From c2ad9e380121d43f8ac066b590f9929a56bd1b0f Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 17 Feb 2010 16:41:30 +0100 Subject: util: new util_format_get_nr_components helper --- src/gallium/auxiliary/util/u_format.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 2fbbb83d4b..6345a11a8c 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -404,6 +404,23 @@ util_format_has_alpha(enum pipe_format format) } } +/** + * Return the number of components stored. + * Formats with block size != 1x1 will always have 1 component (the block). + */ +static INLINE unsigned +util_format_get_nr_components(enum pipe_format format) +{ + const struct util_format_description *desc = util_format_description(format); + unsigned chan; + unsigned nr_comp = 0; + for (chan = 0; chan < 4; chan++) { + if (desc->channel[chan].size != 0) { + nr_comp++; + } + } + return nr_comp; +} /* * Format access functions. -- cgit v1.2.3 From 464a72dd4154f314e08c9d0c4d07417e2bf255f0 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 17 Feb 2010 16:44:38 +0100 Subject: gallium: remove redundant nr_components field from pipe_vertex_element This is a property of the associated src_format pipe format. Hence use util_format_get_nr_components to query this when necessary instead. --- progs/gallium/python/retrace/interpreter.py | 1 - src/gallium/auxiliary/draw/draw_pt.c | 5 ++--- src/gallium/auxiliary/util/u_draw_quad.c | 1 - src/gallium/auxiliary/util/u_dump_state.c | 1 - src/gallium/auxiliary/vl/vl_compositor.c | 2 -- src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 8 ------- src/gallium/drivers/i965/brw_draw_upload.c | 5 ++++- src/gallium/drivers/nv50/nv50_vbo.c | 27 ++++++++++++++---------- src/gallium/drivers/trace/tr_dump_state.c | 1 - src/gallium/include/pipe/p_state.h | 1 - src/gallium/state_trackers/vega/polygon.c | 1 - src/mesa/state_tracker/st_draw.c | 3 --- src/mesa/state_tracker/st_draw_feedback.c | 1 - 13 files changed, 22 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/progs/gallium/python/retrace/interpreter.py b/progs/gallium/python/retrace/interpreter.py index 2db71a212f..52c08abdd3 100755 --- a/progs/gallium/python/retrace/interpreter.py +++ b/progs/gallium/python/retrace/interpreter.py @@ -551,7 +551,6 @@ class Context(Object): data = vbuf.buffer.read() values = unpack_from(format, data, offset) sys.stdout.write('\t\t{' + ', '.join(map(str, values)) + '},\n') - assert len(values) == velem.nr_components sys.stdout.write('\t},\n') sys.stdout.flush() diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 341353f628..51beba50e4 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -309,9 +309,8 @@ draw_arrays_instanced(struct draw_context *draw, tgsi_dump(draw->vs.vertex_shader->state.tokens, 0); debug_printf("Elements:\n"); for (i = 0; i < draw->pt.nr_vertex_elements; i++) { - debug_printf(" format=%s comps=%u\n", - util_format_name(draw->pt.vertex_element[i].src_format), - draw->pt.vertex_element[i].nr_components); + debug_printf(" format=%s\n", + util_format_name(draw->pt.vertex_element[i].src_format)); } debug_printf("Buffers:\n"); for (i = 0; i < draw->pt.nr_vertex_buffers; i++) { diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c index 14506e8451..36e9a4941f 100644 --- a/src/gallium/auxiliary/util/u_draw_quad.c +++ b/src/gallium/auxiliary/util/u_draw_quad.c @@ -64,7 +64,6 @@ util_draw_vertex_buffer(struct pipe_context *pipe, velements[i].instance_divisor = 0; velements[i].vertex_buffer_index = 0; velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; - velements[i].nr_components = 4; } pipe->set_vertex_elements(pipe, num_attribs, velements); diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c index eaf4ec90f2..196c5e06e9 100644 --- a/src/gallium/auxiliary/util/u_dump_state.c +++ b/src/gallium/auxiliary/util/u_dump_state.c @@ -701,7 +701,6 @@ util_dump_vertex_element(struct os_stream *stream, const struct pipe_vertex_elem util_dump_member(stream, uint, state, src_offset); util_dump_member(stream, uint, state, vertex_buffer_index); - util_dump_member(stream, uint, state, nr_components); util_dump_member(stream, format, state, src_format); diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index ba23435f69..5d61423f9d 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -317,7 +317,6 @@ init_buffers(struct vl_compositor *c) c->vertex_elems[0].src_offset = 0; c->vertex_elems[0].instance_divisor = 0; c->vertex_elems[0].vertex_buffer_index = 0; - c->vertex_elems[0].nr_components = 2; c->vertex_elems[0].src_format = PIPE_FORMAT_R32G32_FLOAT; /* @@ -347,7 +346,6 @@ init_buffers(struct vl_compositor *c) c->vertex_elems[1].src_offset = 0; c->vertex_elems[1].instance_divisor = 0; c->vertex_elems[1].vertex_buffer_index = 1; - c->vertex_elems[1].nr_components = 2; c->vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT; /* diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index f323de0ea5..6b9ecd4268 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -892,56 +892,48 @@ init_buffers(struct vl_mpeg12_mc_renderer *r) r->vertex_elems[0].src_offset = 0; r->vertex_elems[0].instance_divisor = 0; r->vertex_elems[0].vertex_buffer_index = 0; - r->vertex_elems[0].nr_components = 2; r->vertex_elems[0].src_format = PIPE_FORMAT_R32G32_FLOAT; /* Luma, texcoord element */ r->vertex_elems[1].src_offset = sizeof(struct vertex2f); r->vertex_elems[1].instance_divisor = 0; r->vertex_elems[1].vertex_buffer_index = 0; - r->vertex_elems[1].nr_components = 2; r->vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT; /* Chroma Cr texcoord element */ r->vertex_elems[2].src_offset = sizeof(struct vertex2f) * 2; r->vertex_elems[2].instance_divisor = 0; r->vertex_elems[2].vertex_buffer_index = 0; - r->vertex_elems[2].nr_components = 2; r->vertex_elems[2].src_format = PIPE_FORMAT_R32G32_FLOAT; /* Chroma Cb texcoord element */ r->vertex_elems[3].src_offset = sizeof(struct vertex2f) * 3; r->vertex_elems[3].instance_divisor = 0; r->vertex_elems[3].vertex_buffer_index = 0; - r->vertex_elems[3].nr_components = 2; r->vertex_elems[3].src_format = PIPE_FORMAT_R32G32_FLOAT; /* First ref surface top field texcoord element */ r->vertex_elems[4].src_offset = 0; r->vertex_elems[4].instance_divisor = 0; r->vertex_elems[4].vertex_buffer_index = 1; - r->vertex_elems[4].nr_components = 2; r->vertex_elems[4].src_format = PIPE_FORMAT_R32G32_FLOAT; /* First ref surface bottom field texcoord element */ r->vertex_elems[5].src_offset = sizeof(struct vertex2f); r->vertex_elems[5].instance_divisor = 0; r->vertex_elems[5].vertex_buffer_index = 1; - r->vertex_elems[5].nr_components = 2; r->vertex_elems[5].src_format = PIPE_FORMAT_R32G32_FLOAT; /* Second ref surface top field texcoord element */ r->vertex_elems[6].src_offset = 0; r->vertex_elems[6].instance_divisor = 0; r->vertex_elems[6].vertex_buffer_index = 2; - r->vertex_elems[6].nr_components = 2; r->vertex_elems[6].src_format = PIPE_FORMAT_R32G32_FLOAT; /* Second ref surface bottom field texcoord element */ r->vertex_elems[7].src_offset = sizeof(struct vertex2f); r->vertex_elems[7].instance_divisor = 0; r->vertex_elems[7].vertex_buffer_index = 2; - r->vertex_elems[7].nr_components = 2; r->vertex_elems[7].src_format = PIPE_FORMAT_R32G32_FLOAT; r->vs_const_buf = pipe_buffer_create diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c index d59261557b..9eafdd4085 100644 --- a/src/gallium/drivers/i965/brw_draw_upload.c +++ b/src/gallium/drivers/i965/brw_draw_upload.c @@ -30,6 +30,7 @@ #include "util/u_upload_mgr.h" #include "util/u_math.h" +#include "util/u_format.h" #include "brw_draw.h" #include "brw_defines.h" @@ -352,13 +353,15 @@ static int brw_emit_vertex_elements(struct brw_context *brw) OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + nr * 2) - 2)); for (i = 0; i < nr; i++) { const struct pipe_vertex_element *input = &brw->curr.vertex_element[i]; + unsigned nr_components = util_format_get_nr_components(input->src_format); + uint32_t format = brw_translate_surface_format( input->src_format ); uint32_t comp0 = BRW_VE1_COMPONENT_STORE_SRC; uint32_t comp1 = BRW_VE1_COMPONENT_STORE_SRC; uint32_t comp2 = BRW_VE1_COMPONENT_STORE_SRC; uint32_t comp3 = BRW_VE1_COMPONENT_STORE_SRC; - switch (input->nr_components) { + switch (nr_components) { case 0: comp0 = BRW_VE1_COMPONENT_STORE_0; case 1: comp1 = BRW_VE1_COMPONENT_STORE_0; case 2: comp2 = BRW_VE1_COMPONENT_STORE_0; diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 1c8ee0b9ad..909d323e05 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -139,15 +139,16 @@ nv50_vbo_vtxelt_to_hw(struct pipe_vertex_element *ve) uint32_t hw_type, hw_size; enum pipe_format pf = ve->src_format; const struct util_format_description *desc; - unsigned size; + unsigned size, nr_components; desc = util_format_description(pf); assert(desc); size = util_format_get_component_bits(pf, UTIL_FORMAT_COLORSPACE_RGB, 0); + nr_components = util_format_get_nr_components(pf); hw_type = nv50_vbo_type_to_hw(pf); - hw_size = nv50_vbo_size_to_hw(size, ve->nr_components); + hw_size = nv50_vbo_size_to_hw(size, nr_components); if (!hw_type || !hw_size) { NOUVEAU_ERR("unsupported vbo format: %s\n", util_format_name(pf)); @@ -222,11 +223,13 @@ nv50_set_static_vtxattr(struct nv50_context *nv50, unsigned i, void *data) struct nouveau_grobj *tesla = nv50->screen->tesla; struct nouveau_channel *chan = tesla->channel; float v[4]; + unsigned nr_components = util_format_get_nr_components(nv50->vtxelt[i].src_format); + util_format_read_4f(nv50->vtxelt[i].src_format, v, 0, data, 0, 0, 0, 1, 1); - switch (nv50->vtxelt[i].nr_components) { + switch (nr_components) { case 4: BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_4F_X(i), 4); OUT_RINGf (chan, v[0]); @@ -726,6 +729,7 @@ nv50_vbo_static_attrib(struct nv50_context *nv50, unsigned attrib, struct nouveau_bo *bo = nouveau_bo(vb->buffer); float v[4]; int ret; + unsigned nr_components = util_format_get_nr_components(ve->src_format); ret = nouveau_bo_map(bo, NOUVEAU_BO_RD); if (ret) @@ -738,7 +742,7 @@ nv50_vbo_static_attrib(struct nv50_context *nv50, unsigned attrib, if (!so) *pso = so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 4, 0); - switch (ve->nr_components) { + switch (nr_components) { case 4: so_method(so, tesla, NV50TCL_VTX_ATTR_4F_X(attrib), 4); so_data (so, fui(v[0])); @@ -1019,7 +1023,7 @@ emit_prepare(struct nv50_context *nv50, struct nv50_vbo_emitctx *emit, for (i = 0; i < nv50->vtxelt_nr; ++i) { struct pipe_vertex_element *ve; struct pipe_vertex_buffer *vb; - unsigned n, size; + unsigned n, size, nr_components; const struct util_format_description *desc; ve = &nv50->vtxelt[i]; @@ -1038,8 +1042,9 @@ emit_prepare(struct nv50_context *nv50, struct nv50_vbo_emitctx *emit, size = util_format_get_component_bits( ve->src_format, UTIL_FORMAT_COLORSPACE_RGB, 0); + nr_components = util_format_get_nr_components(ve->src_format); - assert(ve->nr_components > 0 && ve->nr_components <= 4); + assert(nr_components > 0 && nr_components <= 4); /* It shouldn't be necessary to push the implicit 1s * for case 3 and size 8 cases 1, 2, 3. @@ -1049,25 +1054,25 @@ emit_prepare(struct nv50_context *nv50, struct nv50_vbo_emitctx *emit, NOUVEAU_ERR("unsupported vtxelt size: %u\n", size); return FALSE; case 32: - switch (ve->nr_components) { + switch (nr_components) { case 1: emit->push[n] = emit_b32_1; break; case 2: emit->push[n] = emit_b32_2; break; case 3: emit->push[n] = emit_b32_3; break; case 4: emit->push[n] = emit_b32_4; break; } - emit->vtx_dwords += ve->nr_components; + emit->vtx_dwords += nr_components; break; case 16: - switch (ve->nr_components) { + switch (nr_components) { case 1: emit->push[n] = emit_b16_1; break; case 2: emit->push[n] = emit_b32_1; break; case 3: emit->push[n] = emit_b16_3; break; case 4: emit->push[n] = emit_b32_2; break; } - emit->vtx_dwords += (ve->nr_components + 1) >> 1; + emit->vtx_dwords += (nr_components + 1) >> 1; break; case 8: - switch (ve->nr_components) { + switch (nr_components) { case 1: emit->push[n] = emit_b08_1; break; case 2: emit->push[n] = emit_b16_1; break; case 3: emit->push[n] = emit_b08_3; break; diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index 6da186a655..b9ccc0ca69 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -480,7 +480,6 @@ void trace_dump_vertex_element(const struct pipe_vertex_element *state) trace_dump_member(uint, state, src_offset); trace_dump_member(uint, state, vertex_buffer_index); - trace_dump_member(uint, state, nr_components); trace_dump_member(format, state, src_format); diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 5ac5c87813..5670f7a088 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -383,7 +383,6 @@ struct pipe_vertex_element * this attribute live in? */ unsigned vertex_buffer_index:8; - unsigned nr_components:8; enum pipe_format src_format; /**< PIPE_FORMAT_* */ }; diff --git a/src/gallium/state_trackers/vega/polygon.c b/src/gallium/state_trackers/vega/polygon.c index c06dbf5206..96fbbfc85a 100644 --- a/src/gallium/state_trackers/vega/polygon.c +++ b/src/gallium/state_trackers/vega/polygon.c @@ -296,7 +296,6 @@ static void draw_polygon(struct vg_context *ctx, velement.instance_divisor = 0; velement.vertex_buffer_index = 0; velement.src_format = PIPE_FORMAT_R32G32_FLOAT; - velement.nr_components = COMPONENTS; pipe->set_vertex_elements(pipe, 1, &velement); /* draw */ diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 4b48c168e9..397dddbb47 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -368,7 +368,6 @@ setup_interleaved_attribs(GLcontext *ctx, (unsigned) (arrays[mesaAttr]->Ptr - offset0); velements[attr].instance_divisor = 0; velements[attr].vertex_buffer_index = 0; - velements[attr].nr_components = arrays[mesaAttr]->Size; velements[attr].src_format = st_pipe_vertex_format(arrays[mesaAttr]->Type, arrays[mesaAttr]->Size, @@ -458,7 +457,6 @@ setup_non_interleaved_attribs(GLcontext *ctx, vbuffer[attr].max_index = max_index; velements[attr].instance_divisor = 0; velements[attr].vertex_buffer_index = attr; - velements[attr].nr_components = arrays[mesaAttr]->Size; velements[attr].src_format = st_pipe_vertex_format(arrays[mesaAttr]->Type, arrays[mesaAttr]->Size, @@ -596,7 +594,6 @@ st_draw_vbo(GLcontext *ctx, for (i = 0; i < num_velements; i++) { printf("vlements[%d].vbuffer_index = %u\n", i, velements[i].vertex_buffer_index); printf("vlements[%d].src_offset = %u\n", i, velements[i].src_offset); - printf("vlements[%d].nr_comps = %u\n", i, velements[i].nr_components); printf("vlements[%d].format = %s\n", i, util_format_name(velements[i].src_format)); } } diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index 087f2f22bb..26a5b3fcd6 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -178,7 +178,6 @@ st_feedback_draw_vbo(GLcontext *ctx, vbuffers[attr].max_index = max_index; velements[attr].instance_divisor = 0; velements[attr].vertex_buffer_index = attr; - velements[attr].nr_components = arrays[mesaAttr]->Size; velements[attr].src_format = st_pipe_vertex_format(arrays[mesaAttr]->Type, arrays[mesaAttr]->Size, -- cgit v1.2.3 From 0aa610571162eafc8c31c3d26c3676b6aead82df Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 18 Feb 2010 07:49:14 -0500 Subject: intel: Include main/hash.h using "" instead of <> --- src/mesa/drivers/dri/intel/intel_regions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index 62b4ce61e4..f63d3a4082 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -42,7 +42,7 @@ #include #include -#include
+#include "main/hash.h" #include "intel_context.h" #include "intel_regions.h" #include "intel_blit.h" -- cgit v1.2.3 From 196214bf2b677a83653d49f79d03752f29df44ec Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 18 Feb 2010 13:37:09 +0100 Subject: Revert "st/mesa: Make the frontbuffer visible on st_flush(PIPE_FLUSH_FRAME)." We probably don't want to propagate this condition to the pipe driver, this reverts commit f455ca6490fcb65781b21f81c7117bd923e250d1 and the dri_update_buffer flush altogether until an agreement is reached. --- src/gallium/state_trackers/dri/dri_drawable.c | 2 -- src/mesa/state_tracker/st_cb_flush.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 195ae7b8bc..8843e087a8 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -288,8 +288,6 @@ dri_update_buffer(struct pipe_screen *screen, void *context_private) ctx->r_stamp == *ctx->rPriv->pStamp) return; - st_flush(ctx->st, PIPE_FLUSH_FRAME, NULL); - ctx->d_stamp = *ctx->dPriv->pStamp; ctx->r_stamp = *ctx->rPriv->pStamp; diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c index 573c78336c..1329f807bc 100644 --- a/src/mesa/state_tracker/st_cb_flush.c +++ b/src/mesa/state_tracker/st_cb_flush.c @@ -102,10 +102,6 @@ void st_flush( struct st_context *st, uint pipeFlushFlags, util_gen_mipmap_flush(st->gen_mipmap); st->pipe->flush( st->pipe, pipeFlushFlags, fence ); - - if ((pipeFlushFlags & PIPE_FLUSH_FRAME) && - is_front_buffer_dirty(st)) - display_front_buffer(st); } @@ -139,6 +135,10 @@ static void st_glFlush(GLcontext *ctx) * problems that need to be fixed elsewhere. */ st_flush(st, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL); + + if (is_front_buffer_dirty(st)) { + display_front_buffer(st); + } } @@ -150,6 +150,10 @@ static void st_glFinish(GLcontext *ctx) struct st_context *st = ctx->st; st_finish(st); + + if (is_front_buffer_dirty(st)) { + display_front_buffer(st); + } } -- cgit v1.2.3 From 51d139f03898e5e46af6363c6bba131455738cc4 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 18 Feb 2010 16:36:25 +0100 Subject: gallium: use cso state handling for pipe_vertex_element state --- src/gallium/auxiliary/cso_cache/cso_cache.c | 21 ++++++++ src/gallium/auxiliary/cso_cache/cso_cache.h | 11 +++- src/gallium/auxiliary/cso_cache/cso_context.c | 74 +++++++++++++++++++++++++++ src/gallium/auxiliary/cso_cache/cso_context.h | 7 ++- src/gallium/include/pipe/p_context.h | 9 ++-- 5 files changed, 117 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.c b/src/gallium/auxiliary/cso_cache/cso_cache.c index a6a07e72c2..900c64df4b 100644 --- a/src/gallium/auxiliary/cso_cache/cso_cache.c +++ b/src/gallium/auxiliary/cso_cache/cso_cache.c @@ -43,6 +43,7 @@ struct cso_cache { struct cso_hash *vs_hash; struct cso_hash *rasterizer_hash; struct cso_hash *sampler_hash; + struct cso_hash *velements_hash; int max_size; cso_sanitize_callback sanitize_cb; @@ -108,6 +109,9 @@ static struct cso_hash *_cso_hash_for_type(struct cso_cache *sc, enum cso_cache_ case CSO_VERTEX_SHADER: hash = sc->vs_hash; break; + case CSO_VELEMENTS: + hash = sc->velements_hash; + break; } return hash; @@ -161,6 +165,13 @@ static void delete_vs_state(void *state, void *data) FREE(state); } +static void delete_velements(void *state, void *data) +{ + struct cso_velements *cso = (struct cso_velements *)state; + if (cso->delete_state) + cso->delete_state(cso->context, cso->data); + FREE(state); +} static INLINE void delete_cso(void *state, enum cso_cache_type type) { @@ -183,6 +194,9 @@ static INLINE void delete_cso(void *state, enum cso_cache_type type) case CSO_VERTEX_SHADER: delete_vs_state(state, 0); break; + case CSO_VELEMENTS: + delete_velements(state, 0); + break; default: assert(0); FREE(state); @@ -294,6 +308,7 @@ struct cso_cache *cso_cache_create(void) sc->rasterizer_hash = cso_hash_create(); sc->fs_hash = cso_hash_create(); sc->vs_hash = cso_hash_create(); + sc->velements_hash = cso_hash_create(); sc->sanitize_cb = sanitize_cb; sc->sanitize_data = 0; @@ -325,6 +340,9 @@ void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type, case CSO_VERTEX_SHADER: hash = sc->vs_hash; break; + case CSO_VELEMENTS: + hash = sc->velements_hash; + break; } iter = cso_hash_first_node(hash); @@ -351,6 +369,7 @@ void cso_cache_delete(struct cso_cache *sc) cso_for_each_state(sc, CSO_VERTEX_SHADER, delete_vs_state, 0); cso_for_each_state(sc, CSO_RASTERIZER, delete_rasterizer_state, 0); cso_for_each_state(sc, CSO_SAMPLER, delete_sampler_state, 0); + cso_for_each_state(sc, CSO_VELEMENTS, delete_velements, 0); cso_hash_delete(sc->blend_hash); cso_hash_delete(sc->sampler_hash); @@ -358,6 +377,7 @@ void cso_cache_delete(struct cso_cache *sc) cso_hash_delete(sc->rasterizer_hash); cso_hash_delete(sc->fs_hash); cso_hash_delete(sc->vs_hash); + cso_hash_delete(sc->velements_hash); FREE(sc); } @@ -372,6 +392,7 @@ void cso_set_maximum_cache_size(struct cso_cache *sc, int number) sanitize_hash(sc, sc->vs_hash, CSO_VERTEX_SHADER, sc->max_size); sanitize_hash(sc, sc->rasterizer_hash, CSO_RASTERIZER, sc->max_size); sanitize_hash(sc, sc->sampler_hash, CSO_SAMPLER, sc->max_size); + sanitize_hash(sc, sc->velements_hash, CSO_VELEMENTS, sc->max_size); } int cso_maximum_cache_size(const struct cso_cache *sc) diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.h b/src/gallium/auxiliary/cso_cache/cso_cache.h index eea60b940b..d884d5410f 100644 --- a/src/gallium/auxiliary/cso_cache/cso_cache.h +++ b/src/gallium/auxiliary/cso_cache/cso_cache.h @@ -53,6 +53,7 @@ * - rasterizer (old setup) * - sampler * - vertex shader + * - vertex elements * * Things that are not constant state objects include: * - blend_color @@ -90,7 +91,8 @@ enum cso_cache_type { CSO_DEPTH_STENCIL_ALPHA, CSO_RASTERIZER, CSO_FRAGMENT_SHADER, - CSO_VERTEX_SHADER + CSO_VERTEX_SHADER, + CSO_VELEMENTS }; typedef void (*cso_state_callback)(void *ctx, void *obj); @@ -144,6 +146,13 @@ struct cso_sampler { struct pipe_context *context; }; +struct cso_velements { + struct pipe_vertex_element state[PIPE_MAX_ATTRIBS]; + void *data; + cso_state_callback delete_state; + struct pipe_context *context; +}; + unsigned cso_construct_key(void *item, int item_size); struct cso_cache *cso_cache_create(void); diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index b5241fa64c..95e3c18e53 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -89,6 +89,7 @@ struct cso_context { void *rasterizer, *rasterizer_saved; void *fragment_shader, *fragment_shader_saved, *geometry_shader; void *vertex_shader, *vertex_shader_saved, *geometry_shader_saved; + void *velements, *velements_saved; struct pipe_framebuffer_state fb, fb_saved; struct pipe_viewport_state vp, vp_saved; @@ -171,6 +172,20 @@ static boolean delete_vs_state(struct cso_context *ctx, void *state) return FALSE; } +static boolean delete_vertex_elements(struct cso_context *ctx, + void *state) +{ + struct cso_velements *cso = (struct cso_velements *)state; + + if (ctx->velements == cso->data) + return FALSE; + + if (cso->delete_state) + cso->delete_state(cso->context, cso->data); + FREE(state); + return TRUE; +} + static INLINE boolean delete_cso(struct cso_context *ctx, void *state, enum cso_cache_type type) @@ -194,6 +209,9 @@ static INLINE boolean delete_cso(struct cso_context *ctx, case CSO_VERTEX_SHADER: return delete_vs_state(ctx, state); break; + case CSO_VELEMENTS: + return delete_vertex_elements(ctx, state); + break; default: assert(0); FREE(state); @@ -1126,3 +1144,59 @@ void cso_restore_geometry_shader(struct cso_context *ctx) } ctx->geometry_shader_saved = NULL; } + +enum pipe_error cso_set_vertex_elements(struct cso_context *ctx, + unsigned count, + const struct pipe_vertex_element *states) +{ + unsigned key_size, hash_key; + struct cso_hash_iter iter; + void *handle; + + key_size = sizeof(struct pipe_vertex_element) * count; + hash_key = cso_construct_key((void*)states, key_size); + iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS, (void*)states, key_size); + + if (cso_hash_iter_is_null(iter)) { + struct cso_velements *cso = MALLOC(sizeof(struct cso_velements)); + if (!cso) + return PIPE_ERROR_OUT_OF_MEMORY; + + memcpy(&cso->state, states, key_size); + cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count, &cso->state[0]); + cso->delete_state = (cso_state_callback)ctx->pipe->delete_vertex_elements_state; + cso->context = ctx->pipe; + + iter = cso_insert_state(ctx->cache, hash_key, CSO_VELEMENTS, cso); + if (cso_hash_iter_is_null(iter)) { + FREE(cso); + return PIPE_ERROR_OUT_OF_MEMORY; + } + + handle = cso->data; + } + else { + handle = ((struct cso_velements *)cso_hash_iter_data(iter))->data; + } + + if (ctx->velements != handle) { + ctx->velements = handle; + ctx->pipe->bind_vertex_elements_state(ctx->pipe, handle); + } + return PIPE_OK; +} + +void cso_save_vertex_elements(struct cso_context *ctx) +{ + assert(!ctx->velements); + ctx->velements_saved = ctx->velements; +} + +void cso_restore_vertex_elements(struct cso_context *ctx) +{ + if (ctx->velements != ctx->velements_saved) { + ctx->velements = ctx->velements_saved; + ctx->pipe->bind_vertex_elements_state(ctx->pipe, ctx->velements_saved); + } + ctx->velements_saved = NULL; +} \ No newline at end of file diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h index 707b3c2cee..2caa587516 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.h +++ b/src/gallium/auxiliary/cso_cache/cso_context.h @@ -122,6 +122,12 @@ void cso_restore_vertex_sampler_textures(struct cso_context *cso); +enum pipe_error cso_set_vertex_elements(struct cso_context *ctx, + unsigned count, + const struct pipe_vertex_element *states); +void cso_save_vertex_elements(struct cso_context *ctx); +void cso_restore_vertex_elements(struct cso_context *ctx); + /* These aren't really sensible -- most of the time the api provides * object semantics for shaders anyway, and the cases where it doesn't @@ -157,7 +163,6 @@ void cso_save_geometry_shader(struct cso_context *cso); void cso_restore_geometry_shader(struct cso_context *cso); - enum pipe_error cso_set_framebuffer(struct cso_context *cso, const struct pipe_framebuffer_state *fb); void cso_save_framebuffer(struct cso_context *cso); diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index f82b77903e..376b01aa69 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -177,6 +177,12 @@ struct pipe_context { void (*bind_gs_state)(struct pipe_context *, void *); void (*delete_gs_state)(struct pipe_context *, void *); + void * (*create_vertex_elements_state)(struct pipe_context *, + unsigned num_elements, + const struct pipe_vertex_element *); + void (*bind_vertex_elements_state)(struct pipe_context *, void *); + void (*delete_vertex_elements_state)(struct pipe_context *, void *); + /*@}*/ /** @@ -220,9 +226,6 @@ struct pipe_context { unsigned num_buffers, const struct pipe_vertex_buffer * ); - void (*set_vertex_elements)( struct pipe_context *, - unsigned num_elements, - const struct pipe_vertex_element * ); /*@}*/ -- cgit v1.2.3 From a61dce363929bbc3520f91cefa3ba15bbe31c5bd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Feb 2010 09:40:38 -0700 Subject: swrast: fix left side clipping Fixes bug 26623. Original patch was submitted by Mathias Frohlich and modified by Brian. (cherry picked from commit 7c34c237a2f6732b2c013543523617e375c1f534) --- src/mesa/swrast/s_span.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 905cf3d550..85d30cc929 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -783,15 +783,48 @@ clip_span( GLcontext *ctx, SWspan *span ) * fragment attributes. * For arrays of values, shift them left. */ + for (i = 0; i < FRAG_ATTRIB_MAX; i++) { + if (span->interpMask & (1 << i)) { + GLuint j; + for (j = 0; j < 4; j++) { + span->attrStart[i][j] += leftClip * span->attrStepX[i][j]; + } + } + } + + span->red += leftClip * span->redStep; + span->green += leftClip * span->greenStep; + span->blue += leftClip * span->blueStep; + span->alpha += leftClip * span->alphaStep; + span->index += leftClip * span->indexStep; + span->z += leftClip * span->zStep; + span->intTex[0] += leftClip * span->intTexStep[0]; + span->intTex[1] += leftClip * span->intTexStep[1]; + +#define SHIFT_ARRAY(ARRAY, SHIFT, LEN) \ + memcpy(ARRAY, ARRAY + (SHIFT), (LEN) * sizeof(ARRAY[0])) + for (i = 0; i < FRAG_ATTRIB_MAX; i++) { if (span->arrayAttribs & (1 << i)) { /* shift array elements left by 'leftClip' */ - _mesa_memcpy(span->array->attribs[i], - span->array->attribs[i] + leftClip, - (n - leftClip) * 4 * sizeof(GLfloat)); + SHIFT_ARRAY(span->array->attribs[i], leftClip, n - leftClip); } } + SHIFT_ARRAY(span->array->mask, leftClip, n - leftClip); + SHIFT_ARRAY(span->array->rgba8, leftClip, n - leftClip); + SHIFT_ARRAY(span->array->rgba16, leftClip, n - leftClip); + SHIFT_ARRAY(span->array->x, leftClip, n - leftClip); + SHIFT_ARRAY(span->array->y, leftClip, n - leftClip); + SHIFT_ARRAY(span->array->z, leftClip, n - leftClip); + SHIFT_ARRAY(span->array->index, leftClip, n - leftClip); + for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { + SHIFT_ARRAY(span->array->lambda[i], leftClip, n - leftClip); + } + SHIFT_ARRAY(span->array->coverage, leftClip, n - leftClip); + +#undef SHIFT_ARRAY + span->leftClip = leftClip; span->x = xmin; span->end -= leftClip; -- cgit v1.2.3 From b69dad2921e4477ce721649e4771e73ea453a03b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Feb 2010 12:54:28 -0700 Subject: mesa: silence mklib output for libglapi.c as for other targets --- src/mesa/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/Makefile b/src/mesa/Makefile index f845d93fbd..0cb49e803f 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -38,7 +38,7 @@ libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) # Make archive of gl* API dispatcher functions only libglapi.a: $(GLAPI_OBJECTS) - $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) + @ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) ###################################################################### # Device drivers -- cgit v1.2.3 From 0032525242950bae197b267794193cdcb611c376 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Thu, 18 Feb 2010 14:58:17 -0800 Subject: i915: update render buffers at prepare_render time We need to do this before we emit any state dependent on the current render buffers. --- src/mesa/drivers/dri/i915/i915_vtbl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 392126b7dc..30aaab78c8 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -55,6 +55,7 @@ i915_render_prevalidate(struct intel_context *intel) static void i915_render_start(struct intel_context *intel) { + intel_prepare_render(intel); } -- cgit v1.2.3 From 1ee905bc47272bb5eec1fd7d43cf55b07cb620ca Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 18 Feb 2010 22:42:31 +0000 Subject: pipebuffer: Include fenced buffer manager in build --- src/gallium/auxiliary/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index ff7695150e..916f5f6c91 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -54,6 +54,7 @@ C_SOURCES = \ os/os_stream_str.c \ os/os_stream_null.c \ os/os_time.c \ + pipebuffer/pb_buffer_fenced.c \ pipebuffer/pb_buffer_malloc.c \ pipebuffer/pb_bufmgr_alt.c \ pipebuffer/pb_bufmgr_cache.c \ -- cgit v1.2.3 From 288e4b15e08fc4c9c94f4a09885cc2c2a073bc3c Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 18 Feb 2010 23:13:47 +0000 Subject: trace: Propagate api->name up --- src/gallium/drivers/trace/tr_drm.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/drivers/trace/tr_drm.c b/src/gallium/drivers/trace/tr_drm.c index 919dc1b309..b8adde77f1 100644 --- a/src/gallium/drivers/trace/tr_drm.c +++ b/src/gallium/drivers/trace/tr_drm.c @@ -155,6 +155,7 @@ trace_drm_create(struct drm_api *api) if (!tr_api) goto error; + tr_api->base.name = api->name; tr_api->base.driver_name = api->driver_name; tr_api->base.create_screen = trace_drm_create_screen; tr_api->base.texture_from_shared_handle = trace_drm_texture_from_shared_handle; -- cgit v1.2.3 From 2ecdc2ecec6c371439ea21ed40de090f822dd728 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 18 Feb 2010 23:14:11 +0000 Subject: identity: Propagate api->name and api->driver_name up --- src/gallium/drivers/identity/id_drm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/identity/id_drm.c b/src/gallium/drivers/identity/id_drm.c index 12b516b445..b89724e4f3 100644 --- a/src/gallium/drivers/identity/id_drm.c +++ b/src/gallium/drivers/identity/id_drm.c @@ -142,6 +142,8 @@ identity_drm_create(struct drm_api *api) if (!id_api) goto error; + id_api->base.name = api->name; + id_api->base.driver_name = api->driver_name; id_api->base.create_screen = identity_drm_create_screen; id_api->base.texture_from_shared_handle = identity_drm_texture_from_shared_handle; id_api->base.shared_handle_from_texture = identity_drm_shared_handle_from_texture; -- cgit v1.2.3 From 46b5ae71697fd04de103d628d30501fa1a4e59ad Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Feb 2010 16:32:36 -0700 Subject: softpipe: const qualifiers, comments --- src/gallium/drivers/softpipe/sp_setup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_setup.c b/src/gallium/drivers/softpipe/sp_setup.c index b8590a8cc2..85966bc5e4 100644 --- a/src/gallium/drivers/softpipe/sp_setup.c +++ b/src/gallium/drivers/softpipe/sp_setup.c @@ -211,11 +211,11 @@ static void flush_spans( struct setup_context *setup ) const int xright1 = setup->span.right[1]; struct quad_stage *pipe = setup->softpipe->quad.first; - - int minleft = block_x(MIN2(xleft0, xleft1)); - int maxright = MAX2(xright0, xright1); + const int minleft = block_x(MIN2(xleft0, xleft1)); + const int maxright = MAX2(xright0, xright1); int x; + /* process quads in horizontal chunks of 16 */ for (x = minleft; x < maxright; x += step) { unsigned skip_left0 = CLAMP(xleft0 - x, 0, step); unsigned skip_left1 = CLAMP(xleft1 - x, 0, step); -- cgit v1.2.3 From 00d1d8aad3b97899e3fab1cc4e4296c3f6ee8513 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Feb 2010 16:33:26 -0700 Subject: softpipe: comments and whitespace fixes --- src/gallium/drivers/softpipe/sp_quad_fs.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_quad_fs.c b/src/gallium/drivers/softpipe/sp_quad_fs.c index ad04dc2afc..8ae5a7f028 100644 --- a/src/gallium/drivers/softpipe/sp_quad_fs.c +++ b/src/gallium/drivers/softpipe/sp_quad_fs.c @@ -65,6 +65,7 @@ quad_shade_stage(struct quad_stage *qs) /** * Execute fragment shader for the four fragments in the quad. + * \return TRUE if quad is alive, FALSE if all four pixels are killed */ static INLINE boolean shade_quad(struct quad_stage *qs, struct quad_header *quad) @@ -98,11 +99,14 @@ coverage_quad(struct quad_stage *qs, struct quad_header *quad) } - +/** + * Shade/write an array of quads + * Called via quad_stage::run() + */ static void shade_quads(struct quad_stage *qs, - struct quad_header *quads[], - unsigned nr) + struct quad_header *quads[], + unsigned nr) { struct quad_shade_stage *qss = quad_shade_stage( qs ); struct softpipe_context *softpipe = qs->softpipe; @@ -116,7 +120,7 @@ shade_quads(struct quad_stage *qs, for (i = 0; i < nr; i++) { if (!shade_quad(qs, quads[i])) - continue; + continue; /* quad totally culled/killed */ if (/*do_coverage*/ 0) coverage_quad( qs, quads[i] ); @@ -129,9 +133,6 @@ shade_quads(struct quad_stage *qs, } - - - /** * Per-primitive (or per-begin?) setup */ -- cgit v1.2.3 From 0c728030ed76d8b79876b8606cb0486bff96750c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Feb 2010 16:56:38 -0700 Subject: st/mesa: added some bitmap debug code (disabled) --- src/mesa/state_tracker/st_cb_bitmap.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 25430bba77..e029ea7ffc 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -536,9 +536,29 @@ reset_cache(struct st_context *st) st->bitmap.tex_format, 0, BITMAP_CACHE_WIDTH, BITMAP_CACHE_HEIGHT, 1, PIPE_TEXTURE_USAGE_SAMPLER); +} + +/** Print bitmap image to stdout (debug) */ +static void +print_cache(const struct bitmap_cache *cache) +{ + int i, j, k; + + for (i = 0; i < BITMAP_CACHE_HEIGHT; i++) { + k = BITMAP_CACHE_WIDTH * (BITMAP_CACHE_HEIGHT - i - 1); + for (j = 0; j < BITMAP_CACHE_WIDTH; j++) { + if (cache->buffer[k]) + printf("X"); + else + printf(" "); + k++; + } + printf("\n"); + } } + static void create_cache_trans(struct st_context *st) { @@ -588,6 +608,8 @@ st_flush_bitmap_cache(struct st_context *st) * So unmap and release the texture transfer before drawing. */ if (cache->trans) { + if (0) + print_cache(cache); screen->transfer_unmap(screen, cache->trans); cache->buffer = NULL; -- cgit v1.2.3 From ae7a7026c77c68748fedb60e5deb7649e894da40 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 18 Feb 2010 17:00:10 -0700 Subject: softpipe: fix depth testing problems The optimized Z-test functions assumed that the array of incoming quads are adjacent, but that's not always true. The fragment shader can cull intermediate quads, for example. Now these Z-test functions can cope with non-adjacent quads. A little bit of performance is probably lost, but it's probably not worth worring about. This fixes broken glBitmap() Z testing, among other things. (cherry picked from commit d437d905e6924ebc05ec9efe87e1e2c48d75bc13) --- src/gallium/drivers/softpipe/sp_quad_depth_test.c | 89 ++++++++++++++--------- 1 file changed, 53 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index 499eebd671..dab9565443 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -728,9 +728,14 @@ depth_test_quads_fallback(struct quad_stage *qs, qs->next->run(qs->next, quads, nr); } -/* XXX: this function assumes setup function actually emits linear - * spans of quads. It seems a lot more natural to do (early) - * depth-testing on spans rather than quads. + +/** + * Special-case Z testing for 16-bit Zbuffer, PIPE_FUNC_LESS and + * Z buffer writes enabled. + * + * NOTE: there's no guarantee that the quads are sequentially side by + * side. The fragment shader may have culled some quads, etc. Sliver + * triangles may generate non-sequential quads. */ static void depth_interp_z16_less_write(struct quad_stage *qs, @@ -747,25 +752,33 @@ depth_interp_z16_less_write(struct quad_stage *qs, const float z0 = quads[0]->posCoef->a0[2] + dzdx * fx + dzdy * fy; struct softpipe_cached_tile *tile; ushort (*depth16)[TILE_SIZE]; - ushort idepth[4], depth_step; + ushort init_idepth[4], idepth[4], depth_step; const float scale = 65535.0; - idepth[0] = (ushort)((z0) * scale); - idepth[1] = (ushort)((z0 + dzdx) * scale); - idepth[2] = (ushort)((z0 + dzdy) * scale); - idepth[3] = (ushort)((z0 + dzdx + dzdy) * scale); + /* compute scaled depth of the four pixels in first quad */ + init_idepth[0] = (ushort)((z0) * scale); + init_idepth[1] = (ushort)((z0 + dzdx) * scale); + init_idepth[2] = (ushort)((z0 + dzdy) * scale); + init_idepth[3] = (ushort)((z0 + dzdx + dzdy) * scale); - depth_step = (ushort)(dzdx * 2 * scale); + depth_step = (ushort)(dzdx * scale); tile = sp_get_cached_tile(qs->softpipe->zsbuf_cache, ix, iy); - depth16 = (ushort (*)[TILE_SIZE]) - &tile->data.depth16[iy % TILE_SIZE][ix % TILE_SIZE]; - for (i = 0; i < nr; i++) { - unsigned outmask = quads[i]->inout.mask; + const unsigned outmask = quads[i]->inout.mask; + const int dx = quads[i]->input.x0 - ix; unsigned mask = 0; - + + /* compute depth for this quad */ + idepth[0] = init_idepth[0] + dx * depth_step; + idepth[1] = init_idepth[1] + dx * depth_step; + idepth[2] = init_idepth[2] + dx * depth_step; + idepth[3] = init_idepth[3] + dx * depth_step; + + depth16 = (ushort (*)[TILE_SIZE]) + &tile->data.depth16[iy % TILE_SIZE][(ix + dx)% TILE_SIZE]; + if ((outmask & 1) && idepth[0] < depth16[0][0]) { depth16[0][0] = idepth[0]; mask |= (1 << 0); @@ -786,13 +799,6 @@ depth_interp_z16_less_write(struct quad_stage *qs, mask |= (1 << 3); } - idepth[0] += depth_step; - idepth[1] += depth_step; - idepth[2] += depth_step; - idepth[3] += depth_step; - - depth16 = (ushort (*)[TILE_SIZE]) &depth16[0][2]; - quads[i]->inout.mask = mask; if (quads[i]->inout.mask) quads[pass++] = quads[i]; @@ -804,6 +810,14 @@ depth_interp_z16_less_write(struct quad_stage *qs, } +/** + * Special-case Z testing for 16-bit Zbuffer, PIPE_FUNC_LEQUAL and + * Z buffer writes enabled. + * + * NOTE: there's no guarantee that the quads are sequentially side by + * side. The fragment shader may have culled some quads, etc. Sliver + * triangles may generate non-sequential quads. + */ static void depth_interp_z16_lequal_write(struct quad_stage *qs, struct quad_header *quads[], @@ -819,25 +833,33 @@ depth_interp_z16_lequal_write(struct quad_stage *qs, const float z0 = quads[0]->posCoef->a0[2] + dzdx * fx + dzdy * fy; struct softpipe_cached_tile *tile; ushort (*depth16)[TILE_SIZE]; - ushort idepth[4], depth_step; + ushort init_idepth[4], idepth[4], depth_step; const float scale = 65535.0; - idepth[0] = (ushort)((z0) * scale); - idepth[1] = (ushort)((z0 + dzdx) * scale); - idepth[2] = (ushort)((z0 + dzdy) * scale); - idepth[3] = (ushort)((z0 + dzdx + dzdy) * scale); + /* compute scaled depth of the four pixels in first quad */ + init_idepth[0] = (ushort)((z0) * scale); + init_idepth[1] = (ushort)((z0 + dzdx) * scale); + init_idepth[2] = (ushort)((z0 + dzdy) * scale); + init_idepth[3] = (ushort)((z0 + dzdx + dzdy) * scale); - depth_step = (ushort)(dzdx * 2 * scale); + depth_step = (ushort)(dzdx * scale); tile = sp_get_cached_tile(qs->softpipe->zsbuf_cache, ix, iy); - depth16 = (ushort (*)[TILE_SIZE]) - &tile->data.depth16[iy % TILE_SIZE][ix % TILE_SIZE]; - for (i = 0; i < nr; i++) { - unsigned outmask = quads[i]->inout.mask; + const unsigned outmask = quads[i]->inout.mask; + const int dx = quads[i]->input.x0 - ix; unsigned mask = 0; + /* compute depth for this quad */ + idepth[0] = init_idepth[0] + dx * depth_step; + idepth[1] = init_idepth[1] + dx * depth_step; + idepth[2] = init_idepth[2] + dx * depth_step; + idepth[3] = init_idepth[3] + dx * depth_step; + + depth16 = (ushort (*)[TILE_SIZE]) + &tile->data.depth16[iy % TILE_SIZE][(ix + dx)% TILE_SIZE]; + if ((outmask & 1) && idepth[0] <= depth16[0][0]) { depth16[0][0] = idepth[0]; mask |= (1 << 0); @@ -858,11 +880,6 @@ depth_interp_z16_lequal_write(struct quad_stage *qs, mask |= (1 << 3); } - idepth[0] += depth_step; - idepth[1] += depth_step; - idepth[2] += depth_step; - idepth[3] += depth_step; - depth16 = (ushort (*)[TILE_SIZE]) &depth16[0][2]; quads[i]->inout.mask = mask; -- cgit v1.2.3 From fc427d23439a2702068209957f08990ea29fe21b Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 19 Feb 2010 04:23:06 +0100 Subject: r300g: remove L8_UNORM from colorbuffer formats Not renderable in OpenGL anyway. --- src/gallium/drivers/r300/r300_screen.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 5fa1ea0850..036736ccc4 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -230,7 +230,6 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, /* Supported formats. */ /* Colorbuffer */ case PIPE_FORMAT_A8_UNORM: - case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: case PIPE_FORMAT_A1R5G5B5_UNORM: case PIPE_FORMAT_A4R4G4B4_UNORM: -- cgit v1.2.3 From bef4b476d729320599264483113d577ac5eeaff1 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 19 Feb 2010 12:08:50 +0800 Subject: egl: Silence warnings in check/return macros. The macros give warnings when compiled with -pedantic. This commit is based on a patch by Brian Paul, with minor changes to add do {} while(0) and rename the check macros. --- src/egl/main/eglapi.c | 286 ++++++++++++++++++++++++++------------------------ 1 file changed, 147 insertions(+), 139 deletions(-) (limited to 'src') diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 2de1ac3318..647be65220 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -74,49 +74,57 @@ * * These macros will unlock the display and record the error code. */ -#define _EGL_ERROR(disp, err, ret) \ - ({ \ +#define RETURN_EGL_ERROR(disp, err, ret) \ + do { \ if (disp) \ _eglUnlockDisplay(disp); \ /* EGL error codes are non-zero */ \ if (err) \ _eglError(err, __FUNCTION__); \ - ret; \ - }) -#define _EGL_SUCCESS(disp, ret) _EGL_ERROR(disp, EGL_SUCCESS, ret) + return ret; \ + } while (0) + +#define RETURN_EGL_SUCCESS(disp, ret) \ + RETURN_EGL_ERROR(disp, EGL_SUCCESS, ret) + /* record EGL_SUCCESS only when ret evaluates to true */ -#define _EGL_EVAL(disp, ret) _EGL_ERROR(disp, (ret) ? EGL_SUCCESS : 0, ret) +#define RETURN_EGL_EVAL(disp, ret) \ + RETURN_EGL_ERROR(disp, (ret) ? EGL_SUCCESS : 0, ret) -/** +/* * A bunch of macros and checks to simplify error checking. */ -#define _EGL_CHECK_DISPLAY(disp, ret) \ - ({ \ - _EGLDriver *__drv = _eglCheckDisplay(disp, __FUNCTION__); \ - if (!__drv) \ - return _EGL_ERROR(disp, 0, ret); \ - __drv; \ - }) - - -#define _EGL_CHECK_OBJECT(disp, type, obj, ret) \ - ({ \ - _EGLDriver *__drv = _eglCheck ## type(disp, obj, __FUNCTION__); \ - if (!__drv) \ - return _EGL_ERROR(disp, 0, ret); \ - __drv; \ - }) -#define _EGL_CHECK_SURFACE(disp, surf, ret) \ - _EGL_CHECK_OBJECT(disp, Surface, surf, ret) -#define _EGL_CHECK_CONTEXT(disp, context, ret) \ - _EGL_CHECK_OBJECT(disp, Context, context, ret) -#define _EGL_CHECK_CONFIG(disp, conf, ret) \ - _EGL_CHECK_OBJECT(disp, Config, conf, ret) -#define _EGL_CHECK_SCREEN(disp, scrn, ret) \ - _EGL_CHECK_OBJECT(disp, Screen, scrn, ret) -#define _EGL_CHECK_MODE(disp, m, ret) \ - _EGL_CHECK_OBJECT(disp, Mode, m, ret) + +#define _EGL_CHECK_DISPLAY(disp, ret, drv) \ + do { \ + drv = _eglCheckDisplay(disp, __FUNCTION__); \ + if (!drv) \ + RETURN_EGL_ERROR(disp, 0, ret); \ + } while (0) + +#define _EGL_CHECK_OBJECT(disp, type, obj, ret, drv) \ + do { \ + drv = _eglCheck ## type(disp, obj, __FUNCTION__); \ + if (!drv) \ + RETURN_EGL_ERROR(disp, 0, ret); \ + } while (0) + +#define _EGL_CHECK_SURFACE(disp, surf, ret, drv) \ + _EGL_CHECK_OBJECT(disp, Surface, surf, ret, drv) + +#define _EGL_CHECK_CONTEXT(disp, context, ret, drv) \ + _EGL_CHECK_OBJECT(disp, Context, context, ret, drv) + +#define _EGL_CHECK_CONFIG(disp, conf, ret, drv) \ + _EGL_CHECK_OBJECT(disp, Config, conf, ret, drv) + +#define _EGL_CHECK_SCREEN(disp, scrn, ret, drv) \ + _EGL_CHECK_OBJECT(disp, Screen, scrn, ret, drv) + +#define _EGL_CHECK_MODE(disp, m, ret, drv) \ + _EGL_CHECK_OBJECT(disp, Mode, m, ret, drv) + static INLINE _EGLDriver * @@ -256,7 +264,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) EGLint major_int, minor_int; if (!disp) - return _EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE); + RETURN_EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE); if (!disp->Initialized) { _EGLDriver *drv = disp->Driver; @@ -265,12 +273,12 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) _eglPreloadDrivers(); drv = _eglMatchDriver(disp); if (!drv) - return _EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); } /* Initialize the particular display now */ if (!drv->API.Initialize(drv, disp, &major_int, &minor_int)) - return _EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); disp->APImajor = major_int; disp->APIminor = minor_int; @@ -293,7 +301,7 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) *minor = minor_int; } - return _EGL_SUCCESS(disp, EGL_TRUE); + RETURN_EGL_SUCCESS(disp, EGL_TRUE); } @@ -303,7 +311,7 @@ eglTerminate(EGLDisplay dpy) _EGLDisplay *disp = _eglLockDisplay(dpy); if (!disp) - return _EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE); + RETURN_EGL_ERROR(NULL, EGL_BAD_DISPLAY, EGL_FALSE); if (disp->Initialized) { _EGLDriver *drv = disp->Driver; @@ -313,7 +321,7 @@ eglTerminate(EGLDisplay dpy) disp->Initialized = EGL_FALSE; } - return _EGL_SUCCESS(disp, EGL_TRUE); + RETURN_EGL_SUCCESS(disp, EGL_TRUE); } @@ -324,10 +332,10 @@ eglQueryString(EGLDisplay dpy, EGLint name) _EGLDriver *drv; const char *ret; - drv = _EGL_CHECK_DISPLAY(disp, NULL); + _EGL_CHECK_DISPLAY(disp, NULL, drv); ret = drv->API.QueryString(drv, disp, name); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -339,10 +347,10 @@ eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); ret = drv->API.GetConfigs(drv, disp, configs, config_size, num_config); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -354,11 +362,11 @@ eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); ret = drv->API.ChooseConfig(drv, disp, attrib_list, configs, config_size, num_config); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -371,10 +379,10 @@ eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_CONFIG(disp, conf, EGL_FALSE); + _EGL_CHECK_CONFIG(disp, conf, EGL_FALSE, drv); ret = drv->API.GetConfigAttrib(drv, disp, conf, attribute, value); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -389,14 +397,14 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, _EGLContext *context; EGLContext ret; - drv = _EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT); + _EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT, drv); if (!share && share_list != EGL_NO_CONTEXT) - return _EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT); + RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT); context = drv->API.CreateContext(drv, disp, conf, share, attrib_list); ret = (context) ? _eglLinkContext(context, disp) : EGL_NO_CONTEXT; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -408,11 +416,11 @@ eglDestroyContext(EGLDisplay dpy, EGLContext ctx) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_CONTEXT(disp, context, EGL_FALSE); + _EGL_CHECK_CONTEXT(disp, context, EGL_FALSE, drv); _eglUnlinkContext(context); ret = drv->API.DestroyContext(drv, disp, context); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -428,27 +436,27 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLBoolean ret; if (!disp) - return _EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE); drv = disp->Driver; /* display is allowed to be uninitialized under certain condition */ if (!disp->Initialized) { if (draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE || ctx != EGL_NO_CONTEXT) - return _EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE); } if (!drv) - return _EGL_SUCCESS(disp, EGL_TRUE); + RETURN_EGL_SUCCESS(disp, EGL_TRUE); if (!context && ctx != EGL_NO_CONTEXT) - return _EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE); if ((!draw_surf && draw != EGL_NO_SURFACE) || (!read_surf && read != EGL_NO_SURFACE)) - return _EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); ret = drv->API.MakeCurrent(drv, disp, draw_surf, read_surf, context); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -461,10 +469,10 @@ eglQueryContext(EGLDisplay dpy, EGLContext ctx, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_CONTEXT(disp, context, EGL_FALSE); + _EGL_CHECK_CONTEXT(disp, context, EGL_FALSE, drv); ret = drv->API.QueryContext(drv, disp, context, attribute, value); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -478,12 +486,12 @@ eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, _EGLSurface *surf; EGLSurface ret; - drv = _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE); + _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); surf = drv->API.CreateWindowSurface(drv, disp, conf, window, attrib_list); ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -497,12 +505,12 @@ eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, _EGLSurface *surf; EGLSurface ret; - drv = _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE); + _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); surf = drv->API.CreatePixmapSurface(drv, disp, conf, pixmap, attrib_list); ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -516,12 +524,12 @@ eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, _EGLSurface *surf; EGLSurface ret; - drv = _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE); + _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); surf = drv->API.CreatePbufferSurface(drv, disp, conf, attrib_list); ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -533,11 +541,11 @@ eglDestroySurface(EGLDisplay dpy, EGLSurface surface) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); _eglUnlinkSurface(surf); ret = drv->API.DestroySurface(drv, disp, surf); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } EGLBoolean EGLAPIENTRY @@ -549,10 +557,10 @@ eglQuerySurface(EGLDisplay dpy, EGLSurface surface, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); ret = drv->API.QuerySurface(drv, disp, surf, attribute, value); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } EGLBoolean EGLAPIENTRY @@ -564,10 +572,10 @@ eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); ret = drv->API.SurfaceAttrib(drv, disp, surf, attribute, value); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -579,10 +587,10 @@ eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); ret = drv->API.BindTexImage(drv, disp, surf, buffer); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -594,10 +602,10 @@ eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); ret = drv->API.ReleaseTexImage(drv, disp, surf, buffer); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -610,18 +618,18 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); if (!ctx || !_eglIsContextLinked(ctx) || ctx->Resource.Display != disp) - return _EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE); surf = ctx->DrawSurface; if (!_eglIsSurfaceLinked(surf)) - return _EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); ret = drv->API.SwapInterval(drv, disp, surf, interval); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -634,15 +642,15 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); /* surface must be bound to current context in EGL 1.4 */ if (!ctx || !_eglIsContextLinked(ctx) || surf != ctx->DrawSurface) - return _EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); ret = drv->API.SwapBuffers(drv, disp, surf); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -654,10 +662,10 @@ eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE); + _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); ret = drv->API.CopyBuffers(drv, disp, surf, target); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -670,21 +678,21 @@ eglWaitClient(void) EGLBoolean ret; if (!ctx) - return _EGL_SUCCESS(NULL, EGL_TRUE); + RETURN_EGL_SUCCESS(NULL, EGL_TRUE); disp = ctx->Resource.Display; _eglLockMutex(&disp->Mutex); /* let bad current context imply bad current surface */ if (!_eglIsContextLinked(ctx) || !_eglIsSurfaceLinked(ctx->DrawSurface)) - return _EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE); /* a valid current context implies an initialized current display */ assert(disp->Initialized); drv = disp->Driver; ret = drv->API.WaitClient(drv, disp, ctx); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -698,7 +706,7 @@ eglWaitGL(void) EGLBoolean ret; if (api_index != es_index && _eglIsCurrentThreadDummy()) - return _EGL_ERROR(NULL, EGL_BAD_ALLOC, EGL_FALSE); + RETURN_EGL_ERROR(NULL, EGL_BAD_ALLOC, EGL_FALSE); t->CurrentAPIIndex = es_index; ret = eglWaitClient(); @@ -719,21 +727,21 @@ eglWaitNative(EGLint engine) EGLBoolean ret; if (!ctx) - return _EGL_SUCCESS(NULL, EGL_TRUE); + RETURN_EGL_SUCCESS(NULL, EGL_TRUE); disp = ctx->Resource.Display; _eglLockMutex(&disp->Mutex); /* let bad current context imply bad current surface */ if (!_eglIsContextLinked(ctx) || !_eglIsSurfaceLinked(ctx->DrawSurface)) - return _EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_CURRENT_SURFACE, EGL_FALSE); /* a valid current context implies an initialized current display */ assert(disp->Initialized); drv = disp->Driver; ret = drv->API.WaitNative(drv, disp, engine); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -745,7 +753,7 @@ eglGetCurrentDisplay(void) ret = (ctx) ? _eglGetDisplayHandle(ctx->Resource.Display) : EGL_NO_DISPLAY; - return _EGL_SUCCESS(NULL, ret); + RETURN_EGL_SUCCESS(NULL, ret); } @@ -757,7 +765,7 @@ eglGetCurrentContext(void) ret = _eglGetContextHandle(ctx); - return _EGL_SUCCESS(NULL, ret); + RETURN_EGL_SUCCESS(NULL, ret); } @@ -770,7 +778,7 @@ eglGetCurrentSurface(EGLint readdraw) EGLSurface ret; if (!ctx) - return _EGL_SUCCESS(NULL, EGL_NO_SURFACE); + RETURN_EGL_SUCCESS(NULL, EGL_NO_SURFACE); switch (readdraw) { case EGL_DRAW: @@ -787,7 +795,7 @@ eglGetCurrentSurface(EGLint readdraw) ret = _eglGetSurfaceHandle(surf); - return _EGL_ERROR(NULL, err, ret); + RETURN_EGL_ERROR(NULL, err, ret); } @@ -834,7 +842,7 @@ eglGetProcAddress(const char *procname) _EGLProc ret; if (!procname) - return _EGL_SUCCESS(NULL, NULL); + RETURN_EGL_SUCCESS(NULL, NULL); ret = NULL; if (strncmp(procname, "egl", 3) == 0) { @@ -846,7 +854,7 @@ eglGetProcAddress(const char *procname) } } if (ret) - return _EGL_SUCCESS(NULL, ret); + RETURN_EGL_SUCCESS(NULL, ret); _eglPreloadDrivers(); @@ -858,7 +866,7 @@ eglGetProcAddress(const char *procname) break; } - return _EGL_SUCCESS(NULL, ret); + RETURN_EGL_SUCCESS(NULL, ret); } @@ -879,11 +887,11 @@ eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE); + _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE, drv); ret = drv->API.ChooseModeMESA(drv, disp, scrn, attrib_list, modes, modes_size, num_modes); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -896,10 +904,10 @@ eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE); + _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE, drv); ret = drv->API.GetModesMESA(drv, disp, scrn, modes, mode_size, num_mode); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -912,10 +920,10 @@ eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_MODE(disp, m, EGL_FALSE); + _EGL_CHECK_MODE(disp, m, EGL_FALSE, drv); ret = drv->API.GetModeAttribMESA(drv, disp, m, attribute, value); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -929,14 +937,14 @@ eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_CONTEXT(disp, source_context, EGL_FALSE); + _EGL_CHECK_CONTEXT(disp, source_context, EGL_FALSE, drv); if (!dest_context) - return _EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_FALSE); ret = drv->API.CopyContextMESA(drv, disp, source_context, dest_context, mask); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -948,10 +956,10 @@ eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); ret = drv->API.GetScreensMESA(drv, disp, screens, max_screens, num_screens); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -965,12 +973,12 @@ eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, _EGLSurface *surf; EGLSurface ret; - drv = _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE); + _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); surf = drv->API.CreateScreenSurfaceMESA(drv, disp, conf, attrib_list); ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -985,15 +993,15 @@ eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE); + _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE, drv); if (!surf && surface != EGL_NO_SURFACE) - return _EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); if (!m && mode != EGL_NO_MODE_MESA) - return _EGL_ERROR(disp, EGL_BAD_MODE_MESA, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_MODE_MESA, EGL_FALSE); ret = drv->API.ShowScreenSurfaceMESA(drv, disp, scrn, surf, m); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1005,10 +1013,10 @@ eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE); + _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE, drv); ret = drv->API.ScreenPositionMESA(drv, disp, scrn, x, y); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1021,10 +1029,10 @@ eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE); + _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE, drv); ret = drv->API.QueryScreenMESA(drv, disp, scrn, attribute, value); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1038,12 +1046,12 @@ eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, _EGLSurface *surf; EGLBoolean ret; - drv = _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE); + _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE, drv); ret = drv->API.QueryScreenSurfaceMESA(drv, disp, scrn, &surf); if (ret && surface) *surface = _eglGetSurfaceHandle(surf); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1056,12 +1064,12 @@ eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode) _EGLMode *m; EGLBoolean ret; - drv = _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE); + _EGL_CHECK_SCREEN(disp, scrn, EGL_FALSE, drv); ret = drv->API.QueryScreenModeMESA(drv, disp, scrn, &m); if (ret && mode) *mode = m->Handle; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1073,10 +1081,10 @@ eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode) _EGLDriver *drv; const char *ret; - drv = _EGL_CHECK_MODE(disp, m, NULL); + _EGL_CHECK_MODE(disp, m, NULL, drv); ret = drv->API.QueryModeStringMESA(drv, disp, m); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1107,14 +1115,14 @@ eglBindAPI(EGLenum api) _EGLThreadInfo *t = _eglGetCurrentThread(); if (_eglIsCurrentThreadDummy()) - return _EGL_ERROR(NULL, EGL_BAD_ALLOC, EGL_FALSE); + RETURN_EGL_ERROR(NULL, EGL_BAD_ALLOC, EGL_FALSE); if (!_eglIsApiValid(api)) - return _EGL_ERROR(NULL, EGL_BAD_PARAMETER, EGL_FALSE); + RETURN_EGL_ERROR(NULL, EGL_BAD_PARAMETER, EGL_FALSE); t->CurrentAPIIndex = _eglConvertApiToIndex(api); - return _EGL_SUCCESS(NULL, EGL_TRUE); + RETURN_EGL_SUCCESS(NULL, EGL_TRUE); } @@ -1130,7 +1138,7 @@ eglQueryAPI(void) /* returns one of EGL_OPENGL_API, EGL_OPENGL_ES_API or EGL_OPENVG_API */ ret = _eglConvertApiFromIndex(t->CurrentAPIIndex); - return _EGL_SUCCESS(NULL, ret); + RETURN_EGL_SUCCESS(NULL, ret); } @@ -1145,13 +1153,13 @@ eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, _EGLSurface *surf; EGLSurface ret; - drv = _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE); + _EGL_CHECK_CONFIG(disp, conf, EGL_NO_SURFACE, drv); surf = drv->API.CreatePbufferFromClientBuffer(drv, disp, buftype, buffer, conf, attrib_list); ret = (surf) ? _eglLinkSurface(surf, disp) : EGL_NO_SURFACE; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1184,7 +1192,7 @@ eglReleaseThread(void) _eglDestroyCurrentThread(); - return _EGL_SUCCESS(NULL, EGL_TRUE); + RETURN_EGL_SUCCESS(NULL, EGL_TRUE); } @@ -1204,15 +1212,15 @@ eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, _EGLImage *img; EGLImageKHR ret; - drv = _EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR); + _EGL_CHECK_DISPLAY(disp, EGL_NO_IMAGE_KHR, drv); if (!context && ctx != EGL_NO_CONTEXT) - return _EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR); + RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_IMAGE_KHR); img = drv->API.CreateImageKHR(drv, disp, context, target, buffer, attr_list); ret = (img) ? _eglLinkImage(img, disp) : EGL_NO_IMAGE_KHR; - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } @@ -1224,14 +1232,14 @@ eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image) _EGLDriver *drv; EGLBoolean ret; - drv = _EGL_CHECK_DISPLAY(disp, EGL_FALSE); + _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); if (!img) - return _EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); + RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); _eglUnlinkImage(img); ret = drv->API.DestroyImageKHR(drv, disp, img); - return _EGL_EVAL(disp, ret); + RETURN_EGL_EVAL(disp, ret); } -- cgit v1.2.3 From 496724b869d4258a64e8343d3ae66d08bfb19f7b Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 19 Feb 2010 11:47:54 +0800 Subject: egl: Silence warnings when compiled with -pedantic. Just follow gcc's advices here. --- src/egl/main/eglconfig.c | 2 +- src/egl/main/egldisplay.h | 2 ++ src/egl/main/egldriver.c | 8 +++++++- src/egl/main/egltypedefs.h | 2 -- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index 1190f8cdd5..177cf3ed89 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -112,7 +112,7 @@ enum { ATTRIB_CRITERION_ATLEAST, ATTRIB_CRITERION_MASK, ATTRIB_CRITERION_SPECIAL, - ATTRIB_CRITERION_IGNORE, + ATTRIB_CRITERION_IGNORE }; diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 43b39bda9d..5d69b876ae 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -14,6 +14,8 @@ enum _egl_resource_type { _EGL_NUM_RESOURCES }; +/* this cannot and need not go into egltypedefs.h */ +typedef enum _egl_resource_type _EGLResourceType; /** diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c index 8748fe5f46..6384242b09 100644 --- a/src/egl/main/egldriver.c +++ b/src/egl/main/egldriver.c @@ -144,7 +144,13 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle) mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain"); #elif defined(_EGL_PLATFORM_POSIX) if (lib) { - mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain"); + union { + _EGLMain_t func; + void *ptr; + } tmp = { NULL }; + /* direct cast gives a warning when compiled with -pedantic */ + tmp.ptr = dlsym(lib, "_eglMain"); + mainFunc = tmp.func; if (!mainFunc) error = dlerror(); } diff --git a/src/egl/main/egltypedefs.h b/src/egl/main/egltypedefs.h index e0c95762c6..166b133909 100644 --- a/src/egl/main/egltypedefs.h +++ b/src/egl/main/egltypedefs.h @@ -8,8 +8,6 @@ #include "eglcompiler.h" -typedef enum _egl_resource_type _EGLResourceType; - typedef struct _egl_api _EGLAPI; typedef struct _egl_config _EGLConfig; -- cgit v1.2.3 From 24bdace350a65d405214696f77e74f3d0fe5186a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 19 Feb 2010 00:44:17 -0800 Subject: gamma: s/gammacontext.h/gamma_context.h/ --- src/mesa/drivers/dri/gamma/gamma_context.c | 2 +- src/mesa/drivers/dri/gamma/gamma_dd.c | 2 +- src/mesa/drivers/dri/gamma/gamma_inithw.c | 2 +- src/mesa/drivers/dri/gamma/gamma_lock.c | 2 +- src/mesa/drivers/dri/gamma/gamma_render.c | 2 +- src/mesa/drivers/dri/gamma/gamma_screen.c | 2 +- src/mesa/drivers/dri/gamma/gamma_span.c | 2 +- src/mesa/drivers/dri/gamma/gamma_state.c | 2 +- src/mesa/drivers/dri/gamma/gamma_tex.c | 2 +- src/mesa/drivers/dri/gamma/gamma_texmem.c | 2 +- src/mesa/drivers/dri/gamma/gamma_texstate.c | 2 +- src/mesa/drivers/dri/gamma/gamma_tris.c | 2 +- src/mesa/drivers/dri/gamma/gamma_vb.c | 2 +- src/mesa/drivers/dri/gamma/gamma_xmesa.c | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c index bab5b69a8e..004139d4f7 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.c +++ b/src/mesa/drivers/dri/gamma/gamma_context.c @@ -24,7 +24,7 @@ * 3DLabs Gamma driver. * */ -#include "gammacontext.h" +#include "gamma_context.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_dd.c b/src/mesa/drivers/dri/gamma/gamma_dd.c index 7a81ef5993..c1c371fa7c 100644 --- a/src/mesa/drivers/dri/gamma/gamma_dd.c +++ b/src/mesa/drivers/dri/gamma/gamma_dd.c @@ -23,7 +23,7 @@ * */ -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_vb.h" #include "gamma_lock.h" #if defined(USE_X86_ASM) diff --git a/src/mesa/drivers/dri/gamma/gamma_inithw.c b/src/mesa/drivers/dri/gamma/gamma_inithw.c index 525ad89354..79b54aacb5 100644 --- a/src/mesa/drivers/dri/gamma/gamma_inithw.c +++ b/src/mesa/drivers/dri/gamma/gamma_inithw.c @@ -24,7 +24,7 @@ * */ -#include "gammacontext.h" +#include "gamma_context.h" #include "glint_dri.h" void gammaInitHW( gammaContextPtr gmesa ) diff --git a/src/mesa/drivers/dri/gamma/gamma_lock.c b/src/mesa/drivers/dri/gamma/gamma_lock.c index cd4acef24d..c58b59aa1b 100644 --- a/src/mesa/drivers/dri/gamma/gamma_lock.c +++ b/src/mesa/drivers/dri/gamma/gamma_lock.c @@ -1,5 +1,5 @@ -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_lock.h" #include "drirenderbuffer.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c index a03a93d132..0138ec3004 100644 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ b/src/mesa/drivers/dri/gamma/gamma_render.c @@ -33,7 +33,7 @@ #include "tnl/tcontext.h" -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_tris.h" #include "gamma_vb.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_screen.c b/src/mesa/drivers/dri/gamma/gamma_screen.c index f72a4a5696..47862f1d77 100644 --- a/src/mesa/drivers/dri/gamma/gamma_screen.c +++ b/src/mesa/drivers/dri/gamma/gamma_screen.c @@ -23,7 +23,7 @@ * */ -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_vb.h" #include "glint_dri.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c index 3f0b81800c..7376ecf8e4 100644 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ b/src/mesa/drivers/dri/gamma/gamma_span.c @@ -1,5 +1,5 @@ -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_lock.h" #include "colormac.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c index 47df37466d..83b167a5b7 100644 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ b/src/mesa/drivers/dri/gamma/gamma_state.c @@ -24,7 +24,7 @@ * 3DLabs Gamma driver */ -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_main/macros.h" #include "buffers.h" #include "main/macros.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c index 694e5eba5b..bef8cf27db 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tex.c +++ b/src/mesa/drivers/dri/gamma/gamma_tex.c @@ -12,7 +12,7 @@ #include "swrast/swrast.h" -#include "gammacontext.h" +#include "gamma_context.h" /* diff --git a/src/mesa/drivers/dri/gamma/gamma_texmem.c b/src/mesa/drivers/dri/gamma/gamma_texmem.c index 4cb47e179e..f5e66f577d 100644 --- a/src/mesa/drivers/dri/gamma/gamma_texmem.c +++ b/src/mesa/drivers/dri/gamma/gamma_texmem.c @@ -11,7 +11,7 @@ #include "main/mm.h" #include "glint_dri.h" -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_lock.h" void gammaDestroyTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t) diff --git a/src/mesa/drivers/dri/gamma/gamma_texstate.c b/src/mesa/drivers/dri/gamma/gamma_texstate.c index b3a318d581..46f39135dc 100644 --- a/src/mesa/drivers/dri/gamma/gamma_texstate.c +++ b/src/mesa/drivers/dri/gamma/gamma_texstate.c @@ -9,7 +9,7 @@ #include "main/enums.h" #include "main/mm.h" -#include "gammacontext.h" +#include "gamma_context.h" static void gammaSetTexImages( gammaContextPtr gmesa, struct gl_texture_object *tObj ) diff --git a/src/mesa/drivers/dri/gamma/gamma_tris.c b/src/mesa/drivers/dri/gamma/gamma_tris.c index 2903daf3f1..972735490b 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tris.c +++ b/src/mesa/drivers/dri/gamma/gamma_tris.c @@ -25,7 +25,7 @@ * 3DLabs Gamma driver. */ -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_vb.h" #include "gamma_tris.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.c b/src/mesa/drivers/dri/gamma/gamma_vb.c index 23ca0714c5..ef906115ec 100644 --- a/src/mesa/drivers/dri/gamma/gamma_vb.c +++ b/src/mesa/drivers/dri/gamma/gamma_vb.c @@ -35,7 +35,7 @@ #include "tnl/tcontext.h" #include "tnl/tnl.h" -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_vb.h" #include "gamma_tris.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_xmesa.c b/src/mesa/drivers/dri/gamma/gamma_xmesa.c index e49ab5bae3..430511e353 100644 --- a/src/mesa/drivers/dri/gamma/gamma_xmesa.c +++ b/src/mesa/drivers/dri/gamma/gamma_xmesa.c @@ -24,7 +24,7 @@ * 3DLabs Gamma driver */ -#include "gammacontext.h" +#include "gamma_context.h" #include "gamma_vb.h" #include "main/context.h" #include "main/matrix.h" -- cgit v1.2.3 From e95948ea03bd479f5961452647d3993aa0ab05f6 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 19 Feb 2010 00:51:21 -0800 Subject: gamma: s#colormac.h#main/colormac.h# --- src/mesa/drivers/dri/gamma/gamma_context.h | 2 +- src/mesa/drivers/dri/gamma/gamma_span.c | 2 +- src/mesa/drivers/dri/gamma/gamma_state.c | 2 +- src/mesa/drivers/dri/gamma/gamma_texmem.c | 2 +- src/mesa/drivers/dri/gamma/gamma_tris.c | 2 +- src/mesa/drivers/dri/gamma/gamma_vb.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h index c386aa3007..f702eee945 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.h +++ b/src/mesa/drivers/dri/gamma/gamma_context.h @@ -29,7 +29,7 @@ #include "dri_util.h" #include "drm.h" #include "drm_sarea.h" -#include "colormac.h" +#include "main/colormac.h" #include "gamma_regs.h" #include "gamma_main/macros.h" #include "gamma_screen.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c index 7376ecf8e4..b96e49eadc 100644 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ b/src/mesa/drivers/dri/gamma/gamma_span.c @@ -1,7 +1,7 @@ #include "gamma_context.h" #include "gamma_lock.h" -#include "colormac.h" +#include "main/colormac.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c index 83b167a5b7..45ba521d70 100644 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ b/src/mesa/drivers/dri/gamma/gamma_state.c @@ -29,7 +29,7 @@ #include "buffers.h" #include "main/macros.h" #include "glint_dri.h" -#include "colormac.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "vbo/vbo.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_texmem.c b/src/mesa/drivers/dri/gamma/gamma_texmem.c index f5e66f577d..7df001ff6d 100644 --- a/src/mesa/drivers/dri/gamma/gamma_texmem.c +++ b/src/mesa/drivers/dri/gamma/gamma_texmem.c @@ -3,7 +3,7 @@ #include #include "main/glheader.h" -#include "colormac.h" +#include "main/colormac.h" #include "main/macros.h" #include "main/mtypes.h" #include "main/simple_list.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_tris.c b/src/mesa/drivers/dri/gamma/gamma_tris.c index 972735490b..7899afd673 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tris.c +++ b/src/mesa/drivers/dri/gamma/gamma_tris.c @@ -32,7 +32,7 @@ #include "main/glheader.h" #include "main/mtypes.h" #include "main/macros.h" -#include "colormac.h" +#include "main/colormac.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.c b/src/mesa/drivers/dri/gamma/gamma_vb.c index ef906115ec..c11cfd281a 100644 --- a/src/mesa/drivers/dri/gamma/gamma_vb.c +++ b/src/mesa/drivers/dri/gamma/gamma_vb.c @@ -29,7 +29,7 @@ #include "main/mtypes.h" #include "main/imports.h" #include "main/macros.h" -#include "colormac.h" +#include "main/colormac.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tcontext.h" -- cgit v1.2.3 From 71214c640c8b20020ead13897c76b9b6773126ba Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 19 Feb 2010 03:12:14 -0800 Subject: Revert "r300g: remove L8_UNORM from colorbuffer formats" This reverts commit fc427d23439a2702068209957f08990ea29fe21b. At least xorg uses this, and just because something is not used in OpenGL is *never* a valid reason to remove functionality from Gallium. If something lacks a test, go add a test, don't remove features. --- src/gallium/drivers/r300/r300_screen.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 036736ccc4..5fa1ea0850 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -230,6 +230,7 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, /* Supported formats. */ /* Colorbuffer */ case PIPE_FORMAT_A8_UNORM: + case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: case PIPE_FORMAT_A1R5G5B5_UNORM: case PIPE_FORMAT_A4R4G4B4_UNORM: -- cgit v1.2.3 From 0aecdb638322c81ce30f201f12e1f268acd1a64c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:51 -0800 Subject: Remove _mesa_strstr in favor of plain strstr. --- src/mesa/main/debug.c | 6 +++--- src/mesa/main/imports.c | 9 +-------- src/mesa/main/imports.h | 3 --- src/mesa/shader/shader_api.c | 16 ++++++++-------- src/mesa/shader/slang/slang_link.c | 2 +- 5 files changed, 13 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 9bad83487f..f2182c0577 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -206,17 +206,17 @@ static void add_debug_flags( const char *debug ) MESA_VERBOSE = 0x0; for (i = 0; i < Elements(debug_opt); i++) { - if (_mesa_strstr(debug, debug_opt[i].name)) + if (strstr(debug, debug_opt[i].name)) MESA_VERBOSE |= debug_opt[i].flag; } /* Debug flag: */ - if (_mesa_strstr(debug, "flush")) + if (strstr(debug, "flush")) MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; #if defined(_FPU_GETCW) && defined(_FPU_SETCW) - if (_mesa_strstr(debug, "fpexceptions")) { + if (strstr(debug, "fpexceptions")) { /* raise FP exceptions */ fpu_control_t mask; _FPU_GETCW(mask); diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index def045269c..cd19373fc5 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -841,13 +841,6 @@ _mesa_getenv( const char *var ) /** \name String */ /*@{*/ -/** Wrapper around strstr() */ -char * -_mesa_strstr( const char *haystack, const char *needle ) -{ - return strstr(haystack, needle); -} - /** Wrapper around strncat() */ char * _mesa_strncat( char *dest, const char *src, size_t n ) @@ -1177,7 +1170,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) const char *debugEnv = _mesa_getenv("MESA_DEBUG"); #ifdef DEBUG - if (debugEnv && _mesa_strstr(debugEnv, "silent")) + if (debugEnv && strstr(debugEnv, "silent")) debug = GL_FALSE; else debug = GL_TRUE; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index e3d2ac9b42..c487f1dab6 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, extern char * _mesa_getenv( const char *var ); -extern char * -_mesa_strstr( const char *haystack, const char *needle ); - extern char * _mesa_strncat( char *dest, const char *src, size_t n ); diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index e8eaa9c103..c3b49ed4d4 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -374,21 +374,21 @@ get_shader_flags(void) const char *env = _mesa_getenv("MESA_GLSL"); if (env) { - if (_mesa_strstr(env, "dump")) + if (strstr(env, "dump")) flags |= GLSL_DUMP; - if (_mesa_strstr(env, "log")) + if (strstr(env, "log")) flags |= GLSL_LOG; - if (_mesa_strstr(env, "nopvert")) + if (strstr(env, "nopvert")) flags |= GLSL_NOP_VERT; - if (_mesa_strstr(env, "nopfrag")) + if (strstr(env, "nopfrag")) flags |= GLSL_NOP_FRAG; - if (_mesa_strstr(env, "nopt")) + if (strstr(env, "nopt")) flags |= GLSL_NO_OPT; - else if (_mesa_strstr(env, "opt")) + else if (strstr(env, "opt")) flags |= GLSL_OPT; - if (_mesa_strstr(env, "uniform")) + if (strstr(env, "uniform")) flags |= GLSL_UNIFORMS; - if (_mesa_strstr(env, "useprog")) + if (strstr(env, "useprog")) flags |= GLSL_USE_PROG; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 75b0022b56..9c90d5c531 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -563,7 +563,7 @@ remove_extra_version_directives(GLchar *source) { GLuint verCount = 0; while (1) { - char *ver = _mesa_strstr(source, "#version"); + char *ver = strstr(source, "#version"); if (ver) { verCount++; if (verCount > 1) { -- cgit v1.2.3 From 8ff7624653f0e119865cc6c283775832f1bc2903 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:52 -0800 Subject: Remove _mesa_strncat in favor of plain strncat. --- src/mesa/main/imports.c | 7 ------- src/mesa/main/imports.h | 3 --- src/mesa/shader/atifragshader.c | 16 ++++++++-------- 3 files changed, 8 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index cd19373fc5..1a7535d89e 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -841,13 +841,6 @@ _mesa_getenv( const char *var ) /** \name String */ /*@{*/ -/** Wrapper around strncat() */ -char * -_mesa_strncat( char *dest, const char *src, size_t n ) -{ - return strncat(dest, src, n); -} - /** Wrapper around strcpy() */ char * _mesa_strcpy( char *dest, const char *src ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index c487f1dab6..a3ec0c2ed9 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, extern char * _mesa_getenv( const char *var ); -extern char * -_mesa_strncat( char *dest, const char *src, size_t n ); - extern char * _mesa_strcpy( char *dest, const char *src ); diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index ab7b2030d1..28dbf77b66 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -98,25 +98,25 @@ create_dst_mod_str(GLuint mod) _mesa_memset(ret_str, 0, 1024); if (mod & GL_2X_BIT_ATI) - _mesa_strncat(ret_str, "|2X", 1024); + strncat(ret_str, "|2X", 1024); if (mod & GL_4X_BIT_ATI) - _mesa_strncat(ret_str, "|4X", 1024); + strncat(ret_str, "|4X", 1024); if (mod & GL_8X_BIT_ATI) - _mesa_strncat(ret_str, "|8X", 1024); + strncat(ret_str, "|8X", 1024); if (mod & GL_HALF_BIT_ATI) - _mesa_strncat(ret_str, "|HA", 1024); + strncat(ret_str, "|HA", 1024); if (mod & GL_QUARTER_BIT_ATI) - _mesa_strncat(ret_str, "|QU", 1024); + strncat(ret_str, "|QU", 1024); if (mod & GL_EIGHTH_BIT_ATI) - _mesa_strncat(ret_str, "|EI", 1024); + strncat(ret_str, "|EI", 1024); if (mod & GL_SATURATE_BIT_ATI) - _mesa_strncat(ret_str, "|SAT", 1024); + strncat(ret_str, "|SAT", 1024); if (_mesa_strlen(ret_str) == 0) - _mesa_strncat(ret_str, "NONE", 1024); + strncat(ret_str, "NONE", 1024); return ret_str; } -- cgit v1.2.3 From 5fcaa78912bc78a5db410200c5987e2c57fad570 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:53 -0800 Subject: Remove _mesa_strcpy in favor of plain strcpy. --- src/mesa/main/imports.c | 11 ++--------- src/mesa/main/imports.h | 3 --- src/mesa/shader/slang/slang_mem.c | 2 +- src/mesa/shader/slang/slang_utility.c | 2 +- src/mesa/shader/slang/slang_utility.h | 2 +- 5 files changed, 5 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 1a7535d89e..19deef5767 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -841,13 +841,6 @@ _mesa_getenv( const char *var ) /** \name String */ /*@{*/ -/** Wrapper around strcpy() */ -char * -_mesa_strcpy( char *dest, const char *src ) -{ - return strcpy(dest, src); -} - /** Wrapper around strncpy() */ char * _mesa_strncpy( char *dest, const char *src, size_t n ) @@ -877,7 +870,7 @@ _mesa_strncmp( const char *s1, const char *s2, size_t n ) } /** - * Implemented using _mesa_malloc() and _mesa_strcpy. + * Implemented using _mesa_malloc() and strcpy. * Note that NULL is handled accordingly. */ char * @@ -887,7 +880,7 @@ _mesa_strdup( const char *s ) size_t l = _mesa_strlen(s); char *s2 = (char *) _mesa_malloc(l + 1); if (s2) - _mesa_strcpy(s2, s); + strcpy(s2, s); return s2; } else { diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index a3ec0c2ed9..0143be3ced 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, extern char * _mesa_getenv( const char *var ); -extern char * -_mesa_strcpy( char *dest, const char *src ); - extern char * _mesa_strncpy( char *dest, const char *src, size_t n ); diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index 9224578edb..dc5707a39b 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -215,7 +215,7 @@ _slang_strdup(const char *s) size_t l = _mesa_strlen(s); char *s2 = (char *) _slang_alloc(l + 1); if (s2) - _mesa_strcpy(s2, s); + strcpy(s2, s); return s2; } else { diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 3631e32b3c..950fba5611 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -35,7 +35,7 @@ char * slang_string_concat (char *dst, const char *src) { - return _mesa_strcpy (dst + _mesa_strlen (dst), src); + return strcpy (dst + _mesa_strlen (dst), src); } diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 032c561810..3762cc9679 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -33,7 +33,7 @@ #define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) -#define slang_string_copy(dst, src) _mesa_strcpy (dst, src) +#define slang_string_copy(dst, src) strcpy (dst, src) #define slang_string_length(str) _mesa_strlen (str) char *slang_string_concat (char *, const char *); -- cgit v1.2.3 From f69d1d1438361f10fd8db78d2d38f26e33db9747 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:54 -0800 Subject: Remove _mesa_strncpy in favor of plain strncpy. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 2 +- src/mesa/drivers/x11/fakeglx.c | 2 +- src/mesa/main/dlopen.c | 2 +- src/mesa/main/imports.c | 7 ------- src/mesa/main/imports.h | 3 --- 5 files changed, 3 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 3caf56e924..7e86e68b68 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -442,7 +442,7 @@ get_env_visual(Display *dpy, int scr, const char *varname) return NULL; } - _mesa_strncpy( value, _mesa_getenv(varname), 100 ); + strncpy( value, _mesa_getenv(varname), 100 ); value[99] = 0; sscanf( value, "%s %d", type, &depth ); diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 5c0084f37a..3b8c41b918 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -616,7 +616,7 @@ get_env_visual(Display *dpy, int scr, const char *varname) return NULL; } - _mesa_strncpy( value, _mesa_getenv(varname), 100 ); + strncpy( value, _mesa_getenv(varname), 100 ); value[99] = 0; sscanf( value, "%s %d", type, &depth ); diff --git a/src/mesa/main/dlopen.c b/src/mesa/main/dlopen.c index 81e032081d..658ac9e40c 100644 --- a/src/mesa/main/dlopen.c +++ b/src/mesa/main/dlopen.c @@ -73,7 +73,7 @@ _mesa_dlsym(void *handle, const char *fname) /* need '_' prefix on symbol names */ char fname2[1000]; fname2[0] = '_'; - _mesa_strncpy(fname2 + 1, fname, 998); + strncpy(fname2 + 1, fname, 998); fname2[999] = 0; return (GenericFunc) dlsym(handle, fname2); #elif defined(_GNU_SOURCE) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 19deef5767..78c5cada75 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -841,13 +841,6 @@ _mesa_getenv( const char *var ) /** \name String */ /*@{*/ -/** Wrapper around strncpy() */ -char * -_mesa_strncpy( char *dest, const char *src, size_t n ) -{ - return strncpy(dest, src, n); -} - /** Wrapper around strlen() */ size_t _mesa_strlen( const char *s ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 0143be3ced..192dffe8c6 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, extern char * _mesa_getenv( const char *var ); -extern char * -_mesa_strncpy( char *dest, const char *src, size_t n ); - extern size_t _mesa_strlen( const char *s ); -- cgit v1.2.3 From 21d0c70b4b1c18dc1c3ac7d0fbd8a903d60f8be7 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:55 -0800 Subject: Remove _mesa_strlen in favor of plain strlen. --- src/mesa/main/cpuinfo.c | 2 +- src/mesa/main/extensions.c | 10 +++++----- src/mesa/main/imports.c | 9 +-------- src/mesa/main/imports.h | 3 --- src/mesa/main/shaders.c | 2 +- src/mesa/shader/arbprogram.c | 4 ++-- src/mesa/shader/atifragshader.c | 2 +- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/nvprogram.c | 4 ++-- src/mesa/shader/nvvertparse.c | 2 +- src/mesa/shader/prog_parameter.c | 4 ++-- src/mesa/shader/prog_uniform.c | 2 +- src/mesa/shader/slang/slang_compile.c | 10 +++++----- src/mesa/shader/slang/slang_emit.c | 2 +- src/mesa/shader/slang/slang_label.c | 2 +- src/mesa/shader/slang/slang_link.c | 2 +- src/mesa/shader/slang/slang_mem.c | 2 +- src/mesa/shader/slang/slang_utility.c | 2 +- src/mesa/shader/slang/slang_utility.h | 2 +- 19 files changed, 29 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/mesa/main/cpuinfo.c b/src/mesa/main/cpuinfo.c index b4bfb40eb1..79fcbc71c2 100644 --- a/src/mesa/main/cpuinfo.c +++ b/src/mesa/main/cpuinfo.c @@ -103,7 +103,7 @@ _mesa_get_cpu_string(void) #endif - assert(_mesa_strlen(buffer) < MAX_STRING); + assert(strlen(buffer) < MAX_STRING); return buffer; } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 87c1fac28a..6449f39c7f 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -574,8 +574,8 @@ _mesa_extension_is_enabled( GLcontext *ctx, const char *name ) static char * append(const char *a, const char *b) { - const GLuint aLen = a ? _mesa_strlen(a) : 0; - const GLuint bLen = b ? _mesa_strlen(b) : 0; + const GLuint aLen = a ? strlen(a) : 0; + const GLuint bLen = b ? strlen(b) : 0; char *s = _mesa_calloc(aLen + bLen + 1); if (s) { if (a) @@ -677,12 +677,12 @@ _mesa_make_extension_string( GLcontext *ctx ) /* first, compute length of the extension string */ for (i = 0 ; i < Elements(default_extensions) ; i++) { if (extension_enabled(ctx, i)) { - extStrLen += (GLuint)_mesa_strlen(default_extensions[i].name) + 1; + extStrLen += (GLuint) strlen(default_extensions[i].name) + 1; } } if (extraExt) - extStrLen += _mesa_strlen(extraExt) + 1; /* +1 for space */ + extStrLen += strlen(extraExt) + 1; /* +1 for space */ /* allocate the extension string */ s = (char *) _mesa_malloc(extStrLen); @@ -693,7 +693,7 @@ _mesa_make_extension_string( GLcontext *ctx ) extStrLen = 0; for (i = 0 ; i < Elements(default_extensions) ; i++) { if (extension_enabled(ctx, i)) { - GLuint len = (GLuint)_mesa_strlen(default_extensions[i].name); + GLuint len = (GLuint) strlen(default_extensions[i].name); _mesa_memcpy(s + extStrLen, default_extensions[i].name, len); extStrLen += len; s[extStrLen] = ' '; diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 78c5cada75..dc24ea0740 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -841,13 +841,6 @@ _mesa_getenv( const char *var ) /** \name String */ /*@{*/ -/** Wrapper around strlen() */ -size_t -_mesa_strlen( const char *s ) -{ - return strlen(s); -} - /** Wrapper around strcmp() */ int _mesa_strcmp( const char *s1, const char *s2 ) @@ -870,7 +863,7 @@ char * _mesa_strdup( const char *s ) { if (s) { - size_t l = _mesa_strlen(s); + size_t l = strlen(s); char *s2 = (char *) _mesa_malloc(l + 1); if (s2) strcpy(s2, s); diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 192dffe8c6..f66cf0d6f9 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, extern char * _mesa_getenv( const char *var ); -extern size_t -_mesa_strlen( const char *s ); - extern int _mesa_strcmp( const char *s1, const char *s2 ); diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index d0dc7e551c..b9c84eb792 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -447,7 +447,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, return; } if (length == NULL || length[i] < 0) - offsets[i] = _mesa_strlen(string[i]); + offsets[i] = strlen(string[i]); else offsets[i] = length[i]; /* accumulate string lengths */ diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 7e3040a6ef..a77ff7c5b1 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -910,7 +910,7 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) switch (pname) { case GL_PROGRAM_LENGTH_ARB: *params - = prog->String ? (GLint) _mesa_strlen((char *) prog->String) : 0; + = prog->String ? (GLint) strlen((char *) prog->String) : 0; return; case GL_PROGRAM_FORMAT_ARB: *params = prog->Format; @@ -1091,7 +1091,7 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) } if (prog->String) - _mesa_memcpy(dst, prog->String, _mesa_strlen((char *) prog->String)); + _mesa_memcpy(dst, prog->String, strlen((char *) prog->String)); else *dst = '\0'; } diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index 28dbf77b66..3e26c43c48 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -115,7 +115,7 @@ create_dst_mod_str(GLuint mod) if (mod & GL_SATURATE_BIT_ATI) strncat(ret_str, "|SAT", 1024); - if (_mesa_strlen(ret_str) == 0) + if (strlen(ret_str) == 0) strncat(ret_str, "NONE", 1024); return ret_str; } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 8ee7c93062..b219dfa6e7 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -378,7 +378,7 @@ Peek_Token(struct parse_state *parseState, GLubyte *token) parseState->pos += (-i); return GL_FALSE; } - len = (GLint)_mesa_strlen((const char *) token); + len = (GLint) strlen((const char *) token); parseState->pos += (i - len); return GL_TRUE; } diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index c3b10f5d9b..394b6a42d7 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -260,7 +260,7 @@ _mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params) *params = prog->Target; return; case GL_PROGRAM_LENGTH_NV: - *params = prog->String ?(GLint)_mesa_strlen((char *) prog->String) : 0; + *params = prog->String ?(GLint) strlen((char *) prog->String) : 0; return; case GL_PROGRAM_RESIDENT_NV: *params = prog->Resident; @@ -297,7 +297,7 @@ _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) } if (prog->String) { - MEMCPY(program, prog->String, _mesa_strlen((char *) prog->String)); + MEMCPY(program, prog->String, strlen((char *) prog->String)); } else { program[0] = 0; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index baff7658d1..90f795ab16 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -232,7 +232,7 @@ Peek_Token(struct parse_state *parseState, GLubyte *token) parseState->pos += (-i); return GL_FALSE; } - len = (GLint)_mesa_strlen((const char *) token); + len = (GLint) strlen((const char *) token); parseState->pos += (i - len); return GL_TRUE; } diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index d4970c4e44..0c52c254b5 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -538,7 +538,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, for (i = 0; i < (GLint) paramList->NumParameters; i++) { if (paramList->Parameters[i].Name && _mesa_strncmp(paramList->Parameters[i].Name, name, nameLen) == 0 - && _mesa_strlen(paramList->Parameters[i].Name) == (size_t)nameLen) + && strlen(paramList->Parameters[i].Name) == (size_t)nameLen) return i; } } @@ -723,7 +723,7 @@ _mesa_longest_parameter_name(const struct gl_program_parameter_list *list, return 0; for (i = 0; i < list->NumParameters; i++) { if (list->Parameters[i].Type == type) { - GLuint len = _mesa_strlen(list->Parameters[i].Name); + GLuint len = strlen(list->Parameters[i].Name); if (len > maxLen) maxLen = len; } diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c index 0642713148..cdfe158deb 100644 --- a/src/mesa/shader/prog_uniform.c +++ b/src/mesa/shader/prog_uniform.c @@ -142,7 +142,7 @@ _mesa_longest_uniform_name(const struct gl_uniform_list *list) GLint max = 0; GLuint i; for (i = 0; list && i < list->NumUniforms; i++) { - GLint len = (GLint)_mesa_strlen(list->Uniforms[i].Name); + GLint len = (GLint) strlen(list->Uniforms[i].Name); if (len > max) max = len; } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 33964e0c3b..65842ac0c8 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -167,7 +167,7 @@ static void parse_identifier_str(slang_parse_ctx * C, char **id) { *id = (char *) C->I; - C->I += _mesa_strlen(*id) + 1; + C->I += strlen(*id) + 1; } static slang_atom @@ -176,7 +176,7 @@ parse_identifier(slang_parse_ctx * C) const char *id; id = (const char *) C->I; - C->I += _mesa_strlen(id) + 1; + C->I += strlen(id) + 1; return slang_atom_pool_atom(C->atoms, id); } @@ -298,9 +298,9 @@ parse_float(slang_parse_ctx * C, float *number) parse_identifier_str(C, &fractional); parse_identifier_str(C, &exponent); - whole = (char *) _slang_alloc((_mesa_strlen(integral) + - _mesa_strlen(fractional) + - _mesa_strlen(exponent) + 3) * sizeof(char)); + whole = (char *) _slang_alloc((strlen(integral) + + strlen(fractional) + + strlen(exponent) + 3) * sizeof(char)); if (whole == NULL) { slang_info_log_memory(C->L); RETURN0; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 0f670360ee..fa3a63ea4b 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -754,7 +754,7 @@ instruction_annotation(gl_inst_opcode opcode, char *dstAnnot, s = (char *) malloc(len); sprintf(s, "%s = %s %s %s %s", dstAnnot, srcAnnot0, operator, srcAnnot1, srcAnnot2); - assert(_mesa_strlen(s) < len); + assert(strlen(s) < len); free(dstAnnot); free(srcAnnot0); diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c index 1ca1ef0c7c..1240621365 100644 --- a/src/mesa/shader/slang/slang_label.c +++ b/src/mesa/shader/slang/slang_label.c @@ -32,7 +32,7 @@ _slang_label_new_unique(const char *name) static int id = 1; slang_label *l = (slang_label *) _slang_alloc(sizeof(slang_label)); if (l) { - l->Name = (char *) _slang_alloc(_mesa_strlen(name) + 10); + l->Name = (char *) _slang_alloc(strlen(name) + 10); if (!l->Name) { _mesa_free(l); return NULL; diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 9c90d5c531..2906cb17c4 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -603,7 +603,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) for (i = 0; i < shProg->NumShaders; i++) { const struct gl_shader *shader = shProg->Shaders[i]; if (shader->Type == shaderType) { - shaderLengths[i] = _mesa_strlen(shader->Source); + shaderLengths[i] = strlen(shader->Source); totalLen += shaderLengths[i]; if (!firstShader) firstShader = shader; diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index dc5707a39b..c37e12fb7f 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -212,7 +212,7 @@ char * _slang_strdup(const char *s) { if (s) { - size_t l = _mesa_strlen(s); + size_t l = strlen(s); char *s2 = (char *) _slang_alloc(l + 1); if (s2) strcpy(s2, s); diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 950fba5611..e3b0491d97 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -35,7 +35,7 @@ char * slang_string_concat (char *dst, const char *src) { - return strcpy (dst + _mesa_strlen (dst), src); + return strcpy (dst + strlen (dst), src); } diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 3762cc9679..10071f2c17 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -34,7 +34,7 @@ #define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) #define slang_string_copy(dst, src) strcpy (dst, src) -#define slang_string_length(str) _mesa_strlen (str) +#define slang_string_length(str) strlen (str) char *slang_string_concat (char *, const char *); -- cgit v1.2.3 From 8d73aa6d1ae6e89bb2cd8f52f5586d569a4b6eeb Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:56 -0800 Subject: Remove _mesa_strcmp in favor of plain strcmp. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 12 ++++++------ src/mesa/drivers/fbdev/glfbdev.c | 2 +- src/mesa/drivers/osmesa/osmesa.c | 2 +- src/mesa/drivers/windows/gdi/mesa.def | 3 +-- src/mesa/drivers/windows/icd/mesa.def | 1 - src/mesa/drivers/x11/fakeglx.c | 12 ++++++------ src/mesa/glapi/gl_enums.py | 2 +- src/mesa/glapi/mesadef.py | 1 - src/mesa/main/enums.c | 2 +- src/mesa/main/extensions.c | 4 ++-- src/mesa/main/imports.c | 7 ------- src/mesa/main/imports.h | 3 --- src/mesa/shader/nvfragparse.c | 12 ++++++------ src/mesa/shader/nvvertparse.c | 6 +++--- src/mesa/shader/prog_parameter.c | 6 +++--- src/mesa/shader/prog_uniform.c | 2 +- src/mesa/shader/slang/slang_codegen.c | 8 ++++---- src/mesa/shader/slang/slang_compile.c | 3 +-- src/mesa/shader/slang/slang_print.c | 2 +- src/mesa/shader/slang/slang_utility.h | 2 +- 20 files changed, 39 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 7e86e68b68..971b6e71cb 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -447,12 +447,12 @@ get_env_visual(Display *dpy, int scr, const char *varname) sscanf( value, "%s %d", type, &depth ); - if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor; - else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor; - else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor; - else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor; - else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale; - else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray; + if (strcmp(type,"TrueColor")==0) xclass = TrueColor; + else if (strcmp(type,"DirectColor")==0) xclass = DirectColor; + else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor; + else if (strcmp(type,"StaticColor")==0) xclass = StaticColor; + else if (strcmp(type,"GrayScale")==0) xclass = GrayScale; + else if (strcmp(type,"StaticGray")==0) xclass = StaticGray; if (xclass>-1 && depth>0) { vis = get_visual( dpy, scr, depth, xclass ); diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 1a56b2395f..51bd23575f 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -330,7 +330,7 @@ glFBDevGetProcAddress( const char *procName ) }; const struct name_address *entry; for (entry = functions; entry->name; entry++) { - if (_mesa_strcmp(entry->name, procName) == 0) { + if (strcmp(entry->name, procName) == 0) { return entry->func; } } diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index bac8a9ef14..1c469b15bf 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1579,7 +1579,7 @@ OSMesaGetProcAddress( const char *funcName ) { int i; for (i = 0; functions[i].Name; i++) { - if (_mesa_strcmp(functions[i].Name, funcName) == 0) + if (strcmp(functions[i].Name, funcName) == 0) return functions[i].Function; } return _glapi_get_proc_address(funcName); diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index a31dc55e3f..10e4c4a9c7 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -926,7 +926,6 @@ EXPORTS _mesa_store_texsubimage1d _mesa_store_texsubimage2d _mesa_store_texsubimage3d - _mesa_strcmp _mesa_test_proxy_teximage _mesa_reference_framebuffer _mesa_update_framebuffer_visual @@ -966,4 +965,4 @@ EXPORTS _tnl_InvalidateState _tnl_run_pipeline _tnl_program_string - _tnl_RasterPos \ No newline at end of file + _tnl_RasterPos diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index 25ac08a2f0..c4b9bff30d 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -72,7 +72,6 @@ EXPORTS _mesa_store_texsubimage1d _mesa_store_texsubimage2d _mesa_store_texsubimage3d - _mesa_strcmp _mesa_test_proxy_teximage _mesa_Viewport _mesa_meta_CopyColorSubTable diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 3b8c41b918..fd6d71317b 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -621,12 +621,12 @@ get_env_visual(Display *dpy, int scr, const char *varname) sscanf( value, "%s %d", type, &depth ); - if (_mesa_strcmp(type,"TrueColor")==0) xclass = TrueColor; - else if (_mesa_strcmp(type,"DirectColor")==0) xclass = DirectColor; - else if (_mesa_strcmp(type,"PseudoColor")==0) xclass = PseudoColor; - else if (_mesa_strcmp(type,"StaticColor")==0) xclass = StaticColor; - else if (_mesa_strcmp(type,"GrayScale")==0) xclass = GrayScale; - else if (_mesa_strcmp(type,"StaticGray")==0) xclass = StaticGray; + if (strcmp(type,"TrueColor")==0) xclass = TrueColor; + else if (strcmp(type,"DirectColor")==0) xclass = DirectColor; + else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor; + else if (strcmp(type,"StaticColor")==0) xclass = StaticColor; + else if (strcmp(type,"GrayScale")==0) xclass = GrayScale; + else if (strcmp(type,"StaticGray")==0) xclass = StaticGray; if (xclass>-1 && depth>0) { vis = get_visual( dpy, scr, depth, xclass ); diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py index acaa06ab37..adb0ca526c 100644 --- a/src/mesa/glapi/gl_enums.py +++ b/src/mesa/glapi/gl_enums.py @@ -70,7 +70,7 @@ typedef int (*cfunc)(const void *, const void *); */ static int compar_name( const char *a, const enum_elt *b ) { - return _mesa_strcmp( a, & enum_string_table[ b->offset ] ); + return strcmp( a, & enum_string_table[ b->offset ] ); } /** diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 342c9cde46..8df04143f3 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -152,7 +152,6 @@ def PrintTail(): print '\t_mesa_store_texsubimage1d' print '\t_mesa_store_texsubimage2d' print '\t_mesa_store_texsubimage3d' - print '\t_mesa_strcmp' print '\t_mesa_test_proxy_teximage' print '\t_mesa_Viewport' print '\t_mesa_meta_CopyColorSubTable' diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 1d495b7ae5..fc7f8beb50 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -5181,7 +5181,7 @@ typedef int (*cfunc)(const void *, const void *); */ static int compar_name( const char *a, const enum_elt *b ) { - return _mesa_strcmp( a, & enum_string_table[ b->offset ] ); + return strcmp( a, & enum_string_table[ b->offset ] ); } /** diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 6449f39c7f..9b0b5f06fc 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -498,7 +498,7 @@ set_extension( GLcontext *ctx, const char *name, GLboolean state ) } for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (_mesa_strcmp(default_extensions[i].name, name) == 0) { + if (strcmp(default_extensions[i].name, name) == 0) { if (default_extensions[i].flag_offset) { GLboolean *enabled = base + default_extensions[i].flag_offset; *enabled = state; @@ -560,7 +560,7 @@ _mesa_extension_is_enabled( GLcontext *ctx, const char *name ) GLuint i; for (i = 0 ; i < Elements(default_extensions) ; i++) { - if (_mesa_strcmp(default_extensions[i].name, name) == 0) { + if (strcmp(default_extensions[i].name, name) == 0) { return extension_enabled(ctx, i); } } diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index dc24ea0740..a48f05c536 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -841,13 +841,6 @@ _mesa_getenv( const char *var ) /** \name String */ /*@{*/ -/** Wrapper around strcmp() */ -int -_mesa_strcmp( const char *s1, const char *s2 ) -{ - return strcmp(s1, s2); -} - /** Wrapper around strncmp() */ int _mesa_strncmp( const char *s1, const char *s2, size_t n ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index f66cf0d6f9..867bce763c 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, extern char * _mesa_getenv( const char *var ); -extern int -_mesa_strcmp( const char *s1, const char *s2 ); - extern int _mesa_strncmp( const char *s1, const char *s2, size_t n ); diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index b219dfa6e7..661e7a2a7e 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -802,7 +802,7 @@ Parse_FragReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR; } for (j = 0; InputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, InputRegisters[j]) == 0) { + if (strcmp((const char *) token, InputRegisters[j]) == 0) { *tempRegNum = j; parseState->inputsRead |= (1 << j); break; @@ -835,13 +835,13 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) RETURN_ERROR; /* try to match an output register name */ - if (_mesa_strcmp((char *) token, "COLR") == 0 || - _mesa_strcmp((char *) token, "COLH") == 0) { + if (strcmp((char *) token, "COLR") == 0 || + strcmp((char *) token, "COLH") == 0) { /* note that we don't distinguish between COLR and COLH */ *outputRegNum = FRAG_RESULT_COLOR; parseState->outputsWritten |= (1 << FRAG_RESULT_COLOR); } - else if (_mesa_strcmp((char *) token, "DEPR") == 0) { + else if (strcmp((char *) token, "DEPR") == 0) { *outputRegNum = FRAG_RESULT_DEPTH; parseState->outputsWritten |= (1 << FRAG_RESULT_DEPTH); } @@ -868,8 +868,8 @@ Parse_MaskedDstReg(struct parse_state *parseState, if (!Peek_Token(parseState, token)) RETURN_ERROR; - if (_mesa_strcmp((const char *) token, "RC") == 0 || - _mesa_strcmp((const char *) token, "HC") == 0) { + if (strcmp((const char *) token, "RC") == 0 || + strcmp((const char *) token, "HC") == 0) { /* a write-only register */ dstReg->File = PROGRAM_WRITE_ONLY; if (!Parse_DummyReg(parseState, &idx)) diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 90f795ab16..a983c3ddcf 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -403,7 +403,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg) srcReg->File = PROGRAM_ENV_PARAM; srcReg->Index = reg; } - else if (_mesa_strcmp((const char *) token, "A0") == 0) { + else if (strcmp((const char *) token, "A0") == 0) { /* address register "A0.x" */ if (!Parse_AddrReg(parseState)) RETURN_ERROR; @@ -487,7 +487,7 @@ Parse_AttribReg(struct parse_state *parseState, GLint *tempRegNum) } else { for (j = 0; InputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, InputRegisters[j]) == 0) { + if (strcmp((const char *) token, InputRegisters[j]) == 0) { *tempRegNum = j; break; } @@ -531,7 +531,7 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) /* try to match an output register name */ for (j = start; OutputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, OutputRegisters[j]) == 0) { + if (strcmp((const char *) token, OutputRegisters[j]) == 0) { *outputRegNum = j; break; } diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 0c52c254b5..b0ccf7bd8a 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -215,7 +215,7 @@ _mesa_add_named_constant(struct gl_program_parameter_list *paramList, pvals[1] == values[1] && pvals[2] == values[2] && pvals[3] == values[3] && - _mesa_strcmp(paramList->Parameters[pos].Name, name) == 0) { + strcmp(paramList->Parameters[pos].Name, name) == 0) { /* Same name and value is already in the param list - reuse it */ return pos; } @@ -325,7 +325,7 @@ _mesa_use_uniform(struct gl_program_parameter_list *paramList, for (i = 0; i < paramList->NumParameters; i++) { struct gl_program_parameter *p = paramList->Parameters + i; if ((p->Type == PROGRAM_UNIFORM || p->Type == PROGRAM_SAMPLER) && - _mesa_strcmp(p->Name, name) == 0) { + strcmp(p->Name, name) == 0) { p->Used = GL_TRUE; /* Note that large uniforms may occupy several slots so we're * not done searching yet. @@ -529,7 +529,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, /* name is null-terminated */ for (i = 0; i < (GLint) paramList->NumParameters; i++) { if (paramList->Parameters[i].Name && - _mesa_strcmp(paramList->Parameters[i].Name, name) == 0) + strcmp(paramList->Parameters[i].Name, name) == 0) return i; } } diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c index cdfe158deb..a831ce8cb6 100644 --- a/src/mesa/shader/prog_uniform.c +++ b/src/mesa/shader/prog_uniform.c @@ -128,7 +128,7 @@ _mesa_lookup_uniform(const struct gl_uniform_list *list, const char *name) { GLuint i; for (i = 0; list && i < list->NumUniforms; i++) { - if (!_mesa_strcmp(list->Uniforms[i].Name, name)) { + if (!strcmp(list->Uniforms[i].Name, name)) { return i; } } diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index fe4bddf9ad..2280ceb9ee 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1020,7 +1020,7 @@ slang_substitute(slang_assemble_ctx *A, slang_operation *oper, GLuint i; v = _slang_variable_locate(oper->locals, id, GL_TRUE); if (!v) { - if (_mesa_strcmp((char *) oper->a_id, "__notRetFlag")) + if (strcmp((char *) oper->a_id, "__notRetFlag")) _mesa_problem(NULL, "var %s not found!\n", (char *) oper->a_id); return; } @@ -1658,7 +1658,7 @@ slang_find_asm_info(const char *name) { GLuint i; for (i = 0; AsmInfo[i].Name; i++) { - if (_mesa_strcmp(AsmInfo[i].Name, name) == 0) { + if (strcmp(AsmInfo[i].Name, name) == 0) { return AsmInfo + i; } } @@ -2317,7 +2317,7 @@ _slang_is_vec_mat_type(const char *name) }; int i; for (i = 0; vecmat_types[i]; i++) - if (_mesa_strcmp(name, vecmat_types[i]) == 0) + if (strcmp(name, vecmat_types[i]) == 0) return GL_TRUE; return GL_FALSE; } @@ -5224,7 +5224,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) slang_ir_node *n; GLboolean success = GL_TRUE; - if (_mesa_strcmp((char *) fun->header.a_name, "main") != 0) { + if (strcmp((char *) fun->header.a_name, "main") != 0) { /* we only really generate code for main, all other functions get * inlined or codegen'd upon an actual call. */ diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 65842ac0c8..1a2c39104b 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2563,8 +2563,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, { slang_function *func; success = parse_function(C, &o, 1, &func); - if (success && - _mesa_strcmp((char *) func->header.a_name, "main") == 0) { + if (success && strcmp((char *) func->header.a_name, "main") == 0) { /* found main() */ mainFunc = func; } diff --git a/src/mesa/shader/slang/slang_print.c b/src/mesa/shader/slang/slang_print.c index 98c7877534..6efc5b7826 100644 --- a/src/mesa/shader/slang/slang_print.c +++ b/src/mesa/shader/slang/slang_print.c @@ -698,7 +698,7 @@ slang_print_function(const slang_function *f, GLboolean body) GLuint i; #if 0 - if (_mesa_strcmp((char *) f->header.a_name, "main") != 0) + if (strcmp((char *) f->header.a_name, "main") != 0) return; #endif diff --git a/src/mesa/shader/slang/slang_utility.h b/src/mesa/shader/slang/slang_utility.h index 10071f2c17..2c0d0bcbb2 100644 --- a/src/mesa/shader/slang/slang_utility.h +++ b/src/mesa/shader/slang/slang_utility.h @@ -32,7 +32,7 @@ #define static_assert(expr) do { int _array[(expr) ? 1 : -1]; (void) _array[0]; } while (0) -#define slang_string_compare(str1, str2) _mesa_strcmp (str1, str2) +#define slang_string_compare(str1, str2) strcmp (str1, str2) #define slang_string_copy(dst, src) strcpy (dst, src) #define slang_string_length(str) strlen (str) -- cgit v1.2.3 From 9d9afe9393fde99858ddf40e478bc16cf44e60dc Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:57 -0800 Subject: Remove _mesa_strncmp in favor of plain strncmp. --- src/mesa/main/imports.c | 7 ------- src/mesa/main/imports.h | 3 --- src/mesa/shader/nvfragparse.c | 6 +++--- src/mesa/shader/nvvertparse.c | 6 +++--- src/mesa/shader/prog_parameter.c | 2 +- src/mesa/shader/slang/slang_compile.c | 2 +- 6 files changed, 8 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index a48f05c536..4c5e99fbbe 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -841,13 +841,6 @@ _mesa_getenv( const char *var ) /** \name String */ /*@{*/ -/** Wrapper around strncmp() */ -int -_mesa_strncmp( const char *s1, const char *s2, size_t n ) -{ - return strncmp(s1, s2, n); -} - /** * Implemented using _mesa_malloc() and strcpy. * Note that NULL is handled accordingly. diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 867bce763c..3c8f734e36 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -611,9 +611,6 @@ _mesa_bsearch( const void *key, const void *base, size_t nmemb, size_t size, extern char * _mesa_getenv( const char *var ); -extern int -_mesa_strncmp( const char *s1, const char *s2, size_t n ); - extern char * _mesa_strdup( const char *s ); diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 661e7a2a7e..79b2e5989c 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -224,7 +224,7 @@ MatchInstruction(const GLubyte *token) result.suffixes = 0; for (inst = Instructions; inst->name; inst++) { - if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { + if (strncmp((const char *) token, inst->name, 3) == 0) { /* matched! */ int i = 3; result = *inst; @@ -1495,11 +1495,11 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, _mesa_set_program_error(ctx, -1, NULL); /* check the program header */ - if (_mesa_strncmp((const char *) programString, "!!FP1.0", 7) == 0) { + if (strncmp((const char *) programString, "!!FP1.0", 7) == 0) { target = GL_FRAGMENT_PROGRAM_NV; parseState.pos = programString + 7; } - else if (_mesa_strncmp((const char *) programString, "!!FCP1.0", 8) == 0) { + else if (strncmp((const char *) programString, "!!FCP1.0", 8) == 0) { /* fragment / register combiner program - not supported */ _mesa_set_program_error(ctx, 0, "Invalid fragment program header"); _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(bad header)"); diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index a983c3ddcf..cd5b57ff74 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1313,18 +1313,18 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, _mesa_set_program_error(ctx, -1, NULL); /* check the program header */ - if (_mesa_strncmp((const char *) programString, "!!VP1.0", 7) == 0) { + if (strncmp((const char *) programString, "!!VP1.0", 7) == 0) { target = GL_VERTEX_PROGRAM_NV; parseState.pos = programString + 7; parseState.isStateProgram = GL_FALSE; } - else if (_mesa_strncmp((const char *) programString, "!!VP1.1", 7) == 0) { + else if (strncmp((const char *) programString, "!!VP1.1", 7) == 0) { target = GL_VERTEX_PROGRAM_NV; parseState.pos = programString + 7; parseState.isStateProgram = GL_FALSE; parseState.isVersion1_1 = GL_TRUE; } - else if (_mesa_strncmp((const char *) programString, "!!VSP1.0", 8) == 0) { + else if (strncmp((const char *) programString, "!!VSP1.0", 8) == 0) { target = GL_VERTEX_STATE_PROGRAM_NV; parseState.pos = programString + 8; parseState.isStateProgram = GL_TRUE; diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index b0ccf7bd8a..435e6ceb09 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -537,7 +537,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, /* name is not null-terminated, use nameLen */ for (i = 0; i < (GLint) paramList->NumParameters; i++) { if (paramList->Parameters[i].Name && - _mesa_strncmp(paramList->Parameters[i].Name, name, nameLen) == 0 + strncmp(paramList->Parameters[i].Name, name, nameLen) == 0 && strlen(paramList->Parameters[i].Name) == (size_t)nameLen) return i; } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 1a2c39104b..41d51cd98a 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -65,7 +65,7 @@ static GLboolean legal_identifier(slang_atom name) { /* "gl_" is a reserved prefix */ - if (_mesa_strncmp((char *) name, "gl_", 3) == 0) { + if (strncmp((char *) name, "gl_", 3) == 0) { return GL_FALSE; } return GL_TRUE; -- cgit v1.2.3 From 60b0cae412029e53654f38d0de151908f1feb310 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:58 -0800 Subject: Remove _mesa_atoi in favor of plain atoi. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 4 ++-- src/mesa/drivers/x11/fakeglx.c | 4 ++-- src/mesa/main/imports.c | 9 +-------- src/mesa/main/imports.h | 3 --- src/mesa/shader/nvfragparse.c | 6 +++--- src/mesa/shader/nvvertparse.c | 10 +++++----- src/mesa/shader/shader_api.c | 2 +- 7 files changed, 14 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 971b6e71cb..e3b52f521b 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -280,7 +280,7 @@ default_depth_bits(void) int zBits; const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS"); if (zEnv) - zBits = _mesa_atoi(zEnv); + zBits = atoi(zEnv); else zBits = DEFAULT_SOFTWARE_DEPTH_BITS; return zBits; @@ -292,7 +292,7 @@ default_alpha_bits(void) int aBits; const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS"); if (aEnv) - aBits = _mesa_atoi(aEnv); + aBits = atoi(aEnv); else aBits = 0; return aBits; diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index fd6d71317b..075b9a1e5f 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -378,7 +378,7 @@ default_depth_bits(void) int zBits; const char *zEnv = _mesa_getenv("MESA_GLX_DEPTH_BITS"); if (zEnv) - zBits = _mesa_atoi(zEnv); + zBits = atoi(zEnv); else zBits = DEFAULT_SOFTWARE_DEPTH_BITS; return zBits; @@ -390,7 +390,7 @@ default_alpha_bits(void) int aBits; const char *aEnv = _mesa_getenv("MESA_GLX_ALPHA_BITS"); if (aEnv) - aBits = _mesa_atoi(aEnv); + aBits = atoi(aEnv); else aBits = 0; return aBits; diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 4c5e99fbbe..2a0952c7af 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -860,13 +860,6 @@ _mesa_strdup( const char *s ) } } -/** Wrapper around atoi() */ -int -_mesa_atoi(const char *s) -{ - return atoi(s); -} - /** Wrapper around strtod() */ double _mesa_strtod( const char *s, char **end ) @@ -982,7 +975,7 @@ output_if_debug(const char *prefixString, const char *outputString, * set *to any value*. */ #ifdef DEBUG - debug = (env != NULL && _mesa_atoi(env) == 0) ? 0 : 1; + debug = (env != NULL && atoi(env) == 0) ? 0 : 1; #else debug = (env != NULL) ? 1 : 0; #endif diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 3c8f734e36..124642178c 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -614,9 +614,6 @@ _mesa_getenv( const char *var ); extern char * _mesa_strdup( const char *s ); -extern int -_mesa_atoi( const char *s ); - extern double _mesa_strtod( const char *s, char **end ); diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 79b2e5989c..ff3a921777 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -580,7 +580,7 @@ Parse_TextureImageId(struct parse_state *parseState, imageSrc[2] != 'X') { RETURN_ERROR1("Expected TEX# source"); } - unit = _mesa_atoi((const char *) imageSrc + 3); + unit = atoi((const char *) imageSrc + 3); if ((unit < 0 || unit > MAX_TEXTURE_IMAGE_UNITS) || (unit == 0 && (imageSrc[3] != '0' || imageSrc[4] != 0))) { RETURN_ERROR1("Invalied TEX# source index"); @@ -717,7 +717,7 @@ Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR1("Expected R## or H##"); if (IsDigit(token[1])) { - GLint reg = _mesa_atoi((const char *) (token + 1)); + GLint reg = atoi((const char *) (token + 1)); if (token[0] == 'H') reg += 32; if (reg >= MAX_NV_FRAGMENT_PROGRAM_TEMPS) @@ -768,7 +768,7 @@ Parse_ProgramParamReg(struct parse_state *parseState, GLint *regNum) if (IsDigit(token[0])) { /* a numbered program parameter register */ - GLint reg = _mesa_atoi((const char *) token); + GLint reg = atoi((const char *) token); if (reg >= MAX_NV_FRAGMENT_PROGRAM_PARAMS) RETURN_ERROR1("Invalid constant program number"); *regNum = reg; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index cd5b57ff74..630de7c2d7 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -309,7 +309,7 @@ Parse_TempReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR1("Expected R##"); if (IsDigit(token[1])) { - GLint reg = _mesa_atoi((char *) (token + 1)); + GLint reg = atoi((char *) (token + 1)); if (reg >= MAX_NV_VERTEX_PROGRAM_TEMPS) RETURN_ERROR1("Bad temporary register name"); *tempRegNum = reg; @@ -363,7 +363,7 @@ Parse_AbsParamReg(struct parse_state *parseState, GLint *regNum) if (IsDigit(token[0])) { /* a numbered program parameter register */ - GLint reg = _mesa_atoi((char *) token); + GLint reg = atoi((char *) token); if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS) RETURN_ERROR1("Bad program parameter number"); *regNum = reg; @@ -397,7 +397,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg) /* a numbered program parameter register */ GLint reg; (void) Parse_Token(parseState, token); - reg = _mesa_atoi((char *) token); + reg = atoi((char *) token); if (reg >= MAX_NV_VERTEX_PROGRAM_PARAMS) RETURN_ERROR1("Bad program parameter number"); srcReg->File = PROGRAM_ENV_PARAM; @@ -423,7 +423,7 @@ Parse_ParamReg(struct parse_state *parseState, struct prog_src_register *srcReg) RETURN_ERROR; if (IsDigit(token[0])) { - const GLint k = _mesa_atoi((char *) token); + const GLint k = atoi((char *) token); if (sign == '-') { if (k > 64) RETURN_ERROR1("Bad address offset"); @@ -480,7 +480,7 @@ Parse_AttribReg(struct parse_state *parseState, GLint *tempRegNum) RETURN_ERROR1("Only v[0] accessible in vertex state programs"); if (IsDigit(token[0])) { - GLint reg = _mesa_atoi((char *) token); + GLint reg = atoi((char *) token); if (reg >= MAX_NV_VERTEX_PROGRAM_INPUTS) RETURN_ERROR1("Bad vertex attribute register name"); *tempRegNum = reg; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index c3b49ed4d4..44310d2e61 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1385,7 +1385,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) location = _mesa_lookup_uniform(shProg->Uniforms, newName); if (location >= 0) { - const GLint element = _mesa_atoi(c + 1); + const GLint element = atoi(c + 1); if (element > 0) { /* get type of the uniform array element */ struct gl_program_parameter *p; -- cgit v1.2.3 From c7ac486261ad30ef654f6d0b1608da4e8483cd40 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:50:59 -0800 Subject: Remove _mesa_memcpy in favor of plain memcpy. This may break the SUNOS4 build, but it's no longer relevant. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 4 +- src/mesa/drivers/common/driverfuncs.c | 2 +- src/mesa/drivers/common/meta.c | 12 +++--- src/mesa/drivers/dri/fb/fb_dri.c | 6 +-- src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c | 6 +-- src/mesa/drivers/dri/r300/r300_draw.c | 4 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- src/mesa/drivers/dri/r600/r700_render.c | 4 +- .../drivers/dri/radeon/radeon_buffer_objects.c | 6 +-- src/mesa/drivers/dri/unichrome/via_tex.c | 4 +- src/mesa/drivers/fbdev/glfbdev.c | 2 +- src/mesa/drivers/windows/gdi/mesa.def | 1 - src/mesa/drivers/windows/icd/mesa.def | 1 - src/mesa/drivers/x11/fakeglx.c | 4 +- src/mesa/glapi/mesadef.py | 1 - src/mesa/main/attrib.c | 2 +- src/mesa/main/bitset.h | 2 +- src/mesa/main/bufferobj.c | 8 ++-- src/mesa/main/colortab.c | 2 +- src/mesa/main/dlist.c | 10 ++--- src/mesa/main/extensions.c | 6 +-- src/mesa/main/image.c | 48 +++++++++++----------- src/mesa/main/imports.c | 15 +------ src/mesa/main/imports.h | 5 +-- src/mesa/main/macros.h | 2 +- src/mesa/main/renderbuffer.c | 24 +++++------ src/mesa/main/shaders.c | 4 +- src/mesa/main/syncobj.c | 2 +- src/mesa/main/texgetimage.c | 6 +-- src/mesa/main/texstore.c | 2 +- src/mesa/shader/arbprogram.c | 2 +- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/nvvertparse.c | 2 +- src/mesa/shader/prog_instruction.c | 2 +- src/mesa/shader/program.c | 2 +- src/mesa/shader/program_parse.tab.c | 2 +- src/mesa/shader/program_parse.y | 2 +- src/mesa/shader/shader_api.c | 2 +- src/mesa/shader/slang/slang_compile_operation.c | 6 +-- src/mesa/shader/slang/slang_link.c | 2 +- src/mesa/shader/slang/slang_mem.c | 2 +- src/mesa/shader/slang/slang_utility.c | 4 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/swrast/s_blend.c | 2 +- src/mesa/swrast/s_copypix.c | 14 +++---- src/mesa/swrast/s_drawpix.c | 2 +- src/mesa/swrast/s_span.c | 16 ++++---- src/mesa/swrast/s_stencil.c | 8 ++-- src/mesa/tnl/t_vertex.c | 2 +- src/mesa/tnl/t_vertex_generic.c | 6 +-- src/mesa/vbo/vbo_exec_api.c | 20 ++++----- src/mesa/vbo/vbo_exec_draw.c | 16 ++++---- src/mesa/vbo/vbo_save_api.c | 20 ++++----- src/mesa/vf/vf.c | 2 +- 54 files changed, 159 insertions(+), 178 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index e3b52f521b..9093a0eae9 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -1020,7 +1020,7 @@ glXChooseVisual( Display *dpy, int screen, int *list ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; } @@ -1809,7 +1809,7 @@ glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; #endif diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 49d4aaedb0..4f6f083677 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -120,7 +120,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->FreeTexImageData = _mesa_free_texture_image_data; driver->MapTexture = NULL; driver->UnmapTexture = NULL; - driver->TextureMemCpy = _mesa_memcpy; + driver->TextureMemCpy = memcpy; driver->IsTextureResident = NULL; driver->UpdateTexturePalette = NULL; diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 7116d920f7..4dd2293b24 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -493,12 +493,12 @@ _mesa_meta_begin(GLcontext *ctx, GLbitfield state) if (state & META_TRANSFORM) { GLuint activeTexture = ctx->Texture.CurrentUnit; - _mesa_memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m, - 16 * sizeof(GLfloat)); - _mesa_memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m, - 16 * sizeof(GLfloat)); - _mesa_memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m, - 16 * sizeof(GLfloat)); + memcpy(save->ModelviewMatrix, ctx->ModelviewMatrixStack.Top->m, + 16 * sizeof(GLfloat)); + memcpy(save->ProjectionMatrix, ctx->ProjectionMatrixStack.Top->m, + 16 * sizeof(GLfloat)); + memcpy(save->TextureMatrix, ctx->TextureMatrixStack[0].Top->m, + 16 * sizeof(GLfloat)); save->MatrixMode = ctx->Transform.MatrixMode; /* set 1:1 vertex:pixel coordinate transform */ _mesa_ActiveTextureARB(GL_TEXTURE0); diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index f37241dd69..0675bb9894 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -511,10 +511,8 @@ fbSwapBuffers( __DRIdrawable *dPriv ) ASSERT(backBuffer); for (i = 0; i < dPriv->h; i++) { - _mesa_memcpy(tmp, (char *) backBuffer + offset, - currentPitch); - _mesa_memcpy((char *) frontBuffer + offset, tmp, - currentPitch); + memcpy(tmp, (char *) backBuffer + offset, currentPitch); + memcpy((char *) frontBuffer + offset, tmp, currentPitch); offset += currentPitch; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c index 1118b96de1..5906ad6d39 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c @@ -72,7 +72,7 @@ nouveau_bufferobj_data(GLcontext *ctx, GLenum target, GLsizeiptrARB size, if (data) { nouveau_bo_map(nbo->bo, NOUVEAU_BO_WR); - _mesa_memcpy(nbo->bo->map, data, size); + memcpy(nbo->bo->map, data, size); nouveau_bo_unmap(nbo->bo); } @@ -87,7 +87,7 @@ nouveau_bufferobj_subdata(GLcontext *ctx, GLenum target, GLintptrARB offset, struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj); nouveau_bo_map(nbo->bo, NOUVEAU_BO_WR); - _mesa_memcpy(nbo->bo->map + offset, data, size); + memcpy(nbo->bo->map + offset, data, size); nouveau_bo_unmap(nbo->bo); } @@ -99,7 +99,7 @@ nouveau_bufferobj_get_subdata(GLcontext *ctx, GLenum target, GLintptrARB offset, struct nouveau_bufferobj *nbo = to_nouveau_bufferobj(obj); nouveau_bo_map(nbo->bo, NOUVEAU_BO_RD); - _mesa_memcpy(data, nbo->bo->map + offset, size); + memcpy(data, nbo->bo->map + offset, size); nouveau_bo_unmap(nbo->bo); } diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c index 3efa0e3a16..282c0e18bc 100644 --- a/src/mesa/drivers/dri/r300/r300_draw.c +++ b/src/mesa/drivers/dri/r300/r300_draw.c @@ -177,7 +177,7 @@ static void r300SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer radeon_bo_map(r300->ind_buf.bo, 1); assert(r300->ind_buf.bo->ptr != NULL); dst_ptr = ADD_POINTERS(r300->ind_buf.bo->ptr, r300->ind_buf.bo_offset); - _mesa_memcpy(dst_ptr, src_ptr, size); + memcpy(dst_ptr, src_ptr, size); radeon_bo_unmap(r300->ind_buf.bo); r300->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); @@ -314,7 +314,7 @@ static void r300AlignDataToDword(GLcontext *ctx, const struct gl_client_array *i int i; for (i = 0; i < count; ++i) { - _mesa_memcpy(dst_ptr, src_ptr, input->StrideB); + memcpy(dst_ptr, src_ptr, input->StrideB); src_ptr += input->StrideB; dst_ptr += dst_stride; } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 3a8d5fb745..efdcdb7848 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -235,7 +235,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, vp = _mesa_calloc(sizeof(*vp)); vp->Base = _mesa_clone_vertex_program(ctx, mesa_vp); - _mesa_memcpy(&vp->key, wanted_key, sizeof(vp->key)); + memcpy(&vp->key, wanted_key, sizeof(vp->key)); rc_init(&compiler.Base); compiler.Base.Debug = (RADEON_DEBUG & RADEON_VERTS) ? GL_TRUE : GL_FALSE; diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 8f14af7472..fdd02fac23 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -594,7 +594,7 @@ static void r700AlignDataToDword(GLcontext *ctx, for (i = 0; i < count; ++i) { - _mesa_memcpy(dst_ptr, src_ptr, input->StrideB); + memcpy(dst_ptr, src_ptr, input->StrideB); src_ptr += input->StrideB; dst_ptr += dst_stride; } @@ -855,7 +855,7 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer assert(context->ind_buf.bo->ptr != NULL); dst_ptr = ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - _mesa_memcpy(dst_ptr, src_ptr, size); + memcpy(dst_ptr, src_ptr, size); radeon_bo_unmap(context->ind_buf.bo); context->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c index 99d3ec7005..bc5915d3e4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c +++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c @@ -114,7 +114,7 @@ radeonBufferData(GLcontext * ctx, if (data != NULL) { radeon_bo_map(radeon_obj->bo, GL_TRUE); - _mesa_memcpy(radeon_obj->bo->ptr, data, size); + memcpy(radeon_obj->bo->ptr, data, size); radeon_bo_unmap(radeon_obj->bo); } @@ -145,7 +145,7 @@ radeonBufferSubData(GLcontext * ctx, radeon_bo_map(radeon_obj->bo, GL_TRUE); - _mesa_memcpy(radeon_obj->bo->ptr + offset, data, size); + memcpy(radeon_obj->bo->ptr + offset, data, size); radeon_bo_unmap(radeon_obj->bo); } @@ -165,7 +165,7 @@ radeonGetBufferSubData(GLcontext * ctx, radeon_bo_map(radeon_obj->bo, GL_FALSE); - _mesa_memcpy(data, radeon_obj->bo->ptr + offset, size); + memcpy(data, radeon_obj->bo->ptr + offset, size); radeon_bo_unmap(radeon_obj->bo); } diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 917f975466..a64f093326 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -951,11 +951,11 @@ void viaInitTextureFuncs(struct dd_function_table * functions) * Note that this function is currently disabled in via_tris.c too. */ if (getenv("VIA_NO_SSE")) - functions->TextureMemCpy = _mesa_memcpy; + functions->TextureMemCpy = memcpy; else functions->TextureMemCpy = via_sse_memcpy; #else - functions->TextureMemCpy = _mesa_memcpy; + functions->TextureMemCpy = memcpy; #endif functions->UpdateTexturePalette = 0; diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 51bd23575f..49002512aa 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -742,7 +742,7 @@ glFBDevSwapBuffers( GLFBDevBufferPtr buffer ) ASSERT(frontrb->Base.Data); ASSERT(backrb->Base.Data); - _mesa_memcpy(frontrb->Base.Data, backrb->Base.Data, buffer->size); + memcpy(frontrb->Base.Data, backrb->Base.Data, buffer->size); } diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index 10e4c4a9c7..f82db88bc5 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -899,7 +899,6 @@ EXPORTS _mesa_init_renderbuffer _mesa_initialize_context _mesa_make_current - _mesa_memcpy _mesa_memset _mesa_new_array_object _mesa_new_framebuffer diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index c4b9bff30d..06c384d8b0 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -54,7 +54,6 @@ EXPORTS _mesa_init_driver_functions _mesa_initialize_context _mesa_make_current - _mesa_memcpy _mesa_memset _mesa_new_buffer_object _mesa_new_texture_object diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 075b9a1e5f..291e90c822 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1383,7 +1383,7 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; #endif @@ -2162,7 +2162,7 @@ Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) /* create a new vishandle - the cached one may be stale */ xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { - _mesa_memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); + memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } return xmvis->vishandle; #endif diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 8df04143f3..c7e2c086f7 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -134,7 +134,6 @@ def PrintTail(): print '\t_mesa_init_default_imports' print '\t_mesa_initialize_context' print '\t_mesa_make_current' - print '\t_mesa_memcpy' print '\t_mesa_memset' print '\t_mesa_new_buffer_object' print '\t_mesa_new_texture_object' diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 3fbdba2b3f..881644cdaf 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -432,7 +432,7 @@ _mesa_PushAttrib(GLbitfield mask) _mesa_lock_context_textures(ctx); /* copy/save the bulk of texture state here */ - _mesa_memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture)); + memcpy(&texstate->Texture, &ctx->Texture, sizeof(ctx->Texture)); /* Save references to the currently bound texture objects so they don't * accidentally get deleted while referenced in the attribute stack. diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h index f2709abc9f..5463c0a3c9 100644 --- a/src/mesa/main/bitset.h +++ b/src/mesa/main/bitset.h @@ -47,7 +47,7 @@ /* bitset operations */ -#define BITSET_COPY(x, y) _mesa_memcpy( (x), (y), sizeof (x) ) +#define BITSET_COPY(x, y) memcpy( (x), (y), sizeof (x) ) #define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0) #define BITSET_ZERO(x) _mesa_memset( (x), 0, sizeof (x) ) #define BITSET_ONES(x) _mesa_memset( (x), 0xff, sizeof (x) ) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index dabb1386ca..c735661dc2 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -339,7 +339,7 @@ _mesa_buffer_data( GLcontext *ctx, GLenum target, GLsizeiptrARB size, bufObj->Usage = usage; if (data) { - _mesa_memcpy( bufObj->Data, data, size ); + memcpy( bufObj->Data, data, size ); } return GL_TRUE; @@ -378,7 +378,7 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, ASSERT(size + offset <= bufObj->Size); if (bufObj->Data) { - _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); + memcpy( (GLubyte *) bufObj->Data + offset, data, size ); } } @@ -408,7 +408,7 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, (void) ctx; (void) target; if (bufObj->Data && ((GLsizeiptrARB) (size + offset) <= bufObj->Size)) { - _mesa_memcpy( data, (GLubyte *) bufObj->Data + offset, size ); + memcpy( data, (GLubyte *) bufObj->Data + offset, size ); } } @@ -530,7 +530,7 @@ _mesa_copy_buffer_subdata(GLcontext *ctx, GL_WRITE_ONLY, dst); if (srcPtr && dstPtr) - _mesa_memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); + memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); ctx->Driver.UnmapBuffer(ctx, GL_COPY_READ_BUFFER, src); ctx->Driver.UnmapBuffer(ctx, GL_COPY_WRITE_BUFFER, dst); diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 5ede76c1fb..1c12fb00fa 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -684,7 +684,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, } break; case GL_RGBA: - _mesa_memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat)); + memcpy(rgba, table->TableF, 4 * table->Size * sizeof(GLfloat)); break; default: _mesa_problem(ctx, "bad table format in glGetColorTable"); diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 683d062bb9..ea0d13b890 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -4793,7 +4793,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - _mesa_memcpy(programCopy, program, len); + memcpy(programCopy, program, len); n[1].e = target; n[2].ui = id; n[3].i = len; @@ -4820,7 +4820,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV"); return; } - _mesa_memcpy(idCopy, ids, num * sizeof(GLuint)); + memcpy(idCopy, ids, num * sizeof(GLuint)); n[1].i = num; n[2].data = idCopy; } @@ -4991,7 +4991,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); return; } - _mesa_memcpy(nameCopy, name, len); + memcpy(nameCopy, name, len); n[1].ui = id; n[2].i = len; n[3].data = nameCopy; @@ -5090,7 +5090,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return; } - _mesa_memcpy(programCopy, string, len); + memcpy(programCopy, string, len); n[1].e = target; n[2].e = format; n[3].i = len; @@ -6201,7 +6201,7 @@ memdup(const void *src, GLsizei bytes) { void *b = bytes >= 0 ? _mesa_malloc(bytes) : NULL; if (b) - _mesa_memcpy(b, src, bytes); + memcpy(b, src, bytes); return b; } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 9b0b5f06fc..f24baf5acd 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -579,9 +579,9 @@ append(const char *a, const char *b) char *s = _mesa_calloc(aLen + bLen + 1); if (s) { if (a) - _mesa_memcpy(s, a, aLen); + memcpy(s, a, aLen); if (b) - _mesa_memcpy(s + aLen, b, bLen); + memcpy(s + aLen, b, bLen); s[aLen + bLen] = '\0'; } if (a) @@ -694,7 +694,7 @@ _mesa_make_extension_string( GLcontext *ctx ) for (i = 0 ; i < Elements(default_extensions) ; i++) { if (extension_enabled(ctx, i)) { GLuint len = (GLuint) strlen(default_extensions[i].name); - _mesa_memcpy(s + extStrLen, default_extensions[i].name, len); + memcpy(s + extStrLen, default_extensions[i].name, len); extStrLen += len; s[extStrLen] = ' '; extStrLen++; diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 468f2a9b21..bd03217e2a 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1099,7 +1099,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, } if ((packing->SkipPixels & 7) == 0) { - _mesa_memcpy( dst, src, width_in_bytes ); + memcpy( dst, src, width_in_bytes ); if (packing->LsbFirst) { flip_bytes( dst, width_in_bytes ); } @@ -1191,7 +1191,7 @@ _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, return; if ((packing->SkipPixels & 7) == 0) { - _mesa_memcpy( dst, src, width_in_bytes ); + memcpy( dst, src, width_in_bytes ); if (packing->LsbFirst) { flip_bytes( dst, width_in_bytes ); } @@ -3794,7 +3794,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, if (srcType == CHAN_TYPE) { if (dstFormat == GL_RGBA) { if (srcFormat == GL_RGBA) { - _mesa_memcpy( dest, source, n * 4 * sizeof(GLchan) ); + memcpy( dest, source, n * 4 * sizeof(GLchan) ); return; } else if (srcFormat == GL_RGB) { @@ -3814,7 +3814,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, } else if (dstFormat == GL_RGB) { if (srcFormat == GL_RGB) { - _mesa_memcpy( dest, source, n * 3 * sizeof(GLchan) ); + memcpy( dest, source, n * 3 * sizeof(GLchan) ); return; } else if (srcFormat == GL_RGBA) { @@ -3834,7 +3834,7 @@ _mesa_unpack_color_span_chan( GLcontext *ctx, else if (dstFormat == srcFormat) { GLint comps = _mesa_components_in_format(srcFormat); assert(comps > 0); - _mesa_memcpy( dest, source, n * comps * sizeof(GLchan) ); + memcpy( dest, source, n * comps * sizeof(GLchan) ); return; } } @@ -4381,11 +4381,11 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, */ if (transferOps == 0 && srcType == GL_UNSIGNED_BYTE && dstType == GL_UNSIGNED_BYTE) { - _mesa_memcpy(dest, source, n * sizeof(GLubyte)); + memcpy(dest, source, n * sizeof(GLubyte)); } else if (transferOps == 0 && srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) { - _mesa_memcpy(dest, source, n * sizeof(GLuint)); + memcpy(dest, source, n * sizeof(GLuint)); } else { /* @@ -4421,7 +4421,7 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, } break; case GL_UNSIGNED_INT: - _mesa_memcpy(dest, indexes, n * sizeof(GLuint)); + memcpy(dest, indexes, n * sizeof(GLuint)); break; default: _mesa_problem(ctx, "bad dstType in _mesa_unpack_index_span"); @@ -4444,7 +4444,7 @@ _mesa_pack_index_span( const GLcontext *ctx, GLuint n, if (transferOps & (IMAGE_MAP_COLOR_BIT | IMAGE_SHIFT_OFFSET_BIT)) { /* make a copy of input */ - _mesa_memcpy(indexes, source, n * sizeof(GLuint)); + memcpy(indexes, source, n * sizeof(GLuint)); _mesa_apply_ci_transfer_ops(ctx, transferOps, n, indexes); source = indexes; } @@ -4592,14 +4592,14 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, !ctx->Pixel.MapStencilFlag && srcType == GL_UNSIGNED_BYTE && dstType == GL_UNSIGNED_BYTE) { - _mesa_memcpy(dest, source, n * sizeof(GLubyte)); + memcpy(dest, source, n * sizeof(GLubyte)); } else if (transferOps == 0 && !ctx->Pixel.MapStencilFlag && srcType == GL_UNSIGNED_INT && dstType == GL_UNSIGNED_INT && !srcPacking->SwapBytes) { - _mesa_memcpy(dest, source, n * sizeof(GLuint)); + memcpy(dest, source, n * sizeof(GLuint)); } else { /* @@ -4646,7 +4646,7 @@ _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, } break; case GL_UNSIGNED_INT: - _mesa_memcpy(dest, indexes, n * sizeof(GLuint)); + memcpy(dest, indexes, n * sizeof(GLuint)); break; default: _mesa_problem(ctx, "bad dstType in _mesa_unpack_stencil_span"); @@ -4667,7 +4667,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag) { /* make a copy of input */ - _mesa_memcpy(stencil, source, n * sizeof(GLstencil)); + memcpy(stencil, source, n * sizeof(GLstencil)); _mesa_apply_stencil_transfer_ops(ctx, n, stencil); source = stencil; } @@ -4675,7 +4675,7 @@ _mesa_pack_stencil_span( const GLcontext *ctx, GLuint n, switch (dstType) { case GL_UNSIGNED_BYTE: if (sizeof(GLstencil) == 1) { - _mesa_memcpy( dest, source, n ); + memcpy( dest, source, n ); } else { GLubyte *dst = (GLubyte *) dest; @@ -5039,7 +5039,7 @@ _mesa_pack_depth_span( const GLcontext *ctx, GLuint n, GLvoid *dest, ASSERT(n <= MAX_WIDTH); if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { - _mesa_memcpy(depthCopy, depthSpan, n * sizeof(GLfloat)); + memcpy(depthCopy, depthSpan, n * sizeof(GLfloat)); _mesa_scale_and_bias_depth(ctx, n, depthCopy); depthSpan = depthCopy; } @@ -5158,7 +5158,7 @@ _mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest, ASSERT(n <= MAX_WIDTH); if (ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0) { - _mesa_memcpy(depthCopy, depthVals, n * sizeof(GLfloat)); + memcpy(depthCopy, depthVals, n * sizeof(GLfloat)); _mesa_scale_and_bias_depth(ctx, n, depthCopy); depthVals = depthCopy; } @@ -5166,7 +5166,7 @@ _mesa_pack_depth_stencil_span(const GLcontext *ctx, GLuint n, GLuint *dest, if (ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset || ctx->Pixel.MapStencilFlag) { - _mesa_memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); + memcpy(stencilCopy, stencilVals, n * sizeof(GLstencil)); _mesa_apply_stencil_transfer_ops(ctx, n, stencilCopy); stencilVals = stencilCopy; } @@ -5303,7 +5303,7 @@ _mesa_unpack_image( GLuint dimensions, } } else { - _mesa_memcpy(dst, src, bytesPerRow); + memcpy(dst, src, bytesPerRow); } /* byte flipping/swapping */ @@ -5356,7 +5356,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); } else { const GLubyte (*src1)[4] = (const GLubyte (*)[4]) src; @@ -5372,7 +5372,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); } break; case GL_UNSIGNED_SHORT: @@ -5389,7 +5389,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); } else { const GLushort (*src2)[4] = (const GLushort (*)[4]) src; @@ -5405,7 +5405,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLfloat)); } break; case GL_FLOAT: @@ -5422,7 +5422,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLubyte)); } else { const GLfloat (*src4)[4] = (const GLfloat (*)[4]) src; @@ -5438,7 +5438,7 @@ _mesa_convert_colors(GLenum srcType, const GLvoid *src, } } if (useTemp) - _mesa_memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); + memcpy(dst, tempBuffer, count * 4 * sizeof(GLushort)); } break; default: diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 2a0952c7af..0abdfca381 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -221,7 +221,7 @@ _mesa_align_realloc(void *oldBuffer, size_t oldSize, size_t newSize, const size_t copySize = (oldSize < newSize) ? oldSize : newSize; void *newBuf = _mesa_align_malloc(newSize, alignment); if (newBuf && oldBuffer && copySize > 0) { - _mesa_memcpy(newBuf, oldBuffer, copySize); + memcpy(newBuf, oldBuffer, copySize); } if (oldBuffer) _mesa_align_free(oldBuffer); @@ -238,23 +238,12 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) const size_t copySize = (oldSize < newSize) ? oldSize : newSize; void *newBuffer = _mesa_malloc(newSize); if (newBuffer && oldBuffer && copySize > 0) - _mesa_memcpy(newBuffer, oldBuffer, copySize); + memcpy(newBuffer, oldBuffer, copySize); if (oldBuffer) _mesa_free(oldBuffer); return newBuffer; } -/** memcpy wrapper */ -void * -_mesa_memcpy(void *dest, const void *src, size_t n) -{ -#if defined(SUNOS4) - return memcpy((char *) dest, (char *) src, (int) n); -#else - return memcpy(dest, src, n); -#endif -} - /** Wrapper around memset() */ void _mesa_memset( void *dst, int val, size_t n ) diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 124642178c..8f13d518ea 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -72,7 +72,7 @@ extern "C" { #define ALIGN_FREE(PTR) _mesa_align_free(PTR) /** Copy \p BYTES bytes from \p SRC into \p DST */ -#define MEMCPY( DST, SRC, BYTES) _mesa_memcpy(DST, SRC, BYTES) +#define MEMCPY( DST, SRC, BYTES) memcpy(DST, SRC, BYTES) /** Set \p N bytes in \p DST to \p VAL */ #define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N) @@ -543,9 +543,6 @@ _mesa_exec_free( void *addr ); extern void * _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); -extern void * -_mesa_memcpy( void *dest, const void *src, size_t n ); - extern void _mesa_memset( void *dst, int val, size_t n ); diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 38a97fdb18..a8624574de 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -207,7 +207,7 @@ do { \ */ #define COPY_4FV( DST, SRC ) \ do { \ - _mesa_memcpy(DST, SRC, sizeof(GLfloat) * 4); \ + memcpy(DST, SRC, sizeof(GLfloat) * 4); \ } while (0) /** Copy \p SZ elements into a 4-element vector */ diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 3bb062bae2..4ae5843662 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -87,7 +87,7 @@ get_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const GLubyte *src = (const GLubyte *) rb->Data + y * rb->Width + x; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - _mesa_memcpy(values, src, count * sizeof(GLubyte)); + memcpy(values, src, count * sizeof(GLubyte)); } @@ -121,7 +121,7 @@ put_row_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, values, count * sizeof(GLubyte)); + memcpy(dst, values, count * sizeof(GLubyte)); } } @@ -207,7 +207,7 @@ get_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const void *src = rb->GetPointer(ctx, rb, x, y); ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - _mesa_memcpy(values, src, count * sizeof(GLushort)); + memcpy(values, src, count * sizeof(GLushort)); } @@ -241,7 +241,7 @@ put_row_ushort(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, count * sizeof(GLushort)); + memcpy(dst, src, count * sizeof(GLushort)); } } @@ -337,7 +337,7 @@ get_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const void *src = rb->GetPointer(ctx, rb, x, y); ASSERT(rb->DataType == GL_UNSIGNED_INT || rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - _mesa_memcpy(values, src, count * sizeof(GLuint)); + memcpy(values, src, count * sizeof(GLuint)); } @@ -373,7 +373,7 @@ put_row_uint(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, count * sizeof(GLuint)); + memcpy(dst, src, count * sizeof(GLuint)); } } @@ -631,7 +631,7 @@ get_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) rb->Data + 4 * (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); ASSERT(rb->Format == MESA_FORMAT_RGBA8888); - _mesa_memcpy(values, src, 4 * count * sizeof(GLubyte)); + memcpy(values, src, 4 * count * sizeof(GLubyte)); } @@ -669,7 +669,7 @@ put_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLubyte)); + memcpy(dst, src, 4 * count * sizeof(GLubyte)); } } @@ -788,7 +788,7 @@ get_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const GLshort *src = (const GLshort *) rb->Data + 4 * (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - _mesa_memcpy(values, src, 4 * count * sizeof(GLshort)); + memcpy(values, src, 4 * count * sizeof(GLshort)); } @@ -826,7 +826,7 @@ put_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); + memcpy(dst, src, 4 * count * sizeof(GLushort)); } } @@ -851,7 +851,7 @@ put_row_rgb_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } else { - _mesa_memcpy(dst, src, 4 * count * sizeof(GLushort)); + memcpy(dst, src, 4 * count * sizeof(GLushort)); } } @@ -1374,7 +1374,7 @@ copy_buffer_alpha8(struct gl_renderbuffer* dst, struct gl_renderbuffer* src) ASSERT(dst->Width == src->Width); ASSERT(dst->Height == src->Height); - _mesa_memcpy(dst->Data, src->Data, dst->Width * dst->Height * sizeof(GLubyte)); + memcpy(dst->Data, src->Data, dst->Width * dst->Height * sizeof(GLubyte)); } diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index b9c84eb792..91f2a7a7bf 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -469,8 +469,8 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, for (i = 0; i < count; i++) { GLint start = (i > 0) ? offsets[i - 1] : 0; - _mesa_memcpy(source + start, string[i], - (offsets[i] - start) * sizeof(GLcharARB)); + memcpy(source + start, string[i], + (offsets[i] - start) * sizeof(GLcharARB)); } source[totalLength - 1] = '\0'; source[totalLength - 2] = '\0'; diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index ac3f9eb175..36b48fd9f2 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -398,7 +398,7 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, if (size > 0) { const GLsizei copy_count = MIN2(size, bufSize); - _mesa_memcpy(values, v, sizeof(GLint) * copy_count); + memcpy(values, v, sizeof(GLint) * copy_count); } if (length != NULL) { diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 6b3355a7ec..7ad91805bc 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -156,7 +156,7 @@ get_tex_depth_stencil(GLcontext *ctx, GLuint dimensions, void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, width, height, format, type, img, row, 0); - _mesa_memcpy(dest, src, width * sizeof(GLuint)); + memcpy(dest, src, width * sizeof(GLuint)); if (ctx->Pack.SwapBytes) { _mesa_swap4((GLuint *) dest, width); } @@ -187,7 +187,7 @@ get_tex_ycbcr(GLcontext *ctx, GLuint dimensions, void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, width, height, format, type, img, row, 0); - _mesa_memcpy(dest, src, width * sizeof(GLushort)); + memcpy(dest, src, width * sizeof(GLushort)); /* check for byte swapping */ if ((texImage->TexFormat == MESA_FORMAT_YCBCR @@ -560,7 +560,7 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, texImage->Width, texImage->Height, texImage->Depth); - _mesa_memcpy(img, texImage->Data, size); + memcpy(img, texImage->Data, size); } else { GLuint bw, bh; diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 78612b0856..c1418e0967 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2919,7 +2919,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) + dstYoffset * dstRowStride + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { - _mesa_memcpy(dstRow, srcRow, bytesPerRow); + memcpy(dstRow, srcRow, bytesPerRow); dstRow += dstRowStride; srcRow += srcWidth * components; } diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index a77ff7c5b1..75b4274bfd 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -1091,7 +1091,7 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) } if (prog->String) - _mesa_memcpy(dst, prog->String, strlen((char *) prog->String)); + memcpy(dst, prog->String, strlen((char *) prog->String)); else *dst = '\0'; } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index ff3a921777..e226973c53 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1233,7 +1233,7 @@ Parse_PrintInstruction(struct parse_state *parseState, parseState->pos += len + 1; msg = (GLubyte*) _mesa_malloc(len + 1); - _mesa_memcpy(msg, str, len); + memcpy(msg, str, len); msg[len] = 0; inst->Data = msg; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 630de7c2d7..1a840a3a92 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1050,7 +1050,7 @@ Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction * parseState->pos += len + 1; msg = (GLubyte*) _mesa_malloc(len + 1); - _mesa_memcpy(msg, str, len); + memcpy(msg, str, len); msg[len] = 0; inst->Data = msg; diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 44c961927a..dcf834f52d 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -110,7 +110,7 @@ _mesa_copy_instructions(struct prog_instruction *dest, const struct prog_instruction *src, GLuint n) { GLuint i; - _mesa_memcpy(dest, src, n * sizeof(struct prog_instruction)); + memcpy(dest, src, n * sizeof(struct prog_instruction)); for (i = 0; i < n; i++) { if (src[i].Comment) dest[i].Comment = _mesa_strdup(src[i].Comment); diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 18ef6d5ccf..3bf9a65905 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -223,7 +223,7 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, p++; len = p - lineStart; s = (GLubyte *) _mesa_malloc(len + 1); - _mesa_memcpy(s, lineStart, len); + memcpy(s, lineStart, len); s[len] = 0; return s; diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 2adfb40973..182ef4c26d 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -5623,7 +5623,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; } - _mesa_memcpy (strz, str, len); + memcpy (strz, str, len); strz[len] = '\0'; state->prog->String = strz; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 3880d54917..577bd2c38d 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2662,7 +2662,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; } - _mesa_memcpy (strz, str, len); + memcpy (strz, str, len); strz[len] = '\0'; state->prog->String = strz; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 44310d2e61..7e2a60f74b 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1380,7 +1380,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) GLchar *newName = _mesa_malloc(len + 1); if (!newName) return -1; /* out of mem */ - _mesa_memcpy(newName, name, len); + memcpy(newName, name, len); newName[len] = 0; location = _mesa_lookup_uniform(shProg->Uniforms, newName); diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 3a15d9d3ab..5441d60df5 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -269,10 +269,10 @@ slang_operation_insert(GLuint *numElements, slang_operation **array, slang_operation *newOp; newOp = ops + pos; if (pos > 0) - _mesa_memcpy(ops, *array, pos * sizeof(slang_operation)); + memcpy(ops, *array, pos * sizeof(slang_operation)); if (pos < *numElements) - _mesa_memcpy(newOp + 1, (*array) + pos, - (*numElements - pos) * sizeof(slang_operation)); + memcpy(newOp + 1, (*array) + pos, + (*numElements - pos) * sizeof(slang_operation)); if (!slang_operation_construct(newOp)) { _slang_free(ops); diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 2906cb17c4..68129d4c5a 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -625,7 +625,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) for (i = 0; i < shProg->NumShaders; i++) { const struct gl_shader *shader = shProg->Shaders[i]; if (shader->Type == shaderType) { - _mesa_memcpy(source + len, shader->Source, shaderLengths[i]); + memcpy(source + len, shader->Source, shaderLengths[i]); len += shaderLengths[i]; } } diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index c37e12fb7f..54f5196617 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -197,7 +197,7 @@ _slang_realloc(void *oldBuffer, GLuint oldSize, GLuint newSize) ASSERT(is_valid_address(pool, oldBuffer)); if (newBuffer && oldBuffer && copySize > 0) - _mesa_memcpy(newBuffer, oldBuffer, copySize); + memcpy(newBuffer, oldBuffer, copySize); return newBuffer; } diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index e3b0491d97..56a33e6f6b 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -92,7 +92,7 @@ slang_string_push (slang_string *self, const slang_string *str) return; } if (grow (self, self->length + str->length)) { - _mesa_memcpy (&self->data[self->length], str->data, str->length); + memcpy (&self->data[self->length], str->data, str->length); self->length += str->length; } } @@ -110,7 +110,7 @@ GLvoid slang_string_pushs (slang_string *self, const char *cstr, GLuint len) { if (grow (self, self->length + len)) { - _mesa_memcpy (&self->data[self->length], cstr, len); + memcpy (&self->data[self->length], cstr, len); self->length += len; } } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index f1b4f11c05..c92af34378 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -377,7 +377,7 @@ st_copy_buffer_subdata(GLcontext *ctx, PIPE_BUFFER_USAGE_CPU_WRITE); if (srcPtr && dstPtr) - _mesa_memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); + memcpy(dstPtr + writeOffset, srcPtr + readOffset, size); pipe_buffer_unmap(pipe->screen, srcObj->buffer); pipe_buffer_unmap(pipe->screen, dstObj->buffer); diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 95c83432a9..5b090c72c7 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -89,7 +89,7 @@ blend_noop(GLcontext *ctx, GLuint n, const GLubyte mask[], else bytes = 4 * n * sizeof(GLfloat); - _mesa_memcpy(src, dst, bytes); + memcpy(src, dst, bytes); } diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index e881d1be30..b69be50f51 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -167,7 +167,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; /* copy convolved colors into span array */ - _mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat)); + memcpy(rgba, src, width * 4 * sizeof(GLfloat)); /* write span */ span.x = destx; @@ -273,7 +273,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, /* Get row/span of source pixels */ if (overlapping) { /* get from buffered image */ - _mesa_memcpy(rgba, p, width * sizeof(GLfloat) * 4); + memcpy(rgba, p, width * sizeof(GLfloat) * 4); p += width * 4; } else { @@ -374,7 +374,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, for (j = 0; j < height; j++, sy += stepy, dy += stepy) { /* Get color indexes */ if (overlapping) { - _mesa_memcpy(span.array->index, p, width * sizeof(GLuint)); + memcpy(span.array->index, p, width * sizeof(GLuint)); p += width; } else { @@ -508,7 +508,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, GLfloat depth[MAX_WIDTH]; /* get depth values */ if (overlapping) { - _mesa_memcpy(depth, p, width * sizeof(GLfloat)); + memcpy(depth, p, width * sizeof(GLfloat)); p += width; } else { @@ -606,7 +606,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, /* Get stencil values */ if (overlapping) { - _mesa_memcpy(stencil, p, width * sizeof(GLstencil)); + memcpy(stencil, p, width * sizeof(GLstencil)); p += width; } else { @@ -730,7 +730,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, /* Get stencil values */ if (overlapping) { - _mesa_memcpy(stencil, stencilPtr, width * sizeof(GLstencil)); + memcpy(stencil, stencilPtr, width * sizeof(GLstencil)); stencilPtr += width; } else { @@ -759,7 +759,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, /* get depth values */ if (overlapping) { - _mesa_memcpy(depth, depthPtr, width * sizeof(GLfloat)); + memcpy(depth, depthPtr, width * sizeof(GLfloat)); depthPtr += width; } else { diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 248d6cc1c0..136c296e98 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -473,7 +473,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, _mesa_image_address2d(unpack, pixels, width, height, GL_DEPTH_COMPONENT, type, row, 0); if (shift == 0) { - _mesa_memcpy(span.array->z, zSrc, width * sizeof(GLuint)); + memcpy(span.array->z, zSrc, width * sizeof(GLuint)); } else { GLint col; diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 85d30cc929..63a8d4e350 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -993,8 +993,8 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) if (numBuffers > 1) { /* save indexes for second, third renderbuffer writes */ - _mesa_memcpy(indexSave, span->array->index, - span->end * sizeof(indexSave[0])); + memcpy(indexSave, span->array->index, + span->end * sizeof(indexSave[0])); } if (ctx->Color.IndexLogicOpEnabled) { @@ -1073,8 +1073,8 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) if (buf + 1 < numBuffers) { /* restore original span values */ - _mesa_memcpy(span->array->index, indexSave, - span->end * sizeof(indexSave[0])); + memcpy(span->array->index, indexSave, + span->end * sizeof(indexSave[0])); } } /* for buf */ } @@ -1510,8 +1510,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (!multiFragOutputs && numBuffers > 1) { /* save colors for second, third renderbuffer writes */ - _mesa_memcpy(rgbaSave, span->array->rgba, - 4 * span->end * sizeof(GLchan)); + memcpy(rgbaSave, span->array->rgba, + 4 * span->end * sizeof(GLchan)); } ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB); @@ -1544,8 +1544,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (!multiFragOutputs && numBuffers > 1) { /* restore original span values */ - _mesa_memcpy(span->array->rgba, rgbaSave, - 4 * span->end * sizeof(GLchan)); + memcpy(span->array->rgba, rgbaSave, + 4 * span->end * sizeof(GLchan)); } } /* if rb */ diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index e9e9d3a4f1..5e9a4e37c7 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -475,7 +475,7 @@ stencil_and_ztest_span(GLcontext *ctx, SWspan *span, GLuint face) GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH]; /* save the current mask bits */ - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + memcpy(origMask, mask, n * sizeof(GLubyte)); /* apply the depth test */ _swrast_depth_test_span(ctx, span); @@ -918,7 +918,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) ASSERT(rb->DataType == GL_UNSIGNED_BYTE); _swrast_get_values(ctx, rb, n, x, y, stencil, sizeof(GLubyte)); - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + memcpy(origMask, mask, n * sizeof(GLubyte)); (void) do_stencil_test(ctx, face, n, stencil, mask); @@ -928,7 +928,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) } else { GLubyte tmpMask[MAX_WIDTH]; - _mesa_memcpy(tmpMask, mask, n * sizeof(GLubyte)); + memcpy(tmpMask, mask, n * sizeof(GLubyte)); _swrast_depth_test_span(ctx, span); @@ -962,7 +962,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face ) ctx->Stencil.ZPassFunc[face], face, mask); } else { - _mesa_memcpy(origMask, mask, n * sizeof(GLubyte)); + memcpy(origMask, mask, n * sizeof(GLubyte)); _swrast_depth_test_span(ctx, span); diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index d3955873dc..2b8c962f06 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -236,7 +236,7 @@ void _tnl_get_attr( GLcontext *ctx, const void *vin, dest[0] = ctx->Point.Size; } else { - _mesa_memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat)); + memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat)); } } diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 99ddace73d..b1ea142464 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -1074,9 +1074,9 @@ void _tnl_generic_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ) if (a[j].attrib == VERT_ATTRIB_COLOR0 || a[j].attrib == VERT_ATTRIB_COLOR1) { - _mesa_memcpy( vdst + a[j].vertoffset, - vsrc + a[j].vertoffset, - a[j].vertattrsize ); + memcpy( vdst + a[j].vertoffset, + vsrc + a[j].vertoffset, + a[j].vertattrsize ); } } } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 8ee14be261..b10ee2105a 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -126,8 +126,8 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr); for (i = 0 ; i < exec->vtx.copied.nr ; i++) { - _mesa_memcpy( exec->vtx.buffer_ptr, data, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.buffer_ptr, data, + exec->vtx.vertex_size * sizeof(GLfloat)); exec->vtx.buffer_ptr += exec->vtx.vertex_size; data += exec->vtx.vertex_size; exec->vtx.vert_count++; @@ -414,13 +414,13 @@ static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) } - _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, + exec->vtx.vertex_size * sizeof(GLfloat)); vbo_exec_do_EvalCoord1f( exec, u ); - _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, + exec->vtx.vertex_size * sizeof(GLfloat)); } static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v ) @@ -444,13 +444,13 @@ static void GLAPIENTRY vbo_exec_EvalCoord2f( GLfloat u, GLfloat v ) vbo_exec_fixup_vertex( ctx, VBO_ATTRIB_NORMAL, 3 ); } - _mesa_memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, + exec->vtx.vertex_size * sizeof(GLfloat)); vbo_exec_do_EvalCoord2f( exec, u, v ); - _mesa_memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, - exec->vtx.vertex_size * sizeof(GLfloat)); + memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, + exec->vtx.vertex_size * sizeof(GLfloat)); } static void GLAPIENTRY vbo_exec_EvalCoord1fv( const GLfloat *u ) diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index d7dbbceb1b..526bf7ae79 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -85,24 +85,24 @@ vbo_copy_vertices( struct vbo_exec_context *exec ) case GL_LINES: ovf = nr&1; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case GL_TRIANGLES: ovf = nr%3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case GL_QUADS: ovf = nr&3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case GL_LINE_STRIP: if (nr == 0) { return 0; } else { - _mesa_memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) ); + memcpy( dst, src+(nr-1)*sz, sz * sizeof(GLfloat) ); return 1; } case GL_LINE_LOOP: @@ -112,12 +112,12 @@ vbo_copy_vertices( struct vbo_exec_context *exec ) return 0; } else if (nr == 1) { - _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) ); + memcpy( dst, src+0, sz * sizeof(GLfloat) ); return 1; } else { - _mesa_memcpy( dst, src+0, sz * sizeof(GLfloat) ); - _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) ); + memcpy( dst, src+0, sz * sizeof(GLfloat) ); + memcpy( dst+sz, src+(nr-1)*sz, sz * sizeof(GLfloat) ); return 2; } case GL_TRIANGLE_STRIP: @@ -139,7 +139,7 @@ vbo_copy_vertices( struct vbo_exec_context *exec ) break; } for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz * sizeof(GLfloat) ); return i; case PRIM_OUTSIDE_BEGIN_END: return 0; diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 3f86c68b24..e1caa6f8c5 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -118,23 +118,23 @@ static GLuint _save_copy_vertices( GLcontext *ctx, case GL_LINES: ovf = nr&1; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_TRIANGLES: ovf = nr%3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_QUADS: ovf = nr&3; for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; case GL_LINE_STRIP: if (nr == 0) return 0; else { - _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); + memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) ); return 1; } case GL_LINE_LOOP: @@ -143,11 +143,11 @@ static GLuint _save_copy_vertices( GLcontext *ctx, if (nr == 0) return 0; else if (nr == 1) { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); + memcpy( dst, src+0, sz*sizeof(GLfloat) ); return 1; } else { - _mesa_memcpy( dst, src+0, sz*sizeof(GLfloat) ); - _mesa_memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) ); + memcpy( dst, src+0, sz*sizeof(GLfloat) ); + memcpy( dst+sz, src+(nr-1)*sz, sz*sizeof(GLfloat) ); return 2; } case GL_TRIANGLE_STRIP: @@ -158,7 +158,7 @@ static GLuint _save_copy_vertices( GLcontext *ctx, default: ovf = 2 + (nr&1); break; } for (i = 0 ; i < ovf ; i++) - _mesa_memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); + memcpy( dst+i*sz, src+(nr-ovf+i)*sz, sz*sizeof(GLfloat) ); return i; default: assert(0); @@ -277,7 +277,7 @@ static void _save_compile_vertex_list( GLcontext *ctx ) /* Duplicate our template, increment refcounts to the storage structs: */ - _mesa_memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz)); + memcpy(node->attrsz, save->attrsz, sizeof(node->attrsz)); node->vertex_size = save->vertex_size; node->buffer_offset = (save->buffer - save->vertex_store->buffer) * sizeof(GLfloat); node->count = save->vert_count; @@ -441,7 +441,7 @@ static void _save_wrap_filled_vertex( GLcontext *ctx ) assert(save->max_vert - save->vert_count > save->copied.nr); for (i = 0 ; i < save->copied.nr ; i++) { - _mesa_memcpy( save->buffer_ptr, data, save->vertex_size * sizeof(GLfloat)); + memcpy( save->buffer_ptr, data, save->vertex_size * sizeof(GLfloat)); data += save->vertex_size; save->buffer_ptr += save->vertex_size; save->vert_count++; diff --git a/src/mesa/vf/vf.c b/src/mesa/vf/vf.c index 82f3d2b641..15a78c4c0a 100644 --- a/src/mesa/vf/vf.c +++ b/src/mesa/vf/vf.c @@ -296,7 +296,7 @@ void vf_get_attr( struct vertex_fetch *vf, /* Else return the value from ctx->Current. */ - _mesa_memcpy( dest, dflt, 4*sizeof(GLfloat)); + memcpy( dest, dflt, 4*sizeof(GLfloat)); } -- cgit v1.2.3 From 26f8fad1456fdc2b352cea9d3b4c32cb5f6ae947 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:51:00 -0800 Subject: Remove _mesa_memset in favor of plain memset. This may break the SUNOS4 build, but it's no longer relevant. --- src/glx/glcontextmodes.c | 7 ++----- src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 2 +- src/mesa/drivers/windows/gdi/mesa.def | 1 - src/mesa/drivers/windows/icd/mesa.def | 1 - src/mesa/drivers/x11/xm_dd.c | 2 +- src/mesa/glapi/mesadef.py | 1 - src/mesa/main/bitset.h | 4 ++-- src/mesa/main/ffvertex_prog.c | 2 +- src/mesa/main/imports.c | 11 ----------- src/mesa/main/imports.h | 5 +---- src/mesa/main/renderbuffer.c | 4 ++-- src/mesa/main/texcompress_fxt1.c | 4 ++-- src/mesa/main/texenvprogram.c | 2 +- src/mesa/shader/atifragshader.c | 2 +- src/mesa/shader/prog_cache.c | 2 +- src/mesa/shader/prog_parameter.c | 4 ++-- src/mesa/shader/program.c | 2 +- src/mesa/swrast/s_depth.c | 2 +- src/mesa/swrast/s_span.c | 4 ++-- src/mesa/swrast/s_stencil.c | 4 ++-- src/mesa/tnl/t_vertex_sse.c | 2 +- src/mesa/vf/vf_sse.c | 2 +- 23 files changed, 26 insertions(+), 46 deletions(-) (limited to 'src') diff --git a/src/glx/glcontextmodes.c b/src/glx/glcontextmodes.c index 232031c2ca..257087a802 100644 --- a/src/glx/glcontextmodes.c +++ b/src/glx/glcontextmodes.c @@ -48,17 +48,14 @@ # include # define _mesa_malloc(b) malloc(b) # define _mesa_free(m) free(m) -# define _mesa_memset memset #else # ifdef XFree86Server # include # include # define _mesa_malloc(b) xalloc(b) # define _mesa_free(m) xfree(m) -# define _mesa_memset memset # else # include -# define _mesa_memset memset # define _mesa_malloc(b) Xmalloc(b) # define _mesa_free(m) Xfree(m) # endif /* XFree86Server */ @@ -133,7 +130,7 @@ _gl_copy_visual_to_context_mode(__GLcontextModes * mode, { __GLcontextModes *const next = mode->next; - (void) _mesa_memset(mode, 0, sizeof(__GLcontextModes)); + (void) memset(mode, 0, sizeof(__GLcontextModes)); mode->next = next; mode->visualID = config->vid; @@ -402,7 +399,7 @@ _gl_context_modes_create(unsigned count, size_t minimum_size) break; } - (void) _mesa_memset(*next, 0, size); + (void) memset(*next, 0, size); (*next)->visualID = GLX_DONT_CARE; (*next)->visualType = GLX_DONT_CARE; (*next)->visualRating = GLX_NONE; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 0ecbef1ef9..4f477cfc6b 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -349,7 +349,7 @@ void brw_upload_state(struct brw_context *brw) * state atoms are ordered correctly in the list. */ struct brw_state_flags examined, prev; - _mesa_memset(&examined, 0, sizeof(examined)); + memset(&examined, 0, sizeof(examined)); prev = *state; for (i = 0; i < Elements(atoms); i++) { diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 87387b1e2d..c232cd2791 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -105,7 +105,7 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key, dri_bo *sdc_bo, struct brw_sampler_state *sampler) { - _mesa_memset(sampler, 0, sizeof(*sampler)); + memset(sampler, 0, sizeof(*sampler)); switch (key->minfilter) { case GL_NEAREST: diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index f82db88bc5..d7d6cfa4e2 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -899,7 +899,6 @@ EXPORTS _mesa_init_renderbuffer _mesa_initialize_context _mesa_make_current - _mesa_memset _mesa_new_array_object _mesa_new_framebuffer _mesa_new_program diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index 06c384d8b0..f6bd2aa68b 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -54,7 +54,6 @@ EXPORTS _mesa_init_driver_functions _mesa_initialize_context _mesa_make_current - _mesa_memset _mesa_new_buffer_object _mesa_new_texture_object _mesa_problem diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index df04e3a101..d70236c2a0 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -336,7 +336,7 @@ clear_32bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLuint *ptr4 = (GLuint *) xrb->ximage->data; if (pixel == 0) { /* common case */ - _mesa_memset(ptr4, pixel, 4 * n); + memset(ptr4, pixel, 4 * n); } else { GLuint i; diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index c7e2c086f7..59cea59ac2 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -134,7 +134,6 @@ def PrintTail(): print '\t_mesa_init_default_imports' print '\t_mesa_initialize_context' print '\t_mesa_make_current' - print '\t_mesa_memset' print '\t_mesa_new_buffer_object' print '\t_mesa_new_texture_object' print '\t_mesa_problem' diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h index 5463c0a3c9..29468e8486 100644 --- a/src/mesa/main/bitset.h +++ b/src/mesa/main/bitset.h @@ -49,8 +49,8 @@ */ #define BITSET_COPY(x, y) memcpy( (x), (y), sizeof (x) ) #define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0) -#define BITSET_ZERO(x) _mesa_memset( (x), 0, sizeof (x) ) -#define BITSET_ONES(x) _mesa_memset( (x), 0xff, sizeof (x) ) +#define BITSET_ZERO(x) memset( (x), 0, sizeof (x) ) +#define BITSET_ONES(x) memset( (x), 0xff, sizeof (x) ) #define BITSET_BITWORD(b) ((b) / BITSET_WORDBITS) #define BITSET_BIT(b) (1 << ((b) % BITSET_WORDBITS)) diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 867a55242c..48edec657b 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -1590,7 +1590,7 @@ create_new_program( const struct state_key *key, { struct tnl_program p; - _mesa_memset(&p, 0, sizeof(p)); + memset(&p, 0, sizeof(p)); p.state = key; p.program = program; p.eye_position = undef; diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 0abdfca381..d8375bf572 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -244,17 +244,6 @@ _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) return newBuffer; } -/** Wrapper around memset() */ -void -_mesa_memset( void *dst, int val, size_t n ) -{ -#if defined(SUNOS4) - memset( (char *) dst, (int) val, (int) n ); -#else - memset(dst, val, n); -#endif -} - /** * Fill memory with a constant 16bit word. * \param dst destination pointer. diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 8f13d518ea..68d2043c91 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -74,7 +74,7 @@ extern "C" { /** Copy \p BYTES bytes from \p SRC into \p DST */ #define MEMCPY( DST, SRC, BYTES) memcpy(DST, SRC, BYTES) /** Set \p N bytes in \p DST to \p VAL */ -#define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N) +#define MEMSET( DST, VAL, N ) memset(DST, VAL, N) /*@}*/ @@ -543,9 +543,6 @@ _mesa_exec_free( void *addr ); extern void * _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); -extern void -_mesa_memset( void *dst, int val, size_t n ); - extern void _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ); diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 4ae5843662..bb0c78382c 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -548,7 +548,7 @@ put_mono_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, ASSERT(rb->DataType == GL_UNSIGNED_BYTE); if (!mask && val0 == val1 && val1 == val2) { /* optimized case */ - _mesa_memset(dst, val0, 3 * count); + memset(dst, val0, 3 * count); } else { GLuint i; @@ -1319,7 +1319,7 @@ put_mono_row_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLuint count, } } else { - _mesa_memset(dst, val, count); + memset(dst, val, count); } } diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 85becb80d2..73a31a17ec 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -406,7 +406,7 @@ fxt1_choose (GLfloat vec[][MAX_COMP], GLint nv, } hist[N_TEXELS]; GLint lenh = 0; - _mesa_memset(hist, 0, sizeof(hist)); + memset(hist, 0, sizeof(hist)); for (k = 0; k < n; k++) { GLint l; @@ -1211,7 +1211,7 @@ fxt1_quantize (GLuint *cc, const GLubyte *lines[], GLint comps) if (comps == 3) { /* make the whole block opaque */ - _mesa_memset(input, -1, sizeof(input)); + memset(input, -1, sizeof(input)); } /* 8 texels each line */ diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 5cc5fdaebd..35a2cebab8 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1416,7 +1416,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, GLuint unit; struct ureg cf, out; - _mesa_memset(&p, 0, sizeof(p)); + memset(&p, 0, sizeof(p)); p.state = key; p.program = program; diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index 3e26c43c48..fb2fa4b95f 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -96,7 +96,7 @@ create_dst_mod_str(GLuint mod) { static char ret_str[1024]; - _mesa_memset(ret_str, 0, 1024); + memset(ret_str, 0, 1024); if (mod & GL_2X_BIT_ATI) strncat(ret_str, "|2X", 1024); diff --git a/src/mesa/shader/prog_cache.c b/src/mesa/shader/prog_cache.c index 9437e59613..8e54f3a5a0 100644 --- a/src/mesa/shader/prog_cache.c +++ b/src/mesa/shader/prog_cache.c @@ -88,7 +88,7 @@ rehash(struct gl_program_cache *cache) size = cache->size * 3; items = (struct cache_item**) _mesa_malloc(size * sizeof(*items)); - _mesa_memset(items, 0, size * sizeof(*items)); + memset(items, 0, size * sizeof(*items)); for (i = 0; i < cache->size; i++) for (c = cache->items[i]; c; c = next) { diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 435e6ceb09..1feb7bd71d 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -146,8 +146,8 @@ _mesa_add_parameter(struct gl_program_parameter_list *paramList, paramList->NumParameters = oldNum + sz4; - _mesa_memset(¶mList->Parameters[oldNum], 0, - sz4 * sizeof(struct gl_program_parameter)); + memset(¶mList->Parameters[oldNum], 0, + sz4 * sizeof(struct gl_program_parameter)); for (i = 0; i < sz4; i++) { struct gl_program_parameter *p = paramList->Parameters + oldNum + i; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 3bf9a65905..2410ccb047 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -809,7 +809,7 @@ _mesa_find_used_registers(const struct gl_program *prog, { GLuint i, j; - _mesa_memset(used, 0, usedSize); + memset(used, 0, usedSize); for (i = 0; i < prog->NumInstructions; i++) { const struct prog_instruction *inst = prog->Instructions + i; diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index ac5dae2148..36c8db2107 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1438,7 +1438,7 @@ _swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) /* optimized case */ GLushort *dst = (GLushort *) rb->GetPointer(ctx, rb, x, y); GLuint len = width * height * sizeof(GLushort); - _mesa_memset(dst, (clearValue & 0xff), len); + memset(dst, (clearValue & 0xff), len); } else { /* general case */ diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 63a8d4e350..7087f25d27 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -869,7 +869,7 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) span->writeAll = GL_FALSE; } else { - _mesa_memset(span->array->mask, 1, span->end); + memset(span->array->mask, 1, span->end); span->writeAll = GL_TRUE; } @@ -1338,7 +1338,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) span->writeAll = GL_FALSE; } else { - _mesa_memset(span->array->mask, 1, span->end); + memset(span->array->mask, 1, span->end); span->writeAll = GL_TRUE; } diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 5e9a4e37c7..aa74b21ee8 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -1181,7 +1181,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) /* Note: bottom-to-top raster assumed! */ GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y); GLuint len = width * height * sizeof(GLubyte); - _mesa_memset(stencil, clearVal, len); + memset(stencil, clearVal, len); } else { /* general case */ @@ -1189,7 +1189,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) for (i = 0; i < height; i++) { GLvoid *stencil = rb->GetPointer(ctx, rb, x, y + i); if (rb->DataType == GL_UNSIGNED_BYTE) { - _mesa_memset(stencil, clearVal, width); + memset(stencil, clearVal, width); } else { _mesa_memset16((short unsigned int*) stencil, clearVal, width); diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index 7a255d680a..6436cbfc6e 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -648,7 +648,7 @@ void _tnl_generate_sse_emit( GLcontext *ctx ) return; } - _mesa_memset(&p, 0, sizeof(p)); + memset(&p, 0, sizeof(p)); p.ctx = ctx; p.inputs_safe = 0; /* for now */ diff --git a/src/mesa/vf/vf_sse.c b/src/mesa/vf/vf_sse.c index 4d70196ffe..04275903c9 100644 --- a/src/mesa/vf/vf_sse.c +++ b/src/mesa/vf/vf_sse.c @@ -629,7 +629,7 @@ void vf_generate_sse_emit( struct vertex_fetch *vf ) return; } - _mesa_memset(&p, 0, sizeof(p)); + memset(&p, 0, sizeof(p)); p.vf = vf; p.inputs_safe = 0; /* for now */ -- cgit v1.2.3 From 2efa86ea3040c37965987160733b22e2a0541a3e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 18 Feb 2010 23:51:01 -0800 Subject: Remove _mesa_memcmp in favor of plain memcmp. This may break the SUNOS4 build, but it's no longer relevant. --- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 2 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 3 +-- src/mesa/main/bitset.h | 2 +- src/mesa/main/imports.c | 11 ----------- src/mesa/main/imports.h | 3 --- src/mesa/main/texenvprogram.c | 4 ++-- 6 files changed, 5 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index a0e2dd3c09..f3d8f2f424 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -271,7 +271,7 @@ struct r300_fragment_program *r300SelectAndTranslateFragmentShader(GLcontext *ct fp = fp_list->progs; while (fp) { - if (_mesa_memcmp(&fp->state, &state, sizeof(state)) == 0) { + if (memcmp(&fp->state, &state, sizeof(state)) == 0) { return r300->selected_fp = fp; } fp = fp->next; diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index efdcdb7848..a74b7001dd 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -316,8 +316,7 @@ struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx) wanted_key.WPosAttr = r300->selected_fp->wpos_attr; for (vp = vpc->progs; vp; vp = vp->next) { - if (_mesa_memcmp(&vp->key, &wanted_key, sizeof(wanted_key)) - == 0) { + if (memcmp(&vp->key, &wanted_key, sizeof(wanted_key)) == 0) { return r300->selected_vp = vp; } } diff --git a/src/mesa/main/bitset.h b/src/mesa/main/bitset.h index 29468e8486..9f48b3ccea 100644 --- a/src/mesa/main/bitset.h +++ b/src/mesa/main/bitset.h @@ -48,7 +48,7 @@ /* bitset operations */ #define BITSET_COPY(x, y) memcpy( (x), (y), sizeof (x) ) -#define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0) +#define BITSET_EQUAL(x, y) (memcmp( (x), (y), sizeof (x) ) == 0) #define BITSET_ZERO(x) memset( (x), 0, sizeof (x) ) #define BITSET_ONES(x) memset( (x), 0xff, sizeof (x) ) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index d8375bf572..6730500225 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -268,17 +268,6 @@ _mesa_bzero( void *dst, size_t n ) #endif } -/** Wrapper around memcmp() */ -int -_mesa_memcmp( const void *s1, const void *s2, size_t n ) -{ -#if defined(SUNOS4) - return memcmp( (char *) s1, (char *) s2, (int) n ); -#else - return memcmp(s1, s2, n); -#endif -} - /*@}*/ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 68d2043c91..d5ab7cdc20 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -549,9 +549,6 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ); extern void _mesa_bzero( void *dst, size_t n ); -extern int -_mesa_memcmp( const void *s1, const void *s2, size_t n ); - extern double _mesa_sin(double a); diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 35a2cebab8..f790fd6562 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1095,7 +1095,7 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, emit_arith( p, OPCODE_MAD, tmp0, WRITEMASK_XYZW, 0, two, src[0], neg1); - if (_mesa_memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0) + if (memcmp(&src[0], &src[1], sizeof(struct ureg)) == 0) tmp1 = tmp0; else emit_arith( p, OPCODE_MAD, tmp1, WRITEMASK_XYZW, 0, @@ -1494,7 +1494,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, emit_arith( &p, OPCODE_ADD, out, WRITEMASK_XYZ, 0, cf, s, undef ); emit_arith( &p, OPCODE_MOV, out, WRITEMASK_W, 0, cf, undef, undef ); } - else if (_mesa_memcmp(&cf, &out, sizeof(cf)) != 0) { + else if (memcmp(&cf, &out, sizeof(cf)) != 0) { /* Will wind up in here if no texture enabled or a couple of * other scenarios (GL_REPLACE for instance). */ -- cgit v1.2.3 From e197de56cdb86835f1437688a9161cd909792d80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 08:09:01 -0700 Subject: mesa: replace old MEMCPY macro with memcpy --- src/gallium/state_trackers/glx/xlib/xm_api.c | 2 +- src/mesa/drivers/dri/mga/mgapixel.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 6 +-- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 4 +- src/mesa/drivers/glide/fxdd.c | 6 +-- src/mesa/drivers/glide/fxddtex.c | 4 +- src/mesa/drivers/x11/xm_api.c | 12 +++--- src/mesa/main/attrib.c | 60 ++++++++++++++-------------- src/mesa/main/context.c | 2 +- src/mesa/main/dlist.c | 14 +++---- src/mesa/main/imports.h | 2 - src/mesa/main/mipmap.c | 40 +++++++++---------- src/mesa/main/pixel.c | 4 +- src/mesa/main/texstore.c | 4 +- src/mesa/math/m_matrix.c | 28 ++++++------- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/nvprogram.c | 2 +- src/mesa/shader/nvvertparse.c | 2 +- src/mesa/shader/prog_statevars.c | 2 +- src/mesa/swrast/s_zoom.c | 8 ++-- src/mesa/tnl/t_pipeline.c | 2 +- src/mesa/tnl/t_vb_program.c | 2 +- 22 files changed, 104 insertions(+), 106 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index fb314f3b52..2e678c8f1e 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -678,7 +678,7 @@ XMesaVisual XMesaCreateVisual( Display *display, _mesa_free(v); return NULL; } - MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); + memcpy(v->visinfo, visinfo, sizeof(*visinfo)); v->ximage_flag = ximage_flag; diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c index 69415f8a83..664f7c77c2 100644 --- a/src/mesa/drivers/dri/mga/mgapixel.c +++ b/src/mesa/drivers/dri/mga/mgapixel.c @@ -600,7 +600,7 @@ mgaTryDrawPixels( GLcontext *ctx, } } #else - MEMCPY( address, pixels, rows*bufferpitch ); + memcpy( address, pixels, rows*bufferpitch ); #endif do_draw_pix( ctx, x, y, width, rows, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c index 4449627418..5a7184056d 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_pixels.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_pixels.c @@ -519,7 +519,7 @@ tdfx_readpixels_R5G6B5(GLcontext * ctx, GLint x, GLint y, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -578,7 +578,7 @@ tdfx_readpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, { GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -672,7 +672,7 @@ tdfx_drawpixels_R8G8B8A8(GLcontext * ctx, GLint x, GLint y, (format == GL_BGRA && type == GL_UNSIGNED_BYTE)) { GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst -= dstStride; src += srcStride; } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index e31ae97b02..1c51452c10 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1660,7 +1660,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->Data); ti->padded = GL_TRUE; } else { - MEMCPY(texImage->Data, data, compressedSize); + memcpy(texImage->Data, data, compressedSize); } RevalidateTexture(ctx, texObj); @@ -1707,7 +1707,7 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, rows = height / 4; /* [dBorca] hardcoded 4, but works for FXT1/DXTC */ for (i = 0; i < rows; i++) { - MEMCPY(dest, data, srcRowStride); + memcpy(dest, data, srcRowStride); dest += destRowStride; data = (GLvoid *)((intptr_t)data + (intptr_t)srcRowStride); } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 2bc60399ea..d94bf08a88 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -840,7 +840,7 @@ fxDDReadPixels565 (GLcontext * ctx, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -953,7 +953,7 @@ fxDDReadPixels555 (GLcontext * ctx, const GLint widthInBytes = width * 2; GLint row; for (row = 0; row < height; row++) { - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; src -= srcStride; } @@ -1572,7 +1572,7 @@ fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y, for (row = 0; row < height; row++) { GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, pixels, width, height, format, type, row, 0); - MEMCPY(dst, src, widthInBytes); + memcpy(dst, src, widthInBytes); dst += dstStride; } } diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 9dd4f1e9c3..a87a28ac3e 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1688,7 +1688,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->Data); ti->padded = GL_TRUE; } else { - MEMCPY(texImage->Data, data, texImage->CompressedSize); + memcpy(texImage->Data, data, texImage->CompressedSize); } ti->info.format = mml->glideFormat; @@ -1739,7 +1739,7 @@ fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target, rows = height / 4; /* hardcoded 4, but works for FXT1/DXTC */ for (i = 0; i < rows; i++) { - MEMCPY(dest, data, srcRowStride); + memcpy(dest, data, srcRowStride); dest += destRowStride; data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride); } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 1a5456e1be..98ce6c5831 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -511,12 +511,12 @@ xmesa_free_buffer(XMesaBuffer buffer) static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src) { - MEMCPY(dst->color_table, src->color_table, sizeof(src->color_table)); - MEMCPY(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r)); - MEMCPY(dst->pixel_to_g, src->pixel_to_g, sizeof(src->pixel_to_g)); - MEMCPY(dst->pixel_to_b, src->pixel_to_b, sizeof(src->pixel_to_b)); + memcpy(dst->color_table, src->color_table, sizeof(src->color_table)); + memcpy(dst->pixel_to_r, src->pixel_to_r, sizeof(src->pixel_to_r)); + memcpy(dst->pixel_to_g, src->pixel_to_g, sizeof(src->pixel_to_g)); + memcpy(dst->pixel_to_b, src->pixel_to_b, sizeof(src->pixel_to_b)); dst->num_alloced = src->num_alloced; - MEMCPY(dst->alloced_colors, src->alloced_colors, + memcpy(dst->alloced_colors, src->alloced_colors, sizeof(src->alloced_colors)); } @@ -1376,7 +1376,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, _mesa_free(v); return NULL; } - MEMCPY(v->visinfo, visinfo, sizeof(*visinfo)); + memcpy(v->visinfo, visinfo, sizeof(*visinfo)); #endif /* check for MESA_GAMMA environment variable */ diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 881644cdaf..44dc3b871e 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -222,7 +222,7 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_ACCUM_BUFFER_BIT) { struct gl_accum_attrib *attr; attr = MALLOC_STRUCT( gl_accum_attrib ); - MEMCPY( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); + memcpy( attr, &ctx->Accum, sizeof(struct gl_accum_attrib) ); save_attrib_data(&head, GL_ACCUM_BUFFER_BIT, attr); } @@ -230,7 +230,7 @@ _mesa_PushAttrib(GLbitfield mask) GLuint i; struct gl_colorbuffer_attrib *attr; attr = MALLOC_STRUCT( gl_colorbuffer_attrib ); - MEMCPY( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); + memcpy( attr, &ctx->Color, sizeof(struct gl_colorbuffer_attrib) ); /* push the Draw FBO's DrawBuffer[] state, not ctx->Color.DrawBuffer[] */ for (i = 0; i < ctx->Const.MaxDrawBuffers; i ++) attr->DrawBuffer[i] = ctx->DrawBuffer->ColorDrawBuffer[i]; @@ -241,14 +241,14 @@ _mesa_PushAttrib(GLbitfield mask) struct gl_current_attrib *attr; FLUSH_CURRENT( ctx, 0 ); attr = MALLOC_STRUCT( gl_current_attrib ); - MEMCPY( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); + memcpy( attr, &ctx->Current, sizeof(struct gl_current_attrib) ); save_attrib_data(&head, GL_CURRENT_BIT, attr); } if (mask & GL_DEPTH_BUFFER_BIT) { struct gl_depthbuffer_attrib *attr; attr = MALLOC_STRUCT( gl_depthbuffer_attrib ); - MEMCPY( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); + memcpy( attr, &ctx->Depth, sizeof(struct gl_depthbuffer_attrib) ); save_attrib_data(&head, GL_DEPTH_BUFFER_BIT, attr); } @@ -292,7 +292,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map1TextureCoord4 = ctx->Eval.Map1TextureCoord4; attr->Map1Vertex3 = ctx->Eval.Map1Vertex3; attr->Map1Vertex4 = ctx->Eval.Map1Vertex4; - MEMCPY(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); + memcpy(attr->Map1Attrib, ctx->Eval.Map1Attrib, sizeof(ctx->Eval.Map1Attrib)); attr->Map2Color4 = ctx->Eval.Map2Color4; attr->Map2Index = ctx->Eval.Map2Index; attr->Map2Normal = ctx->Eval.Map2Normal; @@ -302,7 +302,7 @@ _mesa_PushAttrib(GLbitfield mask) attr->Map2TextureCoord4 = ctx->Eval.Map2TextureCoord4; attr->Map2Vertex3 = ctx->Eval.Map2Vertex3; attr->Map2Vertex4 = ctx->Eval.Map2Vertex4; - MEMCPY(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); + memcpy(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib)); attr->Normalize = ctx->Transform.Normalize; attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped; attr->PointSmooth = ctx->Point.SmoothFlag; @@ -336,21 +336,21 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_EVAL_BIT) { struct gl_eval_attrib *attr; attr = MALLOC_STRUCT( gl_eval_attrib ); - MEMCPY( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); + memcpy( attr, &ctx->Eval, sizeof(struct gl_eval_attrib) ); save_attrib_data(&head, GL_EVAL_BIT, attr); } if (mask & GL_FOG_BIT) { struct gl_fog_attrib *attr; attr = MALLOC_STRUCT( gl_fog_attrib ); - MEMCPY( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); + memcpy( attr, &ctx->Fog, sizeof(struct gl_fog_attrib) ); save_attrib_data(&head, GL_FOG_BIT, attr); } if (mask & GL_HINT_BIT) { struct gl_hint_attrib *attr; attr = MALLOC_STRUCT( gl_hint_attrib ); - MEMCPY( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); + memcpy( attr, &ctx->Hint, sizeof(struct gl_hint_attrib) ); save_attrib_data(&head, GL_HINT_BIT, attr); } @@ -358,28 +358,28 @@ _mesa_PushAttrib(GLbitfield mask) struct gl_light_attrib *attr; FLUSH_CURRENT(ctx, 0); /* flush material changes */ attr = MALLOC_STRUCT( gl_light_attrib ); - MEMCPY( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); + memcpy( attr, &ctx->Light, sizeof(struct gl_light_attrib) ); save_attrib_data(&head, GL_LIGHTING_BIT, attr); } if (mask & GL_LINE_BIT) { struct gl_line_attrib *attr; attr = MALLOC_STRUCT( gl_line_attrib ); - MEMCPY( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); + memcpy( attr, &ctx->Line, sizeof(struct gl_line_attrib) ); save_attrib_data(&head, GL_LINE_BIT, attr); } if (mask & GL_LIST_BIT) { struct gl_list_attrib *attr; attr = MALLOC_STRUCT( gl_list_attrib ); - MEMCPY( attr, &ctx->List, sizeof(struct gl_list_attrib) ); + memcpy( attr, &ctx->List, sizeof(struct gl_list_attrib) ); save_attrib_data(&head, GL_LIST_BIT, attr); } if (mask & GL_PIXEL_MODE_BIT) { struct gl_pixel_attrib *attr; attr = MALLOC_STRUCT( gl_pixel_attrib ); - MEMCPY( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); + memcpy( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) ); /* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */ attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer; save_attrib_data(&head, GL_PIXEL_MODE_BIT, attr); @@ -388,35 +388,35 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_POINT_BIT) { struct gl_point_attrib *attr; attr = MALLOC_STRUCT( gl_point_attrib ); - MEMCPY( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); + memcpy( attr, &ctx->Point, sizeof(struct gl_point_attrib) ); save_attrib_data(&head, GL_POINT_BIT, attr); } if (mask & GL_POLYGON_BIT) { struct gl_polygon_attrib *attr; attr = MALLOC_STRUCT( gl_polygon_attrib ); - MEMCPY( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); + memcpy( attr, &ctx->Polygon, sizeof(struct gl_polygon_attrib) ); save_attrib_data(&head, GL_POLYGON_BIT, attr); } if (mask & GL_POLYGON_STIPPLE_BIT) { GLuint *stipple; stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) ); - MEMCPY( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); + memcpy( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) ); save_attrib_data(&head, GL_POLYGON_STIPPLE_BIT, stipple); } if (mask & GL_SCISSOR_BIT) { struct gl_scissor_attrib *attr; attr = MALLOC_STRUCT( gl_scissor_attrib ); - MEMCPY( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); + memcpy( attr, &ctx->Scissor, sizeof(struct gl_scissor_attrib) ); save_attrib_data(&head, GL_SCISSOR_BIT, attr); } if (mask & GL_STENCIL_BUFFER_BIT) { struct gl_stencil_attrib *attr; attr = MALLOC_STRUCT( gl_stencil_attrib ); - MEMCPY( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); + memcpy( attr, &ctx->Stencil, sizeof(struct gl_stencil_attrib) ); save_attrib_data(&head, GL_STENCIL_BUFFER_BIT, attr); } @@ -460,14 +460,14 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_TRANSFORM_BIT) { struct gl_transform_attrib *attr; attr = MALLOC_STRUCT( gl_transform_attrib ); - MEMCPY( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); + memcpy( attr, &ctx->Transform, sizeof(struct gl_transform_attrib) ); save_attrib_data(&head, GL_TRANSFORM_BIT, attr); } if (mask & GL_VIEWPORT_BIT) { struct gl_viewport_attrib *attr; attr = MALLOC_STRUCT( gl_viewport_attrib ); - MEMCPY( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); + memcpy( attr, &ctx->Viewport, sizeof(struct gl_viewport_attrib) ); save_attrib_data(&head, GL_VIEWPORT_BIT, attr); } @@ -475,7 +475,7 @@ _mesa_PushAttrib(GLbitfield mask) if (mask & GL_MULTISAMPLE_BIT_ARB) { struct gl_multisample_attrib *attr; attr = MALLOC_STRUCT( gl_multisample_attrib ); - MEMCPY( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); + memcpy( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) ); save_attrib_data(&head, GL_MULTISAMPLE_BIT_ARB, attr); } @@ -1010,7 +1010,7 @@ _mesa_PopAttrib(void) break; case GL_CURRENT_BIT: FLUSH_CURRENT( ctx, 0 ); - MEMCPY( &ctx->Current, attr->data, + memcpy( &ctx->Current, attr->data, sizeof(struct gl_current_attrib) ); break; case GL_DEPTH_BUFFER_BIT: @@ -1032,7 +1032,7 @@ _mesa_PopAttrib(void) } break; case GL_EVAL_BIT: - MEMCPY( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) ); + memcpy( &ctx->Eval, attr->data, sizeof(struct gl_eval_attrib) ); ctx->NewState |= _NEW_EVAL; break; case GL_FOG_BIT: @@ -1126,7 +1126,7 @@ _mesa_PopAttrib(void) _mesa_set_enable(ctx, GL_COLOR_MATERIAL, light->ColorMaterialEnabled); /* materials */ - MEMCPY(&ctx->Light.Material, &light->Material, + memcpy(&ctx->Light.Material, &light->Material, sizeof(struct gl_material)); } break; @@ -1141,10 +1141,10 @@ _mesa_PopAttrib(void) } break; case GL_LIST_BIT: - MEMCPY( &ctx->List, attr->data, sizeof(struct gl_list_attrib) ); + memcpy( &ctx->List, attr->data, sizeof(struct gl_list_attrib) ); break; case GL_PIXEL_MODE_BIT: - MEMCPY( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); + memcpy( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) ); /* XXX what other pixel state needs to be set by function calls? */ _mesa_ReadBuffer(ctx->Pixel.ReadBuffer); ctx->NewState |= _NEW_PIXEL; @@ -1203,7 +1203,7 @@ _mesa_PopAttrib(void) } break; case GL_POLYGON_STIPPLE_BIT: - MEMCPY( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); + memcpy( ctx->PolygonStipple, attr->data, 32*sizeof(GLuint) ); ctx->NewState |= _NEW_POLYGONSTIPPLE; if (ctx->Driver.PolygonStipple) ctx->Driver.PolygonStipple( ctx, (const GLubyte *) attr->data ); @@ -1417,8 +1417,8 @@ _mesa_PushClientAttrib(GLbitfield mask) ctx->Array.ElementArrayBufferObj->RefCount++; #endif - MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); - MEMCPY( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); + memcpy( attr, &ctx->Array, sizeof(struct gl_array_attrib) ); + memcpy( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) ); attr->ArrayObj = obj; @@ -1492,7 +1492,7 @@ _mesa_PopClientAttrib(void) data->ElementArrayBufferObj->Name); #endif - MEMCPY( ctx->Array.ArrayObj, data->ArrayObj, + memcpy( ctx->Array.ArrayObj, data->ArrayObj, sizeof( struct gl_array_object ) ); FREE( data->ArrayObj ); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index c292d1fea5..f315f0b212 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1108,7 +1108,7 @@ _mesa_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) dst->Polygon = src->Polygon; } if (mask & GL_POLYGON_STIPPLE_BIT) { - /* Use loop instead of MEMCPY due to problem with Portland Group's + /* Use loop instead of memcpy due to problem with Portland Group's * C compiler. Reported by John Stone. */ GLuint i; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index ea0d13b890..9c472d85e3 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -2913,7 +2913,7 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) n[1].e = map; n[2].i = mapsize; n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat)); - MEMCPY(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); + memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); } if (ctx->ExecuteFlag) { CALL_PixelMapfv(ctx->Exec, (map, mapsize, values)); @@ -4365,7 +4365,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); if (n) { n[1].e = target; @@ -4411,7 +4411,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); if (n) { n[1].e = target; @@ -4458,7 +4458,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); if (n) { n[1].e = target; @@ -4501,7 +4501,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); if (n) { n[1].e = target; @@ -4541,7 +4541,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); if (n) { n[1].e = target; @@ -4583,7 +4583,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB"); return; } - MEMCPY(image, data, imageSize); + memcpy(image, data, imageSize); n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); if (n) { n[1].e = target; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index d5ab7cdc20..c4e28df051 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -71,8 +71,6 @@ extern "C" { /** Free aligned memory */ #define ALIGN_FREE(PTR) _mesa_align_free(PTR) -/** Copy \p BYTES bytes from \p SRC into \p DST */ -#define MEMCPY( DST, SRC, BYTES) memcpy(DST, SRC, BYTES) /** Set \p N bytes in \p DST to \p VAL */ #define MEMSET( DST, VAL, N ) memset(DST, VAL, N) diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 77cd1d4159..1da576337f 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -979,9 +979,9 @@ make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); } @@ -1025,15 +1025,15 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + memcpy(dstPtr + dstWidth * (dstHeight - 1) * bpt, srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + memcpy(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ do_row(datatype, comps, srcWidthNB, @@ -1050,9 +1050,9 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, if (srcHeight == dstHeight) { /* copy border pixel from src to dst */ for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, + memcpy(dstPtr + dstWidth * row * bpt, srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); } } @@ -1174,28 +1174,28 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, /* do border along [img][row=0][col=0] */ src = srcPtr + (img + 1) * bytesPerSrcImage; dst = dstPtr + (img + 1) * bytesPerDstImage; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=dstHeight-1][col=0] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (srcHeight - 1) * bytesPerSrcRow; dst = dstPtr + (img + 1) * bytesPerDstImage + (dstHeight - 1) * bytesPerDstRow; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=0][col=dstWidth-1] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (srcWidth - 1) * bpt; dst = dstPtr + (img + 1) * bytesPerDstImage + (dstWidth - 1) * bpt; - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); /* do border along [img][row=dstHeight-1][col=dstWidth-1] */ src = srcPtr + (img * 2 + 1) * bytesPerSrcImage + (bytesPerSrcImage - bpt); dst = dstPtr + (img + 1) * bytesPerDstImage + (bytesPerDstImage - bpt); - MEMCPY(dst, src, bpt); + memcpy(dst, src, bpt); } } else { @@ -1265,9 +1265,9 @@ make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); } @@ -1319,15 +1319,15 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ - MEMCPY(dstPtr, srcPtr, bpt); + memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ - MEMCPY(dstPtr + (dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth - 1) * bpt, srcPtr + (srcWidth - 1) * bpt, bpt); /* upper-left border pixel */ - MEMCPY(dstPtr + dstWidth * (dstHeight - 1) * bpt, + memcpy(dstPtr + dstWidth * (dstHeight - 1) * bpt, srcPtr + srcWidth * (srcHeight - 1) * bpt, bpt); /* upper-right border pixel */ - MEMCPY(dstPtr + (dstWidth * dstHeight - 1) * bpt, + memcpy(dstPtr + (dstWidth * dstHeight - 1) * bpt, srcPtr + (srcWidth * srcHeight - 1) * bpt, bpt); /* lower border */ do_row(datatype, comps, srcWidthNB, @@ -1344,9 +1344,9 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (srcHeight == dstHeight) { /* copy border pixel from src to dst */ for (row = 1; row < srcHeight; row++) { - MEMCPY(dstPtr + dstWidth * row * bpt, + memcpy(dstPtr + dstWidth * row * bpt, srcPtr + srcWidth * row * bpt, bpt); - MEMCPY(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, + memcpy(dstPtr + (dstWidth * row + dstWidth - 1) * bpt, srcPtr + (srcWidth * row + srcWidth - 1) * bpt, bpt); } } diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index ca6ecd7bfb..f6c316a580 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -362,7 +362,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) } } else { - MEMCPY(values, pm->Map, mapsize * sizeof(GLfloat)); + memcpy(values, pm->Map, mapsize * sizeof(GLfloat)); } _mesa_unmap_pbo_dest(ctx, &ctx->Pack); @@ -401,7 +401,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) if (map == GL_PIXEL_MAP_S_TO_S) { /* special case */ - MEMCPY(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); + memcpy(values, ctx->PixelMaps.StoS.Map, mapsize * sizeof(GLint)); } else { for (i = 0; i < mapsize; i++) { diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index c1418e0967..ab572a13ed 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3716,7 +3716,7 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; /* copy the data */ - MEMCPY(texImage->Data, data, imageSize); + memcpy(texImage->Data, data, imageSize); _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); } @@ -3823,7 +3823,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, /* copy rows of blocks */ for (i = 0; i < rows; i++) { - MEMCPY(dest, src, bytesPerRow); + memcpy(dest, src, bytesPerRow); dest += destRowStride; src += srcRowStride; } diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index da6956efed..e810d6deb8 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -599,7 +599,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) } else { /* pure translation */ - MEMCPY( out, Identity, sizeof(Identity) ); + memcpy( out, Identity, sizeof(Identity) ); MAT(out,0,3) = - MAT(in,0,3); MAT(out,1,3) = - MAT(in,1,3); MAT(out,2,3) = - MAT(in,2,3); @@ -637,7 +637,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) */ static GLboolean invert_matrix_identity( GLmatrix *mat ) { - MEMCPY( mat->inv, Identity, sizeof(Identity) ); + memcpy( mat->inv, Identity, sizeof(Identity) ); return GL_TRUE; } @@ -659,7 +659,7 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 ) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); MAT(out,2,2) = 1.0F / MAT(in,2,2); @@ -692,7 +692,7 @@ static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat ) if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); @@ -714,7 +714,7 @@ static GLboolean invert_matrix_perspective( GLmatrix *mat ) if (MAT(in,2,3) == 0) return GL_FALSE; - MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); + memcpy( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0F / MAT(in,0,0); MAT(out,1,1) = 1.0F / MAT(in,1,1); @@ -776,7 +776,7 @@ static GLboolean matrix_invert( GLmatrix *mat ) return GL_TRUE; } else { mat->flags |= MAT_FLAG_SINGULAR; - MEMCPY( mat->inv, Identity, sizeof(Identity) ); + memcpy( mat->inv, Identity, sizeof(Identity) ); return GL_FALSE; } } @@ -807,7 +807,7 @@ _math_matrix_rotate( GLmatrix *mat, s = (GLfloat) _mesa_sin( angle * DEG2RAD ); c = (GLfloat) _mesa_cos( angle * DEG2RAD ); - MEMCPY(m, Identity, sizeof(GLfloat)*16); + memcpy(m, Identity, sizeof(GLfloat)*16); optimized = GL_FALSE; #define M(row,col) m[col*4+row] @@ -1141,10 +1141,10 @@ _math_matrix_viewport(GLmatrix *m, GLint x, GLint y, GLint width, GLint height, void _math_matrix_set_identity( GLmatrix *mat ) { - MEMCPY( mat->m, Identity, 16*sizeof(GLfloat) ); + memcpy( mat->m, Identity, 16*sizeof(GLfloat) ); if (mat->inv) - MEMCPY( mat->inv, Identity, 16*sizeof(GLfloat) ); + memcpy( mat->inv, Identity, 16*sizeof(GLfloat) ); mat->type = MATRIX_IDENTITY; mat->flags &= ~(MAT_DIRTY_FLAGS| @@ -1444,7 +1444,7 @@ _math_matrix_is_dirty( const GLmatrix *m ) void _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) { - MEMCPY( to->m, from->m, sizeof(Identity) ); + memcpy( to->m, from->m, sizeof(Identity) ); to->flags = from->flags; to->type = from->type; @@ -1453,7 +1453,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) matrix_invert( to ); } else { - MEMCPY(to->inv, from->inv, sizeof(GLfloat)*16); + memcpy(to->inv, from->inv, sizeof(GLfloat)*16); } } } @@ -1470,7 +1470,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) void _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ) { - MEMCPY( mat->m, m, 16*sizeof(GLfloat) ); + memcpy( mat->m, m, 16*sizeof(GLfloat) ); mat->flags = (MAT_FLAG_GENERAL | MAT_DIRTY); } @@ -1486,7 +1486,7 @@ _math_matrix_ctr( GLmatrix *m ) { m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if (m->m) - MEMCPY( m->m, Identity, sizeof(Identity) ); + memcpy( m->m, Identity, sizeof(Identity) ); m->inv = NULL; m->type = MATRIX_IDENTITY; m->flags = 0; @@ -1525,7 +1525,7 @@ _math_matrix_alloc_inv( GLmatrix *m ) if (!m->inv) { m->inv = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); if (m->inv) - MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) ); + memcpy( m->inv, Identity, 16 * sizeof(GLfloat) ); } } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index e226973c53..35f18aa2fb 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1479,7 +1479,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - MEMCPY(programString, str, len); + memcpy(programString, str, len); programString[len] = 0; /* Get ready to parse */ diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 394b6a42d7..19020be42c 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -297,7 +297,7 @@ _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) } if (prog->String) { - MEMCPY(program, prog->String, strlen((char *) prog->String)); + memcpy(program, prog->String, strlen((char *) prog->String)); } else { program[0] = 0; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 1a840a3a92..3656438d42 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1296,7 +1296,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; } - MEMCPY(programString, str, len); + memcpy(programString, str, len); programString[len] = 0; /* Get ready to parse */ diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index a0be1acfca..f5264fa918 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -1117,7 +1117,7 @@ static void load_transpose_matrix(GLfloat registers[][4], GLuint pos, const GLfloat mat[16]) { - MEMCPY(registers[pos], mat, 16 * sizeof(GLfloat)); + memcpy(registers[pos], mat, 16 * sizeof(GLfloat)); } diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index a48eae1925..bec16208e3 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -324,14 +324,14 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, ((zoomed.array->ChanType == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) : 4 * sizeof(GLfloat)); if (y1 - y0 > 1) { - MEMCPY(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); + memcpy(rgbaSave, zoomed.array->rgba, zoomed.end * pixelSize); } for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { _swrast_write_rgba_span(ctx, &zoomed); zoomed.end = end; /* restore */ if (y1 - y0 > 1) { /* restore the colors */ - MEMCPY(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); + memcpy(zoomed.array->rgba, rgbaSave, zoomed.end * pixelSize); } } } @@ -340,14 +340,14 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC]; const GLint end = zoomed.end; /* save */ if (y1 - y0 > 1) { - MEMCPY(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); + memcpy(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); } for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { _swrast_write_index_span(ctx, &zoomed); zoomed.end = end; /* restore */ if (y1 - y0 > 1) { /* restore the colors */ - MEMCPY(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); + memcpy(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); } } } diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 946b29e250..36fcd074cd 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -47,7 +47,7 @@ void _tnl_install_pipeline( GLcontext *ctx, */ for (i = 0 ; i < MAX_PIPELINE_STAGES && stages[i] ; i++) { struct tnl_pipeline_stage *s = &tnl->pipeline.stages[i]; - MEMCPY(s, stages[i], sizeof(*s)); + memcpy(s, stages[i], sizeof(*s)); if (s->create) s->create(ctx, s); } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 44b64b17d1..5351b5fe41 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -221,7 +221,7 @@ static void init_machine(GLcontext *ctx, struct gl_program_machine *machine) { /* Input registers get initialized from the current vertex attribs */ - MEMCPY(machine->VertAttribs, ctx->Current.Attrib, + memcpy(machine->VertAttribs, ctx->Current.Attrib, MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat)); if (ctx->VertexProgram._Current->IsNVProgram) { -- cgit v1.2.3 From 2240ba10f30315410bcff77e372ee71664ac4453 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 08:12:31 -0700 Subject: mesa: replace old MEMSET macro with memset --- src/gallium/state_trackers/glx/xlib/glx_usefont.c | 2 +- src/mesa/drivers/dri/tdfx/tdfx_span.c | 6 +++--- src/mesa/drivers/x11/xfonts.c | 2 +- src/mesa/drivers/x11/xm_dd.c | 10 +++++----- src/mesa/main/eval.c | 4 ++-- src/mesa/main/imports.h | 3 --- src/mesa/main/polygon.c | 2 +- src/mesa/math/m_translate.c | 14 +++++++------- 8 files changed, 20 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/glx_usefont.c b/src/gallium/state_trackers/glx/xlib/glx_usefont.c index e502198b20..8903b0e6cb 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_usefont.c +++ b/src/gallium/state_trackers/glx/xlib/glx_usefont.c @@ -343,7 +343,7 @@ glXUseXFont(Font font, int first, int count, int listbase) glNewList(list, GL_COMPILE); if (valid && (bm_width > 0) && (bm_height > 0)) { - MEMSET(bm, '\0', bm_width * bm_height); + memset(bm, '\0', bm_width * bm_height); fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm); glBitmap(width, height, x0, y0, dx, dy, bm); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index a17bcd952a..3879d506ee 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -264,7 +264,7 @@ generate_vismask(const tdfxContextPtr fxMesa, GLint x, GLint y, GLint n, GLint i, j; /* Ensure we clear the visual mask */ - MEMSET(vismask, 0, n); + memset(vismask, 0, n); /* turn on flags for all visible pixels */ for (i = 0; i < fxMesa->numClipRects; i++) { @@ -273,14 +273,14 @@ generate_vismask(const tdfxContextPtr fxMesa, GLint x, GLint y, GLint n, if (y >= rect->y1 && y < rect->y2) { if (x >= rect->x1 && x + n <= rect->x2) { /* common case, whole span inside cliprect */ - MEMSET(vismask, 1, n); + memset(vismask, 1, n); return; } if (x < rect->x2 && x + n >= rect->x1) { /* some of the span is inside the rect */ GLint start, end; if (!initialized) { - MEMSET(vismask, 0, n); + memset(vismask, 0, n); initialized = GL_TRUE; } if (x < rect->x1) diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c index f732c94586..91f819b8df 100644 --- a/src/mesa/drivers/x11/xfonts.c +++ b/src/mesa/drivers/x11/xfonts.c @@ -345,7 +345,7 @@ Fake_glXUseXFont(Font font, int first, int count, int listbase) glNewList(list, GL_COMPILE); if (valid && (bm_width > 0) && (bm_height > 0)) { - MEMSET(bm, '\0', bm_width * bm_height); + memset(bm, '\0', bm_width * bm_height); fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm); glBitmap(width, height, x0, y0, dx, dy, bm); diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index d70236c2a0..d304192f4c 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -232,7 +232,7 @@ clear_8bit_ximage( GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLint i; for (i = 0; i < height; i++) { GLubyte *ptr = PIXEL_ADDR1(xrb, x, y + i); - MEMSET( ptr, xmesa->clearpixel, width ); + memset( ptr, xmesa->clearpixel, width ); } } @@ -294,7 +294,7 @@ clear_24bit_ximage(GLcontext *ctx, struct xmesa_renderbuffer *xrb, GLint j; for (j = 0; j < height; j++) { bgr_t *ptr3 = PIXEL_ADDR3(xrb, x, y + j); - MEMSET(ptr3, r, 3 * width); + memset(ptr3, r, 3 * width); } } else { @@ -524,7 +524,7 @@ xmesa_DrawPixels_8R8G8B( GLcontext *ctx, * been in the OpenGL bottom-to-top orientation. X is top-to-bottom * so we have to carefully compute the Y coordinates/addresses here. */ - MEMSET(&ximage, 0, sizeof(XMesaImage)); + memset(&ximage, 0, sizeof(XMesaImage)); ximage.width = width; ximage.height = height; ximage.format = ZPixmap; @@ -658,7 +658,7 @@ xmesa_DrawPixels_5R6G5B( GLcontext *ctx, * been in the OpenGL bottom-to-top orientation. X is top-to-bottom * so we have to carefully compute the Y coordinates/addresses here. */ - MEMSET(&ximage, 0, sizeof(XMesaImage)); + memset(&ximage, 0, sizeof(XMesaImage)); ximage.width = width; ximage.height = height; ximage.format = ZPixmap; @@ -829,7 +829,7 @@ clear_color_HPCR_ximage( GLcontext *ctx, const GLfloat color[4] ) if (color[0] == 0.0 && color[1] == 0.0 && color[2] == 0.0) { /* black is black */ - MEMSET( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 , + memset( xmesa->xm_visual->hpcr_clear_ximage_pattern, 0x0 , sizeof(xmesa->xm_visual->hpcr_clear_ximage_pattern)); } else { diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 95d6e23187..58eb59b13c 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -894,7 +894,7 @@ void _mesa_init_eval( GLcontext *ctx ) ctx->Eval.Map1TextureCoord4 = GL_FALSE; ctx->Eval.Map1Vertex3 = GL_FALSE; ctx->Eval.Map1Vertex4 = GL_FALSE; - MEMSET(ctx->Eval.Map1Attrib, 0, sizeof(ctx->Eval.Map1Attrib)); + memset(ctx->Eval.Map1Attrib, 0, sizeof(ctx->Eval.Map1Attrib)); ctx->Eval.Map2Color4 = GL_FALSE; ctx->Eval.Map2Index = GL_FALSE; ctx->Eval.Map2Normal = GL_FALSE; @@ -904,7 +904,7 @@ void _mesa_init_eval( GLcontext *ctx ) ctx->Eval.Map2TextureCoord4 = GL_FALSE; ctx->Eval.Map2Vertex3 = GL_FALSE; ctx->Eval.Map2Vertex4 = GL_FALSE; - MEMSET(ctx->Eval.Map2Attrib, 0, sizeof(ctx->Eval.Map2Attrib)); + memset(ctx->Eval.Map2Attrib, 0, sizeof(ctx->Eval.Map2Attrib)); ctx->Eval.AutoNormal = GL_FALSE; ctx->Eval.MapGrid1un = 1; ctx->Eval.MapGrid1u1 = 0.0; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index c4e28df051..048ae912c9 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -71,9 +71,6 @@ extern "C" { /** Free aligned memory */ #define ALIGN_FREE(PTR) _mesa_align_free(PTR) -/** Set \p N bytes in \p DST to \p VAL */ -#define MEMSET( DST, VAL, N ) memset(DST, VAL, N) - /*@}*/ diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index dcde6758c3..30e4a606bb 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -315,7 +315,7 @@ void _mesa_init_polygon( GLcontext * ctx ) /* Polygon Stipple group */ - MEMSET( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) ); + memset( ctx->PolygonStipple, 0xff, 32*sizeof(GLuint) ); } /*@}*/ diff --git a/src/mesa/math/m_translate.c b/src/mesa/math/m_translate.c index 4a20f45ee4..b12b07957c 100644 --- a/src/mesa/math/m_translate.c +++ b/src/mesa/math/m_translate.c @@ -556,13 +556,13 @@ static void trans_4_GLubyte_4ub_raw(GLubyte (*t)[4], static void init_translate_raw(void) { - MEMSET( TAB(_1ui), 0, sizeof(TAB(_1ui)) ); - MEMSET( TAB(_1ub), 0, sizeof(TAB(_1ub)) ); - MEMSET( TAB(_3fn), 0, sizeof(TAB(_3fn)) ); - MEMSET( TAB(_4ub), 0, sizeof(TAB(_4ub)) ); - MEMSET( TAB(_4us), 0, sizeof(TAB(_4us)) ); - MEMSET( TAB(_4f), 0, sizeof(TAB(_4f)) ); - MEMSET( TAB(_4fn), 0, sizeof(TAB(_4fn)) ); + memset( TAB(_1ui), 0, sizeof(TAB(_1ui)) ); + memset( TAB(_1ub), 0, sizeof(TAB(_1ub)) ); + memset( TAB(_3fn), 0, sizeof(TAB(_3fn)) ); + memset( TAB(_4ub), 0, sizeof(TAB(_4ub)) ); + memset( TAB(_4us), 0, sizeof(TAB(_4us)) ); + memset( TAB(_4f), 0, sizeof(TAB(_4f)) ); + memset( TAB(_4fn), 0, sizeof(TAB(_4fn)) ); init_trans_4_GLbyte_raw(); init_trans_3_GLbyte_raw(); -- cgit v1.2.3 From 6bf1ea897fa470af58fe8916dff45e2da79634a3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 08:32:36 -0700 Subject: mesa: replace _mesa_bzero() with memset() --- src/mesa/drivers/common/driverfuncs.c | 2 +- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 2 +- src/mesa/main/bufferobj.c | 2 +- src/mesa/main/dlist.c | 2 +- src/mesa/main/framebuffer.c | 6 +++--- src/mesa/main/imports.c | 11 ----------- src/mesa/main/imports.h | 3 --- src/mesa/main/renderbuffer.c | 4 ++-- src/mesa/main/texobj.c | 2 +- src/mesa/shader/nvfragparse.c | 2 +- src/mesa/shader/prog_instruction.c | 2 +- src/mesa/shader/program.c | 2 +- src/mesa/shader/slang/slang_emit.c | 4 ++-- src/mesa/shader/slang/slang_typeinfo.c | 2 +- src/mesa/swrast/s_depth.c | 16 ++++++++-------- src/mesa/swrast/s_fragprog.c | 3 +-- src/mesa/swrast/s_span.c | 4 ++-- 17 files changed, 27 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 4f6f083677..87163e6505 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -70,7 +70,7 @@ void _mesa_init_driver_functions(struct dd_function_table *driver) { - _mesa_bzero(driver, sizeof(*driver)); + memset(driver, 0, sizeof(*driver)); driver->GetString = NULL; /* REQUIRED! */ driver->UpdateState = NULL; /* REQUIRED! */ diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index f3d8f2f424..acc66e0ae0 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -72,7 +72,7 @@ static void build_state( { int unit; - _mesa_bzero(state, sizeof(*state)); + memset(state, 0, sizeof(*state)); for(unit = 0; unit < 16; ++unit) { if (fp->Base.ShadowSamplers & (1 << unit)) { diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index c735661dc2..2e9793ea0e 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -295,7 +295,7 @@ _mesa_initialize_buffer_object( struct gl_buffer_object *obj, { (void) target; - _mesa_bzero(obj, sizeof(struct gl_buffer_object)); + memset(obj, 0, sizeof(struct gl_buffer_object)); _glthread_INIT_MUTEX(obj->Mutex); obj->RefCount = 1; obj->Name = name; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 9c472d85e3..740ebfe17a 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -9711,7 +9711,7 @@ _mesa_init_display_list(GLcontext *ctx) /* zero-out the instruction size table, just once */ if (!tableInitialized) { - _mesa_bzero(InstSize, sizeof(InstSize)); + memset(InstSize, 0, sizeof(InstSize)); tableInitialized = GL_TRUE; } diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 96e5344383..41b5420943 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -127,7 +127,7 @@ _mesa_initialize_window_framebuffer(struct gl_framebuffer *fb, assert(fb); assert(visual); - _mesa_bzero(fb, sizeof(struct gl_framebuffer)); + memset(fb, 0, sizeof(struct gl_framebuffer)); _glthread_INIT_MUTEX(fb->Mutex); @@ -169,7 +169,7 @@ _mesa_initialize_user_framebuffer(struct gl_framebuffer *fb, GLuint name) assert(fb); assert(name); - _mesa_bzero(fb, sizeof(struct gl_framebuffer)); + memset(fb, 0, sizeof(struct gl_framebuffer)); fb->Name = name; fb->RefCount = 1; @@ -526,7 +526,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) { GLuint i; - _mesa_bzero(&fb->Visual, sizeof(fb->Visual)); + memset(&fb->Visual, 0, sizeof(fb->Visual)); fb->Visual.rgbMode = GL_TRUE; /* assume this */ #if 0 /* this _might_ be needed */ diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 6730500225..5c2c863f97 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -257,17 +257,6 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ) *dst++ = val; } -/** Wrapper around either memset() or bzero() */ -void -_mesa_bzero( void *dst, size_t n ) -{ -#if defined(__FreeBSD__) - bzero( dst, n ); -#else - memset( dst, 0, n ); -#endif -} - /*@}*/ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 048ae912c9..106dd021a1 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -541,9 +541,6 @@ _mesa_realloc( void *oldBuffer, size_t oldSize, size_t newSize ); extern void _mesa_memset16( unsigned short *dst, unsigned short val, size_t n ); -extern void -_mesa_bzero( void *dst, size_t n ); - extern double _mesa_sin(double a); diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index bb0c78382c..aec22d9d14 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -706,7 +706,7 @@ put_mono_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, ASSERT(rb->Format == MESA_FORMAT_RGBA8888); if (!mask && val == 0) { /* common case */ - _mesa_bzero(dst, count * 4 * sizeof(GLubyte)); + memset(dst, 0, count * 4 * sizeof(GLubyte)); } else { /* general case */ @@ -868,7 +868,7 @@ put_mono_row_ushort4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) { /* common case for clearing accum buffer */ - _mesa_bzero(dst, count * 4 * sizeof(GLushort)); + memset(dst, 0, count * 4 * sizeof(GLushort)); } else { GLuint i; diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 9db95814d0..649f3587cb 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -106,7 +106,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, target == GL_TEXTURE_1D_ARRAY_EXT || target == GL_TEXTURE_2D_ARRAY_EXT); - _mesa_bzero(obj, sizeof(*obj)); + memset(obj, 0, sizeof(*obj)); /* init the non-zero fields */ _glthread_INIT_MUTEX(obj->Mutex); obj->RefCount = 1; diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 35f18aa2fb..639408d82a 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1483,7 +1483,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, programString[len] = 0; /* Get ready to parse */ - _mesa_bzero(&parseState, sizeof(struct parse_state)); + memset(&parseState, 0, sizeof(struct parse_state)); parseState.ctx = ctx; parseState.start = programString; parseState.program = program; diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index dcf834f52d..0c4da4d107 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -40,7 +40,7 @@ _mesa_init_instructions(struct prog_instruction *inst, GLuint count) { GLuint i; - _mesa_bzero(inst, count * sizeof(struct prog_instruction)); + memset(inst, 0, count * sizeof(struct prog_instruction)); for (i = 0; i < count; i++) { inst[i].SrcReg[0].File = PROGRAM_UNDEFINED; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 2410ccb047..0c3c5ffbd5 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -240,7 +240,7 @@ _mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog, (void) ctx; if (prog) { GLuint i; - _mesa_bzero(prog, sizeof(*prog)); + memset(prog, 0, sizeof(*prog)); prog->Id = id; prog->Target = target; prog->Resident = GL_TRUE; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index fa3a63ea4b..b621e892c3 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -241,7 +241,7 @@ alloc_local_temp(slang_emit_info *emitInfo, slang_ir_storage *temp, GLint size) { assert(size >= 1); assert(size <= 4); - _mesa_bzero(temp, sizeof(*temp)); + memset(temp, 0, sizeof(*temp)); temp->Size = size; temp->File = PROGRAM_TEMPORARY; temp->Index = -1; @@ -1136,7 +1136,7 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) * dest for this clamp() is an output reg, we can't use that reg for * the intermediate result. Use a temp register instead. */ - _mesa_bzero(&tmpNode, sizeof(tmpNode)); + memset(&tmpNode, 0, sizeof(tmpNode)); if (!alloc_node_storage(emitInfo, &tmpNode, n->Store->Size)) { return NULL; } diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index a96f2fb4c2..01e2bc4a22 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -419,7 +419,7 @@ slang_type_specifier_compatible(const slang_type_specifier * x, GLboolean slang_typeinfo_construct(slang_typeinfo * ti) { - _mesa_bzero(ti, sizeof(*ti)); + memset(ti, 0, sizeof(*ti)); slang_type_specifier_ctr(&ti->spec); ti->array_len = 0; return GL_TRUE; diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 36c8db2107..3e36cf9a7e 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -259,7 +259,7 @@ depth_test_span16( GLcontext *ctx, GLuint n, } break; case GL_NEVER: - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in depth_test_span16"); @@ -488,7 +488,7 @@ depth_test_span32( GLcontext *ctx, GLuint n, } break; case GL_NEVER: - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in depth_test_span32"); @@ -844,7 +844,7 @@ direct_depth_test_pixels16(GLcontext *ctx, GLushort *zStart, GLuint stride, break; case GL_NEVER: /* depth test never passes */ - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in direct_depth_test_pixels"); @@ -1090,7 +1090,7 @@ direct_depth_test_pixels32(GLcontext *ctx, GLuint *zStart, GLuint stride, break; case GL_NEVER: /* depth test never passes */ - _mesa_bzero(mask, n * sizeof(GLubyte)); + memset(mask, 0, n * sizeof(GLubyte)); break; default: _mesa_problem(ctx, "Bad depth func in direct_depth_test_pixels"); @@ -1260,7 +1260,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb) { /* really only doing this to prevent FP exceptions later */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + memset(depth, 0, n * sizeof(GLfloat)); return; } @@ -1269,7 +1269,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= (GLint) rb->Height || x + n <= 0 || x >= (GLint) rb->Width) { /* span is completely outside framebuffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + memset(depth, 0, n * sizeof(GLfloat)); return; } @@ -1326,7 +1326,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb) { /* really only doing this to prevent FP exceptions later */ - _mesa_bzero(depth, n * sizeof(GLuint)); + memset(depth, 0, n * sizeof(GLuint)); return; } @@ -1337,7 +1337,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= (GLint) rb->Height || x + n <= 0 || x >= (GLint) rb->Width) { /* span is completely outside framebuffer */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + memset(depth, 0, n * sizeof(GLfloat)); return; } diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index d31da4c402..7c1de62e87 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -148,8 +148,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { /* Clear temporary registers (undefined for ARB_f_p) */ - _mesa_bzero(machine->Temporaries, - MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); } /* ARB_fragment_coord_conventions */ diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 7087f25d27..dada364360 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1579,7 +1579,7 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { /* completely above, below, or right */ /* XXX maybe leave rgba values undefined? */ - _mesa_bzero(rgba, 4 * n * sizeof(GLchan)); + memset(rgba, 0, 4 * n * sizeof(GLchan)); } else { GLint skip, length; @@ -1642,7 +1642,7 @@ _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { /* completely above, below, or right */ - _mesa_bzero(index, n * sizeof(GLuint)); + memset(index, 0, n * sizeof(GLuint)); } else { GLint skip, length; -- cgit v1.2.3 From 32f2fd1c5d6088692551c80352b7d6fa35b0cd09 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 19 Feb 2010 11:58:49 -0500 Subject: Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions --- src/egl/drivers/dri/egldri.c | 2 +- src/gallium/state_trackers/glx/xlib/glx_api.c | 18 ++-- src/gallium/state_trackers/glx/xlib/xm_api.c | 14 +-- src/glx/glcontextmodes.c | 35 +------- src/glx/glcontextmodes.h | 2 - src/mesa/drivers/common/meta.c | 34 +++---- src/mesa/drivers/dri/common/dri_util.c | 34 +++---- src/mesa/drivers/dri/common/drirenderbuffer.c | 4 +- src/mesa/drivers/dri/common/utils.c | 12 +-- src/mesa/drivers/dri/fb/fb_dri.c | 12 +-- src/mesa/drivers/dri/i965/brw_curbe.c | 6 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 +- src/mesa/drivers/dri/i965/brw_eu.c | 4 +- src/mesa/drivers/dri/i965/brw_queryobj.c | 4 +- src/mesa/drivers/dri/i965/brw_state_batch.c | 6 +- src/mesa/drivers/dri/i965/brw_state_cache.c | 10 +-- src/mesa/drivers/dri/i965/brw_vtbl.c | 10 +-- src/mesa/drivers/dri/i965/brw_wm.c | 8 +- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 12 +-- src/mesa/drivers/dri/intel/intel_fbo.c | 8 +- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 4 +- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 4 +- src/mesa/drivers/dri/intel/intel_span.c | 2 +- src/mesa/drivers/dri/intel/intel_syncobj.c | 4 +- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 2 +- src/mesa/drivers/dri/r300/r300_shader.c | 4 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 +- src/mesa/drivers/dri/r600/r700_oglprog.c | 2 +- src/mesa/drivers/dri/r600/r700_vertprog.c | 2 +- .../drivers/dri/radeon/radeon_buffer_objects.c | 2 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 4 +- src/mesa/drivers/dri/radeon/radeon_queryobj.c | 4 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 4 +- src/mesa/drivers/dri/savage/savage_xmesa.c | 16 ++-- src/mesa/drivers/dri/savage/savagetex.c | 4 +- src/mesa/drivers/dri/swrast/swrast.c | 24 ++--- src/mesa/drivers/dri/unichrome/via_fb.c | 6 +- src/mesa/drivers/fbdev/glfbdev.c | 22 ++--- src/mesa/drivers/glide/fxdd.c | 4 +- src/mesa/drivers/glide/fxddtex.c | 6 +- src/mesa/drivers/glide/fxsetup.c | 4 +- src/mesa/drivers/glslcompiler/glslcompiler.c | 4 +- src/mesa/drivers/osmesa/osmesa.c | 12 +-- src/mesa/drivers/windows/gdi/mesa.def | 2 - src/mesa/drivers/windows/gdi/wmesa.c | 8 +- src/mesa/drivers/windows/icd/mesa.def | 3 - src/mesa/drivers/x11/fakeglx.c | 18 ++-- src/mesa/drivers/x11/xm_api.c | 26 +++--- src/mesa/drivers/x11/xm_buffer.c | 6 +- src/mesa/es/main/specials_es1.c | 2 +- src/mesa/es/main/specials_es2.c | 2 +- src/mesa/glapi/mesadef.py | 3 - src/mesa/main/arrayobj.c | 2 +- src/mesa/main/attrib.c | 4 +- src/mesa/main/bufferobj.c | 4 +- src/mesa/main/colortab.c | 8 +- src/mesa/main/context.c | 24 ++--- src/mesa/main/cpuinfo.c | 4 +- src/mesa/main/debug.c | 28 +++--- src/mesa/main/depthstencil.c | 4 +- src/mesa/main/dlist.c | 100 ++++++++++----------- src/mesa/main/execmem.c | 4 +- src/mesa/main/extensions.c | 6 +- src/mesa/main/framebuffer.c | 2 +- src/mesa/main/hash.c | 8 +- src/mesa/main/image.c | 8 +- src/mesa/main/imports.c | 39 ++------ src/mesa/main/imports.h | 19 ++-- src/mesa/main/light.c | 4 +- src/mesa/main/mipmap.c | 10 +-- src/mesa/main/mm.c | 16 ++-- src/mesa/main/queryobj.c | 2 +- src/mesa/main/renderbuffer.c | 14 +-- src/mesa/main/shaders.c | 12 +-- src/mesa/main/shared.c | 2 +- src/mesa/main/syncobj.c | 2 +- src/mesa/main/texcompress_fxt1.c | 12 +-- src/mesa/main/texcompress_s3tc.c | 8 +- src/mesa/main/teximage.c | 10 +-- src/mesa/main/texobj.c | 2 +- src/mesa/main/texrender.c | 2 +- src/mesa/main/texstore.c | 62 ++++++------- src/mesa/main/version.c | 2 +- src/mesa/shader/arbprogparse.c | 8 +- src/mesa/shader/atifragshader.c | 16 ++-- src/mesa/shader/hash_table.c | 8 +- src/mesa/shader/nvfragparse.c | 6 +- src/mesa/shader/nvvertparse.c | 10 +-- src/mesa/shader/prog_cache.c | 18 ++-- src/mesa/shader/prog_instruction.c | 8 +- src/mesa/shader/prog_optimize.c | 8 +- src/mesa/shader/prog_parameter.c | 14 +-- src/mesa/shader/prog_print.c | 2 +- src/mesa/shader/prog_statevars.c | 2 +- src/mesa/shader/prog_uniform.c | 6 +- src/mesa/shader/program.c | 16 ++-- src/mesa/shader/program_parse.tab.c | 22 ++--- src/mesa/shader/program_parse.y | 22 ++--- src/mesa/shader/shader_api.c | 24 ++--- src/mesa/shader/slang/slang_codegen.c | 6 +- src/mesa/shader/slang/slang_compile.c | 2 +- src/mesa/shader/slang/slang_compile_variable.c | 2 +- src/mesa/shader/slang/slang_emit.c | 6 +- src/mesa/shader/slang/slang_label.c | 2 +- src/mesa/shader/slang/slang_link.c | 26 +++--- src/mesa/shader/slang/slang_log.c | 4 +- src/mesa/shader/slang/slang_mem.c | 14 +-- src/mesa/shader/slang/slang_utility.c | 2 +- src/mesa/shader/symbol_table.c | 2 +- src/mesa/state_tracker/st_cb_accum.c | 12 +-- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- src/mesa/state_tracker/st_cb_bufferobjects.c | 2 +- src/mesa/state_tracker/st_cb_drawpixels.c | 12 +-- src/mesa/state_tracker/st_cb_fbo.c | 10 +-- src/mesa/state_tracker/st_cb_queryobj.c | 2 +- src/mesa/state_tracker/st_cb_rasterpos.c | 2 +- src/mesa/state_tracker/st_cb_texture.c | 4 +- src/mesa/state_tracker/st_context.c | 4 +- src/mesa/state_tracker/st_context.h | 2 +- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 +- src/mesa/swrast/s_blit.c | 32 +++---- src/mesa/swrast/s_copypix.c | 36 ++++---- src/mesa/swrast/s_drawpix.c | 10 +-- src/mesa/swrast/s_readpix.c | 10 +-- src/mesa/tnl/t_draw.c | 4 +- src/mesa/tnl/t_vb_normals.c | 4 +- src/mesa/tnl/t_vb_points.c | 4 +- src/mesa/tnl/t_vertex.c | 2 +- src/mesa/vbo/vbo_exec_array.c | 4 +- src/mesa/vbo/vbo_rebase.c | 8 +- src/mesa/vbo/vbo_split_copy.c | 14 +-- src/mesa/vf/vf.c | 2 +- 132 files changed, 624 insertions(+), 691 deletions(-) (limited to 'src') diff --git a/src/egl/drivers/dri/egldri.c b/src/egl/drivers/dri/egldri.c index ca6821dad0..6a8bf89985 100644 --- a/src/egl/drivers/dri/egldri.c +++ b/src/egl/drivers/dri/egldri.c @@ -812,7 +812,7 @@ __eglGetDrawableInfo(__DRInativeDisplay * ndpy, int screen, __DRIid drawable, return GL_FALSE; } - cliprect = (drm_clip_rect_t*) _mesa_malloc(sizeof(drm_clip_rect_t)); + cliprect = (drm_clip_rect_t*) malloc(sizeof(drm_clip_rect_t)); cliprect->x1 = drawable->x; cliprect->y1 = drawable->y; cliprect->x2 = drawable->x + drawable->w; diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 9093a0eae9..0932569bd3 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -1018,7 +1018,7 @@ glXChooseVisual( Display *dpy, int screen, int *list ) xmvis = choose_visual(dpy, screen, list, GL_FALSE); if (xmvis) { /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -1055,7 +1055,7 @@ glXCreateContext( Display *dpy, XVisualInfo *visinfo, xmvis = create_glx_visual( dpy, visinfo ); if (!xmvis) { /* unusable visual */ - _mesa_free(glxCtx); + free(glxCtx); return NULL; } } @@ -1063,7 +1063,7 @@ glXCreateContext( Display *dpy, XVisualInfo *visinfo, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -1336,7 +1336,7 @@ glXDestroyContext( Display *dpy, GLXContext ctx ) MakeCurrent_PrevReadBuffer = 0; XMesaDestroyContext( glxCtx->xmesaContext ); XMesaGarbageCollect(); - _mesa_free(glxCtx); + free(glxCtx); } @@ -1755,7 +1755,7 @@ glXGetFBConfigs( Display *dpy, int screen, int *nelements ) visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements); if (*nelements > 0) { XMesaVisual *results; - results = (XMesaVisual *) _mesa_malloc(*nelements * sizeof(XMesaVisual)); + results = (XMesaVisual *) malloc(*nelements * sizeof(XMesaVisual)); if (!results) { *nelements = 0; return NULL; @@ -1782,7 +1782,7 @@ glXChooseFBConfig( Display *dpy, int screen, xmvis = choose_visual(dpy, screen, attribList, GL_TRUE); if (xmvis) { - GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual)); + GLXFBConfig *config = (GLXFBConfig *) malloc(sizeof(XMesaVisual)); if (!config) { *nitems = 0; return NULL; @@ -1807,7 +1807,7 @@ glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) return xmvis->vishandle; #else /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -2112,7 +2112,7 @@ glXCreateNewContext( Display *dpy, GLXFBConfig config, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -2332,7 +2332,7 @@ glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int render_ glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 2e678c8f1e..61af663436 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -175,7 +175,7 @@ bits_per_pixel( XMesaVisual xmv ) /* grab the bits/pixel value */ bitsPerPixel = img->bits_per_pixel; /* free the XImage */ - _mesa_free( img->data ); + free( img->data ); img->data = NULL; XDestroyImage( img ); return bitsPerPixel; @@ -669,13 +669,13 @@ XMesaVisual XMesaCreateVisual( Display *display, v->display = display; - /* Save a copy of the XVisualInfo struct because the user may X_mesa_free() + /* Save a copy of the XVisualInfo struct because the user may Xfree() * the struct but we may need some of the information contained in it * at a later time. */ v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo)); if (!v->visinfo) { - _mesa_free(v); + free(v); return NULL; } memcpy(v->visinfo, visinfo, sizeof(*visinfo)); @@ -743,8 +743,8 @@ XMesaVisual XMesaCreateVisual( Display *display, PUBLIC void XMesaDestroyVisual( XMesaVisual v ) { - _mesa_free(v->visinfo); - _mesa_free(v); + free(v->visinfo); + free(v); } @@ -811,7 +811,7 @@ fail: else if (pipe) pipe->destroy(pipe); - _mesa_free(c); + free(c); return NULL; } @@ -828,7 +828,7 @@ void XMesaDestroyContext( XMesaContext c ) screen->destroy(screen); */ - _mesa_free(c); + free(c); } diff --git a/src/glx/glcontextmodes.c b/src/glx/glcontextmodes.c index 257087a802..eb9037907f 100644 --- a/src/glx/glcontextmodes.c +++ b/src/glx/glcontextmodes.c @@ -31,39 +31,13 @@ * \author Ian Romanick */ -#if defined(IN_MINI_GLX) -#include -#else -#if defined(HAVE_DIX_CONFIG_H) -# include -#endif -#include #include #include "GL/glxint.h" -#endif - -/* Memory macros */ -#if defined(IN_MINI_GLX) -# include -# include -# define _mesa_malloc(b) malloc(b) -# define _mesa_free(m) free(m) -#else -# ifdef XFree86Server -# include -# include -# define _mesa_malloc(b) xalloc(b) -# define _mesa_free(m) xfree(m) -# else -# include -# define _mesa_malloc(b) Xmalloc(b) -# define _mesa_free(m) Xfree(m) -# endif /* XFree86Server */ -#endif /* !defined(IN_MINI_GLX) */ +#include +#include #include "glcontextmodes.h" -#if !defined(IN_MINI_GLX) #define NUM_VISUAL_TYPES 6 /** @@ -352,7 +326,6 @@ _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, return GLX_BAD_ATTRIBUTE; } } -#endif /* !defined(IN_MINI_GLX) */ /** @@ -392,7 +365,7 @@ _gl_context_modes_create(unsigned count, size_t minimum_size) next = &base; for (i = 0; i < count; i++) { - *next = (__GLcontextModes *) _mesa_malloc(size); + *next = (__GLcontextModes *) malloc(size); if (*next == NULL) { _gl_context_modes_destroy(base); base = NULL; @@ -438,7 +411,7 @@ _gl_context_modes_destroy(__GLcontextModes * modes) while (modes != NULL) { __GLcontextModes *const next = modes->next; - _mesa_free(modes); + free(modes); modes = next; } } diff --git a/src/glx/glcontextmodes.h b/src/glx/glcontextmodes.h index 6676ae306c..ecf0280cba 100644 --- a/src/glx/glcontextmodes.h +++ b/src/glx/glcontextmodes.h @@ -32,14 +32,12 @@ #include "GL/internal/glcore.h" -#if !defined(IN_MINI_GLX) extern GLint _gl_convert_from_x_visual_type(int visualType); extern GLint _gl_convert_to_x_visual_type(int visualType); extern void _gl_copy_visual_to_context_mode(__GLcontextModes * mode, const __GLXvisualConfig * config); extern int _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, int *value_return); -#endif /* !defined(IN_MINI_GLX) */ extern __GLcontextModes *_gl_context_modes_create(unsigned count, size_t minimum_size); diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 4dd2293b24..42ab7d4ed6 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -307,7 +307,7 @@ _mesa_meta_free(GLcontext *ctx) * freed by the normal context destruction code. But this would be * the place to free other meta data someday. */ - _mesa_free(ctx->Meta); + free(ctx->Meta); ctx->Meta = NULL; } @@ -1304,7 +1304,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx, } if (mask & GL_DEPTH_BUFFER_BIT) { - GLuint *tmp = (GLuint *) _mesa_malloc(srcW * srcH * sizeof(GLuint)); + GLuint *tmp = (GLuint *) malloc(srcW * srcH * sizeof(GLuint)); if (tmp) { if (!blit->DepthFP) init_blit_depth_pixels(ctx); @@ -1328,7 +1328,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx, _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); mask &= ~GL_DEPTH_BUFFER_BIT; - _mesa_free(tmp); + free(tmp); } } @@ -2065,7 +2065,7 @@ _mesa_meta_Bitmap(GLcontext *ctx, if (!bitmap1) return; - bitmap8 = (GLubyte *) _mesa_calloc(width * height); + bitmap8 = (GLubyte *) calloc(1, width * height); if (bitmap8) { _mesa_expand_bitmap(width, height, &unpackSave, bitmap1, bitmap8, width, 0xff); @@ -2082,7 +2082,7 @@ _mesa_meta_Bitmap(GLcontext *ctx, _mesa_set_enable(ctx, tex->Target, GL_FALSE); - _mesa_free(bitmap8); + free(bitmap8); } _mesa_unmap_pbo_source(ctx, &unpackSave); @@ -2531,7 +2531,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, /* * Alloc image buffer (XXX could use a PBO) */ - buf = _mesa_malloc(width * height * bpp); + buf = malloc(width * height * bpp); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD", dims); return; @@ -2592,7 +2592,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, _mesa_lock_texture(ctx, texObj); /* re-lock */ - _mesa_free(buf); + free(buf); } @@ -2647,7 +2647,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, /* * Alloc image buffer (XXX could use a PBO) */ - buf = _mesa_malloc(width * height * bpp); + buf = malloc(width * height * bpp); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage%uD", dims); return; @@ -2688,7 +2688,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, _mesa_lock_texture(ctx, texObj); /* re-lock */ - _mesa_free(buf); + free(buf); } @@ -2731,7 +2731,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable"); return; @@ -2748,7 +2748,7 @@ _mesa_meta_CopyColorTable(GLcontext *ctx, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } @@ -2758,7 +2758,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable"); return; @@ -2775,7 +2775,7 @@ _mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } @@ -2786,7 +2786,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); return; @@ -2805,7 +2805,7 @@ _mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } @@ -2816,7 +2816,7 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, { GLfloat *buf; - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); return; @@ -2836,5 +2836,5 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, _mesa_meta_end(ctx); - _mesa_free(buf); + free(buf); } diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 58a94b5868..9142dd72f5 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -242,12 +242,12 @@ __driUtilUpdateDrawableInfo(__DRIdrawable *pdp) } if (pdp->pClipRects) { - _mesa_free(pdp->pClipRects); + free(pdp->pClipRects); pdp->pClipRects = NULL; } if (pdp->pBackClipRects) { - _mesa_free(pdp->pBackClipRects); + free(pdp->pBackClipRects); pdp->pBackClipRects = NULL; } @@ -324,7 +324,7 @@ static void driSwapBuffers(__DRIdrawable *dPriv) if (!dPriv->numClipRects) return; - rects = _mesa_malloc(sizeof(*rects) * dPriv->numClipRects); + rects = malloc(sizeof(*rects) * dPriv->numClipRects); if (!rects) return; @@ -337,7 +337,7 @@ static void driSwapBuffers(__DRIdrawable *dPriv) } driReportDamage(dPriv, rects, dPriv->numClipRects); - _mesa_free(rects); + free(rects); } static int driDrawableGetMSC( __DRIscreen *sPriv, __DRIdrawable *dPriv, @@ -430,7 +430,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, */ (void) attrs; - pdp = _mesa_malloc(sizeof *pdp); + pdp = malloc(sizeof *pdp); if (!pdp) { return NULL; } @@ -457,7 +457,7 @@ driCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, if (!(*psp->DriverAPI.CreateBuffer)(psp, pdp, &config->modes, renderType == GLX_PIXMAP_BIT)) { - _mesa_free(pdp); + free(pdp); return NULL; } @@ -510,14 +510,14 @@ static void dri_put_drawable(__DRIdrawable *pdp) psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); if (pdp->pClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { - _mesa_free(pdp->pClipRects); + free(pdp->pClipRects); pdp->pClipRects = NULL; } if (pdp->pBackClipRects && pdp->pClipRects != &pdp->dri2.clipRect) { - _mesa_free(pdp->pBackClipRects); + free(pdp->pBackClipRects); pdp->pBackClipRects = NULL; } - _mesa_free(pdp); + free(pdp); } } @@ -547,7 +547,7 @@ driDestroyContext(__DRIcontext *pcp) { if (pcp) { (*pcp->driScreenPriv->DriverAPI.DestroyContext)(pcp); - _mesa_free(pcp); + free(pcp); } } @@ -577,7 +577,7 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, __DRIcontext *pcp; void * const shareCtx = (shared != NULL) ? shared->driverPrivate : NULL; - pcp = _mesa_malloc(sizeof *pcp); + pcp = malloc(sizeof *pcp); if (!pcp) return NULL; @@ -602,7 +602,7 @@ driCreateNewContext(__DRIscreen *psp, const __DRIconfig *config, pcp->hHWContext = hwContext; if ( !(*psp->DriverAPI.CreateContext)(&config->modes, pcp, shareCtx) ) { - _mesa_free(pcp); + free(pcp); return NULL; } @@ -656,7 +656,7 @@ static void driDestroyScreen(__DRIscreen *psp) (void)drmCloseOnce(psp->fd); } - _mesa_free(psp); + free(psp); } } @@ -718,7 +718,7 @@ driCreateNewScreen(int scrn, static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; - psp = _mesa_calloc(sizeof *psp); + psp = calloc(1, sizeof *psp); if (!psp) return NULL; @@ -763,7 +763,7 @@ driCreateNewScreen(int scrn, *driver_modes = driDriverAPI.InitScreen(psp); if (*driver_modes == NULL) { - _mesa_free(psp); + free(psp); return NULL; } @@ -785,7 +785,7 @@ dri2CreateNewScreen(int scrn, int fd, if (driDriverAPI.InitScreen2 == NULL) return NULL; - psp = _mesa_calloc(sizeof(*psp)); + psp = calloc(1, sizeof(*psp)); if (!psp) return NULL; @@ -807,7 +807,7 @@ dri2CreateNewScreen(int scrn, int fd, psp->DriverAPI = driDriverAPI; *driver_configs = driDriverAPI.InitScreen2(psp); if (*driver_configs == NULL) { - _mesa_free(psp); + free(psp); return NULL; } diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c index fe38f608a9..48a2c66229 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.c +++ b/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -32,7 +32,7 @@ driDeleteRenderbuffer(struct gl_renderbuffer *rb) /* don't free rb->Data Chances are it's a memory mapped region for * the dri drivers. */ - _mesa_free(rb); + free(rb); } @@ -70,7 +70,7 @@ driNewRenderbuffer(gl_format format, GLvoid *addr, assert(cpp > 0); assert(pitch > 0); - drb = _mesa_calloc(sizeof(driRenderbuffer)); + drb = calloc(1, sizeof(driRenderbuffer)); if (drb) { const GLuint name = 0; diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 833f9ad232..8c15cbbf73 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -108,7 +108,7 @@ driGetRendererString( char * buffer, const char * hardware_name, cpu = _mesa_get_cpu_string(); if (cpu) { offset += sprintf(buffer + offset, " %s", cpu); - _mesa_free(cpu); + free(cpu); } return offset; @@ -559,7 +559,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, } num_modes = num_depth_stencil_bits * num_db_modes * num_accum_bits * num_msaa_modes; - configs = _mesa_calloc((num_modes + 1) * sizeof *configs); + configs = calloc(1, (num_modes + 1) * sizeof *configs); if (configs == NULL) return NULL; @@ -568,7 +568,7 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, for ( i = 0 ; i < num_db_modes ; i++ ) { for ( h = 0 ; h < num_msaa_modes; h++ ) { for ( j = 0 ; j < num_accum_bits ; j++ ) { - *c = _mesa_malloc (sizeof **c); + *c = malloc (sizeof **c); modes = &(*c)->modes; c++; @@ -653,7 +653,7 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a, while (b[j] != NULL) j++; - all = _mesa_malloc((i + j + 1) * sizeof *all); + all = malloc((i + j + 1) * sizeof *all); index = 0; for (i = 0; a[i] != NULL; i++) all[index++] = a[i]; @@ -661,8 +661,8 @@ __DRIconfig **driConcatConfigs(__DRIconfig **a, all[index++] = b[j]; all[index++] = NULL; - _mesa_free(a); - _mesa_free(b); + free(a); + free(b); return all; } diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 0675bb9894..ac07e57db1 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -340,7 +340,7 @@ fbCreateContext( const __GLcontextModes *glVisual, assert(driContextPriv); /* Allocate the Fb context */ - fbmesa = (fbContextPtr) _mesa_calloc( sizeof(*fbmesa) ); + fbmesa = (fbContextPtr) calloc(1, sizeof(*fbmesa) ); if ( !fbmesa ) return GL_FALSE; @@ -358,7 +358,7 @@ fbCreateContext( const __GLcontextModes *glVisual, ctx = fbmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions, (void *) fbmesa); if (!fbmesa->glCtx) { - _mesa_free(fbmesa); + free(fbmesa); return GL_FALSE; } driContextPriv->driverPrivate = fbmesa; @@ -406,7 +406,7 @@ fbDestroyContext( __DRIcontext *driContextPriv ) fbmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context( fbmesa->glCtx ); - _mesa_free( fbmesa ); + free( fbmesa ); } } @@ -449,7 +449,7 @@ fbCreateBuffer( __DRIscreen *driScrnPriv, } if (mesaVis->doubleBufferMode) { /* XXX what are the correct origin/stride values? */ - GLvoid *backBuf = _mesa_malloc(driScrnPriv->fbStride + GLvoid *backBuf = malloc(driScrnPriv->fbStride * driScrnPriv->fbHeight); driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, backBuf, @@ -503,7 +503,7 @@ fbSwapBuffers( __DRIdrawable *dPriv ) if (ctx->Visual.doubleBufferMode) { int i; int offset = 0; - char *tmp = _mesa_malloc(currentPitch); + char *tmp = malloc(currentPitch); _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ @@ -516,7 +516,7 @@ fbSwapBuffers( __DRIdrawable *dPriv ) offset += currentPitch; } - _mesa_free(tmp); + free(tmp); } } else { diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 6cb8edb611..cb9cd836a0 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -199,7 +199,7 @@ static void prepare_constant_buffer(struct brw_context *brw) return; } - buf = (GLfloat *) _mesa_calloc(bufsz); + buf = (GLfloat *) calloc(1, bufsz); /* fragment shader constants */ if (brw->curbe.wm_size) { @@ -294,12 +294,12 @@ static void prepare_constant_buffer(struct brw_context *brw) bufsz == brw->curbe.last_bufsz && memcmp(buf, brw->curbe.last_buf, bufsz) == 0) { /* constants have not changed */ - _mesa_free(buf); + free(buf); } else { /* constants have changed */ if (brw->curbe.last_buf) - _mesa_free(brw->curbe.last_buf); + free(brw->curbe.last_buf); brw->curbe.last_buf = buf; brw->curbe.last_bufsz = bufsz; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index c46b9ba89c..ceaeb923b0 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -320,7 +320,7 @@ copy_array_to_vbo_array( struct brw_context *brw, } else { void *data; - data = _mesa_malloc(dst_stride * element->count); + data = malloc(dst_stride * element->count); dest = data; for (i = 0; i < element->count; i++) { memcpy(dest, src, dst_stride); @@ -333,7 +333,7 @@ copy_array_to_vbo_array( struct brw_context *brw, size, data); - _mesa_free(data); + free(data); } } } diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c index 1df561386e..4e7c1226ad 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.c +++ b/src/mesa/drivers/dri/i965/brw_eu.c @@ -237,7 +237,7 @@ brw_resolve_cals(struct brw_compile *c) struct brw_glsl_call *call, *next; for (call = c->first_call; call; call = next) { next = call->next; - _mesa_free(call); + free(call); } c->first_call = NULL; } @@ -247,7 +247,7 @@ brw_resolve_cals(struct brw_compile *c) struct brw_glsl_label *label, *next; for (label = c->first_label; label; label = next) { next = label->next; - _mesa_free(label); + free(label); } c->first_label = NULL; } diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index 5399a74244..6cce7e5089 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -73,7 +73,7 @@ brw_new_query_object(GLcontext *ctx, GLuint id) { struct brw_query_object *query; - query = _mesa_calloc(sizeof(struct brw_query_object)); + query = calloc(1, sizeof(struct brw_query_object)); query->Base.Id = id; query->Base.Result = 0; @@ -89,7 +89,7 @@ brw_delete_query(GLcontext *ctx, struct gl_query_object *q) struct brw_query_object *query = (struct brw_query_object *)q; dri_bo_unreference(query->bo); - _mesa_free(query); + free(query); } static void diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index ed8120d617..39019412fd 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -57,8 +57,8 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, if (item->sz == sz && memcmp(item->header, newheader, sz) == 0) return GL_FALSE; if (item->sz != sz) { - _mesa_free(item->header); - item->header = _mesa_malloc(sz); + free(item->header); + item->header = malloc(sz); item->sz = sz; } goto emit; @@ -68,7 +68,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, assert(!item); item = CALLOC_STRUCT(brw_cached_batch_item); - item->header = _mesa_malloc(sz); + item->header = malloc(sz); item->sz = sz; item->next = brw->cached_batch_items; brw->cached_batch_items = item; diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index 1369d97e21..dd9894d681 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -150,7 +150,7 @@ rehash(struct brw_cache *cache) GLuint size, i; size = cache->size * 3; - items = (struct brw_cache_item**) _mesa_calloc(size * sizeof(*items)); + items = (struct brw_cache_item**) calloc(1, size * sizeof(*items)); for (i = 0; i < cache->size; i++) for (c = cache->items[i]; c; c = next) { @@ -237,7 +237,7 @@ brw_upload_cache_with_auxdata(struct brw_cache *cache, /* Set up the memory containing the key, aux_data, and reloc_bufs */ - tmp = _mesa_malloc(key_size + aux_size + relocs_size); + tmp = malloc(key_size + aux_size + relocs_size); memcpy(tmp, key, key_size); memcpy(tmp + key_size, aux, aux_size); @@ -366,7 +366,7 @@ brw_init_non_surface_cache(struct brw_context *brw) cache->size = 7; cache->n_items = 0; cache->items = (struct brw_cache_item **) - _mesa_calloc(cache->size * sizeof(struct brw_cache_item)); + calloc(1, cache->size * sizeof(struct brw_cache_item)); brw_init_cache_id(cache, "CC_VP", BRW_CC_VP); brw_init_cache_id(cache, "CC_UNIT", BRW_CC_UNIT); @@ -403,7 +403,7 @@ brw_init_surface_cache(struct brw_context *brw) cache->size = 7; cache->n_items = 0; cache->items = (struct brw_cache_item **) - _mesa_calloc(cache->size * sizeof(struct brw_cache_item)); + calloc(1, cache->size * sizeof(struct brw_cache_item)); brw_init_cache_id(cache, "SS_SURFACE", BRW_SS_SURFACE); brw_init_cache_id(cache, "SS_SURF_BIND", BRW_SS_SURF_BIND); @@ -444,7 +444,7 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache) cache->n_items = 0; if (brw->curbe.last_buf) { - _mesa_free(brw->curbe.last_buf); + free(brw->curbe.last_buf); brw->curbe.last_buf = NULL; } diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 681319dedf..0b0be02dd2 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -67,11 +67,11 @@ static void brw_destroy_context( struct intel_context *intel ) brw_draw_destroy( brw ); brw_clear_validated_bos(brw); if (brw->wm.compile_data) { - _mesa_free(brw->wm.compile_data->instruction); - _mesa_free(brw->wm.compile_data->vreg); - _mesa_free(brw->wm.compile_data->refs); - _mesa_free(brw->wm.compile_data->prog_instructions); - _mesa_free(brw->wm.compile_data); + free(brw->wm.compile_data->instruction); + free(brw->wm.compile_data->vreg); + free(brw->wm.compile_data->refs); + free(brw->wm.compile_data->prog_instructions); + free(brw->wm.compile_data); } for (i = 0; i < brw->state.nr_color_regions; i++) diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 9191c81755..991e1b964b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -151,11 +151,11 @@ static void do_wm_prog( struct brw_context *brw, */ return; } - c->instruction = _mesa_calloc(BRW_WM_MAX_INSN * sizeof(*c->instruction)); - c->prog_instructions = _mesa_calloc(BRW_WM_MAX_INSN * + c->instruction = calloc(1, BRW_WM_MAX_INSN * sizeof(*c->instruction)); + c->prog_instructions = calloc(1, BRW_WM_MAX_INSN * sizeof(*c->prog_instructions)); - c->vreg = _mesa_calloc(BRW_WM_MAX_VREG * sizeof(*c->vreg)); - c->refs = _mesa_calloc(BRW_WM_MAX_REF * sizeof(*c->refs)); + c->vreg = calloc(1, BRW_WM_MAX_VREG * sizeof(*c->vreg)); + c->refs = calloc(1, BRW_WM_MAX_REF * sizeof(*c->refs)); } else { void *instruction = c->instruction; void *prog_instructions = c->prog_instructions; diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 3b7015b5ad..312866d865 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -113,7 +113,7 @@ intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj) if (obj->Pointer) intel_bufferobj_unmap(ctx, 0, obj); - _mesa_free(intel_obj->sys_buffer); + free(intel_obj->sys_buffer); if (intel_obj->region) { intel_bufferobj_release_region(intel, intel_obj); } @@ -121,7 +121,7 @@ intel_bufferobj_free(GLcontext * ctx, struct gl_buffer_object *obj) dri_bo_unreference(intel_obj->buffer); } - _mesa_free(intel_obj); + free(intel_obj); } @@ -155,7 +155,7 @@ intel_bufferobj_data(GLcontext * ctx, dri_bo_unreference(intel_obj->buffer); intel_obj->buffer = NULL; } - _mesa_free(intel_obj->sys_buffer); + free(intel_obj->sys_buffer); intel_obj->sys_buffer = NULL; if (size != 0) { @@ -164,7 +164,7 @@ intel_bufferobj_data(GLcontext * ctx, * with their contents anyway. */ if (target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER) { - intel_obj->sys_buffer = _mesa_malloc(size); + intel_obj->sys_buffer = malloc(size); if (intel_obj->sys_buffer != NULL) { if (data != NULL) memcpy(intel_obj->sys_buffer, data, size); @@ -373,7 +373,7 @@ intel_bufferobj_map_range(GLcontext * ctx, if ((access & GL_MAP_INVALIDATE_RANGE_BIT) && drm_intel_bo_busy(intel_obj->buffer)) { if (access & GL_MAP_FLUSH_EXPLICIT_BIT) { - intel_obj->range_map_buffer = _mesa_malloc(length); + intel_obj->range_map_buffer = malloc(length); obj->Pointer = intel_obj->range_map_buffer; } else { intel_obj->range_map_bo = drm_intel_bo_alloc(intel->bufmgr, @@ -523,7 +523,7 @@ intel_bufferobj_buffer(struct intel_context *intel, intel_obj->Base.Size, sys_buffer, &intel_obj->Base); - _mesa_free(sys_buffer); + free(sys_buffer); intel_obj->sys_buffer = NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index d58ffd95fa..40b867971d 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -71,13 +71,13 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb) ASSERT(irb); if (irb->span_cache != NULL) - _mesa_free(irb->span_cache); + free(irb->span_cache); if (intel && irb->region) { intel_region_release(&irb->region); } - _mesa_free(irb); + free(irb); } @@ -316,7 +316,7 @@ intel_create_renderbuffer(gl_format format) default: _mesa_problem(NULL, "Unexpected intFormat in intel_create_renderbuffer"); - _mesa_free(irb); + free(irb); return NULL; } @@ -468,7 +468,7 @@ intel_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage) irb->Base.ClassID = INTEL_RB_CLASS; if (!intel_update_wrapper(ctx, irb, texImage)) { - _mesa_free(irb); + free(irb); return NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index eabfbf4af9..54998a63f6 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -395,7 +395,7 @@ intel_texture_bitmap(GLcontext * ctx, } /* Convert the A1 bitmap to an A8 format suitable for glTexImage */ - a8_bitmap = _mesa_calloc(width * height); + a8_bitmap = calloc(1, width * height); _mesa_expand_bitmap(width, height, unpack, bitmap, a8_bitmap, width, 0xff); if (_mesa_is_bufferobj(unpack->BufferObj)) { @@ -430,7 +430,7 @@ intel_texture_bitmap(GLcontext * ctx, _mesa_PixelStorei(GL_UNPACK_ALIGNMENT, 1); _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, a8_bitmap); - _mesa_free(a8_bitmap); + free(a8_bitmap); meta_set_fragment_program(&intel->meta, &intel->meta.bitmap_fp, fp); _mesa_ProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 10177228bd..bd1dd13fb7 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -147,7 +147,7 @@ intel_stencil_drawpixels(GLcontext * ctx, /* Unpack the supplied stencil values into a ubyte buffer. */ assert(sizeof(GLstencil) == sizeof(GLubyte)); - stencil_pixels = _mesa_malloc(width * height * sizeof(GLstencil)); + stencil_pixels = malloc(width * height * sizeof(GLstencil)); for (row = 0; row < height; row++) { GLvoid *source = _mesa_image_address2d(unpack, pixels, width, height, @@ -201,7 +201,7 @@ intel_stencil_drawpixels(GLcontext * ctx, _mesa_TexImage2D(GL_TEXTURE_2D, 0, GL_INTENSITY, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, stencil_pixels); ctx->Unpack = old_unpack; - _mesa_free(stencil_pixels); + free(stencil_pixels); meta_set_passthrough_transform(&intel->meta); diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 97bb97265f..0072bb15fc 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -49,7 +49,7 @@ static void get_span_cache(struct intel_renderbuffer *irb, uint32_t offset) { if (irb->span_cache == NULL) { - irb->span_cache = _mesa_malloc(SPAN_CACHE_SIZE); + irb->span_cache = malloc(SPAN_CACHE_SIZE); irb->span_cache_offset = -1; } diff --git a/src/mesa/drivers/dri/intel/intel_syncobj.c b/src/mesa/drivers/dri/intel/intel_syncobj.c index 0d7889d3c2..d67f0cb4a6 100644 --- a/src/mesa/drivers/dri/intel/intel_syncobj.c +++ b/src/mesa/drivers/dri/intel/intel_syncobj.c @@ -50,7 +50,7 @@ intel_new_sync_object(GLcontext *ctx, GLuint id) { struct intel_sync_object *sync; - sync = _mesa_calloc(sizeof(struct intel_sync_object)); + sync = calloc(1, sizeof(struct intel_sync_object)); return &sync->Base; } @@ -61,7 +61,7 @@ intel_delete_sync_object(GLcontext *ctx, struct gl_sync_object *s) struct intel_sync_object *sync = (struct intel_sync_object *)s; drm_intel_bo_unreference(sync->bo); - _mesa_free(sync); + free(sync); } static void diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index acc66e0ae0..a5810ee500 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -277,7 +277,7 @@ struct r300_fragment_program *r300SelectAndTranslateFragmentShader(GLcontext *ct fp = fp->next; } - fp = _mesa_calloc(sizeof(struct r300_fragment_program)); + fp = calloc(1, sizeof(struct r300_fragment_program)); fp->state = state; diff --git a/src/mesa/drivers/dri/r300/r300_shader.c b/src/mesa/drivers/dri/r300/r300_shader.c index 3638010e48..9c24166ec5 100644 --- a/src/mesa/drivers/dri/r300/r300_shader.c +++ b/src/mesa/drivers/dri/r300/r300_shader.c @@ -39,7 +39,7 @@ static void freeFragProgCache(GLcontext *ctx, struct r300_fragment_program_cont while (fp) { tmp = fp->next; rc_constants_destroy(&fp->code.constants); - _mesa_free(fp); + free(fp); fp = tmp; } } @@ -52,7 +52,7 @@ static void freeVertProgCache(GLcontext *ctx, struct r300_vertex_program_cont *c tmp = vp->next; rc_constants_destroy(&vp->code.constants); _mesa_reference_vertprog(ctx, &vp->Base, NULL); - _mesa_free(vp); + free(vp); vp = tmp; } } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index a74b7001dd..6a366b438b 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -233,7 +233,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, struct r300_vertex_program *vp; struct r300_vertex_program_compiler compiler; - vp = _mesa_calloc(sizeof(*vp)); + vp = calloc(1, sizeof(*vp)); vp->Base = _mesa_clone_vertex_program(ctx, mesa_vp); memcpy(&vp->key, wanted_key, sizeof(vp->key)); diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index 2a50361199..b7124e644a 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -53,7 +53,7 @@ static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *c Clean_Up_Shader(&(vp->r700Shader)); _mesa_reference_vertprog(ctx, &vp->mesa_program, NULL); - _mesa_free(vp); + free(vp); vp = tmp; } } diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 46481cdff4..07e0adc890 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -307,7 +307,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, struct r700_vertex_program *vp; unsigned int i; - vp = _mesa_calloc(sizeof(*vp)); + vp = calloc(1, sizeof(*vp)); vp->mesa_program = _mesa_clone_vertex_program(ctx, mesa_vp); if (mesa_vp->IsPositionInvariant) diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c index bc5915d3e4..0897dafbd8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c +++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c @@ -70,7 +70,7 @@ radeonDeleteBufferObject(GLcontext * ctx, radeon_bo_unref(radeon_obj->bo); } - _mesa_free(radeon_obj); + free(radeon_obj); } diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 56dcc50785..a8931e8478 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -66,7 +66,7 @@ radeon_delete_renderbuffer(struct gl_renderbuffer *rb) if (rrb && rrb->bo) { radeon_bo_unref(rrb->bo); } - _mesa_free(rrb); + free(rrb); } static void * @@ -511,7 +511,7 @@ radeon_wrap_texture(GLcontext * ctx, struct gl_texture_image *texImage) rrb->base.ClassID = RADEON_RB_CLASS; if (!radeon_update_wrapper(ctx, rrb, texImage)) { - _mesa_free(rrb); + free(rrb); return NULL; } diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c index d0dcf0e431..04ce12493e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c +++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c @@ -81,7 +81,7 @@ static struct gl_query_object * radeonNewQueryObject(GLcontext *ctx, GLuint id) { struct radeon_query_object *query; - query = _mesa_calloc(sizeof(struct radeon_query_object)); + query = calloc(1, sizeof(struct radeon_query_object)); query->Base.Id = id; query->Base.Result = 0; @@ -103,7 +103,7 @@ static void radeonDeleteQuery(GLcontext *ctx, struct gl_query_object *q) radeon_bo_unref(query->bo); } - _mesa_free(query); + free(query); } static void radeonWaitQuery(GLcontext *ctx, struct gl_query_object *q) diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 9b9d90bdd0..ff37fd3e86 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -637,7 +637,7 @@ static GLuint * allocate_image_offsets(GLcontext *ctx, int i; GLuint *offsets; - offsets = _mesa_malloc(depth * sizeof(GLuint)) ; + offsets = malloc(depth * sizeof(GLuint)) ; if (!offsets) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTex[Sub]Image"); return NULL; @@ -736,7 +736,7 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, } if (dims == 3) { - _mesa_free(dstImageOffsets); + free(dstImageOffsets); } radeon_teximage_unmap(image); diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 74a001b789..6f07ac275e 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -179,7 +179,7 @@ savageInitDriver(__DRIscreen *sPriv) } /* Allocate the private area */ - savageScreen = (savageScreenPrivate *)_mesa_malloc(sizeof(savageScreenPrivate)); + savageScreen = (savageScreenPrivate *)malloc(sizeof(savageScreenPrivate)); if (!savageScreen) return GL_FALSE; @@ -226,7 +226,7 @@ savageInitDriver(__DRIscreen *sPriv) savageScreen->agpTextures.handle, savageScreen->agpTextures.size, (drmAddress *)&(savageScreen->agpTextures.map)) != 0) { - _mesa_free(savageScreen); + free(savageScreen); sPriv->private = NULL; return GL_FALSE; } @@ -246,7 +246,7 @@ savageInitDriver(__DRIscreen *sPriv) savageScreen->aperture.size, (drmAddress *)&savageScreen->aperture.map) != 0) { - _mesa_free(savageScreen); + free(savageScreen); sPriv->private = NULL; return GL_FALSE; } @@ -282,7 +282,7 @@ savageDestroyScreen(__DRIscreen *sPriv) /* free all option information */ driDestroyOptionInfo (&savageScreen->optionCache); - _mesa_free(savageScreen); + free(savageScreen); sPriv->private = NULL; } @@ -300,7 +300,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, savageScreen->sarea_priv_offset); int textureSize[SAVAGE_NR_TEX_HEAPS]; int i; - imesa = (savageContextPtr)_mesa_calloc(sizeof(savageContext)); + imesa = (savageContextPtr)calloc(1, sizeof(savageContext)); if (!imesa) { return GL_FALSE; } @@ -317,7 +317,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, shareCtx = NULL; ctx = _mesa_create_context(mesaVis, shareCtx, &functions, imesa); if (!ctx) { - _mesa_free(imesa); + free(imesa); return GL_FALSE; } driContextPriv->driverPrivate = imesa; @@ -436,7 +436,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, if (ctx->Const.MaxTextureLevels <= 6) { /*spec requires at least 64x64*/ __driUtilMessage("Not enough texture memory. " "Falling back to indirect rendering."); - _mesa_free(imesa); + free(imesa); return GL_FALSE; } @@ -574,7 +574,7 @@ savageDestroyContext(__DRIcontext *driContextPriv) _mesa_destroy_context(imesa->glCtx); /* no longer use vertex_dma_buf*/ - _mesa_free(imesa); + free(imesa); } } diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 394be44eac..1a748ee126 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -603,7 +603,7 @@ _savage_texstore_a1114444(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } @@ -643,7 +643,7 @@ _savage_texstore_a1118888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 40535b03b9..b2e7df34e8 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -155,7 +155,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, TRACE; - psp = _mesa_calloc(sizeof(*psp)); + psp = calloc(1, sizeof(*psp)); if (!psp) return NULL; @@ -184,7 +184,7 @@ static void driDestroyScreen(__DRIscreen *psp) TRACE; if (psp) { - _mesa_free(psp); + free(psp); } } @@ -241,8 +241,8 @@ swrast_delete_renderbuffer(struct gl_renderbuffer *rb) { TRACE; - _mesa_free(rb->Data); - _mesa_free(rb); + free(rb->Data); + free(rb); } static GLboolean @@ -272,11 +272,11 @@ swrast_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, TRACE; - _mesa_free(rb->Data); + free(rb->Data); swrast_alloc_front_storage(ctx, rb, internalFormat, width, height); - rb->Data = _mesa_malloc(height * xrb->pitch); + rb->Data = malloc(height * xrb->pitch); return GL_TRUE; } @@ -284,7 +284,7 @@ swrast_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb, static struct swrast_renderbuffer * swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) { - struct swrast_renderbuffer *xrb = _mesa_calloc(sizeof *xrb); + struct swrast_renderbuffer *xrb = calloc(1, sizeof *xrb); GLuint pixel_format; TRACE; @@ -358,7 +358,7 @@ driCreateNewDrawable(__DRIscreen *screen, TRACE; - buf = _mesa_calloc(sizeof *buf); + buf = calloc(1, sizeof *buf); if (!buf) return NULL; @@ -366,7 +366,7 @@ driCreateNewDrawable(__DRIscreen *screen, buf->driScreenPriv = screen; - buf->row = _mesa_malloc(MAX_WIDTH * 4); + buf->row = malloc(MAX_WIDTH * 4); /* basic framebuffer setup */ _mesa_initialize_window_framebuffer(&buf->Base, &config->modes); @@ -401,7 +401,7 @@ driDestroyDrawable(__DRIdrawable *buf) if (buf) { struct gl_framebuffer *fb = &buf->Base; - _mesa_free(buf->row); + free(buf->row); fb->DeletePending = GL_TRUE; _mesa_reference_framebuffer(&fb, NULL); @@ -525,7 +525,7 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, TRACE; - ctx = _mesa_calloc(sizeof *ctx); + ctx = calloc(1, sizeof *ctx); if (!ctx) return NULL; @@ -540,7 +540,7 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, if (!_mesa_initialize_context(&ctx->Base, &config->modes, shared ? &shared->Base : NULL, &functions, (void *) ctx)) { - _mesa_free(ctx); + free(ctx); return NULL; } diff --git a/src/mesa/drivers/dri/unichrome/via_fb.c b/src/mesa/drivers/dri/unichrome/via_fb.c index e4fb29f6c6..bebf0619d0 100644 --- a/src/mesa/drivers/dri/unichrome/via_fb.c +++ b/src/mesa/drivers/dri/unichrome/via_fb.c @@ -156,7 +156,7 @@ via_alloc_texture(struct via_context *vmesa, } else if (t->memType == VIA_MEM_SYSTEM) { - t->bufAddr = _mesa_malloc(t->size); + t->bufAddr = malloc(t->size); if (!t->bufAddr) goto cleanup; @@ -226,8 +226,8 @@ via_free_texture(struct via_context *vmesa, struct via_tex_buffer *t) else if (t->memType == VIA_MEM_SYSTEM) { remove_from_list(t); vmesa->total_alloc[t->memType] -= t->size; - _mesa_free(t->bufAddr); - _mesa_free(t); + free(t->bufAddr); + free(t); } else if (t->index && viaCheckBreadcrumb(vmesa, t->lastUsed)) { via_do_free_texture( vmesa, t ); diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 49002512aa..4e369ceac4 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -392,7 +392,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, break; default: /* unexpected token */ - _mesa_free(vis); + free(vis); return NULL; } } @@ -431,7 +431,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, } else { _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); - _mesa_free(vis); + free(vis); return NULL; } } @@ -445,7 +445,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, } else { _mesa_problem(NULL, "Unsupported fbdev CI visual/bitdepth!\n"); - _mesa_free(vis); + free(vis); return NULL; } } @@ -457,7 +457,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, accumBlueBits, accumAlphaBits, numSamples)) { /* something was invalid */ - _mesa_free(vis); + free(vis); return NULL; } @@ -469,7 +469,7 @@ void glFBDevDestroyVisual( GLFBDevVisualPtr visual ) { if (visual) - _mesa_free(visual); + free(visual); } @@ -488,9 +488,9 @@ delete_renderbuffer(struct gl_renderbuffer *rb) { struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; if (frb->mallocedBuffer) { - _mesa_free(frb->Base.Data); + free(frb->Base.Data); } - _mesa_free(frb); + free(frb); } @@ -636,10 +636,10 @@ glFBDevCreateBuffer( const struct fb_fix_screeninfo *fixInfo, const int malloced = !backBuffer; if (malloced) { /* malloc a back buffer */ - backBuffer = _mesa_malloc(size); + backBuffer = malloc(size); if (!backBuffer) { _mesa_free_framebuffer_data(&buf->glframebuffer); - _mesa_free(buf); + free(buf); return NULL; } } @@ -769,7 +769,7 @@ glFBDevCreateContext( const GLFBDevVisualPtr visual, GLFBDevContextPtr share ) if (!_mesa_initialize_context(&ctx->glcontext, &visual->glvisual, share ? &share->glcontext : NULL, &functions, (void *) ctx)) { - _mesa_free(ctx); + free(ctx); return NULL; } @@ -818,7 +818,7 @@ glFBDevDestroyContext( GLFBDevContextPtr context ) _mesa_make_current(NULL, NULL, NULL); } _mesa_free_context_data(&context->glcontext); - _mesa_free(context); + free(context); } } diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index d94bf08a88..b78b101240 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1628,7 +1628,7 @@ fxDDGetString(GLcontext * ctx, GLenum name) if (ctx->Extensions.String == NULL) { GLubyte *ext = _mesa_make_extension_string(ctx); if (ext != NULL) { - ctx->Extensions.String = _mesa_malloc(strlen((char *)ext) + 256); + ctx->Extensions.String = malloc(strlen((char *)ext) + 256); if (ctx->Extensions.String != NULL) { strcpy((char *)ctx->Extensions.String, (char *)ext); /* put any additional extension names here */ @@ -1641,7 +1641,7 @@ fxDDGetString(GLcontext * ctx, GLenum name) strcat((char *)ctx->Extensions.String, " WGL_EXT_extensions_string WGL_ARB_extensions_string"); #endif /* put any additional extension names here */ - _mesa_free(ext); + free(ext); } else { ctx->Extensions.String = ext; } diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index a87a28ac3e..b35874fffc 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1397,10 +1397,10 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, mml->width, mml->height, 1); dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); - texImage->Data = _mesa_malloc(texImage->CompressedSize); + texImage->Data = malloc(texImage->CompressedSize); } else { dstRowStride = mml->width * texelBytes; - texImage->Data = _mesa_malloc(mml->width * mml->height * texelBytes); + texImage->Data = malloc(mml->width * mml->height * texelBytes); } if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); @@ -1654,7 +1654,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat, mml->width, mml->height, 1); - texImage->Data = _mesa_malloc(texImage->CompressedSize); + texImage->Data = malloc(texImage->CompressedSize); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); return; diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 9bf37967cd..9bb352fcb8 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -107,14 +107,14 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) &(mml->wScale), &(mml->hScale)); _w *= mml->wScale; _h *= mml->hScale; - texImage->Data = _mesa_malloc(_w * _h * texelBytes); + texImage->Data = malloc(_w * _h * texelBytes); _mesa_rescale_teximage2d(texelBytes, mml->width, _w * texelBytes, /* dst stride */ mml->width, mml->height, /* src */ _w, _h, /* dst */ texImage_Data /*src*/, texImage->Data /*dst*/ ); - _mesa_free(texImage_Data); + free(texImage_Data); mml->width = _w; mml->height = _h; /* (!) ... and set mml->wScale = _w / texImage->Width */ diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index e4527abdec..448029dace 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -119,7 +119,7 @@ CreateContext(void) 0, 0, 0, 0, 1); /* accum */ buf = _mesa_create_framebuffer(vis); - cc = _mesa_calloc(sizeof(*cc)); + cc = calloc(1, sizeof(*cc)); if (!vis || !buf || !cc) { if (vis) _mesa_destroy_visual(vis); @@ -143,7 +143,7 @@ CreateContext(void) !_swsetup_CreateContext( ctx )) { _mesa_destroy_visual(vis); _mesa_free_context_data(ctx); - _mesa_free(cc); + free(cc); return GL_FALSE; } TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 1c469b15bf..f9672d888e 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -818,7 +818,7 @@ compute_row_addresses( OSMesaContext osmesa ) static void osmesa_delete_renderbuffer(struct gl_renderbuffer *rb) { - _mesa_free(rb); + free(rb); } @@ -1189,7 +1189,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, 1 /* num samples */ ); if (!osmesa->gl_visual) { - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1206,7 +1206,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, : (GLcontext *) NULL, &functions, (void *) osmesa)) { _mesa_destroy_visual( osmesa->gl_visual ); - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1221,7 +1221,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, if (!osmesa->gl_buffer) { _mesa_destroy_visual( osmesa->gl_visual ); _mesa_free_context_data( &osmesa->mesa ); - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1260,7 +1260,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, !_swsetup_CreateContext( ctx )) { _mesa_destroy_visual(osmesa->gl_visual); _mesa_free_context_data(ctx); - _mesa_free(osmesa); + free(osmesa); return NULL; } @@ -1305,7 +1305,7 @@ OSMesaDestroyContext( OSMesaContext osmesa ) _mesa_reference_framebuffer( &osmesa->gl_buffer, NULL ); _mesa_free_context_data( &osmesa->mesa ); - _mesa_free( osmesa ); + free( osmesa ); } } diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index d7d6cfa4e2..baa592f136 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -868,7 +868,6 @@ EXPORTS _mesa_add_soft_renderbuffers _mesa_add_renderbuffer _mesa_bzero - _mesa_calloc _mesa_check_conditional_render _mesa_choose_tex_format _mesa_create_framebuffer @@ -887,7 +886,6 @@ EXPORTS _mesa_error _mesa_finish_render_texture _mesa_framebuffer_renderbuffer - _mesa_free _mesa_free_context_data _mesa_free_texture_image_data _mesa_generate_mipmap diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index b24b758cfb..2fdcb387be 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -1245,7 +1245,7 @@ static void read_rgba_pixels_16(const GLcontext *ctx, static void wmesa_delete_renderbuffer(struct gl_renderbuffer *rb) { - _mesa_free(rb); + free(rb); } @@ -1474,7 +1474,7 @@ WMesaContext WMesaCreateContext(HDC hDC, 1); /* num samples */ if (!visual) { - _mesa_free(c); + free(c); return NULL; } @@ -1512,7 +1512,7 @@ WMesaContext WMesaCreateContext(HDC hDC, !_tnl_CreateContext(ctx) || !_swsetup_CreateContext(ctx)) { _mesa_free_context_data(ctx); - _mesa_free(c); + free(c); return NULL; } _swsetup_Wakeup(ctx); @@ -1557,7 +1557,7 @@ void WMesaDestroyContext( WMesaContext pwc ) _swrast_DestroyContext(ctx); _mesa_free_context_data(ctx); - _mesa_free(pwc); + free(pwc); } diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index f6bd2aa68b..6f33d170ff 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -32,8 +32,6 @@ EXPORTS _mesa_buffer_data _mesa_buffer_map _mesa_buffer_subdata - _mesa_bzero - _mesa_calloc _mesa_choose_tex_format _mesa_compressed_texture_size _mesa_create_framebuffer @@ -47,7 +45,6 @@ EXPORTS _mesa_enable_1_5_extensions _mesa_enable_sw_extensions _mesa_error - _mesa_free _mesa_free_context_data _mesa_get_current_context _mesa_init_default_imports diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 291e90c822..f097d93a71 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1381,7 +1381,7 @@ Fake_glXChooseVisual( Display *dpy, int screen, int *list ) return xmvis->vishandle; #else /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -1438,7 +1438,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, xmvis = create_glx_visual( dpy, visinfo ); if (!xmvis) { /* unusable visual */ - _mesa_free(glxCtx); + free(glxCtx); return NULL; } } @@ -1446,7 +1446,7 @@ Fake_glXCreateContext( Display *dpy, XVisualInfo *visinfo, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -1671,7 +1671,7 @@ Fake_glXDestroyContext( Display *dpy, GLXContext ctx ) MakeCurrent_PrevReadBuffer = 0; XMesaDestroyContext( glxCtx->xmesaContext ); XMesaGarbageCollect(); - _mesa_free(glxCtx); + free(glxCtx); } @@ -2108,7 +2108,7 @@ Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements ) visuals = XGetVisualInfo(dpy, visMask, &visTemplate, nelements); if (*nelements > 0) { XMesaVisual *results; - results = (XMesaVisual *) _mesa_malloc(*nelements * sizeof(XMesaVisual)); + results = (XMesaVisual *) malloc(*nelements * sizeof(XMesaVisual)); if (!results) { *nelements = 0; return NULL; @@ -2135,7 +2135,7 @@ Fake_glXChooseFBConfig( Display *dpy, int screen, xmvis = choose_visual(dpy, screen, attribList, GL_TRUE); if (xmvis) { - GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual)); + GLXFBConfig *config = (GLXFBConfig *) malloc(sizeof(XMesaVisual)); if (!config) { *nitems = 0; return NULL; @@ -2160,7 +2160,7 @@ Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config ) return xmvis->vishandle; #else /* create a new vishandle - the cached one may be stale */ - xmvis->vishandle = (XVisualInfo *) _mesa_malloc(sizeof(XVisualInfo)); + xmvis->vishandle = (XVisualInfo *) malloc(sizeof(XVisualInfo)); if (xmvis->vishandle) { memcpy(xmvis->vishandle, xmvis->visinfo, sizeof(XVisualInfo)); } @@ -2469,7 +2469,7 @@ Fake_glXCreateNewContext( Display *dpy, GLXFBConfig config, glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } @@ -2687,7 +2687,7 @@ Fake_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config, int re glxCtx->xmesaContext = XMesaCreateContext(xmvis, shareCtx ? shareCtx->xmesaContext : NULL); if (!glxCtx->xmesaContext) { - _mesa_free(glxCtx); + free(glxCtx); return NULL; } diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 98ce6c5831..ed945023cf 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -253,7 +253,7 @@ bits_per_pixel( XMesaVisual xmv ) /* grab the bits/pixel value */ bitsPerPixel = img->bits_per_pixel; /* free the XImage */ - _mesa_free( img->data ); + free( img->data ); img->data = NULL; XMesaDestroyImage( img ); return bitsPerPixel; @@ -383,7 +383,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, */ b->frontxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_FALSE); if (!b->frontxrb) { - _mesa_free(b); + free(b); return NULL; } b->frontxrb->Parent = b; @@ -399,7 +399,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, b->backxrb = xmesa_new_renderbuffer(NULL, 0, &vis->mesa_visual, GL_TRUE); if (!b->backxrb) { /* XXX free front xrb too */ - _mesa_free(b); + free(b); return NULL; } b->backxrb->Parent = b; @@ -596,7 +596,7 @@ noFaultXAllocColor( int client, || prevCmapSize != cmapSize || !ctable) { /* free previously cached color table */ if (ctable) - _mesa_free(ctable); + free(ctable); /* Get the color table from X */ ctable = (XMesaColor *) MALLOC(cmapSize * sizeof(XMesaColor)); assert(ctable); @@ -652,8 +652,8 @@ noFaultXAllocColor( int client, *alloced = 0; } #ifdef XFree86Server - _mesa_free(ppixIn); - _mesa_free(ctable); + free(ppixIn); + free(ctable); #else /* don't free table, save it for next time */ #endif @@ -1366,14 +1366,14 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, v->display = display; - /* Save a copy of the XVisualInfo struct because the user may X_mesa_free() + /* Save a copy of the XVisualInfo struct because the user may Xfree() * the struct but we may need some of the information contained in it * at a later time. */ #ifndef XFree86Server v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo)); if(!v->visinfo) { - _mesa_free(v); + free(v); return NULL; } memcpy(v->visinfo, visinfo, sizeof(*visinfo)); @@ -1473,9 +1473,9 @@ PUBLIC void XMesaDestroyVisual( XMesaVisual v ) { #ifndef XFree86Server - _mesa_free(v->visinfo); + free(v->visinfo); #endif - _mesa_free(v); + free(v); } @@ -1514,7 +1514,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual, share_list ? &(share_list->mesa) : (GLcontext *) NULL, &functions, (void *) c)) { - _mesa_free(c); + free(c); return NULL; } @@ -1564,7 +1564,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) !_tnl_CreateContext( mesaCtx ) || !_swsetup_CreateContext( mesaCtx )) { _mesa_free_context_data(&c->mesa); - _mesa_free(c); + free(c); return NULL; } @@ -1598,7 +1598,7 @@ void XMesaDestroyContext( XMesaContext c ) _tnl_DestroyContext( mesaCtx ); _vbo_DestroyContext( mesaCtx ); _mesa_free_context_data( mesaCtx ); - _mesa_free( c ); + free( c ); } diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index bf38629289..5ffe110484 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -242,7 +242,7 @@ xmesa_delete_renderbuffer(struct gl_renderbuffer *rb) * should probably get freed here, but that's currently done in * XMesaDestroyBuffer(). */ - _mesa_free(rb); + free(rb); } @@ -412,11 +412,11 @@ xmesa_delete_framebuffer(struct gl_framebuffer *fb) } if (b->rowimage) { - _mesa_free( b->rowimage->data ); + free( b->rowimage->data ); b->rowimage->data = NULL; XMesaDestroyImage( b->rowimage ); } _mesa_free_framebuffer_data(fb); - _mesa_free(fb); + free(fb); } diff --git a/src/mesa/es/main/specials_es1.c b/src/mesa/es/main/specials_es1.c index a4f14490f3..c842007c22 100644 --- a/src/mesa/es/main/specials_es1.c +++ b/src/mesa/es/main/specials_es1.c @@ -167,7 +167,7 @@ compute_es_extensions(void) unsigned int len; len = make_extension_string(ctx, NULL); - s = (char *) _mesa_malloc(len + 1); + s = (char *) malloc(len + 1); if (!s) return NULL; make_extension_string(ctx, s); diff --git a/src/mesa/es/main/specials_es2.c b/src/mesa/es/main/specials_es2.c index e11ade9b94..10b4f25e0f 100644 --- a/src/mesa/es/main/specials_es2.c +++ b/src/mesa/es/main/specials_es2.c @@ -138,7 +138,7 @@ compute_es_extensions(void) unsigned int len; len = make_extension_string(ctx, NULL); - s = (char *) _mesa_malloc(len + 1); + s = (char *) malloc(len + 1); if (!s) return NULL; make_extension_string(ctx, s); diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 59cea59ac2..38b0246ba5 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -113,8 +113,6 @@ def PrintTail(): print '\t_mesa_buffer_data' print '\t_mesa_buffer_map' print '\t_mesa_buffer_subdata' - print '\t_mesa_bzero' - print '\t_mesa_calloc' print '\t_mesa_choose_tex_format' print '\t_mesa_compressed_texture_size' print '\t_mesa_create_framebuffer' @@ -128,7 +126,6 @@ def PrintTail(): print '\t_mesa_enable_1_5_extensions' print '\t_mesa_enable_sw_extensions' print '\t_mesa_error' - print '\t_mesa_free' print '\t_mesa_free_context_data' print '\t_mesa_get_current_context' print '\t_mesa_init_default_imports' diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index e36137d378..3a1fd37324 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -130,7 +130,7 @@ _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj ) (void) ctx; unbind_array_object_vbos(ctx, obj); _glthread_DESTROY_MUTEX(obj->Mutex); - _mesa_free(obj); + free(obj); } diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 44dc3b871e..9a32bc335d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1559,8 +1559,8 @@ _mesa_free_attrib_data(GLcontext *ctx) } next = attr->next; - _mesa_free(attr->data); - _mesa_free(attr); + free(attr->data); + free(attr); attr = next; } } diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 2e9793ea0e..816465cea1 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -208,14 +208,14 @@ _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj ) (void) ctx; if (bufObj->Data) - _mesa_free(bufObj->Data); + free(bufObj->Data); /* assign strange values here to help w/ debugging */ bufObj->RefCount = -1000; bufObj->Name = ~0; _glthread_DESTROY_MUTEX(bufObj->Mutex); - _mesa_free(bufObj); + free(bufObj); } diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 1c12fb00fa..785813166c 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -407,8 +407,8 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, _mesa_free_colortable_data(table); if (width > 0) { - table->TableF = (GLfloat *) _mesa_malloc(comps * width * sizeof(GLfloat)); - table->TableUB = (GLubyte *) _mesa_malloc(comps * width * sizeof(GLubyte)); + table->TableF = (GLfloat *) malloc(comps * width * sizeof(GLfloat)); + table->TableUB = (GLubyte *) malloc(comps * width * sizeof(GLubyte)); if (!table->TableF || !table->TableUB) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glColorTable"); @@ -1095,11 +1095,11 @@ void _mesa_free_colortable_data( struct gl_color_table *p ) { if (p->TableF) { - _mesa_free(p->TableF); + free(p->TableF); p->TableF = NULL; } if (p->TableUB) { - _mesa_free(p->TableUB); + free(p->TableUB); p->TableUB = NULL; } } diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f315f0b212..4ecbb5ecf6 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -222,7 +222,7 @@ _mesa_create_visual( GLboolean rgbFlag, GLint accumAlphaBits, GLint numSamples ) { - GLvisual *vis = (GLvisual *) _mesa_calloc(sizeof(GLvisual)); + GLvisual *vis = (GLvisual *) calloc(1, sizeof(GLvisual)); if (vis) { if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag, redBits, greenBits, blueBits, alphaBits, @@ -230,7 +230,7 @@ _mesa_create_visual( GLboolean rgbFlag, accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits, numSamples)) { - _mesa_free(vis); + free(vis); return NULL; } } @@ -320,7 +320,7 @@ _mesa_initialize_visual( GLvisual *vis, void _mesa_destroy_visual( GLvisual *vis ) { - _mesa_free(vis); + free(vis); } /*@}*/ @@ -755,7 +755,7 @@ alloc_dispatch_table(void) GLint numEntries = MAX2(_glapi_get_dispatch_table_size(), sizeof(struct _glapi_table) / sizeof(_glapi_proc)); struct _glapi_table *table = - (struct _glapi_table *) _mesa_malloc(numEntries * sizeof(_glapi_proc)); + (struct _glapi_table *) malloc(numEntries * sizeof(_glapi_proc)); if (table) { _glapi_proc *entry = (_glapi_proc *) table; GLint i; @@ -850,7 +850,7 @@ _mesa_initialize_context(GLcontext *ctx, if (!ctx->Exec || !ctx->Save) { _mesa_release_shared_state(ctx, ctx->Shared); if (ctx->Exec) - _mesa_free(ctx->Exec); + free(ctx->Exec); return GL_FALSE; } #if FEATURE_dispatch @@ -913,7 +913,7 @@ _mesa_create_context(const GLvisual *visual, ASSERT(visual); /*ASSERT(driverContext);*/ - ctx = (GLcontext *) _mesa_calloc(sizeof(GLcontext)); + ctx = (GLcontext *) calloc(1, sizeof(GLcontext)); if (!ctx) return NULL; @@ -922,7 +922,7 @@ _mesa_create_context(const GLvisual *visual, return ctx; } else { - _mesa_free(ctx); + free(ctx); return NULL; } } @@ -989,8 +989,8 @@ _mesa_free_context_data( GLcontext *ctx ) #endif /* free dispatch tables */ - _mesa_free(ctx->Exec); - _mesa_free(ctx->Save); + free(ctx->Exec); + free(ctx->Save); /* Shared context state (display lists, textures, etc) */ _mesa_release_shared_state( ctx, ctx->Shared ); @@ -999,10 +999,10 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_display_list_data(ctx); if (ctx->Extensions.String) - _mesa_free((void *) ctx->Extensions.String); + free((void *) ctx->Extensions.String); if (ctx->VersionString) - _mesa_free(ctx->VersionString); + free(ctx->VersionString); /* unbind the context if it's currently bound */ if (ctx == _mesa_get_current_context()) { @@ -1023,7 +1023,7 @@ _mesa_destroy_context( GLcontext *ctx ) { if (ctx) { _mesa_free_context_data(ctx); - _mesa_free( (void *) ctx ); + free( (void *) ctx ); } } diff --git a/src/mesa/main/cpuinfo.c b/src/mesa/main/cpuinfo.c index 79fcbc71c2..35de69b180 100644 --- a/src/mesa/main/cpuinfo.c +++ b/src/mesa/main/cpuinfo.c @@ -43,7 +43,7 @@ _mesa_get_cpu_features(void) /** * Return a string describing the CPU architexture and extensions that * Mesa is using (such as SSE or Altivec). - * \return information string, free it with _mesa_free() + * \return information string, free it with free() */ char * _mesa_get_cpu_string(void) @@ -51,7 +51,7 @@ _mesa_get_cpu_string(void) #define MAX_STRING 50 char *buffer; - buffer = (char *) _mesa_malloc(MAX_STRING); + buffer = (char *) malloc(MAX_STRING); if (!buffer) return NULL; diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index f2182c0577..79b63e940f 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -303,7 +303,7 @@ write_texture_image(struct gl_texture_object *texObj, GLubyte *buffer; char s[100]; - buffer = (GLubyte *) _mesa_malloc(img->Width * img->Height + buffer = (GLubyte *) malloc(img->Width * img->Height * img->Depth * 4); store = ctx->Pack; /* save */ @@ -321,7 +321,7 @@ write_texture_image(struct gl_texture_object *texObj, ctx->Pack = store; /* restore */ - _mesa_free(buffer); + free(buffer); } } @@ -350,7 +350,7 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) return; } - buffer = (GLubyte *) _mesa_malloc(rb->Width * rb->Height * 4); + buffer = (GLubyte *) malloc(rb->Width * rb->Height * 4); ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height, format, type, &ctx->DefaultPacking, buffer); @@ -361,7 +361,7 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) _mesa_printf(" Writing renderbuffer image to %s\n", s); write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); - _mesa_free(buffer); + free(buffer); } @@ -481,7 +481,7 @@ _mesa_dump_color_buffer(const char *filename) const GLuint h = ctx->DrawBuffer->Height; GLubyte *buf; - buf = (GLubyte *) _mesa_malloc(w * h * 4); + buf = (GLubyte *) malloc(w * h * 4); _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); @@ -499,7 +499,7 @@ _mesa_dump_color_buffer(const char *filename) _mesa_PopClientAttrib(); - _mesa_free(buf); + free(buf); } @@ -513,8 +513,8 @@ _mesa_dump_depth_buffer(const char *filename) GLubyte *buf2; GLuint i; - buf = (GLuint *) _mesa_malloc(w * h * 4); /* 4 bpp */ - buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */ + buf = (GLuint *) malloc(w * h * 4); /* 4 bpp */ + buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); @@ -534,8 +534,8 @@ _mesa_dump_depth_buffer(const char *filename) _mesa_PopClientAttrib(); - _mesa_free(buf); - _mesa_free(buf2); + free(buf); + free(buf2); } @@ -549,8 +549,8 @@ _mesa_dump_stencil_buffer(const char *filename) GLubyte *buf2; GLuint i; - buf = (GLubyte *) _mesa_malloc(w * h); /* 1 bpp */ - buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */ + buf = (GLubyte *) malloc(w * h); /* 1 bpp */ + buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); @@ -569,8 +569,8 @@ _mesa_dump_stencil_buffer(const char *filename) _mesa_PopClientAttrib(); - _mesa_free(buf); - _mesa_free(buf2); + free(buf); + free(buf2); } diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index 49946a6506..892520b695 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -65,7 +65,7 @@ delete_wrapper(struct gl_renderbuffer *rb) ASSERT(rb->Format == MESA_FORMAT_Z24_S8 || rb->Format == MESA_FORMAT_S8_Z24); _mesa_reference_renderbuffer(&rb->Wrapped, NULL); - _mesa_free(rb); + free(rb); } @@ -818,5 +818,5 @@ _mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb) } stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL); } - _mesa_free(data); + free(data); } diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 740ebfe17a..87b8ddacc2 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -472,7 +472,7 @@ make_list(GLuint name, GLuint count) { struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list); dlist->Name = name; - dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count); + dlist->Head = (Node *) malloc(sizeof(Node) * count); dlist->Head[0].opcode = OPCODE_END_OF_LIST; return dlist; } @@ -557,108 +557,108 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) switch (opcode) { /* for some commands, we need to free malloc'd memory */ case OPCODE_MAP1: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_MAP2: - _mesa_free(n[10].data); + free(n[10].data); n += InstSize[n[0].opcode]; break; case OPCODE_DRAW_PIXELS: - _mesa_free(n[5].data); + free(n[5].data); n += InstSize[n[0].opcode]; break; case OPCODE_BITMAP: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_COLOR_TABLE: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_COLOR_SUB_TABLE: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_CONVOLUTION_FILTER_1D: - _mesa_free(n[6].data); + free(n[6].data); n += InstSize[n[0].opcode]; break; case OPCODE_CONVOLUTION_FILTER_2D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_POLYGON_STIPPLE: - _mesa_free(n[1].data); + free(n[1].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE1D: - _mesa_free(n[8].data); + free(n[8].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE2D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_IMAGE3D: - _mesa_free(n[10].data); + free(n[10].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE1D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE2D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_TEX_SUB_IMAGE3D: - _mesa_free(n[11].data); + free(n[11].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_1D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_2D: - _mesa_free(n[8].data); + free(n[8].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_IMAGE_3D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: - _mesa_free(n[7].data); + free(n[7].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: - _mesa_free(n[9].data); + free(n[9].data); n += InstSize[n[0].opcode]; break; case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: - _mesa_free(n[11].data); + free(n[11].data); n += InstSize[n[0].opcode]; break; #if FEATURE_NV_vertex_program case OPCODE_LOAD_PROGRAM_NV: - _mesa_free(n[4].data); /* program string */ + free(n[4].data); /* program string */ n += InstSize[n[0].opcode]; break; case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV: - _mesa_free(n[2].data); /* array of program ids */ + free(n[2].data); /* array of program ids */ n += InstSize[n[0].opcode]; break; #endif #if FEATURE_NV_fragment_program case OPCODE_PROGRAM_NAMED_PARAMETER_NV: - _mesa_free(n[3].data); /* parameter name */ + free(n[3].data); /* parameter name */ n += InstSize[n[0].opcode]; break; #endif #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program case OPCODE_PROGRAM_STRING_ARB: - _mesa_free(n[4].data); /* program string */ + free(n[4].data); /* program string */ n += InstSize[n[0].opcode]; break; #endif @@ -670,7 +670,7 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) case OPCODE_UNIFORM_2IV: case OPCODE_UNIFORM_3IV: case OPCODE_UNIFORM_4IV: - _mesa_free(n[3].data); + free(n[3].data); n += InstSize[n[0].opcode]; break; case OPCODE_UNIFORM_MATRIX22: @@ -682,17 +682,17 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) case OPCODE_UNIFORM_MATRIX32: case OPCODE_UNIFORM_MATRIX34: case OPCODE_UNIFORM_MATRIX43: - _mesa_free(n[4].data); + free(n[4].data); n += InstSize[n[0].opcode]; break; case OPCODE_CONTINUE: n = (Node *) n[1].next; - _mesa_free(block); + free(block); block = n; break; case OPCODE_END_OF_LIST: - _mesa_free(block); + free(block); done = GL_TRUE; break; default: @@ -703,7 +703,7 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) } } - _mesa_free(dlist); + free(dlist); } @@ -869,7 +869,7 @@ dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes) Node *newblock; n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; n[0].opcode = OPCODE_CONTINUE; - newblock = (Node *) _mesa_malloc(sizeof(Node) * BLOCK_SIZE); + newblock = (Node *) malloc(sizeof(Node) * BLOCK_SIZE); if (!newblock) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list"); return NULL; @@ -2912,7 +2912,7 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) if (n) { n[1].e = map; n[2].i = mapsize; - n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat)); + n[3].data = (void *) malloc(mapsize * sizeof(GLfloat)); memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat)); } if (ctx->ExecuteFlag) { @@ -4360,7 +4360,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, GLvoid *image; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB"); return; @@ -4377,7 +4377,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, n[7].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage1DARB(ctx->Exec, @@ -4406,7 +4406,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, GLvoid *image; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB"); return; @@ -4424,7 +4424,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, n[8].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage2DARB(ctx->Exec, @@ -4453,7 +4453,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, GLvoid *image; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB"); return; @@ -4472,7 +4472,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, n[9].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexImage3DARB(ctx->Exec, @@ -4496,7 +4496,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB"); return; @@ -4513,7 +4513,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, n[7].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage1DARB(ctx->Exec, (target, level, xoffset, @@ -4536,7 +4536,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB"); return; @@ -4555,7 +4555,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, n[9].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage2DARB(ctx->Exec, @@ -4578,7 +4578,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* make copy of image */ - image = _mesa_malloc(imageSize); + image = malloc(imageSize); if (!image) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB"); return; @@ -4599,7 +4599,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, n[11].data = image; } else if (image) { - _mesa_free(image); + free(image); } if (ctx->ExecuteFlag) { CALL_CompressedTexSubImage3DARB(ctx->Exec, @@ -4788,7 +4788,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4); if (n) { - GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); + GLubyte *programCopy = (GLubyte *) malloc(len); if (!programCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); return; @@ -4815,7 +4815,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2); if (n) { - GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint)); + GLuint *idCopy = (GLuint *) malloc(num * sizeof(GLuint)); if (!idCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV"); return; @@ -4986,7 +4986,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); if (n) { - GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len); + GLubyte *nameCopy = (GLubyte *) malloc(len); if (!nameCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV"); return; @@ -5085,7 +5085,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4); if (n) { - GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); + GLubyte *programCopy = (GLubyte *) malloc(len); if (!programCopy) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return; @@ -6199,7 +6199,7 @@ save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) static void * memdup(const void *src, GLsizei bytes) { - void *b = bytes >= 0 ? _mesa_malloc(bytes) : NULL; + void *b = bytes >= 0 ? malloc(bytes) : NULL; if (b) memcpy(b, src, bytes); return b; diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 4c6139985f..07a7f9fed8 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -140,14 +140,14 @@ _mesa_exec_free(void *addr) void * _mesa_exec_malloc(GLuint size) { - return _mesa_malloc( size ); + return malloc( size ); } void _mesa_exec_free(void *addr) { - _mesa_free(addr); + free(addr); } diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index f24baf5acd..2c1120e19f 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -576,7 +576,7 @@ append(const char *a, const char *b) { const GLuint aLen = a ? strlen(a) : 0; const GLuint bLen = b ? strlen(b) : 0; - char *s = _mesa_calloc(aLen + bLen + 1); + char *s = calloc(1, aLen + bLen + 1); if (s) { if (a) memcpy(s, a, aLen); @@ -585,7 +585,7 @@ append(const char *a, const char *b) s[aLen + bLen] = '\0'; } if (a) - _mesa_free((void *) a); + free((void *) a); return s; } @@ -685,7 +685,7 @@ _mesa_make_extension_string( GLcontext *ctx ) extStrLen += strlen(extraExt) + 1; /* +1 for space */ /* allocate the extension string */ - s = (char *) _mesa_malloc(extStrLen); + s = (char *) malloc(extStrLen); if (!s) return NULL; diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 41b5420943..065e25fd33 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -192,7 +192,7 @@ _mesa_destroy_framebuffer(struct gl_framebuffer *fb) { if (fb) { _mesa_free_framebuffer_data(fb); - _mesa_free(fb); + free(fb); } } diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index fdfbe6b4f4..975775469d 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -108,13 +108,13 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table) _mesa_problem(NULL, "In _mesa_DeleteHashTable, found non-freed data"); } - _mesa_free(entry); + free(entry); entry = next; } } _glthread_DESTROY_MUTEX(table->Mutex); _glthread_DESTROY_MUTEX(table->WalkMutex); - _mesa_free(table); + free(table); } @@ -245,7 +245,7 @@ _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key) else { table->Table[pos] = entry->Next; } - _mesa_free(entry); + free(entry); _glthread_UNLOCK_MUTEX(table->Mutex); return; } @@ -282,7 +282,7 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table, for (entry = table->Table[pos]; entry; entry = next) { callback(entry->Key, entry->Data, userData); next = entry->Next; - _mesa_free(entry); + free(entry); } table->Table[pos] = NULL; } diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index bd03217e2a..dc8d97728b 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1038,7 +1038,7 @@ _mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32], | (p[3] ); p += 4; } - _mesa_free(ptrn); + free(ptrn); } } @@ -1083,7 +1083,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, /* Alloc dest storage */ bytes = ((width + 7) / 8 * height); - buffer = (GLubyte *) _mesa_malloc( bytes ); + buffer = (GLubyte *) malloc( bytes ); if (!buffer) return NULL; @@ -1094,7 +1094,7 @@ _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, _mesa_image_address2d(packing, pixels, width, height, GL_COLOR_INDEX, GL_BITMAP, row, 0); if (!src) { - _mesa_free(buffer); + free(buffer); return NULL; } @@ -5232,7 +5232,7 @@ _mesa_unpack_image( GLuint dimensions, { GLubyte *destBuffer - = (GLubyte *) _mesa_malloc(bytesPerRow * height * depth); + = (GLubyte *) malloc(bytesPerRow * height * depth); GLubyte *dst; GLint img, row; if (!destBuffer) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 5c2c863f97..10224f7888 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -71,27 +71,6 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); /** \name Memory */ /*@{*/ -/** Wrapper around malloc() */ -void * -_mesa_malloc(size_t bytes) -{ - return malloc(bytes); -} - -/** Wrapper around calloc() */ -void * -_mesa_calloc(size_t bytes) -{ - return calloc(1, bytes); -} - -/** Wrapper around free() */ -void -_mesa_free(void *ptr) -{ - free(ptr); -} - /** * Allocate aligned memory. * @@ -118,7 +97,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) ASSERT( alignment > 0 ); - ptr = (uintptr_t) _mesa_malloc(bytes + alignment + sizeof(void *)); + ptr = (uintptr_t) malloc(bytes + alignment + sizeof(void *)); if (!ptr) return NULL; @@ -138,8 +117,8 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) } /** - * Same as _mesa_align_malloc(), but using _mesa_calloc() instead of - * _mesa_malloc() + * Same as _mesa_align_malloc(), but using calloc(1, ) instead of + * malloc() */ void * _mesa_align_calloc(size_t bytes, unsigned long alignment) @@ -167,7 +146,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment) ASSERT( alignment > 0 ); - ptr = (uintptr_t) _mesa_calloc(bytes + alignment + sizeof(void *)); + ptr = (uintptr_t) calloc(1, bytes + alignment + sizeof(void *)); if (!ptr) return NULL; @@ -203,7 +182,7 @@ _mesa_align_free(void *ptr) #else void **cubbyHole = (void **) ((char *) ptr - sizeof(void *)); void *realAddr = *cubbyHole; - _mesa_free(realAddr); + free(realAddr); #endif /* defined(HAVE_POSIX_MEMALIGN) */ } @@ -236,11 +215,11 @@ void * _mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize) { const size_t copySize = (oldSize < newSize) ? oldSize : newSize; - void *newBuffer = _mesa_malloc(newSize); + void *newBuffer = malloc(newSize); if (newBuffer && oldBuffer && copySize > 0) memcpy(newBuffer, oldBuffer, copySize); if (oldBuffer) - _mesa_free(oldBuffer); + free(oldBuffer); return newBuffer; } @@ -798,7 +777,7 @@ _mesa_getenv( const char *var ) /*@{*/ /** - * Implemented using _mesa_malloc() and strcpy. + * Implemented using malloc() and strcpy. * Note that NULL is handled accordingly. */ char * @@ -806,7 +785,7 @@ _mesa_strdup( const char *s ) { if (s) { size_t l = strlen(s); - char *s2 = (char *) _mesa_malloc(l + 1); + char *s2 = (char *) malloc(l + 1); if (s2) strcpy(s2, s); return s2; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 106dd021a1..4eabdfdb0d 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -50,15 +50,15 @@ extern "C" { /*@{*/ /** Allocate \p BYTES bytes */ -#define MALLOC(BYTES) _mesa_malloc(BYTES) +#define MALLOC(BYTES) malloc(BYTES) /** Allocate and zero \p BYTES bytes */ -#define CALLOC(BYTES) _mesa_calloc(BYTES) +#define CALLOC(BYTES) calloc(1, BYTES) /** Allocate a structure of type \p T */ -#define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T)) +#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T)) /** Allocate and zero a structure of type \p T */ -#define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T)) +#define CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T)) /** Free memory */ -#define FREE(PTR) _mesa_free(PTR) +#define FREE(PTR) free(PTR) /** Allocate \p BYTES aligned at \p N bytes */ #define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N) @@ -507,15 +507,6 @@ _mesa_little_endian(void) * Functions */ -extern void * -_mesa_malloc( size_t bytes ); - -extern void * -_mesa_calloc( size_t bytes ); - -extern void -_mesa_free( void *ptr ); - extern void * _mesa_align_malloc( size_t bytes, unsigned long alignment ); diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 654faa5c77..6899ed0ddf 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1433,7 +1433,7 @@ _mesa_free_lighting_data( GLcontext *ctx ) /* Free lighting shininess exponentiation table */ foreach_s( s, tmps, ctx->_ShineTabList ) { - _mesa_free( s ); + free( s ); } - _mesa_free( ctx->_ShineTabList ); + free( ctx->_ShineTabList ); } diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 1da576337f..415abcdfa1 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1537,15 +1537,15 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, size = _mesa_bytes_per_pixel(srcImage->_BaseFormat, CHAN_TYPE) * srcImage->Width * srcImage->Height * srcImage->Depth + 20; /* 20 extra bytes, just be safe when calling last FetchTexel */ - srcData = (GLubyte *) _mesa_malloc(size); + srcData = (GLubyte *) malloc(size); if (!srcData) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); return; } - dstData = (GLubyte *) _mesa_malloc(size / 2); /* 1/4 would probably be OK */ + dstData = (GLubyte *) malloc(size / 2); /* 1/4 would probably be OK */ if (!dstData) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generate mipmaps"); - _mesa_free((void *) srcData); + free((void *) srcData); return; } @@ -1590,8 +1590,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, if (!nextLevel) { /* all done */ if (_mesa_is_format_compressed(srcImage->TexFormat)) { - _mesa_free((void *) srcData); - _mesa_free(dstData); + free((void *) srcData); + free(dstData); } return; } diff --git a/src/mesa/main/mm.c b/src/mesa/main/mm.c index d430bcdb84..3ef38e94be 100644 --- a/src/mesa/main/mm.c +++ b/src/mesa/main/mm.c @@ -60,13 +60,13 @@ mmInit(unsigned ofs, unsigned size) if (!size) return NULL; - heap = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block)); + heap = (struct mem_block *) calloc(1, sizeof(struct mem_block)); if (!heap) return NULL; - block = (struct mem_block *) _mesa_calloc(sizeof(struct mem_block)); + block = (struct mem_block *) calloc(1, sizeof(struct mem_block)); if (!block) { - _mesa_free(heap); + free(heap); return NULL; } @@ -98,7 +98,7 @@ SliceBlock(struct mem_block *p, /* break left [p, newblock, p->next], then p = newblock */ if (startofs > p->ofs) { - newblock = (struct mem_block*) _mesa_calloc(sizeof(struct mem_block)); + newblock = (struct mem_block*) calloc(1, sizeof(struct mem_block)); if (!newblock) return NULL; newblock->ofs = startofs; @@ -122,7 +122,7 @@ SliceBlock(struct mem_block *p, /* break right, also [p, newblock, p->next] */ if (size < p->size) { - newblock = (struct mem_block*) _mesa_calloc(sizeof(struct mem_block)); + newblock = (struct mem_block*) calloc(1, sizeof(struct mem_block)); if (!newblock) return NULL; newblock->ofs = startofs + size; @@ -225,7 +225,7 @@ Join2Blocks(struct mem_block *p) q->next_free->prev_free = q->prev_free; q->prev_free->next_free = q->next_free; - _mesa_free(q); + free(q); return 1; } return 0; @@ -270,9 +270,9 @@ mmDestroy(struct mem_block *heap) for (p = heap->next; p != heap; ) { struct mem_block *next = p->next; - _mesa_free(p); + free(p); p = next; } - _mesa_free(heap); + free(heap); } diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 387a82fc9d..471352f472 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -114,7 +114,7 @@ _mesa_check_query(GLcontext *ctx, struct gl_query_object *q) static void _mesa_delete_query(GLcontext *ctx, struct gl_query_object *q) { - _mesa_free(q); + free(q); } diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index aec22d9d14..c44db255d6 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1122,7 +1122,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, /* free old buffer storage */ if (rb->Data) { - _mesa_free(rb->Data); + free(rb->Data); rb->Data = NULL; } @@ -1179,10 +1179,10 @@ alloc_storage_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, /* next, resize my alpha buffer */ if (arb->Data) { - _mesa_free(arb->Data); + free(arb->Data); } - arb->Data = _mesa_malloc(width * height * sizeof(GLubyte)); + arb->Data = malloc(width * height * sizeof(GLubyte)); if (arb->Data == NULL) { arb->Width = 0; arb->Height = 0; @@ -1204,13 +1204,13 @@ static void delete_renderbuffer_alpha8(struct gl_renderbuffer *arb) { if (arb->Data) { - _mesa_free(arb->Data); + free(arb->Data); } ASSERT(arb->Wrapped); ASSERT(arb != arb->Wrapped); arb->Wrapped->Delete(arb->Wrapped); arb->Wrapped = NULL; - _mesa_free(arb); + free(arb); } @@ -1460,9 +1460,9 @@ void _mesa_delete_renderbuffer(struct gl_renderbuffer *rb) { if (rb->Data) { - _mesa_free(rb->Data); + free(rb->Data); } - _mesa_free(rb); + free(rb); } diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index 91f2a7a7bf..e6f6add768 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -434,7 +434,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, * This array holds offsets of where the appropriate string ends, thus the * last element will be set to the total length of the source code. */ - offsets = (GLint *) _mesa_malloc(count * sizeof(GLint)); + offsets = (GLint *) malloc(count * sizeof(GLint)); if (offsets == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); return; @@ -442,7 +442,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, for (i = 0; i < count; i++) { if (string[i] == NULL) { - _mesa_free((GLvoid *) offsets); + free((GLvoid *) offsets); _mesa_error(ctx, GL_INVALID_OPERATION, "glShaderSourceARB(null string)"); return; } @@ -460,9 +460,9 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, * valgrind warnings in the parser/grammer code. */ totalLength = offsets[count - 1] + 2; - source = (GLcharARB *) _mesa_malloc(totalLength * sizeof(GLcharARB)); + source = (GLcharARB *) malloc(totalLength * sizeof(GLcharARB)); if (source == NULL) { - _mesa_free((GLvoid *) offsets); + free((GLvoid *) offsets); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glShaderSourceARB"); return; } @@ -491,7 +491,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, if (newSource) { _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", shaderObj, checksum, filename); - _mesa_free(source); + free(source); source = newSource; } } @@ -504,7 +504,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, sh->SourceChecksum = checksum; /* save original checksum */ } - _mesa_free(offsets); + free(offsets); } diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index b889364f0d..e364e24048 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -362,7 +362,7 @@ free_shared_state(GLcontext *ctx, struct gl_shared_state *shared) _glthread_DESTROY_MUTEX(shared->Mutex); _glthread_DESTROY_MUTEX(shared->TexMutex); - _mesa_free(shared); + free(shared); } diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index 36b48fd9f2..1bff308177 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -78,7 +78,7 @@ static void _mesa_delete_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj) { (void) ctx; - _mesa_free(syncObj); + free(syncObj); } diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 73a31a17ec..71e40dd3e9 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -105,7 +105,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) dst, dstRowStride); if (tempImage) - _mesa_free((void*) tempImage); + free((void*) tempImage); return GL_TRUE; } @@ -162,7 +162,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) dst, dstRowStride); if (tempImage) - _mesa_free((void*) tempImage); + free((void*) tempImage); return GL_TRUE; } @@ -1305,7 +1305,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, if ((width & 7) | (height & 3)) { GLint newWidth = (width + 7) & ~7; GLint newHeight = (height + 3) & ~3; - newSource = _mesa_malloc(comps * newWidth * newHeight * sizeof(GLchan)); + newSource = malloc(comps * newWidth * newHeight * sizeof(GLchan)); if (!newSource) { GET_CURRENT_CONTEXT(ctx); _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression"); @@ -1324,7 +1324,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, if (CHAN_TYPE != GL_UNSIGNED_BYTE) { const GLuint n = width * height * comps; const GLchan *src = (const GLchan *) source; - GLubyte *dest = (GLubyte *) _mesa_malloc(n * sizeof(GLubyte)); + GLubyte *dest = (GLubyte *) malloc(n * sizeof(GLubyte)); GLuint i; if (!dest) { GET_CURRENT_CONTEXT(ctx); @@ -1335,7 +1335,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, dest[i] = CHAN_TO_UBYTE(src[i]); } if (newSource != NULL) { - _mesa_free(newSource); + free(newSource); } newSource = dest; /* we'll free this buffer before returning */ source = dest; /* the new, GLubyte incoming image */ @@ -1361,7 +1361,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps, cleanUp: if (newSource != NULL) { - _mesa_free(newSource); + free(newSource); } } diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index b271a539a7..fcd28a4b4e 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -213,7 +213,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } @@ -275,7 +275,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void*) tempImage); + free((void*) tempImage); return GL_TRUE; } @@ -336,7 +336,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } @@ -397,7 +397,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) } if (tempImage) - _mesa_free((void *) tempImage); + free((void *) tempImage); return GL_TRUE; } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index da3c6f9841..11e37dc34e 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -488,8 +488,8 @@ _mesa_delete_texture_image( GLcontext *ctx, struct gl_texture_image *texImage ) ASSERT(texImage->Data == NULL); if (texImage->ImageOffsets) - _mesa_free(texImage->ImageOffsets); - _mesa_free(texImage); + free(texImage->ImageOffsets); + free(texImage); } @@ -843,7 +843,7 @@ clear_teximage_fields(struct gl_texture_image *img) img->Depth = 0; img->RowStride = 0; if (img->ImageOffsets) { - _mesa_free(img->ImageOffsets); + free(img->ImageOffsets); img->ImageOffsets = NULL; } img->Width2 = 0; @@ -932,8 +932,8 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, * case code in the texstore routines. */ if (img->ImageOffsets) - _mesa_free(img->ImageOffsets); - img->ImageOffsets = (GLuint *) _mesa_malloc(depth * sizeof(GLuint)); + free(img->ImageOffsets); + img->ImageOffsets = (GLuint *) malloc(depth * sizeof(GLuint)); for (i = 0; i < depth; i++) { img->ImageOffsets[i] = i * width * height; } diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 649f3587cb..feba6e95b6 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -207,7 +207,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) _glthread_DESTROY_MUTEX(texObj->Mutex); /* free this object */ - _mesa_free(texObj); + free(texObj); } diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index cf603d46d8..dbed51a77f 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -414,7 +414,7 @@ static void delete_texture_wrapper(struct gl_renderbuffer *rb) { ASSERT(rb->RefCount == 0); - _mesa_free(rb); + free(rb); } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ab572a13ed..bd63c77a39 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -347,16 +347,16 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, GLfloat *convImage; /* pre-convolution image buffer (3D) */ - tempImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth * 4 * sizeof(GLfloat)); if (!tempImage) return NULL; /* post-convolution image buffer (2D) */ - convImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight + convImage = (GLfloat *) malloc(srcWidth * srcHeight * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tempImage); + free(tempImage); return NULL; } @@ -419,7 +419,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, } } /* loop over 3D image slices */ - _mesa_free(convImage); + free(convImage); /* might need these below */ srcWidth = convWidth; @@ -433,7 +433,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, GLfloat *dst; GLint img, row; - tempImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLfloat)); if (!tempImage) return NULL; @@ -472,10 +472,10 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, */ ASSERT(texComponents >= logComponents); - newImage = (GLfloat *) _mesa_malloc(srcWidth * srcHeight * srcDepth + newImage = (GLfloat *) malloc(srcWidth * srcHeight * srcDepth * texComponents * sizeof(GLfloat)); if (!newImage) { - _mesa_free(tempImage); + free(tempImage); return NULL; } @@ -495,7 +495,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, } } - _mesa_free(tempImage); + free(tempImage); tempImage = newImage; } @@ -582,11 +582,11 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, #endif /* unpack and transfer the source image */ - tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLchan *) malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLchan)); if (!tempImage) { if (freeSrcImage) { - _mesa_free((void *) srcAddr); + free((void *) srcAddr); } return NULL; } @@ -611,7 +611,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, /* If we made a temporary image for convolution, free it here */ if (freeSrcImage) { - _mesa_free((void *) srcAddr); + free((void *) srcAddr); } if (logicalBaseFormat != textureBaseFormat) { @@ -631,10 +631,10 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, */ ASSERT(texComponents >= logComponents); - newImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth + newImage = (GLchan *) malloc(srcWidth * srcHeight * srcDepth * texComponents * sizeof(GLchan)); if (!newImage) { - _mesa_free(tempImage); + free(tempImage); return NULL; } @@ -654,7 +654,7 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, } } - _mesa_free(tempImage); + free(tempImage); tempImage = newImage; } @@ -1267,7 +1267,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1395,7 +1395,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1606,7 +1606,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1733,7 +1733,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1841,7 +1841,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1912,7 +1912,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -1970,7 +1970,7 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2040,7 +2040,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2143,7 +2143,7 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2218,7 +2218,7 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2273,7 +2273,7 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2360,7 +2360,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) src += srcWidth; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2518,7 +2518,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) GLbyte *tempImage, *dst, *src; GLint row; - tempImage = (GLbyte *) _mesa_malloc(srcWidth * srcHeight * srcDepth + tempImage = (GLbyte *) malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLbyte)); if (!tempImage) return GL_FALSE; @@ -2546,7 +2546,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) dst += dstRowStride; src += srcWidth * texelBytes; } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2667,7 +2667,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) dstRow += dstRowStride; } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2925,7 +2925,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } @@ -2996,7 +2996,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) } } - _mesa_free((void *) tempImage); + free((void *) tempImage); } return GL_TRUE; } diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 9d23c577bd..e474fe7fa5 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -122,7 +122,7 @@ _mesa_compute_version(GLcontext *ctx) compute_version(ctx, &ctx->VersionMajor, &ctx->VersionMinor); - ctx->VersionString = (char *) _mesa_malloc(max); + ctx->VersionString = (char *) malloc(max); if (ctx->VersionString) { _mesa_snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, ctx->VersionMajor, ctx->VersionMinor); diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index bdd26b7f3a..03ff30a239 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -85,7 +85,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, } if (program->Base.String != NULL) - _mesa_free(program->Base.String); + free(program->Base.String); /* Copy the relevant contents of the arb_program struct into the * fragment_program struct. @@ -130,7 +130,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, program->Base.InputsRead |= FRAG_BIT_FOGC; if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) @@ -181,7 +181,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, } if (program->Base.String != NULL) - _mesa_free(program->Base.String); + free(program->Base.String); /* Copy the relevant contents of the arb_program struct into the * vertex_program struct. @@ -203,7 +203,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, ? GL_TRUE : GL_FALSE; if (program->Base.Instructions) - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c index fb2fa4b95f..870f77e30d 100644 --- a/src/mesa/shader/atifragshader.c +++ b/src/mesa/shader/atifragshader.c @@ -60,11 +60,11 @@ _mesa_delete_ati_fragment_shader(GLcontext *ctx, struct ati_fragment_shader *s) GLuint i; for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { if (s->Instructions[i]) - _mesa_free(s->Instructions[i]); + free(s->Instructions[i]); if (s->SetupInst[i]) - _mesa_free(s->SetupInst[i]); + free(s->SetupInst[i]); } - _mesa_free(s); + free(s); } @@ -293,7 +293,7 @@ _mesa_DeleteFragmentShaderATI(GLuint id) if (prog) { prog->RefCount--; if (prog->RefCount <= 0) { - _mesa_free(prog); + free(prog); } } } @@ -318,9 +318,9 @@ _mesa_BeginFragmentShaderATI(void) /* no idea if it's allowed to redefine a shader */ for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { if (ctx->ATIFragmentShader.Current->Instructions[i]) - _mesa_free(ctx->ATIFragmentShader.Current->Instructions[i]); + free(ctx->ATIFragmentShader.Current->Instructions[i]); if (ctx->ATIFragmentShader.Current->SetupInst[i]) - _mesa_free(ctx->ATIFragmentShader.Current->SetupInst[i]); + free(ctx->ATIFragmentShader.Current->SetupInst[i]); } /* malloc the instructions here - not sure if the best place but its @@ -328,11 +328,11 @@ _mesa_BeginFragmentShaderATI(void) for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { ctx->ATIFragmentShader.Current->Instructions[i] = (struct atifs_instruction *) - _mesa_calloc(sizeof(struct atifs_instruction) * + calloc(1, sizeof(struct atifs_instruction) * (MAX_NUM_INSTRUCTIONS_PER_PASS_ATI)); ctx->ATIFragmentShader.Current->SetupInst[i] = (struct atifs_setupinst *) - _mesa_calloc(sizeof(struct atifs_setupinst) * + calloc(1, sizeof(struct atifs_setupinst) * (MAX_NUM_FRAGMENT_REGISTERS_ATI)); } diff --git a/src/mesa/shader/hash_table.c b/src/mesa/shader/hash_table.c index e89a2564d7..fa6ba2bfdf 100644 --- a/src/mesa/shader/hash_table.c +++ b/src/mesa/shader/hash_table.c @@ -65,7 +65,7 @@ hash_table_ctor(unsigned num_buckets, hash_func_t hash, num_buckets = 16; } - ht = _mesa_malloc(sizeof(*ht) + ((num_buckets - 1) + ht = malloc(sizeof(*ht) + ((num_buckets - 1) * sizeof(ht->buckets[0]))); if (ht != NULL) { ht->hash = hash; @@ -85,7 +85,7 @@ void hash_table_dtor(struct hash_table *ht) { hash_table_clear(ht); - _mesa_free(ht); + free(ht); } @@ -100,7 +100,7 @@ hash_table_clear(struct hash_table *ht) for (i = 0; i < ht->num_buckets; i++) { foreach_s(node, temp, & ht->buckets[i]) { remove_from_list(node); - _mesa_free(node); + free(node); } assert(is_empty_list(& ht->buckets[i])); @@ -134,7 +134,7 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key) const unsigned bucket = hash_value % ht->num_buckets; struct hash_node *node; - node = _mesa_calloc(sizeof(*node)); + node = calloc(1, sizeof(*node)); node->data = data; node->key = key; diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 639408d82a..4f02703619 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -171,7 +171,7 @@ record_error(struct parse_state *parseState, const char *msg, int lineNo) _mesa_debug(parseState->ctx, "nvfragparse.c(%d): line %d, column %d:%s (%s)\n", lineNo, line, column, (char *) lineStr, msg); - _mesa_free((void *) lineStr); + free((void *) lineStr); #else (void) lineNo; #endif @@ -1231,7 +1231,7 @@ Parse_PrintInstruction(struct parse_state *parseState, for (len = 0; str[len] != '\''; len++) /* find closing quote */ ; parseState->pos += len + 1; - msg = (GLubyte*) _mesa_malloc(len + 1); + msg = (GLubyte*) malloc(len + 1); memcpy(msg, str, len); msg[len] = 0; @@ -1548,7 +1548,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, program->Base.String = programString; program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB; if (program->Base.Instructions) { - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); } program->Base.Instructions = newInst; program->Base.NumInstructions = parseState.numInst; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 3656438d42..fb36303bb9 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -82,7 +82,7 @@ record_error(struct parse_state *parseState, const char *msg, int lineNo) _mesa_debug(parseState->ctx, "nvfragparse.c(%d): line %d, column %d:%s (%s)\n", lineNo, line, column, (char *) lineStr, msg); - _mesa_free((void *) lineStr); + free((void *) lineStr); #else (void) lineNo; #endif @@ -1048,7 +1048,7 @@ Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction * for (len = 0; str[len] != '\''; len++) /* find closing quote */ ; parseState->pos += len + 1; - msg = (GLubyte*) _mesa_malloc(len + 1); + msg = (GLubyte*) malloc(len + 1); memcpy(msg, str, len); msg[len] = 0; @@ -1372,7 +1372,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, newInst = _mesa_alloc_instructions(parseState.numInst); if (!newInst) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); - _mesa_free(programString); + free(programString); return; /* out of memory */ } _mesa_copy_instructions(newInst, instBuffer, parseState.numInst); @@ -1380,12 +1380,12 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, /* install the program */ program->Base.Target = target; if (program->Base.String) { - _mesa_free(program->Base.String); + free(program->Base.String); } program->Base.String = programString; program->Base.Format = GL_PROGRAM_FORMAT_ASCII_ARB; if (program->Base.Instructions) { - _mesa_free(program->Base.Instructions); + free(program->Base.Instructions); } program->Base.Instructions = newInst; program->Base.InputsRead = parseState.inputsRead; diff --git a/src/mesa/shader/prog_cache.c b/src/mesa/shader/prog_cache.c index 8e54f3a5a0..e5b602fc09 100644 --- a/src/mesa/shader/prog_cache.c +++ b/src/mesa/shader/prog_cache.c @@ -87,7 +87,7 @@ rehash(struct gl_program_cache *cache) cache->last = NULL; size = cache->size * 3; - items = (struct cache_item**) _mesa_malloc(size * sizeof(*items)); + items = (struct cache_item**) malloc(size * sizeof(*items)); memset(items, 0, size * sizeof(*items)); for (i = 0; i < cache->size; i++) @@ -97,7 +97,7 @@ rehash(struct gl_program_cache *cache) items[c->hash % size] = c; } - _mesa_free(cache->items); + free(cache->items); cache->items = items; cache->size = size; } @@ -114,9 +114,9 @@ clear_cache(GLcontext *ctx, struct gl_program_cache *cache) for (i = 0; i < cache->size; i++) { for (c = cache->items[i]; c; c = next) { next = c->next; - _mesa_free(c->key); + free(c->key); _mesa_reference_program(ctx, &c->program, NULL); - _mesa_free(c); + free(c); } cache->items[i] = NULL; } @@ -134,9 +134,9 @@ _mesa_new_program_cache(void) if (cache) { cache->size = 17; cache->items = (struct cache_item **) - _mesa_calloc(cache->size * sizeof(struct cache_item)); + calloc(1, cache->size * sizeof(struct cache_item)); if (!cache->items) { - _mesa_free(cache); + free(cache); return NULL; } } @@ -148,8 +148,8 @@ void _mesa_delete_program_cache(GLcontext *ctx, struct gl_program_cache *cache) { clear_cache(ctx, cache); - _mesa_free(cache->items); - _mesa_free(cache); + free(cache->items); + free(cache); } @@ -188,7 +188,7 @@ _mesa_program_cache_insert(GLcontext *ctx, c->hash = hash; - c->key = _mesa_malloc(keysize); + c->key = malloc(keysize); memcpy(c->key, key, keysize); c->program = program; /* no refcount change */ diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 0c4da4d107..81099cb99c 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -70,7 +70,7 @@ struct prog_instruction * _mesa_alloc_instructions(GLuint numInst) { return (struct prog_instruction *) - _mesa_calloc(numInst * sizeof(struct prog_instruction)); + calloc(1, numInst * sizeof(struct prog_instruction)); } @@ -128,11 +128,11 @@ _mesa_free_instructions(struct prog_instruction *inst, GLuint count) GLuint i; for (i = 0; i < count; i++) { if (inst[i].Data) - _mesa_free(inst[i].Data); + free(inst[i].Data); if (inst[i].Comment) - _mesa_free((char *) inst[i].Comment); + free((char *) inst[i].Comment); } - _mesa_free(inst); + free(inst); } diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index e1ec52254c..09816d5044 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -237,7 +237,7 @@ _mesa_remove_dead_code(struct gl_program *prog) } removeInst = (GLboolean *) - _mesa_calloc(prog->NumInstructions * sizeof(GLboolean)); + calloc(1, prog->NumInstructions * sizeof(GLboolean)); /* Determine which temps are read and written */ for (i = 0; i < prog->NumInstructions; i++) { @@ -347,7 +347,7 @@ _mesa_remove_dead_code(struct gl_program *prog) } done: - _mesa_free(removeInst); + free(removeInst); } @@ -538,7 +538,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) } removeInst = (GLboolean *) - _mesa_calloc(prog->NumInstructions * sizeof(GLboolean)); + calloc(1, prog->NumInstructions * sizeof(GLboolean)); /* * Look for sequences such as this: @@ -621,7 +621,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) /* now remove the instructions which aren't needed */ rem = remove_instructions(prog, removeInst); - _mesa_free(removeInst); + free(removeInst); if (dbg) { _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem); diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 1feb7bd71d..25bb4f3d44 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -54,16 +54,16 @@ _mesa_new_parameter_list_sized(unsigned size) /* alloc arrays */ p->Parameters = (struct gl_program_parameter *) - _mesa_calloc(size * sizeof(struct gl_program_parameter)); + calloc(1, size * sizeof(struct gl_program_parameter)); p->ParameterValues = (GLfloat (*)[4]) _mesa_align_malloc(size * 4 *sizeof(GLfloat), 16); if ((p->Parameters == NULL) || (p->ParameterValues == NULL)) { - _mesa_free(p->Parameters); + free(p->Parameters); _mesa_align_free(p->ParameterValues); - _mesa_free(p); + free(p); p = NULL; } } @@ -81,12 +81,12 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) GLuint i; for (i = 0; i < paramList->NumParameters; i++) { if (paramList->Parameters[i].Name) - _mesa_free((void *) paramList->Parameters[i].Name); + free((void *) paramList->Parameters[i].Name); } - _mesa_free(paramList->Parameters); + free(paramList->Parameters); if (paramList->ParameterValues) _mesa_align_free(paramList->ParameterValues); - _mesa_free(paramList); + free(paramList); } @@ -486,7 +486,7 @@ _mesa_add_state_reference(struct gl_program_parameter_list *paramList, paramList->StateFlags |= _mesa_program_state_flags(stateTokens); /* free name string here since we duplicated it in add_parameter() */ - _mesa_free(name); + free(name); return index; } diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 54fd88ad4f..b238537673 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -309,7 +309,7 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, = prog->Parameters->Parameters + index; char *state = _mesa_program_state_string(param->StateIndexes); _mesa_sprintf(str, state); - _mesa_free(state); + free(state); } break; case PROGRAM_ADDRESS: diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index f5264fa918..2c844490dd 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -957,7 +957,7 @@ append_index(char *dst, GLint index) /** * Make a string from the given state vector. * For example, return "state.matrix.texture[2].inverse". - * Use _mesa_free() to deallocate the string. + * Use free() to deallocate the string. */ char * _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) diff --git a/src/mesa/shader/prog_uniform.c b/src/mesa/shader/prog_uniform.c index a831ce8cb6..c408a8492c 100644 --- a/src/mesa/shader/prog_uniform.c +++ b/src/mesa/shader/prog_uniform.c @@ -45,10 +45,10 @@ _mesa_free_uniform_list(struct gl_uniform_list *list) { GLuint i; for (i = 0; i < list->NumUniforms; i++) { - _mesa_free((void *) list->Uniforms[i].Name); + free((void *) list->Uniforms[i].Name); } - _mesa_free(list->Uniforms); - _mesa_free(list); + free(list->Uniforms); + free(list); } diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 0c3c5ffbd5..f4f701b546 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -127,11 +127,11 @@ _mesa_free_program_data(GLcontext *ctx) if (ctx->ATIFragmentShader.Current) { ctx->ATIFragmentShader.Current->RefCount--; if (ctx->ATIFragmentShader.Current->RefCount <= 0) { - _mesa_free(ctx->ATIFragmentShader.Current); + free(ctx->ATIFragmentShader.Current); } } #endif - _mesa_free((void *) ctx->Program.ErrorString); + free((void *) ctx->Program.ErrorString); } @@ -162,7 +162,7 @@ _mesa_update_default_objects_program(GLcontext *ctx) if (ctx->ATIFragmentShader.Current) { ctx->ATIFragmentShader.Current->RefCount--; if (ctx->ATIFragmentShader.Current->RefCount <= 0) { - _mesa_free(ctx->ATIFragmentShader.Current); + free(ctx->ATIFragmentShader.Current); } } ctx->ATIFragmentShader.Current = (struct ati_fragment_shader *) ctx->Shared->DefaultFragmentShader; @@ -180,7 +180,7 @@ void _mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string) { ctx->Program.ErrorPos = pos; - _mesa_free((void *) ctx->Program.ErrorString); + free((void *) ctx->Program.ErrorString); if (!string) string = ""; ctx->Program.ErrorString = _mesa_strdup(string); @@ -190,7 +190,7 @@ _mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string) /** * Find the line number and column for 'pos' within 'string'. * Return a copy of the line which contains 'pos'. Free the line with - * _mesa_free(). + * free(). * \param string the program string * \param pos the position within the string * \param line returns the line number corresponding to 'pos'. @@ -222,7 +222,7 @@ _mesa_find_line_column(const GLubyte *string, const GLubyte *pos, while (*p != 0 && *p != '\n') p++; len = p - lineStart; - s = (GLubyte *) _mesa_malloc(len + 1); + s = (GLubyte *) malloc(len + 1); memcpy(s, lineStart, len); s[len] = 0; @@ -337,7 +337,7 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) return; if (prog->String) - _mesa_free(prog->String); + free(prog->String); _mesa_free_instructions(prog->Instructions, prog->NumInstructions); @@ -351,7 +351,7 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_free_parameter_list(prog->Attributes); } - _mesa_free(prog); + free(prog); } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 182ef4c26d..e5ef25ec38 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -3140,7 +3140,7 @@ yyreduce: ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -3166,7 +3166,7 @@ yyreduce: ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -4547,7 +4547,7 @@ yyreduce: ? err_str : "invalid storage size specifier"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -5403,7 +5403,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list, param_list->StateFlags |= _mesa_program_state_flags(tokens); /* free name string here since we duplicated it in add_parameter() */ - _mesa_free(name); + free(name); return index; } @@ -5568,7 +5568,7 @@ make_error_string(const char *fmt, ...) */ length = 1 + vsnprintf(NULL, 0, fmt, args); - str = _mesa_malloc(length); + str = malloc(length); if (str) { vsnprintf(str, length, fmt, args); } @@ -5588,7 +5588,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) err_str = make_error_string("glProgramStringARB(%s)\n", s); if (err_str) { _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str); - _mesa_free(err_str); + free(err_str); } err_str = make_error_string("line %u, char %u: error: %s\n", @@ -5596,7 +5596,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) _mesa_set_program_error(state->ctx, locp->position, err_str); if (err_str) { - _mesa_free(err_str); + free(err_str); } } @@ -5618,7 +5618,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, /* Make a copy of the program string and force it to be NUL-terminated. */ - strz = (GLubyte *) _mesa_malloc(len + 1); + strz = (GLubyte *) malloc(len + 1); if (strz == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; @@ -5706,7 +5706,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, error: for (inst = state->inst_head; inst != NULL; inst = temp) { temp = inst->next; - _mesa_free(inst); + free(inst); } state->inst_head = NULL; @@ -5715,8 +5715,8 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; - _mesa_free((void *) sym->name); - _mesa_free(sym); + free((void *) sym->name); + free(sym); } state->sym = NULL; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 577bd2c38d..299e2477e4 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1056,7 +1056,7 @@ ccMaskRule: IDENTIFIER ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -1079,7 +1079,7 @@ ccMaskRule2: USED_IDENTIFIER ? err_str : "invalid condition code"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -1956,7 +1956,7 @@ optVarSize: string ? err_str : "invalid storage size specifier"); if (err_str != NULL) { - _mesa_free(err_str); + free(err_str); } YYERROR; @@ -2442,7 +2442,7 @@ int add_state_reference(struct gl_program_parameter_list *param_list, param_list->StateFlags |= _mesa_program_state_flags(tokens); /* free name string here since we duplicated it in add_parameter() */ - _mesa_free(name); + free(name); return index; } @@ -2607,7 +2607,7 @@ make_error_string(const char *fmt, ...) */ length = 1 + vsnprintf(NULL, 0, fmt, args); - str = _mesa_malloc(length); + str = malloc(length); if (str) { vsnprintf(str, length, fmt, args); } @@ -2627,7 +2627,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) err_str = make_error_string("glProgramStringARB(%s)\n", s); if (err_str) { _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str); - _mesa_free(err_str); + free(err_str); } err_str = make_error_string("line %u, char %u: error: %s\n", @@ -2635,7 +2635,7 @@ yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) _mesa_set_program_error(state->ctx, locp->position, err_str); if (err_str) { - _mesa_free(err_str); + free(err_str); } } @@ -2657,7 +2657,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, /* Make a copy of the program string and force it to be NUL-terminated. */ - strz = (GLubyte *) _mesa_malloc(len + 1); + strz = (GLubyte *) malloc(len + 1); if (strz == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); return GL_FALSE; @@ -2745,7 +2745,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, error: for (inst = state->inst_head; inst != NULL; inst = temp) { temp = inst->next; - _mesa_free(inst); + free(inst); } state->inst_head = NULL; @@ -2754,8 +2754,8 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; - _mesa_free((void *) sym->name); - _mesa_free(sym); + free((void *) sym->name); + free(sym); } state->sym = NULL; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 7e2a60f74b..ad3ff26c58 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -115,12 +115,12 @@ _mesa_free_shader_program_data(GLcontext *ctx, shProg->NumShaders = 0; if (shProg->Shaders) { - _mesa_free(shProg->Shaders); + free(shProg->Shaders); shProg->Shaders = NULL; } if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); + free(shProg->InfoLog); shProg->InfoLog = NULL; } } @@ -134,7 +134,7 @@ _mesa_free_shader_program(GLcontext *ctx, struct gl_shader_program *shProg) { _mesa_free_shader_program_data(ctx, shProg); - _mesa_free(shProg); + free(shProg); } @@ -262,11 +262,11 @@ void _mesa_free_shader(GLcontext *ctx, struct gl_shader *sh) { if (sh->Source) - _mesa_free((void *) sh->Source); + free((void *) sh->Source); if (sh->InfoLog) - _mesa_free(sh->InfoLog); + free(sh->InfoLog); _mesa_reference_program(ctx, &sh->Program, NULL); - _mesa_free(sh); + free(sh); } @@ -709,7 +709,7 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) /* alloc new, smaller array */ newList = (struct gl_shader **) - _mesa_malloc((n - 1) * sizeof(struct gl_shader *)); + malloc((n - 1) * sizeof(struct gl_shader *)); if (!newList) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDetachShader"); return; @@ -719,7 +719,7 @@ _mesa_detach_shader(GLcontext *ctx, GLuint program, GLuint shader) } while (++i < n) newList[j++] = shProg->Shaders[i]; - _mesa_free(shProg->Shaders); + free(shProg->Shaders); shProg->Shaders = newList; shProg->NumShaders = n - 1; @@ -1377,7 +1377,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) if (c) { /* truncate name at [ */ const GLint len = c - name; - GLchar *newName = _mesa_malloc(len + 1); + GLchar *newName = malloc(len + 1); if (!newName) return -1; /* out of mem */ memcpy(newName, name, len); @@ -1400,7 +1400,7 @@ _mesa_get_uniform_location(GLcontext *ctx, GLuint program, const GLchar *name) } } - _mesa_free(newName); + free(newName); } } @@ -1431,7 +1431,7 @@ _mesa_shader_source(GLcontext *ctx, GLuint shader, const GLchar *source) /* free old shader source string and install new one */ if (sh->Source) { - _mesa_free((void *) sh->Source); + free((void *) sh->Source); } sh->Source = source; sh->CompileStatus = GL_FALSE; @@ -2155,7 +2155,7 @@ _mesa_validate_program(GLcontext *ctx, GLuint program) if (!shProg->Validated) { /* update info log */ if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); + free(shProg->InfoLog); } shProg->InfoLog = _mesa_strdup(errMsg); } diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 2280ceb9ee..6901b93d5d 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3639,7 +3639,7 @@ make_constant_array(slang_assemble_ctx *A, assert(initializer->type == SLANG_OPER_CALL); assert(initializer->array_constructor); - values = (GLfloat *) _mesa_malloc(numElements * 4 * sizeof(GLfloat)); + values = (GLfloat *) malloc(numElements * 4 * sizeof(GLfloat)); /* convert constructor params into ordinary floats */ for (i = 0; i < numElements; i++) { @@ -3670,7 +3670,7 @@ make_constant_array(slang_assemble_ctx *A, } assert(var->store->Size == size); - _mesa_free(values); + free(values); return GL_TRUE; } @@ -5321,7 +5321,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) /* free codegen context */ /* - _mesa_free(A->codegen); + free(A->codegen); */ return success; diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 41d51cd98a..4280698cc9 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2948,7 +2948,7 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) /* free shader's prev info log */ if (shader->InfoLog) { - _mesa_free(shader->InfoLog); + free(shader->InfoLog); shader->InfoLog = NULL; } diff --git a/src/mesa/shader/slang/slang_compile_variable.c b/src/mesa/shader/slang/slang_compile_variable.c index eab912710e..23c08a9039 100644 --- a/src/mesa/shader/slang/slang_compile_variable.c +++ b/src/mesa/shader/slang/slang_compile_variable.c @@ -182,7 +182,7 @@ slang_variable_destruct(slang_variable * var) } #if 0 if (var->aux) { - _mesa_free(var->aux); + free(var->aux); } #endif } diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index b621e892c3..8bd699ff9d 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2528,7 +2528,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) GLuint *subroutineLoc, i, total; subroutineLoc - = (GLuint *) _mesa_malloc(emitInfo->NumSubroutines * sizeof(GLuint)); + = (GLuint *) malloc(emitInfo->NumSubroutines * sizeof(GLuint)); /* total number of instructions */ total = mainP->NumInstructions; @@ -2566,7 +2566,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) /* free subroutine list */ if (emitInfo->Subroutines) { - _mesa_free(emitInfo->Subroutines); + free(emitInfo->Subroutines); emitInfo->Subroutines = NULL; } emitInfo->NumSubroutines = 0; @@ -2585,7 +2585,7 @@ _slang_resolve_subroutines(slang_emit_info *emitInfo) } } - _mesa_free(subroutineLoc); + free(subroutineLoc); } diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c index 1240621365..7e00b5787f 100644 --- a/src/mesa/shader/slang/slang_label.c +++ b/src/mesa/shader/slang/slang_label.c @@ -34,7 +34,7 @@ _slang_label_new_unique(const char *name) if (l) { l->Name = (char *) _slang_alloc(strlen(name) + 10); if (!l->Name) { - _mesa_free(l); + free(l); return NULL; } _mesa_sprintf(l->Name, "%s_%d", name, id); diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 68129d4c5a..89658c1a39 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -68,7 +68,7 @@ static void link_error(struct gl_shader_program *shProg, const char *msg) { if (shProg->InfoLog) { - _mesa_free(shProg->InfoLog); + free(shProg->InfoLog); } shProg->InfoLog = _mesa_strdup(msg); shProg->LinkStatus = GL_FALSE; @@ -103,7 +103,7 @@ link_varying_vars(GLcontext *ctx, GLuint *map, i, firstVarying, newFile; GLbitfield *inOutFlags; - map = (GLuint *) _mesa_malloc(prog->Varying->NumParameters * sizeof(GLuint)); + map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint)); if (!map) return GL_FALSE; @@ -134,7 +134,7 @@ link_varying_vars(GLcontext *ctx, &shProg->Varying->Parameters[j]; if (var->Size != v->Size) { link_error(shProg, "mismatched varying variable types"); - _mesa_free(map); + free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { @@ -142,7 +142,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "centroid modifier mismatch for '%s'", var->Name); link_error(shProg, msg); - _mesa_free(map); + free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { @@ -150,7 +150,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "invariant modifier mismatch for '%s'", var->Name); link_error(shProg, msg); - _mesa_free(map); + free(map); return GL_FALSE; } } @@ -162,7 +162,7 @@ link_varying_vars(GLcontext *ctx, if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) { link_error(shProg, "Too many varying variables"); - _mesa_free(map); + free(map); return GL_FALSE; } @@ -202,7 +202,7 @@ link_varying_vars(GLcontext *ctx, } } - _mesa_free(map); + free(map); /* these will get recomputed before linking is completed */ prog->InputsRead = 0x0; @@ -594,7 +594,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) GLuint totalLen = 0, len = 0; GLuint i; - shaderLengths = (GLuint *)_mesa_malloc(shProg->NumShaders * sizeof(GLuint)); + shaderLengths = (GLuint *)malloc(shProg->NumShaders * sizeof(GLuint)); if (!shaderLengths) { return NULL; } @@ -611,13 +611,13 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) } if (totalLen == 0) { - _mesa_free(shaderLengths); + free(shaderLengths); return NULL; } - source = (GLchar *) _mesa_malloc(totalLen + 1); + source = (GLchar *) malloc(totalLen + 1); if (!source) { - _mesa_free(shaderLengths); + free(shaderLengths); return NULL; } @@ -634,13 +634,13 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); */ - _mesa_free(shaderLengths); + free(shaderLengths); remove_extra_version_directives(source); newShader = CALLOC_STRUCT(gl_shader); if (!newShader) { - _mesa_free(source); + free(source); return NULL; } diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index 4f6b8541c5..23917fbd2c 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -43,7 +43,7 @@ void slang_info_log_destruct(slang_info_log * log) { if (!log->dont_free_text) - _mesa_free(log->text); + free(log->text); } static int @@ -63,7 +63,7 @@ slang_info_log_message(slang_info_log * log, const char *prefix, _mesa_realloc(log->text, old_len + 1, old_len + size); } else { - log->text = (char *) (_mesa_malloc(size)); + log->text = (char *) (malloc(size)); if (log->text != NULL) log->text[0] = '\0'; } diff --git a/src/mesa/shader/slang/slang_mem.c b/src/mesa/shader/slang/slang_mem.c index 54f5196617..5eaa7c4427 100644 --- a/src/mesa/shader/slang/slang_mem.c +++ b/src/mesa/shader/slang/slang_mem.c @@ -56,12 +56,12 @@ struct slang_mempool_ slang_mempool * _slang_new_mempool(GLuint initialSize) { - slang_mempool *pool = (slang_mempool *) _mesa_calloc(sizeof(slang_mempool)); + slang_mempool *pool = (slang_mempool *) calloc(1, sizeof(slang_mempool)); if (pool) { - pool->Data = (char *) _mesa_calloc(initialSize); + pool->Data = (char *) calloc(1, initialSize); /*printf("ALLOC MEMPOOL %d at %p\n", initialSize, pool->Data);*/ if (!pool->Data) { - _mesa_free(pool); + free(pool); return NULL; } pool->Size = initialSize; @@ -82,8 +82,8 @@ _slang_delete_mempool(slang_mempool *pool) pool->Used, pool->Size, pool->Count, pool->Largest); */ total += pool->Used; - _mesa_free(pool->Data); - _mesa_free(pool); + free(pool->Data); + free(pool); pool = next; } /*printf("TOTAL ALLOCATED: %u\n", total);*/ @@ -125,7 +125,7 @@ void * _slang_alloc(GLuint bytes) { #if USE_MALLOC_FREE - return _mesa_calloc(bytes); + return calloc(1, bytes); #else slang_mempool *pool; GET_CURRENT_CONTEXT(ctx); @@ -231,7 +231,7 @@ void _slang_free(void *addr) { #if USE_MALLOC_FREE - _mesa_free(addr); + free(addr); #else if (addr) { GET_CURRENT_CONTEXT(ctx); diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index 56a33e6f6b..dc1e196bde 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -54,7 +54,7 @@ GLvoid slang_string_free (slang_string *self) { if (self->data != NULL) - _mesa_free (self->data); + free(self->data); } GLvoid diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c index 1f6d9b844d..6a5d686897 100644 --- a/src/mesa/shader/symbol_table.c +++ b/src/mesa/shader/symbol_table.c @@ -354,7 +354,7 @@ _mesa_symbol_table_dtor(struct _mesa_symbol_table *table) for (hdr = table->hdr; hdr != NULL; hdr = next) { next = hdr->next; - _mesa_free(hdr); + free(hdr); } hash_table_dtor(table->ht); diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 1be72e729e..33e43ddcc4 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -143,7 +143,7 @@ accum_accum(struct st_context *st, GLfloat value, PIPE_TRANSFER_READ, xpos, ypos, width, height); - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); @@ -165,7 +165,7 @@ accum_accum(struct st_context *st, GLfloat value, _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()"); } - _mesa_free(buf); + free(buf); screen->tex_transfer_destroy(color_trans); } @@ -192,7 +192,7 @@ accum_load(struct st_context *st, GLfloat value, PIPE_TRANSFER_READ, xpos, ypos, width, height); - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); @@ -214,7 +214,7 @@ accum_load(struct st_context *st, GLfloat value, _mesa_problem(NULL, "unexpected format in st_clear_accum_buffer()"); } - _mesa_free(buf); + free(buf); screen->tex_transfer_destroy(color_trans); } @@ -237,7 +237,7 @@ accum_return(GLcontext *ctx, GLfloat value, if (ST_DEBUG & DEBUG_FALLBACK) debug_printf("%s: fallback processing\n", __FUNCTION__); - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) usage = PIPE_TRANSFER_READ_WRITE; @@ -282,7 +282,7 @@ accum_return(GLcontext *ctx, GLfloat value, pipe_put_tile_rgba(color_trans, 0, 0, width, height, buf); - _mesa_free(buf); + free(buf); screen->tex_transfer_destroy(color_trans); } diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index e029ea7ffc..5968426a1d 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -837,7 +837,7 @@ st_destroy_bitmap(struct st_context *st) screen->tex_transfer_destroy(cache->trans); } pipe_texture_reference(&st->bitmap.cache->texture, NULL); - _mesa_free(st->bitmap.cache); + free(st->bitmap.cache); st->bitmap.cache = NULL; } } diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index c92af34378..b55a085cc7 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -80,7 +80,7 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj) if (st_obj->buffer) pipe_buffer_reference(&st_obj->buffer, NULL); - _mesa_free(st_obj); + free(st_obj); } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 36c0a2b0e1..4e86450edf 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -828,7 +828,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, ubyte *buffer; int i; - buffer = _mesa_malloc(width * height * sizeof(ubyte)); + buffer = malloc(width * height * sizeof(ubyte)); if (!buffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)"); return; @@ -907,7 +907,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } } - _mesa_free(buffer); + free(buffer); /* unmap the stencil buffer */ screen->transfer_unmap(screen, ptDraw); @@ -1089,19 +1089,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, if (type == GL_COLOR) { /* alternate path using get/put_tile() */ - GLfloat *buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); pipe_get_tile_rgba(ptRead, 0, 0, width, height, buf); pipe_put_tile_rgba(ptTex, 0, 0, width, height, buf); - _mesa_free(buf); + free(buf); } else { /* GL_DEPTH */ - GLuint *buf = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); + GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); pipe_get_tile_z(ptRead, 0, 0, width, height, buf); pipe_put_tile_z(ptTex, 0, 0, width, height, buf); - _mesa_free(buf); + free(buf); } screen->tex_transfer_destroy(ptRead); diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 4638879fc2..bfa8e21095 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -102,14 +102,14 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, if(strb->software) { size_t size; - _mesa_free(strb->data); + free(strb->data); assert(strb->format != PIPE_FORMAT_NONE); strb->stride = util_format_get_stride(strb->format, width); size = util_format_get_2d_size(strb->format, strb->stride, height); - strb->data = _mesa_malloc(size); + strb->data = malloc(size); return strb->data != NULL; } @@ -181,8 +181,8 @@ st_renderbuffer_delete(struct gl_renderbuffer *rb) ASSERT(strb); pipe_surface_reference(&strb->surface, NULL); pipe_texture_reference(&strb->texture, NULL); - _mesa_free(strb->data); - _mesa_free(strb); + free(strb->data); + free(strb); } @@ -286,7 +286,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) default: _mesa_problem(NULL, "Unexpected format in st_new_renderbuffer_fb"); - _mesa_free(strb); + free(strb); return NULL; } diff --git a/src/mesa/state_tracker/st_cb_queryobj.c b/src/mesa/state_tracker/st_cb_queryobj.c index dc40c5d269..c66729b124 100644 --- a/src/mesa/state_tracker/st_cb_queryobj.c +++ b/src/mesa/state_tracker/st_cb_queryobj.c @@ -69,7 +69,7 @@ st_DeleteQuery(GLcontext *ctx, struct gl_query_object *q) stq->pq = NULL; } - _mesa_free(stq); + free(stq); } diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c index 4692891c8a..752b411b5f 100644 --- a/src/mesa/state_tracker/st_cb_rasterpos.c +++ b/src/mesa/state_tracker/st_cb_rasterpos.c @@ -101,7 +101,7 @@ rastpos_line( struct draw_stage *stage, struct prim_header *prim ) static void rastpos_destroy(struct draw_stage *stage) { - _mesa_free(stage); + free(stage); } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 13f050900a..7e50e2ab2d 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1319,7 +1319,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, else { /* RGBA format */ GLfloat *tempSrc = - (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (tempSrc && texDest) { const GLint dims = 2; @@ -1359,7 +1359,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, } if (tempSrc) - _mesa_free(tempSrc); + free(tempSrc); } st_texture_image_unmap(ctx->st, stImage); diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 5b3987d73a..de8beaf5e2 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -222,7 +222,7 @@ static void st_destroy_context_priv( struct st_context *st ) st->default_texture = NULL; } - _mesa_free( st ); + free( st ); } @@ -257,7 +257,7 @@ void st_destroy_context( struct st_context *st ) pipe->destroy( pipe ); - _mesa_free(ctx); + free(ctx); } diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 50e98d7146..13b7b0e22d 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -239,7 +239,7 @@ st_fb_orientation(const struct gl_framebuffer *fb) /** clear-alloc a struct-sized object, with casting */ -#define ST_CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T)) +#define ST_CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T)) extern int diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 537a6a8648..807d21a719 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -1055,7 +1055,7 @@ out: /** - * Tokens cannot be free with _mesa_free otherwise the builtin gallium + * Tokens cannot be free with free otherwise the builtin gallium * malloc debugging will get confused. */ void diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index f73ac78ae2..753f3136f5 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -198,14 +198,14 @@ blit_nearest(GLcontext *ctx, } /* allocate the src/dst row buffers */ - srcBuffer = _mesa_malloc(pixelSize * srcWidth); + srcBuffer = malloc(pixelSize * srcWidth); if (!srcBuffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } - dstBuffer = _mesa_malloc(pixelSize * dstWidth); + dstBuffer = malloc(pixelSize * dstWidth); if (!dstBuffer) { - _mesa_free(srcBuffer); + free(srcBuffer); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } @@ -235,8 +235,8 @@ blit_nearest(GLcontext *ctx, drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL); } - _mesa_free(srcBuffer); - _mesa_free(dstBuffer); + free(srcBuffer); + free(dstBuffer); } @@ -366,21 +366,21 @@ blit_linear(GLcontext *ctx, /* Allocate the src/dst row buffers. * Keep two adjacent src rows around for bilinear sampling. */ - srcBuffer0 = _mesa_malloc(pixelSize * srcWidth); + srcBuffer0 = malloc(pixelSize * srcWidth); if (!srcBuffer0) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } - srcBuffer1 = _mesa_malloc(pixelSize * srcWidth); + srcBuffer1 = malloc(pixelSize * srcWidth); if (!srcBuffer1) { - _mesa_free(srcBuffer0); + free(srcBuffer0); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } - dstBuffer = _mesa_malloc(pixelSize * dstWidth); + dstBuffer = malloc(pixelSize * dstWidth); if (!dstBuffer) { - _mesa_free(srcBuffer0); - _mesa_free(srcBuffer1); + free(srcBuffer0); + free(srcBuffer1); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; } @@ -444,9 +444,9 @@ blit_linear(GLcontext *ctx, drawRb->PutRow(ctx, drawRb, dstWidth, dstXpos, dstY, dstBuffer, NULL); } - _mesa_free(srcBuffer0); - _mesa_free(srcBuffer1); - _mesa_free(dstBuffer); + free(srcBuffer0); + free(srcBuffer1); + free(dstBuffer); } @@ -535,7 +535,7 @@ simple_blit(GLcontext *ctx, } /* allocate the row buffer */ - rowBuffer = _mesa_malloc(bytesPerRow); + rowBuffer = malloc(bytesPerRow); if (!rowBuffer) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBlitFrameBufferEXT"); return; @@ -548,7 +548,7 @@ simple_blit(GLcontext *ctx, dstY += yStep; } - _mesa_free(rowBuffer); + free(rowBuffer); } diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index b69be50f51..3f37c027e4 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -114,14 +114,14 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.arrayAttribs = FRAG_BIT_COL0; /* allocate space for GLfloat image */ - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); return; } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tmpImage); + free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); return; } @@ -150,7 +150,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, ASSERT(ctx->Pixel.Separable2DEnabled); _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); } - _mesa_free(tmpImage); + free(tmpImage); /* do remaining post-convolution image transfer ops */ for (row = 0; row < height; row++) { @@ -185,7 +185,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.array->ChanType = CHAN_TYPE; } - _mesa_free(convImage); + free(convImage); } @@ -246,7 +246,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ if (overlapping) { - tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4); + tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat) * 4); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -303,7 +303,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, span.array->ChanType = CHAN_TYPE; /* restore */ if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -352,7 +352,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) { GLint ssy = sy; - tmpImage = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); + tmpImage = (GLuint *) malloc(width * height * sizeof(GLuint)); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -397,7 +397,7 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -487,7 +487,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) { GLint ssy = sy; - tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * sizeof(GLfloat)); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -537,7 +537,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -584,7 +584,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, if (overlapping) { GLint ssy = sy; - tmpImage = (GLstencil *) _mesa_malloc(width * height * sizeof(GLstencil)); + tmpImage = (GLstencil *) malloc(width * height * sizeof(GLstencil)); if (!tmpImage) { _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); return; @@ -626,7 +626,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy, } if (overlapping) - _mesa_free(tmpImage); + free(tmpImage); } @@ -688,7 +688,7 @@ copy_depth_stencil_pixels(GLcontext *ctx, if (stencilMask != 0x0) { tempStencilImage - = (GLstencil *) _mesa_malloc(width * height * sizeof(GLstencil)); + = (GLstencil *) malloc(width * height * sizeof(GLstencil)); if (!tempStencilImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); return; @@ -706,10 +706,10 @@ copy_depth_stencil_pixels(GLcontext *ctx, if (ctx->Depth.Mask) { tempDepthImage - = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat)); + = (GLfloat *) malloc(width * height * sizeof(GLfloat)); if (!tempDepthImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels"); - _mesa_free(tempStencilImage); + free(tempStencilImage); return; } @@ -799,10 +799,10 @@ copy_depth_stencil_pixels(GLcontext *ctx, } if (tempStencilImage) - _mesa_free(tempStencilImage); + free(tempStencilImage); if (tempDepthImage) - _mesa_free(tempDepthImage); + free(tempDepthImage); } diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 136c296e98..7571d5b8c0 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -566,14 +566,14 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, GLint row; GLfloat *dest, *tmpImage; - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); return; } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tmpImage); + free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels"); return; } @@ -597,7 +597,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, ASSERT(ctx->Pixel.Separable2DEnabled); _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); } - _mesa_free(tmpImage); + free(tmpImage); /* continue transfer ops and draw the convolved image */ unpack = &ctx->DefaultPacking; @@ -677,7 +677,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, } if (convImage) { - _mesa_free(convImage); + free(convImage); } } diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 94fb974eab..41911337b8 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -358,14 +358,14 @@ read_rgba_pixels( GLcontext *ctx, GLfloat *dest, *src, *tmpImage, *convImage; GLint row; - tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!tmpImage) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; } - convImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); if (!convImage) { - _mesa_free(tmpImage); + free(tmpImage); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; } @@ -399,7 +399,7 @@ read_rgba_pixels( GLcontext *ctx, ASSERT(ctx->Pixel.Separable2DEnabled); _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage); } - _mesa_free(tmpImage); + free(tmpImage); /* finish transfer ops and pack the resulting image */ src = convImage; @@ -412,7 +412,7 @@ read_rgba_pixels( GLcontext *ctx, transferOps & IMAGE_POST_CONVOLUTION_BITS); src += width * 4; } - _mesa_free(convImage); + free(convImage); } else { /* no convolution */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 149f693711..8a2787a139 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -41,7 +41,7 @@ static GLubyte *get_space(GLcontext *ctx, GLuint bytes) { TNLcontext *tnl = TNL_CONTEXT(ctx); - GLubyte *space = _mesa_malloc(bytes); + GLubyte *space = malloc(bytes); tnl->block[tnl->nr_blocks++] = space; return space; @@ -53,7 +53,7 @@ static void free_space(GLcontext *ctx) TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint i; for (i = 0; i < tnl->nr_blocks; i++) - _mesa_free(tnl->block[i]); + free(tnl->block[i]); tnl->nr_blocks = 0; } diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index 693d3dc118..61ac409573 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -152,7 +152,7 @@ alloc_normal_data(GLcontext *ctx, struct tnl_pipeline_stage *stage) TNLcontext *tnl = TNL_CONTEXT(ctx); struct normal_stage_data *store; - stage->privatePtr = _mesa_malloc(sizeof(*store)); + stage->privatePtr = malloc(sizeof(*store)); store = NORMAL_STAGE_DATA(stage); if (!store) return GL_FALSE; @@ -171,7 +171,7 @@ free_normal_data(struct tnl_pipeline_stage *stage) struct normal_stage_data *store = NORMAL_STAGE_DATA(stage); if (store) { _mesa_vector4f_free( &store->normal ); - _mesa_free( store ); + free( store ); stage->privatePtr = NULL; } } diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c index ab8ea60cf2..20634c80d1 100644 --- a/src/mesa/tnl/t_vb_points.c +++ b/src/mesa/tnl/t_vb_points.c @@ -81,7 +81,7 @@ alloc_point_data(GLcontext *ctx, struct tnl_pipeline_stage *stage) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct point_stage_data *store; - stage->privatePtr = _mesa_malloc(sizeof(*store)); + stage->privatePtr = malloc(sizeof(*store)); store = POINT_STAGE_DATA(stage); if (!store) return GL_FALSE; @@ -97,7 +97,7 @@ free_point_data(struct tnl_pipeline_stage *stage) struct point_stage_data *store = POINT_STAGE_DATA(stage); if (store) { _mesa_vector4f_free( &store->PointSize ); - _mesa_free( store ); + free( store ); stage->privatePtr = NULL; } } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index 2b8c962f06..ed66c35be7 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -88,7 +88,7 @@ void _tnl_register_fastpath( struct tnl_clipspace *vtx, fastpath->match_strides = match_strides; fastpath->func = vtx->emit; fastpath->attr = (struct tnl_attr_type *) - _mesa_malloc(vtx->attr_count * sizeof(fastpath->attr[0])); + malloc(vtx->attr_count * sizeof(fastpath->attr[0])); for (i = 0; i < vtx->attr_count; i++) { fastpath->attr[i].format = vtx->attr[i].format; diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index a284e4047f..f2f1674b6a 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -854,7 +854,7 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, return; } - prim = _mesa_calloc(primcount * sizeof(*prim)); + prim = calloc(1, primcount * sizeof(*prim)); if (prim == NULL) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements"); return; @@ -960,7 +960,7 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, } } - _mesa_free(prim); + free(prim); } diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index 55a82ee369..1db36de3de 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -134,7 +134,7 @@ void vbo_rebase_prims( GLcontext *ctx, /* If we can just tell the hardware or the TNL to interpret our * indices with a different base, do so. */ - tmp_prims = (struct _mesa_prim *)_mesa_malloc(sizeof(*prim) * nr_prims); + tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims); for (i = 0; i < nr_prims; i++) { tmp_prims[i] = prim[i]; @@ -187,7 +187,7 @@ void vbo_rebase_prims( GLcontext *ctx, else { /* Otherwise the primitives need adjustment. */ - tmp_prims = (struct _mesa_prim *)_mesa_malloc(sizeof(*prim) * nr_prims); + tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims); for (i = 0; i < nr_prims; i++) { /* If this fails, it could indicate an application error: @@ -229,10 +229,10 @@ void vbo_rebase_prims( GLcontext *ctx, max_index - min_index ); if (tmp_indices) - _mesa_free(tmp_indices); + free(tmp_indices); if (tmp_prims) - _mesa_free(tmp_prims); + free(tmp_prims); } diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 2ca111217c..2fae267ff5 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -466,7 +466,7 @@ replay_init( struct copy_context *copy ) switch (copy->ib->type) { case GL_UNSIGNED_BYTE: - copy->translated_elt_buf = _mesa_malloc(sizeof(GLuint) * copy->ib->count); + copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count); copy->srcelt = copy->translated_elt_buf; for (i = 0; i < copy->ib->count; i++) @@ -474,7 +474,7 @@ replay_init( struct copy_context *copy ) break; case GL_UNSIGNED_SHORT: - copy->translated_elt_buf = _mesa_malloc(sizeof(GLuint) * copy->ib->count); + copy->translated_elt_buf = malloc(sizeof(GLuint) * copy->ib->count); copy->srcelt = copy->translated_elt_buf; for (i = 0; i < copy->ib->count; i++) @@ -500,7 +500,7 @@ replay_init( struct copy_context *copy ) * * XXX: This should be a VBO! */ - copy->dstbuf = _mesa_malloc(copy->dstbuf_size * copy->vertex_size); + copy->dstbuf = malloc(copy->dstbuf_size * copy->vertex_size); copy->dstptr = copy->dstbuf; /* Setup new vertex arrays to point into the output buffer: @@ -529,7 +529,7 @@ replay_init( struct copy_context *copy ) copy->ib->count * 2 + 3); copy->dstelt_size = MIN2(copy->dstelt_size, copy->limits->max_indices); - copy->dstelt = _mesa_malloc(sizeof(GLuint) * copy->dstelt_size); + copy->dstelt = malloc(sizeof(GLuint) * copy->dstelt_size); copy->dstelt_nr = 0; /* Setup the new index buffer to point to the allocated element @@ -553,9 +553,9 @@ replay_finish( struct copy_context *copy ) /* Free our vertex and index buffers: */ - _mesa_free(copy->translated_elt_buf); - _mesa_free(copy->dstbuf); - _mesa_free(copy->dstelt); + free(copy->translated_elt_buf); + free(copy->dstbuf); + free(copy->dstelt); /* Unmap VBO's */ diff --git a/src/mesa/vf/vf.c b/src/mesa/vf/vf.c index 15a78c4c0a..dab436e2ab 100644 --- a/src/mesa/vf/vf.c +++ b/src/mesa/vf/vf.c @@ -86,7 +86,7 @@ void vf_register_fastpath( struct vertex_fetch *vf, fastpath->match_strides = match_strides; fastpath->func = vf->emit; fastpath->attr = (struct 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; -- cgit v1.2.3 From 298be2b028263b2c343a707662c6fbfa18293cb2 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 19 Feb 2010 12:32:24 -0500 Subject: Replace the _mesa_*printf() wrappers with the plain libc versions --- src/gallium/auxiliary/util/u_gen_mipmap.c | 2 +- src/gallium/drivers/cell/spu/spu_tri.c | 2 +- src/gallium/state_trackers/glx/xlib/glx_api.c | 8 +- src/gallium/state_trackers/glx/xlib/xm_api.c | 8 +- src/mesa/drivers/common/meta.c | 6 +- src/mesa/drivers/dri/i915/i915_context.c | 2 +- src/mesa/drivers/dri/i915/i915_debug.c | 178 ++++++------ src/mesa/drivers/dri/i915/i915_debug_fp.c | 80 +++--- src/mesa/drivers/dri/i915/i915_tex_layout.c | 4 +- src/mesa/drivers/dri/i915/intel_tris.c | 8 +- src/mesa/drivers/dri/i965/brw_context.c | 4 +- src/mesa/drivers/dri/i965/brw_curbe.c | 26 +- src/mesa/drivers/dri/i965/brw_draw.c | 4 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 +- src/mesa/drivers/dri/i965/brw_eu_debug.c | 14 +- src/mesa/drivers/dri/i965/brw_eu_emit.c | 4 +- src/mesa/drivers/dri/i965/brw_state_cache.c | 10 +- src/mesa/drivers/dri/i965/brw_urb.c | 6 +- src/mesa/drivers/dri/i965/brw_vs_emit.c | 14 +- src/mesa/drivers/dri/i965/brw_wm_debug.c | 68 ++--- src/mesa/drivers/dri/i965/brw_wm_emit.c | 12 +- src/mesa/drivers/dri/i965/brw_wm_fp.c | 14 +- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 10 +- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 4 +- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 4 +- src/mesa/drivers/dri/intel/intel_context.c | 2 +- src/mesa/drivers/dri/intel/intel_context.h | 2 +- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 4 +- src/mesa/drivers/dri/intel/intel_pixel_read.c | 14 +- src/mesa/drivers/dri/intel/intel_tex.c | 4 +- src/mesa/drivers/dri/nouveau/nouveau_driver.h | 2 +- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 2 +- src/mesa/drivers/dri/r300/r300_render.c | 2 +- src/mesa/drivers/dri/r300/r300_state.c | 2 +- src/mesa/drivers/dri/r600/r700_state.c | 2 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 2 +- src/mesa/drivers/dri/swrast/swrast_priv.h | 4 +- src/mesa/drivers/x11/fakeglx.c | 10 +- src/mesa/drivers/x11/xm_api.c | 12 +- src/mesa/drivers/x11/xm_tri.c | 92 +++---- src/mesa/glapi/gl_enums.py | 2 +- src/mesa/main/arrayobj.c | 10 +- src/mesa/main/bufferobj.c | 8 +- src/mesa/main/debug.c | 56 ++-- src/mesa/main/dlist.c | 130 ++++----- src/mesa/main/enums.c | 2 +- src/mesa/main/execmem.c | 2 +- src/mesa/main/fbobject.c | 50 ++-- src/mesa/main/ffvertex_prog.c | 8 +- src/mesa/main/imports.c | 67 +---- src/mesa/main/imports.h | 16 -- src/mesa/main/mipmap.c | 2 +- src/mesa/main/shaders.c | 2 +- src/mesa/main/state.c | 2 +- src/mesa/main/texenvprogram.c | 2 +- src/mesa/main/teximage.c | 4 +- src/mesa/main/texobj.c | 6 +- src/mesa/main/texstate.c | 38 +-- src/mesa/main/texstore.c | 20 +- src/mesa/main/varray.c | 18 +- src/mesa/main/version.c | 4 +- src/mesa/math/m_debug_clip.c | 44 +-- src/mesa/math/m_debug_norm.c | 34 +-- src/mesa/math/m_debug_xform.c | 32 +-- src/mesa/math/m_vector.c | 16 +- src/mesa/shader/arbprogparse.c | 4 +- src/mesa/shader/nvfragparse.c | 6 +- src/mesa/shader/nvvertparse.c | 6 +- src/mesa/shader/prog_execute.c | 4 +- src/mesa/shader/prog_instruction.c | 2 +- src/mesa/shader/prog_optimize.c | 62 ++--- src/mesa/shader/prog_print.c | 330 +++++++++++------------ src/mesa/shader/prog_statevars.c | 6 +- src/mesa/shader/program_parse.tab.c | 6 +- src/mesa/shader/program_parse.y | 6 +- src/mesa/shader/shader_api.c | 36 +-- src/mesa/shader/slang/slang_codegen.c | 4 +- src/mesa/shader/slang/slang_emit.c | 4 +- src/mesa/shader/slang/slang_label.c | 2 +- src/mesa/shader/slang/slang_link.c | 26 +- src/mesa/shader/slang/slang_log.c | 6 +- src/mesa/shader/slang/slang_utility.c | 2 +- src/mesa/state_tracker/st_atom.c | 10 +- src/mesa/swrast/s_lines.c | 2 +- src/mesa/tnl/t_draw.c | 10 +- src/mesa/tnl/t_vb_cliptmp.h | 16 +- src/mesa/tnl/t_vertex.c | 10 +- src/mesa/tnl/t_vertex_sse.c | 8 +- src/mesa/vbo/vbo_exec_api.c | 6 +- src/mesa/vbo/vbo_exec_array.c | 70 ++--- src/mesa/vbo/vbo_exec_draw.c | 32 +-- src/mesa/vbo/vbo_rebase.c | 2 +- src/mesa/vbo/vbo_save_api.c | 8 +- src/mesa/vbo/vbo_save_draw.c | 2 +- src/mesa/vbo/vbo_save_loopback.c | 12 +- src/mesa/vbo/vbo_split_copy.c | 36 +-- src/mesa/vf/vf.c | 10 +- src/mesa/vf/vf_sse.c | 8 +- src/mesa/x86/rtasm/x86sse.c | 2 +- 99 files changed, 951 insertions(+), 1032 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 4e358d3938..1d7329d422 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1069,7 +1069,7 @@ reduce_3d(enum pipe_format pformat, */ /* - _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n", + printf("mip3d %d x %d x %d -> %d x %d x %d\n", srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth); */ diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c index 58be001be4..f619380d80 100644 --- a/src/gallium/drivers/cell/spu/spu_tri.c +++ b/src/gallium/drivers/cell/spu/spu_tri.c @@ -752,7 +752,7 @@ subtriangle(struct edge *eleft, struct edge *eright, unsigned lines) finish_y -= sy; /* - _mesa_printf("%s %d %d\n", __FUNCTION__, start_y, finish_y); + printf("%s %d %d\n", __FUNCTION__, start_y, finish_y); */ for (y = start_y; y < finish_y; y++) { diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 0932569bd3..656a69131e 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -1679,8 +1679,8 @@ PUBLIC const char * glXQueryServerString( Display *dpy, int screen, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", - SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", + SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; (void) screen; @@ -1704,8 +1704,8 @@ PUBLIC const char * glXGetClientString( Display *dpy, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, - CLIENT_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, + CLIENT_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 61af663436..a274da0c62 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -550,10 +550,10 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, * reports bugs. */ if (_mesa_getenv("MESA_INFO")) { - _mesa_printf("X/Mesa visual = %p\n", (void *) v); - _mesa_printf("X/Mesa level = %d\n", v->mesa_visual.level); - _mesa_printf("X/Mesa depth = %d\n", v->visinfo->depth); - _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); + printf("X/Mesa visual = %p\n", (void *) v); + printf("X/Mesa level = %d\n", v->mesa_visual.level); + printf("X/Mesa depth = %d\n", v->visinfo->depth); + printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); } if (b && window) { diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 42ab7d4ed6..3aa70ddbf0 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1047,7 +1047,7 @@ init_blit_depth_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - _mesa_snprintf(program2, sizeof(program2), program, texTarget); + snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &blit->DepthFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); @@ -1670,7 +1670,7 @@ init_draw_stencil_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - _mesa_snprintf(program2, sizeof(program2), program, texTarget); + snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &drawpix->StencilFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->StencilFP); @@ -1704,7 +1704,7 @@ init_draw_depth_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - _mesa_snprintf(program2, sizeof(program2), program, texTarget); + snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &drawpix->DepthFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->DepthFP); diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index ed9a44ff24..4d86aae87d 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -108,7 +108,7 @@ i915CreateContext(const __GLcontextModes * mesaVis, return GL_FALSE; if (0) - _mesa_printf("\ntexmem-0-3 branch\n\n"); + printf("\ntexmem-0-3 branch\n\n"); i915InitVtbl(i915); diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index fecfac3033..4569fb918e 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -31,27 +31,25 @@ #include "i915_context.h" #include "i915_debug.h" -#define PRINTF( ... ) _mesa_printf( __VA_ARGS__ ) - static GLboolean debug( struct debug_stream *stream, const char *name, GLuint len ) { GLuint i; GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); if (len == 0) { - PRINTF("Error - zero length packet (0x%08x)\n", stream->ptr[0]); + printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); return GL_FALSE; } if (stream->print_addresses) - PRINTF("%08x: ", stream->offset); + printf("%08x: ", stream->offset); - PRINTF("%s (%d dwords):\n", name, len); + printf("%s (%d dwords):\n", name, len); for (i = 0; i < len; i++) - PRINTF("\t0x%08x\n", ptr[i]); - PRINTF("\n"); + printf("\t0x%08x\n", ptr[i]); + printf("\n"); stream->offset += len * sizeof(GLuint); @@ -88,17 +86,17 @@ static GLboolean debug_prim( struct debug_stream *stream, const char *name, - PRINTF("%s %s (%d dwords):\n", name, prim, len); - PRINTF("\t0x%08x\n", ptr[0]); + printf("%s %s (%d dwords):\n", name, prim, len); + printf("\t0x%08x\n", ptr[0]); for (i = 1; i < len; i++) { if (dump_floats) - PRINTF("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]); + printf("\t0x%08x // %f\n", ptr[i], *(GLfloat *)&ptr[i]); else - PRINTF("\t0x%08x\n", ptr[i]); + printf("\t0x%08x\n", ptr[i]); } - PRINTF("\n"); + printf("\n"); stream->offset += len * sizeof(GLuint); @@ -113,15 +111,15 @@ static GLboolean debug_program( struct debug_stream *stream, const char *name, G GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); if (len == 0) { - PRINTF("Error - zero length packet (0x%08x)\n", stream->ptr[0]); + printf("Error - zero length packet (0x%08x)\n", stream->ptr[0]); assert(0); return GL_FALSE; } if (stream->print_addresses) - PRINTF("%08x: ", stream->offset); + printf("%08x: ", stream->offset); - PRINTF("%s (%d dwords):\n", name, len); + printf("%s (%d dwords):\n", name, len); i915_disassemble_program( ptr, len ); stream->offset += len * sizeof(GLuint); @@ -135,17 +133,17 @@ static GLboolean debug_chain( struct debug_stream *stream, const char *name, GLu GLuint old_offset = stream->offset + len * sizeof(GLuint); GLuint i; - PRINTF("%s (%d dwords):\n", name, len); + printf("%s (%d dwords):\n", name, len); for (i = 0; i < len; i++) - PRINTF("\t0x%08x\n", ptr[i]); + printf("\t0x%08x\n", ptr[i]); stream->offset = ptr[1] & ~0x3; if (stream->offset < old_offset) - PRINTF("\n... skipping backwards from 0x%x --> 0x%x ...\n\n", + printf("\n... skipping backwards from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); else - PRINTF("\n... skipping from 0x%x --> 0x%x ...\n\n", + printf("\n... skipping from 0x%x --> 0x%x ...\n\n", old_offset, stream->offset ); @@ -165,10 +163,10 @@ static GLboolean debug_variable_length_prim( struct debug_stream *stream ) len = 1+(i+2)/2; - PRINTF("3DPRIM, %s variable length %d indicies (%d dwords):\n", prim, i, len); + printf("3DPRIM, %s variable length %d indicies (%d dwords):\n", prim, i, len); for (i = 0; i < len; i++) - PRINTF("\t0x%08x\n", ptr[i]); - PRINTF("\n"); + printf("\t0x%08x\n", ptr[i]); + printf("\n"); stream->offset += len * sizeof(GLuint); return GL_TRUE; @@ -178,9 +176,9 @@ static GLboolean debug_variable_length_prim( struct debug_stream *stream ) #define BITS( dw, hi, lo, ... ) \ do { \ unsigned himask = 0xffffffffU >> (31 - (hi)); \ - PRINTF("\t\t "); \ - PRINTF(__VA_ARGS__); \ - PRINTF(": 0x%x\n", ((dw) & himask) >> (lo)); \ + printf("\t\t "); \ + printf(__VA_ARGS__); \ + printf(": 0x%x\n", ((dw) & himask) >> (lo)); \ } while (0) #define MBZ( dw, hi, lo) do { \ @@ -194,9 +192,9 @@ do { \ #define FLAG( dw, bit, ... ) \ do { \ if (((dw) >> (bit)) & 1) { \ - PRINTF("\t\t "); \ - PRINTF(__VA_ARGS__); \ - PRINTF("\n"); \ + printf("\t\t "); \ + printf(__VA_ARGS__); \ + printf("\n"); \ } \ } while (0) @@ -208,17 +206,17 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, GLuint bits = (ptr[0] >> 4) & 0xff; GLuint j = 0; - PRINTF("%s (%d dwords, flags: %x):\n", name, len, bits); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords, flags: %x):\n", name, len, bits); + printf("\t0x%08x\n", ptr[j++]); if (bits & (1<<0)) { - PRINTF("\t LIS0: 0x%08x\n", ptr[j]); - PRINTF("\t vb address: 0x%08x\n", (ptr[j] & ~0x3)); + printf("\t LIS0: 0x%08x\n", ptr[j]); + printf("\t vb address: 0x%08x\n", (ptr[j] & ~0x3)); BITS(ptr[j], 0, 0, "vb invalidate disable"); j++; } if (bits & (1<<1)) { - PRINTF("\t LIS1: 0x%08x\n", ptr[j]); + printf("\t LIS1: 0x%08x\n", ptr[j]); BITS(ptr[j], 29, 24, "vb dword width"); BITS(ptr[j], 21, 16, "vb dword pitch"); BITS(ptr[j], 15, 0, "vb max index"); @@ -226,7 +224,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, } if (bits & (1<<2)) { int i; - PRINTF("\t LIS2: 0x%08x\n", ptr[j]); + printf("\t LIS2: 0x%08x\n", ptr[j]); for (i = 0; i < 8; i++) { unsigned tc = (ptr[j] >> (i * 4)) & 0xf; if (tc != 0xf) @@ -235,11 +233,11 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, j++; } if (bits & (1<<3)) { - PRINTF("\t LIS3: 0x%08x\n", ptr[j]); + printf("\t LIS3: 0x%08x\n", ptr[j]); j++; } if (bits & (1<<4)) { - PRINTF("\t LIS4: 0x%08x\n", ptr[j]); + printf("\t LIS4: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 23, "point width"); BITS(ptr[j], 22, 19, "line width"); FLAG(ptr[j], 18, "alpha flatshade"); @@ -261,7 +259,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, j++; } if (bits & (1<<5)) { - PRINTF("\t LIS5: 0x%08x\n", ptr[j]); + printf("\t LIS5: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 28, "rgba write disables"); FLAG(ptr[j], 27, "force dflt point width"); FLAG(ptr[j], 26, "last pixel enable"); @@ -279,7 +277,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, j++; } if (bits & (1<<6)) { - PRINTF("\t LIS6: 0x%08x\n", ptr[j]); + printf("\t LIS6: 0x%08x\n", ptr[j]); FLAG(ptr[j], 31, "alpha test enable"); BITS(ptr[j], 30, 28, "alpha func"); BITS(ptr[j], 27, 20, "alpha ref"); @@ -296,7 +294,7 @@ static GLboolean debug_load_immediate( struct debug_stream *stream, } - PRINTF("\n"); + printf("\n"); assert(j == len); @@ -315,34 +313,34 @@ static GLboolean debug_load_indirect( struct debug_stream *stream, GLuint bits = (ptr[0] >> 8) & 0x3f; GLuint i, j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); for (i = 0; i < 6; i++) { if (bits & (1<ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); BR13(stream, ptr[j++]); BR2223(stream, ptr[j], ptr[j+1]); @@ -460,8 +458,8 @@ static GLboolean debug_color_blit( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); BR13(stream, ptr[j++]); BR2223(stream, ptr[j], ptr[j+1]); @@ -481,8 +479,8 @@ static GLboolean debug_modes4( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 21, 18, "logicop func"); FLAG(ptr[j], 17, "stencil test mask modify-enable"); FLAG(ptr[j], 16, "stencil write mask modify-enable"); @@ -502,26 +500,26 @@ static GLboolean debug_map_state( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 15, 0, "map mask"); j++; } while (j < len) { { - PRINTF("\t TMn.0: 0x%08x\n", ptr[j]); - PRINTF("\t map address: 0x%08x\n", (ptr[j] & ~0x3)); + printf("\t TMn.0: 0x%08x\n", ptr[j]); + printf("\t map address: 0x%08x\n", (ptr[j] & ~0x3)); FLAG(ptr[j], 1, "vertical line stride"); FLAG(ptr[j], 0, "vertical line stride offset"); j++; } { - PRINTF("\t TMn.1: 0x%08x\n", ptr[j]); + printf("\t TMn.1: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 21, "height"); BITS(ptr[j], 20, 10, "width"); BITS(ptr[j], 9, 7, "surface format"); @@ -532,7 +530,7 @@ static GLboolean debug_map_state( struct debug_stream *stream, j++; } { - PRINTF("\t TMn.2: 0x%08x\n", ptr[j]); + printf("\t TMn.2: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 21, "dword pitch"); BITS(ptr[j], 20, 15, "cube face enables"); BITS(ptr[j], 14, 9, "max lod"); @@ -554,18 +552,18 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 15, 0, "sampler mask"); j++; } while (j < len) { { - PRINTF("\t TSn.0: 0x%08x\n", ptr[j]); + printf("\t TSn.0: 0x%08x\n", ptr[j]); FLAG(ptr[j], 31, "reverse gamma"); FLAG(ptr[j], 30, "planar to packed"); FLAG(ptr[j], 29, "yuv->rgb"); @@ -582,7 +580,7 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, } { - PRINTF("\t TSn.1: 0x%08x\n", ptr[j]); + printf("\t TSn.1: 0x%08x\n", ptr[j]); BITS(ptr[j], 31, 24, "min lod"); MBZ( ptr[j], 23, 18 ); FLAG(ptr[j], 17, "kill pixel enable"); @@ -597,7 +595,7 @@ static GLboolean debug_sampler_state( struct debug_stream *stream, j++; } { - PRINTF("\t TSn.2: 0x%08x (default color)\n", ptr[j]); + printf("\t TSn.2: 0x%08x (default color)\n", ptr[j]); j++; } } @@ -614,11 +612,11 @@ static GLboolean debug_dest_vars( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); FLAG(ptr[j], 31, "early classic ztest"); FLAG(ptr[j], 30, "opengl tex default color"); FLAG(ptr[j], 29, "bypass iz"); @@ -649,11 +647,11 @@ static GLboolean debug_buf_info( struct debug_stream *stream, GLuint *ptr = (GLuint *)(stream->ptr + stream->offset); int j = 0; - PRINTF("%s (%d dwords):\n", name, len); - PRINTF("\t0x%08x\n", ptr[j++]); + printf("%s (%d dwords):\n", name, len); + printf("\t0x%08x\n", ptr[j++]); { - PRINTF("\t0x%08x\n", ptr[j]); + printf("\t0x%08x\n", ptr[j]); BITS(ptr[j], 28, 28, "aux buffer id"); BITS(ptr[j], 27, 24, "buffer id (7=depth, 3=back)"); FLAG(ptr[j], 23, "use fence regs"); @@ -665,7 +663,7 @@ static GLboolean debug_buf_info( struct debug_stream *stream, j++; } - PRINTF("\t0x%08x -- buffer base address\n", ptr[j++]); + printf("\t0x%08x -- buffer base address\n", ptr[j++]); stream->offset += len * sizeof(GLuint); assert(j == len); @@ -826,7 +824,7 @@ i915_dump_batchbuffer( GLuint *start, GLuint bytes = (end - start) * 4; GLboolean done = GL_FALSE; - PRINTF("\n\nBATCH: (%d)\n", bytes / 4); + printf("\n\nBATCH: (%d)\n", bytes / 4); stream.offset = 0; stream.ptr = (char *)start; @@ -843,7 +841,7 @@ i915_dump_batchbuffer( GLuint *start, stream.offset >= 0); } - PRINTF("END-BATCH\n\n\n"); + printf("END-BATCH\n\n\n"); } diff --git a/src/mesa/drivers/dri/i915/i915_debug_fp.c b/src/mesa/drivers/dri/i915/i915_debug_fp.c index bf500e54fa..adfc9e8945 100644 --- a/src/mesa/drivers/dri/i915/i915_debug_fp.c +++ b/src/mesa/drivers/dri/i915/i915_debug_fp.c @@ -31,8 +31,6 @@ #include "i915_debug.h" #include "main/imports.h" -#define PRINTF( ... ) _mesa_printf( __VA_ARGS__ ) - static const char *opcodes[0x20] = { "NOP", "ADD", @@ -123,27 +121,27 @@ print_reg_type_nr(GLuint type, GLuint nr) case REG_TYPE_T: switch (nr) { case T_DIFFUSE: - PRINTF("T_DIFFUSE"); + printf("T_DIFFUSE"); return; case T_SPECULAR: - PRINTF("T_SPECULAR"); + printf("T_SPECULAR"); return; case T_FOG_W: - PRINTF("T_FOG_W"); + printf("T_FOG_W"); return; default: - PRINTF("T_TEX%d", nr); + printf("T_TEX%d", nr); return; } case REG_TYPE_OC: if (nr == 0) { - PRINTF("oC"); + printf("oC"); return; } break; case REG_TYPE_OD: if (nr == 0) { - PRINTF("oD"); + printf("oD"); return; } break; @@ -151,7 +149,7 @@ print_reg_type_nr(GLuint type, GLuint nr) break; } - PRINTF("%s[%d]", regname[type], nr); + printf("%s[%d]", regname[type], nr); } #define REG_SWIZZLE_MASK 0x7777 @@ -172,33 +170,33 @@ print_reg_neg_swizzle(GLuint reg) (reg & REG_NEGATE_MASK) == 0) return; - PRINTF("."); + printf("."); for (i = 3; i >= 0; i--) { if (reg & (1 << ((i * 4) + 3))) - PRINTF("-"); + printf("-"); switch ((reg >> (i * 4)) & 0x7) { case 0: - PRINTF("x"); + printf("x"); break; case 1: - PRINTF("y"); + printf("y"); break; case 2: - PRINTF("z"); + printf("z"); break; case 3: - PRINTF("w"); + printf("w"); break; case 4: - PRINTF("0"); + printf("0"); break; case 5: - PRINTF("1"); + printf("1"); break; default: - PRINTF("?"); + printf("?"); break; } } @@ -223,15 +221,15 @@ print_dest_reg(GLuint dword) print_reg_type_nr(type, nr); if ((dword & A0_DEST_CHANNEL_ALL) == A0_DEST_CHANNEL_ALL) return; - PRINTF("."); + printf("."); if (dword & A0_DEST_CHANNEL_X) - PRINTF("x"); + printf("x"); if (dword & A0_DEST_CHANNEL_Y) - PRINTF("y"); + printf("y"); if (dword & A0_DEST_CHANNEL_Z) - PRINTF("z"); + printf("z"); if (dword & A0_DEST_CHANNEL_W) - PRINTF("w"); + printf("w"); } @@ -246,29 +244,29 @@ print_arith_op(GLuint opcode, const GLuint * program) if (opcode != A0_NOP) { print_dest_reg(program[0]); if (program[0] & A0_DEST_SATURATE) - PRINTF(" = SATURATE "); + printf(" = SATURATE "); else - PRINTF(" = "); + printf(" = "); } - PRINTF("%s ", opcodes[opcode]); + printf("%s ", opcodes[opcode]); print_src_reg(GET_SRC0_REG(program[0], program[1])); if (args[opcode] == 1) { - PRINTF("\n"); + printf("\n"); return; } - PRINTF(", "); + printf(", "); print_src_reg(GET_SRC1_REG(program[1], program[2])); if (args[opcode] == 2) { - PRINTF("\n"); + printf("\n"); return; } - PRINTF(", "); + printf(", "); print_src_reg(GET_SRC2_REG(program[2])); - PRINTF("\n"); + printf("\n"); return; } @@ -277,24 +275,24 @@ static void print_tex_op(GLuint opcode, const GLuint * program) { print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL); - PRINTF(" = "); + printf(" = "); - PRINTF("%s ", opcodes[opcode]); + printf("%s ", opcodes[opcode]); - PRINTF("S[%d],", program[0] & T0_SAMPLER_NR_MASK); + printf("S[%d],", program[0] & T0_SAMPLER_NR_MASK); print_reg_type_nr((program[1] >> T1_ADDRESS_REG_TYPE_SHIFT) & REG_TYPE_MASK, (program[1] >> T1_ADDRESS_REG_NR_SHIFT) & REG_NR_MASK); - PRINTF("\n"); + printf("\n"); } static void print_dcl_op(GLuint opcode, const GLuint * program) { - PRINTF("%s ", opcodes[opcode]); + printf("%s ", opcodes[opcode]); print_dest_reg(program[0] | A0_DEST_CHANNEL_ALL); - PRINTF("\n"); + printf("\n"); } @@ -304,7 +302,7 @@ i915_disassemble_program(const GLuint * program, GLuint sz) GLuint size = program[0] & 0x1ff; GLint i; - PRINTF("\t\tBEGIN\n"); + printf("\t\tBEGIN\n"); assert(size + 2 == sz); @@ -312,7 +310,7 @@ i915_disassemble_program(const GLuint * program, GLuint sz) for (i = 1; i < sz; i += 3, program += 3) { GLuint opcode = program[0] & (0x1f << 24); - PRINTF("\t\t"); + printf("\t\t"); if ((GLint) opcode >= A0_NOP && opcode <= A0_SLT) print_arith_op(opcode >> 24, program); @@ -321,10 +319,10 @@ i915_disassemble_program(const GLuint * program, GLuint sz) else if (opcode == D0_DCL) print_dcl_op(opcode >> 24, program); else - PRINTF("Unknown opcode 0x%x\n", opcode); + printf("Unknown opcode 0x%x\n", opcode); } - PRINTF("\t\tEND\n\n"); + printf("\t\tEND\n\n"); } diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c index d9588e5b56..fe3908f580 100644 --- a/src/mesa/drivers/dri/i915/i915_tex_layout.c +++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c @@ -145,8 +145,8 @@ i915_miptree_layout_cube(struct intel_context *intel, intel_miptree_set_image_offset(mt, level, face, x, y); if (d == 0) - _mesa_printf("cube mipmap %d/%d (%d..%d) is 0x0\n", - face, level, mt->first_level, mt->last_level); + printf("cube mipmap %d/%d (%d..%d) is 0x0\n", + face, level, mt->first_level, mt->last_level); d >>= 1; x += step_offsets[face][0] * d; diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 6d498c5654..3816adae94 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -66,7 +66,7 @@ intel_flush_inline_primitive(struct intel_context *intel) assert(intel->prim.primitive != ~0); -/* _mesa_printf("/\n"); */ +/* printf("/\n"); */ if (used < 8) goto do_discard; @@ -93,7 +93,7 @@ static void intel_start_inline(struct intel_context *intel, uint32_t prim) intel->no_batch_wrap = GL_TRUE; - /*_mesa_printf("%s *", __progname);*/ + /*printf("%s *", __progname);*/ /* Emit a slot which will be filled with the inline primitive * command later. @@ -111,7 +111,7 @@ static void intel_start_inline(struct intel_context *intel, uint32_t prim) ADVANCE_BATCH(); intel->no_batch_wrap = GL_FALSE; -/* _mesa_printf(">"); */ +/* printf(">"); */ } static void intel_wrap_inline(struct intel_context *intel) @@ -133,7 +133,7 @@ static GLuint *intel_extend_inline(struct intel_context *intel, GLuint dwords) if (intel_batchbuffer_space(intel->batch) < sz) intel_wrap_inline(intel); -/* _mesa_printf("."); */ +/* printf("."); */ intel->vtbl.assert_not_dirty(intel); diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 65f51be341..2ca29b7ae1 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -78,7 +78,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, GLcontext *ctx = &intel->ctx; if (!brw) { - _mesa_printf("%s: failed to alloc context\n", __FUNCTION__); + printf("%s: failed to alloc context\n", __FUNCTION__); return GL_FALSE; } @@ -87,7 +87,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, if (!intelInitContext( intel, mesaVis, driContextPriv, sharedContextPrivate, &functions )) { - _mesa_printf("%s: failed to init intel context\n", __FUNCTION__); + printf("%s: failed to init intel context\n", __FUNCTION__); FREE(brw); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index cb9cd836a0..6f2ead793d 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -114,13 +114,13 @@ static void calculate_curbe_offsets( struct brw_context *brw ) brw->curbe.total_size = reg; if (0) - _mesa_printf("curbe wm %d+%d clip %d+%d vs %d+%d\n", - brw->curbe.wm_start, - brw->curbe.wm_size, - brw->curbe.clip_start, - brw->curbe.clip_size, - brw->curbe.vs_start, - brw->curbe.vs_size ); + printf("curbe wm %d+%d clip %d+%d vs %d+%d\n", + brw->curbe.wm_start, + brw->curbe.wm_size, + brw->curbe.clip_start, + brw->curbe.clip_size, + brw->curbe.vs_start, + brw->curbe.vs_size ); brw->state.dirty.brw |= BRW_NEW_CURBE_OFFSETS; } @@ -280,13 +280,13 @@ static void prepare_constant_buffer(struct brw_context *brw) if (0) { for (i = 0; i < sz*16; i+=4) - _mesa_printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4, - buf[i+0], buf[i+1], buf[i+2], buf[i+3]); + printf("curbe %d.%d: %f %f %f %f\n", i/8, i&4, + buf[i+0], buf[i+1], buf[i+2], buf[i+3]); - _mesa_printf("last_buf %p buf %p sz %d/%d cmp %d\n", - brw->curbe.last_buf, buf, - bufsz, brw->curbe.last_bufsz, - brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1); + printf("last_buf %p buf %p sz %d/%d cmp %d\n", + brw->curbe.last_buf, buf, + bufsz, brw->curbe.last_bufsz, + brw->curbe.last_buf ? memcmp(buf, brw->curbe.last_buf, bufsz) : -1); } if (brw->curbe.curbe_bo != NULL && diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 976249091e..e348d4686b 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -82,7 +82,7 @@ static GLuint brw_set_prim(struct brw_context *brw, GLenum prim) GLcontext *ctx = &brw->intel.ctx; if (INTEL_DEBUG & DEBUG_PRIMS) - _mesa_printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim)); + printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim)); /* Slight optimization to avoid the GS program when not needed: */ @@ -125,7 +125,7 @@ static void brw_emit_prim(struct brw_context *brw, struct intel_context *intel = &brw->intel; if (INTEL_DEBUG & DEBUG_PRIMS) - _mesa_printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode), + printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode), prim->start, prim->count); prim_packet.header.opcode = CMD_3D_PRIM; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index ceaeb923b0..106454de4a 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -169,7 +169,7 @@ static GLuint get_surface_type( GLenum type, GLuint size, GLenum format, GLboolean normalized ) { if (INTEL_DEBUG & DEBUG_VERTS) - _mesa_printf("type %s size %d normalized %d\n", + printf("type %s size %d normalized %d\n", _mesa_lookup_enum_by_nr(type), size, normalized); if (normalized) { @@ -355,7 +355,7 @@ static void brw_prepare_vertices(struct brw_context *brw) /* First build an array of pointers to ve's in vb.inputs_read */ if (0) - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); + printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); /* Accumulate the list of enabled arrays. */ brw->vb.nr_enabled = 0; diff --git a/src/mesa/drivers/dri/i965/brw_eu_debug.c b/src/mesa/drivers/dri/i965/brw_eu_debug.c index 29f3f6d02f..99453afdca 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_debug.c +++ b/src/mesa/drivers/dri/i965/brw_eu_debug.c @@ -54,9 +54,9 @@ void brw_print_reg( struct brw_reg hwreg ) "f" }; - _mesa_printf("%s%s", - hwreg.abs ? "abs/" : "", - hwreg.negate ? "-" : ""); + printf("%s%s", + hwreg.abs ? "abs/" : "", + hwreg.negate ? "-" : ""); if (hwreg.file == BRW_GENERAL_REGISTER_FILE && hwreg.nr % 2 == 0 && @@ -66,7 +66,7 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.hstride == BRW_HORIZONTAL_STRIDE_1 && hwreg.type == BRW_REGISTER_TYPE_F) { /* vector register */ - _mesa_printf("vec%d", hwreg.nr); + printf("vec%d", hwreg.nr); } else if (hwreg.file == BRW_GENERAL_REGISTER_FILE && hwreg.vstride == BRW_VERTICAL_STRIDE_0 && @@ -74,13 +74,13 @@ void brw_print_reg( struct brw_reg hwreg ) hwreg.hstride == BRW_HORIZONTAL_STRIDE_0 && hwreg.type == BRW_REGISTER_TYPE_F) { /* "scalar" register */ - _mesa_printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); + printf("scl%d.%d", hwreg.nr, hwreg.subnr / 4); } else if (hwreg.file == BRW_IMMEDIATE_VALUE) { - _mesa_printf("imm %f", hwreg.dw1.f); + printf("imm %f", hwreg.dw1.f); } else { - _mesa_printf("%s%d.%d<%d;%d,%d>:%s", + printf("%s%d.%d<%d;%d,%d>:%s", file[hwreg.file], hwreg.nr, hwreg.subnr / type_sz(hwreg.type), diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 8d6ac00839..b832c7165d 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -1272,7 +1272,7 @@ void brw_SAMPLE(struct brw_compile *p, GLboolean need_stall = 0; if (writemask == 0) { - /*_mesa_printf("%s: zero writemask??\n", __FUNCTION__); */ + /*printf("%s: zero writemask??\n", __FUNCTION__); */ return; } @@ -1304,7 +1304,7 @@ void brw_SAMPLE(struct brw_compile *p, if (newmask != writemask) { need_stall = 1; - /* _mesa_printf("need stall %x %x\n", newmask , writemask); */ + /* printf("need stall %x %x\n", newmask , writemask); */ } else { struct brw_reg m1 = brw_message_reg(msg_reg_nr); diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index dd9894d681..4bb98d8d5d 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -266,7 +266,7 @@ brw_upload_cache_with_auxdata(struct brw_cache *cache, } if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("upload %s: %d bytes to cache id %d\n", + printf("upload %s: %d bytes to cache id %d\n", cache->name[cache_id], data_size, cache_id); @@ -425,7 +425,7 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache) GLuint i; if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); for (i = 0; i < cache->size; i++) { for (c = cache->items[i]; c; c = next) { @@ -465,7 +465,7 @@ brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo) GLuint i; if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); for (i = 0; i < cache->size; i++) { for (prev = &cache->items[i]; *prev;) { @@ -493,7 +493,7 @@ void brw_state_cache_check_size(struct brw_context *brw) { if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s (n_items=%d)\n", __FUNCTION__, brw->cache.n_items); + printf("%s (n_items=%d)\n", __FUNCTION__, brw->cache.n_items); /* un-tuned guess. We've got around 20 state objects for a total of around * 32k, so 1000 of them is around 1.5MB. @@ -512,7 +512,7 @@ brw_destroy_cache(struct brw_context *brw, struct brw_cache *cache) GLuint i; if (INTEL_DEBUG & DEBUG_STATE) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); brw_clear_cache(brw, cache); for (i = 0; i < BRW_MAX_CACHE; i++) { diff --git a/src/mesa/drivers/dri/i965/brw_urb.c b/src/mesa/drivers/dri/i965/brw_urb.c index f2cdb203b8..4f6b9002ad 100644 --- a/src/mesa/drivers/dri/i965/brw_urb.c +++ b/src/mesa/drivers/dri/i965/brw_urb.c @@ -186,17 +186,17 @@ static void recalculate_urb_fence( struct brw_context *brw ) * entries and the values for minimum nr of entries * provided above. */ - _mesa_printf("couldn't calculate URB layout!\n"); + printf("couldn't calculate URB layout!\n"); exit(1); } if (INTEL_DEBUG & (DEBUG_URB|DEBUG_FALLBACKS)) - _mesa_printf("URB CONSTRAINED\n"); + printf("URB CONSTRAINED\n"); } done: if (INTEL_DEBUG & DEBUG_URB) - _mesa_printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n", + printf("URB fence: %d ..VS.. %d ..GS.. %d ..CLP.. %d ..SF.. %d ..CS.. %d\n", brw->urb.vs_start, brw->urb.gs_start, brw->urb.clip_start, diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 4f4eef85e8..88327d9927 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -287,9 +287,9 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->prog_data.total_grf = reg; if (INTEL_DEBUG & DEBUG_VS) { - _mesa_printf("%s NumAddrRegs %d\n", __FUNCTION__, c->vp->program.Base.NumAddressRegs); - _mesa_printf("%s NumTemps %d\n", __FUNCTION__, c->vp->program.Base.NumTemporaries); - _mesa_printf("%s reg = %d\n", __FUNCTION__, reg); + printf("%s NumAddrRegs %d\n", __FUNCTION__, c->vp->program.Base.NumAddressRegs); + printf("%s NumTemps %d\n", __FUNCTION__, c->vp->program.Base.NumTemporaries); + printf("%s reg = %d\n", __FUNCTION__, reg); } } @@ -1444,9 +1444,9 @@ void brw_vs_emit(struct brw_vs_compile *c ) GLuint file; if (INTEL_DEBUG & DEBUG_VS) { - _mesa_printf("vs-mesa:\n"); + printf("vs-mesa:\n"); _mesa_print_program(&c->vp->program.Base); - _mesa_printf("\n"); + printf("\n"); } brw_set_compression_control(p, BRW_COMPRESSION_NONE); @@ -1796,9 +1796,9 @@ void brw_vs_emit(struct brw_vs_compile *c ) if (INTEL_DEBUG & DEBUG_VS) { int i; - _mesa_printf("vs-native:\n"); + printf("vs-native:\n"); for (i = 0; i < p->nr_insn; i++) brw_disasm(stderr, &p->store[i]); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_debug.c b/src/mesa/drivers/dri/i965/brw_wm_debug.c index 220821087c..a78cc8b54e 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_debug.c +++ b/src/mesa/drivers/dri/i965/brw_wm_debug.c @@ -41,21 +41,21 @@ void brw_wm_print_value( struct brw_wm_compile *c, if (c->state >= PASS2_DONE) brw_print_reg(value->hw_reg); else if( value == &c->undef_value ) - _mesa_printf("undef"); + printf("undef"); else if( value - c->vreg >= 0 && value - c->vreg < BRW_WM_MAX_VREG) - _mesa_printf("r%d", value - c->vreg); + printf("r%d", value - c->vreg); else if (value - c->creg >= 0 && value - c->creg < BRW_WM_MAX_PARAM) - _mesa_printf("c%d", value - c->creg); + printf("c%d", value - c->creg); else if (value - c->payload.input_interp >= 0 && value - c->payload.input_interp < FRAG_ATTRIB_MAX) - _mesa_printf("i%d", value - c->payload.input_interp); + printf("i%d", value - c->payload.input_interp); else if (value - c->payload.depth >= 0 && value - c->payload.depth < FRAG_ATTRIB_MAX) - _mesa_printf("d%d", value - c->payload.depth); + printf("d%d", value - c->payload.depth); else - _mesa_printf("?"); + printf("?"); } void brw_wm_print_ref( struct brw_wm_compile *c, @@ -64,16 +64,16 @@ void brw_wm_print_ref( struct brw_wm_compile *c, struct brw_reg hw_reg = ref->hw_reg; if (ref->unspill_reg) - _mesa_printf("UNSPILL(%x)/", ref->value->spill_slot); + printf("UNSPILL(%x)/", ref->value->spill_slot); if (c->state >= PASS2_DONE) brw_print_reg(ref->hw_reg); else { - _mesa_printf("%s", hw_reg.negate ? "-" : ""); - _mesa_printf("%s", hw_reg.abs ? "abs/" : ""); + printf("%s", hw_reg.negate ? "-" : ""); + printf("%s", hw_reg.abs ? "abs/" : ""); brw_wm_print_value(c, ref->value); if ((hw_reg.nr&1) || hw_reg.subnr) { - _mesa_printf("->%d.%d", (hw_reg.nr&1), hw_reg.subnr); + printf("->%d.%d", (hw_reg.nr&1), hw_reg.subnr); } } } @@ -84,22 +84,22 @@ void brw_wm_print_insn( struct brw_wm_compile *c, GLuint i, arg; GLuint nr_args = brw_wm_nr_args(inst->opcode); - _mesa_printf("["); + printf("["); for (i = 0; i < 4; i++) { if (inst->dst[i]) { brw_wm_print_value(c, inst->dst[i]); if (inst->dst[i]->spill_slot) - _mesa_printf("/SPILL(%x)",inst->dst[i]->spill_slot); + printf("/SPILL(%x)",inst->dst[i]->spill_slot); } else - _mesa_printf("#"); + printf("#"); if (i < 3) - _mesa_printf(","); + printf(","); } - _mesa_printf("]"); + printf("]"); if (inst->writemask != WRITEMASK_XYZW) - _mesa_printf(".%s%s%s%s", + printf(".%s%s%s%s", GET_BIT(inst->writemask, 0) ? "x" : "", GET_BIT(inst->writemask, 1) ? "y" : "", GET_BIT(inst->writemask, 2) ? "z" : "", @@ -107,58 +107,58 @@ void brw_wm_print_insn( struct brw_wm_compile *c, switch (inst->opcode) { case WM_PIXELXY: - _mesa_printf(" = PIXELXY"); + printf(" = PIXELXY"); break; case WM_DELTAXY: - _mesa_printf(" = DELTAXY"); + printf(" = DELTAXY"); break; case WM_PIXELW: - _mesa_printf(" = PIXELW"); + printf(" = PIXELW"); break; case WM_WPOSXY: - _mesa_printf(" = WPOSXY"); + printf(" = WPOSXY"); break; case WM_PINTERP: - _mesa_printf(" = PINTERP"); + printf(" = PINTERP"); break; case WM_LINTERP: - _mesa_printf(" = LINTERP"); + printf(" = LINTERP"); break; case WM_CINTERP: - _mesa_printf(" = CINTERP"); + printf(" = CINTERP"); break; case WM_FB_WRITE: - _mesa_printf(" = FB_WRITE"); + printf(" = FB_WRITE"); break; case WM_FRONTFACING: - _mesa_printf(" = FRONTFACING"); + printf(" = FRONTFACING"); break; default: - _mesa_printf(" = %s", _mesa_opcode_string(inst->opcode)); + printf(" = %s", _mesa_opcode_string(inst->opcode)); break; } if (inst->saturate) - _mesa_printf("_SAT"); + printf("_SAT"); for (arg = 0; arg < nr_args; arg++) { - _mesa_printf(" ["); + printf(" ["); for (i = 0; i < 4; i++) { if (inst->src[arg][i]) { brw_wm_print_ref(c, inst->src[arg][i]); } else - _mesa_printf("%%"); + printf("%%"); if (i < 3) - _mesa_printf(","); + printf(","); else - _mesa_printf("]"); + printf("]"); } } - _mesa_printf("\n"); + printf("\n"); } void brw_wm_print_program( struct brw_wm_compile *c, @@ -166,9 +166,9 @@ void brw_wm_print_program( struct brw_wm_compile *c, { GLuint insn; - _mesa_printf("%s:\n", stage); + printf("%s:\n", stage); for (insn = 0; insn < c->nr_insns; insn++) brw_wm_print_insn(c, &c->instruction[insn]); - _mesa_printf("\n"); + printf("\n"); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index fa0898c586..9315bca315 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -1622,10 +1622,10 @@ void brw_wm_emit( struct brw_wm_compile *c ) break; default: - _mesa_printf("Unsupported opcode %i (%s) in fragment shader\n", - inst->opcode, inst->opcode < MAX_OPCODE ? - _mesa_opcode_string(inst->opcode) : - "unknown"); + printf("Unsupported opcode %i (%s) in fragment shader\n", + inst->opcode, inst->opcode < MAX_OPCODE ? + _mesa_opcode_string(inst->opcode) : + "unknown"); } for (i = 0; i < 4; i++) @@ -1638,9 +1638,9 @@ void brw_wm_emit( struct brw_wm_compile *c ) if (INTEL_DEBUG & DEBUG_WM) { int i; - _mesa_printf("wm-native:\n"); + printf("wm-native:\n"); for (i = 0; i < p->nr_insn; i++) brw_disasm(stderr, &p->store[i]); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 3737faf26f..d73c391582 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -159,7 +159,7 @@ static struct prog_dst_register get_temp( struct brw_wm_compile *c ) int bit = _mesa_ffs( ~c->fp_temp ); if (!bit) { - _mesa_printf("%s: out of temporaries\n", __FILE__); + printf("%s: out of temporaries\n", __FILE__); exit(1); } @@ -1034,7 +1034,7 @@ static void print_insns( const struct prog_instruction *insn, { GLuint i; for (i = 0; i < nr; i++, insn++) { - _mesa_printf("%3d: ", i); + printf("%3d: ", i); if (insn->Opcode < MAX_OPCODE) _mesa_print_instruction(insn); else if (insn->Opcode < MAX_WM_OPCODE) { @@ -1045,7 +1045,7 @@ static void print_insns( const struct prog_instruction *insn, 3); } else - _mesa_printf("965 Opcode %d\n", insn->Opcode); + printf("965 Opcode %d\n", insn->Opcode); } } @@ -1060,9 +1060,9 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) GLuint insn; if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("pre-fp:\n"); + printf("pre-fp:\n"); _mesa_print_program(&fp->program.Base); - _mesa_printf("\n"); + printf("\n"); } c->pixel_xy = src_undef(); @@ -1168,9 +1168,9 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) } if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("pass_fp:\n"); + printf("pass_fp:\n"); print_insns( c->prog_instructions, c->nr_fp_insns ); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index fde83eea62..562608e2ec 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1849,7 +1849,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) c->cur_inst = i; #if 0 - _mesa_printf("Inst %d: ", i); + printf("Inst %d: ", i); _mesa_print_instruction(inst); #endif @@ -2115,7 +2115,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) } break; default: - _mesa_printf("unsupported IR in fragment shader %d\n", + printf("unsupported IR in fragment shader %d\n", inst->Opcode); } @@ -2127,10 +2127,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) post_wm_emit(c); if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("wm-native:\n"); + printf("wm-native:\n"); for (i = 0; i < p->nr_insn; i++) brw_disasm(stderr, &p->store[i]); - _mesa_printf("\n"); + printf("\n"); } } @@ -2141,7 +2141,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c) { if (INTEL_DEBUG & DEBUG_WM) { - _mesa_printf("brw_wm_glsl_emit:\n"); + printf("brw_wm_glsl_emit:\n"); } /* initial instruction translation/simplification */ diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index ff4c082d5e..60bd92ed22 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -105,7 +105,7 @@ static const struct brw_wm_ref *get_param_ref( struct brw_wm_compile *c, GLuint i = c->prog_data.nr_params++; if (i >= BRW_WM_MAX_PARAM) { - _mesa_printf("%s: out of params\n", __FUNCTION__); + printf("%s: out of params\n", __FUNCTION__); c->prog_data.error = 1; return NULL; } @@ -154,7 +154,7 @@ static const struct brw_wm_ref *get_const_ref( struct brw_wm_compile *c, return c->constref[i].ref; } else { - _mesa_printf("%s: out of constrefs\n", __FUNCTION__); + printf("%s: out of constrefs\n", __FUNCTION__); c->prog_data.error = 1; return NULL; } diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index ae0f8a16f9..c9841724ee 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -209,8 +209,8 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, int ret; if (batch->ptr - batch->map > batch->buf->size) - _mesa_printf ("bad relocation ptr %p map %p offset %d size %d\n", - batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); + printf ("bad relocation ptr %p map %p offset %d size %d\n", + batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); ret = dri_bo_emit_reloc(batch->buf, read_domains, write_domain, delta, batch->ptr - batch->map, buffer); diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 8f37fb82c1..3a0830a85b 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -592,7 +592,7 @@ intelInitContext(struct intel_context *intel, if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, functions, (void *) intel)) { - _mesa_printf("%s: failed to init mesa context\n", __FUNCTION__); + printf("%s: failed to init mesa context\n", __FUNCTION__); return GL_FALSE; } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index da5d901abf..d20d44497e 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -345,7 +345,7 @@ extern int INTEL_DEBUG; #define DBG(...) do { \ if (INTEL_DEBUG & FILE_DEBUG_FLAG) \ - _mesa_printf(__VA_ARGS__); \ + printf(__VA_ARGS__); \ } while(0) #define PCI_CHIP_845_G 0x2562 diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 54998a63f6..076fee89bd 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -123,7 +123,7 @@ static GLuint get_bitmap_rect(GLsizei width, GLsizei height, GLuint count = 0; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n", + printf("%s %d,%d %dx%d bitmap %dx%d skip %d src_offset %d mask %d\n", __FUNCTION__, x,y,w,h,width,height,unpack->SkipPixels, src_offset, mask); if (invert) { @@ -516,7 +516,7 @@ intelBitmap(GLcontext * ctx, return; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + printf("%s: fallback to swrast\n", __FUNCTION__); _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels); } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 514a17e2aa..2ac3da7f42 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -80,7 +80,7 @@ do_blit_readpixels(GLcontext * ctx, GLint dst_x, dst_y; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s\n", __FUNCTION__); + printf("%s\n", __FUNCTION__); if (!src) return GL_FALSE; @@ -89,7 +89,7 @@ do_blit_readpixels(GLcontext * ctx, /* PBO only for now: */ if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - not PBO\n", __FUNCTION__); + printf("%s - not PBO\n", __FUNCTION__); return GL_FALSE; } @@ -97,13 +97,13 @@ do_blit_readpixels(GLcontext * ctx, if (ctx->_ImageTransferState || !intel_check_blit_format(src, format, type)) { if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - bad format for blit\n", __FUNCTION__); + printf("%s - bad format for blit\n", __FUNCTION__); return GL_FALSE; } if (pack->Alignment != 1 || pack->SwapBytes || pack->LsbFirst) { if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: bad packing params\n", __FUNCTION__); + printf("%s: bad packing params\n", __FUNCTION__); return GL_FALSE; } @@ -114,7 +114,7 @@ do_blit_readpixels(GLcontext * ctx, if (pack->Invert) { if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__); + printf("%s: MESA_PACK_INVERT not done yet\n", __FUNCTION__); return GL_FALSE; } else { @@ -159,7 +159,7 @@ do_blit_readpixels(GLcontext * ctx, } if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s - DONE\n", __FUNCTION__); + printf("%s - DONE\n", __FUNCTION__); return GL_TRUE; } @@ -181,7 +181,7 @@ intelReadPixels(GLcontext * ctx, return; if (INTEL_DEBUG & DEBUG_PIXEL) - _mesa_printf("%s: fallback to swrast\n", __FUNCTION__); + printf("%s: fallback to swrast\n", __FUNCTION__); /* Update Mesa state before calling down into _swrast_ReadPixels, as * the spans code requires the computed buffer states to be up to date, diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 215a534a5c..8bb6ae99fb 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -146,7 +146,7 @@ timed_memcpy(void *dest, const void *src, size_t n) double rate; if ((((unsigned) src) & 63) || (((unsigned) dest) & 63)) - _mesa_printf("Warning - non-aligned texture copy!\n"); + printf("Warning - non-aligned texture copy!\n"); t1 = fastrdtsc(); ret = do_memcpy(dest, src, n); @@ -154,7 +154,7 @@ timed_memcpy(void *dest, const void *src, size_t n) rate = time_diff(t1, t2); rate /= (double) n; - _mesa_printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate); + printf("timed_memcpy: %u %u --> %f clocks/byte\n", t1, t2, rate); return ret; } #endif /* DO_DEBUG */ diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h index 54bf981a0f..283f6eac2c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h @@ -70,7 +70,7 @@ struct nouveau_driver { }; #define nouveau_error(format, ...) \ - _mesa_fprintf(stderr, "%s: " format, __func__, ## __VA_ARGS__) + fprintf(stderr, "%s: " format, __func__, ## __VA_ARGS__) void nouveau_clear(GLcontext *ctx, GLbitfield buffers); diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index a5810ee500..61ea5e4d9a 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -227,7 +227,7 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog if (compiler.Base.Debug) { fflush(stderr); - _mesa_printf("Fragment Program: Initial program:\n"); + printf("Fragment Program: Initial program:\n"); _mesa_print_program(&cont->Base.Base); fflush(stderr); } diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index e3e6285784..9596131486 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -440,7 +440,7 @@ void r300SwitchFallback(GLcontext *ctx, uint32_t bit, GLboolean mode) if (mode) { if ((fallback_warn & bit) == 0) { if (RADEON_DEBUG & RADEON_FALLBACKS) - _mesa_fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit)); + fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit)); fallback_warn |= bit; } rmesa->fallback |= bit; diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 017d45a503..9d1ff6e2ba 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1970,7 +1970,7 @@ void r300UpdateShaders(r300ContextPtr rmesa) /* should only happenen once, just after context is created */ /* TODO: shouldn't we fallback to sw here? */ if (!ctx->FragmentProgram._Current) { - _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); + fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); return; } diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 0240eefd5c..4ebdbbfad2 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -65,7 +65,7 @@ void r700UpdateShaders(GLcontext * ctx) /* should only happenen once, just after context is created */ /* TODO: shouldn't we fallback to sw here? */ if (!ctx->FragmentProgram._Current) { - _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); + fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); return; } diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index a8931e8478..3b066f5eef 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -43,7 +43,7 @@ #define FILE_DEBUG_FLAG RADEON_TEXTURE #define DBG(...) do { \ if (RADEON_DEBUG & FILE_DEBUG_FLAG) \ - _mesa_printf(__VA_ARGS__); \ + printf(__VA_ARGS__); \ } while(0) static struct gl_framebuffer * diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index 1a5fb31d5a..59b4a6d228 100644 --- a/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -43,13 +43,13 @@ #define DEBUG_SPAN 0 #if DEBUG_CORE -#define TRACE _mesa_printf("--> %s\n", __FUNCTION__) +#define TRACE printf("--> %s\n", __FUNCTION__) #else #define TRACE #endif #if DEBUG_SPAN -#define TRACE_SPAN _mesa_printf("--> %s\n", __FUNCTION__) +#define TRACE_SPAN printf("--> %s\n", __FUNCTION__) #else #define TRACE_SPAN #endif diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index f097d93a71..33a3ff6d5f 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -53,7 +53,7 @@ #include "xmesaP.h" #ifdef __VMS -#define _mesa_sprintf sprintf +#define sprintf sprintf #endif /* This indicates the client-side GLX API and GLX encoder version. */ @@ -2032,8 +2032,8 @@ static const char * Fake_glXQueryServerString( Display *dpy, int screen, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", - SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", + SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; (void) screen; @@ -2057,8 +2057,8 @@ static const char * Fake_glXGetClientString( Display *dpy, int name ) { static char version[1000]; - _mesa_sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, - CLIENT_MINOR_VERSION, MESA_GLX_VERSION); + sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION, + CLIENT_MINOR_VERSION, MESA_GLX_VERSION); (void) dpy; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index ed945023cf..3711c88148 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1110,12 +1110,12 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, * reports bugs. */ if (_mesa_getenv("MESA_INFO")) { - _mesa_printf("X/Mesa visual = %p\n", (void *) v); - _mesa_printf("X/Mesa dithered pf = %u\n", v->dithered_pf); - _mesa_printf("X/Mesa undithered pf = %u\n", v->undithered_pf); - _mesa_printf("X/Mesa level = %d\n", v->mesa_visual.level); - _mesa_printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v)); - _mesa_printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); + printf("X/Mesa visual = %p\n", (void *) v); + printf("X/Mesa dithered pf = %u\n", v->dithered_pf); + printf("X/Mesa undithered pf = %u\n", v->undithered_pf); + printf("X/Mesa level = %d\n", v->mesa_visual.level); + printf("X/Mesa depth = %d\n", GET_VISUAL_DEPTH(v)); + printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); } if (b && window) { diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 3a0cf80139..a6efb35e3c 100644 --- a/src/mesa/drivers/x11/xm_tri.c +++ b/src/mesa/drivers/x11/xm_tri.c @@ -1330,97 +1330,97 @@ extern void _xmesa_print_triangle_func( swrast_tri_func triFunc ); void _xmesa_print_triangle_func( swrast_tri_func triFunc ) { - _mesa_printf("XMesa tri func = "); + printf("XMesa tri func = "); if (triFunc ==smooth_TRUECOLOR_z_triangle) - _mesa_printf("smooth_TRUECOLOR_z_triangle\n"); + printf("smooth_TRUECOLOR_z_triangle\n"); else if (triFunc ==smooth_8A8B8G8R_z_triangle) - _mesa_printf("smooth_8A8B8G8R_z_triangle\n"); + printf("smooth_8A8B8G8R_z_triangle\n"); else if (triFunc ==smooth_8A8R8G8B_z_triangle) - _mesa_printf("smooth_8A8R8G8B_z_triangle\n"); + printf("smooth_8A8R8G8B_z_triangle\n"); else if (triFunc ==smooth_8R8G8B_z_triangle) - _mesa_printf("smooth_8R8G8B_z_triangle\n"); + printf("smooth_8R8G8B_z_triangle\n"); else if (triFunc ==smooth_8R8G8B24_z_triangle) - _mesa_printf("smooth_8R8G8B24_z_triangle\n"); + printf("smooth_8R8G8B24_z_triangle\n"); else if (triFunc ==smooth_TRUEDITHER_z_triangle) - _mesa_printf("smooth_TRUEDITHER_z_triangle\n"); + printf("smooth_TRUEDITHER_z_triangle\n"); else if (triFunc ==smooth_5R6G5B_z_triangle) - _mesa_printf("smooth_5R6G5B_z_triangle\n"); + printf("smooth_5R6G5B_z_triangle\n"); else if (triFunc ==smooth_DITHER_5R6G5B_z_triangle) - _mesa_printf("smooth_DITHER_5R6G5B_z_triangle\n"); + printf("smooth_DITHER_5R6G5B_z_triangle\n"); else if (triFunc ==smooth_HPCR_z_triangle) - _mesa_printf("smooth_HPCR_z_triangle\n"); + printf("smooth_HPCR_z_triangle\n"); else if (triFunc ==smooth_DITHER8_z_triangle) - _mesa_printf("smooth_DITHER8_z_triangle\n"); + printf("smooth_DITHER8_z_triangle\n"); else if (triFunc ==smooth_LOOKUP8_z_triangle) - _mesa_printf("smooth_LOOKUP8_z_triangle\n"); + printf("smooth_LOOKUP8_z_triangle\n"); else if (triFunc ==flat_TRUECOLOR_z_triangle) - _mesa_printf("flat_TRUECOLOR_z_triangle\n"); + printf("flat_TRUECOLOR_z_triangle\n"); else if (triFunc ==flat_8A8B8G8R_z_triangle) - _mesa_printf("flat_8A8B8G8R_z_triangle\n"); + printf("flat_8A8B8G8R_z_triangle\n"); else if (triFunc ==flat_8A8R8G8B_z_triangle) - _mesa_printf("flat_8A8R8G8B_z_triangle\n"); + printf("flat_8A8R8G8B_z_triangle\n"); else if (triFunc ==flat_8R8G8B_z_triangle) - _mesa_printf("flat_8R8G8B_z_triangle\n"); + printf("flat_8R8G8B_z_triangle\n"); else if (triFunc ==flat_8R8G8B24_z_triangle) - _mesa_printf("flat_8R8G8B24_z_triangle\n"); + printf("flat_8R8G8B24_z_triangle\n"); else if (triFunc ==flat_TRUEDITHER_z_triangle) - _mesa_printf("flat_TRUEDITHER_z_triangle\n"); + printf("flat_TRUEDITHER_z_triangle\n"); else if (triFunc ==flat_5R6G5B_z_triangle) - _mesa_printf("flat_5R6G5B_z_triangle\n"); + printf("flat_5R6G5B_z_triangle\n"); else if (triFunc ==flat_DITHER_5R6G5B_z_triangle) - _mesa_printf("flat_DITHER_5R6G5B_z_triangle\n"); + printf("flat_DITHER_5R6G5B_z_triangle\n"); else if (triFunc ==flat_HPCR_z_triangle) - _mesa_printf("flat_HPCR_z_triangle\n"); + printf("flat_HPCR_z_triangle\n"); else if (triFunc ==flat_DITHER8_z_triangle) - _mesa_printf("flat_DITHER8_z_triangle\n"); + printf("flat_DITHER8_z_triangle\n"); else if (triFunc ==flat_LOOKUP8_z_triangle) - _mesa_printf("flat_LOOKUP8_z_triangle\n"); + printf("flat_LOOKUP8_z_triangle\n"); else if (triFunc ==smooth_TRUECOLOR_triangle) - _mesa_printf("smooth_TRUECOLOR_triangle\n"); + printf("smooth_TRUECOLOR_triangle\n"); else if (triFunc ==smooth_8A8B8G8R_triangle) - _mesa_printf("smooth_8A8B8G8R_triangle\n"); + printf("smooth_8A8B8G8R_triangle\n"); else if (triFunc ==smooth_8A8R8G8B_triangle) - _mesa_printf("smooth_8A8R8G8B_triangle\n"); + printf("smooth_8A8R8G8B_triangle\n"); else if (triFunc ==smooth_8R8G8B_triangle) - _mesa_printf("smooth_8R8G8B_triangle\n"); + printf("smooth_8R8G8B_triangle\n"); else if (triFunc ==smooth_8R8G8B24_triangle) - _mesa_printf("smooth_8R8G8B24_triangle\n"); + printf("smooth_8R8G8B24_triangle\n"); else if (triFunc ==smooth_TRUEDITHER_triangle) - _mesa_printf("smooth_TRUEDITHER_triangle\n"); + printf("smooth_TRUEDITHER_triangle\n"); else if (triFunc ==smooth_5R6G5B_triangle) - _mesa_printf("smooth_5R6G5B_triangle\n"); + printf("smooth_5R6G5B_triangle\n"); else if (triFunc ==smooth_DITHER_5R6G5B_triangle) - _mesa_printf("smooth_DITHER_5R6G5B_triangle\n"); + printf("smooth_DITHER_5R6G5B_triangle\n"); else if (triFunc ==smooth_HPCR_triangle) - _mesa_printf("smooth_HPCR_triangle\n"); + printf("smooth_HPCR_triangle\n"); else if (triFunc ==smooth_DITHER8_triangle) - _mesa_printf("smooth_DITHER8_triangle\n"); + printf("smooth_DITHER8_triangle\n"); else if (triFunc ==smooth_LOOKUP8_triangle) - _mesa_printf("smooth_LOOKUP8_triangle\n"); + printf("smooth_LOOKUP8_triangle\n"); else if (triFunc ==flat_TRUECOLOR_triangle) - _mesa_printf("flat_TRUECOLOR_triangle\n"); + printf("flat_TRUECOLOR_triangle\n"); else if (triFunc ==flat_TRUEDITHER_triangle) - _mesa_printf("flat_TRUEDITHER_triangle\n"); + printf("flat_TRUEDITHER_triangle\n"); else if (triFunc ==flat_8A8B8G8R_triangle) - _mesa_printf("flat_8A8B8G8R_triangle\n"); + printf("flat_8A8B8G8R_triangle\n"); else if (triFunc ==flat_8A8R8G8B_triangle) - _mesa_printf("flat_8A8R8G8B_triangle\n"); + printf("flat_8A8R8G8B_triangle\n"); else if (triFunc ==flat_8R8G8B_triangle) - _mesa_printf("flat_8R8G8B_triangle\n"); + printf("flat_8R8G8B_triangle\n"); else if (triFunc ==flat_8R8G8B24_triangle) - _mesa_printf("flat_8R8G8B24_triangle\n"); + printf("flat_8R8G8B24_triangle\n"); else if (triFunc ==flat_5R6G5B_triangle) - _mesa_printf("flat_5R6G5B_triangle\n"); + printf("flat_5R6G5B_triangle\n"); else if (triFunc ==flat_DITHER_5R6G5B_triangle) - _mesa_printf("flat_DITHER_5R6G5B_triangle\n"); + printf("flat_DITHER_5R6G5B_triangle\n"); else if (triFunc ==flat_HPCR_triangle) - _mesa_printf("flat_HPCR_triangle\n"); + printf("flat_HPCR_triangle\n"); else if (triFunc ==flat_DITHER8_triangle) - _mesa_printf("flat_DITHER8_triangle\n"); + printf("flat_DITHER8_triangle\n"); else if (triFunc ==flat_LOOKUP8_triangle) - _mesa_printf("flat_LOOKUP8_triangle\n"); + printf("flat_LOOKUP8_triangle\n"); else - _mesa_printf("???\n"); + printf("???\n"); } #endif diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py index adb0ca526c..3a9ea3c86c 100644 --- a/src/mesa/glapi/gl_enums.py +++ b/src/mesa/glapi/gl_enums.py @@ -105,7 +105,7 @@ const char *_mesa_lookup_enum_by_nr( int nr ) } else { /* this is not re-entrant safe, no big deal here */ - _mesa_sprintf(token_tmp, "0x%x", nr); + sprintf(token_tmp, "0x%x", nr); return token_tmp; } } diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 3a1fd37324..7feaee316d 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -295,11 +295,11 @@ compute_max_element(struct gl_client_array *array) - (GLsizeiptrARB) array->Ptr + array->StrideB - array->_ElementSize) / array->StrideB; if (0) - _mesa_printf("%s Object %u Size %u MaxElement %u\n", - __FUNCTION__, - array->BufferObj->Name, - (GLuint) array->BufferObj->Size, - array->_MaxElement); + printf("%s Object %u Size %u MaxElement %u\n", + __FUNCTION__, + array->BufferObj->Name, + (GLuint) array->BufferObj->Size, + array->_MaxElement); } else { /* user-space array, no idea how big it is */ diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 816465cea1..971b280f3b 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1155,7 +1155,7 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, bufObj->Written = GL_TRUE; #ifdef VBO_DEBUG - _mesa_printf("glBufferDataARB(%u, sz %ld, from %p, usage 0x%x)\n", + printf("glBufferDataARB(%u, sz %ld, from %p, usage 0x%x)\n", bufObj->Name, size, data, usage); #endif @@ -1272,8 +1272,8 @@ _mesa_MapBufferARB(GLenum target, GLenum access) bufObj->Written = GL_TRUE; #ifdef VBO_DEBUG - _mesa_printf("glMapBufferARB(%u, sz %ld, access 0x%x)\n", - bufObj->Name, bufObj->Size, access); + printf("glMapBufferARB(%u, sz %ld, access 0x%x)\n", + bufObj->Name, bufObj->Size, access); if (access == GL_WRITE_ONLY_ARB) { GLuint i; GLubyte *b = (GLubyte *) bufObj->Pointer; @@ -1349,7 +1349,7 @@ _mesa_UnmapBufferARB(GLenum target) } } if (unchanged) { - _mesa_printf("glUnmapBufferARB(%u): %u of %ld unchanged, starting at %d\n", + printf("glUnmapBufferARB(%u): %u of %ld unchanged, starting at %d\n", bufObj->Name, unchanged, bufObj->Size, pos); } } diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 79b63e940f..246dbd436d 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -314,9 +314,9 @@ write_texture_image(struct gl_texture_object *texObj, buffer, texObj, img); /* make filename */ - _mesa_sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); + sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); - _mesa_printf(" Writing image level %u to %s\n", level, s); + printf(" Writing image level %u to %s\n", level, s); write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE); ctx->Pack = store; /* restore */ @@ -356,9 +356,9 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) format, type, &ctx->DefaultPacking, buffer); /* make filename */ - _mesa_sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name); + sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name); - _mesa_printf(" Writing renderbuffer image to %s\n", s); + printf(" Writing renderbuffer image to %s\n", s); write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); free(buffer); @@ -380,17 +380,17 @@ dump_texture(struct gl_texture_object *texObj, GLuint writeImages) GLboolean written = GL_FALSE; GLuint i, j; - _mesa_printf("Texture %u\n", texObj->Name); - _mesa_printf(" Target %s\n", tex_target_name(texObj->Target)); + printf("Texture %u\n", texObj->Name); + printf(" Target %s\n", tex_target_name(texObj->Target)); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { for (j = 0; j < numFaces; j++) { struct gl_texture_image *texImg = texObj->Image[j][i]; if (texImg) { - _mesa_printf(" Face %u level %u: %d x %d x %d, format %s at %p\n", - j, i, - texImg->Width, texImg->Height, texImg->Depth, - _mesa_get_format_name(texImg->TexFormat), - texImg->Data); + printf(" Face %u level %u: %d x %d x %d, format %s at %p\n", + j, i, + texImg->Width, texImg->Height, texImg->Depth, + _mesa_get_format_name(texImg->TexFormat), + texImg->Data); if (writeImages == WRITE_ALL || (writeImages == WRITE_ONE && !written)) { write_texture_image(texObj, j, i); @@ -441,9 +441,9 @@ _mesa_dump_textures(GLuint writeImages) static void dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) { - _mesa_printf("Renderbuffer %u: %u x %u IntFormat = %s\n", - rb->Name, rb->Width, rb->Height, - _mesa_lookup_enum_by_nr(rb->InternalFormat)); + printf("Renderbuffer %u: %u x %u IntFormat = %s\n", + rb->Name, rb->Width, rb->Height, + _mesa_lookup_enum_by_nr(rb->InternalFormat)); if (writeImage) { write_renderbuffer_image(rb); } @@ -489,12 +489,12 @@ _mesa_dump_color_buffer(const char *filename) _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf); - _mesa_printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n", - ctx->ReadBuffer->_ColorReadBuffer, - ctx->ReadBuffer->ColorReadBuffer, - ctx->DrawBuffer->_ColorDrawBuffers[0], - ctx->DrawBuffer->ColorDrawBuffer[0]); - _mesa_printf("Writing %d x %d color buffer to %s\n", w, h, filename); + printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n", + ctx->ReadBuffer->_ColorReadBuffer, + ctx->ReadBuffer->ColorReadBuffer, + ctx->DrawBuffer->_ColorDrawBuffers[0], + ctx->DrawBuffer->ColorDrawBuffer[0]); + printf("Writing %d x %d color buffer to %s\n", w, h, filename); write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE); _mesa_PopClientAttrib(); @@ -529,7 +529,7 @@ _mesa_dump_depth_buffer(const char *filename) buf2[i*3+2] = (buf[i] >> 8) & 0xff; } - _mesa_printf("Writing %d x %d depth buffer to %s\n", w, h, filename); + printf("Writing %d x %d depth buffer to %s\n", w, h, filename); write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); _mesa_PopClientAttrib(); @@ -564,7 +564,7 @@ _mesa_dump_stencil_buffer(const char *filename) buf2[i*3+2] = (buf[i] - 128) * 2; } - _mesa_printf("Writing %d x %d stencil buffer to %s\n", w, h, filename); + printf("Writing %d x %d stencil buffer to %s\n", w, h, filename); write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); _mesa_PopClientAttrib(); @@ -587,7 +587,7 @@ _mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img) const GLubyte *data = (const GLubyte *) img->Data; if (!data) { - _mesa_printf("No texture data\n"); + printf("No texture data\n"); return; } @@ -619,17 +619,17 @@ _mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img) for (i = 0; i < img->Height; i++) { for (j = 0; j < img->Width; j++) { if (c==1) - _mesa_printf("%02x ", data[0]); + printf("%02x ", data[0]); else if (c==2) - _mesa_printf("%02x%02x ", data[0], data[1]); + printf("%02x%02x ", data[0], data[1]); else if (c==3) - _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); + printf("%02x%02x%02x ", data[0], data[1], data[2]); else if (c==4) - _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); + printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); data += (img->RowStride - img->Width) * c; } /* XXX use img->ImageStride here */ - _mesa_printf("\n"); + printf("\n"); } #endif } diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 87b8ddacc2..9ef7fcae90 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -7685,7 +7685,7 @@ execute_list(GLcontext *ctx, GLuint list) default: { char msg[1000]; - _mesa_sprintf(msg, "Error in execute_list: opcode=%d", + sprintf(msg, "Error in execute_list: opcode=%d", (int) opcode); _mesa_problem(ctx, msg); } @@ -9320,7 +9320,7 @@ print_list(GLcontext *ctx, GLuint list) GLboolean done; if (!islist(ctx, list)) { - _mesa_printf("%u is not a display list ID\n", list); + printf("%u is not a display list ID\n", list); return; } @@ -9330,7 +9330,7 @@ print_list(GLcontext *ctx, GLuint list) n = dlist->Head; - _mesa_printf("START-LIST %u, address %p\n", list, (void *) n); + printf("START-LIST %u, address %p\n", list, (void *) n); done = n ? GL_FALSE : GL_TRUE; while (!done) { @@ -9342,196 +9342,196 @@ print_list(GLcontext *ctx, GLuint list) else { switch (opcode) { case OPCODE_ACCUM: - _mesa_printf("Accum %s %g\n", enum_string(n[1].e), n[2].f); + printf("Accum %s %g\n", enum_string(n[1].e), n[2].f); break; case OPCODE_BITMAP: - _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, + printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data); break; case OPCODE_CALL_LIST: - _mesa_printf("CallList %d\n", (int) n[1].ui); + printf("CallList %d\n", (int) n[1].ui); break; case OPCODE_CALL_LIST_OFFSET: - _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui, + printf("CallList %d + offset %u = %u\n", (int) n[1].ui, ctx->List.ListBase, ctx->List.ListBase + n[1].ui); break; case OPCODE_COLOR_TABLE_PARAMETER_FV: - _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n", + printf("ColorTableParameterfv %s %s %f %f %f %f\n", enum_string(n[1].e), enum_string(n[2].e), n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_COLOR_TABLE_PARAMETER_IV: - _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n", + printf("ColorTableParameteriv %s %s %d %d %d %d\n", enum_string(n[1].e), enum_string(n[2].e), n[3].i, n[4].i, n[5].i, n[6].i); break; case OPCODE_DISABLE: - _mesa_printf("Disable %s\n", enum_string(n[1].e)); + printf("Disable %s\n", enum_string(n[1].e)); break; case OPCODE_ENABLE: - _mesa_printf("Enable %s\n", enum_string(n[1].e)); + printf("Enable %s\n", enum_string(n[1].e)); break; case OPCODE_FRUSTUM: - _mesa_printf("Frustum %g %g %g %g %g %g\n", + printf("Frustum %g %g %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_LINE_STIPPLE: - _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us); + printf("LineStipple %d %x\n", n[1].i, (int) n[2].us); break; case OPCODE_LOAD_IDENTITY: - _mesa_printf("LoadIdentity\n"); + printf("LoadIdentity\n"); break; case OPCODE_LOAD_MATRIX: - _mesa_printf("LoadMatrix\n"); - _mesa_printf(" %8f %8f %8f %8f\n", + printf("LoadMatrix\n"); + printf(" %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); break; case OPCODE_MULT_MATRIX: - _mesa_printf("MultMatrix (or Rotate)\n"); - _mesa_printf(" %8f %8f %8f %8f\n", + printf("MultMatrix (or Rotate)\n"); + printf(" %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); - _mesa_printf(" %8f %8f %8f %8f\n", + printf(" %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); break; case OPCODE_ORTHO: - _mesa_printf("Ortho %g %g %g %g %g %g\n", + printf("Ortho %g %g %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_POP_ATTRIB: - _mesa_printf("PopAttrib\n"); + printf("PopAttrib\n"); break; case OPCODE_POP_MATRIX: - _mesa_printf("PopMatrix\n"); + printf("PopMatrix\n"); break; case OPCODE_POP_NAME: - _mesa_printf("PopName\n"); + printf("PopName\n"); break; case OPCODE_PUSH_ATTRIB: - _mesa_printf("PushAttrib %x\n", n[1].bf); + printf("PushAttrib %x\n", n[1].bf); break; case OPCODE_PUSH_MATRIX: - _mesa_printf("PushMatrix\n"); + printf("PushMatrix\n"); break; case OPCODE_PUSH_NAME: - _mesa_printf("PushName %d\n", (int) n[1].ui); + printf("PushName %d\n", (int) n[1].ui); break; case OPCODE_RASTER_POS: - _mesa_printf("RasterPos %g %g %g %g\n", + printf("RasterPos %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f); break; case OPCODE_ROTATE: - _mesa_printf("Rotate %g %g %g %g\n", + printf("Rotate %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f); break; case OPCODE_SCALE: - _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f); + printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f); break; case OPCODE_TRANSLATE: - _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f); + printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f); break; case OPCODE_BIND_TEXTURE: - _mesa_printf("BindTexture %s %d\n", + printf("BindTexture %s %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui); break; case OPCODE_SHADE_MODEL: - _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); + printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); break; case OPCODE_MAP1: - _mesa_printf("Map1 %s %.3f %.3f %d %d\n", + printf("Map1 %s %.3f %.3f %d %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].f, n[3].f, n[4].i, n[5].i); break; case OPCODE_MAP2: - _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", + printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", _mesa_lookup_enum_by_nr(n[1].ui), n[2].f, n[3].f, n[4].f, n[5].f, n[6].i, n[7].i, n[8].i, n[9].i); break; case OPCODE_MAPGRID1: - _mesa_printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f); + printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f); break; case OPCODE_MAPGRID2: - _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", + printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f); break; case OPCODE_EVALMESH1: - _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i); + printf("EvalMesh1 %d %d\n", n[1].i, n[2].i); break; case OPCODE_EVALMESH2: - _mesa_printf("EvalMesh2 %d %d %d %d\n", + printf("EvalMesh2 %d %d %d %d\n", n[1].i, n[2].i, n[3].i, n[4].i); break; case OPCODE_ATTR_1F_NV: - _mesa_printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f); + printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f); break; case OPCODE_ATTR_2F_NV: - _mesa_printf("ATTR_2F_NV attr %d: %f %f\n", + printf("ATTR_2F_NV attr %d: %f %f\n", n[1].i, n[2].f, n[3].f); break; case OPCODE_ATTR_3F_NV: - _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n", + printf("ATTR_3F_NV attr %d: %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f); break; case OPCODE_ATTR_4F_NV: - _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n", + printf("ATTR_4F_NV attr %d: %f %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f, n[5].f); break; case OPCODE_ATTR_1F_ARB: - _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f); + printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f); break; case OPCODE_ATTR_2F_ARB: - _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n", + printf("ATTR_2F_ARB attr %d: %f %f\n", n[1].i, n[2].f, n[3].f); break; case OPCODE_ATTR_3F_ARB: - _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n", + printf("ATTR_3F_ARB attr %d: %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f); break; case OPCODE_ATTR_4F_ARB: - _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n", + printf("ATTR_4F_ARB attr %d: %f %f %f %f\n", n[1].i, n[2].f, n[3].f, n[4].f, n[5].f); break; case OPCODE_MATERIAL: - _mesa_printf("MATERIAL %x %x: %f %f %f %f\n", + printf("MATERIAL %x %x: %f %f %f %f\n", n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f); break; case OPCODE_BEGIN: - _mesa_printf("BEGIN %x\n", n[1].i); + printf("BEGIN %x\n", n[1].i); break; case OPCODE_END: - _mesa_printf("END\n"); + printf("END\n"); break; case OPCODE_RECTF: - _mesa_printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f, + printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f, n[4].f); break; case OPCODE_EVAL_C1: - _mesa_printf("EVAL_C1 %f\n", n[1].f); + printf("EVAL_C1 %f\n", n[1].f); break; case OPCODE_EVAL_C2: - _mesa_printf("EVAL_C2 %f %f\n", n[1].f, n[2].f); + printf("EVAL_C2 %f %f\n", n[1].f, n[2].f); break; case OPCODE_EVAL_P1: - _mesa_printf("EVAL_P1 %d\n", n[1].i); + printf("EVAL_P1 %d\n", n[1].i); break; case OPCODE_EVAL_P2: - _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i); + printf("EVAL_P2 %d %d\n", n[1].i, n[2].i); break; case OPCODE_PROVOKING_VERTEX: - _mesa_printf("ProvokingVertex %s\n", + printf("ProvokingVertex %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); break; @@ -9539,26 +9539,26 @@ print_list(GLcontext *ctx, GLuint list) * meta opcodes/commands */ case OPCODE_ERROR: - _mesa_printf("Error: %s %s\n", + printf("Error: %s %s\n", enum_string(n[1].e), (const char *) n[2].data); break; case OPCODE_CONTINUE: - _mesa_printf("DISPLAY-LIST-CONTINUE\n"); + printf("DISPLAY-LIST-CONTINUE\n"); n = (Node *) n[1].next; break; case OPCODE_END_OF_LIST: - _mesa_printf("END-LIST %u\n", list); + printf("END-LIST %u\n", list); done = GL_TRUE; break; default: if (opcode < 0 || opcode > OPCODE_END_OF_LIST) { - _mesa_printf + printf ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n", opcode, (void *) n); return; } else { - _mesa_printf("command %d, %u operands\n", opcode, + printf("command %d, %u operands\n", opcode, InstSize[opcode]); } } diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index fc7f8beb50..140902f677 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -5216,7 +5216,7 @@ const char *_mesa_lookup_enum_by_nr( int nr ) } else { /* this is not re-entrant safe, no big deal here */ - _mesa_sprintf(token_tmp, "0x%x", nr); + sprintf(token_tmp, "0x%x", nr); return token_tmp; } } diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 07a7f9fed8..ccd6ab43fc 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -106,7 +106,7 @@ _mesa_exec_malloc(GLuint size) if (block) addr = exec_mem + block->ofs; else - _mesa_printf("_mesa_exec_malloc failed\n"); + printf("_mesa_exec_malloc failed\n"); bail: _glthread_UNLOCK_MUTEX(exec_mutex); diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 0e6f69f573..04ea3b4ed7 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -374,8 +374,8 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } if (texImage->Width < 1 || texImage->Height < 1) { att_incomplete("teximage width/height=0"); - _mesa_printf("texobj = %u\n", texObj->Name); - _mesa_printf("level = %d\n", att->TextureLevel); + printf("texobj = %u\n", texObj->Name); + printf("level = %d\n", att->TextureLevel); att->Complete = GL_FALSE; return; } @@ -2139,39 +2139,39 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, /* Debug code */ if (DEBUG_BLIT) { - _mesa_printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d," - " 0x%x, 0x%x)\n", - srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, - mask, filter); + printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d," + " 0x%x, 0x%x)\n", + srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, + mask, filter); if (colorReadRb) { const struct gl_renderbuffer_attachment *att; att = find_attachment(readFb, colorReadRb); - _mesa_printf(" Src FBO %u RB %u (%dx%d) ", - readFb->Name, colorReadRb->Name, - colorReadRb->Width, colorReadRb->Height); + printf(" Src FBO %u RB %u (%dx%d) ", + readFb->Name, colorReadRb->Name, + colorReadRb->Width, colorReadRb->Height); if (att && att->Texture) { - _mesa_printf("Tex %u tgt 0x%x level %u face %u", - att->Texture->Name, - att->Texture->Target, - att->TextureLevel, - att->CubeMapFace); + printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); } - _mesa_printf("\n"); + printf("\n"); att = find_attachment(drawFb, colorDrawRb); - _mesa_printf(" Dst FBO %u RB %u (%dx%d) ", - drawFb->Name, colorDrawRb->Name, - colorDrawRb->Width, colorDrawRb->Height); + printf(" Dst FBO %u RB %u (%dx%d) ", + drawFb->Name, colorDrawRb->Name, + colorDrawRb->Width, colorDrawRb->Height); if (att && att->Texture) { - _mesa_printf("Tex %u tgt 0x%x level %u face %u", - att->Texture->Name, - att->Texture->Target, - att->TextureLevel, - att->CubeMapFace); + printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); } - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 48edec657b..ba94a38770 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -536,10 +536,10 @@ static void debug_insn( struct prog_instruction *inst, const char *fn, if (fn != last_fn) { last_fn = fn; - _mesa_printf("%s:\n", fn); + printf("%s:\n", fn); } - _mesa_printf("%d:\t", line); + printf("%d:\t", line); _mesa_print_instruction(inst); } } @@ -1577,7 +1577,7 @@ static void build_tnl_program( struct tnl_program *p ) /* Disassemble: */ if (DISASSEM) { - _mesa_printf ("\n"); + printf ("\n"); } } @@ -1647,7 +1647,7 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx) if (!prog) { /* OK, we'll have to build a new one */ if (0) - _mesa_printf("Build new TNL program\n"); + printf("Build new TNL program\n"); prog = (struct gl_vertex_program *) ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 10224f7888..112490915f 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -827,67 +827,6 @@ _mesa_str_checksum(const char *str) /*@}*/ -/**********************************************************************/ -/** \name I/O */ -/*@{*/ - -/** Wrapper around vsprintf() */ -int -_mesa_sprintf( char *str, const char *fmt, ... ) -{ - int r; - va_list args; - va_start( args, fmt ); - r = vsprintf( str, fmt, args ); - va_end( args ); - return r; -} - -/** Wrapper around vsnprintf() */ -int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) -{ - int r; - va_list args; - va_start( args, fmt ); - r = vsnprintf( str, size, fmt, args ); - va_end( args ); - return r; -} - -/** Wrapper around printf(), using vsprintf() for the formatting. */ -void -_mesa_printf( const char *fmtString, ... ) -{ - va_list args; - va_start( args, fmtString ); - vfprintf(stderr, fmtString, args); - va_end( args ); -} - -/** Wrapper around fprintf(), using vsprintf() for the formatting. */ -void -_mesa_fprintf( FILE *f, const char *fmtString, ... ) -{ - char s[MAXSTRING]; - va_list args; - va_start( args, fmtString ); - vsnprintf(s, MAXSTRING, fmtString, args); - va_end( args ); - fprintf(f, "%s", s); -} - - -/** Wrapper around vsprintf() */ -int -_mesa_vsprintf( char *str, const char *fmt, va_list args ) -{ - return vsprintf( str, fmt, args ); -} - -/*@}*/ - - /**********************************************************************/ /** \name Diagnostics */ /*@{*/ @@ -927,7 +866,7 @@ output_if_debug(const char *prefixString, const char *outputString, * visible, so communicate with the debugger instead */ { char buf[4096]; - _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); + snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); OutputDebugStringA(buf); } #endif @@ -976,7 +915,7 @@ flush_delayed_errors( GLcontext *ctx ) char s[MAXSTRING]; if (ctx->ErrorDebugCount) { - _mesa_snprintf(s, MAXSTRING, "%d similar %s errors", + snprintf(s, MAXSTRING, "%d similar %s errors", ctx->ErrorDebugCount, error_string(ctx->ErrorValue)); @@ -1083,7 +1022,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); - _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); + snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); ctx->ErrorDebugFmtString = fmtString; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 4eabdfdb0d..a65c6a615f 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -594,22 +594,6 @@ _mesa_strtod( const char *s, char **end ); extern unsigned int _mesa_str_checksum(const char *str); -extern int -_mesa_sprintf( char *str, const char *fmt, ... ); - -extern int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ); - -extern void -_mesa_printf( const char *fmtString, ... ); - -extern void -_mesa_fprintf( FILE *f, const char *fmtString, ... ); - -extern int -_mesa_vsprintf( char *str, const char *fmt, va_list args ); - - extern void _mesa_warning( __GLcontext *gc, const char *fmtString, ... ); diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 415abcdfa1..355af56b41 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1115,7 +1115,7 @@ make_3d_mipmap(GLenum datatype, GLuint comps, GLint border, */ /* - _mesa_printf("mip3d %d x %d x %d -> %d x %d x %d\n", + printf("mip3d %d x %d x %d -> %d x %d x %d\n", srcWidth, srcHeight, srcDepth, dstWidth, dstHeight, dstDepth); */ diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index e6f6add768..f382680b44 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -489,7 +489,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, newSource = _mesa_read_shader(filename); if (newSource) { - _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", + fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", shaderObj, checksum, filename); free(source); source = newSource; diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 5e07d1d2f1..589029db58 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -682,7 +682,7 @@ _mesa_set_varying_vp_inputs( GLcontext *ctx, if (ctx->varying_vp_inputs != varying_inputs) { ctx->varying_vp_inputs = varying_inputs; ctx->NewState |= _NEW_ARRAY; - /*_mesa_printf("%s %x\n", __FUNCTION__, varying_inputs);*/ + /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/ } } diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index f790fd6562..7b8a8b85f2 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -1560,7 +1560,7 @@ create_new_program(GLcontext *ctx, struct state_key *key, if (DISASSEM) { _mesa_print_program(&p.program->Base); - _mesa_printf("\n"); + printf("\n"); } } diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 11e37dc34e..00329c755d 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1307,7 +1307,7 @@ texture_error_check( GLcontext *ctx, GLenum target, if (type != GL_UNSIGNED_SHORT_8_8_MESA && type != GL_UNSIGNED_SHORT_8_8_REV_MESA) { char message[100]; - _mesa_sprintf(message, + sprintf(message, "glTexImage%d(format/type YCBCR mismatch", dimensions); _mesa_error(ctx, GL_INVALID_ENUM, message); return GL_TRUE; /* error */ @@ -1323,7 +1323,7 @@ texture_error_check( GLcontext *ctx, GLenum target, if (border != 0) { if (!isProxy) { char message[100]; - _mesa_sprintf(message, + sprintf(message, "glTexImage%d(format=GL_YCBCR_MESA and border=%d)", dimensions, border); _mesa_error(ctx, GL_INVALID_VALUE, message); diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index feba6e95b6..2753b55c36 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -383,7 +383,7 @@ _mesa_reference_texobj(struct gl_texture_object **ptr, static void incomplete(const struct gl_texture_object *t, const char *why) { - _mesa_printf("Texture Obj %d incomplete because: %s\n", t->Name, why); + printf("Texture Obj %d incomplete because: %s\n", t->Name, why); } #else #define incomplete(t, why) @@ -416,7 +416,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, */ if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { char s[100]; - _mesa_sprintf(s, "base level = %d is invalid", baseLevel); + sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s); t->_Complete = GL_FALSE; return; @@ -425,7 +425,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Always need the base level image */ if (!t->Image[0][baseLevel]) { char s[100]; - _mesa_sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel); + sprintf(s, "Image[baseLevel=%d] == NULL", baseLevel); incomplete(t, s); t->_Complete = GL_FALSE; return; diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 8c4399a430..fce17c2b66 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -122,25 +122,25 @@ void _mesa_print_texunit_state( GLcontext *ctx, GLuint unit ) { const struct gl_texture_unit *texUnit = ctx->Texture.Unit + unit; - _mesa_printf("Texture Unit %d\n", unit); - _mesa_printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode)); - _mesa_printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB)); - _mesa_printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); - _mesa_printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0])); - _mesa_printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1])); - _mesa_printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2])); - _mesa_printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0])); - _mesa_printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1])); - _mesa_printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2])); - _mesa_printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0])); - _mesa_printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1])); - _mesa_printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2])); - _mesa_printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0])); - _mesa_printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1])); - _mesa_printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2])); - _mesa_printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB); - _mesa_printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA); - _mesa_printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]); + printf("Texture Unit %d\n", unit); + printf(" GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode)); + printf(" GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB)); + printf(" GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); + printf(" GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0])); + printf(" GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1])); + printf(" GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2])); + printf(" GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0])); + printf(" GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1])); + printf(" GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2])); + printf(" GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0])); + printf(" GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1])); + printf(" GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2])); + printf(" GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0])); + printf(" GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1])); + printf(" GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2])); + printf(" GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB); + printf(" GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA); + printf(" GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", texUnit->EnvColor[0], texUnit->EnvColor[1], texUnit->EnvColor[2], texUnit->EnvColor[3]); } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index bd63c77a39..65e3fcaa95 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -264,15 +264,15 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, map[ONE] = ONE; #if 0 - _mesa_printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", - inFormat, _mesa_lookup_enum_by_nr(inFormat), - outFormat, _mesa_lookup_enum_by_nr(outFormat), - map[0], - map[1], - map[2], - map[3], - map[4], - map[5]); + printf("from %x/%s to %x/%s map %d %d %d %d %d %d\n", + inFormat, _mesa_lookup_enum_by_nr(inFormat), + outFormat, _mesa_lookup_enum_by_nr(outFormat), + map[0], + map[1], + map[2], + map[3], + map[4], + map[5]); #endif } @@ -884,7 +884,7 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, for (i = 0; i < 4; i++) map[i] = srctype2ubyte[swap[src2base[base2rgba[rgba2dst[i]]]]]; -/* _mesa_printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ +/* printf("map %d %d %d %d\n", map[0], map[1], map[2], map[3]); */ if (srcComponents == dstComponents && srcRowStride == dstRowStride && diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 818ed792e3..86878d6a8a 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1083,14 +1083,14 @@ static void print_array(const char *name, GLint index, const struct gl_client_array *array) { if (index >= 0) - _mesa_printf(" %s[%d]: ", name, index); + printf(" %s[%d]: ", name, index); else - _mesa_printf(" %s: ", name); - _mesa_printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %u), MaxElem=%u\n", - array->Ptr, array->Type, array->Size, - array->_ElementSize, array->StrideB, - array->BufferObj->Name, array->BufferObj->Size, - array->_MaxElement); + printf(" %s: ", name); + printf("Ptr=%p, Type=0x%x, Size=%d, ElemSize=%u, Stride=%d, Buffer=%u(Size %u), MaxElem=%u\n", + array->Ptr, array->Type, array->Size, + array->_ElementSize, array->StrideB, + array->BufferObj->Name, array->BufferObj->Size, + array->_MaxElement); } @@ -1105,7 +1105,7 @@ _mesa_print_arrays(GLcontext *ctx) _mesa_update_array_object_max_element(ctx, arrayObj); - _mesa_printf("Array Object %u\n", arrayObj->Name); + printf("Array Object %u\n", arrayObj->Name); if (arrayObj->Vertex.Enabled) print_array("Vertex", -1, &arrayObj->Vertex); if (arrayObj->Normal.Enabled) @@ -1118,7 +1118,7 @@ _mesa_print_arrays(GLcontext *ctx) for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) if (arrayObj->VertexAttrib[i].Enabled) print_array("Attrib", i, &arrayObj->VertexAttrib[i]); - _mesa_printf(" _MaxElement = %u\n", arrayObj->_MaxElement); + printf(" _MaxElement = %u\n", arrayObj->_MaxElement); } diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index e474fe7fa5..0d01f16059 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -124,7 +124,7 @@ _mesa_compute_version(GLcontext *ctx) ctx->VersionString = (char *) malloc(max); if (ctx->VersionString) { - _mesa_snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, - ctx->VersionMajor, ctx->VersionMinor); + snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, + ctx->VersionMajor, ctx->VersionMinor); } } diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c index 95ae5a347d..7ea5428aa2 100644 --- a/src/mesa/math/m_debug_clip.c +++ b/src/mesa/math/m_debug_clip.c @@ -270,20 +270,20 @@ static int test_cliptest_function( clip_func func, int np, } if ( dco != rco ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco ); + printf( "\n-----------------------------\n" ); + printf( "dco = 0x%02x rco = 0x%02x\n", dco, rco ); return 0; } if ( dca != rca ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca ); + printf( "\n-----------------------------\n" ); + printf( "dca = 0x%02x rca = 0x%02x\n", dca, rca ); return 0; } for ( i = 0 ; i < TEST_COUNT ; i++ ) { if ( dm[i] != rm[i] ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "(i = %i)\n", i ); - _mesa_printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] ); + printf( "\n-----------------------------\n" ); + printf( "(i = %i)\n", i ); + printf( "dm = 0x%02x rm = 0x%02x\n", dm[i], rm[i] ); return 0; } } @@ -297,19 +297,19 @@ static int test_cliptest_function( clip_func func, int np, for ( i = 0 ; i < TEST_COUNT ; i++ ) { for ( j = 0 ; j < 4 ; j++ ) { if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "\n-----------------------------\n" ); - _mesa_printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n", + printf( "\n-----------------------------\n" ); + printf( "(i = %i, j = %i) dm = 0x%02x rm = 0x%02x\n", i, j, dm[i], rm[i] ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][0], r[i][0], r[i][0]-d[i][0], MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][1], r[i][1], r[i][1]-d[i][1], MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][2], r[i][2], r[i][2]-d[i][2], MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); - _mesa_printf( "%f \t %f \t [diff = %e - %i bit missed]\n", + printf( "%f \t %f \t [diff = %e - %i bit missed]\n", d[i][3], r[i][3], r[i][3]-d[i][3], MAX_PRECISION - significand_match( d[i][3], r[i][3] ) ); return 0; @@ -335,19 +335,19 @@ void _math_test_all_cliptest_functions( char *description ) if ( mesa_profile ) { if ( !counter_overhead ) { INIT_COUNTER(); - _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead ); + printf( "counter overhead: %ld cycles\n\n", counter_overhead ); } - _mesa_printf( "cliptest results after hooking in %s functions:\n", description ); + printf( "cliptest results after hooking in %s functions:\n", description ); } #endif #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf( "\n\t" ); + printf( "\n\t" ); for ( psize = 2 ; psize <= 4 ; psize++ ) { - _mesa_printf( " p%d\t", psize ); + printf( " p%d\t", psize ); } - _mesa_printf( "\n--------------------------------------------------------\n\t" ); + printf( "\n--------------------------------------------------------\n\t" ); } #endif @@ -358,23 +358,23 @@ void _math_test_all_cliptest_functions( char *description ) if ( test_cliptest_function( func, np, psize, cycles ) == 0 ) { char buf[100]; - _mesa_sprintf( buf, "%s[%d] failed test (%s)", + sprintf( buf, "%s[%d] failed test (%s)", cnames[np], psize, description ); _mesa_problem( NULL, buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( " %li\t", benchmark_tab[np][psize-1] ); + printf( " %li\t", benchmark_tab[np][psize-1] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( " | [%s]\n\t", cstrings[np] ); + printf( " | [%s]\n\t", cstrings[np] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( "\n" ); + printf( "\n" ); #endif } diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index f9b26d8047..546e8641da 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -294,15 +294,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles ) for ( i = 0 ; i < TEST_COUNT ; i++ ) { for ( j = 0 ; j < 3 ; j++ ) { if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "-----------------------------\n" ); - _mesa_printf( "(i = %i, j = %i)\n", i, j ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "-----------------------------\n" ); + printf( "(i = %i, j = %i)\n", i, j ); + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d[i][0], r[i][0], r[i][0]/d[i][0], MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d[i][1], r[i][1], r[i][1]/d[i][1], MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d[i][2], r[i][2], r[i][2]/d[i][2], MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); return 0; @@ -310,15 +310,15 @@ static int test_norm_function( normal_func func, int mtype, long *cycles ) if ( norm_normalize_types[mtype] != 0 ) { if ( significand_match( d2[i][j], r2[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf( "------------------- precalculated length case ------\n" ); - _mesa_printf( "(i = %i, j = %i)\n", i, j ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "------------------- precalculated length case ------\n" ); + printf( "(i = %i, j = %i)\n", i, j ); + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d2[i][0], r2[i][0], r2[i][0]/d2[i][0], MAX_PRECISION - significand_match( d2[i][0], r2[i][0] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d2[i][1], r2[i][1], r2[i][1]/d2[i][1], MAX_PRECISION - significand_match( d2[i][1], r2[i][1] ) ); - _mesa_printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", + printf( "%f \t %f \t [ratio = %e - %i bit missed]\n", d2[i][2], r2[i][2], r2[i][2]/d2[i][2], MAX_PRECISION - significand_match( d2[i][2], r2[i][2] ) ); return 0; @@ -346,11 +346,11 @@ void _math_test_all_normal_transform_functions( char *description ) if ( mesa_profile ) { if ( !counter_overhead ) { INIT_COUNTER(); - _mesa_printf( "counter overhead: %ld cycles\n\n", counter_overhead ); + printf( "counter overhead: %ld cycles\n\n", counter_overhead ); } - _mesa_printf( "normal transform results after hooking in %s functions:\n", + printf( "normal transform results after hooking in %s functions:\n", description ); - _mesa_printf( "\n-------------------------------------------------------\n" ); + printf( "\n-------------------------------------------------------\n" ); } #endif @@ -360,21 +360,21 @@ void _math_test_all_normal_transform_functions( char *description ) if ( test_norm_function( func, mtype, cycles ) == 0 ) { char buf[100]; - _mesa_sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)", + sprintf( buf, "_mesa_normal_tab[0][%s] failed test (%s)", norm_strings[mtype], description ); _mesa_problem( NULL, buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf( " %li\t", benchmark_tab[mtype] ); - _mesa_printf( " | [%s]\n", norm_strings[mtype] ); + printf( " %li\t", benchmark_tab[mtype] ); + printf( " | [%s]\n", norm_strings[mtype] ); } #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf( "\n" ); + printf( "\n" ); } #endif } diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index df8cc066b6..df1bc8aadf 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -254,18 +254,18 @@ static int test_transform_function( transform_func func, int psize, for ( i = 0 ; i < TEST_COUNT ; i++ ) { for ( j = 0 ; j < 4 ; j++ ) { if ( significand_match( d[i][j], r[i][j] ) < REQUIRED_PRECISION ) { - _mesa_printf("-----------------------------\n" ); - _mesa_printf("(i = %i, j = %i)\n", i, j ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("-----------------------------\n" ); + printf("(i = %i, j = %i)\n", i, j ); + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][0], r[i][0], r[i][0]-d[i][0], MAX_PRECISION - significand_match( d[i][0], r[i][0] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][1], r[i][1], r[i][1]-d[i][1], MAX_PRECISION - significand_match( d[i][1], r[i][1] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][2], r[i][2], r[i][2]-d[i][2], MAX_PRECISION - significand_match( d[i][2], r[i][2] ) ); - _mesa_printf("%f \t %f \t [diff = %e - %i bit missed]\n", + printf("%f \t %f \t [diff = %e - %i bit missed]\n", d[i][3], r[i][3], r[i][3]-d[i][3], MAX_PRECISION - significand_match( d[i][3], r[i][3] ) ); return 0; @@ -292,19 +292,19 @@ void _math_test_all_transform_functions( char *description ) if ( mesa_profile ) { if ( !counter_overhead ) { INIT_COUNTER(); - _mesa_printf("counter overhead: %lu cycles\n\n", counter_overhead ); + printf("counter overhead: %lu cycles\n\n", counter_overhead ); } - _mesa_printf("transform results after hooking in %s functions:\n", description ); + printf("transform results after hooking in %s functions:\n", description ); } #endif #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) { - _mesa_printf("\n" ); + printf("\n" ); for ( psize = 1 ; psize <= 4 ; psize++ ) { - _mesa_printf(" p%d\t", psize ); + printf(" p%d\t", psize ); } - _mesa_printf("\n--------------------------------------------------------\n" ); + printf("\n--------------------------------------------------------\n" ); } #endif @@ -315,23 +315,23 @@ void _math_test_all_transform_functions( char *description ) if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) { char buf[100]; - _mesa_sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)", - psize, mstrings[mtype], description ); + sprintf(buf, "_mesa_transform_tab[0][%d][%s] failed test (%s)", + psize, mstrings[mtype], description ); _mesa_problem( NULL, buf ); } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf(" %li\t", benchmark_tab[psize-1][mtype] ); + printf(" %li\t", benchmark_tab[psize-1][mtype] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf(" | [%s]\n", mstrings[mtype] ); + printf(" | [%s]\n", mstrings[mtype] ); #endif } #ifdef RUN_DEBUG_BENCHMARK if ( mesa_profile ) - _mesa_printf( "\n" ); + printf( "\n" ); #endif } diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index 4cbab11a35..65c381f383 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -148,27 +148,27 @@ _mesa_vector4f_print( const GLvector4f *v, const GLubyte *cullmask, GLfloat *d = (GLfloat *)v->data; GLuint j, i = 0, count; - _mesa_printf("data-start\n"); + printf("data-start\n"); for (; d != v->start; STRIDE_F(d, v->stride), i++) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); + printf(t, i, d[0], d[1], d[2], d[3]); - _mesa_printf("start-count(%u)\n", v->count); + printf("start-count(%u)\n", v->count); count = i + v->count; if (culling) { for (; i < count; STRIDE_F(d, v->stride), i++) if (cullmask[i]) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); + printf(t, i, d[0], d[1], d[2], d[3]); } else { for (; i < count; STRIDE_F(d, v->stride), i++) - _mesa_printf(t, i, d[0], d[1], d[2], d[3]); + printf(t, i, d[0], d[1], d[2], d[3]); } for (j = v->size; j < 4; j++) { if ((v->flags & (1<data; i < count && d[j] == c[j]; @@ -177,9 +177,9 @@ _mesa_vector4f_print( const GLvector4f *v, const GLubyte *cullmask, } if (i == count) - _mesa_printf(" --> ok\n"); + printf(" --> ok\n"); else - _mesa_printf(" --> Failed at %u ******\n", i); + printf(" --> Failed at %u ******\n", i); } } } diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 03ff30a239..6373529e4e 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -148,7 +148,7 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, } #if DEBUG_FP - _mesa_printf("____________Fragment program %u ________\n", program->Base.Id); + printf("____________Fragment program %u ________\n", program->Base.Id); _mesa_print_program(&program->Base); #endif } @@ -211,7 +211,7 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, program->Base.Parameters = prog.Parameters; #if DEBUG_VP - _mesa_printf("____________Vertex program %u __________\n", program->Base.Id); + printf("____________Vertex program %u __________\n", program->Base.Id); _mesa_print_program(&program->Base); #endif } diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 4f02703619..d03cb4e493 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -200,7 +200,7 @@ do { \ #define RETURN_ERROR2(msg1, msg2) \ do { \ char err[1000]; \ - _mesa_sprintf(err, "%s %s", msg1, msg2); \ + sprintf(err, "%s %s", msg1, msg2); \ record_error(parseState, err, __LINE__); \ return GL_FALSE; \ } while(0) @@ -1566,9 +1566,9 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, #endif #ifdef DEBUG_foo - _mesa_printf("--- glLoadProgramNV(%d) result ---\n", program->Base.Id); + printf("--- glLoadProgramNV(%d) result ---\n", program->Base.Id); _mesa_fprint_program_opt(stdout, &program->Base, PROG_PRINT_NV, 0); - _mesa_printf("----------------------------------\n"); + printf("----------------------------------\n"); #endif } else { diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index fb36303bb9..631b315af3 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -111,7 +111,7 @@ do { \ #define RETURN_ERROR2(msg1, msg2) \ do { \ char err[1000]; \ - _mesa_sprintf(err, "%s %s", msg1, msg2); \ + sprintf(err, "%s %s", msg1, msg2); \ record_error(parseState, err, __LINE__); \ return GL_FALSE; \ } while(0) @@ -1397,9 +1397,9 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, program->IsNVProgram = GL_TRUE; #ifdef DEBUG_foo - _mesa_printf("--- glLoadProgramNV result ---\n"); + printf("--- glLoadProgramNV result ---\n"); _mesa_fprint_program_opt(stdout, &program->Base, PROG_PRINT_NV, 0); - _mesa_printf("------------------------------\n"); + printf("------------------------------\n"); #endif if (program->Base.Parameters) diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index ee422e7ec8..3b51f986e8 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -1782,8 +1782,8 @@ _mesa_execute_program(GLcontext * ctx, { GLfloat a[4]; fetch_vector4(&inst->SrcReg[0], machine, a); - _mesa_printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, - a[0], a[1], a[2], a[3]); + printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, + a[0], a[1], a[2], a[3]); } break; case OPCODE_END: diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 81099cb99c..e5534b20e3 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -345,7 +345,7 @@ _mesa_opcode_string(gl_inst_opcode opcode) return InstInfo[opcode].Name; else { static char s[20]; - _mesa_snprintf(s, sizeof(s), "OP%u", opcode); + snprintf(s, sizeof(s), "OP%u", opcode); return s; } } diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 09816d5044..2941a17da3 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -159,7 +159,7 @@ _mesa_consolidate_registers(struct gl_program *prog) GLuint tempMax = 0, i; if (dbg) { - _mesa_printf("Optimize: Begin register consolidation\n"); + printf("Optimize: Begin register consolidation\n"); } memset(tempUsed, 0, sizeof(tempUsed)); @@ -196,7 +196,7 @@ _mesa_consolidate_registers(struct gl_program *prog) for (i = 0; i <= tempMax; i++) { if (tempUsed[i]) { tempMap[i] = freeTemp++; - /*_mesa_printf("replace %u with %u\n", i, tempMap[i]);*/ + /*printf("replace %u with %u\n", i, tempMap[i]);*/ } } if (freeTemp == tempMax + 1) { @@ -204,14 +204,14 @@ _mesa_consolidate_registers(struct gl_program *prog) return; } if (dbg) { - _mesa_printf("Replace regs 0..%u with 0..%u\n", tempMax, freeTemp-1); + printf("Replace regs 0..%u with 0..%u\n", tempMax, freeTemp-1); } } replace_regs(prog, PROGRAM_TEMPORARY, tempMap); if (dbg) { - _mesa_printf("Optimize: End register consolidation\n"); + printf("Optimize: End register consolidation\n"); } } @@ -232,7 +232,7 @@ _mesa_remove_dead_code(struct gl_program *prog) memset(tempRead, 0, sizeof(tempRead)); if (dbg) { - _mesa_printf("Optimize: Begin dead code removal\n"); + printf("Optimize: Begin dead code removal\n"); /*_mesa_print_program(prog);*/ } @@ -255,7 +255,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->SrcReg[j].RelAddr) { if (dbg) - _mesa_printf("abort remove dead code (indirect temp)\n"); + printf("abort remove dead code (indirect temp)\n"); goto done; } @@ -290,7 +290,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.RelAddr) { if (dbg) - _mesa_printf("abort remove dead code (indirect temp)\n"); + printf("abort remove dead code (indirect temp)\n"); goto done; } @@ -319,7 +319,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (!tempRead[index][chan] && inst->DstReg.WriteMask & (1 << chan)) { if (dbg) { - _mesa_printf("Remove writemask on %u.%c\n", i, + printf("Remove writemask on %u.%c\n", i, chan == 3 ? 'w' : 'x' + chan); } inst->DstReg.WriteMask &= ~(1 << chan); @@ -330,7 +330,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.WriteMask == 0) { /* If we cleared all writes, the instruction can be removed. */ if (dbg) - _mesa_printf("Remove instruction %u: \n", i); + printf("Remove instruction %u: \n", i); removeInst[i] = GL_TRUE; } } @@ -340,9 +340,9 @@ _mesa_remove_dead_code(struct gl_program *prog) rem = remove_instructions(prog, removeInst); if (dbg) { - _mesa_printf("Optimize: End dead code removal.\n"); - _mesa_printf(" %u channel writes removed\n", rem); - _mesa_printf(" %u instructions removed\n", rem); + printf("Optimize: End dead code removal.\n"); + printf(" %u channel writes removed\n", rem); + printf(" %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ } @@ -427,7 +427,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog) GLuint i, j; if (dbg) { - _mesa_printf("Optimize: Begin remove extra move use\n"); + printf("Optimize: Begin remove extra move use\n"); _mesa_print_program(prog); } @@ -518,7 +518,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog) } if (dbg) { - _mesa_printf("Optimize: End remove extra move use.\n"); + printf("Optimize: End remove extra move use.\n"); /*_mesa_print_program(prog);*/ } } @@ -533,7 +533,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) GLuint i, rem, loopNesting = 0, subroutineNesting = 0; if (dbg) { - _mesa_printf("Optimize: Begin remove extra moves\n"); + printf("Optimize: Begin remove extra moves\n"); _mesa_print_program(prog); } @@ -605,8 +605,8 @@ _mesa_remove_extra_moves(struct gl_program *prog) removeInst[i] = GL_TRUE; if (dbg) { - _mesa_printf("Remove MOV at %u\n", i); - _mesa_printf("new prev inst %u: ", prevI); + printf("Remove MOV at %u\n", i); + printf("new prev inst %u: ", prevI); _mesa_print_instruction(prevInst); } } @@ -624,7 +624,7 @@ _mesa_remove_extra_moves(struct gl_program *prog) free(removeInst); if (dbg) { - _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem); + printf("Optimize: End remove extra moves. %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ } } @@ -837,7 +837,7 @@ find_live_intervals(struct gl_program *prog, */ if (dbg) { - _mesa_printf("Optimize: Begin find intervals\n"); + printf("Optimize: Begin find intervals\n"); } /* build intermediate arrays */ @@ -864,16 +864,16 @@ find_live_intervals(struct gl_program *prog, /* print interval info */ for (i = 0; i < liveIntervals->Num; i++) { const struct interval *inv = liveIntervals->Intervals + i; - _mesa_printf("Reg[%d] live [%d, %d]:", + printf("Reg[%d] live [%d, %d]:", inv->Reg, inv->Start, inv->End); if (1) { GLuint j; for (j = 0; j < inv->Start; j++) - _mesa_printf(" "); + printf(" "); for (j = inv->Start; j <= inv->End; j++) - _mesa_printf("x"); + printf("x"); } - _mesa_printf("\n"); + printf("\n"); } } @@ -914,7 +914,7 @@ _mesa_reallocate_registers(struct gl_program *prog) GLint maxTemp = -1; if (dbg) { - _mesa_printf("Optimize: Begin live-interval register reallocation\n"); + printf("Optimize: Begin live-interval register reallocation\n"); _mesa_print_program(prog); } @@ -925,7 +925,7 @@ _mesa_reallocate_registers(struct gl_program *prog) if (!find_live_intervals(prog, &liveIntervals)) { if (dbg) - _mesa_printf("Aborting register reallocation\n"); + printf("Aborting register reallocation\n"); return; } @@ -938,7 +938,7 @@ _mesa_reallocate_registers(struct gl_program *prog) const struct interval *live = liveIntervals.Intervals + i; if (dbg) - _mesa_printf("Consider register %u\n", live->Reg); + printf("Consider register %u\n", live->Reg); /* Expire old intervals. Intervals which have ended with respect * to the live interval can have their remapped registers freed. @@ -959,7 +959,7 @@ _mesa_reallocate_registers(struct gl_program *prog) ASSERT(regNew >= 0); if (dbg) - _mesa_printf(" expire interval for reg %u\n", inv->Reg); + printf(" expire interval for reg %u\n", inv->Reg); /* remove interval j from active list */ remove_interval(&activeIntervals, inv); @@ -967,7 +967,7 @@ _mesa_reallocate_registers(struct gl_program *prog) /* return register regNew to the free pool */ if (dbg) - _mesa_printf(" free reg %d\n", regNew); + printf(" free reg %d\n", regNew); ASSERT(usedRegs[regNew] == GL_TRUE); usedRegs[regNew] = GL_FALSE; } @@ -984,7 +984,7 @@ _mesa_reallocate_registers(struct gl_program *prog) registerMap[live->Reg] = k; maxTemp = MAX2(maxTemp, k); if (dbg) - _mesa_printf(" remap register %u -> %d\n", live->Reg, k); + printf(" remap register %u -> %d\n", live->Reg, k); } /* Insert this live interval into the active list which is sorted @@ -1005,8 +1005,8 @@ _mesa_reallocate_registers(struct gl_program *prog) } if (dbg) { - _mesa_printf("Optimize: End live-interval register reallocation\n"); - _mesa_printf("Num temp regs before: %u after: %u\n", + printf("Optimize: End live-interval register reallocation\n"); + printf("Num temp regs before: %u after: %u\n", liveIntervals.Num, maxTemp + 1); _mesa_print_program(prog); } diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index b238537673..a933f21857 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -77,7 +77,7 @@ file_string(gl_register_file f, gl_prog_print_mode mode) default: { static char s[20]; - _mesa_snprintf(s, sizeof(s), "FILE%u", f); + snprintf(s, sizeof(s), "FILE%u", f); return s; } } @@ -172,12 +172,12 @@ arb_input_attrib_string(GLint index, GLenum progType) void _mesa_print_vp_inputs(GLbitfield inputs) { - _mesa_printf("VP Inputs 0x%x: \n", inputs); + printf("VP Inputs 0x%x: \n", inputs); while (inputs) { GLint attr = _mesa_ffs(inputs) - 1; const char *name = arb_input_attrib_string(attr, GL_VERTEX_PROGRAM_ARB); - _mesa_printf(" %d: %s\n", attr, name); + printf(" %d: %s\n", attr, name); inputs &= ~(1 << attr); } } @@ -190,12 +190,12 @@ _mesa_print_vp_inputs(GLbitfield inputs) void _mesa_print_fp_inputs(GLbitfield inputs) { - _mesa_printf("FP Inputs 0x%x: \n", inputs); + printf("FP Inputs 0x%x: \n", inputs); while (inputs) { GLint attr = _mesa_ffs(inputs) - 1; const char *name = arb_input_attrib_string(attr, GL_FRAGMENT_PROGRAM_ARB); - _mesa_printf(" %d: %s\n", attr, name); + printf(" %d: %s\n", attr, name); inputs &= ~(1 << attr); } } @@ -274,46 +274,46 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, switch (mode) { case PROG_PRINT_DEBUG: - _mesa_sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index); + sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index); break; case PROG_PRINT_ARB: switch (f) { case PROGRAM_INPUT: - _mesa_sprintf(str, "%s", arb_input_attrib_string(index, prog->Target)); + sprintf(str, "%s", arb_input_attrib_string(index, prog->Target)); break; case PROGRAM_OUTPUT: - _mesa_sprintf(str, "%s", arb_output_attrib_string(index, prog->Target)); + sprintf(str, "%s", arb_output_attrib_string(index, prog->Target)); break; case PROGRAM_TEMPORARY: - _mesa_sprintf(str, "temp%d", index); + sprintf(str, "temp%d", index); break; case PROGRAM_ENV_PARAM: - _mesa_sprintf(str, "program.env[%s%d]", addr, index); + sprintf(str, "program.env[%s%d]", addr, index); break; case PROGRAM_LOCAL_PARAM: - _mesa_sprintf(str, "program.local[%s%d]", addr, index); + sprintf(str, "program.local[%s%d]", addr, index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%s%d]", addr, index); + sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%s%d]", addr, index); + sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%s%d]", addr, index); + sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: { struct gl_program_parameter *param = prog->Parameters->Parameters + index; char *state = _mesa_program_state_string(param->StateIndexes); - _mesa_sprintf(str, state); + sprintf(str, state); free(state); } break; case PROGRAM_ADDRESS: - _mesa_sprintf(str, "A%d", index); + sprintf(str, "A%d", index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); @@ -324,30 +324,30 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, switch (f) { case PROGRAM_INPUT: if (prog->Target == GL_VERTEX_PROGRAM_ARB) - _mesa_sprintf(str, "v[%d]", index); + sprintf(str, "v[%d]", index); else - _mesa_sprintf(str, "f[%d]", index); + sprintf(str, "f[%d]", index); break; case PROGRAM_OUTPUT: - _mesa_sprintf(str, "o[%d]", index); + sprintf(str, "o[%d]", index); break; case PROGRAM_TEMPORARY: - _mesa_sprintf(str, "R%d", index); + sprintf(str, "R%d", index); break; case PROGRAM_ENV_PARAM: - _mesa_sprintf(str, "c[%d]", index); + sprintf(str, "c[%d]", index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%s%d]", addr, index); + sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%s%d]", addr, index); + sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%s%d]", addr, index); + sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: /* extension */ - _mesa_sprintf(str, "state[%s%d]", addr, index); + sprintf(str, "state[%s%d]", addr, index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); @@ -419,11 +419,11 @@ void _mesa_print_swizzle(GLuint swizzle) { if (swizzle == SWIZZLE_XYZW) { - _mesa_printf(".xyzw\n"); + printf(".xyzw\n"); } else { const char *s = _mesa_swizzle_string(swizzle, 0, 0); - _mesa_printf("%s\n", s); + printf("%s\n", s); } } @@ -476,23 +476,23 @@ fprint_dst_reg(FILE * f, gl_prog_print_mode mode, const struct gl_program *prog) { - _mesa_fprintf(f, "%s%s", - reg_string((gl_register_file) dstReg->File, - dstReg->Index, mode, dstReg->RelAddr, prog), - _mesa_writemask_string(dstReg->WriteMask)); - + fprintf(f, "%s%s", + reg_string((gl_register_file) dstReg->File, + dstReg->Index, mode, dstReg->RelAddr, prog), + _mesa_writemask_string(dstReg->WriteMask)); + if (dstReg->CondMask != COND_TR) { - _mesa_fprintf(f, " (%s.%s)", - _mesa_condcode_string(dstReg->CondMask), - _mesa_swizzle_string(dstReg->CondSwizzle, - GL_FALSE, GL_FALSE)); + fprintf(f, " (%s.%s)", + _mesa_condcode_string(dstReg->CondMask), + _mesa_swizzle_string(dstReg->CondSwizzle, + GL_FALSE, GL_FALSE)); } #if 0 - _mesa_fprintf(f, "%s[%d]%s", - file_string((gl_register_file) dstReg->File, mode), - dstReg->Index, - _mesa_writemask_string(dstReg->WriteMask)); + fprintf(f, "%s[%d]%s", + file_string((gl_register_file) dstReg->File, mode), + dstReg->Index, + _mesa_writemask_string(dstReg->WriteMask)); #endif } @@ -505,19 +505,19 @@ fprint_src_reg(FILE *f, { const char *abs = srcReg->Abs ? "|" : ""; - _mesa_fprintf(f, "%s%s%s%s", - abs, - reg_string((gl_register_file) srcReg->File, - srcReg->Index, mode, srcReg->RelAddr, prog), - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->Negate, GL_FALSE), - abs); + fprintf(f, "%s%s%s%s", + abs, + reg_string((gl_register_file) srcReg->File, + srcReg->Index, mode, srcReg->RelAddr, prog), + _mesa_swizzle_string(srcReg->Swizzle, + srcReg->Negate, GL_FALSE), + abs); #if 0 - _mesa_fprintf(f, "%s[%d]%s", - file_string((gl_register_file) srcReg->File, mode), - srcReg->Index, - _mesa_swizzle_string(srcReg->Swizzle, - srcReg->Negate, GL_FALSE)); + fprintf(f, "%s[%d]%s", + file_string((gl_register_file) srcReg->File, mode), + srcReg->Index, + _mesa_swizzle_string(srcReg->Swizzle, + srcReg->Negate, GL_FALSE)); #endif } @@ -526,9 +526,9 @@ static void fprint_comment(FILE *f, const struct prog_instruction *inst) { if (inst->Comment) - _mesa_fprintf(f, "; # %s\n", inst->Comment); + fprintf(f, "; # %s\n", inst->Comment); else - _mesa_fprintf(f, ";\n"); + fprintf(f, ";\n"); } @@ -541,29 +541,29 @@ fprint_alu_instruction(FILE *f, { GLuint j; - _mesa_fprintf(f, "%s", opcode_string); + fprintf(f, "%s", opcode_string); if (inst->CondUpdate) - _mesa_fprintf(f, ".C"); + fprintf(f, ".C"); /* frag prog only */ if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_fprintf(f, "_SAT"); + fprintf(f, "_SAT"); - _mesa_fprintf(f, " "); + fprintf(f, " "); if (inst->DstReg.File != PROGRAM_UNDEFINED) { fprint_dst_reg(f, &inst->DstReg, mode, prog); } else { - _mesa_fprintf(f, " ???"); + fprintf(f, " ???"); } if (numRegs > 0) - _mesa_fprintf(f, ", "); + fprintf(f, ", "); for (j = 0; j < numRegs; j++) { fprint_src_reg(f, inst->SrcReg + j, mode, prog); if (j + 1 < numRegs) - _mesa_fprintf(f, ", "); + fprintf(f, ", "); } fprint_comment(f, inst); @@ -598,177 +598,177 @@ _mesa_fprint_instruction_opt(FILE *f, indent -= 3; } for (i = 0; i < indent; i++) { - _mesa_fprintf(f, " "); + fprintf(f, " "); } switch (inst->Opcode) { case OPCODE_PRINT: - _mesa_fprintf(f, "PRINT '%s'", inst->Data); + fprintf(f, "PRINT '%s'", inst->Data); if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { - _mesa_fprintf(f, ", "); - _mesa_fprintf(f, "%s[%d]%s", - file_string((gl_register_file) inst->SrcReg[0].File, - mode), - inst->SrcReg[0].Index, - _mesa_swizzle_string(inst->SrcReg[0].Swizzle, - inst->SrcReg[0].Negate, GL_FALSE)); + fprintf(f, ", "); + fprintf(f, "%s[%d]%s", + file_string((gl_register_file) inst->SrcReg[0].File, + mode), + inst->SrcReg[0].Index, + _mesa_swizzle_string(inst->SrcReg[0].Swizzle, + inst->SrcReg[0].Negate, GL_FALSE)); } if (inst->Comment) - _mesa_fprintf(f, " # %s", inst->Comment); + fprintf(f, " # %s", inst->Comment); fprint_comment(f, inst); break; case OPCODE_SWZ: - _mesa_fprintf(f, "SWZ"); + fprintf(f, "SWZ"); if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_fprintf(f, "_SAT"); - _mesa_fprintf(f, " "); + fprintf(f, "_SAT"); + fprintf(f, " "); fprint_dst_reg(f, &inst->DstReg, mode, prog); - _mesa_fprintf(f, ", %s[%d], %s", - file_string((gl_register_file) inst->SrcReg[0].File, - mode), - inst->SrcReg[0].Index, - _mesa_swizzle_string(inst->SrcReg[0].Swizzle, - inst->SrcReg[0].Negate, GL_TRUE)); + fprintf(f, ", %s[%d], %s", + file_string((gl_register_file) inst->SrcReg[0].File, + mode), + inst->SrcReg[0].Index, + _mesa_swizzle_string(inst->SrcReg[0].Swizzle, + inst->SrcReg[0].Negate, GL_TRUE)); fprint_comment(f, inst); break; case OPCODE_TEX: case OPCODE_TXP: case OPCODE_TXL: case OPCODE_TXB: - _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); if (inst->SaturateMode == SATURATE_ZERO_ONE) - _mesa_fprintf(f, "_SAT"); - _mesa_fprintf(f, " "); + fprintf(f, "_SAT"); + fprintf(f, " "); fprint_dst_reg(f, &inst->DstReg, mode, prog); - _mesa_fprintf(f, ", "); + fprintf(f, ", "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); - _mesa_fprintf(f, ", texture[%d], ", inst->TexSrcUnit); + fprintf(f, ", texture[%d], ", inst->TexSrcUnit); switch (inst->TexSrcTarget) { - case TEXTURE_1D_INDEX: _mesa_fprintf(f, "1D"); break; - case TEXTURE_2D_INDEX: _mesa_fprintf(f, "2D"); break; - case TEXTURE_3D_INDEX: _mesa_fprintf(f, "3D"); break; - case TEXTURE_CUBE_INDEX: _mesa_fprintf(f, "CUBE"); break; - case TEXTURE_RECT_INDEX: _mesa_fprintf(f, "RECT"); break; + case TEXTURE_1D_INDEX: fprintf(f, "1D"); break; + case TEXTURE_2D_INDEX: fprintf(f, "2D"); break; + case TEXTURE_3D_INDEX: fprintf(f, "3D"); break; + case TEXTURE_CUBE_INDEX: fprintf(f, "CUBE"); break; + case TEXTURE_RECT_INDEX: fprintf(f, "RECT"); break; default: ; } if (inst->TexShadow) - _mesa_fprintf(f, " SHADOW"); + fprintf(f, " SHADOW"); fprint_comment(f, inst); break; case OPCODE_KIL: - _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); - _mesa_fprintf(f, " "); + fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + fprintf(f, " "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); fprint_comment(f, inst); break; case OPCODE_KIL_NV: - _mesa_fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); - _mesa_fprintf(f, " "); - _mesa_fprintf(f, "%s.%s", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, - GL_FALSE, GL_FALSE)); + fprintf(f, "%s", _mesa_opcode_string(inst->Opcode)); + fprintf(f, " "); + fprintf(f, "%s.%s", + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, + GL_FALSE, GL_FALSE)); fprint_comment(f, inst); break; case OPCODE_ARL: - _mesa_fprintf(f, "ARL "); + fprintf(f, "ARL "); fprint_dst_reg(f, &inst->DstReg, mode, prog); - _mesa_fprintf(f, ", "); + fprintf(f, ", "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); fprint_comment(f, inst); break; case OPCODE_BRA: - _mesa_fprintf(f, "BRA %d (%s%s)", - inst->BranchTarget, - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); + fprintf(f, "BRA %d (%s%s)", + inst->BranchTarget, + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); fprint_comment(f, inst); break; case OPCODE_IF: if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { /* Use ordinary register */ - _mesa_fprintf(f, "IF "); + fprintf(f, "IF "); fprint_src_reg(f, &inst->SrcReg[0], mode, prog); - _mesa_fprintf(f, "; "); + fprintf(f, "; "); } else { /* Use cond codes */ - _mesa_fprintf(f, "IF (%s%s);", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, - 0, GL_FALSE)); + fprintf(f, "IF (%s%s);", + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, + 0, GL_FALSE)); } - _mesa_fprintf(f, " # (if false, goto %d)", inst->BranchTarget); + fprintf(f, " # (if false, goto %d)", inst->BranchTarget); fprint_comment(f, inst); return indent + 3; case OPCODE_ELSE: - _mesa_fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget); + fprintf(f, "ELSE; # (goto %d)\n", inst->BranchTarget); return indent + 3; case OPCODE_ENDIF: - _mesa_fprintf(f, "ENDIF;\n"); + fprintf(f, "ENDIF;\n"); break; case OPCODE_BGNLOOP: - _mesa_fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget); + fprintf(f, "BGNLOOP; # (end at %d)\n", inst->BranchTarget); return indent + 3; case OPCODE_ENDLOOP: - _mesa_fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget); + fprintf(f, "ENDLOOP; # (goto %d)\n", inst->BranchTarget); break; case OPCODE_BRK: case OPCODE_CONT: - _mesa_fprintf(f, "%s (%s%s); # (goto %d)", - _mesa_opcode_string(inst->Opcode), - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE), - inst->BranchTarget); + fprintf(f, "%s (%s%s); # (goto %d)", + _mesa_opcode_string(inst->Opcode), + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE), + inst->BranchTarget); fprint_comment(f, inst); break; case OPCODE_BGNSUB: if (mode == PROG_PRINT_NV) { - _mesa_fprintf(f, "%s:\n", inst->Comment); /* comment is label */ + fprintf(f, "%s:\n", inst->Comment); /* comment is label */ return indent; } else { - _mesa_fprintf(f, "BGNSUB"); + fprintf(f, "BGNSUB"); fprint_comment(f, inst); return indent + 3; } case OPCODE_ENDSUB: if (mode == PROG_PRINT_DEBUG) { - _mesa_fprintf(f, "ENDSUB"); + fprintf(f, "ENDSUB"); fprint_comment(f, inst); } break; case OPCODE_CAL: if (mode == PROG_PRINT_NV) { - _mesa_fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget); + fprintf(f, "CAL %s; # (goto %d)\n", inst->Comment, inst->BranchTarget); } else { - _mesa_fprintf(f, "CAL %u", inst->BranchTarget); + fprintf(f, "CAL %u", inst->BranchTarget); fprint_comment(f, inst); } break; case OPCODE_RET: - _mesa_fprintf(f, "RET (%s%s)", - _mesa_condcode_string(inst->DstReg.CondMask), - _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); + fprintf(f, "RET (%s%s)", + _mesa_condcode_string(inst->DstReg.CondMask), + _mesa_swizzle_string(inst->DstReg.CondSwizzle, 0, GL_FALSE)); fprint_comment(f, inst); break; case OPCODE_END: - _mesa_fprintf(f, "END\n"); + fprintf(f, "END\n"); break; case OPCODE_NOP: if (mode == PROG_PRINT_DEBUG) { - _mesa_fprintf(f, "NOP"); + fprintf(f, "NOP"); fprint_comment(f, inst); } else if (inst->Comment) { /* ARB/NV extensions don't have NOP instruction */ - _mesa_fprintf(f, "# %s\n", inst->Comment); + fprintf(f, "# %s\n", inst->Comment); } break; /* XXX may need other special-case instructions */ @@ -825,26 +825,26 @@ _mesa_fprint_program_opt(FILE *f, switch (prog->Target) { case GL_VERTEX_PROGRAM_ARB: if (mode == PROG_PRINT_ARB) - _mesa_fprintf(f, "!!ARBvp1.0\n"); + fprintf(f, "!!ARBvp1.0\n"); else if (mode == PROG_PRINT_NV) - _mesa_fprintf(f, "!!VP1.0\n"); + fprintf(f, "!!VP1.0\n"); else - _mesa_fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); + fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); break; case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: if (mode == PROG_PRINT_ARB) - _mesa_fprintf(f, "!!ARBfp1.0\n"); + fprintf(f, "!!ARBfp1.0\n"); else if (mode == PROG_PRINT_NV) - _mesa_fprintf(f, "!!FP1.0\n"); + fprintf(f, "!!FP1.0\n"); else - _mesa_fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); + fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); break; } for (i = 0; i < prog->NumInstructions; i++) { if (lineNumbers) - _mesa_fprintf(f, "%3d: ", i); + fprintf(f, "%3d: ", i); indent = _mesa_fprint_instruction_opt(f, prog->Instructions + i, indent, mode, prog); } @@ -896,30 +896,30 @@ _mesa_fprint_program_parameters(FILE *f, { GLuint i; - _mesa_fprintf(f, "InputsRead: 0x%x (0b%s)\n", + fprintf(f, "InputsRead: 0x%x (0b%s)\n", prog->InputsRead, binary(prog->InputsRead)); - _mesa_fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n", + fprintf(f, "OutputsWritten: 0x%llx (0b%s)\n", prog->OutputsWritten, binary(prog->OutputsWritten)); - _mesa_fprintf(f, "NumInstructions=%d\n", prog->NumInstructions); - _mesa_fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries); - _mesa_fprintf(f, "NumParameters=%d\n", prog->NumParameters); - _mesa_fprintf(f, "NumAttributes=%d\n", prog->NumAttributes); - _mesa_fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs); - _mesa_fprintf(f, "SamplersUsed: 0x%x (0b%s)\n", + fprintf(f, "NumInstructions=%d\n", prog->NumInstructions); + fprintf(f, "NumTemporaries=%d\n", prog->NumTemporaries); + fprintf(f, "NumParameters=%d\n", prog->NumParameters); + fprintf(f, "NumAttributes=%d\n", prog->NumAttributes); + fprintf(f, "NumAddressRegs=%d\n", prog->NumAddressRegs); + fprintf(f, "SamplersUsed: 0x%x (0b%s)\n", prog->SamplersUsed, binary(prog->SamplersUsed)); - _mesa_fprintf(f, "Samplers=[ "); + fprintf(f, "Samplers=[ "); for (i = 0; i < MAX_SAMPLERS; i++) { - _mesa_fprintf(f, "%d ", prog->SamplerUnits[i]); + fprintf(f, "%d ", prog->SamplerUnits[i]); } - _mesa_fprintf(f, "]\n"); + fprintf(f, "]\n"); _mesa_load_state_parameters(ctx, prog->Parameters); #if 0 - _mesa_fprintf(f, "Local Params:\n"); + fprintf(f, "Local Params:\n"); for (i = 0; i < MAX_PROGRAM_LOCAL_PARAMS; i++){ const GLfloat *p = prog->LocalParams[i]; - _mesa_fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); + fprintf(f, "%2d: %f, %f, %f, %f\n", i, p[0], p[1], p[2], p[3]); } #endif _mesa_print_parameter_list(prog->Parameters); @@ -950,24 +950,24 @@ _mesa_fprint_parameter_list(FILE *f, return; if (0) - _mesa_fprintf(f, "param list %p\n", (void *) list); - _mesa_fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags); + fprintf(f, "param list %p\n", (void *) list); + fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags); for (i = 0; i < list->NumParameters; i++){ struct gl_program_parameter *param = list->Parameters + i; const GLfloat *v = list->ParameterValues[i]; - _mesa_fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}", - i, param->Size, - file_string(list->Parameters[i].Type, mode), - param->Name, v[0], v[1], v[2], v[3]); + fprintf(f, "param[%d] sz=%d %s %s = {%.3g, %.3g, %.3g, %.3g}", + i, param->Size, + file_string(list->Parameters[i].Type, mode), + param->Name, v[0], v[1], v[2], v[3]); if (param->Flags & PROG_PARAM_BIT_CENTROID) - _mesa_fprintf(f, " Centroid"); + fprintf(f, " Centroid"); if (param->Flags & PROG_PARAM_BIT_INVARIANT) - _mesa_fprintf(f, " Invariant"); + fprintf(f, " Invariant"); if (param->Flags & PROG_PARAM_BIT_FLAT) - _mesa_fprintf(f, " Flat"); + fprintf(f, " Flat"); if (param->Flags & PROG_PARAM_BIT_LINEAR) - _mesa_fprintf(f, " Linear"); - _mesa_fprintf(f, "\n"); + fprintf(f, " Linear"); + fprintf(f, "\n"); } } @@ -997,7 +997,7 @@ _mesa_write_shader_to_file(const struct gl_shader *shader) else type = "vert"; - _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); + snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "w"); if (!f) { fprintf(stderr, "Unable to open %s for writing\n", filename); @@ -1047,7 +1047,7 @@ _mesa_append_uniforms_to_file(const struct gl_shader *shader, else type = "vert"; - _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); + snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "a"); /* append */ if (!f) { fprintf(stderr, "Unable to open %s for appending\n", filename); diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 2c844490dd..ead3ece95d 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -950,7 +950,7 @@ static void append_index(char *dst, GLint index) { char s[20]; - _mesa_sprintf(s, "[%d]", index); + sprintf(s, "[%d]", index); append(dst, s); } @@ -1029,9 +1029,9 @@ _mesa_program_state_string(const gl_state_index state[STATE_LENGTH]) if (modifier) append_token(str, modifier); if (firstRow == lastRow) - _mesa_sprintf(tmp, ".row[%d]", firstRow); + sprintf(tmp, ".row[%d]", firstRow); else - _mesa_sprintf(tmp, ".row[%d..%d]", firstRow, lastRow); + sprintf(tmp, ".row[%d..%d]", firstRow, lastRow); append(str, tmp); } break; diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index e5ef25ec38..3f26f9f84a 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -2984,7 +2984,7 @@ yyreduce: { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; @@ -3001,7 +3001,7 @@ yyreduce: { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; @@ -4915,7 +4915,7 @@ yyreduce: if (exist != NULL) { char m[1000]; - _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); + snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); free((yyvsp[(2) - (4)].string)); yyerror(& (yylsp[(2) - (4)]), state, m); YYERROR; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 299e2477e4..1c856d859d 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -936,7 +936,7 @@ addrRegPosOffset: INTEGER { if (($1 < 0) || ($1 > 63)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", $1); yyerror(& @1, state, s); YYERROR; @@ -950,7 +950,7 @@ addrRegNegOffset: INTEGER { if (($1 < 0) || ($1 > 64)) { char s[100]; - _mesa_snprintf(s, sizeof(s), + snprintf(s, sizeof(s), "relative address offset too large (%d)", $1); yyerror(& @1, state, s); YYERROR; @@ -2173,7 +2173,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER if (exist != NULL) { char m[1000]; - _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2); + snprintf(m, sizeof(m), "redeclared identifier: %s", $2); free($2); yyerror(& @2, state, m); YYERROR; diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index ad3ff26c58..8bd780b0b0 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1483,12 +1483,12 @@ _mesa_link_program(GLcontext *ctx, GLuint program) if (0) { GLuint i; - _mesa_printf("Link %u shaders in program %u: %s\n", + printf("Link %u shaders in program %u: %s\n", shProg->NumShaders, shProg->Name, shProg->LinkStatus ? "Success" : "Failed"); for (i = 0; i < shProg->NumShaders; i++) { - _mesa_printf(" shader %u, type 0x%x\n", + printf(" shader %u, type 0x%x\n", shProg->Shaders[i]->Name, shProg->Shaders[i]->Type); } @@ -1504,7 +1504,7 @@ print_shader_info(const struct gl_shader_program *shProg) { GLuint i; - _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); + printf("Mesa: glUseProgram(%u)\n", shProg->Name); for (i = 0; i < shProg->NumShaders; i++) { const char *s; switch (shProg->Shaders[i]->Type) { @@ -1520,14 +1520,14 @@ print_shader_info(const struct gl_shader_program *shProg) default: s = ""; } - _mesa_printf(" %s shader %u, checksum %u\n", s, - shProg->Shaders[i]->Name, - shProg->Shaders[i]->SourceChecksum); + printf(" %s shader %u, checksum %u\n", s, + shProg->Shaders[i]->Name, + shProg->Shaders[i]->SourceChecksum); } if (shProg->VertexProgram) - _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); if (shProg->FragmentProgram) - _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); + printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); } @@ -1697,8 +1697,8 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, /* This maps a sampler to a texture unit: */ if (sampler < MAX_SAMPLERS) { #if 0 - _mesa_printf("Set program %p sampler %d '%s' to unit %u\n", - program, sampler, param->Name, texUnit); + printf("Set program %p sampler %d '%s' to unit %u\n", + program, sampler, param->Name, texUnit); #endif if (program->SamplerUnits[sampler] != texUnit) { program->SamplerUnits[sampler] = texUnit; @@ -1861,21 +1861,21 @@ _mesa_uniform(GLcontext *ctx, GLint location, GLsizei count, if (ctx->Shader.Flags & GLSL_UNIFORMS) { GLint i; - _mesa_printf("Mesa: set program %u uniform %s (loc %d) to: ", - shProg->Name, uniform->Name, location); + printf("Mesa: set program %u uniform %s (loc %d) to: ", + shProg->Name, uniform->Name, location); if (basicType == GL_INT) { const GLint *v = (const GLint *) values; for (i = 0; i < count * elems; i++) { - _mesa_printf("%d ", v[i]); + printf("%d ", v[i]); } } else { const GLfloat *v = (const GLfloat *) values; for (i = 0; i < count * elems; i++) { - _mesa_printf("%g ", v[i]); + printf("%g ", v[i]); } } - _mesa_printf("\n"); + printf("\n"); } /* A uniform var may be used by both a vertex shader and a fragment @@ -2076,9 +2076,9 @@ validate_samplers(GLcontext *ctx, const struct gl_program *prog, char *errMsg) unit = prog->SamplerUnits[sampler]; target = prog->SamplerTargets[sampler]; if (targetUsed[unit] != -1 && targetUsed[unit] != target) { - _mesa_snprintf(errMsg, 100, - "Texture unit %d is accessed both as %s and %s", - unit, targetName[targetUsed[unit]], targetName[target]); + snprintf(errMsg, 100, + "Texture unit %d is accessed both as %s and %s", + unit, targetName[targetUsed[unit]], targetName[target]); return GL_FALSE; } targetUsed[unit] = target; diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 6901b93d5d..b17256bb1e 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1643,7 +1643,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, if (A->pragmas->Debug) { char s[1000]; - _mesa_snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name); + snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name); n->Comment = _slang_strdup(s); } @@ -2190,7 +2190,7 @@ _slang_make_array_constructor(slang_assemble_ctx *A, slang_operation *oper) */ slang_variable *p = slang_variable_scope_grow(fun->parameters); char name[10]; - _mesa_snprintf(name, sizeof(name), "p%d", i); + snprintf(name, sizeof(name), "p%d", i); p->a_name = slang_atom_pool_atom(A->atoms, name); p->type.qualifier = SLANG_QUAL_CONST; p->type.specifier.type = baseType; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 8bd699ff9d..52fe786890 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2303,8 +2303,8 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) /* error */ char s[100]; /* XXX isn't this really an out of memory/resources error? */ - _mesa_snprintf(s, sizeof(s), "Undefined variable '%s'", - (char *) n->Var->a_name); + snprintf(s, sizeof(s), "Undefined variable '%s'", + (char *) n->Var->a_name); slang_info_log_error(emitInfo->log, s); return NULL; } diff --git a/src/mesa/shader/slang/slang_label.c b/src/mesa/shader/slang/slang_label.c index 7e00b5787f..225612a936 100644 --- a/src/mesa/shader/slang/slang_label.c +++ b/src/mesa/shader/slang/slang_label.c @@ -37,7 +37,7 @@ _slang_label_new_unique(const char *name) free(l); return NULL; } - _mesa_sprintf(l->Name, "%s_%d", name, id); + sprintf(l->Name, "%s_%d", name, id); id++; l->Location = -1; } diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 89658c1a39..b59fc0a43a 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -139,16 +139,16 @@ link_varying_vars(GLcontext *ctx, } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { char msg[100]; - _mesa_snprintf(msg, sizeof(msg), - "centroid modifier mismatch for '%s'", var->Name); + snprintf(msg, sizeof(msg), + "centroid modifier mismatch for '%s'", var->Name); link_error(shProg, msg); free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { char msg[100]; - _mesa_snprintf(msg, sizeof(msg), - "invariant modifier mismatch for '%s'", var->Name); + snprintf(msg, sizeof(msg), + "invariant modifier mismatch for '%s'", var->Name); link_error(shProg, msg); free(map); return GL_FALSE; @@ -269,8 +269,8 @@ link_uniform_vars(GLcontext *ctx, GLuint newSampNum = *numSamplers; if (newSampNum >= ctx->Const.MaxTextureImageUnits) { char s[100]; - _mesa_sprintf(s, "Too many texture samplers (%u, max is %u)", - newSampNum, ctx->Const.MaxTextureImageUnits); + sprintf(s, "Too many texture samplers (%u, max is %u)", + newSampNum, ctx->Const.MaxTextureImageUnits); link_error(shProg, s); return GL_FALSE; } @@ -631,7 +631,7 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) } source[len] = '\0'; /* - _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); + printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); */ free(shaderLengths); @@ -875,11 +875,11 @@ _slang_link(GLcontext *ctx, vertNotify = ctx->Driver.ProgramStringNotify(ctx, GL_FRAGMENT_PROGRAM_ARB, &shProg->FragmentProgram->Base); if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Mesa pre-link fragment program:\n"); + printf("Mesa pre-link fragment program:\n"); _mesa_print_program(&fragProg->Base); _mesa_print_program_parameters(ctx, &fragProg->Base); - _mesa_printf("Mesa post-link fragment program:\n"); + printf("Mesa post-link fragment program:\n"); _mesa_print_program(&shProg->FragmentProgram->Base); _mesa_print_program_parameters(ctx, &shProg->FragmentProgram->Base); } @@ -893,11 +893,11 @@ _slang_link(GLcontext *ctx, fragNotify = ctx->Driver.ProgramStringNotify(ctx, GL_VERTEX_PROGRAM_ARB, &shProg->VertexProgram->Base); if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Mesa pre-link vertex program:\n"); + printf("Mesa pre-link vertex program:\n"); _mesa_print_program(&vertProg->Base); _mesa_print_program_parameters(ctx, &vertProg->Base); - _mesa_printf("Mesa post-link vertex program:\n"); + printf("Mesa post-link vertex program:\n"); _mesa_print_program(&shProg->VertexProgram->Base); _mesa_print_program_parameters(ctx, &shProg->VertexProgram->Base); } @@ -912,10 +912,10 @@ _slang_link(GLcontext *ctx, } if (ctx->Shader.Flags & GLSL_DUMP) { - _mesa_printf("Varying vars:\n"); + printf("Varying vars:\n"); _mesa_print_parameter_list(shProg->Varying); if (shProg->InfoLog) { - _mesa_printf("Info Log: %s\n", shProg->InfoLog); + printf("Info Log: %s\n", shProg->InfoLog); } } diff --git a/src/mesa/shader/slang/slang_log.c b/src/mesa/shader/slang/slang_log.c index 23917fbd2c..9ff21417bc 100644 --- a/src/mesa/shader/slang/slang_log.c +++ b/src/mesa/shader/slang/slang_log.c @@ -86,7 +86,7 @@ slang_info_log_print(slang_info_log * log, const char *msg, ...) char buf[1024]; va_start(va, msg); - _mesa_vsprintf(buf, msg, va); + vsprintf(buf, msg, va); va_end(va); return slang_info_log_message(log, NULL, buf); } @@ -98,7 +98,7 @@ slang_info_log_error(slang_info_log * log, const char *msg, ...) char buf[1024]; va_start(va, msg); - _mesa_vsprintf(buf, msg, va); + vsprintf(buf, msg, va); va_end(va); log->error_flag = GL_TRUE; if (slang_info_log_message(log, "Error", buf)) @@ -114,7 +114,7 @@ slang_info_log_warning(slang_info_log * log, const char *msg, ...) char buf[1024]; va_start(va, msg); - _mesa_vsprintf(buf, msg, va); + vsprintf(buf, msg, va); va_end(va); if (slang_info_log_message(log, "Warning", buf)) return 1; diff --git a/src/mesa/shader/slang/slang_utility.c b/src/mesa/shader/slang/slang_utility.c index dc1e196bde..e77404f692 100644 --- a/src/mesa/shader/slang/slang_utility.c +++ b/src/mesa/shader/slang/slang_utility.c @@ -120,7 +120,7 @@ slang_string_pushi (slang_string *self, GLint i) { char buffer[12]; - _mesa_sprintf (buffer, "%d", i); + sprintf (buffer, "%d", i); slang_string_pushs (self, buffer, strlen (buffer)); } diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index 6a7ebff6ca..7806df4a53 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -143,7 +143,7 @@ void st_validate_state( struct st_context *st ) if (state->st == 0) return; - /*_mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/ + /*printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/ if (1) { /* Debug version which enforces various sanity checks on the @@ -158,17 +158,17 @@ void st_validate_state( struct st_context *st ) const struct st_tracked_state *atom = atoms[i]; struct st_state_flags generated; - /*_mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/ + /*printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/ if (!(atom->dirty.mesa || atom->dirty.st) || !atom->update) { - _mesa_printf("malformed atom %s\n", atom->name); + printf("malformed atom %s\n", atom->name); assert(0); } if (check_state(state, &atom->dirty)) { atoms[i]->update( st ); - /*_mesa_printf("after: %x\n", atom->dirty.mesa);*/ + /*printf("after: %x\n", atom->dirty.mesa);*/ } accumulate_state(&examined, &atom->dirty); @@ -181,7 +181,7 @@ void st_validate_state( struct st_context *st ) assert(!check_state(&examined, &generated)); prev = *state; } - /*_mesa_printf("\n");*/ + /*printf("\n");*/ } else { diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 5411229d70..cff36042cb 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -233,7 +233,7 @@ static const char *lineFuncName = NULL; #define USE(lineFunc) \ do { \ lineFuncName = #lineFunc; \ - /*_mesa_printf("%s\n", lineFuncName);*/ \ + /*printf("%s\n", lineFuncName);*/ \ swrast->Line = lineFunc; \ } while (0) diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 8a2787a139..fdde294257 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -413,12 +413,12 @@ void _tnl_draw_prims( GLcontext *ctx, if (0) { - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); + printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); for (i = 0; i < nr_prims; i++) - _mesa_printf("prim %d: %s start %d count %d\n", i, - _mesa_lookup_enum_by_nr(prim[i].mode), - prim[i].start, - prim[i].count); + printf("prim %d: %s start %d count %d\n", i, + _mesa_lookup_enum_by_nr(prim[i].mode), + prim[i].start, + prim[i].count); } if (min_index) { diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 618b8b3130..8cc36e666d 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -202,12 +202,12 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (0) { /* print pre-clip vertex coords */ GLuint i, j; - _mesa_printf("pre clip:\n"); + printf("pre clip:\n"); for (i = 0; i < n; i++) { j = inlist[i]; - _mesa_printf(" %u: %u: %f, %f, %f, %f\n", - i, j, - coord[j][0], coord[j][1], coord[j][2], coord[j][3]); + printf(" %u: %u: %f, %f, %f, %f\n", + i, j, + coord[j][0], coord[j][1], coord[j][2], coord[j][3]); assert(!IS_INF_OR_NAN(coord[j][0])); assert(!IS_INF_OR_NAN(coord[j][1])); assert(!IS_INF_OR_NAN(coord[j][2])); @@ -247,12 +247,12 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (0) { /* print post-clip vertex coords */ GLuint i, j; - _mesa_printf("post clip:\n"); + printf("post clip:\n"); for (i = 0; i < n; i++) { j = inlist[i]; - _mesa_printf(" %u: %u: %f, %f, %f, %f\n", - i, j, - coord[j][0], coord[j][1], coord[j][2], coord[j][3]); + printf(" %u: %u: %f, %f, %f, %f\n", + i, j, + coord[j][0], coord[j][1], coord[j][2], coord[j][3]); } } diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index ed66c35be7..b35d6a284e 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -307,8 +307,8 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, const GLuint format = map[i].format; if (format == EMIT_PAD) { if (DBG) - _mesa_printf("%d: pad %d, offset %d\n", i, - map[i].offset, offset); + printf("%d: pad %d, offset %d\n", i, + map[i].offset, offset); offset += map[i].offset; @@ -338,9 +338,9 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, if (DBG) - _mesa_printf("%d: %s, vp %p, offset %d\n", i, - _tnl_format_info[format].name, (void *)vp, - vtx->attr[j].vertoffset); + printf("%d: %s, vp %p, offset %d\n", i, + _tnl_format_info[format].name, (void *)vp, + vtx->attr[j].vertoffset); offset += _tnl_format_info[format].attrsize; j++; diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index 6436cbfc6e..98058f3bda 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -496,7 +496,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) update_src_ptr(p, srcECX, vtxESI, a); } else { - _mesa_printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); + printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); return GL_FALSE; } break; @@ -542,7 +542,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) j++; /* NOTE: two attrs consumed */ } else { - _mesa_printf("Can't emit 3ub\n"); + printf("Can't emit 3ub\n"); return GL_FALSE; /* add this later */ } break; @@ -590,12 +590,12 @@ static GLboolean build_vertex_emit( struct x86_program *p ) break; case GL_UNSIGNED_SHORT: default: - _mesa_printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); + printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); return GL_FALSE; } break; default: - _mesa_printf("unknown a[%d].format %d\n", j, a->format); + printf("unknown a[%d].format %d\n", j, a->format); return GL_FALSE; /* catch any new opcodes */ } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index b10ee2105a..aa7f1c40b1 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -857,7 +857,7 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ) void vbo_exec_BeginVertices( GLcontext *ctx ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; - if (0) _mesa_printf("%s\n", __FUNCTION__); + if (0) printf("%s\n", __FUNCTION__); vbo_exec_vtx_map( exec ); assert((exec->ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) == 0); @@ -892,10 +892,10 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) assert(exec->flush_call_depth == 1); #endif - if (0) _mesa_printf("%s\n", __FUNCTION__); + if (0) printf("%s\n", __FUNCTION__); if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { - if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__); + if (0) printf("%s - inside begin/end\n", __FUNCTION__); #ifdef DEBUG exec->flush_call_depth--; assert(exec->flush_call_depth == 0); diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index f2f1674b6a..90474da7c0 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -136,13 +136,13 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, for (k = 0; k < array->Size; k++) { if (IS_INF_OR_NAN(f[k]) || f[k] >= 1.0e20 || f[k] <= -1.0e10) { - _mesa_printf("Bad array data:\n"); - _mesa_printf(" Element[%u].%u = %f\n", j, k, f[k]); - _mesa_printf(" Array %u at %p\n", attrib, (void* ) array); - _mesa_printf(" Type 0x%x, Size %d, Stride %d\n", - array->Type, array->Size, array->Stride); - _mesa_printf(" Address/offset %p in Buffer Object %u\n", - array->Ptr, array->BufferObj->Name); + printf("Bad array data:\n"); + printf(" Element[%u].%u = %f\n", j, k, f[k]); + printf(" Array %u at %p\n", attrib, (void* ) array); + printf(" Type 0x%x, Size %d, Stride %d\n", + array->Type, array->Size, array->Stride); + printf(" Address/offset %p in Buffer Object %u\n", + array->Ptr, array->BufferObj->Name); f[k] = 1.0; /* XXX replace the bad value! */ } /*assert(!IS_INF_OR_NAN(f[k]));*/ @@ -257,21 +257,21 @@ print_draw_arrays(GLcontext *ctx, struct vbo_exec_context *exec, { int i; - _mesa_printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n", - mode, start, count); + printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n", + mode, start, count); for (i = 0; i < 32; i++) { GLuint bufName = exec->array.inputs[i]->BufferObj->Name; GLint stride = exec->array.inputs[i]->Stride; - _mesa_printf("attr %2d: size %d stride %d enabled %d " - "ptr %p Bufobj %u\n", - i, - exec->array.inputs[i]->Size, - stride, - /*exec->array.inputs[i]->Enabled,*/ - exec->array.legacy_array[i]->Enabled, - exec->array.inputs[i]->Ptr, - bufName); + printf("attr %2d: size %d stride %d enabled %d " + "ptr %p Bufobj %u\n", + i, + exec->array.inputs[i]->Size, + stride, + /*exec->array.inputs[i]->Enabled,*/ + exec->array.legacy_array[i]->Enabled, + exec->array.inputs[i]->Ptr, + bufName); if (bufName) { struct gl_buffer_object *buf = _mesa_lookup_bufferobj(ctx, bufName); @@ -284,9 +284,9 @@ print_draw_arrays(GLcontext *ctx, struct vbo_exec_context *exec, int n = (count * stride) / 4; if (n > 32) n = 32; - _mesa_printf(" Data at offset %d:\n", offset); + printf(" Data at offset %d:\n", offset); for (i = 0; i < n; i++) { - _mesa_printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]); + printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]); } ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, buf); } @@ -548,11 +548,11 @@ dump_element_buffer(GLcontext *ctx, GLenum type) const GLubyte *us = (const GLubyte *) map; GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) { - _mesa_printf("%02x ", us[i]); + printf("%02x ", us[i]); if (i % 32 == 31) - _mesa_printf("\n"); + printf("\n"); } - _mesa_printf("\n"); + printf("\n"); } break; case GL_UNSIGNED_SHORT: @@ -560,11 +560,11 @@ dump_element_buffer(GLcontext *ctx, GLenum type) const GLushort *us = (const GLushort *) map; GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) { - _mesa_printf("%04x ", us[i]); + printf("%04x ", us[i]); if (i % 16 == 15) - _mesa_printf("\n"); + printf("\n"); } - _mesa_printf("\n"); + printf("\n"); } break; case GL_UNSIGNED_INT: @@ -572,11 +572,11 @@ dump_element_buffer(GLcontext *ctx, GLenum type) const GLuint *us = (const GLuint *) map; GLint i; for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) { - _mesa_printf("%08x ", us[i]); + printf("%08x ", us[i]); if (i % 8 == 7) - _mesa_printf("\n"); + printf("\n"); } - _mesa_printf("\n"); + printf("\n"); } break; default: @@ -754,12 +754,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, end = ctx->Array.ArrayObj->_MaxElement - 1; } else if (0) { - _mesa_printf("glDraw[Range]Elements{,BaseVertex}" - "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " - "base %d\n", - start, end, type, count, - ctx->Array.ElementArrayBufferObj->Name, - basevertex); + printf("glDraw[Range]Elements{,BaseVertex}" + "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " + "base %d\n", + start, end, type, count, + ctx->Array.ElementArrayBufferObj->Name, + basevertex); } #if 0 diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 526bf7ae79..045af46da8 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -43,22 +43,22 @@ vbo_exec_debug_verts( struct vbo_exec_context *exec ) GLuint count = exec->vtx.vert_count; GLuint i; - _mesa_printf("%s: %u vertices %d primitives, %d vertsize\n", - __FUNCTION__, - count, - exec->vtx.prim_count, - exec->vtx.vertex_size); + printf("%s: %u vertices %d primitives, %d vertsize\n", + __FUNCTION__, + count, + exec->vtx.prim_count, + exec->vtx.vertex_size); for (i = 0 ; i < exec->vtx.prim_count ; i++) { struct _mesa_prim *prim = &exec->vtx.prim[i]; - _mesa_printf(" prim %d: %s%s %d..%d %s %s\n", - i, - _mesa_lookup_prim_by_nr(prim->mode), - prim->weak ? " (weak)" : "", - prim->start, - prim->start + prim->count, - prim->begin ? "BEGIN" : "(wrap)", - prim->end ? "END" : "(wrap)"); + printf(" prim %d: %s%s %d..%d %s %s\n", + i, + _mesa_lookup_prim_by_nr(prim->mode), + prim->weak ? " (weak)" : "", + prim->start, + prim->start + prim->count, + prim->begin ? "BEGIN" : "(wrap)", + prim->end ? "END" : "(wrap)"); } } @@ -343,7 +343,7 @@ vbo_exec_vtx_map( struct vbo_exec_context *exec ) } if (0) - _mesa_printf("map %d..\n", exec->vtx.buffer_used); + printf("map %d..\n", exec->vtx.buffer_used); } @@ -378,8 +378,8 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) } if (0) - _mesa_printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count, - exec->vtx.vert_count); + printf("%s %d %d\n", __FUNCTION__, exec->vtx.prim_count, + exec->vtx.vert_count); vbo_context(ctx)->draw_prims( ctx, exec->vtx.inputs, diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index 1db36de3de..ff7c7a6b0d 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -124,7 +124,7 @@ void vbo_rebase_prims( GLcontext *ctx, assert(min_index != 0); if (0) - _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); + printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); /* XXX this path is disabled for now. diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index e1caa6f8c5..3a64c0cf01 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1185,10 +1185,10 @@ static void vbo_print_vertex_list( GLcontext *ctx, void *data ) GLuint i; (void) ctx; - _mesa_printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", - node->count, - node->prim_count, - node->vertex_size); + printf("VBO-VERTEX-LIST, %u vertices %d primitives, %d vertsize\n", + node->count, + node->prim_count, + node->vertex_size); for (i = 0 ; i < node->prim_count ; i++) { struct _mesa_prim *prim = &node->prim[i]; diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index d834fa1f2e..a7cf29acd4 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -243,7 +243,7 @@ void vbo_save_playback_vertex_list( GLcontext *ctx, void *data ) * includes operations such as glBegin or glDrawArrays. */ if (0) - _mesa_printf("displaylist recursive begin"); + printf("displaylist recursive begin"); vbo_save_loopback_vertex_list( ctx, node ); return; diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c index f13a16e3b5..8d9ae307d6 100644 --- a/src/mesa/vbo/vbo_save_loopback.c +++ b/src/mesa/vbo/vbo_save_loopback.c @@ -95,12 +95,12 @@ static void loopback_prim( GLcontext *ctx, GLuint k; if (0) - _mesa_printf("loopback prim %s(%s,%s) verts %d..%d\n", - _mesa_lookup_prim_by_nr(prim->mode), - prim->begin ? "begin" : "..", - prim->end ? "end" : "..", - start, - end); + printf("loopback prim %s(%s,%s) verts %d..%d\n", + _mesa_lookup_prim_by_nr(prim->mode), + prim->begin ? "begin" : "..", + prim->end ? "end" : "..", + start, + end); if (prim->begin) { CALL_Begin(GET_DISPATCH(), ( prim->mode )); diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c index 2fae267ff5..bce401744d 100644 --- a/src/mesa/vbo/vbo_split_copy.c +++ b/src/mesa/vbo/vbo_split_copy.c @@ -147,21 +147,21 @@ dump_draw_info(GLcontext *ctx, { GLuint i, j; - _mesa_printf("VBO Draw:\n"); + printf("VBO Draw:\n"); for (i = 0; i < nr_prims; i++) { - _mesa_printf("Prim %u of %u\n", i, nr_prims); - _mesa_printf(" Prim mode 0x%x\n", prims[i].mode); - _mesa_printf(" IB: %p\n", (void*) ib); + printf("Prim %u of %u\n", i, nr_prims); + printf(" Prim mode 0x%x\n", prims[i].mode); + printf(" IB: %p\n", (void*) ib); for (j = 0; j < VERT_ATTRIB_MAX; j++) { - _mesa_printf(" array %d at %p:\n", j, (void*) arrays[j]); - _mesa_printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n", - arrays[j]->Enabled, arrays[j]->Ptr, - arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB); + printf(" array %d at %p:\n", j, (void*) arrays[j]); + printf(" enabled %d, ptr %p, size %d, type 0x%x, stride %d\n", + arrays[j]->Enabled, arrays[j]->Ptr, + arrays[j]->Size, arrays[j]->Type, arrays[j]->StrideB); if (0) { GLint k = prims[i].start + prims[i].count - 1; GLfloat *last = (GLfloat *) (arrays[j]->Ptr + arrays[j]->Stride * k); - _mesa_printf(" last: %f %f %f\n", - last[0], last[1], last[2]); + printf(" last: %f %f %f\n", + last[0], last[1], last[2]); } } } @@ -235,7 +235,7 @@ elt(struct copy_context *copy, GLuint elt_idx) GLuint elt = copy->srcelt[elt_idx]; GLuint slot = elt & (ELT_TABLE_SIZE-1); -/* _mesa_printf("elt %d\n", elt); */ +/* printf("elt %d\n", elt); */ /* Look up the incoming element in the vertex cache. Re-emit if * necessary. @@ -244,7 +244,7 @@ elt(struct copy_context *copy, GLuint elt_idx) GLubyte *csr = copy->dstptr; GLuint i; -/* _mesa_printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */ +/* printf(" --> emit to dstelt %d\n", copy->dstbuf_nr); */ for (i = 0; i < copy->nr_varying; i++) { const struct gl_client_array *srcarray = copy->varying[i].array; @@ -268,10 +268,10 @@ elt(struct copy_context *copy, GLuint elt_idx) { const GLuint *f = (const GLuint *)srcptr; GLuint j; - _mesa_printf(" varying %d: ", i); + printf(" varying %d: ", i); for(j = 0; j < copy->varying[i].size / 4; j++) - _mesa_printf("%x ", f[j]); - _mesa_printf("\n"); + printf("%x ", f[j]); + printf("\n"); } } @@ -284,9 +284,9 @@ elt(struct copy_context *copy, GLuint elt_idx) copy->dstbuf_nr * copy->vertex_size)); } /* else */ -/* _mesa_printf(" --> reuse vertex\n"); */ +/* printf(" --> reuse vertex\n"); */ -/* _mesa_printf(" --> emit %d\n", copy->vert_cache[slot].out); */ +/* printf(" --> emit %d\n", copy->vert_cache[slot].out); */ copy->dstelt[copy->dstelt_nr++] = copy->vert_cache[slot].out; return check_flush(copy); } @@ -300,7 +300,7 @@ end( struct copy_context *copy, GLboolean end_flag ) { struct _mesa_prim *prim = ©->dstprim[copy->dstprim_nr]; -/* _mesa_printf("end (%d)\n", end_flag); */ +/* printf("end (%d)\n", end_flag); */ prim->end = end_flag; prim->count = copy->dstelt_nr - prim->start; diff --git a/src/mesa/vf/vf.c b/src/mesa/vf/vf.c index dab436e2ab..defb7cbe2c 100644 --- a/src/mesa/vf/vf.c +++ b/src/mesa/vf/vf.c @@ -162,8 +162,8 @@ GLuint vf_set_vertex_attributes( struct vertex_fetch *vf, const GLuint format = map[i].format; if (format == EMIT_PAD) { if (DBG) - _mesa_printf("%d: pad %d, offset %d\n", i, - map[i].offset, offset); + printf("%d: pad %d, offset %d\n", i, + map[i].offset, offset); offset += map[i].offset; @@ -180,9 +180,9 @@ GLuint vf_set_vertex_attributes( struct vertex_fetch *vf, vf->attr[j].vertoffset = offset; if (DBG) - _mesa_printf("%d: %s, offset %d\n", i, - vf_format_info[format].name, - vf->attr[j].vertoffset); + printf("%d: %s, offset %d\n", i, + vf_format_info[format].name, + vf->attr[j].vertoffset); offset += vf_format_info[format].attrsize; j++; diff --git a/src/mesa/vf/vf_sse.c b/src/mesa/vf/vf_sse.c index 04275903c9..7b947b74a6 100644 --- a/src/mesa/vf/vf_sse.c +++ b/src/mesa/vf/vf_sse.c @@ -482,7 +482,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) 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 ); + printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize ); return GL_FALSE; } break; @@ -527,7 +527,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) j++; /* NOTE: two attrs consumed */ } else { - _mesa_printf("Can't emit 3ub\n"); + printf("Can't emit 3ub\n"); } return GL_FALSE; /* add this later */ break; @@ -575,12 +575,12 @@ static GLboolean build_vertex_emit( struct x86_program *p ) break; case GL_UNSIGNED_SHORT: default: - _mesa_printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); + printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE)); return GL_FALSE; } break; default: - _mesa_printf("unknown a[%d].format %d\n", j, a->format); + printf("unknown a[%d].format %d\n", j, a->format); return GL_FALSE; /* catch any new opcodes */ } diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 647be995c1..c93faba792 100644 --- a/src/mesa/x86/rtasm/x86sse.c +++ b/src/mesa/x86/rtasm/x86sse.c @@ -1184,7 +1184,7 @@ void x86_release_func( struct x86_function *p ) void (*x86_get_func( struct x86_function *p ))(void) { if (DISASSEM && p->store) - _mesa_printf("disassemble %p %p\n", p->store, p->csr); + printf("disassemble %p %p\n", p->store, p->csr); return (void (*)(void)) (unsigned long) p->store; } -- cgit v1.2.3 From d68f024b7dd1891d4939bf56d3065acc225b9c81 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 18 Feb 2010 11:26:18 +0100 Subject: tgsi: Rewrite exec implementations of NRM and NRM4. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 131 ++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 262422364b..14035d4b2d 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -461,6 +461,10 @@ enum tgsi_exec_datatype { static const union tgsi_exec_channel ZeroVec = { { 0.0, 0.0, 0.0, 0.0 } }; +static const union tgsi_exec_channel OneVec = { + {1.0f, 1.0f, 1.0f, 1.0f} +}; + /** * Assert that none of the float values in 'chan' are infinite or NaN. @@ -2029,6 +2033,70 @@ exec_dp2(struct tgsi_exec_machine *mach, } } +static void +exec_nrm4(struct tgsi_exec_machine *mach, + const struct tgsi_full_instruction *inst) +{ + unsigned int chan; + union tgsi_exec_channel arg[4]; + union tgsi_exec_channel scale; + + fetch_source(mach, &arg[0], &inst->Src[0], CHAN_X, TGSI_EXEC_DATA_FLOAT); + micro_mul(&scale, &arg[0], &arg[0]); + + for (chan = CHAN_Y; chan <= CHAN_W; chan++) { + union tgsi_exec_channel product; + + fetch_source(mach, &arg[chan], &inst->Src[0], chan, TGSI_EXEC_DATA_FLOAT); + micro_mul(&product, &arg[chan], &arg[chan]); + micro_add(&scale, &scale, &product); + } + + micro_rsq(&scale, &scale); + + for (chan = CHAN_X; chan <= CHAN_W; chan++) { + if (inst->Dst[0].Register.WriteMask & (1 << chan)) { + micro_mul(&arg[chan], &arg[chan], &scale); + store_dest(mach, &arg[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); + } + } +} + +static void +exec_nrm3(struct tgsi_exec_machine *mach, + const struct tgsi_full_instruction *inst) +{ + if (inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_XYZ) { + unsigned int chan; + union tgsi_exec_channel arg[3]; + union tgsi_exec_channel scale; + + fetch_source(mach, &arg[0], &inst->Src[0], CHAN_X, TGSI_EXEC_DATA_FLOAT); + micro_mul(&scale, &arg[0], &arg[0]); + + for (chan = CHAN_Y; chan <= CHAN_Z; chan++) { + union tgsi_exec_channel product; + + fetch_source(mach, &arg[chan], &inst->Src[0], chan, TGSI_EXEC_DATA_FLOAT); + micro_mul(&product, &arg[chan], &arg[chan]); + micro_add(&scale, &scale, &product); + } + + micro_rsq(&scale, &scale); + + for (chan = CHAN_X; chan <= CHAN_Z; chan++) { + if (inst->Dst[0].Register.WriteMask & (1 << chan)) { + micro_mul(&arg[chan], &arg[chan], &scale); + store_dest(mach, &arg[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); + } + } + } + + if (inst->Dst[0].Register.WriteMask & TGSI_WRITEMASK_W) { + store_dest(mach, &OneVec, &inst->Dst[0], inst, CHAN_W, TGSI_EXEC_DATA_FLOAT); + } +} + static void exec_break(struct tgsi_exec_machine *mach) { @@ -3052,70 +3120,11 @@ exec_instruction( break; case TGSI_OPCODE_NRM: - /* 3-component vector normalize */ - if(IS_CHANNEL_ENABLED(*inst, CHAN_X) || - IS_CHANNEL_ENABLED(*inst, CHAN_Y) || - IS_CHANNEL_ENABLED(*inst, CHAN_Z)) { - /* r3 = sqrt(dp3(src0, src0)) */ - FETCH(&r[0], 0, CHAN_X); - micro_mul(&r[3], &r[0], &r[0]); - FETCH(&r[1], 0, CHAN_Y); - micro_mul(&r[4], &r[1], &r[1]); - micro_add(&r[3], &r[3], &r[4]); - FETCH(&r[2], 0, CHAN_Z); - micro_mul(&r[4], &r[2], &r[2]); - micro_add(&r[3], &r[3], &r[4]); - micro_sqrt(&r[3], &r[3]); - - if (IS_CHANNEL_ENABLED(*inst, CHAN_X)) { - micro_div(&r[0], &r[0], &r[3]); - STORE(&r[0], 0, CHAN_X); - } - if (IS_CHANNEL_ENABLED(*inst, CHAN_Y)) { - micro_div(&r[1], &r[1], &r[3]); - STORE(&r[1], 0, CHAN_Y); - } - if (IS_CHANNEL_ENABLED(*inst, CHAN_Z)) { - micro_div(&r[2], &r[2], &r[3]); - STORE(&r[2], 0, CHAN_Z); - } - } - if (IS_CHANNEL_ENABLED(*inst, CHAN_W)) { - STORE(&mach->Temps[TEMP_1_I].xyzw[TEMP_1_C], 0, CHAN_W); - } + exec_nrm3(mach, inst); break; case TGSI_OPCODE_NRM4: - /* 4-component vector normalize */ - { - union tgsi_exec_channel tmp, dot; - - /* tmp = dp4(src0, src0): */ - FETCH( &r[0], 0, CHAN_X ); - micro_mul( &tmp, &r[0], &r[0] ); - - FETCH( &r[1], 0, CHAN_Y ); - micro_mul( &dot, &r[1], &r[1] ); - micro_add( &tmp, &tmp, &dot ); - - FETCH( &r[2], 0, CHAN_Z ); - micro_mul( &dot, &r[2], &r[2] ); - micro_add( &tmp, &tmp, &dot ); - - FETCH( &r[3], 0, CHAN_W ); - micro_mul( &dot, &r[3], &r[3] ); - micro_add( &tmp, &tmp, &dot ); - - /* tmp = 1 / sqrt(tmp) */ - micro_sqrt( &tmp, &tmp ); - micro_div( &tmp, &mach->Temps[TEMP_1_I].xyzw[TEMP_1_C], &tmp ); - - FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - /* chan = chan * tmp */ - micro_mul( &r[chan_index], &tmp, &r[chan_index] ); - STORE( &r[chan_index], 0, chan_index ); - } - } + exec_nrm4(mach, inst); break; case TGSI_OPCODE_DIV: -- cgit v1.2.3 From f1f7006d1f547571ec300277d7d5eef2007e9de1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 18 Feb 2010 11:56:14 +0100 Subject: tgsi: Change prototypes of micro opcodes to explicitly indicates number of args. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 370 ++++++++++++++++++--------------- 1 file changed, 206 insertions(+), 164 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 14035d4b2d..76ce3a8bf5 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -232,22 +232,26 @@ micro_lg2(union tgsi_exec_channel *dst, static void micro_lrp(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2) { - dst->f[0] = src[0].f[0] * (src[1].f[0] - src[2].f[0]) + src[2].f[0]; - dst->f[1] = src[0].f[1] * (src[1].f[1] - src[2].f[1]) + src[2].f[1]; - dst->f[2] = src[0].f[2] * (src[1].f[2] - src[2].f[2]) + src[2].f[2]; - dst->f[3] = src[0].f[3] * (src[1].f[3] - src[2].f[3]) + src[2].f[3]; + dst->f[0] = src0->f[0] * (src1->f[0] - src2->f[0]) + src2->f[0]; + dst->f[1] = src0->f[1] * (src1->f[1] - src2->f[1]) + src2->f[1]; + dst->f[2] = src0->f[2] * (src1->f[2] - src2->f[2]) + src2->f[2]; + dst->f[3] = src0->f[3] * (src1->f[3] - src2->f[3]) + src2->f[3]; } static void micro_mad(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2) { - dst->f[0] = src[0].f[0] * src[1].f[0] + src[2].f[0]; - dst->f[1] = src[0].f[1] * src[1].f[1] + src[2].f[1]; - dst->f[2] = src[0].f[2] * src[1].f[2] + src[2].f[2]; - dst->f[3] = src[0].f[3] * src[1].f[3] + src[2].f[3]; + dst->f[0] = src0->f[0] * src1->f[0] + src2->f[0]; + dst->f[1] = src0->f[1] * src1->f[1] + src2->f[1]; + dst->f[2] = src0->f[2] * src1->f[2] + src2->f[2]; + dst->f[3] = src0->f[3] * src1->f[3] + src2->f[3]; } static void @@ -304,22 +308,24 @@ micro_rsq(union tgsi_exec_channel *dst, static void micro_seq(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->f[0] = src[0].f[0] == src[1].f[0] ? 1.0f : 0.0f; - dst->f[1] = src[0].f[1] == src[1].f[1] ? 1.0f : 0.0f; - dst->f[2] = src[0].f[2] == src[1].f[2] ? 1.0f : 0.0f; - dst->f[3] = src[0].f[3] == src[1].f[3] ? 1.0f : 0.0f; + dst->f[0] = src0->f[0] == src1->f[0] ? 1.0f : 0.0f; + dst->f[1] = src0->f[1] == src1->f[1] ? 1.0f : 0.0f; + dst->f[2] = src0->f[2] == src1->f[2] ? 1.0f : 0.0f; + dst->f[3] = src0->f[3] == src1->f[3] ? 1.0f : 0.0f; } static void micro_sge(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->f[0] = src[0].f[0] >= src[1].f[0] ? 1.0f : 0.0f; - dst->f[1] = src[0].f[1] >= src[1].f[1] ? 1.0f : 0.0f; - dst->f[2] = src[0].f[2] >= src[1].f[2] ? 1.0f : 0.0f; - dst->f[3] = src[0].f[3] >= src[1].f[3] ? 1.0f : 0.0f; + dst->f[0] = src0->f[0] >= src1->f[0] ? 1.0f : 0.0f; + dst->f[1] = src0->f[1] >= src1->f[1] ? 1.0f : 0.0f; + dst->f[2] = src0->f[2] >= src1->f[2] ? 1.0f : 0.0f; + dst->f[3] = src0->f[3] >= src1->f[3] ? 1.0f : 0.0f; } static void @@ -334,12 +340,13 @@ micro_sgn(union tgsi_exec_channel *dst, static void micro_sgt(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->f[0] = src[0].f[0] > src[1].f[0] ? 1.0f : 0.0f; - dst->f[1] = src[0].f[1] > src[1].f[1] ? 1.0f : 0.0f; - dst->f[2] = src[0].f[2] > src[1].f[2] ? 1.0f : 0.0f; - dst->f[3] = src[0].f[3] > src[1].f[3] ? 1.0f : 0.0f; + dst->f[0] = src0->f[0] > src1->f[0] ? 1.0f : 0.0f; + dst->f[1] = src0->f[1] > src1->f[1] ? 1.0f : 0.0f; + dst->f[2] = src0->f[2] > src1->f[2] ? 1.0f : 0.0f; + dst->f[3] = src0->f[3] > src1->f[3] ? 1.0f : 0.0f; } static void @@ -354,32 +361,35 @@ micro_sin(union tgsi_exec_channel *dst, static void micro_sle(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->f[0] = src[0].f[0] <= src[1].f[0] ? 1.0f : 0.0f; - dst->f[1] = src[0].f[1] <= src[1].f[1] ? 1.0f : 0.0f; - dst->f[2] = src[0].f[2] <= src[1].f[2] ? 1.0f : 0.0f; - dst->f[3] = src[0].f[3] <= src[1].f[3] ? 1.0f : 0.0f; + dst->f[0] = src0->f[0] <= src1->f[0] ? 1.0f : 0.0f; + dst->f[1] = src0->f[1] <= src1->f[1] ? 1.0f : 0.0f; + dst->f[2] = src0->f[2] <= src1->f[2] ? 1.0f : 0.0f; + dst->f[3] = src0->f[3] <= src1->f[3] ? 1.0f : 0.0f; } static void micro_slt(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->f[0] = src[0].f[0] < src[1].f[0] ? 1.0f : 0.0f; - dst->f[1] = src[0].f[1] < src[1].f[1] ? 1.0f : 0.0f; - dst->f[2] = src[0].f[2] < src[1].f[2] ? 1.0f : 0.0f; - dst->f[3] = src[0].f[3] < src[1].f[3] ? 1.0f : 0.0f; + dst->f[0] = src0->f[0] < src1->f[0] ? 1.0f : 0.0f; + dst->f[1] = src0->f[1] < src1->f[1] ? 1.0f : 0.0f; + dst->f[2] = src0->f[2] < src1->f[2] ? 1.0f : 0.0f; + dst->f[3] = src0->f[3] < src1->f[3] ? 1.0f : 0.0f; } static void micro_sne(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->f[0] = src[0].f[0] != src[1].f[0] ? 1.0f : 0.0f; - dst->f[1] = src[0].f[1] != src[1].f[1] ? 1.0f : 0.0f; - dst->f[2] = src[0].f[2] != src[1].f[2] ? 1.0f : 0.0f; - dst->f[3] = src[0].f[3] != src[1].f[3] ? 1.0f : 0.0f; + dst->f[0] = src0->f[0] != src1->f[0] ? 1.0f : 0.0f; + dst->f[1] = src0->f[1] != src1->f[1] ? 1.0f : 0.0f; + dst->f[2] = src0->f[2] != src1->f[2] ? 1.0f : 0.0f; + dst->f[3] = src0->f[3] != src1->f[3] ? 1.0f : 0.0f; } static void @@ -1808,13 +1818,13 @@ exec_declaration(struct tgsi_exec_machine *mach, } } -typedef void (* micro_op)(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src); +typedef void (* micro_unary_op)(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src); static void exec_scalar_unary(struct tgsi_exec_machine *mach, const struct tgsi_full_instruction *inst, - micro_op op, + micro_unary_op op, enum tgsi_exec_datatype dst_datatype, enum tgsi_exec_datatype src_datatype) { @@ -1834,7 +1844,7 @@ exec_scalar_unary(struct tgsi_exec_machine *mach, static void exec_vector_unary(struct tgsi_exec_machine *mach, const struct tgsi_full_instruction *inst, - micro_op op, + micro_unary_op op, enum tgsi_exec_datatype dst_datatype, enum tgsi_exec_datatype src_datatype) { @@ -1856,10 +1866,14 @@ exec_vector_unary(struct tgsi_exec_machine *mach, } } +typedef void (* micro_binary_op)(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1); + static void exec_vector_binary(struct tgsi_exec_machine *mach, const struct tgsi_full_instruction *inst, - micro_op op, + micro_binary_op op, enum tgsi_exec_datatype dst_datatype, enum tgsi_exec_datatype src_datatype) { @@ -1872,7 +1886,7 @@ exec_vector_binary(struct tgsi_exec_machine *mach, fetch_source(mach, &src[0], &inst->Src[0], chan, src_datatype); fetch_source(mach, &src[1], &inst->Src[1], chan, src_datatype); - op(&dst.xyzw[chan], src); + op(&dst.xyzw[chan], &src[0], &src[1]); } } for (chan = 0; chan < NUM_CHANNELS; chan++) { @@ -1882,10 +1896,15 @@ exec_vector_binary(struct tgsi_exec_machine *mach, } } +typedef void (* micro_trinary_op)(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2); + static void exec_vector_trinary(struct tgsi_exec_machine *mach, const struct tgsi_full_instruction *inst, - micro_op op, + micro_trinary_op op, enum tgsi_exec_datatype dst_datatype, enum tgsi_exec_datatype src_datatype) { @@ -1899,7 +1918,7 @@ exec_vector_trinary(struct tgsi_exec_machine *mach, fetch_source(mach, &src[0], &inst->Src[0], chan, src_datatype); fetch_source(mach, &src[1], &inst->Src[1], chan, src_datatype); fetch_source(mach, &src[2], &inst->Src[2], chan, src_datatype); - op(&dst.xyzw[chan], src); + op(&dst.xyzw[chan], &src[0], &src[1], &src[2]); } } for (chan = 0; chan < NUM_CHANNELS; chan++) { @@ -1923,7 +1942,7 @@ exec_dp3(struct tgsi_exec_machine *mach, for (chan = CHAN_Y; chan <= CHAN_Z; chan++) { fetch_source(mach, &arg[0], &inst->Src[0], chan, TGSI_EXEC_DATA_FLOAT); fetch_source(mach, &arg[1], &inst->Src[1], chan, TGSI_EXEC_DATA_FLOAT); - micro_mad(&arg[2], arg); + micro_mad(&arg[2], &arg[0], &arg[1], &arg[2]); } for (chan = 0; chan < NUM_CHANNELS; chan++) { @@ -1947,7 +1966,7 @@ exec_dp4(struct tgsi_exec_machine *mach, for (chan = CHAN_Y; chan <= CHAN_W; chan++) { fetch_source(mach, &arg[0], &inst->Src[0], chan, TGSI_EXEC_DATA_FLOAT); fetch_source(mach, &arg[1], &inst->Src[1], chan, TGSI_EXEC_DATA_FLOAT); - micro_mad(&arg[2], arg); + micro_mad(&arg[2], &arg[0], &arg[1], &arg[2]); } for (chan = 0; chan < NUM_CHANNELS; chan++) { @@ -1970,7 +1989,7 @@ exec_dp2a(struct tgsi_exec_machine *mach, fetch_source(mach, &arg[0], &inst->Src[0], CHAN_Y, TGSI_EXEC_DATA_FLOAT); fetch_source(mach, &arg[1], &inst->Src[1], CHAN_Y, TGSI_EXEC_DATA_FLOAT); - micro_mad(&arg[0], arg); + micro_mad(&arg[0], &arg[0], &arg[1], &arg[2]); fetch_source(mach, &arg[1], &inst->Src[2], CHAN_X, TGSI_EXEC_DATA_FLOAT); micro_add(&arg[0], &arg[0], &arg[1]); @@ -1995,11 +2014,11 @@ exec_dph(struct tgsi_exec_machine *mach, fetch_source(mach, &arg[0], &inst->Src[0], CHAN_Y, TGSI_EXEC_DATA_FLOAT); fetch_source(mach, &arg[1], &inst->Src[1], CHAN_Y, TGSI_EXEC_DATA_FLOAT); - micro_mad(&arg[2], arg); + micro_mad(&arg[2], &arg[0], &arg[1], &arg[2]); fetch_source(mach, &arg[0], &inst->Src[0], CHAN_Z, TGSI_EXEC_DATA_FLOAT); fetch_source(mach, &arg[1], &inst->Src[1], CHAN_Z, TGSI_EXEC_DATA_FLOAT); - micro_mad(&arg[0], arg); + micro_mad(&arg[0], &arg[0], &arg[1], &arg[2]); fetch_source(mach, &arg[1], &inst->Src[1], CHAN_W, TGSI_EXEC_DATA_FLOAT); micro_add(&arg[0], &arg[0], &arg[1]); @@ -2024,7 +2043,7 @@ exec_dp2(struct tgsi_exec_machine *mach, fetch_source(mach, &arg[0], &inst->Src[0], CHAN_Y, TGSI_EXEC_DATA_FLOAT); fetch_source(mach, &arg[1], &inst->Src[1], CHAN_Y, TGSI_EXEC_DATA_FLOAT); - micro_mad(&arg[2], arg); + micro_mad(&arg[2], &arg[0], &arg[1], &arg[2]); for (chan = 0; chan < NUM_CHANNELS; chan++) { if (inst->Dst[0].Register.WriteMask & (1 << chan)) { @@ -2203,42 +2222,46 @@ micro_not(union tgsi_exec_channel *dst, static void micro_shl(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] << src[1].u[0]; - dst->u[1] = src[0].u[1] << src[1].u[1]; - dst->u[2] = src[0].u[2] << src[1].u[2]; - dst->u[3] = src[0].u[3] << src[1].u[3]; + dst->u[0] = src0->u[0] << src1->u[0]; + dst->u[1] = src0->u[1] << src1->u[1]; + dst->u[2] = src0->u[2] << src1->u[2]; + dst->u[3] = src0->u[3] << src1->u[3]; } static void micro_and(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] & src[1].u[0]; - dst->u[1] = src[0].u[1] & src[1].u[1]; - dst->u[2] = src[0].u[2] & src[1].u[2]; - dst->u[3] = src[0].u[3] & src[1].u[3]; + dst->u[0] = src0->u[0] & src1->u[0]; + dst->u[1] = src0->u[1] & src1->u[1]; + dst->u[2] = src0->u[2] & src1->u[2]; + dst->u[3] = src0->u[3] & src1->u[3]; } static void micro_or(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] | src[1].u[0]; - dst->u[1] = src[0].u[1] | src[1].u[1]; - dst->u[2] = src[0].u[2] | src[1].u[2]; - dst->u[3] = src[0].u[3] | src[1].u[3]; + dst->u[0] = src0->u[0] | src1->u[0]; + dst->u[1] = src0->u[1] | src1->u[1]; + dst->u[2] = src0->u[2] | src1->u[2]; + dst->u[3] = src0->u[3] | src1->u[3]; } static void micro_xor(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] ^ src[1].u[0]; - dst->u[1] = src[0].u[1] ^ src[1].u[1]; - dst->u[2] = src[0].u[2] ^ src[1].u[2]; - dst->u[3] = src[0].u[3] ^ src[1].u[3]; + dst->u[0] = src0->u[0] ^ src1->u[0]; + dst->u[1] = src0->u[1] ^ src1->u[1]; + dst->u[2] = src0->u[2] ^ src1->u[2]; + dst->u[3] = src0->u[3] ^ src1->u[3]; } static void @@ -2253,62 +2276,68 @@ micro_f2i(union tgsi_exec_channel *dst, static void micro_idiv(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->i[0] = src[0].i[0] / src[1].i[0]; - dst->i[1] = src[0].i[1] / src[1].i[1]; - dst->i[2] = src[0].i[2] / src[1].i[2]; - dst->i[3] = src[0].i[3] / src[1].i[3]; + dst->i[0] = src0->i[0] / src1->i[0]; + dst->i[1] = src0->i[1] / src1->i[1]; + dst->i[2] = src0->i[2] / src1->i[2]; + dst->i[3] = src0->i[3] / src1->i[3]; } static void micro_imax(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->i[0] = src[0].i[0] > src[1].i[0] ? src[0].i[0] : src[1].i[0]; - dst->i[1] = src[0].i[1] > src[1].i[1] ? src[0].i[1] : src[1].i[1]; - dst->i[2] = src[0].i[2] > src[1].i[2] ? src[0].i[2] : src[1].i[2]; - dst->i[3] = src[0].i[3] > src[1].i[3] ? src[0].i[3] : src[1].i[3]; + dst->i[0] = src0->i[0] > src1->i[0] ? src0->i[0] : src1->i[0]; + dst->i[1] = src0->i[1] > src1->i[1] ? src0->i[1] : src1->i[1]; + dst->i[2] = src0->i[2] > src1->i[2] ? src0->i[2] : src1->i[2]; + dst->i[3] = src0->i[3] > src1->i[3] ? src0->i[3] : src1->i[3]; } static void micro_imin(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->i[0] = src[0].i[0] < src[1].i[0] ? src[0].i[0] : src[1].i[0]; - dst->i[1] = src[0].i[1] < src[1].i[1] ? src[0].i[1] : src[1].i[1]; - dst->i[2] = src[0].i[2] < src[1].i[2] ? src[0].i[2] : src[1].i[2]; - dst->i[3] = src[0].i[3] < src[1].i[3] ? src[0].i[3] : src[1].i[3]; + dst->i[0] = src0->i[0] < src1->i[0] ? src0->i[0] : src1->i[0]; + dst->i[1] = src0->i[1] < src1->i[1] ? src0->i[1] : src1->i[1]; + dst->i[2] = src0->i[2] < src1->i[2] ? src0->i[2] : src1->i[2]; + dst->i[3] = src0->i[3] < src1->i[3] ? src0->i[3] : src1->i[3]; } static void micro_isge(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->i[0] = src[0].i[0] >= src[1].i[0] ? -1 : 0; - dst->i[1] = src[0].i[1] >= src[1].i[1] ? -1 : 0; - dst->i[2] = src[0].i[2] >= src[1].i[2] ? -1 : 0; - dst->i[3] = src[0].i[3] >= src[1].i[3] ? -1 : 0; + dst->i[0] = src0->i[0] >= src1->i[0] ? -1 : 0; + dst->i[1] = src0->i[1] >= src1->i[1] ? -1 : 0; + dst->i[2] = src0->i[2] >= src1->i[2] ? -1 : 0; + dst->i[3] = src0->i[3] >= src1->i[3] ? -1 : 0; } static void micro_ishr(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->i[0] = src[0].i[0] >> src[1].i[0]; - dst->i[1] = src[0].i[1] >> src[1].i[1]; - dst->i[2] = src[0].i[2] >> src[1].i[2]; - dst->i[3] = src[0].i[3] >> src[1].i[3]; + dst->i[0] = src0->i[0] >> src1->i[0]; + dst->i[1] = src0->i[1] >> src1->i[1]; + dst->i[2] = src0->i[2] >> src1->i[2]; + dst->i[3] = src0->i[3] >> src1->i[3]; } static void micro_islt(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->i[0] = src[0].i[0] < src[1].i[0] ? -1 : 0; - dst->i[1] = src[0].i[1] < src[1].i[1] ? -1 : 0; - dst->i[2] = src[0].i[2] < src[1].i[2] ? -1 : 0; - dst->i[3] = src[0].i[3] < src[1].i[3] ? -1 : 0; + dst->i[0] = src0->i[0] < src1->i[0] ? -1 : 0; + dst->i[1] = src0->i[1] < src1->i[1] ? -1 : 0; + dst->i[2] = src0->i[2] < src1->i[2] ? -1 : 0; + dst->i[3] = src0->i[3] < src1->i[3] ? -1 : 0; } static void @@ -2333,122 +2362,135 @@ micro_u2f(union tgsi_exec_channel *dst, static void micro_uadd(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] + src[1].u[0]; - dst->u[1] = src[0].u[1] + src[1].u[1]; - dst->u[2] = src[0].u[2] + src[1].u[2]; - dst->u[3] = src[0].u[3] + src[1].u[3]; + dst->u[0] = src0->u[0] + src1->u[0]; + dst->u[1] = src0->u[1] + src1->u[1]; + dst->u[2] = src0->u[2] + src1->u[2]; + dst->u[3] = src0->u[3] + src1->u[3]; } static void micro_udiv(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] / src[1].u[0]; - dst->u[1] = src[0].u[1] / src[1].u[1]; - dst->u[2] = src[0].u[2] / src[1].u[2]; - dst->u[3] = src[0].u[3] / src[1].u[3]; + dst->u[0] = src0->u[0] / src1->u[0]; + dst->u[1] = src0->u[1] / src1->u[1]; + dst->u[2] = src0->u[2] / src1->u[2]; + dst->u[3] = src0->u[3] / src1->u[3]; } static void micro_umad(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2) { - dst->u[0] = src[0].u[0] * src[1].u[0] + src[2].u[0]; - dst->u[1] = src[0].u[1] * src[1].u[1] + src[2].u[1]; - dst->u[2] = src[0].u[2] * src[1].u[2] + src[2].u[2]; - dst->u[3] = src[0].u[3] * src[1].u[3] + src[2].u[3]; + dst->u[0] = src0->u[0] * src1->u[0] + src2->u[0]; + dst->u[1] = src0->u[1] * src1->u[1] + src2->u[1]; + dst->u[2] = src0->u[2] * src1->u[2] + src2->u[2]; + dst->u[3] = src0->u[3] * src1->u[3] + src2->u[3]; } static void micro_umax(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] > src[1].u[0] ? src[0].u[0] : src[1].u[0]; - dst->u[1] = src[0].u[1] > src[1].u[1] ? src[0].u[1] : src[1].u[1]; - dst->u[2] = src[0].u[2] > src[1].u[2] ? src[0].u[2] : src[1].u[2]; - dst->u[3] = src[0].u[3] > src[1].u[3] ? src[0].u[3] : src[1].u[3]; + dst->u[0] = src0->u[0] > src1->u[0] ? src0->u[0] : src1->u[0]; + dst->u[1] = src0->u[1] > src1->u[1] ? src0->u[1] : src1->u[1]; + dst->u[2] = src0->u[2] > src1->u[2] ? src0->u[2] : src1->u[2]; + dst->u[3] = src0->u[3] > src1->u[3] ? src0->u[3] : src1->u[3]; } static void micro_umin(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] < src[1].u[0] ? src[0].u[0] : src[1].u[0]; - dst->u[1] = src[0].u[1] < src[1].u[1] ? src[0].u[1] : src[1].u[1]; - dst->u[2] = src[0].u[2] < src[1].u[2] ? src[0].u[2] : src[1].u[2]; - dst->u[3] = src[0].u[3] < src[1].u[3] ? src[0].u[3] : src[1].u[3]; + dst->u[0] = src0->u[0] < src1->u[0] ? src0->u[0] : src1->u[0]; + dst->u[1] = src0->u[1] < src1->u[1] ? src0->u[1] : src1->u[1]; + dst->u[2] = src0->u[2] < src1->u[2] ? src0->u[2] : src1->u[2]; + dst->u[3] = src0->u[3] < src1->u[3] ? src0->u[3] : src1->u[3]; } static void micro_umod(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] % src[1].u[0]; - dst->u[1] = src[0].u[1] % src[1].u[1]; - dst->u[2] = src[0].u[2] % src[1].u[2]; - dst->u[3] = src[0].u[3] % src[1].u[3]; + dst->u[0] = src0->u[0] % src1->u[0]; + dst->u[1] = src0->u[1] % src1->u[1]; + dst->u[2] = src0->u[2] % src1->u[2]; + dst->u[3] = src0->u[3] % src1->u[3]; } static void micro_umul(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] * src[1].u[0]; - dst->u[1] = src[0].u[1] * src[1].u[1]; - dst->u[2] = src[0].u[2] * src[1].u[2]; - dst->u[3] = src[0].u[3] * src[1].u[3]; + dst->u[0] = src0->u[0] * src1->u[0]; + dst->u[1] = src0->u[1] * src1->u[1]; + dst->u[2] = src0->u[2] * src1->u[2]; + dst->u[3] = src0->u[3] * src1->u[3]; } static void micro_useq(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] == src[1].u[0] ? ~0 : 0; - dst->u[1] = src[0].u[1] == src[1].u[1] ? ~0 : 0; - dst->u[2] = src[0].u[2] == src[1].u[2] ? ~0 : 0; - dst->u[3] = src[0].u[3] == src[1].u[3] ? ~0 : 0; + dst->u[0] = src0->u[0] == src1->u[0] ? ~0 : 0; + dst->u[1] = src0->u[1] == src1->u[1] ? ~0 : 0; + dst->u[2] = src0->u[2] == src1->u[2] ? ~0 : 0; + dst->u[3] = src0->u[3] == src1->u[3] ? ~0 : 0; } static void micro_usge(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] >= src[1].u[0] ? ~0 : 0; - dst->u[1] = src[0].u[1] >= src[1].u[1] ? ~0 : 0; - dst->u[2] = src[0].u[2] >= src[1].u[2] ? ~0 : 0; - dst->u[3] = src[0].u[3] >= src[1].u[3] ? ~0 : 0; + dst->u[0] = src0->u[0] >= src1->u[0] ? ~0 : 0; + dst->u[1] = src0->u[1] >= src1->u[1] ? ~0 : 0; + dst->u[2] = src0->u[2] >= src1->u[2] ? ~0 : 0; + dst->u[3] = src0->u[3] >= src1->u[3] ? ~0 : 0; } static void micro_ushr(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] >> src[1].u[0]; - dst->u[1] = src[0].u[1] >> src[1].u[1]; - dst->u[2] = src[0].u[2] >> src[1].u[2]; - dst->u[3] = src[0].u[3] >> src[1].u[3]; + dst->u[0] = src0->u[0] >> src1->u[0]; + dst->u[1] = src0->u[1] >> src1->u[1]; + dst->u[2] = src0->u[2] >> src1->u[2]; + dst->u[3] = src0->u[3] >> src1->u[3]; } static void micro_uslt(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] < src[1].u[0] ? ~0 : 0; - dst->u[1] = src[0].u[1] < src[1].u[1] ? ~0 : 0; - dst->u[2] = src[0].u[2] < src[1].u[2] ? ~0 : 0; - dst->u[3] = src[0].u[3] < src[1].u[3] ? ~0 : 0; + dst->u[0] = src0->u[0] < src1->u[0] ? ~0 : 0; + dst->u[1] = src0->u[1] < src1->u[1] ? ~0 : 0; + dst->u[2] = src0->u[2] < src1->u[2] ? ~0 : 0; + dst->u[3] = src0->u[3] < src1->u[3] ? ~0 : 0; } static void micro_usne(union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src) + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { - dst->u[0] = src[0].u[0] != src[1].u[0] ? ~0 : 0; - dst->u[1] = src[0].u[1] != src[1].u[1] ? ~0 : 0; - dst->u[2] = src[0].u[2] != src[1].u[2] ? ~0 : 0; - dst->u[3] = src[0].u[3] != src[1].u[3] ? ~0 : 0; + dst->u[0] = src0->u[0] != src1->u[0] ? ~0 : 0; + dst->u[1] = src0->u[1] != src1->u[1] ? ~0 : 0; + dst->u[2] = src0->u[2] != src1->u[2] ? ~0 : 0; + dst->u[3] = src0->u[3] != src1->u[3] ? ~0 : 0; } static void -- cgit v1.2.3 From f814a497f7359878d3b67316d7b49060ecac0301 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 18 Feb 2010 12:05:08 +0100 Subject: tgsi: Make more exec opcodes look pretty. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 84 ++++++++-------------------------- 1 file changed, 20 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 76ce3a8bf5..fdbf2b436e 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -773,10 +773,9 @@ tgsi_exec_machine_destroy(struct tgsi_exec_machine *mach) } static void -micro_add( - union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src0, - const union tgsi_exec_channel *src1 ) +micro_add(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { dst->f[0] = src0->f[0] + src1->f[0]; dst->f[1] = src0->f[1] + src1->f[1]; @@ -845,10 +844,9 @@ micro_lt( } static void -micro_max( - union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src0, - const union tgsi_exec_channel *src1 ) +micro_max(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { dst->f[0] = src0->f[0] > src1->f[0] ? src0->f[0] : src1->f[0]; dst->f[1] = src0->f[1] > src1->f[1] ? src0->f[1] : src1->f[1]; @@ -857,10 +855,9 @@ micro_max( } static void -micro_min( - union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src0, - const union tgsi_exec_channel *src1 ) +micro_min(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { dst->f[0] = src0->f[0] < src1->f[0] ? src0->f[0] : src1->f[0]; dst->f[1] = src0->f[1] < src1->f[1] ? src0->f[1] : src1->f[1]; @@ -869,10 +866,9 @@ micro_min( } static void -micro_mul( - union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src0, - const union tgsi_exec_channel *src1 ) +micro_mul(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { dst->f[0] = src0->f[0] * src1->f[0]; dst->f[1] = src0->f[1] * src1->f[1]; @@ -975,10 +971,9 @@ micro_sqrt( union tgsi_exec_channel *dst, } static void -micro_sub( - union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src0, - const union tgsi_exec_channel *src1 ) +micro_sub(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1) { dst->f[0] = src0->f[0] - src1->f[0]; dst->f[1] = src0->f[1] - src1->f[1]; @@ -2597,25 +2592,11 @@ exec_instruction( break; case TGSI_OPCODE_MUL: - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - micro_mul(&d[chan_index], &r[0], &r[1]); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_binary(mach, inst, micro_mul, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_ADD: - FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - FETCH( &r[0], 0, chan_index ); - FETCH( &r[1], 1, chan_index ); - micro_add(&d[chan_index], &r[0], &r[1]); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_binary(mach, inst, micro_add, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_DP3: @@ -2654,29 +2635,11 @@ exec_instruction( break; case TGSI_OPCODE_MIN: - FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - - /* XXX use micro_min()?? */ - micro_lt(&d[chan_index], &r[0], &r[1], &r[0], &r[1]); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_binary(mach, inst, micro_min, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_MAX: - FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - - /* XXX use micro_max()?? */ - micro_lt(&d[chan_index], &r[0], &r[1], &r[1], &r[0] ); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_binary(mach, inst, micro_max, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_SLT: @@ -2692,14 +2655,7 @@ exec_instruction( break; case TGSI_OPCODE_SUB: - FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - micro_sub(&d[chan_index], &r[0], &r[1]); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_binary(mach, inst, micro_sub, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_LRP: -- cgit v1.2.3 From 99ae9e8d7d57ae37629754edd5b1e3716611827f Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 19 Feb 2010 13:16:57 -0500 Subject: Drop macro wrappers for the aligned memory functions --- src/mesa/drivers/dri/ffb/ffb_vb.c | 4 ++-- src/mesa/drivers/dri/gamma/gamma_vb.c | 4 ++-- src/mesa/drivers/dri/i810/i810screen.c | 6 +++--- src/mesa/drivers/dri/i810/i810vb.c | 4 ++-- src/mesa/drivers/dri/mach64/mach64_context.c | 4 ++-- src/mesa/drivers/dri/mach64/mach64_vb.c | 4 ++-- src/mesa/drivers/dri/mga/mgavb.c | 4 ++-- src/mesa/drivers/dri/tdfx/tdfx_vb.c | 4 ++-- src/mesa/drivers/glide/fxvb.c | 4 ++-- src/mesa/main/imports.h | 11 ----------- src/mesa/math/m_debug_norm.c | 4 ++-- src/mesa/math/m_debug_xform.c | 4 ++-- src/mesa/math/m_matrix.c | 8 ++++---- src/mesa/math/m_vector.c | 4 ++-- src/mesa/tnl/t_vb_program.c | 4 ++-- src/mesa/tnl/t_vb_vertex.c | 4 ++-- src/mesa/tnl/t_vertex.c | 4 ++-- src/mesa/vbo/vbo_exec_api.c | 4 ++-- 18 files changed, 37 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.c b/src/mesa/drivers/dri/ffb/ffb_vb.c index ca8ffb2721..a53e7c7431 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vb.c +++ b/src/mesa/drivers/dri/ffb/ffb_vb.c @@ -185,7 +185,7 @@ void ffbInitVB( GLcontext *ctx ) ffbContextPtr fmesa = FFB_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - fmesa->verts = (ffb_vertex *)ALIGN_MALLOC(size * sizeof(ffb_vertex), 32); + fmesa->verts = (ffb_vertex *)_mesa_align_malloc(size * sizeof(ffb_vertex), 32); { static int firsttime = 1; @@ -201,7 +201,7 @@ void ffbFreeVB( GLcontext *ctx ) { ffbContextPtr fmesa = FFB_CONTEXT(ctx); if (fmesa->verts) { - ALIGN_FREE(fmesa->verts); + _mesa_align_free(fmesa->verts); fmesa->verts = 0; } } diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.c b/src/mesa/drivers/dri/gamma/gamma_vb.c index c11cfd281a..013f856dcd 100644 --- a/src/mesa/drivers/dri/gamma/gamma_vb.c +++ b/src/mesa/drivers/dri/gamma/gamma_vb.c @@ -338,7 +338,7 @@ void gammaInitVB( GLcontext *ctx ) gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - gmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32); + gmesa->verts = (GLubyte *)_mesa_align_malloc(size * 4 * 16, 32); { static int firsttime = 1; @@ -355,7 +355,7 @@ void gammaFreeVB( GLcontext *ctx ) { gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); if (gmesa->verts) { - ALIGN_FREE(gmesa->verts); + _mesa_align_free(gmesa->verts); gmesa->verts = 0; } } diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 1c4deef319..56708c97cb 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -131,12 +131,12 @@ static drmBufMapPtr i810_create_empty_buffers(void) { drmBufMapPtr retval; - retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32); + retval = (drmBufMapPtr)_mesa_align_malloc(sizeof(drmBufMap), 32); if(retval == NULL) return NULL; memset(retval, 0, sizeof(drmBufMap)); - retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I810_DMA_BUF_NR, 32); + retval->list = (drmBufPtr)_mesa_align_malloc(sizeof(drmBuf) * I810_DMA_BUF_NR, 32); if(retval->list == NULL) { - ALIGN_FREE(retval); + _mesa_align_free(retval); return NULL; } memset(retval->list, 0, sizeof(drmBuf) * I810_DMA_BUF_NR); diff --git a/src/mesa/drivers/dri/i810/i810vb.c b/src/mesa/drivers/dri/i810/i810vb.c index 09a772258c..70301a2d2e 100644 --- a/src/mesa/drivers/dri/i810/i810vb.c +++ b/src/mesa/drivers/dri/i810/i810vb.c @@ -464,7 +464,7 @@ void i810InitVB( GLcontext *ctx ) i810ContextPtr imesa = I810_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - imesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32); + imesa->verts = (GLubyte *)_mesa_align_malloc(size * 4 * 16, 32); { static int firsttime = 1; @@ -480,7 +480,7 @@ void i810FreeVB( GLcontext *ctx ) { i810ContextPtr imesa = I810_CONTEXT(ctx); if (imesa->verts) { - ALIGN_FREE(imesa->verts); + _mesa_align_free(imesa->verts); imesa->verts = 0; } } diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 11bce31b12..77e7e53ce0 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -211,7 +211,7 @@ GLboolean mach64CreateContext( const __GLcontextModes *glVisual, /* Allocate the vertex buffer */ - mmesa->vert_buf = ALIGN_MALLOC(MACH64_BUFFER_SIZE, 32); + mmesa->vert_buf = _mesa_align_malloc(MACH64_BUFFER_SIZE, 32); if ( !mmesa->vert_buf ) return GL_FALSE; mmesa->vert_used = 0; @@ -291,7 +291,7 @@ void mach64DestroyContext( __DRIcontext *driContextPriv ) /* Free the vertex buffer */ if ( mmesa->vert_buf ) - ALIGN_FREE( mmesa->vert_buf ); + _mesa_align_free( mmesa->vert_buf ); /* free the Mesa context */ mmesa->glCtx->DriverCtx = NULL; diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.c b/src/mesa/drivers/dri/mach64/mach64_vb.c index 00da835376..046aff28a8 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_vb.c @@ -619,7 +619,7 @@ void mach64InitVB( GLcontext *ctx ) mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - mmesa->verts = (GLubyte *)ALIGN_MALLOC(size * 4 * 16, 32); + mmesa->verts = (GLubyte *)_mesa_align_malloc(size * 4 * 16, 32); { static int firsttime = 1; @@ -635,7 +635,7 @@ void mach64FreeVB( GLcontext *ctx ) { mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); if (mmesa->verts) { - ALIGN_FREE(mmesa->verts); + _mesa_align_free(mmesa->verts); mmesa->verts = 0; } } diff --git a/src/mesa/drivers/dri/mga/mgavb.c b/src/mesa/drivers/dri/mga/mgavb.c index def5109863..71bbf33f23 100644 --- a/src/mesa/drivers/dri/mga/mgavb.c +++ b/src/mesa/drivers/dri/mga/mgavb.c @@ -451,7 +451,7 @@ void mgaInitVB( GLcontext *ctx ) mgaContextPtr mmesa = MGA_CONTEXT(ctx); GLuint size = TNL_CONTEXT(ctx)->vb.Size; - mmesa->verts = (GLubyte *)ALIGN_MALLOC(size * sizeof(mgaVertex), 32); + mmesa->verts = (GLubyte *)_mesa_align_malloc(size * sizeof(mgaVertex), 32); { static int firsttime = 1; @@ -471,7 +471,7 @@ void mgaFreeVB( GLcontext *ctx ) { mgaContextPtr mmesa = MGA_CONTEXT(ctx); if (mmesa->verts) { - ALIGN_FREE(mmesa->verts); + _mesa_align_free(mmesa->verts); mmesa->verts = 0; } } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vb.c b/src/mesa/drivers/dri/tdfx/tdfx_vb.c index 0f3c877a3e..546d89aa84 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vb.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_vb.c @@ -331,7 +331,7 @@ void tdfxInitVB( GLcontext *ctx ) firsttime = 0; } - fxMesa->verts = ALIGN_MALLOC(size * sizeof(tdfxVertex), 32); + fxMesa->verts = _mesa_align_malloc(size * sizeof(tdfxVertex), 32); fxMesa->vertexFormat = TDFX_LAYOUT_TINY; fxMesa->SetupIndex = TDFX_XYZ_BIT|TDFX_RGBA_BIT; } @@ -341,7 +341,7 @@ void tdfxFreeVB( GLcontext *ctx ) { tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); if (fxMesa->verts) { - ALIGN_FREE(fxMesa->verts); + _mesa_align_free(fxMesa->verts); fxMesa->verts = 0; } } diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c index cc9ad0e8b8..64453cbe4b 100644 --- a/src/mesa/drivers/glide/fxvb.c +++ b/src/mesa/drivers/glide/fxvb.c @@ -808,7 +808,7 @@ void fxAllocVB( GLcontext *ctx ) firsttime = 0; } - fxMesa->verts = (GrVertex *)ALIGN_MALLOC(size * sizeof(GrVertex), 32); + fxMesa->verts = (GrVertex *)_mesa_align_malloc(size * sizeof(GrVertex), 32); fxMesa->SetupIndex = SETUP_XYZW|SETUP_RGBA; } @@ -817,7 +817,7 @@ void fxFreeVB( GLcontext *ctx ) { fxMesaContext fxMesa = FX_CONTEXT(ctx); if (fxMesa->verts) { - ALIGN_FREE(fxMesa->verts); + _mesa_align_free(fxMesa->verts); fxMesa->verts = 0; } } diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index a65c6a615f..269d985f1e 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -60,17 +60,6 @@ extern "C" { /** Free memory */ #define FREE(PTR) free(PTR) -/** Allocate \p BYTES aligned at \p N bytes */ -#define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N) -/** Allocate and zero \p BYTES bytes aligned at \p N bytes */ -#define ALIGN_CALLOC(BYTES, N) _mesa_align_calloc(BYTES, N) -/** Allocate a structure of type \p T aligned at \p N bytes */ -#define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N) -/** Allocate and zero a structure of type \p T aligned at \p N bytes */ -#define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N) -/** Free aligned memory */ -#define ALIGN_FREE(PTR) _mesa_align_free(PTR) - /*@}*/ diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index 546e8641da..710bad14dd 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -208,7 +208,7 @@ static int test_norm_function( normal_func func, int mtype, long *cycles ) (void) cycles; - mat->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); + mat->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 ); mat->inv = m = mat->m; init_matrix( m ); @@ -327,7 +327,7 @@ static int test_norm_function( normal_func func, int mtype, long *cycles ) } } - ALIGN_FREE( mat->m ); + _mesa_align_free( mat->m ); return 1; } diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index df1bc8aadf..46bd454517 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -183,7 +183,7 @@ static int test_transform_function( transform_func func, int psize, return 0; } - mat->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); + mat->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 ); mat->type = mtypes[mtype]; m = mat->m; @@ -273,7 +273,7 @@ static int test_transform_function( transform_func func, int psize, } } - ALIGN_FREE( mat->m ); + _mesa_align_free( mat->m ); return 1; } diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index e810d6deb8..ef8a40fbec 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1484,7 +1484,7 @@ _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ) void _math_matrix_ctr( GLmatrix *m ) { - m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); + m->m = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 ); if (m->m) memcpy( m->m, Identity, sizeof(Identity) ); m->inv = NULL; @@ -1503,11 +1503,11 @@ void _math_matrix_dtr( GLmatrix *m ) { if (m->m) { - ALIGN_FREE( m->m ); + _mesa_align_free( m->m ); m->m = NULL; } if (m->inv) { - ALIGN_FREE( m->inv ); + _mesa_align_free( m->inv ); m->inv = NULL; } } @@ -1523,7 +1523,7 @@ void _math_matrix_alloc_inv( GLmatrix *m ) { if (!m->inv) { - m->inv = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 ); + m->inv = (GLfloat *) _mesa_align_malloc( 16 * sizeof(GLfloat), 16 ); if (m->inv) memcpy( m->inv, Identity, 16 * sizeof(GLfloat) ); } diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index 65c381f383..fbd63fd923 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -101,7 +101,7 @@ _mesa_vector4f_alloc( GLvector4f *v, GLbitfield flags, GLuint count, { v->stride = 4 * sizeof(GLfloat); v->size = 2; - v->storage = ALIGN_MALLOC( count * 4 * sizeof(GLfloat), alignment ); + v->storage = _mesa_align_malloc( count * 4 * sizeof(GLfloat), alignment ); v->storage_count = count; v->start = (GLfloat *) v->storage; v->data = (GLfloat (*)[4]) v->storage; @@ -119,7 +119,7 @@ void _mesa_vector4f_free( GLvector4f *v ) { if (v->flags & VEC_MALLOC) { - ALIGN_FREE( v->storage ); + _mesa_align_free( v->storage ); v->data = NULL; v->start = NULL; v->storage = NULL; diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 5351b5fe41..0137e52fc4 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -514,7 +514,7 @@ init_vp(GLcontext *ctx, struct tnl_pipeline_stage *stage) /* a few other misc allocations */ _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 ); - store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); + store->clipmask = (GLubyte *) _mesa_align_malloc(sizeof(GLubyte)*size, 32 ); return GL_TRUE; } @@ -537,7 +537,7 @@ dtr(struct tnl_pipeline_stage *stage) /* free misc arrays */ _mesa_vector4f_free( &store->ndcCoords ); - ALIGN_FREE( store->clipmask ); + _mesa_align_free( store->clipmask ); FREE( store ); stage->privatePtr = NULL; diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index bc7e0951ec..a275342563 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -246,7 +246,7 @@ static GLboolean init_vertex_stage( GLcontext *ctx, _mesa_vector4f_alloc( &store->clip, 0, size, 32 ); _mesa_vector4f_alloc( &store->proj, 0, size, 32 ); - store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); + store->clipmask = (GLubyte *) _mesa_align_malloc(sizeof(GLubyte)*size, 32 ); if (!store->clipmask || !store->eye.data || @@ -265,7 +265,7 @@ static void dtr( struct tnl_pipeline_stage *stage ) _mesa_vector4f_free( &store->eye ); _mesa_vector4f_free( &store->clip ); _mesa_vector4f_free( &store->proj ); - ALIGN_FREE( store->clipmask ); + _mesa_align_free( store->clipmask ); FREE(store); stage->privatePtr = NULL; stage->run = init_vertex_stage; diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index b35d6a284e..c1b1570232 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -494,7 +494,7 @@ void _tnl_init_vertices( GLcontext *ctx, if (max_vertex_size > vtx->max_vertex_size) { _tnl_free_vertices( ctx ); vtx->max_vertex_size = max_vertex_size; - vtx->vertex_buf = (GLubyte *)ALIGN_CALLOC(vb_size * max_vertex_size, 32 ); + vtx->vertex_buf = (GLubyte *)_mesa_align_calloc(vb_size * max_vertex_size, 32 ); invalidate_funcs(vtx); } @@ -541,7 +541,7 @@ void _tnl_free_vertices( GLcontext *ctx ) struct tnl_clipspace_fastpath *fp, *tmp; if (vtx->vertex_buf) { - ALIGN_FREE(vtx->vertex_buf); + _mesa_align_free(vtx->vertex_buf); vtx->vertex_buf = NULL; } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index aa7f1c40b1..3dde982371 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -781,7 +781,7 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) ctx->Shared->NullBufferObj); ASSERT(!exec->vtx.buffer_map); - exec->vtx.buffer_map = (GLfloat *)ALIGN_MALLOC(VBO_VERT_BUFFER_SIZE, 64); + exec->vtx.buffer_map = (GLfloat *)_mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64); exec->vtx.buffer_ptr = exec->vtx.buffer_map; vbo_exec_vtxfmt_init( exec ); @@ -835,7 +835,7 @@ void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ) ASSERT(exec->vtx.bufferobj->Name == 0 || exec->vtx.bufferobj->Name == IMM_BUFFER_NAME); if (exec->vtx.bufferobj->Name == 0) { - ALIGN_FREE(exec->vtx.buffer_map); + _mesa_align_free(exec->vtx.buffer_map); exec->vtx.buffer_map = NULL; exec->vtx.buffer_ptr = NULL; } -- cgit v1.2.3 From f0c50345d13372e81805d9d176881b981a008123 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 19 Feb 2010 20:01:11 +0100 Subject: r300g: fix rendering into the L8 and A8 texture formats RB3D_COLORPITCH.COLORFORMAT.I8 stores the C2 component. --- src/gallium/drivers/r300/r300_state_inlines.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index a608392532..c990be40b9 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -422,11 +422,11 @@ static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format) /* 8-bit outputs */ case PIPE_FORMAT_A8_UNORM: return R300_US_OUT_FMT_C4_8 | - R300_C0_SEL_A; + R300_C2_SEL_A; case PIPE_FORMAT_I8_UNORM: case PIPE_FORMAT_L8_UNORM: return R300_US_OUT_FMT_C4_8 | - R300_C0_SEL_R; + R300_C2_SEL_R; /* R300_OUT_SIGN(x) */ default: debug_printf("r300: Implementation error: " -- cgit v1.2.3 From da43aa84c8abc13bb8a2c8d0af57471862881523 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 19 Feb 2010 14:08:35 -0500 Subject: intel: Set buffer stamp before getting new buffers This way, if we get an invalidate as we update the buffers, we don't clobber the drawable stamp and ignore the invalidate. Pointed-out-by: Francisco Jerez --- src/mesa/drivers/dri/intel/intel_context.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 3a0830a85b..ced8d5aebe 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -206,6 +206,11 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) if (intel->is_front_buffer_rendering) intel_flush(&intel->ctx, GL_FALSE); + /* Set this up front, so that in case our buffers get invalidated + * while we're getting new buffers, we don't clobber the stamp and + * thus ignore the invalidate. */ + drawable->lastStamp = drawable->dri2.stamp; + if (INTEL_DEBUG & DEBUG_DRI) fprintf(stderr, "enter %s, drawable %p\n", __func__, drawable); @@ -376,7 +381,6 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) } driUpdateFramebufferSize(&intel->ctx, drawable); - drawable->lastStamp = drawable->dri2.stamp; } void -- cgit v1.2.3 From 984b72ad5f47cda8e141dc38524f6a0598dcc541 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 12:41:21 -0700 Subject: mesa: remove abs/negate from fetch_vector1ui() This function is only used for the NV unpack instructions. Negate/abs make no sense and removing the code fixes Windows compiler warnings. Found by Karl Schultz. --- src/mesa/shader/prog_execute.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 3b51f986e8..a1c20a325e 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -356,20 +356,7 @@ fetch_vector1ui(const struct prog_src_register *source, const struct gl_program_machine *machine) { const GLuint *src = (GLuint *) get_src_register_pointer(source, machine); - GLuint result; - - ASSERT(src); - - result = src[GET_SWZ(source->Swizzle, 0)]; - - if (source->Abs) { - result = FABSF(result); - } - if (source->Negate) { - result = -result; - } - - return result; + return src[GET_SWZ(source->Swizzle, 0)]; } -- cgit v1.2.3 From 8de5a292f70dba854a4bf06a2210bc38381e6bcf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 12:45:49 -0700 Subject: mesa: casts to silence new warnings from printf() --- src/mesa/main/debug.c | 4 ++-- src/mesa/shader/prog_print.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 246dbd436d..33b35e03c7 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -490,9 +490,9 @@ _mesa_dump_color_buffer(const char *filename) _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf); printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n", - ctx->ReadBuffer->_ColorReadBuffer, + (void *) ctx->ReadBuffer->_ColorReadBuffer, ctx->ReadBuffer->ColorReadBuffer, - ctx->DrawBuffer->_ColorDrawBuffers[0], + (void *) ctx->DrawBuffer->_ColorDrawBuffers[0], ctx->DrawBuffer->ColorDrawBuffer[0]); printf("Writing %d x %d color buffer to %s\n", w, h, filename); write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE); diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index a933f21857..b4905abf4c 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -603,7 +603,7 @@ _mesa_fprint_instruction_opt(FILE *f, switch (inst->Opcode) { case OPCODE_PRINT: - fprintf(f, "PRINT '%s'", inst->Data); + fprintf(f, "PRINT '%s'", (char *) inst->Data); if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { fprintf(f, ", "); fprintf(f, "%s[%d]%s", -- cgit v1.2.3 From 78a0c353d0f87c85feaa6dcb3042fc25d424f21b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 12:56:49 -0700 Subject: mesa: restore _mesa_snprintf() - it's needed for Windows This reverts part of commit 298be2b028263b2c343a707662c6fbfa18293cb2 --- src/mesa/drivers/common/meta.c | 6 +++--- src/mesa/main/imports.c | 19 ++++++++++++++++--- src/mesa/main/imports.h | 3 +++ src/mesa/main/version.c | 2 +- src/mesa/shader/prog_instruction.c | 2 +- src/mesa/shader/prog_print.c | 6 +++--- src/mesa/shader/program_parse.tab.c | 14 +++++++------- src/mesa/shader/program_parse.y | 10 +++++----- src/mesa/shader/shader_api.c | 2 +- src/mesa/shader/slang/slang_codegen.c | 4 ++-- src/mesa/shader/slang/slang_emit.c | 2 +- src/mesa/shader/slang/slang_link.c | 4 ++-- 12 files changed, 45 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 3aa70ddbf0..42ab7d4ed6 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1047,7 +1047,7 @@ init_blit_depth_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - snprintf(program2, sizeof(program2), program, texTarget); + _mesa_snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &blit->DepthFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); @@ -1670,7 +1670,7 @@ init_draw_stencil_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - snprintf(program2, sizeof(program2), program, texTarget); + _mesa_snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &drawpix->StencilFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->StencilFP); @@ -1704,7 +1704,7 @@ init_draw_depth_pixels(GLcontext *ctx) texTarget = "RECT"; else texTarget = "2D"; - snprintf(program2, sizeof(program2), program, texTarget); + _mesa_snprintf(program2, sizeof(program2), program, texTarget); _mesa_GenPrograms(1, &drawpix->DepthFP); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->DepthFP); diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 112490915f..56e8195810 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -827,6 +827,19 @@ _mesa_str_checksum(const char *str) /*@}*/ +/** Wrapper around vsnprintf() */ +int +_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) +{ + int r; + va_list args; + va_start( args, fmt ); + r = vsnprintf( str, size, fmt, args ); + va_end( args ); + return r; +} + + /**********************************************************************/ /** \name Diagnostics */ /*@{*/ @@ -866,7 +879,7 @@ output_if_debug(const char *prefixString, const char *outputString, * visible, so communicate with the debugger instead */ { char buf[4096]; - snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); + _mesa_snprintf(buf, sizeof(buf), "%s: %s%s", prefixString, outputString, newline ? "\n" : ""); OutputDebugStringA(buf); } #endif @@ -915,7 +928,7 @@ flush_delayed_errors( GLcontext *ctx ) char s[MAXSTRING]; if (ctx->ErrorDebugCount) { - snprintf(s, MAXSTRING, "%d similar %s errors", + _mesa_snprintf(s, MAXSTRING, "%d similar %s errors", ctx->ErrorDebugCount, error_string(ctx->ErrorValue)); @@ -1022,7 +1035,7 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *fmtString, ... ) vsnprintf(s, MAXSTRING, fmtString, args); va_end(args); - snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); + _mesa_snprintf(s2, MAXSTRING, "%s in %s", error_string(error), s); output_if_debug("Mesa: User error", s2, GL_TRUE); ctx->ErrorDebugFmtString = fmtString; diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 269d985f1e..ac3a7b5d61 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -583,6 +583,9 @@ _mesa_strtod( const char *s, char **end ); extern unsigned int _mesa_str_checksum(const char *str); +extern int +_mesa_snprintf( char *str, size_t size, const char *fmt, ... ); + extern void _mesa_warning( __GLcontext *gc, const char *fmtString, ... ); diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 0d01f16059..a39b680650 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -124,7 +124,7 @@ _mesa_compute_version(GLcontext *ctx) ctx->VersionString = (char *) malloc(max); if (ctx->VersionString) { - snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, + _mesa_snprintf(ctx->VersionString, max, "%u.%u Mesa " MESA_VERSION_STRING, ctx->VersionMajor, ctx->VersionMinor); } } diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index e5534b20e3..81099cb99c 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -345,7 +345,7 @@ _mesa_opcode_string(gl_inst_opcode opcode) return InstInfo[opcode].Name; else { static char s[20]; - snprintf(s, sizeof(s), "OP%u", opcode); + _mesa_snprintf(s, sizeof(s), "OP%u", opcode); return s; } } diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index b4905abf4c..0af70af9ad 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -77,7 +77,7 @@ file_string(gl_register_file f, gl_prog_print_mode mode) default: { static char s[20]; - snprintf(s, sizeof(s), "FILE%u", f); + _mesa_snprintf(s, sizeof(s), "FILE%u", f); return s; } } @@ -997,7 +997,7 @@ _mesa_write_shader_to_file(const struct gl_shader *shader) else type = "vert"; - snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); + _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "w"); if (!f) { fprintf(stderr, "Unable to open %s for writing\n", filename); @@ -1047,7 +1047,7 @@ _mesa_append_uniforms_to_file(const struct gl_shader *shader, else type = "vert"; - snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); + _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "a"); /* append */ if (!f) { fprintf(stderr, "Unable to open %s for appending\n", filename); diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 3f26f9f84a..52f6084358 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -2984,7 +2984,7 @@ yyreduce: { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { char s[100]; - snprintf(s, sizeof(s), + _mesa_snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; @@ -3001,7 +3001,7 @@ yyreduce: { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { char s[100]; - snprintf(s, sizeof(s), + _mesa_snprintf(s, sizeof(s), "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; @@ -4915,7 +4915,7 @@ yyreduce: if (exist != NULL) { char m[1000]; - snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); + _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); free((yyvsp[(2) - (4)].string)); yyerror(& (yylsp[(2) - (4)]), state, m); YYERROR; @@ -5559,18 +5559,18 @@ make_error_string(const char *fmt, ...) va_start(args, fmt); - /* Call vsnprintf once to determine how large the final string is. Call it - * again to do the actual formatting. from the vsnprintf manual page: + /* Call v_mesa_snprintf once to determine how large the final string is. Call it + * again to do the actual formatting. from the v_mesa_snprintf manual page: * * Upon successful return, these functions return the number of * characters printed (not including the trailing '\0' used to end * output to strings). */ - length = 1 + vsnprintf(NULL, 0, fmt, args); + length = 1 + v_mesa_snprintf(NULL, 0, fmt, args); str = malloc(length); if (str) { - vsnprintf(str, length, fmt, args); + v_mesa_snprintf(str, length, fmt, args); } va_end(args); diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 1c856d859d..75cb4cf479 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -936,7 +936,7 @@ addrRegPosOffset: INTEGER { if (($1 < 0) || ($1 > 63)) { char s[100]; - snprintf(s, sizeof(s), + _mesa_snprintf(s, sizeof(s), "relative address offset too large (%d)", $1); yyerror(& @1, state, s); YYERROR; @@ -950,7 +950,7 @@ addrRegNegOffset: INTEGER { if (($1 < 0) || ($1 > 64)) { char s[100]; - snprintf(s, sizeof(s), + _mesa_snprintf(s, sizeof(s), "relative address offset too large (%d)", $1); yyerror(& @1, state, s); YYERROR; @@ -2173,7 +2173,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER if (exist != NULL) { char m[1000]; - snprintf(m, sizeof(m), "redeclared identifier: %s", $2); + _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2); free($2); yyerror(& @2, state, m); YYERROR; @@ -2599,7 +2599,7 @@ make_error_string(const char *fmt, ...) va_start(args, fmt); /* Call vsnprintf once to determine how large the final string is. Call it - * again to do the actual formatting. from the vsnprintf manual page: + * again to do the actual formatting. from the v_mesa_snprintf manual page: * * Upon successful return, these functions return the number of * characters printed (not including the trailing '\0' used to end @@ -2609,7 +2609,7 @@ make_error_string(const char *fmt, ...) str = malloc(length); if (str) { - vsnprintf(str, length, fmt, args); + v_mesa_snprintf(str, length, fmt, args); } va_end(args); diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 8bd780b0b0..129a973cf1 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -2076,7 +2076,7 @@ validate_samplers(GLcontext *ctx, const struct gl_program *prog, char *errMsg) unit = prog->SamplerUnits[sampler]; target = prog->SamplerTargets[sampler]; if (targetUsed[unit] != -1 && targetUsed[unit] != target) { - snprintf(errMsg, 100, + _mesa_snprintf(errMsg, 100, "Texture unit %d is accessed both as %s and %s", unit, targetName[targetUsed[unit]], targetName[target]); return GL_FALSE; diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index b17256bb1e..6901b93d5d 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1643,7 +1643,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, if (A->pragmas->Debug) { char s[1000]; - snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name); + _mesa_snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name); n->Comment = _slang_strdup(s); } @@ -2190,7 +2190,7 @@ _slang_make_array_constructor(slang_assemble_ctx *A, slang_operation *oper) */ slang_variable *p = slang_variable_scope_grow(fun->parameters); char name[10]; - snprintf(name, sizeof(name), "p%d", i); + _mesa_snprintf(name, sizeof(name), "p%d", i); p->a_name = slang_atom_pool_atom(A->atoms, name); p->type.qualifier = SLANG_QUAL_CONST; p->type.specifier.type = baseType; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 52fe786890..7c0ea0c114 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2303,7 +2303,7 @@ emit_var_ref(slang_emit_info *emitInfo, slang_ir_node *n) /* error */ char s[100]; /* XXX isn't this really an out of memory/resources error? */ - snprintf(s, sizeof(s), "Undefined variable '%s'", + _mesa_snprintf(s, sizeof(s), "Undefined variable '%s'", (char *) n->Var->a_name); slang_info_log_error(emitInfo->log, s); return NULL; diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index b59fc0a43a..7c7bfbdbc5 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -139,7 +139,7 @@ link_varying_vars(GLcontext *ctx, } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { char msg[100]; - snprintf(msg, sizeof(msg), + _mesa_snprintf(msg, sizeof(msg), "centroid modifier mismatch for '%s'", var->Name); link_error(shProg, msg); free(map); @@ -147,7 +147,7 @@ link_varying_vars(GLcontext *ctx, } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { char msg[100]; - snprintf(msg, sizeof(msg), + _mesa_snprintf(msg, sizeof(msg), "invariant modifier mismatch for '%s'", var->Name); link_error(shProg, msg); free(map); -- cgit v1.2.3 From 150cce6aef85d22b5d32fba5d27605a98be6794a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 19 Feb 2010 13:44:12 -0700 Subject: mesa: fix snprintf() typo --- src/mesa/shader/program_parse.tab.c | 6 +++--- src/mesa/shader/program_parse.y | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 52f6084358..5679b64974 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -5559,18 +5559,18 @@ make_error_string(const char *fmt, ...) va_start(args, fmt); - /* Call v_mesa_snprintf once to determine how large the final string is. Call it + /* Call vsnprintf once to determine how large the final string is. Call it * again to do the actual formatting. from the v_mesa_snprintf manual page: * * Upon successful return, these functions return the number of * characters printed (not including the trailing '\0' used to end * output to strings). */ - length = 1 + v_mesa_snprintf(NULL, 0, fmt, args); + length = 1 + vsnprintf(NULL, 0, fmt, args); str = malloc(length); if (str) { - v_mesa_snprintf(str, length, fmt, args); + vsnprintf(str, length, fmt, args); } va_end(args); diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 75cb4cf479..d5fb0fac3e 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2609,7 +2609,7 @@ make_error_string(const char *fmt, ...) str = malloc(length); if (str) { - v_mesa_snprintf(str, length, fmt, args); + vsnprintf(str, length, fmt, args); } va_end(args); -- cgit v1.2.3 From a45f2ec7b7e929d705df23471ee92f05e233338c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 19 Feb 2010 23:53:27 -0800 Subject: mesa: Silence compiler format warning. --- src/mesa/shader/prog_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 0af70af9ad..765aa003b7 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -308,7 +308,7 @@ reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, struct gl_program_parameter *param = prog->Parameters->Parameters + index; char *state = _mesa_program_state_string(param->StateIndexes); - sprintf(str, state); + sprintf(str, "%s", state); free(state); } break; -- cgit v1.2.3 From 5fd84e0246f58cc59757d0bb2b94427899c944e1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 00:56:32 -0800 Subject: tgsi: ifdef out unused function micro_sqrt. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index fdbf2b436e..593c3cbfb3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -960,6 +960,7 @@ micro_pow( #endif } +#if 0 static void micro_sqrt( union tgsi_exec_channel *dst, const union tgsi_exec_channel *src ) @@ -969,6 +970,7 @@ micro_sqrt( union tgsi_exec_channel *dst, dst->f[2] = sqrtf( src->f[2] ); dst->f[3] = sqrtf( src->f[3] ); } +#endif static void micro_sub(union tgsi_exec_channel *dst, -- cgit v1.2.3 From b76164dcedad257f37af57358b102e14fdea8381 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 01:58:27 -0800 Subject: intel: Silence compiler format warnings. --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 2 +- src/mesa/drivers/dri/intel/intel_fbo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index c9841724ee..9261f2ffd8 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -209,7 +209,7 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, int ret; if (batch->ptr - batch->map > batch->buf->size) - printf ("bad relocation ptr %p map %p offset %d size %d\n", + printf ("bad relocation ptr %p map %p offset %d size %lu\n", batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); ret = dri_bo_emit_reloc(batch->buf, read_domains, write_domain, delta, batch->ptr - batch->map, buffer); diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 40b867971d..e154bd4087 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -525,7 +525,7 @@ intel_render_texture(GLcontext * ctx, return; } - DBG("Begin render texture tid %x tex=%u w=%d h=%d refcount=%d\n", + DBG("Begin render texture tid %lx tex=%u w=%d h=%d refcount=%d\n", _glthread_GetID(), att->Texture->Name, newImage->Width, newImage->Height, irb->Base.RefCount); -- cgit v1.2.3 From fbf04cef7184ab4f1939700740e512526446516f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 02:02:17 -0800 Subject: gamma: Remove unnecessary header. --- src/mesa/drivers/dri/gamma/gamma_context.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h index f702eee945..b03dfa6fb4 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.h +++ b/src/mesa/drivers/dri/gamma/gamma_context.h @@ -31,7 +31,6 @@ #include "drm_sarea.h" #include "main/colormac.h" #include "gamma_regs.h" -#include "gamma_main/macros.h" #include "gamma_screen.h" #include "main/macros.h" #include "main/mtypes.h" -- cgit v1.2.3 From fdcad8a5831b602bd725989599ed2bab33bf9c50 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 02:25:29 -0800 Subject: gamma: Add missing headers. --- src/mesa/drivers/dri/gamma/gamma_context.c | 1 + src/mesa/drivers/dri/gamma/gamma_dd.c | 1 + src/mesa/drivers/dri/gamma/gamma_inithw.c | 1 + src/mesa/drivers/dri/gamma/gamma_render.c | 3 ++- src/mesa/drivers/dri/gamma/gamma_span.c | 1 + src/mesa/drivers/dri/gamma/gamma_state.c | 3 +-- src/mesa/drivers/dri/gamma/gamma_texmem.c | 1 + src/mesa/drivers/dri/gamma/gamma_tris.c | 3 ++- src/mesa/drivers/dri/gamma/gamma_vb.c | 2 +- src/mesa/drivers/dri/gamma/gamma_xmesa.c | 1 + 10 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c index 004139d4f7..5e666c5c8c 100644 --- a/src/mesa/drivers/dri/gamma/gamma_context.c +++ b/src/mesa/drivers/dri/gamma/gamma_context.c @@ -49,6 +49,7 @@ #include "gamma_vb.h" #include "gamma_tris.h" +#include "gamma_macros.h" extern const struct tnl_pipeline_stage _gamma_render_stage; diff --git a/src/mesa/drivers/dri/gamma/gamma_dd.c b/src/mesa/drivers/dri/gamma/gamma_dd.c index c1c371fa7c..389d2231e7 100644 --- a/src/mesa/drivers/dri/gamma/gamma_dd.c +++ b/src/mesa/drivers/dri/gamma/gamma_dd.c @@ -26,6 +26,7 @@ #include "gamma_context.h" #include "gamma_vb.h" #include "gamma_lock.h" +#include "gamma_macros.h" #if defined(USE_X86_ASM) #include "x86/common_x86_asm.h" #endif diff --git a/src/mesa/drivers/dri/gamma/gamma_inithw.c b/src/mesa/drivers/dri/gamma/gamma_inithw.c index 79b54aacb5..735acb7a57 100644 --- a/src/mesa/drivers/dri/gamma/gamma_inithw.c +++ b/src/mesa/drivers/dri/gamma/gamma_inithw.c @@ -25,6 +25,7 @@ */ #include "gamma_context.h" +#include "gamma_macros.h" #include "glint_dri.h" void gammaInitHW( gammaContextPtr gmesa ) diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c index 0138ec3004..3c2fa507a9 100644 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ b/src/mesa/drivers/dri/gamma/gamma_render.c @@ -31,9 +31,10 @@ #include "main/imports.h" #include "main/mtypes.h" -#include "tnl/tcontext.h" +#include "tnl/t_context.h" #include "gamma_context.h" +#include "gamma_macros.h" #include "gamma_tris.h" #include "gamma_vb.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c index b96e49eadc..00160f760b 100644 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ b/src/mesa/drivers/dri/gamma/gamma_span.c @@ -1,6 +1,7 @@ #include "gamma_context.h" #include "gamma_lock.h" +#include "gamma_macros.h" #include "main/colormac.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c index 45ba521d70..c628457fba 100644 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ b/src/mesa/drivers/dri/gamma/gamma_state.c @@ -25,8 +25,7 @@ */ #include "gamma_context.h" -#include "gamma_main/macros.h" -#include "buffers.h" +#include "gamma_macros.h" #include "main/macros.h" #include "glint_dri.h" #include "main/colormac.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_texmem.c b/src/mesa/drivers/dri/gamma/gamma_texmem.c index 7df001ff6d..45a0c0148e 100644 --- a/src/mesa/drivers/dri/gamma/gamma_texmem.c +++ b/src/mesa/drivers/dri/gamma/gamma_texmem.c @@ -13,6 +13,7 @@ #include "glint_dri.h" #include "gamma_context.h" #include "gamma_lock.h" +#include "gamma_macros.h" void gammaDestroyTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t) { diff --git a/src/mesa/drivers/dri/gamma/gamma_tris.c b/src/mesa/drivers/dri/gamma/gamma_tris.c index 7899afd673..b7eab34d52 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tris.c +++ b/src/mesa/drivers/dri/gamma/gamma_tris.c @@ -26,6 +26,7 @@ */ #include "gamma_context.h" +#include "gamma_macros.h" #include "gamma_vb.h" #include "gamma_tris.h" @@ -37,7 +38,7 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" -#include "tnl/tcontext.h" +#include "tnl/t_context.h" #include "tnl/t_pipeline.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.c b/src/mesa/drivers/dri/gamma/gamma_vb.c index 013f856dcd..c9c1ebf62a 100644 --- a/src/mesa/drivers/dri/gamma/gamma_vb.c +++ b/src/mesa/drivers/dri/gamma/gamma_vb.c @@ -32,7 +32,7 @@ #include "main/colormac.h" #include "swrast_setup/swrast_setup.h" -#include "tnl/tcontext.h" +#include "tnl/t_context.h" #include "tnl/tnl.h" #include "gamma_context.h" diff --git a/src/mesa/drivers/dri/gamma/gamma_xmesa.c b/src/mesa/drivers/dri/gamma/gamma_xmesa.c index 430511e353..622121eed4 100644 --- a/src/mesa/drivers/dri/gamma/gamma_xmesa.c +++ b/src/mesa/drivers/dri/gamma/gamma_xmesa.c @@ -25,6 +25,7 @@ */ #include "gamma_context.h" +#include "gamma_macros.h" #include "gamma_vb.h" #include "main/context.h" #include "main/matrix.h" -- cgit v1.2.3 From 1613735d08eacc4b3d21694e5010587357525ecc Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 02:29:43 -0800 Subject: gamma: Silence uninitialized variable warnings. --- src/mesa/drivers/dri/gamma/gamma_tris.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/gamma/gamma_tris.c b/src/mesa/drivers/dri/gamma/gamma_tris.c index b7eab34d52..babe964951 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tris.c +++ b/src/mesa/drivers/dri/gamma/gamma_tris.c @@ -323,7 +323,7 @@ do { \ #define LOCAL_VARS(n) \ gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \ - GLuint color[n]; \ + GLuint color[n] = { 0 }; \ (void) color; -- cgit v1.2.3 From 71e3abc014cf8a1c18dcfd87517546a47ba41b6d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 16:23:44 -0800 Subject: st/xlib: Add assert to check for null pointer dereference. --- src/gallium/state_trackers/glx/xlib/xm_api.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index a274da0c62..4aac08a108 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -1148,6 +1148,7 @@ void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height ) if (!surf_front || !surf_back) return; + assert(pipe); pipe->surface_copy(pipe, surf_front, x, y, /* dest */ surf_back, x, y, /* src */ -- cgit v1.2.3 From d6b348ddd182999e4f3514e990e0bfb4f871805b Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 19 Feb 2010 22:36:16 +0800 Subject: st/egl: Clean up ximage surface. Mainly to move buffer allocation code from ximage_surface_validate to the new ximage_surface_update_buffers. --- src/gallium/state_trackers/egl/x11/native_ximage.c | 170 +++++++++++++-------- 1 file changed, 109 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 92a62f230e..78675a1998 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -79,11 +79,12 @@ struct ximage_surface { XVisualInfo visual; struct ximage_display *xdpy; - int width, height; GC gc; - struct ximage_buffer buffers[NUM_NATIVE_ATTACHMENTS]; unsigned int sequence_number; + int width, height; + struct ximage_buffer buffers[NUM_NATIVE_ATTACHMENTS]; + uint valid_mask; }; struct ximage_config { @@ -195,6 +196,92 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, return (xbuf->texture != NULL); } +/** + * Update the geometry of the surface. Return TRUE if the geometry has changed + * since last call. + */ +static boolean +ximage_surface_update_geometry(struct native_surface *nsurf) +{ + struct ximage_surface *xsurf = ximage_surface(nsurf); + Status ok; + Window root; + int x, y; + unsigned int w, h, border, depth; + boolean updated = FALSE; + + /* pbuffer has fixed geometry */ + if (xsurf->type == XIMAGE_SURFACE_TYPE_PBUFFER) + return FALSE; + + ok = XGetGeometry(xsurf->xdpy->dpy, xsurf->drawable, + &root, &x, &y, &w, &h, &border, &depth); + if (!ok) { + w = xsurf->width; + h = xsurf->height; + } + + /* all buffers become invalid */ + if (xsurf->width != w || xsurf->height != h) { + xsurf->width = w; + xsurf->height = h; + xsurf->valid_mask = 0x0; + + xsurf->sequence_number++; + updated = TRUE; + } + + return updated; +} + +/** + * Update the buffers of the surface. It is a slow function due to the + * round-trip to the server. + */ +static boolean +ximage_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask) +{ + struct ximage_surface *xsurf = ximage_surface(nsurf); + boolean updated; + uint new_valid; + int att; + + updated = ximage_surface_update_geometry(&xsurf->base); + buffer_mask &= ~xsurf->valid_mask; + /* all requested buffers are valid */ + if (!buffer_mask) + return TRUE; + + new_valid = 0x0; + for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { + if (native_attachment_mask_test(buffer_mask, att)) { + struct ximage_buffer *xbuf = &xsurf->buffers[att]; + + /* reallocate the texture */ + if (!ximage_surface_alloc_buffer(&xsurf->base, att)) + break; + + /* update ximage */ + if (xbuf->ximage) { + xbuf->ximage->width = xsurf->width; + xbuf->ximage->height = xsurf->height; + } + + new_valid |= (1 << att); + if (buffer_mask == new_valid) + break; + } + } + + if (new_valid) { + xsurf->valid_mask |= new_valid; + if (updated) + xsurf->sequence_number++; + } + + return (new_valid == buffer_mask); +} + static boolean ximage_surface_draw_buffer(struct native_surface *nsurf, enum native_attachment which) @@ -254,44 +341,24 @@ ximage_surface_swap_buffers(struct native_surface *nsurf) { struct ximage_surface *xsurf = ximage_surface(nsurf); struct ximage_buffer *xfront, *xback, xtmp; + boolean ret; + + /* display the back buffer first */ + ret = ximage_surface_draw_buffer(nsurf, NATIVE_ATTACHMENT_BACK_LEFT); xfront = &xsurf->buffers[NATIVE_ATTACHMENT_FRONT_LEFT]; xback = &xsurf->buffers[NATIVE_ATTACHMENT_BACK_LEFT]; - /* draw the back buffer directly if there is no front buffer */ + /* skip swapping so that the front buffer is allocated only when needed */ if (!xfront->texture) - return ximage_surface_draw_buffer(nsurf, NATIVE_ATTACHMENT_BACK_LEFT); + return ret; - /* swap the buffers */ xtmp = *xfront; *xfront = *xback; *xback = xtmp; - - /* the front/back textures are swapped */ xsurf->sequence_number++; - return ximage_surface_draw_buffer(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT); -} - -static void -ximage_surface_update_geometry(struct native_surface *nsurf) -{ - struct ximage_surface *xsurf = ximage_surface(nsurf); - Status ok; - Window root; - int x, y; - unsigned int w, h, border, depth; - - /* pbuffer has fixed geometry */ - if (xsurf->type == XIMAGE_SURFACE_TYPE_PBUFFER) - return; - - ok = XGetGeometry(xsurf->xdpy->dpy, xsurf->drawable, - &root, &x, &y, &w, &h, &border, &depth); - if (ok) { - xsurf->width = w; - xsurf->height = h; - } + return ret; } static boolean @@ -300,44 +367,25 @@ ximage_surface_validate(struct native_surface *nsurf, uint attachment_mask, int *width, int *height) { struct ximage_surface *xsurf = ximage_surface(nsurf); - boolean new_buffers = FALSE; - int att; - ximage_surface_update_geometry(&xsurf->base); + if (!ximage_surface_update_buffers(&xsurf->base, attachment_mask)) + return FALSE; - for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { - struct ximage_buffer *xbuf = &xsurf->buffers[att]; - - /* delay the allocation */ - if (!native_attachment_mask_test(attachment_mask, att)) - continue; - - /* reallocate the texture */ - if (!xbuf->texture || - xsurf->width != xbuf->texture->width0 || - xsurf->height != xbuf->texture->height0) { - new_buffers = TRUE; - if (ximage_surface_alloc_buffer(&xsurf->base, att)) { - /* update ximage */ - if (xbuf->ximage) { - xbuf->ximage->width = xsurf->width; - xbuf->ximage->height = xsurf->height; - } - } - } + if (seq_num) + *seq_num = xsurf->sequence_number; + + if (textures) { + int att; + for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { + if (native_attachment_mask_test(attachment_mask, att)) { + struct ximage_buffer *xbuf = &xsurf->buffers[att]; - if (textures) { - textures[att] = NULL; - pipe_texture_reference(&textures[att], xbuf->texture); + textures[att] = NULL; + pipe_texture_reference(&textures[att], xbuf->texture); + } } } - /* increase the sequence number so that caller knows */ - if (new_buffers) - xsurf->sequence_number++; - - if (seq_num) - *seq_num = xsurf->sequence_number; if (width) *width = xsurf->width; if (height) -- cgit v1.2.3 From 9d88006ca62bd1cd95e775852f4d797963b3fa20 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 19 Feb 2010 22:12:04 +0800 Subject: st/egl: Clean up DRI2 surface. Mainly to move the call to DRI2GetBuffers from dri2_surface_validate to the new dri2_surface_update_buffers. --- src/gallium/state_trackers/egl/x11/native_dri2.c | 312 +++++++++++++---------- 1 file changed, 182 insertions(+), 130 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index 5f2fd41260..dbd1a64992 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -62,10 +62,15 @@ struct dri2_surface { enum pipe_format color_format; struct dri2_display *dri2dpy; - struct pipe_texture *pbuffer_textures[NUM_NATIVE_ATTACHMENTS]; - boolean have_back, have_fake; - int width, height; unsigned int sequence_number; + int width, height; + struct pipe_texture *textures[NUM_NATIVE_ATTACHMENTS]; + uint valid_mask; + + boolean have_back, have_fake; + + struct x11_drawable_buffer *last_xbufs; + int last_num_xbufs; }; struct dri2_config { @@ -90,110 +95,24 @@ dri2_config(const struct native_config *nconf) return (struct dri2_config *) nconf; } -static boolean -dri2_surface_flush_frontbuffer(struct native_surface *nsurf) -{ - struct dri2_surface *dri2surf = dri2_surface(nsurf); - struct dri2_display *dri2dpy = dri2surf->dri2dpy; - - /* pbuffer is private */ - if (dri2surf->type == DRI2_SURFACE_TYPE_PBUFFER) - return TRUE; - - /* copy to real front buffer */ - if (dri2surf->have_fake) - x11_drawable_copy_buffers(dri2dpy->xscr, dri2surf->drawable, - 0, 0, dri2surf->width, dri2surf->height, - DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); - - return TRUE; -} - -static boolean -dri2_surface_swap_buffers(struct native_surface *nsurf) -{ - struct dri2_surface *dri2surf = dri2_surface(nsurf); - struct dri2_display *dri2dpy = dri2surf->dri2dpy; - - /* pbuffer is private */ - if (dri2surf->type == DRI2_SURFACE_TYPE_PBUFFER) - return TRUE; - - /* copy to front buffer */ - if (dri2surf->have_back) - x11_drawable_copy_buffers(dri2dpy->xscr, dri2surf->drawable, - 0, 0, dri2surf->width, dri2surf->height, - DRI2BufferBackLeft, DRI2BufferFrontLeft); - - /* and update fake front buffer */ - if (dri2surf->have_fake) - x11_drawable_copy_buffers(dri2dpy->xscr, dri2surf->drawable, - 0, 0, dri2surf->width, dri2surf->height, - DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); - - return TRUE; -} - -static boolean -dri2_surface_validate(struct native_surface *nsurf, uint attachment_mask, - unsigned int *seq_num, struct pipe_texture **textures, - int *width, int *height) +/** + * Get the buffers from the server. + */ +static void +dri2_surface_get_buffers(struct native_surface *nsurf, uint buffer_mask) { struct dri2_surface *dri2surf = dri2_surface(nsurf); struct dri2_display *dri2dpy = dri2surf->dri2dpy; unsigned int dri2atts[NUM_NATIVE_ATTACHMENTS]; - struct pipe_texture templ; - struct x11_drawable_buffer *xbufs; int num_ins, num_outs, att, i; - - if (attachment_mask) { - memset(&templ, 0, sizeof(templ)); - templ.target = PIPE_TEXTURE_2D; - templ.last_level = 0; - templ.width0 = dri2surf->width; - templ.height0 = dri2surf->height; - templ.depth0 = 1; - templ.format = dri2surf->color_format; - templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; - - if (textures) - memset(textures, 0, sizeof(*textures) * NUM_NATIVE_ATTACHMENTS); - } - - /* create textures for pbuffer */ - if (dri2surf->type == DRI2_SURFACE_TYPE_PBUFFER) { - struct pipe_screen *screen = dri2dpy->base.screen; - - for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { - struct pipe_texture *ptex = dri2surf->pbuffer_textures[att]; - - /* delay the allocation */ - if (!native_attachment_mask_test(attachment_mask, att)) - continue; - - if (!ptex) { - ptex = screen->texture_create(screen, &templ); - dri2surf->pbuffer_textures[att] = ptex; - } - - if (textures) - pipe_texture_reference(&textures[att], ptex); - } - - if (seq_num) - *seq_num = dri2surf->sequence_number; - if (width) - *width = dri2surf->width; - if (height) - *height = dri2surf->height; - - return TRUE; - } + struct x11_drawable_buffer *xbufs; + struct pipe_texture templ; + uint valid_mask; /* prepare the attachments */ num_ins = 0; for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { - if (native_attachment_mask_test(attachment_mask, att)) { + if (native_attachment_mask_test(buffer_mask, att)) { unsigned int dri2att; switch (att) { @@ -220,27 +139,39 @@ dri2_surface_validate(struct native_surface *nsurf, uint attachment_mask, } } - dri2surf->have_back = FALSE; - dri2surf->have_fake = FALSE; - - /* remember old geometry */ - templ.width0 = dri2surf->width; - templ.height0 = dri2surf->height; - xbufs = x11_drawable_get_buffers(dri2dpy->xscr, dri2surf->drawable, &dri2surf->width, &dri2surf->height, dri2atts, FALSE, num_ins, &num_outs); - if (!xbufs) - return FALSE; - - if (templ.width0 != dri2surf->width || templ.height0 != dri2surf->height) { - /* are there cases where the buffers change and the geometry doesn't? */ - dri2surf->sequence_number++; - templ.width0 = dri2surf->width; - templ.height0 = dri2surf->height; + /* we should be able to do better... */ + if (xbufs && dri2surf->last_num_xbufs == num_outs && + memcmp(dri2surf->last_xbufs, xbufs, sizeof(*xbufs) * num_outs) == 0) { + free(xbufs); + return; } + /* free the old buffers */ + for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) + pipe_texture_reference(&dri2surf->textures[i], NULL); + dri2surf->valid_mask = 0x0; + dri2surf->sequence_number++; + + dri2surf->have_back = FALSE; + dri2surf->have_fake = FALSE; + + if (!xbufs) + return; + + memset(&templ, 0, sizeof(templ)); + templ.target = PIPE_TEXTURE_2D; + templ.last_level = 0; + templ.width0 = dri2surf->width; + templ.height0 = dri2surf->height; + templ.depth0 = 1; + templ.format = dri2surf->color_format; + templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; + + valid_mask = 0x0; for (i = 0; i < num_outs; i++) { struct x11_drawable_buffer *xbuf = &xbufs[i]; const char *desc; @@ -266,33 +197,151 @@ dri2_surface_validate(struct native_surface *nsurf, uint attachment_mask, break; } - if (!desc || !native_attachment_mask_test(attachment_mask, natt) || - (textures && textures[natt])) { + if (!desc || dri2surf->textures[natt]) { if (!desc) _eglLog(_EGL_WARNING, "unknown buffer %d", xbuf->attachment); - else if (!native_attachment_mask_test(attachment_mask, natt)) - _eglLog(_EGL_WARNING, "unexpected buffer %d", xbuf->attachment); else _eglLog(_EGL_WARNING, "both real and fake front buffers are listed"); continue; } - if (textures) { - struct pipe_texture *ptex = - dri2dpy->api->texture_from_shared_handle(dri2dpy->api, - dri2dpy->base.screen, &templ, - desc, xbuf->pitch, xbuf->name); - if (ptex) { - /* the caller owns the textures */ - textures[natt] = ptex; + dri2surf->textures[natt] = + dri2dpy->api->texture_from_shared_handle(dri2dpy->api, + dri2dpy->base.screen, &templ, desc, xbuf->pitch, xbuf->name); + if (dri2surf->textures[natt]) + valid_mask |= 1 << natt; + } + + if (dri2surf->last_xbufs) + free(dri2surf->last_xbufs); + dri2surf->last_xbufs = xbufs; + dri2surf->last_num_xbufs = num_outs; + + dri2surf->valid_mask = valid_mask; +} + +/** + * Update the buffers of the surface. This is a slow function due to the + * round-trip to the server. + */ +static boolean +dri2_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask) +{ + struct dri2_surface *dri2surf = dri2_surface(nsurf); + struct dri2_display *dri2dpy = dri2surf->dri2dpy; + + /* create textures for pbuffer */ + if (dri2surf->type == DRI2_SURFACE_TYPE_PBUFFER) { + struct pipe_screen *screen = dri2dpy->base.screen; + struct pipe_texture templ; + uint new_valid = 0x0; + int att; + + buffer_mask &= ~dri2surf->valid_mask; + if (!buffer_mask) + return TRUE; + + memset(&templ, 0, sizeof(templ)); + templ.target = PIPE_TEXTURE_2D; + templ.last_level = 0; + templ.width0 = dri2surf->width; + templ.height0 = dri2surf->height; + templ.depth0 = 1; + templ.format = dri2surf->color_format; + templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; + + for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { + if (native_attachment_mask_test(buffer_mask, att)) { + assert(!dri2surf->textures[att]); + + dri2surf->textures[att] = screen->texture_create(screen, &templ); + if (!dri2surf->textures[att]) + break; + + new_valid |= 1 << att; + if (new_valid == buffer_mask) + break; } } + dri2surf->valid_mask |= new_valid; + /* no need to update sequence number */ } + else { + dri2_surface_get_buffers(&dri2surf->base, buffer_mask); + } + + return ((dri2surf->valid_mask & buffer_mask) == buffer_mask); +} + +static boolean +dri2_surface_flush_frontbuffer(struct native_surface *nsurf) +{ + struct dri2_surface *dri2surf = dri2_surface(nsurf); + struct dri2_display *dri2dpy = dri2surf->dri2dpy; - free(xbufs); + /* pbuffer is private */ + if (dri2surf->type == DRI2_SURFACE_TYPE_PBUFFER) + return TRUE; + + /* copy to real front buffer */ + if (dri2surf->have_fake) + x11_drawable_copy_buffers(dri2dpy->xscr, dri2surf->drawable, + 0, 0, dri2surf->width, dri2surf->height, + DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); + + return TRUE; +} + +static boolean +dri2_surface_swap_buffers(struct native_surface *nsurf) +{ + struct dri2_surface *dri2surf = dri2_surface(nsurf); + struct dri2_display *dri2dpy = dri2surf->dri2dpy; + + /* pbuffer is private */ + if (dri2surf->type == DRI2_SURFACE_TYPE_PBUFFER) + return TRUE; + + /* copy to front buffer */ + if (dri2surf->have_back) + x11_drawable_copy_buffers(dri2dpy->xscr, dri2surf->drawable, + 0, 0, dri2surf->width, dri2surf->height, + DRI2BufferBackLeft, DRI2BufferFrontLeft); + + /* and update fake front buffer */ + if (dri2surf->have_fake) + x11_drawable_copy_buffers(dri2dpy->xscr, dri2surf->drawable, + 0, 0, dri2surf->width, dri2surf->height, + DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); + + return TRUE; +} + +static boolean +dri2_surface_validate(struct native_surface *nsurf, uint attachment_mask, + unsigned int *seq_num, struct pipe_texture **textures, + int *width, int *height) +{ + struct dri2_surface *dri2surf = dri2_surface(nsurf); + + if (!dri2_surface_update_buffers(&dri2surf->base, attachment_mask)) + return FALSE; if (seq_num) *seq_num = dri2surf->sequence_number; + + if (textures) { + int att; + for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { + if (native_attachment_mask_test(attachment_mask, att)) { + struct pipe_texture *ptex = dri2surf->textures[att]; + + textures[att] = NULL; + pipe_texture_reference(&textures[att], ptex); + } + } + } + if (width) *width = dri2surf->width; if (height) @@ -320,8 +369,11 @@ dri2_surface_destroy(struct native_surface *nsurf) struct dri2_surface *dri2surf = dri2_surface(nsurf); int i; + if (dri2surf->last_xbufs) + free(dri2surf->last_xbufs); + for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) { - struct pipe_texture *ptex = dri2surf->pbuffer_textures[i]; + struct pipe_texture *ptex = dri2surf->textures[i]; pipe_texture_reference(&ptex, NULL); } @@ -345,9 +397,6 @@ dri2_display_create_surface(struct native_display *ndpy, if (!dri2surf) return NULL; - if (drawable) - x11_drawable_enable_dri2(dri2dpy->xscr, drawable, TRUE); - dri2surf->dri2dpy = dri2dpy; dri2surf->type = type; dri2surf->drawable = drawable; @@ -359,6 +408,9 @@ dri2_display_create_surface(struct native_display *ndpy, dri2surf->base.validate = dri2_surface_validate; dri2surf->base.wait = dri2_surface_wait; + if (drawable) + x11_drawable_enable_dri2(dri2dpy->xscr, drawable, TRUE); + return dri2surf; } -- cgit v1.2.3 From 719c4b0fc2672adcaacd81877db9901ff5cd1d7c Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 20 Feb 2010 12:41:30 +0800 Subject: st/egl: Do not force validate when update_buffer is called. st/mesa was changed to call pipe_screen::update_buffer in st_validate_state. In most cases there is no need to validate. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 80dd126995..7ab2cd49ab 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -528,12 +528,6 @@ static void egl_g3d_update_buffer(struct pipe_screen *screen, void *context_private) { struct egl_g3d_context *gctx = egl_g3d_context(context_private); - - /** - * It is likely that the surface has changed when this function is called. - * Set force_validate to skip an unnecessary check. - */ - gctx->force_validate = EGL_TRUE; egl_g3d_validate_context(gctx->base.Resource.Display, &gctx->base); } -- cgit v1.2.3 From 5d4d54574ffb73ecafd44bc533556608f3ab9ffa Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 21 Feb 2010 10:02:13 +0800 Subject: st/egl: Enable extensions before adding configs. Configs are validated before added. The validation depends on the extensions available. If configs are added before enabling extensions, configs with EGL_SCREEN_SURFACE_MESA bit set will never pass the validation for example. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 7ab2cd49ab..d769d253ac 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -587,19 +587,19 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy, egl_g3d_init_st(&gdrv->base); dpy->ClientAPIsMask = gdrv->api_mask; - if (egl_g3d_add_configs(drv, dpy, 1) == 1) { - _eglError(EGL_NOT_INITIALIZED, "eglInitialize(unable to add configs)"); - goto fail; - } - #ifdef EGL_MESA_screen_surface - /* enable MESA_screen_surface */ + /* enable MESA_screen_surface before adding (and validating) configs */ if (gdpy->native->modeset) { dpy->Extensions.MESA_screen_surface = EGL_TRUE; egl_g3d_add_screens(drv, dpy); } #endif + if (egl_g3d_add_configs(drv, dpy, 1) == 1) { + _eglError(EGL_NOT_INITIALIZED, "eglInitialize(unable to add configs)"); + goto fail; + } + *major = 1; *minor = 4; -- cgit v1.2.3 From dbaa84515318c3cf1d4be67fc10ca3bd6bc00e0f Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 21 Feb 2010 10:11:54 +0800 Subject: st/egl: Properly convert vrefresh to refresh rate. Some kernels have vrefresh = (refresh rate * 1000) while others don't. Use some heuristics here. --- src/gallium/state_trackers/egl/kms/native_kms.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index 91cefc538d..ee6ab2e60b 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -499,7 +499,10 @@ kms_display_get_modes(struct native_display *ndpy, kmode->base.desc = kmode->mode.name; kmode->base.width = kmode->mode.hdisplay; kmode->base.height = kmode->mode.vdisplay; - kmode->base.refresh_rate = kmode->mode.vrefresh / 1000; + kmode->base.refresh_rate = kmode->mode.vrefresh; + /* not all kernels have vrefresh = refresh_rate * 1000 */ + if (kmode->base.refresh_rate > 1000) + kmode->base.refresh_rate = (kmode->base.refresh_rate + 500) / 1000; } nmodes_return = malloc(count * sizeof(*nmodes_return)); -- cgit v1.2.3 From ae41339d4ce7c642c03a8d6f5310a68422261150 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 23:27:07 -0800 Subject: glsl/cl: Prevent possible string overflow. --- src/glsl/cl/sl_cl_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 8106ff6f61..2291ec2200 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -387,7 +387,8 @@ _error(struct parse_context *ctx, const char *msg) { if (ctx->error[0] == '\0') { - strcpy(ctx->error, msg); + strncpy(ctx->error, msg, sizeof(ctx->error) - 1); + ctx->error[sizeof(ctx->error) - 1] = '\0'; } } -- cgit v1.2.3 From f96e8a033b212b54a80622839579c99dff2378fc Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 23:43:33 -0800 Subject: radeon: Silence compiler format warning. --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 3b066f5eef..46664a1755 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -564,7 +564,7 @@ radeon_render_texture(GLcontext * ctx, return; } - DBG("Begin render texture tid %x tex=%u w=%d h=%d refcount=%d\n", + DBG("Begin render texture tid %lx tex=%u w=%d h=%d refcount=%d\n", _glthread_GetID(), att->Texture->Name, newImage->Width, newImage->Height, rrb->base.RefCount); -- cgit v1.2.3 From 1207482a0340bfe92e2ff764e55d619c8036a47d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 21 Feb 2010 15:47:45 +0800 Subject: st/egl: Disable SHM in ximage backend. With pipe_screen::update_buffer being called in st_validate_state, it is likely that softpipe will flush tile caches to a detached SHM segment. Disable SHM for now until a better solution is found. --- src/gallium/state_trackers/egl/x11/native_x11.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_x11.c b/src/gallium/state_trackers/egl/x11/native_x11.c index 8eb542bd82..55f0d4d308 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.c +++ b/src/gallium/state_trackers/egl/x11/native_x11.c @@ -141,9 +141,16 @@ native_create_display(EGLNativeDisplayType dpy) if (!ndpy) { EGLint level = (force_sw) ? _EGL_INFO : _EGL_WARNING; - - _eglLog(level, "use software fallback"); - ndpy = x11_create_ximage_display(dpy, TRUE); + boolean use_shm; + + /* + * XXX st/mesa calls pipe_screen::update_buffer in st_validate_state. + * When SHM is used, there is a good chance that the shared memory + * segment is detached before the softpipe tile cache is flushed. + */ + use_shm = FALSE; + _eglLog(level, "use software%s fallback", (use_shm) ? " (SHM)" : ""); + ndpy = x11_create_ximage_display(dpy, use_shm); } return ndpy; -- cgit v1.2.3 From f56c9c2b198dc740fd1559157a160b8a9d0de7a5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 00:24:05 -0800 Subject: i965g: Fix use of out-of-scope variable. --- src/gallium/drivers/i965/brw_wm_sampler_state.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_wm_sampler_state.c b/src/gallium/drivers/i965/brw_wm_sampler_state.c index a8bc31c9ce..6a6086fc51 100644 --- a/src/gallium/drivers/i965/brw_wm_sampler_state.c +++ b/src/gallium/drivers/i965/brw_wm_sampler_state.c @@ -130,15 +130,14 @@ brw_wm_sampler_update_default_colors(struct brw_context *brw) const struct brw_texture *tex = brw_texture(brw->curr.texture[i]); const struct brw_sampler *sampler = brw->curr.sampler[i]; const float *bc; - + float bordercolor[4] = { + sampler->border_color[0], + sampler->border_color[0], + sampler->border_color[0], + sampler->border_color[0] + }; + if (util_format_is_depth_or_stencil(tex->base.format)) { - float bordercolor[4] = { - sampler->border_color[0], - sampler->border_color[0], - sampler->border_color[0], - sampler->border_color[0] - }; - bc = bordercolor; } else { -- cgit v1.2.3 From d1aafb33b5193db351ece5887edad1c908cbf36b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 00:36:50 -0800 Subject: glsl/cl: Prevent possible buffer overflow. --- src/glsl/cl/sl_cl_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 2291ec2200..9a20509fc6 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -2949,7 +2949,8 @@ sl_cl_compile(struct sl_pp_context *context, ctx.tokens_read = 0; ctx.tokens = malloc(ctx.tokens_cap * sizeof(struct sl_pp_token_info)); if (!ctx.tokens) { - strncpy(error, "out of memory", cberror); + strncpy(error, "out of memory", cberror - 1); + error[cberror - 1] = '\0'; return -1; } -- cgit v1.2.3 From 0b83f48e8263ab9ea7c30a929f1d5764b9c61d2a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 01:19:47 -0800 Subject: i965g: Fix assertions that were always true. The surface_format field is 9 bits wide which has a maximum value of 511. BRW_SURFACEFORMAT_INVALID has a value of 4095 which exceeds the width of the surface_format field. This patch asserts that the format is not BRW_SURFACEFORMAT_INVALID before assignment to the surface_format field. --- src/gallium/drivers/i965/brw_screen_texture.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index feb9d5f765..8bdd43cf14 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -191,6 +191,7 @@ static struct pipe_texture *brw_texture_create( struct pipe_screen *screen, struct brw_texture *tex; enum brw_buffer_type buffer_type; enum pipe_error ret; + GLuint format; tex = CALLOC_STRUCT(brw_texture); if (tex == NULL) @@ -248,8 +249,10 @@ static struct pipe_texture *brw_texture_create( struct pipe_screen *screen, tex->ss.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; tex->ss.ss0.surface_type = translate_tex_target(tex->base.target); - tex->ss.ss0.surface_format = translate_tex_format(tex->base.format); - assert(tex->ss.ss0.surface_format != BRW_SURFACEFORMAT_INVALID); + + format = translate_tex_target(tex->base.format); + assert(format != BRW_SURFACEFORMAT_INVALID); + tex->ss.ss0.surface_format = format; /* This is ok for all textures with channel width 8bit or less: */ @@ -474,6 +477,7 @@ brw_texture_blanket_winsys_buffer(struct pipe_screen *screen, { struct brw_screen *bscreen = brw_screen(screen); struct brw_texture *tex; + GLuint format; if (templ->target != PIPE_TEXTURE_2D || templ->last_level != 0 || @@ -518,8 +522,10 @@ brw_texture_blanket_winsys_buffer(struct pipe_screen *screen, tex->ss.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; tex->ss.ss0.surface_type = translate_tex_target(tex->base.target); - tex->ss.ss0.surface_format = translate_tex_format(tex->base.format); - assert(tex->ss.ss0.surface_format != BRW_SURFACEFORMAT_INVALID); + + format = translate_tex_format(tex->base.format); + assert(format != BRW_SURFACEFORMAT_INVALID); + tex->ss.ss0.surface_format = format; /* This is ok for all textures with channel width 8bit or less: */ -- cgit v1.2.3 From 3194197efd78dd1aa14c153672e0ed028d9d5abb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 01:30:35 -0800 Subject: i965g: Remove dead code. --- src/gallium/drivers/i965/brw_screen_surface.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_screen_surface.c b/src/gallium/drivers/i965/brw_screen_surface.c index e2b9954e59..904df813dd 100644 --- a/src/gallium/drivers/i965/brw_screen_surface.c +++ b/src/gallium/drivers/i965/brw_screen_surface.c @@ -231,8 +231,6 @@ static struct pipe_surface *brw_get_tex_surface(struct pipe_screen *screen, case BRW_VIEW_IN_PLACE: surface = create_in_place_view( bscreen, tex, id, usage ); break; - default: - return NULL; } insert_at_head( &tex->views[type], surface ); -- cgit v1.2.3 From d89de9c13fe6cd1f2f1a82d8bc0988d06e629def Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 01:57:16 -0800 Subject: draw: Remove dead code. --- src/gallium/auxiliary/draw/draw_pipe_aapoint.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c index 97f3480879..9f9fb4312c 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c @@ -864,7 +864,7 @@ draw_install_aapoint_stage(struct draw_context *draw, */ aapoint = draw_aapoint_stage( draw ); if (aapoint == NULL) - goto fail; + return FALSE; aapoint->pipe = pipe; @@ -881,10 +881,4 @@ draw_install_aapoint_stage(struct draw_context *draw, draw->pipeline.aapoint = &aapoint->stage; return TRUE; - - fail: - if (aapoint) - aapoint->stage.destroy( &aapoint->stage ); - - return FALSE; } -- cgit v1.2.3 From 7da9da190f44f504db13570c0cec05dffa240cae Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 02:13:15 -0800 Subject: mesa: Add assert to check for null pointer dereference. --- src/mesa/main/framebuffer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 065e25fd33..269bc9ac6c 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -829,8 +829,12 @@ update_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) void _mesa_update_framebuffer(GLcontext *ctx) { - struct gl_framebuffer *drawFb = ctx->DrawBuffer; - struct gl_framebuffer *readFb = ctx->ReadBuffer; + struct gl_framebuffer *drawFb; + struct gl_framebuffer *readFb; + + assert(ctx); + drawFb = ctx->DrawBuffer; + readFb = ctx->ReadBuffer; update_framebuffer(ctx, drawFb); if (readFb != drawFb) -- cgit v1.2.3 From 2a30c268bdddf02300913c79ffbbb779c5399815 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 20 Feb 2010 18:52:20 +0100 Subject: r300g: re-enable SRGB formats Ouch. --- src/gallium/drivers/r300/r300_texture.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 153f4eebda..e2c10325fa 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -208,7 +208,8 @@ static INLINE uint32_t r300_translate_texformat(enum pipe_format format) switch (desc->channel[0].type) { case UTIL_FORMAT_TYPE_UNSIGNED: case UTIL_FORMAT_TYPE_SIGNED: - if (!desc->channel[0].normalized) { + if (!desc->channel[0].normalized && + desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB) { return ~0; } -- cgit v1.2.3 From 5c14fd1743701776d128c2c1d25244f4de371ebe Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 20 Feb 2010 21:33:53 +0100 Subject: r300g: make r300_translate_texformat private Unlikely to increase performance from inlining. And partially expose it through r300_is_sampler_format_supported. --- src/gallium/drivers/r300/r300_screen.c | 2 +- src/gallium/drivers/r300/r300_texture.c | 244 ++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_texture.h | 235 +----------------------------- 3 files changed, 246 insertions(+), 235 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 5fa1ea0850..0b3b96def7 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -222,7 +222,7 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, /* Check sampler format support. */ if ((usage & PIPE_TEXTURE_USAGE_SAMPLER) && (is_r500 || !is_z24) && /* Z24 cannot be sampled from on non-r5xx. */ - r300_translate_texformat(format) != ~0) { + r300_is_sampler_format_supported(format)) { retval |= PIPE_TEXTURE_USAGE_SAMPLER; } diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 34a49bec34..5b7afc6eb9 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -44,6 +44,250 @@ static const unsigned microblock_table[5][3][2] = { {{ 2, 1}, {0, 0}, {0, 0}} /* 128 bits per pixel */ }; +/* Translate a pipe_format into a useful texture format for sampling. + * + * Some special formats are translated directly using R300_EASY_TX_FORMAT, + * but the majority of them is translated in a generic way, automatically + * supporting all the formats hw can support. + * + * R300_EASY_TX_FORMAT swizzles the texture. + * Note the signature of R300_EASY_TX_FORMAT: + * R300_EASY_TX_FORMAT(B, G, R, A, FORMAT); + * + * The FORMAT specifies how the texture sampler will treat the texture, and + * makes available X, Y, Z, W, ZERO, and ONE for swizzling. */ +static uint32_t r300_translate_texformat(enum pipe_format format) +{ + uint32_t result = 0; + const struct util_format_description *desc; + unsigned components = 0, i; + boolean uniform = TRUE; + const uint32_t swizzle_shift[4] = { + R300_TX_FORMAT_R_SHIFT, + R300_TX_FORMAT_G_SHIFT, + R300_TX_FORMAT_B_SHIFT, + R300_TX_FORMAT_A_SHIFT + }; + const uint32_t sign_bit[4] = { + R300_TX_FORMAT_SIGNED_X, + R300_TX_FORMAT_SIGNED_Y, + R300_TX_FORMAT_SIGNED_Z, + R300_TX_FORMAT_SIGNED_W, + }; + + desc = util_format_description(format); + + /* Colorspace (return non-RGB formats directly). */ + switch (desc->colorspace) { + /* Depth stencil formats. */ + case UTIL_FORMAT_COLORSPACE_ZS: + switch (format) { + case PIPE_FORMAT_Z16_UNORM: + return R300_EASY_TX_FORMAT(X, X, X, X, X16); + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + return R300_EASY_TX_FORMAT(X, X, X, X, W24_FP); + default: + return ~0; /* Unsupported. */ + } + + /* YUV formats. */ + case UTIL_FORMAT_COLORSPACE_YUV: + result |= R300_TX_FORMAT_YUV_TO_RGB; + + switch (format) { + case PIPE_FORMAT_YCBCR: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, YVYU422) | result; + case PIPE_FORMAT_YCBCR_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, VYUY422) | result; + default: + return ~0; /* Unsupported/unknown. */ + } + + /* Add gamma correction. */ + case UTIL_FORMAT_COLORSPACE_SRGB: + result |= R300_TX_FORMAT_GAMMA; + break; + + default:; + } + + /* Add swizzle. */ + for (i = 0; i < 4; i++) { + switch (desc->swizzle[i]) { + case UTIL_FORMAT_SWIZZLE_X: + case UTIL_FORMAT_SWIZZLE_NONE: + result |= R300_TX_FORMAT_X << swizzle_shift[i]; + break; + case UTIL_FORMAT_SWIZZLE_Y: + result |= R300_TX_FORMAT_Y << swizzle_shift[i]; + break; + case UTIL_FORMAT_SWIZZLE_Z: + result |= R300_TX_FORMAT_Z << swizzle_shift[i]; + break; + case UTIL_FORMAT_SWIZZLE_W: + result |= R300_TX_FORMAT_W << swizzle_shift[i]; + break; + case UTIL_FORMAT_SWIZZLE_0: + result |= R300_TX_FORMAT_ZERO << swizzle_shift[i]; + break; + case UTIL_FORMAT_SWIZZLE_1: + result |= R300_TX_FORMAT_ONE << swizzle_shift[i]; + break; + default: + return ~0; /* Unsupported. */ + } + } + + /* Compressed formats. */ + if (desc->layout == UTIL_FORMAT_LAYOUT_DXT) { + switch (format) { + case PIPE_FORMAT_DXT1_RGB: + case PIPE_FORMAT_DXT1_RGBA: + case PIPE_FORMAT_DXT1_SRGB: + case PIPE_FORMAT_DXT1_SRGBA: + return R300_TX_FORMAT_DXT1 | result; + case PIPE_FORMAT_DXT3_RGBA: + case PIPE_FORMAT_DXT3_SRGBA: + return R300_TX_FORMAT_DXT3 | result; + case PIPE_FORMAT_DXT5_RGBA: + case PIPE_FORMAT_DXT5_SRGBA: + return R300_TX_FORMAT_DXT5 | result; + default: + return ~0; /* Unsupported/unknown. */ + } + } + + /* Get the number of components. */ + for (i = 0; i < 4; i++) { + if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID) { + ++components; + } + } + + /* Add sign. */ + for (i = 0; i < components; i++) { + if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) { + result |= sign_bit[i]; + } + } + + /* See whether the components are of the same size. */ + for (i = 1; i < components; i++) { + uniform = uniform && desc->channel[0].size == desc->channel[i].size; + } + + /* Non-uniform formats. */ + if (!uniform) { + switch (components) { + case 3: + if (desc->channel[0].size == 5 && + desc->channel[1].size == 6 && + desc->channel[2].size == 5) { + return R300_TX_FORMAT_Z5Y6X5 | result; + } + if (desc->channel[0].size == 5 && + desc->channel[1].size == 5 && + desc->channel[2].size == 6) { + return R300_TX_FORMAT_Z6Y5X5 | result; + } + return ~0; /* Unsupported/unknown. */ + + case 4: + if (desc->channel[0].size == 5 && + desc->channel[1].size == 5 && + desc->channel[2].size == 5 && + desc->channel[3].size == 1) { + return R300_TX_FORMAT_W1Z5Y5X5 | result; + } + if (desc->channel[0].size == 10 && + desc->channel[1].size == 10 && + desc->channel[2].size == 10 && + desc->channel[3].size == 2) { + return R300_TX_FORMAT_W2Z10Y10X10 | result; + } + } + return ~0; /* Unsupported/unknown. */ + } + + /* And finally, uniform formats. */ + switch (desc->channel[0].type) { + case UTIL_FORMAT_TYPE_UNSIGNED: + case UTIL_FORMAT_TYPE_SIGNED: + if (!desc->channel[0].normalized && + desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB) { + return ~0; + } + + switch (desc->channel[0].size) { + case 4: + switch (components) { + case 2: + return R300_TX_FORMAT_Y4X4 | result; + case 4: + return R300_TX_FORMAT_W4Z4Y4X4 | result; + } + return ~0; + + case 8: + switch (components) { + case 1: + return R300_TX_FORMAT_X8 | result; + case 2: + return R300_TX_FORMAT_Y8X8 | result; + case 4: + return R300_TX_FORMAT_W8Z8Y8X8 | result; + } + return ~0; + + case 16: + switch (components) { + case 1: + return R300_TX_FORMAT_X16 | result; + case 2: + return R300_TX_FORMAT_Y16X16 | result; + case 4: + return R300_TX_FORMAT_W16Z16Y16X16 | result; + } + } + return ~0; + +/* XXX Enable float textures here. */ +#if 0 + case UTIL_FORMAT_TYPE_FLOAT: + switch (desc->channel[0].size) { + case 16: + switch (components) { + case 1: + return R300_TX_FORMAT_16F | result; + case 2: + return R300_TX_FORMAT_16F_16F | result; + case 4: + return R300_TX_FORMAT_16F_16F_16F_16F | result; + } + return ~0; + + case 32: + switch (components) { + case 1: + return R300_TX_FORMAT_32F | result; + case 2: + return R300_TX_FORMAT_32F_32F | result; + case 4: + return R300_TX_FORMAT_32F_32F_32F_32F | result; + } + } +#endif + } + + return ~0; /* Unsupported/unknown. */ +} + +boolean r300_is_sampler_format_supported(enum pipe_format format) +{ + return r300_translate_texformat(format) != ~0; +} + static void r300_setup_texture_state(struct r300_screen* screen, struct r300_texture* tex) { struct r300_texture_state* state = &tex->state; diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index e2c10325fa..01209efe3c 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -42,240 +42,7 @@ void r300_texture_reinterpret_format(struct pipe_screen *screen, struct pipe_texture *tex, enum pipe_format new_format); -/* Translate a pipe_format into a useful texture format for sampling. - * - * R300_EASY_TX_FORMAT swizzles the texture. - * Note the signature of R300_EASY_TX_FORMAT: - * R300_EASY_TX_FORMAT(B, G, R, A, FORMAT); - * - * The FORMAT specifies how the texture sampler will treat the texture, and - * makes available X, Y, Z, W, ZERO, and ONE for swizzling. */ -static INLINE uint32_t r300_translate_texformat(enum pipe_format format) -{ - uint32_t result = 0; - const struct util_format_description *desc; - unsigned components = 0, i; - boolean uniform = TRUE; - const uint32_t swizzle_shift[4] = { - R300_TX_FORMAT_R_SHIFT, - R300_TX_FORMAT_G_SHIFT, - R300_TX_FORMAT_B_SHIFT, - R300_TX_FORMAT_A_SHIFT - }; - const uint32_t sign_bit[4] = { - R300_TX_FORMAT_SIGNED_X, - R300_TX_FORMAT_SIGNED_Y, - R300_TX_FORMAT_SIGNED_Z, - R300_TX_FORMAT_SIGNED_W, - }; - - desc = util_format_description(format); - - /* Colorspace (return non-RGB formats directly). */ - switch (desc->colorspace) { - /* Depth stencil formats. */ - case UTIL_FORMAT_COLORSPACE_ZS: - switch (format) { - case PIPE_FORMAT_Z16_UNORM: - return R300_EASY_TX_FORMAT(X, X, X, X, X16); - case PIPE_FORMAT_Z24X8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - return R300_EASY_TX_FORMAT(X, X, X, X, W24_FP); - default: - return ~0; /* Unsupported. */ - } - - /* YUV formats. */ - case UTIL_FORMAT_COLORSPACE_YUV: - result |= R300_TX_FORMAT_YUV_TO_RGB; - - switch (format) { - case PIPE_FORMAT_YCBCR: - return R300_EASY_TX_FORMAT(X, Y, Z, ONE, YVYU422) | result; - case PIPE_FORMAT_YCBCR_REV: - return R300_EASY_TX_FORMAT(X, Y, Z, ONE, VYUY422) | result; - default: - return ~0; /* Unsupported/unknown. */ - } - - /* Add gamma correction. */ - case UTIL_FORMAT_COLORSPACE_SRGB: - result |= R300_TX_FORMAT_GAMMA; - break; - - default:; - } - - /* Add swizzle. */ - for (i = 0; i < 4; i++) { - switch (desc->swizzle[i]) { - case UTIL_FORMAT_SWIZZLE_X: - case UTIL_FORMAT_SWIZZLE_NONE: - result |= R300_TX_FORMAT_X << swizzle_shift[i]; - break; - case UTIL_FORMAT_SWIZZLE_Y: - result |= R300_TX_FORMAT_Y << swizzle_shift[i]; - break; - case UTIL_FORMAT_SWIZZLE_Z: - result |= R300_TX_FORMAT_Z << swizzle_shift[i]; - break; - case UTIL_FORMAT_SWIZZLE_W: - result |= R300_TX_FORMAT_W << swizzle_shift[i]; - break; - case UTIL_FORMAT_SWIZZLE_0: - result |= R300_TX_FORMAT_ZERO << swizzle_shift[i]; - break; - case UTIL_FORMAT_SWIZZLE_1: - result |= R300_TX_FORMAT_ONE << swizzle_shift[i]; - break; - default: - return ~0; /* Unsupported. */ - } - } - - /* Compressed formats. */ - if (desc->layout == UTIL_FORMAT_LAYOUT_DXT) { - switch (format) { - case PIPE_FORMAT_DXT1_RGB: - case PIPE_FORMAT_DXT1_RGBA: - case PIPE_FORMAT_DXT1_SRGB: - case PIPE_FORMAT_DXT1_SRGBA: - return R300_TX_FORMAT_DXT1 | result; - case PIPE_FORMAT_DXT3_RGBA: - case PIPE_FORMAT_DXT3_SRGBA: - return R300_TX_FORMAT_DXT3 | result; - case PIPE_FORMAT_DXT5_RGBA: - case PIPE_FORMAT_DXT5_SRGBA: - return R300_TX_FORMAT_DXT5 | result; - default: - return ~0; /* Unsupported/unknown. */ - } - } - - /* Get the number of components. */ - for (i = 0; i < 4; i++) { - if (desc->channel[i].type != UTIL_FORMAT_TYPE_VOID) { - ++components; - } - } - - /* Add sign. */ - for (i = 0; i < components; i++) { - if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) { - result |= sign_bit[i]; - } - } - - /* See whether the components are of the same size. */ - for (i = 1; i < components; i++) { - uniform = uniform && desc->channel[0].size == desc->channel[i].size; - } - - /* Non-uniform formats. */ - if (!uniform) { - switch (components) { - case 3: - if (desc->channel[0].size == 5 && - desc->channel[1].size == 6 && - desc->channel[2].size == 5) { - return R300_TX_FORMAT_Z5Y6X5 | result; - } - if (desc->channel[0].size == 5 && - desc->channel[1].size == 5 && - desc->channel[2].size == 6) { - return R300_TX_FORMAT_Z6Y5X5 | result; - } - return ~0; /* Unsupported/unknown. */ - - case 4: - if (desc->channel[0].size == 5 && - desc->channel[1].size == 5 && - desc->channel[2].size == 5 && - desc->channel[3].size == 1) { - return R300_TX_FORMAT_W1Z5Y5X5 | result; - } - if (desc->channel[0].size == 10 && - desc->channel[1].size == 10 && - desc->channel[2].size == 10 && - desc->channel[3].size == 2) { - return R300_TX_FORMAT_W2Z10Y10X10 | result; - } - } - return ~0; /* Unsupported/unknown. */ - } - - /* And finally, uniform formats. */ - switch (desc->channel[0].type) { - case UTIL_FORMAT_TYPE_UNSIGNED: - case UTIL_FORMAT_TYPE_SIGNED: - if (!desc->channel[0].normalized && - desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB) { - return ~0; - } - - switch (desc->channel[0].size) { - case 4: - switch (components) { - case 2: - return R300_TX_FORMAT_Y4X4 | result; - case 4: - return R300_TX_FORMAT_W4Z4Y4X4 | result; - } - return ~0; - - case 8: - switch (components) { - case 1: - return R300_TX_FORMAT_X8 | result; - case 2: - return R300_TX_FORMAT_Y8X8 | result; - case 4: - return R300_TX_FORMAT_W8Z8Y8X8 | result; - } - return ~0; - - case 16: - switch (components) { - case 1: - return R300_TX_FORMAT_X16 | result; - case 2: - return R300_TX_FORMAT_Y16X16 | result; - case 4: - return R300_TX_FORMAT_W16Z16Y16X16 | result; - } - } - return ~0; - -/* XXX Enable float textures here. */ -#if 0 - case UTIL_FORMAT_TYPE_FLOAT: - switch (desc->channel[0].size) { - case 16: - switch (components) { - case 1: - return R300_TX_FORMAT_16F | result; - case 2: - return R300_TX_FORMAT_16F_16F | result; - case 4: - return R300_TX_FORMAT_16F_16F_16F_16F | result; - } - return ~0; - - case 32: - switch (components) { - case 1: - return R300_TX_FORMAT_32F | result; - case 2: - return R300_TX_FORMAT_32F_32F | result; - case 4: - return R300_TX_FORMAT_32F_32F_32F_32F | result; - } - } -#endif - } - - return ~0; /* Unsupported/unknown. */ -} +boolean r300_is_sampler_format_supported(enum pipe_format format); struct r300_video_surface { -- cgit v1.2.3 From 7a087e1d6f6eb3ff4b78e34ba7b59b6fc5082bc1 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 21 Feb 2010 00:17:04 +0100 Subject: r300g: add all missing colorbuffer formats --- src/gallium/drivers/r300/r300_screen.c | 60 +++----- src/gallium/drivers/r300/r300_state_inlines.h | 188 ++++++++++++++++++++------ 2 files changed, 165 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 0b3b96def7..4bb4e5a785 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -27,6 +27,7 @@ #include "r300_context.h" #include "r300_screen.h" +#include "r300_state_inlines.h" #include "r300_texture.h" #include "radeon_winsys.h" @@ -212,6 +213,7 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, boolean is_r500 = r300_screen(screen)->caps->is_r500; boolean is_z24 = format == PIPE_FORMAT_Z24X8_UNORM || format == PIPE_FORMAT_Z24S8_UNORM; + boolean is_color2101010 = format == PIPE_FORMAT_A2B10G10R10_UNORM; if (target >= PIPE_MAX_TEXTURE_TYPES) { debug_printf("r300: Implementation error: Received bogus texture " @@ -221,50 +223,32 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, /* Check sampler format support. */ if ((usage & PIPE_TEXTURE_USAGE_SAMPLER) && - (is_r500 || !is_z24) && /* Z24 cannot be sampled from on non-r5xx. */ + /* Z24 cannot be sampled from on non-r5xx. */ + (is_r500 || !is_z24) && r300_is_sampler_format_supported(format)) { retval |= PIPE_TEXTURE_USAGE_SAMPLER; } - switch (format) { - /* Supported formats. */ - /* Colorbuffer */ - case PIPE_FORMAT_A8_UNORM: - case PIPE_FORMAT_L8_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_R8G8B8A8_UNORM: - case PIPE_FORMAT_R8G8B8X8_UNORM: - case PIPE_FORMAT_I8_UNORM: - retval |= usage & - (PIPE_TEXTURE_USAGE_RENDER_TARGET | - PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY); - break; - - /* ZS buffer */ - case PIPE_FORMAT_Z16_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - retval = usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL; - break; - - /* XXX Add all remaining gallium-supported formats, - * see util/u_format.csv. */ - - default:; + /* Check colorbuffer format support. */ + if ((usage & (PIPE_TEXTURE_USAGE_RENDER_TARGET | + PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_PRIMARY)) && + /* 2101010 cannot be rendered to on non-r5xx. */ + (is_r500 || !is_color2101010) && + r300_is_colorbuffer_format_supported(format)) { + retval |= usage & + (PIPE_TEXTURE_USAGE_RENDER_TARGET | + PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_PRIMARY); } - /* If usage was a mask that contained multiple bits, and not all of them - * are supported, this will catch that and return FALSE. - * e.g. usage = 2 | 4; retval = 4; (retval >= usage) == FALSE - * - * This also returns FALSE for any unknown formats. - */ - return (retval >= usage); + /* Check depth-stencil format support. */ + if (usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL && + r300_is_zs_format_supported(format)) { + retval |= PIPE_TEXTURE_USAGE_DEPTH_STENCIL; + } + + return retval == usage; } static struct pipe_transfer* diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index c990be40b9..63f5ff6045 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -334,43 +334,66 @@ static INLINE uint32_t r300_anisotropy(unsigned max_aniso) static INLINE uint32_t r300_translate_colorformat(enum pipe_format format) { switch (format) { - /* 8-bit buffers */ + /* 8-bit buffers. */ case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_I8_UNORM: case PIPE_FORMAT_L8_UNORM: + case PIPE_FORMAT_L8_SRGB: + case PIPE_FORMAT_R8_UNORM: + case PIPE_FORMAT_R8_SNORM: return R300_COLOR_FORMAT_I8; - /* 16-bit buffers */ + + /* 16-bit buffers. */ case PIPE_FORMAT_R5G6B5_UNORM: return R300_COLOR_FORMAT_RGB565; case PIPE_FORMAT_A1R5G5B5_UNORM: return R300_COLOR_FORMAT_ARGB1555; case PIPE_FORMAT_A4R4G4B4_UNORM: return R300_COLOR_FORMAT_ARGB4444; - /* 32-bit buffers */ + + /* 32-bit buffers. */ case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_SRGB: case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_X8R8G8B8_SRGB: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8A8_SRGB: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8X8_SRGB: case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_SNORM: + case PIPE_FORMAT_R8G8B8A8_SRGB: case PIPE_FORMAT_R8G8B8X8_UNORM: + case PIPE_FORMAT_R8G8B8X8_SRGB: + case PIPE_FORMAT_R8G8B8X8_SNORM: + case PIPE_FORMAT_A8B8G8R8_SNORM: + case PIPE_FORMAT_X8B8G8R8_SNORM: + case PIPE_FORMAT_X8UB8UG8SR8S_NORM: return R300_COLOR_FORMAT_ARGB8888; - /* XXX Not in pipe_format - case PIPE_FORMAT_A32R32G32B32: - return R300_COLOR_FORMAT_ARGB32323232; - case PIPE_FORMAT_A16R16G16B16: + case PIPE_FORMAT_A2B10G10R10_UNORM: + return R500_COLOR_FORMAT_ARGB2101010; /* R5xx-only? */ + + /* 64-bit buffers. */ + case PIPE_FORMAT_R16G16B16A16_UNORM: + case PIPE_FORMAT_R16G16B16A16_SNORM: + //case PIPE_FORMAT_R16G16B16A16_FLOAT: /* not in pipe_format */ return R300_COLOR_FORMAT_ARGB16161616; - case PIPE_FORMAT_A10R10G10B10_UNORM: - return R500_COLOR_FORMAT_ARGB10101010; - case PIPE_FORMAT_A2R10G10B10_UNORM: - return R500_COLOR_FORMAT_ARGB2101010; - case PIPE_FORMAT_I10_UNORM: - return R500_COLOR_FORMAT_I10; */ + +/* XXX Enable float textures here. */ +#if 0 + /* 128-bit buffers. */ + case PIPE_FORMAT_R32G32B32A32_FLOAT: + return R300_COLOR_FORMAT_ARGB32323232; +#endif + + /* YUV buffers. */ + case PIPE_FORMAT_YCBCR: + return R300_COLOR_FORMAT_YVYU; + case PIPE_FORMAT_YCBCR_REV: + return R300_COLOR_FORMAT_VYUY; default: - debug_printf("r300: Implementation error: " - "Got unsupported color format %s in %s\n", - util_format_name(format), __FUNCTION__); - assert(0); - break; + return ~0; /* Unsupported. */ } - return 0; } /* Depthbuffer and stencilbuffer. Thankfully, we only support two flavors. */ @@ -386,13 +409,8 @@ static INLINE uint32_t r300_translate_zsformat(enum pipe_format format) case PIPE_FORMAT_Z24S8_UNORM: return R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL; default: - debug_printf("r300: Implementation error: " - "Got unsupported ZS format %s in %s\n", - util_format_name(format), __FUNCTION__); - assert(0); - break; + return ~0; /* Unsupported. */ } - return 0; } /* Shader output formats. This is essentially the swizzle from the shader @@ -401,41 +419,121 @@ static INLINE uint32_t r300_translate_zsformat(enum pipe_format format) * Note that formats are stored from C3 to C0. */ static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format) { + uint32_t modifier = 0; + unsigned i; + const struct util_format_description *desc; + static const uint32_t sign_bit[4] = { + R300_OUT_SIGN(0x1), + R300_OUT_SIGN(0x2), + R300_OUT_SIGN(0x4), + R300_OUT_SIGN(0x8), + }; + + desc = util_format_description(format); + + /* Specifies how the shader output is written to the fog unit. */ + if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) { + /* The gamma correction causes precision loss so we need + * higher precision to maintain reasonable quality. + * It has nothing to do with the colorbuffer format. */ + modifier |= R300_US_OUT_FMT_C4_10_GAMMA; + } else if (desc->channel[0].type == UTIL_FORMAT_TYPE_FLOAT) { + if (desc->channel[0].size == 32) { + modifier |= R300_US_OUT_FMT_C4_32_FP; + } else { + modifier |= R300_US_OUT_FMT_C4_16_FP; + } + } else { + if (desc->channel[0].size == 16) { + modifier |= R300_US_OUT_FMT_C4_16; + } else { + /* C4_8 seems to be used for the formats whose pixel size + * is <= 32 bits. */ + modifier |= R300_US_OUT_FMT_C4_8; + } + } + + /* Add sign. */ + for (i = 0; i < 4; i++) + if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) { + modifier |= sign_bit[i]; + } + + /* Add swizzles and return. */ switch (format) { + /* 8-bit outputs. + * COLORFORMAT_I8 stores the C2 component. */ + case PIPE_FORMAT_A8_UNORM: + return modifier | R300_C2_SEL_A; + case PIPE_FORMAT_I8_UNORM: + case PIPE_FORMAT_L8_UNORM: + case PIPE_FORMAT_L8_SRGB: + case PIPE_FORMAT_R8_UNORM: + case PIPE_FORMAT_R8_SNORM: + return modifier | R300_C2_SEL_R; + + /* ARGB 32-bit outputs. */ case PIPE_FORMAT_R5G6B5_UNORM: - /* C_5_6_5 is missing in US_OUT_FMT, but C4_8 works just fine. */ case PIPE_FORMAT_A1R5G5B5_UNORM: - /* C_1_5_5_5 is missing in US_OUT_FMT, but C4_8 works just fine. */ case PIPE_FORMAT_A4R4G4B4_UNORM: - /* C4_4 is missing in US_OUT_FMT, but C4_8 works just fine. */ case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_SRGB: case PIPE_FORMAT_X8R8G8B8_UNORM: - return R300_US_OUT_FMT_C4_8 | + case PIPE_FORMAT_X8R8G8B8_SRGB: + return modifier | R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A; + + /* BGRA 32-bit outputs. */ + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8A8_SRGB: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8X8_SRGB: + return modifier | + R300_C0_SEL_A | R300_C1_SEL_R | + R300_C2_SEL_G | R300_C3_SEL_B; + + /* RGBA 32-bit outputs. */ case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_SNORM: + case PIPE_FORMAT_R8G8B8A8_SRGB: case PIPE_FORMAT_R8G8B8X8_UNORM: - return R300_US_OUT_FMT_C4_8 | + case PIPE_FORMAT_R8G8B8X8_SRGB: + case PIPE_FORMAT_R8G8B8X8_SNORM: + return modifier | R300_C0_SEL_A | R300_C1_SEL_B | R300_C2_SEL_G | R300_C3_SEL_R; - /* 8-bit outputs */ - case PIPE_FORMAT_A8_UNORM: - return R300_US_OUT_FMT_C4_8 | - R300_C2_SEL_A; - case PIPE_FORMAT_I8_UNORM: - case PIPE_FORMAT_L8_UNORM: - return R300_US_OUT_FMT_C4_8 | - R300_C2_SEL_R; - /* R300_OUT_SIGN(x) */ + /* ABGR 32-bit outputs. */ + case PIPE_FORMAT_A8B8G8R8_SNORM: + case PIPE_FORMAT_X8B8G8R8_SNORM: + case PIPE_FORMAT_X8UB8UG8SR8S_NORM: + case PIPE_FORMAT_A2B10G10R10_UNORM: + /* RGBA high precision outputs (same swizzles as ABGR low precision) */ + case PIPE_FORMAT_R16G16B16A16_UNORM: + case PIPE_FORMAT_R16G16B16A16_SNORM: + //case PIPE_FORMAT_R16G16B16A16_FLOAT: /* not in pipe_format */ + case PIPE_FORMAT_R32G32B32A32_FLOAT: + return modifier | + R300_C0_SEL_R | R300_C1_SEL_G | + R300_C2_SEL_B | R300_C3_SEL_A; + default: - debug_printf("r300: Implementation error: " - "Got unsupported output format %s in %s\n", - util_format_name(format), __FUNCTION__); - assert(0); - return R300_US_OUT_FMT_UNUSED; + return ~0; /* Unsupported. */ } - return 0; +} + +static INLINE +boolean r300_is_zs_format_supported(enum pipe_format format) +{ + return r300_translate_zsformat(format) != ~0; +} + +static INLINE +boolean r300_is_colorbuffer_format_supported(enum pipe_format format) +{ + return r300_translate_colorformat(format) != ~0 && + r300_translate_out_fmt(format) != ~0; } /* Non-CSO state. (For now.) */ -- cgit v1.2.3 From 3c244dac47195cce3fdcb05176e38d33b2cad8ed Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 20 Feb 2010 21:12:45 +0100 Subject: r300g: precompute framebuffer register values --- src/gallium/drivers/r300/r300_context.h | 11 ++ src/gallium/drivers/r300/r300_emit.c | 14 +- src/gallium/drivers/r300/r300_screen.c | 1 - src/gallium/drivers/r300/r300_state_inlines.h | 209 ----------------------- src/gallium/drivers/r300/r300_texture.c | 231 ++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_texture.h | 4 + 6 files changed, 250 insertions(+), 220 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 1eba8a8ed1..443af4ec2e 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -125,6 +125,16 @@ struct r300_texture_state { uint32_t format2; /* R300_TX_FORMAT2: 0x4500 */ }; +struct r300_texture_fb_state { + /* Colorbuffer. */ + uint32_t colorpitch[PIPE_MAX_TEXTURE_LEVELS]; /* R300_RB3D_COLORPITCH[0-3]*/ + uint32_t us_out_fmt; /* R300_US_OUT_FMT[0-3] */ + + /* Zbuffer. */ + uint32_t depthpitch[PIPE_MAX_TEXTURE_LEVELS]; /* R300_RB3D_DEPTHPITCH */ + uint32_t zb_format; /* R300_ZB_FORMAT */ +}; + struct r300_viewport_state { float xscale; /* R300_VAP_VPORT_XSCALE: 0x2098 */ float xoffset; /* R300_VAP_VPORT_XOFFSET: 0x209c */ @@ -232,6 +242,7 @@ struct r300_texture { /* Registers carrying texture format data. */ struct r300_texture_state state; + struct r300_texture_fb_state fb_state; /* Buffer tiling */ enum r300_buffer_tiling microtile, macrotile; diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 88fe166359..5a2865887f 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -422,14 +422,10 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) OUT_CS_RELOC(tex->buffer, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_CS_REG_SEQ(R300_RB3D_COLORPITCH0 + (4 * i), 1); - OUT_CS_RELOC(tex->buffer, tex->pitch[surf->level] | - r300_translate_colorformat(tex->tex.format) | - R300_COLOR_TILE(tex->mip_macrotile[surf->level]) | - R300_COLOR_MICROTILE(tex->microtile), + OUT_CS_RELOC(tex->buffer, tex->fb_state.colorpitch[surf->level], 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), - r300_translate_out_fmt(surf->format)); + OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), tex->fb_state.us_out_fmt); } /* Set up a zbuffer. */ @@ -441,12 +437,10 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1); OUT_CS_RELOC(tex->buffer, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_CS_REG(R300_ZB_FORMAT, r300_translate_zsformat(tex->tex.format)); + OUT_CS_REG(R300_ZB_FORMAT, tex->fb_state.zb_format); OUT_CS_REG_SEQ(R300_ZB_DEPTHPITCH, 1); - OUT_CS_RELOC(tex->buffer, tex->pitch[surf->level] | - R300_DEPTHMACROTILE(tex->mip_macrotile[surf->level]) | - R300_DEPTHMICROTILE(tex->microtile), + OUT_CS_RELOC(tex->buffer, tex->fb_state.depthpitch[surf->level], 0, RADEON_GEM_DOMAIN_VRAM, 0); } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 4bb4e5a785..6a55570571 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -27,7 +27,6 @@ #include "r300_context.h" #include "r300_screen.h" -#include "r300_state_inlines.h" #include "r300_texture.h" #include "radeon_winsys.h" diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 63f5ff6045..0e1cb328d1 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -327,215 +327,6 @@ static INLINE uint32_t r300_anisotropy(unsigned max_aniso) } } -/* Buffer formats. */ - -/* Colorbuffer formats. This is the unswizzled format of the RB3D block's - * output. For the swizzling of the targets, check the shader's format. */ -static INLINE uint32_t r300_translate_colorformat(enum pipe_format format) -{ - switch (format) { - /* 8-bit buffers. */ - case PIPE_FORMAT_A8_UNORM: - case PIPE_FORMAT_I8_UNORM: - case PIPE_FORMAT_L8_UNORM: - case PIPE_FORMAT_L8_SRGB: - case PIPE_FORMAT_R8_UNORM: - case PIPE_FORMAT_R8_SNORM: - return R300_COLOR_FORMAT_I8; - - /* 16-bit buffers. */ - case PIPE_FORMAT_R5G6B5_UNORM: - return R300_COLOR_FORMAT_RGB565; - case PIPE_FORMAT_A1R5G5B5_UNORM: - return R300_COLOR_FORMAT_ARGB1555; - case PIPE_FORMAT_A4R4G4B4_UNORM: - return R300_COLOR_FORMAT_ARGB4444; - - /* 32-bit buffers. */ - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_SRGB: - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_SRGB: - case PIPE_FORMAT_B8G8R8A8_UNORM: - case PIPE_FORMAT_B8G8R8A8_SRGB: - case PIPE_FORMAT_B8G8R8X8_UNORM: - case PIPE_FORMAT_B8G8R8X8_SRGB: - case PIPE_FORMAT_R8G8B8A8_UNORM: - case PIPE_FORMAT_R8G8B8A8_SNORM: - case PIPE_FORMAT_R8G8B8A8_SRGB: - case PIPE_FORMAT_R8G8B8X8_UNORM: - case PIPE_FORMAT_R8G8B8X8_SRGB: - case PIPE_FORMAT_R8G8B8X8_SNORM: - case PIPE_FORMAT_A8B8G8R8_SNORM: - case PIPE_FORMAT_X8B8G8R8_SNORM: - case PIPE_FORMAT_X8UB8UG8SR8S_NORM: - return R300_COLOR_FORMAT_ARGB8888; - case PIPE_FORMAT_A2B10G10R10_UNORM: - return R500_COLOR_FORMAT_ARGB2101010; /* R5xx-only? */ - - /* 64-bit buffers. */ - case PIPE_FORMAT_R16G16B16A16_UNORM: - case PIPE_FORMAT_R16G16B16A16_SNORM: - //case PIPE_FORMAT_R16G16B16A16_FLOAT: /* not in pipe_format */ - return R300_COLOR_FORMAT_ARGB16161616; - -/* XXX Enable float textures here. */ -#if 0 - /* 128-bit buffers. */ - case PIPE_FORMAT_R32G32B32A32_FLOAT: - return R300_COLOR_FORMAT_ARGB32323232; -#endif - - /* YUV buffers. */ - case PIPE_FORMAT_YCBCR: - return R300_COLOR_FORMAT_YVYU; - case PIPE_FORMAT_YCBCR_REV: - return R300_COLOR_FORMAT_VYUY; - default: - return ~0; /* Unsupported. */ - } -} - -/* Depthbuffer and stencilbuffer. Thankfully, we only support two flavors. */ -static INLINE uint32_t r300_translate_zsformat(enum pipe_format format) -{ - switch (format) { - /* 16-bit depth, no stencil */ - case PIPE_FORMAT_Z16_UNORM: - return R300_DEPTHFORMAT_16BIT_INT_Z; - /* 24-bit depth, ignored stencil */ - case PIPE_FORMAT_Z24X8_UNORM: - /* 24-bit depth, 8-bit stencil */ - case PIPE_FORMAT_Z24S8_UNORM: - return R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL; - default: - return ~0; /* Unsupported. */ - } -} - -/* Shader output formats. This is essentially the swizzle from the shader - * to the RB3D block. - * - * Note that formats are stored from C3 to C0. */ -static INLINE uint32_t r300_translate_out_fmt(enum pipe_format format) -{ - uint32_t modifier = 0; - unsigned i; - const struct util_format_description *desc; - static const uint32_t sign_bit[4] = { - R300_OUT_SIGN(0x1), - R300_OUT_SIGN(0x2), - R300_OUT_SIGN(0x4), - R300_OUT_SIGN(0x8), - }; - - desc = util_format_description(format); - - /* Specifies how the shader output is written to the fog unit. */ - if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) { - /* The gamma correction causes precision loss so we need - * higher precision to maintain reasonable quality. - * It has nothing to do with the colorbuffer format. */ - modifier |= R300_US_OUT_FMT_C4_10_GAMMA; - } else if (desc->channel[0].type == UTIL_FORMAT_TYPE_FLOAT) { - if (desc->channel[0].size == 32) { - modifier |= R300_US_OUT_FMT_C4_32_FP; - } else { - modifier |= R300_US_OUT_FMT_C4_16_FP; - } - } else { - if (desc->channel[0].size == 16) { - modifier |= R300_US_OUT_FMT_C4_16; - } else { - /* C4_8 seems to be used for the formats whose pixel size - * is <= 32 bits. */ - modifier |= R300_US_OUT_FMT_C4_8; - } - } - - /* Add sign. */ - for (i = 0; i < 4; i++) - if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) { - modifier |= sign_bit[i]; - } - - /* Add swizzles and return. */ - switch (format) { - /* 8-bit outputs. - * COLORFORMAT_I8 stores the C2 component. */ - case PIPE_FORMAT_A8_UNORM: - return modifier | R300_C2_SEL_A; - case PIPE_FORMAT_I8_UNORM: - case PIPE_FORMAT_L8_UNORM: - case PIPE_FORMAT_L8_SRGB: - case PIPE_FORMAT_R8_UNORM: - case PIPE_FORMAT_R8_SNORM: - return modifier | R300_C2_SEL_R; - - /* ARGB 32-bit outputs. */ - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_SRGB: - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_SRGB: - return modifier | - R300_C0_SEL_B | R300_C1_SEL_G | - R300_C2_SEL_R | R300_C3_SEL_A; - - /* BGRA 32-bit outputs. */ - case PIPE_FORMAT_B8G8R8A8_UNORM: - case PIPE_FORMAT_B8G8R8A8_SRGB: - case PIPE_FORMAT_B8G8R8X8_UNORM: - case PIPE_FORMAT_B8G8R8X8_SRGB: - return modifier | - R300_C0_SEL_A | R300_C1_SEL_R | - R300_C2_SEL_G | R300_C3_SEL_B; - - /* RGBA 32-bit outputs. */ - case PIPE_FORMAT_R8G8B8A8_UNORM: - case PIPE_FORMAT_R8G8B8A8_SNORM: - case PIPE_FORMAT_R8G8B8A8_SRGB: - case PIPE_FORMAT_R8G8B8X8_UNORM: - case PIPE_FORMAT_R8G8B8X8_SRGB: - case PIPE_FORMAT_R8G8B8X8_SNORM: - return modifier | - R300_C0_SEL_A | R300_C1_SEL_B | - R300_C2_SEL_G | R300_C3_SEL_R; - - /* ABGR 32-bit outputs. */ - case PIPE_FORMAT_A8B8G8R8_SNORM: - case PIPE_FORMAT_X8B8G8R8_SNORM: - case PIPE_FORMAT_X8UB8UG8SR8S_NORM: - case PIPE_FORMAT_A2B10G10R10_UNORM: - /* RGBA high precision outputs (same swizzles as ABGR low precision) */ - case PIPE_FORMAT_R16G16B16A16_UNORM: - case PIPE_FORMAT_R16G16B16A16_SNORM: - //case PIPE_FORMAT_R16G16B16A16_FLOAT: /* not in pipe_format */ - case PIPE_FORMAT_R32G32B32A32_FLOAT: - return modifier | - R300_C0_SEL_R | R300_C1_SEL_G | - R300_C2_SEL_B | R300_C3_SEL_A; - - default: - return ~0; /* Unsupported. */ - } -} - -static INLINE -boolean r300_is_zs_format_supported(enum pipe_format format) -{ - return r300_translate_zsformat(format) != ~0; -} - -static INLINE -boolean r300_is_colorbuffer_format_supported(enum pipe_format format) -{ - return r300_translate_colorformat(format) != ~0 && - r300_translate_out_fmt(format) != ~0; -} - /* Non-CSO state. (For now.) */ static INLINE uint32_t r300_translate_gb_pipes(int pipe_count) diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 5b7afc6eb9..ed2be06254 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -1,5 +1,6 @@ /* * Copyright 2008 Corbin Simpson + * Copyright 2010 Marek Olšák * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -29,6 +30,7 @@ #include "r300_context.h" #include "r300_texture.h" #include "r300_screen.h" +#include "r300_state_inlines.h" #include "radeon_winsys.h" @@ -283,6 +285,213 @@ static uint32_t r300_translate_texformat(enum pipe_format format) return ~0; /* Unsupported/unknown. */ } +/* Buffer formats. */ + +/* Colorbuffer formats. This is the unswizzled format of the RB3D block's + * output. For the swizzling of the targets, check the shader's format. */ +static uint32_t r300_translate_colorformat(enum pipe_format format) +{ + switch (format) { + /* 8-bit buffers. */ + case PIPE_FORMAT_A8_UNORM: + case PIPE_FORMAT_I8_UNORM: + case PIPE_FORMAT_L8_UNORM: + case PIPE_FORMAT_L8_SRGB: + case PIPE_FORMAT_R8_UNORM: + case PIPE_FORMAT_R8_SNORM: + return R300_COLOR_FORMAT_I8; + + /* 16-bit buffers. */ + case PIPE_FORMAT_R5G6B5_UNORM: + return R300_COLOR_FORMAT_RGB565; + case PIPE_FORMAT_A1R5G5B5_UNORM: + return R300_COLOR_FORMAT_ARGB1555; + case PIPE_FORMAT_A4R4G4B4_UNORM: + return R300_COLOR_FORMAT_ARGB4444; + + /* 32-bit buffers. */ + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_X8R8G8B8_SRGB: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8A8_SRGB: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8X8_SRGB: + case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_SNORM: + case PIPE_FORMAT_R8G8B8A8_SRGB: + case PIPE_FORMAT_R8G8B8X8_UNORM: + case PIPE_FORMAT_R8G8B8X8_SRGB: + case PIPE_FORMAT_R8G8B8X8_SNORM: + case PIPE_FORMAT_A8B8G8R8_SNORM: + case PIPE_FORMAT_X8B8G8R8_SNORM: + case PIPE_FORMAT_X8UB8UG8SR8S_NORM: + return R300_COLOR_FORMAT_ARGB8888; + case PIPE_FORMAT_A2B10G10R10_UNORM: + return R500_COLOR_FORMAT_ARGB2101010; /* R5xx-only? */ + + /* 64-bit buffers. */ + case PIPE_FORMAT_R16G16B16A16_UNORM: + case PIPE_FORMAT_R16G16B16A16_SNORM: + //case PIPE_FORMAT_R16G16B16A16_FLOAT: /* not in pipe_format */ + return R300_COLOR_FORMAT_ARGB16161616; + +/* XXX Enable float textures here. */ +#if 0 + /* 128-bit buffers. */ + case PIPE_FORMAT_R32G32B32A32_FLOAT: + return R300_COLOR_FORMAT_ARGB32323232; +#endif + + /* YUV buffers. */ + case PIPE_FORMAT_YCBCR: + return R300_COLOR_FORMAT_YVYU; + case PIPE_FORMAT_YCBCR_REV: + return R300_COLOR_FORMAT_VYUY; + default: + return ~0; /* Unsupported. */ + } +} + +/* Depthbuffer and stencilbuffer. Thankfully, we only support two flavors. */ +static uint32_t r300_translate_zsformat(enum pipe_format format) +{ + switch (format) { + /* 16-bit depth, no stencil */ + case PIPE_FORMAT_Z16_UNORM: + return R300_DEPTHFORMAT_16BIT_INT_Z; + /* 24-bit depth, ignored stencil */ + case PIPE_FORMAT_Z24X8_UNORM: + /* 24-bit depth, 8-bit stencil */ + case PIPE_FORMAT_Z24S8_UNORM: + return R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL; + default: + return ~0; /* Unsupported. */ + } +} + +/* Shader output formats. This is essentially the swizzle from the shader + * to the RB3D block. + * + * Note that formats are stored from C3 to C0. */ +static uint32_t r300_translate_out_fmt(enum pipe_format format) +{ + uint32_t modifier = 0; + unsigned i; + const struct util_format_description *desc; + static const uint32_t sign_bit[4] = { + R300_OUT_SIGN(0x1), + R300_OUT_SIGN(0x2), + R300_OUT_SIGN(0x4), + R300_OUT_SIGN(0x8), + }; + + desc = util_format_description(format); + + /* Specifies how the shader output is written to the fog unit. */ + if (desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) { + /* The gamma correction causes precision loss so we need + * higher precision to maintain reasonable quality. + * It has nothing to do with the colorbuffer format. */ + modifier |= R300_US_OUT_FMT_C4_10_GAMMA; + } else if (desc->channel[0].type == UTIL_FORMAT_TYPE_FLOAT) { + if (desc->channel[0].size == 32) { + modifier |= R300_US_OUT_FMT_C4_32_FP; + } else { + modifier |= R300_US_OUT_FMT_C4_16_FP; + } + } else { + if (desc->channel[0].size == 16) { + modifier |= R300_US_OUT_FMT_C4_16; + } else { + /* C4_8 seems to be used for the formats whose pixel size + * is <= 32 bits. */ + modifier |= R300_US_OUT_FMT_C4_8; + } + } + + /* Add sign. */ + for (i = 0; i < 4; i++) + if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) { + modifier |= sign_bit[i]; + } + + /* Add swizzles and return. */ + switch (format) { + /* 8-bit outputs. + * COLORFORMAT_I8 stores the C2 component. */ + case PIPE_FORMAT_A8_UNORM: + return modifier | R300_C2_SEL_A; + case PIPE_FORMAT_I8_UNORM: + case PIPE_FORMAT_L8_UNORM: + case PIPE_FORMAT_L8_SRGB: + case PIPE_FORMAT_R8_UNORM: + case PIPE_FORMAT_R8_SNORM: + return modifier | R300_C2_SEL_R; + + /* ARGB 32-bit outputs. */ + case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_X8R8G8B8_SRGB: + return modifier | + R300_C0_SEL_B | R300_C1_SEL_G | + R300_C2_SEL_R | R300_C3_SEL_A; + + /* BGRA 32-bit outputs. */ + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8A8_SRGB: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8X8_SRGB: + return modifier | + R300_C0_SEL_A | R300_C1_SEL_R | + R300_C2_SEL_G | R300_C3_SEL_B; + + /* RGBA 32-bit outputs. */ + case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_SNORM: + case PIPE_FORMAT_R8G8B8A8_SRGB: + case PIPE_FORMAT_R8G8B8X8_UNORM: + case PIPE_FORMAT_R8G8B8X8_SRGB: + case PIPE_FORMAT_R8G8B8X8_SNORM: + return modifier | + R300_C0_SEL_A | R300_C1_SEL_B | + R300_C2_SEL_G | R300_C3_SEL_R; + + /* ABGR 32-bit outputs. */ + case PIPE_FORMAT_A8B8G8R8_SNORM: + case PIPE_FORMAT_X8B8G8R8_SNORM: + case PIPE_FORMAT_X8UB8UG8SR8S_NORM: + case PIPE_FORMAT_A2B10G10R10_UNORM: + /* RGBA high precision outputs (same swizzles as ABGR low precision) */ + case PIPE_FORMAT_R16G16B16A16_UNORM: + case PIPE_FORMAT_R16G16B16A16_SNORM: + //case PIPE_FORMAT_R16G16B16A16_FLOAT: /* not in pipe_format */ + case PIPE_FORMAT_R32G32B32A32_FLOAT: + return modifier | + R300_C0_SEL_R | R300_C1_SEL_G | + R300_C2_SEL_B | R300_C3_SEL_A; + + default: + return ~0; /* Unsupported. */ + } +} + +boolean r300_is_colorbuffer_format_supported(enum pipe_format format) +{ + return r300_translate_colorformat(format) != ~0 && + r300_translate_out_fmt(format) != ~0; +} + +boolean r300_is_zs_format_supported(enum pipe_format format) +{ + return r300_translate_zsformat(format) != ~0; +} + boolean r300_is_sampler_format_supported(enum pipe_format format) { return r300_translate_texformat(format) != ~0; @@ -292,8 +501,10 @@ static void r300_setup_texture_state(struct r300_screen* screen, struct r300_tex { struct r300_texture_state* state = &tex->state; struct pipe_texture *pt = &tex->tex; + unsigned i; boolean is_r500 = screen->caps->is_r500; + /* Set sampler state. */ state->format0 = R300_TX_WIDTH((pt->width0 - 1) & 0x7ff) | R300_TX_HEIGHT((pt->height0 - 1) & 0x7ff); @@ -327,6 +538,26 @@ static void r300_setup_texture_state(struct r300_screen* screen, struct r300_tex SCREEN_DBG(screen, DBG_TEX, "r300: Set texture state (%dx%d, %d levels)\n", pt->width0, pt->height0, pt->last_level); + + /* Set framebuffer state. */ + if (util_format_is_depth_or_stencil(tex->tex.format)) { + for (i = 0; i <= tex->tex.last_level; i++) { + tex->fb_state.depthpitch[i] = + tex->pitch[i] | + R300_DEPTHMACROTILE(tex->mip_macrotile[i]) | + R300_DEPTHMICROTILE(tex->microtile); + } + tex->fb_state.zb_format = r300_translate_zsformat(tex->tex.format); + } else { + for (i = 0; i <= tex->tex.last_level; i++) { + tex->fb_state.colorpitch[i] = + tex->pitch[i] | + r300_translate_colorformat(tex->tex.format) | + R300_COLOR_TILE(tex->mip_macrotile[i]) | + R300_COLOR_MICROTILE(tex->microtile); + } + tex->fb_state.us_out_fmt = r300_translate_out_fmt(tex->tex.format); + } } void r300_texture_reinterpret_format(struct pipe_screen *screen, diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 01209efe3c..46a5fb6188 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -42,6 +42,10 @@ void r300_texture_reinterpret_format(struct pipe_screen *screen, struct pipe_texture *tex, enum pipe_format new_format); +boolean r300_is_colorbuffer_format_supported(enum pipe_format format); + +boolean r300_is_zs_format_supported(enum pipe_format format); + boolean r300_is_sampler_format_supported(enum pipe_format format); struct r300_video_surface -- cgit v1.2.3 From 8ff6790afb9c1b5a53a22fed9d5159581ba42a8f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 14:26:53 -0800 Subject: r300g: Remove unnecessary header. --- src/gallium/drivers/r300/r300_emit.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 5a2865887f..f7dcd8dc52 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -32,7 +32,6 @@ #include "r300_emit.h" #include "r300_fs.h" #include "r300_screen.h" -#include "r300_state_inlines.h" #include "r300_vs.h" void r300_emit_blend_state(struct r300_context* r300, void* state) -- cgit v1.2.3 From b7eed19efec0cdaca42cabbc6f9fadcb892aee81 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 15:10:50 -0800 Subject: st/mesa: Fix memory leak on out-of-memory error path. --- src/mesa/state_tracker/st_program.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 7ce3938904..7f8677d400 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -205,8 +205,10 @@ st_translate_vertex_program(struct st_context *st, unsigned num_outputs; ureg = ureg_create( TGSI_PROCESSOR_VERTEX ); - if (ureg == NULL) + if (ureg == NULL) { + FREE(vpv); return NULL; + } vpv->num_inputs = stvp->num_inputs; num_outputs = stvp->num_outputs; -- cgit v1.2.3 From c786df2caf54584f1a307d820cbd947db706e20c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 15:15:52 -0800 Subject: i965g: Fix memory leak. --- src/gallium/drivers/i965/brw_state_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_state_cache.c b/src/gallium/drivers/i965/brw_state_cache.c index 85c20076fb..c911f3997d 100644 --- a/src/gallium/drivers/i965/brw_state_cache.c +++ b/src/gallium/drivers/i965/brw_state_cache.c @@ -213,7 +213,7 @@ brw_upload_cache( struct brw_cache *cache, void *aux_return, struct brw_winsys_buffer **bo_out) { - struct brw_cache_item *item = CALLOC_STRUCT(brw_cache_item); + struct brw_cache_item *item; GLuint hash = hash_key(key, key_size, relocs, nr_relocs); GLuint relocs_size = nr_relocs * sizeof relocs[0]; GLuint aux_size = cache->aux_size[cache_id]; @@ -233,6 +233,7 @@ brw_upload_cache( struct brw_cache *cache, if (ret) return ret; + item = CALLOC_STRUCT(brw_cache_item); /* Set up the memory containing the key, aux_data, and relocs */ tmp = MALLOC(key_size + aux_size + relocs_size); -- cgit v1.2.3 From 233290f2031057b37fdadb650873b02be307ebc8 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 21 Feb 2010 20:49:29 +0100 Subject: r3OOg: support rendering of more than 65535 vertices per draw call (almost) The path for VAP_ALT_NUM_VERTICES is also in place (and tested) but not enabled by default due to the missing support of this reg in the upstream kernel. Also, a non-zero BUFFER_BASE in the INDX_BUFFER packet3 hangs the machine. Am I missing something? Because of this, only draw_arrays can render more than 65535 vertices without the use of VAP_ALT_NUM_VERTICES. --- src/gallium/drivers/r300/r300_reg.h | 3 + src/gallium/drivers/r300/r300_render.c | 109 ++++++++++++++++++++++++--------- 2 files changed, 83 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index a049da69e2..a249e8b36b 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -113,11 +113,14 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* index size - when not set the indices are assumed to be 16 bit */ # define R300_VAP_VF_CNTL__INDEX_SIZE_32bit (1<<11) +# define R500_VAP_VF_CNTL__USE_ALT_NUM_VERTS (1<<14) /* number of vertices */ # define R300_VAP_VF_CNTL__NUM_VERTICES__SHIFT 16 #define R500_VAP_INDEX_OFFSET 0x208c +#define R500_VAP_ALT_NUM_VERTICES 0x2088 + #define R300_VAP_OUTPUT_VTX_FMT_0 0x2090 # define R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT (1<<0) # define R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT (1<<1) diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index cd4971ae13..754eb4dc76 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -42,6 +42,9 @@ /* r300_render: Vertex and index buffer primitive emission. */ #define R300_MAX_VBO_SIZE (1024 * 1024) +/* XXX The DRM rejects VAP_ALT_NUM_VERTICES.. */ +//#define ENABLE_ALT_NUM_VERTS + uint32_t r300_translate_primitive(unsigned prim) { switch (prim) { @@ -210,16 +213,28 @@ static void r300_emit_draw_arrays(struct r300_context *r300, unsigned mode, unsigned count) { +#if defined(ENABLE_ALT_NUM_VERTS) + boolean alt_num_verts = count > 65535; +#else + boolean alt_num_verts = FALSE; +#endif CS_LOCALS(r300); - BEGIN_CS(8); + if (alt_num_verts) { + assert(count < (1 << 24)); + BEGIN_CS(10); + OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count); + } else { + BEGIN_CS(8); + } OUT_CS_REG(R300_GA_COLOR_CONTROL, r300_provoking_vertex_fixes(r300, mode)); OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0); OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, count - 1); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_VBUF_2, 0); OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (count << 16) | - r300_translate_primitive(mode)); + r300_translate_primitive(mode) | + (alt_num_verts ? R500_VAP_VF_CNTL__USE_ALT_NUM_VERTS : 0)); END_CS; } @@ -234,14 +249,27 @@ static void r300_emit_draw_elements(struct r300_context *r300, { uint32_t count_dwords; uint32_t offset_dwords = indexSize * start / sizeof(uint32_t); +#if defined(ENABLE_ALT_NUM_VERTS) + boolean alt_num_verts = count > 65535; +#else + boolean alt_num_verts = FALSE; +#endif CS_LOCALS(r300); - /* XXX most of these are stupid */ - assert(indexSize == 4 || indexSize == 2); assert((start * indexSize) % 4 == 0); - assert(offset_dwords == 0); - BEGIN_CS(14); + /* XXX Non-zero offset locks up. */ + if (offset_dwords != 0) { + return; + } + + if (alt_num_verts) { + assert(count < (1 << 24)); + BEGIN_CS(16); + OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count); + } else { + BEGIN_CS(14); + } OUT_CS_REG(R300_GA_COLOR_CONTROL, r300_provoking_vertex_fixes(r300, mode)); OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, minIndex); @@ -251,24 +279,24 @@ static void r300_emit_draw_elements(struct r300_context *r300, count_dwords = count + start; OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) | R300_VAP_VF_CNTL__INDEX_SIZE_32bit | - r300_translate_primitive(mode)); + r300_translate_primitive(mode) | + (alt_num_verts ? R500_VAP_VF_CNTL__USE_ALT_NUM_VERTS : 0)); } else { count_dwords = (count + start + 1) / 2; OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) | - r300_translate_primitive(mode)); + r300_translate_primitive(mode) | + (alt_num_verts ? R500_VAP_VF_CNTL__USE_ALT_NUM_VERTS : 0)); } /* INDX_BUFFER is a truly special packet3. * Unlike most other packet3, where the offset is after the count, * the order is reversed, so the relocation ends up carrying the * size of the indexbuf instead of the offset. - * - * XXX Fix offset */ OUT_CS_PKT3(R300_PACKET3_INDX_BUFFER, 2); OUT_CS(R300_INDX_BUFFER_ONE_REG_WR | (R300_VAP_PORT_IDX0 >> 2) | (0 << R300_INDX_BUFFER_SKIP_SHIFT)); - OUT_CS(offset_dwords); + OUT_CS(offset_dwords << 2); OUT_CS_RELOC(indexBuffer, count_dwords, RADEON_GEM_DOMAIN_GTT, 0, 0); @@ -343,18 +371,18 @@ void r300_draw_range_elements(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); struct pipe_buffer* orgIndexBuffer = indexBuffer; +#if defined(ENABLE_ALT_NUM_VERTS) + boolean alt_num_verts = r300_screen(pipe->screen)->caps->is_r500 && + count > 65536; +#else + boolean alt_num_verts = FALSE; +#endif + unsigned short_count; if (!u_trim_pipe_prim(mode, &count)) { return; } - if (count > 65535) { - /* XXX: use aux/indices functions to split this into smaller - * primitives. - */ - return; - } - r300_update_derived_state(r300); r300_emit_buffer_validate(r300); @@ -381,8 +409,19 @@ void r300_draw_range_elements(struct pipe_context* pipe, r300_emit_aos(r300, 0); - r300_emit_draw_elements(r300, indexBuffer, indexSize, minIndex, maxIndex, - mode, start, count); + if (alt_num_verts || count <= 65535) { + r300_emit_draw_elements(r300, indexBuffer, indexSize, minIndex, + maxIndex, mode, start, count); + } else { + do { + short_count = MIN2(count, 65534); + r300_emit_draw_elements(r300, indexBuffer, indexSize, minIndex, + maxIndex, mode, start, short_count); + + start += short_count; + count -= short_count; + } while (count); + } cleanup: if (indexBuffer != orgIndexBuffer) { @@ -404,18 +443,18 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, unsigned start, unsigned count) { struct r300_context* r300 = r300_context(pipe); +#if defined(ENABLE_ALT_NUM_VERTS) + boolean alt_num_verts = r300_screen(pipe->screen)->caps->is_r500 && + count > 65536; +#else + boolean alt_num_verts = FALSE; +#endif + unsigned short_count; if (!u_trim_pipe_prim(mode, &count)) { return; } - if (count > 65535) { - /* XXX: driver needs to handle this -- use the functions in - * aux/indices to split this into several smaller primitives. - */ - return; - } - r300_update_derived_state(r300); r300_emit_buffer_validate(r300); @@ -428,8 +467,20 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, } r300_emit_dirty_state(r300); - r300_emit_aos(r300, start); - r300_emit_draw_arrays(r300, mode, count); + + if (alt_num_verts || count <= 65535) { + r300_emit_aos(r300, start); + r300_emit_draw_arrays(r300, mode, count); + } else { + do { + short_count = MIN2(count, 65535); + r300_emit_aos(r300, start); + r300_emit_draw_arrays(r300, mode, short_count); + + start += short_count; + count -= short_count; + } while (count); + } } } -- cgit v1.2.3 From fff5be8e7b4557c221f2425dcafc2e7cbbba76ba Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 12 Feb 2010 15:39:51 +1000 Subject: r300g: rebuild winsys/pipe buffer handling and add buffer map This creates a cleaner winsys and drop the simple screen stuff. It makes r300g use pb_bufmgr structs and adds usage of the cached bufmgr for vertex/index buffers. It also avoids mapping too often. I'm not 100% sure this is perfect but it won't find its own bugs. Signed-off-by: Dave Airlie --- src/gallium/drivers/r300/Makefile | 1 + src/gallium/drivers/r300/r300_context.c | 38 ++- src/gallium/drivers/r300/r300_context.h | 9 +- src/gallium/drivers/r300/r300_cs.h | 22 +- src/gallium/drivers/r300/r300_emit.c | 54 +-- src/gallium/drivers/r300/r300_render.c | 33 +- src/gallium/drivers/r300/r300_screen.c | 38 ++- src/gallium/drivers/r300/r300_screen.h | 2 +- src/gallium/drivers/r300/r300_screen_buffer.c | 222 +++++++++++++ src/gallium/drivers/r300/r300_screen_buffer.h | 85 +++++ src/gallium/drivers/r300/r300_state.c | 25 +- src/gallium/drivers/r300/r300_texture.c | 41 +-- src/gallium/drivers/r300/r300_texture.h | 4 +- src/gallium/drivers/r300/r300_winsys.h | 127 +++++++- src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h | 2 - src/gallium/winsys/drm/radeon/core/Makefile | 2 +- src/gallium/winsys/drm/radeon/core/radeon_buffer.h | 60 ++-- src/gallium/winsys/drm/radeon/core/radeon_drm.c | 134 +++----- src/gallium/winsys/drm/radeon/core/radeon_drm.h | 5 - .../winsys/drm/radeon/core/radeon_drm_buffer.c | 361 +++++++++++++++++++++ src/gallium/winsys/drm/radeon/core/radeon_r300.c | 237 ++++++++++---- src/gallium/winsys/drm/radeon/core/radeon_r300.h | 6 +- src/gallium/winsys/drm/radeon/core/radeon_winsys.h | 86 ++--- 23 files changed, 1247 insertions(+), 347 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_screen_buffer.c create mode 100644 src/gallium/drivers/r300/r300_screen_buffer.h create mode 100644 src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index afddcb161f..5707309bdf 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -14,6 +14,7 @@ C_SOURCES = \ r300_query.c \ r300_render.c \ r300_screen.c \ + r300_screen_buffer.c \ r300_state.c \ r300_state_derived.c \ r300_state_invariant.c \ diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index f631b4ed27..a8a6a07a84 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -24,6 +24,7 @@ #include "util/u_memory.h" #include "util/u_simple_list.h" +#include "util/u_upload_mgr.h" #include "r300_blit.h" #include "r300_context.h" @@ -54,6 +55,9 @@ static void r300_destroy_context(struct pipe_context* context) FREE(query); } + u_upload_destroy(r300->upload_vb); + u_upload_destroy(r300->upload_ib); + FREE(r300->blend_color_state.state); FREE(r300->clip_state.state); FREE(r300->fb_state.state); @@ -70,11 +74,7 @@ r300_is_texture_referenced(struct pipe_context *pipe, struct pipe_texture *texture, unsigned face, unsigned level) { - struct pipe_buffer* buf = 0; - - r300_get_texture_buffer(pipe->screen, texture, &buf, NULL); - - return pipe->is_buffer_referenced(pipe, buf); + return 0; } static unsigned int @@ -136,14 +136,14 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, { struct r300_context* r300 = CALLOC_STRUCT(r300_context); struct r300_screen* r300screen = r300_screen(screen); - struct radeon_winsys* radeon_winsys = r300screen->radeon_winsys; + struct r300_winsys_screen *rws = r300screen->rws; if (!r300) return NULL; - r300->winsys = radeon_winsys; + r300->rws = rws; - r300->context.winsys = (struct pipe_winsys*)radeon_winsys; + r300->context.winsys = (struct pipe_winsys*)rws; r300->context.screen = screen; r300->context.priv = priv; @@ -201,11 +201,31 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->invariant_state.dirty = TRUE; - r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300); + rws->set_flush_cb(r300->rws, r300_flush_cb, r300); r300->dirty_state = R300_NEW_KITCHEN_SINK; r300->dirty_hw++; r300->blitter = util_blitter_create(&r300->context); + r300->upload_ib = u_upload_create(screen, + 32 * 1024, 16, + PIPE_BUFFER_USAGE_INDEX); + + if (r300->upload_ib == NULL) + goto no_upload_ib; + + r300->upload_vb = u_upload_create(screen, + 128 * 1024, 16, + PIPE_BUFFER_USAGE_VERTEX); + if (r300->upload_vb == NULL) + goto no_upload_vb; + return &r300->context; + + // u_upload_destroy(r300->upload_vb); + no_upload_ib: + u_upload_destroy(r300->upload_ib); + no_upload_vb: + FREE(r300); + return NULL; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 443af4ec2e..749bac0498 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -32,6 +32,7 @@ #include "r300_screen.h" +struct u_upload_mgr; struct r300_context; struct r300_fragment_shader; @@ -238,7 +239,7 @@ struct r300_texture { boolean is_npot; /* Pipe buffer backing this texture. */ - struct pipe_buffer* buffer; + struct r300_winsys_buffer *buffer; /* Registers carrying texture format data. */ struct r300_texture_state state; @@ -265,7 +266,7 @@ struct r300_context { struct pipe_context context; /* The interface to the windowing system, etc. */ - struct radeon_winsys* winsys; + struct r300_winsys_screen *rws; /* Draw module. Used mostly for SW TCL. */ struct draw_context* draw; /* Accelerated blit support. */ @@ -330,6 +331,7 @@ struct r300_context { /* Vertex elements for Gallium. */ struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; int vertex_element_count; + bool any_user_vbs; struct pipe_stencil_ref stencil_ref; @@ -343,6 +345,9 @@ struct r300_context { boolean polygon_offset_enabled; /* Z buffer bit depth. */ uint32_t zbuffer_bpp; + + struct u_upload_mgr *upload_vb; + struct u_upload_mgr *upload_ib; }; /* Convenience cast wrapper. */ diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 151f72b0fe..ad07efbffd 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -51,7 +51,7 @@ #define CS_LOCALS(context) \ struct r300_context* const cs_context_copy = (context); \ - struct radeon_winsys* cs_winsys = cs_context_copy->winsys; \ + struct r300_winsys_screen *cs_winsys = cs_context_copy->rws; \ int cs_count = 0; (void) cs_count; #define CHECK_CS(size) \ @@ -105,22 +105,34 @@ cs_count--; \ } while (0) -#define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \ +#define OUT_CS_BUF_RELOC(bo, offset, rd, wd, flags) do { \ DBG(cs_context_copy, DBG_CS, "r300: writing relocation for buffer %p, offset %d, " \ "domains (%d, %d, %d)\n", \ bo, offset, rd, wd, flags); \ assert(bo); \ cs_winsys->write_cs_dword(cs_winsys, offset); \ - cs_winsys->write_cs_reloc(cs_winsys, bo, rd, wd, flags); \ + r300_buffer_write_reloc(cs_winsys, r300_buffer(bo), rd, wd, flags); \ cs_count -= 3; \ } while (0) -#define OUT_CS_RELOC_NO_OFFSET(bo, rd, wd, flags) do { \ + +#define OUT_CS_TEX_RELOC(tex, offset, rd, wd, flags) do { \ + DBG(cs_context_copy, DBG_CS, "r300: writing relocation for texture %p, offset %d, " \ + "domains (%d, %d, %d)\n", \ + tex, offset, rd, wd, flags); \ + assert(tex); \ + cs_winsys->write_cs_dword(cs_winsys, offset); \ + r300_texture_write_reloc(cs_winsys, tex, rd, wd, flags); \ + cs_count -= 3; \ +} while (0) + + +#define OUT_CS_BUF_RELOC_NO_OFFSET(bo, rd, wd, flags) do { \ DBG(cs_context_copy, DBG_CS, "r300: writing relocation for buffer %p, " \ "domains (%d, %d, %d)\n", \ bo, rd, wd, flags); \ assert(bo); \ - cs_winsys->write_cs_reloc(cs_winsys, bo, rd, wd, flags); \ + r300_buffer_write_reloc(cs_winsys, r300_buffer(bo), rd, wd, flags); \ cs_count -= 2; \ } while (0) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index f7dcd8dc52..6fb1d7bd92 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -32,6 +32,8 @@ #include "r300_emit.h" #include "r300_fs.h" #include "r300_screen.h" +#include "r300_screen_buffer.h" +#include "r300_state_inlines.h" #include "r300_vs.h" void r300_emit_blend_state(struct r300_context* r300, void* state) @@ -418,10 +420,10 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) assert(tex && tex->buffer && "cbuf is marked, but NULL!"); OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); - OUT_CS_RELOC(tex->buffer, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_CS_TEX_RELOC(tex, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_CS_REG_SEQ(R300_RB3D_COLORPITCH0 + (4 * i), 1); - OUT_CS_RELOC(tex->buffer, tex->fb_state.colorpitch[surf->level], + OUT_CS_TEX_RELOC(tex, tex->fb_state.colorpitch[surf->level], 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), tex->fb_state.us_out_fmt); @@ -434,12 +436,12 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) assert(tex && tex->buffer && "zsbuf is marked, but NULL!"); OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1); - OUT_CS_RELOC(tex->buffer, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_CS_TEX_RELOC(tex, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_CS_REG(R300_ZB_FORMAT, tex->fb_state.zb_format); OUT_CS_REG_SEQ(R300_ZB_DEPTHPITCH, 1); - OUT_CS_RELOC(tex->buffer, tex->fb_state.depthpitch[surf->level], + OUT_CS_TEX_RELOC(tex, tex->fb_state.depthpitch[surf->level], 0, RADEON_GEM_DOMAIN_VRAM, 0); } @@ -489,13 +491,13 @@ static void r300_emit_query_finish(struct r300_context *r300, /* pipe 3 only */ OUT_CS_REG(R300_SU_REG_DEST, 1 << 3); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 3), + OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 3), 0, RADEON_GEM_DOMAIN_GTT, 0); case 3: /* pipe 2 only */ OUT_CS_REG(R300_SU_REG_DEST, 1 << 2); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 2), + OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 2), 0, RADEON_GEM_DOMAIN_GTT, 0); case 2: /* pipe 1 only */ @@ -503,13 +505,13 @@ static void r300_emit_query_finish(struct r300_context *r300, OUT_CS_REG(R300_SU_REG_DEST, 1 << (caps->high_second_pipe ? 3 : 1)); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 1), + OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 1), 0, RADEON_GEM_DOMAIN_GTT, 0); case 1: /* pipe 0 only */ OUT_CS_REG(R300_SU_REG_DEST, 1 << 0); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 0), + OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 0), 0, RADEON_GEM_DOMAIN_GTT, 0); break; default: @@ -531,7 +533,7 @@ static void rv530_emit_query_single(struct r300_context *r300, BEGIN_CS(8); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_0); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); + OUT_CS_BUF_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL); END_CS; } @@ -544,10 +546,10 @@ static void rv530_emit_query_double(struct r300_context *r300, BEGIN_CS(14); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_0); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); + OUT_CS_BUF_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_1); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_RELOC(r300->oqbo, query->offset + sizeof(uint32_t), 0, RADEON_GEM_DOMAIN_GTT, 0); + OUT_CS_BUF_RELOC(r300->oqbo, query->offset + sizeof(uint32_t), 0, RADEON_GEM_DOMAIN_GTT, 0); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL); END_CS; } @@ -759,7 +761,7 @@ void r300_emit_texture(struct r300_context* r300, OUT_CS_REG(R300_TX_FORMAT1_0 + (offset * 4), tex->state.format1); OUT_CS_REG(R300_TX_FORMAT2_0 + (offset * 4), tex->state.format2); OUT_CS_REG_SEQ(R300_TX_OFFSET_0 + (offset * 4), 1); - OUT_CS_RELOC(tex->buffer, + OUT_CS_TEX_RELOC(tex, R300_TXO_MACRO_TILE(tex->macrotile) | R300_TXO_MICRO_TILE(tex->microtile), RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0, 0); @@ -800,7 +802,7 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) } for (i = 0; i < aos_count; i++) { - OUT_CS_RELOC_NO_OFFSET(vbuf[velem[i].vertex_buffer_index].buffer, + OUT_CS_BUF_RELOC_NO_OFFSET(vbuf[velem[i].vertex_buffer_index].buffer, RADEON_GEM_DOMAIN_GTT, 0, 0); } END_CS; @@ -1012,15 +1014,15 @@ void r300_emit_buffer_validate(struct r300_context *r300) boolean invalid = FALSE; /* Clean out BOs. */ - r300->winsys->reset_bos(r300->winsys); + r300->rws->reset_bos(r300->rws); validate: /* Color buffers... */ for (i = 0; i < fb->nr_cbufs; i++) { tex = (struct r300_texture*)fb->cbufs[i]->texture; assert(tex && tex->buffer && "cbuf is marked, but NULL!"); - if (!r300->winsys->add_buffer(r300->winsys, tex->buffer, - 0, RADEON_GEM_DOMAIN_VRAM)) { + if (!r300_add_texture(r300->rws, tex, + 0, RADEON_GEM_DOMAIN_VRAM)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } @@ -1029,8 +1031,8 @@ validate: if (fb->zsbuf) { tex = (struct r300_texture*)fb->zsbuf->texture; assert(tex && tex->buffer && "zsbuf is marked, but NULL!"); - if (!r300->winsys->add_buffer(r300->winsys, tex->buffer, - 0, RADEON_GEM_DOMAIN_VRAM)) { + if (!r300_add_texture(r300->rws, tex, + 0, RADEON_GEM_DOMAIN_VRAM)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } @@ -1040,31 +1042,31 @@ validate: tex = r300->textures[i]; if (!tex) continue; - if (!r300->winsys->add_buffer(r300->winsys, tex->buffer, - RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0)) { + if (!r300_add_texture(r300->rws, tex, + RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } /* ...occlusion query buffer... */ if (r300->dirty_state & R300_NEW_QUERY) { - if (!r300->winsys->add_buffer(r300->winsys, r300->oqbo, - 0, RADEON_GEM_DOMAIN_GTT)) { + if (!r300_add_buffer(r300->rws, r300->oqbo, + 0, RADEON_GEM_DOMAIN_GTT)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } /* ...and vertex buffer. */ if (r300->vbo) { - if (!r300->winsys->add_buffer(r300->winsys, r300->vbo, - RADEON_GEM_DOMAIN_GTT, 0)) { + if (!r300_add_buffer(r300->rws, r300->vbo, + RADEON_GEM_DOMAIN_GTT, 0)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } else { /* debug_printf("No VBO while emitting dirty state!\n"); */ } - if (!r300->winsys->validate(r300->winsys)) { + if (!r300->rws->validate(r300->rws)) { r300->context.flush(&r300->context, 0, NULL); if (invalid) { /* Well, hell. */ @@ -1096,7 +1098,7 @@ void r300_emit_dirty_state(struct r300_context* r300) /* Make sure we have at least 2*1024 spare dwords. */ /* XXX It would be nice to know the number of dwords we really need to * XXX emit. */ - while (!r300->winsys->check_cs(r300->winsys, dwords)) { + while (!r300->rws->check_cs(r300->rws, dwords)) { r300->context.flush(&r300->context, 0, NULL); } diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 754eb4dc76..47f5d6f7f1 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -30,10 +30,12 @@ #include "util/u_format.h" #include "util/u_memory.h" +#include "util/u_upload_mgr.h" #include "util/u_prim.h" #include "r300_cs.h" #include "r300_context.h" +#include "r300_screen_buffer.h" #include "r300_emit.h" #include "r300_reg.h" #include "r300_render.h" @@ -297,7 +299,7 @@ static void r300_emit_draw_elements(struct r300_context *r300, OUT_CS(R300_INDX_BUFFER_ONE_REG_WR | (R300_VAP_PORT_IDX0 >> 2) | (0 << R300_INDX_BUFFER_SKIP_SHIFT)); OUT_CS(offset_dwords << 2); - OUT_CS_RELOC(indexBuffer, count_dwords, + OUT_CS_BUF_RELOC(indexBuffer, count_dwords, RADEON_GEM_DOMAIN_GTT, 0, 0); END_CS; @@ -308,21 +310,28 @@ static boolean r300_setup_vertex_buffers(struct r300_context *r300) struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; struct pipe_vertex_element *velem = r300->vertex_element; struct pipe_buffer *pbuf; + int ret; + + /* upload buffers first */ + if (r300->any_user_vbs) { + ret = r300_upload_user_buffers(r300); + r300->any_user_vbs = false; + } validate: for (int i = 0; i < r300->vertex_element_count; i++) { pbuf = vbuf[velem[i].vertex_buffer_index].buffer; - if (!r300->winsys->add_buffer(r300->winsys, pbuf, - RADEON_GEM_DOMAIN_GTT, 0)) { + if (!r300_add_buffer(r300->rws, pbuf, + RADEON_GEM_DOMAIN_GTT, 0)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } - if (!r300->winsys->validate(r300->winsys)) { + if (!r300->rws->validate(r300->rws)) { r300->context.flush(&r300->context, 0, NULL); - return r300->winsys->validate(r300->winsys); + return r300->rws->validate(r300->rws); } return TRUE; @@ -396,15 +405,20 @@ void r300_draw_range_elements(struct pipe_context* pipe, indexSize = 2; } - if (!r300->winsys->add_buffer(r300->winsys, indexBuffer, - RADEON_GEM_DOMAIN_GTT, 0)) { + r300_upload_index_buffer(r300, &indexBuffer, + indexSize, start, count); + + if (!r300_add_buffer(r300->rws, indexBuffer, + RADEON_GEM_DOMAIN_GTT, 0)) { goto cleanup; } - if (!r300->winsys->validate(r300->winsys)) { + if (!r300->rws->validate(r300->rws)) { goto cleanup; } + u_upload_flush(r300->upload_vb); + u_upload_flush(r300->upload_ib); r300_emit_dirty_state(r300); r300_emit_aos(r300, 0); @@ -425,7 +439,7 @@ void r300_draw_range_elements(struct pipe_context* pipe, cleanup: if (indexBuffer != orgIndexBuffer) { - pipe->screen->buffer_destroy(indexBuffer); + pipe_buffer_reference( &indexBuffer, NULL ); } } @@ -466,6 +480,7 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, return; } + u_upload_flush(r300->upload_vb); r300_emit_dirty_state(r300); if (alt_num_verts || count <= 65535) { diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 6a55570571..3b70312c82 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -23,7 +23,6 @@ #include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" -#include "util/u_simple_screen.h" #include "r300_context.h" #include "r300_screen.h" @@ -32,6 +31,8 @@ #include "radeon_winsys.h" #include "r300_winsys.h" +#include "r300_screen_buffer.h" + /* Return the identifier behind whom the brave coders responsible for this * amalgamation of code, sweat, and duct tape, routinely obscure their names. * @@ -292,10 +293,11 @@ static void* r300_transfer_map(struct pipe_screen* screen, struct pipe_transfer* transfer) { struct r300_texture* tex = (struct r300_texture*)transfer->texture; + struct r300_winsys_screen *rws = r300_winsys_screen(screen); char* map; enum pipe_format format = tex->tex.format; - map = pipe_buffer_map(screen, tex->buffer, + map = rws->buffer_map(rws, tex->buffer, pipe_transfer_buffer_flags(transfer)); if (!map) { @@ -311,21 +313,26 @@ static void r300_transfer_unmap(struct pipe_screen* screen, struct pipe_transfer* transfer) { struct r300_texture* tex = (struct r300_texture*)transfer->texture; - pipe_buffer_unmap(screen, tex->buffer); + struct r300_winsys_screen *rws = r300_winsys_screen(screen); + rws->buffer_unmap(rws, tex->buffer); } static void r300_destroy_screen(struct pipe_screen* pscreen) { struct r300_screen* r300screen = r300_screen(pscreen); + struct r300_winsys_screen *rws = r300_winsys_screen(pscreen); + + if (rws) + rws->destroy(rws); FREE(r300screen->caps); FREE(r300screen); } -struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys) +struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws) { - struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen); - struct r300_capabilities* caps = CALLOC_STRUCT(r300_capabilities); + struct r300_screen *r300screen = CALLOC_STRUCT(r300_screen); + struct r300_capabilities *caps = CALLOC_STRUCT(r300_capabilities); if (!r300screen || !caps) { FREE(r300screen); @@ -333,16 +340,16 @@ struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys) return NULL; } - caps->pci_id = radeon_winsys->pci_id; - caps->num_frag_pipes = radeon_winsys->gb_pipes; - caps->num_z_pipes = radeon_winsys->z_pipes; + caps->pci_id = rws->get_value(rws, R300_VID_PCI_ID); + caps->num_frag_pipes = rws->get_value(rws, R300_VID_GB_PIPES); + caps->num_z_pipes = rws->get_value(rws, R300_VID_Z_PIPES); r300_init_debug(r300screen); r300_parse_chipset(caps); r300screen->caps = caps; - r300screen->radeon_winsys = radeon_winsys; - r300screen->screen.winsys = (struct pipe_winsys*)radeon_winsys; + r300screen->rws = rws; + r300screen->screen.winsys = (struct pipe_winsys*)rws; r300screen->screen.destroy = r300_destroy_screen; r300screen->screen.get_name = r300_get_name; r300screen->screen.get_vendor = r300_get_vendor; @@ -356,7 +363,12 @@ struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys) r300screen->screen.transfer_unmap = r300_transfer_unmap; r300_init_screen_texture_functions(&r300screen->screen); - u_simple_screen_init(&r300screen->screen); - + r300_screen_init_buffer_functions(r300screen); return &r300screen->screen; } + +struct r300_winsys_screen * +r300_winsys_screen(struct pipe_screen *screen) +{ + return r300_screen(screen)->rws; +} diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index 502fbfa5a2..87fc6190ce 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -33,7 +33,7 @@ struct r300_screen { /* Parent class */ struct pipe_screen screen; - struct radeon_winsys* radeon_winsys; + struct r300_winsys_screen *rws; /* Chipset capabilities */ struct r300_capabilities* caps; diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c new file mode 100644 index 0000000000..358582ea21 --- /dev/null +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -0,0 +1,222 @@ +#include + +#include "util/u_inlines.h" +#include "util/u_format.h" +#include "util/u_memory.h" +#include "util/u_upload_mgr.h" + +#include "r300_screen_buffer.h" + +#include "r300_winsys.h" + +int r300_upload_index_buffer(struct r300_context *r300, + struct pipe_buffer **index_buffer, + unsigned index_size, + unsigned start, + unsigned count) +{ + struct pipe_buffer *upload_buffer = NULL; + unsigned index_offset = start * index_size; + int ret = 0; + + if (r300_buffer_is_user_buffer(*index_buffer)) { + ret = u_upload_buffer(r300->upload_ib, + index_offset, + count * index_size, + *index_buffer, + &index_offset, + &upload_buffer); + if (ret) { + goto done; + } + *index_buffer = upload_buffer; + } + done: + // if (upload_buffer) + // pipe_buffer_reference(&upload_buffer, NULL); + return ret; +} + +int r300_upload_user_buffers(struct r300_context *r300) +{ + enum pipe_error ret = PIPE_OK; + int i, nr; + + nr = r300->vertex_buffer_count; + + for (i = 0; i < nr; i++) { + + if (r300_buffer_is_user_buffer(r300->vertex_buffer[i].buffer)) { + struct pipe_buffer *upload_buffer = NULL; + unsigned offset = 0; + unsigned size = r300->vertex_buffer[i].buffer->size; + unsigned upload_offset; + + ret = u_upload_buffer(r300->upload_vb, + offset, size, + r300->vertex_buffer[i].buffer, + &upload_offset, &upload_buffer); + if (ret) + return ret; + + pipe_buffer_reference(&r300->vertex_buffer[i].buffer, NULL); + r300->vertex_buffer[i].buffer = upload_buffer; + r300->vertex_buffer[i].buffer_offset = upload_offset; + } + } + return ret; +} + +static struct r300_winsys_buffer * +r300_winsys_buffer_create(struct r300_screen *r300screen, + unsigned alignment, + unsigned usage, + unsigned size) +{ + struct r300_winsys_screen *rws = r300screen->rws; + struct r300_winsys_buffer *buf; + + buf = rws->buffer_create(rws, alignment, usage, size); + return buf; +} + +static void r300_winsys_buffer_destroy(struct r300_screen *r300screen, + struct r300_buffer *rbuf) +{ + struct r300_winsys_screen *rws = r300screen->rws; + + if (rbuf->buf) { + rws->buffer_destroy(rbuf->buf); + rbuf->buf = NULL; + } +} + +static struct pipe_buffer *r300_buffer_create(struct pipe_screen *screen, + unsigned alignment, + unsigned usage, + unsigned size) +{ + struct r300_screen *r300screen = r300_screen(screen); + struct r300_buffer *rbuf; + + rbuf = CALLOC_STRUCT(r300_buffer); + if (!rbuf) + goto error1; + + rbuf->magic = R300_BUFFER_MAGIC; + + pipe_reference_init(&rbuf->base.reference, 1); + rbuf->base.screen = screen; + rbuf->base.alignment = alignment; + rbuf->base.usage = usage; + rbuf->base.size = size; + + rbuf->buf = r300_winsys_buffer_create(r300screen, + alignment, + usage, + size); + + if (!rbuf->buf) + goto error2; + + return &rbuf->base; +error2: + FREE(rbuf); +error1: + return NULL; +} + + +static struct pipe_buffer *r300_user_buffer_create(struct pipe_screen *screen, + void *ptr, + unsigned bytes) +{ + struct r300_buffer *rbuf; + + rbuf = CALLOC_STRUCT(r300_buffer); + if (!rbuf) + goto no_rbuf; + + rbuf->magic = R300_BUFFER_MAGIC; + + pipe_reference_init(&rbuf->base.reference, 1); + rbuf->base.screen = screen; + rbuf->base.alignment = 1; + rbuf->base.usage = 0; + rbuf->base.size = bytes; + + rbuf->user_buffer = ptr; + return &rbuf->base; + +no_rbuf: + return NULL; +} + +static void r300_buffer_destroy(struct pipe_buffer *buf) +{ + struct r300_screen *r300screen = r300_screen(buf->screen); + struct r300_buffer *rbuf = r300_buffer(buf); + + r300_winsys_buffer_destroy(r300screen, rbuf); + FREE(rbuf); +} + +static void * +r300_buffer_map_range(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned offset, unsigned length, + unsigned usage ) +{ + struct r300_screen *r300screen = r300_screen(screen); + struct r300_winsys_screen *rws = r300screen->rws; + struct r300_buffer *rbuf = r300_buffer(buf); + void *map; + + if (rbuf->user_buffer) + return rbuf->user_buffer; + + map = rws->buffer_map(rws, rbuf->buf, usage); + + return map; +} + +static void * +r300_buffer_map(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned usage) +{ + struct r300_screen *r300screen = r300_screen(screen); + struct r300_winsys_screen *rws = r300screen->rws; + struct r300_buffer *rbuf = r300_buffer(buf); + void *map; + + if (rbuf->user_buffer) + return rbuf->user_buffer; + + map = rws->buffer_map(rws, rbuf->buf, usage); + + return map; +} + +static void +r300_buffer_unmap(struct pipe_screen *screen, + struct pipe_buffer *buf) +{ + struct r300_screen *r300screen = r300_screen(screen); + struct r300_winsys_screen *rws = r300screen->rws; + struct r300_buffer *rbuf = r300_buffer(buf); + + if (rbuf->buf) + rws->buffer_unmap(rws, rbuf->buf); +} + +void r300_screen_init_buffer_functions(struct r300_screen *r300screen) +{ + r300screen->screen.buffer_create = r300_buffer_create; + r300screen->screen.user_buffer_create = r300_user_buffer_create; + r300screen->screen.buffer_map = r300_buffer_map; + r300screen->screen.buffer_map_range = r300_buffer_map_range; +// r300screen->screen.buffer_flush_mapped_range = r300_buffer_flush_mapped_range; + r300screen->screen.buffer_unmap = r300_buffer_unmap; + r300screen->screen.buffer_destroy = r300_buffer_destroy; +} diff --git a/src/gallium/drivers/r300/r300_screen_buffer.h b/src/gallium/drivers/r300/r300_screen_buffer.h new file mode 100644 index 0000000000..7c026508b5 --- /dev/null +++ b/src/gallium/drivers/r300/r300_screen_buffer.h @@ -0,0 +1,85 @@ +#ifndef R300_SCREEN_BUFFER_H +#define R300_SCREEN_BUFFER_H +#include "pipe/p_compiler.h" +#include "pipe/p_state.h" +#include "r300_screen.h" + +#include "r300_winsys.h" +#include "r300_context.h" + +#define R300_BUFFER_MAGIC 0xabcd1234 + +struct r300_buffer +{ + struct pipe_buffer base; + + uint32_t magic; + + struct r300_winsys_buffer *buf; + + void *user_buffer; +}; + +static INLINE struct r300_buffer * +r300_buffer(struct pipe_buffer *buffer) +{ + if (buffer) { + assert(((struct r300_buffer *)buffer)->magic == R300_BUFFER_MAGIC); + return (struct r300_buffer *)buffer; + } + return NULL; +} + +static INLINE boolean +r300_buffer_is_user_buffer(struct pipe_buffer *buffer) +{ + return r300_buffer(buffer)->user_buffer ? true : false; +} + +static INLINE boolean r300_add_buffer(struct r300_winsys_screen *rws, + struct pipe_buffer *buffer, + int rd, int wr) +{ + struct r300_buffer *buf = r300_buffer(buffer); + + if (!buf->buf) + return true; + + return rws->add_buffer(rws, buf->buf, rd, wr); +} + + +static INLINE boolean r300_add_texture(struct r300_winsys_screen *rws, + struct r300_texture *tex, + int rd, int wr) +{ + return rws->add_buffer(rws, tex->buffer, rd, wr); +} + +void r300_screen_init_buffer_functions(struct r300_screen *r300screen); + +static INLINE void r300_buffer_write_reloc(struct r300_winsys_screen *rws, + struct r300_buffer *buf, + uint32_t rd, uint32_t wd, uint32_t flags) +{ + if (!buf->buf) + return; + + rws->write_cs_reloc(rws, buf->buf, rd, wd, flags); +} + +static INLINE void r300_texture_write_reloc(struct r300_winsys_screen *rws, + struct r300_texture *texture, + uint32_t rd, uint32_t wd, uint32_t flags) +{ + rws->write_cs_reloc(rws, texture->buffer, rd, wd, flags); +} + +int r300_upload_user_buffers(struct r300_context *r300); + +int r300_upload_index_buffer(struct r300_context *r300, + struct pipe_buffer **index_buffer, + unsigned index_size, + unsigned start, + unsigned count); +#endif diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 34bf81c193..d8a87dec15 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -34,6 +34,7 @@ #include "r300_context.h" #include "r300_reg.h" #include "r300_screen.h" +#include "r300_screen_buffer.h" #include "r300_state_inlines.h" #include "r300_fs.h" #include "r300_vs.h" @@ -521,7 +522,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)old_state->cbufs[i]->texture; if (tex) { - r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, + r300->rws->buffer_set_tiling(r300->rws, tex->buffer, tex->pitch[0], tex->microtile != 0, tex->macrotile != 0); @@ -533,7 +534,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)old_state->zsbuf->texture; if (tex) { - r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, + r300->rws->buffer_set_tiling(r300->rws, tex->buffer, tex->pitch[0], tex->microtile != 0, tex->macrotile != 0); @@ -545,7 +546,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)new_state->cbufs[i]->texture; level = new_state->cbufs[i]->level; - r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, + r300->rws->buffer_set_tiling(r300->rws, tex->buffer, tex->pitch[level], tex->microtile != 0, tex->mip_macrotile[level] != 0); @@ -554,7 +555,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)new_state->zsbuf->texture; level = new_state->zsbuf->level; - r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, + r300->rws->buffer_set_tiling(r300->rws, tex->buffer, tex->pitch[level], tex->microtile != 0, tex->mip_macrotile[level] != 0); @@ -1028,10 +1029,26 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, const struct pipe_vertex_buffer* buffers) { struct r300_context* r300 = r300_context(pipe); + boolean any_user_buffer = false; + int i; + + if (count == r300->vertex_buffer_count && + memcmp(r300->vertex_buffer, buffers, count * sizeof(buffers[0])) == 0) + return; + + for (i = 0; i < count; i++) { + pipe_buffer_reference(&r300->vertex_buffer[i].buffer, buffers[i].buffer); + if (r300_buffer_is_user_buffer(buffers[i].buffer)) + any_user_buffer = true; + } + + for ( ; i < r300->vertex_buffer_count; i++) + pipe_buffer_reference(&r300->vertex_buffer[i].buffer, NULL); memcpy(r300->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count); r300->vertex_buffer_count = count; + r300->any_user_vbs = any_user_buffer; if (r300->draw) { draw_flush(r300->draw); diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index ed2be06254..9016e86ccd 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -731,7 +731,7 @@ static struct pipe_texture* { struct r300_texture* tex = CALLOC_STRUCT(r300_texture); struct r300_screen* rscreen = r300_screen(screen); - struct radeon_winsys* winsys = (struct radeon_winsys*)screen->winsys; + struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys; if (!tex) { return NULL; @@ -745,13 +745,13 @@ static struct pipe_texture* r300_setup_miptree(rscreen, tex); r300_setup_texture_state(rscreen, tex); - tex->buffer = screen->buffer_create(screen, 2048, - PIPE_BUFFER_USAGE_PIXEL, - tex->size); - winsys->buffer_set_tiling(winsys, tex->buffer, - tex->pitch[0], - tex->microtile != R300_BUFFER_LINEAR, - tex->macrotile != R300_BUFFER_LINEAR); + tex->buffer = rws->buffer_create(rws, 2048, + PIPE_BUFFER_USAGE_PIXEL, + tex->size); + rws->buffer_set_tiling(rws, tex->buffer, + tex->pitch[0], + tex->microtile != R300_BUFFER_LINEAR, + tex->macrotile != R300_BUFFER_LINEAR); if (!tex->buffer) { FREE(tex); @@ -764,9 +764,9 @@ static struct pipe_texture* static void r300_texture_destroy(struct pipe_texture* texture) { struct r300_texture* tex = (struct r300_texture*)texture; + struct r300_winsys_screen *rws = (struct r300_winsys_screen *)texture->screen->winsys; - pipe_buffer_reference(&tex->buffer, NULL); - + rws->buffer_reference(rws, &tex->buffer, NULL); FREE(tex); } @@ -806,14 +806,14 @@ static void r300_tex_surface_destroy(struct pipe_surface* s) FREE(s); } -static struct pipe_texture* - r300_texture_blanket(struct pipe_screen* screen, - const struct pipe_texture* base, - const unsigned* stride, - struct pipe_buffer* buffer) +struct pipe_texture *r300_texture_blanket_winsys_buffer(struct pipe_screen *screen, + const struct pipe_texture *base, + const unsigned *stride, + struct r300_winsys_buffer *buffer) { struct r300_texture* tex; struct r300_screen* rscreen = r300_screen(screen); + struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys; /* Support only 2D textures without mipmaps */ if (base->target != PIPE_TEXTURE_2D || @@ -837,7 +837,7 @@ static struct pipe_texture* r300_setup_flags(tex); r300_setup_texture_state(rscreen, tex); - pipe_buffer_reference(&tex->buffer, buffer); + rws->buffer_reference(rws, &tex->buffer, buffer); return (struct pipe_texture*)tex; } @@ -896,7 +896,6 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen) screen->texture_destroy = r300_texture_destroy; screen->get_tex_surface = r300_get_tex_surface; screen->tex_surface_destroy = r300_tex_surface_destroy; - screen->texture_blanket = r300_texture_blanket; screen->video_surface_create = r300_video_surface_create; screen->video_surface_destroy= r300_video_surface_destroy; @@ -904,19 +903,23 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen) boolean r300_get_texture_buffer(struct pipe_screen* screen, struct pipe_texture* texture, - struct pipe_buffer** buffer, + struct r300_winsys_buffer** buffer, unsigned* stride) { struct r300_texture* tex = (struct r300_texture*)texture; + struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys; + struct r300_winsys_buffer *buf; + if (!tex) { return FALSE; } - pipe_buffer_reference(buffer, tex->buffer); + rws->buffer_reference(rws, &buf, tex->buffer); if (stride) { *stride = r300_texture_get_stride(r300_screen(screen), tex, 0); } + *buffer = buf; return TRUE; } diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 46a5fb6188..97724f790c 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -63,8 +63,8 @@ r300_video_surface(struct pipe_video_surface *pvs) #ifndef R300_WINSYS_H boolean r300_get_texture_buffer(struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, + struct pipe_texture *texture, + struct r300_winsys_buffer** buffer, unsigned* stride); #endif /* R300_WINSYS_H */ diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index 40fb8a95ca..c6f9174496 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -23,10 +23,6 @@ #ifndef R300_WINSYS_H #define R300_WINSYS_H -#ifdef __cplusplus -extern "C" { -#endif - /* The public interface header for the r300 pipe driver. * Any winsys hosting this pipe needs to implement r300_winsys and then * call r300_create_screen to start things. */ @@ -34,19 +30,128 @@ extern "C" { #include "pipe/p_defines.h" #include "pipe/p_state.h" -struct radeon_winsys; +struct r300_winsys_screen; /* Creates a new r300 screen. */ -struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys); +struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws); + +struct r300_winsys_buffer; boolean r300_get_texture_buffer(struct pipe_screen* screen, struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride); + struct r300_winsys_buffer** buffer, + unsigned *stride); + +enum r300_value_id { + R300_VID_PCI_ID, + R300_VID_GB_PIPES, + R300_VID_Z_PIPES, +}; + +struct r300_winsys_screen { + void (*destroy)(struct r300_winsys_screen *ws); + + /** + * Buffer management. Buffer attributes are mostly fixed over its lifetime. + * + * Remember that gallium gets to choose the interface it needs, and the + * window systems must then implement that interface (rather than the + * other way around...). + * + * usage is a bitmask of R300_WINSYS_BUFFER_USAGE_PIXEL/VERTEX/INDEX/CONSTANT. This + * usage argument is only an optimization hint, not a guarantee, therefore + * proper behavior must be observed in all circumstances. + * + * alignment indicates the client's alignment requirements, eg for + * SSE instructions. + */ + struct r300_winsys_buffer *(*buffer_create)(struct r300_winsys_screen *ws, + unsigned alignment, + unsigned usage, + unsigned size); + + /** + * Map the entire data store of a buffer object into the client's address. + * flags is bitmask of R300_WINSYS_BUFFER_USAGE_CPU_READ/WRITE flags. + */ + void *(*buffer_map)( struct r300_winsys_screen *ws, + struct r300_winsys_buffer *buf, + unsigned usage ); + + void (*buffer_unmap)( struct r300_winsys_screen *ws, + struct r300_winsys_buffer *buf ); + + void (*buffer_destroy)( struct r300_winsys_buffer *buf ); + + + void (*buffer_reference)(struct r300_winsys_screen *rws, + struct r300_winsys_buffer **pdst, + struct r300_winsys_buffer *src); + + boolean (*buffer_references)(struct r300_winsys_buffer *a, + struct r300_winsys_buffer *b); + + /* Add a pipe_buffer to the list of buffer objects to validate. */ + boolean (*add_buffer)(struct r300_winsys_screen *winsys, + struct r300_winsys_buffer *buf, + uint32_t rd, + uint32_t wd); + + /* Revalidate all currently setup pipe_buffers. + * Returns TRUE if a flush is required. */ + boolean (*validate)(struct r300_winsys_screen* winsys); + + /* Check to see if there's room for commands. */ + boolean (*check_cs)(struct r300_winsys_screen* winsys, int size); + + /* Start a command emit. */ + void (*begin_cs)(struct r300_winsys_screen* winsys, + int size, + const char* file, + const char* function, + int line); + + /* Write a dword to the command buffer. */ + void (*write_cs_dword)(struct r300_winsys_screen* winsys, uint32_t dword); + + /* Write a relocated dword to the command buffer. */ + void (*write_cs_reloc)(struct r300_winsys_screen *winsys, + struct r300_winsys_buffer *buf, + uint32_t rd, + uint32_t wd, + uint32_t flags); + + /* Finish a command emit. */ + void (*end_cs)(struct r300_winsys_screen* winsys, + const char* file, + const char* function, + int line); + + /* Flush the CS. */ + void (*flush_cs)(struct r300_winsys_screen* winsys); + + /* winsys flush - callback from winsys when flush required */ + void (*set_flush_cb)(struct r300_winsys_screen *winsys, + void (*flush_cb)(void *), void *data); + + void (*reset_bos)(struct r300_winsys_screen *winsys); + + void (*buffer_set_tiling)(struct r300_winsys_screen *winsys, + struct r300_winsys_buffer *buffer, + uint32_t pitch, + boolean microtiled, + boolean macrotiled); + + uint32_t (*get_value)(struct r300_winsys_screen *winsys, + enum r300_value_id vid); +}; -#ifdef __cplusplus -} -#endif +struct r300_winsys_screen * +r300_winsys_screen(struct pipe_screen *screen); +struct pipe_texture *r300_texture_blanket_winsys_buffer(struct pipe_screen *screen, + const struct pipe_texture *base, + const unsigned *stride, + struct r300_winsys_buffer *buffer); #endif /* R300_WINSYS_H */ diff --git a/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h b/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h index c6a7d4a8c5..b36680eb66 100644 --- a/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h +++ b/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h @@ -32,8 +32,6 @@ i965_libdrm_winsys(struct brw_winsys_screen *iws) return (struct i965_libdrm_winsys *)iws; } -struct i965_libdrm_winsys *i965_libdrm_winsys_create(int fd, unsigned pci_id); - void i965_libdrm_winsys_init_buffer_functions(struct i965_libdrm_winsys *idws); diff --git a/src/gallium/winsys/drm/radeon/core/Makefile b/src/gallium/winsys/drm/radeon/core/Makefile index 860cbb6dbf..13bbbf730d 100644 --- a/src/gallium/winsys/drm/radeon/core/Makefile +++ b/src/gallium/winsys/drm/radeon/core/Makefile @@ -5,7 +5,7 @@ include $(TOP)/configs/current LIBNAME = radeonwinsys C_SOURCES = \ - radeon_buffer.c \ + radeon_drm_buffer.c \ radeon_drm.c \ radeon_r300.c diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h index f1c8fc2a3b..8e0274e33d 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h @@ -32,11 +32,11 @@ #include -#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" #include "pipebuffer/pb_buffer.h" +#include "pipebuffer/pb_bufmgr.h" #include "util/u_memory.h" @@ -47,41 +47,41 @@ #include "radeon_winsys.h" -struct radeon_pipe_buffer { - struct pipe_buffer base; - /* Pointer to GPU-backed BO. */ - struct radeon_bo *bo; - /* Pointer to fallback PB buffer. */ - struct pb_buffer *pb; - boolean flinked; - uint32_t flink; -}; #define RADEON_MAX_BOS 24 -struct radeon_winsys_priv { - /* DRM FD */ - int fd; +static INLINE struct pb_buffer * +radeon_pb_buffer(struct r300_winsys_buffer *buffer) +{ + return (struct pb_buffer *)buffer; +} - /* Radeon BO manager. */ - struct radeon_bo_manager* bom; +static INLINE struct r300_winsys_buffer * +radeon_libdrm_winsys_buffer(struct pb_buffer *buffer) +{ + return (struct r300_winsys_buffer *)buffer; +} - /* Radeon CS manager. */ - struct radeon_cs_manager* csm; +struct pb_manager * +radeon_drm_bufmgr_create(struct radeon_libdrm_winsys *rws); - /* Current CS. */ - struct radeon_cs* cs; +boolean radeon_drm_bufmgr_add_buffer(struct pb_buffer *_buf, + uint32_t rd, uint32_t wd); - /* Flush CB */ - void (*flush_cb)(void *); - void *flush_data; -}; -struct radeon_winsys* radeon_pipe_winsys(int fb); -#if 0 -struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context, - uint32_t handle, - enum pipe_format format, - int w, int h, int pitch); -#endif +void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf, + uint32_t rd, uint32_t wd, + uint32_t flags); + +struct radeon_libdrm_winsys* radeon_pipe_winsys(int fd); + +boolean radeon_drm_bufmgr_shared_handle_from_buffer(struct pb_buffer *_buf, + uint32_t *handle); +uint32_t radeon_drm_bufmgr_handle_from_buffer(struct pb_buffer *_buf); +struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr, + uint32_t handle); + +void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf, boolean microtiled, boolean macrotiled, uint32_t pitch); + +void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr); #endif diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index 0c0e118ba3..f886fda2f2 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -31,8 +31,22 @@ #include "radeon_drm.h" +static struct radeon_libdrm_winsys * +radeon_winsys_create(int fd) +{ + struct radeon_libdrm_winsys *rws; + + rws = CALLOC_STRUCT(radeon_libdrm_winsys); + if (rws == NULL) { + return NULL; + } + + rws->fd = fd; + return rws; +} + /* Helper function to do the ioctls needed for setup and init. */ -static void do_ioctls(int fd, struct radeon_winsys* winsys) +static void do_ioctls(int fd, struct radeon_libdrm_winsys* winsys) { struct drm_radeon_gem_info gem_info = {0}; struct drm_radeon_info info = {0}; @@ -123,62 +137,26 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB, struct drm_create_screen_arg *arg) { - struct radeon_winsys* rwinsys = radeon_pipe_winsys(drmFB); - do_ioctls(drmFB, rwinsys); + struct radeon_libdrm_winsys* rws; + + rws = radeon_winsys_create(drmFB); + if (!rws) + return NULL; + + do_ioctls(drmFB, rws); /* The state tracker can organize a softpipe fallback if no hw * driver is found. */ - if (is_r3xx(rwinsys->pci_id)) { - radeon_setup_winsys(drmFB, rwinsys); - return r300_create_screen(rwinsys); + if (is_r3xx(rws->pci_id)) { + radeon_setup_winsys(drmFB, rws); + return r300_create_screen(&rws->base); } else { - FREE(rwinsys); + FREE(rws); return NULL; } } - -boolean radeon_buffer_from_texture(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride) -{ - /* XXX fix this */ - return r300_get_texture_buffer(screen, texture, buffer, stride); -} - -/* Create a buffer from a handle. */ -/* XXX what's up with name? */ -struct pipe_buffer* radeon_buffer_from_handle(struct drm_api* api, - struct pipe_screen* screen, - const char* name, - unsigned handle) -{ - struct radeon_bo_manager* bom = - ((struct radeon_winsys*)screen->winsys)->priv->bom; - struct radeon_pipe_buffer* radeon_buffer; - struct radeon_bo* bo = NULL; - - bo = radeon_bo_open(bom, handle, 0, 0, 0, 0); - if (bo == NULL) { - return NULL; - } - - radeon_buffer = CALLOC_STRUCT(radeon_pipe_buffer); - if (radeon_buffer == NULL) { - radeon_bo_unref(bo); - return NULL; - } - - pipe_reference_init(&radeon_buffer->base.reference, 1); - radeon_buffer->base.screen = screen; - radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; - radeon_buffer->bo = bo; - return &radeon_buffer->base; -} - static struct pipe_texture* radeon_texture_from_shared_handle(struct drm_api *api, struct pipe_screen *screen, @@ -187,18 +165,20 @@ radeon_texture_from_shared_handle(struct drm_api *api, unsigned stride, unsigned handle) { - struct pipe_buffer *buffer; + struct pb_buffer *_buf; + struct r300_winsys_buffer *buf; struct pipe_texture *blanket; + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(r300_winsys_screen(screen)); - buffer = radeon_buffer_from_handle(api, screen, name, handle); - if (!buffer) { - return NULL; + _buf = radeon_drm_bufmgr_create_buffer_from_handle(ws->kman, handle); + if (!_buf) { + return NULL; } - blanket = screen->texture_blanket(screen, templ, &stride, buffer); - - pipe_buffer_reference(&buffer, NULL); + buf = radeon_libdrm_winsys_buffer(_buf); + blanket = r300_texture_blanket_winsys_buffer(screen, templ, &stride, buf); + pb_reference(&_buf, NULL); return blanket; } @@ -208,34 +188,14 @@ static boolean radeon_shared_handle_from_texture(struct drm_api *api, unsigned *stride, unsigned *handle) { - int retval, fd; - struct drm_gem_flink flink; - struct radeon_pipe_buffer* radeon_buffer; - struct pipe_buffer *buffer = NULL; - - if (!radeon_buffer_from_texture(api, screen, texture, &buffer, stride)) { + struct r300_winsys_buffer *radeon_buffer; + struct pb_buffer *_buf; + if (!r300_get_texture_buffer(screen, texture, &radeon_buffer, stride)) { return FALSE; } - radeon_buffer = (struct radeon_pipe_buffer*)buffer; - if (!radeon_buffer->flinked) { - fd = ((struct radeon_winsys*)screen->winsys)->priv->fd; - - flink.handle = radeon_buffer->bo->handle; - - retval = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - if (retval) { - debug_printf("radeon: DRM_IOCTL_GEM_FLINK failed, error %d\n", - retval); - return FALSE; - } - - radeon_buffer->flink = flink.name; - radeon_buffer->flinked = TRUE; - } - - *handle = radeon_buffer->flink; - return TRUE; + _buf = radeon_pb_buffer(radeon_buffer); + return radeon_drm_bufmgr_shared_handle_from_buffer(_buf, handle); } static boolean radeon_local_handle_from_texture(struct drm_api *api, @@ -244,16 +204,18 @@ static boolean radeon_local_handle_from_texture(struct drm_api *api, unsigned *stride, unsigned *handle) { - struct pipe_buffer *buffer = NULL; - if (!radeon_buffer_from_texture(api, screen, texture, &buffer, stride)) { + struct r300_winsys_buffer *radeon_buffer; + struct pb_buffer *_buf; + + if (!r300_get_texture_buffer(screen, texture, &radeon_buffer, stride)) { return FALSE; } - *handle = ((struct radeon_pipe_buffer*)buffer)->bo->handle; - - pipe_buffer_reference(&buffer, NULL); + _buf = radeon_pb_buffer(radeon_buffer); + *handle = radeon_drm_bufmgr_handle_from_buffer(_buf); - return TRUE; + pb_reference(&_buf, NULL); + return true; } static void radeon_drm_api_destroy(struct drm_api *api) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.h b/src/gallium/winsys/drm/radeon/core/radeon_drm.h index 8d74cbafc2..2f55061330 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.h @@ -59,11 +59,6 @@ boolean radeon_buffer_from_texture(struct drm_api* api, struct pipe_buffer** buffer, unsigned* stride); -struct pipe_buffer* radeon_buffer_from_handle(struct drm_api* api, - struct pipe_screen* screen, - const char* name, - unsigned handle); - boolean radeon_handle_from_buffer(struct drm_api* api, struct pipe_screen* screen, struct pipe_buffer* buffer, diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c new file mode 100644 index 0000000000..5f2fd2d7fc --- /dev/null +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c @@ -0,0 +1,361 @@ + +#include "radeon_drm.h" +#include "radeon_bo_gem.h" +#include "radeon_cs_gem.h" + +#include "util/u_inlines.h" +#include "util/u_memory.h" +#include "util/u_simple_list.h" +#include "pipebuffer/pb_buffer.h" +#include "pipebuffer/pb_bufmgr.h" + +#include "radeon_winsys.h" +struct radeon_drm_bufmgr; + +struct radeon_drm_buffer { + struct pb_buffer base; + struct radeon_drm_bufmgr *mgr; + + struct radeon_bo *bo; + + boolean flinked; + uint32_t flink; + + boolean mapped; + struct radeon_drm_buffer *next, *prev; +}; + +extern const struct pb_vtbl radeon_drm_buffer_vtbl; + + +static INLINE struct radeon_drm_buffer * +radeon_drm_buffer(struct pb_buffer *buf) +{ + assert(buf); + assert(buf->vtbl == &radeon_drm_buffer_vtbl); + return (struct radeon_drm_buffer *)buf; +} + +struct radeon_drm_bufmgr { + struct pb_manager base; + struct radeon_libdrm_winsys *rws; + struct radeon_drm_buffer buffer_map_list; +}; + +static INLINE struct radeon_drm_bufmgr * +radeon_drm_bufmgr(struct pb_manager *mgr) +{ + assert(mgr); + return (struct radeon_drm_bufmgr *)mgr; +} + +static void +radeon_drm_buffer_destroy(struct pb_buffer *_buf) +{ + struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); + + if (buf->mapped) { + remove_from_list(buf); + radeon_bo_unmap(buf->bo); + buf->mapped = false; + } + radeon_bo_unref(buf->bo); + + FREE(buf); +} + +static void * +radeon_drm_buffer_map(struct pb_buffer *_buf, + unsigned flags) +{ + struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); + int write; + + if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { + uint32_t domain; + + if (radeon_bo_is_busy(buf->bo, &domain)) + return NULL; + } + + if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs)) { + buf->mgr->rws->flush_cb(buf->mgr->rws->flush_data); + } + + if (buf->mapped) + return buf->bo->ptr; + + if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { + write = 1; + } + + if (radeon_bo_map(buf->bo, write)) { + return NULL; + } + buf->mapped = true; + insert_at_tail(&buf->mgr->buffer_map_list, buf); + return buf->bo->ptr; +} + +static void +radeon_drm_buffer_unmap(struct pb_buffer *_buf) +{ + (void)_buf; +} + +static void +radeon_drm_buffer_get_base_buffer(struct pb_buffer *buf, + struct pb_buffer **base_buf, + unsigned *offset) +{ + *base_buf = buf; + *offset = 0; +} + + +static enum pipe_error +radeon_drm_buffer_validate(struct pb_buffer *_buf, + struct pb_validate *vl, + unsigned flags) +{ + /* Always pinned */ + return PIPE_OK; +} + +static void +radeon_drm_buffer_fence(struct pb_buffer *buf, + struct pipe_fence_handle *fence) +{ +} + +const struct pb_vtbl radeon_drm_buffer_vtbl = { + radeon_drm_buffer_destroy, + radeon_drm_buffer_map, + radeon_drm_buffer_unmap, + radeon_drm_buffer_validate, + radeon_drm_buffer_fence, + radeon_drm_buffer_get_base_buffer, +}; + + +static uint32_t radeon_domain_from_usage(unsigned usage) +{ + uint32_t domain = 0; + + if (usage & PIPE_BUFFER_USAGE_GPU_WRITE) { + domain |= RADEON_GEM_DOMAIN_VRAM; + } + if (usage & PIPE_BUFFER_USAGE_PIXEL) { + domain |= RADEON_GEM_DOMAIN_VRAM; + } + if (usage & PIPE_BUFFER_USAGE_VERTEX) { + domain |= RADEON_GEM_DOMAIN_GTT; + } + if (usage & PIPE_BUFFER_USAGE_INDEX) { + domain |= RADEON_GEM_DOMAIN_GTT; + } + + return domain; +} + +struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr, + uint32_t handle) +{ + struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); + struct radeon_libdrm_winsys *rws = mgr->rws; + struct radeon_drm_buffer *buf; + struct radeon_bo *bo; + + bo = radeon_bo_open(rws->bom, handle, 0, + 0, 0, 0); + if (bo == NULL) + return NULL; + + buf = CALLOC_STRUCT(radeon_drm_buffer); + if (!buf) { + radeon_bo_unref(bo); + return NULL; + } + + make_empty_list(buf); + + pipe_reference_init(&buf->base.base.reference, 1); + buf->base.base.alignment = 0; + buf->base.base.usage = PIPE_BUFFER_USAGE_PIXEL; + buf->base.base.size = 0; + buf->base.vtbl = &radeon_drm_buffer_vtbl; + buf->mgr = mgr; + + buf->bo = bo; + + // fprintf(stderr,"hand %p : %d\n", &buf->base, handle); + return &buf->base; + +} + +static struct pb_buffer * +radeon_drm_bufmgr_create_buffer(struct pb_manager *_mgr, + pb_size size, + const struct pb_desc *desc) +{ + struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); + struct radeon_libdrm_winsys *rws = mgr->rws; + struct radeon_drm_buffer *buf; + uint32_t domain; + + buf = CALLOC_STRUCT(radeon_drm_buffer); + if (!buf) + goto error1; + + pipe_reference_init(&buf->base.base.reference, 1); + buf->base.base.alignment = desc->alignment; + buf->base.base.usage = desc->usage; + buf->base.base.size = size; + buf->base.vtbl = &radeon_drm_buffer_vtbl; + buf->mgr = mgr; + + make_empty_list(buf); + domain = radeon_domain_from_usage(desc->usage); + buf->bo = radeon_bo_open(rws->bom, 0, size, + desc->alignment, domain, 0); + if (buf->bo == NULL) + goto error2; + + // fprintf(stderr,"%p : %d\n", &buf->base, size); + return &buf->base; + + error2: + FREE(buf); + error1: + return NULL; +} + +static void +radeon_drm_bufmgr_flush(struct pb_manager *mgr) +{ + /* NOP */ +} + +static void +radeon_drm_bufmgr_destroy(struct pb_manager *_mgr) +{ + struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); + FREE(mgr); +} + +struct pb_manager * +radeon_drm_bufmgr_create(struct radeon_libdrm_winsys *rws) +{ + struct radeon_drm_bufmgr *mgr; + + mgr = CALLOC_STRUCT(radeon_drm_bufmgr); + if (!mgr) + return NULL; + + mgr->base.destroy = radeon_drm_bufmgr_destroy; + mgr->base.create_buffer = radeon_drm_bufmgr_create_buffer; + mgr->base.flush = radeon_drm_bufmgr_flush; + + mgr->rws = rws; + make_empty_list(&mgr->buffer_map_list); + return &mgr->base; +} + +uint32_t radeon_drm_bufmgr_handle_from_buffer(struct pb_buffer *_buf) +{ + struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); + + return buf->bo->handle; +} + +boolean radeon_drm_bufmgr_shared_handle_from_buffer(struct pb_buffer *_buf, + uint32_t *handle) +{ + struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); + struct drm_gem_flink flink; + int retval, fd; + if (!buf->flinked) { + fd = buf->mgr->rws->fd; + flink.handle = buf->bo->handle; + + retval = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); + if (retval) { + return false; + } + + buf->flinked = TRUE; + buf->flink = flink.name; + } + *handle = buf->flink; + return TRUE; +} + +static struct radeon_drm_buffer *get_drm_buffer(struct pb_buffer *_buf) +{ + struct radeon_drm_buffer *buf; + if (_buf->vtbl == &radeon_drm_buffer_vtbl) { + buf = radeon_drm_buffer(_buf); + } else { + struct pb_buffer *base_buf; + pb_size offset; + pb_get_base_buffer(_buf, &base_buf, &offset); + + buf = radeon_drm_buffer(base_buf); + } + return buf; +} + +void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf, boolean microtiled, boolean macrotiled, uint32_t pitch) +{ + struct radeon_drm_buffer *buf = get_drm_buffer(_buf); + uint32_t flags = 0; + + if (microtiled) + flags |= RADEON_BO_FLAGS_MICRO_TILE; + if (macrotiled) + flags |= RADEON_BO_FLAGS_MACRO_TILE; + + radeon_bo_set_tiling(buf->bo, flags, pitch); + +} + +boolean radeon_drm_bufmgr_add_buffer(struct pb_buffer *_buf, + uint32_t rd, uint32_t wd) +{ + struct radeon_drm_buffer *buf = get_drm_buffer(_buf); + radeon_cs_space_add_persistent_bo(buf->mgr->rws->cs, buf->bo, + rd, wd); + + return true; +} + +void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf, + uint32_t rd, uint32_t wd, + uint32_t flags) +{ + struct radeon_drm_buffer *buf = get_drm_buffer(_buf); + int retval; + + retval = radeon_cs_write_reloc(buf->mgr->rws->cs, + buf->bo, rd, wd, flags); + if (retval) { + debug_printf("radeon: Relocation of %p (%d, %d, %d) failed!\n", + buf, rd, wd, flags); + } +} + +void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr) +{ + struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); + struct radeon_drm_buffer *rpb, *t_rpb; + + foreach_s(rpb, t_rpb, &mgr->buffer_map_list) { + rpb->mapped = 0; + radeon_bo_unmap(rpb->bo); + remove_from_list(rpb); + } + + make_empty_list(&mgr->buffer_map_list); + + +} diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index d759beaba1..997abb8f5c 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -22,29 +22,104 @@ #include "radeon_r300.h" -static void radeon_set_flush_cb(struct radeon_winsys *winsys, +static struct r300_winsys_buffer * +radeon_r300_winsys_buffer_create(struct r300_winsys_screen *rws, + unsigned alignment, + unsigned usage, + unsigned size) +{ + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + struct pb_desc desc; + struct pb_manager *provider; + struct pb_buffer *buffer; + + memset(&desc, 0, sizeof(desc)); + desc.alignment = alignment; + desc.usage = usage; + + if (usage == PIPE_BUFFER_USAGE_CONSTANT) + provider = ws->mman; + else if (usage == PIPE_BUFFER_USAGE_VERTEX || + usage == PIPE_BUFFER_USAGE_INDEX) + provider = ws->cman; + else + provider = ws->kman; + buffer = provider->create_buffer(provider, size, &desc); + if (!buffer) + return NULL; + + return radeon_libdrm_winsys_buffer(buffer); +} + +static void radeon_r300_winsys_buffer_destroy(struct r300_winsys_buffer *buf) +{ + struct pb_buffer *_buf = radeon_pb_buffer(buf); + + pb_destroy(_buf); +} +static void radeon_r300_winsys_buffer_set_tiling(struct r300_winsys_screen *rws, + struct r300_winsys_buffer *buf, + uint32_t pitch, + boolean microtiled, + boolean macrotiled) +{ + struct pb_buffer *_buf = radeon_pb_buffer(buf); + radeon_drm_bufmgr_set_tiling(_buf, microtiled, macrotiled, pitch); +} + +static void *radeon_r300_winsys_buffer_map(struct r300_winsys_screen *ws, + struct r300_winsys_buffer *buf, + unsigned usage) +{ + struct pb_buffer *_buf = radeon_pb_buffer(buf); + + return pb_map(_buf, 0); +} + +static void radeon_r300_winsys_buffer_unmap(struct r300_winsys_screen *ws, + struct r300_winsys_buffer *buf) +{ + struct pb_buffer *_buf = radeon_pb_buffer(buf); + + pb_unmap(_buf); +} + +static void radeon_r300_winsys_buffer_reference(struct r300_winsys_screen *rws, + struct r300_winsys_buffer **pdst, + struct r300_winsys_buffer *src) +{ + struct pb_buffer *_src = radeon_pb_buffer(src); + struct pb_buffer *_dst = radeon_pb_buffer(*pdst); + + pb_reference(&_dst, _src); + + *pdst = radeon_libdrm_winsys_buffer(_dst); +} + +static void radeon_set_flush_cb(struct r300_winsys_screen *rws, void (*flush_cb)(void *), void *data) { - winsys->priv->flush_cb = flush_cb; - winsys->priv->flush_data = data; - radeon_cs_space_set_flush(winsys->priv->cs, flush_cb, data); + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + ws->flush_cb = flush_cb; + ws->flush_data = data; + radeon_cs_space_set_flush(ws->cs, flush_cb, data); } -static boolean radeon_add_buffer(struct radeon_winsys* winsys, - struct pipe_buffer* pbuffer, +static boolean radeon_add_buffer(struct r300_winsys_screen *rws, + struct r300_winsys_buffer *buf, uint32_t rd, uint32_t wd) { - struct radeon_bo* bo = ((struct radeon_pipe_buffer*)pbuffer)->bo; + struct pb_buffer *_buf = radeon_pb_buffer(buf); - radeon_cs_space_add_persistent_bo(winsys->priv->cs, bo, rd, wd); - return TRUE; + return radeon_drm_bufmgr_add_buffer(_buf, rd, wd); } -static boolean radeon_validate(struct radeon_winsys* winsys) +static boolean radeon_validate(struct r300_winsys_screen *rws) { - if (radeon_cs_space_check(winsys->priv->cs) < 0) { + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + if (radeon_cs_space_check(ws->cs) < 0) { return FALSE; } @@ -52,108 +127,146 @@ static boolean radeon_validate(struct radeon_winsys* winsys) return TRUE; } -static boolean radeon_check_cs(struct radeon_winsys* winsys, int size) +static boolean radeon_check_cs(struct r300_winsys_screen *rws, int size) { - struct radeon_cs* cs = winsys->priv->cs; + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + struct radeon_cs *cs = ws->cs; - return radeon_validate(winsys) && cs->cdw + size <= cs->ndw; + return radeon_validate(rws) && cs->cdw + size <= cs->ndw; } -static void radeon_begin_cs(struct radeon_winsys* winsys, +static void radeon_begin_cs(struct r300_winsys_screen *rws, int size, const char* file, const char* function, int line) { - radeon_cs_begin(winsys->priv->cs, size, file, function, line); + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + radeon_cs_begin(ws->cs, size, file, function, line); } -static void radeon_write_cs_dword(struct radeon_winsys* winsys, +static void radeon_write_cs_dword(struct r300_winsys_screen *rws, uint32_t dword) { - radeon_cs_write_dword(winsys->priv->cs, dword); + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + radeon_cs_write_dword(ws->cs, dword); } -static void radeon_write_cs_reloc(struct radeon_winsys* winsys, - struct pipe_buffer* pbuffer, +static void radeon_write_cs_reloc(struct r300_winsys_screen *rws, + struct r300_winsys_buffer *buf, uint32_t rd, uint32_t wd, uint32_t flags) { - int retval = 0; - struct radeon_pipe_buffer* radeon_buffer = - (struct radeon_pipe_buffer*)pbuffer; - - assert(!radeon_buffer->pb); - - retval = radeon_cs_write_reloc(winsys->priv->cs, radeon_buffer->bo, - rd, wd, flags); - - if (retval) { - debug_printf("radeon: Relocation of %p (%d, %d, %d) failed!\n", - pbuffer, rd, wd, flags); - } + struct pb_buffer *_buf = radeon_pb_buffer(buf); + radeon_drm_bufmgr_write_reloc(_buf, rd, wd, flags); } -static void radeon_reset_bos(struct radeon_winsys *winsys) +static void radeon_reset_bos(struct r300_winsys_screen *rws) { - radeon_cs_space_reset_bos(winsys->priv->cs); + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + radeon_cs_space_reset_bos(ws->cs); } -static void radeon_end_cs(struct radeon_winsys* winsys, +static void radeon_end_cs(struct r300_winsys_screen *rws, const char* file, const char* function, int line) { - radeon_cs_end(winsys->priv->cs, file, function, line); + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); + radeon_cs_end(ws->cs, file, function, line); } -static void radeon_flush_cs(struct radeon_winsys* winsys) +static void radeon_flush_cs(struct r300_winsys_screen *rws) { + struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); int retval; /* Don't flush a zero-sized CS. */ - if (!winsys->priv->cs->cdw) { + if (!ws->cs->cdw) { return; } + radeon_drm_bufmgr_flush_maps(ws->kman); /* Emit the CS. */ - retval = radeon_cs_emit(winsys->priv->cs); + retval = radeon_cs_emit(ws->cs); if (retval) { debug_printf("radeon: Bad CS, dumping...\n"); - radeon_cs_print(winsys->priv->cs, stderr); + radeon_cs_print(ws->cs, stderr); } /* Reset CS. * Someday, when we care about performance, we should really find a way * to rotate between two or three CS objects so that the GPU can be * spinning through one CS while another one is being filled. */ - radeon_cs_erase(winsys->priv->cs); + radeon_cs_erase(ws->cs); +} + +static uint32_t radeon_get_value(struct r300_winsys_screen *rws, + enum r300_value_id id) +{ + struct radeon_libdrm_winsys *ws = (struct radeon_libdrm_winsys *)rws; + + switch(id) { + case R300_VID_PCI_ID: + return ws->pci_id; + case R300_VID_GB_PIPES: + return ws->gb_pipes; + case R300_VID_Z_PIPES: + return ws->z_pipes; + } + return 0; +} + +static void +radeon_winsys_destroy(struct r300_winsys_screen *rws) +{ + struct radeon_libdrm_winsys *ws = (struct radeon_libdrm_winsys *)rws; + radeon_cs_destroy(ws->cs); + + ws->cman->destroy(ws->cman); + ws->kman->destroy(ws->kman); + ws->mman->destroy(ws->mman); + + radeon_bo_manager_gem_dtor(ws->bom); + radeon_cs_manager_gem_dtor(ws->csm); } void -radeon_setup_winsys(int fd, struct radeon_winsys* winsys) +radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws) { - struct radeon_winsys_priv* priv = winsys->priv; + ws->csm = radeon_cs_manager_gem_ctor(fd); + + ws->bom = radeon_bo_manager_gem_ctor(fd); + ws->kman = radeon_drm_bufmgr_create(ws); - priv->csm = radeon_cs_manager_gem_ctor(fd); + ws->cman = pb_cache_manager_create(ws->kman, 100000); + ws->mman = pb_malloc_bufmgr_create(); /* Size limit on IBs is 64 kibibytes. */ - priv->cs = radeon_cs_create(priv->csm, 1024 * 64 / 4); - radeon_cs_set_limit(priv->cs, - RADEON_GEM_DOMAIN_GTT, winsys->gart_size); - radeon_cs_set_limit(priv->cs, - RADEON_GEM_DOMAIN_VRAM, winsys->vram_size); - - winsys->add_buffer = radeon_add_buffer; - winsys->validate = radeon_validate; - - winsys->check_cs = radeon_check_cs; - winsys->begin_cs = radeon_begin_cs; - winsys->write_cs_dword = radeon_write_cs_dword; - winsys->write_cs_reloc = radeon_write_cs_reloc; - winsys->end_cs = radeon_end_cs; - winsys->flush_cs = radeon_flush_cs; - winsys->reset_bos = radeon_reset_bos; - winsys->set_flush_cb = radeon_set_flush_cb; + ws->cs = radeon_cs_create(ws->csm, 1024 * 64 / 4); + radeon_cs_set_limit(ws->cs, + RADEON_GEM_DOMAIN_GTT, ws->gart_size); + radeon_cs_set_limit(ws->cs, + RADEON_GEM_DOMAIN_VRAM, ws->vram_size); + + ws->base.add_buffer = radeon_add_buffer; + ws->base.validate = radeon_validate; + ws->base.destroy = radeon_winsys_destroy; + ws->base.check_cs = radeon_check_cs; + ws->base.begin_cs = radeon_begin_cs; + ws->base.write_cs_dword = radeon_write_cs_dword; + ws->base.write_cs_reloc = radeon_write_cs_reloc; + ws->base.end_cs = radeon_end_cs; + ws->base.flush_cs = radeon_flush_cs; + ws->base.reset_bos = radeon_reset_bos; + ws->base.set_flush_cb = radeon_set_flush_cb; + ws->base.get_value = radeon_get_value; + + ws->base.buffer_create = radeon_r300_winsys_buffer_create; + ws->base.buffer_destroy = radeon_r300_winsys_buffer_destroy; + ws->base.buffer_set_tiling = radeon_r300_winsys_buffer_set_tiling; + ws->base.buffer_map = radeon_r300_winsys_buffer_map; + ws->base.buffer_unmap = radeon_r300_winsys_buffer_unmap; + ws->base.buffer_reference = radeon_r300_winsys_buffer_reference; } diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.h b/src/gallium/winsys/drm/radeon/core/radeon_r300.h index cfbdb30266..82a8aad715 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.h @@ -28,12 +28,12 @@ #include #include "drm.h" #include "radeon_drm.h" +#include "radeon_bo_gem.h" #include "radeon_cs_gem.h" -#include "r300_winsys.h" - +#include "radeon_winsys.h" #include "radeon_buffer.h" -void radeon_setup_winsys(int fd, struct radeon_winsys* winsys); +void radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* winsys); #endif /* RADEON_R300_H */ diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h index 4901080ca7..c8e725cff0 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h @@ -30,16 +30,17 @@ #ifndef RADEON_WINSYS_H #define RADEON_WINSYS_H -#include "util/u_simple_screen.h" +#include "r300_winsys.h" -struct radeon_winsys_priv; - -struct radeon_winsys { +struct radeon_libdrm_winsys { /* Parent class. */ - struct pipe_winsys base; + struct r300_winsys_screen base; + + struct pb_manager *kman; - /* Winsys private */ - struct radeon_winsys_priv* priv; + struct pb_manager *mman; + + struct pb_manager *cman; /* PCI ID */ uint32_t pci_id; @@ -56,56 +57,27 @@ struct radeon_winsys { /* VRAM size. */ uint32_t vram_size; - /* Add a pipe_buffer to the list of buffer objects to validate. */ - boolean (*add_buffer)(struct radeon_winsys* winsys, - struct pipe_buffer* pbuffer, - uint32_t rd, - uint32_t wd); - - /* Revalidate all currently setup pipe_buffers. - * Returns TRUE if a flush is required. */ - boolean (*validate)(struct radeon_winsys* winsys); - - /* Check to see if there's room for commands. */ - boolean (*check_cs)(struct radeon_winsys* winsys, int size); - - /* Start a command emit. */ - void (*begin_cs)(struct radeon_winsys* winsys, - int size, - const char* file, - const char* function, - int line); - - /* Write a dword to the command buffer. */ - void (*write_cs_dword)(struct radeon_winsys* winsys, uint32_t dword); - - /* Write a relocated dword to the command buffer. */ - void (*write_cs_reloc)(struct radeon_winsys* winsys, - struct pipe_buffer* bo, - uint32_t rd, - uint32_t wd, - uint32_t flags); - - /* Finish a command emit. */ - void (*end_cs)(struct radeon_winsys* winsys, - const char* file, - const char* function, - int line); - - /* Flush the CS. */ - void (*flush_cs)(struct radeon_winsys* winsys); - - /* winsys flush - callback from winsys when flush required */ - void (*set_flush_cb)(struct radeon_winsys *winsys, - void (*flush_cb)(void *), void *data); - - void (*reset_bos)(struct radeon_winsys *winsys); - - void (*buffer_set_tiling)(struct radeon_winsys* winsys, - struct pipe_buffer* buffer, - uint32_t pitch, - boolean microtiled, - boolean macrotiled); + /* DRM FD */ + int fd; + + /* Radeon BO manager. */ + struct radeon_bo_manager *bom; + + /* Radeon CS manager. */ + struct radeon_cs_manager *csm; + + /* Current CS. */ + struct radeon_cs *cs; + + /* Flush CB */ + void (*flush_cb)(void *); + void *flush_data; }; +static INLINE struct radeon_libdrm_winsys * +radeon_winsys_screen(struct r300_winsys_screen *base) +{ + return (struct radeon_libdrm_winsys *)base; +} + #endif -- cgit v1.2.3 From b14548ea32000459f4f0c4b49f3fa11d1ee9c003 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 22 Feb 2010 17:26:30 +1000 Subject: Revert "r300g: rebuild winsys/pipe buffer handling and add buffer map" This reverts commit fff5be8e7b4557c221f2425dcafc2e7cbbba76ba. Probably went too soon with this, dileX reported OA not working for him it works here fine, but the optimisations I wanted aren't working properly yet so I'll fix that now. Signed-off-by: Dave Airlie --- src/gallium/drivers/r300/Makefile | 1 - src/gallium/drivers/r300/r300_context.c | 38 +-- src/gallium/drivers/r300/r300_context.h | 9 +- src/gallium/drivers/r300/r300_cs.h | 22 +- src/gallium/drivers/r300/r300_emit.c | 54 ++- src/gallium/drivers/r300/r300_render.c | 33 +- src/gallium/drivers/r300/r300_screen.c | 38 +-- src/gallium/drivers/r300/r300_screen.h | 2 +- src/gallium/drivers/r300/r300_screen_buffer.c | 222 ------------- src/gallium/drivers/r300/r300_screen_buffer.h | 85 ----- src/gallium/drivers/r300/r300_state.c | 25 +- src/gallium/drivers/r300/r300_texture.c | 41 ++- src/gallium/drivers/r300/r300_texture.h | 4 +- src/gallium/drivers/r300/r300_winsys.h | 127 +------- src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h | 2 + src/gallium/winsys/drm/radeon/core/Makefile | 2 +- src/gallium/winsys/drm/radeon/core/radeon_buffer.h | 60 ++-- src/gallium/winsys/drm/radeon/core/radeon_drm.c | 134 +++++--- src/gallium/winsys/drm/radeon/core/radeon_drm.h | 5 + .../winsys/drm/radeon/core/radeon_drm_buffer.c | 361 --------------------- src/gallium/winsys/drm/radeon/core/radeon_r300.c | 237 ++++---------- src/gallium/winsys/drm/radeon/core/radeon_r300.h | 6 +- src/gallium/winsys/drm/radeon/core/radeon_winsys.h | 86 +++-- 23 files changed, 347 insertions(+), 1247 deletions(-) delete mode 100644 src/gallium/drivers/r300/r300_screen_buffer.c delete mode 100644 src/gallium/drivers/r300/r300_screen_buffer.h delete mode 100644 src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 5707309bdf..afddcb161f 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -14,7 +14,6 @@ C_SOURCES = \ r300_query.c \ r300_render.c \ r300_screen.c \ - r300_screen_buffer.c \ r300_state.c \ r300_state_derived.c \ r300_state_invariant.c \ diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index a8a6a07a84..f631b4ed27 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -24,7 +24,6 @@ #include "util/u_memory.h" #include "util/u_simple_list.h" -#include "util/u_upload_mgr.h" #include "r300_blit.h" #include "r300_context.h" @@ -55,9 +54,6 @@ static void r300_destroy_context(struct pipe_context* context) FREE(query); } - u_upload_destroy(r300->upload_vb); - u_upload_destroy(r300->upload_ib); - FREE(r300->blend_color_state.state); FREE(r300->clip_state.state); FREE(r300->fb_state.state); @@ -74,7 +70,11 @@ r300_is_texture_referenced(struct pipe_context *pipe, struct pipe_texture *texture, unsigned face, unsigned level) { - return 0; + struct pipe_buffer* buf = 0; + + r300_get_texture_buffer(pipe->screen, texture, &buf, NULL); + + return pipe->is_buffer_referenced(pipe, buf); } static unsigned int @@ -136,14 +136,14 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, { struct r300_context* r300 = CALLOC_STRUCT(r300_context); struct r300_screen* r300screen = r300_screen(screen); - struct r300_winsys_screen *rws = r300screen->rws; + struct radeon_winsys* radeon_winsys = r300screen->radeon_winsys; if (!r300) return NULL; - r300->rws = rws; + r300->winsys = radeon_winsys; - r300->context.winsys = (struct pipe_winsys*)rws; + r300->context.winsys = (struct pipe_winsys*)radeon_winsys; r300->context.screen = screen; r300->context.priv = priv; @@ -201,31 +201,11 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->invariant_state.dirty = TRUE; - rws->set_flush_cb(r300->rws, r300_flush_cb, r300); + r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300); r300->dirty_state = R300_NEW_KITCHEN_SINK; r300->dirty_hw++; r300->blitter = util_blitter_create(&r300->context); - r300->upload_ib = u_upload_create(screen, - 32 * 1024, 16, - PIPE_BUFFER_USAGE_INDEX); - - if (r300->upload_ib == NULL) - goto no_upload_ib; - - r300->upload_vb = u_upload_create(screen, - 128 * 1024, 16, - PIPE_BUFFER_USAGE_VERTEX); - if (r300->upload_vb == NULL) - goto no_upload_vb; - return &r300->context; - - // u_upload_destroy(r300->upload_vb); - no_upload_ib: - u_upload_destroy(r300->upload_ib); - no_upload_vb: - FREE(r300); - return NULL; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 749bac0498..443af4ec2e 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -32,7 +32,6 @@ #include "r300_screen.h" -struct u_upload_mgr; struct r300_context; struct r300_fragment_shader; @@ -239,7 +238,7 @@ struct r300_texture { boolean is_npot; /* Pipe buffer backing this texture. */ - struct r300_winsys_buffer *buffer; + struct pipe_buffer* buffer; /* Registers carrying texture format data. */ struct r300_texture_state state; @@ -266,7 +265,7 @@ struct r300_context { struct pipe_context context; /* The interface to the windowing system, etc. */ - struct r300_winsys_screen *rws; + struct radeon_winsys* winsys; /* Draw module. Used mostly for SW TCL. */ struct draw_context* draw; /* Accelerated blit support. */ @@ -331,7 +330,6 @@ struct r300_context { /* Vertex elements for Gallium. */ struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; int vertex_element_count; - bool any_user_vbs; struct pipe_stencil_ref stencil_ref; @@ -345,9 +343,6 @@ struct r300_context { boolean polygon_offset_enabled; /* Z buffer bit depth. */ uint32_t zbuffer_bpp; - - struct u_upload_mgr *upload_vb; - struct u_upload_mgr *upload_ib; }; /* Convenience cast wrapper. */ diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index ad07efbffd..151f72b0fe 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -51,7 +51,7 @@ #define CS_LOCALS(context) \ struct r300_context* const cs_context_copy = (context); \ - struct r300_winsys_screen *cs_winsys = cs_context_copy->rws; \ + struct radeon_winsys* cs_winsys = cs_context_copy->winsys; \ int cs_count = 0; (void) cs_count; #define CHECK_CS(size) \ @@ -105,34 +105,22 @@ cs_count--; \ } while (0) -#define OUT_CS_BUF_RELOC(bo, offset, rd, wd, flags) do { \ +#define OUT_CS_RELOC(bo, offset, rd, wd, flags) do { \ DBG(cs_context_copy, DBG_CS, "r300: writing relocation for buffer %p, offset %d, " \ "domains (%d, %d, %d)\n", \ bo, offset, rd, wd, flags); \ assert(bo); \ cs_winsys->write_cs_dword(cs_winsys, offset); \ - r300_buffer_write_reloc(cs_winsys, r300_buffer(bo), rd, wd, flags); \ - cs_count -= 3; \ -} while (0) - - -#define OUT_CS_TEX_RELOC(tex, offset, rd, wd, flags) do { \ - DBG(cs_context_copy, DBG_CS, "r300: writing relocation for texture %p, offset %d, " \ - "domains (%d, %d, %d)\n", \ - tex, offset, rd, wd, flags); \ - assert(tex); \ - cs_winsys->write_cs_dword(cs_winsys, offset); \ - r300_texture_write_reloc(cs_winsys, tex, rd, wd, flags); \ + cs_winsys->write_cs_reloc(cs_winsys, bo, rd, wd, flags); \ cs_count -= 3; \ } while (0) - -#define OUT_CS_BUF_RELOC_NO_OFFSET(bo, rd, wd, flags) do { \ +#define OUT_CS_RELOC_NO_OFFSET(bo, rd, wd, flags) do { \ DBG(cs_context_copy, DBG_CS, "r300: writing relocation for buffer %p, " \ "domains (%d, %d, %d)\n", \ bo, rd, wd, flags); \ assert(bo); \ - r300_buffer_write_reloc(cs_winsys, r300_buffer(bo), rd, wd, flags); \ + cs_winsys->write_cs_reloc(cs_winsys, bo, rd, wd, flags); \ cs_count -= 2; \ } while (0) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 6fb1d7bd92..f7dcd8dc52 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -32,8 +32,6 @@ #include "r300_emit.h" #include "r300_fs.h" #include "r300_screen.h" -#include "r300_screen_buffer.h" -#include "r300_state_inlines.h" #include "r300_vs.h" void r300_emit_blend_state(struct r300_context* r300, void* state) @@ -420,10 +418,10 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) assert(tex && tex->buffer && "cbuf is marked, but NULL!"); OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1); - OUT_CS_TEX_RELOC(tex, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_CS_RELOC(tex->buffer, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_CS_REG_SEQ(R300_RB3D_COLORPITCH0 + (4 * i), 1); - OUT_CS_TEX_RELOC(tex, tex->fb_state.colorpitch[surf->level], + OUT_CS_RELOC(tex->buffer, tex->fb_state.colorpitch[surf->level], 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), tex->fb_state.us_out_fmt); @@ -436,12 +434,12 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) assert(tex && tex->buffer && "zsbuf is marked, but NULL!"); OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1); - OUT_CS_TEX_RELOC(tex, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_CS_RELOC(tex->buffer, surf->offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); OUT_CS_REG(R300_ZB_FORMAT, tex->fb_state.zb_format); OUT_CS_REG_SEQ(R300_ZB_DEPTHPITCH, 1); - OUT_CS_TEX_RELOC(tex, tex->fb_state.depthpitch[surf->level], + OUT_CS_RELOC(tex->buffer, tex->fb_state.depthpitch[surf->level], 0, RADEON_GEM_DOMAIN_VRAM, 0); } @@ -491,13 +489,13 @@ static void r300_emit_query_finish(struct r300_context *r300, /* pipe 3 only */ OUT_CS_REG(R300_SU_REG_DEST, 1 << 3); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 3), + OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 3), 0, RADEON_GEM_DOMAIN_GTT, 0); case 3: /* pipe 2 only */ OUT_CS_REG(R300_SU_REG_DEST, 1 << 2); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 2), + OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 2), 0, RADEON_GEM_DOMAIN_GTT, 0); case 2: /* pipe 1 only */ @@ -505,13 +503,13 @@ static void r300_emit_query_finish(struct r300_context *r300, OUT_CS_REG(R300_SU_REG_DEST, 1 << (caps->high_second_pipe ? 3 : 1)); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 1), + OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 1), 0, RADEON_GEM_DOMAIN_GTT, 0); case 1: /* pipe 0 only */ OUT_CS_REG(R300_SU_REG_DEST, 1 << 0); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_BUF_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 0), + OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 0), 0, RADEON_GEM_DOMAIN_GTT, 0); break; default: @@ -533,7 +531,7 @@ static void rv530_emit_query_single(struct r300_context *r300, BEGIN_CS(8); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_0); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_BUF_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); + OUT_CS_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL); END_CS; } @@ -546,10 +544,10 @@ static void rv530_emit_query_double(struct r300_context *r300, BEGIN_CS(14); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_0); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_BUF_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); + OUT_CS_RELOC(r300->oqbo, query->offset, 0, RADEON_GEM_DOMAIN_GTT, 0); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_1); OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1); - OUT_CS_BUF_RELOC(r300->oqbo, query->offset + sizeof(uint32_t), 0, RADEON_GEM_DOMAIN_GTT, 0); + OUT_CS_RELOC(r300->oqbo, query->offset + sizeof(uint32_t), 0, RADEON_GEM_DOMAIN_GTT, 0); OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL); END_CS; } @@ -761,7 +759,7 @@ void r300_emit_texture(struct r300_context* r300, OUT_CS_REG(R300_TX_FORMAT1_0 + (offset * 4), tex->state.format1); OUT_CS_REG(R300_TX_FORMAT2_0 + (offset * 4), tex->state.format2); OUT_CS_REG_SEQ(R300_TX_OFFSET_0 + (offset * 4), 1); - OUT_CS_TEX_RELOC(tex, + OUT_CS_RELOC(tex->buffer, R300_TXO_MACRO_TILE(tex->macrotile) | R300_TXO_MICRO_TILE(tex->microtile), RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0, 0); @@ -802,7 +800,7 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) } for (i = 0; i < aos_count; i++) { - OUT_CS_BUF_RELOC_NO_OFFSET(vbuf[velem[i].vertex_buffer_index].buffer, + OUT_CS_RELOC_NO_OFFSET(vbuf[velem[i].vertex_buffer_index].buffer, RADEON_GEM_DOMAIN_GTT, 0, 0); } END_CS; @@ -1014,15 +1012,15 @@ void r300_emit_buffer_validate(struct r300_context *r300) boolean invalid = FALSE; /* Clean out BOs. */ - r300->rws->reset_bos(r300->rws); + r300->winsys->reset_bos(r300->winsys); validate: /* Color buffers... */ for (i = 0; i < fb->nr_cbufs; i++) { tex = (struct r300_texture*)fb->cbufs[i]->texture; assert(tex && tex->buffer && "cbuf is marked, but NULL!"); - if (!r300_add_texture(r300->rws, tex, - 0, RADEON_GEM_DOMAIN_VRAM)) { + if (!r300->winsys->add_buffer(r300->winsys, tex->buffer, + 0, RADEON_GEM_DOMAIN_VRAM)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } @@ -1031,8 +1029,8 @@ validate: if (fb->zsbuf) { tex = (struct r300_texture*)fb->zsbuf->texture; assert(tex && tex->buffer && "zsbuf is marked, but NULL!"); - if (!r300_add_texture(r300->rws, tex, - 0, RADEON_GEM_DOMAIN_VRAM)) { + if (!r300->winsys->add_buffer(r300->winsys, tex->buffer, + 0, RADEON_GEM_DOMAIN_VRAM)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } @@ -1042,31 +1040,31 @@ validate: tex = r300->textures[i]; if (!tex) continue; - if (!r300_add_texture(r300->rws, tex, - RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0)) { + if (!r300->winsys->add_buffer(r300->winsys, tex->buffer, + RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } /* ...occlusion query buffer... */ if (r300->dirty_state & R300_NEW_QUERY) { - if (!r300_add_buffer(r300->rws, r300->oqbo, - 0, RADEON_GEM_DOMAIN_GTT)) { + if (!r300->winsys->add_buffer(r300->winsys, r300->oqbo, + 0, RADEON_GEM_DOMAIN_GTT)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } /* ...and vertex buffer. */ if (r300->vbo) { - if (!r300_add_buffer(r300->rws, r300->vbo, - RADEON_GEM_DOMAIN_GTT, 0)) { + if (!r300->winsys->add_buffer(r300->winsys, r300->vbo, + RADEON_GEM_DOMAIN_GTT, 0)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } else { /* debug_printf("No VBO while emitting dirty state!\n"); */ } - if (!r300->rws->validate(r300->rws)) { + if (!r300->winsys->validate(r300->winsys)) { r300->context.flush(&r300->context, 0, NULL); if (invalid) { /* Well, hell. */ @@ -1098,7 +1096,7 @@ void r300_emit_dirty_state(struct r300_context* r300) /* Make sure we have at least 2*1024 spare dwords. */ /* XXX It would be nice to know the number of dwords we really need to * XXX emit. */ - while (!r300->rws->check_cs(r300->rws, dwords)) { + while (!r300->winsys->check_cs(r300->winsys, dwords)) { r300->context.flush(&r300->context, 0, NULL); } diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 47f5d6f7f1..754eb4dc76 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -30,12 +30,10 @@ #include "util/u_format.h" #include "util/u_memory.h" -#include "util/u_upload_mgr.h" #include "util/u_prim.h" #include "r300_cs.h" #include "r300_context.h" -#include "r300_screen_buffer.h" #include "r300_emit.h" #include "r300_reg.h" #include "r300_render.h" @@ -299,7 +297,7 @@ static void r300_emit_draw_elements(struct r300_context *r300, OUT_CS(R300_INDX_BUFFER_ONE_REG_WR | (R300_VAP_PORT_IDX0 >> 2) | (0 << R300_INDX_BUFFER_SKIP_SHIFT)); OUT_CS(offset_dwords << 2); - OUT_CS_BUF_RELOC(indexBuffer, count_dwords, + OUT_CS_RELOC(indexBuffer, count_dwords, RADEON_GEM_DOMAIN_GTT, 0, 0); END_CS; @@ -310,28 +308,21 @@ static boolean r300_setup_vertex_buffers(struct r300_context *r300) struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; struct pipe_vertex_element *velem = r300->vertex_element; struct pipe_buffer *pbuf; - int ret; - - /* upload buffers first */ - if (r300->any_user_vbs) { - ret = r300_upload_user_buffers(r300); - r300->any_user_vbs = false; - } validate: for (int i = 0; i < r300->vertex_element_count; i++) { pbuf = vbuf[velem[i].vertex_buffer_index].buffer; - if (!r300_add_buffer(r300->rws, pbuf, - RADEON_GEM_DOMAIN_GTT, 0)) { + if (!r300->winsys->add_buffer(r300->winsys, pbuf, + RADEON_GEM_DOMAIN_GTT, 0)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } } - if (!r300->rws->validate(r300->rws)) { + if (!r300->winsys->validate(r300->winsys)) { r300->context.flush(&r300->context, 0, NULL); - return r300->rws->validate(r300->rws); + return r300->winsys->validate(r300->winsys); } return TRUE; @@ -405,20 +396,15 @@ void r300_draw_range_elements(struct pipe_context* pipe, indexSize = 2; } - r300_upload_index_buffer(r300, &indexBuffer, - indexSize, start, count); - - if (!r300_add_buffer(r300->rws, indexBuffer, - RADEON_GEM_DOMAIN_GTT, 0)) { + if (!r300->winsys->add_buffer(r300->winsys, indexBuffer, + RADEON_GEM_DOMAIN_GTT, 0)) { goto cleanup; } - if (!r300->rws->validate(r300->rws)) { + if (!r300->winsys->validate(r300->winsys)) { goto cleanup; } - u_upload_flush(r300->upload_vb); - u_upload_flush(r300->upload_ib); r300_emit_dirty_state(r300); r300_emit_aos(r300, 0); @@ -439,7 +425,7 @@ void r300_draw_range_elements(struct pipe_context* pipe, cleanup: if (indexBuffer != orgIndexBuffer) { - pipe_buffer_reference( &indexBuffer, NULL ); + pipe->screen->buffer_destroy(indexBuffer); } } @@ -480,7 +466,6 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, return; } - u_upload_flush(r300->upload_vb); r300_emit_dirty_state(r300); if (alt_num_verts || count <= 65535) { diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 3b70312c82..6a55570571 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -23,6 +23,7 @@ #include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" +#include "util/u_simple_screen.h" #include "r300_context.h" #include "r300_screen.h" @@ -31,8 +32,6 @@ #include "radeon_winsys.h" #include "r300_winsys.h" -#include "r300_screen_buffer.h" - /* Return the identifier behind whom the brave coders responsible for this * amalgamation of code, sweat, and duct tape, routinely obscure their names. * @@ -293,11 +292,10 @@ static void* r300_transfer_map(struct pipe_screen* screen, struct pipe_transfer* transfer) { struct r300_texture* tex = (struct r300_texture*)transfer->texture; - struct r300_winsys_screen *rws = r300_winsys_screen(screen); char* map; enum pipe_format format = tex->tex.format; - map = rws->buffer_map(rws, tex->buffer, + map = pipe_buffer_map(screen, tex->buffer, pipe_transfer_buffer_flags(transfer)); if (!map) { @@ -313,26 +311,21 @@ static void r300_transfer_unmap(struct pipe_screen* screen, struct pipe_transfer* transfer) { struct r300_texture* tex = (struct r300_texture*)transfer->texture; - struct r300_winsys_screen *rws = r300_winsys_screen(screen); - rws->buffer_unmap(rws, tex->buffer); + pipe_buffer_unmap(screen, tex->buffer); } static void r300_destroy_screen(struct pipe_screen* pscreen) { struct r300_screen* r300screen = r300_screen(pscreen); - struct r300_winsys_screen *rws = r300_winsys_screen(pscreen); - - if (rws) - rws->destroy(rws); FREE(r300screen->caps); FREE(r300screen); } -struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws) +struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys) { - struct r300_screen *r300screen = CALLOC_STRUCT(r300_screen); - struct r300_capabilities *caps = CALLOC_STRUCT(r300_capabilities); + struct r300_screen* r300screen = CALLOC_STRUCT(r300_screen); + struct r300_capabilities* caps = CALLOC_STRUCT(r300_capabilities); if (!r300screen || !caps) { FREE(r300screen); @@ -340,16 +333,16 @@ struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws) return NULL; } - caps->pci_id = rws->get_value(rws, R300_VID_PCI_ID); - caps->num_frag_pipes = rws->get_value(rws, R300_VID_GB_PIPES); - caps->num_z_pipes = rws->get_value(rws, R300_VID_Z_PIPES); + caps->pci_id = radeon_winsys->pci_id; + caps->num_frag_pipes = radeon_winsys->gb_pipes; + caps->num_z_pipes = radeon_winsys->z_pipes; r300_init_debug(r300screen); r300_parse_chipset(caps); r300screen->caps = caps; - r300screen->rws = rws; - r300screen->screen.winsys = (struct pipe_winsys*)rws; + r300screen->radeon_winsys = radeon_winsys; + r300screen->screen.winsys = (struct pipe_winsys*)radeon_winsys; r300screen->screen.destroy = r300_destroy_screen; r300screen->screen.get_name = r300_get_name; r300screen->screen.get_vendor = r300_get_vendor; @@ -363,12 +356,7 @@ struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws) r300screen->screen.transfer_unmap = r300_transfer_unmap; r300_init_screen_texture_functions(&r300screen->screen); - r300_screen_init_buffer_functions(r300screen); - return &r300screen->screen; -} + u_simple_screen_init(&r300screen->screen); -struct r300_winsys_screen * -r300_winsys_screen(struct pipe_screen *screen) -{ - return r300_screen(screen)->rws; + return &r300screen->screen; } diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index 87fc6190ce..502fbfa5a2 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -33,7 +33,7 @@ struct r300_screen { /* Parent class */ struct pipe_screen screen; - struct r300_winsys_screen *rws; + struct radeon_winsys* radeon_winsys; /* Chipset capabilities */ struct r300_capabilities* caps; diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c deleted file mode 100644 index 358582ea21..0000000000 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ /dev/null @@ -1,222 +0,0 @@ -#include - -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_memory.h" -#include "util/u_upload_mgr.h" - -#include "r300_screen_buffer.h" - -#include "r300_winsys.h" - -int r300_upload_index_buffer(struct r300_context *r300, - struct pipe_buffer **index_buffer, - unsigned index_size, - unsigned start, - unsigned count) -{ - struct pipe_buffer *upload_buffer = NULL; - unsigned index_offset = start * index_size; - int ret = 0; - - if (r300_buffer_is_user_buffer(*index_buffer)) { - ret = u_upload_buffer(r300->upload_ib, - index_offset, - count * index_size, - *index_buffer, - &index_offset, - &upload_buffer); - if (ret) { - goto done; - } - *index_buffer = upload_buffer; - } - done: - // if (upload_buffer) - // pipe_buffer_reference(&upload_buffer, NULL); - return ret; -} - -int r300_upload_user_buffers(struct r300_context *r300) -{ - enum pipe_error ret = PIPE_OK; - int i, nr; - - nr = r300->vertex_buffer_count; - - for (i = 0; i < nr; i++) { - - if (r300_buffer_is_user_buffer(r300->vertex_buffer[i].buffer)) { - struct pipe_buffer *upload_buffer = NULL; - unsigned offset = 0; - unsigned size = r300->vertex_buffer[i].buffer->size; - unsigned upload_offset; - - ret = u_upload_buffer(r300->upload_vb, - offset, size, - r300->vertex_buffer[i].buffer, - &upload_offset, &upload_buffer); - if (ret) - return ret; - - pipe_buffer_reference(&r300->vertex_buffer[i].buffer, NULL); - r300->vertex_buffer[i].buffer = upload_buffer; - r300->vertex_buffer[i].buffer_offset = upload_offset; - } - } - return ret; -} - -static struct r300_winsys_buffer * -r300_winsys_buffer_create(struct r300_screen *r300screen, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct r300_winsys_screen *rws = r300screen->rws; - struct r300_winsys_buffer *buf; - - buf = rws->buffer_create(rws, alignment, usage, size); - return buf; -} - -static void r300_winsys_buffer_destroy(struct r300_screen *r300screen, - struct r300_buffer *rbuf) -{ - struct r300_winsys_screen *rws = r300screen->rws; - - if (rbuf->buf) { - rws->buffer_destroy(rbuf->buf); - rbuf->buf = NULL; - } -} - -static struct pipe_buffer *r300_buffer_create(struct pipe_screen *screen, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct r300_screen *r300screen = r300_screen(screen); - struct r300_buffer *rbuf; - - rbuf = CALLOC_STRUCT(r300_buffer); - if (!rbuf) - goto error1; - - rbuf->magic = R300_BUFFER_MAGIC; - - pipe_reference_init(&rbuf->base.reference, 1); - rbuf->base.screen = screen; - rbuf->base.alignment = alignment; - rbuf->base.usage = usage; - rbuf->base.size = size; - - rbuf->buf = r300_winsys_buffer_create(r300screen, - alignment, - usage, - size); - - if (!rbuf->buf) - goto error2; - - return &rbuf->base; -error2: - FREE(rbuf); -error1: - return NULL; -} - - -static struct pipe_buffer *r300_user_buffer_create(struct pipe_screen *screen, - void *ptr, - unsigned bytes) -{ - struct r300_buffer *rbuf; - - rbuf = CALLOC_STRUCT(r300_buffer); - if (!rbuf) - goto no_rbuf; - - rbuf->magic = R300_BUFFER_MAGIC; - - pipe_reference_init(&rbuf->base.reference, 1); - rbuf->base.screen = screen; - rbuf->base.alignment = 1; - rbuf->base.usage = 0; - rbuf->base.size = bytes; - - rbuf->user_buffer = ptr; - return &rbuf->base; - -no_rbuf: - return NULL; -} - -static void r300_buffer_destroy(struct pipe_buffer *buf) -{ - struct r300_screen *r300screen = r300_screen(buf->screen); - struct r300_buffer *rbuf = r300_buffer(buf); - - r300_winsys_buffer_destroy(r300screen, rbuf); - FREE(rbuf); -} - -static void * -r300_buffer_map_range(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned offset, unsigned length, - unsigned usage ) -{ - struct r300_screen *r300screen = r300_screen(screen); - struct r300_winsys_screen *rws = r300screen->rws; - struct r300_buffer *rbuf = r300_buffer(buf); - void *map; - - if (rbuf->user_buffer) - return rbuf->user_buffer; - - map = rws->buffer_map(rws, rbuf->buf, usage); - - return map; -} - -static void * -r300_buffer_map(struct pipe_screen *screen, - struct pipe_buffer *buf, - unsigned usage) -{ - struct r300_screen *r300screen = r300_screen(screen); - struct r300_winsys_screen *rws = r300screen->rws; - struct r300_buffer *rbuf = r300_buffer(buf); - void *map; - - if (rbuf->user_buffer) - return rbuf->user_buffer; - - map = rws->buffer_map(rws, rbuf->buf, usage); - - return map; -} - -static void -r300_buffer_unmap(struct pipe_screen *screen, - struct pipe_buffer *buf) -{ - struct r300_screen *r300screen = r300_screen(screen); - struct r300_winsys_screen *rws = r300screen->rws; - struct r300_buffer *rbuf = r300_buffer(buf); - - if (rbuf->buf) - rws->buffer_unmap(rws, rbuf->buf); -} - -void r300_screen_init_buffer_functions(struct r300_screen *r300screen) -{ - r300screen->screen.buffer_create = r300_buffer_create; - r300screen->screen.user_buffer_create = r300_user_buffer_create; - r300screen->screen.buffer_map = r300_buffer_map; - r300screen->screen.buffer_map_range = r300_buffer_map_range; -// r300screen->screen.buffer_flush_mapped_range = r300_buffer_flush_mapped_range; - r300screen->screen.buffer_unmap = r300_buffer_unmap; - r300screen->screen.buffer_destroy = r300_buffer_destroy; -} diff --git a/src/gallium/drivers/r300/r300_screen_buffer.h b/src/gallium/drivers/r300/r300_screen_buffer.h deleted file mode 100644 index 7c026508b5..0000000000 --- a/src/gallium/drivers/r300/r300_screen_buffer.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef R300_SCREEN_BUFFER_H -#define R300_SCREEN_BUFFER_H -#include "pipe/p_compiler.h" -#include "pipe/p_state.h" -#include "r300_screen.h" - -#include "r300_winsys.h" -#include "r300_context.h" - -#define R300_BUFFER_MAGIC 0xabcd1234 - -struct r300_buffer -{ - struct pipe_buffer base; - - uint32_t magic; - - struct r300_winsys_buffer *buf; - - void *user_buffer; -}; - -static INLINE struct r300_buffer * -r300_buffer(struct pipe_buffer *buffer) -{ - if (buffer) { - assert(((struct r300_buffer *)buffer)->magic == R300_BUFFER_MAGIC); - return (struct r300_buffer *)buffer; - } - return NULL; -} - -static INLINE boolean -r300_buffer_is_user_buffer(struct pipe_buffer *buffer) -{ - return r300_buffer(buffer)->user_buffer ? true : false; -} - -static INLINE boolean r300_add_buffer(struct r300_winsys_screen *rws, - struct pipe_buffer *buffer, - int rd, int wr) -{ - struct r300_buffer *buf = r300_buffer(buffer); - - if (!buf->buf) - return true; - - return rws->add_buffer(rws, buf->buf, rd, wr); -} - - -static INLINE boolean r300_add_texture(struct r300_winsys_screen *rws, - struct r300_texture *tex, - int rd, int wr) -{ - return rws->add_buffer(rws, tex->buffer, rd, wr); -} - -void r300_screen_init_buffer_functions(struct r300_screen *r300screen); - -static INLINE void r300_buffer_write_reloc(struct r300_winsys_screen *rws, - struct r300_buffer *buf, - uint32_t rd, uint32_t wd, uint32_t flags) -{ - if (!buf->buf) - return; - - rws->write_cs_reloc(rws, buf->buf, rd, wd, flags); -} - -static INLINE void r300_texture_write_reloc(struct r300_winsys_screen *rws, - struct r300_texture *texture, - uint32_t rd, uint32_t wd, uint32_t flags) -{ - rws->write_cs_reloc(rws, texture->buffer, rd, wd, flags); -} - -int r300_upload_user_buffers(struct r300_context *r300); - -int r300_upload_index_buffer(struct r300_context *r300, - struct pipe_buffer **index_buffer, - unsigned index_size, - unsigned start, - unsigned count); -#endif diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index d8a87dec15..34bf81c193 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -34,7 +34,6 @@ #include "r300_context.h" #include "r300_reg.h" #include "r300_screen.h" -#include "r300_screen_buffer.h" #include "r300_state_inlines.h" #include "r300_fs.h" #include "r300_vs.h" @@ -522,7 +521,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)old_state->cbufs[i]->texture; if (tex) { - r300->rws->buffer_set_tiling(r300->rws, tex->buffer, + r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, tex->pitch[0], tex->microtile != 0, tex->macrotile != 0); @@ -534,7 +533,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)old_state->zsbuf->texture; if (tex) { - r300->rws->buffer_set_tiling(r300->rws, tex->buffer, + r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, tex->pitch[0], tex->microtile != 0, tex->macrotile != 0); @@ -546,7 +545,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)new_state->cbufs[i]->texture; level = new_state->cbufs[i]->level; - r300->rws->buffer_set_tiling(r300->rws, tex->buffer, + r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, tex->pitch[level], tex->microtile != 0, tex->mip_macrotile[level] != 0); @@ -555,7 +554,7 @@ static void r300_fb_update_tiling_flags(struct r300_context *r300, tex = (struct r300_texture*)new_state->zsbuf->texture; level = new_state->zsbuf->level; - r300->rws->buffer_set_tiling(r300->rws, tex->buffer, + r300->winsys->buffer_set_tiling(r300->winsys, tex->buffer, tex->pitch[level], tex->microtile != 0, tex->mip_macrotile[level] != 0); @@ -1029,26 +1028,10 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, const struct pipe_vertex_buffer* buffers) { struct r300_context* r300 = r300_context(pipe); - boolean any_user_buffer = false; - int i; - - if (count == r300->vertex_buffer_count && - memcmp(r300->vertex_buffer, buffers, count * sizeof(buffers[0])) == 0) - return; - - for (i = 0; i < count; i++) { - pipe_buffer_reference(&r300->vertex_buffer[i].buffer, buffers[i].buffer); - if (r300_buffer_is_user_buffer(buffers[i].buffer)) - any_user_buffer = true; - } - - for ( ; i < r300->vertex_buffer_count; i++) - pipe_buffer_reference(&r300->vertex_buffer[i].buffer, NULL); memcpy(r300->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count); r300->vertex_buffer_count = count; - r300->any_user_vbs = any_user_buffer; if (r300->draw) { draw_flush(r300->draw); diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 9016e86ccd..ed2be06254 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -731,7 +731,7 @@ static struct pipe_texture* { struct r300_texture* tex = CALLOC_STRUCT(r300_texture); struct r300_screen* rscreen = r300_screen(screen); - struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys; + struct radeon_winsys* winsys = (struct radeon_winsys*)screen->winsys; if (!tex) { return NULL; @@ -745,13 +745,13 @@ static struct pipe_texture* r300_setup_miptree(rscreen, tex); r300_setup_texture_state(rscreen, tex); - tex->buffer = rws->buffer_create(rws, 2048, - PIPE_BUFFER_USAGE_PIXEL, - tex->size); - rws->buffer_set_tiling(rws, tex->buffer, - tex->pitch[0], - tex->microtile != R300_BUFFER_LINEAR, - tex->macrotile != R300_BUFFER_LINEAR); + tex->buffer = screen->buffer_create(screen, 2048, + PIPE_BUFFER_USAGE_PIXEL, + tex->size); + winsys->buffer_set_tiling(winsys, tex->buffer, + tex->pitch[0], + tex->microtile != R300_BUFFER_LINEAR, + tex->macrotile != R300_BUFFER_LINEAR); if (!tex->buffer) { FREE(tex); @@ -764,9 +764,9 @@ static struct pipe_texture* static void r300_texture_destroy(struct pipe_texture* texture) { struct r300_texture* tex = (struct r300_texture*)texture; - struct r300_winsys_screen *rws = (struct r300_winsys_screen *)texture->screen->winsys; - rws->buffer_reference(rws, &tex->buffer, NULL); + pipe_buffer_reference(&tex->buffer, NULL); + FREE(tex); } @@ -806,14 +806,14 @@ static void r300_tex_surface_destroy(struct pipe_surface* s) FREE(s); } -struct pipe_texture *r300_texture_blanket_winsys_buffer(struct pipe_screen *screen, - const struct pipe_texture *base, - const unsigned *stride, - struct r300_winsys_buffer *buffer) +static struct pipe_texture* + r300_texture_blanket(struct pipe_screen* screen, + const struct pipe_texture* base, + const unsigned* stride, + struct pipe_buffer* buffer) { struct r300_texture* tex; struct r300_screen* rscreen = r300_screen(screen); - struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys; /* Support only 2D textures without mipmaps */ if (base->target != PIPE_TEXTURE_2D || @@ -837,7 +837,7 @@ struct pipe_texture *r300_texture_blanket_winsys_buffer(struct pipe_screen *scre r300_setup_flags(tex); r300_setup_texture_state(rscreen, tex); - rws->buffer_reference(rws, &tex->buffer, buffer); + pipe_buffer_reference(&tex->buffer, buffer); return (struct pipe_texture*)tex; } @@ -896,6 +896,7 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen) screen->texture_destroy = r300_texture_destroy; screen->get_tex_surface = r300_get_tex_surface; screen->tex_surface_destroy = r300_tex_surface_destroy; + screen->texture_blanket = r300_texture_blanket; screen->video_surface_create = r300_video_surface_create; screen->video_surface_destroy= r300_video_surface_destroy; @@ -903,23 +904,19 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen) boolean r300_get_texture_buffer(struct pipe_screen* screen, struct pipe_texture* texture, - struct r300_winsys_buffer** buffer, + struct pipe_buffer** buffer, unsigned* stride) { struct r300_texture* tex = (struct r300_texture*)texture; - struct r300_winsys_screen *rws = (struct r300_winsys_screen *)screen->winsys; - struct r300_winsys_buffer *buf; - if (!tex) { return FALSE; } - rws->buffer_reference(rws, &buf, tex->buffer); + pipe_buffer_reference(buffer, tex->buffer); if (stride) { *stride = r300_texture_get_stride(r300_screen(screen), tex, 0); } - *buffer = buf; return TRUE; } diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 97724f790c..46a5fb6188 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -63,8 +63,8 @@ r300_video_surface(struct pipe_video_surface *pvs) #ifndef R300_WINSYS_H boolean r300_get_texture_buffer(struct pipe_screen* screen, - struct pipe_texture *texture, - struct r300_winsys_buffer** buffer, + struct pipe_texture* texture, + struct pipe_buffer** buffer, unsigned* stride); #endif /* R300_WINSYS_H */ diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index c6f9174496..40fb8a95ca 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -23,6 +23,10 @@ #ifndef R300_WINSYS_H #define R300_WINSYS_H +#ifdef __cplusplus +extern "C" { +#endif + /* The public interface header for the r300 pipe driver. * Any winsys hosting this pipe needs to implement r300_winsys and then * call r300_create_screen to start things. */ @@ -30,128 +34,19 @@ #include "pipe/p_defines.h" #include "pipe/p_state.h" -struct r300_winsys_screen; +struct radeon_winsys; /* Creates a new r300 screen. */ -struct pipe_screen* r300_create_screen(struct r300_winsys_screen *rws); - -struct r300_winsys_buffer; +struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys); boolean r300_get_texture_buffer(struct pipe_screen* screen, struct pipe_texture* texture, - struct r300_winsys_buffer** buffer, - unsigned *stride); - -enum r300_value_id { - R300_VID_PCI_ID, - R300_VID_GB_PIPES, - R300_VID_Z_PIPES, -}; - -struct r300_winsys_screen { - void (*destroy)(struct r300_winsys_screen *ws); - - /** - * Buffer management. Buffer attributes are mostly fixed over its lifetime. - * - * Remember that gallium gets to choose the interface it needs, and the - * window systems must then implement that interface (rather than the - * other way around...). - * - * usage is a bitmask of R300_WINSYS_BUFFER_USAGE_PIXEL/VERTEX/INDEX/CONSTANT. This - * usage argument is only an optimization hint, not a guarantee, therefore - * proper behavior must be observed in all circumstances. - * - * alignment indicates the client's alignment requirements, eg for - * SSE instructions. - */ - struct r300_winsys_buffer *(*buffer_create)(struct r300_winsys_screen *ws, - unsigned alignment, - unsigned usage, - unsigned size); - - /** - * Map the entire data store of a buffer object into the client's address. - * flags is bitmask of R300_WINSYS_BUFFER_USAGE_CPU_READ/WRITE flags. - */ - void *(*buffer_map)( struct r300_winsys_screen *ws, - struct r300_winsys_buffer *buf, - unsigned usage ); - - void (*buffer_unmap)( struct r300_winsys_screen *ws, - struct r300_winsys_buffer *buf ); - - void (*buffer_destroy)( struct r300_winsys_buffer *buf ); - - - void (*buffer_reference)(struct r300_winsys_screen *rws, - struct r300_winsys_buffer **pdst, - struct r300_winsys_buffer *src); - - boolean (*buffer_references)(struct r300_winsys_buffer *a, - struct r300_winsys_buffer *b); - - /* Add a pipe_buffer to the list of buffer objects to validate. */ - boolean (*add_buffer)(struct r300_winsys_screen *winsys, - struct r300_winsys_buffer *buf, - uint32_t rd, - uint32_t wd); - - /* Revalidate all currently setup pipe_buffers. - * Returns TRUE if a flush is required. */ - boolean (*validate)(struct r300_winsys_screen* winsys); - - /* Check to see if there's room for commands. */ - boolean (*check_cs)(struct r300_winsys_screen* winsys, int size); - - /* Start a command emit. */ - void (*begin_cs)(struct r300_winsys_screen* winsys, - int size, - const char* file, - const char* function, - int line); - - /* Write a dword to the command buffer. */ - void (*write_cs_dword)(struct r300_winsys_screen* winsys, uint32_t dword); - - /* Write a relocated dword to the command buffer. */ - void (*write_cs_reloc)(struct r300_winsys_screen *winsys, - struct r300_winsys_buffer *buf, - uint32_t rd, - uint32_t wd, - uint32_t flags); - - /* Finish a command emit. */ - void (*end_cs)(struct r300_winsys_screen* winsys, - const char* file, - const char* function, - int line); - - /* Flush the CS. */ - void (*flush_cs)(struct r300_winsys_screen* winsys); - - /* winsys flush - callback from winsys when flush required */ - void (*set_flush_cb)(struct r300_winsys_screen *winsys, - void (*flush_cb)(void *), void *data); - - void (*reset_bos)(struct r300_winsys_screen *winsys); - - void (*buffer_set_tiling)(struct r300_winsys_screen *winsys, - struct r300_winsys_buffer *buffer, - uint32_t pitch, - boolean microtiled, - boolean macrotiled); - - uint32_t (*get_value)(struct r300_winsys_screen *winsys, - enum r300_value_id vid); -}; + struct pipe_buffer** buffer, + unsigned* stride); -struct r300_winsys_screen * -r300_winsys_screen(struct pipe_screen *screen); +#ifdef __cplusplus +} +#endif -struct pipe_texture *r300_texture_blanket_winsys_buffer(struct pipe_screen *screen, - const struct pipe_texture *base, - const unsigned *stride, - struct r300_winsys_buffer *buffer); #endif /* R300_WINSYS_H */ diff --git a/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h b/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h index b36680eb66..c6a7d4a8c5 100644 --- a/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h +++ b/src/gallium/winsys/drm/i965/gem/i965_drm_winsys.h @@ -32,6 +32,8 @@ i965_libdrm_winsys(struct brw_winsys_screen *iws) return (struct i965_libdrm_winsys *)iws; } +struct i965_libdrm_winsys *i965_libdrm_winsys_create(int fd, unsigned pci_id); + void i965_libdrm_winsys_init_buffer_functions(struct i965_libdrm_winsys *idws); diff --git a/src/gallium/winsys/drm/radeon/core/Makefile b/src/gallium/winsys/drm/radeon/core/Makefile index 13bbbf730d..860cbb6dbf 100644 --- a/src/gallium/winsys/drm/radeon/core/Makefile +++ b/src/gallium/winsys/drm/radeon/core/Makefile @@ -5,7 +5,7 @@ include $(TOP)/configs/current LIBNAME = radeonwinsys C_SOURCES = \ - radeon_drm_buffer.c \ + radeon_buffer.c \ radeon_drm.c \ radeon_r300.c diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h index 8e0274e33d..f1c8fc2a3b 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h @@ -32,11 +32,11 @@ #include +#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" #include "pipebuffer/pb_buffer.h" -#include "pipebuffer/pb_bufmgr.h" #include "util/u_memory.h" @@ -47,41 +47,41 @@ #include "radeon_winsys.h" +struct radeon_pipe_buffer { + struct pipe_buffer base; + /* Pointer to GPU-backed BO. */ + struct radeon_bo *bo; + /* Pointer to fallback PB buffer. */ + struct pb_buffer *pb; + boolean flinked; + uint32_t flink; +}; #define RADEON_MAX_BOS 24 -static INLINE struct pb_buffer * -radeon_pb_buffer(struct r300_winsys_buffer *buffer) -{ - return (struct pb_buffer *)buffer; -} +struct radeon_winsys_priv { + /* DRM FD */ + int fd; -static INLINE struct r300_winsys_buffer * -radeon_libdrm_winsys_buffer(struct pb_buffer *buffer) -{ - return (struct r300_winsys_buffer *)buffer; -} + /* Radeon BO manager. */ + struct radeon_bo_manager* bom; -struct pb_manager * -radeon_drm_bufmgr_create(struct radeon_libdrm_winsys *rws); + /* Radeon CS manager. */ + struct radeon_cs_manager* csm; -boolean radeon_drm_bufmgr_add_buffer(struct pb_buffer *_buf, - uint32_t rd, uint32_t wd); + /* Current CS. */ + struct radeon_cs* cs; + /* Flush CB */ + void (*flush_cb)(void *); + void *flush_data; +}; -void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf, - uint32_t rd, uint32_t wd, - uint32_t flags); - -struct radeon_libdrm_winsys* radeon_pipe_winsys(int fd); - -boolean radeon_drm_bufmgr_shared_handle_from_buffer(struct pb_buffer *_buf, - uint32_t *handle); -uint32_t radeon_drm_bufmgr_handle_from_buffer(struct pb_buffer *_buf); -struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr, - uint32_t handle); - -void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf, boolean microtiled, boolean macrotiled, uint32_t pitch); - -void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr); +struct radeon_winsys* radeon_pipe_winsys(int fb); +#if 0 +struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_context, + uint32_t handle, + enum pipe_format format, + int w, int h, int pitch); +#endif #endif diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index f886fda2f2..0c0e118ba3 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -31,22 +31,8 @@ #include "radeon_drm.h" -static struct radeon_libdrm_winsys * -radeon_winsys_create(int fd) -{ - struct radeon_libdrm_winsys *rws; - - rws = CALLOC_STRUCT(radeon_libdrm_winsys); - if (rws == NULL) { - return NULL; - } - - rws->fd = fd; - return rws; -} - /* Helper function to do the ioctls needed for setup and init. */ -static void do_ioctls(int fd, struct radeon_libdrm_winsys* winsys) +static void do_ioctls(int fd, struct radeon_winsys* winsys) { struct drm_radeon_gem_info gem_info = {0}; struct drm_radeon_info info = {0}; @@ -137,26 +123,62 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB, struct drm_create_screen_arg *arg) { - struct radeon_libdrm_winsys* rws; - - rws = radeon_winsys_create(drmFB); - if (!rws) - return NULL; - - do_ioctls(drmFB, rws); + struct radeon_winsys* rwinsys = radeon_pipe_winsys(drmFB); + do_ioctls(drmFB, rwinsys); /* The state tracker can organize a softpipe fallback if no hw * driver is found. */ - if (is_r3xx(rws->pci_id)) { - radeon_setup_winsys(drmFB, rws); - return r300_create_screen(&rws->base); + if (is_r3xx(rwinsys->pci_id)) { + radeon_setup_winsys(drmFB, rwinsys); + return r300_create_screen(rwinsys); } else { - FREE(rws); + FREE(rwinsys); return NULL; } } + +boolean radeon_buffer_from_texture(struct drm_api* api, + struct pipe_screen* screen, + struct pipe_texture* texture, + struct pipe_buffer** buffer, + unsigned* stride) +{ + /* XXX fix this */ + return r300_get_texture_buffer(screen, texture, buffer, stride); +} + +/* Create a buffer from a handle. */ +/* XXX what's up with name? */ +struct pipe_buffer* radeon_buffer_from_handle(struct drm_api* api, + struct pipe_screen* screen, + const char* name, + unsigned handle) +{ + struct radeon_bo_manager* bom = + ((struct radeon_winsys*)screen->winsys)->priv->bom; + struct radeon_pipe_buffer* radeon_buffer; + struct radeon_bo* bo = NULL; + + bo = radeon_bo_open(bom, handle, 0, 0, 0, 0); + if (bo == NULL) { + return NULL; + } + + radeon_buffer = CALLOC_STRUCT(radeon_pipe_buffer); + if (radeon_buffer == NULL) { + radeon_bo_unref(bo); + return NULL; + } + + pipe_reference_init(&radeon_buffer->base.reference, 1); + radeon_buffer->base.screen = screen; + radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; + radeon_buffer->bo = bo; + return &radeon_buffer->base; +} + static struct pipe_texture* radeon_texture_from_shared_handle(struct drm_api *api, struct pipe_screen *screen, @@ -165,20 +187,18 @@ radeon_texture_from_shared_handle(struct drm_api *api, unsigned stride, unsigned handle) { - struct pb_buffer *_buf; - struct r300_winsys_buffer *buf; + struct pipe_buffer *buffer; struct pipe_texture *blanket; - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(r300_winsys_screen(screen)); - _buf = radeon_drm_bufmgr_create_buffer_from_handle(ws->kman, handle); - if (!_buf) { - return NULL; + buffer = radeon_buffer_from_handle(api, screen, name, handle); + if (!buffer) { + return NULL; } - buf = radeon_libdrm_winsys_buffer(_buf); - blanket = r300_texture_blanket_winsys_buffer(screen, templ, &stride, buf); + blanket = screen->texture_blanket(screen, templ, &stride, buffer); + + pipe_buffer_reference(&buffer, NULL); - pb_reference(&_buf, NULL); return blanket; } @@ -188,14 +208,34 @@ static boolean radeon_shared_handle_from_texture(struct drm_api *api, unsigned *stride, unsigned *handle) { - struct r300_winsys_buffer *radeon_buffer; - struct pb_buffer *_buf; - if (!r300_get_texture_buffer(screen, texture, &radeon_buffer, stride)) { + int retval, fd; + struct drm_gem_flink flink; + struct radeon_pipe_buffer* radeon_buffer; + struct pipe_buffer *buffer = NULL; + + if (!radeon_buffer_from_texture(api, screen, texture, &buffer, stride)) { return FALSE; } - _buf = radeon_pb_buffer(radeon_buffer); - return radeon_drm_bufmgr_shared_handle_from_buffer(_buf, handle); + radeon_buffer = (struct radeon_pipe_buffer*)buffer; + if (!radeon_buffer->flinked) { + fd = ((struct radeon_winsys*)screen->winsys)->priv->fd; + + flink.handle = radeon_buffer->bo->handle; + + retval = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); + if (retval) { + debug_printf("radeon: DRM_IOCTL_GEM_FLINK failed, error %d\n", + retval); + return FALSE; + } + + radeon_buffer->flink = flink.name; + radeon_buffer->flinked = TRUE; + } + + *handle = radeon_buffer->flink; + return TRUE; } static boolean radeon_local_handle_from_texture(struct drm_api *api, @@ -204,18 +244,16 @@ static boolean radeon_local_handle_from_texture(struct drm_api *api, unsigned *stride, unsigned *handle) { - struct r300_winsys_buffer *radeon_buffer; - struct pb_buffer *_buf; - - if (!r300_get_texture_buffer(screen, texture, &radeon_buffer, stride)) { + struct pipe_buffer *buffer = NULL; + if (!radeon_buffer_from_texture(api, screen, texture, &buffer, stride)) { return FALSE; } - _buf = radeon_pb_buffer(radeon_buffer); - *handle = radeon_drm_bufmgr_handle_from_buffer(_buf); + *handle = ((struct radeon_pipe_buffer*)buffer)->bo->handle; + + pipe_buffer_reference(&buffer, NULL); - pb_reference(&_buf, NULL); - return true; + return TRUE; } static void radeon_drm_api_destroy(struct drm_api *api) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.h b/src/gallium/winsys/drm/radeon/core/radeon_drm.h index 2f55061330..8d74cbafc2 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.h @@ -59,6 +59,11 @@ boolean radeon_buffer_from_texture(struct drm_api* api, struct pipe_buffer** buffer, unsigned* stride); +struct pipe_buffer* radeon_buffer_from_handle(struct drm_api* api, + struct pipe_screen* screen, + const char* name, + unsigned handle); + boolean radeon_handle_from_buffer(struct drm_api* api, struct pipe_screen* screen, struct pipe_buffer* buffer, diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c deleted file mode 100644 index 5f2fd2d7fc..0000000000 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm_buffer.c +++ /dev/null @@ -1,361 +0,0 @@ - -#include "radeon_drm.h" -#include "radeon_bo_gem.h" -#include "radeon_cs_gem.h" - -#include "util/u_inlines.h" -#include "util/u_memory.h" -#include "util/u_simple_list.h" -#include "pipebuffer/pb_buffer.h" -#include "pipebuffer/pb_bufmgr.h" - -#include "radeon_winsys.h" -struct radeon_drm_bufmgr; - -struct radeon_drm_buffer { - struct pb_buffer base; - struct radeon_drm_bufmgr *mgr; - - struct radeon_bo *bo; - - boolean flinked; - uint32_t flink; - - boolean mapped; - struct radeon_drm_buffer *next, *prev; -}; - -extern const struct pb_vtbl radeon_drm_buffer_vtbl; - - -static INLINE struct radeon_drm_buffer * -radeon_drm_buffer(struct pb_buffer *buf) -{ - assert(buf); - assert(buf->vtbl == &radeon_drm_buffer_vtbl); - return (struct radeon_drm_buffer *)buf; -} - -struct radeon_drm_bufmgr { - struct pb_manager base; - struct radeon_libdrm_winsys *rws; - struct radeon_drm_buffer buffer_map_list; -}; - -static INLINE struct radeon_drm_bufmgr * -radeon_drm_bufmgr(struct pb_manager *mgr) -{ - assert(mgr); - return (struct radeon_drm_bufmgr *)mgr; -} - -static void -radeon_drm_buffer_destroy(struct pb_buffer *_buf) -{ - struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); - - if (buf->mapped) { - remove_from_list(buf); - radeon_bo_unmap(buf->bo); - buf->mapped = false; - } - radeon_bo_unref(buf->bo); - - FREE(buf); -} - -static void * -radeon_drm_buffer_map(struct pb_buffer *_buf, - unsigned flags) -{ - struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); - int write; - - if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { - uint32_t domain; - - if (radeon_bo_is_busy(buf->bo, &domain)) - return NULL; - } - - if (radeon_bo_is_referenced_by_cs(buf->bo, buf->mgr->rws->cs)) { - buf->mgr->rws->flush_cb(buf->mgr->rws->flush_data); - } - - if (buf->mapped) - return buf->bo->ptr; - - if (flags & PIPE_BUFFER_USAGE_CPU_WRITE) { - write = 1; - } - - if (radeon_bo_map(buf->bo, write)) { - return NULL; - } - buf->mapped = true; - insert_at_tail(&buf->mgr->buffer_map_list, buf); - return buf->bo->ptr; -} - -static void -radeon_drm_buffer_unmap(struct pb_buffer *_buf) -{ - (void)_buf; -} - -static void -radeon_drm_buffer_get_base_buffer(struct pb_buffer *buf, - struct pb_buffer **base_buf, - unsigned *offset) -{ - *base_buf = buf; - *offset = 0; -} - - -static enum pipe_error -radeon_drm_buffer_validate(struct pb_buffer *_buf, - struct pb_validate *vl, - unsigned flags) -{ - /* Always pinned */ - return PIPE_OK; -} - -static void -radeon_drm_buffer_fence(struct pb_buffer *buf, - struct pipe_fence_handle *fence) -{ -} - -const struct pb_vtbl radeon_drm_buffer_vtbl = { - radeon_drm_buffer_destroy, - radeon_drm_buffer_map, - radeon_drm_buffer_unmap, - radeon_drm_buffer_validate, - radeon_drm_buffer_fence, - radeon_drm_buffer_get_base_buffer, -}; - - -static uint32_t radeon_domain_from_usage(unsigned usage) -{ - uint32_t domain = 0; - - if (usage & PIPE_BUFFER_USAGE_GPU_WRITE) { - domain |= RADEON_GEM_DOMAIN_VRAM; - } - if (usage & PIPE_BUFFER_USAGE_PIXEL) { - domain |= RADEON_GEM_DOMAIN_VRAM; - } - if (usage & PIPE_BUFFER_USAGE_VERTEX) { - domain |= RADEON_GEM_DOMAIN_GTT; - } - if (usage & PIPE_BUFFER_USAGE_INDEX) { - domain |= RADEON_GEM_DOMAIN_GTT; - } - - return domain; -} - -struct pb_buffer *radeon_drm_bufmgr_create_buffer_from_handle(struct pb_manager *_mgr, - uint32_t handle) -{ - struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); - struct radeon_libdrm_winsys *rws = mgr->rws; - struct radeon_drm_buffer *buf; - struct radeon_bo *bo; - - bo = radeon_bo_open(rws->bom, handle, 0, - 0, 0, 0); - if (bo == NULL) - return NULL; - - buf = CALLOC_STRUCT(radeon_drm_buffer); - if (!buf) { - radeon_bo_unref(bo); - return NULL; - } - - make_empty_list(buf); - - pipe_reference_init(&buf->base.base.reference, 1); - buf->base.base.alignment = 0; - buf->base.base.usage = PIPE_BUFFER_USAGE_PIXEL; - buf->base.base.size = 0; - buf->base.vtbl = &radeon_drm_buffer_vtbl; - buf->mgr = mgr; - - buf->bo = bo; - - // fprintf(stderr,"hand %p : %d\n", &buf->base, handle); - return &buf->base; - -} - -static struct pb_buffer * -radeon_drm_bufmgr_create_buffer(struct pb_manager *_mgr, - pb_size size, - const struct pb_desc *desc) -{ - struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); - struct radeon_libdrm_winsys *rws = mgr->rws; - struct radeon_drm_buffer *buf; - uint32_t domain; - - buf = CALLOC_STRUCT(radeon_drm_buffer); - if (!buf) - goto error1; - - pipe_reference_init(&buf->base.base.reference, 1); - buf->base.base.alignment = desc->alignment; - buf->base.base.usage = desc->usage; - buf->base.base.size = size; - buf->base.vtbl = &radeon_drm_buffer_vtbl; - buf->mgr = mgr; - - make_empty_list(buf); - domain = radeon_domain_from_usage(desc->usage); - buf->bo = radeon_bo_open(rws->bom, 0, size, - desc->alignment, domain, 0); - if (buf->bo == NULL) - goto error2; - - // fprintf(stderr,"%p : %d\n", &buf->base, size); - return &buf->base; - - error2: - FREE(buf); - error1: - return NULL; -} - -static void -radeon_drm_bufmgr_flush(struct pb_manager *mgr) -{ - /* NOP */ -} - -static void -radeon_drm_bufmgr_destroy(struct pb_manager *_mgr) -{ - struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); - FREE(mgr); -} - -struct pb_manager * -radeon_drm_bufmgr_create(struct radeon_libdrm_winsys *rws) -{ - struct radeon_drm_bufmgr *mgr; - - mgr = CALLOC_STRUCT(radeon_drm_bufmgr); - if (!mgr) - return NULL; - - mgr->base.destroy = radeon_drm_bufmgr_destroy; - mgr->base.create_buffer = radeon_drm_bufmgr_create_buffer; - mgr->base.flush = radeon_drm_bufmgr_flush; - - mgr->rws = rws; - make_empty_list(&mgr->buffer_map_list); - return &mgr->base; -} - -uint32_t radeon_drm_bufmgr_handle_from_buffer(struct pb_buffer *_buf) -{ - struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); - - return buf->bo->handle; -} - -boolean radeon_drm_bufmgr_shared_handle_from_buffer(struct pb_buffer *_buf, - uint32_t *handle) -{ - struct radeon_drm_buffer *buf = radeon_drm_buffer(_buf); - struct drm_gem_flink flink; - int retval, fd; - if (!buf->flinked) { - fd = buf->mgr->rws->fd; - flink.handle = buf->bo->handle; - - retval = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - if (retval) { - return false; - } - - buf->flinked = TRUE; - buf->flink = flink.name; - } - *handle = buf->flink; - return TRUE; -} - -static struct radeon_drm_buffer *get_drm_buffer(struct pb_buffer *_buf) -{ - struct radeon_drm_buffer *buf; - if (_buf->vtbl == &radeon_drm_buffer_vtbl) { - buf = radeon_drm_buffer(_buf); - } else { - struct pb_buffer *base_buf; - pb_size offset; - pb_get_base_buffer(_buf, &base_buf, &offset); - - buf = radeon_drm_buffer(base_buf); - } - return buf; -} - -void radeon_drm_bufmgr_set_tiling(struct pb_buffer *_buf, boolean microtiled, boolean macrotiled, uint32_t pitch) -{ - struct radeon_drm_buffer *buf = get_drm_buffer(_buf); - uint32_t flags = 0; - - if (microtiled) - flags |= RADEON_BO_FLAGS_MICRO_TILE; - if (macrotiled) - flags |= RADEON_BO_FLAGS_MACRO_TILE; - - radeon_bo_set_tiling(buf->bo, flags, pitch); - -} - -boolean radeon_drm_bufmgr_add_buffer(struct pb_buffer *_buf, - uint32_t rd, uint32_t wd) -{ - struct radeon_drm_buffer *buf = get_drm_buffer(_buf); - radeon_cs_space_add_persistent_bo(buf->mgr->rws->cs, buf->bo, - rd, wd); - - return true; -} - -void radeon_drm_bufmgr_write_reloc(struct pb_buffer *_buf, - uint32_t rd, uint32_t wd, - uint32_t flags) -{ - struct radeon_drm_buffer *buf = get_drm_buffer(_buf); - int retval; - - retval = radeon_cs_write_reloc(buf->mgr->rws->cs, - buf->bo, rd, wd, flags); - if (retval) { - debug_printf("radeon: Relocation of %p (%d, %d, %d) failed!\n", - buf, rd, wd, flags); - } -} - -void radeon_drm_bufmgr_flush_maps(struct pb_manager *_mgr) -{ - struct radeon_drm_bufmgr *mgr = radeon_drm_bufmgr(_mgr); - struct radeon_drm_buffer *rpb, *t_rpb; - - foreach_s(rpb, t_rpb, &mgr->buffer_map_list) { - rpb->mapped = 0; - radeon_bo_unmap(rpb->bo); - remove_from_list(rpb); - } - - make_empty_list(&mgr->buffer_map_list); - - -} diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index 997abb8f5c..d759beaba1 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -22,104 +22,29 @@ #include "radeon_r300.h" -static struct r300_winsys_buffer * -radeon_r300_winsys_buffer_create(struct r300_winsys_screen *rws, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - struct pb_desc desc; - struct pb_manager *provider; - struct pb_buffer *buffer; - - memset(&desc, 0, sizeof(desc)); - desc.alignment = alignment; - desc.usage = usage; - - if (usage == PIPE_BUFFER_USAGE_CONSTANT) - provider = ws->mman; - else if (usage == PIPE_BUFFER_USAGE_VERTEX || - usage == PIPE_BUFFER_USAGE_INDEX) - provider = ws->cman; - else - provider = ws->kman; - buffer = provider->create_buffer(provider, size, &desc); - if (!buffer) - return NULL; - - return radeon_libdrm_winsys_buffer(buffer); -} - -static void radeon_r300_winsys_buffer_destroy(struct r300_winsys_buffer *buf) -{ - struct pb_buffer *_buf = radeon_pb_buffer(buf); - - pb_destroy(_buf); -} -static void radeon_r300_winsys_buffer_set_tiling(struct r300_winsys_screen *rws, - struct r300_winsys_buffer *buf, - uint32_t pitch, - boolean microtiled, - boolean macrotiled) -{ - struct pb_buffer *_buf = radeon_pb_buffer(buf); - radeon_drm_bufmgr_set_tiling(_buf, microtiled, macrotiled, pitch); -} - -static void *radeon_r300_winsys_buffer_map(struct r300_winsys_screen *ws, - struct r300_winsys_buffer *buf, - unsigned usage) -{ - struct pb_buffer *_buf = radeon_pb_buffer(buf); - - return pb_map(_buf, 0); -} - -static void radeon_r300_winsys_buffer_unmap(struct r300_winsys_screen *ws, - struct r300_winsys_buffer *buf) -{ - struct pb_buffer *_buf = radeon_pb_buffer(buf); - - pb_unmap(_buf); -} - -static void radeon_r300_winsys_buffer_reference(struct r300_winsys_screen *rws, - struct r300_winsys_buffer **pdst, - struct r300_winsys_buffer *src) -{ - struct pb_buffer *_src = radeon_pb_buffer(src); - struct pb_buffer *_dst = radeon_pb_buffer(*pdst); - - pb_reference(&_dst, _src); - - *pdst = radeon_libdrm_winsys_buffer(_dst); -} - -static void radeon_set_flush_cb(struct r300_winsys_screen *rws, +static void radeon_set_flush_cb(struct radeon_winsys *winsys, void (*flush_cb)(void *), void *data) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - ws->flush_cb = flush_cb; - ws->flush_data = data; - radeon_cs_space_set_flush(ws->cs, flush_cb, data); + winsys->priv->flush_cb = flush_cb; + winsys->priv->flush_data = data; + radeon_cs_space_set_flush(winsys->priv->cs, flush_cb, data); } -static boolean radeon_add_buffer(struct r300_winsys_screen *rws, - struct r300_winsys_buffer *buf, +static boolean radeon_add_buffer(struct radeon_winsys* winsys, + struct pipe_buffer* pbuffer, uint32_t rd, uint32_t wd) { - struct pb_buffer *_buf = radeon_pb_buffer(buf); + struct radeon_bo* bo = ((struct radeon_pipe_buffer*)pbuffer)->bo; - return radeon_drm_bufmgr_add_buffer(_buf, rd, wd); + radeon_cs_space_add_persistent_bo(winsys->priv->cs, bo, rd, wd); + return TRUE; } -static boolean radeon_validate(struct r300_winsys_screen *rws) +static boolean radeon_validate(struct radeon_winsys* winsys) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - if (radeon_cs_space_check(ws->cs) < 0) { + if (radeon_cs_space_check(winsys->priv->cs) < 0) { return FALSE; } @@ -127,146 +52,108 @@ static boolean radeon_validate(struct r300_winsys_screen *rws) return TRUE; } -static boolean radeon_check_cs(struct r300_winsys_screen *rws, int size) +static boolean radeon_check_cs(struct radeon_winsys* winsys, int size) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - struct radeon_cs *cs = ws->cs; + struct radeon_cs* cs = winsys->priv->cs; - return radeon_validate(rws) && cs->cdw + size <= cs->ndw; + return radeon_validate(winsys) && cs->cdw + size <= cs->ndw; } -static void radeon_begin_cs(struct r300_winsys_screen *rws, +static void radeon_begin_cs(struct radeon_winsys* winsys, int size, const char* file, const char* function, int line) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - radeon_cs_begin(ws->cs, size, file, function, line); + radeon_cs_begin(winsys->priv->cs, size, file, function, line); } -static void radeon_write_cs_dword(struct r300_winsys_screen *rws, +static void radeon_write_cs_dword(struct radeon_winsys* winsys, uint32_t dword) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - radeon_cs_write_dword(ws->cs, dword); + radeon_cs_write_dword(winsys->priv->cs, dword); } -static void radeon_write_cs_reloc(struct r300_winsys_screen *rws, - struct r300_winsys_buffer *buf, +static void radeon_write_cs_reloc(struct radeon_winsys* winsys, + struct pipe_buffer* pbuffer, uint32_t rd, uint32_t wd, uint32_t flags) { - struct pb_buffer *_buf = radeon_pb_buffer(buf); - radeon_drm_bufmgr_write_reloc(_buf, rd, wd, flags); + int retval = 0; + struct radeon_pipe_buffer* radeon_buffer = + (struct radeon_pipe_buffer*)pbuffer; + + assert(!radeon_buffer->pb); + + retval = radeon_cs_write_reloc(winsys->priv->cs, radeon_buffer->bo, + rd, wd, flags); + + if (retval) { + debug_printf("radeon: Relocation of %p (%d, %d, %d) failed!\n", + pbuffer, rd, wd, flags); + } } -static void radeon_reset_bos(struct r300_winsys_screen *rws) +static void radeon_reset_bos(struct radeon_winsys *winsys) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - radeon_cs_space_reset_bos(ws->cs); + radeon_cs_space_reset_bos(winsys->priv->cs); } -static void radeon_end_cs(struct r300_winsys_screen *rws, +static void radeon_end_cs(struct radeon_winsys* winsys, const char* file, const char* function, int line) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); - radeon_cs_end(ws->cs, file, function, line); + radeon_cs_end(winsys->priv->cs, file, function, line); } -static void radeon_flush_cs(struct r300_winsys_screen *rws) +static void radeon_flush_cs(struct radeon_winsys* winsys) { - struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws); int retval; /* Don't flush a zero-sized CS. */ - if (!ws->cs->cdw) { + if (!winsys->priv->cs->cdw) { return; } - radeon_drm_bufmgr_flush_maps(ws->kman); /* Emit the CS. */ - retval = radeon_cs_emit(ws->cs); + retval = radeon_cs_emit(winsys->priv->cs); if (retval) { debug_printf("radeon: Bad CS, dumping...\n"); - radeon_cs_print(ws->cs, stderr); + radeon_cs_print(winsys->priv->cs, stderr); } /* Reset CS. * Someday, when we care about performance, we should really find a way * to rotate between two or three CS objects so that the GPU can be * spinning through one CS while another one is being filled. */ - radeon_cs_erase(ws->cs); -} - -static uint32_t radeon_get_value(struct r300_winsys_screen *rws, - enum r300_value_id id) -{ - struct radeon_libdrm_winsys *ws = (struct radeon_libdrm_winsys *)rws; - - switch(id) { - case R300_VID_PCI_ID: - return ws->pci_id; - case R300_VID_GB_PIPES: - return ws->gb_pipes; - case R300_VID_Z_PIPES: - return ws->z_pipes; - } - return 0; -} - -static void -radeon_winsys_destroy(struct r300_winsys_screen *rws) -{ - struct radeon_libdrm_winsys *ws = (struct radeon_libdrm_winsys *)rws; - radeon_cs_destroy(ws->cs); - - ws->cman->destroy(ws->cman); - ws->kman->destroy(ws->kman); - ws->mman->destroy(ws->mman); - - radeon_bo_manager_gem_dtor(ws->bom); - radeon_cs_manager_gem_dtor(ws->csm); + radeon_cs_erase(winsys->priv->cs); } void -radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws) +radeon_setup_winsys(int fd, struct radeon_winsys* winsys) { - ws->csm = radeon_cs_manager_gem_ctor(fd); - - ws->bom = radeon_bo_manager_gem_ctor(fd); - ws->kman = radeon_drm_bufmgr_create(ws); + struct radeon_winsys_priv* priv = winsys->priv; - ws->cman = pb_cache_manager_create(ws->kman, 100000); - ws->mman = pb_malloc_bufmgr_create(); + priv->csm = radeon_cs_manager_gem_ctor(fd); /* Size limit on IBs is 64 kibibytes. */ - ws->cs = radeon_cs_create(ws->csm, 1024 * 64 / 4); - radeon_cs_set_limit(ws->cs, - RADEON_GEM_DOMAIN_GTT, ws->gart_size); - radeon_cs_set_limit(ws->cs, - RADEON_GEM_DOMAIN_VRAM, ws->vram_size); - - ws->base.add_buffer = radeon_add_buffer; - ws->base.validate = radeon_validate; - ws->base.destroy = radeon_winsys_destroy; - ws->base.check_cs = radeon_check_cs; - ws->base.begin_cs = radeon_begin_cs; - ws->base.write_cs_dword = radeon_write_cs_dword; - ws->base.write_cs_reloc = radeon_write_cs_reloc; - ws->base.end_cs = radeon_end_cs; - ws->base.flush_cs = radeon_flush_cs; - ws->base.reset_bos = radeon_reset_bos; - ws->base.set_flush_cb = radeon_set_flush_cb; - ws->base.get_value = radeon_get_value; - - ws->base.buffer_create = radeon_r300_winsys_buffer_create; - ws->base.buffer_destroy = radeon_r300_winsys_buffer_destroy; - ws->base.buffer_set_tiling = radeon_r300_winsys_buffer_set_tiling; - ws->base.buffer_map = radeon_r300_winsys_buffer_map; - ws->base.buffer_unmap = radeon_r300_winsys_buffer_unmap; - ws->base.buffer_reference = radeon_r300_winsys_buffer_reference; + priv->cs = radeon_cs_create(priv->csm, 1024 * 64 / 4); + radeon_cs_set_limit(priv->cs, + RADEON_GEM_DOMAIN_GTT, winsys->gart_size); + radeon_cs_set_limit(priv->cs, + RADEON_GEM_DOMAIN_VRAM, winsys->vram_size); + + winsys->add_buffer = radeon_add_buffer; + winsys->validate = radeon_validate; + + winsys->check_cs = radeon_check_cs; + winsys->begin_cs = radeon_begin_cs; + winsys->write_cs_dword = radeon_write_cs_dword; + winsys->write_cs_reloc = radeon_write_cs_reloc; + winsys->end_cs = radeon_end_cs; + winsys->flush_cs = radeon_flush_cs; + winsys->reset_bos = radeon_reset_bos; + winsys->set_flush_cb = radeon_set_flush_cb; } diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.h b/src/gallium/winsys/drm/radeon/core/radeon_r300.h index 82a8aad715..cfbdb30266 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.h @@ -28,12 +28,12 @@ #include #include "drm.h" #include "radeon_drm.h" -#include "radeon_bo_gem.h" #include "radeon_cs_gem.h" -#include "radeon_winsys.h" +#include "r300_winsys.h" + #include "radeon_buffer.h" -void radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* winsys); +void radeon_setup_winsys(int fd, struct radeon_winsys* winsys); #endif /* RADEON_R300_H */ diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h index c8e725cff0..4901080ca7 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h @@ -30,17 +30,16 @@ #ifndef RADEON_WINSYS_H #define RADEON_WINSYS_H -#include "r300_winsys.h" +#include "util/u_simple_screen.h" -struct radeon_libdrm_winsys { - /* Parent class. */ - struct r300_winsys_screen base; - - struct pb_manager *kman; +struct radeon_winsys_priv; - struct pb_manager *mman; +struct radeon_winsys { + /* Parent class. */ + struct pipe_winsys base; - struct pb_manager *cman; + /* Winsys private */ + struct radeon_winsys_priv* priv; /* PCI ID */ uint32_t pci_id; @@ -57,27 +56,56 @@ struct radeon_libdrm_winsys { /* VRAM size. */ uint32_t vram_size; - /* DRM FD */ - int fd; - - /* Radeon BO manager. */ - struct radeon_bo_manager *bom; - - /* Radeon CS manager. */ - struct radeon_cs_manager *csm; - - /* Current CS. */ - struct radeon_cs *cs; - - /* Flush CB */ - void (*flush_cb)(void *); - void *flush_data; + /* Add a pipe_buffer to the list of buffer objects to validate. */ + boolean (*add_buffer)(struct radeon_winsys* winsys, + struct pipe_buffer* pbuffer, + uint32_t rd, + uint32_t wd); + + /* Revalidate all currently setup pipe_buffers. + * Returns TRUE if a flush is required. */ + boolean (*validate)(struct radeon_winsys* winsys); + + /* Check to see if there's room for commands. */ + boolean (*check_cs)(struct radeon_winsys* winsys, int size); + + /* Start a command emit. */ + void (*begin_cs)(struct radeon_winsys* winsys, + int size, + const char* file, + const char* function, + int line); + + /* Write a dword to the command buffer. */ + void (*write_cs_dword)(struct radeon_winsys* winsys, uint32_t dword); + + /* Write a relocated dword to the command buffer. */ + void (*write_cs_reloc)(struct radeon_winsys* winsys, + struct pipe_buffer* bo, + uint32_t rd, + uint32_t wd, + uint32_t flags); + + /* Finish a command emit. */ + void (*end_cs)(struct radeon_winsys* winsys, + const char* file, + const char* function, + int line); + + /* Flush the CS. */ + void (*flush_cs)(struct radeon_winsys* winsys); + + /* winsys flush - callback from winsys when flush required */ + void (*set_flush_cb)(struct radeon_winsys *winsys, + void (*flush_cb)(void *), void *data); + + void (*reset_bos)(struct radeon_winsys *winsys); + + void (*buffer_set_tiling)(struct radeon_winsys* winsys, + struct pipe_buffer* buffer, + uint32_t pitch, + boolean microtiled, + boolean macrotiled); }; -static INLINE struct radeon_libdrm_winsys * -radeon_winsys_screen(struct r300_winsys_screen *base) -{ - return (struct radeon_libdrm_winsys *)base; -} - #endif -- cgit v1.2.3 From 5abee283d310a70efa4c713707f06624d5462322 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 21 Jan 2010 17:39:01 +0000 Subject: intel: Check that we have a bufmgr or bail out when initializing the context. Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/intel/intel_context.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index ced8d5aebe..3c36c3f4c8 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -594,6 +594,10 @@ intelInitContext(struct intel_context *intel, struct intel_screen *intelScreen = sPriv->private; int bo_reuse_mode; + /* we can't do anything without a connection to the device */ + if (intelScreen->bufmgr == NULL) + return GL_FALSE; + if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, functions, (void *) intel)) { printf("%s: failed to init mesa context\n", __FUNCTION__); -- cgit v1.2.3 From ac6ce53af7f67d01afd8e33d297f95c21aa3405e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 22 Feb 2010 09:50:15 +0000 Subject: i915: Remove superfluous MI_NOOP from vertex emission Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/i915/intel_tris.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 3816adae94..9975e2f47b 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -98,8 +98,7 @@ static void intel_start_inline(struct intel_context *intel, uint32_t prim) /* Emit a slot which will be filled with the inline primitive * command later. */ - BEGIN_BATCH(2); - OUT_BATCH(0); + BEGIN_BATCH(1); assert((intel->batch->dirty_state & (1<<1)) == 0); -- cgit v1.2.3 From 415b7c7775dd7240abd2c929ea3335304a790d39 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 22 Feb 2010 09:51:33 +0000 Subject: i915: Fix logic !gen >= 3 The effect of this was that all objects were aligned to 128 bytes on all generations, rather than just gen2. Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/i915/intel_tris.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 9975e2f47b..0afbda2436 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -217,7 +217,7 @@ void intel_flush_prim(struct intel_context *intel) intel->prim.count = 0; offset = intel->prim.start_offset; intel->prim.start_offset = intel->prim.current_offset; - if (!intel->gen >= 3) + if (intel->gen < 3) intel->prim.start_offset = ALIGN(intel->prim.start_offset, 128); intel->prim.flush = NULL; -- cgit v1.2.3 From 15904c057beec3029a8ed2035d7ba50f9414943d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 22 Feb 2010 09:53:36 +0000 Subject: intel: assert that we do not overflow the batch buffer. Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 9261f2ffd8..4c99dcde23 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -158,9 +158,10 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, } /* Mark the end of the buffer. */ - *(GLuint *) (batch->ptr) = MI_BATCH_BUFFER_END; /* noop */ + *(GLuint *) (batch->ptr) = MI_BATCH_BUFFER_END; batch->ptr += 4; used = batch->ptr - batch->map; + assert (used <= batch->buf->size); /* Workaround for recursive batchbuffer flushing: If the window is * moved, we can get into a case where we try to flush during a -- cgit v1.2.3 From 6ce5b5e115451543a4a059ef6b618c1e53f2bbc5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Feb 2010 08:04:16 -0700 Subject: mesa/st: Make ST_SURFACE_DEPTH index consistent with mesa's BUFFER_DEPTH. Some st functions assume that they are identical. (cherry picked from commit 9d17ad2891b58de9e33e943ff918a678c6a3c2bd) --- src/mesa/state_tracker/st_public.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h index 98c19817c8..5c9a8550db 100644 --- a/src/mesa/state_tracker/st_public.h +++ b/src/mesa/state_tracker/st_public.h @@ -39,7 +39,7 @@ #define ST_SURFACE_BACK_LEFT 1 #define ST_SURFACE_FRONT_RIGHT 2 #define ST_SURFACE_BACK_RIGHT 3 -#define ST_SURFACE_DEPTH 8 +#define ST_SURFACE_DEPTH 4 #define ST_TEXTURE_2D 0x2 #define ST_TEXTURE_RECT 0x4 -- cgit v1.2.3 From 504e297a2c395d136ff73279db28cc9de3303c2d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Feb 2010 08:04:39 -0700 Subject: st/mesa: Add checks for ST_SURFACE_x vs MESA_BUFFER_x The ST_SURFACE_x values should match the Mesa BUFFER_x values. Added some assertions to prevent future mix-ups. (cherry picked from commit 13cbb5fff68ef8831230638e9f0b29a217750e9d) --- src/mesa/state_tracker/st_framebuffer.c | 8 ++++++++ src/mesa/state_tracker/st_public.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 4e225a123c..1d35e8d657 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -160,6 +160,7 @@ void st_unreference_framebuffer( struct st_framebuffer *stfb ) * Set/replace a framebuffer surface. * The user of the state tracker can use this instead of * st_resize_framebuffer() to provide new surfaces when a window is resized. + * \param surfIndex an ST_SURFACE_x index */ void st_set_framebuffer_surface(struct st_framebuffer *stfb, @@ -170,6 +171,13 @@ st_set_framebuffer_surface(struct st_framebuffer *stfb, struct st_renderbuffer *strb; GLuint width, height, i; + /* sanity checks */ + assert(ST_SURFACE_FRONT_LEFT == BUFFER_FRONT_LEFT); + assert(ST_SURFACE_BACK_LEFT == BUFFER_BACK_LEFT); + assert(ST_SURFACE_FRONT_RIGHT == BUFFER_FRONT_RIGHT); + assert(ST_SURFACE_BACK_RIGHT == BUFFER_BACK_RIGHT); + assert(ST_SURFACE_DEPTH == BUFFER_DEPTH); + assert(surfIndex < BUFFER_COUNT); strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer); diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h index 5c9a8550db..0824356cec 100644 --- a/src/mesa/state_tracker/st_public.h +++ b/src/mesa/state_tracker/st_public.h @@ -34,7 +34,7 @@ #include "pipe/p_compiler.h" #include "pipe/p_format.h" - +/** Renderbuffer surfaces (should match Mesa names) */ #define ST_SURFACE_FRONT_LEFT 0 #define ST_SURFACE_BACK_LEFT 1 #define ST_SURFACE_FRONT_RIGHT 2 -- cgit v1.2.3 From cfdd1ca69521446b5d937d95e7d8bfb27f6d68eb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Feb 2010 08:04:53 -0700 Subject: st/mesa: change viewport Z scale/bias for glBitmap/glDrawPixels This fixes incorrect Z position of glBitmap, glDraw/CopyPixels for the svga driver. Now we use 0.5, 0.5 as is typical for ordinary 3D rendering. (cherry picked from commit bcd561c66777e58dbb29a573c4d2279772bac6c5) --- src/mesa/state_tracker/st_cb_bitmap.c | 7 +++++-- src/mesa/state_tracker/st_cb_drawpixels.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 5968426a1d..0332d4dbdf 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -481,15 +481,18 @@ draw_bitmap_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, struct pipe_viewport_state vp; vp.scale[0] = 0.5f * width; vp.scale[1] = height * (invert ? -0.5f : 0.5f); - vp.scale[2] = 1.0f; + vp.scale[2] = 0.5f; vp.scale[3] = 1.0f; vp.translate[0] = 0.5f * width; vp.translate[1] = 0.5f * height; - vp.translate[2] = 0.0f; + vp.translate[2] = 0.5f; vp.translate[3] = 0.0f; cso_set_viewport(cso, &vp); } + /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */ + z = z * 2.0 - 1.0; + /* draw textured quad */ offset = setup_bitmap_vertex_data(st, x, y, width, height, z, color); diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 4e86450edf..e9aee6b205 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -572,11 +572,11 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, struct pipe_viewport_state vp; vp.scale[0] = 0.5f * w; vp.scale[1] = -0.5f * h; - vp.scale[2] = 1.0f; + vp.scale[2] = 0.5f; vp.scale[3] = 1.0f; vp.translate[0] = 0.5f * w; vp.translate[1] = 0.5f * h; - vp.translate[2] = 0.0f; + vp.translate[2] = 0.5f; vp.translate[3] = 0.0f; cso_set_viewport(cso, &vp); } @@ -601,6 +601,9 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, y0 = (GLfloat) y; y1 = y + height * ctx->Pixel.ZoomY; + /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */ + z = z * 2.0 - 1.0; + draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex, (GLfloat) width / pt->width0, (GLfloat) height / pt->height0); -- cgit v1.2.3 From 98e2f6c38bede8373fbf51981ccf6b513ac3695c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Feb 2010 08:14:05 -0700 Subject: i915g: added missing texture cap queries --- src/gallium/drivers/i915/i915_screen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index c450854c98..b1d754dc4e 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -95,6 +95,10 @@ i915_get_param(struct pipe_screen *screen, int param) switch (param) { case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return 8; + case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: + return 0; + case PIPE_CAP_MAX_COMBINED_SAMPLERS: + return 8; case PIPE_CAP_NPOT_TEXTURES: return 1; case PIPE_CAP_TWO_SIDED_STENCIL: -- cgit v1.2.3 From 2467354842d7118efff73165ddaaf4c519b41e46 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Feb 2010 08:14:14 -0700 Subject: i965g: added missing texture cap queries --- src/gallium/drivers/i965/brw_screen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index 184cd490e5..b03a782a2f 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -153,6 +153,10 @@ brw_get_param(struct pipe_screen *screen, int param) switch (param) { case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return 8; + case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: + return 8; + case PIPE_CAP_MAX_COMBINED_SAMPLERS: + return 16; /* XXX correct? */ case PIPE_CAP_NPOT_TEXTURES: return 1; case PIPE_CAP_TWO_SIDED_STENCIL: -- cgit v1.2.3 From 63cb6f59eac91ba34cf80ff3736568e40b094fe1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 22 Feb 2010 21:36:22 +0100 Subject: gallium: Remove bypass_vs_clip_and_viewport from rasteriser state. Needs testing. --- src/gallium/auxiliary/draw/draw_context.c | 8 +- src/gallium/auxiliary/draw/draw_pt.c | 4 +- .../auxiliary/draw/draw_pt_fetch_shade_emit.c | 3 +- .../auxiliary/draw/draw_pt_fetch_shade_pipeline.c | 15 +- src/gallium/auxiliary/util/u_blit.c | 15 +- src/gallium/auxiliary/util/u_blitter.c | 1 - src/gallium/auxiliary/util/u_dump_state.c | 1 - src/gallium/auxiliary/util/u_gen_mipmap.c | 39 ++- src/gallium/docs/source/cso/rasterizer.rst | 12 - src/gallium/drivers/nv30/nv30_context.h | 1 - src/gallium/drivers/nv30/nv30_state_viewport.c | 58 +---- src/gallium/drivers/nv40/nv40_context.h | 1 - src/gallium/drivers/nv40/nv40_state_viewport.c | 57 +---- src/gallium/drivers/nv50/nv50_context.h | 1 - src/gallium/drivers/nv50/nv50_state_validate.c | 62 ++--- src/gallium/drivers/r300/r300_context.h | 2 - src/gallium/drivers/r300/r300_emit.c | 46 ++-- src/gallium/drivers/r300/r300_state.c | 5 +- src/gallium/drivers/r300/r300_state_derived.c | 8 +- src/gallium/drivers/softpipe/sp_video_context.c | 1 - src/gallium/drivers/svga/svga_state_framebuffer.c | 285 ++++++++++----------- src/gallium/drivers/svga/svga_state_need_swtnl.c | 3 +- src/gallium/drivers/trace/tr_dump_state.c | 1 - src/gallium/include/pipe/p_state.h | 10 - src/mesa/state_tracker/st_cb_clear.c | 44 ++-- 25 files changed, 271 insertions(+), 412 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index d5ddc4a6a9..bb0988543f 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -128,9 +128,7 @@ void draw_set_rasterizer_state( struct draw_context *draw, draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); draw->rasterizer = raster; - draw->bypass_clipping = - ((draw->rasterizer && draw->rasterizer->bypass_vs_clip_and_viewport) || - draw->driver.bypass_clipping); + draw->bypass_clipping = draw->driver.bypass_clipping; } @@ -140,9 +138,7 @@ void draw_set_driver_clipping( struct draw_context *draw, draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE ); draw->driver.bypass_clipping = bypass_clipping; - draw->bypass_clipping = - ((draw->rasterizer && draw->rasterizer->bypass_vs_clip_and_viewport) || - draw->driver.bypass_clipping); + draw->bypass_clipping = draw->driver.bypass_clipping; } diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index 341353f628..6d90a6c42f 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -87,9 +87,7 @@ draw_pt_arrays(struct draw_context *draw, opt |= PT_CLIPTEST; } - if (!draw->rasterizer->bypass_vs_clip_and_viewport) { - opt |= PT_SHADE; - } + opt |= PT_SHADE; } if (opt == 0) diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c index c5dfbcfa3c..1aecb51077 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c @@ -100,8 +100,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle, fse->key.nr_elements = MAX2(fse->key.nr_outputs, /* outputs - translate to hw format */ fse->key.nr_inputs); /* inputs - fetch from api format */ - fse->key.viewport = (!draw->rasterizer->bypass_vs_clip_and_viewport && - !draw->identity_viewport); + fse->key.viewport = !draw->identity_viewport; fse->key.clip = !draw->bypass_clipping; fse->key.const_vbuffers = 0; diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c index 56b69354b2..da5106463a 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c @@ -96,8 +96,7 @@ static void fetch_pipeline_prepare( struct draw_pt_middle_end *middle, */ draw_pt_post_vs_prepare( fpme->post_vs, (boolean)draw->bypass_clipping, - (boolean)(draw->identity_viewport || - draw->rasterizer->bypass_vs_clip_and_viewport), + (boolean)draw->identity_viewport, (boolean)draw->rasterizer->gl_rasterization_rules, (draw->vs.edgeflag_output ? true : false) ); @@ -154,9 +153,7 @@ static void fetch_pipeline_run( struct draw_pt_middle_end *middle, (char *)pipeline_verts ); /* Run the shader, note that this overwrites the data[] parts of - * the pipeline verts. If there is no shader, eg if - * bypass_vs_clip_and_viewport, then the inputs == outputs, and are - * already in the correct place. + * the pipeline verts. */ if (opt & PT_SHADE) { @@ -239,9 +236,7 @@ static void fetch_pipeline_linear_run( struct draw_pt_middle_end *middle, (char *)pipeline_verts ); /* Run the shader, note that this overwrites the data[] parts of - * the pipeline verts. If there is no shader, ie if - * bypass_vs_clip_and_viewport, then the inputs == outputs, and are - * already in the correct place. + * the pipeline verts. */ if (opt & PT_SHADE) { @@ -319,9 +314,7 @@ static boolean fetch_pipeline_linear_run_elts( struct draw_pt_middle_end *middle (char *)pipeline_verts ); /* Run the shader, note that this overwrites the data[] parts of - * the pipeline verts. If there is no shader, ie if - * bypass_vs_clip_and_viewport, then the inputs == outputs, and are - * already in the correct place. + * the pipeline verts. */ if (opt & PT_SHADE) { diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index f0bc58a558..90a3230a0f 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -101,7 +101,6 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso) memset(&ctx->rasterizer, 0, sizeof(ctx->rasterizer)); ctx->rasterizer.front_winding = PIPE_WINDING_CW; ctx->rasterizer.cull_mode = PIPE_WINDING_NONE; - ctx->rasterizer.bypass_vs_clip_and_viewport = 1; ctx->rasterizer.gl_rasterization_rules = 1; /* samplers */ @@ -114,7 +113,6 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso) ctx->sampler.mag_img_filter = 0; /* set later */ ctx->sampler.normalized_coords = 1; - /* vertex shader - still required to provide the linkage between * fragment shader input semantics and vertex_element/buffers. */ @@ -407,6 +405,7 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_save_rasterizer(ctx->cso); cso_save_samplers(ctx->cso); cso_save_sampler_textures(ctx->cso); + cso_save_viewport(ctx->cso); cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); @@ -422,6 +421,17 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_single_sampler(ctx->cso, 0, &ctx->sampler); cso_single_sampler_done(ctx->cso); + /* viewport */ + ctx->viewport.scale[0] = 0.5f * dst->width; + ctx->viewport.scale[1] = 0.5f * dst->height; + ctx->viewport.scale[2] = 1.0f; + ctx->viewport.scale[3] = 1.0f; + ctx->viewport.translate[0] = 0.5f * dst->width; + ctx->viewport.translate[1] = 0.5f * dst->height; + ctx->viewport.translate[2] = 0.0f; + ctx->viewport.translate[3] = 0.0f; + cso_set_viewport(ctx->cso, &ctx->viewport); + /* texture */ cso_set_sampler_textures(ctx->cso, 1, &tex); @@ -461,6 +471,7 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_restore_rasterizer(ctx->cso); cso_restore_samplers(ctx->cso); cso_restore_sampler_textures(ctx->cso); + cso_restore_viewport(ctx->cso); cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 18f8606818..50877f6b01 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -160,7 +160,6 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) memset(&rs_state, 0, sizeof(rs_state)); rs_state.front_winding = PIPE_WINDING_CW; rs_state.cull_mode = PIPE_WINDING_NONE; - rs_state.bypass_vs_clip_and_viewport = 1; rs_state.gl_rasterization_rules = 1; rs_state.flatshade = 1; ctx->rs_state = pipe->create_rasterizer_state(pipe, &rs_state); diff --git a/src/gallium/auxiliary/util/u_dump_state.c b/src/gallium/auxiliary/util/u_dump_state.c index eaf4ec90f2..ae7afd7311 100644 --- a/src/gallium/auxiliary/util/u_dump_state.c +++ b/src/gallium/auxiliary/util/u_dump_state.c @@ -318,7 +318,6 @@ util_dump_rasterizer_state(struct os_stream *stream, const struct pipe_rasterize util_dump_member(stream, uint, state, line_stipple_factor); util_dump_member(stream, uint, state, line_stipple_pattern); util_dump_member(stream, bool, state, line_last_pixel); - util_dump_member(stream, bool, state, bypass_vs_clip_and_viewport); util_dump_member(stream, bool, state, flatshade_first); util_dump_member(stream, bool, state, gl_rasterization_rules); diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 1d7329d422..4f9ff1d961 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1296,7 +1296,6 @@ util_create_gen_mipmap(struct pipe_context *pipe, memset(&ctx->rasterizer, 0, sizeof(ctx->rasterizer)); ctx->rasterizer.front_winding = PIPE_WINDING_CW; ctx->rasterizer.cull_mode = PIPE_WINDING_NONE; - ctx->rasterizer.bypass_vs_clip_and_viewport = 1; ctx->rasterizer.gl_rasterization_rules = 1; /* sampler state */ @@ -1361,25 +1360,25 @@ get_next_slot(struct gen_mipmap_state *ctx) static unsigned set_vertex_data(struct gen_mipmap_state *ctx, enum pipe_texture_target tex_target, - uint face, float width, float height) + uint face) { unsigned offset; /* vert[0].position */ - ctx->vertices[0][0][0] = 0.0f; /*x*/ - ctx->vertices[0][0][1] = 0.0f; /*y*/ + ctx->vertices[0][0][0] = -1.0f; /*x*/ + ctx->vertices[0][0][1] = -1.0f; /*y*/ /* vert[1].position */ - ctx->vertices[1][0][0] = width; - ctx->vertices[1][0][1] = 0.0f; + ctx->vertices[1][0][0] = 1.0f; + ctx->vertices[1][0][1] = -1.0f; /* vert[2].position */ - ctx->vertices[2][0][0] = width; - ctx->vertices[2][0][1] = height; + ctx->vertices[2][0][0] = 1.0f; + ctx->vertices[2][0][1] = 1.0f; /* vert[3].position */ - ctx->vertices[3][0][0] = 0.0f; - ctx->vertices[3][0][1] = height; + ctx->vertices[3][0][0] = -1.0f; + ctx->vertices[3][0][1] = 1.0f; /* Setup vertex texcoords. This is a little tricky for cube maps. */ if (tex_target == PIPE_TEXTURE_CUBE) { @@ -1499,6 +1498,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); + cso_save_viewport(ctx->cso); /* bind our state */ cso_set_blend(ctx->cso, &ctx->blend); @@ -1522,6 +1522,7 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, */ for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) { const uint srcLevel = dstLevel - 1; + struct pipe_viewport_state vp; struct pipe_surface *surf = screen->get_tex_surface(screen, pt, face, dstLevel, zslice, @@ -1535,6 +1536,17 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, fb.height = u_minify(pt->height0, dstLevel); cso_set_framebuffer(ctx->cso, &fb); + /* viewport */ + vp.scale[0] = 0.5f * fb.width; + vp.scale[1] = 0.5f * fb.height; + vp.scale[2] = 1.0f; + vp.scale[3] = 1.0f; + vp.translate[0] = 0.5f * fb.width; + vp.translate[1] = 0.5f * fb.height; + vp.translate[2] = 0.0f; + vp.translate[3] = 0.0f; + cso_set_viewport(ctx->cso, &vp); + /* * Setup sampler state * Note: we should only have to set the min/max LOD clamps to ensure @@ -1549,12 +1561,10 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_set_sampler_textures(ctx->cso, 1, &pt); - /* quad coords in window coords (bypassing vs, clip and viewport) */ + /* quad coords in clip coords */ offset = set_vertex_data(ctx, pt->target, - face, - (float) u_minify(pt->width0, dstLevel), - (float) u_minify(pt->height0, dstLevel)); + face); util_draw_vertex_buffer(ctx->pipe, ctx->vbuf, @@ -1578,4 +1588,5 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); + cso_restore_viewport(ctx->cso); } diff --git a/src/gallium/docs/source/cso/rasterizer.rst b/src/gallium/docs/source/cso/rasterizer.rst index 24cc78c68d..ccd9136a2e 100644 --- a/src/gallium/docs/source/cso/rasterizer.rst +++ b/src/gallium/docs/source/cso/rasterizer.rst @@ -10,18 +10,6 @@ multisample state, scissoring and flat/smooth shading. Members ------- -bypass_vs_clip_and_viewport -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Whether the entire TCL pipeline should be bypassed. This implies that -vertices are pre-transformed for the viewport, and will not be run -through the vertex shader. - -.. note:: - - Implementations may still clip away vertices that are not in the viewport - when this is set. - flatshade ^^^^^^^^^ diff --git a/src/gallium/drivers/nv30/nv30_context.h b/src/gallium/drivers/nv30/nv30_context.h index ca3d6aca7f..ea259aadf3 100644 --- a/src/gallium/drivers/nv30/nv30_context.h +++ b/src/gallium/drivers/nv30/nv30_context.h @@ -101,7 +101,6 @@ struct nv30_blend_state { struct nv30_state { unsigned scissor_enabled; unsigned stipple_enabled; - unsigned viewport_bypass; unsigned fp_samplers; uint64_t dirty; diff --git a/src/gallium/drivers/nv30/nv30_state_viewport.c b/src/gallium/drivers/nv30/nv30_state_viewport.c index 2d7781292b..6fccd6b60e 100644 --- a/src/gallium/drivers/nv30/nv30_state_viewport.c +++ b/src/gallium/drivers/nv30/nv30_state_viewport.c @@ -5,55 +5,25 @@ nv30_state_viewport_validate(struct nv30_context *nv30) { struct pipe_viewport_state *vpt = &nv30->viewport; struct nouveau_stateobj *so; - unsigned bypass; - - if (/*nv30->render_mode == HW &&*/ - !nv30->rasterizer->pipe.bypass_vs_clip_and_viewport) - bypass = 0; - else - bypass = 1; if (nv30->state.hw[NV30_STATE_VIEWPORT] && - (bypass || !(nv30->dirty & NV30_NEW_VIEWPORT)) && - nv30->state.viewport_bypass == bypass) + !(nv30->dirty & NV30_NEW_VIEWPORT)) return FALSE; - nv30->state.viewport_bypass = bypass; so = so_new(3, 10, 0); - if (!bypass) { - so_method(so, nv30->screen->rankine, - NV34TCL_VIEWPORT_TRANSLATE_X, 8); - so_data (so, fui(vpt->translate[0])); - so_data (so, fui(vpt->translate[1])); - so_data (so, fui(vpt->translate[2])); - so_data (so, fui(vpt->translate[3])); - so_data (so, fui(vpt->scale[0])); - so_data (so, fui(vpt->scale[1])); - so_data (so, fui(vpt->scale[2])); - so_data (so, fui(vpt->scale[3])); -/* so_method(so, nv30->screen->rankine, 0x1d78, 1); - so_data (so, 1); -*/ } else { - so_method(so, nv30->screen->rankine, - NV34TCL_VIEWPORT_TRANSLATE_X, 8); - so_data (so, fui(0.0)); - so_data (so, fui(0.0)); - so_data (so, fui(0.0)); - so_data (so, fui(0.0)); - so_data (so, fui(1.0)); - so_data (so, fui(1.0)); - so_data (so, fui(1.0)); - so_data (so, fui(0.0)); - /* Not entirely certain what this is yet. The DDX uses this - * value also as it fixes rendering when you pass - * pre-transformed vertices to the GPU. My best gusss is that - * this bypasses some culling/clipping stage. Might be worth - * noting that points/lines are uneffected by whatever this - * value fixes, only filled polygons are effected. - */ -/* so_method(so, nv30->screen->rankine, 0x1d78, 1); - so_data (so, 0x110); -*/ } + so_method(so, nv30->screen->rankine, + NV34TCL_VIEWPORT_TRANSLATE_X, 8); + so_data (so, fui(vpt->translate[0])); + so_data (so, fui(vpt->translate[1])); + so_data (so, fui(vpt->translate[2])); + so_data (so, fui(vpt->translate[3])); + so_data (so, fui(vpt->scale[0])); + so_data (so, fui(vpt->scale[1])); + so_data (so, fui(vpt->scale[2])); + so_data (so, fui(vpt->scale[3])); +/* so_method(so, nv30->screen->rankine, 0x1d78, 1); + so_data (so, 1); +*/ /* TODO/FIXME: never saw value 0x0110 in renouveau dumps, only 0x0001 */ so_method(so, nv30->screen->rankine, 0x1d78, 1); so_data (so, 1); diff --git a/src/gallium/drivers/nv40/nv40_context.h b/src/gallium/drivers/nv40/nv40_context.h index 4861924dac..97fb6a2ef9 100644 --- a/src/gallium/drivers/nv40/nv40_context.h +++ b/src/gallium/drivers/nv40/nv40_context.h @@ -101,7 +101,6 @@ struct nv40_blend_state { struct nv40_state { unsigned scissor_enabled; unsigned stipple_enabled; - unsigned viewport_bypass; unsigned fp_samplers; uint64_t dirty; diff --git a/src/gallium/drivers/nv40/nv40_state_viewport.c b/src/gallium/drivers/nv40/nv40_state_viewport.c index 9919ba1d0b..3aacb00f99 100644 --- a/src/gallium/drivers/nv40/nv40_state_viewport.c +++ b/src/gallium/drivers/nv40/nv40_state_viewport.c @@ -5,55 +5,24 @@ nv40_state_viewport_validate(struct nv40_context *nv40) { struct pipe_viewport_state *vpt = &nv40->viewport; struct nouveau_stateobj *so; - unsigned bypass; - - if (nv40->render_mode == HW && - !nv40->rasterizer->pipe.bypass_vs_clip_and_viewport) - bypass = 0; - else - bypass = 1; if (nv40->state.hw[NV40_STATE_VIEWPORT] && - (bypass || !(nv40->dirty & NV40_NEW_VIEWPORT)) && - nv40->state.viewport_bypass == bypass) + !(nv40->dirty & NV40_NEW_VIEWPORT)) return FALSE; - nv40->state.viewport_bypass = bypass; so = so_new(2, 9, 0); - if (!bypass) { - so_method(so, nv40->screen->curie, - NV40TCL_VIEWPORT_TRANSLATE_X, 8); - so_data (so, fui(vpt->translate[0])); - so_data (so, fui(vpt->translate[1])); - so_data (so, fui(vpt->translate[2])); - so_data (so, fui(vpt->translate[3])); - so_data (so, fui(vpt->scale[0])); - so_data (so, fui(vpt->scale[1])); - so_data (so, fui(vpt->scale[2])); - so_data (so, fui(vpt->scale[3])); - so_method(so, nv40->screen->curie, 0x1d78, 1); - so_data (so, 1); - } else { - so_method(so, nv40->screen->curie, - NV40TCL_VIEWPORT_TRANSLATE_X, 8); - so_data (so, fui(0.0)); - so_data (so, fui(0.0)); - so_data (so, fui(0.0)); - so_data (so, fui(0.0)); - so_data (so, fui(1.0)); - so_data (so, fui(1.0)); - so_data (so, fui(1.0)); - so_data (so, fui(0.0)); - /* Not entirely certain what this is yet. The DDX uses this - * value also as it fixes rendering when you pass - * pre-transformed vertices to the GPU. My best gusss is that - * this bypasses some culling/clipping stage. Might be worth - * noting that points/lines are uneffected by whatever this - * value fixes, only filled polygons are effected. - */ - so_method(so, nv40->screen->curie, 0x1d78, 1); - so_data (so, 0x110); - } + so_method(so, nv40->screen->curie, + NV40TCL_VIEWPORT_TRANSLATE_X, 8); + so_data (so, fui(vpt->translate[0])); + so_data (so, fui(vpt->translate[1])); + so_data (so, fui(vpt->translate[2])); + so_data (so, fui(vpt->translate[3])); + so_data (so, fui(vpt->scale[0])); + so_data (so, fui(vpt->scale[1])); + so_data (so, fui(vpt->scale[2])); + so_data (so, fui(vpt->scale[3])); + so_method(so, nv40->screen->curie, 0x1d78, 1); + so_data (so, 1); so_ref(so, &nv40->state.hw[NV40_STATE_VIEWPORT]); so_ref(NULL, &so); diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index b4de3e2ba5..c540594b94 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -127,7 +127,6 @@ struct nv50_state { struct nouveau_stateobj *scissor; unsigned scissor_enabled; struct nouveau_stateobj *viewport; - unsigned viewport_bypass; struct nouveau_stateobj *tsc_upload; struct nouveau_stateobj *tic_upload; unsigned miptree_nr[PIPE_SHADER_TYPES]; diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index efab94cab7..a91b31015e 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -375,50 +375,32 @@ nv50_state_validate(struct nv50_context *nv50) scissor_uptodate: if (nv50->dirty & (NV50_NEW_VIEWPORT | NV50_NEW_RASTERIZER)) { - unsigned bypass; - - if (!nv50->rasterizer->pipe.bypass_vs_clip_and_viewport) - bypass = 0; - else - bypass = 1; - if (nv50->state.viewport && - (bypass || !(nv50->dirty & NV50_NEW_VIEWPORT)) && - nv50->state.viewport_bypass == bypass) + !(nv50->dirty & NV50_NEW_VIEWPORT)) goto viewport_uptodate; - nv50->state.viewport_bypass = bypass; so = so_new(5, 9, 0); - if (!bypass) { - so_method(so, tesla, NV50TCL_VIEWPORT_TRANSLATE_X(0), 3); - so_data (so, fui(nv50->viewport.translate[0])); - so_data (so, fui(nv50->viewport.translate[1])); - so_data (so, fui(nv50->viewport.translate[2])); - so_method(so, tesla, NV50TCL_VIEWPORT_SCALE_X(0), 3); - so_data (so, fui(nv50->viewport.scale[0])); - so_data (so, fui(nv50->viewport.scale[1])); - so_data (so, fui(nv50->viewport.scale[2])); - - so_method(so, tesla, NV50TCL_VIEWPORT_TRANSFORM_EN, 1); - so_data (so, 1); - /* 0x0000 = remove whole primitive only (xyz) - * 0x1018 = remove whole primitive only (xy), clamp z - * 0x1080 = clip primitive (xyz) - * 0x1098 = clip primitive (xy), clamp z - */ - so_method(so, tesla, NV50TCL_VIEW_VOLUME_CLIP_CTRL, 1); - so_data (so, 0x1080); - /* no idea what 0f90 does */ - so_method(so, tesla, 0x0f90, 1); - so_data (so, 0); - } else { - so_method(so, tesla, NV50TCL_VIEWPORT_TRANSFORM_EN, 1); - so_data (so, 0); - so_method(so, tesla, NV50TCL_VIEW_VOLUME_CLIP_CTRL, 1); - so_data (so, 0x0000); - so_method(so, tesla, 0x0f90, 1); - so_data (so, 1); - } + so_method(so, tesla, NV50TCL_VIEWPORT_TRANSLATE_X(0), 3); + so_data (so, fui(nv50->viewport.translate[0])); + so_data (so, fui(nv50->viewport.translate[1])); + so_data (so, fui(nv50->viewport.translate[2])); + so_method(so, tesla, NV50TCL_VIEWPORT_SCALE_X(0), 3); + so_data (so, fui(nv50->viewport.scale[0])); + so_data (so, fui(nv50->viewport.scale[1])); + so_data (so, fui(nv50->viewport.scale[2])); + + so_method(so, tesla, NV50TCL_VIEWPORT_TRANSFORM_EN, 1); + so_data (so, 1); + /* 0x0000 = remove whole primitive only (xyz) + * 0x1018 = remove whole primitive only (xy), clamp z + * 0x1080 = clip primitive (xyz) + * 0x1098 = clip primitive (xy), clamp z + */ + so_method(so, tesla, NV50TCL_VIEW_VOLUME_CLIP_CTRL, 1); + so_data (so, 0x1080); + /* no idea what 0f90 does */ + so_method(so, tesla, 0x0f90, 1); + so_data (so, 0); so_ref(so, &nv50->state.viewport); so_ref(NULL, &so); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 443af4ec2e..2f056aafcb 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -337,8 +337,6 @@ struct r300_context { uint32_t dirty_state; /* Flag indicating whether or not the HW is dirty. */ uint32_t dirty_hw; - /* Whether the TCL engine should be in bypass mode. */ - boolean tcl_bypass; /* Whether polygon offset is enabled. */ boolean polygon_offset_enabled; /* Z buffer bit depth. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index f7dcd8dc52..37ebe6c49d 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -170,23 +170,15 @@ static const float * get_shader_constant( break; case RC_STATE_R300_VIEWPORT_SCALE: - if (r300->tcl_bypass) { - vec[0] = 1; - vec[1] = 1; - vec[2] = 1; - } else { - vec[0] = viewport->xscale; - vec[1] = viewport->yscale; - vec[2] = viewport->zscale; - } + vec[0] = viewport->xscale; + vec[1] = viewport->yscale; + vec[2] = viewport->zscale; break; case RC_STATE_R300_VIEWPORT_OFFSET: - if (!r300->tcl_bypass) { - vec[0] = viewport->xoffset; - vec[1] = viewport->yoffset; - vec[2] = viewport->zoffset; - } + vec[0] = viewport->xoffset; + vec[1] = viewport->yoffset; + vec[2] = viewport->zoffset; break; default: @@ -936,22 +928,16 @@ void r300_emit_viewport_state(struct r300_context* r300, void* state) struct r300_viewport_state* viewport = (struct r300_viewport_state*)state; CS_LOCALS(r300); - if (r300->tcl_bypass) { - BEGIN_CS(2); - OUT_CS_REG(R300_VAP_VTE_CNTL, 0); - END_CS; - } else { - BEGIN_CS(9); - OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); - OUT_CS_32F(viewport->xscale); - OUT_CS_32F(viewport->xoffset); - OUT_CS_32F(viewport->yscale); - OUT_CS_32F(viewport->yoffset); - OUT_CS_32F(viewport->zscale); - OUT_CS_32F(viewport->zoffset); - OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control); - END_CS; - } + BEGIN_CS(9); + OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); + OUT_CS_32F(viewport->xscale); + OUT_CS_32F(viewport->xoffset); + OUT_CS_32F(viewport->yscale); + OUT_CS_32F(viewport->yoffset); + OUT_CS_32F(viewport->zscale); + OUT_CS_32F(viewport->zoffset); + OUT_CS_REG(R300_VAP_VTE_CNTL, viewport->vte_control); + END_CS; } void r300_emit_texture_count(struct r300_context* r300) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 34bf81c193..3550c69c46 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -711,8 +711,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe, /* If bypassing TCL, or if no TCL engine is present, turn off the HW TCL. * Else, enable HW TCL and force Draw's TCL off. */ - if (state->bypass_vs_clip_and_viewport || - !r300screen->caps->has_tcl) { + if (!r300screen->caps->has_tcl) { rs->vap_control_status |= R300_VAP_TCL_BYPASS; } @@ -824,10 +823,8 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) } if (rs) { - r300->tcl_bypass = rs->rs.bypass_vs_clip_and_viewport; r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; } else { - r300->tcl_bypass = FALSE; r300->polygon_offset_enabled = FALSE; } diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 2cbce9210a..778eaaacd9 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -114,13 +114,7 @@ static void r300_vertex_psc(struct r300_context* r300) int identity[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; int* stream_tab; - /* If TCL is bypassed, map vertex streams to equivalent VS output - * locations. */ - if (r300->tcl_bypass) { - stream_tab = r300->vs->stream_loc_notcl; - } else { - stream_tab = identity; - } + stream_tab = identity; /* Vertex shaders have no semantics on their inputs, * so PSC should just route stuff based on the vertex elements, diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index 7a3a636167..8e4867a904 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -174,7 +174,6 @@ init_pipe_state(struct sp_mpeg12_context *ctx) rast.line_stipple_factor = 0; rast.line_stipple_pattern = 0; rast.line_last_pixel = 0; - rast.bypass_vs_clip_and_viewport = 0; rast.line_width = 1; rast.point_smooth = 0; rast.point_quad_rasterization = 0; diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c index b4cafb8f21..4d0c06bd77 100644 --- a/src/gallium/drivers/svga/svga_state_framebuffer.c +++ b/src/gallium/drivers/svga/svga_state_framebuffer.c @@ -120,174 +120,153 @@ static int emit_viewport( struct svga_context *svga, float fb_width = svga->curr.framebuffer.width; float fb_height = svga->curr.framebuffer.height; - memset( &prescale, 0, sizeof(prescale) ); - - if (svga->curr.rast->templ.bypass_vs_clip_and_viewport) { - - /* Avoid POSITIONT as it has a non trivial implementation outside the D3D - * API. Always generate a vertex shader. - */ - rect.x = 0; - rect.y = 0; - rect.w = svga->curr.framebuffer.width; - rect.h = svga->curr.framebuffer.height; - - prescale.scale[0] = 2.0 / (float)rect.w; - prescale.scale[1] = - 2.0 / (float)rect.h; - prescale.scale[2] = 1.0; - prescale.scale[3] = 1.0; - prescale.translate[0] = -1.0f; - prescale.translate[1] = 1.0f; - prescale.translate[2] = 0; - prescale.translate[3] = 0; - prescale.enabled = TRUE; - } else { - - /* Examine gallium viewport transformation and produce a screen - * rectangle and possibly vertex shader pre-transformation to - * get the same results. - */ - float fx = viewport->scale[0] * -1.0 + viewport->translate[0]; - float fy = flip * viewport->scale[1] * -1.0 + viewport->translate[1]; - float fw = viewport->scale[0] * 2; - float fh = flip * viewport->scale[1] * 2; - - SVGA_DBG(DEBUG_VIEWPORT, - "\ninitial %f,%f %fx%f\n", - fx, - fy, - fw, - fh); - - prescale.scale[0] = 1.0; - prescale.scale[1] = 1.0; - prescale.scale[2] = 1.0; - prescale.scale[3] = 1.0; - prescale.translate[0] = 0; - prescale.translate[1] = 0; - prescale.translate[2] = 0; - prescale.translate[3] = 0; - prescale.enabled = TRUE; - - - - if (fw < 0) { - prescale.scale[0] *= -1.0; - prescale.translate[0] += -fw; - fw = -fw; - fx = viewport->scale[0] * 1.0 + viewport->translate[0]; - } + float fx = viewport->scale[0] * -1.0 + viewport->translate[0]; + float fy = flip * viewport->scale[1] * -1.0 + viewport->translate[1]; + float fw = viewport->scale[0] * 2; + float fh = flip * viewport->scale[1] * 2; - if (fh < 0) { - prescale.scale[1] *= -1.0; - prescale.translate[1] += -fh; - fh = -fh; - fy = flip * viewport->scale[1] * 1.0 + viewport->translate[1]; - } + memset( &prescale, 0, sizeof(prescale) ); - if (fx < 0) { - prescale.translate[0] += fx; - prescale.scale[0] *= fw / (fw + fx); - fw += fx; - fx = 0; - } + /* Examine gallium viewport transformation and produce a screen + * rectangle and possibly vertex shader pre-transformation to + * get the same results. + */ - if (fy < 0) { - prescale.translate[1] += fy; - prescale.scale[1] *= fh / (fh + fy); - fh += fy; - fy = 0; - } + SVGA_DBG(DEBUG_VIEWPORT, + "\ninitial %f,%f %fx%f\n", + fx, + fy, + fw, + fh); + + prescale.scale[0] = 1.0; + prescale.scale[1] = 1.0; + prescale.scale[2] = 1.0; + prescale.scale[3] = 1.0; + prescale.translate[0] = 0; + prescale.translate[1] = 0; + prescale.translate[2] = 0; + prescale.translate[3] = 0; + prescale.enabled = TRUE; + + + + if (fw < 0) { + prescale.scale[0] *= -1.0; + prescale.translate[0] += -fw; + fw = -fw; + fx = viewport->scale[0] * 1.0 + viewport->translate[0]; + } - if (fx + fw > fb_width) { - prescale.scale[0] *= fw / (fb_width - fx); - prescale.translate[0] -= fx * (fw / (fb_width - fx)); - prescale.translate[0] += fx; - fw = fb_width - fx; - - } + if (fh < 0) { + prescale.scale[1] *= -1.0; + prescale.translate[1] += -fh; + fh = -fh; + fy = flip * viewport->scale[1] * 1.0 + viewport->translate[1]; + } - if (fy + fh > fb_height) { - prescale.scale[1] *= fh / (fb_height - fy); - prescale.translate[1] -= fy * (fh / (fb_height - fy)); - prescale.translate[1] += fy; - fh = fb_height - fy; - } + if (fx < 0) { + prescale.translate[0] += fx; + prescale.scale[0] *= fw / (fw + fx); + fw += fx; + fx = 0; + } - if (fw < 0 || fh < 0) { - fw = fh = fx = fy = 0; - degenerate = TRUE; - goto out; - } + if (fy < 0) { + prescale.translate[1] += fy; + prescale.scale[1] *= fh / (fh + fy); + fh += fy; + fy = 0; + } + if (fx + fw > fb_width) { + prescale.scale[0] *= fw / (fb_width - fx); + prescale.translate[0] -= fx * (fw / (fb_width - fx)); + prescale.translate[0] += fx; + fw = fb_width - fx; + + } - /* D3D viewport is integer space. Convert fx,fy,etc. to - * integers. - * - * TODO: adjust pretranslate correct for any subpixel error - * introduced converting to integers. - */ - rect.x = fx; - rect.y = fy; - rect.w = fw; - rect.h = fh; + if (fy + fh > fb_height) { + prescale.scale[1] *= fh / (fb_height - fy); + prescale.translate[1] -= fy * (fh / (fb_height - fy)); + prescale.translate[1] += fy; + fh = fb_height - fy; + } - SVGA_DBG(DEBUG_VIEWPORT, - "viewport error %f,%f %fx%f\n", - fabs((float)rect.x - fx), - fabs((float)rect.y - fy), - fabs((float)rect.w - fw), - fabs((float)rect.h - fh)); + if (fw < 0 || fh < 0) { + fw = fh = fx = fy = 0; + degenerate = TRUE; + goto out; + } - SVGA_DBG(DEBUG_VIEWPORT, - "viewport %d,%d %dx%d\n", - rect.x, - rect.y, - rect.w, - rect.h); - - /* Finally, to get GL rasterization rules, need to tweak the - * screen-space coordinates slightly relative to D3D which is - * what hardware implements natively. - */ - if (svga->curr.rast->templ.gl_rasterization_rules) { - float adjust_x = 0.0; - float adjust_y = 0.0; - - switch (svga->curr.reduced_prim) { - case PIPE_PRIM_LINES: - adjust_x = -0.5; - adjust_y = 0; - break; - case PIPE_PRIM_POINTS: - case PIPE_PRIM_TRIANGLES: - adjust_x = -0.375; - adjust_y = -0.5; - break; - } - - prescale.translate[0] += adjust_x; - prescale.translate[1] += adjust_y; - prescale.translate[2] = 0.5; /* D3D clip space */ - prescale.scale[2] = 0.5; /* D3D clip space */ + /* D3D viewport is integer space. Convert fx,fy,etc. to + * integers. + * + * TODO: adjust pretranslate correct for any subpixel error + * introduced converting to integers. + */ + rect.x = fx; + rect.y = fy; + rect.w = fw; + rect.h = fh; + + SVGA_DBG(DEBUG_VIEWPORT, + "viewport error %f,%f %fx%f\n", + fabs((float)rect.x - fx), + fabs((float)rect.y - fy), + fabs((float)rect.w - fw), + fabs((float)rect.h - fh)); + + SVGA_DBG(DEBUG_VIEWPORT, + "viewport %d,%d %dx%d\n", + rect.x, + rect.y, + rect.w, + rect.h); + + + /* Finally, to get GL rasterization rules, need to tweak the + * screen-space coordinates slightly relative to D3D which is + * what hardware implements natively. + */ + if (svga->curr.rast->templ.gl_rasterization_rules) { + float adjust_x = 0.0; + float adjust_y = 0.0; + + switch (svga->curr.reduced_prim) { + case PIPE_PRIM_LINES: + adjust_x = -0.5; + adjust_y = 0; + break; + case PIPE_PRIM_POINTS: + case PIPE_PRIM_TRIANGLES: + adjust_x = -0.375; + adjust_y = -0.5; + break; } + prescale.translate[0] += adjust_x; + prescale.translate[1] += adjust_y; + prescale.translate[2] = 0.5; /* D3D clip space */ + prescale.scale[2] = 0.5; /* D3D clip space */ + } - range_min = viewport->scale[2] * -1.0 + viewport->translate[2]; - range_max = viewport->scale[2] * 1.0 + viewport->translate[2]; - /* D3D (and by implication SVGA) doesn't like dealing with zmax - * less than zmin. Detect that case, flip the depth range and - * invert our z-scale factor to achieve the same effect. - */ - if (range_min > range_max) { - float range_tmp; - range_tmp = range_min; - range_min = range_max; - range_max = range_tmp; - prescale.scale[2] = -prescale.scale[2]; - } + range_min = viewport->scale[2] * -1.0 + viewport->translate[2]; + range_max = viewport->scale[2] * 1.0 + viewport->translate[2]; + + /* D3D (and by implication SVGA) doesn't like dealing with zmax + * less than zmin. Detect that case, flip the depth range and + * invert our z-scale factor to achieve the same effect. + */ + if (range_min > range_max) { + float range_tmp; + range_tmp = range_min; + range_min = range_max; + range_max = range_tmp; + prescale.scale[2] = -prescale.scale[2]; } if (prescale.enabled) { diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index dd13a89d24..a6ed18599c 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -129,8 +129,7 @@ static int update_need_pipeline( struct svga_context *svga, /* SVGA_NEW_CLIP */ - if (!svga->curr.rast->templ.bypass_vs_clip_and_viewport && - svga->curr.clip.nr) { + if (svga->curr.clip.nr) { SVGA_DBG(DEBUG_SWTNL, "%s: userclip\n", __FUNCTION__); need_pipeline = TRUE; } diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index 6da186a655..f97d963dba 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -112,7 +112,6 @@ void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state) trace_dump_member(uint, state, line_stipple_factor); trace_dump_member(uint, state, line_stipple_pattern); trace_dump_member(bool, state, line_last_pixel); - trace_dump_member(bool, state, bypass_vs_clip_and_viewport); trace_dump_member(bool, state, flatshade_first); trace_dump_member(bool, state, gl_rasterization_rules); diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 5ac5c87813..02558520bf 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -113,16 +113,6 @@ struct pipe_rasterizer_state unsigned line_stipple_pattern:16; unsigned line_last_pixel:1; - /** - * Vertex coordinates are pre-transformed to screen space. Skip - * the vertex shader, clipping and viewport processing. Note that - * a vertex shader is still needed though, to indicate the mapping - * from vertex elements to fragment shader input semantics. - * - * XXX: considered for removal. - */ - unsigned bypass_vs_clip_and_viewport:1; - /** * Use the first vertex of a primitive as the provoking vertex for * flat shading. diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 898c32293d..5edab55cca 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -65,9 +65,6 @@ st_init_clear(struct st_context *st) memset(&st->clear.raster, 0, sizeof(st->clear.raster)); st->clear.raster.gl_rasterization_rules = 1; - /* rasterizer state: bypass vertex shader, clipping and viewport */ - st->clear.raster.bypass_vs_clip_and_viewport = 1; - /* fragment shader state: color pass-through program */ st->clear.fs = util_make_fragment_passthrough_shader(pipe); @@ -104,9 +101,7 @@ st_destroy_clear(struct st_context *st) /** * Draw a screen-aligned quadrilateral. - * Coords are window coords with y=0=bottom. These will be passed - * through unmodified to the rasterizer as we have set - * rasterizer->bypass_vs_clip_and_viewport. + * Coords are clip coords with y=0=bottom. */ static void draw_quad(GLcontext *ctx, @@ -192,18 +187,13 @@ clear_with_quad(GLcontext *ctx, GLboolean color, GLboolean depth, GLboolean stencil) { struct st_context *st = ctx->st; - const GLfloat x0 = (GLfloat) ctx->DrawBuffer->_Xmin; - const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax; - GLfloat y0, y1; - - if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - y0 = (GLfloat) (ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax); - y1 = (GLfloat) (ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin); - } - else { - y0 = (GLfloat) ctx->DrawBuffer->_Ymin; - y1 = (GLfloat) ctx->DrawBuffer->_Ymax; - } + const struct gl_framebuffer *fb = ctx->DrawBuffer; + const GLfloat fb_width = (GLfloat) fb->Width; + const GLfloat fb_height = (GLfloat) fb->Height; + const GLfloat x0 = (GLfloat) ctx->DrawBuffer->_Xmin / fb_width * 2.0f - 1.0f; + const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 1.0f; + const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 1.0f; + const GLfloat y1 = (GLfloat) ctx->DrawBuffer->_Ymax / fb_height * 2.0f - 1.0f; /* printf("%s %s%s%s %f,%f %f,%f\n", __FUNCTION__, @@ -218,6 +208,7 @@ clear_with_quad(GLcontext *ctx, cso_save_stencil_ref(st->cso_context); cso_save_depth_stencil_alpha(st->cso_context); cso_save_rasterizer(st->cso_context); + cso_save_viewport(st->cso_context); cso_save_fragment_shader(st->cso_context); cso_save_vertex_shader(st->cso_context); @@ -273,6 +264,21 @@ clear_with_quad(GLcontext *ctx, cso_set_rasterizer(st->cso_context, &st->clear.raster); + /* viewport state: viewport matching window dims */ + { + const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP); + struct pipe_viewport_state vp; + vp.scale[0] = 0.5f * fb_width; + vp.scale[1] = fb_height * (invert ? -0.5f : 0.5f); + vp.scale[2] = 1.0f; + vp.scale[3] = 1.0f; + vp.translate[0] = 0.5f * fb_width; + vp.translate[1] = 0.5f * fb_height; + vp.translate[2] = 0.0f; + vp.translate[3] = 0.0f; + cso_set_viewport(st->cso_context, &vp); + } + cso_set_fragment_shader_handle(st->cso_context, st->clear.fs); cso_set_vertex_shader_handle(st->cso_context, st->clear.vs); @@ -284,9 +290,9 @@ clear_with_quad(GLcontext *ctx, cso_restore_stencil_ref(st->cso_context); cso_restore_depth_stencil_alpha(st->cso_context); cso_restore_rasterizer(st->cso_context); + cso_restore_viewport(st->cso_context); cso_restore_fragment_shader(st->cso_context); cso_restore_vertex_shader(st->cso_context); - } -- cgit v1.2.3 From 12d5203bb39a6146c5fd08b66f49b4fc1feb1162 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 27 Jan 2010 14:45:56 +0000 Subject: svga: Fix PIPE_LOGICOP_INVERT. Actually the current XOR implementation is an INVERT. This fixes rectangle selection in Maya. --- src/gallium/drivers/svga/svga_pipe_blend.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_pipe_blend.c b/src/gallium/drivers/svga/svga_pipe_blend.c index b60117f090..594eec7166 100644 --- a/src/gallium/drivers/svga/svga_pipe_blend.c +++ b/src/gallium/drivers/svga/svga_pipe_blend.c @@ -92,6 +92,7 @@ svga_create_blend_state(struct pipe_context *pipe, if (templ->logicop_enable) { switch (templ->logicop_func) { case PIPE_LOGICOP_XOR: + case PIPE_LOGICOP_INVERT: blend->need_white_fragments = TRUE; blend->rt[i].blend_enable = TRUE; blend->rt[i].srcblend = SVGA3D_BLENDOP_ONE; @@ -125,12 +126,6 @@ svga_create_blend_state(struct pipe_context *pipe, blend->rt[i].dstblend = SVGA3D_BLENDOP_ONE; blend->rt[i].blendeq = SVGA3D_BLENDEQ_MAXIMUM; break; - case PIPE_LOGICOP_INVERT: - blend->rt[i].blend_enable = TRUE; - blend->rt[i].srcblend = SVGA3D_BLENDOP_INVSRCCOLOR; - blend->rt[i].dstblend = SVGA3D_BLENDOP_ZERO; - blend->rt[i].blendeq = SVGA3D_BLENDEQ_ADD; - break; case PIPE_LOGICOP_AND: /* Approximate with minimum - works for the 0 & anything case: */ blend->rt[i].blend_enable = TRUE; -- cgit v1.2.3 From 422167a9b0dc5b6da7bc7c47621b5da1bc6d315b Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 27 Jan 2010 15:41:25 +0000 Subject: svga: Prevent buffer overflow in buffer ranges. Do this by extending the nearest range to cover the new range. This fixes an access fault in Call of Duty which was doing many disjoint glBufferSubData calls. --- src/gallium/drivers/svga/svga_screen_buffer.c | 62 +++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index c9e9bef540..0371ddde36 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -311,10 +311,20 @@ svga_buffer_upload_queue(struct svga_buffer *sbuf, unsigned end) { unsigned i; + unsigned nearest_range; + unsigned nearest_dist; assert(sbuf->hw.buf); assert(end > start); + if (sbuf->hw.num_ranges < SVGA_BUFFER_MAX_RANGES) { + nearest_range = sbuf->hw.num_ranges; + nearest_dist = ~0; + } else { + nearest_range = SVGA_BUFFER_MAX_RANGES - 1; + nearest_dist = 0; + } + /* * Try to grow one of the ranges. * @@ -326,11 +336,33 @@ svga_buffer_upload_queue(struct svga_buffer *sbuf, */ for(i = 0; i < sbuf->hw.num_ranges; ++i) { - if(start <= sbuf->hw.ranges[i].end && sbuf->hw.ranges[i].start <= end) { + int left_dist; + int right_dist; + int dist; + + left_dist = start - sbuf->hw.ranges[i].end; + right_dist = sbuf->hw.ranges[i].start - end; + dist = MAX2(left_dist, right_dist); + + if (dist <= 0) { + /* + * Ranges are contiguous or overlapping -- extend this one and return. + */ + sbuf->hw.ranges[i].start = MIN2(sbuf->hw.ranges[i].start, start); - sbuf->hw.ranges[i].end = MAX2(sbuf->hw.ranges[i].end, end); + sbuf->hw.ranges[i].end = MAX2(sbuf->hw.ranges[i].end, end); return; } + else { + /* + * Discontiguous ranges -- keep track of the nearest range. + */ + + if (dist < nearest_dist) { + nearest_range = i; + nearest_dist = dist; + } + } } /* @@ -345,13 +377,27 @@ svga_buffer_upload_queue(struct svga_buffer *sbuf, assert(!sbuf->hw.svga); assert(!sbuf->hw.boxes); - /* - * Add a new range. - */ + if (sbuf->hw.num_ranges < SVGA_BUFFER_MAX_RANGES) { + /* + * Add a new range. + */ - sbuf->hw.ranges[sbuf->hw.num_ranges].start = start; - sbuf->hw.ranges[sbuf->hw.num_ranges].end = end; - ++sbuf->hw.num_ranges; + sbuf->hw.ranges[sbuf->hw.num_ranges].start = start; + sbuf->hw.ranges[sbuf->hw.num_ranges].end = end; + ++sbuf->hw.num_ranges; + } else { + /* + * Everything else failed, so just extend the nearest range. + * + * It is OK to do this because we always keep a local copy of the + * host buffer data, for SW TNL, and the host never modifies the buffer. + */ + + assert(nearest_range < SVGA_BUFFER_MAX_RANGES); + assert(nearest_range < sbuf->hw.num_ranges); + sbuf->hw.ranges[nearest_range].start = MIN2(sbuf->hw.ranges[nearest_range].start, start); + sbuf->hw.ranges[nearest_range].end = MAX2(sbuf->hw.ranges[nearest_range].end, end); + } } -- cgit v1.2.3 From 935929595c31ded8827f081150d1024ff2909d6b Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 16 Feb 2010 15:51:34 +0000 Subject: pipebuffer: Don't synchronize when checking for buffer overflows. To avoid masking synchronization issues in debug builds. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index c2593cf165..a5dbded2bc 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -179,7 +179,9 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) { uint8_t *map; - map = pb_map(buf->buffer, PIPE_BUFFER_USAGE_CPU_READ); + map = pb_map(buf->buffer, + PIPE_BUFFER_USAGE_CPU_READ | + PIPE_BUFFER_USAGE_UNSYNCHRONIZED); assert(map); if(map) { boolean underflow, overflow; -- cgit v1.2.3 From 21480fb9e4cad4f0e411c2ffc64e8c9a752d45e8 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 16 Feb 2010 16:43:53 +0000 Subject: svga: Remove unused buffer download code. Unnecessary now that we never destroy buffer storage. --- src/gallium/drivers/svga/svga_screen_buffer.c | 40 --------------------------- src/gallium/drivers/svga/svga_screen_buffer.h | 5 ---- 2 files changed, 45 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 0371ddde36..525352f347 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -288,8 +288,6 @@ svga_buffer_upload_flush(struct svga_context *svga, sbuf->hw.svga = NULL; sbuf->hw.boxes = NULL; - sbuf->host_written = TRUE; - /* Decrement reference count */ pipe_reference(&(sbuf->base.reference), NULL); sbuf = NULL; @@ -420,44 +418,6 @@ svga_buffer_map_range( struct pipe_screen *screen, if(!sbuf->hw.buf) { if(svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK) return NULL; - - /* Populate the hardware storage if the host surface pre-existed */ - if(sbuf->host_written) { - SVGA3dSurfaceDMAFlags flags; - enum pipe_error ret; - struct pipe_fence_handle *fence = NULL; - - assert(sbuf->handle); - - SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "dma from sid %p (buffer), bytes %u - %u\n", - sbuf->handle, 0, sbuf->base.size); - - memset(&flags, 0, sizeof flags); - - ret = SVGA3D_BufferDMA(ss->swc, - sbuf->hw.buf, - sbuf->handle, - SVGA3D_READ_HOST_VRAM, - sbuf->base.size, - 0, - flags); - if(ret != PIPE_OK) { - ss->swc->flush(ss->swc, NULL); - - ret = SVGA3D_BufferDMA(ss->swc, - sbuf->hw.buf, - sbuf->handle, - SVGA3D_READ_HOST_VRAM, - sbuf->base.size, - 0, - flags); - assert(ret == PIPE_OK); - } - - ss->swc->flush(ss->swc, &fence); - sws->fence_finish(sws, fence, 0); - sws->fence_reference(sws, &fence, NULL); - } } map = sws->buffer_map(sws, sbuf->hw.buf, usage); diff --git a/src/gallium/drivers/svga/svga_screen_buffer.h b/src/gallium/drivers/svga/svga_screen_buffer.h index 448ac107c7..e0e1b22e46 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.h +++ b/src/gallium/drivers/svga/svga_screen_buffer.h @@ -135,11 +135,6 @@ struct svga_buffer */ struct svga_winsys_surface *handle; - /** - * Whether the host has been ever written. - */ - boolean host_written; - struct { unsigned count; boolean writing; -- cgit v1.2.3 From 6390dbb3734a7979b5a8a9410f02c7f2db4fa8ec Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 18 Feb 2010 18:11:50 +0000 Subject: svga: Temporarily create a sw vertex buf when failed to create a hw buf. Many apps don't check the return of map buffer so it is better not to fail. --- src/gallium/drivers/svga/svga_screen_buffer.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 525352f347..8f591e1977 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -410,18 +410,31 @@ svga_buffer_map_range( struct pipe_screen *screen, struct svga_buffer *sbuf = svga_buffer( buf ); void *map; - if(sbuf->swbuf) { + if (!sbuf->swbuf && !sbuf->hw.buf) { + if (svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK) { + /* + * We can't create a hardware buffer big enough, so create a malloc + * buffer instead. + */ + + debug_printf("%s: failed to allocate %u KB of DMA, splitting DMA transfers\n", + __FUNCTION__, + (sbuf->base.size + 1023)/1024); + + sbuf->swbuf = align_malloc(sbuf->base.size, sbuf->base.alignment); + } + } + + if (sbuf->swbuf) { /* User/malloc buffer */ map = sbuf->swbuf; } - else { - if(!sbuf->hw.buf) { - if(svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK) - return NULL; - } - + else if (sbuf->hw.buf) { map = sws->buffer_map(sws, sbuf->hw.buf, usage); } + else { + map = NULL; + } if(map) { pipe_mutex_lock(ss->swc_mutex); -- cgit v1.2.3 From cf861335a44376609258a2ec399c215e35f9f075 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 18 Feb 2010 14:05:57 +0000 Subject: svga: Further cleanup/comment svga buffer code. Just cosmetic changes -- no behavior change. --- src/gallium/drivers/svga/svga_screen_buffer.c | 144 +++++++++++++------------- src/gallium/drivers/svga/svga_screen_buffer.h | 110 +++++++++++++------- 2 files changed, 142 insertions(+), 112 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 8f591e1977..bf637f2aa9 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -83,7 +83,7 @@ svga_buffer_create_host_surface(struct svga_screen *ss, * as svga_screen_surface_create might have passed a recycled host * buffer. */ - sbuf->hw.flags.discard = TRUE; + sbuf->dma.flags.discard = TRUE; SVGA_DBG(DEBUG_DMA, " --> got sid %p sz %d (buffer)\n", sbuf->handle, sbuf->base.size); } @@ -109,10 +109,10 @@ svga_buffer_destroy_hw_storage(struct svga_screen *ss, struct svga_buffer *sbuf) struct svga_winsys_screen *sws = ss->sws; assert(!sbuf->map.count); - assert(sbuf->hw.buf); - if(sbuf->hw.buf) { - sws->buffer_destroy(sws, sbuf->hw.buf); - sbuf->hw.buf = NULL; + assert(sbuf->hwbuf); + if(sbuf->hwbuf) { + sws->buffer_destroy(sws, sbuf->hwbuf); + sbuf->hwbuf = NULL; } } @@ -151,16 +151,16 @@ static INLINE enum pipe_error svga_buffer_create_hw_storage(struct svga_screen *ss, struct svga_buffer *sbuf) { - if(!sbuf->hw.buf) { + if(!sbuf->hwbuf) { unsigned alignment = sbuf->base.alignment; unsigned usage = 0; unsigned size = sbuf->base.size; - sbuf->hw.buf = svga_winsys_buffer_create(ss, alignment, usage, size); - if(!sbuf->hw.buf) + sbuf->hwbuf = svga_winsys_buffer_create(ss, alignment, usage, size); + if(!sbuf->hwbuf) return PIPE_ERROR_OUT_OF_MEMORY; - assert(!sbuf->needs_flush); + assert(!sbuf->dma.pending); } return PIPE_OK; @@ -175,12 +175,12 @@ svga_buffer_upload_command(struct svga_context *svga, struct svga_buffer *sbuf) { struct svga_winsys_context *swc = svga->swc; - struct svga_winsys_buffer *guest = sbuf->hw.buf; + struct svga_winsys_buffer *guest = sbuf->hwbuf; struct svga_winsys_surface *host = sbuf->handle; SVGA3dTransferType transfer = SVGA3D_WRITE_HOST_VRAM; - SVGA3dSurfaceDMAFlags flags = sbuf->hw.flags; + SVGA3dSurfaceDMAFlags flags = sbuf->dma.flags; SVGA3dCmdSurfaceDMA *cmd; - uint32 numBoxes = sbuf->hw.num_ranges; + uint32 numBoxes = sbuf->map.num_ranges; SVGA3dCopyBox *boxes; SVGA3dCmdSurfaceDMASuffix *pSuffix; unsigned region_flags; @@ -218,8 +218,8 @@ svga_buffer_upload_command(struct svga_context *svga, cmd->transfer = transfer; - sbuf->hw.boxes = (SVGA3dCopyBox *)&cmd[1]; - sbuf->hw.svga = svga; + sbuf->dma.boxes = (SVGA3dCopyBox *)&cmd[1]; + sbuf->dma.svga = svga; /* Increment reference count */ dummy = NULL; @@ -248,10 +248,10 @@ svga_buffer_upload_flush(struct svga_context *svga, unsigned i; assert(sbuf->handle); - assert(sbuf->hw.buf); - assert(sbuf->hw.num_ranges); - assert(sbuf->hw.svga == svga); - assert(sbuf->hw.boxes); + assert(sbuf->hwbuf); + assert(sbuf->map.num_ranges); + assert(sbuf->dma.svga == svga); + assert(sbuf->dma.boxes); /* * Patch the DMA command with the final copy box. @@ -259,34 +259,34 @@ svga_buffer_upload_flush(struct svga_context *svga, SVGA_DBG(DEBUG_DMA, "dma to sid %p\n", sbuf->handle); - boxes = sbuf->hw.boxes; - for(i = 0; i < sbuf->hw.num_ranges; ++i) { + boxes = sbuf->dma.boxes; + for(i = 0; i < sbuf->map.num_ranges; ++i) { SVGA_DBG(DEBUG_DMA, " bytes %u - %u\n", - sbuf->hw.ranges[i].start, sbuf->hw.ranges[i].end); + sbuf->map.ranges[i].start, sbuf->map.ranges[i].end); - boxes[i].x = sbuf->hw.ranges[i].start; + boxes[i].x = sbuf->map.ranges[i].start; boxes[i].y = 0; boxes[i].z = 0; - boxes[i].w = sbuf->hw.ranges[i].end - sbuf->hw.ranges[i].start; + boxes[i].w = sbuf->map.ranges[i].end - sbuf->map.ranges[i].start; boxes[i].h = 1; boxes[i].d = 1; - boxes[i].srcx = sbuf->hw.ranges[i].start; + boxes[i].srcx = sbuf->map.ranges[i].start; boxes[i].srcy = 0; boxes[i].srcz = 0; } - sbuf->hw.num_ranges = 0; - memset(&sbuf->hw.flags, 0, sizeof sbuf->hw.flags); + sbuf->map.num_ranges = 0; + memset(&sbuf->dma.flags, 0, sizeof sbuf->dma.flags); assert(sbuf->head.prev && sbuf->head.next); LIST_DEL(&sbuf->head); #ifdef DEBUG sbuf->head.next = sbuf->head.prev = NULL; #endif - sbuf->needs_flush = FALSE; + sbuf->dma.pending = FALSE; - sbuf->hw.svga = NULL; - sbuf->hw.boxes = NULL; + sbuf->dma.svga = NULL; + sbuf->dma.boxes = NULL; /* Decrement reference count */ pipe_reference(&(sbuf->base.reference), NULL); @@ -295,7 +295,7 @@ svga_buffer_upload_flush(struct svga_context *svga, /** - * Queue a DMA upload of a range of this buffer to the host. + * Note a dirty range. * * This function only notes the range down. It doesn't actually emit a DMA * upload command. That only happens when a context tries to refer to this @@ -304,19 +304,19 @@ svga_buffer_upload_flush(struct svga_context *svga, * We try to lump as many contiguous DMA transfers together as possible. */ static void -svga_buffer_upload_queue(struct svga_buffer *sbuf, - unsigned start, - unsigned end) +svga_buffer_add_range(struct svga_buffer *sbuf, + unsigned start, + unsigned end) { unsigned i; unsigned nearest_range; unsigned nearest_dist; - assert(sbuf->hw.buf); + assert(sbuf->hwbuf); assert(end > start); - if (sbuf->hw.num_ranges < SVGA_BUFFER_MAX_RANGES) { - nearest_range = sbuf->hw.num_ranges; + if (sbuf->map.num_ranges < SVGA_BUFFER_MAX_RANGES) { + nearest_range = sbuf->map.num_ranges; nearest_dist = ~0; } else { nearest_range = SVGA_BUFFER_MAX_RANGES - 1; @@ -333,13 +333,13 @@ svga_buffer_upload_queue(struct svga_buffer *sbuf, * buffer should be flushed. */ - for(i = 0; i < sbuf->hw.num_ranges; ++i) { + for(i = 0; i < sbuf->map.num_ranges; ++i) { int left_dist; int right_dist; int dist; - left_dist = start - sbuf->hw.ranges[i].end; - right_dist = sbuf->hw.ranges[i].start - end; + left_dist = start - sbuf->map.ranges[i].end; + right_dist = sbuf->map.ranges[i].start - end; dist = MAX2(left_dist, right_dist); if (dist <= 0) { @@ -347,8 +347,8 @@ svga_buffer_upload_queue(struct svga_buffer *sbuf, * Ranges are contiguous or overlapping -- extend this one and return. */ - sbuf->hw.ranges[i].start = MIN2(sbuf->hw.ranges[i].start, start); - sbuf->hw.ranges[i].end = MAX2(sbuf->hw.ranges[i].end, end); + sbuf->map.ranges[i].start = MIN2(sbuf->map.ranges[i].start, start); + sbuf->map.ranges[i].end = MAX2(sbuf->map.ranges[i].end, end); return; } else { @@ -368,21 +368,21 @@ svga_buffer_upload_queue(struct svga_buffer *sbuf, * pending DMA upload and start clean. */ - if(sbuf->needs_flush) - svga_buffer_upload_flush(sbuf->hw.svga, sbuf); + if(sbuf->dma.pending) + svga_buffer_upload_flush(sbuf->dma.svga, sbuf); - assert(!sbuf->needs_flush); - assert(!sbuf->hw.svga); - assert(!sbuf->hw.boxes); + assert(!sbuf->dma.pending); + assert(!sbuf->dma.svga); + assert(!sbuf->dma.boxes); - if (sbuf->hw.num_ranges < SVGA_BUFFER_MAX_RANGES) { + if (sbuf->map.num_ranges < SVGA_BUFFER_MAX_RANGES) { /* * Add a new range. */ - sbuf->hw.ranges[sbuf->hw.num_ranges].start = start; - sbuf->hw.ranges[sbuf->hw.num_ranges].end = end; - ++sbuf->hw.num_ranges; + sbuf->map.ranges[sbuf->map.num_ranges].start = start; + sbuf->map.ranges[sbuf->map.num_ranges].end = end; + ++sbuf->map.num_ranges; } else { /* * Everything else failed, so just extend the nearest range. @@ -392,9 +392,9 @@ svga_buffer_upload_queue(struct svga_buffer *sbuf, */ assert(nearest_range < SVGA_BUFFER_MAX_RANGES); - assert(nearest_range < sbuf->hw.num_ranges); - sbuf->hw.ranges[nearest_range].start = MIN2(sbuf->hw.ranges[nearest_range].start, start); - sbuf->hw.ranges[nearest_range].end = MAX2(sbuf->hw.ranges[nearest_range].end, end); + assert(nearest_range < sbuf->map.num_ranges); + sbuf->map.ranges[nearest_range].start = MIN2(sbuf->map.ranges[nearest_range].start, start); + sbuf->map.ranges[nearest_range].end = MAX2(sbuf->map.ranges[nearest_range].end, end); } } @@ -410,7 +410,7 @@ svga_buffer_map_range( struct pipe_screen *screen, struct svga_buffer *sbuf = svga_buffer( buf ); void *map; - if (!sbuf->swbuf && !sbuf->hw.buf) { + if (!sbuf->swbuf && !sbuf->hwbuf) { if (svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK) { /* * We can't create a hardware buffer big enough, so create a malloc @@ -429,8 +429,8 @@ svga_buffer_map_range( struct pipe_screen *screen, /* User/malloc buffer */ map = sbuf->swbuf; } - else if (sbuf->hw.buf) { - map = sws->buffer_map(sws, sbuf->hw.buf, usage); + else if (sbuf->hwbuf) { + map = sws->buffer_map(sws, sbuf->hwbuf, usage); } else { map = NULL; @@ -466,8 +466,8 @@ svga_buffer_flush_mapped_range( struct pipe_screen *screen, assert(sbuf->map.writing); if(sbuf->map.writing) { assert(sbuf->map.flush_explicit); - if(sbuf->hw.buf) - svga_buffer_upload_queue(sbuf, offset, offset + length); + if(sbuf->hwbuf) + svga_buffer_add_range(sbuf, offset, offset + length); } pipe_mutex_unlock(ss->swc_mutex); } @@ -486,16 +486,16 @@ svga_buffer_unmap( struct pipe_screen *screen, if(sbuf->map.count) --sbuf->map.count; - if(sbuf->hw.buf) - sws->buffer_unmap(sws, sbuf->hw.buf); + if(sbuf->hwbuf) + sws->buffer_unmap(sws, sbuf->hwbuf); if(sbuf->map.writing) { if(!sbuf->map.flush_explicit) { /* No mapped range was flushed -- flush the whole buffer */ SVGA_DBG(DEBUG_DMA, "flushing the whole buffer\n"); - if(sbuf->hw.buf) - svga_buffer_upload_queue(sbuf, 0, sbuf->base.size); + if(sbuf->hwbuf) + svga_buffer_add_range(sbuf, 0, sbuf->base.size); } sbuf->map.writing = FALSE; @@ -513,12 +513,12 @@ svga_buffer_destroy( struct pipe_buffer *buf ) assert(!p_atomic_read(&buf->reference.count)); - assert(!sbuf->needs_flush); + assert(!sbuf->dma.pending); if(sbuf->handle) svga_buffer_destroy_host_surface(ss, sbuf); - if(sbuf->hw.buf) + if(sbuf->hwbuf) svga_buffer_destroy_hw_storage(ss, sbuf); if(sbuf->swbuf && !sbuf->user) @@ -621,7 +621,7 @@ svga_screen_init_buffer_functions(struct pipe_screen *screen) static INLINE enum pipe_error svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) { - if(!sbuf->hw.buf) { + if(!sbuf->hwbuf) { enum pipe_error ret; void *map; @@ -635,7 +635,7 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) return ret; pipe_mutex_lock(ss->swc_mutex); - map = ss->sws->buffer_map(ss->sws, sbuf->hw.buf, PIPE_BUFFER_USAGE_CPU_WRITE); + map = ss->sws->buffer_map(ss->sws, sbuf->hwbuf, PIPE_BUFFER_USAGE_CPU_WRITE); assert(map); if(!map) { pipe_mutex_unlock(ss->swc_mutex); @@ -643,7 +643,7 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) } memcpy(map, sbuf->swbuf, sbuf->base.size); - ss->sws->buffer_unmap(ss->sws, sbuf->hw.buf); + ss->sws->buffer_unmap(ss->sws, sbuf->hwbuf); /* This user/malloc buffer is now indistinguishable from a gpu buffer */ assert(!sbuf->map.count); @@ -655,7 +655,7 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) sbuf->swbuf = NULL; } - svga_buffer_upload_queue(sbuf, 0, sbuf->base.size); + svga_buffer_add_range(sbuf, 0, sbuf->base.size); } pipe_mutex_unlock(ss->swc_mutex); @@ -689,16 +689,16 @@ svga_buffer_handle(struct svga_context *svga, return NULL; } - if(!sbuf->needs_flush && sbuf->hw.num_ranges) { + if(!sbuf->dma.pending && sbuf->map.num_ranges) { /* Queue the buffer for flushing */ ret = svga_buffer_upload_command(svga, sbuf); if(ret != PIPE_OK) /* XXX: Should probably have a richer return value */ return NULL; - assert(sbuf->hw.svga == svga); + assert(sbuf->dma.svga == svga); - sbuf->needs_flush = TRUE; + sbuf->dma.pending = TRUE; assert(!sbuf->head.prev && !sbuf->head.next); LIST_ADDTAIL(&sbuf->head, &svga->dirty_buffers); } @@ -758,7 +758,7 @@ svga_context_flush_buffers(struct svga_context *svga) sbuf = LIST_ENTRY(struct svga_buffer, curr, head); assert(p_atomic_read(&sbuf->base.reference.count) != 0); - assert(sbuf->needs_flush); + assert(sbuf->dma.pending); svga_buffer_upload_flush(svga, sbuf); diff --git a/src/gallium/drivers/svga/svga_screen_buffer.h b/src/gallium/drivers/svga/svga_screen_buffer.h index e0e1b22e46..044fa0a465 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.h +++ b/src/gallium/drivers/svga/svga_screen_buffer.h @@ -56,35 +56,6 @@ struct svga_buffer_range }; -/** - * Describe a - * - * This holds the information to emit a SVGA3dCmdSurfaceDMA. - */ -struct svga_buffer_upload -{ - /** - * Guest memory region. - */ - struct svga_winsys_buffer *buf; - - struct svga_buffer_range ranges[SVGA_BUFFER_MAX_RANGES]; - unsigned num_ranges; - - SVGA3dSurfaceDMAFlags flags; - - /** - * Pointer to the DMA copy box *inside* the command buffer. - */ - SVGA3dCopyBox *boxes; - - /** - * Context that has the pending DMA to this buffer. - */ - struct svga_context *svga; -}; - - /** * SVGA pipe buffer. */ @@ -110,14 +81,6 @@ struct svga_buffer */ boolean user; - /** - * DMA'ble memory. - * - * A piece of GMR memory. It is created when mapping the buffer, and will be - * used to upload/download vertex data from the host. - */ - struct svga_buffer_upload hw; - /** * Creation key for the host surface handle. * @@ -134,14 +97,81 @@ struct svga_buffer * trying to bind */ struct svga_winsys_surface *handle; - + + /** + * Information about ongoing and past map operations. + */ struct { + /** + * Number of concurrent mappings. + * + * XXX: It is impossible to guarantee concurrent maps work in all + * circumstances -- pipe_buffers really need transfer objects too. + */ unsigned count; + + /** + * Whether this buffer is currently mapped for writing. + */ boolean writing; + + /** + * Whether the application will tell us explicity which ranges it touched + * or not. + */ boolean flush_explicit; + + /** + * Dirty ranges. + * + * Ranges that were touched by the application and need to be uploaded to + * the host. + * + * This information will be copied into dma.boxes, when emiting the + * SVGA3dCmdSurfaceDMA command. + */ + struct svga_buffer_range ranges[SVGA_BUFFER_MAX_RANGES]; + unsigned num_ranges; } map; - - boolean needs_flush; + + /** + * DMA'ble memory. + * + * A piece of GMR memory, with the same size of the buffer. It is created + * when mapping the buffer, and will be used to upload vertex data to the + * host. + */ + struct svga_winsys_buffer *hwbuf; + + /** + * Information about pending DMA uploads. + * + */ + struct { + /** + * Whether this buffer has an unfinished DMA upload command. + * + * If not set then the rest of the information is null. + */ + boolean pending; + + SVGA3dSurfaceDMAFlags flags; + + /** + * Pointer to the DMA copy box *inside* the command buffer. + */ + SVGA3dCopyBox *boxes; + + /** + * Context that has the pending DMA to this buffer. + */ + struct svga_context *svga; + } dma; + + /** + * Linked list head, used to gather all buffers with pending dma uploads on + * a context. It is only valid if the dma.pending is set above. + */ struct list_head head; }; -- cgit v1.2.3 From 3a6e581f2f56097aa1b17a131b818a70a888cd98 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 18 Feb 2010 14:12:31 +0000 Subject: svga: Note ranges even when there is no hardware buffer around. Not having a hardware buffer around doesn't change the fact that the range is dirty and needs to be uploaded eventually. --- src/gallium/drivers/svga/svga_screen_buffer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index bf637f2aa9..14fa40d206 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -312,7 +312,6 @@ svga_buffer_add_range(struct svga_buffer *sbuf, unsigned nearest_range; unsigned nearest_dist; - assert(sbuf->hwbuf); assert(end > start); if (sbuf->map.num_ranges < SVGA_BUFFER_MAX_RANGES) { @@ -466,8 +465,7 @@ svga_buffer_flush_mapped_range( struct pipe_screen *screen, assert(sbuf->map.writing); if(sbuf->map.writing) { assert(sbuf->map.flush_explicit); - if(sbuf->hwbuf) - svga_buffer_add_range(sbuf, offset, offset + length); + svga_buffer_add_range(sbuf, offset, offset + length); } pipe_mutex_unlock(ss->swc_mutex); } @@ -494,8 +492,7 @@ svga_buffer_unmap( struct pipe_screen *screen, /* No mapped range was flushed -- flush the whole buffer */ SVGA_DBG(DEBUG_DMA, "flushing the whole buffer\n"); - if(sbuf->hwbuf) - svga_buffer_add_range(sbuf, 0, sbuf->base.size); + svga_buffer_add_range(sbuf, 0, sbuf->base.size); } sbuf->map.writing = FALSE; -- cgit v1.2.3 From 2452921e5adb56a3d99e52fb2b963fcd2a0b75e9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 18 Feb 2010 16:40:14 +0000 Subject: svga: Break uploads of big buffers into smaller pieces. Fixes crash in Homeworld2 which tries to create a 14MB buffer, because we now avoid creating GMR buffers larger than 8MB to ensure progress given we have only a 16MB pool. --- src/gallium/drivers/svga/svga_screen_buffer.c | 159 ++++++++++++++++++++++---- src/gallium/drivers/svga/svga_screen_buffer.h | 10 ++ 2 files changed, 147 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 14fa40d206..ed8c33d829 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -178,7 +178,6 @@ svga_buffer_upload_command(struct svga_context *svga, struct svga_winsys_buffer *guest = sbuf->hwbuf; struct svga_winsys_surface *host = sbuf->handle; SVGA3dTransferType transfer = SVGA3D_WRITE_HOST_VRAM; - SVGA3dSurfaceDMAFlags flags = sbuf->dma.flags; SVGA3dCmdSurfaceDMA *cmd; uint32 numBoxes = sbuf->map.num_ranges; SVGA3dCopyBox *boxes; @@ -228,9 +227,11 @@ svga_buffer_upload_command(struct svga_context *svga, pSuffix = (SVGA3dCmdSurfaceDMASuffix *)((uint8_t*)cmd + sizeof *cmd + numBoxes * sizeof *boxes); pSuffix->suffixSize = sizeof *pSuffix; pSuffix->maximumOffset = sbuf->base.size; - pSuffix->flags = flags; + pSuffix->flags = sbuf->dma.flags; - swc->commit(swc); + SVGA_FIFOCommitAll(swc); + + sbuf->dma.flags.discard = FALSE; return PIPE_OK; } @@ -276,7 +277,6 @@ svga_buffer_upload_flush(struct svga_context *svga, } sbuf->map.num_ranges = 0; - memset(&sbuf->dma.flags, 0, sizeof sbuf->dma.flags); assert(sbuf->head.prev && sbuf->head.next); LIST_DEL(&sbuf->head); @@ -627,7 +627,6 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) return PIPE_ERROR; ret = svga_buffer_create_hw_storage(ss, sbuf); - assert(ret == PIPE_OK); if(ret != PIPE_OK) return ret; @@ -636,7 +635,8 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) assert(map); if(!map) { pipe_mutex_unlock(ss->swc_mutex); - return PIPE_ERROR_OUT_OF_MEMORY; + svga_buffer_destroy_hw_storage(ss, sbuf); + return PIPE_ERROR; } memcpy(map, sbuf->swbuf, sbuf->base.size); @@ -652,10 +652,86 @@ svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) sbuf->swbuf = NULL; } - svga_buffer_add_range(sbuf, 0, sbuf->base.size); + pipe_mutex_unlock(ss->swc_mutex); } - pipe_mutex_unlock(ss->swc_mutex); + return PIPE_OK; +} + + +/** + * Upload the buffer to the host in a piecewise fashion. + * + * Used when the buffer is too big to fit in the GMR aperture. + */ +static INLINE enum pipe_error +svga_buffer_upload_piecewise(struct svga_screen *ss, + struct svga_context *svga, + struct svga_buffer *sbuf) +{ + struct svga_winsys_screen *sws = ss->sws; + const unsigned alignment = sbuf->base.alignment; + const unsigned usage = 0; + unsigned size = sbuf->base.size; + unsigned offset = 0; + + SVGA_DBG(DEBUG_DMA, "dma to sid %p\n", sbuf->handle); + + /* + * TODO: upload only the modified ranges + */ + + offset = 0; + while (offset < sbuf->base.size) { + struct svga_winsys_buffer *hwbuf; + uint8_t *map; + enum pipe_error ret; + + if (offset + size > sbuf->base.size) + size = sbuf->base.size - offset; + + hwbuf = svga_winsys_buffer_create(ss, alignment, usage, size); + while (!hwbuf) { + size /= 2; + if (!size) + return PIPE_ERROR_OUT_OF_MEMORY; + hwbuf = svga_winsys_buffer_create(ss, alignment, usage, size); + } + + SVGA_DBG(DEBUG_DMA, " bytes %u - %u\n", + offset, offset + size); + + map = sws->buffer_map(sws, hwbuf, + PIPE_BUFFER_USAGE_CPU_WRITE | + PIPE_BUFFER_USAGE_DISCARD); + assert(map); + if (map) { + memcpy(map, sbuf->swbuf, size); + sws->buffer_unmap(sws, hwbuf); + } + + ret = SVGA3D_BufferDMA(svga->swc, + hwbuf, sbuf->handle, + SVGA3D_WRITE_HOST_VRAM, + size, offset, sbuf->dma.flags); + if(ret != PIPE_OK) { + svga_context_flush(svga, NULL); + ret = SVGA3D_BufferDMA(svga->swc, + hwbuf, sbuf->handle, + SVGA3D_WRITE_HOST_VRAM, + size, offset, sbuf->dma.flags); + assert(ret == PIPE_OK); + } + + sbuf->dma.flags.discard = FALSE; + + sws->buffer_destroy(sws, hwbuf); + + offset += size; + } + + sbuf->map.num_ranges = 0; + return PIPE_OK; } @@ -680,29 +756,68 @@ svga_buffer_handle(struct svga_context *svga, ret = svga_buffer_create_host_surface(ss, sbuf); if(ret != PIPE_OK) return NULL; - - ret = svga_buffer_update_hw(ss, sbuf); - if(ret != PIPE_OK) - return NULL; } - if(!sbuf->dma.pending && sbuf->map.num_ranges) { - /* Queue the buffer for flushing */ - ret = svga_buffer_upload_command(svga, sbuf); - if(ret != PIPE_OK) - /* XXX: Should probably have a richer return value */ - return NULL; + assert(sbuf->handle); - assert(sbuf->dma.svga == svga); + if (sbuf->map.num_ranges) { + if (!sbuf->dma.pending) { + /* + * No pending DMA upload yet, so insert a DMA upload command now. + */ - sbuf->dma.pending = TRUE; - assert(!sbuf->head.prev && !sbuf->head.next); - LIST_ADDTAIL(&sbuf->head, &svga->dirty_buffers); + /* + * Migrate the data from swbuf -> hwbuf if necessary. + */ + ret = svga_buffer_update_hw(ss, sbuf); + if (ret == PIPE_OK) { + /* + * Queue a dma command. + */ + + ret = svga_buffer_upload_command(svga, sbuf); + if (ret == PIPE_ERROR_OUT_OF_MEMORY) { + svga_context_flush(svga, NULL); + ret = svga_buffer_upload_command(svga, sbuf); + assert(ret == PIPE_OK); + } + if (ret == PIPE_OK) { + sbuf->dma.pending = TRUE; + assert(!sbuf->head.prev && !sbuf->head.next); + LIST_ADDTAIL(&sbuf->head, &svga->dirty_buffers); + } + } + else if (ret == PIPE_ERROR_OUT_OF_MEMORY) { + /* + * The buffer is too big to fit in the GMR aperture, so break it in + * smaller pieces. + */ + ret = svga_buffer_upload_piecewise(ss, svga, sbuf); + } + + if (ret != PIPE_OK) { + /* + * Something unexpected happened above. There is very little that + * we can do other than proceeding while ignoring the dirty ranges. + */ + assert(0); + sbuf->map.num_ranges = 0; + } + } + else { + /* + * There a pending dma already. Make sure it is from this context. + */ + assert(sbuf->dma.svga == svga); + } } + assert(!sbuf->map.num_ranges || sbuf->dma.pending); + return sbuf->handle; } + struct pipe_buffer * svga_screen_buffer_wrap_surface(struct pipe_screen *screen, enum SVGA3dSurfaceFormat format, diff --git a/src/gallium/drivers/svga/svga_screen_buffer.h b/src/gallium/drivers/svga/svga_screen_buffer.h index 044fa0a465..937cf30478 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.h +++ b/src/gallium/drivers/svga/svga_screen_buffer.h @@ -201,6 +201,16 @@ svga_buffer_is_user_buffer( struct pipe_buffer *buffer ) void svga_screen_init_buffer_functions(struct pipe_screen *screen); + +/** + * Get the host surface handle for this buffer. + * + * This will ensure the host surface is updated, issuing DMAs as needed. + * + * NOTE: This may insert new commands in the context, so it *must* be called + * before reserving command buffer space. And, in order to insert commands + * it may need to call svga_context_flush(). + */ struct svga_winsys_surface * svga_buffer_handle(struct svga_context *svga, struct pipe_buffer *buf); -- cgit v1.2.3 From d1a022537195dc9afca7b487af70b188fbcfcd99 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 18 Feb 2010 17:21:53 +0000 Subject: svga: Upload the dirty ranges instead of the whole buffer. --- src/gallium/drivers/svga/svga_screen_buffer.c | 93 ++++++++++++++------------- 1 file changed, 48 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index ed8c33d829..54663e764b 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -612,7 +612,7 @@ svga_screen_init_buffer_functions(struct pipe_screen *screen) } -/** +/** * Copy the contents of the user buffer / malloc buffer to a hardware buffer. */ static INLINE enum pipe_error @@ -670,64 +670,67 @@ svga_buffer_upload_piecewise(struct svga_screen *ss, struct svga_buffer *sbuf) { struct svga_winsys_screen *sws = ss->sws; - const unsigned alignment = sbuf->base.alignment; + const unsigned alignment = sizeof(void *); const unsigned usage = 0; - unsigned size = sbuf->base.size; - unsigned offset = 0; + unsigned i; + + assert(sbuf->map.num_ranges); + assert(!sbuf->dma.pending); SVGA_DBG(DEBUG_DMA, "dma to sid %p\n", sbuf->handle); - /* - * TODO: upload only the modified ranges - */ + for (i = 0; i < sbuf->map.num_ranges; ++i) { + struct svga_buffer_range *range = &sbuf->map.ranges[i]; + unsigned offset = range->start; + unsigned size = range->end - range->start; - offset = 0; - while (offset < sbuf->base.size) { - struct svga_winsys_buffer *hwbuf; - uint8_t *map; - enum pipe_error ret; + while (offset < range->end) { + struct svga_winsys_buffer *hwbuf; + uint8_t *map; + enum pipe_error ret; - if (offset + size > sbuf->base.size) - size = sbuf->base.size - offset; + if (offset + size > range->end) + size = range->end - offset; - hwbuf = svga_winsys_buffer_create(ss, alignment, usage, size); - while (!hwbuf) { - size /= 2; - if (!size) - return PIPE_ERROR_OUT_OF_MEMORY; hwbuf = svga_winsys_buffer_create(ss, alignment, usage, size); - } + while (!hwbuf) { + size /= 2; + if (!size) + return PIPE_ERROR_OUT_OF_MEMORY; + hwbuf = svga_winsys_buffer_create(ss, alignment, usage, size); + } - SVGA_DBG(DEBUG_DMA, " bytes %u - %u\n", - offset, offset + size); + SVGA_DBG(DEBUG_DMA, " bytes %u - %u\n", + offset, offset + size); - map = sws->buffer_map(sws, hwbuf, - PIPE_BUFFER_USAGE_CPU_WRITE | - PIPE_BUFFER_USAGE_DISCARD); - assert(map); - if (map) { - memcpy(map, sbuf->swbuf, size); - sws->buffer_unmap(sws, hwbuf); - } + map = sws->buffer_map(sws, hwbuf, + PIPE_BUFFER_USAGE_CPU_WRITE | + PIPE_BUFFER_USAGE_DISCARD); + assert(map); + if (map) { + memcpy(map, sbuf->swbuf, size); + sws->buffer_unmap(sws, hwbuf); + } - ret = SVGA3D_BufferDMA(svga->swc, - hwbuf, sbuf->handle, - SVGA3D_WRITE_HOST_VRAM, - size, offset, sbuf->dma.flags); - if(ret != PIPE_OK) { - svga_context_flush(svga, NULL); - ret = SVGA3D_BufferDMA(svga->swc, - hwbuf, sbuf->handle, - SVGA3D_WRITE_HOST_VRAM, - size, offset, sbuf->dma.flags); - assert(ret == PIPE_OK); - } + ret = SVGA3D_BufferDMA(svga->swc, + hwbuf, sbuf->handle, + SVGA3D_WRITE_HOST_VRAM, + size, offset, sbuf->dma.flags); + if(ret != PIPE_OK) { + svga_context_flush(svga, NULL); + ret = SVGA3D_BufferDMA(svga->swc, + hwbuf, sbuf->handle, + SVGA3D_WRITE_HOST_VRAM, + size, offset, sbuf->dma.flags); + assert(ret == PIPE_OK); + } - sbuf->dma.flags.discard = FALSE; + sbuf->dma.flags.discard = FALSE; - sws->buffer_destroy(sws, hwbuf); + sws->buffer_destroy(sws, hwbuf); - offset += size; + offset += size; + } } sbuf->map.num_ranges = 0; -- cgit v1.2.3 From 28e80aa0b85aac3ed3d34ee13b6412be4d9d5773 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 22 Feb 2010 21:47:07 +0000 Subject: tgsi: Report an error when a destination has an empty writemask. --- src/gallium/auxiliary/tgsi/tgsi_sanity.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c index 91e1b27da1..371f690b29 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c @@ -321,6 +321,9 @@ iter_instruction( reg, "destination", FALSE ); + if (!inst->Dst[i].Register.WriteMask) { + report_error(ctx, "Destination register has empty writemask"); + } } for (i = 0; i < inst->Instruction.NumSrcRegs; i++) { scan_register *reg = create_scan_register_src(&inst->Src[i]); -- cgit v1.2.3 From 7384cdf651dc69098f4d988dd3b217879ec63336 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 22 Feb 2010 18:01:32 +0000 Subject: svga: Don't emit zero writemasks. This fixes a regression with Lightsmark, where more compact TGSI from Mesa was causing a zero mask MOV to be emitted for shadow map compare, causing problems in some backends. Add a few more assertions to catch cases like this. --- src/gallium/drivers/svga/svga_tgsi_emit.h | 2 + src/gallium/drivers/svga/svga_tgsi_insn.c | 65 ++++++++++++++++++------------- 2 files changed, 39 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_tgsi_emit.h b/src/gallium/drivers/svga/svga_tgsi_emit.h index e8f75485d5..48eced2ece 100644 --- a/src/gallium/drivers/svga/svga_tgsi_emit.h +++ b/src/gallium/drivers/svga/svga_tgsi_emit.h @@ -138,6 +138,7 @@ static INLINE boolean emit_dst( struct svga_shader_emitter *emit, SVGA3dShaderDestToken dest ) { assert(dest.reserved0); + assert(dest.mask); return svga_shader_emit_dword( emit, dest.value ); } @@ -267,6 +268,7 @@ static INLINE SVGA3dShaderDestToken writemask( SVGA3dShaderDestToken dest, unsigned mask ) { + assert(dest.mask & mask); dest.mask &= mask; return dest; } diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index 87aed39f78..9b1b5507cb 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -112,6 +112,7 @@ translate_dst_register( struct svga_shader_emitter *emit, } dest.mask = reg->Register.WriteMask; + assert(dest.mask); if (insn->Instruction.Saturate) dest.dstMod = SVGA3DDSTMOD_SATURATE; @@ -1410,34 +1411,42 @@ static boolean emit_tex(struct svga_shader_emitter *emit, if (compare) { - SVGA3dShaderDestToken src0_zdivw = get_temp( emit ); - struct src_register tex_src_x = scalar(src(tex_result), TGSI_SWIZZLE_Y); - struct src_register one = - scalar( get_zero_immediate( emit ), TGSI_SWIZZLE_W ); - - /* Divide texcoord R by Q */ - if (!submit_op1( emit, inst_token( SVGA3DOP_RCP ), - src0_zdivw, - scalar(src0, TGSI_SWIZZLE_W) )) - return FALSE; + if (dst.mask & TGSI_WRITEMASK_XYZ) { + SVGA3dShaderDestToken src0_zdivw = get_temp( emit ); + struct src_register tex_src_x = scalar(src(tex_result), TGSI_SWIZZLE_Y); + + /* Divide texcoord R by Q */ + if (!submit_op1( emit, inst_token( SVGA3DOP_RCP ), + src0_zdivw, + scalar(src0, TGSI_SWIZZLE_W) )) + return FALSE; - if (!submit_op2( emit, inst_token( SVGA3DOP_MUL ), - src0_zdivw, - scalar(src0, TGSI_SWIZZLE_Z), - src(src0_zdivw) )) - return FALSE; + if (!submit_op2( emit, inst_token( SVGA3DOP_MUL ), + src0_zdivw, + scalar(src0, TGSI_SWIZZLE_Z), + src(src0_zdivw) )) + return FALSE; - if (!emit_select( - emit, - emit->key.fkey.tex[src1.base.num].compare_func, - dst, - src(src0_zdivw), - tex_src_x)) - return FALSE; + if (!emit_select( + emit, + emit->key.fkey.tex[src1.base.num].compare_func, + writemask( dst, TGSI_WRITEMASK_XYZ ), + src(src0_zdivw), + tex_src_x)) + return FALSE; + } - return submit_op1( emit, inst_token( SVGA3DOP_MOV ), - writemask( dst, TGSI_WRITEMASK_W), - one ); + if (dst.mask & TGSI_WRITEMASK_W) { + struct src_register one = + scalar( get_zero_immediate( emit ), TGSI_SWIZZLE_W ); + + if (!submit_op1( emit, inst_token( SVGA3DOP_MOV ), + writemask( dst, TGSI_WRITEMASK_W ), + one )) + return FALSE; + } + + return TRUE; } else if (!emit->use_sm30 && dst.mask != TGSI_WRITEMASK_XYZW) { @@ -1827,13 +1836,13 @@ static boolean emit_exp(struct svga_shader_emitter *emit, */ if (dst.mask & TGSI_WRITEMASK_X) { if (!submit_op2( emit, inst_token( SVGA3DOP_ADD ), - writemask( dst, dst.mask & TGSI_WRITEMASK_X ), + writemask( dst, TGSI_WRITEMASK_X ), src0, scalar( negate( src( fraction ) ), TGSI_SWIZZLE_Y ) ) ) return FALSE; if (!submit_op1( emit, inst_token( SVGA3DOP_EXP ), - writemask( dst, dst.mask & TGSI_WRITEMASK_X ), + writemask( dst, TGSI_WRITEMASK_X ), scalar( src( dst ), TGSI_SWIZZLE_X ) ) ) return FALSE; @@ -1845,7 +1854,7 @@ static boolean emit_exp(struct svga_shader_emitter *emit, */ if (dst.mask & TGSI_WRITEMASK_Z) { if (!submit_op1( emit, inst_token( SVGA3DOP_EXPP ), - writemask( dst, dst.mask & TGSI_WRITEMASK_Z ), + writemask( dst, TGSI_WRITEMASK_Z ), src0 ) ) return FALSE; } -- cgit v1.2.3 From 066fd70639a1681bfde0a8e1fb7fdca7897158e5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 22 Feb 2010 18:57:09 +0000 Subject: svga: Emit a scalar rcp in shadow maps. Small improvement in Lightsmark 2008. --- src/gallium/drivers/svga/svga_tgsi_insn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c index 9b1b5507cb..3d4f56a67b 100644 --- a/src/gallium/drivers/svga/svga_tgsi_insn.c +++ b/src/gallium/drivers/svga/svga_tgsi_insn.c @@ -1417,21 +1417,21 @@ static boolean emit_tex(struct svga_shader_emitter *emit, /* Divide texcoord R by Q */ if (!submit_op1( emit, inst_token( SVGA3DOP_RCP ), - src0_zdivw, + writemask(src0_zdivw, TGSI_WRITEMASK_X), scalar(src0, TGSI_SWIZZLE_W) )) return FALSE; if (!submit_op2( emit, inst_token( SVGA3DOP_MUL ), - src0_zdivw, + writemask(src0_zdivw, TGSI_WRITEMASK_X), scalar(src0, TGSI_SWIZZLE_Z), - src(src0_zdivw) )) + scalar(src(src0_zdivw), TGSI_SWIZZLE_X) )) return FALSE; if (!emit_select( emit, emit->key.fkey.tex[src1.base.num].compare_func, writemask( dst, TGSI_WRITEMASK_XYZ ), - src(src0_zdivw), + scalar(src(src0_zdivw), TGSI_SWIZZLE_X), tex_src_x)) return FALSE; } -- cgit v1.2.3 From 8ea7d8412c5c002b43824a5df5356cbe1a05ce20 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 22 Feb 2010 19:20:25 +0000 Subject: svga: Fix the guest offset of piecewise buffer DMAs. It was being erroneously set equal to the host offset, but it should be zero. --- src/gallium/drivers/svga/svga_cmd.c | 9 +++++---- src/gallium/drivers/svga/svga_cmd.h | 3 ++- src/gallium/drivers/svga/svga_screen_buffer.c | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_cmd.c b/src/gallium/drivers/svga/svga_cmd.c index a0da7d7e5d..04307d17fe 100644 --- a/src/gallium/drivers/svga/svga_cmd.c +++ b/src/gallium/drivers/svga/svga_cmd.c @@ -478,7 +478,8 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc, struct svga_winsys_surface *host, SVGA3dTransferType transfer, // IN uint32 size, // IN - uint32 offset, // IN + uint32 guest_offset, // IN + uint32 host_offset, // IN SVGA3dSurfaceDMAFlags flags) // IN { SVGA3dCmdSurfaceDMA *cmd; @@ -517,19 +518,19 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc, cmd->transfer = transfer; box = (SVGA3dCopyBox *)&cmd[1]; - box->x = offset; + box->x = host_offset; box->y = 0; box->z = 0; box->w = size; box->h = 1; box->d = 1; - box->srcx = offset; + box->srcx = guest_offset; box->srcy = 0; box->srcz = 0; pSuffix = (SVGA3dCmdSurfaceDMASuffix *)((uint8_t*)cmd + sizeof *cmd + sizeof *box); pSuffix->suffixSize = sizeof *pSuffix; - pSuffix->maximumOffset = offset + size; + pSuffix->maximumOffset = guest_offset + size; pSuffix->flags = flags; swc->commit(swc); diff --git a/src/gallium/drivers/svga/svga_cmd.h b/src/gallium/drivers/svga/svga_cmd.h index 8041054769..da9fc4355f 100644 --- a/src/gallium/drivers/svga/svga_cmd.h +++ b/src/gallium/drivers/svga/svga_cmd.h @@ -111,7 +111,8 @@ SVGA3D_BufferDMA(struct svga_winsys_context *swc, struct svga_winsys_surface *host, SVGA3dTransferType transfer, uint32 size, - uint32 offset, + uint32 guest_offset, + uint32 host_offset, SVGA3dSurfaceDMAFlags flags); /* diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 54663e764b..e3f4a46260 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -715,13 +715,13 @@ svga_buffer_upload_piecewise(struct svga_screen *ss, ret = SVGA3D_BufferDMA(svga->swc, hwbuf, sbuf->handle, SVGA3D_WRITE_HOST_VRAM, - size, offset, sbuf->dma.flags); + size, 0, offset, sbuf->dma.flags); if(ret != PIPE_OK) { svga_context_flush(svga, NULL); ret = SVGA3D_BufferDMA(svga->swc, hwbuf, sbuf->handle, SVGA3D_WRITE_HOST_VRAM, - size, offset, sbuf->dma.flags); + size, 0, offset, sbuf->dma.flags); assert(ret == PIPE_OK); } -- cgit v1.2.3 From b330928549b39e97e16aee636c335865504ffab9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 22 Feb 2010 19:24:18 +0000 Subject: svga: Upload user buffers only once. --- src/gallium/drivers/svga/svga_pipe_vertex.c | 2 +- src/gallium/drivers/svga/svga_screen_buffer.c | 9 ++++- src/gallium/drivers/svga/svga_screen_buffer.h | 13 +++++++ src/gallium/drivers/svga/svga_state_vdecl.c | 51 +++++++++++++-------------- 4 files changed, 46 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_pipe_vertex.c b/src/gallium/drivers/svga/svga_pipe_vertex.c index ffc0f99565..836b8441da 100644 --- a/src/gallium/drivers/svga/svga_pipe_vertex.c +++ b/src/gallium/drivers/svga/svga_pipe_vertex.c @@ -49,7 +49,7 @@ static void svga_set_vertex_buffers(struct pipe_context *pipe, /* Adjust refcounts */ for (i = 0; i < count; i++) { pipe_buffer_reference(&svga->curr.vb[i].buffer, buffers[i].buffer); - if (svga_buffer(buffers[i].buffer)->user) + if (svga_buffer_is_user_buffer(buffers[i].buffer)) any_user_buffer = TRUE; } diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index e3f4a46260..1ff6a3a5b3 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -151,6 +151,8 @@ static INLINE enum pipe_error svga_buffer_create_hw_storage(struct svga_screen *ss, struct svga_buffer *sbuf) { + assert(!sbuf->user); + if(!sbuf->hwbuf) { unsigned alignment = sbuf->base.alignment; unsigned usage = 0; @@ -515,6 +517,9 @@ svga_buffer_destroy( struct pipe_buffer *buf ) if(sbuf->handle) svga_buffer_destroy_host_surface(ss, sbuf); + if(sbuf->uploaded.buffer) + pipe_buffer_reference(&sbuf->uploaded.buffer, NULL); + if(sbuf->hwbuf) svga_buffer_destroy_hw_storage(ss, sbuf); @@ -613,11 +618,12 @@ svga_screen_init_buffer_functions(struct pipe_screen *screen) /** - * Copy the contents of the user buffer / malloc buffer to a hardware buffer. + * Copy the contents of the malloc buffer to a hardware buffer. */ static INLINE enum pipe_error svga_buffer_update_hw(struct svga_screen *ss, struct svga_buffer *sbuf) { + assert(!sbuf->user); if(!sbuf->hwbuf) { enum pipe_error ret; void *map; @@ -754,6 +760,7 @@ svga_buffer_handle(struct svga_context *svga, sbuf = svga_buffer(buf); assert(!sbuf->map.count); + assert(!sbuf->user); if(!sbuf->handle) { ret = svga_buffer_create_host_surface(ss, sbuf); diff --git a/src/gallium/drivers/svga/svga_screen_buffer.h b/src/gallium/drivers/svga/svga_screen_buffer.h index 937cf30478..8c862fa62d 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.h +++ b/src/gallium/drivers/svga/svga_screen_buffer.h @@ -134,6 +134,19 @@ struct svga_buffer unsigned num_ranges; } map; + /** + * Information about uploaded version of user buffers. + */ + struct { + struct pipe_buffer *buffer; + + /** + * We combine multiple user buffers into the same hardware buffer. This + * is the relative offset within that buffer. + */ + unsigned offset; + } uploaded; + /** * DMA'ble memory. * diff --git a/src/gallium/drivers/svga/svga_state_vdecl.c b/src/gallium/drivers/svga/svga_state_vdecl.c index d1066ce13b..ded903170b 100644 --- a/src/gallium/drivers/svga/svga_state_vdecl.c +++ b/src/gallium/drivers/svga/svga_state_vdecl.c @@ -54,33 +54,30 @@ upload_user_buffers( struct svga_context *svga ) { if (svga_buffer_is_user_buffer(svga->curr.vb[i].buffer)) { - struct pipe_buffer *upload_buffer = NULL; - unsigned offset = /*svga->curr.vb[i].buffer_offset*/ 0; - unsigned size = svga->curr.vb[i].buffer->size /*- offset*/; - unsigned upload_offset; - - ret = u_upload_buffer( svga->upload_vb, - offset, - size, - svga->curr.vb[i].buffer, - &upload_offset, - &upload_buffer ); - if (ret) - return ret; - - if (0) - debug_printf("%s: %d: orig buf %p upl buf %p ofs %d sz %d\n", - __FUNCTION__, - i, - svga->curr.vb[i].buffer, - upload_buffer, upload_offset, size); - - /* Make sure we release the old buffer and end up with the - * correct refcount on the uploaded buffer. - */ - pipe_buffer_reference( &svga->curr.vb[i].buffer, NULL ); - svga->curr.vb[i].buffer = upload_buffer; - svga->curr.vb[i].buffer_offset = upload_offset; + struct svga_buffer *buffer = svga_buffer(svga->curr.vb[i].buffer); + + if (!buffer->uploaded.buffer) { + ret = u_upload_buffer( svga->upload_vb, + 0, + buffer->base.size, + &buffer->base, + &buffer->uploaded.offset, + &buffer->uploaded.buffer ); + if (ret) + return ret; + + if (0) + debug_printf("%s: %d: orig buf %p upl buf %p ofs %d sz %d\n", + __FUNCTION__, + i, + buffer, + buffer->uploaded.buffer, + buffer->uploaded.offset, + buffer->base.size); + } + + pipe_buffer_reference( &svga->curr.vb[i].buffer, buffer->uploaded.buffer ); + svga->curr.vb[i].buffer_offset = buffer->uploaded.offset; } } -- cgit v1.2.3 From 902ccfcb40f21e1a5fca2f1bec1cbbabb053d8cf Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 22 Feb 2010 13:51:38 +0100 Subject: r300g: fix draw_elements for "start" != 0 Reported-by: Andre Maasikas --- src/gallium/drivers/r300/r300_render.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 754eb4dc76..648d884654 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -258,11 +258,6 @@ static void r300_emit_draw_elements(struct r300_context *r300, assert((start * indexSize) % 4 == 0); - /* XXX Non-zero offset locks up. */ - if (offset_dwords != 0) { - return; - } - if (alt_num_verts) { assert(count < (1 << 24)); BEGIN_CS(16); @@ -276,13 +271,13 @@ static void r300_emit_draw_elements(struct r300_context *r300, OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, maxIndex); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, 0); if (indexSize == 4) { - count_dwords = count + start; + count_dwords = count; OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) | R300_VAP_VF_CNTL__INDEX_SIZE_32bit | r300_translate_primitive(mode) | (alt_num_verts ? R500_VAP_VF_CNTL__USE_ALT_NUM_VERTS : 0)); } else { - count_dwords = (count + start + 1) / 2; + count_dwords = (count + 1) / 2; OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) | r300_translate_primitive(mode) | (alt_num_verts ? R500_VAP_VF_CNTL__USE_ALT_NUM_VERTS : 0)); -- cgit v1.2.3 From 6da07e45b3e5cb37b63afafb650569d3d275e608 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 22 Feb 2010 23:23:57 -0800 Subject: draw: Remove dead code. --- src/gallium/auxiliary/draw/draw_pipe_offset.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/draw/draw_pipe_offset.c b/src/gallium/auxiliary/draw/draw_pipe_offset.c index e829492423..8e321946ce 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_offset.c +++ b/src/gallium/auxiliary/draw/draw_pipe_offset.c @@ -161,7 +161,7 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw ) { struct offset_stage *offset = CALLOC_STRUCT(offset_stage); if (offset == NULL) - goto fail; + return NULL; draw_alloc_temp_verts( &offset->stage, 3 ); @@ -176,10 +176,4 @@ struct draw_stage *draw_offset_stage( struct draw_context *draw ) offset->stage.destroy = offset_destroy; return &offset->stage; - - fail: - if (offset) - offset->stage.destroy( &offset->stage ); - - return NULL; } -- cgit v1.2.3 From a0fe36a39b92780efd2374b66f16b39e541f1172 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 22 Feb 2010 23:32:43 -0800 Subject: i965g: Add fallthrough comments in switch statement. Silences warnings about missing break statements in static analysis. --- src/gallium/drivers/i965/brw_draw_upload.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c index d59261557b..9f136eec71 100644 --- a/src/gallium/drivers/i965/brw_draw_upload.c +++ b/src/gallium/drivers/i965/brw_draw_upload.c @@ -359,9 +359,9 @@ static int brw_emit_vertex_elements(struct brw_context *brw) uint32_t comp3 = BRW_VE1_COMPONENT_STORE_SRC; switch (input->nr_components) { - case 0: comp0 = BRW_VE1_COMPONENT_STORE_0; - case 1: comp1 = BRW_VE1_COMPONENT_STORE_0; - case 2: comp2 = BRW_VE1_COMPONENT_STORE_0; + case 0: comp0 = BRW_VE1_COMPONENT_STORE_0; /* fallthrough */ + case 1: comp1 = BRW_VE1_COMPONENT_STORE_0; /* fallthrough */ + case 2: comp2 = BRW_VE1_COMPONENT_STORE_0; /* fallthrough */ case 3: comp3 = BRW_VE1_COMPONENT_STORE_1_FLT; break; } -- cgit v1.2.3 From 83a5b7e4689dcc36789f567847ccf65db858a9f3 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 22 Feb 2010 23:49:50 -0800 Subject: glsl/apps: Assert that ftell does not return an error. --- src/glsl/apps/compile.c | 1 + src/glsl/apps/process.c | 1 + src/glsl/apps/purify.c | 2 ++ src/glsl/apps/tokenise.c | 1 + src/glsl/apps/version.c | 1 + 5 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index 3b3c083c2e..21c2b7617e 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -79,6 +79,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[3], "w"); diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index e65f35cc00..c8a1a1868c 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -58,6 +58,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index 3019e8b220..5ab6bae96d 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include #include #include #include @@ -56,6 +57,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index c70c3ccbb1..b4c6d60930 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -57,6 +57,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index 0420f97294..9820ad94dc 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -56,6 +56,7 @@ main(int argc, fseek(in, 0, SEEK_END); size = ftell(in); + assert(size != -1); fseek(in, 0, SEEK_SET); out = fopen(argv[2], "wb"); -- cgit v1.2.3 From abcb6b6d01c253627363a05205291630b5247018 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 23 Feb 2010 00:19:30 -0800 Subject: mesa: Assert that array index is not negative. --- src/mesa/main/texcompress_fxt1.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 71e40dd3e9..149853f7ac 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -528,6 +528,7 @@ fxt1_lloyd (GLfloat vec[][MAX_COMP], GLint nv, #else GLint best = fxt1_bestcol(vec, nv, input[k], nc, &err); #endif + assert(best >= 0); /* add in closest color */ for (i = 0; i < nc; i++) { sum[best][i] += input[k][i]; -- cgit v1.2.3 From 58a72cd65e352849a5ce7be473fc5a2a7fc32e79 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 22 Feb 2010 21:56:58 +0800 Subject: st/egl: Unify surface creation. Add a new function egl_g3d_create_surface and use it to create window, pixmap, buffer, and screen surfaces. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 204 +++++++++++------------- 1 file changed, 97 insertions(+), 107 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index d769d253ac..13a7487ea8 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -687,131 +687,143 @@ egl_g3d_destroy_context(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx) return EGL_TRUE; } -static EGLBoolean -init_surface_geometry(_EGLSurface *surf) -{ - struct egl_g3d_surface *gsurf = egl_g3d_surface(surf); - - return gsurf->native->validate(gsurf->native, 0x0, - &gsurf->sequence_number, NULL, - &gsurf->base.Width, &gsurf->base.Height); -} +struct egl_g3d_create_surface_arg { + EGLint type; + union { + EGLNativeWindowType win; + EGLNativePixmapType pix; + } u; +}; static _EGLSurface * -egl_g3d_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy, - _EGLConfig *conf, EGLNativeWindowType win, - const EGLint *attribs) +egl_g3d_create_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, + struct egl_g3d_create_surface_arg *arg, + const EGLint *attribs) { struct egl_g3d_display *gdpy = egl_g3d_display(dpy); struct egl_g3d_config *gconf = egl_g3d_config(conf); struct egl_g3d_surface *gsurf; + struct native_surface *nsurf; + const char *err; + + switch (arg->type) { + case EGL_WINDOW_BIT: + err = "eglCreateWindowSurface"; + break; + case EGL_PIXMAP_BIT: + err = "eglCreatePixmapSurface"; + break; + case EGL_PBUFFER_BIT: + err = "eglCreatePBufferSurface"; + break; +#ifdef EGL_MESA_screen_surface + case EGL_SCREEN_BIT_MESA: + err = "eglCreateScreenSurface"; + break; +#endif + default: + err = "eglCreateUnknownSurface"; + break; + } gsurf = CALLOC_STRUCT(egl_g3d_surface); if (!gsurf) { - _eglError(EGL_BAD_ALLOC, "eglCreateWindowSurface"); + _eglError(EGL_BAD_ALLOC, err); return NULL; } - if (!_eglInitSurface(&gsurf->base, dpy, EGL_WINDOW_BIT, conf, attribs)) { + if (!_eglInitSurface(&gsurf->base, dpy, arg->type, conf, attribs)) { free(gsurf); return NULL; } - gsurf->native = - gdpy->native->create_window_surface(gdpy->native, win, gconf->native); - if (!gsurf->native) { + /* create the native surface */ + switch (arg->type) { + case EGL_WINDOW_BIT: + nsurf = gdpy->native->create_window_surface(gdpy->native, + arg->u.win, gconf->native); + break; + case EGL_PIXMAP_BIT: + nsurf = gdpy->native->create_pixmap_surface(gdpy->native, + arg->u.pix, gconf->native); + break; + case EGL_PBUFFER_BIT: + nsurf = gdpy->native->create_pbuffer_surface(gdpy->native, + gconf->native, gsurf->base.Width, gsurf->base.Height); + break; +#ifdef EGL_MESA_screen_surface + case EGL_SCREEN_BIT_MESA: + /* prefer back buffer (move to _eglInitSurface?) */ + gsurf->base.RenderBuffer = EGL_BACK_BUFFER; + nsurf = gdpy->native->modeset->create_scanout_surface(gdpy->native, + gconf->native, gsurf->base.Width, gsurf->base.Height); + break; +#endif + default: + nsurf = NULL; + break; + } + + if (!nsurf) { free(gsurf); return NULL; } - - if (!init_surface_geometry(&gsurf->base)) { - gsurf->native->destroy(gsurf->native); + /* initialize the geometry */ + if (!nsurf->validate(nsurf, 0x0, &gsurf->sequence_number, NULL, + &gsurf->base.Width, &gsurf->base.Height)) { + nsurf->destroy(nsurf); free(gsurf); return NULL; } - gsurf->render_att = (gsurf->base.RenderBuffer == EGL_SINGLE_BUFFER || - !gconf->native->mode.doubleBufferMode) ? + gsurf->native = nsurf; + + gsurf->render_att = (gsurf->base.RenderBuffer == EGL_SINGLE_BUFFER) ? NATIVE_ATTACHMENT_FRONT_LEFT : NATIVE_ATTACHMENT_BACK_LEFT; + if (!gconf->native->mode.doubleBufferMode) + gsurf->render_att = NATIVE_ATTACHMENT_FRONT_LEFT; return &gsurf->base; } static _EGLSurface * -egl_g3d_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy, - _EGLConfig *conf, EGLNativePixmapType pix, +egl_g3d_create_window_surface(_EGLDriver *drv, _EGLDisplay *dpy, + _EGLConfig *conf, EGLNativeWindowType win, const EGLint *attribs) { - struct egl_g3d_display *gdpy = egl_g3d_display(dpy); - struct egl_g3d_config *gconf = egl_g3d_config(conf); - struct egl_g3d_surface *gsurf; + struct egl_g3d_create_surface_arg arg; - gsurf = CALLOC_STRUCT(egl_g3d_surface); - if (!gsurf) { - _eglError(EGL_BAD_ALLOC, "eglCreatePixmapSurface"); - return NULL; - } + memset(&arg, 0, sizeof(arg)); + arg.type = EGL_WINDOW_BIT; + arg.u.win = win; - if (!_eglInitSurface(&gsurf->base, dpy, EGL_PIXMAP_BIT, conf, attribs)) { - free(gsurf); - return NULL; - } - - gsurf->native = - gdpy->native->create_pixmap_surface(gdpy->native, pix, gconf->native); - if (!gsurf->native) { - free(gsurf); - return NULL; - } + return egl_g3d_create_surface(drv, dpy, conf, &arg, attribs); +} - if (!init_surface_geometry(&gsurf->base)) { - gsurf->native->destroy(gsurf->native); - free(gsurf); - return NULL; - } +static _EGLSurface * +egl_g3d_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *dpy, + _EGLConfig *conf, EGLNativePixmapType pix, + const EGLint *attribs) +{ + struct egl_g3d_create_surface_arg arg; - gsurf->render_att = NATIVE_ATTACHMENT_FRONT_LEFT; + memset(&arg, 0, sizeof(arg)); + arg.type = EGL_PIXMAP_BIT; + arg.u.pix = pix; - return &gsurf->base; + return egl_g3d_create_surface(drv, dpy, conf, &arg, attribs); } static _EGLSurface * egl_g3d_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, const EGLint *attribs) { - struct egl_g3d_display *gdpy = egl_g3d_display(dpy); - struct egl_g3d_config *gconf = egl_g3d_config(conf); - struct egl_g3d_surface *gsurf; - - gsurf = CALLOC_STRUCT(egl_g3d_surface); - if (!gsurf) { - _eglError(EGL_BAD_ALLOC, "eglCreatePbufferSurface"); - return NULL; - } - - if (!_eglInitSurface(&gsurf->base, dpy, EGL_PBUFFER_BIT, conf, attribs)) { - free(gsurf); - return NULL; - } - - gsurf->native = - gdpy->native->create_pbuffer_surface(gdpy->native, gconf->native, - gsurf->base.Width, gsurf->base.Height); - if (!gsurf->native) { - free(gsurf); - return NULL; - } + struct egl_g3d_create_surface_arg arg; - if (!init_surface_geometry(&gsurf->base)) { - gsurf->native->destroy(gsurf->native); - free(gsurf); - return NULL; - } + memset(&arg, 0, sizeof(arg)); + arg.type = EGL_PBUFFER_BIT; - gsurf->render_att = (!gconf->native->mode.doubleBufferMode) ? - NATIVE_ATTACHMENT_FRONT_LEFT : NATIVE_ATTACHMENT_BACK_LEFT; - - return &gsurf->base; + return egl_g3d_create_surface(drv, dpy, conf, &arg, attribs); } /** @@ -1171,34 +1183,12 @@ static _EGLSurface * egl_g3d_create_screen_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, const EGLint *attribs) { - struct egl_g3d_display *gdpy = egl_g3d_display(dpy); - struct egl_g3d_config *gconf = egl_g3d_config(conf); - struct egl_g3d_surface *gsurf; - - gsurf = CALLOC_STRUCT(egl_g3d_surface); - if (!gsurf) { - _eglError(EGL_BAD_ALLOC, "eglCreatePbufferSurface"); - return NULL; - } + struct egl_g3d_create_surface_arg arg; - if (!_eglInitSurface(&gsurf->base, dpy, - EGL_SCREEN_BIT_MESA, conf, attribs)) { - free(gsurf); - return NULL; - } + memset(&arg, 0, sizeof(arg)); + arg.type = EGL_SCREEN_BIT_MESA; - gsurf->native = - gdpy->native->modeset->create_scanout_surface(gdpy->native, - gconf->native, gsurf->base.Width, gsurf->base.Height); - if (!gsurf->native) { - free(gsurf); - return NULL; - } - - gsurf->render_att = (!gconf->native->mode.doubleBufferMode) ? - NATIVE_ATTACHMENT_FRONT_LEFT : NATIVE_ATTACHMENT_BACK_LEFT; - - return &gsurf->base; + return egl_g3d_create_surface(drv, dpy, conf, &arg, attribs); } static EGLBoolean -- cgit v1.2.3 From 7d1237bc71811e95aec142f41599620f0361fafc Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 22 Feb 2010 21:59:14 +0800 Subject: egl: Remove unused _EGL_SKIP_HANDLE_CHECK. It was added to skip checking EGLDisplay, EGLSurface, and etc. It is never defined and the spec does not allow the checks to be skipped. Remove it for good. --- src/egl/main/eglconfig.c | 6 ------ src/egl/main/eglconfig.h | 17 ----------------- src/egl/main/egldisplay.c | 6 ------ src/egl/main/egldisplay.h | 24 ------------------------ 4 files changed, 53 deletions(-) (limited to 'src') diff --git a/src/egl/main/eglconfig.c b/src/egl/main/eglconfig.c index 177cf3ed89..21d13cba90 100644 --- a/src/egl/main/eglconfig.c +++ b/src/egl/main/eglconfig.c @@ -76,9 +76,6 @@ _eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf) } -#ifndef _EGL_SKIP_HANDLE_CHECK - - EGLBoolean _eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy) { @@ -96,9 +93,6 @@ _eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy) } -#endif /* _EGL_SKIP_HANDLE_CHECK */ - - enum { /* types */ ATTRIB_TYPE_INTEGER, diff --git a/src/egl/main/eglconfig.h b/src/egl/main/eglconfig.h index 56ec95fe9a..ced060f779 100644 --- a/src/egl/main/eglconfig.h +++ b/src/egl/main/eglconfig.h @@ -92,27 +92,10 @@ PUBLIC EGLConfig _eglAddConfig(_EGLDisplay *dpy, _EGLConfig *conf); -#ifndef _EGL_SKIP_HANDLE_CHECK - - extern EGLBoolean _eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy); -#else - - -static INLINE EGLBoolean -_eglCheckConfigHandle(EGLConfig config, _EGLDisplay *dpy) -{ - _EGLConfig *conf = (_EGLConfig *) config; - return (dpy && conf && conf->Display == dpy); -} - - -#endif /* _EGL_SKIP_HANDLE_CHECK */ - - /** * Lookup a handle to find the linked config. * Return NULL if the handle has no corresponding linked config. diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index f7dbe8ec22..5dc5fd9719 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -134,9 +134,6 @@ _eglCleanupDisplay(_EGLDisplay *disp) } -#ifndef _EGL_SKIP_HANDLE_CHECK - - /** * Return EGL_TRUE if the given handle is a valid handle to a display. */ @@ -181,9 +178,6 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy) } -#endif /* !_EGL_SKIP_HANDLE_CHECK */ - - /** * Link a resource to a display. */ diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h index 5d69b876ae..21bf22b5fe 100644 --- a/src/egl/main/egldisplay.h +++ b/src/egl/main/egldisplay.h @@ -101,9 +101,6 @@ PUBLIC void _eglCleanupDisplay(_EGLDisplay *disp); -#ifndef _EGL_SKIP_HANDLE_CHECK - - extern EGLBoolean _eglCheckDisplayHandle(EGLDisplay dpy); @@ -112,27 +109,6 @@ PUBLIC EGLBoolean _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy); -#else /* !_EGL_SKIP_HANDLE_CHECK */ - -/* Only do a quick check. This is NOT standard compliant. */ - -static INLINE EGLBoolean -_eglCheckDisplayHandle(EGLDisplay dpy) -{ - return ((_EGLDisplay *) dpy != NULL); -} - - -static INLINE EGLBoolean -_eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy); -{ - return (((_EGLResource *) res)->Display == dpy); -} - - -#endif /* _EGL_SKIP_HANDLE_CHECK */ - - /** * Lookup a handle to find the linked display. * Return NULL if the handle has no corresponding linked display. -- cgit v1.2.3 From c41cf31da8e2b57ea9911ed1720650cfc2649a84 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 23 Feb 2010 13:48:19 -0500 Subject: i965: Enable GL_ARB_fragment_coord_conventions now that the GLSL is fixed. Tested with piglit glsl-arb-fragment-coord-conventions. --- src/mesa/drivers/dri/intel/intel_extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 84c8d013e3..e16c33b33d 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -151,6 +151,7 @@ static const struct dri_extension i915_extensions[] = { static const struct dri_extension brw_extensions[] = { { "GL_ARB_depth_clamp", NULL }, { "GL_ARB_depth_texture", NULL }, + { "GL_ARB_fragment_coord_conventions", NULL }, { "GL_ARB_fragment_program", NULL }, { "GL_ARB_fragment_program_shadow", NULL }, { "GL_ARB_fragment_shader", NULL }, -- cgit v1.2.3 From 9f4f87893b4d3555204a1a66d108f8f9185e3d14 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Tue, 23 Feb 2010 08:50:15 -0800 Subject: pipebuffer: avoid assert due to increasing a zeroed refcnt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cache manager stores buffers with a reference count that dropped to 0. pipe_reference asserts in this case on debug builds, so use pipe_reference_init instead. Signed-off-by: José Fonseca --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 53bc019a20..86f9266c95 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -294,7 +294,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, LIST_DEL(&buf->head); pipe_mutex_unlock(mgr->mutex); /* Increase refcount */ - pipe_reference(NULL, &buf->base.base.reference); + pipe_reference_init(&buf->base.base.reference, 1); return &buf->base; } -- cgit v1.2.3 From c36b912e09a12b60d26fd1ebe0939b457514d800 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Tue, 23 Feb 2010 08:55:38 -0800 Subject: pipebuffer: fix inverted signalled checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A return of 0 means the fence is signalled. Signed-off-by: José Fonseca --- src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 95eb5f6563..d97f749b6e 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -696,7 +696,7 @@ fenced_buffer_map(struct pb_buffer *buf, * Don't wait for the GPU to finish accessing it, if blocking is forbidden. */ if((flags & PIPE_BUFFER_USAGE_DONTBLOCK) && - ops->fence_signalled(ops, fenced_buf->fence, 0) == 0) { + ops->fence_signalled(ops, fenced_buf->fence, 0) != 0) { goto done; } -- cgit v1.2.3 From 2f5beb4b530d47d6b4a7cf0effeaec0d2c1b6ea4 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Tue, 23 Feb 2010 08:55:24 -0800 Subject: pipebuffer: slab: if size < alignment, use alignment to find bucket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the size is lower than the alignment, we must use the alignment to select the bucket. Otherwise, the selected bucket won't be able to satisfy our request and will fail. Signed-off-by: José Fonseca --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c index c445cb578b..24e2820f88 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c @@ -483,11 +483,15 @@ pb_slab_range_manager_create_buffer(struct pb_manager *_mgr, { struct pb_slab_range_manager *mgr = pb_slab_range_manager(_mgr); pb_size bufSize; + pb_size reqSize = size; unsigned i; + if(desc->alignment > reqSize) + reqSize = desc->alignment; + bufSize = mgr->minBufSize; for (i = 0; i < mgr->numBuckets; ++i) { - if(bufSize >= size) + if(bufSize >= reqSize) return mgr->buckets[i]->create_buffer(mgr->buckets[i], size, desc); bufSize *= 2; } -- cgit v1.2.3 From 251bf298bfddd06c6d6cd4b03ba9aadfc02e2895 Mon Sep 17 00:00:00 2001 From: kleinerm Date: Fri, 19 Feb 2010 12:28:26 -0800 Subject: glx: Fix some typos in pointer checking for OML_sync_control entry points. Signed-off-by: Mario Kleiner Signed-off-by: Brian Paul --- src/glx/glxcmds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 704e9a0b9d..4fbc6b6ab2 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -2364,7 +2364,7 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable, psc = &priv->screenConfigs[i]; #if defined(__DRI_SWAP_BUFFER_COUNTER) && defined(__DRI_MEDIA_STREAM_COUNTER) - if (pdraw && psc->sbc && psc->sbc) + if (pdraw && psc->sbc && psc->msc) return ( (pdraw && psc->sbc && psc->msc) && ((*psc->msc->getMSC)(psc->driScreen, msc) == 0) && ((*psc->sbc->getSBC)(pdraw->driDrawable, sbc) == 0) @@ -2494,7 +2494,7 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable, __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable, &screen); __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen); - if (!pdraw || !gc->driContext) /* no GLX for this */ + if (!pdraw || !gc || !gc->driContext) /* no GLX for this */ return -1; /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE @@ -2594,7 +2594,7 @@ __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, return ((ret == 0) && (__glXGetUST(ust) == 0)); } #endif - if (pdraw && psc->driScreen && psc->driScreen->waitForMSC) { + if (pdraw && psc->driScreen && psc->driScreen->waitForSBC) { ret = psc->driScreen->waitForSBC(pdraw, target_sbc, ust, msc, sbc); return ret; } -- cgit v1.2.3 From 232f6e176192d112fbdf9bd7de2d0f36ee16a246 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 23 Feb 2010 09:08:28 +0100 Subject: r300g: fix texture swizzling for the SRGB formats --- src/gallium/drivers/r300/r300_texture.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index ed2be06254..7b116b30e5 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -70,6 +70,19 @@ static uint32_t r300_translate_texformat(enum pipe_format format) R300_TX_FORMAT_B_SHIFT, R300_TX_FORMAT_A_SHIFT }; + const uint32_t swizzle_arith[4] = { + R300_TX_FORMAT_X, + R300_TX_FORMAT_Y, + R300_TX_FORMAT_Z, + R300_TX_FORMAT_W + }; + const uint32_t swizzle_array[4] = { + R300_TX_FORMAT_W, + R300_TX_FORMAT_Z, + R300_TX_FORMAT_Y, + R300_TX_FORMAT_X + }; + const uint32_t *swizzle; const uint32_t sign_bit[4] = { R300_TX_FORMAT_SIGNED_X, R300_TX_FORMAT_SIGNED_Y, @@ -115,20 +128,23 @@ static uint32_t r300_translate_texformat(enum pipe_format format) } /* Add swizzle. */ + swizzle = desc->layout == UTIL_FORMAT_LAYOUT_ARITH ? + swizzle_arith : swizzle_array; + for (i = 0; i < 4; i++) { switch (desc->swizzle[i]) { case UTIL_FORMAT_SWIZZLE_X: case UTIL_FORMAT_SWIZZLE_NONE: - result |= R300_TX_FORMAT_X << swizzle_shift[i]; + result |= swizzle[0] << swizzle_shift[i]; break; case UTIL_FORMAT_SWIZZLE_Y: - result |= R300_TX_FORMAT_Y << swizzle_shift[i]; + result |= swizzle[1] << swizzle_shift[i]; break; case UTIL_FORMAT_SWIZZLE_Z: - result |= R300_TX_FORMAT_Z << swizzle_shift[i]; + result |= swizzle[2] << swizzle_shift[i]; break; case UTIL_FORMAT_SWIZZLE_W: - result |= R300_TX_FORMAT_W << swizzle_shift[i]; + result |= swizzle[3] << swizzle_shift[i]; break; case UTIL_FORMAT_SWIZZLE_0: result |= R300_TX_FORMAT_ZERO << swizzle_shift[i]; -- cgit v1.2.3 From f437a673777ca613ef4c1464fb9083e269f3928c Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Mon, 22 Feb 2010 22:27:48 +0200 Subject: glapi: mv code generation to subdir This just moves files, code generation Makefile will be fixed in next commit for easier review. --- src/mesa/glapi/APPLE_vertex_array_object.xml | 27 - src/mesa/glapi/ARB_copy_buffer.xml | 24 - src/mesa/glapi/ARB_depth_clamp.xml | 12 - src/mesa/glapi/ARB_draw_elements_base_vertex.xml | 40 - src/mesa/glapi/ARB_framebuffer_object.xml | 275 - src/mesa/glapi/ARB_map_buffer_range.xml | 34 - src/mesa/glapi/ARB_seamless_cube_map.xml | 12 - src/mesa/glapi/ARB_sync.xml | 84 - src/mesa/glapi/ARB_vertex_array_object.xml | 34 - src/mesa/glapi/EXT_draw_buffers2.xml | 49 - src/mesa/glapi/EXT_framebuffer_object.xml | 235 - src/mesa/glapi/EXT_packed_depth_stencil.xml | 18 - src/mesa/glapi/EXT_provoking_vertex.xml | 35 - src/mesa/glapi/EXT_texture_array.xml | 42 - src/mesa/glapi/Makefile | 158 - src/mesa/glapi/NV_conditional_render.xml | 26 - src/mesa/glapi/extension_helper.py | 324 - src/mesa/glapi/gen/APPLE_vertex_array_object.xml | 27 + src/mesa/glapi/gen/ARB_copy_buffer.xml | 24 + src/mesa/glapi/gen/ARB_depth_clamp.xml | 12 + .../glapi/gen/ARB_draw_elements_base_vertex.xml | 40 + src/mesa/glapi/gen/ARB_framebuffer_object.xml | 275 + src/mesa/glapi/gen/ARB_map_buffer_range.xml | 34 + src/mesa/glapi/gen/ARB_seamless_cube_map.xml | 12 + src/mesa/glapi/gen/ARB_sync.xml | 84 + src/mesa/glapi/gen/ARB_vertex_array_object.xml | 34 + src/mesa/glapi/gen/EXT_draw_buffers2.xml | 49 + src/mesa/glapi/gen/EXT_framebuffer_object.xml | 235 + src/mesa/glapi/gen/EXT_packed_depth_stencil.xml | 18 + src/mesa/glapi/gen/EXT_provoking_vertex.xml | 35 + src/mesa/glapi/gen/EXT_texture_array.xml | 42 + src/mesa/glapi/gen/Makefile | 158 + src/mesa/glapi/gen/NV_conditional_render.xml | 26 + src/mesa/glapi/gen/extension_helper.py | 324 + src/mesa/glapi/gen/glX_API.xml | 220 + src/mesa/glapi/gen/glX_XML.py | 570 + src/mesa/glapi/gen/glX_doc.py | 280 + src/mesa/glapi/gen/glX_proto_common.py | 95 + src/mesa/glapi/gen/glX_proto_recv.py | 554 + src/mesa/glapi/gen/glX_proto_send.py | 1042 ++ src/mesa/glapi/gen/glX_proto_size.py | 704 ++ src/mesa/glapi/gen/glX_server_table.py | 411 + src/mesa/glapi/gen/gl_API.dtd | 140 + src/mesa/glapi/gen/gl_API.xml | 12505 +++++++++++++++++++ src/mesa/glapi/gen/gl_SPARC_asm.py | 275 + src/mesa/glapi/gen/gl_XML.py | 967 ++ src/mesa/glapi/gen/gl_and_glX_API.xml | 7 + src/mesa/glapi/gen/gl_apitemp.py | 320 + src/mesa/glapi/gen/gl_enums.py | 243 + src/mesa/glapi/gen/gl_offsets.py | 120 + src/mesa/glapi/gen/gl_procs.py | 215 + src/mesa/glapi/gen/gl_table.py | 229 + src/mesa/glapi/gen/gl_x86-64_asm.py | 334 + src/mesa/glapi/gen/gl_x86_asm.py | 270 + src/mesa/glapi/gen/license.py | 47 + src/mesa/glapi/gen/mesadef.py | 216 + src/mesa/glapi/gen/next_available_offset.sh | 39 + src/mesa/glapi/gen/remap_helper.py | 226 + src/mesa/glapi/gen/typeexpr.py | 292 + src/mesa/glapi/glX_API.xml | 220 - src/mesa/glapi/glX_XML.py | 570 - src/mesa/glapi/glX_doc.py | 280 - src/mesa/glapi/glX_proto_common.py | 95 - src/mesa/glapi/glX_proto_recv.py | 554 - src/mesa/glapi/glX_proto_send.py | 1042 -- src/mesa/glapi/glX_proto_size.py | 704 -- src/mesa/glapi/glX_server_table.py | 411 - src/mesa/glapi/gl_API.dtd | 140 - src/mesa/glapi/gl_API.xml | 12505 ------------------- src/mesa/glapi/gl_SPARC_asm.py | 275 - src/mesa/glapi/gl_XML.py | 967 -- src/mesa/glapi/gl_and_glX_API.xml | 7 - src/mesa/glapi/gl_apitemp.py | 320 - src/mesa/glapi/gl_enums.py | 243 - src/mesa/glapi/gl_offsets.py | 120 - src/mesa/glapi/gl_procs.py | 215 - src/mesa/glapi/gl_table.py | 229 - src/mesa/glapi/gl_x86-64_asm.py | 334 - src/mesa/glapi/gl_x86_asm.py | 270 - src/mesa/glapi/license.py | 47 - src/mesa/glapi/mesadef.py | 216 - src/mesa/glapi/next_available_offset.sh | 39 - src/mesa/glapi/remap_helper.py | 226 - src/mesa/glapi/typeexpr.py | 292 - 84 files changed, 21750 insertions(+), 21750 deletions(-) delete mode 100644 src/mesa/glapi/APPLE_vertex_array_object.xml delete mode 100644 src/mesa/glapi/ARB_copy_buffer.xml delete mode 100644 src/mesa/glapi/ARB_depth_clamp.xml delete mode 100644 src/mesa/glapi/ARB_draw_elements_base_vertex.xml delete mode 100644 src/mesa/glapi/ARB_framebuffer_object.xml delete mode 100644 src/mesa/glapi/ARB_map_buffer_range.xml delete mode 100644 src/mesa/glapi/ARB_seamless_cube_map.xml delete mode 100644 src/mesa/glapi/ARB_sync.xml delete mode 100644 src/mesa/glapi/ARB_vertex_array_object.xml delete mode 100644 src/mesa/glapi/EXT_draw_buffers2.xml delete mode 100644 src/mesa/glapi/EXT_framebuffer_object.xml delete mode 100644 src/mesa/glapi/EXT_packed_depth_stencil.xml delete mode 100644 src/mesa/glapi/EXT_provoking_vertex.xml delete mode 100644 src/mesa/glapi/EXT_texture_array.xml delete mode 100644 src/mesa/glapi/Makefile delete mode 100644 src/mesa/glapi/NV_conditional_render.xml delete mode 100644 src/mesa/glapi/extension_helper.py create mode 100644 src/mesa/glapi/gen/APPLE_vertex_array_object.xml create mode 100644 src/mesa/glapi/gen/ARB_copy_buffer.xml create mode 100644 src/mesa/glapi/gen/ARB_depth_clamp.xml create mode 100644 src/mesa/glapi/gen/ARB_draw_elements_base_vertex.xml create mode 100644 src/mesa/glapi/gen/ARB_framebuffer_object.xml create mode 100644 src/mesa/glapi/gen/ARB_map_buffer_range.xml create mode 100644 src/mesa/glapi/gen/ARB_seamless_cube_map.xml create mode 100644 src/mesa/glapi/gen/ARB_sync.xml create mode 100644 src/mesa/glapi/gen/ARB_vertex_array_object.xml create mode 100644 src/mesa/glapi/gen/EXT_draw_buffers2.xml create mode 100644 src/mesa/glapi/gen/EXT_framebuffer_object.xml create mode 100644 src/mesa/glapi/gen/EXT_packed_depth_stencil.xml create mode 100644 src/mesa/glapi/gen/EXT_provoking_vertex.xml create mode 100644 src/mesa/glapi/gen/EXT_texture_array.xml create mode 100644 src/mesa/glapi/gen/Makefile create mode 100644 src/mesa/glapi/gen/NV_conditional_render.xml create mode 100644 src/mesa/glapi/gen/extension_helper.py create mode 100644 src/mesa/glapi/gen/glX_API.xml create mode 100644 src/mesa/glapi/gen/glX_XML.py create mode 100644 src/mesa/glapi/gen/glX_doc.py create mode 100644 src/mesa/glapi/gen/glX_proto_common.py create mode 100644 src/mesa/glapi/gen/glX_proto_recv.py create mode 100644 src/mesa/glapi/gen/glX_proto_send.py create mode 100644 src/mesa/glapi/gen/glX_proto_size.py create mode 100644 src/mesa/glapi/gen/glX_server_table.py create mode 100644 src/mesa/glapi/gen/gl_API.dtd create mode 100644 src/mesa/glapi/gen/gl_API.xml create mode 100644 src/mesa/glapi/gen/gl_SPARC_asm.py create mode 100644 src/mesa/glapi/gen/gl_XML.py create mode 100644 src/mesa/glapi/gen/gl_and_glX_API.xml create mode 100644 src/mesa/glapi/gen/gl_apitemp.py create mode 100644 src/mesa/glapi/gen/gl_enums.py create mode 100644 src/mesa/glapi/gen/gl_offsets.py create mode 100644 src/mesa/glapi/gen/gl_procs.py create mode 100644 src/mesa/glapi/gen/gl_table.py create mode 100644 src/mesa/glapi/gen/gl_x86-64_asm.py create mode 100644 src/mesa/glapi/gen/gl_x86_asm.py create mode 100644 src/mesa/glapi/gen/license.py create mode 100644 src/mesa/glapi/gen/mesadef.py create mode 100755 src/mesa/glapi/gen/next_available_offset.sh create mode 100644 src/mesa/glapi/gen/remap_helper.py create mode 100644 src/mesa/glapi/gen/typeexpr.py delete mode 100644 src/mesa/glapi/glX_API.xml delete mode 100644 src/mesa/glapi/glX_XML.py delete mode 100644 src/mesa/glapi/glX_doc.py delete mode 100644 src/mesa/glapi/glX_proto_common.py delete mode 100644 src/mesa/glapi/glX_proto_recv.py delete mode 100644 src/mesa/glapi/glX_proto_send.py delete mode 100644 src/mesa/glapi/glX_proto_size.py delete mode 100644 src/mesa/glapi/glX_server_table.py delete mode 100644 src/mesa/glapi/gl_API.dtd delete mode 100644 src/mesa/glapi/gl_API.xml delete mode 100644 src/mesa/glapi/gl_SPARC_asm.py delete mode 100644 src/mesa/glapi/gl_XML.py delete mode 100644 src/mesa/glapi/gl_and_glX_API.xml delete mode 100644 src/mesa/glapi/gl_apitemp.py delete mode 100644 src/mesa/glapi/gl_enums.py delete mode 100644 src/mesa/glapi/gl_offsets.py delete mode 100644 src/mesa/glapi/gl_procs.py delete mode 100644 src/mesa/glapi/gl_table.py delete mode 100644 src/mesa/glapi/gl_x86-64_asm.py delete mode 100644 src/mesa/glapi/gl_x86_asm.py delete mode 100644 src/mesa/glapi/license.py delete mode 100644 src/mesa/glapi/mesadef.py delete mode 100755 src/mesa/glapi/next_available_offset.sh delete mode 100644 src/mesa/glapi/remap_helper.py delete mode 100644 src/mesa/glapi/typeexpr.py (limited to 'src') diff --git a/src/mesa/glapi/APPLE_vertex_array_object.xml b/src/mesa/glapi/APPLE_vertex_array_object.xml deleted file mode 100644 index bd8427eaf6..0000000000 --- a/src/mesa/glapi/APPLE_vertex_array_object.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_copy_buffer.xml b/src/mesa/glapi/ARB_copy_buffer.xml deleted file mode 100644 index 719816d817..0000000000 --- a/src/mesa/glapi/ARB_copy_buffer.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_depth_clamp.xml b/src/mesa/glapi/ARB_depth_clamp.xml deleted file mode 100644 index 157c9a86b1..0000000000 --- a/src/mesa/glapi/ARB_depth_clamp.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_draw_elements_base_vertex.xml b/src/mesa/glapi/ARB_draw_elements_base_vertex.xml deleted file mode 100644 index f4067f4c8d..0000000000 --- a/src/mesa/glapi/ARB_draw_elements_base_vertex.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_framebuffer_object.xml b/src/mesa/glapi/ARB_framebuffer_object.xml deleted file mode 100644 index e6bdcd6e50..0000000000 --- a/src/mesa/glapi/ARB_framebuffer_object.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_map_buffer_range.xml b/src/mesa/glapi/ARB_map_buffer_range.xml deleted file mode 100644 index afcb9b6ba6..0000000000 --- a/src/mesa/glapi/ARB_map_buffer_range.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_seamless_cube_map.xml b/src/mesa/glapi/ARB_seamless_cube_map.xml deleted file mode 100644 index 3cdc84d2b9..0000000000 --- a/src/mesa/glapi/ARB_seamless_cube_map.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_sync.xml b/src/mesa/glapi/ARB_sync.xml deleted file mode 100644 index 4e4eebac32..0000000000 --- a/src/mesa/glapi/ARB_sync.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/ARB_vertex_array_object.xml b/src/mesa/glapi/ARB_vertex_array_object.xml deleted file mode 100644 index 3b4ab64f55..0000000000 --- a/src/mesa/glapi/ARB_vertex_array_object.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/EXT_draw_buffers2.xml b/src/mesa/glapi/EXT_draw_buffers2.xml deleted file mode 100644 index efbe61f74e..0000000000 --- a/src/mesa/glapi/EXT_draw_buffers2.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/EXT_framebuffer_object.xml b/src/mesa/glapi/EXT_framebuffer_object.xml deleted file mode 100644 index 4f418f7b64..0000000000 --- a/src/mesa/glapi/EXT_framebuffer_object.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/EXT_packed_depth_stencil.xml b/src/mesa/glapi/EXT_packed_depth_stencil.xml deleted file mode 100644 index 5be810302f..0000000000 --- a/src/mesa/glapi/EXT_packed_depth_stencil.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/EXT_provoking_vertex.xml b/src/mesa/glapi/EXT_provoking_vertex.xml deleted file mode 100644 index 71d2c72909..0000000000 --- a/src/mesa/glapi/EXT_provoking_vertex.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/EXT_texture_array.xml b/src/mesa/glapi/EXT_texture_array.xml deleted file mode 100644 index b5b8bd406f..0000000000 --- a/src/mesa/glapi/EXT_texture_array.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile deleted file mode 100644 index da679607d7..0000000000 --- a/src/mesa/glapi/Makefile +++ /dev/null @@ -1,158 +0,0 @@ -# This file isn't used during a normal compilation since we don't want to -# require Python in order to compile Mesa. -# Instead, when the Mesa developers update/change the API interface it's -# up to him/her to re-run this makefile and check in the newly generated files. - - -TOP = ../../.. -include $(TOP)/configs/current - -OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h glapidispatch.h \ - ../main/enums.c \ - ../main/remap_helper.h \ - ../x86/glapi_x86.S \ - ../x86-64/glapi_x86-64.S \ - ../sparc/glapi_sparc.S \ - ../../glx/indirect.c \ - ../../glx/indirect.h \ - ../../glx/indirect_init.c \ - ../../glx/indirect_size.h \ - ../../glx/indirect_size.c - - -GLX_DIR = $(XORG_BASE)/glx - -SERVER_GLAPI_FILES = \ - $(GLX_DIR)/glapi.h \ - $(GLX_DIR)/glapi.c \ - $(GLX_DIR)/glapi_nop.c \ - $(GLX_DIR)/glthread.c \ - $(GLX_DIR)/glthread.h - -SERVER_OUTPUTS = \ - $(GLX_DIR)/indirect_dispatch.c \ - $(GLX_DIR)/indirect_dispatch_swap.c \ - $(GLX_DIR)/indirect_dispatch.h \ - $(GLX_DIR)/indirect_reqsize.c \ - $(GLX_DIR)/indirect_reqsize.h \ - $(GLX_DIR)/indirect_size.h \ - $(GLX_DIR)/indirect_size_get.c \ - $(GLX_DIR)/indirect_size_get.h \ - $(GLX_DIR)/indirect_table.c \ - $(GLX_DIR)/glapitemp.h \ - $(GLX_DIR)/glapitable.h \ - $(GLX_DIR)/glapioffsets.h \ - $(GLX_DIR)/glapidispatch.h \ - $(GLX_DIR)/glprocs.h \ - $(SERVER_GLAPI_FILES) - -API_XML = gl_API.xml \ - ARB_copy_buffer.xml \ - ARB_depth_clamp.xml \ - ARB_draw_elements_base_vertex.xml \ - ARB_framebuffer_object.xml \ - ARB_map_buffer_range.xml \ - ARB_seamless_cube_map.xml \ - ARB_sync.xml \ - ARB_vertex_array_object.xml \ - APPLE_vertex_array_object.xml \ - EXT_draw_buffers2.xml \ - EXT_framebuffer_object.xml \ - EXT_packed_depth_stencil.xml \ - EXT_provoking_vertex.xml \ - EXT_texture_array.xml \ - NV_conditional_render.xml - -COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py -COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py - -all: check-xorg-source $(OUTPUTS) $(SERVER_OUTPUTS) - -check-xorg-source: - @if ! test -d $(GLX_DIR); then \ - echo "ERROR: Must specify path to xserver checkout; set XORG_BASE."; \ - exit 1; \ - fi - -$(GLX_DIR)/%.c: %.c - cp $< $@ - -$(GLX_DIR)/%.h: %.h - cp $< $@ - -glprocs.h $(GLX_DIR)/glprocs.h: gl_procs.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -glapitemp.h $(GLX_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -glapioffsets.h $(GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -glapitable.h $(GLX_DIR)/glapitable.h: gl_table.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -glapidispatch.h $(GLX_DIR)/glapidispatch.h: gl_table.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ - -../main/enums.c: gl_enums.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../main/remap_helper.h: remap_helper.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../x86/glapi_x86.S: gl_x86_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../x86-64/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../../glx/indirect.c: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ - -../../glx/indirect.h: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@ - -../../glx/indirect_init.c: glX_proto_send.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@ - -../../glx/indirect_size.h $(GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \ - | $(INDENT) $(INDENT_FLAGS) > $@ - -../../glx/indirect_size.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \ - | $(INDENT) $(INDENT_FLAGS) > $@ - -$(GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@ - -$(GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@ - -$(GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@ - -$(GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ - | $(INDENT) $(INDENT_FLAGS) > $@ - -$(GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ - -$(GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ - | $(INDENT) $(INDENT_FLAGS) -l200 > $@ - -$(GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ - -$(GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX) - $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@ - -clean: - -rm -f *~ *.pyo - -rm -f $(OUTPUTS) diff --git a/src/mesa/glapi/NV_conditional_render.xml b/src/mesa/glapi/NV_conditional_render.xml deleted file mode 100644 index 8bb31dd1fc..0000000000 --- a/src/mesa/glapi/NV_conditional_render.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/extension_helper.py b/src/mesa/glapi/extension_helper.py deleted file mode 100644 index 83471d89f5..0000000000 --- a/src/mesa/glapi/extension_helper.py +++ /dev/null @@ -1,324 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML -import license -import sys, getopt, string - -vtxfmt = [ - "ArrayElement", \ - "Color3f", \ - "Color3fv", \ - "Color4f", \ - "Color4fv", \ - "EdgeFlag", \ - "EdgeFlagv", \ - "EvalCoord1f", \ - "EvalCoord1fv", \ - "EvalCoord2f", \ - "EvalCoord2fv", \ - "EvalPoint1", \ - "EvalPoint2", \ - "FogCoordfEXT", \ - "FogCoordfvEXT", \ - "Indexf", \ - "Indexfv", \ - "Materialfv", \ - "MultiTexCoord1fARB", \ - "MultiTexCoord1fvARB", \ - "MultiTexCoord2fARB", \ - "MultiTexCoord2fvARB", \ - "MultiTexCoord3fARB", \ - "MultiTexCoord3fvARB", \ - "MultiTexCoord4fARB", \ - "MultiTexCoord4fvARB", \ - "Normal3f", \ - "Normal3fv", \ - "SecondaryColor3fEXT", \ - "SecondaryColor3fvEXT", \ - "TexCoord1f", \ - "TexCoord1fv", \ - "TexCoord2f", \ - "TexCoord2fv", \ - "TexCoord3f", \ - "TexCoord3fv", \ - "TexCoord4f", \ - "TexCoord4fv", \ - "Vertex2f", \ - "Vertex2fv", \ - "Vertex3f", \ - "Vertex3fv", \ - "Vertex4f", \ - "Vertex4fv", \ - "CallList", \ - "CallLists", \ - "Begin", \ - "End", \ - "VertexAttrib1fNV", \ - "VertexAttrib1fvNV", \ - "VertexAttrib2fNV", \ - "VertexAttrib2fvNV", \ - "VertexAttrib3fNV", \ - "VertexAttrib3fvNV", \ - "VertexAttrib4fNV", \ - "VertexAttrib4fvNV", \ - "VertexAttrib1fARB", \ - "VertexAttrib1fvARB", \ - "VertexAttrib2fARB", \ - "VertexAttrib2fvARB", \ - "VertexAttrib3fARB", \ - "VertexAttrib3fvARB", \ - "VertexAttrib4fARB", \ - "VertexAttrib4fvARB", \ - "Rectf", \ - "DrawArrays", \ - "DrawElements", \ - "DrawRangeElements", \ - "EvalMesh1", \ - "EvalMesh2", \ -] - -def all_entrypoints_in_abi(f, abi, api): - for n in f.entry_points: - [category, num] = api.get_category_for_name( n ) - if category not in abi: - return 0 - - return 1 - - -def any_entrypoints_in_abi(f, abi, api): - for n in f.entry_points: - [category, num] = api.get_category_for_name( n ) - if category in abi: - return 1 - - return 0 - - -def condition_for_function(f, abi, all_not_in_ABI): - """Create a C-preprocessor condition for the function. - - There are two modes of operation. If all_not_in_ABI is set, a - condition is only created is all of the entry-point names for f are - not in the selected ABI. If all_not_in_ABI is not set, a condition - is created if any entryp-point name is not in the selected ABI. - """ - - condition = [] - for n in f.entry_points: - [category, num] = api.get_category_for_name( n ) - if category not in abi: - condition.append( 'defined(need_%s)' % (gl_XML.real_category_name( category )) ) - elif all_not_in_ABI: - return [] - - return condition - - -class PrintGlExtensionGlue(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "extension_helper.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def printRealHeader(self): - print '#include "utils.h"' - print '#include "glapi/dispatch.h"' - print '' - return - - - def printBody(self, api): - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - - category_list = {} - - print '#ifndef NULL' - print '# define NULL 0' - print '#endif' - print '' - - for f in api.functionIterateAll(): - condition = condition_for_function(f, abi, 0) - if len(condition): - print '#if %s' % (string.join(condition, " || ")) - print 'static const char %s_names[] =' % (f.name) - - parameter_signature = '' - for p in f.parameterIterator(): - if p.is_padding: - continue - - # FIXME: This is a *really* ugly hack. :( - - tn = p.type_expr.get_base_type_node() - if p.is_pointer(): - parameter_signature += 'p' - elif tn.integer: - parameter_signature += 'i' - elif tn.size == 4: - parameter_signature += 'f' - else: - parameter_signature += 'd' - - print ' "%s\\0" /* Parameter signature */' % (parameter_signature) - - for n in f.entry_points: - print ' "gl%s\\0"' % (n) - - [category, num] = api.get_category_for_name( n ) - if category not in abi: - c = gl_XML.real_category_name(category) - if not category_list.has_key(c): - category_list[ c ] = [] - - category_list[ c ].append( f ) - - print ' "";' - print '#endif' - print '' - - keys = category_list.keys() - keys.sort() - - for category in keys: - print '#if defined(need_%s)' % (category) - print 'static const struct dri_extension_function %s_functions[] = {' % (category) - - for f in category_list[ category ]: - # A function either has an offset that is - # assigned by the ABI, or it has a remap - # index. - if any_entrypoints_in_abi(f, abi, api): - index_name = "-1" - offset = f.offset - else: - index_name = "%s_remap_index" % (f.name) - offset = -1 - - print ' { %s_names, %s, %d },' % (f.name, index_name, offset) - - - print ' { NULL, 0, 0 }' - print '};' - print '#endif' - print '' - - return - - -class PrintInitDispatch(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "extension_helper.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def do_function_body(self, api, abi, vtxfmt_only): - last_condition_string = None - for f in api.functionIterateByOffset(): - if (f.name in vtxfmt) and not vtxfmt_only: - continue - - if (f.name not in vtxfmt) and vtxfmt_only: - continue - - condition = condition_for_function(f, abi, 1) - condition_string = string.join(condition, " || ") - - if condition_string != last_condition_string: - if last_condition_string: - print '#endif /* %s */' % (last_condition_string) - - if condition_string: - print '#if %s' % (condition_string) - - if vtxfmt_only: - print ' disp->%s = vfmt->%s;' % (f.name, f.name) - else: - print ' disp->%s = _mesa_%s;' % (f.name, f.name) - - last_condition_string = condition_string - - if last_condition_string: - print '#endif /* %s */' % (last_condition_string) - - - - def printBody(self, api): - abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] - - print 'void driver_init_exec_table(struct _glapi_table *disp)' - print '{' - self.do_function_body(api, abi, 0) - print '}' - print '' - print 'void driver_install_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt)' - print '{' - self.do_function_body(api, abi, 1) - print '}' - - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - print " -m output_mode Output mode can be one of 'extensions' or 'exec_init'." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") - except Exception,e: - show_usage() - - mode = "extensions" - for (arg,val) in args: - if arg == "-f": - file_name = val - if arg == '-m': - mode = val - - - api = gl_XML.parse_GL_API( file_name ) - - if mode == "extensions": - printer = PrintGlExtensionGlue() - elif mode == "exec_init": - printer = PrintInitDispatch() - else: - show_usage() - - printer.Print( api ) diff --git a/src/mesa/glapi/gen/APPLE_vertex_array_object.xml b/src/mesa/glapi/gen/APPLE_vertex_array_object.xml new file mode 100644 index 0000000000..bd8427eaf6 --- /dev/null +++ b/src/mesa/glapi/gen/APPLE_vertex_array_object.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_copy_buffer.xml b/src/mesa/glapi/gen/ARB_copy_buffer.xml new file mode 100644 index 0000000000..719816d817 --- /dev/null +++ b/src/mesa/glapi/gen/ARB_copy_buffer.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_depth_clamp.xml b/src/mesa/glapi/gen/ARB_depth_clamp.xml new file mode 100644 index 0000000000..157c9a86b1 --- /dev/null +++ b/src/mesa/glapi/gen/ARB_depth_clamp.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_draw_elements_base_vertex.xml b/src/mesa/glapi/gen/ARB_draw_elements_base_vertex.xml new file mode 100644 index 0000000000..f4067f4c8d --- /dev/null +++ b/src/mesa/glapi/gen/ARB_draw_elements_base_vertex.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_framebuffer_object.xml b/src/mesa/glapi/gen/ARB_framebuffer_object.xml new file mode 100644 index 0000000000..e6bdcd6e50 --- /dev/null +++ b/src/mesa/glapi/gen/ARB_framebuffer_object.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_map_buffer_range.xml b/src/mesa/glapi/gen/ARB_map_buffer_range.xml new file mode 100644 index 0000000000..afcb9b6ba6 --- /dev/null +++ b/src/mesa/glapi/gen/ARB_map_buffer_range.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_seamless_cube_map.xml b/src/mesa/glapi/gen/ARB_seamless_cube_map.xml new file mode 100644 index 0000000000..3cdc84d2b9 --- /dev/null +++ b/src/mesa/glapi/gen/ARB_seamless_cube_map.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_sync.xml b/src/mesa/glapi/gen/ARB_sync.xml new file mode 100644 index 0000000000..4e4eebac32 --- /dev/null +++ b/src/mesa/glapi/gen/ARB_sync.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/ARB_vertex_array_object.xml b/src/mesa/glapi/gen/ARB_vertex_array_object.xml new file mode 100644 index 0000000000..3b4ab64f55 --- /dev/null +++ b/src/mesa/glapi/gen/ARB_vertex_array_object.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/EXT_draw_buffers2.xml b/src/mesa/glapi/gen/EXT_draw_buffers2.xml new file mode 100644 index 0000000000..efbe61f74e --- /dev/null +++ b/src/mesa/glapi/gen/EXT_draw_buffers2.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/EXT_framebuffer_object.xml b/src/mesa/glapi/gen/EXT_framebuffer_object.xml new file mode 100644 index 0000000000..4f418f7b64 --- /dev/null +++ b/src/mesa/glapi/gen/EXT_framebuffer_object.xml @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/EXT_packed_depth_stencil.xml b/src/mesa/glapi/gen/EXT_packed_depth_stencil.xml new file mode 100644 index 0000000000..5be810302f --- /dev/null +++ b/src/mesa/glapi/gen/EXT_packed_depth_stencil.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/EXT_provoking_vertex.xml b/src/mesa/glapi/gen/EXT_provoking_vertex.xml new file mode 100644 index 0000000000..71d2c72909 --- /dev/null +++ b/src/mesa/glapi/gen/EXT_provoking_vertex.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/EXT_texture_array.xml b/src/mesa/glapi/gen/EXT_texture_array.xml new file mode 100644 index 0000000000..b5b8bd406f --- /dev/null +++ b/src/mesa/glapi/gen/EXT_texture_array.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/Makefile b/src/mesa/glapi/gen/Makefile new file mode 100644 index 0000000000..da679607d7 --- /dev/null +++ b/src/mesa/glapi/gen/Makefile @@ -0,0 +1,158 @@ +# This file isn't used during a normal compilation since we don't want to +# require Python in order to compile Mesa. +# Instead, when the Mesa developers update/change the API interface it's +# up to him/her to re-run this makefile and check in the newly generated files. + + +TOP = ../../.. +include $(TOP)/configs/current + +OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h glapidispatch.h \ + ../main/enums.c \ + ../main/remap_helper.h \ + ../x86/glapi_x86.S \ + ../x86-64/glapi_x86-64.S \ + ../sparc/glapi_sparc.S \ + ../../glx/indirect.c \ + ../../glx/indirect.h \ + ../../glx/indirect_init.c \ + ../../glx/indirect_size.h \ + ../../glx/indirect_size.c + + +GLX_DIR = $(XORG_BASE)/glx + +SERVER_GLAPI_FILES = \ + $(GLX_DIR)/glapi.h \ + $(GLX_DIR)/glapi.c \ + $(GLX_DIR)/glapi_nop.c \ + $(GLX_DIR)/glthread.c \ + $(GLX_DIR)/glthread.h + +SERVER_OUTPUTS = \ + $(GLX_DIR)/indirect_dispatch.c \ + $(GLX_DIR)/indirect_dispatch_swap.c \ + $(GLX_DIR)/indirect_dispatch.h \ + $(GLX_DIR)/indirect_reqsize.c \ + $(GLX_DIR)/indirect_reqsize.h \ + $(GLX_DIR)/indirect_size.h \ + $(GLX_DIR)/indirect_size_get.c \ + $(GLX_DIR)/indirect_size_get.h \ + $(GLX_DIR)/indirect_table.c \ + $(GLX_DIR)/glapitemp.h \ + $(GLX_DIR)/glapitable.h \ + $(GLX_DIR)/glapioffsets.h \ + $(GLX_DIR)/glapidispatch.h \ + $(GLX_DIR)/glprocs.h \ + $(SERVER_GLAPI_FILES) + +API_XML = gl_API.xml \ + ARB_copy_buffer.xml \ + ARB_depth_clamp.xml \ + ARB_draw_elements_base_vertex.xml \ + ARB_framebuffer_object.xml \ + ARB_map_buffer_range.xml \ + ARB_seamless_cube_map.xml \ + ARB_sync.xml \ + ARB_vertex_array_object.xml \ + APPLE_vertex_array_object.xml \ + EXT_draw_buffers2.xml \ + EXT_framebuffer_object.xml \ + EXT_packed_depth_stencil.xml \ + EXT_provoking_vertex.xml \ + EXT_texture_array.xml \ + NV_conditional_render.xml + +COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py +COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py + +all: check-xorg-source $(OUTPUTS) $(SERVER_OUTPUTS) + +check-xorg-source: + @if ! test -d $(GLX_DIR); then \ + echo "ERROR: Must specify path to xserver checkout; set XORG_BASE."; \ + exit 1; \ + fi + +$(GLX_DIR)/%.c: %.c + cp $< $@ + +$(GLX_DIR)/%.h: %.h + cp $< $@ + +glprocs.h $(GLX_DIR)/glprocs.h: gl_procs.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +glapitemp.h $(GLX_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +glapioffsets.h $(GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +glapitable.h $(GLX_DIR)/glapitable.h: gl_table.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +glapidispatch.h $(GLX_DIR)/glapidispatch.h: gl_table.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ + +../main/enums.c: gl_enums.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../main/remap_helper.h: remap_helper.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../x86/glapi_x86.S: gl_x86_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../x86-64/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + +../../glx/indirect.c: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ + +../../glx/indirect.h: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@ + +../../glx/indirect_init.c: glX_proto_send.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@ + +../../glx/indirect_size.h $(GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +../../glx/indirect_size.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@ + +$(GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@ + +$(GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@ + +$(GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ + | $(INDENT) $(INDENT_FLAGS) -l200 > $@ + +$(GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ + +$(GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX) + $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@ + +clean: + -rm -f *~ *.pyo + -rm -f $(OUTPUTS) diff --git a/src/mesa/glapi/gen/NV_conditional_render.xml b/src/mesa/glapi/gen/NV_conditional_render.xml new file mode 100644 index 0000000000..8bb31dd1fc --- /dev/null +++ b/src/mesa/glapi/gen/NV_conditional_render.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/extension_helper.py b/src/mesa/glapi/gen/extension_helper.py new file mode 100644 index 0000000000..83471d89f5 --- /dev/null +++ b/src/mesa/glapi/gen/extension_helper.py @@ -0,0 +1,324 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt, string + +vtxfmt = [ + "ArrayElement", \ + "Color3f", \ + "Color3fv", \ + "Color4f", \ + "Color4fv", \ + "EdgeFlag", \ + "EdgeFlagv", \ + "EvalCoord1f", \ + "EvalCoord1fv", \ + "EvalCoord2f", \ + "EvalCoord2fv", \ + "EvalPoint1", \ + "EvalPoint2", \ + "FogCoordfEXT", \ + "FogCoordfvEXT", \ + "Indexf", \ + "Indexfv", \ + "Materialfv", \ + "MultiTexCoord1fARB", \ + "MultiTexCoord1fvARB", \ + "MultiTexCoord2fARB", \ + "MultiTexCoord2fvARB", \ + "MultiTexCoord3fARB", \ + "MultiTexCoord3fvARB", \ + "MultiTexCoord4fARB", \ + "MultiTexCoord4fvARB", \ + "Normal3f", \ + "Normal3fv", \ + "SecondaryColor3fEXT", \ + "SecondaryColor3fvEXT", \ + "TexCoord1f", \ + "TexCoord1fv", \ + "TexCoord2f", \ + "TexCoord2fv", \ + "TexCoord3f", \ + "TexCoord3fv", \ + "TexCoord4f", \ + "TexCoord4fv", \ + "Vertex2f", \ + "Vertex2fv", \ + "Vertex3f", \ + "Vertex3fv", \ + "Vertex4f", \ + "Vertex4fv", \ + "CallList", \ + "CallLists", \ + "Begin", \ + "End", \ + "VertexAttrib1fNV", \ + "VertexAttrib1fvNV", \ + "VertexAttrib2fNV", \ + "VertexAttrib2fvNV", \ + "VertexAttrib3fNV", \ + "VertexAttrib3fvNV", \ + "VertexAttrib4fNV", \ + "VertexAttrib4fvNV", \ + "VertexAttrib1fARB", \ + "VertexAttrib1fvARB", \ + "VertexAttrib2fARB", \ + "VertexAttrib2fvARB", \ + "VertexAttrib3fARB", \ + "VertexAttrib3fvARB", \ + "VertexAttrib4fARB", \ + "VertexAttrib4fvARB", \ + "Rectf", \ + "DrawArrays", \ + "DrawElements", \ + "DrawRangeElements", \ + "EvalMesh1", \ + "EvalMesh2", \ +] + +def all_entrypoints_in_abi(f, abi, api): + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category not in abi: + return 0 + + return 1 + + +def any_entrypoints_in_abi(f, abi, api): + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category in abi: + return 1 + + return 0 + + +def condition_for_function(f, abi, all_not_in_ABI): + """Create a C-preprocessor condition for the function. + + There are two modes of operation. If all_not_in_ABI is set, a + condition is only created is all of the entry-point names for f are + not in the selected ABI. If all_not_in_ABI is not set, a condition + is created if any entryp-point name is not in the selected ABI. + """ + + condition = [] + for n in f.entry_points: + [category, num] = api.get_category_for_name( n ) + if category not in abi: + condition.append( 'defined(need_%s)' % (gl_XML.real_category_name( category )) ) + elif all_not_in_ABI: + return [] + + return condition + + +class PrintGlExtensionGlue(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "extension_helper.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def printRealHeader(self): + print '#include "utils.h"' + print '#include "glapi/dispatch.h"' + print '' + return + + + def printBody(self, api): + abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + + category_list = {} + + print '#ifndef NULL' + print '# define NULL 0' + print '#endif' + print '' + + for f in api.functionIterateAll(): + condition = condition_for_function(f, abi, 0) + if len(condition): + print '#if %s' % (string.join(condition, " || ")) + print 'static const char %s_names[] =' % (f.name) + + parameter_signature = '' + for p in f.parameterIterator(): + if p.is_padding: + continue + + # FIXME: This is a *really* ugly hack. :( + + tn = p.type_expr.get_base_type_node() + if p.is_pointer(): + parameter_signature += 'p' + elif tn.integer: + parameter_signature += 'i' + elif tn.size == 4: + parameter_signature += 'f' + else: + parameter_signature += 'd' + + print ' "%s\\0" /* Parameter signature */' % (parameter_signature) + + for n in f.entry_points: + print ' "gl%s\\0"' % (n) + + [category, num] = api.get_category_for_name( n ) + if category not in abi: + c = gl_XML.real_category_name(category) + if not category_list.has_key(c): + category_list[ c ] = [] + + category_list[ c ].append( f ) + + print ' "";' + print '#endif' + print '' + + keys = category_list.keys() + keys.sort() + + for category in keys: + print '#if defined(need_%s)' % (category) + print 'static const struct dri_extension_function %s_functions[] = {' % (category) + + for f in category_list[ category ]: + # A function either has an offset that is + # assigned by the ABI, or it has a remap + # index. + if any_entrypoints_in_abi(f, abi, api): + index_name = "-1" + offset = f.offset + else: + index_name = "%s_remap_index" % (f.name) + offset = -1 + + print ' { %s_names, %s, %d },' % (f.name, index_name, offset) + + + print ' { NULL, 0, 0 }' + print '};' + print '#endif' + print '' + + return + + +class PrintInitDispatch(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "extension_helper.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def do_function_body(self, api, abi, vtxfmt_only): + last_condition_string = None + for f in api.functionIterateByOffset(): + if (f.name in vtxfmt) and not vtxfmt_only: + continue + + if (f.name not in vtxfmt) and vtxfmt_only: + continue + + condition = condition_for_function(f, abi, 1) + condition_string = string.join(condition, " || ") + + if condition_string != last_condition_string: + if last_condition_string: + print '#endif /* %s */' % (last_condition_string) + + if condition_string: + print '#if %s' % (condition_string) + + if vtxfmt_only: + print ' disp->%s = vfmt->%s;' % (f.name, f.name) + else: + print ' disp->%s = _mesa_%s;' % (f.name, f.name) + + last_condition_string = condition_string + + if last_condition_string: + print '#endif /* %s */' % (last_condition_string) + + + + def printBody(self, api): + abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + + print 'void driver_init_exec_table(struct _glapi_table *disp)' + print '{' + self.do_function_body(api, abi, 0) + print '}' + print '' + print 'void driver_install_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt)' + print '{' + self.do_function_body(api, abi, 1) + print '}' + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + print " -m output_mode Output mode can be one of 'extensions' or 'exec_init'." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:") + except Exception,e: + show_usage() + + mode = "extensions" + for (arg,val) in args: + if arg == "-f": + file_name = val + if arg == '-m': + mode = val + + + api = gl_XML.parse_GL_API( file_name ) + + if mode == "extensions": + printer = PrintGlExtensionGlue() + elif mode == "exec_init": + printer = PrintInitDispatch() + else: + show_usage() + + printer.Print( api ) diff --git a/src/mesa/glapi/gen/glX_API.xml b/src/mesa/glapi/gen/glX_API.xml new file mode 100644 index 0000000000..9e02aa498e --- /dev/null +++ b/src/mesa/glapi/gen/glX_API.xml @@ -0,0 +1,220 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/glX_XML.py b/src/mesa/glapi/gen/glX_XML.py new file mode 100644 index 0000000000..4c2e0f95bf --- /dev/null +++ b/src/mesa/glapi/gen/glX_XML.py @@ -0,0 +1,570 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt, string + + +class glx_item_factory(gl_XML.gl_item_factory): + """Factory to create GLX protocol oriented objects derived from gl_item.""" + + def create_item(self, name, element, context): + if name == "function": + return glx_function(element, context) + elif name == "enum": + return glx_enum(element, context) + elif name == "api": + return glx_api(self) + else: + return gl_XML.gl_item_factory.create_item(self, name, element, context) + + +class glx_enum(gl_XML.gl_enum): + def __init__(self, element, context): + gl_XML.gl_enum.__init__(self, element, context) + + self.functions = {} + + child = element.children + while child: + if child.type == "element" and child.name == "size": + n = child.nsProp( "name", None ) + c = child.nsProp( "count", None ) + m = child.nsProp( "mode", None ) + + if not c: + c = self.default_count + else: + c = int(c) + + if m == "get": + mode = 0 + else: + mode = 1 + + if not self.functions.has_key(n): + self.functions[ n ] = [c, mode] + + child = child.next + + return + + +class glx_function(gl_XML.gl_function): + def __init__(self, element, context): + self.glx_rop = 0 + self.glx_sop = 0 + self.glx_vendorpriv = 0 + + self.glx_vendorpriv_names = [] + + # If this is set to true, it means that GLdouble parameters should be + # written to the GLX protocol packet in the order they appear in the + # prototype. This is different from the "classic" ordering. In the + # classic ordering GLdoubles are written to the protocol packet first, + # followed by non-doubles. NV_vertex_program was the first extension + # to break with this tradition. + + self.glx_doubles_in_order = 0 + + self.vectorequiv = None + self.output = None + self.can_be_large = 0 + self.reply_always_array = 0 + self.dimensions_in_reply = 0 + self.img_reset = None + + self.server_handcode = 0 + self.client_handcode = 0 + self.ignore = 0 + + self.count_parameter_list = [] + self.counter_list = [] + self.parameters_by_name = {} + self.offsets_calculated = 0 + + gl_XML.gl_function.__init__(self, element, context) + return + + + def process_element(self, element): + gl_XML.gl_function.process_element(self, element) + + # If the function already has a vector equivalent set, don't + # set it again. This can happen if an alias to a function + # appears after the function that it aliases. + + if not self.vectorequiv: + self.vectorequiv = element.nsProp("vectorequiv", None) + + + name = element.nsProp("name", None) + if name == self.name: + for param in self.parameters: + self.parameters_by_name[ param.name ] = param + + if len(param.count_parameter_list): + self.count_parameter_list.extend( param.count_parameter_list ) + + if param.counter and param.counter not in self.counter_list: + self.counter_list.append(param.counter) + + + child = element.children + while child: + if child.type == "element" and child.name == "glx": + rop = child.nsProp( 'rop', None ) + sop = child.nsProp( 'sop', None ) + vop = child.nsProp( 'vendorpriv', None ) + + if rop: + self.glx_rop = int(rop) + + if sop: + self.glx_sop = int(sop) + + if vop: + self.glx_vendorpriv = int(vop) + self.glx_vendorpriv_names.append(name) + + self.img_reset = child.nsProp( 'img_reset', None ) + + # The 'handcode' attribute can be one of 'true', + # 'false', 'client', or 'server'. + + handcode = child.nsProp( 'handcode', None ) + if handcode == "false": + self.server_handcode = 0 + self.client_handcode = 0 + elif handcode == "true": + self.server_handcode = 1 + self.client_handcode = 1 + elif handcode == "client": + self.server_handcode = 0 + self.client_handcode = 1 + elif handcode == "server": + self.server_handcode = 1 + self.client_handcode = 0 + else: + raise RuntimeError('Invalid handcode mode "%s" in function "%s".' % (handcode, self.name)) + + self.ignore = gl_XML.is_attr_true( child, 'ignore' ) + self.can_be_large = gl_XML.is_attr_true( child, 'large' ) + self.glx_doubles_in_order = gl_XML.is_attr_true( child, 'doubles_in_order' ) + self.reply_always_array = gl_XML.is_attr_true( child, 'always_array' ) + self.dimensions_in_reply = gl_XML.is_attr_true( child, 'dimensions_in_reply' ) + + child = child.next + + + # Do some validation of the GLX protocol information. As + # new tests are discovered, they should be added here. + + for param in self.parameters: + if param.is_output and self.glx_rop != 0: + raise RuntimeError("Render / RenderLarge commands cannot have outputs (%s)." % (self.name)) + + return + + + def has_variable_size_request(self): + """Determine if the GLX request packet is variable sized. + + The GLX request packet is variable sized in several common + situations. + + 1. The function has a non-output parameter that is counted + by another parameter (e.g., the 'textures' parameter of + glDeleteTextures). + + 2. The function has a non-output parameter whose count is + determined by another parameter that is an enum (e.g., the + 'params' parameter of glLightfv). + + 3. The function has a non-output parameter that is an + image. + + 4. The function must be hand-coded on the server. + """ + + if self.glx_rop == 0: + return 0 + + if self.server_handcode or self.images: + return 1 + + for param in self.parameters: + if not param.is_output: + if param.counter or len(param.count_parameter_list): + return 1 + + return 0 + + + def variable_length_parameter(self): + for param in self.parameters: + if not param.is_output: + if param.counter or len(param.count_parameter_list): + return param + + return None + + + def calculate_offsets(self): + if not self.offsets_calculated: + # Calculate the offset of the first function parameter + # in the GLX command packet. This byte offset is + # measured from the end of the Render / RenderLarge + # header. The offset for all non-pixel commends is + # zero. The offset for pixel commands depends on the + # number of dimensions of the pixel data. + + if len(self.images) and not self.images[0].is_output: + [dim, junk, junk, junk, junk] = self.images[0].get_dimensions() + + # The base size is the size of the pixel pack info + # header used by images with the specified number + # of dimensions. + + if dim <= 2: + offset = 20 + elif dim <= 4: + offset = 36 + else: + raise RuntimeError('Invalid number of dimensions %u for parameter "%s" in function "%s".' % (dim, self.image.name, self.name)) + else: + offset = 0 + + for param in self.parameterIterateGlxSend(): + if param.img_null_flag: + offset += 4 + + if param.name != self.img_reset: + param.offset = offset + if not param.is_variable_length() and not param.is_client_only: + offset += param.size() + + if self.pad_after( param ): + offset += 4 + + + self.offsets_calculated = 1 + return + + + def offset_of(self, param_name): + self.calculate_offsets() + return self.parameters_by_name[ param_name ].offset + + + def parameterIterateGlxSend(self, include_variable_parameters = 1): + """Create an iterator for parameters in GLX request order.""" + + # The parameter lists are usually quite short, so it's easier + # (i.e., less code) to just generate a new list with the + # required elements than it is to create a new iterator class. + + temp = [ [], [], [] ] + for param in self.parameters: + if param.is_output: continue + + if param.is_variable_length(): + temp[2].append( param ) + elif not self.glx_doubles_in_order and param.is_64_bit(): + temp[0].append( param ) + else: + temp[1].append( param ) + + parameters = temp[0] + parameters.extend( temp[1] ) + if include_variable_parameters: + parameters.extend( temp[2] ) + return parameters.__iter__() + + + def parameterIterateCounters(self): + temp = [] + for name in self.counter_list: + temp.append( self.parameters_by_name[ name ] ) + + return temp.__iter__() + + + def parameterIterateOutputs(self): + temp = [] + for p in self.parameters: + if p.is_output: + temp.append( p ) + + return temp + + + def command_fixed_length(self): + """Return the length, in bytes as an integer, of the + fixed-size portion of the command.""" + + if len(self.parameters) == 0: + return 0 + + self.calculate_offsets() + + size = 0 + for param in self.parameterIterateGlxSend(0): + if param.name != self.img_reset and not param.is_client_only: + if size == 0: + size = param.offset + param.size() + else: + size += param.size() + + if self.pad_after( param ): + size += 4 + + for param in self.images: + if param.img_null_flag or param.is_output: + size += 4 + + return size + + + def command_variable_length(self): + """Return the length, as a string, of the variable-sized + portion of the command.""" + + size_string = "" + for p in self.parameterIterateGlxSend(): + if (not p.is_output) and (p.is_variable_length() or p.is_image()): + # FIXME Replace the 1 in the size_string call + # FIXME w/0 to eliminate some un-needed parnes + # FIXME This would already be done, but it + # FIXME adds some extra diffs to the generated + # FIXME code. + + size_string = size_string + " + __GLX_PAD(%s)" % (p.size_string(1)) + + return size_string + + + def command_length(self): + size = self.command_fixed_length() + + if self.glx_rop != 0: + size += 4 + + size = ((size + 3) & ~3) + return "%u%s" % (size, self.command_variable_length()) + + + def opcode_real_value(self): + """Get the true numeric value of the GLX opcode + + Behaves similarly to opcode_value, except for + X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. + In these cases the value for the GLX opcode field (i.e., + 16 for X_GLXVendorPrivate or 17 for + X_GLXVendorPrivateWithReply) is returned. For other 'single' + commands, the opcode for the command (e.g., 101 for + X_GLsop_NewList) is returned.""" + + if self.glx_vendorpriv != 0: + if self.needs_reply(): + return 17 + else: + return 16 + else: + return self.opcode_value() + + + def opcode_value(self): + """Get the unique protocol opcode for the glXFunction""" + + if (self.glx_rop == 0) and self.vectorequiv: + equiv = self.context.functions_by_name[ self.vectorequiv ] + self.glx_rop = equiv.glx_rop + + + if self.glx_rop != 0: + return self.glx_rop + elif self.glx_sop != 0: + return self.glx_sop + elif self.glx_vendorpriv != 0: + return self.glx_vendorpriv + else: + return -1 + + + def opcode_rop_basename(self): + """Return either the name to be used for GLX protocol enum. + + Returns either the name of the function or the name of the + name of the equivalent vector (e.g., glVertex3fv for + glVertex3f) function.""" + + if self.vectorequiv == None: + return self.name + else: + return self.vectorequiv + + + def opcode_name(self): + """Get the unique protocol enum name for the glXFunction""" + + if (self.glx_rop == 0) and self.vectorequiv: + equiv = self.context.functions_by_name[ self.vectorequiv ] + self.glx_rop = equiv.glx_rop + self.glx_doubles_in_order = equiv.glx_doubles_in_order + + + if self.glx_rop != 0: + return "X_GLrop_%s" % (self.opcode_rop_basename()) + elif self.glx_sop != 0: + return "X_GLsop_%s" % (self.name) + elif self.glx_vendorpriv != 0: + return "X_GLvop_%s" % (self.name) + else: + raise RuntimeError('Function "%s" has no opcode.' % (self.name)) + + + def opcode_vendor_name(self, name): + if name in self.glx_vendorpriv_names: + return "X_GLvop_%s" % (name) + else: + raise RuntimeError('Function "%s" has no VendorPrivate opcode.' % (name)) + + + def opcode_real_name(self): + """Get the true protocol enum name for the GLX opcode + + Behaves similarly to opcode_name, except for + X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. + In these cases the string 'X_GLXVendorPrivate' or + 'X_GLXVendorPrivateWithReply' is returned. For other + single or render commands 'X_GLsop' or 'X_GLrop' plus the + name of the function returned.""" + + if self.glx_vendorpriv != 0: + if self.needs_reply(): + return "X_GLXVendorPrivateWithReply" + else: + return "X_GLXVendorPrivate" + else: + return self.opcode_name() + + + def needs_reply(self): + try: + x = self._needs_reply + except Exception, e: + x = 0 + if self.return_type != 'void': + x = 1 + + for param in self.parameters: + if param.is_output: + x = 1 + break + + self._needs_reply = x + + return x + + + def pad_after(self, p): + """Returns the name of the field inserted after the + specified field to pad out the command header.""" + + for image in self.images: + if image.img_pad_dimensions: + if not image.height: + if p.name == image.width: + return "height" + elif p.name == image.img_xoff: + return "yoffset" + elif not image.extent: + if p.name == image.depth: + # Should this be "size4d"? + return "extent" + elif p.name == image.img_zoff: + return "woffset" + + return None + + + def has_different_protocol(self, name): + """Returns true if the named version of the function uses different protocol from the other versions. + + Some functions, such as glDeleteTextures and + glDeleteTexturesEXT are functionally identical, but have + different protocol. This function returns true if the + named function is an alias name and that named version uses + different protocol from the function that is aliased. + """ + + return (name in self.glx_vendorpriv_names) and self.glx_sop + + + def static_glx_name(self, name): + if self.has_different_protocol(name): + for n in self.glx_vendorpriv_names: + if n in self.static_entry_points: + return n + + return self.static_name(name) + + + def client_supported_for_indirect(self): + """Returns true if the function is supported on the client + side for indirect rendering.""" + + return not self.ignore and (self.offset != -1) and (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or self.client_handcode) + + +class glx_function_iterator: + """Class to iterate over a list of glXFunctions""" + + def __init__(self, context): + self.iterator = context.functionIterateByOffset() + return + + + def __iter__(self): + return self + + + def next(self): + f = self.iterator.next() + + if f.client_supported_for_indirect(): + return f + else: + return self.next() + + +class glx_api(gl_XML.gl_api): + def functionIterateGlx(self): + return glx_function_iterator(self) + diff --git a/src/mesa/glapi/gen/glX_doc.py b/src/mesa/glapi/gen/glX_doc.py new file mode 100644 index 0000000000..e9fbbe6f16 --- /dev/null +++ b/src/mesa/glapi/gen/glX_doc.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt + + +class glx_doc_item_factory(glX_proto_common.glx_proto_item_factory): + """Factory to create GLX protocol documentation oriented objects derived from glItem.""" + + def create_item(self, name, element, context): + if name == "parameter": + return glx_doc_parameter(element, context) + else: + return glX_proto_common.glx_proto_item_factory.create_item(self, name, element, context) + + +class glx_doc_parameter(gl_XML.gl_parameter): + def packet_type(self, type_dict): + """Get the type string for the packet header + + GLX protocol documentation uses type names like CARD32, + FLOAT64, LISTofCARD8, and ENUM. This function converts the + type of the parameter to one of these names.""" + + list_of = "" + if self.is_array(): + list_of = "LISTof" + + t_name = self.get_base_type_string() + if not type_dict.has_key( t_name ): + type_name = "CARD8" + else: + type_name = type_dict[ t_name ] + + return "%s%s" % (list_of, type_name) + + + def packet_size(self): + p = None + s = self.size() + if s == 0: + a_prod = "n" + b_prod = self.p_type.size + + if not self.count_parameter_list and self.counter: + a_prod = self.counter + elif self.count_parameter_list and not self.counter or self.is_output: + pass + elif self.count_parameter_list and self.counter: + b_prod = self.counter + else: + raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name)) + + ss = "%s*%s" % (a_prod, b_prod) + + return [ss, p] + else: + if s % 4 != 0: + p = "p" + + return [str(s), p] + +class PrintGlxProtoText(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + self.license = "" + + + def printHeader(self): + return + + + def body_size(self, f): + # At some point, refactor this function and + # glXFunction::command_payload_length. + + size = 0; + size_str = "" + pad_str = "" + plus = "" + for p in f.parameterIterateGlxSend(): + [s, pad] = p.packet_size() + try: + size += int(s) + except Exception,e: + size_str += "%s%s" % (plus, s) + plus = "+" + + if pad != None: + pad_str = pad + + return [size, size_str, pad_str] + + + def print_render_header(self, f): + [size, size_str, pad_str] = self.body_size(f) + size += 4; + + if size_str == "": + s = "%u" % ((size + 3) & ~3) + elif pad_str != "": + s = "%u+%s+%s" % (size, size_str, pad_str) + else: + s = "%u+%s" % (size, size_str) + + print ' 2 %-15s rendering command length' % (s) + print ' 2 %-4u rendering command opcode' % (f.glx_rop) + return + + + def print_single_header(self, f): + [size, size_str, pad_str] = self.body_size(f) + size = ((size + 3) / 4) + 2; + + if f.glx_vendorpriv != 0: + size += 1 + + print ' 1 CARD8 opcode (X assigned)' + print ' 1 %-4u GLX opcode (%s)' % (f.opcode_real_value(), f.opcode_real_name()) + + if size_str == "": + s = "%u" % (size) + elif pad_str != "": + s = "%u+((%s+%s)/4)" % (size, size_str, pad_str) + else: + s = "%u+((%s)/4)" % (size, size_str) + + print ' 2 %-15s request length' % (s) + + if f.glx_vendorpriv != 0: + print ' 4 %-4u vendor specific opcode' % (f.opcode_value()) + + print ' 4 GLX_CONTEXT_TAG context tag' + + return + + + def print_reply(self, f): + print ' =>' + print ' 1 1 reply' + print ' 1 unused' + print ' 2 CARD16 sequence number' + + if f.output == None: + print ' 4 0 reply length' + elif f.reply_always_array: + print ' 4 m reply length' + else: + print ' 4 m reply length, m = (n == 1 ? 0 : n)' + + + output = None + for x in f.parameterIterateOutputs(): + output = x + break + + + unused = 24 + if f.return_type != 'void': + print ' 4 %-15s return value' % (f.return_type) + unused -= 4 + elif output != None: + print ' 4 unused' + unused -= 4 + + if output != None: + print ' 4 CARD32 n' + unused -= 4 + + if output != None: + if not f.reply_always_array: + print '' + print ' if (n = 1) this follows:' + print '' + print ' 4 CARD32 %s' % (output.name) + print ' %-2u unused' % (unused - 4) + print '' + print ' otherwise this follows:' + print '' + + print ' %-2u unused' % (unused) + + [s, pad] = output.packet_size() + print ' %-8s %-15s %s' % (s, output.packet_type( self.type_map ), output.name) + if pad != None: + try: + bytes = int(s) + bytes = 4 - (bytes & 3) + print ' %-8u %-15s unused' % (bytes, "") + except Exception,e: + print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) + else: + print ' %-2u unused' % (unused) + + + def print_body(self, f): + for p in f.parameterIterateGlxSend(): + [s, pad] = p.packet_size() + print ' %-8s %-15s %s' % (s, p.packet_type( self.type_map ), p.name) + if pad != None: + try: + bytes = int(s) + bytes = 4 - (bytes & 3) + print ' %-8u %-15s unused' % (bytes, "") + except Exception,e: + print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) + + def printBody(self, api): + self.type_map = {} + for t in api.typeIterate(): + self.type_map[ "GL" + t.name ] = t.glx_name + + + # At some point this should be expanded to support pixel + # functions, but I'm not going to lose any sleep over it now. + + for f in api.functionIterateByOffset(): + if f.client_handcode or f.server_handcode or f.vectorequiv or len(f.get_images()): + continue + + + if f.glx_rop: + print ' %s' % (f.name) + self.print_render_header(f) + elif f.glx_sop or f.glx_vendorpriv: + print ' %s' % (f.name) + self.print_single_header(f) + else: + continue + + self.print_body(f) + + if f.needs_reply(): + self.print_reply(f) + + print '' + return + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API( file_name, glx_doc_item_factory() ) + + printer = PrintGlxProtoText() + printer.Print( api ) diff --git a/src/mesa/glapi/gen/glX_proto_common.py b/src/mesa/glapi/gen/glX_proto_common.py new file mode 100644 index 0000000000..6f094e22b3 --- /dev/null +++ b/src/mesa/glapi/gen/glX_proto_common.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML +import string + + +class glx_proto_item_factory(glX_XML.glx_item_factory): + """Factory to create GLX protocol oriented objects derived from gl_item.""" + + def create_item(self, name, element, context): + if name == "type": + return glx_proto_type(element, context) + else: + return glX_XML.glx_item_factory.create_item(self, name, element, context) + + +class glx_proto_type(gl_XML.gl_type): + def __init__(self, element, context): + gl_XML.gl_type.__init__(self, element, context) + + self.glx_name = element.nsProp( "glx_name", None ) + return + + +class glx_print_proto(gl_XML.gl_print_base): + def size_call(self, func, outputs_also = 0): + """Create C code to calculate 'compsize'. + + Creates code to calculate 'compsize'. If the function does + not need 'compsize' to be calculated, None will be + returned.""" + + compsize = None + + for param in func.parameterIterator(): + if outputs_also or not param.is_output: + if param.is_image(): + [dim, w, h, d, junk] = param.get_dimensions() + + compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, param.img_format, param.img_type, param.img_target) + if not param.img_send_null: + compsize = '(%s != NULL) ? %s : 0' % (param.name, compsize) + + return compsize + + elif len(param.count_parameter_list): + parameters = string.join( param.count_parameter_list, "," ) + compsize = "__gl%s_size(%s)" % (func.name, parameters) + + return compsize + + return None + + + def emit_packet_size_calculation(self, f, bias): + # compsize is only used in the command size calculation if + # the function has a non-output parameter that has a non-empty + # counter_parameter_list. + + compsize = self.size_call(f) + if compsize: + print ' const GLuint compsize = %s;' % (compsize) + + if bias: + print ' const GLuint cmdlen = %s - %u;' % (f.command_length(), bias) + else: + print ' const GLuint cmdlen = %s;' % (f.command_length()) + + #print '' + return compsize diff --git a/src/mesa/glapi/gen/glX_proto_recv.py b/src/mesa/glapi/gen/glX_proto_recv.py new file mode 100644 index 0000000000..f423c6db08 --- /dev/null +++ b/src/mesa/glapi/gen/glX_proto_recv.py @@ -0,0 +1,554 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt, string + + +class PrintGlxDispatch_h(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_recv.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + + self.header_tag = "_INDIRECT_DISPATCH_H_" + return + + + def printRealHeader(self): + self.printVisibility( "HIDDEN", "hidden" ) + print 'struct __GLXclientStateRec;' + print '' + return + + + def printBody(self, api): + for func in api.functionIterateAll(): + if not func.ignore and not func.vectorequiv: + if func.glx_rop: + print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name) + print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name) + elif func.glx_sop or func.glx_vendorpriv: + print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) + print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) + + if func.glx_sop and func.glx_vendorpriv: + n = func.glx_vendorpriv_names[0] + print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) + print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) + + return + + +class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): + def __init__(self, do_swap): + gl_XML.gl_print_base.__init__(self) + self.name = "glX_proto_recv.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + + self.real_types = [ '', '', 'uint16_t', '', 'uint32_t', '', '', '', 'uint64_t' ] + self.do_swap = do_swap + return + + + def printRealHeader(self): + print '#include ' + print '#include ' + print '#include ' + + print '#include ' + print '#include "indirect_size.h"' + print '#include "indirect_size_get.h"' + print '#include "indirect_dispatch.h"' + print '#include "glxserver.h"' + print '#include "glxbyteorder.h"' + print '#include "indirect_util.h"' + print '#include "singlesize.h"' + print '#include "glapi.h"' + print '#include "glapitable.h"' + print '#include "glthread.h"' + print '#include "dispatch.h"' + print '' + print '#define __GLX_PAD(x) (((x) + 3) & ~3)' + print '' + print 'typedef struct {' + print ' __GLX_PIXEL_3D_HDR;' + print '} __GLXpixel3DHeader;' + print '' + print 'extern GLboolean __glXErrorOccured( void );' + print 'extern void __glXClearErrorOccured( void );' + print '' + print 'static const unsigned dummy_answer[2] = {0, 0};' + print '' + return + + + def printBody(self, api): + if self.do_swap: + self.emit_swap_wrappers(api) + + + for func in api.functionIterateByOffset(): + if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv): + self.printFunction(func, func.name) + if func.glx_sop and func.glx_vendorpriv: + self.printFunction(func, func.glx_vendorpriv_names[0]) + + + return + + + def printFunction(self, f, name): + if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0): + return + + if not self.do_swap: + base = '__glXDisp' + else: + base = '__glXDispSwap' + + if f.glx_rop: + print 'void %s_%s(GLbyte * pc)' % (base, name) + else: + print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, name) + + print '{' + + if f.glx_rop or f.vectorequiv: + self.printRenderFunction(f) + elif f.glx_sop or f.glx_vendorpriv: + if len(f.get_images()) == 0: + self.printSingleFunction(f, name) + else: + print "/* Missing GLX protocol for %s. */" % (name) + + print '}' + print '' + return + + + def swap_name(self, bytes): + return 'bswap_%u_array' % (8 * bytes) + + + def emit_swap_wrappers(self, api): + self.type_map = {} + already_done = [ ] + + for t in api.typeIterate(): + te = t.get_type_expression() + t_size = te.get_element_size() + + if t_size > 1 and t.glx_name: + + t_name = "GL" + t.name + self.type_map[ t_name ] = t.glx_name + + if t.glx_name not in already_done: + real_name = self.real_types[t_size] + + print 'static %s' % (t_name) + print 'bswap_%s( const void * src )' % (t.glx_name) + print '{' + print ' union { %s dst; %s ret; } x;' % (real_name, t_name) + print ' x.dst = bswap_%u( *(%s *) src );' % (t_size * 8, real_name) + print ' return x.ret;' + print '}' + print '' + already_done.append( t.glx_name ) + + for bits in [16, 32, 64]: + print 'static void *' + print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits) + print '{' + print ' unsigned i;' + print '' + print ' for ( i = 0 ; i < count ; i++ ) {' + print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits) + print ' src[i] = temp;' + print ' }' + print '' + print ' return src;' + print '}' + print '' + + + def fetch_param(self, param): + t = param.type_string() + o = param.offset + element_size = param.size() / param.get_element_count() + + if self.do_swap and (element_size != 1): + if param.is_array(): + real_name = self.real_types[ element_size ] + + swap_func = self.swap_name( element_size ) + return ' (%-8s)%s( (%s *) (pc + %2s), %s )' % (t, swap_func, real_name, o, param.count) + else: + t_name = param.get_base_type_string() + return ' (%-8s)bswap_%-7s( pc + %2s )' % (t, self.type_map[ t_name ], o) + else: + if param.is_array(): + return ' (%-8s)(pc + %2u)' % (t, o) + else: + return '*(%-8s *)(pc + %2u)' % (t, o) + + return None + + + def emit_function_call(self, f, retval_assign, indent): + list = [] + + for param in f.parameterIterator(): + if param.is_padding: + continue + + if param.is_counter or param.is_image() or param.is_output or param.name in f.count_parameter_list or len(param.count_parameter_list): + location = param.name + else: + location = self.fetch_param(param) + + list.append( '%s %s' % (indent, location) ) + + + if len( list ): + print '%s %sCALL_%s( GET_DISPATCH(), (' % (indent, retval_assign, f.name) + print string.join( list, ",\n" ) + print '%s ) );' % (indent) + else: + print '%s %sCALL_%s( GET_DISPATCH(), () );' % (indent, retval_assign, f.name) + return + + + def common_func_print_just_start(self, f, indent): + align64 = 0 + need_blank = 0 + + + f.calculate_offsets() + for param in f.parameterIterateGlxSend(): + # If any parameter has a 64-bit base type, then we + # have to do alignment magic for the while thing. + + if param.is_64_bit(): + align64 = 1 + + + # FIXME img_null_flag is over-loaded. In addition to + # FIXME being used for images, it is used to signify + # FIXME NULL data pointers for vertex buffer object + # FIXME related functions. Re-name it to null_data + # FIXME or something similar. + + if param.img_null_flag: + print '%s const CARD32 ptr_is_null = *(CARD32 *)(pc + %s);' % (indent, param.offset - 4) + cond = '(ptr_is_null != 0) ? NULL : ' + else: + cond = "" + + + type_string = param.type_string() + + if param.is_image(): + offset = f.offset_of( param.name ) + + print '%s %s const %s = (%s) (%s(pc + %s));' % (indent, type_string, param.name, type_string, cond, offset) + + if param.depth: + print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent) + else: + print '%s __GLXpixelHeader * const hdr = (__GLXpixelHeader *)(pc);' % (indent) + + need_blank = 1 + elif param.is_counter or param.name in f.count_parameter_list: + location = self.fetch_param(param) + print '%s const %s %s = %s;' % (indent, type_string, param.name, location) + need_blank = 1 + elif len(param.count_parameter_list): + if param.size() == 1 and not self.do_swap: + location = self.fetch_param(param) + print '%s %s %s = %s%s;' % (indent, type_string, param.name, cond, location) + else: + print '%s %s %s;' % (indent, type_string, param.name) + need_blank = 1 + + + + if need_blank: + print '' + + if align64: + print '#ifdef __GLX_ALIGN64' + + if f.has_variable_size_request(): + self.emit_packet_size_calculation(f, 4) + s = "cmdlen" + else: + s = str((f.command_fixed_length() + 3) & ~3) + + print ' if ((unsigned long)(pc) & 7) {' + print ' (void) memmove(pc-4, pc, %s);' % (s) + print ' pc -= 4;' + print ' }' + print '#endif' + print '' + + + need_blank = 0 + if self.do_swap: + for param in f.parameterIterateGlxSend(): + if param.count_parameter_list: + o = param.offset + count = param.get_element_count() + type_size = param.size() / count + + if param.counter: + count_name = param.counter + else: + count_name = str(count) + + # This is basically an ugly special- + # case for glCallLists. + + if type_size == 1: + x = [] + x.append( [1, ['BYTE', 'UNSIGNED_BYTE', '2_BYTES', '3_BYTES', '4_BYTES']] ) + x.append( [2, ['SHORT', 'UNSIGNED_SHORT']] ) + x.append( [4, ['INT', 'UNSIGNED_INT', 'FLOAT']] ) + + print ' switch(%s) {' % (param.count_parameter_list[0]) + for sub in x: + for t_name in sub[1]: + print ' case GL_%s:' % (t_name) + + if sub[0] == 1: + print ' %s = (%s) (pc + %s); break;' % (param.name, param.type_string(), o) + else: + swap_func = self.swap_name(sub[0]) + print ' %s = (%s) %s( (%s *) (pc + %s), %s ); break;' % (param.name, param.type_string(), swap_func, self.real_types[sub[0]], o, count_name) + print ' default:' + print ' return;' + print ' }' + else: + swap_func = self.swap_name(type_size) + compsize = self.size_call(f, 1) + print ' %s = (%s) %s( (%s *) (pc + %s), %s );' % (param.name, param.type_string(), swap_func, self.real_types[type_size], o, compsize) + + need_blank = 1 + + else: + for param in f.parameterIterateGlxSend(): + if param.count_parameter_list: + print '%s %s = (%s) (pc + %s);' % (indent, param.name, param.type_string(), param.offset) + need_blank = 1 + + + if need_blank: + print '' + + + return + + + def printSingleFunction(self, f, name): + if name not in f.glx_vendorpriv_names: + print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;' + else: + print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;' + + print ' int error;' + + if self.do_swap: + print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' + else: + print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);' + + print '' + if name not in f.glx_vendorpriv_names: + print ' pc += __GLX_SINGLE_HDR_SIZE;' + else: + print ' pc += __GLX_VENDPRIV_HDR_SIZE;' + + print ' if ( cx != NULL ) {' + self.common_func_print_just_start(f, " ") + + + if f.return_type != 'void': + print ' %s retval;' % (f.return_type) + retval_string = "retval" + retval_assign = "retval = " + else: + retval_string = "0" + retval_assign = "" + + + type_size = 0 + answer_string = "dummy_answer" + answer_count = "0" + is_array_string = "GL_FALSE" + + for param in f.parameterIterateOutputs(): + answer_type = param.get_base_type_string() + if answer_type == "GLvoid": + answer_type = "GLubyte" + + + c = param.get_element_count() + type_size = (param.size() / c) + if type_size == 1: + size_scale = "" + else: + size_scale = " * %u" % (type_size) + + + if param.count_parameter_list: + print ' const GLuint compsize = %s;' % (self.size_call(f, 1)) + print ' %s answerBuffer[200];' % (answer_type) + print ' %s %s = __glXGetAnswerBuffer(cl, compsize%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, size_scale, type_size ) + answer_string = param.name + answer_count = "compsize" + + print '' + print ' if (%s == NULL) return BadAlloc;' % (param.name) + print ' __glXClearErrorOccured();' + print '' + elif param.counter: + print ' %s answerBuffer[200];' % (answer_type) + print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, param.counter, size_scale, type_size) + answer_string = param.name + answer_count = param.counter + elif c >= 1: + print ' %s %s[%u];' % (answer_type, param.name, c) + answer_string = param.name + answer_count = "%u" % (c) + + if f.reply_always_array: + is_array_string = "GL_TRUE" + + + self.emit_function_call(f, retval_assign, " ") + + + if f.needs_reply(): + if self.do_swap: + for param in f.parameterIterateOutputs(): + c = param.get_element_count() + type_size = (param.size() / c) + + if type_size > 1: + swap_name = self.swap_name( type_size ) + print ' (void) %s( (uint%u_t *) %s, %s );' % (swap_name, 8 * type_size, param.name, answer_count) + + + reply_func = '__glXSendReplySwap' + else: + reply_func = '__glXSendReply' + + print ' %s(cl->client, %s, %s, %u, %s, %s);' % (reply_func, answer_string, answer_count, type_size, is_array_string, retval_string) + #elif f.note_unflushed: + # print ' cx->hasUnflushedCommands = GL_TRUE;' + + print ' error = Success;' + print ' }' + print '' + print ' return error;' + return + + + def printRenderFunction(self, f): + # There are 4 distinct phases in a rendering dispatch function. + # In the first phase we compute the sizes and offsets of each + # element in the command. In the second phase we (optionally) + # re-align 64-bit data elements. In the third phase we + # (optionally) byte-swap array data. Finally, in the fourth + # phase we actually dispatch the function. + + self.common_func_print_just_start(f, "") + + images = f.get_images() + if len(images): + if self.do_swap: + pre = "bswap_CARD32( & " + post = " )" + else: + pre = "" + post = "" + + img = images[0] + + # swapBytes and lsbFirst are single byte fields, so + # the must NEVER be byte-swapped. + + if not (img.img_type == "GL_BITMAP" and img.img_format == "GL_COLOR_INDEX"): + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, hdr->swapBytes) );' + + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );' + + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, (GLint) %shdr->rowLength%s) );' % (pre, post) + if img.depth: + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_IMAGE_HEIGHT, (GLint) %shdr->imageHeight%s) );' % (pre, post) + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, (GLint) %shdr->skipRows%s) );' % (pre, post) + if img.depth: + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_IMAGES, (GLint) %shdr->skipImages%s) );' % (pre, post) + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, (GLint) %shdr->skipPixels%s) );' % (pre, post) + print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, (GLint) %shdr->alignment%s) );' % (pre, post) + print '' + + + self.emit_function_call(f, "", "") + return + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s") + except Exception,e: + show_usage() + + mode = "dispatch_c" + do_swap = 0 + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "-s": + do_swap = 1 + + if mode == "dispatch_c": + printer = PrintGlxDispatchFunctions(do_swap) + elif mode == "dispatch_h": + printer = PrintGlxDispatch_h() + else: + show_usage() + + api = gl_XML.parse_GL_API( file_name, glX_proto_common.glx_proto_item_factory() ) + + printer.Print( api ) diff --git a/src/mesa/glapi/gen/glX_proto_send.py b/src/mesa/glapi/gen/glX_proto_send.py new file mode 100644 index 0000000000..daca1b767a --- /dev/null +++ b/src/mesa/glapi/gen/glX_proto_send.py @@ -0,0 +1,1042 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick +# Jeremy Kolb + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt, copy, string + +def convertStringForXCB(str): + tmp = "" + special = [ "ARB" ] + i = 0 + while i < len(str): + if str[i:i+3] in special: + tmp = '%s_%s' % (tmp, string.lower(str[i:i+3])) + i = i + 2; + elif str[i].isupper(): + tmp = '%s_%s' % (tmp, string.lower(str[i])) + else: + tmp = '%s%s' % (tmp, str[i]) + i += 1 + return tmp + +def hash_pixel_function(func): + """Generate a 'unique' key for a pixel function. The key is based on + the parameters written in the command packet. This includes any + padding that might be added for the original function and the 'NULL + image' flag.""" + + + h = "" + hash_pre = "" + hash_suf = "" + for param in func.parameterIterateGlxSend(): + if param.is_image(): + [dim, junk, junk, junk, junk] = param.get_dimensions() + + d = (dim + 1) & ~1 + hash_pre = "%uD%uD_" % (d - 1, d) + + if param.img_null_flag: + hash_suf = "_NF" + + h += "%u" % (param.size()) + + if func.pad_after(param): + h += "4" + + + n = func.name.replace("%uD" % (dim), "") + n = "__glx_%s_%uD%uD" % (n, d - 1, d) + + h = hash_pre + h + hash_suf + return [h, n] + + +class glx_pixel_function_stub(glX_XML.glx_function): + """Dummy class used to generate pixel "utility" functions that are + shared by multiple dimension image functions. For example, these + objects are used to generate shared functions used to send GLX + protocol for TexImage1D and TexImage2D, TexSubImage1D and + TexSubImage2D, etc.""" + + def __init__(self, func, name): + # The parameters to the utility function are the same as the + # parameters to the real function except for the added "pad" + # parameters. + + self.name = name + self.images = [] + self.parameters = [] + self.parameters_by_name = {} + for _p in func.parameterIterator(): + p = copy.copy(_p) + self.parameters.append(p) + self.parameters_by_name[ p.name ] = p + + + if p.is_image(): + self.images.append(p) + p.height = "height" + + if p.img_yoff == None: + p.img_yoff = "yoffset" + + if p.depth: + if p.extent == None: + p.extent = "extent" + + if p.img_woff == None: + p.img_woff = "woffset" + + + pad_name = func.pad_after(p) + if pad_name: + pad = copy.copy(p) + pad.name = pad_name + self.parameters.append(pad) + self.parameters_by_name[ pad.name ] = pad + + + self.return_type = func.return_type + + self.glx_rop = ~0 + self.glx_sop = 0 + self.glx_vendorpriv = 0 + + self.glx_doubles_in_order = func.glx_doubles_in_order + + self.vectorequiv = None + self.output = None + self.can_be_large = func.can_be_large + self.reply_always_array = func.reply_always_array + self.dimensions_in_reply = func.dimensions_in_reply + self.img_reset = None + + self.server_handcode = 0 + self.client_handcode = 0 + self.ignore = 0 + + self.count_parameter_list = func.count_parameter_list + self.counter_list = func.counter_list + self.offsets_calculated = 0 + return + + +class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): + def __init__(self): + glX_proto_common.glx_print_proto.__init__(self) + self.name = "glX_proto_send.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004, 2005", "IBM") + + + self.last_category = "" + self.generic_sizes = [3, 4, 6, 8, 12, 16, 24, 32] + self.pixel_stubs = {} + self.debug = 0 + return + + def printRealHeader(self): + print '' + print '#include ' + print '#include "indirect.h"' + print '#include "glxclient.h"' + print '#include "indirect_size.h"' + print '#include "dispatch.h"' + print '#include "glapi.h"' + print '#include "glthread.h"' + print '#include ' + print '#ifdef USE_XCB' + print '#include ' + print '#include ' + print '#include ' + print '#endif /* USE_XCB */' + + print '' + print '#define __GLX_PAD(n) (((n) + 3) & ~3)' + print '' + self.printFastcall() + self.printNoinline() + print '' + print '#if !defined __GNUC__ || __GNUC__ < 3' + print '# define __builtin_expect(x, y) x' + print '#endif' + print '' + print '/* If the size and opcode values are known at compile-time, this will, on' + print ' * x86 at least, emit them with a single instruction.' + print ' */' + print '#define emit_header(dest, op, size) \\' + print ' do { union { short s[2]; int i; } temp; \\' + print ' temp.s[0] = (size); temp.s[1] = (op); \\' + print ' *((int *)(dest)) = temp.i; } while(0)' + print '' + print """NOINLINE CARD32 +__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ) +{ + xGLXSingleReply reply; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + if (size != 0) { + if ((reply.length > 0) || reply_is_always_array) { + const GLint bytes = (reply_is_always_array) + ? (4 * reply.length) : (reply.size * size); + const GLint extra = 4 - (bytes & 3); + + _XRead(dpy, dest, bytes); + if ( extra < 4 ) { + _XEatData(dpy, extra); + } + } + else { + (void) memcpy( dest, &(reply.pad3), size); + } + } + + return reply.retval; +} + +NOINLINE void +__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, + GLint width, GLint height, GLint depth, GLenum format, GLenum type, + void * dest, GLboolean dimensions_in_reply ) +{ + xGLXSingleReply reply; + GLint size; + + (void) _XReply(dpy, (xReply *) & reply, 0, False); + + if ( dimensions_in_reply ) { + width = reply.pad3; + height = reply.pad4; + depth = reply.pad5; + + if ((height == 0) || (max_dim < 2)) { height = 1; } + if ((depth == 0) || (max_dim < 3)) { depth = 1; } + } + + size = reply.length * 4; + if (size != 0) { + void * buf = Xmalloc( size ); + + if ( buf == NULL ) { + _XEatData(dpy, size); + __glXSetError(gc, GL_OUT_OF_MEMORY); + } + else { + const GLint extra = 4 - (size & 3); + + _XRead(dpy, buf, size); + if ( extra < 4 ) { + _XEatData(dpy, extra); + } + + __glEmptyImage(gc, 3, width, height, depth, format, type, + buf, dest); + Xfree(buf); + } + } +} + +#define X_GLXSingle 0 + +NOINLINE FASTCALL GLubyte * +__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) +{ + xGLXSingleReq * req; + Display * const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXSingle, cmdlen, req); + req->reqType = gc->majorOpcode; + req->contextTag = gc->currentContextTag; + req->glxCode = sop; + return (GLubyte *)(req) + sz_xGLXSingleReq; +} + +NOINLINE FASTCALL GLubyte * +__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) +{ + xGLXVendorPrivateReq * req; + Display * const dpy = gc->currentDpy; + + (void) __glXFlushRenderBuffer(gc, gc->pc); + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, cmdlen, req); + req->reqType = gc->majorOpcode; + req->glxCode = code; + req->vendorCode = vop; + req->contextTag = gc->currentContextTag; + return (GLubyte *)(req) + sz_xGLXVendorPrivateReq; +} + +const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + +#define zero (__glXDefaultPixelStore+0) +#define one (__glXDefaultPixelStore+8) +#define default_pixel_store_1D (__glXDefaultPixelStore+4) +#define default_pixel_store_1D_size 20 +#define default_pixel_store_2D (__glXDefaultPixelStore+4) +#define default_pixel_store_2D_size 20 +#define default_pixel_store_3D (__glXDefaultPixelStore+0) +#define default_pixel_store_3D_size 36 +#define default_pixel_store_4D (__glXDefaultPixelStore+0) +#define default_pixel_store_4D_size 36 +""" + + for size in self.generic_sizes: + self.print_generic_function(size) + return + + + def printBody(self, api): + + self.pixel_stubs = {} + generated_stubs = [] + + for func in api.functionIterateGlx(): + if func.client_handcode: continue + + # If the function is a pixel function with a certain + # GLX protocol signature, create a fake stub function + # for it. For example, create a single stub function + # that is used to implement both glTexImage1D and + # glTexImage2D. + + if func.glx_rop != 0: + do_it = 0 + for image in func.get_images(): + if image.img_pad_dimensions: + do_it = 1 + break + + + if do_it: + [h, n] = hash_pixel_function(func) + + + self.pixel_stubs[ func.name ] = n + if h not in generated_stubs: + generated_stubs.append(h) + + fake_func = glx_pixel_function_stub( func, n ) + self.printFunction(fake_func, fake_func.name) + + + self.printFunction(func, func.name) + if func.glx_sop and func.glx_vendorpriv: + self.printFunction(func, func.glx_vendorpriv_names[0]) + + return + + + def printFunction(self, func, name): + footer = '}\n' + if func.glx_rop == ~0: + print 'static %s' % (func.return_type) + print '%s( unsigned opcode, unsigned dim, %s )' % (func.name, func.get_parameter_string()) + print '{' + else: + if func.has_different_protocol(name): + if func.return_type == "void": + ret_string = '' + else: + ret_string = "return " + + func_name = func.static_glx_name(name) + print '#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv) + print '%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()) + print '{' + print ' __GLXcontext * const gc = __glXGetCurrentContext();' + print '' + print '#ifdef GLX_DIRECT_RENDERING' + print ' if (gc->driContext) {' + print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) + print ' } else' + print '#endif' + print ' {' + + footer = '}\n}\n' + else: + print '#define %s %d' % (func.opcode_name(), func.opcode_value()) + + print '%s __indirect_gl%s(%s)' % (func.return_type, name, func.get_parameter_string()) + print '{' + + + if func.glx_rop != 0 or func.vectorequiv != None: + if len(func.images): + self.printPixelFunction(func) + else: + self.printRenderFunction(func) + elif func.glx_sop != 0 or func.glx_vendorpriv != 0: + self.printSingleFunction(func, name) + pass + else: + print "/* Missing GLX protocol for %s. */" % (name) + + print footer + return + + + def print_generic_function(self, n): + size = (n + 3) & ~3 + print """static FASTCALL NOINLINE void +generic_%u_byte( GLint rop, const void * ptr ) +{ + __GLXcontext * const gc = __glXGetCurrentContext(); + const GLuint cmdlen = %u; + + emit_header(gc->pc, rop, cmdlen); + (void) memcpy((void *)(gc->pc + 4), ptr, %u); + gc->pc += cmdlen; + if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } +} +""" % (n, size + 4, size) + return + + + def common_emit_one_arg(self, p, pc, adjust, extra_offset): + if p.is_array(): + src_ptr = p.name + else: + src_ptr = "&" + p.name + + if p.is_padding: + print '(void) memset((void *)(%s + %u), 0, %s);' \ + % (pc, p.offset + adjust, p.size_string() ) + elif not extra_offset: + print '(void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \ + % (pc, p.offset + adjust, src_ptr, p.size_string() ) + else: + print '(void) memcpy((void *)(%s + %u + %s), (void *)(%s), %s);' \ + % (pc, p.offset + adjust, extra_offset, src_ptr, p.size_string() ) + + def common_emit_args(self, f, pc, adjust, skip_vla): + extra_offset = None + + for p in f.parameterIterateGlxSend( not skip_vla ): + if p.name != f.img_reset: + self.common_emit_one_arg(p, pc, adjust, extra_offset) + + if p.is_variable_length(): + temp = p.size_string() + if extra_offset: + extra_offset += " + %s" % (temp) + else: + extra_offset = temp + + return + + + def pixel_emit_args(self, f, pc, large): + """Emit the arguments for a pixel function. This differs from + common_emit_args in that pixel functions may require padding + be inserted (i.e., for the missing width field for + TexImage1D), and they may also require a 'NULL image' flag + be inserted before the image data.""" + + if large: + adjust = 8 + else: + adjust = 4 + + for param in f.parameterIterateGlxSend(): + if not param.is_image(): + self.common_emit_one_arg(param, pc, adjust, None) + + if f.pad_after(param): + print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset + param.size()) + adjust) + + else: + [dim, width, height, depth, extent] = param.get_dimensions() + if f.glx_rop == ~0: + dim_str = "dim" + else: + dim_str = str(dim) + + if param.is_padding: + print '(void) memset((void *)(%s + %u), 0, %s);' \ + % (pc, (param.offset - 4) + adjust, param.size_string() ) + + if param.img_null_flag: + if large: + print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset - 4) + adjust) + else: + print '(void) memcpy((void *)(%s + %u), (void *)((%s == NULL) ? one : zero), 4);' % (pc, (param.offset - 4) + adjust, param.name) + + + pixHeaderPtr = "%s + %u" % (pc, adjust) + pcPtr = "%s + %u" % (pc, param.offset + adjust) + + if not large: + if param.img_send_null: + condition = '(compsize > 0) && (%s != NULL)' % (param.name) + else: + condition = 'compsize > 0' + + print 'if (%s) {' % (condition) + print ' (*gc->fillImage)(gc, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) + print '} else {' + print ' (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (pixHeaderPtr, dim, dim) + print '}' + else: + print '__glXSendLargeImage(gc, compsize, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) + + return + + + def large_emit_begin(self, f, op_name = None): + if not op_name: + op_name = f.opcode_real_name() + + print 'const GLint op = %s;' % (op_name) + print 'const GLuint cmdlenLarge = cmdlen + 4;' + print 'GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);' + print '(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);' + print '(void) memcpy((void *)(pc + 4), (void *)(&op), 4);' + return + + + def common_func_print_just_start(self, f, name): + print ' __GLXcontext * const gc = __glXGetCurrentContext();' + + # The only reason that single and vendor private commands need + # a variable called 'dpy' is becuase they use the SyncHandle + # macro. For whatever brain-dead reason, that macro is hard- + # coded to use a variable called 'dpy' instead of taking a + # parameter. + + # FIXME Simplify the logic related to skip_condition and + # FIXME condition_list in this function. Basically, remove + # FIXME skip_condition, and just append the "dpy != NULL" type + # FIXME condition to condition_list from the start. The only + # FIXME reason it's done in this confusing way now is to + # FIXME minimize the diffs in the generated code. + + if not f.glx_rop: + for p in f.parameterIterateOutputs(): + if p.is_image() and (p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP"): + print ' const __GLXattribute * const state = gc->client_state_private;' + break + + print ' Display * const dpy = gc->currentDpy;' + skip_condition = "dpy != NULL" + elif f.can_be_large: + skip_condition = "gc->currentDpy != NULL" + else: + skip_condition = None + + + if f.return_type != 'void': + print ' %s retval = (%s) 0;' % (f.return_type, f.return_type) + + + if name != None and name not in f.glx_vendorpriv_names: + print '#ifndef USE_XCB' + self.emit_packet_size_calculation(f, 0) + if name != None and name not in f.glx_vendorpriv_names: + print '#endif' + + condition_list = [] + for p in f.parameterIterateCounters(): + condition_list.append( "%s >= 0" % (p.name) ) + # 'counter' parameters cannot be negative + print " if (%s < 0) {" % p.name + print " __glXSetError(gc, GL_INVALID_VALUE);" + if f.return_type != 'void': + print " return 0;" + else: + print " return;" + print " }" + + if skip_condition: + condition_list.append( skip_condition ) + + if len( condition_list ) > 0: + if len( condition_list ) > 1: + skip_condition = "(%s)" % (string.join( condition_list, ") && (" )) + else: + skip_condition = "%s" % (condition_list.pop(0)) + + print ' if (__builtin_expect(%s, 1)) {' % (skip_condition) + return 1 + else: + return 0 + + + def printSingleFunction(self, f, name): + self.common_func_print_just_start(f, name) + + if self.debug: + print ' printf( "Enter %%s...\\n", "gl%s" );' % (f.name) + + if name not in f.glx_vendorpriv_names: + + # XCB specific: + print '#ifdef USE_XCB' + if self.debug: + print ' printf("\\tUsing XCB.\\n");' + print ' xcb_connection_t *c = XGetXCBConnection(dpy);' + print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' + xcb_name = 'xcb_glx%s' % convertStringForXCB(name) + + iparams=[] + extra_iparams = [] + output = None + for p in f.parameterIterator(): + if p.is_output: + output = p + + if p.is_image(): + if p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP": + extra_iparams.append("state->storePack.swapEndian") + else: + extra_iparams.append("0") + + # Hardcode this in. lsb_first param (apparently always GL_FALSE) + # also present in GetPolygonStipple, but taken care of above. + if xcb_name == "xcb_glx_read_pixels": + extra_iparams.append("0") + else: + iparams.append(p.name) + + + xcb_request = '%s(%s)' % (xcb_name, ", ".join(["c", "gc->currentContextTag"] + iparams + extra_iparams)) + + if f.needs_reply(): + print ' %s_reply_t *reply = %s_reply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request) + if output and f.reply_always_array: + print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) + + elif output and not f.reply_always_array: + if not output.is_image(): + print ' if (%s_data_length(reply) == 0)' % (xcb_name) + print ' (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (output.name) + print ' else' + print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) + + + if f.return_type != 'void': + print ' retval = reply->ret_val;' + print ' free(reply);' + else: + print ' ' + xcb_request + ';' + print '#else' + # End of XCB specific. + + + if f.parameters != []: + pc_decl = "GLubyte const * pc =" + else: + pc_decl = "(void)" + + if name in f.glx_vendorpriv_names: + print ' %s __glXSetupVendorRequest(gc, %s, %s, cmdlen);' % (pc_decl, f.opcode_real_name(), f.opcode_vendor_name(name)) + else: + print ' %s __glXSetupSingleRequest(gc, %s, cmdlen);' % (pc_decl, f.opcode_name()) + + self.common_emit_args(f, "pc", 0, 0) + + images = f.get_images() + + for img in images: + if img.is_output: + o = f.command_fixed_length() - 4 + print ' *(int32_t *)(pc + %u) = 0;' % (o) + if img.img_format != "GL_COLOR_INDEX" or img.img_type != "GL_BITMAP": + print ' * (int8_t *)(pc + %u) = state->storePack.swapEndian;' % (o) + + if f.img_reset: + print ' * (int8_t *)(pc + %u) = %s;' % (o + 1, f.img_reset) + + + return_name = '' + if f.needs_reply(): + if f.return_type != 'void': + return_name = " retval" + return_str = " retval = (%s)" % (f.return_type) + else: + return_str = " (void)" + + got_reply = 0 + + for p in f.parameterIterateOutputs(): + if p.is_image(): + [dim, w, h, d, junk] = p.get_dimensions() + if f.dimensions_in_reply: + print " __glXReadPixelReply(dpy, gc, %u, 0, 0, 0, %s, %s, %s, GL_TRUE);" % (dim, p.img_format, p.img_type, p.name) + else: + print " __glXReadPixelReply(dpy, gc, %u, %s, %s, %s, %s, %s, %s, GL_FALSE);" % (dim, w, h, d, p.img_format, p.img_type, p.name) + + got_reply = 1 + else: + if f.reply_always_array: + aa = "GL_TRUE" + else: + aa = "GL_FALSE" + + # gl_parameter.size() returns the size + # of the entire data item. If the + # item is a fixed-size array, this is + # the size of the whole array. This + # is not what __glXReadReply wants. It + # wants the size of a single data + # element in the reply packet. + # Dividing by the array size (1 for + # non-arrays) gives us this. + + s = p.size() / p.get_element_count() + print " %s __glXReadReply(dpy, %s, %s, %s);" % (return_str, s, p.name, aa) + got_reply = 1 + + + # If a reply wasn't read to fill an output parameter, + # read a NULL reply to get the return value. + + if not got_reply: + print " %s __glXReadReply(dpy, 0, NULL, GL_FALSE);" % (return_str) + + + elif self.debug: + # Only emit the extra glFinish call for functions + # that don't already require a reply from the server. + print ' __indirect_glFinish();' + + if self.debug: + print ' printf( "Exit %%s.\\n", "gl%s" );' % (name) + + + print ' UnlockDisplay(dpy); SyncHandle();' + + if name not in f.glx_vendorpriv_names: + print '#endif /* USE_XCB */' + + print ' }' + print ' return%s;' % (return_name) + return + + + def printPixelFunction(self, f): + if self.pixel_stubs.has_key( f.name ): + # Normally gl_function::get_parameter_string could be + # used. However, this call needs to have the missing + # dimensions (e.g., a fake height value for + # glTexImage1D) added in. + + p_string = "" + for param in f.parameterIterateGlxSend(): + if param.is_padding: + continue + + p_string += ", " + param.name + + if param.is_image(): + [dim, junk, junk, junk, junk] = param.get_dimensions() + + if f.pad_after(param): + p_string += ", 1" + + print ' %s(%s, %u%s );' % (self.pixel_stubs[f.name] , f.opcode_name(), dim, p_string) + return + + + if self.common_func_print_just_start(f, None): + trailer = " }" + else: + trailer = None + + + if f.can_be_large: + print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' + print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' + print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' + print ' }' + + if f.glx_rop == ~0: + opcode = "opcode" + else: + opcode = f.opcode_real_name() + + print 'emit_header(gc->pc, %s, cmdlen);' % (opcode) + + self.pixel_emit_args( f, "gc->pc", 0 ) + print 'gc->pc += cmdlen;' + print 'if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' + + if f.can_be_large: + print '}' + print 'else {' + + self.large_emit_begin(f, opcode) + self.pixel_emit_args(f, "pc", 1) + + print '}' + + if trailer: print trailer + return + + + def printRenderFunction(self, f): + # There is a class of GL functions that take a single pointer + # as a parameter. This pointer points to a fixed-size chunk + # of data, and the protocol for this functions is very + # regular. Since they are so regular and there are so many + # of them, special case them with generic functions. On + # x86, this saves about 26KB in the libGL.so binary. + + if f.variable_length_parameter() == None and len(f.parameters) == 1: + p = f.parameters[0] + if p.is_pointer(): + cmdlen = f.command_fixed_length() + if cmdlen in self.generic_sizes: + print ' generic_%u_byte( %s, %s );' % (cmdlen, f.opcode_real_name(), p.name) + return + + if self.common_func_print_just_start(f, None): + trailer = " }" + else: + trailer = None + + if self.debug: + print 'printf( "Enter %%s...\\n", "gl%s" );' % (f.name) + + if f.can_be_large: + print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' + print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' + print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' + print ' }' + + print 'emit_header(gc->pc, %s, cmdlen);' % (f.opcode_real_name()) + + self.common_emit_args(f, "gc->pc", 4, 0) + print 'gc->pc += cmdlen;' + print 'if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' + + if f.can_be_large: + print '}' + print 'else {' + + self.large_emit_begin(f) + self.common_emit_args(f, "pc", 8, 1) + + p = f.variable_length_parameter() + print ' __glXSendLargeCommand(gc, pc, %u, %s, %s);' % (p.offset + 8, p.name, p.size_string()) + print '}' + + if self.debug: + print '__indirect_glFinish();' + print 'printf( "Exit %%s.\\n", "gl%s" );' % (f.name) + + if trailer: print trailer + return + + +class PrintGlxProtoInit_c(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_send.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") + return + + + def printRealHeader(self): + print """/** + * \\file indirect_init.c + * Initialize indirect rendering dispatch table. + * + * \\author Kevin E. Martin + * \\author Brian Paul + * \\author Ian Romanick + */ + +#include "indirect_init.h" +#include "indirect.h" +#include "glapi.h" + + +/** + * No-op function used to initialize functions that have no GLX protocol + * support. + */ +static int NoOp(void) +{ + return 0; +} + +/** + * Create and initialize a new GL dispatch table. The table is initialized + * with GLX indirect rendering protocol functions. + */ +__GLapi * __glXNewIndirectAPI( void ) +{ + __GLapi *glAPI; + GLuint entries; + + entries = _glapi_get_dispatch_table_size(); + glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); + + /* first, set all entries to point to no-op functions */ + { + int i; + void **dispatch = (void **) glAPI; + for (i = 0; i < entries; i++) { + dispatch[i] = (void *) NoOp; + } + } + + /* now, initialize the entries we understand */""" + + def printRealFooter(self): + print """ + return glAPI; +} +""" + return + + + def printBody(self, api): + for [name, number] in api.categoryIterate(): + if number != None: + preamble = '\n /* %3u. %s */\n\n' % (int(number), name) + else: + preamble = '\n /* %s */\n\n' % (name) + + for func in api.functionIterateByCategory(name): + if func.client_supported_for_indirect(): + print '%s glAPI->%s = __indirect_gl%s;' % (preamble, func.name, func.name) + preamble = '' + + return + + +class PrintGlxProtoInit_h(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_send.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") + self.header_tag = "_INDIRECT_H_" + + self.last_category = "" + return + + + def printRealHeader(self): + print """/** + * \\file + * Prototypes for indirect rendering functions. + * + * \\author Kevin E. Martin + * \\author Ian Romanick + */ +""" + self.printVisibility( "HIDDEN", "hidden" ) + self.printFastcall() + self.printNoinline() + + print """ +#include "glxclient.h" + +extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, + void * dest, GLboolean reply_is_always_array ); + +extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, + __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, + GLint depth, GLenum format, GLenum type, void * dest, + GLboolean dimensions_in_reply ); + +extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( + __GLXcontext * gc, GLint sop, GLint cmdlen ); + +extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( + __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); +""" + + + def printBody(self, api): + for func in api.functionIterateGlx(): + params = func.get_parameter_string() + + print 'extern HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, params) + + for n in func.entry_points: + if func.has_different_protocol(n): + asdf = func.static_glx_name(n) + if asdf not in func.static_entry_points: + print 'extern HIDDEN %s gl%s(%s);' % (func.return_type, asdf, params) + else: + print 'GLAPI %s GLAPIENTRY gl%s(%s);' % (func.return_type, asdf, params) + + break + + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode] [-d]" % sys.argv[0] + print " -m output_mode Output mode can be one of 'proto', 'init_c' or 'init_h'." + print " -d Enable extra debug information in the generated code." + sys.exit(1) + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:d") + except Exception,e: + show_usage() + + debug = 0 + mode = "proto" + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "-d": + debug = 1 + + if mode == "proto": + printer = PrintGlxProtoStubs() + elif mode == "init_c": + printer = PrintGlxProtoInit_c() + elif mode == "init_h": + printer = PrintGlxProtoInit_h() + else: + show_usage() + + + printer.debug = debug + api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) + + printer.Print( api ) diff --git a/src/mesa/glapi/gen/glX_proto_size.py b/src/mesa/glapi/gen/glX_proto_size.py new file mode 100644 index 0000000000..95cb5110cc --- /dev/null +++ b/src/mesa/glapi/gen/glX_proto_size.py @@ -0,0 +1,704 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML +import license +import sys, getopt, copy, string + + +class glx_enum_function: + def __init__(self, func_name, enum_dict): + self.name = func_name + self.mode = 1 + self.sig = None + + # "enums" is a set of lists. The element in the set is the + # value of the enum. The list is the list of names for that + # value. For example, [0x8126] = {"POINT_SIZE_MIN", + # "POINT_SIZE_MIN_ARB", "POINT_SIZE_MIN_EXT", + # "POINT_SIZE_MIN_SGIS"}. + + self.enums = {} + + # "count" is indexed by count values. Each element of count + # is a list of index to "enums" that have that number of + # associated data elements. For example, [4] = + # {GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, + # GL_AMBIENT_AND_DIFFUSE} (the enum names are used here, + # but the actual hexadecimal values would be in the array). + + self.count = {} + + + # Fill self.count and self.enums using the dictionary of enums + # that was passed in. The generic Get functions (e.g., + # GetBooleanv and friends) are handled specially here. In + # the data the generic Get functions are refered to as "Get". + + if func_name in ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev"]: + match_name = "Get" + else: + match_name = func_name + + mode_set = 0 + for enum_name in enum_dict: + e = enum_dict[ enum_name ] + + if e.functions.has_key( match_name ): + [count, mode] = e.functions[ match_name ] + + if mode_set and mode != self.mode: + raise RuntimeError("Not all enums for %s have the same mode." % (func_name)) + + self.mode = mode + + if self.enums.has_key( e.value ): + if e.name not in self.enums[ e.value ]: + self.enums[ e.value ].append( e ) + else: + if not self.count.has_key( count ): + self.count[ count ] = [] + + self.enums[ e.value ] = [ e ] + self.count[ count ].append( e.value ) + + + return + + + def signature( self ): + if self.sig == None: + self.sig = "" + for i in self.count: + if i == None: + raise RuntimeError("i is None. WTF?") + + self.count[i].sort() + for e in self.count[i]: + self.sig += "%04x,%d," % (e, i) + + return self.sig + + + def is_set( self ): + return self.mode + + + def PrintUsingTable(self): + """Emit the body of the __gl*_size function using a pair + of look-up tables and a mask. The mask is calculated such + that (e & mask) is unique for all the valid values of e for + this function. The result of (e & mask) is used as an index + into the first look-up table. If it matches e, then the + same entry of the second table is returned. Otherwise zero + is returned. + + It seems like this should cause better code to be generated. + However, on x86 at least, the resulting .o file is about 20% + larger then the switch-statment version. I am leaving this + code in because the results may be different on other + platforms (e.g., PowerPC or x86-64).""" + + return 0 + count = 0 + for a in self.enums: + count += 1 + + if self.count.has_key(-1): + return 0 + + # Determine if there is some mask M, such that M = (2^N) - 1, + # that will generate unique values for all of the enums. + + mask = 0 + for i in [1, 2, 3, 4, 5, 6, 7, 8]: + mask = (1 << i) - 1 + + fail = 0; + for a in self.enums: + for b in self.enums: + if a != b: + if (a & mask) == (b & mask): + fail = 1; + + if not fail: + break; + else: + mask = 0 + + if (mask != 0) and (mask < (2 * count)): + masked_enums = {} + masked_count = {} + + for i in range(0, mask + 1): + masked_enums[i] = "0"; + masked_count[i] = 0; + + for c in self.count: + for e in self.count[c]: + i = e & mask + enum_obj = self.enums[e][0] + masked_enums[i] = '0x%04x /* %s */' % (e, enum_obj.name ) + masked_count[i] = c + + + print ' static const GLushort a[%u] = {' % (mask + 1) + for e in masked_enums: + print ' %s, ' % (masked_enums[e]) + print ' };' + + print ' static const GLubyte b[%u] = {' % (mask + 1) + for c in masked_count: + print ' %u, ' % (masked_count[c]) + print ' };' + + print ' const unsigned idx = (e & 0x%02xU);' % (mask) + print '' + print ' return (e == a[idx]) ? (GLint) b[idx] : 0;' + return 1; + else: + return 0; + + + def PrintUsingSwitch(self, name): + """Emit the body of the __gl*_size function using a + switch-statement.""" + + print ' switch( e ) {' + + for c in self.count: + for e in self.count[c]: + first = 1 + + # There may be multiple enums with the same + # value. This happens has extensions are + # promoted from vendor-specific or EXT to + # ARB and to the core. Emit the first one as + # a case label, and emit the others as + # commented-out case labels. + + list = {} + for enum_obj in self.enums[e]: + list[ enum_obj.priority() ] = enum_obj.name + + keys = list.keys() + keys.sort() + for k in keys: + j = list[k] + if first: + print ' case GL_%s:' % (j) + first = 0 + else: + print '/* case GL_%s:*/' % (j) + + if c == -1: + print ' return __gl%s_variable_size( e );' % (name) + else: + print ' return %u;' % (c) + + print ' default: return 0;' + print ' }' + + + def Print(self, name): + print 'INTERNAL PURE FASTCALL GLint' + print '__gl%s_size( GLenum e )' % (name) + print '{' + + if not self.PrintUsingTable(): + self.PrintUsingSwitch(name) + + print '}' + print '' + + +class glx_server_enum_function(glx_enum_function): + def __init__(self, func, enum_dict): + glx_enum_function.__init__(self, func.name, enum_dict) + + self.function = func + return + + + def signature( self ): + if self.sig == None: + sig = glx_enum_function.signature(self) + + p = self.function.variable_length_parameter() + if p: + sig += "%u" % (p.size()) + + self.sig = sig + + return self.sig; + + + def Print(self, name, printer): + f = self.function + printer.common_func_print_just_header( f ) + + fixup = [] + + foo = {} + for param_name in f.count_parameter_list: + o = f.offset_of( param_name ) + foo[o] = param_name + + for param_name in f.counter_list: + o = f.offset_of( param_name ) + foo[o] = param_name + + keys = foo.keys() + keys.sort() + for o in keys: + p = f.parameters_by_name[ foo[o] ] + + printer.common_emit_one_arg(p, "pc", 0) + fixup.append( p.name ) + + + print ' GLsizei compsize;' + print '' + + printer.common_emit_fixups(fixup) + + print '' + print ' compsize = __gl%s_size(%s);' % (f.name, string.join(f.count_parameter_list, ",")) + p = f.variable_length_parameter() + print ' return __GLX_PAD(%s);' % (p.size_string()) + + print '}' + print '' + + +class PrintGlxSizeStubs_common(gl_XML.gl_print_base): + do_get = (1 << 0) + do_set = (1 << 1) + + def __init__(self, which_functions): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_size.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM") + + self.emit_set = ((which_functions & PrintGlxSizeStubs_common.do_set) != 0) + self.emit_get = ((which_functions & PrintGlxSizeStubs_common.do_get) != 0) + return + + +class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): + def printRealHeader(self): + print '' + print '#include ' + if self.emit_get: + print '#include "indirect_size_get.h"' + print '#include "glxserver.h"' + print '#include "indirect_util.h"' + + print '#include "indirect_size.h"' + + print '' + self.printPure() + print '' + self.printFastcall() + print '' + self.printVisibility( "INTERNAL", "internal" ) + print '' + print '' + print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)' + print '# undef HAVE_ALIAS' + print '#endif' + print '#ifdef HAVE_ALIAS' + print '# define ALIAS2(from,to) \\' + print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' + print ' __attribute__ ((alias( # to )));' + print '# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )' + print '#else' + print '# define ALIAS(from,to) \\' + print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' + print ' { return __gl ## to ## _size( e ); }' + print '#endif' + print '' + print '' + + + def printBody(self, api): + enum_sigs = {} + aliases = [] + + for func in api.functionIterateGlx(): + ef = glx_enum_function( func.name, api.enums_by_name ) + if len(ef.enums) == 0: + continue + + if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): + sig = ef.signature() + if enum_sigs.has_key( sig ): + aliases.append( [func.name, enum_sigs[ sig ]] ) + else: + enum_sigs[ sig ] = func.name + ef.Print( func.name ) + + + for [alias_name, real_name] in aliases: + print 'ALIAS( %s, %s )' % (alias_name, real_name) + + + +class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): + def printRealHeader(self): + print """/** + * \\file + * Prototypes for functions used to determine the number of data elements in + * various GLX protocol messages. + * + * \\author Ian Romanick + */ +""" + self.printPure(); + print '' + self.printFastcall(); + print '' + self.printVisibility( "INTERNAL", "internal" ); + print '' + + + def printBody(self, api): + for func in api.functionIterateGlx(): + ef = glx_enum_function( func.name, api.enums_by_name ) + if len(ef.enums) == 0: + continue + + if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): + print 'extern INTERNAL PURE FASTCALL GLint __gl%s_size(GLenum);' % (func.name) + + +class PrintGlxReqSize_common(gl_XML.gl_print_base): + """Common base class for PrintGlxSizeReq_h and PrintGlxSizeReq_h. + + The main purpose of this common base class is to provide the infrastructure + for the derrived classes to iterate over the same set of functions. + """ + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "glX_proto_size.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") + + +class PrintGlxReqSize_h(PrintGlxReqSize_common): + def __init__(self): + PrintGlxReqSize_common.__init__(self) + self.header_tag = "_INDIRECT_REQSIZE_H_" + + + def printRealHeader(self): + self.printVisibility("HIDDEN", "hidden") + print '' + self.printPure() + print '' + + + def printBody(self, api): + for func in api.functionIterateGlx(): + if not func.ignore and func.has_variable_size_request(): + print 'extern PURE HIDDEN int __glX%sReqSize(const GLbyte *pc, Bool swap);' % (func.name) + + +class PrintGlxReqSize_c(PrintGlxReqSize_common): + """Create the server-side 'request size' functions. + + Create the server-side functions that are used to determine what the + size of a varible length command should be. The server then uses + this value to determine if the incoming command packed it malformed. + """ + + def __init__(self): + PrintGlxReqSize_common.__init__(self) + self.counter_sigs = {} + + + def printRealHeader(self): + print '' + print '#include ' + print '#include "glxserver.h"' + print '#include "glxbyteorder.h"' + print '#include "indirect_size.h"' + print '#include "indirect_reqsize.h"' + print '' + print '#define __GLX_PAD(x) (((x) + 3) & ~3)' + print '' + print '#if defined(__CYGWIN__) || defined(__MINGW32__)' + print '# undef HAVE_ALIAS' + print '#endif' + print '#ifdef HAVE_ALIAS' + print '# define ALIAS2(from,to) \\' + print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' + print ' __attribute__ ((alias( # to )));' + print '# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )' + print '#else' + print '# define ALIAS(from,to) \\' + print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' + print ' { return __glX ## to ## ReqSize( pc, swap ); }' + print '#endif' + print '' + print '' + + + def printBody(self, api): + aliases = [] + enum_functions = {} + enum_sigs = {} + + for func in api.functionIterateGlx(): + if not func.has_variable_size_request(): continue + + ef = glx_server_enum_function( func, api.enums_by_name ) + if len(ef.enums) == 0: continue + + sig = ef.signature() + + if not enum_functions.has_key(func.name): + enum_functions[ func.name ] = sig + + if not enum_sigs.has_key( sig ): + enum_sigs[ sig ] = ef + + + + for func in api.functionIterateGlx(): + # Even though server-handcode fuctions are on "the + # list", and prototypes are generated for them, there + # isn't enough information to generate a size + # function. If there was enough information, they + # probably wouldn't need to be handcoded in the first + # place! + + if func.server_handcode: continue + if not func.has_variable_size_request(): continue + + if enum_functions.has_key(func.name): + sig = enum_functions[func.name] + ef = enum_sigs[ sig ] + + if ef.name != func.name: + aliases.append( [func.name, ef.name] ) + else: + ef.Print( func.name, self ) + + elif func.images: + self.printPixelFunction(func) + elif func.has_variable_size_request(): + a = self.printCountedFunction(func) + if a: aliases.append(a) + + + for [alias_name, real_name] in aliases: + print 'ALIAS( %s, %s )' % (alias_name, real_name) + + return + + + def common_emit_fixups(self, fixup): + """Utility function to emit conditional byte-swaps.""" + + if fixup: + print ' if (swap) {' + for name in fixup: + print ' %s = bswap_32(%s);' % (name, name) + print ' }' + + return + + + def common_emit_one_arg(self, p, pc, adjust): + offset = p.offset + dst = p.string() + src = '(%s *)' % (p.type_string()) + print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust); + return + + + def common_func_print_just_header(self, f): + print 'int' + print '__glX%sReqSize( const GLbyte * pc, Bool swap )' % (f.name) + print '{' + + + def printPixelFunction(self, f): + self.common_func_print_just_header(f) + + f.offset_of( f.parameters[0].name ) + [dim, w, h, d, junk] = f.get_images()[0].get_dimensions() + + print ' GLint row_length = * (GLint *)(pc + 4);' + + if dim < 3: + fixup = ['row_length', 'skip_rows', 'alignment'] + print ' GLint image_height = 0;' + print ' GLint skip_images = 0;' + print ' GLint skip_rows = * (GLint *)(pc + 8);' + print ' GLint alignment = * (GLint *)(pc + 16);' + else: + fixup = ['row_length', 'image_height', 'skip_rows', 'skip_images', 'alignment'] + print ' GLint image_height = * (GLint *)(pc + 8);' + print ' GLint skip_rows = * (GLint *)(pc + 16);' + print ' GLint skip_images = * (GLint *)(pc + 20);' + print ' GLint alignment = * (GLint *)(pc + 32);' + + img = f.images[0] + for p in f.parameterIterateGlxSend(): + if p.name in [w, h, d, img.img_format, img.img_type, img.img_target]: + self.common_emit_one_arg(p, "pc", 0) + fixup.append( p.name ) + + print '' + + self.common_emit_fixups(fixup) + + if img.img_null_flag: + print '' + print ' if (*(CARD32 *) (pc + %s))' % (img.offset - 4) + print ' return 0;' + + print '' + print ' return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d ) + print ' image_height, row_length, skip_images,' + print ' skip_rows, alignment);' + print '}' + print '' + return + + + def printCountedFunction(self, f): + + sig = "" + offset = 0 + fixup = [] + params = [] + plus = '' + size = '' + param_offsets = {} + + # Calculate the offset of each counter parameter and the + # size string for the variable length parameter(s). While + # that is being done, calculate a unique signature for this + # function. + + for p in f.parameterIterateGlxSend(): + if p.is_counter: + fixup.append( p.name ) + params.append( p ) + elif p.counter: + s = p.size() + if s == 0: s = 1 + + sig += "(%u,%u)" % (f.offset_of(p.counter), s) + size += '%s%s' % (plus, p.size_string()) + plus = ' + ' + + + # If the calculated signature matches a function that has + # already be emitted, don't emit this function. Instead, add + # it to the list of function aliases. + + if self.counter_sigs.has_key(sig): + n = self.counter_sigs[sig]; + alias = [f.name, n] + else: + alias = None + self.counter_sigs[sig] = f.name + + self.common_func_print_just_header(f) + + for p in params: + self.common_emit_one_arg(p, "pc", 0) + + + print '' + self.common_emit_fixups(fixup) + print '' + + print ' return __GLX_PAD(%s);' % (size) + print '}' + print '' + + return alias + + +def show_usage(): + print "Usage: %s [-f input_file_name] -m output_mode [--only-get | --only-set] [--get-alias-set]" % sys.argv[0] + print " -m output_mode Output mode can be one of 'size_c' or 'size_h'." + print " --only-get Only emit 'get'-type functions." + print " --only-set Only emit 'set'-type functions." + print "" + print "By default, both 'get' and 'set'-type functions are emitted." + sys.exit(1) + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:h:", ["only-get", "only-set", "header-tag"]) + except Exception,e: + show_usage() + + mode = None + header_tag = None + which_functions = PrintGlxSizeStubs_common.do_get | PrintGlxSizeStubs_common.do_set + + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "--only-get": + which_functions = PrintGlxSizeStubs_common.do_get + elif arg == "--only-set": + which_functions = PrintGlxSizeStubs_common.do_set + elif (arg == '-h') or (arg == "--header-tag"): + header_tag = val + + if mode == "size_c": + printer = PrintGlxSizeStubs_c( which_functions ) + elif mode == "size_h": + printer = PrintGlxSizeStubs_h( which_functions ) + if header_tag: + printer.header_tag = header_tag + elif mode == "reqsize_c": + printer = PrintGlxReqSize_c() + elif mode == "reqsize_h": + printer = PrintGlxReqSize_h() + else: + show_usage() + + api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) + + + printer.Print( api ) diff --git a/src/mesa/glapi/gen/glX_server_table.py b/src/mesa/glapi/gen/glX_server_table.py new file mode 100644 index 0000000000..f3962f875b --- /dev/null +++ b/src/mesa/glapi/gen/glX_server_table.py @@ -0,0 +1,411 @@ +#!/bin/env python + +# (C) Copyright IBM Corporation 2005, 2006 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML, glX_proto_common, license +import sys, getopt + + +def log2(value): + for i in range(0, 30): + p = 1 << i + if p >= value: + return i + + return -1 + + +def round_down_to_power_of_two(n): + """Returns the nearest power-of-two less than or equal to n.""" + + for i in range(30, 0, -1): + p = 1 << i + if p <= n: + return p + + return -1 + + +class function_table: + def __init__(self, name, do_size_check): + self.name_base = name + self.do_size_check = do_size_check + + + self.max_bits = 1 + self.next_opcode_threshold = (1 << self.max_bits) + self.max_opcode = 0 + + self.functions = {} + self.lookup_table = [] + + # Minimum number of opcodes in a leaf node. + self.min_op_bits = 3 + self.min_op_count = (1 << self.min_op_bits) + return + + + def append(self, opcode, func): + self.functions[opcode] = func + + if opcode > self.max_opcode: + self.max_opcode = opcode + + if opcode > self.next_opcode_threshold: + bits = log2(opcode) + if (1 << bits) <= opcode: + bits += 1 + + self.max_bits = bits + self.next_opcode_threshold = 1 << bits + return + + + def divide_group(self, min_opcode, total): + """Divide the group starting min_opcode into subgroups. + Returns a tuple containing the number of bits consumed by + the node, the list of the children's tuple, and the number + of entries in the final array used by this node and its + children, and the depth of the subtree rooted at the node.""" + + remaining_bits = self.max_bits - total + next_opcode = min_opcode + (1 << remaining_bits) + empty_children = 0 + + for M in range(0, remaining_bits): + op_count = 1 << (remaining_bits - M); + child_count = 1 << M; + + empty_children = 0 + full_children = 0 + for i in range(min_opcode, next_opcode, op_count): + used = 0 + empty = 0 + + for j in range(i, i + op_count): + if self.functions.has_key(j): + used += 1; + else: + empty += 1; + + + if empty == op_count: + empty_children += 1 + + if used == op_count: + full_children += 1 + + if (empty_children > 0) or (full_children == child_count) or (op_count <= self.min_op_count): + break + + + # If all the remaining bits are used by this node, as is the + # case when M is 0 or remaining_bits, the node is a leaf. + + if (M == 0) or (M == remaining_bits): + return [remaining_bits, [], 0, 0] + else: + children = [] + count = 1 + depth = 1 + all_children_are_nonempty_leaf_nodes = 1 + for i in range(min_opcode, next_opcode, op_count): + n = self.divide_group(i, total + M) + + if not (n[1] == [] and not self.is_empty_leaf(i, n[0])): + all_children_are_nonempty_leaf_nodes = 0 + + children.append(n) + count += n[2] + 1 + + if n[3] >= depth: + depth = n[3] + 1 + + # If all of the child nodes are non-empty leaf nodes, pull + # them up and make this node a leaf. + + if all_children_are_nonempty_leaf_nodes: + return [remaining_bits, [], 0, 0] + else: + return [M, children, count, depth] + + + def is_empty_leaf(self, base_opcode, M): + for op in range(base_opcode, base_opcode + (1 << M)): + if self.functions.has_key(op): + return 0 + break + + return 1 + + + def dump_tree(self, node, base_opcode, remaining_bits, base_entry, depth): + M = node[0] + children = node[1] + child_M = remaining_bits - M + + + # This actually an error condition. + if children == []: + return + + print ' /* [%u] -> opcode range [%u, %u], node depth %u */' % (base_entry, base_opcode, base_opcode + (1 << remaining_bits), depth) + print ' %u,' % (M) + + base_entry += (1 << M) + 1 + + child_index = base_entry + child_base_opcode = base_opcode + for child in children: + if child[1] == []: + if self.is_empty_leaf(child_base_opcode, child_M): + print ' EMPTY_LEAF,' + else: + # Emit the index of the next dispatch + # function. Then add all the + # dispatch functions for this leaf + # node to the dispatch function + # lookup table. + + print ' LEAF(%u),' % (len(self.lookup_table)) + + for op in range(child_base_opcode, child_base_opcode + (1 << child_M)): + if self.functions.has_key(op): + func = self.functions[op] + size = func.command_fixed_length() + + if func.glx_rop != 0: + size += 4 + + size = ((size + 3) & ~3) + + if func.has_variable_size_request(): + size_name = "__glX%sReqSize" % (func.name) + else: + size_name = "" + + if func.glx_vendorpriv == op: + func_name = func.glx_vendorpriv_names[0] + else: + func_name = func.name + + temp = [op, "__glXDisp_%s" % (func_name), "__glXDispSwap_%s" % (func_name), size, size_name] + else: + temp = [op, "NULL", "NULL", 0, ""] + + self.lookup_table.append(temp) + else: + print ' %u,' % (child_index) + child_index += child[2] + + child_base_opcode += 1 << child_M + + print '' + + child_index = base_entry + for child in children: + if child[1] != []: + self.dump_tree(child, base_opcode, remaining_bits - M, child_index, depth + 1) + child_index += child[2] + + base_opcode += 1 << (remaining_bits - M) + + + def Print(self): + # Each dispatch table consists of two data structures. + # + # The first structure is an N-way tree where the opcode for + # the function is the key. Each node switches on a range of + # bits from the opcode. M bits are extracted from the opcde + # and are used as an index to select one of the N, where + # N = 2^M, children. + # + # The tree is stored as a flat array. The first value is the + # number of bits, M, used by the node. For inner nodes, the + # following 2^M values are indexes into the array for the + # child nodes. For leaf nodes, the followign 2^M values are + # indexes into the second data structure. + # + # If an inner node's child index is 0, the child is an empty + # leaf node. That is, none of the opcodes selectable from + # that child exist. Since most of the possible opcode space + # is unused, this allows compact data storage. + # + # The second data structure is an array of pairs of function + # pointers. Each function contains a pointer to a protocol + # decode function and a pointer to a byte-swapped protocol + # decode function. Elements in this array are selected by the + # leaf nodes of the first data structure. + # + # As the tree is traversed, an accumulator is kept. This + # accumulator counts the bits of the opcode consumed by the + # traversal. When accumulator + M = B, where B is the + # maximum number of bits in an opcode, the traversal has + # reached a leaf node. The traversal starts with the most + # significant bits and works down to the least significant + # bits. + # + # Creation of the tree is the most complicated part. At + # each node the elements are divided into groups of 2^M + # elements. The value of M selected is the smallest possible + # value where all of the groups are either empty or full, or + # the groups are a preset minimum size. If all the children + # of a node are non-empty leaf nodes, the children are merged + # to create a single leaf node that replaces the parent. + + tree = self.divide_group(0, 0) + + print '/*****************************************************************/' + print '/* tree depth = %u */' % (tree[3]) + print 'static const int_fast16_t %s_dispatch_tree[%u] = {' % (self.name_base, tree[2]) + self.dump_tree(tree, 0, self.max_bits, 0, 1) + print '};\n' + + # After dumping the tree, dump the function lookup table. + + print 'static const void *%s_function_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) + index = 0 + for func in self.lookup_table: + opcode = func[0] + name = func[1] + name_swap = func[2] + + print ' /* [% 3u] = %5u */ {%s, %s},' % (index, opcode, name, name_swap) + + index += 1 + + print '};\n' + + if self.do_size_check: + var_table = [] + + print 'static const int_fast16_t %s_size_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) + index = 0 + var_table = [] + for func in self.lookup_table: + opcode = func[0] + fixed = func[3] + var = func[4] + + if var != "": + var_offset = "%2u" % (len(var_table)) + var_table.append(var) + else: + var_offset = "~0" + + print ' /* [%3u] = %5u */ {%3u, %s},' % (index, opcode, fixed, var_offset) + index += 1 + + + print '};\n' + + + print 'static const gl_proto_size_func %s_size_func_table[%u] = {' % (self.name_base, len(var_table)) + for func in var_table: + print ' %s,' % (func) + + print '};\n' + + + print 'const struct __glXDispatchInfo %s_dispatch_info = {' % (self.name_base) + print ' %u,' % (self.max_bits) + print ' %s_dispatch_tree,' % (self.name_base) + print ' %s_function_table,' % (self.name_base) + if self.do_size_check: + print ' %s_size_table,' % (self.name_base) + print ' %s_size_func_table' % (self.name_base) + else: + print ' NULL,' + print ' NULL' + print '};\n' + return + + +class PrintGlxDispatchTables(glX_proto_common.glx_print_proto): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + self.name = "glX_server_table.py (from Mesa)" + self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005, 2006", "IBM") + + self.rop_functions = function_table("Render", 1) + self.sop_functions = function_table("Single", 0) + self.vop_functions = function_table("VendorPriv", 0) + return + + + def printRealHeader(self): + print '#include ' + print '#include "glxserver.h"' + print '#include "glxext.h"' + print '#include "indirect_dispatch.h"' + print '#include "indirect_reqsize.h"' + print '#include "g_disptab.h"' + print '#include "indirect_table.h"' + print '' + return + + + def printBody(self, api): + for f in api.functionIterateAll(): + if not f.ignore and f.vectorequiv == None: + if f.glx_rop != 0: + self.rop_functions.append(f.glx_rop, f) + if f.glx_sop != 0: + self.sop_functions.append(f.glx_sop, f) + if f.glx_vendorpriv != 0: + self.vop_functions.append(f.glx_vendorpriv, f) + + self.sop_functions.Print() + self.rop_functions.Print() + self.vop_functions.Print() + return + + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m") + except Exception,e: + show_usage() + + mode = "table_c" + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + + if mode == "table_c": + printer = PrintGlxDispatchTables() + else: + show_usage() + + + api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) + + + printer.Print( api ) diff --git a/src/mesa/glapi/gen/gl_API.dtd b/src/mesa/glapi/gen/gl_API.dtd new file mode 100644 index 0000000000..30c646c924 --- /dev/null +++ b/src/mesa/glapi/gen/gl_API.dtd @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/gl_API.xml b/src/mesa/glapi/gen/gl_API.xml new file mode 100644 index 0000000000..fbf8b0c3e4 --- /dev/null +++ b/src/mesa/glapi/gen/gl_API.xml @@ -0,0 +1,12505 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/gl_SPARC_asm.py b/src/mesa/glapi/gen/gl_SPARC_asm.py new file mode 100644 index 0000000000..33e752df38 --- /dev/null +++ b/src/mesa/glapi/gen/gl_SPARC_asm.py @@ -0,0 +1,275 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt + +class PrintGenericStubs(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + self.name = "gl_SPARC_asm.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + + + def printRealHeader(self): + print '#include "glapi/glapioffsets.h"' + print '' + print '#ifdef __arch64__' + print '#define GL_OFF(N)\t((N) * 8)' + print '#define GL_LL\t\tldx' + print '#define GL_TIE_LD(SYM)\t%tie_ldx(SYM)' + print '#define GL_STACK_SIZE\t128' + print '#else' + print '#define GL_OFF(N)\t((N) * 4)' + print '#define GL_LL\t\tld' + print '#define GL_TIE_LD(SYM)\t%tie_ld(SYM)' + print '#define GL_STACK_SIZE\t64' + print '#endif' + print '' + print '#define GLOBL_FN(x) .globl x ; .type x, @function' + print '#define HIDDEN(x) .hidden x' + print '' + print '\t.register %g2, #scratch' + print '\t.register %g3, #scratch' + print '' + print '\t.text' + print '' + print '\tGLOBL_FN(__glapi_sparc_icache_flush)' + print '\tHIDDEN(__glapi_sparc_icache_flush)' + print '\t.type\t__glapi_sparc_icache_flush, @function' + print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */' + print '\tflush\t%o0' + print '\tretl' + print '\t nop' + print '' + print '\t.align\t32' + print '' + print '\t.type\t__glapi_sparc_get_pc, @function' + print '__glapi_sparc_get_pc:' + print '\tretl' + print '\t add\t%o7, %g2, %g2' + print '\t.size\t__glapi_sparc_get_pc, .-__glapi_sparc_get_pc' + print '' + print '#ifdef GLX_USE_TLS' + print '' + print '\tGLOBL_FN(__glapi_sparc_get_dispatch)' + print '\tHIDDEN(__glapi_sparc_get_dispatch)' + print '__glapi_sparc_get_dispatch:' + print '\tmov\t%o7, %g1' + print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' + print '\tcall\t__glapi_sparc_get_pc' + print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' + print '\tmov\t%g1, %o7' + print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1' + print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1' + print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)' + print '\tretl' + print '\t mov\t%g2, %o0' + print '' + print '\t.data' + print '\t.align\t32' + print '' + print '\t/* --> sethi %hi(_glapi_tls_Dispatch), %g1 */' + print '\t/* --> or %g1, %lo(_glapi_tls_Dispatch), %g1 */' + print '\tGLOBL_FN(__glapi_sparc_tls_stub)' + print '\tHIDDEN(__glapi_sparc_tls_stub)' + print '__glapi_sparc_tls_stub: /* Call offset in %g3 */' + print '\tmov\t%o7, %g1' + print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' + print '\tcall\t__glapi_sparc_get_pc' + print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' + print '\tmov\t%g1, %o7' + print '\tsrl\t%g3, 10, %g3' + print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1' + print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1' + print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)' + print '\tGL_LL\t[%g7+%g2], %g1' + print '\tGL_LL\t[%g1 + %g3], %g1' + print '\tjmp\t%g1' + print '\t nop' + print '\t.size\t__glapi_sparc_tls_stub, .-__glapi_sparc_tls_stub' + print '' + print '#define GL_STUB(fn, off)\t\t\t\t\\' + print '\tGLOBL_FN(fn);\t\t\t\t\t\\' + print 'fn:\tba\t__glapi_sparc_tls_stub;\t\t\t\\' + print '\t sethi\tGL_OFF(off), %g3;\t\t\t\\' + print '\t.size\tfn,.-fn;' + print '' + print '#elif defined(PTHREADS)' + print '' + print '\t/* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */' + print '\t/* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */' + print '\t/* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */' + print '\t/* 64-bit 0x0c --> sllx %g1, 32, %g1 */' + print '\t/* 64-bit 0x10 --> add %g1, %g2, %g1 */' + print '\t/* 64-bit 0x14 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */' + print '' + print '\t/* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */' + print '\t/* 32-bit 0x04 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */' + print '' + print '\t.data' + print '\t.align\t32' + print '' + print '\tGLOBL_FN(__glapi_sparc_pthread_stub)' + print '\tHIDDEN(__glapi_sparc_pthread_stub)' + print '__glapi_sparc_pthread_stub: /* Call offset in %g3 */' + print '\tmov\t%o7, %g1' + print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' + print '\tcall\t__glapi_sparc_get_pc' + print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' + print '\tmov\t%g1, %o7' + print '\tsethi\t%hi(_glapi_Dispatch), %g1' + print '\tor\t%g1, %lo(_glapi_Dispatch), %g1' + print '\tsrl\t%g3, 10, %g3' + print '\tGL_LL\t[%g2+%g1], %g2' + print '\tGL_LL\t[%g2], %g1' + print '\tcmp\t%g1, 0' + print '\tbe\t2f' + print '\t nop' + print '1:\tGL_LL\t[%g1 + %g3], %g1' + print '\tjmp\t%g1' + print '\t nop' + print '2:\tsave\t%sp, GL_STACK_SIZE, %sp' + print '\tmov\t%g3, %l0' + print '\tcall\t_glapi_get_dispatch' + print '\t nop' + print '\tmov\t%o0, %g1' + print '\tmov\t%l0, %g3' + print '\tba\t1b' + print '\t restore %g0, %g0, %g0' + print '\t.size\t__glapi_sparc_pthread_stub, .-__glapi_sparc_pthread_stub' + print '' + print '#define GL_STUB(fn, off)\t\t\t\\' + print '\tGLOBL_FN(fn);\t\t\t\t\\' + print 'fn:\tba\t__glapi_sparc_pthread_stub;\t\\' + print '\t sethi\tGL_OFF(off), %g3;\t\t\\' + print '\t.size\tfn,.-fn;' + print '' + print '#else /* Non-threaded version. */' + print '' + print '\t.type __glapi_sparc_nothread_stub, @function' + print '__glapi_sparc_nothread_stub: /* Call offset in %g3 */' + print '\tmov\t%o7, %g1' + print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' + print '\tcall\t__glapi_sparc_get_pc' + print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' + print '\tmov\t%g1, %o7' + print '\tsrl\t%g3, 10, %g3' + print '\tsethi\t%hi(_glapi_Dispatch), %g1' + print '\tor\t%g1, %lo(_glapi_Dispatch), %g1' + print '\tGL_LL\t[%g2+%g1], %g2' + print '\tGL_LL\t[%g2], %g1' + print '\tGL_LL\t[%g1 + %g3], %g1' + print '\tjmp\t%g1' + print '\t nop' + print '\t.size\t__glapi_sparc_nothread_stub, .-__glapi_sparc_nothread_stub' + print '' + print '#define GL_STUB(fn, off)\t\t\t\\' + print '\tGLOBL_FN(fn);\t\t\t\t\\' + print 'fn:\tba\t__glapi_sparc_nothread_stub;\t\\' + print '\t sethi\tGL_OFF(off), %g3;\t\t\\' + print '\t.size\tfn,.-fn;' + print '' + print '#endif' + print '' + print '#define GL_STUB_ALIAS(fn, alias) \\' + print ' .globl fn; \\' + print ' .set fn, alias' + print '' + print '\t.text' + print '\t.align\t32' + print '' + print '\t.globl\tgl_dispatch_functions_start' + print '\tHIDDEN(gl_dispatch_functions_start)' + print 'gl_dispatch_functions_start:' + print '' + return + + def printRealFooter(self): + print '' + print '\t.globl\tgl_dispatch_functions_end' + print '\tHIDDEN(gl_dispatch_functions_end)' + print 'gl_dispatch_functions_end:' + return + + def printBody(self, api): + for f in api.functionIterateByOffset(): + name = f.dispatch_name() + + print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, f.name) + + if not f.is_static_entry_point(f.name): + print '\tHIDDEN(gl%s)' % (name) + + for f in api.functionIterateByOffset(): + name = f.dispatch_name() + + if f.is_static_entry_point(f.name): + for n in f.entry_points: + if n != f.name: + text = '\tGL_STUB_ALIAS(gl%s, gl%s)' % (n, f.name) + + if f.has_different_protocol(n): + print '#ifndef GLX_INDIRECT_RENDERING' + print text + print '#endif' + else: + print text + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + mode = "generic" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == '-m': + mode = val + elif arg == "-f": + file_name = val + + if mode == "generic": + printer = PrintGenericStubs() + else: + print "ERROR: Invalid mode \"%s\" specified." % mode + show_usage() + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer.Print(api) diff --git a/src/mesa/glapi/gen/gl_XML.py b/src/mesa/glapi/gen/gl_XML.py new file mode 100644 index 0000000000..a10a35e513 --- /dev/null +++ b/src/mesa/glapi/gen/gl_XML.py @@ -0,0 +1,967 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import libxml2 +import re, sys, string +import typeexpr + + +def parse_GL_API( file_name, factory = None ): + doc = libxml2.readFile( file_name, None, libxml2.XML_PARSE_XINCLUDE + libxml2.XML_PARSE_NOBLANKS + libxml2.XML_PARSE_DTDVALID + libxml2.XML_PARSE_DTDATTR + libxml2.XML_PARSE_DTDLOAD + libxml2.XML_PARSE_NOENT ) + ret = doc.xincludeProcess() + + if not factory: + factory = gl_item_factory() + + api = factory.create_item( "api", None, None ) + api.process_element( doc ) + + # After the XML has been processed, we need to go back and assign + # dispatch offsets to the functions that request that their offsets + # be assigned by the scripts. Typically this means all functions + # that are not part of the ABI. + + for func in api.functionIterateByCategory(): + if func.assign_offset: + func.offset = api.next_offset; + api.next_offset += 1 + + doc.freeDoc() + + return api + + +def is_attr_true( element, name ): + """Read a name value from an element's attributes. + + The value read from the attribute list must be either 'true' or + 'false'. If the value is 'false', zero will be returned. If the + value is 'true', non-zero will be returned. An exception will be + raised for any other value.""" + + value = element.nsProp( name, None ) + if value == "true": + return 1 + elif value == "false": + return 0 + else: + raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name)) + + +class gl_print_base: + """Base class of all API pretty-printers. + + In the model-view-controller pattern, this is the view. Any derived + class will want to over-ride the printBody, printRealHader, and + printRealFooter methods. Some derived classes may want to over-ride + printHeader and printFooter, or even Print (though this is unlikely). + """ + + def __init__(self): + # Name of the script that is generating the output file. + # Every derived class should set this to the name of its + # source file. + + self.name = "a" + + + # License on the *generated* source file. This may differ + # from the license on the script that is generating the file. + # Every derived class should set this to some reasonable + # value. + # + # See license.py for an example of a reasonable value. + + self.license = "The license for this file is unspecified." + + + # The header_tag is the name of the C preprocessor define + # used to prevent multiple inclusion. Typically only + # generated C header files need this to be set. Setting it + # causes code to be generated automatically in printHeader + # and printFooter. + + self.header_tag = None + + + # List of file-private defines that must be undefined at the + # end of the file. This can be used in header files to define + # names for use in the file, then undefine them at the end of + # the header file. + + self.undef_list = [] + return + + + def Print(self, api): + self.printHeader() + self.printBody(api) + self.printFooter() + return + + + def printHeader(self): + """Print the header associated with all files and call the printRealHeader method.""" + + print '/* DO NOT EDIT - This file generated automatically by %s script */' \ + % (self.name) + print '' + print '/*' + print ' * ' + self.license.replace('\n', '\n * ') + print ' */' + print '' + if self.header_tag: + print '#if !defined( %s )' % (self.header_tag) + print '# define %s' % (self.header_tag) + print '' + self.printRealHeader(); + return + + + def printFooter(self): + """Print the header associated with all files and call the printRealFooter method.""" + + self.printRealFooter() + + if self.undef_list: + print '' + for u in self.undef_list: + print "# undef %s" % (u) + + if self.header_tag: + print '' + print '#endif /* !defined( %s ) */' % (self.header_tag) + + + def printRealHeader(self): + """Print the "real" header for the created file. + + In the base class, this function is empty. All derived + classes should over-ride this function.""" + return + + + def printRealFooter(self): + """Print the "real" footer for the created file. + + In the base class, this function is empty. All derived + classes should over-ride this function.""" + return + + + def printPure(self): + """Conditionally define `PURE' function attribute. + + Conditionally defines a preprocessor macro `PURE' that wraps + GCC's `pure' function attribute. The conditional code can be + easilly adapted to other compilers that support a similar + feature. + + The name is also added to the file's undef_list. + """ + self.undef_list.append("PURE") + print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define PURE __attribute__((pure)) +# else +# define PURE +# endif""" + return + + + def printFastcall(self): + """Conditionally define `FASTCALL' function attribute. + + Conditionally defines a preprocessor macro `FASTCALL' that + wraps GCC's `fastcall' function attribute. The conditional + code can be easilly adapted to other compilers that support a + similar feature. + + The name is also added to the file's undef_list. + """ + + self.undef_list.append("FASTCALL") + print """# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) +# define FASTCALL __attribute__((fastcall)) +# else +# define FASTCALL +# endif""" + return + + + def printVisibility(self, S, s): + """Conditionally define visibility function attribute. + + Conditionally defines a preprocessor macro name S that wraps + GCC's visibility function attribute. The visibility used is + the parameter s. The conditional code can be easilly adapted + to other compilers that support a similar feature. + + The name is also added to the file's undef_list. + """ + + self.undef_list.append(S) + print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# define %s __attribute__((visibility("%s"))) +# else +# define %s +# endif""" % (S, s, S) + return + + + def printNoinline(self): + """Conditionally define `NOINLINE' function attribute. + + Conditionally defines a preprocessor macro `NOINLINE' that + wraps GCC's `noinline' function attribute. The conditional + code can be easilly adapted to other compilers that support a + similar feature. + + The name is also added to the file's undef_list. + """ + + self.undef_list.append("NOINLINE") + print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define NOINLINE __attribute__((noinline)) +# else +# define NOINLINE +# endif""" + return + + +def real_function_name(element): + name = element.nsProp( "name", None ) + alias = element.nsProp( "alias", None ) + + if alias: + return alias + else: + return name + + +def real_category_name(c): + if re.compile("[1-9][0-9]*[.][0-9]+").match(c): + return "GL_VERSION_" + c.replace(".", "_") + else: + return c + + +def classify_category(name, number): + """Based on the category name and number, select a numerical class for it. + + Categories are divided into four classes numbered 0 through 3. The + classes are: + + 0. Core GL versions, sorted by version number. + 1. ARB extensions, sorted by extension number. + 2. Non-ARB extensions, sorted by extension number. + 3. Un-numbered extensions, sorted by extension name. + """ + + try: + core_version = float(name) + except Exception,e: + core_version = 0.0 + + if core_version > 0.0: + cat_type = 0 + key = name + elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"): + cat_type = 1 + key = int(number) + else: + if number != None: + cat_type = 2 + key = int(number) + else: + cat_type = 3 + key = name + + + return [cat_type, key] + + +def create_parameter_string(parameters, include_names): + """Create a parameter string from a list of gl_parameters.""" + + list = [] + for p in parameters: + if p.is_padding: + continue + + if include_names: + list.append( p.string() ) + else: + list.append( p.type_string() ) + + if len(list) == 0: list = ["void"] + + return string.join(list, ", ") + + +class gl_item: + def __init__(self, element, context): + self.context = context + self.name = element.nsProp( "name", None ) + self.category = real_category_name( element.parent.nsProp( "name", None ) ) + return + + +class gl_type( gl_item ): + def __init__(self, element, context): + gl_item.__init__(self, element, context) + self.size = int( element.nsProp( "size", None ), 0 ) + + te = typeexpr.type_expression( None ) + tn = typeexpr.type_node() + tn.size = int( element.nsProp( "size", None ), 0 ) + tn.integer = not is_attr_true( element, "float" ) + tn.unsigned = is_attr_true( element, "unsigned" ) + tn.name = "GL" + self.name + te.set_base_type_node( tn ) + + self.type_expr = te + return + + + def get_type_expression(self): + return self.type_expr + + +class gl_enum( gl_item ): + def __init__(self, element, context): + gl_item.__init__(self, element, context) + self.value = int( element.nsProp( "value", None ), 0 ) + + temp = element.nsProp( "count", None ) + if not temp or temp == "?": + self.default_count = -1 + else: + try: + c = int(temp) + except Exception,e: + raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n)) + + self.default_count = c + + return + + + def priority(self): + """Calculate a 'priority' for this enum name. + + When an enum is looked up by number, there may be many + possible names, but only one is the 'prefered' name. The + priority is used to select which name is the 'best'. + + Highest precedence is given to core GL name. ARB extension + names have the next highest, followed by EXT extension names. + Vendor extension names are the lowest. + """ + + if self.name.endswith( "_BIT" ): + bias = 1 + else: + bias = 0 + + if self.category.startswith( "GL_VERSION_" ): + priority = 0 + elif self.category.startswith( "GL_ARB_" ): + priority = 2 + elif self.category.startswith( "GL_EXT_" ): + priority = 4 + else: + priority = 6 + + return priority + bias + + + +class gl_parameter: + def __init__(self, element, context): + self.name = element.nsProp( "name", None ) + + ts = element.nsProp( "type", None ) + self.type_expr = typeexpr.type_expression( ts, context ) + + temp = element.nsProp( "variable_param", None ) + if temp: + self.count_parameter_list = temp.split( ' ' ) + else: + self.count_parameter_list = [] + + # The count tag can be either a numeric string or the name of + # a variable. If it is the name of a variable, the int(c) + # statement will throw an exception, and the except block will + # take over. + + c = element.nsProp( "count", None ) + try: + count = int(c) + self.count = count + self.counter = None + except Exception,e: + count = 1 + self.count = 0 + self.counter = c + + self.count_scale = int(element.nsProp( "count_scale", None )) + + elements = (count * self.count_scale) + if elements == 1: + elements = 0 + + #if ts == "GLdouble": + # print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size()) + # print '/* # elements = %u */' % (elements) + self.type_expr.set_elements( elements ) + #if ts == "GLdouble": + # print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size()) + + self.is_client_only = is_attr_true( element, 'client_only' ) + self.is_counter = is_attr_true( element, 'counter' ) + self.is_output = is_attr_true( element, 'output' ) + + + # Pixel data has special parameters. + + self.width = element.nsProp('img_width', None) + self.height = element.nsProp('img_height', None) + self.depth = element.nsProp('img_depth', None) + self.extent = element.nsProp('img_extent', None) + + self.img_xoff = element.nsProp('img_xoff', None) + self.img_yoff = element.nsProp('img_yoff', None) + self.img_zoff = element.nsProp('img_zoff', None) + self.img_woff = element.nsProp('img_woff', None) + + self.img_format = element.nsProp('img_format', None) + self.img_type = element.nsProp('img_type', None) + self.img_target = element.nsProp('img_target', None) + + self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' ) + self.img_null_flag = is_attr_true( element, 'img_null_flag' ) + self.img_send_null = is_attr_true( element, 'img_send_null' ) + + self.is_padding = is_attr_true( element, 'padding' ) + return + + + def compatible(self, other): + return 1 + + + def is_array(self): + return self.is_pointer() + + + def is_pointer(self): + return self.type_expr.is_pointer() + + + def is_image(self): + if self.width: + return 1 + else: + return 0 + + + def is_variable_length(self): + return len(self.count_parameter_list) or self.counter + + + def is_64_bit(self): + count = self.type_expr.get_element_count() + if count: + if (self.size() / count) == 8: + return 1 + else: + if self.size() == 8: + return 1 + + return 0 + + + def string(self): + return self.type_expr.original_string + " " + self.name + + + def type_string(self): + return self.type_expr.original_string + + + def get_base_type_string(self): + return self.type_expr.get_base_name() + + + def get_dimensions(self): + if not self.width: + return [ 0, "0", "0", "0", "0" ] + + dim = 1 + w = self.width + h = "1" + d = "1" + e = "1" + + if self.height: + dim = 2 + h = self.height + + if self.depth: + dim = 3 + d = self.depth + + if self.extent: + dim = 4 + e = self.extent + + return [ dim, w, h, d, e ] + + + def get_stack_size(self): + return self.type_expr.get_stack_size() + + + def size(self): + if self.is_image(): + return 0 + else: + return self.type_expr.get_element_size() + + + def get_element_count(self): + c = self.type_expr.get_element_count() + if c == 0: + return 1 + + return c + + + def size_string(self, use_parens = 1): + s = self.size() + if self.counter or self.count_parameter_list: + list = [ "compsize" ] + + if self.counter and self.count_parameter_list: + list.append( self.counter ) + elif self.counter: + list = [ self.counter ] + + if s > 1: + list.append( str(s) ) + + if len(list) > 1 and use_parens : + return "(%s)" % (string.join(list, " * ")) + else: + return string.join(list, " * ") + + elif self.is_image(): + return "compsize" + else: + return str(s) + + + def format_string(self): + if self.type_expr.original_string == "GLenum": + return "0x%x" + else: + return self.type_expr.format_string() + + + +class gl_function( gl_item ): + def __init__(self, element, context): + self.context = context + self.name = None + + self.entry_points = [] + self.return_type = "void" + self.parameters = [] + self.offset = -1 + self.initialized = 0 + self.images = [] + + self.assign_offset = 0 + + self.static_entry_points = [] + + # Track the parameter string (for the function prototype) + # for each entry-point. This is done because some functions + # change their prototype slightly when promoted from extension + # to ARB extension to core. glTexImage3DEXT and glTexImage3D + # are good examples of this. Scripts that need to generate + # code for these differing aliases need to real prototype + # for each entry-point. Otherwise, they may generate code + # that won't compile. + + self.parameter_strings = {} + + self.process_element( element ) + + return + + + def process_element(self, element): + name = element.nsProp( "name", None ) + alias = element.nsProp( "alias", None ) + + if is_attr_true(element, "static_dispatch"): + self.static_entry_points.append(name) + + self.entry_points.append( name ) + if alias: + true_name = alias + else: + true_name = name + + # Only try to set the offset when a non-alias + # entry-point is being processes. + + offset = element.nsProp( "offset", None ) + if offset: + try: + o = int( offset ) + self.offset = o + except Exception, e: + self.offset = -1 + if offset == "assign": + self.assign_offset = 1 + + + if not self.name: + self.name = true_name + elif self.name != true_name: + raise RuntimeError("Function true name redefined. Was %s, now %s." % (self.name, true_name)) + + + # There are two possible cases. The first time an entry-point + # with data is seen, self.initialized will be 0. On that + # pass, we just fill in the data. The next time an + # entry-point with data is seen, self.initialized will be 1. + # On that pass we have to make that the new values match the + # valuse from the previous entry-point. + + parameters = [] + return_type = "void" + child = element.children + while child: + if child.type == "element": + if child.name == "return": + return_type = child.nsProp( "type", None ) + elif child.name == "param": + param = self.context.factory.create_item( "parameter", child, self.context) + parameters.append( param ) + + child = child.next + + + if self.initialized: + if self.return_type != return_type: + raise RuntimeError( "Return type changed in %s. Was %s, now %s." % (name, self.return_type, return_type)) + + if len(parameters) != len(self.parameters): + raise RuntimeError( "Parameter count mismatch in %s. Was %d, now %d." % (name, len(self.parameters), len(parameters))) + + for j in range(0, len(parameters)): + p1 = parameters[j] + p2 = self.parameters[j] + if not p1.compatible( p2 ): + raise RuntimeError( 'Parameter type mismatch in %s. "%s" was "%s", now "%s".' % (name, p2.name, p2.type_expr.original_string, p1.type_expr.original_string)) + + + if true_name == name or not self.initialized: + self.return_type = return_type + self.parameters = parameters + + for param in self.parameters: + if param.is_image(): + self.images.append( param ) + + if element.children: + self.initialized = 1 + self.parameter_strings[name] = create_parameter_string(parameters, 1) + else: + self.parameter_strings[name] = None + + return + + + def get_images(self): + """Return potentially empty list of input images.""" + return self.images + + + def parameterIterator(self): + return self.parameters.__iter__(); + + + def get_parameter_string(self, entrypoint = None): + if entrypoint: + s = self.parameter_strings[ entrypoint ] + if s: + return s + + return create_parameter_string( self.parameters, 1 ) + + def get_called_parameter_string(self): + p_string = "" + comma = "" + + for p in self.parameterIterator(): + p_string = p_string + comma + p.name + comma = ", " + + return p_string + + + def is_abi(self): + return (self.offset >= 0 and not self.assign_offset) + + def is_static_entry_point(self, name): + return name in self.static_entry_points + + def dispatch_name(self): + if self.name in self.static_entry_points: + return self.name + else: + return "_dispatch_stub_%u" % (self.offset) + + def static_name(self, name): + if name in self.static_entry_points: + return name + else: + return "_dispatch_stub_%u" % (self.offset) + + +class gl_item_factory: + """Factory to create objects derived from gl_item.""" + + def create_item(self, item_name, element, context): + if item_name == "function": + return gl_function(element, context) + if item_name == "type": + return gl_type(element, context) + elif item_name == "enum": + return gl_enum(element, context) + elif item_name == "parameter": + return gl_parameter(element, context) + elif item_name == "api": + return gl_api(self) + else: + return None + + +class gl_api: + def __init__(self, factory): + self.functions_by_name = {} + self.enums_by_name = {} + self.types_by_name = {} + + self.category_dict = {} + self.categories = [{}, {}, {}, {}] + + self.factory = factory + + self.next_offset = 0 + + typeexpr.create_initial_types() + return + + + def process_element(self, doc): + element = doc.children + while element.type != "element" or element.name != "OpenGLAPI": + element = element.next + + if element: + self.process_OpenGLAPI(element) + return + + + def process_OpenGLAPI(self, element): + child = element.children + while child: + if child.type == "element": + if child.name == "category": + self.process_category( child ) + elif child.name == "OpenGLAPI": + self.process_OpenGLAPI( child ) + + child = child.next + + return + + + def process_category(self, cat): + cat_name = cat.nsProp( "name", None ) + cat_number = cat.nsProp( "number", None ) + + [cat_type, key] = classify_category(cat_name, cat_number) + self.categories[cat_type][key] = [cat_name, cat_number] + + child = cat.children + while child: + if child.type == "element": + if child.name == "function": + func_name = real_function_name( child ) + + temp_name = child.nsProp( "name", None ) + self.category_dict[ temp_name ] = [cat_name, cat_number] + + if self.functions_by_name.has_key( func_name ): + func = self.functions_by_name[ func_name ] + func.process_element( child ) + else: + func = self.factory.create_item( "function", child, self ) + self.functions_by_name[ func_name ] = func + + if func.offset >= self.next_offset: + self.next_offset = func.offset + 1 + + + elif child.name == "enum": + enum = self.factory.create_item( "enum", child, self ) + self.enums_by_name[ enum.name ] = enum + elif child.name == "type": + t = self.factory.create_item( "type", child, self ) + self.types_by_name[ "GL" + t.name ] = t + + + child = child.next + + return + + + def functionIterateByCategory(self, cat = None): + """Iterate over functions by category. + + If cat is None, all known functions are iterated in category + order. See classify_category for details of the ordering. + Within a category, functions are sorted by name. If cat is + not None, then only functions in that category are iterated. + """ + lists = [{}, {}, {}, {}] + + for func in self.functionIterateAll(): + [cat_name, cat_number] = self.category_dict[func.name] + + if (cat == None) or (cat == cat_name): + [func_cat_type, key] = classify_category(cat_name, cat_number) + + if not lists[func_cat_type].has_key(key): + lists[func_cat_type][key] = {} + + lists[func_cat_type][key][func.name] = func + + + functions = [] + for func_cat_type in range(0,4): + keys = lists[func_cat_type].keys() + keys.sort() + + for key in keys: + names = lists[func_cat_type][key].keys() + names.sort() + + for name in names: + functions.append(lists[func_cat_type][key][name]) + + return functions.__iter__() + + + def functionIterateByOffset(self): + max_offset = -1 + for func in self.functions_by_name.itervalues(): + if func.offset > max_offset: + max_offset = func.offset + + + temp = [None for i in range(0, max_offset + 1)] + for func in self.functions_by_name.itervalues(): + if func.offset != -1: + temp[ func.offset ] = func + + + list = [] + for i in range(0, max_offset + 1): + if temp[i]: + list.append(temp[i]) + + return list.__iter__(); + + + def functionIterateAll(self): + return self.functions_by_name.itervalues() + + + def enumIterateByName(self): + keys = self.enums_by_name.keys() + keys.sort() + + list = [] + for enum in keys: + list.append( self.enums_by_name[ enum ] ) + + return list.__iter__() + + + def categoryIterate(self): + """Iterate over categories. + + Iterate over all known categories in the order specified by + classify_category. Each iterated value is a tuple of the + name and number (which may be None) of the category. + """ + + list = [] + for cat_type in range(0,4): + keys = self.categories[cat_type].keys() + keys.sort() + + for key in keys: + list.append(self.categories[cat_type][key]) + + return list.__iter__() + + + def get_category_for_name( self, name ): + if self.category_dict.has_key(name): + return self.category_dict[name] + else: + return ["", None] + + + def typeIterate(self): + return self.types_by_name.itervalues() + + + def find_type( self, type_name ): + if type_name in self.types_by_name: + return self.types_by_name[ type_name ].type_expr + else: + print "Unable to find base type matching \"%s\"." % (type_name) + return None diff --git a/src/mesa/glapi/gen/gl_and_glX_API.xml b/src/mesa/glapi/gen/gl_and_glX_API.xml new file mode 100644 index 0000000000..34c977e9c0 --- /dev/null +++ b/src/mesa/glapi/gen/gl_and_glX_API.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/mesa/glapi/gen/gl_apitemp.py b/src/mesa/glapi/gen/gl_apitemp.py new file mode 100644 index 0000000000..41a40fbeb6 --- /dev/null +++ b/src/mesa/glapi/gen/gl_apitemp.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML, glX_XML +import license +import sys, getopt + +class PrintGlOffsets(gl_XML.gl_print_base): + def __init__(self, es=False): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_apitemp.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + + self.es = es + + self.undef_list.append( "KEYWORD1" ) + self.undef_list.append( "KEYWORD1_ALT" ) + self.undef_list.append( "KEYWORD2" ) + self.undef_list.append( "NAME" ) + self.undef_list.append( "DISPATCH" ) + self.undef_list.append( "RETURN_DISPATCH" ) + self.undef_list.append( "DISPATCH_TABLE_NAME" ) + self.undef_list.append( "UNUSED_TABLE_NAME" ) + self.undef_list.append( "TABLE_ENTRY" ) + + + def printFunction(self, f, name): + p_string = "" + o_string = "" + t_string = "" + comma = "" + + if f.is_static_entry_point(name): + keyword = "KEYWORD1" + else: + keyword = "KEYWORD1_ALT" + + n = f.static_name(name) + + for p in f.parameterIterator(): + if p.is_padding: + continue + + if p.is_pointer(): + cast = "(const void *) " + else: + cast = "" + + t_string = t_string + comma + p.format_string() + p_string = p_string + comma + p.name + o_string = o_string + comma + cast + p.name + comma = ", " + + + if f.return_type != 'void': + dispatch = "RETURN_DISPATCH" + else: + dispatch = "DISPATCH" + + need_proto = False + if not f.is_static_entry_point(name): + need_proto = True + elif self.es: + cat, num = api.get_category_for_name(name) + if (cat.startswith("es") or cat.startswith("GL_OES")): + need_proto = True + if need_proto: + print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name)) + print '' + + print '%s %s KEYWORD2 NAME(%s)(%s)' % (keyword, f.return_type, n, f.get_parameter_string(name)) + print '{' + if p_string == "": + print ' %s(%s, (), (F, "gl%s();\\n"));' \ + % (dispatch, f.name, name) + else: + print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \ + % (dispatch, f.name, p_string, name, t_string, o_string) + print '}' + print '' + return + + def printRealHeader(self): + print '' + self.printVisibility( "HIDDEN", "hidden" ) + print """ +/* + * This file is a template which generates the OpenGL API entry point + * functions. It should be included by a .c file which first defines + * the following macros: + * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32 + * KEYWORD2 - usually nothing, but might be __stdcall on Win32 + * NAME(n) - builds the final function name (usually add "gl" prefix) + * DISPATCH(func, args, msg) - code to do dispatch of named function. + * msg is a printf-style debug message. + * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value + * + * Here is an example which generates the usual OpenGL functions: + * #define KEYWORD1 + * #define KEYWORD2 + * #define NAME(func) gl##func + * #define DISPATCH(func, args, msg) \\ + * struct _glapi_table *dispatch = CurrentDispatch; \\ + * (*dispatch->func) args + * #define RETURN DISPATCH(func, args, msg) \\ + * struct _glapi_table *dispatch = CurrentDispatch; \\ + * return (*dispatch->func) args + * + */ + + +#if defined( NAME ) +#ifndef KEYWORD1 +#define KEYWORD1 +#endif + +#ifndef KEYWORD1_ALT +#define KEYWORD1_ALT HIDDEN +#endif + +#ifndef KEYWORD2 +#define KEYWORD2 +#endif + +#ifndef DISPATCH +#error DISPATCH must be defined +#endif + +#ifndef RETURN_DISPATCH +#error RETURN_DISPATCH must be defined +#endif + +""" + return + + + + def printInitDispatch(self, api): + print """ +#endif /* defined( NAME ) */ + +/* + * This is how a dispatch table can be initialized with all the functions + * we generated above. + */ +#ifdef DISPATCH_TABLE_NAME + +#ifndef TABLE_ENTRY +#error TABLE_ENTRY must be defined +#endif + +#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS +#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined +#endif + +_glapi_proc DISPATCH_TABLE_NAME[] = {""" + for f in api.functionIterateByOffset(): + print ' TABLE_ENTRY(%s),' % (f.dispatch_name()) + + print ' /* A whole bunch of no-op functions. These might be called' + print ' * when someone tries to call a dynamically-registered' + print ' * extension function without a current rendering context.' + print ' */' + for i in range(1, 100): + print ' TABLE_ENTRY(Unused),' + + print '};' + print '#endif /* DISPATCH_TABLE_NAME */' + print '' + return + + + def printAliasedTable(self, api): + print """ +/* + * This is just used to silence compiler warnings. + * We list the functions which are not otherwise used. + */ +#ifdef UNUSED_TABLE_NAME +_glapi_proc UNUSED_TABLE_NAME[] = {""" + + normal_entries = [] + proto_entries = [] + for f in api.functionIterateByOffset(): + normal_ents, proto_ents = self.classifyEntryPoints(f) + + # exclude f.name + if f.name in normal_ents: + normal_ents.remove(f.name) + elif f.name in proto_ents: + proto_ents.remove(f.name) + + normal_ents = [f.static_name(ent) for ent in normal_ents] + proto_ents = [f.static_name(ent) for ent in proto_ents] + + normal_entries.extend(normal_ents) + proto_entries.extend(proto_ents) + + print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS' + for ent in normal_entries: + print ' TABLE_ENTRY(%s),' % (ent) + print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */' + print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS' + for ent in proto_entries: + print ' TABLE_ENTRY(%s),' % (ent) + print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */' + + print '};' + print '#endif /*UNUSED_TABLE_NAME*/' + print '' + return + + + def classifyEntryPoints(self, func): + normal_names = [] + normal_stubs = [] + proto_names = [] + proto_stubs = [] + # classify the entry points + for name in func.entry_points: + if func.has_different_protocol(name): + if func.is_static_entry_point(name): + proto_names.append(name) + else: + proto_stubs.append(name) + else: + if func.is_static_entry_point(name): + normal_names.append(name) + else: + normal_stubs.append(name) + # there can be at most one stub for a function + if normal_stubs: + normal_names.append(normal_stubs[0]) + elif proto_stubs: + proto_names.append(proto_stubs[0]) + + return (normal_names, proto_names) + + def printBody(self, api): + normal_entry_points = [] + proto_entry_points = [] + for func in api.functionIterateByOffset(): + normal_ents, proto_ents = self.classifyEntryPoints(func) + normal_entry_points.append((func, normal_ents)) + proto_entry_points.append((func, proto_ents)) + + print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS' + print '' + for func, ents in normal_entry_points: + for ent in ents: + self.printFunction(func, ent) + print '' + print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */' + print '' + print '/* these entry points might require different protocols */' + print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS' + print '' + for func, ents in proto_entry_points: + for ent in ents: + self.printFunction(func, ent) + print '' + print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */' + print '' + + self.printInitDispatch(api) + self.printAliasedTable(api) + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0] + print "-c Enable compatibility with OpenGL ES." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:c") + except Exception,e: + show_usage() + + es = False + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-c": + es = True + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + + printer = PrintGlOffsets(es) + printer.Print(api) diff --git a/src/mesa/glapi/gen/gl_enums.py b/src/mesa/glapi/gen/gl_enums.py new file mode 100644 index 0000000000..3a9ea3c86c --- /dev/null +++ b/src/mesa/glapi/gen/gl_enums.py @@ -0,0 +1,243 @@ +#!/usr/bin/python2 +# -*- Mode: Python; py-indent-offset: 8 -*- + +# (C) Copyright Zack Rusin 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Zack Rusin + +import license +import gl_XML +import sys, getopt + +class PrintGlEnums(gl_XML.gl_print_base): + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_enums.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2005 Brian Paul All Rights Reserved.""", "BRIAN PAUL") + self.enum_table = {} + + + def printRealHeader(self): + print '#include "main/glheader.h"' + print '#include "main/mfeatures.h"' + print '#include "main/enums.h"' + print '#include "main/imports.h"' + print '' + print 'typedef struct {' + print ' size_t offset;' + print ' int n;' + print '} enum_elt;' + print '' + return + + def print_code(self): + print """ +typedef int (*cfunc)(const void *, const void *); + +/** + * Compare a key name to an element in the \c all_enums array. + * + * \c bsearch always passes the key as the first parameter and the pointer + * to the array element as the second parameter. We can elimiate some + * extra work by taking advantage of that fact. + * + * \param a Pointer to the desired enum name. + * \param b Pointer to an element of the \c all_enums array. + */ +static int compar_name( const char *a, const enum_elt *b ) +{ + return strcmp( a, & enum_string_table[ b->offset ] ); +} + +/** + * Compare a key enum value to an element in the \c all_enums array. + * + * \c bsearch always passes the key as the first parameter and the pointer + * to the array element as the second parameter. We can elimiate some + * extra work by taking advantage of that fact. + * + * \param a Pointer to the desired enum name. + * \param b Pointer to an index into the \c all_enums array. + */ +static int compar_nr( const int *a, const unsigned *b ) +{ + return a[0] - all_enums[*b].n; +} + + +static char token_tmp[20]; + +const char *_mesa_lookup_enum_by_nr( int nr ) +{ + unsigned * i; + + i = (unsigned *) _mesa_bsearch(& nr, reduced_enums, + Elements(reduced_enums), + sizeof(reduced_enums[0]), + (cfunc) compar_nr); + + if ( i != NULL ) { + return & enum_string_table[ all_enums[ *i ].offset ]; + } + else { + /* this is not re-entrant safe, no big deal here */ + sprintf(token_tmp, "0x%x", nr); + return token_tmp; + } +} + +/* Get the name of an enum given that it is a primitive type. Avoids + * GL_FALSE/GL_POINTS ambiguity and others. + */ +const char *_mesa_lookup_prim_by_nr( int nr ) +{ + switch (nr) { + case GL_POINTS: return "GL_POINTS"; + case GL_LINES: return "GL_LINES"; + case GL_LINE_STRIP: return "GL_LINE_STRIP"; + case GL_LINE_LOOP: return "GL_LINE_LOOP"; + case GL_TRIANGLES: return "GL_TRIANGLES"; + case GL_TRIANGLE_STRIP: return "GL_TRIANGLE_STRIP"; + case GL_TRIANGLE_FAN: return "GL_TRIANGLE_FAN"; + case GL_QUADS: return "GL_QUADS"; + case GL_QUAD_STRIP: return "GL_QUAD_STRIP"; + case GL_POLYGON: return "GL_POLYGON"; + case GL_POLYGON+1: return "OUTSIDE_BEGIN_END"; + default: return ""; + } +} + + + +int _mesa_lookup_enum_by_name( const char *symbol ) +{ + enum_elt * f = NULL; + + if ( symbol != NULL ) { + f = (enum_elt *) _mesa_bsearch(symbol, all_enums, + Elements(all_enums), + sizeof( enum_elt ), + (cfunc) compar_name); + } + + return (f != NULL) ? f->n : -1; +} + +""" + return + + + def printBody(self, api): + self.process_enums( api ) + + keys = self.enum_table.keys() + keys.sort() + + name_table = [] + enum_table = {} + + for enum in keys: + low_pri = 9 + for [name, pri] in self.enum_table[ enum ]: + name_table.append( [name, enum] ) + + if pri < low_pri: + low_pri = pri + enum_table[enum] = name + + + name_table.sort() + + string_offsets = {} + i = 0; + print 'LONGSTRING static const char enum_string_table[] = ' + for [name, enum] in name_table: + print ' "%s\\0"' % (name) + string_offsets[ name ] = i + i += len(name) + 1 + + print ' ;' + print '' + + + print 'static const enum_elt all_enums[%u] =' % (len(name_table)) + print '{' + for [name, enum] in name_table: + print ' { %5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name) + print '};' + print '' + + print 'static const unsigned reduced_enums[%u] =' % (len(keys)) + print '{' + for enum in keys: + name = enum_table[ enum ] + if [name, enum] not in name_table: + print ' /* Error! %s, 0x%04x */ 0,' % (name, enum) + else: + i = name_table.index( [name, enum] ) + + print ' %4u, /* %s */' % (i, name) + print '};' + + + self.print_code() + return + + + def process_enums(self, api): + self.enum_table = {} + + for obj in api.enumIterateByName(): + if obj.value not in self.enum_table: + self.enum_table[ obj.value ] = [] + + + name = "GL_" + obj.name + priority = obj.priority() + self.enum_table[ obj.value ].append( [name, priority] ) + + +def show_usage(): + print "Usage: %s [-f input_file_name]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API( file_name ) + + printer = PrintGlEnums() + printer.Print( api ) diff --git a/src/mesa/glapi/gen/gl_offsets.py b/src/mesa/glapi/gen/gl_offsets.py new file mode 100644 index 0000000000..54867b3463 --- /dev/null +++ b/src/mesa/glapi/gen/gl_offsets.py @@ -0,0 +1,120 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt + +class PrintGlOffsets(gl_XML.gl_print_base): + def __init__(self, es=False): + gl_XML.gl_print_base.__init__(self) + + self.es = es + self.name = "gl_offsets.py (from Mesa)" + self.header_tag = '_GLAPI_OFFSETS_H_' + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + return + + def printBody(self, api): + print '/* this file should not be included directly in mesa */' + print '' + + functions = [] + abi_functions = [] + alias_functions = [] + count = 0 + for f in api.functionIterateByOffset(): + if not f.is_abi(): + functions.append( [f, count] ) + count += 1 + else: + abi_functions.append( f ) + + if self.es: + # remember functions with aliases + if len(f.entry_points) > 1: + alias_functions.append(f) + + for f in abi_functions: + print '#define _gloffset_%s %d' % (f.name, f.offset) + last_static = f.offset + + print '' + print '#if !defined(_GLAPI_USE_REMAP_TABLE)' + print '' + + for [f, index] in functions: + print '#define _gloffset_%s %d' % (f.name, f.offset) + + print '#define _gloffset_FIRST_DYNAMIC %d' % (api.next_offset) + + print '' + print '#else' + print '' + + for [f, index] in functions: + print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name) + + print '' + print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' + + if alias_functions: + print '' + print '/* define aliases for compatibility */' + for f in alias_functions: + for name in f.entry_points: + if name != f.name: + print '#define _gloffset_%s _gloffset_%s' % (name, f.name) + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0] + print " -c Enable compatibility with OpenGL ES." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:c") + except Exception,e: + show_usage() + + es = False + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-c": + es = True + + api = gl_XML.parse_GL_API( file_name ) + + printer = PrintGlOffsets(es) + printer.Print( api ) diff --git a/src/mesa/glapi/gen/gl_procs.py b/src/mesa/glapi/gen/gl_procs.py new file mode 100644 index 0000000000..5de61fbdfe --- /dev/null +++ b/src/mesa/glapi/gen/gl_procs.py @@ -0,0 +1,215 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt + +class PrintGlProcs(gl_XML.gl_print_base): + def __init__(self, long_strings, es=False): + gl_XML.gl_print_base.__init__(self) + + self.es = es + self.long_strings = long_strings + self.name = "gl_procs.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004, 2006""", "BRIAN PAUL, IBM") + + + def printRealHeader(self): + print """ +/* This file is only included by glapi.c and is used for + * the GetProcAddress() function + */ + +typedef struct { + GLint Name_offset; +#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) + _glapi_proc Address; +#endif + GLuint Offset; +} glprocs_table_t; + +#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o } +#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o } +#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o } +#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) +# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o } +#endif + +""" + return + + def printRealFooter(self): + print '' + print '#undef NAME_FUNC_OFFSET' + return + + def printFunctionString(self, name): + if self.long_strings: + print ' "gl%s\\0"' % (name) + else: + print " 'g','l',", + for c in name: + print "'%s'," % (c), + + print "'\\0'," + + + def printBody(self, api): + print '' + if self.long_strings: + print 'static const char gl_string_table[] =' + else: + print 'static const char gl_string_table[] = {' + + base_offset = 0 + table = [] + for func in api.functionIterateByOffset(): + name = func.dispatch_name() + self.printFunctionString(func.name) + table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) + + # The length of the function's name, plus 2 for "gl", + # plus 1 for the NUL. + + base_offset += len(func.name) + 3 + + + for func in api.functionIterateByOffset(): + for n in func.entry_points: + if n != func.name: + name = func.dispatch_name() + self.printFunctionString( n ) + + if func.has_different_protocol(n): + alt_name = "gl" + func.static_glx_name(n) + table.append((base_offset, "gl" + name, alt_name, alt_name, func.name)) + else: + table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) + + base_offset += len(n) + 3 + + + if self.long_strings: + print ' ;' + else: + print '};' + + print '' + print '' + print "#ifdef USE_MGL_NAMESPACE" + for func in api.functionIterateByOffset(): + for n in func.entry_points: + if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): + print '#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset) + break + print "#endif /* USE_MGL_NAMESPACE */" + print '' + print '' + print '#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)' + for func in api.functionIterateByOffset(): + for n in func.entry_points: + if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): + print '%s GLAPIENTRY gl_dispatch_stub_%u(%s);' % (func.return_type, func.offset, func.get_parameter_string()) + break + + if self.es: + categories = {} + for func in api.functionIterateByOffset(): + for n in func.entry_points: + cat, num = api.get_category_for_name(n) + if (cat.startswith("es") or cat.startswith("GL_OES")): + if not categories.has_key(cat): + categories[cat] = [] + proto = 'GLAPI %s GLAPIENTRY %s(%s);' \ + % (func.return_type, "gl" + n, func.get_parameter_string(n)) + categories[cat].append(proto) + if categories: + print '' + print '/* OpenGL ES specific prototypes */' + print '' + keys = categories.keys() + keys.sort() + for key in keys: + print '/* category %s */' % key + print "\n".join(categories[key]) + print '' + + print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */' + + print '' + print 'static const glprocs_table_t static_functions[] = {' + + for info in table: + print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info + + print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)' + print '};' + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0] + print "-c Enable compatibility with OpenGL ES." + print "-m mode mode can be one of:" + print " long - Create code for compilers that can handle very" + print " long string constants. (default)" + print " short - Create code for compilers that can only handle" + print " ANSI C89 string constants." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c") + except Exception,e: + show_usage() + + long_string = 1 + es = False + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + if val == "short": + long_string = 0 + elif val == "long": + long_string = 1 + else: + show_usage() + elif arg == "-c": + es = True + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer = PrintGlProcs(long_string, es) + printer.Print(api) diff --git a/src/mesa/glapi/gen/gl_table.py b/src/mesa/glapi/gen/gl_table.py new file mode 100644 index 0000000000..3bd7569e92 --- /dev/null +++ b/src/mesa/glapi/gen/gl_table.py @@ -0,0 +1,229 @@ +#!/usr/bin/python2 + +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import gl_XML +import license +import sys, getopt + +class PrintGlTable(gl_XML.gl_print_base): + def __init__(self, es=False): + gl_XML.gl_print_base.__init__(self) + + self.es = es + self.header_tag = '_GLAPI_TABLE_H_' + self.name = "gl_table.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") + return + + + def printBody(self, api): + for f in api.functionIterateByOffset(): + arg_string = f.get_parameter_string() + print ' %s (GLAPIENTRYP %s)(%s); /* %d */' % (f.return_type, f.name, arg_string, f.offset) + + + def printRealHeader(self): + print '#ifndef GLAPIENTRYP' + print '# ifndef GLAPIENTRY' + print '# define GLAPIENTRY' + print '# endif' + print '' + print '# define GLAPIENTRYP GLAPIENTRY *' + print '#endif' + print '' + print '' + print 'struct _glapi_table' + print '{' + return + + + def printRealFooter(self): + print '};' + return + + +class PrintRemapTable(gl_XML.gl_print_base): + def __init__(self, es=False): + gl_XML.gl_print_base.__init__(self) + + self.es = es + self.header_tag = '_GLAPI_DISPATCH_H_' + self.name = "gl_table.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def printRealHeader(self): + print """ +/* this file should not be included directly in mesa */ + +/** + * \\file glapidispatch.h + * Macros for handling GL dispatch tables. + * + * For each known GL function, there are 3 macros in this file. The first + * macro is named CALL_FuncName and is used to call that GL function using + * the specified dispatch table. The other 2 macros, called GET_FuncName + * can SET_FuncName, are used to get and set the dispatch pointer for the + * named function in the specified dispatch table. + */ +""" + + return + + def printBody(self, api): + print '#define CALL_by_offset(disp, cast, offset, parameters) \\' + print ' (*(cast (GET_by_offset(disp, offset)))) parameters' + print '#define GET_by_offset(disp, offset) \\' + print ' (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL' + print '#define SET_by_offset(disp, offset, fn) \\' + print ' do { \\' + print ' if ( (offset) < 0 ) { \\' + print ' /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\\n", */ \\' + print ' /* __func__, __LINE__, disp, offset, # fn); */ \\' + print ' /* abort(); */ \\' + print ' } \\' + print ' else { \\' + print ' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\' + print ' } \\' + print ' } while(0)' + print '' + + functions = [] + abi_functions = [] + alias_functions = [] + count = 0 + for f in api.functionIterateByOffset(): + if not f.is_abi(): + functions.append( [f, count] ) + count += 1 + else: + abi_functions.append( f ) + + if self.es: + # remember functions with aliases + if len(f.entry_points) > 1: + alias_functions.append(f) + + + for f in abi_functions: + print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) + print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) + print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) + + + print '' + print '#if !defined(_GLAPI_USE_REMAP_TABLE)' + print '' + + for [f, index] in functions: + print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) + print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) + print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) + + print '' + print '#else' + print '' + print '#define driDispatchRemapTable_size %u' % (count) + print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];' + print '' + + for [f, index] in functions: + print '#define %s_remap_index %u' % (f.name, index) + + print '' + + for [f, index] in functions: + arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) + cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) + + print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name) + print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name) + print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name) + + + print '' + print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' + + if alias_functions: + print '' + print '/* define aliases for compatibility */' + for f in alias_functions: + for name in f.entry_points: + if name != f.name: + print '#define CALL_%s(disp, parameters) CALL_%s(disp, parameters)' % (name, f.name) + print '#define GET_%s(disp) GET_%s(disp)' % (name, f.name) + print '#define SET_%s(disp, fn) SET_%s(disp, fn)' % (name, f.name) + print '' + + print '#if defined(_GLAPI_USE_REMAP_TABLE)' + for f in alias_functions: + for name in f.entry_points: + if name != f.name: + print '#define %s_remap_index %s_remap_index' % (name, f.name) + print '#endif /* defined(_GLAPI_USE_REMAP_TABLE) */' + print '' + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0] + print " -m mode Mode can be 'table' or 'remap_table'." + print " -c Enable compatibility with OpenGL ES." + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c") + except Exception,e: + show_usage() + + mode = "table" + es = False + for (arg,val) in args: + if arg == "-f": + file_name = val + elif arg == "-m": + mode = val + elif arg == "-c": + es = True + + if mode == "table": + printer = PrintGlTable(es) + elif mode == "remap_table": + printer = PrintRemapTable(es) + else: + show_usage() + + api = gl_XML.parse_GL_API( file_name ) + + printer.Print( api ) diff --git a/src/mesa/glapi/gen/gl_x86-64_asm.py b/src/mesa/glapi/gen/gl_x86-64_asm.py new file mode 100644 index 0000000000..31c1a2b93a --- /dev/null +++ b/src/mesa/glapi/gen/gl_x86-64_asm.py @@ -0,0 +1,334 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt, copy + +def should_use_push(registers): + for [reg, offset] in registers: + if reg[1:4] == "xmm": + return 0 + + N = len(registers) + return (N & 1) != 0 + + +def local_size(registers): + # The x86-64 ABI says "the value (%rsp - 8) is always a multiple of + # 16 when control is transfered to the function entry point." This + # means that the local stack usage must be (16*N)+8 for some value + # of N. (16*N)+8 = (8*(2N))+8 = 8*(2N+1). As long as N is odd, we + # meet this requirement. + + N = (len(registers) | 1) + return 8*N + + +def save_all_regs(registers): + adjust_stack = 0 + if not should_use_push(registers): + adjust_stack = local_size(registers) + print '\tsubq\t$%u, %%rsp' % (adjust_stack) + + for [reg, stack_offset] in registers: + save_reg( reg, stack_offset, adjust_stack ) + return + + +def restore_all_regs(registers): + adjust_stack = 0 + if not should_use_push(registers): + adjust_stack = local_size(registers) + + temp = copy.deepcopy(registers) + while len(temp): + [reg, stack_offset] = temp.pop() + restore_reg(reg, stack_offset, adjust_stack) + + if adjust_stack: + print '\taddq\t$%u, %%rsp' % (adjust_stack) + return + + +def save_reg(reg, offset, use_move): + if use_move: + if offset == 0: + print '\tmovq\t%s, (%%rsp)' % (reg) + else: + print '\tmovq\t%s, %u(%%rsp)' % (reg, offset) + else: + print '\tpushq\t%s' % (reg) + + return + + +def restore_reg(reg, offset, use_move): + if use_move: + if offset == 0: + print '\tmovq\t(%%rsp), %s' % (reg) + else: + print '\tmovq\t%u(%%rsp), %s' % (offset, reg) + else: + print '\tpopq\t%s' % (reg) + + return + + +class PrintGenericStubs(gl_XML.gl_print_base): + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_x86-64_asm.py (from Mesa)" + self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") + return + + + def get_stack_size(self, f): + size = 0 + for p in f.parameterIterator(): + size += p.get_stack_size() + + return size + + + def printRealHeader(self): + print "/* If we build with gcc's -fvisibility=hidden flag, we'll need to change" + print " * the symbol visibility mode to 'default'." + print ' */' + print '' + print '#include "x86/assyntax.h"' + print '' + print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303' + print '# pragma GCC visibility push(default)' + print '# define HIDDEN(x) .hidden x' + print '#else' + print '# define HIDDEN(x)' + print '#endif' + print '' + print '# if defined(USE_MGL_NAMESPACE)' + print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))' + print '# define _glapi_Dispatch _mglapi_Dispatch' + print '# else' + print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' + print '# endif' + print '' + print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' + print '# define THREADS' + print '#endif' + print '' + print '\t.text' + print '' + print '#ifdef GLX_USE_TLS' + print '' + print '\t.globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)' + print '_x86_64_get_get_dispatch:' + print '\tlea\t_x86_64_get_dispatch(%rip), %rax' + print '\tret' + print '' + print '\t.p2align\t4,,15' + print '_x86_64_get_dispatch:' + print '\tmovq\t_glapi_tls_Dispatch@GOTTPOFF(%rip), %rax' + print '\tmovq\t%fs:(%rax), %rax' + print '\tret' + print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch' + print '' + print '#elif defined(PTHREADS)' + print '' + print '\t.extern\t_glapi_Dispatch' + print '\t.extern\t_gl_DispatchTSD' + print '\t.extern\tpthread_getspecific' + print '' + print '\t.p2align\t4,,15' + print '_x86_64_get_dispatch:' + print '\tmovq\t_gl_DispatchTSD(%rip), %rdi' + print '\tjmp\tpthread_getspecific@PLT' + print '' + print '#elif defined(THREADS)' + print '' + print '\t.extern\t_glapi_get_dispatch' + print '' + print '#endif' + print '' + return + + + def printRealFooter(self): + print '' + print '#if defined(GLX_USE_TLS) && defined(__linux__)' + print ' .section ".note.ABI-tag", "a"' + print ' .p2align 2' + print ' .long 1f - 0f /* name length */' + print ' .long 3f - 2f /* data length */' + print ' .long 1 /* note length */' + print '0: .asciz "GNU" /* vendor name */' + print '1: .p2align 2' + print '2: .long 0 /* note data: the ABI tag */' + print ' .long 2,4,20 /* Minimum kernel version w/TLS */' + print '3: .p2align 2 /* pad out section */' + print '#endif /* GLX_USE_TLS */' + print '' + print '#if defined (__ELF__) && defined (__linux__)' + print ' .section .note.GNU-stack,"",%progbits' + print '#endif' + return + + + def printFunction(self, f): + + # The x86-64 ABI divides function parameters into a couple + # classes. For the OpenGL interface, the only ones that are + # relevent are INTEGER and SSE. Basically, the first 8 + # GLfloat or GLdouble parameters are placed in %xmm0 - %xmm7, + # the first 6 non-GLfloat / non-GLdouble parameters are placed + # in registers listed in int_parameters. + # + # If more parameters than that are required, they are passed + # on the stack. Therefore, we just have to make sure that + # %esp hasn't changed when we jump to the actual function. + # Since we're jumping to the function (and not calling it), we + # have to make sure of that anyway! + + int_parameters = ["%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"] + + int_class = 0 + sse_class = 0 + stack_offset = 0 + registers = [] + for p in f.parameterIterator(): + type_name = p.get_base_type_string() + + if p.is_pointer() or (type_name != "GLfloat" and type_name != "GLdouble"): + if int_class < 6: + registers.append( [int_parameters[int_class], stack_offset] ) + int_class += 1 + stack_offset += 8 + else: + if sse_class < 8: + registers.append( ["%%xmm%u" % (sse_class), stack_offset] ) + sse_class += 1 + stack_offset += 8 + + if ((int_class & 1) == 0) and (sse_class == 0): + registers.append( ["%rbp", 0] ) + + + name = f.dispatch_name() + + print '\t.p2align\t4,,15' + print '\t.globl\tGL_PREFIX(%s)' % (name) + print '\t.type\tGL_PREFIX(%s), @function' % (name) + if not f.is_static_entry_point(f.name): + print '\tHIDDEN(GL_PREFIX(%s))' % (name) + print 'GL_PREFIX(%s):' % (name) + print '#if defined(GLX_USE_TLS)' + print '\tcall\t_x86_64_get_dispatch@PLT' + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + print '\tjmp\t*%r11' + print '#elif defined(PTHREADS)' + + save_all_regs(registers) + print '\tcall\t_x86_64_get_dispatch@PLT' + restore_all_regs(registers) + + if f.offset == 0: + print '\tmovq\t(%rax), %r11' + else: + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + + print '\tjmp\t*%r11' + + print '#else' + print '\tmovq\t_glapi_Dispatch(%rip), %rax' + print '\ttestq\t%rax, %rax' + print '\tje\t1f' + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + print '\tjmp\t*%r11' + print '1:' + + save_all_regs(registers) + print '\tcall\t_glapi_get_dispatch' + restore_all_regs(registers) + + print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) + print '\tjmp\t*%r11' + print '#endif /* defined(GLX_USE_TLS) */' + + print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (name, name) + print '' + return + + + def printBody(self, api): + for f in api.functionIterateByOffset(): + self.printFunction(f) + + + for f in api.functionIterateByOffset(): + dispatch = f.dispatch_name() + for n in f.entry_points: + if n != f.name: + if f.is_static_entry_point(n): + text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch) + + if f.has_different_protocol(n): + print '#ifndef GLX_INDIRECT_RENDERING' + print text + print '#endif' + else: + print text + + return + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + mode = "generic" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == '-m': + mode = val + elif arg == "-f": + file_name = val + + if mode == "generic": + printer = PrintGenericStubs() + else: + print "ERROR: Invalid mode \"%s\" specified." % mode + show_usage() + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer.Print(api) diff --git a/src/mesa/glapi/gen/gl_x86_asm.py b/src/mesa/glapi/gen/gl_x86_asm.py new file mode 100644 index 0000000000..d210f3a248 --- /dev/null +++ b/src/mesa/glapi/gen/gl_x86_asm.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2004, 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import license +import gl_XML, glX_XML +import sys, getopt + +class PrintGenericStubs(gl_XML.gl_print_base): + + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "gl_x86_asm.py (from Mesa)" + self.license = license.bsd_license_template % ( \ +"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +(C) Copyright IBM Corporation 2004, 2005""", "BRIAN PAUL, IBM") + return + + + def get_stack_size(self, f): + size = 0 + for p in f.parameterIterator(): + if p.is_padding: + continue + + size += p.get_stack_size() + + return size + + + def printRealHeader(self): + print '#include "x86/assyntax.h"' + print '#include "glapi/glapioffsets.h"' + print '' + print '#if defined(STDCALL_API)' + print '# if defined(USE_MGL_NAMESPACE)' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))' + print '# else' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))' + print '# endif' + print '#else' + print '# if defined(USE_MGL_NAMESPACE)' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))' + print '# define _glapi_Dispatch _mglapi_Dispatch' + print '# else' + print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))' + print '# endif' + print '#endif' + print '' + print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))' + print '' + print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)' + print '#define GLOBL_FN(x) GLOBL x ; .type x, function' + print '#else' + print '#define GLOBL_FN(x) GLOBL x' + print '#endif' + print '' + print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' + print '# define THREADS' + print '#endif' + print '' + print '#ifdef GLX_USE_TLS' + print '' + print '#ifdef GLX_X86_READONLY_TEXT' + print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)' + print '#else' + print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */' + print '#endif' + print '' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tCALL(_x86_get_dispatch) ;\t\t\t\\' + print '\tCTX_INSNS ; \\' + print '\tJMP(GL_OFFSET(off))' + print '' + print '#elif defined(PTHREADS)' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' + print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' + print '\tJE(1f) ;\t\t\t\t\t\\' + print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' + print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\' + print '\tJMP(GL_OFFSET(off))' + print '#elif defined(THREADS)' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' + print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' + print '\tJE(1f) ;\t\t\t\t\t\\' + print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' + print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\' + print '\tJMP(GL_OFFSET(off))' + print '#else /* Non-threaded version. */' + print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' + print 'ALIGNTEXT16;\t\t\t\t\t\t\\' + print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' + print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' + print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' + print '\tJMP(GL_OFFSET(off))' + print '#endif' + print '' + print '#ifdef HAVE_ALIAS' + print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' + print '\t.globl\tGL_PREFIX(fn, fn_alt) ;\t\t\t\\' + print '\t.set\tGL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)' + print '#else' + print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' + print ' GL_STUB(fn, off, fn_alt)' + print '#endif' + print '' + print 'SEG_TEXT' + print '' + print '#ifdef GLX_USE_TLS' + print '' + print '\tGLOBL\tGLNAME(_x86_get_dispatch)' + print '\tHIDDEN(GLNAME(_x86_get_dispatch))' + print 'ALIGNTEXT16' + print 'GLNAME(_x86_get_dispatch):' + print '\tcall 1f' + print '1:\tpopl %eax' + print '\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax' + print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax' + print '\tret' + print '' + print '#elif defined(PTHREADS)' + print 'EXTERN GLNAME(_glapi_Dispatch)' + print 'EXTERN GLNAME(_gl_DispatchTSD)' + print 'EXTERN GLNAME(pthread_getspecific)' + print '' + print 'ALIGNTEXT16' + print 'GLNAME(_x86_get_dispatch):' + print '\tSUB_L(CONST(24), ESP)' + print '\tPUSH_L(GLNAME(_gl_DispatchTSD))' + print '\tCALL(GLNAME(pthread_getspecific))' + print '\tADD_L(CONST(28), ESP)' + print '\tRET' + print '#elif defined(THREADS)' + print 'EXTERN GLNAME(_glapi_get_dispatch)' + print '#endif' + print '' + + print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )' + print '\t\t.section\twtext, "awx", @progbits' + print '#endif /* defined( GLX_USE_TLS ) */' + + print '' + print '\t\tALIGNTEXT16' + print '\t\tGLOBL GLNAME(gl_dispatch_functions_start)' + print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_start))' + print 'GLNAME(gl_dispatch_functions_start):' + print '' + return + + + def printRealFooter(self): + print '' + print '\t\tGLOBL\tGLNAME(gl_dispatch_functions_end)' + print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_end))' + print '\t\tALIGNTEXT16' + print 'GLNAME(gl_dispatch_functions_end):' + print '' + print '#if defined(GLX_USE_TLS) && defined(__linux__)' + print ' .section ".note.ABI-tag", "a"' + print ' .p2align 2' + print ' .long 1f - 0f /* name length */' + print ' .long 3f - 2f /* data length */' + print ' .long 1 /* note length */' + print '0: .asciz "GNU" /* vendor name */' + print '1: .p2align 2' + print '2: .long 0 /* note data: the ABI tag */' + print ' .long 2,4,20 /* Minimum kernel version w/TLS */' + print '3: .p2align 2 /* pad out section */' + print '#endif /* GLX_USE_TLS */' + print '' + print '#if defined (__ELF__) && defined (__linux__)' + print ' .section .note.GNU-stack,"",%progbits' + print '#endif' + return + + + def printBody(self, api): + for f in api.functionIterateByOffset(): + name = f.dispatch_name() + stack = self.get_stack_size(f) + alt = "%s@%u" % (name, stack) + + print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt) + + if not f.is_static_entry_point(f.name): + print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt) + + + for f in api.functionIterateByOffset(): + name = f.dispatch_name() + stack = self.get_stack_size(f) + alt = "%s@%u" % (name, stack) + + if f.is_static_entry_point(f.name): + for n in f.entry_points: + if n != f.name: + alt2 = "%s@%u" % (n, stack) + text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt) + + if f.has_different_protocol(n): + print '#ifndef GLX_INDIRECT_RENDERING' + print text + print '#endif' + else: + print text + + return + +def show_usage(): + print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + mode = "generic" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == '-m': + mode = val + elif arg == "-f": + file_name = val + + if mode == "generic": + printer = PrintGenericStubs() + else: + print "ERROR: Invalid mode \"%s\" specified." % mode + show_usage() + + api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) + printer.Print(api) diff --git a/src/mesa/glapi/gen/license.py b/src/mesa/glapi/gen/license.py new file mode 100644 index 0000000000..02181648e4 --- /dev/null +++ b/src/mesa/glapi/gen/license.py @@ -0,0 +1,47 @@ +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +bsd_license_template = """%s +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sub license, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +%s, +AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.""" diff --git a/src/mesa/glapi/gen/mesadef.py b/src/mesa/glapi/gen/mesadef.py new file mode 100644 index 0000000000..38b0246ba5 --- /dev/null +++ b/src/mesa/glapi/gen/mesadef.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python + + +# Mesa 3-D graphics library +# Version: 4.1 +# +# Copyright (C) 1999-2001 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +# Generate the mesa.def file for Windows. +# +# Usage: +# mesadef.py >mesa.def +# Then copy to src/mesa/drivers/windows/gdi +# +# Dependencies: +# The apispec file must be in the current directory. + + + +import apiparser +import string + + +def PrintHead(): + print '; DO NOT EDIT - This file generated automatically by mesadef.py script' + print 'DESCRIPTION \'Mesa (OpenGL work-alike) for Win32\'' + print 'VERSION 6.0' + print ';' + print '; Module definition file for Mesa (OPENGL32.DLL)' + print ';' + print '; Note: The OpenGL functions use the STDCALL' + print '; function calling convention. Microsoft\'s' + print '; OPENGL32 uses this convention and so must the' + print '; Mesa OPENGL32 so that the Mesa DLL can be used' + print '; as a drop-in replacement.' + print ';' + print '; The linker exports STDCALL entry points with' + print '; \'decorated\' names; e.g., _glBegin@0, where the' + print '; trailing number is the number of bytes of ' + print '; parameter data pushed onto the stack. The' + print '; callee is responsible for popping this data' + print '; off the stack, usually via a RETF n instruction.' + print ';' + print '; However, the Microsoft OPENGL32.DLL does not export' + print '; the decorated names, even though the calling convention' + print '; is STDCALL. So, this module definition file is' + print '; needed to force the Mesa OPENGL32.DLL to export the' + print '; symbols in the same manner as the Microsoft DLL.' + print '; Were it not for this problem, this file would not' + print '; be needed (for the gl* functions) since the entry' + print '; points are compiled with dllexport declspec.' + print ';' + print '; However, this file is still needed to export "internal"' + print '; Mesa symbols for the benefit of the OSMESA32.DLL.' + print ';' + print 'EXPORTS' + return +#enddef + + +def PrintTail(): + print ';' + print '; WGL API' + print '\twglChoosePixelFormat' + print '\twglCopyContext' + print '\twglCreateContext' + print '\twglCreateLayerContext' + print '\twglDeleteContext' + print '\twglDescribeLayerPlane' + print '\twglDescribePixelFormat' + print '\twglGetCurrentContext' + print '\twglGetCurrentDC' + print '\twglGetExtensionsStringARB' + print '\twglGetLayerPaletteEntries' + print '\twglGetPixelFormat' + print '\twglGetProcAddress' + print '\twglMakeCurrent' + print '\twglRealizeLayerPalette' + print '\twglSetLayerPaletteEntries' + print '\twglSetPixelFormat' + print '\twglShareLists' + print '\twglSwapBuffers' + print '\twglSwapLayerBuffers' + print '\twglUseFontBitmapsA' + print '\twglUseFontBitmapsW' + print '\twglUseFontOutlinesA' + print '\twglUseFontOutlinesW' + print ';' + print '; Mesa internals - mostly for OSMESA' + print '\t_ac_CreateContext' + print '\t_ac_DestroyContext' + print '\t_ac_InvalidateState' + print '\t_glapi_get_context' + print '\t_glapi_get_proc_address' + print '\t_mesa_buffer_data' + print '\t_mesa_buffer_map' + print '\t_mesa_buffer_subdata' + print '\t_mesa_choose_tex_format' + print '\t_mesa_compressed_texture_size' + print '\t_mesa_create_framebuffer' + print '\t_mesa_create_visual' + print '\t_mesa_delete_buffer_object' + print '\t_mesa_delete_texture_object' + print '\t_mesa_destroy_framebuffer' + print '\t_mesa_destroy_visual' + print '\t_mesa_enable_1_3_extensions' + print '\t_mesa_enable_1_4_extensions' + print '\t_mesa_enable_1_5_extensions' + print '\t_mesa_enable_sw_extensions' + print '\t_mesa_error' + print '\t_mesa_free_context_data' + print '\t_mesa_get_current_context' + print '\t_mesa_init_default_imports' + print '\t_mesa_initialize_context' + print '\t_mesa_make_current' + print '\t_mesa_new_buffer_object' + print '\t_mesa_new_texture_object' + print '\t_mesa_problem' + print '\t_mesa_ResizeBuffersMESA' + print '\t_mesa_store_compressed_teximage1d' + print '\t_mesa_store_compressed_teximage2d' + print '\t_mesa_store_compressed_teximage3d' + print '\t_mesa_store_compressed_texsubimage1d' + print '\t_mesa_store_compressed_texsubimage2d' + print '\t_mesa_store_compressed_texsubimage3d' + print '\t_mesa_store_teximage1d' + print '\t_mesa_store_teximage2d' + print '\t_mesa_store_teximage3d' + print '\t_mesa_store_texsubimage1d' + print '\t_mesa_store_texsubimage2d' + print '\t_mesa_store_texsubimage3d' + print '\t_mesa_test_proxy_teximage' + print '\t_mesa_Viewport' + print '\t_mesa_meta_CopyColorSubTable' + print '\t_mesa_meta_CopyColorTable' + print '\t_mesa_meta_CopyConvolutionFilter1D' + print '\t_mesa_meta_CopyConvolutionFilter2D' + print '\t_mesa_meta_CopyTexImage1D' + print '\t_mesa_meta_CopyTexImage2D' + print '\t_mesa_meta_CopyTexSubImage1D' + print '\t_mesa_meta_CopyTexSubImage2D' + print '\t_mesa_meta_CopyTexSubImage3D' + print '\t_swrast_Accum' + print '\t_swrast_alloc_buffers' + print '\t_swrast_Bitmap' + print '\t_swrast_CopyPixels' + print '\t_swrast_DrawPixels' + print '\t_swrast_GetDeviceDriverReference' + print '\t_swrast_Clear' + print '\t_swrast_choose_line' + print '\t_swrast_choose_triangle' + print '\t_swrast_CreateContext' + print '\t_swrast_DestroyContext' + print '\t_swrast_InvalidateState' + print '\t_swrast_ReadPixels' + print '\t_swrast_zbuffer_address' + print '\t_swsetup_Wakeup' + print '\t_swsetup_CreateContext' + print '\t_swsetup_DestroyContext' + print '\t_swsetup_InvalidateState' + print '\t_tnl_CreateContext' + print '\t_tnl_DestroyContext' + print '\t_tnl_InvalidateState' + print '\t_tnl_MakeCurrent' + print '\t_tnl_run_pipeline' +#enddef + + +records = [] + +def FindOffset(funcName): + for (name, alias, offset) in records: + if name == funcName: + return offset + #endif + #endfor + return -1 +#enddef + + +def EmitEntry(name, returnType, argTypeList, argNameList, alias, offset): + if alias == '': + dispatchName = name + else: + dispatchName = alias + if offset < 0: + offset = FindOffset(dispatchName) + if offset >= 0 and string.find(name, "unused") == -1: + print '\tgl%s' % (name) + # save this info in case we need to look up an alias later + records.append((name, dispatchName, offset)) + +#enddef + + +PrintHead() +apiparser.ProcessSpecFile("APIspec", EmitEntry) +PrintTail() diff --git a/src/mesa/glapi/gen/next_available_offset.sh b/src/mesa/glapi/gen/next_available_offset.sh new file mode 100755 index 0000000000..e7d6c2f4af --- /dev/null +++ b/src/mesa/glapi/gen/next_available_offset.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# (C) Copyright IBM Corporation 2004 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +# Trivial shell script to search the API definition file and print out the +# next numerically available API entry-point offset. This could probably +# be made smarter, but it would be better to use the existin Python +# framework to do that. This is just a quick-and-dirty hack. + +num=$(grep 'offset="' gl_API.xml |\ + sed 's/.\+ offset="//g;s/".*$//g' |\ + grep -v '?' |\ + sort -rn |\ + head -1) + +echo $((num + 1)) diff --git a/src/mesa/glapi/gen/remap_helper.py b/src/mesa/glapi/gen/remap_helper.py new file mode 100644 index 0000000000..d93c7a4285 --- /dev/null +++ b/src/mesa/glapi/gen/remap_helper.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python + +# Copyright (C) 2009 Chia-I Wu +# All Rights Reserved. +# +# This is based on extension_helper.py by Ian Romanick. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +import gl_XML +import license +import sys, getopt, string + +def get_function_spec(func): + sig = "" + # derive parameter signature + for p in func.parameterIterator(): + if p.is_padding: + continue + # FIXME: This is a *really* ugly hack. :( + tn = p.type_expr.get_base_type_node() + if p.is_pointer(): + sig += 'p' + elif tn.integer: + sig += 'i' + elif tn.size == 4: + sig += 'f' + else: + sig += 'd' + + spec = [sig] + for ent in func.entry_points: + spec.append("gl" + ent) + + # spec is terminated by an empty string + spec.append('') + + return spec + +class PrintGlRemap(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "remap_helper.py (from Mesa)" + self.license = license.bsd_license_template % ("Copyright (C) 2009 Chia-I Wu ", "Chia-I Wu") + return + + + def printRealHeader(self): + print '#include "glapi/dispatch.h"' + print '' + return + + + def printBody(self, api): + print 'struct gl_function_remap {' + print ' GLint func_index;' + print ' GLint dispatch_offset; /* for sanity check */' + print '};' + print '' + + pool_indices = {} + + print '/* this is internal to remap.c */' + print '#ifdef need_MESA_remap_table' + print '' + print 'static const char _mesa_function_pool[] =' + + # output string pool + index = 0; + for f in api.functionIterateAll(): + pool_indices[f] = index + + spec = get_function_spec(f) + + # a function has either assigned offset, fixed offset, + # or no offset + if f.assign_offset: + comments = "will be remapped" + elif f.offset > 0: + comments = "offset %d" % f.offset + else: + comments = "dynamic" + + print ' /* _mesa_function_pool[%d]: %s (%s) */' \ + % (index, f.name, comments) + for line in spec: + print ' "%s\\0"' % line + index += len(line) + 1 + print ' ;' + print '' + + print '/* these functions need to be remapped */' + print 'static const struct {' + print ' GLint pool_index;' + print ' GLint remap_index;' + print '} MESA_remap_table_functions[] = {' + # output all functions that need to be remapped + # iterate by offsets so that they are sorted by remap indices + for f in api.functionIterateByOffset(): + if not f.assign_offset: + continue + print ' { %5d, %s_remap_index },' \ + % (pool_indices[f], f.name) + print ' { -1, -1 }' + print '};' + print '' + + # collect functions by versions/extensions + extension_functions = {} + abi_extensions = [] + for f in api.functionIterateAll(): + for n in f.entry_points: + category, num = api.get_category_for_name(n) + # consider only GL_VERSION_X_Y or extensions + c = gl_XML.real_category_name(category) + if c.startswith("GL_"): + if not extension_functions.has_key(c): + extension_functions[c] = [] + extension_functions[c].append(f) + # remember the ext names of the ABI + if (f.is_abi() and n == f.name and + c not in abi_extensions): + abi_extensions.append(c) + # ignore the ABI itself + for ext in abi_extensions: + extension_functions.pop(ext) + + extensions = extension_functions.keys() + extensions.sort() + + # output ABI functions that have alternative names (with ext suffix) + print '/* these functions are in the ABI, but have alternative names */' + print 'static const struct gl_function_remap MESA_alt_functions[] = {' + for ext in extensions: + funcs = [] + for f in extension_functions[ext]: + # test if the function is in the ABI and has alt names + if f.is_abi() and len(f.entry_points) > 1: + funcs.append(f) + if not funcs: + continue + print ' /* from %s */' % ext + for f in funcs: + print ' { %5d, _gloffset_%s },' \ + % (pool_indices[f], f.name) + print ' { -1, -1 }' + print '};' + print '' + + print '#endif /* need_MESA_remap_table */' + print '' + + # output remap helpers for DRI drivers + + for ext in extensions: + funcs = [] + remapped = [] + for f in extension_functions[ext]: + if f.assign_offset: + # these are handled above + remapped.append(f) + else: + # these functions are either in the + # abi, or have offset -1 + funcs.append(f) + + print '#if defined(need_%s)' % (ext) + if remapped: + print '/* functions defined in MESA_remap_table_functions are excluded */' + + # output extension functions that need to be mapped + print 'static const struct gl_function_remap %s_functions[] = {' % (ext) + for f in funcs: + if f.offset >= 0: + print ' { %5d, _gloffset_%s },' \ + % (pool_indices[f], f.name) + else: + print ' { %5d, -1 }, /* %s */' % \ + (pool_indices[f], f.name) + print ' { -1, -1 }' + print '};' + + print '#endif' + print '' + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API( file_name ) + + printer = PrintGlRemap() + printer.Print( api ) diff --git a/src/mesa/glapi/gen/typeexpr.py b/src/mesa/glapi/gen/typeexpr.py new file mode 100644 index 0000000000..8ba7de4862 --- /dev/null +++ b/src/mesa/glapi/gen/typeexpr.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python + +# (C) Copyright IBM Corporation 2005 +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# Authors: +# Ian Romanick + +import string, copy + +class type_node: + def __init__(self): + self.pointer = 0 # bool + self.const = 0 # bool + self.signed = 1 # bool + self.integer = 1 # bool + + # If elements is set to non-zero, then field is an array. + self.elements = 0 + + self.name = None + self.size = 0 # type's size in bytes + return + + + def string(self): + """Return string representation of this type_node.""" + s = "" + + if self.pointer: + s = "* " + + if self.const: + s += "const " + + if not self.pointer: + if self.integer: + if self.signed: + s += "signed " + else: + s += "unsigned " + + if self.name: + s += "%s " % (self.name) + + return s + + +class type_table: + def __init__(self): + self.types_by_name = {} + return + + + def add_type(self, type_expr): + self.types_by_name[ type_expr.get_base_name() ] = type_expr + return + + + def find_type(self, name): + if name in self.types_by_name: + return self.types_by_name[ name ] + else: + return None + + +def create_initial_types(): + tt = type_table() + + basic_types = [ + ("char", 1, 1), + ("short", 2, 1), + ("int", 4, 1), + ("long", 4, 1), + ("float", 4, 0), + ("double", 8, 0), + ("enum", 4, 1) + ] + + for (type_name, type_size, integer) in basic_types: + te = type_expression(None) + tn = type_node() + tn.name = type_name + tn.size = type_size + tn.integer = integer + te.expr.append(tn) + tt.add_type( te ) + + type_expression.built_in_types = tt + return + + +class type_expression: + built_in_types = None + + def __init__(self, type_string, extra_types = None): + self.expr = [] + + if not type_string: + return + + self.original_string = type_string + + if not type_expression.built_in_types: + raise RuntimeError("create_initial_types must be called before creating type_expression objects.") + + # Replace '*' with ' * ' in type_string. Then, split the string + # into tokens, separated by spaces. + tokens = string.split( string.replace( type_string, "*", " * " ) ) + + const = 0 + t = None + signed = 0 + unsigned = 0 + + for i in tokens: + if i == "const": + if t and t.pointer: + t.const = 1 + else: + const = 1 + elif i == "signed": + signed = 1 + elif i == "unsigned": + unsigned = 1 + elif i == "*": + # This is a quirky special-case because of the + # way the C works for types. If 'unsigned' is + # specified all by itself, it is treated the + # same as "unsigned int". + + if unsigned: + self.set_base_type( "int", signed, unsigned, const, extra_types ) + const = 0 + signed = 0 + unsigned = 0 + + if not self.expr: + raise RuntimeError("Invalid type expression (dangling pointer)") + + if signed: + raise RuntimeError("Invalid type expression (signed / unsigned applied to pointer)") + + t = type_node() + t.pointer = 1 + self.expr.append( t ) + else: + if self.expr: + raise RuntimeError('Invalid type expression (garbage after pointer qualifier -> "%s")' % (self.original_string)) + + self.set_base_type( i, signed, unsigned, const, extra_types ) + const = 0 + signed = 0 + unsigned = 0 + + if signed and unsigned: + raise RuntimeError("Invalid type expression (both signed and unsigned specified)") + + + if const: + raise RuntimeError("Invalid type expression (dangling const)") + + if unsigned: + raise RuntimeError("Invalid type expression (dangling signed)") + + if signed: + raise RuntimeError("Invalid type expression (dangling unsigned)") + + return + + + def set_base_type(self, type_name, signed, unsigned, const, extra_types): + te = type_expression.built_in_types.find_type( type_name ) + if not te: + te = extra_types.find_type( type_name ) + + if not te: + raise RuntimeError('Unknown base type "%s".' % (type_name)) + + self.expr = copy.deepcopy(te.expr) + + t = self.expr[ len(self.expr) - 1 ] + t.const = const + if signed: + t.signed = 1 + elif unsigned: + t.signed = 0 + + + def set_base_type_node(self, tn): + self.expr = [tn] + return + + + def set_elements(self, count): + tn = self.expr[0] + + tn.elements = count + return + + + def string(self): + s = "" + for t in self.expr: + s += t.string() + + return s + + + def get_base_type_node(self): + return self.expr[0] + + + def get_base_name(self): + if len(self.expr): + return self.expr[0].name + else: + return None + + + def get_element_size(self): + tn = self.expr[0] + + if tn.elements: + return tn.elements * tn.size + else: + return tn.size + + + def get_element_count(self): + tn = self.expr[0] + return tn.elements + + + def get_stack_size(self): + tn = self.expr[ len(self.expr) - 1 ] + + if tn.elements or tn.pointer: + return 4 + elif not tn.integer: + return tn.size + else: + return 4 + + + def is_pointer(self): + tn = self.expr[ len(self.expr) - 1 ] + return tn.pointer + + + def format_string(self): + tn = self.expr[ len(self.expr) - 1 ] + if tn.pointer: + return "%p" + elif not tn.integer: + return "%f" + else: + return "%d" + + + +if __name__ == '__main__': + + types_to_try = [ "int", "int *", "const int *", "int * const", "const int * const", \ + "unsigned * const *", \ + "float", "const double", "double * const"] + + create_initial_types() + + for t in types_to_try: + print 'Trying "%s"...' % (t) + te = type_expression( t ) + print 'Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size()) diff --git a/src/mesa/glapi/glX_API.xml b/src/mesa/glapi/glX_API.xml deleted file mode 100644 index 9e02aa498e..0000000000 --- a/src/mesa/glapi/glX_API.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/glX_XML.py b/src/mesa/glapi/glX_XML.py deleted file mode 100644 index 4c2e0f95bf..0000000000 --- a/src/mesa/glapi/glX_XML.py +++ /dev/null @@ -1,570 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML -import license -import sys, getopt, string - - -class glx_item_factory(gl_XML.gl_item_factory): - """Factory to create GLX protocol oriented objects derived from gl_item.""" - - def create_item(self, name, element, context): - if name == "function": - return glx_function(element, context) - elif name == "enum": - return glx_enum(element, context) - elif name == "api": - return glx_api(self) - else: - return gl_XML.gl_item_factory.create_item(self, name, element, context) - - -class glx_enum(gl_XML.gl_enum): - def __init__(self, element, context): - gl_XML.gl_enum.__init__(self, element, context) - - self.functions = {} - - child = element.children - while child: - if child.type == "element" and child.name == "size": - n = child.nsProp( "name", None ) - c = child.nsProp( "count", None ) - m = child.nsProp( "mode", None ) - - if not c: - c = self.default_count - else: - c = int(c) - - if m == "get": - mode = 0 - else: - mode = 1 - - if not self.functions.has_key(n): - self.functions[ n ] = [c, mode] - - child = child.next - - return - - -class glx_function(gl_XML.gl_function): - def __init__(self, element, context): - self.glx_rop = 0 - self.glx_sop = 0 - self.glx_vendorpriv = 0 - - self.glx_vendorpriv_names = [] - - # If this is set to true, it means that GLdouble parameters should be - # written to the GLX protocol packet in the order they appear in the - # prototype. This is different from the "classic" ordering. In the - # classic ordering GLdoubles are written to the protocol packet first, - # followed by non-doubles. NV_vertex_program was the first extension - # to break with this tradition. - - self.glx_doubles_in_order = 0 - - self.vectorequiv = None - self.output = None - self.can_be_large = 0 - self.reply_always_array = 0 - self.dimensions_in_reply = 0 - self.img_reset = None - - self.server_handcode = 0 - self.client_handcode = 0 - self.ignore = 0 - - self.count_parameter_list = [] - self.counter_list = [] - self.parameters_by_name = {} - self.offsets_calculated = 0 - - gl_XML.gl_function.__init__(self, element, context) - return - - - def process_element(self, element): - gl_XML.gl_function.process_element(self, element) - - # If the function already has a vector equivalent set, don't - # set it again. This can happen if an alias to a function - # appears after the function that it aliases. - - if not self.vectorequiv: - self.vectorequiv = element.nsProp("vectorequiv", None) - - - name = element.nsProp("name", None) - if name == self.name: - for param in self.parameters: - self.parameters_by_name[ param.name ] = param - - if len(param.count_parameter_list): - self.count_parameter_list.extend( param.count_parameter_list ) - - if param.counter and param.counter not in self.counter_list: - self.counter_list.append(param.counter) - - - child = element.children - while child: - if child.type == "element" and child.name == "glx": - rop = child.nsProp( 'rop', None ) - sop = child.nsProp( 'sop', None ) - vop = child.nsProp( 'vendorpriv', None ) - - if rop: - self.glx_rop = int(rop) - - if sop: - self.glx_sop = int(sop) - - if vop: - self.glx_vendorpriv = int(vop) - self.glx_vendorpriv_names.append(name) - - self.img_reset = child.nsProp( 'img_reset', None ) - - # The 'handcode' attribute can be one of 'true', - # 'false', 'client', or 'server'. - - handcode = child.nsProp( 'handcode', None ) - if handcode == "false": - self.server_handcode = 0 - self.client_handcode = 0 - elif handcode == "true": - self.server_handcode = 1 - self.client_handcode = 1 - elif handcode == "client": - self.server_handcode = 0 - self.client_handcode = 1 - elif handcode == "server": - self.server_handcode = 1 - self.client_handcode = 0 - else: - raise RuntimeError('Invalid handcode mode "%s" in function "%s".' % (handcode, self.name)) - - self.ignore = gl_XML.is_attr_true( child, 'ignore' ) - self.can_be_large = gl_XML.is_attr_true( child, 'large' ) - self.glx_doubles_in_order = gl_XML.is_attr_true( child, 'doubles_in_order' ) - self.reply_always_array = gl_XML.is_attr_true( child, 'always_array' ) - self.dimensions_in_reply = gl_XML.is_attr_true( child, 'dimensions_in_reply' ) - - child = child.next - - - # Do some validation of the GLX protocol information. As - # new tests are discovered, they should be added here. - - for param in self.parameters: - if param.is_output and self.glx_rop != 0: - raise RuntimeError("Render / RenderLarge commands cannot have outputs (%s)." % (self.name)) - - return - - - def has_variable_size_request(self): - """Determine if the GLX request packet is variable sized. - - The GLX request packet is variable sized in several common - situations. - - 1. The function has a non-output parameter that is counted - by another parameter (e.g., the 'textures' parameter of - glDeleteTextures). - - 2. The function has a non-output parameter whose count is - determined by another parameter that is an enum (e.g., the - 'params' parameter of glLightfv). - - 3. The function has a non-output parameter that is an - image. - - 4. The function must be hand-coded on the server. - """ - - if self.glx_rop == 0: - return 0 - - if self.server_handcode or self.images: - return 1 - - for param in self.parameters: - if not param.is_output: - if param.counter or len(param.count_parameter_list): - return 1 - - return 0 - - - def variable_length_parameter(self): - for param in self.parameters: - if not param.is_output: - if param.counter or len(param.count_parameter_list): - return param - - return None - - - def calculate_offsets(self): - if not self.offsets_calculated: - # Calculate the offset of the first function parameter - # in the GLX command packet. This byte offset is - # measured from the end of the Render / RenderLarge - # header. The offset for all non-pixel commends is - # zero. The offset for pixel commands depends on the - # number of dimensions of the pixel data. - - if len(self.images) and not self.images[0].is_output: - [dim, junk, junk, junk, junk] = self.images[0].get_dimensions() - - # The base size is the size of the pixel pack info - # header used by images with the specified number - # of dimensions. - - if dim <= 2: - offset = 20 - elif dim <= 4: - offset = 36 - else: - raise RuntimeError('Invalid number of dimensions %u for parameter "%s" in function "%s".' % (dim, self.image.name, self.name)) - else: - offset = 0 - - for param in self.parameterIterateGlxSend(): - if param.img_null_flag: - offset += 4 - - if param.name != self.img_reset: - param.offset = offset - if not param.is_variable_length() and not param.is_client_only: - offset += param.size() - - if self.pad_after( param ): - offset += 4 - - - self.offsets_calculated = 1 - return - - - def offset_of(self, param_name): - self.calculate_offsets() - return self.parameters_by_name[ param_name ].offset - - - def parameterIterateGlxSend(self, include_variable_parameters = 1): - """Create an iterator for parameters in GLX request order.""" - - # The parameter lists are usually quite short, so it's easier - # (i.e., less code) to just generate a new list with the - # required elements than it is to create a new iterator class. - - temp = [ [], [], [] ] - for param in self.parameters: - if param.is_output: continue - - if param.is_variable_length(): - temp[2].append( param ) - elif not self.glx_doubles_in_order and param.is_64_bit(): - temp[0].append( param ) - else: - temp[1].append( param ) - - parameters = temp[0] - parameters.extend( temp[1] ) - if include_variable_parameters: - parameters.extend( temp[2] ) - return parameters.__iter__() - - - def parameterIterateCounters(self): - temp = [] - for name in self.counter_list: - temp.append( self.parameters_by_name[ name ] ) - - return temp.__iter__() - - - def parameterIterateOutputs(self): - temp = [] - for p in self.parameters: - if p.is_output: - temp.append( p ) - - return temp - - - def command_fixed_length(self): - """Return the length, in bytes as an integer, of the - fixed-size portion of the command.""" - - if len(self.parameters) == 0: - return 0 - - self.calculate_offsets() - - size = 0 - for param in self.parameterIterateGlxSend(0): - if param.name != self.img_reset and not param.is_client_only: - if size == 0: - size = param.offset + param.size() - else: - size += param.size() - - if self.pad_after( param ): - size += 4 - - for param in self.images: - if param.img_null_flag or param.is_output: - size += 4 - - return size - - - def command_variable_length(self): - """Return the length, as a string, of the variable-sized - portion of the command.""" - - size_string = "" - for p in self.parameterIterateGlxSend(): - if (not p.is_output) and (p.is_variable_length() or p.is_image()): - # FIXME Replace the 1 in the size_string call - # FIXME w/0 to eliminate some un-needed parnes - # FIXME This would already be done, but it - # FIXME adds some extra diffs to the generated - # FIXME code. - - size_string = size_string + " + __GLX_PAD(%s)" % (p.size_string(1)) - - return size_string - - - def command_length(self): - size = self.command_fixed_length() - - if self.glx_rop != 0: - size += 4 - - size = ((size + 3) & ~3) - return "%u%s" % (size, self.command_variable_length()) - - - def opcode_real_value(self): - """Get the true numeric value of the GLX opcode - - Behaves similarly to opcode_value, except for - X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. - In these cases the value for the GLX opcode field (i.e., - 16 for X_GLXVendorPrivate or 17 for - X_GLXVendorPrivateWithReply) is returned. For other 'single' - commands, the opcode for the command (e.g., 101 for - X_GLsop_NewList) is returned.""" - - if self.glx_vendorpriv != 0: - if self.needs_reply(): - return 17 - else: - return 16 - else: - return self.opcode_value() - - - def opcode_value(self): - """Get the unique protocol opcode for the glXFunction""" - - if (self.glx_rop == 0) and self.vectorequiv: - equiv = self.context.functions_by_name[ self.vectorequiv ] - self.glx_rop = equiv.glx_rop - - - if self.glx_rop != 0: - return self.glx_rop - elif self.glx_sop != 0: - return self.glx_sop - elif self.glx_vendorpriv != 0: - return self.glx_vendorpriv - else: - return -1 - - - def opcode_rop_basename(self): - """Return either the name to be used for GLX protocol enum. - - Returns either the name of the function or the name of the - name of the equivalent vector (e.g., glVertex3fv for - glVertex3f) function.""" - - if self.vectorequiv == None: - return self.name - else: - return self.vectorequiv - - - def opcode_name(self): - """Get the unique protocol enum name for the glXFunction""" - - if (self.glx_rop == 0) and self.vectorequiv: - equiv = self.context.functions_by_name[ self.vectorequiv ] - self.glx_rop = equiv.glx_rop - self.glx_doubles_in_order = equiv.glx_doubles_in_order - - - if self.glx_rop != 0: - return "X_GLrop_%s" % (self.opcode_rop_basename()) - elif self.glx_sop != 0: - return "X_GLsop_%s" % (self.name) - elif self.glx_vendorpriv != 0: - return "X_GLvop_%s" % (self.name) - else: - raise RuntimeError('Function "%s" has no opcode.' % (self.name)) - - - def opcode_vendor_name(self, name): - if name in self.glx_vendorpriv_names: - return "X_GLvop_%s" % (name) - else: - raise RuntimeError('Function "%s" has no VendorPrivate opcode.' % (name)) - - - def opcode_real_name(self): - """Get the true protocol enum name for the GLX opcode - - Behaves similarly to opcode_name, except for - X_GLXVendorPrivate and X_GLXVendorPrivateWithReply commands. - In these cases the string 'X_GLXVendorPrivate' or - 'X_GLXVendorPrivateWithReply' is returned. For other - single or render commands 'X_GLsop' or 'X_GLrop' plus the - name of the function returned.""" - - if self.glx_vendorpriv != 0: - if self.needs_reply(): - return "X_GLXVendorPrivateWithReply" - else: - return "X_GLXVendorPrivate" - else: - return self.opcode_name() - - - def needs_reply(self): - try: - x = self._needs_reply - except Exception, e: - x = 0 - if self.return_type != 'void': - x = 1 - - for param in self.parameters: - if param.is_output: - x = 1 - break - - self._needs_reply = x - - return x - - - def pad_after(self, p): - """Returns the name of the field inserted after the - specified field to pad out the command header.""" - - for image in self.images: - if image.img_pad_dimensions: - if not image.height: - if p.name == image.width: - return "height" - elif p.name == image.img_xoff: - return "yoffset" - elif not image.extent: - if p.name == image.depth: - # Should this be "size4d"? - return "extent" - elif p.name == image.img_zoff: - return "woffset" - - return None - - - def has_different_protocol(self, name): - """Returns true if the named version of the function uses different protocol from the other versions. - - Some functions, such as glDeleteTextures and - glDeleteTexturesEXT are functionally identical, but have - different protocol. This function returns true if the - named function is an alias name and that named version uses - different protocol from the function that is aliased. - """ - - return (name in self.glx_vendorpriv_names) and self.glx_sop - - - def static_glx_name(self, name): - if self.has_different_protocol(name): - for n in self.glx_vendorpriv_names: - if n in self.static_entry_points: - return n - - return self.static_name(name) - - - def client_supported_for_indirect(self): - """Returns true if the function is supported on the client - side for indirect rendering.""" - - return not self.ignore and (self.offset != -1) and (self.glx_rop or self.glx_sop or self.glx_vendorpriv or self.vectorequiv or self.client_handcode) - - -class glx_function_iterator: - """Class to iterate over a list of glXFunctions""" - - def __init__(self, context): - self.iterator = context.functionIterateByOffset() - return - - - def __iter__(self): - return self - - - def next(self): - f = self.iterator.next() - - if f.client_supported_for_indirect(): - return f - else: - return self.next() - - -class glx_api(gl_XML.gl_api): - def functionIterateGlx(self): - return glx_function_iterator(self) - diff --git a/src/mesa/glapi/glX_doc.py b/src/mesa/glapi/glX_doc.py deleted file mode 100644 index e9fbbe6f16..0000000000 --- a/src/mesa/glapi/glX_doc.py +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt - - -class glx_doc_item_factory(glX_proto_common.glx_proto_item_factory): - """Factory to create GLX protocol documentation oriented objects derived from glItem.""" - - def create_item(self, name, element, context): - if name == "parameter": - return glx_doc_parameter(element, context) - else: - return glX_proto_common.glx_proto_item_factory.create_item(self, name, element, context) - - -class glx_doc_parameter(gl_XML.gl_parameter): - def packet_type(self, type_dict): - """Get the type string for the packet header - - GLX protocol documentation uses type names like CARD32, - FLOAT64, LISTofCARD8, and ENUM. This function converts the - type of the parameter to one of these names.""" - - list_of = "" - if self.is_array(): - list_of = "LISTof" - - t_name = self.get_base_type_string() - if not type_dict.has_key( t_name ): - type_name = "CARD8" - else: - type_name = type_dict[ t_name ] - - return "%s%s" % (list_of, type_name) - - - def packet_size(self): - p = None - s = self.size() - if s == 0: - a_prod = "n" - b_prod = self.p_type.size - - if not self.count_parameter_list and self.counter: - a_prod = self.counter - elif self.count_parameter_list and not self.counter or self.is_output: - pass - elif self.count_parameter_list and self.counter: - b_prod = self.counter - else: - raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name)) - - ss = "%s*%s" % (a_prod, b_prod) - - return [ss, p] - else: - if s % 4 != 0: - p = "p" - - return [str(s), p] - -class PrintGlxProtoText(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - self.license = "" - - - def printHeader(self): - return - - - def body_size(self, f): - # At some point, refactor this function and - # glXFunction::command_payload_length. - - size = 0; - size_str = "" - pad_str = "" - plus = "" - for p in f.parameterIterateGlxSend(): - [s, pad] = p.packet_size() - try: - size += int(s) - except Exception,e: - size_str += "%s%s" % (plus, s) - plus = "+" - - if pad != None: - pad_str = pad - - return [size, size_str, pad_str] - - - def print_render_header(self, f): - [size, size_str, pad_str] = self.body_size(f) - size += 4; - - if size_str == "": - s = "%u" % ((size + 3) & ~3) - elif pad_str != "": - s = "%u+%s+%s" % (size, size_str, pad_str) - else: - s = "%u+%s" % (size, size_str) - - print ' 2 %-15s rendering command length' % (s) - print ' 2 %-4u rendering command opcode' % (f.glx_rop) - return - - - def print_single_header(self, f): - [size, size_str, pad_str] = self.body_size(f) - size = ((size + 3) / 4) + 2; - - if f.glx_vendorpriv != 0: - size += 1 - - print ' 1 CARD8 opcode (X assigned)' - print ' 1 %-4u GLX opcode (%s)' % (f.opcode_real_value(), f.opcode_real_name()) - - if size_str == "": - s = "%u" % (size) - elif pad_str != "": - s = "%u+((%s+%s)/4)" % (size, size_str, pad_str) - else: - s = "%u+((%s)/4)" % (size, size_str) - - print ' 2 %-15s request length' % (s) - - if f.glx_vendorpriv != 0: - print ' 4 %-4u vendor specific opcode' % (f.opcode_value()) - - print ' 4 GLX_CONTEXT_TAG context tag' - - return - - - def print_reply(self, f): - print ' =>' - print ' 1 1 reply' - print ' 1 unused' - print ' 2 CARD16 sequence number' - - if f.output == None: - print ' 4 0 reply length' - elif f.reply_always_array: - print ' 4 m reply length' - else: - print ' 4 m reply length, m = (n == 1 ? 0 : n)' - - - output = None - for x in f.parameterIterateOutputs(): - output = x - break - - - unused = 24 - if f.return_type != 'void': - print ' 4 %-15s return value' % (f.return_type) - unused -= 4 - elif output != None: - print ' 4 unused' - unused -= 4 - - if output != None: - print ' 4 CARD32 n' - unused -= 4 - - if output != None: - if not f.reply_always_array: - print '' - print ' if (n = 1) this follows:' - print '' - print ' 4 CARD32 %s' % (output.name) - print ' %-2u unused' % (unused - 4) - print '' - print ' otherwise this follows:' - print '' - - print ' %-2u unused' % (unused) - - [s, pad] = output.packet_size() - print ' %-8s %-15s %s' % (s, output.packet_type( self.type_map ), output.name) - if pad != None: - try: - bytes = int(s) - bytes = 4 - (bytes & 3) - print ' %-8u %-15s unused' % (bytes, "") - except Exception,e: - print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) - else: - print ' %-2u unused' % (unused) - - - def print_body(self, f): - for p in f.parameterIterateGlxSend(): - [s, pad] = p.packet_size() - print ' %-8s %-15s %s' % (s, p.packet_type( self.type_map ), p.name) - if pad != None: - try: - bytes = int(s) - bytes = 4 - (bytes & 3) - print ' %-8u %-15s unused' % (bytes, "") - except Exception,e: - print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s) - - def printBody(self, api): - self.type_map = {} - for t in api.typeIterate(): - self.type_map[ "GL" + t.name ] = t.glx_name - - - # At some point this should be expanded to support pixel - # functions, but I'm not going to lose any sleep over it now. - - for f in api.functionIterateByOffset(): - if f.client_handcode or f.server_handcode or f.vectorequiv or len(f.get_images()): - continue - - - if f.glx_rop: - print ' %s' % (f.name) - self.print_render_header(f) - elif f.glx_sop or f.glx_vendorpriv: - print ' %s' % (f.name) - self.print_single_header(f) - else: - continue - - self.print_body(f) - - if f.needs_reply(): - self.print_reply(f) - - print '' - return - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API( file_name, glx_doc_item_factory() ) - - printer = PrintGlxProtoText() - printer.Print( api ) diff --git a/src/mesa/glapi/glX_proto_common.py b/src/mesa/glapi/glX_proto_common.py deleted file mode 100644 index 6f094e22b3..0000000000 --- a/src/mesa/glapi/glX_proto_common.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML, glX_XML -import string - - -class glx_proto_item_factory(glX_XML.glx_item_factory): - """Factory to create GLX protocol oriented objects derived from gl_item.""" - - def create_item(self, name, element, context): - if name == "type": - return glx_proto_type(element, context) - else: - return glX_XML.glx_item_factory.create_item(self, name, element, context) - - -class glx_proto_type(gl_XML.gl_type): - def __init__(self, element, context): - gl_XML.gl_type.__init__(self, element, context) - - self.glx_name = element.nsProp( "glx_name", None ) - return - - -class glx_print_proto(gl_XML.gl_print_base): - def size_call(self, func, outputs_also = 0): - """Create C code to calculate 'compsize'. - - Creates code to calculate 'compsize'. If the function does - not need 'compsize' to be calculated, None will be - returned.""" - - compsize = None - - for param in func.parameterIterator(): - if outputs_also or not param.is_output: - if param.is_image(): - [dim, w, h, d, junk] = param.get_dimensions() - - compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, param.img_format, param.img_type, param.img_target) - if not param.img_send_null: - compsize = '(%s != NULL) ? %s : 0' % (param.name, compsize) - - return compsize - - elif len(param.count_parameter_list): - parameters = string.join( param.count_parameter_list, "," ) - compsize = "__gl%s_size(%s)" % (func.name, parameters) - - return compsize - - return None - - - def emit_packet_size_calculation(self, f, bias): - # compsize is only used in the command size calculation if - # the function has a non-output parameter that has a non-empty - # counter_parameter_list. - - compsize = self.size_call(f) - if compsize: - print ' const GLuint compsize = %s;' % (compsize) - - if bias: - print ' const GLuint cmdlen = %s - %u;' % (f.command_length(), bias) - else: - print ' const GLuint cmdlen = %s;' % (f.command_length()) - - #print '' - return compsize diff --git a/src/mesa/glapi/glX_proto_recv.py b/src/mesa/glapi/glX_proto_recv.py deleted file mode 100644 index f423c6db08..0000000000 --- a/src/mesa/glapi/glX_proto_recv.py +++ /dev/null @@ -1,554 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt, string - - -class PrintGlxDispatch_h(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_recv.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") - - self.header_tag = "_INDIRECT_DISPATCH_H_" - return - - - def printRealHeader(self): - self.printVisibility( "HIDDEN", "hidden" ) - print 'struct __GLXclientStateRec;' - print '' - return - - - def printBody(self, api): - for func in api.functionIterateAll(): - if not func.ignore and not func.vectorequiv: - if func.glx_rop: - print 'extern HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name) - print 'extern HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name) - elif func.glx_sop or func.glx_vendorpriv: - print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) - print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name) - - if func.glx_sop and func.glx_vendorpriv: - n = func.glx_vendorpriv_names[0] - print 'extern HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) - print 'extern HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n) - - return - - -class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): - def __init__(self, do_swap): - gl_XML.gl_print_base.__init__(self) - self.name = "glX_proto_recv.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") - - self.real_types = [ '', '', 'uint16_t', '', 'uint32_t', '', '', '', 'uint64_t' ] - self.do_swap = do_swap - return - - - def printRealHeader(self): - print '#include ' - print '#include ' - print '#include ' - - print '#include ' - print '#include "indirect_size.h"' - print '#include "indirect_size_get.h"' - print '#include "indirect_dispatch.h"' - print '#include "glxserver.h"' - print '#include "glxbyteorder.h"' - print '#include "indirect_util.h"' - print '#include "singlesize.h"' - print '#include "glapi.h"' - print '#include "glapitable.h"' - print '#include "glthread.h"' - print '#include "dispatch.h"' - print '' - print '#define __GLX_PAD(x) (((x) + 3) & ~3)' - print '' - print 'typedef struct {' - print ' __GLX_PIXEL_3D_HDR;' - print '} __GLXpixel3DHeader;' - print '' - print 'extern GLboolean __glXErrorOccured( void );' - print 'extern void __glXClearErrorOccured( void );' - print '' - print 'static const unsigned dummy_answer[2] = {0, 0};' - print '' - return - - - def printBody(self, api): - if self.do_swap: - self.emit_swap_wrappers(api) - - - for func in api.functionIterateByOffset(): - if not func.ignore and not func.server_handcode and not func.vectorequiv and (func.glx_rop or func.glx_sop or func.glx_vendorpriv): - self.printFunction(func, func.name) - if func.glx_sop and func.glx_vendorpriv: - self.printFunction(func, func.glx_vendorpriv_names[0]) - - - return - - - def printFunction(self, f, name): - if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0): - return - - if not self.do_swap: - base = '__glXDisp' - else: - base = '__glXDispSwap' - - if f.glx_rop: - print 'void %s_%s(GLbyte * pc)' % (base, name) - else: - print 'int %s_%s(__GLXclientState *cl, GLbyte *pc)' % (base, name) - - print '{' - - if f.glx_rop or f.vectorequiv: - self.printRenderFunction(f) - elif f.glx_sop or f.glx_vendorpriv: - if len(f.get_images()) == 0: - self.printSingleFunction(f, name) - else: - print "/* Missing GLX protocol for %s. */" % (name) - - print '}' - print '' - return - - - def swap_name(self, bytes): - return 'bswap_%u_array' % (8 * bytes) - - - def emit_swap_wrappers(self, api): - self.type_map = {} - already_done = [ ] - - for t in api.typeIterate(): - te = t.get_type_expression() - t_size = te.get_element_size() - - if t_size > 1 and t.glx_name: - - t_name = "GL" + t.name - self.type_map[ t_name ] = t.glx_name - - if t.glx_name not in already_done: - real_name = self.real_types[t_size] - - print 'static %s' % (t_name) - print 'bswap_%s( const void * src )' % (t.glx_name) - print '{' - print ' union { %s dst; %s ret; } x;' % (real_name, t_name) - print ' x.dst = bswap_%u( *(%s *) src );' % (t_size * 8, real_name) - print ' return x.ret;' - print '}' - print '' - already_done.append( t.glx_name ) - - for bits in [16, 32, 64]: - print 'static void *' - print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits) - print '{' - print ' unsigned i;' - print '' - print ' for ( i = 0 ; i < count ; i++ ) {' - print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits) - print ' src[i] = temp;' - print ' }' - print '' - print ' return src;' - print '}' - print '' - - - def fetch_param(self, param): - t = param.type_string() - o = param.offset - element_size = param.size() / param.get_element_count() - - if self.do_swap and (element_size != 1): - if param.is_array(): - real_name = self.real_types[ element_size ] - - swap_func = self.swap_name( element_size ) - return ' (%-8s)%s( (%s *) (pc + %2s), %s )' % (t, swap_func, real_name, o, param.count) - else: - t_name = param.get_base_type_string() - return ' (%-8s)bswap_%-7s( pc + %2s )' % (t, self.type_map[ t_name ], o) - else: - if param.is_array(): - return ' (%-8s)(pc + %2u)' % (t, o) - else: - return '*(%-8s *)(pc + %2u)' % (t, o) - - return None - - - def emit_function_call(self, f, retval_assign, indent): - list = [] - - for param in f.parameterIterator(): - if param.is_padding: - continue - - if param.is_counter or param.is_image() or param.is_output or param.name in f.count_parameter_list or len(param.count_parameter_list): - location = param.name - else: - location = self.fetch_param(param) - - list.append( '%s %s' % (indent, location) ) - - - if len( list ): - print '%s %sCALL_%s( GET_DISPATCH(), (' % (indent, retval_assign, f.name) - print string.join( list, ",\n" ) - print '%s ) );' % (indent) - else: - print '%s %sCALL_%s( GET_DISPATCH(), () );' % (indent, retval_assign, f.name) - return - - - def common_func_print_just_start(self, f, indent): - align64 = 0 - need_blank = 0 - - - f.calculate_offsets() - for param in f.parameterIterateGlxSend(): - # If any parameter has a 64-bit base type, then we - # have to do alignment magic for the while thing. - - if param.is_64_bit(): - align64 = 1 - - - # FIXME img_null_flag is over-loaded. In addition to - # FIXME being used for images, it is used to signify - # FIXME NULL data pointers for vertex buffer object - # FIXME related functions. Re-name it to null_data - # FIXME or something similar. - - if param.img_null_flag: - print '%s const CARD32 ptr_is_null = *(CARD32 *)(pc + %s);' % (indent, param.offset - 4) - cond = '(ptr_is_null != 0) ? NULL : ' - else: - cond = "" - - - type_string = param.type_string() - - if param.is_image(): - offset = f.offset_of( param.name ) - - print '%s %s const %s = (%s) (%s(pc + %s));' % (indent, type_string, param.name, type_string, cond, offset) - - if param.depth: - print '%s __GLXpixel3DHeader * const hdr = (__GLXpixel3DHeader *)(pc);' % (indent) - else: - print '%s __GLXpixelHeader * const hdr = (__GLXpixelHeader *)(pc);' % (indent) - - need_blank = 1 - elif param.is_counter or param.name in f.count_parameter_list: - location = self.fetch_param(param) - print '%s const %s %s = %s;' % (indent, type_string, param.name, location) - need_blank = 1 - elif len(param.count_parameter_list): - if param.size() == 1 and not self.do_swap: - location = self.fetch_param(param) - print '%s %s %s = %s%s;' % (indent, type_string, param.name, cond, location) - else: - print '%s %s %s;' % (indent, type_string, param.name) - need_blank = 1 - - - - if need_blank: - print '' - - if align64: - print '#ifdef __GLX_ALIGN64' - - if f.has_variable_size_request(): - self.emit_packet_size_calculation(f, 4) - s = "cmdlen" - else: - s = str((f.command_fixed_length() + 3) & ~3) - - print ' if ((unsigned long)(pc) & 7) {' - print ' (void) memmove(pc-4, pc, %s);' % (s) - print ' pc -= 4;' - print ' }' - print '#endif' - print '' - - - need_blank = 0 - if self.do_swap: - for param in f.parameterIterateGlxSend(): - if param.count_parameter_list: - o = param.offset - count = param.get_element_count() - type_size = param.size() / count - - if param.counter: - count_name = param.counter - else: - count_name = str(count) - - # This is basically an ugly special- - # case for glCallLists. - - if type_size == 1: - x = [] - x.append( [1, ['BYTE', 'UNSIGNED_BYTE', '2_BYTES', '3_BYTES', '4_BYTES']] ) - x.append( [2, ['SHORT', 'UNSIGNED_SHORT']] ) - x.append( [4, ['INT', 'UNSIGNED_INT', 'FLOAT']] ) - - print ' switch(%s) {' % (param.count_parameter_list[0]) - for sub in x: - for t_name in sub[1]: - print ' case GL_%s:' % (t_name) - - if sub[0] == 1: - print ' %s = (%s) (pc + %s); break;' % (param.name, param.type_string(), o) - else: - swap_func = self.swap_name(sub[0]) - print ' %s = (%s) %s( (%s *) (pc + %s), %s ); break;' % (param.name, param.type_string(), swap_func, self.real_types[sub[0]], o, count_name) - print ' default:' - print ' return;' - print ' }' - else: - swap_func = self.swap_name(type_size) - compsize = self.size_call(f, 1) - print ' %s = (%s) %s( (%s *) (pc + %s), %s );' % (param.name, param.type_string(), swap_func, self.real_types[type_size], o, compsize) - - need_blank = 1 - - else: - for param in f.parameterIterateGlxSend(): - if param.count_parameter_list: - print '%s %s = (%s) (pc + %s);' % (indent, param.name, param.type_string(), param.offset) - need_blank = 1 - - - if need_blank: - print '' - - - return - - - def printSingleFunction(self, f, name): - if name not in f.glx_vendorpriv_names: - print ' xGLXSingleReq * const req = (xGLXSingleReq *) pc;' - else: - print ' xGLXVendorPrivateReq * const req = (xGLXVendorPrivateReq *) pc;' - - print ' int error;' - - if self.do_swap: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' - else: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);' - - print '' - if name not in f.glx_vendorpriv_names: - print ' pc += __GLX_SINGLE_HDR_SIZE;' - else: - print ' pc += __GLX_VENDPRIV_HDR_SIZE;' - - print ' if ( cx != NULL ) {' - self.common_func_print_just_start(f, " ") - - - if f.return_type != 'void': - print ' %s retval;' % (f.return_type) - retval_string = "retval" - retval_assign = "retval = " - else: - retval_string = "0" - retval_assign = "" - - - type_size = 0 - answer_string = "dummy_answer" - answer_count = "0" - is_array_string = "GL_FALSE" - - for param in f.parameterIterateOutputs(): - answer_type = param.get_base_type_string() - if answer_type == "GLvoid": - answer_type = "GLubyte" - - - c = param.get_element_count() - type_size = (param.size() / c) - if type_size == 1: - size_scale = "" - else: - size_scale = " * %u" % (type_size) - - - if param.count_parameter_list: - print ' const GLuint compsize = %s;' % (self.size_call(f, 1)) - print ' %s answerBuffer[200];' % (answer_type) - print ' %s %s = __glXGetAnswerBuffer(cl, compsize%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, size_scale, type_size ) - answer_string = param.name - answer_count = "compsize" - - print '' - print ' if (%s == NULL) return BadAlloc;' % (param.name) - print ' __glXClearErrorOccured();' - print '' - elif param.counter: - print ' %s answerBuffer[200];' % (answer_type) - print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, param.counter, size_scale, type_size) - answer_string = param.name - answer_count = param.counter - elif c >= 1: - print ' %s %s[%u];' % (answer_type, param.name, c) - answer_string = param.name - answer_count = "%u" % (c) - - if f.reply_always_array: - is_array_string = "GL_TRUE" - - - self.emit_function_call(f, retval_assign, " ") - - - if f.needs_reply(): - if self.do_swap: - for param in f.parameterIterateOutputs(): - c = param.get_element_count() - type_size = (param.size() / c) - - if type_size > 1: - swap_name = self.swap_name( type_size ) - print ' (void) %s( (uint%u_t *) %s, %s );' % (swap_name, 8 * type_size, param.name, answer_count) - - - reply_func = '__glXSendReplySwap' - else: - reply_func = '__glXSendReply' - - print ' %s(cl->client, %s, %s, %u, %s, %s);' % (reply_func, answer_string, answer_count, type_size, is_array_string, retval_string) - #elif f.note_unflushed: - # print ' cx->hasUnflushedCommands = GL_TRUE;' - - print ' error = Success;' - print ' }' - print '' - print ' return error;' - return - - - def printRenderFunction(self, f): - # There are 4 distinct phases in a rendering dispatch function. - # In the first phase we compute the sizes and offsets of each - # element in the command. In the second phase we (optionally) - # re-align 64-bit data elements. In the third phase we - # (optionally) byte-swap array data. Finally, in the fourth - # phase we actually dispatch the function. - - self.common_func_print_just_start(f, "") - - images = f.get_images() - if len(images): - if self.do_swap: - pre = "bswap_CARD32( & " - post = " )" - else: - pre = "" - post = "" - - img = images[0] - - # swapBytes and lsbFirst are single byte fields, so - # the must NEVER be byte-swapped. - - if not (img.img_type == "GL_BITMAP" and img.img_format == "GL_COLOR_INDEX"): - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SWAP_BYTES, hdr->swapBytes) );' - - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_LSB_FIRST, hdr->lsbFirst) );' - - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ROW_LENGTH, (GLint) %shdr->rowLength%s) );' % (pre, post) - if img.depth: - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_IMAGE_HEIGHT, (GLint) %shdr->imageHeight%s) );' % (pre, post) - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, (GLint) %shdr->skipRows%s) );' % (pre, post) - if img.depth: - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_IMAGES, (GLint) %shdr->skipImages%s) );' % (pre, post) - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, (GLint) %shdr->skipPixels%s) );' % (pre, post) - print ' CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_ALIGNMENT, (GLint) %shdr->alignment%s) );' % (pre, post) - print '' - - - self.emit_function_call(f, "", "") - return - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s") - except Exception,e: - show_usage() - - mode = "dispatch_c" - do_swap = 0 - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - elif arg == "-s": - do_swap = 1 - - if mode == "dispatch_c": - printer = PrintGlxDispatchFunctions(do_swap) - elif mode == "dispatch_h": - printer = PrintGlxDispatch_h() - else: - show_usage() - - api = gl_XML.parse_GL_API( file_name, glX_proto_common.glx_proto_item_factory() ) - - printer.Print( api ) diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py deleted file mode 100644 index daca1b767a..0000000000 --- a/src/mesa/glapi/glX_proto_send.py +++ /dev/null @@ -1,1042 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick -# Jeremy Kolb - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt, copy, string - -def convertStringForXCB(str): - tmp = "" - special = [ "ARB" ] - i = 0 - while i < len(str): - if str[i:i+3] in special: - tmp = '%s_%s' % (tmp, string.lower(str[i:i+3])) - i = i + 2; - elif str[i].isupper(): - tmp = '%s_%s' % (tmp, string.lower(str[i])) - else: - tmp = '%s%s' % (tmp, str[i]) - i += 1 - return tmp - -def hash_pixel_function(func): - """Generate a 'unique' key for a pixel function. The key is based on - the parameters written in the command packet. This includes any - padding that might be added for the original function and the 'NULL - image' flag.""" - - - h = "" - hash_pre = "" - hash_suf = "" - for param in func.parameterIterateGlxSend(): - if param.is_image(): - [dim, junk, junk, junk, junk] = param.get_dimensions() - - d = (dim + 1) & ~1 - hash_pre = "%uD%uD_" % (d - 1, d) - - if param.img_null_flag: - hash_suf = "_NF" - - h += "%u" % (param.size()) - - if func.pad_after(param): - h += "4" - - - n = func.name.replace("%uD" % (dim), "") - n = "__glx_%s_%uD%uD" % (n, d - 1, d) - - h = hash_pre + h + hash_suf - return [h, n] - - -class glx_pixel_function_stub(glX_XML.glx_function): - """Dummy class used to generate pixel "utility" functions that are - shared by multiple dimension image functions. For example, these - objects are used to generate shared functions used to send GLX - protocol for TexImage1D and TexImage2D, TexSubImage1D and - TexSubImage2D, etc.""" - - def __init__(self, func, name): - # The parameters to the utility function are the same as the - # parameters to the real function except for the added "pad" - # parameters. - - self.name = name - self.images = [] - self.parameters = [] - self.parameters_by_name = {} - for _p in func.parameterIterator(): - p = copy.copy(_p) - self.parameters.append(p) - self.parameters_by_name[ p.name ] = p - - - if p.is_image(): - self.images.append(p) - p.height = "height" - - if p.img_yoff == None: - p.img_yoff = "yoffset" - - if p.depth: - if p.extent == None: - p.extent = "extent" - - if p.img_woff == None: - p.img_woff = "woffset" - - - pad_name = func.pad_after(p) - if pad_name: - pad = copy.copy(p) - pad.name = pad_name - self.parameters.append(pad) - self.parameters_by_name[ pad.name ] = pad - - - self.return_type = func.return_type - - self.glx_rop = ~0 - self.glx_sop = 0 - self.glx_vendorpriv = 0 - - self.glx_doubles_in_order = func.glx_doubles_in_order - - self.vectorequiv = None - self.output = None - self.can_be_large = func.can_be_large - self.reply_always_array = func.reply_always_array - self.dimensions_in_reply = func.dimensions_in_reply - self.img_reset = None - - self.server_handcode = 0 - self.client_handcode = 0 - self.ignore = 0 - - self.count_parameter_list = func.count_parameter_list - self.counter_list = func.counter_list - self.offsets_calculated = 0 - return - - -class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): - def __init__(self): - glX_proto_common.glx_print_proto.__init__(self) - self.name = "glX_proto_send.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004, 2005", "IBM") - - - self.last_category = "" - self.generic_sizes = [3, 4, 6, 8, 12, 16, 24, 32] - self.pixel_stubs = {} - self.debug = 0 - return - - def printRealHeader(self): - print '' - print '#include ' - print '#include "indirect.h"' - print '#include "glxclient.h"' - print '#include "indirect_size.h"' - print '#include "dispatch.h"' - print '#include "glapi.h"' - print '#include "glthread.h"' - print '#include ' - print '#ifdef USE_XCB' - print '#include ' - print '#include ' - print '#include ' - print '#endif /* USE_XCB */' - - print '' - print '#define __GLX_PAD(n) (((n) + 3) & ~3)' - print '' - self.printFastcall() - self.printNoinline() - print '' - print '#if !defined __GNUC__ || __GNUC__ < 3' - print '# define __builtin_expect(x, y) x' - print '#endif' - print '' - print '/* If the size and opcode values are known at compile-time, this will, on' - print ' * x86 at least, emit them with a single instruction.' - print ' */' - print '#define emit_header(dest, op, size) \\' - print ' do { union { short s[2]; int i; } temp; \\' - print ' temp.s[0] = (size); temp.s[1] = (op); \\' - print ' *((int *)(dest)) = temp.i; } while(0)' - print '' - print """NOINLINE CARD32 -__glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ) -{ - xGLXSingleReply reply; - - (void) _XReply(dpy, (xReply *) & reply, 0, False); - if (size != 0) { - if ((reply.length > 0) || reply_is_always_array) { - const GLint bytes = (reply_is_always_array) - ? (4 * reply.length) : (reply.size * size); - const GLint extra = 4 - (bytes & 3); - - _XRead(dpy, dest, bytes); - if ( extra < 4 ) { - _XEatData(dpy, extra); - } - } - else { - (void) memcpy( dest, &(reply.pad3), size); - } - } - - return reply.retval; -} - -NOINLINE void -__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, - GLint width, GLint height, GLint depth, GLenum format, GLenum type, - void * dest, GLboolean dimensions_in_reply ) -{ - xGLXSingleReply reply; - GLint size; - - (void) _XReply(dpy, (xReply *) & reply, 0, False); - - if ( dimensions_in_reply ) { - width = reply.pad3; - height = reply.pad4; - depth = reply.pad5; - - if ((height == 0) || (max_dim < 2)) { height = 1; } - if ((depth == 0) || (max_dim < 3)) { depth = 1; } - } - - size = reply.length * 4; - if (size != 0) { - void * buf = Xmalloc( size ); - - if ( buf == NULL ) { - _XEatData(dpy, size); - __glXSetError(gc, GL_OUT_OF_MEMORY); - } - else { - const GLint extra = 4 - (size & 3); - - _XRead(dpy, buf, size); - if ( extra < 4 ) { - _XEatData(dpy, extra); - } - - __glEmptyImage(gc, 3, width, height, depth, format, type, - buf, dest); - Xfree(buf); - } - } -} - -#define X_GLXSingle 0 - -NOINLINE FASTCALL GLubyte * -__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) -{ - xGLXSingleReq * req; - Display * const dpy = gc->currentDpy; - - (void) __glXFlushRenderBuffer(gc, gc->pc); - LockDisplay(dpy); - GetReqExtra(GLXSingle, cmdlen, req); - req->reqType = gc->majorOpcode; - req->contextTag = gc->currentContextTag; - req->glxCode = sop; - return (GLubyte *)(req) + sz_xGLXSingleReq; -} - -NOINLINE FASTCALL GLubyte * -__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) -{ - xGLXVendorPrivateReq * req; - Display * const dpy = gc->currentDpy; - - (void) __glXFlushRenderBuffer(gc, gc->pc); - LockDisplay(dpy); - GetReqExtra(GLXVendorPrivate, cmdlen, req); - req->reqType = gc->majorOpcode; - req->glxCode = code; - req->vendorCode = vop; - req->contextTag = gc->currentContextTag; - return (GLubyte *)(req) + sz_xGLXVendorPrivateReq; -} - -const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; - -#define zero (__glXDefaultPixelStore+0) -#define one (__glXDefaultPixelStore+8) -#define default_pixel_store_1D (__glXDefaultPixelStore+4) -#define default_pixel_store_1D_size 20 -#define default_pixel_store_2D (__glXDefaultPixelStore+4) -#define default_pixel_store_2D_size 20 -#define default_pixel_store_3D (__glXDefaultPixelStore+0) -#define default_pixel_store_3D_size 36 -#define default_pixel_store_4D (__glXDefaultPixelStore+0) -#define default_pixel_store_4D_size 36 -""" - - for size in self.generic_sizes: - self.print_generic_function(size) - return - - - def printBody(self, api): - - self.pixel_stubs = {} - generated_stubs = [] - - for func in api.functionIterateGlx(): - if func.client_handcode: continue - - # If the function is a pixel function with a certain - # GLX protocol signature, create a fake stub function - # for it. For example, create a single stub function - # that is used to implement both glTexImage1D and - # glTexImage2D. - - if func.glx_rop != 0: - do_it = 0 - for image in func.get_images(): - if image.img_pad_dimensions: - do_it = 1 - break - - - if do_it: - [h, n] = hash_pixel_function(func) - - - self.pixel_stubs[ func.name ] = n - if h not in generated_stubs: - generated_stubs.append(h) - - fake_func = glx_pixel_function_stub( func, n ) - self.printFunction(fake_func, fake_func.name) - - - self.printFunction(func, func.name) - if func.glx_sop and func.glx_vendorpriv: - self.printFunction(func, func.glx_vendorpriv_names[0]) - - return - - - def printFunction(self, func, name): - footer = '}\n' - if func.glx_rop == ~0: - print 'static %s' % (func.return_type) - print '%s( unsigned opcode, unsigned dim, %s )' % (func.name, func.get_parameter_string()) - print '{' - else: - if func.has_different_protocol(name): - if func.return_type == "void": - ret_string = '' - else: - ret_string = "return " - - func_name = func.static_glx_name(name) - print '#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv) - print '%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()) - print '{' - print ' __GLXcontext * const gc = __glXGetCurrentContext();' - print '' - print '#ifdef GLX_DIRECT_RENDERING' - print ' if (gc->driContext) {' - print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) - print ' } else' - print '#endif' - print ' {' - - footer = '}\n}\n' - else: - print '#define %s %d' % (func.opcode_name(), func.opcode_value()) - - print '%s __indirect_gl%s(%s)' % (func.return_type, name, func.get_parameter_string()) - print '{' - - - if func.glx_rop != 0 or func.vectorequiv != None: - if len(func.images): - self.printPixelFunction(func) - else: - self.printRenderFunction(func) - elif func.glx_sop != 0 or func.glx_vendorpriv != 0: - self.printSingleFunction(func, name) - pass - else: - print "/* Missing GLX protocol for %s. */" % (name) - - print footer - return - - - def print_generic_function(self, n): - size = (n + 3) & ~3 - print """static FASTCALL NOINLINE void -generic_%u_byte( GLint rop, const void * ptr ) -{ - __GLXcontext * const gc = __glXGetCurrentContext(); - const GLuint cmdlen = %u; - - emit_header(gc->pc, rop, cmdlen); - (void) memcpy((void *)(gc->pc + 4), ptr, %u); - gc->pc += cmdlen; - if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); } -} -""" % (n, size + 4, size) - return - - - def common_emit_one_arg(self, p, pc, adjust, extra_offset): - if p.is_array(): - src_ptr = p.name - else: - src_ptr = "&" + p.name - - if p.is_padding: - print '(void) memset((void *)(%s + %u), 0, %s);' \ - % (pc, p.offset + adjust, p.size_string() ) - elif not extra_offset: - print '(void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \ - % (pc, p.offset + adjust, src_ptr, p.size_string() ) - else: - print '(void) memcpy((void *)(%s + %u + %s), (void *)(%s), %s);' \ - % (pc, p.offset + adjust, extra_offset, src_ptr, p.size_string() ) - - def common_emit_args(self, f, pc, adjust, skip_vla): - extra_offset = None - - for p in f.parameterIterateGlxSend( not skip_vla ): - if p.name != f.img_reset: - self.common_emit_one_arg(p, pc, adjust, extra_offset) - - if p.is_variable_length(): - temp = p.size_string() - if extra_offset: - extra_offset += " + %s" % (temp) - else: - extra_offset = temp - - return - - - def pixel_emit_args(self, f, pc, large): - """Emit the arguments for a pixel function. This differs from - common_emit_args in that pixel functions may require padding - be inserted (i.e., for the missing width field for - TexImage1D), and they may also require a 'NULL image' flag - be inserted before the image data.""" - - if large: - adjust = 8 - else: - adjust = 4 - - for param in f.parameterIterateGlxSend(): - if not param.is_image(): - self.common_emit_one_arg(param, pc, adjust, None) - - if f.pad_after(param): - print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset + param.size()) + adjust) - - else: - [dim, width, height, depth, extent] = param.get_dimensions() - if f.glx_rop == ~0: - dim_str = "dim" - else: - dim_str = str(dim) - - if param.is_padding: - print '(void) memset((void *)(%s + %u), 0, %s);' \ - % (pc, (param.offset - 4) + adjust, param.size_string() ) - - if param.img_null_flag: - if large: - print '(void) memcpy((void *)(%s + %u), zero, 4);' % (pc, (param.offset - 4) + adjust) - else: - print '(void) memcpy((void *)(%s + %u), (void *)((%s == NULL) ? one : zero), 4);' % (pc, (param.offset - 4) + adjust, param.name) - - - pixHeaderPtr = "%s + %u" % (pc, adjust) - pcPtr = "%s + %u" % (pc, param.offset + adjust) - - if not large: - if param.img_send_null: - condition = '(compsize > 0) && (%s != NULL)' % (param.name) - else: - condition = 'compsize > 0' - - print 'if (%s) {' % (condition) - print ' (*gc->fillImage)(gc, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) - print '} else {' - print ' (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (pixHeaderPtr, dim, dim) - print '}' - else: - print '__glXSendLargeImage(gc, compsize, %s, %s, %s, %s, %s, %s, %s, %s, %s);' % (dim_str, width, height, depth, param.img_format, param.img_type, param.name, pcPtr, pixHeaderPtr) - - return - - - def large_emit_begin(self, f, op_name = None): - if not op_name: - op_name = f.opcode_real_name() - - print 'const GLint op = %s;' % (op_name) - print 'const GLuint cmdlenLarge = cmdlen + 4;' - print 'GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);' - print '(void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);' - print '(void) memcpy((void *)(pc + 4), (void *)(&op), 4);' - return - - - def common_func_print_just_start(self, f, name): - print ' __GLXcontext * const gc = __glXGetCurrentContext();' - - # The only reason that single and vendor private commands need - # a variable called 'dpy' is becuase they use the SyncHandle - # macro. For whatever brain-dead reason, that macro is hard- - # coded to use a variable called 'dpy' instead of taking a - # parameter. - - # FIXME Simplify the logic related to skip_condition and - # FIXME condition_list in this function. Basically, remove - # FIXME skip_condition, and just append the "dpy != NULL" type - # FIXME condition to condition_list from the start. The only - # FIXME reason it's done in this confusing way now is to - # FIXME minimize the diffs in the generated code. - - if not f.glx_rop: - for p in f.parameterIterateOutputs(): - if p.is_image() and (p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP"): - print ' const __GLXattribute * const state = gc->client_state_private;' - break - - print ' Display * const dpy = gc->currentDpy;' - skip_condition = "dpy != NULL" - elif f.can_be_large: - skip_condition = "gc->currentDpy != NULL" - else: - skip_condition = None - - - if f.return_type != 'void': - print ' %s retval = (%s) 0;' % (f.return_type, f.return_type) - - - if name != None and name not in f.glx_vendorpriv_names: - print '#ifndef USE_XCB' - self.emit_packet_size_calculation(f, 0) - if name != None and name not in f.glx_vendorpriv_names: - print '#endif' - - condition_list = [] - for p in f.parameterIterateCounters(): - condition_list.append( "%s >= 0" % (p.name) ) - # 'counter' parameters cannot be negative - print " if (%s < 0) {" % p.name - print " __glXSetError(gc, GL_INVALID_VALUE);" - if f.return_type != 'void': - print " return 0;" - else: - print " return;" - print " }" - - if skip_condition: - condition_list.append( skip_condition ) - - if len( condition_list ) > 0: - if len( condition_list ) > 1: - skip_condition = "(%s)" % (string.join( condition_list, ") && (" )) - else: - skip_condition = "%s" % (condition_list.pop(0)) - - print ' if (__builtin_expect(%s, 1)) {' % (skip_condition) - return 1 - else: - return 0 - - - def printSingleFunction(self, f, name): - self.common_func_print_just_start(f, name) - - if self.debug: - print ' printf( "Enter %%s...\\n", "gl%s" );' % (f.name) - - if name not in f.glx_vendorpriv_names: - - # XCB specific: - print '#ifdef USE_XCB' - if self.debug: - print ' printf("\\tUsing XCB.\\n");' - print ' xcb_connection_t *c = XGetXCBConnection(dpy);' - print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' - xcb_name = 'xcb_glx%s' % convertStringForXCB(name) - - iparams=[] - extra_iparams = [] - output = None - for p in f.parameterIterator(): - if p.is_output: - output = p - - if p.is_image(): - if p.img_format != "GL_COLOR_INDEX" or p.img_type != "GL_BITMAP": - extra_iparams.append("state->storePack.swapEndian") - else: - extra_iparams.append("0") - - # Hardcode this in. lsb_first param (apparently always GL_FALSE) - # also present in GetPolygonStipple, but taken care of above. - if xcb_name == "xcb_glx_read_pixels": - extra_iparams.append("0") - else: - iparams.append(p.name) - - - xcb_request = '%s(%s)' % (xcb_name, ", ".join(["c", "gc->currentContextTag"] + iparams + extra_iparams)) - - if f.needs_reply(): - print ' %s_reply_t *reply = %s_reply(c, %s, NULL);' % (xcb_name, xcb_name, xcb_request) - if output and f.reply_always_array: - print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) - - elif output and not f.reply_always_array: - if not output.is_image(): - print ' if (%s_data_length(reply) == 0)' % (xcb_name) - print ' (void)memcpy(%s, &reply->datum, sizeof(reply->datum));' % (output.name) - print ' else' - print ' (void)memcpy(%s, %s_data(reply), %s_data_length(reply) * sizeof(%s));' % (output.name, xcb_name, xcb_name, output.get_base_type_string()) - - - if f.return_type != 'void': - print ' retval = reply->ret_val;' - print ' free(reply);' - else: - print ' ' + xcb_request + ';' - print '#else' - # End of XCB specific. - - - if f.parameters != []: - pc_decl = "GLubyte const * pc =" - else: - pc_decl = "(void)" - - if name in f.glx_vendorpriv_names: - print ' %s __glXSetupVendorRequest(gc, %s, %s, cmdlen);' % (pc_decl, f.opcode_real_name(), f.opcode_vendor_name(name)) - else: - print ' %s __glXSetupSingleRequest(gc, %s, cmdlen);' % (pc_decl, f.opcode_name()) - - self.common_emit_args(f, "pc", 0, 0) - - images = f.get_images() - - for img in images: - if img.is_output: - o = f.command_fixed_length() - 4 - print ' *(int32_t *)(pc + %u) = 0;' % (o) - if img.img_format != "GL_COLOR_INDEX" or img.img_type != "GL_BITMAP": - print ' * (int8_t *)(pc + %u) = state->storePack.swapEndian;' % (o) - - if f.img_reset: - print ' * (int8_t *)(pc + %u) = %s;' % (o + 1, f.img_reset) - - - return_name = '' - if f.needs_reply(): - if f.return_type != 'void': - return_name = " retval" - return_str = " retval = (%s)" % (f.return_type) - else: - return_str = " (void)" - - got_reply = 0 - - for p in f.parameterIterateOutputs(): - if p.is_image(): - [dim, w, h, d, junk] = p.get_dimensions() - if f.dimensions_in_reply: - print " __glXReadPixelReply(dpy, gc, %u, 0, 0, 0, %s, %s, %s, GL_TRUE);" % (dim, p.img_format, p.img_type, p.name) - else: - print " __glXReadPixelReply(dpy, gc, %u, %s, %s, %s, %s, %s, %s, GL_FALSE);" % (dim, w, h, d, p.img_format, p.img_type, p.name) - - got_reply = 1 - else: - if f.reply_always_array: - aa = "GL_TRUE" - else: - aa = "GL_FALSE" - - # gl_parameter.size() returns the size - # of the entire data item. If the - # item is a fixed-size array, this is - # the size of the whole array. This - # is not what __glXReadReply wants. It - # wants the size of a single data - # element in the reply packet. - # Dividing by the array size (1 for - # non-arrays) gives us this. - - s = p.size() / p.get_element_count() - print " %s __glXReadReply(dpy, %s, %s, %s);" % (return_str, s, p.name, aa) - got_reply = 1 - - - # If a reply wasn't read to fill an output parameter, - # read a NULL reply to get the return value. - - if not got_reply: - print " %s __glXReadReply(dpy, 0, NULL, GL_FALSE);" % (return_str) - - - elif self.debug: - # Only emit the extra glFinish call for functions - # that don't already require a reply from the server. - print ' __indirect_glFinish();' - - if self.debug: - print ' printf( "Exit %%s.\\n", "gl%s" );' % (name) - - - print ' UnlockDisplay(dpy); SyncHandle();' - - if name not in f.glx_vendorpriv_names: - print '#endif /* USE_XCB */' - - print ' }' - print ' return%s;' % (return_name) - return - - - def printPixelFunction(self, f): - if self.pixel_stubs.has_key( f.name ): - # Normally gl_function::get_parameter_string could be - # used. However, this call needs to have the missing - # dimensions (e.g., a fake height value for - # glTexImage1D) added in. - - p_string = "" - for param in f.parameterIterateGlxSend(): - if param.is_padding: - continue - - p_string += ", " + param.name - - if param.is_image(): - [dim, junk, junk, junk, junk] = param.get_dimensions() - - if f.pad_after(param): - p_string += ", 1" - - print ' %s(%s, %u%s );' % (self.pixel_stubs[f.name] , f.opcode_name(), dim, p_string) - return - - - if self.common_func_print_just_start(f, None): - trailer = " }" - else: - trailer = None - - - if f.can_be_large: - print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' - print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' - print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' - print ' }' - - if f.glx_rop == ~0: - opcode = "opcode" - else: - opcode = f.opcode_real_name() - - print 'emit_header(gc->pc, %s, cmdlen);' % (opcode) - - self.pixel_emit_args( f, "gc->pc", 0 ) - print 'gc->pc += cmdlen;' - print 'if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' - - if f.can_be_large: - print '}' - print 'else {' - - self.large_emit_begin(f, opcode) - self.pixel_emit_args(f, "pc", 1) - - print '}' - - if trailer: print trailer - return - - - def printRenderFunction(self, f): - # There is a class of GL functions that take a single pointer - # as a parameter. This pointer points to a fixed-size chunk - # of data, and the protocol for this functions is very - # regular. Since they are so regular and there are so many - # of them, special case them with generic functions. On - # x86, this saves about 26KB in the libGL.so binary. - - if f.variable_length_parameter() == None and len(f.parameters) == 1: - p = f.parameters[0] - if p.is_pointer(): - cmdlen = f.command_fixed_length() - if cmdlen in self.generic_sizes: - print ' generic_%u_byte( %s, %s );' % (cmdlen, f.opcode_real_name(), p.name) - return - - if self.common_func_print_just_start(f, None): - trailer = " }" - else: - trailer = None - - if self.debug: - print 'printf( "Enter %%s...\\n", "gl%s" );' % (f.name) - - if f.can_be_large: - print 'if (cmdlen <= gc->maxSmallRenderCommandSize) {' - print ' if ( (gc->pc + cmdlen) > gc->bufEnd ) {' - print ' (void) __glXFlushRenderBuffer(gc, gc->pc);' - print ' }' - - print 'emit_header(gc->pc, %s, cmdlen);' % (f.opcode_real_name()) - - self.common_emit_args(f, "gc->pc", 4, 0) - print 'gc->pc += cmdlen;' - print 'if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' - - if f.can_be_large: - print '}' - print 'else {' - - self.large_emit_begin(f) - self.common_emit_args(f, "pc", 8, 1) - - p = f.variable_length_parameter() - print ' __glXSendLargeCommand(gc, pc, %u, %s, %s);' % (p.offset + 8, p.name, p.size_string()) - print '}' - - if self.debug: - print '__indirect_glFinish();' - print 'printf( "Exit %%s.\\n", "gl%s" );' % (f.name) - - if trailer: print trailer - return - - -class PrintGlxProtoInit_c(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_send.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") - return - - - def printRealHeader(self): - print """/** - * \\file indirect_init.c - * Initialize indirect rendering dispatch table. - * - * \\author Kevin E. Martin - * \\author Brian Paul - * \\author Ian Romanick - */ - -#include "indirect_init.h" -#include "indirect.h" -#include "glapi.h" - - -/** - * No-op function used to initialize functions that have no GLX protocol - * support. - */ -static int NoOp(void) -{ - return 0; -} - -/** - * Create and initialize a new GL dispatch table. The table is initialized - * with GLX indirect rendering protocol functions. - */ -__GLapi * __glXNewIndirectAPI( void ) -{ - __GLapi *glAPI; - GLuint entries; - - entries = _glapi_get_dispatch_table_size(); - glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); - - /* first, set all entries to point to no-op functions */ - { - int i; - void **dispatch = (void **) glAPI; - for (i = 0; i < entries; i++) { - dispatch[i] = (void *) NoOp; - } - } - - /* now, initialize the entries we understand */""" - - def printRealFooter(self): - print """ - return glAPI; -} -""" - return - - - def printBody(self, api): - for [name, number] in api.categoryIterate(): - if number != None: - preamble = '\n /* %3u. %s */\n\n' % (int(number), name) - else: - preamble = '\n /* %s */\n\n' % (name) - - for func in api.functionIterateByCategory(name): - if func.client_supported_for_indirect(): - print '%s glAPI->%s = __indirect_gl%s;' % (preamble, func.name, func.name) - preamble = '' - - return - - -class PrintGlxProtoInit_h(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_send.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM") - self.header_tag = "_INDIRECT_H_" - - self.last_category = "" - return - - - def printRealHeader(self): - print """/** - * \\file - * Prototypes for indirect rendering functions. - * - * \\author Kevin E. Martin - * \\author Ian Romanick - */ -""" - self.printVisibility( "HIDDEN", "hidden" ) - self.printFastcall() - self.printNoinline() - - print """ -#include "glxclient.h" - -extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, - void * dest, GLboolean reply_is_always_array ); - -extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, - __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, - GLint depth, GLenum format, GLenum type, void * dest, - GLboolean dimensions_in_reply ); - -extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( - __GLXcontext * gc, GLint sop, GLint cmdlen ); - -extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( - __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); -""" - - - def printBody(self, api): - for func in api.functionIterateGlx(): - params = func.get_parameter_string() - - print 'extern HIDDEN %s __indirect_gl%s(%s);' % (func.return_type, func.name, params) - - for n in func.entry_points: - if func.has_different_protocol(n): - asdf = func.static_glx_name(n) - if asdf not in func.static_entry_points: - print 'extern HIDDEN %s gl%s(%s);' % (func.return_type, asdf, params) - else: - print 'GLAPI %s GLAPIENTRY gl%s(%s);' % (func.return_type, asdf, params) - - break - - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode] [-d]" % sys.argv[0] - print " -m output_mode Output mode can be one of 'proto', 'init_c' or 'init_h'." - print " -d Enable extra debug information in the generated code." - sys.exit(1) - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:d") - except Exception,e: - show_usage() - - debug = 0 - mode = "proto" - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - elif arg == "-d": - debug = 1 - - if mode == "proto": - printer = PrintGlxProtoStubs() - elif mode == "init_c": - printer = PrintGlxProtoInit_c() - elif mode == "init_h": - printer = PrintGlxProtoInit_h() - else: - show_usage() - - - printer.debug = debug - api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) - - printer.Print( api ) diff --git a/src/mesa/glapi/glX_proto_size.py b/src/mesa/glapi/glX_proto_size.py deleted file mode 100644 index 95cb5110cc..0000000000 --- a/src/mesa/glapi/glX_proto_size.py +++ /dev/null @@ -1,704 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML, glX_XML -import license -import sys, getopt, copy, string - - -class glx_enum_function: - def __init__(self, func_name, enum_dict): - self.name = func_name - self.mode = 1 - self.sig = None - - # "enums" is a set of lists. The element in the set is the - # value of the enum. The list is the list of names for that - # value. For example, [0x8126] = {"POINT_SIZE_MIN", - # "POINT_SIZE_MIN_ARB", "POINT_SIZE_MIN_EXT", - # "POINT_SIZE_MIN_SGIS"}. - - self.enums = {} - - # "count" is indexed by count values. Each element of count - # is a list of index to "enums" that have that number of - # associated data elements. For example, [4] = - # {GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, - # GL_AMBIENT_AND_DIFFUSE} (the enum names are used here, - # but the actual hexadecimal values would be in the array). - - self.count = {} - - - # Fill self.count and self.enums using the dictionary of enums - # that was passed in. The generic Get functions (e.g., - # GetBooleanv and friends) are handled specially here. In - # the data the generic Get functions are refered to as "Get". - - if func_name in ["GetIntegerv", "GetBooleanv", "GetFloatv", "GetDoublev"]: - match_name = "Get" - else: - match_name = func_name - - mode_set = 0 - for enum_name in enum_dict: - e = enum_dict[ enum_name ] - - if e.functions.has_key( match_name ): - [count, mode] = e.functions[ match_name ] - - if mode_set and mode != self.mode: - raise RuntimeError("Not all enums for %s have the same mode." % (func_name)) - - self.mode = mode - - if self.enums.has_key( e.value ): - if e.name not in self.enums[ e.value ]: - self.enums[ e.value ].append( e ) - else: - if not self.count.has_key( count ): - self.count[ count ] = [] - - self.enums[ e.value ] = [ e ] - self.count[ count ].append( e.value ) - - - return - - - def signature( self ): - if self.sig == None: - self.sig = "" - for i in self.count: - if i == None: - raise RuntimeError("i is None. WTF?") - - self.count[i].sort() - for e in self.count[i]: - self.sig += "%04x,%d," % (e, i) - - return self.sig - - - def is_set( self ): - return self.mode - - - def PrintUsingTable(self): - """Emit the body of the __gl*_size function using a pair - of look-up tables and a mask. The mask is calculated such - that (e & mask) is unique for all the valid values of e for - this function. The result of (e & mask) is used as an index - into the first look-up table. If it matches e, then the - same entry of the second table is returned. Otherwise zero - is returned. - - It seems like this should cause better code to be generated. - However, on x86 at least, the resulting .o file is about 20% - larger then the switch-statment version. I am leaving this - code in because the results may be different on other - platforms (e.g., PowerPC or x86-64).""" - - return 0 - count = 0 - for a in self.enums: - count += 1 - - if self.count.has_key(-1): - return 0 - - # Determine if there is some mask M, such that M = (2^N) - 1, - # that will generate unique values for all of the enums. - - mask = 0 - for i in [1, 2, 3, 4, 5, 6, 7, 8]: - mask = (1 << i) - 1 - - fail = 0; - for a in self.enums: - for b in self.enums: - if a != b: - if (a & mask) == (b & mask): - fail = 1; - - if not fail: - break; - else: - mask = 0 - - if (mask != 0) and (mask < (2 * count)): - masked_enums = {} - masked_count = {} - - for i in range(0, mask + 1): - masked_enums[i] = "0"; - masked_count[i] = 0; - - for c in self.count: - for e in self.count[c]: - i = e & mask - enum_obj = self.enums[e][0] - masked_enums[i] = '0x%04x /* %s */' % (e, enum_obj.name ) - masked_count[i] = c - - - print ' static const GLushort a[%u] = {' % (mask + 1) - for e in masked_enums: - print ' %s, ' % (masked_enums[e]) - print ' };' - - print ' static const GLubyte b[%u] = {' % (mask + 1) - for c in masked_count: - print ' %u, ' % (masked_count[c]) - print ' };' - - print ' const unsigned idx = (e & 0x%02xU);' % (mask) - print '' - print ' return (e == a[idx]) ? (GLint) b[idx] : 0;' - return 1; - else: - return 0; - - - def PrintUsingSwitch(self, name): - """Emit the body of the __gl*_size function using a - switch-statement.""" - - print ' switch( e ) {' - - for c in self.count: - for e in self.count[c]: - first = 1 - - # There may be multiple enums with the same - # value. This happens has extensions are - # promoted from vendor-specific or EXT to - # ARB and to the core. Emit the first one as - # a case label, and emit the others as - # commented-out case labels. - - list = {} - for enum_obj in self.enums[e]: - list[ enum_obj.priority() ] = enum_obj.name - - keys = list.keys() - keys.sort() - for k in keys: - j = list[k] - if first: - print ' case GL_%s:' % (j) - first = 0 - else: - print '/* case GL_%s:*/' % (j) - - if c == -1: - print ' return __gl%s_variable_size( e );' % (name) - else: - print ' return %u;' % (c) - - print ' default: return 0;' - print ' }' - - - def Print(self, name): - print 'INTERNAL PURE FASTCALL GLint' - print '__gl%s_size( GLenum e )' % (name) - print '{' - - if not self.PrintUsingTable(): - self.PrintUsingSwitch(name) - - print '}' - print '' - - -class glx_server_enum_function(glx_enum_function): - def __init__(self, func, enum_dict): - glx_enum_function.__init__(self, func.name, enum_dict) - - self.function = func - return - - - def signature( self ): - if self.sig == None: - sig = glx_enum_function.signature(self) - - p = self.function.variable_length_parameter() - if p: - sig += "%u" % (p.size()) - - self.sig = sig - - return self.sig; - - - def Print(self, name, printer): - f = self.function - printer.common_func_print_just_header( f ) - - fixup = [] - - foo = {} - for param_name in f.count_parameter_list: - o = f.offset_of( param_name ) - foo[o] = param_name - - for param_name in f.counter_list: - o = f.offset_of( param_name ) - foo[o] = param_name - - keys = foo.keys() - keys.sort() - for o in keys: - p = f.parameters_by_name[ foo[o] ] - - printer.common_emit_one_arg(p, "pc", 0) - fixup.append( p.name ) - - - print ' GLsizei compsize;' - print '' - - printer.common_emit_fixups(fixup) - - print '' - print ' compsize = __gl%s_size(%s);' % (f.name, string.join(f.count_parameter_list, ",")) - p = f.variable_length_parameter() - print ' return __GLX_PAD(%s);' % (p.size_string()) - - print '}' - print '' - - -class PrintGlxSizeStubs_common(gl_XML.gl_print_base): - do_get = (1 << 0) - do_set = (1 << 1) - - def __init__(self, which_functions): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_size.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM") - - self.emit_set = ((which_functions & PrintGlxSizeStubs_common.do_set) != 0) - self.emit_get = ((which_functions & PrintGlxSizeStubs_common.do_get) != 0) - return - - -class PrintGlxSizeStubs_c(PrintGlxSizeStubs_common): - def printRealHeader(self): - print '' - print '#include ' - if self.emit_get: - print '#include "indirect_size_get.h"' - print '#include "glxserver.h"' - print '#include "indirect_util.h"' - - print '#include "indirect_size.h"' - - print '' - self.printPure() - print '' - self.printFastcall() - print '' - self.printVisibility( "INTERNAL", "internal" ) - print '' - print '' - print '#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__)' - print '# undef HAVE_ALIAS' - print '#endif' - print '#ifdef HAVE_ALIAS' - print '# define ALIAS2(from,to) \\' - print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' - print ' __attribute__ ((alias( # to )));' - print '# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )' - print '#else' - print '# define ALIAS(from,to) \\' - print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\' - print ' { return __gl ## to ## _size( e ); }' - print '#endif' - print '' - print '' - - - def printBody(self, api): - enum_sigs = {} - aliases = [] - - for func in api.functionIterateGlx(): - ef = glx_enum_function( func.name, api.enums_by_name ) - if len(ef.enums) == 0: - continue - - if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): - sig = ef.signature() - if enum_sigs.has_key( sig ): - aliases.append( [func.name, enum_sigs[ sig ]] ) - else: - enum_sigs[ sig ] = func.name - ef.Print( func.name ) - - - for [alias_name, real_name] in aliases: - print 'ALIAS( %s, %s )' % (alias_name, real_name) - - - -class PrintGlxSizeStubs_h(PrintGlxSizeStubs_common): - def printRealHeader(self): - print """/** - * \\file - * Prototypes for functions used to determine the number of data elements in - * various GLX protocol messages. - * - * \\author Ian Romanick - */ -""" - self.printPure(); - print '' - self.printFastcall(); - print '' - self.printVisibility( "INTERNAL", "internal" ); - print '' - - - def printBody(self, api): - for func in api.functionIterateGlx(): - ef = glx_enum_function( func.name, api.enums_by_name ) - if len(ef.enums) == 0: - continue - - if (ef.is_set() and self.emit_set) or (not ef.is_set() and self.emit_get): - print 'extern INTERNAL PURE FASTCALL GLint __gl%s_size(GLenum);' % (func.name) - - -class PrintGlxReqSize_common(gl_XML.gl_print_base): - """Common base class for PrintGlxSizeReq_h and PrintGlxSizeReq_h. - - The main purpose of this common base class is to provide the infrastructure - for the derrived classes to iterate over the same set of functions. - """ - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "glX_proto_size.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005", "IBM") - - -class PrintGlxReqSize_h(PrintGlxReqSize_common): - def __init__(self): - PrintGlxReqSize_common.__init__(self) - self.header_tag = "_INDIRECT_REQSIZE_H_" - - - def printRealHeader(self): - self.printVisibility("HIDDEN", "hidden") - print '' - self.printPure() - print '' - - - def printBody(self, api): - for func in api.functionIterateGlx(): - if not func.ignore and func.has_variable_size_request(): - print 'extern PURE HIDDEN int __glX%sReqSize(const GLbyte *pc, Bool swap);' % (func.name) - - -class PrintGlxReqSize_c(PrintGlxReqSize_common): - """Create the server-side 'request size' functions. - - Create the server-side functions that are used to determine what the - size of a varible length command should be. The server then uses - this value to determine if the incoming command packed it malformed. - """ - - def __init__(self): - PrintGlxReqSize_common.__init__(self) - self.counter_sigs = {} - - - def printRealHeader(self): - print '' - print '#include ' - print '#include "glxserver.h"' - print '#include "glxbyteorder.h"' - print '#include "indirect_size.h"' - print '#include "indirect_reqsize.h"' - print '' - print '#define __GLX_PAD(x) (((x) + 3) & ~3)' - print '' - print '#if defined(__CYGWIN__) || defined(__MINGW32__)' - print '# undef HAVE_ALIAS' - print '#endif' - print '#ifdef HAVE_ALIAS' - print '# define ALIAS2(from,to) \\' - print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' - print ' __attribute__ ((alias( # to )));' - print '# define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )' - print '#else' - print '# define ALIAS(from,to) \\' - print ' GLint __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \\' - print ' { return __glX ## to ## ReqSize( pc, swap ); }' - print '#endif' - print '' - print '' - - - def printBody(self, api): - aliases = [] - enum_functions = {} - enum_sigs = {} - - for func in api.functionIterateGlx(): - if not func.has_variable_size_request(): continue - - ef = glx_server_enum_function( func, api.enums_by_name ) - if len(ef.enums) == 0: continue - - sig = ef.signature() - - if not enum_functions.has_key(func.name): - enum_functions[ func.name ] = sig - - if not enum_sigs.has_key( sig ): - enum_sigs[ sig ] = ef - - - - for func in api.functionIterateGlx(): - # Even though server-handcode fuctions are on "the - # list", and prototypes are generated for them, there - # isn't enough information to generate a size - # function. If there was enough information, they - # probably wouldn't need to be handcoded in the first - # place! - - if func.server_handcode: continue - if not func.has_variable_size_request(): continue - - if enum_functions.has_key(func.name): - sig = enum_functions[func.name] - ef = enum_sigs[ sig ] - - if ef.name != func.name: - aliases.append( [func.name, ef.name] ) - else: - ef.Print( func.name, self ) - - elif func.images: - self.printPixelFunction(func) - elif func.has_variable_size_request(): - a = self.printCountedFunction(func) - if a: aliases.append(a) - - - for [alias_name, real_name] in aliases: - print 'ALIAS( %s, %s )' % (alias_name, real_name) - - return - - - def common_emit_fixups(self, fixup): - """Utility function to emit conditional byte-swaps.""" - - if fixup: - print ' if (swap) {' - for name in fixup: - print ' %s = bswap_32(%s);' % (name, name) - print ' }' - - return - - - def common_emit_one_arg(self, p, pc, adjust): - offset = p.offset - dst = p.string() - src = '(%s *)' % (p.type_string()) - print '%-18s = *%11s(%s + %u);' % (dst, src, pc, offset + adjust); - return - - - def common_func_print_just_header(self, f): - print 'int' - print '__glX%sReqSize( const GLbyte * pc, Bool swap )' % (f.name) - print '{' - - - def printPixelFunction(self, f): - self.common_func_print_just_header(f) - - f.offset_of( f.parameters[0].name ) - [dim, w, h, d, junk] = f.get_images()[0].get_dimensions() - - print ' GLint row_length = * (GLint *)(pc + 4);' - - if dim < 3: - fixup = ['row_length', 'skip_rows', 'alignment'] - print ' GLint image_height = 0;' - print ' GLint skip_images = 0;' - print ' GLint skip_rows = * (GLint *)(pc + 8);' - print ' GLint alignment = * (GLint *)(pc + 16);' - else: - fixup = ['row_length', 'image_height', 'skip_rows', 'skip_images', 'alignment'] - print ' GLint image_height = * (GLint *)(pc + 8);' - print ' GLint skip_rows = * (GLint *)(pc + 16);' - print ' GLint skip_images = * (GLint *)(pc + 20);' - print ' GLint alignment = * (GLint *)(pc + 32);' - - img = f.images[0] - for p in f.parameterIterateGlxSend(): - if p.name in [w, h, d, img.img_format, img.img_type, img.img_target]: - self.common_emit_one_arg(p, "pc", 0) - fixup.append( p.name ) - - print '' - - self.common_emit_fixups(fixup) - - if img.img_null_flag: - print '' - print ' if (*(CARD32 *) (pc + %s))' % (img.offset - 4) - print ' return 0;' - - print '' - print ' return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d ) - print ' image_height, row_length, skip_images,' - print ' skip_rows, alignment);' - print '}' - print '' - return - - - def printCountedFunction(self, f): - - sig = "" - offset = 0 - fixup = [] - params = [] - plus = '' - size = '' - param_offsets = {} - - # Calculate the offset of each counter parameter and the - # size string for the variable length parameter(s). While - # that is being done, calculate a unique signature for this - # function. - - for p in f.parameterIterateGlxSend(): - if p.is_counter: - fixup.append( p.name ) - params.append( p ) - elif p.counter: - s = p.size() - if s == 0: s = 1 - - sig += "(%u,%u)" % (f.offset_of(p.counter), s) - size += '%s%s' % (plus, p.size_string()) - plus = ' + ' - - - # If the calculated signature matches a function that has - # already be emitted, don't emit this function. Instead, add - # it to the list of function aliases. - - if self.counter_sigs.has_key(sig): - n = self.counter_sigs[sig]; - alias = [f.name, n] - else: - alias = None - self.counter_sigs[sig] = f.name - - self.common_func_print_just_header(f) - - for p in params: - self.common_emit_one_arg(p, "pc", 0) - - - print '' - self.common_emit_fixups(fixup) - print '' - - print ' return __GLX_PAD(%s);' % (size) - print '}' - print '' - - return alias - - -def show_usage(): - print "Usage: %s [-f input_file_name] -m output_mode [--only-get | --only-set] [--get-alias-set]" % sys.argv[0] - print " -m output_mode Output mode can be one of 'size_c' or 'size_h'." - print " --only-get Only emit 'get'-type functions." - print " --only-set Only emit 'set'-type functions." - print "" - print "By default, both 'get' and 'set'-type functions are emitted." - sys.exit(1) - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:h:", ["only-get", "only-set", "header-tag"]) - except Exception,e: - show_usage() - - mode = None - header_tag = None - which_functions = PrintGlxSizeStubs_common.do_get | PrintGlxSizeStubs_common.do_set - - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - elif arg == "--only-get": - which_functions = PrintGlxSizeStubs_common.do_get - elif arg == "--only-set": - which_functions = PrintGlxSizeStubs_common.do_set - elif (arg == '-h') or (arg == "--header-tag"): - header_tag = val - - if mode == "size_c": - printer = PrintGlxSizeStubs_c( which_functions ) - elif mode == "size_h": - printer = PrintGlxSizeStubs_h( which_functions ) - if header_tag: - printer.header_tag = header_tag - elif mode == "reqsize_c": - printer = PrintGlxReqSize_c() - elif mode == "reqsize_h": - printer = PrintGlxReqSize_h() - else: - show_usage() - - api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) - - - printer.Print( api ) diff --git a/src/mesa/glapi/glX_server_table.py b/src/mesa/glapi/glX_server_table.py deleted file mode 100644 index f3962f875b..0000000000 --- a/src/mesa/glapi/glX_server_table.py +++ /dev/null @@ -1,411 +0,0 @@ -#!/bin/env python - -# (C) Copyright IBM Corporation 2005, 2006 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML, glX_XML, glX_proto_common, license -import sys, getopt - - -def log2(value): - for i in range(0, 30): - p = 1 << i - if p >= value: - return i - - return -1 - - -def round_down_to_power_of_two(n): - """Returns the nearest power-of-two less than or equal to n.""" - - for i in range(30, 0, -1): - p = 1 << i - if p <= n: - return p - - return -1 - - -class function_table: - def __init__(self, name, do_size_check): - self.name_base = name - self.do_size_check = do_size_check - - - self.max_bits = 1 - self.next_opcode_threshold = (1 << self.max_bits) - self.max_opcode = 0 - - self.functions = {} - self.lookup_table = [] - - # Minimum number of opcodes in a leaf node. - self.min_op_bits = 3 - self.min_op_count = (1 << self.min_op_bits) - return - - - def append(self, opcode, func): - self.functions[opcode] = func - - if opcode > self.max_opcode: - self.max_opcode = opcode - - if opcode > self.next_opcode_threshold: - bits = log2(opcode) - if (1 << bits) <= opcode: - bits += 1 - - self.max_bits = bits - self.next_opcode_threshold = 1 << bits - return - - - def divide_group(self, min_opcode, total): - """Divide the group starting min_opcode into subgroups. - Returns a tuple containing the number of bits consumed by - the node, the list of the children's tuple, and the number - of entries in the final array used by this node and its - children, and the depth of the subtree rooted at the node.""" - - remaining_bits = self.max_bits - total - next_opcode = min_opcode + (1 << remaining_bits) - empty_children = 0 - - for M in range(0, remaining_bits): - op_count = 1 << (remaining_bits - M); - child_count = 1 << M; - - empty_children = 0 - full_children = 0 - for i in range(min_opcode, next_opcode, op_count): - used = 0 - empty = 0 - - for j in range(i, i + op_count): - if self.functions.has_key(j): - used += 1; - else: - empty += 1; - - - if empty == op_count: - empty_children += 1 - - if used == op_count: - full_children += 1 - - if (empty_children > 0) or (full_children == child_count) or (op_count <= self.min_op_count): - break - - - # If all the remaining bits are used by this node, as is the - # case when M is 0 or remaining_bits, the node is a leaf. - - if (M == 0) or (M == remaining_bits): - return [remaining_bits, [], 0, 0] - else: - children = [] - count = 1 - depth = 1 - all_children_are_nonempty_leaf_nodes = 1 - for i in range(min_opcode, next_opcode, op_count): - n = self.divide_group(i, total + M) - - if not (n[1] == [] and not self.is_empty_leaf(i, n[0])): - all_children_are_nonempty_leaf_nodes = 0 - - children.append(n) - count += n[2] + 1 - - if n[3] >= depth: - depth = n[3] + 1 - - # If all of the child nodes are non-empty leaf nodes, pull - # them up and make this node a leaf. - - if all_children_are_nonempty_leaf_nodes: - return [remaining_bits, [], 0, 0] - else: - return [M, children, count, depth] - - - def is_empty_leaf(self, base_opcode, M): - for op in range(base_opcode, base_opcode + (1 << M)): - if self.functions.has_key(op): - return 0 - break - - return 1 - - - def dump_tree(self, node, base_opcode, remaining_bits, base_entry, depth): - M = node[0] - children = node[1] - child_M = remaining_bits - M - - - # This actually an error condition. - if children == []: - return - - print ' /* [%u] -> opcode range [%u, %u], node depth %u */' % (base_entry, base_opcode, base_opcode + (1 << remaining_bits), depth) - print ' %u,' % (M) - - base_entry += (1 << M) + 1 - - child_index = base_entry - child_base_opcode = base_opcode - for child in children: - if child[1] == []: - if self.is_empty_leaf(child_base_opcode, child_M): - print ' EMPTY_LEAF,' - else: - # Emit the index of the next dispatch - # function. Then add all the - # dispatch functions for this leaf - # node to the dispatch function - # lookup table. - - print ' LEAF(%u),' % (len(self.lookup_table)) - - for op in range(child_base_opcode, child_base_opcode + (1 << child_M)): - if self.functions.has_key(op): - func = self.functions[op] - size = func.command_fixed_length() - - if func.glx_rop != 0: - size += 4 - - size = ((size + 3) & ~3) - - if func.has_variable_size_request(): - size_name = "__glX%sReqSize" % (func.name) - else: - size_name = "" - - if func.glx_vendorpriv == op: - func_name = func.glx_vendorpriv_names[0] - else: - func_name = func.name - - temp = [op, "__glXDisp_%s" % (func_name), "__glXDispSwap_%s" % (func_name), size, size_name] - else: - temp = [op, "NULL", "NULL", 0, ""] - - self.lookup_table.append(temp) - else: - print ' %u,' % (child_index) - child_index += child[2] - - child_base_opcode += 1 << child_M - - print '' - - child_index = base_entry - for child in children: - if child[1] != []: - self.dump_tree(child, base_opcode, remaining_bits - M, child_index, depth + 1) - child_index += child[2] - - base_opcode += 1 << (remaining_bits - M) - - - def Print(self): - # Each dispatch table consists of two data structures. - # - # The first structure is an N-way tree where the opcode for - # the function is the key. Each node switches on a range of - # bits from the opcode. M bits are extracted from the opcde - # and are used as an index to select one of the N, where - # N = 2^M, children. - # - # The tree is stored as a flat array. The first value is the - # number of bits, M, used by the node. For inner nodes, the - # following 2^M values are indexes into the array for the - # child nodes. For leaf nodes, the followign 2^M values are - # indexes into the second data structure. - # - # If an inner node's child index is 0, the child is an empty - # leaf node. That is, none of the opcodes selectable from - # that child exist. Since most of the possible opcode space - # is unused, this allows compact data storage. - # - # The second data structure is an array of pairs of function - # pointers. Each function contains a pointer to a protocol - # decode function and a pointer to a byte-swapped protocol - # decode function. Elements in this array are selected by the - # leaf nodes of the first data structure. - # - # As the tree is traversed, an accumulator is kept. This - # accumulator counts the bits of the opcode consumed by the - # traversal. When accumulator + M = B, where B is the - # maximum number of bits in an opcode, the traversal has - # reached a leaf node. The traversal starts with the most - # significant bits and works down to the least significant - # bits. - # - # Creation of the tree is the most complicated part. At - # each node the elements are divided into groups of 2^M - # elements. The value of M selected is the smallest possible - # value where all of the groups are either empty or full, or - # the groups are a preset minimum size. If all the children - # of a node are non-empty leaf nodes, the children are merged - # to create a single leaf node that replaces the parent. - - tree = self.divide_group(0, 0) - - print '/*****************************************************************/' - print '/* tree depth = %u */' % (tree[3]) - print 'static const int_fast16_t %s_dispatch_tree[%u] = {' % (self.name_base, tree[2]) - self.dump_tree(tree, 0, self.max_bits, 0, 1) - print '};\n' - - # After dumping the tree, dump the function lookup table. - - print 'static const void *%s_function_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) - index = 0 - for func in self.lookup_table: - opcode = func[0] - name = func[1] - name_swap = func[2] - - print ' /* [% 3u] = %5u */ {%s, %s},' % (index, opcode, name, name_swap) - - index += 1 - - print '};\n' - - if self.do_size_check: - var_table = [] - - print 'static const int_fast16_t %s_size_table[%u][2] = {' % (self.name_base, len(self.lookup_table)) - index = 0 - var_table = [] - for func in self.lookup_table: - opcode = func[0] - fixed = func[3] - var = func[4] - - if var != "": - var_offset = "%2u" % (len(var_table)) - var_table.append(var) - else: - var_offset = "~0" - - print ' /* [%3u] = %5u */ {%3u, %s},' % (index, opcode, fixed, var_offset) - index += 1 - - - print '};\n' - - - print 'static const gl_proto_size_func %s_size_func_table[%u] = {' % (self.name_base, len(var_table)) - for func in var_table: - print ' %s,' % (func) - - print '};\n' - - - print 'const struct __glXDispatchInfo %s_dispatch_info = {' % (self.name_base) - print ' %u,' % (self.max_bits) - print ' %s_dispatch_tree,' % (self.name_base) - print ' %s_function_table,' % (self.name_base) - if self.do_size_check: - print ' %s_size_table,' % (self.name_base) - print ' %s_size_func_table' % (self.name_base) - else: - print ' NULL,' - print ' NULL' - print '};\n' - return - - -class PrintGlxDispatchTables(glX_proto_common.glx_print_proto): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - self.name = "glX_server_table.py (from Mesa)" - self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2005, 2006", "IBM") - - self.rop_functions = function_table("Render", 1) - self.sop_functions = function_table("Single", 0) - self.vop_functions = function_table("VendorPriv", 0) - return - - - def printRealHeader(self): - print '#include ' - print '#include "glxserver.h"' - print '#include "glxext.h"' - print '#include "indirect_dispatch.h"' - print '#include "indirect_reqsize.h"' - print '#include "g_disptab.h"' - print '#include "indirect_table.h"' - print '' - return - - - def printBody(self, api): - for f in api.functionIterateAll(): - if not f.ignore and f.vectorequiv == None: - if f.glx_rop != 0: - self.rop_functions.append(f.glx_rop, f) - if f.glx_sop != 0: - self.sop_functions.append(f.glx_sop, f) - if f.glx_vendorpriv != 0: - self.vop_functions.append(f.glx_vendorpriv, f) - - self.sop_functions.Print() - self.rop_functions.Print() - self.vop_functions.Print() - return - - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m") - except Exception,e: - show_usage() - - mode = "table_c" - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - - if mode == "table_c": - printer = PrintGlxDispatchTables() - else: - show_usage() - - - api = gl_XML.parse_GL_API( file_name, glX_XML.glx_item_factory() ) - - - printer.Print( api ) diff --git a/src/mesa/glapi/gl_API.dtd b/src/mesa/glapi/gl_API.dtd deleted file mode 100644 index 30c646c924..0000000000 --- a/src/mesa/glapi/gl_API.dtd +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml deleted file mode 100644 index fbf8b0c3e4..0000000000 --- a/src/mesa/glapi/gl_API.xml +++ /dev/null @@ -1,12505 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/mesa/glapi/gl_SPARC_asm.py b/src/mesa/glapi/gl_SPARC_asm.py deleted file mode 100644 index 33e752df38..0000000000 --- a/src/mesa/glapi/gl_SPARC_asm.py +++ /dev/null @@ -1,275 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import license -import gl_XML, glX_XML -import sys, getopt - -class PrintGenericStubs(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - self.name = "gl_SPARC_asm.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - - - def printRealHeader(self): - print '#include "glapi/glapioffsets.h"' - print '' - print '#ifdef __arch64__' - print '#define GL_OFF(N)\t((N) * 8)' - print '#define GL_LL\t\tldx' - print '#define GL_TIE_LD(SYM)\t%tie_ldx(SYM)' - print '#define GL_STACK_SIZE\t128' - print '#else' - print '#define GL_OFF(N)\t((N) * 4)' - print '#define GL_LL\t\tld' - print '#define GL_TIE_LD(SYM)\t%tie_ld(SYM)' - print '#define GL_STACK_SIZE\t64' - print '#endif' - print '' - print '#define GLOBL_FN(x) .globl x ; .type x, @function' - print '#define HIDDEN(x) .hidden x' - print '' - print '\t.register %g2, #scratch' - print '\t.register %g3, #scratch' - print '' - print '\t.text' - print '' - print '\tGLOBL_FN(__glapi_sparc_icache_flush)' - print '\tHIDDEN(__glapi_sparc_icache_flush)' - print '\t.type\t__glapi_sparc_icache_flush, @function' - print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */' - print '\tflush\t%o0' - print '\tretl' - print '\t nop' - print '' - print '\t.align\t32' - print '' - print '\t.type\t__glapi_sparc_get_pc, @function' - print '__glapi_sparc_get_pc:' - print '\tretl' - print '\t add\t%o7, %g2, %g2' - print '\t.size\t__glapi_sparc_get_pc, .-__glapi_sparc_get_pc' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '\tGLOBL_FN(__glapi_sparc_get_dispatch)' - print '\tHIDDEN(__glapi_sparc_get_dispatch)' - print '__glapi_sparc_get_dispatch:' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1' - print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1' - print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)' - print '\tretl' - print '\t mov\t%g2, %o0' - print '' - print '\t.data' - print '\t.align\t32' - print '' - print '\t/* --> sethi %hi(_glapi_tls_Dispatch), %g1 */' - print '\t/* --> or %g1, %lo(_glapi_tls_Dispatch), %g1 */' - print '\tGLOBL_FN(__glapi_sparc_tls_stub)' - print '\tHIDDEN(__glapi_sparc_tls_stub)' - print '__glapi_sparc_tls_stub: /* Call offset in %g3 */' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\tadd\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsrl\t%g3, 10, %g3' - print '\tsethi\t%tie_hi22(_glapi_tls_Dispatch), %g1' - print '\tadd\t%g1, %tie_lo10(_glapi_tls_Dispatch), %g1' - print '\tGL_LL\t[%g2 + %g1], %g2, GL_TIE_LD(_glapi_tls_Dispatch)' - print '\tGL_LL\t[%g7+%g2], %g1' - print '\tGL_LL\t[%g1 + %g3], %g1' - print '\tjmp\t%g1' - print '\t nop' - print '\t.size\t__glapi_sparc_tls_stub, .-__glapi_sparc_tls_stub' - print '' - print '#define GL_STUB(fn, off)\t\t\t\t\\' - print '\tGLOBL_FN(fn);\t\t\t\t\t\\' - print 'fn:\tba\t__glapi_sparc_tls_stub;\t\t\t\\' - print '\t sethi\tGL_OFF(off), %g3;\t\t\t\\' - print '\t.size\tfn,.-fn;' - print '' - print '#elif defined(PTHREADS)' - print '' - print '\t/* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */' - print '\t/* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */' - print '\t/* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */' - print '\t/* 64-bit 0x0c --> sllx %g1, 32, %g1 */' - print '\t/* 64-bit 0x10 --> add %g1, %g2, %g1 */' - print '\t/* 64-bit 0x14 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */' - print '' - print '\t/* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */' - print '\t/* 32-bit 0x04 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */' - print '' - print '\t.data' - print '\t.align\t32' - print '' - print '\tGLOBL_FN(__glapi_sparc_pthread_stub)' - print '\tHIDDEN(__glapi_sparc_pthread_stub)' - print '__glapi_sparc_pthread_stub: /* Call offset in %g3 */' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsethi\t%hi(_glapi_Dispatch), %g1' - print '\tor\t%g1, %lo(_glapi_Dispatch), %g1' - print '\tsrl\t%g3, 10, %g3' - print '\tGL_LL\t[%g2+%g1], %g2' - print '\tGL_LL\t[%g2], %g1' - print '\tcmp\t%g1, 0' - print '\tbe\t2f' - print '\t nop' - print '1:\tGL_LL\t[%g1 + %g3], %g1' - print '\tjmp\t%g1' - print '\t nop' - print '2:\tsave\t%sp, GL_STACK_SIZE, %sp' - print '\tmov\t%g3, %l0' - print '\tcall\t_glapi_get_dispatch' - print '\t nop' - print '\tmov\t%o0, %g1' - print '\tmov\t%l0, %g3' - print '\tba\t1b' - print '\t restore %g0, %g0, %g0' - print '\t.size\t__glapi_sparc_pthread_stub, .-__glapi_sparc_pthread_stub' - print '' - print '#define GL_STUB(fn, off)\t\t\t\\' - print '\tGLOBL_FN(fn);\t\t\t\t\\' - print 'fn:\tba\t__glapi_sparc_pthread_stub;\t\\' - print '\t sethi\tGL_OFF(off), %g3;\t\t\\' - print '\t.size\tfn,.-fn;' - print '' - print '#else /* Non-threaded version. */' - print '' - print '\t.type __glapi_sparc_nothread_stub, @function' - print '__glapi_sparc_nothread_stub: /* Call offset in %g3 */' - print '\tmov\t%o7, %g1' - print '\tsethi\t%hi(_GLOBAL_OFFSET_TABLE_-4), %g2' - print '\tcall\t__glapi_sparc_get_pc' - print '\t add\t%g2, %lo(_GLOBAL_OFFSET_TABLE_+4), %g2' - print '\tmov\t%g1, %o7' - print '\tsrl\t%g3, 10, %g3' - print '\tsethi\t%hi(_glapi_Dispatch), %g1' - print '\tor\t%g1, %lo(_glapi_Dispatch), %g1' - print '\tGL_LL\t[%g2+%g1], %g2' - print '\tGL_LL\t[%g2], %g1' - print '\tGL_LL\t[%g1 + %g3], %g1' - print '\tjmp\t%g1' - print '\t nop' - print '\t.size\t__glapi_sparc_nothread_stub, .-__glapi_sparc_nothread_stub' - print '' - print '#define GL_STUB(fn, off)\t\t\t\\' - print '\tGLOBL_FN(fn);\t\t\t\t\\' - print 'fn:\tba\t__glapi_sparc_nothread_stub;\t\\' - print '\t sethi\tGL_OFF(off), %g3;\t\t\\' - print '\t.size\tfn,.-fn;' - print '' - print '#endif' - print '' - print '#define GL_STUB_ALIAS(fn, alias) \\' - print ' .globl fn; \\' - print ' .set fn, alias' - print '' - print '\t.text' - print '\t.align\t32' - print '' - print '\t.globl\tgl_dispatch_functions_start' - print '\tHIDDEN(gl_dispatch_functions_start)' - print 'gl_dispatch_functions_start:' - print '' - return - - def printRealFooter(self): - print '' - print '\t.globl\tgl_dispatch_functions_end' - print '\tHIDDEN(gl_dispatch_functions_end)' - print 'gl_dispatch_functions_end:' - return - - def printBody(self, api): - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - - print '\tGL_STUB(gl%s, _gloffset_%s)' % (name, f.name) - - if not f.is_static_entry_point(f.name): - print '\tHIDDEN(gl%s)' % (name) - - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - - if f.is_static_entry_point(f.name): - for n in f.entry_points: - if n != f.name: - text = '\tGL_STUB_ALIAS(gl%s, gl%s)' % (n, f.name) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text - - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - mode = "generic" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == '-m': - mode = val - elif arg == "-f": - file_name = val - - if mode == "generic": - printer = PrintGenericStubs() - else: - print "ERROR: Invalid mode \"%s\" specified." % mode - show_usage() - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer.Print(api) diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py deleted file mode 100644 index a10a35e513..0000000000 --- a/src/mesa/glapi/gl_XML.py +++ /dev/null @@ -1,967 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import libxml2 -import re, sys, string -import typeexpr - - -def parse_GL_API( file_name, factory = None ): - doc = libxml2.readFile( file_name, None, libxml2.XML_PARSE_XINCLUDE + libxml2.XML_PARSE_NOBLANKS + libxml2.XML_PARSE_DTDVALID + libxml2.XML_PARSE_DTDATTR + libxml2.XML_PARSE_DTDLOAD + libxml2.XML_PARSE_NOENT ) - ret = doc.xincludeProcess() - - if not factory: - factory = gl_item_factory() - - api = factory.create_item( "api", None, None ) - api.process_element( doc ) - - # After the XML has been processed, we need to go back and assign - # dispatch offsets to the functions that request that their offsets - # be assigned by the scripts. Typically this means all functions - # that are not part of the ABI. - - for func in api.functionIterateByCategory(): - if func.assign_offset: - func.offset = api.next_offset; - api.next_offset += 1 - - doc.freeDoc() - - return api - - -def is_attr_true( element, name ): - """Read a name value from an element's attributes. - - The value read from the attribute list must be either 'true' or - 'false'. If the value is 'false', zero will be returned. If the - value is 'true', non-zero will be returned. An exception will be - raised for any other value.""" - - value = element.nsProp( name, None ) - if value == "true": - return 1 - elif value == "false": - return 0 - else: - raise RuntimeError('Invalid value "%s" for boolean "%s".' % (value, name)) - - -class gl_print_base: - """Base class of all API pretty-printers. - - In the model-view-controller pattern, this is the view. Any derived - class will want to over-ride the printBody, printRealHader, and - printRealFooter methods. Some derived classes may want to over-ride - printHeader and printFooter, or even Print (though this is unlikely). - """ - - def __init__(self): - # Name of the script that is generating the output file. - # Every derived class should set this to the name of its - # source file. - - self.name = "a" - - - # License on the *generated* source file. This may differ - # from the license on the script that is generating the file. - # Every derived class should set this to some reasonable - # value. - # - # See license.py for an example of a reasonable value. - - self.license = "The license for this file is unspecified." - - - # The header_tag is the name of the C preprocessor define - # used to prevent multiple inclusion. Typically only - # generated C header files need this to be set. Setting it - # causes code to be generated automatically in printHeader - # and printFooter. - - self.header_tag = None - - - # List of file-private defines that must be undefined at the - # end of the file. This can be used in header files to define - # names for use in the file, then undefine them at the end of - # the header file. - - self.undef_list = [] - return - - - def Print(self, api): - self.printHeader() - self.printBody(api) - self.printFooter() - return - - - def printHeader(self): - """Print the header associated with all files and call the printRealHeader method.""" - - print '/* DO NOT EDIT - This file generated automatically by %s script */' \ - % (self.name) - print '' - print '/*' - print ' * ' + self.license.replace('\n', '\n * ') - print ' */' - print '' - if self.header_tag: - print '#if !defined( %s )' % (self.header_tag) - print '# define %s' % (self.header_tag) - print '' - self.printRealHeader(); - return - - - def printFooter(self): - """Print the header associated with all files and call the printRealFooter method.""" - - self.printRealFooter() - - if self.undef_list: - print '' - for u in self.undef_list: - print "# undef %s" % (u) - - if self.header_tag: - print '' - print '#endif /* !defined( %s ) */' % (self.header_tag) - - - def printRealHeader(self): - """Print the "real" header for the created file. - - In the base class, this function is empty. All derived - classes should over-ride this function.""" - return - - - def printRealFooter(self): - """Print the "real" footer for the created file. - - In the base class, this function is empty. All derived - classes should over-ride this function.""" - return - - - def printPure(self): - """Conditionally define `PURE' function attribute. - - Conditionally defines a preprocessor macro `PURE' that wraps - GCC's `pure' function attribute. The conditional code can be - easilly adapted to other compilers that support a similar - feature. - - The name is also added to the file's undef_list. - """ - self.undef_list.append("PURE") - print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define PURE __attribute__((pure)) -# else -# define PURE -# endif""" - return - - - def printFastcall(self): - """Conditionally define `FASTCALL' function attribute. - - Conditionally defines a preprocessor macro `FASTCALL' that - wraps GCC's `fastcall' function attribute. The conditional - code can be easilly adapted to other compilers that support a - similar feature. - - The name is also added to the file's undef_list. - """ - - self.undef_list.append("FASTCALL") - print """# if defined(__i386__) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define FASTCALL __attribute__((fastcall)) -# else -# define FASTCALL -# endif""" - return - - - def printVisibility(self, S, s): - """Conditionally define visibility function attribute. - - Conditionally defines a preprocessor macro name S that wraps - GCC's visibility function attribute. The visibility used is - the parameter s. The conditional code can be easilly adapted - to other compilers that support a similar feature. - - The name is also added to the file's undef_list. - """ - - self.undef_list.append(S) - print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) -# define %s __attribute__((visibility("%s"))) -# else -# define %s -# endif""" % (S, s, S) - return - - - def printNoinline(self): - """Conditionally define `NOINLINE' function attribute. - - Conditionally defines a preprocessor macro `NOINLINE' that - wraps GCC's `noinline' function attribute. The conditional - code can be easilly adapted to other compilers that support a - similar feature. - - The name is also added to the file's undef_list. - """ - - self.undef_list.append("NOINLINE") - print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) -# define NOINLINE __attribute__((noinline)) -# else -# define NOINLINE -# endif""" - return - - -def real_function_name(element): - name = element.nsProp( "name", None ) - alias = element.nsProp( "alias", None ) - - if alias: - return alias - else: - return name - - -def real_category_name(c): - if re.compile("[1-9][0-9]*[.][0-9]+").match(c): - return "GL_VERSION_" + c.replace(".", "_") - else: - return c - - -def classify_category(name, number): - """Based on the category name and number, select a numerical class for it. - - Categories are divided into four classes numbered 0 through 3. The - classes are: - - 0. Core GL versions, sorted by version number. - 1. ARB extensions, sorted by extension number. - 2. Non-ARB extensions, sorted by extension number. - 3. Un-numbered extensions, sorted by extension name. - """ - - try: - core_version = float(name) - except Exception,e: - core_version = 0.0 - - if core_version > 0.0: - cat_type = 0 - key = name - elif name.startswith("GL_ARB_") or name.startswith("GLX_ARB_") or name.startswith("WGL_ARB_"): - cat_type = 1 - key = int(number) - else: - if number != None: - cat_type = 2 - key = int(number) - else: - cat_type = 3 - key = name - - - return [cat_type, key] - - -def create_parameter_string(parameters, include_names): - """Create a parameter string from a list of gl_parameters.""" - - list = [] - for p in parameters: - if p.is_padding: - continue - - if include_names: - list.append( p.string() ) - else: - list.append( p.type_string() ) - - if len(list) == 0: list = ["void"] - - return string.join(list, ", ") - - -class gl_item: - def __init__(self, element, context): - self.context = context - self.name = element.nsProp( "name", None ) - self.category = real_category_name( element.parent.nsProp( "name", None ) ) - return - - -class gl_type( gl_item ): - def __init__(self, element, context): - gl_item.__init__(self, element, context) - self.size = int( element.nsProp( "size", None ), 0 ) - - te = typeexpr.type_expression( None ) - tn = typeexpr.type_node() - tn.size = int( element.nsProp( "size", None ), 0 ) - tn.integer = not is_attr_true( element, "float" ) - tn.unsigned = is_attr_true( element, "unsigned" ) - tn.name = "GL" + self.name - te.set_base_type_node( tn ) - - self.type_expr = te - return - - - def get_type_expression(self): - return self.type_expr - - -class gl_enum( gl_item ): - def __init__(self, element, context): - gl_item.__init__(self, element, context) - self.value = int( element.nsProp( "value", None ), 0 ) - - temp = element.nsProp( "count", None ) - if not temp or temp == "?": - self.default_count = -1 - else: - try: - c = int(temp) - except Exception,e: - raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n)) - - self.default_count = c - - return - - - def priority(self): - """Calculate a 'priority' for this enum name. - - When an enum is looked up by number, there may be many - possible names, but only one is the 'prefered' name. The - priority is used to select which name is the 'best'. - - Highest precedence is given to core GL name. ARB extension - names have the next highest, followed by EXT extension names. - Vendor extension names are the lowest. - """ - - if self.name.endswith( "_BIT" ): - bias = 1 - else: - bias = 0 - - if self.category.startswith( "GL_VERSION_" ): - priority = 0 - elif self.category.startswith( "GL_ARB_" ): - priority = 2 - elif self.category.startswith( "GL_EXT_" ): - priority = 4 - else: - priority = 6 - - return priority + bias - - - -class gl_parameter: - def __init__(self, element, context): - self.name = element.nsProp( "name", None ) - - ts = element.nsProp( "type", None ) - self.type_expr = typeexpr.type_expression( ts, context ) - - temp = element.nsProp( "variable_param", None ) - if temp: - self.count_parameter_list = temp.split( ' ' ) - else: - self.count_parameter_list = [] - - # The count tag can be either a numeric string or the name of - # a variable. If it is the name of a variable, the int(c) - # statement will throw an exception, and the except block will - # take over. - - c = element.nsProp( "count", None ) - try: - count = int(c) - self.count = count - self.counter = None - except Exception,e: - count = 1 - self.count = 0 - self.counter = c - - self.count_scale = int(element.nsProp( "count_scale", None )) - - elements = (count * self.count_scale) - if elements == 1: - elements = 0 - - #if ts == "GLdouble": - # print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size()) - # print '/* # elements = %u */' % (elements) - self.type_expr.set_elements( elements ) - #if ts == "GLdouble": - # print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size()) - - self.is_client_only = is_attr_true( element, 'client_only' ) - self.is_counter = is_attr_true( element, 'counter' ) - self.is_output = is_attr_true( element, 'output' ) - - - # Pixel data has special parameters. - - self.width = element.nsProp('img_width', None) - self.height = element.nsProp('img_height', None) - self.depth = element.nsProp('img_depth', None) - self.extent = element.nsProp('img_extent', None) - - self.img_xoff = element.nsProp('img_xoff', None) - self.img_yoff = element.nsProp('img_yoff', None) - self.img_zoff = element.nsProp('img_zoff', None) - self.img_woff = element.nsProp('img_woff', None) - - self.img_format = element.nsProp('img_format', None) - self.img_type = element.nsProp('img_type', None) - self.img_target = element.nsProp('img_target', None) - - self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' ) - self.img_null_flag = is_attr_true( element, 'img_null_flag' ) - self.img_send_null = is_attr_true( element, 'img_send_null' ) - - self.is_padding = is_attr_true( element, 'padding' ) - return - - - def compatible(self, other): - return 1 - - - def is_array(self): - return self.is_pointer() - - - def is_pointer(self): - return self.type_expr.is_pointer() - - - def is_image(self): - if self.width: - return 1 - else: - return 0 - - - def is_variable_length(self): - return len(self.count_parameter_list) or self.counter - - - def is_64_bit(self): - count = self.type_expr.get_element_count() - if count: - if (self.size() / count) == 8: - return 1 - else: - if self.size() == 8: - return 1 - - return 0 - - - def string(self): - return self.type_expr.original_string + " " + self.name - - - def type_string(self): - return self.type_expr.original_string - - - def get_base_type_string(self): - return self.type_expr.get_base_name() - - - def get_dimensions(self): - if not self.width: - return [ 0, "0", "0", "0", "0" ] - - dim = 1 - w = self.width - h = "1" - d = "1" - e = "1" - - if self.height: - dim = 2 - h = self.height - - if self.depth: - dim = 3 - d = self.depth - - if self.extent: - dim = 4 - e = self.extent - - return [ dim, w, h, d, e ] - - - def get_stack_size(self): - return self.type_expr.get_stack_size() - - - def size(self): - if self.is_image(): - return 0 - else: - return self.type_expr.get_element_size() - - - def get_element_count(self): - c = self.type_expr.get_element_count() - if c == 0: - return 1 - - return c - - - def size_string(self, use_parens = 1): - s = self.size() - if self.counter or self.count_parameter_list: - list = [ "compsize" ] - - if self.counter and self.count_parameter_list: - list.append( self.counter ) - elif self.counter: - list = [ self.counter ] - - if s > 1: - list.append( str(s) ) - - if len(list) > 1 and use_parens : - return "(%s)" % (string.join(list, " * ")) - else: - return string.join(list, " * ") - - elif self.is_image(): - return "compsize" - else: - return str(s) - - - def format_string(self): - if self.type_expr.original_string == "GLenum": - return "0x%x" - else: - return self.type_expr.format_string() - - - -class gl_function( gl_item ): - def __init__(self, element, context): - self.context = context - self.name = None - - self.entry_points = [] - self.return_type = "void" - self.parameters = [] - self.offset = -1 - self.initialized = 0 - self.images = [] - - self.assign_offset = 0 - - self.static_entry_points = [] - - # Track the parameter string (for the function prototype) - # for each entry-point. This is done because some functions - # change their prototype slightly when promoted from extension - # to ARB extension to core. glTexImage3DEXT and glTexImage3D - # are good examples of this. Scripts that need to generate - # code for these differing aliases need to real prototype - # for each entry-point. Otherwise, they may generate code - # that won't compile. - - self.parameter_strings = {} - - self.process_element( element ) - - return - - - def process_element(self, element): - name = element.nsProp( "name", None ) - alias = element.nsProp( "alias", None ) - - if is_attr_true(element, "static_dispatch"): - self.static_entry_points.append(name) - - self.entry_points.append( name ) - if alias: - true_name = alias - else: - true_name = name - - # Only try to set the offset when a non-alias - # entry-point is being processes. - - offset = element.nsProp( "offset", None ) - if offset: - try: - o = int( offset ) - self.offset = o - except Exception, e: - self.offset = -1 - if offset == "assign": - self.assign_offset = 1 - - - if not self.name: - self.name = true_name - elif self.name != true_name: - raise RuntimeError("Function true name redefined. Was %s, now %s." % (self.name, true_name)) - - - # There are two possible cases. The first time an entry-point - # with data is seen, self.initialized will be 0. On that - # pass, we just fill in the data. The next time an - # entry-point with data is seen, self.initialized will be 1. - # On that pass we have to make that the new values match the - # valuse from the previous entry-point. - - parameters = [] - return_type = "void" - child = element.children - while child: - if child.type == "element": - if child.name == "return": - return_type = child.nsProp( "type", None ) - elif child.name == "param": - param = self.context.factory.create_item( "parameter", child, self.context) - parameters.append( param ) - - child = child.next - - - if self.initialized: - if self.return_type != return_type: - raise RuntimeError( "Return type changed in %s. Was %s, now %s." % (name, self.return_type, return_type)) - - if len(parameters) != len(self.parameters): - raise RuntimeError( "Parameter count mismatch in %s. Was %d, now %d." % (name, len(self.parameters), len(parameters))) - - for j in range(0, len(parameters)): - p1 = parameters[j] - p2 = self.parameters[j] - if not p1.compatible( p2 ): - raise RuntimeError( 'Parameter type mismatch in %s. "%s" was "%s", now "%s".' % (name, p2.name, p2.type_expr.original_string, p1.type_expr.original_string)) - - - if true_name == name or not self.initialized: - self.return_type = return_type - self.parameters = parameters - - for param in self.parameters: - if param.is_image(): - self.images.append( param ) - - if element.children: - self.initialized = 1 - self.parameter_strings[name] = create_parameter_string(parameters, 1) - else: - self.parameter_strings[name] = None - - return - - - def get_images(self): - """Return potentially empty list of input images.""" - return self.images - - - def parameterIterator(self): - return self.parameters.__iter__(); - - - def get_parameter_string(self, entrypoint = None): - if entrypoint: - s = self.parameter_strings[ entrypoint ] - if s: - return s - - return create_parameter_string( self.parameters, 1 ) - - def get_called_parameter_string(self): - p_string = "" - comma = "" - - for p in self.parameterIterator(): - p_string = p_string + comma + p.name - comma = ", " - - return p_string - - - def is_abi(self): - return (self.offset >= 0 and not self.assign_offset) - - def is_static_entry_point(self, name): - return name in self.static_entry_points - - def dispatch_name(self): - if self.name in self.static_entry_points: - return self.name - else: - return "_dispatch_stub_%u" % (self.offset) - - def static_name(self, name): - if name in self.static_entry_points: - return name - else: - return "_dispatch_stub_%u" % (self.offset) - - -class gl_item_factory: - """Factory to create objects derived from gl_item.""" - - def create_item(self, item_name, element, context): - if item_name == "function": - return gl_function(element, context) - if item_name == "type": - return gl_type(element, context) - elif item_name == "enum": - return gl_enum(element, context) - elif item_name == "parameter": - return gl_parameter(element, context) - elif item_name == "api": - return gl_api(self) - else: - return None - - -class gl_api: - def __init__(self, factory): - self.functions_by_name = {} - self.enums_by_name = {} - self.types_by_name = {} - - self.category_dict = {} - self.categories = [{}, {}, {}, {}] - - self.factory = factory - - self.next_offset = 0 - - typeexpr.create_initial_types() - return - - - def process_element(self, doc): - element = doc.children - while element.type != "element" or element.name != "OpenGLAPI": - element = element.next - - if element: - self.process_OpenGLAPI(element) - return - - - def process_OpenGLAPI(self, element): - child = element.children - while child: - if child.type == "element": - if child.name == "category": - self.process_category( child ) - elif child.name == "OpenGLAPI": - self.process_OpenGLAPI( child ) - - child = child.next - - return - - - def process_category(self, cat): - cat_name = cat.nsProp( "name", None ) - cat_number = cat.nsProp( "number", None ) - - [cat_type, key] = classify_category(cat_name, cat_number) - self.categories[cat_type][key] = [cat_name, cat_number] - - child = cat.children - while child: - if child.type == "element": - if child.name == "function": - func_name = real_function_name( child ) - - temp_name = child.nsProp( "name", None ) - self.category_dict[ temp_name ] = [cat_name, cat_number] - - if self.functions_by_name.has_key( func_name ): - func = self.functions_by_name[ func_name ] - func.process_element( child ) - else: - func = self.factory.create_item( "function", child, self ) - self.functions_by_name[ func_name ] = func - - if func.offset >= self.next_offset: - self.next_offset = func.offset + 1 - - - elif child.name == "enum": - enum = self.factory.create_item( "enum", child, self ) - self.enums_by_name[ enum.name ] = enum - elif child.name == "type": - t = self.factory.create_item( "type", child, self ) - self.types_by_name[ "GL" + t.name ] = t - - - child = child.next - - return - - - def functionIterateByCategory(self, cat = None): - """Iterate over functions by category. - - If cat is None, all known functions are iterated in category - order. See classify_category for details of the ordering. - Within a category, functions are sorted by name. If cat is - not None, then only functions in that category are iterated. - """ - lists = [{}, {}, {}, {}] - - for func in self.functionIterateAll(): - [cat_name, cat_number] = self.category_dict[func.name] - - if (cat == None) or (cat == cat_name): - [func_cat_type, key] = classify_category(cat_name, cat_number) - - if not lists[func_cat_type].has_key(key): - lists[func_cat_type][key] = {} - - lists[func_cat_type][key][func.name] = func - - - functions = [] - for func_cat_type in range(0,4): - keys = lists[func_cat_type].keys() - keys.sort() - - for key in keys: - names = lists[func_cat_type][key].keys() - names.sort() - - for name in names: - functions.append(lists[func_cat_type][key][name]) - - return functions.__iter__() - - - def functionIterateByOffset(self): - max_offset = -1 - for func in self.functions_by_name.itervalues(): - if func.offset > max_offset: - max_offset = func.offset - - - temp = [None for i in range(0, max_offset + 1)] - for func in self.functions_by_name.itervalues(): - if func.offset != -1: - temp[ func.offset ] = func - - - list = [] - for i in range(0, max_offset + 1): - if temp[i]: - list.append(temp[i]) - - return list.__iter__(); - - - def functionIterateAll(self): - return self.functions_by_name.itervalues() - - - def enumIterateByName(self): - keys = self.enums_by_name.keys() - keys.sort() - - list = [] - for enum in keys: - list.append( self.enums_by_name[ enum ] ) - - return list.__iter__() - - - def categoryIterate(self): - """Iterate over categories. - - Iterate over all known categories in the order specified by - classify_category. Each iterated value is a tuple of the - name and number (which may be None) of the category. - """ - - list = [] - for cat_type in range(0,4): - keys = self.categories[cat_type].keys() - keys.sort() - - for key in keys: - list.append(self.categories[cat_type][key]) - - return list.__iter__() - - - def get_category_for_name( self, name ): - if self.category_dict.has_key(name): - return self.category_dict[name] - else: - return ["", None] - - - def typeIterate(self): - return self.types_by_name.itervalues() - - - def find_type( self, type_name ): - if type_name in self.types_by_name: - return self.types_by_name[ type_name ].type_expr - else: - print "Unable to find base type matching \"%s\"." % (type_name) - return None diff --git a/src/mesa/glapi/gl_and_glX_API.xml b/src/mesa/glapi/gl_and_glX_API.xml deleted file mode 100644 index 34c977e9c0..0000000000 --- a/src/mesa/glapi/gl_and_glX_API.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/mesa/glapi/gl_apitemp.py b/src/mesa/glapi/gl_apitemp.py deleted file mode 100644 index 41a40fbeb6..0000000000 --- a/src/mesa/glapi/gl_apitemp.py +++ /dev/null @@ -1,320 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML, glX_XML -import license -import sys, getopt - -class PrintGlOffsets(gl_XML.gl_print_base): - def __init__(self, es=False): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_apitemp.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - - self.es = es - - self.undef_list.append( "KEYWORD1" ) - self.undef_list.append( "KEYWORD1_ALT" ) - self.undef_list.append( "KEYWORD2" ) - self.undef_list.append( "NAME" ) - self.undef_list.append( "DISPATCH" ) - self.undef_list.append( "RETURN_DISPATCH" ) - self.undef_list.append( "DISPATCH_TABLE_NAME" ) - self.undef_list.append( "UNUSED_TABLE_NAME" ) - self.undef_list.append( "TABLE_ENTRY" ) - - - def printFunction(self, f, name): - p_string = "" - o_string = "" - t_string = "" - comma = "" - - if f.is_static_entry_point(name): - keyword = "KEYWORD1" - else: - keyword = "KEYWORD1_ALT" - - n = f.static_name(name) - - for p in f.parameterIterator(): - if p.is_padding: - continue - - if p.is_pointer(): - cast = "(const void *) " - else: - cast = "" - - t_string = t_string + comma + p.format_string() - p_string = p_string + comma + p.name - o_string = o_string + comma + cast + p.name - comma = ", " - - - if f.return_type != 'void': - dispatch = "RETURN_DISPATCH" - else: - dispatch = "DISPATCH" - - need_proto = False - if not f.is_static_entry_point(name): - need_proto = True - elif self.es: - cat, num = api.get_category_for_name(name) - if (cat.startswith("es") or cat.startswith("GL_OES")): - need_proto = True - if need_proto: - print '%s %s KEYWORD2 NAME(%s)(%s);' % (keyword, f.return_type, n, f.get_parameter_string(name)) - print '' - - print '%s %s KEYWORD2 NAME(%s)(%s)' % (keyword, f.return_type, n, f.get_parameter_string(name)) - print '{' - if p_string == "": - print ' %s(%s, (), (F, "gl%s();\\n"));' \ - % (dispatch, f.name, name) - else: - print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \ - % (dispatch, f.name, p_string, name, t_string, o_string) - print '}' - print '' - return - - def printRealHeader(self): - print '' - self.printVisibility( "HIDDEN", "hidden" ) - print """ -/* - * This file is a template which generates the OpenGL API entry point - * functions. It should be included by a .c file which first defines - * the following macros: - * KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32 - * KEYWORD2 - usually nothing, but might be __stdcall on Win32 - * NAME(n) - builds the final function name (usually add "gl" prefix) - * DISPATCH(func, args, msg) - code to do dispatch of named function. - * msg is a printf-style debug message. - * RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value - * - * Here is an example which generates the usual OpenGL functions: - * #define KEYWORD1 - * #define KEYWORD2 - * #define NAME(func) gl##func - * #define DISPATCH(func, args, msg) \\ - * struct _glapi_table *dispatch = CurrentDispatch; \\ - * (*dispatch->func) args - * #define RETURN DISPATCH(func, args, msg) \\ - * struct _glapi_table *dispatch = CurrentDispatch; \\ - * return (*dispatch->func) args - * - */ - - -#if defined( NAME ) -#ifndef KEYWORD1 -#define KEYWORD1 -#endif - -#ifndef KEYWORD1_ALT -#define KEYWORD1_ALT HIDDEN -#endif - -#ifndef KEYWORD2 -#define KEYWORD2 -#endif - -#ifndef DISPATCH -#error DISPATCH must be defined -#endif - -#ifndef RETURN_DISPATCH -#error RETURN_DISPATCH must be defined -#endif - -""" - return - - - - def printInitDispatch(self, api): - print """ -#endif /* defined( NAME ) */ - -/* - * This is how a dispatch table can be initialized with all the functions - * we generated above. - */ -#ifdef DISPATCH_TABLE_NAME - -#ifndef TABLE_ENTRY -#error TABLE_ENTRY must be defined -#endif - -#ifdef _GLAPI_SKIP_NORMAL_ENTRY_POINTS -#error _GLAPI_SKIP_NORMAL_ENTRY_POINTS must not be defined -#endif - -_glapi_proc DISPATCH_TABLE_NAME[] = {""" - for f in api.functionIterateByOffset(): - print ' TABLE_ENTRY(%s),' % (f.dispatch_name()) - - print ' /* A whole bunch of no-op functions. These might be called' - print ' * when someone tries to call a dynamically-registered' - print ' * extension function without a current rendering context.' - print ' */' - for i in range(1, 100): - print ' TABLE_ENTRY(Unused),' - - print '};' - print '#endif /* DISPATCH_TABLE_NAME */' - print '' - return - - - def printAliasedTable(self, api): - print """ -/* - * This is just used to silence compiler warnings. - * We list the functions which are not otherwise used. - */ -#ifdef UNUSED_TABLE_NAME -_glapi_proc UNUSED_TABLE_NAME[] = {""" - - normal_entries = [] - proto_entries = [] - for f in api.functionIterateByOffset(): - normal_ents, proto_ents = self.classifyEntryPoints(f) - - # exclude f.name - if f.name in normal_ents: - normal_ents.remove(f.name) - elif f.name in proto_ents: - proto_ents.remove(f.name) - - normal_ents = [f.static_name(ent) for ent in normal_ents] - proto_ents = [f.static_name(ent) for ent in proto_ents] - - normal_entries.extend(normal_ents) - proto_entries.extend(proto_ents) - - print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS' - for ent in normal_entries: - print ' TABLE_ENTRY(%s),' % (ent) - print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */' - print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS' - for ent in proto_entries: - print ' TABLE_ENTRY(%s),' % (ent) - print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */' - - print '};' - print '#endif /*UNUSED_TABLE_NAME*/' - print '' - return - - - def classifyEntryPoints(self, func): - normal_names = [] - normal_stubs = [] - proto_names = [] - proto_stubs = [] - # classify the entry points - for name in func.entry_points: - if func.has_different_protocol(name): - if func.is_static_entry_point(name): - proto_names.append(name) - else: - proto_stubs.append(name) - else: - if func.is_static_entry_point(name): - normal_names.append(name) - else: - normal_stubs.append(name) - # there can be at most one stub for a function - if normal_stubs: - normal_names.append(normal_stubs[0]) - elif proto_stubs: - proto_names.append(proto_stubs[0]) - - return (normal_names, proto_names) - - def printBody(self, api): - normal_entry_points = [] - proto_entry_points = [] - for func in api.functionIterateByOffset(): - normal_ents, proto_ents = self.classifyEntryPoints(func) - normal_entry_points.append((func, normal_ents)) - proto_entry_points.append((func, proto_ents)) - - print '#ifndef _GLAPI_SKIP_NORMAL_ENTRY_POINTS' - print '' - for func, ents in normal_entry_points: - for ent in ents: - self.printFunction(func, ent) - print '' - print '#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */' - print '' - print '/* these entry points might require different protocols */' - print '#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS' - print '' - for func, ents in proto_entry_points: - for ent in ents: - self.printFunction(func, ent) - print '' - print '#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */' - print '' - - self.printInitDispatch(api) - self.printAliasedTable(api) - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0] - print "-c Enable compatibility with OpenGL ES." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:c") - except Exception,e: - show_usage() - - es = False - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-c": - es = True - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - - printer = PrintGlOffsets(es) - printer.Print(api) diff --git a/src/mesa/glapi/gl_enums.py b/src/mesa/glapi/gl_enums.py deleted file mode 100644 index 3a9ea3c86c..0000000000 --- a/src/mesa/glapi/gl_enums.py +++ /dev/null @@ -1,243 +0,0 @@ -#!/usr/bin/python2 -# -*- Mode: Python; py-indent-offset: 8 -*- - -# (C) Copyright Zack Rusin 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Zack Rusin - -import license -import gl_XML -import sys, getopt - -class PrintGlEnums(gl_XML.gl_print_base): - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_enums.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2005 Brian Paul All Rights Reserved.""", "BRIAN PAUL") - self.enum_table = {} - - - def printRealHeader(self): - print '#include "main/glheader.h"' - print '#include "main/mfeatures.h"' - print '#include "main/enums.h"' - print '#include "main/imports.h"' - print '' - print 'typedef struct {' - print ' size_t offset;' - print ' int n;' - print '} enum_elt;' - print '' - return - - def print_code(self): - print """ -typedef int (*cfunc)(const void *, const void *); - -/** - * Compare a key name to an element in the \c all_enums array. - * - * \c bsearch always passes the key as the first parameter and the pointer - * to the array element as the second parameter. We can elimiate some - * extra work by taking advantage of that fact. - * - * \param a Pointer to the desired enum name. - * \param b Pointer to an element of the \c all_enums array. - */ -static int compar_name( const char *a, const enum_elt *b ) -{ - return strcmp( a, & enum_string_table[ b->offset ] ); -} - -/** - * Compare a key enum value to an element in the \c all_enums array. - * - * \c bsearch always passes the key as the first parameter and the pointer - * to the array element as the second parameter. We can elimiate some - * extra work by taking advantage of that fact. - * - * \param a Pointer to the desired enum name. - * \param b Pointer to an index into the \c all_enums array. - */ -static int compar_nr( const int *a, const unsigned *b ) -{ - return a[0] - all_enums[*b].n; -} - - -static char token_tmp[20]; - -const char *_mesa_lookup_enum_by_nr( int nr ) -{ - unsigned * i; - - i = (unsigned *) _mesa_bsearch(& nr, reduced_enums, - Elements(reduced_enums), - sizeof(reduced_enums[0]), - (cfunc) compar_nr); - - if ( i != NULL ) { - return & enum_string_table[ all_enums[ *i ].offset ]; - } - else { - /* this is not re-entrant safe, no big deal here */ - sprintf(token_tmp, "0x%x", nr); - return token_tmp; - } -} - -/* Get the name of an enum given that it is a primitive type. Avoids - * GL_FALSE/GL_POINTS ambiguity and others. - */ -const char *_mesa_lookup_prim_by_nr( int nr ) -{ - switch (nr) { - case GL_POINTS: return "GL_POINTS"; - case GL_LINES: return "GL_LINES"; - case GL_LINE_STRIP: return "GL_LINE_STRIP"; - case GL_LINE_LOOP: return "GL_LINE_LOOP"; - case GL_TRIANGLES: return "GL_TRIANGLES"; - case GL_TRIANGLE_STRIP: return "GL_TRIANGLE_STRIP"; - case GL_TRIANGLE_FAN: return "GL_TRIANGLE_FAN"; - case GL_QUADS: return "GL_QUADS"; - case GL_QUAD_STRIP: return "GL_QUAD_STRIP"; - case GL_POLYGON: return "GL_POLYGON"; - case GL_POLYGON+1: return "OUTSIDE_BEGIN_END"; - default: return ""; - } -} - - - -int _mesa_lookup_enum_by_name( const char *symbol ) -{ - enum_elt * f = NULL; - - if ( symbol != NULL ) { - f = (enum_elt *) _mesa_bsearch(symbol, all_enums, - Elements(all_enums), - sizeof( enum_elt ), - (cfunc) compar_name); - } - - return (f != NULL) ? f->n : -1; -} - -""" - return - - - def printBody(self, api): - self.process_enums( api ) - - keys = self.enum_table.keys() - keys.sort() - - name_table = [] - enum_table = {} - - for enum in keys: - low_pri = 9 - for [name, pri] in self.enum_table[ enum ]: - name_table.append( [name, enum] ) - - if pri < low_pri: - low_pri = pri - enum_table[enum] = name - - - name_table.sort() - - string_offsets = {} - i = 0; - print 'LONGSTRING static const char enum_string_table[] = ' - for [name, enum] in name_table: - print ' "%s\\0"' % (name) - string_offsets[ name ] = i - i += len(name) + 1 - - print ' ;' - print '' - - - print 'static const enum_elt all_enums[%u] =' % (len(name_table)) - print '{' - for [name, enum] in name_table: - print ' { %5u, 0x%08X }, /* %s */' % (string_offsets[name], enum, name) - print '};' - print '' - - print 'static const unsigned reduced_enums[%u] =' % (len(keys)) - print '{' - for enum in keys: - name = enum_table[ enum ] - if [name, enum] not in name_table: - print ' /* Error! %s, 0x%04x */ 0,' % (name, enum) - else: - i = name_table.index( [name, enum] ) - - print ' %4u, /* %s */' % (i, name) - print '};' - - - self.print_code() - return - - - def process_enums(self, api): - self.enum_table = {} - - for obj in api.enumIterateByName(): - if obj.value not in self.enum_table: - self.enum_table[ obj.value ] = [] - - - name = "GL_" + obj.name - priority = obj.priority() - self.enum_table[ obj.value ].append( [name, priority] ) - - -def show_usage(): - print "Usage: %s [-f input_file_name]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API( file_name ) - - printer = PrintGlEnums() - printer.Print( api ) diff --git a/src/mesa/glapi/gl_offsets.py b/src/mesa/glapi/gl_offsets.py deleted file mode 100644 index 54867b3463..0000000000 --- a/src/mesa/glapi/gl_offsets.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML -import license -import sys, getopt - -class PrintGlOffsets(gl_XML.gl_print_base): - def __init__(self, es=False): - gl_XML.gl_print_base.__init__(self) - - self.es = es - self.name = "gl_offsets.py (from Mesa)" - self.header_tag = '_GLAPI_OFFSETS_H_' - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - return - - def printBody(self, api): - print '/* this file should not be included directly in mesa */' - print '' - - functions = [] - abi_functions = [] - alias_functions = [] - count = 0 - for f in api.functionIterateByOffset(): - if not f.is_abi(): - functions.append( [f, count] ) - count += 1 - else: - abi_functions.append( f ) - - if self.es: - # remember functions with aliases - if len(f.entry_points) > 1: - alias_functions.append(f) - - for f in abi_functions: - print '#define _gloffset_%s %d' % (f.name, f.offset) - last_static = f.offset - - print '' - print '#if !defined(_GLAPI_USE_REMAP_TABLE)' - print '' - - for [f, index] in functions: - print '#define _gloffset_%s %d' % (f.name, f.offset) - - print '#define _gloffset_FIRST_DYNAMIC %d' % (api.next_offset) - - print '' - print '#else' - print '' - - for [f, index] in functions: - print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name) - - print '' - print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' - - if alias_functions: - print '' - print '/* define aliases for compatibility */' - for f in alias_functions: - for name in f.entry_points: - if name != f.name: - print '#define _gloffset_%s _gloffset_%s' % (name, f.name) - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-c]" % sys.argv[0] - print " -c Enable compatibility with OpenGL ES." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:c") - except Exception,e: - show_usage() - - es = False - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-c": - es = True - - api = gl_XML.parse_GL_API( file_name ) - - printer = PrintGlOffsets(es) - printer.Print( api ) diff --git a/src/mesa/glapi/gl_procs.py b/src/mesa/glapi/gl_procs.py deleted file mode 100644 index 5de61fbdfe..0000000000 --- a/src/mesa/glapi/gl_procs.py +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import license -import gl_XML, glX_XML -import sys, getopt - -class PrintGlProcs(gl_XML.gl_print_base): - def __init__(self, long_strings, es=False): - gl_XML.gl_print_base.__init__(self) - - self.es = es - self.long_strings = long_strings - self.name = "gl_procs.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004, 2006""", "BRIAN PAUL, IBM") - - - def printRealHeader(self): - print """ -/* This file is only included by glapi.c and is used for - * the GetProcAddress() function - */ - -typedef struct { - GLint Name_offset; -#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) - _glapi_proc Address; -#endif - GLuint Offset; -} glprocs_table_t; - -#if !defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , o } -#elif defined(NEED_FUNCTION_POINTER) && !defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f1 , o } -#elif defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f2 , o } -#elif !defined(NEED_FUNCTION_POINTER) && defined(GLX_INDIRECT_RENDERING) -# define NAME_FUNC_OFFSET(n,f1,f2,f3,o) { n , (_glapi_proc) f3 , o } -#endif - -""" - return - - def printRealFooter(self): - print '' - print '#undef NAME_FUNC_OFFSET' - return - - def printFunctionString(self, name): - if self.long_strings: - print ' "gl%s\\0"' % (name) - else: - print " 'g','l',", - for c in name: - print "'%s'," % (c), - - print "'\\0'," - - - def printBody(self, api): - print '' - if self.long_strings: - print 'static const char gl_string_table[] =' - else: - print 'static const char gl_string_table[] = {' - - base_offset = 0 - table = [] - for func in api.functionIterateByOffset(): - name = func.dispatch_name() - self.printFunctionString(func.name) - table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) - - # The length of the function's name, plus 2 for "gl", - # plus 1 for the NUL. - - base_offset += len(func.name) + 3 - - - for func in api.functionIterateByOffset(): - for n in func.entry_points: - if n != func.name: - name = func.dispatch_name() - self.printFunctionString( n ) - - if func.has_different_protocol(n): - alt_name = "gl" + func.static_glx_name(n) - table.append((base_offset, "gl" + name, alt_name, alt_name, func.name)) - else: - table.append((base_offset, "gl" + name, "gl" + name, "NULL", func.name)) - - base_offset += len(n) + 3 - - - if self.long_strings: - print ' ;' - else: - print '};' - - print '' - print '' - print "#ifdef USE_MGL_NAMESPACE" - for func in api.functionIterateByOffset(): - for n in func.entry_points: - if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): - print '#define gl_dispatch_stub_%u mgl_dispatch_stub_%u' % (func.offset, func.offset) - break - print "#endif /* USE_MGL_NAMESPACE */" - print '' - print '' - print '#if defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING)' - for func in api.functionIterateByOffset(): - for n in func.entry_points: - if (not func.is_static_entry_point(func.name)) or (func.has_different_protocol(n) and not func.is_static_entry_point(n)): - print '%s GLAPIENTRY gl_dispatch_stub_%u(%s);' % (func.return_type, func.offset, func.get_parameter_string()) - break - - if self.es: - categories = {} - for func in api.functionIterateByOffset(): - for n in func.entry_points: - cat, num = api.get_category_for_name(n) - if (cat.startswith("es") or cat.startswith("GL_OES")): - if not categories.has_key(cat): - categories[cat] = [] - proto = 'GLAPI %s GLAPIENTRY %s(%s);' \ - % (func.return_type, "gl" + n, func.get_parameter_string(n)) - categories[cat].append(proto) - if categories: - print '' - print '/* OpenGL ES specific prototypes */' - print '' - keys = categories.keys() - keys.sort() - for key in keys: - print '/* category %s */' % key - print "\n".join(categories[key]) - print '' - - print '#endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */' - - print '' - print 'static const glprocs_table_t static_functions[] = {' - - for info in table: - print ' NAME_FUNC_OFFSET(%5u, %s, %s, %s, _gloffset_%s),' % info - - print ' NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)' - print '};' - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0] - print "-c Enable compatibility with OpenGL ES." - print "-m mode mode can be one of:" - print " long - Create code for compilers that can handle very" - print " long string constants. (default)" - print " short - Create code for compilers that can only handle" - print " ANSI C89 string constants." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c") - except Exception,e: - show_usage() - - long_string = 1 - es = False - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - if val == "short": - long_string = 0 - elif val == "long": - long_string = 1 - else: - show_usage() - elif arg == "-c": - es = True - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer = PrintGlProcs(long_string, es) - printer.Print(api) diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py deleted file mode 100644 index 3bd7569e92..0000000000 --- a/src/mesa/glapi/gl_table.py +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/python2 - -# (C) Copyright IBM Corporation 2004 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import gl_XML -import license -import sys, getopt - -class PrintGlTable(gl_XML.gl_print_base): - def __init__(self, es=False): - gl_XML.gl_print_base.__init__(self) - - self.es = es - self.header_tag = '_GLAPI_TABLE_H_' - self.name = "gl_table.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM") - return - - - def printBody(self, api): - for f in api.functionIterateByOffset(): - arg_string = f.get_parameter_string() - print ' %s (GLAPIENTRYP %s)(%s); /* %d */' % (f.return_type, f.name, arg_string, f.offset) - - - def printRealHeader(self): - print '#ifndef GLAPIENTRYP' - print '# ifndef GLAPIENTRY' - print '# define GLAPIENTRY' - print '# endif' - print '' - print '# define GLAPIENTRYP GLAPIENTRY *' - print '#endif' - print '' - print '' - print 'struct _glapi_table' - print '{' - return - - - def printRealFooter(self): - print '};' - return - - -class PrintRemapTable(gl_XML.gl_print_base): - def __init__(self, es=False): - gl_XML.gl_print_base.__init__(self) - - self.es = es - self.header_tag = '_GLAPI_DISPATCH_H_' - self.name = "gl_table.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def printRealHeader(self): - print """ -/* this file should not be included directly in mesa */ - -/** - * \\file glapidispatch.h - * Macros for handling GL dispatch tables. - * - * For each known GL function, there are 3 macros in this file. The first - * macro is named CALL_FuncName and is used to call that GL function using - * the specified dispatch table. The other 2 macros, called GET_FuncName - * can SET_FuncName, are used to get and set the dispatch pointer for the - * named function in the specified dispatch table. - */ -""" - - return - - def printBody(self, api): - print '#define CALL_by_offset(disp, cast, offset, parameters) \\' - print ' (*(cast (GET_by_offset(disp, offset)))) parameters' - print '#define GET_by_offset(disp, offset) \\' - print ' (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL' - print '#define SET_by_offset(disp, offset, fn) \\' - print ' do { \\' - print ' if ( (offset) < 0 ) { \\' - print ' /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\\n", */ \\' - print ' /* __func__, __LINE__, disp, offset, # fn); */ \\' - print ' /* abort(); */ \\' - print ' } \\' - print ' else { \\' - print ' ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \\' - print ' } \\' - print ' } while(0)' - print '' - - functions = [] - abi_functions = [] - alias_functions = [] - count = 0 - for f in api.functionIterateByOffset(): - if not f.is_abi(): - functions.append( [f, count] ) - count += 1 - else: - abi_functions.append( f ) - - if self.es: - # remember functions with aliases - if len(f.entry_points) > 1: - alias_functions.append(f) - - - for f in abi_functions: - print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) - print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) - print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) - - - print '' - print '#if !defined(_GLAPI_USE_REMAP_TABLE)' - print '' - - for [f, index] in functions: - print '#define CALL_%s(disp, parameters) (*((disp)->%s)) parameters' % (f.name, f.name) - print '#define GET_%s(disp) ((disp)->%s)' % (f.name, f.name) - print '#define SET_%s(disp, fn) ((disp)->%s = fn)' % (f.name, f.name) - - print '' - print '#else' - print '' - print '#define driDispatchRemapTable_size %u' % (count) - print 'extern int driDispatchRemapTable[ driDispatchRemapTable_size ];' - print '' - - for [f, index] in functions: - print '#define %s_remap_index %u' % (f.name, index) - - print '' - - for [f, index] in functions: - arg_string = gl_XML.create_parameter_string( f.parameters, 0 ) - cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string) - - print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), driDispatchRemapTable[%s_remap_index], parameters)' % (f.name, cast, f.name) - print '#define GET_%s(disp) GET_by_offset(disp, driDispatchRemapTable[%s_remap_index])' % (f.name, f.name) - print '#define SET_%s(disp, fn) SET_by_offset(disp, driDispatchRemapTable[%s_remap_index], fn)' % (f.name, f.name) - - - print '' - print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' - - if alias_functions: - print '' - print '/* define aliases for compatibility */' - for f in alias_functions: - for name in f.entry_points: - if name != f.name: - print '#define CALL_%s(disp, parameters) CALL_%s(disp, parameters)' % (name, f.name) - print '#define GET_%s(disp) GET_%s(disp)' % (name, f.name) - print '#define SET_%s(disp, fn) SET_%s(disp, fn)' % (name, f.name) - print '' - - print '#if defined(_GLAPI_USE_REMAP_TABLE)' - for f in alias_functions: - for name in f.entry_points: - if name != f.name: - print '#define %s_remap_index %s_remap_index' % (name, f.name) - print '#endif /* defined(_GLAPI_USE_REMAP_TABLE) */' - print '' - - return - - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m mode] [-c]" % sys.argv[0] - print " -m mode Mode can be 'table' or 'remap_table'." - print " -c Enable compatibility with OpenGL ES." - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:m:c") - except Exception,e: - show_usage() - - mode = "table" - es = False - for (arg,val) in args: - if arg == "-f": - file_name = val - elif arg == "-m": - mode = val - elif arg == "-c": - es = True - - if mode == "table": - printer = PrintGlTable(es) - elif mode == "remap_table": - printer = PrintRemapTable(es) - else: - show_usage() - - api = gl_XML.parse_GL_API( file_name ) - - printer.Print( api ) diff --git a/src/mesa/glapi/gl_x86-64_asm.py b/src/mesa/glapi/gl_x86-64_asm.py deleted file mode 100644 index 31c1a2b93a..0000000000 --- a/src/mesa/glapi/gl_x86-64_asm.py +++ /dev/null @@ -1,334 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import license -import gl_XML, glX_XML -import sys, getopt, copy - -def should_use_push(registers): - for [reg, offset] in registers: - if reg[1:4] == "xmm": - return 0 - - N = len(registers) - return (N & 1) != 0 - - -def local_size(registers): - # The x86-64 ABI says "the value (%rsp - 8) is always a multiple of - # 16 when control is transfered to the function entry point." This - # means that the local stack usage must be (16*N)+8 for some value - # of N. (16*N)+8 = (8*(2N))+8 = 8*(2N+1). As long as N is odd, we - # meet this requirement. - - N = (len(registers) | 1) - return 8*N - - -def save_all_regs(registers): - adjust_stack = 0 - if not should_use_push(registers): - adjust_stack = local_size(registers) - print '\tsubq\t$%u, %%rsp' % (adjust_stack) - - for [reg, stack_offset] in registers: - save_reg( reg, stack_offset, adjust_stack ) - return - - -def restore_all_regs(registers): - adjust_stack = 0 - if not should_use_push(registers): - adjust_stack = local_size(registers) - - temp = copy.deepcopy(registers) - while len(temp): - [reg, stack_offset] = temp.pop() - restore_reg(reg, stack_offset, adjust_stack) - - if adjust_stack: - print '\taddq\t$%u, %%rsp' % (adjust_stack) - return - - -def save_reg(reg, offset, use_move): - if use_move: - if offset == 0: - print '\tmovq\t%s, (%%rsp)' % (reg) - else: - print '\tmovq\t%s, %u(%%rsp)' % (reg, offset) - else: - print '\tpushq\t%s' % (reg) - - return - - -def restore_reg(reg, offset, use_move): - if use_move: - if offset == 0: - print '\tmovq\t(%%rsp), %s' % (reg) - else: - print '\tmovq\t%u(%%rsp), %s' % (offset, reg) - else: - print '\tpopq\t%s' % (reg) - - return - - -class PrintGenericStubs(gl_XML.gl_print_base): - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_x86-64_asm.py (from Mesa)" - self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") - return - - - def get_stack_size(self, f): - size = 0 - for p in f.parameterIterator(): - size += p.get_stack_size() - - return size - - - def printRealHeader(self): - print "/* If we build with gcc's -fvisibility=hidden flag, we'll need to change" - print " * the symbol visibility mode to 'default'." - print ' */' - print '' - print '#include "x86/assyntax.h"' - print '' - print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303' - print '# pragma GCC visibility push(default)' - print '# define HIDDEN(x) .hidden x' - print '#else' - print '# define HIDDEN(x)' - print '#endif' - print '' - print '# if defined(USE_MGL_NAMESPACE)' - print '# define GL_PREFIX(n) GLNAME(CONCAT(mgl,n))' - print '# define _glapi_Dispatch _mglapi_Dispatch' - print '# else' - print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' - print '# endif' - print '' - print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' - print '# define THREADS' - print '#endif' - print '' - print '\t.text' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '\t.globl _x86_64_get_get_dispatch; HIDDEN(_x86_64_get_get_dispatch)' - print '_x86_64_get_get_dispatch:' - print '\tlea\t_x86_64_get_dispatch(%rip), %rax' - print '\tret' - print '' - print '\t.p2align\t4,,15' - print '_x86_64_get_dispatch:' - print '\tmovq\t_glapi_tls_Dispatch@GOTTPOFF(%rip), %rax' - print '\tmovq\t%fs:(%rax), %rax' - print '\tret' - print '\t.size\t_x86_64_get_dispatch, .-_x86_64_get_dispatch' - print '' - print '#elif defined(PTHREADS)' - print '' - print '\t.extern\t_glapi_Dispatch' - print '\t.extern\t_gl_DispatchTSD' - print '\t.extern\tpthread_getspecific' - print '' - print '\t.p2align\t4,,15' - print '_x86_64_get_dispatch:' - print '\tmovq\t_gl_DispatchTSD(%rip), %rdi' - print '\tjmp\tpthread_getspecific@PLT' - print '' - print '#elif defined(THREADS)' - print '' - print '\t.extern\t_glapi_get_dispatch' - print '' - print '#endif' - print '' - return - - - def printRealFooter(self): - print '' - print '#if defined(GLX_USE_TLS) && defined(__linux__)' - print ' .section ".note.ABI-tag", "a"' - print ' .p2align 2' - print ' .long 1f - 0f /* name length */' - print ' .long 3f - 2f /* data length */' - print ' .long 1 /* note length */' - print '0: .asciz "GNU" /* vendor name */' - print '1: .p2align 2' - print '2: .long 0 /* note data: the ABI tag */' - print ' .long 2,4,20 /* Minimum kernel version w/TLS */' - print '3: .p2align 2 /* pad out section */' - print '#endif /* GLX_USE_TLS */' - print '' - print '#if defined (__ELF__) && defined (__linux__)' - print ' .section .note.GNU-stack,"",%progbits' - print '#endif' - return - - - def printFunction(self, f): - - # The x86-64 ABI divides function parameters into a couple - # classes. For the OpenGL interface, the only ones that are - # relevent are INTEGER and SSE. Basically, the first 8 - # GLfloat or GLdouble parameters are placed in %xmm0 - %xmm7, - # the first 6 non-GLfloat / non-GLdouble parameters are placed - # in registers listed in int_parameters. - # - # If more parameters than that are required, they are passed - # on the stack. Therefore, we just have to make sure that - # %esp hasn't changed when we jump to the actual function. - # Since we're jumping to the function (and not calling it), we - # have to make sure of that anyway! - - int_parameters = ["%rdi", "%rsi", "%rdx", "%rcx", "%r8", "%r9"] - - int_class = 0 - sse_class = 0 - stack_offset = 0 - registers = [] - for p in f.parameterIterator(): - type_name = p.get_base_type_string() - - if p.is_pointer() or (type_name != "GLfloat" and type_name != "GLdouble"): - if int_class < 6: - registers.append( [int_parameters[int_class], stack_offset] ) - int_class += 1 - stack_offset += 8 - else: - if sse_class < 8: - registers.append( ["%%xmm%u" % (sse_class), stack_offset] ) - sse_class += 1 - stack_offset += 8 - - if ((int_class & 1) == 0) and (sse_class == 0): - registers.append( ["%rbp", 0] ) - - - name = f.dispatch_name() - - print '\t.p2align\t4,,15' - print '\t.globl\tGL_PREFIX(%s)' % (name) - print '\t.type\tGL_PREFIX(%s), @function' % (name) - if not f.is_static_entry_point(f.name): - print '\tHIDDEN(GL_PREFIX(%s))' % (name) - print 'GL_PREFIX(%s):' % (name) - print '#if defined(GLX_USE_TLS)' - print '\tcall\t_x86_64_get_dispatch@PLT' - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - print '\tjmp\t*%r11' - print '#elif defined(PTHREADS)' - - save_all_regs(registers) - print '\tcall\t_x86_64_get_dispatch@PLT' - restore_all_regs(registers) - - if f.offset == 0: - print '\tmovq\t(%rax), %r11' - else: - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - - print '\tjmp\t*%r11' - - print '#else' - print '\tmovq\t_glapi_Dispatch(%rip), %rax' - print '\ttestq\t%rax, %rax' - print '\tje\t1f' - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - print '\tjmp\t*%r11' - print '1:' - - save_all_regs(registers) - print '\tcall\t_glapi_get_dispatch' - restore_all_regs(registers) - - print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8) - print '\tjmp\t*%r11' - print '#endif /* defined(GLX_USE_TLS) */' - - print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (name, name) - print '' - return - - - def printBody(self, api): - for f in api.functionIterateByOffset(): - self.printFunction(f) - - - for f in api.functionIterateByOffset(): - dispatch = f.dispatch_name() - for n in f.entry_points: - if n != f.name: - if f.is_static_entry_point(n): - text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text - - return - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - mode = "generic" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == '-m': - mode = val - elif arg == "-f": - file_name = val - - if mode == "generic": - printer = PrintGenericStubs() - else: - print "ERROR: Invalid mode \"%s\" specified." % mode - show_usage() - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer.Print(api) diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py deleted file mode 100644 index d210f3a248..0000000000 --- a/src/mesa/glapi/gl_x86_asm.py +++ /dev/null @@ -1,270 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2004, 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import license -import gl_XML, glX_XML -import sys, getopt - -class PrintGenericStubs(gl_XML.gl_print_base): - - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "gl_x86_asm.py (from Mesa)" - self.license = license.bsd_license_template % ( \ -"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -(C) Copyright IBM Corporation 2004, 2005""", "BRIAN PAUL, IBM") - return - - - def get_stack_size(self, f): - size = 0 - for p in f.parameterIterator(): - if p.is_padding: - continue - - size += p.get_stack_size() - - return size - - - def printRealHeader(self): - print '#include "x86/assyntax.h"' - print '#include "glapi/glapioffsets.h"' - print '' - print '#if defined(STDCALL_API)' - print '# if defined(USE_MGL_NAMESPACE)' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))' - print '# else' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))' - print '# endif' - print '#else' - print '# if defined(USE_MGL_NAMESPACE)' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))' - print '# define _glapi_Dispatch _mglapi_Dispatch' - print '# else' - print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))' - print '# endif' - print '#endif' - print '' - print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))' - print '' - print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__)' - print '#define GLOBL_FN(x) GLOBL x ; .type x, function' - print '#else' - print '#define GLOBL_FN(x) GLOBL x' - print '#endif' - print '' - print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' - print '# define THREADS' - print '#endif' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '#ifdef GLX_X86_READONLY_TEXT' - print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)' - print '#else' - print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */' - print '#endif' - print '' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tCALL(_x86_get_dispatch) ;\t\t\t\\' - print '\tCTX_INSNS ; \\' - print '\tJMP(GL_OFFSET(off))' - print '' - print '#elif defined(PTHREADS)' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' - print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' - print '\tJE(1f) ;\t\t\t\t\t\\' - print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' - print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\' - print '\tJMP(GL_OFFSET(off))' - print '#elif defined(THREADS)' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' - print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' - print '\tJE(1f) ;\t\t\t\t\t\\' - print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' - print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\' - print '\tJMP(GL_OFFSET(off))' - print '#else /* Non-threaded version. */' - print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' - print 'ALIGNTEXT16;\t\t\t\t\t\t\\' - print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' - print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' - print '\tJMP(GL_OFFSET(off))' - print '#endif' - print '' - print '#ifdef HAVE_ALIAS' - print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' - print '\t.globl\tGL_PREFIX(fn, fn_alt) ;\t\t\t\\' - print '\t.set\tGL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)' - print '#else' - print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\' - print ' GL_STUB(fn, off, fn_alt)' - print '#endif' - print '' - print 'SEG_TEXT' - print '' - print '#ifdef GLX_USE_TLS' - print '' - print '\tGLOBL\tGLNAME(_x86_get_dispatch)' - print '\tHIDDEN(GLNAME(_x86_get_dispatch))' - print 'ALIGNTEXT16' - print 'GLNAME(_x86_get_dispatch):' - print '\tcall 1f' - print '1:\tpopl %eax' - print '\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax' - print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax' - print '\tret' - print '' - print '#elif defined(PTHREADS)' - print 'EXTERN GLNAME(_glapi_Dispatch)' - print 'EXTERN GLNAME(_gl_DispatchTSD)' - print 'EXTERN GLNAME(pthread_getspecific)' - print '' - print 'ALIGNTEXT16' - print 'GLNAME(_x86_get_dispatch):' - print '\tSUB_L(CONST(24), ESP)' - print '\tPUSH_L(GLNAME(_gl_DispatchTSD))' - print '\tCALL(GLNAME(pthread_getspecific))' - print '\tADD_L(CONST(28), ESP)' - print '\tRET' - print '#elif defined(THREADS)' - print 'EXTERN GLNAME(_glapi_get_dispatch)' - print '#endif' - print '' - - print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )' - print '\t\t.section\twtext, "awx", @progbits' - print '#endif /* defined( GLX_USE_TLS ) */' - - print '' - print '\t\tALIGNTEXT16' - print '\t\tGLOBL GLNAME(gl_dispatch_functions_start)' - print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_start))' - print 'GLNAME(gl_dispatch_functions_start):' - print '' - return - - - def printRealFooter(self): - print '' - print '\t\tGLOBL\tGLNAME(gl_dispatch_functions_end)' - print '\t\tHIDDEN(GLNAME(gl_dispatch_functions_end))' - print '\t\tALIGNTEXT16' - print 'GLNAME(gl_dispatch_functions_end):' - print '' - print '#if defined(GLX_USE_TLS) && defined(__linux__)' - print ' .section ".note.ABI-tag", "a"' - print ' .p2align 2' - print ' .long 1f - 0f /* name length */' - print ' .long 3f - 2f /* data length */' - print ' .long 1 /* note length */' - print '0: .asciz "GNU" /* vendor name */' - print '1: .p2align 2' - print '2: .long 0 /* note data: the ABI tag */' - print ' .long 2,4,20 /* Minimum kernel version w/TLS */' - print '3: .p2align 2 /* pad out section */' - print '#endif /* GLX_USE_TLS */' - print '' - print '#if defined (__ELF__) && defined (__linux__)' - print ' .section .note.GNU-stack,"",%progbits' - print '#endif' - return - - - def printBody(self, api): - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - stack = self.get_stack_size(f) - alt = "%s@%u" % (name, stack) - - print '\tGL_STUB(%s, _gloffset_%s, %s)' % (name, f.name, alt) - - if not f.is_static_entry_point(f.name): - print '\tHIDDEN(GL_PREFIX(%s, %s))' % (name, alt) - - - for f in api.functionIterateByOffset(): - name = f.dispatch_name() - stack = self.get_stack_size(f) - alt = "%s@%u" % (name, stack) - - if f.is_static_entry_point(f.name): - for n in f.entry_points: - if n != f.name: - alt2 = "%s@%u" % (n, stack) - text = '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % (n, f.name, alt2, f.name, alt) - - if f.has_different_protocol(n): - print '#ifndef GLX_INDIRECT_RENDERING' - print text - print '#endif' - else: - print text - - return - -def show_usage(): - print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - mode = "generic" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "m:f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == '-m': - mode = val - elif arg == "-f": - file_name = val - - if mode == "generic": - printer = PrintGenericStubs() - else: - print "ERROR: Invalid mode \"%s\" specified." % mode - show_usage() - - api = gl_XML.parse_GL_API(file_name, glX_XML.glx_item_factory()) - printer.Print(api) diff --git a/src/mesa/glapi/license.py b/src/mesa/glapi/license.py deleted file mode 100644 index 02181648e4..0000000000 --- a/src/mesa/glapi/license.py +++ /dev/null @@ -1,47 +0,0 @@ -# (C) Copyright IBM Corporation 2004 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -bsd_license_template = """%s -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sub license, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -%s, -AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.""" diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py deleted file mode 100644 index 38b0246ba5..0000000000 --- a/src/mesa/glapi/mesadef.py +++ /dev/null @@ -1,216 +0,0 @@ -#!/usr/bin/env python - - -# Mesa 3-D graphics library -# Version: 4.1 -# -# Copyright (C) 1999-2001 Brian Paul All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -# Generate the mesa.def file for Windows. -# -# Usage: -# mesadef.py >mesa.def -# Then copy to src/mesa/drivers/windows/gdi -# -# Dependencies: -# The apispec file must be in the current directory. - - - -import apiparser -import string - - -def PrintHead(): - print '; DO NOT EDIT - This file generated automatically by mesadef.py script' - print 'DESCRIPTION \'Mesa (OpenGL work-alike) for Win32\'' - print 'VERSION 6.0' - print ';' - print '; Module definition file for Mesa (OPENGL32.DLL)' - print ';' - print '; Note: The OpenGL functions use the STDCALL' - print '; function calling convention. Microsoft\'s' - print '; OPENGL32 uses this convention and so must the' - print '; Mesa OPENGL32 so that the Mesa DLL can be used' - print '; as a drop-in replacement.' - print ';' - print '; The linker exports STDCALL entry points with' - print '; \'decorated\' names; e.g., _glBegin@0, where the' - print '; trailing number is the number of bytes of ' - print '; parameter data pushed onto the stack. The' - print '; callee is responsible for popping this data' - print '; off the stack, usually via a RETF n instruction.' - print ';' - print '; However, the Microsoft OPENGL32.DLL does not export' - print '; the decorated names, even though the calling convention' - print '; is STDCALL. So, this module definition file is' - print '; needed to force the Mesa OPENGL32.DLL to export the' - print '; symbols in the same manner as the Microsoft DLL.' - print '; Were it not for this problem, this file would not' - print '; be needed (for the gl* functions) since the entry' - print '; points are compiled with dllexport declspec.' - print ';' - print '; However, this file is still needed to export "internal"' - print '; Mesa symbols for the benefit of the OSMESA32.DLL.' - print ';' - print 'EXPORTS' - return -#enddef - - -def PrintTail(): - print ';' - print '; WGL API' - print '\twglChoosePixelFormat' - print '\twglCopyContext' - print '\twglCreateContext' - print '\twglCreateLayerContext' - print '\twglDeleteContext' - print '\twglDescribeLayerPlane' - print '\twglDescribePixelFormat' - print '\twglGetCurrentContext' - print '\twglGetCurrentDC' - print '\twglGetExtensionsStringARB' - print '\twglGetLayerPaletteEntries' - print '\twglGetPixelFormat' - print '\twglGetProcAddress' - print '\twglMakeCurrent' - print '\twglRealizeLayerPalette' - print '\twglSetLayerPaletteEntries' - print '\twglSetPixelFormat' - print '\twglShareLists' - print '\twglSwapBuffers' - print '\twglSwapLayerBuffers' - print '\twglUseFontBitmapsA' - print '\twglUseFontBitmapsW' - print '\twglUseFontOutlinesA' - print '\twglUseFontOutlinesW' - print ';' - print '; Mesa internals - mostly for OSMESA' - print '\t_ac_CreateContext' - print '\t_ac_DestroyContext' - print '\t_ac_InvalidateState' - print '\t_glapi_get_context' - print '\t_glapi_get_proc_address' - print '\t_mesa_buffer_data' - print '\t_mesa_buffer_map' - print '\t_mesa_buffer_subdata' - print '\t_mesa_choose_tex_format' - print '\t_mesa_compressed_texture_size' - print '\t_mesa_create_framebuffer' - print '\t_mesa_create_visual' - print '\t_mesa_delete_buffer_object' - print '\t_mesa_delete_texture_object' - print '\t_mesa_destroy_framebuffer' - print '\t_mesa_destroy_visual' - print '\t_mesa_enable_1_3_extensions' - print '\t_mesa_enable_1_4_extensions' - print '\t_mesa_enable_1_5_extensions' - print '\t_mesa_enable_sw_extensions' - print '\t_mesa_error' - print '\t_mesa_free_context_data' - print '\t_mesa_get_current_context' - print '\t_mesa_init_default_imports' - print '\t_mesa_initialize_context' - print '\t_mesa_make_current' - print '\t_mesa_new_buffer_object' - print '\t_mesa_new_texture_object' - print '\t_mesa_problem' - print '\t_mesa_ResizeBuffersMESA' - print '\t_mesa_store_compressed_teximage1d' - print '\t_mesa_store_compressed_teximage2d' - print '\t_mesa_store_compressed_teximage3d' - print '\t_mesa_store_compressed_texsubimage1d' - print '\t_mesa_store_compressed_texsubimage2d' - print '\t_mesa_store_compressed_texsubimage3d' - print '\t_mesa_store_teximage1d' - print '\t_mesa_store_teximage2d' - print '\t_mesa_store_teximage3d' - print '\t_mesa_store_texsubimage1d' - print '\t_mesa_store_texsubimage2d' - print '\t_mesa_store_texsubimage3d' - print '\t_mesa_test_proxy_teximage' - print '\t_mesa_Viewport' - print '\t_mesa_meta_CopyColorSubTable' - print '\t_mesa_meta_CopyColorTable' - print '\t_mesa_meta_CopyConvolutionFilter1D' - print '\t_mesa_meta_CopyConvolutionFilter2D' - print '\t_mesa_meta_CopyTexImage1D' - print '\t_mesa_meta_CopyTexImage2D' - print '\t_mesa_meta_CopyTexSubImage1D' - print '\t_mesa_meta_CopyTexSubImage2D' - print '\t_mesa_meta_CopyTexSubImage3D' - print '\t_swrast_Accum' - print '\t_swrast_alloc_buffers' - print '\t_swrast_Bitmap' - print '\t_swrast_CopyPixels' - print '\t_swrast_DrawPixels' - print '\t_swrast_GetDeviceDriverReference' - print '\t_swrast_Clear' - print '\t_swrast_choose_line' - print '\t_swrast_choose_triangle' - print '\t_swrast_CreateContext' - print '\t_swrast_DestroyContext' - print '\t_swrast_InvalidateState' - print '\t_swrast_ReadPixels' - print '\t_swrast_zbuffer_address' - print '\t_swsetup_Wakeup' - print '\t_swsetup_CreateContext' - print '\t_swsetup_DestroyContext' - print '\t_swsetup_InvalidateState' - print '\t_tnl_CreateContext' - print '\t_tnl_DestroyContext' - print '\t_tnl_InvalidateState' - print '\t_tnl_MakeCurrent' - print '\t_tnl_run_pipeline' -#enddef - - -records = [] - -def FindOffset(funcName): - for (name, alias, offset) in records: - if name == funcName: - return offset - #endif - #endfor - return -1 -#enddef - - -def EmitEntry(name, returnType, argTypeList, argNameList, alias, offset): - if alias == '': - dispatchName = name - else: - dispatchName = alias - if offset < 0: - offset = FindOffset(dispatchName) - if offset >= 0 and string.find(name, "unused") == -1: - print '\tgl%s' % (name) - # save this info in case we need to look up an alias later - records.append((name, dispatchName, offset)) - -#enddef - - -PrintHead() -apiparser.ProcessSpecFile("APIspec", EmitEntry) -PrintTail() diff --git a/src/mesa/glapi/next_available_offset.sh b/src/mesa/glapi/next_available_offset.sh deleted file mode 100755 index e7d6c2f4af..0000000000 --- a/src/mesa/glapi/next_available_offset.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# -# (C) Copyright IBM Corporation 2004 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -# Trivial shell script to search the API definition file and print out the -# next numerically available API entry-point offset. This could probably -# be made smarter, but it would be better to use the existin Python -# framework to do that. This is just a quick-and-dirty hack. - -num=$(grep 'offset="' gl_API.xml |\ - sed 's/.\+ offset="//g;s/".*$//g' |\ - grep -v '?' |\ - sort -rn |\ - head -1) - -echo $((num + 1)) diff --git a/src/mesa/glapi/remap_helper.py b/src/mesa/glapi/remap_helper.py deleted file mode 100644 index d93c7a4285..0000000000 --- a/src/mesa/glapi/remap_helper.py +++ /dev/null @@ -1,226 +0,0 @@ -#!/usr/bin/env python - -# Copyright (C) 2009 Chia-I Wu -# All Rights Reserved. -# -# This is based on extension_helper.py by Ian Romanick. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -import gl_XML -import license -import sys, getopt, string - -def get_function_spec(func): - sig = "" - # derive parameter signature - for p in func.parameterIterator(): - if p.is_padding: - continue - # FIXME: This is a *really* ugly hack. :( - tn = p.type_expr.get_base_type_node() - if p.is_pointer(): - sig += 'p' - elif tn.integer: - sig += 'i' - elif tn.size == 4: - sig += 'f' - else: - sig += 'd' - - spec = [sig] - for ent in func.entry_points: - spec.append("gl" + ent) - - # spec is terminated by an empty string - spec.append('') - - return spec - -class PrintGlRemap(gl_XML.gl_print_base): - def __init__(self): - gl_XML.gl_print_base.__init__(self) - - self.name = "remap_helper.py (from Mesa)" - self.license = license.bsd_license_template % ("Copyright (C) 2009 Chia-I Wu ", "Chia-I Wu") - return - - - def printRealHeader(self): - print '#include "glapi/dispatch.h"' - print '' - return - - - def printBody(self, api): - print 'struct gl_function_remap {' - print ' GLint func_index;' - print ' GLint dispatch_offset; /* for sanity check */' - print '};' - print '' - - pool_indices = {} - - print '/* this is internal to remap.c */' - print '#ifdef need_MESA_remap_table' - print '' - print 'static const char _mesa_function_pool[] =' - - # output string pool - index = 0; - for f in api.functionIterateAll(): - pool_indices[f] = index - - spec = get_function_spec(f) - - # a function has either assigned offset, fixed offset, - # or no offset - if f.assign_offset: - comments = "will be remapped" - elif f.offset > 0: - comments = "offset %d" % f.offset - else: - comments = "dynamic" - - print ' /* _mesa_function_pool[%d]: %s (%s) */' \ - % (index, f.name, comments) - for line in spec: - print ' "%s\\0"' % line - index += len(line) + 1 - print ' ;' - print '' - - print '/* these functions need to be remapped */' - print 'static const struct {' - print ' GLint pool_index;' - print ' GLint remap_index;' - print '} MESA_remap_table_functions[] = {' - # output all functions that need to be remapped - # iterate by offsets so that they are sorted by remap indices - for f in api.functionIterateByOffset(): - if not f.assign_offset: - continue - print ' { %5d, %s_remap_index },' \ - % (pool_indices[f], f.name) - print ' { -1, -1 }' - print '};' - print '' - - # collect functions by versions/extensions - extension_functions = {} - abi_extensions = [] - for f in api.functionIterateAll(): - for n in f.entry_points: - category, num = api.get_category_for_name(n) - # consider only GL_VERSION_X_Y or extensions - c = gl_XML.real_category_name(category) - if c.startswith("GL_"): - if not extension_functions.has_key(c): - extension_functions[c] = [] - extension_functions[c].append(f) - # remember the ext names of the ABI - if (f.is_abi() and n == f.name and - c not in abi_extensions): - abi_extensions.append(c) - # ignore the ABI itself - for ext in abi_extensions: - extension_functions.pop(ext) - - extensions = extension_functions.keys() - extensions.sort() - - # output ABI functions that have alternative names (with ext suffix) - print '/* these functions are in the ABI, but have alternative names */' - print 'static const struct gl_function_remap MESA_alt_functions[] = {' - for ext in extensions: - funcs = [] - for f in extension_functions[ext]: - # test if the function is in the ABI and has alt names - if f.is_abi() and len(f.entry_points) > 1: - funcs.append(f) - if not funcs: - continue - print ' /* from %s */' % ext - for f in funcs: - print ' { %5d, _gloffset_%s },' \ - % (pool_indices[f], f.name) - print ' { -1, -1 }' - print '};' - print '' - - print '#endif /* need_MESA_remap_table */' - print '' - - # output remap helpers for DRI drivers - - for ext in extensions: - funcs = [] - remapped = [] - for f in extension_functions[ext]: - if f.assign_offset: - # these are handled above - remapped.append(f) - else: - # these functions are either in the - # abi, or have offset -1 - funcs.append(f) - - print '#if defined(need_%s)' % (ext) - if remapped: - print '/* functions defined in MESA_remap_table_functions are excluded */' - - # output extension functions that need to be mapped - print 'static const struct gl_function_remap %s_functions[] = {' % (ext) - for f in funcs: - if f.offset >= 0: - print ' { %5d, _gloffset_%s },' \ - % (pool_indices[f], f.name) - else: - print ' { %5d, -1 }, /* %s */' % \ - (pool_indices[f], f.name) - print ' { -1, -1 }' - print '};' - - print '#endif' - print '' - - return - - -def show_usage(): - print "Usage: %s [-f input_file_name]" % sys.argv[0] - sys.exit(1) - -if __name__ == '__main__': - file_name = "gl_API.xml" - - try: - (args, trail) = getopt.getopt(sys.argv[1:], "f:") - except Exception,e: - show_usage() - - for (arg,val) in args: - if arg == "-f": - file_name = val - - api = gl_XML.parse_GL_API( file_name ) - - printer = PrintGlRemap() - printer.Print( api ) diff --git a/src/mesa/glapi/typeexpr.py b/src/mesa/glapi/typeexpr.py deleted file mode 100644 index 8ba7de4862..0000000000 --- a/src/mesa/glapi/typeexpr.py +++ /dev/null @@ -1,292 +0,0 @@ -#!/usr/bin/env python - -# (C) Copyright IBM Corporation 2005 -# All Rights Reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# on the rights to use, copy, modify, merge, publish, distribute, sub -# license, and/or sell copies of the Software, and to permit persons to whom -# the Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# -# Authors: -# Ian Romanick - -import string, copy - -class type_node: - def __init__(self): - self.pointer = 0 # bool - self.const = 0 # bool - self.signed = 1 # bool - self.integer = 1 # bool - - # If elements is set to non-zero, then field is an array. - self.elements = 0 - - self.name = None - self.size = 0 # type's size in bytes - return - - - def string(self): - """Return string representation of this type_node.""" - s = "" - - if self.pointer: - s = "* " - - if self.const: - s += "const " - - if not self.pointer: - if self.integer: - if self.signed: - s += "signed " - else: - s += "unsigned " - - if self.name: - s += "%s " % (self.name) - - return s - - -class type_table: - def __init__(self): - self.types_by_name = {} - return - - - def add_type(self, type_expr): - self.types_by_name[ type_expr.get_base_name() ] = type_expr - return - - - def find_type(self, name): - if name in self.types_by_name: - return self.types_by_name[ name ] - else: - return None - - -def create_initial_types(): - tt = type_table() - - basic_types = [ - ("char", 1, 1), - ("short", 2, 1), - ("int", 4, 1), - ("long", 4, 1), - ("float", 4, 0), - ("double", 8, 0), - ("enum", 4, 1) - ] - - for (type_name, type_size, integer) in basic_types: - te = type_expression(None) - tn = type_node() - tn.name = type_name - tn.size = type_size - tn.integer = integer - te.expr.append(tn) - tt.add_type( te ) - - type_expression.built_in_types = tt - return - - -class type_expression: - built_in_types = None - - def __init__(self, type_string, extra_types = None): - self.expr = [] - - if not type_string: - return - - self.original_string = type_string - - if not type_expression.built_in_types: - raise RuntimeError("create_initial_types must be called before creating type_expression objects.") - - # Replace '*' with ' * ' in type_string. Then, split the string - # into tokens, separated by spaces. - tokens = string.split( string.replace( type_string, "*", " * " ) ) - - const = 0 - t = None - signed = 0 - unsigned = 0 - - for i in tokens: - if i == "const": - if t and t.pointer: - t.const = 1 - else: - const = 1 - elif i == "signed": - signed = 1 - elif i == "unsigned": - unsigned = 1 - elif i == "*": - # This is a quirky special-case because of the - # way the C works for types. If 'unsigned' is - # specified all by itself, it is treated the - # same as "unsigned int". - - if unsigned: - self.set_base_type( "int", signed, unsigned, const, extra_types ) - const = 0 - signed = 0 - unsigned = 0 - - if not self.expr: - raise RuntimeError("Invalid type expression (dangling pointer)") - - if signed: - raise RuntimeError("Invalid type expression (signed / unsigned applied to pointer)") - - t = type_node() - t.pointer = 1 - self.expr.append( t ) - else: - if self.expr: - raise RuntimeError('Invalid type expression (garbage after pointer qualifier -> "%s")' % (self.original_string)) - - self.set_base_type( i, signed, unsigned, const, extra_types ) - const = 0 - signed = 0 - unsigned = 0 - - if signed and unsigned: - raise RuntimeError("Invalid type expression (both signed and unsigned specified)") - - - if const: - raise RuntimeError("Invalid type expression (dangling const)") - - if unsigned: - raise RuntimeError("Invalid type expression (dangling signed)") - - if signed: - raise RuntimeError("Invalid type expression (dangling unsigned)") - - return - - - def set_base_type(self, type_name, signed, unsigned, const, extra_types): - te = type_expression.built_in_types.find_type( type_name ) - if not te: - te = extra_types.find_type( type_name ) - - if not te: - raise RuntimeError('Unknown base type "%s".' % (type_name)) - - self.expr = copy.deepcopy(te.expr) - - t = self.expr[ len(self.expr) - 1 ] - t.const = const - if signed: - t.signed = 1 - elif unsigned: - t.signed = 0 - - - def set_base_type_node(self, tn): - self.expr = [tn] - return - - - def set_elements(self, count): - tn = self.expr[0] - - tn.elements = count - return - - - def string(self): - s = "" - for t in self.expr: - s += t.string() - - return s - - - def get_base_type_node(self): - return self.expr[0] - - - def get_base_name(self): - if len(self.expr): - return self.expr[0].name - else: - return None - - - def get_element_size(self): - tn = self.expr[0] - - if tn.elements: - return tn.elements * tn.size - else: - return tn.size - - - def get_element_count(self): - tn = self.expr[0] - return tn.elements - - - def get_stack_size(self): - tn = self.expr[ len(self.expr) - 1 ] - - if tn.elements or tn.pointer: - return 4 - elif not tn.integer: - return tn.size - else: - return 4 - - - def is_pointer(self): - tn = self.expr[ len(self.expr) - 1 ] - return tn.pointer - - - def format_string(self): - tn = self.expr[ len(self.expr) - 1 ] - if tn.pointer: - return "%p" - elif not tn.integer: - return "%f" - else: - return "%d" - - - -if __name__ == '__main__': - - types_to_try = [ "int", "int *", "const int *", "int * const", "const int * const", \ - "unsigned * const *", \ - "float", "const double", "double * const"] - - create_initial_types() - - for t in types_to_try: - print 'Trying "%s"...' % (t) - te = type_expression( t ) - print 'Got "%s" (%u, %u).' % (te.string(), te.get_stack_size(), te.get_element_size()) -- cgit v1.2.3 From ad520aaa87d30957ba5635cede1da828a5894105 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Mon, 22 Feb 2010 22:27:48 +0200 Subject: glapi: fix code generation Makefile after mv --- src/mesa/glapi/gen/Makefile | 191 +++++++++++++++++++++++++++----------------- 1 file changed, 118 insertions(+), 73 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/gen/Makefile b/src/mesa/glapi/gen/Makefile index da679607d7..6b6b9aecaa 100644 --- a/src/mesa/glapi/gen/Makefile +++ b/src/mesa/glapi/gen/Makefile @@ -4,49 +4,75 @@ # up to him/her to re-run this makefile and check in the newly generated files. -TOP = ../../.. +TOP = ../../../.. include $(TOP)/configs/current -OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h glapidispatch.h \ - ../main/enums.c \ - ../main/remap_helper.h \ - ../x86/glapi_x86.S \ - ../x86-64/glapi_x86-64.S \ - ../sparc/glapi_sparc.S \ - ../../glx/indirect.c \ - ../../glx/indirect.h \ - ../../glx/indirect_init.c \ - ../../glx/indirect_size.h \ - ../../glx/indirect_size.c - - -GLX_DIR = $(XORG_BASE)/glx - -SERVER_GLAPI_FILES = \ - $(GLX_DIR)/glapi.h \ - $(GLX_DIR)/glapi.c \ - $(GLX_DIR)/glapi_nop.c \ - $(GLX_DIR)/glthread.c \ - $(GLX_DIR)/glthread.h - -SERVER_OUTPUTS = \ - $(GLX_DIR)/indirect_dispatch.c \ - $(GLX_DIR)/indirect_dispatch_swap.c \ - $(GLX_DIR)/indirect_dispatch.h \ - $(GLX_DIR)/indirect_reqsize.c \ - $(GLX_DIR)/indirect_reqsize.h \ - $(GLX_DIR)/indirect_size.h \ - $(GLX_DIR)/indirect_size_get.c \ - $(GLX_DIR)/indirect_size_get.h \ - $(GLX_DIR)/indirect_table.c \ - $(GLX_DIR)/glapitemp.h \ - $(GLX_DIR)/glapitable.h \ - $(GLX_DIR)/glapioffsets.h \ - $(GLX_DIR)/glapidispatch.h \ - $(GLX_DIR)/glprocs.h \ - $(SERVER_GLAPI_FILES) - -API_XML = gl_API.xml \ +MESA_DIR = $(TOP)/src/mesa +MESA_GLAPI_DIR = $(TOP)/src/mesa/glapi +MESA_GLX_DIR = $(TOP)/src/glx + +MESA_GLAPI_OUTPUTS = \ + $(MESA_GLAPI_DIR)/glprocs.h \ + $(MESA_GLAPI_DIR)/glapitemp.h \ + $(MESA_GLAPI_DIR)/glapioffsets.h \ + $(MESA_GLAPI_DIR)/glapitable.h \ + $(MESA_GLAPI_DIR)/glapidispatch.h + +MESA_GLAPI_ASM_OUTPUTS = \ + $(MESA_DIR)/x86/glapi_x86.S \ + $(MESA_DIR)/x86-64/glapi_x86-64.S \ + $(MESA_DIR)/sparc/glapi_sparc.S + +MESA_OUTPUTS = \ + $(MESA_GLAPI_OUTPUTS) \ + $(MESA_GLAPI_ASM_OUTPUTS) \ + $(MESA_DIR)/main/enums.c \ + $(MESA_DIR)/main/remap_helper.h \ + $(MESA_GLX_DIR)/indirect.c \ + $(MESA_GLX_DIR)/indirect.h \ + $(MESA_GLX_DIR)/indirect_init.c \ + $(MESA_GLX_DIR)/indirect_size.h \ + $(MESA_GLX_DIR)/indirect_size.c + +###################################################################### + +XORG_GLX_DIR = $(XORG_BASE)/glx + +XORG_GLAPI_FILES = \ + $(XORG_GLX_DIR)/glapi.h \ + $(XORG_GLX_DIR)/glapi.c \ + $(XORG_GLX_DIR)/glapi_getproc.c \ + $(XORG_GLX_DIR)/glapi_nop.c \ + $(XORG_GLX_DIR)/glthread.c \ + $(XORG_GLX_DIR)/glthread.h + +XORG_GLAPI_OUTPUTS = \ + $(XORG_GLX_DIR)/glprocs.h \ + $(XORG_GLX_DIR)/glapitemp.h \ + $(XORG_GLX_DIR)/glapioffsets.h \ + $(XORG_GLX_DIR)/glapitable.h \ + $(XORG_GLX_DIR)/glapidispatch.h + +# XXX sync mesa and xorg glapi, generate in mesa only and just copy in glx/glapi +# +# $(XORG_GLAPI_FILES) \ +# $(XORG_GLAPI_OUTPUTS) \ + +XORG_OUTPUTS = \ + $(XORG_GLX_DIR)/indirect_dispatch.c \ + $(XORG_GLX_DIR)/indirect_dispatch_swap.c \ + $(XORG_GLX_DIR)/indirect_dispatch.h \ + $(XORG_GLX_DIR)/indirect_reqsize.c \ + $(XORG_GLX_DIR)/indirect_reqsize.h \ + $(XORG_GLX_DIR)/indirect_size.h \ + $(XORG_GLX_DIR)/indirect_size_get.c \ + $(XORG_GLX_DIR)/indirect_size_get.h \ + $(XORG_GLX_DIR)/indirect_table.c + +###################################################################### + +API_XML = \ + gl_API.xml \ ARB_copy_buffer.xml \ ARB_depth_clamp.xml \ ARB_draw_elements_base_vertex.xml \ @@ -63,96 +89,115 @@ API_XML = gl_API.xml \ EXT_texture_array.xml \ NV_conditional_render.xml -COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py +COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py + COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py -all: check-xorg-source $(OUTPUTS) $(SERVER_OUTPUTS) +###################################################################### + +all: mesa xorg + +mesa: $(MESA_OUTPUTS) + +xorg: check-xorg-source $(XORG_OUTPUTS) check-xorg-source: - @if ! test -d $(GLX_DIR); then \ + @if ! test -d $(XORG_GLX_DIR); then \ echo "ERROR: Must specify path to xserver checkout; set XORG_BASE."; \ exit 1; \ fi -$(GLX_DIR)/%.c: %.c +clean: + -rm -f *~ *.pyo + -rm -f $(MESA_OUTPUTS) + +###################################################################### + +$(XORG_GLX_DIR)/%.c: %.c cp $< $@ -$(GLX_DIR)/%.h: %.h +$(XORG_GLX_DIR)/%.h: %.h cp $< $@ -glprocs.h $(GLX_DIR)/glprocs.h: gl_procs.py $(COMMON) +###################################################################### + +$(MESA_GLAPI_DIR)/glprocs.h $(XORG_GLX_DIR)/glprocs.h: gl_procs.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -glapitemp.h $(GLX_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) +$(MESA_GLAPI_DIR)/glapitemp.h $(XORG_GLX_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -glapioffsets.h $(GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) +$(MESA_GLAPI_DIR)/glapioffsets.h $(XORG_GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -glapitable.h $(GLX_DIR)/glapitable.h: gl_table.py $(COMMON) +$(MESA_GLAPI_DIR)/glapitable.h $(XORG_GLX_DIR)/glapitable.h: gl_table.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -glapidispatch.h $(GLX_DIR)/glapidispatch.h: gl_table.py $(COMMON) +$(MESA_GLAPI_DIR)/glapidispatch.h $(XORG_GLX_DIR)/glapidispatch.h: gl_table.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ -../main/enums.c: gl_enums.py $(COMMON) +###################################################################### + +$(MESA_DIR)/x86/glapi_x86.S: gl_x86_asm.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -../main/remap_helper.h: remap_helper.py $(COMMON) +$(MESA_DIR)/x86-64/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -../x86/glapi_x86.S: gl_x86_asm.py $(COMMON) +$(MESA_DIR)/sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -../x86-64/glapi_x86-64.S: gl_x86-64_asm.py $(COMMON) +###################################################################### + +$(MESA_DIR)/main/enums.c: gl_enums.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -../sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) +$(MESA_DIR)/main/remap_helper.h: remap_helper.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -../../glx/indirect.c: glX_proto_send.py $(COMMON_GLX) +###################################################################### + +$(MESA_GLX_DIR)/indirect.c: glX_proto_send.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ -../../glx/indirect.h: glX_proto_send.py $(COMMON_GLX) +$(MESA_GLX_DIR)/indirect.h: glX_proto_send.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m init_h > $@ -../../glx/indirect_init.c: glX_proto_send.py $(COMMON_GLX) +$(MESA_GLX_DIR)/indirect_init.c: glX_proto_send.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m init_c > $@ -../../glx/indirect_size.h $(GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX) +$(MESA_GLX_DIR)/indirect_size.h $(XORG_GLX_DIR)/indirect_size.h: glX_proto_size.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-set -h _INDIRECT_SIZE_H_ \ | $(INDENT) $(INDENT_FLAGS) > $@ -../../glx/indirect_size.c: glX_proto_size.py $(COMMON_GLX) +$(MESA_GLX_DIR)/indirect_size.c: glX_proto_size.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c --only-set \ | $(INDENT) $(INDENT_FLAGS) > $@ -$(GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) +###################################################################### + +$(XORG_GLX_DIR)/indirect_dispatch.c: glX_proto_recv.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c > $@ -$(GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) +$(XORG_GLX_DIR)/indirect_dispatch_swap.c: glX_proto_recv.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_c -s > $@ -$(GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX) +$(XORG_GLX_DIR)/indirect_dispatch.h: glX_proto_recv.py gl_and_glX_API.xml $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m dispatch_h -f gl_and_glX_API.xml -s > $@ -$(GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX) +$(XORG_GLX_DIR)/indirect_size_get.h: glX_proto_size.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m size_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ | $(INDENT) $(INDENT_FLAGS) > $@ -$(GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) +$(XORG_GLX_DIR)/indirect_size_get.c: glX_proto_size.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m size_c | $(INDENT) $(INDENT_FLAGS) > $@ -$(GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX) +$(XORG_GLX_DIR)/indirect_reqsize.h: glX_proto_size.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_h --only-get -h '_INDIRECT_SIZE_GET_H_' \ | $(INDENT) $(INDENT_FLAGS) -l200 > $@ -$(GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) +$(XORG_GLX_DIR)/indirect_reqsize.c: glX_proto_size.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m reqsize_c | $(INDENT) $(INDENT_FLAGS) > $@ -$(GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX) +$(XORG_GLX_DIR)/indirect_table.c: glX_server_table.py gl_and_glX_API.xml $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -f gl_and_glX_API.xml > $@ - -clean: - -rm -f *~ *.pyo - -rm -f $(OUTPUTS) -- cgit v1.2.3 From 295a02549d74559831023455d1bb0ebf42bc1415 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Mon, 22 Feb 2010 22:27:49 +0200 Subject: glapi: fix es after mv --- Makefile | 6 +++--- src/mesa/es/glapi/Makefile | 2 +- src/mesa/es/glapi/base1_API.xml | 2 +- src/mesa/es/glapi/base2_API.xml | 2 +- src/mesa/es/glapi/es1_API.xml | 2 +- src/mesa/es/glapi/es1_COMPAT.xml | 2 +- src/mesa/es/glapi/es1_EXT.xml | 2 +- src/mesa/es/glapi/es2_API.xml | 2 +- src/mesa/es/glapi/es2_COMPAT.xml | 2 +- src/mesa/es/glapi/es2_EXT.xml | 2 +- src/mesa/es/glapi/es_COMPAT.xml | 4 ++-- src/mesa/es/glapi/es_EXT.xml | 2 +- src/mesa/es/glapi/gl_compare.py | 2 +- src/mesa/es/glapi/gl_parse_header.py | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/Makefile b/Makefile index ea5751d947..3e92e1312e 100644 --- a/Makefile +++ b/Makefile @@ -314,9 +314,9 @@ MAIN_FILES = \ ES_FILES = \ $(DIRECTORY)/include/GLES/*.h \ $(DIRECTORY)/include/GLES2/*.h \ - $(DIRECTORY)/src/mesa/glapi/*.xml \ - $(DIRECTORY)/src/mesa/glapi/*.py \ - $(DIRECTORY)/src/mesa/glapi/*.dtd \ + $(DIRECTORY)/src/mesa/glapi/gen/*.xml \ + $(DIRECTORY)/src/mesa/glapi/gen/*.py \ + $(DIRECTORY)/src/mesa/glapi/gen/*.dtd \ $(DIRECTORY)/src/mesa/es/glapi/Makefile \ $(DIRECTORY)/src/mesa/es/glapi/*.xml \ $(DIRECTORY)/src/mesa/es/glapi/*.py \ diff --git a/src/mesa/es/glapi/Makefile b/src/mesa/es/glapi/Makefile index 1e32af867d..e8a9afab7c 100644 --- a/src/mesa/es/glapi/Makefile +++ b/src/mesa/es/glapi/Makefile @@ -1,5 +1,5 @@ TOP = ../../../.. -GLAPI = ../../glapi +GLAPI = ../../glapi/gen include $(TOP)/configs/current OUTPUTS := \ diff --git a/src/mesa/es/glapi/base1_API.xml b/src/mesa/es/glapi/base1_API.xml index f5d136ccef..72e4128272 100644 --- a/src/mesa/es/glapi/base1_API.xml +++ b/src/mesa/es/glapi/base1_API.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/es1_API.xml b/src/mesa/es/glapi/es1_API.xml index 7ee5515f19..1ac1467458 100644 --- a/src/mesa/es/glapi/es1_API.xml +++ b/src/mesa/es/glapi/es1_API.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/es1_COMPAT.xml b/src/mesa/es/glapi/es1_COMPAT.xml index 4fc9223cc0..1f45a8c0b6 100644 --- a/src/mesa/es/glapi/es1_COMPAT.xml +++ b/src/mesa/es/glapi/es1_COMPAT.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/es1_EXT.xml b/src/mesa/es/glapi/es1_EXT.xml index de4868cfd4..d4abd81046 100644 --- a/src/mesa/es/glapi/es1_EXT.xml +++ b/src/mesa/es/glapi/es1_EXT.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/es2_API.xml b/src/mesa/es/glapi/es2_API.xml index 266c07613c..b476dbe00f 100644 --- a/src/mesa/es/glapi/es2_API.xml +++ b/src/mesa/es/glapi/es2_API.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/es2_COMPAT.xml b/src/mesa/es/glapi/es2_COMPAT.xml index 61f11a604e..5ecd4a1ba6 100644 --- a/src/mesa/es/glapi/es2_COMPAT.xml +++ b/src/mesa/es/glapi/es2_COMPAT.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/es2_EXT.xml b/src/mesa/es/glapi/es2_EXT.xml index 3615772b56..dcf9858569 100644 --- a/src/mesa/es/glapi/es2_EXT.xml +++ b/src/mesa/es/glapi/es2_EXT.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/es_COMPAT.xml b/src/mesa/es/glapi/es_COMPAT.xml index bb6d28db83..1bd66dad30 100644 --- a/src/mesa/es/glapi/es_COMPAT.xml +++ b/src/mesa/es/glapi/es_COMPAT.xml @@ -1,5 +1,5 @@ - + @@ -2641,6 +2641,6 @@ - + diff --git a/src/mesa/es/glapi/es_EXT.xml b/src/mesa/es/glapi/es_EXT.xml index b76cda929a..629ba90528 100644 --- a/src/mesa/es/glapi/es_EXT.xml +++ b/src/mesa/es/glapi/es_EXT.xml @@ -1,5 +1,5 @@ - + diff --git a/src/mesa/es/glapi/gl_compare.py b/src/mesa/es/glapi/gl_compare.py index 7a2148cb1f..6b5e43bb98 100644 --- a/src/mesa/es/glapi/gl_compare.py +++ b/src/mesa/es/glapi/gl_compare.py @@ -25,7 +25,7 @@ import sys import os.path import getopt -GLAPI = "../../glapi" +GLAPI = "../../glapi/gen" sys.path.append(GLAPI) import gl_XML diff --git a/src/mesa/es/glapi/gl_parse_header.py b/src/mesa/es/glapi/gl_parse_header.py index 8b8d16b395..5382eba35c 100644 --- a/src/mesa/es/glapi/gl_parse_header.py +++ b/src/mesa/es/glapi/gl_parse_header.py @@ -26,7 +26,7 @@ import os.path import getopt import re -GLAPI = "../../glapi" +GLAPI = "../../glapi/gen" sys.path.append(GLAPI) class HeaderParser(object): -- cgit v1.2.3 From c8aaa24f2da4e4da3d726e0a58459c7d9cb64b93 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 10 Feb 2010 18:07:38 -0700 Subject: llvmpipe: added some assertions --- src/gallium/drivers/llvmpipe/lp_scene.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index b7116297ec..cba0e21298 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -100,6 +100,9 @@ lp_scene_bin_reset(struct lp_scene *scene, unsigned x, unsigned y) struct cmd_block *block; struct cmd_block *tmp; + assert(x < TILES_X); + assert(y < TILES_Y); + for (block = list->head; block != list->tail; block = tmp) { tmp = block->next; FREE(block); -- cgit v1.2.3 From 049b4c340575ebc788d9a009829980fafa587eff Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 10 Feb 2010 18:10:16 -0700 Subject: llvmpipe: added assertions to verify that scene is empty --- src/gallium/drivers/llvmpipe/lp_rast.c | 3 +++ src/gallium/drivers/llvmpipe/lp_setup.c | 2 ++ 2 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 6dbcb3c9b3..bbd63aec2b 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -603,6 +603,9 @@ release_scene( struct lp_rasterizer *rast, util_unreference_framebuffer_state( &scene->fb ); lp_scene_reset( scene ); + + assert(lp_scene_is_empty(scene)); + lp_scene_enqueue( rast->empty_scenes, scene ); rast->curr_scene = NULL; } diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index cb873667a2..3aec9de373 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -64,6 +64,8 @@ lp_setup_get_current_scene(struct setup_context *setup) */ setup->scene = lp_scene_dequeue(setup->empty_scenes, TRUE); + assert(lp_scene_is_empty(setup->scene)); + if(0)lp_scene_reset( setup->scene ); /* XXX temporary? */ lp_scene_set_framebuffer_size(setup->scene, -- cgit v1.2.3 From f7830dc3916b355452f656dba955804fd7535544 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Feb 2010 18:23:15 -0700 Subject: st/glx: added PIPE_FORMAT_Z24S8_UNORM code --- src/gallium/state_trackers/glx/xlib/xm_api.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 4aac08a108..1798faa0f3 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -376,7 +376,8 @@ create_xmesa_buffer(Drawable d, BufferType type, #endif if (vis->mesa_visual.stencilBits == 8) { - if (depthFormat == PIPE_FORMAT_S8Z24_UNORM) + if (depthFormat == PIPE_FORMAT_S8Z24_UNORM || + depthFormat == PIPE_FORMAT_Z24S8_UNORM) stencilFormat = depthFormat; else stencilFormat = PIPE_FORMAT_S8_UNORM; @@ -388,6 +389,10 @@ create_xmesa_buffer(Drawable d, BufferType type, /* use 24-bit Z, undefined stencil channel */ depthFormat = PIPE_FORMAT_X8Z24_UNORM; } + else if (depthFormat == PIPE_FORMAT_Z24S8_UNORM) { + /* use 24-bit Z, undefined stencil channel */ + depthFormat = PIPE_FORMAT_Z24X8_UNORM; + } } -- cgit v1.2.3 From a84575cdc0c8193b2c7858734e2ec6b1ec4511b2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Feb 2010 18:55:28 -0700 Subject: st/glx: improved depth/stencil format selection code Actually ask the gallium screen what Z/stencil format is supported. This will let us remove some hacks in the llvmpipe driver. --- src/gallium/state_trackers/glx/xlib/glx_api.c | 5 +- src/gallium/state_trackers/glx/xlib/xm_api.c | 106 ++++++++++++++++---------- src/gallium/state_trackers/glx/xlib/xm_api.h | 3 + 3 files changed, 71 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 656a69131e..08bf624b5c 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -689,6 +689,8 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) int desiredVisualID = -1; int numAux = 0; + xmesa_init(); + parselist = list; while (*parselist) { @@ -941,9 +943,6 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) /* give the visual some useful GLX attributes */ double_flag = GL_TRUE; rgb_flag = GL_TRUE; - depth_size = default_depth_bits(); - stencil_size = STENCIL_BITS; - /* XXX accum??? */ } } else if (level==0) { diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 1798faa0f3..188b885f68 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -319,6 +319,51 @@ choose_pixel_format(XMesaVisual v) +/** + * Query the default gallium screen for a Z/Stencil format that + * at least matches the given depthBits and stencilBits. + */ +static void +xmesa_choose_z_stencil_format(int depthBits, int stencilBits, + enum pipe_format *depthFormat, + enum pipe_format *stencilFormat) +{ + const enum pipe_texture_target target = PIPE_TEXTURE_2D; + const unsigned tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL; + const unsigned geom_flags = (PIPE_TEXTURE_GEOM_NON_SQUARE | + PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO); + static enum pipe_format formats[] = { + PIPE_FORMAT_Z24S8_UNORM, + PIPE_FORMAT_S8Z24_UNORM, + PIPE_FORMAT_Z16_UNORM, + PIPE_FORMAT_Z32_UNORM + }; + int i; + + assert(screen); + + *depthFormat = *stencilFormat = PIPE_FORMAT_NONE; + + /* search for supported format */ + for (i = 0; i < Elements(formats); i++) { + if (screen->is_format_supported(screen, formats[i], + target, tex_usage, geom_flags)) { + *depthFormat = formats[i]; + break; + } + } + + if (stencilBits) { + *stencilFormat = *depthFormat; + } + + /* XXX we should check that he chosen format has at least as many bits + * as what was requested. + */ +} + + + /**********************************************************************/ /***** Linked list of XMesaBuffers *****/ /**********************************************************************/ @@ -361,39 +406,9 @@ create_xmesa_buffer(Drawable d, BufferType type, /* determine PIPE_FORMATs for buffers */ colorFormat = choose_pixel_format(vis); - if (vis->mesa_visual.depthBits == 0) - depthFormat = PIPE_FORMAT_NONE; -#ifdef GALLIUM_CELL /* XXX temporary for Cell! */ - else - depthFormat = PIPE_FORMAT_S8Z24_UNORM; -#else - else if (vis->mesa_visual.depthBits <= 16) - depthFormat = PIPE_FORMAT_Z16_UNORM; - else if (vis->mesa_visual.depthBits <= 24) - depthFormat = PIPE_FORMAT_S8Z24_UNORM; - else - depthFormat = PIPE_FORMAT_Z32_UNORM; -#endif - - if (vis->mesa_visual.stencilBits == 8) { - if (depthFormat == PIPE_FORMAT_S8Z24_UNORM || - depthFormat == PIPE_FORMAT_Z24S8_UNORM) - stencilFormat = depthFormat; - else - stencilFormat = PIPE_FORMAT_S8_UNORM; - } - else { - /* no stencil */ - stencilFormat = PIPE_FORMAT_NONE; - if (depthFormat == PIPE_FORMAT_S8Z24_UNORM) { - /* use 24-bit Z, undefined stencil channel */ - depthFormat = PIPE_FORMAT_X8Z24_UNORM; - } - else if (depthFormat == PIPE_FORMAT_Z24S8_UNORM) { - /* use 24-bit Z, undefined stencil channel */ - depthFormat = PIPE_FORMAT_Z24X8_UNORM; - } - } + xmesa_choose_z_stencil_format(vis->mesa_visual.depthBits, + vis->mesa_visual.stencilBits, + &depthFormat, &stencilFormat); get_drawable_size(vis->display, d, &width, &height); @@ -658,6 +673,8 @@ XMesaVisual XMesaCreateVisual( Display *display, XMesaVisual v; GLint red_bits, green_bits, blue_bits, alpha_bits; + xmesa_init(); + /* For debugging only */ if (_mesa_getenv("MESA_XSYNC")) { /* This makes debugging X easier. @@ -753,6 +770,21 @@ void XMesaDestroyVisual( XMesaVisual v ) } +/** + * Do one-time initializations. + */ +void +xmesa_init(void) +{ + static GLboolean firstTime = GL_TRUE; + if (firstTime) { + pipe_mutex_init(_xmesa_lock); + _screen = driver.create_pipe_screen(); + screen = trace_screen_create( _screen ); + firstTime = GL_FALSE; + } +} + /** * Create a new XMesaContext. @@ -764,18 +796,12 @@ void XMesaDestroyVisual( XMesaVisual v ) PUBLIC XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) { - static GLboolean firstTime = GL_TRUE; struct pipe_context *pipe = NULL; XMesaContext c; GLcontext *mesaCtx; uint pf; - if (firstTime) { - pipe_mutex_init(_xmesa_lock); - _screen = driver.create_pipe_screen(); - screen = trace_screen_create( _screen ); - firstTime = GL_FALSE; - } + xmesa_init(); /* Note: the XMesaContext contains a Mesa GLcontext struct (inheritance) */ c = (XMesaContext) CALLOC_STRUCT(xmesa_context); diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.h b/src/gallium/state_trackers/glx/xlib/xm_api.h index 63a329cbe0..004cb260dc 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.h +++ b/src/gallium/state_trackers/glx/xlib/xm_api.h @@ -366,6 +366,9 @@ xmesa_buffer(GLframebuffer *fb) } +extern void +xmesa_init(void); + extern void xmesa_delete_framebuffer(struct gl_framebuffer *fb); -- cgit v1.2.3 From 0e7c22ff3c8532dad35a08f8b350be78383bfb0d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Feb 2010 18:56:24 -0700 Subject: llvmpipe: Z16 format is not supported --- src/gallium/drivers/llvmpipe/lp_screen.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 1cd3ea9a84..ad5a484959 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -233,6 +233,10 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, format_desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB && format_desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS) return FALSE; + + /* not supported yet */ + if (format == PIPE_FORMAT_Z16_UNORM) + return FALSE; } return TRUE; -- cgit v1.2.3 From cd25e436ef8cc355109ba302621533e522f2f50b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Feb 2010 18:56:58 -0700 Subject: llvmpipe: remove Z16 format override hack --- src/gallium/drivers/llvmpipe/lp_texture.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 022bf92cb4..7f45635542 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -124,12 +124,6 @@ llvmpipe_texture_create(struct pipe_screen *_screen, pipe_reference_init(&lpt->base.reference, 1); lpt->base.screen = &screen->base; - /* XXX: The xlib state tracker is brain-dead and will request - * PIPE_FORMAT_Z16_UNORM no matter how much we tell it we don't support it. - */ - if (lpt->base.format == PIPE_FORMAT_Z16_UNORM) - lpt->base.format = PIPE_FORMAT_Z32_UNORM; - if (lpt->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | PIPE_TEXTURE_USAGE_PRIMARY)) { if (!llvmpipe_displaytarget_layout(screen, lpt)) -- cgit v1.2.3 From b628950662a97452e539bcc704bd2acee70f8355 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Feb 2010 17:13:13 -0700 Subject: st/mesa: whitespace fixes --- src/mesa/state_tracker/st_cb_texture.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 7e50e2ab2d..c849132e74 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1717,19 +1717,16 @@ copy_image_data_to_texture(struct st_context *st, st_texture_image_copy(st->pipe, stObj->pt, dstLevel, /* dest texture, level */ stImage->pt, /* src texture */ - stImage->face - ); + stImage->face); pipe_texture_reference(&stImage->pt, NULL); } else if (stImage->base.Data) { /* More straightforward upload. */ - st_teximage_flush_before_map(st, stObj->pt, stImage->face, dstLevel, PIPE_TRANSFER_WRITE); - st_texture_image_data(st, stObj->pt, stImage->face, -- cgit v1.2.3 From 5e321280c14fa376c44c3eeef67b27160419fc56 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Feb 2010 15:18:49 -0700 Subject: llvmpipe: whole image tile/untile functions --- src/gallium/drivers/llvmpipe/lp_tile_image.c | 126 +++++++++++++++++++++++++++ src/gallium/drivers/llvmpipe/lp_tile_image.h | 57 ++++++++++++ 2 files changed, 183 insertions(+) create mode 100644 src/gallium/drivers/llvmpipe/lp_tile_image.c create mode 100644 src/gallium/drivers/llvmpipe/lp_tile_image.h (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_tile_image.c b/src/gallium/drivers/llvmpipe/lp_tile_image.c new file mode 100644 index 0000000000..c1980b316d --- /dev/null +++ b/src/gallium/drivers/llvmpipe/lp_tile_image.c @@ -0,0 +1,126 @@ +/************************************************************************** + * + * Copyright 2010 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#include "lp_tile_soa.h" +#include "lp_tile_image.h" + + +#define BYTES_PER_TILE (TILE_SIZE * TILE_SIZE * 4) + + +/** + * Convert a tiled image into a linear image. + * \param src_stride source row stride in bytes (bytes per row of tiles) + * \param dst_stride dest row stride in bytes + */ +void +lp_tiled_to_linear(const uint8_t *src, + uint8_t *dst, + unsigned width, unsigned height, + enum pipe_format format, + unsigned src_stride, + unsigned dst_stride) +{ + const unsigned tiles_per_row = src_stride / BYTES_PER_TILE; + unsigned i, j; + + for (j = 0; j < height; j += TILE_SIZE) { + for (i = 0; i < width; i += TILE_SIZE) { + unsigned tile_offset = + ((j / TILE_SIZE) * tiles_per_row + i / TILE_SIZE); + unsigned byte_offset = tile_offset * BYTES_PER_TILE; + const uint8_t *src_tile = src + byte_offset; + + lp_tile_write_4ub(format, + src_tile, + dst, + dst_stride, + i, j, TILE_SIZE, TILE_SIZE); + } + } +} + + +/** + * Convert a linear image into a tiled image. + * \param src_stride source row stride in bytes + * \param dst_stride dest row stride in bytes (bytes per row of tiles) + */ +void +lp_linear_to_tiled(const uint8_t *src, + uint8_t *dst, + unsigned width, unsigned height, + enum pipe_format format, + unsigned src_stride, + unsigned dst_stride) +{ + const unsigned tiles_per_row = dst_stride / BYTES_PER_TILE; + unsigned i, j; + + for (j = 0; j < height; j += TILE_SIZE) { + for (i = 0; i < width; i += TILE_SIZE) { + unsigned tile_offset = + ((j / TILE_SIZE) * tiles_per_row + i / TILE_SIZE); + unsigned byte_offset = tile_offset * BYTES_PER_TILE; + uint8_t *dst_tile = dst + byte_offset; + + lp_tile_read_4ub(format, + dst_tile, + src, + src_stride, + i, j, TILE_SIZE, TILE_SIZE); + } + } +} + + +/** + * For testing only. + */ +void +test_tiled_linear_conversion(uint8_t *data, + enum pipe_format format, + unsigned width, unsigned height, + unsigned stride) +{ + /* size in tiles */ + unsigned wt = (width + TILE_SIZE - 1) / TILE_SIZE; + unsigned ht = (height + TILE_SIZE - 1) / TILE_SIZE; + + uint8_t *tiled = malloc(wt * ht * TILE_SIZE * TILE_SIZE * 4); + + unsigned tiled_stride = wt * TILE_SIZE * TILE_SIZE * 4; + + lp_linear_to_tiled(data, tiled, width, height, format, + stride, tiled_stride); + + lp_tiled_to_linear(tiled, data, width, height, format, + tiled_stride, stride); + + free(tiled); +} + diff --git a/src/gallium/drivers/llvmpipe/lp_tile_image.h b/src/gallium/drivers/llvmpipe/lp_tile_image.h new file mode 100644 index 0000000000..60d472e8c5 --- /dev/null +++ b/src/gallium/drivers/llvmpipe/lp_tile_image.h @@ -0,0 +1,57 @@ +/************************************************************************** + * + * Copyright 2010 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#ifndef LP_TILE_IMAGE_H +#define LP_TILE_IMAGE_H + + +void +lp_tiled_to_linear(const uint8_t *src, + uint8_t *dst, + unsigned width, unsigned height, + enum pipe_format format, + unsigned src_stride, + unsigned dst_stride); + + +void +lp_linear_to_tiled(const uint8_t *src, + uint8_t *dst, + unsigned width, unsigned height, + enum pipe_format format, + unsigned src_stride, + unsigned dst_stride); + + +void +test_tiled_linear_conversion(uint8_t *data, + enum pipe_format format, + unsigned width, unsigned height, + unsigned stride); + + +#endif /* LP_TILE_IMAGE_H */ -- cgit v1.2.3 From 1eec90d660052a597db08332141f1ffee1570209 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 22 Feb 2010 15:19:45 -0700 Subject: llvmpipe: add lp_tile_image.c to sources --- src/gallium/drivers/llvmpipe/Makefile | 1 + src/gallium/drivers/llvmpipe/SConscript | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/Makefile b/src/gallium/drivers/llvmpipe/Makefile index 3173251437..41ac1cee72 100644 --- a/src/gallium/drivers/llvmpipe/Makefile +++ b/src/gallium/drivers/llvmpipe/Makefile @@ -37,6 +37,7 @@ C_SOURCES = \ lp_surface.c \ lp_tex_sample_llvm.c \ lp_texture.c \ + lp_tile_image.c \ lp_tile_soa.c CPP_SOURCES = \ diff --git a/src/gallium/drivers/llvmpipe/SConscript b/src/gallium/drivers/llvmpipe/SConscript index a39283e5e8..9084c97079 100644 --- a/src/gallium/drivers/llvmpipe/SConscript +++ b/src/gallium/drivers/llvmpipe/SConscript @@ -52,6 +52,7 @@ llvmpipe = env.ConvenienceLibrary( 'lp_surface.c', 'lp_tex_sample_llvm.c', 'lp_texture.c', + 'lp_tile_image.c', 'lp_tile_soa.c', ]) -- cgit v1.2.3 From 402f54b0d1f69a2231e42b726ebaf8a726efa307 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Feb 2010 21:16:18 -0700 Subject: gallivm: added clamp and int_to_float functions --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 41 ++++++++++++++++++++++++++++- src/gallium/auxiliary/gallivm/lp_bld_arit.h | 10 +++++++ 2 files changed, 50 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index 54b31befe6..bbce31f9eb 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -613,6 +613,22 @@ lp_build_max(struct lp_build_context *bld, } +/** + * Generate clamp(a, min, max) + * Do checks for special cases. + */ +LLVMValueRef +lp_build_clamp(struct lp_build_context *bld, + LLVMValueRef a, + LLVMValueRef min, + LLVMValueRef max) +{ + a = lp_build_min(bld, a, max); + a = lp_build_max(bld, a, min); + return a; +} + + /** * Generate abs(a) */ @@ -693,6 +709,29 @@ lp_build_sgn(struct lp_build_context *bld, } +/** + * Convert vector of int to vector of float. + */ +LLVMValueRef +lp_build_int_to_float(struct lp_build_context *bld, + LLVMValueRef a) +{ + const struct lp_type type = bld->type; + + assert(type.floating); + /*assert(lp_check_value(type, a));*/ + + { + LLVMTypeRef vec_type = lp_build_vec_type(type); + /*LLVMTypeRef int_vec_type = lp_build_int_vec_type(type);*/ + LLVMValueRef res; + res = LLVMBuildSIToFP(bld->builder, a, vec_type, ""); + return res; + } +} + + + enum lp_build_round_sse41_mode { LP_BUILD_ROUND_SSE41_NEAREST = 0, @@ -819,7 +858,7 @@ lp_build_ceil(struct lp_build_context *bld, /** * Convert to integer, through whichever rounding method that's fastest, - * typically truncating to zero. + * typically truncating toward zero. */ LLVMValueRef lp_build_itrunc(struct lp_build_context *bld, diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.h b/src/gallium/auxiliary/gallivm/lp_bld_arit.h index 62be4b9aee..da84b7ca02 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.h @@ -106,6 +106,12 @@ lp_build_max(struct lp_build_context *bld, LLVMValueRef a, LLVMValueRef b); +LLVMValueRef +lp_build_clamp(struct lp_build_context *bld, + LLVMValueRef a, + LLVMValueRef min, + LLVMValueRef max); + LLVMValueRef lp_build_abs(struct lp_build_context *bld, LLVMValueRef a); @@ -114,6 +120,10 @@ LLVMValueRef lp_build_sgn(struct lp_build_context *bld, LLVMValueRef a); +LLVMValueRef +lp_build_int_to_float(struct lp_build_context *bld, + LLVMValueRef a); + LLVMValueRef lp_build_round(struct lp_build_context *bld, LLVMValueRef a); -- cgit v1.2.3 From db9c151d77d02729d7387213c3f4ee96c65dd0cc Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 23 Feb 2010 23:15:20 -0500 Subject: intel: Call intel_prepare_render() in intelMakeCurrent() This restores old behaviour, where we end up doing a DRI2GetBuffers() call from intelMakeCurrent(). The idea was that we could do this lazily, just before we start rendering. However, if we don't do the DRI2GetBuffers() round-trip we don't get the drawable size and higher level mesa ends up short-cutting a number of GL calls, such as glClear(). --- src/mesa/drivers/dri/intel/intel_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 3c36c3f4c8..de063d51c9 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -887,6 +887,7 @@ intelMakeCurrent(__DRIcontext * driContextPriv, intel->driDrawable = driDrawPriv; driContextPriv->dri2.draw_stamp = driDrawPriv->dri2.stamp - 1; driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1; + intel_prepare_render(&intel->ctx); } else { _mesa_make_current(NULL, NULL, NULL); -- cgit v1.2.3 From b75d40736997911e00cab339a7f15ec9bc86e535 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 24 Feb 2010 17:19:09 +1000 Subject: radeon: fix bad state emission causes kernel to do bad depth clear The kernel lets you clear depth without getting a depth offset from userspace, mesa used to emit state before clear, but that got lost in the refactoring, which made the kernel bug show up. Fix mesa driver to emit the state properly now. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/radeon/radeon_ioctl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index c7ea452156..d429f15fa5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -481,6 +481,7 @@ static void radeonKernelClear(GLcontext *ctx, GLuint flags) } } + radeonEmitState(&rmesa->radeon); /* Send current state to the hardware */ rcommonFlushCmdBufLocked( &rmesa->radeon, __FUNCTION__ ); -- cgit v1.2.3 From e16f0c14f353cc04ad6cbcf99e3b95ccb1d2c06b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 24 Feb 2010 00:24:51 -0800 Subject: r600: Assert that array index is not negative. --- src/mesa/drivers/dri/r600/r700_assembler.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index d0059fad2e..8344dd9a51 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1250,6 +1250,7 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, if(pAsm->aArgSubst[1+src] >= 0) { + assert(fld >= 0); setaddrmode_PVSSRC(&(pAsm->S[fld].src), ADDR_ABSOLUTE); pAsm->S[fld].src.rtype = SRC_REG_TEMPORARY; pAsm->S[fld].src.reg = pAsm->aArgSubst[1+src]; -- cgit v1.2.3 From 3f5bac8960a5c6d1f08f0dc849676139b9d6ce5c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 24 Feb 2010 19:13:07 +1000 Subject: radeon/r200: fix the state emission before kernel clear this moves the emission outside the lock and adds r200 support. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r200/r200_ioctl.c | 2 ++ src/mesa/drivers/dri/radeon/radeon_ioctl.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c index a1b505707e..b72f69b7f4 100644 --- a/src/mesa/drivers/dri/r200/r200_ioctl.c +++ b/src/mesa/drivers/dri/r200/r200_ioctl.c @@ -61,6 +61,8 @@ static void r200KernelClear(GLcontext *ctx, GLuint flags) GLint cx, cy, cw, ch, ret; GLuint i; + radeonEmitState(&rmesa->radeon); + LOCK_HARDWARE( &rmesa->radeon ); /* Throttle the number of clear ioctls we do. diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c index d429f15fa5..5ac526c6de 100644 --- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c +++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c @@ -442,6 +442,8 @@ static void radeonKernelClear(GLcontext *ctx, GLuint flags) GLint ret, i; GLint cx, cy, cw, ch; + radeonEmitState(&rmesa->radeon); + LOCK_HARDWARE( &rmesa->radeon ); /* compute region after locking: */ @@ -481,7 +483,6 @@ static void radeonKernelClear(GLcontext *ctx, GLuint flags) } } - radeonEmitState(&rmesa->radeon); /* Send current state to the hardware */ rcommonFlushCmdBufLocked( &rmesa->radeon, __FUNCTION__ ); -- cgit v1.2.3 From 5dce9b252b65102ed69956fdd47862d5cb1c4af1 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 23 Feb 2010 19:51:42 +0000 Subject: util: Store more derived data in the the format description. --- src/gallium/auxiliary/util/u_format.h | 18 ++++++++++++++++++ src/gallium/auxiliary/util/u_format_parse.py | 24 ++++++++++++++++++++++++ src/gallium/auxiliary/util/u_format_table.py | 6 ++++++ 3 files changed, 48 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 2fbbb83d4b..7054a07b2d 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -138,8 +138,26 @@ struct util_format_description const char *name; struct util_format_block block; enum util_format_layout layout; + + /** + * The number of channels. + */ + unsigned nr_channels:3; + + /** + * Whether all channels have the same number of whole bytes. + */ + unsigned is_array:1; + + /** + * Whether channels have mixed types (ignoring UTIL_FORMAT_TYPE_VOID). + */ + unsigned is_mixed:1; + struct util_format_channel_description channel[4]; + unsigned char swizzle[4]; + enum util_format_colorspace colorspace; }; diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 493aff7112..5d49fc7652 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -83,6 +83,30 @@ class Format: size += type.size return size + def nr_channels(self): + nr_channels = 0 + for type in self.in_types: + if type.size: + nr_channels += 1 + return nr_channels + + def is_array(self): + ref_type = self.in_types[0] + for type in self.in_types[1:]: + if type.size and (type.size != ref_type.size or type.size % 8): + return False + return True + + def is_mixed(self): + ref_type = self.in_types[0] + for type in self.in_types[1:]: + if type.kind != VOID: + if type.kind != ref_type.kind: + return True + if type.norm != ref_type.norm: + return True + return False + def stride(self): return self.block_size()/8 diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index 571cab55dc..05e176d567 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -94,6 +94,9 @@ def write_format_table(formats): print " \"PIPE_FORMAT_NONE\"," print " {0, 0, 0}," print " 0," + print " 0," + print " 0," + print " 0," print " {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}," print " {0, 0, 0, 0}," print " 0" @@ -104,6 +107,9 @@ def write_format_table(formats): print " \"%s\"," % (format.name,) print " {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size()) print " %s," % (layout_map(format.layout),) + print " %u,\t/* nr_channels */" % (format.nr_channels(),) + print " %s,\t/* is_array */" % (bool_map(format.is_array()),) + print " %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),) print " {" for i in range(4): type = format.in_types[i] -- cgit v1.2.3 From 4e526b42b0fdcb9144292598458137076514fe04 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 23 Feb 2010 20:19:50 +0000 Subject: llvmpipe: Kill unused UTIL_FORMAT_LAYOUT_SCALAR. --- src/gallium/drivers/llvmpipe/lp_screen.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index ad5a484959..0e5750ce11 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -194,8 +194,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, format_desc->block.height != 1) return FALSE; - if(format_desc->layout != UTIL_FORMAT_LAYOUT_SCALAR && - format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH && + if(format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH && format_desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) return FALSE; @@ -224,8 +223,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, format_desc->block.height != 1) return FALSE; - if(format_desc->layout != UTIL_FORMAT_LAYOUT_SCALAR && - format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH && + if(format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH && format_desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) return FALSE; -- cgit v1.2.3 From 573a8002d540eebf6a39733ba8cdba1569eeab82 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 23 Feb 2010 20:20:19 +0000 Subject: util: Kill unused UTIL_FORMAT_LAYOUT_SCALAR. --- src/gallium/auxiliary/util/u_format.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 7054a07b2d..7792aa0673 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -55,11 +55,6 @@ extern "C" { * XXX: This should be renamed to something like util_format_pack. */ enum util_format_layout { - /** - * Single scalar component. - */ - UTIL_FORMAT_LAYOUT_SCALAR = 0, - /** * One or more components of mixed integer formats, arithmetically encoded * in a word up to 32bits. @@ -392,7 +387,6 @@ util_format_has_alpha(enum pipe_format format) } switch (desc->layout) { - case UTIL_FORMAT_LAYOUT_SCALAR: case UTIL_FORMAT_LAYOUT_ARITH: case UTIL_FORMAT_LAYOUT_ARRAY: /* FIXME: pf_get_component_bits( PIPE_FORMAT_A8L8_UNORM, PIPE_FORMAT_COMP_A ) should not return 0 right? */ -- cgit v1.2.3 From 227ae7b968c1351921babdbf6f052239766ffce4 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 24 Feb 2010 15:16:54 +0100 Subject: cso: Track clip state with cso context. --- src/gallium/auxiliary/cso_cache/cso_context.c | 54 +++++++++++++++++++++++++++ src/gallium/auxiliary/cso_cache/cso_context.h | 13 +++++++ 2 files changed, 67 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index b5241fa64c..a7335c340c 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -90,6 +90,9 @@ struct cso_context { void *fragment_shader, *fragment_shader_saved, *geometry_shader; void *vertex_shader, *vertex_shader_saved, *geometry_shader_saved; + struct pipe_clip_state clip; + struct pipe_clip_state clip_saved; + struct pipe_framebuffer_state fb, fb_saved; struct pipe_viewport_state vp, vp_saved; struct pipe_blend_color blend_color; @@ -1126,3 +1129,54 @@ void cso_restore_geometry_shader(struct cso_context *ctx) } ctx->geometry_shader_saved = NULL; } + + +/* clip state */ + +static INLINE void +clip_state_cpy(struct pipe_clip_state *dst, + const struct pipe_clip_state *src) +{ + dst->nr = src->nr; + if (src->nr) { + memcpy(dst->ucp, src->ucp, src->nr * sizeof(src->ucp[0])); + } +} + +static INLINE int +clip_state_cmp(const struct pipe_clip_state *a, + const struct pipe_clip_state *b) +{ + if (a->nr != b->nr) { + return 1; + } + if (a->nr) { + return memcmp(a->ucp, b->ucp, a->nr * sizeof(a->ucp[0])); + } + return 0; +} + +void +cso_set_clip(struct cso_context *ctx, + const struct pipe_clip_state *clip) +{ + if (clip_state_cmp(&ctx->clip, clip)) { + clip_state_cpy(&ctx->clip, clip); + ctx->pipe->set_clip_state(ctx->pipe, clip); + } +} + +void +cso_save_clip(struct cso_context *ctx) +{ + clip_state_cpy(&ctx->clip_saved, &ctx->clip); +} + +void +cso_restore_clip(struct cso_context *ctx) +{ + if (clip_state_cmp(&ctx->clip, &ctx->clip_saved)) { + clip_state_cpy(&ctx->clip, &ctx->clip_saved); + ctx->pipe->set_clip_state(ctx->pipe, &ctx->clip_saved); + } +} diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h index 707b3c2cee..251a9a644f 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.h +++ b/src/gallium/auxiliary/cso_cache/cso_context.h @@ -180,6 +180,19 @@ void cso_save_stencil_ref(struct cso_context *cso); void cso_restore_stencil_ref(struct cso_context *cso); +/* clip state */ + +void +cso_set_clip(struct cso_context *cso, + const struct pipe_clip_state *clip); + +void +cso_save_clip(struct cso_context *cso); + +void +cso_restore_clip(struct cso_context *cso); + + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 8039ee09b8c78a70c1c50207cce9a7bb4cffc675 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 24 Feb 2010 15:28:41 +0100 Subject: st/mesa: Use cso context to manage clip state. --- src/mesa/state_tracker/st_atom_clip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_atom_clip.c b/src/mesa/state_tracker/st_atom_clip.c index 23d709b814..80c0e92139 100644 --- a/src/mesa/state_tracker/st_atom_clip.c +++ b/src/mesa/state_tracker/st_atom_clip.c @@ -35,6 +35,8 @@ #include "pipe/p_context.h" #include "st_atom.h" +#include "cso_cache/cso_context.h" + /* Second state atom for user clip planes: */ @@ -56,7 +58,7 @@ static void update_clip( struct st_context *st ) if (memcmp(&clip, &st->state.clip, sizeof(clip)) != 0) { st->state.clip = clip; - st->pipe->set_clip_state(st->pipe, &clip); + cso_set_clip(st->cso_context, &clip); } } -- cgit v1.2.3 From 5b3f8369c693e75d1dbc7587e4e0d77934c0cd77 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 24 Feb 2010 15:48:30 +0100 Subject: util: Reset clip state when doing blitting. --- src/gallium/auxiliary/util/u_blit.c | 8 +++++++- src/gallium/auxiliary/util/u_gen_mipmap.c | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index 90a3230a0f..95567d00fe 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -62,6 +62,7 @@ struct blit_state struct pipe_rasterizer_state rasterizer; struct pipe_sampler_state sampler; struct pipe_viewport_state viewport; + struct pipe_clip_state clip; void *vs; void *fs[TGSI_WRITEMASK_XYZW + 1]; @@ -264,7 +265,6 @@ regions_overlap(int srcX0, int srcY0, * \param writemask controls which channels in the dest surface are sourced * from the src surface. Disabled channels are sourced * from (0,0,0,1). - * XXX what about clipping??? * XXX need some control over blitting Z and/or stencil. */ void @@ -409,11 +409,13 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); + cso_save_clip(ctx->cso); /* set misc state we care about */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); + cso_set_clip(ctx->cso, &ctx->clip); /* sampler */ ctx->sampler.min_img_filter = filter; @@ -475,6 +477,7 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); + cso_restore_clip(ctx->cso); pipe_texture_reference(&tex, NULL); } @@ -558,11 +561,13 @@ util_blit_pixels_tex(struct blit_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); + cso_save_clip(ctx->cso); /* set misc state we care about */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); + cso_set_clip(ctx->cso, &ctx->clip); /* sampler */ ctx->sampler.min_img_filter = filter; @@ -607,4 +612,5 @@ util_blit_pixels_tex(struct blit_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); + cso_restore_clip(ctx->cso); } diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 4f9ff1d961..f423882ca2 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -61,6 +61,7 @@ struct gen_mipmap_state struct pipe_depth_stencil_alpha_state depthstencil; struct pipe_rasterizer_state rasterizer; struct pipe_sampler_state sampler; + struct pipe_clip_state clip; void *vs; void *fs2d, *fsCube; @@ -1499,11 +1500,13 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); cso_save_viewport(ctx->cso); + cso_save_clip(ctx->cso); /* bind our state */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); + cso_set_clip(ctx->cso, &ctx->clip); cso_set_fragment_shader_handle(ctx->cso, fs); cso_set_vertex_shader_handle(ctx->cso, ctx->vs); @@ -1589,4 +1592,5 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); cso_restore_viewport(ctx->cso); + cso_restore_clip(ctx->cso); } -- cgit v1.2.3 From 78f72d73ee37c1a269f010e492631503a7fc35b2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 08:13:55 -0700 Subject: mesa: disable unreachable meta mipmap gen code More work is needed to support 3D mipmap generation. Disable unreachable code until then. See bug 26722. --- src/mesa/drivers/common/meta.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 42ab7d4ed6..8e229bbe38 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2131,12 +2131,15 @@ _mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, GL_COLOR_ATTACHMENT0_EXT, target, texObj->Name, srcLevel); } +#if 0 + /* other work is needed to enable 3D mipmap generation */ else if (target == GL_TEXTURE_3D) { GLint zoffset = 0; _mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, target, texObj->Name, srcLevel, zoffset); } +#endif else { /* 2D / cube */ _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, -- cgit v1.2.3 From a9aa811af01273cef8a73118abdc87313f365ad3 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 24 Feb 2010 16:41:18 +0100 Subject: st/mesa: Reset clip state when clearing with quads. --- src/mesa/state_tracker/st_cb_clear.c | 6 +++++- src/mesa/state_tracker/st_context.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 5edab55cca..9e66eed363 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -62,7 +62,8 @@ st_init_clear(struct st_context *st) { struct pipe_context *pipe = st->pipe; - memset(&st->clear.raster, 0, sizeof(st->clear.raster)); + memset(&st->clear, 0, sizeof(st->clear)); + st->clear.raster.gl_rasterization_rules = 1; /* fragment shader state: color pass-through program */ @@ -209,6 +210,7 @@ clear_with_quad(GLcontext *ctx, cso_save_depth_stencil_alpha(st->cso_context); cso_save_rasterizer(st->cso_context); cso_save_viewport(st->cso_context); + cso_save_clip(st->cso_context); cso_save_fragment_shader(st->cso_context); cso_save_vertex_shader(st->cso_context); @@ -279,6 +281,7 @@ clear_with_quad(GLcontext *ctx, cso_set_viewport(st->cso_context, &vp); } + cso_set_clip(st->cso_context, &st->clear.clip); cso_set_fragment_shader_handle(st->cso_context, st->clear.fs); cso_set_vertex_shader_handle(st->cso_context, st->clear.vs); @@ -291,6 +294,7 @@ clear_with_quad(GLcontext *ctx, cso_restore_depth_stencil_alpha(st->cso_context); cso_restore_rasterizer(st->cso_context); cso_restore_viewport(st->cso_context); + cso_restore_clip(st->cso_context); cso_restore_fragment_shader(st->cso_context); cso_restore_vertex_shader(st->cso_context); } diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 13b7b0e22d..045c029c30 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -166,6 +166,7 @@ struct st_context struct { struct pipe_rasterizer_state raster; struct pipe_viewport_state viewport; + struct pipe_clip_state clip; void *vs; void *fs; float vertices[4][2][4]; /**< vertex pos + color */ -- cgit v1.2.3 From b57d80da7765b2f06ba37758c05819456c27d0b9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 13:47:42 +0000 Subject: util: Allow '#' comments in u_format.csv. --- src/gallium/auxiliary/util/u_format_parse.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 5d49fc7652..37336029d8 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -137,7 +137,15 @@ def parse(filename): stream = open(filename) formats = [] for line in stream: - line = line.rstrip() + try: + comment = line.index('#') + except ValueError: + pass + else: + line = line[:comment] + line = line.strip() + if not line: + continue fields = [field.strip() for field in line.split(',')] name = fields[0] layout = fields[1] -- cgit v1.2.3 From ba7ce0ccd4e160dc4f2322ce03e01a315938d37e Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 14:15:09 +0000 Subject: util: Organize formats in groups. Add comments. --- src/gallium/auxiliary/util/u_format.csv | 96 +++++++++++++++++++++------------ 1 file changed, 61 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 01f7931aed..2d83d169e9 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -1,3 +1,4 @@ +# Typical rendertarget formats PIPE_FORMAT_A8R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , zyxw, rgb PIPE_FORMAT_X8R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb PIPE_FORMAT_B8G8R8A8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , yzwx, rgb @@ -6,13 +7,33 @@ PIPE_FORMAT_A1R5G5B5_UNORM , arith , 1, 1, un5 , un5 , un5 , un1 , zyxw, PIPE_FORMAT_A4R4G4B4_UNORM , arith , 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb PIPE_FORMAT_R5G6B5_UNORM , arith , 1, 1, un5 , un6 , un5 , , zyx1, rgb PIPE_FORMAT_A2B10G10R10_UNORM , arith , 1, 1, un10, un10, un10, un2 , xyzw, rgb + +# Luminance/Intensity/Alpha formats PIPE_FORMAT_L8_UNORM , arith , 1, 1, un8 , , , , xxx1, rgb PIPE_FORMAT_A8_UNORM , arith , 1, 1, un8 , , , , 000x, rgb PIPE_FORMAT_I8_UNORM , arith , 1, 1, un8 , , , , xxxx, rgb PIPE_FORMAT_A8L8_UNORM , arith , 1, 1, un8 , un8 , , , xxxy, rgb PIPE_FORMAT_L16_UNORM , arith , 1, 1, un16, , , , xxx1, rgb -PIPE_FORMAT_YCBCR , yuv , 2, 1, x32 , , , , xyz1, yuv -PIPE_FORMAT_YCBCR_REV , yuv , 2, 1, x32 , , , , xyz1, yuv + +# SRGB formats +PIPE_FORMAT_L8_SRGB , arith , 1, 1, u8 , , , , xxx1, srgb +PIPE_FORMAT_A8L8_SRGB , arith , 1, 1, u8 , u8 , , , xxxy, srgb +PIPE_FORMAT_R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , , xyz1, srgb +PIPE_FORMAT_R8G8B8A8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , xyzw, srgb +PIPE_FORMAT_R8G8B8X8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , xyz1, srgb +PIPE_FORMAT_A8R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , yzwx, srgb +PIPE_FORMAT_X8R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , yzw1, srgb +PIPE_FORMAT_B8G8R8A8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , zyxw, srgb +PIPE_FORMAT_B8G8R8X8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , zyx1, srgb + +# Signed formats (typically used for bump map textures) +PIPE_FORMAT_A8B8G8R8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb +PIPE_FORMAT_X8B8G8R8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb +PIPE_FORMAT_X8UB8UG8SR8S_NORM , arith , 1, 1, sn8 , sn8 , un8 , x8 , wzy1, rgb +PIPE_FORMAT_B6UG5SR5S_NORM , arith , 1, 1, sn5 , sn5 , un6 , , xyz1, rgb + +# Depth-stencil formats +PIPE_FORMAT_S8_UNORM , array , 1, 1, un8 , , , , _x__, zs PIPE_FORMAT_Z16_UNORM , array , 1, 1, un16, , , , x___, zs PIPE_FORMAT_Z32_UNORM , array , 1, 1, un32, , , , x___, zs PIPE_FORMAT_Z32_FLOAT , array , 1, 1, f32 , , , , x___, zs @@ -20,7 +41,26 @@ PIPE_FORMAT_S8Z24_UNORM , arith , 1, 1, un24, un8 , , , xy__, PIPE_FORMAT_Z24S8_UNORM , arith , 1, 1, un8 , un24, , , yx__, zs PIPE_FORMAT_X8Z24_UNORM , arith , 1, 1, un24, un8 , , , x___, zs PIPE_FORMAT_Z24X8_UNORM , arith , 1, 1, un8 , un24, , , y___, zs -PIPE_FORMAT_S8_UNORM , array , 1, 1, un8 , , , , _x__, zs + +# YUV formats +PIPE_FORMAT_YCBCR , yuv , 2, 1, x32 , , , , xyz1, yuv +PIPE_FORMAT_YCBCR_REV , yuv , 2, 1, x32 , , , , xyz1, yuv + +# Compressed formats +PIPE_FORMAT_DXT1_RGB , dxt , 4, 4, x64 , , , , xyz1, rgb +PIPE_FORMAT_DXT1_RGBA , dxt , 4, 4, x64 , , , , xyzw, rgb +PIPE_FORMAT_DXT3_RGBA , dxt , 4, 4, x128, , , , xyzw, rgb +PIPE_FORMAT_DXT5_RGBA , dxt , 4, 4, x128, , , , xyzw, rgb +PIPE_FORMAT_DXT1_SRGB , dxt , 4, 4, x64 , , , , xyz1, srgb +PIPE_FORMAT_DXT1_SRGBA , dxt , 4, 4, x64 , , , , xyzw, srgb +PIPE_FORMAT_DXT3_SRGBA , dxt , 4, 4, x128, , , , xyzw, srgb +PIPE_FORMAT_DXT5_SRGBA , dxt , 4, 4, x128, , , , xyzw, srgb + +# Old vector formats +# XXX: Swizzle notation is reversed for these! +# See also: +# - src/gallium/auxiliary/translate/translate_generic.c +# - src/mesa/state_tracker/st_draw.c PIPE_FORMAT_R64_FLOAT , array , 1, 1, f64 , , , , x001, rgb PIPE_FORMAT_R64G64_FLOAT , array , 1, 1, f64 , f64 , , , xy01, rgb PIPE_FORMAT_R64G64B64_FLOAT , array , 1, 1, f64 , f64 , f64 , , xyz1, rgb @@ -45,6 +85,10 @@ PIPE_FORMAT_R32_SSCALED , array , 1, 1, s32 , , , , x001, PIPE_FORMAT_R32G32_SSCALED , array , 1, 1, s32 , s32 , , , xy01, rgb PIPE_FORMAT_R32G32B32_SSCALED , array , 1, 1, s32 , s32 , s32 , , xyz1, rgb PIPE_FORMAT_R32G32B32A32_SSCALED , array , 1, 1, s32 , s32 , s32 , s32 , xyzw, rgb +PIPE_FORMAT_R32_FIXED , array , 1, 1, h32 , , , , x001, rgb +PIPE_FORMAT_R32G32_FIXED , array , 1, 1, h32 , h32 , , , xy01, rgb +PIPE_FORMAT_R32G32B32_FIXED , array , 1, 1, h32 , h32 , h32 , , xyz1, rgb +PIPE_FORMAT_R32G32B32A32_FIXED , array , 1, 1, h32 , h32 , h32 , h32 , xyzw, rgb PIPE_FORMAT_R16_UNORM , array , 1, 1, un16, , , , x001, rgb PIPE_FORMAT_R16G16_UNORM , array , 1, 1, un16, un16, , , xy01, rgb PIPE_FORMAT_R16G16B16_UNORM , array , 1, 1, un16, un16, un16, , xyz1, rgb @@ -62,48 +106,30 @@ PIPE_FORMAT_R16G16_SSCALED , array , 1, 1, s16 , s16 , , , xy01, PIPE_FORMAT_R16G16B16_SSCALED , array , 1, 1, s16 , s16 , s16 , , xyz1, rgb PIPE_FORMAT_R16G16B16A16_SSCALED , array , 1, 1, s16 , s16 , s16 , s16 , xyzw, rgb PIPE_FORMAT_R8_UNORM , array , 1, 1, un8 , , , , x001, rgb -PIPE_FORMAT_R8G8_UNORM , array , 1, 1, un8 , un8 , , , yx01, rgb -PIPE_FORMAT_R8G8B8_UNORM , array , 1, 1, un8 , un8 , un8 , , zyx1, rgb -PIPE_FORMAT_R8G8B8A8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb -PIPE_FORMAT_R8G8B8X8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb +PIPE_FORMAT_R8G8_UNORM , array , 1, 1, un8 , un8 , , , xy01, rgb PIPE_FORMAT_R8_USCALED , array , 1, 1, u8 , , , , x001, rgb PIPE_FORMAT_R8G8_USCALED , array , 1, 1, u8 , u8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_USCALED , array , 1, 1, u8 , u8 , u8 , , xyz1, rgb PIPE_FORMAT_R8G8B8A8_USCALED , array , 1, 1, u8 , u8 , u8 , u8 , xyzw, rgb -PIPE_FORMAT_R8G8B8X8_USCALED , array , 1, 1, u8 , u8 , u8 , u8 , xyz1, rgb PIPE_FORMAT_R8_SNORM , array , 1, 1, sn8 , , , , x001, rgb PIPE_FORMAT_R8G8_SNORM , array , 1, 1, sn8 , sn8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , , xyz1, rgb PIPE_FORMAT_R8G8B8A8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , xyzw, rgb -PIPE_FORMAT_R8G8B8X8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb -PIPE_FORMAT_B6G5R5_SNORM , arith , 1, 1, sn5 , sn5 , sn6 , , xyz1, rgb -PIPE_FORMAT_A8B8G8R8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb -PIPE_FORMAT_X8B8G8R8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb PIPE_FORMAT_R8_SSCALED , array , 1, 1, s8 , , , , x001, rgb PIPE_FORMAT_R8G8_SSCALED , array , 1, 1, s8 , s8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_SSCALED , array , 1, 1, s8 , s8 , s8 , , xyz1, rgb PIPE_FORMAT_R8G8B8A8_SSCALED , array , 1, 1, s8 , s8 , s8 , s8 , xyzw, rgb + +# Ambiguous formats +# FIXME: They are used with different meanings in different places!!! +PIPE_FORMAT_R8G8B8_UNORM , array , 1, 1, un8 , un8 , un8 , , zyx1, rgb +PIPE_FORMAT_R8G8B8A8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb + +# Unused formats +# XXX: Couldn't find any state tracker using them!! +PIPE_FORMAT_B6G5R5_SNORM , arith , 1, 1, sn5 , sn5 , sn6 , , xyz1, rgb +PIPE_FORMAT_R8G8B8X8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb +PIPE_FORMAT_R8G8B8X8_USCALED , array , 1, 1, u8 , u8 , u8 , u8 , xyz1, rgb PIPE_FORMAT_R8G8B8X8_SSCALED , array , 1, 1, s8 , s8 , s8 , s8 , xyz1, rgb -PIPE_FORMAT_R32_FIXED , array , 1, 1, h32 , , , , x001, rgb -PIPE_FORMAT_R32G32_FIXED , array , 1, 1, h32 , h32 , , , xy01, rgb -PIPE_FORMAT_R32G32B32_FIXED , array , 1, 1, h32 , h32 , h32 , , xyz1, rgb -PIPE_FORMAT_R32G32B32A32_FIXED , array , 1, 1, h32 , h32 , h32 , h32 , xyzw, rgb -PIPE_FORMAT_L8_SRGB , arith , 1, 1, u8 , , , , xxx1, srgb -PIPE_FORMAT_A8L8_SRGB , arith , 1, 1, u8 , u8 , , , xxxy, srgb -PIPE_FORMAT_R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , , xyz1, srgb -PIPE_FORMAT_R8G8B8A8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , xyzw, srgb -PIPE_FORMAT_R8G8B8X8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , xyz1, srgb -PIPE_FORMAT_A8R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , yzwx, srgb -PIPE_FORMAT_X8R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , yzw1, srgb -PIPE_FORMAT_B8G8R8A8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , zyxw, srgb -PIPE_FORMAT_B8G8R8X8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , zyx1, srgb -PIPE_FORMAT_X8UB8UG8SR8S_NORM , array , 1, 1, sn8 , sn8 , un8 , x8 , wzy1, rgb -PIPE_FORMAT_B6UG5SR5S_NORM , arith , 1, 1, sn5 , sn5 , un6 , , xyz1, rgb -PIPE_FORMAT_DXT1_RGB , dxt , 4, 4, x64 , , , , xyz1, rgb -PIPE_FORMAT_DXT1_RGBA , dxt , 4, 4, x64 , , , , xyzw, rgb -PIPE_FORMAT_DXT3_RGBA , dxt , 4, 4, x128, , , , xyzw, rgb -PIPE_FORMAT_DXT5_RGBA , dxt , 4, 4, x128, , , , xyzw, rgb -PIPE_FORMAT_DXT1_SRGB , dxt , 4, 4, x64 , , , , xyz1, srgb -PIPE_FORMAT_DXT1_SRGBA , dxt , 4, 4, x64 , , , , xyzw, srgb -PIPE_FORMAT_DXT3_SRGBA , dxt , 4, 4, x128, , , , xyzw, srgb -PIPE_FORMAT_DXT5_SRGBA , dxt , 4, 4, x128, , , , xyzw, srgb +# XXX: This one is mentioned in mesa and r300, but not anywhere else. Not sure it is actually needed +PIPE_FORMAT_R8G8B8X8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb -- cgit v1.2.3 From 55f02ba364ba4fa01b2a8596bf8a4914414a3087 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 14:33:45 +0000 Subject: util: Fix swizzles for SRGB formats. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on Marek Olšák's fix 8-bits-per-channel formats swizzles, with the exception that the notation for several formats (the vector formats) is actually reversed so they should be left alone. --- src/gallium/auxiliary/util/u_format.csv | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 2d83d169e9..37f831d509 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -18,18 +18,18 @@ PIPE_FORMAT_L16_UNORM , arith , 1, 1, un16, , , , xxx1, # SRGB formats PIPE_FORMAT_L8_SRGB , arith , 1, 1, u8 , , , , xxx1, srgb PIPE_FORMAT_A8L8_SRGB , arith , 1, 1, u8 , u8 , , , xxxy, srgb -PIPE_FORMAT_R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , , xyz1, srgb -PIPE_FORMAT_R8G8B8A8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , xyzw, srgb -PIPE_FORMAT_R8G8B8X8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , xyz1, srgb -PIPE_FORMAT_A8R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , yzwx, srgb -PIPE_FORMAT_X8R8G8B8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , yzw1, srgb -PIPE_FORMAT_B8G8R8A8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , zyxw, srgb -PIPE_FORMAT_B8G8R8X8_SRGB , array , 1, 1, u8 , u8 , u8 , u8 , zyx1, srgb +PIPE_FORMAT_R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , , zyx1, srgb +PIPE_FORMAT_R8G8B8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , wzyx, srgb +PIPE_FORMAT_R8G8B8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , wzy1, srgb +PIPE_FORMAT_A8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , zyxw, srgb +PIPE_FORMAT_X8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , zyx1, srgb +PIPE_FORMAT_B8G8R8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , yzwx, srgb +PIPE_FORMAT_B8G8R8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , yzw1, srgb # Signed formats (typically used for bump map textures) -PIPE_FORMAT_A8B8G8R8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb -PIPE_FORMAT_X8B8G8R8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb -PIPE_FORMAT_X8UB8UG8SR8S_NORM , arith , 1, 1, sn8 , sn8 , un8 , x8 , wzy1, rgb +PIPE_FORMAT_A8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb +PIPE_FORMAT_X8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb +PIPE_FORMAT_X8UB8UG8SR8S_NORM , arith , 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb PIPE_FORMAT_B6UG5SR5S_NORM , arith , 1, 1, sn5 , sn5 , un6 , , xyz1, rgb # Depth-stencil formats -- cgit v1.2.3 From 5caa0048293b9791f0db24e6a91126a7c2cae577 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 14:36:54 +0000 Subject: util: Minor tweaks to ambigous/unused format descriptions. --- src/gallium/auxiliary/util/u_format.csv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 37f831d509..e8765f2351 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -122,14 +122,14 @@ PIPE_FORMAT_R8G8B8A8_SSCALED , array , 1, 1, s8 , s8 , s8 , s8 , xyzw, # Ambiguous formats # FIXME: They are used with different meanings in different places!!! -PIPE_FORMAT_R8G8B8_UNORM , array , 1, 1, un8 , un8 , un8 , , zyx1, rgb -PIPE_FORMAT_R8G8B8A8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb +PIPE_FORMAT_R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 , , zyx1, rgb +PIPE_FORMAT_R8G8B8A8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb # Unused formats # XXX: Couldn't find any state tracker using them!! PIPE_FORMAT_B6G5R5_SNORM , arith , 1, 1, sn5 , sn5 , sn6 , , xyz1, rgb -PIPE_FORMAT_R8G8B8X8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb -PIPE_FORMAT_R8G8B8X8_USCALED , array , 1, 1, u8 , u8 , u8 , u8 , xyz1, rgb -PIPE_FORMAT_R8G8B8X8_SSCALED , array , 1, 1, s8 , s8 , s8 , s8 , xyz1, rgb +PIPE_FORMAT_R8G8B8X8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb +PIPE_FORMAT_R8G8B8X8_USCALED , arith , 1, 1, u8 , u8 , u8 , u8 , wzy1, rgb +PIPE_FORMAT_R8G8B8X8_SSCALED , arith , 1, 1, s8 , s8 , s8 , s8 , wzy1, rgb # XXX: This one is mentioned in mesa and r300, but not anywhere else. Not sure it is actually needed -PIPE_FORMAT_R8G8B8X8_UNORM , array , 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb +PIPE_FORMAT_R8G8B8X8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb -- cgit v1.2.3 From 395b335fa4d0e5b069b8fb69b7fda7b2e76c3138 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 14:51:31 +0000 Subject: util: Handle correctly 24bit formats. --- src/gallium/auxiliary/util/u_format_access.py | 125 +++++++++++++------------- 1 file changed, 64 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index 0b05ddb931..83f7a1b6f3 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -81,25 +81,26 @@ def is_format_supported(format): def native_type(format): '''Get the native appropriate for a format.''' - if format.layout == ARITH: - # For arithmetic pixel formats return the integer type that matches the whole pixel - return 'uint%u_t' % format.block_size() - elif format.layout == ARRAY: - # For array pixel formats return the integer type that matches the color channel - type = format.in_types[0] - if type.kind == UNSIGNED: - return 'uint%u_t' % type.size - elif type.kind == SIGNED: - return 'int%u_t' % type.size - elif type.kind == FLOAT: - if type.size == 32: - return 'float' - elif type.size == 64: - return 'double' + if format.layout in (ARITH, ARRAY): + if not format.is_array(): + # For arithmetic pixel formats return the integer type that matches the whole pixel + return 'uint%u_t' % format.block_size() + else: + # For array pixel formats return the integer type that matches the color channel + type = format.in_types[0] + if type.kind == UNSIGNED: + return 'uint%u_t' % type.size + elif type.kind == SIGNED: + return 'int%u_t' % type.size + elif type.kind == FLOAT: + if type.size == 32: + return 'float' + elif type.size == 64: + return 'double' + else: + assert False else: assert False - else: - assert False else: assert False @@ -291,29 +292,30 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): else: assert False - if format.layout == ARITH: - print ' %s pixel = *src_pixel++;' % src_native_type - shift = 0; - for i in range(4): - src_type = format.in_types[i] - width = src_type.size - if names[i]: - value = 'pixel' - mask = (1 << width) - 1 - if shift: - value = '(%s >> %u)' % (value, shift) - if shift + width < format.block_size(): - value = '(%s & 0x%x)' % (value, mask) - value = conversion_expr(src_type, dst_type, dst_native_type, value) - print ' %s %s = %s;' % (dst_native_type, names[i], value) - shift += width - elif format.layout == ARRAY: - for i in range(4): - src_type = format.in_types[i] - if names[i]: - value = '(*src_pixel++)' - value = conversion_expr(src_type, dst_type, dst_native_type, value) - print ' %s %s = %s;' % (dst_native_type, names[i], value) + if format.layout in (ARITH, ARRAY): + if not format.is_array(): + print ' %s pixel = *src_pixel++;' % src_native_type + shift = 0; + for i in range(4): + src_type = format.in_types[i] + width = src_type.size + if names[i]: + value = 'pixel' + mask = (1 << width) - 1 + if shift: + value = '(%s >> %u)' % (value, shift) + if shift + width < format.block_size(): + value = '(%s & 0x%x)' % (value, mask) + value = conversion_expr(src_type, dst_type, dst_native_type, value) + print ' %s %s = %s;' % (dst_native_type, names[i], value) + shift += width + else: + for i in range(4): + src_type = format.in_types[i] + if names[i]: + value = '(*src_pixel++)' + value = conversion_expr(src_type, dst_type, dst_native_type, value) + print ' %s %s = %s;' % (dst_native_type, names[i], value) else: assert False @@ -376,27 +378,28 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): else: assert False - if format.layout == ARITH: - print ' %s pixel = 0;' % dst_native_type - shift = 0; - for i in range(4): - dst_type = format.in_types[i] - width = dst_type.size - if inv_swizzle[i] is not None: - value = 'src_pixel[%u]' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) - if shift: - value = '(%s << %u)' % (value, shift) - print ' pixel |= %s;' % value - shift += width - print ' *dst_pixel++ = pixel;' - elif format.layout == ARRAY: - for i in range(4): - dst_type = format.in_types[i] - if inv_swizzle[i] is not None: - value = 'src_pixel[%u]' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) - print ' *dst_pixel++ = %s;' % value + if format.layout in (ARITH, ARRAY): + if not format.is_array(): + print ' %s pixel = 0;' % dst_native_type + shift = 0; + for i in range(4): + dst_type = format.in_types[i] + width = dst_type.size + if inv_swizzle[i] is not None: + value = 'src_pixel[%u]' % inv_swizzle[i] + value = conversion_expr(src_type, dst_type, dst_native_type, value) + if shift: + value = '(%s << %u)' % (value, shift) + print ' pixel |= %s;' % value + shift += width + print ' *dst_pixel++ = pixel;' + else: + for i in range(4): + dst_type = format.in_types[i] + if inv_swizzle[i] is not None: + value = 'src_pixel[%u]' % inv_swizzle[i] + value = conversion_expr(src_type, dst_type, dst_native_type, value) + print ' *dst_pixel++ = %s;' % value else: assert False print ' src_pixel += 4;' -- cgit v1.2.3 From a9395360f2fd113beac759ca642d48588e0846f9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 14:51:47 +0000 Subject: llvmpipe: Handle correctly 24bit formats. --- src/gallium/drivers/llvmpipe/lp_tile_soa.py | 90 +++++++++++++++-------------- 1 file changed, 46 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py index 5d53689a3d..7d5ded2f02 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py @@ -76,29 +76,30 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): else: assert False - if format.layout == ARITH: - print ' %s pixel = *src_pixel++;' % src_native_type - shift = 0; - for i in range(4): - src_type = format.in_types[i] - width = src_type.size - if names[i]: - value = 'pixel' - mask = (1 << width) - 1 - if shift: - value = '(%s >> %u)' % (value, shift) - if shift + width < format.block_size(): - value = '(%s & 0x%x)' % (value, mask) - value = conversion_expr(src_type, dst_type, dst_native_type, value) - print ' %s %s = %s;' % (dst_native_type, names[i], value) - shift += width - elif format.layout == ARRAY: - for i in range(4): - src_type = format.in_types[i] - if names[i]: - value = '(*src_pixel++)' - value = conversion_expr(src_type, dst_type, dst_native_type, value) - print ' %s %s = %s;' % (dst_native_type, names[i], value) + if format.layout in (ARITH, ARRAY): + if not format.is_array(): + print ' %s pixel = *src_pixel++;' % src_native_type + shift = 0; + for i in range(4): + src_type = format.in_types[i] + width = src_type.size + if names[i]: + value = 'pixel' + mask = (1 << width) - 1 + if shift: + value = '(%s >> %u)' % (value, shift) + if shift + width < format.block_size(): + value = '(%s & 0x%x)' % (value, mask) + value = conversion_expr(src_type, dst_type, dst_native_type, value) + print ' %s %s = %s;' % (dst_native_type, names[i], value) + shift += width + else: + for i in range(4): + src_type = format.in_types[i] + if names[i]: + value = '(*src_pixel++)' + value = conversion_expr(src_type, dst_type, dst_native_type, value) + print ' %s %s = %s;' % (dst_native_type, names[i], value) else: assert False @@ -222,27 +223,28 @@ def emit_tile_pixel_write_code(format, src_type): print ' %s *dst_pixel = (%s *)(dst_row + x0*%u);' % (dst_native_type, dst_native_type, format.stride()) print ' for (x = 0; x < w; ++x) {' - if format.layout == ARITH: - print ' %s pixel = 0;' % dst_native_type - shift = 0; - for i in range(4): - dst_type = format.in_types[i] - width = dst_type.size - if inv_swizzle[i] is not None: - value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) - if shift: - value = '(%s << %u)' % (value, shift) - print ' pixel |= %s;' % value - shift += width - print ' *dst_pixel++ = pixel;' - elif format.layout == ARRAY: - for i in range(4): - dst_type = format.in_types[i] - if inv_swizzle[i] is not None: - value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) - print ' *dst_pixel++ = %s;' % value + if format.layout in (ARITH, ARRAY): + if not format.is_array(): + print ' %s pixel = 0;' % dst_native_type + shift = 0; + for i in range(4): + dst_type = format.in_types[i] + width = dst_type.size + if inv_swizzle[i] is not None: + value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] + value = conversion_expr(src_type, dst_type, dst_native_type, value) + if shift: + value = '(%s << %u)' % (value, shift) + print ' pixel |= %s;' % value + shift += width + print ' *dst_pixel++ = pixel;' + else: + for i in range(4): + dst_type = format.in_types[i] + if inv_swizzle[i] is not None: + value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] + value = conversion_expr(src_type, dst_type, dst_native_type, value) + print ' *dst_pixel++ = %s;' % value else: assert False -- cgit v1.2.3 From 943314f38f1224d4929b41acc9ef8fde81ef9dbe Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 15:10:46 +0000 Subject: util: Factor out the code to shorten a format name. --- src/gallium/auxiliary/util/u_format_access.py | 19 ++++--------------- src/gallium/auxiliary/util/u_format_parse.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index 83f7a1b6f3..ca0c9765c2 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -42,17 +42,6 @@ import sys from u_format_parse import * -def short_name(format): - '''Make up a short norm for a format, suitable to be used as suffix in - function names.''' - - name = format.name - if name.startswith('PIPE_FORMAT_'): - name = name[len('PIPE_FORMAT_'):] - name = name.lower() - return name - - def is_format_supported(format): '''Determines whether we actually have the plumbing necessary to generate the to read/write to/from this format.''' @@ -262,7 +251,7 @@ def conversion_expr(src_type, dst_type, dst_native_type, value): def generate_format_read(format, dst_type, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' - name = short_name(format) + name = format.short_name() src_native_type = native_type(format) @@ -350,7 +339,7 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): def generate_format_write(format, src_type, src_native_type, src_suffix): '''Generate the function to write pixels to a particular format''' - name = short_name(format) + name = format.short_name() dst_native_type = native_type(format) @@ -427,7 +416,7 @@ def generate_read(formats, dst_type, dst_native_type, dst_suffix): for format in formats: if is_format_supported(format): print ' case %s:' % format.name - print ' func = &util_format_%s_read_%s;' % (short_name(format), dst_suffix) + print ' func = &util_format_%s_read_%s;' % (format.short_name(), dst_suffix) print ' break;' print ' default:' print ' debug_printf("unsupported format\\n");' @@ -454,7 +443,7 @@ def generate_write(formats, src_type, src_native_type, src_suffix): for format in formats: if is_format_supported(format): print ' case %s:' % format.name - print ' func = &util_format_%s_write_%s;' % (short_name(format), src_suffix) + print ' func = &util_format_%s_write_%s;' % (format.short_name(), src_suffix) print ' break;' print ' default:' print ' debug_printf("unsupported format\\n");' diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 37336029d8..248a26ea8c 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -77,6 +77,16 @@ class Format: def __str__(self): return self.name + def short_name(self): + '''Make up a short norm for a format, suitable to be used as suffix in + function names.''' + + name = self.name + if name.startswith('PIPE_FORMAT_'): + name = name[len('PIPE_FORMAT_'):] + name = name.lower() + return name + def block_size(self): size = 0 for type in self.in_types: -- cgit v1.2.3 From 3c45c4bc44310c1af4f0c06d29eb0a9d39a38837 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 15:11:28 +0000 Subject: util: Cope with the fact that formats in u_format.csv are not ordered. --- src/gallium/auxiliary/Makefile | 1 - src/gallium/auxiliary/SConscript | 1 - src/gallium/auxiliary/util/u_format.c | 45 ----------------- src/gallium/auxiliary/util/u_format_table.py | 75 +++++++++++++++++----------- 4 files changed, 47 insertions(+), 75 deletions(-) delete mode 100644 src/gallium/auxiliary/util/u_format.c (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 916f5f6c91..2d41fb3dca 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -105,7 +105,6 @@ C_SOURCES = \ util/u_cpu_detect.c \ util/u_dl.c \ util/u_draw_quad.c \ - util/u_format.c \ util/u_format_access.c \ util/u_format_table.c \ util/u_gen_mipmap.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index b531ad2dbd..8d2859fa71 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -140,7 +140,6 @@ source = [ 'util/u_dump_state.c', 'util/u_dl.c', 'util/u_draw_quad.c', - 'util/u_format.c', 'util/u_format_access.c', 'util/u_format_table.c', 'util/u_gen_mipmap.c', diff --git a/src/gallium/auxiliary/util/u_format.c b/src/gallium/auxiliary/util/u_format.c deleted file mode 100644 index e0724a1a8b..0000000000 --- a/src/gallium/auxiliary/util/u_format.c +++ /dev/null @@ -1,45 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 Vmware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#include "u_format.h" - - -const struct util_format_description * -util_format_description(enum pipe_format format) -{ - const struct util_format_description *desc; - - if (format >= PIPE_FORMAT_COUNT) { - return NULL; - } - - desc = &util_format_description_table[format]; - assert(desc->format == format); - - return desc; -} diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index 05e176d567..3d0e3a0349 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -87,39 +87,39 @@ def write_format_table(formats): print '#include "u_format.h"' print print 'const struct util_format_description' - print 'util_format_description_table[] = ' - print "{" - print " {" - print " PIPE_FORMAT_NONE," - print " \"PIPE_FORMAT_NONE\"," - print " {0, 0, 0}," - print " 0," - print " 0," - print " 0," - print " 0," - print " {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}," - print " {0, 0, 0, 0}," - print " 0" - print " }," + print 'util_format_none_description = {' + print " PIPE_FORMAT_NONE," + print " \"PIPE_FORMAT_NONE\"," + print " {0, 0, 0}," + print " 0," + print " 0," + print " 0," + print " 0," + print " {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}," + print " {0, 0, 0, 0}," + print " 0" + print "};" + print for format in formats: + print 'const struct util_format_description' + print 'util_format_%s_description = {' % (format.short_name(),) + print " %s," % (format.name,) + print " \"%s\"," % (format.name,) + print " {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size()) + print " %s," % (layout_map(format.layout),) + print " %u,\t/* nr_channels */" % (format.nr_channels(),) + print " %s,\t/* is_array */" % (bool_map(format.is_array()),) + print " %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),) print " {" - print " %s," % (format.name,) - print " \"%s\"," % (format.name,) - print " {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size()) - print " %s," % (layout_map(format.layout),) - print " %u,\t/* nr_channels */" % (format.nr_channels(),) - print " %s,\t/* is_array */" % (bool_map(format.is_array()),) - print " %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),) - print " {" for i in range(4): type = format.in_types[i] if i < 3: sep = "," else: sep = "" - print " {%s, %s, %u}%s\t/* %s */" % (kind_map[type.kind], bool_map(type.norm), type.size, sep, "xyzw"[i]) - print " }," - print " {" + print " {%s, %s, %u}%s\t/* %s */" % (kind_map[type.kind], bool_map(type.norm), type.size, sep, "xyzw"[i]) + print " }," + print " {" for i in range(4): swizzle = format.out_swizzle[i] if i < 3: @@ -130,11 +130,30 @@ def write_format_table(formats): comment = colorspace_channels_map[format.colorspace][i] except (KeyError, IndexError): comment = 'ignored' - print " %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment) - print " }," - print " %s," % (colorspace_map(format.colorspace),) + print " %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment) print " }," + print " %s," % (colorspace_map(format.colorspace),) + print "};" + print + print "const struct util_format_description *" + print "util_format_description(enum pipe_format format)" + print "{" + print " if (format >= PIPE_FORMAT_COUNT) {" + print " return NULL;" + print " }" + print + print " switch (format) {" + print " case PIPE_FORMAT_NONE:" + print " return &util_format_none_description;" + for format in formats: + print " case %s:" % format.name + print " return &util_format_%s_description;" % (format.short_name(),) + print " default:" + print " assert(0);" + print " return NULL;" + print " }" print "};" + print def main(): -- cgit v1.2.3 From 1dbb5f02aeca89626c4479c53828ea7957989892 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 15:41:24 +0000 Subject: util: Refactor some code. --- src/gallium/auxiliary/util/u_format_access.py | 35 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index ca0c9765c2..fb85215d20 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -248,6 +248,24 @@ def conversion_expr(src_type, dst_type, dst_native_type, value): assert False +def compute_inverse_swizzle(format): + '''Return an array[4] of inverse swizzle terms''' + inv_swizzle = [None]*4 + if format.colorspace == 'rgb': + for i in range(4): + swizzle = format.out_swizzle[i] + if swizzle < 4: + inv_swizzle[swizzle] = i + elif format.colorspace == 'zs': + swizzle = format.out_swizzle[0] + if swizzle < 4: + inv_swizzle[swizzle] = 0 + else: + assert False + + return inv_swizzle + + def generate_format_read(format, dst_type, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' @@ -330,7 +348,7 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): print ' }' print ' src_row += src_stride;' - print ' dst_row += dst_stride/sizeof(%s);' % dst_native_type + print ' dst_row += dst_stride/sizeof(*dst_row);' print ' }' print '}' print @@ -354,18 +372,7 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): print ' const %s *src_pixel = src_row;' %src_native_type print ' for (x = 0; x < w; ++x) {' - inv_swizzle = [None]*4 - if format.colorspace == 'rgb': - for i in range(4): - swizzle = format.out_swizzle[i] - if swizzle < 4: - inv_swizzle[swizzle] = i - elif format.colorspace == 'zs': - swizzle = format.out_swizzle[0] - if swizzle < 4: - inv_swizzle[swizzle] = 0 - else: - assert False + inv_swizzle = compute_inverse_swizzle(format) if format.layout in (ARITH, ARRAY): if not format.is_array(): @@ -395,7 +402,7 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): print ' }' print ' dst_row += dst_stride;' - print ' src_row += src_stride/sizeof(%s);' % src_native_type + print ' src_row += src_stride/sizeof(*src_row);' print ' }' print '}' print -- cgit v1.2.3 From 085810542f40f71d93d84d4198166e915df4d384 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 15:45:11 +0000 Subject: llvmpipe: Fix breakeage. Due to the u_format.csv changes the unrolled code generator was being used for formats it didn't support. Bring some bugfixes from u_format_access.py too. --- src/gallium/drivers/llvmpipe/lp_tile_soa.py | 37 ++++++++++------------------- 1 file changed, 13 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py index 7d5ded2f02..0b9631f871 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py @@ -48,7 +48,7 @@ from u_format_access import * def generate_format_read(format, dst_type, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' - name = short_name(format) + name = format.short_name() src_native_type = native_type(format) @@ -111,14 +111,14 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): elif swizzle == SWIZZLE_0: value = '0' elif swizzle == SWIZZLE_1: - value = '1' + value = get_one(dst_type) else: assert False elif format.colorspace == 'zs': if i < 3: value = 'z' else: - value = '1' + value = get_one(dst_type) else: assert False print ' TILE_PIXEL(dst, x, y, %u) = %s; /* %s */' % (i, value, 'rgba'[i]) @@ -130,21 +130,6 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): print -def compute_inverse_swizzle(format): - '''Return an array[4] of inverse swizzle terms''' - inv_swizzle = [None]*4 - if format.colorspace == 'rgb': - for i in range(4): - swizzle = format.out_swizzle[i] - if swizzle < 4: - inv_swizzle[swizzle] = i - elif format.colorspace == 'zs': - swizzle = format.out_swizzle[0] - if swizzle < 4: - inv_swizzle[swizzle] = 0 - return inv_swizzle - - def pack_rgba(format, src_type, r, g, b, a): """Return an expression for packing r, g, b, a into a pixel of the given format. Ex: '(b << 24) | (g << 16) | (r << 8) | (a << 0)' @@ -154,7 +139,7 @@ def pack_rgba(format, src_type, r, g, b, a): shift = 0 expr = None for i in range(4): - # choose r, g, b, or a depending on the inverse swizzle term + # choose r, g, b, or a depending on the inverse swizzle term if inv_swizzle[i] == 0: value = r elif inv_swizzle[i] == 1: @@ -185,7 +170,7 @@ def emit_unrolled_write_code(format, src_type): '''Emit code for writing a block based on unrolled loops. This is considerably faster than the TILE_PIXEL-based code below. ''' - dst_native_type = native_type(format) + dst_native_type = intermediate_native_type(format.block_size(), False) print ' const unsigned dstpix_stride = dst_stride / %d;' % format.stride() print ' %s *dstpix = (%s *) dst;' % (dst_native_type, dst_native_type) print ' unsigned int qx, qy, i;' @@ -256,12 +241,16 @@ def emit_tile_pixel_write_code(format, src_type): def generate_format_write(format, src_type, src_native_type, src_suffix): '''Generate the function to write pixels to a particular format''' - name = short_name(format) + name = format.short_name() print 'static void' print 'lp_tile_%s_write_%s(const %s *src, uint8_t *dst, unsigned dst_stride, unsigned x0, unsigned y0, unsigned w, unsigned h)' % (name, src_suffix, src_native_type) print '{' - if format.layout == ARITH and format.colorspace == 'rgb': + if format.layout in (ARITH, ARRAY) \ + and format.colorspace == 'rgb' \ + and format.block_size() <= 32 \ + and not format.is_mixed() \ + and format.in_types[0].kind == UNSIGNED: emit_unrolled_write_code(format, src_type) else: emit_tile_pixel_write_code(format, src_type) @@ -284,7 +273,7 @@ def generate_read(formats, dst_type, dst_native_type, dst_suffix): for format in formats: if is_format_supported(format): print ' case %s:' % format.name - print ' func = &lp_tile_%s_read_%s;' % (short_name(format), dst_suffix) + print ' func = &lp_tile_%s_read_%s;' % (format.short_name(), dst_suffix) print ' break;' print ' default:' print ' debug_printf("unsupported format\\n");' @@ -311,7 +300,7 @@ def generate_write(formats, src_type, src_native_type, src_suffix): for format in formats: if is_format_supported(format): print ' case %s:' % format.name - print ' func = &lp_tile_%s_write_%s;' % (short_name(format), src_suffix) + print ' func = &lp_tile_%s_write_%s;' % (format.short_name(), src_suffix) print ' break;' print ' default:' print ' debug_printf("unsupported format\\n");' -- cgit v1.2.3 From fb1834cdfdfece763f3125aa2b05e1231f560168 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 08:52:03 -0700 Subject: gallium/docs: clean up texture usage text, added texture geom info --- src/gallium/docs/source/screen.rst | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 27f65522b6..e78634e59e 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -147,16 +147,30 @@ These flags determine the possible roles a texture may be used for during its lifetime. Texture usage flags are cumulative and may be combined to create a texture that can be used as multiple things. -* ``RENDER_TARGET``: A colorbuffer or pixelbuffer. +* ``RENDER_TARGET``: A color buffer or pixel buffer which will be rendered to. * ``DISPLAY_TARGET``: A sharable buffer that can be given to another process. -* ``PRIMARY``: A frontbuffer or scanout buffer. -* ``DEPTH_STENCIL``: A depthbuffer, stencilbuffer, or Z buffer. Gallium does - not explicitly provide for stencil-only buffers, so any stencilbuffer - validated here is implicitly also a depthbuffer. +* ``PRIMARY``: A front color buffer or scanout buffer. +* ``DEPTH_STENCIL``: A depth (Z) buffer or stencil buffer. Gallium does + not explicitly provide for stencil-only buffers, so any stencil buffer + validated here is implicitly also a depth buffer. * ``SAMPLER``: A texture that may be sampled from in a fragment or vertex shader. * ``DYNAMIC``: A texture that will be mapped frequently. + +PIPE_TEXTURE_GEOM +^^^^^^^^^^^^^^^^^ + +These flags are used when querying whether a particular pipe_format is +supported by the driver (with the `is_format_supported` function). +Some formats may only be supported for certain kinds of textures. +For example, a compressed format might only be used for POT textures. + +* ``PIPE_TEXTURE_GEOM_NON_SQUARE``: The texture may not be square +* ``PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO``: The texture dimensions may not be + powers of two. + + Methods ------- -- cgit v1.2.3 From b64b78e7c3d3354933dffd250c996f387243152b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 08:52:20 -0700 Subject: i915g: fix a comment --- src/gallium/drivers/i915/i915_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index e101c8683e..7ba222c78b 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -223,7 +223,7 @@ i915_miptree_layout_2d(struct i915_texture *tex) if (i915_scanout_layout(tex)) return; - /* for shared buffers we use some very like scanout */ + /* for shared buffers we use something very like scanout */ if (pt->tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) if (i915_display_target_layout(tex)) return; -- cgit v1.2.3 From 816d23505abbcd789e7390c515178bc0df8e49c4 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 16:09:44 +0000 Subject: util: Kill array vs arith layouts. Revamp UTIL_FORMAT_LAYOUT_xxx. Too confusing. I now can get the same information through other means. --- src/gallium/auxiliary/util/u_format.csv | 218 +++++++++++++------------- src/gallium/auxiliary/util/u_format.h | 114 ++++++-------- src/gallium/auxiliary/util/u_format_access.py | 8 +- src/gallium/auxiliary/util/u_format_parse.py | 3 +- 4 files changed, 163 insertions(+), 180 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index e8765f2351..50341e9752 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -1,135 +1,135 @@ # Typical rendertarget formats -PIPE_FORMAT_A8R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , zyxw, rgb -PIPE_FORMAT_X8R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb -PIPE_FORMAT_B8G8R8A8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , yzwx, rgb -PIPE_FORMAT_B8G8R8X8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb -PIPE_FORMAT_A1R5G5B5_UNORM , arith , 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb -PIPE_FORMAT_A4R4G4B4_UNORM , arith , 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb -PIPE_FORMAT_R5G6B5_UNORM , arith , 1, 1, un5 , un6 , un5 , , zyx1, rgb -PIPE_FORMAT_A2B10G10R10_UNORM , arith , 1, 1, un10, un10, un10, un2 , xyzw, rgb +PIPE_FORMAT_A8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, rgb +PIPE_FORMAT_X8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb +PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, rgb +PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb +PIPE_FORMAT_A1R5G5B5_UNORM , plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb +PIPE_FORMAT_A4R4G4B4_UNORM , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb +PIPE_FORMAT_R5G6B5_UNORM , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb +PIPE_FORMAT_A2B10G10R10_UNORM , plain, 1, 1, un10, un10, un10, un2 , xyzw, rgb # Luminance/Intensity/Alpha formats -PIPE_FORMAT_L8_UNORM , arith , 1, 1, un8 , , , , xxx1, rgb -PIPE_FORMAT_A8_UNORM , arith , 1, 1, un8 , , , , 000x, rgb -PIPE_FORMAT_I8_UNORM , arith , 1, 1, un8 , , , , xxxx, rgb -PIPE_FORMAT_A8L8_UNORM , arith , 1, 1, un8 , un8 , , , xxxy, rgb -PIPE_FORMAT_L16_UNORM , arith , 1, 1, un16, , , , xxx1, rgb +PIPE_FORMAT_L8_UNORM , plain, 1, 1, un8 , , , , xxx1, rgb +PIPE_FORMAT_A8_UNORM , plain, 1, 1, un8 , , , , 000x, rgb +PIPE_FORMAT_I8_UNORM , plain, 1, 1, un8 , , , , xxxx, rgb +PIPE_FORMAT_A8L8_UNORM , plain, 1, 1, un8 , un8 , , , xxxy, rgb +PIPE_FORMAT_L16_UNORM , plain, 1, 1, un16, , , , xxx1, rgb # SRGB formats -PIPE_FORMAT_L8_SRGB , arith , 1, 1, u8 , , , , xxx1, srgb -PIPE_FORMAT_A8L8_SRGB , arith , 1, 1, u8 , u8 , , , xxxy, srgb -PIPE_FORMAT_R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , , zyx1, srgb -PIPE_FORMAT_R8G8B8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , wzyx, srgb -PIPE_FORMAT_R8G8B8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , wzy1, srgb -PIPE_FORMAT_A8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , zyxw, srgb -PIPE_FORMAT_X8R8G8B8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , zyx1, srgb -PIPE_FORMAT_B8G8R8A8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , yzwx, srgb -PIPE_FORMAT_B8G8R8X8_SRGB , arith , 1, 1, u8 , u8 , u8 , u8 , yzw1, srgb +PIPE_FORMAT_L8_SRGB , plain, 1, 1, u8 , , , , xxx1, srgb +PIPE_FORMAT_A8L8_SRGB , plain, 1, 1, u8 , u8 , , , xxxy, srgb +PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, u8 , u8 , u8 , , zyx1, srgb +PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , wzyx, srgb +PIPE_FORMAT_R8G8B8X8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , wzy1, srgb +PIPE_FORMAT_A8R8G8B8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , zyxw, srgb +PIPE_FORMAT_X8R8G8B8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , zyx1, srgb +PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , yzwx, srgb +PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , yzw1, srgb # Signed formats (typically used for bump map textures) -PIPE_FORMAT_A8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb -PIPE_FORMAT_X8B8G8R8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb -PIPE_FORMAT_X8UB8UG8SR8S_NORM , arith , 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb -PIPE_FORMAT_B6UG5SR5S_NORM , arith , 1, 1, sn5 , sn5 , un6 , , xyz1, rgb +PIPE_FORMAT_A8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb +PIPE_FORMAT_X8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb +PIPE_FORMAT_X8UB8UG8SR8S_NORM , plain, 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb +PIPE_FORMAT_B6UG5SR5S_NORM , plain, 1, 1, sn5 , sn5 , un6 , , xyz1, rgb # Depth-stencil formats -PIPE_FORMAT_S8_UNORM , array , 1, 1, un8 , , , , _x__, zs -PIPE_FORMAT_Z16_UNORM , array , 1, 1, un16, , , , x___, zs -PIPE_FORMAT_Z32_UNORM , array , 1, 1, un32, , , , x___, zs -PIPE_FORMAT_Z32_FLOAT , array , 1, 1, f32 , , , , x___, zs -PIPE_FORMAT_S8Z24_UNORM , arith , 1, 1, un24, un8 , , , xy__, zs -PIPE_FORMAT_Z24S8_UNORM , arith , 1, 1, un8 , un24, , , yx__, zs -PIPE_FORMAT_X8Z24_UNORM , arith , 1, 1, un24, un8 , , , x___, zs -PIPE_FORMAT_Z24X8_UNORM , arith , 1, 1, un8 , un24, , , y___, zs +PIPE_FORMAT_S8_UNORM , plain, 1, 1, un8 , , , , _x__, zs +PIPE_FORMAT_Z16_UNORM , plain, 1, 1, un16, , , , x___, zs +PIPE_FORMAT_Z32_UNORM , plain, 1, 1, un32, , , , x___, zs +PIPE_FORMAT_Z32_FLOAT , plain, 1, 1, f32 , , , , x___, zs +PIPE_FORMAT_S8Z24_UNORM , plain, 1, 1, un24, un8 , , , xy__, zs +PIPE_FORMAT_Z24S8_UNORM , plain, 1, 1, un8 , un24, , , yx__, zs +PIPE_FORMAT_X8Z24_UNORM , plain, 1, 1, un24, un8 , , , x___, zs +PIPE_FORMAT_Z24X8_UNORM , plain, 1, 1, un8 , un24, , , y___, zs # YUV formats -PIPE_FORMAT_YCBCR , yuv , 2, 1, x32 , , , , xyz1, yuv -PIPE_FORMAT_YCBCR_REV , yuv , 2, 1, x32 , , , , xyz1, yuv +PIPE_FORMAT_YCBCR , subsampled, 2, 1, x32 , , , , xyz1, yuv +PIPE_FORMAT_YCBCR_REV , subsampled, 2, 1, x32 , , , , xyz1, yuv # Compressed formats -PIPE_FORMAT_DXT1_RGB , dxt , 4, 4, x64 , , , , xyz1, rgb -PIPE_FORMAT_DXT1_RGBA , dxt , 4, 4, x64 , , , , xyzw, rgb -PIPE_FORMAT_DXT3_RGBA , dxt , 4, 4, x128, , , , xyzw, rgb -PIPE_FORMAT_DXT5_RGBA , dxt , 4, 4, x128, , , , xyzw, rgb -PIPE_FORMAT_DXT1_SRGB , dxt , 4, 4, x64 , , , , xyz1, srgb -PIPE_FORMAT_DXT1_SRGBA , dxt , 4, 4, x64 , , , , xyzw, srgb -PIPE_FORMAT_DXT3_SRGBA , dxt , 4, 4, x128, , , , xyzw, srgb -PIPE_FORMAT_DXT5_SRGBA , dxt , 4, 4, x128, , , , xyzw, srgb +PIPE_FORMAT_DXT1_RGB , compressed, 4, 4, x64 , , , , xyz1, rgb +PIPE_FORMAT_DXT1_RGBA , compressed, 4, 4, x64 , , , , xyzw, rgb +PIPE_FORMAT_DXT3_RGBA , compressed, 4, 4, x128, , , , xyzw, rgb +PIPE_FORMAT_DXT5_RGBA , compressed, 4, 4, x128, , , , xyzw, rgb +PIPE_FORMAT_DXT1_SRGB , compressed, 4, 4, x64 , , , , xyz1, srgb +PIPE_FORMAT_DXT1_SRGBA , compressed, 4, 4, x64 , , , , xyzw, srgb +PIPE_FORMAT_DXT3_SRGBA , compressed, 4, 4, x128, , , , xyzw, srgb +PIPE_FORMAT_DXT5_SRGBA , compressed, 4, 4, x128, , , , xyzw, srgb # Old vector formats # XXX: Swizzle notation is reversed for these! # See also: # - src/gallium/auxiliary/translate/translate_generic.c # - src/mesa/state_tracker/st_draw.c -PIPE_FORMAT_R64_FLOAT , array , 1, 1, f64 , , , , x001, rgb -PIPE_FORMAT_R64G64_FLOAT , array , 1, 1, f64 , f64 , , , xy01, rgb -PIPE_FORMAT_R64G64B64_FLOAT , array , 1, 1, f64 , f64 , f64 , , xyz1, rgb -PIPE_FORMAT_R64G64B64A64_FLOAT , array , 1, 1, f64 , f64 , f64 , f64 , xyzw, rgb -PIPE_FORMAT_R32_FLOAT , array , 1, 1, f32 , , , , x001, rgb -PIPE_FORMAT_R32G32_FLOAT , array , 1, 1, f32 , f32 , , , xy01, rgb -PIPE_FORMAT_R32G32B32_FLOAT , array , 1, 1, f32 , f32 , f32 , , xyz1, rgb -PIPE_FORMAT_R32G32B32A32_FLOAT , array , 1, 1, f32 , f32 , f32 , f32 , xyzw, rgb -PIPE_FORMAT_R32_UNORM , array , 1, 1, un32, , , , x001, rgb -PIPE_FORMAT_R32G32_UNORM , array , 1, 1, un32, un32, , , xy01, rgb -PIPE_FORMAT_R32G32B32_UNORM , array , 1, 1, un32, un32, un32, , xyz1, rgb -PIPE_FORMAT_R32G32B32A32_UNORM , array , 1, 1, un32, un32, un32, un32, xyzw, rgb -PIPE_FORMAT_R32_USCALED , array , 1, 1, u32 , , , , x001, rgb -PIPE_FORMAT_R32G32_USCALED , array , 1, 1, u32 , u32 , , , xy01, rgb -PIPE_FORMAT_R32G32B32_USCALED , array , 1, 1, u32 , u32 , u32 , , xyz1, rgb -PIPE_FORMAT_R32G32B32A32_USCALED , array , 1, 1, u32 , u32 , u32 , u32 , xyzw, rgb -PIPE_FORMAT_R32_SNORM , array , 1, 1, sn32, , , , x001, rgb -PIPE_FORMAT_R32G32_SNORM , array , 1, 1, sn32, sn32, , , xy01, rgb -PIPE_FORMAT_R32G32B32_SNORM , array , 1, 1, sn32, sn32, sn32, , xyz1, rgb -PIPE_FORMAT_R32G32B32A32_SNORM , array , 1, 1, sn32, sn32, sn32, sn32, xyzw, rgb -PIPE_FORMAT_R32_SSCALED , array , 1, 1, s32 , , , , x001, rgb -PIPE_FORMAT_R32G32_SSCALED , array , 1, 1, s32 , s32 , , , xy01, rgb -PIPE_FORMAT_R32G32B32_SSCALED , array , 1, 1, s32 , s32 , s32 , , xyz1, rgb -PIPE_FORMAT_R32G32B32A32_SSCALED , array , 1, 1, s32 , s32 , s32 , s32 , xyzw, rgb -PIPE_FORMAT_R32_FIXED , array , 1, 1, h32 , , , , x001, rgb -PIPE_FORMAT_R32G32_FIXED , array , 1, 1, h32 , h32 , , , xy01, rgb -PIPE_FORMAT_R32G32B32_FIXED , array , 1, 1, h32 , h32 , h32 , , xyz1, rgb -PIPE_FORMAT_R32G32B32A32_FIXED , array , 1, 1, h32 , h32 , h32 , h32 , xyzw, rgb -PIPE_FORMAT_R16_UNORM , array , 1, 1, un16, , , , x001, rgb -PIPE_FORMAT_R16G16_UNORM , array , 1, 1, un16, un16, , , xy01, rgb -PIPE_FORMAT_R16G16B16_UNORM , array , 1, 1, un16, un16, un16, , xyz1, rgb -PIPE_FORMAT_R16G16B16A16_UNORM , array , 1, 1, un16, un16, un16, un16, xyzw, rgb -PIPE_FORMAT_R16_USCALED , array , 1, 1, u16 , , , , x001, rgb -PIPE_FORMAT_R16G16_USCALED , array , 1, 1, u16 , u16 , , , xy01, rgb -PIPE_FORMAT_R16G16B16_USCALED , array , 1, 1, u16 , u16 , u16 , , xyz1, rgb -PIPE_FORMAT_R16G16B16A16_USCALED , array , 1, 1, u16 , u16 , u16 , u16 , xyzw, rgb -PIPE_FORMAT_R16_SNORM , array , 1, 1, sn16, , , , x001, rgb -PIPE_FORMAT_R16G16_SNORM , array , 1, 1, sn16, sn16, , , xy01, rgb -PIPE_FORMAT_R16G16B16_SNORM , array , 1, 1, sn16, sn16, sn16, , xyz1, rgb -PIPE_FORMAT_R16G16B16A16_SNORM , array , 1, 1, sn16, sn16, sn16, sn16, xyzw, rgb -PIPE_FORMAT_R16_SSCALED , array , 1, 1, s16 , , , , x001, rgb -PIPE_FORMAT_R16G16_SSCALED , array , 1, 1, s16 , s16 , , , xy01, rgb -PIPE_FORMAT_R16G16B16_SSCALED , array , 1, 1, s16 , s16 , s16 , , xyz1, rgb -PIPE_FORMAT_R16G16B16A16_SSCALED , array , 1, 1, s16 , s16 , s16 , s16 , xyzw, rgb -PIPE_FORMAT_R8_UNORM , array , 1, 1, un8 , , , , x001, rgb -PIPE_FORMAT_R8G8_UNORM , array , 1, 1, un8 , un8 , , , xy01, rgb -PIPE_FORMAT_R8_USCALED , array , 1, 1, u8 , , , , x001, rgb -PIPE_FORMAT_R8G8_USCALED , array , 1, 1, u8 , u8 , , , xy01, rgb -PIPE_FORMAT_R8G8B8_USCALED , array , 1, 1, u8 , u8 , u8 , , xyz1, rgb -PIPE_FORMAT_R8G8B8A8_USCALED , array , 1, 1, u8 , u8 , u8 , u8 , xyzw, rgb -PIPE_FORMAT_R8_SNORM , array , 1, 1, sn8 , , , , x001, rgb -PIPE_FORMAT_R8G8_SNORM , array , 1, 1, sn8 , sn8 , , , xy01, rgb -PIPE_FORMAT_R8G8B8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , , xyz1, rgb -PIPE_FORMAT_R8G8B8A8_SNORM , array , 1, 1, sn8 , sn8 , sn8 , sn8 , xyzw, rgb -PIPE_FORMAT_R8_SSCALED , array , 1, 1, s8 , , , , x001, rgb -PIPE_FORMAT_R8G8_SSCALED , array , 1, 1, s8 , s8 , , , xy01, rgb -PIPE_FORMAT_R8G8B8_SSCALED , array , 1, 1, s8 , s8 , s8 , , xyz1, rgb -PIPE_FORMAT_R8G8B8A8_SSCALED , array , 1, 1, s8 , s8 , s8 , s8 , xyzw, rgb +PIPE_FORMAT_R64_FLOAT , plain, 1, 1, f64 , , , , x001, rgb +PIPE_FORMAT_R64G64_FLOAT , plain, 1, 1, f64 , f64 , , , xy01, rgb +PIPE_FORMAT_R64G64B64_FLOAT , plain, 1, 1, f64 , f64 , f64 , , xyz1, rgb +PIPE_FORMAT_R64G64B64A64_FLOAT , plain, 1, 1, f64 , f64 , f64 , f64 , xyzw, rgb +PIPE_FORMAT_R32_FLOAT , plain, 1, 1, f32 , , , , x001, rgb +PIPE_FORMAT_R32G32_FLOAT , plain, 1, 1, f32 , f32 , , , xy01, rgb +PIPE_FORMAT_R32G32B32_FLOAT , plain, 1, 1, f32 , f32 , f32 , , xyz1, rgb +PIPE_FORMAT_R32G32B32A32_FLOAT , plain, 1, 1, f32 , f32 , f32 , f32 , xyzw, rgb +PIPE_FORMAT_R32_UNORM , plain, 1, 1, un32, , , , x001, rgb +PIPE_FORMAT_R32G32_UNORM , plain, 1, 1, un32, un32, , , xy01, rgb +PIPE_FORMAT_R32G32B32_UNORM , plain, 1, 1, un32, un32, un32, , xyz1, rgb +PIPE_FORMAT_R32G32B32A32_UNORM , plain, 1, 1, un32, un32, un32, un32, xyzw, rgb +PIPE_FORMAT_R32_USCALED , plain, 1, 1, u32 , , , , x001, rgb +PIPE_FORMAT_R32G32_USCALED , plain, 1, 1, u32 , u32 , , , xy01, rgb +PIPE_FORMAT_R32G32B32_USCALED , plain, 1, 1, u32 , u32 , u32 , , xyz1, rgb +PIPE_FORMAT_R32G32B32A32_USCALED , plain, 1, 1, u32 , u32 , u32 , u32 , xyzw, rgb +PIPE_FORMAT_R32_SNORM , plain, 1, 1, sn32, , , , x001, rgb +PIPE_FORMAT_R32G32_SNORM , plain, 1, 1, sn32, sn32, , , xy01, rgb +PIPE_FORMAT_R32G32B32_SNORM , plain, 1, 1, sn32, sn32, sn32, , xyz1, rgb +PIPE_FORMAT_R32G32B32A32_SNORM , plain, 1, 1, sn32, sn32, sn32, sn32, xyzw, rgb +PIPE_FORMAT_R32_SSCALED , plain, 1, 1, s32 , , , , x001, rgb +PIPE_FORMAT_R32G32_SSCALED , plain, 1, 1, s32 , s32 , , , xy01, rgb +PIPE_FORMAT_R32G32B32_SSCALED , plain, 1, 1, s32 , s32 , s32 , , xyz1, rgb +PIPE_FORMAT_R32G32B32A32_SSCALED , plain, 1, 1, s32 , s32 , s32 , s32 , xyzw, rgb +PIPE_FORMAT_R32_FIXED , plain, 1, 1, h32 , , , , x001, rgb +PIPE_FORMAT_R32G32_FIXED , plain, 1, 1, h32 , h32 , , , xy01, rgb +PIPE_FORMAT_R32G32B32_FIXED , plain, 1, 1, h32 , h32 , h32 , , xyz1, rgb +PIPE_FORMAT_R32G32B32A32_FIXED , plain, 1, 1, h32 , h32 , h32 , h32 , xyzw, rgb +PIPE_FORMAT_R16_UNORM , plain, 1, 1, un16, , , , x001, rgb +PIPE_FORMAT_R16G16_UNORM , plain, 1, 1, un16, un16, , , xy01, rgb +PIPE_FORMAT_R16G16B16_UNORM , plain, 1, 1, un16, un16, un16, , xyz1, rgb +PIPE_FORMAT_R16G16B16A16_UNORM , plain, 1, 1, un16, un16, un16, un16, xyzw, rgb +PIPE_FORMAT_R16_USCALED , plain, 1, 1, u16 , , , , x001, rgb +PIPE_FORMAT_R16G16_USCALED , plain, 1, 1, u16 , u16 , , , xy01, rgb +PIPE_FORMAT_R16G16B16_USCALED , plain, 1, 1, u16 , u16 , u16 , , xyz1, rgb +PIPE_FORMAT_R16G16B16A16_USCALED , plain, 1, 1, u16 , u16 , u16 , u16 , xyzw, rgb +PIPE_FORMAT_R16_SNORM , plain, 1, 1, sn16, , , , x001, rgb +PIPE_FORMAT_R16G16_SNORM , plain, 1, 1, sn16, sn16, , , xy01, rgb +PIPE_FORMAT_R16G16B16_SNORM , plain, 1, 1, sn16, sn16, sn16, , xyz1, rgb +PIPE_FORMAT_R16G16B16A16_SNORM , plain, 1, 1, sn16, sn16, sn16, sn16, xyzw, rgb +PIPE_FORMAT_R16_SSCALED , plain, 1, 1, s16 , , , , x001, rgb +PIPE_FORMAT_R16G16_SSCALED , plain, 1, 1, s16 , s16 , , , xy01, rgb +PIPE_FORMAT_R16G16B16_SSCALED , plain, 1, 1, s16 , s16 , s16 , , xyz1, rgb +PIPE_FORMAT_R16G16B16A16_SSCALED , plain, 1, 1, s16 , s16 , s16 , s16 , xyzw, rgb +PIPE_FORMAT_R8_UNORM , plain, 1, 1, un8 , , , , x001, rgb +PIPE_FORMAT_R8G8_UNORM , plain, 1, 1, un8 , un8 , , , xy01, rgb +PIPE_FORMAT_R8_USCALED , plain, 1, 1, u8 , , , , x001, rgb +PIPE_FORMAT_R8G8_USCALED , plain, 1, 1, u8 , u8 , , , xy01, rgb +PIPE_FORMAT_R8G8B8_USCALED , plain, 1, 1, u8 , u8 , u8 , , xyz1, rgb +PIPE_FORMAT_R8G8B8A8_USCALED , plain, 1, 1, u8 , u8 , u8 , u8 , xyzw, rgb +PIPE_FORMAT_R8_SNORM , plain, 1, 1, sn8 , , , , x001, rgb +PIPE_FORMAT_R8G8_SNORM , plain, 1, 1, sn8 , sn8 , , , xy01, rgb +PIPE_FORMAT_R8G8B8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , , xyz1, rgb +PIPE_FORMAT_R8G8B8A8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyzw, rgb +PIPE_FORMAT_R8_SSCALED , plain, 1, 1, s8 , , , , x001, rgb +PIPE_FORMAT_R8G8_SSCALED , plain, 1, 1, s8 , s8 , , , xy01, rgb +PIPE_FORMAT_R8G8B8_SSCALED , plain, 1, 1, s8 , s8 , s8 , , xyz1, rgb +PIPE_FORMAT_R8G8B8A8_SSCALED , plain, 1, 1, s8 , s8 , s8 , s8 , xyzw, rgb # Ambiguous formats # FIXME: They are used with different meanings in different places!!! -PIPE_FORMAT_R8G8B8_UNORM , arith , 1, 1, un8 , un8 , un8 , , zyx1, rgb -PIPE_FORMAT_R8G8B8A8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb +PIPE_FORMAT_R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , , zyx1, rgb +PIPE_FORMAT_R8G8B8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb # Unused formats # XXX: Couldn't find any state tracker using them!! -PIPE_FORMAT_B6G5R5_SNORM , arith , 1, 1, sn5 , sn5 , sn6 , , xyz1, rgb -PIPE_FORMAT_R8G8B8X8_SNORM , arith , 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb -PIPE_FORMAT_R8G8B8X8_USCALED , arith , 1, 1, u8 , u8 , u8 , u8 , wzy1, rgb -PIPE_FORMAT_R8G8B8X8_SSCALED , arith , 1, 1, s8 , s8 , s8 , s8 , wzy1, rgb +PIPE_FORMAT_B6G5R5_SNORM , plain, 1, 1, sn5 , sn5 , sn6 , , xyz1, rgb +PIPE_FORMAT_R8G8B8X8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb +PIPE_FORMAT_R8G8B8X8_USCALED , plain, 1, 1, u8 , u8 , u8 , u8 , wzy1, rgb +PIPE_FORMAT_R8G8B8X8_SSCALED , plain, 1, 1, s8 , s8 , s8 , s8 , wzy1, rgb # XXX: This one is mentioned in mesa and r300, but not anywhere else. Not sure it is actually needed -PIPE_FORMAT_R8G8B8X8_UNORM , arith , 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb +PIPE_FORMAT_R8G8B8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 7792aa0673..e8fa0022b5 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2009 Vmware, Inc. + * Copyright 2009-2010 Vmware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -39,42 +39,32 @@ extern "C" { /** - * Describe how to best pack/unpack pixels into/from the prescribed format. + * Describe how to pack/unpack pixels into/from the prescribed format. * - * These are used for automatic code generation of pixel packing and unpacking - * routines (in compile time, e.g., u_format_access.py, or in runtime, like - * llvmpipe does). - * - * Thumb rule is: if you're not code generating pixel packing/unpacking then - * these are irrelevant for you. - * - * Note that this can be deduced from other values in util_format_description - * structure. This is by design, to make code generation of pixel - * packing/unpacking/sampling routines simple and efficient. - * - * XXX: This should be renamed to something like util_format_pack. + * XXX: This could be renamed to something like util_format_pack, or broke down + * in flags inside util_format_block that said exactly what we want. */ enum util_format_layout { /** - * One or more components of mixed integer formats, arithmetically encoded - * in a word up to 32bits. + * Formats with util_format_block::width == util_format_block::height == 1 + * that can be described as an ordinary data structure. */ - UTIL_FORMAT_LAYOUT_ARITH = 1, + UTIL_FORMAT_LAYOUT_PLAIN = 0, /** - * One or more components, no mixed formats, each with equal power of two - * number of bytes. + * Formats with sub-sampled channels. + * + * This is for formats like YV12 where there is less than one sample per + * pixel. + * + * XXX: This could actually b */ - UTIL_FORMAT_LAYOUT_ARRAY = 2, + UTIL_FORMAT_LAYOUT_SUBSAMPLED = 3, /** - * XXX: Not used yet. These might go away and be replaced by a single entry, - * for formats where multiple pixels have to be - * read in order to determine a single pixel value (i.e., block.width > 1 - * || block.height > 1) + * An unspecified compression algorithm. */ - UTIL_FORMAT_LAYOUT_YUV = 3, - UTIL_FORMAT_LAYOUT_DXT = 4 + UTIL_FORMAT_LAYOUT_COMPRESSED = 4 }; @@ -131,7 +121,12 @@ struct util_format_description { enum pipe_format format; const char *name; + + /** + * Pixel block dimensions. + */ struct util_format_block block; + enum util_format_layout layout; /** @@ -140,7 +135,7 @@ struct util_format_description unsigned nr_channels:3; /** - * Whether all channels have the same number of whole bytes. + * Whether all channels have the same number of (whole) bytes. */ unsigned is_array:1; @@ -149,10 +144,27 @@ struct util_format_description */ unsigned is_mixed:1; + /** + * Input channel description. + * + * Only valid for UTIL_FORMAT_LAYOUT_PLAIN formats. + */ struct util_format_channel_description channel[4]; + /** + * Output channel swizzle. + * + * The order is either: + * - RGBA + * - YUV(A) + * - ZS + * depending on the colorspace. + */ unsigned char swizzle[4]; + /** + * Colorspace transformation. + */ enum util_format_colorspace colorspace; }; @@ -192,7 +204,7 @@ util_format_is_compressed(enum pipe_format format) return FALSE; } - return desc->layout == UTIL_FORMAT_LAYOUT_DXT ? TRUE : FALSE; + return desc->layout == UTIL_FORMAT_LAYOUT_COMPRESSED ? TRUE : FALSE; } static INLINE boolean @@ -266,14 +278,7 @@ util_format_get_blockwidth(enum pipe_format format) return 1; } - switch (desc->layout) { - case UTIL_FORMAT_LAYOUT_YUV: - return 2; - case UTIL_FORMAT_LAYOUT_DXT: - return 4; - default: - return 1; - } + return desc->block.width; } static INLINE uint @@ -286,12 +291,7 @@ util_format_get_blockheight(enum pipe_format format) return 1; } - switch (desc->layout) { - case UTIL_FORMAT_LAYOUT_DXT: - return 4; - default: - return 1; - } + return desc->block.height; } static INLINE unsigned @@ -386,30 +386,14 @@ util_format_has_alpha(enum pipe_format format) return FALSE; } - switch (desc->layout) { - case UTIL_FORMAT_LAYOUT_ARITH: - case UTIL_FORMAT_LAYOUT_ARRAY: - /* FIXME: pf_get_component_bits( PIPE_FORMAT_A8L8_UNORM, PIPE_FORMAT_COMP_A ) should not return 0 right? */ - if (format == PIPE_FORMAT_A8_UNORM || - format == PIPE_FORMAT_A8L8_UNORM || - format == PIPE_FORMAT_A8L8_SRGB) { - return TRUE; - } - return util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 3) != 0; - case UTIL_FORMAT_LAYOUT_YUV: + switch (desc->colorspace) { + case UTIL_FORMAT_COLORSPACE_RGB: + case UTIL_FORMAT_COLORSPACE_SRGB: + return desc->swizzle[3] != UTIL_FORMAT_SWIZZLE_1; + case UTIL_FORMAT_COLORSPACE_YUV: + return FALSE; + case UTIL_FORMAT_COLORSPACE_ZS: return FALSE; - case UTIL_FORMAT_LAYOUT_DXT: - switch (format) { - case PIPE_FORMAT_DXT1_RGBA: - case PIPE_FORMAT_DXT3_RGBA: - case PIPE_FORMAT_DXT5_RGBA: - case PIPE_FORMAT_DXT1_SRGBA: - case PIPE_FORMAT_DXT3_SRGBA: - case PIPE_FORMAT_DXT5_SRGBA: - return TRUE; - default: - return FALSE; - } default: assert(0); return FALSE; diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index fb85215d20..f7a92f62a8 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -52,7 +52,7 @@ def is_format_supported(format): if format.colorspace not in ('rgb', 'zs'): return False - if format.layout not in (ARITH, ARRAY): + if format.layout != PLAIN: return False for i in range(4): @@ -70,7 +70,7 @@ def is_format_supported(format): def native_type(format): '''Get the native appropriate for a format.''' - if format.layout in (ARITH, ARRAY): + if format.layout == PLAIN: if not format.is_array(): # For arithmetic pixel formats return the integer type that matches the whole pixel return 'uint%u_t' % format.block_size() @@ -299,7 +299,7 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): else: assert False - if format.layout in (ARITH, ARRAY): + if format.layout == PLAIN: if not format.is_array(): print ' %s pixel = *src_pixel++;' % src_native_type shift = 0; @@ -374,7 +374,7 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): inv_swizzle = compute_inverse_swizzle(format) - if format.layout in (ARITH, ARRAY): + if format.layout == PLAIN: if not format.is_array(): print ' %s pixel = 0;' % dst_native_type shift = 0; diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 248a26ea8c..983c3a90fc 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -37,8 +37,7 @@ VOID, UNSIGNED, SIGNED, FIXED, FLOAT = range(5) SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_0, SWIZZLE_1, SWIZZLE_NONE, = range(7) -ARITH = 'arith' -ARRAY = 'array' +PLAIN = 'plain' class Type: -- cgit v1.2.3 From e5a43ac594e7b4c072b90310f7193c341b015f6b Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 16:10:06 +0000 Subject: gallivm: Update for UTIL_FORMAT_LAYOUT_xxx changes. --- src/gallium/auxiliary/gallivm/lp_bld_depth.c | 2 +- src/gallium/auxiliary/gallivm/lp_bld_format_aos.c | 6 +++--- src/gallium/auxiliary/gallivm/lp_bld_format_soa.c | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_depth.c b/src/gallium/auxiliary/gallivm/lp_bld_depth.c index d438c0e63d..f08f8eb6d8 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_depth.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_depth.c @@ -171,7 +171,7 @@ lp_build_depth_test(LLVMBuilderRef builder, unsigned padding_right; unsigned chan; - assert(format_desc->layout == UTIL_FORMAT_LAYOUT_ARITH); + assert(format_desc->layout == UTIL_FORMAT_LAYOUT_PLAIN); assert(format_desc->channel[z_swizzle].type == UTIL_FORMAT_TYPE_UNSIGNED); assert(format_desc->channel[z_swizzle].size <= format_desc->block.bits); assert(format_desc->channel[z_swizzle].normalized); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c index dfa080b853..a07f7418f2 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c @@ -70,7 +70,7 @@ lp_build_unpack_rgba_aos(LLVMBuilderRef builder, unsigned i; /* FIXME: Support more formats */ - assert(desc->layout == UTIL_FORMAT_LAYOUT_ARITH); + assert(desc->layout == UTIL_FORMAT_LAYOUT_PLAIN); assert(desc->block.width == 1); assert(desc->block.height == 1); assert(desc->block.bits <= 32); @@ -189,7 +189,7 @@ lp_build_unpack_rgba8_aos(LLVMBuilderRef builder, lp_build_context_init(&bld, builder, type); /* FIXME: Support more formats */ - assert(desc->layout == UTIL_FORMAT_LAYOUT_ARITH); + assert(desc->layout == UTIL_FORMAT_LAYOUT_PLAIN); assert(desc->block.width == 1); assert(desc->block.height == 1); assert(desc->block.bits <= 32); @@ -303,7 +303,7 @@ lp_build_pack_rgba_aos(LLVMBuilderRef builder, unsigned shift; unsigned i, j; - assert(desc->layout == UTIL_FORMAT_LAYOUT_ARITH); + assert(desc->layout == UTIL_FORMAT_LAYOUT_PLAIN); assert(desc->block.width == 1); assert(desc->block.height == 1); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c index 64151d169d..abb27e4c32 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_soa.c @@ -92,9 +92,7 @@ lp_build_unpack_rgba_soa(LLVMBuilderRef builder, unsigned chan; /* FIXME: Support more formats */ - assert(format_desc->layout == UTIL_FORMAT_LAYOUT_ARITH || - (format_desc->layout == UTIL_FORMAT_LAYOUT_ARRAY && - format_desc->block.bits == format_desc->channel[0].size)); + assert(format_desc->layout == UTIL_FORMAT_LAYOUT_PLAIN); assert(format_desc->block.width == 1); assert(format_desc->block.height == 1); assert(format_desc->block.bits <= 32); -- cgit v1.2.3 From 83686b3f92f29208e35b971c118e179c14e120db Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 16:10:14 +0000 Subject: llvmpipe: Update for UTIL_FORMAT_LAYOUT_xxx changes. --- src/gallium/drivers/llvmpipe/lp_screen.c | 6 ++---- src/gallium/drivers/llvmpipe/lp_tile_soa.py | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 0e5750ce11..1950f14135 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -194,8 +194,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, format_desc->block.height != 1) return FALSE; - if(format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH && - format_desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) + if(format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) return FALSE; if(format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB && @@ -223,8 +222,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, format_desc->block.height != 1) return FALSE; - if(format_desc->layout != UTIL_FORMAT_LAYOUT_ARITH && - format_desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) + if(format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) return FALSE; if(format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB && diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py index 0b9631f871..a66a846f8e 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py @@ -76,7 +76,7 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): else: assert False - if format.layout in (ARITH, ARRAY): + if format.layout == PLAIN: if not format.is_array(): print ' %s pixel = *src_pixel++;' % src_native_type shift = 0; @@ -208,7 +208,7 @@ def emit_tile_pixel_write_code(format, src_type): print ' %s *dst_pixel = (%s *)(dst_row + x0*%u);' % (dst_native_type, dst_native_type, format.stride()) print ' for (x = 0; x < w; ++x) {' - if format.layout in (ARITH, ARRAY): + if format.layout == PLAIN: if not format.is_array(): print ' %s pixel = 0;' % dst_native_type shift = 0; @@ -246,7 +246,7 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): print 'static void' print 'lp_tile_%s_write_%s(const %s *src, uint8_t *dst, unsigned dst_stride, unsigned x0, unsigned y0, unsigned w, unsigned h)' % (name, src_suffix, src_native_type) print '{' - if format.layout in (ARITH, ARRAY) \ + if format.layout == PLAIN \ and format.colorspace == 'rgb' \ and format.block_size() <= 32 \ and not format.is_mixed() \ -- cgit v1.2.3 From 85434f9e3cae74c1992bb619641f97c0e4028a63 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 16:10:36 +0000 Subject: mesa: Update for UTIL_FORMAT_LAYOUT_xxx changes. --- src/mesa/state_tracker/st_format.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 851c16f83c..3100a4edaa 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -82,8 +82,7 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) desc = util_format_description(format); assert(desc); - if (desc->layout == UTIL_FORMAT_LAYOUT_ARITH || - desc->layout == UTIL_FORMAT_LAYOUT_ARRAY) { + if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) { #if 0 printf("%s\n", util_format_name( format ) ); #endif @@ -147,11 +146,16 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) pinfo->mesa_format = st_pipe_format_to_mesa_format(format); } - else if (desc->layout == UTIL_FORMAT_LAYOUT_YUV) { + else if (format == PIPE_FORMAT_YCBCR) { pinfo->mesa_format = MESA_FORMAT_YCBCR; pinfo->datatype = GL_UNSIGNED_SHORT; pinfo->size = 2; /* two bytes per "texel" */ } + else if (format == PIPE_FORMAT_YCBCR_REV) { + pinfo->mesa_format = MESA_FORMAT_YCBCR_REV; + pinfo->datatype = GL_UNSIGNED_SHORT; + pinfo->size = 2; /* two bytes per "texel" */ + } else { /* compressed format? */ assert(0); -- cgit v1.2.3 From f9f4f3df422334aee31f9041c374c72d0f97ba39 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 24 Feb 2010 16:11:08 +0000 Subject: r300: Update for UTIL_FORMAT_LAYOUT_xxx changes. --- src/gallium/drivers/r300/r300_state_inlines.h | 6 ++---- src/gallium/drivers/r300/r300_texture.c | 14 ++------------ 2 files changed, 4 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 0e1cb328d1..2f3a56e1fb 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -384,8 +384,7 @@ r300_translate_vertex_data_type(enum pipe_format format) { desc = util_format_description(format); - if (desc->layout != UTIL_FORMAT_LAYOUT_ARITH && - desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) { + if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) { debug_printf("r300: Bad format %s in %s:%d\n", util_format_name(format), __FUNCTION__, __LINE__); assert(0); @@ -458,8 +457,7 @@ r300_translate_vertex_data_swizzle(enum pipe_format format) { assert(format); - if (desc->layout != UTIL_FORMAT_LAYOUT_ARITH && - desc->layout != UTIL_FORMAT_LAYOUT_ARRAY) { + if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) { debug_printf("r300: Bad format %s in %s:%d\n", util_format_name(format), __FUNCTION__, __LINE__); return 0; diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 7b116b30e5..7c3b781c0b 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -70,19 +70,12 @@ static uint32_t r300_translate_texformat(enum pipe_format format) R300_TX_FORMAT_B_SHIFT, R300_TX_FORMAT_A_SHIFT }; - const uint32_t swizzle_arith[4] = { + const uint32_t swizzle[4] = { R300_TX_FORMAT_X, R300_TX_FORMAT_Y, R300_TX_FORMAT_Z, R300_TX_FORMAT_W }; - const uint32_t swizzle_array[4] = { - R300_TX_FORMAT_W, - R300_TX_FORMAT_Z, - R300_TX_FORMAT_Y, - R300_TX_FORMAT_X - }; - const uint32_t *swizzle; const uint32_t sign_bit[4] = { R300_TX_FORMAT_SIGNED_X, R300_TX_FORMAT_SIGNED_Y, @@ -128,9 +121,6 @@ static uint32_t r300_translate_texformat(enum pipe_format format) } /* Add swizzle. */ - swizzle = desc->layout == UTIL_FORMAT_LAYOUT_ARITH ? - swizzle_arith : swizzle_array; - for (i = 0; i < 4; i++) { switch (desc->swizzle[i]) { case UTIL_FORMAT_SWIZZLE_X: @@ -158,7 +148,7 @@ static uint32_t r300_translate_texformat(enum pipe_format format) } /* Compressed formats. */ - if (desc->layout == UTIL_FORMAT_LAYOUT_DXT) { + if (desc->layout == UTIL_FORMAT_LAYOUT_COMPRESSED) { switch (format) { case PIPE_FORMAT_DXT1_RGB: case PIPE_FORMAT_DXT1_RGBA: -- cgit v1.2.3 From 5997501ca0d0c905025bc2a840e48e2176d64ea3 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 24 Feb 2010 11:43:33 -0500 Subject: r600: proper fix for 15601835361e2fdd34b38b265cfc3007749ee24d PRE_EMIT_STATE_BUFSZ accounts for the start 3d, idle, cd/db flush not for state. The relocs for CB_COLOR0_FRAG & CB_COLOR0_TILE are part of the render target state. --- src/mesa/drivers/dri/r600/r700_chip.c | 2 +- src/mesa/drivers/dri/r600/r700_render.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index a742dbcf12..63614b160c 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1349,7 +1349,7 @@ void r600InitAtoms(context_t *context) ALLOC_STATE(poly, always, 10, r700SendPolyState); ALLOC_STATE(cb, cb, 18, r700SendCBState); ALLOC_STATE(clrcmp, always, 6, r700SendCBCLRCMPState); - ALLOC_STATE(cb_target, always, 25, r700SendRenderTargetState); + ALLOC_STATE(cb_target, always, 29, r700SendRenderTargetState); ALLOC_STATE(blnd, blnd, (6 + (R700_MAX_RENDER_TARGETS * 3)), r700SendCBBlendState); ALLOC_STATE(blnd_clr, always, 6, r700SendCBBlendColorState); ALLOC_STATE(sx, always, 9, r700SendSXState); diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index fdd02fac23..1d7a94cbb2 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -419,7 +419,7 @@ static void r700RunRenderPrimitiveImmediate(GLcontext * ctx, int start, int end, } /* start 3d, idle, cb/db flush */ -#define PRE_EMIT_STATE_BUFSZ 5 + 5 + 18 +#define PRE_EMIT_STATE_BUFSZ 5 + 5 + 14 static GLuint r700PredictRenderSize(GLcontext* ctx, const struct _mesa_prim *prim, -- cgit v1.2.3 From ba929471989f9670fba80fc786ed9b4e7f8185c8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 10:43:30 -0700 Subject: llvmpipe: vertex shader textures not supported yet --- src/gallium/drivers/llvmpipe/lp_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 1950f14135..89869faeb9 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -83,7 +83,7 @@ llvmpipe_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return PIPE_MAX_SAMPLERS; case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: - return PIPE_MAX_VERTEX_SAMPLERS; + return 0; case PIPE_CAP_MAX_COMBINED_SAMPLERS: return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS; case PIPE_CAP_NPOT_TEXTURES: -- cgit v1.2.3 From f8978f186ec38b3f9021d0c96fed11d10157face Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 10:47:58 -0700 Subject: llvmpipe: SRGB textures not supported yet --- src/gallium/drivers/llvmpipe/lp_screen.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 89869faeb9..f84ede675b 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -226,7 +226,6 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, return FALSE; if(format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB && - format_desc->colorspace != UTIL_FORMAT_COLORSPACE_SRGB && format_desc->colorspace != UTIL_FORMAT_COLORSPACE_ZS) return FALSE; -- cgit v1.2.3 From 5bc62895e294ea461e8487bac1aa84c6cc4f6809 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 10:56:10 -0700 Subject: st/mesa: code clean-ups in st_renderbuffer_alloc_storage() --- src/mesa/state_tracker/st_cb_fbo.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index bfa8e21095..906eccdc09 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -83,14 +83,14 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, GLenum internalFormat, GLuint width, GLuint height) { - struct pipe_context *pipe = ctx->st->pipe; + struct pipe_screen *screen = ctx->st->pipe->screen; struct st_renderbuffer *strb = st_renderbuffer(rb); enum pipe_format format; if (strb->format != PIPE_FORMAT_NONE) format = strb->format; else - format = st_choose_renderbuffer_format(pipe->screen, internalFormat); + format = st_choose_renderbuffer_format(screen, internalFormat); /* init renderbuffer fields */ strb->Base.Width = width; @@ -149,16 +149,15 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, PIPE_BUFFER_USAGE_CPU_WRITE); #endif - strb->texture = pipe->screen->texture_create( pipe->screen, - &template ); + strb->texture = screen->texture_create(screen, &template); if (!strb->texture) return FALSE; - strb->surface = pipe->screen->get_tex_surface( pipe->screen, - strb->texture, - 0, 0, 0, - surface_usage ); + strb->surface = screen->get_tex_surface(screen, + strb->texture, + 0, 0, 0, + surface_usage); if (strb->surface) { assert(strb->surface->texture); assert(strb->surface->format); -- cgit v1.2.3 From 5d8aae55f29fe35ec3d514b54b05b6c6fc8bebe2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:03:58 -0700 Subject: st/mesa: use util_format_get_blocksize() --- src/mesa/state_tracker/st_cb_drawpixels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index e9aee6b205..ba28a224e8 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -319,7 +319,7 @@ make_texture(struct st_context *st, pipeFormat = st_mesa_format_to_pipe_format(mformat); assert(pipeFormat); - cpp = st_sizeof_format(pipeFormat); + cpp = util_format_get_blocksize(pipeFormat); pixels = _mesa_map_pbo_source(ctx, unpack, pixels); if (!pixels) -- cgit v1.2.3 From 87c85347ed8f74a855532fe6862d3ef62937ccbb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:10:47 -0700 Subject: st/mesa: clean-up of format-related code --- src/mesa/state_tracker/st_cb_fbo.c | 9 +++--- src/mesa/state_tracker/st_format.c | 60 ++------------------------------------ src/mesa/state_tracker/st_format.h | 21 ++++--------- 3 files changed, 13 insertions(+), 77 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 906eccdc09..0898866a73 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -57,11 +57,11 @@ /** * Compute the renderbuffer's Red/Green/EtcBit fields from the pipe format. */ -static int +static void init_renderbuffer_bits(struct st_renderbuffer *strb, enum pipe_format pipeFormat) { - struct pipe_format_info info; + struct st_format_info info; if (!st_get_format_info( pipeFormat, &info )) { assert( 0 ); @@ -69,10 +69,9 @@ init_renderbuffer_bits(struct st_renderbuffer *strb, strb->Base.Format = info.mesa_format; strb->Base.DataType = st_format_datatype(pipeFormat); - - return info.size; } + /** * gl_renderbuffer::AllocStorage() * This is called to allocate the original drawing surface, and @@ -99,7 +98,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, strb->defined = GL_FALSE; /* undefined contents now */ - if(strb->software) { + if (strb->software) { size_t size; free(strb->data); diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 3100a4edaa..8789d4b750 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -59,23 +59,12 @@ format_max_bits(enum pipe_format format) return size; } -static GLuint -format_size(enum pipe_format format) -{ - return - util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0) + - util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 1) + - util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 2) + - util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 3) + - util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 0) + - util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 1); -} /* * XXX temporary here */ GLboolean -st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) +st_get_format_info(enum pipe_format format, struct st_format_info *pinfo) { const struct util_format_description *desc; @@ -118,43 +107,15 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) } } - /* Component bits */ - pinfo->red_bits = util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0); - pinfo->green_bits = util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 1); - pinfo->blue_bits = util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 2); - pinfo->alpha_bits = util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 3); - pinfo->depth_bits = util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 0); - pinfo->stencil_bits = util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 1); - pinfo->luminance_bits = 0; - pinfo->intensity_bits = 0; - - /* Format size */ - pinfo->size = format_size(format) / 8; - - /* Luminance & Intensity bits */ - if (desc->swizzle[0] == UTIL_FORMAT_SWIZZLE_X && - desc->swizzle[1] == UTIL_FORMAT_SWIZZLE_X && - desc->swizzle[2] == UTIL_FORMAT_SWIZZLE_X) { - if (desc->swizzle[3] == UTIL_FORMAT_SWIZZLE_X) { - pinfo->intensity_bits = pinfo->red_bits; - } - else { - pinfo->luminance_bits = pinfo->red_bits; - } - pinfo->red_bits = 0; - } - pinfo->mesa_format = st_pipe_format_to_mesa_format(format); } else if (format == PIPE_FORMAT_YCBCR) { pinfo->mesa_format = MESA_FORMAT_YCBCR; pinfo->datatype = GL_UNSIGNED_SHORT; - pinfo->size = 2; /* two bytes per "texel" */ } else if (format == PIPE_FORMAT_YCBCR_REV) { pinfo->mesa_format = MESA_FORMAT_YCBCR_REV; pinfo->datatype = GL_UNSIGNED_SHORT; - pinfo->size = 2; /* two bytes per "texel" */ } else { /* compressed format? */ @@ -179,27 +140,12 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) /** - * Return bytes per pixel for the given format. - */ -GLuint -st_sizeof_format(enum pipe_format format) -{ - struct pipe_format_info info; - if (!st_get_format_info( format, &info )) { - assert( 0 ); - return 0; - } - return info.size; -} - - -/** - * Return bytes per pixel for the given format. + * Return basic GL datatype for the given format. */ GLenum st_format_datatype(enum pipe_format format) { - struct pipe_format_info info; + struct st_format_info info; if (!st_get_format_info( format, &info )) { assert( 0 ); return 0; diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 7cddf5aa66..721c6aeb3d 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -31,29 +31,20 @@ #include "main/formats.h" -struct pipe_format_info + +/** + * Information for mapping Mesa formats to Gallium formats. + */ +struct st_format_info { enum pipe_format format; gl_format mesa_format; GLenum datatype; - GLubyte red_bits; - GLubyte green_bits; - GLubyte blue_bits; - GLubyte alpha_bits; - GLubyte luminance_bits; - GLubyte intensity_bits; - GLubyte depth_bits; - GLubyte stencil_bits; - GLubyte size; /**< in bytes */ }; GLboolean -st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo); - - -extern GLuint -st_sizeof_format(enum pipe_format format); +st_get_format_info(enum pipe_format format, struct st_format_info *pinfo); extern GLenum -- cgit v1.2.3 From d7de632de39888dbc955055ba0eb3623e5335992 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:17:41 -0700 Subject: st/mesa: clean-ups in FBO code --- src/mesa/state_tracker/st_cb_fbo.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 0898866a73..ea040bdc4f 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -54,24 +54,6 @@ #include "util/u_inlines.h" -/** - * Compute the renderbuffer's Red/Green/EtcBit fields from the pipe format. - */ -static void -init_renderbuffer_bits(struct st_renderbuffer *strb, - enum pipe_format pipeFormat) -{ - struct st_format_info info; - - if (!st_get_format_info( pipeFormat, &info )) { - assert( 0 ); - } - - strb->Base.Format = info.mesa_format; - strb->Base.DataType = st_format_datatype(pipeFormat); -} - - /** * gl_renderbuffer::AllocStorage() * This is called to allocate the original drawing surface, and @@ -94,7 +76,8 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, /* init renderbuffer fields */ strb->Base.Width = width; strb->Base.Height = height; - init_renderbuffer_bits(strb, format); + strb->Base.Format = st_pipe_format_to_mesa_format(format); + strb->Base.DataType = st_format_datatype(format); strb->defined = GL_FALSE; /* undefined contents now */ @@ -249,8 +232,9 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) _mesa_init_renderbuffer(&strb->Base, 0); strb->Base.ClassID = 0x4242; /* just a unique value */ strb->Base.NumSamples = samples; + strb->Base.Format = st_pipe_format_to_mesa_format(format); + strb->Base.DataType = st_format_datatype(format); strb->format = format; - init_renderbuffer_bits(strb, format); strb->software = sw; switch (format) { @@ -395,7 +379,8 @@ st_render_texture(GLcontext *ctx, PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE); - init_renderbuffer_bits(strb, pt->format); + strb->Base.Format = st_pipe_format_to_mesa_format(pt->format); + strb->Base.DataType = st_format_datatype(pt->format); /* printf("RENDER TO TEXTURE obj=%p pt=%p surf=%p %d x %d\n", -- cgit v1.2.3 From 7802ef6f6978c68e732ed419e88d9af9f131b380 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:23:58 -0700 Subject: st/mesa: more format code clean-up and removal --- src/mesa/state_tracker/st_format.c | 71 ++++++++++---------------------------- src/mesa/state_tracker/st_format.h | 15 -------- 2 files changed, 18 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 8789d4b750..c414c7da61 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -60,11 +60,11 @@ format_max_bits(enum pipe_format format) } -/* - * XXX temporary here +/** + * Return basic GL datatype for the given gallium format. */ -GLboolean -st_get_format_info(enum pipe_format format, struct st_format_info *pinfo) +GLenum +st_format_datatype(enum pipe_format format) { const struct util_format_description *desc; @@ -72,85 +72,50 @@ st_get_format_info(enum pipe_format format, struct st_format_info *pinfo) assert(desc); if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) { -#if 0 - printf("%s\n", util_format_name( format ) ); -#endif - - /* Data type */ - if (format == PIPE_FORMAT_A1R5G5B5_UNORM || format == PIPE_FORMAT_R5G6B5_UNORM) { - pinfo->datatype = GL_UNSIGNED_SHORT; + if (format == PIPE_FORMAT_A1R5G5B5_UNORM || + format == PIPE_FORMAT_R5G6B5_UNORM) { + return GL_UNSIGNED_SHORT; } else if (format == PIPE_FORMAT_S8Z24_UNORM || format == PIPE_FORMAT_Z24S8_UNORM) { - pinfo->datatype = GL_UNSIGNED_INT_24_8; + return GL_UNSIGNED_INT_24_8; } else { const GLuint size = format_max_bits(format); if (size == 8) { if (desc->channel[0].type == UTIL_FORMAT_TYPE_UNSIGNED) - pinfo->datatype = GL_UNSIGNED_BYTE; + return GL_UNSIGNED_BYTE; else - pinfo->datatype = GL_BYTE; + return GL_BYTE; } else if (size == 16) { if (desc->channel[0].type == UTIL_FORMAT_TYPE_UNSIGNED) - pinfo->datatype = GL_UNSIGNED_SHORT; + return GL_UNSIGNED_SHORT; else - pinfo->datatype = GL_SHORT; + return GL_SHORT; } else { assert( size <= 32 ); if (desc->channel[0].type == UTIL_FORMAT_TYPE_UNSIGNED) - pinfo->datatype = GL_UNSIGNED_INT; + return GL_UNSIGNED_INT; else - pinfo->datatype = GL_INT; + return GL_INT; } } - - pinfo->mesa_format = st_pipe_format_to_mesa_format(format); } else if (format == PIPE_FORMAT_YCBCR) { - pinfo->mesa_format = MESA_FORMAT_YCBCR; - pinfo->datatype = GL_UNSIGNED_SHORT; + return GL_UNSIGNED_SHORT; } else if (format == PIPE_FORMAT_YCBCR_REV) { - pinfo->mesa_format = MESA_FORMAT_YCBCR_REV; - pinfo->datatype = GL_UNSIGNED_SHORT; + return GL_UNSIGNED_SHORT; } else { /* compressed format? */ assert(0); } -#if 0 - printf( - "ST_FORMAT: R(%u), G(%u), B(%u), A(%u), Z(%u), S(%u)\n", - pinfo->red_bits, - pinfo->green_bits, - pinfo->blue_bits, - pinfo->alpha_bits, - pinfo->depth_bits, - pinfo->stencil_bits ); -#endif - - pinfo->format = format; - - return GL_TRUE; -} - - -/** - * Return basic GL datatype for the given format. - */ -GLenum -st_format_datatype(enum pipe_format format) -{ - struct st_format_info info; - if (!st_get_format_info( format, &info )) { - assert( 0 ); - return 0; - } - return info.datatype; + assert(0); + return GL_NONE; } diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 721c6aeb3d..6cc5a15b1d 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -32,21 +32,6 @@ #include "main/formats.h" -/** - * Information for mapping Mesa formats to Gallium formats. - */ -struct st_format_info -{ - enum pipe_format format; - gl_format mesa_format; - GLenum datatype; -}; - - -GLboolean -st_get_format_info(enum pipe_format format, struct st_format_info *pinfo); - - extern GLenum st_format_datatype(enum pipe_format format); -- cgit v1.2.3 From 002f9142113149cd2db8e5a6016fb5f7795ce55e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:31:33 -0700 Subject: st/mesa: consolidate redundant format conversion code --- src/mesa/state_tracker/st_format.c | 107 ++++++++----------------------------- 1 file changed, 21 insertions(+), 86 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index c414c7da61..a14d9cc3a2 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -119,6 +119,9 @@ st_format_datatype(enum pipe_format format) } +/** + * Translate Mesa format to Gallium format. + */ enum pipe_format st_mesa_format_to_pipe_format(gl_format mesaFormat) { @@ -192,10 +195,13 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) } +/** + * Translate Gallium format to Mesa format. + */ gl_format -st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) +st_pipe_format_to_mesa_format(enum pipe_format format) { - switch (pipeFormat) { + switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: return MESA_FORMAT_ARGB8888; case PIPE_FORMAT_X8R8G8B8_UNORM: @@ -218,25 +224,29 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) return MESA_FORMAT_L8; case PIPE_FORMAT_I8_UNORM: return MESA_FORMAT_I8; + case PIPE_FORMAT_S8_UNORM: + return MESA_FORMAT_S8; + + case PIPE_FORMAT_R16G16B16A16_SNORM: + return MESA_FORMAT_SIGNED_RGBA_16; + case PIPE_FORMAT_Z16_UNORM: return MESA_FORMAT_Z16; case PIPE_FORMAT_Z32_UNORM: return MESA_FORMAT_Z32; - case PIPE_FORMAT_Z24X8_UNORM: - return MESA_FORMAT_Z24_X8; case PIPE_FORMAT_Z24S8_UNORM: return MESA_FORMAT_Z24_S8; + case PIPE_FORMAT_Z24X8_UNORM: + return MESA_FORMAT_Z24_X8; case PIPE_FORMAT_X8Z24_UNORM: return MESA_FORMAT_X8_Z24; case PIPE_FORMAT_S8Z24_UNORM: return MESA_FORMAT_S8_Z24; - case PIPE_FORMAT_S8_UNORM: - return MESA_FORMAT_S8; case PIPE_FORMAT_YCBCR: return MESA_FORMAT_YCBCR; - case PIPE_FORMAT_R16G16B16A16_SNORM: - return MESA_FORMAT_SIGNED_RGBA_16; + case PIPE_FORMAT_YCBCR_REV: + return MESA_FORMAT_YCBCR_REV; #if FEATURE_texture_s3tc case PIPE_FORMAT_DXT1_RGB: @@ -258,6 +268,7 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) return MESA_FORMAT_SRGBA_DXT5; #endif #endif + #if FEATURE_EXT_texture_sRGB case PIPE_FORMAT_A8L8_SRGB: return MESA_FORMAT_SLA8; @@ -272,7 +283,7 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) #endif default: assert(0); - return 0; + return MESA_FORMAT_NONE; } } @@ -641,82 +652,6 @@ st_choose_renderbuffer_format(struct pipe_screen *screen, } -static gl_format -translate_gallium_format_to_mesa_format(enum pipe_format format) -{ - switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - return MESA_FORMAT_ARGB8888; - case PIPE_FORMAT_X8R8G8B8_UNORM: - return MESA_FORMAT_XRGB8888; - case PIPE_FORMAT_A1R5G5B5_UNORM: - return MESA_FORMAT_ARGB1555; - case PIPE_FORMAT_A4R4G4B4_UNORM: - return MESA_FORMAT_ARGB4444; - case PIPE_FORMAT_R5G6B5_UNORM: - return MESA_FORMAT_RGB565; - case PIPE_FORMAT_A8L8_UNORM: - return MESA_FORMAT_AL88; - case PIPE_FORMAT_A8_UNORM: - return MESA_FORMAT_A8; - case PIPE_FORMAT_L8_UNORM: - return MESA_FORMAT_L8; - case PIPE_FORMAT_I8_UNORM: - return MESA_FORMAT_I8; - case PIPE_FORMAT_Z16_UNORM: - return MESA_FORMAT_Z16; - case PIPE_FORMAT_Z32_UNORM: - return MESA_FORMAT_Z32; - case PIPE_FORMAT_Z24S8_UNORM: - return MESA_FORMAT_Z24_S8; - case PIPE_FORMAT_X8Z24_UNORM: - return MESA_FORMAT_X8_Z24; - case PIPE_FORMAT_S8Z24_UNORM: - return MESA_FORMAT_S8_Z24; - case PIPE_FORMAT_YCBCR: - return MESA_FORMAT_YCBCR; - case PIPE_FORMAT_YCBCR_REV: - return MESA_FORMAT_YCBCR_REV; -#if FEATURE_texture_s3tc - case PIPE_FORMAT_DXT1_RGB: - return MESA_FORMAT_RGB_DXT1; - case PIPE_FORMAT_DXT1_RGBA: - return MESA_FORMAT_RGBA_DXT1; - case PIPE_FORMAT_DXT3_RGBA: - return MESA_FORMAT_RGBA_DXT3; - case PIPE_FORMAT_DXT5_RGBA: - return MESA_FORMAT_RGBA_DXT5; -#if FEATURE_EXT_texture_sRGB - case PIPE_FORMAT_DXT1_SRGB: - return MESA_FORMAT_SRGB_DXT1; - case PIPE_FORMAT_DXT1_SRGBA: - return MESA_FORMAT_SRGBA_DXT1; - case PIPE_FORMAT_DXT3_SRGBA: - return MESA_FORMAT_SRGBA_DXT3; - case PIPE_FORMAT_DXT5_SRGBA: - return MESA_FORMAT_SRGBA_DXT5; -#endif -#endif -#if FEATURE_EXT_texture_sRGB - case PIPE_FORMAT_A8L8_SRGB: - return MESA_FORMAT_SLA8; - case PIPE_FORMAT_L8_SRGB: - return MESA_FORMAT_SL8; - case PIPE_FORMAT_R8G8B8_SRGB: - return MESA_FORMAT_SRGB8; - case PIPE_FORMAT_R8G8B8A8_SRGB: - return MESA_FORMAT_SRGBA8; - case PIPE_FORMAT_A8R8G8B8_SRGB: - return MESA_FORMAT_SARGB8; -#endif - /* XXX add additional cases */ - default: - assert(0); - return MESA_FORMAT_NONE; - } -} - - /** * Called via ctx->Driver.chooseTextureFormat(). */ @@ -734,7 +669,7 @@ st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat, if (pFormat == PIPE_FORMAT_NONE) return MESA_FORMAT_NONE; - return translate_gallium_format_to_mesa_format(pFormat); + return st_pipe_format_to_mesa_format(pFormat); } -- cgit v1.2.3 From 517faa4f3720134a19e1834144c75cf58a68c9c8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:33:54 -0700 Subject: st/mesa: updated comments --- src/mesa/state_tracker/st_format.c | 4 ++-- src/mesa/state_tracker/st_format.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index a14d9cc3a2..c8f9ac3038 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -1,7 +1,7 @@ /************************************************************************** * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * Copyright (c) 2008 VMware, Inc. + * Copyright (c) 2008-2010 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -28,7 +28,7 @@ /** - * Texture Image-related functions. + * Mesa / Gallium format conversion and format selection code. * \author Brian Paul */ diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 6cc5a15b1d..a6cf7025a9 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -1,6 +1,7 @@ /************************************************************************** * * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright (c) 2010 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -61,4 +62,4 @@ extern GLboolean st_equal_formats(enum pipe_format pFormat, GLenum format, GLenum type); -#endif /* ST_CB_TEXIMAGE_H */ +#endif /* ST_FORMAT_H */ -- cgit v1.2.3 From caa46f753835f8bb87fc16e22734f27a1d52bb27 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 11 Feb 2010 17:36:59 -0500 Subject: glapi: Add GL_OES_EGL_image --- include/GL/gl.h | 15 +++++++++++++++ src/mesa/glapi/gen/Makefile | 3 ++- src/mesa/glapi/gen/OES_EGL_image.xml | 20 ++++++++++++++++++++ src/mesa/glapi/gen/gl_API.xml | 2 ++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/mesa/glapi/gen/OES_EGL_image.xml (limited to 'src') diff --git a/include/GL/gl.h b/include/GL/gl.h index 36153b159b..3fce3dfc0a 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -2196,6 +2196,21 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen #endif /* GL_ATI_blend_equation_separate */ +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +typedef void* GLeglImageOES; +#endif + +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + /** ** NOTE!!!!! If you add new functions to this file, or update diff --git a/src/mesa/glapi/gen/Makefile b/src/mesa/glapi/gen/Makefile index 6b6b9aecaa..4984da8581 100644 --- a/src/mesa/glapi/gen/Makefile +++ b/src/mesa/glapi/gen/Makefile @@ -87,7 +87,8 @@ API_XML = \ EXT_packed_depth_stencil.xml \ EXT_provoking_vertex.xml \ EXT_texture_array.xml \ - NV_conditional_render.xml + NV_conditional_render.xml \ + OES_EGL_image.xml COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py diff --git a/src/mesa/glapi/gen/OES_EGL_image.xml b/src/mesa/glapi/gen/OES_EGL_image.xml new file mode 100644 index 0000000000..1cb43d49a4 --- /dev/null +++ b/src/mesa/glapi/gen/OES_EGL_image.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/gl_API.xml b/src/mesa/glapi/gen/gl_API.xml index fbf8b0c3e4..0b3d57baa6 100644 --- a/src/mesa/glapi/gen/gl_API.xml +++ b/src/mesa/glapi/gen/gl_API.xml @@ -12502,4 +12502,6 @@ + + -- cgit v1.2.3 From 07b07b4d723394c82f7ba915c1cba620b307013d Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 11 Feb 2010 17:37:50 -0500 Subject: glapi: GL_OES_EGL_image autogenerated files --- src/glx/indirect.c | 3 +- src/mesa/glapi/glapidispatch.h | 16 +- src/mesa/glapi/glapioffsets.h | 6 +- src/mesa/glapi/glapitable.h | 2 + src/mesa/glapi/glapitemp.h | 12 + src/mesa/glapi/glprocs.h | 608 +++++------ src/mesa/main/remap_helper.h | 2317 ++++++++++++++++++++-------------------- src/mesa/sparc/glapi_sparc.S | 2 + src/mesa/x86-64/glapi_x86-64.S | 74 ++ src/mesa/x86/glapi_x86.S | 2 + 10 files changed, 1586 insertions(+), 1456 deletions(-) (limited to 'src') diff --git a/src/glx/indirect.c b/src/glx/indirect.c index 48bae1478f..262637a947 100644 --- a/src/glx/indirect.c +++ b/src/glx/indirect.c @@ -30,8 +30,7 @@ #include "indirect.h" #include "glxclient.h" #include "indirect_size.h" -#include "glapitable.h" -#include "glapidispatch.h" +#include "dispatch.h" #include "glapi.h" #include "glthread.h" #include diff --git a/src/mesa/glapi/glapidispatch.h b/src/mesa/glapi/glapidispatch.h index 51ae7feaf6..b7f661c535 100644 --- a/src/mesa/glapi/glapidispatch.h +++ b/src/mesa/glapi/glapidispatch.h @@ -2470,10 +2470,16 @@ #define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters #define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) #define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) +#define CALL_EGLImageTargetRenderbufferStorageOES(disp, parameters) (*((disp)->EGLImageTargetRenderbufferStorageOES)) parameters +#define GET_EGLImageTargetRenderbufferStorageOES(disp) ((disp)->EGLImageTargetRenderbufferStorageOES) +#define SET_EGLImageTargetRenderbufferStorageOES(disp, fn) ((disp)->EGLImageTargetRenderbufferStorageOES = fn) +#define CALL_EGLImageTargetTexture2DOES(disp, parameters) (*((disp)->EGLImageTargetTexture2DOES)) parameters +#define GET_EGLImageTargetTexture2DOES(disp) ((disp)->EGLImageTargetTexture2DOES) +#define SET_EGLImageTargetTexture2DOES(disp, fn) ((disp)->EGLImageTargetTexture2DOES = fn) #else -#define driDispatchRemapTable_size 395 +#define driDispatchRemapTable_size 397 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define AttachShader_remap_index 0 @@ -2871,6 +2877,8 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define ProgramLocalParameters4fvEXT_remap_index 392 #define GetQueryObjecti64vEXT_remap_index 393 #define GetQueryObjectui64vEXT_remap_index 394 +#define EGLImageTargetRenderbufferStorageOES_remap_index 395 +#define EGLImageTargetTexture2DOES_remap_index 396 #define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) #define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) @@ -4057,6 +4065,12 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) #define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) #define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) +#define CALL_EGLImageTargetRenderbufferStorageOES(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLvoid *)), driDispatchRemapTable[EGLImageTargetRenderbufferStorageOES_remap_index], parameters) +#define GET_EGLImageTargetRenderbufferStorageOES(disp) GET_by_offset(disp, driDispatchRemapTable[EGLImageTargetRenderbufferStorageOES_remap_index]) +#define SET_EGLImageTargetRenderbufferStorageOES(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EGLImageTargetRenderbufferStorageOES_remap_index], fn) +#define CALL_EGLImageTargetTexture2DOES(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLvoid *)), driDispatchRemapTable[EGLImageTargetTexture2DOES_remap_index], parameters) +#define GET_EGLImageTargetTexture2DOES(disp) GET_by_offset(disp, driDispatchRemapTable[EGLImageTargetTexture2DOES_remap_index]) +#define SET_EGLImageTargetTexture2DOES(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EGLImageTargetTexture2DOES_remap_index], fn) #endif /* !defined(_GLAPI_USE_REMAP_TABLE) */ diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index c5d367f6f2..8e16e22983 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -837,7 +837,9 @@ #define _gloffset_ProgramLocalParameters4fvEXT 800 #define _gloffset_GetQueryObjecti64vEXT 801 #define _gloffset_GetQueryObjectui64vEXT 802 -#define _gloffset_FIRST_DYNAMIC 803 +#define _gloffset_EGLImageTargetRenderbufferStorageOES 803 +#define _gloffset_EGLImageTargetTexture2DOES 804 +#define _gloffset_FIRST_DYNAMIC 805 #else @@ -1236,6 +1238,8 @@ #define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index] #define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] #define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] +#define _gloffset_EGLImageTargetRenderbufferStorageOES driDispatchRemapTable[EGLImageTargetRenderbufferStorageOES_remap_index] +#define _gloffset_EGLImageTargetTexture2DOES driDispatchRemapTable[EGLImageTargetTexture2DOES_remap_index] #endif /* !defined(_GLAPI_USE_REMAP_TABLE) */ diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 0c5b46d04b..8aeb450b99 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -843,6 +843,8 @@ struct _glapi_table void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 800 */ void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 801 */ void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 802 */ + void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 803 */ + void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 804 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 2540ef6465..2ef4728e09 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -5612,6 +5612,16 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLuint id, GLenum pname, GLu DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } +KEYWORD1 void KEYWORD2 NAME(EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset) +{ + DISPATCH(EGLImageTargetRenderbufferStorageOES, (target, writeOffset), (F, "glEGLImageTargetRenderbufferStorageOES(0x%x, %p);\n", target, (const void *) writeOffset)); +} + +KEYWORD1 void KEYWORD2 NAME(EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset) +{ + DISPATCH(EGLImageTargetTexture2DOES, (target, writeOffset), (F, "glEGLImageTargetTexture2DOES(0x%x, %p);\n", target, (const void *) writeOffset)); +} + #endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */ @@ -6568,6 +6578,8 @@ _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(_dispatch_stub_800), TABLE_ENTRY(_dispatch_stub_801), TABLE_ENTRY(_dispatch_stub_802), + TABLE_ENTRY(EGLImageTargetRenderbufferStorageOES), + TABLE_ENTRY(EGLImageTargetTexture2DOES), /* A whole bunch of no-op functions. These might be called * when someone tries to call a dynamically-registered * extension function without a current rendering context. diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index b590a7c41d..513fa89726 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -855,6 +855,8 @@ static const char gl_string_table[] = "glProgramLocalParameters4fvEXT\0" "glGetQueryObjecti64vEXT\0" "glGetQueryObjectui64vEXT\0" + "glEGLImageTargetRenderbufferStorageOES\0" + "glEGLImageTargetTexture2DOES\0" "glArrayElementEXT\0" "glBindTextureEXT\0" "glDrawArraysEXT\0" @@ -2071,308 +2073,310 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET(14176, gl_dispatch_stub_800, gl_dispatch_stub_800, NULL, _gloffset_ProgramLocalParameters4fvEXT), NAME_FUNC_OFFSET(14207, gl_dispatch_stub_801, gl_dispatch_stub_801, NULL, _gloffset_GetQueryObjecti64vEXT), NAME_FUNC_OFFSET(14231, gl_dispatch_stub_802, gl_dispatch_stub_802, NULL, _gloffset_GetQueryObjectui64vEXT), - NAME_FUNC_OFFSET(14256, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET(14274, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET(14291, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET(14307, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET(14332, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET(14352, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET(14372, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET(14395, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET(14418, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET(14438, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), - NAME_FUNC_OFFSET(14455, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET(14472, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), - NAME_FUNC_OFFSET(14487, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET(14511, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET(14530, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET(14549, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET(14565, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET(14584, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET(14607, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14623, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14639, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET(14666, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET(14693, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET(14713, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14732, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14751, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14781, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14811, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14841, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14871, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET(14890, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET(14913, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET(14938, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET(14963, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET(14990, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET(15018, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET(15045, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET(15073, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET(15102, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET(15131, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET(15157, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET(15188, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET(15219, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET(15243, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET(15266, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), - NAME_FUNC_OFFSET(15284, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET(15313, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET(15342, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), - NAME_FUNC_OFFSET(15357, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET(15383, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET(15409, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET(15424, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET(15436, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET(15456, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET(15473, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET(15489, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET(15508, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET(15531, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET(15547, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET(15569, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET(15587, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET(15606, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET(15624, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET(15643, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET(15661, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET(15680, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET(15698, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET(15717, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET(15735, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET(15754, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET(15772, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET(15791, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET(15809, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET(15828, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET(15846, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET(15865, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET(15883, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET(15902, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET(15920, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET(15939, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET(15957, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET(15976, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET(15994, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET(16013, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET(16031, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET(16050, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET(16068, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET(16087, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET(16105, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET(16124, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET(16142, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET(16161, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), - NAME_FUNC_OFFSET(16184, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET(16207, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET(16230, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET(16253, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET(16276, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET(16293, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET(16316, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET(16339, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET(16362, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET(16388, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET(16414, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET(16440, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET(16464, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16491, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16517, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET(16537, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET(16557, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET(16577, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), - NAME_FUNC_OFFSET(16600, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), - NAME_FUNC_OFFSET(16624, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), - NAME_FUNC_OFFSET(16647, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), - NAME_FUNC_OFFSET(16671, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET(16688, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET(16706, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET(16723, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET(16741, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET(16758, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET(16776, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET(16793, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET(16811, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET(16828, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET(16846, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET(16863, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET(16881, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET(16898, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET(16916, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET(16933, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET(16951, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET(16968, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET(16986, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET(17005, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET(17024, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET(17043, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET(17062, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET(17082, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET(17102, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(17122, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), - NAME_FUNC_OFFSET(17140, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(17157, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(17175, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(17192, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(17210, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), - NAME_FUNC_OFFSET(17228, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(17245, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(17263, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), - NAME_FUNC_OFFSET(17282, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), - NAME_FUNC_OFFSET(17301, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), - NAME_FUNC_OFFSET(17320, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(17342, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(17355, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(17368, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(17384, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(17400, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(17413, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(17436, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(17456, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(17475, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(17486, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(17498, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(17512, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(17525, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(17541, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(17552, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(17565, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(17584, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(17604, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(17617, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(17627, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(17643, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(17662, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(17680, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(17701, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(17716, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(17731, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(17745, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(17760, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(17772, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(17785, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(17797, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(17810, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(17822, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(17835, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(17847, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(17860, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(17872, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(17885, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17897, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17910, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17922, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(17935, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(17947, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(17960, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(17979, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(17998, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(18017, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(18030, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(18048, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(18069, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(18087, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(18107, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(18121, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(18138, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample), - NAME_FUNC_OFFSET(18174, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(18190, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(18209, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18227, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18248, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18270, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18289, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18311, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18334, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(18353, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(18373, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(18392, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(18412, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(18431, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(18451, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(18470, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(18490, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(18509, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(18529, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(18549, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(18570, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(18590, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(18611, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(18631, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(18652, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(18676, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(18694, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(18714, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(18732, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(18744, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(18757, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(18769, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(18782, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18802, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18826, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18840, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18857, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18872, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18890, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18904, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18921, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18936, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18954, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18968, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18985, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(19000, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(19018, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(19032, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(19049, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(19064, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(19082, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(19096, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(19113, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(19128, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(19146, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(19160, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(19177, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(19192, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(19210, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(19224, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(19241, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(19256, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(19274, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19288, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19305, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19320, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19338, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(19355, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(19375, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(19392, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19418, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19447, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(19462, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(19480, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(19499, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(19520, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(19536, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19560, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19587, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(19605, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(19624, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(19649, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(19670, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(19692, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(19718, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(19741, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(19764, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(19787, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(19805, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(19824, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(19841, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(19879, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(19908, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(19924, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(19941, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(19963, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(19981, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), - NAME_FUNC_OFFSET(20007, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), + NAME_FUNC_OFFSET(14256, glEGLImageTargetRenderbufferStorageOES, glEGLImageTargetRenderbufferStorageOES, NULL, _gloffset_EGLImageTargetRenderbufferStorageOES), + NAME_FUNC_OFFSET(14295, glEGLImageTargetTexture2DOES, glEGLImageTargetTexture2DOES, NULL, _gloffset_EGLImageTargetTexture2DOES), + NAME_FUNC_OFFSET(14324, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET(14342, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET(14359, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET(14375, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET(14400, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET(14420, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET(14440, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET(14463, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET(14486, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET(14506, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), + NAME_FUNC_OFFSET(14523, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET(14540, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), + NAME_FUNC_OFFSET(14555, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET(14579, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET(14598, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET(14617, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET(14633, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET(14652, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET(14675, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14691, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14707, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET(14734, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET(14761, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET(14781, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14800, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14819, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14849, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14879, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14909, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14939, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET(14958, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET(14981, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET(15006, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET(15031, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET(15058, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET(15086, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET(15113, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET(15141, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET(15170, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET(15199, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET(15225, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET(15256, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET(15287, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET(15311, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET(15334, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), + NAME_FUNC_OFFSET(15352, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET(15381, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET(15410, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), + NAME_FUNC_OFFSET(15425, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET(15451, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET(15477, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET(15492, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET(15504, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET(15524, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET(15541, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET(15557, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET(15576, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET(15599, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET(15615, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET(15637, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET(15655, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET(15674, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET(15692, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET(15711, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET(15729, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET(15748, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET(15766, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET(15785, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET(15803, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET(15822, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET(15840, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET(15859, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET(15877, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET(15896, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET(15914, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET(15933, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET(15951, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET(15970, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET(15988, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET(16007, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET(16025, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET(16044, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET(16062, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET(16081, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET(16099, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET(16118, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET(16136, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET(16155, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET(16173, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET(16192, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET(16210, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET(16229, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), + NAME_FUNC_OFFSET(16252, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET(16275, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET(16298, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET(16321, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET(16344, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET(16361, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET(16384, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET(16407, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET(16430, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET(16456, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET(16482, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET(16508, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET(16532, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16559, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16585, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET(16605, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET(16625, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET(16645, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), + NAME_FUNC_OFFSET(16668, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), + NAME_FUNC_OFFSET(16692, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), + NAME_FUNC_OFFSET(16715, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), + NAME_FUNC_OFFSET(16739, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET(16756, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET(16774, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET(16791, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET(16809, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET(16826, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET(16844, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET(16861, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET(16879, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET(16896, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET(16914, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET(16931, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET(16949, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET(16966, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET(16984, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET(17001, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET(17019, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET(17036, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET(17054, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET(17073, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET(17092, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET(17111, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET(17130, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET(17150, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET(17170, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET(17190, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), + NAME_FUNC_OFFSET(17208, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(17225, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(17243, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(17260, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(17278, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), + NAME_FUNC_OFFSET(17296, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(17313, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(17331, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), + NAME_FUNC_OFFSET(17350, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), + NAME_FUNC_OFFSET(17369, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), + NAME_FUNC_OFFSET(17388, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(17410, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(17423, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(17436, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(17452, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(17468, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(17481, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(17504, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(17524, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(17543, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(17554, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(17566, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(17580, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(17593, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(17609, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(17620, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(17633, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(17652, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(17672, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(17685, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(17695, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(17711, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(17730, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(17748, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(17769, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(17784, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(17799, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(17813, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(17828, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(17840, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(17853, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(17865, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(17878, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(17890, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(17903, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(17915, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(17928, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(17940, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(17953, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(17965, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(17978, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(17990, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(18003, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(18015, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(18028, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(18047, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(18066, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(18085, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(18098, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(18116, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(18137, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(18155, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(18175, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(18189, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(18206, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample), + NAME_FUNC_OFFSET(18242, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(18258, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(18277, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18295, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18316, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18338, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18357, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18379, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18402, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(18421, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(18441, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(18460, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(18480, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(18499, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(18519, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(18538, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(18558, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(18577, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(18597, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(18617, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(18638, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(18658, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(18679, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(18699, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(18720, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(18744, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(18762, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(18782, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(18800, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(18812, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(18825, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(18837, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(18850, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18870, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18894, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18908, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18925, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18940, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18958, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18972, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18989, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(19004, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(19022, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(19036, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(19053, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(19068, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(19086, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(19100, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(19117, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(19132, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(19150, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(19164, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(19181, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(19196, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(19214, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(19228, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(19245, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19260, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19278, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19292, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19309, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19324, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19342, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19356, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19373, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19388, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19406, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(19423, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(19443, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(19460, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19486, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19515, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(19530, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(19548, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(19567, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(19588, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(19604, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19628, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19655, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(19673, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(19692, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(19717, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(19738, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(19760, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(19786, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(19809, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(19832, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(19855, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(19873, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(19892, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(19909, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(19947, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(19976, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(19992, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(20009, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(20031, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(20049, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(20075, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index fe2bebd96c..2c8f0de467 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -1587,2772 +1587,2780 @@ static const char _mesa_function_pool[] = "i\0" "glIndexi\0" "\0" - /* _mesa_function_pool[10753]: EndQueryARB (will be remapped) */ + /* _mesa_function_pool[10753]: EGLImageTargetTexture2DOES (will be remapped) */ + "ip\0" + "glEGLImageTargetTexture2DOES\0" + "\0" + /* _mesa_function_pool[10786]: EndQueryARB (will be remapped) */ "i\0" "glEndQuery\0" "glEndQueryARB\0" "\0" - /* _mesa_function_pool[10781]: DeleteFencesNV (will be remapped) */ + /* _mesa_function_pool[10814]: DeleteFencesNV (will be remapped) */ "ip\0" "glDeleteFencesNV\0" "\0" - /* _mesa_function_pool[10802]: DeformationMap3dSGIX (dynamic) */ + /* _mesa_function_pool[10835]: DeformationMap3dSGIX (dynamic) */ "iddiiddiiddiip\0" "glDeformationMap3dSGIX\0" "\0" - /* _mesa_function_pool[10841]: DepthMask (offset 211) */ + /* _mesa_function_pool[10874]: DepthMask (offset 211) */ "i\0" "glDepthMask\0" "\0" - /* _mesa_function_pool[10856]: IsShader (will be remapped) */ + /* _mesa_function_pool[10889]: IsShader (will be remapped) */ "i\0" "glIsShader\0" "\0" - /* _mesa_function_pool[10870]: Indexf (offset 46) */ + /* _mesa_function_pool[10903]: Indexf (offset 46) */ "f\0" "glIndexf\0" "\0" - /* _mesa_function_pool[10882]: GetImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[10915]: GetImageTransformParameterivHP (dynamic) */ "iip\0" "glGetImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[10920]: Indexd (offset 44) */ + /* _mesa_function_pool[10953]: Indexd (offset 44) */ "d\0" "glIndexd\0" "\0" - /* _mesa_function_pool[10932]: GetMaterialiv (offset 270) */ + /* _mesa_function_pool[10965]: GetMaterialiv (offset 270) */ "iip\0" "glGetMaterialiv\0" "\0" - /* _mesa_function_pool[10953]: StencilOp (offset 244) */ + /* _mesa_function_pool[10986]: StencilOp (offset 244) */ "iii\0" "glStencilOp\0" "\0" - /* _mesa_function_pool[10970]: WindowPos4ivMESA (will be remapped) */ + /* _mesa_function_pool[11003]: WindowPos4ivMESA (will be remapped) */ "p\0" "glWindowPos4ivMESA\0" "\0" - /* _mesa_function_pool[10992]: MultiTexCoord3svARB (offset 399) */ + /* _mesa_function_pool[11025]: MultiTexCoord3svARB (offset 399) */ "ip\0" "glMultiTexCoord3sv\0" "glMultiTexCoord3svARB\0" "\0" - /* _mesa_function_pool[11037]: TexEnvfv (offset 185) */ + /* _mesa_function_pool[11070]: TexEnvfv (offset 185) */ "iip\0" "glTexEnvfv\0" "\0" - /* _mesa_function_pool[11053]: MultiTexCoord4iARB (offset 404) */ + /* _mesa_function_pool[11086]: MultiTexCoord4iARB (offset 404) */ "iiiii\0" "glMultiTexCoord4i\0" "glMultiTexCoord4iARB\0" "\0" - /* _mesa_function_pool[11099]: Indexs (offset 50) */ + /* _mesa_function_pool[11132]: Indexs (offset 50) */ "i\0" "glIndexs\0" "\0" - /* _mesa_function_pool[11111]: Binormal3ivEXT (dynamic) */ + /* _mesa_function_pool[11144]: Binormal3ivEXT (dynamic) */ "p\0" "glBinormal3ivEXT\0" "\0" - /* _mesa_function_pool[11131]: ResizeBuffersMESA (will be remapped) */ + /* _mesa_function_pool[11164]: ResizeBuffersMESA (will be remapped) */ "\0" "glResizeBuffersMESA\0" "\0" - /* _mesa_function_pool[11153]: GetUniformivARB (will be remapped) */ + /* _mesa_function_pool[11186]: GetUniformivARB (will be remapped) */ "iip\0" "glGetUniformiv\0" "glGetUniformivARB\0" "\0" - /* _mesa_function_pool[11191]: PixelTexGenParameteriSGIS (will be remapped) */ + /* _mesa_function_pool[11224]: PixelTexGenParameteriSGIS (will be remapped) */ "ii\0" "glPixelTexGenParameteriSGIS\0" "\0" - /* _mesa_function_pool[11223]: VertexPointervINTEL (dynamic) */ + /* _mesa_function_pool[11256]: VertexPointervINTEL (dynamic) */ "iip\0" "glVertexPointervINTEL\0" "\0" - /* _mesa_function_pool[11250]: Vertex2i (offset 130) */ + /* _mesa_function_pool[11283]: Vertex2i (offset 130) */ "ii\0" "glVertex2i\0" "\0" - /* _mesa_function_pool[11265]: LoadMatrixf (offset 291) */ + /* _mesa_function_pool[11298]: LoadMatrixf (offset 291) */ "p\0" "glLoadMatrixf\0" "\0" - /* _mesa_function_pool[11282]: Vertex2f (offset 128) */ + /* _mesa_function_pool[11315]: Vertex2f (offset 128) */ "ff\0" "glVertex2f\0" "\0" - /* _mesa_function_pool[11297]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[11330]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[11350]: Color4bv (offset 26) */ + /* _mesa_function_pool[11383]: Color4bv (offset 26) */ "p\0" "glColor4bv\0" "\0" - /* _mesa_function_pool[11364]: VertexPointer (offset 321) */ + /* _mesa_function_pool[11397]: VertexPointer (offset 321) */ "iiip\0" "glVertexPointer\0" "\0" - /* _mesa_function_pool[11386]: SecondaryColor3uiEXT (will be remapped) */ + /* _mesa_function_pool[11419]: SecondaryColor3uiEXT (will be remapped) */ "iii\0" "glSecondaryColor3ui\0" "glSecondaryColor3uiEXT\0" "\0" - /* _mesa_function_pool[11434]: StartInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[11467]: StartInstrumentsSGIX (dynamic) */ "\0" "glStartInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[11459]: SecondaryColor3usvEXT (will be remapped) */ + /* _mesa_function_pool[11492]: SecondaryColor3usvEXT (will be remapped) */ "p\0" "glSecondaryColor3usv\0" "glSecondaryColor3usvEXT\0" "\0" - /* _mesa_function_pool[11507]: VertexAttrib2fvNV (will be remapped) */ + /* _mesa_function_pool[11540]: VertexAttrib2fvNV (will be remapped) */ "ip\0" "glVertexAttrib2fvNV\0" "\0" - /* _mesa_function_pool[11531]: ProgramLocalParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[11564]: ProgramLocalParameter4dvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4dvARB\0" "\0" - /* _mesa_function_pool[11566]: DeleteLists (offset 4) */ + /* _mesa_function_pool[11599]: DeleteLists (offset 4) */ "ii\0" "glDeleteLists\0" "\0" - /* _mesa_function_pool[11584]: LogicOp (offset 242) */ + /* _mesa_function_pool[11617]: LogicOp (offset 242) */ "i\0" "glLogicOp\0" "\0" - /* _mesa_function_pool[11597]: MatrixIndexuivARB (dynamic) */ + /* _mesa_function_pool[11630]: MatrixIndexuivARB (dynamic) */ "ip\0" "glMatrixIndexuivARB\0" "\0" - /* _mesa_function_pool[11621]: Vertex2s (offset 132) */ + /* _mesa_function_pool[11654]: Vertex2s (offset 132) */ "ii\0" "glVertex2s\0" "\0" - /* _mesa_function_pool[11636]: RenderbufferStorageMultisample (will be remapped) */ + /* _mesa_function_pool[11669]: RenderbufferStorageMultisample (will be remapped) */ "iiiii\0" "glRenderbufferStorageMultisample\0" "glRenderbufferStorageMultisampleEXT\0" "\0" - /* _mesa_function_pool[11712]: TexCoord4fv (offset 121) */ + /* _mesa_function_pool[11745]: TexCoord4fv (offset 121) */ "p\0" "glTexCoord4fv\0" "\0" - /* _mesa_function_pool[11729]: Tangent3sEXT (dynamic) */ + /* _mesa_function_pool[11762]: Tangent3sEXT (dynamic) */ "iii\0" "glTangent3sEXT\0" "\0" - /* _mesa_function_pool[11749]: GlobalAlphaFactorfSUN (dynamic) */ + /* _mesa_function_pool[11782]: GlobalAlphaFactorfSUN (dynamic) */ "f\0" "glGlobalAlphaFactorfSUN\0" "\0" - /* _mesa_function_pool[11776]: MultiTexCoord3iARB (offset 396) */ + /* _mesa_function_pool[11809]: MultiTexCoord3iARB (offset 396) */ "iiii\0" "glMultiTexCoord3i\0" "glMultiTexCoord3iARB\0" "\0" - /* _mesa_function_pool[11821]: IsProgram (will be remapped) */ + /* _mesa_function_pool[11854]: IsProgram (will be remapped) */ "i\0" "glIsProgram\0" "\0" - /* _mesa_function_pool[11836]: TexCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[11869]: TexCoordPointerListIBM (dynamic) */ "iiipi\0" "glTexCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[11868]: GlobalAlphaFactorusSUN (dynamic) */ + /* _mesa_function_pool[11901]: GlobalAlphaFactorusSUN (dynamic) */ "i\0" "glGlobalAlphaFactorusSUN\0" "\0" - /* _mesa_function_pool[11896]: VertexAttrib2dvNV (will be remapped) */ + /* _mesa_function_pool[11929]: VertexAttrib2dvNV (will be remapped) */ "ip\0" "glVertexAttrib2dvNV\0" "\0" - /* _mesa_function_pool[11920]: FramebufferRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[11953]: FramebufferRenderbufferEXT (will be remapped) */ "iiii\0" "glFramebufferRenderbuffer\0" "glFramebufferRenderbufferEXT\0" "\0" - /* _mesa_function_pool[11981]: VertexAttrib1dvNV (will be remapped) */ + /* _mesa_function_pool[12014]: VertexAttrib1dvNV (will be remapped) */ "ip\0" "glVertexAttrib1dvNV\0" "\0" - /* _mesa_function_pool[12005]: GenTextures (offset 328) */ + /* _mesa_function_pool[12038]: GenTextures (offset 328) */ "ip\0" "glGenTextures\0" "glGenTexturesEXT\0" "\0" - /* _mesa_function_pool[12040]: SetFenceNV (will be remapped) */ + /* _mesa_function_pool[12073]: SetFenceNV (will be remapped) */ "ii\0" "glSetFenceNV\0" "\0" - /* _mesa_function_pool[12057]: FramebufferTexture1DEXT (will be remapped) */ + /* _mesa_function_pool[12090]: FramebufferTexture1DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture1D\0" "glFramebufferTexture1DEXT\0" "\0" - /* _mesa_function_pool[12113]: GetCombinerOutputParameterivNV (will be remapped) */ + /* _mesa_function_pool[12146]: GetCombinerOutputParameterivNV (will be remapped) */ "iiip\0" "glGetCombinerOutputParameterivNV\0" "\0" - /* _mesa_function_pool[12152]: PixelTexGenParameterivSGIS (will be remapped) */ + /* _mesa_function_pool[12185]: PixelTexGenParameterivSGIS (will be remapped) */ "ip\0" "glPixelTexGenParameterivSGIS\0" "\0" - /* _mesa_function_pool[12185]: TextureNormalEXT (dynamic) */ + /* _mesa_function_pool[12218]: TextureNormalEXT (dynamic) */ "i\0" "glTextureNormalEXT\0" "\0" - /* _mesa_function_pool[12207]: IndexPointerListIBM (dynamic) */ + /* _mesa_function_pool[12240]: IndexPointerListIBM (dynamic) */ "iipi\0" "glIndexPointerListIBM\0" "\0" - /* _mesa_function_pool[12235]: WeightfvARB (dynamic) */ + /* _mesa_function_pool[12268]: WeightfvARB (dynamic) */ "ip\0" "glWeightfvARB\0" "\0" - /* _mesa_function_pool[12253]: RasterPos2sv (offset 69) */ + /* _mesa_function_pool[12286]: RasterPos2sv (offset 69) */ "p\0" "glRasterPos2sv\0" "\0" - /* _mesa_function_pool[12271]: Color4ubv (offset 36) */ + /* _mesa_function_pool[12304]: Color4ubv (offset 36) */ "p\0" "glColor4ubv\0" "\0" - /* _mesa_function_pool[12286]: DrawBuffer (offset 202) */ + /* _mesa_function_pool[12319]: DrawBuffer (offset 202) */ "i\0" "glDrawBuffer\0" "\0" - /* _mesa_function_pool[12302]: TexCoord2fv (offset 105) */ + /* _mesa_function_pool[12335]: TexCoord2fv (offset 105) */ "p\0" "glTexCoord2fv\0" "\0" - /* _mesa_function_pool[12319]: WindowPos4fMESA (will be remapped) */ + /* _mesa_function_pool[12352]: WindowPos4fMESA (will be remapped) */ "ffff\0" "glWindowPos4fMESA\0" "\0" - /* _mesa_function_pool[12343]: TexCoord1sv (offset 101) */ + /* _mesa_function_pool[12376]: TexCoord1sv (offset 101) */ "p\0" "glTexCoord1sv\0" "\0" - /* _mesa_function_pool[12360]: WindowPos3dvMESA (will be remapped) */ + /* _mesa_function_pool[12393]: WindowPos3dvMESA (will be remapped) */ "p\0" "glWindowPos3dv\0" "glWindowPos3dvARB\0" "glWindowPos3dvMESA\0" "\0" - /* _mesa_function_pool[12415]: DepthFunc (offset 245) */ + /* _mesa_function_pool[12448]: DepthFunc (offset 245) */ "i\0" "glDepthFunc\0" "\0" - /* _mesa_function_pool[12430]: PixelMapusv (offset 253) */ + /* _mesa_function_pool[12463]: PixelMapusv (offset 253) */ "iip\0" "glPixelMapusv\0" "\0" - /* _mesa_function_pool[12449]: GetQueryObjecti64vEXT (will be remapped) */ + /* _mesa_function_pool[12482]: GetQueryObjecti64vEXT (will be remapped) */ "iip\0" "glGetQueryObjecti64vEXT\0" "\0" - /* _mesa_function_pool[12478]: MultiTexCoord1dARB (offset 376) */ + /* _mesa_function_pool[12511]: MultiTexCoord1dARB (offset 376) */ "id\0" "glMultiTexCoord1d\0" "glMultiTexCoord1dARB\0" "\0" - /* _mesa_function_pool[12521]: PointParameterivNV (will be remapped) */ + /* _mesa_function_pool[12554]: PointParameterivNV (will be remapped) */ "ip\0" "glPointParameteriv\0" "glPointParameterivNV\0" "\0" - /* _mesa_function_pool[12565]: BlendFunc (offset 241) */ + /* _mesa_function_pool[12598]: BlendFunc (offset 241) */ "ii\0" "glBlendFunc\0" "\0" - /* _mesa_function_pool[12581]: Uniform2fvARB (will be remapped) */ + /* _mesa_function_pool[12614]: Uniform2fvARB (will be remapped) */ "iip\0" "glUniform2fv\0" "glUniform2fvARB\0" "\0" - /* _mesa_function_pool[12615]: BufferParameteriAPPLE (will be remapped) */ + /* _mesa_function_pool[12648]: BufferParameteriAPPLE (will be remapped) */ "iii\0" "glBufferParameteriAPPLE\0" "\0" - /* _mesa_function_pool[12644]: MultiTexCoord3dvARB (offset 393) */ + /* _mesa_function_pool[12677]: MultiTexCoord3dvARB (offset 393) */ "ip\0" "glMultiTexCoord3dv\0" "glMultiTexCoord3dvARB\0" "\0" - /* _mesa_function_pool[12689]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[12722]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[12745]: DeleteObjectARB (will be remapped) */ + /* _mesa_function_pool[12778]: DeleteObjectARB (will be remapped) */ "i\0" "glDeleteObjectARB\0" "\0" - /* _mesa_function_pool[12766]: MatrixIndexPointerARB (dynamic) */ + /* _mesa_function_pool[12799]: MatrixIndexPointerARB (dynamic) */ "iiip\0" "glMatrixIndexPointerARB\0" "\0" - /* _mesa_function_pool[12796]: ProgramNamedParameter4dvNV (will be remapped) */ + /* _mesa_function_pool[12829]: ProgramNamedParameter4dvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4dvNV\0" "\0" - /* _mesa_function_pool[12831]: Tangent3fvEXT (dynamic) */ + /* _mesa_function_pool[12864]: Tangent3fvEXT (dynamic) */ "p\0" "glTangent3fvEXT\0" "\0" - /* _mesa_function_pool[12850]: Flush (offset 217) */ + /* _mesa_function_pool[12883]: Flush (offset 217) */ "\0" "glFlush\0" "\0" - /* _mesa_function_pool[12860]: Color4uiv (offset 38) */ + /* _mesa_function_pool[12893]: Color4uiv (offset 38) */ "p\0" "glColor4uiv\0" "\0" - /* _mesa_function_pool[12875]: GenVertexArrays (will be remapped) */ + /* _mesa_function_pool[12908]: GenVertexArrays (will be remapped) */ "ip\0" "glGenVertexArrays\0" "\0" - /* _mesa_function_pool[12897]: RasterPos3sv (offset 77) */ + /* _mesa_function_pool[12930]: RasterPos3sv (offset 77) */ "p\0" "glRasterPos3sv\0" "\0" - /* _mesa_function_pool[12915]: BindFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[12948]: BindFramebufferEXT (will be remapped) */ "ii\0" "glBindFramebuffer\0" "glBindFramebufferEXT\0" "\0" - /* _mesa_function_pool[12958]: ReferencePlaneSGIX (dynamic) */ + /* _mesa_function_pool[12991]: ReferencePlaneSGIX (dynamic) */ "p\0" "glReferencePlaneSGIX\0" "\0" - /* _mesa_function_pool[12982]: PushAttrib (offset 219) */ + /* _mesa_function_pool[13015]: PushAttrib (offset 219) */ "i\0" "glPushAttrib\0" "\0" - /* _mesa_function_pool[12998]: RasterPos2i (offset 66) */ + /* _mesa_function_pool[13031]: RasterPos2i (offset 66) */ "ii\0" "glRasterPos2i\0" "\0" - /* _mesa_function_pool[13016]: ValidateProgramARB (will be remapped) */ + /* _mesa_function_pool[13049]: ValidateProgramARB (will be remapped) */ "i\0" "glValidateProgram\0" "glValidateProgramARB\0" "\0" - /* _mesa_function_pool[13058]: TexParameteriv (offset 181) */ + /* _mesa_function_pool[13091]: TexParameteriv (offset 181) */ "iip\0" "glTexParameteriv\0" "\0" - /* _mesa_function_pool[13080]: UnlockArraysEXT (will be remapped) */ + /* _mesa_function_pool[13113]: UnlockArraysEXT (will be remapped) */ "\0" "glUnlockArraysEXT\0" "\0" - /* _mesa_function_pool[13100]: TexCoord2fColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[13133]: TexCoord2fColor3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[13141]: WindowPos3fvMESA (will be remapped) */ + /* _mesa_function_pool[13174]: WindowPos3fvMESA (will be remapped) */ "p\0" "glWindowPos3fv\0" "glWindowPos3fvARB\0" "glWindowPos3fvMESA\0" "\0" - /* _mesa_function_pool[13196]: RasterPos2f (offset 64) */ + /* _mesa_function_pool[13229]: RasterPos2f (offset 64) */ "ff\0" "glRasterPos2f\0" "\0" - /* _mesa_function_pool[13214]: VertexAttrib1svNV (will be remapped) */ + /* _mesa_function_pool[13247]: VertexAttrib1svNV (will be remapped) */ "ip\0" "glVertexAttrib1svNV\0" "\0" - /* _mesa_function_pool[13238]: RasterPos2d (offset 62) */ + /* _mesa_function_pool[13271]: RasterPos2d (offset 62) */ "dd\0" "glRasterPos2d\0" "\0" - /* _mesa_function_pool[13256]: RasterPos3fv (offset 73) */ + /* _mesa_function_pool[13289]: RasterPos3fv (offset 73) */ "p\0" "glRasterPos3fv\0" "\0" - /* _mesa_function_pool[13274]: CopyTexSubImage3D (offset 373) */ + /* _mesa_function_pool[13307]: CopyTexSubImage3D (offset 373) */ "iiiiiiiii\0" "glCopyTexSubImage3D\0" "glCopyTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[13328]: VertexAttrib2dARB (will be remapped) */ + /* _mesa_function_pool[13361]: VertexAttrib2dARB (will be remapped) */ "idd\0" "glVertexAttrib2d\0" "glVertexAttrib2dARB\0" "\0" - /* _mesa_function_pool[13370]: Color4ub (offset 35) */ + /* _mesa_function_pool[13403]: Color4ub (offset 35) */ "iiii\0" "glColor4ub\0" "\0" - /* _mesa_function_pool[13387]: GetInteger64v (will be remapped) */ + /* _mesa_function_pool[13420]: GetInteger64v (will be remapped) */ "ip\0" "glGetInteger64v\0" "\0" - /* _mesa_function_pool[13407]: TextureColorMaskSGIS (dynamic) */ + /* _mesa_function_pool[13440]: TextureColorMaskSGIS (dynamic) */ "iiii\0" "glTextureColorMaskSGIS\0" "\0" - /* _mesa_function_pool[13436]: RasterPos2s (offset 68) */ + /* _mesa_function_pool[13469]: RasterPos2s (offset 68) */ "ii\0" "glRasterPos2s\0" "\0" - /* _mesa_function_pool[13454]: GetColorTable (offset 343) */ + /* _mesa_function_pool[13487]: GetColorTable (offset 343) */ "iiip\0" "glGetColorTable\0" "glGetColorTableSGI\0" "glGetColorTableEXT\0" "\0" - /* _mesa_function_pool[13514]: SelectBuffer (offset 195) */ + /* _mesa_function_pool[13547]: SelectBuffer (offset 195) */ "ip\0" "glSelectBuffer\0" "\0" - /* _mesa_function_pool[13533]: Indexiv (offset 49) */ + /* _mesa_function_pool[13566]: Indexiv (offset 49) */ "p\0" "glIndexiv\0" "\0" - /* _mesa_function_pool[13546]: TexCoord3i (offset 114) */ + /* _mesa_function_pool[13579]: TexCoord3i (offset 114) */ "iii\0" "glTexCoord3i\0" "\0" - /* _mesa_function_pool[13564]: CopyColorTable (offset 342) */ + /* _mesa_function_pool[13597]: CopyColorTable (offset 342) */ "iiiii\0" "glCopyColorTable\0" "glCopyColorTableSGI\0" "\0" - /* _mesa_function_pool[13608]: GetHistogramParameterfv (offset 362) */ + /* _mesa_function_pool[13641]: GetHistogramParameterfv (offset 362) */ "iip\0" "glGetHistogramParameterfv\0" "glGetHistogramParameterfvEXT\0" "\0" - /* _mesa_function_pool[13668]: Frustum (offset 289) */ + /* _mesa_function_pool[13701]: Frustum (offset 289) */ "dddddd\0" "glFrustum\0" "\0" - /* _mesa_function_pool[13686]: GetString (offset 275) */ + /* _mesa_function_pool[13719]: GetString (offset 275) */ "i\0" "glGetString\0" "\0" - /* _mesa_function_pool[13701]: ColorPointervINTEL (dynamic) */ + /* _mesa_function_pool[13734]: ColorPointervINTEL (dynamic) */ "iip\0" "glColorPointervINTEL\0" "\0" - /* _mesa_function_pool[13727]: TexEnvf (offset 184) */ + /* _mesa_function_pool[13760]: TexEnvf (offset 184) */ "iif\0" "glTexEnvf\0" "\0" - /* _mesa_function_pool[13742]: TexCoord3d (offset 110) */ + /* _mesa_function_pool[13775]: TexCoord3d (offset 110) */ "ddd\0" "glTexCoord3d\0" "\0" - /* _mesa_function_pool[13760]: AlphaFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[13793]: AlphaFragmentOp1ATI (will be remapped) */ "iiiiii\0" "glAlphaFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[13790]: TexCoord3f (offset 112) */ + /* _mesa_function_pool[13823]: TexCoord3f (offset 112) */ "fff\0" "glTexCoord3f\0" "\0" - /* _mesa_function_pool[13808]: MultiTexCoord3ivARB (offset 397) */ + /* _mesa_function_pool[13841]: MultiTexCoord3ivARB (offset 397) */ "ip\0" "glMultiTexCoord3iv\0" "glMultiTexCoord3ivARB\0" "\0" - /* _mesa_function_pool[13853]: MultiTexCoord2sARB (offset 390) */ + /* _mesa_function_pool[13886]: MultiTexCoord2sARB (offset 390) */ "iii\0" "glMultiTexCoord2s\0" "glMultiTexCoord2sARB\0" "\0" - /* _mesa_function_pool[13897]: VertexAttrib1dvARB (will be remapped) */ + /* _mesa_function_pool[13930]: VertexAttrib1dvARB (will be remapped) */ "ip\0" "glVertexAttrib1dv\0" "glVertexAttrib1dvARB\0" "\0" - /* _mesa_function_pool[13940]: DeleteTextures (offset 327) */ + /* _mesa_function_pool[13973]: DeleteTextures (offset 327) */ "ip\0" "glDeleteTextures\0" "glDeleteTexturesEXT\0" "\0" - /* _mesa_function_pool[13981]: TexCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[14014]: TexCoordPointerEXT (will be remapped) */ "iiiip\0" "glTexCoordPointerEXT\0" "\0" - /* _mesa_function_pool[14009]: TexSubImage4DSGIS (dynamic) */ + /* _mesa_function_pool[14042]: TexSubImage4DSGIS (dynamic) */ "iiiiiiiiiiiip\0" "glTexSubImage4DSGIS\0" "\0" - /* _mesa_function_pool[14044]: TexCoord3s (offset 116) */ + /* _mesa_function_pool[14077]: TexCoord3s (offset 116) */ "iii\0" "glTexCoord3s\0" "\0" - /* _mesa_function_pool[14062]: GetTexLevelParameteriv (offset 285) */ + /* _mesa_function_pool[14095]: GetTexLevelParameteriv (offset 285) */ "iiip\0" "glGetTexLevelParameteriv\0" "\0" - /* _mesa_function_pool[14093]: CombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[14126]: CombinerStageParameterfvNV (dynamic) */ "iip\0" "glCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[14127]: StopInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[14160]: StopInstrumentsSGIX (dynamic) */ "i\0" "glStopInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[14152]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[14185]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ "fffffffffffffff\0" "glTexCoord4fColor4fNormal3fVertex4fSUN\0" "\0" - /* _mesa_function_pool[14208]: ClearAccum (offset 204) */ + /* _mesa_function_pool[14241]: ClearAccum (offset 204) */ "ffff\0" "glClearAccum\0" "\0" - /* _mesa_function_pool[14227]: DeformSGIX (dynamic) */ + /* _mesa_function_pool[14260]: DeformSGIX (dynamic) */ "i\0" "glDeformSGIX\0" "\0" - /* _mesa_function_pool[14243]: GetVertexAttribfvARB (will be remapped) */ + /* _mesa_function_pool[14276]: GetVertexAttribfvARB (will be remapped) */ "iip\0" "glGetVertexAttribfv\0" "glGetVertexAttribfvARB\0" "\0" - /* _mesa_function_pool[14291]: SecondaryColor3ivEXT (will be remapped) */ + /* _mesa_function_pool[14324]: SecondaryColor3ivEXT (will be remapped) */ "p\0" "glSecondaryColor3iv\0" "glSecondaryColor3ivEXT\0" "\0" - /* _mesa_function_pool[14337]: TexCoord4iv (offset 123) */ + /* _mesa_function_pool[14370]: TexCoord4iv (offset 123) */ "p\0" "glTexCoord4iv\0" "\0" - /* _mesa_function_pool[14354]: UniformMatrix4x2fv (will be remapped) */ + /* _mesa_function_pool[14387]: UniformMatrix4x2fv (will be remapped) */ "iiip\0" "glUniformMatrix4x2fv\0" "\0" - /* _mesa_function_pool[14381]: GetDetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[14414]: GetDetailTexFuncSGIS (dynamic) */ "ip\0" "glGetDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[14408]: GetCombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[14441]: GetCombinerStageParameterfvNV (dynamic) */ "iip\0" "glGetCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[14445]: PolygonOffset (offset 319) */ + /* _mesa_function_pool[14478]: PolygonOffset (offset 319) */ "ff\0" "glPolygonOffset\0" "\0" - /* _mesa_function_pool[14465]: BindVertexArray (will be remapped) */ + /* _mesa_function_pool[14498]: BindVertexArray (will be remapped) */ "i\0" "glBindVertexArray\0" "\0" - /* _mesa_function_pool[14486]: Color4ubVertex2fvSUN (dynamic) */ + /* _mesa_function_pool[14519]: Color4ubVertex2fvSUN (dynamic) */ "pp\0" "glColor4ubVertex2fvSUN\0" "\0" - /* _mesa_function_pool[14513]: Rectd (offset 86) */ + /* _mesa_function_pool[14546]: Rectd (offset 86) */ "dddd\0" "glRectd\0" "\0" - /* _mesa_function_pool[14527]: TexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[14560]: TexFilterFuncSGIS (dynamic) */ "iiip\0" "glTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[14553]: SampleMaskSGIS (will be remapped) */ + /* _mesa_function_pool[14586]: SampleMaskSGIS (will be remapped) */ "fi\0" "glSampleMaskSGIS\0" "glSampleMaskEXT\0" "\0" - /* _mesa_function_pool[14590]: GetAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[14623]: GetAttribLocationARB (will be remapped) */ "ip\0" "glGetAttribLocation\0" "glGetAttribLocationARB\0" "\0" - /* _mesa_function_pool[14637]: RasterPos3i (offset 74) */ + /* _mesa_function_pool[14670]: RasterPos3i (offset 74) */ "iii\0" "glRasterPos3i\0" "\0" - /* _mesa_function_pool[14656]: VertexAttrib4ubvARB (will be remapped) */ + /* _mesa_function_pool[14689]: VertexAttrib4ubvARB (will be remapped) */ "ip\0" "glVertexAttrib4ubv\0" "glVertexAttrib4ubvARB\0" "\0" - /* _mesa_function_pool[14701]: DetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[14734]: DetailTexFuncSGIS (dynamic) */ "iip\0" "glDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[14726]: Normal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[14759]: Normal3fVertex3fSUN (dynamic) */ "ffffff\0" "glNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[14756]: CopyTexImage2D (offset 324) */ + /* _mesa_function_pool[14789]: CopyTexImage2D (offset 324) */ "iiiiiiii\0" "glCopyTexImage2D\0" "glCopyTexImage2DEXT\0" "\0" - /* _mesa_function_pool[14803]: GetBufferPointervARB (will be remapped) */ + /* _mesa_function_pool[14836]: GetBufferPointervARB (will be remapped) */ "iip\0" "glGetBufferPointerv\0" "glGetBufferPointervARB\0" "\0" - /* _mesa_function_pool[14851]: ProgramEnvParameter4fARB (will be remapped) */ + /* _mesa_function_pool[14884]: ProgramEnvParameter4fARB (will be remapped) */ "iiffff\0" "glProgramEnvParameter4fARB\0" "glProgramParameter4fNV\0" "\0" - /* _mesa_function_pool[14909]: Uniform3ivARB (will be remapped) */ + /* _mesa_function_pool[14942]: Uniform3ivARB (will be remapped) */ "iip\0" "glUniform3iv\0" "glUniform3ivARB\0" "\0" - /* _mesa_function_pool[14943]: Lightfv (offset 160) */ + /* _mesa_function_pool[14976]: Lightfv (offset 160) */ "iip\0" "glLightfv\0" "\0" - /* _mesa_function_pool[14958]: ClearDepth (offset 208) */ + /* _mesa_function_pool[14991]: ClearDepth (offset 208) */ "d\0" "glClearDepth\0" "\0" - /* _mesa_function_pool[14974]: GetFenceivNV (will be remapped) */ + /* _mesa_function_pool[15007]: GetFenceivNV (will be remapped) */ "iip\0" "glGetFenceivNV\0" "\0" - /* _mesa_function_pool[14994]: WindowPos4dvMESA (will be remapped) */ + /* _mesa_function_pool[15027]: WindowPos4dvMESA (will be remapped) */ "p\0" "glWindowPos4dvMESA\0" "\0" - /* _mesa_function_pool[15016]: ColorSubTable (offset 346) */ + /* _mesa_function_pool[15049]: ColorSubTable (offset 346) */ "iiiiip\0" "glColorSubTable\0" "glColorSubTableEXT\0" "\0" - /* _mesa_function_pool[15059]: Color4fv (offset 30) */ + /* _mesa_function_pool[15092]: Color4fv (offset 30) */ "p\0" "glColor4fv\0" "\0" - /* _mesa_function_pool[15073]: MultiTexCoord4ivARB (offset 405) */ + /* _mesa_function_pool[15106]: MultiTexCoord4ivARB (offset 405) */ "ip\0" "glMultiTexCoord4iv\0" "glMultiTexCoord4ivARB\0" "\0" - /* _mesa_function_pool[15118]: ProgramLocalParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[15151]: ProgramLocalParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramLocalParameters4fvEXT\0" "\0" - /* _mesa_function_pool[15155]: ColorPointer (offset 308) */ + /* _mesa_function_pool[15188]: ColorPointer (offset 308) */ "iiip\0" "glColorPointer\0" "\0" - /* _mesa_function_pool[15176]: Rects (offset 92) */ + /* _mesa_function_pool[15209]: Rects (offset 92) */ "iiii\0" "glRects\0" "\0" - /* _mesa_function_pool[15190]: GetMapAttribParameterfvNV (dynamic) */ + /* _mesa_function_pool[15223]: GetMapAttribParameterfvNV (dynamic) */ "iiip\0" "glGetMapAttribParameterfvNV\0" "\0" - /* _mesa_function_pool[15224]: Lightiv (offset 162) */ + /* _mesa_function_pool[15257]: Lightiv (offset 162) */ "iip\0" "glLightiv\0" "\0" - /* _mesa_function_pool[15239]: VertexAttrib4sARB (will be remapped) */ + /* _mesa_function_pool[15272]: VertexAttrib4sARB (will be remapped) */ "iiiii\0" "glVertexAttrib4s\0" "glVertexAttrib4sARB\0" "\0" - /* _mesa_function_pool[15283]: GetQueryObjectuivARB (will be remapped) */ + /* _mesa_function_pool[15316]: GetQueryObjectuivARB (will be remapped) */ "iip\0" "glGetQueryObjectuiv\0" "glGetQueryObjectuivARB\0" "\0" - /* _mesa_function_pool[15331]: GetTexParameteriv (offset 283) */ + /* _mesa_function_pool[15364]: GetTexParameteriv (offset 283) */ "iip\0" "glGetTexParameteriv\0" "\0" - /* _mesa_function_pool[15356]: MapParameterivNV (dynamic) */ + /* _mesa_function_pool[15389]: MapParameterivNV (dynamic) */ "iip\0" "glMapParameterivNV\0" "\0" - /* _mesa_function_pool[15380]: GenRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[15413]: GenRenderbuffersEXT (will be remapped) */ "ip\0" "glGenRenderbuffers\0" "glGenRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[15425]: VertexAttrib2dvARB (will be remapped) */ + /* _mesa_function_pool[15458]: VertexAttrib2dvARB (will be remapped) */ "ip\0" "glVertexAttrib2dv\0" "glVertexAttrib2dvARB\0" "\0" - /* _mesa_function_pool[15468]: EdgeFlagPointerEXT (will be remapped) */ + /* _mesa_function_pool[15501]: EdgeFlagPointerEXT (will be remapped) */ "iip\0" "glEdgeFlagPointerEXT\0" "\0" - /* _mesa_function_pool[15494]: VertexAttribs2svNV (will be remapped) */ + /* _mesa_function_pool[15527]: VertexAttribs2svNV (will be remapped) */ "iip\0" "glVertexAttribs2svNV\0" "\0" - /* _mesa_function_pool[15520]: WeightbvARB (dynamic) */ + /* _mesa_function_pool[15553]: WeightbvARB (dynamic) */ "ip\0" "glWeightbvARB\0" "\0" - /* _mesa_function_pool[15538]: VertexAttrib2fvARB (will be remapped) */ + /* _mesa_function_pool[15571]: VertexAttrib2fvARB (will be remapped) */ "ip\0" "glVertexAttrib2fv\0" "glVertexAttrib2fvARB\0" "\0" - /* _mesa_function_pool[15581]: GetBufferParameterivARB (will be remapped) */ + /* _mesa_function_pool[15614]: GetBufferParameterivARB (will be remapped) */ "iip\0" "glGetBufferParameteriv\0" "glGetBufferParameterivARB\0" "\0" - /* _mesa_function_pool[15635]: Rectdv (offset 87) */ + /* _mesa_function_pool[15668]: Rectdv (offset 87) */ "pp\0" "glRectdv\0" "\0" - /* _mesa_function_pool[15648]: ListParameteriSGIX (dynamic) */ + /* _mesa_function_pool[15681]: ListParameteriSGIX (dynamic) */ "iii\0" "glListParameteriSGIX\0" "\0" - /* _mesa_function_pool[15674]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[15707]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffff\0" "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[15733]: InstrumentsBufferSGIX (dynamic) */ + /* _mesa_function_pool[15766]: InstrumentsBufferSGIX (dynamic) */ "ip\0" "glInstrumentsBufferSGIX\0" "\0" - /* _mesa_function_pool[15761]: VertexAttrib4NivARB (will be remapped) */ + /* _mesa_function_pool[15794]: VertexAttrib4NivARB (will be remapped) */ "ip\0" "glVertexAttrib4Niv\0" "glVertexAttrib4NivARB\0" "\0" - /* _mesa_function_pool[15806]: GetAttachedShaders (will be remapped) */ + /* _mesa_function_pool[15839]: GetAttachedShaders (will be remapped) */ "iipp\0" "glGetAttachedShaders\0" "\0" - /* _mesa_function_pool[15833]: GenVertexArraysAPPLE (will be remapped) */ + /* _mesa_function_pool[15866]: GenVertexArraysAPPLE (will be remapped) */ "ip\0" "glGenVertexArraysAPPLE\0" "\0" - /* _mesa_function_pool[15860]: Materialiv (offset 172) */ + /* _mesa_function_pool[15893]: Materialiv (offset 172) */ "iip\0" "glMaterialiv\0" "\0" - /* _mesa_function_pool[15878]: PushClientAttrib (offset 335) */ + /* _mesa_function_pool[15911]: PushClientAttrib (offset 335) */ "i\0" "glPushClientAttrib\0" "\0" - /* _mesa_function_pool[15900]: ProgramEnvParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[15933]: ProgramEnvParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramEnvParameters4fvEXT\0" "\0" - /* _mesa_function_pool[15935]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[15968]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[15981]: WindowPos2iMESA (will be remapped) */ + /* _mesa_function_pool[16014]: WindowPos2iMESA (will be remapped) */ "ii\0" "glWindowPos2i\0" "glWindowPos2iARB\0" "glWindowPos2iMESA\0" "\0" - /* _mesa_function_pool[16034]: SecondaryColor3fvEXT (will be remapped) */ + /* _mesa_function_pool[16067]: SecondaryColor3fvEXT (will be remapped) */ "p\0" "glSecondaryColor3fv\0" "glSecondaryColor3fvEXT\0" "\0" - /* _mesa_function_pool[16080]: PolygonMode (offset 174) */ + /* _mesa_function_pool[16113]: PolygonMode (offset 174) */ "ii\0" "glPolygonMode\0" "\0" - /* _mesa_function_pool[16098]: CompressedTexSubImage1DARB (will be remapped) */ + /* _mesa_function_pool[16131]: CompressedTexSubImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexSubImage1D\0" "glCompressedTexSubImage1DARB\0" "\0" - /* _mesa_function_pool[16162]: GetVertexAttribivNV (will be remapped) */ + /* _mesa_function_pool[16195]: GetVertexAttribivNV (will be remapped) */ "iip\0" "glGetVertexAttribivNV\0" "\0" - /* _mesa_function_pool[16189]: GetProgramStringARB (will be remapped) */ + /* _mesa_function_pool[16222]: GetProgramStringARB (will be remapped) */ "iip\0" "glGetProgramStringARB\0" "\0" - /* _mesa_function_pool[16216]: TexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[16249]: TexBumpParameterfvATI (will be remapped) */ "ip\0" "glTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[16244]: CompileShaderARB (will be remapped) */ + /* _mesa_function_pool[16277]: CompileShaderARB (will be remapped) */ "i\0" "glCompileShader\0" "glCompileShaderARB\0" "\0" - /* _mesa_function_pool[16282]: DeleteShader (will be remapped) */ + /* _mesa_function_pool[16315]: DeleteShader (will be remapped) */ "i\0" "glDeleteShader\0" "\0" - /* _mesa_function_pool[16300]: DisableClientState (offset 309) */ + /* _mesa_function_pool[16333]: DisableClientState (offset 309) */ "i\0" "glDisableClientState\0" "\0" - /* _mesa_function_pool[16324]: TexGeni (offset 192) */ + /* _mesa_function_pool[16357]: TexGeni (offset 192) */ "iii\0" "glTexGeni\0" "\0" - /* _mesa_function_pool[16339]: TexGenf (offset 190) */ + /* _mesa_function_pool[16372]: TexGenf (offset 190) */ "iif\0" "glTexGenf\0" "\0" - /* _mesa_function_pool[16354]: Uniform3fARB (will be remapped) */ + /* _mesa_function_pool[16387]: Uniform3fARB (will be remapped) */ "ifff\0" "glUniform3f\0" "glUniform3fARB\0" "\0" - /* _mesa_function_pool[16387]: TexGend (offset 188) */ + /* _mesa_function_pool[16420]: TexGend (offset 188) */ "iid\0" "glTexGend\0" "\0" - /* _mesa_function_pool[16402]: ListParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[16435]: ListParameterfvSGIX (dynamic) */ "iip\0" "glListParameterfvSGIX\0" "\0" - /* _mesa_function_pool[16429]: GetPolygonStipple (offset 274) */ + /* _mesa_function_pool[16462]: GetPolygonStipple (offset 274) */ "p\0" "glGetPolygonStipple\0" "\0" - /* _mesa_function_pool[16452]: Tangent3dvEXT (dynamic) */ + /* _mesa_function_pool[16485]: Tangent3dvEXT (dynamic) */ "p\0" "glTangent3dvEXT\0" "\0" - /* _mesa_function_pool[16471]: GetVertexAttribfvNV (will be remapped) */ + /* _mesa_function_pool[16504]: GetVertexAttribfvNV (will be remapped) */ "iip\0" "glGetVertexAttribfvNV\0" "\0" - /* _mesa_function_pool[16498]: WindowPos3sMESA (will be remapped) */ + /* _mesa_function_pool[16531]: WindowPos3sMESA (will be remapped) */ "iii\0" "glWindowPos3s\0" "glWindowPos3sARB\0" "glWindowPos3sMESA\0" "\0" - /* _mesa_function_pool[16552]: VertexAttrib2svNV (will be remapped) */ + /* _mesa_function_pool[16585]: VertexAttrib2svNV (will be remapped) */ "ip\0" "glVertexAttrib2svNV\0" "\0" - /* _mesa_function_pool[16576]: VertexAttribs1fvNV (will be remapped) */ + /* _mesa_function_pool[16609]: VertexAttribs1fvNV (will be remapped) */ "iip\0" "glVertexAttribs1fvNV\0" "\0" - /* _mesa_function_pool[16602]: TexCoord2fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[16635]: TexCoord2fVertex3fvSUN (dynamic) */ "pp\0" "glTexCoord2fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[16631]: WindowPos4sMESA (will be remapped) */ + /* _mesa_function_pool[16664]: WindowPos4sMESA (will be remapped) */ "iiii\0" "glWindowPos4sMESA\0" "\0" - /* _mesa_function_pool[16655]: VertexAttrib4NuivARB (will be remapped) */ + /* _mesa_function_pool[16688]: VertexAttrib4NuivARB (will be remapped) */ "ip\0" "glVertexAttrib4Nuiv\0" "glVertexAttrib4NuivARB\0" "\0" - /* _mesa_function_pool[16702]: ClientActiveTextureARB (offset 375) */ + /* _mesa_function_pool[16735]: ClientActiveTextureARB (offset 375) */ "i\0" "glClientActiveTexture\0" "glClientActiveTextureARB\0" "\0" - /* _mesa_function_pool[16752]: PixelTexGenSGIX (will be remapped) */ + /* _mesa_function_pool[16785]: PixelTexGenSGIX (will be remapped) */ "i\0" "glPixelTexGenSGIX\0" "\0" - /* _mesa_function_pool[16773]: ReplacementCodeusvSUN (dynamic) */ + /* _mesa_function_pool[16806]: ReplacementCodeusvSUN (dynamic) */ "p\0" "glReplacementCodeusvSUN\0" "\0" - /* _mesa_function_pool[16800]: Uniform4fARB (will be remapped) */ + /* _mesa_function_pool[16833]: Uniform4fARB (will be remapped) */ "iffff\0" "glUniform4f\0" "glUniform4fARB\0" "\0" - /* _mesa_function_pool[16834]: Color4sv (offset 34) */ + /* _mesa_function_pool[16867]: Color4sv (offset 34) */ "p\0" "glColor4sv\0" "\0" - /* _mesa_function_pool[16848]: FlushMappedBufferRange (will be remapped) */ + /* _mesa_function_pool[16881]: FlushMappedBufferRange (will be remapped) */ "iii\0" "glFlushMappedBufferRange\0" "\0" - /* _mesa_function_pool[16878]: IsProgramNV (will be remapped) */ + /* _mesa_function_pool[16911]: IsProgramNV (will be remapped) */ "i\0" "glIsProgramARB\0" "glIsProgramNV\0" "\0" - /* _mesa_function_pool[16910]: FlushMappedBufferRangeAPPLE (will be remapped) */ + /* _mesa_function_pool[16943]: FlushMappedBufferRangeAPPLE (will be remapped) */ "iii\0" "glFlushMappedBufferRangeAPPLE\0" "\0" - /* _mesa_function_pool[16945]: PixelZoom (offset 246) */ + /* _mesa_function_pool[16978]: PixelZoom (offset 246) */ "ff\0" "glPixelZoom\0" "\0" - /* _mesa_function_pool[16961]: ReplacementCodePointerSUN (dynamic) */ + /* _mesa_function_pool[16994]: ReplacementCodePointerSUN (dynamic) */ "iip\0" "glReplacementCodePointerSUN\0" "\0" - /* _mesa_function_pool[16994]: ProgramEnvParameter4dARB (will be remapped) */ + /* _mesa_function_pool[17027]: ProgramEnvParameter4dARB (will be remapped) */ "iidddd\0" "glProgramEnvParameter4dARB\0" "glProgramParameter4dNV\0" "\0" - /* _mesa_function_pool[17052]: ColorTableParameterfv (offset 340) */ + /* _mesa_function_pool[17085]: ColorTableParameterfv (offset 340) */ "iip\0" "glColorTableParameterfv\0" "glColorTableParameterfvSGI\0" "\0" - /* _mesa_function_pool[17108]: FragmentLightModelfSGIX (dynamic) */ + /* _mesa_function_pool[17141]: FragmentLightModelfSGIX (dynamic) */ "if\0" "glFragmentLightModelfSGIX\0" "\0" - /* _mesa_function_pool[17138]: Binormal3bvEXT (dynamic) */ + /* _mesa_function_pool[17171]: Binormal3bvEXT (dynamic) */ "p\0" "glBinormal3bvEXT\0" "\0" - /* _mesa_function_pool[17158]: PixelMapuiv (offset 252) */ + /* _mesa_function_pool[17191]: PixelMapuiv (offset 252) */ "iip\0" "glPixelMapuiv\0" "\0" - /* _mesa_function_pool[17177]: Color3dv (offset 12) */ + /* _mesa_function_pool[17210]: Color3dv (offset 12) */ "p\0" "glColor3dv\0" "\0" - /* _mesa_function_pool[17191]: IsTexture (offset 330) */ + /* _mesa_function_pool[17224]: IsTexture (offset 330) */ "i\0" "glIsTexture\0" "glIsTextureEXT\0" "\0" - /* _mesa_function_pool[17221]: VertexWeightfvEXT (dynamic) */ + /* _mesa_function_pool[17254]: VertexWeightfvEXT (dynamic) */ "p\0" "glVertexWeightfvEXT\0" "\0" - /* _mesa_function_pool[17244]: VertexAttrib1dARB (will be remapped) */ + /* _mesa_function_pool[17277]: VertexAttrib1dARB (will be remapped) */ "id\0" "glVertexAttrib1d\0" "glVertexAttrib1dARB\0" "\0" - /* _mesa_function_pool[17285]: ImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[17318]: ImageTransformParameterivHP (dynamic) */ "iip\0" "glImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[17320]: TexCoord4i (offset 122) */ + /* _mesa_function_pool[17353]: TexCoord4i (offset 122) */ "iiii\0" "glTexCoord4i\0" "\0" - /* _mesa_function_pool[17339]: DeleteQueriesARB (will be remapped) */ + /* _mesa_function_pool[17372]: DeleteQueriesARB (will be remapped) */ "ip\0" "glDeleteQueries\0" "glDeleteQueriesARB\0" "\0" - /* _mesa_function_pool[17378]: Color4ubVertex2fSUN (dynamic) */ + /* _mesa_function_pool[17411]: Color4ubVertex2fSUN (dynamic) */ "iiiiff\0" "glColor4ubVertex2fSUN\0" "\0" - /* _mesa_function_pool[17408]: FragmentColorMaterialSGIX (dynamic) */ + /* _mesa_function_pool[17441]: FragmentColorMaterialSGIX (dynamic) */ "ii\0" "glFragmentColorMaterialSGIX\0" "\0" - /* _mesa_function_pool[17440]: CurrentPaletteMatrixARB (dynamic) */ + /* _mesa_function_pool[17473]: CurrentPaletteMatrixARB (dynamic) */ "i\0" "glCurrentPaletteMatrixARB\0" "\0" - /* _mesa_function_pool[17469]: GetMapdv (offset 266) */ + /* _mesa_function_pool[17502]: GetMapdv (offset 266) */ "iip\0" "glGetMapdv\0" "\0" - /* _mesa_function_pool[17485]: SamplePatternSGIS (will be remapped) */ + /* _mesa_function_pool[17518]: SamplePatternSGIS (will be remapped) */ "i\0" "glSamplePatternSGIS\0" "glSamplePatternEXT\0" "\0" - /* _mesa_function_pool[17527]: PixelStoref (offset 249) */ + /* _mesa_function_pool[17560]: PixelStoref (offset 249) */ "if\0" "glPixelStoref\0" "\0" - /* _mesa_function_pool[17545]: IsQueryARB (will be remapped) */ + /* _mesa_function_pool[17578]: IsQueryARB (will be remapped) */ "i\0" "glIsQuery\0" "glIsQueryARB\0" "\0" - /* _mesa_function_pool[17571]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[17604]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ "iiiiifff\0" "glReplacementCodeuiColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[17620]: PixelStorei (offset 250) */ + /* _mesa_function_pool[17653]: PixelStorei (offset 250) */ "ii\0" "glPixelStorei\0" "\0" - /* _mesa_function_pool[17638]: VertexAttrib4usvARB (will be remapped) */ + /* _mesa_function_pool[17671]: VertexAttrib4usvARB (will be remapped) */ "ip\0" "glVertexAttrib4usv\0" "glVertexAttrib4usvARB\0" "\0" - /* _mesa_function_pool[17683]: LinkProgramARB (will be remapped) */ + /* _mesa_function_pool[17716]: LinkProgramARB (will be remapped) */ "i\0" "glLinkProgram\0" "glLinkProgramARB\0" "\0" - /* _mesa_function_pool[17717]: VertexAttrib2fNV (will be remapped) */ + /* _mesa_function_pool[17750]: VertexAttrib2fNV (will be remapped) */ "iff\0" "glVertexAttrib2fNV\0" "\0" - /* _mesa_function_pool[17741]: ShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[17774]: ShaderSourceARB (will be remapped) */ "iipp\0" "glShaderSource\0" "glShaderSourceARB\0" "\0" - /* _mesa_function_pool[17780]: FragmentMaterialiSGIX (dynamic) */ + /* _mesa_function_pool[17813]: FragmentMaterialiSGIX (dynamic) */ "iii\0" "glFragmentMaterialiSGIX\0" "\0" - /* _mesa_function_pool[17809]: EvalCoord2dv (offset 233) */ + /* _mesa_function_pool[17842]: EvalCoord2dv (offset 233) */ "p\0" "glEvalCoord2dv\0" "\0" - /* _mesa_function_pool[17827]: VertexAttrib3svARB (will be remapped) */ + /* _mesa_function_pool[17860]: VertexAttrib3svARB (will be remapped) */ "ip\0" "glVertexAttrib3sv\0" "glVertexAttrib3svARB\0" "\0" - /* _mesa_function_pool[17870]: ColorMaterial (offset 151) */ + /* _mesa_function_pool[17903]: ColorMaterial (offset 151) */ "ii\0" "glColorMaterial\0" "\0" - /* _mesa_function_pool[17890]: CompressedTexSubImage3DARB (will be remapped) */ + /* _mesa_function_pool[17923]: CompressedTexSubImage3DARB (will be remapped) */ "iiiiiiiiiip\0" "glCompressedTexSubImage3D\0" "glCompressedTexSubImage3DARB\0" "\0" - /* _mesa_function_pool[17958]: WindowPos2ivMESA (will be remapped) */ + /* _mesa_function_pool[17991]: WindowPos2ivMESA (will be remapped) */ "p\0" "glWindowPos2iv\0" "glWindowPos2ivARB\0" "glWindowPos2ivMESA\0" "\0" - /* _mesa_function_pool[18013]: IsFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[18046]: IsFramebufferEXT (will be remapped) */ "i\0" "glIsFramebuffer\0" "glIsFramebufferEXT\0" "\0" - /* _mesa_function_pool[18051]: Uniform4ivARB (will be remapped) */ + /* _mesa_function_pool[18084]: Uniform4ivARB (will be remapped) */ "iip\0" "glUniform4iv\0" "glUniform4ivARB\0" "\0" - /* _mesa_function_pool[18085]: GetVertexAttribdvARB (will be remapped) */ + /* _mesa_function_pool[18118]: GetVertexAttribdvARB (will be remapped) */ "iip\0" "glGetVertexAttribdv\0" "glGetVertexAttribdvARB\0" "\0" - /* _mesa_function_pool[18133]: TexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[18166]: TexBumpParameterivATI (will be remapped) */ "ip\0" "glTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[18161]: GetSeparableFilter (offset 359) */ + /* _mesa_function_pool[18194]: GetSeparableFilter (offset 359) */ "iiippp\0" "glGetSeparableFilter\0" "glGetSeparableFilterEXT\0" "\0" - /* _mesa_function_pool[18214]: Binormal3dEXT (dynamic) */ + /* _mesa_function_pool[18247]: Binormal3dEXT (dynamic) */ "ddd\0" "glBinormal3dEXT\0" "\0" - /* _mesa_function_pool[18235]: SpriteParameteriSGIX (dynamic) */ + /* _mesa_function_pool[18268]: SpriteParameteriSGIX (dynamic) */ "ii\0" "glSpriteParameteriSGIX\0" "\0" - /* _mesa_function_pool[18262]: RequestResidentProgramsNV (will be remapped) */ + /* _mesa_function_pool[18295]: RequestResidentProgramsNV (will be remapped) */ "ip\0" "glRequestResidentProgramsNV\0" "\0" - /* _mesa_function_pool[18294]: TagSampleBufferSGIX (dynamic) */ + /* _mesa_function_pool[18327]: TagSampleBufferSGIX (dynamic) */ "\0" "glTagSampleBufferSGIX\0" "\0" - /* _mesa_function_pool[18318]: ReplacementCodeusSUN (dynamic) */ + /* _mesa_function_pool[18351]: ReplacementCodeusSUN (dynamic) */ "i\0" "glReplacementCodeusSUN\0" "\0" - /* _mesa_function_pool[18344]: FeedbackBuffer (offset 194) */ + /* _mesa_function_pool[18377]: FeedbackBuffer (offset 194) */ "iip\0" "glFeedbackBuffer\0" "\0" - /* _mesa_function_pool[18366]: RasterPos2iv (offset 67) */ + /* _mesa_function_pool[18399]: RasterPos2iv (offset 67) */ "p\0" "glRasterPos2iv\0" "\0" - /* _mesa_function_pool[18384]: TexImage1D (offset 182) */ + /* _mesa_function_pool[18417]: TexImage1D (offset 182) */ "iiiiiiip\0" "glTexImage1D\0" "\0" - /* _mesa_function_pool[18407]: ListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[18440]: ListParameterivSGIX (dynamic) */ "iip\0" "glListParameterivSGIX\0" "\0" - /* _mesa_function_pool[18434]: MultiDrawElementsEXT (will be remapped) */ + /* _mesa_function_pool[18467]: MultiDrawElementsEXT (will be remapped) */ "ipipi\0" "glMultiDrawElements\0" "glMultiDrawElementsEXT\0" "\0" - /* _mesa_function_pool[18484]: Color3s (offset 17) */ + /* _mesa_function_pool[18517]: Color3s (offset 17) */ "iii\0" "glColor3s\0" "\0" - /* _mesa_function_pool[18499]: Uniform1ivARB (will be remapped) */ + /* _mesa_function_pool[18532]: Uniform1ivARB (will be remapped) */ "iip\0" "glUniform1iv\0" "glUniform1ivARB\0" "\0" - /* _mesa_function_pool[18533]: WindowPos2sMESA (will be remapped) */ + /* _mesa_function_pool[18566]: WindowPos2sMESA (will be remapped) */ "ii\0" "glWindowPos2s\0" "glWindowPos2sARB\0" "glWindowPos2sMESA\0" "\0" - /* _mesa_function_pool[18586]: WeightusvARB (dynamic) */ + /* _mesa_function_pool[18619]: WeightusvARB (dynamic) */ "ip\0" "glWeightusvARB\0" "\0" - /* _mesa_function_pool[18605]: TexCoordPointer (offset 320) */ + /* _mesa_function_pool[18638]: TexCoordPointer (offset 320) */ "iiip\0" "glTexCoordPointer\0" "\0" - /* _mesa_function_pool[18629]: FogCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[18662]: FogCoordPointerEXT (will be remapped) */ "iip\0" "glFogCoordPointer\0" "glFogCoordPointerEXT\0" "\0" - /* _mesa_function_pool[18673]: IndexMaterialEXT (dynamic) */ + /* _mesa_function_pool[18706]: IndexMaterialEXT (dynamic) */ "ii\0" "glIndexMaterialEXT\0" "\0" - /* _mesa_function_pool[18696]: Color3i (offset 15) */ + /* _mesa_function_pool[18729]: Color3i (offset 15) */ "iii\0" "glColor3i\0" "\0" - /* _mesa_function_pool[18711]: FrontFace (offset 157) */ + /* _mesa_function_pool[18744]: FrontFace (offset 157) */ "i\0" "glFrontFace\0" "\0" - /* _mesa_function_pool[18726]: EvalCoord2d (offset 232) */ + /* _mesa_function_pool[18759]: EvalCoord2d (offset 232) */ "dd\0" "glEvalCoord2d\0" "\0" - /* _mesa_function_pool[18744]: SecondaryColor3ubvEXT (will be remapped) */ + /* _mesa_function_pool[18777]: SecondaryColor3ubvEXT (will be remapped) */ "p\0" "glSecondaryColor3ubv\0" "glSecondaryColor3ubvEXT\0" "\0" - /* _mesa_function_pool[18792]: EvalCoord2f (offset 234) */ + /* _mesa_function_pool[18825]: EvalCoord2f (offset 234) */ "ff\0" "glEvalCoord2f\0" "\0" - /* _mesa_function_pool[18810]: VertexAttrib4dvARB (will be remapped) */ + /* _mesa_function_pool[18843]: VertexAttrib4dvARB (will be remapped) */ "ip\0" "glVertexAttrib4dv\0" "glVertexAttrib4dvARB\0" "\0" - /* _mesa_function_pool[18853]: BindAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[18886]: BindAttribLocationARB (will be remapped) */ "iip\0" "glBindAttribLocation\0" "glBindAttribLocationARB\0" "\0" - /* _mesa_function_pool[18903]: Color3b (offset 9) */ + /* _mesa_function_pool[18936]: Color3b (offset 9) */ "iii\0" "glColor3b\0" "\0" - /* _mesa_function_pool[18918]: MultiTexCoord2dARB (offset 384) */ + /* _mesa_function_pool[18951]: MultiTexCoord2dARB (offset 384) */ "idd\0" "glMultiTexCoord2d\0" "glMultiTexCoord2dARB\0" "\0" - /* _mesa_function_pool[18962]: ExecuteProgramNV (will be remapped) */ + /* _mesa_function_pool[18995]: ExecuteProgramNV (will be remapped) */ "iip\0" "glExecuteProgramNV\0" "\0" - /* _mesa_function_pool[18986]: Color3f (offset 13) */ + /* _mesa_function_pool[19019]: Color3f (offset 13) */ "fff\0" "glColor3f\0" "\0" - /* _mesa_function_pool[19001]: LightEnviSGIX (dynamic) */ + /* _mesa_function_pool[19034]: LightEnviSGIX (dynamic) */ "ii\0" "glLightEnviSGIX\0" "\0" - /* _mesa_function_pool[19021]: Color3d (offset 11) */ + /* _mesa_function_pool[19054]: Color3d (offset 11) */ "ddd\0" "glColor3d\0" "\0" - /* _mesa_function_pool[19036]: Normal3dv (offset 55) */ + /* _mesa_function_pool[19069]: Normal3dv (offset 55) */ "p\0" "glNormal3dv\0" "\0" - /* _mesa_function_pool[19051]: Lightf (offset 159) */ + /* _mesa_function_pool[19084]: Lightf (offset 159) */ "iif\0" "glLightf\0" "\0" - /* _mesa_function_pool[19065]: ReplacementCodeuiSUN (dynamic) */ + /* _mesa_function_pool[19098]: ReplacementCodeuiSUN (dynamic) */ "i\0" "glReplacementCodeuiSUN\0" "\0" - /* _mesa_function_pool[19091]: MatrixMode (offset 293) */ + /* _mesa_function_pool[19124]: MatrixMode (offset 293) */ "i\0" "glMatrixMode\0" "\0" - /* _mesa_function_pool[19107]: GetPixelMapusv (offset 273) */ + /* _mesa_function_pool[19140]: GetPixelMapusv (offset 273) */ "ip\0" "glGetPixelMapusv\0" "\0" - /* _mesa_function_pool[19128]: Lighti (offset 161) */ + /* _mesa_function_pool[19161]: Lighti (offset 161) */ "iii\0" "glLighti\0" "\0" - /* _mesa_function_pool[19142]: VertexAttribPointerNV (will be remapped) */ + /* _mesa_function_pool[19175]: VertexAttribPointerNV (will be remapped) */ "iiiip\0" "glVertexAttribPointerNV\0" "\0" - /* _mesa_function_pool[19173]: GetBooleanIndexedvEXT (will be remapped) */ + /* _mesa_function_pool[19206]: GetBooleanIndexedvEXT (will be remapped) */ "iip\0" "glGetBooleanIndexedvEXT\0" "\0" - /* _mesa_function_pool[19202]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ + /* _mesa_function_pool[19235]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ "iiip\0" "glGetFramebufferAttachmentParameteriv\0" "glGetFramebufferAttachmentParameterivEXT\0" "\0" - /* _mesa_function_pool[19287]: PixelTransformParameterfEXT (dynamic) */ + /* _mesa_function_pool[19320]: PixelTransformParameterfEXT (dynamic) */ "iif\0" "glPixelTransformParameterfEXT\0" "\0" - /* _mesa_function_pool[19322]: MultiTexCoord4dvARB (offset 401) */ + /* _mesa_function_pool[19355]: MultiTexCoord4dvARB (offset 401) */ "ip\0" "glMultiTexCoord4dv\0" "glMultiTexCoord4dvARB\0" "\0" - /* _mesa_function_pool[19367]: PixelTransformParameteriEXT (dynamic) */ + /* _mesa_function_pool[19400]: PixelTransformParameteriEXT (dynamic) */ "iii\0" "glPixelTransformParameteriEXT\0" "\0" - /* _mesa_function_pool[19402]: GetDoublev (offset 260) */ + /* _mesa_function_pool[19435]: GetDoublev (offset 260) */ "ip\0" "glGetDoublev\0" "\0" - /* _mesa_function_pool[19419]: MultMatrixd (offset 295) */ + /* _mesa_function_pool[19452]: MultMatrixd (offset 295) */ "p\0" "glMultMatrixd\0" "\0" - /* _mesa_function_pool[19436]: MultMatrixf (offset 294) */ + /* _mesa_function_pool[19469]: MultMatrixf (offset 294) */ "p\0" "glMultMatrixf\0" "\0" - /* _mesa_function_pool[19453]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[19486]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ "ffiiiifff\0" "glTexCoord2fColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[19496]: Uniform1iARB (will be remapped) */ + /* _mesa_function_pool[19529]: Uniform1iARB (will be remapped) */ "ii\0" "glUniform1i\0" "glUniform1iARB\0" "\0" - /* _mesa_function_pool[19527]: VertexAttribPointerARB (will be remapped) */ + /* _mesa_function_pool[19560]: VertexAttribPointerARB (will be remapped) */ "iiiiip\0" "glVertexAttribPointer\0" "glVertexAttribPointerARB\0" "\0" - /* _mesa_function_pool[19582]: SharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[19615]: SharpenTexFuncSGIS (dynamic) */ "iip\0" "glSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[19608]: MultiTexCoord4fvARB (offset 403) */ + /* _mesa_function_pool[19641]: MultiTexCoord4fvARB (offset 403) */ "ip\0" "glMultiTexCoord4fv\0" "glMultiTexCoord4fvARB\0" "\0" - /* _mesa_function_pool[19653]: UniformMatrix2x3fv (will be remapped) */ + /* _mesa_function_pool[19686]: UniformMatrix2x3fv (will be remapped) */ "iiip\0" "glUniformMatrix2x3fv\0" "\0" - /* _mesa_function_pool[19680]: TrackMatrixNV (will be remapped) */ + /* _mesa_function_pool[19713]: TrackMatrixNV (will be remapped) */ "iiii\0" "glTrackMatrixNV\0" "\0" - /* _mesa_function_pool[19702]: CombinerParameteriNV (will be remapped) */ + /* _mesa_function_pool[19735]: CombinerParameteriNV (will be remapped) */ "ii\0" "glCombinerParameteriNV\0" "\0" - /* _mesa_function_pool[19729]: DeleteAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[19762]: DeleteAsyncMarkersSGIX (dynamic) */ "ii\0" "glDeleteAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[19758]: IsAsyncMarkerSGIX (dynamic) */ + /* _mesa_function_pool[19791]: IsAsyncMarkerSGIX (dynamic) */ "i\0" "glIsAsyncMarkerSGIX\0" "\0" - /* _mesa_function_pool[19781]: FrameZoomSGIX (dynamic) */ + /* _mesa_function_pool[19814]: FrameZoomSGIX (dynamic) */ "i\0" "glFrameZoomSGIX\0" "\0" - /* _mesa_function_pool[19800]: Normal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[19833]: Normal3fVertex3fvSUN (dynamic) */ "pp\0" "glNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[19827]: RasterPos4sv (offset 85) */ + /* _mesa_function_pool[19860]: RasterPos4sv (offset 85) */ "p\0" "glRasterPos4sv\0" "\0" - /* _mesa_function_pool[19845]: VertexAttrib4NsvARB (will be remapped) */ + /* _mesa_function_pool[19878]: VertexAttrib4NsvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nsv\0" "glVertexAttrib4NsvARB\0" "\0" - /* _mesa_function_pool[19890]: VertexAttrib3fvARB (will be remapped) */ + /* _mesa_function_pool[19923]: VertexAttrib3fvARB (will be remapped) */ "ip\0" "glVertexAttrib3fv\0" "glVertexAttrib3fvARB\0" "\0" - /* _mesa_function_pool[19933]: ClearColor (offset 206) */ + /* _mesa_function_pool[19966]: ClearColor (offset 206) */ "ffff\0" "glClearColor\0" "\0" - /* _mesa_function_pool[19952]: GetSynciv (will be remapped) */ + /* _mesa_function_pool[19985]: GetSynciv (will be remapped) */ "iiipp\0" "glGetSynciv\0" "\0" - /* _mesa_function_pool[19971]: DeleteFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[20004]: DeleteFramebuffersEXT (will be remapped) */ "ip\0" "glDeleteFramebuffers\0" "glDeleteFramebuffersEXT\0" "\0" - /* _mesa_function_pool[20020]: GlobalAlphaFactorsSUN (dynamic) */ + /* _mesa_function_pool[20053]: GlobalAlphaFactorsSUN (dynamic) */ "i\0" "glGlobalAlphaFactorsSUN\0" "\0" - /* _mesa_function_pool[20047]: IsEnabledIndexedEXT (will be remapped) */ + /* _mesa_function_pool[20080]: IsEnabledIndexedEXT (will be remapped) */ "ii\0" "glIsEnabledIndexedEXT\0" "\0" - /* _mesa_function_pool[20073]: TexEnviv (offset 187) */ + /* _mesa_function_pool[20106]: TexEnviv (offset 187) */ "iip\0" "glTexEnviv\0" "\0" - /* _mesa_function_pool[20089]: TexSubImage3D (offset 372) */ + /* _mesa_function_pool[20122]: TexSubImage3D (offset 372) */ "iiiiiiiiiip\0" "glTexSubImage3D\0" "glTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[20137]: Tangent3fEXT (dynamic) */ + /* _mesa_function_pool[20170]: Tangent3fEXT (dynamic) */ "fff\0" "glTangent3fEXT\0" "\0" - /* _mesa_function_pool[20157]: SecondaryColor3uivEXT (will be remapped) */ + /* _mesa_function_pool[20190]: SecondaryColor3uivEXT (will be remapped) */ "p\0" "glSecondaryColor3uiv\0" "glSecondaryColor3uivEXT\0" "\0" - /* _mesa_function_pool[20205]: MatrixIndexubvARB (dynamic) */ + /* _mesa_function_pool[20238]: MatrixIndexubvARB (dynamic) */ "ip\0" "glMatrixIndexubvARB\0" "\0" - /* _mesa_function_pool[20229]: Color4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[20262]: Color4fNormal3fVertex3fSUN (dynamic) */ "ffffffffff\0" "glColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[20270]: PixelTexGenParameterfSGIS (will be remapped) */ + /* _mesa_function_pool[20303]: PixelTexGenParameterfSGIS (will be remapped) */ "if\0" "glPixelTexGenParameterfSGIS\0" "\0" - /* _mesa_function_pool[20302]: CreateShader (will be remapped) */ + /* _mesa_function_pool[20335]: CreateShader (will be remapped) */ "i\0" "glCreateShader\0" "\0" - /* _mesa_function_pool[20320]: GetColorTableParameterfv (offset 344) */ + /* _mesa_function_pool[20353]: GetColorTableParameterfv (offset 344) */ "iip\0" "glGetColorTableParameterfv\0" "glGetColorTableParameterfvSGI\0" "glGetColorTableParameterfvEXT\0" "\0" - /* _mesa_function_pool[20412]: FragmentLightModelfvSGIX (dynamic) */ + /* _mesa_function_pool[20445]: FragmentLightModelfvSGIX (dynamic) */ "ip\0" "glFragmentLightModelfvSGIX\0" "\0" - /* _mesa_function_pool[20443]: Bitmap (offset 8) */ + /* _mesa_function_pool[20476]: Bitmap (offset 8) */ "iiffffp\0" "glBitmap\0" "\0" - /* _mesa_function_pool[20461]: MultiTexCoord3fARB (offset 394) */ + /* _mesa_function_pool[20494]: MultiTexCoord3fARB (offset 394) */ "ifff\0" "glMultiTexCoord3f\0" "glMultiTexCoord3fARB\0" "\0" - /* _mesa_function_pool[20506]: GetTexLevelParameterfv (offset 284) */ + /* _mesa_function_pool[20539]: GetTexLevelParameterfv (offset 284) */ "iiip\0" "glGetTexLevelParameterfv\0" "\0" - /* _mesa_function_pool[20537]: GetPixelTexGenParameterfvSGIS (will be remapped) */ + /* _mesa_function_pool[20570]: GetPixelTexGenParameterfvSGIS (will be remapped) */ "ip\0" "glGetPixelTexGenParameterfvSGIS\0" "\0" - /* _mesa_function_pool[20573]: GenFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[20606]: GenFramebuffersEXT (will be remapped) */ "ip\0" "glGenFramebuffers\0" "glGenFramebuffersEXT\0" "\0" - /* _mesa_function_pool[20616]: GetProgramParameterdvNV (will be remapped) */ + /* _mesa_function_pool[20649]: GetProgramParameterdvNV (will be remapped) */ "iiip\0" "glGetProgramParameterdvNV\0" "\0" - /* _mesa_function_pool[20648]: Vertex2sv (offset 133) */ + /* _mesa_function_pool[20681]: Vertex2sv (offset 133) */ "p\0" "glVertex2sv\0" "\0" - /* _mesa_function_pool[20663]: GetIntegerv (offset 263) */ + /* _mesa_function_pool[20696]: GetIntegerv (offset 263) */ "ip\0" "glGetIntegerv\0" "\0" - /* _mesa_function_pool[20681]: IsVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[20714]: IsVertexArrayAPPLE (will be remapped) */ "i\0" "glIsVertexArray\0" "glIsVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[20721]: FragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[20754]: FragmentLightfvSGIX (dynamic) */ "iip\0" "glFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[20748]: DetachShader (will be remapped) */ + /* _mesa_function_pool[20781]: DetachShader (will be remapped) */ "ii\0" "glDetachShader\0" "\0" - /* _mesa_function_pool[20767]: VertexAttrib4NubARB (will be remapped) */ + /* _mesa_function_pool[20800]: VertexAttrib4NubARB (will be remapped) */ "iiiii\0" "glVertexAttrib4Nub\0" "glVertexAttrib4NubARB\0" "\0" - /* _mesa_function_pool[20815]: GetProgramEnvParameterfvARB (will be remapped) */ + /* _mesa_function_pool[20848]: GetProgramEnvParameterfvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterfvARB\0" "\0" - /* _mesa_function_pool[20850]: GetTrackMatrixivNV (will be remapped) */ + /* _mesa_function_pool[20883]: GetTrackMatrixivNV (will be remapped) */ "iiip\0" "glGetTrackMatrixivNV\0" "\0" - /* _mesa_function_pool[20877]: VertexAttrib3svNV (will be remapped) */ + /* _mesa_function_pool[20910]: VertexAttrib3svNV (will be remapped) */ "ip\0" "glVertexAttrib3svNV\0" "\0" - /* _mesa_function_pool[20901]: Uniform4fvARB (will be remapped) */ + /* _mesa_function_pool[20934]: Uniform4fvARB (will be remapped) */ "iip\0" "glUniform4fv\0" "glUniform4fvARB\0" "\0" - /* _mesa_function_pool[20935]: MultTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[20968]: MultTransposeMatrixfARB (will be remapped) */ "p\0" "glMultTransposeMatrixf\0" "glMultTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[20987]: GetTexEnviv (offset 277) */ + /* _mesa_function_pool[21020]: GetTexEnviv (offset 277) */ "iip\0" "glGetTexEnviv\0" "\0" - /* _mesa_function_pool[21006]: ColorFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[21039]: ColorFragmentOp1ATI (will be remapped) */ "iiiiiii\0" "glColorFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[21037]: GetUniformfvARB (will be remapped) */ + /* _mesa_function_pool[21070]: GetUniformfvARB (will be remapped) */ "iip\0" "glGetUniformfv\0" "glGetUniformfvARB\0" "\0" - /* _mesa_function_pool[21075]: PopClientAttrib (offset 334) */ + /* _mesa_function_pool[21108]: EGLImageTargetRenderbufferStorageOES (will be remapped) */ + "ip\0" + "glEGLImageTargetRenderbufferStorageOES\0" + "\0" + /* _mesa_function_pool[21151]: PopClientAttrib (offset 334) */ "\0" "glPopClientAttrib\0" "\0" - /* _mesa_function_pool[21095]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[21171]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffffff\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[21166]: DetachObjectARB (will be remapped) */ + /* _mesa_function_pool[21242]: DetachObjectARB (will be remapped) */ "ii\0" "glDetachObjectARB\0" "\0" - /* _mesa_function_pool[21188]: VertexBlendARB (dynamic) */ + /* _mesa_function_pool[21264]: VertexBlendARB (dynamic) */ "i\0" "glVertexBlendARB\0" "\0" - /* _mesa_function_pool[21208]: WindowPos3iMESA (will be remapped) */ + /* _mesa_function_pool[21284]: WindowPos3iMESA (will be remapped) */ "iii\0" "glWindowPos3i\0" "glWindowPos3iARB\0" "glWindowPos3iMESA\0" "\0" - /* _mesa_function_pool[21262]: SeparableFilter2D (offset 360) */ + /* _mesa_function_pool[21338]: SeparableFilter2D (offset 360) */ "iiiiiipp\0" "glSeparableFilter2D\0" "glSeparableFilter2DEXT\0" "\0" - /* _mesa_function_pool[21315]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[21391]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[21360]: Map1d (offset 220) */ + /* _mesa_function_pool[21436]: Map1d (offset 220) */ "iddiip\0" "glMap1d\0" "\0" - /* _mesa_function_pool[21376]: Map1f (offset 221) */ + /* _mesa_function_pool[21452]: Map1f (offset 221) */ "iffiip\0" "glMap1f\0" "\0" - /* _mesa_function_pool[21392]: CompressedTexImage2DARB (will be remapped) */ + /* _mesa_function_pool[21468]: CompressedTexImage2DARB (will be remapped) */ "iiiiiiip\0" "glCompressedTexImage2D\0" "glCompressedTexImage2DARB\0" "\0" - /* _mesa_function_pool[21451]: ArrayElement (offset 306) */ + /* _mesa_function_pool[21527]: ArrayElement (offset 306) */ "i\0" "glArrayElement\0" "glArrayElementEXT\0" "\0" - /* _mesa_function_pool[21487]: TexImage2D (offset 183) */ + /* _mesa_function_pool[21563]: TexImage2D (offset 183) */ "iiiiiiiip\0" "glTexImage2D\0" "\0" - /* _mesa_function_pool[21511]: DepthBoundsEXT (will be remapped) */ + /* _mesa_function_pool[21587]: DepthBoundsEXT (will be remapped) */ "dd\0" "glDepthBoundsEXT\0" "\0" - /* _mesa_function_pool[21532]: ProgramParameters4fvNV (will be remapped) */ + /* _mesa_function_pool[21608]: ProgramParameters4fvNV (will be remapped) */ "iiip\0" "glProgramParameters4fvNV\0" "\0" - /* _mesa_function_pool[21563]: DeformationMap3fSGIX (dynamic) */ + /* _mesa_function_pool[21639]: DeformationMap3fSGIX (dynamic) */ "iffiiffiiffiip\0" "glDeformationMap3fSGIX\0" "\0" - /* _mesa_function_pool[21602]: GetProgramivNV (will be remapped) */ + /* _mesa_function_pool[21678]: GetProgramivNV (will be remapped) */ "iip\0" "glGetProgramivNV\0" "\0" - /* _mesa_function_pool[21624]: GetMinmaxParameteriv (offset 366) */ + /* _mesa_function_pool[21700]: GetMinmaxParameteriv (offset 366) */ "iip\0" "glGetMinmaxParameteriv\0" "glGetMinmaxParameterivEXT\0" "\0" - /* _mesa_function_pool[21678]: PixelTransferf (offset 247) */ + /* _mesa_function_pool[21754]: PixelTransferf (offset 247) */ "if\0" "glPixelTransferf\0" "\0" - /* _mesa_function_pool[21699]: CopyTexImage1D (offset 323) */ + /* _mesa_function_pool[21775]: CopyTexImage1D (offset 323) */ "iiiiiii\0" "glCopyTexImage1D\0" "glCopyTexImage1DEXT\0" "\0" - /* _mesa_function_pool[21745]: PushMatrix (offset 298) */ + /* _mesa_function_pool[21821]: PushMatrix (offset 298) */ "\0" "glPushMatrix\0" "\0" - /* _mesa_function_pool[21760]: Fogiv (offset 156) */ + /* _mesa_function_pool[21836]: Fogiv (offset 156) */ "ip\0" "glFogiv\0" "\0" - /* _mesa_function_pool[21772]: TexCoord1dv (offset 95) */ + /* _mesa_function_pool[21848]: TexCoord1dv (offset 95) */ "p\0" "glTexCoord1dv\0" "\0" - /* _mesa_function_pool[21789]: AlphaFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[21865]: AlphaFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiii\0" "glAlphaFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[21825]: PixelTransferi (offset 248) */ + /* _mesa_function_pool[21901]: PixelTransferi (offset 248) */ "ii\0" "glPixelTransferi\0" "\0" - /* _mesa_function_pool[21846]: GetVertexAttribdvNV (will be remapped) */ + /* _mesa_function_pool[21922]: GetVertexAttribdvNV (will be remapped) */ "iip\0" "glGetVertexAttribdvNV\0" "\0" - /* _mesa_function_pool[21873]: VertexAttrib3fvNV (will be remapped) */ + /* _mesa_function_pool[21949]: VertexAttrib3fvNV (will be remapped) */ "ip\0" "glVertexAttrib3fvNV\0" "\0" - /* _mesa_function_pool[21897]: Rotatef (offset 300) */ + /* _mesa_function_pool[21973]: Rotatef (offset 300) */ "ffff\0" "glRotatef\0" "\0" - /* _mesa_function_pool[21913]: GetFinalCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[21989]: GetFinalCombinerInputParameterivNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[21955]: Vertex3i (offset 138) */ + /* _mesa_function_pool[22031]: Vertex3i (offset 138) */ "iii\0" "glVertex3i\0" "\0" - /* _mesa_function_pool[21971]: Vertex3f (offset 136) */ + /* _mesa_function_pool[22047]: Vertex3f (offset 136) */ "fff\0" "glVertex3f\0" "\0" - /* _mesa_function_pool[21987]: Clear (offset 203) */ + /* _mesa_function_pool[22063]: Clear (offset 203) */ "i\0" "glClear\0" "\0" - /* _mesa_function_pool[21998]: Vertex3d (offset 134) */ + /* _mesa_function_pool[22074]: Vertex3d (offset 134) */ "ddd\0" "glVertex3d\0" "\0" - /* _mesa_function_pool[22014]: GetMapParameterivNV (dynamic) */ + /* _mesa_function_pool[22090]: GetMapParameterivNV (dynamic) */ "iip\0" "glGetMapParameterivNV\0" "\0" - /* _mesa_function_pool[22041]: Uniform4iARB (will be remapped) */ + /* _mesa_function_pool[22117]: Uniform4iARB (will be remapped) */ "iiiii\0" "glUniform4i\0" "glUniform4iARB\0" "\0" - /* _mesa_function_pool[22075]: ReadBuffer (offset 254) */ + /* _mesa_function_pool[22151]: ReadBuffer (offset 254) */ "i\0" "glReadBuffer\0" "\0" - /* _mesa_function_pool[22091]: ConvolutionParameteri (offset 352) */ + /* _mesa_function_pool[22167]: ConvolutionParameteri (offset 352) */ "iii\0" "glConvolutionParameteri\0" "glConvolutionParameteriEXT\0" "\0" - /* _mesa_function_pool[22147]: Ortho (offset 296) */ + /* _mesa_function_pool[22223]: Ortho (offset 296) */ "dddddd\0" "glOrtho\0" "\0" - /* _mesa_function_pool[22163]: Binormal3sEXT (dynamic) */ + /* _mesa_function_pool[22239]: Binormal3sEXT (dynamic) */ "iii\0" "glBinormal3sEXT\0" "\0" - /* _mesa_function_pool[22184]: ListBase (offset 6) */ + /* _mesa_function_pool[22260]: ListBase (offset 6) */ "i\0" "glListBase\0" "\0" - /* _mesa_function_pool[22198]: Vertex3s (offset 140) */ + /* _mesa_function_pool[22274]: Vertex3s (offset 140) */ "iii\0" "glVertex3s\0" "\0" - /* _mesa_function_pool[22214]: ConvolutionParameterf (offset 350) */ + /* _mesa_function_pool[22290]: ConvolutionParameterf (offset 350) */ "iif\0" "glConvolutionParameterf\0" "glConvolutionParameterfEXT\0" "\0" - /* _mesa_function_pool[22270]: GetColorTableParameteriv (offset 345) */ + /* _mesa_function_pool[22346]: GetColorTableParameteriv (offset 345) */ "iip\0" "glGetColorTableParameteriv\0" "glGetColorTableParameterivSGI\0" "glGetColorTableParameterivEXT\0" "\0" - /* _mesa_function_pool[22362]: ProgramEnvParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[22438]: ProgramEnvParameter4dvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4dvARB\0" "glProgramParameter4dvNV\0" "\0" - /* _mesa_function_pool[22419]: ShadeModel (offset 177) */ + /* _mesa_function_pool[22495]: ShadeModel (offset 177) */ "i\0" "glShadeModel\0" "\0" - /* _mesa_function_pool[22435]: VertexAttribs2fvNV (will be remapped) */ + /* _mesa_function_pool[22511]: VertexAttribs2fvNV (will be remapped) */ "iip\0" "glVertexAttribs2fvNV\0" "\0" - /* _mesa_function_pool[22461]: Rectiv (offset 91) */ + /* _mesa_function_pool[22537]: Rectiv (offset 91) */ "pp\0" "glRectiv\0" "\0" - /* _mesa_function_pool[22474]: UseProgramObjectARB (will be remapped) */ + /* _mesa_function_pool[22550]: UseProgramObjectARB (will be remapped) */ "i\0" "glUseProgram\0" "glUseProgramObjectARB\0" "\0" - /* _mesa_function_pool[22512]: GetMapParameterfvNV (dynamic) */ + /* _mesa_function_pool[22588]: GetMapParameterfvNV (dynamic) */ "iip\0" "glGetMapParameterfvNV\0" "\0" - /* _mesa_function_pool[22539]: EndConditionalRenderNV (will be remapped) */ + /* _mesa_function_pool[22615]: EndConditionalRenderNV (will be remapped) */ "\0" "glEndConditionalRenderNV\0" "\0" - /* _mesa_function_pool[22566]: PassTexCoordATI (will be remapped) */ + /* _mesa_function_pool[22642]: PassTexCoordATI (will be remapped) */ "iii\0" "glPassTexCoordATI\0" "\0" - /* _mesa_function_pool[22589]: DeleteProgram (will be remapped) */ + /* _mesa_function_pool[22665]: DeleteProgram (will be remapped) */ "i\0" "glDeleteProgram\0" "\0" - /* _mesa_function_pool[22608]: Tangent3ivEXT (dynamic) */ + /* _mesa_function_pool[22684]: Tangent3ivEXT (dynamic) */ "p\0" "glTangent3ivEXT\0" "\0" - /* _mesa_function_pool[22627]: Tangent3dEXT (dynamic) */ + /* _mesa_function_pool[22703]: Tangent3dEXT (dynamic) */ "ddd\0" "glTangent3dEXT\0" "\0" - /* _mesa_function_pool[22647]: SecondaryColor3dvEXT (will be remapped) */ + /* _mesa_function_pool[22723]: SecondaryColor3dvEXT (will be remapped) */ "p\0" "glSecondaryColor3dv\0" "glSecondaryColor3dvEXT\0" "\0" - /* _mesa_function_pool[22693]: Vertex2fv (offset 129) */ + /* _mesa_function_pool[22769]: Vertex2fv (offset 129) */ "p\0" "glVertex2fv\0" "\0" - /* _mesa_function_pool[22708]: MultiDrawArraysEXT (will be remapped) */ + /* _mesa_function_pool[22784]: MultiDrawArraysEXT (will be remapped) */ "ippi\0" "glMultiDrawArrays\0" "glMultiDrawArraysEXT\0" "\0" - /* _mesa_function_pool[22753]: BindRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[22829]: BindRenderbufferEXT (will be remapped) */ "ii\0" "glBindRenderbuffer\0" "glBindRenderbufferEXT\0" "\0" - /* _mesa_function_pool[22798]: MultiTexCoord4dARB (offset 400) */ + /* _mesa_function_pool[22874]: MultiTexCoord4dARB (offset 400) */ "idddd\0" "glMultiTexCoord4d\0" "glMultiTexCoord4dARB\0" "\0" - /* _mesa_function_pool[22844]: Vertex3sv (offset 141) */ + /* _mesa_function_pool[22920]: Vertex3sv (offset 141) */ "p\0" "glVertex3sv\0" "\0" - /* _mesa_function_pool[22859]: SecondaryColor3usEXT (will be remapped) */ + /* _mesa_function_pool[22935]: SecondaryColor3usEXT (will be remapped) */ "iii\0" "glSecondaryColor3us\0" "glSecondaryColor3usEXT\0" "\0" - /* _mesa_function_pool[22907]: ProgramLocalParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[22983]: ProgramLocalParameter4fvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4fvARB\0" "\0" - /* _mesa_function_pool[22942]: DeleteProgramsNV (will be remapped) */ + /* _mesa_function_pool[23018]: DeleteProgramsNV (will be remapped) */ "ip\0" "glDeleteProgramsARB\0" "glDeleteProgramsNV\0" "\0" - /* _mesa_function_pool[22985]: EvalMesh1 (offset 236) */ + /* _mesa_function_pool[23061]: EvalMesh1 (offset 236) */ "iii\0" "glEvalMesh1\0" "\0" - /* _mesa_function_pool[23002]: MultiTexCoord1sARB (offset 382) */ + /* _mesa_function_pool[23078]: MultiTexCoord1sARB (offset 382) */ "ii\0" "glMultiTexCoord1s\0" "glMultiTexCoord1sARB\0" "\0" - /* _mesa_function_pool[23045]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[23121]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ "iffffff\0" "glReplacementCodeuiColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[23092]: GetVertexAttribPointervNV (will be remapped) */ + /* _mesa_function_pool[23168]: GetVertexAttribPointervNV (will be remapped) */ "iip\0" "glGetVertexAttribPointerv\0" "glGetVertexAttribPointervARB\0" "glGetVertexAttribPointervNV\0" "\0" - /* _mesa_function_pool[23180]: DisableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[23256]: DisableIndexedEXT (will be remapped) */ "ii\0" "glDisableIndexedEXT\0" "\0" - /* _mesa_function_pool[23204]: MultiTexCoord1dvARB (offset 377) */ + /* _mesa_function_pool[23280]: MultiTexCoord1dvARB (offset 377) */ "ip\0" "glMultiTexCoord1dv\0" "glMultiTexCoord1dvARB\0" "\0" - /* _mesa_function_pool[23249]: Uniform2iARB (will be remapped) */ + /* _mesa_function_pool[23325]: Uniform2iARB (will be remapped) */ "iii\0" "glUniform2i\0" "glUniform2iARB\0" "\0" - /* _mesa_function_pool[23281]: Vertex2iv (offset 131) */ + /* _mesa_function_pool[23357]: Vertex2iv (offset 131) */ "p\0" "glVertex2iv\0" "\0" - /* _mesa_function_pool[23296]: GetProgramStringNV (will be remapped) */ + /* _mesa_function_pool[23372]: GetProgramStringNV (will be remapped) */ "iip\0" "glGetProgramStringNV\0" "\0" - /* _mesa_function_pool[23322]: ColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[23398]: ColorPointerEXT (will be remapped) */ "iiiip\0" "glColorPointerEXT\0" "\0" - /* _mesa_function_pool[23347]: LineWidth (offset 168) */ + /* _mesa_function_pool[23423]: LineWidth (offset 168) */ "f\0" "glLineWidth\0" "\0" - /* _mesa_function_pool[23362]: MapBufferARB (will be remapped) */ + /* _mesa_function_pool[23438]: MapBufferARB (will be remapped) */ "ii\0" "glMapBuffer\0" "glMapBufferARB\0" "\0" - /* _mesa_function_pool[23393]: MultiDrawElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[23469]: MultiDrawElementsBaseVertex (will be remapped) */ "ipipip\0" "glMultiDrawElementsBaseVertex\0" "\0" - /* _mesa_function_pool[23431]: Binormal3svEXT (dynamic) */ + /* _mesa_function_pool[23507]: Binormal3svEXT (dynamic) */ "p\0" "glBinormal3svEXT\0" "\0" - /* _mesa_function_pool[23451]: ApplyTextureEXT (dynamic) */ + /* _mesa_function_pool[23527]: ApplyTextureEXT (dynamic) */ "i\0" "glApplyTextureEXT\0" "\0" - /* _mesa_function_pool[23472]: TexGendv (offset 189) */ + /* _mesa_function_pool[23548]: TexGendv (offset 189) */ "iip\0" "glTexGendv\0" "\0" - /* _mesa_function_pool[23488]: EnableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[23564]: EnableIndexedEXT (will be remapped) */ "ii\0" "glEnableIndexedEXT\0" "\0" - /* _mesa_function_pool[23511]: TextureMaterialEXT (dynamic) */ + /* _mesa_function_pool[23587]: TextureMaterialEXT (dynamic) */ "ii\0" "glTextureMaterialEXT\0" "\0" - /* _mesa_function_pool[23536]: TextureLightEXT (dynamic) */ + /* _mesa_function_pool[23612]: TextureLightEXT (dynamic) */ "i\0" "glTextureLightEXT\0" "\0" - /* _mesa_function_pool[23557]: ResetMinmax (offset 370) */ + /* _mesa_function_pool[23633]: ResetMinmax (offset 370) */ "i\0" "glResetMinmax\0" "glResetMinmaxEXT\0" "\0" - /* _mesa_function_pool[23591]: SpriteParameterfSGIX (dynamic) */ + /* _mesa_function_pool[23667]: SpriteParameterfSGIX (dynamic) */ "if\0" "glSpriteParameterfSGIX\0" "\0" - /* _mesa_function_pool[23618]: EnableClientState (offset 313) */ + /* _mesa_function_pool[23694]: EnableClientState (offset 313) */ "i\0" "glEnableClientState\0" "\0" - /* _mesa_function_pool[23641]: VertexAttrib4sNV (will be remapped) */ + /* _mesa_function_pool[23717]: VertexAttrib4sNV (will be remapped) */ "iiiii\0" "glVertexAttrib4sNV\0" "\0" - /* _mesa_function_pool[23667]: GetConvolutionParameterfv (offset 357) */ + /* _mesa_function_pool[23743]: GetConvolutionParameterfv (offset 357) */ "iip\0" "glGetConvolutionParameterfv\0" "glGetConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[23731]: VertexAttribs4dvNV (will be remapped) */ + /* _mesa_function_pool[23807]: VertexAttribs4dvNV (will be remapped) */ "iip\0" "glVertexAttribs4dvNV\0" "\0" - /* _mesa_function_pool[23757]: MultiModeDrawArraysIBM (will be remapped) */ + /* _mesa_function_pool[23833]: MultiModeDrawArraysIBM (will be remapped) */ "pppii\0" "glMultiModeDrawArraysIBM\0" "\0" - /* _mesa_function_pool[23789]: VertexAttrib4dARB (will be remapped) */ + /* _mesa_function_pool[23865]: VertexAttrib4dARB (will be remapped) */ "idddd\0" "glVertexAttrib4d\0" "glVertexAttrib4dARB\0" "\0" - /* _mesa_function_pool[23833]: GetTexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[23909]: GetTexBumpParameterfvATI (will be remapped) */ "ip\0" "glGetTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[23864]: ProgramNamedParameter4dNV (will be remapped) */ + /* _mesa_function_pool[23940]: ProgramNamedParameter4dNV (will be remapped) */ "iipdddd\0" "glProgramNamedParameter4dNV\0" "\0" - /* _mesa_function_pool[23901]: GetMaterialfv (offset 269) */ + /* _mesa_function_pool[23977]: GetMaterialfv (offset 269) */ "iip\0" "glGetMaterialfv\0" "\0" - /* _mesa_function_pool[23922]: VertexWeightfEXT (dynamic) */ + /* _mesa_function_pool[23998]: VertexWeightfEXT (dynamic) */ "f\0" "glVertexWeightfEXT\0" "\0" - /* _mesa_function_pool[23944]: Binormal3fEXT (dynamic) */ + /* _mesa_function_pool[24020]: Binormal3fEXT (dynamic) */ "fff\0" "glBinormal3fEXT\0" "\0" - /* _mesa_function_pool[23965]: CallList (offset 2) */ + /* _mesa_function_pool[24041]: CallList (offset 2) */ "i\0" "glCallList\0" "\0" - /* _mesa_function_pool[23979]: Materialfv (offset 170) */ + /* _mesa_function_pool[24055]: Materialfv (offset 170) */ "iip\0" "glMaterialfv\0" "\0" - /* _mesa_function_pool[23997]: TexCoord3fv (offset 113) */ + /* _mesa_function_pool[24073]: TexCoord3fv (offset 113) */ "p\0" "glTexCoord3fv\0" "\0" - /* _mesa_function_pool[24014]: FogCoordfvEXT (will be remapped) */ + /* _mesa_function_pool[24090]: FogCoordfvEXT (will be remapped) */ "p\0" "glFogCoordfv\0" "glFogCoordfvEXT\0" "\0" - /* _mesa_function_pool[24046]: MultiTexCoord1ivARB (offset 381) */ + /* _mesa_function_pool[24122]: MultiTexCoord1ivARB (offset 381) */ "ip\0" "glMultiTexCoord1iv\0" "glMultiTexCoord1ivARB\0" "\0" - /* _mesa_function_pool[24091]: SecondaryColor3ubEXT (will be remapped) */ + /* _mesa_function_pool[24167]: SecondaryColor3ubEXT (will be remapped) */ "iii\0" "glSecondaryColor3ub\0" "glSecondaryColor3ubEXT\0" "\0" - /* _mesa_function_pool[24139]: MultiTexCoord2ivARB (offset 389) */ + /* _mesa_function_pool[24215]: MultiTexCoord2ivARB (offset 389) */ "ip\0" "glMultiTexCoord2iv\0" "glMultiTexCoord2ivARB\0" "\0" - /* _mesa_function_pool[24184]: FogFuncSGIS (dynamic) */ + /* _mesa_function_pool[24260]: FogFuncSGIS (dynamic) */ "ip\0" "glFogFuncSGIS\0" "\0" - /* _mesa_function_pool[24202]: CopyTexSubImage2D (offset 326) */ + /* _mesa_function_pool[24278]: CopyTexSubImage2D (offset 326) */ "iiiiiiii\0" "glCopyTexSubImage2D\0" "glCopyTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[24255]: GetObjectParameterivARB (will be remapped) */ + /* _mesa_function_pool[24331]: GetObjectParameterivARB (will be remapped) */ "iip\0" "glGetObjectParameterivARB\0" "\0" - /* _mesa_function_pool[24286]: Color3iv (offset 16) */ + /* _mesa_function_pool[24362]: Color3iv (offset 16) */ "p\0" "glColor3iv\0" "\0" - /* _mesa_function_pool[24300]: TexCoord4fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[24376]: TexCoord4fVertex4fSUN (dynamic) */ "ffffffff\0" "glTexCoord4fVertex4fSUN\0" "\0" - /* _mesa_function_pool[24334]: DrawElements (offset 311) */ + /* _mesa_function_pool[24410]: DrawElements (offset 311) */ "iiip\0" "glDrawElements\0" "\0" - /* _mesa_function_pool[24355]: BindVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[24431]: BindVertexArrayAPPLE (will be remapped) */ "i\0" "glBindVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[24381]: GetProgramLocalParameterdvARB (will be remapped) */ + /* _mesa_function_pool[24457]: GetProgramLocalParameterdvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterdvARB\0" "\0" - /* _mesa_function_pool[24418]: GetHistogramParameteriv (offset 363) */ + /* _mesa_function_pool[24494]: GetHistogramParameteriv (offset 363) */ "iip\0" "glGetHistogramParameteriv\0" "glGetHistogramParameterivEXT\0" "\0" - /* _mesa_function_pool[24478]: MultiTexCoord1iARB (offset 380) */ + /* _mesa_function_pool[24554]: MultiTexCoord1iARB (offset 380) */ "ii\0" "glMultiTexCoord1i\0" "glMultiTexCoord1iARB\0" "\0" - /* _mesa_function_pool[24521]: GetConvolutionFilter (offset 356) */ + /* _mesa_function_pool[24597]: GetConvolutionFilter (offset 356) */ "iiip\0" "glGetConvolutionFilter\0" "glGetConvolutionFilterEXT\0" "\0" - /* _mesa_function_pool[24576]: GetProgramivARB (will be remapped) */ + /* _mesa_function_pool[24652]: GetProgramivARB (will be remapped) */ "iip\0" "glGetProgramivARB\0" "\0" - /* _mesa_function_pool[24599]: BlendFuncSeparateEXT (will be remapped) */ + /* _mesa_function_pool[24675]: BlendFuncSeparateEXT (will be remapped) */ "iiii\0" "glBlendFuncSeparate\0" "glBlendFuncSeparateEXT\0" "glBlendFuncSeparateINGR\0" "\0" - /* _mesa_function_pool[24672]: MapBufferRange (will be remapped) */ + /* _mesa_function_pool[24748]: MapBufferRange (will be remapped) */ "iiii\0" "glMapBufferRange\0" "\0" - /* _mesa_function_pool[24695]: ProgramParameters4dvNV (will be remapped) */ + /* _mesa_function_pool[24771]: ProgramParameters4dvNV (will be remapped) */ "iiip\0" "glProgramParameters4dvNV\0" "\0" - /* _mesa_function_pool[24726]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[24802]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[24763]: EvalPoint2 (offset 239) */ + /* _mesa_function_pool[24839]: EvalPoint2 (offset 239) */ "ii\0" "glEvalPoint2\0" "\0" - /* _mesa_function_pool[24780]: EvalPoint1 (offset 237) */ + /* _mesa_function_pool[24856]: EvalPoint1 (offset 237) */ "i\0" "glEvalPoint1\0" "\0" - /* _mesa_function_pool[24796]: Binormal3dvEXT (dynamic) */ + /* _mesa_function_pool[24872]: Binormal3dvEXT (dynamic) */ "p\0" "glBinormal3dvEXT\0" "\0" - /* _mesa_function_pool[24816]: PopMatrix (offset 297) */ + /* _mesa_function_pool[24892]: PopMatrix (offset 297) */ "\0" "glPopMatrix\0" "\0" - /* _mesa_function_pool[24830]: FinishFenceNV (will be remapped) */ + /* _mesa_function_pool[24906]: FinishFenceNV (will be remapped) */ "i\0" "glFinishFenceNV\0" "\0" - /* _mesa_function_pool[24849]: GetFogFuncSGIS (dynamic) */ + /* _mesa_function_pool[24925]: GetFogFuncSGIS (dynamic) */ "p\0" "glGetFogFuncSGIS\0" "\0" - /* _mesa_function_pool[24869]: GetUniformLocationARB (will be remapped) */ + /* _mesa_function_pool[24945]: GetUniformLocationARB (will be remapped) */ "ip\0" "glGetUniformLocation\0" "glGetUniformLocationARB\0" "\0" - /* _mesa_function_pool[24918]: SecondaryColor3fEXT (will be remapped) */ + /* _mesa_function_pool[24994]: SecondaryColor3fEXT (will be remapped) */ "fff\0" "glSecondaryColor3f\0" "glSecondaryColor3fEXT\0" "\0" - /* _mesa_function_pool[24964]: GetTexGeniv (offset 280) */ + /* _mesa_function_pool[25040]: GetTexGeniv (offset 280) */ "iip\0" "glGetTexGeniv\0" "\0" - /* _mesa_function_pool[24983]: CombinerInputNV (will be remapped) */ + /* _mesa_function_pool[25059]: CombinerInputNV (will be remapped) */ "iiiiii\0" "glCombinerInputNV\0" "\0" - /* _mesa_function_pool[25009]: VertexAttrib3sARB (will be remapped) */ + /* _mesa_function_pool[25085]: VertexAttrib3sARB (will be remapped) */ "iiii\0" "glVertexAttrib3s\0" "glVertexAttrib3sARB\0" "\0" - /* _mesa_function_pool[25052]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[25128]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[25097]: Map2d (offset 222) */ + /* _mesa_function_pool[25173]: Map2d (offset 222) */ "iddiiddiip\0" "glMap2d\0" "\0" - /* _mesa_function_pool[25117]: Map2f (offset 223) */ + /* _mesa_function_pool[25193]: Map2f (offset 223) */ "iffiiffiip\0" "glMap2f\0" "\0" - /* _mesa_function_pool[25137]: ProgramStringARB (will be remapped) */ + /* _mesa_function_pool[25213]: ProgramStringARB (will be remapped) */ "iiip\0" "glProgramStringARB\0" "\0" - /* _mesa_function_pool[25162]: Vertex4s (offset 148) */ + /* _mesa_function_pool[25238]: Vertex4s (offset 148) */ "iiii\0" "glVertex4s\0" "\0" - /* _mesa_function_pool[25179]: TexCoord4fVertex4fvSUN (dynamic) */ + /* _mesa_function_pool[25255]: TexCoord4fVertex4fvSUN (dynamic) */ "pp\0" "glTexCoord4fVertex4fvSUN\0" "\0" - /* _mesa_function_pool[25208]: VertexAttrib3sNV (will be remapped) */ + /* _mesa_function_pool[25284]: VertexAttrib3sNV (will be remapped) */ "iiii\0" "glVertexAttrib3sNV\0" "\0" - /* _mesa_function_pool[25233]: VertexAttrib1fNV (will be remapped) */ + /* _mesa_function_pool[25309]: VertexAttrib1fNV (will be remapped) */ "if\0" "glVertexAttrib1fNV\0" "\0" - /* _mesa_function_pool[25256]: Vertex4f (offset 144) */ + /* _mesa_function_pool[25332]: Vertex4f (offset 144) */ "ffff\0" "glVertex4f\0" "\0" - /* _mesa_function_pool[25273]: EvalCoord1d (offset 228) */ + /* _mesa_function_pool[25349]: EvalCoord1d (offset 228) */ "d\0" "glEvalCoord1d\0" "\0" - /* _mesa_function_pool[25290]: Vertex4d (offset 142) */ + /* _mesa_function_pool[25366]: Vertex4d (offset 142) */ "dddd\0" "glVertex4d\0" "\0" - /* _mesa_function_pool[25307]: RasterPos4dv (offset 79) */ + /* _mesa_function_pool[25383]: RasterPos4dv (offset 79) */ "p\0" "glRasterPos4dv\0" "\0" - /* _mesa_function_pool[25325]: FragmentLightfSGIX (dynamic) */ + /* _mesa_function_pool[25401]: FragmentLightfSGIX (dynamic) */ "iif\0" "glFragmentLightfSGIX\0" "\0" - /* _mesa_function_pool[25351]: GetCompressedTexImageARB (will be remapped) */ + /* _mesa_function_pool[25427]: GetCompressedTexImageARB (will be remapped) */ "iip\0" "glGetCompressedTexImage\0" "glGetCompressedTexImageARB\0" "\0" - /* _mesa_function_pool[25407]: GetTexGenfv (offset 279) */ + /* _mesa_function_pool[25483]: GetTexGenfv (offset 279) */ "iip\0" "glGetTexGenfv\0" "\0" - /* _mesa_function_pool[25426]: Vertex4i (offset 146) */ + /* _mesa_function_pool[25502]: Vertex4i (offset 146) */ "iiii\0" "glVertex4i\0" "\0" - /* _mesa_function_pool[25443]: VertexWeightPointerEXT (dynamic) */ + /* _mesa_function_pool[25519]: VertexWeightPointerEXT (dynamic) */ "iiip\0" "glVertexWeightPointerEXT\0" "\0" - /* _mesa_function_pool[25474]: GetHistogram (offset 361) */ + /* _mesa_function_pool[25550]: GetHistogram (offset 361) */ "iiiip\0" "glGetHistogram\0" "glGetHistogramEXT\0" "\0" - /* _mesa_function_pool[25514]: ActiveStencilFaceEXT (will be remapped) */ + /* _mesa_function_pool[25590]: ActiveStencilFaceEXT (will be remapped) */ "i\0" "glActiveStencilFaceEXT\0" "\0" - /* _mesa_function_pool[25540]: StencilFuncSeparateATI (will be remapped) */ + /* _mesa_function_pool[25616]: StencilFuncSeparateATI (will be remapped) */ "iiii\0" "glStencilFuncSeparateATI\0" "\0" - /* _mesa_function_pool[25571]: Materialf (offset 169) */ + /* _mesa_function_pool[25647]: Materialf (offset 169) */ "iif\0" "glMaterialf\0" "\0" - /* _mesa_function_pool[25588]: GetShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[25664]: GetShaderSourceARB (will be remapped) */ "iipp\0" "glGetShaderSource\0" "glGetShaderSourceARB\0" "\0" - /* _mesa_function_pool[25633]: IglooInterfaceSGIX (dynamic) */ + /* _mesa_function_pool[25709]: IglooInterfaceSGIX (dynamic) */ "ip\0" "glIglooInterfaceSGIX\0" "\0" - /* _mesa_function_pool[25658]: Materiali (offset 171) */ + /* _mesa_function_pool[25734]: Materiali (offset 171) */ "iii\0" "glMateriali\0" "\0" - /* _mesa_function_pool[25675]: VertexAttrib4dNV (will be remapped) */ + /* _mesa_function_pool[25751]: VertexAttrib4dNV (will be remapped) */ "idddd\0" "glVertexAttrib4dNV\0" "\0" - /* _mesa_function_pool[25701]: MultiModeDrawElementsIBM (will be remapped) */ + /* _mesa_function_pool[25777]: MultiModeDrawElementsIBM (will be remapped) */ "ppipii\0" "glMultiModeDrawElementsIBM\0" "\0" - /* _mesa_function_pool[25736]: Indexsv (offset 51) */ + /* _mesa_function_pool[25812]: Indexsv (offset 51) */ "p\0" "glIndexsv\0" "\0" - /* _mesa_function_pool[25749]: MultiTexCoord4svARB (offset 407) */ + /* _mesa_function_pool[25825]: MultiTexCoord4svARB (offset 407) */ "ip\0" "glMultiTexCoord4sv\0" "glMultiTexCoord4svARB\0" "\0" - /* _mesa_function_pool[25794]: LightModelfv (offset 164) */ + /* _mesa_function_pool[25870]: LightModelfv (offset 164) */ "ip\0" "glLightModelfv\0" "\0" - /* _mesa_function_pool[25813]: TexCoord2dv (offset 103) */ + /* _mesa_function_pool[25889]: TexCoord2dv (offset 103) */ "p\0" "glTexCoord2dv\0" "\0" - /* _mesa_function_pool[25830]: GenQueriesARB (will be remapped) */ + /* _mesa_function_pool[25906]: GenQueriesARB (will be remapped) */ "ip\0" "glGenQueries\0" "glGenQueriesARB\0" "\0" - /* _mesa_function_pool[25863]: EvalCoord1dv (offset 229) */ + /* _mesa_function_pool[25939]: EvalCoord1dv (offset 229) */ "p\0" "glEvalCoord1dv\0" "\0" - /* _mesa_function_pool[25881]: ReplacementCodeuiVertex3fSUN (dynamic) */ + /* _mesa_function_pool[25957]: ReplacementCodeuiVertex3fSUN (dynamic) */ "ifff\0" "glReplacementCodeuiVertex3fSUN\0" "\0" - /* _mesa_function_pool[25918]: Translated (offset 303) */ + /* _mesa_function_pool[25994]: Translated (offset 303) */ "ddd\0" "glTranslated\0" "\0" - /* _mesa_function_pool[25936]: Translatef (offset 304) */ + /* _mesa_function_pool[26012]: Translatef (offset 304) */ "fff\0" "glTranslatef\0" "\0" - /* _mesa_function_pool[25954]: StencilMask (offset 209) */ + /* _mesa_function_pool[26030]: StencilMask (offset 209) */ "i\0" "glStencilMask\0" "\0" - /* _mesa_function_pool[25971]: Tangent3iEXT (dynamic) */ + /* _mesa_function_pool[26047]: Tangent3iEXT (dynamic) */ "iii\0" "glTangent3iEXT\0" "\0" - /* _mesa_function_pool[25991]: GetLightiv (offset 265) */ + /* _mesa_function_pool[26067]: GetLightiv (offset 265) */ "iip\0" "glGetLightiv\0" "\0" - /* _mesa_function_pool[26009]: DrawMeshArraysSUN (dynamic) */ + /* _mesa_function_pool[26085]: DrawMeshArraysSUN (dynamic) */ "iiii\0" "glDrawMeshArraysSUN\0" "\0" - /* _mesa_function_pool[26035]: IsList (offset 287) */ + /* _mesa_function_pool[26111]: IsList (offset 287) */ "i\0" "glIsList\0" "\0" - /* _mesa_function_pool[26047]: IsSync (will be remapped) */ + /* _mesa_function_pool[26123]: IsSync (will be remapped) */ "i\0" "glIsSync\0" "\0" - /* _mesa_function_pool[26059]: RenderMode (offset 196) */ + /* _mesa_function_pool[26135]: RenderMode (offset 196) */ "i\0" "glRenderMode\0" "\0" - /* _mesa_function_pool[26075]: GetMapControlPointsNV (dynamic) */ + /* _mesa_function_pool[26151]: GetMapControlPointsNV (dynamic) */ "iiiiiip\0" "glGetMapControlPointsNV\0" "\0" - /* _mesa_function_pool[26108]: DrawBuffersARB (will be remapped) */ + /* _mesa_function_pool[26184]: DrawBuffersARB (will be remapped) */ "ip\0" "glDrawBuffers\0" "glDrawBuffersARB\0" "glDrawBuffersATI\0" "\0" - /* _mesa_function_pool[26160]: ProgramLocalParameter4fARB (will be remapped) */ + /* _mesa_function_pool[26236]: ProgramLocalParameter4fARB (will be remapped) */ "iiffff\0" "glProgramLocalParameter4fARB\0" "\0" - /* _mesa_function_pool[26197]: SpriteParameterivSGIX (dynamic) */ + /* _mesa_function_pool[26273]: SpriteParameterivSGIX (dynamic) */ "ip\0" "glSpriteParameterivSGIX\0" "\0" - /* _mesa_function_pool[26225]: ProvokingVertexEXT (will be remapped) */ + /* _mesa_function_pool[26301]: ProvokingVertexEXT (will be remapped) */ "i\0" "glProvokingVertexEXT\0" "glProvokingVertex\0" "\0" - /* _mesa_function_pool[26267]: MultiTexCoord1fARB (offset 378) */ + /* _mesa_function_pool[26343]: MultiTexCoord1fARB (offset 378) */ "if\0" "glMultiTexCoord1f\0" "glMultiTexCoord1fARB\0" "\0" - /* _mesa_function_pool[26310]: LoadName (offset 198) */ + /* _mesa_function_pool[26386]: LoadName (offset 198) */ "i\0" "glLoadName\0" "\0" - /* _mesa_function_pool[26324]: VertexAttribs4ubvNV (will be remapped) */ + /* _mesa_function_pool[26400]: VertexAttribs4ubvNV (will be remapped) */ "iip\0" "glVertexAttribs4ubvNV\0" "\0" - /* _mesa_function_pool[26351]: WeightsvARB (dynamic) */ + /* _mesa_function_pool[26427]: WeightsvARB (dynamic) */ "ip\0" "glWeightsvARB\0" "\0" - /* _mesa_function_pool[26369]: Uniform1fvARB (will be remapped) */ + /* _mesa_function_pool[26445]: Uniform1fvARB (will be remapped) */ "iip\0" "glUniform1fv\0" "glUniform1fvARB\0" "\0" - /* _mesa_function_pool[26403]: CopyTexSubImage1D (offset 325) */ + /* _mesa_function_pool[26479]: CopyTexSubImage1D (offset 325) */ "iiiiii\0" "glCopyTexSubImage1D\0" "glCopyTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[26454]: CullFace (offset 152) */ + /* _mesa_function_pool[26530]: CullFace (offset 152) */ "i\0" "glCullFace\0" "\0" - /* _mesa_function_pool[26468]: BindTexture (offset 307) */ + /* _mesa_function_pool[26544]: BindTexture (offset 307) */ "ii\0" "glBindTexture\0" "glBindTextureEXT\0" "\0" - /* _mesa_function_pool[26503]: BeginFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[26579]: BeginFragmentShaderATI (will be remapped) */ "\0" "glBeginFragmentShaderATI\0" "\0" - /* _mesa_function_pool[26530]: MultiTexCoord4fARB (offset 402) */ + /* _mesa_function_pool[26606]: MultiTexCoord4fARB (offset 402) */ "iffff\0" "glMultiTexCoord4f\0" "glMultiTexCoord4fARB\0" "\0" - /* _mesa_function_pool[26576]: VertexAttribs3svNV (will be remapped) */ + /* _mesa_function_pool[26652]: VertexAttribs3svNV (will be remapped) */ "iip\0" "glVertexAttribs3svNV\0" "\0" - /* _mesa_function_pool[26602]: StencilFunc (offset 243) */ + /* _mesa_function_pool[26678]: StencilFunc (offset 243) */ "iii\0" "glStencilFunc\0" "\0" - /* _mesa_function_pool[26621]: CopyPixels (offset 255) */ + /* _mesa_function_pool[26697]: CopyPixels (offset 255) */ "iiiii\0" "glCopyPixels\0" "\0" - /* _mesa_function_pool[26641]: Rectsv (offset 93) */ + /* _mesa_function_pool[26717]: Rectsv (offset 93) */ "pp\0" "glRectsv\0" "\0" - /* _mesa_function_pool[26654]: ReplacementCodeuivSUN (dynamic) */ + /* _mesa_function_pool[26730]: ReplacementCodeuivSUN (dynamic) */ "p\0" "glReplacementCodeuivSUN\0" "\0" - /* _mesa_function_pool[26681]: EnableVertexAttribArrayARB (will be remapped) */ + /* _mesa_function_pool[26757]: EnableVertexAttribArrayARB (will be remapped) */ "i\0" "glEnableVertexAttribArray\0" "glEnableVertexAttribArrayARB\0" "\0" - /* _mesa_function_pool[26739]: NormalPointervINTEL (dynamic) */ + /* _mesa_function_pool[26815]: NormalPointervINTEL (dynamic) */ "ip\0" "glNormalPointervINTEL\0" "\0" - /* _mesa_function_pool[26765]: CopyConvolutionFilter2D (offset 355) */ + /* _mesa_function_pool[26841]: CopyConvolutionFilter2D (offset 355) */ "iiiiii\0" "glCopyConvolutionFilter2D\0" "glCopyConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[26828]: WindowPos3ivMESA (will be remapped) */ + /* _mesa_function_pool[26904]: WindowPos3ivMESA (will be remapped) */ "p\0" "glWindowPos3iv\0" "glWindowPos3ivARB\0" "glWindowPos3ivMESA\0" "\0" - /* _mesa_function_pool[26883]: CopyBufferSubData (will be remapped) */ + /* _mesa_function_pool[26959]: CopyBufferSubData (will be remapped) */ "iiiii\0" "glCopyBufferSubData\0" "\0" - /* _mesa_function_pool[26910]: NormalPointer (offset 318) */ + /* _mesa_function_pool[26986]: NormalPointer (offset 318) */ "iip\0" "glNormalPointer\0" "\0" - /* _mesa_function_pool[26931]: TexParameterfv (offset 179) */ + /* _mesa_function_pool[27007]: TexParameterfv (offset 179) */ "iip\0" "glTexParameterfv\0" "\0" - /* _mesa_function_pool[26953]: IsBufferARB (will be remapped) */ + /* _mesa_function_pool[27029]: IsBufferARB (will be remapped) */ "i\0" "glIsBuffer\0" "glIsBufferARB\0" "\0" - /* _mesa_function_pool[26981]: WindowPos4iMESA (will be remapped) */ + /* _mesa_function_pool[27057]: WindowPos4iMESA (will be remapped) */ "iiii\0" "glWindowPos4iMESA\0" "\0" - /* _mesa_function_pool[27005]: VertexAttrib4uivARB (will be remapped) */ + /* _mesa_function_pool[27081]: VertexAttrib4uivARB (will be remapped) */ "ip\0" "glVertexAttrib4uiv\0" "glVertexAttrib4uivARB\0" "\0" - /* _mesa_function_pool[27050]: Tangent3bvEXT (dynamic) */ + /* _mesa_function_pool[27126]: Tangent3bvEXT (dynamic) */ "p\0" "glTangent3bvEXT\0" "\0" - /* _mesa_function_pool[27069]: UniformMatrix3x4fv (will be remapped) */ + /* _mesa_function_pool[27145]: UniformMatrix3x4fv (will be remapped) */ "iiip\0" "glUniformMatrix3x4fv\0" "\0" - /* _mesa_function_pool[27096]: ClipPlane (offset 150) */ + /* _mesa_function_pool[27172]: ClipPlane (offset 150) */ "ip\0" "glClipPlane\0" "\0" - /* _mesa_function_pool[27112]: Recti (offset 90) */ + /* _mesa_function_pool[27188]: Recti (offset 90) */ "iiii\0" "glRecti\0" "\0" - /* _mesa_function_pool[27126]: DrawRangeElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[27202]: DrawRangeElementsBaseVertex (will be remapped) */ "iiiiipi\0" "glDrawRangeElementsBaseVertex\0" "\0" - /* _mesa_function_pool[27165]: TexCoordPointervINTEL (dynamic) */ + /* _mesa_function_pool[27241]: TexCoordPointervINTEL (dynamic) */ "iip\0" "glTexCoordPointervINTEL\0" "\0" - /* _mesa_function_pool[27194]: DeleteBuffersARB (will be remapped) */ + /* _mesa_function_pool[27270]: DeleteBuffersARB (will be remapped) */ "ip\0" "glDeleteBuffers\0" "glDeleteBuffersARB\0" "\0" - /* _mesa_function_pool[27233]: WindowPos4fvMESA (will be remapped) */ + /* _mesa_function_pool[27309]: WindowPos4fvMESA (will be remapped) */ "p\0" "glWindowPos4fvMESA\0" "\0" - /* _mesa_function_pool[27255]: GetPixelMapuiv (offset 272) */ + /* _mesa_function_pool[27331]: GetPixelMapuiv (offset 272) */ "ip\0" "glGetPixelMapuiv\0" "\0" - /* _mesa_function_pool[27276]: Rectf (offset 88) */ + /* _mesa_function_pool[27352]: Rectf (offset 88) */ "ffff\0" "glRectf\0" "\0" - /* _mesa_function_pool[27290]: VertexAttrib1sNV (will be remapped) */ + /* _mesa_function_pool[27366]: VertexAttrib1sNV (will be remapped) */ "ii\0" "glVertexAttrib1sNV\0" "\0" - /* _mesa_function_pool[27313]: Indexfv (offset 47) */ + /* _mesa_function_pool[27389]: Indexfv (offset 47) */ "p\0" "glIndexfv\0" "\0" - /* _mesa_function_pool[27326]: SecondaryColor3svEXT (will be remapped) */ + /* _mesa_function_pool[27402]: SecondaryColor3svEXT (will be remapped) */ "p\0" "glSecondaryColor3sv\0" "glSecondaryColor3svEXT\0" "\0" - /* _mesa_function_pool[27372]: LoadTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[27448]: LoadTransposeMatrixfARB (will be remapped) */ "p\0" "glLoadTransposeMatrixf\0" "glLoadTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[27424]: GetPointerv (offset 329) */ + /* _mesa_function_pool[27500]: GetPointerv (offset 329) */ "ip\0" "glGetPointerv\0" "glGetPointervEXT\0" "\0" - /* _mesa_function_pool[27459]: Tangent3bEXT (dynamic) */ + /* _mesa_function_pool[27535]: Tangent3bEXT (dynamic) */ "iii\0" "glTangent3bEXT\0" "\0" - /* _mesa_function_pool[27479]: CombinerParameterfNV (will be remapped) */ + /* _mesa_function_pool[27555]: CombinerParameterfNV (will be remapped) */ "if\0" "glCombinerParameterfNV\0" "\0" - /* _mesa_function_pool[27506]: IndexMask (offset 212) */ + /* _mesa_function_pool[27582]: IndexMask (offset 212) */ "i\0" "glIndexMask\0" "\0" - /* _mesa_function_pool[27521]: BindProgramNV (will be remapped) */ + /* _mesa_function_pool[27597]: BindProgramNV (will be remapped) */ "ii\0" "glBindProgramARB\0" "glBindProgramNV\0" "\0" - /* _mesa_function_pool[27558]: VertexAttrib4svARB (will be remapped) */ + /* _mesa_function_pool[27634]: VertexAttrib4svARB (will be remapped) */ "ip\0" "glVertexAttrib4sv\0" "glVertexAttrib4svARB\0" "\0" - /* _mesa_function_pool[27601]: GetFloatv (offset 262) */ + /* _mesa_function_pool[27677]: GetFloatv (offset 262) */ "ip\0" "glGetFloatv\0" "\0" - /* _mesa_function_pool[27617]: CreateDebugObjectMESA (dynamic) */ + /* _mesa_function_pool[27693]: CreateDebugObjectMESA (dynamic) */ "\0" "glCreateDebugObjectMESA\0" "\0" - /* _mesa_function_pool[27643]: GetShaderiv (will be remapped) */ + /* _mesa_function_pool[27719]: GetShaderiv (will be remapped) */ "iip\0" "glGetShaderiv\0" "\0" - /* _mesa_function_pool[27662]: ClientWaitSync (will be remapped) */ + /* _mesa_function_pool[27738]: ClientWaitSync (will be remapped) */ "iii\0" "glClientWaitSync\0" "\0" - /* _mesa_function_pool[27684]: TexCoord4s (offset 124) */ + /* _mesa_function_pool[27760]: TexCoord4s (offset 124) */ "iiii\0" "glTexCoord4s\0" "\0" - /* _mesa_function_pool[27703]: TexCoord3sv (offset 117) */ + /* _mesa_function_pool[27779]: TexCoord3sv (offset 117) */ "p\0" "glTexCoord3sv\0" "\0" - /* _mesa_function_pool[27720]: BindFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[27796]: BindFragmentShaderATI (will be remapped) */ "i\0" "glBindFragmentShaderATI\0" "\0" - /* _mesa_function_pool[27747]: PopAttrib (offset 218) */ + /* _mesa_function_pool[27823]: PopAttrib (offset 218) */ "\0" "glPopAttrib\0" "\0" - /* _mesa_function_pool[27761]: Fogfv (offset 154) */ + /* _mesa_function_pool[27837]: Fogfv (offset 154) */ "ip\0" "glFogfv\0" "\0" - /* _mesa_function_pool[27773]: UnmapBufferARB (will be remapped) */ + /* _mesa_function_pool[27849]: UnmapBufferARB (will be remapped) */ "i\0" "glUnmapBuffer\0" "glUnmapBufferARB\0" "\0" - /* _mesa_function_pool[27807]: InitNames (offset 197) */ + /* _mesa_function_pool[27883]: InitNames (offset 197) */ "\0" "glInitNames\0" "\0" - /* _mesa_function_pool[27821]: Normal3sv (offset 61) */ + /* _mesa_function_pool[27897]: Normal3sv (offset 61) */ "p\0" "glNormal3sv\0" "\0" - /* _mesa_function_pool[27836]: Minmax (offset 368) */ + /* _mesa_function_pool[27912]: Minmax (offset 368) */ "iii\0" "glMinmax\0" "glMinmaxEXT\0" "\0" - /* _mesa_function_pool[27862]: TexCoord4d (offset 118) */ + /* _mesa_function_pool[27938]: TexCoord4d (offset 118) */ "dddd\0" "glTexCoord4d\0" "\0" - /* _mesa_function_pool[27881]: TexCoord4f (offset 120) */ + /* _mesa_function_pool[27957]: TexCoord4f (offset 120) */ "ffff\0" "glTexCoord4f\0" "\0" - /* _mesa_function_pool[27900]: FogCoorddvEXT (will be remapped) */ + /* _mesa_function_pool[27976]: FogCoorddvEXT (will be remapped) */ "p\0" "glFogCoorddv\0" "glFogCoorddvEXT\0" "\0" - /* _mesa_function_pool[27932]: FinishTextureSUNX (dynamic) */ + /* _mesa_function_pool[28008]: FinishTextureSUNX (dynamic) */ "\0" "glFinishTextureSUNX\0" "\0" - /* _mesa_function_pool[27954]: GetFragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[28030]: GetFragmentLightfvSGIX (dynamic) */ "iip\0" "glGetFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[27984]: Binormal3fvEXT (dynamic) */ + /* _mesa_function_pool[28060]: Binormal3fvEXT (dynamic) */ "p\0" "glBinormal3fvEXT\0" "\0" - /* _mesa_function_pool[28004]: GetBooleanv (offset 258) */ + /* _mesa_function_pool[28080]: GetBooleanv (offset 258) */ "ip\0" "glGetBooleanv\0" "\0" - /* _mesa_function_pool[28022]: ColorFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[28098]: ColorFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiiii\0" "glColorFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[28059]: Hint (offset 158) */ + /* _mesa_function_pool[28135]: Hint (offset 158) */ "ii\0" "glHint\0" "\0" - /* _mesa_function_pool[28070]: Color4dv (offset 28) */ + /* _mesa_function_pool[28146]: Color4dv (offset 28) */ "p\0" "glColor4dv\0" "\0" - /* _mesa_function_pool[28084]: VertexAttrib2svARB (will be remapped) */ + /* _mesa_function_pool[28160]: VertexAttrib2svARB (will be remapped) */ "ip\0" "glVertexAttrib2sv\0" "glVertexAttrib2svARB\0" "\0" - /* _mesa_function_pool[28127]: AreProgramsResidentNV (will be remapped) */ + /* _mesa_function_pool[28203]: AreProgramsResidentNV (will be remapped) */ "ipp\0" "glAreProgramsResidentNV\0" "\0" - /* _mesa_function_pool[28156]: WindowPos3svMESA (will be remapped) */ + /* _mesa_function_pool[28232]: WindowPos3svMESA (will be remapped) */ "p\0" "glWindowPos3sv\0" "glWindowPos3svARB\0" "glWindowPos3svMESA\0" "\0" - /* _mesa_function_pool[28211]: CopyColorSubTable (offset 347) */ + /* _mesa_function_pool[28287]: CopyColorSubTable (offset 347) */ "iiiii\0" "glCopyColorSubTable\0" "glCopyColorSubTableEXT\0" "\0" - /* _mesa_function_pool[28261]: WeightdvARB (dynamic) */ + /* _mesa_function_pool[28337]: WeightdvARB (dynamic) */ "ip\0" "glWeightdvARB\0" "\0" - /* _mesa_function_pool[28279]: DeleteRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[28355]: DeleteRenderbuffersEXT (will be remapped) */ "ip\0" "glDeleteRenderbuffers\0" "glDeleteRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[28330]: VertexAttrib4NubvARB (will be remapped) */ + /* _mesa_function_pool[28406]: VertexAttrib4NubvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nubv\0" "glVertexAttrib4NubvARB\0" "\0" - /* _mesa_function_pool[28377]: VertexAttrib3dvNV (will be remapped) */ + /* _mesa_function_pool[28453]: VertexAttrib3dvNV (will be remapped) */ "ip\0" "glVertexAttrib3dvNV\0" "\0" - /* _mesa_function_pool[28401]: GetObjectParameterfvARB (will be remapped) */ + /* _mesa_function_pool[28477]: GetObjectParameterfvARB (will be remapped) */ "iip\0" "glGetObjectParameterfvARB\0" "\0" - /* _mesa_function_pool[28432]: Vertex4iv (offset 147) */ + /* _mesa_function_pool[28508]: Vertex4iv (offset 147) */ "p\0" "glVertex4iv\0" "\0" - /* _mesa_function_pool[28447]: GetProgramEnvParameterdvARB (will be remapped) */ + /* _mesa_function_pool[28523]: GetProgramEnvParameterdvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterdvARB\0" "\0" - /* _mesa_function_pool[28482]: TexCoord4dv (offset 119) */ + /* _mesa_function_pool[28558]: TexCoord4dv (offset 119) */ "p\0" "glTexCoord4dv\0" "\0" - /* _mesa_function_pool[28499]: LockArraysEXT (will be remapped) */ + /* _mesa_function_pool[28575]: LockArraysEXT (will be remapped) */ "ii\0" "glLockArraysEXT\0" "\0" - /* _mesa_function_pool[28519]: Begin (offset 7) */ + /* _mesa_function_pool[28595]: Begin (offset 7) */ "i\0" "glBegin\0" "\0" - /* _mesa_function_pool[28530]: LightModeli (offset 165) */ + /* _mesa_function_pool[28606]: LightModeli (offset 165) */ "ii\0" "glLightModeli\0" "\0" - /* _mesa_function_pool[28548]: Rectfv (offset 89) */ + /* _mesa_function_pool[28624]: Rectfv (offset 89) */ "pp\0" "glRectfv\0" "\0" - /* _mesa_function_pool[28561]: LightModelf (offset 163) */ + /* _mesa_function_pool[28637]: LightModelf (offset 163) */ "if\0" "glLightModelf\0" "\0" - /* _mesa_function_pool[28579]: GetTexParameterfv (offset 282) */ + /* _mesa_function_pool[28655]: GetTexParameterfv (offset 282) */ "iip\0" "glGetTexParameterfv\0" "\0" - /* _mesa_function_pool[28604]: GetLightfv (offset 264) */ + /* _mesa_function_pool[28680]: GetLightfv (offset 264) */ "iip\0" "glGetLightfv\0" "\0" - /* _mesa_function_pool[28622]: PixelTransformParameterivEXT (dynamic) */ + /* _mesa_function_pool[28698]: PixelTransformParameterivEXT (dynamic) */ "iip\0" "glPixelTransformParameterivEXT\0" "\0" - /* _mesa_function_pool[28658]: BinormalPointerEXT (dynamic) */ + /* _mesa_function_pool[28734]: BinormalPointerEXT (dynamic) */ "iip\0" "glBinormalPointerEXT\0" "\0" - /* _mesa_function_pool[28684]: VertexAttrib1dNV (will be remapped) */ + /* _mesa_function_pool[28760]: VertexAttrib1dNV (will be remapped) */ "id\0" "glVertexAttrib1dNV\0" "\0" - /* _mesa_function_pool[28707]: GetCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[28783]: GetCombinerInputParameterivNV (will be remapped) */ "iiiip\0" "glGetCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[28746]: Disable (offset 214) */ + /* _mesa_function_pool[28822]: Disable (offset 214) */ "i\0" "glDisable\0" "\0" - /* _mesa_function_pool[28759]: MultiTexCoord2fvARB (offset 387) */ + /* _mesa_function_pool[28835]: MultiTexCoord2fvARB (offset 387) */ "ip\0" "glMultiTexCoord2fv\0" "glMultiTexCoord2fvARB\0" "\0" - /* _mesa_function_pool[28804]: GetRenderbufferParameterivEXT (will be remapped) */ + /* _mesa_function_pool[28880]: GetRenderbufferParameterivEXT (will be remapped) */ "iip\0" "glGetRenderbufferParameteriv\0" "glGetRenderbufferParameterivEXT\0" "\0" - /* _mesa_function_pool[28870]: CombinerParameterivNV (will be remapped) */ + /* _mesa_function_pool[28946]: CombinerParameterivNV (will be remapped) */ "ip\0" "glCombinerParameterivNV\0" "\0" - /* _mesa_function_pool[28898]: GenFragmentShadersATI (will be remapped) */ + /* _mesa_function_pool[28974]: GenFragmentShadersATI (will be remapped) */ "i\0" "glGenFragmentShadersATI\0" "\0" - /* _mesa_function_pool[28925]: DrawArrays (offset 310) */ + /* _mesa_function_pool[29001]: DrawArrays (offset 310) */ "iii\0" "glDrawArrays\0" "glDrawArraysEXT\0" "\0" - /* _mesa_function_pool[28959]: WeightuivARB (dynamic) */ + /* _mesa_function_pool[29035]: WeightuivARB (dynamic) */ "ip\0" "glWeightuivARB\0" "\0" - /* _mesa_function_pool[28978]: VertexAttrib2sARB (will be remapped) */ + /* _mesa_function_pool[29054]: VertexAttrib2sARB (will be remapped) */ "iii\0" "glVertexAttrib2s\0" "glVertexAttrib2sARB\0" "\0" - /* _mesa_function_pool[29020]: ColorMask (offset 210) */ + /* _mesa_function_pool[29096]: ColorMask (offset 210) */ "iiii\0" "glColorMask\0" "\0" - /* _mesa_function_pool[29038]: GenAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[29114]: GenAsyncMarkersSGIX (dynamic) */ "i\0" "glGenAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[29063]: Tangent3svEXT (dynamic) */ + /* _mesa_function_pool[29139]: Tangent3svEXT (dynamic) */ "p\0" "glTangent3svEXT\0" "\0" - /* _mesa_function_pool[29082]: GetListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[29158]: GetListParameterivSGIX (dynamic) */ "iip\0" "glGetListParameterivSGIX\0" "\0" - /* _mesa_function_pool[29112]: BindBufferARB (will be remapped) */ + /* _mesa_function_pool[29188]: BindBufferARB (will be remapped) */ "ii\0" "glBindBuffer\0" "glBindBufferARB\0" "\0" - /* _mesa_function_pool[29145]: GetInfoLogARB (will be remapped) */ + /* _mesa_function_pool[29221]: GetInfoLogARB (will be remapped) */ "iipp\0" "glGetInfoLogARB\0" "\0" - /* _mesa_function_pool[29167]: RasterPos4iv (offset 83) */ + /* _mesa_function_pool[29243]: RasterPos4iv (offset 83) */ "p\0" "glRasterPos4iv\0" "\0" - /* _mesa_function_pool[29185]: Enable (offset 215) */ + /* _mesa_function_pool[29261]: Enable (offset 215) */ "i\0" "glEnable\0" "\0" - /* _mesa_function_pool[29197]: LineStipple (offset 167) */ + /* _mesa_function_pool[29273]: LineStipple (offset 167) */ "ii\0" "glLineStipple\0" "\0" - /* _mesa_function_pool[29215]: VertexAttribs4svNV (will be remapped) */ + /* _mesa_function_pool[29291]: VertexAttribs4svNV (will be remapped) */ "iip\0" "glVertexAttribs4svNV\0" "\0" - /* _mesa_function_pool[29241]: EdgeFlagPointerListIBM (dynamic) */ + /* _mesa_function_pool[29317]: EdgeFlagPointerListIBM (dynamic) */ "ipi\0" "glEdgeFlagPointerListIBM\0" "\0" - /* _mesa_function_pool[29271]: UniformMatrix3x2fv (will be remapped) */ + /* _mesa_function_pool[29347]: UniformMatrix3x2fv (will be remapped) */ "iiip\0" "glUniformMatrix3x2fv\0" "\0" - /* _mesa_function_pool[29298]: GetMinmaxParameterfv (offset 365) */ + /* _mesa_function_pool[29374]: GetMinmaxParameterfv (offset 365) */ "iip\0" "glGetMinmaxParameterfv\0" "glGetMinmaxParameterfvEXT\0" "\0" - /* _mesa_function_pool[29352]: VertexAttrib1fvARB (will be remapped) */ + /* _mesa_function_pool[29428]: VertexAttrib1fvARB (will be remapped) */ "ip\0" "glVertexAttrib1fv\0" "glVertexAttrib1fvARB\0" "\0" - /* _mesa_function_pool[29395]: GenBuffersARB (will be remapped) */ + /* _mesa_function_pool[29471]: GenBuffersARB (will be remapped) */ "ip\0" "glGenBuffers\0" "glGenBuffersARB\0" "\0" - /* _mesa_function_pool[29428]: VertexAttribs1svNV (will be remapped) */ + /* _mesa_function_pool[29504]: VertexAttribs1svNV (will be remapped) */ "iip\0" "glVertexAttribs1svNV\0" "\0" - /* _mesa_function_pool[29454]: Vertex3fv (offset 137) */ + /* _mesa_function_pool[29530]: Vertex3fv (offset 137) */ "p\0" "glVertex3fv\0" "\0" - /* _mesa_function_pool[29469]: GetTexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[29545]: GetTexBumpParameterivATI (will be remapped) */ "ip\0" "glGetTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[29500]: Binormal3bEXT (dynamic) */ + /* _mesa_function_pool[29576]: Binormal3bEXT (dynamic) */ "iii\0" "glBinormal3bEXT\0" "\0" - /* _mesa_function_pool[29521]: FragmentMaterialivSGIX (dynamic) */ + /* _mesa_function_pool[29597]: FragmentMaterialivSGIX (dynamic) */ "iip\0" "glFragmentMaterialivSGIX\0" "\0" - /* _mesa_function_pool[29551]: IsRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[29627]: IsRenderbufferEXT (will be remapped) */ "i\0" "glIsRenderbuffer\0" "glIsRenderbufferEXT\0" "\0" - /* _mesa_function_pool[29591]: GenProgramsNV (will be remapped) */ + /* _mesa_function_pool[29667]: GenProgramsNV (will be remapped) */ "ip\0" "glGenProgramsARB\0" "glGenProgramsNV\0" "\0" - /* _mesa_function_pool[29628]: VertexAttrib4dvNV (will be remapped) */ + /* _mesa_function_pool[29704]: VertexAttrib4dvNV (will be remapped) */ "ip\0" "glVertexAttrib4dvNV\0" "\0" - /* _mesa_function_pool[29652]: EndFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[29728]: EndFragmentShaderATI (will be remapped) */ "\0" "glEndFragmentShaderATI\0" "\0" - /* _mesa_function_pool[29677]: Binormal3iEXT (dynamic) */ + /* _mesa_function_pool[29753]: Binormal3iEXT (dynamic) */ "iii\0" "glBinormal3iEXT\0" "\0" - /* _mesa_function_pool[29698]: WindowPos2fMESA (will be remapped) */ + /* _mesa_function_pool[29774]: WindowPos2fMESA (will be remapped) */ "ff\0" "glWindowPos2f\0" "glWindowPos2fARB\0" @@ -4367,399 +4375,401 @@ static const struct { } MESA_remap_table_functions[] = { { 1461, AttachShader_remap_index }, { 8764, CreateProgram_remap_index }, - { 20302, CreateShader_remap_index }, - { 22589, DeleteProgram_remap_index }, - { 16282, DeleteShader_remap_index }, - { 20748, DetachShader_remap_index }, - { 15806, GetAttachedShaders_remap_index }, + { 20335, CreateShader_remap_index }, + { 22665, DeleteProgram_remap_index }, + { 16315, DeleteShader_remap_index }, + { 20781, DetachShader_remap_index }, + { 15839, GetAttachedShaders_remap_index }, { 4275, GetProgramInfoLog_remap_index }, { 361, GetProgramiv_remap_index }, { 5578, GetShaderInfoLog_remap_index }, - { 27643, GetShaderiv_remap_index }, - { 11821, IsProgram_remap_index }, - { 10856, IsShader_remap_index }, + { 27719, GetShaderiv_remap_index }, + { 11854, IsProgram_remap_index }, + { 10889, IsShader_remap_index }, { 8868, StencilFuncSeparate_remap_index }, { 3487, StencilMaskSeparate_remap_index }, { 6654, StencilOpSeparate_remap_index }, - { 19653, UniformMatrix2x3fv_remap_index }, + { 19686, UniformMatrix2x3fv_remap_index }, { 2615, UniformMatrix2x4fv_remap_index }, - { 29271, UniformMatrix3x2fv_remap_index }, - { 27069, UniformMatrix3x4fv_remap_index }, - { 14354, UniformMatrix4x2fv_remap_index }, + { 29347, UniformMatrix3x2fv_remap_index }, + { 27145, UniformMatrix3x4fv_remap_index }, + { 14387, UniformMatrix4x2fv_remap_index }, { 2937, UniformMatrix4x3fv_remap_index }, { 8782, LoadTransposeMatrixdARB_remap_index }, - { 27372, LoadTransposeMatrixfARB_remap_index }, + { 27448, LoadTransposeMatrixfARB_remap_index }, { 4848, MultTransposeMatrixdARB_remap_index }, - { 20935, MultTransposeMatrixfARB_remap_index }, + { 20968, MultTransposeMatrixfARB_remap_index }, { 172, SampleCoverageARB_remap_index }, { 5002, CompressedTexImage1DARB_remap_index }, - { 21392, CompressedTexImage2DARB_remap_index }, + { 21468, CompressedTexImage2DARB_remap_index }, { 3550, CompressedTexImage3DARB_remap_index }, - { 16098, CompressedTexSubImage1DARB_remap_index }, + { 16131, CompressedTexSubImage1DARB_remap_index }, { 1880, CompressedTexSubImage2DARB_remap_index }, - { 17890, CompressedTexSubImage3DARB_remap_index }, - { 25351, GetCompressedTexImageARB_remap_index }, + { 17923, CompressedTexSubImage3DARB_remap_index }, + { 25427, GetCompressedTexImageARB_remap_index }, { 3395, DisableVertexAttribArrayARB_remap_index }, - { 26681, EnableVertexAttribArrayARB_remap_index }, - { 28447, GetProgramEnvParameterdvARB_remap_index }, - { 20815, GetProgramEnvParameterfvARB_remap_index }, - { 24381, GetProgramLocalParameterdvARB_remap_index }, + { 26757, EnableVertexAttribArrayARB_remap_index }, + { 28523, GetProgramEnvParameterdvARB_remap_index }, + { 20848, GetProgramEnvParameterfvARB_remap_index }, + { 24457, GetProgramLocalParameterdvARB_remap_index }, { 7096, GetProgramLocalParameterfvARB_remap_index }, - { 16189, GetProgramStringARB_remap_index }, - { 24576, GetProgramivARB_remap_index }, - { 18085, GetVertexAttribdvARB_remap_index }, - { 14243, GetVertexAttribfvARB_remap_index }, + { 16222, GetProgramStringARB_remap_index }, + { 24652, GetProgramivARB_remap_index }, + { 18118, GetVertexAttribdvARB_remap_index }, + { 14276, GetVertexAttribfvARB_remap_index }, { 8677, GetVertexAttribivARB_remap_index }, - { 16994, ProgramEnvParameter4dARB_remap_index }, - { 22362, ProgramEnvParameter4dvARB_remap_index }, - { 14851, ProgramEnvParameter4fARB_remap_index }, + { 17027, ProgramEnvParameter4dARB_remap_index }, + { 22438, ProgramEnvParameter4dvARB_remap_index }, + { 14884, ProgramEnvParameter4fARB_remap_index }, { 7959, ProgramEnvParameter4fvARB_remap_index }, { 3513, ProgramLocalParameter4dARB_remap_index }, - { 11531, ProgramLocalParameter4dvARB_remap_index }, - { 26160, ProgramLocalParameter4fARB_remap_index }, - { 22907, ProgramLocalParameter4fvARB_remap_index }, - { 25137, ProgramStringARB_remap_index }, - { 17244, VertexAttrib1dARB_remap_index }, - { 13897, VertexAttrib1dvARB_remap_index }, + { 11564, ProgramLocalParameter4dvARB_remap_index }, + { 26236, ProgramLocalParameter4fARB_remap_index }, + { 22983, ProgramLocalParameter4fvARB_remap_index }, + { 25213, ProgramStringARB_remap_index }, + { 17277, VertexAttrib1dARB_remap_index }, + { 13930, VertexAttrib1dvARB_remap_index }, { 3688, VertexAttrib1fARB_remap_index }, - { 29352, VertexAttrib1fvARB_remap_index }, + { 29428, VertexAttrib1fvARB_remap_index }, { 6180, VertexAttrib1sARB_remap_index }, { 2054, VertexAttrib1svARB_remap_index }, - { 13328, VertexAttrib2dARB_remap_index }, - { 15425, VertexAttrib2dvARB_remap_index }, + { 13361, VertexAttrib2dARB_remap_index }, + { 15458, VertexAttrib2dvARB_remap_index }, { 1480, VertexAttrib2fARB_remap_index }, - { 15538, VertexAttrib2fvARB_remap_index }, - { 28978, VertexAttrib2sARB_remap_index }, - { 28084, VertexAttrib2svARB_remap_index }, + { 15571, VertexAttrib2fvARB_remap_index }, + { 29054, VertexAttrib2sARB_remap_index }, + { 28160, VertexAttrib2svARB_remap_index }, { 10015, VertexAttrib3dARB_remap_index }, { 7662, VertexAttrib3dvARB_remap_index }, { 1567, VertexAttrib3fARB_remap_index }, - { 19890, VertexAttrib3fvARB_remap_index }, - { 25009, VertexAttrib3sARB_remap_index }, - { 17827, VertexAttrib3svARB_remap_index }, + { 19923, VertexAttrib3fvARB_remap_index }, + { 25085, VertexAttrib3sARB_remap_index }, + { 17860, VertexAttrib3svARB_remap_index }, { 4301, VertexAttrib4NbvARB_remap_index }, - { 15761, VertexAttrib4NivARB_remap_index }, - { 19845, VertexAttrib4NsvARB_remap_index }, - { 20767, VertexAttrib4NubARB_remap_index }, - { 28330, VertexAttrib4NubvARB_remap_index }, - { 16655, VertexAttrib4NuivARB_remap_index }, + { 15794, VertexAttrib4NivARB_remap_index }, + { 19878, VertexAttrib4NsvARB_remap_index }, + { 20800, VertexAttrib4NubARB_remap_index }, + { 28406, VertexAttrib4NubvARB_remap_index }, + { 16688, VertexAttrib4NuivARB_remap_index }, { 2810, VertexAttrib4NusvARB_remap_index }, { 9609, VertexAttrib4bvARB_remap_index }, - { 23789, VertexAttrib4dARB_remap_index }, - { 18810, VertexAttrib4dvARB_remap_index }, + { 23865, VertexAttrib4dARB_remap_index }, + { 18843, VertexAttrib4dvARB_remap_index }, { 10122, VertexAttrib4fARB_remap_index }, { 10492, VertexAttrib4fvARB_remap_index }, { 9061, VertexAttrib4ivARB_remap_index }, - { 15239, VertexAttrib4sARB_remap_index }, - { 27558, VertexAttrib4svARB_remap_index }, - { 14656, VertexAttrib4ubvARB_remap_index }, - { 27005, VertexAttrib4uivARB_remap_index }, - { 17638, VertexAttrib4usvARB_remap_index }, - { 19527, VertexAttribPointerARB_remap_index }, - { 29112, BindBufferARB_remap_index }, + { 15272, VertexAttrib4sARB_remap_index }, + { 27634, VertexAttrib4svARB_remap_index }, + { 14689, VertexAttrib4ubvARB_remap_index }, + { 27081, VertexAttrib4uivARB_remap_index }, + { 17671, VertexAttrib4usvARB_remap_index }, + { 19560, VertexAttribPointerARB_remap_index }, + { 29188, BindBufferARB_remap_index }, { 5893, BufferDataARB_remap_index }, { 1382, BufferSubDataARB_remap_index }, - { 27194, DeleteBuffersARB_remap_index }, - { 29395, GenBuffersARB_remap_index }, - { 15581, GetBufferParameterivARB_remap_index }, - { 14803, GetBufferPointervARB_remap_index }, + { 27270, DeleteBuffersARB_remap_index }, + { 29471, GenBuffersARB_remap_index }, + { 15614, GetBufferParameterivARB_remap_index }, + { 14836, GetBufferPointervARB_remap_index }, { 1335, GetBufferSubDataARB_remap_index }, - { 26953, IsBufferARB_remap_index }, - { 23362, MapBufferARB_remap_index }, - { 27773, UnmapBufferARB_remap_index }, + { 27029, IsBufferARB_remap_index }, + { 23438, MapBufferARB_remap_index }, + { 27849, UnmapBufferARB_remap_index }, { 268, BeginQueryARB_remap_index }, - { 17339, DeleteQueriesARB_remap_index }, - { 10753, EndQueryARB_remap_index }, - { 25830, GenQueriesARB_remap_index }, + { 17372, DeleteQueriesARB_remap_index }, + { 10786, EndQueryARB_remap_index }, + { 25906, GenQueriesARB_remap_index }, { 1772, GetQueryObjectivARB_remap_index }, - { 15283, GetQueryObjectuivARB_remap_index }, + { 15316, GetQueryObjectuivARB_remap_index }, { 1624, GetQueryivARB_remap_index }, - { 17545, IsQueryARB_remap_index }, + { 17578, IsQueryARB_remap_index }, { 7272, AttachObjectARB_remap_index }, - { 16244, CompileShaderARB_remap_index }, + { 16277, CompileShaderARB_remap_index }, { 2879, CreateProgramObjectARB_remap_index }, { 5838, CreateShaderObjectARB_remap_index }, - { 12745, DeleteObjectARB_remap_index }, - { 21166, DetachObjectARB_remap_index }, + { 12778, DeleteObjectARB_remap_index }, + { 21242, DetachObjectARB_remap_index }, { 10564, GetActiveUniformARB_remap_index }, { 8380, GetAttachedObjectsARB_remap_index }, { 8659, GetHandleARB_remap_index }, - { 29145, GetInfoLogARB_remap_index }, - { 28401, GetObjectParameterfvARB_remap_index }, - { 24255, GetObjectParameterivARB_remap_index }, - { 25588, GetShaderSourceARB_remap_index }, - { 24869, GetUniformLocationARB_remap_index }, - { 21037, GetUniformfvARB_remap_index }, - { 11153, GetUniformivARB_remap_index }, - { 17683, LinkProgramARB_remap_index }, - { 17741, ShaderSourceARB_remap_index }, + { 29221, GetInfoLogARB_remap_index }, + { 28477, GetObjectParameterfvARB_remap_index }, + { 24331, GetObjectParameterivARB_remap_index }, + { 25664, GetShaderSourceARB_remap_index }, + { 24945, GetUniformLocationARB_remap_index }, + { 21070, GetUniformfvARB_remap_index }, + { 11186, GetUniformivARB_remap_index }, + { 17716, LinkProgramARB_remap_index }, + { 17774, ShaderSourceARB_remap_index }, { 6554, Uniform1fARB_remap_index }, - { 26369, Uniform1fvARB_remap_index }, - { 19496, Uniform1iARB_remap_index }, - { 18499, Uniform1ivARB_remap_index }, + { 26445, Uniform1fvARB_remap_index }, + { 19529, Uniform1iARB_remap_index }, + { 18532, Uniform1ivARB_remap_index }, { 2003, Uniform2fARB_remap_index }, - { 12581, Uniform2fvARB_remap_index }, - { 23249, Uniform2iARB_remap_index }, + { 12614, Uniform2fvARB_remap_index }, + { 23325, Uniform2iARB_remap_index }, { 2123, Uniform2ivARB_remap_index }, - { 16354, Uniform3fARB_remap_index }, + { 16387, Uniform3fARB_remap_index }, { 8410, Uniform3fvARB_remap_index }, { 5512, Uniform3iARB_remap_index }, - { 14909, Uniform3ivARB_remap_index }, - { 16800, Uniform4fARB_remap_index }, - { 20901, Uniform4fvARB_remap_index }, - { 22041, Uniform4iARB_remap_index }, - { 18051, Uniform4ivARB_remap_index }, + { 14942, Uniform3ivARB_remap_index }, + { 16833, Uniform4fARB_remap_index }, + { 20934, Uniform4fvARB_remap_index }, + { 22117, Uniform4iARB_remap_index }, + { 18084, Uniform4ivARB_remap_index }, { 7324, UniformMatrix2fvARB_remap_index }, { 17, UniformMatrix3fvARB_remap_index }, { 2475, UniformMatrix4fvARB_remap_index }, - { 22474, UseProgramObjectARB_remap_index }, - { 13016, ValidateProgramARB_remap_index }, - { 18853, BindAttribLocationARB_remap_index }, + { 22550, UseProgramObjectARB_remap_index }, + { 13049, ValidateProgramARB_remap_index }, + { 18886, BindAttribLocationARB_remap_index }, { 4346, GetActiveAttribARB_remap_index }, - { 14590, GetAttribLocationARB_remap_index }, - { 26108, DrawBuffersARB_remap_index }, - { 11636, RenderbufferStorageMultisample_remap_index }, - { 16848, FlushMappedBufferRange_remap_index }, - { 24672, MapBufferRange_remap_index }, - { 14465, BindVertexArray_remap_index }, - { 12875, GenVertexArrays_remap_index }, - { 26883, CopyBufferSubData_remap_index }, - { 27662, ClientWaitSync_remap_index }, + { 14623, GetAttribLocationARB_remap_index }, + { 26184, DrawBuffersARB_remap_index }, + { 11669, RenderbufferStorageMultisample_remap_index }, + { 16881, FlushMappedBufferRange_remap_index }, + { 24748, MapBufferRange_remap_index }, + { 14498, BindVertexArray_remap_index }, + { 12908, GenVertexArrays_remap_index }, + { 26959, CopyBufferSubData_remap_index }, + { 27738, ClientWaitSync_remap_index }, { 2394, DeleteSync_remap_index }, { 6221, FenceSync_remap_index }, - { 13387, GetInteger64v_remap_index }, - { 19952, GetSynciv_remap_index }, - { 26047, IsSync_remap_index }, + { 13420, GetInteger64v_remap_index }, + { 19985, GetSynciv_remap_index }, + { 26123, IsSync_remap_index }, { 8328, WaitSync_remap_index }, { 3363, DrawElementsBaseVertex_remap_index }, - { 27126, DrawRangeElementsBaseVertex_remap_index }, - { 23393, MultiDrawElementsBaseVertex_remap_index }, + { 27202, DrawRangeElementsBaseVertex_remap_index }, + { 23469, MultiDrawElementsBaseVertex_remap_index }, { 4711, PolygonOffsetEXT_remap_index }, - { 20537, GetPixelTexGenParameterfvSGIS_remap_index }, + { 20570, GetPixelTexGenParameterfvSGIS_remap_index }, { 3895, GetPixelTexGenParameterivSGIS_remap_index }, - { 20270, PixelTexGenParameterfSGIS_remap_index }, + { 20303, PixelTexGenParameterfSGIS_remap_index }, { 580, PixelTexGenParameterfvSGIS_remap_index }, - { 11191, PixelTexGenParameteriSGIS_remap_index }, - { 12152, PixelTexGenParameterivSGIS_remap_index }, - { 14553, SampleMaskSGIS_remap_index }, - { 17485, SamplePatternSGIS_remap_index }, - { 23322, ColorPointerEXT_remap_index }, - { 15468, EdgeFlagPointerEXT_remap_index }, + { 11224, PixelTexGenParameteriSGIS_remap_index }, + { 12185, PixelTexGenParameterivSGIS_remap_index }, + { 14586, SampleMaskSGIS_remap_index }, + { 17518, SamplePatternSGIS_remap_index }, + { 23398, ColorPointerEXT_remap_index }, + { 15501, EdgeFlagPointerEXT_remap_index }, { 5166, IndexPointerEXT_remap_index }, { 5246, NormalPointerEXT_remap_index }, - { 13981, TexCoordPointerEXT_remap_index }, + { 14014, TexCoordPointerEXT_remap_index }, { 6016, VertexPointerEXT_remap_index }, { 3165, PointParameterfEXT_remap_index }, { 6861, PointParameterfvEXT_remap_index }, - { 28499, LockArraysEXT_remap_index }, - { 13080, UnlockArraysEXT_remap_index }, + { 28575, LockArraysEXT_remap_index }, + { 13113, UnlockArraysEXT_remap_index }, { 7868, CullParameterdvEXT_remap_index }, { 10359, CullParameterfvEXT_remap_index }, { 1151, SecondaryColor3bEXT_remap_index }, { 7020, SecondaryColor3bvEXT_remap_index }, { 9238, SecondaryColor3dEXT_remap_index }, - { 22647, SecondaryColor3dvEXT_remap_index }, - { 24918, SecondaryColor3fEXT_remap_index }, - { 16034, SecondaryColor3fvEXT_remap_index }, + { 22723, SecondaryColor3dvEXT_remap_index }, + { 24994, SecondaryColor3fEXT_remap_index }, + { 16067, SecondaryColor3fvEXT_remap_index }, { 426, SecondaryColor3iEXT_remap_index }, - { 14291, SecondaryColor3ivEXT_remap_index }, + { 14324, SecondaryColor3ivEXT_remap_index }, { 8896, SecondaryColor3sEXT_remap_index }, - { 27326, SecondaryColor3svEXT_remap_index }, - { 24091, SecondaryColor3ubEXT_remap_index }, - { 18744, SecondaryColor3ubvEXT_remap_index }, - { 11386, SecondaryColor3uiEXT_remap_index }, - { 20157, SecondaryColor3uivEXT_remap_index }, - { 22859, SecondaryColor3usEXT_remap_index }, - { 11459, SecondaryColor3usvEXT_remap_index }, + { 27402, SecondaryColor3svEXT_remap_index }, + { 24167, SecondaryColor3ubEXT_remap_index }, + { 18777, SecondaryColor3ubvEXT_remap_index }, + { 11419, SecondaryColor3uiEXT_remap_index }, + { 20190, SecondaryColor3uivEXT_remap_index }, + { 22935, SecondaryColor3usEXT_remap_index }, + { 11492, SecondaryColor3usvEXT_remap_index }, { 10435, SecondaryColorPointerEXT_remap_index }, - { 22708, MultiDrawArraysEXT_remap_index }, - { 18434, MultiDrawElementsEXT_remap_index }, - { 18629, FogCoordPointerEXT_remap_index }, + { 22784, MultiDrawArraysEXT_remap_index }, + { 18467, MultiDrawElementsEXT_remap_index }, + { 18662, FogCoordPointerEXT_remap_index }, { 4044, FogCoorddEXT_remap_index }, - { 27900, FogCoorddvEXT_remap_index }, + { 27976, FogCoorddvEXT_remap_index }, { 4136, FogCoordfEXT_remap_index }, - { 24014, FogCoordfvEXT_remap_index }, - { 16752, PixelTexGenSGIX_remap_index }, - { 24599, BlendFuncSeparateEXT_remap_index }, + { 24090, FogCoordfvEXT_remap_index }, + { 16785, PixelTexGenSGIX_remap_index }, + { 24675, BlendFuncSeparateEXT_remap_index }, { 5928, FlushVertexArrayRangeNV_remap_index }, { 4660, VertexArrayRangeNV_remap_index }, - { 24983, CombinerInputNV_remap_index }, + { 25059, CombinerInputNV_remap_index }, { 1946, CombinerOutputNV_remap_index }, - { 27479, CombinerParameterfNV_remap_index }, + { 27555, CombinerParameterfNV_remap_index }, { 4580, CombinerParameterfvNV_remap_index }, - { 19702, CombinerParameteriNV_remap_index }, - { 28870, CombinerParameterivNV_remap_index }, + { 19735, CombinerParameteriNV_remap_index }, + { 28946, CombinerParameterivNV_remap_index }, { 6298, FinalCombinerInputNV_remap_index }, { 8725, GetCombinerInputParameterfvNV_remap_index }, - { 28707, GetCombinerInputParameterivNV_remap_index }, + { 28783, GetCombinerInputParameterivNV_remap_index }, { 6097, GetCombinerOutputParameterfvNV_remap_index }, - { 12113, GetCombinerOutputParameterivNV_remap_index }, + { 12146, GetCombinerOutputParameterivNV_remap_index }, { 5673, GetFinalCombinerInputParameterfvNV_remap_index }, - { 21913, GetFinalCombinerInputParameterivNV_remap_index }, - { 11131, ResizeBuffersMESA_remap_index }, + { 21989, GetFinalCombinerInputParameterivNV_remap_index }, + { 11164, ResizeBuffersMESA_remap_index }, { 9842, WindowPos2dMESA_remap_index }, { 944, WindowPos2dvMESA_remap_index }, - { 29698, WindowPos2fMESA_remap_index }, + { 29774, WindowPos2fMESA_remap_index }, { 6965, WindowPos2fvMESA_remap_index }, - { 15981, WindowPos2iMESA_remap_index }, - { 17958, WindowPos2ivMESA_remap_index }, - { 18533, WindowPos2sMESA_remap_index }, + { 16014, WindowPos2iMESA_remap_index }, + { 17991, WindowPos2ivMESA_remap_index }, + { 18566, WindowPos2sMESA_remap_index }, { 4916, WindowPos2svMESA_remap_index }, { 6790, WindowPos3dMESA_remap_index }, - { 12360, WindowPos3dvMESA_remap_index }, + { 12393, WindowPos3dvMESA_remap_index }, { 472, WindowPos3fMESA_remap_index }, - { 13141, WindowPos3fvMESA_remap_index }, - { 21208, WindowPos3iMESA_remap_index }, - { 26828, WindowPos3ivMESA_remap_index }, - { 16498, WindowPos3sMESA_remap_index }, - { 28156, WindowPos3svMESA_remap_index }, + { 13174, WindowPos3fvMESA_remap_index }, + { 21284, WindowPos3iMESA_remap_index }, + { 26904, WindowPos3ivMESA_remap_index }, + { 16531, WindowPos3sMESA_remap_index }, + { 28232, WindowPos3svMESA_remap_index }, { 9793, WindowPos4dMESA_remap_index }, - { 14994, WindowPos4dvMESA_remap_index }, - { 12319, WindowPos4fMESA_remap_index }, - { 27233, WindowPos4fvMESA_remap_index }, - { 26981, WindowPos4iMESA_remap_index }, - { 10970, WindowPos4ivMESA_remap_index }, - { 16631, WindowPos4sMESA_remap_index }, + { 15027, WindowPos4dvMESA_remap_index }, + { 12352, WindowPos4fMESA_remap_index }, + { 27309, WindowPos4fvMESA_remap_index }, + { 27057, WindowPos4iMESA_remap_index }, + { 11003, WindowPos4ivMESA_remap_index }, + { 16664, WindowPos4sMESA_remap_index }, { 2857, WindowPos4svMESA_remap_index }, - { 23757, MultiModeDrawArraysIBM_remap_index }, - { 25701, MultiModeDrawElementsIBM_remap_index }, - { 10781, DeleteFencesNV_remap_index }, - { 24830, FinishFenceNV_remap_index }, + { 23833, MultiModeDrawArraysIBM_remap_index }, + { 25777, MultiModeDrawElementsIBM_remap_index }, + { 10814, DeleteFencesNV_remap_index }, + { 24906, FinishFenceNV_remap_index }, { 3287, GenFencesNV_remap_index }, - { 14974, GetFenceivNV_remap_index }, + { 15007, GetFenceivNV_remap_index }, { 7257, IsFenceNV_remap_index }, - { 12040, SetFenceNV_remap_index }, + { 12073, SetFenceNV_remap_index }, { 3744, TestFenceNV_remap_index }, - { 28127, AreProgramsResidentNV_remap_index }, - { 27521, BindProgramNV_remap_index }, - { 22942, DeleteProgramsNV_remap_index }, - { 18962, ExecuteProgramNV_remap_index }, - { 29591, GenProgramsNV_remap_index }, - { 20616, GetProgramParameterdvNV_remap_index }, + { 28203, AreProgramsResidentNV_remap_index }, + { 27597, BindProgramNV_remap_index }, + { 23018, DeleteProgramsNV_remap_index }, + { 18995, ExecuteProgramNV_remap_index }, + { 29667, GenProgramsNV_remap_index }, + { 20649, GetProgramParameterdvNV_remap_index }, { 9300, GetProgramParameterfvNV_remap_index }, - { 23296, GetProgramStringNV_remap_index }, - { 21602, GetProgramivNV_remap_index }, - { 20850, GetTrackMatrixivNV_remap_index }, - { 23092, GetVertexAttribPointervNV_remap_index }, - { 21846, GetVertexAttribdvNV_remap_index }, - { 16471, GetVertexAttribfvNV_remap_index }, - { 16162, GetVertexAttribivNV_remap_index }, - { 16878, IsProgramNV_remap_index }, + { 23372, GetProgramStringNV_remap_index }, + { 21678, GetProgramivNV_remap_index }, + { 20883, GetTrackMatrixivNV_remap_index }, + { 23168, GetVertexAttribPointervNV_remap_index }, + { 21922, GetVertexAttribdvNV_remap_index }, + { 16504, GetVertexAttribfvNV_remap_index }, + { 16195, GetVertexAttribivNV_remap_index }, + { 16911, IsProgramNV_remap_index }, { 8306, LoadProgramNV_remap_index }, - { 24695, ProgramParameters4dvNV_remap_index }, - { 21532, ProgramParameters4fvNV_remap_index }, - { 18262, RequestResidentProgramsNV_remap_index }, - { 19680, TrackMatrixNV_remap_index }, - { 28684, VertexAttrib1dNV_remap_index }, - { 11981, VertexAttrib1dvNV_remap_index }, - { 25233, VertexAttrib1fNV_remap_index }, + { 24771, ProgramParameters4dvNV_remap_index }, + { 21608, ProgramParameters4fvNV_remap_index }, + { 18295, RequestResidentProgramsNV_remap_index }, + { 19713, TrackMatrixNV_remap_index }, + { 28760, VertexAttrib1dNV_remap_index }, + { 12014, VertexAttrib1dvNV_remap_index }, + { 25309, VertexAttrib1fNV_remap_index }, { 2245, VertexAttrib1fvNV_remap_index }, - { 27290, VertexAttrib1sNV_remap_index }, - { 13214, VertexAttrib1svNV_remap_index }, + { 27366, VertexAttrib1sNV_remap_index }, + { 13247, VertexAttrib1svNV_remap_index }, { 4251, VertexAttrib2dNV_remap_index }, - { 11896, VertexAttrib2dvNV_remap_index }, - { 17717, VertexAttrib2fNV_remap_index }, - { 11507, VertexAttrib2fvNV_remap_index }, + { 11929, VertexAttrib2dvNV_remap_index }, + { 17750, VertexAttrib2fNV_remap_index }, + { 11540, VertexAttrib2fvNV_remap_index }, { 5076, VertexAttrib2sNV_remap_index }, - { 16552, VertexAttrib2svNV_remap_index }, + { 16585, VertexAttrib2svNV_remap_index }, { 9990, VertexAttrib3dNV_remap_index }, - { 28377, VertexAttrib3dvNV_remap_index }, + { 28453, VertexAttrib3dvNV_remap_index }, { 9112, VertexAttrib3fNV_remap_index }, - { 21873, VertexAttrib3fvNV_remap_index }, - { 25208, VertexAttrib3sNV_remap_index }, - { 20877, VertexAttrib3svNV_remap_index }, - { 25675, VertexAttrib4dNV_remap_index }, - { 29628, VertexAttrib4dvNV_remap_index }, + { 21949, VertexAttrib3fvNV_remap_index }, + { 25284, VertexAttrib3sNV_remap_index }, + { 20910, VertexAttrib3svNV_remap_index }, + { 25751, VertexAttrib4dNV_remap_index }, + { 29704, VertexAttrib4dvNV_remap_index }, { 3945, VertexAttrib4fNV_remap_index }, { 8356, VertexAttrib4fvNV_remap_index }, - { 23641, VertexAttrib4sNV_remap_index }, + { 23717, VertexAttrib4sNV_remap_index }, { 1293, VertexAttrib4svNV_remap_index }, { 4409, VertexAttrib4ubNV_remap_index }, { 734, VertexAttrib4ubvNV_remap_index }, - { 19142, VertexAttribPointerNV_remap_index }, + { 19175, VertexAttribPointerNV_remap_index }, { 2097, VertexAttribs1dvNV_remap_index }, - { 16576, VertexAttribs1fvNV_remap_index }, - { 29428, VertexAttribs1svNV_remap_index }, + { 16609, VertexAttribs1fvNV_remap_index }, + { 29504, VertexAttribs1svNV_remap_index }, { 9137, VertexAttribs2dvNV_remap_index }, - { 22435, VertexAttribs2fvNV_remap_index }, - { 15494, VertexAttribs2svNV_remap_index }, + { 22511, VertexAttribs2fvNV_remap_index }, + { 15527, VertexAttribs2svNV_remap_index }, { 4608, VertexAttribs3dvNV_remap_index }, { 1977, VertexAttribs3fvNV_remap_index }, - { 26576, VertexAttribs3svNV_remap_index }, - { 23731, VertexAttribs4dvNV_remap_index }, + { 26652, VertexAttribs3svNV_remap_index }, + { 23807, VertexAttribs4dvNV_remap_index }, { 4634, VertexAttribs4fvNV_remap_index }, - { 29215, VertexAttribs4svNV_remap_index }, - { 26324, VertexAttribs4ubvNV_remap_index }, - { 23833, GetTexBumpParameterfvATI_remap_index }, - { 29469, GetTexBumpParameterivATI_remap_index }, - { 16216, TexBumpParameterfvATI_remap_index }, - { 18133, TexBumpParameterivATI_remap_index }, - { 13760, AlphaFragmentOp1ATI_remap_index }, + { 29291, VertexAttribs4svNV_remap_index }, + { 26400, VertexAttribs4ubvNV_remap_index }, + { 23909, GetTexBumpParameterfvATI_remap_index }, + { 29545, GetTexBumpParameterivATI_remap_index }, + { 16249, TexBumpParameterfvATI_remap_index }, + { 18166, TexBumpParameterivATI_remap_index }, + { 13793, AlphaFragmentOp1ATI_remap_index }, { 9652, AlphaFragmentOp2ATI_remap_index }, - { 21789, AlphaFragmentOp3ATI_remap_index }, - { 26503, BeginFragmentShaderATI_remap_index }, - { 27720, BindFragmentShaderATI_remap_index }, - { 21006, ColorFragmentOp1ATI_remap_index }, + { 21865, AlphaFragmentOp3ATI_remap_index }, + { 26579, BeginFragmentShaderATI_remap_index }, + { 27796, BindFragmentShaderATI_remap_index }, + { 21039, ColorFragmentOp1ATI_remap_index }, { 3823, ColorFragmentOp2ATI_remap_index }, - { 28022, ColorFragmentOp3ATI_remap_index }, + { 28098, ColorFragmentOp3ATI_remap_index }, { 4753, DeleteFragmentShaderATI_remap_index }, - { 29652, EndFragmentShaderATI_remap_index }, - { 28898, GenFragmentShadersATI_remap_index }, - { 22566, PassTexCoordATI_remap_index }, + { 29728, EndFragmentShaderATI_remap_index }, + { 28974, GenFragmentShadersATI_remap_index }, + { 22642, PassTexCoordATI_remap_index }, { 5996, SampleMapATI_remap_index }, { 5769, SetFragmentShaderConstantATI_remap_index }, { 319, PointParameteriNV_remap_index }, - { 12521, PointParameterivNV_remap_index }, - { 25514, ActiveStencilFaceEXT_remap_index }, - { 24355, BindVertexArrayAPPLE_remap_index }, + { 12554, PointParameterivNV_remap_index }, + { 25590, ActiveStencilFaceEXT_remap_index }, + { 24431, BindVertexArrayAPPLE_remap_index }, { 2522, DeleteVertexArraysAPPLE_remap_index }, - { 15833, GenVertexArraysAPPLE_remap_index }, - { 20681, IsVertexArrayAPPLE_remap_index }, + { 15866, GenVertexArraysAPPLE_remap_index }, + { 20714, IsVertexArrayAPPLE_remap_index }, { 775, GetProgramNamedParameterdvNV_remap_index }, { 3128, GetProgramNamedParameterfvNV_remap_index }, - { 23864, ProgramNamedParameter4dNV_remap_index }, - { 12796, ProgramNamedParameter4dvNV_remap_index }, + { 23940, ProgramNamedParameter4dNV_remap_index }, + { 12829, ProgramNamedParameter4dvNV_remap_index }, { 7893, ProgramNamedParameter4fNV_remap_index }, { 10400, ProgramNamedParameter4fvNV_remap_index }, - { 21511, DepthBoundsEXT_remap_index }, + { 21587, DepthBoundsEXT_remap_index }, { 1043, BlendEquationSeparateEXT_remap_index }, - { 12915, BindFramebufferEXT_remap_index }, - { 22753, BindRenderbufferEXT_remap_index }, + { 12948, BindFramebufferEXT_remap_index }, + { 22829, BindRenderbufferEXT_remap_index }, { 8575, CheckFramebufferStatusEXT_remap_index }, - { 19971, DeleteFramebuffersEXT_remap_index }, - { 28279, DeleteRenderbuffersEXT_remap_index }, - { 11920, FramebufferRenderbufferEXT_remap_index }, - { 12057, FramebufferTexture1DEXT_remap_index }, + { 20004, DeleteFramebuffersEXT_remap_index }, + { 28355, DeleteRenderbuffersEXT_remap_index }, + { 11953, FramebufferRenderbufferEXT_remap_index }, + { 12090, FramebufferTexture1DEXT_remap_index }, { 10228, FramebufferTexture2DEXT_remap_index }, { 9895, FramebufferTexture3DEXT_remap_index }, - { 20573, GenFramebuffersEXT_remap_index }, - { 15380, GenRenderbuffersEXT_remap_index }, + { 20606, GenFramebuffersEXT_remap_index }, + { 15413, GenRenderbuffersEXT_remap_index }, { 5715, GenerateMipmapEXT_remap_index }, - { 19202, GetFramebufferAttachmentParameterivEXT_remap_index }, - { 28804, GetRenderbufferParameterivEXT_remap_index }, - { 18013, IsFramebufferEXT_remap_index }, - { 29551, IsRenderbufferEXT_remap_index }, + { 19235, GetFramebufferAttachmentParameterivEXT_remap_index }, + { 28880, GetRenderbufferParameterivEXT_remap_index }, + { 18046, IsFramebufferEXT_remap_index }, + { 29627, IsRenderbufferEXT_remap_index }, { 7204, RenderbufferStorageEXT_remap_index }, { 651, BlitFramebufferEXT_remap_index }, - { 12615, BufferParameteriAPPLE_remap_index }, - { 16910, FlushMappedBufferRangeAPPLE_remap_index }, + { 12648, BufferParameteriAPPLE_remap_index }, + { 16943, FlushMappedBufferRangeAPPLE_remap_index }, { 2701, FramebufferTextureLayerEXT_remap_index }, { 8277, ColorMaskIndexedEXT_remap_index }, - { 23180, DisableIndexedEXT_remap_index }, - { 23488, EnableIndexedEXT_remap_index }, - { 19173, GetBooleanIndexedvEXT_remap_index }, + { 23256, DisableIndexedEXT_remap_index }, + { 23564, EnableIndexedEXT_remap_index }, + { 19206, GetBooleanIndexedvEXT_remap_index }, { 9685, GetIntegerIndexedvEXT_remap_index }, - { 20047, IsEnabledIndexedEXT_remap_index }, + { 20080, IsEnabledIndexedEXT_remap_index }, { 4074, BeginConditionalRenderNV_remap_index }, - { 22539, EndConditionalRenderNV_remap_index }, - { 26225, ProvokingVertexEXT_remap_index }, + { 22615, EndConditionalRenderNV_remap_index }, + { 26301, ProvokingVertexEXT_remap_index }, { 9521, GetTexParameterPointervAPPLE_remap_index }, { 4436, TextureRangeAPPLE_remap_index }, - { 25540, StencilFuncSeparateATI_remap_index }, - { 15900, ProgramEnvParameters4fvEXT_remap_index }, - { 15118, ProgramLocalParameters4fvEXT_remap_index }, - { 12449, GetQueryObjecti64vEXT_remap_index }, + { 25616, StencilFuncSeparateATI_remap_index }, + { 15933, ProgramEnvParameters4fvEXT_remap_index }, + { 15151, ProgramLocalParameters4fvEXT_remap_index }, + { 12482, GetQueryObjecti64vEXT_remap_index }, { 9163, GetQueryObjectui64vEXT_remap_index }, + { 21108, EGLImageTargetRenderbufferStorageOES_remap_index }, + { 10753, EGLImageTargetTexture2DOES_remap_index }, { -1, -1 } }; @@ -4770,8 +4780,8 @@ static const struct gl_function_remap MESA_alt_functions[] = { /* from GL_EXT_blend_minmax */ { 9952, _gloffset_BlendEquation }, /* from GL_EXT_color_subtable */ - { 15016, _gloffset_ColorSubTable }, - { 28211, _gloffset_CopyColorSubTable }, + { 15049, _gloffset_ColorSubTable }, + { 28287, _gloffset_CopyColorSubTable }, /* from GL_EXT_convolution */ { 213, _gloffset_ConvolutionFilter1D }, { 2284, _gloffset_CopyConvolutionFilter1D }, @@ -4779,62 +4789,62 @@ static const struct gl_function_remap MESA_alt_functions[] = { { 7553, _gloffset_ConvolutionFilter2D }, { 7719, _gloffset_ConvolutionParameteriv }, { 8179, _gloffset_ConvolutionParameterfv }, - { 18161, _gloffset_GetSeparableFilter }, - { 21262, _gloffset_SeparableFilter2D }, - { 22091, _gloffset_ConvolutionParameteri }, - { 22214, _gloffset_ConvolutionParameterf }, - { 23667, _gloffset_GetConvolutionParameterfv }, - { 24521, _gloffset_GetConvolutionFilter }, - { 26765, _gloffset_CopyConvolutionFilter2D }, + { 18194, _gloffset_GetSeparableFilter }, + { 21338, _gloffset_SeparableFilter2D }, + { 22167, _gloffset_ConvolutionParameteri }, + { 22290, _gloffset_ConvolutionParameterf }, + { 23743, _gloffset_GetConvolutionParameterfv }, + { 24597, _gloffset_GetConvolutionFilter }, + { 26841, _gloffset_CopyConvolutionFilter2D }, /* from GL_EXT_copy_texture */ - { 13274, _gloffset_CopyTexSubImage3D }, - { 14756, _gloffset_CopyTexImage2D }, - { 21699, _gloffset_CopyTexImage1D }, - { 24202, _gloffset_CopyTexSubImage2D }, - { 26403, _gloffset_CopyTexSubImage1D }, + { 13307, _gloffset_CopyTexSubImage3D }, + { 14789, _gloffset_CopyTexImage2D }, + { 21775, _gloffset_CopyTexImage1D }, + { 24278, _gloffset_CopyTexSubImage2D }, + { 26479, _gloffset_CopyTexSubImage1D }, /* from GL_EXT_draw_range_elements */ { 8462, _gloffset_DrawRangeElements }, /* from GL_EXT_histogram */ { 812, _gloffset_Histogram }, { 3088, _gloffset_ResetHistogram }, { 8834, _gloffset_GetMinmax }, - { 13608, _gloffset_GetHistogramParameterfv }, - { 21624, _gloffset_GetMinmaxParameteriv }, - { 23557, _gloffset_ResetMinmax }, - { 24418, _gloffset_GetHistogramParameteriv }, - { 25474, _gloffset_GetHistogram }, - { 27836, _gloffset_Minmax }, - { 29298, _gloffset_GetMinmaxParameterfv }, + { 13641, _gloffset_GetHistogramParameterfv }, + { 21700, _gloffset_GetMinmaxParameteriv }, + { 23633, _gloffset_ResetMinmax }, + { 24494, _gloffset_GetHistogramParameteriv }, + { 25550, _gloffset_GetHistogram }, + { 27912, _gloffset_Minmax }, + { 29374, _gloffset_GetMinmaxParameterfv }, /* from GL_EXT_paletted_texture */ { 7415, _gloffset_ColorTable }, - { 13454, _gloffset_GetColorTable }, - { 20320, _gloffset_GetColorTableParameterfv }, - { 22270, _gloffset_GetColorTableParameteriv }, + { 13487, _gloffset_GetColorTable }, + { 20353, _gloffset_GetColorTableParameterfv }, + { 22346, _gloffset_GetColorTableParameteriv }, /* from GL_EXT_subtexture */ { 6136, _gloffset_TexSubImage1D }, { 9448, _gloffset_TexSubImage2D }, /* from GL_EXT_texture3D */ { 1658, _gloffset_TexImage3D }, - { 20089, _gloffset_TexSubImage3D }, + { 20122, _gloffset_TexSubImage3D }, /* from GL_EXT_texture_object */ { 2964, _gloffset_PrioritizeTextures }, { 6585, _gloffset_AreTexturesResident }, - { 12005, _gloffset_GenTextures }, - { 13940, _gloffset_DeleteTextures }, - { 17191, _gloffset_IsTexture }, - { 26468, _gloffset_BindTexture }, + { 12038, _gloffset_GenTextures }, + { 13973, _gloffset_DeleteTextures }, + { 17224, _gloffset_IsTexture }, + { 26544, _gloffset_BindTexture }, /* from GL_EXT_vertex_array */ - { 21451, _gloffset_ArrayElement }, - { 27424, _gloffset_GetPointerv }, - { 28925, _gloffset_DrawArrays }, + { 21527, _gloffset_ArrayElement }, + { 27500, _gloffset_GetPointerv }, + { 29001, _gloffset_DrawArrays }, /* from GL_SGI_color_table */ { 6703, _gloffset_ColorTableParameteriv }, { 7415, _gloffset_ColorTable }, - { 13454, _gloffset_GetColorTable }, - { 13564, _gloffset_CopyColorTable }, - { 17052, _gloffset_ColorTableParameterfv }, - { 20320, _gloffset_GetColorTableParameterfv }, - { 22270, _gloffset_GetColorTableParameteriv }, + { 13487, _gloffset_GetColorTable }, + { 13597, _gloffset_CopyColorTable }, + { 17085, _gloffset_ColorTableParameterfv }, + { 20353, _gloffset_GetColorTableParameterfv }, + { 22346, _gloffset_GetColorTableParameteriv }, /* from GL_VERSION_1_3 */ { 381, _gloffset_MultiTexCoord3sARB }, { 613, _gloffset_ActiveTextureARB }, @@ -4847,29 +4857,29 @@ static const struct gl_function_remap MESA_alt_functions[] = { { 9714, _gloffset_MultiTexCoord4sARB }, { 10314, _gloffset_MultiTexCoord2dvARB }, { 10696, _gloffset_MultiTexCoord1svARB }, - { 10992, _gloffset_MultiTexCoord3svARB }, - { 11053, _gloffset_MultiTexCoord4iARB }, - { 11776, _gloffset_MultiTexCoord3iARB }, - { 12478, _gloffset_MultiTexCoord1dARB }, - { 12644, _gloffset_MultiTexCoord3dvARB }, - { 13808, _gloffset_MultiTexCoord3ivARB }, - { 13853, _gloffset_MultiTexCoord2sARB }, - { 15073, _gloffset_MultiTexCoord4ivARB }, - { 16702, _gloffset_ClientActiveTextureARB }, - { 18918, _gloffset_MultiTexCoord2dARB }, - { 19322, _gloffset_MultiTexCoord4dvARB }, - { 19608, _gloffset_MultiTexCoord4fvARB }, - { 20461, _gloffset_MultiTexCoord3fARB }, - { 22798, _gloffset_MultiTexCoord4dARB }, - { 23002, _gloffset_MultiTexCoord1sARB }, - { 23204, _gloffset_MultiTexCoord1dvARB }, - { 24046, _gloffset_MultiTexCoord1ivARB }, - { 24139, _gloffset_MultiTexCoord2ivARB }, - { 24478, _gloffset_MultiTexCoord1iARB }, - { 25749, _gloffset_MultiTexCoord4svARB }, - { 26267, _gloffset_MultiTexCoord1fARB }, - { 26530, _gloffset_MultiTexCoord4fARB }, - { 28759, _gloffset_MultiTexCoord2fvARB }, + { 11025, _gloffset_MultiTexCoord3svARB }, + { 11086, _gloffset_MultiTexCoord4iARB }, + { 11809, _gloffset_MultiTexCoord3iARB }, + { 12511, _gloffset_MultiTexCoord1dARB }, + { 12677, _gloffset_MultiTexCoord3dvARB }, + { 13841, _gloffset_MultiTexCoord3ivARB }, + { 13886, _gloffset_MultiTexCoord2sARB }, + { 15106, _gloffset_MultiTexCoord4ivARB }, + { 16735, _gloffset_ClientActiveTextureARB }, + { 18951, _gloffset_MultiTexCoord2dARB }, + { 19355, _gloffset_MultiTexCoord4dvARB }, + { 19641, _gloffset_MultiTexCoord4fvARB }, + { 20494, _gloffset_MultiTexCoord3fARB }, + { 22874, _gloffset_MultiTexCoord4dARB }, + { 23078, _gloffset_MultiTexCoord1sARB }, + { 23280, _gloffset_MultiTexCoord1dvARB }, + { 24122, _gloffset_MultiTexCoord1ivARB }, + { 24215, _gloffset_MultiTexCoord2ivARB }, + { 24554, _gloffset_MultiTexCoord1iARB }, + { 25825, _gloffset_MultiTexCoord4svARB }, + { 26343, _gloffset_MultiTexCoord1fARB }, + { 26606, _gloffset_MultiTexCoord4fARB }, + { 28835, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; @@ -4941,10 +4951,10 @@ static const struct gl_function_remap GL_ARB_map_buffer_range_functions[] = { #if defined(need_GL_ARB_matrix_palette) static const struct gl_function_remap GL_ARB_matrix_palette_functions[] = { { 3339, -1 }, /* MatrixIndexusvARB */ - { 11597, -1 }, /* MatrixIndexuivARB */ - { 12766, -1 }, /* MatrixIndexPointerARB */ - { 17440, -1 }, /* CurrentPaletteMatrixARB */ - { 20205, -1 }, /* MatrixIndexubvARB */ + { 11630, -1 }, /* MatrixIndexuivARB */ + { 12799, -1 }, /* MatrixIndexPointerARB */ + { 17473, -1 }, /* CurrentPaletteMatrixARB */ + { 20238, -1 }, /* MatrixIndexubvARB */ { -1, -1 } }; #endif @@ -5017,13 +5027,13 @@ static const struct gl_function_remap GL_ARB_vertex_blend_functions[] = { { 2226, -1 }, /* WeightubvARB */ { 5603, -1 }, /* WeightivARB */ { 9817, -1 }, /* WeightPointerARB */ - { 12235, -1 }, /* WeightfvARB */ - { 15520, -1 }, /* WeightbvARB */ - { 18586, -1 }, /* WeightusvARB */ - { 21188, -1 }, /* VertexBlendARB */ - { 26351, -1 }, /* WeightsvARB */ - { 28261, -1 }, /* WeightdvARB */ - { 28959, -1 }, /* WeightuivARB */ + { 12268, -1 }, /* WeightfvARB */ + { 15553, -1 }, /* WeightbvARB */ + { 18619, -1 }, /* WeightusvARB */ + { 21264, -1 }, /* VertexBlendARB */ + { 26427, -1 }, /* WeightsvARB */ + { 28337, -1 }, /* WeightdvARB */ + { 29035, -1 }, /* WeightuivARB */ { -1, -1 } }; #endif @@ -5121,8 +5131,8 @@ static const struct gl_function_remap GL_EXT_blend_minmax_functions[] = { #if defined(need_GL_EXT_color_subtable) static const struct gl_function_remap GL_EXT_color_subtable_functions[] = { - { 15016, _gloffset_ColorSubTable }, - { 28211, _gloffset_CopyColorSubTable }, + { 15049, _gloffset_ColorSubTable }, + { 28287, _gloffset_CopyColorSubTable }, { -1, -1 } }; #endif @@ -5142,13 +5152,13 @@ static const struct gl_function_remap GL_EXT_convolution_functions[] = { { 7553, _gloffset_ConvolutionFilter2D }, { 7719, _gloffset_ConvolutionParameteriv }, { 8179, _gloffset_ConvolutionParameterfv }, - { 18161, _gloffset_GetSeparableFilter }, - { 21262, _gloffset_SeparableFilter2D }, - { 22091, _gloffset_ConvolutionParameteri }, - { 22214, _gloffset_ConvolutionParameterf }, - { 23667, _gloffset_GetConvolutionParameterfv }, - { 24521, _gloffset_GetConvolutionFilter }, - { 26765, _gloffset_CopyConvolutionFilter2D }, + { 18194, _gloffset_GetSeparableFilter }, + { 21338, _gloffset_SeparableFilter2D }, + { 22167, _gloffset_ConvolutionParameteri }, + { 22290, _gloffset_ConvolutionParameterf }, + { 23743, _gloffset_GetConvolutionParameterfv }, + { 24597, _gloffset_GetConvolutionFilter }, + { 26841, _gloffset_CopyConvolutionFilter2D }, { -1, -1 } }; #endif @@ -5156,38 +5166,38 @@ static const struct gl_function_remap GL_EXT_convolution_functions[] = { #if defined(need_GL_EXT_coordinate_frame) static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { { 9332, -1 }, /* TangentPointerEXT */ - { 11111, -1 }, /* Binormal3ivEXT */ - { 11729, -1 }, /* Tangent3sEXT */ - { 12831, -1 }, /* Tangent3fvEXT */ - { 16452, -1 }, /* Tangent3dvEXT */ - { 17138, -1 }, /* Binormal3bvEXT */ - { 18214, -1 }, /* Binormal3dEXT */ - { 20137, -1 }, /* Tangent3fEXT */ - { 22163, -1 }, /* Binormal3sEXT */ - { 22608, -1 }, /* Tangent3ivEXT */ - { 22627, -1 }, /* Tangent3dEXT */ - { 23431, -1 }, /* Binormal3svEXT */ - { 23944, -1 }, /* Binormal3fEXT */ - { 24796, -1 }, /* Binormal3dvEXT */ - { 25971, -1 }, /* Tangent3iEXT */ - { 27050, -1 }, /* Tangent3bvEXT */ - { 27459, -1 }, /* Tangent3bEXT */ - { 27984, -1 }, /* Binormal3fvEXT */ - { 28658, -1 }, /* BinormalPointerEXT */ - { 29063, -1 }, /* Tangent3svEXT */ - { 29500, -1 }, /* Binormal3bEXT */ - { 29677, -1 }, /* Binormal3iEXT */ + { 11144, -1 }, /* Binormal3ivEXT */ + { 11762, -1 }, /* Tangent3sEXT */ + { 12864, -1 }, /* Tangent3fvEXT */ + { 16485, -1 }, /* Tangent3dvEXT */ + { 17171, -1 }, /* Binormal3bvEXT */ + { 18247, -1 }, /* Binormal3dEXT */ + { 20170, -1 }, /* Tangent3fEXT */ + { 22239, -1 }, /* Binormal3sEXT */ + { 22684, -1 }, /* Tangent3ivEXT */ + { 22703, -1 }, /* Tangent3dEXT */ + { 23507, -1 }, /* Binormal3svEXT */ + { 24020, -1 }, /* Binormal3fEXT */ + { 24872, -1 }, /* Binormal3dvEXT */ + { 26047, -1 }, /* Tangent3iEXT */ + { 27126, -1 }, /* Tangent3bvEXT */ + { 27535, -1 }, /* Tangent3bEXT */ + { 28060, -1 }, /* Binormal3fvEXT */ + { 28734, -1 }, /* BinormalPointerEXT */ + { 29139, -1 }, /* Tangent3svEXT */ + { 29576, -1 }, /* Binormal3bEXT */ + { 29753, -1 }, /* Binormal3iEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_copy_texture) static const struct gl_function_remap GL_EXT_copy_texture_functions[] = { - { 13274, _gloffset_CopyTexSubImage3D }, - { 14756, _gloffset_CopyTexImage2D }, - { 21699, _gloffset_CopyTexImage1D }, - { 24202, _gloffset_CopyTexSubImage2D }, - { 26403, _gloffset_CopyTexSubImage1D }, + { 13307, _gloffset_CopyTexSubImage3D }, + { 14789, _gloffset_CopyTexImage2D }, + { 21775, _gloffset_CopyTexImage1D }, + { 24278, _gloffset_CopyTexSubImage2D }, + { 26479, _gloffset_CopyTexSubImage1D }, { -1, -1 } }; #endif @@ -5260,13 +5270,13 @@ static const struct gl_function_remap GL_EXT_histogram_functions[] = { { 812, _gloffset_Histogram }, { 3088, _gloffset_ResetHistogram }, { 8834, _gloffset_GetMinmax }, - { 13608, _gloffset_GetHistogramParameterfv }, - { 21624, _gloffset_GetMinmaxParameteriv }, - { 23557, _gloffset_ResetMinmax }, - { 24418, _gloffset_GetHistogramParameteriv }, - { 25474, _gloffset_GetHistogram }, - { 27836, _gloffset_Minmax }, - { 29298, _gloffset_GetMinmaxParameterfv }, + { 13641, _gloffset_GetHistogramParameterfv }, + { 21700, _gloffset_GetMinmaxParameteriv }, + { 23633, _gloffset_ResetMinmax }, + { 24494, _gloffset_GetHistogramParameteriv }, + { 25550, _gloffset_GetHistogram }, + { 27912, _gloffset_Minmax }, + { 29374, _gloffset_GetMinmaxParameterfv }, { -1, -1 } }; #endif @@ -5280,16 +5290,16 @@ static const struct gl_function_remap GL_EXT_index_func_functions[] = { #if defined(need_GL_EXT_index_material) static const struct gl_function_remap GL_EXT_index_material_functions[] = { - { 18673, -1 }, /* IndexMaterialEXT */ + { 18706, -1 }, /* IndexMaterialEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_light_texture) static const struct gl_function_remap GL_EXT_light_texture_functions[] = { - { 23451, -1 }, /* ApplyTextureEXT */ - { 23511, -1 }, /* TextureMaterialEXT */ - { 23536, -1 }, /* TextureLightEXT */ + { 23527, -1 }, /* ApplyTextureEXT */ + { 23587, -1 }, /* TextureMaterialEXT */ + { 23612, -1 }, /* TextureLightEXT */ { -1, -1 } }; #endif @@ -5311,9 +5321,9 @@ static const struct gl_function_remap GL_EXT_multisample_functions[] = { #if defined(need_GL_EXT_paletted_texture) static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = { { 7415, _gloffset_ColorTable }, - { 13454, _gloffset_GetColorTable }, - { 20320, _gloffset_GetColorTableParameterfv }, - { 22270, _gloffset_GetColorTableParameteriv }, + { 13487, _gloffset_GetColorTable }, + { 20353, _gloffset_GetColorTableParameterfv }, + { 22346, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif @@ -5321,9 +5331,9 @@ static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = { #if defined(need_GL_EXT_pixel_transform) static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = { { 9573, -1 }, /* PixelTransformParameterfvEXT */ - { 19287, -1 }, /* PixelTransformParameterfEXT */ - { 19367, -1 }, /* PixelTransformParameteriEXT */ - { 28622, -1 }, /* PixelTransformParameterivEXT */ + { 19320, -1 }, /* PixelTransformParameterfEXT */ + { 19400, -1 }, /* PixelTransformParameteriEXT */ + { 28698, -1 }, /* PixelTransformParameterivEXT */ { -1, -1 } }; #endif @@ -5374,7 +5384,7 @@ static const struct gl_function_remap GL_EXT_subtexture_functions[] = { #if defined(need_GL_EXT_texture3D) static const struct gl_function_remap GL_EXT_texture3D_functions[] = { { 1658, _gloffset_TexImage3D }, - { 20089, _gloffset_TexSubImage3D }, + { 20122, _gloffset_TexSubImage3D }, { -1, -1 } }; #endif @@ -5390,17 +5400,17 @@ static const struct gl_function_remap GL_EXT_texture_array_functions[] = { static const struct gl_function_remap GL_EXT_texture_object_functions[] = { { 2964, _gloffset_PrioritizeTextures }, { 6585, _gloffset_AreTexturesResident }, - { 12005, _gloffset_GenTextures }, - { 13940, _gloffset_DeleteTextures }, - { 17191, _gloffset_IsTexture }, - { 26468, _gloffset_BindTexture }, + { 12038, _gloffset_GenTextures }, + { 13973, _gloffset_DeleteTextures }, + { 17224, _gloffset_IsTexture }, + { 26544, _gloffset_BindTexture }, { -1, -1 } }; #endif #if defined(need_GL_EXT_texture_perturb_normal) static const struct gl_function_remap GL_EXT_texture_perturb_normal_functions[] = { - { 12185, -1 }, /* TextureNormalEXT */ + { 12218, -1 }, /* TextureNormalEXT */ { -1, -1 } }; #endif @@ -5415,18 +5425,18 @@ static const struct gl_function_remap GL_EXT_timer_query_functions[] = { #if defined(need_GL_EXT_vertex_array) /* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_EXT_vertex_array_functions[] = { - { 21451, _gloffset_ArrayElement }, - { 27424, _gloffset_GetPointerv }, - { 28925, _gloffset_DrawArrays }, + { 21527, _gloffset_ArrayElement }, + { 27500, _gloffset_GetPointerv }, + { 29001, _gloffset_DrawArrays }, { -1, -1 } }; #endif #if defined(need_GL_EXT_vertex_weighting) static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { - { 17221, -1 }, /* VertexWeightfvEXT */ - { 23922, -1 }, /* VertexWeightfEXT */ - { 25443, -1 }, /* VertexWeightPointerEXT */ + { 17254, -1 }, /* VertexWeightfvEXT */ + { 23998, -1 }, /* VertexWeightfEXT */ + { 25519, -1 }, /* VertexWeightPointerEXT */ { -1, -1 } }; #endif @@ -5437,8 +5447,8 @@ static const struct gl_function_remap GL_HP_image_transform_functions[] = { { 3305, -1 }, /* ImageTransformParameterfHP */ { 9026, -1 }, /* ImageTransformParameterfvHP */ { 10614, -1 }, /* ImageTransformParameteriHP */ - { 10882, -1 }, /* GetImageTransformParameterivHP */ - { 17285, -1 }, /* ImageTransformParameterivHP */ + { 10915, -1 }, /* GetImageTransformParameterivHP */ + { 17318, -1 }, /* ImageTransformParameterivHP */ { -1, -1 } }; #endif @@ -5457,9 +5467,9 @@ static const struct gl_function_remap GL_IBM_vertex_array_lists_functions[] = { { 6759, -1 }, /* FogCoordPointerListIBM */ { 7066, -1 }, /* VertexPointerListIBM */ { 10535, -1 }, /* ColorPointerListIBM */ - { 11836, -1 }, /* TexCoordPointerListIBM */ - { 12207, -1 }, /* IndexPointerListIBM */ - { 29241, -1 }, /* EdgeFlagPointerListIBM */ + { 11869, -1 }, /* TexCoordPointerListIBM */ + { 12240, -1 }, /* IndexPointerListIBM */ + { 29317, -1 }, /* EdgeFlagPointerListIBM */ { -1, -1 } }; #endif @@ -5473,10 +5483,10 @@ static const struct gl_function_remap GL_INGR_blend_func_separate_functions[] = #if defined(need_GL_INTEL_parallel_arrays) static const struct gl_function_remap GL_INTEL_parallel_arrays_functions[] = { - { 11223, -1 }, /* VertexPointervINTEL */ - { 13701, -1 }, /* ColorPointervINTEL */ - { 26739, -1 }, /* NormalPointervINTEL */ - { 27165, -1 }, /* TexCoordPointervINTEL */ + { 11256, -1 }, /* VertexPointervINTEL */ + { 13734, -1 }, /* ColorPointervINTEL */ + { 26815, -1 }, /* NormalPointervINTEL */ + { 27241, -1 }, /* TexCoordPointervINTEL */ { -1, -1 } }; #endif @@ -5493,7 +5503,7 @@ static const struct gl_function_remap GL_MESA_shader_debug_functions[] = { { 1522, -1 }, /* GetDebugLogLengthMESA */ { 3063, -1 }, /* ClearDebugLogMESA */ { 4018, -1 }, /* GetDebugLogMESA */ - { 27617, -1 }, /* CreateDebugObjectMESA */ + { 27693, -1 }, /* CreateDebugObjectMESA */ { -1, -1 } }; #endif @@ -5518,11 +5528,11 @@ static const struct gl_function_remap GL_NV_evaluators_functions[] = { { 7521, -1 }, /* MapControlPointsNV */ { 7620, -1 }, /* MapParameterfvNV */ { 9431, -1 }, /* EvalMapsNV */ - { 15190, -1 }, /* GetMapAttribParameterfvNV */ - { 15356, -1 }, /* MapParameterivNV */ - { 22014, -1 }, /* GetMapParameterivNV */ - { 22512, -1 }, /* GetMapParameterfvNV */ - { 26075, -1 }, /* GetMapControlPointsNV */ + { 15223, -1 }, /* GetMapAttribParameterfvNV */ + { 15389, -1 }, /* MapParameterivNV */ + { 22090, -1 }, /* GetMapParameterivNV */ + { 22588, -1 }, /* GetMapParameterfvNV */ + { 26151, -1 }, /* GetMapControlPointsNV */ { -1, -1 } }; #endif @@ -5557,8 +5567,8 @@ static const struct gl_function_remap GL_NV_register_combiners_functions[] = { #if defined(need_GL_NV_register_combiners2) static const struct gl_function_remap GL_NV_register_combiners2_functions[] = { - { 14093, -1 }, /* CombinerStageParameterfvNV */ - { 14408, -1 }, /* GetCombinerStageParameterfvNV */ + { 14126, -1 }, /* CombinerStageParameterfvNV */ + { 14441, -1 }, /* GetCombinerStageParameterfvNV */ { -1, -1 } }; #endif @@ -5577,6 +5587,13 @@ static const struct gl_function_remap GL_NV_vertex_program_functions[] = { }; #endif +#if defined(need_GL_OES_EGL_image) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_OES_EGL_image_functions[] = { + { -1, -1 } +}; +#endif + #if defined(need_GL_PGI_misc_hints) static const struct gl_function_remap GL_PGI_misc_hints_functions[] = { { 7705, -1 }, /* HintPGI */ @@ -5586,16 +5603,16 @@ static const struct gl_function_remap GL_PGI_misc_hints_functions[] = { #if defined(need_GL_SGIS_detail_texture) static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = { - { 14381, -1 }, /* GetDetailTexFuncSGIS */ - { 14701, -1 }, /* DetailTexFuncSGIS */ + { 14414, -1 }, /* GetDetailTexFuncSGIS */ + { 14734, -1 }, /* DetailTexFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_fog_function) static const struct gl_function_remap GL_SGIS_fog_function_functions[] = { - { 24184, -1 }, /* FogFuncSGIS */ - { 24849, -1 }, /* GetFogFuncSGIS */ + { 24260, -1 }, /* FogFuncSGIS */ + { 24925, -1 }, /* GetFogFuncSGIS */ { -1, -1 } }; #endif @@ -5624,7 +5641,7 @@ static const struct gl_function_remap GL_SGIS_point_parameters_functions[] = { #if defined(need_GL_SGIS_sharpen_texture) static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = { { 5865, -1 }, /* GetSharpenTexFuncSGIS */ - { 19582, -1 }, /* SharpenTexFuncSGIS */ + { 19615, -1 }, /* SharpenTexFuncSGIS */ { -1, -1 } }; #endif @@ -5632,14 +5649,14 @@ static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = { #if defined(need_GL_SGIS_texture4D) static const struct gl_function_remap GL_SGIS_texture4D_functions[] = { { 894, -1 }, /* TexImage4DSGIS */ - { 14009, -1 }, /* TexSubImage4DSGIS */ + { 14042, -1 }, /* TexSubImage4DSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture_color_mask) static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = { - { 13407, -1 }, /* TextureColorMaskSGIS */ + { 13440, -1 }, /* TextureColorMaskSGIS */ { -1, -1 } }; #endif @@ -5647,7 +5664,7 @@ static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = { #if defined(need_GL_SGIS_texture_filter4) static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = { { 6042, -1 }, /* GetTexFilterFuncSGIS */ - { 14527, -1 }, /* TexFilterFuncSGIS */ + { 14560, -1 }, /* TexFilterFuncSGIS */ { -1, -1 } }; #endif @@ -5657,9 +5674,9 @@ static const struct gl_function_remap GL_SGIX_async_functions[] = { { 3014, -1 }, /* AsyncMarkerSGIX */ { 3997, -1 }, /* FinishAsyncSGIX */ { 4734, -1 }, /* PollAsyncSGIX */ - { 19729, -1 }, /* DeleteAsyncMarkersSGIX */ - { 19758, -1 }, /* IsAsyncMarkerSGIX */ - { 29038, -1 }, /* GenAsyncMarkersSGIX */ + { 19762, -1 }, /* DeleteAsyncMarkersSGIX */ + { 19791, -1 }, /* IsAsyncMarkerSGIX */ + { 29114, -1 }, /* GenAsyncMarkersSGIX */ { -1, -1 } }; #endif @@ -5682,29 +5699,29 @@ static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { { 8131, -1 }, /* FragmentLightModeliSGIX */ { 9494, -1 }, /* FragmentLightivSGIX */ { 9760, -1 }, /* GetFragmentMaterialivSGIX */ - { 17108, -1 }, /* FragmentLightModelfSGIX */ - { 17408, -1 }, /* FragmentColorMaterialSGIX */ - { 17780, -1 }, /* FragmentMaterialiSGIX */ - { 19001, -1 }, /* LightEnviSGIX */ - { 20412, -1 }, /* FragmentLightModelfvSGIX */ - { 20721, -1 }, /* FragmentLightfvSGIX */ - { 25325, -1 }, /* FragmentLightfSGIX */ - { 27954, -1 }, /* GetFragmentLightfvSGIX */ - { 29521, -1 }, /* FragmentMaterialivSGIX */ + { 17141, -1 }, /* FragmentLightModelfSGIX */ + { 17441, -1 }, /* FragmentColorMaterialSGIX */ + { 17813, -1 }, /* FragmentMaterialiSGIX */ + { 19034, -1 }, /* LightEnviSGIX */ + { 20445, -1 }, /* FragmentLightModelfvSGIX */ + { 20754, -1 }, /* FragmentLightfvSGIX */ + { 25401, -1 }, /* FragmentLightfSGIX */ + { 28030, -1 }, /* GetFragmentLightfvSGIX */ + { 29597, -1 }, /* FragmentMaterialivSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_framezoom) static const struct gl_function_remap GL_SGIX_framezoom_functions[] = { - { 19781, -1 }, /* FrameZoomSGIX */ + { 19814, -1 }, /* FrameZoomSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_igloo_interface) static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { - { 25633, -1 }, /* IglooInterfaceSGIX */ + { 25709, -1 }, /* IglooInterfaceSGIX */ { -1, -1 } }; #endif @@ -5714,9 +5731,9 @@ static const struct gl_function_remap GL_SGIX_instruments_functions[] = { { 2573, -1 }, /* ReadInstrumentsSGIX */ { 5621, -1 }, /* PollInstrumentsSGIX */ { 9392, -1 }, /* GetInstrumentsSGIX */ - { 11434, -1 }, /* StartInstrumentsSGIX */ - { 14127, -1 }, /* StopInstrumentsSGIX */ - { 15733, -1 }, /* InstrumentsBufferSGIX */ + { 11467, -1 }, /* StartInstrumentsSGIX */ + { 14160, -1 }, /* StopInstrumentsSGIX */ + { 15766, -1 }, /* InstrumentsBufferSGIX */ { -1, -1 } }; #endif @@ -5725,10 +5742,10 @@ static const struct gl_function_remap GL_SGIX_instruments_functions[] = { static const struct gl_function_remap GL_SGIX_list_priority_functions[] = { { 1125, -1 }, /* ListParameterfSGIX */ { 2763, -1 }, /* GetListParameterfvSGIX */ - { 15648, -1 }, /* ListParameteriSGIX */ - { 16402, -1 }, /* ListParameterfvSGIX */ - { 18407, -1 }, /* ListParameterivSGIX */ - { 29082, -1 }, /* GetListParameterivSGIX */ + { 15681, -1 }, /* ListParameteriSGIX */ + { 16435, -1 }, /* ListParameterfvSGIX */ + { 18440, -1 }, /* ListParameterivSGIX */ + { 29158, -1 }, /* GetListParameterivSGIX */ { -1, -1 } }; #endif @@ -5743,16 +5760,16 @@ static const struct gl_function_remap GL_SGIX_pixel_texture_functions[] = { #if defined(need_GL_SGIX_polynomial_ffd) static const struct gl_function_remap GL_SGIX_polynomial_ffd_functions[] = { { 3251, -1 }, /* LoadIdentityDeformationMapSGIX */ - { 10802, -1 }, /* DeformationMap3dSGIX */ - { 14227, -1 }, /* DeformSGIX */ - { 21563, -1 }, /* DeformationMap3fSGIX */ + { 10835, -1 }, /* DeformationMap3dSGIX */ + { 14260, -1 }, /* DeformSGIX */ + { 21639, -1 }, /* DeformationMap3fSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_reference_plane) static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { - { 12958, -1 }, /* ReferencePlaneSGIX */ + { 12991, -1 }, /* ReferencePlaneSGIX */ { -1, -1 } }; #endif @@ -5760,16 +5777,16 @@ static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { #if defined(need_GL_SGIX_sprite) static const struct gl_function_remap GL_SGIX_sprite_functions[] = { { 8547, -1 }, /* SpriteParameterfvSGIX */ - { 18235, -1 }, /* SpriteParameteriSGIX */ - { 23591, -1 }, /* SpriteParameterfSGIX */ - { 26197, -1 }, /* SpriteParameterivSGIX */ + { 18268, -1 }, /* SpriteParameteriSGIX */ + { 23667, -1 }, /* SpriteParameterfSGIX */ + { 26273, -1 }, /* SpriteParameterivSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_tag_sample_buffer) static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = { - { 18294, -1 }, /* TagSampleBufferSGIX */ + { 18327, -1 }, /* TagSampleBufferSGIX */ { -1, -1 } }; #endif @@ -5778,18 +5795,18 @@ static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = { static const struct gl_function_remap GL_SGI_color_table_functions[] = { { 6703, _gloffset_ColorTableParameteriv }, { 7415, _gloffset_ColorTable }, - { 13454, _gloffset_GetColorTable }, - { 13564, _gloffset_CopyColorTable }, - { 17052, _gloffset_ColorTableParameterfv }, - { 20320, _gloffset_GetColorTableParameterfv }, - { 22270, _gloffset_GetColorTableParameteriv }, + { 13487, _gloffset_GetColorTable }, + { 13597, _gloffset_CopyColorTable }, + { 17085, _gloffset_ColorTableParameterfv }, + { 20353, _gloffset_GetColorTableParameterfv }, + { 22346, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif #if defined(need_GL_SUNX_constant_data) static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { - { 27932, -1 }, /* FinishTextureSUNX */ + { 28008, -1 }, /* FinishTextureSUNX */ { -1, -1 } }; #endif @@ -5801,16 +5818,16 @@ static const struct gl_function_remap GL_SUN_global_alpha_functions[] = { { 5646, -1 }, /* GlobalAlphaFactordSUN */ { 8631, -1 }, /* GlobalAlphaFactoruiSUN */ { 8983, -1 }, /* GlobalAlphaFactorbSUN */ - { 11749, -1 }, /* GlobalAlphaFactorfSUN */ - { 11868, -1 }, /* GlobalAlphaFactorusSUN */ - { 20020, -1 }, /* GlobalAlphaFactorsSUN */ + { 11782, -1 }, /* GlobalAlphaFactorfSUN */ + { 11901, -1 }, /* GlobalAlphaFactorusSUN */ + { 20053, -1 }, /* GlobalAlphaFactorsSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_mesh_array) static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { - { 26009, -1 }, /* DrawMeshArraysSUN */ + { 26085, -1 }, /* DrawMeshArraysSUN */ { -1, -1 } }; #endif @@ -5819,11 +5836,11 @@ static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { static const struct gl_function_remap GL_SUN_triangle_list_functions[] = { { 3971, -1 }, /* ReplacementCodeubSUN */ { 5485, -1 }, /* ReplacementCodeubvSUN */ - { 16773, -1 }, /* ReplacementCodeusvSUN */ - { 16961, -1 }, /* ReplacementCodePointerSUN */ - { 18318, -1 }, /* ReplacementCodeusSUN */ - { 19065, -1 }, /* ReplacementCodeuiSUN */ - { 26654, -1 }, /* ReplacementCodeuivSUN */ + { 16806, -1 }, /* ReplacementCodeusvSUN */ + { 16994, -1 }, /* ReplacementCodePointerSUN */ + { 18351, -1 }, /* ReplacementCodeusSUN */ + { 19098, -1 }, /* ReplacementCodeuiSUN */ + { 26730, -1 }, /* ReplacementCodeuivSUN */ { -1, -1 } }; #endif @@ -5848,28 +5865,28 @@ static const struct gl_function_remap GL_SUN_vertex_functions[] = { { 8942, -1 }, /* Color3fVertex3fvSUN */ { 9357, -1 }, /* Color4fNormal3fVertex3fvSUN */ { 10058, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ - { 11297, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ - { 12689, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ - { 13100, -1 }, /* TexCoord2fColor3fVertex3fSUN */ - { 14152, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ - { 14486, -1 }, /* Color4ubVertex2fvSUN */ - { 14726, -1 }, /* Normal3fVertex3fSUN */ - { 15674, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ - { 15935, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ - { 16602, -1 }, /* TexCoord2fVertex3fvSUN */ - { 17378, -1 }, /* Color4ubVertex2fSUN */ - { 17571, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ - { 19453, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ - { 19800, -1 }, /* Normal3fVertex3fvSUN */ - { 20229, -1 }, /* Color4fNormal3fVertex3fSUN */ - { 21095, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ - { 21315, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ - { 23045, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ - { 24300, -1 }, /* TexCoord4fVertex4fSUN */ - { 24726, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ - { 25052, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ - { 25179, -1 }, /* TexCoord4fVertex4fvSUN */ - { 25881, -1 }, /* ReplacementCodeuiVertex3fSUN */ + { 11330, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ + { 12722, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ + { 13133, -1 }, /* TexCoord2fColor3fVertex3fSUN */ + { 14185, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ + { 14519, -1 }, /* Color4ubVertex2fvSUN */ + { 14759, -1 }, /* Normal3fVertex3fSUN */ + { 15707, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ + { 15968, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ + { 16635, -1 }, /* TexCoord2fVertex3fvSUN */ + { 17411, -1 }, /* Color4ubVertex2fSUN */ + { 17604, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ + { 19486, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ + { 19833, -1 }, /* Normal3fVertex3fvSUN */ + { 20262, -1 }, /* Color4fNormal3fVertex3fSUN */ + { 21171, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ + { 21391, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ + { 23121, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ + { 24376, -1 }, /* TexCoord4fVertex4fSUN */ + { 24802, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ + { 25128, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ + { 25255, -1 }, /* TexCoord4fVertex4fvSUN */ + { 25957, -1 }, /* ReplacementCodeuiVertex3fSUN */ { -1, -1 } }; #endif @@ -5888,29 +5905,29 @@ static const struct gl_function_remap GL_VERSION_1_3_functions[] = { { 9714, _gloffset_MultiTexCoord4sARB }, { 10314, _gloffset_MultiTexCoord2dvARB }, { 10696, _gloffset_MultiTexCoord1svARB }, - { 10992, _gloffset_MultiTexCoord3svARB }, - { 11053, _gloffset_MultiTexCoord4iARB }, - { 11776, _gloffset_MultiTexCoord3iARB }, - { 12478, _gloffset_MultiTexCoord1dARB }, - { 12644, _gloffset_MultiTexCoord3dvARB }, - { 13808, _gloffset_MultiTexCoord3ivARB }, - { 13853, _gloffset_MultiTexCoord2sARB }, - { 15073, _gloffset_MultiTexCoord4ivARB }, - { 16702, _gloffset_ClientActiveTextureARB }, - { 18918, _gloffset_MultiTexCoord2dARB }, - { 19322, _gloffset_MultiTexCoord4dvARB }, - { 19608, _gloffset_MultiTexCoord4fvARB }, - { 20461, _gloffset_MultiTexCoord3fARB }, - { 22798, _gloffset_MultiTexCoord4dARB }, - { 23002, _gloffset_MultiTexCoord1sARB }, - { 23204, _gloffset_MultiTexCoord1dvARB }, - { 24046, _gloffset_MultiTexCoord1ivARB }, - { 24139, _gloffset_MultiTexCoord2ivARB }, - { 24478, _gloffset_MultiTexCoord1iARB }, - { 25749, _gloffset_MultiTexCoord4svARB }, - { 26267, _gloffset_MultiTexCoord1fARB }, - { 26530, _gloffset_MultiTexCoord4fARB }, - { 28759, _gloffset_MultiTexCoord2fvARB }, + { 11025, _gloffset_MultiTexCoord3svARB }, + { 11086, _gloffset_MultiTexCoord4iARB }, + { 11809, _gloffset_MultiTexCoord3iARB }, + { 12511, _gloffset_MultiTexCoord1dARB }, + { 12677, _gloffset_MultiTexCoord3dvARB }, + { 13841, _gloffset_MultiTexCoord3ivARB }, + { 13886, _gloffset_MultiTexCoord2sARB }, + { 15106, _gloffset_MultiTexCoord4ivARB }, + { 16735, _gloffset_ClientActiveTextureARB }, + { 18951, _gloffset_MultiTexCoord2dARB }, + { 19355, _gloffset_MultiTexCoord4dvARB }, + { 19641, _gloffset_MultiTexCoord4fvARB }, + { 20494, _gloffset_MultiTexCoord3fARB }, + { 22874, _gloffset_MultiTexCoord4dARB }, + { 23078, _gloffset_MultiTexCoord1sARB }, + { 23280, _gloffset_MultiTexCoord1dvARB }, + { 24122, _gloffset_MultiTexCoord1ivARB }, + { 24215, _gloffset_MultiTexCoord2ivARB }, + { 24554, _gloffset_MultiTexCoord1iARB }, + { 25825, _gloffset_MultiTexCoord4svARB }, + { 26343, _gloffset_MultiTexCoord1fARB }, + { 26606, _gloffset_MultiTexCoord4fARB }, + { 28835, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; #endif diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 9b0f8027eb..3fbdb4abb3 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -1037,6 +1037,8 @@ gl_dispatch_functions_start: HIDDEN(gl_dispatch_stub_801) GL_STUB(gl_dispatch_stub_802, _gloffset_GetQueryObjectui64vEXT) HIDDEN(gl_dispatch_stub_802) + GL_STUB(glEGLImageTargetRenderbufferStorageOES, _gloffset_EGLImageTargetRenderbufferStorageOES) + GL_STUB(glEGLImageTargetTexture2DOES, _gloffset_EGLImageTargetTexture2DOES) GL_STUB_ALIAS(glArrayElementEXT, glArrayElement) GL_STUB_ALIAS(glBindTextureEXT, glBindTexture) GL_STUB_ALIAS(glDrawArraysEXT, glDrawArrays) diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index 8edb69bf84..4c9eab882b 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -30414,6 +30414,80 @@ GL_PREFIX(_dispatch_stub_802): #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(_dispatch_stub_802), .-GL_PREFIX(_dispatch_stub_802) + .p2align 4,,15 + .globl GL_PREFIX(EGLImageTargetRenderbufferStorageOES) + .type GL_PREFIX(EGLImageTargetRenderbufferStorageOES), @function +GL_PREFIX(EGLImageTargetRenderbufferStorageOES): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 6424(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rbp + call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi + popq %rdi + movq 6424(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 6424(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rbp + call _glapi_get_dispatch + popq %rbp + popq %rsi + popq %rdi + movq 6424(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(EGLImageTargetRenderbufferStorageOES), .-GL_PREFIX(EGLImageTargetRenderbufferStorageOES) + + .p2align 4,,15 + .globl GL_PREFIX(EGLImageTargetTexture2DOES) + .type GL_PREFIX(EGLImageTargetTexture2DOES), @function +GL_PREFIX(EGLImageTargetTexture2DOES): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 6432(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rbp + call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi + popq %rdi + movq 6432(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 6432(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rbp + call _glapi_get_dispatch + popq %rbp + popq %rsi + popq %rdi + movq 6432(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(EGLImageTargetTexture2DOES), .-GL_PREFIX(EGLImageTargetTexture2DOES) + .globl GL_PREFIX(ArrayElementEXT) ; .set GL_PREFIX(ArrayElementEXT), GL_PREFIX(ArrayElement) .globl GL_PREFIX(BindTextureEXT) ; .set GL_PREFIX(BindTextureEXT), GL_PREFIX(BindTexture) .globl GL_PREFIX(DrawArraysEXT) ; .set GL_PREFIX(DrawArraysEXT), GL_PREFIX(DrawArrays) diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 8030fdf90b..13270ef35d 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -991,6 +991,8 @@ GLNAME(gl_dispatch_functions_start): HIDDEN(GL_PREFIX(_dispatch_stub_801, _dispatch_stub_801@12)) GL_STUB(_dispatch_stub_802, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_802@12) HIDDEN(GL_PREFIX(_dispatch_stub_802, _dispatch_stub_802@12)) + GL_STUB(EGLImageTargetRenderbufferStorageOES, _gloffset_EGLImageTargetRenderbufferStorageOES, EGLImageTargetRenderbufferStorageOES@8) + GL_STUB(EGLImageTargetTexture2DOES, _gloffset_EGLImageTargetTexture2DOES, EGLImageTargetTexture2DOES@8) GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4) GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8) GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12) -- cgit v1.2.3 From d1dc5b124e133379be5bb57b68733c09c0e04f71 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 11 Feb 2010 17:42:30 -0500 Subject: core: Implement GL_OES_EGL_image entry points --- src/mesa/main/dd.h | 11 +++++++++++ src/mesa/main/fbobject.c | 24 ++++++++++++++++++++++++ src/mesa/main/fbobject.h | 3 +++ src/mesa/main/mfeatures.h | 2 ++ src/mesa/main/teximage.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/mesa/main/teximage.h | 2 ++ 6 files changed, 83 insertions(+) (limited to 'src') diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index d98a14e09c..079e44bb95 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1035,6 +1035,17 @@ struct dd_function_table { GLfloat width, GLfloat height); /*@}*/ #endif + +#if FEATURE_OES_EGL_image + void (*EGLImageTargetTexture2D)(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, + GLeglImageOES image_handle); + void (*EGLImageTargetRenderbufferStorage)(GLcontext *ctx, + struct gl_renderbuffer *rb, + void *image_handle); +#endif + }; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 04ea3b4ed7..8fbe0830c7 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1008,6 +1008,30 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, */ } +#if FEATURE_OES_EGL_image +void GLAPIENTRY +_mesa_EGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + struct gl_renderbuffer *rb; + + if (target != GL_RENDERBUFFER) { + _mesa_error(ctx, GL_INVALID_ENUM, "EGLImageTargetRenderbufferStorageOES"); + return; + } + + rb = ctx->CurrentRenderbuffer; + if (!rb) { + _mesa_error(ctx, GL_INVALID_OPERATION, "EGLImageTargetRenderbufferStorageOES"); + return; + } + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image); +} +#endif /** * Helper function for _mesa_GetRenderbufferParameterivEXT() and diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index 5409394073..28f75dfca7 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -88,6 +88,9 @@ _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +extern void GLAPIENTRY +_mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image); + extern void GLAPIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params); diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 4e68bc15d8..f0896ee626 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -122,5 +122,7 @@ #define FEATURE_NV_fragment_program _HAVE_FULL_GL #define FEATURE_NV_vertex_program _HAVE_FULL_GL +#define FEATURE_OES_EGL_image _HAVE_FULL_GL + #endif /* FEATURES_H */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 00329c755d..40ebff76c6 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2448,6 +2448,47 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, } +#if FEATURE_OES_EGL_image +void GLAPIENTRY +_mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + struct gl_texture_object *texObj; + struct gl_texture_image *texImage; + + if (target != GL_TEXTURE_2D) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glEGLImageTargetTexture2D(target=%d)", target); + return; + } + + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) + _mesa_update_state(ctx); + + texObj = _mesa_get_current_tex_object(ctx, target); + _mesa_lock_texture(ctx, texObj); + + texImage = _mesa_get_tex_image(ctx, texObj, target, 0); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glEGLImageTargetTexture2D"); + } else { + if (texImage->Data) + ctx->Driver.FreeTexImageData( ctx, texImage ); + + ASSERT(texImage->Data == NULL); + ctx->Driver.EGLImageTargetTexture2D(ctx, target, + texObj, texImage, image); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + _mesa_unlock_texture(ctx, texObj); + +} +#endif + void GLAPIENTRY _mesa_TexSubImage1D( GLenum target, GLint level, diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 97c9018319..d82cc98521 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -165,6 +165,8 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat, GLint border, GLenum format, GLenum type, const GLvoid *pixels ); +extern void GLAPIENTRY +_mesa_EGLImageTargetTexture2DOES( GLenum target, GLeglImageOES image ); extern void GLAPIENTRY _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, -- cgit v1.2.3 From 9f6990120ace5725e16ee2dd9a59da76fe1041cc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 08:59:49 -0700 Subject: gallium: comment/document usage flags --- src/gallium/include/pipe/p_screen.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 48625bf312..e4a9222809 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -121,7 +121,9 @@ struct pipe_screen { void (*texture_destroy)(struct pipe_texture *pt); - /** Get a surface which is a "view" into a texture */ + /** Get a 2D surface which is a "view" into a texture + * \param usage bitmaks of PIPE_BUFFER_USAGE_* read/write flags + */ struct pipe_surface *(*get_tex_surface)(struct pipe_screen *, struct pipe_texture *texture, unsigned face, unsigned level, -- cgit v1.2.3 From 51b799288a405be3f4cdbfc7221221399512992a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 11:57:26 -0700 Subject: mesa: put declaration before code --- src/mesa/main/fbobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 8fbe0830c7..4ce3998812 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1012,9 +1012,9 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, void GLAPIENTRY _mesa_EGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image) { + struct gl_renderbuffer *rb; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - struct gl_renderbuffer *rb; if (target != GL_RENDERBUFFER) { _mesa_error(ctx, GL_INVALID_ENUM, "EGLImageTargetRenderbufferStorageOES"); -- cgit v1.2.3 From ccd78fed880c4c8f1fccf1d10fc46442fa146359 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 12:03:51 -0700 Subject: gallium: remove $(DEFINES) from cc/c++ command lines The $(DEFINES) is already in $(CFLAG)S and (CXXFLAGS). This prevents all the -D args appearing twice in the compilation commands. --- src/gallium/Makefile.template | 8 ++++---- src/gallium/winsys/xlib/Makefile | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template index 5d9d2db786..3274c8e0c3 100644 --- a/src/gallium/Makefile.template +++ b/src/gallium/Makefile.template @@ -54,16 +54,16 @@ install: ##### RULES ##### %.s: %.c - $(CC) -S $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ + $(CC) -S $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ %.o: %.c - $(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ + $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ %.o: %.cpp - $(CXX) -c $(INCLUDES) $(DEFINES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@ + $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@ %.o: %.S - $(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ + $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ sinclude depend diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 9482e8f9b1..824c666ae3 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -50,10 +50,10 @@ LIBS = \ .SUFFIXES : .cpp .c.o: - $(CC) -c $(INCLUDE_DIRS) $(DEFINES) $(CFLAGS) $< -o $@ + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ .cpp.o: - $(CXX) -c $(INCLUDE_DIRS) $(DEFINES) $(CXXFLAGS) $< -o $@ + $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@ -- cgit v1.2.3 From c26247100bfd453a7ec013f630abe366c12fbd8b Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 11 Feb 2010 18:59:40 -0500 Subject: intel: Implement DRI image extension --- src/mesa/drivers/dri/common/dri_util.c | 2 + src/mesa/drivers/dri/common/dri_util.h | 1 + src/mesa/drivers/dri/intel/intel_regions.h | 8 +++ src/mesa/drivers/dri/intel/intel_screen.c | 93 ++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 9142dd72f5..b80b608f4b 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -675,6 +675,8 @@ setupLoaderExtensions(__DRIscreen *psp, psp->systemTime = (__DRIsystemTimeExtension *) extensions[i]; if (strcmp(extensions[i]->name, __DRI_DRI2_LOADER) == 0) psp->dri2.loader = (__DRIdri2LoaderExtension *) extensions[i]; + if (strcmp(extensions[i]->name, __DRI_IMAGE_LOOKUP) == 0) + psp->dri2.image = (__DRIimageLookupExtension *) extensions[i]; } } diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 2eadb9ac8c..99c0f1e442 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -544,6 +544,7 @@ struct __DRIscreenRec { * fields will not be valid or initializaed in that case. */ int enabled; __DRIdri2LoaderExtension *loader; + __DRIimageLookupExtension *image; } dri2; /* The lock actually in use, old sarea or DRI2 */ diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h index 6d36f3d88a..7ee6a988ea 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.h +++ b/src/mesa/drivers/dri/intel/intel_regions.h @@ -148,4 +148,12 @@ void _mesa_copy_rect(GLubyte * dst, const GLubyte * src, GLuint src_pitch, GLuint src_x, GLuint src_y); +struct __DRIimageRec { + struct intel_region *region; + GLenum internal_format; + GLuint format; + GLenum data_type; + void *data; +}; + #endif diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 5e23aa8a1d..f19e2ee81d 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -41,6 +41,7 @@ #include "intel_fbo.h" #include "intel_screen.h" #include "intel_tex.h" +#include "intel_regions.h" #include "i915_drm.h" @@ -137,11 +138,103 @@ static const struct __DRI2flushExtensionRec intelFlushExtension = { intelDRI2Invalidate, }; +static __DRIimage * +intel_create_image_from_name(__DRIcontext *context, + int width, int height, int format, + int name, int pitch, void *loaderPrivate) +{ + __DRIimage *image; + struct intel_context *intel = context->driverPrivate; + int cpp; + + image = CALLOC(sizeof *image); + if (image == NULL) + return NULL; + + switch (format) { + case __DRI_IMAGE_FORMAT_RGB565: + image->format = MESA_FORMAT_RGB565; + image->internal_format = GL_RGB; + image->data_type = GL_UNSIGNED_BYTE; + break; + case __DRI_IMAGE_FORMAT_XRGB8888: + image->format = MESA_FORMAT_XRGB8888; + image->internal_format = GL_RGB; + image->data_type = GL_UNSIGNED_BYTE; + break; + case __DRI_IMAGE_FORMAT_ARGB8888: + image->format = MESA_FORMAT_ARGB8888; + image->internal_format = GL_RGBA; + image->data_type = GL_UNSIGNED_BYTE; + break; + default: + free(image); + return NULL; + } + + image->data = loaderPrivate; + cpp = _mesa_get_format_bytes(image->format); + + image->region = intel_region_alloc_for_handle(intel, cpp, width, height, + pitch, name, "image"); + if (image->region == NULL) { + FREE(image); + return NULL; + } + + return image; +} + +static __DRIimage * +intel_create_image_from_renderbuffer(__DRIcontext *context, + int renderbuffer, void *loaderPrivate) +{ + __DRIimage *image; + struct intel_context *intel = context->driverPrivate; + struct gl_renderbuffer *rb; + struct intel_renderbuffer *irb; + + rb = intel->ctx.CurrentRenderbuffer; + if (!rb) { + _mesa_error(&intel->ctx, + GL_INVALID_OPERATION, "glRenderbufferExternalMESA"); + return NULL; + } + + irb = intel_renderbuffer(rb); + image = CALLOC(sizeof *image); + if (image == NULL) + return NULL; + + image->internal_format = rb->InternalFormat; + image->format = rb->Format; + image->data_type = rb->DataType; + image->data = loaderPrivate; + intel_region_reference(&image->region, irb->region); + + return image; +} + +static void +intel_destroy_image(__DRIimage *image) +{ + intel_region_release(&image->region); + FREE(image); +} + +static struct __DRIimageExtensionRec intelImageExtension = { + { __DRI_IMAGE, __DRI_IMAGE_VERSION }, + intel_create_image_from_name, + intel_create_image_from_renderbuffer, + intel_destroy_image, +}; + static const __DRIextension *intelScreenExtensions[] = { &driReadDrawableExtension, &intelTexOffsetExtension.base, &intelTexBufferExtension.base, &intelFlushExtension.base, + &intelImageExtension.base, NULL }; -- cgit v1.2.3 From 10e79627414bc2bbc72d68ed25fb9999948a294f Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 11 Feb 2010 19:04:02 -0500 Subject: intel: Implement GL_OES_EGL_image entrypoints --- src/mesa/drivers/dri/intel/intel_fbo.c | 36 +++++++++++++++++++ src/mesa/drivers/dri/intel/intel_tex_image.c | 52 ++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index e154bd4087..82c7b19eef 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -200,6 +200,37 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, } +#if FEATURE_OES_EGL_image +static void +intel_image_target_renderbuffer_storage(GLcontext *ctx, + struct gl_renderbuffer *rb, + void *image_handle) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_renderbuffer *irb; + __DRIscreen *screen; + __DRIimage *image; + + screen = intel->intelScreen->driScrnPriv; + image = screen->dri2.image->lookupEGLImage(intel->driContext, image_handle, + intel->driContext->loaderPrivate); + if (image == NULL) + return; + + irb = intel_renderbuffer(rb); + if (irb->region) + intel_region_release(&irb->region); + intel_region_reference(&irb->region, image->region); + + rb->Width = image->region->width; + rb->Height = image->region->height; + rb->Format = image->format; + rb->DataType = image->data_type; + rb->_BaseFormat = _mesa_base_fbo_format(&intel->ctx, + image->internal_format); +} +#endif + /** * Called for each hardware renderbuffer when a _window_ is resized. * Just update fields. @@ -651,4 +682,9 @@ intel_fbo_init(struct intel_context *intel) intel->ctx.Driver.ResizeBuffers = intel_resize_buffers; intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer; intel->ctx.Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer; + +#if FEATURE_OES_EGL_image + intel->ctx.Driver.EGLImageTargetRenderbufferStorage = + intel_image_target_renderbuffer_storage; +#endif } diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index aefd0b97d0..f586aee992 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -814,6 +814,54 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv) intelSetTexBuffer2(pDRICtx, target, __DRI_TEXTURE_FORMAT_RGBA, dPriv); } +#if FEATURE_OES_EGL_image +static void +intel_image_target_texture_2d(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, + GLeglImageOES image_handle) +{ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_object *intelObj = intel_texture_object(texObj); + struct intel_texture_image *intelImage = intel_texture_image(texImage); + struct intel_mipmap_tree *mt; + __DRIscreen *screen; + __DRIimage *image; + + screen = intel->intelScreen->driScrnPriv; + image = screen->dri2.image->lookupEGLImage(intel->driContext, image_handle, + intel->driContext->loaderPrivate); + if (image == NULL) + return; + + mt = intel_miptree_create_for_region(intel, target, + image->internal_format, + 0, 0, image->region, 1, 0); + if (mt == NULL) + return; + + if (intelImage->mt) { + intel_miptree_release(intel, &intelImage->mt); + assert(!texImage->Data); + } + if (intelObj->mt) + intel_miptree_release(intel, &intelObj->mt); + + intelObj->mt = mt; + _mesa_init_teximage_fields(&intel->ctx, target, texImage, + image->region->width, image->region->height, 1, + 0, image->internal_format); + + intelImage->face = target_to_face(target); + intelImage->level = 0; + texImage->TexFormat = image->format; + texImage->RowStride = image->region->pitch; + intel_miptree_reference(&intelImage->mt, intelObj->mt); + + if (!intel_miptree_match_image(intelObj->mt, &intelImage->base)) + fprintf(stderr, "miptree doesn't match image\n"); +} +#endif void intelInitTextureImageFuncs(struct dd_function_table *functions) @@ -825,4 +873,8 @@ intelInitTextureImageFuncs(struct dd_function_table *functions) functions->CompressedTexImage2D = intelCompressedTexImage2D; functions->GetCompressedTexImage = intelGetCompressedTexImage; + +#if FEATURE_OES_EGL_image + functions->EGLImageTargetTexture2D = intel_image_target_texture_2d; +#endif } -- cgit v1.2.3 From f4e7d1b1e5477a28e9a6364e742a79f95fb9b10e Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 11 Feb 2010 19:28:26 -0500 Subject: egl_dri2: Implement EGL_KHR_image and EGL_KHR_image_pixmap --- src/egl/drivers/dri2/egl_dri2.c | 153 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 149 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 5d36c49b2c..0c2dfe6dd4 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -42,7 +42,6 @@ #include #include -#include "eglconfigutil.h" #include "eglconfig.h" #include "eglcontext.h" #include "egldisplay.h" @@ -50,6 +49,7 @@ #include "eglcurrent.h" #include "egllog.h" #include "eglsurface.h" +#include "eglimage.h" struct dri2_egl_driver { @@ -67,10 +67,12 @@ struct dri2_egl_display __DRIdri2Extension *dri2; __DRI2flushExtension *flush; __DRItexBufferExtension *tex_buffer; + __DRIimageExtension *image; int fd; __DRIdri2LoaderExtension loader_extension; - const __DRIextension *extensions[2]; + __DRIimageLookupExtension image_lookup_extension; + const __DRIextension *extensions[3]; }; struct dri2_egl_context @@ -93,12 +95,25 @@ struct dri2_egl_surface struct dri2_egl_config { - _EGLConfig base; + _EGLConfig base; const __DRIconfig *dri_config; }; +struct dri2_egl_image +{ + _EGLImage base; + __DRIimage *dri_image; + int width; + int height; + int name; + int pitch; + int cpp; + int format; +}; + /* standard typecasts */ _EGL_DRIVER_STANDARD_TYPECASTS(dri2_egl) +_EGL_DRIVER_TYPECAST(dri2_egl_image, _EGLImage, obj) EGLint dri2_to_egl_attribute_map[] = { 0, @@ -346,6 +361,25 @@ dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate) #endif } +static __DRIimage * +dri2_lookup_egl_image(__DRIcontext *context, void *image, void *data) +{ + struct dri2_egl_context *dri2_ctx = data; + _EGLDisplay *disp = dri2_ctx->base.Resource.Display; + struct dri2_egl_image *dri2_img; + _EGLImage *img; + + img = _eglLookupImage(image, disp); + if (img == NULL) { + _eglError(EGL_BAD_PARAMETER, "dri2_lookup_egl_image"); + return NULL; + } + + dri2_img = dri2_egl_image(image); + + return dri2_img->dri_image; +} + static __DRIbuffer * dri2_get_buffers_with_format(__DRIdrawable * driDrawable, int *width, int *height, @@ -405,6 +439,7 @@ static struct dri2_extension_match dri2_driver_extensions[] = { static struct dri2_extension_match dri2_core_extensions[] = { { __DRI2_FLUSH, 1, offsetof(struct dri2_egl_display, flush) }, { __DRI_TEX_BUFFER, 2, offsetof(struct dri2_egl_display, tex_buffer) }, + { __DRI_IMAGE, 1, offsetof(struct dri2_egl_display, image) }, { NULL } }; @@ -609,8 +644,13 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, dri2_dpy->loader_extension.getBuffersWithFormat = NULL; } + dri2_dpy->image_lookup_extension.base.name = __DRI_IMAGE_LOOKUP; + dri2_dpy->image_lookup_extension.base.version = 1; + dri2_dpy->image_lookup_extension.lookupEGLImage = dri2_lookup_egl_image; + dri2_dpy->extensions[0] = &dri2_dpy->loader_extension.base; - dri2_dpy->extensions[1] = NULL; + dri2_dpy->extensions[1] = &dri2_dpy->image_lookup_extension.base; + dri2_dpy->extensions[2] = NULL; dri2_dpy->dri_screen = dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions, @@ -652,6 +692,8 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, } disp->ClientAPIsMask = EGL_OPENGL_BIT; + disp->Extensions.KHR_image_base = EGL_TRUE; + disp->Extensions.KHR_image_pixmap = EGL_TRUE; /* we're supporting EGL 1.4 */ *major = 1; @@ -1064,6 +1106,107 @@ dri2_release_tex_image(_EGLDriver *drv, return EGL_TRUE; } +static _EGLImage * +dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp, + _EGLContext *ctx, EGLenum target, + EGLClientBuffer buffer, const EGLint *attr_list) +{ + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx); + struct dri2_egl_image *dri2_img; + unsigned int attachments[1]; + xcb_drawable_t drawable; + xcb_dri2_get_buffers_cookie_t buffers_cookie; + xcb_dri2_get_buffers_reply_t *buffers_reply; + xcb_dri2_dri2_buffer_t *buffers; + xcb_get_geometry_cookie_t geometry_cookie; + xcb_get_geometry_reply_t *geometry_reply; + xcb_generic_error_t *error; + + dri2_img = malloc(sizeof *dri2_img); + if (!dri2_img) { + _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr"); + return EGL_NO_IMAGE_KHR; + } + + if (!_eglInitImage(&dri2_img->base, disp, attr_list)) + return EGL_NO_IMAGE_KHR; + + switch (target) { + case EGL_NATIVE_PIXMAP_KHR: + drawable = (xcb_drawable_t) buffer; + xcb_dri2_create_drawable (dri2_dpy->conn, drawable); + attachments[0] = XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT; + buffers_cookie = + xcb_dri2_get_buffers_unchecked (dri2_dpy->conn, + drawable, 1, 1, attachments); + geometry_cookie = xcb_get_geometry (dri2_dpy->conn, drawable); + buffers_reply = xcb_dri2_get_buffers_reply (dri2_dpy->conn, + buffers_cookie, NULL); + buffers = xcb_dri2_get_buffers_buffers (buffers_reply); + if (buffers == NULL) { + free(dri2_img); + return NULL; + } + + geometry_reply = xcb_get_geometry_reply (dri2_dpy->conn, + geometry_cookie, &error); + if (geometry_reply == NULL || error != NULL) { + _eglError(EGL_BAD_ALLOC, "xcb_get_geometry"); + free(error); + free(dri2_img); + free(buffers_reply); + } + + dri2_img->width = buffers_reply->width; + dri2_img->height = buffers_reply->height; + dri2_img->name = buffers[0].name; + dri2_img->pitch = buffers[0].pitch / buffers[0].cpp; + dri2_img->cpp = buffers[0].cpp; + switch (geometry_reply->depth) { + case 16: + dri2_img->format = __DRI_IMAGE_FORMAT_RGB565; + break; + case 24: + dri2_img->format = __DRI_IMAGE_FORMAT_XRGB8888; + break; + case 32: + dri2_img->format = __DRI_IMAGE_FORMAT_ARGB8888; + break; + } + free(buffers_reply); + free(geometry_reply); + break; + + default: + _eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr"); + free(dri2_img); + return EGL_NO_IMAGE_KHR; + } + + dri2_img->dri_image = + dri2_dpy->image->createImageFromName(dri2_ctx->dri_context, + dri2_img->width, + dri2_img->height, + dri2_img->format, + dri2_img->name, + dri2_img->pitch, + dri2_img); + + return &dri2_img->base; +} + +static EGLBoolean +dri2_destroy_image_khr(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *image) +{ + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + struct dri2_egl_image *dri2_img = dri2_egl_image(image); + + dri2_dpy->image->destroyImage(dri2_img->dri_image); + free(dri2_img); + + return EGL_TRUE; +} /** * This is the main entrypoint into the driver, called by libEGL. @@ -1094,6 +1237,8 @@ _eglMain(const char *args) dri2_drv->base.API.CopyBuffers = dri2_copy_buffers; dri2_drv->base.API.BindTexImage = dri2_bind_tex_image; dri2_drv->base.API.ReleaseTexImage = dri2_release_tex_image; + dri2_drv->base.API.CreateImageKHR = dri2_create_image_khr; + dri2_drv->base.API.DestroyImageKHR = dri2_destroy_image_khr; dri2_drv->base.Name = "DRI2"; dri2_drv->base.Unload = dri2_unload; -- cgit v1.2.3 From ab71a5e4c918eee19b518603a2db11d2793b2c91 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 13:23:10 -0700 Subject: llvmpipe: added some assertions --- src/gallium/drivers/llvmpipe/lp_rast_tri.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c index 0334705ef7..bbc95c399a 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c @@ -130,6 +130,9 @@ do_block_4( struct lp_rasterizer_task *rast_task, int c2, int c3 ) { + assert(x >= 0); + assert(y >= 0); + lp_rast_shade_quads(rast_task->rast, rast_task->thread_index, &tri->inputs, @@ -155,6 +158,8 @@ do_block_16( struct lp_rasterizer_task *rast_task, int c[3]; int i, j; + assert(x >= 0); + assert(y >= 0); assert(x % 16 == 0); assert(y % 16 == 0); -- cgit v1.2.3 From 1c9db3c57f1538e21b839df0989b958be3465a36 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 13:30:57 -0700 Subject: llvmpipe: pass fewer parameters to rasterization functions --- src/gallium/drivers/llvmpipe/lp_rast.c | 5 ++--- src/gallium/drivers/llvmpipe/lp_rast_priv.h | 11 +++++------ src/gallium/drivers/llvmpipe/lp_rast_tri.c | 8 ++------ 3 files changed, 9 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index bbd63aec2b..159ef0d55d 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -396,14 +396,13 @@ void lp_rast_shade_tile( struct lp_rasterizer *rast, * Compute shading for a 4x4 block of pixels. * This is a bin command called during bin processing. */ -void lp_rast_shade_quads( struct lp_rasterizer *rast, - unsigned thread_index, +void lp_rast_shade_quads( struct lp_rasterizer_task *task, const struct lp_rast_shader_inputs *inputs, unsigned x, unsigned y, int32_t c1, int32_t c2, int32_t c3) { - struct lp_rasterizer_task *task = &rast->tasks[thread_index]; const struct lp_rast_state *state = task->current_state; + struct lp_rasterizer *rast = task->rast; struct lp_rast_tile *tile = &task->tile; uint8_t *color[PIPE_MAX_COLOR_BUFS]; void *depth; diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h index 5c5497e092..382e169c1c 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h @@ -121,8 +121,7 @@ struct lp_rasterizer }; -void lp_rast_shade_quads( struct lp_rasterizer *rast, - unsigned thread_index, +void lp_rast_shade_quads( struct lp_rasterizer_task *task, const struct lp_rast_shader_inputs *inputs, unsigned x, unsigned y, int32_t c1, int32_t c2, int32_t c3); @@ -159,13 +158,13 @@ lp_rast_depth_pointer( struct lp_rasterizer *rast, * \param x, y location of 4x4 block in window coords */ static INLINE void -lp_rast_shade_quads_all( struct lp_rasterizer *rast, - unsigned thread_index, +lp_rast_shade_quads_all( struct lp_rasterizer_task *task, const struct lp_rast_shader_inputs *inputs, unsigned x, unsigned y ) { - const struct lp_rast_state *state = rast->tasks[thread_index].current_state; - struct lp_rast_tile *tile = &rast->tasks[thread_index].tile; + struct lp_rasterizer *rast = task->rast; + const struct lp_rast_state *state = task->current_state; + struct lp_rast_tile *tile = &task->tile; const unsigned ix = x % TILE_SIZE, iy = y % TILE_SIZE; uint8_t *color[PIPE_MAX_COLOR_BUFS]; void *depth; diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c index bbc95c399a..90325aedb8 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c @@ -93,10 +93,7 @@ block_full_4( struct lp_rasterizer_task *rast_task, const struct lp_rast_triangle *tri, int x, int y ) { - lp_rast_shade_quads_all(rast_task->rast, - rast_task->thread_index, - &tri->inputs, - x, y); + lp_rast_shade_quads_all(rast_task, &tri->inputs, x, y); } @@ -133,8 +130,7 @@ do_block_4( struct lp_rasterizer_task *rast_task, assert(x >= 0); assert(y >= 0); - lp_rast_shade_quads(rast_task->rast, - rast_task->thread_index, + lp_rast_shade_quads(rast_task, &tri->inputs, x, y, -c1, -c2, -c3); -- cgit v1.2.3 From 5046f2c1950c44129f6098a7aae14dd50ee1f8a4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 13:53:30 -0700 Subject: llvmpipe: more lp_rasterizer_task parameter passing --- src/gallium/drivers/llvmpipe/lp_rast.c | 119 +++++++++++++---------------- src/gallium/drivers/llvmpipe/lp_rast.h | 24 +++--- src/gallium/drivers/llvmpipe/lp_rast_tri.c | 57 ++++++-------- src/gallium/drivers/llvmpipe/lp_scene.h | 3 +- 4 files changed, 89 insertions(+), 114 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 159ef0d55d..07817efd74 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -156,14 +156,13 @@ lp_rast_end( struct lp_rasterizer *rast ) * \param y window Y position of the tile, in pixels */ static void -lp_rast_start_tile( struct lp_rasterizer *rast, - unsigned thread_index, - unsigned x, unsigned y ) +lp_rast_start_tile(struct lp_rasterizer_task *task, + unsigned x, unsigned y) { LP_DBG(DEBUG_RAST, "%s %d,%d\n", __FUNCTION__, x, y); - rast->tasks[thread_index].x = x; - rast->tasks[thread_index].y = y; + task->x = x; + task->y = y; } @@ -171,12 +170,13 @@ lp_rast_start_tile( struct lp_rasterizer *rast, * Clear the rasterizer's current color tile. * This is a bin command called during bin processing. */ -void lp_rast_clear_color( struct lp_rasterizer *rast, - unsigned thread_index, - const union lp_rast_cmd_arg arg ) +void +lp_rast_clear_color(struct lp_rasterizer_task *task, + const union lp_rast_cmd_arg arg) { + struct lp_rasterizer *rast = task->rast; const uint8_t *clear_color = arg.clear_color; - uint8_t **color_tile = rast->tasks[thread_index].tile.color; + uint8_t **color_tile = task->tile.color; unsigned i; LP_DBG(DEBUG_RAST, "%s 0x%x,0x%x,0x%x,0x%x\n", __FUNCTION__, @@ -225,11 +225,11 @@ void lp_rast_clear_color( struct lp_rasterizer *rast, * Clear the rasterizer's current z/stencil tile. * This is a bin command called during bin processing. */ -void lp_rast_clear_zstencil( struct lp_rasterizer *rast, - unsigned thread_index, - const union lp_rast_cmd_arg arg) +void +lp_rast_clear_zstencil(struct lp_rasterizer_task *task, + const union lp_rast_cmd_arg arg) { - struct lp_rasterizer_task *task = &rast->tasks[thread_index]; + struct lp_rasterizer *rast = task->rast; const unsigned tile_x = task->x; const unsigned tile_y = task->y; const unsigned height = TILE_SIZE/TILE_VECTOR_HEIGHT; @@ -288,13 +288,12 @@ void lp_rast_clear_zstencil( struct lp_rasterizer *rast, * Load tile color from the framebuffer surface. * This is a bin command called during bin processing. */ -void lp_rast_load_color( struct lp_rasterizer *rast, - unsigned thread_index, - const union lp_rast_cmd_arg arg) +void +lp_rast_load_color(struct lp_rasterizer_task *task, + const union lp_rast_cmd_arg arg) { - struct lp_rasterizer_task *task = &rast->tasks[thread_index]; - const unsigned x = task->x; - const unsigned y = task->y; + struct lp_rasterizer *rast = task->rast; + const unsigned x = task->x, y = task->y; unsigned i; LP_DBG(DEBUG_RAST, "%s at %u, %u\n", __FUNCTION__, x, y); @@ -304,10 +303,7 @@ void lp_rast_load_color( struct lp_rasterizer *rast, int w = TILE_SIZE; int h = TILE_SIZE; - if (x >= transfer->width) - continue; - - if (y >= transfer->height) + if (x >= transfer->width || y >= transfer->height) continue; assert(w >= 0); @@ -327,16 +323,16 @@ void lp_rast_load_color( struct lp_rasterizer *rast, } -void lp_rast_set_state( struct lp_rasterizer *rast, - unsigned thread_index, - const union lp_rast_cmd_arg arg ) +void +lp_rast_set_state(struct lp_rasterizer_task *task, + const union lp_rast_cmd_arg arg) { const struct lp_rast_state *state = arg.set_state; LP_DBG(DEBUG_RAST, "%s %p\n", __FUNCTION__, (void *) state); /* just set the current state pointer for this rasterizer */ - rast->tasks[thread_index].current_state = state; + task->current_state = state; } @@ -346,16 +342,15 @@ void lp_rast_set_state( struct lp_rasterizer *rast, * completely contained inside a triangle. * This is a bin command called during bin processing. */ -void lp_rast_shade_tile( struct lp_rasterizer *rast, - unsigned thread_index, - const union lp_rast_cmd_arg arg ) +void +lp_rast_shade_tile(struct lp_rasterizer_task *task, + const union lp_rast_cmd_arg arg) { - struct lp_rasterizer_task *task = &rast->tasks[thread_index]; + struct lp_rasterizer *rast = task->rast; const struct lp_rast_state *state = task->current_state; struct lp_rast_tile *tile = &task->tile; const struct lp_rast_shader_inputs *inputs = arg.shade_tile; - const unsigned tile_x = task->x; - const unsigned tile_y = task->y; + const unsigned tile_x = task->x, tile_y = task->y; unsigned x, y; LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); @@ -514,12 +509,11 @@ outline_subtiles(uint8_t *tile) /** * Write the rasterizer's color tile to the framebuffer. */ -static void lp_rast_store_color( struct lp_rasterizer *rast, - unsigned thread_index) +static void +lp_rast_store_color(struct lp_rasterizer_task *task) { - struct lp_rasterizer_task *task = &rast->tasks[thread_index]; - const unsigned x = task->x; - const unsigned y = task->y; + struct lp_rasterizer *rast = task->rast; + const unsigned x = task->x, y = task->y; unsigned i; for (i = 0; i < rast->state.fb.nr_cbufs; i++) { @@ -534,7 +528,7 @@ static void lp_rast_store_color( struct lp_rasterizer *rast, continue; LP_DBG(DEBUG_RAST, "%s [%u] %d,%d %dx%d\n", __FUNCTION__, - thread_index, x, y, w, h); + task->thread_index, x, y, w, h); if (LP_DEBUG & DEBUG_SHOW_SUBTILES) outline_subtiles(task->tile.color[i]); @@ -557,13 +551,14 @@ static void lp_rast_store_color( struct lp_rasterizer *rast, * Write the rasterizer's tiles to the framebuffer. */ static void -lp_rast_end_tile( struct lp_rasterizer *rast, - unsigned thread_index ) +lp_rast_end_tile(struct lp_rasterizer_task *task) { + struct lp_rasterizer *rast = task->rast; + LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); if (rast->state.write_color) - lp_rast_store_color(rast, thread_index); + lp_rast_store_color(task); } @@ -571,9 +566,9 @@ lp_rast_end_tile( struct lp_rasterizer *rast, * Signal on a fence. This is called during bin execution/rasterization. * Called per thread. */ -void lp_rast_fence( struct lp_rasterizer *rast, - unsigned thread_index, - const union lp_rast_cmd_arg arg ) +void +lp_rast_fence(struct lp_rasterizer_task *task, + const union lp_rast_cmd_arg arg) { struct lp_fence *fence = arg.fence; @@ -617,25 +612,24 @@ release_scene( struct lp_rasterizer *rast, * Called per thread. */ static void -rasterize_bin( struct lp_rasterizer *rast, - unsigned thread_index, - const struct cmd_bin *bin, - int x, int y) +rasterize_bin(struct lp_rasterizer_task *task, + const struct cmd_bin *bin, + int x, int y) { const struct cmd_block_list *commands = &bin->commands; struct cmd_block *block; unsigned k; - lp_rast_start_tile( rast, thread_index, x, y ); + lp_rast_start_tile( task, x, y ); /* simply execute each of the commands in the block list */ for (block = commands->head; block; block = block->next) { for (k = 0; k < block->count; k++) { - block->cmd[k]( rast, thread_index, block->arg[k] ); + block->cmd[k]( task, block->arg[k] ); } } - lp_rast_end_tile( rast, thread_index ); + lp_rast_end_tile( task ); } @@ -719,10 +713,9 @@ is_empty_bin( const struct cmd_bin *bin ) * Called per thread. */ static void -rasterize_scene( struct lp_rasterizer *rast, - unsigned thread_index, +rasterize_scene(struct lp_rasterizer_task *task, struct lp_scene *scene, - bool write_depth ) + bool write_depth) { /* loop over scene bins, rasterize each */ #if 0 @@ -730,9 +723,8 @@ rasterize_scene( struct lp_rasterizer *rast, unsigned i, j; for (i = 0; i < scene->tiles_x; i++) { for (j = 0; j < scene->tiles_y; j++) { - struct cmd_bin *bin = lp_get_bin(scene, i, j); - rasterize_bin( rast, thread_index, - bin, i * TILE_SIZE, j * TILE_SIZE ); + struct cmd_bin *bin = lp_scene_get_bin(scene, i, j); + rasterize_bin(task, bin, i * TILE_SIZE, j * TILE_SIZE); } } } @@ -744,7 +736,7 @@ rasterize_scene( struct lp_rasterizer *rast, assert(scene); while ((bin = lp_scene_bin_iter_next(scene, &x, &y))) { if (!is_empty_bin( bin )) - rasterize_bin( rast, thread_index, bin, x * TILE_SIZE, y * TILE_SIZE); + rasterize_bin(task, bin, x * TILE_SIZE, y * TILE_SIZE); } } #endif @@ -788,7 +780,7 @@ lp_rasterize_scene( struct lp_rasterizer *rast, fb->zsbuf != NULL && write_depth ); lp_scene_bin_iter_begin( scene ); - rasterize_scene( rast, 0, scene, write_depth ); + rasterize_scene( &rast->tasks[0], scene, write_depth ); release_scene( rast, scene ); @@ -862,10 +854,9 @@ static PIPE_THREAD_ROUTINE( thread_func, init_data ) /* do work */ if (debug) debug_printf("thread %d doing work\n", task->thread_index); - rasterize_scene(rast, - task->thread_index, - rast->curr_scene, - rast->curr_scene->write_depth); + rasterize_scene(task, + rast->curr_scene, + rast->curr_scene->write_depth); /* wait for all threads to finish with this scene */ pipe_barrier_wait( &rast->barrier ); diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h index 875f18e0c0..1ed2700191 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.h +++ b/src/gallium/drivers/llvmpipe/lp_rast.h @@ -53,6 +53,9 @@ struct pipe_screen; #define FIXED_ONE (1<inputs, x, y); + lp_rast_shade_quads_all(task, &tri->inputs, x, y); } @@ -101,16 +101,16 @@ block_full_4( struct lp_rasterizer_task *rast_task, * Shade all pixels in a 16x16 block. */ static void -block_full_16( struct lp_rasterizer_task *rast_task, - const struct lp_rast_triangle *tri, - int x, int y ) +block_full_16(struct lp_rasterizer_task *task, + const struct lp_rast_triangle *tri, + int x, int y) { unsigned ix, iy; assert(x % 16 == 0); assert(y % 16 == 0); for (iy = 0; iy < 16; iy += 4) for (ix = 0; ix < 16; ix += 4) - block_full_4(rast_task, tri, x + ix, y + iy); + block_full_4(task, tri, x + ix, y + iy); } @@ -120,20 +120,15 @@ block_full_16( struct lp_rasterizer_task *rast_task, * will be done as part of the fragment shader. */ static void -do_block_4( struct lp_rasterizer_task *rast_task, - const struct lp_rast_triangle *tri, - int x, int y, - int c1, - int c2, - int c3 ) +do_block_4(struct lp_rasterizer_task *task, + const struct lp_rast_triangle *tri, + int x, int y, + int c1, int c2, int c3) { assert(x >= 0); assert(y >= 0); - lp_rast_shade_quads(rast_task, - &tri->inputs, - x, y, - -c1, -c2, -c3); + lp_rast_shade_quads(task, &tri->inputs, x, y, -c1, -c2, -c3); } @@ -142,12 +137,10 @@ do_block_4( struct lp_rasterizer_task *rast_task, * of the triangle's bounds. */ static void -do_block_16( struct lp_rasterizer_task *rast_task, - const struct lp_rast_triangle *tri, - int x, int y, - int c0, - int c1, - int c2 ) +do_block_16(struct lp_rasterizer_task *task, + const struct lp_rast_triangle *tri, + int x, int y, + int c0, int c1, int c2) { unsigned mask = 0; int eo[3]; @@ -194,7 +187,7 @@ do_block_16( struct lp_rasterizer_task *rast_task, * the triangle. It's a little faster to do it in the jit code. */ LP_COUNT(nr_non_empty_4); - do_block_4(rast_task, tri, px, py, cx1, cx2, cx3); + do_block_4(task, tri, px, py, cx1, cx2, cx3); } } @@ -204,15 +197,11 @@ do_block_16( struct lp_rasterizer_task *rast_task, * for this triangle. */ void -lp_rast_triangle( struct lp_rasterizer *rast, - unsigned thread_index, - const union lp_rast_cmd_arg arg ) +lp_rast_triangle(struct lp_rasterizer_task *task, + const union lp_rast_cmd_arg arg) { - struct lp_rasterizer_task *rast_task = &rast->tasks[thread_index]; const struct lp_rast_triangle *tri = arg.triangle; - - int x = rast_task->x; - int y = rast_task->y; + const int x = task->x, y = task->y; int ei[3], eo[3], c[3]; unsigned outmask, inmask, partial_mask; unsigned i, j; @@ -273,7 +262,7 @@ lp_rast_triangle( struct lp_rasterizer *rast, partial_mask &= ~(1 << i); LP_COUNT(nr_partially_covered_16); - do_block_16(rast_task, tri, px, py, cx1, cx2, cx3); + do_block_16(task, tri, px, py, cx1, cx2, cx3); } /* Iterate over fulls: @@ -286,6 +275,6 @@ lp_rast_triangle( struct lp_rasterizer *rast, inmask &= ~(1 << i); LP_COUNT(nr_fully_covered_16); - block_full_16(rast_task, tri, px, py); + block_full_16(task, tri, px, py); } } diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index fb478cc2eb..8d725cd437 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -56,8 +56,7 @@ /* switch to a non-pointer value for this: */ -typedef void (*lp_rast_cmd)( struct lp_rasterizer *, - unsigned thread_index, +typedef void (*lp_rast_cmd)( struct lp_rasterizer_task *, const union lp_rast_cmd_arg ); struct cmd_block { -- cgit v1.2.3 From f393d95ff2de0a87d188099f97bf6cc781ae9e54 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 14:06:52 -0700 Subject: dri: remove old assertion (see bug 26734) (cherry picked from commit 293f4d51b473783d5c5ab773a1c438e0a2fe46f2) --- src/mesa/drivers/dri/common/drirenderbuffer.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c index 48a2c66229..c9ce6e3cb6 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.c +++ b/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -59,14 +59,6 @@ driNewRenderbuffer(gl_format format, GLvoid *addr, { driRenderbuffer *drb; - assert(format == GL_RGBA || - format == GL_RGB5 || - format == GL_RGBA8 || - format == GL_DEPTH_COMPONENT16 || - format == GL_DEPTH_COMPONENT24 || - format == GL_DEPTH_COMPONENT32 || - format == GL_STENCIL_INDEX8_EXT); - assert(cpp > 0); assert(pitch > 0); -- cgit v1.2.3 From 17efc8c05c6931a4638ee9f6138794f2b2b29540 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 24 Feb 2010 14:00:30 -0800 Subject: mesa: Fix SCons build. --- src/mesa/main/teximage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 40ebff76c6..d72e91b3a3 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2452,10 +2452,10 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, void GLAPIENTRY _mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) { - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); struct gl_texture_object *texObj; struct gl_texture_image *texImage; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); if (target != GL_TEXTURE_2D) { _mesa_error(ctx, GL_INVALID_ENUM, -- cgit v1.2.3 From 1332ee5487cc03955978162076ae8f37e70f06ee Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 15:09:57 -0700 Subject: gallium: remove extra -I paths from Makefile.template --- src/gallium/Makefile.template | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template index 3274c8e0c3..713e192a4e 100644 --- a/src/gallium/Makefile.template +++ b/src/gallium/Makefile.template @@ -21,9 +21,6 @@ INCLUDES = \ -I$(TOP)/src/gallium/include \ -I$(TOP)/src/gallium/auxiliary \ -I$(TOP)/src/gallium/drivers \ - -I$(GALLIUM)/src/gallium/include \ - -I$(GALLIUM)/src/gallium/auxiliary \ - -I$(GALLIUM)/src/gallium/drivers \ $(LIBRARY_INCLUDES) -- cgit v1.2.3 From 778276a4dd30d97ca9b573b090a28b22d17a6801 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 15:49:11 -0700 Subject: r300g: remove invalid .PHONY line The $(COMPILER_ARCHIVE) target is not a phony target. This solves the unconditional re-making of libr300.a --- src/gallium/drivers/r300/Makefile | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index afddcb161f..1f69daec81 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -32,7 +32,5 @@ EXTRA_OBJECTS = \ include ../../Makefile.template -.PHONY : $(COMPILER_ARCHIVE) - $(COMPILER_ARCHIVE): $(MAKE) -C $(TOP)/src/mesa/drivers/dri/r300/compiler -- cgit v1.2.3 From 072aeb57bd20b5fc39cf9d46a693a1a9aa9de11e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 16:13:46 -0700 Subject: vbo: remove dead code --- src/mesa/vbo/vbo_context.c | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index a5b0070bd3..e3be39a342 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -33,24 +33,13 @@ #include "vbo.h" #include "vbo_context.h" -#if 0 -/* Reach out and grab this to use as the default: - */ -extern void _tnl_draw_prims( GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prims, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index ); -#endif - #define NR_LEGACY_ATTRIBS 16 #define NR_GENERIC_ATTRIBS 16 #define NR_MAT_ATTRIBS 12 + static GLuint check_size( const GLfloat *attr ) { if (attr[3] != 1.0) return 4; @@ -59,6 +48,7 @@ static GLuint check_size( const GLfloat *attr ) return 1; } + static void init_legacy_currval(GLcontext *ctx) { struct vbo_context *vbo = vbo_context(ctx); @@ -158,23 +148,6 @@ static void init_mat_currval(GLcontext *ctx) } } -#if 0 - -static void vbo_exec_current_init( struct vbo_exec_context *exec ) -{ - GLcontext *ctx = exec->ctx; - GLint i; - - /* setup the pointers for the typical 16 vertex attributes */ - for (i = 0; i < VBO_ATTRIB_FIRST_MATERIAL; i++) - exec->vtx.current[i] = ctx->Current.Attrib[i]; - - /* setup pointers for the 12 material attributes */ - for (i = 0; i < MAT_ATTRIB_MAX; i++) - exec->vtx.current[VBO_ATTRIB_FIRST_MATERIAL + i] = - ctx->Light.Material.Attrib[i]; -} -#endif GLboolean _vbo_CreateContext( GLcontext *ctx ) { @@ -220,12 +193,6 @@ GLboolean _vbo_CreateContext( GLcontext *ctx ) } - /* By default: - */ -#if 0 /* dead - see vbo_set_draw_func() */ - vbo->draw_prims = _tnl_draw_prims; -#endif - /* Hook our functions into exec and compile dispatch tables. These * will pretty much be permanently installed, which means that the * vtxfmt mechanism can be removed now. @@ -240,6 +207,7 @@ GLboolean _vbo_CreateContext( GLcontext *ctx ) return GL_TRUE; } + void _vbo_InvalidateState( GLcontext *ctx, GLuint new_state ) { _ae_invalidate_state(ctx, new_state); -- cgit v1.2.3 From bc04ae21c10bedcc75d3483784d3eaf7bf090f55 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 24 Feb 2010 17:30:43 -0700 Subject: llvmpipe: clean up rasterization threads upon context destruction Fixes glean hang, bug 26536. --- src/gallium/drivers/llvmpipe/lp_rast.c | 17 +++++++++++++++++ src/gallium/drivers/llvmpipe/lp_rast_priv.h | 1 + 2 files changed, 18 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 07817efd74..82c006d78b 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -826,6 +826,9 @@ static PIPE_THREAD_ROUTINE( thread_func, init_data ) debug_printf("thread %d waiting for work\n", task->thread_index); pipe_semaphore_wait(&task->work_ready); + if (rast->exit_flag) + break; + if (task->thread_index == 0) { /* thread[0]: * - get next scene to rasterize @@ -961,6 +964,20 @@ void lp_rast_destroy( struct lp_rasterizer *rast ) align_free(rast->tasks[i].tile.color[cbuf]); } + /* Set exit_flag and signal each thread's work_ready semaphore. + * Each thread will be woken up, notice that the exit_flag is set and + * break out of its main loop. The thread will then exit. + */ + rast->exit_flag = TRUE; + for (i = 0; i < rast->num_threads; i++) { + pipe_semaphore_signal(&rast->tasks[i].work_ready); + } + + for (i = 0; i < rast->num_threads; i++) { + pipe_semaphore_destroy(&rast->tasks[i].work_ready); + pipe_semaphore_destroy(&rast->tasks[i].work_done); + } + /* for synchronizing rasterization threads */ pipe_barrier_destroy( &rast->barrier ); diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h index 382e169c1c..abc5a9ad89 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h @@ -84,6 +84,7 @@ struct lp_rasterizer { boolean clipped_tile; boolean check_for_clipped_tiles; + boolean exit_flag; /* Framebuffer stuff */ -- cgit v1.2.3 From e6632b4bf7cba5fe8a77d54635a3b617fa67185f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 22 Feb 2010 15:11:29 +0100 Subject: r300g: prevent CS overflow when emitting the draw packets Signed-off-by: Corbin Simpson --- src/gallium/drivers/r300/r300_emit.c | 29 +++++++++++------------ src/gallium/drivers/r300/r300_emit.h | 2 ++ src/gallium/drivers/r300/r300_render.c | 42 ++++++++++++++++++++++++++++++---- 3 files changed, 55 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index f7dcd8dc52..2d8801c08a 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -1076,16 +1076,10 @@ validate: } } -/* Emit all dirty state. */ -void r300_emit_dirty_state(struct r300_context* r300) +unsigned r300_get_num_dirty_dwords(struct r300_context *r300) { - struct r300_screen* r300screen = r300_screen(r300->context.screen); struct r300_atom* atom; - unsigned i, dwords = 1024; - int dirty_tex = 0; - - /* Check the required number of dwords against the space remaining in the - * current CS object. If we need more, then flush. */ + unsigned dwords = 0; foreach(atom, &r300->atom_list) { if (atom->dirty || atom->always_dirty) { @@ -1093,12 +1087,19 @@ void r300_emit_dirty_state(struct r300_context* r300) } } - /* Make sure we have at least 2*1024 spare dwords. */ - /* XXX It would be nice to know the number of dwords we really need to - * XXX emit. */ - while (!r300->winsys->check_cs(r300->winsys, dwords)) { - r300->context.flush(&r300->context, 0, NULL); - } + /* XXX This is the compensation for the non-atomized states. */ + dwords += 2048; + + return dwords; +} + +/* Emit all dirty state. */ +void r300_emit_dirty_state(struct r300_context* r300) +{ + struct r300_screen* r300screen = r300_screen(r300->context.screen); + struct r300_atom* atom; + unsigned i; + int dirty_tex = 0; if (r300->dirty_state & R300_NEW_QUERY) { r300_emit_query_start(r300); diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 6b96d9b57c..ff709a0595 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -90,6 +90,8 @@ void r300_emit_ztop_state(struct r300_context* r300, void* state); void r300_flush_textures(struct r300_context* r300); +unsigned r300_get_num_dirty_dwords(struct r300_context *r300); + /* Emit all dirty state. */ void r300_emit_dirty_state(struct r300_context* r300); diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 648d884654..ec72d6c3b5 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -118,6 +118,18 @@ static uint32_t r300_provoking_vertex_fixes(struct r300_context *r300, return color_control; } +/* Check if the requested number of dwords is available in the CS and + * if not, flush. Return TRUE if the flush occured. */ +static boolean r300_reserve_cs_space(struct r300_context *r300, + unsigned dwords) +{ + while (!r300->winsys->check_cs(r300->winsys, dwords)) { + r300->context.flush(&r300->context, 0, NULL); + return TRUE; + } + return FALSE; +} + static boolean immd_is_good_idea(struct r300_context *r300, unsigned count) { @@ -132,7 +144,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, struct pipe_vertex_element* velem; struct pipe_vertex_buffer* vbuf; unsigned vertex_element_count = r300->vertex_element_count; - unsigned i, v, vbi, dw, elem_offset; + unsigned i, v, vbi, dw, elem_offset, dwords; /* Size of the vertex, in dwords. */ unsigned vertex_size = 0; @@ -171,9 +183,12 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, } } + dwords = 10 + count * vertex_size; + + r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + dwords); r300_emit_dirty_state(r300); - BEGIN_CS(10 + count * vertex_size); + BEGIN_CS(dwords); OUT_CS_REG(R300_GA_COLOR_CONTROL, r300_provoking_vertex_fixes(r300, mode)); OUT_CS_REG(R300_VAP_VTX_SIZE, vertex_size); @@ -400,8 +415,9 @@ void r300_draw_range_elements(struct pipe_context* pipe, goto cleanup; } + /* 128 dwords for emit_aos and emit_draw_elements */ + r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 128); r300_emit_dirty_state(r300); - r300_emit_aos(r300, 0); if (alt_num_verts || count <= 65535) { @@ -415,6 +431,12 @@ void r300_draw_range_elements(struct pipe_context* pipe, start += short_count; count -= short_count; + + /* 16 spare dwords are enough for emit_draw_elements. */ + if (count && r300_reserve_cs_space(r300, 16)) { + r300_emit_dirty_state(r300); + r300_emit_aos(r300, 0); + } } while (count); } @@ -461,6 +483,9 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, return; } + /* Make sure there are at least 128 spare dwords in the command buffer. + * (most of it being consumed by emit_aos) */ + r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 128); r300_emit_dirty_state(r300); if (alt_num_verts || count <= 65535) { @@ -474,6 +499,12 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, start += short_count; count -= short_count; + + /* Again, we emit both AOS and draw_arrays so there should be + * at least 128 spare dwords. */ + if (count && r300_reserve_cs_space(r300, 128)) { + r300_emit_dirty_state(r300); + } } while (count); } } @@ -690,6 +721,7 @@ static void r300_render_draw_arrays(struct vbuf_render* render, CS_LOCALS(r300); + r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 2); r300_emit_dirty_state(r300); DBG(r300, DBG_DRAW, "r300: Doing vbuf render, count %d\n", count); @@ -708,12 +740,14 @@ static void r300_render_draw(struct vbuf_render* render, struct r300_render* r300render = r300_render(render); struct r300_context* r300 = r300render->r300; int i; + unsigned dwords = 2 + (count+1)/2; CS_LOCALS(r300); + r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + dwords); r300_emit_dirty_state(r300); - BEGIN_CS(2 + (count+1)/2); + BEGIN_CS(dwords); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, (count+1)/2); OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) | r300render->hwprim); -- cgit v1.2.3 From f05d4526e31bfcf238d826582317312bf0d8572d Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 24 Feb 2010 19:53:47 -0800 Subject: r300g: Move CALLOCs to correct place. --- src/gallium/drivers/r300/r300_context.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index f631b4ed27..925873ad53 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -128,7 +128,14 @@ static void r300_setup_atoms(struct r300_context* r300) R300_INIT_ATOM(vertex_format, 26); /* Some non-CSO atoms need explicit space to store the state locally. */ + r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state); + r300->clip_state.state = CALLOC_STRUCT(pipe_clip_state); r300->fb_state.state = CALLOC_STRUCT(pipe_framebuffer_state); + r300->rs_block_state.state = CALLOC_STRUCT(r300_rs_block); + r300->scissor_state.state = CALLOC_STRUCT(pipe_scissor_state); + r300->vertex_format_state.state = CALLOC_STRUCT(r300_vertex_info); + r300->viewport_state.state = CALLOC_STRUCT(r300_viewport_state); + r300->ztop_state.state = CALLOC_STRUCT(r300_ztop_state); } struct pipe_context* r300_create_context(struct pipe_screen* screen, @@ -178,14 +185,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300_setup_atoms(r300); - r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state); - r300->clip_state.state = CALLOC_STRUCT(pipe_clip_state); - r300->rs_block_state.state = CALLOC_STRUCT(r300_rs_block); - r300->scissor_state.state = CALLOC_STRUCT(pipe_scissor_state); - r300->vertex_format_state.state = CALLOC_STRUCT(r300_vertex_info); - r300->viewport_state.state = CALLOC_STRUCT(r300_viewport_state); - r300->ztop_state.state = CALLOC_STRUCT(r300_ztop_state); - /* Open up the OQ BO. */ r300->oqbo = screen->buffer_create(screen, 4096, PIPE_BUFFER_USAGE_VERTEX, 4096); -- cgit v1.2.3 From 686f69bd13fd2aebaa40edeb7e25e4a49b12a2bd Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 24 Feb 2010 20:02:59 -0800 Subject: r300g: Atomize vertex shader. --- src/gallium/drivers/r300/r300_blit.c | 2 +- src/gallium/drivers/r300/r300_context.c | 1 + src/gallium/drivers/r300/r300_context.h | 3 +- src/gallium/drivers/r300/r300_emit.c | 62 ++++++++++++--------------- src/gallium/drivers/r300/r300_emit.h | 3 +- src/gallium/drivers/r300/r300_state.c | 18 ++++---- src/gallium/drivers/r300/r300_state_derived.c | 25 ++++++----- src/gallium/drivers/r300/r300_vs.c | 4 +- 8 files changed, 58 insertions(+), 60 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index eb9b0beeb5..187b4bf384 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -33,7 +33,7 @@ static void r300_blitter_save_states(struct r300_context* r300) util_blitter_save_stencil_ref(r300->blitter, &(r300->stencil_ref)); util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state); util_blitter_save_fragment_shader(r300->blitter, r300->fs); - util_blitter_save_vertex_shader(r300->blitter, r300->vs); + util_blitter_save_vertex_shader(r300->blitter, r300->vs_state.state); } /* Clear currently bound buffers. */ diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 925873ad53..47883589a7 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -126,6 +126,7 @@ static void r300_setup_atoms(struct r300_context* r300) R300_INIT_ATOM(viewport, 9); R300_INIT_ATOM(rs_block, 21); R300_INIT_ATOM(vertex_format, 26); + R300_INIT_ATOM(vs, 1031); /* Some non-CSO atoms need explicit space to store the state locally. */ r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 443af4ec2e..3d4f6524e5 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -155,7 +155,6 @@ struct r300_ztop_state { #define R300_ANY_NEW_SAMPLERS 0x0001fe00 #define R300_NEW_TEXTURE 0x00040000 #define R300_ANY_NEW_TEXTURES 0x03fc0000 -#define R300_NEW_VERTEX_SHADER 0x08000000 #define R300_NEW_VERTEX_SHADER_CONSTANTS 0x10000000 #define R300_NEW_QUERY 0x40000000 #define R300_NEW_KITCHEN_SINK 0x7fffffff @@ -315,7 +314,7 @@ struct r300_context { struct r300_texture* textures[8]; int texture_count; /* Vertex shader. */ - struct r300_vertex_shader* vs; + struct r300_atom vs_state; /* Viewport state. */ struct r300_atom viewport_state; /* ZTOP state. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 2d8801c08a..3037a38989 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -843,21 +843,31 @@ void r300_emit_vertex_format_state(struct r300_context* r300, void* state) END_CS; } +static void r300_flush_pvs(struct r300_context* r300) +{ + CS_LOCALS(r300); + + BEGIN_CS(2); + OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); + END_CS; +} -void r300_emit_vertex_program_code(struct r300_context* r300, - struct r300_vertex_program_code* code) +void r300_emit_vs_state(struct r300_context* r300, void* state) { - int i; + struct r300_vertex_shader* vs = (struct r300_vertex_shader*)state; + struct r300_vertex_program_code* code = &vs->code; struct r300_screen* r300screen = r300_screen(r300->context.screen); unsigned instruction_count = code->length / 4; + unsigned i; + + unsigned vtx_mem_size = r300screen->caps->is_r500 ? 128 : 72; + unsigned input_count = MAX2(util_bitcount(code->InputsRead), 1); + unsigned output_count = MAX2(util_bitcount(code->OutputsWritten), 1); + unsigned temp_count = MAX2(code->num_temporaries, 1); - int vtx_mem_size = r300screen->caps->is_r500 ? 128 : 72; - int input_count = MAX2(util_bitcount(code->InputsRead), 1); - int output_count = MAX2(util_bitcount(code->OutputsWritten), 1); - int temp_count = MAX2(code->num_temporaries, 1); - int pvs_num_slots = MIN3(vtx_mem_size / input_count, - vtx_mem_size / output_count, 10); - int pvs_num_controllers = MIN2(vtx_mem_size / temp_count, 6); + unsigned pvs_num_slots = MIN3(vtx_mem_size / input_count, + vtx_mem_size / output_count, 10); + unsigned pvs_num_controllers = MIN2(vtx_mem_size / temp_count, 6); CS_LOCALS(r300); @@ -867,6 +877,8 @@ void r300_emit_vertex_program_code(struct r300_context* r300, return; } + r300_flush_pvs(r300); + BEGIN_CS(9 + code->length); /* R300_VAP_PVS_CODE_CNTL_0 * R300_VAP_PVS_CONST_CNTL @@ -881,8 +893,9 @@ void r300_emit_vertex_program_code(struct r300_context* r300, OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, 0); OUT_CS_ONE_REG(R300_VAP_PVS_UPLOAD_DATA, code->length); - for (i = 0; i < code->length; i++) + for (i = 0; i < code->length; i++) { OUT_CS(code->body.d[i]); + } OUT_CS_REG(R300_VAP_CNTL, R300_PVS_NUM_SLOTS(pvs_num_slots) | R300_PVS_NUM_CNTLRS(pvs_num_controllers) | @@ -892,12 +905,6 @@ void r300_emit_vertex_program_code(struct r300_context* r300, END_CS; } -void r300_emit_vertex_shader(struct r300_context* r300, - struct r300_vertex_shader* vs) -{ - r300_emit_vertex_program_code(r300, &vs->code); -} - void r300_emit_vs_constant_buffer(struct r300_context* r300, struct rc_constant_list* constants) { @@ -994,15 +1001,6 @@ void r300_flush_textures(struct r300_context* r300) END_CS; } -static void r300_flush_pvs(struct r300_context* r300) -{ - CS_LOCALS(r300); - - BEGIN_CS(2); - OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); - END_CS; -} - void r300_emit_buffer_validate(struct r300_context *r300) { struct pipe_framebuffer_state* fb = @@ -1088,7 +1086,7 @@ unsigned r300_get_num_dirty_dwords(struct r300_context *r300) } /* XXX This is the compensation for the non-atomized states. */ - dwords += 2048; + dwords += 1024; return dwords; } @@ -1160,17 +1158,13 @@ void r300_emit_dirty_state(struct r300_context* r300) r300_flush_textures(r300); } - if (r300->dirty_state & (R300_NEW_VERTEX_SHADER | R300_NEW_VERTEX_SHADER_CONSTANTS)) { + if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS || r300->vs_state.dirty) { r300_flush_pvs(r300); } - if (r300->dirty_state & R300_NEW_VERTEX_SHADER) { - r300_emit_vertex_shader(r300, r300->vs); - r300->dirty_state &= ~R300_NEW_VERTEX_SHADER; - } - if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS) { - r300_emit_vs_constant_buffer(r300, &r300->vs->code.constants); + struct r300_vertex_shader* vs = r300->vs_state.state; + r300_emit_vs_constant_buffer(r300, &vs->code.constants); r300->dirty_state &= ~R300_NEW_VERTEX_SHADER_CONSTANTS; } diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index ff709a0595..f27cf5f32d 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -79,8 +79,7 @@ void r300_emit_vertex_program_code(struct r300_context* r300, void r300_emit_vs_constant_buffer(struct r300_context* r300, struct rc_constant_list* constants); -void r300_emit_vertex_shader(struct r300_context* r300, - struct r300_vertex_shader* vs); +void r300_emit_vs_state(struct r300_context* r300, void* state); void r300_emit_viewport_state(struct r300_context* r300, void* state); diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 34bf81c193..0f14ccc53e 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -658,9 +658,7 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) r300->fs = fs; r300_pick_fragment_shader(r300); - if (r300->vs && r300_vertex_shader_setup_wpos(r300)) { - r300->vertex_format_state.dirty = TRUE; - } + r300->vertex_format_state.dirty = TRUE; r300->dirty_state |= R300_NEW_FRAGMENT_SHADER | R300_NEW_FRAGMENT_SHADER_CONSTANTS; } @@ -1107,21 +1105,23 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader; if (vs == NULL) { - r300->vs = NULL; + r300->vs_state.state = NULL; return; } else if (!vs->translated) { r300_translate_vertex_shader(r300, vs); } - r300->vs = vs; + r300->vs_state.state = vs; + r300->vs_state.size = vs->code.length + 11; + r300->vs_state.dirty = TRUE; + + r300->vertex_format_state.dirty = TRUE; + if (r300->fs) { r300_vertex_shader_setup_wpos(r300); } - r300->vertex_format_state.dirty = TRUE; - - r300->dirty_state |= - R300_NEW_VERTEX_SHADER | R300_NEW_VERTEX_SHADER_CONSTANTS; + r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS; } else { draw_flush(r300->draw); draw_bind_vertex_shader(r300->draw, diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 2cbce9210a..b33d44990a 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -42,7 +42,8 @@ static void r300_draw_emit_attrib(struct r300_context* r300, enum interp_mode interp, int index) { - struct tgsi_shader_info* info = &r300->vs->info; + struct r300_vertex_shader* vs = r300->vs_state.state; + struct tgsi_shader_info* info = &vs->info; int output; output = draw_find_shader_output(r300->draw, @@ -55,7 +56,8 @@ static void r300_draw_emit_attrib(struct r300_context* r300, static void r300_draw_emit_all_attribs(struct r300_context* r300) { - struct r300_shader_semantics* vs_outputs = &r300->vs->outputs; + struct r300_vertex_shader* vs = r300->vs_state.state; + struct r300_shader_semantics* vs_outputs = &vs->outputs; int i, gen_count; /* Position. */ @@ -106,6 +108,7 @@ static void r300_draw_emit_all_attribs(struct r300_context* r300) /* Update the PSC tables. */ static void r300_vertex_psc(struct r300_context* r300) { + struct r300_vertex_shader* vs = r300->vs_state.state; struct r300_vertex_info *vformat = (struct r300_vertex_info*)r300->vertex_format_state.state; uint16_t type, swizzle; @@ -117,7 +120,7 @@ static void r300_vertex_psc(struct r300_context* r300) /* If TCL is bypassed, map vertex streams to equivalent VS output * locations. */ if (r300->tcl_bypass) { - stream_tab = r300->vs->stream_loc_notcl; + stream_tab = vs->stream_loc_notcl; } else { stream_tab = identity; } @@ -127,7 +130,7 @@ static void r300_vertex_psc(struct r300_context* r300) * and not on attrib information. */ DBG(r300, DBG_DRAW, "r300: vs expects %d attribs, routing %d elements" " in psc\n", - r300->vs->info.num_inputs, + vs->info.num_inputs, r300->vertex_element_count); for (i = 0; i < r300->vertex_element_count; i++) { @@ -159,13 +162,14 @@ static void r300_vertex_psc(struct r300_context* r300) /* Update the PSC tables for SW TCL, using Draw. */ static void r300_swtcl_vertex_psc(struct r300_context* r300) { + struct r300_vertex_shader* vs = r300->vs_state.state; struct r300_vertex_info *vformat = (struct r300_vertex_info*)r300->vertex_format_state.state; struct vertex_info* vinfo = &vformat->vinfo; uint16_t type, swizzle; enum pipe_format format; unsigned i, attrib_count; - int* vs_output_tab = r300->vs->stream_loc_notcl; + int* vs_output_tab = vs->stream_loc_notcl; /* For each Draw attribute, route it to the fragment shader according * to the vs_output_tab. */ @@ -424,6 +428,7 @@ static void r300_update_rs_block(struct r300_context* r300, /* Update the shader-dependant states. */ static void r300_update_derived_shader_state(struct r300_context* r300) { + struct r300_vertex_shader* vs = r300->vs_state.state; struct r300_screen* r300screen = r300_screen(r300->context.screen); struct r300_vertex_info *vformat = (struct r300_vertex_info*)r300->vertex_format_state.state; @@ -431,9 +436,9 @@ static void r300_update_derived_shader_state(struct r300_context* r300) /* Mmm, delicious hax */ memset(r300->vertex_format_state.state, 0, sizeof(struct r300_vertex_info)); - memcpy(vinfo->hwfmt, r300->vs->hwfmt, sizeof(uint)*4); + memcpy(vinfo->hwfmt, vs->hwfmt, sizeof(uint)*4); - r300_update_rs_block(r300, &r300->vs->outputs, &r300->fs->inputs); + r300_update_rs_block(r300, &vs->outputs, &r300->fs->inputs); if (r300screen->caps->has_tcl) { r300_vertex_psc(r300); @@ -519,9 +524,9 @@ static void r300_update_ztop(struct r300_context* r300) void r300_update_derived_state(struct r300_context* r300) { /* XXX */ - if (r300->dirty_state & - (R300_NEW_FRAGMENT_SHADER | R300_NEW_VERTEX_SHADER) || - r300->vertex_format_state.dirty || r300->rs_state.dirty) { + if (r300->dirty_state & R300_NEW_FRAGMENT_SHADER || + r300->vs_state.dirty || r300->vertex_format_state.dirty || + r300->rs_state.dirty) { r300_update_derived_shader_state(r300); } diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index a6786c321c..60a04bbfed 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -368,8 +368,8 @@ void r300_translate_vertex_shader(struct r300_context* r300, boolean r300_vertex_shader_setup_wpos(struct r300_context* r300) { - struct r300_vertex_shader* vs = r300->vs; - int tex_output = r300->vs->wpos_tex_output; + struct r300_vertex_shader* vs = r300->vs_state.state; + int tex_output = vs->wpos_tex_output; uint32_t tex_fmt = R300_INPUT_CNTL_TC0 << tex_output; uint32_t* hwfmt = vs->hwfmt; -- cgit v1.2.3 From 235c6bdf6dc0a687a7313f948444c4294abc0ea1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 25 Feb 2010 10:22:30 +0100 Subject: util: Fix blitter vertex and viewport setup. --- src/gallium/auxiliary/util/u_blit.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index 95567d00fe..0b263a9db5 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -426,11 +426,11 @@ util_blit_pixels_writemask(struct blit_state *ctx, /* viewport */ ctx->viewport.scale[0] = 0.5f * dst->width; ctx->viewport.scale[1] = 0.5f * dst->height; - ctx->viewport.scale[2] = 1.0f; + ctx->viewport.scale[2] = 0.5f; ctx->viewport.scale[3] = 1.0f; ctx->viewport.translate[0] = 0.5f * dst->width; ctx->viewport.translate[1] = 0.5f * dst->height; - ctx->viewport.translate[2] = 0.0f; + ctx->viewport.translate[2] = 0.5f; ctx->viewport.translate[3] = 0.0f; cso_set_viewport(ctx->cso, &ctx->viewport); @@ -456,8 +456,10 @@ util_blit_pixels_writemask(struct blit_state *ctx, /* draw quad */ offset = setup_vertex_data_tex(ctx, - (float) dstX0, (float) dstY0, - (float) dstX1, (float) dstY1, + (float) dstX0 / dst->width * 2.0f - 1.0f, + (float) dstY0 / dst->height * 2.0f - 1.0f, + (float) dstX1 / dst->width * 2.0f - 1.0f, + (float) dstY1 / dst->height * 2.0f - 1.0f, s0, t0, s1, t1, z); @@ -575,6 +577,17 @@ util_blit_pixels_tex(struct blit_state *ctx, cso_single_sampler(ctx->cso, 0, &ctx->sampler); cso_single_sampler_done(ctx->cso); + /* viewport */ + ctx->viewport.scale[0] = 0.5f * dst->width; + ctx->viewport.scale[1] = 0.5f * dst->height; + ctx->viewport.scale[2] = 0.5f; + ctx->viewport.scale[3] = 1.0f; + ctx->viewport.translate[0] = 0.5f * dst->width; + ctx->viewport.translate[1] = 0.5f * dst->height; + ctx->viewport.translate[2] = 0.5f; + ctx->viewport.translate[3] = 0.0f; + cso_set_viewport(ctx->cso, &ctx->viewport); + /* texture */ cso_set_sampler_textures(ctx->cso, 1, &tex); @@ -592,8 +605,10 @@ util_blit_pixels_tex(struct blit_state *ctx, /* draw quad */ offset = setup_vertex_data_tex(ctx, - (float) dstX0, (float) dstY0, - (float) dstX1, (float) dstY1, + (float) dstX0 / dst->width * 2.0f - 1.0f, + (float) dstY0 / dst->height * 2.0f - 1.0f, + (float) dstX1 / dst->width * 2.0f - 1.0f, + (float) dstY1 / dst->height * 2.0f - 1.0f, s0, t0, s1, t1, z); -- cgit v1.2.3 From 9be414f4b93c763e1aee8f634a13721ae5d95fcd Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 25 Feb 2010 02:19:00 -0800 Subject: glu/sgi: Set freed pointer to NULL. --- src/glu/sgi/libtess/mesh.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c index 95f87cdc94..2e962ed437 100644 --- a/src/glu/sgi/libtess/mesh.c +++ b/src/glu/sgi/libtess/mesh.c @@ -332,6 +332,7 @@ int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) /* We are merging two disjoint vertices -- destroy eDst->Org */ joiningVertices = TRUE; KillVertex( eDst->Org, eOrg->Org ); + eDst->Org = NULL; } if( eDst->Lface != eOrg->Lface ) { /* We are connecting two disjoint loops -- destroy eDst->Lface */ -- cgit v1.2.3 From d553479cc48d512fc5055c166a699bcfff494a24 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 25 Feb 2010 02:26:18 -0800 Subject: mesa: Remove dead error condition. --- src/mesa/main/pixel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index f6c316a580..e2e3854fc8 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -427,7 +427,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values ) _mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapusv(map)"); return; } - mapsize = pm ? pm->Size : 0; + mapsize = pm->Size; if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, GL_UNSIGNED_SHORT, values)) { -- cgit v1.2.3 From cc7904ffa56b3f27de80bf31084dead12fb09ae0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 25 Feb 2010 02:42:41 -0800 Subject: util: Assert that pointer is not null before dereferencing. --- src/gallium/auxiliary/util/u_inlines.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_inlines.h b/src/gallium/auxiliary/util/u_inlines.h index e95d58ea86..0cb3432c6e 100644 --- a/src/gallium/auxiliary/util/u_inlines.h +++ b/src/gallium/auxiliary/util/u_inlines.h @@ -90,7 +90,10 @@ pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) static INLINE void pipe_buffer_reference(struct pipe_buffer **ptr, struct pipe_buffer *buf) { - struct pipe_buffer *old_buf = *ptr; + struct pipe_buffer *old_buf; + + assert(ptr); + old_buf = *ptr; if (pipe_reference(&(*ptr)->reference, &buf->reference)) old_buf->screen->buffer_destroy(old_buf); -- cgit v1.2.3 From 545ac97f9b95e9b5ebd04d2960abb224b5adbe17 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 17 Feb 2010 23:11:31 +0800 Subject: st/egl: Add dri2InvalidateBuffers. src/glx/dri2.c will call dri2InvalidateBuffers when DRI2_InvalidateBuffers event is received. This fixes a missing symbol error, and paves the way for event-based validation. --- src/gallium/state_trackers/egl/x11/native_dri2.c | 13 ++++- src/gallium/state_trackers/egl/x11/native_x11.c | 2 +- src/gallium/state_trackers/egl/x11/x11_screen.c | 68 ++++++++++++++++++------ src/gallium/state_trackers/egl/x11/x11_screen.h | 10 +++- 4 files changed, 74 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index dbd1a64992..feae025dcc 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -50,6 +50,8 @@ struct dri2_display { struct drm_api *api; struct x11_screen *xscr; int xscr_number; + const char *dri_driver; + int dri_major, dri_minor; struct dri2_config *configs; int num_configs; @@ -681,7 +683,16 @@ dri2_display_init_screen(struct native_display *ndpy) return FALSE; } - fd = x11_screen_enable_dri2(dri2dpy->xscr, driver); + dri2dpy->dri_driver = x11_screen_probe_dri2(dri2dpy->xscr, + &dri2dpy->dri_major, &dri2dpy->dri_minor); + if (!dri2dpy->dri_driver || !driver || + strcmp(dri2dpy->dri_driver, driver) != 0) { + _eglLog(_EGL_WARNING, "Driver mismatch: %s != %s", + dri2dpy->dri_driver, dri2dpy->api->name); + return FALSE; + } + + fd = x11_screen_enable_dri2(dri2dpy->xscr, NULL, NULL); if (fd < 0) return FALSE; diff --git a/src/gallium/state_trackers/egl/x11/native_x11.c b/src/gallium/state_trackers/egl/x11/native_x11.c index 55f0d4d308..3add95d0ac 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.c +++ b/src/gallium/state_trackers/egl/x11/native_x11.c @@ -70,7 +70,7 @@ native_create_probe(EGLNativeDisplayType dpy) xscr = x11_screen_create(xdpy, scr); if (xscr) { if (x11_screen_support(xscr, X11_SCREEN_EXTENSION_DRI2)) { - driver_name = x11_screen_probe_dri2(xscr); + driver_name = x11_screen_probe_dri2(xscr, NULL, NULL); if (driver_name) nprobe->data = strdup(driver_name); } diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.c b/src/gallium/state_trackers/egl/x11/x11_screen.c index d72bfc99d3..f409611484 100644 --- a/src/gallium/state_trackers/egl/x11/x11_screen.c +++ b/src/gallium/state_trackers/egl/x11/x11_screen.c @@ -39,6 +39,9 @@ #include "glxinit.h" struct x11_screen { + /* dummy base class */ + struct __GLXDRIdisplayRec base; + Display *dpy; int number; @@ -53,6 +56,9 @@ struct x11_screen { char *dri_device; int dri_fd; + x11_drawable_invalidate_buffers dri_invalidate_buffers; + void *dri_user_data; + XVisualInfo *visuals; int num_visuals; @@ -98,6 +104,8 @@ x11_screen_destroy(struct x11_screen *xscr) Xfree(xscr->dri_device); /* xscr->glx_dpy will be destroyed with the X display */ + if (xscr->glx_dpy) + xscr->glx_dpy->dri2Display = NULL; if (xscr->visuals) XFree(xscr->visuals); @@ -247,24 +255,25 @@ x11_screen_get_glx_visuals(struct x11_screen *xscr) : NULL; } -static boolean -x11_screen_is_driver_equal(struct x11_screen *xscr, const char *driver) -{ - return (strcmp(xscr->dri_driver, driver) == 0); -} - /** * Probe the screen for the DRI2 driver name. */ const char * -x11_screen_probe_dri2(struct x11_screen *xscr) +x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor) { + if (!x11_screen_init_dri2(xscr)) + return NULL; + /* get the driver name and the device name */ if (!xscr->dri_driver) { if (!DRI2Connect(xscr->dpy, RootWindow(xscr->dpy, xscr->number), &xscr->dri_driver, &xscr->dri_device)) xscr->dri_driver = xscr->dri_device = NULL; } + if (major) + *major = xscr->dri_major; + if (minor) + *minor = xscr->dri_minor; return xscr->dri_driver; } @@ -274,21 +283,17 @@ x11_screen_probe_dri2(struct x11_screen *xscr) * descriptor will be closed automatically when the screen is destoryed. */ int -x11_screen_enable_dri2(struct x11_screen *xscr, const char *driver) +x11_screen_enable_dri2(struct x11_screen *xscr, + x11_drawable_invalidate_buffers invalidate_buffers, + void *user_data) { if (xscr->dri_fd < 0) { int fd; drm_magic_t magic; /* get the driver name and the device name first */ - if (!x11_screen_probe_dri2(xscr)) - return -1; - - if (!x11_screen_is_driver_equal(xscr, driver)) { - _eglLog(_EGL_WARNING, "Driver mismatch: %s != %s", - xscr->dri_driver, driver); + if (!x11_screen_probe_dri2(xscr, NULL, NULL)) return -1; - } fd = open(xscr->dri_device, O_RDWR); if (fd < 0) { @@ -310,6 +315,22 @@ x11_screen_enable_dri2(struct x11_screen *xscr, const char *driver) return -1; } + if (!x11_screen_init_glx(xscr)) { + _eglLog(_EGL_WARNING, "failed to initialize GLX"); + close(fd); + return -1; + } + if (xscr->glx_dpy->dri2Display) { + _eglLog(_EGL_WARNING, + "display is already managed by another x11 screen"); + close(fd); + return -1; + } + + xscr->glx_dpy->dri2Display = (__GLXDRIdisplay *) xscr; + xscr->dri_invalidate_buffers = invalidate_buffers; + xscr->dri_user_data = user_data; + xscr->dri_fd = fd; } @@ -451,3 +472,20 @@ x11_context_modes_count(const __GLcontextModes *modes) count++; return count; } + +/** + * This is called from src/glx/dri2.c. + */ +void +dri2InvalidateBuffers(Display *dpy, XID drawable) +{ + __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct x11_screen *xscr = NULL; + + if (priv && priv->dri2Display) + xscr = (struct x11_screen *) priv->dri2Display; + if (!xscr || !xscr->dri_invalidate_buffers) + return; + + xscr->dri_invalidate_buffers(xscr, drawable, xscr->dri_user_data); +} diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.h b/src/gallium/state_trackers/egl/x11/x11_screen.h index 5432858ac3..37e8d5a40e 100644 --- a/src/gallium/state_trackers/egl/x11/x11_screen.h +++ b/src/gallium/state_trackers/egl/x11/x11_screen.h @@ -48,6 +48,10 @@ struct x11_drawable_buffer { struct x11_screen; +typedef void (*x11_drawable_invalidate_buffers)(struct x11_screen *xscr, + Drawable drawable, + void *user_data); + struct x11_screen * x11_screen_create(Display *dpy, int screen); @@ -71,10 +75,12 @@ const __GLcontextModes * x11_screen_get_glx_visuals(struct x11_screen *xscr); const char * -x11_screen_probe_dri2(struct x11_screen *xscr); +x11_screen_probe_dri2(struct x11_screen *xscr, int *major, int *minor); int -x11_screen_enable_dri2(struct x11_screen *xscr, const char *driver); +x11_screen_enable_dri2(struct x11_screen *xscr, + x11_drawable_invalidate_buffers invalidate_buffers, + void *user_data); __GLcontextModes * x11_context_modes_create(unsigned count); -- cgit v1.2.3 From 29ec53d8439eab85f39de02bd18539c26410d2bf Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 24 Feb 2010 15:34:16 +0800 Subject: st/egl: Refactor dri2_surface_get_buffers. Add dri2_surface_process_drawable_buffers to process the buffers returned by the server. --- src/gallium/state_trackers/egl/x11/native_dri2.c | 118 +++++++++++++---------- 1 file changed, 67 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index feae025dcc..f4072bb0cd 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -98,65 +98,23 @@ dri2_config(const struct native_config *nconf) } /** - * Get the buffers from the server. + * Process the buffers returned by the server. */ static void -dri2_surface_get_buffers(struct native_surface *nsurf, uint buffer_mask) +dri2_surface_process_drawable_buffers(struct native_surface *nsurf, + struct x11_drawable_buffer *xbufs, + int num_xbufs) { struct dri2_surface *dri2surf = dri2_surface(nsurf); struct dri2_display *dri2dpy = dri2surf->dri2dpy; - unsigned int dri2atts[NUM_NATIVE_ATTACHMENTS]; - int num_ins, num_outs, att, i; - struct x11_drawable_buffer *xbufs; struct pipe_texture templ; uint valid_mask; + int i; - /* prepare the attachments */ - num_ins = 0; - for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { - if (native_attachment_mask_test(buffer_mask, att)) { - unsigned int dri2att; - - switch (att) { - case NATIVE_ATTACHMENT_FRONT_LEFT: - dri2att = DRI2BufferFrontLeft; - break; - case NATIVE_ATTACHMENT_BACK_LEFT: - dri2att = DRI2BufferBackLeft; - break; - case NATIVE_ATTACHMENT_FRONT_RIGHT: - dri2att = DRI2BufferFrontRight; - break; - case NATIVE_ATTACHMENT_BACK_RIGHT: - dri2att = DRI2BufferBackRight; - break; - default: - assert(0); - dri2att = 0; - break; - } - - dri2atts[num_ins] = dri2att; - num_ins++; - } - } - - xbufs = x11_drawable_get_buffers(dri2dpy->xscr, dri2surf->drawable, - &dri2surf->width, &dri2surf->height, - dri2atts, FALSE, num_ins, &num_outs); - - /* we should be able to do better... */ - if (xbufs && dri2surf->last_num_xbufs == num_outs && - memcmp(dri2surf->last_xbufs, xbufs, sizeof(*xbufs) * num_outs) == 0) { - free(xbufs); - return; - } - - /* free the old buffers */ + /* free the old textures */ for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) pipe_texture_reference(&dri2surf->textures[i], NULL); dri2surf->valid_mask = 0x0; - dri2surf->sequence_number++; dri2surf->have_back = FALSE; dri2surf->have_fake = FALSE; @@ -174,7 +132,7 @@ dri2_surface_get_buffers(struct native_surface *nsurf, uint buffer_mask) templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; valid_mask = 0x0; - for (i = 0; i < num_outs; i++) { + for (i = 0; i < num_xbufs; i++) { struct x11_drawable_buffer *xbuf = &xbufs[i]; const char *desc; enum native_attachment natt; @@ -214,12 +172,70 @@ dri2_surface_get_buffers(struct native_surface *nsurf, uint buffer_mask) valid_mask |= 1 << natt; } + dri2surf->valid_mask = valid_mask; +} + +/** + * Get the buffers from the server. + */ +static void +dri2_surface_get_buffers(struct native_surface *nsurf, uint buffer_mask) +{ + struct dri2_surface *dri2surf = dri2_surface(nsurf); + struct dri2_display *dri2dpy = dri2surf->dri2dpy; + unsigned int dri2atts[NUM_NATIVE_ATTACHMENTS]; + int num_ins, num_outs, att; + struct x11_drawable_buffer *xbufs; + + /* prepare the attachments */ + num_ins = 0; + for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { + if (native_attachment_mask_test(buffer_mask, att)) { + unsigned int dri2att; + + switch (att) { + case NATIVE_ATTACHMENT_FRONT_LEFT: + dri2att = DRI2BufferFrontLeft; + break; + case NATIVE_ATTACHMENT_BACK_LEFT: + dri2att = DRI2BufferBackLeft; + break; + case NATIVE_ATTACHMENT_FRONT_RIGHT: + dri2att = DRI2BufferFrontRight; + break; + case NATIVE_ATTACHMENT_BACK_RIGHT: + dri2att = DRI2BufferBackRight; + break; + default: + assert(0); + dri2att = 0; + break; + } + + dri2atts[num_ins] = dri2att; + num_ins++; + } + } + + xbufs = x11_drawable_get_buffers(dri2dpy->xscr, dri2surf->drawable, + &dri2surf->width, &dri2surf->height, + dri2atts, FALSE, num_ins, &num_outs); + + /* we should be able to do better... */ + if (xbufs && dri2surf->last_num_xbufs == num_outs && + memcmp(dri2surf->last_xbufs, xbufs, sizeof(*xbufs) * num_outs) == 0) { + free(xbufs); + return; + } + + dri2_surface_process_drawable_buffers(&dri2surf->base, xbufs, num_outs); + + dri2surf->sequence_number++; + if (dri2surf->last_xbufs) free(dri2surf->last_xbufs); dri2surf->last_xbufs = xbufs; dri2surf->last_num_xbufs = num_outs; - - dri2surf->valid_mask = valid_mask; } /** -- cgit v1.2.3 From 33b92471a7b97c4f3ebf722e8551f37e167a445c Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 25 Feb 2010 21:16:56 +0800 Subject: st/egl: Reduce validation round-trips in ximage backend. ximage_surface_validate is called several times per frame. This commit adds the client and server stamps to reduce the round-trips to the server. The idea is to bump the server stamp when flush_frontbuffer or swap_buffers is called, and to skip the round-trip when the client stamp is equal to the server stamp. This makes sure the client APIs get the new buffers when a new frame is started while skipping all round-trips during the drawing. To make this work, egl_g3d_validate_context is no longer called after swap_buffers. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 20 +------ src/gallium/state_trackers/egl/x11/native_ximage.c | 62 +++++++++++++--------- 2 files changed, 39 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 13a7487ea8..086e644e21 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -931,25 +931,7 @@ egl_g3d_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf) if (gctx) gctx->stapi->st_notify_swapbuffers(gctx->draw.st_fb); - /* - * We drew on the back buffer, unless there was no back buffer. - * In that case, we drew on the front buffer. Either case, we call - * swap_buffers. - */ - if (!gsurf->native->swap_buffers(gsurf->native)) - return EGL_FALSE; - - if (gctx) { - struct egl_g3d_config *gconf = egl_g3d_config(gsurf->base.Config); - - /* force validation if the swap method is not copy */ - if (gconf->native->mode.swapMethod != GLX_SWAP_COPY_OML) { - gctx->force_validate = EGL_TRUE; - egl_g3d_validate_context(dpy, &gctx->base); - } - } - - return EGL_TRUE; + return gsurf->native->swap_buffers(gsurf->native); } /** diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 78675a1998..8ba73f289d 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -81,7 +81,8 @@ struct ximage_surface { GC gc; - unsigned int sequence_number; + unsigned int server_stamp; + unsigned int client_stamp; int width, height; struct ximage_buffer buffers[NUM_NATIVE_ATTACHMENTS]; uint valid_mask; @@ -216,18 +217,11 @@ ximage_surface_update_geometry(struct native_surface *nsurf) ok = XGetGeometry(xsurf->xdpy->dpy, xsurf->drawable, &root, &x, &y, &w, &h, &border, &depth); - if (!ok) { - w = xsurf->width; - h = xsurf->height; - } - - /* all buffers become invalid */ - if (xsurf->width != w || xsurf->height != h) { + if (ok && (xsurf->width != w || xsurf->height != h)) { xsurf->width = w; xsurf->height = h; - xsurf->valid_mask = 0x0; - xsurf->sequence_number++; + xsurf->server_stamp++; updated = TRUE; } @@ -247,10 +241,18 @@ ximage_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask) int att; updated = ximage_surface_update_geometry(&xsurf->base); - buffer_mask &= ~xsurf->valid_mask; - /* all requested buffers are valid */ - if (!buffer_mask) - return TRUE; + if (updated) { + /* all buffers become invalid */ + xsurf->valid_mask = 0x0; + } + else { + buffer_mask &= ~xsurf->valid_mask; + /* all requested buffers are valid */ + if (!buffer_mask) { + xsurf->client_stamp = xsurf->server_stamp; + return TRUE; + } + } new_valid = 0x0; for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { @@ -273,11 +275,8 @@ ximage_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask) } } - if (new_valid) { - xsurf->valid_mask |= new_valid; - if (updated) - xsurf->sequence_number++; - } + xsurf->valid_mask |= new_valid; + xsurf->client_stamp = xsurf->server_stamp; return (new_valid == buffer_mask); } @@ -333,7 +332,15 @@ ximage_surface_draw_buffer(struct native_surface *nsurf, static boolean ximage_surface_flush_frontbuffer(struct native_surface *nsurf) { - return ximage_surface_draw_buffer(nsurf, NATIVE_ATTACHMENT_FRONT_LEFT); + struct ximage_surface *xsurf = ximage_surface(nsurf); + boolean ret; + + ret = ximage_surface_draw_buffer(&xsurf->base, + NATIVE_ATTACHMENT_FRONT_LEFT); + /* force buffers to be updated in next validation call */ + xsurf->server_stamp++; + + return ret; } static boolean @@ -345,6 +352,8 @@ ximage_surface_swap_buffers(struct native_surface *nsurf) /* display the back buffer first */ ret = ximage_surface_draw_buffer(nsurf, NATIVE_ATTACHMENT_BACK_LEFT); + /* force buffers to be updated in next validation call */ + xsurf->server_stamp++; xfront = &xsurf->buffers[NATIVE_ATTACHMENT_FRONT_LEFT]; xback = &xsurf->buffers[NATIVE_ATTACHMENT_BACK_LEFT]; @@ -356,7 +365,6 @@ ximage_surface_swap_buffers(struct native_surface *nsurf) xtmp = *xfront; *xfront = *xback; *xback = xtmp; - xsurf->sequence_number++; return ret; } @@ -368,11 +376,14 @@ ximage_surface_validate(struct native_surface *nsurf, uint attachment_mask, { struct ximage_surface *xsurf = ximage_surface(nsurf); - if (!ximage_surface_update_buffers(&xsurf->base, attachment_mask)) - return FALSE; + if (xsurf->client_stamp != xsurf->server_stamp || + (xsurf->valid_mask & attachment_mask) != attachment_mask) { + if (!ximage_surface_update_buffers(&xsurf->base, attachment_mask)) + return FALSE; + } if (seq_num) - *seq_num = xsurf->sequence_number; + *seq_num = xsurf->client_stamp; if (textures) { int att; @@ -453,6 +464,9 @@ ximage_display_create_surface(struct native_display *ndpy, return NULL; } + /* initialize the geometry */ + ximage_surface_update_buffers(&xsurf->base, 0x0); + for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) { struct ximage_buffer *xbuf = &xsurf->buffers[i]; -- cgit v1.2.3 From 6e28a4e0bcd98327838855175a5b214c31a4cde0 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 25 Feb 2010 21:18:20 +0800 Subject: st/egl: Reduce validation round-trips in DRI2 backend. This is similar to the changes to reduce the round-trips in ximage backend. When the server supports DRI_InvalidateBuffers, the event is used to update the server stamp (this path is not tested). Otherwise, the server stamp is updated when flush_frontbuffer or swap_buffers is called. This makes sure at least the client APIs get the new buffers when a new frame is started while skipping all round-trips during the drawing. --- src/gallium/state_trackers/egl/x11/native_dri2.c | 102 +++++++++++++++++++---- 1 file changed, 88 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index f4072bb0cd..8df58891a0 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -26,6 +26,7 @@ #include "util/u_math.h" #include "util/u_format.h" #include "util/u_inlines.h" +#include "util/u_hash_table.h" #include "pipe/p_compiler.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" @@ -55,6 +56,8 @@ struct dri2_display { struct dri2_config *configs; int num_configs; + + struct util_hash_table *surfaces; }; struct dri2_surface { @@ -64,7 +67,8 @@ struct dri2_surface { enum pipe_format color_format; struct dri2_display *dri2dpy; - unsigned int sequence_number; + unsigned int server_stamp; + unsigned int client_stamp; int width, height; struct pipe_texture *textures[NUM_NATIVE_ATTACHMENTS]; uint valid_mask; @@ -225,12 +229,14 @@ dri2_surface_get_buffers(struct native_surface *nsurf, uint buffer_mask) if (xbufs && dri2surf->last_num_xbufs == num_outs && memcmp(dri2surf->last_xbufs, xbufs, sizeof(*xbufs) * num_outs) == 0) { free(xbufs); + dri2surf->client_stamp = dri2surf->server_stamp; return; } dri2_surface_process_drawable_buffers(&dri2surf->base, xbufs, num_outs); - dri2surf->sequence_number++; + dri2surf->server_stamp++; + dri2surf->client_stamp = dri2surf->server_stamp; if (dri2surf->last_xbufs) free(dri2surf->last_xbufs); @@ -282,7 +288,7 @@ dri2_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask) } } dri2surf->valid_mask |= new_valid; - /* no need to update sequence number */ + /* no need to update the stamps */ } else { dri2_surface_get_buffers(&dri2surf->base, buffer_mask); @@ -291,6 +297,16 @@ dri2_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask) return ((dri2surf->valid_mask & buffer_mask) == buffer_mask); } +/** + * Return TRUE if the surface receives DRI2_InvalidateBuffers events. + */ +static INLINE boolean +dri2_surface_receive_events(struct native_surface *nsurf) +{ + struct dri2_surface *dri2surf = dri2_surface(nsurf); + return (dri2surf->dri2dpy->dri_minor >= 3); +} + static boolean dri2_surface_flush_frontbuffer(struct native_surface *nsurf) { @@ -307,6 +323,10 @@ dri2_surface_flush_frontbuffer(struct native_surface *nsurf) 0, 0, dri2surf->width, dri2surf->height, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); + /* force buffers to be updated in next validation call */ + if (!dri2_surface_receive_events(&dri2surf->base)) + dri2surf->server_stamp++; + return TRUE; } @@ -332,6 +352,10 @@ dri2_surface_swap_buffers(struct native_surface *nsurf) 0, 0, dri2surf->width, dri2surf->height, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); + /* force buffers to be updated in next validation call */ + if (!dri2_surface_receive_events(&dri2surf->base)) + dri2surf->server_stamp++; + return TRUE; } @@ -342,11 +366,14 @@ dri2_surface_validate(struct native_surface *nsurf, uint attachment_mask, { struct dri2_surface *dri2surf = dri2_surface(nsurf); - if (!dri2_surface_update_buffers(&dri2surf->base, attachment_mask)) - return FALSE; + if (dri2surf->server_stamp != dri2surf->client_stamp || + (dri2surf->valid_mask & attachment_mask) != attachment_mask) { + if (!dri2_surface_update_buffers(&dri2surf->base, attachment_mask)) + return FALSE; + } if (seq_num) - *seq_num = dri2surf->sequence_number; + *seq_num = dri2surf->client_stamp; if (textures) { int att; @@ -395,9 +422,13 @@ dri2_surface_destroy(struct native_surface *nsurf) pipe_texture_reference(&ptex, NULL); } - if (dri2surf->drawable) + if (dri2surf->drawable) { x11_drawable_enable_dri2(dri2surf->dri2dpy->xscr, dri2surf->drawable, FALSE); + + util_hash_table_remove(dri2surf->dri2dpy->surfaces, + (void *) dri2surf->drawable); + } free(dri2surf); } @@ -426,8 +457,14 @@ dri2_display_create_surface(struct native_display *ndpy, dri2surf->base.validate = dri2_surface_validate; dri2surf->base.wait = dri2_surface_wait; - if (drawable) + if (drawable) { x11_drawable_enable_dri2(dri2dpy->xscr, drawable, TRUE); + /* initialize the geometry */ + dri2_surface_update_buffers(&dri2surf->base, 0x0); + + util_hash_table_set(dri2surf->dri2dpy->surfaces, + (void *) dri2surf->drawable, (void *) &dri2surf->base); + } return dri2surf; } @@ -673,6 +710,9 @@ dri2_display_destroy(struct native_display *ndpy) if (dri2dpy->base.screen) dri2dpy->base.screen->destroy(dri2dpy->base.screen); + if (dri2dpy->surfaces) + util_hash_table_destroy(dri2dpy->surfaces); + if (dri2dpy->xscr) x11_screen_destroy(dri2dpy->xscr); if (dri2dpy->own_dpy) @@ -682,6 +722,24 @@ dri2_display_destroy(struct native_display *ndpy) free(dri2dpy); } +static void +dri2_display_invalidate_buffers(struct x11_screen *xscr, Drawable drawable, + void *user_data) +{ + struct native_display *ndpy = (struct native_display* ) user_data; + struct dri2_display *dri2dpy = dri2_display(ndpy); + struct native_surface *nsurf; + struct dri2_surface *dri2surf; + + nsurf = (struct native_surface *) + util_hash_table_get(dri2dpy->surfaces, (void *) drawable); + if (!nsurf) + return; + + dri2surf = dri2_surface(nsurf); + dri2surf->server_stamp++; +} + /** * Initialize DRI2 and pipe screen. */ @@ -708,7 +766,8 @@ dri2_display_init_screen(struct native_display *ndpy) return FALSE; } - fd = x11_screen_enable_dri2(dri2dpy->xscr, NULL, NULL); + fd = x11_screen_enable_dri2(dri2dpy->xscr, + dri2_display_invalidate_buffers, &dri2dpy->base); if (fd < 0) return FALSE; @@ -723,6 +782,19 @@ dri2_display_init_screen(struct native_display *ndpy) return TRUE; } +static unsigned +dri2_display_hash_table_hash(void *key) +{ + XID drawable = pointer_to_uintptr(key); + return (unsigned) drawable; +} + +static int +dri2_display_hash_table_compare(void *key1, void *key2) +{ + return (key1 - key2); +} + struct native_display * x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api) { @@ -733,11 +805,6 @@ x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api) return NULL; dri2dpy->api = api; - if (!dri2dpy->api) { - _eglLog(_EGL_WARNING, "failed to create DRM API"); - free(dri2dpy); - return NULL; - } dri2dpy->dpy = dpy; if (!dri2dpy->dpy) { @@ -761,6 +828,13 @@ x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api) return NULL; } + dri2dpy->surfaces = util_hash_table_create(dri2_display_hash_table_hash, + dri2_display_hash_table_compare); + if (!dri2dpy->surfaces) { + dri2_display_destroy(&dri2dpy->base); + return NULL; + } + dri2dpy->base.destroy = dri2_display_destroy; dri2dpy->base.get_configs = dri2_display_get_configs; dri2dpy->base.is_pixmap_supported = dri2_display_is_pixmap_supported; -- cgit v1.2.3 From 2be1fcaafef8af672434553c4bdca73a9db6934d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 24 Feb 2010 11:17:16 +0800 Subject: mesa: Remove unused Makefile.{ugl,win}. --- src/mesa/main/Makefile.ugl | 364 --------------------------------------------- src/mesa/main/Makefile.win | 208 -------------------------- 2 files changed, 572 deletions(-) delete mode 100644 src/mesa/main/Makefile.ugl delete mode 100644 src/mesa/main/Makefile.win (limited to 'src') diff --git a/src/mesa/main/Makefile.ugl b/src/mesa/main/Makefile.ugl deleted file mode 100644 index b440e13643..0000000000 --- a/src/mesa/main/Makefile.ugl +++ /dev/null @@ -1,364 +0,0 @@ -# Mesa 3-D graphics library -# Version: 4.1 -# -# Copyright (C) 2001 Wind River Systems, Inc - -# The MIT License -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -# Makefile for core library - -# This makefile can moved all objects files in MESA_OBJ for use with -# ld in windShell or create a library from objects files in their -# associated .c folder. -# -# For an easy inclusion of lib$(CPU)$(TOOL)GL.a in vxworks image, this -# makefile collects together all .o in an only file -# (obj$(CPU)$(TOOL)GL.o). This operation is unnecessary for -# lib$(CPU)$(TOOL)OSMesa.a and lib$(CPU)$(TOOL)UglMesa.a because they -# already contain only one file. -# -##### MACROS ##### -MESA_MAJOR=4 -MESA_MINOR=1 -MESA_TINY=0 -VERSION=$(MESA_MAJOR).$(MESA_MINOR) - -GL_MAJOR = 1 -GL_MINOR = 2 -GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) - -##### RULES ##### - -include ..\rules.windml - -#### GL ##### - -GL_SOURCES = \ - api_arrayelt.c \ - api_loopback.c \ - api_noop.c \ - api_validate.c \ - accum.c \ - arbprogram.c \ - attrib.c \ - blend.c \ - bufferobj.c \ - buffers.c \ - clip.c \ - colortab.c \ - context.c \ - convolve.c \ - debug.c \ - depth.c \ - dispatch.c \ - dlist.c \ - drawpix.c \ - enable.c \ - enums.c \ - eval.c \ - extensions.c \ - feedback.c \ - fog.c \ - get.c \ - glapi.c \ - glthread.c \ - hash.c \ - hint.c \ - histogram.c \ - image.c \ - imports.c \ - light.c \ - lines.c \ - matrix.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ - texcompress.c \ - texformat.c \ - teximage.c \ - texobj.c \ - texstate.c \ - texstore.c \ - texutil.c \ - varray.c \ - vtxfmt.c \ - X86/x86.c \ - X86/common_x86.c \ - X86/3dnow.c \ - X86/sse.c \ - math/m_debug_clip.c \ - math/m_debug_norm.c \ - math/m_debug_vertex.c \ - math/m_debug_xform.c \ - math/m_eval.c \ - math/m_matrix.c \ - math/m_translate.c \ - math/m_vector.c \ - math/m_vertices.c \ - math/m_xform.c \ - array_cache/ac_context.c \ - array_cache/ac_import.c \ - swrast/s_aaline.c \ - swrast/s_aatriangle.c \ - swrast/s_accum.c \ - swrast/s_alpha.c \ - swrast/s_alphabuf.c \ - swrast/s_bitmap.c \ - swrast/s_blend.c \ - swrast/s_buffers.c \ - swrast/s_copypix.c \ - swrast/s_context.c \ - swrast/s_depth.c \ - swrast/s_drawpix.c \ - swrast/s_feedback.c \ - swrast/s_fog.c \ - swrast/s_imaging.c \ - swrast/s_lines.c \ - swrast/s_logic.c \ - swrast/s_masking.c \ - swrast/s_pixeltex.c \ - swrast/s_points.c \ - swrast/s_readpix.c \ - swrast/s_span.c \ - swrast/s_stencil.c \ - swrast/s_texture.c \ - swrast/s_texstore.c \ - swrast/s_triangle.c \ - swrast/s_zoom.c \ - swrast_setup/ss_context.c \ - swrast_setup/ss_triangle.c \ - swrast_setup/ss_vb.c \ - tnl/t_array_api.c \ - tnl/t_array_import.c \ - tnl/t_context.c \ - tnl/t_eval_api.c \ - tnl/t_imm_alloc.c \ - tnl/t_imm_api.c \ - tnl/t_imm_debug.c \ - tnl/t_imm_dlist.c \ - tnl/t_imm_elt.c \ - tnl/t_imm_eval.c \ - tnl/t_imm_exec.c \ - tnl/t_imm_fixup.c \ - tnl/t_pipeline.c \ - tnl/t_vb_fog.c \ - tnl/t_vb_light.c \ - tnl/t_vb_normals.c \ - tnl/t_vb_points.c \ - tnl/t_vb_render.c \ - tnl/t_vb_texgen.c \ - tnl/t_vb_texmat.c \ - tnl/t_vb_vertex.c - -GL_OBJECTS = $(GL_SOURCES:.c=.o) -GL_OBJNAME = $(MESA_LIBDIR)/objMesaGL.o - -#### X86 ##### - -x86_files = \ - X86/common_x86_asm.S \ - X86/glapi_x86.S \ - X86/x86_cliptest.S \ - X86/x86_vertex.S \ - X86/x86_xform2.S \ - X86/x86_xform3.S \ - X86/x86_xform4.S \ - -x3dnow_files = \ - X86/3dnow_normal.S \ - X86/3dnow_vertex.S \ - X86/3dnow_xform1.S \ - X86/3dnow_xform2.S \ - X86/3dnow_xform3.S \ - X86/3dnow_xform4.S - -sse_files = \ - X86/sse_normal.S \ - X86/sse_vertex.S \ - X86/sse_xform1.S \ - X86/sse_xform2.S \ - X86/sse_xform3.S \ - X86/sse_xform4.S - -mmx_files = X86/mmx_blend.S - -X86_OBJNAME = $(MESA_LIBDIR)/objMesaX86.o - -##### UGL ##### - -UGL_SOURCES = \ - windml/ugl_api.c \ - windml/ugl_dd.c \ - windml/ugl_span.c \ - windml/ugl_line.c \ - windml/ugl_tri.c \ - windml/tornado/torMesaUGLInit.c - -UGL_OBJECTS = $(UGL_SOURCES:.c=.o) -UGL_OBJNAME = $(MESA_LIBDIR)/objMesaUGL.o - -##### OS ##### - -OS_SOURCES = OSmesa/osmesa.c windml/tornado/torMesaOSInit.c -OS_OBJECTS = $(OS_SOURCES:.c=.o) -OS_OBJNAME = $(MESA_LIBDIR)/objMesaOS.o - -##### GLUTSHAPES ##### - -GLUTSHAPES_SOURCES = \ - windml/ugl_glutshapes.c \ - windml/tornado/torGLUTShapesInit.c - -GLUTSHAPES_OBJECTS = $(GLUTSHAPES_SOURCES:.c=.o) -GLUTSHAPES_OBJNAME = $(MESA_LIBDIR)/objGLUTShapes.o - -SOURCES = $(GL_SOURCES) $(UGL_SOURCES) $(OS_SOURCES) \ - $(GLUTSHAPES_SOURCES) - -##### TARGETS ##### - -all: depend.$(CPU)$(TOOL) cfgX86 $(X86_OBJNAME) $(GL_OBJNAME)\ -$(UGL_OBJNAME) $(OS_OBJNAME) $(GLUTSHAPES_OBJNAME) - -#histogram.o: -# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< - -#image.o: -# $(CC) $(CFLAGS) -O1 $(OPTION_OBJECT_ONLY) $(OPTION_OBJECT_NAME)$@ $< - -cfgX86: -ifdef HAVE_3DNOW -x3dnow_sources = $(x3dnow_files) -CFLAGS_3DNOW = -DUSE_3DNOW_ASM -HAVE_X86 = 1 -endif -ifdef HAVE_SSE -sse_sources = $(sse_files) -CFLAGS_SSE = -DUSE_SSE_ASM -HAVE_X86 = 1 -endif -ifdef HAVE_MMX -mmx_sources = $(mmx_files) -CFLAGS_MMX = -DUSE_MMX_ASM -HAVE_X86 = 1 -endif -ifdef HAVE_X86 -x86_sources = $(x86_files) -CFLAGS_X86 = -DUSE_X86_ASM -endif -X86_SOURCES = $(x86_sources) $(mmx_sources) \ - $(x3dnow_sources) $(sse_sources) -X86_OBJECTS = $(X86_SOURCES:.S=.o) -CFLAGS_USE_X86 = $(CFLAGS_3DNOW) $(CFLAGS_SSE) $(CFLAGS_MMX) $(CFLAGS_X86) - -#X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c -# $(CC) -I ./ X86/gen_matypes.c -o X86/gen_matypes -# ./X86/gen_matypes > X86/matypes.h -# $(RM) X86/gen_matypes -# $(RM) X86/gen_matypes.o - -# Make the Mesax86 library -$(X86_OBJNAME): $(X86_OBJECTS) -ifdef HAVE_X86 -# $(LD) -r $(X86_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(X86_OBJECTS) -o $(X86_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(X86_OBJNAME) -# $(RM) $(X86_OBJNAME) -endif - -# Make the GL library -$(GL_OBJNAME): $(GL_OBJECTS) -# $(LD) -r $(GL_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(GL_OBJECTS) -o $(GL_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(GL_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(GL_OBJNAME) -# $(RM) $(GL_OBJNAME) - -# Make the UGLMesa library -$(UGL_OBJNAME): $(UGL_OBJECTS) -# $(LD) -r $(UGL_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(UGL_OBJECTS) -o $(UGL_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(UGL_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(UGL_OBJNAME) -# $(RM) $(UGL_OBJNAME) - -# Make the OSMesa library -$(OS_OBJNAME): $(OS_OBJECTS) -# $(LD) -r $(OS_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(OS_OBJECTS) -o $(OS_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(OS_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(OS_OBJNAME) -# $(RM) $(OS_OBJNAME) - -# Make the GLUT Shapes library -$(GLUTSHAPES_OBJNAME): $(GLUTSHAPES_OBJECTS) -# $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(GLUTSHAPES_OBJECTS) -o $(GLUTSHAPES_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) -# $(RM) $(GLUTSHAPES_OBJNAME) - -depend.$(CPU)$(TOOL): -ifeq ($(WIND_HOST_TYPE),x86-win32) - @ $(RM) $@ - @ $(ECHO) Creating depend.$(CPU)$(TOOL) -ifneq ($(SOURCES),) - @ for %f in ($(SOURCES)) do \ - $(CC) -MM $(CFLAGS) %f >>$@ -endif -else -Makefile - @ $(RM) $@ - @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" -ifneq ($(SOURCES),) - @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ - do \ - $(CC) -MM $(CFLAGS) $$FILE \ - | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ - done -endif -endif - -.PHONY = clean - -clean: -# $(AR) d $(MESA_LIBNAME) $(GL_OBJNAME) -# $(AR) d $(MESA_LIBNAME) $(UGL_OBJNAME) -# $(AR) d $(MESA_LIBNAME) $(OS_OBJNAME) -# $(AR) d $(MESA_LIBNAME) $(GLUTSHAPES_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(GL_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(UGL_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(OS_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(GLUTSHAPES_OBJNAME) - $(RM) $(GL_OBJECTS) - $(RM) $(UGL_OBJECTS) - $(RM) $(OS_OBJECTS) - $(RM) $(GLUTSHAPES_OBJECTS) - $(RM) $(GL_OBJNAME) - $(RM) $(UGL_OBJNAME) - $(RM) $(OS_OBJNAME) - $(RM) $(GLUTSHAPES_OBJNAME) - $(RM) depend.$(CPU)$(TOOL) - -include depend.$(CPU)$(TOOL) - diff --git a/src/mesa/main/Makefile.win b/src/mesa/main/Makefile.win deleted file mode 100644 index a27f44c112..0000000000 --- a/src/mesa/main/Makefile.win +++ /dev/null @@ -1,208 +0,0 @@ -# Makefile for Win32 -# -# NOTE: the install target may overwrite important files in the system dirs -# Check first, before making the install target. -# -# This builds both the osmesa and Windows drivers. -# - -!include - -TOP = .. -SUBDIRS = osmesa.dir - -CORE_SRCS = \ - api_loopback.c \ - api_noop.c \ - api_validate.c \ - accum.c \ - arbprogram.c \ - attrib.c \ - blend.c \ - bufferobj.c \ - buffers.c \ - clip.c \ - colortab.c \ - context.c \ - convolve.c \ - debug.c \ - depth.c \ - dispatch.c \ - dlist.c \ - drawpix.c \ - enable.c \ - enums.c \ - eval.c \ - extensions.c \ - feedback.c \ - fog.c \ - get.c \ - glapi.c \ - glthread.c \ - hash.c \ - hint.c \ - histogram.c \ - image.c \ - imports.c \ - light.c \ - lines.c \ - matrix.c \ - nvprogram.c \ - nvfragparse.c \ - nvvertexec.c \ - nvvertparse.c \ - pixel.c \ - points.c \ - polygon.c \ - rastpos.c \ - state.c \ - stencil.c \ - texcompress.c \ - texcompress_fxt1.c \ - texcompress_s3tc.c \ - teximage.c \ - texformat.c \ - texobj.c \ - texstate.c \ - texstore.c \ - varray.c \ - vtxfmt.c \ -# X86\x86.c \ -# X86\common_x86.c \ -# X86\3dnow.c \ -# X86\sse.c \ - math\m_debug_norm.c \ - math\m_debug_xform.c \ - math\m_eval.c \ - math\m_matrix.c \ - math\m_translate.c \ - math\m_vector.c \ - math\m_xform.c \ - array_cache\ac_context.c \ - array_cache\ac_import.c \ - swrast\s_aaline.c \ - swrast\s_aatriangle.c \ - swrast\s_accum.c \ - swrast\s_alpha.c \ - swrast\s_alphabuf.c \ - swrast\s_bitmap.c \ - swrast\s_blend.c \ - swrast\s_buffers.c \ - swrast\s_copypix.c \ - swrast\s_context.c \ - swrast\s_depth.c \ - swrast\s_drawpix.c \ - swrast\s_feedback.c \ - swrast\s_fog.c \ - swrast\s_imaging.c \ - swrast\s_lines.c \ - swrast\s_logic.c \ - swrast\s_masking.c \ - swrast\s_nvfragprog.c \ - swrast\s_pixeltex.c \ - swrast\s_points.c \ - swrast\s_readpix.c \ - swrast\s_span.c \ - swrast\s_stencil.c \ - swrast\s_texstore.c \ - swrast\s_texture.c \ - swrast\s_triangle.c \ - swrast\s_zoom.c \ - swrast_setup\ss_context.c \ - swrast_setup\ss_triangle.c \ - swrast_setup\ss_vb.c \ - tnl\t_array_api.c \ - tnl\t_array_import.c \ - tnl\t_context.c \ - tnl\t_eval_api.c \ - tnl\t_imm_alloc.c \ - tnl\t_imm_api.c \ - tnl\t_imm_debug.c \ - tnl\t_imm_dlist.c \ - tnl\t_imm_elt.c \ - tnl\t_imm_eval.c \ - tnl\t_imm_exec.c \ - tnl\t_imm_fixup.c \ - tnl\t_pipeline.c \ - tnl\t_vb_fog.c \ - tnl\t_vb_light.c \ - tnl\t_vb_normals.c \ - tnl\t_vb_points.c \ - tnl\t_vb_program.c \ - tnl\t_vb_render.c \ - tnl\t_vb_texgen.c \ - tnl\t_vb_texmat.c \ - tnl\t_vb_vertex.c - -DRIVER_SRCS = \ - Trace\tr_context.c \ - Trace\tr_control.c \ - Trace\tr_error.c \ - Trace\tr_support.c \ - Trace\tr_wrapper.c \ - Trace\tr_write.c \ - Windows\wgl.c \ - Windows\wmesa.c - -ASM_SRCS = - -SRCS = $(CORE_SRCS) $(DRIVER_SRCS) - -all : mesadll $(SUBDIRS) - -!include "$(TOP)/mesawin32.mak" - -mesadll : $(MESADLL) - -CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -DBUILD_GL32 -DNO_PARALLEL -DNO_STEREO -!IFNDEF NODEBUG -CFLAGS = $(CFLAGS) -DMESA_DEBUG -!ENDIF -LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS) - -OBJS = $(ASM_SRCS:.S=.obj) $(CORE_SRCS:.c=.obj) $(DRIVER_SRCS:.c=.obj) -LIBS = winmm.lib $(guilibsdll) - -$(MESADLL) : $(OBJS) mesa.def - $(link) $(LFLAGS) -out:$(MESADLL) -def:mesa.def $(OBJS) $(LIBS) - @echo "copying Mesa dynamic link library to lib directory..." - -copy $(MESADLL) ..\lib - @echo "copying Mesa import library to lib directory..." - -copy $(MESALIB) ..\lib - -$(SUBDIRS) : - @echo. - @echo Making in $* directory - @cd $* - @nmake -f Makefile.win -nologo - @cd .. - -install : $(MESADLL) - @echo. - @echo "copying Mesa dynamic link library to system directory..." - -copy $(MESADLL) $(DLLINSTALL) - @echo "copying Mesa header files to include directory..." - -copy ..\..\include\GL\gl.h $(INCLUDEINSTALL) - -copy ..\..\include\GL\glext.h $(INCLUDEINSTALL) - @echo "copying Mesa import library to library directory..." - -copy $(MESALIB) $(LIBINSTALL) - -clean :: - @del /f tnl\*.obj - @del /f swrast_setup\*.obj - @del /f math\*.obj - @del /f array_cache\*.obj - @del /f swrast\*.obj - @del /f Trace\*.obj - @del /f osmesa\*.obj - @del /f Windows\*.obj - -clobber :: - @del /f OSmesa\*.lib - @del /f OSmesa\*.exp - @del /f OSmesa\*.dll - -# override default inference rule with one that writes the object to -# the same subdir that the c file is in. -.c.obj : - $(cc) $(CFLAGS) -I. $< /Fo$*.obj -- cgit v1.2.3 From 4cb13b433cfdaa1295e5df048d7ef614545f6e16 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 24 Feb 2010 12:04:58 +0800 Subject: glapi: Generated GLX sources should use glapidispatch.h. Fix glX_proto_recv.py and glX_proto_send.py, and regenerate the sources. --- src/glx/indirect.c | 2 +- src/mesa/glapi/gen/glX_proto_recv.py | 2 +- src/mesa/glapi/gen/glX_proto_send.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/glx/indirect.c b/src/glx/indirect.c index 262637a947..4a571a230b 100644 --- a/src/glx/indirect.c +++ b/src/glx/indirect.c @@ -30,7 +30,7 @@ #include "indirect.h" #include "glxclient.h" #include "indirect_size.h" -#include "dispatch.h" +#include "glapidispatch.h" #include "glapi.h" #include "glthread.h" #include diff --git a/src/mesa/glapi/gen/glX_proto_recv.py b/src/mesa/glapi/gen/glX_proto_recv.py index f423c6db08..31745fcef7 100644 --- a/src/mesa/glapi/gen/glX_proto_recv.py +++ b/src/mesa/glapi/gen/glX_proto_recv.py @@ -92,7 +92,7 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): print '#include "glapi.h"' print '#include "glapitable.h"' print '#include "glthread.h"' - print '#include "dispatch.h"' + print '#include "glapidispatch.h"' print '' print '#define __GLX_PAD(x) (((x) + 3) & ~3)' print '' diff --git a/src/mesa/glapi/gen/glX_proto_send.py b/src/mesa/glapi/gen/glX_proto_send.py index daca1b767a..4d484c833a 100644 --- a/src/mesa/glapi/gen/glX_proto_send.py +++ b/src/mesa/glapi/gen/glX_proto_send.py @@ -166,7 +166,7 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): print '#include "indirect.h"' print '#include "glxclient.h"' print '#include "indirect_size.h"' - print '#include "dispatch.h"' + print '#include "glapidispatch.h"' print '#include "glapi.h"' print '#include "glthread.h"' print '#include ' -- cgit v1.2.3 From 27d260b41038e0c19c8f24b8bdb2c004c1eb7aa2 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 24 Feb 2010 11:20:14 +0800 Subject: glapi: Move src/mesa/main/dispatch.c to glapi and rename. main/dispatch.c is a glapi source file. It is part of GLAPI_SOURCES in sources.mak and part of glapi_sources in SConscript. This commit moves it to glapi/ and renames it to glapi_dispatch.c. --- docs/devinfo.html | 2 +- docs/dispatch.html | 4 +- src/mesa/Makefile.mgw | 2 +- src/mesa/SConscript | 2 +- src/mesa/glapi/glapi_dispatch.c | 96 +++++++++++++++++++++++++++++++++++++++ src/mesa/main/descrip.mms | 3 -- src/mesa/main/dispatch.c | 96 --------------------------------------- src/mesa/sources.mak | 2 +- windows/VC7/mesa/mesa/mesa.vcproj | 6 +-- windows/VC8/mesa/mesa/mesa.vcproj | 8 ++-- 10 files changed, 109 insertions(+), 112 deletions(-) create mode 100644 src/mesa/glapi/glapi_dispatch.c delete mode 100644 src/mesa/main/dispatch.c (limited to 'src') diff --git a/docs/devinfo.html b/docs/devinfo.html index 0fb816749e..df0e726524 100644 --- a/docs/devinfo.html +++ b/docs/devinfo.html @@ -107,7 +107,7 @@ Global variables are not allowed. Function name examples:

-	glFooBar()       - a public GL entry point (in dispatch.c)
+	glFooBar()       - a public GL entry point (in glapi_dispatch.c)
 	_mesa_FooBar()   - the internal immediate mode function
 	save_FooBar()    - retained mode (display list) function in dlist.c
 	foo_bar()        - a static (private) function
diff --git a/docs/dispatch.html b/docs/dispatch.html
index bcab74c707..0c54a84675 100644
--- a/docs/dispatch.html
+++ b/docs/dispatch.html
@@ -244,8 +244,8 @@ isn't a significant problem.

system. There are two steps to this. The file must first be added to src/mesa/sources. That gets the file built and linked. The second step is to add the correct #ifdef magic to -src/mesa/main/dispatch.c to prevent the C version of the dispatch -functions from being built.

+src/mesa/glapi/glapi_dispatch.c to prevent the C version of the +dispatch functions from being built.

3.4. Fixed-Length Dispatch Stubs

diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw index e894c6277d..b90384d04a 100644 --- a/src/mesa/Makefile.mgw +++ b/src/mesa/Makefile.mgw @@ -200,7 +200,7 @@ ifeq (1,1) x86/glapi_x86.o: x86/glapi_x86.S $(CC) -o $@ $(CFLAGS) -DSTDCALL_API -c $< else -main/dispatch.o: main/dispatch.c +glapi/glapi_dispatch.o: glapi/glapi_dispatch.c $(CC) -o $@ $(CFLAGS) -UUSE_X86_ASM -c $< glapi/glapi.o: glapi/glapi.c $(CC) -o $@ $(CFLAGS) -UUSE_X86_ASM -c $< diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 0726fcb1a7..0a25dccde5 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -247,8 +247,8 @@ if env['platform'] != 'winddk': ) glapi_sources = [ - 'main/dispatch.c', 'glapi/glapi.c', + 'glapi/glapi_dispatch.c', 'glapi/glapi_getproc.c', 'glapi/glapi_nop.c', 'glapi/glthread.c', diff --git a/src/mesa/glapi/glapi_dispatch.c b/src/mesa/glapi/glapi_dispatch.c new file mode 100644 index 0000000000..4cb43f4505 --- /dev/null +++ b/src/mesa/glapi/glapi_dispatch.c @@ -0,0 +1,96 @@ +/* + * Mesa 3-D graphics library + * Version: 6.3 + * + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/** + * \file glapi_dispatch.c + * + * This file generates all the gl* function entrypoints. This code is not + * used if optimized assembly stubs are available (e.g., using x86/glapi_x86.S + * on IA32 or sparc/glapi_sparc.S on SPARC). + * + * \note + * This file is also used to build the client-side libGL that loads DRI-based + * device drivers. At build-time it is symlinked to src/glx. + * + * \author Brian Paul + */ + +#include "main/glheader.h" +#include "main/compiler.h" +#include "glapi/glapi.h" +#include "glapi/glapitable.h" +#include "glapi/glapidispatch.h" +#include "glapi/glthread.h" + + +#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM)) + +#if defined(WIN32) +#define KEYWORD1 GLAPI +#else +#define KEYWORD1 PUBLIC +#endif + +#define KEYWORD2 GLAPIENTRY + +#if defined(USE_MGL_NAMESPACE) +#define NAME(func) mgl##func +#else +#define NAME(func) gl##func +#endif + +#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */ + +#define F stdout +#define DISPATCH(FUNC, ARGS, MESSAGE) \ + fprintf MESSAGE; \ + CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ + fprintf MESSAGE; \ + return CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +#else + +#define DISPATCH(FUNC, ARGS, MESSAGE) \ + CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ + return CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +#endif /* logging */ + + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLX_INDIRECT_RENDERING +/* those link to libglapi.a should provide the entry points */ +#define _GLAPI_SKIP_PROTO_ENTRY_POINTS +#endif +#include "glapi/glapitemp.h" + +#endif /* USE_X86_ASM */ diff --git a/src/mesa/main/descrip.mms b/src/mesa/main/descrip.mms index e49ec65d42..70bc263726 100644 --- a/src/mesa/main/descrip.mms +++ b/src/mesa/main/descrip.mms @@ -38,7 +38,6 @@ SOURCES =accum.c \ debug.c \ depth.c \ depthstencil.c \ - dispatch.c \ dlist.c \ drawpix.c \ enable.c \ @@ -113,7 +112,6 @@ convolve.obj,\ debug.obj,\ depth.obj,\ depthstencil.obj,\ -dispatch.obj,\ dlist.obj,\ drawpix.obj,\ enable.obj,\ @@ -198,7 +196,6 @@ convolve.obj : convolve.c debug.obj : debug.c depth.obj : depth.c depthstencil.obj : depthstencil.c -dispatch.obj : dispatch.c dlist.obj : dlist.c drawpix.obj : drawpix.c enable.obj : enable.c diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c deleted file mode 100644 index b9b726b001..0000000000 --- a/src/mesa/main/dispatch.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -/** - * \file dispatch.c - * - * This file generates all the gl* function entrypoints. This code is not - * used if optimized assembly stubs are available (e.g., using x86/glapi_x86.S - * on IA32 or sparc/glapi_sparc.S on SPARC). - * - * \note - * This file is also used to build the client-side libGL that loads DRI-based - * device drivers. At build-time it is symlinked to src/glx. - * - * \author Brian Paul - */ - -#include "main/glheader.h" -#include "main/compiler.h" -#include "glapi/glapi.h" -#include "glapi/glapitable.h" -#include "glapi/glapidispatch.h" -#include "glapi/glthread.h" - - -#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM)) - -#if defined(WIN32) -#define KEYWORD1 GLAPI -#else -#define KEYWORD1 PUBLIC -#endif - -#define KEYWORD2 GLAPIENTRY - -#if defined(USE_MGL_NAMESPACE) -#define NAME(func) mgl##func -#else -#define NAME(func) gl##func -#endif - -#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */ - -#define F stdout -#define DISPATCH(FUNC, ARGS, MESSAGE) \ - fprintf MESSAGE; \ - CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ - fprintf MESSAGE; \ - return CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#else - -#define DISPATCH(FUNC, ARGS, MESSAGE) \ - CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ - return CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#endif /* logging */ - - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifdef GLX_INDIRECT_RENDERING -/* those link to libglapi.a should provide the entry points */ -#define _GLAPI_SKIP_PROTO_ENTRY_POINTS -#endif -#include "glapi/glapitemp.h" - -#endif /* USE_X86_ASM */ diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 354331955a..9f2e4e5157 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -86,8 +86,8 @@ MAIN_SOURCES = \ main/vtxfmt.c GLAPI_SOURCES = \ - main/dispatch.c \ glapi/glapi.c \ + glapi/glapi_dispatch.c \ glapi/glapi_getproc.c \ glapi/glapi_nop.c \ glapi/glthread.c diff --git a/windows/VC7/mesa/mesa/mesa.vcproj b/windows/VC7/mesa/mesa/mesa.vcproj index caee6c0ca6..623e001c74 100644 --- a/windows/VC7/mesa/mesa/mesa.vcproj +++ b/windows/VC7/mesa/mesa/mesa.vcproj @@ -181,9 +181,6 @@ - - @@ -226,6 +223,9 @@ + + diff --git a/windows/VC8/mesa/mesa/mesa.vcproj b/windows/VC8/mesa/mesa/mesa.vcproj index 15ad229328..8795746916 100644 --- a/windows/VC8/mesa/mesa/mesa.vcproj +++ b/windows/VC8/mesa/mesa/mesa.vcproj @@ -422,10 +422,6 @@ RelativePath="..\..\..\..\src\mesa\main\depthstencil.c" > - - @@ -494,6 +490,10 @@ RelativePath="..\..\..\..\src\mesa\glapi\glapi.c" > + + -- cgit v1.2.3 From 2cf44390d1e819f23e1d7ceb3199276c9148c647 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 24 Feb 2010 12:01:14 +0800 Subject: mesa: Move src/mesa/glapi/dispatch.h to mesa. glapi/dispatch.h is a core Mesa header file. Move the header file to main/ to make this clear. It also becomes clear after this change that IN_DRI_DRIVER is only used in core Mesa to enable the remap table. --- src/mesa/es/main/drawtex.c | 2 +- src/mesa/es/main/es_generator.py | 2 +- src/mesa/glapi/dispatch.h | 37 ---------------------------------- src/mesa/glapi/gen/extension_helper.py | 2 +- src/mesa/glapi/gen/remap_helper.py | 2 +- src/mesa/main/accum.c | 2 +- src/mesa/main/api_arrayelt.c | 2 +- src/mesa/main/api_exec.c | 2 +- src/mesa/main/api_loopback.c | 2 +- src/mesa/main/api_noop.c | 2 +- src/mesa/main/arrayobj.c | 2 +- src/mesa/main/attrib.c | 2 +- src/mesa/main/colortab.c | 2 +- src/mesa/main/convolve.c | 2 +- src/mesa/main/dispatch.h | 37 ++++++++++++++++++++++++++++++++++ src/mesa/main/dlist.c | 2 +- src/mesa/main/drawpix.c | 2 +- src/mesa/main/eval.c | 2 +- src/mesa/main/feedback.c | 2 +- src/mesa/main/histogram.c | 2 +- src/mesa/main/pixel.c | 2 +- src/mesa/main/queryobj.c | 2 +- src/mesa/main/rastpos.c | 2 +- src/mesa/main/remap.c | 4 ++-- src/mesa/main/remap_helper.h | 2 +- src/mesa/main/texgen.c | 2 +- src/mesa/main/varray.c | 2 +- src/mesa/main/vtxfmt_tmp.h | 2 +- src/mesa/shader/shader_api.c | 2 +- src/mesa/vbo/vbo_exec_api.c | 2 +- src/mesa/vbo/vbo_exec_eval.c | 2 +- src/mesa/vbo/vbo_save_api.c | 2 +- src/mesa/vbo/vbo_save_loopback.c | 2 +- 33 files changed, 69 insertions(+), 69 deletions(-) delete mode 100644 src/mesa/glapi/dispatch.h create mode 100644 src/mesa/main/dispatch.h (limited to 'src') diff --git a/src/mesa/es/main/drawtex.c b/src/mesa/es/main/drawtex.c index cbd41ca975..42f4409397 100644 --- a/src/mesa/es/main/drawtex.c +++ b/src/mesa/es/main/drawtex.c @@ -25,7 +25,7 @@ #include "main/state.h" #include "main/imports.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_OES_draw_texture diff --git a/src/mesa/es/main/es_generator.py b/src/mesa/es/main/es_generator.py index 590f5940a7..f736792dec 100644 --- a/src/mesa/es/main/es_generator.py +++ b/src/mesa/es/main/es_generator.py @@ -207,7 +207,7 @@ extern void _mesa_error(void *ctx, GLenum error, const char *fmtString, ... ); #include "main/compiler.h" #include "main/api_exec.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" typedef void (*_glapi_proc)(void); /* generic function pointer */ """ diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h deleted file mode 100644 index 27f80a5062..0000000000 --- a/src/mesa/glapi/dispatch.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2005 - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef _DISPATCH_H -#define _DISPATCH_H - -#ifdef IN_DRI_DRIVER -#define _GLAPI_USE_REMAP_TABLE -#endif - -#include "glapi/glapitable.h" -#include "glapi/glapioffsets.h" -#include "glapi/glapidispatch.h" - -#endif /* _DISPATCH_H */ diff --git a/src/mesa/glapi/gen/extension_helper.py b/src/mesa/glapi/gen/extension_helper.py index 83471d89f5..2c83b4e0d1 100644 --- a/src/mesa/glapi/gen/extension_helper.py +++ b/src/mesa/glapi/gen/extension_helper.py @@ -151,7 +151,7 @@ class PrintGlExtensionGlue(gl_XML.gl_print_base): def printRealHeader(self): print '#include "utils.h"' - print '#include "glapi/dispatch.h"' + print '#include "main/dispatch.h"' print '' return diff --git a/src/mesa/glapi/gen/remap_helper.py b/src/mesa/glapi/gen/remap_helper.py index d93c7a4285..8b50526d2b 100644 --- a/src/mesa/glapi/gen/remap_helper.py +++ b/src/mesa/glapi/gen/remap_helper.py @@ -64,7 +64,7 @@ class PrintGlRemap(gl_XML.gl_print_base): def printRealHeader(self): - print '#include "glapi/dispatch.h"' + print '#include "main/dispatch.h"' print '' return diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 032e13b96e..2012d00fd5 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -29,7 +29,7 @@ #include "macros.h" #include "state.h" #include "mtypes.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_accum diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 469b4529f9..ffcd194240 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -32,7 +32,7 @@ #include "context.h" #include "imports.h" #include "macros.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" typedef void (GLAPIENTRY *array_func)( const void * ); diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index e62c7aa572..f8e004af3f 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -104,7 +104,7 @@ #if FEATURE_ARB_sync #include "syncobj.h" #endif -#include "glapi/dispatch.h" +#include "main/dispatch.h" diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 3d466ac44a..aedc509fb2 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -36,7 +36,7 @@ #include "glapi/glapi.h" #include "glapi/glapitable.h" #include "glapi/glthread.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" /* KW: A set of functions to convert unusual Color/Normal/Vertex/etc * calls to a smaller set of driver-provided formats. Currently just diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index f72f957300..9a36394d65 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -32,7 +32,7 @@ #include "macros.h" #include "dlist.h" #include "eval.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" /** diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c index 7feaee316d..0069cd3dcf 100644 --- a/src/mesa/main/arrayobj.c +++ b/src/mesa/main/arrayobj.c @@ -48,7 +48,7 @@ #endif #include "arrayobj.h" #include "macros.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" /** diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 9a32bc335d..92fb8d289d 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -56,7 +56,7 @@ #include "varray.h" #include "viewport.h" #include "mtypes.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" /** diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 785813166c..52d5badf39 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -32,7 +32,7 @@ #include "state.h" #include "teximage.h" #include "texstate.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_colortable diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 5ed93e0c60..15e8dffc23 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -39,7 +39,7 @@ #include "image.h" #include "mtypes.h" #include "state.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_convolve diff --git a/src/mesa/main/dispatch.h b/src/mesa/main/dispatch.h new file mode 100644 index 0000000000..27f80a5062 --- /dev/null +++ b/src/mesa/main/dispatch.h @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corporation 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#ifndef _DISPATCH_H +#define _DISPATCH_H + +#ifdef IN_DRI_DRIVER +#define _GLAPI_USE_REMAP_TABLE +#endif + +#include "glapi/glapitable.h" +#include "glapi/glapioffsets.h" +#include "glapi/glapidispatch.h" + +#endif /* _DISPATCH_H */ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 9ef7fcae90..673db30f25 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -66,7 +66,7 @@ #include "math/m_matrix.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 0afd47b797..84cb78612b 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -32,7 +32,7 @@ #include "framebuffer.h" #include "readpix.h" #include "state.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_drawpix diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 58eb59b13c..bd2e1177fd 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -44,7 +44,7 @@ #include "eval.h" #include "macros.h" #include "mtypes.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_evaluators diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index fcdbb75fc4..e20456fa75 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -36,7 +36,7 @@ #include "feedback.h" #include "macros.h" #include "mtypes.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_feedback diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index c7304e8dd7..3a65bb1926 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -29,7 +29,7 @@ #include "context.h" #include "image.h" #include "histogram.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_histogram diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index e2e3854fc8..675e933ca6 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -35,7 +35,7 @@ #include "macros.h" #include "pixel.h" #include "mtypes.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_pixel_transfer diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index 471352f472..e14511a388 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -29,7 +29,7 @@ #include "imports.h" #include "queryobj.h" #include "mtypes.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_queryobj diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index be61dc265d..d72b846c36 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -34,7 +34,7 @@ #include "macros.h" #include "rastpos.h" #include "state.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_rastpos diff --git a/src/mesa/main/remap.c b/src/mesa/main/remap.c index 5f32a48258..8d9df6b830 100644 --- a/src/mesa/main/remap.c +++ b/src/mesa/main/remap.c @@ -38,7 +38,7 @@ #include "remap.h" #include "imports.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_remap_table @@ -183,7 +183,7 @@ _mesa_map_static_functions(void) /** * Initialize the remap table. This is called in one_time_init(). * The remap table needs to be initialized before calling the - * CALL/GET/SET macros defined in glapi/dispatch.h. + * CALL/GET/SET macros defined in main/dispatch.h. */ void _mesa_init_remap_table(void) diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index 2c8f0de467..0a5b629688 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -25,7 +25,7 @@ * SOFTWARE. */ -#include "glapi/dispatch.h" +#include "main/dispatch.h" struct gl_function_remap { GLint func_index; diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 2ae839b2a6..e70ea30290 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -37,7 +37,7 @@ #include "main/texgen.h" #include "main/texstate.h" #include "math/m_matrix.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #if FEATURE_texgen diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 86878d6a8a..b4128f84d8 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -34,7 +34,7 @@ #include "mtypes.h" #include "varray.h" #include "arrayobj.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" /** diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h index ae636fb24f..037c4b1888 100644 --- a/src/mesa/main/vtxfmt_tmp.h +++ b/src/mesa/main/vtxfmt_tmp.h @@ -29,7 +29,7 @@ #define PRE_LOOPBACK( FUNC ) #endif -#include "glapi/dispatch.h" +#include "main/dispatch.h" static void GLAPIENTRY TAG(ArrayElement)( GLint i ) { diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 129a973cf1..d0d0575b0b 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -46,7 +46,7 @@ #include "shader/shader_api.h" #include "shader/slang/slang_compile.h" #include "shader/slang/slang_link.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" /** diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 3dde982371..e40f5f9dc4 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -41,7 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/light.h" #include "main/api_arrayelt.h" #include "main/api_noop.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c index a7846213d0..23ad12608f 100644 --- a/src/mesa/vbo/vbo_exec_eval.c +++ b/src/mesa/vbo/vbo_exec_eval.c @@ -29,7 +29,7 @@ #include "main/context.h" #include "main/macros.h" #include "math/m_eval.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #include "vbo_exec.h" diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 3a64c0cf01..a5d027982f 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -78,7 +78,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/api_validate.h" #include "main/api_arrayelt.h" #include "main/vtxfmt.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #include "vbo_context.h" diff --git a/src/mesa/vbo/vbo_save_loopback.c b/src/mesa/vbo/vbo_save_loopback.c index 8d9ae307d6..f253c854d2 100644 --- a/src/mesa/vbo/vbo_save_loopback.c +++ b/src/mesa/vbo/vbo_save_loopback.c @@ -30,7 +30,7 @@ #include "main/enums.h" #include "main/imports.h" #include "main/mtypes.h" -#include "glapi/dispatch.h" +#include "main/dispatch.h" #include "glapi/glapi.h" #include "vbo_context.h" -- cgit v1.2.3 From aa799fa2d0701fbaa968036c0c1964d00a530c6d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 25 Feb 2010 15:01:10 +0100 Subject: tgsi: Remove dead code. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 593c3cbfb3..68566d3093 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -960,18 +960,6 @@ micro_pow( #endif } -#if 0 -static void -micro_sqrt( union tgsi_exec_channel *dst, - const union tgsi_exec_channel *src ) -{ - dst->f[0] = sqrtf( src->f[0] ); - dst->f[1] = sqrtf( src->f[1] ); - dst->f[2] = sqrtf( src->f[2] ); - dst->f[3] = sqrtf( src->f[3] ); -} -#endif - static void micro_sub(union tgsi_exec_channel *dst, const union tgsi_exec_channel *src0, -- cgit v1.2.3 From ec91810147425f4123ec80117109925e054cc66d Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Thu, 25 Feb 2010 17:52:04 +0200 Subject: glapi: minor ugliness to be able to copy to xorg --- src/mesa/glapi/glapi.c | 13 +------------ src/mesa/glapi/glapi_dispatch.c | 6 ++++++ src/mesa/glapi/glapi_getproc.c | 8 ++++++-- src/mesa/glapi/glapi_nop.c | 6 ++++++ src/mesa/glapi/glthread.c | 4 +++- 5 files changed, 22 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 469523d57c..631ffba3c7 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -51,22 +51,11 @@ #ifdef HAVE_DIX_CONFIG_H - #include -#define PUBLIC - +#include "glapi/mesa.h" #else - #include "main/glheader.h" - -#endif - #include "main/compiler.h" - -#include -#include -#ifdef DEBUG -#include #endif #include "glapi/glapi.h" diff --git a/src/mesa/glapi/glapi_dispatch.c b/src/mesa/glapi/glapi_dispatch.c index 4cb43f4505..32b9535e3f 100644 --- a/src/mesa/glapi/glapi_dispatch.c +++ b/src/mesa/glapi/glapi_dispatch.c @@ -37,8 +37,14 @@ * \author Brian Paul */ +#ifdef HAVE_DIX_CONFIG_H +#include +#include "glapi/mesa.h" +#else #include "main/glheader.h" #include "main/compiler.h" +#endif + #include "glapi/glapi.h" #include "glapi/glapitable.h" #include "glapi/glapidispatch.h" diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index eecfb9c1ae..69eb42c79e 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -30,10 +30,14 @@ */ -#include -#include +#ifdef HAVE_DIX_CONFIG_H +#include +#include "glapi/mesa.h" +#else #include "main/glheader.h" #include "main/compiler.h" +#endif + #include "glapi/glapi.h" #include "glapi/glapioffsets.h" #include "glapi/glapitable.h" diff --git a/src/mesa/glapi/glapi_nop.c b/src/mesa/glapi/glapi_nop.c index aa84b9a169..b1a718a5f0 100644 --- a/src/mesa/glapi/glapi_nop.c +++ b/src/mesa/glapi/glapi_nop.c @@ -38,8 +38,14 @@ +#ifdef HAVE_DIX_CONFIG_H +#include +#include "glapi/mesa.h" +#else #include "main/compiler.h" #include "main/glheader.h" +#endif + #include "glapi/glapi.h" #ifdef DEBUG diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index 1c2c386571..be4e2f754d 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -30,9 +30,11 @@ #ifdef HAVE_DIX_CONFIG_H #include +#include "glapi/mesa.h" +#else +#include "main/compiler.h" #endif -#include "main/compiler.h" #include "glapi/glthread.h" -- cgit v1.2.3 From f1f33f929366e452046de27429fc730a83d11c4b Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Thu, 25 Feb 2010 17:52:05 +0200 Subject: glapi: EXTRA_DEBUG is never defined, make this explicit --- src/mesa/glapi/glapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 631ffba3c7..2fa673d307 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -490,7 +490,7 @@ _glapi_get_dispatch_table_size(void) void _glapi_check_table(const struct _glapi_table *table) { -#ifdef EXTRA_DEBUG +#if 0 /* Enable this for extra DEBUG */ const GLuint entries = _glapi_get_dispatch_table_size(); const void **tab = (const void **) table; GLuint i; -- cgit v1.2.3 From fec2a67e405607b8527261add7e5842e9a75c921 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Thu, 25 Feb 2010 17:52:05 +0200 Subject: glapi/gen: just copy in glx/glapi --- src/mesa/glapi/gen/Makefile | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/gen/Makefile b/src/mesa/glapi/gen/Makefile index 4984da8581..8e9c909f31 100644 --- a/src/mesa/glapi/gen/Makefile +++ b/src/mesa/glapi/gen/Makefile @@ -37,28 +37,26 @@ MESA_OUTPUTS = \ ###################################################################### XORG_GLX_DIR = $(XORG_BASE)/glx +XORG_GLAPI_DIR = $(XORG_BASE)/glx/glapi XORG_GLAPI_FILES = \ - $(XORG_GLX_DIR)/glapi.h \ - $(XORG_GLX_DIR)/glapi.c \ - $(XORG_GLX_DIR)/glapi_getproc.c \ - $(XORG_GLX_DIR)/glapi_nop.c \ - $(XORG_GLX_DIR)/glthread.c \ - $(XORG_GLX_DIR)/glthread.h + $(XORG_GLAPI_DIR)/glapi.h \ + $(XORG_GLAPI_DIR)/glapi.c \ + $(XORG_GLAPI_DIR)/glapi_getproc.c \ + $(XORG_GLAPI_DIR)/glapi_nop.c \ + $(XORG_GLAPI_DIR)/glthread.c \ + $(XORG_GLAPI_DIR)/glthread.h XORG_GLAPI_OUTPUTS = \ - $(XORG_GLX_DIR)/glprocs.h \ - $(XORG_GLX_DIR)/glapitemp.h \ - $(XORG_GLX_DIR)/glapioffsets.h \ - $(XORG_GLX_DIR)/glapitable.h \ - $(XORG_GLX_DIR)/glapidispatch.h - -# XXX sync mesa and xorg glapi, generate in mesa only and just copy in glx/glapi -# -# $(XORG_GLAPI_FILES) \ -# $(XORG_GLAPI_OUTPUTS) \ + $(XORG_GLAPI_DIR)/glprocs.h \ + $(XORG_GLAPI_DIR)/glapitemp.h \ + $(XORG_GLAPI_DIR)/glapioffsets.h \ + $(XORG_GLAPI_DIR)/glapitable.h \ + $(XORG_GLAPI_DIR)/glapidispatch.h XORG_OUTPUTS = \ + $(XORG_GLAPI_FILES) \ + $(XORG_GLAPI_OUTPUTS) \ $(XORG_GLX_DIR)/indirect_dispatch.c \ $(XORG_GLX_DIR)/indirect_dispatch_swap.c \ $(XORG_GLX_DIR)/indirect_dispatch.h \ @@ -114,27 +112,27 @@ clean: ###################################################################### -$(XORG_GLX_DIR)/%.c: %.c +$(XORG_GLAPI_DIR)/%.c: $(MESA_GLAPI_DIR)/%.c cp $< $@ -$(XORG_GLX_DIR)/%.h: %.h +$(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h cp $< $@ ###################################################################### -$(MESA_GLAPI_DIR)/glprocs.h $(XORG_GLX_DIR)/glprocs.h: gl_procs.py $(COMMON) +$(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -$(MESA_GLAPI_DIR)/glapitemp.h $(XORG_GLX_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) +$(MESA_GLAPI_DIR)/glapitemp.h: gl_apitemp.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -$(MESA_GLAPI_DIR)/glapioffsets.h $(XORG_GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) +$(MESA_GLAPI_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -$(MESA_GLAPI_DIR)/glapitable.h $(XORG_GLX_DIR)/glapitable.h: gl_table.py $(COMMON) +$(MESA_GLAPI_DIR)/glapitable.h: gl_table.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -$(MESA_GLAPI_DIR)/glapidispatch.h $(XORG_GLX_DIR)/glapidispatch.h: gl_table.py $(COMMON) +$(MESA_GLAPI_DIR)/glapidispatch.h: gl_table.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ ###################################################################### -- cgit v1.2.3 From aec4d225b28bfb97aa04845fe038b37e4ffad240 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 25 Feb 2010 14:21:50 +0100 Subject: python: Fix typo. --- src/gallium/state_trackers/python/p_state.i | 2 +- .../python/tests/regress/fragment-shader/frag-abs.png | Bin 0 -> 8750 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-abs.png (limited to 'src') diff --git a/src/gallium/state_trackers/python/p_state.i b/src/gallium/state_trackers/python/p_state.i index 5afe4d4908..eda77b56f8 100644 --- a/src/gallium/state_trackers/python/p_state.i +++ b/src/gallium/state_trackers/python/p_state.i @@ -69,7 +69,7 @@ pipe_blend_state(const char *STRING, unsigned LENGTH) { struct pipe_blend_state *state; - state = CALLOC_STRUCT(pipe_framebuffer_state); + state = CALLOC_STRUCT(pipe_blend_state); if (state) { LENGTH = MIN2(sizeof *state, LENGTH); memcpy(state, STRING, LENGTH); diff --git a/src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-abs.png b/src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-abs.png new file mode 100644 index 0000000000..c947a7b881 Binary files /dev/null and b/src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-abs.png differ -- cgit v1.2.3 From db2e1518ff4ecb4a394076321ea5cdda3483ccbe Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 25 Feb 2010 17:02:52 +0000 Subject: scons: Always build trace driver There are so many state trackers and winsys that rely on it for debug building, and trace can really build anywhere and is thin so there's no point is making it an option. Based on Xavier Chantry 's patch: "I also removed the trace check in xlib SConscript which is now useless, and that script seems to deal with the cell driver, so I added cell in the check for supported drivers." --- SConstruct | 4 ++++ src/gallium/winsys/xlib/SConscript | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/SConstruct b/SConstruct index ea63b90f46..e1c4a1898c 100644 --- a/SConstruct +++ b/SConstruct @@ -110,6 +110,10 @@ Export([ ####################################################################### # Environment setup +# Always build trace driver +if 'trace' not in env['drivers']: + env['drivers'].append('trace') + # Includes env.Append(CPPPATH = [ '#/include', diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index a4dabb7804..8c9d318af2 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -14,11 +14,7 @@ if env['dri']: print 'warning: DRI enabled: skipping build of xlib libGL.so' Return() -if 'trace' not in env['drivers']: - print 'warning: trace pipe driver disabled: skipping build of xlib libGL.so' - Return() - -if not set(('softpipe', 'llvmpipe', 'trace')).intersection(env['drivers']): +if not set(('softpipe', 'llvmpipe', 'cell')).intersection(env['drivers']): print 'warning: no supported pipe driver: skipping build of xlib libGL.so' Return() -- cgit v1.2.3 From 91af398b32f0f63a1560fe023651be0861c08f8a Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 21 Feb 2010 14:28:17 +0100 Subject: dri/nouveau: Fix stencil mask handling on glClear(). --- src/mesa/drivers/dri/nouveau/nouveau_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c index bf0e20ca81..afaa8de5b3 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c @@ -112,8 +112,8 @@ nouveau_clear(GLcontext *ctx, GLbitfield buffers) mask = pack_zs_i(s->format, (buffers & BUFFER_BIT_DEPTH && ctx->Depth.Mask) ? ~0 : 0, - (buffers & BUFFER_BIT_STENCIL && - ctx->Stencil.WriteMask[0]) ? ~0 : 0); + (buffers & BUFFER_BIT_STENCIL ? + ctx->Stencil.WriteMask[0] : 0)); value = pack_zs_f(s->format, ctx->Depth.Clear, ctx->Stencil.Clear); -- cgit v1.2.3 From 9a8e374c46079d40ef577842cbf917af1c131dc0 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 21 Feb 2010 14:30:31 +0100 Subject: dri/nouveau: Set _BaseFormat correctly for z24s8 renderbuffers. --- src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index 91eade8d63..c5fb0151b3 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -70,7 +70,7 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat) case GL_DEPTH_COMPONENT24: case GL_STENCIL_INDEX8_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->_BaseFormat = GL_DEPTH_COMPONENT; + rb->_BaseFormat = GL_DEPTH_STENCIL; rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT; s->cpp = 4; -- cgit v1.2.3 From 1e4c0618a8e5f251b68e98af498a2a8ff787cc61 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 21 Feb 2010 14:35:56 +0100 Subject: dri/nouveau: Avoid mask overflow on nv04_surface_fill. --- src/mesa/drivers/dri/nouveau/nv04_surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c index 86fa1dcd7a..a219779b86 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_surface.c +++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c @@ -369,7 +369,7 @@ nv04_surface_fill(GLcontext *ctx, BEGIN_RING(chan, patt, NV04_IMAGE_PATTERN_COLOR_FORMAT, 1); OUT_RING (chan, rect_format(dst->format)); BEGIN_RING(chan, patt, NV04_IMAGE_PATTERN_MONOCHROME_COLOR1, 1); - OUT_RING (chan, mask | ~0 << (8 * dst->cpp)); + OUT_RING (chan, mask | ~0ll << (8 * dst->cpp)); BEGIN_RING(chan, rect, NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT, 1); OUT_RING (chan, rect_format(dst->format)); -- cgit v1.2.3 From e59e5e3388c9561d58aa02bab20baca99ba86d15 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 22 Feb 2010 01:50:04 +0100 Subject: dri/nouveau: Clean up the nv04 surface code a bit. --- src/mesa/drivers/dri/nouveau/nv04_surface.c | 36 ++++++++--------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c index a219779b86..e8a5409fbd 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_surface.c +++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c @@ -216,8 +216,8 @@ nv04_surface_copy_swizzle(GLcontext *ctx, /* If area is too large to copy in one shot we must copy it in * POT chunks to meet alignment requirements */ - assert(sub_w == w || _mesa_is_pow_two(sub_w)); - assert(sub_h == h || _mesa_is_pow_two(sub_h)); + assert(sub_w == w || _mesa_is_pow_two(w)); + assert(sub_h == h || _mesa_is_pow_two(h)); nouveau_bo_marko(bctx, sifm, NV03_SCALED_IMAGE_FROM_MEMORY_DMA_IMAGE, src->bo, bo_flags | NOUVEAU_BO_RD); @@ -239,8 +239,6 @@ nv04_surface_copy_swizzle(GLcontext *ctx, for (x = 0; x < w; x += sub_w) { sub_w = MIN2(sub_w, w - x); - /* Must be 64-byte aligned */ - assert(!(dst->offset & 63)); MARK_RING(chan, 15, 1); @@ -277,10 +275,10 @@ nv04_surface_copy_swizzle(GLcontext *ctx, static void nv04_surface_copy_m2mf(GLcontext *ctx, - struct nouveau_surface *dst, - struct nouveau_surface *src, - int dx, int dy, int sx, int sy, - int w, int h) + struct nouveau_surface *dst, + struct nouveau_surface *src, + int dx, int dy, int sx, int sy, + int w, int h) { struct nouveau_channel *chan = context_chan(ctx); struct nouveau_hw_state *hw = &to_nouveau_context(ctx)->hw; @@ -484,34 +482,20 @@ nv04_surface_init(GLcontext *ctx) OUT_RING (chan, NV04_GDI_RECTANGLE_TEXT_MONOCHROME_FORMAT_LE); /* Swizzled surface. */ - switch (context_chipset(ctx) & 0xf0) { - case 0x00: - case 0x10: + if (context_chipset(ctx) < 0x20) class = NV04_SWIZZLED_SURFACE; - break; - case 0x20: + else class = NV20_SWIZZLED_SURFACE; - break; - default: - /* Famous last words: this really can't happen.. */ - assert(0); - break; - } ret = nouveau_grobj_alloc(chan, handle++, class, &hw->swzsurf); if (ret) goto fail; /* Scaled image from memory. */ - switch (context_chipset(ctx) & 0xf0) { - case 0x00: + if (context_chipset(ctx) < 0x10) class = NV04_SCALED_IMAGE_FROM_MEMORY; - break; - case 0x10: - case 0x20: + else class = NV10_SCALED_IMAGE_FROM_MEMORY; - break; - } ret = nouveau_grobj_alloc(chan, handle++, class, &hw->sifm); if (ret) -- cgit v1.2.3 From 44602bb23ca7b67d4db586d9194c75cfe4a60962 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 22 Feb 2010 01:53:23 +0100 Subject: dri/nouveau: Swizzle using the CPU when we hit a limitation of SIFM. --- src/mesa/drivers/dri/nouveau/nv04_surface.c | 96 ++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c index e8a5409fbd..e3febf7d2f 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_surface.c +++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c @@ -321,6 +321,82 @@ nv04_surface_copy_m2mf(GLcontext *ctx, FIRE_RING(chan); } +typedef unsigned (*get_offset_t)(struct nouveau_surface *s, + unsigned x, unsigned y); + +static unsigned +get_linear_offset(struct nouveau_surface *s, unsigned x, unsigned y) +{ + return x * s->cpp + y * s->pitch; +} + +static unsigned +get_swizzled_offset(struct nouveau_surface *s, unsigned x, unsigned y) +{ + unsigned k = log2i(MIN2(s->width, s->height)); + + unsigned u = (x & 0x001) << 0 | + (x & 0x002) << 1 | + (x & 0x004) << 2 | + (x & 0x008) << 3 | + (x & 0x010) << 4 | + (x & 0x020) << 5 | + (x & 0x040) << 6 | + (x & 0x080) << 7 | + (x & 0x100) << 8 | + (x & 0x200) << 9 | + (x & 0x400) << 10 | + (x & 0x800) << 11; + + unsigned v = (y & 0x001) << 1 | + (y & 0x002) << 2 | + (y & 0x004) << 3 | + (y & 0x008) << 4 | + (y & 0x010) << 5 | + (y & 0x020) << 6 | + (y & 0x040) << 7 | + (y & 0x080) << 8 | + (y & 0x100) << 9 | + (y & 0x200) << 10 | + (y & 0x400) << 11 | + (y & 0x800) << 12; + + return s->cpp * (((u | v) & ~(~0 << 2*k)) | + (x & (~0 << k)) << k | + (y & (~0 << k)) << k); +} + +static void +nv04_surface_copy_cpu(GLcontext *ctx, + struct nouveau_surface *dst, + struct nouveau_surface *src, + int dx, int dy, int sx, int sy, + int w, int h) +{ + int x, y; + get_offset_t get_dst = (dst->layout == SWIZZLED ? + get_swizzled_offset : get_linear_offset); + get_offset_t get_src = (src->layout == SWIZZLED ? + get_swizzled_offset : get_linear_offset); + void *dp, *sp; + + nouveau_bo_map(dst->bo, NOUVEAU_BO_WR); + nouveau_bo_map(src->bo, NOUVEAU_BO_RD); + + dp = dst->bo->map + dst->offset; + sp = src->bo->map + src->offset; + + for (y = 0; y < h; y++) { + for (x = 0; x < w; x++) { + memcpy(dp + get_dst(dst, dx + x, dy + y), + sp + get_src(src, sx + x, sy + y), dst->cpp); + } + } + + nouveau_bo_unmap(src->bo); + nouveau_bo_unmap(dst->bo); +} + void nv04_surface_copy(GLcontext *ctx, struct nouveau_surface *dst, @@ -328,16 +404,22 @@ nv04_surface_copy(GLcontext *ctx, int dx, int dy, int sx, int sy, int w, int h) { - /* Setup transfer to swizzle the texture to vram if needed */ - if (src->layout != SWIZZLED && - dst->layout == SWIZZLED && - dst->width > 2 && dst->height > 1) { - nv04_surface_copy_swizzle(ctx, dst, src, - dx, dy, sx, sy, w, h); + /* Linear texture copy. */ + if ((src->layout == LINEAR && dst->layout == LINEAR) || + dst->width <= 2 || dst->height <= 1) { + nv04_surface_copy_m2mf(ctx, dst, src, dx, dy, sx, sy, w, h); + return; + } + + /* Swizzle using sifm+swzsurf. */ + if (src->layout == LINEAR && dst->layout == SWIZZLED && + dst->cpp != 1 && !(dst->offset & 63)) { + nv04_surface_copy_swizzle(ctx, dst, src, dx, dy, sx, sy, w, h); return; } - nv04_surface_copy_m2mf(ctx, dst, src, dx, dy, sx, sy, w, h); + /* Fallback to CPU copy. */ + nv04_surface_copy_cpu(ctx, dst, src, dx, dy, sx, sy, w, h); } void -- cgit v1.2.3 From 323e6bbb052f37f91c7340e16c2352bb780a43d8 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 22 Feb 2010 02:03:42 +0100 Subject: dri/nouveau: Try to validate textures earlier. --- src/mesa/drivers/dri/nouveau/nouveau_state.c | 4 +- src/mesa/drivers/dri/nouveau/nouveau_texture.c | 284 ++++++++++++++++--------- src/mesa/drivers/dri/nouveau/nouveau_texture.h | 5 +- src/mesa/drivers/dri/nouveau/nv04_state_tex.c | 4 +- src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 3 +- src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 3 +- 6 files changed, 191 insertions(+), 112 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index d727822175..5d593ed4dd 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c @@ -396,7 +396,6 @@ nouveau_tex_parameter(GLcontext *ctx, GLenum target, const GLfloat *params) { switch (pname) { - case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: @@ -408,9 +407,10 @@ nouveau_tex_parameter(GLcontext *ctx, GLenum target, context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit); break; + case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_BASE_LEVEL: case GL_TEXTURE_MAX_LEVEL: - texture_dirty(t); + nouveau_texture_reallocate(ctx, t); context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit); break; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index ab6e93cceb..32603ab66d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -171,6 +171,148 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint internalFormat, } } +static GLboolean +teximage_fits(struct gl_texture_object *t, int level, + struct gl_texture_image *ti) +{ + struct nouveau_surface *s = &to_nouveau_texture(t)->surfaces[level]; + + return s->bo && s->width == ti->Width && + s->height == ti->Height && + s->format == ti->TexFormat; +} + +static GLboolean +validate_teximage(GLcontext *ctx, struct gl_texture_object *t, + int level, int x, int y, int z, + int width, int height, int depth) +{ + struct gl_texture_image *ti = t->Image[0][level]; + + if (ti && teximage_fits(t, level, ti)) { + struct nouveau_surface *ss = to_nouveau_texture(t)->surfaces; + struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; + + context_drv(ctx)->surface_copy(ctx, &ss[level], s, + x, y, x, y, + width, height); + + return GL_TRUE; + } + + return GL_FALSE; +} + +static int +get_last_level(struct gl_texture_object *t) +{ + struct gl_texture_image *base = t->Image[0][t->BaseLevel]; + + if (t->MinFilter == GL_NEAREST || + t->MinFilter == GL_LINEAR || !base) + return t->BaseLevel; + else + return MIN2(t->BaseLevel + base->MaxLog2, t->MaxLevel); +} + +static void +relayout_texture(GLcontext *ctx, struct gl_texture_object *t) +{ + struct gl_texture_image *base = t->Image[0][t->BaseLevel]; + + if (base) { + struct nouveau_surface *ss = to_nouveau_texture(t)->surfaces; + struct nouveau_surface *s = &to_nouveau_teximage(base)->surface; + int i, ret, last = get_last_level(t); + unsigned size, offset = 0, + width = s->width, + height = s->height; + + /* Deallocate the old storage. */ + for (i = 0; i < MAX_TEXTURE_LEVELS; i++) + nouveau_bo_ref(NULL, &ss[i].bo); + + /* Relayout the mipmap tree. */ + for (i = t->BaseLevel; i <= last; i++) { + size = width * height * s->cpp; + + /* Images larger than 16B have to be aligned. */ + if (size > 16) + offset = align(offset, 64); + + ss[i] = (struct nouveau_surface) { + .offset = offset, + .layout = SWIZZLED, + .format = s->format, + .width = width, + .height = height, + .cpp = s->cpp, + .pitch = width * s->cpp, + }; + + offset += size; + width = MAX2(1, width / 2); + height = MAX2(1, height / 2); + } + + /* Get new storage. */ + size = align(offset, 64); + + ret = nouveau_bo_new(context_dev(ctx), NOUVEAU_BO_MAP | + NOUVEAU_BO_GART | NOUVEAU_BO_VRAM, + 0, size, &ss[last].bo); + assert(!ret); + + for (i = t->BaseLevel; i < last; i++) + nouveau_bo_ref(ss[last].bo, &ss[i].bo); + } +} + +GLboolean +nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t) +{ + struct nouveau_texture *nt = to_nouveau_texture(t); + int i, last = get_last_level(t); + + if (!nt->surfaces[last].bo) + return GL_FALSE; + + if (nt->dirty) { + nt->dirty = GL_FALSE; + + /* Copy the teximages to the actual miptree. */ + for (i = t->BaseLevel; i <= last; i++) { + struct nouveau_surface *s = &nt->surfaces[i]; + + validate_teximage(ctx, t, i, 0, 0, 0, + s->width, s->height, 1); + } + } + + return GL_TRUE; +} + +void +nouveau_texture_reallocate(GLcontext *ctx, struct gl_texture_object *t) +{ + texture_dirty(t); + relayout_texture(ctx, t); + nouveau_texture_validate(ctx, t); +} + +static unsigned +get_teximage_placement(struct gl_texture_image *ti) +{ + if (ti->TexFormat == MESA_FORMAT_A8 || + ti->TexFormat == MESA_FORMAT_L8 || + ti->TexFormat == MESA_FORMAT_I8) + /* 1 cpp formats will have to be swizzled by the CPU, + * so leave them in system RAM for now. */ + return NOUVEAU_BO_MAP; + else + return NOUVEAU_BO_GART | NOUVEAU_BO_MAP; +} + static void nouveau_teximage(GLcontext *ctx, GLint dims, GLenum target, GLint level, GLint internalFormat, @@ -181,37 +323,45 @@ nouveau_teximage(GLcontext *ctx, GLint dims, GLenum target, GLint level, struct gl_texture_image *ti) { struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; - unsigned bo_flags = NOUVEAU_BO_GART | NOUVEAU_BO_RDWR | NOUVEAU_BO_MAP; int ret; /* Allocate a new bo for the image. */ - nouveau_surface_alloc(ctx, s, LINEAR, bo_flags, ti->TexFormat, - width, height); + nouveau_surface_alloc(ctx, s, LINEAR, get_teximage_placement(ti), + ti->TexFormat, width, height); ti->RowStride = s->pitch / s->cpp; pixels = _mesa_validate_pbo_teximage(ctx, dims, width, height, depth, format, type, pixels, packing, "glTexImage"); - if (!pixels) - return; - - /* Store the pixel data. */ - nouveau_teximage_map(ctx, ti); - - ret = _mesa_texstore(ctx, dims, ti->_BaseFormat, - ti->TexFormat, ti->Data, - 0, 0, 0, s->pitch, - ti->ImageOffsets, - width, height, depth, - format, type, pixels, packing); - assert(ret); + if (pixels) { + /* Store the pixel data. */ + nouveau_teximage_map(ctx, ti); + + ret = _mesa_texstore(ctx, dims, ti->_BaseFormat, + ti->TexFormat, ti->Data, + 0, 0, 0, s->pitch, + ti->ImageOffsets, + width, height, depth, + format, type, pixels, packing); + assert(ret); + + nouveau_teximage_unmap(ctx, ti); + _mesa_unmap_teximage_pbo(ctx, packing); + + if (!validate_teximage(ctx, t, level, 0, 0, 0, + width, height, depth)) + /* It doesn't fit, mark it as dirty. */ + texture_dirty(t); + } - nouveau_teximage_unmap(ctx, ti); - _mesa_unmap_teximage_pbo(ctx, packing); + if (level == t->BaseLevel) { + if (!teximage_fits(t, level, ti)) + relayout_texture(ctx, t); + nouveau_texture_validate(ctx, t); + } context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit); context_dirty_i(ctx, TEX_ENV, ctx->Texture.CurrentUnit); - texture_dirty(t); } static void @@ -271,8 +421,9 @@ nouveau_texsubimage_3d(GLcontext *ctx, GLenum target, GLint level, packing, t, ti); nouveau_teximage_unmap(ctx, ti); - context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit); - texture_dirty(t); + if (!to_nouveau_texture(t)->dirty) + validate_teximage(ctx, t, level, xoffset, yoffset, zoffset, + width, height, depth); } static void @@ -290,8 +441,9 @@ nouveau_texsubimage_2d(GLcontext *ctx, GLenum target, GLint level, packing, t, ti); nouveau_teximage_unmap(ctx, ti); - context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit); - texture_dirty(t); + if (!to_nouveau_texture(t)->dirty) + validate_teximage(ctx, t, level, xoffset, yoffset, 0, + width, height, 1); } static void @@ -308,8 +460,9 @@ nouveau_texsubimage_1d(GLcontext *ctx, GLenum target, GLint level, packing, t, ti); nouveau_teximage_unmap(ctx, ti); - context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit); - texture_dirty(t); + if (!to_nouveau_texture(t)->dirty) + validate_teximage(ctx, t, level, xoffset, 0, 0, + width, 1, 1); } static void @@ -354,87 +507,6 @@ nouveau_texture_unmap(GLcontext *ctx, struct gl_texture_object *t) } } -static void -relayout_miptree(GLcontext *ctx, struct gl_texture_object *t) -{ - struct nouveau_surface *ss = to_nouveau_texture(t)->surfaces; - unsigned last_level, offset = 0; - unsigned size; - int i, ret; - - if (t->MinFilter == GL_NEAREST || - t->MinFilter == GL_LINEAR) - last_level = t->BaseLevel; - else - last_level = t->_MaxLevel; - - /* Deallocate the old storage. */ - for (i = 0; i < MAX_TEXTURE_LEVELS; i++) - nouveau_bo_ref(NULL, &ss[i].bo); - - /* Relayout the mipmap tree. */ - for (i = t->BaseLevel; i <= last_level; i++) { - struct nouveau_surface *s = - &to_nouveau_teximage(t->Image[0][i])->surface; - - size = s->width * s->height * s->cpp; - - /* Images larger than 16B have to be aligned. */ - if (size > 16) - offset = align(offset, 64); - - ss[i] = (struct nouveau_surface) { - .offset = offset, - .layout = SWIZZLED, - .format = s->format, - .width = s->width, - .height = s->height, - .cpp = s->cpp, - .pitch = s->width * s->cpp, - }; - - offset += size; - } - - /* Get new storage. */ - size = align(offset, 64); - - ret = nouveau_bo_new(context_dev(ctx), - NOUVEAU_BO_GART | NOUVEAU_BO_VRAM, - 0, size, &ss[last_level].bo); - assert(!ret); - - for (i = t->BaseLevel; i < last_level; i++) - nouveau_bo_ref(ss[last_level].bo, &ss[i].bo); -} - -void -nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t) -{ - struct nouveau_texture *nt = to_nouveau_texture(t); - int i; - - if (!nt->dirty) - return; - - nt->dirty = GL_FALSE; - - relayout_miptree(ctx, t); - - /* Copy the teximages to the actual swizzled miptree. */ - for (i = t->BaseLevel; i < MAX_TEXTURE_LEVELS; i++) { - struct gl_texture_image *ti = t->Image[0][i]; - struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; - - if (!nt->surfaces[i].bo) - break; - - context_drv(ctx)->surface_copy(ctx, &nt->surfaces[i], s, - 0, 0, 0, 0, - s->width, s->height); - } -} - void nouveau_texture_functions_init(struct dd_function_table *functions) { diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.h b/src/mesa/drivers/dri/nouveau/nouveau_texture.h index 695c0897b5..75d8190e88 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.h @@ -43,7 +43,10 @@ struct nouveau_texture { #define texture_dirty(t) \ to_nouveau_texture(t)->dirty = GL_TRUE; -void +GLboolean nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t); +void +nouveau_texture_reallocate(GLcontext *ctx, struct gl_texture_object *t); + #endif diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c index 99ea310c65..684a19e703 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c @@ -89,7 +89,9 @@ nv04_emit_tex_obj(GLcontext *ctx, int emit) struct gl_texture_image *ti = t->Image[0][t->BaseLevel]; int lod_max = 1, lod_bias = 0; - nouveau_texture_validate(ctx, t); + if (!nouveau_texture_validate(ctx, t)) + return; + s = &to_nouveau_texture(t)->surfaces[t->BaseLevel]; if (t->MinFilter != GL_NEAREST && diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index e5d4f3d18d..d732a5335b 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -90,7 +90,8 @@ nv10_emit_tex_obj(GLcontext *ctx, int emit) s = &to_nouveau_texture(t)->surfaces[t->BaseLevel]; ti = t->Image[0][t->BaseLevel]; - nouveau_texture_validate(ctx, t); + if (!nouveau_texture_validate(ctx, t)) + return; /* Recompute the texturing registers. */ tx_format = nvgl_wrap_mode(t->WrapT) << 28 diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c index d01e91f8ee..2bf760d3b0 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c @@ -87,7 +87,8 @@ nv20_emit_tex_obj(GLcontext *ctx, int emit) s = &to_nouveau_texture(t)->surfaces[t->BaseLevel]; ti = t->Image[0][t->BaseLevel]; - nouveau_texture_validate(ctx, t); + if (!nouveau_texture_validate(ctx, t)) + return; /* Recompute the texturing registers. */ tx_format = ti->DepthLog2 << 28 -- cgit v1.2.3 From 7269a30b86745a29bb575ce3545ab82e6514ce2a Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 23 Feb 2010 16:15:14 +0100 Subject: dri/nouveau: Restructure the nv[12]0 regcombiner code, and fake A8/L8 support. --- src/mesa/drivers/dri/nouveau/Makefile | 1 + src/mesa/drivers/dri/nouveau/nouveau_util.h | 18 ++ src/mesa/drivers/dri/nouveau/nv10_driver.h | 8 + src/mesa/drivers/dri/nouveau/nv10_state_frag.c | 233 ++++++++++++------------- src/mesa/drivers/dri/nouveau/nv20_context.c | 10 +- src/mesa/drivers/dri/nouveau/nv20_driver.h | 7 + src/mesa/drivers/dri/nouveau/nv20_state_frag.c | 73 ++++++++ 7 files changed, 221 insertions(+), 129 deletions(-) create mode 100644 src/mesa/drivers/dri/nouveau/nv20_state_frag.c (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/Makefile b/src/mesa/drivers/dri/nouveau/Makefile index 43bc9f9516..49e8933561 100644 --- a/src/mesa/drivers/dri/nouveau/Makefile +++ b/src/mesa/drivers/dri/nouveau/Makefile @@ -42,6 +42,7 @@ DRIVER_SOURCES = \ nv20_state_polygon.c \ nv20_state_raster.c \ nv20_state_tex.c \ + nv20_state_frag.c \ nv20_state_tnl.c C_SOURCES = \ diff --git a/src/mesa/drivers/dri/nouveau/nouveau_util.h b/src/mesa/drivers/dri/nouveau/nouveau_util.h index 076f225fed..d6007aba2b 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_util.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_util.h @@ -173,4 +173,22 @@ OUT_RINGm(struct nouveau_channel *chan, float m[16]) OUT_RINGf(chan, m[4*j + i]); } +static inline GLboolean +is_color_operand(int op) +{ + return op == GL_SRC_COLOR || op == GL_ONE_MINUS_SRC_COLOR; +} + +static inline GLboolean +is_negative_operand(int op) +{ + return op == GL_ONE_MINUS_SRC_COLOR || op == GL_ONE_MINUS_SRC_ALPHA; +} + +static inline GLboolean +is_texture_source(int s) +{ + return s == GL_TEXTURE || (s >= GL_TEXTURE0 && s <= GL_TEXTURE31); +} + #endif diff --git a/src/mesa/drivers/dri/nouveau/nv10_driver.h b/src/mesa/drivers/dri/nouveau/nv10_driver.h index 4c220b0373..b5ab19b3bc 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_driver.h +++ b/src/mesa/drivers/dri/nouveau/nv10_driver.h @@ -118,6 +118,14 @@ void nv10_emit_stencil_op(GLcontext *ctx, int emit); /* nv10_state_frag.c */ +void +nv10_get_general_combiner(GLcontext *ctx, int i, + uint32_t *a_in, uint32_t *a_out, + uint32_t *c_in, uint32_t *c_out, uint32_t *k); + +void +nv10_get_final_combiner(GLcontext *ctx, uint64_t *in, int *n); + void nv10_emit_tex_env(GLcontext *ctx, int emit); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c index c1df26ecce..b56b4ff02c 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Francisco Jerez. + * Copyright (C) 2009-2010 Francisco Jerez. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining @@ -90,11 +90,11 @@ struct combiner_state { } while (0) /* Get the RC input source for the specified EXT_texture_env_combine - * argument. */ + * source. */ static uint32_t -get_input_source(struct combiner_state *rc, int arg) +get_input_source(struct combiner_state *rc, int source) { - switch (rc->source[arg]) { + switch (source) { case GL_TEXTURE: return RC_IN_SOURCE(TEXTURE0) + rc->unit; @@ -127,52 +127,69 @@ get_input_source(struct combiner_state *rc, int arg) } } -/* Get the RC input mapping for the specified argument, possibly - * inverted or biased. */ +/* Get the RC input mapping for the specified texture_env_combine + * operand, possibly inverted or biased. */ #define INVERT 0x1 #define HALF_BIAS 0x2 static uint32_t -get_input_mapping(struct combiner_state *rc, int arg, int flags) +get_input_mapping(struct combiner_state *rc, int operand, int flags) { int map = 0; - switch (rc->operand[arg]) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: + if (is_color_operand(operand)) map |= RC_IN_USAGE(RGB); - break; - - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: + else map |= RC_IN_USAGE(ALPHA); - break; - } - switch (rc->operand[arg]) { - case GL_SRC_COLOR: - case GL_SRC_ALPHA: - map |= (flags & INVERT ? RC_IN_MAPPING(UNSIGNED_INVERT) : - flags & HALF_BIAS ? RC_IN_MAPPING(HALF_BIAS_NORMAL) : - RC_IN_MAPPING(UNSIGNED_IDENTITY)); - break; + if (is_negative_operand(operand) == !(flags & INVERT)) + map |= flags & HALF_BIAS ? + RC_IN_MAPPING(HALF_BIAS_NEGATE) : + RC_IN_MAPPING(UNSIGNED_INVERT); + else + map |= flags & HALF_BIAS ? + RC_IN_MAPPING(HALF_BIAS_NORMAL) : + RC_IN_MAPPING(UNSIGNED_IDENTITY); - case GL_ONE_MINUS_SRC_COLOR: - case GL_ONE_MINUS_SRC_ALPHA: - map |= (flags & INVERT ? RC_IN_MAPPING(UNSIGNED_IDENTITY) : - flags & HALF_BIAS ? RC_IN_MAPPING(HALF_BIAS_NEGATE) : - RC_IN_MAPPING(UNSIGNED_INVERT)); - break; + return map; +} + +static uint32_t +get_input_arg(struct combiner_state *rc, int arg, int flags) +{ + int source = rc->source[arg]; + int operand = rc->operand[arg]; + + /* Fake several unsupported texture formats. */ + if (is_texture_source(source)) { + int i = (source == GL_TEXTURE ? + rc->unit : source - GL_TEXTURE0); + struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current; + gl_format format = t->Image[0][t->BaseLevel]->TexFormat; + + if (format == MESA_FORMAT_A8) { + /* Emulated using I8. */ + if (is_color_operand(operand)) + return RC_IN_SOURCE(ZERO) | + get_input_mapping(rc, operand, flags); + + } else if (format == MESA_FORMAT_L8) { + /* Sometimes emulated using I8. */ + if (!is_color_operand(operand)) + return RC_IN_SOURCE(ZERO) | + get_input_mapping(rc, operand, + flags ^ INVERT); + } } - return map; + return get_input_source(rc, source) | + get_input_mapping(rc, operand, flags); } /* Bind the RC input variable to the EXT_texture_env_combine * argument , possibly inverted or biased. */ #define INPUT_ARG(rc, var, arg, flags) \ - (rc)->in |= (get_input_mapping(rc, arg, flags) | \ - get_input_source(rc, arg)) << RC_IN_SHIFT_##var + (rc)->in |= get_input_arg(rc, arg, flags) << RC_IN_SHIFT_##var /* Bind the RC input variable to the RC source . */ #define INPUT_SRC(rc, var, src, chan) \ @@ -268,86 +285,13 @@ setup_combiner(struct combiner_state *rc) } } -/* Write the register combiner state out to the hardware. */ -static void -nv10_load_combiner(GLcontext *ctx, int i, struct combiner_state *rc_a, - struct combiner_state *rc_c, uint32_t rc_const) -{ - struct nouveau_channel *chan = context_chan(ctx); - struct nouveau_grobj *celsius = context_eng3d(ctx); - - /* Enable the combiners we're going to need. */ - if (i == 1) { - if (rc_c->out || rc_a->out) - rc_c->out |= 0x5 << 27; - else - rc_c->out |= 0x3 << 27; - } - - BEGIN_RING(chan, celsius, NV10TCL_RC_IN_ALPHA(i), 1); - OUT_RING(chan, rc_a->in); - BEGIN_RING(chan, celsius, NV10TCL_RC_IN_RGB(i), 1); - OUT_RING(chan, rc_c->in); - BEGIN_RING(chan, celsius, NV10TCL_RC_COLOR(i), 1); - OUT_RING(chan, rc_const); - BEGIN_RING(chan, celsius, NV10TCL_RC_OUT_ALPHA(i), 1); - OUT_RING(chan, rc_a->out); - BEGIN_RING(chan, celsius, NV10TCL_RC_OUT_RGB(i), 1); - OUT_RING(chan, rc_c->out); -} - -static void -nv10_load_final(GLcontext *ctx, struct combiner_state *rc, int n) -{ - struct nouveau_channel *chan = context_chan(ctx); - struct nouveau_grobj *celsius = context_eng3d(ctx); - - BEGIN_RING(chan, celsius, NV10TCL_RC_FINAL0, 2); - OUT_RING(chan, rc->in); - OUT_RING(chan, rc->in >> 32); -} - -static void -nv20_load_combiner(GLcontext *ctx, int i, struct combiner_state *rc_a, - struct combiner_state *rc_c, uint32_t rc_const) -{ - struct nouveau_channel *chan = context_chan(ctx); - struct nouveau_grobj *kelvin = context_eng3d(ctx); - - BEGIN_RING(chan, kelvin, NV20TCL_RC_IN_ALPHA(i), 1); - OUT_RING(chan, rc_a->in); - BEGIN_RING(chan, kelvin, NV20TCL_RC_OUT_ALPHA(i), 1); - OUT_RING(chan, rc_a->out); - BEGIN_RING(chan, kelvin, NV20TCL_RC_IN_RGB(i), 1); - OUT_RING(chan, rc_c->in); - BEGIN_RING(chan, kelvin, NV20TCL_RC_OUT_RGB(i), 1); - OUT_RING(chan, rc_c->out); - BEGIN_RING(chan, kelvin, NV20TCL_RC_CONSTANT_COLOR0(i), 1); - OUT_RING(chan, rc_const); -} - -static void -nv20_load_final(GLcontext *ctx, struct combiner_state *rc, int n) -{ - struct nouveau_channel *chan = context_chan(ctx); - struct nouveau_grobj *kelvin = context_eng3d(ctx); - - BEGIN_RING(chan, kelvin, NV20TCL_RC_FINAL0, 2); - OUT_RING(chan, rc->in); - OUT_RING(chan, rc->in >> 32); - - BEGIN_RING(chan, kelvin, NV20TCL_RC_ENABLE, 1); - OUT_RING(chan, n); -} - void -nv10_emit_tex_env(GLcontext *ctx, int emit) +nv10_get_general_combiner(GLcontext *ctx, int i, + uint32_t *a_in, uint32_t *a_out, + uint32_t *c_in, uint32_t *c_out, uint32_t *k) { - const int i = emit - NOUVEAU_STATE_TEX_ENV0; struct combiner_state rc_a, rc_c; - uint32_t rc_const; - /* Compute the new combiner state. */ if (ctx->Texture.Unit[i]._ReallyEnabled) { INIT_COMBINER(RGB, ctx, &rc_c, i); @@ -359,26 +303,22 @@ nv10_emit_tex_env(GLcontext *ctx, int emit) setup_combiner(&rc_c); setup_combiner(&rc_a); - rc_const = pack_rgba_f(MESA_FORMAT_ARGB8888, - ctx->Texture.Unit[i].EnvColor); - } else { - rc_a.in = rc_a.out = rc_c.in = rc_c.out = rc_const = 0; + rc_a.in = rc_a.out = rc_c.in = rc_c.out = 0; } - if (context_chipset(ctx) >= 0x20) - nv20_load_combiner(ctx, i, &rc_a, &rc_c, rc_const); - else - nv10_load_combiner(ctx, i, &rc_a, &rc_c, rc_const); - - context_dirty(ctx, FRAG); + *k = pack_rgba_f(MESA_FORMAT_ARGB8888, + ctx->Texture.Unit[i].EnvColor); + *a_in = rc_a.in; + *a_out = rc_a.out; + *c_in = rc_c.in; + *c_out = rc_c.out; } void -nv10_emit_frag(GLcontext *ctx, int emit) +nv10_get_final_combiner(GLcontext *ctx, uint64_t *in, int *n) { struct combiner_state rc = {}; - int n = log2i(ctx->Texture._EnabledUnits) + 1; /* * The final fragment value equation is something like: @@ -409,8 +349,53 @@ nv10_emit_frag(GLcontext *ctx, int emit) INPUT_SRC(&rc, G, PRIMARY_COLOR, ALPHA); } - if (context_chipset(ctx) >= 0x20) - nv20_load_final(ctx, &rc, n); - else - nv10_load_final(ctx, &rc, n); + *in = rc.in; + *n = log2i(ctx->Texture._EnabledUnits) + 1; +} + +void +nv10_emit_tex_env(GLcontext *ctx, int emit) +{ + const int i = emit - NOUVEAU_STATE_TEX_ENV0; + struct nouveau_channel *chan = context_chan(ctx); + struct nouveau_grobj *celsius = context_eng3d(ctx); + uint32_t a_in, a_out, c_in, c_out, k; + + nv10_get_general_combiner(ctx, i, &a_in, &a_out, &c_in, &c_out, &k); + + /* Enable the combiners we're going to need. */ + if (i == 1) { + if (c_out || a_out) + c_out |= 0x5 << 27; + else + c_out |= 0x3 << 27; + } + + BEGIN_RING(chan, celsius, NV10TCL_RC_IN_ALPHA(i), 1); + OUT_RING(chan, a_in); + BEGIN_RING(chan, celsius, NV10TCL_RC_IN_RGB(i), 1); + OUT_RING(chan, c_in); + BEGIN_RING(chan, celsius, NV10TCL_RC_COLOR(i), 1); + OUT_RING(chan, k); + BEGIN_RING(chan, celsius, NV10TCL_RC_OUT_ALPHA(i), 1); + OUT_RING(chan, a_out); + BEGIN_RING(chan, celsius, NV10TCL_RC_OUT_RGB(i), 1); + OUT_RING(chan, c_out); + + context_dirty(ctx, FRAG); +} + +void +nv10_emit_frag(GLcontext *ctx, int emit) +{ + struct nouveau_channel *chan = context_chan(ctx); + struct nouveau_grobj *celsius = context_eng3d(ctx); + uint64_t in; + int n; + + nv10_get_final_combiner(ctx, &in, &n); + + BEGIN_RING(chan, celsius, NV10TCL_RC_FINAL0, 2); + OUT_RING(chan, in); + OUT_RING(chan, in >> 32); } diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c index 82a13fb6ff..a80062f5f1 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_context.c +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c @@ -449,7 +449,7 @@ const struct nouveau_driver nv20_driver = { nv10_emit_front_face, nv10_emit_depth, nv10_emit_dither, - nv10_emit_frag, + nv20_emit_frag, nv20_emit_framebuffer, nv20_emit_fog, nv10_emit_index_mask, @@ -487,10 +487,10 @@ const struct nouveau_driver nv20_driver = { nv10_emit_stencil_func, nv10_emit_stencil_mask, nv10_emit_stencil_op, - nv10_emit_tex_env, - nv10_emit_tex_env, - nv10_emit_tex_env, - nv10_emit_tex_env, + nv20_emit_tex_env, + nv20_emit_tex_env, + nv20_emit_tex_env, + nv20_emit_tex_env, nv10_emit_tex_gen, nv10_emit_tex_gen, nv10_emit_tex_gen, diff --git a/src/mesa/drivers/dri/nouveau/nv20_driver.h b/src/mesa/drivers/dri/nouveau/nv20_driver.h index f82a292cf7..18574e9be6 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_driver.h +++ b/src/mesa/drivers/dri/nouveau/nv20_driver.h @@ -59,6 +59,13 @@ nv20_emit_point_mode(GLcontext *ctx, int emit); void nv20_emit_logic_opcode(GLcontext *ctx, int emit); +/* nv20_state_frag.c */ +void +nv20_emit_tex_env(GLcontext *ctx, int emit); + +void +nv20_emit_frag(GLcontext *ctx, int emit); + /* nv20_state_tex.c */ void nv20_emit_tex_obj(GLcontext *ctx, int emit); diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_frag.c b/src/mesa/drivers/dri/nouveau/nv20_state_frag.c new file mode 100644 index 0000000000..74803d2ae8 --- /dev/null +++ b/src/mesa/drivers/dri/nouveau/nv20_state_frag.c @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2009-2010 Francisco Jerez. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "nouveau_driver.h" +#include "nouveau_context.h" +#include "nouveau_class.h" +#include "nv10_driver.h" +#include "nv20_driver.h" + +void +nv20_emit_tex_env(GLcontext *ctx, int emit) +{ + const int i = emit - NOUVEAU_STATE_TEX_ENV0; + struct nouveau_channel *chan = context_chan(ctx); + struct nouveau_grobj *kelvin = context_eng3d(ctx); + uint32_t a_in, a_out, c_in, c_out, k; + + nv10_get_general_combiner(ctx, i, &a_in, &a_out, &c_in, &c_out, &k); + + BEGIN_RING(chan, kelvin, NV20TCL_RC_IN_ALPHA(i), 1); + OUT_RING(chan, a_in); + BEGIN_RING(chan, kelvin, NV20TCL_RC_OUT_ALPHA(i), 1); + OUT_RING(chan, a_out); + BEGIN_RING(chan, kelvin, NV20TCL_RC_IN_RGB(i), 1); + OUT_RING(chan, c_in); + BEGIN_RING(chan, kelvin, NV20TCL_RC_OUT_RGB(i), 1); + OUT_RING(chan, c_out); + BEGIN_RING(chan, kelvin, NV20TCL_RC_CONSTANT_COLOR0(i), 1); + OUT_RING(chan, k); + + context_dirty(ctx, FRAG); +} + +void +nv20_emit_frag(GLcontext *ctx, int emit) +{ + struct nouveau_channel *chan = context_chan(ctx); + struct nouveau_grobj *kelvin = context_eng3d(ctx); + uint64_t in; + int n; + + nv10_get_final_combiner(ctx, &in, &n); + + BEGIN_RING(chan, kelvin, NV20TCL_RC_FINAL0, 2); + OUT_RING(chan, in); + OUT_RING(chan, in >> 32); + + BEGIN_RING(chan, kelvin, NV20TCL_RC_ENABLE, 1); + OUT_RING(chan, n); +} -- cgit v1.2.3 From 3ccfce85e243e83afc1bb582d7424d9238a64f42 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 23 Feb 2010 16:57:06 +0100 Subject: dri/nouveau: Fake A8 and L8 texture support on nv04. --- src/mesa/drivers/dri/nouveau/nv04_state_frag.c | 76 ++++++++++++++++---------- 1 file changed, 46 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c index 34ee296202..d7c86d4178 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c @@ -41,6 +41,7 @@ NV04_MULTITEX_TRIANGLE_COMBINE_COLOR_ALPHA0 struct combiner_state { + GLcontext *ctx; int unit; GLboolean alpha; @@ -59,11 +60,12 @@ struct combiner_state { /* Initialize a combiner_state struct from the texture unit * context. */ -#define INIT_COMBINER(chan, rc, i) do { \ +#define INIT_COMBINER(chan, ctx, rc, i) do { \ struct gl_tex_env_combine_state *c = \ ctx->Texture.Unit[i]._CurrentCombine; \ - (rc)->alpha = __INIT_COMBINER_ALPHA_##chan; \ + (rc)->ctx = ctx; \ (rc)->unit = i; \ + (rc)->alpha = __INIT_COMBINER_ALPHA_##chan; \ (rc)->mode = c->Mode##chan; \ (rc)->source = c->Source##chan; \ (rc)->operand = c->Operand##chan; \ @@ -72,11 +74,11 @@ struct combiner_state { } while (0) /* Get the combiner source for the specified EXT_texture_env_combine - * argument. */ + * source. */ static uint32_t -get_arg_source(struct combiner_state *rc, int arg) +get_input_source(struct combiner_state *rc, int source) { - switch (rc->source[arg]) { + switch (source) { case GL_TEXTURE: return rc->unit ? COMBINER_SOURCE(TEXTURE1) : COMBINER_SOURCE(TEXTURE0); @@ -103,38 +105,53 @@ get_arg_source(struct combiner_state *rc, int arg) } /* Get the (possibly inverted) combiner input mapping for the - * specified argument. */ + * specified EXT_texture_env_combine operand. */ #define INVERT 0x1 static uint32_t -get_arg_mapping(struct combiner_state *rc, int arg, int flags) +get_input_mapping(struct combiner_state *rc, int operand, int flags) { int map = 0; - switch (rc->operand[arg]) { - case GL_SRC_COLOR: - case GL_ONE_MINUS_SRC_COLOR: - break; + if (!is_color_operand(operand) && !rc->alpha) + map |= COMBINER_ALPHA; - case GL_SRC_ALPHA: - case GL_ONE_MINUS_SRC_ALPHA: - map |= rc->alpha ? 0 : COMBINER_ALPHA; - break; - } + if (is_negative_operand(operand) == !(flags & INVERT)) + map |= COMBINER_INVERT; - switch (rc->operand[arg]) { - case GL_SRC_COLOR: - case GL_SRC_ALPHA: - map |= flags & INVERT ? COMBINER_INVERT : 0; - break; + return map; +} - case GL_ONE_MINUS_SRC_COLOR: - case GL_ONE_MINUS_SRC_ALPHA: - map |= flags & INVERT ? 0 : COMBINER_INVERT; - break; +static uint32_t +get_input_arg(struct combiner_state *rc, int arg, int flags) +{ + int source = rc->source[arg]; + int operand = rc->operand[arg]; + + /* Fake several unsupported texture formats. */ + if (is_texture_source(source)) { + int i = (source == GL_TEXTURE ? + rc->unit : source - GL_TEXTURE0); + struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current; + gl_format format = t->Image[0][t->BaseLevel]->TexFormat; + + if (format == MESA_FORMAT_A8) { + /* Emulated using I8. */ + if (is_color_operand(operand)) + return COMBINER_SOURCE(ZERO) | + get_input_mapping(rc, operand, flags); + + } else if (format == MESA_FORMAT_L8) { + /* Emulated using I8. */ + if (!is_color_operand(operand)) + return COMBINER_SOURCE(ZERO) | + get_input_mapping(rc, operand, + flags ^ INVERT); + } } - return map; + return get_input_source(rc, source) | + get_input_mapping(rc, operand, flags); } /* Bind the combiner input to the combiner source , @@ -146,8 +163,7 @@ get_arg_mapping(struct combiner_state *rc, int arg, int flags) /* Bind the combiner input to the EXT_texture_env_combine * argument , possibly inverted. */ #define INPUT_ARG(rc, in, arg, flags) \ - (rc)->hw |= (get_arg_source(rc, arg) | \ - get_arg_mapping(rc, arg, flags)) << COMBINER_SHIFT(in) + (rc)->hw |= get_input_arg(rc, arg, flags) << COMBINER_SHIFT(in) #define UNSIGNED_OP(rc) \ (rc)->hw |= ((rc)->logscale ? \ @@ -222,10 +238,10 @@ nv04_emit_tex_env(GLcontext *ctx, int emit) /* Compute the new combiner state. */ if (ctx->Texture.Unit[i]._ReallyEnabled) { - INIT_COMBINER(A, &rc_a, i); + INIT_COMBINER(A, ctx, &rc_a, i); setup_combiner(&rc_a); - INIT_COMBINER(RGB, &rc_c, i); + INIT_COMBINER(RGB, ctx, &rc_c, i); setup_combiner(&rc_c); } else { -- cgit v1.2.3 From 35041ec151fa6af71966d86869c38bc6b2f7606f Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 23 Feb 2010 16:30:48 +0100 Subject: dri/nouveau: Add some RGB888 span functions. --- src/mesa/drivers/dri/nouveau/nouveau_span.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.c b/src/mesa/drivers/dri/nouveau/nouveau_span.c index dbbbf15b09..f1a56dd03a 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_span.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_span.c @@ -61,6 +61,15 @@ #include "spantmp2.h" +/* RGB888 span functions */ +#define SPANTMP_PIXEL_FMT GL_BGR +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV +#define TAG(x) nouveau_##x##_rgb888 +#define TAG2(x, y) nouveau_##x##_rgb888##y +#define GET_PTR(x, y) (s->bo->map + (y)*s->pitch + (x)*s->cpp) + +#include "spantmp2.h" + /* ARGB8888 span functions */ #define SPANTMP_PIXEL_FMT GL_BGRA #define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV @@ -101,6 +110,8 @@ renderbuffer_map_unmap(struct gl_renderbuffer *rb, GLboolean map) nouveau_InitPointers_rgb565(rb); break; case MESA_FORMAT_XRGB8888: + nouveau_InitPointers_rgb888(rb); + break; case MESA_FORMAT_ARGB8888: nouveau_InitPointers_argb8888(rb); break; -- cgit v1.2.3 From 7432ffbdfa52b51b720bdde5cd50c497862b8806 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 23 Feb 2010 16:31:42 +0100 Subject: dri/nouveau: Don't try to map a non-existent teximage. --- src/mesa/drivers/dri/nouveau/nouveau_texture.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 32603ab66d..5b78804295 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -81,10 +81,12 @@ nouveau_teximage_map(GLcontext *ctx, struct gl_texture_image *ti) struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; int ret; - ret = nouveau_bo_map(s->bo, NOUVEAU_BO_RDWR); - assert(!ret); + if (s->bo) { + ret = nouveau_bo_map(s->bo, NOUVEAU_BO_RDWR); + assert(!ret); - ti->Data = s->bo->map; + ti->Data = s->bo->map; + } } static void @@ -92,7 +94,8 @@ nouveau_teximage_unmap(GLcontext *ctx, struct gl_texture_image *ti) { struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; - nouveau_bo_unmap(s->bo); + if (s->bo) + nouveau_bo_unmap(s->bo); ti->Data = NULL; } -- cgit v1.2.3 From a7b8d105a6efe4056633f7129f80aac1f13cc246 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 25 Feb 2010 02:15:54 +0100 Subject: dri/nouveau: Support rectangle textures. --- src/mesa/drivers/dri/nouveau/nouveau_texture.c | 21 +++++++------ src/mesa/drivers/dri/nouveau/nv10_context.c | 7 +++++ src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 37 +++++++++++++++++++++-- src/mesa/drivers/dri/nouveau/nv20_context.c | 7 +++++ src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 42 ++++++++++++++++++++++++-- 5 files changed, 100 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 5b78804295..840bd6fe83 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -118,9 +118,6 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint internalFormat, return MESA_FORMAT_ARGB8888; case GL_RGB5_A1: return MESA_FORMAT_ARGB1555; - case GL_RGBA2: - case GL_RGBA4: - return MESA_FORMAT_ARGB4444; case 3: case GL_R3_G3_B2: @@ -180,9 +177,10 @@ teximage_fits(struct gl_texture_object *t, int level, { struct nouveau_surface *s = &to_nouveau_texture(t)->surfaces[level]; - return s->bo && s->width == ti->Width && - s->height == ti->Height && - s->format == ti->TexFormat; + return t->Target == GL_TEXTURE_RECTANGLE || + (s->bo && s->width == ti->Width && + s->height == ti->Height && + s->format == ti->TexFormat); } static GLboolean @@ -196,9 +194,12 @@ validate_teximage(GLcontext *ctx, struct gl_texture_object *t, struct nouveau_surface *ss = to_nouveau_texture(t)->surfaces; struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface; - context_drv(ctx)->surface_copy(ctx, &ss[level], s, - x, y, x, y, - width, height); + if (t->Target == GL_TEXTURE_RECTANGLE) + nouveau_surface_ref(s, &ss[level]); + else + context_drv(ctx)->surface_copy(ctx, &ss[level], s, + x, y, x, y, + width, height); return GL_TRUE; } @@ -223,7 +224,7 @@ relayout_texture(GLcontext *ctx, struct gl_texture_object *t) { struct gl_texture_image *base = t->Image[0][t->BaseLevel]; - if (base) { + if (base && t->Target != GL_TEXTURE_RECTANGLE) { struct nouveau_surface *ss = to_nouveau_texture(t)->surfaces; struct nouveau_surface *s = &to_nouveau_teximage(base)->surface; int i, ret, last = get_last_level(t); diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c index d80d99caa8..8e70c419ed 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_context.c +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c @@ -32,6 +32,11 @@ #include "nv04_driver.h" #include "nv10_driver.h" +static const struct dri_extension nv10_extensions[] = { + { "GL_EXT_texture_rectangle", NULL }, + { NULL, NULL } +}; + static void nv10_clear(GLcontext *ctx, GLbitfield buffers) { @@ -301,6 +306,8 @@ nv10_context_create(struct nouveau_screen *screen, const GLvisual *visual, if (!nouveau_context_init(ctx, screen, visual, share_ctx)) goto fail; + driInitExtensions(ctx, nv10_extensions, GL_FALSE); + /* GL constants. */ ctx->Const.MaxTextureLevels = 12; ctx->Const.MaxTextureCoordUnits = NV10_TEXTURE_UNITS; diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index d732a5335b..f45f6c949e 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -38,7 +38,7 @@ nv10_emit_tex_gen(GLcontext *ctx, int emit) } static uint32_t -get_tex_format(struct gl_texture_image *ti) +get_tex_format_pot(struct gl_texture_image *ti) { switch (ti->TexFormat) { case MESA_FORMAT_ARGB8888: @@ -67,6 +67,29 @@ get_tex_format(struct gl_texture_image *ti) } } +static uint32_t +get_tex_format_rect(struct gl_texture_image *ti) +{ + switch (ti->TexFormat) { + case MESA_FORMAT_ARGB1555: + return NV10TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT; + + case MESA_FORMAT_RGB565: + return NV10TCL_TX_FORMAT_FORMAT_R5G6B5_RECT; + + case MESA_FORMAT_ARGB8888: + return NV10TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT; + + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + return NV10TCL_TX_FORMAT_FORMAT_A8_RECT; + + default: + assert(0); + } +} + void nv10_emit_tex_obj(GLcontext *ctx, int emit) { @@ -98,7 +121,6 @@ nv10_emit_tex_obj(GLcontext *ctx, int emit) | nvgl_wrap_mode(t->WrapS) << 24 | ti->HeightLog2 << 20 | ti->WidthLog2 << 16 - | get_tex_format(ti) | 5 << 4 | 1 << 12; tx_filter = nvgl_filter_mode(t->MagFilter) << 28 @@ -107,6 +129,17 @@ nv10_emit_tex_obj(GLcontext *ctx, int emit) tx_enable = NV10TCL_TX_ENABLE_ENABLE | log2i(t->MaxAnisotropy) << 4; + if (t->Target == GL_TEXTURE_RECTANGLE) { + BEGIN_RING(chan, celsius, NV10TCL_TX_NPOT_PITCH(i), 1); + OUT_RING(chan, s->pitch << 16); + BEGIN_RING(chan, celsius, NV10TCL_TX_NPOT_SIZE(i), 1); + OUT_RING(chan, align(s->width, 2) << 16 | s->height); + + tx_format |= get_tex_format_rect(ti); + } else { + tx_format |= get_tex_format_pot(ti); + } + if (t->MinFilter != GL_NEAREST && t->MinFilter != GL_LINEAR) { int lod_min = t->MinLod; diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c index a80062f5f1..635b5c0996 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_context.c +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c @@ -31,6 +31,11 @@ #include "nv10_driver.h" #include "nv20_driver.h" +static const struct dri_extension nv20_extensions[] = { + { "GL_EXT_texture_rectangle", NULL }, + { NULL, NULL } +}; + static void nv20_hwctx_init(GLcontext *ctx) { @@ -394,6 +399,8 @@ nv20_context_create(struct nouveau_screen *screen, const GLvisual *visual, if (!nouveau_context_init(ctx, screen, visual, share_ctx)) goto fail; + driInitExtensions(ctx, nv20_extensions, GL_FALSE); + /* GL constants. */ ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS; ctx->Const.MaxTextureImageUnits = NV20_TEXTURE_UNITS; diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c index 2bf760d3b0..4627799809 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c @@ -33,7 +33,7 @@ #include "nv20_driver.h" static uint32_t -get_tex_format(struct gl_texture_image *ti) +get_tex_format_pot(struct gl_texture_image *ti) { switch (ti->TexFormat) { case MESA_FORMAT_ARGB8888: @@ -62,6 +62,34 @@ get_tex_format(struct gl_texture_image *ti) } } +static uint32_t +get_tex_format_rect(struct gl_texture_image *ti) +{ + switch (ti->TexFormat) { + case MESA_FORMAT_ARGB1555: + return NV20TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT; + + case MESA_FORMAT_RGB565: + return NV20TCL_TX_FORMAT_FORMAT_R5G6B5_RECT; + + case MESA_FORMAT_ARGB8888: + return NV20TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT; + + case MESA_FORMAT_L8: + return NV20TCL_TX_FORMAT_FORMAT_L8_RECT; + + case MESA_FORMAT_A8: + case MESA_FORMAT_I8: + return NV20TCL_TX_FORMAT_FORMAT_A8_RECT; + + case MESA_FORMAT_ARGB4444: + return NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT; + + default: + assert(0); + } +} + void nv20_emit_tex_obj(GLcontext *ctx, int emit) { @@ -94,7 +122,6 @@ nv20_emit_tex_obj(GLcontext *ctx, int emit) tx_format = ti->DepthLog2 << 28 | ti->HeightLog2 << 24 | ti->WidthLog2 << 20 - | get_tex_format(ti) | NV20TCL_TX_FORMAT_DIMS_2D | NV20TCL_TX_FORMAT_NO_BORDER | 1 << 16; @@ -109,6 +136,17 @@ nv20_emit_tex_obj(GLcontext *ctx, int emit) tx_enable = NV20TCL_TX_ENABLE_ENABLE | log2i(t->MaxAnisotropy) << 4; + if (t->Target == GL_TEXTURE_RECTANGLE) { + BEGIN_RING(chan, kelvin, NV20TCL_TX_NPOT_PITCH(i), 1); + OUT_RING(chan, s->pitch << 16); + BEGIN_RING(chan, kelvin, NV20TCL_TX_NPOT_SIZE(i), 1); + OUT_RING(chan, s->width << 16 | s->height); + + tx_format |= get_tex_format_rect(ti); + } else { + tx_format |= get_tex_format_pot(ti); + } + if (t->MinFilter != GL_NEAREST && t->MinFilter != GL_LINEAR) { int lod_min = t->MinLod; -- cgit v1.2.3 From 4a7e9b5df453055ed6eedce1ea5c1d4a2f810fa7 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 21 Feb 2010 14:23:40 +0100 Subject: dri/nouveau: Implement EXT_texture_from_pixmap. --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 91 +++++++++++++------------- src/mesa/drivers/dri/nouveau/nouveau_context.h | 13 ++-- src/mesa/drivers/dri/nouveau/nouveau_driver.c | 2 - src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 1 - src/mesa/drivers/dri/nouveau/nouveau_screen.c | 8 +++ src/mesa/drivers/dri/nouveau/nouveau_texture.c | 53 +++++++++++++++ src/mesa/drivers/dri/nouveau/nouveau_texture.h | 5 ++ 7 files changed, 116 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index b1b0e81643..2629733273 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -168,19 +168,19 @@ nouveau_context_destroy(__DRIcontext *dri_ctx) context_drv(ctx)->context_destroy(ctx); } -static void -nouveau_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, - unsigned int *stamp) +void +nouveau_update_renderbuffers(__DRIcontext *dri_ctx, __DRIdrawable *draw) { - struct nouveau_context *nctx = context->driverPrivate; - GLcontext *ctx = &nctx->base; - __DRIscreen *screen = context->driScreenPriv; - struct gl_framebuffer *fb = drawable->driverPrivate; + GLcontext *ctx = dri_ctx->driverPrivate; + __DRIscreen *screen = dri_ctx->driScreenPriv; + struct gl_framebuffer *fb = draw->driverPrivate; unsigned int attachments[10]; __DRIbuffer *buffers = NULL; int i = 0, count, ret; - *stamp = *drawable->pStamp; + if (draw->lastStamp == *draw->pStamp) + return; + draw->lastStamp = *draw->pStamp; attachments[i++] = __DRI_BUFFER_FRONT_LEFT; if (fb->Visual.doubleBufferMode) @@ -192,10 +192,9 @@ nouveau_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, else if (fb->Visual.haveStencilBuffer) attachments[i++] = __DRI_BUFFER_STENCIL; - buffers = (*screen->dri2.loader->getBuffers)(drawable, - &drawable->w, &drawable->h, + buffers = (*screen->dri2.loader->getBuffers)(draw, &draw->w, &draw->h, attachments, i, &count, - drawable->loaderPrivate); + draw->loaderPrivate); if (buffers == NULL) return; @@ -227,8 +226,8 @@ nouveau_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, rb = fb->Attachment[index].Renderbuffer; s = &to_nouveau_renderbuffer(rb)->surface; - s->width = drawable->w; - s->height = drawable->h; + s->width = draw->w; + s->height = draw->h; s->pitch = buffers[i].pitch; s->cpp = buffers[i].cpp; @@ -244,12 +243,25 @@ nouveau_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, ret = nouveau_bo_handle_ref(context_dev(ctx), buffers[i].name, &s->bo); assert(!ret); - - context_dirty(ctx, FRAMEBUFFER); } } - _mesa_resize_framebuffer(ctx, fb, drawable->w, drawable->h); + _mesa_resize_framebuffer(NULL, fb, draw->w, draw->h); +} + +static void +update_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable *draw, + int *stamp) +{ + GLcontext *ctx = dri_ctx->driverPrivate; + struct gl_framebuffer *fb = draw->driverPrivate; + + *stamp = *draw->pStamp; + + nouveau_update_renderbuffers(dri_ctx, draw); + _mesa_resize_framebuffer(ctx, fb, draw->w, draw->h); + + context_dirty(ctx, FRAMEBUFFER); } GLboolean @@ -260,16 +272,15 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw, struct nouveau_context *nctx = dri_ctx->driverPrivate; GLcontext *ctx = &nctx->base; - if (dri_draw->driverPrivate == ctx->WinSysDrawBuffer && - dri_read->driverPrivate == ctx->WinSysReadBuffer) - return GL_TRUE; - /* Ask the X server for new renderbuffers. */ - nouveau_update_renderbuffers(dri_ctx, dri_draw, - &nctx->drawable.d_stamp); - if (dri_draw != dri_read) - nouveau_update_renderbuffers(dri_ctx, dri_read, - &nctx->drawable.r_stamp); + if (dri_draw->driverPrivate != ctx->WinSysDrawBuffer) + update_framebuffer(dri_ctx, dri_draw, + &dri_ctx->dri2.draw_stamp); + + if (dri_draw != dri_read && + dri_read->driverPrivate != ctx->WinSysReadBuffer) + update_framebuffer(dri_ctx, dri_read, + &dri_ctx->dri2.read_stamp); /* Pass it down to mesa. */ _mesa_make_current(ctx, dri_draw->driverPrivate, @@ -307,30 +318,20 @@ nouveau_fallback(GLcontext *ctx, enum nouveau_fallback mode) void nouveau_validate_framebuffer(GLcontext *ctx) { - struct nouveau_context *nctx = to_nouveau_context(ctx); __DRIcontext *dri_ctx = to_nouveau_context(ctx)->dri_context; __DRIdrawable *dri_draw = dri_ctx->driDrawablePriv; __DRIdrawable *dri_read = dri_ctx->driReadablePriv; - if ((ctx->DrawBuffer->Name == 0 && - nctx->drawable.d_stamp != *dri_draw->pStamp) || - (dri_draw != dri_read && - ctx->ReadBuffer->Name == 0 && - nctx->drawable.r_stamp != *dri_read->pStamp)) { - if (nctx->drawable.dirty) - ctx->Driver.Flush(ctx); + if (ctx->DrawBuffer->Name == 0 && + dri_ctx->dri2.draw_stamp != *dri_draw->pStamp) + update_framebuffer(dri_ctx, dri_draw, + &dri_ctx->dri2.draw_stamp); - /* Ask the X server for new renderbuffers. */ - nouveau_update_renderbuffers(dri_ctx, dri_draw, - &nctx->drawable.d_stamp); - if (dri_draw != dri_read) - nouveau_update_renderbuffers(dri_ctx, dri_read, - &nctx->drawable.r_stamp); - - if (nouveau_next_dirty_state(ctx) >= 0) - FIRE_RING(context_chan(ctx)); - } + if (ctx->ReadBuffer->Name == 0 && dri_draw != dri_read && + dri_ctx->dri2.read_stamp != *dri_read->pStamp) + update_framebuffer(dri_ctx, dri_read, + &dri_ctx->dri2.read_stamp); - /* Someone's planning to draw something really soon. */ - nctx->drawable.dirty = GL_TRUE; + if (nouveau_next_dirty_state(ctx) >= 0) + FIRE_RING(context_chan(ctx)); } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h index efe3e5148b..682f8a414e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h @@ -56,12 +56,6 @@ struct nouveau_hw_state { struct nouveau_grobj *sifm; }; -struct nouveau_drawable_state { - GLboolean dirty; - unsigned int d_stamp; - unsigned int r_stamp; -}; - struct nouveau_context { GLcontext base; __DRIcontext *dri_context; @@ -73,7 +67,6 @@ struct nouveau_context { struct nouveau_hw_state hw; struct nouveau_bo_state bo; struct nouveau_render_state render; - struct nouveau_drawable_state drawable; }; #define to_nouveau_context(ctx) ((struct nouveau_context *)(ctx)) @@ -107,9 +100,11 @@ nouveau_context_deinit(GLcontext *ctx); void nouveau_context_destroy(__DRIcontext *dri_ctx); +void +nouveau_update_renderbuffers(__DRIcontext *dri_ctx, __DRIdrawable *draw); + GLboolean -nouveau_context_make_current(__DRIcontext *dri_ctx, - __DRIdrawable *ddraw, +nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *ddraw, __DRIdrawable *rdraw); GLboolean diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c index afaa8de5b3..1d12f43741 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c @@ -67,8 +67,6 @@ nouveau_flush(GLcontext *ctx) dri2->flushFrontBuffer(drawable, drawable->loaderPrivate); } - - nctx->drawable.dirty = GL_FALSE; } static void diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index c5fb0151b3..1db8c5dd8d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -142,7 +142,6 @@ nouveau_renderbuffer_dri_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; - context_dirty(ctx, FRAMEBUFFER); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index 71e57e17e6..18db12f626 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -27,6 +27,7 @@ #include "nouveau_driver.h" #include "nouveau_context.h" #include "nouveau_fbo.h" +#include "nouveau_texture.h" #include "nouveau_drmif.h" #include "nv04_driver.h" #include "nv10_driver.h" @@ -226,8 +227,15 @@ static const struct __DRI2flushExtensionRec nouveau_flush_extension = { dri2InvalidateDrawable, }; +static const struct __DRItexBufferExtensionRec nouveau_texbuffer_extension = { + { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, + NULL, + nouveau_set_texbuffer, +}; + static const __DRIextension *nouveau_screen_extensions[] = { &nouveau_flush_extension.base, + &nouveau_texbuffer_extension.base, NULL }; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 840bd6fe83..c1b0ddae7b 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -27,6 +27,7 @@ #include "nouveau_driver.h" #include "nouveau_context.h" #include "nouveau_texture.h" +#include "nouveau_fbo.h" #include "nouveau_util.h" #include "main/texobj.h" @@ -36,6 +37,7 @@ #include "main/texgetimage.h" #include "main/mipmap.h" #include "main/texfetch.h" +#include "main/teximage.h" static struct gl_texture_object * nouveau_texture_new(GLcontext *ctx, GLuint name, GLenum target) @@ -489,6 +491,57 @@ nouveau_bind_texture(GLcontext *ctx, GLenum target, context_dirty_i(ctx, TEX_ENV, ctx->Texture.CurrentUnit); } +static gl_format +get_texbuffer_format(struct gl_renderbuffer *rb, GLint format) +{ + struct nouveau_surface *s = &to_nouveau_renderbuffer(rb)->surface; + + if (s->cpp < 4) + return s->format; + else if (format == __DRI_TEXTURE_FORMAT_RGBA) + return MESA_FORMAT_ARGB8888; + else + return MESA_FORMAT_XRGB8888; +} + +void +nouveau_set_texbuffer(__DRIcontext *dri_ctx, + GLint target, GLint format, + __DRIdrawable *draw) +{ + struct nouveau_context *nctx = dri_ctx->driverPrivate; + GLcontext *ctx = &nctx->base; + struct gl_framebuffer *fb = draw->driverPrivate; + struct gl_renderbuffer *rb = + fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer; + struct gl_texture_object *t = _mesa_get_current_tex_object(ctx, target); + struct gl_texture_image *ti; + struct nouveau_surface *s; + + _mesa_lock_texture(ctx, t); + ti = _mesa_get_tex_image(ctx, t, target, 0); + s = &to_nouveau_teximage(ti)->surface; + + /* Update the texture surface with the given drawable. */ + nouveau_update_renderbuffers(dri_ctx, draw); + nouveau_surface_ref(&to_nouveau_renderbuffer(rb)->surface, s); + + /* Update the image fields. */ + _mesa_init_teximage_fields(ctx, target, ti, s->width, s->height, + 1, 0, s->cpp); + ti->RowStride = s->pitch / s->cpp; + ti->TexFormat = s->format = get_texbuffer_format(rb, format); + + /* Try to validate it. */ + if (!validate_teximage(ctx, t, 0, 0, 0, 0, s->width, s->height, 1)) + nouveau_texture_reallocate(ctx, t); + + context_dirty_i(ctx, TEX_OBJ, ctx->Texture.CurrentUnit); + context_dirty_i(ctx, TEX_ENV, ctx->Texture.CurrentUnit); + + _mesa_unlock_texture(ctx, t); +} + static void nouveau_texture_map(GLcontext *ctx, struct gl_texture_object *t) { diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.h b/src/mesa/drivers/dri/nouveau/nouveau_texture.h index 75d8190e88..b91facbdeb 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.h @@ -43,6 +43,11 @@ struct nouveau_texture { #define texture_dirty(t) \ to_nouveau_texture(t)->dirty = GL_TRUE; +void +nouveau_set_texbuffer(__DRIcontext *dri_ctx, + GLint target, GLint format, + __DRIdrawable *draw); + GLboolean nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t); -- cgit v1.2.3 From 59ddf8ca635465dea1d455c384f5905b65dc6979 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 23 Feb 2010 16:39:26 +0100 Subject: dri/nouveau: Use the hardware I8 format for intensity textures. --- src/mesa/drivers/dri/nouveau/nouveau_texture.c | 2 +- src/mesa/drivers/dri/nouveau/nv04_state_tex.c | 1 + src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 1 + src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index c1b0ddae7b..0947a2a95b 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -157,7 +157,7 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint internalFormat, case GL_INTENSITY12: case GL_INTENSITY16: case GL_INTENSITY8: - return MESA_FORMAT_ARGB8888; + return MESA_FORMAT_I8; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c index 684a19e703..facd41cff6 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c @@ -38,6 +38,7 @@ get_tex_format(struct gl_texture_image *ti) switch (ti->TexFormat) { case MESA_FORMAT_A8: case MESA_FORMAT_L8: + case MESA_FORMAT_I8: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_Y8; case MESA_FORMAT_ARGB1555: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A1R5G5B5; diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index f45f6c949e..7fe27317b2 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -54,6 +54,7 @@ get_tex_format_pot(struct gl_texture_image *ti) return NV10TCL_TX_FORMAT_FORMAT_R5G6B5; case MESA_FORMAT_A8: + case MESA_FORMAT_I8: return NV10TCL_TX_FORMAT_FORMAT_A8; case MESA_FORMAT_L8: diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c index 4627799809..7a5914d9b7 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c @@ -49,6 +49,7 @@ get_tex_format_pot(struct gl_texture_image *ti) return NV20TCL_TX_FORMAT_FORMAT_R5G6B5; case MESA_FORMAT_A8: + case MESA_FORMAT_I8: return NV20TCL_TX_FORMAT_FORMAT_A8; case MESA_FORMAT_L8: -- cgit v1.2.3 From 51e8a66fa197de7e17fb94d901a4cf26f0812670 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 25 Feb 2010 01:55:13 +0100 Subject: dri/nouveau: Use the XRGB8888 hardware texture format. --- src/mesa/drivers/dri/nouveau/nouveau_texture.c | 45 ++++++++++++++------------ src/mesa/drivers/dri/nouveau/nv04_state_tex.c | 2 ++ src/mesa/drivers/dri/nouveau/nv10_state_frag.c | 7 ++++ src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 4 +++ src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 18 +++++++---- 5 files changed, 49 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 0947a2a95b..bf365bfca3 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -108,40 +108,28 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case 4: case GL_RGBA: - case GL_RGB10_A2: + case GL_RGBA2: + case GL_RGBA4: + case GL_RGBA8: case GL_RGBA12: case GL_RGBA16: - case GL_RGBA8: + case GL_RGB10_A2: + return MESA_FORMAT_ARGB8888; + case GL_RGB5_A1: + return MESA_FORMAT_ARGB1555; + case GL_RGB: case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - return MESA_FORMAT_ARGB8888; - case GL_RGB5_A1: - return MESA_FORMAT_ARGB1555; - + return MESA_FORMAT_XRGB8888; case 3: case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: return MESA_FORMAT_RGB565; - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA12: - case GL_ALPHA16: - case GL_ALPHA8: - return MESA_FORMAT_A8; - - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - case GL_LUMINANCE8: - return MESA_FORMAT_L8; - case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: @@ -152,6 +140,21 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE8_ALPHA8: return MESA_FORMAT_ARGB8888; + case 1: + case GL_LUMINANCE: + case GL_LUMINANCE4: + case GL_LUMINANCE12: + case GL_LUMINANCE16: + case GL_LUMINANCE8: + return MESA_FORMAT_L8; + + case GL_ALPHA: + case GL_ALPHA4: + case GL_ALPHA12: + case GL_ALPHA16: + case GL_ALPHA8: + return MESA_FORMAT_A8; + case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY12: diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c index facd41cff6..6d8762b7d1 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c @@ -48,6 +48,8 @@ get_tex_format(struct gl_texture_image *ti) return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_R5G6B5; case MESA_FORMAT_ARGB8888: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A8R8G8B8; + case MESA_FORMAT_XRGB8888: + return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_X8R8G8B8; default: assert(0); } diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c index b56b4ff02c..76b95fdd51 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c @@ -179,6 +179,13 @@ get_input_arg(struct combiner_state *rc, int arg, int flags) return RC_IN_SOURCE(ZERO) | get_input_mapping(rc, operand, flags ^ INVERT); + + } else if (format == MESA_FORMAT_XRGB8888) { + /* Sometimes emulated using ARGB8888. */ + if (!is_color_operand(operand)) + return RC_IN_SOURCE(ZERO) | + get_input_mapping(rc, operand, + flags ^ INVERT); } } diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index 7fe27317b2..02a5ca797a 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -44,6 +44,9 @@ get_tex_format_pot(struct gl_texture_image *ti) case MESA_FORMAT_ARGB8888: return NV10TCL_TX_FORMAT_FORMAT_A8R8G8B8; + case MESA_FORMAT_XRGB8888: + return NV10TCL_TX_FORMAT_FORMAT_X8R8G8B8; + case MESA_FORMAT_ARGB1555: return NV10TCL_TX_FORMAT_FORMAT_A1R5G5B5; @@ -79,6 +82,7 @@ get_tex_format_rect(struct gl_texture_image *ti) return NV10TCL_TX_FORMAT_FORMAT_R5G6B5_RECT; case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: return NV10TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT; case MESA_FORMAT_A8: diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c index 7a5914d9b7..92870105f9 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c @@ -45,6 +45,9 @@ get_tex_format_pot(struct gl_texture_image *ti) case MESA_FORMAT_ARGB4444: return NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4; + case MESA_FORMAT_XRGB8888: + return NV20TCL_TX_FORMAT_FORMAT_X8R8G8B8; + case MESA_FORMAT_RGB565: return NV20TCL_TX_FORMAT_FORMAT_R5G6B5; @@ -67,15 +70,21 @@ static uint32_t get_tex_format_rect(struct gl_texture_image *ti) { switch (ti->TexFormat) { + case MESA_FORMAT_ARGB8888: + return NV20TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT; + case MESA_FORMAT_ARGB1555: return NV20TCL_TX_FORMAT_FORMAT_A1R5G5B5_RECT; + case MESA_FORMAT_ARGB4444: + return NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT; + + case MESA_FORMAT_XRGB8888: + return NV20TCL_TX_FORMAT_FORMAT_R8G8B8_RECT; + case MESA_FORMAT_RGB565: return NV20TCL_TX_FORMAT_FORMAT_R5G6B5_RECT; - case MESA_FORMAT_ARGB8888: - return NV20TCL_TX_FORMAT_FORMAT_A8R8G8B8_RECT; - case MESA_FORMAT_L8: return NV20TCL_TX_FORMAT_FORMAT_L8_RECT; @@ -83,9 +92,6 @@ get_tex_format_rect(struct gl_texture_image *ti) case MESA_FORMAT_I8: return NV20TCL_TX_FORMAT_FORMAT_A8_RECT; - case MESA_FORMAT_ARGB4444: - return NV20TCL_TX_FORMAT_FORMAT_A4R4G4B4_RECT; - default: assert(0); } -- cgit v1.2.3 From 554a8f4026459406e7d3ed4e7017a88a57492ddf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Nov 2009 11:28:47 -0800 Subject: intel: Start adding defines and some bits for sandybridge bringup. --- src/mesa/drivers/dri/i965/brw_draw.c | 4 ++ src/mesa/drivers/dri/i965/brw_state_upload.c | 96 ++++++++++++++++++++++++++-- src/mesa/drivers/dri/intel/intel_blit.c | 14 ++++ src/mesa/drivers/dri/intel/intel_chipset.h | 14 +++- src/mesa/drivers/dri/intel/intel_clear.c | 6 ++ src/mesa/drivers/dri/intel/intel_context.c | 4 +- 6 files changed, 130 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index e348d4686b..106cd31632 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -124,6 +124,10 @@ static void brw_emit_prim(struct brw_context *brw, struct brw_3d_primitive prim_packet; struct intel_context *intel = &brw->intel; + /* Last thing to hook up in the pipeline when brw_state_upload.c is done. */ + if (IS_GEN6(intel->intelScreen->deviceID)) + return; + if (INTEL_DEBUG & DEBUG_PRIMS) printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode), prim->start, prim->count); diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 4f477cfc6b..1ee4f4ab80 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -35,8 +35,15 @@ #include "brw_state.h" #include "intel_batchbuffer.h" #include "intel_buffers.h" +#include "intel_chipset.h" -static const struct brw_tracked_state *atoms[] = +/* This is used to initialize brw->state.atoms[]. We could use this + * list directly except for a single atom, brw_constant_buffer, which + * has a .dirty value which changes according to the parameters of the + * current fragment and vertex programs, and so cannot be a static + * value. + */ +static const struct brw_tracked_state *gen4_atoms[] = { &brw_check_fallback, @@ -95,6 +102,66 @@ static const struct brw_tracked_state *atoms[] = &brw_constant_buffer }; +const struct brw_tracked_state *gen6_atoms[] = +{ + &brw_check_fallback, + +#if 0 + &brw_wm_input_sizes, + &brw_vs_prog, + &brw_gs_prog, + &brw_clip_prog, + &brw_sf_prog, + &brw_wm_prog, + + /* Once all the programs are done, we know how large urb entry + * sizes need to be and can decide if we need to change the urb + * layout. + */ + &brw_curbe_offsets, + &brw_recalculate_urb_fence, + + &brw_cc_vp, + &brw_cc_unit, + + &brw_vs_surfaces, /* must do before unit */ + &brw_wm_constant_surface, /* must do before wm surfaces/bind bo */ + &brw_wm_surfaces, /* must do before samplers and unit */ + &brw_wm_samplers, + + &brw_wm_unit, + &brw_sf_vp, + &brw_sf_unit, + &brw_vs_unit, /* always required, enabled or not */ + &brw_clip_unit, + &brw_gs_unit, + + /* Command packets: + */ + &brw_invarient_state, + &brw_state_base_address, + + &brw_binding_table_pointers, + &brw_blend_constant_color, + + &brw_depthbuffer, + + &brw_polygon_stipple, + &brw_polygon_stipple_offset, + + &brw_line_stipple, + &brw_aa_line_parameters, + + &brw_psp_urb_cbs, + + &brw_drawing_rect, + &brw_indices, + &brw_index_buffer, + &brw_vertices, + + &brw_constant_buffer +#endif +}; void brw_init_state( struct brw_context *brw ) { @@ -270,6 +337,8 @@ void brw_validate_state( struct brw_context *brw ) struct intel_context *intel = &brw->intel; struct brw_state_flags *state = &brw->state.dirty; GLuint i; + const struct brw_tracked_state **atoms; + int num_atoms; brw_clear_validated_bos(brw); @@ -278,6 +347,14 @@ void brw_validate_state( struct brw_context *brw ) brw_add_validated_bo(brw, intel->batch->buf); + if (IS_GEN6(intel->intelScreen->deviceID)) { + atoms = gen6_atoms; + num_atoms = ARRAY_SIZE(gen6_atoms); + } else { + atoms = gen4_atoms; + num_atoms = ARRAY_SIZE(gen4_atoms); + } + if (brw->emit_state_always) { state->mesa |= ~0; state->brw |= ~0; @@ -305,7 +382,7 @@ void brw_validate_state( struct brw_context *brw ) brw->intel.Fallback = GL_FALSE; /* boolean, not bitfield */ /* do prepare stage for all atoms */ - for (i = 0; i < Elements(atoms); i++) { + for (i = 0; i < num_atoms; i++) { const struct brw_tracked_state *atom = atoms[i]; if (brw->intel.Fallback) @@ -337,9 +414,20 @@ void brw_validate_state( struct brw_context *brw ) void brw_upload_state(struct brw_context *brw) { + struct intel_context *intel = &brw->intel; struct brw_state_flags *state = &brw->state.dirty; int i; static int dirty_count = 0; + const struct brw_tracked_state **atoms; + int num_atoms; + + if (IS_GEN6(intel->intelScreen->deviceID)) { + atoms = gen6_atoms; + num_atoms = ARRAY_SIZE(gen6_atoms); + } else { + atoms = gen4_atoms; + num_atoms = ARRAY_SIZE(gen4_atoms); + } brw_clear_validated_bos(brw); @@ -352,7 +440,7 @@ void brw_upload_state(struct brw_context *brw) memset(&examined, 0, sizeof(examined)); prev = *state; - for (i = 0; i < Elements(atoms); i++) { + for (i = 0; i < num_atoms; i++) { const struct brw_tracked_state *atom = atoms[i]; struct brw_state_flags generated; @@ -381,7 +469,7 @@ void brw_upload_state(struct brw_context *brw) } } else { - for (i = 0; i < Elements(atoms); i++) { + for (i = 0; i < num_atoms; i++) { const struct brw_tracked_state *atom = atoms[i]; if (brw->intel.Fallback) diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 5a60a17500..196a64a47a 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -89,6 +89,10 @@ intelEmitCopyBlit(struct intel_context *intel, dri_bo *aper_array[3]; BATCH_LOCALS; + /* Blits are in a different ringbuffer so we don't use them. */ + if (intel->gen >= 6) + return GL_FALSE; + if (dst_tiling != I915_TILING_NONE) { if (dst_offset & 4095) return GL_FALSE; @@ -218,6 +222,9 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) GLint cx, cy, cw, ch; BATCH_LOCALS; + /* Blits are in a different ringbuffer so we don't use them. */ + assert(intel->gen < 6); + /* * Compute values for clearing the buffers. */ @@ -388,6 +395,10 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, int dwords = ALIGN(src_size, 8) / 4; uint32_t opcode, br13, blit_cmd; + /* Blits are in a different ringbuffer so we don't use them. */ + if (intel->gen >= 6) + return GL_FALSE; + if (dst_tiling != I915_TILING_NONE) { if (dst_offset & 4095) return GL_FALSE; @@ -473,6 +484,9 @@ intel_emit_linear_blit(struct intel_context *intel, { GLuint pitch, height; + /* Blits are in a different ringbuffer so we don't use them. */ + assert(intel->gen < 6); + /* The pitch is a signed value. */ pitch = MIN2(size, (1 << 15) - 1); height = size / pitch; diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h index 3dc8653a73..a0b2266925 100644 --- a/src/mesa/drivers/dri/intel/intel_chipset.h +++ b/src/mesa/drivers/dri/intel/intel_chipset.h @@ -1,4 +1,4 @@ -/* + /* * Copyright © 2007 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a @@ -71,6 +71,8 @@ #define PCI_CHIP_ILD_G 0x0042 #define PCI_CHIP_ILM_G 0x0046 +#define PCI_CHIP_SANDYBRIDGE 0x0102 + #define IS_MOBILE(devid) (devid == PCI_CHIP_I855_GM || \ devid == PCI_CHIP_I915_GM || \ devid == PCI_CHIP_I945_GM || \ @@ -104,14 +106,20 @@ devid == PCI_CHIP_Q33_G || \ devid == PCI_CHIP_Q35_G || IS_IGD(devid)) -#define IS_965(devid) (devid == PCI_CHIP_I965_G || \ +#define IS_GEN4(devid) (devid == PCI_CHIP_I965_G || \ devid == PCI_CHIP_I965_Q || \ devid == PCI_CHIP_I965_G_1 || \ devid == PCI_CHIP_I965_GM || \ devid == PCI_CHIP_I965_GME || \ devid == PCI_CHIP_I946_GZ || \ + IS_G4X(devid)) + +#define IS_GEN6(devid) (devid == PCI_CHIP_SANDYBRIDGE) + +#define IS_965(devid) (IS_GEN4(devid) || \ IS_G4X(devid) || \ - IS_IGDNG(devid)) + IS_IGDNG(devid) || \ + IS_GEN6(devid)) #define IS_9XX(devid) (IS_915(devid) || \ IS_945(devid) || \ diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index ca78681538..03b24e2b51 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -133,6 +133,12 @@ intelClear(GLcontext *ctx, GLbitfield mask) } } + if (intel->gen >= 6) { + /* Blits are in a different ringbuffer so we don't use them. */ + tri_mask |= blit_mask; + blit_mask = 0; + } + /* SW fallback clearing */ swrast_mask = mask & ~tri_mask & ~blit_mask; diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index de063d51c9..8af7a23385 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -610,7 +610,9 @@ intelInitContext(struct intel_context *intel, intel->driContext = driContextPriv; intel->driFd = sPriv->fd; - if (IS_965(intel->intelScreen->deviceID)) { + if (IS_GEN6(intel->intelScreen->deviceID)) { + intel->gen = 6; + } else if (IS_965(intel->intelScreen->deviceID)) { intel->gen = 4; } else if (IS_9XX(intel->intelScreen->deviceID)) { intel->gen = 3; -- cgit v1.2.3 From 719f2b1d8570aa58b970bd28941221ee6c34af9b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Nov 2009 13:19:30 -0800 Subject: i965: Set up sandybridge depthbuffer. --- src/mesa/drivers/dri/i965/brw_misc_state.c | 21 ++++++++++++++++++--- src/mesa/drivers/dri/i965/brw_state_upload.c | 2 ++ src/mesa/drivers/dri/intel/intel_decode.c | 4 +++- 3 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index f708ee0063..d6eb6162df 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -209,7 +209,14 @@ static void emit_depthbuffer(struct brw_context *brw) { struct intel_context *intel = &brw->intel; struct intel_region *region = brw->state.depth_region; - unsigned int len = (intel->is_g4x || intel->is_ironlake) ? 6 : 5; + unsigned int len; + + if (intel->gen >= 6) + len = 7; + else if (intel->is_g4x || intel->is_ironlake) + len = 6; + else + len = 5; if (region == NULL) { BEGIN_BATCH(len); @@ -220,9 +227,12 @@ static void emit_depthbuffer(struct brw_context *brw) OUT_BATCH(0); OUT_BATCH(0); - if (intel->is_g4x || intel->is_ironlake) + if (intel->is_g4x || intel->is_ironlake || intel->gen >= 6) OUT_BATCH(0); + if (intel->gen >= 6) + OUT_BATCH(0); + ADVANCE_BATCH(); } else { unsigned int format; @@ -243,6 +253,8 @@ static void emit_depthbuffer(struct brw_context *brw) } assert(region->tiling != I915_TILING_X); + if (IS_GEN6(intel->intelScreen->deviceID)) + assert(region->tiling != I915_TILING_NONE); BEGIN_BATCH(len); OUT_BATCH(CMD_DEPTH_BUFFER << 16 | (len - 2)); @@ -259,9 +271,12 @@ static void emit_depthbuffer(struct brw_context *brw) ((region->height - 1) << 19)); OUT_BATCH(0); - if (intel->is_g4x || intel->is_ironlake) + if (intel->is_g4x || intel->is_ironlake || intel->gen >= 6) OUT_BATCH(0); + if (intel->gen >= 6) + OUT_BATCH(0); + ADVANCE_BATCH(); } } diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 1ee4f4ab80..4c12e68c0e 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -143,9 +143,11 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_binding_table_pointers, &brw_blend_constant_color, +#endif &brw_depthbuffer, +#if 0 &brw_polygon_stipple, &brw_polygon_stipple_offset, diff --git a/src/mesa/drivers/dri/intel/intel_decode.c b/src/mesa/drivers/dri/intel/intel_decode.c index a9dfe281cb..c3112d980a 100644 --- a/src/mesa/drivers/dri/intel/intel_decode.c +++ b/src/mesa/drivers/dri/intel/intel_decode.c @@ -1592,7 +1592,7 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, int *failures) return len; case 0x7905: - if (len != 5 && len != 6) + if (len < 5 || len > 7) fprintf(out, "Bad count in 3DSTATE_DEPTH_BUFFER\n"); if (count < len) BUFFER_FAIL(count, len, "3DSTATE_DEPTH_BUFFER"); @@ -1611,6 +1611,8 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, int *failures) instr_out(data, hw_offset, 4, "volume depth\n"); if (len == 6) instr_out(data, hw_offset, 5, "\n"); + if (len == 7) + instr_out(data, hw_offset, 6, "render target view extent\n"); return len; -- cgit v1.2.3 From 0b9932ffde3f7228288717302b43aa01df0b5fa0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Nov 2009 13:41:22 -0800 Subject: i965: Update WM surface state setup for sandybridge's new BLEND_STATE. --- src/mesa/drivers/dri/i965/brw_state_upload.c | 2 ++ src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 39 +++++++++++++----------- 2 files changed, 24 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 4c12e68c0e..afa940962f 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -124,9 +124,11 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_cc_vp, &brw_cc_unit, +#endif &brw_vs_surfaces, /* must do before unit */ &brw_wm_constant_surface, /* must do before wm surfaces/bind bo */ &brw_wm_surfaces, /* must do before samplers and unit */ +#if 0 &brw_wm_samplers, &brw_wm_unit, diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 1db438ae7b..a42067611c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -509,7 +509,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, struct gl_renderbuffer *rb, unsigned int unit) { - struct intel_context *intel = &brw->intel;; + struct intel_context *intel = &brw->intel; GLcontext *ctx = &intel->ctx; dri_bo *region_bo = NULL; struct intel_renderbuffer *irb = intel_renderbuffer(rb); @@ -576,18 +576,21 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.draw_x = 0; key.draw_y = 0; } - /* _NEW_COLOR */ - memcpy(key.color_mask, ctx->Color.ColorMask[unit], - sizeof(key.color_mask)); - /* As mentioned above, disable writes to the alpha component when the - * renderbuffer is XRGB. - */ - if (ctx->DrawBuffer->Visual.alphaBits == 0) - key.color_mask[3] = GL_FALSE; + if (intel->gen < 6) { + /* _NEW_COLOR */ + memcpy(key.color_mask, ctx->Color.ColorMask[unit], + sizeof(key.color_mask)); + + /* As mentioned above, disable writes to the alpha component when the + * renderbuffer is XRGB. + */ + if (ctx->DrawBuffer->Visual.alphaBits == 0) + key.color_mask[3] = GL_FALSE; - key.color_blend = (!ctx->Color._LogicOpEnabled && - (ctx->Color.BlendEnabled & (1 << unit))); + key.color_blend = (!ctx->Color._LogicOpEnabled && + (ctx->Color.BlendEnabled & (1 << unit))); + } dri_bo_unreference(brw->wm.surf_bo[unit]); brw->wm.surf_bo[unit] = brw_search_cache(&brw->surface_cache, @@ -639,12 +642,14 @@ brw_update_renderbuffer_surface(struct brw_context *brw, brw_set_surface_tiling(&surf, key.tiling); surf.ss3.pitch = (key.pitch * key.cpp) - 1; - /* _NEW_COLOR */ - surf.ss0.color_blend = key.color_blend; - surf.ss0.writedisable_red = !key.color_mask[0]; - surf.ss0.writedisable_green = !key.color_mask[1]; - surf.ss0.writedisable_blue = !key.color_mask[2]; - surf.ss0.writedisable_alpha = !key.color_mask[3]; + if (intel->gen < 6) { + /* _NEW_COLOR */ + surf.ss0.color_blend = key.color_blend; + surf.ss0.writedisable_red = !key.color_mask[0]; + surf.ss0.writedisable_green = !key.color_mask[1]; + surf.ss0.writedisable_blue = !key.color_mask[2]; + surf.ss0.writedisable_alpha = !key.color_mask[3]; + } /* Key size will never match key size for textures, so we're safe. */ brw->wm.surf_bo[unit] = brw_upload_cache(&brw->surface_cache, -- cgit v1.2.3 From 9dce60f35b25f4f5605b22d75447bac5d9f55515 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Nov 2009 14:02:24 -0800 Subject: i965: Set up sandybridge binding table pointers but don't enable it yet. It hangs the GPU at the clipper stage, presumably because we're lacking other setup. --- src/mesa/drivers/dri/i965/brw_defines.h | 3 +++ src/mesa/drivers/dri/i965/brw_misc_state.c | 35 ++++++++++++++++++++++++++++++ src/mesa/drivers/dri/i965/brw_state.h | 1 + 3 files changed, 39 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index ea0d7e05d4..afdc5a1d85 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -778,6 +778,9 @@ #define CMD_PIPELINED_STATE_POINTERS 0x7800 #define CMD_BINDING_TABLE_PTRS 0x7801 +# define GEN6_BINDING_TABLE_MODIFY_VS (1 << 8) +# define GEN6_BINDING_TABLE_MODIFY_GS (1 << 9) +# define GEN6_BINDING_TABLE_MODIFY_PS (1 << 10) #define CMD_VERTEX_BUFFER 0x7808 # define BRW_VB0_INDEX_SHIFT 27 diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index d6eb6162df..7d9e793ff2 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -136,6 +136,41 @@ const struct brw_tracked_state brw_binding_table_pointers = { .emit = upload_binding_table_pointers, }; +/** + * Upload the binding table pointers, which point each stage's array of surface + * state pointers. + * + * The binding table pointers are relative to the surface state base address, + * which is 0. + */ +static void upload_gen6_binding_table_pointers(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + BEGIN_BATCH(4); + OUT_BATCH(CMD_BINDING_TABLE_PTRS << 16 | + GEN6_BINDING_TABLE_MODIFY_VS | + GEN6_BINDING_TABLE_MODIFY_GS | + GEN6_BINDING_TABLE_MODIFY_PS | + (4 - 2)); + if (brw->vs.bind_bo != NULL) + OUT_RELOC(brw->vs.bind_bo, I915_GEM_DOMAIN_SAMPLER, 0, 0); /* vs */ + else + OUT_BATCH(0); + OUT_BATCH(0); /* gs */ + OUT_RELOC(brw->wm.bind_bo, I915_GEM_DOMAIN_SAMPLER, 0, 0); /* wm/ps */ + ADVANCE_BATCH(); +} + +const struct brw_tracked_state gen6_binding_table_pointers = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_BATCH, + .cache = CACHE_NEW_SURF_BIND, + }, + .prepare = prepare_binding_table_pointers, + .emit = upload_gen6_binding_table_pointers, +}; /** * Upload pointers to the per-stage state. diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 536fe8b249..a24a02100c 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -90,6 +90,7 @@ const struct brw_tracked_state brw_drawing_rect; const struct brw_tracked_state brw_indices; const struct brw_tracked_state brw_vertices; const struct brw_tracked_state brw_index_buffer; +const struct brw_tracked_state gen6_binding_table_pointers; /** * Use same key for WM and VS surfaces. -- cgit v1.2.3 From 7ee590424c974cb10882e9c4664a6024595fc9de Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 29 Jan 2010 11:18:26 -0800 Subject: i965: Start adding support for the Sandybridge CC unit. --- src/mesa/drivers/dri/i965/Makefile | 4 +- src/mesa/drivers/dri/i965/brw_context.h | 15 +- src/mesa/drivers/dri/i965/brw_defines.h | 1 + src/mesa/drivers/dri/i965/brw_state.h | 4 + src/mesa/drivers/dri/i965/brw_state_cache.c | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 7 +- src/mesa/drivers/dri/i965/brw_structs.h | 100 ++++++++- src/mesa/drivers/dri/i965/gen6_cc.c | 296 ++++++++++++++++++++++++++ src/mesa/drivers/dri/i965/gen6_depthstencil.c | 169 +++++++++++++++ 9 files changed, 592 insertions(+), 5 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_cc.c create mode 100644 src/mesa/drivers/dri/i965/gen6_depthstencil.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 7758a792fd..7ce794d3aa 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -84,7 +84,9 @@ DRIVER_SOURCES = \ brw_wm_pass2.c \ brw_wm_sampler_state.c \ brw_wm_state.c \ - brw_wm_surface_state.c + brw_wm_surface_state.c \ + gen6_cc.c \ + gen6_depthstencil.c C_SOURCES = \ $(COMMON_SOURCES) \ diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 21c4cd38a7..ea89d4f6fa 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -282,6 +282,9 @@ struct brw_vs_ouput_sizes { enum brw_cache_id { + BRW_BLEND_STATE, + BRW_DEPTH_STENCIL_STATE, + BRW_COLOR_CALC_STATE, BRW_CC_VP, BRW_CC_UNIT, BRW_WM_PROG, @@ -354,6 +357,9 @@ struct brw_tracked_state { /* Flags for brw->state.cache. */ +#define CACHE_NEW_BLEND_STATE (1< + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "intel_batchbuffer.h" +#include "main/macros.h" +#include "main/enums.h" + +struct brw_blend_state_key { + GLboolean color_blend, alpha_enabled; + + GLenum logic_op; + + GLenum blend_eq_rgb, blend_eq_a; + GLenum blend_src_rgb, blend_src_a; + GLenum blend_dst_rgb, blend_dst_a; + + GLenum alpha_func; + + GLboolean dither; +}; + +static void +blend_state_populate_key(struct brw_context *brw, + struct brw_blend_state_key *key) +{ + GLcontext *ctx = &brw->intel.ctx; + + memset(key, 0, sizeof(*key)); + + /* _NEW_COLOR */ + if (ctx->Color._LogicOpEnabled) + key->logic_op = ctx->Color.LogicOp; + else + key->logic_op = GL_COPY; + + /* _NEW_COLOR */ + key->color_blend = ctx->Color.BlendEnabled; + if (key->color_blend) { + key->blend_eq_rgb = ctx->Color.BlendEquationRGB; + key->blend_eq_a = ctx->Color.BlendEquationA; + key->blend_src_rgb = ctx->Color.BlendSrcRGB; + key->blend_dst_rgb = ctx->Color.BlendDstRGB; + key->blend_src_a = ctx->Color.BlendSrcA; + key->blend_dst_a = ctx->Color.BlendDstA; + } + + /* _NEW_COLOR */ + key->alpha_enabled = ctx->Color.AlphaEnabled; + if (key->alpha_enabled) { + key->alpha_func = ctx->Color.AlphaFunc; + } + + /* _NEW_COLOR */ + key->dither = ctx->Color.DitherFlag; +} + +/** + * Creates the state cache entry for the given CC unit key. + */ +static drm_intel_bo * +blend_state_create_from_key(struct brw_context *brw, + struct brw_blend_state_key *key) +{ + struct gen6_blend_state blend; + drm_intel_bo *bo; + + memset(&blend, 0, sizeof(blend)); + + if (key->logic_op != GL_COPY) { + blend.blend1.logic_op_enable = 1; + blend.blend1.logic_op_func = intel_translate_logic_op(key->logic_op); + } else if (key->color_blend) { + GLenum eqRGB = key->blend_eq_rgb; + GLenum eqA = key->blend_eq_a; + GLenum srcRGB = key->blend_src_rgb; + GLenum dstRGB = key->blend_dst_rgb; + GLenum srcA = key->blend_src_a; + GLenum dstA = key->blend_dst_a; + + if (eqRGB == GL_MIN || eqRGB == GL_MAX) { + srcRGB = dstRGB = GL_ONE; + } + + if (eqA == GL_MIN || eqA == GL_MAX) { + srcA = dstA = GL_ONE; + } + + blend.blend0.dest_blend_factor = brw_translate_blend_factor(dstRGB); + blend.blend0.source_blend_factor = brw_translate_blend_factor(srcRGB); + blend.blend0.blend_func = brw_translate_blend_equation(eqRGB); + + blend.blend0.ia_dest_blend_factor = brw_translate_blend_factor(dstA); + blend.blend0.ia_source_blend_factor = brw_translate_blend_factor(srcA); + blend.blend0.ia_blend_func = brw_translate_blend_equation(eqA); + + blend.blend0.blend_enable = 1; + blend.blend0.ia_blend_enable = (srcA != srcRGB || + dstA != dstRGB || + eqA != eqRGB); + } + + if (key->alpha_enabled) { + blend.blend1.alpha_test_enable = 1; + blend.blend1.alpha_test_func = intel_translate_compare_func(key->alpha_func); + + } + + if (key->dither) { + blend.blend1.dither_enable = 1; + blend.blend1.y_dither_offset = 0; + blend.blend1.x_dither_offset = 0; + } + + bo = brw_upload_cache(&brw->cache, BRW_BLEND_STATE, + key, sizeof(*key), + NULL, 0, + &blend, sizeof(blend)); + + return bo; +} + +static void +prepare_blend_state(struct brw_context *brw) +{ + struct brw_blend_state_key key; + + blend_state_populate_key(brw, &key); + + drm_intel_bo_unreference(brw->cc.blend_state_bo); + brw->cc.blend_state_bo = brw_search_cache(&brw->cache, BRW_BLEND_STATE, + &key, sizeof(key), + NULL, 0, + NULL); + + if (brw->cc.blend_state_bo == NULL) + brw->cc.blend_state_bo = blend_state_create_from_key(brw, &key); +} + +const struct brw_tracked_state gen6_blend_state = { + .dirty = { + .mesa = _NEW_COLOR, + .brw = 0, + .cache = 0, + }, + .prepare = prepare_blend_state, +}; + +struct brw_color_calc_state_key { + GLubyte blend_constant_color[4]; + GLclampf alpha_ref; + GLubyte stencil_ref[2]; +}; + +static void +color_calc_state_populate_key(struct brw_context *brw, + struct brw_color_calc_state_key *key) +{ + GLcontext *ctx = &brw->intel.ctx; + + memset(key, 0, sizeof(*key)); + + /* _NEW_STENCIL */ + if (ctx->Stencil._Enabled) { + const unsigned back = ctx->Stencil._BackFace; + + key->stencil_ref[0] = ctx->Stencil.Ref[0]; + if (ctx->Stencil._TestTwoSide) + key->stencil_ref[1] = ctx->Stencil.Ref[back]; + } + + /* _NEW_COLOR */ + if (ctx->Color.AlphaEnabled) + key->alpha_ref = ctx->Color.AlphaRef; + + key->blend_constant_color[0] = ctx->Color.BlendColor[0]; + key->blend_constant_color[1] = ctx->Color.BlendColor[1]; + key->blend_constant_color[2] = ctx->Color.BlendColor[2]; + key->blend_constant_color[3] = ctx->Color.BlendColor[3]; +} + +/** + * Creates the state cache entry for the given CC state key. + */ +static drm_intel_bo * +color_calc_state_create_from_key(struct brw_context *brw, + struct brw_color_calc_state_key *key) +{ + struct gen6_color_calc_state cc; + drm_intel_bo *bo; + + memset(&cc, 0, sizeof(cc)); + + cc.cc0.alpha_test_format = BRW_ALPHATEST_FORMAT_UNORM8; + UNCLAMPED_FLOAT_TO_UBYTE(cc.cc1.alpha_ref_fi.ui, key->alpha_ref); + + cc.cc0.stencil_ref = key->stencil_ref[0]; + cc.cc0.bf_stencil_ref = key->stencil_ref[1]; + + cc.constant_r = key->blend_constant_color[0]; + cc.constant_g = key->blend_constant_color[1]; + cc.constant_b = key->blend_constant_color[2]; + cc.constant_a = key->blend_constant_color[3]; + + bo = brw_upload_cache(&brw->cache, BRW_COLOR_CALC_STATE, + key, sizeof(*key), + NULL, 0, + &cc, sizeof(cc)); + + return bo; +} + +static void +prepare_color_calc_state(struct brw_context *brw) +{ + struct brw_color_calc_state_key key; + + color_calc_state_populate_key(brw, &key); + + drm_intel_bo_unreference(brw->cc.state_bo); + brw->cc.state_bo = brw_search_cache(&brw->cache, BRW_COLOR_CALC_STATE, + &key, sizeof(key), + NULL, 0, + NULL); + + if (brw->cc.state_bo == NULL) + brw->cc.state_bo = color_calc_state_create_from_key(brw, &key); +} + +const struct brw_tracked_state gen6_color_calc_state = { + .dirty = { + .mesa = _NEW_COLOR, + .brw = 0, + .cache = 0, + }, + .prepare = prepare_color_calc_state, +}; + +static void upload_cc_state_pointers(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + BEGIN_BATCH(4); + OUT_BATCH(CMD_3D_CC_STATE_POINTERS << 16 | (4 - 2)); + OUT_RELOC(brw->cc.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + OUT_RELOC(brw->cc.blend_state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + OUT_RELOC(brw->cc.depth_stencil_state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + ADVANCE_BATCH(); +} + + +static void prepare_cc_state_pointers(struct brw_context *brw) +{ + brw_add_validated_bo(brw, brw->cc.state_bo); + brw_add_validated_bo(brw, brw->cc.blend_state_bo); + brw_add_validated_bo(brw, brw->cc.depth_stencil_state_bo); +} + +const struct brw_tracked_state gen6_cc_state_pointers = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_BATCH, + .cache = (CACHE_NEW_BLEND_STATE | + CACHE_NEW_COLOR_CALC_STATE | + CACHE_NEW_DEPTH_STENCIL_STATE) + }, + .prepare = prepare_cc_state_pointers, + .emit = upload_cc_state_pointers, +}; diff --git a/src/mesa/drivers/dri/i965/gen6_depthstencil.c b/src/mesa/drivers/dri/i965/gen6_depthstencil.c new file mode 100644 index 0000000000..960927164c --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_depthstencil.c @@ -0,0 +1,169 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "main/macros.h" +#include "main/enums.h" + +struct brw_depth_stencil_state_key { + GLenum depth_func; + GLboolean depth_test, depth_write; + GLboolean stencil, stencil_two_side; + GLenum stencil_func[2], stencil_fail_op[2]; + GLenum stencil_pass_depth_fail_op[2], stencil_pass_depth_pass_op[2]; + GLubyte stencil_write_mask[2], stencil_test_mask[2]; +}; + +static void +depth_stencil_state_populate_key(struct brw_context *brw, + struct brw_depth_stencil_state_key *key) +{ + GLcontext *ctx = &brw->intel.ctx; + const unsigned back = ctx->Stencil._BackFace; + + memset(key, 0, sizeof(*key)); + + /* _NEW_STENCIL */ + key->stencil = ctx->Stencil._Enabled; + key->stencil_two_side = ctx->Stencil._TestTwoSide; + + if (key->stencil) { + key->stencil_func[0] = ctx->Stencil.Function[0]; + key->stencil_fail_op[0] = ctx->Stencil.FailFunc[0]; + key->stencil_pass_depth_fail_op[0] = ctx->Stencil.ZFailFunc[0]; + key->stencil_pass_depth_pass_op[0] = ctx->Stencil.ZPassFunc[0]; + key->stencil_write_mask[0] = ctx->Stencil.WriteMask[0]; + key->stencil_test_mask[0] = ctx->Stencil.ValueMask[0]; + } + if (key->stencil_two_side) { + key->stencil_func[1] = ctx->Stencil.Function[back]; + key->stencil_fail_op[1] = ctx->Stencil.FailFunc[back]; + key->stencil_pass_depth_fail_op[1] = ctx->Stencil.ZFailFunc[back]; + key->stencil_pass_depth_pass_op[1] = ctx->Stencil.ZPassFunc[back]; + key->stencil_write_mask[1] = ctx->Stencil.WriteMask[back]; + key->stencil_test_mask[1] = ctx->Stencil.ValueMask[back]; + } + + key->depth_test = ctx->Depth.Test; + if (key->depth_test) { + key->depth_func = ctx->Depth.Func; + key->depth_write = ctx->Depth.Mask; + } +} + +/** + * Creates the state cache entry for the given DEPTH_STENCIL_STATE state key. + */ +static dri_bo * +depth_stencil_state_create_from_key(struct brw_context *brw, + struct brw_depth_stencil_state_key *key) +{ + struct gen6_depth_stencil_state ds; + dri_bo *bo; + + memset(&ds, 0, sizeof(ds)); + + /* _NEW_STENCIL */ + if (key->stencil) { + ds.ds0.stencil_enable = 1; + ds.ds0.stencil_func = + intel_translate_compare_func(key->stencil_func[0]); + ds.ds0.stencil_fail_op = + intel_translate_stencil_op(key->stencil_fail_op[0]); + ds.ds0.stencil_pass_depth_fail_op = + intel_translate_stencil_op(key->stencil_pass_depth_fail_op[0]); + ds.ds0.stencil_pass_depth_pass_op = + intel_translate_stencil_op(key->stencil_pass_depth_pass_op[0]); + ds.ds1.stencil_write_mask = key->stencil_write_mask[0]; + ds.ds1.stencil_test_mask = key->stencil_test_mask[0]; + + if (key->stencil_two_side) { + ds.ds0.bf_stencil_enable = 1; + ds.ds0.bf_stencil_func = + intel_translate_compare_func(key->stencil_func[1]); + ds.ds0.bf_stencil_fail_op = + intel_translate_stencil_op(key->stencil_fail_op[1]); + ds.ds0.bf_stencil_pass_depth_fail_op = + intel_translate_stencil_op(key->stencil_pass_depth_fail_op[1]); + ds.ds0.bf_stencil_pass_depth_pass_op = + intel_translate_stencil_op(key->stencil_pass_depth_pass_op[1]); + ds.ds1.bf_stencil_write_mask = key->stencil_write_mask[1]; + ds.ds1.bf_stencil_test_mask = key->stencil_test_mask[1]; + } + + /* Not really sure about this: + */ + if (key->stencil_write_mask[0] || + (key->stencil_two_side && key->stencil_write_mask[1])) + ds.ds0.stencil_write_enable = 1; + } + + /* _NEW_DEPTH */ + if (key->depth_test) { + ds.ds2.depth_test_enable = 1; + ds.ds2.depth_test_func = intel_translate_compare_func(key->depth_func); + ds.ds2.depth_write_enable = key->depth_write; + } + + bo = brw_upload_cache(&brw->cache, BRW_DEPTH_STENCIL_STATE, + key, sizeof(*key), + NULL, 0, + &ds, sizeof(ds)); + + return bo; +} + +static void +prepare_depth_stencil_state(struct brw_context *brw) +{ + struct brw_depth_stencil_state_key key; + + depth_stencil_state_populate_key(brw, &key); + + dri_bo_unreference(brw->cc.depth_stencil_state_bo); + brw->cc.depth_stencil_state_bo = brw_search_cache(&brw->cache, + BRW_DEPTH_STENCIL_STATE, + &key, sizeof(key), + NULL, 0, + NULL); + + if (brw->cc.depth_stencil_state_bo == NULL) + brw->cc.depth_stencil_state_bo = + depth_stencil_state_create_from_key(brw, &key); +} + +const struct brw_tracked_state gen6_depth_stencil_state = { + .dirty = { + .mesa = _NEW_DEPTH | _NEW_STENCIL, + .brw = 0, + .cache = 0, + }, + .prepare = prepare_depth_stencil_state, +}; -- cgit v1.2.3 From ba882d7827e5526e99c9d5c453d56c5e029c7476 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 16 Nov 2009 14:50:23 -0800 Subject: i965: Add untested Sandybridge passthrough VS setup. --- src/mesa/drivers/dri/i965/Makefile | 3 +- src/mesa/drivers/dri/i965/brw_defines.h | 23 ++++++++- src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 3 +- src/mesa/drivers/dri/i965/gen6_vs_state.c | 75 ++++++++++++++++++++++++++++ 5 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_vs_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 7ce794d3aa..d21c921db3 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -86,7 +86,8 @@ DRIVER_SOURCES = \ brw_wm_state.c \ brw_wm_surface_state.c \ gen6_cc.c \ - gen6_depthstencil.c + gen6_depthstencil.c \ + gen6_vs_state.c C_SOURCES = \ $(COMMON_SOURCES) \ diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 5d3b0a8b7a..7a7bcc4e79 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -807,10 +807,29 @@ # define BRW_VE1_COMPONENT_3_SHIFT 16 # define BRW_VE1_DST_OFFSET_SHIFT 0 -#define CMD_3D_CC_STATE_POINTERS 0x780e /* GEN6+ */ #define CMD_INDEX_BUFFER 0x780a -#define CMD_VF_STATISTICS_965 0x780b +#define CMD_VF_STATISTICS_965 0x780b #define CMD_VF_STATISTICS_GM45 0x680b +#define CMD_3D_CC_STATE_POINTERS 0x780e /* GEN6+ */ + +#define CMD_3D_VS_STATE 0x7810 /* GEN6+ */ +# define GEN6_VS_SPF_MODE (1 << 31) +# define GEN6_VS_VECTOR_MASK_ENABLE (1 << 30) +# define GEN6_VS_SAMPLER_COUNT_SHIFT 27 +# define GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 +# define GEN6_VS_DISPATCH_START_GRF_SHIFT 20 +# define GEN6_VS_URB_READ_LENGTH_SHIFT 11 +# define GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT 0 +# define GEN6_VS_MAX_THREADS_SHIFT 25 +# define GEN6_VS_STATISTICS_ENABLE (1 << 10) +# define GEN6_VS_CACHE_DISABLE (1 << 1) +# define GEN6_VS_ENABLE (1 << 0) + +#define CMD_3D_CONSTANT_VS_STATE 0x7815 /* GEN6+ */ +# define GEN6_VS_BUFFER_3_ENABLE (1 << 15) +# define GEN6_VS_BUFFER_2_ENABLE (1 << 14) +# define GEN6_VS_BUFFER_1_ENABLE (1 << 13) +# define GEN6_VS_BUFFER_0_ENABLE (1 << 12) #define CMD_DRAW_RECT 0x7900 #define CMD_BLEND_CONSTANT_COLOR 0x7901 diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 5112cd8016..5066fe151b 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -95,6 +95,7 @@ const struct brw_tracked_state gen6_blend_state; const struct brw_tracked_state gen6_cc_state_pointers; const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; +const struct brw_tracked_state gen6_vs_state; /** * Use same key for WM and VS surfaces. diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index ed9e18f33c..b4b086dec4 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -132,13 +132,14 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_vs_surfaces, /* must do before unit */ &brw_wm_constant_surface, /* must do before wm surfaces/bind bo */ &brw_wm_surfaces, /* must do before samplers and unit */ + + &gen6_vs_state, #if 0 &brw_wm_samplers, &brw_wm_unit, &brw_sf_vp, &brw_sf_unit, - &brw_vs_unit, /* always required, enabled or not */ &brw_clip_unit, &brw_gs_unit, diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c new file mode 100644 index 0000000000..4caabf32b0 --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -0,0 +1,75 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "main/macros.h" +#include "main/enums.h" +#include "intel_batchbuffer.h" + +static void +upload_vs_state(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + BEGIN_BATCH(6); + OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2)); + OUT_BATCH(0); /* prog_bo */ + /* OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); */ + OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) | + (brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); + OUT_BATCH(0); /* scratch space base offset */ + OUT_BATCH((1 << GEN6_VS_DISPATCH_START_GRF_SHIFT) | + (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | + (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); + OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) | + GEN6_VS_STATISTICS_ENABLE); + ADVANCE_BATCH(); + + /* Disable all the constant buffers. */ + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_VS_STATE | (5 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); +} + +const struct brw_tracked_state gen6_vs_state = { + .dirty = { + .mesa = _NEW_TRANSFORM, + .brw = (BRW_NEW_CURBE_OFFSETS | + BRW_NEW_NR_VS_SURFACES | + BRW_NEW_URB_FENCE | + BRW_NEW_CONTEXT), + .cache = CACHE_NEW_VS_PROG + }, + .emit = upload_vs_state, +}; -- cgit v1.2.3 From 520b64ddfb4c2efa742bc2217fef96fdec5eea9b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 26 Nov 2009 22:03:43 -0800 Subject: i965: Add untested passthrough GS setup. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/brw_defines.h | 29 +++++++++-- src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- src/mesa/drivers/dri/i965/gen6_gs_state.c | 74 ++++++++++++++++++++++++++++ 5 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_gs_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index d21c921db3..fb7ee096d9 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -87,6 +87,7 @@ DRIVER_SOURCES = \ brw_wm_surface_state.c \ gen6_cc.c \ gen6_depthstencil.c \ + gen6_gs_state.c \ gen6_vs_state.c C_SOURCES = \ diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 7a7bcc4e79..7ba1c77ebe 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -813,11 +813,13 @@ #define CMD_3D_CC_STATE_POINTERS 0x780e /* GEN6+ */ #define CMD_3D_VS_STATE 0x7810 /* GEN6+ */ +/* DW2 */ # define GEN6_VS_SPF_MODE (1 << 31) # define GEN6_VS_VECTOR_MASK_ENABLE (1 << 30) # define GEN6_VS_SAMPLER_COUNT_SHIFT 27 # define GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 # define GEN6_VS_DISPATCH_START_GRF_SHIFT 20 +/* DW4 */ # define GEN6_VS_URB_READ_LENGTH_SHIFT 11 # define GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT 0 # define GEN6_VS_MAX_THREADS_SHIFT 25 @@ -825,11 +827,30 @@ # define GEN6_VS_CACHE_DISABLE (1 << 1) # define GEN6_VS_ENABLE (1 << 0) +#define CMD_3D_GS_STATE 0x7811 /* GEN6+ */ +/* DW2 */ +# define GEN6_GS_SPF_MODE (1 << 31) +# define GEN6_GS_VECTOR_MASK_ENABLE (1 << 30) +# define GEN6_GS_SAMPLER_COUNT_SHIFT 27 +# define GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 +# define GEN6_GS_DISPATCH_START_GRF_SHIFT 20 +/* DW4 */ +# define GEN6_GS_URB_READ_LENGTH_SHIFT 11 +# define GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT 0 +/* DW5 */ +# define GEN6_GS_MAX_THREADS_SHIFT 25 +# define GEN6_GS_STATISTICS_ENABLE (1 << 10) +# define GEN6_GS_SO_STATISTICS_ENABLE (1 << 9) +# define GEN6_GS_RENDERING_ENABLE (1 << 8) +/* DW6 */ +# define GEN6_GS_ENABLE (1 << 15) + #define CMD_3D_CONSTANT_VS_STATE 0x7815 /* GEN6+ */ -# define GEN6_VS_BUFFER_3_ENABLE (1 << 15) -# define GEN6_VS_BUFFER_2_ENABLE (1 << 14) -# define GEN6_VS_BUFFER_1_ENABLE (1 << 13) -# define GEN6_VS_BUFFER_0_ENABLE (1 << 12) +#define CMD_3D_CONSTANT_GS_STATE 0x7816 /* GEN6+ */ +# define GEN6_CONSTANT_BUFFER_3_ENABLE (1 << 15) +# define GEN6_CONSTANT_BUFFER_2_ENABLE (1 << 14) +# define GEN6_CONSTANT_BUFFER_1_ENABLE (1 << 13) +# define GEN6_CONSTANT_BUFFER_0_ENABLE (1 << 12) #define CMD_DRAW_RECT 0x7900 #define CMD_BLEND_CONSTANT_COLOR 0x7901 diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 5066fe151b..c4d1f2556c 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -95,6 +95,7 @@ const struct brw_tracked_state gen6_blend_state; const struct brw_tracked_state gen6_cc_state_pointers; const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; +const struct brw_tracked_state gen6_gs_state; const struct brw_tracked_state gen6_vs_state; /** diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index b4b086dec4..dd797c42dd 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -134,6 +134,7 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_surfaces, /* must do before samplers and unit */ &gen6_vs_state, + &gen6_gs_state, #if 0 &brw_wm_samplers, @@ -141,7 +142,6 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_sf_vp, &brw_sf_unit, &brw_clip_unit, - &brw_gs_unit, /* Command packets: */ diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c new file mode 100644 index 0000000000..3a16bd368c --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -0,0 +1,74 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "main/macros.h" +#include "main/enums.h" +#include "intel_batchbuffer.h" + +static void +upload_gs_state(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + BEGIN_BATCH(6); + OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2)); + OUT_BATCH(0); /* prog_bo */ + /* OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); */ + OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | + (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); + OUT_BATCH(0); /* scratch space base offset */ + OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) | + (brw->gs.prog_data->urb_read_length << GEN6_GS_URB_READ_LENGTH_SHIFT) | + (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); + OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | + GEN6_GS_STATISTICS_ENABLE); + ADVANCE_BATCH(); + + /* Disable all the constant buffers. */ + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_GS_STATE << 16 | (5 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); +} + +const struct brw_tracked_state gen6_gs_state = { + .dirty = { + .mesa = _NEW_TRANSFORM, + .brw = (BRW_NEW_CURBE_OFFSETS | + BRW_NEW_URB_FENCE | + BRW_NEW_CONTEXT), + .cache = CACHE_NEW_GS_PROG + }, + .emit = upload_gs_state, +}; -- cgit v1.2.3 From f58fbcf7618bcc6ef9da8e8939100b14ea4d584b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 29 Jan 2010 11:12:18 -0800 Subject: i965: Add untested REJECT_ALL clip state. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/brw_defines.h | 21 ++++++++ src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 3 +- src/mesa/drivers/dri/i965/gen6_clip_state.c | 76 ++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_clip_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index fb7ee096d9..3bf14e8a77 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -86,6 +86,7 @@ DRIVER_SOURCES = \ brw_wm_state.c \ brw_wm_surface_state.c \ gen6_cc.c \ + gen6_clip_state.c \ gen6_depthstencil.c \ gen6_gs_state.c \ gen6_vs_state.c diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 7ba1c77ebe..52960da682 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -845,6 +845,27 @@ /* DW6 */ # define GEN6_GS_ENABLE (1 << 15) +#define CMD_3D_CLIP_STATE 0x7812 /* GEN6+ */ +/* DW1 */ +# define GEN6_CLIP_STATISTICS_ENABLE (1 << 10) +/* DW2 */ +# define GEN6_CLIP_ENABLE (1 << 31) +# define GEN6_CLIP_API_OGL (1 << 30) +# define GEN6_CLIP_XY_TEST (1 << 28) +# define GEN6_CLIP_Z_TEST (1 << 27) +# define GEN6_CLIP_GB_TEST (1 << 26) +# define GEN6_CLIP_MODE_NORMAL (0 << 13) +# define GEN6_CLIP_MODE_REJECT_ALL (3 << 13) +# define GEN6_CLIP_MODE_ACCEPT_ALL (4 << 13) +# define GEN6_CLIP_PERSPECTIVE_DIVIDE_DISABLE (1 << 9) +# define GEN6_CLIP_BARYCENTRIC_ENABLE (1 << 8) +# define GEN6_CLIP_TRI_PROVOKE_SHIFT 4 +# define GEN6_CLIP_LINE_PROVOKE_SHIFT 2 +# define GEN6_CLIP_TRIFAN_PROVOKE_SHIFT 0 +/* DW3 */ +# define GEN6_CLIP_MIN_POINT_WIDTH_SHIFT 17 +# define GEN6_CLIP_MAX_POINT_WIDTH_SHIFT 6 + #define CMD_3D_CONSTANT_VS_STATE 0x7815 /* GEN6+ */ #define CMD_3D_CONSTANT_GS_STATE 0x7816 /* GEN6+ */ # define GEN6_CONSTANT_BUFFER_3_ENABLE (1 << 15) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index c4d1f2556c..596a9cd3a0 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -93,6 +93,7 @@ const struct brw_tracked_state brw_index_buffer; const struct brw_tracked_state gen6_binding_table_pointers; const struct brw_tracked_state gen6_blend_state; const struct brw_tracked_state gen6_cc_state_pointers; +const struct brw_tracked_state gen6_clip_state; const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; const struct brw_tracked_state gen6_gs_state; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index dd797c42dd..9f5d789e1e 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -110,7 +110,6 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_input_sizes, &brw_vs_prog, &brw_gs_prog, - &brw_clip_prog, &brw_sf_prog, &brw_wm_prog, @@ -135,13 +134,13 @@ const struct brw_tracked_state *gen6_atoms[] = &gen6_vs_state, &gen6_gs_state, + &gen6_clip_state, #if 0 &brw_wm_samplers, &brw_wm_unit, &brw_sf_vp, &brw_sf_unit, - &brw_clip_unit, /* Command packets: */ diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c new file mode 100644 index 0000000000..f34e5f32cc --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -0,0 +1,76 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "main/macros.h" +#include "main/enums.h" +#include "intel_batchbuffer.h" + +static void +upload_clip_state(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + GLcontext *ctx = &intel->ctx; + uint32_t depth_clamp = 0; + uint32_t provoking; + + if (!ctx->Transform.DepthClamp) + depth_clamp = GEN6_CLIP_Z_TEST; + + if (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION) { + provoking = 0; + } else { + provoking = + (2 << GEN6_CLIP_TRI_PROVOKE_SHIFT) | + (2 << GEN6_CLIP_TRIFAN_PROVOKE_SHIFT) | + (1 << GEN6_CLIP_LINE_PROVOKE_SHIFT); + } + + BEGIN_BATCH(4); + OUT_BATCH(CMD_3D_CLIP_STATE << 16 | (4 - 2)); + OUT_BATCH(0); + OUT_BATCH(GEN6_CLIP_ENABLE | + GEN6_CLIP_API_OGL | + GEN6_CLIP_MODE_REJECT_ALL | /* XXX: debug: get VS working */ + GEN6_CLIP_XY_TEST | + depth_clamp | + provoking); + OUT_BATCH(0); + ADVANCE_BATCH(); +} + +const struct brw_tracked_state gen6_clip_state = { + .dirty = { + .mesa = _NEW_TRANSFORM, + .brw = BRW_NEW_CONTEXT, + .cache = 0 + }, + .emit = upload_clip_state, +}; -- cgit v1.2.3 From 98f9666f04eed9ae873fdea20c4c4b9db6cead84 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 15:04:37 -0800 Subject: i965: Get vp-tri batchbuffers running (no rendering). --- src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- src/mesa/drivers/dri/i965/gen6_gs_state.c | 40 +++++++++++++++++++--------- src/mesa/drivers/dri/i965/gen6_vs_state.c | 3 +-- 3 files changed, 29 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 9f5d789e1e..f5446ed73b 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -106,10 +106,10 @@ const struct brw_tracked_state *gen6_atoms[] = { &brw_check_fallback, -#if 0 &brw_wm_input_sizes, &brw_vs_prog, &brw_gs_prog, +#if 0 &brw_sf_prog, &brw_wm_prog, diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 3a16bd368c..31da0dc088 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -38,19 +38,33 @@ upload_gs_state(struct brw_context *brw) { struct intel_context *intel = &brw->intel; - BEGIN_BATCH(6); - OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2)); - OUT_BATCH(0); /* prog_bo */ - /* OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); */ - OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | - (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); - OUT_BATCH(0); /* scratch space base offset */ - OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) | - (brw->gs.prog_data->urb_read_length << GEN6_GS_URB_READ_LENGTH_SHIFT) | - (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); - OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | - GEN6_GS_STATISTICS_ENABLE); - ADVANCE_BATCH(); + if (brw->gs.prog_bo) { + BEGIN_BATCH(6); + OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2)); + OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | + (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); + OUT_BATCH(0); /* scratch space base offset */ + OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) | + (brw->gs.prog_data->urb_read_length << GEN6_GS_URB_READ_LENGTH_SHIFT) | + (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); + OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | + GEN6_GS_STATISTICS_ENABLE); + ADVANCE_BATCH(); + } else { + BEGIN_BATCH(6); + OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2)); + OUT_BATCH(0); /* prog_bo */ + OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | + (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); + OUT_BATCH(0); /* scratch space base offset */ + OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) | + (0 << GEN6_GS_URB_READ_LENGTH_SHIFT) | + (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); + OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | + GEN6_GS_STATISTICS_ENABLE); + ADVANCE_BATCH(); + } /* Disable all the constant buffers. */ BEGIN_BATCH(5); diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 4caabf32b0..d82319afa7 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -40,8 +40,7 @@ upload_vs_state(struct brw_context *brw) BEGIN_BATCH(6); OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2)); - OUT_BATCH(0); /* prog_bo */ - /* OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); */ + OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) | (brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); OUT_BATCH(0); /* scratch space base offset */ -- cgit v1.2.3 From eda1b50aa10031aeb07071f59fed93304b2fe2ca Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 15:06:08 -0800 Subject: i965: Try turning on the VS. --- src/mesa/drivers/dri/i965/gen6_vs_state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index d82319afa7..098a1d0b57 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -46,7 +46,8 @@ upload_vs_state(struct brw_context *brw) OUT_BATCH(0); /* scratch space base offset */ OUT_BATCH((1 << GEN6_VS_DISPATCH_START_GRF_SHIFT) | (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | - (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); + (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT) | + GEN6_VS_ENABLE); OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) | GEN6_VS_STATISTICS_ENABLE); ADVANCE_BATCH(); -- cgit v1.2.3 From 8485e100b81d5cf44cde7af0c7feb79a32bf3dd0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 15:20:06 -0800 Subject: i965: Try uploading SNB VS constants. --- src/mesa/drivers/dri/i965/gen6_vs_state.c | 61 ++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 098a1d0b57..d33b2b4d7d 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -31,12 +31,20 @@ #include "brw_util.h" #include "main/macros.h" #include "main/enums.h" +#include "shader/prog_parameter.h" +#include "shader/prog_statevars.h" #include "intel_batchbuffer.h" static void upload_vs_state(struct brw_context *brw) { struct intel_context *intel = &brw->intel; + GLcontext *ctx = &intel->ctx; + const struct brw_vertex_program *vp = + brw_vertex_program_const(brw->vertex_program); + unsigned int nr_params = vp->program.Base.Parameters->NumParameters; + drm_intel_bo *constant_bo; + int i; BEGIN_BATCH(6); OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2)); @@ -52,19 +60,54 @@ upload_vs_state(struct brw_context *brw) GEN6_VS_STATISTICS_ENABLE); ADVANCE_BATCH(); - /* Disable all the constant buffers. */ - BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_VS_STATE | (5 - 2)); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); + if (vp->use_const_buffer || nr_params == 0) { + /* Disable the push constant buffers. */ + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_VS_STATE << 16 | (5 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } else { + if (brw->vertex_program->IsNVProgram) + _mesa_load_tracked_matrices(ctx); + + /* Updates the ParamaterValues[i] pointers for all parameters of the + * basic type of PROGRAM_STATE_VAR. + */ + _mesa_load_state_parameters(ctx, vp->program.Base.Parameters); + + constant_bo = drm_intel_bo_alloc(intel->bufmgr, "VS constant_bo", + nr_params * 4 * sizeof(float), + 4096); + intel_bo_map_gtt_preferred(intel, constant_bo, GL_TRUE); + for (i = 0; i < nr_params; i++) { + memcpy((char *)constant_bo->virtual + i * 4 * sizeof(float), + vp->program.Base.Parameters->ParameterValues[i], + 4 * sizeof(float)); + } + intel_bo_unmap_gtt_preferred(intel, constant_bo); + + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_VS_STATE << 16 | + GEN6_CONSTANT_BUFFER_0_ENABLE | + (5 - 2)); + OUT_RELOC(constant_bo, + I915_GEM_DOMAIN_RENDER, 0, /* XXX: bad domain */ + ALIGN(nr_params, 2) / 2 - 1); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + + drm_intel_bo_unreference(constant_bo); + } } const struct brw_tracked_state gen6_vs_state = { .dirty = { - .mesa = _NEW_TRANSFORM, + .mesa = _NEW_TRANSFORM | _NEW_PROGRAM_CONSTANTS, .brw = (BRW_NEW_CURBE_OFFSETS | BRW_NEW_NR_VS_SURFACES | BRW_NEW_URB_FENCE | -- cgit v1.2.3 From 0da50fa67009535577dc84dde21672db5ec45134 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 15:44:29 -0800 Subject: i965: Try sending prims down the pipeline. Now things catch on fire. --- src/mesa/drivers/dri/i965/brw_draw.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 106cd31632..e348d4686b 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -124,10 +124,6 @@ static void brw_emit_prim(struct brw_context *brw, struct brw_3d_primitive prim_packet; struct intel_context *intel = &brw->intel; - /* Last thing to hook up in the pipeline when brw_state_upload.c is done. */ - if (IS_GEN6(intel->intelScreen->deviceID)) - return; - if (INTEL_DEBUG & DEBUG_PRIMS) printf("PRIM: %s %d %d\n", _mesa_lookup_enum_by_nr(prim->mode), prim->start, prim->count); -- cgit v1.2.3 From c9dc6d425e645f2988118ff51cabe167a0cd3971 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 17:08:32 -0800 Subject: i965: Set up the SNB URB. even with vs disabled, still doesn't work. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/brw_context.h | 3 +- src/mesa/drivers/dri/i965/brw_defines.h | 6 +++ src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- src/mesa/drivers/dri/i965/gen6_urb.c | 81 ++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_urb.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 3bf14e8a77..35093f014b 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -89,6 +89,7 @@ DRIVER_SOURCES = \ gen6_clip_state.c \ gen6_depthstencil.c \ gen6_gs_state.c \ + gen6_urb.c \ gen6_vs_state.c C_SOURCES = \ diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index ea89d4f6fa..c4b68ca05b 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -544,7 +544,8 @@ struct brw_context GLuint nr_sf_entries; GLuint nr_cs_entries; -/* GLuint vs_size; */ + /* gen6 */ + GLuint vs_size; /* GLuint gs_size; */ /* GLuint clip_size; */ /* GLuint sf_size; */ diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 52960da682..08eb2b2d91 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -812,6 +812,12 @@ #define CMD_VF_STATISTICS_GM45 0x680b #define CMD_3D_CC_STATE_POINTERS 0x780e /* GEN6+ */ +#define CMD_URB 0x7805 /* GEN6+ */ +# define GEN6_URB_VS_SIZE_SHIFT 16 +# define GEN6_URB_VS_ENTRIES_SHIFT 0 +# define GEN6_URB_GS_SIZE_SHIFT 8 +# define GEN6_URB_GS_ENTRIES_SHIFT 0 + #define CMD_3D_VS_STATE 0x7810 /* GEN6+ */ /* DW2 */ # define GEN6_VS_SPF_MODE (1 << 31) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 596a9cd3a0..11489d477c 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -97,6 +97,7 @@ const struct brw_tracked_state gen6_clip_state; const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; const struct brw_tracked_state gen6_gs_state; +const struct brw_tracked_state gen6_urb; const struct brw_tracked_state gen6_vs_state; /** diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index f5446ed73b..fc30e60087 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -118,11 +118,11 @@ const struct brw_tracked_state *gen6_atoms[] = * layout. */ &brw_curbe_offsets, - &brw_recalculate_urb_fence, &brw_cc_vp, #endif + &gen6_urb, &gen6_blend_state, /* must do before cc unit */ &gen6_color_calc_state, /* must do before cc unit */ &gen6_depth_stencil_state, /* must do before cc unit */ diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c new file mode 100644 index 0000000000..dea0aa7100 --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_urb.c @@ -0,0 +1,81 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "main/macros.h" +#include "intel_batchbuffer.h" +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" + +static void +prepare_urb( struct brw_context *brw ) +{ + brw->urb.nr_vs_entries = 24; + if (brw->gs.prog_bo) + brw->urb.nr_gs_entries = 4; + else + brw->urb.nr_gs_entries = 0; + /* CACHE_NEW_VS_PROG */ + brw->urb.vs_size = MIN2(brw->vs.prog_data->urb_entry_size, 1); + + /* Check that the number of URB rows (8 floats each) allocated is less + * than the URB space. + */ + assert((brw->urb.nr_vs_entries + + brw->urb.nr_gs_entries) * brw->urb.vs_size * 8 < 64 * 1024); +} + +static void +upload_urb(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + assert(brw->urb.nr_vs_entries % 4 == 0); + assert(brw->urb.nr_gs_entries % 4 == 0); + /* GS requirement */ + assert(!brw->gs.prog_bo || brw->urb.vs_size < 5); + + intel_batchbuffer_emit_mi_flush(intel->batch); + + BEGIN_BATCH(3); + OUT_BATCH(CMD_URB << 16 | (3 - 2)); + OUT_BATCH(((brw->urb.vs_size - 1) << GEN6_URB_VS_SIZE_SHIFT) | + ((brw->urb.nr_vs_entries) << GEN6_URB_VS_SIZE_SHIFT)); + OUT_BATCH(((brw->urb.vs_size - 1) << GEN6_URB_GS_SIZE_SHIFT) | + ((brw->urb.nr_gs_entries) << GEN6_URB_GS_SIZE_SHIFT)); + ADVANCE_BATCH(); +} + +const struct brw_tracked_state gen6_urb = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_CONTEXT, + .cache = CACHE_NEW_VS_PROG, + }, + .prepare = prepare_urb, + .emit = upload_urb, +}; -- cgit v1.2.3 From ff3997904ab988824e744fdbecde6eb79d9bf40f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 16:53:07 -0800 Subject: i965: Reconnect the index/vertex setup. --- src/mesa/drivers/dri/i965/brw_defines.h | 5 ++++ src/mesa/drivers/dri/i965/brw_draw_upload.c | 42 +++++++++++++++++++++------- src/mesa/drivers/dri/i965/brw_state_upload.c | 5 ++-- src/mesa/drivers/dri/i965/gen6_vs_state.c | 3 +- 4 files changed, 40 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 08eb2b2d91..e280c2ee4e 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -784,14 +784,19 @@ #define CMD_VERTEX_BUFFER 0x7808 # define BRW_VB0_INDEX_SHIFT 27 +# define GEN6_VB0_INDEX_SHIFT 26 # define BRW_VB0_ACCESS_VERTEXDATA (0 << 26) # define BRW_VB0_ACCESS_INSTANCEDATA (1 << 26) +# define GEN6_VB0_ACCESS_VERTEXDATA (0 << 20) +# define GEN6_VB0_ACCESS_INSTANCEDATA (1 << 20) # define BRW_VB0_PITCH_SHIFT 0 #define CMD_VERTEX_ELEMENT 0x7809 # define BRW_VE0_INDEX_SHIFT 27 +# define GEN6_VE0_INDEX_SHIFT 26 # define BRW_VE0_FORMAT_SHIFT 16 # define BRW_VE0_VALID (1 << 26) +# define GEN6_VE0_VALID (1 << 25) # define BRW_VE0_SRC_OFFSET_SHIFT 0 # define BRW_VE1_COMPONENT_NOSTORE 0 # define BRW_VE1_COMPONENT_STORE_SRC 1 diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 106454de4a..e6bfc567af 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -503,10 +503,17 @@ static void brw_emit_vertices(struct brw_context *brw) if (brw->vb.nr_enabled == 0) { BEGIN_BATCH(3); OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | 1); - OUT_BATCH((0 << BRW_VE0_INDEX_SHIFT) | - BRW_VE0_VALID | - (BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) | - (0 << BRW_VE0_SRC_OFFSET_SHIFT)); + if (IS_GEN6(intel->intelScreen->deviceID)) { + OUT_BATCH((0 << GEN6_VE0_INDEX_SHIFT) | + GEN6_VE0_VALID | + (BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) | + (0 << BRW_VE0_SRC_OFFSET_SHIFT)); + } else { + OUT_BATCH((0 << BRW_VE0_INDEX_SHIFT) | + BRW_VE0_VALID | + (BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) | + (0 << BRW_VE0_SRC_OFFSET_SHIFT)); + } OUT_BATCH((BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_0_SHIFT) | (BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_1_SHIFT) | (BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_2_SHIFT) | @@ -527,9 +534,17 @@ static void brw_emit_vertices(struct brw_context *brw) for (i = 0; i < brw->vb.nr_enabled; i++) { struct brw_vertex_element *input = brw->vb.enabled[i]; + uint32_t dw0; - OUT_BATCH((i << BRW_VB0_INDEX_SHIFT) | - BRW_VB0_ACCESS_VERTEXDATA | + if (IS_GEN6(intel->intelScreen->deviceID)) { + dw0 = GEN6_VB0_ACCESS_VERTEXDATA | + (i << GEN6_VB0_INDEX_SHIFT); + } else { + dw0 = BRW_VB0_ACCESS_VERTEXDATA | + (i << BRW_VB0_INDEX_SHIFT); + } + + OUT_BATCH(dw0 | (input->stride << BRW_VB0_PITCH_SHIFT)); OUT_RELOC(input->bo, I915_GEM_DOMAIN_VERTEX, 0, @@ -565,10 +580,17 @@ static void brw_emit_vertices(struct brw_context *brw) break; } - OUT_BATCH((i << BRW_VE0_INDEX_SHIFT) | - BRW_VE0_VALID | - (format << BRW_VE0_FORMAT_SHIFT) | - (0 << BRW_VE0_SRC_OFFSET_SHIFT)); + if (IS_GEN6(intel->intelScreen->deviceID)) { + OUT_BATCH((i << GEN6_VE0_INDEX_SHIFT) | + GEN6_VE0_VALID | + (format << BRW_VE0_FORMAT_SHIFT) | + (0 << BRW_VE0_SRC_OFFSET_SHIFT)); + } else { + OUT_BATCH((i << BRW_VE0_INDEX_SHIFT) | + BRW_VE0_VALID | + (format << BRW_VE0_FORMAT_SHIFT) | + (0 << BRW_VE0_SRC_OFFSET_SHIFT)); + } if (intel->is_ironlake) OUT_BATCH((comp0 << BRW_VE1_COMPONENT_0_SHIFT) | diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index fc30e60087..30386ef316 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -163,12 +163,11 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_psp_urb_cbs, &brw_drawing_rect, +#endif + &brw_indices, &brw_index_buffer, &brw_vertices, - - &brw_constant_buffer -#endif }; void brw_init_state( struct brw_context *brw ) diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index d33b2b4d7d..0202871399 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -54,8 +54,7 @@ upload_vs_state(struct brw_context *brw) OUT_BATCH(0); /* scratch space base offset */ OUT_BATCH((1 << GEN6_VS_DISPATCH_START_GRF_SHIFT) | (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | - (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT) | - GEN6_VS_ENABLE); + (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) | GEN6_VS_STATISTICS_ENABLE); ADVANCE_BATCH(); -- cgit v1.2.3 From 040cf3fcdc3ec717f3d98a37e2f0c19481a856bd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 17:25:42 -0800 Subject: i965: Add basic decode of new gen6 packet boundaries. --- src/mesa/drivers/dri/intel/intel_decode.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_decode.c b/src/mesa/drivers/dri/intel/intel_decode.c index c3112d980a..5293482b35 100644 --- a/src/mesa/drivers/dri/intel/intel_decode.c +++ b/src/mesa/drivers/dri/intel/intel_decode.c @@ -1437,6 +1437,12 @@ decode_3d_965(uint32_t *data, int count, uint32_t hw_offset, int *failures) { 0x7909, 2, 2, "3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP" }, { 0x790a, 3, 3, "3DSTATE_AA_LINE_PARAMETERS" }, { 0x7b00, 6, 6, "3DPRIMITIVE" }, + { 0x780e, 4, 4, "3DSTATE_CC_STATE_POINTERS" }, + { 0x7810, 6, 6, "3DSTATE_VS_STATE" }, + { 0x7811, 6, 6, "3DSTATE_GS_STATE" }, + { 0x7812, 4, 4, "3DSTATE_CLIP_STATE" }, + { 0x7815, 5, 5, "3DSTATE_CONSTANT_VS_STATE" }, + { 0x7816, 5, 5, "3DSTATE_CONSTANT_GS_STATE" }, }; len = (data[0] & 0x0000ffff) + 2; -- cgit v1.2.3 From d512aa3d6d9948f5c294110fdae7a24aaf37051f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 18:31:32 -0800 Subject: i965: Fix some defines of gen6 regs from docs comparison. --- src/mesa/drivers/dri/i965/brw_defines.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index e280c2ee4e..f727bf53f7 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -829,10 +829,11 @@ # define GEN6_VS_VECTOR_MASK_ENABLE (1 << 30) # define GEN6_VS_SAMPLER_COUNT_SHIFT 27 # define GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 -# define GEN6_VS_DISPATCH_START_GRF_SHIFT 20 /* DW4 */ +# define GEN6_VS_DISPATCH_START_GRF_SHIFT 20 # define GEN6_VS_URB_READ_LENGTH_SHIFT 11 -# define GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT 0 +# define GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT 4 +/* DW6 */ # define GEN6_VS_MAX_THREADS_SHIFT 25 # define GEN6_VS_STATISTICS_ENABLE (1 << 10) # define GEN6_VS_CACHE_DISABLE (1 << 1) @@ -844,10 +845,10 @@ # define GEN6_GS_VECTOR_MASK_ENABLE (1 << 30) # define GEN6_GS_SAMPLER_COUNT_SHIFT 27 # define GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 -# define GEN6_GS_DISPATCH_START_GRF_SHIFT 20 /* DW4 */ # define GEN6_GS_URB_READ_LENGTH_SHIFT 11 -# define GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT 0 +# define GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT 4 +# define GEN6_GS_DISPATCH_START_GRF_SHIFT 0 /* DW5 */ # define GEN6_GS_MAX_THREADS_SHIFT 25 # define GEN6_GS_STATISTICS_ENABLE (1 << 10) -- cgit v1.2.3 From d971375bc1872cb2d95a710e3d62f5b037fbe7f7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 29 Jan 2010 10:42:17 -0800 Subject: i965: Giant pile of flushing to track down SNB bringup issues. This should go away before we push the code. --- src/mesa/drivers/dri/i965/gen6_cc.c | 2 ++ src/mesa/drivers/dri/i965/gen6_clip_state.c | 2 ++ src/mesa/drivers/dri/i965/gen6_gs_state.c | 2 ++ src/mesa/drivers/dri/i965/gen6_urb.c | 2 ++ src/mesa/drivers/dri/i965/gen6_vs_state.c | 4 ++++ 5 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index b1b6dc7db3..ba1e3abe83 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -273,6 +273,8 @@ static void upload_cc_state_pointers(struct brw_context *brw) OUT_RELOC(brw->cc.blend_state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); OUT_RELOC(brw->cc.depth_stencil_state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); } diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index f34e5f32cc..5ddfa9aad2 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -64,6 +64,8 @@ upload_clip_state(struct brw_context *brw) provoking); OUT_BATCH(0); ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); } const struct brw_tracked_state gen6_clip_state = { diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 31da0dc088..47702f7f30 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -74,6 +74,8 @@ upload_gs_state(struct brw_context *brw) OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); } const struct brw_tracked_state gen6_gs_state = { diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c index dea0aa7100..55f7ac7727 100644 --- a/src/mesa/drivers/dri/i965/gen6_urb.c +++ b/src/mesa/drivers/dri/i965/gen6_urb.c @@ -68,6 +68,8 @@ upload_urb(struct brw_context *brw) OUT_BATCH(((brw->urb.vs_size - 1) << GEN6_URB_GS_SIZE_SHIFT) | ((brw->urb.nr_gs_entries) << GEN6_URB_GS_SIZE_SHIFT)); ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); } const struct brw_tracked_state gen6_urb = { diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 0202871399..ba00e4e1fb 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -59,6 +59,8 @@ upload_vs_state(struct brw_context *brw) GEN6_VS_STATISTICS_ENABLE); ADVANCE_BATCH(); + intel_batchbuffer_emit_mi_flush(intel->batch); + if (vp->use_const_buffer || nr_params == 0) { /* Disable the push constant buffers. */ BEGIN_BATCH(5); @@ -102,6 +104,8 @@ upload_vs_state(struct brw_context *brw) drm_intel_bo_unreference(constant_bo); } + + intel_batchbuffer_emit_mi_flush(intel->batch); } const struct brw_tracked_state gen6_vs_state = { -- cgit v1.2.3 From 2c3d6f8e3e714451c436d5496167747e9311c3df Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Dec 2009 18:52:35 -0800 Subject: i965: Free gen6 state BOs on context destroy. --- src/mesa/drivers/dri/i965/brw_vtbl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 0b0be02dd2..27a2a3e8a7 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -102,6 +102,9 @@ static void brw_destroy_context( struct intel_context *intel ) dri_bo_release(&brw->cc.prog_bo); dri_bo_release(&brw->cc.state_bo); dri_bo_release(&brw->cc.vp_bo); + dri_bo_release(&brw->cc.blend_state_bo); + dri_bo_release(&brw->cc.depth_stencil_state_bo); + dri_bo_release(&brw->cc.color_calc_state_bo); } -- cgit v1.2.3 From a38096aa94ef62dba73792f1680098059b697662 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Dec 2009 14:11:14 -0800 Subject: i965: Set the state base address on Sandybridge. --- src/mesa/drivers/dri/i965/brw_misc_state.c | 15 ++++++++++++++- src/mesa/drivers/dri/i965/brw_state_upload.c | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 7d9e793ff2..c36a287d81 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -559,7 +559,20 @@ static void upload_state_base_address( struct brw_context *brw ) /* Output the structure (brw_state_base_address) directly to the * batchbuffer, so we can emit relocations inline. */ - if (intel->is_ironlake) { + if (intel->gen >= 6) { + BEGIN_BATCH(10); + OUT_BATCH(CMD_STATE_BASE_ADDRESS << 16 | (10 - 2)); + OUT_BATCH(1); /* General state base address */ + OUT_BATCH(1); /* Surface state base address */ + OUT_BATCH(1); /* Dynamic state base address */ + OUT_BATCH(1); /* Indirect object base address */ + OUT_BATCH(1); /* Instruction base address */ + OUT_BATCH(1); /* General state upper bound */ + OUT_BATCH(1); /* Dynamic state upper bound */ + OUT_BATCH(1); /* Indirect object upper bound */ + OUT_BATCH(1); /* Instruction access upper bound */ + ADVANCE_BATCH(); + } else if (intel->is_ironlake) { BEGIN_BATCH(8); OUT_BATCH(CMD_STATE_BASE_ADDRESS << 16 | (8 - 2)); OUT_BATCH(1); /* General state base address */ diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 30386ef316..30a36956e2 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -145,8 +145,11 @@ const struct brw_tracked_state *gen6_atoms[] = /* Command packets: */ &brw_invarient_state, +#endif + &brw_state_base_address, +#if 0 &brw_binding_table_pointers, &brw_blend_constant_color, #endif -- cgit v1.2.3 From 93fcfc8369cc3fa42f6ba577c26474464f21e6ad Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Dec 2009 14:17:00 -0800 Subject: i965: Fix up the VF stats packet header. --- src/mesa/drivers/dri/i965/brw_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 2ca29b7ae1..3614149966 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -150,7 +150,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, MIN2(ctx->Const.FragmentProgram.MaxNativeParameters, ctx->Const.FragmentProgram.MaxEnvParams); - if (intel->is_ironlake || intel->is_g4x) { + if (intel->is_ironlake || intel->is_g4x || intel->gen >= 6) { brw->CMD_VF_STATISTICS = CMD_VF_STATISTICS_GM45; brw->CMD_PIPELINE_SELECT = CMD_PIPELINE_SELECT_GM45; brw->has_surface_tile_offset = GL_TRUE; -- cgit v1.2.3 From 64e0c586a74553b2941f18feb199d8cddb192102 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 08:20:32 -0800 Subject: i965: Add Sandybridge scissor state. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/brw_context.h | 2 +- src/mesa/drivers/dri/i965/brw_defines.h | 2 + src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 3 + src/mesa/drivers/dri/i965/brw_structs.h | 5 ++ src/mesa/drivers/dri/i965/gen6_scissor_state.c | 108 +++++++++++++++++++++++++ 7 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_scissor_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 35093f014b..9426ffc0da 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -89,6 +89,7 @@ DRIVER_SOURCES = \ gen6_clip_state.c \ gen6_depthstencil.c \ gen6_gs_state.c \ + gen6_scissor_state.c \ gen6_urb.c \ gen6_vs_state.c diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index c4b68ca05b..d6fc37e4d8 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -293,7 +293,7 @@ enum brw_cache_id { BRW_WM_UNIT, BRW_SF_PROG, BRW_SF_VP, - BRW_SF_UNIT, + BRW_SF_UNIT, /* scissor state on gen6 */ BRW_VS_UNIT, BRW_VS_PROG, BRW_GS_UNIT, diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index f727bf53f7..b11ec7b165 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -823,6 +823,8 @@ # define GEN6_URB_GS_SIZE_SHIFT 8 # define GEN6_URB_GS_ENTRIES_SHIFT 0 +#define CMD_3D_SCISSOR_STATE_POINTERS 0x780f /* GEN6+ */ + #define CMD_3D_VS_STATE 0x7810 /* GEN6+ */ /* DW2 */ # define GEN6_VS_SPF_MODE (1 << 31) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 11489d477c..25e261dd15 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -97,6 +97,7 @@ const struct brw_tracked_state gen6_clip_state; const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; const struct brw_tracked_state gen6_gs_state; +const struct brw_tracked_state gen6_scissor_state; const struct brw_tracked_state gen6_urb; const struct brw_tracked_state gen6_vs_state; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 30a36956e2..d36cc3aa1b 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -139,6 +139,9 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_samplers, &brw_wm_unit, +#endif + &gen6_scissor_state, +#if 0 &brw_sf_vp, &brw_sf_unit, diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 10c0c62202..87d5c06cdc 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -909,6 +909,11 @@ struct brw_sf_unit_state }; +struct gen6_scissor_state +{ + GLuint ymin, xmin; + GLuint ymax, xmax; +}; struct brw_gs_unit_state { diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c new file mode 100644 index 0000000000..2d36f0056d --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c @@ -0,0 +1,108 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "intel_batchbuffer.h" +#include "main/macros.h" +#include "main/enums.h" + +static void +prepare_scissor_state(struct brw_context *brw) +{ + GLcontext *ctx = &brw->intel.ctx; + const GLboolean render_to_fbo = (ctx->DrawBuffer->Name != 0); + struct gen6_scissor_state scissor; + + /* _NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT */ + + /* The scissor only needs to handle the intersection of drawable and + * scissor rect. Clipping to the boundaries of static shared buffers + * for front/back/depth is covered by looping over cliprects in brw_draw.c. + * + * Note that the hardware's coordinates are inclusive, while Mesa's min is + * inclusive but max is exclusive. + */ + if (render_to_fbo) { + /* texmemory: Y=0=bottom */ + scissor.xmin = ctx->DrawBuffer->_Xmin; + scissor.xmax = ctx->DrawBuffer->_Xmax - 1; + scissor.ymin = ctx->DrawBuffer->_Ymin; + scissor.ymax = ctx->DrawBuffer->_Ymax - 1; + } + else { + /* memory: Y=0=top */ + scissor.xmin = ctx->DrawBuffer->_Xmin; + scissor.xmax = ctx->DrawBuffer->_Xmax - 1; + scissor.ymin = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymax; + scissor.ymax = ctx->DrawBuffer->Height - ctx->DrawBuffer->_Ymin - 1; + } + + drm_intel_bo_unreference(brw->sf.state_bo); + brw->sf.state_bo = brw_cache_data(&brw->cache, BRW_SF_UNIT, + &scissor, sizeof(scissor), + NULL, 0); +} + +const struct brw_tracked_state gen6_scissor_state = { + .dirty = { + .mesa = _NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT, + .brw = 0, + .cache = 0, + }, + .prepare = prepare_scissor_state, +}; + +static void upload_scissor_state_pointers(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + BEGIN_BATCH(2); + OUT_BATCH(CMD_3D_SCISSOR_STATE_POINTERS << 16 | (2 - 2)); + OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); +} + + +static void prepare_scissor_state_pointers(struct brw_context *brw) +{ + brw_add_validated_bo(brw, brw->sf.state_bo); +} + +const struct brw_tracked_state gen6_scissor_state_pointers = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_BATCH, + .cache = CACHE_NEW_SF_UNIT + }, + .prepare = prepare_scissor_state_pointers, + .emit = upload_scissor_state_pointers, +}; -- cgit v1.2.3 From c9065cd61fd43a507ae3100d7c0ab957672cab70 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 08:23:37 -0800 Subject: i965: Enable DRAWING_RECTANGLE emit on Sandybridge. --- src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index d36cc3aa1b..086f82c992 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -167,9 +167,9 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_aa_line_parameters, &brw_psp_urb_cbs, +#endif &brw_drawing_rect, -#endif &brw_indices, &brw_index_buffer, -- cgit v1.2.3 From 1ae0cb5f286bbba10e99c8e3bc1c55d2aeb38b59 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 09:38:50 -0800 Subject: i965: Add Sandybridge viewport setup. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/brw_defines.h | 5 + src/mesa/drivers/dri/i965/brw_state.h | 4 + src/mesa/drivers/dri/i965/brw_state_upload.c | 8 +- src/mesa/drivers/dri/i965/brw_structs.h | 9 ++ src/mesa/drivers/dri/i965/gen6_viewport_state.c | 175 ++++++++++++++++++++++++ 6 files changed, 200 insertions(+), 2 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_viewport_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 9426ffc0da..32eb3f8fcd 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -91,6 +91,7 @@ DRIVER_SOURCES = \ gen6_gs_state.c \ gen6_scissor_state.c \ gen6_urb.c \ + gen6_viewport_state.c \ gen6_vs_state.c C_SOURCES = \ diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index b11ec7b165..3201de601a 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -823,6 +823,11 @@ # define GEN6_URB_GS_SIZE_SHIFT 8 # define GEN6_URB_GS_ENTRIES_SHIFT 0 +#define CMD_VIEWPORT_STATE_POINTERS 0x780d /* GEN6+ */ +# define GEN6_CC_VIEWPORT_MODIFY (1 << 12) +# define GEN6_SF_VIEWPORT_MODIFY (1 << 11) +# define GEN6_CLIP_VIEWPORT_MODIFY (1 << 10) + #define CMD_3D_SCISSOR_STATE_POINTERS 0x780f /* GEN6+ */ #define CMD_3D_VS_STATE 0x7810 /* GEN6+ */ diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 25e261dd15..7c5819fc1b 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -93,12 +93,16 @@ const struct brw_tracked_state brw_index_buffer; const struct brw_tracked_state gen6_binding_table_pointers; const struct brw_tracked_state gen6_blend_state; const struct brw_tracked_state gen6_cc_state_pointers; +const struct brw_tracked_state gen6_cc_vp; const struct brw_tracked_state gen6_clip_state; +const struct brw_tracked_state gen6_clip_vp; const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; const struct brw_tracked_state gen6_gs_state; const struct brw_tracked_state gen6_scissor_state; +const struct brw_tracked_state gen6_sf_vp; const struct brw_tracked_state gen6_urb; +const struct brw_tracked_state gen6_viewport_state; const struct brw_tracked_state gen6_vs_state; /** diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 086f82c992..3e6c967f53 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -119,9 +119,13 @@ const struct brw_tracked_state *gen6_atoms[] = */ &brw_curbe_offsets, - &brw_cc_vp, #endif + &gen6_clip_vp, + &gen6_sf_vp, + &gen6_cc_vp, + &gen6_viewport_state, /* must do after *_vp stages */ + &gen6_urb, &gen6_blend_state, /* must do before cc unit */ &gen6_color_calc_state, /* must do before cc unit */ @@ -141,8 +145,8 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_unit, #endif &gen6_scissor_state, + #if 0 - &brw_sf_vp, &brw_sf_unit, /* Command packets: diff --git a/src/mesa/drivers/dri/i965/brw_structs.h b/src/mesa/drivers/dri/i965/brw_structs.h index 87d5c06cdc..3c2adfc87d 100644 --- a/src/mesa/drivers/dri/i965/brw_structs.h +++ b/src/mesa/drivers/dri/i965/brw_structs.h @@ -1144,6 +1144,15 @@ struct brw_sf_viewport } scissor; }; +struct gen6_sf_viewport { + GLfloat m00; + GLfloat m11; + GLfloat m22; + GLfloat m30; + GLfloat m31; + GLfloat m32; +}; + /* Documented in the subsystem/shared-functions/sampler chapter... */ struct brw_surface_state diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c new file mode 100644 index 0000000000..13d2fc1b42 --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c @@ -0,0 +1,175 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "intel_batchbuffer.h" +#include "main/macros.h" +#include "main/enums.h" + +/* The clip VP defines the guardband region where expensive clipping is skipped + * and fragments are allowed to be generated and clipped out cheaply by the SF. + * + * By setting it to NDC bounds of [-1,1], we don't do GB clipping. It's + * supposed to cause seams to become visible in apps due to shared edges taking + * different clip/no clip paths depending on whether the rest of the prim ends + * up in the guardband or not. + */ +static void +prepare_clip_vp(struct brw_context *brw) +{ + struct brw_clipper_viewport vp; + + vp.xmin = -1.0; + vp.xmax = 1.0; + vp.ymin = -1.0; + vp.ymax = 1.0; + + drm_intel_bo_unreference(brw->clip.vp_bo); + brw->clip.vp_bo = brw_cache_data(&brw->cache, BRW_CLIP_VP, + &vp, sizeof(vp), + NULL, 0); +} + +const struct brw_tracked_state gen6_clip_vp = { + .dirty = { + .mesa = _NEW_VIEWPORT, /* XXX: not really, but we need nonzero */ + .brw = 0, + .cache = 0, + }, + .prepare = prepare_clip_vp, +}; + +static void +prepare_sf_vp(struct brw_context *brw) +{ + GLcontext *ctx = &brw->intel.ctx; + const GLfloat depth_scale = 1.0F / ctx->DrawBuffer->_DepthMaxF; + struct brw_sf_viewport sfv; + GLfloat y_scale, y_bias; + const GLboolean render_to_fbo = (ctx->DrawBuffer->Name != 0); + const GLfloat *v = ctx->Viewport._WindowMap.m; + + memset(&sfv, 0, sizeof(sfv)); + + /* _NEW_BUFFERS */ + if (render_to_fbo) { + y_scale = 1.0; + y_bias = 0; + } else { + y_scale = -1.0; + y_bias = ctx->DrawBuffer->Height; + } + + /* _NEW_VIEWPORT */ + sfv.viewport.m00 = v[MAT_SX]; + sfv.viewport.m11 = v[MAT_SY] * y_scale; + sfv.viewport.m22 = v[MAT_SZ] * depth_scale; + sfv.viewport.m30 = v[MAT_TX]; + sfv.viewport.m31 = v[MAT_TY] * y_scale + y_bias; + sfv.viewport.m32 = v[MAT_TZ] * depth_scale; + + drm_intel_bo_unreference(brw->sf.vp_bo); + brw->sf.vp_bo = brw_cache_data(&brw->cache, BRW_SF_VP, + &sfv, sizeof(sfv), + NULL, 0); +} + +const struct brw_tracked_state gen6_sf_vp = { + .dirty = { + .mesa = _NEW_VIEWPORT | _NEW_BUFFERS, + .brw = 0, + .cache = 0, + }, + .prepare = prepare_sf_vp, +}; + +static void +prepare_cc_vp(struct brw_context *brw) +{ + GLcontext *ctx = &brw->intel.ctx; + struct brw_cc_viewport ccv; + + /* _NEW_TRANSOFORM */ + if (ctx->Transform.DepthClamp) { + /* _NEW_VIEWPORT */ + ccv.min_depth = MIN2(ctx->Viewport.Near, ctx->Viewport.Far); + ccv.max_depth = MAX2(ctx->Viewport.Near, ctx->Viewport.Far); + } else { + ccv.min_depth = 0.0; + ccv.max_depth = 1.0; + } + + drm_intel_bo_unreference(brw->cc.vp_bo); + brw->cc.vp_bo = brw_cache_data(&brw->cache, BRW_CC_VP, &ccv, sizeof(ccv), + NULL, 0); +} + +const struct brw_tracked_state gen6_cc_vp = { + .dirty = { + .mesa = _NEW_VIEWPORT | _NEW_TRANSFORM, + .brw = 0, + .cache = 0, + }, + .prepare = prepare_cc_vp, +}; + +static void prepare_viewport_state_pointers(struct brw_context *brw) +{ + brw_add_validated_bo(brw, brw->sf.state_bo); +} + +static void upload_viewport_state_pointers(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + BEGIN_BATCH(4); + OUT_BATCH(CMD_VIEWPORT_STATE_POINTERS << 16 | (4 - 2) | + GEN6_CC_VIEWPORT_MODIFY | + GEN6_SF_VIEWPORT_MODIFY | + GEN6_CLIP_VIEWPORT_MODIFY); + OUT_RELOC(brw->clip.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + OUT_RELOC(brw->sf.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + OUT_RELOC(brw->cc.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); +} + +const struct brw_tracked_state gen6_viewport_state = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_BATCH, + .cache = (CACHE_NEW_CLIP_VP | + CACHE_NEW_SF_VP | + CACHE_NEW_CC_VP) + }, + .prepare = prepare_viewport_state_pointers, + .emit = upload_viewport_state_pointers, +}; -- cgit v1.2.3 From 0fbc0b0c172060ce5dd946fe33a43d9194ab45d0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 09:47:53 -0800 Subject: i965: Enable clip stats. --- src/mesa/drivers/dri/i965/gen6_clip_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index 5ddfa9aad2..9fabd05341 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -55,7 +55,7 @@ upload_clip_state(struct brw_context *brw) BEGIN_BATCH(4); OUT_BATCH(CMD_3D_CLIP_STATE << 16 | (4 - 2)); - OUT_BATCH(0); + OUT_BATCH(GEN6_CLIP_STATISTICS_ENABLE); OUT_BATCH(GEN6_CLIP_ENABLE | GEN6_CLIP_API_OGL | GEN6_CLIP_MODE_REJECT_ALL | /* XXX: debug: get VS working */ -- cgit v1.2.3 From 305b72154f6b05360d64feca4725a2eaa8c48a6e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 14:51:42 -0800 Subject: i965: fix typo in SNB GS register defines --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 3201de601a..c1f041939e 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -853,9 +853,9 @@ # define GEN6_GS_SAMPLER_COUNT_SHIFT 27 # define GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 /* DW4 */ +# define GEN6_GS_DISPATCH_START_GRF_SHIFT 20 # define GEN6_GS_URB_READ_LENGTH_SHIFT 11 # define GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT 4 -# define GEN6_GS_DISPATCH_START_GRF_SHIFT 0 /* DW5 */ # define GEN6_GS_MAX_THREADS_SHIFT 25 # define GEN6_GS_STATISTICS_ENABLE (1 << 10) -- cgit v1.2.3 From a935cb2acafab199ac5ed4f2484af77be2af6363 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 15:51:43 -0800 Subject: i965: fix typo in SNB VS defines comment --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index c1f041939e..fcf02e9e3b 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -840,7 +840,7 @@ # define GEN6_VS_DISPATCH_START_GRF_SHIFT 20 # define GEN6_VS_URB_READ_LENGTH_SHIFT 11 # define GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT 4 -/* DW6 */ +/* DW5 */ # define GEN6_VS_MAX_THREADS_SHIFT 25 # define GEN6_VS_STATISTICS_ENABLE (1 << 10) # define GEN6_VS_CACHE_DISABLE (1 << 1) -- cgit v1.2.3 From da577ee8800b940fcf416716c13133cd43c3d035 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 15:52:17 -0800 Subject: i965: Fix up Sandybridge GS reg definitions --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index fcf02e9e3b..ae16fab566 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -853,9 +853,9 @@ # define GEN6_GS_SAMPLER_COUNT_SHIFT 27 # define GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 /* DW4 */ -# define GEN6_GS_DISPATCH_START_GRF_SHIFT 20 # define GEN6_GS_URB_READ_LENGTH_SHIFT 11 # define GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT 4 +# define GEN6_GS_DISPATCH_START_GRF_SHIFT 0 /* DW5 */ # define GEN6_GS_MAX_THREADS_SHIFT 25 # define GEN6_GS_STATISTICS_ENABLE (1 << 10) -- cgit v1.2.3 From dd743fa36fa9303c2a2d0e7d3798fdc00ef43287 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 17 Dec 2009 18:41:18 -0800 Subject: i965: Fixup Sandybridge GS packet from doc updates. --- src/mesa/drivers/dri/i965/gen6_gs_state.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 47702f7f30..761059c96a 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -39,8 +39,8 @@ upload_gs_state(struct brw_context *brw) struct intel_context *intel = &brw->intel; if (brw->gs.prog_bo) { - BEGIN_BATCH(6); - OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2)); + BEGIN_BATCH(7); + OUT_BATCH(CMD_3D_GS_STATE << 16 | (7 - 2)); OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); @@ -50,10 +50,11 @@ upload_gs_state(struct brw_context *brw) (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | GEN6_GS_STATISTICS_ENABLE); + OUT_BATCH(GEN6_GS_ENABLE); ADVANCE_BATCH(); } else { - BEGIN_BATCH(6); - OUT_BATCH(CMD_3D_GS_STATE << 16 | (6 - 2)); + BEGIN_BATCH(7); + OUT_BATCH(CMD_3D_GS_STATE << 16 | (7 - 2)); OUT_BATCH(0); /* prog_bo */ OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) | (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); @@ -63,6 +64,7 @@ upload_gs_state(struct brw_context *brw) (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | GEN6_GS_STATISTICS_ENABLE); + OUT_BATCH(0); ADVANCE_BATCH(); } -- cgit v1.2.3 From 70be48dff6bb68c61285641e4d976bfd53e0f00c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 29 Jan 2010 11:03:04 -0800 Subject: i965: Untested Sandybridge SF setup. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/brw_defines.h | 70 ++++++++++++ src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 7 +- src/mesa/drivers/dri/i965/gen6_sf_state.c | 149 +++++++++++++++++++++++++ src/mesa/drivers/dri/i965/gen6_vs_state.c | 3 +- src/mesa/drivers/dri/intel/intel_batchbuffer.h | 13 +++ 7 files changed, 238 insertions(+), 6 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_sf_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 32eb3f8fcd..d614fbb6a9 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -90,6 +90,7 @@ DRIVER_SOURCES = \ gen6_depthstencil.c \ gen6_gs_state.c \ gen6_scissor_state.c \ + gen6_sf_state.c \ gen6_urb.c \ gen6_viewport_state.c \ gen6_vs_state.c diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index ae16fab566..f34575355e 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -885,6 +885,76 @@ # define GEN6_CLIP_MIN_POINT_WIDTH_SHIFT 17 # define GEN6_CLIP_MAX_POINT_WIDTH_SHIFT 6 +#define CMD_3D_SF_STATE 0x7813 /* GEN6+ */ +/* DW1 */ +# define GEN6_SF_NUM_OUTPUTS_SHIFT 22 +# define GEN6_SF_SWIZZLE_ENABLE (1 << 21) +# define GEN6_SF_POINT_SPRITE_LOWERLEFT (1 << 20) +# define GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT 11 +# define GEN6_SF_URB_ENTRY_READ_OFFSET_SHIFT 4 +/* DW2 */ +# define GEN6_SF_LEGACY_GLOBAL_DEPTH_BIAS (1 << 11) +# define GEN6_SF_STATISTICS_ENABLE (1 << 10) +# define GEN6_SF_GLOBAL_DEPTH_OFFSET_SOLID (1 << 9) +# define GEN6_SF_GLOBAL_DEPTH_OFFSET_WIREFRAME (1 << 8) +# define GEN6_SF_GLOBAL_DEPTH_OFFSET_POINT (1 << 7) +# define GEN6_SF_FRONT_SOLID (0 << 5) +# define GEN6_SF_FRONT_WIREFRAME (1 << 5) +# define GEN6_SF_FRONT_POINT (2 << 5) +# define GEN6_SF_BACK_SOLID (0 << 3) +# define GEN6_SF_BACK_WIREFRAME (1 << 3) +# define GEN6_SF_BACK_POINT (2 << 3) +# define GEN6_SF_VIEWPORT_TRANSFORM_ENABLE (1 << 1) +# define GEN6_SF_WINDING_CCW (1 << 0) +/* DW3 */ +# define GEN6_SF_LINE_AA_ENABLE (1 << 31) +# define GEN6_SF_CULL_BOTH (0 << 29) +# define GEN6_SF_CULL_NONE (1 << 29) +# define GEN6_SF_CULL_FRONT (2 << 29) +# define GEN6_SF_CULL_BACK (3 << 29) +# define GEN6_SF_LINE_WIDTH_SHIFT 18 /* U3.7 */ +# define GEN6_SF_LINE_END_CAP_WIDTH_0_5 (0 << 16) +# define GEN6_SF_LINE_END_CAP_WIDTH_1_0 (1 << 16) +# define GEN6_SF_LINE_END_CAP_WIDTH_2_0 (2 << 16) +# define GEN6_SF_LINE_END_CAP_WIDTH_4_0 (3 << 16) +# define GEN6_SF_SCISSOR_ENABLE (1 << 11) +# define GEN6_SF_MSRAST_OFF_PIXEL (0 << 8) +# define GEN6_SF_MSRAST_OFF_PATTERN (1 << 8) +# define GEN6_SF_MSRAST_ON_PIXEL (2 << 8) +# define GEN6_SF_MSRAST_ON_PATTERN (3 << 8) +/* DW4 */ +# define GEN6_SF_TRI_PROVOKE_SHIFT 29 +# define GEN6_SF_LINE_PROVOKE_SHIFT 27 +# define GEN6_SF_TRIFAN_PROVOKE_SHIFT 25 +# define GEN6_SF_LINE_AA_MODE_MANHATTAN (0 << 14) +# define GEN6_SF_LINE_AA_MODE_TRUE (1 << 14) +# define GEN6_SF_VERTEX_SUBPIXEL_8BITS (0 << 12) +# define GEN6_SF_VERTEX_SUBPIXEL_4BITS (1 << 12) +# define GEN6_SF_USE_STATE_POINT_WIDTH (1 << 11) +# define GEN6_SF_POINT_WIDTH_SHIFT 0 /* U8.3 */ +/* DW5: depth offset constant */ +/* DW6: depth offset scale */ +/* DW7: depth offset clamp */ +/* DW8 */ +# define ATTRIBUTE_1_OVERRIDE_W (1 << 31) +# define ATTRIBUTE_1_OVERRIDE_Z (1 << 30) +# define ATTRIBUTE_1_OVERRIDE_Y (1 << 29) +# define ATTRIBUTE_1_OVERRIDE_X (1 << 28) +# define ATTRIBUTE_1_CONST_SOURCE_SHIFT 25 +# define ATTRIBUTE_1_SWIZZLE_SHIFT 22 +# define ATTRIBUTE_1_SOURCE_SHIFT 16 +# define ATTRIBUTE_0_OVERRIDE_W (1 << 15) +# define ATTRIBUTE_0_OVERRIDE_Z (1 << 14) +# define ATTRIBUTE_0_OVERRIDE_Y (1 << 13) +# define ATTRIBUTE_0_OVERRIDE_X (1 << 12) +# define ATTRIBUTE_0_CONST_SOURCE_SHIFT 9 +# define ATTRIBUTE_0_SWIZZLE_SHIFT 6 +# define ATTRIBUTE_0_SOURCE_SHIFT 0 +/* DW16: Point sprite texture coordinate enables */ +/* DW17: Constant interpolation enables */ +/* DW18: attr 0-7 wrap shortest enables */ +/* DW19: attr 8-16 wrap shortest enables */ + #define CMD_3D_CONSTANT_VS_STATE 0x7815 /* GEN6+ */ #define CMD_3D_CONSTANT_GS_STATE 0x7816 /* GEN6+ */ # define GEN6_CONSTANT_BUFFER_3_ENABLE (1 << 15) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 7c5819fc1b..f2579d7cdc 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -100,6 +100,7 @@ const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; const struct brw_tracked_state gen6_gs_state; const struct brw_tracked_state gen6_scissor_state; +const struct brw_tracked_state gen6_sf_state; const struct brw_tracked_state gen6_sf_vp; const struct brw_tracked_state gen6_urb; const struct brw_tracked_state gen6_viewport_state; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 3e6c967f53..9874d725bb 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -110,7 +110,6 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_vs_prog, &brw_gs_prog, #if 0 - &brw_sf_prog, &brw_wm_prog, /* Once all the programs are done, we know how large urb entry @@ -118,8 +117,6 @@ const struct brw_tracked_state *gen6_atoms[] = * layout. */ &brw_curbe_offsets, - - #endif &gen6_clip_vp, &gen6_sf_vp, @@ -144,11 +141,11 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_unit, #endif + &gen6_sf_state, + &gen6_scissor_state, #if 0 - &brw_sf_unit, - /* Command packets: */ &brw_invarient_state, diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c new file mode 100644 index 0000000000..548cdb9fca --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -0,0 +1,149 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "main/macros.h" +#include "main/enums.h" +#include "intel_batchbuffer.h" + +static void +upload_sf_state(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + GLcontext *ctx = &intel->ctx; + /* CACHE_NEW_VS_PROG */ + uint32_t num_inputs = brw_count_bits(brw->vs.prog_data->outputs_written); + /* This should probably be FS inputs read */ + uint32_t num_outputs = brw_count_bits(brw->vs.prog_data->outputs_written); + uint32_t dw1, dw2, dw3, dw4; + int i; + /* _NEW_BUFFER */ + GLboolean render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; + + dw1 = + num_outputs << GEN6_SF_NUM_OUTPUTS_SHIFT | + num_inputs << GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT | + 3 << GEN6_SF_URB_ENTRY_READ_OFFSET_SHIFT; + dw2 = GEN6_SF_VIEWPORT_TRANSFORM_ENABLE | + GEN6_SF_STATISTICS_ENABLE; + dw3 = 0; + dw4 = 0; + + /* _NEW_POLYGON */ + if ((ctx->Polygon.FrontFace == GL_CCW) ^ render_to_fbo) + dw2 |= GEN6_SF_WINDING_CCW; + + /* _NEW_SCISSOR */ + if (ctx->Scissor.Enabled) + dw3 |= GEN6_SF_SCISSOR_ENABLE; + + /* _NEW_POLYGON */ + if (ctx->Polygon.CullFlag) { + switch (ctx->Polygon.CullFaceMode) { + case GL_FRONT: + dw3 |= GEN6_SF_CULL_BOTH; + break; + case GL_BACK: + dw3 |= GEN6_SF_CULL_BACK; + break; + case GL_FRONT_AND_BACK: + dw3 |= GEN6_SF_CULL_BOTH; + break; + default: + assert(0); + break; + } + } else { + dw3 |= GEN6_SF_CULL_NONE; + } + + /* _NEW_LINE */ + dw3 |= U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7) << + GEN6_SF_LINE_WIDTH_SHIFT; + if (ctx->Line.SmoothFlag) { + dw3 |= GEN6_SF_LINE_AA_ENABLE; + dw3 |= GEN6_SF_LINE_AA_MODE_TRUE; + dw3 |= GEN6_SF_LINE_END_CAP_WIDTH_1_0; + } + + /* _NEW_POINT */ + if (ctx->Point._Attenuated) + dw4 |= GEN6_SF_USE_STATE_POINT_WIDTH; + + dw4 |= U_FIXED(CLAMP(ctx->Point.Size, 0.125, 225.875), 3) << + GEN6_SF_POINT_WIDTH_SHIFT; + if (render_to_fbo) + dw1 |= GEN6_SF_POINT_SPRITE_LOWERLEFT; + + /* _NEW_LIGHT */ + if (ctx->Light.ProvokingVertex != GL_FIRST_VERTEX_CONVENTION) { + dw4 |= + (2 << GEN6_SF_TRI_PROVOKE_SHIFT) | + (2 << GEN6_SF_TRIFAN_PROVOKE_SHIFT) | + (1 << GEN6_SF_LINE_PROVOKE_SHIFT); + } else { + dw4 |= + (1 << GEN6_SF_TRIFAN_PROVOKE_SHIFT); + } + + BEGIN_BATCH(20); + OUT_BATCH(CMD_3D_SF_STATE << 16 | (20 - 2)); + OUT_BATCH(dw1); + OUT_BATCH(dw2); + OUT_BATCH(dw3); + OUT_BATCH(dw4); + OUT_BATCH_F(ctx->Polygon.OffsetUnits * 2); /* constant. copied from gen4 */ + OUT_BATCH_F(ctx->Polygon.OffsetFactor); /* scale */ + OUT_BATCH_F(0.0); /* XXX: global depth offset clamp */ + for (i = 0; i < 8; i++) { + /* attribute overrides */ + OUT_BATCH(0); + } + OUT_BATCH(0); /* point sprite texcoord bitmask */ + OUT_BATCH(0); /* constant interp bitmask */ + OUT_BATCH(0); /* wrapshortest enables 0-7 */ + OUT_BATCH(0); /* wrapshortest enables 8-15 */ + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); +} + +const struct brw_tracked_state gen6_sf_state = { + .dirty = { + .mesa = (_NEW_LIGHT | + _NEW_POLYGON | + _NEW_LINE | + _NEW_SCISSOR | + _NEW_BUFFERS), + .brw = BRW_NEW_CONTEXT, + .cache = CACHE_NEW_VS_PROG + }, + .emit = upload_sf_state, +}; diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index ba00e4e1fb..0299dc6768 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -56,7 +56,8 @@ upload_vs_state(struct brw_context *brw) (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) | - GEN6_VS_STATISTICS_ENABLE); + GEN6_VS_STATISTICS_ENABLE| + GEN6_VS_ENABLE); ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index b052b724d8..4daada205a 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -96,6 +96,17 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, intel_batchbuffer_flush(batch); } +static INLINE uint32_t float_as_int(float f) +{ + union { + float f; + uint32_t d; + } fi; + + fi.f = f; + return fi.d; +} + /* Here are the crusty old macros, to be removed: */ #define BATCH_LOCALS @@ -108,6 +119,8 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, } while (0) #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) +#define OUT_BATCH_F(f) intel_batchbuffer_emit_dword(intel->batch, \ + float_as_int(f)) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ assert((unsigned) (delta) < buf->size); \ -- cgit v1.2.3 From 737fac7ba220e4a2d66a8e2100ae0af620c274df Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 21 Dec 2009 11:22:14 -0800 Subject: i965: Hook up remaining Sandybridge state packets besides WM. --- src/mesa/drivers/dri/i965/brw_misc_state.c | 4 +++- src/mesa/drivers/dri/i965/brw_state_upload.c | 30 ++++++---------------------- 2 files changed, 9 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index c36a287d81..b4e7dd547f 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -485,6 +485,8 @@ const struct brw_tracked_state brw_line_stipple = { static void upload_invarient_state( struct brw_context *brw ) { + struct intel_context *intel = &brw->intel; + { /* 0x61040000 Pipeline Select */ /* PipelineSelect : 0 */ @@ -496,7 +498,7 @@ static void upload_invarient_state( struct brw_context *brw ) BRW_BATCH_STRUCT(brw, &ps); } - { + if (intel->gen < 6) { struct brw_global_depth_offset_clamp gdo; memset(&gdo, 0, sizeof(gdo)); diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 9874d725bb..6f214b037e 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -109,18 +109,13 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_input_sizes, &brw_vs_prog, &brw_gs_prog, -#if 0 &brw_wm_prog, - /* Once all the programs are done, we know how large urb entry - * sizes need to be and can decide if we need to change the urb - * layout. - */ - &brw_curbe_offsets, -#endif &gen6_clip_vp, &gen6_sf_vp, &gen6_cc_vp, + + /* Command packets: */ &gen6_viewport_state, /* must do after *_vp stages */ &gen6_urb, @@ -133,43 +128,30 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_constant_surface, /* must do before wm surfaces/bind bo */ &brw_wm_surfaces, /* must do before samplers and unit */ + &brw_wm_samplers, + &gen6_vs_state, &gen6_gs_state, &gen6_clip_state, -#if 0 - &brw_wm_samplers, - - &brw_wm_unit, -#endif &gen6_sf_state, + /* &gen6_wm_state, */ &gen6_scissor_state, -#if 0 - /* Command packets: - */ &brw_invarient_state, -#endif &brw_state_base_address, -#if 0 - &brw_binding_table_pointers, - &brw_blend_constant_color, -#endif + &gen6_binding_table_pointers, &brw_depthbuffer, -#if 0 &brw_polygon_stipple, &brw_polygon_stipple_offset, &brw_line_stipple, &brw_aa_line_parameters, - &brw_psp_urb_cbs, -#endif - &brw_drawing_rect, &brw_indices, -- cgit v1.2.3 From ab8c37fe18e0367e8718774198a0d0086fde0cf9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 21 Dec 2009 11:48:32 -0800 Subject: i965: Untested Sandybridge WM packets. --- src/mesa/drivers/dri/i965/Makefile | 3 +- src/mesa/drivers/dri/i965/brw_defines.h | 62 ++++++++++ src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- src/mesa/drivers/dri/i965/gen6_wm_state.c | 162 +++++++++++++++++++++++++++ 5 files changed, 228 insertions(+), 2 deletions(-) create mode 100644 src/mesa/drivers/dri/i965/gen6_wm_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index d614fbb6a9..f84e87e7e6 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -93,7 +93,8 @@ DRIVER_SOURCES = \ gen6_sf_state.c \ gen6_urb.c \ gen6_viewport_state.c \ - gen6_vs_state.c + gen6_vs_state.c \ + gen6_wm_state.c C_SOURCES = \ $(COMMON_SOURCES) \ diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index f34575355e..be32a8fa82 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -955,8 +955,70 @@ /* DW18: attr 0-7 wrap shortest enables */ /* DW19: attr 8-16 wrap shortest enables */ +#define CMD_3D_WM_STATE 0x7814 /* GEN6+ */ +/* DW1: kernel pointer */ +/* DW2 */ +# define GEN6_WM_SPF_MODE (1 << 31) +# define GEN6_WM_VECTOR_MASK_ENABLE (1 << 30) +# define GEN6_WM_SAMPLER_COUNT_SHIFT 27 +# define GEN6_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT 18 +/* DW3: scratch space */ +/* DW4 */ +# define GEN6_WM_STATISTICS_ENABLE (1 << 31) +# define GEN6_WM_DEPTH_CLEAR (1 << 30) +# define GEN6_WM_DEPTH_RESOLVE (1 << 28) +# define GEN6_WM_HIERARCHICAL_DEPTH_RESOLVE (1 << 27) +# define GEN6_WM_DISPATCH_START_GRF_SHIFT_0 16 +# define GEN6_WM_DISPATCH_START_GRF_SHIFT_1 8 +# define GEN6_WM_DISPATCH_START_GRF_SHIFT_2 0 +/* DW5 */ +# define GEN6_WM_MAX_THREADS_SHIFT 25 +# define GEN6_WM_KILL_ENABLE (1 << 22) +# define GEN6_WM_COMPUTED_DEPTH (1 << 21) +# define GEN6_WM_USES_SOURCE_DEPTH (1 << 20) +# define GEN6_WM_DISPATCH_ENABLE (1 << 19) +# define GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5 (0 << 16) +# define GEN6_WM_LINE_END_CAP_AA_WIDTH_1_0 (1 << 16) +# define GEN6_WM_LINE_END_CAP_AA_WIDTH_2_0 (2 << 16) +# define GEN6_WM_LINE_END_CAP_AA_WIDTH_4_0 (3 << 16) +# define GEN6_WM_LINE_AA_WIDTH_0_5 (0 << 14) +# define GEN6_WM_LINE_AA_WIDTH_1_0 (1 << 14) +# define GEN6_WM_LINE_AA_WIDTH_2_0 (2 << 14) +# define GEN6_WM_LINE_AA_WIDTH_4_0 (3 << 14) +# define GEN6_WM_POLYGON_STIPPLE_ENABLE (1 << 13) +# define GEN6_WM_LINE_STIPPLE_ENABLE (1 << 12) +# define GEN6_WM_OMASK_TO_RENDER_TARGET (1 << 9) +# define GEN6_WM_USES_SOURCE_W (1 << 8) +# define GEN6_WM_DUAL_SOURCE_BLEND_ENABLE (1 << 7) +# define GEN6_WM_32_DISPATCH_ENABLE (1 << 2) +# define GEN6_WM_16_DISPATCH_ENABLE (1 << 1) +# define GEN6_WM_8_DISPATCH_ENABLE (1 << 0) +/* DW6 */ +# define GEN6_WM_NUM_SF_OUTPUTS_SHIFT 20 +# define GEN6_WM_POSOFFSET_NONE (0 << 18) +# define GEN6_WM_POSOFFSET_CENTROID (2 << 18) +# define GEN6_WM_POSOFFSET_SAMPLE (3 << 18) +# define GEN6_WM_POSITION_ZW_PIXEL (0 << 16) +# define GEN6_WM_POSITION_ZW_CENTROID (2 << 16) +# define GEN6_WM_POSITION_ZW_SAMPLE (3 << 16) +# define GEN6_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 15) +# define GEN6_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC (1 << 14) +# define GEN6_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC (1 << 13) +# define GEN6_WM_PERSPECTIVE_SAMPLE_BARYCENTRIC (1 << 12) +# define GEN6_WM_PERSPECTIVE_CENTROID_BARYCENTRIC (1 << 11) +# define GEN6_WM_PERSPECTIVE_PIXEL_BARYCENTRIC (1 << 10) +# define GEN6_WM_POINT_RASTRULE_UPPER_RIGHT (1 << 9) +# define GEN6_WM_MSRAST_OFF_PIXEL (0 << 1) +# define GEN6_WM_MSRAST_OFF_PATTERN (1 << 1) +# define GEN6_WM_MSRAST_ON_PIXEL (2 << 1) +# define GEN6_WM_MSRAST_ON_PATTERN (3 << 1) +# define GEN6_WM_MSDISPMODE_PERPIXEL (1 << 0) +/* DW7: kernel 1 pointer */ +/* DW8: kernel 2 pointer */ + #define CMD_3D_CONSTANT_VS_STATE 0x7815 /* GEN6+ */ #define CMD_3D_CONSTANT_GS_STATE 0x7816 /* GEN6+ */ +#define CMD_3D_CONSTANT_PS_STATE 0x7817 /* GEN6+ */ # define GEN6_CONSTANT_BUFFER_3_ENABLE (1 << 15) # define GEN6_CONSTANT_BUFFER_2_ENABLE (1 << 14) # define GEN6_CONSTANT_BUFFER_1_ENABLE (1 << 13) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index f2579d7cdc..990eaf7e67 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -105,6 +105,7 @@ const struct brw_tracked_state gen6_sf_vp; const struct brw_tracked_state gen6_urb; const struct brw_tracked_state gen6_viewport_state; const struct brw_tracked_state gen6_vs_state; +const struct brw_tracked_state gen6_wm_state; /** * Use same key for WM and VS surfaces. diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 6f214b037e..824502ca6e 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -134,7 +134,7 @@ const struct brw_tracked_state *gen6_atoms[] = &gen6_gs_state, &gen6_clip_state, &gen6_sf_state, - /* &gen6_wm_state, */ + &gen6_wm_state, &gen6_scissor_state, diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c new file mode 100644 index 0000000000..d896f7dcc0 --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -0,0 +1,162 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "main/macros.h" +#include "main/enums.h" +#include "shader/prog_parameter.h" +#include "shader/prog_statevars.h" +#include "intel_batchbuffer.h" + +static void +upload_wm_state(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + GLcontext *ctx = &intel->ctx; + const struct brw_fragment_program *fp = + brw_fragment_program_const(brw->fragment_program); + unsigned int nr_params = fp->program.Base.Parameters->NumParameters; + drm_intel_bo *constant_bo; + int i; + uint32_t dw2, dw4, dw5, dw6; + + dw2 = dw4 = dw5 = dw6 = 0; + dw4 |= GEN6_WM_STATISTICS_ENABLE; + dw5 |= GEN6_WM_LINE_AA_WIDTH_1_0; + dw5 |= GEN6_WM_LINE_END_CAP_AA_WIDTH_0_5; + + /* BRW_NEW_NR_SURFACES */ + dw2 |= brw->wm.nr_surfaces << GEN6_WM_BINDING_TABLE_ENTRY_COUNT_SHIFT; + + /* CACHE_NEW_SAMPLER */ + dw2 |= (ALIGN(brw->wm.sampler_count, 4) / 4) << GEN6_WM_SAMPLER_COUNT_SHIFT; + dw4 |= (1 << GEN6_WM_DISPATCH_START_GRF_SHIFT_0); + + dw5 |= (40 - 1) << GEN6_WM_MAX_THREADS_SHIFT; + dw5 |= GEN6_WM_DISPATCH_ENABLE; + + /* BRW_NEW_FRAGMENT_PROGRAM */ + if (fp->isGLSL) + dw5 |= GEN6_WM_8_DISPATCH_ENABLE; + else + dw5 |= GEN6_WM_16_DISPATCH_ENABLE; + + /* _NEW_LINE */ + if (ctx->Line.StippleFlag) + dw5 |= GEN6_WM_LINE_STIPPLE_ENABLE; + + /* _NEW_POLYGONSTIPPLE */ + if (ctx->Polygon.StippleFlag) + dw5 |= GEN6_WM_POLYGON_STIPPLE_ENABLE; + + /* BRW_NEW_FRAGMENT_PROGRAM */ + if (fp->program.Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) + dw5 |= GEN6_WM_USES_SOURCE_DEPTH | GEN6_WM_USES_SOURCE_W; + if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) + dw5 |= GEN6_WM_COMPUTED_DEPTH; + + /* _NEW_COLOR */ + if (fp->program.UsesKill || ctx->Color.AlphaEnabled) + dw5 |= GEN6_WM_KILL_ENABLE; + + /* This should probably be FS inputs read */ + dw6 |= brw_count_bits(brw->vs.prog_data->outputs_written) << + GEN6_WM_NUM_SF_OUTPUTS_SHIFT; + + BEGIN_BATCH(9); + OUT_BATCH(CMD_3D_WM_STATE << 16 | (9 - 2)); + OUT_RELOC(brw->wm.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_BATCH(dw2); + OUT_BATCH(0); /* scratch space base offset */ + OUT_BATCH(dw4); + OUT_BATCH(dw5); + OUT_BATCH(dw6); + OUT_BATCH(0); /* kernel 1 pointer */ + OUT_BATCH(0); /* kernel 2 pointer */ + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); + + if (fp->use_const_buffer || nr_params == 0) { + /* Disable the push constant buffers. */ + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | (5 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } else { + /* Updates the ParamaterValues[i] pointers for all parameters of the + * basic type of PROGRAM_STATE_VAR. + */ + _mesa_load_state_parameters(ctx, fp->program.Base.Parameters); + + constant_bo = drm_intel_bo_alloc(intel->bufmgr, "WM constant_bo", + nr_params * 4 * sizeof(float), + 4096); + intel_bo_map_gtt_preferred(intel, constant_bo, GL_TRUE); + for (i = 0; i < nr_params; i++) { + memcpy((char *)constant_bo->virtual + i * 4 * sizeof(float), + fp->program.Base.Parameters->ParameterValues[i], + 4 * sizeof(float)); + } + intel_bo_unmap_gtt_preferred(intel, constant_bo); + + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | + GEN6_CONSTANT_BUFFER_0_ENABLE | + (5 - 2)); + OUT_RELOC(constant_bo, + I915_GEM_DOMAIN_RENDER, 0, /* XXX: bad domain */ + ALIGN(nr_params, 2) / 2 - 1); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + + drm_intel_bo_unreference(constant_bo); + } + + intel_batchbuffer_emit_mi_flush(intel->batch); +} + +const struct brw_tracked_state gen6_wm_state = { + .dirty = { + .mesa = _NEW_LINE | _NEW_POLYGONSTIPPLE | _NEW_COLOR, + .brw = (BRW_NEW_CURBE_OFFSETS | + BRW_NEW_FRAGMENT_PROGRAM | + BRW_NEW_NR_WM_SURFACES | + BRW_NEW_URB_FENCE | + BRW_NEW_BATCH), + .cache = CACHE_NEW_SAMPLER + }, + .emit = upload_wm_state, +}; -- cgit v1.2.3 From 591a996ab6a8ef96a46e88317071330d94c4138f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 21 Dec 2009 13:08:41 -0800 Subject: i965: Move PIPELINE_SELECT to the top of gen6 3d pipeline setup. --- src/mesa/drivers/dri/i965/brw_state_upload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 824502ca6e..aa83d7ad18 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -116,6 +116,8 @@ const struct brw_tracked_state *gen6_atoms[] = &gen6_cc_vp, /* Command packets: */ + &brw_invarient_state, + &gen6_viewport_state, /* must do after *_vp stages */ &gen6_urb, @@ -138,8 +140,6 @@ const struct brw_tracked_state *gen6_atoms[] = &gen6_scissor_state, - &brw_invarient_state, - &brw_state_base_address, &gen6_binding_table_pointers, -- cgit v1.2.3 From 1489f108f4a9b53b42d3d4123da64ccdb7aafdde Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 21 Dec 2009 14:28:18 -0800 Subject: i965: Fix up some Sandybridge define checks for the structure rebase. --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 6 +++--- src/mesa/drivers/dri/intel/intel_context.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index e6bfc567af..f0a4e8ad65 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -536,7 +536,7 @@ static void brw_emit_vertices(struct brw_context *brw) struct brw_vertex_element *input = brw->vb.enabled[i]; uint32_t dw0; - if (IS_GEN6(intel->intelScreen->deviceID)) { + if (intel->gen >= 6) { dw0 = GEN6_VB0_ACCESS_VERTEXDATA | (i << GEN6_VB0_INDEX_SHIFT); } else { @@ -549,7 +549,7 @@ static void brw_emit_vertices(struct brw_context *brw) OUT_RELOC(input->bo, I915_GEM_DOMAIN_VERTEX, 0, input->offset); - if (intel->is_ironlake) { + if (intel->is_ironlake || intel->gen >= 6) { OUT_RELOC(input->bo, I915_GEM_DOMAIN_VERTEX, 0, input->bo->size - 1); @@ -592,7 +592,7 @@ static void brw_emit_vertices(struct brw_context *brw) (0 << BRW_VE0_SRC_OFFSET_SHIFT)); } - if (intel->is_ironlake) + if (intel->is_ironlake || intel->gen >= 6) OUT_BATCH((comp0 << BRW_VE1_COMPONENT_0_SHIFT) | (comp1 << BRW_VE1_COMPONENT_1_SHIFT) | (comp2 << BRW_VE1_COMPONENT_2_SHIFT) | diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 8af7a23385..767ad8c9d2 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -612,6 +612,8 @@ intelInitContext(struct intel_context *intel, if (IS_GEN6(intel->intelScreen->deviceID)) { intel->gen = 6; + intel->needs_ff_sync = GL_TRUE; + intel->has_luminance_srgb = GL_TRUE; } else if (IS_965(intel->intelScreen->deviceID)) { intel->gen = 4; } else if (IS_9XX(intel->intelScreen->deviceID)) { -- cgit v1.2.3 From 2ab3bf2fa37042386a2d50f60b1d0e32e26b91c2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 25 Jan 2010 14:48:06 -0800 Subject: i965: Re-disable the VS. There's stuff that needs to happen in the ISA before we can play with actually executing anything in the VS. --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- src/mesa/drivers/dri/i965/gen6_vs_state.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index be32a8fa82..50c4d6d0a4 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -796,7 +796,7 @@ # define GEN6_VE0_INDEX_SHIFT 26 # define BRW_VE0_FORMAT_SHIFT 16 # define BRW_VE0_VALID (1 << 26) -# define GEN6_VE0_VALID (1 << 25) +# define GEN6_VE0_VALID (0 << 25) # define BRW_VE0_SRC_OFFSET_SHIFT 0 # define BRW_VE1_COMPONENT_NOSTORE 0 # define BRW_VE1_COMPONENT_STORE_SRC 1 diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 0299dc6768..ba00e4e1fb 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -56,8 +56,7 @@ upload_vs_state(struct brw_context *brw) (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) | - GEN6_VS_STATISTICS_ENABLE| - GEN6_VS_ENABLE); + GEN6_VS_STATISTICS_ENABLE); ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); -- cgit v1.2.3 From f69d46150c308285a518391db02cc9cba0f2a12d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 1 Feb 2010 09:04:12 -0800 Subject: i965: Add a couple SNB state packets I saw in other batchbuffer dumps. --- src/mesa/drivers/dri/i965/brw_defines.h | 21 ++++++++++++++++++ src/mesa/drivers/dri/i965/brw_misc_state.c | 34 ++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 50c4d6d0a4..52cd12df59 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -1024,6 +1024,8 @@ # define GEN6_CONSTANT_BUFFER_1_ENABLE (1 << 13) # define GEN6_CONSTANT_BUFFER_0_ENABLE (1 << 12) +#define CMD_3D_SAMPLE_MASK 0x7818 /* GEN6+ */ + #define CMD_DRAW_RECT 0x7900 #define CMD_BLEND_CONSTANT_COLOR 0x7901 #define CMD_CHROMA_KEY 0x7904 @@ -1034,6 +1036,25 @@ #define CMD_GLOBAL_DEPTH_OFFSET_CLAMP 0x7909 #define CMD_AA_LINE_PARAMETERS 0x790a +#define CMD_GS_SVB_INDEX 0x790b /* CTG+ */ +/* DW1 */ +# define SVB_INDEX_SHIFT 29 +# define SVB_LOAD_INTERNAL_VERTEX_COUNT (1 << 0) /* SNB+ */ +/* DW2: SVB index */ +/* DW3: SVB maximum index */ + +#define CMD_3D_MULTISAMPLE 0x790d /* SNB+ */ +/* DW1 */ +# define MS_PIXEL_LOCATION_CENTER (0 << 4) +# define MS_PIXEL_LOCATION_UPPER_LEFT (1 << 4) +# define MS_NUMSAMPLES_1 (0 << 1) +# define MS_NUMSAMPLES_4 (2 << 1) +# define MS_NUMSAMPLES_8 (3 << 1) + +#define CMD_3D_CLEAR_PARAMS 0x7910 /* ILK+ */ +# define DEPTH_CLEAR_VALID (1 << 15) +/* DW1: depth clear value */ + #define CMD_PIPE_CONTROL 0x7a00 #define CMD_3D_PRIM 0x7b00 diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index b4e7dd547f..d030ed41f4 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -314,6 +314,14 @@ static void emit_depthbuffer(struct brw_context *brw) ADVANCE_BATCH(); } + + /* Initialize it for safety. */ + if (intel->gen >= 6) { + BEGIN_BATCH(2); + OUT_BATCH(CMD_3D_CLEAR_PARAMS << 16 | (2 - 2)); + OUT_BATCH(0); + ADVANCE_BATCH(); + } } const struct brw_tracked_state brw_depthbuffer = { @@ -511,6 +519,32 @@ static void upload_invarient_state( struct brw_context *brw ) BRW_BATCH_STRUCT(brw, &gdo); } + intel_batchbuffer_emit_mi_flush(intel->batch); + + if (intel->gen >= 6) { + int i; + + BEGIN_BATCH(3); + OUT_BATCH(CMD_3D_MULTISAMPLE << 16 | (3 - 2)); + OUT_BATCH(MS_PIXEL_LOCATION_CENTER | + MS_NUMSAMPLES_1); + OUT_BATCH(0); /* positions for 4/8-sample */ + ADVANCE_BATCH(); + + BEGIN_BATCH(2); + OUT_BATCH(CMD_3D_SAMPLE_MASK << 16 | (2 - 2)); + OUT_BATCH(1); + ADVANCE_BATCH(); + + for (i = 0; i < 4; i++) { + BEGIN_BATCH(4); + OUT_BATCH(CMD_GS_SVB_INDEX << 16 | (4 - 2)); + OUT_BATCH(i << SVB_INDEX_SHIFT); + OUT_BATCH(0); + OUT_BATCH(0xffffffff); + ADVANCE_BATCH(); + } + } /* 0x61020000 State Instruction Pointer */ { -- cgit v1.2.3 From 5878c841e90a8006715877045aa95a752472eaab Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 1 Feb 2010 09:41:26 -0800 Subject: i965: Set GS rendering enabled even when the GS stage is disabled. This is copying the behavior of other drivers. --- src/mesa/drivers/dri/i965/gen6_gs_state.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 761059c96a..9a4a13810a 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -49,7 +49,8 @@ upload_gs_state(struct brw_context *brw) (brw->gs.prog_data->urb_read_length << GEN6_GS_URB_READ_LENGTH_SHIFT) | (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | - GEN6_GS_STATISTICS_ENABLE); + GEN6_GS_STATISTICS_ENABLE | + GEN6_GS_RENDERING_ENABLE); OUT_BATCH(GEN6_GS_ENABLE); ADVANCE_BATCH(); } else { @@ -63,7 +64,8 @@ upload_gs_state(struct brw_context *brw) (0 << GEN6_GS_URB_READ_LENGTH_SHIFT) | (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT)); OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) | - GEN6_GS_STATISTICS_ENABLE); + GEN6_GS_STATISTICS_ENABLE | + GEN6_GS_RENDERING_ENABLE); OUT_BATCH(0); ADVANCE_BATCH(); } -- cgit v1.2.3 From c791f8a1e532834ae7a517c042e9efe262b62233 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 1 Feb 2010 09:55:18 -0800 Subject: i965: Set up the SNB sampler state pointers. --- src/mesa/drivers/dri/i965/Makefile | 1 + src/mesa/drivers/dri/i965/brw_defines.h | 8 +++ src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 1 + src/mesa/drivers/dri/i965/gen6_sampler_state.c | 74 ++++++++++++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 src/mesa/drivers/dri/i965/gen6_sampler_state.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index f84e87e7e6..f98a1a27db 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -89,6 +89,7 @@ DRIVER_SOURCES = \ gen6_clip_state.c \ gen6_depthstencil.c \ gen6_gs_state.c \ + gen6_sampler_state.c \ gen6_scissor_state.c \ gen6_sf_state.c \ gen6_urb.c \ diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 52cd12df59..9ed49e0dc3 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -782,6 +782,14 @@ # define GEN6_BINDING_TABLE_MODIFY_GS (1 << 9) # define GEN6_BINDING_TABLE_MODIFY_PS (1 << 10) +#define CMD_3D_SAMPLER_STATE_POINTERS 0x7802 /* SNB+ */ +# define PS_SAMPLER_STATE_CHANGE (1 << 12) +# define GS_SAMPLER_STATE_CHANGE (1 << 9) +# define VS_SAMPLER_STATE_CHANGE (1 << 8) +/* DW1: VS */ +/* DW2: GS */ +/* DW3: PS */ + #define CMD_VERTEX_BUFFER 0x7808 # define BRW_VB0_INDEX_SHIFT 27 # define GEN6_VB0_INDEX_SHIFT 26 diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 990eaf7e67..f790cfabe2 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -99,6 +99,7 @@ const struct brw_tracked_state gen6_clip_vp; const struct brw_tracked_state gen6_color_calc_state; const struct brw_tracked_state gen6_depth_stencil_state; const struct brw_tracked_state gen6_gs_state; +const struct brw_tracked_state gen6_sampler_state; const struct brw_tracked_state gen6_scissor_state; const struct brw_tracked_state gen6_sf_state; const struct brw_tracked_state gen6_sf_vp; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index aa83d7ad18..9e54f29f0f 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -131,6 +131,7 @@ const struct brw_tracked_state *gen6_atoms[] = &brw_wm_surfaces, /* must do before samplers and unit */ &brw_wm_samplers, + &gen6_sampler_state, &gen6_vs_state, &gen6_gs_state, diff --git a/src/mesa/drivers/dri/i965/gen6_sampler_state.c b/src/mesa/drivers/dri/i965/gen6_sampler_state.c new file mode 100644 index 0000000000..641d8859b3 --- /dev/null +++ b/src/mesa/drivers/dri/i965/gen6_sampler_state.c @@ -0,0 +1,74 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Eric Anholt + * + */ + +#include "brw_context.h" +#include "brw_state.h" +#include "brw_defines.h" +#include "brw_util.h" +#include "intel_batchbuffer.h" +#include "main/macros.h" +#include "main/enums.h" + +static void +upload_sampler_state_pointers(struct brw_context *brw) +{ + struct intel_context *intel = &brw->intel; + + BEGIN_BATCH(4); + OUT_BATCH(CMD_3D_SAMPLER_STATE_POINTERS << 16 | + VS_SAMPLER_STATE_CHANGE | + GS_SAMPLER_STATE_CHANGE | + PS_SAMPLER_STATE_CHANGE | + (4 - 2)); + OUT_BATCH(0); /* VS */ + OUT_BATCH(0); /* GS */ + if (brw->wm.sampler_bo) + OUT_RELOC(brw->wm.sampler_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + else + OUT_BATCH(0); + + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); +} + + +static void +prepare_sampler_state_pointers(struct brw_context *brw) +{ + brw_add_validated_bo(brw, brw->wm.sampler_bo); +} + +const struct brw_tracked_state gen6_sampler_state = { + .dirty = { + .mesa = 0, + .brw = BRW_NEW_BATCH, + .cache = CACHE_NEW_SAMPLER + }, + .prepare = prepare_sampler_state_pointers, + .emit = upload_sampler_state_pointers, +}; -- cgit v1.2.3 From 078e7b62f69658e40aedea59cf6f005162a29f83 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 23 Feb 2010 17:42:20 -0800 Subject: i965: Emit SNB FF unit state after the unit's push constants. There's a BUN for the WM unit that says WM_STATE must immediately follow PS_CONSTANTS, which this addresses. Presumably other units are roughly the same, too. --- src/mesa/drivers/dri/i965/gen6_gs_state.c | 22 ++++---- src/mesa/drivers/dri/i965/gen6_vs_state.c | 30 +++++------ src/mesa/drivers/dri/i965/gen6_wm_state.c | 86 +++++++++++++++---------------- 3 files changed, 69 insertions(+), 69 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 9a4a13810a..4032605a85 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -38,6 +38,17 @@ upload_gs_state(struct brw_context *brw) { struct intel_context *intel = &brw->intel; + /* Disable all the constant buffers. */ + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_GS_STATE << 16 | (5 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); + if (brw->gs.prog_bo) { BEGIN_BATCH(7); OUT_BATCH(CMD_3D_GS_STATE << 16 | (7 - 2)); @@ -69,17 +80,6 @@ upload_gs_state(struct brw_context *brw) OUT_BATCH(0); ADVANCE_BATCH(); } - - /* Disable all the constant buffers. */ - BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_GS_STATE << 16 | (5 - 2)); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); - - intel_batchbuffer_emit_mi_flush(intel->batch); } const struct brw_tracked_state gen6_gs_state = { diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index ba00e4e1fb..04fc16e679 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -46,21 +46,6 @@ upload_vs_state(struct brw_context *brw) drm_intel_bo *constant_bo; int i; - BEGIN_BATCH(6); - OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2)); - OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); - OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) | - (brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); - OUT_BATCH(0); /* scratch space base offset */ - OUT_BATCH((1 << GEN6_VS_DISPATCH_START_GRF_SHIFT) | - (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | - (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); - OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) | - GEN6_VS_STATISTICS_ENABLE); - ADVANCE_BATCH(); - - intel_batchbuffer_emit_mi_flush(intel->batch); - if (vp->use_const_buffer || nr_params == 0) { /* Disable the push constant buffers. */ BEGIN_BATCH(5); @@ -106,6 +91,21 @@ upload_vs_state(struct brw_context *brw) } intel_batchbuffer_emit_mi_flush(intel->batch); + + BEGIN_BATCH(6); + OUT_BATCH(CMD_3D_VS_STATE << 16 | (6 - 2)); + OUT_RELOC(brw->vs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_BATCH((0 << GEN6_VS_SAMPLER_COUNT_SHIFT) | + (brw->vs.nr_surfaces << GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); + OUT_BATCH(0); /* scratch space base offset */ + OUT_BATCH((1 << GEN6_VS_DISPATCH_START_GRF_SHIFT) | + (brw->vs.prog_data->urb_read_length << GEN6_VS_URB_READ_LENGTH_SHIFT) | + (0 << GEN6_VS_URB_ENTRY_READ_OFFSET_SHIFT)); + OUT_BATCH((0 << GEN6_VS_MAX_THREADS_SHIFT) | + GEN6_VS_STATISTICS_ENABLE); + ADVANCE_BATCH(); + + intel_batchbuffer_emit_mi_flush(intel->batch); } const struct brw_tracked_state gen6_vs_state = { diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index d896f7dcc0..f4ae7ed750 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -47,6 +47,49 @@ upload_wm_state(struct brw_context *brw) int i; uint32_t dw2, dw4, dw5, dw6; + if (fp->use_const_buffer || nr_params == 0) { + /* Disable the push constant buffers. */ + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | (5 - 2)); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + } else { + /* Updates the ParamaterValues[i] pointers for all parameters of the + * basic type of PROGRAM_STATE_VAR. + */ + _mesa_load_state_parameters(ctx, fp->program.Base.Parameters); + + constant_bo = drm_intel_bo_alloc(intel->bufmgr, "WM constant_bo", + nr_params * 4 * sizeof(float), + 4096); + intel_bo_map_gtt_preferred(intel, constant_bo, GL_TRUE); + for (i = 0; i < nr_params; i++) { + memcpy((char *)constant_bo->virtual + i * 4 * sizeof(float), + fp->program.Base.Parameters->ParameterValues[i], + 4 * sizeof(float)); + } + intel_bo_unmap_gtt_preferred(intel, constant_bo); + + BEGIN_BATCH(5); + OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | + GEN6_CONSTANT_BUFFER_0_ENABLE | + (5 - 2)); + OUT_RELOC(constant_bo, + I915_GEM_DOMAIN_RENDER, 0, /* XXX: bad domain */ + ALIGN(nr_params, 2) / 2 - 1); + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(0); + ADVANCE_BATCH(); + + drm_intel_bo_unreference(constant_bo); + } + + intel_batchbuffer_emit_mi_flush(intel->batch); + dw2 = dw4 = dw5 = dw6 = 0; dw4 |= GEN6_WM_STATISTICS_ENABLE; dw5 |= GEN6_WM_LINE_AA_WIDTH_1_0; @@ -103,49 +146,6 @@ upload_wm_state(struct brw_context *brw) ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); - - if (fp->use_const_buffer || nr_params == 0) { - /* Disable the push constant buffers. */ - BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | (5 - 2)); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); - } else { - /* Updates the ParamaterValues[i] pointers for all parameters of the - * basic type of PROGRAM_STATE_VAR. - */ - _mesa_load_state_parameters(ctx, fp->program.Base.Parameters); - - constant_bo = drm_intel_bo_alloc(intel->bufmgr, "WM constant_bo", - nr_params * 4 * sizeof(float), - 4096); - intel_bo_map_gtt_preferred(intel, constant_bo, GL_TRUE); - for (i = 0; i < nr_params; i++) { - memcpy((char *)constant_bo->virtual + i * 4 * sizeof(float), - fp->program.Base.Parameters->ParameterValues[i], - 4 * sizeof(float)); - } - intel_bo_unmap_gtt_preferred(intel, constant_bo); - - BEGIN_BATCH(5); - OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | - GEN6_CONSTANT_BUFFER_0_ENABLE | - (5 - 2)); - OUT_RELOC(constant_bo, - I915_GEM_DOMAIN_RENDER, 0, /* XXX: bad domain */ - ALIGN(nr_params, 2) / 2 - 1); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - ADVANCE_BATCH(); - - drm_intel_bo_unreference(constant_bo); - } - - intel_batchbuffer_emit_mi_flush(intel->batch); } const struct brw_tracked_state gen6_wm_state = { -- cgit v1.2.3 From 38c449409207c8948c1961a3132475bbd422f8f1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 24 Feb 2010 09:16:19 -0800 Subject: i965: Add SNB math opcode support. This is untested at this point. --- src/mesa/drivers/dri/i965/brw_defines.h | 4 ++- src/mesa/drivers/dri/i965/brw_eu_emit.c | 50 +++++++++++++++++++++------------ src/mesa/drivers/dri/i965/brw_vs_emit.c | 12 +++++--- 3 files changed, 43 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 9ed49e0dc3..2bb3448da7 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -530,6 +530,7 @@ #define BRW_OPCODE_POP 47 #define BRW_OPCODE_WAIT 48 #define BRW_OPCODE_SEND 49 +#define BRW_OPCODE_MATH 56 #define BRW_OPCODE_ADD 64 #define BRW_OPCODE_MUL 65 #define BRW_OPCODE_AVG 66 @@ -727,7 +728,8 @@ #define BRW_MATH_FUNCTION_SIN 6 /* was 7 */ #define BRW_MATH_FUNCTION_COS 7 /* was 8 */ #define BRW_MATH_FUNCTION_SINCOS 8 /* was 6 */ -#define BRW_MATH_FUNCTION_TAN 9 +#define BRW_MATH_FUNCTION_TAN 9 /* gen4 */ +#define BRW_MATH_FUNCTION_FDIV 9 /* gen6+ */ #define BRW_MATH_FUNCTION_POW 10 #define BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER 11 #define BRW_MATH_FUNCTION_INT_DIV_QUOTIENT 12 diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index b832c7165d..2d55299ddb 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -917,26 +917,40 @@ void brw_math( struct brw_compile *p, GLuint data_type, GLuint precision ) { - struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); - GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; - GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; + struct intel_context *intel = &p->brw->intel; - /* Example code doesn't set predicate_control for send - * instructions. - */ - insn->header.predicate_control = 0; - insn->header.destreg__conditionalmod = msg_reg_nr; + if (intel->gen >= 6) { + struct brw_instruction *insn = next_insn(p, BRW_OPCODE_MATH); - brw_set_dest(insn, dest); - brw_set_src0(insn, src); - brw_set_math_message(p->brw, - insn, - msg_length, response_length, - function, - BRW_MATH_INTEGER_UNSIGNED, - precision, - saturate, - data_type); + /* Math is the same ISA format as other opcodes, except that CondModifier + * becomes FC[3:0] and ThreadCtrl becomes FC[5:4]. + */ + insn->header.destreg__conditionalmod = function; + + brw_set_dest(insn, dest); + brw_set_src0(insn, src); + brw_set_src1(insn, brw_null_reg()); + } else { + struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); + GLuint msg_length = (function == BRW_MATH_FUNCTION_POW) ? 2 : 1; + GLuint response_length = (function == BRW_MATH_FUNCTION_SINCOS) ? 2 : 1; + /* Example code doesn't set predicate_control for send + * instructions. + */ + insn->header.predicate_control = 0; + insn->header.destreg__conditionalmod = msg_reg_nr; + + brw_set_dest(insn, dest); + brw_set_src0(insn, src); + brw_set_math_message(p->brw, + insn, + msg_length, response_length, + function, + BRW_MATH_INTEGER_UNSIGNED, + precision, + saturate, + data_type); + } } /** diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 88327d9927..b6e5f945eb 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -479,9 +479,11 @@ static void emit_math1( struct brw_vs_compile *c, * whether that turns out to be a simulator bug or not: */ struct brw_compile *p = &c->func; + struct intel_context *intel = &p->brw->intel; struct brw_reg tmp = dst; - GLboolean need_tmp = (dst.dw1.bits.writemask != 0xf || - dst.file != BRW_GENERAL_REGISTER_FILE); + GLboolean need_tmp = (intel->gen < 6 && + (dst.dw1.bits.writemask != 0xf || + dst.file != BRW_GENERAL_REGISTER_FILE)); if (need_tmp) tmp = get_tmp(c); @@ -510,9 +512,11 @@ static void emit_math2( struct brw_vs_compile *c, GLuint precision) { struct brw_compile *p = &c->func; + struct intel_context *intel = &p->brw->intel; struct brw_reg tmp = dst; - GLboolean need_tmp = (dst.dw1.bits.writemask != 0xf || - dst.file != BRW_GENERAL_REGISTER_FILE); + GLboolean need_tmp = (intel->gen < 6 && + (dst.dw1.bits.writemask != 0xf || + dst.file != BRW_GENERAL_REGISTER_FILE)); if (need_tmp) tmp = get_tmp(c); -- cgit v1.2.3 From 0bca812dc43c056c76fce8136f287f9de3c38975 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 25 Feb 2010 14:26:25 -0800 Subject: Revert "glu/sgi: Set freed pointer to NULL." This commit breaks flightgear fgfs. A null pointer is dereferenced in the function MakeVertex. This reverts commit 9be414f4b93c763e1aee8f634a13721ae5d95fcd. --- src/glu/sgi/libtess/mesh.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c index 2e962ed437..95f87cdc94 100644 --- a/src/glu/sgi/libtess/mesh.c +++ b/src/glu/sgi/libtess/mesh.c @@ -332,7 +332,6 @@ int __gl_meshSplice( GLUhalfEdge *eOrg, GLUhalfEdge *eDst ) /* We are merging two disjoint vertices -- destroy eDst->Org */ joiningVertices = TRUE; KillVertex( eDst->Org, eOrg->Org ); - eDst->Org = NULL; } if( eDst->Lface != eOrg->Lface ) { /* We are connecting two disjoint loops -- destroy eDst->Lface */ -- cgit v1.2.3 From dadd5094bfe8f8a9d0fc7b48086d3a4bc1c6b15f Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 15:50:52 -0500 Subject: Remove allegro driver --- src/mesa/drivers/allegro/amesa.c | 414 ------------------------------------- src/mesa/drivers/allegro/amesa.h | 65 ------ src/mesa/drivers/allegro/direct.h | 189 ----------------- src/mesa/drivers/allegro/generic.h | 234 --------------------- 4 files changed, 902 deletions(-) delete mode 100644 src/mesa/drivers/allegro/amesa.c delete mode 100644 src/mesa/drivers/allegro/amesa.h delete mode 100644 src/mesa/drivers/allegro/direct.h delete mode 100644 src/mesa/drivers/allegro/generic.h (limited to 'src') diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c deleted file mode 100644 index 0744677d2b..0000000000 --- a/src/mesa/drivers/allegro/amesa.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.0 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include "main/buffers.h" -#include "main/context.h" -#include "main/imports.h" -#include "main/matrix.h" -#include "main/mtypes.h" -#include "amesa.h" - - -struct amesa_visual - { - GLvisual *GLVisual; /* inherit from GLvisual */ - GLboolean DBFlag; /* double buffered? */ - GLuint Depth; /* bits per pixel ( >= 15 ) */ - }; - - -struct amesa_buffer - { - GLframebuffer *GLBuffer; /* inherit from GLframebuffer */ - GLuint Width, Height; - BITMAP *Screen; - BITMAP *Background; - BITMAP *Active; - }; - - -struct amesa_context - { - GLcontext *GLContext; /* inherit from GLcontext */ - AMesaVisual Visual; - AMesaBuffer Buffer; - GLuint ClearColor; - GLuint CurrentColor; - }; - - -static void setup_dd_pointers(GLcontext *ctx); - - -/**********************************************************************/ -/***** drawing functions *****/ -/**********************************************************************/ - -#define FLIP(context, y) (context->Buffer->Height - (y) - 1) - -#include "allegro/generic.h" -#include "allegro/direct.h" - - -/**********************************************************************/ -/***** 15-bit accelerated drawing funcs *****/ -/**********************************************************************/ - -IMPLEMENT_WRITE_RGBA_SPAN(15, unsigned short) -IMPLEMENT_WRITE_RGB_SPAN(15, unsigned short) -IMPLEMENT_WRITE_MONO_RGBA_SPAN(15, unsigned short) -IMPLEMENT_READ_RGBA_SPAN(15, unsigned short) -IMPLEMENT_WRITE_RGBA_PIXELS(15, unsigned short) -IMPLEMENT_WRITE_MONO_RGBA_PIXELS(15, unsigned short) -IMPLEMENT_READ_RGBA_PIXELS(15, unsigned short) - - -/**********************************************************************/ -/***** 16-bit accelerated drawing funcs *****/ -/**********************************************************************/ - -IMPLEMENT_WRITE_RGBA_SPAN(16, unsigned short) -IMPLEMENT_WRITE_RGB_SPAN(16, unsigned short) -IMPLEMENT_WRITE_MONO_RGBA_SPAN(16, unsigned short) -IMPLEMENT_READ_RGBA_SPAN(16, unsigned short) -IMPLEMENT_WRITE_RGBA_PIXELS(16, unsigned short) -IMPLEMENT_WRITE_MONO_RGBA_PIXELS(16, unsigned short) -IMPLEMENT_READ_RGBA_PIXELS(16, unsigned short) - - -/**********************************************************************/ -/***** 32-bit accelerated drawing funcs *****/ -/**********************************************************************/ - -IMPLEMENT_WRITE_RGBA_SPAN(32, unsigned long) -IMPLEMENT_WRITE_RGB_SPAN(32, unsigned long) -IMPLEMENT_WRITE_MONO_RGBA_SPAN(32, unsigned long) -IMPLEMENT_READ_RGBA_SPAN(32, unsigned long) -IMPLEMENT_WRITE_RGBA_PIXELS(32, unsigned long) -IMPLEMENT_WRITE_MONO_RGBA_PIXELS(32, unsigned long) -IMPLEMENT_READ_RGBA_PIXELS(32, unsigned long) - - -/**********************************************************************/ -/***** Miscellaneous device driver funcs *****/ -/**********************************************************************/ - -static GLboolean set_buffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bit) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - GLboolean ok = GL_TRUE; - - if (bit == DD_FRONT_LEFT_BIT) - context->Buffer->Active = context->Buffer->Screen; - - else if (bit == DD_BACK_LEFT) - { - if (context->Buffer->Background) - context->Buffer->Active = context->Buffer->Background; - else - ok = GL_FALSE; - } - - else - ok = GL_FALSE; - - return ok; - } - - -static void get_buffer_size(GLcontext *ctx, GLuint *width, GLuint *height) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - - *width = context->Buffer->Width; - *height = context->Buffer->Height; - } - - -/** - * We only implement this function as a mechanism to check if the - * framebuffer size has changed (and update corresponding state). - */ -static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - /* poll for window size change and realloc software Z/stencil/etc if needed */ - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysDrawBuffer; - get_buffer_size( &newWidth, &newHeight ); - if (buffer->Width != newWidth || buffer->Height != newHeight) { - _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); - } - -} - - -/**********************************************************************/ -/**********************************************************************/ - -static void setup_dd_pointers(GLcontext *ctx) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - - /* Initialize all the pointers in the driver struct. Do this whenever */ - /* a new context is made current or we change buffers via set_buffer! */ - - ctx->Driver.UpdateState = setup_dd_pointers; - ctx->Driver.SetBuffer = set_buffer; - ctx->Driver.GetBufferSize = get_buffer_size; - ctx->Driver.Viewport = viewport; - - ctx->Driver.Color = set_color_generic; - ctx->Driver.ClearColor = clear_color_generic; - ctx->Driver.Clear = clear_generic; - ctx->Driver.WriteRGBASpan = write_rgba_span_generic; - ctx->Driver.WriteRGBSpan = write_rgb_span_generic; - ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_generic; - ctx->Driver.WriteRGBAPixels = write_rgba_pixels_generic; - ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_generic; - ctx->Driver.ReadRGBASpan = read_rgba_span_generic; - ctx->Driver.ReadRGBAPixels = read_rgba_pixels_generic; - - if (context->Buffer->Active != screen) - { - switch (context->Visual->Depth) - { - case 15: - ctx->Driver.WriteRGBASpan = write_rgba_span_15; - ctx->Driver.WriteRGBSpan = write_rgb_span_15; - ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_15; - ctx->Driver.WriteRGBAPixels = write_rgba_pixels_15; - ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_15; - ctx->Driver.ReadRGBASpan = read_rgba_span_15; - ctx->Driver.ReadRGBAPixels = read_rgba_pixels_15; - break; - - case 16: - ctx->Driver.WriteRGBASpan = write_rgba_span_16; - ctx->Driver.WriteRGBSpan = write_rgb_span_16; - ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_16; - ctx->Driver.WriteRGBAPixels = write_rgba_pixels_16; - ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_16; - ctx->Driver.ReadRGBASpan = read_rgba_span_16; - ctx->Driver.ReadRGBAPixels = read_rgba_pixels_16; - break; - - case 32: - ctx->Driver.WriteRGBASpan = write_rgba_span_32; - ctx->Driver.WriteRGBSpan = write_rgb_span_32; - ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span_32; - ctx->Driver.WriteRGBAPixels = write_rgba_pixels_32; - ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels_32; - ctx->Driver.ReadRGBASpan = read_rgba_span_32; - ctx->Driver.ReadRGBAPixels = read_rgba_pixels_32; - break; - } - } - } - - -/**********************************************************************/ -/***** AMesa Public API Functions *****/ -/**********************************************************************/ - - -AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, - GLint depthSize, GLint stencilSize, GLint accumSize) - { - AMesaVisual visual; - GLbyte redBits, greenBits, blueBits; - - visual = (AMesaVisual)calloc(1, sizeof(struct amesa_visual)); - if (!visual) - return NULL; - - switch (depth) - { - case 15: - redBits = 5; - greenBits = 5; - blueBits = 5; - break; - - case 16: - redBits = 5; - greenBits = 6; - blueBits = 5; - break; - - case 24: case 32: - redBits = 8; - greenBits = 8; - blueBits = 8; - break; - - default: - free(visual); - return NULL; - } - - visual->DBFlag = dbFlag; - visual->Depth = depth; - visual->GLVisual = _mesa_create_visual(GL_TRUE, /* rgb mode */ - dbFlag, /* db_flag */ - GL_FALSE, /* stereo */ - redBits, greenBits, blueBits, 8, - 0, /* index bits */ - depthSize, /* depth bits */ - stencilSize,/* stencil bits */ - accumSize, /* accum bits */ - accumSize, /* accum bits */ - accumSize, /* accum bits */ - accumSize, /* accum bits */ - 1 ); - if (!visual->GLVisual) - { - free(visual); - return NULL; - } - - return visual; - } - - -void AMesaDestroyVisual(AMesaVisual visual) - { - _mesa_destroy_visual(visual->GLVisual); - free(visual); - } - - -AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, - GLint width, GLint height) - { - AMesaBuffer buffer; - - buffer = (AMesaBuffer)calloc(1, sizeof(struct amesa_buffer)); - if (!buffer) - return NULL; - - buffer->Screen = NULL; - buffer->Background = NULL; - buffer->Active = NULL; - buffer->Width = width; - buffer->Height = height; - - if (visual->DBFlag) - { - buffer->Background = create_bitmap_ex(visual->Depth, width, height); - if (!buffer->Background) - { - free(buffer); - return NULL; - } - } - - buffer->GLBuffer = _mesa_create_framebuffer(visual->GLVisual); - if (!buffer->GLBuffer) - { - if (buffer->Background) destroy_bitmap(buffer->Background); - free(buffer); - return NULL; - } - - return buffer; - } - - -void AMesaDestroyBuffer(AMesaBuffer buffer) -{ - if (buffer->Screen) destroy_bitmap(buffer->Screen); - if (buffer->Background) destroy_bitmap(buffer->Background); - _mesa_reference_framebuffer(&buffer->GLBuffer, NULL); - free(buffer); -} - - -AMesaContext AMesaCreateContext(AMesaVisual visual, - AMesaContext share) -{ - AMesaContext context; - GLboolean direct = GL_FALSE; - - context = (AMesaContext)calloc(1, sizeof(struct amesa_context)); - if (!context) - return NULL; - - context->Visual = visual; - context->Buffer = NULL; - context->ClearColor = 0; - context->CurrentColor = 0; - context->GLContext = _mesa_create_context(visual->GLVisual, - share ? share->GLContext : NULL, - (void *) context, GL_FALSE ); - if (!context->GLContext) - { - free(context); - return NULL; - } - - return context; -} - - -void AMesaDestroyContext(AMesaContext context) -{ - _mesa_destroy_context(context->GLContext); - free(context); -} - - -GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer) -{ - if (context && buffer) { - set_color_depth(context->Visual->Depth); - if (set_gfx_mode(GFX_AUTODETECT, buffer->Width, buffer->Height, 0, 0) != 0) - return GL_FALSE; - - context->Buffer = buffer; - buffer->Screen = screen; - buffer->Active = buffer->Background ? buffer->Background : screen; - - setup_dd_pointers(context->GLContext); - _mesa_make_current(context->GLContext, buffer->GLBuffer); - } - else { - /* XXX I don't think you want to destroy anything here! */ - destroy_bitmap(context->Buffer->Screen); - context->Buffer->Screen = NULL; - context->Buffer->Active = NULL; - context->Buffer = NULL; - _mesa_make_current(NULL, NULL); - } - - return GL_TRUE; -} - - -void AMesaSwapBuffers(AMesaBuffer buffer) -{ - if (buffer->Background) { - blit(buffer->Background, buffer->Screen, - 0, 0, 0, 0, - buffer->Width, buffer->Height); - } -} diff --git a/src/mesa/drivers/allegro/amesa.h b/src/mesa/drivers/allegro/amesa.h deleted file mode 100644 index 852d34cf4f..0000000000 --- a/src/mesa/drivers/allegro/amesa.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.3 - * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */ - - -#ifndef AMESA_H -#define AMESA_H - - -#define AMESA_MAJOR_VERSION 3 -#define AMESA_MINOR_VERSION 3 - - -typedef struct amesa_visual *AMesaVisual; -typedef struct amesa_buffer *AMesaBuffer; -typedef struct amesa_context *AMesaContext; - - -extern AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, - GLint depthSize, - GLint stencilSize, - GLint accumSize); - -extern void AMesaDestroyVisual(AMesaVisual visual); - -extern AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, - GLint width, GLint height); - -extern void AMesaDestroyBuffer(AMesaBuffer buffer); - - -extern AMesaContext AMesaCreateContext(AMesaVisual visual, - AMesaContext sharelist); - -extern void AMesaDestroyContext(AMesaContext context); - -extern GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer); - -extern void AMesaSwapBuffers(AMesaBuffer buffer); - - -#endif /* AMESA_H */ diff --git a/src/mesa/drivers/allegro/direct.h b/src/mesa/drivers/allegro/direct.h deleted file mode 100644 index bd8b5eb49d..0000000000 --- a/src/mesa/drivers/allegro/direct.h +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.0 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#define DESTINATION(BMP, X, Y, TYPE) \ - ({ \ - BITMAP *_bmp = BMP; \ - \ - (TYPE*)(_bmp->line[_bmp->h - (Y) - 1]) + (X); \ - }) - - -#define IMPLEMENT_WRITE_RGBA_SPAN(DEPTH, TYPE) \ -static void write_rgba_span_##DEPTH (const GLcontext *ctx, \ - GLuint n, GLint x, GLint y, \ - const GLubyte rgba[][4], \ - const GLubyte mask[]) \ - { \ - AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ - TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \ - \ - if (mask) \ - { \ - while (n--) \ - { \ - if (mask[0]) d[0] = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \ - d++; rgba++; mask++; \ - } \ - } \ - else \ - { \ - while (n--) \ - { \ - d[0] = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \ - d++; rgba++; \ - } \ - } \ - } - - -#define IMPLEMENT_WRITE_RGB_SPAN(DEPTH, TYPE) \ -static void write_rgb_span_##DEPTH (const GLcontext *ctx, \ - GLuint n, GLint x, GLint y, \ - const GLubyte rgb[][3], \ - const GLubyte mask[]) \ - { \ - AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ - TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \ - \ - if (mask) \ - { \ - while (n--) \ - { \ - if (mask[0]) d[0] = makecol##DEPTH(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]); \ - d++; rgb++; mask++; \ - } \ - } \ - else \ - { \ - while (n--) \ - { \ - d[0] = makecol##DEPTH(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP]); \ - d++; rgb++; \ - } \ - } \ - } - - -#define IMPLEMENT_WRITE_MONO_RGBA_SPAN(DEPTH, TYPE) \ -static void write_mono_rgba_span_##DEPTH (const GLcontext *ctx, \ - GLuint n, GLint x, GLint y, \ - const GLubyte mask[]) \ - { \ - AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ - TYPE color = context->CurrentColor; \ - TYPE *d = DESTINATION(context->Buffer->Active, x, y, TYPE); \ - \ - while (n--) \ - { \ - if (mask[0]) d[0] = color; \ - d++; mask++; \ - } \ - } - - -#define IMPLEMENT_READ_RGBA_SPAN(DEPTH, TYPE) \ -static void read_rgba_span_##DEPTH (const GLcontext *ctx, \ - GLuint n, GLint x, GLint y, \ - GLubyte rgba[][4]) \ - { \ - AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ - BITMAP *bmp = context->Buffer->Active; \ - TYPE *d = DESTINATION(bmp, x, y, TYPE); \ - \ - while (n--) \ - { \ - rgba[0][RCOMP] = getr##DEPTH(d[0]); \ - rgba[0][GCOMP] = getg##DEPTH(d[0]); \ - rgba[0][BCOMP] = getb##DEPTH(d[0]); \ - rgba[0][ACOMP] = 255; \ - \ - d++; rgba++; \ - } \ - } - - -#define IMPLEMENT_WRITE_RGBA_PIXELS(DEPTH, TYPE) \ -static void write_rgba_pixels_##DEPTH (const GLcontext *ctx, \ - GLuint n, \ - const GLint x[], \ - const GLint y[], \ - const GLubyte rgba[][4], \ - const GLubyte mask[]) \ - { \ - AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ - BITMAP *bmp = context->Buffer->Active; \ - \ - while (n--) \ - { \ - if (mask[0]) *DESTINATION(bmp, x[0], y[0], TYPE) = makecol##DEPTH(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP]); \ - rgba++; x++; y++; mask++; \ - } \ - } - - - -#define IMPLEMENT_WRITE_MONO_RGBA_PIXELS(DEPTH, TYPE) \ -static void write_mono_rgba_pixels_##DEPTH (const GLcontext *ctx, \ - GLuint n, \ - const GLint x[], \ - const GLint y[], \ - const GLubyte mask[]) \ - { \ - AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ - TYPE color = context->CurrentColor; \ - BITMAP *bmp = context->Buffer->Active; \ - \ - while (n--) \ - { \ - if (mask[0]) *DESTINATION(bmp, x[0], y[0], TYPE) = color; \ - x++; y++; mask++; \ - } \ - } - - -#define IMPLEMENT_READ_RGBA_PIXELS(DEPTH, TYPE) \ -static void read_rgba_pixels_##DEPTH (const GLcontext *ctx, \ - GLuint n, \ - const GLint x[], \ - const GLint y[], \ - GLubyte rgba[][4], \ - const GLubyte mask[]) \ - { \ - AMesaContext context = (AMesaContext)(ctx->DriverCtx); \ - BITMAP *bmp = context->Buffer->Active; \ - \ - while (n--) \ - { \ - if (mask[0]) \ - { \ - int color = *DESTINATION(bmp, x[0], y[0], TYPE); \ - \ - rgba[0][RCOMP] = getr##DEPTH(color); \ - rgba[0][GCOMP] = getg##DEPTH(color); \ - rgba[0][BCOMP] = getb##DEPTH(color); \ - rgba[0][ACOMP] = 255; \ - } \ - \ - x++; y++; rgba++; mask++; \ - } \ - } - diff --git a/src/mesa/drivers/allegro/generic.h b/src/mesa/drivers/allegro/generic.h deleted file mode 100644 index 4c8af9b95c..0000000000 --- a/src/mesa/drivers/allegro/generic.h +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.0 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -static void clear_color_generic(GLcontext *ctx, const GLfloat color[4]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - GLubyte r, g, b; - CLAMPED_FLOAT_TO_UBYTE(r, color[0]); - CLAMPED_FLOAT_TO_UBYTE(g, color[1]); - CLAMPED_FLOAT_TO_UBYTE(b, color[2]); - context->ClearColor = makecol(r, g, b); - } - - -static void set_color_generic(GLcontext *ctx, - GLubyte red, GLubyte green, - GLubyte blue, GLubyte alpha) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - - context->CurrentColor = makecol(red, green, blue); - } - - -static GLbitfield clear_generic(GLcontext *ctx, - GLbitfield mask, GLboolean all, - GLint x, GLint y, - GLint width, GLint height) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - - if (mask & GL_COLOR_BUFFER_BIT) - { - if (all) - clear_to_color(context->Buffer->Active, context->ClearColor); - else - rect(context->Buffer->Active, - x, y, x+width-1, y+height-1, - context->ClearColor); - } - - return mask & (~GL_COLOR_BUFFER_BIT); - } - - -static void write_rgba_span_generic(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], - const GLubyte mask[]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - BITMAP *bmp = context->Buffer->Active; - - y = FLIP(context, y); - - if (mask) - { - while (n--) - { - if (mask[0]) putpixel(bmp, x, y, makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP])); - x++; mask++; rgba++; - } - } - else - { - while (n--) - { - putpixel(bmp, x, y, makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP])); - x++; rgba++; - } - } - } - - -static void write_rgb_span_generic(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgb[][3], - const GLubyte mask[]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - BITMAP *bmp = context->Buffer->Active; - - y = FLIP(context, y); - - if (mask) - { - while(n--) - { - if (mask[0]) putpixel(bmp, x, y, makecol(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP])); - x++; mask++; rgb++; - } - } - else - { - while (n--) - { - putpixel(bmp, x, y, makecol(rgb[0][RCOMP], rgb[0][GCOMP], rgb[0][BCOMP])); - x++; rgb++; - } - } - } - - -static void write_mono_rgba_span_generic(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte mask[]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - BITMAP *bmp = context->Buffer->Active; - int color = context->CurrentColor; - - y = FLIP(context, y); - - if (mask) - { - while(n--) - { - if (mask[0]) putpixel(bmp, x, y, color); - x++; mask++; - } - } - else - { - while(n--) - { - putpixel(bmp, x, y, color); - x++; - } - } - } - - -static void read_rgba_span_generic(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - BITMAP *bmp = context->Buffer->Active; - - y = FLIP(context, y); - - while (n--) - { - int color = getpixel(bmp, x, y); - - rgba[0][RCOMP] = getr(color); - rgba[0][GCOMP] = getg(color); - rgba[0][BCOMP] = getb(color); - rgba[0][ACOMP] = 255; - - x++; rgba++; - } - } - - -static void write_rgba_pixels_generic(const GLcontext *ctx, - GLuint n, - const GLint x[], - const GLint y[], - const GLubyte rgba[][4], - const GLubyte mask[]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - BITMAP *bmp = context->Buffer->Active; - - while (n--) - { - if (mask[0]) putpixel(bmp, x[0], FLIP(context, y[0]), makecol(rgba[0][RCOMP], rgba[0][GCOMP], rgba[0][BCOMP])); - x++; y++; mask++; - } - } - - -static void write_mono_rgba_pixels_generic(const GLcontext *ctx, - GLuint n, - const GLint x[], - const GLint y[], - const GLubyte mask[]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - BITMAP *bmp = context->Buffer->Active; - int color = context->CurrentColor; - - while (n--) - { - if (mask[0]) putpixel(bmp, x[0], FLIP(context, y[0]), color); - x++; y++; mask++; - } - } - - -static void read_rgba_pixels_generic(const GLcontext *ctx, - GLuint n, - const GLint x[], - const GLint y[], - GLubyte rgba[][4], - const GLubyte mask[]) - { - AMesaContext context = (AMesaContext)(ctx->DriverCtx); - BITMAP *bmp = context->Buffer->Active; - - while (n--) - { - if (mask[0]) - { - int color = getpixel(bmp, x[0], FLIP(context, y[0])); - - rgba[0][RCOMP] = getr(color); - rgba[0][GCOMP] = getg(color); - rgba[0][BCOMP] = getb(color); - rgba[0][ACOMP] = 255; - } - - x++; y++; mask++; rgba++; - } - } - -- cgit v1.2.3 From 4387580e50f49d642160982208c807da858cd1ab Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 15:49:18 -0500 Subject: Remove directfb support --- Makefile | 8 +- configs/linux-directfb | 38 - configure.ac | 2 +- docs/README.directfb | 29 - include/GL/directfbgl.h | 89 --- progs/directfb/.gitignore | 4 - progs/directfb/Makefile | 38 - progs/directfb/df_gears.c | 480 ------------ progs/directfb/df_morph3d.c | 1013 -------------------------- progs/directfb/df_reflect.c | 489 ------------- progs/directfb/multi_window.c | 240 ------ src/glut/directfb/Makefile | 87 --- src/glut/directfb/NOTES | 9 - src/glut/directfb/callback.c | 300 -------- src/glut/directfb/color.c | 39 - src/glut/directfb/cursor.c | 175 ----- src/glut/directfb/cursors.h | 306 -------- src/glut/directfb/events.c | 492 ------------- src/glut/directfb/ext.c | 202 ----- src/glut/directfb/font.c | 213 ------ src/glut/directfb/font.h | 58 -- src/glut/directfb/game.c | 153 ---- src/glut/directfb/globals.c | 63 -- src/glut/directfb/init.c | 128 ---- src/glut/directfb/internal.h | 188 ----- src/glut/directfb/menu.c | 87 --- src/glut/directfb/models.c | 599 --------------- src/glut/directfb/overlay.c | 62 -- src/glut/directfb/state.c | 219 ------ src/glut/directfb/teapot.c | 212 ------ src/glut/directfb/window.c | 597 --------------- src/mesa/drivers/directfb/Makefile | 67 -- src/mesa/drivers/directfb/idirectfbgl_mesa.c | 982 ------------------------- 33 files changed, 2 insertions(+), 7666 deletions(-) delete mode 100644 configs/linux-directfb delete mode 100644 docs/README.directfb delete mode 100644 include/GL/directfbgl.h delete mode 100644 progs/directfb/.gitignore delete mode 100644 progs/directfb/Makefile delete mode 100644 progs/directfb/df_gears.c delete mode 100644 progs/directfb/df_morph3d.c delete mode 100644 progs/directfb/df_reflect.c delete mode 100644 progs/directfb/multi_window.c delete mode 100644 src/glut/directfb/Makefile delete mode 100644 src/glut/directfb/NOTES delete mode 100644 src/glut/directfb/callback.c delete mode 100644 src/glut/directfb/color.c delete mode 100644 src/glut/directfb/cursor.c delete mode 100644 src/glut/directfb/cursors.h delete mode 100644 src/glut/directfb/events.c delete mode 100644 src/glut/directfb/ext.c delete mode 100644 src/glut/directfb/font.c delete mode 100644 src/glut/directfb/font.h delete mode 100644 src/glut/directfb/game.c delete mode 100644 src/glut/directfb/globals.c delete mode 100644 src/glut/directfb/init.c delete mode 100644 src/glut/directfb/internal.h delete mode 100644 src/glut/directfb/menu.c delete mode 100644 src/glut/directfb/models.c delete mode 100644 src/glut/directfb/overlay.c delete mode 100644 src/glut/directfb/state.c delete mode 100644 src/glut/directfb/teapot.c delete mode 100644 src/glut/directfb/window.c delete mode 100644 src/mesa/drivers/directfb/Makefile delete mode 100644 src/mesa/drivers/directfb/idirectfbgl_mesa.c (limited to 'src') diff --git a/Makefile b/Makefile index 3e92e1312e..0527fa0d82 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ install: done -.PHONY: default doxygen clean realclean distclean install linux-directfb-install +.PHONY: default doxygen clean realclean distclean install # If there's no current configuration file $(TOP)/configs/current: @@ -109,7 +109,6 @@ linux-alpha-static \ linux-cell \ linux-cell-debug \ linux-debug \ -linux-directfb \ linux-dri \ linux-dri-debug \ linux-dri-x86 \ @@ -271,8 +270,6 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ - $(DIRECTORY)/src/mesa/drivers/directfb/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/directfb/Makefile \ $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ $(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \ $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ @@ -483,9 +480,6 @@ GLUT_FILES = \ $(DIRECTORY)/src/glut/fbdev/*[ch] \ $(DIRECTORY)/src/glut/mini/*[ch] \ $(DIRECTORY)/src/glut/mini/glut.pc.in \ - $(DIRECTORY)/src/glut/directfb/Makefile \ - $(DIRECTORY)/src/glut/directfb/NOTES \ - $(DIRECTORY)/src/glut/directfb/*[ch] DEPEND_FILES = \ $(TOP)/src/mesa/depend \ diff --git a/configs/linux-directfb b/configs/linux-directfb deleted file mode 100644 index 9ae3de96d1..0000000000 --- a/configs/linux-directfb +++ /dev/null @@ -1,38 +0,0 @@ -# Configuration for DirectFB - -include $(TOP)/configs/default - -CONFIG_NAME = linux-directfb - -# Compiler and flags -CC = gcc -CXX = g++ - -CFLAGS = -Wall -O3 -ffast-math -fPIC -std=c99 -D_GNU_SOURCE -D_POSIX_SOURCE -D_SVID_SOURCE \ - -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DPTHREADS - -CXXFLAGS = -Wall -O3 -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -HAVE_X86 = $(shell uname -m | grep 'i[3-6]86' >/dev/null && echo yes) -ifeq ($(HAVE_X86), yes) - CFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM - CXXFLAGS += -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM - MESA_ASM_SOURCES = $(X86_SOURCES) - GLAPI_ASM_SOURCES = $(X86_API) -endif - -# Directories -SRC_DIRS = gallium mesa glu glut/directfb glew -GLU_DIRS = sgi -DRIVER_DIRS = directfb -PROGRAM_DIRS = demos directfb - -# Library/program dependencies -GL_LIB_DEPS = -lm -lpthread -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLU_LIB) -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLU_LIB) -l$(GLUT_LIB) - diff --git a/configure.ac b/configure.ac index 485836a428..b4561000d2 100644 --- a/configure.ac +++ b/configure.ac @@ -395,7 +395,7 @@ fi dnl dnl Driver configuration. Options are xlib, dri and osmesa right now. -dnl More later: directfb, fbdev, ... +dnl More later: fbdev, ... dnl default_driver="xlib" diff --git a/docs/README.directfb b/docs/README.directfb deleted file mode 100644 index d66ca8d3ca..0000000000 --- a/docs/README.directfb +++ /dev/null @@ -1,29 +0,0 @@ - - Mesa DirectFB Information - - -Requirements -============ - - To build Mesa with DirectFB (DirectFBGL) support you need: - - DirectFB at least 1.0.0 (http://directfb.org) - - pkg-config at least 0.9 (http://pkgconfig.sf.net) - - -Installation -============ - Run - - make linux-directfb - - to build Mesa and DirectFBGL module, - - make install - - to install OpenGL libraries and - - cd src/mesa/drivers/directfb ; make install - - to install DirectFBGL module in the proper location. - Actually, that last command may not be needed. Please provide feedback. - diff --git a/include/GL/directfbgl.h b/include/GL/directfbgl.h deleted file mode 100644 index 984c4b1427..0000000000 --- a/include/GL/directfbgl.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - (c) Copyright 2001 convergence integrated media GmbH. - All rights reserved. - - Written by Denis Oliver Kropp and - Andreas Hundt . - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef __DIRECTFBGL_H__ -#define __DIRECTFBGL_H__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - -typedef struct { - int buffer_size; - int depth_size; - int stencil_size; - int aux_buffers; - - int red_size; - int green_size; - int blue_size; - int alpha_size; - - int accum_red_size; - int accum_green_size; - int accum_blue_size; - int accum_alpha_size; - - DFBBoolean double_buffer; - DFBBoolean stereo; -} DFBGLAttributes; - - -DEFINE_INTERFACE( IDirectFBGL, - - /** Context handling **/ - - /* - * Acquire the hardware lock. - */ - DFBResult (*Lock) ( - IDirectFBGL *thiz - ); - - /* - * Release the lock. - */ - DFBResult (*Unlock) ( - IDirectFBGL *thiz - ); - - /* - * Query the OpenGL attributes. - */ - DFBResult (*GetAttributes) ( - IDirectFBGL *thiz, - DFBGLAttributes *attributes - ); -) - - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/progs/directfb/.gitignore b/progs/directfb/.gitignore deleted file mode 100644 index 55d65fb5b0..0000000000 --- a/progs/directfb/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -df_gears -df_morph3d -df_reflect -multi_window diff --git a/progs/directfb/Makefile b/progs/directfb/Makefile deleted file mode 100644 index 93c2a7df14..0000000000 --- a/progs/directfb/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# progs/directfb/Makefile - -TOP = ../.. -include $(TOP)/configs/current - - -INCDIR = $(TOP)/include -I$(TOP)/progs - -LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) - -CFLAGS += $(shell pkg-config --cflags directfb) -APP_LIB_DEPS += $(shell pkg-config --libs directfb) - -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) - -PROGS = df_gears \ - df_reflect \ - df_morph3d \ - multi_window - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ - - -##### TARGETS ##### - -default: $(PROGS) - - -clean: - -rm -f $(PROGS) - -rm -f *.o *~ - diff --git a/progs/directfb/df_gears.c b/progs/directfb/df_gears.c deleted file mode 100644 index c480767bd3..0000000000 --- a/progs/directfb/df_gears.c +++ /dev/null @@ -1,480 +0,0 @@ -/* - (c) Copyright 2001 convergence integrated media GmbH. - All rights reserved. - - Written by Denis Oliver Kropp and - Andreas Hundt . - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include - -#include -#include - -#include - - -/* the super interface */ -IDirectFB *dfb; - -/* the primary surface (surface of primary layer) */ -IDirectFBSurface *primary; - -/* the GL context */ -IDirectFBGL *primary_gl; - -/* our font */ -IDirectFBFont *font; - -/* event buffer */ -IDirectFBEventBuffer *events; - -/* macro for a safe call to DirectFB functions */ -#define DFBCHECK(x...) \ - { \ - err = x; \ - if (err != DFB_OK) { \ - fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - DirectFBErrorFatal( #x, err ); \ - } \ - } - -static int screen_width, screen_height; - -static unsigned long T0 = 0; -static GLint Frames = 0; -static GLfloat fps = 0; - -static inline unsigned long get_millis() -{ - struct timeval tv; - - gettimeofday (&tv, NULL); - return (tv.tv_sec * 1000 + tv.tv_usec / 1000); -} - - -#ifndef M_PI -#define M_PI 3.14159265 -#endif - -/** - - Draw a gear wheel. You'll probably want to call this function when - building a display list since we do a lot of trig here. - - Input: inner_radius - radius of hole at center - outer_radius - radius at center of teeth - width - width of gear - teeth - number of teeth - tooth_depth - depth of tooth - - **/ - -static void -gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth / 2.0; - r2 = outer_radius + tooth_depth / 2.0; - - da = 2.0 * M_PI / teeth / 4.0; - - glShadeModel(GL_FLAT); - - glNormal3f(0.0, 0.0, 1.0); - - /* draw front face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - if (i < teeth) { - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5); - } - } - glEnd(); - - /* draw front sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5); - } - glEnd(); - - glNormal3f(0.0, 0.0, -1.0); - - /* draw back face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - if (i < teeth) { - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - } - } - glEnd(); - - /* draw back sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - } - glEnd(); - - /* draw outward faces of teeth */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - u = r2 * cos(angle + da) - r1 * cos(angle); - v = r2 * sin(angle + da) - r1 * sin(angle); - len = sqrt(u * u + v * v); - u /= len; - v /= len; - glNormal3f(v, -u, 0.0); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5); - u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da); - v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da); - glNormal3f(v, -u, 0.0); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - } - - glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5); - glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5); - - glEnd(); - - glShadeModel(GL_SMOOTH); - - /* draw inside radius cylinder */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glNormal3f(-cos(angle), -sin(angle), 0.0); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - } - glEnd(); - -} - -static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; -static GLfloat inc_rotx = 0, inc_roty = 0, inc_rotz = 0; -static GLint gear1, gear2, gear3; -static GLfloat angle = 0.0; - -static void -draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); - - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(angle, 0.0, 0.0, 1.0); - glCallList(gear1); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(3.1, -2.0, 0.0); - glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0); - glCallList(gear2); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(-3.1, 4.2, 0.0); - glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0); - glCallList(gear3); - glPopMatrix(); - - glPopMatrix(); -} - -/* new window size or exposure */ -static void -reshape(int width, int height) -{ - GLfloat h = (GLfloat) height / (GLfloat) width; - - glViewport(0, 0, (GLint) width, (GLint) height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -40.0); -} - -static void -init(int argc, char *argv[]) -{ - static GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0}; - static GLfloat red[4] = {0.8, 0.1, 0.0, 1.0}; - static GLfloat green[4] = {0.0, 0.8, 0.2, 1.0}; - static GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0}; - GLint i; - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear(1.0, 4.0, 1.0, 20, 0.7); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear(0.5, 2.0, 2.0, 10, 0.7); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear(1.3, 2.0, 0.5, 10, 0.7); - glEndList(); - - glEnable(GL_NORMALIZE); - - for ( i=1; iCreateInputEventBuffer( dfb, DICAPS_KEYS | DICAPS_AXES, - DFB_FALSE, &events )); - - /* set our cooperative level to DFSCL_FULLSCREEN - for exclusive access to the primary layer */ - dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN ); - - /* get the primary surface, i.e. the surface of the - primary layer we have exclusive access to */ - dsc.flags = DSDESC_CAPS; - dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE; - - DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary )); - - /* get the size of the surface and fill it */ - DFBCHECK(primary->GetSize( primary, &screen_width, &screen_height )); - DFBCHECK(primary->FillRectangle( primary, 0, 0, - screen_width, screen_height )); - primary->Flip( primary, NULL, 0 ); - - /* create the default font and set it */ - DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font )); - DFBCHECK(primary->SetFont( primary, font )); - - /* get the GL context */ - DFBCHECK(primary->GetGL( primary, &primary_gl )); - - DFBCHECK(primary_gl->Lock( primary_gl )); - - init(argc, argv); - reshape(screen_width, screen_height); - - DFBCHECK(primary_gl->Unlock( primary_gl )); - - T0 = get_millis(); - - while (!quit) { - DFBInputEvent evt; - unsigned long t; - - DFBCHECK(primary_gl->Lock( primary_gl )); - - draw(); - - DFBCHECK(primary_gl->Unlock( primary_gl )); - - if (fps) { - char buf[64]; - - snprintf(buf, 64, "%4.1f FPS\n", fps); - - primary->SetColor( primary, 0xff, 0, 0, 0xff ); - primary->DrawString( primary, buf, -1, screen_width - 5, 5, DSTF_TOPRIGHT ); - } - - primary->Flip( primary, NULL, 0 ); - Frames++; - - - t = get_millis(); - if (t - T0 >= 2000) { - GLfloat seconds = (t - T0) / 1000.0; - - fps = Frames / seconds; - - T0 = t; - Frames = 0; - } - - - while (events->GetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) { - switch (evt.type) { - case DIET_KEYPRESS: - switch (evt.key_symbol) { - case DIKS_ESCAPE: - quit = 1; - break; - case DIKS_CURSOR_UP: - inc_rotx = 5.0; - break; - case DIKS_CURSOR_DOWN: - inc_rotx = -5.0; - break; - case DIKS_CURSOR_LEFT: - inc_roty = 5.0; - break; - case DIKS_CURSOR_RIGHT: - inc_roty = -5.0; - break; - case DIKS_PAGE_UP: - inc_rotz = 5.0; - break; - case DIKS_PAGE_DOWN: - inc_rotz = -5.0; - break; - default: - ; - } - break; - case DIET_KEYRELEASE: - switch (evt.key_symbol) { - case DIKS_CURSOR_UP: - inc_rotx = 0; - break; - case DIKS_CURSOR_DOWN: - inc_rotx = 0; - break; - case DIKS_CURSOR_LEFT: - inc_roty = 0; - break; - case DIKS_CURSOR_RIGHT: - inc_roty = 0; - break; - case DIKS_PAGE_UP: - inc_rotz = 0; - break; - case DIKS_PAGE_DOWN: - inc_rotz = 0; - break; - default: - ; - } - break; - case DIET_AXISMOTION: - if (evt.flags & DIEF_AXISREL) { - switch (evt.axis) { - case DIAI_X: - view_roty += evt.axisrel / 2.0; - break; - case DIAI_Y: - view_rotx += evt.axisrel / 2.0; - break; - case DIAI_Z: - view_rotz += evt.axisrel / 2.0; - break; - default: - ; - } - } - break; - default: - ; - } - } - - angle += 2.0; - - view_rotx += inc_rotx; - view_roty += inc_roty; - view_rotz += inc_rotz; - } - - /* release our interfaces to shutdown DirectFB */ - primary_gl->Release( primary_gl ); - primary->Release( primary ); - font->Release( font ); - events->Release( events ); - dfb->Release( dfb ); - - return 0; -} - diff --git a/progs/directfb/df_morph3d.c b/progs/directfb/df_morph3d.c deleted file mode 100644 index 2730fa6156..0000000000 --- a/progs/directfb/df_morph3d.c +++ /dev/null @@ -1,1013 +0,0 @@ -/* - (c) Copyright 2001 convergence integrated media GmbH. - All rights reserved. - - Written by Denis Oliver Kropp and - Andreas Hundt . - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -/*- - * morph3d.c - Shows 3D morphing objects - * - * Converted to GLUT by brianp on 1/1/98 - * - * This program was inspired on a WindowsNT(R)'s screen saver. It was written - * from scratch and it was not based on any other source code. - * - * Porting it to xlock (the final objective of this code since the moment I - * decided to create it) was possible by comparing the original Mesa's gear - * demo with it's ported version, so thanks for Danny Sung for his indirect - * help (look at gear.c in xlock source tree). NOTE: At the moment this code - * was sent to Brian Paul for package inclusion, the XLock Version was not - * available. In fact, I'll wait it to appear on the next Mesa release (If you - * are reading this, it means THIS release) to send it for xlock package - * inclusion). It will probably there be a GLUT version too. - * - * Thanks goes also to Brian Paul for making it possible and inexpensive - * to use OpenGL at home. - * - * Since I'm not a native english speaker, my apologies for any gramatical - * mistake. - * - * My e-mail addresses are - * - * vianna@cat.cbpf.br - * and - * marcelo@venus.rdc.puc-rio.br - * - * Marcelo F. Vianna (Feb-13-1997) - */ - -/* -This document is VERY incomplete, but tries to describe the mathematics used -in the program. At this moment it just describes how the polyhedra are -generated. On futhurer versions, this document will be probabbly improved. - -Since I'm not a native english speaker, my apologies for any gramatical -mistake. - -Marcelo Fernandes Vianna -- Undergraduate in Computer Engeneering at Catholic Pontifical University -- of Rio de Janeiro (PUC-Rio) Brasil. -- e-mail: vianna@cat.cbpf.br or marcelo@venus.rdc.puc-rio.br -- Feb-13-1997 - -POLYHEDRA GENERATION - -For the purpose of this program it's not sufficient to know the polyhedra -vertexes coordinates. Since the morphing algorithm applies a nonlinear -transformation over the surfaces (faces) of the polyhedron, each face has -to be divided into smaller ones. The morphing algorithm needs to transform -each vertex of these smaller faces individually. It's a very time consoming -task. - -In order to reduce calculation overload, and since all the macro faces of -the polyhedron are transformed by the same way, the generation is made by -creating only one face of the polyhedron, morphing it and then rotating it -around the polyhedron center. - -What we need to know is the face radius of the polyhedron (the radius of -the inscribed sphere) and the angle between the center of two adjacent -faces using the center of the sphere as the angle's vertex. - -The face radius of the regular polyhedra are known values which I decided -to not waste my time calculating. Following is a table of face radius for -the regular polyhedra with edge length = 1: - - TETRAHEDRON : 1/(2*sqrt(2))/sqrt(3) - CUBE : 1/2 - OCTAHEDRON : 1/sqrt(6) - DODECAHEDRON : T^2 * sqrt((T+2)/5) / 2 -> where T=(sqrt(5)+1)/2 - ICOSAHEDRON : (3*sqrt(3)+sqrt(15))/12 - -I've not found any reference about the mentioned angles, so I needed to -calculate them, not a trivial task until I figured out how :) -Curiously these angles are the same for the tetrahedron and octahedron. -A way to obtain this value is inscribing the tetrahedron inside the cube -by matching their vertexes. So you'll notice that the remaining unmatched -vertexes are in the same straight line starting in the cube/tetrahedron -center and crossing the center of each tetrahedron's face. At this point -it's easy to obtain the bigger angle of the isosceles triangle formed by -the center of the cube and two opposite vertexes on the same cube face. -The edges of this triangle have the following lenghts: sqrt(2) for the base -and sqrt(3)/2 for the other two other edges. So the angle we want is: - +-----------------------------------------------------------+ - | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees | - +-----------------------------------------------------------+ -For the cube this angle is obvious, but just for formality it can be -easily obtained because we also know it's isosceles edge lenghts: -sqrt(2)/2 for the base and 1/2 for the other two edges. So the angle we -want is: - +-----------------------------------------------------------+ - | 2*ARCSIN((sqrt(2)/2)/1) = 90.000000000000000000 degrees | - +-----------------------------------------------------------+ -For the octahedron we use the same idea used for the tetrahedron, but now -we inscribe the cube inside the octahedron so that all cubes's vertexes -matches excatly the center of each octahedron's face. It's now clear that -this angle is the same of the thetrahedron one: - +-----------------------------------------------------------+ - | 2*ARCSIN(sqrt(2)/sqrt(3)) = 109.47122063449069174 degrees | - +-----------------------------------------------------------+ -For the dodecahedron it's a little bit harder because it's only relationship -with the cube is useless to us. So we need to solve the problem by another -way. The concept of Face radius also exists on 2D polygons with the name -Edge radius: - Edge Radius For Pentagon (ERp) - ERp = (1/2)/TAN(36 degrees) * VRp = 0.6881909602355867905 - (VRp is the pentagon's vertex radio). - Face Radius For Dodecahedron - FRd = T^2 * sqrt((T+2)/5) / 2 = 1.1135163644116068404 -Why we need ERp? Well, ERp and FRd segments forms a 90 degrees angle, -completing this triangle, the lesser angle is a half of the angle we are -looking for, so this angle is: - +-----------------------------------------------------------+ - | 2*ARCTAN(ERp/FRd) = 63.434948822922009981 degrees | - +-----------------------------------------------------------+ -For the icosahedron we can use the same method used for dodecahedron (well -the method used for dodecahedron may be used for all regular polyhedra) - Edge Radius For Triangle (this one is well known: 1/3 of the triangle height) - ERt = sin(60)/3 = sqrt(3)/6 = 0.2886751345948128655 - Face Radius For Icosahedron - FRi= (3*sqrt(3)+sqrt(15))/12 = 0.7557613140761707538 -So the angle is: - +-----------------------------------------------------------+ - | 2*ARCTAN(ERt/FRi) = 41.810314895778596167 degrees | - +-----------------------------------------------------------+ - -*/ - - -#include -#include -#include -#include -#include - -#include -#include - -#include - - -/* the super interface */ -IDirectFB *dfb; - -/* the primary surface (surface of primary layer) */ -IDirectFBSurface *primary; - -/* the GL context */ -IDirectFBGL *primary_gl; - -/* our font */ -IDirectFBFont *font; - -/* event buffer */ -IDirectFBEventBuffer *events; - -/* macro for a safe call to DirectFB functions */ -#define DFBCHECK(x...) \ - { \ - err = x; \ - if (err != DFB_OK) { \ - fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - DirectFBErrorFatal( #x, err ); \ - } \ - } - -static int screen_width, screen_height; - -static unsigned long T0 = 0; -static GLint Frames = 0; -static GLfloat fps = 0; - -static inline unsigned long get_millis() -{ - struct timeval tv; - - gettimeofday (&tv, NULL); - return (tv.tv_sec * 1000 + tv.tv_usec / 1000); -} - - - -#define Scale 0.3 - -#define VectMul(X1,Y1,Z1,X2,Y2,Z2) (Y1)*(Z2)-(Z1)*(Y2),(Z1)*(X2)-(X1)*(Z2),(X1)*(Y2)-(Y1)*(X2) -#define sqr(A) ((A)*(A)) - -/* Increasing this values produces better image quality, the price is speed. */ -/* Very low values produces erroneous/incorrect plotting */ -#define tetradivisions 23 -#define cubedivisions 20 -#define octadivisions 21 -#define dodecadivisions 10 -#define icodivisions 15 - -#define tetraangle 109.47122063449069174 -#define cubeangle 90.000000000000000000 -#define octaangle 109.47122063449069174 -#define dodecaangle 63.434948822922009981 -#define icoangle 41.810314895778596167 - -#ifndef Pi -#define Pi 3.1415926535897932385 -#endif -#define SQRT2 1.4142135623730951455 -#define SQRT3 1.7320508075688771932 -#define SQRT5 2.2360679774997898051 -#define SQRT6 2.4494897427831778813 -#define SQRT15 3.8729833462074170214 -#define cossec36_2 0.8506508083520399322 -#define cos72 0.3090169943749474241 -#define sin72 0.9510565162951535721 -#define cos36 0.8090169943749474241 -#define sin36 0.5877852522924731292 - -/*************************************************************************/ - -static int mono=0; -static int smooth=1; -static GLint WindH, WindW; -static GLfloat step=0; -static GLfloat seno; -static int object; -static int edgedivisions; -static void (*draw_object)( void ); -static float Magnitude; -static float *MaterialColor[20]; - -static float front_shininess[] = {60.0}; -static float front_specular[] = { 0.7, 0.7, 0.7, 1.0 }; -static float ambient[] = { 0.0, 0.0, 0.0, 1.0 }; -static float diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; -static float position0[] = { 1.0, 1.0, 1.0, 0.0 }; -static float position1[] = {-1.0,-1.0, 1.0, 0.0 }; -static float lmodel_ambient[] = { 0.5, 0.5, 0.5, 1.0 }; -static float lmodel_twoside[] = {GL_TRUE}; - -static float MaterialRed[] = { 0.7, 0.0, 0.0, 1.0 }; -static float MaterialGreen[] = { 0.1, 0.5, 0.2, 1.0 }; -static float MaterialBlue[] = { 0.0, 0.0, 0.7, 1.0 }; -static float MaterialCyan[] = { 0.2, 0.5, 0.7, 1.0 }; -static float MaterialYellow[] = { 0.7, 0.7, 0.0, 1.0 }; -static float MaterialMagenta[] = { 0.6, 0.2, 0.5, 1.0 }; -static float MaterialWhite[] = { 0.7, 0.7, 0.7, 1.0 }; -static float MaterialGray[] = { 0.2, 0.2, 0.2, 1.0 }; - -#define TRIANGLE(Edge, Amp, Divisions, Z) \ -{ \ - GLfloat Xf,Yf,Xa,Yb,Xf2,Yf2; \ - GLfloat Factor,Factor1,Factor2; \ - GLfloat VertX,VertY,VertZ,NeiAX,NeiAY,NeiAZ,NeiBX,NeiBY,NeiBZ; \ - GLfloat Ax,Ay,Bx; \ - int Ri,Ti; \ - GLfloat Vr=(Edge)*SQRT3/3; \ - GLfloat AmpVr2=(Amp)/sqr(Vr); \ - GLfloat Zf=(Edge)*(Z); \ - \ - Ax=(Edge)*(+0.5/(Divisions)), Ay=(Edge)*(-SQRT3/(2*Divisions)); \ - Bx=(Edge)*(-0.5/(Divisions)); \ - \ - for (Ri=1; Ri<=(Divisions); Ri++) { \ - glBegin(GL_TRIANGLE_STRIP); \ - for (Ti=0; TiFlip( primary, NULL, 0 ); - - glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT0, GL_POSITION, position0); - glLightfv(GL_LIGHT1, GL_AMBIENT, ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse); - glLightfv(GL_LIGHT1, GL_POSITION, position1); - glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); - glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_LIGHT1); - glEnable(GL_DEPTH_TEST); - glEnable(GL_NORMALIZE); - - glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess); - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular); - - glHint(GL_FOG_HINT, GL_FASTEST); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); - glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST); - - pinit(); -} - -int main( int argc, char *argv[] ) -{ - int quit = 0; - DFBResult err; - DFBSurfaceDescription dsc; - - DFBCHECK(DirectFBInit( &argc, &argv )); - - /* create the super interface */ - DFBCHECK(DirectFBCreate( &dfb )); - - /* create an event buffer for all devices with these caps */ - DFBCHECK(dfb->CreateInputEventBuffer( dfb, DICAPS_KEYS, DFB_FALSE, &events )); - - /* set our cooperative level to DFSCL_FULLSCREEN - for exclusive access to the primary layer */ - dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN ); - - /* get the primary surface, i.e. the surface of the - primary layer we have exclusive access to */ - dsc.flags = DSDESC_CAPS; - dsc.caps = DSCAPS_PRIMARY | DSCAPS_DOUBLE; - - DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary )); - - /* get the size of the surface and fill it */ - DFBCHECK(primary->GetSize( primary, &screen_width, &screen_height )); - DFBCHECK(primary->FillRectangle( primary, 0, 0, - screen_width, screen_height )); - - /* create the default font and set it */ - DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font )); - DFBCHECK(primary->SetFont( primary, font )); - - /* get the GL context */ - DFBCHECK(primary->GetGL( primary, &primary_gl )); - - DFBCHECK(primary_gl->Lock( primary_gl )); - - init(); - reshape(screen_width, screen_height); - - DFBCHECK(primary_gl->Unlock( primary_gl )); - - T0 = get_millis(); - - while (!quit) { - DFBInputEvent evt; - unsigned long t; - - primary->Clear( primary, 0, 0, 0, 0 ); - - DFBCHECK(primary_gl->Lock( primary_gl )); - - draw(); - - DFBCHECK(primary_gl->Unlock( primary_gl )); - - if (fps) { - char buf[64]; - - sprintf(buf, "%4.1f FPS\n", fps); - primary->SetColor( primary, 0xff, 0, 0, 0xff ); - primary->DrawString( primary, buf, -1, screen_width - 5, 5, DSTF_TOPRIGHT ); - } - - primary->Flip( primary, NULL, 0 ); - Frames++; - - - t = get_millis(); - if (t - T0 >= 1000) { - GLfloat seconds = (t - T0) / 1000.0; - - fps = Frames / seconds; - - T0 = t; - Frames = 0; - } - - - while (events->GetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) { - switch (evt.type) { - case DIET_KEYPRESS: - switch (evt.key_symbol) { - case DIKS_ESCAPE: - quit = 1; - break; - case DIKS_1: object=1; break; - case DIKS_2: object=2; break; - case DIKS_3: object=3; break; - case DIKS_4: object=4; break; - case DIKS_5: object=5; break; - case DIKS_SPACE: mono^=1; break; - case DIKS_ENTER: smooth^=1; break; - default: - ; - } - pinit(); - break; - default: - ; - } - } - } - - /* release our interfaces to shutdown DirectFB */ - primary_gl->Release( primary_gl ); - primary->Release( primary ); - font->Release( font ); - events->Release( events ); - dfb->Release( dfb ); - - return 0; -} - diff --git a/progs/directfb/df_reflect.c b/progs/directfb/df_reflect.c deleted file mode 100644 index a0e789c387..0000000000 --- a/progs/directfb/df_reflect.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - (c) Copyright 2001 convergence integrated media GmbH. - All rights reserved. - - Written by Denis Oliver Kropp and - Andreas Hundt . - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include - -#include -#include - -#include - -#include "util/showbuffer.c" -#include "util/readtex.c" - - -/* the super interface */ -IDirectFB *dfb; - -/* the primary surface (surface of primary layer) */ -IDirectFBSurface *primary; - -/* the GL context */ -IDirectFBGL *primary_gl; - -/* our font */ -IDirectFBFont *font; - -/* event buffer */ -IDirectFBEventBuffer *events; - -/* macro for a safe call to DirectFB functions */ -#define DFBCHECK(x...) \ - { \ - err = x; \ - if (err != DFB_OK) { \ - fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - DirectFBErrorFatal( #x, err ); \ - } \ - } - -static int screen_width, screen_height; - -static unsigned long T0 = 0; -static GLint Frames = 0; -static GLfloat fps = 0; - -static inline unsigned long get_millis() -{ - struct timeval tv; - - gettimeofday (&tv, NULL); - return (tv.tv_sec * 1000 + tv.tv_usec / 1000); -} - -/*******************************/ - -#define DEG2RAD (3.14159/180.0) - -#define TABLE_TEXTURE "../images/tile.rgb" - -static GLint ImgWidth, ImgHeight; -static GLenum ImgFormat; -static GLubyte *Image = NULL; - -#define MAX_OBJECTS 2 -static GLint table_list; -static GLint objects_list[MAX_OBJECTS]; - -static GLfloat xrot, yrot; -static GLfloat spin; - -static GLint Width = 400, Height = 300; -static GLenum ShowBuffer = GL_NONE; - - -static void make_table( void ) -{ - static GLfloat table_mat[] = { 1.0, 1.0, 1.0, 0.6 }; - static GLfloat gray[] = { 0.4, 0.4, 0.4, 1.0 }; - - table_list = glGenLists(1); - glNewList( table_list, GL_COMPILE ); - - /* load table's texture */ - glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, table_mat ); -/* glMaterialfv( GL_FRONT, GL_EMISSION, gray );*/ - glMaterialfv( GL_FRONT, GL_DIFFUSE, table_mat ); - glMaterialfv( GL_FRONT, GL_AMBIENT, gray ); - - /* draw textured square for the table */ - glPushMatrix(); - glScalef( 4.0, 4.0, 4.0 ); - glBegin( GL_POLYGON ); - glNormal3f( 0.0, 1.0, 0.0 ); - glTexCoord2f( 0.0, 0.0 ); glVertex3f( -1.0, 0.0, 1.0 ); - glTexCoord2f( 1.0, 0.0 ); glVertex3f( 1.0, 0.0, 1.0 ); - glTexCoord2f( 1.0, 1.0 ); glVertex3f( 1.0, 0.0, -1.0 ); - glTexCoord2f( 0.0, 1.0 ); glVertex3f( -1.0, 0.0, -1.0 ); - glEnd(); - glPopMatrix(); - - glDisable( GL_TEXTURE_2D ); - - glEndList(); -} - - -static void make_objects( void ) -{ - GLUquadricObj *q; - - static GLfloat cyan[] = { 0.0, 1.0, 1.0, 1.0 }; - static GLfloat green[] = { 0.2, 1.0, 0.2, 1.0 }; - static GLfloat black[] = { 0.0, 0.0, 0.0, 0.0 }; - - q = gluNewQuadric(); - gluQuadricDrawStyle( q, GLU_FILL ); - gluQuadricNormals( q, GLU_SMOOTH ); - - objects_list[0] = glGenLists(1); - glNewList( objects_list[0], GL_COMPILE ); - glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, cyan ); - glMaterialfv( GL_FRONT, GL_EMISSION, black ); - gluCylinder( q, 0.5, 0.5, 1.0, 15, 1 ); - glEndList(); - - objects_list[1] = glGenLists(1); - glNewList( objects_list[1], GL_COMPILE ); - glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green ); - glMaterialfv( GL_FRONT, GL_EMISSION, black ); - gluCylinder( q, 1.5, 0.0, 2.5, 15, 1 ); - glEndList(); -} - - -static void init( void ) -{ - make_table(); - make_objects(); - - Image = LoadRGBImage( TABLE_TEXTURE, &ImgWidth, &ImgHeight, &ImgFormat ); - if (!Image) { - printf("Couldn't read %s\n", TABLE_TEXTURE); - exit(0); - } - - gluBuild2DMipmaps(GL_TEXTURE_2D, 3, ImgWidth, ImgHeight, - ImgFormat, GL_UNSIGNED_BYTE, Image); - - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - - xrot = 30.0; - yrot = 50.0; - spin = 0.0; - - glShadeModel( GL_FLAT ); - - glEnable( GL_LIGHT0 ); - glEnable( GL_LIGHTING ); - - glClearColor( 0.5, 0.5, 0.9, 0.0 ); - - glEnable( GL_NORMALIZE ); -} - - - -static void reshape(int w, int h) -{ - GLfloat yAspect = 2.5; - GLfloat xAspect = yAspect * (float) w / (float) h; - Width = w; - Height = h; - glViewport(0, 0, w, h); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum( -xAspect, xAspect, -yAspect, yAspect, 10.0, 30.0 ); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); -} - - - -static void draw_objects( GLfloat eyex, GLfloat eyey, GLfloat eyez ) -{ - (void) eyex; - (void) eyey; - (void) eyez; -#ifndef USE_ZBUFFER - if (eyex<0.5) { -#endif - glPushMatrix(); - glTranslatef( 1.0, 1.5, 0.0 ); - glRotatef( spin, 1.0, 0.5, 0.0 ); - glRotatef( 0.5*spin, 0.0, 0.5, 1.0 ); - glCallList( objects_list[0] ); - glPopMatrix(); - - glPushMatrix(); - glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*spin) ), 0.0 ); - glRotatef( 0.5*spin, 0.0, 0.5, 1.0 ); - glRotatef( spin, 1.0, 0.5, 0.0 ); - glScalef( 0.5, 0.5, 0.5 ); - glCallList( objects_list[1] ); - glPopMatrix(); -#ifndef USE_ZBUFFER - } - else { - glPushMatrix(); - glTranslatef( -1.0, 0.85+3.0*fabs( cos(0.01*spin) ), 0.0 ); - glRotatef( 0.5*spin, 0.0, 0.5, 1.0 ); - glRotatef( spin, 1.0, 0.5, 0.0 ); - glScalef( 0.5, 0.5, 0.5 ); - glCallList( objects_list[1] ); - glPopMatrix(); - - glPushMatrix(); - glTranslatef( 1.0, 1.5, 0.0 ); - glRotatef( spin, 1.0, 0.5, 0.0 ); - glRotatef( 0.5*spin, 0.0, 0.5, 1.0 ); - glCallList( objects_list[0] ); - glPopMatrix(); - } -#endif -} - - - -static void draw_table( void ) -{ - glCallList( table_list ); -} - - - -static void draw( void ) -{ - static GLfloat light_pos[] = { 0.0, 20.0, 0.0, 1.0 }; - GLfloat dist = 20.0; - GLfloat eyex, eyey, eyez; - - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - - - eyex = dist * cos(yrot*DEG2RAD) * cos(xrot*DEG2RAD); - eyez = dist * sin(yrot*DEG2RAD) * cos(xrot*DEG2RAD); - eyey = dist * sin(xrot*DEG2RAD); - - /* view from top */ - glPushMatrix(); - gluLookAt( eyex, eyey, eyez, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 ); - - glLightfv( GL_LIGHT0, GL_POSITION, light_pos ); - - /* draw table into stencil planes */ - glDisable( GL_DEPTH_TEST ); - glEnable( GL_STENCIL_TEST ); - glStencilFunc( GL_ALWAYS, 1, 0xffffffff ); - glStencilOp( GL_REPLACE, GL_REPLACE, GL_REPLACE ); - glColorMask( GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE ); - draw_table(); - glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); - - glEnable( GL_DEPTH_TEST ); - - /* render view from below (reflected viewport) */ - /* only draw where stencil==1 */ - if (eyey>0.0) { - glPushMatrix(); - - glStencilFunc( GL_EQUAL, 1, 0xffffffff ); /* draw if ==1 */ - glStencilOp( GL_KEEP, GL_KEEP, GL_KEEP ); - glScalef( 1.0, -1.0, 1.0 ); - - /* Reposition light in reflected space. */ - glLightfv(GL_LIGHT0, GL_POSITION, light_pos); - - draw_objects(eyex, eyey, eyez); - glPopMatrix(); - - /* Restore light's original unreflected position. */ - glLightfv(GL_LIGHT0, GL_POSITION, light_pos); - } - - glDisable( GL_STENCIL_TEST ); - - glEnable( GL_BLEND ); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - - glEnable( GL_TEXTURE_2D ); - draw_table(); - glDisable( GL_TEXTURE_2D ); - glDisable( GL_BLEND ); - - /* view from top */ - glPushMatrix(); - - draw_objects(eyex, eyey, eyez); - - glPopMatrix(); - - glPopMatrix(); - - if (ShowBuffer == GL_DEPTH) { - ShowDepthBuffer(Width, Height, 1.0, 0.0); - } - else if (ShowBuffer == GL_STENCIL) { - ShowStencilBuffer(Width, Height, 255.0, 0.0); - } - else if (ShowBuffer == GL_ALPHA) { - ShowAlphaBuffer(Width, Height); - } -} - -/*******************************/ - -int main( int argc, char *argv[] ) -{ - int quit = 0; - DFBResult err; - DFBSurfaceDescription dsc; - - DFBCHECK(DirectFBInit( &argc, &argv )); - - /* create the super interface */ - DFBCHECK(DirectFBCreate( &dfb )); - - /* create an event buffer for all devices with these caps */ - DFBCHECK(dfb->CreateInputEventBuffer( dfb, DICAPS_ALL, DFB_FALSE, &events )); - - /* set our cooperative level to DFSCL_FULLSCREEN - for exclusive access to the primary layer */ - dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN ); - - /* get the primary surface, i.e. the surface of the - primary layer we have exclusive access to */ - dsc.flags = DSDESC_CAPS; - dsc.caps = (DFBSurfaceCapabilities)(DSCAPS_PRIMARY | DSCAPS_DOUBLE); - - DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary )); - - /* get the size of the surface and fill it */ - DFBCHECK(primary->GetSize( primary, &screen_width, &screen_height )); - DFBCHECK(primary->FillRectangle( primary, 0, 0, - screen_width, screen_height )); - - /* create the default font and set it */ - DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font )); - DFBCHECK(primary->SetFont( primary, font )); - - /* get the GL context */ - DFBCHECK(primary->GetGL( primary, &primary_gl )); - - DFBCHECK(primary_gl->Lock( primary_gl )); - - init(); - reshape(screen_width, screen_height); - - DFBCHECK(primary_gl->Unlock( primary_gl )); - - T0 = get_millis(); - - while (!quit) { - DFBInputEvent evt; - unsigned long t; - - DFBCHECK(primary_gl->Lock( primary_gl )); - - draw(); - - DFBCHECK(primary_gl->Unlock( primary_gl )); - - if (fps) { - char buf[64]; - - sprintf(buf, "%4.1f FPS\n", fps); - primary->SetColor( primary, 0xff, 0, 0, 0xff ); - primary->DrawString( primary, buf, -1, screen_width - 5, 5, DSTF_TOPRIGHT ); - } - - primary->Flip( primary, NULL, (DFBSurfaceFlipFlags)0 ); - Frames++; - - - t = get_millis(); - if (t - T0 >= 1000) { - GLfloat seconds = (t - T0) / 1000.0; - - fps = Frames / seconds; - - T0 = t; - Frames = 0; - } - - - while (events->GetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) { - switch (evt.type) { - case DIET_KEYPRESS: - switch (DFB_LOWER_CASE(evt.key_symbol)) { - case DIKS_ESCAPE: - quit = 1; - break; - case DIKS_CURSOR_UP: - xrot += 3.0; - if ( xrot > 85 ) - xrot = 85; - break; - case DIKS_CURSOR_DOWN: - xrot -= 3.0; - if ( xrot < 5 ) - xrot = 5; - break; - case DIKS_CURSOR_LEFT: - yrot += 3.0; - break; - case DIKS_CURSOR_RIGHT: - yrot -= 3.0; - break; - case DIKS_SMALL_D: - ShowBuffer = GL_DEPTH; - break; - case DIKS_SMALL_S: - ShowBuffer = GL_STENCIL; - break; - case DIKS_SMALL_A: - ShowBuffer = GL_ALPHA; - break; - default: - ShowBuffer = GL_NONE; - } - break; - case DIET_AXISMOTION: - if (evt.flags & DIEF_AXISREL) { - switch (evt.axis) { - case DIAI_X: - yrot += evt.axisrel / 2.0; - break; - case DIAI_Y: - xrot += evt.axisrel / 2.0; - break; - default: - ; - } - } - break; - default: - ; - } - } - - spin += 2.0; - yrot += 3.0; - } - - /* release our interfaces to shutdown DirectFB */ - primary_gl->Release( primary_gl ); - primary->Release( primary ); - font->Release( font ); - events->Release( events ); - dfb->Release( dfb ); - - return 0; -} - diff --git a/progs/directfb/multi_window.c b/progs/directfb/multi_window.c deleted file mode 100644 index 9bb0e4be8e..0000000000 --- a/progs/directfb/multi_window.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - (c) Copyright 2001 convergence integrated media GmbH. - All rights reserved. - - Written by Denis Oliver Kropp and - Andreas Hundt . - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include -#include -#include -#include - -#include -#include - -#include -#include - - -typedef struct { - IDirectFBWindow *window; - IDirectFBSurface *surface; - IDirectFBGL *gl; - - int width; - int height; - - unsigned long last_time; - int frames; - float fps; -} Context; - -static const GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0}; - -static IDirectFB *dfb; -static IDirectFBDisplayLayer *layer; -static IDirectFBFont *font; -static IDirectFBEventBuffer *events = NULL; - -/* macro for a safe call to DirectFB functions */ -#define DFBCHECK(x...) \ - do { \ - ret = x; \ - if (ret != DFB_OK) { \ - fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - DirectFBErrorFatal( #x, ret ); \ - } \ - } while (0) - - -static inline unsigned long get_millis() -{ - struct timeval tv; - - gettimeofday (&tv, NULL); - return (tv.tv_sec * 1000 + tv.tv_usec / 1000); -} - - -static void -setup( Context *context ) -{ - GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0}; - - context->surface->GetSize( context->surface, - &context->width, &context->height ); - - context->gl->Lock( context->gl ); - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - glViewport(0, 0, context->width, context->height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(70.0, context->width / (float) context->height, 1.0, 80.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -40.0); - - context->gl->Unlock( context->gl ); -} - -static void -update( Context *context ) -{ - unsigned long t; - IDirectFBSurface *surface = context->surface; - static __u8 r = 0, g = 0, b = 0; - - - context->gl->Lock( context->gl ); - - glClearColor( r++/255.0, g++/255.0, b++/255.0, 1.0 ); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - context->gl->Unlock( context->gl ); - - if (context->fps) { - char buf[16]; - - snprintf(buf, sizeof(buf), "%.1f FPS\n", context->fps); - - surface->SetColor( surface, 0xff, 0x00, 0x00, 0xff ); - surface->DrawString( surface, buf, -1, - context->width - 5, 5, DSTF_TOPRIGHT ); - } - - surface->Flip( surface, NULL, 0 ); - - context->frames++; - - t = get_millis(); - if (t - context->last_time >= 2000) { - float seconds = (t - context->last_time) / 1000.0f; - - context->fps = context->frames / seconds; - - context->last_time = t; - context->frames = 0; - } -} - -int -main( int argc, char *argv[] ) -{ - DFBResult ret; - int i; - int quit = 0; - const int num = 2; - Context contexts[num]; - - DFBCHECK(DirectFBInit( &argc, &argv )); - - /* create the super interface */ - DFBCHECK(DirectFBCreate( &dfb )); - - DFBCHECK(dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer )); - - /* create the default font */ - DFBCHECK(dfb->CreateFont( dfb, NULL, NULL, &font )); - - for (i=0; iCreateWindow( layer, &desc, &window )); - DFBCHECK(window->GetSurface( window, &surface )); - DFBCHECK(surface->GetGL( surface, &gl )); - - contexts[i].window = window; - contexts[i].surface = surface; - contexts[i].gl = gl; - - contexts[i].last_time = get_millis(); - contexts[i].frames = 0; - contexts[i].fps = 0; - - setup( &contexts[i] ); - - if (events) - DFBCHECK(window->AttachEventBuffer( window, events )); - else - DFBCHECK(window->CreateEventBuffer( window, &events )); - - DFBCHECK(surface->SetFont( surface, font )); - - window->SetOpacity( window, 0xff ); - } - - while (!quit) { - DFBWindowEvent evt; - - for (i=0; iGetEvent( events, DFB_EVENT(&evt) ) == DFB_OK) { - switch (evt.type) { - case DWET_KEYDOWN: - switch (evt.key_symbol) { - case DIKS_ESCAPE: - quit = 1; - break; - - default: - break; - } - break; - - default: - break; - } - } - } - - events->Release( events ); - - for (i=0; iRelease( contexts[i].gl ); - contexts[i].surface->Release( contexts[i].surface ); - contexts[i].window->Release( contexts[i].window ); - } - - font->Release( font ); - layer->Release( layer ); - dfb->Release( dfb ); - - return 0; -} - diff --git a/src/glut/directfb/Makefile b/src/glut/directfb/Makefile deleted file mode 100644 index bf93d63e30..0000000000 --- a/src/glut/directfb/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# subset glut - -TOP = ../../.. -include $(TOP)/configs/current - -MARK = $(TOP)/src/glut/glx - -GLUT_MAJOR = 3 -GLUT_MINOR = 7 -GLUT_TINY = 1 - -INCLUDES = -I$(TOP)/include -I$(MARK) $(shell pkg-config --cflags directfb) - -GLUT_LIB_DEPS += $(shell pkg-config --libs directfb) - -CORE_SOURCES = \ - callback.c \ - color.c \ - cursor.c \ - ext.c \ - events.c \ - font.c \ - game.c \ - globals.c \ - init.c \ - menu.c \ - models.c \ - overlay.c \ - state.c \ - teapot.c \ - window.c \ - - -MARK_SOURCES = \ - $(MARK)/glut_8x13.c \ - $(MARK)/glut_9x15.c \ - $(MARK)/glut_hel10.c \ - $(MARK)/glut_hel12.c \ - $(MARK)/glut_hel18.c \ - $(MARK)/glut_tr10.c \ - $(MARK)/glut_tr24.c - -SOURCES = $(CORE_SOURCES) $(MARK_SOURCES) - -OBJECTS = $(SOURCES:.c=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) - - -# Make the library -$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ - $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ - $(MKLIB_OPTIONS) $(OBJECTS) - - -# Run 'make -f Makefile.solo dep' to update the dependencies if you change -# what's included by any source file. -depend: $(SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -# Remove .o and backup files -clean: depend - -rm -f depend depend.bak - -rm -f *.o *~ *.o *~ *.so libglut.so.3.7 - -include depend diff --git a/src/glut/directfb/NOTES b/src/glut/directfb/NOTES deleted file mode 100644 index af917c6667..0000000000 --- a/src/glut/directfb/NOTES +++ /dev/null @@ -1,9 +0,0 @@ -DirectFB GLUT Implementation NOTES ----------------------------------- - -* To have high performance rendering, it's really important to - use glutEnterGameMode() instead of glutCreateWindow()/glutFullScreen(). - You can also force a windowed application to game mode by setting - the environment variable "__GLUT_GAME_MODE". - - diff --git a/src/glut/directfb/callback.c b/src/glut/directfb/callback.c deleted file mode 100644 index 7c9768aac0..0000000000 --- a/src/glut/directfb/callback.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include - -#include "internal.h" - - -typedef void (GLUTCALLBACK *__GlutTimerCallback) ( int value ); - -typedef struct __GlutTimer_s { - struct timeval interval; - struct timeval expire; - - __GlutTimerCallback func; - int value; - - struct __GlutTimer_s *next; -} __GlutTimer; - -/*****************************************************************************/ - -static __GlutTimer *g_timers = NULL; - -/*****************************************************************************/ - - -void GLUTAPIENTRY -glutDisplayFunc( void (GLUTCALLBACK *func) (void) ) -{ - display_func = func; -} - - -void GLUTAPIENTRY -glutReshapeFunc( void (GLUTCALLBACK *func) (int width, int height) ) -{ - reshape_func = func; -} - - -void GLUTAPIENTRY -glutKeyboardFunc( void (GLUTCALLBACK *func) (unsigned char key, int x, int y) ) -{ - keyboard_func = func; -} - - -void GLUTAPIENTRY -glutMouseFunc( void (GLUTCALLBACK *func) (int button, int state, int x, int y) ) -{ - mouse_func = func; -} - - -void GLUTAPIENTRY -glutMotionFunc( void (GLUTCALLBACK *func) (int x, int y) ) -{ - motion_func = func; -} - - -void GLUTAPIENTRY -glutPassiveMotionFunc( void (GLUTCALLBACK *func) (int x, int y) ) -{ - passive_motion_func = func; -} - - -void GLUTAPIENTRY -glutEntryFunc( void (GLUTCALLBACK *func) (int state) ) -{ - entry_func = func; -} - - -void GLUTAPIENTRY -glutVisibilityFunc( void (GLUTCALLBACK *func) (int state) ) -{ - visibility_func = func; -} - - -void GLUTAPIENTRY -glutMenuStateFunc( void (GLUTCALLBACK *func) (int state) ) -{ - menu_state_func = func; -} - - -void GLUTAPIENTRY -glutSpecialFunc( void (GLUTCALLBACK *func) (int key, int x, int y) ) -{ - special_func = func; -} - - -void GLUTAPIENTRY -glutSpaceballMotionFunc( void (GLUTCALLBACK *func) (int x, int y, int z) ) -{ -} - - -void GLUTAPIENTRY -glutSpaceballRotateFunc( void (GLUTCALLBACK *func) (int x, int y, int z) ) -{ -} - - -void GLUTAPIENTRY -glutSpaceballButtonFunc( void (GLUTCALLBACK *func) (int button, int state) ) -{ -} - - -void GLUTAPIENTRY -glutButtonBoxFunc( void (GLUTCALLBACK *func) (int button, int state) ) -{ -} - - -void GLUTAPIENTRY -glutDialsFunc( void (GLUTCALLBACK *func) (int dial, int value) ) -{ -} - - -void GLUTAPIENTRY -glutTabletMotionFunc( void (GLUTCALLBACK *func) (int x, int y) ) -{ -} - - -void GLUTAPIENTRY -glutTabletButtonFunc( void (GLUTCALLBACK *func) (int button, int state, int x, int y) ) -{ -} - - -void GLUTAPIENTRY -glutMenuStatusFunc( void (GLUTCALLBACK *func) (int status, int x, int y) ) -{ -} - - -void GLUTAPIENTRY -glutOverlayDisplayFunc( void (GLUTCALLBACK *func) (void) ) -{ -} - - -void GLUTAPIENTRY -glutWindowStatusFunc( void (GLUTCALLBACK *func) (int state) ) -{ -} - - -void GLUTAPIENTRY -glutKeyboardUpFunc( void (GLUTCALLBACK *func) (unsigned char key, int x, int y) ) -{ - keyboard_up_func = func; -} - - -void GLUTAPIENTRY -glutSpecialUpFunc( void (GLUTCALLBACK *func) (int key, int x, int y) ) -{ - special_up_func = func; -} - - -void GLUTAPIENTRY -glutJoystickFunc( void (GLUTCALLBACK *func)(unsigned int buttons, int x, int y, int z), int pollInterval ) -{ - joystick_func = func; - /* FIXME: take care of pollInterval */ -} - - -void GLUTAPIENTRY -glutIdleFunc( void (GLUTCALLBACK *func) (void) ) -{ - idle_func = func; -} - - -void GLUTAPIENTRY -glutTimerFunc( unsigned int msec, void (GLUTCALLBACK *func) (int value), int value ) -{ - __GlutTimer *timer; - - if (!func) - return; - - timer = calloc( 1, sizeof(__GlutTimer) ); - if (!timer) - __glutFatalError( "out of memory" ); - - timer->interval.tv_sec = msec / 1000; - timer->interval.tv_usec = (msec % 1000) * 1000; - - gettimeofday( &timer->expire, NULL ); - timer->expire.tv_usec += timer->interval.tv_usec; - timer->expire.tv_sec += timer->interval.tv_sec + timer->expire.tv_usec/1000000; - timer->expire.tv_usec %= 1000000; - - timer->func = func; - timer->value = value; - - timer->next = g_timers; - g_timers = timer; -} - - -void -__glutHandleTimers( void ) -{ - __GlutTimer *cur; - struct timeval now; - - for (cur = g_timers; cur; cur = cur->next ) { - gettimeofday( &now, NULL ); - - if (cur->expire.tv_sec > now.tv_sec || - (cur->expire.tv_sec == now.tv_sec && - cur->expire.tv_usec >= now.tv_usec)) - { - g_idle = GL_FALSE; - - cur->func( cur->value ); - - cur->expire.tv_usec += cur->interval.tv_usec; - cur->expire.tv_sec += cur->interval.tv_sec + cur->expire.tv_usec/1000000; - cur->expire.tv_usec %= 1000000; - } - } -} - - -GLboolean -__glutGetTimeout( int *ret_msec ) -{ - __GlutTimer *cur; - struct timeval *time = NULL; - struct timeval now; - - for (cur = g_timers; cur; cur = cur->next) { - if (time == NULL || - time->tv_sec > cur->expire.tv_sec || - (time->tv_sec == cur->expire.tv_sec && - time->tv_usec > cur->expire.tv_usec)) { - time = &cur->expire; - } - } - - if (time == NULL) - return GL_FALSE; - - gettimeofday( &now, NULL ); - - *ret_msec = (time->tv_sec - now.tv_sec) * 1000 + - (time->tv_usec - now.tv_usec + 999) / 1000; - - return GL_TRUE; -} - - -void -__glutFreeTimers( void ) -{ - __GlutTimer *cur = g_timers; - - while (cur) { - __GlutTimer *next = cur->next; - free( cur ); - cur = next; - } - - g_timers = NULL; -} - diff --git a/src/glut/directfb/color.c b/src/glut/directfb/color.c deleted file mode 100644 index 26c514c6d5..0000000000 --- a/src/glut/directfb/color.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "internal.h" - - -void GLUTAPIENTRY -glutSetColor( int index, GLfloat red, GLfloat green, GLfloat blue ) -{ -} - - -GLfloat GLUTAPIENTRY -glutGetColor( int index, int component ) -{ - return 0.0; -} - - -void GLUTAPIENTRY -glutCopyColormap( int win ) -{ -} diff --git a/src/glut/directfb/cursor.c b/src/glut/directfb/cursor.c deleted file mode 100644 index aca3fcc921..0000000000 --- a/src/glut/directfb/cursor.c +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include - -#include "internal.h" - -#include "cursors.h" - - -void GLUTAPIENTRY -glutSetCursor( int type ) -{ - const unsigned char *cursor; - DFBSurfaceDescription dsc; - IDirectFBSurface *shape; - - if (!g_current || !g_current->window) - return; - - if (g_current->cursor == type) - return; - - switch (type) { - case GLUT_CURSOR_RIGHT_ARROW: - cursor = &cur_right_arrow[0]; - break; - case GLUT_CURSOR_LEFT_ARROW: - cursor = &cur_left_arrow[0]; - break; - case GLUT_CURSOR_INFO: - cursor = &cur_info[0]; - break; - case GLUT_CURSOR_DESTROY: - cursor = &cur_destroy[0]; - break; - case GLUT_CURSOR_HELP: - cursor = &cur_help[0]; - break; - case GLUT_CURSOR_CYCLE: - cursor = &cur_cycle[0]; - break; - case GLUT_CURSOR_SPRAY: - cursor = &cur_spray[0]; - break; - case GLUT_CURSOR_WAIT: - cursor = &cur_wait[0]; - break; - case GLUT_CURSOR_TEXT: - cursor = &cur_text[0]; - break; - case GLUT_CURSOR_CROSSHAIR: - cursor = &cur_crosshair[0]; - break; - case GLUT_CURSOR_UP_DOWN: - cursor = &cur_up_down[0]; - break; - case GLUT_CURSOR_LEFT_RIGHT: - cursor = &cur_left_right[0]; - break; - case GLUT_CURSOR_TOP_SIDE: - cursor = &cur_top_side[0]; - break; - case GLUT_CURSOR_BOTTOM_SIDE: - cursor = &cur_bottom_side[0]; - break; - case GLUT_CURSOR_LEFT_SIDE: - cursor = &cur_left_side[0]; - break; - case GLUT_CURSOR_RIGHT_SIDE: - cursor = &cur_right_side[0]; - break; - case GLUT_CURSOR_TOP_LEFT_CORNER: - cursor = &cur_top_left[0]; - break; - case GLUT_CURSOR_TOP_RIGHT_CORNER: - cursor = &cur_top_right[0]; - break; - case GLUT_CURSOR_BOTTOM_RIGHT_CORNER: - cursor = &cur_bottom_right[0]; - break; - case GLUT_CURSOR_BOTTOM_LEFT_CORNER: - cursor = &cur_bottom_left[0]; - break; - case GLUT_CURSOR_NONE: - cursor = NULL; - break; - default: - cursor = &cur_right_arrow[0]; - break; - } - - dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; - dsc.width = - dsc.height = cursor ? cursor[0] : 8; - dsc.pixelformat = DSPF_ARGB; - - if (dfb->CreateSurface( dfb, &dsc, &shape )) - return; - - if (cursor) { - __u8 *src = (__u8*) &cursor[3]; - __u8 *msk = src + cursor[0]*cursor[0]/8; - void *dst; - int pitch; - int x, y; - - if (shape->Lock( shape, DSLF_WRITE, &dst, &pitch )) { - shape->Release( shape ); - return; - } - - for (y = 0; y < cursor[0]; y++) { - for (x = 0; x < cursor[0]; x++) { - ((__u32*)dst)[x] = - ((src[x>>3] & (0x80 >> (x&7))) ? 0 : 0x00ffffff) | - ((msk[x>>3] & (0x80 >> (x&7))) ? 0xff000000 : 0); - } - - dst += pitch; - src += cursor[0]/8; - msk += cursor[0]/8; - } - - shape->Unlock( shape ); - } - else { - /* Invisible cursor */ - shape->Clear( shape, 0, 0, 0, 0 ); - } - - g_current->window->SetCursorShape( g_current->window, shape, - cursor ? cursor[1] : 0, - cursor ? cursor[2] : 0 ); - g_current->cursor = type; - - shape->Release( shape ); -} - - -void GLUTAPIENTRY -glutWarpPointer( int x, int y ) -{ - if (g_current) { - if (!g_game) { - int wx, wy; - g_current->window->GetPosition( g_current->window, &wx, &wy ); - primary->WarpCursor( primary, wx+x, wy+y ); - } - else { - g_current->cx = x; - g_current->cy = y; - } - } -} - - diff --git a/src/glut/directfb/cursors.h b/src/glut/directfb/cursors.h deleted file mode 100644 index 30ab7c348e..0000000000 --- a/src/glut/directfb/cursors.h +++ /dev/null @@ -1,306 +0,0 @@ -#ifndef __GLUT_CURSORS_H__ -#define __GLUT_CURSORS_H__ - - -static const unsigned char cur_right_arrow[] = { - 16, /* size */ - 1, 2, /* hotspot */ - /* data */ - 0x00, 0x00, 0x60, 0x00, 0x78, 0x00, 0x3e, 0x00, - 0x3f, 0x80, 0x1f, 0xe0, 0x1f, 0xf8, 0x0f, 0x80, - 0x0f, 0xc0, 0x06, 0xe0, 0x06, 0x70, 0x02, 0x38, - 0x02, 0x1c, 0x00, 0x0e, 0x00, 0x04, 0x00, 0x00, - /* mask */ - 0xe0, 0x00, 0xf8, 0x00, 0xfe, 0x00, 0x7f, 0x80, - 0x7f, 0xe0, 0x3f, 0xf8, 0x3f, 0xfc, 0x1f, 0xfc, - 0x1f, 0xe0, 0x0f, 0xf0, 0x0f, 0xf8, 0x07, 0x7c, - 0x07, 0x3e, 0x02, 0x1f, 0x00, 0x0e, 0x00, 0x04, -}; - -static const unsigned char cur_left_arrow[] = { - 16, /* size */ - 1, 15, /* hotspot */ - /* data */ - 0x00, 0x00, 0x80, 0x06, 0x00, 0x1e, 0x00, 0x7c, - 0x01, 0xfc, 0x07, 0xf8, 0x1f, 0xf8, 0x01, 0xf0, - 0x01, 0xf0, 0x02, 0x60, 0x04, 0x60, 0x08, 0x40, - 0x10, 0x40, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, - /* mask */ - 0x00, 0x07, 0x00, 0x1f, 0x00, 0x7f, 0x01, 0xfe, - 0x07, 0xfe, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, - 0x03, 0xf8, 0x07, 0xf0, 0x0e, 0xf0, 0x1c, 0xe0, - 0x38, 0xe0, 0x70, 0xe0, 0xe0, 0x00, 0xc0, 0x00, -}; - -static const unsigned char cur_info[] = { - 16, /* size */ - 0, 2, /* hotspot */ - /* data */ - 0x30, 0x00, 0x3c, 0x00, 0x0f, 0x00, 0x07, 0x80, - 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x07, 0xf4, - 0x0f, 0xfe, 0x0f, 0xfa, 0x07, 0xe0, 0x03, 0xe0, - 0x00, 0x52, 0x00, 0x46, 0x00, 0x2c, 0x00, 0x18, - /* mask */ - 0xb8, 0x00, 0x3e, 0x00, 0x1f, 0x80, 0x0f, 0xc0, - 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xfc, 0x1f, 0xfe, - 0x1f, 0xfe, 0x1f, 0xfe, 0x0f, 0xfe, 0x07, 0xfe, - 0x03, 0xfe, 0x00, 0xfe, 0x00, 0x7e, 0x00, 0x3c, -}; - -static const unsigned char cur_destroy[] = { - 16, /* size */ - 12, 8, /* hotspot */ - /* data */ - 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0c, 0xcc, - 0x0c, 0xcc, 0x07, 0xf8, 0x03, 0xf0, 0x01, 0xe0, - 0x21, 0xe1, 0x61, 0xe1, 0x10, 0xc2, 0x0e, 0x1c, - 0x01, 0xe0, 0x47, 0xf8, 0x7c, 0x0f, 0x20, 0x01, - /* mask */ - 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0xfc, 0x1f, 0xfe, - 0x1f, 0xfe, 0x0f, 0xfc, 0x07, 0xf8, 0x83, 0xf1, - 0xe3, 0xf1, 0xf3, 0xf3, 0x39, 0xef, 0x1e, 0x1e, - 0x01, 0xe0, 0xc7, 0xfe, 0xff, 0xff, 0x7c, 0x0f, -}; - -static const unsigned char cur_help[] = { - 16, /* size */ - 7, 8, /* hotspot */ - /* data */ - 0x83, 0xe0, 0x07, 0xf0, 0x0e, 0x38, 0x0c, 0x18, - 0x0c, 0x38, 0x0e, 0x30, 0x07, 0x00, 0x03, 0xc0, - 0x01, 0xc0, 0x01, 0x40, 0x01, 0x40, 0x07, 0x70, - 0x03, 0x60, 0x01, 0xc0, 0x00, 0x80, 0x00, 0x00, - /* mask */ - 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, - 0x1e, 0x3c, 0x1e, 0x7c, 0x1f, 0x78, 0x0f, 0xf0, - 0x07, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x07, 0xf0, - 0x0f, 0xf8, 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0, -}; - -static const unsigned char cur_cycle[] = { - 16, /* size */ - 7, 9, /* hotspot */ - /* data */ - 0x00, 0x00, 0x07, 0xe2, 0x0f, 0xf6, 0x18, 0x3e, - 0x10, 0x12, 0x00, 0x32, 0x00, 0x7e, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x00, 0x4c, 0x00, 0x48, 0x08, - 0x7c, 0x18, 0x6f, 0xf0, 0x47, 0xe0, 0x00, 0x00, - /* mask */ - 0x07, 0xe3, 0x0f, 0xf7, 0x1f, 0xff, 0x3f, 0xff, - 0x38, 0x3f, 0x30, 0xff, 0x00, 0xff, 0x00, 0xff, - 0xff, 0x00, 0xff, 0x00, 0xfe, 0x0c, 0xfc, 0x1c, - 0xff, 0xfc, 0xff, 0xf8, 0xef, 0xf0, 0xc7, 0xe0, -}; - -static const unsigned char cur_spray[] = { - 16, /* size */ - 2, 4, /* hotspot */ - /* data */ - 0x98, 0x00, 0x02, 0x00, 0x18, 0xb0, 0x02, 0x78, - 0x18, 0x58, 0x00, 0xfc, 0x00, 0x84, 0x00, 0x9c, - 0x00, 0x94, 0x00, 0x9c, 0x00, 0x94, 0x00, 0x9c, - 0x00, 0x9c, 0x00, 0x84, 0x00, 0x84, 0x00, 0xfc, - /* mask */ - 0x30, 0x00, 0x34, 0x60, 0x35, 0xf0, 0x35, 0xf0, - 0x35, 0xf8, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, - 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, - 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, 0x03, 0xfc, -}; - -static const unsigned char cur_wait[] = { - 16, /* size */ - 9, 1, /* hotspot */ - /* data */ - 0x07, 0xf8, 0x07, 0xf8, 0x07, 0xf8, 0x0f, 0xfc, - 0x18, 0x86, 0x30, 0x83, 0xe0, 0x81, 0xe1, 0xc1, - 0xe1, 0xc1, 0xe0, 0x21, 0x30, 0x13, 0x18, 0x06, - 0x0f, 0xfc, 0x07, 0xf8, 0x07, 0xf8, 0x07, 0xf8, - /* mask */ - 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x1f, 0xfe, - 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, - 0x1f, 0xfe, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, -}; - -static const unsigned char cur_text[] = { - 16, /* size */ - 8, 8, /* hotspot */ - /* data */ - 0x00, 0x00, 0x0f, 0x70, 0x09, 0xc0, 0x00, 0x80, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x80, 0x01, 0xc0, 0x07, 0x70, 0x00, 0x00, - /* mask */ - 0x0f, 0x78, 0x0f, 0xf8, 0x0f, 0xf8, 0x03, 0xe0, - 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, - 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, - 0x03, 0xe0, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0x78, -}; - -static const unsigned char cur_crosshair[] = { - 16, /* size */ - 7, 9, /* hotspot */ - /* data */ - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0xff, 0x7f, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, - /* mask */ - 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, - 0x01, 0xc0, 0x01, 0xc0, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, - 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, -}; - -static const unsigned char cur_up_down[] = { - 16, /* size */ - 7, 8, /* hotspot */ - /* data */ - 0x00, 0x80, 0x09, 0xc0, 0x03, 0xe0, 0x07, 0xf0, - 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, - 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x07, 0xf0, - 0x03, 0xe0, 0x01, 0xc0, 0x00, 0x80, 0x00, 0x00, - /* mask */ - 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, - 0x0f, 0xf8, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, - 0x03, 0xe0, 0x03, 0xe0, 0x0f, 0xf8, 0x0f, 0xf8, - 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0, 0x00, 0x00, -}; - -static const unsigned char cur_left_right[] = { - 16, /* size */ - 7, 8, /* hotspot */ - /* data */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x18, 0x0c, 0x3f, 0xfe, 0x78, 0x0f, - 0x3f, 0xfe, 0x18, 0x0c, 0x08, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - /* mask */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x18, - 0x1c, 0x1c, 0x3f, 0xfe, 0x7f, 0xff, 0x7f, 0xff, - 0x7f, 0xff, 0x3f, 0xfe, 0x1c, 0x1c, 0x0c, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; - -static const unsigned char cur_top_side[] = { - 16, /* size */ - 1, 8, /* hotspot */ - /* data */ - 0x00, 0x00, 0xff, 0xfe, 0x3f, 0xfe, 0x00, 0x00, - 0x00, 0x80, 0x01, 0xc0, 0x02, 0xa0, 0x04, 0x90, - 0x08, 0x88, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, - /* mask */ - 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, - 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, - 0x1d, 0xdc, 0x19, 0xcc, 0x01, 0xc0, 0x01, 0xc0, - 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, -}; - -static const unsigned char cur_bottom_side[] = { - 16, /* size */ - 14, 8, /* hotspot */ - /* data */ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x08, 0x88, - 0x04, 0x90, 0x02, 0xa0, 0x01, 0xc0, 0x00, 0x80, - 0x00, 0x00, 0x3f, 0xfe, 0x3f, 0xfe, 0x00, 0x00, - /* mask */ - 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, - 0x01, 0xc0, 0x01, 0xc0, 0x19, 0xcc, 0x1d, 0xdc, - 0x0f, 0xf8, 0x07, 0xf0, 0x03, 0xe0, 0x01, 0xc0, - 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, -}; - -static const unsigned char cur_left_side[] = { - 16, /* size */ - 7, 15, /* hotspot */ - /* data */ - 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x01, 0x06, - 0x00, 0x86, 0x00, 0x46, 0x00, 0x26, 0x7f, 0xf6, - 0x00, 0x26, 0x00, 0x46, 0x00, 0x86, 0x01, 0x06, - 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, - /* mask */ - 0x00, 0x0f, 0x00, 0x0f, 0x03, 0x0f, 0x03, 0x8f, - 0x01, 0xcf, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x00, 0xef, 0x01, 0xcf, 0x03, 0x8f, - 0x03, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x00, -}; - -static const unsigned char cur_right_side[] = { - 16, /* size */ - 7, 2, /* hotspot */ - /* data */ - 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x80, - 0x61, 0x00, 0x62, 0x00, 0x64, 0x00, 0x6f, 0xfe, - 0x64, 0x00, 0x62, 0x00, 0x61, 0x00, 0x60, 0x80, - 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - /* mask */ - 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0xc0, 0xf1, 0xc0, - 0xf3, 0x80, 0xf7, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xf7, 0x00, 0xf3, 0x80, 0xf1, 0xc0, - 0xf0, 0xc0, 0xf0, 0x00, 0xf0, 0x00, 0x00, 0x00, -}; - -static const unsigned char cur_top_left[] = { - 16, /* size */ - 1, 15, /* hotspot */ - /* data */ - 0x00, 0x00, 0xff, 0xfe, 0x7f, 0xfe, 0x00, 0x06, - 0x00, 0x06, 0x00, 0x06, 0x1f, 0xc6, 0x00, 0xc6, - 0x01, 0x46, 0x02, 0x46, 0x04, 0x46, 0x08, 0x46, - 0x10, 0x46, 0x00, 0x06, 0x00, 0x06, 0x00, 0x00, - /* mask */ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x00, 0x0f, 0x3f, 0xef, 0x3f, 0xef, 0x3f, 0xef, - 0x03, 0xef, 0x07, 0xef, 0x0e, 0xef, 0x1c, 0xef, - 0x38, 0xef, 0x30, 0xef, 0x00, 0x0f, 0x00, 0x0f, -}; - -static const unsigned char cur_top_right[] = { - 16, /* size */ - 1, 2, /* hotspot */ - /* data */ - 0x00, 0x00, 0xff, 0xfe, 0x7f, 0xfe, 0x60, 0x00, - 0x60, 0x00, 0x60, 0x00, 0x63, 0xf8, 0x63, 0x00, - 0x62, 0x80, 0x62, 0x40, 0x62, 0x20, 0x62, 0x10, - 0x62, 0x08, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, - /* mask */ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xf0, 0x00, 0xf7, 0xfc, 0xf7, 0xfc, 0xf7, 0xfc, - 0xf7, 0xc0, 0xf7, 0xe0, 0xf7, 0x70, 0xf7, 0x38, - 0xf7, 0x1c, 0xf7, 0x0c, 0xf0, 0x00, 0xf0, 0x00, -}; - -static const unsigned char cur_bottom_right[] = { - 16, /* size */ - 14, 2, /* hotspot */ - /* data */ - 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x62, 0x08, - 0x62, 0x10, 0x62, 0x20, 0x62, 0x40, 0x62, 0x80, - 0x63, 0x00, 0x63, 0xf8, 0x60, 0x00, 0x60, 0x00, - 0x60, 0x00, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00, - /* mask */ - 0xf0, 0x00, 0xf0, 0x00, 0xf7, 0x0c, 0xf7, 0x1c, - 0xf7, 0x38, 0xf7, 0x70, 0xf7, 0xe0, 0xf7, 0xc0, - 0xf7, 0xfc, 0xf7, 0xfc, 0xf7, 0xfc, 0xf0, 0x00, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -}; - -static const unsigned char cur_bottom_left[] = { - 16, /* size */ - 14, 15, /* hotspot */ - /* data */ - 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x10, 0x46, - 0x08, 0x46, 0x04, 0x46, 0x02, 0x46, 0x01, 0x46, - 0x00, 0xc6, 0x1f, 0xc6, 0x00, 0x06, 0x00, 0x06, - 0x00, 0x06, 0x7f, 0xfe, 0x7f, 0xfe, 0x00, 0x00, - /* mask */ - 0x00, 0x0f, 0x00, 0x0f, 0x30, 0xef, 0x38, 0xef, - 0x1c, 0xef, 0x0e, 0xef, 0x07, 0xef, 0x03, 0xef, - 0x3f, 0xef, 0x3f, 0xef, 0x3f, 0xef, 0x00, 0x0f, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -}; - - -#endif /* __GLUT_CURSORS_H__ */ diff --git a/src/glut/directfb/events.c b/src/glut/directfb/events.c deleted file mode 100644 index 6ebdd166ac..0000000000 --- a/src/glut/directfb/events.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include - -#include "internal.h" - - -/*****************************************************************************/ - -static int g_ignore_key_repeat = 0; - -/*****************************************************************************/ - - -int GLUTAPIENTRY -glutDeviceGet( GLenum type ) -{ - switch (type) { - case GLUT_HAS_KEYBOARD: - return (keyboard != NULL); - case GLUT_HAS_MOUSE: - return (mouse != NULL); - case GLUT_NUM_MOUSE_BUTTONS: - if (mouse) { - DFBInputDeviceDescription dsc; - mouse->GetDescription( mouse, &dsc ); - return dsc.max_button+1; - } - break; - case GLUT_DEVICE_IGNORE_KEY_REPEAT: - return g_ignore_key_repeat; - case GLUT_DEVICE_KEY_REPEAT: - return (g_ignore_key_repeat) ? GLUT_KEY_REPEAT_OFF - : GLUT_KEY_REPEAT_ON; - case GLUT_HAS_JOYSTICK: - case GLUT_OWNS_JOYSTICK: - return (g_game && joystick); /* only available in game mode */ - case GLUT_JOYSTICK_BUTTONS: - if (joystick) { - DFBInputDeviceDescription dsc; - joystick->GetDescription( joystick, &dsc ); - return dsc.max_button+1; - } - break; - case GLUT_JOYSTICK_AXES: - if (joystick) { - DFBInputDeviceDescription dsc; - joystick->GetDescription( joystick, &dsc ); - return dsc.max_axis+1; - } - break; - case GLUT_JOYSTICK_POLL_RATE: - if (joystick) - return 1; /* hack */ - break; - default: - break; - } - - return 0; -} - - -int GLUTAPIENTRY -glutGetModifiers( void ) -{ - if (g_current) - return g_current->modifiers; - return 0; -} - - -void GLUTAPIENTRY -glutIgnoreKeyRepeat( int ignore ) -{ - g_ignore_key_repeat = ignore; -} - - -void GLUTAPIENTRY -glutSetKeyRepeat( int mode ) -{ - g_ignore_key_repeat = (mode == GLUT_KEY_REPEAT_OFF); -} - - -void GLUTAPIENTRY -glutForceJoystickFunc( void ) -{ - if (g_game && joystick && joystick_func) { - joystick_func( g_game->buttons, - g_game->jx, g_game->jy, g_game->jz ); - } -} - - -static int -__glutSpecialKey( DFBInputDeviceKeySymbol key ) -{ - switch (key) { - case DIKS_F1: - return GLUT_KEY_F1; - case DIKS_F2: - return GLUT_KEY_F2; - case DIKS_F3: - return GLUT_KEY_F3; - case DIKS_F4: - return GLUT_KEY_F4; - case DIKS_F5: - return GLUT_KEY_F5; - case DIKS_F6: - return GLUT_KEY_F6; - case DIKS_F7: - return GLUT_KEY_F7; - case DIKS_F8: - return GLUT_KEY_F8; - case DIKS_F9: - return GLUT_KEY_F9; - case DIKS_F10: - return GLUT_KEY_F10; - case DIKS_F11: - return GLUT_KEY_F11; - case DIKS_F12: - return GLUT_KEY_F12; - case DIKS_CURSOR_LEFT: - return GLUT_KEY_LEFT; - case DIKS_CURSOR_UP: - return GLUT_KEY_UP; - case DIKS_CURSOR_RIGHT: - return GLUT_KEY_RIGHT; - case DIKS_CURSOR_DOWN: - return GLUT_KEY_DOWN; - case DIKS_PAGE_UP: - return GLUT_KEY_PAGE_UP; - case DIKS_PAGE_DOWN: - return GLUT_KEY_PAGE_DOWN; - case DIKS_HOME: - return GLUT_KEY_HOME; - case DIKS_END: - return GLUT_KEY_END; - case DIKS_INSERT: - return GLUT_KEY_INSERT; - default: - break; - } - - return 0; -} - - -static int -__glutButton( DFBInputDeviceButtonIdentifier button ) -{ - switch (button) { - case DIBI_LEFT: - return GLUT_LEFT_BUTTON; - case DIBI_MIDDLE: - return GLUT_MIDDLE_BUTTON; - case DIBI_RIGHT: - return GLUT_RIGHT_BUTTON; - default: - break; - } - - return 0; -} - - -static int -__glutModifiers( DFBInputDeviceModifierMask mask ) -{ - return ((mask & DIMM_SHIFT) ? GLUT_ACTIVE_SHIFT : 0) | - ((mask & DIMM_CONTROL) ? GLUT_ACTIVE_CTRL : 0) | - ((mask & DIMM_ALT) ? GLUT_ACTIVE_ALT : 0); -} - - -static void -__glutWindowEvent( DFBWindowEvent *e, DFBWindowEvent *p ) -{ - __GlutWindow *window; - - window = __glutFindWindow( e->window_id ); - if (!window) /* window was destroyed */ - return; - - switch (e->type) { - case DWET_KEYDOWN: - window->modifiers = __glutModifiers( e->modifiers ); - if (g_ignore_key_repeat && p) { - if (p->type == DWET_KEYDOWN && - p->window_id == e->window_id && - p->key_symbol == e->key_symbol) - break; - } - if (DFB_KEY_IS_ASCII( e->key_symbol )) { - if (keyboard_func) { - __glutSetWindow( window ); - keyboard_func( e->key_symbol, e->x, e->y ); - } - } - else { - int key = __glutSpecialKey( e->key_symbol ); - if (key && special_func) { - __glutSetWindow( window ); - special_func( key, e->x, e->y ); - } - } - break; - case DWET_KEYUP: - window->modifiers = __glutModifiers( e->modifiers ); - if (DFB_KEY_IS_ASCII( e->key_symbol )) { - if (keyboard_up_func) { - __glutSetWindow( window ); - keyboard_up_func( e->key_symbol, e->x, e->y ); - } - } - else { - int key = __glutSpecialKey( e->key_symbol ); - if (key && special_up_func) { - __glutSetWindow( window ); - special_up_func( key, e->x, e->y ); - } - } - break; - case DWET_BUTTONDOWN: - if (mouse_func) { - __glutSetWindow( window ); - mouse_func( __glutButton( e->button ), GLUT_DOWN, e->x, e->y ); - } - break; - case DWET_BUTTONUP: - if (mouse_func) { - __glutSetWindow( window ); - mouse_func( __glutButton( e->button ), GLUT_UP, e->x, e->y ); - } - break; - case DWET_MOTION: - if (e->buttons) { - if (motion_func) { - __glutSetWindow( window ); - motion_func( e->cx, e->cy ); - } - } - else { - if (passive_motion_func) { - __glutSetWindow( window ); - passive_motion_func( e->cx, e->cy ); - } - } - break; - case DWET_ENTER: - if (entry_func) { - __glutSetWindow( window ); - entry_func( GLUT_ENTERED ); - } - break; - case DWET_LEAVE: - if (entry_func) { - __glutSetWindow( window ); - entry_func( GLUT_LEFT ); - } - break; - case DWET_SIZE: - window->reshape = GL_TRUE; - window->redisplay = GL_TRUE; - break; - default: - break; - } -} - - -static void -__glutInputEvent( DFBInputEvent *e, DFBInputEvent *p ) -{ - __glutAssert( g_game != NULL ); - - switch (e->type) { - case DIET_KEYPRESS: - g_game->modifiers = __glutModifiers( e->modifiers ); - if (g_ignore_key_repeat && p) { - if (p->type == DIET_KEYPRESS && - p->key_symbol == e->key_symbol) - break; - } - if (DFB_KEY_IS_ASCII( e->key_symbol )) { - if (keyboard_func) { - __glutSetWindow( g_game ); - keyboard_func( e->key_symbol, g_game->cx, g_game->cy ); - } - } - else { - int key = __glutSpecialKey( e->key_symbol ); - if (key && special_func) { - __glutSetWindow( g_game ); - special_func( key, g_game->cx, g_game->cy ); - } - } - break; - case DIET_KEYRELEASE: - g_game->modifiers = __glutModifiers( e->modifiers ); - if (DFB_KEY_IS_ASCII( e->key_symbol )) { - if (keyboard_up_func) { - __glutSetWindow( g_game ); - keyboard_up_func( e->key_symbol, g_game->cx, g_game->cy ); - } - } - else { - int key = __glutSpecialKey( e->key_symbol ); - if (key && special_up_func) { - __glutSetWindow( g_game ); - special_up_func( key, g_game->cx, g_game->cy ); - } - } - break; - case DIET_BUTTONPRESS: - if (e->device_id == DIDID_JOYSTICK) { - g_game->buttons = e->buttons; - if (joystick_func) { - __glutSetWindow( g_game ); - joystick_func( g_game->buttons, - g_game->jx, g_game->jy, g_game->jz ); - } - } - else { - if (mouse_func) { - __glutSetWindow( g_game ); - mouse_func( __glutButton( e->button ), - GLUT_DOWN, g_game->cx, g_game->cy ); - } - } - break; - case DIET_BUTTONRELEASE: - if (e->device_id == DIDID_JOYSTICK) { - g_game->buttons = e->buttons; - if (joystick_func) { - __glutSetWindow( g_game ); - joystick_func( g_game->buttons, - g_game->jx, g_game->jy, g_game->jz ); - } - } - else { - if (mouse_func) { - __glutSetWindow( g_game ); - mouse_func( __glutButton( e->button ), - GLUT_UP, g_game->cx, g_game->cy ); - } - } - break; - case DIET_AXISMOTION: - if (e->device_id == DIDID_JOYSTICK) { - switch (e->axis) { - case DIAI_X: - if (e->flags & DIEF_AXISABS) - g_game->jx = e->axisabs; - else if (e->flags & DIEF_AXISREL) - g_game->jx += e->axisrel; - break; - case DIAI_Y: - if (e->flags & DIEF_AXISABS) - g_game->jy = e->axisabs; - else if (e->flags & DIEF_AXISREL) - g_game->jy += e->axisrel; - break; - case DIAI_Z: - if (e->flags & DIEF_AXISABS) - g_game->jz = e->axisabs; - else if (e->flags & DIEF_AXISREL) - g_game->jz += e->axisrel; - break; - default: - break; - } - if (joystick_func) { - __glutSetWindow( g_game ); - joystick_func( g_game->buttons, - g_game->jx, g_game->jy, g_game->jz ); - } - } - else { - switch (e->axis) { - case DIAI_X: - if (e->flags & DIEF_AXISABS) - g_game->cx = e->axisabs; - else if (e->flags & DIEF_AXISREL) - g_game->cx += e->axisrel; - break; - case DIAI_Y: - if (e->flags & DIEF_AXISABS) - g_game->cy = e->axisabs; - else if (e->flags & DIEF_AXISREL) - g_game->cy += e->axisrel; - break; - default: - return; - } - if (e->buttons && motion_func) { - __glutSetWindow( g_game ); - motion_func( g_game->cx, g_game->cy ); - } - else if (!e->buttons && passive_motion_func) { - __glutSetWindow( g_game ); - passive_motion_func( g_game->cx, g_game->cy ); - } - } - break; - default: - break; - } -} - - -void GLUTAPIENTRY -glutMainLoop( void ) -{ - __glutAssert( events != NULL ); - - __glutHandleWindows(); - - while (GL_TRUE) { - DFBEvent evt, prev; - - g_idle = GL_TRUE; - - __glutHandleTimers(); - - prev.clazz = DFEC_NONE; - - while (events->GetEvent( events, &evt ) == DFB_OK) { - g_idle = GL_FALSE; - - switch (evt.clazz) { - case DFEC_WINDOW: - if (prev.clazz == DFEC_WINDOW) - __glutWindowEvent( &evt.window, &prev.window ); - else - __glutWindowEvent( &evt.window, NULL ); - break; - case DFEC_INPUT: - if (prev.clazz == DFEC_INPUT) - __glutInputEvent( &evt.input, &prev.input ); - else - __glutInputEvent( &evt.input, NULL ); - break; - default: - __glutWarning( "unexpected event class %d!\n", evt.clazz ); - break; - } - - prev = evt; - - __glutHandleTimers(); - } - - __glutHandleWindows(); - - if (g_idle) { - if (idle_func) { - idle_func(); - } - else { - int msec; - __glutSetWindow( NULL ); - if (__glutGetTimeout( &msec )) - events->WaitForEventWithTimeout( events, msec/1000, msec%1000 ); - else - events->WaitForEvent( events ); - } - } - } -} - diff --git a/src/glut/directfb/ext.c b/src/glut/directfb/ext.c deleted file mode 100644 index e37ecf5afa..0000000000 --- a/src/glut/directfb/ext.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include - -#include "internal.h" - - -static const struct { - const char *name; - const GLUTproc address; -} glut_functions[] = { - { "glutInit", (const GLUTproc) glutInit }, - { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode }, - { "glutInitDisplayString", (const GLUTproc) glutInitDisplayString }, - { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition }, - { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize }, - { "glutMainLoop", (const GLUTproc) glutMainLoop }, - { "glutCreateWindow", (const GLUTproc) glutCreateWindow }, - { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow }, - { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow }, - { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay }, - { "glutPostWindowRedisplay", (const GLUTproc) glutPostWindowRedisplay }, - { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers }, - { "glutGetWindow", (const GLUTproc) glutGetWindow }, - { "glutSetWindow", (const GLUTproc) glutSetWindow }, - { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle }, - { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle }, - { "glutPositionWindow", (const GLUTproc) glutPositionWindow }, - { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow }, - { "glutPopWindow", (const GLUTproc) glutPopWindow }, - { "glutPushWindow", (const GLUTproc) glutPushWindow }, - { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow }, - { "glutShowWindow", (const GLUTproc) glutShowWindow }, - { "glutHideWindow", (const GLUTproc) glutHideWindow }, - { "glutFullScreen", (const GLUTproc) glutFullScreen }, - { "glutSetCursor", (const GLUTproc) glutSetCursor }, - { "glutWarpPointer", (const GLUTproc) glutWarpPointer }, - { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay }, - { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay }, - { "glutUseLayer", (const GLUTproc) glutUseLayer }, - { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay }, - { "glutPostWindowOverlayRedisplay", (const GLUTproc) glutPostWindowOverlayRedisplay }, - { "glutShowOverlay", (const GLUTproc) glutShowOverlay }, - { "glutHideOverlay", (const GLUTproc) glutHideOverlay }, - { "glutCreateMenu", (const GLUTproc) glutCreateMenu }, - { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu }, - { "glutGetMenu", (const GLUTproc) glutGetMenu }, - { "glutSetMenu", (const GLUTproc) glutSetMenu }, - { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry }, - { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu }, - { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry }, - { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu }, - { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem }, - { "glutAttachMenu", (const GLUTproc) glutAttachMenu }, - { "glutDetachMenu", (const GLUTproc) glutDetachMenu }, - { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc }, - { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc }, - { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc }, - { "glutMouseFunc", (const GLUTproc) glutMouseFunc }, - { "glutMotionFunc", (const GLUTproc) glutMotionFunc }, - { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc }, - { "glutEntryFunc", (const GLUTproc) glutEntryFunc }, - { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc }, - { "glutIdleFunc", (const GLUTproc) glutIdleFunc }, - { "glutTimerFunc", (const GLUTproc) glutTimerFunc }, - { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc }, - { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc }, - { "glutSpaceballMotionFunc", (const GLUTproc) glutSpaceballMotionFunc }, - { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc }, - { "glutSpaceballButtonFunc", (const GLUTproc) glutSpaceballButtonFunc }, - { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc }, - { "glutDialsFunc", (const GLUTproc) glutDialsFunc }, - { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc }, - { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc }, - { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc }, - { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc }, - { "glutWindowStatusFunc", (const GLUTproc) glutWindowStatusFunc }, - { "glutKeyboardUpFunc", (const GLUTproc) glutKeyboardUpFunc }, - { "glutSpecialUpFunc", (const GLUTproc) glutSpecialUpFunc }, - { "glutJoystickFunc", (const GLUTproc) glutJoystickFunc }, - { "glutSetColor", (const GLUTproc) glutSetColor }, - { "glutGetColor", (const GLUTproc) glutGetColor }, - { "glutCopyColormap", (const GLUTproc) glutCopyColormap }, - { "glutGet", (const GLUTproc) glutGet }, - { "glutDeviceGet", (const GLUTproc) glutDeviceGet }, - { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported }, - { "glutGetModifiers", (const GLUTproc) glutGetModifiers }, - { "glutLayerGet", (const GLUTproc) glutLayerGet }, - { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress }, - { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter }, - { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth }, - { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter }, - { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth }, - { "glutBitmapLength", (const GLUTproc) glutBitmapLength }, - { "glutStrokeLength", (const GLUTproc) glutStrokeLength }, - { "glutWireSphere", (const GLUTproc) glutWireSphere }, - { "glutSolidSphere", (const GLUTproc) glutSolidSphere }, - { "glutWireCone", (const GLUTproc) glutWireCone }, - { "glutSolidCone", (const GLUTproc) glutSolidCone }, - { "glutWireCube", (const GLUTproc) glutWireCube }, - { "glutSolidCube", (const GLUTproc) glutSolidCube }, - { "glutWireTorus", (const GLUTproc) glutWireTorus }, - { "glutSolidTorus", (const GLUTproc) glutSolidTorus }, - { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron }, - { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron }, - { "glutWireTeapot", (const GLUTproc) glutWireTeapot }, - { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot }, - { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron }, - { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron }, - { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron }, - { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron }, - { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron }, - { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron }, -// { "glutVideoResizeGet", (const GLUTproc) glutVideoResizeGet }, -// { "glutSetupVideoResizing", (const GLUTproc) glutSetupVideoResizing }, -// { "glutStopVideoResizing", (const GLUTproc) glutStopVideoResizing }, -// { "glutVideoResize", (const GLUTproc) glutVideoResize }, -// { "glutVideoPan", (const GLUTproc) glutVideoPan }, - { "glutReportErrors", (const GLUTproc) glutReportErrors }, - { "glutIgnoreKeyRepeat", (const GLUTproc) glutIgnoreKeyRepeat }, - { "glutSetKeyRepeat", (const GLUTproc) glutSetKeyRepeat }, - { "glutForceJoystickFunc", (const GLUTproc) glutForceJoystickFunc }, - { "glutGameModeString", (const GLUTproc) glutGameModeString }, - { "glutEnterGameMode", (const GLUTproc) glutEnterGameMode }, - { "glutLeaveGameMode", (const GLUTproc) glutLeaveGameMode }, - { "glutGameModeGet", (const GLUTproc) glutGameModeGet }, -}; - - -GLUTproc GLUTAPIENTRY -glutGetProcAddress( const char *name ) -{ - int i; - - for (i = 0; i < sizeof(glut_functions)/sizeof(glut_functions[0]); i++) { - if (!strcmp( name, glut_functions[i].name )) - return glut_functions[i].address; - } - -#if DIRECTFBGL_INTERFACE_VERSION >= 1 - if (g_current) { - void *address = NULL; - g_current->gl->GetProcAddress( g_current->gl, name, &address ); - return address; - } -#endif - return NULL; -} - - -int GLUTAPIENTRY -glutExtensionSupported( const char *name ) -{ - GLubyte *extensions; - int length; - - if (!name || !*name) - return 0; - - length = strlen( name ); - extensions = (GLubyte*) glGetString( GL_EXTENSIONS ); - - while (extensions && *extensions) { - GLubyte *next; - - next = strchr( extensions, ' ' ); - if (next) { - if (length == (int)(next - extensions)) { - if (!strncmp( extensions, name, length )) - return 1; - } - extensions = next+1; - } - else { - if (!strcmp( extensions, name )) - return 1; - break; - } - } - - return 0; -} - diff --git a/src/glut/directfb/font.c b/src/glut/directfb/font.c deleted file mode 100644 index 0139cddbec..0000000000 --- a/src/glut/directfb/font.c +++ /dev/null @@ -1,213 +0,0 @@ -/* Copyright (c) Mark J. Kilgard, 1994, 1998. - - This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include "internal.h" -#include "font.h" - - -#if defined(_WIN32) || defined (GLUT_IMPORT_LIB) - -static inline void* -__glutFont( void *font ) -{ - switch((long)font) { - case (long)GLUT_STROKE_ROMAN: - return &glutStrokeRoman; - case (long)GLUT_STROKE_MONO_ROMAN: - return &glutStrokeMonoRoman; - case (long)GLUT_BITMAP_9_BY_15: - return &glutBitmap9By15; - case (long)GLUT_BITMAP_8_BY_13: - return &glutBitmap8By13; - case (long)GLUT_BITMAP_TIMES_ROMAN_10: - return &glutBitmapTimesRoman10; - case (long)GLUT_BITMAP_TIMES_ROMAN_24: - return &glutBitmapTimesRoman24; - case (long)GLUT_BITMAP_HELVETICA_10: - return &glutBitmapHelvetica10; - case (long)GLUT_BITMAP_HELVETICA_12: - return &glutBitmapHelvetica12; - case (long)GLUT_BITMAP_HELVETICA_18: - return &glutBitmapHelvetica18; - } - - return NULL; -} - -#else - -static inline void* -__glutFont( void *font ) -{ - return font; -} - -#endif - - -void GLUTAPIENTRY -glutBitmapCharacter( GLUTbitmapFont font, int c ) -{ - const BitmapCharRec *ch; - BitmapFontPtr fontinfo; - GLint swapbytes, lsbfirst, rowlength; - GLint skiprows, skippixels, alignment; - - fontinfo = (BitmapFontPtr) __glutFont( font ); - - if (!fontinfo || c < fontinfo->first || - c >= fontinfo->first + fontinfo->num_chars) - return; - - ch = fontinfo->ch[c - fontinfo->first]; - if (ch) { - /* Save current modes. */ - glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes); - glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst); - glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength); - glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows); - glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels); - glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); - /* Little endian machines (DEC Alpha for example) could - benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE - instead of GL_FALSE, but this would require changing the - generated bitmaps too. */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, - ch->advance, 0, ch->bitmap); - /* Restore saved modes. */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); - glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst); - glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength); - glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); - glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); - } -} - - -int GLUTAPIENTRY -glutBitmapWidth( GLUTbitmapFont font, int c ) -{ - BitmapFontPtr fontinfo; - const BitmapCharRec *ch; - - fontinfo = (BitmapFontPtr) __glutFont( font ); - - if (!fontinfo || c < fontinfo->first || - c >= fontinfo->first + fontinfo->num_chars) - return 0; - - ch = fontinfo->ch[c - fontinfo->first]; - if (ch) - return ch->advance; - - return 0; -} - - -int GLUTAPIENTRY -glutBitmapLength( GLUTbitmapFont font, const unsigned char *string ) -{ - int c, length; - BitmapFontPtr fontinfo; - const BitmapCharRec *ch; - - fontinfo = (BitmapFontPtr) __glutFont( font ); - if (!fontinfo) - return 0; - - for (length = 0; *string != '\0'; string++) { - c = *string; - if (c >= fontinfo->first && - c < fontinfo->first + fontinfo->num_chars) { - ch = fontinfo->ch[c - fontinfo->first]; - if (ch) - length += ch->advance; - } - } - - return length; -} - - -void GLUTAPIENTRY -glutStrokeCharacter( GLUTstrokeFont font, int c ) -{ - const StrokeCharRec *ch; - const StrokeRec *stroke; - const CoordRec *coord; - StrokeFontPtr fontinfo; - int i, j; - - fontinfo = (StrokeFontPtr) __glutFont( font ); - - if (!fontinfo || c < 0 || c >= fontinfo->num_chars) - return; - - ch = &(fontinfo->ch[c]); - if (ch) { - for (i = ch->num_strokes, stroke = ch->stroke; - i > 0; i--, stroke++) { - glBegin(GL_LINE_STRIP); - for (j = stroke->num_coords, coord = stroke->coord; - j > 0; j--, coord++) { - glVertex2f(coord->x, coord->y); - } - glEnd(); - } - glTranslatef(ch->right, 0.0, 0.0); - } -} - - -int GLUTAPIENTRY -glutStrokeWidth( GLUTstrokeFont font, int c ) -{ - StrokeFontPtr fontinfo; - const StrokeCharRec *ch; - - fontinfo = (StrokeFontPtr) __glutFont( font ); - - if (!fontinfo || c < 0 || c >= fontinfo->num_chars) - return 0; - - ch = &(fontinfo->ch[c]); - if (ch) - return ch->right; - - return 0; -} - - -int GLUTAPIENTRY -glutStrokeLength( GLUTstrokeFont font, const unsigned char *string ) -{ - int c, length; - StrokeFontPtr fontinfo; - const StrokeCharRec *ch; - - fontinfo = (StrokeFontPtr) __glutFont( font ); - if (!fontinfo) - return 0; - - for (length = 0; *string != '\0'; string++) { - c = *string; - if (c >= 0 && c < fontinfo->num_chars) { - ch = &(fontinfo->ch[c]); - if (ch) - length += ch->right; - } - } - - return length; -} - diff --git a/src/glut/directfb/font.h b/src/glut/directfb/font.h deleted file mode 100644 index b1e76838a0..0000000000 --- a/src/glut/directfb/font.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) Mark J. Kilgard, 1994, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#ifndef __GLUT_FONT_H__ -#define __GLUT_FONT_H__ - - -typedef struct { - const GLsizei width; - const GLsizei height; - const GLfloat xorig; - const GLfloat yorig; - const GLfloat advance; - const GLubyte *bitmap; -} BitmapCharRec, *BitmapCharPtr; - -typedef struct { - const char *name; - const int num_chars; - const int first; - const BitmapCharRec * const *ch; -} BitmapFontRec, *BitmapFontPtr; - -typedef void *GLUTbitmapFont; - - -typedef struct { - float x; - float y; -} CoordRec, *CoordPtr; - -typedef struct { - int num_coords; - const CoordRec *coord; -} StrokeRec, *StrokePtr; - -typedef struct { - int num_strokes; - const StrokeRec *stroke; - float center; - float right; -} StrokeCharRec, *StrokeCharPtr; - -typedef struct { - const char *name; - int num_chars; - const StrokeCharRec *ch; - float top; - float bottom; -} StrokeFontRec, *StrokeFontPtr; - -typedef void *GLUTstrokeFont; - - -#endif /* __GLUT_FONT_H__ */ diff --git a/src/glut/directfb/game.c b/src/glut/directfb/game.c deleted file mode 100644 index 4c027a68f6..0000000000 --- a/src/glut/directfb/game.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include - -#include "internal.h" - - -/*****************************************************************************/ - -static int g_display_changed = 0; - -/*****************************************************************************/ - - -void GLUTAPIENTRY -glutGameModeString( const char *string ) -{ - int x, y, bpp; - char *tmp; - - if (!string) - return; - - tmp = strchr( string, 'x' ); - if (tmp) { - x = strtol( string, NULL, 10 ); - y = strtol( tmp+1, NULL, 10 ); - - if (x > 0 && y > 0) { - g_width = x; - g_height = y; - } - } - - tmp = strchr( string, ':' ); - if (tmp) { - bpp = strtol( tmp+1, NULL, 10 ); - - if (bpp > 0) - g_bpp = bpp; - } -} - - -int GLUTAPIENTRY -glutEnterGameMode( void ) -{ - DFBDisplayLayerConfig prev, cur; - - glutInit( NULL, NULL ); - - primary->GetConfiguration( primary, &prev ); - primary->SetCooperativeLevel( primary, DLSCL_EXCLUSIVE ); - - if (g_game) - __glutDestroyWindow( g_game ); - - g_game = __glutCreateWindow( GL_TRUE ); - if (!g_game) - return 0; - - __glutSetWindow( g_game ); - g_game->cursor = GLUT_CURSOR_NONE; - - primary->GetConfiguration( primary, &cur ); - g_display_changed = (cur.width != prev.width || - cur.height != prev.height || - cur.pixelformat != prev.pixelformat); - - return g_game->id; -} - - -void GLUTAPIENTRY -glutLeaveGameMode( void ) -{ - if (g_game) - __glutDestroyWindow( g_game ); - - primary->SetCooperativeLevel( primary, DLSCL_ADMINISTRATIVE ); -} - - -int GLUTAPIENTRY -glutGameModeGet( GLenum type ) -{ - switch (type) { - case GLUT_GAME_MODE_ACTIVE: - return (g_game != NULL); - case GLUT_GAME_MODE_POSSIBLE: - if (primary) { - DFBDisplayLayerConfig c; - c.flags = DLCONF_WIDTH | DLCONF_HEIGHT; - c.width = g_width; - c.height = g_height; - /* XXX: bpp */ - if (primary->TestConfiguration( primary, &c, 0 ) == DFB_OK) - return 1; - } - break; - case GLUT_GAME_MODE_WIDTH: - if (g_game) { - int w; - g_game->surface->GetSize( g_game->surface, &w, 0 ); - return w; - } - break; - case GLUT_GAME_MODE_HEIGHT: - if (g_game) { - int h; - g_game->surface->GetSize( g_game->surface, 0, &h ); - return h; - } - break; - case GLUT_GAME_MODE_PIXEL_DEPTH: - if (g_game) { - DFBSurfacePixelFormat f; - g_game->surface->GetPixelFormat( g_game->surface, &f ); - return DFB_COLOR_BITS_PER_PIXEL( f ); - } - break; - case GLUT_GAME_MODE_REFRESH_RATE: - return 60; /* assume 60hz */ - case GLUT_GAME_MODE_DISPLAY_CHANGED: - return g_display_changed; - default: - break; - } - - return 0; -} - - - diff --git a/src/glut/directfb/globals.c b/src/glut/directfb/globals.c deleted file mode 100644 index 2a5291137e..0000000000 --- a/src/glut/directfb/globals.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "internal.h" - -IDirectFB *dfb = NULL; -IDirectFBDisplayLayer *primary = NULL; -IDirectFBEventBuffer *events = NULL; -IDirectFBInputDevice *keyboard = NULL; -IDirectFBInputDevice *mouse = NULL; -IDirectFBInputDevice *joystick = NULL; - -GLenum g_display_mode = 0; -GLuint g_width = DEFAULT_WIDTH; -GLuint g_height = DEFAULT_HEIGHT; -GLint g_xpos = 0; -GLint g_ypos = 0; -GLint g_bpp = 0; -GLboolean g_idle = GL_TRUE; -__GlutWindow *g_current = NULL; -__GlutWindow *g_game = NULL; - - -void (GLUTCALLBACK *display_func) (void) = 0; -void (GLUTCALLBACK *reshape_func) (int width, int height) = 0; -void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y) = 0; -void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y) = 0; -void (GLUTCALLBACK *motion_func) (int x, int y) = 0; -void (GLUTCALLBACK *passive_motion_func) (int x, int y) = 0; -void (GLUTCALLBACK *entry_func) (int state) = 0; -void (GLUTCALLBACK *visibility_func) (int state) = 0; -void (GLUTCALLBACK *idle_func) (void) = 0; -void (GLUTCALLBACK *menu_state_func) (int state) = 0; -void (GLUTCALLBACK *special_func) (int key, int x, int y) = 0; -void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z) = 0; -void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z) = 0; -void (GLUTCALLBACK *spaceball_button_func) (int button, int state) = 0; -void (GLUTCALLBACK *button_box_func) (int button, int state) = 0; -void (GLUTCALLBACK *dials_func) (int dial, int value) = 0; -void (GLUTCALLBACK *tablet_motion_func) (int x, int y) = 0; -void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y) = 0; -void (GLUTCALLBACK *menu_status_func) (int status, int x, int y) = 0; -void (GLUTCALLBACK *overlay_display_func) (void) = 0; -void (GLUTCALLBACK *window_status_func) (int state) = 0; -void (GLUTCALLBACK *keyboard_up_func) (unsigned char key, int x, int y) = 0; -void (GLUTCALLBACK *special_up_func) (int key, int x, int y) = 0; -void (GLUTCALLBACK *joystick_func) (unsigned int buttons, int x, int y, int z) = 0; diff --git a/src/glut/directfb/init.c b/src/glut/directfb/init.c deleted file mode 100644 index ba1a49adf2..0000000000 --- a/src/glut/directfb/init.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include - -#include "internal.h" - - -static void -__glutExit( void ) -{ - __glutFreeTimers(); - __glutDestroyWindows(); - - if (events) { - events->Release( events ); - events = NULL; - } - - if (joystick) { - joystick->Release( joystick ); - joystick = NULL; - } - - if (mouse) { - mouse->Release( mouse ); - mouse = NULL; - } - - if (keyboard) { - keyboard->Release( keyboard ); - keyboard = NULL; - } - - if (primary) { - primary->Release( primary ); - primary = NULL; - } - - if (dfb) { - dfb->Release( dfb ); - dfb = NULL; - } -} - - -void GLUTAPIENTRY -glutInit( int *argcp, char **argv ) -{ - DFBResult ret; - - if (dfb) - return; - - glutGet( GLUT_ELAPSED_TIME ); - - ret = DirectFBInit( argcp, argv ? &argv : NULL ); - if (ret) - DirectFBErrorFatal( "DirectFBInit()", ret ); - - ret = DirectFBCreate( &dfb ); - if (ret) - DirectFBErrorFatal( "DirectFBCreate()", ret ); - - ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &primary ); - if (ret) - DirectFBErrorFatal( "IDirectFB::GetDisplayLayer()", ret ); - - ret = dfb->CreateEventBuffer( dfb, &events ); - if (ret) - DirectFBErrorFatal( "IDirectFB::CreateEventBuffer()", ret ); - - dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard ); - dfb->GetInputDevice( dfb, DIDID_MOUSE, &mouse ); - dfb->GetInputDevice( dfb, DIDID_JOYSTICK, &joystick ); - - primary->SetCooperativeLevel( primary, DLSCL_ADMINISTRATIVE ); - - atexit( __glutExit ); -} - - -void GLUTAPIENTRY -glutInitDisplayMode( unsigned int mode ) -{ - g_display_mode = mode; -} - - -void GLUTAPIENTRY -glutInitWindowPosition( int x, int y ) -{ - g_xpos = x; - g_ypos = y; -} - - -void GLUTAPIENTRY -glutInitWindowSize( int width, int height ) -{ - g_width = width; - g_height = height; -} - - -void GLUTAPIENTRY -glutInitDisplayString( const char *string ) -{ -} - diff --git a/src/glut/directfb/internal.h b/src/glut/directfb/internal.h deleted file mode 100644 index 55c4b5ce28..0000000000 --- a/src/glut/directfb/internal.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef __GLUT_INTERNAL_H__ -#define __GLUT_INTERNAL_H__ - -#include -#include - -#include -#include - -#include - -#include "GL/glut.h" - - -#define VERSION_CODE( M, m, r ) (((M) << 16) | ((m) << 8) | ((r))) - -#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ - DIRECTFB_MINOR_VERSION, \ - DIRECTFB_MICRO_VERSION ) - - -#define DEFAULT_WIDTH 640 -#define DEFAULT_HEIGHT 480 - -/* - * Window request flags - */ -#define WINDOW_REQUEST_POSITION 0x00000001 -#define WINDOW_REQUEST_RESIZE 0x00000002 -#define WINDOW_REQUEST_RESTACK 0x00000004 -#define WINDOW_REQUEST_SHOW 0x00000008 -#define WINDOW_REQUEST_HIDE 0x00000010 -#define WINDOW_REQUEST_DESTROY 0x00000020 - -/* - * GLUT Window implementation - */ -typedef struct __GlutWindow_s { - int id; - DFBWindowID wid; - - IDirectFBWindow *window; /* NULL = fullscreen (game mode) */ - IDirectFBSurface *surface; - IDirectFBGL *gl; - - /* display mode */ - GLenum mode; - - /* cursor position in fullscreen mode */ - int cx; - int cy; - /* joystick position */ - int jx; - int jy; - int jz; - /* pressed modifiers */ - int modifiers; - /* pressed buttons */ - int buttons; - /* current cursor shape */ - int cursor; - - struct { - int flags; - int x; - int y; - int w; - int h; - int z; - } req; - - GLboolean visible; - GLboolean redisplay; - GLboolean reshape; - GLboolean visibility; - - struct __GlutWindow_s *next; - struct __GlutWindow_s *prev; -} __GlutWindow; - - -/* Global Vars */ -extern IDirectFB *dfb; -extern IDirectFBDisplayLayer *primary; -extern IDirectFBEventBuffer *events; -extern IDirectFBInputDevice *keyboard; -extern IDirectFBInputDevice *mouse; -extern IDirectFBInputDevice *joystick; - -extern GLenum g_display_mode; -extern GLuint g_width; -extern GLuint g_height; -extern GLint g_xpos; -extern GLint g_ypos; -extern GLint g_bpp; -extern GLboolean g_idle; -extern __GlutWindow *g_current; -extern __GlutWindow *g_game; - - -/* Global Funcs */ -/* window.c */ -extern __GlutWindow* __glutCreateWindow( GLboolean fullscreen ); -extern __GlutWindow* __glutFindWindow( DFBWindowID id ); -extern void __glutSetWindow( __GlutWindow *window ); -extern void __glutHandleWindows( void ); -extern void __glutDestroyWindow( __GlutWindow *window ); -extern void __glutDestroyWindows( void ); -/* callback.c */ -extern void __glutHandleTimers( void ); -extern GLboolean __glutGetTimeout( int *ret_msec ); -extern void __glutFreeTimers( void ); - - -/* Global Callbacks */ -extern void (GLUTCALLBACK *display_func) (void); -extern void (GLUTCALLBACK *reshape_func) (int width, int height); -extern void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y); -extern void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y); -extern void (GLUTCALLBACK *motion_func) (int x, int y); -extern void (GLUTCALLBACK *passive_motion_func) (int x, int y); -extern void (GLUTCALLBACK *entry_func) (int state); -extern void (GLUTCALLBACK *visibility_func) (int state); -extern void (GLUTCALLBACK *idle_func) (void); -extern void (GLUTCALLBACK *menu_state_func) (int state); -extern void (GLUTCALLBACK *special_func) (int key, int x, int y); -extern void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z); -extern void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z); -extern void (GLUTCALLBACK *spaceball_button_func) (int button, int state); -extern void (GLUTCALLBACK *button_box_func) (int button, int state); -extern void (GLUTCALLBACK *dials_func) (int dial, int value); -extern void (GLUTCALLBACK *tablet_motion_func) (int x, int y); -extern void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y); -extern void (GLUTCALLBACK *menu_status_func) (int status, int x, int y); -extern void (GLUTCALLBACK *overlay_display_func) (void); -extern void (GLUTCALLBACK *window_status_func) (int state); -extern void (GLUTCALLBACK *keyboard_up_func) (unsigned char key, int x, int y); -extern void (GLUTCALLBACK *special_up_func) (int key, int x, int y); -extern void (GLUTCALLBACK *joystick_func) (unsigned int buttons, int x, int y, int z); - - -#ifdef DEBUG -# define __glutAssert( exp ) {\ - if (!(exp)) {\ - fprintf( stderr, "(!!) *** Assertion [%s] failed in %s() ***\n",\ - #exp, __FUNCTION__ ); - fflush( stderr );\ - exit( -1 );\ - }\ - } -#else -# define __glutAssert( exp ) -#endif - -#define __glutWarning( format, ... ) {\ - fprintf( stderr, "(!) GLUT: " format "!\n", ## __VA_ARGS__ );\ - fflush( stderr );\ -} - -#define __glutFatalError( format, ... ) {\ - fprintf( stderr, "(!) GLUT: " format "!\n", ## __VA_ARGS__ );\ - fprintf( stderr, "\t-> from %s() at line %d\n", __FUNCTION__, __LINE__ );\ - fflush( stderr );\ - exit( -1 );\ -} - - -#endif /* __GLUT_INTERNAL_H__ */ - diff --git a/src/glut/directfb/menu.c b/src/glut/directfb/menu.c deleted file mode 100644 index 400e966bbb..0000000000 --- a/src/glut/directfb/menu.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "internal.h" - - -int GLUTAPIENTRY -glutCreateMenu( void (GLUTCALLBACK *func) (int) ) -{ - return 0; -} - -void GLUTAPIENTRY -glutDestroyMenu( int menu ) -{ -} - - -int GLUTAPIENTRY -glutGetMenu( void ) -{ - return 0; -} - - -void GLUTAPIENTRY -glutSetMenu( int menu ) -{ -} - - -void GLUTAPIENTRY -glutAddMenuEntry( const char *label, int value ) -{ -} - - -void GLUTAPIENTRY -glutAddSubMenu( const char *label, int submenu ) -{ -} - - -void GLUTAPIENTRY -glutChangeToMenuEntry( int item, const char *label, int value ) -{ -} - - -void GLUTAPIENTRY -glutChangeToSubMenu( int item, const char *label, int submenu ) -{ -} - - -void GLUTAPIENTRY -glutRemoveMenuItem( int item ) -{ -} - - -void GLUTAPIENTRY -glutAttachMenu( int button ) -{ -} - - -void GLUTAPIENTRY -glutDetachMenu( int button ) -{ -} diff --git a/src/glut/directfb/models.c b/src/glut/directfb/models.c deleted file mode 100644 index d96a8f5077..0000000000 --- a/src/glut/directfb/models.c +++ /dev/null @@ -1,599 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/** -(c) Copyright 1993, Silicon Graphics, Inc. - -ALL RIGHTS RESERVED - -Permission to use, copy, modify, and distribute this software -for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that -both the copyright notice and this permission notice appear in -supporting documentation, and that the name of Silicon -Graphics, Inc. not be used in advertising or publicity -pertaining to distribution of the software without specific, -written prior permission. - -THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU -"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR -OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO -EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE -ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, -INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, -SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR -NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR -PERFORMANCE OF THIS SOFTWARE. - -US Government Users Restricted Rights - -Use, duplication, or disclosure by the Government is subject to -restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -(c)(1)(ii) of the Rights in Technical Data and Computer -Software clause at DFARS 252.227-7013 and/or in similar or -successor clauses in the FAR or the DOD or NASA FAR -Supplement. Unpublished-- rights reserved under the copyright -laws of the United States. Contractor/manufacturer is Silicon -Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA -94039-7311. - -OpenGL(TM) is a trademark of Silicon Graphics, Inc. -*/ - -#include -#include -#include - -#include "internal.h" - -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -static GLUquadricObj *quadObj; - -#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } - -static void -initQuadObj(void) -{ - quadObj = gluNewQuadric(); - if (!quadObj) - __glutFatalError("out of memory"); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireSphere(GLdouble radius, GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_LINE); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluSphere(quadObj, radius, slices, stacks); -} - -void GLUTAPIENTRY -glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_FILL); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluSphere(quadObj, radius, slices, stacks); -} - -void GLUTAPIENTRY -glutWireCone(GLdouble base, GLdouble height, - GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_LINE); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluCylinder(quadObj, base, 0.0, height, slices, stacks); -} - -void GLUTAPIENTRY -glutSolidCone(GLdouble base, GLdouble height, - GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_FILL); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluCylinder(quadObj, base, 0.0, height, slices, stacks); -} - -/* ENDCENTRY */ - -static void -drawBox(GLfloat size, GLenum type) -{ - static GLfloat n[6][3] = - { - {-1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {1.0, 0.0, 0.0}, - {0.0, -1.0, 0.0}, - {0.0, 0.0, 1.0}, - {0.0, 0.0, -1.0} - }; - static GLint faces[6][4] = - { - {0, 1, 2, 3}, - {3, 2, 6, 7}, - {7, 6, 5, 4}, - {4, 5, 1, 0}, - {5, 6, 2, 1}, - {7, 4, 0, 3} - }; - GLfloat v[8][3]; - GLint i; - - v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; - v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; - v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; - v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; - v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; - v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; - - for (i = 5; i >= 0; i--) { - glBegin(type); -/* glNormal3fv(&n[i][0]); */ - glVertex3fv(&v[faces[i][0]][0]); - glVertex3fv(&v[faces[i][1]][0]); - glVertex3fv(&v[faces[i][2]][0]); - glVertex3fv(&v[faces[i][3]][0]); - glEnd(); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireCube(GLdouble size) -{ - drawBox(size, GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidCube(GLdouble size) -{ - drawBox(size, GL_QUADS); -} - -/* ENDCENTRY */ - -static void -doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) -{ - int i, j; - GLfloat theta, phi, theta1; - GLfloat cosTheta, sinTheta; - GLfloat cosTheta1, sinTheta1; - GLfloat ringDelta, sideDelta; - - ringDelta = 2.0 * M_PI / rings; - sideDelta = 2.0 * M_PI / nsides; - - theta = 0.0; - cosTheta = 1.0; - sinTheta = 0.0; - for (i = rings - 1; i >= 0; i--) { - theta1 = theta + ringDelta; - cosTheta1 = cos(theta1); - sinTheta1 = sin(theta1); - glBegin(GL_QUAD_STRIP); - phi = 0.0; - for (j = nsides; j >= 0; j--) { - GLfloat cosPhi, sinPhi, dist; - - phi += sideDelta; - cosPhi = cos(phi); - sinPhi = sin(phi); - dist = R + r * cosPhi; - -/* glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); */ - glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); -/* glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); */ - glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); - } - glEnd(); - theta = theta1; - cosTheta = cosTheta1; - sinTheta = sinTheta1; - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, - GLint nsides, GLint rings) -{ -/* glPushAttrib(GL_POLYGON_BIT); */ -/* glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); */ - doughnut(innerRadius, outerRadius, nsides, rings); -/* glPopAttrib(); */ -} - -void GLUTAPIENTRY -glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, - GLint nsides, GLint rings) -{ - doughnut(innerRadius, outerRadius, nsides, rings); -} - -/* ENDCENTRY */ - -static GLfloat dodec[20][3]; - -static void -initDodecahedron(void) -{ - GLfloat alpha, beta; - - alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); - beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - - 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); - /* *INDENT-OFF* */ - dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; - dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; - dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; - dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; - dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; - dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; - dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; - dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; - dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; - dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; - dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; - dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; - dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; - dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; - dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; - dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; - dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; - dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; - dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; - dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; - /* *INDENT-ON* */ - -} - -#define DIFF3(_a,_b,_c) { \ - (_c)[0] = (_a)[0] - (_b)[0]; \ - (_c)[1] = (_a)[1] - (_b)[1]; \ - (_c)[2] = (_a)[2] - (_b)[2]; \ -} - -static void -crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) -{ - GLfloat p[3]; /* in case prod == v1 or v2 */ - - p[0] = v1[1] * v2[2] - v2[1] * v1[2]; - p[1] = v1[2] * v2[0] - v2[2] * v1[0]; - p[2] = v1[0] * v2[1] - v2[0] * v1[1]; - prod[0] = p[0]; - prod[1] = p[1]; - prod[2] = p[2]; -} - -static void -normalize(GLfloat v[3]) -{ - GLfloat d; - - d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - if (d == 0.0) { -/* __glutWarning("normalize: zero length vector"); */ - v[0] = d = 1.0; - } - d = 1 / d; - v[0] *= d; - v[1] *= d; - v[2] *= d; -} - -static void -pentagon(int a, int b, int c, int d, int e, GLenum shadeType) -{ - GLfloat n0[3], d1[3], d2[3]; - - DIFF3(dodec[a], dodec[b], d1); - DIFF3(dodec[b], dodec[c], d2); - crossprod(d1, d2, n0); - normalize(n0); - - glBegin(shadeType); -/* glNormal3fv(n0); */ - glVertex3fv(&dodec[a][0]); - glVertex3fv(&dodec[b][0]); - glVertex3fv(&dodec[c][0]); - glVertex3fv(&dodec[d][0]); - glVertex3fv(&dodec[e][0]); - glEnd(); -} - -static void -dodecahedron(GLenum type) -{ - static int inited = 0; - - if (inited == 0) { - inited = 1; - initDodecahedron(); - } - pentagon(0, 1, 9, 16, 5, type); - pentagon(1, 0, 3, 18, 7, type); - pentagon(1, 7, 11, 10, 9, type); - pentagon(11, 7, 18, 19, 6, type); - pentagon(8, 17, 16, 9, 10, type); - pentagon(2, 14, 15, 6, 19, type); - pentagon(2, 13, 12, 4, 14, type); - pentagon(2, 19, 18, 3, 13, type); - pentagon(3, 0, 5, 12, 13, type); - pentagon(6, 15, 8, 10, 11, type); - pentagon(4, 17, 8, 15, 14, type); - pentagon(4, 12, 5, 16, 17, type); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireDodecahedron(void) -{ - dodecahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidDodecahedron(void) -{ - dodecahedron(GL_TRIANGLE_FAN); -} - -/* ENDCENTRY */ - -static void -recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, - GLenum shadeType) -{ - GLfloat q0[3], q1[3]; - - DIFF3(n1, n2, q0); - DIFF3(n2, n3, q1); - crossprod(q0, q1, q1); - normalize(q1); - - glBegin(shadeType); -/* glNormal3fv(q1); */ - glVertex3fv(n1); - glVertex3fv(n2); - glVertex3fv(n3); - glEnd(); -} - -static void -subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, - GLenum shadeType) -{ - int depth; - GLfloat w0[3], w1[3], w2[3]; - GLfloat l; - int i, j, k, n; - - depth = 1; - for (i = 0; i < depth; i++) { - for (j = 0; i + j < depth; j++) { - k = depth - i - j; - for (n = 0; n < 3; n++) { - w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; - w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) - / depth; - w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) - / depth; - } - l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); - w0[0] /= l; - w0[1] /= l; - w0[2] /= l; - l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); - w1[0] /= l; - w1[1] /= l; - w1[2] /= l; - l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); - w2[0] /= l; - w2[1] /= l; - w2[2] /= l; - recorditem(w1, w0, w2, shadeType); - } - } -} - -static void -drawtriangle(int i, GLfloat data[][3], int ndx[][3], - GLenum shadeType) -{ - GLfloat *x0, *x1, *x2; - - x0 = data[ndx[i][0]]; - x1 = data[ndx[i][1]]; - x2 = data[ndx[i][2]]; - subdivide(x0, x1, x2, shadeType); -} - -/* octahedron data: The octahedron produced is centered at the - origin and has radius 1.0 */ -static GLfloat odata[6][3] = -{ - {1.0, 0.0, 0.0}, - {-1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {0.0, -1.0, 0.0}, - {0.0, 0.0, 1.0}, - {0.0, 0.0, -1.0} -}; - -static int ondex[8][3] = -{ - {0, 4, 2}, - {1, 2, 4}, - {0, 3, 4}, - {1, 4, 3}, - {0, 2, 5}, - {1, 5, 2}, - {0, 5, 3}, - {1, 3, 5} -}; - -static void -octahedron(GLenum shadeType) -{ - int i; - - for (i = 7; i >= 0; i--) { - drawtriangle(i, odata, ondex, shadeType); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireOctahedron(void) -{ - octahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidOctahedron(void) -{ - octahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ - -/* icosahedron data: These numbers are rigged to make an - icosahedron of radius 1.0 */ - -#define X .525731112119133606 -#define Z .850650808352039932 - -static GLfloat idata[12][3] = -{ - {-X, 0, Z}, - {X, 0, Z}, - {-X, 0, -Z}, - {X, 0, -Z}, - {0, Z, X}, - {0, Z, -X}, - {0, -Z, X}, - {0, -Z, -X}, - {Z, X, 0}, - {-Z, X, 0}, - {Z, -X, 0}, - {-Z, -X, 0} -}; - -static int index[20][3] = -{ - {0, 4, 1}, - {0, 9, 4}, - {9, 5, 4}, - {4, 5, 8}, - {4, 8, 1}, - {8, 10, 1}, - {8, 3, 10}, - {5, 3, 8}, - {5, 2, 3}, - {2, 7, 3}, - {7, 10, 3}, - {7, 6, 10}, - {7, 11, 6}, - {11, 0, 6}, - {0, 1, 6}, - {6, 1, 10}, - {9, 0, 11}, - {9, 11, 2}, - {9, 2, 5}, - {7, 2, 11}, -}; - -static void -icosahedron(GLenum shadeType) -{ - int i; - - for (i = 19; i >= 0; i--) { - drawtriangle(i, idata, index, shadeType); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireIcosahedron(void) -{ - icosahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidIcosahedron(void) -{ - icosahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ - -/* tetrahedron data: */ - -#define T 1.73205080756887729 - -static GLfloat tdata[4][3] = -{ - {T, T, T}, - {T, -T, -T}, - {-T, T, -T}, - {-T, -T, T} -}; - -static int tndex[4][3] = -{ - {0, 1, 3}, - {2, 1, 0}, - {3, 2, 0}, - {1, 2, 3} -}; - -static void -tetrahedron(GLenum shadeType) -{ - int i; - - for (i = 3; i >= 0; i--) - drawtriangle(i, tdata, tndex, shadeType); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireTetrahedron(void) -{ - tetrahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidTetrahedron(void) -{ - tetrahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ diff --git a/src/glut/directfb/overlay.c b/src/glut/directfb/overlay.c deleted file mode 100644 index 714be5f1a2..0000000000 --- a/src/glut/directfb/overlay.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "internal.h" - - -void GLUTAPIENTRY -glutEstablishOverlay( void ) -{ -} - - -void GLUTAPIENTRY -glutRemoveOverlay( void ) -{ -} - - -void GLUTAPIENTRY -glutUseLayer( GLenum layer ) -{ -} - - -void GLUTAPIENTRY -glutPostOverlayRedisplay( void ) -{ -} - - -void GLUTAPIENTRY -glutPostWindowOverlayRedisplay( int win ) -{ -} - - -void GLUTAPIENTRY -glutShowOverlay( void ) -{ -} - - -void GLUTAPIENTRY -glutHideOverlay( void ) -{ -} diff --git a/src/glut/directfb/state.c b/src/glut/directfb/state.c deleted file mode 100644 index 194d5bbb62..0000000000 --- a/src/glut/directfb/state.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include - -#include "GL/glu.h" - -#include "internal.h" - - -int GLUTAPIENTRY -glutGet( GLenum type ) -{ - switch (type) { - case GLUT_WINDOW_X: - if (g_current && g_current->window) { - int x; - g_current->window->GetPosition( g_current->window, &x, 0 ); - return x; - } - break; - case GLUT_WINDOW_Y: - if (g_current && g_current->window) { - int y; - g_current->window->GetPosition( g_current->window, 0, &y ); - return y; - } - break; - - case GLUT_WINDOW_WIDTH: - if (g_current) { - int w; - g_current->surface->GetSize( g_current->surface, &w, 0 ); - return w; - } - break; - case GLUT_WINDOW_HEIGHT: - if (g_current) { - int h; - g_current->surface->GetSize( g_current->surface, 0, &h ); - return h; - } - break; - - case GLUT_WINDOW_BUFFER_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.buffer_size; - } - break; - case GLUT_WINDOW_STENCIL_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.stencil_size; - } - break; - case GLUT_WINDOW_DEPTH_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.depth_size; - } - break; - case GLUT_WINDOW_RED_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.red_size; - } - break; - case GLUT_WINDOW_GREEN_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.green_size; - } - break; - case GLUT_WINDOW_BLUE_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.blue_size; - } - break; - case GLUT_WINDOW_ALPHA_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.alpha_size; - } - break; - case GLUT_WINDOW_ACCUM_RED_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.accum_red_size; - } - break; - case GLUT_WINDOW_ACCUM_GREEN_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.accum_green_size; - } - break; - case GLUT_WINDOW_ACCUM_BLUE_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.accum_blue_size; - } - break; - case GLUT_WINDOW_ACCUM_ALPHA_SIZE: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.accum_alpha_size; - } - break; - case GLUT_WINDOW_DOUBLEBUFFER: - if (g_current) { - DFBGLAttributes a; - g_current->gl->GetAttributes( g_current->gl, &a ); - return a.double_buffer; - } - break; - - case GLUT_WINDOW_RGBA: - return 1; - - case GLUT_WINDOW_CURSOR: - if (g_current) - return g_current->cursor; - break; - - case GLUT_SCREEN_WIDTH: - if (primary) { - DFBDisplayLayerConfig c; - primary->GetConfiguration( primary, &c ); - return c.width; - } - break; - case GLUT_SCREEN_HEIGHT: - if (primary) { - DFBDisplayLayerConfig c; - primary->GetConfiguration( primary, &c ); - return c.height; - } - break; - - case GLUT_INIT_DISPLAY_MODE: - return g_display_mode; - case GLUT_INIT_WINDOW_X: - return g_xpos; - case GLUT_INIT_WINDOW_Y: - return g_ypos; - case GLUT_INIT_WINDOW_WIDTH: - return g_width; - case GLUT_INIT_WINDOW_HEIGHT: - return g_height; - - case GLUT_ELAPSED_TIME: - { - static long long start = -1; - struct timeval t; - - gettimeofday( &t, NULL ); - if (start == -1) { - start = t.tv_sec * 1000ll + t.tv_usec / 1000ll; - return 0; - } - return (t.tv_sec * 1000ll + t.tv_usec / 1000ll - start); - } - break; - - default: - break; - } - - return 0; -} - - -int GLUTAPIENTRY -glutLayerGet( GLenum type ) -{ - return 0; -} - -void GLUTAPIENTRY -glutReportErrors( void ) -{ - GLenum error; - - while ((error = glGetError()) != GL_NO_ERROR) - __glutWarning( "**OpenGL Error** %s", gluErrorString( error ) ); -} - - diff --git a/src/glut/directfb/teapot.c b/src/glut/directfb/teapot.c deleted file mode 100644 index e7f1ee812f..0000000000 --- a/src/glut/directfb/teapot.c +++ /dev/null @@ -1,212 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/** -(c) Copyright 1993, Silicon Graphics, Inc. - -ALL RIGHTS RESERVED - -Permission to use, copy, modify, and distribute this software -for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that -both the copyright notice and this permission notice appear in -supporting documentation, and that the name of Silicon -Graphics, Inc. not be used in advertising or publicity -pertaining to distribution of the software without specific, -written prior permission. - -THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU -"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR -OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO -EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE -ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, -INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, -SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR -NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR -PERFORMANCE OF THIS SOFTWARE. - -US Government Users Restricted Rights - -Use, duplication, or disclosure by the Government is subject to -restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -(c)(1)(ii) of the Rights in Technical Data and Computer -Software clause at DFARS 252.227-7013 and/or in similar or -successor clauses in the FAR or the DOD or NASA FAR -Supplement. Unpublished-- rights reserved under the copyright -laws of the United States. Contractor/manufacturer is Silicon -Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA -94039-7311. - -OpenGL(TM) is a trademark of Silicon Graphics, Inc. -*/ - -#include -#include -#include "GL/glut.h" - -/* Rim, body, lid, and bottom data must be reflected in x and - y; handle and spout data across the y axis only. */ - -static int patchdata[][16] = -{ - /* rim */ - {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15}, - /* body */ - {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27}, - {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40}, - /* lid */ - {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, - 101, 0, 1, 2, 3,}, - {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117}, - /* bottom */ - {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, - 125, 120, 40, 39, 38, 37}, - /* handle */ - {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56}, - {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 28, 65, 66, 67}, - /* spout */ - {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83}, - {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95} -}; -/* *INDENT-OFF* */ - -static float cpdata[][3] = -{ - {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, - -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, - {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, - 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, - 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, - 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, - {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, - 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, - {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, - 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, - 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, - {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, - {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, - -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, - -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, - 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, - 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, - 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, - {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, - -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, - 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, - -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, - 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, - 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, - 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, - {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, - -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, - 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, - {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, - {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, - {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, - 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, - 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, - -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, - 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, - 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, - 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, - {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, - -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, - 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, - {0.84, -1.5, 0.075} -}; - -static float tex[2][2][2] = -{ - { {0, 0}, - {1, 0}}, - { {0, 1}, - {1, 1}} -}; - -/* *INDENT-ON* */ - -static void -teapot(GLint grid, GLdouble scale, GLenum type) -{ - float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; - long i, j, k, l; - - glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); - glEnable(GL_AUTO_NORMAL); - glEnable(GL_NORMALIZE); - glEnable(GL_MAP2_VERTEX_3); - glEnable(GL_MAP2_TEXTURE_COORD_2); - glPushMatrix(); - glRotatef(270.0, 1.0, 0.0, 0.0); - glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); - glTranslatef(0.0, 0.0, -1.5); - for (i = 0; i < 10; i++) { - for (j = 0; j < 4; j++) { - for (k = 0; k < 4; k++) { - for (l = 0; l < 3; l++) { - p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 1) - q[j][k][l] *= -1.0; - if (i < 6) { - r[j][k][l] = - cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 0) - r[j][k][l] *= -1.0; - s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - if (l == 0) - s[j][k][l] *= -1.0; - if (l == 1) - s[j][k][l] *= -1.0; - } - } - } - } - glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, - &tex[0][0][0]); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &p[0][0][0]); - glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &q[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - if (i < 6) { - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &r[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &s[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - } - } - glPopMatrix(); - glPopAttrib(); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutSolidTeapot(GLdouble scale) -{ - teapot(7, scale, GL_FILL); -} - -void GLUTAPIENTRY -glutWireTeapot(GLdouble scale) -{ - teapot(10, scale, GL_LINE); -} - -/* ENDCENTRY */ diff --git a/src/glut/directfb/window.c b/src/glut/directfb/window.c deleted file mode 100644 index 62cf8bb33e..0000000000 --- a/src/glut/directfb/window.c +++ /dev/null @@ -1,597 +0,0 @@ -/* - * Copyright (C) 2006 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include - -#include "internal.h" - - -/*****************************************************************************/ - -static __GlutWindow *g_stack = NULL; - -/*****************************************************************************/ - - -__GlutWindow* -__glutCreateWindow( GLboolean fullscreen ) -{ - __GlutWindow *new; - DFBResult ret; - static int curid = 1; - - new = calloc( 1, sizeof(__GlutWindow) ); - if (!new) - __glutFatalError( "out of memory" ); - - new->id = curid++; - - if (fullscreen) { - DFBDisplayLayerConfig config; - DFBDisplayLayerConfigFlags fail = 0; - - config.flags = DLCONF_WIDTH | DLCONF_HEIGHT | - DLCONF_BUFFERMODE; - config.width = g_width; - config.height = g_height; - - if (g_display_mode & GLUT_DOUBLE) - config.buffermode = DLBM_BACKVIDEO; - else - config.buffermode = DLBM_FRONTONLY; - - if (g_bpp) { - config.flags |= DLCONF_PIXELFORMAT; - - switch (g_bpp) { - case 8: - config.pixelformat = DSPF_RGB332; - break; - case 12: - config.pixelformat = DSPF_ARGB4444; - break; - case 15: - config.pixelformat = DSPF_ARGB1555; - break; - case 16: - config.pixelformat = DSPF_RGB16; - break; - case 24: - case 32: - config.pixelformat = DSPF_RGB32; - break; - default: - config.flags &= ~DLCONF_PIXELFORMAT; - break; - } - } - - primary->TestConfiguration( primary, &config, &fail ); - config.flags &= ~fail; - primary->SetConfiguration( primary, &config ); - - ret = primary->GetSurface( primary, &new->surface ); - if (ret) { - DirectFBError( "IDirectFBDisplayLayer::GetSurface()", ret ); - free( new ); - return NULL; - } - - ret = new->surface->GetGL( new->surface, &new->gl ); - if (ret) { - DirectFBError( "IDirectFBSurface::GetGL()", ret ); - new->surface->Release( new->surface ); - free( new ); - return NULL; - } - - events->Reset( events ); - if (keyboard) - keyboard->AttachEventBuffer( keyboard, events ); - if (mouse) - mouse->AttachEventBuffer( mouse, events ); - if (joystick) - joystick->AttachEventBuffer( joystick, events ); - - new->visible = GL_TRUE; - } - else { - DFBWindowDescription dsc; - - dsc.flags = DWDESC_CAPS | DWDESC_POSX | DWDESC_POSY | - DWDESC_WIDTH | DWDESC_HEIGHT; - dsc.caps = DWCAPS_NONE; - dsc.posx = g_xpos; - dsc.posy = g_ypos; - dsc.width = g_width; - dsc.height = g_height; - - if (g_display_mode & GLUT_DOUBLE) - dsc.caps |= DWCAPS_DOUBLEBUFFER; - if (g_display_mode & GLUT_ALPHA) - dsc.caps |= DWCAPS_ALPHACHANNEL; - - ret = primary->CreateWindow( primary, &dsc, &new->window ); - if (ret) { - DirectFBError( "IDirectFBDisplayLayer::CreateWindow()", ret ); - free( new ); - return NULL; - } - - new->window->GetID( new->window, &new->wid ); - - ret = new->window->GetSurface( new->window, &new->surface ); - if (ret) { - DirectFBError( "IDirectFBWindow::GetSurface()", ret ); - new->window->Release( new->window ); - free( new ); - return NULL; - } - - ret = new->surface->GetGL( new->surface, &new->gl ); - if (ret) { - DirectFBError( "IDirectFBSurface::GetGl()", ret ); - new->surface->Release( new->surface ); - new->window->Release( new->window ); - free( new ); - return NULL; - } - - new->window->AttachEventBuffer( new->window, events ); - /* enable only handled events */ - new->window->DisableEvents( new->window, DWET_ALL ); - new->window->EnableEvents( new->window, DWET_KEYDOWN | DWET_KEYUP | - DWET_BUTTONDOWN | DWET_BUTTONUP | - DWET_ENTER | DWET_LEAVE | - DWET_MOTION | DWET_SIZE ); - - new->req.flags |= WINDOW_REQUEST_SHOW; - } - - new->mode = g_display_mode; - - new->reshape = GL_TRUE; - new->visibility = GL_TRUE; - new->redisplay = GL_TRUE; - - if (g_stack) { - new->prev = g_stack->prev; - g_stack->prev->next = new; - g_stack->prev = new; - } - else { - new->prev = new; - g_stack = new; - } - - return new; -} - - -__GlutWindow* -__glutFindWindow( DFBWindowID id ) -{ - __GlutWindow *cur; - - for (cur = g_stack; cur; cur = cur->next) { - if (cur->wid == id) - return cur; - } - - __glutFatalError( "Window %d not found", id ); - - return NULL; -} - - -void -__glutSetWindow( __GlutWindow *window ) -{ - if (g_current) { - if (g_current == window) - return; - g_current->gl->Unlock( g_current->gl ); - } - - if (window) - window->gl->Lock( window->gl ); - g_current = window; -} - - -void -__glutHandleWindows( void ) -{ - __GlutWindow *cur = g_stack; - - while (cur) { - __GlutWindow *next = cur->next; - GLboolean displayed = GL_FALSE; - - if (cur->window && cur->req.flags) { - if (cur == g_current) - cur->gl->Unlock( cur->gl ); - - if (cur->req.flags & WINDOW_REQUEST_DESTROY) { - __glutDestroyWindow( cur ); - cur = next; - continue; - } - - if (cur->req.flags & WINDOW_REQUEST_POSITION) { - cur->window->MoveTo( cur->window, - cur->req.x, cur->req.y ); - } - - if (cur->req.flags & WINDOW_REQUEST_RESIZE) { - cur->window->Resize( cur->window, - cur->req.w, cur->req.h ); - cur->reshape = GL_TRUE; - cur->redisplay = GL_TRUE; - } - - if (cur->req.flags & WINDOW_REQUEST_RESTACK) { - while (cur->req.z > 0) { - if (cur->req.z >= +1000) { - cur->window->RaiseToTop( cur->window ); - cur->req.z = 0; - break; - } - - cur->window->Raise( cur->window ); - cur->req.z--; - } - - while (cur->req.z < 0) { - if (cur->req.z <= -1000) { - cur->window->LowerToBottom( cur->window ); - cur->req.z = 0; - break; - } - - cur->window->Lower( cur->window ); - cur->req.z++; - } - } - - if (cur->req.flags & WINDOW_REQUEST_SHOW) { - cur->window->SetOpacity( cur->window, 0xff ); - cur->visible = GL_TRUE; - cur->visibility = GL_TRUE; - } - else if (cur->req.flags & WINDOW_REQUEST_HIDE) { - cur->window->SetOpacity( cur->window, 0x00 ); - cur->visible = GL_FALSE; - cur->visibility = GL_TRUE; - } - - cur->req.flags = 0; - - if (cur == g_current) - cur->gl->Lock( cur->gl ); - } - - if (cur->reshape && reshape_func) { - int w, h; - g_idle = GL_FALSE; - cur->surface->GetSize( cur->surface, &w, &h ); - __glutSetWindow( cur ); - reshape_func( w, h ); - displayed = GL_TRUE; - } - - if (cur->visibility && visibility_func) { - g_idle = GL_FALSE; - __glutSetWindow( cur ); - visibility_func( cur->visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE ); - displayed = GL_TRUE; - } - - if (cur->redisplay && display_func) { - g_idle = GL_FALSE; - __glutSetWindow( cur ); - display_func(); - displayed = GL_TRUE; - } - - if (displayed && cur->window && cur->visible) { - if (!(cur->mode & GLUT_DOUBLE)) { - cur->gl->Unlock( cur->gl ); - cur->surface->Flip( cur->surface, NULL, 0 ); - cur->gl->Lock( cur->gl ); - } - } - - cur->reshape = GL_FALSE; - cur->visibility = GL_FALSE; - cur->redisplay = GL_FALSE; - - cur = next; - } -} - - -void -__glutDestroyWindow( __GlutWindow *window ) -{ - __GlutWindow *next = window->next; - __GlutWindow *prev = window->prev; - - __glutAssert( window != NULL ); - - if (window == g_current) - g_current = NULL; - if (window == g_game) - g_game = NULL; - - window->gl->Unlock( window->gl ); - window->gl->Release( window->gl ); - window->surface->Release( window->surface ); - - if (window->window) { -#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,26) - window->window->DetachEventBuffer( window->window, events ); -#else - window->window->Destroy( window->window ); -#endif - window->window->Release( window->window ); - } - else { -#if DIRECTFB_VERSION_CODE >= VERSION_CODE(0,9,26) - if (joystick) - joystick->DetachEventBuffer( joystick, events ); - if (mouse) - mouse->DetachEventBuffer( mouse, events ); - if (keyboard) - keyboard->DetachEventBuffer( keyboard, events ); -#endif - events->Reset( events ); - } - - free( window ); - - if (next) - next->prev = prev; - else - g_stack->prev = prev; - - if (window == g_stack) - g_stack = next; - else - prev->next = next; -} - - -void -__glutDestroyWindows( void ) -{ - __GlutWindow *cur = g_stack; - - while (cur) { - __GlutWindow *next = cur->next; - __glutDestroyWindow( cur ); - cur = next; - } -} - - -int GLUTAPIENTRY -glutCreateWindow( const char *title ) -{ - __GlutWindow *window; - - if (getenv( "__GLUT_GAME_MODE" )) - return glutEnterGameMode(); - - glutInit( NULL, NULL ); - - window = __glutCreateWindow( GL_FALSE ); - if (!window) - return 0; - - __glutSetWindow( window ); - glutSetCursor( GLUT_CURSOR_INHERIT ); - - return window->id; -} - - -int GLUTAPIENTRY -glutCreateSubWindow( int win, int x, int y, int width, int height ) -{ - return GL_FALSE; -} - - -void GLUTAPIENTRY -glutDestroyWindow( int win ) -{ - __GlutWindow *cur; - - for (cur = g_stack; cur; cur = cur->next) { - if (cur->id == win) { - if (cur->window) - cur->window->Destroy( cur->window ); - - cur->req.flags |= WINDOW_REQUEST_DESTROY; - break; - } - } -} - - -void GLUTAPIENTRY -glutPostRedisplay( void ) -{ - if (g_current) - g_current->redisplay = GL_TRUE; -} - - -void GLUTAPIENTRY -glutPostWindowRedisplay( int win ) -{ - __GlutWindow *cur; - - for (cur = g_stack; cur; cur = cur->next) { - if (cur->id == win) { - cur->redisplay = GL_TRUE; - break; - } - } -} - - -void GLUTAPIENTRY -glutSwapBuffers( void ) -{ - if (g_current) { - g_current->gl->Unlock( g_current->gl ); - g_current->surface->Flip( g_current->surface, NULL, 0 ); - g_current->gl->Lock( g_current->gl ); - } -} - - -int GLUTAPIENTRY -glutGetWindow( void ) -{ - return (g_current) ? g_current->id : 0; -} - - -void GLUTAPIENTRY -glutSetWindow( int win ) -{ - __GlutWindow *cur; - - if (g_current && g_current->id == win) - return; - - for (cur = g_stack; cur; cur = cur->next) { - if (cur->id == win) { - __glutSetWindow( cur ); - break; - } - } -} - - -void GLUTAPIENTRY -glutSetWindowTitle( const char *title ) -{ -} - - -void GLUTAPIENTRY -glutSetIconTitle( const char *title ) -{ -} - - -void GLUTAPIENTRY -glutFullScreen( void ) -{ - if (g_current && !g_game) { - DFBDisplayLayerConfig config; - - primary->GetConfiguration( primary, &config ); - - g_current->req.flags |= WINDOW_REQUEST_POSITION | - WINDOW_REQUEST_RESIZE | - WINDOW_REQUEST_RESTACK; - g_current->req.x = 0; - g_current->req.y = 0; - g_current->req.w = config.width; - g_current->req.h = config.height; - g_current->req.z = 1000; - } -} - - -void GLUTAPIENTRY -glutPositionWindow( int x, int y ) -{ - if (g_current && !g_game) { - g_current->req.flags |= WINDOW_REQUEST_POSITION; - g_current->req.x = x; - g_current->req.y = y; - } -} - - -void GLUTAPIENTRY -glutReshapeWindow( int width, int height ) -{ - if (g_current && !g_game) { - g_current->req.flags |= WINDOW_REQUEST_RESIZE; - g_current->req.w = width; - g_current->req.h = height; - } -} - - -void GLUTAPIENTRY -glutPopWindow( void ) -{ - if (g_current && !g_game) { - g_current->req.flags |= WINDOW_REQUEST_RESTACK; - g_current->req.z--; - } -} - - -void GLUTAPIENTRY -glutPushWindow( void ) -{ - if (g_current && !g_game) { - g_current->req.flags |= WINDOW_REQUEST_RESTACK; - g_current->req.z++; - } -} - - -void GLUTAPIENTRY -glutIconifyWindow( void ) -{ -} - - -void GLUTAPIENTRY -glutShowWindow( void ) -{ - if (g_current && !g_game) { - g_current->req.flags |= WINDOW_REQUEST_SHOW; - g_current->req.flags &= ~WINDOW_REQUEST_HIDE; - } -} - - -void GLUTAPIENTRY -glutHideWindow( void ) -{ - if (g_current && !g_game) { - g_current->req.flags |= WINDOW_REQUEST_HIDE; - g_current->req.flags &= ~WINDOW_REQUEST_SHOW; - } -} - diff --git a/src/mesa/drivers/directfb/Makefile b/src/mesa/drivers/directfb/Makefile deleted file mode 100644 index 94c82a2c9c..0000000000 --- a/src/mesa/drivers/directfb/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -# src/mesa/drivers/directfb/Makefile - -TOP = ../../../.. - -include $(TOP)/configs/current - - -INCLUDE_DIRS = \ - -I$(TOP)/include \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/tnl \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -DFB_CFLAGS = $(shell pkg-config --cflags directfb) -DFB_MODULEDIR = $(shell pkg-config --variable=moduledir directfb-internal) - -DIRECTFBGL_MESA_SOURCES = ../common/driverfuncs.c idirectfbgl_mesa.c - -DIRECTFBGL_MESA_OBJECTS = $(DIRECTFBGL_MESA_SOURCES:.c=.o) - -DIRECTFBGL_MESA = libidirectfbgl_mesa.so - -LIBS = $(TOP)/src/mesa/libmesa.a $(TOP)/src/mesa/libglapi.a - - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DFB_CFLAGS) $< -o $@ - - -default: directfb-libgl directfbgl_mesa - - -# XXX this used to be in src/mesa/Makefile and is probably broken now -directfb-libgl: $(LIBS) - @ $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ - -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(LIBS) \ - $(GL_LIB_DEPS) - - - -# Mesa DirectFBGL module -directfbgl_mesa: $(DIRECTFBGL_MESA_OBJECTS) - $(CC) -shared $(CFLAGS) $(DIRECTFBGL_MESA_OBJECTS) -o $(DIRECTFBGL_MESA) \ - -Wl,-soname -Wl,$(DIRECTFBGL_MESA) -L$(TOP)/$(LIB_DIR) -lGL -lm - - -install: - @if test -d $(DFB_MODULEDIR); then \ - echo "Installing DirectFBGL module."; \ - else \ - echo "*** Failed to determine DirectFB module's directory."; \ - echo "*** Installation aborted."; \ - exit 1; \ - fi; - test -d $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ || mkdir $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ - install -m 755 $(DIRECTFBGL_MESA) $(DFB_MODULEDIR)/interfaces/IDirectFBGL/ - - -clean: - -rm -f *.o *.so - diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c deleted file mode 100644 index 85a6f03672..0000000000 --- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c +++ /dev/null @@ -1,982 +0,0 @@ -/* - * Copyright (C) 2004-2007 Claudio Ciccani - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * - * Based on glfbdev.c, written by Brian Paul. - * - */ - -#include -#include -#include - -#include - -#include -#include - -#include - -#include -#include -#include - -#undef CLAMP -#include "main/glheader.h" -#include "main/buffers.h" -#include "main/context.h" -#include "main/extensions.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/imports.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "main/texstore.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "drivers/common/driverfuncs.h" - - -#define VERSION_CODE( M, m, r ) (((M) * 1000) + ((m) * 100) + ((r))) -#define DIRECTFB_VERSION_CODE VERSION_CODE( DIRECTFB_MAJOR_VERSION, \ - DIRECTFB_MINOR_VERSION, \ - DIRECTFB_MICRO_VERSION ) - - -static DFBResult -Probe( void *data ); - -static DFBResult -Construct( IDirectFBGL *thiz, - IDirectFBSurface *surface ); - -#include - -DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBGL, Mesa ) - -/* - * private data struct of IDirectFBGL - */ -typedef struct { - int ref; /* reference counter */ - - int locked; - - IDirectFBSurface *surface; - DFBSurfacePixelFormat format; - int width; - int height; - - struct { - GLubyte *start; - GLubyte *end; - int pitch; - } video; - - GLvisual visual; - GLframebuffer framebuffer; - GLcontext context; - struct gl_renderbuffer render; -} IDirectFBGL_data; - -/******************************************************************************/ - -static pthread_mutex_t global_lock = PTHREAD_MUTEX_INITIALIZER; -static unsigned int global_ref = 0; - -static INLINE int directfbgl_init( void ) -{ - pthread_mutexattr_t attr; - int ret; - - if (global_ref++) - return 0; - - pthread_mutexattr_init( &attr ); - pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK ); - ret = pthread_mutex_init( &global_lock, &attr ); - pthread_mutexattr_destroy( &attr ); - - return ret; -} - -static INLINE void directfbgl_finish( void ) -{ - if (--global_ref == 0) - pthread_mutex_destroy( &global_lock ); -} - -#define directfbgl_lock() pthread_mutex_lock( &global_lock ) -#define directfbgl_unlock() pthread_mutex_unlock( &global_lock ) - -/******************************************************************************/ - -static bool directfbgl_init_visual ( GLvisual *visual, - DFBSurfacePixelFormat format ); -static bool directfbgl_create_context ( GLcontext *context, - GLframebuffer *framebuffer, - GLvisual *visual, - IDirectFBGL_data *data ); -static void directfbgl_destroy_context( GLcontext *context, - GLframebuffer *framebuffer ); - -/******************************************************************************/ - - -static void -IDirectFBGL_Mesa_Destruct( IDirectFBGL *thiz ) -{ - IDirectFBGL_data *data = (IDirectFBGL_data*) thiz->priv; - - directfbgl_destroy_context( &data->context, &data->framebuffer ); - - if (data->surface) - data->surface->Release( data->surface ); - - DIRECT_DEALLOCATE_INTERFACE( thiz ); - - directfbgl_finish(); -} - -static DFBResult -IDirectFBGL_Mesa_AddRef( IDirectFBGL *thiz ) -{ - DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); - - data->ref++; - - return DFB_OK; -} - -static DFBResult -IDirectFBGL_Mesa_Release( IDirectFBGL *thiz ) -{ - DIRECT_INTERFACE_GET_DATA( IDirectFBGL ) - - if (--data->ref == 0) - IDirectFBGL_Mesa_Destruct( thiz ); - - return DFB_OK; -} - -static DFBResult -IDirectFBGL_Mesa_Lock( IDirectFBGL *thiz ) -{ - IDirectFBSurface *surface; - int width = 0; - int height = 0; - DFBResult ret; - - DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); - - if (data->locked) { - data->locked++; - return DFB_OK; - } - - if (directfbgl_lock()) - return DFB_LOCKED; - - surface = data->surface; - surface->GetSize( surface, &width, &height ); - - ret = surface->Lock( surface, DSLF_READ | DSLF_WRITE, - (void*)&data->video.start, &data->video.pitch ); - if (ret) { - D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" ); - directfbgl_unlock(); - return ret; - } - data->video.end = data->video.start + (height-1) * data->video.pitch; - - data->render.Data = data->video.start; - - _mesa_make_current( &data->context, - &data->framebuffer, &data->framebuffer ); - - if (data->width != width || data->height != height) { - _mesa_resize_framebuffer( &data->context, - &data->framebuffer, width, height ); - data->width = width; - data->height = height; - } - - data->locked++; - - return DFB_OK; -} - -static DFBResult -IDirectFBGL_Mesa_Unlock( IDirectFBGL *thiz ) -{ - DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); - - if (!data->locked) - return DFB_OK; - - if (--data->locked == 0) { - _mesa_make_current( NULL, NULL, NULL ); - - data->surface->Unlock( data->surface ); - - directfbgl_unlock(); - } - - return DFB_OK; -} - -static DFBResult -IDirectFBGL_Mesa_GetAttributes( IDirectFBGL *thiz, - DFBGLAttributes *attributes ) -{ - DFBSurfaceCapabilities caps; - GLvisual *visual; - - DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); - - if (!attributes) - return DFB_INVARG; - - data->surface->GetCapabilities( data->surface, &caps ); - - visual = &data->visual; - - attributes->buffer_size = visual->rgbBits ? : visual->indexBits; - attributes->depth_size = visual->depthBits; - attributes->stencil_size = visual->stencilBits; - attributes->aux_buffers = visual->numAuxBuffers; - attributes->red_size = visual->redBits; - attributes->green_size = visual->greenBits; - attributes->blue_size = visual->blueBits; - attributes->alpha_size = visual->alphaBits; - attributes->accum_red_size = visual->accumRedBits; - attributes->accum_green_size = visual->accumGreenBits; - attributes->accum_blue_size = visual->accumBlueBits; - attributes->accum_alpha_size = visual->accumAlphaBits; - attributes->double_buffer = ((caps & DSCAPS_FLIPPING) != 0); - attributes->stereo = (visual->stereoMode != 0); - - return DFB_OK; -} - -#if DIRECTFBGL_INTERFACE_VERSION >= 1 -static DFBResult -IDirectFBGL_Mesa_GetProcAddress( IDirectFBGL *thiz, - const char *name, - void **ret_address ) -{ - DIRECT_INTERFACE_GET_DATA( IDirectFBGL ); - - if (!name) - return DFB_INVARG; - - if (!ret_address) - return DFB_INVARG; - - *ret_address = _glapi_get_proc_address( name ); - - return (*ret_address) ? DFB_OK : DFB_UNSUPPORTED; -} -#endif - - -/* exported symbols */ - -static DFBResult -Probe( void *data ) -{ - return DFB_OK; -} - -static DFBResult -Construct( IDirectFBGL *thiz, IDirectFBSurface *surface ) -{ - DFBResult ret; - - /* Initialize global resources. */ - if (directfbgl_init()) - return DFB_INIT; - - /* Allocate interface data. */ - DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL ); - - /* Initialize interface data. */ - data->ref = 1; - - /* Duplicate destination surface. */ - ret = surface->GetSubSurface( surface, NULL, &data->surface ); - if (ret) { - IDirectFBGL_Mesa_Destruct( thiz ); - return ret; - } - - data->surface->GetPixelFormat( data->surface, &data->format ); - data->surface->GetSize( data->surface, &data->width, &data->height ); - - /* Configure visual. */ - if (!directfbgl_init_visual( &data->visual, data->format )) { - D_ERROR( "DirectFBGL/Mesa: failed to initialize visual.\n" ); - IDirectFBGL_Mesa_Destruct( thiz ); - return DFB_UNSUPPORTED; - } - - /* Create context. */ - if (!directfbgl_create_context( &data->context, - &data->framebuffer, - &data->visual, data )) { - D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" ); - IDirectFBGL_Mesa_Destruct( thiz ); - return DFB_UNSUPPORTED; - } - - /* Assign interface pointers. */ - thiz->AddRef = IDirectFBGL_Mesa_AddRef; - thiz->Release = IDirectFBGL_Mesa_Release; - thiz->Lock = IDirectFBGL_Mesa_Lock; - thiz->Unlock = IDirectFBGL_Mesa_Unlock; - thiz->GetAttributes = IDirectFBGL_Mesa_GetAttributes; -#if DIRECTFBGL_INTERFACE_VERSION >= 1 - thiz->GetProcAddress = IDirectFBGL_Mesa_GetProcAddress; -#endif - - return DFB_OK; -} - - -/***************************** Driver functions ******************************/ - -static const GLubyte* -dfbGetString( GLcontext *ctx, GLenum pname ) -{ - return NULL; -} - -static void -dfbUpdateState( GLcontext *ctx, GLuint new_state ) -{ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); -} - -static void -dfbGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height ) -{ - GLcontext *ctx = _mesa_get_current_context(); - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; - - *width = (GLuint) data->width; - *height = (GLuint) data->height; -} - -/** - * We only implement this function as a mechanism to check if the - * framebuffer size has changed (and update corresponding state). - */ -static void -dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) -{ - /* Nothing to do (the surface can't be resized while it's locked). */ - return; -} - -static void -dfbClear( GLcontext *ctx, GLbitfield mask ) -{ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; - -#define BUFFER_BIT_MASK (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT | \ - BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT ) - if (mask & BUFFER_BIT_MASK && - ctx->Color.ColorMask[0][0] && - ctx->Color.ColorMask[0][1] && - ctx->Color.ColorMask[0][2] && - ctx->Color.ColorMask[0][3]) - { - DFBRegion clip; - GLubyte a, r, g, b; - - UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] ); - UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] ); - UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] ); - UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] ); - - clip.x1 = ctx->DrawBuffer->_Xmin; - clip.y1 = ctx->DrawBuffer->_Ymin; - clip.x2 = ctx->DrawBuffer->_Xmax - 1; - clip.y2 = ctx->DrawBuffer->_Ymax - 1; - data->surface->SetClip( data->surface, &clip ); - - data->surface->Unlock( data->surface ); - - data->surface->Clear( data->surface, r, g, b, a ); - - data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE, - (void*)&data->video.start, &data->video.pitch ); - data->video.end = data->video.start + (data->height-1) * data->video.pitch; - data->render.Data = data->video.start; - - mask &= ~BUFFER_BIT_MASK; - } -#undef BUFFER_BIT_MASK - - if (mask) - _swrast_Clear( ctx, mask ); -} - - -/************************ RenderBuffer functions *****************************/ - -static void -dfbDeleteRenderbuffer( struct gl_renderbuffer *render ) -{ - return; -} - -static GLboolean -dfbRenderbufferStorage( GLcontext *ctx, struct gl_renderbuffer *render, - GLenum internalFormat, GLuint width, GLuint height ) -{ - return GL_TRUE; -} - - -/***************************** Span functions ********************************/ - -/* RGB332 */ -#define NAME(PREFIX) PREFIX##_RGB332 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = data->video.end - (Y) * data->video.pitch + (X); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[RCOMP]) & 0xe0) ) | \ - (((S[GCOMP]) & 0xe0) >> 3) | \ - (((S[BCOMP]) ) >> 6) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0xe0) ); \ - D[GCOMP] = ((*P & 0x1c) << 3); \ - D[BCOMP] = ((*P & 0x03) << 6); \ - D[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - -/* ARGB4444 */ -#define NAME(PREFIX) PREFIX##_ARGB4444 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL_RGB(P, X, Y, S) \ - *P = ( 0xf000 | \ - (((S[RCOMP]) & 0xf0) << 4) | \ - (((S[GCOMP]) & 0xf0) ) | \ - (((S[BCOMP]) & 0xf0) >> 4) ) -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[ACOMP]) & 0xf0) << 8) | \ - (((S[RCOMP]) & 0xf0) << 4) | \ - (((S[GCOMP]) & 0xf0) ) | \ - (((S[BCOMP]) & 0xf0) >> 4) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x0f00) >> 4) | ((*P & 0x0f00) >> 8); \ - D[GCOMP] = ((*P & 0x00f0) ) | ((*P & 0x00f0) >> 4); \ - D[BCOMP] = ((*P & 0x000f) << 4) | ((*P & 0x000f) ); \ - D[ACOMP] = ((*P & 0xf000) >> 8) | ((*P & 0xf000) >> 12) - -#include "swrast/s_spantemp.h" - -/* RGB444 */ -#define NAME(PREFIX) PREFIX##_RGB444 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[RCOMP]) & 0xf0) << 4) | \ - (((S[GCOMP]) & 0xf0) ) | \ - (((S[BCOMP]) & 0xf0) >> 4) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x0f00) >> 4) | ((*P & 0x0f00) >> 8); \ - D[GCOMP] = ((*P & 0x00f0) ) | ((*P & 0x00f0) >> 4); \ - D[BCOMP] = ((*P & 0x000f) << 4) | ((*P & 0x000f) ); \ - D[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - -/* ARGB2554 */ -#define NAME(PREFIX) PREFIX##_ARGB2554 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL_RGB(P, X, Y, S) \ - *P = ( 0xc000 | \ - (((S[RCOMP]) & 0xf8) << 6) | \ - (((S[GCOMP]) & 0xf8) << 1) | \ - (((S[BCOMP]) & 0xf0) >> 4) ) -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[ACOMP]) & 0xc0) << 8) | \ - (((S[RCOMP]) & 0xf8) << 6) | \ - (((S[GCOMP]) & 0xf8) << 1) | \ - (((S[BCOMP]) & 0xf0) >> 4) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x3e00) >> 9); \ - D[GCOMP] = ((*P & 0x01f0) >> 4); \ - D[BCOMP] = ((*P & 0x000f) << 4); \ - D[ACOMP] = ((*P & 0xc000) >> 14) - -#include "swrast/s_spantemp.h" - -/* ARGB1555 */ -#define NAME(PREFIX) PREFIX##_ARGB1555 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL_RGB(P, X, Y, S) \ - *P = ( 0x8000 | \ - (((S[RCOMP]) & 0xf8) << 7) | \ - (((S[GCOMP]) & 0xf8) << 2) | \ - (((S[BCOMP]) ) >> 3) ) -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[ACOMP]) & 0x80) << 16) | \ - (((S[RCOMP]) & 0xf8) << 7) | \ - (((S[GCOMP]) & 0xf8) << 2) | \ - (((S[BCOMP]) ) >> 3) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x7c00) >> 7) | ((*P & 0x7c00) >> 12); \ - D[GCOMP] = ((*P & 0x03e0) >> 2) | ((*P & 0x03e0) >> 7); \ - D[BCOMP] = ((*P & 0x001f) << 3) | ((*P & 0x001f) << 2); \ - D[ACOMP] = ((*P & 0x8000) ? 0xff : 0) - -#include "swrast/s_spantemp.h" - -/* RGB555 */ -#define NAME(PREFIX) PREFIX##_RGB555 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[RCOMP]) & 0xf8) << 7) | \ - (((S[GCOMP]) & 0xf8) << 2) | \ - (((S[BCOMP]) ) >> 3) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x7c00) >> 7) | ((*P & 0x7c00) >> 12); \ - D[GCOMP] = ((*P & 0x03e0) >> 2) | ((*P & 0x03e0) >> 7); \ - D[BCOMP] = ((*P & 0x001f) << 3) | ((*P & 0x001f) << 2); \ - D[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - -/* RGB16 */ -#define NAME(PREFIX) PREFIX##_RGB16 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[RCOMP]) & 0xf8) << 8) | \ - (((S[GCOMP]) & 0xfc) << 3) | \ - (((S[BCOMP]) ) >> 3) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0xf800) >> 8) | ((*P & 0xf800) >> 13); \ - D[GCOMP] = ((*P & 0x07e0) >> 3) | ((*P & 0x07e0) >> 9); \ - D[BCOMP] = ((*P & 0x001f) << 3) | ((*P & 0x001f) >> 2); \ - D[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - -/* RGB24 */ -#define NAME(PREFIX) PREFIX##_RGB24 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3; -#define INC_PIXEL_PTR(P) P += 3 -#define STORE_PIXEL(P, X, Y, S) \ - P[0] = S[BCOMP]; P[1] = S[GCOMP]; P[2] = S[BCOMP] -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = P[2]; D[GCOMP] = P[1]; D[BCOMP] = P[0]; D[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - -/* RGB32 */ -#define NAME(PREFIX) PREFIX##_RGB32 -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( ((S[RCOMP]) << 16) | \ - ((S[GCOMP]) << 8) | \ - ((S[BCOMP]) ) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x00ff0000) >> 16); \ - D[GCOMP] = ((*P & 0x0000ff00) >> 8); \ - D[BCOMP] = ((*P & 0x000000ff) ); \ - D[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - -/* ARGB */ -#define NAME(PREFIX) PREFIX##_ARGB -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL_RGB(P, X, Y, S) \ - *P = ( 0xff000000 | \ - ((S[RCOMP]) << 16) | \ - ((S[GCOMP]) << 8) | \ - ((S[BCOMP]) ) ) -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( ((S[ACOMP]) << 24) | \ - ((S[RCOMP]) << 16) | \ - ((S[GCOMP]) << 8) | \ - ((S[BCOMP]) ) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x00ff0000) >> 16); \ - D[GCOMP] = ((*P & 0x0000ff00) >> 8); \ - D[BCOMP] = ((*P & 0x000000ff) ); \ - D[ACOMP] = ((*P & 0xff000000) >> 24) - -#include "swrast/s_spantemp.h" - -/* AiRGB */ -#define NAME(PREFIX) PREFIX##_AiRGB -#define FORMAT GL_RGBA8 -#define RB_TYPE GLubyte -#define SPAN_VARS \ - IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL_RGB(P, X, Y, S) \ - *P = ( ((S[RCOMP]) << 16) | \ - ((S[GCOMP]) << 8) | \ - ((S[BCOMP]) ) ) -#define STORE_PIXEL(P, X, Y, S) \ - *P = ( (((S[ACOMP]) ^ 0xff) << 24) | \ - (((S[RCOMP]) ) << 16) | \ - (((S[GCOMP]) ) << 8) | \ - (((S[BCOMP]) ) ) ) -#define FETCH_PIXEL(D, P) \ - D[RCOMP] = ((*P & 0x00ff0000) >> 16); \ - D[GCOMP] = ((*P & 0x0000ff00) >> 8); \ - D[BCOMP] = ((*P & 0x000000ff) ); \ - D[ACOMP] = (((*P & 0xff000000) >> 24) ^ 0xff) - -#include "swrast/s_spantemp.h" - - -/*****************************************************************************/ - -static bool -directfbgl_init_visual( GLvisual *visual, - DFBSurfacePixelFormat format ) -{ - GLboolean rgbFlag = GL_TRUE; - GLboolean dbFlag = GL_FALSE; - GLboolean stereoFlag = GL_FALSE; - GLint redBits = 0; - GLint blueBits = 0; - GLint greenBits = 0; - GLint alphaBits = 0; - GLint indexBits = 0; - GLint depthBits = 0; - GLint stencilBits = 0; - GLint accumRedBits = 0; - GLint accumGreenBits = 0; - GLint accumBlueBits = 0; - GLint accumAlphaBits = 0; - GLint numSamples = 0; - - /* FIXME: LUT8 support. */ - switch (format) { - case DSPF_RGB332: - redBits = 3; - greenBits = 3; - blueBits = 2; - break; - case DSPF_ARGB4444: - alphaBits = 4; - case DSPF_RGB444: - redBits = 4; - greenBits = 4; - blueBits = 4; - break; - case DSPF_ARGB2554: - alphaBits = 2; - redBits = 5; - greenBits = 5; - blueBits = 4; - break; - case DSPF_ARGB1555: - alphaBits = 1; - case DSPF_RGB555: - redBits = 5; - greenBits = 5; - blueBits = 5; - break; - case DSPF_RGB16: - redBits = 5; - greenBits = 6; - blueBits = 5; - break; - case DSPF_ARGB: - case DSPF_AiRGB: - alphaBits = 8; - case DSPF_RGB24: - case DSPF_RGB32: - redBits = 8; - greenBits = 8; - blueBits = 8; - break; - default: - D_WARN( "unsupported pixelformat" ); - return false; - } - - if (rgbFlag) { - accumRedBits = redBits; - accumGreenBits = greenBits; - accumBlueBits = blueBits; - accumAlphaBits = alphaBits; - depthBits = redBits + greenBits + blueBits; - stencilBits = alphaBits; - } else - depthBits = 8; - - return _mesa_initialize_visual( visual, - rgbFlag, dbFlag, stereoFlag, - redBits, greenBits, blueBits, alphaBits, - indexBits, depthBits, stencilBits, - accumRedBits, accumGreenBits, - accumBlueBits, accumAlphaBits, - numSamples ); -} - -static bool -directfbgl_create_context( GLcontext *context, - GLframebuffer *framebuffer, - GLvisual *visual, - IDirectFBGL_data *data ) -{ - struct dd_function_table functions; - - _mesa_initialize_window_framebuffer( framebuffer, visual ); - - _mesa_init_driver_functions( &functions ); - functions.GetString = dfbGetString; - functions.UpdateState = dfbUpdateState; - functions.GetBufferSize = dfbGetBufferSize; - functions.Viewport = dfbSetViewport; - functions.Clear = dfbClear; - - if (!_mesa_initialize_context( context, visual, NULL, - &functions, (void*) data )) { - D_DEBUG( "DirectFBGL/Mesa: _mesa_initialize_context() failed.\n" ); - _mesa_free_framebuffer_data( framebuffer ); - return false; - } - - _swrast_CreateContext( context ); - _vbo_CreateContext( context ); - _tnl_CreateContext( context ); - _swsetup_CreateContext( context ); - _swsetup_Wakeup( context ); - - _mesa_init_renderbuffer( &data->render, 0 ); - data->render.InternalFormat = GL_RGBA; - data->render._BaseFormat = GL_RGBA; - data->render.DataType = GL_UNSIGNED_BYTE; - data->render.Data = data->video.start; - data->render.Delete = dfbDeleteRenderbuffer; - data->render.AllocStorage = dfbRenderbufferStorage; - - switch (data->format) { - case DSPF_RGB332: - data->render.GetRow = get_row_RGB332; - data->render.GetValues = get_values_RGB332; - data->render.PutRow = put_row_RGB332; - data->render.PutRowRGB = put_row_rgb_RGB332; - data->render.PutMonoRow = put_mono_row_RGB332; - data->render.PutValues = put_values_RGB332; - data->render.PutMonoValues = put_mono_values_RGB332; - break; - case DSPF_ARGB4444: - data->render.GetRow = get_row_ARGB4444; - data->render.GetValues = get_values_ARGB4444; - data->render.PutRow = put_row_ARGB4444; - data->render.PutRowRGB = put_row_rgb_ARGB4444; - data->render.PutMonoRow = put_mono_row_ARGB4444; - data->render.PutValues = put_values_ARGB4444; - data->render.PutMonoValues = put_mono_values_ARGB4444; - break; - case DSPF_RGB444: - data->render.GetRow = get_row_RGB444; - data->render.GetValues = get_values_RGB444; - data->render.PutRow = put_row_RGB444; - data->render.PutRowRGB = put_row_rgb_RGB444; - data->render.PutMonoRow = put_mono_row_RGB444; - data->render.PutValues = put_values_RGB444; - data->render.PutMonoValues = put_mono_values_RGB444; - break; - case DSPF_ARGB2554: - data->render.GetRow = get_row_ARGB2554; - data->render.GetValues = get_values_ARGB2554; - data->render.PutRow = put_row_ARGB2554; - data->render.PutRowRGB = put_row_rgb_ARGB2554; - data->render.PutMonoRow = put_mono_row_ARGB2554; - data->render.PutValues = put_values_ARGB2554; - data->render.PutMonoValues = put_mono_values_ARGB2554; - break; - case DSPF_ARGB1555: - data->render.GetRow = get_row_ARGB1555; - data->render.GetValues = get_values_ARGB1555; - data->render.PutRow = put_row_ARGB1555; - data->render.PutRowRGB = put_row_rgb_ARGB1555; - data->render.PutMonoRow = put_mono_row_ARGB1555; - data->render.PutValues = put_values_ARGB1555; - data->render.PutMonoValues = put_mono_values_ARGB1555; - break; - case DSPF_RGB555: - data->render.GetRow = get_row_RGB555; - data->render.GetValues = get_values_RGB555; - data->render.PutRow = put_row_RGB555; - data->render.PutRowRGB = put_row_rgb_RGB555; - data->render.PutMonoRow = put_mono_row_RGB555; - data->render.PutValues = put_values_RGB555; - data->render.PutMonoValues = put_mono_values_RGB555; - break; - case DSPF_RGB16: - data->render.GetRow = get_row_RGB16; - data->render.GetValues = get_values_RGB16; - data->render.PutRow = put_row_RGB16; - data->render.PutRowRGB = put_row_rgb_RGB16; - data->render.PutMonoRow = put_mono_row_RGB16; - data->render.PutValues = put_values_RGB16; - data->render.PutMonoValues = put_mono_values_RGB16; - break; - case DSPF_RGB24: - data->render.GetRow = get_row_RGB24; - data->render.GetValues = get_values_RGB24; - data->render.PutRow = put_row_RGB24; - data->render.PutRowRGB = put_row_rgb_RGB24; - data->render.PutMonoRow = put_mono_row_RGB24; - data->render.PutValues = put_values_RGB24; - data->render.PutMonoValues = put_mono_values_RGB24; - break; - case DSPF_RGB32: - data->render.GetRow = get_row_RGB32; - data->render.GetValues = get_values_RGB32; - data->render.PutRow = put_row_RGB32; - data->render.PutRowRGB = put_row_rgb_RGB32; - data->render.PutMonoRow = put_mono_row_RGB32; - data->render.PutValues = put_values_RGB32; - data->render.PutMonoValues = put_mono_values_RGB32; - break; - case DSPF_ARGB: - data->render.GetRow = get_row_ARGB; - data->render.GetValues = get_values_ARGB; - data->render.PutRow = put_row_ARGB; - data->render.PutRowRGB = put_row_rgb_ARGB; - data->render.PutMonoRow = put_mono_row_ARGB; - data->render.PutValues = put_values_ARGB; - data->render.PutMonoValues = put_mono_values_ARGB; - break; - case DSPF_AiRGB: - data->render.GetRow = get_row_AiRGB; - data->render.GetValues = get_values_AiRGB; - data->render.PutRow = put_row_AiRGB; - data->render.PutRowRGB = put_row_rgb_AiRGB; - data->render.PutMonoRow = put_mono_row_AiRGB; - data->render.PutValues = put_values_AiRGB; - data->render.PutMonoValues = put_mono_values_AiRGB; - break; - default: - D_BUG( "unexpected pixelformat" ); - return false; - } - - data->render.Width = data->width; - data->render.Height = data->height; - - _mesa_add_renderbuffer( framebuffer, BUFFER_FRONT_LEFT, &data->render ); - - _mesa_add_soft_renderbuffers( framebuffer, - GL_FALSE, - visual->haveDepthBuffer, - visual->haveStencilBuffer, - visual->haveAccumBuffer, - GL_FALSE, - GL_FALSE ); - - TNL_CONTEXT( context )->Driver.RunPipeline = _tnl_run_pipeline; - - _mesa_enable_sw_extensions( context ); - - return true; -} - -static void -directfbgl_destroy_context( GLcontext *context, - GLframebuffer *framebuffer ) -{ - _swsetup_DestroyContext( context ); - _swrast_DestroyContext( context ); - _tnl_DestroyContext( context ); - _vbo_DestroyContext( context ); - //_mesa_free_framebuffer_data( framebuffer ); - _mesa_free_context_data( context ); -} - -- cgit v1.2.3 From 97972244d5254cb2862325f8fe03db0a82a8041a Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 15:52:32 -0500 Subject: Remove d3d driver --- docs/README.D3D | 124 -- src/mesa/drivers/d3d/D3DCAPS.CPP | 250 ---- src/mesa/drivers/d3d/D3DHAL.H | 68 - src/mesa/drivers/d3d/D3DInit.cpp | 891 ------------- src/mesa/drivers/d3d/D3DMESA.H | 84 -- src/mesa/drivers/d3d/D3DRaster.cpp | 213 ---- src/mesa/drivers/d3d/D3DShared.h | 154 --- src/mesa/drivers/d3d/D3DTEXT.CPP | 576 --------- src/mesa/drivers/d3d/D3DTextureMgr.cpp | 947 -------------- src/mesa/drivers/d3d/D3DTextureMgr.h | 62 - src/mesa/drivers/d3d/D3DUTILS.CPP | 638 ---------- src/mesa/drivers/d3d/D3Dvbrender.c | 2149 -------------------------------- src/mesa/drivers/d3d/DDrawPROCS.c | 399 ------ src/mesa/drivers/d3d/DEBUG.C | 143 --- src/mesa/drivers/d3d/DEBUG.H | 90 -- src/mesa/drivers/d3d/DbgEnv.bat | 25 - src/mesa/drivers/d3d/MAKEFILE | 101 -- src/mesa/drivers/d3d/NULLProcs.h | 49 - src/mesa/drivers/d3d/NullProcs.c | 49 - src/mesa/drivers/d3d/OPENGL32.DEF | 442 ------- src/mesa/drivers/d3d/WGL.C | 1262 ------------------- src/mesa/drivers/d3d/d3dText.h | 53 - 22 files changed, 8769 deletions(-) delete mode 100644 docs/README.D3D delete mode 100644 src/mesa/drivers/d3d/D3DCAPS.CPP delete mode 100644 src/mesa/drivers/d3d/D3DHAL.H delete mode 100644 src/mesa/drivers/d3d/D3DInit.cpp delete mode 100644 src/mesa/drivers/d3d/D3DMESA.H delete mode 100644 src/mesa/drivers/d3d/D3DRaster.cpp delete mode 100644 src/mesa/drivers/d3d/D3DShared.h delete mode 100644 src/mesa/drivers/d3d/D3DTEXT.CPP delete mode 100644 src/mesa/drivers/d3d/D3DTextureMgr.cpp delete mode 100644 src/mesa/drivers/d3d/D3DTextureMgr.h delete mode 100644 src/mesa/drivers/d3d/D3DUTILS.CPP delete mode 100644 src/mesa/drivers/d3d/D3Dvbrender.c delete mode 100644 src/mesa/drivers/d3d/DDrawPROCS.c delete mode 100644 src/mesa/drivers/d3d/DEBUG.C delete mode 100644 src/mesa/drivers/d3d/DEBUG.H delete mode 100644 src/mesa/drivers/d3d/DbgEnv.bat delete mode 100644 src/mesa/drivers/d3d/MAKEFILE delete mode 100644 src/mesa/drivers/d3d/NULLProcs.h delete mode 100644 src/mesa/drivers/d3d/NullProcs.c delete mode 100644 src/mesa/drivers/d3d/OPENGL32.DEF delete mode 100644 src/mesa/drivers/d3d/WGL.C delete mode 100644 src/mesa/drivers/d3d/d3dText.h (limited to 'src') diff --git a/docs/README.D3D b/docs/README.D3D deleted file mode 100644 index b41fcb6208..0000000000 --- a/docs/README.D3D +++ /dev/null @@ -1,124 +0,0 @@ - - DirectX 6 Driver for Mesa 3.0 - - -This software is distributed under the terms of the GNU Library -General Public License, see the LICENSE file for details. - - - -What do you need ? ------------------- - - - A PC with a DirectX 6 video driver installed. - - - Mesa 3.0 - - - The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine). - The Voodoo2 requires the Glide library 2.51. The Glide 3.0 is not - compatible with the Glide 2.x so it doesn't work with the current - version of the driver; - - - Visual C++ 5.0 is only compiler test but others should be ok with - changes to the makefiles (CFLAGS/LFLAGS). - - - DirectX 6 SDK (was a MS download but not sure if still available). - - - SoftIce or another debugger that will get DPF's is nice. - - -Tested on: ----------- - Windows 95 - Windows 98 - Windows NT 5.0 (beta 2) - - -What is able to do ? --------------------- - - - the driver will try and use DirectX to rasterize the OpenGL primitives - that are sent to the driver. The driver will fall back to SW if the rendering - context is too big. The fallback to SW still uses DirectDraw. If the driver - fails to support and operation (accum, stencil, etc) then it will try and get - Mesa to render it in SW. DirectX 6 features that are unsupported by the - installed DirectX 6 driver will be mapped to some other best fit feature. - - -How to compile: ---------------- - - These instructions assume you have Visual C++ installed. - - You might need to increase you enviroment space. You can do this by - adding the following statement to you config.sys. - - shell=C:\COMMAND.COM C:\ /p /e:8198 - - Next setup you compiler enviroment by running vcvars32.bat in the Visual C++ - 'bin' directoy. - - c:\DevStudio\VC\bin\vcvars32.bat - - Modify the D3D makefile to point at your SDK install. Example has the SDK - installed on my 'f' drive in the root. - - file: \Mesa-3.0\src\makefile.d3d - - SDKROOT=f:\mssdk - - Now you can simply make the project. If you look in the makefile you can see - I have some different targets like 'install'. - - nmake /f makefile.d3d - - -FAQ: ----- - - 1) I don't think the driver is using my DirectX driver. - - This maybe true as the current version will only select the Primary D3D driver - installed. If you 3D card is the secondary (3dfx) then your out of luck for this - release. - - 2) The driver seems like its not HW accelerated. - - If you have a video card with limited memory then you might want to try and - change your destop resolution to a low setting (640x480x16) so that the 3D part - of the card has more resources. Remeber the driver can't make the card better... - - 3) Nothing works. - - Make sure you have a DirectX '6' driver installed. Check you driver docs for this - info or use the SDK info utilities. - The final 'dll' is named opengl32.dll and is either in the same directory as the - OpenGL program or in your system directory (x:\windows\system or x:\winnt\system32). - Check your destop resolution. Most DirectX 6 drivers will only support 16bit and - 32bit color depth. To find out for sure you can check the DirectX Info Viewer in - the SDK. - - - 4) Rendering doesn't look right. - - Sometimes this is because the card doesn't support a feature that that is required. - This is usually due to unsupported alpha functions (test/blend) or texture mapping. - Some cards suffer from too small of an alpha channel. The driver does its best to - fallback on unsupported features. This is not to say the driver may not have a bug(s). - - 5) Textures look bad. - - No mipmapping in this release. - - -Thanks to: ----------- - -Brian Paul - - - - -Leigh McRae (leigh@altsoftware.com) -February 9, 1999 - diff --git a/src/mesa/drivers/d3d/D3DCAPS.CPP b/src/mesa/drivers/d3d/D3DCAPS.CPP deleted file mode 100644 index 80ee91d922..0000000000 --- a/src/mesa/drivers/d3d/D3DCAPS.CPP +++ /dev/null @@ -1,250 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver Build 5 */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "D3DHAL.h" -/*===========================================================================*/ -/* Macros. */ -/*===========================================================================*/ -#define SRCBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwSrcBlendCaps & d3d ) \ - { \ - sprintf( buffer, "SRC Blend: %s -> %s", # gl, # d3d ); \ - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ - pShared->dwSrcBlendCaps[index] = d3d; \ - } \ - else \ - { \ - sprintf( buffer, "SRC Blend: %s -> %s", # gl, # fall ); \ - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ - pShared->dwSrcBlendCaps[index] = fall; \ - } -#define DSTBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwDestBlendCaps & d3d ) \ - { \ - sprintf( buffer, "DST Blend: %s -> %s", # gl, # d3d ); \ - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ - pShared->dwDestBlendCaps[index] = d3d; \ - } \ - else \ - { \ - sprintf( buffer, "DST Blend: %s -> %s", # gl, # fall ); \ - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \ - pShared->dwDestBlendCaps[index] = fall; \ - } - -/*===========================================================================*/ -/* I use this function to handle the fact that the D3D texture blending and */ -/* OpenGL texture blending functions don't map one to one. Also there is the*/ -/* problem with cards not supporting all the D3D functions. So I use the CAPS*/ -/* of the card to make a table of functions that will have defaults for the */ -/* unsupported functions. */ -/* So first I fill the table with the fallback function then I check to see */ -/* if the card supports the requested function. If it does I replace the */ -/* default thats already in the array. Now order does matter as I used an */ -/* enum type in D3DShared.h so that the mapping would be a little easier. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void AlphaBlendTableHAL( PMESAD3DHAL pHAL ) -{ - PMESAD3DSHARED pShared = &pHAL->shared; - int index; - char buffer[128]; - - DPF(( DBG_FUNC, "AlphaBlendTableHAL();" )); - - /* Make the fallback for the Source blend. */ - for( index = 0; index < 14; index++ ) - { - switch( index ) - { - case s_zero: - SRCBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE ); - break; - case s_one: - SRCBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE ); - break; - case s_dst_color: - SRCBLEND_MAP( GL_DST_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE ); - break; - case s_one_minus_dst_color: - SRCBLEND_MAP( GL_ONE_MINUS_DST_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE ); - break; - case s_src_alpha: - SRCBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE ); - break; - case s_one_minus_src_alpha: - SRCBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE ); - break; - case s_dst_alpha: - SRCBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE ); - break; - case s_one_minus_dst_alpha: - SRCBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE ); - break; - case s_src_alpha_saturate: - SRCBLEND_MAP( GL_SRC_ALPHA_SATURATE, D3DBLEND_SRCALPHASAT, D3DBLEND_ONE ); - break; - case s_constant_color: - SRCBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE ); - break; - case s_one_minus_constant_color: - SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE ); - break; - case s_constant_alpha: - SRCBLEND_MAP( GL_CONSTANT_ALPHA, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE ); - break; - case s_one_minus_constant_alpha: - SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE ); - break; - } - } - - /* Make the fallback for the Destination blend. */ - for( index = 0; index < 14; index++ ) - { - switch( index ) - { - case d_zero: - DSTBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE ); - break; - case d_one: - DSTBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE ); - break; - case d_src_color: - DSTBLEND_MAP( GL_SRC_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE ); - break; - case d_one_minus_src_color: - DSTBLEND_MAP( GL_ONE_MINUS_SRC_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE ); - break; - case d_src_alpha: - DSTBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE ); - break; - case d_one_minus_src_alpha: - DSTBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE ); - break; - case d_dst_alpha: - DSTBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE ); - break; - case d_one_minus_dst_alpha: - DSTBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE ); - break; - case d_constant_color: - DSTBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE ); - break; - case d_one_minus_constant_color: - DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE ); - break; - case d_constant_alpha: - DSTBLEND_MAP( GL_CONSTANT_ALPHAR, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE ); - break; - case d_one_minus_constant_alpha: - DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE ); - break; - } - } - - /* Make the fallbacks for the texture functions. */ - for( index = 0; index < 4; index++ ) - { - switch( index ) - { - case d3dtblend_decal: - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_DECAL" )); - pShared->dwTexFunc[index] = D3DTBLEND_DECAL; - } - else - { - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_MODULATE" )); - pShared->dwTexFunc[index] = D3DTBLEND_MODULATE; - } - else - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_ADD" )); - pShared->dwTexFunc[index] = D3DTBLEND_ADD; - } - } - break; - case d3dtblend_decalalpha: - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECALALPHA ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_DECALALPHA" )); - pShared->dwTexFunc[index] = D3DTBLEND_DECALALPHA; - } - else - { - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPA -> D3DTBLEND_DECAL" )); - pShared->dwTexFunc[index] = D3DTBLEND_DECAL; - } - else - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_ADD" )); - pShared->dwTexFunc[index] = D3DTBLEND_ADD; - } - } - break; - case d3dtblend_modulate: - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATE" )); - pShared->dwTexFunc[index] = D3DTBLEND_MODULATE; - } - else - { - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATEALPHA" )); - pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA; - } - else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_DECAL" )); - pShared->dwTexFunc[index] = D3DTBLEND_DECAL; - } - else - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_ADD" )); - pShared->dwTexFunc[index] = D3DTBLEND_ADD; - } - } - break; - case d3dtblend_modulatealpha: - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATEALPHA" )); - pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA; - } - else - { - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATE" )); - pShared->dwTexFunc[index] = D3DTBLEND_MODULATE; - } - else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL ) - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_DECALE" )); - pShared->dwTexFunc[index] = D3DTBLEND_DECAL; - } - else - { - DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_ADD" )); - pShared->dwTexFunc[index] = D3DTBLEND_ADD; - } - } - break; - } - } -} - diff --git a/src/mesa/drivers/d3d/D3DHAL.H b/src/mesa/drivers/d3d/D3DHAL.H deleted file mode 100644 index 2496d164e5..0000000000 --- a/src/mesa/drivers/d3d/D3DHAL.H +++ /dev/null @@ -1,68 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#ifndef _D3D_HAL_INC -#define _D3D_HAL_INC - -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include -#include -#include -#include -#include -#include "D3DShared.h" -#include "D3DTextureMgr.h" -#include "Debug.h" -/*===========================================================================*/ -/* Defines. */ -/*===========================================================================*/ -#define DX_RESTORE(ps) if ( (ps) && (ps)->IsLost() ) (ps)->Restore(); -/*===========================================================================*/ -/* Type defines. */ -/*===========================================================================*/ -typedef struct _d3d_hal_struct -{ - MESAD3DSHARED shared; - - GUID guid; - LPDIRECTDRAW lpDD; - LPDIRECTDRAW4 lpDD4; - LPDIRECT3D3 lpD3D3; - LPDIRECT3DDEVICE3 lpD3DDevice; - D3DDEVICEDESC D3DHWDevDesc; - LPDIRECTDRAWSURFACE4 lpDDSPrimary, - lpDDSRender, - lpDDSZbuffer; - LPDIRECT3DVIEWPORT3 lpViewport; - LPDIRECTDRAWCLIPPER lpClipper; - DDPIXELFORMAT ddpf, - ddpfZBuffer; - PTM_OBJECT pTMList; - -} MESAD3DHAL, *PMESAD3DHAL; -/*===========================================================================*/ -/* External function prototypes. */ -/*===========================================================================*/ -extern BOOL InitTMgrHAL( PMESAD3DHAL pHAL ); -extern void TermTMgrHAL( PMESAD3DHAL pHAL ); -extern void AlphaBlendTableHAL( PMESAD3DHAL pHAL ); - -extern void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel ); -extern char *ErrorStringD3D( HRESULT hr ); -extern void FatalShutDown( PMESAD3DHAL pHAL ); -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ -extern char *errorMsg; - -#endif - diff --git a/src/mesa/drivers/d3d/D3DInit.cpp b/src/mesa/drivers/d3d/D3DInit.cpp deleted file mode 100644 index e21cd21e25..0000000000 --- a/src/mesa/drivers/d3d/D3DInit.cpp +++ /dev/null @@ -1,891 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver Build 5 */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "D3DHAL.h" -/*===========================================================================*/ -/* Local function prototypes. */ -/*===========================================================================*/ -static void DestroyAllSurfaces( PMESAD3DHAL pHAL ); -static void DestroyDevice( PMESAD3DHAL pHAL ); -static void DestroyInterfaces( PMESAD3DHAL pHAL ); - -HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid ); -HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid ); -HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid ); -/*===========================================================================*/ -/* Globals. */ -/*===========================================================================*/ -//char *errorMsg; -/*===========================================================================*/ -/* This function is responable for allocating the actual MESAD3DHAL struct. */ -/* Each Mesa context will have its own MESAD3DHAL struct so its like a mini */ -/* context to some extent. All one time allocations/operations get done here.*/ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -extern "C" PMESAD3DSHARED InitHAL( HWND hwnd ) -{ - PMESAD3DHAL pHAL; - ULONG rc; - - DPF(( DBG_FUNC, "InitHAL();" )); - DPF(( DBG_CNTX_INFO, "hwnd: %d", hwnd )); - - /* Allocate the structure and zero it out. */ - pHAL = (PMESAD3DHAL)ALLOC( sizeof(MESAD3DHAL) ); - if ( pHAL == NULL ) - { - RIP( pHAL, "InitHAL->", "Memory Allocation" ); - return (PMESAD3DSHARED)NULL; - } - memset( pHAL, 0, sizeof(MESAD3DHAL) ); - - /* Get the texture manager going. */ - rc = InitTMgrHAL( pHAL ); - if ( rc == FALSE ) - { - RIP( pHAL, "InitTMgrHAL->", "Failed" ); - return (PMESAD3DSHARED)NULL; - } - - /* Fill in the window parameters if we can. */ - pHAL->shared.hwnd = hwnd; - - /* Parse the user's enviroment variables to generate a debug mask. */ - ReadDBGEnv(); - - return (PMESAD3DSHARED)pHAL; -} -/*===========================================================================*/ -/* This function will unload all the resources that the MESAD3DHAL struct */ -/* has bound to it. The actual structure itself will be freed. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void TermHAL( PMESAD3DSHARED pShared ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - - DPF(( DBG_FUNC, "TermHAL();" )); - - /* Check for an empty wrapper structure. */ - if ( pHAL == NULL ) - return; - - /* Kill this texture manager. */ - TermTMgrHAL( pHAL ); - - /* Kill any DDraw stuff if exists. */ - DestroyDevice( pHAL ); - DestroyAllSurfaces( pHAL ); - DestroyInterfaces( pHAL ); - - FREE( pHAL ); -} -/*===========================================================================*/ -/* This function is used to init and resize the rendering surface as the two*/ -/* are almost the same. First the device and all the surfaces are destoryed */ -/* if they already exist. Next we create a OffScreen rendering surface and */ -/* save some pixelformat info to do color convertions. Next we start to take */ -/* care of getting the most out of the hardware. I use bHardware to determine*/ -/* the state of the device we found in the device enumeration. The enum proc*/ -/* will try for hardware first. I next use a bForceSW to make the enum proc */ -/* choose a software device. So I will try some combinations with HW first */ -/* until I feel I have to set the bForceSW and call this function again. If */ -/* this function is called with no width or height then use the internals. */ -/* NOTE: The worst case is that all will be in SW (RGBDevice) and really */ -/* I should forget the whole thing and fall back to a DDraw span type*/ -/* rendering but what is the point. This way I always know I have a */ -/* D3DDevice and that makes things easier. I do impliment the span */ -/* rendering function for stuff that I haven't done support for such */ -/* as points and lines. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE */ -/*===========================================================================*/ -extern "C" BOOL CreateHAL( PMESAD3DSHARED pShared ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - DDSURFACEDESC2 ddsd2; - D3DDEVICEDESC D3DSWDevDesc; - DDSCAPS2 ddscaps; - DWORD dwCoopFlags, - dwWidth, - dwHeight; - ULONG rc; - - DPF(( DBG_FUNC, "CreateHAL();" )); - -#define InitDDSD2(f) memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); \ - ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); \ - ddsd2.dwFlags = f; - - if ( pHAL == NULL ) - return FALSE; - - /* Use the internal rectangle struct. */ - dwWidth = pShared->rectW.right - pShared->rectW.left; - dwHeight = pShared->rectW.bottom - pShared->rectW.top; - - DPF(( DBG_CNTX_INFO, "Width: %d Height: %d", dwWidth, dwHeight )); - - /* The dimensions might still be the same so just leave. */ - if ( (dwWidth == pShared->dwWidth) && (dwHeight == pShared->dwHeight) ) - { - DPF(( DBG_CNTX_WARN, "Context size hasn't changed" )); - return TRUE; - } - - /* If one of the dimensions are zero then leave. WM_SIZE should get us back here. */ - if ( (dwWidth == 0) || (dwHeight == 0) ) - return TRUE; - - /* Save the renders dimensions. */ - pShared->dwWidth = dwWidth; - pShared->dwHeight = dwHeight; - - DPF(( DBG_CNTX_INFO, "Creating Context:\n cx:%d cy:%d", pShared->dwWidth, pShared->dwHeight )); - - /*=================================*/ - /* Create all required interfaces. */ - /*=================================*/ - - /* Kill any DDraw stuff if exists. */ - DestroyDevice( pHAL ); - DestroyAllSurfaces( pHAL ); - DestroyInterfaces( pHAL ); - - /* Create a instance of DDraw using the Primary display driver. */ - rc = DirectDrawCreate( NULL, &pHAL->lpDD, NULL ); - if( FAILED(rc) ) - { - RIP( pHAL, "DirectDrawCreate->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Get the DDraw4 interface. */ - rc = pHAL->lpDD->QueryInterface( IID_IDirectDraw4, (void **)&pHAL->lpDD4 ); - if( FAILED(rc) ) - { - RIP( pHAL, "QueryInterface (IID_IDirectDraw4) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Get the Direct3D3 interface. */ - rc = pHAL->lpDD4->QueryInterface( IID_IDirect3D3, (void **)&pHAL->lpD3D3 ); - if( FAILED(rc) ) - { - RIP( pHAL, "QueryInterface (IID_IDirect3D3) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Set the Cooperative level. NOTE: we need to know if we are FS at this point.*/ - dwCoopFlags = (pShared->bWindow == TRUE) ? DDSCL_NORMAL : (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); - rc = pHAL->lpDD4->SetCooperativeLevel( pShared->hwnd, dwCoopFlags ); - if ( FAILED(rc) ) - { - RIP( pHAL, "SetCooperativeLevel->", ErrorStringD3D(rc) ); - return FALSE; - } - - /*==================================================================*/ - /* Get the best device we can and note whether its hardware or not. */ - /*==================================================================*/ - pShared->bForceSW = FALSE; - pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL ); - pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice ); - DPF(( DBG_CNTX_INFO, "bHardware: %s", (pShared->bHardware) ? "TRUE" : "FALSE" )); - DPF(( DBG_CNTX_INFO, "bWindowed: %s", (pShared->bWindow) ? "TRUE" : "FALSE" )); - - /*========================================================================*/ - /* HARDWARE was found. */ - /*========================================================================*/ - if ( pShared->bHardware == TRUE ) - { - /*===================================*/ - /* HARDWARE -> Z-BUFFER. */ - /*===================================*/ - - /* Get a Z-Buffer pixelformat. */ - memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); - ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); - rc = pHAL->lpD3D3->EnumZBufferFormats( pHAL->guid, EnumZBufferHook, (VOID*)&ddsd2.ddpfPixelFormat ); - if ( FAILED(rc) ) - { - RIP( pHAL, "EnumZBufferFormatsl->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Setup our request structure for the Z-buffer surface. */ - ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; - ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY; - ddsd2.dwWidth = dwWidth; - ddsd2.dwHeight = dwHeight; - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSZbuffer, NULL ); - if ( !FAILED(rc) ) - { - DPF(( DBG_CNTX_INFO, "HW ZBuffer" )); - - /*===================================*/ - /* HARDWARE -> Z-BUFFER -> FLIPABLE */ - /*===================================*/ - if ( pShared->bWindow == FALSE ) - { - InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT ); - ddsd2.dwBackBufferCount = 1; - ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); - if ( FAILED(rc) ) - { - /* Make sure we try the next fall back. */ - DPF(( DBG_CNTX_WARN, "HW Flip/Complex not available" )); - pHAL->lpDDSPrimary = NULL; - } - else - { - /* Get the back buffer that was created. */ - ddscaps.dwCaps = DDSCAPS_BACKBUFFER; - rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender ); - if ( FAILED(rc) ) - { - DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> HW Flip/Complex" )); - - /* Make sure we try the next fall back. */ - pHAL->lpDDSPrimary->Release(); - pHAL->lpDDSPrimary = NULL; - } - else - { - /* I have had problems when a complex surface comes back */ - /* with the back buffer being created in SW. Not sure why */ - /* or how this is possable but I'm checking for it here. */ - memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); - ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); - DX_RESTORE( pHAL->lpDDSRender ); - rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 ); - if ( FAILED(rc) ) - { - RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* If the surface is in VID then we are happy with are Flipable. */ - if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM ) - { - pShared->bFlipable = TRUE; - DPF(( DBG_CNTX_INFO, "HW Flip/Complex!" )); - } - else - { - /* Kill this setup. */ - pHAL->lpDDSPrimary->Release(); - pHAL->lpDDSPrimary = NULL; - } - } - } - } - - /*===================================*/ - /* HARDWARE -> Z-BUFFER -> BLT */ - /*===================================*/ - if ( pHAL->lpDDSPrimary == NULL ) - { - pShared->bFlipable = FALSE; - - /* Create the Primary (front buffer). */ - InitDDSD2( DDSD_CAPS ); - ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); - if ( FAILED(rc) ) - { - /* This is an error as we should be able to do this at minimum. */ - RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Create the Render (back buffer). */ - InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT ); - ddsd2.dwWidth = dwWidth; - ddsd2.dwHeight = dwHeight; - ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL ); - if ( FAILED(rc) ) - { - DPF(( DBG_CNTX_WARN, "Failed HW Offscreen surface" )); - - /* Make sure we try the next fall back. */ - pHAL->lpDDSPrimary->Release(); - pHAL->lpDDSPrimary = NULL; - } - else - { - /* Might as well check here too see if this surface is in */ - /* hardware. If nothing else just to be consistant. */ - memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); - ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); - DX_RESTORE( pHAL->lpDDSRender ); - rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 ); - if ( FAILED(rc) ) - { - RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* If the surface is in VID then we are happy. */ - if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM ) - { - /* Create a clipper object so that DDraw will be able to blt windows that */ - /* have been clipped by the screen or other windows. */ - pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL ); - pHAL->lpClipper->SetHWnd( 0, pShared->hwnd ); - pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper ); - pHAL->lpClipper->Release(); - DPF(( DBG_CNTX_INFO, "HW RENDER surface" )); - } - else - { - /* Kill this setup. */ - pHAL->lpDDSRender->Release(); - pHAL->lpDDSRender = NULL; - pHAL->lpDDSPrimary->Release(); - pHAL->lpDDSPrimary = NULL; - } - } - } - - /*===================================*/ - /* Create D3DDEVICE -> HARDWARE. */ - /*===================================*/ - if ( pHAL->lpDDSZbuffer && pHAL->lpDDSPrimary && pHAL->lpDDSRender ) - { - DX_RESTORE( pHAL->lpDDSRender ); - DX_RESTORE( pHAL->lpDDSZbuffer ); - - rc = pHAL->lpDDSRender->AddAttachedSurface( pHAL->lpDDSZbuffer ); - if ( FAILED(rc) ) - { - RIP( pHAL, "AddAttachedSurface (ZBUFFER) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DHALDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL ); - if ( rc != D3D_OK ) - { - DPF(( DBG_CNTX_WARN, "Failed HW Device" )); - pHAL->lpD3DDevice = NULL; - } - else - { - DPF(( DBG_CNTX_INFO, "HW Device" )); - } - } - } - } - - /*========================================================================*/ - /* SOFTWARE fallback. */ - /*========================================================================*/ - if ( pHAL->lpD3DDevice == NULL ) - { - DPF(( DBG_CNTX_INFO, "SW fallback :(" )); - - /* Make sure we have no surfaces allocated. Just incase. */ - DestroyAllSurfaces( pHAL ); - - /* Get a software device. */ - pShared->bFlipable = FALSE; - pShared->bForceSW = TRUE; - pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL ); - pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice ); - - /*===================================*/ - /* SOFTWARE -> Z-BUFFER. */ - /*===================================*/ - - /*===================================*/ - /* SOFTWARE -> Z-BUFFER -> FLIPABLE */ - /*===================================*/ - if ( pShared->bWindow == FALSE ) - { - InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT ); - ddsd2.dwBackBufferCount = 1; - ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX; - ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); - ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS); - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); - if ( FAILED(rc) ) - { - DPF(( DBG_CNTX_WARN, "Failed SW Flip/Complex" )); - - /* Make sure we try the next fall back. */ - pHAL->lpDDSPrimary = NULL; - } - else - { - ddscaps.dwCaps = DDSCAPS_BACKBUFFER; - rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender ); - if ( FAILED(rc) ) - { - /* Make sure we try the next fall back. */ - DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> SW Flip/Complex" )); - pHAL->lpDDSPrimary->Release(); - pHAL->lpDDSPrimary = NULL; - } - else - { - DPF(( DBG_CNTX_INFO, "SW Flip/Complex" )); - pShared->bFlipable = TRUE; - } - } - } - - /*===================================*/ - /* SOFTWARE -> Z-BUFFER -> BLT */ - /*===================================*/ - if ( pHAL->lpDDSPrimary == NULL ) - { - /* Create the Primary (front buffer). */ - InitDDSD2( DDSD_CAPS ); - ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL ); - if ( FAILED(rc) ) - { - /* This is an error as we should be able to do this at minimum. */ - RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Create the Render (back buffer). */ - InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT ); - ddsd2.dwWidth = dwWidth; - ddsd2.dwHeight = dwHeight; - ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; - ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); - ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS); - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL ); - if ( FAILED(rc) ) - { - /* That was our last hope. */ - RIP( pHAL, "CreateSurface (RENDER) ->", ErrorStringD3D(rc) ); - return FALSE; - } - else - { - DPF(( DBG_CNTX_INFO, "SW RENDER surface" )); - - /* Create a clipper object so that DDraw will be able to blt windows that */ - /* have been clipped by the screen or other windows. */ - pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL ); - pHAL->lpClipper->SetHWnd( 0, pShared->hwnd ); - pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper ); - pHAL->lpClipper->Release(); - } - } - - /*===================================*/ - /* Create D3DDEVICE -> SOFTWARE. */ - /*===================================*/ - if ( pHAL->lpDDSPrimary && pHAL->lpDDSRender ) - { - DX_RESTORE( pHAL->lpDDSRender ); - rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DRGBDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL ); - if ( rc != D3D_OK ) - { - /* That was our last hope. */ - RIP( pHAL, "CreateDevice (IID_IDirect3DRGBDevice) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - DPF(( DBG_CNTX_INFO, "SW Device" )); - } - } - - /*==============================================================================*/ - /* Get a copy of the render pixelformat so that wgl.c can call GetPixelInfoD3D. */ - /*==============================================================================*/ - memset( &pHAL->ddpf, 0, sizeof(DDPIXELFORMAT) ); - pHAL->ddpf.dwSize = sizeof( DDPIXELFORMAT ); - rc = pHAL->lpDDSRender->GetPixelFormat( &pHAL->ddpf ); - if ( FAILED(rc) ) - { - RIP( pHAL, "GetPixelFormat ->", ErrorStringD3D(rc) ); - return FALSE; - } - DebugPixelFormat( "Using OFFSCREEN", &pHAL->ddpf ); - DebugPixelFormat( "Using ZBUFFER", &ddsd2.ddpfPixelFormat ); - - /* Get a copy of what the D3DDevice supports for later use. */ - memset( &D3DSWDevDesc, 0, sizeof(D3DDEVICEDESC) ); - memset( &pHAL->D3DHWDevDesc, 0, sizeof(D3DDEVICEDESC) ); - D3DSWDevDesc.dwSize = sizeof( D3DDEVICEDESC ); - pHAL->D3DHWDevDesc.dwSize = sizeof( D3DDEVICEDESC ); - rc = pHAL->lpD3DDevice->GetCaps( &pHAL->D3DHWDevDesc, &D3DSWDevDesc ); - if ( FAILED(rc) ) - { - RIP( pHAL, "GetCaps ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Get a copy of the pixel convertion stuff for direct buffer access. */ - Solve8BitChannelPixelFormat( &pHAL->ddpf, &pShared->pixel ); - AlphaBlendTableHAL( pHAL ); - - /* We must prime the Begin/End scene for SwapBuffers to work. */ - rc = pHAL->lpD3DDevice->BeginScene(); - if ( FAILED(rc) ) - { - RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) ); - return FALSE; - } - -#undef InitDDSD2 - - return TRUE; -} -/*===========================================================================*/ -/* This function will make sure a viewport is created and set for the device*/ -/* in the supplied structure. If a rect is supplied then it will be used for*/ -/* the viewport otherwise the current setting in the strucute will be used. */ -/* Note that the rect is relative to the window. So left/top must be 0,0 to */ -/* use the whole window else there is scissoring going down. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -extern "C" BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - D3DVIEWPORT2 vdData; - ULONG rc; - POINT pt; - - DPF(( DBG_FUNC, "SetViewportHAL();" )); - - /* Make sure we have enough info. */ - if ( !pHAL || !pHAL->lpDDSPrimary || !pHAL->lpD3DDevice ) - { - DPF(( DBG_CNTX_WARN, "SetViewport() -> NULL Pointer" )); - return FALSE; - } - - /* TODO: this is just a temp fix to stop redundant changes. */ - if ( pRect && - (pShared->rectV.left == pRect->left) && - (pShared->rectV.right == pRect->right) && - (pShared->rectV.top == pRect->top) && - (pShared->rectV.bottom == pRect->bottom) ) - { - DPF(( DBG_CNTX_WARN, "Redundant viewport" )); - return TRUE; - } - - DPF(( DBG_CNTX_INFO, "Current Viewport:" )); - DPF(( DBG_CNTX_INFO, "x: %d y: %d", pShared->rectV.left, pShared->rectV.top )); - DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pShared->rectV.right-pShared->rectV.left), (pShared->rectV.bottom-pShared->rectV.top) )); - DPF(( DBG_CNTX_INFO, "New Viewport:" )); - DPF(( DBG_CNTX_INFO, "x: %d y: %d", pRect->left, pRect->top )); - DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pRect->right-pRect->left), (pRect->bottom-pRect->top) )); - - /* Update the current viewport rect if one is supplied. */ - if ( pRect ) - memcpy( &pShared->rectV, pRect, sizeof(RECT) ); - - /* Build the request structure. */ - memset( &vdData, 0, sizeof(D3DVIEWPORT2) ); - vdData.dwSize = sizeof(D3DVIEWPORT2); - vdData.dwX = pShared->rectV.left; - vdData.dwY = pShared->rectV.top; - vdData.dwWidth = (pShared->rectV.right - pShared->rectV.left); - vdData.dwHeight = (pShared->rectV.bottom - pShared->rectV.top); - - if ( !vdData.dwWidth || !vdData.dwHeight ) - { - GetClientRect( pShared->hwnd, &pShared->rectW ); - pt.x = pt.y = 0; - ClientToScreen( pShared->hwnd, &pt ); - OffsetRect( &pShared->rectW, pt.x, pt.y); - vdData.dwX = pShared->rectW.left; - vdData.dwY = pShared->rectW.top; - vdData.dwWidth = (pShared->rectW.right - pShared->rectW.left); - vdData.dwHeight = (pShared->rectW.bottom - pShared->rectW.top); - memcpy( &pShared->rectV, &pShared->rectW, sizeof(RECT) ); - } - - // The dvClipX, dvClipY, dvClipWidth, dvClipHeight, dvMinZ, - // and dvMaxZ members define the non-normalized post-perspective - // 3-D view volume which is visible to the viewer. In most cases, - // dvClipX is set to -1.0 and dvClipY is set to the inverse of - // the viewport's aspect ratio on the target surface, which can be - // calculated by dividing the dwHeight member by dwWidth. Similarly, - // the dvClipWidth member is typically 2.0 and dvClipHeight is set - // to twice the aspect ratio set in dwClipY. The dvMinZ and dvMaxZ - // are usually set to 0.0 and 1.0. - vdData.dvClipX = -1.0f; - vdData.dvClipWidth = 2.0f; - vdData.dvClipY = 1.0f; - vdData.dvClipHeight = 2.0f; - vdData.dvMaxZ = maxZ; - vdData.dvMinZ = minZ; - - DPF(( DBG_CNTX_INFO, "zMin: %f zMax: %f", minZ, maxZ )); - - /* I'm going to destroy the viewport everytime as when we size we will */ - /* have a new D3DDevice. As this area doesn't need to be fast... */ - if ( pHAL->lpViewport ) - { - DPF(( DBG_CNTX_INFO, "DeleteViewport" )); - - pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport ); - rc = pHAL->lpViewport->Release(); - pHAL->lpViewport = NULL; - } - - rc = pHAL->lpD3D3->CreateViewport( &pHAL->lpViewport, NULL ); - if ( rc != D3D_OK ) - { - DPF(( DBG_CNTX_ERROR, "CreateViewport Failed" )); - return FALSE; - } - - /* Update the device with the new viewport. */ - pHAL->lpD3DDevice->AddViewport( pHAL->lpViewport ); - pHAL->lpViewport->SetViewport2( &vdData ); - pHAL->lpD3DDevice->SetCurrentViewport( pHAL->lpViewport ); - - return TRUE; -} -/*===========================================================================*/ -/* */ -/* */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid ) -{ - DDSURFACEDESC2 *pddsd2 = (DDSURFACEDESC2 *)pVoid; - - DPF(( DBG_FUNC, "EnumSurfacesHook();" )); - - if ( (lpDDSDesc->ddpfPixelFormat.dwFlags == pddsd2->ddpfPixelFormat.dwFlags) && (lpDDSDesc->ddsCaps.dwCaps == pddsd2->ddsCaps.dwCaps) ) - { - /* Save the pixelformat now so that we know we have one. */ - memcpy( pddsd2, lpDDSDesc, sizeof(DDSURFACEDESC2) ); - - return D3DENUMRET_CANCEL; - } - - return D3DENUMRET_OK; -} -/*===========================================================================*/ -/* This is the callback proc to get a Z-Buffer. Thats it. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid ) -{ - DDPIXELFORMAT *pddpfChoice = (DDPIXELFORMAT *)pVoid; - - DPF(( DBG_FUNC, "EnumZBufferHook();" )); - - /* If this is ANY type of depth-buffer, stop. */ - if( pddpf->dwFlags == DDPF_ZBUFFER ) - { - /* Save the pixelformat now so that we know we have one. */ - memcpy( pddpfChoice, pddpf, sizeof(DDPIXELFORMAT) ); - - /* I feel if the hardware supports this low then lets use it. Could get ugly. */ - if( pddpf->dwZBufferBitDepth >= 8 ) - { - return D3DENUMRET_CANCEL; - } - } - - return D3DENUMRET_OK; -} -/*===========================================================================*/ -/* This function handles the callback for the D3DDevice enumeration. Good */ -/* god who's idea was this? The D3D wrapper has two variable related to what*/ -/* kind of device we want and have. First we have a Bool that is set if we */ -/* have allocated a HW device. We always look for the HW device first. The */ -/* other variable is used to force SW. If we have run into a case that we */ -/* want to fallback to SW then we set this. We will fallback if we cannot */ -/* texture in video memory (among others). */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pVoid; - LPD3DDEVICEDESC pChoice = lpD3DHWDesc; - - DPF(( DBG_FUNC, "EnumDeviceHook();" )); - - /* Determine if which device description is valid. */ - if ( pChoice->dcmColorModel == 0 ) - pChoice = lpD3DHELDesc; - - /* Make sure we always have a GUID. */ - memcpy( &pHAL->guid, lpGuid, sizeof(GUID) ); - - /* This controls whether we will except HW or not. */ - if ( pHAL->shared.bForceSW == TRUE ) - { - return (pChoice == lpD3DHELDesc) ? D3DENUMRET_CANCEL : D3DENUMRET_OK; - } - - /* Always try for hardware. */ - if ( pChoice == lpD3DHWDesc ) - { - return D3DENUMRET_CANCEL; - } - - return D3DENUMRET_OK; -} -/*===========================================================================*/ -/* This function will destroy any and all surfaces that this context has */ -/* allocated. If there is a clipper object then it will also be destoryed as*/ -/* it is part of the Primary Surface. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void DestroyAllSurfaces( PMESAD3DHAL pHAL ) -{ - LONG refCount; - - DPF(( DBG_FUNC, "DestroyAllSurfaces();" )); - - DX_RESTORE( pHAL->lpDDSPrimary ); - DX_RESTORE( pHAL->lpDDSRender ); - DX_RESTORE( pHAL->lpDDSZbuffer); - - if ( pHAL->lpDDSRender ) - { - pHAL->lpDDSRender->Unlock( NULL ); - - /* If this isn't a Flipable surface then we must clean up the render. */ - if ( pHAL->shared.bFlipable == FALSE) - { - if ( pHAL->lpDDSZbuffer ) - { - DPF(( DBG_CNTX_INFO, "Remove attached surfaces from RENDER" )); - pHAL->lpDDSRender->DeleteAttachedSurface( 0, NULL ); - } - - DPF(( DBG_CNTX_INFO, "Release RENDER" )); - refCount = pHAL->lpDDSRender->Release(); - pHAL->lpDDSRender = NULL; - } - } - - if ( pHAL->lpDDSZbuffer ) - { - DPF(( DBG_CNTX_INFO, "Release ZBuffer" )); - pHAL->lpDDSZbuffer->Unlock( NULL ); - refCount = pHAL->lpDDSZbuffer->Release(); - pHAL->lpDDSZbuffer = NULL; - } - - if ( pHAL->lpClipper ) - { - DPF(( DBG_CNTX_INFO, "Release Clipper" )); - refCount = pHAL->lpClipper->Release(); - pHAL->lpClipper = NULL; - } - - if ( pHAL->lpDDSPrimary ) - { - pHAL->lpDDSPrimary->Unlock( NULL ); - - DPF(( DBG_CNTX_INFO, "Release PRIMARY" )); - refCount = pHAL->lpDDSPrimary->Release(); - pHAL->lpDDSPrimary = NULL; - } -} -/*===========================================================================*/ -/* This function will destroy the current D3DDevice and any resources that */ -/* belong to it. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void DestroyDevice( PMESAD3DHAL pHAL ) -{ - LONG refCount; - - DPF(( DBG_FUNC, "DestroyDevice();" )); - - /* Kill the D3D stuff if exists. */ - if ( pHAL->lpViewport ) - { - DPF(( DBG_CNTX_INFO, "Delete Viewport" )); - pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport ); - - DPF(( DBG_CNTX_INFO, "Release Viewport" )); - refCount = pHAL->lpViewport->Release(); - pHAL->lpViewport = NULL; - } - - if ( pHAL->lpD3DDevice != NULL ) - { - DPF(( DBG_CNTX_INFO, "Release D3DDevice" )); - refCount = pHAL->lpD3DDevice->EndScene(); - refCount = pHAL->lpD3DDevice->Release(); - pHAL->lpD3DDevice = NULL; - } -} -/*===========================================================================*/ -/* This function will destroy the current D3DDevice and any resources that */ -/* belong to it. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void DestroyInterfaces( PMESAD3DHAL pHAL ) -{ - LONG refCount; - - DPF(( DBG_FUNC, "DestroyInterfaces();" )); - - if ( pHAL->lpD3D3 != NULL ) - { - DPF(( DBG_CNTX_INFO, "Release Direct3D3" )); - refCount = pHAL->lpD3D3->Release(); - pHAL->lpD3D3 = NULL; - } - - if ( pHAL->lpDD4 != NULL ) - { - DPF(( DBG_CNTX_INFO, "Release DDraw4" )); - refCount = pHAL->lpDD4->Release(); - pHAL->lpDD4 = NULL; - } - - if ( pHAL->lpDD != NULL ) - { - DPF(( DBG_CNTX_INFO, "Release DDraw" )); - refCount = pHAL->lpDD->Release(); - pHAL->lpDD = NULL; - } -} -/*===========================================================================*/ -/* This function will first send (not post) a message to the client window */ -/* that this context is using. The client will respond by unbinding itself */ -/* and binding the 'default' context. This allows the API to be supported */ -/* until the window can be destroyed. Finally we post the quit message to */ -/* the client in hopes to end the application. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void FatalShutDown( PMESAD3DHAL pHAL ) -{ - /* Whip this baby in too try and support the API until we die... */ - if ( pHAL ) - SendMessage( pHAL->shared.hwnd, UM_FATALSHUTDOWN, 0L, 0L ); - - /* Close the client application down. */ - PostQuitMessage( 0 ); -} - diff --git a/src/mesa/drivers/d3d/D3DMESA.H b/src/mesa/drivers/d3d/D3DMESA.H deleted file mode 100644 index 71a7cd8aed..0000000000 --- a/src/mesa/drivers/d3d/D3DMESA.H +++ /dev/null @@ -1,84 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#ifndef D3D_MESA_H -#define D3D_MESA_H -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include -#include -#include -#include "matrix.h" -#include "context.h" -#include "mtypes.h" -#include "vb.h" -#include "D3DShared.h" -#include "Debug.h" -#include "NULLProcs.h" -/*===========================================================================*/ -/* Macros. */ -/*===========================================================================*/ -#define FLIP(h,y) (h-y) -/*===========================================================================*/ -/* Magic numbers. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Type defines. */ -/*===========================================================================*/ -struct __extensions__ -{ - PROC proc; - char *name; -}; - -typedef GLbitfield (*ClearPROC)( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); -typedef void (*WSpanRGBPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] ); -typedef void (*WSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); -typedef void (*WSpanRGBAMonoPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] ); -typedef void (*WPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); -typedef void (*WPixelsRGBAMonoPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] ); -typedef void (*RSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); -typedef void (*RPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); - -typedef struct D3D_mesa_context -{ - PMESAD3DSHARED pShared; - - GLcontext *gl_ctx; /* The core GL/Mesa context */ - GLvisual *gl_visual; /* Describes the buffers */ - GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers */ - - HDC hdc; - WNDPROC hOldProc; - - UCHAR rClear, /* Current clear colors. */ - gClear, - bClear, - aClear, - rCurrent, /* Current rendering colors. */ - gCurrent, - bCurrent, - aCurrent; - - struct D3D_mesa_context *next; - -} D3DMESACONTEXT, *PD3DMESACONTEXT; -/*===========================================================================*/ -/* Extern function prototypes. */ -/*===========================================================================*/ -extern void gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ); -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ -extern D3DTLVERTEX D3DTLVertices[(VB_MAX*6)]; - -#endif - diff --git a/src/mesa/drivers/d3d/D3DRaster.cpp b/src/mesa/drivers/d3d/D3DRaster.cpp deleted file mode 100644 index 41e42ad94c..0000000000 --- a/src/mesa/drivers/d3d/D3DRaster.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "D3DHAL.h" -/*===========================================================================*/ -/* This function clears the context bound to the supplied shared context. */ -/* The function takes the D3D flags D3DCLEAR_TARGET, D3DCLEAR_STENCIL and */ -/* D3DCLEAR_ZBUFFER. Set bAll to TRUE for a full clear else supply the coord*/ -/* of the rect to be cleared relative to the window. The color is always a */ -/* 32bit value (RGBA). Fill in the z-value and stencil if needed. */ -/* */ -/* TODO: this can be redone to be called by Mesa directly. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - D3DRECT d3dRect; - -#ifdef D3D_DEBUG - HRESULT rc; - - DPF(( DBG_FUNC, "CleaHAL();" )); - - /* Make sure we have enough info. */ - if ( (pHAL == NULL) || (pHAL->lpViewport == NULL) ) - return; -#endif - - if ( bAll ) - { - /* I assume my viewport is valid. */ - d3dRect.lX1 = pShared->rectV.left; - d3dRect.lY1 = pShared->rectV.top; - d3dRect.lX2 = pShared->rectV.right; - d3dRect.lY2 = pShared->rectV.bottom; - } - else - { - d3dRect.lX1 = pShared->rectV.left + x; - d3dRect.lY1 = pShared->rectV.top + y; - d3dRect.lX2 = d3dRect.lX1 + cx; - d3dRect.lY2 = d3dRect.lY1 + cy; - } - -#ifdef D3D_DEBUG - rc = pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil ); - if ( FAILED(rc) ) - { - RIP( pHAL, "Clear2 ->", ErrorStringD3D(rc) ); - } -#else - pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil ); -#endif -} -/*===========================================================================*/ -/* Well this is the guts of it all. Here we rasterize the primitives that */ -/* are in their final form. OpenGL has done all the lighting, transfomations*/ -/* and clipping at this point. */ -/* */ -/* TODO: I'm not sure if I want to bother to check for errors on this call. */ -/* The overhead kills me... */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - -#ifdef D3D_DEBUG - HRESULT rc; - - DPF(( DBG_FUNC, "DrawPrimitveHAL();" )); - - /* Make sure we have enough info. */ - if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) ) - return; - - DPF(( DBG_PRIM_INFO, "DP( %d )", dwCount )); - - rc = pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType, - D3DFVF_TLVERTEX, - (LPVOID)pVertices, - dwCount, - (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); - if ( FAILED(rc) ) - { - RIP( pHAL, "DrawPrimitive ->", ErrorStringD3D(rc) ); - } -#else - pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType, - D3DFVF_TLVERTEX, - (LPVOID)pVertices, - dwCount, - (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); -#endif -} -/*===========================================================================*/ -/* This call will handle the swapping of the buffers. Now I didn't bother */ -/* to support single buffered so this will be used for glFlush() as its all */ -/* the same. So first we do an EndScene as we are always considered to be in*/ -/* a BeginScene because when we leave we do a BeginScene. Now note that when*/ -/* the context is created in the first place we do a BeginScene also just to */ -/* get things going. The call will use either Flip/blt based on the type of */ -/* surface was created for rendering. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void SwapBuffersHAL( PMESAD3DSHARED pShared ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - -#ifdef D3D_DEBUG - HRESULT rc; - - DPF(( DBG_FUNC, "SwapBuffersHAL();" )); - DPF(( DBG_ALL_PROFILE, "=================SWAP===================" )); - - /* Make sure we have enough info. */ - if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) ) - return; - - /* Make sure we have enough info. */ - if ( pHAL->lpDDSPrimary != NULL ) - { - rc = pHAL->lpD3DDevice->EndScene(); - if ( FAILED(rc) ) - { - RIP( pHAL, "EndScene ->", ErrorStringD3D(rc) ); - } - - if ( pShared->bFlipable ) - { - DPF(( DBG_CNTX_PROFILE, "Swap->FLIP" )); - rc = pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT ); - } - else - { - DPF(( DBG_CNTX_PROFILE, "Swap->Blt" )); - rc = pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL ); - } - if ( FAILED(rc) ) - { - RIP( pHAL, "Blt (RENDER/PRIMARY) ->", ErrorStringD3D(rc) ); - } - - rc = pHAL->lpD3DDevice->BeginScene(); - if ( FAILED(rc) ) - { - RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) ); - } - } -#else - pHAL->lpD3DDevice->EndScene(); - - if ( pShared->bFlipable ) - pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT ); - else - pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL ); - - pHAL->lpD3DDevice->BeginScene(); - -#endif -} -/*===========================================================================*/ -/* This function is a very thin wrapper for the D3D call 'SetRenderState'. */ -/* Using this function requires all the types to be defined by including the */ -/* D3D header file. */ -/* */ -/* TODO: would be much better to get ride of all these calls per VBRender. */ -/* I feel I should get this call into SetRenderStates() the RenderVB. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - -#ifdef D3D_DEBUG - HRESULT rc; - - DPF(( DBG_FUNC, "SetStateHAL();" )); - - /* Make sure we have enough info. */ - if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) ) - return; - - rc = pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState ); - if ( FAILED(rc) ) - { - RIP( pHAL, "SetRenderState ->", ErrorStringD3D(rc) ); - } - -#else - pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState ); -#endif -} - - - - - - - - diff --git a/src/mesa/drivers/d3d/D3DShared.h b/src/mesa/drivers/d3d/D3DShared.h deleted file mode 100644 index cc629e2111..0000000000 --- a/src/mesa/drivers/d3d/D3DShared.h +++ /dev/null @@ -1,154 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#ifndef D3D_MESA_ALL_H -#define D3D_MESA_ALL_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include -#include -/*===========================================================================*/ -/* Magic numbers. */ -/*===========================================================================*/ -#define TM_ACTION_LOAD 0x01 -#define TM_ACTION_BIND 0x02 -#define TM_ACTION_UPDATE 0x04 - -#define UM_FATALSHUTDOWN (WM_USER+42) -/*===========================================================================*/ -/* Macros defines. */ -/*===========================================================================*/ -#define ALLOC(cb) malloc( (cb) ) -#define FREE(p) { free( (p) ); (p) = NULL; } -/*===========================================================================*/ -/* Type defines. */ -/*===========================================================================*/ -typedef struct _pixel_convert -{ - int cb, /* Count in bytes of one pixel. */ - rShift, /* Shift count that postions each componet. */ - gShift, - bShift, - aShift; - float rScale, /* Value that scales a color that ranges 0.0 -> 1.0 */ - gScale, /* to this pixel format. */ - bScale, - aScale; - DWORD dwRMask, /* Color mask per component. */ - dwGMask, - dwBMask, - dwAMask; - -} PIXELINFO, *PPIXELINFO; - - -typedef struct _d3d_shared_info -{ - HWND hwnd; - BOOL bWindow, - bFlipable, - bForceSW, - bHardware; - RECT rectW, /* Window size and postion in screen space. */ - rectV; /* Viewport size and postion. */ - DWORD dwWidth, /* Current render size for quick checks. */ - dwHeight; - - PIXELINFO pixel; - DWORD dwSrcBlendCaps[14], /* See D3DCAPS.CPP */ - dwDestBlendCaps[14], - dwTexFunc[4]; - -} MESAD3DSHARED, *PMESAD3DSHARED; - -typedef struct _render_options -{ - BOOL bForceSoftware, /* TODO: Add user switches. */ - bStretchtoPrimary; - -} USER_CTRL, *PUSER_CRTL; - -enum { s_zero = 0, - s_one, - s_dst_color, - s_one_minus_dst_color, - s_src_alpha, - s_one_minus_src_alpha, - s_dst_alpha, - s_one_minus_dst_alpha, - s_src_alpha_saturate, - s_constant_color, - s_one_minus_constant_color, - s_constant_alpha, - s_one_minus_constant_alpha }; - -enum { d_zero = 0, - d_one, - d_src_color, - d_one_minus_src_color, - d_src_alpha, - d_one_minus_src_alpha, - d_dst_alpha, - d_one_minus_dst_alpha, - d_constant_color, - d_one_minus_constant_color, - d_constant_alpha, - d_one_minus_constant_alpha }; - -enum { d3dtblend_decal = 0, - d3dtblend_decalalpha, - d3dtblend_modulate, - d3dtblend_modulatealpha }; - -/*===========================================================================*/ -/* Function prototypes. */ -/*===========================================================================*/ -PMESAD3DSHARED InitHAL( HWND hwnd ); -void TermHAL( PMESAD3DSHARED pShared ); -BOOL CreateHAL( PMESAD3DSHARED pShared ); -BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ ); - -void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil ); -void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState ); -void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount ); - -void SwapBuffersHAL( PMESAD3DSHARED pShared ); -DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack ); -void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack ); -void UpdateScreenPosHAL( PMESAD3DSHARED pShared ); -void GetPixelInfoHAL( PMESAD3DSHARED pShared, PPIXELINFO pPixel ); -BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags, RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels ); -void DisableTMgrHAL( PMESAD3DSHARED pShared ); - - -int SaveDIBitmap( char *filename, BITMAPINFO *info, void *bits ); -int ARGB_SaveBitmap( char *filename, int width, int height, unsigned char *pARGB ); -int BGRA_SaveBitmap( char *filename, int width, int height, unsigned char *pBGRA ); -int BGR_SaveBitmap( char *filename, int width, int height, unsigned char *pBGR ); -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ -extern float g_DepthScale, /* Mesa needs to scale Z in SW. The HAL */ - g_MaxDepth; /* doesn't but I wanted SW still to work.*/ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/src/mesa/drivers/d3d/D3DTEXT.CPP b/src/mesa/drivers/d3d/D3DTEXT.CPP deleted file mode 100644 index 39855b65fa..0000000000 --- a/src/mesa/drivers/d3d/D3DTEXT.CPP +++ /dev/null @@ -1,576 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "d3dText.h" - -/*============================================================================= - - 1 - ------ - | | - 6 | | 2 - | 7 | - ------ - | | - 5 | | 3 - | | - ------ - 4 - - TL_0 TR_0 -TLL TL_1 TR_1 TRR - -MLL_0 ML_0 MR_0 MRR_0 -MLL_1 ML_1 MR_1 MRR_1 - -BLL BL_0 BR_0 BRR - BL_1 BR_1 - -=============================================================================*/ - -#define TLL 0 -#define TRR 1 -#define TL_0 2 -#define TL_1 3 -#define TR_0 4 -#define TR_1 5 - -#define MLL_0 6 -#define MLL_1 7 -#define MRR_0 8 -#define MRR_1 9 - -#define ML_0 10 -#define ML_1 11 -#define MR_0 12 -#define MR_1 13 - -#define BL_0 14 -#define BL_1 15 -#define BR_0 16 -#define BR_1 17 -#define BLL 18 -#define BRR 19 - -#define BIT1 0x00000001 -#define BIT2 0x00000002 -#define BIT3 0x00000004 -#define BIT4 0x00000008 -#define BIT5 0x00000010 -#define BIT6 0x00000020 -#define BIT7 0x00000040 - -#define TOP BIT4 -#define MIDDLE BIT7 -#define BOTTOM BIT1 -#define TLEFT BIT5 -#define BLEFT BIT6 -#define LEFT (TLEFT|BLEFT) -#define TRIGHT BIT3 -#define BRIGHT BIT2 -#define RIGHT (TRIGHT|BRIGHT) -#define ALL 0xFFFFFFFF - -/*===========================================================================*/ -/* This is the static array that will map the ASCII value of the character */ -/* being draw to the bit mask that will be scan converted to the LED display.*/ -/*===========================================================================*/ -DWORD textBitMasks[] = -{ - 0xFFFFFFFF, // 000 - 0xFFFFFFFF, // 001 - 0xFFFFFFFF, // 002 - 0xFFFFFFFF, // 003 - 0xFFFFFFFF, // 004 - 0xFFFFFFFF, // 005 - 0xFFFFFFFF, // 006 - 0xFFFFFFFF, // 007 - 0xFFFFFFFF, // 008 - 0xFFFFFFFF, // 009 - 0xFFFFFFFF, // 010 - 0xFFFFFFFF, // 011 - 0xFFFFFFFF, // 012 - 0xFFFFFFFF, // 013 - 0xFFFFFFFF, // 014 - 0xFFFFFFFF, // 015 - 0xFFFFFFFF, // 016 - 0xFFFFFFFF, // 017 - 0xFFFFFFFF, // 018 - 0xFFFFFFFF, // 019 - 0xFFFFFFFF, // 020 - 0xFFFFFFFF, // 021 - 0xFFFFFFFF, // 022 - 0xFFFFFFFF, // 023 - 0xFFFFFFFF, // 024 - 0xFFFFFFFF, // 025 - 0xFFFFFFFF, // 026 - 0xFFFFFFFF, // 027 - 0xFFFFFFFF, // 028 - 0xFFFFFFFF, // 029 - 0xFFFFFFFF, // 030 - 0XFFFFFFFF, // 031 - 0x00000000, // 032 'SPC' - 0xFFFFFFFF, // 033 - 0xFFFFFFFF, // 034 - 0xFFFFFFFF, // 035 - 0xFFFFFFFF, // 036 - 0xFFFFFFFF, // 037 - 0xFFFFFFFF, // 038 - 0xFFFFFFFF, // 039 - 0xFFFFFFFF, // 040 - 0xFFFFFFFF, // 041 - 0xFFFFFFFF, // 042 - 0xFFFFFFFF, // 043 - 0xFFFFFFFF, // 044 - 0xFFFFFFFF, // 045 - 0xFFFFFFFF, // 046 - 0xFFFFFFFF, // 047 - (ALL &~ MIDDLE), // 048 '0' - (RIGHT), // 049 '1' - (ALL &~ TLEFT &~ BRIGHT), // 050 '2' - (ALL &~ LEFT), // 051 '3' - (TLEFT | MIDDLE | RIGHT), // 052 '4' - (ALL &~ TRIGHT &~ BLEFT), // 053 '5' - (ALL &~ TRIGHT), // 054 '6' - (TOP | RIGHT), // 055 '7' - (ALL), // 056 '8' - (ALL &~ BOTTOM &~ BLEFT), // 057 '9' - 0xFFFFFFFF, // 058 - 0xFFFFFFFF, // 059 - 0xFFFFFFFF, // 060 - 0XFFFFFFFF, // 061 - 0xFFFFFFFF, // 062 - 0xFFFFFFFF, // 063 - 0xFFFFFFFF, // 064 - (ALL &~ BOTTOM), // 065 'A' - (ALL), // 066 'B' - (TOP | LEFT | BOTTOM), // 067 'C' - (ALL &~ MIDDLE), // 068 'D' - (ALL &~ RIGHT), // 069 'E' - (LEFT | TOP | MIDDLE), // 070 'F' - 0x00000000, // 071 'G' - (ALL &~ TOP &~ BOTTOM), // 072 'H' - (RIGHT), // 073 'I' - (RIGHT | BOTTOM), // 074 'J' - 0x00000000, // 075 'K' - (LEFT | BOTTOM), // 076 'L' - 0x00000000, // 088 'M' - 0x00000000, // 089 'N' - (ALL &~ MIDDLE), // 090 'O' - (ALL &~ BRIGHT &~ BOTTOM),// 091 'P' - 0x00000000, // 092 'Q' - 0x00000000, // 093 'R' - (ALL &~ TRIGHT &~ BLEFT), // 094 'S' - 0X00000000, // 095 'T' - (LEFT | RIGHT | BOTTOM), // 096 'U' - 0x00000000, // 097 'V' - 0x00000000, // 098 'W' - 0x00000000, // 099 'X' - 0x00000000, // 1000 'Z' - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 100 - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 104 - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 108 - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 112 - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 116 - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 120 - 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF // 124 -}; - -#define CT 1.0f -#define CX 7.0f -#define CY 13.0f -#define CM ((CY-(CT*3.0f))/2.0f) - -float lCoords[][2] = -{ - /* Top outsides. */ - { 0, (CY-CT) }, - { CX, (CY-CT) }, - - /* Top Line. */ - { CT, CY }, - { CT, (CY-CT) }, - { (CX-CT), CY }, - { (CX-CT), (CY-CT) }, - - /* Middle outsides. */ - { 0.0f, (CT+CM+CT) }, - { 0.0f, (CT+CM) }, - { CX, (CT+CM+CT) }, - { CX, (CT+CM) }, - - /* Middle Line. */ - { CT, (CT+CM+CT) }, - { CT, (CT+CM) }, - { (CX-CT), (CT+CM+CT) }, - { (CX-CT), (CT+CM) }, - - /* Bottom line. */ - { CT, CT }, - { CT, 0.0f }, - { (CX-CT), CT }, - { (CX-CT), 0.0f }, - - /* Bottom outsides. */ - { 0.0f, CT}, - { CX, CT } -}; - -static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics ); - -D3DTLVERTEX TextVertices[MAX_VERTICES]; -/*===========================================================================*/ -/* When we attach I will zero out the whole D3D vertex buffer I'm using for */ -/* the text. This way I don't need to set all the redundant values. I also */ -/* set all the oow values to 1 as I will be doing direct rendering. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -extern "C" BOOL InitD3DText( void ) -{ - int index; - - /* Set the D3D Vertex Buffer up once so we don't do redundant changes. */ - memset( &TextVertices[0], 0, sizeof(TextVertices) ); - for( index = 0; index < MAX_VERTICES; index++ ) - TextVertices[index].rhw = D3DVAL( 1.0 ); - - return TRUE; -} -/*===========================================================================*/ -/* This function takes a single character and draw it using the supplied */ -/* fontmetrics structure. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics ) -{ - int cIndex, - nIndex, - index; - float cWidth = CX, - cHeight = CY; - - /* Find the max width/height of a character and add the spacing so */ - /* that we can use this value to calculate the x,y of the character.*/ - cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing; - cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing; - - /* Walk the string. This must be NULL terminated. */ - for( cIndex = 0, nIndex = 0; *pszString; pszString++, cIndex = nIndex, x++ ) - { - /* Convert the character and get the index into the text vertex buffer. */ - nIndex = ConvertCharacter( &pszString[0], cIndex, pfntMetrics ); - if ( (nIndex - cIndex) > 2 ) - { - /* Modify the text vertex buffer based on the fntMetrics structure. */ - for( index = cIndex; index < nIndex; index++ ) - { - /* Scale the character. */ - TextVertices[index].sx *= pfntMetrics->fntXScale; - TextVertices[index].sy *= pfntMetrics->fntYScale; - - /* Move the character. */ - TextVertices[index].sx += (cWidth*x); - TextVertices[index].sy += (cHeight*y); - - /* Set the color. */ - TextVertices[index].color = pfntMetrics->dwColor; - } - } - } - - if ( nIndex < 3 ) - return; - - /* Set the states that slim things down. */ - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE ); - - /* Blast them baby... */ - pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST, - D3DFVF_TLVERTEX, - (LPVOID)&TextVertices[0], - nIndex, - (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); -} -/*===========================================================================*/ -/* This function takes a single character and draw it directly to the screen*/ -/* unsing the supplied fntMetrics structure. The character will be drawn at */ -/* the supplied x,y. The x,y position is relative to the top left and uses */ -/* the spacing in the fntMetrics structure. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics ) -{ - int cIndex = 0, - index; - float cWidth = CX, - cHeight = CY; - - /* Convert the character and get the index into the text vertex buffer. */ - cIndex = ConvertCharacter( c, 0, pfntMetrics ); - if ( cIndex < 3 ) - return; - - /* Find the max width/height of a character and add the spacing so */ - /* that we can use this value to calculate the x,y of the character.*/ - cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing; - cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing; - - /* Modify the text vertex buffer based on the fntMetrics structure. */ - for( index = 0; index < cIndex; index++ ) - { - /* Scale the character. */ - TextVertices[index].sx *= pfntMetrics->fntXScale; - TextVertices[index].sy *= pfntMetrics->fntYScale; - - /* Move the character. */ - TextVertices[index].sx += (cWidth*x); - TextVertices[index].sy += (cHeight*y); - - /* Set the color. */ - TextVertices[index].color = pfntMetrics->dwColor; - } - - - /* Set the states that slim things down. */ - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE ); - pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE ); - - /* Blast them baby... */ - pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST, - D3DFVF_TLVERTEX, - (LPVOID)&TextVertices[0], - cIndex, - (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) ); -} -/*===========================================================================*/ -/* This function takes a single character and draw it using the supplied */ -/* fontmetrics structure. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics ) -{ - DWORD asciiChar = (int)(*c); - - /* Handle the TOP line. */ - if ( textBitMasks[asciiChar] & BIT1 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TR_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] ); - } - - /* Handle the TOP/BOTTOM RIGHT lines. */ - // if ( textBitMasks[index] & (BIT2|BIT3) ) - if ( 1 == 0 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TRR][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] ); - } - else - { - if ( textBitMasks[asciiChar] & BIT2 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[TRR][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] ); - } - if ( textBitMasks[asciiChar] & BIT3 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[BR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] ); - } - } - - /* Handle the TOP/BOTTOM LEFT lines. */ - // if ( textBitMasks[asciiChar] & (BIT5|BIT6) ) - if ( 1 == 0 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BLL][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] ); - } - else - { - if ( textBitMasks[asciiChar] & BIT5 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[BLL][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] ); - } - if ( textBitMasks[asciiChar] & BIT6 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[TL_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_0][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] ); - TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] ); - } - } - - /* Handle the MIDDLE line. */ - if ( textBitMasks[asciiChar] & BIT7 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] ); - } - - /* Handle the BOTTOM line. */ - if ( textBitMasks[asciiChar] & BIT4 ) - { - TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BL_1][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_1][1] ); - TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] ); - TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] ); - } - - return cIndex; -} - -#undef CM -#undef CY -#undef CX -#undef CT - -#undef TLL -#undef TRR -#undef TL_0 -#undef TL_1 -#undef TR_0 -#undef TR_1 - -#undef MLL_0 -#undef MLL_1 -#undef MRR_0 -#undef MRR_1 - -#undef ML_0 -#undef ML_1 -#undef MR_0 -#undef MR_1 - -#undef BL_0 -#undef BL_1 -#undef BR_0 -#undef BR_1 -#undef BLL -#undef BRR - -#undef BIT1 -#undef BIT2 -#undef BIT3 -#undef BIT4 -#undef BIT5 -#undef BIT6 -#undef BIT7 - -#undef TOP -#undef MIDDLE -#undef BOTTOM -#undef TLEFT -#undef BLEFT -#undef LEFT -#undef TRIGHT -#undef BRIGHT -#undef RIGHT -#undef ALL diff --git a/src/mesa/drivers/d3d/D3DTextureMgr.cpp b/src/mesa/drivers/d3d/D3DTextureMgr.cpp deleted file mode 100644 index a6600cab02..0000000000 --- a/src/mesa/drivers/d3d/D3DTextureMgr.cpp +++ /dev/null @@ -1,947 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "D3DHAL.h" -/*===========================================================================*/ -/* Local function prototypes. */ -/*===========================================================================*/ -static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels ); -static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj ); -static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ); -static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ); -HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext ); -/*===========================================================================*/ -/* This function will simply set the top of stack to NULL. I only used it */ -/* just incase I want to add something later. */ -/*===========================================================================*/ -/* RETURN: TRUE. */ -/*===========================================================================*/ -BOOL InitTMgrHAL( PMESAD3DHAL pHAL ) -{ - DPF(( DBG_FUNC, "InitTMgrHAL();" )); - - /* Be clean my friend. */ - pHAL->pTMList = NULL; - - return TRUE; -} -/*===========================================================================*/ -/* This function will walk the Texture Managers linked list and destroy all */ -/* surfaces (SYSTEM/VIDEO). The texture objects themselves also will be */ -/* freed. */ -/* NOTE: this is per/context. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void TermTMgrHAL( PMESAD3DHAL pHAL ) -{ - DPF(( DBG_FUNC, "TermTMgrHAL();" )); - - if ( pHAL && pHAL->pTMList ) - { - /* Destroy the surface and remove the TMO from the stack. */ - while( DestroyTextureObject(pHAL,NULL) ); - - /* Be clean my friend. */ - pHAL->pTMList = NULL; - } -} -/*===========================================================================*/ -/* This function is a HACK as I don't know how I can disable a texture with-*/ -/* out booting it out. Is there know state change? */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void DisableTMgrHAL( PMESAD3DSHARED pShared ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - - DPF(( DBG_FUNC, "DisableTMgrHAL();" )); - - /* Check too see that we have a valid context. */ - if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) ) - { - DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" )); - return; - } - - // TODO: This is a hack to shut off textures. - pHAL->lpD3DDevice->SetTexture( 0, NULL ); -} -/*===========================================================================*/ -/* This function is the only entry into the TextureManager that Mesa/wgl */ -/* will see. It uses a dwAction to specify what we are doing. I did this as*/ -/* depending on the cards resources the action taken can change. */ -/* When this function is called we will always search the Texture Managers */ -/* linked list (per context remember) and try and find a structure that has */ -/* the same dwName. If we have a match we pull it out of the list and put it*/ -/* at the top of the list (TOL). If we don't find one then we create a struc*/ -/* and put it a TOL. This TOL idea makes for some caching as we will always */ -/* destroy Texture Surfaces from the bottom up... */ -/* All texture objects at this point will create a texture surface in System*/ -/* memory (SMEM). Then we will copy the Mesa texture into the surface using */ -/* the 'pixel' struc to get the translation info. So now this means that all*/ -/* textures that Mesa gives me I will have a Surface with a copy. If Mesa */ -/* changes the texture the I update the surface in (SMEM). */ -/* Now we have a texture struc and a Texture Surface in SMEM. At this point*/ -/* we create another surface on the card (VMEM). Finally we blt from the */ -/* SMEM to the VMEM and set the texture as current. Why do I need two? First*/ -/* this solves square textures. If the cards CAPS is square textures only */ -/* then I change the dimensions of the VMEM surface and the blt solves it for*/ -/* me. Second it saves me from filling D3D textures over and over if the */ -/* card needs to be creating and destroying surfaces because of low memory. */ -/* The surface in SMEM is expected to work always. When a surface has to be*/ -/* created in VMEM then we put it in a loop that tries to create the surface.*/ -/* If we create the surface ok then we brake from the loop. If we fail then */ -/* we will call 'FreeTextureMemory' that will return TRUE/FALSE as to whether*/ -/* memory was freed. If memory was freed then we can try again. If no memory*/ -/* was freed then it just can't fit. */ -/* 'FreeTextureMemory' will find the end of the list and start freeing VMEM */ -/* (never SMEM) surfaces that are not locked. */ -/* BIND - when we bind and there is a texture struct with a texture surface */ -/* in VMEM then we just make it current. If we have a struct and a surface */ -/* in SMEM but no VMEM surface then we create the surface in VMEM and blt */ -/* from the SMEM surface. If we have nothing its just like a creation... */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -extern "C" BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags, - RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - PTM_OBJECT pTMObj, - pTemp; - DDSURFACEDESC2 ddsd2; - HRESULT rc; - - - DPF(( DBG_FUNC, "CreateTMgrHAL();" )); - - DPF(( DBG_TXT_INFO, "Texture:" )); - DPF(( DBG_TXT_INFO, "cx: %d cy: %d", dwWidth, dwHeight )); - DPF(( DBG_TXT_INFO, "Rect:" )); - if ( rectDirty ) - { - DPF(( DBG_TXT_INFO, "x0: %d y0: %d", rectDirty->left, rectDirty->top )); - DPF(( DBG_TXT_INFO, "x1: %d y1: %d", rectDirty->right, rectDirty->bottom )); - } - - /* Check too see that we have a valid context. */ - if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) ) - { - DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" )); - return FALSE; - } - - /*=================================================*/ - /* See if we can find this texture object by name. */ - /*=================================================*/ - for( pTMObj = pHAL->pTMList; pTMObj && (pTMObj->dwName != dwName); pTMObj = pTMObj->next ); - - /*=========================================================*/ - /* Allocate a new object if we didn't get a matching name. */ - /*=========================================================*/ - if ( pTMObj == NULL ) - { - pTMObj = (PTM_OBJECT)ALLOC( sizeof(TM_OBJECT) ); - if ( pTMObj == NULL ) - return FALSE; - memset( pTMObj, 0, sizeof(TM_OBJECT) ); - - /* Put the object at the beginning of the list. */ - pTMObj->next = pHAL->pTMList; - if ( pTMObj->next ) - { - pTemp = pTMObj->next; - pTemp->prev = pTMObj; - } - pHAL->pTMList = pTMObj; - } - else - { - /*===============================================================*/ - /* Make some caching happen by pulling this object to the front. */ - /*===============================================================*/ - if ( pHAL->pTMList != pTMObj ) - { - /* Pull the object out of the list. */ - if ( pTMObj->prev ) - { - pTemp = pTMObj->prev; - pTemp->next = pTMObj->next; - } - if ( pTMObj->next ) - { - pTemp = pTMObj->next; - pTemp->prev = pTMObj->prev; - } - - pTMObj->prev = NULL; - pTMObj->next = NULL; - - /* Put the object at the front of the list. */ - pTMObj->next = pHAL->pTMList; - if ( pTMObj->next ) - { - pTemp = pTMObj->next; - pTemp->prev = pTMObj; - } - pHAL->pTMList = pTMObj; - } - } - - /*========================================================*/ - /* If we are doing BIND and the texture is in VID memory. */ - /*========================================================*/ - if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_Video ) - { - DPF(( DBG_TXT_PROFILE, "Cache HIT (%d)", dwName )); - - /* Make this the current texture. */ - rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); - if ( FAILED(rc) ) - { - DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); - pHAL->lpD3DDevice->SetTexture( 0, NULL ); - return FALSE; - } - - return TRUE; - } - - /*=================================================================*/ - /* If we are doing BIND and the texture is at least in SYS memory. */ - /*=================================================================*/ - if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_System ) - { - DPF(( DBG_TXT_PROFILE, "Cache MISS (%d)", dwName )); - - /* Create the texture on the card. */ - rc = LoadTextureInVideo( pHAL, pTMObj ); - if ( rc == FALSE ) - return FALSE; - - /* Make this the current texture. */ - rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); - if ( FAILED(rc) ) - { - DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); - pHAL->lpD3DDevice->SetTexture( 0, NULL ); - return FALSE; - } - - return TRUE; - } - - /*=========================================================*/ - /* If we are doing UPDATE then try in VID first for speed. */ - /*=========================================================*/ - if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_Video && - !(pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) ) - { - DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" )); - - /* Update the texture on the card. */ - UpdateTexture( pTMObj, TRUE, rectDirty, (UCHAR *)pPixels ); - - /* We updated the texture in VID so kill the SYS so we know its dirty. */ - if ( pTMObj->lpDDS_System ) - { - DPF(( DBG_TXT_INFO, "Release texture (SYS)" )); - DX_RESTORE( pTMObj->lpDDS_System ); - pTMObj->lpDDS_System->Release(); - pTMObj->lpDDS_System = NULL; - } - - /* Make this the current texture. */ - rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); - if ( FAILED(rc) ) - { - DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); - pHAL->lpD3DDevice->SetTexture( 0, NULL ); - return FALSE; - } - - return TRUE; - } - - /*===========================================================*/ - /* If we are doing UPDATE then try in SYS still gives speed. */ - /*===========================================================*/ - if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_System ) - { - DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" )); - - /* Update the texture in SYS. */ - UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels ); - - /* We updated the SYS texture only so now blt to the VID. */ - rc = LoadTextureInVideo( pHAL, pTMObj ); - if ( rc == FALSE ) - return FALSE; - - /* Make this the current texture. */ - rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); - if ( FAILED(rc) ) - { - DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); - pHAL->lpD3DDevice->SetTexture( 0, NULL ); - return FALSE; - } - - return TRUE; - } - - /* At this point we have a valid Texture Manager Object with updated */ - /* links. We now need to create or update a texture surface that is */ - /* in system memory. Every texture has a copy in system so we can use*/ - /* blt to solve problems with textures allocated on the card (square */ - /* only textures, pixelformats...). */ - - // TODO: make support for update also. Dirty rectangle basicly... - - /* Kill the interface if we have one no matter what. */ - if ( pTMObj->lpD3DTexture2 ) - { - DPF(( DBG_TXT_INFO, "Release Texture2" )); - pTMObj->lpD3DTexture2->Release(); - pTMObj->lpD3DTexture2 = NULL; - } - - /* Kill the system surface. TODO: should try to get the SubIMage going again */ - if ( pTMObj->lpDDS_System ) - { - DPF(( DBG_TXT_INFO, "Release texture (SYS)" )); - DX_RESTORE( pTMObj->lpDDS_System ); - pTMObj->lpDDS_System->Release(); - pTMObj->lpDDS_System = NULL; - } - - /* Kill the Video surface. TODO: need some reuse system... */ - if ( pTMObj->lpDDS_Video ) - { - DPF(( DBG_TXT_INFO, "Release texture (VID)" )); - DX_RESTORE( pTMObj->lpDDS_Video ); - pTMObj->lpDDS_Video->Release(); - pTMObj->lpDDS_Video = NULL; - } - - /*================================================================*/ - /* Translate the the Mesa/OpenGL pixel channels to the D3D flags. */ - /*================================================================*/ - switch( dwRequestFlags ) - { - case GL_ALPHA: - dwRequestFlags = DDPF_ALPHA; - DPF(( DBG_TXT_WARN, "GL_ALPHA not supported!)" )); - return FALSE; - - case GL_INTENSITY: - case GL_LUMINANCE: - DPF(( DBG_TXT_WARN, "GL_INTENSITY/GL_LUMINANCE not supported!)" )); - dwRequestFlags = DDPF_LUMINANCE; - return FALSE; - - case GL_LUMINANCE_ALPHA: - DPF(( DBG_TXT_WARN, "GL_LUMINANCE_ALPHA not supported!)" )); - dwRequestFlags = DDPF_LUMINANCE | DDPF_ALPHAPIXELS; - return FALSE; - - case GL_RGB: - DPF(( DBG_TXT_INFO, "Texture -> GL_RGB" )); - dwRequestFlags = DDPF_RGB; - break; - - case GL_RGBA: - DPF(( DBG_TXT_INFO, "Texture -> GL_RGBA" )); - dwRequestFlags = DDPF_RGB | DDPF_ALPHAPIXELS; - break; - } - - /*==============================*/ - /* Populate the texture object. */ - /*==============================*/ - pTMObj->dwName = dwName; - pTMObj->lpD3DDevice = pHAL->lpD3DDevice; - pTMObj->dwFlags = dwRequestFlags; - if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY ) - { - DPF(( DBG_TXT_INFO, "Convert to Square..." )); - pTMObj->dwSHeight = dwHeight; - pTMObj->dwSWidth = dwWidth; - - /* Shrink non-square textures. */ - pTMObj->dwVHeight = (dwHeight > dwWidth) ? dwWidth : dwHeight; - pTMObj->dwVWidth = (dwHeight > dwWidth) ? dwWidth : dwHeight; - } - else - { - pTMObj->dwSHeight = dwHeight; - pTMObj->dwSWidth = dwWidth; - pTMObj->dwVHeight = dwHeight; - pTMObj->dwVWidth = dwWidth; - } - - /*========================*/ - /* Create SYSTEM surface. */ - /*========================*/ - - /* Request a surface in system memory. */ - memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); - ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); - ddsd2.dwWidth = pTMObj->dwSWidth; - ddsd2.dwHeight = pTMObj->dwSHeight; - ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; - ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY; - ddsd2.ddsCaps.dwCaps2 = 0L; - memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) ); - ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); - ddsd2.ddpfPixelFormat.dwFlags = dwRequestFlags; - rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat ); - if ( FAILED(rc) ) - { - RIP( pHAL, "EnumerTextureFormats (SYSTEM)->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Create the surface using the enumerated pixelformat. */ - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_System, NULL ); - if ( FAILED(rc) ) - { - RIP( pHAL, "CreateSurface (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Solve the pixel mapping info using the surface pixelformat. */ - Solve8BitChannelPixelFormat( &ddsd2.ddpfPixelFormat, &pTMObj->pixel ); - - /*===================================================================*/ - /* Fill the texture using the PixelInfo structure to do the mapping. */ - /*===================================================================*/ - UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels ); - - /*=======================*/ - /* Create VIDEO surface. */ - /*=======================*/ - rc = LoadTextureInVideo( pHAL, pTMObj ); - if ( rc == FALSE ) - return FALSE; - - /* Make this the current texture. */ - rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 ); - if ( FAILED(rc) ) - { - DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) )); - pHAL->lpD3DDevice->SetTexture( 0, NULL ); - return FALSE; - } - - return TRUE; -} -/*===========================================================================*/ -/* This function will handle the creation and destruction of the texture */ -/* surfaces on the card. Using the dw'V'Width/Height dimensions the call */ -/* try and create the texture on the card and keep using FreeTextureMemory */ -/* until the surace can be created. Once the surface is created we get the */ -/* interface that we will use to make it the current texture. I didn't put */ -/* the code to make the texture current in this function as BIND needs to */ -/* use the same code and this function doesn't always get called when we do a*/ -/* bind. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj ) -{ - DDSURFACEDESC2 ddsd2; - HRESULT rc; - - DPF(( DBG_FUNC, "LoadTextureInVideo();" )); - - /* Kill the interface if we have one no matter what. */ - if ( pTMObj->lpD3DTexture2 ) - { - DPF(( DBG_TXT_INFO, "Release Texture2" )); - pTMObj->lpD3DTexture2->Release(); - pTMObj->lpD3DTexture2 = NULL; - } - - /* Kill the Video surface. TODO: need some reuse system... */ - if ( pTMObj->lpDDS_Video ) - { - DPF(( DBG_TXT_INFO, "Release texture (VID)" )); - DX_RESTORE( pTMObj->lpDDS_Video ); - pTMObj->lpDDS_Video->Release(); - pTMObj->lpDDS_Video = NULL; - } - - /* Request a surface in Video memory. */ - memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); - ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); - ddsd2.dwWidth = pTMObj->dwVWidth; - ddsd2.dwHeight = pTMObj->dwVHeight; - ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT; - ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY; - ddsd2.ddsCaps.dwCaps2 = 0L; - memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) ); - ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT ); - ddsd2.ddpfPixelFormat.dwFlags = pTMObj->dwFlags; - rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat ); - if ( FAILED(rc) ) - { - RIP( pHAL, "EnumerTextureFormats ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Make sure we lock so we don't nuke this texture trying to free memory for it. */ - pTMObj->bLock = TRUE; - - /* Start a loop that will free all textures until we have created the texture */ - /* surface or we can't free up more memory. */ - do - { - /* Try to create the texture surface. */ - rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_Video, NULL ); - if ( !FAILED(rc) ) - break; - - DPF(( DBG_TXT_INFO, "Free Texture Memory" )); - - /* DestroyTexture will return TRUE if a surface was freed. */ - } while( FreeTextureMemory(pHAL,NULL) ); - - /* Make sure we unlock or we won't be able to nuke the TMO later. */ - pTMObj->bLock = FALSE; - - /* Did we create a valid texture surface? */ - if ( FAILED(rc) ) - { - DPF(( DBG_TXT_WARN, "Failed to load texture" )); - pHAL->lpD3DDevice->SetTexture( 0, NULL ); - return FALSE; - } - - DX_RESTORE( pTMObj->lpDDS_System ); - DX_RESTORE( pTMObj->lpDDS_Video ); - - DPF(( DBG_TXT_INFO, "Texture Blt SYSTEM -> VID" )); - - /* Now blt the texture in system memory to the card. */ - rc = pTMObj->lpDDS_Video->Blt( NULL, pTMObj->lpDDS_System, NULL, DDBLT_WAIT, NULL ); - if ( FAILED(rc) ) - { - RIP( pHAL, "Blt (TEXTURE) ->", ErrorStringD3D(rc) ); - return FALSE; - } - - /* Get the Texture interface that is used to render with. */ - pTMObj->lpDDS_Video->QueryInterface( IID_IDirect3DTexture2, (void **)&pTMObj->lpD3DTexture2 ); - if ( pTMObj->lpD3DTexture2 == NULL ) - { - DPF(( DBG_TXT_WARN, "Failed QueryTextureInterface" )); - pHAL->lpD3DDevice->SetTexture( 0, NULL ); - return FALSE; - } - - return TRUE; -} -/*===========================================================================*/ -/* If this function gets a texture object struc then we will try and free */ -/* it. If we get a NULL then we will search from the bottom up and free one */ -/* VMEM surface. I can only free when the surface isn't locked and of course*/ -/* there must be a VMEM surface. We never free SMEM surfaces as that isn't */ -/* the point. */ -/* TODO: should have a pointer to the bottom of the stack really. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ) -{ - PTM_OBJECT pCurrent; - BOOL bFreed = FALSE; - - DPF(( DBG_FUNC, "FreeTextureMemory();" )); - DPF(( DBG_TXT_WARN, "FREE TEXTURE!" )); - - /* Just to be safe. */ - if ( !pHAL || !pHAL->pTMList ) - { - DPF(( DBG_TXT_WARN, "FreeTextureMemory() -> NULL pHAL/pHAL->pTMList" )); - return FALSE; - } - - /* Free the last texture in the list. */ - if ( pTMObject == NULL ) - { - DPF(( DBG_TXT_INFO, "Free Last texture in cache" )); - - /* Find the last texture object. */ - for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next ); - - /* Now backup until we find a texture on the card. */ - while( pCurrent && (pCurrent->lpDDS_Video == NULL) && (pCurrent->bLock == FALSE) ) - pCurrent = pCurrent->prev; - - /* Didn't find anything. */ - if ( pCurrent == NULL ) - { - DPF(( DBG_TXT_INFO, "No texture memory freed" )); - return FALSE; - } - } - else - { - /* See if we can find this texture object. */ - for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next ); - - /* Didn't find anything. */ - if ( pCurrent == NULL ) - { - DPF(( DBG_TXT_INFO, "Requested texture to be freed NOT FOUND" )); - return FALSE; - } - } - - /* Can't free this baby. */ - if ( pCurrent->bLock == TRUE ) - { - DPF(( DBG_TXT_WARN, "Requested texture LOCKED" )); - return FALSE; - } - - /* Free the texture memory. */ - if ( pCurrent->lpD3DTexture2 ) - { - DPF(( DBG_TXT_INFO, "Release Texture2" )); - pCurrent->lpD3DTexture2->Release(); - pCurrent->lpD3DTexture2 = NULL; - bFreed = TRUE; - } - if ( pCurrent->lpDDS_Video ) - { - DPF(( DBG_TXT_INFO, "Release texture (VID):" )); - DPF(( DBG_TXT_INFO, "dwName: %d", pCurrent->dwName )); - DPF(( DBG_TXT_INFO, "cx: %d, cy: %d", pCurrent->dwVWidth, pCurrent->dwVHeight )); - pCurrent->lpDDS_Video->Release(); - pCurrent->lpDDS_Video = NULL; - bFreed = TRUE; - } - - return bFreed; -} -/*===========================================================================*/ -/* This function searches the linked list of texture objects in the supplied*/ -/* D3Dwrapper structure. If it finds a match it will free it and pull it out*/ -/* of the linked list. The function works on the bases of a matching pointer*/ -/* to the object (not matching content). */ -/* If the function gets passed a NULL then we want to free the last texture */ -/* object in the list. Used in a loop to destory all. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject ) -{ - PTM_OBJECT pCurrent; - - DPF(( DBG_FUNC, "DestoryTextureObject();" )); - - /* Just to be safe. */ - if ( !pHAL || !pHAL->pTMList ) - { - DPF(( DBG_TXT_WARN, "DestroyTextureObject() -> NULL pHAL/pHAL->pTMList" )); - return FALSE; - } - - /* Free the last texture in the list. */ - if ( pTMObject == NULL ) - { - /* Find the last texture object. */ - for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next ); - } - else - { - /* See if we can find this texture object. */ - for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next ); - - /* Didn't find anything. */ - if ( pCurrent == NULL ) - { - DPF(( DBG_TXT_WARN, "No textures to be freed" )); - return FALSE; - } - } - - /* Can't free this baby. */ - if ( pCurrent->bLock == TRUE ) - { - DPF(( DBG_TXT_WARN, "Requested texture to be freed LOCKED" )); - return FALSE; - } - - /* Free the texture memory. */ - if ( pCurrent->lpD3DTexture2 ) - { - DPF(( DBG_TXT_INFO, "Release Texture2" )); - pCurrent->lpD3DTexture2->Release(); - pCurrent->lpD3DTexture2 = NULL; - } - if ( pCurrent->lpDDS_Video ) - { - DPF(( DBG_TXT_INFO, "Release texture (VID):" )); - pCurrent->lpDDS_Video->Release(); - pCurrent->lpDDS_Video = NULL; - } - if ( pCurrent->lpDDS_System ) - { - DPF(( DBG_TXT_INFO, "Release texture (SYS):" )); - pCurrent->lpDDS_System->Release(); - pCurrent->lpDDS_System = NULL; - } - - /* Pull this texture out of the list. */ - if ( pCurrent == pHAL->pTMList ) - pHAL->pTMList = NULL; - if ( pCurrent->prev ) - (pCurrent->prev)->next = pCurrent->next; - if ( pCurrent->next ) - (pCurrent->next)->prev = pCurrent->prev; - FREE( pCurrent ); - - return TRUE; -} -/*===========================================================================*/ -/* This function is the callback function that gets called when we are doing*/ -/* an enumeration of the texture formats supported by this device. The choice*/ -/* is made by checking to see if we have a match with the supplied D3D pixel-*/ -/* format. So the enumeration has to pass a desired D3D PF as the user var. */ -/*===========================================================================*/ -/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */ -/*===========================================================================*/ -static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels ) -{ - LPDIRECTDRAWSURFACE4 lpDDS; - DDSURFACEDESC2 ddsd2; - DWORD srcPitch, - dwHeight, - dwWidth, - dwCol, - dwColor; - UCHAR *pSrc, - *pSrcRow, - *pDest, - *pDestRow; - int rc; - - // TODO: Do I need to pass the h/w when its in the object! - DPF(( DBG_FUNC, "UpdateTexture();" )); - - /* Get the surface pointer we are looking for. */ - lpDDS = (bVideo) ? pTMObj->lpDDS_Video : pTMObj->lpDDS_System; - - /*===================================================================*/ - /* Fill the texture using the PixelInfo structure to do the mapping. */ - /*===================================================================*/ - - /* Get the surface pointer. */ - memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); - ddsd2.dwSize = sizeof(DDSURFACEDESC2); - rc = lpDDS->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL ); - if ( FAILED(rc) ) - { - RIP( NULL, "Lock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) ); - return; - } - - /* For now we are only updating the system surface so use its dimensions. */ - dwWidth = (bVideo) ? pTMObj->dwVWidth : pTMObj->dwSWidth; - dwHeight = (bVideo) ? pTMObj->dwVHeight : pTMObj->dwSHeight; - - /* If we are updating the whole surface then the pDest/pSrc will */ - /* always be the same. */ - if ( pRect == NULL ) - { - pDest = (UCHAR *)ddsd2.lpSurface; - pSrc = pixels; - } - - /* Fill the texture surface based on the pixelformat flags. */ - if ( pTMObj->dwFlags == (DDPF_RGB | DDPF_ALPHAPIXELS) ) - { - srcPitch = dwWidth * 4; - if ( pRect ) - { - pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); - pSrc = pixels + (pRect->top * dwWidth * 4) + (pRect->left * 4); - dwHeight = (pRect->bottom - pRect->top); - dwWidth = (pRect->right - pRect->left); - } - - for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) - { - for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) - { - dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); - dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift ); - dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift ); - if ( pTMObj->pixel.aScale == -1.0 ) - dwColor |= ( (*(pSrc+3) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 ); - else - dwColor |= ( ((DWORD)(*(pSrc+3) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift ); - memcpy( pDest, &dwColor, pTMObj->pixel.cb ); - pDest += pTMObj->pixel.cb; - pSrc += 4; - } - } - } - else if ( pTMObj->dwFlags == DDPF_RGB ) - { - srcPitch = dwWidth * 3; - if ( pRect ) - { - pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); - pSrc = pixels + (pRect->top * dwWidth * 3) + (pRect->left * 3); - dwHeight = (pRect->bottom - pRect->top); - dwWidth = (pRect->right - pRect->left); - } - - for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) - { - for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) - { - dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); - dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift ); - dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift ); - memcpy( pDest, &dwColor, pTMObj->pixel.cb ); - pDest += pTMObj->pixel.cb; - pSrc += 3; - } - } - } - else if ( pTMObj->dwFlags == (DDPF_LUMINANCE | DDPF_ALPHAPIXELS) ) - { - srcPitch = dwWidth * 2; - if ( pRect ) - { - pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); - pSrc = pixels + (pRect->top * dwWidth * 2) + (pRect->left * 2); - dwHeight = (pRect->bottom - pRect->top); - dwWidth = (pRect->right - pRect->left); - } - - for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) - { - for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) - { - dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); - if ( pTMObj->pixel.aScale == -1.0 ) - dwColor |= ( (*(pSrc+1) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 ); - else - dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift ); - memcpy( pDest, &dwColor, pTMObj->pixel.cb ); - pDest += pTMObj->pixel.cb; - pSrc += 2; - } - } - } - else if ( pTMObj->dwFlags == DDPF_LUMINANCE ) - { - srcPitch = dwWidth; - if ( pRect ) - { - pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); - pSrc = pixels + (pRect->top * dwWidth) + (pRect->left); - dwHeight = (pRect->bottom - pRect->top); - dwWidth = (pRect->right - pRect->left); - } - - for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) - { - for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) - { - dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift ); - memcpy( pDest, &dwColor, pTMObj->pixel.cb ); - pDest += pTMObj->pixel.cb; - pSrc++; - } - } - } - else if ( pTMObj->dwFlags == DDPF_ALPHAPIXELS ) - { - srcPitch = dwWidth; - if ( pRect ) - { - pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb); - pSrc = pixels + (pRect->top * dwWidth) + (pRect->left); - dwHeight = (pRect->bottom - pRect->top); - dwWidth = (pRect->right - pRect->left); - } - - for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch ) - { - for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ ) - { - if ( pTMObj->pixel.aScale == -1.0 ) - dwColor = ( (*pSrc & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 ); - else - dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift ); - memcpy( pDest, &dwColor, pTMObj->pixel.cb ); - pDest += pTMObj->pixel.cb; - pSrc++; - } - } - } - - /* Unlock the surface. */ - rc = lpDDS->Unlock( NULL ); - if ( FAILED(rc) ) - { - RIP( NULL, "Unlock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) ); - } -} -/*===========================================================================*/ -/* This function is the callback function that gets called when we are doing*/ -/* an enumeration of the texture formats supported by this device. The choice*/ -/* is made by checking to see if we have a match with the supplied D3D pixel-*/ -/* format. So the enumeration has to pass a desired D3D PF as the user var. */ -/*===========================================================================*/ -/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */ -/*===========================================================================*/ -HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext ) -{ - LPDDPIXELFORMAT lpDDPixFmtRequest = (LPDDPIXELFORMAT)lpContext; - PIXELINFO pixel; - - DPF(( DBG_FUNC, "EnumPFHook();" )); - - if ( lpDDPixFmt->dwFlags == lpDDPixFmtRequest->dwFlags ) - { - /* Are we looking for an alpha channel? */ - if ( lpDDPixFmtRequest->dwFlags & DDPF_ALPHAPIXELS ) - { - /* Try for something that has more then 1bits of Alpha. */ - Solve8BitChannelPixelFormat( lpDDPixFmt, &pixel ); - if ( pixel.aScale == -1.0 ) - { - /* Save this format no matter what as its a match of sorts. */ - memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) ); - return D3DENUMRET_OK; - } - } - - /* Save this format as its a good match. */ - memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) ); - - /* We are happy at this point so lets leave. */ - return D3DENUMRET_CANCEL; - } - - return D3DENUMRET_OK; -} - - diff --git a/src/mesa/drivers/d3d/D3DTextureMgr.h b/src/mesa/drivers/d3d/D3DTextureMgr.h deleted file mode 100644 index 8a64ceaaec..0000000000 --- a/src/mesa/drivers/d3d/D3DTextureMgr.h +++ /dev/null @@ -1,62 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#ifndef _TEXTURE_MGR_INC -#define _TEXTURE_MGR_INC - -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include -#include -#include -#include -#include -#include "GL/gl.h" -/*========================================================================*/ -/* Defines. */ -/*========================================================================*/ -/*========================================================================*/ -/* Type defines. */ -/*========================================================================*/ -typedef struct _local_texture_object -{ - DWORD dwName, - dwPriority, - dwFlags, - dwSWidth, - dwSHeight, - dwVWidth, - dwVHeight; - BOOL bLock, - bDirty; /* I only update VID on SubImage calls so the system */ - /* texture can get invalid. */ - - LPDIRECT3DDEVICE3 lpD3DDevice; /* If the device changes we must get new handles... */ - LPDIRECTDRAWSURFACE4 lpDDS_System, - lpDDS_Video; - LPDIRECT3DTEXTURE2 lpD3DTexture2; - - PIXELINFO pixel; - - struct _local_texture_object *next; - struct _local_texture_object *prev; - -} TM_OBJECT, *PTM_OBJECT; -/*========================================================================*/ -/* Function prototypes. */ -/*========================================================================*/ -void APIENTRY InitTMD3D( void *pVoid ); -void APIENTRY TermTMD3D( void *pVoid ); -/*========================================================================*/ -/* Global variables declaration. */ -/*========================================================================*/ - -#endif diff --git a/src/mesa/drivers/d3d/D3DUTILS.CPP b/src/mesa/drivers/d3d/D3DUTILS.CPP deleted file mode 100644 index 02664f96e4..0000000000 --- a/src/mesa/drivers/d3d/D3DUTILS.CPP +++ /dev/null @@ -1,638 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "D3DHAL.h" -/*===========================================================================*/ -/* Local only functions. */ -/*===========================================================================*/ -static int CountTrailingZeros( DWORD dwMask ); -/*===========================================================================*/ -/* This function is used to get the pointer to the surface and the pitch for*/ -/* the scanline rendering functions. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - static DDSURFACEDESC2 ddsd2; - HRESULT rc; - - DPF(( DBG_FUNC, "LockHAL();" )); - - /* Set the request structure up first. */ - memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); - ddsd2.dwSize = sizeof(DDSURFACEDESC2); - - /* Make sure we have enough info. */ - if ( pHAL ) - { - rc = pHAL->lpDDSRender->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL ); - if ( FAILED(rc) ) - { - RIP( pHAL, "Lock (RENDER) ->", ErrorStringD3D(rc) ); - } - } - - return &ddsd2; -} -/*===========================================================================*/ -/* This is just a simple wrapper. I probably don't need to do any error */ -/* checking as the Lock must have worked inorder to get here... */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - HRESULT rc; - - DPF(( DBG_FUNC, "UnlockHAL();" )); - - /* Make sure we have enough info. */ - if ( pHAL ) - { - rc = pHAL->lpDDSRender->Unlock( NULL ); - if ( FAILED(rc) ) - { - RIP( pHAL, "Unlock (RENDER) ->", ErrorStringD3D(rc) ); - } - } -} -/*===========================================================================*/ -/* This function will track the main/Primary window that will be used as the*/ -/* target for the Blt in SwapBuffers. As a side effect the call will check */ -/* to see if the primary surface is the same size and position as the screen.*/ -/* If they are the same size we will call it fullscreen... */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -extern "C" void UpdateScreenPosHAL( PMESAD3DSHARED pShared ) -{ - PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared; - POINT pt; - DWORD dwWidth, dwHeight; - - DPF(( DBG_FUNC, "UpdateScreenPosHAL();" )); - - /* Make sure we have enough info. */ - if ( pHAL != NULL ) - { - /* Update the windows screen position. */ - GetClientRect( pShared->hwnd, &pShared->rectW ); - pt.x = pt.y = 0; - ClientToScreen( pShared->hwnd, &pt ); - OffsetRect( &pShared->rectW, pt.x, pt.y); - - /* Compare the primary to the screen. */ - dwWidth = GetSystemMetrics( SM_CXSCREEN ); - dwHeight = GetSystemMetrics( SM_CYSCREEN ); - if ( (pShared->rectW.left > 0) || (pShared->rectW.top > 0) || - (pShared->rectW.right > dwWidth) || (pShared->rectW.bottom > dwHeight) ) - pShared->bWindow = TRUE; - else - pShared->bWindow = FALSE; - } -} -/*===========================================================================*/ -/* This function will fill in the pixel info structure defined in D3Dshared.*/ -/* Basicly it will take a DirectDraw pixelformat structure and make scaling */ -/* values that will convert from 8bit channels to whatever the supplied ddpf */ -/* uses. Also we will generate shift values that will be used to get move */ -/* each component of the pixel into place. */ -/* I have now added a special case for a 1bit alpha channel. If I find a 1b*/ -/* alpha then I will set the scale to -1.0 which should be unique. Later I */ -/* can check the alpha scale value too see if its -1.0 and thus handle it. I*/ -/* was finding that the case was not working tom my advantage so this is my */ -/* HACK for the day. As a TODO I should work on this... */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel ) -{ - DPF(( DBG_FUNC, "Solve8BitChannelPixelFromat();" )); - - memset( pPixel, 0, sizeof(PPIXELINFO) ); - - /* Check too see if the color space is valid in the PF. */ - if ( pddpf->dwFlags & DDPF_RGB ) - { - /* Solve the red stuff. */ - pPixel->dwRMask = pddpf->dwRBitMask; - pPixel->rShift = CountTrailingZeros( pPixel->dwRMask ); - pPixel->rScale = (float)0.00392156 * (float)(pPixel->dwRMask >> pPixel->rShift); - - /* Solve the green thingy's. */ - pPixel->dwGMask = pddpf->dwGBitMask; - pPixel->gShift = CountTrailingZeros( pPixel->dwGMask ); - pPixel->gScale = (float)0.00392156 * (float)(pPixel->dwGMask >> pPixel->gShift); - - /* Solve the blues. */ - pPixel->dwBMask = pddpf->dwBBitMask; - pPixel->bShift = CountTrailingZeros( pddpf->dwBBitMask ); - pPixel->bScale = (float)0.00392156 * (float)(pddpf->dwBBitMask >> pPixel->bShift); - } - - /* Do the alpha channel if there is one. */ - if ( pddpf->dwFlags & DDPF_ALPHAPIXELS ) - { - pPixel->dwAMask = pddpf->dwRGBAlphaBitMask; - pPixel->aShift = CountTrailingZeros( pPixel->dwAMask ); - - /* Special case a 1bit alpha. */ - if ( (pPixel->dwAMask >> pPixel->aShift) == 1 ) - pPixel->aScale = -1.0; - else - pPixel->aScale = (float)0.00392156 * (float)(pPixel->dwAMask >> pPixel->aShift); - } - - /* Get the size of the pixel in bytes. Should work as dwRGBBitCount is in a union. */ - pPixel->cb = pddpf->dwRGBBitCount / 8; -} -/*===========================================================================*/ -/* See RETURN :) */ -/*===========================================================================*/ -/* RETURN: number of contiguous zeros starting from the right. */ -/*===========================================================================*/ -static int CountTrailingZeros( DWORD dwMask ) -{ - DWORD Mask; - - if ( dwMask == 0 ) - return 32; - - /* Can't take credit for this one! */ - Mask = dwMask & -(int)dwMask; - return ((Mask & 0xFFFF0000)!=0) << 4 - | ((Mask & 0xFF00FF00)!=0) << 3 - | ((Mask & 0xF0F0F0F0)!=0) << 2 - | ((Mask & 0xCCCCCCCC)!=0) << 1 - | ((Mask & 0xAAAAAAAA)!=0); -} -/*===========================================================================*/ -/* This function will convert the DDraw error code to its macro string. The*/ -/* returned pointer is static so you need not worry about memory managemnet */ -/* but the error message gets written over from call to call... */ -/*===========================================================================*/ -/* RETURN: pointer to the single static buffer that hold the error message. */ -/*===========================================================================*/ -char *ErrorStringD3D( HRESULT hr ) -{ - static char errorString[128]; - - switch( hr ) - { - case DDERR_ALREADYINITIALIZED: - strcpy( errorString, "DDERR_ALREADYINITIALIZED" ); - break; - - case DDERR_CANNOTATTACHSURFACE: - strcpy( errorString, "DDERR_CANNOTATTACHSURFACE" ); - break; - - case DDERR_CANNOTDETACHSURFACE: - strcpy( errorString, "DDERR_CANNOTDETACHSURFACE" ); - break; - - case DDERR_CURRENTLYNOTAVAIL: - strcpy( errorString, "DDERR_CURRENTLYNOTAVAIL" ); - break; - - case DDERR_EXCEPTION: - strcpy( errorString, "DDERR_EXCEPTION" ); - break; - - case DDERR_GENERIC: - strcpy( errorString, "DDERR_GENERIC" ); - break; - - case DDERR_HEIGHTALIGN: - strcpy( errorString, "DDERR_HEIGHTALIGN" ); - break; - - case DDERR_INCOMPATIBLEPRIMARY: - strcpy( errorString, "DDERR_INCOMPATIBLEPRIMARY" ); - break; - - case DDERR_INVALIDCAPS: - strcpy( errorString, "DDERR_INVALIDCAPS" ); - break; - - case DDERR_INVALIDCLIPLIST: - strcpy( errorString, "DDERR_INVALIDCLIPLIST" ); - break; - - case DDERR_INVALIDMODE: - strcpy( errorString, "DDERR_INVALIDMODE" ); - break; - - case DDERR_INVALIDOBJECT: - strcpy( errorString, "DDERR_INVALIDOBJECT" ); - break; - - case DDERR_INVALIDPARAMS: - strcpy( errorString, "DDERR_INVALIDPARAMS" ); - break; - - case DDERR_INVALIDPIXELFORMAT: - strcpy( errorString, "DDERR_INVALIDPIXELFORMAT" ); - break; - - case DDERR_INVALIDRECT: - strcpy( errorString, "DDERR_INVALIDRECT" ); - break; - - case DDERR_LOCKEDSURFACES: - strcpy( errorString, "DDERR_LOCKEDSURFACES" ); - break; - - case DDERR_NO3D: - strcpy( errorString, "DDERR_NO3D" ); - break; - - case DDERR_NOALPHAHW: - strcpy( errorString, "DDERR_NOALPHAHW" ); - break; - - case DDERR_NOCLIPLIST: - strcpy( errorString, "DDERR_NOCLIPLIST" ); - break; - - case DDERR_NOCOLORCONVHW: - strcpy( errorString, "DDERR_NOCOLORCONVHW" ); - break; - - case DDERR_NOCOOPERATIVELEVELSET: - strcpy( errorString, "DDERR_NOCOOPERATIVELEVELSET" ); - break; - - case DDERR_NOCOLORKEY: - strcpy( errorString, "DDERR_NOCOLORKEY" ); - break; - - case DDERR_NOCOLORKEYHW: - strcpy( errorString, "DDERR_NOCOLORKEYHW" ); - break; - - case DDERR_NODIRECTDRAWSUPPORT: - strcpy( errorString, "DDERR_NODIRECTDRAWSUPPORT" ); - break; - - case DDERR_NOEXCLUSIVEMODE: - strcpy( errorString, "DDERR_NOEXCLUSIVEMODE" ); - break; - - case DDERR_NOFLIPHW: - strcpy( errorString, "DDERR_NOFLIPHW" ); - break; - - case DDERR_NOGDI: - strcpy( errorString, "DDERR_NOGDI" ); - break; - - case DDERR_NOMIRRORHW: - strcpy( errorString, "DDERR_NOMIRRORHW" ); - break; - - case DDERR_NOTFOUND: - strcpy( errorString, "DDERR_NOTFOUND" ); - break; - - case DDERR_NOOVERLAYHW: - strcpy( errorString, "DDERR_NOOVERLAYHW" ); - break; - - case DDERR_OVERLAPPINGRECTS: - strcpy( errorString, "DDERR_OVERLAPPINGRECTS" ); - break; - - case DDERR_NORASTEROPHW: - strcpy( errorString, "DDERR_NORASTEROPHW" ); - break; - - case DDERR_NOROTATIONHW: - strcpy( errorString, "DDERR_NOROTATIONHW" ); - break; - - case DDERR_NOSTRETCHHW: - strcpy( errorString, "DDERR_NOSTRETCHHW" ); - break; - - case DDERR_NOT4BITCOLOR: - strcpy( errorString, "DDERR_NOT4BITCOLOR" ); - break; - - case DDERR_NOT4BITCOLORINDEX: - strcpy( errorString, "DDERR_NOT4BITCOLORINDEX" ); - break; - - case DDERR_NOT8BITCOLOR: - strcpy( errorString, "DDERR_NOT8BITCOLOR" ); - break; - - case DDERR_NOTEXTUREHW: - strcpy( errorString, "DDERR_NOTEXTUREHW" ); - break; - - case DDERR_NOVSYNCHW: - strcpy( errorString, "DDERR_NOVSYNCHW" ); - break; - - case DDERR_NOZBUFFERHW: - strcpy( errorString, "DDERR_NOZBUFFERHW" ); - break; - - case DDERR_NOZOVERLAYHW: - strcpy( errorString, "DDERR_NOZOVERLAYHW" ); - break; - - case DDERR_OUTOFCAPS: - strcpy( errorString, "DDERR_OUTOFCAPS" ); - break; - - case DDERR_OUTOFMEMORY: - strcpy( errorString, "DDERR_OUTOFMEMORY" ); - break; - - case DDERR_OUTOFVIDEOMEMORY: - strcpy( errorString, "DDERR_OUTOFVIDEOMEMORY" ); - break; - - case DDERR_OVERLAYCANTCLIP: - strcpy( errorString, "DDERR_OVERLAYCANTCLIP" ); - break; - - case DDERR_OVERLAYCOLORKEYONLYONEACTIVE: - strcpy( errorString, "DDERR_OVERLAYCOLORKEYONLYONEACTIVE" ); - break; - - case DDERR_PALETTEBUSY: - strcpy( errorString, "DDERR_PALETTEBUSY" ); - break; - - case DDERR_COLORKEYNOTSET: - strcpy( errorString, "DDERR_COLORKEYNOTSET" ); - break; - - case DDERR_SURFACEALREADYATTACHED: - strcpy( errorString, "DDERR_SURFACEALREADYATTACHED" ); - break; - - case DDERR_SURFACEALREADYDEPENDENT: - strcpy( errorString, "DDERR_SURFACEALREADYDEPENDENT" ); - break; - - case DDERR_SURFACEBUSY: - strcpy( errorString, "DDERR_SURFACEBUSY" ); - break; - - case DDERR_CANTLOCKSURFACE: - strcpy( errorString, "DDERR_CANTLOCKSURFACE" ); - break; - - case DDERR_SURFACEISOBSCURED: - strcpy( errorString, "DDERR_SURFACEISOBSCURED" ); - break; - - case DDERR_SURFACELOST: - strcpy( errorString, "DDERR_SURFACELOST" ); - break; - - case DDERR_SURFACENOTATTACHED: - strcpy( errorString, "DDERR_SURFACENOTATTACHED" ); - break; - - case DDERR_TOOBIGHEIGHT: - strcpy( errorString, "DDERR_TOOBIGHEIGHT" ); - break; - - case DDERR_TOOBIGSIZE: - strcpy( errorString, "DDERR_TOOBIGSIZE" ); - break; - - case DDERR_TOOBIGWIDTH: - strcpy( errorString, "DDERR_TOOBIGWIDTH" ); - break; - - case DDERR_UNSUPPORTED: - strcpy( errorString, "DDERR_UNSUPPORTED" ); - break; - - case DDERR_UNSUPPORTEDFORMAT: - strcpy( errorString, "DDERR_UNSUPPORTEDFORMAT" ); - break; - - case DDERR_UNSUPPORTEDMASK: - strcpy( errorString, "DDERR_UNSUPPORTEDMASK" ); - break; - - case DDERR_INVALIDSTREAM: - strcpy( errorString, "DDERR_INVALIDSTREAM" ); - break; - - case DDERR_VERTICALBLANKINPROGRESS: - strcpy( errorString, "DDERR_VERTICALBLANKINPROGRESS" ); - break; - - case DDERR_WASSTILLDRAWING: - strcpy( errorString, "DDERR_WASSTILLDRAWING" ); - break; - - case DDERR_XALIGN: - strcpy( errorString, "DDERR_XALIGN" ); - break; - - case DDERR_INVALIDDIRECTDRAWGUID: - strcpy( errorString, "DDERR_INVALIDDIRECTDRAWGUID" ); - break; - - case DDERR_DIRECTDRAWALREADYCREATED: - strcpy( errorString, "DDERR_DIRECTDRAWALREADYCREATED" ); - break; - - case DDERR_NODIRECTDRAWHW: - strcpy( errorString, "DDERR_NODIRECTDRAWHW" ); - break; - - case DDERR_PRIMARYSURFACEALREADYEXISTS: - strcpy( errorString, "DDERR_PRIMARYSURFACEALREADYEXISTS" ); - break; - - case DDERR_NOEMULATION: - strcpy( errorString, "DDERR_NOEMULATION" ); - break; - - case DDERR_REGIONTOOSMALL: - strcpy( errorString, "DDERR_REGIONTOOSMALL" ); - break; - - case DDERR_CLIPPERISUSINGHWND: - strcpy( errorString, "DDERR_CLIPPERISUSINGHWND" ); - break; - - case DDERR_NOCLIPPERATTACHED: - strcpy( errorString, "DDERR_NOCLIPPERATTACHED" ); - break; - - case DDERR_NOHWND: - strcpy( errorString, "DDERR_NOHWND" ); - break; - - case DDERR_HWNDSUBCLASSED: - strcpy( errorString, "DDERR_HWNDSUBCLASSED" ); - break; - - case DDERR_HWNDALREADYSET: - strcpy( errorString, "DDERR_HWNDALREADYSET" ); - break; - - case DDERR_NOPALETTEATTACHED: - strcpy( errorString, "DDERR_NOPALETTEATTACHED" ); - break; - - case DDERR_NOPALETTEHW: - strcpy( errorString, "DDERR_NOPALETTEHW" ); - break; - - case DDERR_BLTFASTCANTCLIP: - strcpy( errorString, "DDERR_BLTFASTCANTCLIP" ); - break; - - case DDERR_NOBLTHW: - strcpy( errorString, "DDERR_NOBLTHW" ); - break; - - case DDERR_NODDROPSHW: - strcpy( errorString, "DDERR_NODDROPSHW" ); - break; - - case DDERR_OVERLAYNOTVISIBLE: - strcpy( errorString, "DDERR_OVERLAYNOTVISIBLE" ); - break; - - case DDERR_NOOVERLAYDEST: - strcpy( errorString, "DDERR_NOOVERLAYDEST" ); - break; - - case DDERR_INVALIDPOSITION: - strcpy( errorString, "DDERR_INVALIDPOSITION" ); - break; - - case DDERR_NOTAOVERLAYSURFACE: - strcpy( errorString, "DDERR_NOTAOVERLAYSURFACE" ); - break; - - case DDERR_EXCLUSIVEMODEALREADYSET: - strcpy( errorString, "DDERR_EXCLUSIVEMODEALREADYSET" ); - break; - - case DDERR_NOTFLIPPABLE: - strcpy( errorString, "DDERR_NOTFLIPPABLE" ); - break; - - case DDERR_CANTDUPLICATE: - strcpy( errorString, "DDERR_CANTDUPLICATE" ); - break; - - case DDERR_NOTLOCKED: - strcpy( errorString, "DDERR_NOTLOCKED" ); - break; - - case DDERR_CANTCREATEDC: - strcpy( errorString, "DDERR_CANTCREATEDC" ); - break; - - case DDERR_NODC: - strcpy( errorString, "DDERR_NODC" ); - break; - - case DDERR_WRONGMODE: - strcpy( errorString, "DDERR_WRONGMODE" ); - break; - - case DDERR_IMPLICITLYCREATED: - strcpy( errorString, "DDERR_IMPLICITLYCREATED" ); - break; - - case DDERR_NOTPALETTIZED: - strcpy( errorString, "DDERR_NOTPALETTIZED" ); - break; - - case DDERR_UNSUPPORTEDMODE: - strcpy( errorString, "DDERR_UNSUPPORTEDMODE" ); - break; - - case DDERR_NOMIPMAPHW: - strcpy( errorString, "DDERR_NOMIPMAPHW" ); - break; - - case DDERR_INVALIDSURFACETYPE: - strcpy( errorString, "DDERR_INVALIDSURFACETYPE" ); - break; - - case DDERR_NOOPTIMIZEHW: - strcpy( errorString, "DDERR_NOOPTIMIZEHW" ); - break; - - case DDERR_NOTLOADED: - strcpy( errorString, "DDERR_NOTLOADED" ); - break; - - case DDERR_NOFOCUSWINDOW: - strcpy( errorString, "DDERR_NOFOCUSWINDOW" ); - break; - - case DDERR_DCALREADYCREATED: - strcpy( errorString, "DDERR_DCALREADYCREATED" ); - break; - - case DDERR_NONONLOCALVIDMEM: - strcpy( errorString, "DDERR_NONONLOCALVIDMEM" ); - break; - - case DDERR_CANTPAGELOCK: - strcpy( errorString, "DDERR_CANTPAGELOCK" ); - break; - - case DDERR_CANTPAGEUNLOCK: - strcpy( errorString, "DDERR_CANTPAGEUNLOCK" ); - break; - - case DDERR_NOTPAGELOCKED: - strcpy( errorString, "DDERR_NOTPAGELOCKED" ); - break; - - case DDERR_MOREDATA: - strcpy( errorString, "DDERR_MOREDATA" ); - break; - - case DDERR_EXPIRED: - strcpy( errorString, "DDERR_EXPIRED" ); - break; - - case DDERR_VIDEONOTACTIVE: - strcpy( errorString, "DDERR_VIDEONOTACTIVE" ); - break; - - case DDERR_DEVICEDOESNTOWNSURFACE: - strcpy( errorString, "DDERR_DEVICEDOESNTOWNSURFACE" ); - break; - - case DDERR_NOTINITIALIZED: - strcpy( errorString, "DDERR_NOTINITIALIZED" ); - break; - - default: - strcpy( errorString, "" ); - break; - } - - return &errorString[0]; -} diff --git a/src/mesa/drivers/d3d/D3Dvbrender.c b/src/mesa/drivers/d3d/D3Dvbrender.c deleted file mode 100644 index 09857f1dc8..0000000000 --- a/src/mesa/drivers/d3d/D3Dvbrender.c +++ /dev/null @@ -1,2149 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include -#include "clip.h" -#include "context.h" -#include "light.h" -#include "lines.h" -#include "macros.h" -#include "matrix.h" -#include "pb.h" -#include "points.h" -#include "mtypes.h" -#include "vb.h" -#include "vbrender.h" -#include "xform.h" -#include "D3DMesa.h" - -static void SetRenderStates( GLcontext *ctx ); -static void DebugRenderStates( GLcontext *ctx, BOOL bForce ); - -static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end ); -static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end ); -static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end ); -static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end ); -static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end ); -static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv ); -void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ); -void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); - -/* I went with a D3D vertex buffer that is 6 times that of the Mesa one */ -/* instead of having the D3D one flush when its full. This way Mesa will*/ -/* handle all the flushing. I need x6 as points can use 4 vertex each. */ -D3DTLVERTEX D3DTLVertices[ (VB_MAX*6) ]; -GLuint VList[VB_SIZE]; -/*===========================================================================*/ -/* Compute Z offsets for a polygon with plane defined by (A,B,C,D) */ -/* D is not needed. TODO: Currently we are calculating this but not using it.*/ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void OffsetPolygon( GLcontext *ctx, GLfloat a, GLfloat b, GLfloat c ) -{ - GLfloat ac, - bc, - m, - offset; - - DPF(( DBG_FUNC, "OffsetPolygon();" )); - - if ( (c < 0.001F) && (c > - 0.001F) ) - { - /* Prevents underflow problems. */ - ctx->PointZoffset = 0.0F; - ctx->LineZoffset = 0.0F; - ctx->PolygonZoffset = 0.0F; - } - else - { - ac = a / c; - bc = b / c; - if ( ac < 0.0F ) - ac = -ac; - if ( bc<0.0F ) - bc = -bc; - m = MAX2( ac, bc ); /* m = sqrt( ac*ac + bc*bc ); */ - - offset = (m * ctx->Polygon.OffsetFactor + ctx->Polygon.OffsetUnits); - ctx->PointZoffset = ctx->Polygon.OffsetPoint ? offset : 0.0F; - ctx->LineZoffset = ctx->Polygon.OffsetLine ? offset : 0.0F; - ctx->PolygonZoffset = ctx->Polygon.OffsetFill ? offset : 0.0F; - } - - DPF(( DBG_PRIM_INFO, "OffsetPolygon: %f", offset )); -} -/*===========================================================================*/ -/* Compute signed area of the n-sided polgyon specified by vertices */ -/* vb->Win[] and vertex list vlist[]. */ -/* A clockwise polygon will return a negative area. A counter-clockwise */ -/* polygon will return a positive area. I have changed this function to */ -/* actually calculate twice the area as its faster and still gives the sign. */ -/*===========================================================================*/ -/* RETURN: signed area of the polgon. */ -/*===========================================================================*/ -static GLfloat PolygonArea( const struct vertex_buffer *vb, GLuint n, const GLuint vlist[] ) -{ - GLfloat area; - GLuint i; - - DPF(( DBG_FUNC, "PolygonArea();" )); - -#define j0 vlist[i] -#define j1 vlist[(i+1)%n] -#define x0 vb->Win[j0][0] -#define y0 vb->Win[j0][1] -#define x1 vb->Win[j1][0] -#define y1 vb->Win[j1][1] - - /* area = sum of trapezoids */ - for( i = 0, area = 0.0; i < n; i++ ) - area += ((x0 - x1) * (y0 + y1)); /* Note: no divide by two here! */ - -#undef x0 -#undef y0 -#undef x1 -#undef y1 -#undef j1 -#undef j0 - - // TODO: I don't see the point or * 0.5 as we just want the sign... - return area; -} -/*===========================================================================*/ -/* Render a polygon that needs clipping on at least one vertex. The function*/ -/* will first clip the polygon to any user clipping planes then clip to the */ -/* viewing volume. The final polygon will be draw as single triangles that */ -/* first need minor proccessing (culling, offset, etc) before we draw the */ -/* polygon as a fan. NOTE: the fan is draw as single triangles as its not */ -/* formed sequentaly in the VB but is in the vlist[]. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void RenderClippedPolygon( GLcontext *ctx, GLuint n, GLuint vlist[] ) -{ - struct vertex_buffer *VB = ctx->VB; - GLfloat (*win)[3] = VB->Win, - *proj = ctx->ProjectionMatrix, - ex, ey, - fx, fy, c, - wInv; - GLuint index, - pv, - facing; - - DPF(( DBG_FUNC, "RenderClippedPolygon();" )); - - DPF(( DBG_PRIM_INFO, "RenderClippedtPolygon( %d )", n )); - - /* Which vertex dictates the color when flat shading. */ - pv = (ctx->Primitive==GL_POLYGON) ? vlist[0] : vlist[n-1]; - - /* Clipping may introduce new vertices. New vertices will be stored in */ - /* the vertex buffer arrays starting with location VB->Free. After we've*/ - /* rendered the polygon, these extra vertices can be overwritten. */ - VB->Free = VB_MAX; - - /* Clip against user clipping planes in eye coord space. */ - if ( ctx->Transform.AnyClip ) - { - n = gl_userclip_polygon( ctx, n, vlist ); - if ( n < 3 ) - return; - - /* Transform vertices from eye to clip coordinates: clip = Proj * eye */ - for( index = 0; index < n; index++ ) - { - TRANSFORM_POINT( VB->Clip[vlist[index]], proj, VB->Eye[vlist[index]] ); - } - } - - /* Clip against view volume in clip coord space */ - n = gl_viewclip_polygon( ctx, n, vlist ); - if ( n < 3 ) - return; - - /* Transform new vertices from clip to ndc to window coords. */ - /* ndc = clip / W window = viewport_mapping(ndc) */ - /* Note that window Z values are scaled to the range of integer */ - /* depth buffer values. */ - - /* Only need to compute window coords for new vertices */ - for( index = VB_MAX; index < VB->Free; index++ ) - { - if ( VB->Clip[index][3] != 0.0F ) - { - wInv = 1.0F / VB->Clip[index][3]; - - win[index][0] = VB->Clip[index][0] * wInv * ctx->Viewport.Sx + ctx->Viewport.Tx; - win[index][1] = VB->Clip[index][1] * wInv * ctx->Viewport.Sy + ctx->Viewport.Ty; - win[index][2] = VB->Clip[index][2] * wInv * ctx->Viewport.Sz + ctx->Viewport.Tz; - } - else - { - /* Can't divide by zero, so... */ - win[index][0] = win[index][1] = win[index][2] = 0.0F; - } - } - - /* Draw filled polygon as a triangle fan */ - for( index = 2; index < n; index++ ) - { - /* Compute orientation of triangle */ - ex = win[vlist[index-1]][0] - win[vlist[0]][0]; - ey = win[vlist[index-1]][1] - win[vlist[0]][1]; - fx = win[vlist[index]][0] - win[vlist[0]][0]; - fy = win[vlist[index]][1] - win[vlist[0]][1]; - c = (ex * fy) - (ey * fx); - - /* polygon is perpindicular to view plane, don't draw it */ - if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) - continue; - - /* Backface culling. */ - facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; - if ( (facing + 1) & ctx->Polygon.CullBits ) - continue; - - if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) - { - if ( facing == 1 ) - { - /* use back color */ - VB->Color = VB->Bcolor; - VB->Specular= VB->Bspec; - } - else - { - /* use front color */ - VB->Color = VB->Fcolor; - VB->Specular= VB->Fspec; - } - } - - if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) - { - /* finish computing plane equation of polygon, compute offset */ - GLfloat fz = win[vlist[index]][2] - win[vlist[0]][2]; - GLfloat ez = win[vlist[index-1]][2] - win[vlist[0]][2]; - GLfloat a = (ey * fz) - (ez * fy); - GLfloat b = (ez * fx) - (ex * fz); - OffsetPolygon( ctx, a, b, c ); - } - RenderOneTriangle( ctx, vlist[0], vlist[index-1], vlist[index], pv ); - } -} -/*===========================================================================*/ -/* This function gets called when either the vertex buffer is full or glEnd */ -/* has been called. If the we aren't in rendering mode (FEEDBACK) then I */ -/* pass the vertex buffer back to Mesa to deal with by returning FALSE. */ -/* If I can render the primitive types in the buffer directly then I will */ -/* return TRUE after I render the vertex buffer and reset the vertex buffer. */ -/* */ -/* TODO: I don't handle the special case of when the vertex buffer is full */ -/* and we have a primitive that bounds this buffer and the next one to */ -/* come. I'm not sure right now if Mesa handles this for me... */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone ) -{ - struct vertex_buffer *VB = ctx->VB; - GLuint index, - vlist[VB_SIZE]; - - DPF(( DBG_FUNC, "RenderVertexBuffer();" )); - - /* We only need to hook actual tri's that need rendering. */ - if ( ctx->RenderMode != GL_RENDER ) - { - // (ctx->Visual->AccumBits > 0) ) - // (ctx->Visual->StencilBits > 0) ) - DPF(( DBG_PRIM_INFO, "Passing VB back to Mesa" )); - return FALSE; - } - - /* I'm going to set the states here so that all functions will */ - /* be assured to have the right states. If Mesa's vertex bufefr */ - /* function calls one of my primitive functions (TRI,POINT,LINE) */ - /* it will need the right states. So instead of doing it in the */ - /* primitive function I will always do it here at risk of some */ - /* slow down to some cases... */ - SetRenderStates( ctx ); - - switch( ctx->Primitive ) - { - case GL_POINTS: - DPF(( DBG_PRIM_INFO, "GL_POINTS( %d )", VB->Count )); - RenderPointsVB( ctx, 0, VB->Count ); - break; - - case GL_LINES: - case GL_LINE_STRIP: - case GL_LINE_LOOP: - /* Not supported functions yet so pass back that we failed to */ - /* render the vertex buffer and Mesa will have to do it. */ - DPF(( DBG_PRIM_INFO, "GL_LINE_?( %d )", VB->Count )); - return FALSE; - - case GL_TRIANGLES: - if ( VB->Count < 3 ) - { - DPF(( DBG_PRIM_WARN, "GL_TRIANGLES( %d )", VB->Count )); - return FALSE; - } - - DPF(( DBG_PRIM_INFO, "GL_TRIANGLES( %d )", VB->Count )); - RenderTriangleVB( ctx, 0, VB->Count ); - break; - - case GL_TRIANGLE_STRIP: - if ( VB->Count < 3 ) - { - DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_STRIP( %d )", VB->Count )); - return FALSE; - } - - DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_STRIP( %d )", VB->Count )); - RenderTriangleStripVB( ctx, 0, VB->Count ); - break; - - case GL_TRIANGLE_FAN: - if ( VB->Count < 3 ) - { - DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_FAN( %d )", VB->Count )); - return FALSE; - } - - DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_FAN( %d )", VB->Count )); - RenderTriangleFanVB( ctx, 0, VB->Count ); - break; - - case GL_QUADS: - if ( VB->Count < 4 ) - { - DPF(( DBG_PRIM_WARN, "GL_QUADS( %d )", VB->Count )); - return FALSE; - } - - DPF(( DBG_PRIM_INFO, "GL_QUADS( %d )", VB->Count )); - RenderQuadVB( ctx, 0, VB->Count ); - break; - - case GL_QUAD_STRIP: - if ( VB->Count < 4 ) - { - DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count )); - return FALSE; - } - - DPF(( DBG_PRIM_INFO, "GL_QUAD_STRIP( %d )", VB->Count )); - - if ( VB->ClipOrMask ) - { - for( index = 3; index < VB->Count; index += 2 ) - { - if ( VB->ClipMask[index-3] & VB->ClipMask[index-2] & VB->ClipMask[index-1] & VB->ClipMask[index] & CLIP_ALL_BITS ) - { - /* All points clipped by common plane */ - DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count )); - continue; - } - else if ( VB->ClipMask[index-3] | VB->ClipMask[index-2] | VB->ClipMask[index-1] | VB->ClipMask[index] ) - { - vlist[0] = index - 3; - vlist[1] = index - 2; - vlist[2] = index; - vlist[3] = index - 1; - RenderClippedPolygon( ctx, 4, vlist ); - } - else - { - RenderQuad( ctx, (index-3), (index-2), index, (index-1), index ); - } - } - } - else - { - /* No clipping needed */ - for( index = 3; index < VB->Count; index += 2 ) - RenderQuad( ctx, (index-3), (index-2), index, (index-1), index ); - } - break; - - case GL_POLYGON: - if ( VB->Count < 3 ) - { - DPF(( DBG_PRIM_WARN, "GL_POLYGON( %d )", VB->Count )); - return FALSE; - } - - DPF(( DBG_PRIM_INFO, "GL_POLYGON( %d )", VB->Count )); - - /* All points clipped by common plane, draw nothing */ - if ( !(VB->ClipAndMask & CLIP_ALL_BITS) ) - RenderTriangleFanVB( ctx, 0, VB->Count ); - break; - - default: - /* should never get here */ - _mesa_problem( ctx, "invalid mode in gl_render_vb" ); - } - - DPF(( DBG_PRIM_INFO, "ResetVB" )); - - /* We return TRUE to indicate we rendered the VB. */ - gl_reset_vb( ctx, allDone ); - return TRUE; -} -/*===========================================================================*/ -/* This function will render the current vertex buffer as triangles. The */ -/* buffer has to be able to be rendered directly. This means that we are */ -/* filled, no offsets, no culling and one sided rendering. Also we must be */ -/* in render mode of course. */ -/* First I will fill the global D3D vertice buffer. Next I will set all the*/ -/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ -/* to the wrapper that call DrawPrimitives. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - int index, - cVertex, - height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - DWORD dwPVColor; - GLfloat ex, ey, - fx, fy, c; - GLuint facing; - - DPF(( DBG_FUNC, "RenderTriangleVB" )); - - if ( !VB->ClipOrMask ) - { - DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) )); - for( index = start, cVertex = 0; index < end; ) - { - dwPVColor = (VB->Color[(index+2)][3]<<24) | (VB->Color[(index+2)][0]<<16) | (VB->Color[(index+2)][1]<<8) | VB->Color[(index+2)][2]; - - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; - index++; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; - index++; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color= dwPVColor; - index++; - } - } - else - { -#define v1 index -#define v2 (index+1) -#define v3 (index+2) - - for( index = start, cVertex = 0; index < end; index += 3 ) - { - if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) - { - continue; - } - else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) - { - VList[0] = v1; - VList[1] = v2; - VList[2] = v3; - RenderClippedPolygon( ctx, 3, VList ); - continue; - } - - /* Compute orientation of triangle */ - ex = VB->Win[v2][0] - VB->Win[v1][0]; - ey = VB->Win[v2][1] - VB->Win[v1][1]; - fx = VB->Win[v3][0] - VB->Win[v1][0]; - fy = VB->Win[v3][1] - VB->Win[v1][1]; - c = (ex * fy) - (ey * fx); - - /* polygon is perpindicular to view plane, don't draw it */ - if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) - continue; - - /* Backface culling. */ - facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; - if ( (facing + 1) & ctx->Polygon.CullBits ) - continue; - - if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) - { - if ( facing == 1 ) - { - /* use back color */ - VB->Color = VB->Bcolor; - VB->Specular= VB->Bspec; - } - else - { - /* use front color */ - VB->Color = VB->Fcolor; - VB->Specular= VB->Fspec; - } - } - - if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) - { - /* Finish computing plane equation of polygon, compute offset */ - GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; - GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; - GLfloat a = (ey * fz) - (ez * fy); - GLfloat b = (ez * fx) - (ex * fz); - OffsetPolygon( ctx, a, b, c ); - } - - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */ - dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - D3DTLVertices[cVertex++].color= dwPVColor; - } -#undef v1 -#undef v2 -#undef v3 - } - - /* Render the converted vertex buffer. */ - if ( cVertex > 2 ) - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); -} -/*===========================================================================*/ -/* This function will render the current vertex buffer as a triangle fan. */ -/* The buffer has to be able to be rendered directly. This means that we are*/ -/* filled, no offsets, no culling and one sided rendering. Also we must be */ -/* in render mode of course. */ -/* First I will fill the global D3D vertice buffer. Next I will set all the*/ -/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ -/* to the wrapper that call DrawPrimitives. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - int index, - cVertex, - height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - GLfloat ex, ey, - fx, fy, c; - GLuint facing; - DWORD dwPVColor; - - DPF(( DBG_FUNC, "RenderTriangleFanVB();" )); - - /* Special case that we can blast the fan without culling, offset, etc... */ - if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) ) - { - DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) )); - - /* Seed the the fan. */ - D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] ); - D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) ); - D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] ); - D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] ); - D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] ); - D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) ); - D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2]; - - /* Seed the the fan. */ - D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] ); - D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) ); - D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] ); - D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] ); - D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] ); - D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) ); - D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2]; - - for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ ) - { - /*=================================*/ - /* Add the next vertex to the fan. */ - /*=================================*/ - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; - } - - /* Render the converted vertex buffer. */ - if ( cVertex ) - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLEFAN, &D3DTLVertices[0], cVertex ); - } - else - { -#define v1 start -#define v2 (index-1) -#define v3 index - - for( index = (start+2), cVertex = 0; index < end; index++ ) - { - if ( VB->ClipOrMask ) - { - /* All points clipped by common plane */ - if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) - { - continue; - } - else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) - { - VList[0] = v1; - VList[1] = v2; - VList[2] = v3; - RenderClippedPolygon( ctx, 3, VList ); - continue; - } - } - - /* Compute orientation of triangle */ - ex = VB->Win[v2][0] - VB->Win[v1][0]; - ey = VB->Win[v2][1] - VB->Win[v1][1]; - fx = VB->Win[v3][0] - VB->Win[v1][0]; - fy = VB->Win[v3][1] - VB->Win[v1][1]; - c = (ex * fy) - (ey * fx); - - /* polygon is perpindicular to view plane, don't draw it */ - if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) - continue; - - /* Backface culling. */ - facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; - if ( (facing + 1) & ctx->Polygon.CullBits ) - continue; - - if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) - { - /* Finish computing plane equation of polygon, compute offset */ - GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; - GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; - GLfloat a = (ey * fz) - (ez * fy); - GLfloat b = (ez * fx) - (ex * fz); - OffsetPolygon( ctx, a, b, c ); - } - - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - D3DTLVertices[cVertex++].color= dwPVColor; - } - - /* Render the converted vertex buffer. */ - if ( cVertex ) - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); -#undef v1 -#undef v2 -#undef v3 - } -} -/*===========================================================================*/ -/* This function will render the current vertex buffer as a triangle strip. */ -/* The buffer has to be able to be rendered directly. This means that we are*/ -/* filled, no offsets, no culling and one sided rendering. Also we must be */ -/* in render mode of course. */ -/* First I will fill the global D3D vertice buffer. Next I will set all the*/ -/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ -/* to the wrapper that call DrawPrimitives. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - int index, - cVertex = 0, - v1, v2, v3, - height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - GLfloat ex, ey, - fx, fy, c; - GLuint facing; - DWORD dwPVColor; - - DPF(( DBG_FUNC, "RenderTriangleStripVB();" )); - - /* Special case that we can blast the fan without culling, offset, etc... */ - if ( !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) ) - { - DPF(( DBG_PRIM_PROFILE, "DirectTriangles" )); - - /* Seed the the strip. */ - D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] ); - D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) ); - D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] ); - D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] ); - D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] ); - D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) ); - D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2]; - - /* Seed the the strip. */ - D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] ); - D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) ); - D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] ); - D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] ); - D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] ); - D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) ); - D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2]; - - for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ ) - { - /*===================================*/ - /* Add the next vertex to the strip. */ - /*===================================*/ - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; - } - - /* Render the converted vertex buffer. */ - if ( cVertex ) - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLESTRIP, &D3DTLVertices[0], cVertex ); - } - else - { - for( index = (start+2); index < end; index++ ) - { - /* We need to switch order so that winding won't be a problem. */ - if ( index & 1 ) - { - v1 = index - 1; - v2 = index - 2; - v3 = index - 0; - } - else - { - v1 = index - 2; - v2 = index - 1; - v3 = index - 0; - } - - /* All vertices clipped by common plane */ - if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) - continue; - - /* Check if any vertices need clipping. */ - if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) - { - VList[0] = v1; - VList[1] = v2; - VList[2] = v3; - RenderClippedPolygon( ctx, 3, VList ); - } - else - { - /* Compute orientation of triangle */ - ex = VB->Win[v2][0] - VB->Win[v1][0]; - ey = VB->Win[v2][1] - VB->Win[v1][1]; - fx = VB->Win[v3][0] - VB->Win[v1][0]; - fy = VB->Win[v3][1] - VB->Win[v1][1]; - c = (ex * fy) - (ey * fx); - - /* Polygon is perpindicular to view plane, don't draw it */ - if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) - continue; - - /* Backface culling. */ - facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; - if ( (facing + 1) & ctx->Polygon.CullBits ) - continue; - - /* Need right color if we have two sided lighting. */ - if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) - { - if ( facing == 1 ) - { - /* use back color */ - VB->Color = VB->Bcolor; - VB->Specular= VB->Bspec; - } - else - { - /* use front color */ - VB->Color = VB->Fcolor; - VB->Specular= VB->Fspec; - } - } - - if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) - { - /* Finish computing plane equation of polygon, compute offset */ - GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; - GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; - GLfloat a = (ey * fz) - (ez * fy); - GLfloat b = (ez * fx) - (ex * fz); - OffsetPolygon( ctx, a, b, c ); - } - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - - /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */ - dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - D3DTLVertices[cVertex++].color= dwPVColor; - } - } - - /* Render the converted vertex buffer. */ - if ( cVertex ) - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); - } -} -/*===========================================================================*/ -/* This function will render the current vertex buffer as Quads. The buffer*/ -/* has to be able to be rendered directly. This means that we are filled, no*/ -/* offsets, no culling and one sided rendering. Also we must be in render */ -/* mode of cource. */ -/* First I will fill the global D3D vertice buffer. Next I will set all the*/ -/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ -/* to the wrapper that call DrawPrimitives. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - int index, - cVertex, - height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - DWORD dwPVColor; - GLfloat ex, ey, - fx, fy, c; - GLuint facing; /* 0=front, 1=back */ - - DPF(( DBG_FUNC, "RenderQuadVB();" )); - -#define v1 (index) -#define v2 (index+1) -#define v3 (index+2) -#define v4 (index+3) - - if ( !VB->ClipOrMask ) - { - DPF(( DBG_PRIM_PROFILE, "DirectTriangles" )); - - for( cVertex = 0, index = start; index < end; index += 4 ) - { - if ( ctx->Light.ShadeModel == GL_FLAT ) - dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; - - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v2][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v4][2] ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; - } - } - else - { - for( cVertex = 0, index = start; index < end; index += 4 ) - { - if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & VB->ClipMask[v4] & CLIP_ALL_BITS ) - { - continue; - } - else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] | VB->ClipMask[v4] ) - { - VList[0] = v1; - VList[1] = v2; - VList[2] = v3; - VList[3] = v4; - RenderClippedPolygon( ctx, 4, VList ); - continue; - } - - /* Compute orientation of triangle */ - ex = VB->Win[v2][0] - VB->Win[v1][0]; - ey = VB->Win[v2][1] - VB->Win[v1][1]; - fx = VB->Win[v3][0] - VB->Win[v1][0]; - fy = VB->Win[v3][1] - VB->Win[v1][1]; - c = (ex * fy) - (ey * fx); - - /* polygon is perpindicular to view plane, don't draw it */ - if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) - continue; - - /* Backface culling. */ - facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; - if ( (facing + 1) & ctx->Polygon.CullBits ) - continue; - - if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) - { - if ( facing == 1 ) - { - /* use back color */ - VB->Color = VB->Bcolor; - VB->Specular= VB->Bspec; - } - else - { - /* use front color */ - VB->Color = VB->Fcolor; - VB->Specular= VB->Fspec; - } - } - - if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) - { - /* Finish computing plane equation of polygon, compute offset */ - GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; - GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; - GLfloat a = (ey * fz) - (ez * fy); - GLfloat b = (ez * fx) - (ex * fz); - OffsetPolygon( ctx, a, b, c ); - } - - if ( ctx->Light.ShadeModel == GL_FLAT ) - dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; - - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] ); - D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) ); - D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) ); - D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] ); - D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] ); - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); - D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? - dwPVColor : - (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; - } - } - -#undef v4 -#undef v3 -#undef v2 -#undef v1 - - /* Render the converted vertex buffer. */ - if ( cVertex ) - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); -} -/*===========================================================================*/ -/* */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - DWORD dwPVColor; - GLfloat ex, ey, - fx, fy, c; - GLuint facing; /* 0=front, 1=back */ - static D3DTLVERTEX TLVertices[6]; - - DPF(( DBG_FUNC, "RenderQuad" )); - DPF(( DBG_PRIM_INFO, "RenderQuad( 1 )" )); - - /* Compute orientation of triangle */ - ex = VB->Win[v2][0] - VB->Win[v1][0]; - ey = VB->Win[v2][1] - VB->Win[v1][1]; - fx = VB->Win[v3][0] - VB->Win[v1][0]; - fy = VB->Win[v3][1] - VB->Win[v1][1]; - c = (ex * fy) - (ey * fx); - - /* polygon is perpindicular to view plane, don't draw it */ - if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) - return; - - /* Backface culling. */ - facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; - if ( (facing + 1) & ctx->Polygon.CullBits ) - return; - - if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) - { - if ( facing == 1 ) - { - /* use back color */ - VB->Color = VB->Bcolor; - VB->Specular= VB->Bspec; - } - else - { - /* use front color */ - VB->Color = VB->Fcolor; - VB->Specular= VB->Fspec; - } - } - - if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) - { - /* Finish computing plane equation of polygon, compute offset */ - GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; - GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; - GLfloat a = (ey * fz) - (ez * fy); - GLfloat b = (ez * fx) - (ex * fz); - OffsetPolygon( ctx, a, b, c ); - } - - if ( ctx->Light.ShadeModel == GL_FLAT ) - dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; - - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); - TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); - TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); - TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); - TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); - TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); - TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); - TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); - TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); - TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - - TLVertices[2].sx = D3DVAL( VB->Win[v3][0] ); - TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) ); - TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] ); - TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] ); - TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - TLVertices[3].sx = D3DVAL( VB->Win[v3][0] ); - TLVertices[3].sy = D3DVAL( (height - VB->Win[v3][1]) ); - TLVertices[3].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - TLVertices[3].tu = D3DVAL( VB->TexCoord[v3][0] ); - TLVertices[3].tv = D3DVAL( VB->TexCoord[v3][1] ); - TLVertices[3].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - TLVertices[3].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - - TLVertices[4].sx = D3DVAL( VB->Win[v4][0] ); - TLVertices[4].sy = D3DVAL( (height - VB->Win[v4][1]) ); - TLVertices[4].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) ); - TLVertices[4].tu = D3DVAL( VB->TexCoord[v4][0] ); - TLVertices[4].tv = D3DVAL( VB->TexCoord[v4][1] ); - TLVertices[4].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); - TLVertices[4].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; - - TLVertices[5].sx = D3DVAL( VB->Win[v1][0] ); - TLVertices[5].sy = D3DVAL( (height - VB->Win[v1][1]) ); - TLVertices[5].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - TLVertices[5].tu = D3DVAL( VB->TexCoord[v1][0] ); - TLVertices[5].tv = D3DVAL( VB->TexCoord[v1][1] ); - TLVertices[5].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - TLVertices[5].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - /* Draw the two triangles. */ - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 6 ); -} -/*===========================================================================*/ -/* */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - DWORD dwPVColor; - static D3DTLVERTEX TLVertices[3]; - - DPF(( DBG_FUNC, "RenderOneTriangle" )); - DPF(( DBG_PRIM_INFO, "RenderTriangle( 1 )" )); - - /*=====================================*/ - /* Populate the the triangle vertices. */ - /*=====================================*/ - if ( ctx->Light.ShadeModel == GL_FLAT ) - dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; - - TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); - TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); - TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); - TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); - TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); - TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - DPF(( DBG_PRIM_INFO, "V1 -> x:%f y:%f z:%f c:%x", - TLVertices[0].sx, - TLVertices[0].sy, - TLVertices[0].sz, - TLVertices[0].color )); - - TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); - TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); - TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); - TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); - TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); - TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - DPF(( DBG_PRIM_INFO, "V2 -> x:%f y:%f z:%f c:%x", - TLVertices[1].sx, - TLVertices[1].sy, - TLVertices[1].sz, - TLVertices[1].color )); - - TLVertices[2].sx = D3DVAL( VB->Win[v3][0] ); - TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) ); - TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); - TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] ); - TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] ); - TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); - TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; - DPF(( DBG_PRIM_INFO, "V3 -> x:%f y:%f z:%f c:%x", - TLVertices[2].sx, - TLVertices[2].sy, - TLVertices[2].sz, - TLVertices[2].color )); - - /* Draw the triangle. */ - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 3 ); -} -/*===========================================================================*/ -/* */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - DWORD dwPVColor; - static D3DTLVERTEX TLVertices[2]; - - DPF(( DBG_FUNC, "RenderOneLine" )); - DPF(( DBG_PRIM_INFO, "RenderLine( 1 )" )); - - if ( VB->MonoColor ) - dwPVColor = (pContext->aCurrent<<24) | (pContext->rCurrent<<16) | (pContext->gCurrent<<8) | pContext->bCurrent; - else - dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; - - TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); - TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); - TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->LineZoffset) ); - TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); - TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); - TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); - TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; - - TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); - TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); - TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->LineZoffset) ); - TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); - TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); - TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); - TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : - (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; - - /* Draw line from (x0,y0) to (x1,y1) with current pixel color/index */ - DrawPrimitiveHAL( pContext->pShared, D3DPT_LINELIST, &TLVertices[0], 2 ); -} -/*===========================================================================*/ -/* This function was written to convert points into triangles. I did this */ -/* as all card accelerate triangles and most drivers do this anyway. In hind*/ -/* thought this might be a bad idea as some cards do better. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - struct vertex_buffer *VB = ctx->VB; - struct pixel_buffer *PB = ctx->PB; - GLuint index; - GLfloat radius, z, - xmin, ymin, - xmax, ymax; - GLint cVertex, - height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); - DWORD dwPVColor; - - DPF(( DBG_FUNC, "RenderPointsVB();" )); - - radius = CLAMP( ctx->Point.Size, MIN_POINT_SIZE, MAX_POINT_SIZE ) * 0.5F; - - for( index = start, cVertex = 0; index <= end; index++ ) - { - if ( VB->ClipMask[index] == 0 ) - { - xmin = D3DVAL( VB->Win[index][0] - radius ); - xmax = D3DVAL( VB->Win[index][0] + radius ); - ymin = D3DVAL( height - VB->Win[index][1] - radius ); - ymax = D3DVAL( height - VB->Win[index][1] + radius ); - z = D3DVAL( (VB->Win[index][2] + ctx->PointZoffset) ); - - dwPVColor = (VB->Color[index][3]<<24) | - (VB->Color[index][0]<<16) | - (VB->Color[index][1]<<8) | - VB->Color[index][2]; - - D3DTLVertices[cVertex].sx = xmin; - D3DTLVertices[cVertex].sy = ymax; - D3DTLVertices[cVertex].sz = z; - D3DTLVertices[cVertex].tu = 0.0; - D3DTLVertices[cVertex].tv = 0.0; - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color = dwPVColor; - - D3DTLVertices[cVertex].sx = xmin; - D3DTLVertices[cVertex].sy = ymin; - D3DTLVertices[cVertex].sz = z; - D3DTLVertices[cVertex].tu = 0.0; - D3DTLVertices[cVertex].tv = 0.0; - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color = dwPVColor; - - D3DTLVertices[cVertex].sx = xmax; - D3DTLVertices[cVertex].sy = ymin; - D3DTLVertices[cVertex].sz = z; - D3DTLVertices[cVertex].tu = 0.0; - D3DTLVertices[cVertex].tv = 0.0; - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color = dwPVColor; - - D3DTLVertices[cVertex].sx = xmax; - D3DTLVertices[cVertex].sy = ymin; - D3DTLVertices[cVertex].sz = z; - D3DTLVertices[cVertex].tu = 0.0; - D3DTLVertices[cVertex].tv = 0.0; - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color = dwPVColor; - - D3DTLVertices[cVertex].sx = xmax; - D3DTLVertices[cVertex].sy = ymax; - D3DTLVertices[cVertex].sz = z; - D3DTLVertices[cVertex].tu = 0.0; - D3DTLVertices[cVertex].tv = 0.0; - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color = dwPVColor; - - D3DTLVertices[cVertex].sx = xmin; - D3DTLVertices[cVertex].sy = ymax; - D3DTLVertices[cVertex].sz = z; - D3DTLVertices[cVertex].tu = 0.0; - D3DTLVertices[cVertex].tv = 0.0; - D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); - D3DTLVertices[cVertex++].color = dwPVColor; - } - } - - /* Render the converted vertex buffer. */ - if ( cVertex ) - DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); -} -/*===========================================================================*/ -/* This gets call before we render any primitives so that the current OGL */ -/* states will be mapped the D3D context. I'm still not sure how D3D works */ -/* but I'm finding that it doesn't act like a state machine as OGL is. It */ -/* looks like the state gets set back to the defaults after a DrawPrimitives */ -/* or an EndScene. Also I set states that are the default even though this */ -/* is redundant as the defaults seem screwed up. */ -/* TODO: make a batch call. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void SetRenderStates( GLcontext *ctx ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DWORD dwFunc; - static BOOL bTexture = FALSE; - static int texName = -1; - - DPF(( DBG_FUNC, "SetRenderStates();" )); - - if ( g_DBGMask & DBG_STATES ) - DebugRenderStates( ctx, FALSE ); - - SetStateHAL( pContext->pShared, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE ); - SetStateHAL( pContext->pShared, D3DRENDERSTATE_DITHERENABLE, (ctx->Color.DitherFlag) ? TRUE : FALSE ); - - /*================================================*/ - /* Check too see if there are new TEXTURE states. */ - /*================================================*/ - if ( ctx->Texture._EnabledUnits ) - { - switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode ) - { - case GL_MODULATE: - if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA ) - dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulatealpha]; - else - dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulate]; - break; - - case GL_BLEND: - dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha]; - break; - - case GL_REPLACE: - dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal]; - break; - - case GL_DECAL: - if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA ) - dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha]; - else - dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal]; - break; - } - SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAPBLEND, dwFunc ); - - switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter ) - { - case GL_NEAREST: - dwFunc = D3DFILTER_NEAREST; - break; - case GL_LINEAR: - dwFunc = D3DFILTER_LINEAR; - break; - case GL_NEAREST_MIPMAP_NEAREST: - dwFunc = D3DFILTER_MIPNEAREST; - break; - case GL_LINEAR_MIPMAP_NEAREST: - dwFunc = D3DFILTER_LINEARMIPNEAREST; - break; - case GL_NEAREST_MIPMAP_LINEAR: - dwFunc = D3DFILTER_MIPLINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - dwFunc = D3DFILTER_LINEARMIPLINEAR; - break; - } - SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAG, dwFunc ); - - switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter ) - { - case GL_NEAREST: - dwFunc = D3DFILTER_NEAREST; - break; - case GL_LINEAR: - dwFunc = D3DFILTER_LINEAR; - break; - case GL_NEAREST_MIPMAP_NEAREST: - dwFunc = D3DFILTER_MIPNEAREST; - break; - case GL_LINEAR_MIPMAP_NEAREST: - dwFunc = D3DFILTER_LINEARMIPNEAREST; - break; - case GL_NEAREST_MIPMAP_LINEAR: - dwFunc = D3DFILTER_MIPLINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - dwFunc = D3DFILTER_LINEARMIPLINEAR; - break; - } - SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMIN, dwFunc ); - - /* Another hack to cut down on redundant texture binding. */ - // if ( texName != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name ) - // { - texName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name; - CreateTMgrHAL( pContext->pShared, - texName, - 0, - ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format, - (RECT *)NULL, - ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Width, - ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Height, - TM_ACTION_BIND, - (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Data ); - // } - bTexture = TRUE; - } - else - { - /* This is nasty but should cut down on the number of redundant calls. */ - if ( bTexture == TRUE ) - { - DisableTMgrHAL( pContext->pShared ); - bTexture = FALSE; - } - } - - /*===============================================*/ - /* Check too see if there are new RASTER states. */ - /*===============================================*/ - - // TODO: no concept of front & back. - switch( ctx->Polygon.FrontMode ) - { - case GL_POINT: - SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_POINT ); - break; - case GL_LINE: - SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME ); - break; - case GL_FILL: - SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID ); - break; - } - - /*************/ - /* Z-Buffer. */ - /*************/ - if ( ctx->Depth.Test == GL_TRUE ) - { - switch( ctx->Depth.Func ) - { - case GL_NEVER: - dwFunc = D3DCMP_NEVER; - break; - case GL_LESS: - dwFunc = D3DCMP_LESS; - break; - case GL_GEQUAL: - dwFunc = D3DCMP_GREATEREQUAL; - break; - case GL_LEQUAL: - dwFunc = D3DCMP_LESSEQUAL; - break; - case GL_GREATER: - dwFunc = D3DCMP_GREATER; - break; - case GL_NOTEQUAL: - dwFunc = D3DCMP_NOTEQUAL; - break; - case GL_EQUAL: - dwFunc = D3DCMP_EQUAL; - break; - case GL_ALWAYS: - dwFunc = D3DCMP_ALWAYS; - break; - } - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZFUNC, dwFunc ); - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, TRUE ); - } - else - { - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, FALSE ); - } - - /*******************/ - /* Z-Write Enable. */ - /*******************/ - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZWRITEENABLE , (ctx->Depth.Mask == GL_TRUE) ? TRUE : FALSE ); - - /***************/ - /* Alpha test. */ - /***************/ - if ( ctx->Color.AlphaEnabled == GL_TRUE ) - { - switch( ctx->Color.AlphaFunc ) - { - case GL_NEVER: - dwFunc = D3DCMP_NEVER; - break; - case GL_LESS: - dwFunc = D3DCMP_LESS; - break; - case GL_GEQUAL: - dwFunc = D3DCMP_GREATEREQUAL; - break; - case GL_LEQUAL: - dwFunc = D3DCMP_LESSEQUAL; - break; - case GL_GREATER: - dwFunc = D3DCMP_GREATER; - break; - case GL_NOTEQUAL: - dwFunc = D3DCMP_NOTEQUAL; - break; - case GL_EQUAL: - dwFunc = D3DCMP_EQUAL; - break; - case GL_ALWAYS: - dwFunc = D3DCMP_ALWAYS; - break; - } - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHAFUNC , dwFunc ); - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, TRUE ); - } - else - { - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, FALSE ); - } - - /****************/ - /* Alpha blend. */ - /****************/ - if ( ctx->Color.BlendEnabled == GL_TRUE ) - { - switch( ctx->Color.BlendSrc ) - { - case GL_ZERO: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_zero]; - break; - case GL_ONE: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_one]; - break; - case GL_DST_COLOR: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_color]; - break; - case GL_ONE_MINUS_DST_COLOR: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_color]; - break; - case GL_SRC_ALPHA: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha]; - break; - case GL_ONE_MINUS_SRC_ALPHA: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_src_alpha]; - break; - case GL_DST_ALPHA: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_alpha]; - break; - case GL_ONE_MINUS_DST_ALPHA: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_alpha]; - break; - case GL_SRC_ALPHA_SATURATE: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha_saturate]; - break; - case GL_CONSTANT_COLOR: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_color]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_color]; - break; - case GL_CONSTANT_ALPHA: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_alpha]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_alpha]; - break; - } - SetStateHAL( pContext->pShared, D3DRENDERSTATE_SRCBLEND, dwFunc ); - - switch( ctx->Color.BlendDst ) - { - case GL_ZERO: - dwFunc = pContext->pShared->dwDestBlendCaps[d_zero]; - break; - case GL_ONE: - dwFunc = pContext->pShared->dwDestBlendCaps[d_one]; - break; - case GL_SRC_COLOR: - dwFunc = pContext->pShared->dwDestBlendCaps[d_src_color]; - break; - case GL_ONE_MINUS_SRC_COLOR: - dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_color]; - break; - case GL_SRC_ALPHA: - dwFunc = pContext->pShared->dwDestBlendCaps[d_src_alpha]; - break; - case GL_ONE_MINUS_SRC_ALPHA: - dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_alpha]; - break; - case GL_DST_ALPHA: - dwFunc = pContext->pShared->dwDestBlendCaps[d_dst_alpha]; - break; - case GL_ONE_MINUS_DST_ALPHA: - dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_dst_alpha]; - break; - case GL_CONSTANT_COLOR: - dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_color]; - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_color]; - break; - case GL_CONSTANT_ALPHA: - dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_alpha]; - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_alpha]; - break; - } - SetStateHAL( pContext->pShared, D3DRENDERSTATE_DESTBLEND, dwFunc ); - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE ); - } - else - { - SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE ); - } -} -/*===========================================================================*/ -/* If this function is called it will track the changes to the current */ -/* states that I'm setting in Direct3D. I did this so that the DPF's would */ -/* be under control! */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void DebugRenderStates( GLcontext *ctx, BOOL bForce ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DWORD dwFunc; - static int dither = -1, - texture = -1, - textName = -1, - textEnv = -1, - textMin = -1, - textMag = -1, - polyMode = -1, - depthTest = -1, - depthFunc = -1, - depthMask = -1, - alphaTest = -1, - alphaFunc = -1, - blend = -1, - blendSrc = -1, - blendDest = -1; - - /* Force a displayed update of all current states. */ - if ( bForce ) - { - dither = texture = textName = textEnv = textMin = textMag = -1; - polyMode = depthTest = depthFunc = depthMask = -1; - alphaTest = alphaFunc = blend = blendSrc = blendDest = -1; - } - - if ( dither != ctx->Color.DitherFlag ) - { - dither = ctx->Color.DitherFlag; - DPF(( 0, "\tDither\t\t%s", (dither) ? "ENABLED" : "--------" )); - } - if ( depthTest != ctx->Depth.Test ) - { - depthTest = ctx->Depth.Test; - DPF(( 0, "\tDepth Test\t%s", (depthTest) ? "ENABLED" : "--------" )); - } - if ( alphaTest != ctx->Color.AlphaEnabled ) - { - alphaTest = ctx->Color.AlphaEnabled; - - DPF(( 0, "\tAlpha Test\t%s", (alphaTest) ? "ENABLED" : "--------" )); - } - if ( blend != ctx->Color.BlendEnabled ) - { - blend = ctx->Color.BlendEnabled; - - DPF(( 0, "\tBlending\t%s", (blend) ? "ENABLED" : "--------" )); - } - - /*================================================*/ - /* Check too see if there are new TEXTURE states. */ - /*================================================*/ - if ( texture != ctx->Texture._EnabledUnits ) - { - texture = ctx->Texture._EnabledUnits; - DPF(( 0, "\tTexture\t\t%s", (texture) ? "ENABLED" : "--------" )); - } - - if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current ) - { - if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name != textName ) - { - textName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name; - DPF(( 0, "\tTexture Name:\t%d", textName )); - DPF(( 0, "\tTexture Format:\t%s", - (ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0][0]->Format == GL_RGBA) ? - "GL_RGBA" : "GLRGB" )); - } - - if ( textEnv != ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode ) - { - textEnv = ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode; - - switch( textEnv ) - { - case GL_MODULATE: - DPF(( 0, "\tTexture\tMode\tGL_MODULATE" )); - break; - case GL_BLEND: - DPF(( 0, "\tTexture\tMode\tGL_BLEND" )); - break; - case GL_REPLACE: - DPF(( 0, "\tTexture\tMode\tGL_REPLACE" )); - break; - case GL_DECAL: - DPF(( 0, "\tTexture\tMode\tGL_DECAL" )); - break; - } - } - - if ( textMag != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter ) - { - textMag = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter; - - switch( textMag ) - { - case GL_NEAREST: - DPF(( 0, "\tTexture MAG\tGL_NEAREST" )); - break; - case GL_LINEAR: - DPF(( 0, "\tTexture MAG\tGL_LINEAR" )); - break; - case GL_NEAREST_MIPMAP_NEAREST: - DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_NEAREST" )); - break; - case GL_LINEAR_MIPMAP_NEAREST: - DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_NEAREST" )); - break; - case GL_NEAREST_MIPMAP_LINEAR: - DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_LINEAR" )); - break; - case GL_LINEAR_MIPMAP_LINEAR: - DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_LINEAR" )); - break; - } - } - - if ( textMin != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter ) - { - textMin = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter; - - switch( textMin ) - { - case GL_NEAREST: - DPF(( 0, "\tTexture MIN\tGL_NEAREST" )); - break; - case GL_LINEAR: - DPF(( 0, "\tTexture MIN\tGL_LINEAR" )); - break; - case GL_NEAREST_MIPMAP_NEAREST: - DPF(( 0, "\tTexture MIN\tGL_NEAREST_MIPMAP_NEAREST" )); - break; - case GL_LINEAR_MIPMAP_NEAREST: - DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_NEAREST" )); - break; - case GL_NEAREST_MIPMAP_LINEAR: - DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" )); - break; - case GL_LINEAR_MIPMAP_LINEAR: - DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" )); - break; - } - } - } - - if ( ctx->Polygon.FrontMode != polyMode ) - { - polyMode = ctx->Polygon.FrontMode; - - switch( polyMode ) - { - case GL_POINT: - DPF(( 0, "\tMode\t\tGL_POINT" )); - break; - case GL_LINE: - DPF(( 0, "\tMode\t\tGL_LINE" )); - break; - case GL_FILL: - DPF(( 0, "\tMode\t\tGL_FILL" )); - break; - } - } - - if ( depthFunc != ctx->Depth.Func ) - { - depthFunc = ctx->Depth.Func; - - switch( depthFunc ) - { - case GL_NEVER: - DPF(( 0, "\tDepth Func\tGL_NEVER" )); - break; - case GL_LESS: - DPF(( 0, "\tDepth Func\tGL_LESS" )); - break; - case GL_GEQUAL: - DPF(( 0, "\tDepth Func\tGL_GEQUAL" )); - break; - case GL_LEQUAL: - DPF(( 0, "\tDepth Func\tGL_LEQUAL" )); - break; - case GL_GREATER: - DPF(( 0, "\tDepth Func\tGL_GREATER" )); - break; - case GL_NOTEQUAL: - DPF(( 0, "\tDepth Func\tGL_NOTEQUAL" )); - break; - case GL_EQUAL: - DPF(( 0, "\tDepth Func\tGL_EQUAL" )); - break; - case GL_ALWAYS: - DPF(( 0, "\tDepth Func\tGL_ALWAYS" )); - break; - } - } - - if ( depthMask != ctx->Depth.Mask ) - { - depthMask = ctx->Depth.Mask; - DPF(( 0, "\tZWrite\t\t%s", (depthMask) ? "ENABLED" : "--------" )); - } - - if ( alphaFunc != ctx->Color.AlphaFunc ) - { - alphaFunc = ctx->Color.AlphaFunc; - - switch( alphaFunc ) - { - case GL_NEVER: - DPF(( 0, "\tAlpha Func\tGL_NEVER" )); - break; - case GL_LESS: - DPF(( 0, "\tAlpha Func\tGL_LESS" )); - break; - case GL_GEQUAL: - DPF(( 0, "\tAlpha Func\tGL_GEQUAL" )); - break; - case GL_LEQUAL: - DPF(( 0, "\tAlpha Func\tGL_LEQUAL" )); - break; - case GL_GREATER: - DPF(( 0, "\tAlpha Func\tGL_GREATER" )); - break; - case GL_NOTEQUAL: - DPF(( 0, "\tAlpha Func\tGL_NOTEQUAL" )); - break; - case GL_EQUAL: - DPF(( 0, "\tAlpha Func\tGL_EQUAL" )); - break; - case GL_ALWAYS: - DPF(( 0, "\tAlpha Func\tGL_ALWAYS" )); - break; - } - } - - if ( blendSrc != ctx->Color.BlendSrc ) - { - blendSrc = ctx->Color.BlendSrc; - - switch( blendSrc ) - { - case GL_ZERO: - DPF(( 0, "\tSRC Blend\tGL_ZERO" )); - break; - case GL_ONE: - DPF(( 0, "\tSRC Blend\tGL_ONE" )); - break; - case GL_DST_COLOR: - DPF(( 0, "\tSRC Blend\tGL_DST_COLOR" )); - break; - case GL_ONE_MINUS_DST_COLOR: - DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_COLOR" )); - break; - case GL_SRC_ALPHA: - DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA" )); - break; - case GL_ONE_MINUS_SRC_ALPHA: - DPF(( 0, "\tSRC Blend\tGL_MINUS_SRC_ALPHA" )); - break; - case GL_DST_ALPHA: - DPF(( 0, "\tSRC Blend\tGL_DST_ALPHA" )); - break; - case GL_ONE_MINUS_DST_ALPHA: - DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_ALPHA" )); - break; - case GL_SRC_ALPHA_SATURATE: - DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA_SATURATE" )); - break; - case GL_CONSTANT_COLOR: - DPF(( 0, "\tSRC Blend\tGL_CONSTANT_COLOR" )); - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_COLOR" )); - break; - case GL_CONSTANT_ALPHA: - DPF(( 0, "\tSRC Blend\tGL_CONSTANT_ALPHA" )); - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" )); - break; - } - } - - if ( blendDest != ctx->Color.BlendDst ) - { - blendDest = ctx->Color.BlendDst; - - switch( blendDest ) - { - case GL_ZERO: - DPF(( 0, "\tDST Blend\tGL_ZERO" )); - break; - case GL_ONE: - DPF(( 0, "\tDST Blend\tGL_ONE" )); - break; - case GL_SRC_COLOR: - DPF(( 0, "\tDST Blend\tGL_SRC_COLOR" )); - break; - case GL_ONE_MINUS_SRC_COLOR: - DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_COLOR" )); - break; - case GL_SRC_ALPHA: - DPF(( 0, "\tDST Blend\tGL_SRC_ALPHA" )); - break; - case GL_ONE_MINUS_SRC_ALPHA: - DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_ALPHA" )); - break; - case GL_DST_ALPHA: - DPF(( 0, "\tDST Blend\tGL_DST_ALPHA" )); - break; - case GL_ONE_MINUS_DST_ALPHA: - DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_DST_ALPHA" )); - break; - case GL_CONSTANT_COLOR: - DPF(( 0, "\tDST Blend\tGL_CONSTANT_COLOR" )); - break; - case GL_ONE_MINUS_CONSTANT_COLOR: - DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_COLOR" )); - break; - case GL_CONSTANT_ALPHA: - DPF(( 0, "\tDST Blend\tGL_CONSTANT_ALPHA" )); - break; - case GL_ONE_MINUS_CONSTANT_ALPHA: - DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" )); - break; - } - } -} diff --git a/src/mesa/drivers/d3d/DDrawPROCS.c b/src/mesa/drivers/d3d/DDrawPROCS.c deleted file mode 100644 index 10dcfdbabb..0000000000 --- a/src/mesa/drivers/d3d/DDrawPROCS.c +++ /dev/null @@ -1,399 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "D3DMesa.h" -/*===========================================================================*/ -/* This call will clear the render surface using the pixel info built from */ -/* the surface at creation time. The call uses Lock/Unlock to access the */ -/* surface. The call also special cases a full clear or a dirty rectangle. */ -/* Finally the call returns the new clear mask that reflects that the color */ -/* buffer was cleared. */ -/*===========================================================================*/ -/* RETURN: the original mask with the bits cleared that represents the buffer*/ -/* or buffers we just cleared. */ -/*===========================================================================*/ -GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - UCHAR *pBuffer, - *pScanLine; - int index, - index2; - DWORD dwColor; - - if ( mask & GL_COLOR_BUFFER_BIT ) - { - /* Lock the surface to get the surface pointer. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - /* Solve the color once only. */ - dwColor = ( ((DWORD)((float)pContext->rClear * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)pContext->gClear * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)pContext->bClear * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - - if ( all ) - { - for( index = 0, pScanLine = (UCHAR *)pddsd2->lpSurface; index < pContext->pShared->dwHeight; index++, pScanLine += pddsd2->lPitch ) - for( pBuffer = pScanLine, index2 = 0; index2 < pContext->pShared->dwWidth; index2++, pBuffer += pContext->pShared->pixel.cb ) - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - else - { - pScanLine = ((UCHAR *)pddsd2->lpSurface) + - ( (FLIP( pContext->pShared->dwHeight, (y+height)) * pddsd2->lPitch) + (x * pContext->pShared->pixel.cb) ); - - for( index = 0; index < height; index++, pScanLine += pddsd2->lPitch ) - { - for( index2 = 0, pBuffer = pScanLine; index2 < width; index2++, pBuffer += pContext->pShared->pixel.cb ) - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - - UnlockHAL( pContext->pShared, TRUE ); - } - - return (mask & ~GL_COLOR_BUFFER_BIT); -} -/*===========================================================================*/ -/* This proc (as all others) has been written for the general case. I use */ -/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ -/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - UCHAR *pBuffer; - int index; - DWORD dwColor; - - /* Get the surface pointer and the pitch. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - /* Find the start of the span. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb); - - if ( mask ) - { - for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) - { - if ( mask[index] ) - { - /* Pack the color components. */ - dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - } - else - { - for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) - { - /* Pack the color components. */ - dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - - /* Giver back. */ - UnlockHAL( pContext->pShared, TRUE ); -} -/*===========================================================================*/ -/* This proc (as all others) has been written for the general case. I use */ -/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ -/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - UCHAR *pBuffer; - int index; - DWORD dwColor; - - /* Get the surface pointer and the pitch. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - /* Find the start of the span. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb); - - if ( mask ) - { - for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) - { - if ( mask[index] ) - { - /* Pack the color components. */ - dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - } - else - { - for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) - { - /* Pack the color components. */ - dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - - /* Giver back. */ - UnlockHAL( pContext->pShared, TRUE ); -} -/*===========================================================================*/ -/* This proc (as all others) has been written for the general case. I use */ -/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ -/* Screen render surface uses. The color is solved once from the current */ -/* color components. The alpha is ignored as Mesa is doing it in SW. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - UCHAR *pBuffer; - int index; - DWORD dwColor; - - /* Lock the surface to get the surface pointer and the pitch. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - /* Solve the color once only. (no alpha) */ - dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - - /* Find the start of the span. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb); - - if ( mask ) - { - for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) - if ( mask[index] ) - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - else - { - for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - - /* Giver back. */ - UnlockHAL( pContext->pShared, TRUE ); -} -/*===========================================================================*/ -/* This proc (as all others) has been written for the general case. I use */ -/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ -/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - UCHAR *pBuffer; - int index; - DWORD dwColor; - - /* Get the surface pointer and the pitch. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - if ( mask ) - { - for( index = 0; index < n; index++ ) - { - if ( mask[index] ) - { - /* Pack the color components. */ - dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - - /* Find the pixel. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - } - else - { - for( index = 0; index < n; index++ ) - { - /* Pack the color components. */ - dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - - /* Find the pixel. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - - /* Giver back. */ - UnlockHAL( pContext->pShared, TRUE ); -} -/*===========================================================================*/ -/* This proc (as all others) has been written for the general case. I use */ -/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */ -/* Screen render surface uses. The color is solved once from the current */ -/* color components. The alpha is ignored as Mesa is doing it in SW. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - UCHAR *pBuffer; - int index; - DWORD dwColor; - - /* Get the surface pointer and the pitch. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - /* Solve the color once only. I don't uses the alpha. */ - dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift ); - dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift ); - dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift ); - - if ( mask ) - { - /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ - for( index = 0; index < n; index++ ) - { - if ( mask[index] ) - { - /* Find the pixel. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - } - else - { - /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ - for( index = 0; index < n; index++ ) - { - /* Find the pixel. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb); - memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb ); - } - } - - /* Giver back. */ - UnlockHAL( pContext->pShared, TRUE ); -} -/*===========================================================================*/ -/* This proc isn't written for speed rather its to handle the general case. */ -/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/ -/* structure that was generated from the OffScreen surface pixelformat. The */ -/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/ -/* own alpha channel when the context was created. I did this as I didn't */ -/* feel that it was worth the effort to try and get HW to work (bus bound). */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - UCHAR *pBuffer; - int index; - DWORD *pdwColor; - - /* Get the surface pointer and the pitch. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - /* Find the start of the span. Invert y for Windows. */ - pBuffer = (UCHAR *)pddsd2->lpSurface + - (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + - (x*pContext->pShared->pixel.cb); - - /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ - for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb ) - { - pdwColor = (DWORD *)pBuffer; - rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale); - rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale); - rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale); - } - - /* Giver back. */ - UnlockHAL( pContext->pShared, TRUE ); -} -/*===========================================================================*/ -/* This proc isn't written for speed rather its to handle the general case. */ -/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/ -/* structure that was generated from the OffScreen surface pixelformat. The */ -/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/ -/* own alpha channel when the context was created. I did this as I didn't */ -/* feel that it was worth the effort to try and get HW to work (bus bound). */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DDSURFACEDESC2 *pddsd2; - int index; - DWORD *pdwColor; - - /* Get the surface pointer and the pitch. */ - pddsd2 = LockHAL( pContext->pShared, TRUE ); - - if ( mask ) - { - /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ - for( index = 0; index < n; index++ ) - { - if ( mask[index] ) - { - /* Find the start of the pixel. Invert y for Windows. */ - pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb)); - rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale); - rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale); - rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale); - } - } - } - else - { - /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */ - for( index = 0; index < n; index++ ) - { - /* Find the start of the pixel. Invert y for Windows. */ - pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb)); - rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale); - rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale); - rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale); - } - } - - /* Giver back. */ - UnlockHAL( pContext->pShared, TRUE ); -} diff --git a/src/mesa/drivers/d3d/DEBUG.C b/src/mesa/drivers/d3d/DEBUG.C deleted file mode 100644 index 79e273903a..0000000000 --- a/src/mesa/drivers/d3d/DEBUG.C +++ /dev/null @@ -1,143 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "Debug.h" -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ -DWORD g_DBGMask = DBG_ALL_ERROR; -/*===========================================================================*/ -/* This is your basic DPF function with printf like support. The function */ -/* also works with a global debug mask variable. I have written support that*/ -/* allows for the user's enviroment variable space to be read and set the */ -/* masks. This is done when the dll starts and is only in the debug version.*/ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void _cdecl DebugPrint( int mask, char *pszFormat, ... ) -{ - char buffer[512]; - va_list args; - - /* A mask of 0 will always pass. Easy to remeber. */ - if ( (mask == 0) || (mask & g_DBGMask) ) - { - va_start( args, pszFormat ); - - if ( mask & DBG_ALL_ERROR ) - OutputDebugString( "MesaD3D: (ERROR)" ); - else - OutputDebugString( "MesaD3D: " ); - - vsprintf( buffer, pszFormat, args ); - strcat( buffer, "\n" ); - OutputDebugString( buffer ); - - va_end( args ); - } -} -/*===========================================================================*/ -/* This call reads the users enviroment variables and sets any debug mask */ -/* that they have set to TRUE. Now the value must be "TRUE". */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void ReadDBGEnv( void ) -{ - g_DBGMask = DBG_ALL_ERROR; - -#define IS_VAR_SET(v) if ( getenv( # v ) && !strcmp(getenv( # v ),"TRUE") ) g_DBGMask |= v; - - IS_VAR_SET( DBG_FUNC ); - IS_VAR_SET( DBG_STATES ); - - IS_VAR_SET( DBG_CNTX_INFO ); - IS_VAR_SET( DBG_CNTX_WARN ); - IS_VAR_SET( DBG_CNTX_PROFILE ); - IS_VAR_SET( DBG_CNTX_ERROR ); - IS_VAR_SET( DBG_CNTX_ALL ); - - IS_VAR_SET( DBG_PRIM_INFO ); - IS_VAR_SET( DBG_PRIM_WARN ); - IS_VAR_SET( DBG_PRIM_PROFILE ); - IS_VAR_SET( DBG_PRIM_ERROR ); - IS_VAR_SET( DBG_PRIM_ALL ); - - IS_VAR_SET( DBG_TXT_INFO ); - IS_VAR_SET( DBG_TXT_WARN ); - IS_VAR_SET( DBG_TXT_PROFILE ); - IS_VAR_SET( DBG_TXT_ERROR ); - IS_VAR_SET( DBG_TXT_ALL ); - - IS_VAR_SET( DBG_ALL_INFO ); - IS_VAR_SET( DBG_ALL_WARN ); - IS_VAR_SET( DBG_ALL_PROFILE ); - IS_VAR_SET( DBG_ALL_ERROR ); - IS_VAR_SET( DBG_ALL ); - -#undef IS_VAR_SET -} -/*===========================================================================*/ -/* This function will take a pointer to a DDSURFACEDESC2 structure & display*/ -/* the parsed information using a DPF call. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf ) -{ - char buffer[256]; - - /* Parse the flag type and write the string equivalent. */ - if ( pddpf->dwFlags & DDPF_ALPHA ) - strcat( buffer, "DDPF_ALPHA " ); - if ( pddpf->dwFlags & DDPF_ALPHAPIXELS ) - strcat( buffer, "DDPF_ALPHAPIXELS " ); - if ( pddpf->dwFlags & DDPF_ALPHAPREMULT ) - strcat( buffer, "DDPF_ALPHAPREMULT " ); - if ( pddpf->dwFlags & DDPF_BUMPLUMINANCE ) - strcat( buffer, "DDPF_BUMPLUMINANCE " ); - if ( pddpf->dwFlags & DDPF_BUMPDUDV ) - strcat( buffer, "DDPF_BUMPDUDV " ); - if ( pddpf->dwFlags & DDPF_COMPRESSED ) - strcat( buffer, "DDPF_COMPRESSED " ); - if ( pddpf->dwFlags & DDPF_FOURCC ) - strcat( buffer, "DDPF_FOURCC " ); - if ( pddpf->dwFlags & DDPF_LUMINANCE ) - strcat( buffer, "DDPF_LUMINANCE " ); - if ( pddpf->dwFlags & DDPF_PALETTEINDEXED1 ) - strcat( buffer, "DDPF_PALETTEINDEXED1 " ); - if ( pddpf->dwFlags & DDPF_PALETTEINDEXED2 ) - strcat( buffer, "DDPF_PALETTEINDEXED2 " ); - if ( pddpf->dwFlags & DDPF_PALETTEINDEXED4 ) - strcat( buffer, "DDPF_PALETTEINDEXED4 " ); - if ( pddpf->dwFlags & DDPF_PALETTEINDEXED8 ) - strcat( buffer, "DDPF_PALETTEINDEXED8 " ); - if ( pddpf->dwFlags & DDPF_PALETTEINDEXEDTO8 ) - strcat( buffer, "DDPF_PALETTEINDEXEDTO8 " ); - if ( pddpf->dwFlags & DDPF_RGB ) - strcat( buffer, "DDPF_RGB " ); - if ( pddpf->dwFlags & DDPF_RGBTOYUV ) - strcat( buffer, "DDPF_RGBTOYUV " ); - if ( pddpf->dwFlags & DDPF_STENCILBUFFER ) - strcat( buffer, "DDPF_STENCILBUFFER " ); - if ( pddpf->dwFlags & DDPF_YUV ) - strcat( buffer, "DDPF_YUV " ); - if ( pddpf->dwFlags & DDPF_ZBUFFER ) - strcat( buffer, "DDPF_ZBUFFER " ); - if ( pddpf->dwFlags & DDPF_ZPIXELS ) - strcat( buffer, "DDPF_ZPIXELS " ); - - DPF(( (DBG_TXT_INFO|DBG_CNTX_INFO),"%s", buffer )); -} - - - - - diff --git a/src/mesa/drivers/d3d/DEBUG.H b/src/mesa/drivers/d3d/DEBUG.H deleted file mode 100644 index daeeb72278..0000000000 --- a/src/mesa/drivers/d3d/DEBUG.H +++ /dev/null @@ -1,90 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#ifndef _DEBUG_H -#define _DEBUG_H - -#ifdef __cplusplus -extern "C" { -#endif - -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include -#include -#include -#include -#include "D3DShared.h" -/*===========================================================================*/ -/* Magic numbers. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Macros defines. */ -/*===========================================================================*/ -#define DBG_FUNC 0x00000001 -#define DBG_STATES 0x00000002 - -#define DBG_CNTX_INFO 0x00000010 -#define DBG_CNTX_WARN 0x00000020 -#define DBG_CNTX_PROFILE 0x00000040 -#define DBG_CNTX_ERROR 0x00000080 -#define DBG_CNTX_ALL 0x000000F0 - -#define DBG_PRIM_INFO 0x00000100 -#define DBG_PRIM_WARN 0x00000200 -#define DBG_PRIM_PROFILE 0x00000400 -#define DBG_PRIM_ERROR 0x00000800 -#define DBG_PRIM_ALL 0x00000F00 - -#define DBG_TXT_INFO 0x00001000 -#define DBG_TXT_WARN 0x00002000 -#define DBG_TXT_PROFILE 0x00004000 -#define DBG_TXT_ERROR 0x00008000 -#define DBG_TXT_ALL 0x0000F000 - -#define DBG_ALL_INFO 0x11111110 -#define DBG_ALL_WARN 0x22222220 -#define DBG_ALL_PROFILE 0x44444440 -#define DBG_ALL_ERROR 0x88888880 -#define DBG_ALL 0xFFFFFFFF - -#ifdef D3D_DEBUG -# define DPF(arg) DebugPrint arg -# define RIP(pH,msg,err) OutputDebugString(msg); \ - OutputDebugString(err); \ - OutputDebugString("\n"); \ - FatalShutDown(pH) -#else -# define DPF(arg) -# define RIP(pH,msg,err) FatalShutDown(pH) -#endif -/*===========================================================================*/ -/* Type defines. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Function prototypes. */ -/*===========================================================================*/ -extern void ReadDBGEnv( void ); -extern void _cdecl DebugPrint( int mask, char *pszFormat, ... ); -extern void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf ); -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ -extern DWORD g_DBGMask; - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/src/mesa/drivers/d3d/DbgEnv.bat b/src/mesa/drivers/d3d/DbgEnv.bat deleted file mode 100644 index acea045856..0000000000 --- a/src/mesa/drivers/d3d/DbgEnv.bat +++ /dev/null @@ -1,25 +0,0 @@ -SET DBG_FUNC=FALSE - -SET DBG_CNTX_INFO=TRUE -SET DBG_CNTX_WARN=TRUE -SET DBG_CNTX_PROFILE=FALSE -SET DBG_CNTX_ERROR=TRUE -SET DBG_CNTX_ALL=TRUE - -SET DBG_PRIM_INFO=FALSE -SET DBG_PRIM_WARN=FALSE -SET DBG_PRIM_PROFILE=FALSE -SET DBG_PRIM_ERROR=TRUE -SET DBG_PRIM_ALL=FALSE - -SET DBG_TXT_INFO=FALSE -SET DBG_TXT_WARN=TRUE -SET DBG_TXT_PROFILE=FALSE -SET DBG_TXT_ERROR=TRUE -SET DBG_TXT_ALL=FALSE - -SET DBG_ALL_INFO=FALSE -SET DBG_ALL_WARN=TRUE -SET DBG_ALL_PROFILE=FALSE -SET DBG_ALL_ERROR=TRUE -SET DBG_ALL=FALSE diff --git a/src/mesa/drivers/d3d/MAKEFILE b/src/mesa/drivers/d3d/MAKEFILE deleted file mode 100644 index 6aa88f3cef..0000000000 --- a/src/mesa/drivers/d3d/MAKEFILE +++ /dev/null @@ -1,101 +0,0 @@ -############################################################################## -# -# Mesa-3.0 Makefile for DirectX 6 Driver -# -# By Leigh McRae -# -# http://www.altsoftware.com/ -# -# Copyright (c) 1999-1998 alt.software inc. All Rights Reserved -############################################################################## -NAME= -TARGET= WGL Driver (D3DHAL) - -D3D_DIR=$(MAKEDIR)\D3D -TARGET_DIR=e:\WinNT\System32 -TEMP_DIR=c:\Temp - -SPACE=- -LINKER=link.exe - -INCLUDE=$(SDKROOT)\include;$(INCLUDE) -LIB=$(SDKROOT)\lib;$(LIB) -############################################################################## -CFLAGS = /c /nologo /W1 /G5 /I..\ /I..\..\Include \ - /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D" -CPPFLAGS= /c /nologo /W1 /G5 /I..\ /I..\..\Include \ - /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D" - -!IF "$(DEBUG)" == "1" - -CFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CFLAGS) -CPPFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CPPFLAGS) -BUILD_TYPE=debug - -!ELSE - -CFLAGS = /MT /Ox /D "NDEBUG" $(CFLAGS) -CPPFLAGS = /MT /Ox /D "NDEBUG" $(CPPFLAGS) -BUILD_TYPE=release - -!ENDIF -############################################################################## -SRCS_WGL = wgl.c D3Dvbrender.c DDrawPROCS.c NULLProcs.c Debug.c -SRCS_HAL = D3DInit.cpp D3DRaster.cpp D3DTextureMgr.cpp D3DUtils.cpp D3DCaps.cpp -OBJS_WGL = $(SRCS_WGL:.c=.obj) -OBJS_HAL = $(SRCS_HAL:.cpp=.obj) - -WINLIBS = kernel32.lib user32.lib gdi32.lib oldnames.lib -DXLIBS = -LIBS = $(WINLIBS) $(DXLIBS) -############################################################################### -# Primary Targets # -############################################################################### - -default: header WGL HAL footer - -all: default - -WGL : $(OBJS_WGL) - -HAL : $(OBJS_HAL) - -install : forceit - @echo $(SPACE) - @echo ======================================== - @echo Install files created. - @echo ======================================== - - -############################################################################### -# Secondary Targets # -############################################################################### - -clean: - @echo ======================================== - @echo Cleaning $(TARGET) - @del *.obj - @del *.dep - @del *.exp - @del *.ncb - @del *.plg - @del *.lib - @echo ======================================== - -header: - @echo ============================================================ - @echo Building $(TARGET) ($(BUILD_TYPE) version) - @echo ============================================================ - @echo $(SPACE) - -footer: - @echo $(SPACE) - @echo ============================================================ - @echo DONE building $(TARGET) ($(BUILD_TYPE) version) - @echo ============================================================ - -forceit: - - - - diff --git a/src/mesa/drivers/d3d/NULLProcs.h b/src/mesa/drivers/d3d/NULLProcs.h deleted file mode 100644 index f0bbd2162d..0000000000 --- a/src/mesa/drivers/d3d/NULLProcs.h +++ /dev/null @@ -1,49 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#ifndef NULL_MESA_PROCS_INC -#define NULL_MESA_PROCS_INC -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include "matrix.h" -#include "context.h" -#include "types.h" -#include "vb.h" -/*===========================================================================*/ -/* Macros. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Magic numbers. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Type defines. */ -/*===========================================================================*/ -void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); -void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); -GLboolean NULLSetBuffer( GLcontext *ctx, GLenum mode ); -void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ); -GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h ); -void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] ); -void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] ); -void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] ); -void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] ); -void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] ); -void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] ); -void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] ); -/*===========================================================================*/ -/* Extern function prototypes. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ - -#endif - diff --git a/src/mesa/drivers/d3d/NullProcs.c b/src/mesa/drivers/d3d/NullProcs.c deleted file mode 100644 index d6fb598074..0000000000 --- a/src/mesa/drivers/d3d/NullProcs.c +++ /dev/null @@ -1,49 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 DirectX 6 Driver */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#ifndef NULL_MESA_PROCS_INC -#define NULL_MESA_PROCS_INC -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include "matrix.h" -#include "context.h" -#include "mtypes.h" -#include "vb.h" -/*===========================================================================*/ -/* Macros. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Magic numbers. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Type defines. */ -/*===========================================================================*/ -void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); -void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); -GLboolean NULLSetBuffer( GLcontext *ctx, GLframebuffer *buffer, GLuint bit ); -void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ); -GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h ); -void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] ); -void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] ); -void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] ); -void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] ); -void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] ); -void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] ); -void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] ); -/*===========================================================================*/ -/* Extern function prototypes. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ - -#endif - diff --git a/src/mesa/drivers/d3d/OPENGL32.DEF b/src/mesa/drivers/d3d/OPENGL32.DEF deleted file mode 100644 index bc0304da33..0000000000 --- a/src/mesa/drivers/d3d/OPENGL32.DEF +++ /dev/null @@ -1,442 +0,0 @@ -;=========================================================================== -; -; Mesa-3.0 DirectX 6 Driver -; -; By Leigh McRae -; -; http://www.altsoftware.com/ -; -; Copyright (c) 1999-1998 alt.software inc. All Rights Reserved -;=========================================================================== -NAME OpenGL32.DLL -DESCRIPTION "Mesa-3.0 DX6 Driver Version 0.5" - -EXPORTS - DllMain - glAccum - glAlphaFunc - glAreTexturesResident - glAreTexturesResidentEXT - glArrayElement - glArrayElementEXT - glBegin - glBindTexture - glBindTextureEXT - glBitmap - glBlendColorEXT - glBlendEquationEXT - glBlendFunc - glCallList - glCallLists - glClear - glClearAccum - glClearColor - glClearDepth - glClearIndex - glClearStencil - glClipPlane - glColor3b - glColor3bv - glColor3d - glColor3dv - glColor3f - glColor3fv - glColor3i - glColor3iv - glColor3s - glColor3sv - glColor3ub - glColor3ubv - glColor3ui - glColor3uiv - glColor3us - glColor3usv - glColor4b - glColor4bv - glColor4d - glColor4dv - glColor4f - glColor4fv - glColor4i - glColor4iv - glColor4s - glColor4sv - glColor4ub - glColor4ubv - glColor4ui - glColor4uiv - glColor4us - glColor4usv - glColorMask - glColorMaterial - glColorPointer - glColorPointerEXT - glColorSubTableEXT - glColorTableEXT - glCopyPixels - glCopyTexImage1D - glCopyTexImage2D - glCopyTexSubImage1D - glCopyTexSubImage2D - glCopyTexSubImage3DEXT - glCullFace - glDeleteLists - glDeleteTextures - glDeleteTexturesEXT - glDepthFunc - glDepthMask - glDepthRange - glDisable - glDisableClientState - glDrawArrays - glDrawArraysEXT - glDrawBuffer - glDrawElements - glDrawPixels - glEdgeFlag - glEdgeFlagPointer - glEdgeFlagPointerEXT - glEdgeFlagv - glEnable - glEnableClientState - glEnd - glEndList - glEvalCoord1d - glEvalCoord1dv - glEvalCoord1f - glEvalCoord1fv - glEvalCoord2d - glEvalCoord2dv - glEvalCoord2f - glEvalCoord2fv - glEvalMesh1 - glEvalMesh2 - glEvalPoint1 - glEvalPoint2 - glFeedbackBuffer - glFinish - glFlush - glFogf - glFogfv - glFogi - glFogiv - glFrontFace - glFrustum - glGenLists - glGenTextures - glGenTexturesEXT - glGetBooleanv - glGetClipPlane - glGetColorTableEXT - glGetColorTableParameterfvEXT - glGetColorTableParameterivEXT - glGetDoublev - glGetError - glGetFloatv - glGetIntegerv - glGetLightfv - glGetLightiv - glGetMapdv - glGetMapfv - glGetMapiv - glGetMaterialfv - glGetMaterialiv - glGetPixelMapfv - glGetPixelMapuiv - glGetPixelMapusv - glGetPointerv - glGetPointervEXT - glGetPolygonStipple - glGetString - glGetTexEnvfv - glGetTexEnviv - glGetTexGendv - glGetTexGenfv - glGetTexGeniv - glGetTexImage - glGetTexLevelParameterfv - glGetTexLevelParameteriv - glGetTexParameterfv - glGetTexParameteriv - glHint - glIndexd - glIndexdv - glIndexf - glIndexfv - glIndexi - glIndexiv - glIndexMask - glIndexPointer - glIndexPointerEXT - glIndexs - glIndexsv - glIndexub - glIndexubv - glInitNames - glInterleavedArrays - glIsEnabled - glIsList - glIsTexture - glIsTextureEXT - glLightf - glLightfv - glLighti - glLightiv - glLightModelf - glLightModelfv - glLightModeli - glLightModeliv - glLineStipple - glLineWidth - glListBase - glLoadIdentity - glLoadMatrixd - glLoadMatrixf - glLoadName - glLogicOp - glMap1d - glMap1f - glMap2d - glMap2f - glMapGrid1d - glMapGrid1f - glMapGrid2d - glMapGrid2f - glMaterialf - glMaterialfv - glMateriali - glMaterialiv - glMatrixMode - glMultMatrixd - glMultMatrixf - glNewList - glNormal3b - glNormal3bv - glNormal3d - glNormal3dv - glNormal3f - glNormal3fv - glNormal3i - glNormal3iv - glNormal3s - glNormal3sv - glNormalPointer - glNormalPointerEXT - glOrtho - glPassThrough - glPixelMapfv - glPixelMapuiv - glPixelMapusv - glPixelStoref - glPixelStorei - glPixelTransferf - glPixelTransferi - glPixelZoom - glPointParameterfEXT - glPointParameterfvEXT - glPointSize - glPolygonMode - glPolygonOffset - glPolygonOffsetEXT - glPolygonStipple - glPopAttrib - glPopClientAttrib - glPopMatrix - glPopName - glPrioritizeTextures - glPrioritizeTexturesEXT - glPushAttrib - glPushClientAttrib - glPushMatrix - glPushName - glRasterPos2d - glRasterPos2dv - glRasterPos2f - glRasterPos2fv - glRasterPos2i - glRasterPos2iv - glRasterPos2s - glRasterPos2sv - glRasterPos3d - glRasterPos3dv - glRasterPos3f - glRasterPos3fv - glRasterPos3i - glRasterPos3iv - glRasterPos3s - glRasterPos3sv - glRasterPos4d - glRasterPos4dv - glRasterPos4f - glRasterPos4fv - glRasterPos4i - glRasterPos4iv - glRasterPos4s - glRasterPos4sv - glReadBuffer - glReadPixels - glRectd - glRectdv - glRectf - glRectfv - glRecti - glRectiv - glRects - glRectsv - glRenderMode - glResizeBuffersMESA - glRotated - glRotatef - glScaled - glScalef - glScissor - glSelectBuffer - glShadeModel - glStencilFunc - glStencilMask - glStencilOp - glTexCoord1d - glTexCoord1dv - glTexCoord1f - glTexCoord1fv - glTexCoord1i - glTexCoord1iv - glTexCoord1s - glTexCoord1sv - glTexCoord2d - glTexCoord2dv - glTexCoord2f - glTexCoord2fv - glTexCoord2i - glTexCoord2iv - glTexCoord2s - glTexCoord2sv - glTexCoord3d - glTexCoord3dv - glTexCoord3f - glTexCoord3fv - glTexCoord3i - glTexCoord3iv - glTexCoord3s - glTexCoord3sv - glTexCoord4d - glTexCoord4dv - glTexCoord4f - glTexCoord4fv - glTexCoord4i - glTexCoord4iv - glTexCoord4s - glTexCoord4sv - glTexCoordPointer - glTexCoordPointerEXT - glTexEnvf - glTexEnvfv - glTexEnvi - glTexEnviv - glTexGend - glTexGendv - glTexGenf - glTexGenfv - glTexGeni - glTexGeniv - glTexImage1D - glTexImage2D - glTexImage3DEXT - glTexParameterf - glTexParameterfv - glTexParameteri - glTexParameteriv - glTexSubImage1D - glTexSubImage2D - glTexSubImage3DEXT - glTranslated - glTranslatef - glVertex2d - glVertex2dv - glVertex2f - glVertex2fv - glVertex2i - glVertex2iv - glVertex2s - glVertex2sv - glVertex3d - glVertex3dv - glVertex3f - glVertex3fv - glVertex3i - glVertex3iv - glVertex3s - glVertex3sv - glVertex4d - glVertex4dv - glVertex4f - glVertex4fv - glVertex4i - glVertex4iv - glVertex4s - glVertex4sv - glVertexPointer - glVertexPointerEXT - glViewport - glWindowPos2dMESA - glWindowPos2dvMESA - glWindowPos2fMESA - glWindowPos2fvMESA - glWindowPos2iMESA - glWindowPos2ivMESA - glWindowPos2sMESA - glWindowPos2svMESA - glWindowPos3dMESA - glWindowPos3dvMESA - glWindowPos3fMESA - glWindowPos3fvMESA - glWindowPos3iMESA - glWindowPos3ivMESA - glWindowPos3sMESA - glWindowPos3svMESA - glWindowPos4dMESA - glWindowPos4dvMESA - glWindowPos4fMESA - glWindowPos4fvMESA - glWindowPos4iMESA - glWindowPos4ivMESA - glWindowPos4sMESA - glWindowPos4svMESA -; WMesaCreateContext -; WMesaDestroyContext -; WMesaMakeCurrent -; WMesaPaletteChange -; WMesaSwapBuffers -; OSMesaCreateContext -; OSMesaDestroyContext -; OSMesaMakeCurrent -; OSMesaGetCurrentContext -; OSMesaPixelStore -; OSMesaGetIntegerv -; OSMesaGetDepthBuffer - wglCopyContext - wglCreateContext - wglCreateLayerContext - wglDeleteContext -; wglDescribeLayerPlane - wglGetCurrentContext - wglGetCurrentDC -; wglGetLayerPaletteEntries - wglGetProcAddress - wglMakeCurrent -; wglRealizeLayerPalette -; wglSetLayerPaletteEntries - wglShareLists - wglSwapLayerBuffers - wglUseFontBitmapsA - wglUseFontBitmapsW - wglUseFontOutlinesA - wglUseFontOutlinesW - wglChoosePixelFormat - wglDescribePixelFormat - wglGetPixelFormat - wglSetPixelFormat - wglSwapBuffers - - - diff --git a/src/mesa/drivers/d3d/WGL.C b/src/mesa/drivers/d3d/WGL.C deleted file mode 100644 index 170d094ed4..0000000000 --- a/src/mesa/drivers/d3d/WGL.C +++ /dev/null @@ -1,1262 +0,0 @@ -/*===========================================================================*/ -/* */ -/* Mesa-3.0 Makefile for DirectX 6 */ -/* */ -/* By Leigh McRae */ -/* */ -/* http://www.altsoftware.com/ */ -/* */ -/* Copyright (c) 1998-1997 alt.software inc. All Rights Reserved */ -/*===========================================================================*/ -#include "D3DMesa.h" -/*===========================================================================*/ -/* Window managment. */ -/*===========================================================================*/ -static BOOL InitOpenGL( HINSTANCE hInst ); -static BOOL TermOpenGL( HINSTANCE hInst ); -static BOOL ResizeContext( GLcontext *ctx ); -static BOOL MakeCurrent( D3DMESACONTEXT *pContext ); -static void DestroyContext( D3DMESACONTEXT *pContext ); -static BOOL UnBindWindow( D3DMESACONTEXT *pContext ); -LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam ); -/*===========================================================================*/ -/* Mesa hooks. */ -/*===========================================================================*/ -static void SetupDDPointers( GLcontext *ctx ); -static void SetupSWDDPointers( GLcontext *ctx ); -static void SetupHWDDPointers( GLcontext *ctx ); -static void SetupNULLDDPointers( GLcontext *ctx ); -static const char *RendererString( void ); - -/* State Management hooks. */ -static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); -static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); -static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer ); - -/* Window Management hooks. */ -static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ); -static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ); -static void Flush( GLcontext *ctx ); - -/* Span rendering hooks. */ -void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] ); -void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); -void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] ); -void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); -void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] ); -void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); -void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); -GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); - -/* Primitve rendering hooks. */ -GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone ); -void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ); -void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); -GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); - -/* Texture Management hooks. */ -static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ); -static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image ); -static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image ); -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ -D3DMESACONTEXT *pD3DCurrent, - *pD3DDefault; /* Thin support context. */ - -struct __extensions__ ext[] = { - - { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" }, - { (PROC)glBlendEquationEXT, "glBlendEquationEXT" }, - { (PROC)glBlendColorEXT, "glBlendColorExt" }, - { (PROC)glVertexPointerEXT, "glVertexPointerEXT" }, - { (PROC)glNormalPointerEXT, "glNormalPointerEXT" }, - { (PROC)glColorPointerEXT, "glColorPointerEXT" }, - { (PROC)glIndexPointerEXT, "glIndexPointerEXT" }, - { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" }, - { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" }, - { (PROC)glGetPointervEXT, "glGetPointervEXT" }, - { (PROC)glArrayElementEXT, "glArrayElementEXT" }, - { (PROC)glDrawArraysEXT, "glDrawArrayEXT" }, - { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" }, - { (PROC)glBindTextureEXT, "glBindTextureEXT" }, - { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" }, - { (PROC)glGenTexturesEXT, "glGenTexturesEXT" }, - { (PROC)glIsTextureEXT, "glIsTextureEXT" }, - { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" }, - { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" }, - { (PROC)glTexImage3DEXT, "glTexImage3DEXT" }, - { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" }, -}; - -int qt_ext = sizeof(ext) / sizeof(ext[0]); -float g_DepthScale, - g_MaxDepth; -/*===========================================================================*/ -/* When a process loads this DLL we will setup the linked list for context */ -/* management and create a default context that will support the API until */ -/* the user creates and binds thier own. This THIN default context is useful*/ -/* to have around. */ -/* When the process terminates we will clean up all resources here. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY DllMain( HINSTANCE hInst, DWORD reason, LPVOID reserved ) -{ - switch( reason ) - { - case DLL_PROCESS_ATTACH: - return InitOpenGL( hInst ); - - case DLL_PROCESS_DETACH: - return TermOpenGL( hInst ); - } - - return TRUE; -} -/*===========================================================================*/ -/* The first thing we do when this dll is hit is connect to the dll that has*/ -/* handles all the DirectX 6 rendering. I decided to use another dll as DX6 */ -/* is all C++ and Mesa-3.0 is C (thats a good thing). This way I can write */ -/* the DX6 in C++ and Mesa-3.0 in C without having to worry about linkage. */ -/* I feel this is easy and better then using static wrappers as it is likely */ -/* faster and it allows me to just develope the one without compiling the */ -/* other. */ -/* NOTE that at this point we don't have much other than a very thin context*/ -/* that will support the API calls only to the point of not causing the app */ -/* to crash from the API table being empty. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -static BOOL InitOpenGL( HINSTANCE hInst ) -{ - /* Allocate and clear the default context. */ - pD3DDefault = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) ); - if ( pD3DDefault == NULL ) - return FALSE; - memset( pD3DDefault, 0, sizeof(D3DMESACONTEXT) ); - - /* Clear the D3D vertex buffer so that values not used will be zero. This */ - /* save me from some redundant work. */ - memset( &D3DTLVertices, 0, sizeof(D3DTLVertices) ); - - /* Update the link. We uses a circular list so that it is easy to */ - /* add and search. This context will also be used for head and tail.*/ - pD3DDefault->next = pD3DDefault; - - /*========================================================================*/ - /* Do all core Mesa stuff. */ - /*========================================================================*/ - pD3DDefault->gl_visual = _mesa_create_visual( TRUE, - FALSE, /* db_flag */ - GL_FALSE, /* stereo */ - 8,8,8,8, /* r, g, b, a bits */ - 0, /* index bits */ - 16, /* depth_bits */ - 8, /* stencil_bits */ - 8,8,8,8, /* accum_bits */ - 1 ); - - if ( pD3DDefault->gl_visual == NULL) - { - FREE( pD3DDefault ); - return FALSE; - } - - /* Allocate a new Mesa context */ - pD3DDefault->gl_ctx = _mesa_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE ); - if ( pD3DDefault->gl_ctx == NULL ) - { - _mesa_destroy_visual( pD3DDefault->gl_visual ); - FREE( pD3DDefault ); - return FALSE; - } - - /* Allocate a new Mesa frame buffer */ - pD3DDefault->gl_buffer = _mesa_create_framebuffer( pD3DDefault->gl_visual ); - if ( pD3DDefault->gl_buffer == NULL ) - { - _mesa_destroy_visual( pD3DDefault->gl_visual ); - _mesa_destroy_context( pD3DDefault->gl_ctx ); - FREE( pD3DDefault ); - return FALSE; - } - SetupDDPointers( pD3DDefault->gl_ctx ); - _mesa_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer ); - - return TRUE; -} -/*===========================================================================*/ -/* This function will create a new D3D context but will not create the D3D */ -/* surfaces or even an instance of D3D (see at GetBufferSize). The only stuff*/ -/* done here is the internal Mesa stuff and some Win32 handles. */ -/*===========================================================================*/ -/* RETURN: casted pointer to the context, NULL. */ -/*===========================================================================*/ -HGLRC APIENTRY wglCreateContext( HDC hdc ) -{ - D3DMESACONTEXT *pNewContext; - DWORD dwCoopFlags = DDSCL_NORMAL; - RECT rectClient; - POINT pt; - - /* ALLOC and clear the new context. */ - pNewContext = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) ); - if ( pNewContext == NULL ) - { - SetLastError( 0 ); - return (HGLRC)NULL; - } - memset( pNewContext, 0, sizeof(D3DMESACONTEXT) ); - - /*========================================================================*/ - /* Do all core Mesa stuff. */ - /*========================================================================*/ - - /* TODO: support more then one visual. */ - pNewContext->gl_visual = _mesa_create_visual( TRUE, - TRUE, /* db_flag */ - GL_FALSE, /* stereo */ - 8,8,8,8, /* r, g, b, a bits */ - 0, /* index bits */ - 16, /* depth_bits */ - 8, /* stencil_bits */ - 16,16,16,16,/* accum_bits */ - 1 ); - if ( pNewContext->gl_visual == NULL) - { - FREE( pNewContext ); - SetLastError( 0 ); - return (HGLRC)NULL; - } - - /* Allocate a new Mesa context */ - pNewContext->gl_ctx = _mesa_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE ); - if ( pNewContext->gl_ctx == NULL ) - { - _mesa_destroy_visual( pNewContext->gl_visual ); - FREE( pNewContext ); - SetLastError( 0 ); - return (HGLRC)NULL; - } - - /* Allocate a new Mesa frame buffer */ - pNewContext->gl_buffer = _mesa_create_framebuffer( pNewContext->gl_visual ); - if ( pNewContext->gl_buffer == NULL ) - { - _mesa_destroy_visual( pNewContext->gl_visual ); - _mesa_destroy_context( pNewContext->gl_ctx ); - FREE( pNewContext ); - SetLastError( 0 ); - return (HGLRC)NULL; - } - - /*========================================================================*/ - /* Do all the driver stuff. */ - /*========================================================================*/ - pNewContext->hdc = hdc; - pNewContext->next = pD3DDefault->next; - pD3DDefault->next = pNewContext; /* Add to circular list. */ - - /* Create the HAL for the new context. */ - pNewContext->pShared = InitHAL( WindowFromDC(hdc) ); - - return (HGLRC)pNewContext; -} -/*===========================================================================*/ -/* This is a wrapper function that is supported by MakeCurrent. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglMakeCurrent( HDC hdc, HGLRC hglrc ) -{ - return MakeCurrent((D3DMESACONTEXT *)hglrc); -} -/*===========================================================================*/ -/* MakeCurrent will unbind whatever context is current (if any) & then bind */ -/* the supplied context. A context that is bound has it's window proc hooked*/ -/* with the wglMonitorProc and the context pointer is saved in pD3DCurrent. */ -/* Once the context is bound we update the Mesa-3.0 hooks (SetDDPointers) and*/ -/* the viewport (Mesa-.30 and DX6). */ -/* */ -/* TODO: this function can't fail. */ -/*===========================================================================*/ -/* RETURN: TRUE */ -/*===========================================================================*/ -static BOOL MakeCurrent( D3DMESACONTEXT *pContext ) -{ - D3DMESACONTEXT *pNext; - - /*====================================================================*/ - /* This is a special case that is a request to have no context bound. */ - /*====================================================================*/ - if ( pContext == NULL ) - { - /* Walk the whole list. We start and end at the Default context. */ - for( pNext = pD3DDefault->next; pNext != pD3DDefault; pNext = pNext->next ) - UnBindWindow( pNext ); - - return TRUE; - } - - /*=================================================*/ - /* Make for a fast redundant use of this function. */ - /*=================================================*/ - if ( pD3DCurrent == pContext ) - return TRUE; - - /*=============================*/ - /* Unbind the current context. */ - /*=============================*/ - UnBindWindow( pD3DCurrent ); - - /*=====================================*/ - /* Let Mesa-3.0 we have a new context. */ - /*=====================================*/ - SetupDDPointers( pContext->gl_ctx ); - _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer ); - - /* We are done so set the internal current context. */ - if ( pContext != pD3DDefault ) - { - ResizeContext( pContext->gl_ctx ); - pContext->hOldProc = (WNDPROC)GetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC ); - SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)wglMonitorProc ); - } - pD3DCurrent = pContext; - - return TRUE; -} -/*===========================================================================*/ -/* This function will only return the current window size. I have re-done */ -/* this function so that it doesn't check the current size and react to it as*/ -/* I should be able to have all the react code in the WM_SIZE message. The */ -/* old version would check the current window size and create/resize the HAL */ -/* surfaces if they have changed. I needed to delay the creation if the */ -/* surfaces because sometimes I wouldn't have a window size so this is where */ -/* I delayed it. If you are reading this then all went ok! */ -/* The default context will return a zero sized window and I'm not sure if */ -/* this is ok at this point (TODO). */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - /* Fall through for the default because that is one of the uses for it. */ - if ( pContext == pD3DDefault ) - { - *width = 0; - *height = 0; - } - else - { - *width = pContext->pShared->dwWidth; - *height = pContext->pShared->dwHeight; - } -} -/*===========================================================================*/ -/* */ -/* */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static BOOL ResizeContext( GLcontext *ctx ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx, - *pCurrentTemp; - RECT rectClient; - POINT pt; - DWORD dwWidth, - dwHeight; - static BOOL bDDrawLock = FALSE; - - /* Make sure we have some values. */ - if ( (pContext->hdc == NULL ) || - (pContext->pShared->hwnd != WindowFromDC(pContext->hdc)) || - (pContext == pD3DDefault) ) - return FALSE; - - /* Having problems with DDraw sending resize messages before I was done. */ - if( bDDrawLock == TRUE ) - return FALSE; - - // TODO: don't think I need this anymore. - pCurrentTemp = pD3DCurrent; - pD3DCurrent = pD3DDefault; - bDDrawLock = TRUE; - - /* Get the current window dimentions. */ - UpdateScreenPosHAL( pContext->pShared ); - dwWidth = pContext->pShared->rectW.right - pContext->pShared->rectW.left; - dwHeight = pContext->pShared->rectW.bottom - pContext->pShared->rectW.top; - - /* Is the size of the OffScreen Render different? */ - if ( (dwWidth != pContext->pShared->dwWidth) || (dwHeight != pContext->pShared->dwHeight) ) - { - /* Create all the D3D surfaces and device. */ - CreateHAL( pContext->pShared ); - - /* I did this so that software rendering would still work as */ - /* I don't need to scale the z values twice. */ - g_DepthScale = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF); - g_MaxDepth = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF); - gl_DepthRange( pContext->gl_ctx, ctx->Viewport.Near, ctx->Viewport.Far ); - - /* Make sure we have a viewport. */ - gl_Viewport( pContext->gl_ctx, 0, 0, dwWidth, dwHeight ); - - /* Update Mesa as we might have changed from SW <-> HW. */ - SetupDDPointers( pContext->gl_ctx ); - _mesa_make_current( pContext->gl_ctx, pContext->gl_buffer ); - - /* If we are in HW we need to load the current texture if there is one already. */ - // if ( (ctx->Texture.Set[ctx->Texture.CurrentSet].Current != NULL) && - // (pContext->pShared->bHardware == TRUE) ) - // { - // CreateTMgrHAL( pContext->pShared, - // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name, - // 0, - // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format, - // (RECT *)NULL, - // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Width, - // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Height, - // TM_ACTION_BIND, - // (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Data ); - // } - } - - // TODO: don't think I need this anymore. - pD3DCurrent = pCurrentTemp; - bDDrawLock = FALSE; - - return TRUE; -} - -/*===========================================================================* -/* This function will Blt the render buffer to the PRIMARY surface. I repeat*/ -/* this code for the other SwapBuffer like functions and the flush (didn't */ -/* want the function calling overhead). Thsi could have been a macro... */ -/* */ -/* TODO: there are some problems with viewport/scissoring. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglSwapBuffers( HDC hdc ) -{ - /* Fall through for the default because that is one of the uses for it. */ - if ( pD3DCurrent == pD3DDefault ) - return FALSE; - - SwapBuffersHAL( pD3DCurrent->pShared ); - - return TRUE; -} -/*===========================================================================*/ -/* Same as wglSwapBuffers. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY SwapBuffers( HDC hdc ) -{ - /* Fall through for the default because that is one of the uses for it. */ - if ( pD3DCurrent == pD3DDefault ) - return FALSE; - - SwapBuffersHAL( pD3DCurrent->pShared ); - - return TRUE; -} -/*===========================================================================*/ -/* This should be ok as none of the SwapBuffers will cause a redundant Blt */ -/* as none of my Swap functions will call flush. This should also allow */ -/* sinlge buffered applications to work (not really worried though). Some */ -/* applications may flush then swap but then this is there fault IMHO. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void Flush( GLcontext *ctx ) -{ - /* Fall through for the default because that is one of the uses for it. */ - if ( pD3DCurrent == pD3DDefault ) - return; - - SwapBuffersHAL( pD3DCurrent->pShared ); -} -/*===========================================================================*/ -/* For now this function will ignore the supplied PF. If I'm going to allow */ -/* the user to choice the mode and device at startup I'm going to have to do */ -/* something different. */ -/* */ -/* TODO: use the linked list of modes to build a pixel format to be returned */ -/* to the caller. */ -/*===========================================================================*/ -/* RETURN: 1. */ -/*===========================================================================*/ -int APIENTRY wglChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd ) -{ - return 1; -} -/*===========================================================================*/ -/* See wglChoosePixelFormat. */ -/*===========================================================================*/ -/* RETURN: 1. */ -/*===========================================================================*/ -int APIENTRY ChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd ) -{ - return wglChoosePixelFormat(hdc,ppfd); -} -/*===========================================================================*/ -/* This function (for now) returns a static PF everytime. This is just to */ -/* allow things to continue. */ -/*===========================================================================*/ -/* RETURN: 1. */ -/*===========================================================================*/ -int APIENTRY wglDescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd ) -{ - static PIXELFORMATDESCRIPTOR pfd = - { - sizeof(PIXELFORMATDESCRIPTOR), /* size */ - 1, /* version */ - PFD_SUPPORT_OPENGL | - PFD_DRAW_TO_WINDOW | - PFD_DOUBLEBUFFER, /* support double-buffering */ - PFD_TYPE_RGBA, /* color type */ - 16, /* prefered color depth */ - 0, 0, 0, 0, 0, 0, /* color bits (ignored) */ - 0, /* no alpha buffer */ - 0, /* alpha bits (ignored) */ - 0, /* no accumulation buffer */ - 0, 0, 0, 0, /* accum bits (ignored) */ - 16, /* depth buffer */ - 0, /* no stencil buffer */ - 0, /* no auxiliary buffers */ - PFD_MAIN_PLANE, /* main layer */ - 0, /* reserved */ - 0, 0, 0, /* no layer, visible, damage masks */ - }; - - /* Return the address of this static PF if one was requested. */ - if ( ppfd != NULL ) - memcpy( ppfd, &pfd, sizeof(PIXELFORMATDESCRIPTOR) ); - - return 1; -} -/*===========================================================================*/ -/* See wglDescribePixelFormat. */ -/*===========================================================================*/ -/* RETURN: 1. */ -/*===========================================================================*/ -int APIENTRY DescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd ) -{ - return wglDescribePixelFormat(hdc,iPixelFormat,nBytes,ppfd); -} -/*===========================================================================*/ -/* This function will always return 1 for now. Just to allow for support. */ -/*===========================================================================*/ -/* RETURN: 1. */ -/*===========================================================================*/ -int APIENTRY wglGetPixelFormat( HDC hdc ) -{ - return 1; -} -/*===========================================================================*/ -/* See wglGetPixelFormat. */ -/*===========================================================================*/ -/* RETURN: 1. */ -/*===========================================================================*/ -int APIENTRY GetPixelFormat( HDC hdc ) -{ - return wglGetPixelFormat(hdc); -} -/*===========================================================================*/ -/* This will aways work for now. */ -/*===========================================================================*/ -/* RETURN: TRUE. */ -/*===========================================================================*/ -BOOL APIENTRY wglSetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd ) -{ - return TRUE; -} -/*===========================================================================*/ -/* See wglSetPixelFormat. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY SetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd ) -{ - return wglSetPixelFormat(hdc,iPixelFormat,ppfd); -} -/*===========================================================================*/ -/* This is a wrapper function that is supported by my own internal function.*/ -/* that takes my own D3D Mesa context structure. This so I can reuse the */ -/* function (no need for speed). */ -/*===========================================================================*/ -/* RETURN: TRUE. */ -/*===========================================================================*/ -BOOL APIENTRY wglDeleteContext( HGLRC hglrc ) -{ - DestroyContext( (D3DMESACONTEXT *)hglrc ); - - return TRUE; -} -/*===========================================================================*/ -/* Simple getter function that uses a cast. */ -/*===========================================================================*/ -/* RETURN: casted pointer to the context, NULL. */ -/*===========================================================================*/ -HGLRC APIENTRY wglGetCurrentContext( VOID ) -{ - return (pD3DCurrent) ? (HGLRC)pD3DCurrent : (HGLRC)NULL; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) -{ - SetLastError( 0 ); - return FALSE; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: NULL. */ -/*===========================================================================*/ -HGLRC APIENTRY wglCreateLayerContext( HDC hdc,int iLayerPlane ) -{ - SetLastError( 0 ); - return (HGLRC)NULL; -} -/*===========================================================================*/ -/* Simple getter function. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -HDC APIENTRY wglGetCurrentDC( VOID ) -{ - return (pD3DCurrent) ? pD3DCurrent->hdc : (HDC)NULL; -} -/*===========================================================================*/ -/* Simply call that searches the supported extensions for a match & returns */ -/* the pointer to the function that lends support. */ -/*===========================================================================*/ -/* RETURN: pointer to API call, NULL. */ -/*===========================================================================*/ -PROC APIENTRY wglGetProcAddress( LPCSTR lpszProc ) -{ - int index; - - for( index = 0; index < qt_ext; index++ ) - if( !strcmp(lpszProc,ext[index].name) ) - return ext[index].proc; - - SetLastError( 0 ); - return NULL; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglShareLists( HGLRC hglrc1, HGLRC hglrc2 ) -{ - SetLastError( 0 ); - return FALSE; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglUseFontBitmaps( HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase ) -{ - SetLastError( 0 ); - return FALSE; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglUseFontBitmapsW( HDC hdc,DWORD first,DWORD count,DWORD listBase ) -{ - SetLastError( 0 ); - return FALSE; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglUseFontOutlinesA( HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf ) -{ - SetLastError( 0 ); - return FALSE; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglUseFontOutlinesW( HDC hdc,DWORD first,DWORD count, DWORD listBase,FLOAT deviation, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf ) -{ - SetLastError( 0 ); - return FALSE ; -} -/*===========================================================================*/ -/* No support. */ -/*===========================================================================*/ -/* RETURN: FALSE. */ -/*===========================================================================*/ -BOOL APIENTRY wglSwapLayerBuffers( HDC hdc, UINT fuPlanes ) -{ - SetLastError( 0 ); - return FALSE; -} -/*===========================================================================*/ -/* This function will be hooked into the window that has been bound. Right */ -/* now it is used to track the window size and position. Also the we clean */ -/* up the currrent context when the window is close/destroyed. */ -/* */ -/* TODO: there might be something wrong here as some games (Heretic II) don't*/ -/* track the window quit right. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam ) -{ - WNDPROC hOldProc; - GLint width, - height; - - switch( message ) - { -// case WM_PAINT: -// break; -// case WM_ACTIVATE: -// break; -// case WM_SHOWWINDOW: -// break; - - case UM_FATALSHUTDOWN: - /* Support the API until we die... */ - MakeCurrent( pD3DDefault ); - break; - - case WM_MOVE: - case WM_DISPLAYCHANGE: - case WM_SIZE: - ResizeContext( pD3DCurrent->gl_ctx ); - break; - - case WM_CLOSE: - case WM_DESTROY: - /* Support the API until we die... */ - hOldProc = pD3DCurrent->hOldProc; - DestroyContext( pD3DCurrent ); - return (hOldProc)(hwnd,message,wParam,lParam); - } - - return (pD3DCurrent->hOldProc)(hwnd,message,wParam,lParam); -} - -/**********************************************************************/ -/***** Miscellaneous device driver funcs *****/ -/**********************************************************************/ - -/*===========================================================================*/ -/* Not reacting to this as I'm only supporting drawing to the back buffer */ -/* right now. */ -/*===========================================================================*/ -/* RETURN: TRUE. */ -/*===========================================================================*/ -static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer ) -{ - if (buffer == GL_BACK_LEFT) - return GL_TRUE; - else - return GL_FALSE; -} -/*===========================================================================*/ -/* This proc will be called by Mesa when the viewport has been set. So if */ -/* we have a context and it isn't the default then we should let D3D know of */ -/* the change. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - RECT rect; - - /* Make sure we can set a viewport. */ - if ( pContext->pShared && (pContext != pD3DDefault) ) - { - // TODO: might be needed. - UpdateScreenPosHAL( pContext->pShared ); - rect.left = x; - rect.right = x + w; - rect.top = y; - rect.bottom = y + h; - - // TODO: shared struct should make this call smaller - SetViewportHAL( pContext->pShared, &rect, 0.0F, 1.0F ); - } -} -/*===========================================================================*/ -/* This function could be better I guess but I decided just to grab the four*/ -/* components and store then seperately. Makes it easier to use IMHO. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - pContext->aClear = a; - pContext->bClear = b; - pContext->gClear = g; - pContext->rClear = r; -} -/*===========================================================================*/ -/* This function could be better I guess but I decided just to grab the four*/ -/* components and store then seperately. Makes it easier to use IMHO. */ -/* (is there an echo in here?) */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - pContext->aCurrent = a; - pContext->bCurrent = b; - pContext->gCurrent = g; - pContext->rCurrent = r; -} -/*===========================================================================*/ -/* */ -/* */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static const char *RendererString( void ) -{ - static char pszRender[64]; - - strcpy( pszRender, "altD3D " ); - - if ( pD3DCurrent->pShared->bHardware ) - strcat( pszRender, "(HW)"); - else - strcat( pszRender, "(SW)"); - - return (const char *)pszRender; -} -/*===========================================================================*/ -/* This function will choose which set of pointers Mesa will use based on */ -/* whether we hard using hardware or software. I have added another set of */ -/* pointers that will do nothing but stop the API from crashing. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void SetupDDPointers( GLcontext *ctx ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - // TODO: write a generic NULL support for the span render. - if ( pContext->pShared && pContext->pShared->bHardware ) - { - ctx->Driver.UpdateState = SetupHWDDPointers; - } - else if ( pContext == pD3DDefault ) - { - ctx->Driver.UpdateState = SetupNULLDDPointers; - } - else - { - ctx->Driver.UpdateState = SetupSWDDPointers; - } -} -/*===========================================================================*/ -/* This function will populate all the Mesa driver hooks. This version of */ -/* hooks will do nothing but support the API when we don't have a valid */ -/* context bound. This is mostly for applications that don't behave right */ -/* and also to help exit as clean as possable when we have a FatalError. */ -/*===========================================================================*/ -/* RETURN: pointer to the specific function. */ -/*===========================================================================*/ -static void SetupNULLDDPointers( GLcontext *ctx ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - /* Initialize all the pointers in the DD struct. Do this whenever */ - /* a new context is made current or we change buffers via set_buffer! */ - ctx->Driver.UpdateState = SetupNULLDDPointers; - - /* State management hooks. */ - ctx->Driver.Color = NULLSetColor; - ctx->Driver.ClearColor = NULLClearColor; - ctx->Driver.Clear = NULLClearBuffers; - ctx->Driver.SetBuffer = NULLSetBuffer; - - /* Window management hooks. */ - ctx->Driver.GetBufferSize = NULLGetBufferSize; - - /* Primitive rendering hooks. */ - ctx->Driver.TriangleFunc = NULL; - ctx->Driver.RenderVB = NULL; - - /* Pixel/span writing functions: */ - ctx->Driver.WriteRGBASpan = NULLWrSpRGBA; - ctx->Driver.WriteRGBSpan = NULLWrSpRGB; - ctx->Driver.WriteMonoRGBASpan = NULLWrSpRGBAMono; - ctx->Driver.WriteRGBAPixels = NULLWrPiRGBA; - ctx->Driver.WriteMonoRGBAPixels = NULLWrPiRGBAMono; - - /* Pixel/span reading functions: */ - ctx->Driver.ReadRGBASpan = NULLReSpRGBA; - ctx->Driver.ReadRGBAPixels = NULLRePiRGBA; - - /* Misc. hooks. */ - ctx->Driver.RendererString = RendererString; -} -/*===========================================================================*/ -/* This function will populate all the Mesa driver hooks. There are two of */ -/* these functions. One if we have hardware support and one is there is only*/ -/* software. These functions will be called by Mesa and by the wgl.c when we*/ -/* have resized (or created) the buffers. The thing is that if a window gets*/ -/* resized we may loose hardware support or gain it... */ -/*===========================================================================*/ -/* RETURN: pointer to the specific function. */ -/*===========================================================================*/ -static void SetupSWDDPointers( GLcontext *ctx ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - /* Initialize all the pointers in the DD struct. Do this whenever */ - /* a new context is made current or we change buffers via set_buffer! */ - ctx->Driver.UpdateState = SetupSWDDPointers; - - /* State management hooks. */ - ctx->Driver.Color = SetColor; - ctx->Driver.ClearColor = ClearColor; - ctx->Driver.Clear = ClearBuffers; - ctx->Driver.SetBuffer = SetBuffer; - - /* Window management hooks. */ - ctx->Driver.GetBufferSize = GetBufferSize; - ctx->Driver.Viewport = SetViewport; - - /* Primitive rendering hooks. */ - ctx->Driver.TriangleFunc = NULL; - ctx->Driver.RenderVB = NULL; - - /* Texture management hooks. */ - - /* Pixel/span writing functions: */ - ctx->Driver.WriteRGBASpan = WSpanRGBA; - ctx->Driver.WriteRGBSpan = WSpanRGB; - ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono; - ctx->Driver.WriteRGBAPixels = WPixelsRGBA; - ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono; - - /* Pixel/span reading functions: */ - ctx->Driver.ReadRGBASpan = RSpanRGBA; - ctx->Driver.ReadRGBAPixels = RPixelsRGBA; - - /* Misc. hooks. */ - ctx->Driver.Flush = Flush; - ctx->Driver.RendererString = RendererString; -} -/*===========================================================================*/ -/* This function will populate all the Mesa driver hooks. There are two of */ -/* these functions. One if we have hardware support and one is there is only*/ -/* software. These functions will be called by Mesa and by the wgl.c when we*/ -/* have resized (or created) the buffers. The thing is that if a window gets*/ -/* resized we may loose hardware support or gain it... */ -/*===========================================================================*/ -/* RETURN: pointer to the specific function. */ -/*===========================================================================*/ -static void SetupHWDDPointers( GLcontext *ctx ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - /* Initialize all the pointers in the DD struct. Do this whenever */ - /* a new context is made current or we change buffers via set_buffer! */ - ctx->Driver.UpdateState = SetupHWDDPointers; - - /* State management hooks. */ - ctx->Driver.Color = SetColor; - ctx->Driver.ClearColor = ClearColor; - ctx->Driver.Clear = ClearBuffersD3D; - ctx->Driver.SetBuffer = SetBuffer; - - /* Window management hooks. */ - ctx->Driver.GetBufferSize = GetBufferSize; - ctx->Driver.Viewport = SetViewport; - - /* Primitive rendering hooks. */ - ctx->Driver.TriangleFunc = RenderOneTriangle; - ctx->Driver.LineFunc = RenderOneLine; - ctx->Driver.RenderVB = RenderVertexBuffer; - - /* Pixel/span writing functions: */ - ctx->Driver.WriteRGBASpan = WSpanRGBA; - ctx->Driver.WriteRGBSpan = WSpanRGB; - ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono; - ctx->Driver.WriteRGBAPixels = WPixelsRGBA; - ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono; - - /* Pixel/span reading functions: */ - ctx->Driver.ReadRGBASpan = RSpanRGBA; - ctx->Driver.ReadRGBAPixels = RPixelsRGBA; - - /* Texture management hooks. */ - // ctx->Driver.BindTexture = TextureBind; - ctx->Driver.TexImage = TextureLoad; - ctx->Driver.TexSubImage = TextureSubImage; - - /* Misc. hooks. */ - ctx->Driver.Flush = Flush; - ctx->Driver.RendererString = RendererString; -} -/*===========================================================================*/ -/* This function will release all resources used by the DLL. Every context */ -/* will be clobbered by releaseing all driver desources and then freeing the */ -/* context memory. Most all the work is done in DestroyContext. */ -/*===========================================================================*/ -/* RETURN: TRUE. */ -/*===========================================================================*/ -static BOOL TermOpenGL( HINSTANCE hInst ) -{ - D3DMESACONTEXT *pTmp, - *pNext; - - /* Just incase we are still getting paint msg. */ - MakeCurrent( pD3DDefault ); - - /* Walk the list until we get back to the default context. */ - for( pTmp = pD3DDefault->next; pTmp != pD3DDefault; pTmp = pNext ) - { - pNext = pTmp->next; - DestroyContext( pTmp ); - } - DestroyContext( pD3DDefault ); - - return TRUE; -} -/*===========================================================================*/ -/* This function is an internal function that will clean up all the Mesa */ -/* context bound to this D3D context. Also any D3D stuff that this context */ -/* uses will be unloaded. */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -static void DestroyContext( D3DMESACONTEXT *pContext ) -{ - D3DMESACONTEXT *pTmp; - - /* Walk the list until we find the context before this one. */ - for( pTmp = pD3DDefault; pTmp && (pTmp->next != pContext); pTmp = pTmp->next ) - if ( pTmp == pTmp->next ) - break; - - /* If we never found it it must already be deleted. */ - if ( pTmp->next != pContext ) - return; - - /* Make sure we are not using this context. */ - if ( pContext == pD3DCurrent ) - MakeCurrent( pD3DDefault ); - - /* Free the Mesa stuff. */ - if ( pContext->gl_visual ) - { - _mesa_destroy_visual( pContext->gl_visual ); - pContext->gl_visual = NULL; - } - if ( pContext->gl_buffer ) - { - _mesa_destroy_framebuffer( pContext->gl_buffer ); - pContext->gl_buffer = NULL; - } - if ( pContext->gl_ctx ) - { - _mesa_destroy_context( pContext->gl_ctx ); - pContext->gl_ctx = NULL; - } - - /* Now dump the D3D. */ - if ( pContext->pShared ) - TermHAL( pContext->pShared ); - - /* Update the previous context's link. */ - pTmp->next = pContext->next; - - /* Gonzo. */ - FREE( pContext ); -} -/*===========================================================================*/ -/* This function will pull the supplied context away from Win32. Basicly it*/ -/* will remove the hook from the window Proc. */ -/* */ -/* TODO: might want to serialize this stuff... */ -/*===========================================================================*/ -/* RETURN: TRUE, FALSE. */ -/*===========================================================================*/ -static BOOL UnBindWindow( D3DMESACONTEXT *pContext ) -{ - if ( pContext == NULL ) - return FALSE; - - if ( pContext == pD3DDefault ) - return TRUE; - - /* Make sure we always have a context bound. */ - if ( pContext == pD3DCurrent ) - pD3DCurrent = pD3DDefault; - - SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)pContext->hOldProc ); - pContext->hOldProc = NULL; - - return TRUE; -} -/*===========================================================================*/ -/* There are two cases that allow for a faster clear when we know that the */ -/* whole buffer is cleared and that there is no clipping. */ -/*===========================================================================*/ -/* RETURN: the original mask with the bits cleared that represents the buffer* -/* or buffers we just cleared. */ -/*===========================================================================*/ -GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - DWORD dwFlags = 0; - - if ( mask & GL_COLOR_BUFFER_BIT ) - { - dwFlags |= D3DCLEAR_TARGET; - mask &= ~GL_COLOR_BUFFER_BIT; - } - if ( mask & GL_DEPTH_BUFFER_BIT ) - { - dwFlags |= D3DCLEAR_ZBUFFER; - mask &= ~GL_DEPTH_BUFFER_BIT; - } - if ( dwFlags == 0 ) - return mask; - - ClearHAL( pContext->pShared, - dwFlags, - all, - x, y, - width, height, - ((pContext->aClear<<24) | (pContext->rClear<<16) | (pContext->gClear<<8) | (pContext->bClear)), - ctx->Depth.Clear, - 0 ); - - return mask; -} - - - -/*===========================================================================*/ -/* TEXTURE MANAGER: ok here is how I did textures. Mesa-3.0 will keep track*/ -/* of all the textures for us. So this means that at anytime we can go to */ -/* the Mesa context and get the current texture. With this in mind this is */ -/* what I did. I really don't care about what textures get or are loaded */ -/* until I actually have to draw a tri that is textured. At this point I */ -/* must have the texture so I demand the texture by destorying all other */ -/* texture surfaces if need be and load the current one. This allows for the*/ -/* best preformance on low memory cards as time is not wasted loading and */ -/* unload textures. */ -/*===========================================================================*/ - - - - - -/*===========================================================================*/ -/* TextureLoad will try and create a D3D surface from the supplied texture */ -/* object if its level 0 (first). The surface will be fully filled with the */ -/* texture. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - /* TODO: only doing first LOD. */ - if ( (ctx->DriverCtx == NULL) || (level != 0) ) - return; - - CreateTMgrHAL( pContext->pShared, - tObj->Name, - level, - tObj->Image[level]->Format, - (RECT *)NULL, - tObj->Image[level]->Width, - tObj->Image[level]->Height, - TM_ACTION_LOAD, - (void *)tObj->Image[level]->Data ); -} -/*===========================================================================*/ -/* TextureBind make sure that the texture is on the card. Thats it. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - - /* TODO: only doing first LOD. */ - if ( (tObj->Image[0] == NULL) || (ctx->DriverCtx == NULL) ) - return; - - CreateTMgrHAL( pContext->pShared, - tObj->Name, - 0, - tObj->Image[0]->Format, - (RECT *)NULL, - tObj->Image[0]->Width, - tObj->Image[0]->Height, - TM_ACTION_BIND, - (void *)tObj->Image[0]->Data ); -} -/*===========================================================================*/ -/* TextureSubImage will make sure that the texture being updated is updated */ -/* if its on the card. */ -/*===========================================================================*/ -/* RETURN: */ -/*===========================================================================*/ -static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image ) -{ - D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; - RECT rect; - - /* TODO: only doing first LOD. */ - if ( (ctx->DriverCtx == NULL) || (level > 0) ) - return; - - /* Create a dirty rectangle structure. */ - rect.left = xoffset; - rect.right = xoffset + width; - rect.top = yoffset; - rect.bottom = yoffset + height; - - CreateTMgrHAL( pContext->pShared, - tObj->Name, - 0, - tObj->Image[0]->Format, - &rect, - tObj->Image[0]->Width, - tObj->Image[0]->Height, - TM_ACTION_UPDATE, - (void *)tObj->Image[0]->Data ); -} - diff --git a/src/mesa/drivers/d3d/d3dText.h b/src/mesa/drivers/d3d/d3dText.h deleted file mode 100644 index 9ff0650518..0000000000 --- a/src/mesa/drivers/d3d/d3dText.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef D3D_TEXT_H -#define D3D_TEXT_H - - -#ifdef __cplusplus -extern "C" { -#endif - -/*===========================================================================*/ -/* Includes. */ -/*===========================================================================*/ -#include -#include -#include -/*===========================================================================*/ -/* Magic numbers. */ -/*===========================================================================*/ -#define D3DLTEXT_BITSUSED 0xFFFFFFFF -#define MAX_VERTICES 700 // (14*40) 14 per character, 40 characters -/*===========================================================================*/ -/* Macros defines. */ -/*===========================================================================*/ -/*===========================================================================*/ -/* Type defines. */ -/*===========================================================================*/ -typedef struct _d3dText_metrics -{ - float fntYScale, - fntXScale; - - int fntXSpacing, - fntYSpacing; - - DWORD dwColor; - LPDIRECT3DDEVICE3 lpD3DDevice; - -} D3DFONTMETRICS, *PD3DFONTMETRICS; -/*===========================================================================*/ -/* Function prototypes. */ -/*===========================================================================*/ -extern BOOL InitD3DText( void ); -extern void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics ); -extern void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics ); -/*===========================================================================*/ -/* Global variables. */ -/*===========================================================================*/ - -#ifdef __cplusplus -} -#endif - - -#endif -- cgit v1.2.3 From b5c3199afe0d90787223cb57c35ff22e38b3c920 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 15:55:00 -0500 Subject: Remove dos driver --- Makefile | 3 - include/GL/Makefile.am | 2 +- src/mesa/drivers/dos/blit.S | 1040 --------------------------------------- src/mesa/drivers/dos/dmesa.c | 359 -------------- src/mesa/drivers/dos/dpmi.c | 166 ------- src/mesa/drivers/dos/internal.h | 105 ---- src/mesa/drivers/dos/null.c | 224 --------- src/mesa/drivers/dos/null.h | 41 -- src/mesa/drivers/dos/vesa.c | 719 --------------------------- src/mesa/drivers/dos/vesa.h | 65 --- src/mesa/drivers/dos/vga.c | 289 ----------- src/mesa/drivers/dos/vga.h | 42 -- src/mesa/drivers/dos/video.c | 442 ----------------- src/mesa/drivers/dos/video.h | 56 --- 14 files changed, 1 insertion(+), 3552 deletions(-) delete mode 100644 src/mesa/drivers/dos/blit.S delete mode 100644 src/mesa/drivers/dos/dmesa.c delete mode 100644 src/mesa/drivers/dos/dpmi.c delete mode 100644 src/mesa/drivers/dos/internal.h delete mode 100644 src/mesa/drivers/dos/null.c delete mode 100644 src/mesa/drivers/dos/null.h delete mode 100644 src/mesa/drivers/dos/vesa.c delete mode 100644 src/mesa/drivers/dos/vesa.h delete mode 100644 src/mesa/drivers/dos/vga.c delete mode 100644 src/mesa/drivers/dos/vga.h delete mode 100644 src/mesa/drivers/dos/video.c delete mode 100644 src/mesa/drivers/dos/video.h (limited to 'src') diff --git a/Makefile b/Makefile index 0527fa0d82..659e11c5fb 100644 --- a/Makefile +++ b/Makefile @@ -270,7 +270,6 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ - $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ $(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \ $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \ @@ -472,8 +471,6 @@ GLUT_FILES = \ $(DIRECTORY)/src/glut/beos/*.[ch] \ $(DIRECTORY)/src/glut/beos/*.cpp \ $(DIRECTORY)/src/glut/beos/Makefile \ - $(DIRECTORY)/src/glut/dos/*.[ch] \ - $(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \ $(DIRECTORY)/src/glut/ggi/*.[ch] \ $(DIRECTORY)/src/glut/ggi/Makefile \ $(DIRECTORY)/src/glut/fbdev/Makefile \ diff --git a/include/GL/Makefile.am b/include/GL/Makefile.am index ca528f606d..a62495766c 100644 --- a/include/GL/Makefile.am +++ b/include/GL/Makefile.am @@ -28,7 +28,7 @@ if NEED_GLUT sel_inc_glut = $(INC_GLUT) endif -EXTRA_HEADERS = amesa.h dosmesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \ +EXTRA_HEADERS = amesa.h foomesa.h glut_h.dja mesa_wgl.h mglmesa.h \ vms_x_fix.h wmesa.h \ $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) diff --git a/src/mesa/drivers/dos/blit.S b/src/mesa/drivers/dos/blit.S deleted file mode 100644 index 02dc8400d8..0000000000 --- a/src/mesa/drivers/dos/blit.S +++ /dev/null @@ -1,1040 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - - .file "blit.S" - -/* - * extern unsigned int vesa_gran_mask, vesa_gran_shift; - * extern int vl_video_selector; - - * extern void *vl_current_draw_buffer; - * extern int vl_current_stride, vl_current_height; - * extern int vl_current_offset, vl_current_delta; - */ - - .text - -/* Desc: VESA bank switching routine (BIOS) - * - * In : EBX=0, EDX = bank number - * Out : - - * - * Note: thrashes EAX - */ - .p2align 5,,31 -_vesa_swbankBIOS: - movw $0x4f05, %ax - int $0x10 - ret - - .p2align 2,,3 - .global _vesa_swbank -_vesa_swbank: .long _vesa_swbankBIOS - -/* Desc: void vesa_b_dump_virtual (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_b_dump_virtual -_vesa_b_dump_virtual: - cld - pushl %es - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %es - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - movl _vl_current_delta, %ebx - shrl $2, %ecx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - pushl %eax - pushl %ebx - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - popl %ebx - popl %eax - subl %ebp, %edi - .balign 4 - 2: - movsl - decl %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - popl %es - ret - -/* Desc: void vesa_l_dump_virtual (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_l_dump_virtual -_vesa_l_dump_virtual: - cld - pushl %es - pushl %esi - pushl %edi - movl _vl_video_selector, %es - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %eax - shrl $2, %ecx - .balign 4 - 0: - pushl %ecx - rep; movsl - popl %ecx - addl %eax, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %es - ret - -/* Desc: void vesa_l_dump_virtual_mmx (void); - * - * In : - - * Out : - - * - * Note: uses current draw buffer - */ - .p2align 5,,31 - .global _vesa_l_dump_virtual_mmx -_vesa_l_dump_virtual_mmx: -#ifdef USE_MMX_ASM - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %eax - shrl $3, %ecx - .balign 4 - 0: - pushl %ecx - .balign 4 - 1: - movq (%esi), %mm0 - addl $8, %esi - movq %mm0, %fs:(%edi) - addl $8, %edi - decl %ecx - jnz 1b - popl %ecx - addl %eax, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - emms -#endif - ret - - - -#define CVT_32_TO_16(s, tmp) \ - /* SRC = bbbbbbbbggggggggrrrrrrrr******** */\ - movl %e##s##x, %tmp ;\ - /* TMP = bbbbbbbbggggggggrrrrrrrr******** */\ - shrb $2, %s##h ;\ - /* SRC = bbbbbbbbgggggg00rrrrrrrr******** */\ - andl $0xF80000, %tmp ;\ - /* TMP = 0000000000000000000rrrrr00000000 */\ - shrw $3, %s##x ;\ - /* SRC = bbbbbgggggg00000rrrrrrrr******** */\ - shrl $8, %tmp ;\ - /* TMP = 00000000000rrrrr0000000000000000 */\ - orl %tmp, %e##s##x ;\ - /* SRC = bbbbbggggggrrrrrrrrrrrrr******** */ - -#define CVT_32_TO_15(s, tmp) \ - /* SRC = bbbbbbbbggggggggrrrrrrrr******** */\ - movl %e##s##x, %tmp ;\ - /* TMP = bbbbbbbbggggggggrrrrrrrr******** */\ - shrb $3, %s##h ;\ - /* SRC = bbbbbbbbgggggg00rrrrrrrr******** */\ - andl $0xF80000, %tmp ;\ - /* TMP = 0000000000000000000rrrrr00000000 */\ - shrw $3, %s##x ;\ - /* SRC = bbbbbgggggg00000rrrrrrrr******** */\ - shrl $9, %tmp ;\ - /* TMP = 00000000000rrrrr0000000000000000 */\ - orl %tmp, %e##s##x ;\ - /* SRC = bbbbbggggggrrrrrrrrrrrrr******** */ - -#define CVT_16_TO_15(src, tmp) \ - /* SRC = bbbbbggggggrrrrrBBBBBGGGGGGRRRRR */\ - movl %src, %tmp ;\ - /* TMP = bbbbbggggggrrrrrBBBBBGGGGGGRRRRR */\ - andl $0x1F001F, %src ;\ - /* SRC = bbbbb00000000000BBBBB00000000000 */\ - andl $0xFFC0FFC0, %tmp ;\ - /* TMP = 000000gggggrrrrr000000GGGGGRRRRR */\ - shrl %tmp ;\ - /* TMP = 00000gggggrrrrr000000GGGGGRRRRR0 */\ - orl %tmp, %src ;\ - /* SRC = bbbbbgggggrrrrr0BBBBBGGGGGRRRRR0 */\ - - - -/* transform BGRA to BGR */ - .p2align 5,,31 - .global _vesa_l_dump_32_to_24 -_vesa_l_dump_32_to_24: - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %ecx - 1: - movl (%esi), %eax - addl $4, %esi - movw %ax, %fs:(%edi) - shrl $16, %eax - movb %al, %fs:2(%edi) - addl $3, %edi - subl $3, %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - ret - -/* transform BGRA to B5G6R5 */ - .p2align 5,,31 - .global _vesa_l_dump_32_to_16 -_vesa_l_dump_32_to_16: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %ecx - 1: - movl (%esi), %eax - addl $4, %esi - CVT_32_TO_16(a, ebp) - movw %ax, %fs:(%edi) - addl $2, %edi - subl $2, %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - -/* transform BGRA to B5G5R5 */ - .p2align 5,,31 - .global _vesa_l_dump_32_to_15 -_vesa_l_dump_32_to_15: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %ecx - 1: - movl (%esi), %eax - addl $4, %esi - CVT_32_TO_15(a, ebp) - movw %ax, %fs:(%edi) - addl $2, %edi - subl $2, %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - -/* transform BGRA to fake8 */ - .p2align 5,,31 - .global _vesa_l_dump_32_to_8 -_vesa_l_dump_32_to_8: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %edx - pushl %ecx - pushl %ebx - 1: - movl (%esi), %eax - addl $4, %esi -#if 1 - xorl %ebx, %ebx - movl %eax, %edx - movb %ah, %bl - shrl $16, %edx - andl $0xFF, %edx - andl $0xFF, %eax - - movb _array_b(%eax), %al - movb _array_r(%edx), %dl - movb _array_g(%ebx), %bl - - imull $36, %eax - imull $6, %ebx - addl %edx, %eax - addl %ebx, %eax -#endif - movb %al, %fs:(%edi) - incl %edi - decl %ecx - jnz 1b - popl %ebx - popl %ecx - popl %edx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - -/* transform BGR to BGRx */ - .p2align 5,,31 - .global _vesa_l_dump_24_to_32 -_vesa_l_dump_24_to_32: - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %ecx - 1: - movl (%esi), %eax - addl $3, %esi - movl %eax, %fs:(%edi) - addl $4, %edi - subl $4, %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - ret - -/* transform BGR to fake8 */ - .p2align 5,,31 - .global _vesa_l_dump_24_to_8 -_vesa_l_dump_24_to_8: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %edx - pushl %ecx - pushl %ebx - 1: - movl (%esi), %eax - addl $3, %esi -#if 1 - xorl %ebx, %ebx - movl %eax, %edx - movb %ah, %bl - shrl $16, %edx - andl $0xFF, %edx - andl $0xFF, %eax - - movb _array_b(%eax), %al - movb _array_r(%edx), %dl - movb _array_g(%ebx), %bl - - imull $36, %eax - imull $6, %ebx - addl %edx, %eax - addl %ebx, %eax -#endif - movb %al, %fs:(%edi) - incl %edi - decl %ecx - jnz 1b - popl %ebx - popl %ecx - popl %edx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - -/* transform B5G6R5 to B5G5R5 */ - .p2align 5,,31 - .global _vesa_l_dump_16_to_15 -_vesa_l_dump_16_to_15: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %ecx - 1: - movl (%esi), %eax - addl $4, %esi - CVT_16_TO_15(eax, ebp) - movl %eax, %fs:(%edi) - addl $4, %edi - subl $4, %ecx - jnz 1b - popl %ecx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - -/* transform B5G6R5 to fake8 */ - .p2align 5,,31 - .global _vesa_l_dump_16_to_8 -_vesa_l_dump_16_to_8: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vl_current_stride, %ecx - movl _vl_current_height, %edx - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %ecx - pushl %ebx - 1: - movl (%esi), %eax - addl $4, %esi -#if 1 - movl %eax, %ebx - andl $0xFFFF, %eax - shrl $16, %ebx - movb _tab_16_8(%eax), %al - movb _tab_16_8(%ebx), %ah -#endif - movw %ax, %fs:(%edi) - addl $2, %edi - subl $2, %ecx - jnz 1b - popl %ebx - popl %ecx - addl %ebx, %edi - decl %edx - jnz 0b - popl %edi - popl %esi - popl %ebx - popl %ebp - ret - - - - .p2align 5,,31 - .global _vesa_b_dump_32_to_24 -_vesa_b_dump_32_to_24: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - movl $0x00FFFFFF, %ebx - .balign 4 - 0: - pushl %eax - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - pushl %ebx - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - popl %ebx - subl %ebp, %edi - .balign 4 - 2: - movb (%esi), %al /* XXX too many accesses */ - incl %esi - rorl $8, %ebx - jnc 2b - movb %al, %fs:(%edi) - incl %edi - decl %ecx - jnz 1b - popl %ecx - popl %eax - addl _vl_current_delta, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret - - .p2align 5,,31 - .global _vesa_b_dump_32_to_16 -_vesa_b_dump_32_to_16: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - .balign 4 - 0: - pushl %eax - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - subl %ebp, %edi - .balign 4 - 2: - movl (%esi), %eax - addl $4, %esi - CVT_32_TO_16(a, ebx) - movw %ax, %fs:(%edi) - addl $2, %edi - subl $2, %ecx - jnz 1b - popl %ecx - popl %eax - addl _vl_current_delta, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret - - .p2align 5,,31 - .global _vesa_b_dump_32_to_15 -_vesa_b_dump_32_to_15: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - .balign 4 - 0: - pushl %eax - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - subl %ebp, %edi - .balign 4 - 2: - movl (%esi), %eax - addl $4, %esi - CVT_32_TO_15(a, ebx) - movw %ax, %fs:(%edi) - addl $2, %edi - subl $2, %ecx - jnz 1b - popl %ecx - popl %eax - addl _vl_current_delta, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret - - .p2align 5,,31 - .global _vesa_b_dump_32_to_8 -_vesa_b_dump_32_to_8: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - .balign 4 - 0: - pushl %eax - pushl %ecx - pushl %edx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - popl %edx - incl %edx - pushl %edx - xorl %ebx, %ebx - call *_vesa_swbank - subl %ebp, %edi - .balign 4 - 2: - movl (%esi), %eax - addl $4, %esi -#if 1 - xorl %ebx, %ebx - movl %eax, %edx - movb %ah, %bl - shrl $16, %edx - andl $0xFF, %edx - andl $0xFF, %eax - - movb _array_b(%eax), %al - movb _array_r(%edx), %dl - movb _array_g(%ebx), %bl - - imull $36, %eax - imull $6, %ebx - addl %edx, %eax - addl %ebx, %eax -#endif - movb %al, %fs:(%edi) - incl %edi - decl %ecx - jnz 1b - popl %edx - popl %ecx - popl %eax - addl _vl_current_delta, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret - - .p2align 5,,31 - .global _vesa_b_dump_24_to_32 -_vesa_b_dump_24_to_32: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %eax - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - pushl %ebx - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - popl %ebx - subl %ebp, %edi - .balign 4 - 2: - movl (%esi), %eax - addl $3, %esi - movl %eax, %fs:(%edi) - addl $4, %edi - subl $4, %ecx - jnz 1b - popl %ecx - popl %eax - addl %ebx, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret - - .p2align 5,,31 - .global _vesa_b_dump_24_to_8 -_vesa_b_dump_24_to_8: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - .balign 4 - 0: - pushl %eax - pushl %ecx - pushl %edx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - popl %edx - incl %edx - pushl %edx - xorl %ebx, %ebx - call *_vesa_swbank - subl %ebp, %edi - .balign 4 - 2: - movl (%esi), %eax - addl $3, %esi -#if 1 - xorl %ebx, %ebx - movl %eax, %edx - movb %ah, %bl - shrl $16, %edx - andl $0xFF, %edx - andl $0xFF, %eax - - movb _array_b(%eax), %al - movb _array_r(%edx), %dl - movb _array_g(%ebx), %bl - - imull $36, %eax - imull $6, %ebx - addl %edx, %eax - addl %ebx, %eax -#endif - movb %al, %fs:(%edi) - incl %edi - decl %ecx - jnz 1b - popl %edx - popl %ecx - popl %eax - addl _vl_current_delta, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret - - .p2align 5,,31 - .global _vesa_b_dump_16_to_15 -_vesa_b_dump_16_to_15: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - .balign 4 - 0: - pushl %eax - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - subl %ebp, %edi - .balign 4 - 2: - movw (%esi), %ax - addl $2, %esi - CVT_16_TO_15(eax, ebx) - movw %ax, %fs:(%edi) - addl $2, %edi - subl $2, %ecx - jnz 1b - popl %ecx - popl %eax - addl _vl_current_delta, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret - - .p2align 5,,31 - .global _vesa_b_dump_16_to_8 -_vesa_b_dump_16_to_8: - pushl %ebx - pushl %esi - pushl %edi - pushl %ebp - movl _vl_video_selector, %fs - movl _vl_current_draw_buffer, %esi - movl _vl_current_offset, %edi - movl _vesa_gran_shift, %ecx - movl _vesa_gran_mask, %ebp - movl %edi, %edx - xorl %ebx, %ebx - andl %ebp, %edi - shrl %cl, %edx - incl %ebp - call *_vesa_swbank - movl _vl_current_stride, %ecx - movl _vl_current_height, %eax - movl _vl_current_delta, %ebx - .balign 4 - 0: - pushl %eax - pushl %ecx - .balign 4 - 1: - cmpl %ebp, %edi - jb 2f - pushl %ebx - incl %edx - xorl %ebx, %ebx - call *_vesa_swbank - popl %ebx - subl %ebp, %edi - .balign 4 - 2: - movw (%esi), %ax - addl $2, %esi -#if 1 - andl $0xFFFF, %eax - movb _tab_16_8(%eax), %al -#endif - movb %al, %fs:(%edi) - addl $1, %edi - subl $1, %ecx - jnz 1b - popl %ecx - popl %eax - addl %ebx, %edi - decl %eax - jnz 0b - popl %ebp - popl %edi - popl %esi - popl %ebx - ret diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c deleted file mode 100644 index 003c06a8ff..0000000000 --- a/src/mesa/drivers/dos/dmesa.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#include "main/context.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "video.h" - -#include "GL/osmesa.h" -#include "GL/dmesa.h" - - -/* - * This has nothing to do with Mesa Visual structure. - * We keep this one around for backwards compatibility, - * and to store video mode data for DMesaCreateContext. - */ -struct dmesa_visual { - GLenum format; /* OSMesa framebuffer format */ - GLint depthBits; - GLint stencilBits; - GLint accumBits; -}; - -/* - * This has nothing to do with Mesa Buffer structure. - * We keep this one around for backwards compatibility, - * and to store various data. - */ -struct dmesa_buffer { - int xpos, ypos; /* position */ - int width, height; /* size in pixels */ - GLenum type; - void *the_window; /* your window handle, etc */ -}; - -/* - * This has nothing to do with Mesa Context structure. - * We keep this one around for backwards compatibility, - * and to store real off-screen context. - */ -struct dmesa_context { - OSMesaContext osmesa; - DMesaBuffer buffer; -}; - - -static DMesaContext ctx; - - -/**************************************************************************** - * DMesa Public API Functions - ***************************************************************************/ - -/* - * The exact arguments to this function will depend on your window system - */ -DMesaVisual -DMesaCreateVisual (GLint width, - GLint height, - GLint colDepth, - GLint refresh, - GLboolean dbFlag, - GLboolean rgbFlag, - GLint alphaSize, - GLint depthSize, - GLint stencilSize, - GLint accumSize) -{ - DMesaVisual visual; - GLenum format; - int fbbits; - - if (dbFlag) { - return NULL; - } - - if (!rgbFlag) { - format = OSMESA_COLOR_INDEX; - fbbits = 8; - } else if (alphaSize) { - format = OSMESA_BGRA; - fbbits = 32; - } else if (colDepth == 15 || colDepth == 16) { - format = OSMESA_RGB_565; - fbbits = 16; - } else { - format = OSMESA_BGR; - fbbits = 24; - } - - if ((visual = (DMesaVisual)CALLOC_STRUCT(dmesa_visual)) == NULL) { - return NULL; - } - - if (vl_video_init(width, height, colDepth, rgbFlag, refresh, fbbits) <= 0) { - FREE(visual); - return NULL; - } - - visual->format = format; - visual->depthBits = depthSize; - visual->stencilBits = stencilSize; - visual->accumBits = accumSize; - return visual; -} - - -void -DMesaDestroyVisual (DMesaVisual visual) -{ - vl_video_exit(); - FREE(visual); -} - - -DMesaBuffer -DMesaCreateBuffer (DMesaVisual visual, - GLint xpos, GLint ypos, - GLint width, GLint height) -{ - DMesaBuffer buffer; - GLenum type; - int bytesPerPixel; - - switch (visual->format) { - case OSMESA_COLOR_INDEX: - bytesPerPixel = 1; - type = CHAN_TYPE; - break; - case OSMESA_RGB_565: - bytesPerPixel = 2; - type = GL_UNSIGNED_SHORT_5_6_5; - break; - case OSMESA_BGR: - bytesPerPixel = 3; - type = CHAN_TYPE; - break; - default: - bytesPerPixel = 4; - type = CHAN_TYPE; - } - - if ((buffer = (DMesaBuffer)CALLOC_STRUCT(dmesa_buffer)) != NULL) { - buffer->xpos = xpos; - buffer->ypos = ypos; - buffer->width = width; - buffer->height = height; - buffer->type = type; - buffer->the_window = MALLOC(width * height * bytesPerPixel + 1); - if (buffer->the_window == NULL) { - FREE(buffer); - buffer = NULL; - } - } - - return buffer; -} - - -void -DMesaDestroyBuffer (DMesaBuffer buffer) -{ - FREE(buffer->the_window); - FREE(buffer); -} - - -DMesaContext -DMesaCreateContext (DMesaVisual visual, DMesaContext share) -{ - DMesaContext dmesa; - if ((dmesa = (DMesaContext)CALLOC_STRUCT(dmesa_context)) != NULL) { - dmesa->osmesa = OSMesaCreateContextExt( - visual->format, - visual->depthBits, - visual->stencilBits, - visual->accumBits, - (share != NULL) ? share->osmesa : NULL); - if (dmesa->osmesa == NULL) { - FREE(dmesa); - dmesa = NULL; - } - } - return dmesa; -} - - -void -DMesaDestroyContext (DMesaContext dmesa) -{ - OSMesaDestroyContext(dmesa->osmesa); - FREE(dmesa); -} - - -GLboolean -DMesaMoveBuffer (GLint xpos, GLint ypos) -{ - const DMesaContext dmesa = DMesaGetCurrentContext(); - DMesaBuffer b = dmesa->buffer; - - if (vl_sync_buffer(&b->the_window, xpos, ypos, b->width, b->height) == 0) { - b->xpos = xpos; - b->ypos = ypos; - return GL_TRUE; - } - - return GL_FALSE; -} - - -GLboolean -DMesaResizeBuffer (GLint width, GLint height) -{ - const DMesaContext dmesa = DMesaGetCurrentContext(); - DMesaBuffer b = dmesa->buffer; - - if (vl_sync_buffer(&b->the_window, b->xpos, b->ypos, width, height) == 0) { - b->width = width; - b->height = height; - return GL_TRUE; - } - - return GL_FALSE; -} - - -GLboolean -DMesaMakeCurrent (DMesaContext dmesa, DMesaBuffer buffer) -{ - if (dmesa == NULL || buffer == NULL) { - ctx = NULL; - return GL_TRUE; - } - if (OSMesaMakeCurrent(dmesa->osmesa, buffer->the_window, - buffer->type, - buffer->width, buffer->height) && - vl_sync_buffer(&buffer->the_window, buffer->xpos, buffer->ypos, buffer->width, buffer->height) == 0) { - OSMesaPixelStore(OSMESA_Y_UP, GL_FALSE); - dmesa->buffer = buffer; - ctx = dmesa; - return GL_TRUE; - } - return GL_FALSE; -} - - -void -DMesaSwapBuffers (DMesaBuffer buffer) -{ - /* copy/swap back buffer to front if applicable */ - GET_CURRENT_CONTEXT(ctx); - _mesa_notifySwapBuffers(ctx); - vl_flip(); - (void)buffer; -} - - -void -DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue) -{ - vl_setCI(ndx, red, green, blue); -} - - -DMesaContext -DMesaGetCurrentContext (void) -{ - return ctx; -} - - -DMesaBuffer -DMesaGetCurrentBuffer (void) -{ - const DMesaContext dmesa = DMesaGetCurrentContext(); - - if (dmesa != NULL) { - return dmesa->buffer; - } - - return NULL; -} - - -DMesaProc -DMesaGetProcAddress (const char *name) -{ - DMesaProc p = (DMesaProc)_glapi_get_proc_address(name); - - /* TODO: handle DMesa* namespace - if (p == NULL) { - } - */ - - return p; -} - - -int -DMesaGetIntegerv (GLenum pname, GLint *params) -{ - switch (pname) { - case DMESA_GET_SCREEN_SIZE: - vl_get(VL_GET_SCREEN_SIZE, params); - break; - case DMESA_GET_DRIVER_CAPS: - params[0] = 0; - break; - case DMESA_GET_VIDEO_MODES: - return vl_get(VL_GET_VIDEO_MODES, params); - case DMESA_GET_BUFFER_ADDR: { - const DMesaContext dmesa = DMesaGetCurrentContext(); - if (dmesa != NULL) { - DMesaBuffer b = dmesa->buffer; - if (b != NULL) { - params[0] = (GLint)b->the_window; - } - } - break; - } - default: - return -1; - } - - return 0; -} diff --git a/src/mesa/drivers/dos/dpmi.c b/src/mesa/drivers/dos/dpmi.c deleted file mode 100644 index bd33b8856c..0000000000 --- a/src/mesa/drivers/dos/dpmi.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include - -#include "internal.h" - - -#ifndef MAX -#define MAX(x, y) (((x) < (y)) ? (y) : (x)) -#endif - - -/* _create_linear_mapping: - * Maps a physical address range into linear memory. - */ -int -_create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size) -{ - __dpmi_meminfo meminfo; - - if (physaddr >= 0x100000) { - /* map into linear memory */ - meminfo.address = physaddr; - meminfo.size = size; - if (__dpmi_physical_address_mapping(&meminfo) != 0) { - return -1; - } - - *linear = meminfo.address; - } else { - /* exploit 1 -> 1 physical to linear mapping in low megabyte */ - *linear = physaddr; - } - - return 0; -} - - -/* _remove_linear_mapping: - * Frees the DPMI resources being used to map a linear address range. - */ -void -_remove_linear_mapping (unsigned long *linear) -{ - __dpmi_meminfo meminfo; - - if (*linear) { - if (*linear >= 0x100000) { - meminfo.address = *linear; - __dpmi_free_physical_address_mapping(&meminfo); - } - - *linear = 0; - } -} - - -/* _create_selector: - * Allocates a selector to access a region of linear memory. - */ -int -_create_selector (int *segment, unsigned long base, int size) -{ - /* allocate an ldt descriptor */ - if ((*segment=__dpmi_allocate_ldt_descriptors(1)) < 0) { - *segment = 0; - return -1; - } - - /* create the linear mapping */ - if (_create_linear_mapping(&base, base, size)) { - __dpmi_free_ldt_descriptor(*segment); - *segment = 0; - return -1; - } - - /* set the descriptor base and limit */ - __dpmi_set_segment_base_address(*segment, base); - __dpmi_set_segment_limit(*segment, MAX(size-1, 0xFFFF)); - - return 0; -} - - -/* _remove_selector: - * Frees a DPMI segment selector. - */ -void -_remove_selector (int *segment) -{ - if (*segment) { - unsigned long base; - __dpmi_get_segment_base_address(*segment, &base); - _remove_linear_mapping(&base); - __dpmi_free_ldt_descriptor(*segment); - *segment = 0; - } -} - - -/* Desc: retrieve CPU MMX capability - * - * In : - - * Out : FALSE if CPU cannot do MMX - * - * Note: - - */ -int -_can_mmx (void) -{ -#ifdef USE_MMX_ASM - int x86_cpu_features = 0; - __asm("\n\ - pushfl \n\ - popl %%eax \n\ - movl %%eax, %%ecx \n\ - xorl $0x200000, %%eax\n\ - pushl %%eax \n\ - popfl \n\ - pushfl \n\ - popl %%eax \n\ - pushl %%ecx \n\ - popfl \n\ - xorl %%ecx, %%eax \n\ - jz 0f \n\ - movl $1, %%eax \n\ - cpuid \n\ - movl %%edx, %0 \n\ - 0: \n\ - ":"=g"(x86_cpu_features)::"%eax", "%ebx", "%ecx", "%edx"); - return (x86_cpu_features & 0x00800000); -#else - return 0; -#endif -} diff --git a/src/mesa/drivers/dos/internal.h b/src/mesa/drivers/dos/internal.h deleted file mode 100644 index 0fa7c77222..0000000000 --- a/src/mesa/drivers/dos/internal.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#ifndef INTERNAL_H_included -#define INTERNAL_H_included - -#include "../main/mtypes.h" - - -/* - * general purpose defines, etc. - */ -#ifndef FALSE -#define FALSE 0 -#define TRUE !FALSE -#endif - -#define __PACKED__ __attribute__((packed)) - -typedef unsigned char word8; -typedef unsigned short word16; -typedef unsigned long word32; - -#define _16_ *(word16 *)& -#define _32_ *(word32 *)& - -typedef void (*BLTFUNC) (void); - - -/* - * video mode structure - */ -typedef struct vl_mode { - int xres, yres; - int bpp; - - int mode; - int scanlen; - - int sel; - int gran; -} vl_mode; - - -/* - * video driver structure - */ -typedef struct { - vl_mode *(*init) (void); - int (*entermode) (vl_mode *p, int refresh, int fbbits); - void (*blit) (void); - void (*setCI_f) (int index, float red, float green, float blue); - void (*setCI_i) (int index, int red, int green, int blue); - int (*get) (int pname, int *params); - void (*restore) (void); - void (*fini) (void); -} vl_driver; - - -/* - * memory mapping - */ -int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size); -void _remove_linear_mapping (unsigned long *linear); -int _create_selector (int *segment, unsigned long base, int size); -void _remove_selector (int *segment); - - -/* - * system routines - */ -int _can_mmx (void); - - -#endif diff --git a/src/mesa/drivers/dos/null.c b/src/mesa/drivers/dos/null.c deleted file mode 100644 index 55846299fb..0000000000 --- a/src/mesa/drivers/dos/null.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#include -#include - -#include "video.h" -#include "null.h" - - -static vl_mode *modes; - -#define null_color_precision 8 - - -static void -null_blit_nop (void) -{ -} - - -/* Desc: Attempts to detect NUL, check video modes and create selectors. - * - * In : - - * Out : mode array - * - * Note: - - */ -static vl_mode * -null_init (void) -{ - static int m[][2] = { - { 320, 200 }, - { 320, 240 }, - { 400, 300 }, - { 512, 384 }, - { 640, 400 }, - { 640, 480 }, - { 800, 600 }, - { 1024, 768 }, - { 1280, 1024 }, - { 1600, 1200 } - }; - static int b[] = { - 8, - 15, - 16, - 24, - 32 - }; - const unsigned int m_count = sizeof(m) / sizeof(m[0]); - const unsigned int b_count = sizeof(b) / sizeof(b[0]); - - unsigned int i, j, k; - - if (modes == NULL) { - modes = malloc(sizeof(vl_mode) * (1 + m_count * b_count)); - - if (modes != NULL) { - for (k = 0, i = 0; i < m_count; i++) { - for (j = 0; j < b_count; j++, k++) { - modes[k].xres = m[i][0]; - modes[k].yres = m[i][1]; - modes[k].bpp = b[j]; - modes[k].mode = 0x4000; - modes[k].scanlen = m[i][0] * ((b[j] + 7) / 8); - modes[k].sel = -1; - modes[k].gran = -1; - } - } - modes[k].xres = -1; - modes[k].yres = -1; - modes[k].bpp = -1; - modes[k].mode = 0xffff; - modes[k].scanlen = -1; - modes[k].sel = -1; - modes[k].gran = -1; - } - } - - return modes; -} - - -/* Desc: Frees all resources allocated by NUL init code. - * - * In : - - * Out : - - * - * Note: - - */ -static void -null_fini (void) -{ - if (modes != NULL) { - free(modes); - modes = NULL; - } -} - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: - - */ -static int -null_entermode (vl_mode *p, int refresh, int fbbits) -{ - NUL.blit = null_blit_nop; - - return 0; - - (void)(p && refresh && fbbits); /* silence compiler warning */ -} - - -/* Desc: Restores to the mode prior to first call to null_entermode. - * - * In : - - * Out : - - * - * Note: - - */ -static void -null_restore (void) -{ -} - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses integer values - */ -static void -null_setCI_i (int index, int red, int green, int blue) -{ - (void)(index && red && green && blue); /* silence compiler warning */ -} - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses normalized values - */ -static void -null_setCI_f (int index, float red, float green, float blue) -{ - float max = (1 << null_color_precision) - 1; - - null_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); -} - - -/* Desc: state retrieval - * - * In : parameter name, ptr to storage - * Out : 0 if request successfully processed - * - * Note: - - */ -static int -null_get (int pname, int *params) -{ - switch (pname) { - default: - params[0] = params[0]; /* silence compiler warning */ - return -1; - } - return 0; -} - - -/* - * the driver - */ -vl_driver NUL = { - null_init, - null_entermode, - NULL, - null_setCI_f, - null_setCI_i, - null_get, - null_restore, - null_fini -}; diff --git a/src/mesa/drivers/dos/null.h b/src/mesa/drivers/dos/null.h deleted file mode 100644 index bbdc7966e0..0000000000 --- a/src/mesa/drivers/dos/null.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef NULL_H_included -#define NULL_H_included - -#include "internal.h" - -extern vl_driver NUL; - -#endif diff --git a/src/mesa/drivers/dos/vesa.c b/src/mesa/drivers/dos/vesa.c deleted file mode 100644 index 3fdd3e25db..0000000000 --- a/src/mesa/drivers/dos/vesa.c +++ /dev/null @@ -1,719 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "video.h" -#include "vesa.h" - - -static vl_mode modes[128]; - -static word16 vesa_ver; -static int banked_selector, linear_selector; -static int oldmode = -1; - -static int vesa_color_precision = 6; - -static word16 *vesa_pmcode; -unsigned int vesa_gran_mask, vesa_gran_shift; - - -/* - * VESA info - */ -#define V_SIGN 0 -#define V_MINOR 4 -#define V_MAJOR 5 -#define V_OEM_OFS 6 -#define V_OEM_SEG 8 -#define V_MODE_OFS 14 -#define V_MODE_SEG 16 -#define V_MEMORY 18 - -/* - * mode info - */ -#define M_ATTR 0 -#define M_GRAN 4 -#define M_SCANLEN 16 -#define M_XRES 18 -#define M_YRES 20 -#define M_BPP 25 -#define M_RED 31 -#define M_GREEN 33 -#define M_BLUE 35 -#define M_PHYS_PTR 40 - -/* - * VESA 3.0 CRTC timings structure - */ -typedef struct CRTCInfoBlock { - unsigned short HorizontalTotal; - unsigned short HorizontalSyncStart; - unsigned short HorizontalSyncEnd; - unsigned short VerticalTotal; - unsigned short VerticalSyncStart; - unsigned short VerticalSyncEnd; - unsigned char Flags; - unsigned long PixelClock; /* units of Hz */ - unsigned short RefreshRate; /* units of 0.01 Hz */ - unsigned char reserved[40]; -} __PACKED__ CRTCInfoBlock; - -#define HNEG (1 << 2) -#define VNEG (1 << 3) -#define DOUBLESCAN (1 << 0) - - -/* Desc: Attempts to detect VESA, check video modes and create selectors. - * - * In : - - * Out : mode array - * - * Note: - - */ -static vl_mode * -vesa_init (void) -{ - __dpmi_regs r; - word16 *p; - vl_mode *q; - char vesa_info[512], tmp[512]; - int maxsize = 0; - word32 linearfb = 0; - - if (vesa_ver) { - return modes; - } - - _farpokel(_stubinfo->ds_selector, 0, 0x32454256); - r.x.ax = 0x4f00; - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512); - if ((r.x.ax != 0x004f) || ((_32_ vesa_info[V_SIGN]) != 0x41534556)) { - return NULL; - } - - p = (word16 *)(((_16_ vesa_info[V_MODE_SEG]) << 4) + (_16_ vesa_info[V_MODE_OFS])); - q = modes; - do { - if ((q->mode = _farpeekw(__djgpp_dos_sel, (unsigned long)(p++))) == 0xffff) { - break; - } - - r.x.ax = 0x4f01; - r.x.cx = q->mode; - r.x.di = 512; - r.x.es = _stubinfo->ds_segment; - __dpmi_int(0x10, &r); - movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256); - switch (tmp[M_BPP]) { - case 16: - q->bpp = tmp[M_RED] + tmp[M_GREEN] + tmp[M_BLUE]; - break; - case 8: - case 15: - case 24: - case 32: - q->bpp = tmp[M_BPP]; - break; - default: - q->bpp = 0; - } - if ((r.x.ax == 0x004f) && ((tmp[M_ATTR] & 0x11) == 0x11) && q->bpp) { - q->xres = _16_ tmp[M_XRES]; - q->yres = _16_ tmp[M_YRES]; - q->scanlen = _16_ tmp[M_SCANLEN]; - q->gran = (_16_ tmp[M_GRAN]) << 10; - if (tmp[M_ATTR] & 0x80) { - vl_mode *q1 = q + 1; - *q1 = *q++; - linearfb = _32_ tmp[M_PHYS_PTR]; - q->mode |= 0x4000; - } - if (maxsize < (q->scanlen * q->yres)) { - maxsize = q->scanlen * q->yres; - } - q++; - } - } while (TRUE); - - if (q == modes) { - return NULL; - } - if (_create_selector(&banked_selector, 0xa0000, modes[0].gran)) { - return NULL; - } - if (linearfb) { - maxsize = ((maxsize + 0xfffUL) & ~0xfffUL); - if (_create_selector(&linear_selector, linearfb, maxsize)) { - linear_selector = banked_selector; - } - } - - for (q = modes; q->mode != 0xffff; q++) { - q->sel = banked_selector; - if (q->mode & 0x4000) { - if (linear_selector != banked_selector) { - q->sel = linear_selector; - } else { - q->mode &= ~0x4000; - } - } - } - - if (vesa_info[V_MAJOR] >= 2) { - r.x.ax = 0x4f0a; - r.x.bx = 0; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - vesa_pmcode = (word16 *)malloc(r.x.cx); - if (vesa_pmcode != NULL) { - movedata(__djgpp_dos_sel, (r.x.es << 4) + r.x.di, _my_ds(), (unsigned)vesa_pmcode, r.x.cx); - if (vesa_pmcode[3]) { - p = (word16 *)((long)vesa_pmcode + vesa_pmcode[3]); - while (*p++ != 0xffff) { - } - } else { - p = NULL; - } - if (p && (*p != 0xffff)) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } else { - vesa_swbank = (void *)((long)vesa_pmcode + vesa_pmcode[0]); - } - } - } - } - - vesa_ver = _16_ vesa_info[V_MINOR]; - return modes; -} - - -/* Desc: Frees all resources allocated by VESA init code. - * - * In : - - * Out : - - * - * Note: - - */ -static void -vesa_fini (void) -{ - if (vesa_ver) { - _remove_selector(&linear_selector); - _remove_selector(&banked_selector); - if (vesa_pmcode != NULL) { - free(vesa_pmcode); - vesa_pmcode = NULL; - } - } -} - - -/* Desc: Uses VESA 3.0 function 0x4F0B to find the closest pixel clock to the requested value. - * - * In : mode, clock - * Out : desired clock - * - * Note: - - */ -static unsigned long -_closest_pixclk (int mode_no, unsigned long vclk) -{ - __dpmi_regs r; - - r.x.ax = 0x4F0B; - r.h.bl = 0; - r.d.ecx = vclk; - r.x.dx = mode_no; - __dpmi_int(0x10, &r); - - return (r.x.ax == 0x004f) ? r.d.ecx : 0; -} - - -/* Desc: Calculates CRTC mode timings. - * - * In : crtc block, geometry, adjust - * Out : - * - * Note: - */ -static void -_crtc_timing (CRTCInfoBlock *crtc, int xres, int yres, int xadjust, int yadjust) -{ - int HTotal, VTotal; - int HDisp, VDisp; - int HSS, VSS; - int HSE, VSE; - int HSWidth, VSWidth; - int SS, SE; - int doublescan = FALSE; - - if (yres < 400) { - doublescan = TRUE; - yres *= 2; - } - - HDisp = xres; - HTotal = (int)(HDisp * 1.27) & ~0x7; - HSWidth = (int)((HTotal - HDisp) / 5) & ~0x7; - HSS = HDisp + 16; - HSE = HSS + HSWidth; - VDisp = yres; - VTotal = VDisp * 1.07; - VSWidth = (VTotal / 100) + 1; - VSS = VDisp + ((int)(VTotal - VDisp) / 5) + 1; - VSE = VSS + VSWidth; - - SS = HSS + xadjust; - SE = HSE + xadjust; - - if (xadjust < 0) { - if (SS < (HDisp + 8)) { - SS = HDisp + 8; - SE = SS + HSWidth; - } - } else { - if ((HTotal - 24) < SE) { - SE = HTotal - 24; - SS = SE - HSWidth; - } - } - - HSS = SS; - HSE = SE; - - SS = VSS + yadjust; - SE = VSE + yadjust; - - if (yadjust < 0) { - if (SS < (VDisp + 3)) { - SS = VDisp + 3; - SE = SS + VSWidth; - } - } else { - if ((VTotal - 4) < SE) { - SE = VTotal - 4; - SS = SE - VSWidth; - } - } - - VSS = SS; - VSE = SE; - - crtc->HorizontalTotal = HTotal; - crtc->HorizontalSyncStart = HSS; - crtc->HorizontalSyncEnd = HSE; - crtc->VerticalTotal = VTotal; - crtc->VerticalSyncStart = VSS; - crtc->VerticalSyncEnd = VSE; - crtc->Flags = HNEG | VNEG; - - if (doublescan) { - crtc->Flags |= DOUBLESCAN; - } -} - - -/* Desc: Attempts to choose a suitable blitter. - * - * In : ptr to mode structure, software framebuffer bits - * Out : blitter funciton, or NULL - * - * Note: - - */ -static BLTFUNC -_choose_blitter (vl_mode *p, int fbbits) -{ - BLTFUNC blitter; - - if (p->mode & 0x4000) { - blitter = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; - switch (p->bpp) { - case 8: - switch (fbbits) { - case 8: - break; - case 16: - blitter = vesa_l_dump_16_to_8; - break; - case 24: - blitter = vesa_l_dump_24_to_8; - break; - case 32: - blitter = vesa_l_dump_32_to_8; - break; - case 15: - default: - return NULL; - } - break; - case 15: - switch (fbbits) { - case 16: - blitter = vesa_l_dump_16_to_15; - break; - case 32: - blitter = vesa_l_dump_32_to_15; - break; - case 8: - case 15: - case 24: - default: - return NULL; - } - break; - case 16: - switch (fbbits) { - case 16: - break; - case 32: - blitter = vesa_l_dump_32_to_16; - break; - case 8: - case 15: - case 24: - default: - return NULL; - } - break; - case 24: - switch (fbbits) { - case 24: - break; - case 32: - blitter = vesa_l_dump_32_to_24; - break; - case 8: - case 15: - case 16: - default: - return NULL; - } - break; - case 32: - switch (fbbits) { - case 24: - blitter = vesa_l_dump_24_to_32; - break; - case 32: - break; - case 8: - case 15: - case 16: - default: - return NULL; - } - break; - } - } else { - blitter = vesa_b_dump_virtual; - switch (p->bpp) { - case 8: - switch (fbbits) { - case 8: - break; - case 16: - blitter = vesa_b_dump_16_to_8; - break; - case 24: - blitter = vesa_b_dump_24_to_8; - break; - case 32: - blitter = vesa_b_dump_32_to_8; - break; - case 15: - default: - return NULL; - } - break; - case 15: - switch (fbbits) { - case 16: - blitter = vesa_b_dump_16_to_15; - break; - case 32: - blitter = vesa_b_dump_32_to_15; - break; - case 8: - case 15: - case 24: - default: - return NULL; - } - break; - case 16: - switch (fbbits) { - case 16: - break; - case 32: - blitter = vesa_b_dump_32_to_16; - break; - case 8: - case 15: - case 24: - default: - return NULL; - } - break; - case 24: - switch (fbbits) { - case 24: - break; - case 32: - blitter = vesa_b_dump_32_to_24; - break; - case 8: - case 15: - case 16: - default: - return NULL; - } - break; - case 32: - switch (fbbits) { - case 24: - blitter = vesa_b_dump_24_to_32; - break; - case 32: - break; - case 8: - case 15: - case 16: - default: - return NULL; - } - break; - } - } - - return blitter; -} - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: - - */ -static int -vesa_entermode (vl_mode *p, int refresh, int fbbits) -{ - __dpmi_regs r; - - if (!(p->mode & 0x4000)) { - { int n; for (vesa_gran_shift = 0, n = p->gran; n; vesa_gran_shift++, n >>= 1); } - vesa_gran_mask = (1 << (--vesa_gran_shift)) - 1; - if ((unsigned)p->gran != (vesa_gran_mask + 1)) { - return !0; - } - } - - VESA.blit = _choose_blitter(p, fbbits); - if (VESA.blit == NULL) { - return !0; - } - - if (oldmode == -1) { - r.x.ax = 0x4f03; - __dpmi_int(0x10, &r); - oldmode = r.x.bx; - } - - r.x.ax = 0x4f02; - r.x.bx = p->mode; - - if (refresh && ((vesa_ver >> 8) >= 3)) { - /* VESA 3.0 stuff for controlling the refresh rate */ - CRTCInfoBlock crtc; - unsigned long vclk; - double f0; - - _crtc_timing(&crtc, p->xres, p->yres, 0, 0); - - vclk = (double)crtc.HorizontalTotal * crtc.VerticalTotal * refresh; - vclk = _closest_pixclk(p->mode, vclk); - - if (vclk != 0) { - f0 = (double)vclk / (crtc.HorizontalTotal * crtc.VerticalTotal); - /*_current_refresh_rate = (int)(f0 + 0.5);*/ - - crtc.PixelClock = vclk; - crtc.RefreshRate = refresh * 100; - - movedata(_my_ds(), (unsigned)&crtc, _stubinfo->ds_selector, 0, sizeof(crtc)); - - r.x.di = 0; - r.x.es = _stubinfo->ds_segment; - r.x.bx |= 0x0800; - } - } - - __dpmi_int(0x10, &r); - if (r.x.ax != 0x004f) { - return !0; - } - - if (p->bpp == 8) { - r.x.ax = 0x4f08; - r.x.bx = 0x0800; - __dpmi_int(0x10, &r); - if (r.x.ax == 0x004f) { - r.x.ax = 0x4f08; - r.h.bl = 0x01; - __dpmi_int(0x10, &r); - vesa_color_precision = r.h.bh; - } - } - - return 0; -} - - -/* Desc: Restores to the mode prior to first call to vesa_entermode. - * - * In : - - * Out : - - * - * Note: - - */ -static void -vesa_restore (void) -{ - __dpmi_regs r; - - if (oldmode != -1) { - if (oldmode < 0x100) { - __asm("int $0x10"::"a"(oldmode)); - } else { - r.x.ax = 0x4f02; - r.x.bx = oldmode; - __dpmi_int(0x10, &r); - } - oldmode = -1; - } -} - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses integer values - */ -static void -vesa_setCI_i (int index, int red, int green, int blue) -{ -#if 0 - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ - "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); -#else - outportb(0x03C8, index); - outportb(0x03C9, red); - outportb(0x03C9, green); - outportb(0x03C9, blue); -#endif -} - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses normalized values - */ -static void -vesa_setCI_f (int index, float red, float green, float blue) -{ - float max = (1 << vesa_color_precision) - 1; - - vesa_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); -} - - -/* Desc: state retrieval - * - * In : parameter name, ptr to storage - * Out : 0 if request successfully processed - * - * Note: - - */ -static int -vesa_get (int pname, int *params) -{ - switch (pname) { - case VL_GET_CI_PREC: - params[0] = vesa_color_precision; - break; - default: - return -1; - } - return 0; -} - - -/* - * the driver - */ -vl_driver VESA = { - vesa_init, - vesa_entermode, - NULL, - vesa_setCI_f, - vesa_setCI_i, - vesa_get, - vesa_restore, - vesa_fini -}; diff --git a/src/mesa/drivers/dos/vesa.h b/src/mesa/drivers/dos/vesa.h deleted file mode 100644 index 4b3c3ab832..0000000000 --- a/src/mesa/drivers/dos/vesa.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VESA_H_included -#define VESA_H_included - -#include "internal.h" - -extern void *vesa_swbank; - -extern void vesa_b_dump_virtual (void); -extern void vesa_l_dump_virtual (void); -extern void vesa_l_dump_virtual_mmx (void); - -extern void vesa_l_dump_32_to_24 (void); -extern void vesa_l_dump_32_to_16 (void); -extern void vesa_l_dump_32_to_15 (void); -extern void vesa_l_dump_32_to_8 (void); -extern void vesa_l_dump_24_to_32 (void); -extern void vesa_l_dump_24_to_8 (void); -extern void vesa_l_dump_16_to_15 (void); -extern void vesa_l_dump_16_to_8 (void); - -extern void vesa_b_dump_32_to_24 (void); -extern void vesa_b_dump_32_to_16 (void); -extern void vesa_b_dump_32_to_15 (void); -extern void vesa_b_dump_32_to_8 (void); -extern void vesa_b_dump_24_to_32 (void); -extern void vesa_b_dump_24_to_8 (void); -extern void vesa_b_dump_16_to_15 (void); -extern void vesa_b_dump_16_to_8 (void); - -extern vl_driver VESA; - -#endif diff --git a/src/mesa/drivers/dos/vga.c b/src/mesa/drivers/dos/vga.c deleted file mode 100644 index 5a6447dd87..0000000000 --- a/src/mesa/drivers/dos/vga.c +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#include -#include - -#include "video.h" -#include "vga.h" - - -static vl_mode modes[] = { - { - /* .xres = */ 320, - /* .yres = */ 200, - /* .bpp = */ 8, - /* .mode = */ 0x13 | 0x4000, - /* .scanlen = */ 320, - /* .sel = */ -1, - /* .gran = */ 320*200 - }, - { - /* .xres = */ -1, - /* .yres = */ -1, - /* .bpp = */ -1, - /* .mode = */ 0xffff, - /* .scanlen = */ -1, - /* .sel = */ -1, - /* .gran = */ -1 - } -}; - -static word16 vga_ver; -static int linear_selector; -static int oldmode = -1; - -#define vga_color_precision 6 - - -/* Desc: Attempts to detect VGA, check video modes and create selectors. - * - * In : - - * Out : mode array - * - * Note: - - */ -static vl_mode * -vga_init (void) -{ - int rv = 0; - - if (vga_ver) { - return modes; - } - - __asm("\n\ - movw $0x1a00, %%ax \n\ - int $0x10 \n\ - cmpb $0x1a, %%al \n\ - jne 0f \n\ - cmpb $0x07, %%bl \n\ - jb 0f \n\ - andl $0xff, %%ebx \n\ - movl %%ebx, %0 \n\ - 0:":"=g"(rv)::"%eax", "%ebx"); - if (rv == 0) { - return NULL; - } - - if (_create_selector(&linear_selector, 0xa0000, 0x10000)) { - return NULL; - } - - modes[0].sel = linear_selector; - - vga_ver = rv; - return modes; -} - - -/* Desc: Frees all resources allocated by VGA init code. - * - * In : - - * Out : - - * - * Note: - - */ -static void -vga_fini (void) -{ - if (vga_ver) { - _remove_selector(&linear_selector); - } -} - - -/* Desc: Attempts to choose a suitable blitter. - * - * In : ptr to mode structure, software framebuffer bits - * Out : blitter funciton, or NULL - * - * Note: - - */ -static BLTFUNC -_choose_blitter (vl_mode *p, int fbbits) -{ - BLTFUNC blitter; - - switch (fbbits) { - case 8: - blitter = _can_mmx() ? vesa_l_dump_virtual_mmx : vesa_l_dump_virtual; - break; - case 16: - blitter = vesa_l_dump_16_to_8; - break; - case 24: - blitter = vesa_l_dump_24_to_8; - break; - case 32: - blitter = vesa_l_dump_32_to_8; - break; - default: - return NULL; - } - - return blitter; - - (void)p; -} - - -/* Desc: Attempts to enter specified video mode. - * - * In : ptr to mode structure, refresh rate - * Out : 0 if success - * - * Note: - - */ -static int -vga_entermode (vl_mode *p, int refresh, int fbbits) -{ - if (!(p->mode & 0x4000)) { - return -1; - } - - VGA.blit = _choose_blitter(p, fbbits); - if (VGA.blit == NULL) { - return !0; - } - - if (oldmode == -1) { - __asm("\n\ - movb $0x0f, %%ah \n\ - int $0x10 \n\ - andl $0xff, %%eax \n\ - movl %%eax, %0 \n\ - ":"=g"(oldmode)::"%eax", "%ebx"); - } - - __asm("int $0x10"::"a"(p->mode&0xff)); - - return 0; - - (void)refresh; /* silence compiler warning */ -} - - -/* Desc: Restores to the mode prior to first call to vga_entermode. - * - * In : - - * Out : - - * - * Note: - - */ -static void -vga_restore (void) -{ - if (oldmode != -1) { - __asm("int $0x10"::"a"(oldmode)); - oldmode = -1; - } -} - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses integer values - */ -static void -vga_setCI_i (int index, int red, int green, int blue) -{ -#if 0 - __asm("\n\ - movw $0x1010, %%ax \n\ - movb %1, %%dh \n\ - movb %2, %%ch \n\ - int $0x10 \n\ - "::"b"(index), "m"(red), "m"(green), "c"(blue):"%eax", "%edx"); -#else - outportb(0x03C8, index); - outportb(0x03C9, red); - outportb(0x03C9, green); - outportb(0x03C9, blue); -#endif -} - - -/* Desc: set one palette entry - * - * In : color index, R, G, B - * Out : - - * - * Note: uses normalized values - */ -static void -vga_setCI_f (int index, float red, float green, float blue) -{ - float max = (1 << vga_color_precision) - 1; - - vga_setCI_i(index, (int)(red * max), (int)(green * max), (int)(blue * max)); -} - - -/* Desc: state retrieval - * - * In : parameter name, ptr to storage - * Out : 0 if request successfully processed - * - * Note: - - */ -static int -vga_get (int pname, int *params) -{ - switch (pname) { - case VL_GET_CI_PREC: - params[0] = vga_color_precision; - break; - default: - return -1; - } - return 0; -} - - -/* - * the driver - */ -vl_driver VGA = { - vga_init, - vga_entermode, - NULL, - vga_setCI_f, - vga_setCI_i, - vga_get, - vga_restore, - vga_fini -}; diff --git a/src/mesa/drivers/dos/vga.h b/src/mesa/drivers/dos/vga.h deleted file mode 100644 index 7c17625a3c..0000000000 --- a/src/mesa/drivers/dos/vga.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VGA_H_included -#define VGA_H_included - -#include "internal.h" -#include "vesa.h" - -extern vl_driver VGA; - -#endif diff --git a/src/mesa/drivers/dos/video.c b/src/mesa/drivers/dos/video.c deleted file mode 100644 index 468207fbf6..0000000000 --- a/src/mesa/drivers/dos/video.c +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - * - * Thanks to CrazyPyro (Neil Funk) for FakeColor - */ - - -#include - -#include "internal.h" -#include "vesa.h" -#include "vga.h" -#include "null.h" -#include "video.h" - - -static vl_driver *drv; -/* based upon mode specific data: valid entire session */ -int vl_video_selector; -static vl_mode *video_mode; -static int video_scanlen, video_bypp; -/* valid until next buffer */ -void *vl_current_draw_buffer, *vl_current_read_buffer; -int vl_current_stride, vl_current_width, vl_current_height, vl_current_bytes; -int vl_current_offset, vl_current_delta; - - -void (*vl_flip) (void); - - -/* FakeColor data */ -#define R_CNT 6 -#define G_CNT 6 -#define B_CNT 6 - -#define R_BIAS 7 -#define G_BIAS 7 -#define B_BIAS 7 - -static word32 VGAPalette[256]; -word8 array_r[256]; -word8 array_g[256]; -word8 array_b[256]; -word8 tab_16_8[0x10000]; - - -/* lookup table for scaling 5 bit colors up to 8 bits */ -static int _rgb_scale_5[32] = { - 0, 8, 16, 25, 33, 41, 49, 58, - 66, 74, 82, 90, 99, 107, 115, 123, - 132, 140, 148, 156, 165, 173, 181, 189, - 197, 206, 214, 222, 230, 239, 247, 255 -}; - -/* lookup table for scaling 6 bit colors up to 8 bits */ -static int _rgb_scale_6[64] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 45, 49, 53, 57, 61, - 65, 69, 73, 77, 81, 85, 89, 93, - 97, 101, 105, 109, 113, 117, 121, 125, - 130, 134, 138, 142, 146, 150, 154, 158, - 162, 166, 170, 174, 178, 182, 186, 190, - 194, 198, 202, 206, 210, 215, 219, 223, - 227, 231, 235, 239, 243, 247, 251, 255 -}; - - -/* Desc: color composition (w/o ALPHA) - * - * In : array of integers (R, G, B) - * Out : color - * - * Note: - - */ -static int -v_mixrgb8fake (const unsigned char rgb[]) -{ - return array_b[rgb[2]]*G_CNT*R_CNT - + array_g[rgb[1]]*R_CNT - + array_r[rgb[0]]; -} - - -/* Desc: color decomposition - * - * In : pixel offset, array of integers to hold color components (R, G, B, A) - * Out : - - * - * Note: uses current read buffer - */ -static void -v_getrgb8fake6 (unsigned int offset, unsigned char rgb[]) -{ - word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; - rgb[0] = _rgb_scale_6[(c >> 16) & 0x3F]; - rgb[1] = _rgb_scale_6[(c >> 8) & 0x3F]; - rgb[2] = _rgb_scale_6[ c & 0x3F]; -} -static void -v_getrgb8fake8 (unsigned int offset, unsigned char rgb[]) -{ - word32 c = VGAPalette[((word8 *)vl_current_read_buffer)[offset]]; - rgb[0] = c >> 16; - rgb[1] = c >> 8; - rgb[2] = c; -} - - -/* Desc: create R5G6B5 to FakeColor table lookup - * - * In : - - * Out : - - * - * Note: - - */ -static void -init_tab_16_8 (void) -{ - int i; - for (i = 0; i < 0x10000; i++) { - unsigned char rgb[3]; - rgb[0] = _rgb_scale_5[(i >> 11) & 0x1F]; - rgb[1] = _rgb_scale_6[(i >> 5) & 0x3F]; - rgb[2] = _rgb_scale_5[ i & 0x1F]; - tab_16_8[i] = v_mixrgb8fake(rgb); - } - (void)v_getrgb8fake6; - (void)v_getrgb8fake8; -} - - -/* Desc: set one palette entry - * - * In : index, R, G, B - * Out : - - * - * Note: color components are in range [0.0 .. 1.0] - */ -void -vl_setCI (int index, float red, float green, float blue) -{ - drv->setCI_f(index, red, green, blue); -} - - -/* Desc: set one palette entry - * - * In : color, R, G, B - * Out : - - * - * Note: - - */ -static void -fake_setcolor (int c, int r, int g, int b) -{ - VGAPalette[c] = 0xff000000 | (r<<16) | (g<<8) | b; - - drv->setCI_i(c, r, g, b); -} - - -/* Desc: build FakeColor palette - * - * In : CI precision in bits - * Out : - - * - * Note: - - */ -static void -fake_buildpalette (int bits) -{ - double c_r, c_g, c_b; - int r, g, b, color = 0; - - double max = (1 << bits) - 1; - - for (b = 0; b < B_CNT; ++b) { - for (g = 0; g < G_CNT; ++g) { - for (r = 0; r < R_CNT; ++r) { - c_r = 0.5 + (double)r * (max-R_BIAS) / (R_CNT-1.) + R_BIAS; - c_g = 0.5 + (double)g * (max-G_BIAS) / (G_CNT-1.) + G_BIAS; - c_b = 0.5 + (double)b * (max-B_BIAS) / (B_CNT-1.) + B_BIAS; - fake_setcolor(color++, (int)c_r, (int)c_g, (int)c_b); - } - } - } - - for (color = 0; color < 256; color++) { - c_r = (double)color * R_CNT / 256.; - c_g = (double)color * G_CNT / 256.; - c_b = (double)color * B_CNT / 256.; - array_r[color] = (int)c_r; - array_g[color] = (int)c_g; - array_b[color] = (int)c_b; - } -} - - -/* Desc: initialize hardware - * - * In : - - * Out : list of available modes - * - * Note: when returning non-NULL, global variable `drv' is guaranteed to be ok - */ -static vl_mode * -v_init_hw (void) -{ - static vl_mode *q = NULL; - - if (q == NULL) { - /* are we forced to NUL driver? */ - if (getenv("DMESA_NULDRV")) { - if ((q = NUL.init()) != NULL) { - drv = &NUL; - } - return q; - } - /* initialize hardware */ - if ((q = VESA.init()) != NULL) { - drv = &VESA; - } else if ((q = VGA.init()) != NULL) { - drv = &VGA; - } else { - drv = NULL; - } - } - - return q; -} - - -/* Desc: sync buffer with video hardware - * - * In : ptr to old buffer, position, size - * Out : 0 if success - * - * Note: - - */ -int -vl_sync_buffer (void **buffer, int x, int y, int width, int height) -{ - if ((/*XXX*/width & 7) || (x < 0) || (y < 0) || (x+width > video_mode->xres) || (y+height > video_mode->yres)) { - return -1; - } else { - void *newbuf = *buffer; - - if ((newbuf == NULL) || (vl_current_width != width) || (vl_current_height != height)) { - newbuf = realloc(newbuf, width * height * video_bypp); - } - - if (newbuf == NULL) { - return -2; - } - - vl_current_width = width; - vl_current_height = height; - vl_current_stride = vl_current_width * video_bypp; - vl_current_bytes = vl_current_stride * height; - - vl_current_offset = video_scanlen * y + video_bypp * x; - vl_current_delta = video_scanlen - vl_current_stride; - - vl_current_draw_buffer = vl_current_read_buffer = *buffer = newbuf; - return 0; - } -} - - -/* Desc: state retrieval - * - * In : name, storage - * Out : -1 for an error - * - * Note: - - */ -int -vl_get (int pname, int *params) -{ - switch (pname) { - case VL_GET_SCREEN_SIZE: - params[0] = video_mode->xres; - params[1] = video_mode->yres; - break; - case VL_GET_VIDEO_MODES: { - int n; - vl_mode *q; - if ((q = v_init_hw()) == NULL) { - return -1; - } - /* count available visuals */ - for (n = 0; q->mode != 0xffff; q++) { - if ((q + 1)->mode == (q->mode | 0x4000)) { - /* same mode, but linear */ - q++; - } - if (params) { - params[n] = (int)q; - } - n++; - } - return n; - } - default: - return (drv != NULL) ? drv->get(pname, params) : -1; - } - return 0; -} - - -/* Desc: setup mode - * - * In : ptr to mode definition - * Out : 0 if success - * - * Note: - - */ -static int -vl_setup_mode (vl_mode *p) -{ - if (p == NULL) { - return -1; - } - - switch (p->bpp) { - case 8: - break; - case 15: - break; - case 16: - break; - case 24: - break; - case 32: - break; - default: - return -1; - } - - video_mode = p; - video_bypp = (p->bpp+7)/8; - video_scanlen = p->scanlen; - vl_video_selector = p->sel; - - return 0; -} - - -/* Desc: restore to the mode prior to first call to `vl_video_init'. - * - * In : - - * Out : - - * - * Note: - - */ -void -vl_video_exit (void) -{ - drv->restore(); - drv->fini(); - video_mode = NULL; -} - - -/* Desc: enter mode - * - * In : xres, yres, bits/pixel, RGB, refresh rate - * Out : pixel width in bits if success - * - * Note: - - */ -int -vl_video_init (int width, int height, int bpp, int rgb, int refresh, int fbbits) -{ - int fake; - vl_mode *p, *q; - unsigned int min; - - fake = 0; - if (!rgb) { - bpp = 8; - } else if (bpp == 8) { - fake = 1; - } - - /* initialize hardware */ - if ((q = v_init_hw()) == NULL) { - return 0; - } - - /* search for a mode that fits our request */ - for (min = -1, p = NULL; q->mode != 0xffff; q++) { - if ((q->xres >= width) && (q->yres >= height) && (q->bpp == bpp)) { - if (min >= (unsigned)(q->xres * q->yres)) { - min = q->xres * q->yres; - p = q; - } - } - } - - /* setup and enter mode */ - if ((vl_setup_mode(p) == 0) && (drv->entermode(p, refresh, fbbits) == 0)) { - vl_flip = drv->blit; - if (fake) { - drv->get(VL_GET_CI_PREC, (int *)(&min)); - fake_buildpalette(min); - init_tab_16_8(); - } - return bpp; - } - - /* abort */ - return 0; -} diff --git a/src/mesa/drivers/dos/video.h b/src/mesa/drivers/dos/video.h deleted file mode 100644 index e084116742..0000000000 --- a/src/mesa/drivers/dos/video.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * DOS/DJGPP device driver for Mesa - * - * Author: Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#ifndef VIDEO_H_included -#define VIDEO_H_included - -typedef int fixed; - -#define VL_GET_CARD_NAME 0x0100 -#define VL_GET_VRAM 0x0101 -#define VL_GET_CI_PREC 0x0200 -#define VL_GET_HPIXELS 0x0201 -#define VL_GET_SCREEN_SIZE 0x0202 -#define VL_GET_VIDEO_MODES 0x0300 - -extern void (*vl_flip) (void); - -void vl_setCI (int index, float red, float green, float blue); - -int vl_sync_buffer (void **buffer, int x, int y, int width, int height); -int vl_get (int pname, int *params); - -void vl_video_exit (void); -int vl_video_init (int width, int height, int bpp, int rgb, int refresh, int fbbits); - -#endif -- cgit v1.2.3 From 230d263aca86854104645c589d75f2862c50abe6 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 16:00:45 -0500 Subject: Remove GGI support --- Makefile | 11 - progs/ggi/asc-view.c | 377 -------- progs/ggi/blah | 2 - progs/ggi/blat | 7 - progs/ggi/box.asc | 66 -- progs/ggi/cone.asc | 198 ----- progs/ggi/gears.c | 339 -------- progs/ggi/gears2.c | 390 --------- progs/ggi/sphere.asc | 132 --- progs/ggi/torus.asc | 264 ------ progs/ggi/tube.asc | 396 --------- src/glut/ggi/Makefile | 53 -- src/glut/ggi/debug.h | 259 ------ src/glut/ggi/ggiglut.c | 959 --------------------- src/mesa/drivers/ggi/default/.gitignore | 1 - src/mesa/drivers/ggi/default/genkgi.conf.in | 4 - src/mesa/drivers/ggi/default/genkgi.h | 76 -- src/mesa/drivers/ggi/default/genkgi_mode.c | 97 --- src/mesa/drivers/ggi/default/genkgi_visual.c | 190 ---- src/mesa/drivers/ggi/default/linear.c | 409 --------- src/mesa/drivers/ggi/default/linear_15.c | 36 - src/mesa/drivers/ggi/default/linear_16.c | 36 - src/mesa/drivers/ggi/default/linear_24.c | 36 - src/mesa/drivers/ggi/default/linear_32.c | 36 - src/mesa/drivers/ggi/default/linear_8.c | 36 - src/mesa/drivers/ggi/default/stubs.c | 512 ----------- src/mesa/drivers/ggi/display/.gitignore | 1 - src/mesa/drivers/ggi/display/fbdev.conf.in | 4 - src/mesa/drivers/ggi/display/fbdev_mode.c | 130 --- src/mesa/drivers/ggi/display/fbdev_visual.c | 138 --- src/mesa/drivers/ggi/ggimesa.c | 670 -------------- src/mesa/drivers/ggi/ggimesa.conf.in | 13 - src/mesa/drivers/ggi/include/ggi/mesa/debug.h | 260 ------ .../drivers/ggi/include/ggi/mesa/display_fbdev.h | 20 - src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h | 84 -- .../drivers/ggi/include/ggi/mesa/ggimesa_int.h | 44 - 36 files changed, 6286 deletions(-) delete mode 100644 progs/ggi/asc-view.c delete mode 100644 progs/ggi/blah delete mode 100644 progs/ggi/blat delete mode 100644 progs/ggi/box.asc delete mode 100644 progs/ggi/cone.asc delete mode 100644 progs/ggi/gears.c delete mode 100644 progs/ggi/gears2.c delete mode 100644 progs/ggi/sphere.asc delete mode 100644 progs/ggi/torus.asc delete mode 100644 progs/ggi/tube.asc delete mode 100644 src/glut/ggi/Makefile delete mode 100644 src/glut/ggi/debug.h delete mode 100644 src/glut/ggi/ggiglut.c delete mode 100644 src/mesa/drivers/ggi/default/.gitignore delete mode 100644 src/mesa/drivers/ggi/default/genkgi.conf.in delete mode 100644 src/mesa/drivers/ggi/default/genkgi.h delete mode 100644 src/mesa/drivers/ggi/default/genkgi_mode.c delete mode 100644 src/mesa/drivers/ggi/default/genkgi_visual.c delete mode 100644 src/mesa/drivers/ggi/default/linear.c delete mode 100644 src/mesa/drivers/ggi/default/linear_15.c delete mode 100644 src/mesa/drivers/ggi/default/linear_16.c delete mode 100644 src/mesa/drivers/ggi/default/linear_24.c delete mode 100644 src/mesa/drivers/ggi/default/linear_32.c delete mode 100644 src/mesa/drivers/ggi/default/linear_8.c delete mode 100644 src/mesa/drivers/ggi/default/stubs.c delete mode 100644 src/mesa/drivers/ggi/display/.gitignore delete mode 100644 src/mesa/drivers/ggi/display/fbdev.conf.in delete mode 100644 src/mesa/drivers/ggi/display/fbdev_mode.c delete mode 100644 src/mesa/drivers/ggi/display/fbdev_visual.c delete mode 100644 src/mesa/drivers/ggi/ggimesa.c delete mode 100644 src/mesa/drivers/ggi/ggimesa.conf.in delete mode 100644 src/mesa/drivers/ggi/include/ggi/mesa/debug.h delete mode 100644 src/mesa/drivers/ggi/include/ggi/mesa/display_fbdev.h delete mode 100644 src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h delete mode 100644 src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h (limited to 'src') diff --git a/Makefile b/Makefile index 659e11c5fb..b99a87b8ba 100644 --- a/Makefile +++ b/Makefile @@ -211,7 +211,6 @@ MAIN_FILES = \ $(DIRECTORY)/docs/*.spec \ $(DIRECTORY)/include/GL/internal/glcore.h \ $(DIRECTORY)/include/GL/dmesa.h \ - $(DIRECTORY)/include/GL/ggimesa.h \ $(DIRECTORY)/include/GL/gl.h \ $(DIRECTORY)/include/GL/glext.h \ $(DIRECTORY)/include/GL/gl_mangle.h \ @@ -273,13 +272,6 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \ $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \ - $(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \ - $(DIRECTORY)/src/mesa/drivers/ggi/default/genkgi.conf.in \ - $(DIRECTORY)/src/mesa/drivers/ggi/display/*.c \ - $(DIRECTORY)/src/mesa/drivers/ggi/display/fbdev.conf.in \ - $(DIRECTORY)/src/mesa/drivers/ggi/include/ggi/mesa/*.h \ $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \ $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \ $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \ @@ -458,7 +450,6 @@ DEMO_FILES = \ $(DIRECTORY)/progs/windml/Makefile.ugl \ $(DIRECTORY)/progs/windml/*.c \ $(DIRECTORY)/progs/windml/*.bmp \ - $(DIRECTORY)/progs/ggi/*.c GLUT_FILES = \ $(DIRECTORY)/include/GL/glut.h \ @@ -471,8 +462,6 @@ GLUT_FILES = \ $(DIRECTORY)/src/glut/beos/*.[ch] \ $(DIRECTORY)/src/glut/beos/*.cpp \ $(DIRECTORY)/src/glut/beos/Makefile \ - $(DIRECTORY)/src/glut/ggi/*.[ch] \ - $(DIRECTORY)/src/glut/ggi/Makefile \ $(DIRECTORY)/src/glut/fbdev/Makefile \ $(DIRECTORY)/src/glut/fbdev/*[ch] \ $(DIRECTORY)/src/glut/mini/*[ch] \ diff --git a/progs/ggi/asc-view.c b/progs/ggi/asc-view.c deleted file mode 100644 index d37fba9d9f..0000000000 --- a/progs/ggi/asc-view.c +++ /dev/null @@ -1,377 +0,0 @@ -/* - test program for the ggi-mesa driver - - Copyright (C) 1997,1998 Uwe Maurer - uwe_maurer@t-online.de - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -ggi_visual_t vis,vis_mem; - -GGIMesaContext ctx; - -int screen_x=GGI_AUTO,screen_y=GGI_AUTO; -ggi_graphtype bpp=GT_AUTO; - -//#define ZBUFFER - -//#define SMOOTH_NORMALS - -void Init() -{ - GLfloat h=(GLfloat)3/4; - GLfloat pos[4]={5,5,-20,0}; - GLfloat specular[4]={.4,.4,.4,1}; - GLfloat diffuse[4]={.3,.3,.3,1}; - GLfloat ambient[4]={.2,.2,.2,1}; - - int err; - - if (ggiInit()<0) - { - printf("ggiInit() failed\n"); - exit(1); - } - ctx=GGIMesaCreateContext(); - if (ctx==NULL) - { - printf("Can't create Context!\n"); - exit(1); - } - - vis=ggiOpen(NULL); - vis_mem=ggiOpen("display-memory",NULL); - if (vis==NULL || vis_mem==NULL) - { - printf("Can't open ggi_visuals!\n"); - exit(1); - } - err=ggiSetGraphMode(vis,screen_x,screen_y,screen_x,screen_y,bpp); - err+=ggiSetGraphMode(vis_mem,screen_x,screen_y,screen_x,screen_y,bpp); - if (err) - { - printf("Can't set %ix%i\n",screen_x,screen_y); - exit(1); - } - - if (GGIMesaSetVisual(ctx,vis_mem,GL_TRUE,GL_FALSE)<0) - { - printf("GGIMesaSetVisual() failed!\n"); - exit(1); - } - - GGIMesaMakeCurrent(ctx); - - glViewport(0,0,screen_x,screen_y); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1,1,-h,h,1,50); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0,0,-9); - glShadeModel(GL_FLAT); - - glFrontFace(GL_CW); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - - glLightfv(GL_LIGHT0,GL_POSITION,pos); - - glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse); - glLightfv(GL_LIGHT0,GL_AMBIENT,ambient); - glLightfv(GL_LIGHT0,GL_SPECULAR,specular); - - #ifdef ZBUFFER - glEnable(GL_DEPTH_TEST); - #endif -} - - -#define MAX_VERTS 1000 -#define MAX_TRIS 2000 -#define MAX_LEN 1024 -#define MAX_F 100000000 - -void LoadAsc(GLuint *list,char *file) -{ - FILE *fp; - - GLfloat p[MAX_VERTS][3]; - GLfloat normal[MAX_VERTS][3]; - float ncount[MAX_VERTS]; - int v[MAX_TRIS][3]; - char line[MAX_LEN]; - char *s; - int i,j; - int verts,faces; - GLuint v0,v1,v2; - GLfloat n[3]; - GLfloat len,k; - GLfloat min[3]={MAX_F,MAX_F,MAX_F}; - GLfloat max[3]={-MAX_F,-MAX_F,-MAX_F}; - char *coord_str[]={"X","Z","Y"}; - - fp=fopen(file,"r"); - if (!fp) - { - printf("Can't open %s!\n",file); - exit(1); - } - - while (strncmp(fgets(line,MAX_LEN,fp),"Tri-mesh",8)) ; - - s=strstr(line,":")+1; - verts=atoi(s); - s=strstr(s,":")+1; - faces=atoi(s); - - if (verts>MAX_VERTS) - { - printf("Too many vertices..\n"); - exit(1); - } - - while (strncmp(fgets(line,MAX_LEN,fp),"Vertex list",11)) ; - - for (i=0;imax[j]) max[j]=k; - if (klen) {len=k;j=i;} - n[i]=(max[i]+min[i])/2; - } - - len/=2; - - for (i=0;iread); - rotate+=10; - frames++; - if (frames==(*maxframes)) break; - - if (ggiKbhit(vis)) - { - *maxframes=frames; - break; - } - } - - gettimeofday(&stop,NULL); - len=(double)(stop.tv_sec-start.tv_sec)+ - (double)(stop.tv_usec-start.tv_usec)/1e6; - return len; -} - -void visible(int vis) -{ - if (vis == GLUT_VISIBLE) - glutIdleFunc(idle); - else - glutIdleFunc(NULL); -} - -int main(int argc, char *argv[]) -{ - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); - - glutInitWindowPosition(0, 0); - glutInitWindowSize(300, 300); - glutCreateWindow("asc-view"); - init(); - - glutDisplayFunc(draw); - glutReshapeFunc(reshape); - glutKeyboardFunc(key); - glutSpecialFunc(special); - glutVisibilityFunc(visible); - - glutMainLoop(); -#if 0 - GLuint l; - char *file; - int maxframes=0; - double len; - - Init(); - - file=(argc>1) ? argv[1] : "asc/box.asc"; - if (argc>2) maxframes=atoi(argv[2]); - - if (argc==1) - { - printf("usage: %s filename.asc\n",argv[0]); - } - - LoadAsc(&l,file); - - len=Display(l,&maxframes); - - printf("\ttime: %.3f sec\n",len); - printf("\tframes: %i\n",maxframes); - printf("\tfps: %.3f \n",(double)maxframes/len); - - GGIMesaDestroyContext(ctx); - ggiClose(vis); - ggiClose(vis_mem); - ggiExit(); -#endif - return 0; -} - diff --git a/progs/ggi/blah b/progs/ggi/blah deleted file mode 100644 index 2c1664d7d0..0000000000 --- a/progs/ggi/blah +++ /dev/null @@ -1,2 +0,0 @@ -Terminating on signal 11 - diff --git a/progs/ggi/blat b/progs/ggi/blat deleted file mode 100644 index 7ff64a9d10..0000000000 --- a/progs/ggi/blat +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -function foobar() { - echo "foo!" -} - -foobar diff --git a/progs/ggi/box.asc b/progs/ggi/box.asc deleted file mode 100644 index f8b23fd85a..0000000000 --- a/progs/ggi/box.asc +++ /dev/null @@ -1,66 +0,0 @@ -Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 - -Named object: "Object01" -Tri-mesh, Vertices: 8 Faces: 12 -Vertex list: -Vertex 0: X: -20 Y: -19.999998 Z: 20.000002 -Vertex 1: X: 20 Y: -19.999998 Z: 20.000002 -Vertex 2: X: 20 Y: 20.000002 Z: 19.999998 -Vertex 3: X: -20 Y: 20.000002 Z: 19.999998 -Vertex 4: X: -20 Y: -20.000002 Z: -19.999998 -Vertex 5: X: 20 Y: -20.000002 Z: -19.999998 -Vertex 6: X: 20 Y: 19.999998 Z: -20.000002 -Vertex 7: X: -20 Y: 19.999998 Z: -20.000002 -Face list: -Face 0: A:0 B:1 C:2 AB:1 BC:1 CA:0 -Smoothing: 1 -Face 1: A:0 B:2 C:3 AB:0 BC:1 CA:1 -Smoothing: 1 -Face 2: A:0 B:4 C:5 AB:1 BC:1 CA:0 -Smoothing: 2 -Face 3: A:0 B:5 C:1 AB:0 BC:1 CA:1 -Smoothing: 2 -Face 4: A:1 B:5 C:6 AB:1 BC:1 CA:0 -Smoothing: 3 -Face 5: A:1 B:6 C:2 AB:0 BC:1 CA:1 -Smoothing: 3 -Face 6: A:2 B:6 C:7 AB:1 BC:1 CA:0 -Smoothing: 4 -Face 7: A:2 B:7 C:3 AB:0 BC:1 CA:1 -Smoothing: 4 -Face 8: A:3 B:7 C:4 AB:1 BC:1 CA:0 -Smoothing: 5 -Face 9: A:3 B:4 C:0 AB:0 BC:1 CA:1 -Smoothing: 5 -Face 10: A:4 B:7 C:6 AB:1 BC:1 CA:0 -Smoothing: 6 -Face 11: A:4 B:6 C:5 AB:0 BC:1 CA:1 -Smoothing: 6 - - - - - - - - - - - - - - - - - - - - - - - - - Page 1 - - - diff --git a/progs/ggi/cone.asc b/progs/ggi/cone.asc deleted file mode 100644 index 5c52285996..0000000000 --- a/progs/ggi/cone.asc +++ /dev/null @@ -1,198 +0,0 @@ -Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216 - -Named object: "Object01" -Tri-mesh, Vertices: 34 Faces: 64 -Vertex list: -Vertex 0: X: 60.167416 Y: -87.419525 Z: -53.3088 -Vertex 1: X: 76.70787 Y: -87.419518 Z: -29.84565 -Vertex 2: X: 83.0103 Y: -87.419518 Z: -1.838764 -Vertex 3: X: 78.115204 Y: -87.419518 Z: 26.448057 -Vertex 4: X: 62.767834 Y: -87.41951 Z: 50.708401 -Vertex 5: X: 39.304672 Y: -87.41951 Z: 67.248848 -Vertex 6: X: 11.297782 Y: -87.41951 Z: 73.551254 -Vertex 7: X: -16.989004 Y: -87.41951 Z: 68.656158 -Vertex 8: X: -41.249344 Y: -87.41951 Z: 53.308777 -Vertex 9: X: -57.789783 Y: -87.419518 Z: 29.845612 -Vertex 10: X: -64.092194 Y: -87.419518 Z: 1.838721 -Vertex 11: X: -59.197079 Y: -87.419518 Z: -26.448097 -Vertex 12: X: -43.849678 Y: -87.419525 Z: -50.708427 -Vertex 13: X: -20.386503 Y: -87.419525 Z: -67.248856 -Vertex 14: X: 7.62039 Y: -87.419525 Z: -73.551239 -Vertex 15: X: 35.907204 Y: -87.419525 Z: -68.656105 -Vertex 16: X: 101.684875 Y: 94.590591 Z: -96.955391 -Vertex 17: X: 131.767838 Y: 94.590591 Z: -54.281792 -Vertex 18: X: 143.230377 Y: 94.590599 Z: -3.344275 -Vertex 19: X: 134.327423 Y: 94.590607 Z: 48.102379 -Vertex 20: X: 106.414383 Y: 94.590607 Z: 92.225876 -Vertex 21: X: 63.740765 Y: 94.590607 Z: 122.3088 -Vertex 22: X: 12.803238 Y: 94.590614 Z: 133.771301 -Vertex 23: X: -38.643349 Y: 94.590607 Z: 124.868355 -Vertex 24: X: -82.766846 Y: 94.590607 Z: 96.955307 -Vertex 25: X: -112.849762 Y: 94.590607 Z: 54.281677 -Vertex 26: X: -124.312256 Y: 94.590599 Z: 3.344152 -Vertex 27: X: -115.409271 Y: 94.590591 Z: -48.102493 -Vertex 28: X: -87.496201 Y: 94.590591 Z: -92.225967 -Vertex 29: X: -44.822552 Y: 94.590591 Z: -122.308861 -Vertex 30: X: 6.114983 Y: 94.590584 Z: -133.771332 -Vertex 31: X: 57.561623 Y: 94.590591 Z: -124.868301 -Vertex 32: X: 9.459057 Y: -87.419518 Z: 0.000008 -Vertex 33: X: 9.459057 Y: 94.590599 Z: -0.000008 -Face list: -Face 0: A:0 B:1 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 1: A:1 B:2 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 2: A:2 B:3 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 3: A:3 B:4 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 4: A:4 B:5 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 5: A:5 B:6 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 6: A:6 B:7 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 7: A:7 B:8 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 8: A:8 B:9 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 9: A:9 B:10 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 10: A:10 B:11 C:32 AB:1 BC:0 CA:0 - - Page 1 - - - -Smoothing: 1 -Face 11: A:11 B:12 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 12: A:12 B:13 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 13: A:13 B:14 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 14: A:14 B:15 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 15: A:15 B:0 C:32 AB:1 BC:0 CA:0 -Smoothing: 1 -Face 16: A:0 B:16 C:17 AB:1 BC:1 CA:0 -Smoothing: 2 -Face 17: A:0 B:17 C:1 AB:0 BC:1 CA:1 -Smoothing: 2 -Face 18: A:1 B:17 C:18 AB:1 BC:1 CA:0 -Smoothing: 3 -Face 19: A:1 B:18 C:2 AB:0 BC:1 CA:1 -Smoothing: 3 -Face 20: A:2 B:18 C:19 AB:1 BC:1 CA:0 -Smoothing: 4 -Face 21: A:2 B:19 C:3 AB:0 BC:1 CA:1 -Smoothing: 4 -Face 22: A:3 B:19 C:20 AB:1 BC:1 CA:0 -Smoothing: 5 -Face 23: A:3 B:20 C:4 AB:0 BC:1 CA:1 -Smoothing: 5 -Face 24: A:4 B:20 C:21 AB:1 BC:1 CA:0 -Smoothing: 6 -Face 25: A:4 B:21 C:5 AB:0 BC:1 CA:1 -Smoothing: 6 -Face 26: A:5 B:21 C:22 AB:1 BC:1 CA:0 -Smoothing: 7 -Face 27: A:5 B:22 C:6 AB:0 BC:1 CA:1 -Smoothing: 7 -Face 28: A:6 B:22 C:23 AB:1 BC:1 CA:0 -Smoothing: 8 -Face 29: A:6 B:23 C:7 AB:0 BC:1 CA:1 -Smoothing: 8 -Face 30: A:7 B:23 C:24 AB:1 BC:1 CA:0 -Smoothing: 9 -Face 31: A:7 B:24 C:8 AB:0 BC:1 CA:1 -Smoothing: 9 -Face 32: A:8 B:24 C:25 AB:1 BC:1 CA:0 -Smoothing: 10 -Face 33: A:8 B:25 C:9 AB:0 BC:1 CA:1 -Smoothing: 10 -Face 34: A:9 B:25 C:26 AB:1 BC:1 CA:0 -Smoothing: 11 -Face 35: A:9 B:26 C:10 AB:0 BC:1 CA:1 -Smoothing: 11 -Face 36: A:10 B:26 C:27 AB:1 BC:1 CA:0 -Smoothing: 12 -Face 37: A:10 B:27 C:11 AB:0 BC:1 CA:1 -Smoothing: 12 -Face 38: A:11 B:27 C:28 AB:1 BC:1 CA:0 -Smoothing: 13 -Face 39: A:11 B:28 C:12 AB:0 BC:1 CA:1 -Smoothing: 13 -Face 40: A:12 B:28 C:29 AB:1 BC:1 CA:0 -Smoothing: 14 - - Page 2 - - - -Face 41: A:12 B:29 C:13 AB:0 BC:1 CA:1 -Smoothing: 14 -Face 42: A:13 B:29 C:30 AB:1 BC:1 CA:0 -Smoothing: 15 -Face 43: A:13 B:30 C:14 AB:0 BC:1 CA:1 -Smoothing: 15 -Face 44: A:14 B:30 C:31 AB:1 BC:1 CA:0 -Smoothing: 16 -Face 45: A:14 B:31 C:15 AB:0 BC:1 CA:1 -Smoothing: 16 -Face 46: A:15 B:31 C:16 AB:1 BC:1 CA:0 -Smoothing: 17 -Face 47: A:15 B:16 C:0 AB:0 BC:1 CA:1 -Smoothing: 17 -Face 48: A:16 B:33 C:17 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 49: A:17 B:33 C:18 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 50: A:18 B:33 C:19 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 51: A:19 B:33 C:20 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 52: A:20 B:33 C:21 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 53: A:21 B:33 C:22 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 54: A:22 B:33 C:23 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 55: A:23 B:33 C:24 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 56: A:24 B:33 C:25 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 57: A:25 B:33 C:26 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 58: A:26 B:33 C:27 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 59: A:27 B:33 C:28 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 60: A:28 B:33 C:29 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 61: A:29 B:33 C:30 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 62: A:30 B:33 C:31 AB:0 BC:0 CA:1 -Smoothing: 18 -Face 63: A:31 B:33 C:16 AB:0 BC:0 CA:1 -Smoothing: 18 - - - - - - - - - - - - - - - - - Page 3 - - - diff --git a/progs/ggi/gears.c b/progs/ggi/gears.c deleted file mode 100644 index 2b3231d8ae..0000000000 --- a/progs/ggi/gears.c +++ /dev/null @@ -1,339 +0,0 @@ - -/* - * 3-D gear wheels. This program is in the public domain. - * - * Brian Paul - */ - -/* Conversion to GLUT by Mark J. Kilgard */ - -#include -#include -#include -#include - -#ifndef M_PI -#define M_PI 3.14159265 -#endif - -static GLint T0 = 0; -static GLint Frames = 0; - - -/** - - Draw a gear wheel. You'll probably want to call this function when - building a display list since we do a lot of trig here. - - Input: inner_radius - radius of hole at center - outer_radius - radius at center of teeth - width - width of gear - teeth - number of teeth - tooth_depth - depth of tooth - - **/ - -static void -gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth / 2.0; - r2 = outer_radius + tooth_depth / 2.0; - - da = 2.0 * M_PI / teeth / 4.0; - - glShadeModel(GL_FLAT); - - glNormal3f(0.0, 0.0, 1.0); - - /* draw front face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - if (i < teeth) { - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5); - } - } - glEnd(); - - /* draw front sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5); - } - glEnd(); - - glNormal3f(0.0, 0.0, -1.0); - - /* draw back face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - if (i < teeth) { - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - } - } - glEnd(); - - /* draw back sides of teeth */ - glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - } - glEnd(); - - /* draw outward faces of teeth */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - - glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); - glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); - u = r2 * cos(angle + da) - r1 * cos(angle); - v = r2 * sin(angle + da) - r1 * sin(angle); - len = sqrt(u * u + v * v); - u /= len; - v /= len; - glNormal3f(v, -u, 0.0); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); - glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5); - glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5); - u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da); - v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da); - glNormal3f(v, -u, 0.0); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5); - glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5); - glNormal3f(cos(angle), sin(angle), 0.0); - } - - glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5); - glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5); - - glEnd(); - - glShadeModel(GL_SMOOTH); - - /* draw inside radius cylinder */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; - glNormal3f(-cos(angle), -sin(angle), 0.0); - glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); - glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); - } - glEnd(); - -} - -static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; -static GLint gear1, gear2, gear3; -static GLfloat angle = 0.0; - -static void -draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); - - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(angle, 0.0, 0.0, 1.0); - glCallList(gear1); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(3.1, -2.0, 0.0); - glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0); - glCallList(gear2); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(-3.1, 4.2, 0.0); - glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0); - glCallList(gear3); - glPopMatrix(); - - glPopMatrix(); - - glutSwapBuffers(); - - Frames++; - { - GLint t = glutGet(GLUT_ELAPSED_TIME); - if (t - T0 >= 5000) { - GLfloat seconds = (t - T0) / 1000.0; - GLfloat fps = Frames / seconds; - printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps); - T0 = t; - Frames = 0; - } - } -} - - -static void -idle(void) -{ - angle += 2.0; - glutPostRedisplay(); -} - -/* change view angle, exit upon ESC */ -/* ARGSUSED1 */ -static void -key(unsigned char k, int x, int y) -{ - switch (k) { - case 'z': - view_rotz += 5.0; - break; - case 'Z': - view_rotz -= 5.0; - break; - case 27: /* Escape */ - exit(0); /* FIXME: Shutdown and free resources cleanly in ggiglut */ - break; - default: - return; - } - glutPostRedisplay(); -} - -/* change view angle */ -/* ARGSUSED1 */ -static void -special(int k, int x, int y) -{ - switch (k) { - case GLUT_KEY_UP: - view_rotx += 5.0; - break; - case GLUT_KEY_DOWN: - view_rotx -= 5.0; - break; - case GLUT_KEY_LEFT: - view_roty += 5.0; - break; - case GLUT_KEY_RIGHT: - view_roty -= 5.0; - break; - default: - return; - } - glutPostRedisplay(); -} - -/* new window size or exposure */ -static void -reshape(int width, int height) -{ - GLfloat h = (GLfloat) height / (GLfloat) width; - - glViewport(0, 0, (GLint) width, (GLint) height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0.0, 0.0, -40.0); -} - -static void -init(void) -{ - static GLfloat pos[4] = - {5.0, 5.0, 10.0, 0.0}; - static GLfloat red[4] = - {0.8, 0.1, 0.0, 1.0}; - static GLfloat green[4] = - {0.0, 0.8, 0.2, 1.0}; - static GLfloat blue[4] = - {0.2, 0.2, 1.0, 1.0}; - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear(1.0, 4.0, 1.0, 20, 0.7); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear(0.5, 2.0, 2.0, 10, 0.7); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear(1.3, 2.0, 0.5, 10, 0.7); - glEndList(); - - glEnable(GL_NORMALIZE); -} - -void -visible(int vis) -{ - if (vis == GLUT_VISIBLE) - glutIdleFunc(idle); - else - glutIdleFunc(NULL); -} - -int main(int argc, char *argv[]) -{ - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); - -// glutInitWindowPosition(0, 0); -// glutInitWindowSize(300, 300); - glutCreateWindow("Gears"); - init(); - - glutDisplayFunc(draw); - glutReshapeFunc(reshape); - glutKeyboardFunc(key); - glutSpecialFunc(special); - glutVisibilityFunc(visible); - - glutMainLoop(); - - return 0; -} diff --git a/progs/ggi/gears2.c b/progs/ggi/gears2.c deleted file mode 100644 index 9468c03177..0000000000 --- a/progs/ggi/gears2.c +++ /dev/null @@ -1,390 +0,0 @@ -/* gears.c */ - -/* - * 3-D gear wheels. This program is in the public domain. - * - * Brian Paul - * modified by Uwe Maurer (uwe_maurer@t-online.de) - */ - -#include -#include -#include -#include -#include -#ifndef M_PI -# define M_PI 3.14159265 -#endif - - -ggi_visual_t vis; -char text[100]; -int db_flag,vis_x, vis_y, vir_x, vir_y, gt; - -/* - * Draw a gear wheel. You'll probably want to call this function when - * building a display list since we do a lot of trig here. - * - * Input: inner_radius - radius of hole at center - * outer_radius - radius at center of teeth - * width - width of gear - * teeth - number of teeth - * tooth_depth - depth of tooth - */ -static void gear( GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth ) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth/2.0; - r2 = outer_radius + tooth_depth/2.0; - - da = 2.0*M_PI / teeth / 4.0; - - glShadeModel( GL_FLAT ); - - glNormal3f( 0.0, 0.0, 1.0 ); - - /* draw front face */ - glBegin( GL_QUAD_STRIP ); - for (i=0;i<=teeth;i++) { - angle = i * 2.0*M_PI / teeth; - glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 ); - glVertex3f( r1*cos(angle), r1*sin(angle), width*0.5 ); - glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 ); - glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), width*0.5 ); - } - glEnd(); - - /* draw front sides of teeth */ - glBegin( GL_QUADS ); - da = 2.0*M_PI / teeth / 4.0; - for (i=0;i GGI"); - ggiPuts(vis,0,ggiGetInfo(vis)->mode->visible.y," Mesa -> GGI"); - - ggiPuts(vis,0,16,text); - ggiPuts(vis,0,ggiGetInfo(vis)->mode->visible.y+16,text); -#endif - - if(db_flag) - ggiMesaSwapBuffers(); - - count++; - if (count==limit) { - exit(1); - } - ++n; - /* - if (!(n%10)){ - ggi_color rgb = { 10000, 10000, 10000 }; - ggiSetSimpleMode(vis,vis_x+(n/10),vis_y+(n/10),db_flag?2:1, gt); - glViewport(0, 0,vis_x+(n/10),vis_y+(n/10)); - ggiSetGCForeground(vis, ggiMapColor(vis, &rgb)); - ggiDrawBox(vis, 20, 20, 100, 100); - if(db_flag) - ggiSetWriteFrame(vis, 1); - } - */ -} - -static void idle( void ) -{ - angle += 2.0; - draw(); -} - -/* new window size or exposure */ -static void reshape( int width, int height ) -{ - GLfloat h = (GLfloat) height / (GLfloat) width; - - if(db_flag) - glDrawBuffer(GL_BACK); - else - glDrawBuffer(GL_FRONT); - glViewport(0, 0, (GLint)width, (GLint)height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum( -1.0, 1.0, -h, h, 5.0, 60.0 ); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -40.0 ); - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - -} - - -static void init( void ) -{ - static GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0 }; - static GLfloat red[4] = {0.9, 0.9, 0.9, 1.0 }; - static GLfloat green[4] = {0.0, 0.8, 0.9, 1.0 }; - static GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0 }; - - glLightfv( GL_LIGHT0, GL_POSITION, pos ); - glEnable( GL_CULL_FACE ); - glEnable( GL_LIGHTING ); - glEnable( GL_LIGHT0 ); - glEnable( GL_DEPTH_TEST ); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red ); - glIndexi(1); - gear( 1.0, 4.0, 1.0, 20, 0.7 ); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green ); - glIndexi(2); - gear( 0.5, 2.0, 2.0, 10, 0.7 ); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue ); - glIndexi(3); - gear( 1.3, 2.0, 0.5, 10, 0.7 ); - glEndList(); - - glEnable( GL_NORMALIZE ); -} - -static void usage(char *s) -{ - printf("%s visible_x visible_y virtual_x virtual_y bpp db_flag\n",s); - printf("example:\n"); - printf("%s 320 200 320 400 8 1\n",s); - exit(1); -} - -int main( int argc, char *argv[] ) -{ - ggi_mesa_context_t ctx; - ggi_mode mode; - int bpp; - - limit=0; - - if (argc<7) usage(argv[0]); - - vis_x=atoi(argv[1]); - vis_y=atoi(argv[2]); - vir_x=atoi(argv[3]); - vir_y=atoi(argv[4]); - bpp=atoi(argv[5]); - db_flag=atoi(argv[6]); - - switch(bpp) - { - case 4: gt=GT_4BIT;break; - case 8: gt=GT_8BIT;break; - case 15:gt=GT_15BIT;break; - case 16:gt=GT_16BIT;break; - case 24:gt=GT_24BIT;break; - case 32:gt=GT_32BIT;break; - default: - printf("%i Bits per Pixel ???\n",bpp); - exit(1); - } - sprintf(text,"%sx%s %i colors, RGB mode, %s", - argv[1],argv[2],1< -#include -#include -#include - - -__BEGIN_DECLS - -/* Exported variables */ -#ifdef BUILDING_GGIGLUT -extern uint32 _ggiglutDebugState; -extern int _ggiglutDebugSync; -#else -IMPORTVAR uint32 _ggiglutDebugState; -IMPORTVAR int _ggiglutDebugSync; -#endif - -__END_DECLS - - -/* Debugging types - * bit 0 is reserved! */ - -#define GGIGLUTDEBUG_CORE (1<<1) /* 2 */ -#define GGIGLUTDEBUG_MODE (1<<2) /* 4 */ -#define GGIGLUTDEBUG_COLOR (1<<3) /* 8 */ -#define GGIGLUTDEBUG_DRAW (1<<4) /* 16 */ -#define GGIGLUTDEBUG_MISC (1<<5) /* 32 */ -#define GGIGLUTDEBUG_LIBS (1<<6) /* 64 */ -#define GGIGLUTDEBUG_EVENTS (1<<7) /* 128 */ - -#define GGIGLUTDEBUG_ALL 0xffffffff - -#ifdef __GNUC__ - -#ifdef DEBUG -#define GGIGLUTDPRINT(form,args...) if (_ggiglutDebugState) { ggDPrintf(_ggiglutDebugSync, "GGIGLUT",form, ##args); } -#define GGIGLUTDPRINT_CORE(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_CORE) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } -#define GGIGLUTDPRINT_MODE(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_MODE) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } -#define GGIGLUTDPRINT_COLOR(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_COLOR) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } -#define GGIGLUTDPRINT_DRAW(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_DRAW) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } -#define GGIGLUTDPRINT_MISC(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_MISC) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } -#define GGIGLUTDPRINT_LIBS(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_LIBS) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } -#define GGIGLUTDPRINT_EVENTS(form,args...) if (_ggiglutDebugState & GGIGLUTDEBUG_EVENTS) { ggDPrintf(_ggiglutDebugSync,"GGIGLUT",form, ##args); } -#else /* DEBUG */ -#define GGIGLUTDPRINT(form,args...) do{}while(0) -#define GGIGLUTDPRINT_CORE(form,args...) do{}while(0) -#define GGIGLUTDPRINT_MODE(form,args...) do{}while(0) -#define GGIGLUTDPRINT_COLOR(form,args...) do{}while(0) -#define GGIGLUTDPRINT_DRAW(form,args...) do{}while(0) -#define GGIGLUTDPRINT_MISC(form,args...) do{}while(0) -#define GGIGLUTDPRINT_LIBS(form,args...) do{}while(0) -#define GGIGLUTDPRINT_EVENTS(form,args...) do{}while(0) -#endif /* DEBUG */ - -#else /* __GNUC__ */ - -__BEGIN_DECLS - -static inline void GGIGLUTDPRINT(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIGLUTDPRINT_CORE(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_CORE) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIGLUTDPRINT_MODE(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_MODE) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIGLUTDPRINT_COLOR(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_COLOR) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIGLUTDPRINT_DRAW(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_DRAW) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIGLUTDPRINT_MISC(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_MISC) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIGLUTDPRINT_LIBS(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_LIBS) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIGLUTDPRINT_EVENTS(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_EVENTS) { - va_list args; - - fprintf(stderr, "GGIGLUT: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggiglutDebugSync) fflush(stderr); - } -#endif -} - -__END_DECLS - -#endif /* __GNUC__ */ - -#ifdef DEBUG -#define GGIGLUT_ASSERT(x,str) \ -{ if (!(x)) { \ - fprintf(stderr,"GGIGLUT:%s:%d: INTERNAL ERROR: %s\n",__FILE__,__LINE__,str); \ - exit(1); \ -} } -#define GGIGLUT_APPASSERT(x,str) \ -{ if (!(x)) { \ - fprintf(stderr,"GGIGLUT:%s:%d: APPLICATION ERROR: %s\n",__FILE__,__LINE__,str); \ - exit(1); \ -} } -#else /* DEBUG */ -#define GGIGLUT_ASSERT(x,str) do{}while(0) -#define GGIGLUT_APPASSERT(x,str) do{}while(0) -#endif /* DEBUG */ - -#ifdef DEBUG -# define GGIGLUTD0(x) x -#else -# define GGIGLUTD0(x) /* empty */ -#endif - -#ifdef GGIGLUTDLEV -# if GGIGLUTDLEV == 1 -# define GGIGLUTD1(x) x -# define GGIGLUTD2(x) /* empty */ -# define GGIGLUTD3(x) /* empty */ -# elif GGIGLUTDLEV == 2 -# define GGIGLUTD1(x) x -# define GGIGLUTD2(x) x -# define GGIGLUTD3(x) /* empty */ -# elif GGIGLUTDLEV > 2 -# define GGIGLUTD1(x) x -# define GGIGLUTD2(x) x -# define GGIGLUTD3(x) x -# endif -#else -# define GGIGLUTD1(x) /* empty */ -# define GGIGLUTD2(x) /* empty */ -# define GGIGLUTD3(x) /* empty */ -#endif - -#endif /* _GGI_MESA_INTERNAL_DEBUG_H */ diff --git a/src/glut/ggi/ggiglut.c b/src/glut/ggi/ggiglut.c deleted file mode 100644 index 2fe65a154c..0000000000 --- a/src/glut/ggi/ggiglut.c +++ /dev/null @@ -1,959 +0,0 @@ -/* ************************************************************************** - * ggiglut.c - * ************************************************************************** - * - * Copyright (C) 1998 Uwe Maurer - uwe_maurer@t-online.de - * Copyright (C) 1999 James Simmons - * Copyright (C) 1999 Jon Taylor - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * ************************************************************************** - * To-do: - * - Make everything use the portable ggi_* types - * - */ - -#define BUILDING_GGIGLUT - -#define WIDTH 640 -#define HEIGHT 480 -#define GRAPHTYPE_RGB GT_16BIT -#define GRAPHTYPE_INDEX GT_8BIT - -/*************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "GL/ggimesa.h" -#include "debug.h" - -#include -#include - -int _ggiglutDebugSync = 0; -uint32 _ggiglutDebugState = 0; - -char *__glutProgramName = "GGI"; - -static ggi_visual_t __glut_vis; - -static ggi_mesa_context_t __glut_ctx; - -//static int __glut_width = WIDTH; -//static int __glut_height = HEIGHT; -//static ggi_graphtype __glut_gt_rgb = GRAPHTYPE_RGB; -//static ggi_graphtype __glut_gt_index = GRAPHTYPE_INDEX; -static int __glut_width = GGI_AUTO; -static int __glut_height = GGI_AUTO; -static ggi_graphtype __glut_gt_rgb = GT_AUTO; -static ggi_graphtype __glut_gt_index = GT_8BIT; -static int __glut_init = GL_FALSE; - -static int mousex = WIDTH / 2; -static int mousey = HEIGHT / 2; -static int mouse_moved = GL_FALSE; -static int mouse_down = GL_FALSE; -static int mouse_showcursor = GL_FALSE; - -static void (*__glut_reshape)(int, int); -static void (*__glut_display)(void); -static void (*__glut_idle)(void); -static void (*__glut_keyboard)(unsigned char, int, int); -static void (*__glut_special)(int, int, int); -static void (*__glut_mouse)(int, int, int, int); -static void (*__glut_motion)(int, int); -static void (*__glut_passive_motion)(int, int); -static void (*__glut_visibility)(int); - -static unsigned int __glut_mode = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH; - -static int __glut_mod_keys = 0; - -static int __glut_redisplay = GL_FALSE; - -/* Menu */ -static int __glut_menubutton = -1; -static int __glut_menuactive = GL_FALSE; - -#define MAX_ENTRIES 64 - -typedef struct menu_s -{ - char *label[MAX_ENTRIES]; - int value[MAX_ENTRIES]; - struct menu_s * submenu[MAX_ENTRIES]; - void (*func)(int); - int max_strlen; - int num_entries; -} menu_t; - -static menu_t *mainmenu; -static menu_t *curmenu; -static menu_t *activemenu; - -void glutInit(int *argc, char **argv) -{ - ggi_graphtype gt; - int i, k; - char *str; - - GGIGLUTDPRINT_CORE("glutInit() called\n"); - - #define REMOVE {for (k=i;k<*argc-1;k++) argv[k]=argv[k+1]; \ - (*argc)--; i--; } - - if (__glut_init) return; - - str = getenv("GGIGLUT_DEBUG"); - if (str != NULL) { - _ggiglutDebugState = atoi(str); - fprintf(stderr, "Debugging=%d\n", _ggiglutDebugState); - GGIGLUTDPRINT_CORE("Debugging=%d\n", _ggiglutDebugState); - } - - str = getenv("GGIGLUT_DEBUGSYNC"); - if (str != NULL) { - _ggiglutDebugSync = 1; - } - - if (argc && argv) - { - - for (i = 1; i < *argc; i++) - { - if (strcmp(argv[i], "-mouse") == 0) - { - mouse_showcursor = GL_TRUE; - REMOVE; - } - else - if (strcmp(argv[i], "-bpp") == 0 && (i + 1) < (*argc)) - { - switch(atoi(argv[i + 1])) - { - case 4: gt = GT_4BIT; break; - case 8: gt = GT_8BIT; break; - case 15: gt = GT_15BIT; break; - case 16: gt = GT_16BIT; break; - case 24: gt = GT_24BIT; break; - case 32: gt = GT_32BIT; break; - default: - ggiPanic("\"%s\" bits per pixel?\n", argv[i+1]); - } - __glut_gt_rgb = __glut_gt_index = gt; - REMOVE; - REMOVE; - } - else - if (strcmp(argv[i], "-size") == 0 && (i + 2) < (*argc)) - { - __glut_width = atoi(argv[i + 1]); - __glut_height = atoi(argv[i + 2]); - REMOVE; - REMOVE; - REMOVE; - } - } - } - - if (ggiInit() < 0) - { - ggiPanic("ggiInit() failed!\n"); - } - __glut_init = GL_TRUE; - -#undef REMOVE -} - -void glutInitWindowPosition(int x, int y) -{ - GGIGLUTDPRINT_CORE("glutInitWindowPosition() called\n"); -} - -void glutInitWindowSize(int x, int y) -{ - GGIGLUTDPRINT_CORE("glutInitWindowsSize() called\n"); -} - -void glutFullScreen(void) -{ - GGIGLUTDPRINT_CORE("glutFullScreen() called\n"); -} - -void glutInitDisplayMode(unsigned int mode) -{ - GGIGLUTDPRINT_CORE("glutInitDisplayMode() called\n"); - - __glut_mode = mode; -} - -void glutInitDisplayString(const char *string) -{ - GGIGLUTDPRINT_CORE("glutInitDisplayString(%s) called\n", string); -} - -int glutCreateWindow(const char *title) -{ - ggi_graphtype gt; - ggi_mode mode = - { - 1, - { GGI_AUTO, GGI_AUTO }, - { GGI_AUTO, GGI_AUTO }, - { 0, 0 }, - GT_AUTO, - { GGI_AUTO, GGI_AUTO } - }; - int frames; - int rgb; - int err; - - GGIGLUTDPRINT_CORE("glutCreateWindow() called\n"); - - if (!__glut_init) - glutInit(NULL, NULL); - - GGIGLUTDPRINT("GGIGLUT: %s\n", title); - - rgb = !(__glut_mode & GLUT_INDEX); - frames = (__glut_mode & GLUT_DOUBLE) ? 2 : 1; - - gt = (rgb) ? __glut_gt_rgb : __glut_gt_index; - - __glut_vis = ggiOpen(NULL); - if (__glut_vis == NULL) - { - ggiPanic("ggiOpen() failed!\n"); - /* return GL_FALSE; */ - } - - ggiSetFlags(__glut_vis, GGIFLAG_ASYNC); - - ggiCheckMode(__glut_vis, &mode); - - err = ggiSetMode(__glut_vis, &mode); - if (err < 0) - { - ggiPanic("Can't set graphic mode!\n"); - /* return GL_FALSE; */ - } - - if (ggiMesaExtendVisual(__glut_vis, GL_FALSE, GL_FALSE, - 16, 0, 0, 0, 0, 0, 1) < 0) - { - ggiPanic("GGIMesaSetVisual failed!\n"); - } - - __glut_ctx = ggiMesaCreateContext(__glut_vis); - - if (__glut_ctx == NULL) - ggiPanic("Can't create mesa-context\n"); - - ggiGetMode(__glut_vis, &mode); - - - __glut_width = mode.visible.x; - __glut_height = mode.visible.y; - - mousex = mode.visible.x / 2; - mousey = mode.visible.y / 2; - - ggiMesaMakeCurrent(__glut_ctx, __glut_vis); - - if (__glut_reshape) - __glut_reshape(__glut_width, __glut_height); - - return GL_TRUE; -} - -void glutReshapeFunc(void (*func)(int, int)) -{ - GGIGLUTDPRINT_CORE("glutReshapeFunc() called\n"); - - __glut_reshape = func; - if (__glut_vis && __glut_reshape) - __glut_reshape(__glut_width, __glut_height); -} - -void glutKeyboardFunc(void (*keyboard)(unsigned char key, int x, int y)) -{ - GGIGLUTDPRINT_CORE("glutKeyBoardFunc() called\n"); - - __glut_keyboard = keyboard; -} - -int glutGetModifiers(void) -{ - GGIGLUTDPRINT_CORE("glutGetModifiers() called\n"); - - return __glut_mod_keys; -} - -void glutEntryFunc(void (*func)(int state)) -{ - GGIGLUTDPRINT_CORE("glutEntryFunc() called\n"); -} - -void glutVisibilitFunc(void (*func)(int state)) -{ - GGIGLUTDPRINT_CORE("glutVisibilityFunc() called\n"); -} - -void glutTimerFunc(unsigned int millis, void (*func)(int value), int value) -{ - GGIGLUTDPRINT_CORE("glutTimerFunc() called\n"); -} - -void glutMenuStateFunc(void (*func)(int state)) -{ - GGIGLUTDPRINT_CORE("glutMenuStateFunc() called\n"); -} - -int glutGet(GLenum type) -{ - GGIGLUTDPRINT_CORE("glutGet() called\n"); - - switch(type) - { - case GLUT_WINDOW_X: - return 0; - case GLUT_WINDOW_Y: - return 0; - case GLUT_WINDOW_WIDTH: - return __glut_width; - case GLUT_WINDOW_HEIGHT: - return __glut_height; - case GLUT_MENU_NUM_ITEMS: - if (curmenu) - return curmenu->num_entries; - else - return 0; - default: - GGIGLUTDPRINT("glutGet: unknown type %i\n", type); - } - return 0; -} - -void glutSpecialFunc(void (*special)(int key, int x, int y)) -{ - GGIGLUTDPRINT_CORE("glutSpecialFunc() called\n"); - - __glut_special=special; -} - -void glutDisplayFunc(void (*disp)(void)) -{ - GGIGLUTDPRINT_CORE("glutDisplayFunc() called\n"); - __glut_display=disp; -} - -void glutSetColor(int index, GLfloat red, GLfloat green, GLfloat blue) -{ - ggi_color c; - GLfloat max; - - GGIGLUTDPRINT_CORE("glutSetColor() called\n"); - - if (red > 1.0) red = 1.0; - if (red < 0.0) red = 0.0; - if (green > 1.0) green = 1.0; - if (green < 0.0) green = 0.0; - if (blue > 1.0) blue = 1.0; - if (blue < 0.0) blue = 0.0; - - max = (float)((1 << GGI_COLOR_PRECISION) - 1); - - c.r = (int)(max * red); - c.g = (int)(max * green); - c.b = (int)(max * blue); - ggiSetPalette(__glut_vis, index, 1, &c); -} - -void glutPostRedisplay(void) -{ - GGIGLUTDPRINT_CORE("glutPostRedisplay() called\n"); - - __glut_redisplay = GL_TRUE; -} - -void glutPostWindowRedisplay(int win) -{ - GGIGLUTDPRINT_CORE("glutPostWindowRedisplay() called\n"); - - __glut_redisplay = GL_TRUE; -} - -void glutSwapBuffers(void) -{ - GGIGLUTDPRINT_CORE("glutSwapBuffers() called\n"); - - ggiMesaSwapBuffers(); -} - -void glutIdleFunc(void (*idle)(void)) -{ - GGIGLUTDPRINT_CORE("glutIdleFunc() called\n"); - - __glut_idle = idle; -} - -static void keyboard(ggi_event *ev) -{ - int sym; - int modifer = 0, key = 0; - - GGIGLUTDPRINT_CORE("keyboard() called\n"); - - sym = ev->key.sym; - - modifer = ev->key.modifiers; - if (modifer == GII_KM_SHIFT) - __glut_mod_keys |= GLUT_ACTIVE_SHIFT; - if (modifer == GII_KM_CTRL) - __glut_mod_keys |= GLUT_ACTIVE_CTRL; - if (modifer == GII_KM_ALT) - __glut_mod_keys |= GLUT_ACTIVE_ALT; - - /* if (__glut_special && key) __glut_special(GII_KTYP(key),0,0); */ - - if (__glut_keyboard) -// __glut_keyboard(GII_UNICODE(sym), 0, 0); - __glut_keyboard(sym, 0, 0); -} - -static void mouseabs(ggi_event *ev) -{ - int oldx = mousex; - int oldy = mousey; - - mousex = ev->pmove.x; - mousey = ev->pmove.y; - - if (mousex < 0) mousex = 0; - if (mousey < 0) mousey = 0; - if (mousex >= __glut_width) mousex = __glut_width - 1; - if (mousey >= __glut_height) mousey = __glut_height - 1; - - if (mousex != oldx || mousey != oldy) mouse_moved = GL_TRUE; -} - -static void mouse(ggi_event *ev) -{ - int oldx = mousex; - int oldy = mousey; - - GGIGLUTDPRINT_CORE("mouse() called\n"); - - mousex += ev->pmove.x >> 1; - mousey += ev->pmove.y >> 1; - - if (mousex < 0) mousex = 0; - if (mousey < 0) mousey = 0; - if (mousex >= __glut_width) mousex = __glut_width - 1; - if (mousey >= __glut_height) mousey = __glut_height - 1; - - if (mousex != oldx || mousey != oldy) mouse_moved = GL_TRUE; - -} - -static void showmenu(void); -static int clickmenu(void); -static void updatemouse(void); -static void drawmouse(void); - -static void mousemove(void) -{ - GGIGLUTDPRINT_CORE("mousemove() called\n"); - - if (mouse_moved) { - if (__glut_motion && mouse_down) { - __glut_motion(mousex,mousey); - } - - if (__glut_passive_motion && (!mouse_down)) { - __glut_passive_motion(mousex,mousey); - } - - if (__glut_menuactive) updatemouse(); - mouse_moved=GL_FALSE; - } -} - -static void button(ggi_event *ev) -{ - int i; - int btn[4] = { - 0, - GLUT_LEFT_BUTTON, - GLUT_RIGHT_BUTTON, - GLUT_MIDDLE_BUTTON - }; - - GGIGLUTDPRINT_CORE("button() called\n"); - - mousemove(); - - if (ev->pbutton.button <= 3) { /* GGI can have >3 buttons ! */ - char state = ev->any.type == evPtrButtonPress ? GLUT_DOWN : GLUT_UP; - if (__glut_menuactive) { - if (state == GLUT_UP && clickmenu()) { - glutPostRedisplay(); - __glut_menuactive = GL_FALSE; - } - } else - if (btn[ev->pbutton.button] == __glut_menubutton) { - __glut_menuactive = GL_TRUE; - activemenu = mainmenu; - showmenu(); - } else - if (__glut_mouse) { - __glut_mouse(btn[ev->pbutton.button], state, mousex, mousey); - } - if (state == GLUT_DOWN) { - mouse_down |= (1 << (ev->pbutton.button - 1)); - } - else mouse_down &= ~( 1 << (ev->pbutton.button - 1)); - } -} - -void glutMainLoop(void) -{ - ggi_event ev; - ggi_event_mask evmask = (emKeyPress | emKeyRepeat | emPtrMove | emPtrButton); - - GGIGLUTDPRINT_CORE("glutMainLoop() called\n"); - - ggiSetEventMask(__glut_vis, evmask); - - glutPostRedisplay(); - - if (__glut_visibility) - __glut_visibility(GLUT_VISIBLE); - - while (1) - { - if (!__glut_menuactive) - { - if (__glut_idle) - __glut_idle(); - if (__glut_redisplay && __glut_display) - { - __glut_redisplay = GL_FALSE; - __glut_display(); - } - } - - while (1) - { - struct timeval t = {0, 0}; - - if (ggiEventPoll(__glut_vis, evmask, &t) == 0) - break; - - ggiEventRead(__glut_vis, &ev, evmask); - - switch (ev.any.type) - { - case evKeyPress: - case evKeyRepeat: - keyboard(&ev); - break; - case evPtrAbsolute: - mouseabs(&ev); - break; - case evPtrRelative: - mouse(&ev); - break; - case evPtrButtonPress: - case evPtrButtonRelease: - button(&ev); - break; - } - } - mousemove(); - } -} - -static void showmenu() -{ - int y,i; - ggi_color col = { 0xffff, 0xffff, 0xffff }; - - GGIGLUTDPRINT_CORE("showmenu() called\n"); - - ggiSetGCForeground(__glut_vis,ggiMapColor(__glut_vis,&col)); - ggiSetOrigin(__glut_vis,0,0); - - for (y = i = 0; i < activemenu->num_entries; i++, y += 8) { - ggiPuts(__glut_vis, 0, y, activemenu->label[i]); - } - drawmouse(); -} - -static int clickmenu(void) -{ - int i; - int w, h; - - GGIGLUTDPRINT_CORE("clickmenu() called\n"); - - i = mousey / 8; - - if (i >= activemenu->num_entries) return GL_TRUE; - if (mousex >= 8 * strlen(activemenu->label[i])) return GL_TRUE; - - if (activemenu->submenu[i]) { - ggi_color col={0,0,0}; - ggiSetGCForeground(__glut_vis,ggiMapColor(__glut_vis,&col)); - h=activemenu->num_entries*8; - w=activemenu->max_strlen*8; - ggiDrawBox(__glut_vis,0,0,w,h); - activemenu=activemenu->submenu[i]; - showmenu(); - return GL_FALSE; - } - curmenu=activemenu; - activemenu->func(activemenu->value[i]); - return GL_TRUE; -} - -static int oldx=-1; -static int oldy=-1; -static char buffer[16*16*4]; - -static void updatemouse() -{ - GGIGLUTDPRINT_CORE("updatemouse() called\n"); - - ggiPutBox(__glut_vis,oldx,oldy,16,16,buffer); - drawmouse(); -} - -static void drawmouse() -{ - int x,y; - - GGIGLUTDPRINT_CORE("drawmouse() called\n"); - - x=mousex-8; - if (x<0) x=0; - y=mousey-8; - if (y<0) y=0; - ggiGetBox(__glut_vis,x,y,16,16,buffer); - ggiDrawLine(__glut_vis,mousex-2,mousey,mousex+2,mousey); - ggiDrawLine(__glut_vis,mousex,mousey-2,mousex,mousey+2); - oldx=x; - oldy=y; -} - -int glutCreateMenu(void(*func)(int)) -{ - menu_t *m; - - GGIGLUTDPRINT_CORE("glutCreateMenu() called\n"); - - m=malloc(sizeof(menu_t)); - memset(m,0,sizeof(menu_t)); - curmenu=m; - curmenu->func=func; - return (int)curmenu; -} - -static void addEntry(const char *label,int value,menu_t *submenu) -{ - int i=curmenu->num_entries; - - GGIGLUTDPRINT_CORE("addEntry() called\n"); - - /* printf("%i %i %s %p\n",i,value,label,submenu); */ - if (ilabel[i]=strdup(label); - curmenu->value[i]=value; - curmenu->submenu[i]=submenu; - - if (strlen(label)>curmenu->max_strlen) - curmenu->max_strlen=strlen(label); - curmenu->num_entries++; - } -} - -void glutAddMenuEntry(const char *label,int value) -{ - GGIGLUTDPRINT_CORE("glutAddMenuEntry() called\n"); - - addEntry(label,value,NULL); -} - -void glutAddSubMenu(const char *label,int submenu) -{ - char text[100]; - - GGIGLUTDPRINT_CORE("glutAddSubMenu() called\n"); - - if (!curmenu) return; - strncpy(text,label,98); - text[98]=0; - text[strlen(text)+1]=0; - text[strlen(text)]='>'; - - addEntry(text,0,(menu_t *) submenu); -} - -void glutAttachMenu(int button) -{ - GGIGLUTDPRINT_CORE("glutAttachMenu() called\n"); - - mainmenu=curmenu; - __glut_menubutton=button; -} - -void glutDetachMenu(int button) -{ - GGIGLUTDPRINT_CORE("glutDetachMenu() called\n"); -} - -void glutVisibilityFunc(void (*func)(int state)) -{ - GGIGLUTDPRINT_CORE("glutVisibilityFunc() called\n"); - - __glut_visibility=func; -} - -void glutMouseFunc(void (*mouse)(int, int, int, int)) -{ - GGIGLUTDPRINT_CORE("glutMouseFunc() called\n"); - - __glut_mouse=mouse; -} - -void glutMotionFunc(void (*motion)(int,int)) -{ - GGIGLUTDPRINT_CORE("glutMotionFunc() called\n"); - - __glut_motion=motion; -} - -void glutPassiveMotionFunc(void (*motion)(int,int)) -{ - GGIGLUTDPRINT_CORE("glutPassiveMotionFunc() called\n"); - - __glut_passive_motion=motion; -} - -void glutSetWindowTitle(const char *title) -{ - GGIGLUTDPRINT_CORE("glutSetWindowTitle() called\n"); -} - -void glutSetIconTitle(const char *title) -{ - GGIGLUTDPRINT_CORE("glutSetIconTitle() called\n"); -} - -void glutChangeToMenuEntry(int item,const char *label,int value) -{ - GGIGLUTDPRINT_CORE("glutChangeToMenuEntry() called\n"); - - if (item>0 && item<=curmenu->num_entries) { - item--; - free(curmenu->label[item]); - curmenu->label[item]=strdup(label); - curmenu->value[item]=value; - curmenu->submenu[item]=NULL; - } -} -void glutChangeToSubMenu(int item,const char *label,int submenu) -{ - GGIGLUTDPRINT_CORE("glutChengeToSubMenu() called\n"); - - if (item>0 && item<=curmenu->num_entries) { - item--; - free(curmenu->label[item]); - curmenu->label[item]=strdup(label); - curmenu->value[item]=0; - curmenu->submenu[item]=(menu_t *)submenu; - } -} - -void glutDestroyMenu(int menu) -{ - menu_t *m=(menu_t *)menu; - int i; - - GGIGLUTDPRINT_CORE("glutDestroyMenu() called\n"); - - for (i=0;inum_entries;i++) { - free(m->label[i]); - } - free(m); -} - -int glutCreateSubWindow(int win,int x,int y,int w,int h) -{ - GGIGLUTDPRINT_CORE("glutCreateSubWindow() called\n"); - - return 0; -} - -void glutDestroyWindow(int win) -{ - GGIGLUTDPRINT_CORE("glutDestroyWindow() called\n"); -} - -int glutGetWindow(void) -{ - GGIGLUTDPRINT_CORE("glutGetWindow() called\n"); - - return 0; -} - -void glutSetWindow(int win) -{ - GGIGLUTDPRINT_CORE("glutSetWindow() called\n"); -} - -void glutPositionWindow(int x,int y) -{ - GGIGLUTDPRINT_CORE("glutPositionWindow() called\n"); -} - -void glutReshapeWindow(int x,int y) -{ - GGIGLUTDPRINT_CORE("glutReshapeWindow() called\n"); -} - -void glutPushWindow(void) -{ - GGIGLUTDPRINT_CORE("glutPushWindow() called\n"); -} - -void glutPopWindow(void) -{ - GGIGLUTDPRINT_CORE("glutPopWindow() called\n"); -} - -void glutIconifyWindow(void) -{ - GGIGLUTDPRINT_CORE("glutIconifyWindow() called\n"); -} - -void glutShowWindow() -{ - GGIGLUTDPRINT_CORE("glutShowWindow() called\n"); -} - -void glutHideWindow() -{ - GGIGLUTDPRINT_CORE("glutHideWindow() called\n"); -} - -void glutSetCursor(int cursor) -{ - GGIGLUTDPRINT_CORE("glutSetCursor() called\n"); -} - -void glutWarpPointer(int x,int y) -{ - GGIGLUTDPRINT_CORE("glutWarpPointer() called\n"); -} - -void glutEstablishOverlay(void) -{ - GGIGLUTDPRINT_CORE("glutEstablishOverlay() called\n"); -} - -void glutRemoveOverlay(void) -{ - GGIGLUTDPRINT_CORE("glutRemoveOverlay() called\n"); -} - -void glutUseLayer(GLenum layer) -{ - GGIGLUTDPRINT_CORE("glutUseLayer() called\n"); -} - -int glutLayerGet(GLenum type) -{ - GGIGLUTDPRINT_CORE("glutLayerGet() called\n"); - return 0; -} - -void glutPostOverlayRedisplay(void) -{ - GGIGLUTDPRINT_CORE("glutPostOverlayRedisplay() called\n"); -} - -void glutPostWindowOverlayRedisplay(int w) -{ - GGIGLUTDPRINT_CORE("glutPostWindowOverlayRedisplay() called\n"); -} - -void glutShowOverlay(void) -{ - GGIGLUTDPRINT_CORE("glutShowOverlay() called\n"); -} - -void glutHideOverlay(void) -{ - GGIGLUTDPRINT_CORE("glutHideOverlay() called\n"); -} - -int glutGetMenu(void) -{ - GGIGLUTDPRINT_CORE("glutGetMenu() called\n"); - return 0; -} - -void glutSetMenu(int menu) -{ - GGIGLUTDPRINT_CORE("glutSetMenu() called\n"); -} - -void glutRemoveMenuItem(int item) -{ - GGIGLUTDPRINT_CORE("glutRemoveMenuItem() called\n"); -} - -void glutSpaceBallMotionFunc(void (*func)(int key,int x,int y)) -{ - GGIGLUTDPRINT_CORE("glutSpaceBallMotionFunc() called\n"); -} - -void glutSpaceBallRotateFunc(void (*func)(int x,int y,int z)) -{ - GGIGLUTDPRINT_CORE("glutSpaceBallRotateFunc() called\n"); -} - -void glutSpaceBallButtonFunc(void (*func)(int button,int state)) -{ - GGIGLUTDPRINT_CORE("glutSpaceBallButtonFunc() called\n"); -} - -void glutCopyColormap(int win) -{ - GGIGLUTDPRINT_CORE("glutCopyColormap() called\n"); -} - -int glutDeviceGet(GLenum param) -{ - GGIGLUTDPRINT_CORE("glutDeviceGet() called\n"); - - return 0; -} diff --git a/src/mesa/drivers/ggi/default/.gitignore b/src/mesa/drivers/ggi/default/.gitignore deleted file mode 100644 index c8a526b14d..0000000000 --- a/src/mesa/drivers/ggi/default/.gitignore +++ /dev/null @@ -1 +0,0 @@ -genkgi.conf diff --git a/src/mesa/drivers/ggi/default/genkgi.conf.in b/src/mesa/drivers/ggi/default/genkgi.conf.in deleted file mode 100644 index 02acad2a19..0000000000 --- a/src/mesa/drivers/ggi/default/genkgi.conf.in +++ /dev/null @@ -1,4 +0,0 @@ -# GGIMesa genkgi helper configuration -.root: @ggi_libdir@/ggi/mesa/default - -tgt-fbdev-kgicon-d3dim-mesa d3dim.so diff --git a/src/mesa/drivers/ggi/default/genkgi.h b/src/mesa/drivers/ggi/default/genkgi.h deleted file mode 100644 index 6d0963416f..0000000000 --- a/src/mesa/drivers/ggi/default/genkgi.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -****************************************************************************** - - GGIMesa - KGIcon specific overrides for fbcon-mesa - API header - - Copyright (C) 1999 Jon Taylor [taylorj@ggi-project.org] - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -****************************************************************************** -*/ - -#ifndef _GENKGI_MESA_H -#define _GENKGI_MESA_H - -#undef KGI_USE_PPBUFS - -#include -#include - -#include -#include -#include - -#ifndef MAP_FAILED -#define MAP_FAILED ((void *)-1) -#endif - -/* FIXME: LibGGI needs to export its genkgi.h */ -struct genkgi_priv -{ - ggi_gc *mapped_gc; - unsigned int gc_size; - ggifunc_drawline *drawline; - ggifunc_drawbox *drawbox; - ggifunc_fillscreen *fillscreen; - int fd_gc; - int close_gc; - int fd_kgicommand; - uint8 *mapped_kgicommand; - uint8 *kgicommand_ptr; - unsigned int kgicommand_buffersize; -}; - -#define GENKGI_PRIV(vis) ((struct genkgi_priv *)FBDEV_PRIV(vis)->accelpriv) - -extern ggifunc_getapi GGIMesa_genkgi_getapi; -extern ggifunc_flush GGIMesa_genkgi_flush; - -struct genkgi_priv_mesa -{ - char accel[100]; - int have_accel; - void *accelpriv; /* Private data of subdrivers */ - struct genkgi_priv *oldpriv; /* LibGGI's private data */ -}; - -#define GENKGI_PRIV_MESA(vis) ((struct genkgi_priv_mesa *)FBDEV_PRIV_MESA(vis)->accelpriv) - -#endif /* _GENKHI_MESA_H */ diff --git a/src/mesa/drivers/ggi/default/genkgi_mode.c b/src/mesa/drivers/ggi/default/genkgi_mode.c deleted file mode 100644 index f81d6a45bd..0000000000 --- a/src/mesa/drivers/ggi/default/genkgi_mode.c +++ /dev/null @@ -1,97 +0,0 @@ -/* -****************************************************************************** - - display-fbdev-kgicon-generic-mesa - - Copyright (C) 1999 Jon Taylor [taylorj@ggi-project.org] - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -****************************************************************************** -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "genkgi.h" - -int GGIMesa_genkgi_getapi(ggi_visual *vis, int num, char *apiname, char *arguments) -{ - struct genkgi_priv_mesa *priv = GENKGI_PRIV_MESA(vis); - - GGIMESADPRINT_CORE("Entered mesa_genkgi_getapi, num=%d\n", num); - - strcpy(arguments, ""); - - switch(num) - { - case 0: - if (priv->have_accel) - { - strcpy(apiname, priv->accel); - return 0; - } - break; - } - return -1; -} - -int GGIMesa_genkgi_flush(ggi_visual *vis, int x, int y, int w, int h, int tryflag) -{ - struct genkgi_priv_mesa *priv = GENKGI_PRIV_MESA(vis); - int junkval; - - priv->oldpriv->kgicommand_ptr += getpagesize(); - (kgiu32)(priv->oldpriv->kgicommand_ptr) &= 0xfffff000; - junkval = *((int *)(priv->oldpriv->kgicommand_ptr)); - - /* Check if we are now in the last page, and reset the - * FIFO if so. We can't use the last page to send - * more commands, since there's no page after it that - * we can touch to fault in the last page's commands. - * - * FIXME: This will be replaced with a flush-and-reset handler - * on the end-of-buffer pagefault at some point.... - * - */ - if ((priv->oldpriv->kgicommand_ptr - priv->oldpriv->mapped_kgicommand) - >= (priv->oldpriv->kgicommand_buffersize - getpagesize())) - { - munmap(priv->oldpriv->mapped_kgicommand, priv->oldpriv->kgicommand_buffersize); - if ((priv->oldpriv->mapped_kgicommand = - mmap(NULL, - priv->oldpriv->kgicommand_buffersize, - PROT_READ | PROT_WRITE, - MAP_SHARED, - priv->oldpriv->fd_kgicommand, - 0)) == MAP_FAILED) - { - ggiPanic("Failed to remap kgicommand!"); - } - priv->oldpriv->kgicommand_ptr = priv->oldpriv->mapped_kgicommand; - } - return 0; -} diff --git a/src/mesa/drivers/ggi/default/genkgi_visual.c b/src/mesa/drivers/ggi/default/genkgi_visual.c deleted file mode 100644 index d7838cae6e..0000000000 --- a/src/mesa/drivers/ggi/default/genkgi_visual.c +++ /dev/null @@ -1,190 +0,0 @@ -/* -****************************************************************************** - - genkgi_visual.c: visual handling for the generic KGI helper - - Copyright (C) 1999 Jon Taylor [taylorj@ggi-project.org] - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -****************************************************************************** -*/ - -#include -#include -#include -#include -#include "genkgi.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_SYS_VT_H -#include -#else -#include -#endif -#ifdef HAVE_LINUX_KDEV_T_H -#include -#endif -#include - -#define DEFAULT_FBNUM 0 - -static char accel_prefix[] = "tgt-fbdev-kgicon-"; -#define PREFIX_LEN (sizeof(accel_prefix)) - -typedef struct { - int async; - char *str; -} accel_info; - -static accel_info accel_strings[] = -{ - { 0, "d3dim" }, /* Direct3D Immediate Mode */ -}; - -#define NUM_ACCELS (sizeof(accel_strings)/sizeof(accel_info)) - -/* FIXME: These should be defined in the makefile system */ -#define CONF_FILE "/usr/local/etc/ggi/mesa/targets/genkgi.conf" -void *_configHandle; -char confstub[512] = CONF_FILE; -char *conffile = confstub; - -static int changed(ggi_visual_t vis, int whatchanged) -{ - GGIMESADPRINT_CORE("Entered ggimesa_genkgi_changed\n"); - - switch (whatchanged) - { - case GGI_CHG_APILIST: - { - char api[256]; - char args[256]; - int i; - const char *fname; - ggi_dlhandle *lib; - - for (i = 0; ggiGetAPI(vis, i, api, args) == 0; i++) - { - strcat(api, "-mesa"); - GGIMESADPRINT_CORE("ggimesa_genkgi_changed: api=%s, i=%d\n", api, i); - fname = ggMatchConfig(_configHandle, api, NULL); - if (fname == NULL) - { - /* No special implementation for this sublib */ - continue; - } - - lib = ggiExtensionLoadDL(vis, fname, args, NULL); - } - } - break; - } - return 0; -} - -static int GGIdlinit(ggi_visual *vis, struct ggi_dlhandle *dlh, - const char *args, void *argptr, uint32 *dlret) -{ - struct genkgi_priv_mesa *priv; - char libname[256], libargs[256]; - int id, err; - struct stat junk; - ggifunc_getapi *oldgetapi; - - GGIMESADPRINT_CORE("display-fbdev-kgicon-mesa: GGIdlinit start\n"); - - GENKGI_PRIV_MESA(vis) = priv = malloc(sizeof(struct genkgi_priv_mesa)); - if (priv == NULL) - { - fprintf(stderr, "Failed to allocate genkgi private data\n"); - return GGI_DL_ERROR; - } - - priv->oldpriv = GENKGI_PRIV(vis); -#if 0 - err = ggLoadConfig(conffile, &_configHandle); - if (err != GGI_OK) - { - gl_ggiPrint("display-fbdev-kgicon-mesa: Couldn't open %s\n", conffile); - return err; - } - - /* Hack city here. We need to probe the KGI driver properly for - * suggest-strings to discover the acceleration type(s). - */ - priv->have_accel = 0; - - if (stat("/proc/gfx0", &junk) == 0) - { - sprintf(priv->accel, "%s%s", accel_prefix, "d3dim"); - priv->have_accel = 1; - GGIMESADPRINT_CORE("display-fbdev-kgicon-mesa: Using accel: \"%s\"\n", priv->accel); - } - - /* Mode management */ - vis->opdisplay->getapi = GGIMesa_genkgi_getapi; - ggiIndicateChange(vis, GGI_CHG_APILIST); - - /* Give the accel sublibs a chance to set up a driver */ - if (priv->have_accel == 1) - { - oldgetapi = vis->opdisplay->getapi; - vis->opdisplay->getapi = GGIMesa_genkgi_getapi; - changed(vis, GGI_CHG_APILIST); - /* If the accel sublibs didn't produce, back up - * and keep looking */ - if ((LIBGGI_MESAEXT(vis)->update_state == NULL) || - (LIBGGI_MESAEXT(vis)->setup_driver == NULL)) - vis->opdisplay->getapi = oldgetapi; - } - - LIBGGI_MESAEXT(vis)->update_state = genkgi_update_state; - LIBGGI_MESAEXT(vis)->setup_driver = genkgi_setup_driver; -#endif - GGIMESADPRINT_CORE("display-fbdev-kgicon-mesa: GGIdlinit finished\n"); - - *dlret = GGI_DL_OPDRAW; - return 0; -} - -int MesaGGIdl_fbdev(int func, void **funcptr) -{ - switch (func) { - case GGIFUNC_open: - *funcptr = GGIopen; - return 0; - case GGIFUNC_exit: - case GGIFUNC_close: - *funcptr = NULL; - return 0; - default: - *funcptr = NULL; - } - return GGI_ENOTFOUND; -} - -#include diff --git a/src/mesa/drivers/ggi/default/linear.c b/src/mesa/drivers/ggi/default/linear.c deleted file mode 100644 index 9d29761ad5..0000000000 --- a/src/mesa/drivers/ggi/default/linear.c +++ /dev/null @@ -1,409 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#include -#include -#include -#include "swrast/swrast.h" - -#define RMASK ((1<>RS) << (G+B)) | \ - ((color[GCOMP]>>GS) << B) | \ - ((color[BCOMP]>>BS))) - -#define FLIP(coord) (LIBGGI_VIRTY(ggi_ctx->ggi_visual) - (coord) - 1) - - -/**********************************************************************/ -/***** Write spans of pixels *****/ -/**********************************************************************/ - -void GGIwrite_ci32_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLuint ci[], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - if (mask) { - while (n--) { - if (*mask++) - *fb = *ci; - fb++; - ci++; - } - } else { - while (n--) *fb++ = *ci++; - } -} - -void GGIwrite_ci8_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte ci[], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - if (mask) { - while (n--) { - if (*mask++) - *fb = *ci; - fb++; - ci++; - } - } else { - while (n--) *fb++ = *ci++; - } -} - - -void GGIwrite_rgba_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLchan rgba[][4], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - if (mask) { - while (n--) { - if (*mask++) - *fb = PACK(rgba[0]); - fb++; - rgba++; - } - } else { - while (n--) { - *fb++ = PACK(rgba[0]); - rgba++; - } - } -} - -void GGIwrite_rgb_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLchan rgba[][3], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - if (mask) { - while (n--) { - if (*mask++) - *fb = PACK(rgba[0]); - fb++; - rgba++; - } - } else { - while (n--) { - *fb++ = PACK(rgba[0]); - rgba++; - } - } -} - - -void GGIwrite_mono_rgba_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - if (mask) { - while (n--){ - if (*mask++) - *fb = PACK(color); - ++fb; - } - } else { - while (n--) - *fb++ = PACK(color); - - /* Alternatively we could write a potentialy faster HLine - ggiSetGCForeground(ggi_ctx->ggi_visual, color); - ggiDrawHLine(ggi_ctx->ggi_visual,x,FLIP(y),n); - */ - } -} - -void GGIwrite_mono_ci_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLuint ci, const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - if (mask){ - while (n--){ - if (*mask++) - *fb = ci; - ++fb; - } - } else { - while (n--) - *fb++ = ci; - - /* Alternatively we could write a potentialy faster HLine - ggiSetGCForeground(ggi_ctx->ggi_visual, ci); - ggiDrawHLine(ggi_ctx->ggi_visual, x, FLIP(y), n); - */ - } -} - - -/**********************************************************************/ -/***** Read spans of pixels *****/ -/**********************************************************************/ - - -void GGIread_ci32_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, GLuint ci[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - while (n--) - *ci++ = (GLuint)*fb++; -} - -void GGIread_rgba_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, GLchan rgba[][4]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - FB_TYPE color; - FB_TYPE *fb; - fb = (FB_TYPE *)((char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual) + - FLIP(y)*LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual)) + x; - - while (n--) { - color = *fb++; - rgba[0][RCOMP] = (GLubyte) (color>>(G+B))<>B)& ((1<DriverCtx; - int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); - char *fb = (char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual); - - while (n--) { - if (*mask++){ - FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; - *dst = *ci; - } - ci++; - x++; - y++; - } -} - -void GGIwrite_mono_ci_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLuint ci, const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); - char *fb = (char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual); - - while (n--) { - if (*mask++){ - FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; - *dst = ci; - } - x++; - y++; - } -} - -void GGIwrite_rgba_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLchan rgba[][4], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); - char *fb = (char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual); - - while (n--) { - if (*mask++){ - FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; - *dst = PACK(rgba[0]); - } - x++; - y++; - rgba++; - } -} - -void GGIwrite_mono_rgba_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLchan rgba[4], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); - char *fb = (char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual); - - while (n--) { - if (*mask++){ - FB_TYPE *dst = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; - *dst = PACK(rgba); - } - - x++; - y++; - } -} - -/**********************************************************************/ -/***** Read arrays of pixels *****/ -/**********************************************************************/ - -void GGIread_ci32_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLuint ci[], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); - char *fb = (char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual); - - while (n--) { - if (*mask++){ - FB_TYPE *src = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; - *ci = *src; - } - ci++; - x++; - y++; - } -} - -void GGIread_rgba_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLubyte rgba[][4], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - int stride = LIBGGI_FB_W_STRIDE(ggi_ctx->ggi_visual); - char *fb = (char *)LIBGGI_CURWRITE(ggi_ctx->ggi_visual); - FB_TYPE color; - - while (n--) { - if (*mask++) { - FB_TYPE *src = (FB_TYPE*)(fb + FLIP(*y)*stride) + *x; - color = *src; - - rgba[0][RCOMP] = (GLubyte)(color>>(G+B))<>B)& ((1<gl_ctx); - - GGIMESADPRINT_LIBS("linear_%d: GGIsetup_driver\n", sizeof(FB_TYPE)*8); - - swdd->WriteRGBASpan = GGIwrite_rgba_span; - swdd->WriteRGBSpan = GGIwrite_rgb_span; - swdd->WriteMonoRGBASpan = GGIwrite_mono_rgba_span; - swdd->WriteRGBAPixels = GGIwrite_rgba_pixels; - swdd->WriteMonoRGBAPixels = GGIwrite_mono_rgba_pixels; - - swdd->WriteCI32Span = GGIwrite_ci32_span; - swdd->WriteCI8Span = GGIwrite_ci8_span; - swdd->WriteMonoCISpan = GGIwrite_mono_ci_span; - swdd->WriteCI32Pixels = GGIwrite_ci32_pixels; - swdd->WriteMonoCIPixels = GGIwrite_mono_ci_pixels; - - swdd->ReadCI32Span = GGIread_ci32_span; - swdd->ReadRGBASpan = GGIread_rgba_span; - swdd->ReadCI32Pixels = GGIread_ci32_pixels; - swdd->ReadRGBAPixels = GGIread_rgba_pixels; - - swdd->SetBuffer = GGIset_buffer; - - return 0; -} - -static int GGIopen(ggi_visual_t vis,struct ggi_dlhandle *dlh, - const char *args,void *argptr, uint32 *dlret) -{ - GGIMESADPRINT_CORE("linear_%d: GGIOpen\n", sizeof(FB_TYPE)*8); - LIBGGI_MESAEXT(vis)->setup_driver = GGIsetup_driver; - - *dlret = GGI_DL_OPDRAW; - return 0; -} - -int DLOPENFUNC(int func, void **funcptr) -{ - switch (func) { - case GGIFUNC_open: - *funcptr = GGIopen; - return 0; - case GGIFUNC_exit: - case GGIFUNC_close: - *funcptr = NULL; - return 0; - default: - *funcptr = NULL; - } - return GGI_ENOTFOUND; -} - diff --git a/src/mesa/drivers/ggi/default/linear_15.c b/src/mesa/drivers/ggi/default/linear_15.c deleted file mode 100644 index ead7cc5847..0000000000 --- a/src/mesa/drivers/ggi/default/linear_15.c +++ /dev/null @@ -1,36 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#include - -#define R 5 -#define G 5 -#define B 5 - -#define FB_TYPE uint16 -#define FB_BITS 15 -#define DLOPENFUNC MesaGGIdl_linear_15 - -#include "linear.c" - diff --git a/src/mesa/drivers/ggi/default/linear_16.c b/src/mesa/drivers/ggi/default/linear_16.c deleted file mode 100644 index 6028699bbc..0000000000 --- a/src/mesa/drivers/ggi/default/linear_16.c +++ /dev/null @@ -1,36 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#include - -#define R 5 -#define G 6 -#define B 5 - -#define FB_TYPE uint16 -#define FB_BITS 16 -#define DLOPENFUNC MesaGGIdl_linear_16 - -#include "linear.c" - diff --git a/src/mesa/drivers/ggi/default/linear_24.c b/src/mesa/drivers/ggi/default/linear_24.c deleted file mode 100644 index 7a2236f124..0000000000 --- a/src/mesa/drivers/ggi/default/linear_24.c +++ /dev/null @@ -1,36 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#include - -#define R 8 -#define G 8 -#define B 8 - -#define FB_TYPE uint32 -#define FB_BITS 24 -#define DLOPENFUNC MesaGGIdl_linear_24 - -#include "linear.c" - diff --git a/src/mesa/drivers/ggi/default/linear_32.c b/src/mesa/drivers/ggi/default/linear_32.c deleted file mode 100644 index 7cbf945f35..0000000000 --- a/src/mesa/drivers/ggi/default/linear_32.c +++ /dev/null @@ -1,36 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#include - -#define R 8 -#define G 8 -#define B 8 - -#define FB_TYPE uint32 -#define FB_BITS 32 -#define DLOPENFUNC MesaGGIdl_linear_32 - -#include "linear.c" - diff --git a/src/mesa/drivers/ggi/default/linear_8.c b/src/mesa/drivers/ggi/default/linear_8.c deleted file mode 100644 index 9c7b5d712f..0000000000 --- a/src/mesa/drivers/ggi/default/linear_8.c +++ /dev/null @@ -1,36 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#include - -#define R 3 -#define G 3 -#define B 2 - -#define FB_TYPE uint8 -#define FB_BITS 8 -#define DLOPENFUNC MesaGGIdl_linear_8 - -#include "linear.c" - diff --git a/src/mesa/drivers/ggi/default/stubs.c b/src/mesa/drivers/ggi/default/stubs.c deleted file mode 100644 index 62722972b2..0000000000 --- a/src/mesa/drivers/ggi/default/stubs.c +++ /dev/null @@ -1,512 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#include - -#include -#include -#include - -#include "swrast/swrast.h" -//#include "swrast_setup/swrast_setup.h" -//#include "swrast/s_context.h" -//#include "swrast/s_depth.h" -//#include "swrast/s_triangle.h" - -#define FLIP(coord) (LIBGGI_MODE(ggi_ctx->ggi_visual)->visible.y-(coord)-1) - -/**********************************************************************/ -/***** Write spans of pixels *****/ -/**********************************************************************/ - -void GGIwrite_ci32_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLuint ci[], - const GLubyte mask[] ) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - y = FLIP(y); - if (mask) - { - while (n--) { - if (*mask++) - ggiPutPixel(ggi_ctx->ggi_visual, x, y, *ci); - x++; - ci++; - } - } - else - { - while (n--) - ggiPutPixel(ggi_ctx->ggi_visual, x++, y, *ci++); - } -} - -void GGIwrite_ci8_span(const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte ci[], - const GLubyte mask[] ) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - y = FLIP(y); - if (mask) - { - while (n--) { - if (*mask++) - ggiPutPixel(ggi_ctx->ggi_visual, x, y, *ci); - x++; - ci++; - } - } - else - { - while (n--) - ggiPutPixel(ggi_ctx->ggi_visual, x++, y, *ci++); - } -} - -void GGIwrite_mono_ci_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLuint ci, const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - y = FLIP(y); - if (mask) - { - while (n--) { - if (*mask++) - ggiPutPixel(ggi_ctx->ggi_visual, x, y, ci); - x++; - } - } - else - { - while (n--) - ggiPutPixel(ggi_ctx->ggi_visual, x++, y, ci); - } -} - -void GGIwrite_mono_rgba_span(const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLchan rgba[4], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_color rgb; - ggi_pixel col; - - y = FLIP(y); - - rgb.r = (uint16)(rgba[RCOMP]) << SHIFT; - rgb.g = (uint16)(rgba[GCOMP]) << SHIFT; - rgb.b = (uint16)(rgba[BCOMP]) << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - - if (mask) - { - while (n--) { - if (*mask++) - ggiPutPixel(ggi_ctx->ggi_visual, x, y, col); - x++; - } - } - else - { - ggiDrawHLine(ggi_ctx->ggi_visual, x, y, n); - } -} - -void GGIwrite_rgba_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], - const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_color rgb; - ggi_pixel col; - y = FLIP(y); - - if (mask) - { - while (n--) { - if (*mask++) - { - rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - ggiPutPixel(ggi_ctx->ggi_visual, x, y, col); - } - x++; - rgba++; - } - } - else - { - while (n--) - { - rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - ggiPutPixel(ggi_ctx->ggi_visual, x++, y, col); - rgba++; - } - } -} - -void GGIwrite_rgb_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLubyte rgba[][3], - const GLubyte mask[] ) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_color rgb; - ggi_pixel col; - y = FLIP(y); - - if (mask) - { - while (n--) { - if (*mask++) - { - rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - ggiPutPixel(ggi_ctx->ggi_visual, x, y, col); - } - x++; - rgba++; - } - } - else - { - while (n--) - { - rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - ggiPutPixel(ggi_ctx->ggi_visual, x++, y, col); - rgba++; - } - } -} - - - -/**********************************************************************/ -/***** Read spans of pixels *****/ -/**********************************************************************/ - - -void GGIread_ci32_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, GLuint ci[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - y = FLIP(y); - while (n--) - ggiGetPixel(ggi_ctx->ggi_visual, x++, y, ci++); -} - -void GGIread_rgba_span( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_color rgb; - ggi_pixel col; - - y = FLIP(y); - - while (n--) - { - ggiGetPixel(ggi_ctx->ggi_visual, x++, y, &col); - ggiUnmapPixel(ggi_ctx->ggi_visual, col, &rgb); - rgba[0][RCOMP] = (GLubyte) (rgb.r >> SHIFT); - rgba[0][GCOMP] = (GLubyte) (rgb.g >> SHIFT); - rgba[0][BCOMP] = (GLubyte) (rgb.b >> SHIFT); - rgba[0][ACOMP] = 0; - rgba++; - } -} - -/**********************************************************************/ -/***** Write arrays of pixels *****/ -/**********************************************************************/ - -void GGIwrite_ci32_pixels( const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLuint ci[], const GLubyte mask[] ) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - while (n--) { - if (*mask++) - ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), *ci); - ci++; - x++; - y++; - } -} - -void GGIwrite_mono_ci_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLuint ci, const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - while (n--) { - if (*mask++) - ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), ci); - x++; - y++; - } -} - -void GGIwrite_rgba_pixels( const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], - const GLubyte mask[] ) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_pixel col; - ggi_color rgb; - while (n--) { - if (*mask++) { - rgb.r = (uint16)(rgba[0][RCOMP]) << SHIFT; - rgb.g = (uint16)(rgba[0][GCOMP]) << SHIFT; - rgb.b = (uint16)(rgba[0][BCOMP]) << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), col); - } - x++; - y++; - rgba++; - } -} - -void GGIwrite_mono_rgba_pixels(const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLchan rgba[4], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_color rgb; - ggi_pixel col; - - rgb.r = (uint16)(rgba[RCOMP]) << SHIFT; - rgb.g = (uint16)(rgba[GCOMP]) << SHIFT; - rgb.b = (uint16)(rgba[BCOMP]) << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - - while (n--) { - if (*mask++) - ggiPutPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), col); - x++; - y++; - } -} - -/**********************************************************************/ -/***** Read arrays of pixels *****/ -/**********************************************************************/ - -void GGIread_ci32_pixels( const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLuint ci[], const GLubyte mask[]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - while (n--) { - if (*mask++) - ggiGetPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), ci); - ci++; - x++; - y++; - } -} - -void GGIread_rgba_pixels( const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - GLubyte rgba[][4], - const GLubyte mask[] ) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_color rgb; - ggi_pixel col; - - while (n--) - { - if (*mask++) - { - ggiGetPixel(ggi_ctx->ggi_visual, *x, FLIP(*y), &col); - ggiUnmapPixel(ggi_ctx->ggi_visual, col, &rgb); - rgba[0][RCOMP] = rgb.r >> SHIFT; - rgba[0][GCOMP] = rgb.g >> SHIFT; - rgba[0][BCOMP] = rgb.b >> SHIFT; - rgba[0][ACOMP] = 0; - } - x++; - y++; - rgba++; - } -} - -int GGIextend_visual(ggi_visual_t vis) -{ - return 0; -} - -//static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx); - -int GGIsetup_driver(ggi_mesa_context_t ggi_ctx) -{ - struct swrast_device_driver *swdd = - _swrast_GetDeviceDriverReference(ggi_ctx->gl_ctx); - - GGIMESADPRINT_CORE("stubs: setup_driver\n"); - - swdd->WriteRGBASpan = GGIwrite_rgba_span; - swdd->WriteRGBSpan = GGIwrite_rgb_span; - swdd->WriteMonoRGBASpan = GGIwrite_mono_rgba_span; - swdd->WriteRGBAPixels = GGIwrite_rgba_pixels; - swdd->WriteMonoRGBAPixels = GGIwrite_mono_rgba_pixels; - - swdd->WriteCI32Span = GGIwrite_ci32_span; - swdd->WriteCI8Span = GGIwrite_ci8_span; - swdd->WriteMonoCISpan = GGIwrite_mono_ci_span; - swdd->WriteCI32Pixels = GGIwrite_ci32_pixels; - swdd->WriteMonoCIPixels = GGIwrite_mono_ci_pixels; - - swdd->ReadCI32Span = GGIread_ci32_span; - swdd->ReadRGBASpan = GGIread_rgba_span; - swdd->ReadCI32Pixels = GGIread_ci32_pixels; - swdd->ReadRGBAPixels = GGIread_rgba_pixels; - - return 0; -} - -void GGIupdate_state(ggi_mesa_context_t *ctx) -{ - //ctx->Driver.TriangleFunc = _swsetup_Triangle; -} - -/* -void GGItriangle_flat(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1, const SWvertex *v2) -{ -//#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE - -#define SETUP_CODE \ - ggi_color color; \ - color.r = v0->color[0]; \ - color.g = v0->color[1]; \ - color.b = v0->color[2]; \ - color.a = v0->color[3]; \ - ggiSetGCForeground(VIS, ggiMapColor(VIS, &color)); - -#define INNER_LOOP(LEFT,RIGHT,Y) \ - ggiDrawHLine(VIS,LEFT,FLIP(Y),RIGHT-LEFT); - -#include "swrast/s_tritemp.h" -} - - -static void GGItriangle_flat_depth(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1, const SWvertex *v2) -{ -#define INTERP_Z 1 -#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE - -#define SETUP_CODE \ - ggi_color color; \ - color.r = v0->color[0]; \ - color.g = v0->color[1]; \ - color.b = v0->color[2]; \ - color.a = v0->color[3]; \ - ggiSetGCForeground(VIS, ggiMapColor(VIS, &color)); - -#define INNER_LOOP(LEFT,RIGHT,Y) \ - { \ - GLint i,xx=LEFT,yy=FLIP(Y),n=RIGHT-LEFT,length=0; \ - GLint startx=xx; \ - for (i=0;iStencil._Enabled) return NULL; - if (ctx->Polygon.SmoothFlag) return NULL; - if (ctx->Polygon.StippleFlag) return NULL; - if (ctx->Texture._ReallyEnabled) return NULL; - if (ctx->Light.ShadeModel==GL_SMOOTH) return NULL; - if (ctx->Depth.Test && ctx->Depth.Func != GL_LESS) return NULL; - - if (ctx->Depth.Test) - return GGItriangle_flat_depth; - - return GGItriangle_flat; -} -*/ -static int GGIopen(ggi_visual_t vis, struct ggi_dlhandle *dlh, - const char *args, void *argptr, uint32 *dlret) -{ - LIBGGI_MESAEXT(vis)->update_state = GGIupdate_state; - LIBGGI_MESAEXT(vis)->setup_driver = GGIsetup_driver; - - *dlret = GGI_DL_OPDRAW; - return 0; -} - -int MesaGGIdl_stubs(int func, void **funcptr) -{ - switch (func) { - case GGIFUNC_open: - *funcptr = GGIopen; - return 0; - case GGIFUNC_exit: - case GGIFUNC_close: - *funcptr = NULL; - return 0; - default: - *funcptr = NULL; - } - return GGI_ENOTFOUND; -} diff --git a/src/mesa/drivers/ggi/display/.gitignore b/src/mesa/drivers/ggi/display/.gitignore deleted file mode 100644 index 98858db2c0..0000000000 --- a/src/mesa/drivers/ggi/display/.gitignore +++ /dev/null @@ -1 +0,0 @@ -fbdev.conf diff --git a/src/mesa/drivers/ggi/display/fbdev.conf.in b/src/mesa/drivers/ggi/display/fbdev.conf.in deleted file mode 100644 index 2acb89426f..0000000000 --- a/src/mesa/drivers/ggi/display/fbdev.conf.in +++ /dev/null @@ -1,4 +0,0 @@ -# GGIMesa fbdev target configuration -.root: @ggi_libdir@/ggi/mesa/default - -tgt-fbdev-kgicon-generic-mesa genkgi.so diff --git a/src/mesa/drivers/ggi/display/fbdev_mode.c b/src/mesa/drivers/ggi/display/fbdev_mode.c deleted file mode 100644 index 85c35ffe0e..0000000000 --- a/src/mesa/drivers/ggi/display/fbdev_mode.c +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - - display-fbdev-mesa - - Copyright (C) 1999 Jon Taylor [taylorj@ggi-project.org] - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -****************************************************************************** -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#ifndef MAP_FAILED -#define MAP_FAILED ((void*)-1) -#endif - -#define FB_KLUDGE_FONTX 8 -#define FB_KLUDGE_FONTY 16 -#define FB_KLUDGE_TEXTMODE 13 -#define TIMINGFILE "/etc/fb.modes" - -int GGIMesa_fbdev_getapi(ggi_visual *vis, int num, char *apiname, char *arguments) -{ - struct fbdev_priv_mesa *priv = GGIMESA_PRIV(vis); - - arguments = '\0'; - - switch(num) { - case 0: - if (priv->oldpriv->have_accel) { - strcpy(apiname, priv->oldpriv->accel); - return 0; - } - break; - } - - return -1; -} - -static int do_setmode(ggi_visual *vis) -{ - struct fbdev_priv_mesa *priv = GGIMESA_PRIV(vis); - int err, id; - char libname[GGI_API_MAXLEN], libargs[GGI_API_MAXLEN]; - ggi_graphtype gt; - - _ggiZapMode(vis, ~GGI_DL_OPDISPLAY); - priv->have_accel = 0; - - for (id = 1; GGIMesa_fbdev_getapi(vis, id, libname, libargs) == 0; id++) { - if (_ggiOpenDL(vis, libname, libargs, NULL) == 0) { - GGIMESADPRINT_LIBS(stderr, "display-fbdev-mesa: Error opening the " - "%s (%s) library.\n", libname, libargs); - return GGI_EFATAL; - } - - GGIMESADPRINT_CORE("Success in loading %s (%s)\n", - libname, libargs); - } - - if (priv->oldpriv->accel && - _ggiOpenDL(vis, priv->accel, NULL, NULL) != 0) { - priv->have_accel = 1; - } else { - priv->have_accel = 0; - } - vis->accelactive = 0; - - ggiIndicateChange(vis, GGI_CHG_APILIST); - - GGIMESADPRINT_CORE("display-fbdev-mesa: do_setmode SUCCESS\n"); - - return 0; -} - - -int GGIMesa_fbdev_setmode(ggi_visual *vis, ggi_mode *mode) -{ - int err; - - if ((err = ggiCheckMode(vis, mode)) != 0) { - return err; - } - - GGIMESADPRINT_CORE("display-fbdev-mesa: setmode %dx%d#%dx%dF%d[0x%02x]\n", - mode->visible.x, mode->visible.y, - mode->virt.x, mode->virt.y, - mode->frames, mode->graphtype); - - memcpy(LIBGGI_MODE(vis), mode, sizeof(ggi_mode)); - - /* Now actually set the mode */ - err = do_setmode(vis); - if (err != 0) { - return err; - } - - GGIMESADPRINT_CORE("display-fbdev-mesa: setmode success.\n"); - - return 0; -} diff --git a/src/mesa/drivers/ggi/display/fbdev_visual.c b/src/mesa/drivers/ggi/display/fbdev_visual.c deleted file mode 100644 index f0c1771c77..0000000000 --- a/src/mesa/drivers/ggi/display/fbdev_visual.c +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** - - display-fbdev-mesa: visual handling - - Copyright (C) 1999 Jon Taylor [taylorj@ggi-project.org] - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -****************************************************************************** -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -#ifdef HAVE_SYS_VT_H -#include -#else -#include -#endif -#ifdef HAVE_LINUX_KDEV_T_H -#include -#endif -#include - -#define MAX_DEV_LEN 63 -#define DEFAULT_FBNUM 0 - -static char accel_prefix[] = "tgt-fbdev-"; -#define PREFIX_LEN (sizeof(accel_prefix)) - -typedef struct { - int async; - char *str; -} accel_info; - -static accel_info accel_strings[] = { - { 0, "kgicon-generic",}, /* no accel - check for KGIcon */ - { 0, NULL }, /* Atari Blitter */ -}; - -#define NUM_ACCELS (sizeof(accel_strings)/sizeof(accel_info)) - - - -static int GGIopen(ggi_visual *vis, struct ggi_dlhandle *dlh, - const char *args, void *argptr, uint32 *dlret) -{ - int err; - struct fbdev_priv_mesa *priv; - ggifunc_getapi *oldgetapi; - - - priv->oldpriv = LIBGGI_PRIVATE(vis); /* Hook back */ - - GGIMESA_PRIV(vis) = priv = malloc(sizeof(struct fbdev_priv_mesa)); - if (priv == NULL) { - fprintf(stderr, "GGIMesa: Failed to allocate fbdev private data\n"); - return GGI_ENOMEM; - } - - oldgetapi = vis->opdisplay->getapi; - vis->opdisplay->getapi = GGIMesa_fbdev_getapi; - changed(vis, GGI_CHG_APILIST); - - /* If the accel sublibs didn't sucessfuly hook a driver, - * back up and keep looking */ - if ((LIBGGI_MESAEXT(vis)->update_state == NULL) || - (LIBGGI_MESAEXT(vis)->setup_driver == NULL)) - { - vis->opdisplay->getapi = oldgetapi; - } - - *dlret = GGI_DL_EXTENSION; - return 0; -} - - -static int GGIclose(ggi_visual *vis, struct ggi_dlhandle *dlh) -{ - struct fbdev_priv_mesa *priv = GGIMESA_PRIV(vis); - - if (priv) { - LIBGGI_PRIVATE(vis) = priv->oldpriv; - free(priv); - } - - return 0; -} - - -int MesaGGIdl_fbdev_mesa(int func, void **funcptr) -{ - switch (func) { - case GGIFUNC_open: - *funcptr = GGIopen; - return 0; - case GGIFUNC_exit: - *funcptr = NULL; - return 0; - case GGIFUNC_close: - *funcptr = GGIclose; - return 0; - default: - *funcptr = NULL; - } - - return GGI_ENOTFOUND; -} - - -#include diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c deleted file mode 100644 index bc08144d66..0000000000 --- a/src/mesa/drivers/ggi/ggimesa.c +++ /dev/null @@ -1,670 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997-1998 Uwe Maurer - uwe_maurer@t-online.de - * 2002 Filip Spacek - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#include -#include -#include "main/extensions.h" -#include "main/buffers.h" -#include "main/colormac.h" -#include "main/imports.h" -#include "main/matrix.h" -#include "main/teximage.h" -#include "main/texformat.h" -#include "main/texstore.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "vbo/vbo.h" - -/* We use LibGG to manage config files */ -#include - - -/* XXX: Those #defines should be provided via - * config.h - */ -#define GGIMESAPATHTAG "pAtHTAg" -#define GGIMESACONFDIR "pAtHTAg/usr/local/etc/ggi" -#define GGIMESATAGLEN 7 -#define GGIMESACONFFILE "ggimesa.conf" - - -/* Static variables - */ -static int _ggimesaLibIsUp = 0; -static void *_ggimesaConfigHandle; -static char _ggimesaconfstub[512] = GGIMESACONFDIR; -static char *_ggimesaconfdir = _ggimesaconfstub+GGIMESATAGLEN; - -int _ggimesaDebugSync = 0; -uint32 _ggimesaDebugState = 0; - - - -/* Extension ID. Defaulting to -1 should make segfault on abuse more likely... - */ -ggi_extid _ggiMesaID = -1; - - -#define SUBLIB_PREFIX "MesaGGIdl_" - - -/* - * Returns the directory where global config files are kept - */ - -const char *ggiMesaGetConfDir(void) -{ -#ifdef __WIN32__ - /* On Win32 we allow overriding of the compiled in path. */ - const char *envdir = getenv("GGI_CONFDIR"); - if (envdir) return envdir; -#endif - return _ggimesaconfdir; -} - - -/* Dummy function which returns -1 - We use this to reset the function pointers */ -static int _ggi_error(void) -{ - GGIMESADPRINT_CORE("_ggi_error() called\n"); - - return -1; -} - - -static int changed(ggi_visual_t vis, int whatchanged) -{ - GLcontext *ctx; - ctx = _mesa_get_current_context(); - - GGIMESADPRINT_CORE("changed() called\n"); - - switch (whatchanged) { - case GGI_CHG_APILIST: - { - char api[GGI_MAX_APILEN]; - char args[GGI_MAX_APILEN]; - int i; - const char *fname; - ggi_dlhandle *lib; - - GLvisual *gl_vis = &(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual); - GLframebuffer *gl_fb = &(LIBGGI_MESAEXT(vis)->mesa_buffer); - - /* Initialize the framebuffer to provide all necessary - buffers in software. The target libraries that are loaded - next are free to modify this according to their - capabilities. - */ - /* FIXME: if the target changes capabilities we'll leak - swrast's memory !!! Need to deallocate first */ - _mesa_initialize_framebuffer(gl_fb, gl_vis, - gl_vis->depthBits > 0, - gl_vis->stencilBits > 0, - gl_vis->accumRedBits > 0, - gl_vis->alphaBits > 0); - - for (i = 0; ggiGetAPI(vis, i, api, args) == 0; i++) { - strcat(api, "-mesa"); - GGIMESADPRINT_CORE("GGIMesa: looking for" - "a sublib named %s\n", api); - fname = ggMatchConfig(_ggimesaConfigHandle, api, NULL); - if (fname == NULL) { - /* No special implementation for this sublib */ - continue; - } - lib = ggiExtensionLoadDL(vis, fname, args, NULL, - SUBLIB_PREFIX); - } - - /* The targets have cleared everything they can do from - the framebuffer structure so we provide the rest in sw - */ - /*_swrast_alloc_buffers(gl_fb);*/ - - break; - } - } - return 0; -} - - -int ggiMesaInit() -{ - int err; - char *str; - char *conffile; - - GGIMESADPRINT_CORE("ggiMesaInit() called\n"); - - _ggimesaLibIsUp++; - if (_ggimesaLibIsUp > 1) return 0; /* Initialize only at first call */ - - str = getenv("GGIMESA_DEBUGSYNC"); - if (str != NULL) { - _ggimesaDebugSync = 1; - } - - str = getenv("GGIMESA_DEBUG"); - if (str != NULL) { - _ggimesaDebugState = atoi(str); - GGIMESADPRINT_CORE("%s Debugging=%d\n", - _ggimesaDebugSync ? "sync" : "async", - _ggimesaDebugState); - } - - - conffile = malloc(strlen(ggiMesaGetConfDir()) + 1 - + strlen(GGIMESACONFFILE) +1); - if (conffile == NULL) { - fprintf(stderr, "GGIMesa: unable to allocate memory for config filename.\n"); - return GGI_ENOMEM; - } - sprintf(conffile, "%s%c%s", - ggiMesaGetConfDir(), '/', GGIMESACONFFILE); - err = ggLoadConfig(conffile, &_ggimesaConfigHandle); - if (err != GGI_OK) { - fprintf(stderr, "GGIMesa: Couldn't open %s\n", - conffile); - free(conffile); - _ggimesaLibIsUp--; - return err; - } - free(conffile); - - _ggiMesaID = ggiExtensionRegister("GGIMesa", - sizeof(struct ggi_mesa_ext), changed); - if (_ggiMesaID < 0) { - fprintf(stderr, "GGIMesa: failed to register as extension\n"); - _ggimesaLibIsUp--; - ggFreeConfig(_ggimesaConfigHandle); - return _ggiMesaID; - } - - return 0; -} - -int ggiMesaExit(void) -{ - int rc; - - GGIMESADPRINT_CORE("ggiMesaExit() called\n"); - - if (!_ggimesaLibIsUp) return -1; - - if (_ggimesaLibIsUp > 1) { - /* Exit only at last call */ - _ggimesaLibIsUp--; - return 0; - } - - rc = ggiExtensionUnregister(_ggiMesaID); - ggFreeConfig(_ggimesaConfigHandle); - - _ggimesaLibIsUp = 0; - - return rc; -} - - - - -static void gl_ggiUpdateState(GLcontext *ctx, GLuint new_state); - - -static void gl_ggiGetSize(GLframebuffer *fb, GLuint *width, GLuint *height) -{ - /* FIXME: this is a hack to work around the new interface */ - GLcontext *ctx; - ggi_mesa_context_t ggi_ctx; - ctx = _mesa_get_current_context(); - ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - - GGIMESADPRINT_CORE("gl_ggiGetSize() called\n"); - - *width = LIBGGI_VIRTX(ggi_ctx->ggi_visual); - *height = LIBGGI_VIRTY(ggi_ctx->ggi_visual); - printf("returning %d, %d\n", *width, *height); -} - -/** - * We only implement this function as a mechanism to check if the - * framebuffer size has changed (and update corresponding state). - */ -static void gl_ggiViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysDrawBuffer; - gl_ggiGetSize( buffer, &newWidth, &newHeight ); - if (buffer->Width != newWidth || buffer->Height != newHeight) { - _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); - } -} - - -static void gl_ggiSetIndex(GLcontext *ctx, GLuint ci) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - - GGIMESADPRINT_CORE("gl_ggiSetIndex() called\n"); - - ggiSetGCForeground(ggi_ctx->ggi_visual, ci); - ggi_ctx->color = (ggi_pixel)ci; -} - -static void gl_ggiSetClearIndex(GLcontext *ctx, GLuint ci) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - - GGIMESADPRINT_CORE("gl_ggiSetClearIndex() called\n"); - - ggiSetGCForeground(ggi_ctx->ggi_visual, ci); - ggi_ctx->clearcolor = (ggi_pixel)ci; -} - -static void gl_ggiSetClearColor(GLcontext *ctx, const GLfloat color[4]) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - ggi_color rgb; - ggi_pixel col; - GLubyte byteColor[3]; - - GGIMESADPRINT_CORE("gl_ggiSetClearColor() called\n"); - - CLAMPED_FLOAT_TO_UBYTE(byteColor[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(byteColor[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(byteColor[2], color[2]); - - rgb.r = (uint16)byteColor[0] << SHIFT; - rgb.g = (uint16)byteColor[1] << SHIFT; - rgb.b = (uint16)byteColor[2] << SHIFT; - col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); - ggiSetGCForeground(ggi_ctx->ggi_visual, col); - ggi_ctx->clearcolor = col; -} - -static void gl_ggiClear(GLcontext *ctx, GLbitfield mask) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - int x = ctx->DrawBuffer->_Xmin; - int y = ctx->DrawBuffer->_Ymin; - int w = ctx->DrawBuffer->_Xmax - x; - int h = ctx->DrawBuffer->_Ymax - y; - GLboolean all = (w == ctx->DrawBuffer->Width && h == ctx->DrawBuffer->height) - - GGIMESADPRINT_CORE("gl_ggiClear() called\n"); - - if (mask & (DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT)) { - ggiSetGCForeground(ggi_ctx->ggi_visual, ggi_ctx->clearcolor); - - if (all) { - int w, h; - w = LIBGGI_VIRTX(ggi_ctx->ggi_visual); - h = LIBGGI_VIRTX(ggi_ctx->ggi_visual); - ggiDrawBox(ggi_ctx->ggi_visual, 0, 0, w, h); - } else { - ggiDrawBox(ggi_ctx->ggi_visual, x, y, //FLIP(y), - width, height); - } - ggiSetGCForeground(ggi_ctx->ggi_visual, ggi_ctx->color); - - mask &= ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); - } - _swrast_Clear(ctx, mask); - -} - - -/* Set the buffer used for reading */ -/* XXX support for separate read/draw buffers hasn't been tested */ -static GLboolean gl_ggiSetBuffer(GLcontext *ctx, GLframebuffer *buffer, GLuint bufferBit) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - - printf("set read %d\n", bufferBit); - GGIMESADPRINT_CORE("gl_ggiSetBuffer() called\n"); - - if (bufferBit == DD_FRONT_LEFT_BIT) - { - ggiSetReadFrame(ggi_ctx->ggi_visual, - ggiGetDisplayFrame(ggi_ctx->ggi_visual)); - ggiSetWriteFrame(ggi_ctx->ggi_visual, - ggiGetDisplayFrame(ggi_ctx->ggi_visual)); - return GL_TRUE; - } - else if (bufferBit == DD_BACK_LEFT_BIT) - { - ggiSetReadFrame(ggi_ctx->ggi_visual, - ggiGetDisplayFrame(ggi_ctx->ggi_visual)?0 : 1); - ggiSetWriteFrame(ggi_ctx->ggi_visual, - ggiGetDisplayFrame(ggi_ctx->ggi_visual)?0 : 1); - return GL_TRUE; - } - else - return GL_FALSE; -} - - -static const GLubyte * gl_ggiGetString(GLcontext *ctx, GLenum name) -{ - GGIMESADPRINT_CORE("gl_ggiGetString() called\n"); - - if (name == GL_RENDERER) { - return (GLubyte *) "Mesa GGI"; - } else { - return NULL; - } -} - -static void gl_ggiFlush(GLcontext *ctx) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - - GGIMESADPRINT_CORE("gl_ggiFlush() called\n"); - - ggiFlush(ggi_ctx->ggi_visual); -} - -static void gl_ggiIndexMask(GLcontext *ctx, GLuint mask) -{ - GGIMESADPRINT_CORE("gl_ggiIndexMask() called\n"); -} - -static void gl_ggiColorMask(GLcontext *ctx, GLboolean rmask, GLboolean gmask, - GLboolean bmask, GLboolean amask) -{ - GGIMESADPRINT_CORE("gl_ggiColorMask() called\n"); -} - -static void gl_ggiEnable(GLcontext *ctx, GLenum pname, GLboolean state) -{ - GGIMESADPRINT_CORE("gl_ggiEnable() called\n"); -} - -static void gl_ggiSetupPointers(GLcontext *ctx) -{ - TNLcontext *tnl; - - GGIMESADPRINT_CORE("gl_ggiSetupPointers() called\n"); - - /* Plug in default driver functions */ - _mesa_init_driver_functions(&ctx->Driver); - - /* Plug in ggi-specific functions */ - ctx->Driver.GetString = gl_ggiGetString; - ctx->Driver.GetBufferSize = gl_ggiGetSize; - ctx->Driver.Viewport = gl_ggiViewport; - ctx->Driver.Finish = gl_ggiFlush; - ctx->Driver.Flush = gl_ggiFlush; - ctx->Driver.Clear = gl_ggiClear; - ctx->Driver.ClearIndex = gl_ggiSetClearIndex; - ctx->Driver.ClearColor = gl_ggiSetClearColor; - ctx->Driver.IndexMask = gl_ggiIndexMask; - ctx->Driver.ColorMask = gl_ggiColorMask; - ctx->Driver.Enable = gl_ggiEnable; - ctx->Driver.UpdateState = gl_ggiUpdateState; - - /* Initialize TNL driver interface */ - tnl = TNL_CONTEXT(ctx); - tnl->Driver.RunPipeline = _tnl_run_pipeline; - - /* Install setup for tnl */ - _swsetup_Wakeup(ctx); -} - -static void get_mode_info(ggi_visual_t vis, int *r, int *g, int *b, - GLboolean *rgb, GLboolean *db, int *ci) -{ - unsigned int i; - - *r = 0; - *g = 0; - *b = 0; - - for(i = 0; i < sizeof(ggi_pixel)*8; ++i) { - int mask = 1 << i; - if (LIBGGI_PIXFMT(vis)->red_mask & mask) - ++(*r); - if (LIBGGI_PIXFMT(vis)->green_mask & mask) - ++(*g); - if (LIBGGI_PIXFMT(vis)->blue_mask & mask) - ++(*b); - } - - *rgb = GT_SCHEME(LIBGGI_MODE(vis)->graphtype) == GT_TRUECOLOR; - *db = LIBGGI_MODE(vis)->frames > 1; - *ci = GT_SIZE(LIBGGI_MODE(vis)->graphtype); - - printf("rgb (%d, %d, %d) db %d, rgb %d ci %d\n",*r,*g,*b,*db,*rgb,*ci); -} - - -int ggiMesaAttach(ggi_visual_t vis) -{ - int rc; - - GGIMESADPRINT_CORE("ggiMesaAttach() called\n"); - - rc = ggiExtensionAttach(vis, _ggiMesaID); - if (rc == 0) - { - int r, g, b, ci; - GLboolean rgb, db; - GLvisual *gl_visual; - - /* We are creating the primary instance */ - memset(LIBGGI_MESAEXT(vis), 0, sizeof(struct ggi_mesa_ext)); - LIBGGI_MESAEXT(vis)->update_state = (void *)_ggi_error; - LIBGGI_MESAEXT(vis)->setup_driver = (void *)_ggi_error; - - /* Initialize default mesa visual */ - get_mode_info(vis, &r, &g, &b, &rgb, &db, &ci); - gl_visual = &(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual); - _mesa_initialize_visual(gl_visual, - rgb, db, 0 /* No stereo */, - r, g, b, 0 /* No alpha */, ci, - 0 /* No depth */, 0 /* No stencil */, - 0, 0, 0, 0 /* No accum */, 0); - - /* Now fake an "API change" so the right libs get loaded */ - changed(vis, GGI_CHG_APILIST); - } - - return rc; -} - -int ggiMesaDetach(ggi_visual_t vis) -{ - GGIMESADPRINT_CORE("ggiMesaDetach() called\n"); - - return ggiExtensionDetach(vis, _ggiMesaID); -} - -int ggiMesaExtendVisual(ggi_visual_t vis, GLboolean alpha_flag, - GLboolean stereo_flag, GLint depth_size, - GLint stencil_size, GLint accum_red_size, - GLint accum_green_size, GLint accum_blue_size, - GLint accum_alpha_size, GLint num_samples) -{ - GLvisual *gl_vis = &(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual); - int r, g, b, ci; - GLboolean db, rgb; - - get_mode_info(vis, &r, &g, &b, &rgb, &db, &ci); - - /* Initialize the visual with the provided information */ - _mesa_initialize_visual(gl_vis, - rgb, db, stereo_flag, - r, g, b, 0 /* FIXME */, ci, - depth_size, stencil_size, - accum_red_size, accum_green_size, - accum_blue_size, accum_alpha_size, 0); - - /* Now fake an "API change" so the right libs get loaded. After all, - extending the visual by all these new buffers could be considered - a "mode change" which requires an "API change". - */ - changed(vis, GGI_CHG_APILIST); - - return 0; -} - - -ggi_mesa_context_t ggiMesaCreateContext(ggi_visual_t vis) -{ - ggi_mesa_context_t ctx; - int err; - - GGIMESADPRINT_CORE("ggiMesaCreateContext() called\n"); - - ctx = (ggi_mesa_context_t)malloc(sizeof(struct ggi_mesa_context)); - if (!ctx) - return NULL; - - ctx->ggi_visual = vis; - ctx->color = 0; - - ctx->gl_ctx = - _mesa_create_context(&(LIBGGI_MESAEXT(vis)->mesa_visual.gl_visual), - NULL, (void *) ctx, GL_FALSE); - if (!ctx->gl_ctx) - goto free_context; - - _mesa_enable_sw_extensions(ctx->gl_ctx); - - _swrast_CreateContext(ctx->gl_ctx); - _vbo_CreateContext(ctx->gl_ctx); - _tnl_CreateContext(ctx->gl_ctx); - _swsetup_CreateContext(ctx->gl_ctx); - - gl_ggiSetupPointers(ctx->gl_ctx); - - /* Make sure that an appropriate sublib has been loaded */ - if (!LIBGGI_MESAEXT(ctx->ggi_visual)->setup_driver){ - GGIMESADPRINT_CORE("setup_driver==NULL!\n"); - GGIMESADPRINT_CORE("Please check your config files!\n"); - goto free_context; - } - - /* Set up the sublib driver */ - err = LIBGGI_MESAEXT(ctx->ggi_visual)->setup_driver(ctx); - if (err){ - GGIMESADPRINT_CORE("setup_driver failed (err = %d)", err); - goto free_gl_context; - } - - return ctx; - -free_gl_context: - _mesa_destroy_context(ctx->gl_ctx); -free_context: - free(ctx); - - return NULL; -} - -void ggiMesaDestroyContext(ggi_mesa_context_t ctx) -{ - GGIMESADPRINT_CORE("ggiMesaDestroyContext() called\n"); - - if(!ctx) - return; - - _mesa_destroy_context(ctx->gl_ctx); - free(ctx); -} - -void ggiMesaMakeCurrent(ggi_mesa_context_t ctx, ggi_visual_t vis) -{ - GGIMESADPRINT_CORE("ggiMesaMakeCurrent(ctx = %p) called\n", ctx); - - /* FIXME: clean up where are ggi_vis */ - if (ctx->ggi_visual != vis) { - GGIMESADPRINT_CORE("Cannot migrate GL contexts\n"); - return; - } - - _mesa_make_current(ctx->gl_ctx, &LIBGGI_MESAEXT(vis)->mesa_buffer); -} - - -/* - * Swap front/back buffers for current context if double buffered. - */ -void ggiMesaSwapBuffers(void) -{ - GLcontext *ctx; - ggi_mesa_context_t ggi_ctx; - ctx = _mesa_get_current_context(); - ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - - GGIMESADPRINT_CORE("ggiMesaSwapBuffers() called\n"); - - _mesa_notifySwapBuffers(ctx); - gl_ggiFlush(ctx); - - ggiSetDisplayFrame(ggi_ctx->ggi_visual, - !ggiGetDisplayFrame(ggi_ctx->ggi_visual)); - ggiSetWriteFrame(ggi_ctx->ggi_visual, - !ggiGetWriteFrame(ggi_ctx->ggi_visual)); - ggiSetReadFrame(ggi_ctx->ggi_visual, - !ggiGetReadFrame(ggi_ctx->ggi_visual)); - - GGIMESADPRINT_CORE("swap disp: %d, write %d\n", - ggiGetDisplayFrame(ggi_ctx->ggi_visual), - ggiGetWriteFrame(ggi_ctx->ggi_visual)); -} - -static void gl_ggiUpdateState(GLcontext *ctx, GLuint new_state) -{ - ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; - - GGIMESADPRINT_CORE("gl_ggiUpdateState() called\n"); - - /* Propogate statechange information to swrast and swrast_setup - * modules. The GGI driver has no internal GL-dependent state. - */ - _swrast_InvalidateState(ctx, new_state); - _swsetup_InvalidateState(ctx, new_state); - _tnl_InvalidateState(ctx, new_state); - - /* XXX: Better use an assertion that bails out here on failure */ - if (!LIBGGI_MESAEXT(ggi_ctx->ggi_visual)->update_state) { - GGIMESADPRINT_CORE("update_state == NULL!\n"); - GGIMESADPRINT_CORE("Please check your config files!\n"); - ggiPanic(""); - } - - LIBGGI_MESAEXT(ggi_ctx->ggi_visual)->update_state(ggi_ctx); -} - diff --git a/src/mesa/drivers/ggi/ggimesa.conf.in b/src/mesa/drivers/ggi/ggimesa.conf.in deleted file mode 100644 index 72132334fd..0000000000 --- a/src/mesa/drivers/ggi/ggimesa.conf.in +++ /dev/null @@ -1,13 +0,0 @@ -# GGIMesa global configuration -.root: @ggi_libdir@/ggi/mesa - -generic-stubs-mesa default/stubs.so -generic-linear-8-mesa default/linear_8.so -generic-linear-15-mesa default/linear_15.so -generic-linear-16-mesa default/linear_16.so -generic-linear-24-mesa default/linear_24.so -generic-linear-32-mesa default/linear_32.so - -display-fbdev-mesa display/fbdev.so - -# .include @ggi_confdir@/ggi/mesa/targets/fbdev.conf diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/debug.h b/src/mesa/drivers/ggi/include/ggi/mesa/debug.h deleted file mode 100644 index f461fee72c..0000000000 --- a/src/mesa/drivers/ggi/include/ggi/mesa/debug.h +++ /dev/null @@ -1,260 +0,0 @@ -/* -****************************************************************************** - - GGIMesa debugging macros - - Copyright (C) 1998-1999 Marcus Sundberg [marcus@ggi-project.org] - Copyright (C) 1999-2000 Jon Taylor [taylorj@ggi-project.org] - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -****************************************************************************** -*/ - -#ifndef _GGI_MESA_INTERNAL_DEBUG_H -#define _GGI_MESA_INTERNAL_DEBUG_H - -#include -#include -#include -#include - -#ifndef DEBUG -#define DEBUG -#endif - -__BEGIN_DECLS - -/* Exported variables */ -#ifdef BUILDING_GGIMESA -extern uint32 _ggimesaDebugState; -extern int _ggimesaDebugSync; -#else -IMPORTVAR uint32 _ggimesaDebugState; -IMPORTVAR int _ggimesaDebugSync; -#endif - -__END_DECLS - - -/* Debugging types - * bit 0 is reserved! */ - -#define GGIMESADEBUG_CORE (1<<1) /* 2 */ -#define GGIMESADEBUG_MODE (1<<2) /* 4 */ -#define GGIMESADEBUG_COLOR (1<<3) /* 8 */ -#define GGIMESADEBUG_DRAW (1<<4) /* 16 */ -#define GGIMESADEBUG_MISC (1<<5) /* 32 */ -#define GGIMESADEBUG_LIBS (1<<6) /* 64 */ -#define GGIMESADEBUG_EVENTS (1<<7) /* 128 */ - -#define GGIMESADEBUG_ALL 0xffffffff - -#ifdef __GNUC__ - -#ifdef DEBUG -#define GGIMESADPRINT(args...) if (_ggimesaDebugState) { ggDPrintf(_ggimesaDebugSync, "GGIMesa",args); } -#define GGIMESADPRINT_CORE(args...) if (_ggimesaDebugState & GGIMESADEBUG_CORE) { ggDPrintf(_ggimesaDebugSync,"GGIMesa",args); } -#define GGIMESADPRINT_MODE(args...) if (_ggimesaDebugState & GGIMESADEBUG_MODE) { ggDPrintf(_ggimesaDebugSync,"GGIMesa",args); } -#define GGIMESADPRINT_COLOR(args...) if (_ggimesaDebugState & GGIMESADEBUG_COLOR) { ggDPrintf(_ggimesaDebugSync,"GGIMesa",args); } -#define GGIMESADPRINT_DRAW(args...) if (_ggimesaDebugState & GGIMESADEBUG_DRAW) { ggDPrintf(_ggimesaDebugSync,"GGIMesa",args); } -#define GGIMESADPRINT_MISC(args...) if (_ggimesaDebugState & GGIMESADEBUG_MISC) { ggDPrintf(_ggimesaDebugSync,"GGIMesa",args); } -#define GGIMESADPRINT_LIBS(args...) if (_ggimesaDebugState & GGIMESADEBUG_LIBS) { ggDPrintf(_ggimesaDebugSync,"GGIMesa",args); } -#define GGIMESADPRINT_EVENTS(args...) if (_ggimesaDebugState & GGIMESADEBUG_EVENTS) { ggDPrintf(_ggimesaDebugSync,"GGIMesa",args); } -#else /* DEBUG */ -#define GGIMESADPRINT(args...) do{}while(0) -#define GGIMESADPRINT_CORE(args...) do{}while(0) -#define GGIMESADPRINT_MODE(args...) do{}while(0) -#define GGIMESADPRINT_COLOR(args...) do{}while(0) -#define GGIMESADPRINT_DRAW(args...) do{}while(0) -#define GGIMESADPRINT_MISC(args...) do{}while(0) -#define GGIMESADPRINT_LIBS(args...) do{}while(0) -#define GGIMESADPRINT_EVENTS(args...) do{}while(0) -#endif /* DEBUG */ - -#else /* __GNUC__ */ - -__BEGIN_DECLS - -static inline void GGIMESADPRINT(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIMESADPRINT_CORE(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_CORE) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIMESADPRINT_MODE(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_MODE) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIMESADPRINT_COLOR(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_COLOR) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIMESADPRINT_DRAW(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_DRAW) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIMESADPRINT_MISC(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_MISC) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIMESADPRINT_LIBS(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_LIBS) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -static inline void GGIMESADPRINT_EVENTS(const char *form,...) -{ -#ifdef DEBUG - if (_ggiDebugState & GGIDEBUG_EVENTS) { - va_list args; - - fprintf(stderr, "GGIMesa: "); - va_start(args, form); - vfprintf(stderr, form, args); - va_end(args); - if (_ggimesaDebugSync) fflush(stderr); - } -#endif -} - -__END_DECLS - -#endif /* __GNUC__ */ - -#ifdef DEBUG -#define GGIMESA_ASSERT(x,str) \ -{ if (!(x)) { \ - fprintf(stderr,"GGIMESA:%s:%d: INTERNAL ERROR: %s\n",__FILE__,__LINE__,str); \ - exit(1); \ -} } -#define GGIMESA_APPASSERT(x,str) \ -{ if (!(x)) { \ - fprintf(stderr,"GGIMESA:%s:%d: APPLICATION ERROR: %s\n",__FILE__,__LINE__,str); \ - exit(1); \ -} } -#else /* DEBUG */ -#define GGIMESA_ASSERT(x,str) do{}while(0) -#define GGIMESA_APPASSERT(x,str) do{}while(0) -#endif /* DEBUG */ - -#ifdef DEBUG -# define GGIMESAD0(x) x -#else -# define GGIMESAD0(x) /* empty */ -#endif - -#ifdef GGIMESADLEV -# if GGIMESADLEV == 1 -# define GGIMESAD1(x) x -# define GGIMESAD2(x) /* empty */ -# define GGIMESAD3(x) /* empty */ -# elif GGIMESADLEV == 2 -# define GGIMESAD1(x) x -# define GGIMESAD2(x) x -# define GGIMESAD3(x) /* empty */ -# elif GGIMESADLEV > 2 -# define GGIMESAD1(x) x -# define GGIMESAD2(x) x -# define GGIMESAD3(x) x -# endif -#else -# define GGIMESAD1(x) /* empty */ -# define GGIMESAD2(x) /* empty */ -# define GGIMESAD3(x) /* empty */ -#endif - -#endif /* _GGI_MESA_INTERNAL_DEBUG_H */ diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/display_fbdev.h b/src/mesa/drivers/ggi/include/ggi/mesa/display_fbdev.h deleted file mode 100644 index 5c3c1e290c..0000000000 --- a/src/mesa/drivers/ggi/include/ggi/mesa/display_fbdev.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _GGIMESA_DISPLAY_FBDEV_H -#define _GGIMESA_DISPLAY_FBDEV_H - -#include -#include - -ggifunc_setmode GGIMesa_fbdev_setmode; -ggifunc_getapi GGIMesa_fbdev_getapi; - -#define FBDEV_PRIV_MESA(vis) ((struct fbdev_priv_mesa *)(FBDEV_PRIV(vis)->accelpriv)) - -struct fbdev_priv_mesa -{ - char *accel; - int have_accel; - void *accelpriv; - ggi_fbdev_priv *oldpriv; /* Hooks back to the LibGGI fbdev target's private data */ -}; - -#endif /* _GGIMESA_DISPLAY_FBDEV_H */ diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h deleted file mode 100644 index ecdbe414f8..0000000000 --- a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa.h +++ /dev/null @@ -1,84 +0,0 @@ -/* GGI-Driver for MESA - * - * Copyright (C) 1997 Uwe Maurer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * --------------------------------------------------------------------- - * This code was derived from the following source of information: - * - * svgamesa.c and ddsample.c by Brian Paul - * - */ - -#ifndef _GGIMESA_H -#define _GGIMESA_H - -#include -#include -#include -#include "config.h" -#include "context.h" -#include "drawpix.h" -#include "imports.h" -#include "matrix.h" -#include "state.h" -#include "mtypes.h" -#include "macros.h" -#include "depth.h" - -#undef ASSERT /* ASSERT is redefined */ - -#include -#include -#include -#include "GL/ggimesa.h" - -/* - * GGIMesa visual configuration. - * - * This structure "derives" from Mesa's GLvisual and extends it by - * GGI's visual. Combination of these two structures is enough to fully - * describe the mode the application is currently running in. GGI - * visual provides information about color configuration and buffering - * method, GLvisual fills the rest. - */ -struct ggi_mesa_visual { - GLvisual gl_visual; - ggi_visual_t ggi_visual; -}; - -/* - * GGIMesa context. - * - * GGIMesa context expands the Mesa's context (it doesn't actualy derive - * from it, but this ability isn't needed, and it is best if GL context - * creation is left up to Mesa). It also contains a reference to the GGI - * visual it is attached to, which is very useful for all Mesa callbacks. - */ -struct ggi_mesa_context -{ - GLcontext *gl_ctx; - ggi_visual_t ggi_visual; - - ggi_pixel color; /* Current color or index*/ - ggi_pixel clearcolor; - - void *priv; -}; - -#define SHIFT (GGI_COLOR_PRECISION - 8) - -#endif - diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h b/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h deleted file mode 100644 index faafc779e6..0000000000 --- a/src/mesa/drivers/ggi/include/ggi/mesa/ggimesa_int.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _GGI_MESA_INT_H -#define _GGI_MESA_INT_H - -#include -#include "ggimesa.h" - - -extern ggi_extid _ggiMesaID; - -ggifunc_setmode GGIMesa_setmode; -ggifunc_getapi GGIMesa_getapi; - -typedef struct ggi_mesa_ext -{ - /* - * How mesa extends this visual; i.e., size of the depth buffer etc. - * - * By default (upon attaching) this structure is initialized to what - * libggi is guaranteed to handle without any help: single buffered - * visual without any ancilary buffers. - */ - struct ggi_mesa_visual mesa_visual; - - /* - * Mesa framebuffer is a collection of all ancilary buffers required. - * - * This structure contains the ancilary buffers provided in in - * software. On each mode change it is loaded with the list of - * required buffers and the target is expected to clear the ones - * it can provide in hw. The remaining ones are then provided in sw. - * - */ - GLframebuffer mesa_buffer; - - void (*update_state)(ggi_mesa_context_t ctx); - int (*setup_driver)(ggi_mesa_context_t ctx); - - void *private; -} ggi_mesa_ext_t; - -#define LIBGGI_MESAEXT(vis) ((ggi_mesa_ext_t *)LIBGGI_EXT(vis,_ggiMesaID)) -#define GGIMESA_PRIV(vis) ((LIBGGI_MESAEXT(vis)->priv)) - -#endif /* _GGI_MISC_INT_H */ -- cgit v1.2.3 From e14a5b14b2db2ef2e744b49024ac341b998d1711 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 16:08:59 -0500 Subject: Drop glide driver --- Makefile | 3 - configs/linux-glide | 23 - configs/linux-x86-glide | 28 - src/mesa/drivers/glide/fxapi.c | 951 --------------- src/mesa/drivers/glide/fxdd.c | 2197 ----------------------------------- src/mesa/drivers/glide/fxddspan.c | 638 ---------- src/mesa/drivers/glide/fxddtex.c | 1836 ----------------------------- src/mesa/drivers/glide/fxdrv.h | 773 ------------- src/mesa/drivers/glide/fxg.c | 2309 ------------------------------------- src/mesa/drivers/glide/fxg.h | 382 ------ src/mesa/drivers/glide/fxglidew.c | 269 ----- src/mesa/drivers/glide/fxglidew.h | 228 ---- src/mesa/drivers/glide/fxsetup.c | 2220 ----------------------------------- src/mesa/drivers/glide/fxsetup.h | 850 -------------- src/mesa/drivers/glide/fxtexman.c | 874 -------------- src/mesa/drivers/glide/fxtris.c | 1832 ----------------------------- src/mesa/drivers/glide/fxvb.c | 838 -------------- src/mesa/drivers/glide/fxvbtmp.h | 370 ------ 18 files changed, 16621 deletions(-) delete mode 100644 configs/linux-glide delete mode 100644 configs/linux-x86-glide delete mode 100644 src/mesa/drivers/glide/fxapi.c delete mode 100644 src/mesa/drivers/glide/fxdd.c delete mode 100644 src/mesa/drivers/glide/fxddspan.c delete mode 100644 src/mesa/drivers/glide/fxddtex.c delete mode 100644 src/mesa/drivers/glide/fxdrv.h delete mode 100644 src/mesa/drivers/glide/fxg.c delete mode 100644 src/mesa/drivers/glide/fxg.h delete mode 100644 src/mesa/drivers/glide/fxglidew.c delete mode 100644 src/mesa/drivers/glide/fxglidew.h delete mode 100644 src/mesa/drivers/glide/fxsetup.c delete mode 100644 src/mesa/drivers/glide/fxsetup.h delete mode 100644 src/mesa/drivers/glide/fxtexman.c delete mode 100644 src/mesa/drivers/glide/fxtris.c delete mode 100644 src/mesa/drivers/glide/fxvb.c delete mode 100644 src/mesa/drivers/glide/fxvbtmp.h (limited to 'src') diff --git a/Makefile b/Makefile index b99a87b8ba..f2ec3bf20f 100644 --- a/Makefile +++ b/Makefile @@ -118,7 +118,6 @@ linux-dri-xcb \ linux-egl \ linux-indirect \ linux-fbdev \ -linux-glide \ linux-ia64-icc \ linux-ia64-icc-static \ linux-icc \ @@ -149,7 +148,6 @@ linux-x86-64 \ linux-x86-64-debug \ linux-x86-64-profile \ linux-x86-64-static \ -linux-x86-glide \ linux-x86-profile \ linux-x86-static \ netbsd \ @@ -271,7 +269,6 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ $(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \ $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ - $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \ $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \ $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \ diff --git a/configs/linux-glide b/configs/linux-glide deleted file mode 100644 index 31475c81d8..0000000000 --- a/configs/linux-glide +++ /dev/null @@ -1,23 +0,0 @@ -# Configuration for generic Linux with 3Dfx Glide driver - -include $(TOP)/configs/default - -CONFIG_NAME = linux-glide - -# Compiler and flags -CC = gcc -CXX = g++ - -CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include -CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -GLUT_CFLAGS = -fexceptions - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -# Library/program dependencies -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm diff --git a/configs/linux-x86-glide b/configs/linux-x86-glide deleted file mode 100644 index 603b2bf758..0000000000 --- a/configs/linux-x86-glide +++ /dev/null @@ -1,28 +0,0 @@ -# Configuration for Linux with 3Dfx Glide driver and x86 optimizations - -include $(TOP)/configs/default - -CONFIG_NAME = linux-x86-glide - -# Compiler and flags -CC = gcc -CXX = g++ - -CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include -DFX -I/usr/include/glide -I/usr/local/glide/include - -CXXFLAGS = -Wall -O3 -ansi -pedantic -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE - -GLUT_CFLAGS = -fexceptions - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -MESA_ASM_SOURCES = $(X86_SOURCES) -GLAPI_ASM_SOURCES = $(X86_API) - -# Library/program dependencies -GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -L/usr/local/glide/lib -lglide3x -lm -lpthread -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11 -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/local/glide/lib -lglide3x -lm diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c deleted file mode 100644 index 238f491599..0000000000 --- a/src/mesa/drivers/glide/fxapi.c +++ /dev/null @@ -1,951 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - - -/* fxapi.c - public interface to FX/Mesa functions (fxmesa.h) */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#if defined(FX) -#include "fxdrv.h" - -#include "drivers/common/driverfuncs.h" -#include "main/framebuffer.h" - -#ifndef TDFX_DEBUG -int TDFX_DEBUG = (0 -/* | VERBOSE_VARRAY */ -/* | VERBOSE_TEXTURE */ -/* | VERBOSE_IMMEDIATE */ -/* | VERBOSE_PIPELINE */ -/* | VERBOSE_DRIVER */ -/* | VERBOSE_STATE */ -/* | VERBOSE_API */ -/* | VERBOSE_DISPLAY_LIST */ -/* | VERBOSE_LIGHTING */ -/* | VERBOSE_PRIMS */ -/* | VERBOSE_VERTS */ - ); -#endif - -static fxMesaContext fxMesaCurrentCtx = NULL; - -/* - * Status of 3Dfx hardware initialization - */ - -static int glbGlideInitialized = 0; -static int glb3DfxPresent = 0; -static int glbTotNumCtx = 0; - -static GrHwConfiguration glbHWConfig; -static int glbCurrentBoard = 0; - - -#if defined(__WIN32__) -static int -cleangraphics(void) -{ - glbTotNumCtx = 1; - fxMesaDestroyContext(fxMesaCurrentCtx); - - return 0; -} -#elif defined(__linux__) -static void -cleangraphics(void) -{ - glbTotNumCtx = 1; - fxMesaDestroyContext(fxMesaCurrentCtx); -} - -static void -cleangraphics_handler(int s) -{ - fprintf(stderr, "fxmesa: ERROR: received a not handled signal %d\n", s); - - cleangraphics(); -/* abort(); */ - exit(1); -} -#endif - - -/* - * Query 3Dfx hardware presence/kind - */ -static GLboolean GLAPIENTRY fxQueryHardware (void) -{ - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxQueryHardware()\n"); - } - - if (!glbGlideInitialized) { - grGlideInit(); - glb3DfxPresent = FX_grSstQueryHardware(&glbHWConfig); - - glbGlideInitialized = 1; - -#if defined(__WIN32__) - _onexit((_onexit_t) cleangraphics); -#elif defined(__linux__) - /* Only register handler if environment variable is not defined. */ - if (!getenv("MESA_FX_NO_SIGNALS")) { - atexit(cleangraphics); - } -#endif - } - - return glb3DfxPresent; -} - - -/* - * Select the Voodoo board to use when creating - * a new context. - */ -GLint GLAPIENTRY fxMesaSelectCurrentBoard (int n) -{ - fxQueryHardware(); - - if ((n < 0) || (n >= glbHWConfig.num_sst)) - return -1; - - return glbHWConfig.SSTs[glbCurrentBoard = n].type; -} - - -fxMesaContext GLAPIENTRY fxMesaGetCurrentContext (void) -{ - return fxMesaCurrentCtx; -} - - -void GLAPIENTRY fxGetScreenGeometry (GLint *w, GLint *h) -{ - GLint width = 0; - GLint height = 0; - - if (fxMesaCurrentCtx != NULL) { - width = fxMesaCurrentCtx->screen_width; - height = fxMesaCurrentCtx->screen_height; - } - - if (w != NULL) { - *w = width; - } - if (h != NULL) { - *h = height; - } -} - - -/* - * The 3Dfx Global Palette extension for GLQuake. - * More a trick than a real extesion, use the shared global - * palette extension. - */ -extern void GLAPIENTRY gl3DfxSetPaletteEXT(GLuint * pal); /* silence warning */ -void GLAPIENTRY -gl3DfxSetPaletteEXT(GLuint * pal) -{ - fxMesaContext fxMesa = fxMesaCurrentCtx; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - int i; - - fprintf(stderr, "gl3DfxSetPaletteEXT(...)\n"); - - for (i = 0; i < 256; i++) { - fprintf(stderr, "\t%x\n", pal[i]); - } - } - - if (fxMesa) { - fxMesa->haveGlobalPaletteTexture = 1; - - grTexDownloadTable(GR_TEXTABLE_PALETTE, (GuTexPalette *) pal); - } -} - - -static GrScreenResolution_t fxBestResolution (int width, int height) -{ - static int resolutions[][3] = { - { GR_RESOLUTION_320x200, 320, 200 }, - { GR_RESOLUTION_320x240, 320, 240 }, - { GR_RESOLUTION_400x256, 400, 256 }, - { GR_RESOLUTION_512x384, 512, 384 }, - { GR_RESOLUTION_640x200, 640, 200 }, - { GR_RESOLUTION_640x350, 640, 350 }, - { GR_RESOLUTION_640x400, 640, 400 }, - { GR_RESOLUTION_640x480, 640, 480 }, - { GR_RESOLUTION_800x600, 800, 600 }, - { GR_RESOLUTION_960x720, 960, 720 }, - { GR_RESOLUTION_856x480, 856, 480 }, - { GR_RESOLUTION_512x256, 512, 256 }, - { GR_RESOLUTION_1024x768, 1024, 768 }, - { GR_RESOLUTION_1280x1024, 1280, 1024 }, - { GR_RESOLUTION_1600x1200, 1600, 1200 }, - { GR_RESOLUTION_400x300, 400, 300 }, - { GR_RESOLUTION_1152x864, 1152, 864 }, - { GR_RESOLUTION_1280x960, 1280, 960 }, - { GR_RESOLUTION_1600x1024, 1600, 1024 }, - { GR_RESOLUTION_1792x1344, 1792, 1344 }, - { GR_RESOLUTION_1856x1392, 1856, 1392 }, - { GR_RESOLUTION_1920x1440, 1920, 1440 }, - { GR_RESOLUTION_2048x1536, 2048, 1536 }, - { GR_RESOLUTION_2048x2048, 2048, 2048 } - }; - - int i, size; - int lastvalidres = GR_RESOLUTION_640x480; - int min = 2048 * 2048; /* max is GR_RESOLUTION_2048x2048 */ - GrResolution resTemplate = { - GR_QUERY_ANY, - GR_QUERY_ANY, - 2 /*GR_QUERY_ANY */, - GR_QUERY_ANY - }; - GrResolution *presSupported; - - fxQueryHardware(); - - size = grQueryResolutions(&resTemplate, NULL); - presSupported = malloc(size); - - size /= sizeof(GrResolution); - grQueryResolutions(&resTemplate, presSupported); - - for (i = 0; i < size; i++) { - int r = presSupported[i].resolution; - if ((width <= resolutions[r][1]) && (height <= resolutions[r][2])) { - if (min > (resolutions[r][1] * resolutions[r][2])) { - min = resolutions[r][1] * resolutions[r][2]; - lastvalidres = r; - } - } - } - - free(presSupported); - - return resolutions[lastvalidres][0]; -} - - -fxMesaContext GLAPIENTRY -fxMesaCreateBestContext(GLuint win, GLint width, GLint height, - const GLint attribList[]) -{ - int res = fxBestResolution(width, height); - - if (res == -1) { - return NULL; - } - - return fxMesaCreateContext(win, res, GR_REFRESH_60Hz, attribList); -} - - -/* - * Create a new FX/Mesa context and return a handle to it. - */ -fxMesaContext GLAPIENTRY -fxMesaCreateContext(GLuint win, - GrScreenResolution_t res, - GrScreenRefresh_t ref, const GLint attribList[]) -{ - fxMesaContext fxMesa = NULL; - GLcontext *ctx = NULL, *shareCtx = NULL; - struct dd_function_table functions; - - int i; - const char *str; - int sliaa, numSLI, samplesPerChip; - struct SstCard_St *voodoo; - struct tdfx_glide *Glide; - - GLboolean aux; - GLboolean doubleBuffer; - GLuint colDepth; - GLuint depthSize, alphaSize, stencilSize, accumSize; - GLuint redBits, greenBits, blueBits, alphaBits; - GrPixelFormat_t pixFmt; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxMesaCreateContext(...)\n"); - } - - /* Okay, first process the user flags */ - aux = GL_FALSE; - doubleBuffer = GL_FALSE; - colDepth = 16; - depthSize = alphaSize = stencilSize = accumSize = 0; - - i = 0; - while (attribList[i] != FXMESA_NONE) { - switch (attribList[i]) { - case FXMESA_COLORDEPTH: - colDepth = attribList[++i]; - break; - case FXMESA_DOUBLEBUFFER: - doubleBuffer = GL_TRUE; - break; - case FXMESA_ALPHA_SIZE: - if ((alphaSize = attribList[++i])) { - aux = GL_TRUE; - } - break; - case FXMESA_DEPTH_SIZE: - if ((depthSize = attribList[++i])) { - aux = GL_TRUE; - } - break; - case FXMESA_STENCIL_SIZE: - stencilSize = attribList[++i]; - break; - case FXMESA_ACCUM_SIZE: - accumSize = attribList[++i]; - break; - /* XXX ugly hack here for sharing display lists */ - case FXMESA_SHARE_CONTEXT: - shareCtx = (GLcontext *)attribList[++i]; - break; - default: - fprintf(stderr, "fxMesaCreateContext: ERROR: wrong parameter (%d) passed\n", attribList[i]); - return NULL; - } - i++; - } - - if (!fxQueryHardware()) { - str = "no Voodoo hardware!"; - goto errorhandler; - } - - grSstSelect(glbCurrentBoard); - /*grEnable(GR_OPENGL_MODE_EXT);*/ /* [koolsmoky] */ - voodoo = &glbHWConfig.SSTs[glbCurrentBoard]; - - fxMesa = (fxMesaContext)CALLOC_STRUCT(tfxMesaContext); - if (!fxMesa) { - str = "private context"; - goto errorhandler; - } - - if (getenv("MESA_FX_INFO")) { - fxMesa->verbose = GL_TRUE; - } - - fxMesa->type = voodoo->type; - fxMesa->HavePalExt = voodoo->HavePalExt && !getenv("MESA_FX_IGNORE_PALEXT"); - fxMesa->HavePixExt = voodoo->HavePixExt && !getenv("MESA_FX_IGNORE_PIXEXT"); - fxMesa->HaveTexFmt = voodoo->HaveTexFmt && !getenv("MESA_FX_IGNORE_TEXFMT"); - fxMesa->HaveCmbExt = voodoo->HaveCmbExt && !getenv("MESA_FX_IGNORE_CMBEXT"); - fxMesa->HaveMirExt = voodoo->HaveMirExt && !getenv("MESA_FX_IGNORE_MIREXT"); - fxMesa->HaveTexUma = voodoo->HaveTexUma && !getenv("MESA_FX_IGNORE_TEXUMA"); - fxMesa->Glide = glbHWConfig.Glide; - Glide = &fxMesa->Glide; - fxMesa->HaveTexus2 = Glide->txImgQuantize && - Glide->txMipQuantize && - Glide->txPalToNcc && !getenv("MESA_FX_IGNORE_TEXUS2"); - - /* Determine if we need vertex swapping, RGB order and SLI/AA */ - sliaa = 0; - switch (fxMesa->type) { - case GR_SSTTYPE_VOODOO: - case GR_SSTTYPE_SST96: - case GR_SSTTYPE_Banshee: - fxMesa->bgrOrder = GL_TRUE; - fxMesa->snapVertices = (getenv("MESA_FX_NOSNAP") == NULL); - break; - case GR_SSTTYPE_Voodoo2: - fxMesa->bgrOrder = GL_TRUE; - fxMesa->snapVertices = GL_FALSE; - break; - case GR_SSTTYPE_Voodoo4: - case GR_SSTTYPE_Voodoo5: - /* number of SLI units and AA Samples per chip */ - if ((str = Glide->grGetRegistryOrEnvironmentStringExt("SSTH3_SLI_AA_CONFIGURATION")) != NULL) { - sliaa = atoi(str); - } - case GR_SSTTYPE_Voodoo3: - default: - fxMesa->bgrOrder = GL_FALSE; - fxMesa->snapVertices = GL_FALSE; - break; - } - /* XXX todo - Add the old SLI/AA settings for Napalm. */ - switch(voodoo->numChips) { - case 4: /* 4 chips */ - switch(sliaa) { - case 8: /* 8 Sample AA */ - numSLI = 1; - samplesPerChip = 2; - break; - case 7: /* 4 Sample AA */ - numSLI = 1; - samplesPerChip = 1; - break; - case 6: /* 2 Sample AA */ - numSLI = 2; - samplesPerChip = 1; - break; - default: - numSLI = 4; - samplesPerChip = 1; - } - break; - case 2: /* 2 chips */ - switch(sliaa) { - case 4: /* 4 Sample AA */ - numSLI = 1; - samplesPerChip = 2; - break; - case 3: /* 2 Sample AA */ - numSLI = 1; - samplesPerChip = 1; - break; - default: - numSLI = 2; - samplesPerChip = 1; - } - break; - default: /* 1 chip */ - switch(sliaa) { - case 1: /* 2 Sample AA */ - numSLI = 1; - samplesPerChip = 2; - break; - default: - numSLI = 1; - samplesPerChip = 1; - } - } - - fxMesa->fsaa = samplesPerChip * voodoo->numChips / numSLI; /* 1:noFSAA, 2:2xFSAA, 4:4xFSAA, 8:8xFSAA */ - - switch (fxMesa->colDepth = colDepth) { - case 15: - redBits = 5; - greenBits = 5; - blueBits = 5; - alphaBits = depthSize ? 1 : 8; - switch(fxMesa->fsaa) { - case 8: - pixFmt = GR_PIXFMT_AA_8_ARGB_1555; - break; - case 4: - pixFmt = GR_PIXFMT_AA_4_ARGB_1555; - break; - case 2: - pixFmt = GR_PIXFMT_AA_2_ARGB_1555; - break; - default: - pixFmt = GR_PIXFMT_ARGB_1555; - } - break; - case 16: - redBits = 5; - greenBits = 6; - blueBits = 5; - alphaBits = depthSize ? 0 : 8; - switch(fxMesa->fsaa) { - case 8: - pixFmt = GR_PIXFMT_AA_8_RGB_565; - break; - case 4: - pixFmt = GR_PIXFMT_AA_4_RGB_565; - break; - case 2: - pixFmt = GR_PIXFMT_AA_2_RGB_565; - break; - default: - pixFmt = GR_PIXFMT_RGB_565; - } - break; - case 24: - fxMesa->colDepth = 32; - case 32: - redBits = 8; - greenBits = 8; - blueBits = 8; - alphaBits = 8; - switch(fxMesa->fsaa) { - case 8: - pixFmt = GR_PIXFMT_AA_8_ARGB_8888; - break; - case 4: - pixFmt = GR_PIXFMT_AA_4_ARGB_8888; - break; - case 2: - pixFmt = GR_PIXFMT_AA_2_ARGB_8888; - break; - default: - pixFmt = GR_PIXFMT_ARGB_8888; - } - break; - default: - str = "pixelFormat"; - goto errorhandler; - } - - /* Tips: - * 1. we don't bother setting/checking AUX for stencil, because we'll decide - * later whether we have HW stencil, based on depth buffer (thus AUX is - * properly set) - * 2. when both DEPTH and ALPHA are enabled, depth should win. However, it is - * not clear whether 15bpp and 32bpp require AUX alpha buffer. Furthermore, - * alpha buffering is required only if destination alpha is used in alpha - * blending; alpha blending modes that do not use destination alpha can be - * used w/o alpha buffer. - * 3. `alphaBits' is what we can provide - * `alphaSize' is what app requests - * if we cannot provide enough bits for alpha buffer, we should fallback to - * SW alpha. However, setting `alphaBits' to `alphaSize' might confuse some - * of the span functions... - */ - - fxMesa->haveHwAlpha = GL_FALSE; - if (alphaSize && (alphaSize <= alphaBits)) { - alphaSize = alphaBits; - fxMesa->haveHwAlpha = GL_TRUE; - } - - fxMesa->haveHwStencil = (fxMesa->HavePixExt && stencilSize && depthSize == 24); - - fxMesa->haveZBuffer = depthSize > 0; - fxMesa->haveDoubleBuffer = doubleBuffer; - fxMesa->haveGlobalPaletteTexture = GL_FALSE; - fxMesa->board = glbCurrentBoard; - - fxMesa->haveTwoTMUs = (voodoo->nTexelfx > 1); - - if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_NUM_TMU"))) { - if (atoi(str) <= 1) { - fxMesa->haveTwoTMUs = GL_FALSE; - } - } - - if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_SWAPPENDINGCOUNT"))) { - fxMesa->maxPendingSwapBuffers = atoi(str); - if (fxMesa->maxPendingSwapBuffers > 6) { - fxMesa->maxPendingSwapBuffers = 6; - } else if (fxMesa->maxPendingSwapBuffers < 0) { - fxMesa->maxPendingSwapBuffers = 0; - } - } else { - fxMesa->maxPendingSwapBuffers = 2; - } - - if ((str = Glide->grGetRegistryOrEnvironmentStringExt("FX_GLIDE_SWAPINTERVAL"))) { - fxMesa->swapInterval = atoi(str); - } else { - fxMesa->swapInterval = 0; - } - - BEGIN_BOARD_LOCK(); - if (fxMesa->HavePixExt) { - fxMesa->glideContext = Glide->grSstWinOpenExt((FxU32)win, res, ref, - GR_COLORFORMAT_ABGR, GR_ORIGIN_LOWER_LEFT, - pixFmt, - 2, aux); - } else if (pixFmt == GR_PIXFMT_RGB_565) { - fxMesa->glideContext = grSstWinOpen((FxU32)win, res, ref, - GR_COLORFORMAT_ABGR, GR_ORIGIN_LOWER_LEFT, - 2, aux); - } else { - fxMesa->glideContext = 0; - } - END_BOARD_LOCK(); - if (!fxMesa->glideContext) { - str = "grSstWinOpen"; - goto errorhandler; - } - - /* screen */ - fxMesa->screen_width = FX_grSstScreenWidth(); - fxMesa->screen_height = FX_grSstScreenHeight(); - - /* window inside screen */ - fxMesa->width = fxMesa->screen_width; - fxMesa->height = fxMesa->screen_height; - - /* scissor inside window */ - fxMesa->clipMinX = 0; - fxMesa->clipMaxX = fxMesa->width; - fxMesa->clipMinY = 0; - fxMesa->clipMaxY = fxMesa->height; - - if (fxMesa->verbose) { - FxI32 tmuRam, fbRam; - - /* Not that it matters, but tmuRam and fbRam change after grSstWinOpen. */ - tmuRam = voodoo->tmuConfig[GR_TMU0].tmuRam; - fbRam = voodoo->fbRam; - BEGIN_BOARD_LOCK(); - grGet(GR_MEMORY_TMU, 4, &tmuRam); - grGet(GR_MEMORY_FB, 4, &fbRam); - END_BOARD_LOCK(); - - fprintf(stderr, "Voodoo Using Glide %s\n", grGetString(GR_VERSION)); - fprintf(stderr, "Voodoo Board: %d/%d, %s, %d GPU\n", - fxMesa->board + 1, - glbHWConfig.num_sst, - grGetString(GR_HARDWARE), - voodoo->numChips); - fprintf(stderr, "Voodoo Memory: FB = %ld, TM = %d x %ld\n", - fbRam, - voodoo->nTexelfx, - tmuRam); - fprintf(stderr, "Voodoo Screen: %dx%d:%d %s, %svertex snapping\n", - fxMesa->screen_width, - fxMesa->screen_height, - colDepth, - fxMesa->bgrOrder ? "BGR" : "RGB", - fxMesa->snapVertices ? "" : "no "); - } - - sprintf(fxMesa->rendererString, "Mesa %s v0.63 %s%s", - grGetString(GR_RENDERER), - grGetString(GR_HARDWARE), - ((fxMesa->type < GR_SSTTYPE_Voodoo4) && (voodoo->numChips > 1)) ? " SLI" : ""); - - fxMesa->glVis = _mesa_create_visual(GL_TRUE, /* RGB mode */ - doubleBuffer, - GL_FALSE, /* stereo */ - redBits, /* RGBA.R bits */ - greenBits, /* RGBA.G bits */ - blueBits, /* RGBA.B bits */ - alphaSize, /* RGBA.A bits */ - 0, /* index bits */ - depthSize, /* depth_size */ - stencilSize, /* stencil_size */ - accumSize, - accumSize, - accumSize, - alphaSize ? accumSize : 0, - 1); - if (!fxMesa->glVis) { - str = "_mesa_create_visual"; - goto errorhandler; - } - - _mesa_init_driver_functions(&functions); - ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis, shareCtx, - &functions, (void *) fxMesa); - if (!ctx) { - str = "_mesa_create_context"; - goto errorhandler; - } - - - if (!fxDDInitFxMesaContext(fxMesa)) { - str = "fxDDInitFxMesaContext"; - goto errorhandler; - } - - - fxMesa->glBuffer = _mesa_create_framebuffer(fxMesa->glVis); -#if 0 -/* XXX this is a complete mess :( - * _mesa_add_soft_renderbuffers - * driNewRenderbuffer - */ - GL_FALSE, /* no software depth */ - stencilSize && !fxMesa->haveHwStencil, - fxMesa->glVis->accumRedBits > 0, - alphaSize && !fxMesa->haveHwAlpha); -#endif - if (!fxMesa->glBuffer) { - str = "_mesa_create_framebuffer"; - goto errorhandler; - } - - glbTotNumCtx++; - - /* install signal handlers */ -#if defined(__linux__) - /* Only install if environment var. is not set. */ - if (!getenv("MESA_FX_NO_SIGNALS")) { - signal(SIGINT, cleangraphics_handler); - signal(SIGHUP, cleangraphics_handler); - signal(SIGPIPE, cleangraphics_handler); - signal(SIGFPE, cleangraphics_handler); - signal(SIGBUS, cleangraphics_handler); - signal(SIGILL, cleangraphics_handler); - signal(SIGSEGV, cleangraphics_handler); - signal(SIGTERM, cleangraphics_handler); - } -#endif - - return fxMesa; - -errorhandler: - if (fxMesa) { - if (fxMesa->glideContext) { - grSstWinClose(fxMesa->glideContext); - fxMesa->glideContext = 0; - } - - if (fxMesa->state) { - FREE(fxMesa->state); - } - if (fxMesa->fogTable) { - FREE(fxMesa->fogTable); - } - if (fxMesa->glBuffer) { - _mesa_reference_framebuffer(&fxMesa->glBuffer, NULL); - } - if (fxMesa->glVis) { - _mesa_destroy_visual(fxMesa->glVis); - } - if (fxMesa->glCtx) { - _mesa_destroy_context(fxMesa->glCtx); - } - FREE(fxMesa); - } - - fprintf(stderr, "fxMesaCreateContext: ERROR: %s\n", str); - return NULL; -} - - -/* - * Function to set the new window size in the context (mainly for the Voodoo Rush) - */ -void GLAPIENTRY -fxMesaUpdateScreenSize(fxMesaContext fxMesa) -{ - fxMesa->width = FX_grSstScreenWidth(); - fxMesa->height = FX_grSstScreenHeight(); -} - - -/* - * Destroy the given FX/Mesa context. - */ -void GLAPIENTRY -fxMesaDestroyContext(fxMesaContext fxMesa) -{ - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxMesaDestroyContext(...)\n"); - } - - if (!fxMesa) - return; - - if (fxMesa->verbose) { - fprintf(stderr, "Misc Stats:\n"); - fprintf(stderr, " # swap buffer: %u\n", fxMesa->stats.swapBuffer); - - if (!fxMesa->stats.swapBuffer) - fxMesa->stats.swapBuffer = 1; - - fprintf(stderr, "Textures Stats:\n"); - fprintf(stderr, " Free texture memory on TMU0: %d\n", - fxMesa->freeTexMem[FX_TMU0]); - if (fxMesa->haveTwoTMUs) - fprintf(stderr, " Free texture memory on TMU1: %d\n", - fxMesa->freeTexMem[FX_TMU1]); - fprintf(stderr, " # request to TMM to upload a texture objects: %u\n", - fxMesa->stats.reqTexUpload); - fprintf(stderr, - " # request to TMM to upload a texture objects per swapbuffer: %.2f\n", - fxMesa->stats.reqTexUpload / (float) fxMesa->stats.swapBuffer); - fprintf(stderr, " # texture objects uploaded: %u\n", - fxMesa->stats.texUpload); - fprintf(stderr, " # texture objects uploaded per swapbuffer: %.2f\n", - fxMesa->stats.texUpload / (float) fxMesa->stats.swapBuffer); - fprintf(stderr, " # MBs uploaded to texture memory: %.2f\n", - fxMesa->stats.memTexUpload / (float) (1 << 20)); - fprintf(stderr, - " # MBs uploaded to texture memory per swapbuffer: %.2f\n", - (fxMesa->stats.memTexUpload / - (float) fxMesa->stats.swapBuffer) / (float) (1 << 20)); - } - - glbTotNumCtx--; - - if (!glbTotNumCtx && getenv("MESA_FX_INFO")) { - GrSstPerfStats_t st; - - FX_grSstPerfStats(&st); - - fprintf(stderr, "Pixels Stats:\n"); - fprintf(stderr, " # pixels processed (minus buffer clears): %u\n", - (unsigned) st.pixelsIn); - fprintf(stderr, " # pixels not drawn due to chroma key test failure: %u\n", - (unsigned) st.chromaFail); - fprintf(stderr, " # pixels not drawn due to depth test failure: %u\n", - (unsigned) st.zFuncFail); - fprintf(stderr, - " # pixels not drawn due to alpha test failure: %u\n", - (unsigned) st.aFuncFail); - fprintf(stderr, " # pixels drawn (including buffer clears and LFB writes): %u\n", - (unsigned) st.pixelsOut); - } - - /* close the hardware first, - * so we can debug atexit problems (memory leaks, etc). - */ - grSstWinClose(fxMesa->glideContext); - fxCloseHardware(); - - fxDDDestroyFxMesaContext(fxMesa); /* must be before _mesa_destroy_context */ - _mesa_destroy_visual(fxMesa->glVis); - _mesa_destroy_context(fxMesa->glCtx); - _mesa_reference_framebuffer(&fxMesa->glBuffer, NULL); - fxTMClose(fxMesa); /* must be after _mesa_destroy_context */ - - FREE(fxMesa); - - if (fxMesa == fxMesaCurrentCtx) - fxMesaCurrentCtx = NULL; -} - - -/* - * Make the specified FX/Mesa context the current one. - */ -void GLAPIENTRY -fxMesaMakeCurrent(fxMesaContext fxMesa) -{ - if (!fxMesa) { - _mesa_make_current(NULL, NULL, NULL); - fxMesaCurrentCtx = NULL; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxMesaMakeCurrent(NULL)\n"); - } - - return; - } - - /* if this context is already the current one, we can return early */ - if (fxMesaCurrentCtx == fxMesa - && fxMesaCurrentCtx->glCtx == _mesa_get_current_context()) { - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxMesaMakeCurrent(NOP)\n"); - } - - return; - } - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxMesaMakeCurrent(...)\n"); - } - - if (fxMesaCurrentCtx) - grGlideGetState((GrState *) fxMesaCurrentCtx->state); - - fxMesaCurrentCtx = fxMesa; - - grSstSelect(fxMesa->board); - grGlideSetState((GrState *) fxMesa->state); - - _mesa_make_current(fxMesa->glCtx, fxMesa->glBuffer, fxMesa->glBuffer); - - fxSetupDDPointers(fxMesa->glCtx); -} - - -/* - * Swap front/back buffers for current context if double buffered. - */ -void GLAPIENTRY -fxMesaSwapBuffers(void) -{ - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxMesaSwapBuffers()\n"); - } - - if (fxMesaCurrentCtx) { - _mesa_notifySwapBuffers(fxMesaCurrentCtx->glCtx); - - if (fxMesaCurrentCtx->haveDoubleBuffer) { - - grBufferSwap(fxMesaCurrentCtx->swapInterval); - -#if 0 - /* - * Don't allow swap buffer commands to build up! - */ - while (FX_grGetInteger(GR_PENDING_BUFFERSWAPS) > - fxMesaCurrentCtx->maxPendingSwapBuffers) - /* The driver is able to sleep when waiting for the completation - of multiple swapbuffer operations instead of wasting - CPU time (NOTE: you must uncomment the following line in the - in order to enable this option) */ - /* usleep(10000); */ - ; -#endif - - fxMesaCurrentCtx->stats.swapBuffer++; - } - } -} - - -/* - * Shutdown Glide library - */ -void GLAPIENTRY -fxCloseHardware(void) -{ - if (glbGlideInitialized) { - if (glbTotNumCtx == 0) { - grGlideShutdown(); - glbGlideInitialized = 0; - } - } -} - - -#else - - -/* - * Need this to provide at least one external definition. - */ -extern int gl_fx_dummy_function_api(void); -int -gl_fx_dummy_function_api(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c deleted file mode 100644 index b78b101240..0000000000 --- a/src/mesa/drivers/glide/fxdd.c +++ /dev/null @@ -1,2197 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - -/* fxdd.c - 3Dfx VooDoo Mesa device driver functions */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#if defined(FX) - -#include "main/image.h" -#include "main/mtypes.h" -#include "fxdrv.h" -#include "main/buffers.h" -#include "main/enums.h" -#include "main/extensions.h" -#include "main/macros.h" -#include "main/texstore.h" -#include "main/teximage.h" -#include "swrast/swrast.h" -#include "swrast/s_context.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "vbo/vbo.h" - - - -/* lookup table for scaling 4 bit colors up to 8 bits */ -GLuint FX_rgb_scale_4[16] = { - 0, 17, 34, 51, 68, 85, 102, 119, - 136, 153, 170, 187, 204, 221, 238, 255 -}; - -/* lookup table for scaling 5 bit colors up to 8 bits */ -GLuint FX_rgb_scale_5[32] = { - 0, 8, 16, 25, 33, 41, 49, 58, - 66, 74, 82, 90, 99, 107, 115, 123, - 132, 140, 148, 156, 165, 173, 181, 189, - 197, 206, 214, 222, 230, 239, 247, 255 -}; - -/* lookup table for scaling 6 bit colors up to 8 bits */ -GLuint FX_rgb_scale_6[64] = { - 0, 4, 8, 12, 16, 20, 24, 28, - 32, 36, 40, 45, 49, 53, 57, 61, - 65, 69, 73, 77, 81, 85, 89, 93, - 97, 101, 105, 109, 113, 117, 121, 125, - 130, 134, 138, 142, 146, 150, 154, 158, - 162, 166, 170, 174, 178, 182, 186, 190, - 194, 198, 202, 206, 210, 215, 219, 223, - 227, 231, 235, 239, 243, 247, 251, 255 -}; - - -/* - * Disable color by masking out R, G, B, A - */ -static void fxDisableColor (fxMesaContext fxMesa) -{ - if (fxMesa->colDepth == 32) { - /* 32bpp mode */ - fxMesa->Glide.grColorMaskExt(FXFALSE, FXFALSE, FXFALSE, FXFALSE); - } else { - /* 15/16 bpp mode */ - grColorMask(FXFALSE, FXFALSE); - } -} - - -/**********************************************************************/ -/***** Miscellaneous functions *****/ -/**********************************************************************/ - -/* Return buffer size information */ -static void -fxDDGetBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) -{ - GET_CURRENT_CONTEXT(ctx); - if (ctx && FX_CONTEXT(ctx)) { - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDGetBufferSize(...)\n"); - } - - *width = fxMesa->width; - *height = fxMesa->height; - } -} - - -/** - * We only implement this function as a mechanism to check if the - * framebuffer size has changed (and update corresponding state). - */ -static void -fxDDViewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysDrawBuffer; - fxDDGetBufferSize( buffer, &newWidth, &newHeight ); - if (buffer->Width != newWidth || buffer->Height != newHeight) { - _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); - } -} - - -/* Implements glClearColor() */ -static void -fxDDClearColor(GLcontext * ctx, const GLfloat color[4]) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLubyte col[4]; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDClearColor(%f, %f, %f, %f)\n", - color[0], color[1], color[2], color[3]); - } - - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(col[3], color[3]); - - fxMesa->clearC = FXCOLOR4(col); - fxMesa->clearA = col[3]; -} - - -/* Clear the color and/or depth buffers */ -static void fxDDClear( GLcontext *ctx, GLbitfield mask ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLbitfield softwareMask = mask & (BUFFER_BIT_ACCUM); - const GLuint stencil_size = fxMesa->haveHwStencil ? ctx->Visual.stencilBits : 0; - const FxU32 clearD = (FxU32) (ctx->DrawBuffer->_DepthMaxF * ctx->Depth.Clear); - const FxU8 clearS = (FxU8) (ctx->Stencil.Clear & 0xff); - - if ( TDFX_DEBUG & MESA_VERBOSE ) { - fprintf( stderr, "fxDDClear\n"); - } - - /* we can't clear accum buffers nor stereo */ - mask &= ~(BUFFER_BIT_ACCUM | BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT); - - /* Need this check to respond to certain HW updates */ - if (fxMesa->new_state & (FX_NEW_SCISSOR | FX_NEW_COLOR_MASK)) { - fxSetupScissor(ctx); - fxSetupColorMask(ctx); - fxMesa->new_state &= ~(FX_NEW_SCISSOR | FX_NEW_COLOR_MASK); - } - - /* - * As per GL spec, color masking should be obeyed when clearing - */ - if (ctx->Visual.greenBits != 8) { - /* can only do color masking if running in 24/32bpp on Napalm */ - if (ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP] || - ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]) { - softwareMask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)); - mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); - } - } - - if (fxMesa->haveHwStencil) { - /* - * If we want to clear stencil, it must be enabled - * in the HW, even if the stencil test is not enabled - * in the OGL state. - */ - BEGIN_BOARD_LOCK(); - if (mask & BUFFER_BIT_STENCIL) { - fxMesa->Glide.grStencilMaskExt(fxMesa->unitsState.stencilWriteMask); - /* set stencil ref value = desired clear value */ - fxMesa->Glide.grStencilFuncExt(GR_CMP_ALWAYS, clearS, 0xff); - fxMesa->Glide.grStencilOpExt(GR_STENCILOP_REPLACE, - GR_STENCILOP_REPLACE, GR_STENCILOP_REPLACE); - grEnable(GR_STENCIL_MODE_EXT); - } - else { - grDisable(GR_STENCIL_MODE_EXT); - } - END_BOARD_LOCK(); - } else if (mask & BUFFER_BIT_STENCIL) { - softwareMask |= (mask & (BUFFER_BIT_STENCIL)); - mask &= ~(BUFFER_BIT_STENCIL); - } - - /* - * This may be ugly, but it's needed in order to work around a number - * of Glide bugs. - */ - BEGIN_CLIP_LOOP(); - { - /* - * This could probably be done fancier but doing each possible case - * explicitly is less error prone. - */ - switch (mask & ~BUFFER_BIT_STENCIL) { - case BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH: - /* back buffer & depth */ - grDepthMask(FXTRUE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - if (stencil_size > 0) { - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - } - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - break; - case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_DEPTH: - /* XXX it appears that the depth buffer isn't cleared when - * glRenderBuffer(GR_BUFFER_FRONTBUFFER) is set. - * This is a work-around/ - */ - /* clear depth */ - grDepthMask(FXTRUE); - fxDisableColor(fxMesa); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - fxSetupColorMask(ctx); - grDepthMask(FXFALSE); - /* clear front */ - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - break; - case BUFFER_BIT_BACK_LEFT: - /* back buffer only */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - break; - case BUFFER_BIT_FRONT_LEFT: - /* front buffer only */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - break; - case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT: - /* front and back */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - break; - case BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH: - /* clear back and depth */ - grDepthMask(FXTRUE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - /* clear front */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_FRONTBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - break; - case BUFFER_BIT_DEPTH: - /* just the depth buffer */ - grDepthMask(FXTRUE); - fxDisableColor(fxMesa); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - if (stencil_size > 0) - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - else - grBufferClear(fxMesa->clearC, - fxMesa->clearA, - clearD); - fxSetupColorMask(ctx); - break; - default: - /* clear no color buffers or depth buffer but might clear stencil */ - if ((stencil_size > 0) && (mask & BUFFER_BIT_STENCIL)) { - /* XXX need this RenderBuffer call to work around Glide bug */ - grDepthMask(FXFALSE); - grRenderBuffer(GR_BUFFER_BACKBUFFER); - fxDisableColor(fxMesa); - fxMesa->Glide.grBufferClearExt(fxMesa->clearC, - fxMesa->clearA, - clearD, clearS); - fxSetupColorMask(ctx); - } - } - } - END_CLIP_LOOP(); - - if (fxMesa->haveHwStencil) { - /* We changed the stencil state above. Restore it! */ - fxSetupStencil(ctx); - } - fxSetupDepthTest(ctx); - grRenderBuffer(fxMesa->currentFB); - - if (softwareMask) - _swrast_Clear( ctx, softwareMask ); -} - - -/* Set the buffer used for drawing */ -/* XXX support for separate read/draw buffers hasn't been tested */ -/* XXX GL_NONE disables color, but fails to correctly maintain state */ -static void -fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDSetDrawBuffer(%x)\n", (int)mode); - } - - if (mode == GL_FRONT_LEFT) { - fxMesa->currentFB = GR_BUFFER_FRONTBUFFER; - grRenderBuffer(fxMesa->currentFB); - } - else if (mode == GL_BACK_LEFT) { - fxMesa->currentFB = GR_BUFFER_BACKBUFFER; - grRenderBuffer(fxMesa->currentFB); - } - else if (mode == GL_NONE) { - fxDisableColor(fxMesa); - } - else { - /* we'll need a software fallback */ - /* XXX not implemented */ - } - - /* update s/w fallback state */ - _swrast_DrawBuffer(ctx, mode); -} - - -static void -fxDDDrawBitmap2 (GLcontext *ctx, GLint px, GLint py, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GrLfbInfo_t info; - GrLfbWriteMode_t mode; - FxU16 color; - const struct gl_pixelstore_attrib *finalUnpack; - struct gl_pixelstore_attrib scissoredUnpack; - - /* check if there's any raster operations enabled which we can't handle */ - if (swrast->_RasterMask & (ALPHATEST_BIT | - /*BLEND_BIT |*/ /* blending ok, through pixpipe */ - DEPTH_BIT | /* could be done with RGB:DEPTH */ - FOG_BIT | /* could be done with RGB:DEPTH */ - LOGIC_OP_BIT | - /*CLIP_BIT |*/ /* clipping ok, below */ - STENCIL_BIT | - MASKING_BIT | - MULTI_DRAW_BIT | - OCCLUSION_BIT | /* nope! at least not yet */ - TEXTURE_BIT | - FRAGPROG_BIT)) { - _swrast_Bitmap(ctx, px, py, width, height, unpack, bitmap); - return; - } - - /* make sure the pixelpipe is configured correctly */ - fxSetupFXUnits(ctx); - - /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ - if (ctx->Scissor.Enabled) { - /* This is a bit tricky, but by carefully adjusting the px, py, - * width, height, skipPixels and skipRows values we can do - * scissoring without special code in the rendering loop. - */ - - /* we'll construct a new pixelstore struct */ - finalUnpack = &scissoredUnpack; - scissoredUnpack = *unpack; - if (scissoredUnpack.RowLength == 0) - scissoredUnpack.RowLength = width; - - /* clip left */ - if (px < ctx->Scissor.X) { - scissoredUnpack.SkipPixels += (ctx->Scissor.X - px); - width -= (ctx->Scissor.X - px); - px = ctx->Scissor.X; - } - /* clip right */ - if (px + width >= ctx->Scissor.X + ctx->Scissor.Width) { - width -= (px + width - (ctx->Scissor.X + ctx->Scissor.Width)); - } - /* clip bottom */ - if (py < ctx->Scissor.Y) { - scissoredUnpack.SkipRows += (ctx->Scissor.Y - py); - height -= (ctx->Scissor.Y - py); - py = ctx->Scissor.Y; - } - /* clip top */ - if (py + height >= ctx->Scissor.Y + ctx->Scissor.Height) { - height -= (py + height - (ctx->Scissor.Y + ctx->Scissor.Height)); - } - - if (width <= 0 || height <= 0) - return; - } - else { - finalUnpack = unpack; - } - - /* compute pixel value */ - { - GLint r = (GLint) (ctx->Current.RasterColor[RCOMP] * 255.0f); - GLint g = (GLint) (ctx->Current.RasterColor[GCOMP] * 255.0f); - GLint b = (GLint) (ctx->Current.RasterColor[BCOMP] * 255.0f); - GLint a = (GLint) (ctx->Current.RasterColor[ACOMP] * 255.0f); - if (fxMesa->colDepth == 15) { - color = TDFXPACKCOLOR1555(b, g, r, a); - mode = GR_LFBWRITEMODE_1555; - } else { - color = fxMesa->bgrOrder ? TDFXPACKCOLOR565(r, g, b) : TDFXPACKCOLOR565(b, g, r); - mode = GR_LFBWRITEMODE_565; - } - } - - info.size = sizeof(info); - if (!grLfbLock(GR_LFB_WRITE_ONLY, - fxMesa->currentFB, - mode, - GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { - _swrast_Bitmap(ctx, px, py, width, height, finalUnpack, bitmap); - return; - } - - { - const GLint winX = 0; - const GLint winY = 0; - /* The dest stride depends on the hardware and whether we're drawing - * to the front or back buffer. This compile-time test seems to do - * the job for now. - */ - const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */ - - GLint row; - /* compute dest address of bottom-left pixel in bitmap */ - GLushort *dst = (GLushort *) info.lfbPtr - + (winY + py) * dstStride + (winX + px); - - for (row = 0; row < height; row++) { - const GLubyte *src = - (const GLubyte *) _mesa_image_address2d(finalUnpack, - bitmap, width, height, - GL_COLOR_INDEX, GL_BITMAP, - row, 0); - if (finalUnpack->LsbFirst) { - /* least significan bit first */ - GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7); - GLint col; - for (col = 0; col < width; col++) { - if (*src & mask) { - dst[col] = color; - } - if (mask == 128U) { - src++; - mask = 1U; - } - else { - mask = mask << 1; - } - } - if (mask != 1) - src++; - } - else { - /* most significan bit first */ - GLubyte mask = 128U >> (finalUnpack->SkipPixels & 0x7); - GLint col; - for (col = 0; col < width; col++) { - if (*src & mask) { - dst[col] = color; - } - if (mask == 1U) { - src++; - mask = 128U; - } - else { - mask = mask >> 1; - } - } - if (mask != 128) - src++; - } - dst += dstStride; - } - } - - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); -} - -static void -fxDDDrawBitmap4 (GLcontext *ctx, GLint px, GLint py, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GrLfbInfo_t info; - FxU32 color; - const struct gl_pixelstore_attrib *finalUnpack; - struct gl_pixelstore_attrib scissoredUnpack; - - /* check if there's any raster operations enabled which we can't handle */ - if ((swrast->_RasterMask & (/*ALPHATEST_BIT |*/ - /*BLEND_BIT |*/ /* blending ok, through pixpipe */ - DEPTH_BIT | /* could be done with RGB:DEPTH */ - FOG_BIT | /* could be done with RGB:DEPTH */ - LOGIC_OP_BIT | - /*CLIP_BIT |*/ /* clipping ok, below */ - STENCIL_BIT | - /*MASKING_BIT |*/ /* masking ok, we're in 32bpp */ - MULTI_DRAW_BIT | - OCCLUSION_BIT | /* nope! at least not yet */ - TEXTURE_BIT | - FRAGPROG_BIT)) - ) { - _swrast_Bitmap(ctx, px, py, width, height, unpack, bitmap); - return; - } - - /* make sure the pixelpipe is configured correctly */ - fxSetupFXUnits(ctx); - - /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ - if (ctx->Scissor.Enabled) { - /* This is a bit tricky, but by carefully adjusting the px, py, - * width, height, skipPixels and skipRows values we can do - * scissoring without special code in the rendering loop. - */ - - /* we'll construct a new pixelstore struct */ - finalUnpack = &scissoredUnpack; - scissoredUnpack = *unpack; - if (scissoredUnpack.RowLength == 0) - scissoredUnpack.RowLength = width; - - /* clip left */ - if (px < ctx->Scissor.X) { - scissoredUnpack.SkipPixels += (ctx->Scissor.X - px); - width -= (ctx->Scissor.X - px); - px = ctx->Scissor.X; - } - /* clip right */ - if (px + width >= ctx->Scissor.X + ctx->Scissor.Width) { - width -= (px + width - (ctx->Scissor.X + ctx->Scissor.Width)); - } - /* clip bottom */ - if (py < ctx->Scissor.Y) { - scissoredUnpack.SkipRows += (ctx->Scissor.Y - py); - height -= (ctx->Scissor.Y - py); - py = ctx->Scissor.Y; - } - /* clip top */ - if (py + height >= ctx->Scissor.Y + ctx->Scissor.Height) { - height -= (py + height - (ctx->Scissor.Y + ctx->Scissor.Height)); - } - - if (width <= 0 || height <= 0) - return; - } - else { - finalUnpack = unpack; - } - - /* compute pixel value */ - { - GLint r = (GLint) (ctx->Current.RasterColor[RCOMP] * 255.0f); - GLint g = (GLint) (ctx->Current.RasterColor[GCOMP] * 255.0f); - GLint b = (GLint) (ctx->Current.RasterColor[BCOMP] * 255.0f); - GLint a = (GLint) (ctx->Current.RasterColor[ACOMP] * 255.0f); - color = TDFXPACKCOLOR8888(b, g, r, a); - } - - info.size = sizeof(info); - if (!grLfbLock(GR_LFB_WRITE_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_8888, - GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { - _swrast_Bitmap(ctx, px, py, width, height, finalUnpack, bitmap); - return; - } - - { - const GLint winX = 0; - const GLint winY = 0; - /* The dest stride depends on the hardware and whether we're drawing - * to the front or back buffer. This compile-time test seems to do - * the job for now. - */ - const GLint dstStride = info.strideInBytes / 4; /* stride in GLuints */ - - GLint row; - /* compute dest address of bottom-left pixel in bitmap */ - GLuint *dst = (GLuint *) info.lfbPtr - + (winY + py) * dstStride + (winX + px); - - for (row = 0; row < height; row++) { - const GLubyte *src = - (const GLubyte *) _mesa_image_address2d(finalUnpack, - bitmap, width, height, - GL_COLOR_INDEX, GL_BITMAP, - row, 0); - if (finalUnpack->LsbFirst) { - /* least significan bit first */ - GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7); - GLint col; - for (col = 0; col < width; col++) { - if (*src & mask) { - dst[col] = color; - } - if (mask == 128U) { - src++; - mask = 1U; - } - else { - mask = mask << 1; - } - } - if (mask != 1) - src++; - } - else { - /* most significan bit first */ - GLubyte mask = 128U >> (finalUnpack->SkipPixels & 0x7); - GLint col; - for (col = 0; col < width; col++) { - if (*src & mask) { - dst[col] = color; - } - if (mask == 1U) { - src++; - mask = 128U; - } - else { - mask = mask >> 1; - } - } - if (mask != 128) - src++; - } - dst += dstStride; - } - } - - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); -} - - -static void -fxDDReadPixels565 (GLcontext * ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *packing, - GLvoid *dstImage) -{ - if (ctx->_ImageTransferState/* & (IMAGE_SCALE_BIAS_BIT|IMAGE_MAP_COLOR_BIT)*/) { - _swrast_ReadPixels(ctx, x, y, width, height, format, type, - packing, dstImage); - return; - } - else { - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrLfbInfo_t info; - - BEGIN_BOARD_LOCK(); - info.size = sizeof(info); - if (grLfbLock(GR_LFB_READ_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_ANY, - GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { - const GLint winX = 0; - const GLint winY = fxMesa->height - 1; - const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */ - const GLushort *src = (const GLushort *) info.lfbPtr - + (winY - y) * srcStride + (winX + x); - GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage, - width, height, format, - type, 0, 0); - GLint dstStride = - _mesa_image_row_stride(packing, width, format, type); - - if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { - /* convert 5R6G5B into 8R8G8B */ - GLint row, col; - const GLint halfWidth = width >> 1; - const GLint extraPixel = (width & 1); - for (row = 0; row < height; row++) { - GLubyte *d = dst; - for (col = 0; col < halfWidth; col++) { - const GLuint pixel = ((const GLuint *) src)[col]; - *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f]; - *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 27) & 0x1f]; - *d++ = FX_rgb_scale_6[(pixel >> 21) & 0x3f]; - *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f]; - } - if (extraPixel) { - GLushort pixel = src[width - 1]; - *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f]; - *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - } - dst += dstStride; - src -= srcStride; - } - } - else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { - /* convert 5R6G5B into 8R8G8B8A */ - GLint row, col; - const GLint halfWidth = width >> 1; - const GLint extraPixel = (width & 1); - for (row = 0; row < height; row++) { - GLubyte *d = dst; - for (col = 0; col < halfWidth; col++) { - const GLuint pixel = ((const GLuint *) src)[col]; - *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f]; - *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - *d++ = 255; - *d++ = FX_rgb_scale_5[(pixel >> 27) & 0x1f]; - *d++ = FX_rgb_scale_6[(pixel >> 21) & 0x3f]; - *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f]; - *d++ = 255; - } - if (extraPixel) { - const GLushort pixel = src[width - 1]; - *d++ = FX_rgb_scale_5[(pixel >> 11) & 0x1f]; - *d++ = FX_rgb_scale_6[(pixel >> 5) & 0x3f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - *d++ = 255; - } - dst += dstStride; - src -= srcStride; - } - } - else if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { - /* directly memcpy 5R6G5B pixels into client's buffer */ - const GLint widthInBytes = width * 2; - GLint row; - for (row = 0; row < height; row++) { - memcpy(dst, src, widthInBytes); - dst += dstStride; - src -= srcStride; - } - } - else { - grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); - END_BOARD_LOCK(); - _swrast_ReadPixels(ctx, x, y, width, height, format, type, - packing, dstImage); - return; - } - - grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); - } - END_BOARD_LOCK(); - } -} - -static void -fxDDReadPixels555 (GLcontext * ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *packing, - GLvoid *dstImage) -{ - if (ctx->_ImageTransferState/* & (IMAGE_SCALE_BIAS_BIT|IMAGE_MAP_COLOR_BIT)*/) { - _swrast_ReadPixels(ctx, x, y, width, height, format, type, - packing, dstImage); - return; - } - else { - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrLfbInfo_t info; - - BEGIN_BOARD_LOCK(); - info.size = sizeof(info); - if (grLfbLock(GR_LFB_READ_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_ANY, - GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { - const GLint winX = 0; - const GLint winY = fxMesa->height - 1; - const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */ - const GLushort *src = (const GLushort *) info.lfbPtr - + (winY - y) * srcStride + (winX + x); - GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage, - width, height, format, - type, 0, 0); - GLint dstStride = - _mesa_image_row_stride(packing, width, format, type); - - if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { - /* convert 5R5G5B into 8R8G8B */ - GLint row, col; - const GLint halfWidth = width >> 1; - const GLint extraPixel = (width & 1); - for (row = 0; row < height; row++) { - GLubyte *d = dst; - for (col = 0; col < halfWidth; col++) { - const GLuint pixel = ((const GLuint *) src)[col]; - *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 26) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 21) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f]; - } - if (extraPixel) { - GLushort pixel = src[width - 1]; - *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - } - dst += dstStride; - src -= srcStride; - } - } - else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { - /* convert 5R6G5B into 8R8G8B8A */ - GLint row, col; - const GLint halfWidth = width >> 1; - const GLint extraPixel = (width & 1); - for (row = 0; row < height; row++) { - GLubyte *d = dst; - for (col = 0; col < halfWidth; col++) { - const GLuint pixel = ((const GLuint *) src)[col]; - *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - *d++ = (pixel & 0x8000) ? 255 : 0; - *d++ = FX_rgb_scale_5[(pixel >> 26) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 21) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 16) & 0x1f]; - *d++ = (pixel & 0x80000000) ? 255 : 0; - } - if (extraPixel) { - const GLushort pixel = src[width - 1]; - *d++ = FX_rgb_scale_5[(pixel >> 10) & 0x1f]; - *d++ = FX_rgb_scale_5[(pixel >> 5) & 0x1f]; - *d++ = FX_rgb_scale_5[ pixel & 0x1f]; - *d++ = (pixel & 0x8000) ? 255 : 0; - } - dst += dstStride; - src -= srcStride; - } - } - else if (format == GL_BGRA && type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { - /* directly memcpy 5R5G5B pixels into client's buffer */ - const GLint widthInBytes = width * 2; - GLint row; - for (row = 0; row < height; row++) { - memcpy(dst, src, widthInBytes); - dst += dstStride; - src -= srcStride; - } - } - else { - grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); - END_BOARD_LOCK(); - _swrast_ReadPixels(ctx, x, y, width, height, format, type, - packing, dstImage); - return; - } - - grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); - } - END_BOARD_LOCK(); - } -} - -static void -fxDDReadPixels8888 (GLcontext * ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *packing, - GLvoid *dstImage) -{ - if (ctx->_ImageTransferState/* & (IMAGE_SCALE_BIAS_BIT|IMAGE_MAP_COLOR_BIT)*/) { - _swrast_ReadPixels(ctx, x, y, width, height, format, type, - packing, dstImage); - return; - } - else { - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrLfbInfo_t info; - - BEGIN_BOARD_LOCK(); - info.size = sizeof(info); - if (grLfbLock(GR_LFB_READ_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_ANY, - GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { - const GLint winX = 0; - const GLint winY = fxMesa->height - 1; - const GLint srcStride = info.strideInBytes / 4; /* stride in GLuints */ - const GLuint *src = (const GLuint *) info.lfbPtr - + (winY - y) * srcStride + (winX + x); - GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage, - width, height, format, - type, 0, 0); - GLint dstStride = - _mesa_image_row_stride(packing, width, format, type); - - if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { - /* convert 8A8R8G8B into 8R8G8B */ - GLint row, col; - for (row = 0; row < height; row++) { - GLubyte *d = dst; - for (col = 0; col < width; col++) { - const GLuint pixel = ((const GLuint *) src)[col]; - *d++ = pixel >> 16; - *d++ = pixel >> 8; - *d++ = pixel; - } - dst += dstStride; - src -= srcStride; - } - } - else if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { - /* 8A8R8G8B pixels into client's buffer */ - GLint row, col; - for (row = 0; row < height; row++) { - GLubyte *d = dst; - for (col = 0; col < width; col++) { - const GLuint pixel = ((const GLuint *) src)[col]; - *d++ = pixel >> 16; - *d++ = pixel >> 8; - *d++ = pixel; - *d++ = pixel >> 24; - } - dst += dstStride; - src -= srcStride; - } - } - else if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { - /* convert 8A8R8G8B into 5R6G5B */ - GLint row, col; - for (row = 0; row < height; row++) { - GLushort *d = (GLushort *)dst; - for (col = 0; col < width; col++) { - const GLuint pixel = ((const GLuint *) src)[col]; - *d++ = (((pixel >> 16) & 0xf8) << 8) | - (((pixel >> 8) & 0xfc) << 3) | - ((pixel & 0xf8) >> 3); - } - dst += dstStride; - src -= srcStride; - } - } - else { - grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); - END_BOARD_LOCK(); - _swrast_ReadPixels(ctx, x, y, width, height, format, type, - packing, dstImage); - return; - } - - grLfbUnlock(GR_LFB_READ_ONLY, fxMesa->currentFB); - } - END_BOARD_LOCK(); - } -} - - -static void -fxDDDrawPixels555 (GLcontext * ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid * pixels) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GrLfbInfo_t info; - const struct gl_pixelstore_attrib *finalUnpack; - struct gl_pixelstore_attrib scissoredUnpack; - - if (ctx->Pixel.ZoomX != 1.0F || - ctx->Pixel.ZoomY != 1.0F || - (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| - IMAGE_MAP_COLOR_BIT)) || - (swrast->_RasterMask & (ALPHATEST_BIT | - /*BLEND_BIT |*/ /* blending ok, through pixpipe */ - DEPTH_BIT | /* could be done with RGB:DEPTH */ - FOG_BIT | /* could be done with RGB:DEPTH */ - LOGIC_OP_BIT | - /*CLIP_BIT |*/ /* clipping ok, below */ - STENCIL_BIT | - MASKING_BIT | - MULTI_DRAW_BIT | - OCCLUSION_BIT | /* nope! at least not yet */ - TEXTURE_BIT | - FRAGPROG_BIT)) || - fxMesa->fallback) - { - _swrast_DrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels ); - return; - } - - /* make sure the pixelpipe is configured correctly */ - fxSetupFXUnits(ctx); - - /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ - if (ctx->Scissor.Enabled) { - /* This is a bit tricky, but by carefully adjusting the px, py, - * width, height, skipPixels and skipRows values we can do - * scissoring without special code in the rendering loop. - */ - - /* we'll construct a new pixelstore struct */ - finalUnpack = &scissoredUnpack; - scissoredUnpack = *unpack; - if (scissoredUnpack.RowLength == 0) - scissoredUnpack.RowLength = width; - - /* clip left */ - if (x < ctx->Scissor.X) { - scissoredUnpack.SkipPixels += (ctx->Scissor.X - x); - width -= (ctx->Scissor.X - x); - x = ctx->Scissor.X; - } - /* clip right */ - if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) { - width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width)); - } - /* clip bottom */ - if (y < ctx->Scissor.Y) { - scissoredUnpack.SkipRows += (ctx->Scissor.Y - y); - height -= (ctx->Scissor.Y - y); - y = ctx->Scissor.Y; - } - /* clip top */ - if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) { - height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height)); - } - - if (width <= 0 || height <= 0) - return; - } - else { - finalUnpack = unpack; - } - - info.size = sizeof(info); - if (!grLfbLock(GR_LFB_WRITE_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_1555, - GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - { - const GLint winX = 0; - const GLint winY = 0; - - const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */ - GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x); - - if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - GLint col; - for (col = 0; col < width; col++) { - dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], src[3]); - src += 4; - } - dst += dstStride; - } - } - else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - GLint col; - for (col = 0; col < width; col++) { - dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], 255); - src += 3; - } - dst += dstStride; - } - } - else { - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - } - - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); -} - - -static void -fxDDDrawPixels565 (GLcontext * ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid * pixels) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GrLfbInfo_t info; - const struct gl_pixelstore_attrib *finalUnpack; - struct gl_pixelstore_attrib scissoredUnpack; - - if (ctx->Pixel.ZoomX != 1.0F || - ctx->Pixel.ZoomY != 1.0F || - (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| - IMAGE_MAP_COLOR_BIT)) || - (swrast->_RasterMask & (ALPHATEST_BIT | - /*BLEND_BIT |*/ /* blending ok, through pixpipe */ - DEPTH_BIT | /* could be done with RGB:DEPTH */ - FOG_BIT | /* could be done with RGB:DEPTH */ - LOGIC_OP_BIT | - /*CLIP_BIT |*/ /* clipping ok, below */ - STENCIL_BIT | - MASKING_BIT | - MULTI_DRAW_BIT | - OCCLUSION_BIT | /* nope! at least not yet */ - TEXTURE_BIT | - FRAGPROG_BIT)) || - fxMesa->fallback) - { - _swrast_DrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels ); - return; - } - - /* make sure the pixelpipe is configured correctly */ - fxSetupFXUnits(ctx); - - /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ - if (ctx->Scissor.Enabled) { - /* This is a bit tricky, but by carefully adjusting the px, py, - * width, height, skipPixels and skipRows values we can do - * scissoring without special code in the rendering loop. - */ - - /* we'll construct a new pixelstore struct */ - finalUnpack = &scissoredUnpack; - scissoredUnpack = *unpack; - if (scissoredUnpack.RowLength == 0) - scissoredUnpack.RowLength = width; - - /* clip left */ - if (x < ctx->Scissor.X) { - scissoredUnpack.SkipPixels += (ctx->Scissor.X - x); - width -= (ctx->Scissor.X - x); - x = ctx->Scissor.X; - } - /* clip right */ - if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) { - width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width)); - } - /* clip bottom */ - if (y < ctx->Scissor.Y) { - scissoredUnpack.SkipRows += (ctx->Scissor.Y - y); - height -= (ctx->Scissor.Y - y); - y = ctx->Scissor.Y; - } - /* clip top */ - if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) { - height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height)); - } - - if (width <= 0 || height <= 0) - return; - } - else { - finalUnpack = unpack; - } - - info.size = sizeof(info); - if (!grLfbLock(GR_LFB_WRITE_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_565, - GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - { - const GLint winX = 0; - const GLint winY = 0; - - const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */ - GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x); - - if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - GLint col; - for (col = 0; col < width; col++) { - dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]); - src += 4; - } - dst += dstStride; - } - } - else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - GLint col; - for (col = 0; col < width; col++) { - dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]); - src += 3; - } - dst += dstStride; - } - } - else { - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - } - - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); -} - - -static void -fxDDDrawPixels565_rev (GLcontext * ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid * pixels) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GrLfbInfo_t info; - const struct gl_pixelstore_attrib *finalUnpack; - struct gl_pixelstore_attrib scissoredUnpack; - - if (ctx->Pixel.ZoomX != 1.0F || - ctx->Pixel.ZoomY != 1.0F || - (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| - IMAGE_MAP_COLOR_BIT)) || - (swrast->_RasterMask & (ALPHATEST_BIT | - /*BLEND_BIT |*/ /* blending ok, through pixpipe */ - DEPTH_BIT | /* could be done with RGB:DEPTH */ - FOG_BIT | /* could be done with RGB:DEPTH */ - LOGIC_OP_BIT | - /*CLIP_BIT |*/ /* clipping ok, below */ - STENCIL_BIT | - MASKING_BIT | - MULTI_DRAW_BIT | - OCCLUSION_BIT | /* nope! at least not yet */ - TEXTURE_BIT | - FRAGPROG_BIT)) || - fxMesa->fallback) - { - _swrast_DrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels ); - return; - } - - /* make sure the pixelpipe is configured correctly */ - fxSetupFXUnits(ctx); - - /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ - if (ctx->Scissor.Enabled) { - /* This is a bit tricky, but by carefully adjusting the px, py, - * width, height, skipPixels and skipRows values we can do - * scissoring without special code in the rendering loop. - */ - - /* we'll construct a new pixelstore struct */ - finalUnpack = &scissoredUnpack; - scissoredUnpack = *unpack; - if (scissoredUnpack.RowLength == 0) - scissoredUnpack.RowLength = width; - - /* clip left */ - if (x < ctx->Scissor.X) { - scissoredUnpack.SkipPixels += (ctx->Scissor.X - x); - width -= (ctx->Scissor.X - x); - x = ctx->Scissor.X; - } - /* clip right */ - if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) { - width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width)); - } - /* clip bottom */ - if (y < ctx->Scissor.Y) { - scissoredUnpack.SkipRows += (ctx->Scissor.Y - y); - height -= (ctx->Scissor.Y - y); - y = ctx->Scissor.Y; - } - /* clip top */ - if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) { - height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height)); - } - - if (width <= 0 || height <= 0) - return; - } - else { - finalUnpack = unpack; - } - - info.size = sizeof(info); - if (!grLfbLock(GR_LFB_WRITE_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_565, - GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - { - const GLint winX = 0; - const GLint winY = 0; - - const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */ - GLushort *dst = (GLushort *) info.lfbPtr + (winY + y) * dstStride + (winX + x); - - if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - GLint col; - for (col = 0; col < width; col++) { - dst[col] = TDFXPACKCOLOR565(src[0], src[1], src[2]); - src += 4; - } - dst += dstStride; - } - } - else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - GLint col; - for (col = 0; col < width; col++) { - dst[col] = TDFXPACKCOLOR565(src[0], src[1], src[2]); - src += 3; - } - dst += dstStride; - } - } - else { - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - } - - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); -} - - -static void -fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid * pixels) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT(ctx); - GrLfbInfo_t info; - const struct gl_pixelstore_attrib *finalUnpack; - struct gl_pixelstore_attrib scissoredUnpack; - - if (ctx->Pixel.ZoomX != 1.0F || - ctx->Pixel.ZoomY != 1.0F || - (ctx->_ImageTransferState & (IMAGE_SCALE_BIAS_BIT| - IMAGE_MAP_COLOR_BIT)) || - (swrast->_RasterMask & (/*ALPHATEST_BIT |*/ - /*BLEND_BIT |*/ /* blending ok, through pixpipe */ - DEPTH_BIT | /* could be done with RGB:DEPTH */ - FOG_BIT | /* could be done with RGB:DEPTH */ - LOGIC_OP_BIT | - /*CLIP_BIT |*/ /* clipping ok, below */ - STENCIL_BIT | - /*MASKING_BIT |*/ /* masking ok, we're in 32bpp */ - MULTI_DRAW_BIT | - OCCLUSION_BIT | /* nope! at least not yet */ - TEXTURE_BIT | - FRAGPROG_BIT)) || - fxMesa->fallback) - { - _swrast_DrawPixels( ctx, x, y, width, height, format, type, - unpack, pixels ); - return; - } - - /* make sure the pixelpipe is configured correctly */ - fxSetupFXUnits(ctx); - - /* FIXME! _RasterMask & CLIP_BIT gets set if we're out of Viewport, also! */ - if (ctx->Scissor.Enabled) { - /* This is a bit tricky, but by carefully adjusting the px, py, - * width, height, skipPixels and skipRows values we can do - * scissoring without special code in the rendering loop. - */ - - /* we'll construct a new pixelstore struct */ - finalUnpack = &scissoredUnpack; - scissoredUnpack = *unpack; - if (scissoredUnpack.RowLength == 0) - scissoredUnpack.RowLength = width; - - /* clip left */ - if (x < ctx->Scissor.X) { - scissoredUnpack.SkipPixels += (ctx->Scissor.X - x); - width -= (ctx->Scissor.X - x); - x = ctx->Scissor.X; - } - /* clip right */ - if (x + width >= ctx->Scissor.X + ctx->Scissor.Width) { - width -= (x + width - (ctx->Scissor.X + ctx->Scissor.Width)); - } - /* clip bottom */ - if (y < ctx->Scissor.Y) { - scissoredUnpack.SkipRows += (ctx->Scissor.Y - y); - height -= (ctx->Scissor.Y - y); - y = ctx->Scissor.Y; - } - /* clip top */ - if (y + height >= ctx->Scissor.Y + ctx->Scissor.Height) { - height -= (y + height - (ctx->Scissor.Y + ctx->Scissor.Height)); - } - - if (width <= 0 || height <= 0) - return; - } - else { - finalUnpack = unpack; - } - - info.size = sizeof(info); - if (!grLfbLock(GR_LFB_WRITE_ONLY, - fxMesa->currentFB, - GR_LFBWRITEMODE_8888, - GR_ORIGIN_LOWER_LEFT, FXTRUE, &info)) { - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - { - const GLint winX = 0; - const GLint winY = 0; - - const GLint dstStride = info.strideInBytes / 4; /* stride in GLuints */ - GLuint *dst = (GLuint *) info.lfbPtr + (winY + y) * dstStride + (winX + x); - - if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) { - /* directly memcpy 8A8R8G8B pixels to screen */ - const GLint widthInBytes = width * 4; - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - memcpy(dst, src, widthInBytes); - dst += dstStride; - } - } - else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) { - GLint row; - for (row = 0; row < height; row++) { - GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack, - pixels, width, height, format, type, row, 0); - GLint col; - for (col = 0; col < width; col++) { - dst[col] = TDFXPACKCOLOR8888(src[2], src[1], src[0], 255); - src += 3; - } - dst += dstStride; - } - } - else { - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); - _swrast_DrawPixels(ctx, x, y, width, height, format, type, finalUnpack, pixels); - return; - } - - } - - grLfbUnlock(GR_LFB_WRITE_ONLY, fxMesa->currentFB); -} - - -static void -fxDDFinish(GLcontext * ctx) -{ - grFlush(); -} - - - - - -/* KW: Put the word Mesa in the render string because quakeworld - * checks for this rather than doing a glGet(GL_MAX_TEXTURE_SIZE). - * Why? - */ -static const GLubyte * -fxDDGetString(GLcontext * ctx, GLenum name) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - switch (name) { - case GL_RENDERER: - return (GLubyte *)fxMesa->rendererString; -#if __WIN32__ /* hack to advertise vanilla extension names */ - case GL_EXTENSIONS: - if (ctx->Extensions.String == NULL) { - GLubyte *ext = _mesa_make_extension_string(ctx); - if (ext != NULL) { - ctx->Extensions.String = malloc(strlen((char *)ext) + 256); - if (ctx->Extensions.String != NULL) { - strcpy((char *)ctx->Extensions.String, (char *)ext); - /* put any additional extension names here */ -#if 0 - strcat((char *)ctx->Extensions.String, " 3DFX_set_global_palette"); -#endif -#if __WIN32__ - strcat((char *)ctx->Extensions.String, " WGL_3DFX_gamma_control"); - strcat((char *)ctx->Extensions.String, " WGL_EXT_swap_control"); - strcat((char *)ctx->Extensions.String, " WGL_EXT_extensions_string WGL_ARB_extensions_string"); -#endif - /* put any additional extension names here */ - free(ext); - } else { - ctx->Extensions.String = ext; - } - } - } - return ctx->Extensions.String; -#endif - default: - return NULL; - } -} - -static const struct tnl_pipeline_stage *fx_pipeline[] = { - &_tnl_vertex_transform_stage, /* XXX todo - Add the fastpath here */ - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_point_attenuation_stage, -#if defined(FEATURE_NV_vertex_program) || defined(FEATURE_ARB_vertex_program) - &_tnl_vertex_program_stage, -#endif - &_tnl_render_stage, - 0, -}; - - - - -int -fxDDInitFxMesaContext(fxMesaContext fxMesa) -{ - GLcontext *ctx = fxMesa->glCtx; - - FX_setupGrVertexLayout(); - - fxMesa->color = 0xffffffff; - fxMesa->clearC = 0; - fxMesa->clearA = 0; - - fxMesa->stats.swapBuffer = 0; - fxMesa->stats.reqTexUpload = 0; - fxMesa->stats.texUpload = 0; - fxMesa->stats.memTexUpload = 0; - - fxMesa->tmuSrc = FX_TMU_NONE; - fxMesa->lastUnitsMode = FX_UM_NONE; - fxTMInit(fxMesa); - - /* FX units setup */ - - fxMesa->unitsState.alphaTestEnabled = GL_FALSE; - fxMesa->unitsState.alphaTestFunc = GL_ALWAYS; - fxMesa->unitsState.alphaTestRefValue = 0.0; - - fxMesa->unitsState.blendEnabled = GL_FALSE; - fxMesa->unitsState.blendSrcFuncRGB = GR_BLEND_ONE; - fxMesa->unitsState.blendDstFuncRGB = GR_BLEND_ZERO; - fxMesa->unitsState.blendSrcFuncAlpha = GR_BLEND_ONE; - fxMesa->unitsState.blendDstFuncAlpha = GR_BLEND_ZERO; - fxMesa->unitsState.blendEqRGB = GR_BLEND_OP_ADD; - fxMesa->unitsState.blendEqAlpha = GR_BLEND_OP_ADD; - - fxMesa->unitsState.depthTestEnabled = GL_FALSE; - fxMesa->unitsState.depthMask = GL_TRUE; - fxMesa->unitsState.depthTestFunc = GL_LESS; - fxMesa->unitsState.depthBias = 0; - - fxMesa->unitsState.stencilWriteMask = 0xff; - - if (fxMesa->colDepth == 32) { - /* 32bpp */ - fxMesa->Glide.grColorMaskExt(FXTRUE, FXTRUE, FXTRUE, fxMesa->haveHwAlpha); - } else { - /* 15/16 bpp mode */ - grColorMask(FXTRUE, fxMesa->haveHwAlpha); - } - - fxMesa->currentFB = fxMesa->haveDoubleBuffer ? GR_BUFFER_BACKBUFFER : GR_BUFFER_FRONTBUFFER; - grRenderBuffer(fxMesa->currentFB); - - fxMesa->state = MALLOC(FX_grGetInteger(GR_GLIDE_STATE_SIZE)); - fxMesa->fogTable = (GrFog_t *) MALLOC(FX_grGetInteger(GR_FOG_TABLE_ENTRIES) * - sizeof(GrFog_t)); - - if (!fxMesa->state || !fxMesa->fogTable) { - if (fxMesa->state) - FREE(fxMesa->state); - if (fxMesa->fogTable) - FREE(fxMesa->fogTable); - return 0; - } - - if (fxMesa->haveZBuffer) { - grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER); - } - - if (!fxMesa->bgrOrder) { - grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); - } - - if (fxMesa->Glide.grSetNumPendingBuffers != NULL) { - fxMesa->Glide.grSetNumPendingBuffers(fxMesa->maxPendingSwapBuffers); - } - - fxMesa->textureAlign = FX_grGetInteger(GR_TEXTURE_ALIGN); - /* [koolsmoky] */ - { - char *env; - int textureLevels = 0; - int textureSize = FX_grGetInteger(GR_MAX_TEXTURE_SIZE); - do { - textureLevels++; - } while ((textureSize >>= 0x1) & 0x7ff); - ctx->Const.MaxTextureLevels = textureLevels; - ctx->Const.MaxTextureLodBias = /*textureLevels - 1*/8; /* Glide bug */ -#if FX_RESCALE_BIG_TEXURES_HACK - fxMesa->textureMaxLod = textureLevels - 1; - if ((env = getenv("MESA_FX_MAXLOD")) != NULL) { - int maxLevels = atoi(env) + 1; - if ((maxLevels <= MAX_TEXTURE_LEVELS) && (maxLevels > textureLevels)) { - ctx->Const.MaxTextureLevels = maxLevels; - } - } -#endif - } - ctx->Const.MaxTextureCoordUnits = - ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1; - ctx->Const.MaxTextureUnits = MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits); - - ctx->Const.MaxDrawBuffers = 1; - - fxMesa->new_state = _NEW_ALL; - if (!fxMesa->haveHwStencil) { - /* don't touch stencil if there is none */ - fxMesa->new_state &= ~FX_NEW_STENCIL; - } - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext(ctx); - _vbo_CreateContext(ctx); - _tnl_CreateContext(ctx); - _swsetup_CreateContext(ctx); - - /* Install customized pipeline */ - _tnl_destroy_pipeline(ctx); - _tnl_install_pipeline(ctx, fx_pipeline); - - fxAllocVB(ctx); - - fxSetupDDPointers(ctx); - fxDDInitTriFuncs(ctx); - - /* Tell the software rasterizer to use pixel fog always. - */ - _swrast_allow_vertex_fog(ctx, GL_FALSE); - _swrast_allow_pixel_fog(ctx, GL_TRUE); - _tnl_allow_vertex_fog( ctx, GL_FALSE ); - _tnl_allow_pixel_fog( ctx, GL_TRUE ); - - /* Tell tnl not to calculate or use vertex fog factors. (Needed to - * tell render stage not to clip fog coords). - */ -/* _tnl_calculate_vertex_fog( ctx, GL_FALSE ); */ - - fxDDInitExtensions(ctx); - -#if 0 - /* do we want dither? It just looks bad... */ - grEnable(GR_ALLOW_MIPMAP_DITHER); -#endif - grGlideGetState((GrState *) fxMesa->state); - - return 1; -} - -/* Undo the above. - */ -void -fxDDDestroyFxMesaContext(fxMesaContext fxMesa) -{ - _swsetup_DestroyContext(fxMesa->glCtx); - _tnl_DestroyContext(fxMesa->glCtx); - _vbo_DestroyContext(fxMesa->glCtx); - _swrast_DestroyContext(fxMesa->glCtx); - - if (fxMesa->state) - FREE(fxMesa->state); - if (fxMesa->fogTable) - FREE(fxMesa->fogTable); - fxFreeVB(fxMesa->glCtx); -} - - - - -void -fxDDInitExtensions(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - -#if 1 /* multipass ColorSum stage */ - _mesa_enable_extension(ctx, "GL_EXT_secondary_color"); -#endif - - _mesa_enable_extension(ctx, "GL_ARB_point_sprite"); - _mesa_enable_extension(ctx, "GL_EXT_point_parameters"); - _mesa_enable_extension(ctx, "GL_EXT_paletted_texture"); - _mesa_enable_extension(ctx, "GL_EXT_texture_lod_bias"); - _mesa_enable_extension(ctx, "GL_EXT_shared_texture_palette"); - _mesa_enable_extension(ctx, "GL_EXT_blend_func_separate"); - _mesa_enable_extension(ctx, "GL_EXT_texture_env_add"); - _mesa_enable_extension(ctx, "GL_EXT_stencil_wrap"); - _mesa_enable_extension(ctx, "GL_EXT_stencil_two_side"); - - if (fxMesa->haveTwoTMUs) { - _mesa_enable_extension(ctx, "GL_ARB_multitexture"); - } - - if (fxMesa->type >= GR_SSTTYPE_Voodoo4) { - _mesa_enable_extension(ctx, "GL_3DFX_texture_compression_FXT1"); - _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); - _mesa_enable_extension(ctx, "GL_S3_s3tc"); - _mesa_enable_extension(ctx, "GL_NV_blend_square"); - } else { - /* [dBorca] - * We should enable generic texture compression functions, - * but some poorly written apps automatically assume S3TC. - * Binding NCC to GL_COMPRESSED_RGB[A] is an unnecessary hassle, - * since it's slow and ugly (better with palette textures, then). - * Moreover, NCC is not an OpenGL standard, so we can't use - * precompressed textures. Last, but not least, NCC runs amok - * when multitexturing on a Voodoo3 and up (see POINTCAST vs UMA). - * Note: this is also a problem with palette textures, but - * faking multitex by multipass is evil... - * Implementing NCC requires three stages: - * fxDDChooseTextureFormat: - * bind GL_COMPRESSED_RGB[A] to _mesa_texformat_argb8888, - * so we can quantize properly, at a later time - * fxDDTexImage: - * if GL_COMPRESSED_RGB - * use _mesa_texformat_l8 to get 1bpt and set GR_TEXFMT_YIQ_422 - * if GL_COMPRESSED_RGBA - * use _mesa_texformat_al88 to get 2bpt and set GR_TEXFMT_AYIQ_8422 - * txMipQuantize(...); - * if (level == 0) { - * txPalToNcc((GuNccTable *)(&(ti->palette)), pxMip.pal); - * } - * fxSetupSingleTMU_NoLock/fxSetupDoubleTMU_NoLock: - * grTexDownloadTable(GR_TEXTABLE_NCC0, &(ti->palette)); - */ - _mesa_enable_extension(ctx, "GL_SGIS_generate_mipmap"); - } - - if (fxMesa->HaveCmbExt) { - _mesa_enable_extension(ctx, "GL_ARB_texture_env_combine"); - _mesa_enable_extension(ctx, "GL_EXT_texture_env_combine"); - } - - if (fxMesa->HavePixExt) { - _mesa_enable_extension(ctx, "GL_EXT_blend_subtract"); - _mesa_enable_extension(ctx, "GL_EXT_blend_equation_separate"); - } - - if (fxMesa->HaveMirExt) { - _mesa_enable_extension(ctx, "GL_ARB_texture_mirrored_repeat"); - } - - if (fxMesa->type >= GR_SSTTYPE_Voodoo2) { - _mesa_enable_extension(ctx, "GL_EXT_fog_coord"); - } - - /* core-level extensions */ - /* dangerous */ - if (getenv("MESA_FX_ALLOW_VP")) { - _mesa_enable_extension(ctx, "GL_ARB_vertex_program"); - _mesa_enable_extension(ctx, "GL_NV_vertex_program"); - _mesa_enable_extension(ctx, "GL_NV_vertex_program1_1"); - } -#if 0 - /* this requires _tnl_vertex_cull_stage in the pipeline */ - _mesa_enable_extension(ctx, "EXT_cull_vertex"); -#endif -} - - -/************************************************************************/ -/************************************************************************/ -/************************************************************************/ - -/* Check if the hardware supports the current context - * - * Performs similar work to fxDDChooseRenderState() - should be merged. - */ -GLuint -fx_check_IsInHardware(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (ctx->RenderMode != GL_RENDER) { - return FX_FALLBACK_RENDER_MODE; - } - - if (ctx->Stencil._Enabled && !fxMesa->haveHwStencil) { - return FX_FALLBACK_STENCIL; - } - - if ((ctx->DrawBuffer->_ColorDrawBufferIndexes[0] != BUFFER_BIT_FRONT_LEFT) && - (ctx->DrawBuffer->_ColorDrawBufferIndexes[0] != BUFFER_BIT_BACK_LEFT)) { - return FX_FALLBACK_DRAW_BUFFER; - } - - if (ctx->Color.BlendEnabled) { - if (ctx->Color.BlendEquationRGB != GL_FUNC_ADD) { - if (!fxMesa->HavePixExt || - ((ctx->Color.BlendEquationRGB != GL_FUNC_SUBTRACT) && - (ctx->Color.BlendEquationRGB != GL_FUNC_REVERSE_SUBTRACT))) { - return FX_FALLBACK_BLEND; - } - } - - if (ctx->Color.BlendEquationA != GL_FUNC_ADD) { - if (!fxMesa->HavePixExt || - ((ctx->Color.BlendEquationA != GL_FUNC_SUBTRACT) && - (ctx->Color.BlendEquationA != GL_FUNC_REVERSE_SUBTRACT))) { - return FX_FALLBACK_BLEND; - } - } - -#if 0 - /* [dBorca] - * We fail the spec here, unless certain blending modes: - * RGB: (GL_ONE + GL_*) or (GL_ZERO + GL_*) or ... - */ - if (NEED_SECONDARY_COLOR(ctx)) { - if ((ctx->Color.BlendEquationRGB != GL_FUNC_ADD) && - (ctx->Color.BlendSrcRGB != GL_ONE)) { - /* Can't use multipass to blend ColorSum stage */ - return FX_FALLBACK_SPECULAR; - } - } -#endif - } - - /* [dBorca] - * We could avoid this for certain `sfactor/dfactor' - * I do not think that is even worthwhile to check - * because if someone is using blending they use more - * interesting settings and also it would add more - * state tracking to a lot of the code. - */ - if (ctx->Color.ColorLogicOpEnabled && (ctx->Color.LogicOp != GL_COPY)) { - return FX_FALLBACK_LOGICOP; - } - - if ((fxMesa->colDepth != 32) && - ((ctx->Color.ColorMask[RCOMP] != ctx->Color.ColorMask[GCOMP]) || - (ctx->Color.ColorMask[GCOMP] != ctx->Color.ColorMask[BCOMP]))) { - return FX_FALLBACK_COLORMASK; - } - - /* Unsupported texture/multitexture cases */ - - /* we can only do 1D/2D textures */ - if (ctx->Texture.Unit[0]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT)) - return FX_FALLBACK_TEXTURE_MAP; - - if (fxMesa->haveTwoTMUs) { - if (ctx->Texture.Unit[1]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT)) - return FX_FALLBACK_TEXTURE_MAP; - - if (ctx->Texture.Unit[0]._ReallyEnabled) { - if (fxMesa->type < GR_SSTTYPE_Voodoo2) - if (ctx->Texture.Unit[0].EnvMode == GL_BLEND && - (ctx->Texture.Unit[1]._ReallyEnabled || - ctx->Texture.Unit[0].EnvColor[0] != 0 || - ctx->Texture.Unit[0].EnvColor[1] != 0 || - ctx->Texture.Unit[0].EnvColor[2] != 0 || - ctx->Texture.Unit[0].EnvColor[3] != 1)) { - return FX_FALLBACK_TEXTURE_ENV; - } - if (ctx->Texture.Unit[0]._Current->Image[0][0]->Border > 0) - return FX_FALLBACK_TEXTURE_BORDER; - } - - if (ctx->Texture.Unit[1]._ReallyEnabled) { - if (fxMesa->type < GR_SSTTYPE_Voodoo2) - if (ctx->Texture.Unit[1].EnvMode == GL_BLEND) - return FX_FALLBACK_TEXTURE_ENV; - if (ctx->Texture.Unit[1]._Current->Image[0][0]->Border > 0) - return FX_FALLBACK_TEXTURE_BORDER; - } - - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fx_check_IsInHardware: envmode is %s/%s\n", - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode), - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode)); - - /* KW: This was wrong (I think) and I changed it... which doesn't mean - * it is now correct... - * BP: The old condition just seemed to test if both texture units - * were enabled. That's easy! - */ - if (ctx->Texture._EnabledUnits == 0x3) { -#if 0 - /* Can't use multipass to blend a multitextured triangle - fall - * back to software. - */ - if (!fxMesa->haveTwoTMUs && ctx->Color.BlendEnabled) { - return FX_FALLBACK_TEXTURE_MULTI; - } -#endif - - if (!fxMesa->HaveCmbExt && - (ctx->Texture.Unit[0].EnvMode != ctx->Texture.Unit[1].EnvMode) && - (ctx->Texture.Unit[0].EnvMode != GL_MODULATE) && - (ctx->Texture.Unit[0].EnvMode != GL_REPLACE)) { /* q2, seems ok... */ - if (TDFX_DEBUG & VERBOSE_DRIVER) - fprintf(stderr, "fx_check_IsInHardware: unsupported multitex env mode\n"); - return FX_FALLBACK_TEXTURE_MULTI; - } - } - } - else { - /* we have just one texture unit */ - if (ctx->Texture._EnabledUnits > 0x1) { - return FX_FALLBACK_TEXTURE_MULTI; - } - - if (fxMesa->type < GR_SSTTYPE_Voodoo2) - if (ctx->Texture.Unit[0]._ReallyEnabled && - (ctx->Texture.Unit[0].EnvMode == GL_BLEND)) { - return FX_FALLBACK_TEXTURE_ENV; - } - } - - return 0; -} - - - -static void -fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state) -{ - /* TNLcontext *tnl = TNL_CONTEXT(ctx); */ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDUpdateDDPointers(%08x)\n", new_state); - } - - _swrast_InvalidateState(ctx, new_state); - _vbo_InvalidateState(ctx, new_state); - _tnl_InvalidateState(ctx, new_state); - _swsetup_InvalidateState(ctx, new_state); - - fxMesa->new_gl_state |= new_state; -} - - - - -void -fxSetupDDPointers(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - /* TNLcontext *tnl = TNL_CONTEXT(ctx); */ - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupDDPointers()\n"); - } - - ctx->Driver.UpdateState = fxDDUpdateDDPointers; - ctx->Driver.GetString = fxDDGetString; - ctx->Driver.ClearIndex = NULL; - ctx->Driver.ClearColor = fxDDClearColor; - ctx->Driver.Clear = fxDDClear; - ctx->Driver.DrawBuffer = fxDDSetDrawBuffer; - ctx->Driver.GetBufferSize = fxDDGetBufferSize; - ctx->Driver.Viewport = fxDDViewport; - switch (fxMesa->colDepth) { - case 15: - ctx->Driver.DrawPixels = fxDDDrawPixels555; - ctx->Driver.ReadPixels = fxDDReadPixels555; - ctx->Driver.Bitmap = fxDDDrawBitmap2; - break; - case 16: - ctx->Driver.DrawPixels = !fxMesa->bgrOrder ? fxDDDrawPixels565 : fxDDDrawPixels565_rev; - ctx->Driver.ReadPixels = fxDDReadPixels565; - ctx->Driver.Bitmap = fxDDDrawBitmap2; - break; - case 32: - ctx->Driver.DrawPixels = fxDDDrawPixels8888; - ctx->Driver.ReadPixels = fxDDReadPixels8888; - ctx->Driver.Bitmap = fxDDDrawBitmap4; - break; - } - ctx->Driver.Finish = fxDDFinish; - ctx->Driver.Flush = NULL; - ctx->Driver.ChooseTextureFormat = fxDDChooseTextureFormat; - ctx->Driver.TexImage1D = fxDDTexImage1D; - ctx->Driver.TexImage2D = fxDDTexImage2D; - ctx->Driver.TexSubImage1D = fxDDTexSubImage1D; - ctx->Driver.TexSubImage2D = fxDDTexSubImage2D; - ctx->Driver.CompressedTexImage2D = fxDDCompressedTexImage2D; - ctx->Driver.CompressedTexSubImage2D = fxDDCompressedTexSubImage2D; - ctx->Driver.TestProxyTexImage = fxDDTestProxyTexImage; - ctx->Driver.TexEnv = fxDDTexEnv; - ctx->Driver.TexParameter = fxDDTexParam; - ctx->Driver.BindTexture = fxDDTexBind; - ctx->Driver.DeleteTexture = fxDDTexDel; - ctx->Driver.IsTextureResident = fxDDIsTextureResident; - ctx->Driver.UpdateTexturePalette = fxDDTexPalette; - ctx->Driver.AlphaFunc = fxDDAlphaFunc; - ctx->Driver.BlendFuncSeparate = fxDDBlendFuncSeparate; - ctx->Driver.BlendEquationSeparate = fxDDBlendEquationSeparate; - ctx->Driver.DepthFunc = fxDDDepthFunc; - ctx->Driver.DepthMask = fxDDDepthMask; - ctx->Driver.ColorMask = fxDDColorMask; - ctx->Driver.Fogfv = fxDDFogfv; - ctx->Driver.Scissor = fxDDScissor; - ctx->Driver.FrontFace = fxDDFrontFace; - ctx->Driver.CullFace = fxDDCullFace; - ctx->Driver.ShadeModel = fxDDShadeModel; - ctx->Driver.Enable = fxDDEnable; - if (fxMesa->haveHwStencil) { - ctx->Driver.StencilFuncSeparate = fxDDStencilFuncSeparate; - ctx->Driver.StencilMaskSeparate = fxDDStencilMaskSeparate; - ctx->Driver.StencilOpSeparate = fxDDStencilOpSeparate; - } - - fxSetupDDSpanPointers(ctx); - fxDDUpdateDDPointers(ctx, ~0); -} - - -#else - - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_dd(void); -int -gl_fx_dummy_function_dd(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c deleted file mode 100644 index d3a58a301c..0000000000 --- a/src/mesa/drivers/glide/fxddspan.c +++ /dev/null @@ -1,638 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - - -/* fxdd.c - 3Dfx VooDoo Mesa span and pixel functions */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#if defined(FX) - -#include "fxdrv.h" -#include "fxglidew.h" -#include "swrast/swrast.h" - - -/************************************************************************/ -/***** Span functions *****/ -/************************************************************************/ - -#define DBG 0 - - -#define LOCAL_VARS \ - GrBuffer_t currentFB = GR_BUFFER_BACKBUFFER; \ - GLuint pitch = info.strideInBytes; \ - GLuint height = fxMesa->height; \ - char *buf = (char *)((char *)info.lfbPtr + 0 /* x, y offset */); \ - GLuint p; \ - (void) buf; (void) p; - -#define CLIPPIXEL( _x, _y ) ( _x >= minx && _x < maxx && \ - _y >= miny && _y < maxy ) - -#define CLIPSPAN( _x, _y, _n, _x1, _n1, _i ) \ - if ( _y < miny || _y >= maxy ) { \ - _n1 = 0, _x1 = x; \ - } else { \ - _n1 = _n; \ - _x1 = _x; \ - if ( _x1 < minx ) _i += (minx-_x1), n1 -= (minx-_x1), _x1 = minx;\ - if ( _x1 + _n1 >= maxx ) n1 -= (_x1 + n1 - maxx); \ - } - -#define Y_FLIP(_y) (height - _y - 1) - -#define HW_WRITE_LOCK() \ - fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GrLfbInfo_t info; \ - info.size = sizeof(GrLfbInfo_t); \ - if ( grLfbLock( GR_LFB_WRITE_ONLY, \ - currentFB, LFB_MODE, \ - GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) { - -#define HW_WRITE_UNLOCK() \ - grLfbUnlock( GR_LFB_WRITE_ONLY, currentFB ); \ - } - -#define HW_READ_LOCK() \ - fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GrLfbInfo_t info; \ - info.size = sizeof(GrLfbInfo_t); \ - if ( grLfbLock( GR_LFB_READ_ONLY, currentFB, \ - LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) { - -#define HW_READ_UNLOCK() \ - grLfbUnlock( GR_LFB_READ_ONLY, currentFB ); \ - } - -#define HW_WRITE_CLIPLOOP() \ - do { \ - /* remember, we need to flip the scissor, too */ \ - /* is it better to do it inside fxDDScissor? */ \ - const int minx = fxMesa->clipMinX; \ - const int maxy = Y_FLIP(fxMesa->clipMinY); \ - const int maxx = fxMesa->clipMaxX; \ - const int miny = Y_FLIP(fxMesa->clipMaxY); - -#define HW_READ_CLIPLOOP() \ - do { \ - /* remember, we need to flip the scissor, too */ \ - /* is it better to do it inside fxDDScissor? */ \ - const int minx = fxMesa->clipMinX; \ - const int maxy = Y_FLIP(fxMesa->clipMinY); \ - const int maxx = fxMesa->clipMaxX; \ - const int miny = Y_FLIP(fxMesa->clipMaxY); - -#define HW_ENDCLIPLOOP() \ - } while (0) - - -/* 16 bit, ARGB1555 color spanline and pixel functions */ - -#undef LFB_MODE -#define LFB_MODE GR_LFBWRITEMODE_1555 - -#undef BYTESPERPIXEL -#define BYTESPERPIXEL 2 - -#undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p, color) \ - p = TDFXPACKCOLOR1555( color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \ - TDFXPACKCOLOR1555( r, g, b, a ) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch); \ - rgba[0] = FX_rgb_scale_5[(p >> 10) & 0x1F]; \ - rgba[1] = FX_rgb_scale_5[(p >> 5) & 0x1F]; \ - rgba[2] = FX_rgb_scale_5[ p & 0x1F]; \ - rgba[3] = (p & 0x8000) ? 255 : 0; \ - } while (0) - -#define TAG(x) tdfx##x##_ARGB1555 -#include "../dri/common/spantmp.h" - - -/* 16 bit, RGB565 color spanline and pixel functions */ -/* [dBorca] Hack alert: - * This is wrong. The alpha value is lost, even when we provide - * HW alpha (565 w/o depth buffering). To really update alpha buffer, - * we would need to do the 565 writings via 8888 colorformat and rely - * on the Voodoo to perform color scaling. In which case our 565 span - * would look nicer! But this violates FSAA rules... - */ - -#undef LFB_MODE -#define LFB_MODE GR_LFBWRITEMODE_565 - -#undef BYTESPERPIXEL -#define BYTESPERPIXEL 2 - -#undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p, color) \ - p = TDFXPACKCOLOR565( color[RCOMP], color[GCOMP], color[BCOMP] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \ - TDFXPACKCOLOR565( r, g, b ) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch); \ - rgba[0] = FX_rgb_scale_5[(p >> 11) & 0x1F]; \ - rgba[1] = FX_rgb_scale_6[(p >> 5) & 0x3F]; \ - rgba[2] = FX_rgb_scale_5[ p & 0x1F]; \ - rgba[3] = 0xff; \ - } while (0) - -#define TAG(x) tdfx##x##_RGB565 -#include "../dri/common/spantmp.h" - - -/* 32 bit, ARGB8888 color spanline and pixel functions */ - -#undef LFB_MODE -#define LFB_MODE GR_LFBWRITEMODE_8888 - -#undef BYTESPERPIXEL -#define BYTESPERPIXEL 4 - -#undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p, color) \ - p = TDFXPACKCOLOR8888( color[RCOMP], color[GCOMP], color[BCOMP], color[ACOMP] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = \ - TDFXPACKCOLOR8888( r, g, b, a ) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLuint p = *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch); \ - rgba[0] = (p >> 16) & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = (p >> 24) & 0xff; \ - } while (0) - -#define TAG(x) tdfx##x##_ARGB8888 -#include "../dri/common/spantmp.h" - - -/************************************************************************/ -/***** Depth functions *****/ -/************************************************************************/ - -#define DBG 0 - -#undef HW_WRITE_LOCK -#undef HW_WRITE_UNLOCK -#undef HW_READ_LOCK -#undef HW_READ_UNLOCK - -#define HW_CLIPLOOP HW_WRITE_CLIPLOOP - -#define LOCAL_DEPTH_VARS \ - GLuint pitch = info.strideInBytes; \ - GLuint height = fxMesa->height; \ - char *buf = (char *)((char *)info.lfbPtr + 0 /* x, y offset */); \ - (void) buf; - -#define HW_WRITE_LOCK() \ - fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GrLfbInfo_t info; \ - info.size = sizeof(GrLfbInfo_t); \ - if ( grLfbLock( GR_LFB_WRITE_ONLY, \ - GR_BUFFER_AUXBUFFER, LFB_MODE, \ - GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) { - -#define HW_WRITE_UNLOCK() \ - grLfbUnlock( GR_LFB_WRITE_ONLY, GR_BUFFER_AUXBUFFER); \ - } - -#define HW_READ_LOCK() \ - fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GrLfbInfo_t info; \ - info.size = sizeof(GrLfbInfo_t); \ - if ( grLfbLock( GR_LFB_READ_ONLY, GR_BUFFER_AUXBUFFER, \ - LFB_MODE, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info ) ) { - -#define HW_READ_UNLOCK() \ - grLfbUnlock( GR_LFB_READ_ONLY, GR_BUFFER_AUXBUFFER); \ - } - - -/* 16 bit, depth spanline and pixel functions */ - -#undef LFB_MODE -#define LFB_MODE GR_LFBWRITEMODE_ZA16 - -#undef BYTESPERPIXEL -#define BYTESPERPIXEL 2 - -#define VALUE_TYPE GLushort - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) = d - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLushort *)(buf + _x*BYTESPERPIXEL + _y*pitch) - -#define TAG(x) tdfx##x##_Z16 -#include "../dri/common/depthtmp.h" - - -/* 24 bit, depth spanline and pixel functions (for use w/ stencil) */ -/* [dBorca] Hack alert: - * This is evil. The incoming Mesa's 24bit depth value - * is shifted left 8 bits, to obtain a full 32bit value, - * which will be thrown into the framebuffer. We rely on - * the fact that Voodoo hardware transforms a 32bit value - * into 24bit value automatically and, MOST IMPORTANT, won't - * alter the upper 8bits of the value already existing in the - * framebuffer (where stencil resides). - */ - -#undef LFB_MODE -#define LFB_MODE GR_LFBWRITEMODE_Z32 - -#undef BYTESPERPIXEL -#define BYTESPERPIXEL 4 - -#define VALUE_TYPE GLuint - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch) = d << 8 - -#define READ_DEPTH( d, _x, _y ) \ - d = (*(GLuint *)(buf + _x*BYTESPERPIXEL + _y*pitch)) & 0xffffff - -#define TAG(x) tdfx##x##_Z24 -#include "../dri/common/depthtmp.h" - - -/* 32 bit, depth spanline and pixel functions (for use w/o stencil) */ -/* [dBorca] Hack alert: - * This is more evil. We make Mesa run in 32bit depth, but - * tha Voodoo HW can only handle 24bit depth. Well, exploiting - * the pixel pipeline, we can achieve 24:8 format for greater - * precision... - * If anyone tells me how to really store 32bit values into the - * depth buffer, I'll write the *_Z32 routines. Howver, bear in - * mind that means running without stencil! - */ - -/************************************************************************/ -/***** Span functions (optimized) *****/ -/************************************************************************/ - -/* - * Read a span of 15-bit RGB pixels. Note, we don't worry about cliprects - * since OpenGL says obscured pixels have undefined values. - */ -static void fxReadRGBASpan_ARGB1555 (const GLcontext * ctx, - struct gl_renderbuffer *rb, - GLuint n, - GLint x, GLint y, - GLubyte rgba[][4]) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrBuffer_t currentFB = GR_BUFFER_BACKBUFFER; - GrLfbInfo_t info; - info.size = sizeof(GrLfbInfo_t); - if (grLfbLock(GR_LFB_READ_ONLY, currentFB, - GR_LFBWRITEMODE_ANY, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { - const GLint winX = 0; - const GLint winY = fxMesa->height - 1; - const GLushort *data16 = (const GLushort *)((const GLubyte *)info.lfbPtr + - (winY - y) * info.strideInBytes + - (winX + x) * 2); - const GLuint *data32 = (const GLuint *) data16; - GLuint i, j; - GLuint extraPixel = (n & 1); - n -= extraPixel; - - for (i = j = 0; i < n; i += 2, j++) { - GLuint pixel = data32[j]; - rgba[i][0] = FX_rgb_scale_5[(pixel >> 10) & 0x1F]; - rgba[i][1] = FX_rgb_scale_5[(pixel >> 5) & 0x1F]; - rgba[i][2] = FX_rgb_scale_5[ pixel & 0x1F]; - rgba[i][3] = (pixel & 0x8000) ? 255 : 0; - rgba[i+1][0] = FX_rgb_scale_5[(pixel >> 26) & 0x1F]; - rgba[i+1][1] = FX_rgb_scale_5[(pixel >> 21) & 0x1F]; - rgba[i+1][2] = FX_rgb_scale_5[(pixel >> 16) & 0x1F]; - rgba[i+1][3] = (pixel & 0x80000000) ? 255 : 0; - } - if (extraPixel) { - GLushort pixel = data16[n]; - rgba[n][0] = FX_rgb_scale_5[(pixel >> 10) & 0x1F]; - rgba[n][1] = FX_rgb_scale_5[(pixel >> 5) & 0x1F]; - rgba[n][2] = FX_rgb_scale_5[ pixel & 0x1F]; - rgba[n][3] = (pixel & 0x8000) ? 255 : 0; - } - - grLfbUnlock(GR_LFB_READ_ONLY, currentFB); - } -} - -/* - * Read a span of 16-bit RGB pixels. Note, we don't worry about cliprects - * since OpenGL says obscured pixels have undefined values. - */ -static void fxReadRGBASpan_RGB565 (const GLcontext * ctx, - struct gl_renderbuffer *rb, - GLuint n, - GLint x, GLint y, - GLubyte rgba[][4]) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrBuffer_t currentFB = GR_BUFFER_BACKBUFFER; - GrLfbInfo_t info; - info.size = sizeof(GrLfbInfo_t); - if (grLfbLock(GR_LFB_READ_ONLY, currentFB, - GR_LFBWRITEMODE_ANY, GR_ORIGIN_UPPER_LEFT, FXFALSE, &info)) { - const GLint winX = 0; - const GLint winY = fxMesa->height - 1; - const GLushort *data16 = (const GLushort *)((const GLubyte *)info.lfbPtr + - (winY - y) * info.strideInBytes + - (winX + x) * 2); - const GLuint *data32 = (const GLuint *) data16; - GLuint i, j; - GLuint extraPixel = (n & 1); - n -= extraPixel; - - for (i = j = 0; i < n; i += 2, j++) { - GLuint pixel = data32[j]; - rgba[i][0] = FX_rgb_scale_5[(pixel >> 11) & 0x1F]; - rgba[i][1] = FX_rgb_scale_6[(pixel >> 5) & 0x3F]; - rgba[i][2] = FX_rgb_scale_5[ pixel & 0x1F]; - rgba[i][3] = 255; - rgba[i+1][0] = FX_rgb_scale_5[(pixel >> 27) & 0x1F]; - rgba[i+1][1] = FX_rgb_scale_6[(pixel >> 21) & 0x3F]; - rgba[i+1][2] = FX_rgb_scale_5[(pixel >> 16) & 0x1F]; - rgba[i+1][3] = 255; - } - if (extraPixel) { - GLushort pixel = data16[n]; - rgba[n][0] = FX_rgb_scale_5[(pixel >> 11) & 0x1F]; - rgba[n][1] = FX_rgb_scale_6[(pixel >> 5) & 0x3F]; - rgba[n][2] = FX_rgb_scale_5[ pixel & 0x1F]; - rgba[n][3] = 255; - } - - grLfbUnlock(GR_LFB_READ_ONLY, currentFB); - } -} - -/* - * Read a span of 32-bit RGB pixels. Note, we don't worry about cliprects - * since OpenGL says obscured pixels have undefined values. - */ -static void fxReadRGBASpan_ARGB8888 (const GLcontext * ctx, - struct gl_renderbuffer *rb, - GLuint n, - GLint x, GLint y, - GLubyte rgba[][4]) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrBuffer_t currentFB = GR_BUFFER_BACKBUFFER; - GLuint i; - grLfbReadRegion(currentFB, x, fxMesa->height - 1 - y, n, 1, n * 4, rgba); - for (i = 0; i < n; i++) { - GLubyte c = rgba[i][0]; - rgba[i][0] = rgba[i][2]; - rgba[i][2] = c; - } -} - - -/************************************************************************/ -/***** Depth functions (optimized) *****/ -/************************************************************************/ - -static void -fxReadDepthSpan_Z16(GLcontext * ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint depth[]) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLint bottom = fxMesa->height - 1; - GLushort depth16[MAX_WIDTH]; - GLuint i; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxReadDepthSpan_Z16(...)\n"); - } - - grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth16); - for (i = 0; i < n; i++) { - depth[i] = depth16[i]; - } -} - - -static void -fxReadDepthSpan_Z24(GLcontext * ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint depth[]) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLint bottom = fxMesa->height - 1; - GLuint i; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxReadDepthSpan_Z24(...)\n"); - } - - grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, depth); - for (i = 0; i < n; i++) { - depth[i] &= 0xffffff; - } -} - - -/************************************************************************/ -/***** Stencil functions (optimized) *****/ -/************************************************************************/ - -static void -fxWriteStencilSpan (GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const GLstencil stencil[], const GLubyte mask[]) -{ - /* - * XXX todo - */ -} - -static void -fxReadStencilSpan(GLcontext * ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLstencil stencil[]) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLint bottom = fxMesa->height - 1; - GLuint zs32[MAX_WIDTH]; - GLuint i; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxReadStencilSpan(...)\n"); - } - - grLfbReadRegion(GR_BUFFER_AUXBUFFER, x, bottom - y, n, 1, 0, zs32); - for (i = 0; i < n; i++) { - stencil[i] = zs32[i] >> 24; - } -} - -static void -fxWriteStencilPixels (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, - const GLint x[], const GLint y[], - const GLstencil stencil[], - const GLubyte mask[]) -{ - /* - * XXX todo - */ -} - -static void -fxReadStencilPixels (GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, - const GLint x[], const GLint y[], - GLstencil stencil[]) -{ - /* - * XXX todo - */ -} - - -void -fxSetupDDSpanPointers(GLcontext * ctx) -{ - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - switch (fxMesa->colDepth) { - case 15: - swdd->WriteRGBASpan = tdfxWriteRGBASpan_ARGB1555; - swdd->WriteRGBSpan = tdfxWriteRGBSpan_ARGB1555; - swdd->WriteRGBAPixels = tdfxWriteRGBAPixels_ARGB1555; - swdd->WriteMonoRGBASpan = tdfxWriteMonoRGBASpan_ARGB1555; - swdd->WriteMonoRGBAPixels = tdfxWriteMonoRGBAPixels_ARGB1555; - swdd->ReadRGBASpan = /*td*/fxReadRGBASpan_ARGB1555; - swdd->ReadRGBAPixels = tdfxReadRGBAPixels_ARGB1555; - - swdd->WriteDepthSpan = tdfxWriteDepthSpan_Z16; - swdd->WriteDepthPixels = tdfxWriteDepthPixels_Z16; - swdd->ReadDepthSpan = /*td*/fxReadDepthSpan_Z16; - swdd->ReadDepthPixels = tdfxReadDepthPixels_Z16; - break; - case 16: - swdd->WriteRGBASpan = tdfxWriteRGBASpan_RGB565; - swdd->WriteRGBSpan = tdfxWriteRGBSpan_RGB565; - swdd->WriteRGBAPixels = tdfxWriteRGBAPixels_RGB565; - swdd->WriteMonoRGBASpan = tdfxWriteMonoRGBASpan_RGB565; - swdd->WriteMonoRGBAPixels = tdfxWriteMonoRGBAPixels_RGB565; - swdd->ReadRGBASpan = /*td*/fxReadRGBASpan_RGB565; - swdd->ReadRGBAPixels = tdfxReadRGBAPixels_RGB565; - - swdd->WriteDepthSpan = tdfxWriteDepthSpan_Z16; - swdd->WriteDepthPixels = tdfxWriteDepthPixels_Z16; - swdd->ReadDepthSpan = /*td*/fxReadDepthSpan_Z16; - swdd->ReadDepthPixels = tdfxReadDepthPixels_Z16; - break; - case 32: - swdd->WriteRGBASpan = tdfxWriteRGBASpan_ARGB8888; - swdd->WriteRGBSpan = tdfxWriteRGBSpan_ARGB8888; - swdd->WriteRGBAPixels = tdfxWriteRGBAPixels_ARGB8888; - swdd->WriteMonoRGBASpan = tdfxWriteMonoRGBASpan_ARGB8888; - swdd->WriteMonoRGBAPixels = tdfxWriteMonoRGBAPixels_ARGB8888; - swdd->ReadRGBASpan = /*td*/fxReadRGBASpan_ARGB8888; - swdd->ReadRGBAPixels = tdfxReadRGBAPixels_ARGB8888; - - swdd->WriteDepthSpan = tdfxWriteDepthSpan_Z24; - swdd->WriteDepthPixels = tdfxWriteDepthPixels_Z24; - swdd->ReadDepthSpan = /*td*/fxReadDepthSpan_Z24; - swdd->ReadDepthPixels = tdfxReadDepthPixels_Z24; - break; - } - - if (fxMesa->haveHwStencil) { - swdd->WriteStencilSpan = fxWriteStencilSpan; - swdd->ReadStencilSpan = fxReadStencilSpan; - swdd->WriteStencilPixels = fxWriteStencilPixels; - swdd->ReadStencilPixels = fxReadStencilPixels; - } -#if 0 - swdd->WriteCI8Span = NULL; - swdd->WriteCI32Span = NULL; - swdd->WriteMonoCISpan = NULL; - swdd->WriteCI32Pixels = NULL; - swdd->WriteMonoCIPixels = NULL; - swdd->ReadCI32Span = NULL; - swdd->ReadCI32Pixels = NULL; - - swdd->SpanRenderStart = tdfxSpanRenderStart; /* BEGIN_BOARD_LOCK */ - swdd->SpanRenderFinish = tdfxSpanRenderFinish; /* END_BOARD_LOCK */ -#endif -} - - -#else - - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_span(void); -int -gl_fx_dummy_function_span(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c deleted file mode 100644 index b35874fffc..0000000000 --- a/src/mesa/drivers/glide/fxddtex.c +++ /dev/null @@ -1,1836 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#if defined(FX) - -#include "fxdrv.h" -#include "main/enums.h" -#include "main/formats.h" -#include "main/image.h" -#include "main/teximage.h" -#include "main/texstore.h" -#include "main/texformat.h" -#include "main/texcompress.h" -#include "main/texobj.h" -#include "main/texstore.h" - - -/* no borders! can't halve 1x1! (stride > width * comp) not allowed */ -static void -_mesa_halve2x2_teximage2d ( GLcontext *ctx, - struct gl_texture_image *texImage, - GLuint bytesPerPixel, - GLint srcWidth, GLint srcHeight, - const GLvoid *srcImage, GLvoid *dstImage ) -{ - GLint i, j, k; - GLint dstWidth = srcWidth / 2; - GLint dstHeight = srcHeight / 2; - GLint srcRowStride = srcWidth * bytesPerPixel; - GLubyte *src = (GLubyte *)srcImage; - GLubyte *dst = dstImage; - - GLuint bpt = 0; - GLubyte *_s = NULL; - GLubyte *_d = NULL; - GLenum _t = 0; - - if (texImage->TexFormat->MesaFormat == MESA_FORMAT_RGB565) { - _t = GL_UNSIGNED_SHORT_5_6_5_REV; - bpt = bytesPerPixel; - } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB4444) { - _t = GL_UNSIGNED_SHORT_4_4_4_4_REV; - bpt = bytesPerPixel; - } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB1555) { - _t = GL_UNSIGNED_SHORT_1_5_5_5_REV; - bpt = bytesPerPixel; - } - if (bpt) { - bytesPerPixel = 4; - srcRowStride = srcWidth * bytesPerPixel; - if (dstWidth == 0) { - dstWidth = 1; - } - if (dstHeight == 0) { - dstHeight = 1; - } - _s = src = MALLOC(srcRowStride * srcHeight); - _d = dst = MALLOC(dstWidth * bytesPerPixel * dstHeight); - _mesa_texstore(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, src, - 0, 0, 0, /* dstX/Y/Zoffset */ - srcRowStride, /* dstRowStride */ - 0, /* dstImageStride */ - srcWidth, srcHeight, 1, - texImage->_BaseFormat, _t, - srcImage, &ctx->DefaultPacking); - } - - if (srcHeight == 1) { - for (i = 0; i < dstWidth; i++) { - for (k = 0; k < bytesPerPixel; k++) { - dst[0] = (src[0] + src[bytesPerPixel] + 1) / 2; - src++; - dst++; - } - src += bytesPerPixel; - } - } else if (srcWidth == 1) { - for (j = 0; j < dstHeight; j++) { - for (k = 0; k < bytesPerPixel; k++) { - dst[0] = (src[0] + src[srcRowStride] + 1) / 2; - src++; - dst++; - } - src += srcRowStride; - } - } else { - for (j = 0; j < dstHeight; j++) { - for (i = 0; i < dstWidth; i++) { - for (k = 0; k < bytesPerPixel; k++) { - dst[0] = (src[0] + - src[bytesPerPixel] + - src[srcRowStride] + - src[srcRowStride + bytesPerPixel] + 2) / 4; - src++; - dst++; - } - src += bytesPerPixel; - } - src += srcRowStride; - } - } - - if (bpt) { - src = _s; - dst = _d; - _mesa_texstore(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, dstImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstWidth * bpt, - 0, /* dstImageStride */ - dstWidth, dstHeight, 1, - GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); - FREE(dst); - FREE(src); - } -} - - -void -fxPrintTextureData(tfxTexInfo * ti) -{ - fprintf(stderr, "Texture Data:\n"); - if (ti->tObj) { - fprintf(stderr, "\tName: %d\n", ti->tObj->Name); - fprintf(stderr, "\tBaseLevel: %d\n", ti->tObj->BaseLevel); - fprintf(stderr, "\tSize: %d x %d\n", - ti->tObj->Image[0][ti->tObj->BaseLevel]->Width, - ti->tObj->Image[0][ti->tObj->BaseLevel]->Height); - } - else - fprintf(stderr, "\tName: UNNAMED\n"); - fprintf(stderr, "\tLast used: %d\n", ti->lastTimeUsed); - fprintf(stderr, "\tTMU: %ld\n", ti->whichTMU); - fprintf(stderr, "\t%s\n", (ti->isInTM) ? "In TMU" : "Not in TMU"); - if (ti->tm[0]) - fprintf(stderr, "\tMem0: %x-%x\n", (unsigned) ti->tm[0]->startAddr, - (unsigned) ti->tm[0]->endAddr); - if (ti->tm[1]) - fprintf(stderr, "\tMem1: %x-%x\n", (unsigned) ti->tm[1]->startAddr, - (unsigned) ti->tm[1]->endAddr); - fprintf(stderr, "\tMipmaps: %d-%d\n", ti->minLevel, ti->maxLevel); - fprintf(stderr, "\tFilters: min %d max %d\n", - (int) ti->minFilt, (int) ti->maxFilt); - fprintf(stderr, "\tClamps: s %d t %d\n", (int) ti->sClamp, - (int) ti->tClamp); - fprintf(stderr, "\tScales: s %f t %f\n", ti->sScale, ti->tScale); - fprintf(stderr, "\t%s\n", - (ti->fixedPalette) ? "Fixed palette" : "Non fixed palette"); - fprintf(stderr, "\t%s\n", (ti->validated) ? "Validated" : "Not validated"); -} - - -/************************************************************************/ -/*************************** Texture Mapping ****************************/ -/************************************************************************/ - -static void -fxTexInvalidate(GLcontext * ctx, struct gl_texture_object *tObj) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti; - - ti = fxTMGetTexInfo(tObj); - if (ti->isInTM) - fxTMMoveOutTM(fxMesa, tObj); /* TO DO: SLOW but easy to write */ - - ti->validated = GL_FALSE; - fxMesa->new_state |= FX_NEW_TEXTURING; -} - -static tfxTexInfo * -fxAllocTexObjData(fxMesaContext fxMesa) -{ - tfxTexInfo *ti; - - if (!(ti = CALLOC(sizeof(tfxTexInfo)))) { - fprintf(stderr, "fxAllocTexObjData: ERROR: out of memory !\n"); - fxCloseHardware(); - exit(-1); - } - - ti->validated = GL_FALSE; - ti->isInTM = GL_FALSE; - - ti->whichTMU = FX_TMU_NONE; - - ti->tm[FX_TMU0] = NULL; - ti->tm[FX_TMU1] = NULL; - - ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED; - ti->maxFilt = GR_TEXTUREFILTER_BILINEAR; - - ti->sClamp = GR_TEXTURECLAMP_WRAP; - ti->tClamp = GR_TEXTURECLAMP_WRAP; - - ti->mmMode = GR_MIPMAP_NEAREST; - ti->LODblend = FXFALSE; - - return ti; -} - -void -fxDDTexBind(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDTexBind(%d, %x)\n", tObj->Name, (GLuint)tObj->DriverData); - } - - if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D)) - return; - - if (!tObj->DriverData) { - tObj->DriverData = fxAllocTexObjData(fxMesa); - } - ti = fxTMGetTexInfo(tObj); - - fxMesa->texBindNumber++; - ti->lastTimeUsed = fxMesa->texBindNumber; - - fxMesa->new_state |= FX_NEW_TEXTURING; -} - -void -fxDDTexEnv(GLcontext * ctx, GLenum target, GLenum pname, - const GLfloat * param) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - if (param) - fprintf(stderr, "fxDDTexEnv(%x, %x)\n", pname, (GLint) (*param)); - else - fprintf(stderr, "fxDDTexEnv(%x)\n", pname); - } - - /* apply any lod biasing right now */ - if (pname == GL_TEXTURE_LOD_BIAS_EXT) { - GLfloat bias = *param; - bias = CLAMP(bias, - -ctx->Const.MaxTextureLodBias, - ctx->Const.MaxTextureLodBias - 0.25); - - grTexLodBiasValue(GR_TMU0, bias); - - if (fxMesa->haveTwoTMUs) { - grTexLodBiasValue(GR_TMU1, bias); - } - - } - - fxMesa->new_state |= FX_NEW_TEXTURING; -} - -void -fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, - GLenum pname, const GLfloat * params) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLenum param = (GLenum) (GLint) params[0]; - tfxTexInfo *ti; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDTexParam(%d, %x, %s, %s)\n", - tObj->Name, (GLuint) tObj->DriverData, - _mesa_lookup_enum_by_nr(pname), - _mesa_lookup_enum_by_nr(param)); - } - - if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D)) - return; - - if (!tObj->DriverData) - tObj->DriverData = fxAllocTexObjData(fxMesa); - ti = fxTMGetTexInfo(tObj); - - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - switch (param) { - case GL_NEAREST: - ti->mmMode = GR_MIPMAP_DISABLE; - ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED; - ti->LODblend = FXFALSE; - break; - case GL_LINEAR: - ti->mmMode = GR_MIPMAP_DISABLE; - ti->minFilt = GR_TEXTUREFILTER_BILINEAR; - ti->LODblend = FXFALSE; - break; - case GL_NEAREST_MIPMAP_LINEAR: - /* [dBorca] - * currently Napalm can't do single-pass trilinear, - * because the way its combiners are set. So we fall back - * to GL_NEAREST_MIPMAP_NEAREST. We'll let true trilinear - * enabled for V2, V3. - */ - if (!fxMesa->HaveCmbExt) { - if (fxMesa->haveTwoTMUs) { - ti->mmMode = GR_MIPMAP_NEAREST; - ti->LODblend = FXTRUE; - } else { - ti->mmMode = GR_MIPMAP_NEAREST_DITHER; - ti->LODblend = FXFALSE; - } - ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED; - break; - } - case GL_NEAREST_MIPMAP_NEAREST: - ti->mmMode = GR_MIPMAP_NEAREST; - ti->minFilt = GR_TEXTUREFILTER_POINT_SAMPLED; - ti->LODblend = FXFALSE; - break; - case GL_LINEAR_MIPMAP_LINEAR: - /* [dBorca] - * currently Napalm can't do single-pass trilinear, - * because the way its combiners are set. So we fall back - * to GL_LINEAR_MIPMAP_NEAREST. We'll let true trilinear - * enabled for V2, V3. - */ - if (!fxMesa->HaveCmbExt) { - if (fxMesa->haveTwoTMUs) { - ti->mmMode = GR_MIPMAP_NEAREST; - ti->LODblend = FXTRUE; - } else { - ti->mmMode = GR_MIPMAP_NEAREST_DITHER; - ti->LODblend = FXFALSE; - } - ti->minFilt = GR_TEXTUREFILTER_BILINEAR; - break; - } - case GL_LINEAR_MIPMAP_NEAREST: - ti->mmMode = GR_MIPMAP_NEAREST; - ti->minFilt = GR_TEXTUREFILTER_BILINEAR; - ti->LODblend = FXFALSE; - break; - default: - break; - } - fxTexInvalidate(ctx, tObj); - break; - - case GL_TEXTURE_MAG_FILTER: - switch (param) { - case GL_NEAREST: - ti->maxFilt = GR_TEXTUREFILTER_POINT_SAMPLED; - break; - case GL_LINEAR: - ti->maxFilt = GR_TEXTUREFILTER_BILINEAR; - break; - default: - break; - } - fxMesa->new_state |= FX_NEW_TEXTURING; - break; - - case GL_TEXTURE_WRAP_S: - switch (param) { - case GL_MIRRORED_REPEAT: - ti->sClamp = GR_TEXTURECLAMP_MIRROR_EXT; - break; - case GL_CLAMP_TO_BORDER: /* no-no, but don't REPEAT, either */ - case GL_CLAMP_TO_EDGE: /* CLAMP discarding border */ - case GL_CLAMP: - ti->sClamp = GR_TEXTURECLAMP_CLAMP; - break; - case GL_REPEAT: - ti->sClamp = GR_TEXTURECLAMP_WRAP; - break; - default: - break; - } - fxMesa->new_state |= FX_NEW_TEXTURING; - break; - - case GL_TEXTURE_WRAP_T: - switch (param) { - case GL_MIRRORED_REPEAT: - ti->tClamp = GR_TEXTURECLAMP_MIRROR_EXT; - break; - case GL_CLAMP_TO_BORDER: /* no-no, but don't REPEAT, either */ - case GL_CLAMP_TO_EDGE: /* CLAMP discarding border */ - case GL_CLAMP: - ti->tClamp = GR_TEXTURECLAMP_CLAMP; - break; - case GL_REPEAT: - ti->tClamp = GR_TEXTURECLAMP_WRAP; - break; - default: - break; - } - fxMesa->new_state |= FX_NEW_TEXTURING; - break; - - case GL_TEXTURE_BORDER_COLOR: - /* TO DO */ - break; - - case GL_TEXTURE_MIN_LOD: - /* TO DO */ - break; - case GL_TEXTURE_MAX_LOD: - /* TO DO */ - break; - case GL_TEXTURE_BASE_LEVEL: - fxTexInvalidate(ctx, tObj); - break; - case GL_TEXTURE_MAX_LEVEL: - fxTexInvalidate(ctx, tObj); - break; - - default: - break; - } -} - -void -fxDDTexDel(GLcontext * ctx, struct gl_texture_object *tObj) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDTexDel(%d, %p)\n", tObj->Name, (void *) ti); - } - - if (!ti) - return; - - fxTMFreeTexture(fxMesa, tObj); - - FREE(ti); - tObj->DriverData = NULL; - - /* Free mipmap images and the texture object itself */ - _mesa_delete_texture_object(ctx, tObj); -} - - -/** - * Allocate a new texture object. - * Called via ctx->Driver.NewTextureObject. - * Note: this function will be called during context creation to - * allocate the default texture objects. - */ -struct gl_texture_object * -fxDDNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ) -{ - struct gl_texture_object *obj; - obj = _mesa_new_texture_object(ctx, name, target); - return obj; -} - - -/* - * Return true if texture is resident, false otherwise. - */ -GLboolean -fxDDIsTextureResident(GLcontext *ctx, struct gl_texture_object *tObj) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - return (ti && ti->isInTM); -} - - - -/* - * Convert a gl_color_table texture palette to Glide's format. - */ -static GrTexTable_t -convertPalette(const fxMesaContext fxMesa, FxU32 data[256], const struct gl_color_table *table) -{ - const GLubyte *tableUB = (const GLubyte *) table->Table; - GLint width = table->Size; - FxU32 r, g, b, a; - GLint i; - - ASSERT(table->Type == GL_UNSIGNED_BYTE); - - switch (table->_BaseFormat) { - case GL_INTENSITY: - for (i = 0; i < width; i++) { - r = tableUB[i]; - g = tableUB[i]; - b = tableUB[i]; - a = tableUB[i]; - data[i] = (a << 24) | (r << 16) | (g << 8) | b; - } - return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE; - case GL_LUMINANCE: - for (i = 0; i < width; i++) { - r = tableUB[i]; - g = tableUB[i]; - b = tableUB[i]; - a = 255; - data[i] = (a << 24) | (r << 16) | (g << 8) | b; - } - return GR_TEXTABLE_PALETTE; - case GL_ALPHA: - for (i = 0; i < width; i++) { - r = g = b = 255; - a = tableUB[i]; - data[i] = (a << 24) | (r << 16) | (g << 8) | b; - } - return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE; - case GL_LUMINANCE_ALPHA: - for (i = 0; i < width; i++) { - r = g = b = tableUB[i * 2 + 0]; - a = tableUB[i * 2 + 1]; - data[i] = (a << 24) | (r << 16) | (g << 8) | b; - } - return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE; - default: - case GL_RGB: - for (i = 0; i < width; i++) { - r = tableUB[i * 3 + 0]; - g = tableUB[i * 3 + 1]; - b = tableUB[i * 3 + 2]; - a = 255; - data[i] = (a << 24) | (r << 16) | (g << 8) | b; - } - return GR_TEXTABLE_PALETTE; - case GL_RGBA: - for (i = 0; i < width; i++) { - r = tableUB[i * 4 + 0]; - g = tableUB[i * 4 + 1]; - b = tableUB[i * 4 + 2]; - a = tableUB[i * 4 + 3]; - data[i] = (a << 24) | (r << 16) | (g << 8) | b; - } - return fxMesa->HavePalExt ? GR_TEXTABLE_PALETTE_6666_EXT : GR_TEXTABLE_PALETTE; - } -} - - -void -fxDDTexPalette(GLcontext * ctx, struct gl_texture_object *tObj) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (tObj) { - /* per-texture palette */ - tfxTexInfo *ti; - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDTexPalette(%d, %x)\n", - tObj->Name, (GLuint) tObj->DriverData); - } - /* This might be a proxy texture. */ - if (!tObj->Palette.Table) - return; - if (!tObj->DriverData) - tObj->DriverData = fxAllocTexObjData(fxMesa); - ti = fxTMGetTexInfo(tObj); - ti->paltype = convertPalette(fxMesa, ti->palette.data, &tObj->Palette); - fxTexInvalidate(ctx, tObj); - } - else { - /* global texture palette */ - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDTexPalette(global)\n"); - } - fxMesa->glbPalType = convertPalette(fxMesa, fxMesa->glbPalette.data, &ctx->Texture.Palette); - fxMesa->new_state |= FX_NEW_TEXTURING; - - grTexDownloadTable(fxMesa->glbPalType, &(fxMesa->glbPalette)); - } -} - - -void -fxDDTexUseGlbPalette(GLcontext * ctx, GLboolean state) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxDDTexUseGlbPalette(%d)\n", state); - } - - fxMesa->haveGlobalPaletteTexture = state; - fxMesa->new_state |= FX_NEW_TEXTURING; -} - - -static int -logbase2(int n) -{ - GLint i = 1; - GLint log2 = 0; - - if (n < 0) { - return -1; - } - - while (n > i) { - i *= 2; - log2++; - } - if (i != n) { - return -1; - } - else { - return log2; - } -} - - -/* fxTexGetInfo - * w, h - source texture width and height - * lodlevel - Glide lod level token for the larger texture dimension - * ar - Glide aspect ratio token - * sscale - S scale factor used during triangle setup - * tscale - T scale factor used during triangle setup - * wscale - OpenGL -> Glide image width scale factor - * hscale - OpenGL -> Glide image height scale factor - */ -int -fxTexGetInfo(int w, int h, GrLOD_t * lodlevel, GrAspectRatio_t * ar, - float *sscale, float *tscale, - int *wscale, int *hscale) -{ - int logw, logh, ws, hs; - GrLOD_t l; - GrAspectRatio_t aspectratio; - float s, t; - - logw = logbase2(w); - logh = logbase2(h); - - l = MAX2(logw, logh); - aspectratio = logw - logh; - ws = hs = 1; - s = t = 256.0f; - - /* hardware only allows a maximum aspect ratio of 8x1, so handle - * |aspectratio| > 3 by scaling the image and using an 8x1 aspect - * ratio - */ - switch (aspectratio) { - case 0: - break; - case 1: - t = 128.0f; - break; - case 2: - t = 64.0f; - break; - case 3: - t = 32.0f; - break; - case -1: - s = 128.0f; - break; - case -2: - s = 64.0f; - break; - case -3: - s = 32.0f; - break; - default: - if (aspectratio > 3) { - t = 32.0f; - hs = 1 << (aspectratio - 3); - aspectratio = GR_ASPECT_LOG2_8x1; - } else /*if (aspectratio < -3)*/ { - s = 32.0f; - ws = 1 << (-aspectratio - 3); - aspectratio = GR_ASPECT_LOG2_1x8; - } - } - - if (lodlevel) - (*lodlevel) = l; - - if (ar) - (*ar) = aspectratio; - - if (sscale) - (*sscale) = s; - - if (tscale) - (*tscale) = t; - - if (wscale) - (*wscale) = ws; - - if (hscale) - (*hscale) = hs; - - - return 1; -} - -static GLboolean -fxIsTexSupported(GLenum target, GLint internalFormat, - const struct gl_texture_image *image) -{ - if ((target != GL_TEXTURE_1D) && (target != GL_TEXTURE_2D)) - return GL_FALSE; - -#if 0 - if (!fxTexGetInfo(image->Width, image->Height, NULL, NULL, NULL, NULL, NULL, NULL)) - return GL_FALSE; -#endif - - if (image->Border > 0) - return GL_FALSE; - - return GL_TRUE; -} - - -/**********************************************************************/ -/**** NEW TEXTURE IMAGE FUNCTIONS ****/ -/**********************************************************************/ -extern void -fxt1_decode_1 (const void *texture, int width, - int i, int j, unsigned char *rgba); - -/* Texel-fetch functions for software texturing and glGetTexImage(). - * We should have been able to use some "standard" fetch functions (which - * may get defined in texutil.c) but we have to account for scaled texture - * images on tdfx hardware (the 8:1 aspect ratio limit). - * Hence, we need special functions here. - */ - -static void -fetch_intensity8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLubyte *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLubyte *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = *texel; - rgba[GCOMP] = *texel; - rgba[BCOMP] = *texel; - rgba[ACOMP] = *texel; -} - - -static void -fetch_luminance8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLubyte *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLubyte *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = *texel; - rgba[GCOMP] = *texel; - rgba[BCOMP] = *texel; - rgba[ACOMP] = 255; -} - - -static void -fetch_alpha8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLubyte *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLubyte *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = 255; - rgba[GCOMP] = 255; - rgba[BCOMP] = 255; - rgba[ACOMP] = *texel; -} - - -static void -fetch_index8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *indexOut) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLubyte *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLubyte *) texImage->Data) + j * mml->width + i; - *indexOut = *texel; -} - - -static void -fetch_luminance8_alpha8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLubyte *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLubyte *) texImage->Data) + (j * mml->width + i) * 2; - rgba[RCOMP] = texel[0]; - rgba[GCOMP] = texel[0]; - rgba[BCOMP] = texel[0]; - rgba[ACOMP] = texel[1]; -} - - -static void -fetch_r5g6b5(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLushort *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLushort *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = FX_rgb_scale_5[(*texel >> 11) & 0x1F]; - rgba[GCOMP] = FX_rgb_scale_6[(*texel >> 5) & 0x3F]; - rgba[BCOMP] = FX_rgb_scale_5[ *texel & 0x1F]; - rgba[ACOMP] = 255; -} - - -static void -fetch_r4g4b4a4(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLushort *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLushort *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = FX_rgb_scale_4[(*texel >> 8) & 0xF]; - rgba[GCOMP] = FX_rgb_scale_4[(*texel >> 4) & 0xF]; - rgba[BCOMP] = FX_rgb_scale_4[ *texel & 0xF]; - rgba[ACOMP] = FX_rgb_scale_4[(*texel >> 12) & 0xF]; -} - - -static void -fetch_r5g5b5a1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLushort *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLushort *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = FX_rgb_scale_5[(*texel >> 10) & 0x1F]; - rgba[GCOMP] = FX_rgb_scale_5[(*texel >> 5) & 0x1F]; - rgba[BCOMP] = FX_rgb_scale_5[ *texel & 0x1F]; - rgba[ACOMP] = (*texel >> 15) * 255; -} - - -static void -fetch_a8r8g8b8(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - const GLuint *texel; - - i = i * mml->wScale; - j = j * mml->hScale; - - texel = ((GLuint *) texImage->Data) + j * mml->width + i; - rgba[RCOMP] = (((*texel) >> 16) & 0xff); - rgba[GCOMP] = (((*texel) >> 8) & 0xff); - rgba[BCOMP] = (((*texel) ) & 0xff); - rgba[ACOMP] = (((*texel) >> 24) & 0xff); -} - - -static void -fetch_rgb_fxt1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - i = i * mml->wScale; - j = j * mml->hScale; - - fxt1_decode_1(texImage->Data, mml->width, i, j, rgba); - rgba[ACOMP] = 255; -} - - -static void -fetch_rgba_fxt1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - i = i * mml->wScale; - j = j * mml->hScale; - - fxt1_decode_1(texImage->Data, mml->width, i, j, rgba); -} - - -static void -fetch_rgb_dxt1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - i = i * mml->wScale; - j = j * mml->hScale; - - _mesa_texformat_rgb_dxt1.FetchTexel2D(texImage, i, j, k, rgba); -} - - -static void -fetch_rgba_dxt1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - i = i * mml->wScale; - j = j * mml->hScale; - - _mesa_texformat_rgba_dxt1.FetchTexel2D(texImage, i, j, k, rgba); -} - - -static void -fetch_rgba_dxt3(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - i = i * mml->wScale; - j = j * mml->hScale; - - _mesa_texformat_rgba_dxt3.FetchTexel2D(texImage, i, j, k, rgba); -} - - -static void -fetch_rgba_dxt5(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *rgba) -{ - const tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - i = i * mml->wScale; - j = j * mml->hScale; - - _mesa_texformat_rgba_dxt5.FetchTexel2D(texImage, i, j, k, rgba); -} - - -#if 0 /* break glass in case of emergency */ -static void -PrintTexture(int w, int h, int c, const GLubyte * data) -{ - int i, j; - for (i = 0; i < h; i++) { - for (j = 0; j < w; j++) { - if (c == 2) - fprintf(stderr, "%02x %02x ", data[0], data[1]); - else if (c == 3) - fprintf(stderr, "%02x %02x %02x ", data[0], data[1], data[2]); - data += c; - } - fprintf(stderr, "\n"); - } -} -#endif - - -gl_format -fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, - GLenum srcFormat, GLenum srcType ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLboolean allow32bpt = fxMesa->HaveTexFmt; - - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxDDChooseTextureFormat(...)\n"); - } - - switch (internalFormat) { - case GL_COMPRESSED_RGB: - /* intentional fall through */ - case 3: - case GL_RGB: - if ( srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5 ) { - return MESA_FORMAT_RGB565; - } - /* intentional fall through */ - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - return (allow32bpt) ? MESA_FORMAT_ARGB8888 - : MESA_FORMAT_RGB565; - case GL_RGBA2: - case GL_RGBA4: - return MESA_FORMAT_ARGB4444; - case GL_COMPRESSED_RGBA: - /* intentional fall through */ - case 4: - case GL_RGBA: - if ( srcFormat == GL_BGRA ) { - if ( srcType == GL_UNSIGNED_INT_8_8_8_8_REV ) { - return MESA_FORMAT_ARGB8888; - } - else if ( srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { - return MESA_FORMAT_ARGB4444; - } - else if ( srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { - return MESA_FORMAT_ARGB1555; - } - } - /* intentional fall through */ - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - return (allow32bpt) ? MESA_FORMAT_ARGB8888 - : MESA_FORMAT_ARGB4444; - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - case GL_COMPRESSED_INTENSITY: - return MESA_FORMAT_I8; - case 1: - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - case GL_COMPRESSED_LUMINANCE: - return MESA_FORMAT_L8; - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - case GL_COMPRESSED_ALPHA: - return MESA_FORMAT_A8; - case GL_COLOR_INDEX: - case GL_COLOR_INDEX1_EXT: - case GL_COLOR_INDEX2_EXT: - case GL_COLOR_INDEX4_EXT: - case GL_COLOR_INDEX8_EXT: - case GL_COLOR_INDEX12_EXT: - case GL_COLOR_INDEX16_EXT: - return MESA_FORMAT_CI8; - case 2: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - case GL_COMPRESSED_LUMINANCE_ALPHA: - return MESA_FORMAT_AL88; - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - return MESA_FORMAT_RGB565; - case GL_RGB5_A1: - return MESA_FORMAT_ARGB1555; - /* GL_EXT_texture_compression_s3tc */ - /* GL_S3_s3tc */ - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - case GL_RGB_S3TC: - case GL_RGB4_S3TC: - return MESA_FORMAT_RGB_DXT1; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return MESA_FORMAT_RGBA_DXT1; - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case GL_RGBA_S3TC: - case GL_RGBA4_S3TC: - return MESA_FORMAT_RGBA_DXT3; - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return MESA_FORMAT_RGBA_DXT5; - /* GL_3DFX_texture_compression_FXT1 */ - case GL_COMPRESSED_RGB_FXT1_3DFX: - return MESA_FORMAT_RGB_FXT1; - case GL_COMPRESSED_RGBA_FXT1_3DFX: - return MESA_FORMAT_RGBA_FXT1; - default: - _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat"); - return MESA_FORMAT_NONE; - } -} - - -static GrTextureFormat_t -fxGlideFormat(GLint mesaFormat) -{ - switch (mesaFormat) { - case MESA_FORMAT_I8: - return GR_TEXFMT_ALPHA_8; - case MESA_FORMAT_A8: - return GR_TEXFMT_ALPHA_8; - case MESA_FORMAT_L8: - return GR_TEXFMT_INTENSITY_8; - case MESA_FORMAT_CI8: - return GR_TEXFMT_P_8; - case MESA_FORMAT_AL88: - return GR_TEXFMT_ALPHA_INTENSITY_88; - case MESA_FORMAT_RGB565: - return GR_TEXFMT_RGB_565; - case MESA_FORMAT_ARGB4444: - return GR_TEXFMT_ARGB_4444; - case MESA_FORMAT_ARGB1555: - return GR_TEXFMT_ARGB_1555; - case MESA_FORMAT_ARGB8888: - return GR_TEXFMT_ARGB_8888; - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - return GR_TEXFMT_ARGB_CMP_FXT1; - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - return GR_TEXFMT_ARGB_CMP_DXT1; - case MESA_FORMAT_RGBA_DXT3: - return GR_TEXFMT_ARGB_CMP_DXT3; - case MESA_FORMAT_RGBA_DXT5: - return GR_TEXFMT_ARGB_CMP_DXT5; - default: - _mesa_problem(NULL, "Unexpected format in fxGlideFormat"); - return 0; - } -} - - -static FetchTexelFuncC -fxFetchFunction(GLint mesaFormat) -{ - switch (mesaFormat) { - case MESA_FORMAT_I8: - return &fetch_intensity8; - case MESA_FORMAT_A8: - return &fetch_alpha8; - case MESA_FORMAT_L8: - return &fetch_luminance8; - case MESA_FORMAT_CI8: - return &fetch_index8; - case MESA_FORMAT_AL88: - return &fetch_luminance8_alpha8; - case MESA_FORMAT_RGB565: - return &fetch_r5g6b5; - case MESA_FORMAT_ARGB4444: - return &fetch_r4g4b4a4; - case MESA_FORMAT_ARGB1555: - return &fetch_r5g5b5a1; - case MESA_FORMAT_ARGB8888: - return &fetch_a8r8g8b8; - case MESA_FORMAT_RGB_FXT1: - return &fetch_rgb_fxt1; - case MESA_FORMAT_RGBA_FXT1: - return &fetch_rgba_fxt1; - case MESA_FORMAT_RGB_DXT1: - return &fetch_rgb_dxt1; - case MESA_FORMAT_RGBA_DXT1: - return &fetch_rgba_dxt1; - case MESA_FORMAT_RGBA_DXT3: - return &fetch_rgba_dxt3; - case MESA_FORMAT_RGBA_DXT5: - return &fetch_rgba_dxt5; - default: - _mesa_problem(NULL, "Unexpected format in fxFetchFunction"); - return NULL; - } -} - - -static GLboolean -adjust2DRatio (GLcontext *ctx, - GLint xoffset, GLint yoffset, - GLint width, GLint height, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - tfxMipMapLevel *mml, - struct gl_texture_image *texImage, - GLint texelBytes, - GLint dstRowStride) -{ - const GLint newWidth = width * mml->wScale; - const GLint newHeight = height * mml->hScale; - GLvoid *tempImage; - - if (!_mesa_is_format_compressed(texImage->TexFormat)) { - GLubyte *destAddr; - - tempImage = MALLOC(width * height * texelBytes); - if (!tempImage) { - return GL_FALSE; - } - - _mesa_texstore(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, tempImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * texelBytes, /* dstRowStride */ - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); - - /* now rescale */ - /* compute address of dest subimage within the overal tex image */ - destAddr = (GLubyte *) texImage->Data - + (yoffset * mml->hScale * mml->width - + xoffset * mml->wScale) * texelBytes; - - _mesa_rescale_teximage2d(texelBytes, - width, - dstRowStride, /* dst stride */ - width, height, - newWidth, newHeight, - tempImage, destAddr); - } else { - const GLint rawBytes = 4; - GLvoid *rawImage = MALLOC(width * height * rawBytes); - - if (!rawImage) { - return GL_FALSE; - } - tempImage = MALLOC(newWidth * newHeight * rawBytes); - if (!tempImage) { - return GL_FALSE; - } - /* unpack image, apply transfer ops and store in rawImage */ - _mesa_texstore(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, rawImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * rawBytes, /* dstRowStride */ - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); - _mesa_rescale_teximage2d(rawBytes, - width, - newWidth * rawBytes, /* dst stride */ - width, height, /* src */ - newWidth, newHeight, /* dst */ - rawImage /*src*/, tempImage /*dst*/ ); - _mesa_texstore(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - newWidth, newHeight, 1, - GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); - FREE(rawImage); - } - - FREE(tempImage); - - return GL_TRUE; -} - - -void -fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, - GLint internalFormat, GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti; - tfxMipMapLevel *mml; - GLint texelBytes, dstRowStride; - - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxDDTexImage2D: id=%d int 0x%x format 0x%x type 0x%x %dx%d\n", - texObj->Name, texImage->InternalFormat, format, type, - texImage->Width, texImage->Height); - } - - if (!fxIsTexSupported(target, internalFormat, texImage)) { - _mesa_problem(NULL, "fx Driver: unsupported texture in fxDDTexImg()\n"); - return; - } - - if (!texObj->DriverData) { - texObj->DriverData = fxAllocTexObjData(fxMesa); - if (!texObj->DriverData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - return; - } - } - ti = fxTMGetTexInfo(texObj); - - if (!texImage->DriverData) { - texImage->DriverData = CALLOC(sizeof(tfxMipMapLevel)); - if (!texImage->DriverData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - return; - } - } - mml = FX_MIPMAP_DATA(texImage); - - fxTexGetInfo(width, height, NULL, NULL, NULL, NULL, - &mml->wScale, &mml->hScale); - - mml->width = width * mml->wScale; - mml->height = height * mml->hScale; - -#if FX_COMPRESS_S3TC_AS_FXT1_HACK - /* [koolsmoky] substitute FXT1 for DXTn and Legacy S3TC */ - if (!ctx->Mesa_DXTn && _mesa_is_format_compressed(texImage->TexFormat)) { - switch (internalFormat) { - case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - case GL_RGB_S3TC: - case GL_RGB4_S3TC: - internalFormat = GL_COMPRESSED_RGB_FXT1_3DFX; - break; - case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - case GL_RGBA_S3TC: - case GL_RGBA4_S3TC: - internalFormat = GL_COMPRESSED_RGBA_FXT1_3DFX; - } - texImage->InternalFormat = internalFormat; - } -#endif -#if FX_TC_NAPALM - if (fxMesa->type >= GR_SSTTYPE_Voodoo4) { - GLenum texNapalm = 0; - if (internalFormat == GL_COMPRESSED_RGB) { - texNapalm = GL_COMPRESSED_RGB_FXT1_3DFX; - } else if (internalFormat == GL_COMPRESSED_RGBA) { - texNapalm = GL_COMPRESSED_RGBA_FXT1_3DFX; - } - if (texNapalm) { - texImage->InternalFormat = internalFormat = texNapalm; - } - } -#endif - - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); - /*if (!fxMesa->HaveTexFmt) assert(texelBytes == 1 || texelBytes == 2);*/ - - mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat); - - /* allocate mipmap buffer */ - assert(!texImage->Data); - if (_mesa_is_format_compressed(texImage->TexFormat)) { - texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat, - mml->width, - mml->height, 1); - dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); - texImage->Data = malloc(texImage->CompressedSize); - } else { - dstRowStride = mml->width * texelBytes; - texImage->Data = malloc(mml->width * mml->height * texelBytes); - } - if (!texImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - return; - } - - if (pixels != NULL) { - if (mml->wScale != 1 || mml->hScale != 1) { - /* rescale image to overcome 1:8 aspect limitation */ - if (!adjust2DRatio(ctx, - 0, 0, - width, height, - format, type, pixels, - packing, - mml, - texImage, - texelBytes, - dstRowStride) - ) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); - return; - } - } - else { - /* no rescaling needed */ - /* unpack image, apply transfer ops and store in texImage->Data */ - _mesa_texstore(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - GLint mipWidth, mipHeight; - tfxMipMapLevel *mip; - struct gl_texture_image *mipImage; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - - assert(!_mesa_is_format_compressed(texImage->TexFormat)); - - while (level < texObj->MaxLevel && level < maxLevels - 1) { - mipWidth = width / 2; - if (!mipWidth) { - mipWidth = 1; - } - mipHeight = height / 2; - if (!mipHeight) { - mipHeight = 1; - } - if ((mipWidth == width) && (mipHeight == height)) { - break; - } - _mesa_TexImage2D(target, ++level, internalFormat, - mipWidth, mipHeight, border, - format, type, - NULL); - mipImage = _mesa_select_tex_image(ctx, texUnit, target, level); - mip = FX_MIPMAP_DATA(mipImage); - _mesa_halve2x2_teximage2d(ctx, - texImage, - texelBytes, - mml->width, mml->height, - texImage->Data, mipImage->Data); - texImage = mipImage; - mml = mip; - width = mipWidth; - height = mipHeight; - } - } - } - - ti->info.format = mml->glideFormat; - texImage->FetchTexelc = fxFetchFunction(texImage->TexFormat->MesaFormat); - - fxTexInvalidate(ctx, texObj); -} - - -void -fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti; - tfxMipMapLevel *mml; - GLint texelBytes, dstRowStride; - - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxDDTexSubImage2D: id=%d\n", texObj->Name); - } - - if (!texObj->DriverData) { - _mesa_problem(ctx, "problem in fxDDTexSubImage2D"); - return; - } - - ti = fxTMGetTexInfo(texObj); - assert(ti); - mml = FX_MIPMAP_DATA(texImage); - assert(mml); - - assert(texImage->Data); /* must have an existing texture image! */ - assert(texImage->_BaseFormat); - - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); - if (_mesa_is_format_compressed(texImage->TexFormat)) { - dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); - } else { - dstRowStride = mml->width * texelBytes; - } - - if (mml->wScale != 1 || mml->hScale != 1) { - /* need to rescale subimage to match mipmap level's rescale factors */ - if (!adjust2DRatio(ctx, - xoffset, yoffset, - width, height, - format, type, pixels, - packing, - mml, - texImage, - texelBytes, - dstRowStride) - ) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); - return; - } - } - else { - /* no rescaling needed */ - _mesa_texstore(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, (GLubyte *) texImage->Data, - xoffset, yoffset, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - GLint mipWidth, mipHeight; - tfxMipMapLevel *mip; - struct gl_texture_image *mipImage; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - - assert(!_mesa_is_format_compressed(texImage->TexFormat)); - - width = texImage->Width; - height = texImage->Height; - while (level < texObj->MaxLevel && level < maxLevels - 1) { - mipWidth = width / 2; - if (!mipWidth) { - mipWidth = 1; - } - mipHeight = height / 2; - if (!mipHeight) { - mipHeight = 1; - } - if ((mipWidth == width) && (mipHeight == height)) { - break; - } - ++level; - mipImage = _mesa_select_tex_image(ctx, texUnit, target, level); - mip = FX_MIPMAP_DATA(mipImage); - _mesa_halve2x2_teximage2d(ctx, - texImage, - texelBytes, - mml->width, mml->height, - texImage->Data, mipImage->Data); - texImage = mipImage; - mml = mip; - width = mipWidth; - height = mipHeight; - } - } - - if (ti->validated && ti->isInTM && !texObj->GenerateMipmap) - fxTMReloadMipMapLevel(fxMesa, texObj, level); - else - fxTexInvalidate(ctx, texObj); -} - - -void -fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti; - tfxMipMapLevel *mml; - - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxDDCompressedTexImage2D: id=%d int 0x%x %dx%d\n", - texObj->Name, internalFormat, - width, height); - } - - assert(_mesa_is_format_compressed(texImage->TexFormat)); - - if (!fxIsTexSupported(target, internalFormat, texImage)) { - _mesa_problem(NULL, "fx Driver: unsupported texture in fxDDCompressedTexImg()\n"); - return; - } - - if (!texObj->DriverData) { - texObj->DriverData = fxAllocTexObjData(fxMesa); - if (!texObj->DriverData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); - return; - } - } - ti = fxTMGetTexInfo(texObj); - - if (!texImage->DriverData) { - texImage->DriverData = CALLOC(sizeof(tfxMipMapLevel)); - if (!texImage->DriverData) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); - return; - } - } - mml = FX_MIPMAP_DATA(texImage); - - fxTexGetInfo(width, height, NULL, NULL, NULL, NULL, - &mml->wScale, &mml->hScale); - - mml->width = width * mml->wScale; - mml->height = height * mml->hScale; - - /* Determine the appropriate Glide texel format, - * given the user's internal texture format hint. - */ - mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat); - - /* allocate new storage for texture image, if needed */ - if (!texImage->Data) { - texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat, - mml->width, - mml->height, 1); - texImage->Data = malloc(texImage->CompressedSize); - if (!texImage->Data) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); - return; - } - } - - /* save the texture data */ - if (mml->wScale != 1 || mml->hScale != 1) { - /* [dBorca] Hack alert: - * now we're screwed. We can't decompress, - * unless we do it in HW (via textureBuffer). - * We still have some chances: - * 1) we got FXT1 textures - we CAN decompress, rescale for - * aspectratio, then compress back. - * 2) there is a chance that MIN("s", "t") won't be overflowed. - * Thus, we don't care about textureclamp and we could lower - * MIN("uscale", "vscale") below 32. We still have to have - * our data aligned inside a 8:1 rectangle. - * 3) just in case if MIN("s", "t") gets overflowed with GL_REPEAT, - * we replicate the data over the padded area. - * For now, we take 2) + 3) but texelfetchers will be wrong! - */ - GLuint srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); - - GLuint destRowStride = _mesa_format_row_stride(texImage->TexFormat, - mml->width); - - _mesa_upscale_teximage2d(srcRowStride, (height+3) / 4, - destRowStride, (mml->height+3) / 4, - 1, data, srcRowStride, - texImage->Data); - ti->padded = GL_TRUE; - } else { - memcpy(texImage->Data, data, texImage->CompressedSize); - } - - ti->info.format = mml->glideFormat; - texImage->FetchTexelc = fxFetchFunction(texImage->TexFormat->MesaFormat); - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - assert(!_mesa_is_format_compressed(texImage->TexFormat)); - } - - fxTexInvalidate(ctx, texObj); -} - - -void -fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target, - GLint level, GLint xoffset, - GLint yoffset, GLsizei width, - GLint height, GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti; - tfxMipMapLevel *mml; - GLint destRowStride, srcRowStride; - GLint i, rows; - GLubyte *dest; - - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxDDCompressedTexSubImage2D: id=%d\n", texObj->Name); - } - - ti = fxTMGetTexInfo(texObj); - assert(ti); - mml = FX_MIPMAP_DATA(texImage); - assert(mml); - - srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); - - destRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); - dest = _mesa_compressed_image_address(xoffset, yoffset, 0, - texImage->InternalFormat, - mml->width, - (GLubyte*) texImage->Data); - - rows = height / 4; /* hardcoded 4, but works for FXT1/DXTC */ - - for (i = 0; i < rows; i++) { - memcpy(dest, data, srcRowStride); - dest += destRowStride; - data = (GLvoid *)((GLuint)data + (GLuint)srcRowStride); - } - - /* [dBorca] Hack alert: - * see fxDDCompressedTexImage2D for caveats - */ - if (mml->wScale != 1 || mml->hScale != 1) { - srcRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); - - destRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); - _mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4, - destRowStride, mml->height / 4, - 1, texImage->Data, destRowStride, - texImage->Data); - } - - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - assert(!_mesa_is_format_compressed(texImage->TexFormat)); - } - - if (ti->validated && ti->isInTM) - fxTMReloadMipMapLevel(fxMesa, texObj, level); - else - fxTexInvalidate(ctx, texObj); -} - - -void -fxDDTexImage1D (GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, GLint width, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - fxDDTexImage2D(ctx, target, level, - internalFormat, width, 1, border, - format, type, pixels, - packing, - texObj, - texImage); -} - - -void -fxDDTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, - GLint xoffset, - GLsizei width, - GLenum format, GLenum type, const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - fxDDTexSubImage2D(ctx, target, level, - xoffset, 0, width, 1, - format, type, pixels, - packing, - texObj, - texImage); -} - - -GLboolean -fxDDTestProxyTexImage (GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLenum format, GLenum type, - GLint width, GLint height, - GLint depth, GLint border) -{ - /* XXX todo - maybe through fxTexValidate() */ - return _mesa_test_proxy_teximage(ctx, target, - level, internalFormat, - format, type, - width, height, - depth, border); -} - - -#else /* FX */ - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_ddtex(void); -int -gl_fx_dummy_function_ddtex(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h deleted file mode 100644 index bee10de2f4..0000000000 --- a/src/mesa/drivers/glide/fxdrv.h +++ /dev/null @@ -1,773 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - -/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */ - - -#ifndef FXDRV_H -#define FXDRV_H - -/* If you comment out this define, a variable takes its place, letting - * you turn debugging on/off from the debugger. - */ - -#include "glheader.h" - - -#if defined(__linux__) -#include -#endif - -#include "main/context.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/matrix.h" -#include "main/mtypes.h" - -#include "GL/fxmesa.h" -#include "fxglidew.h" - -#include "math/m_vector.h" - - -#define COPY_FLOAT(dst, src) (dst) = (src) - -/* Define some shorter names for these things. - */ -#define XCOORD GR_VERTEX_X_OFFSET -#define YCOORD GR_VERTEX_Y_OFFSET -#define ZCOORD GR_VERTEX_OOZ_OFFSET -#define OOWCOORD GR_VERTEX_OOW_OFFSET - -#define S0COORD GR_VERTEX_SOW_TMU0_OFFSET -#define T0COORD GR_VERTEX_TOW_TMU0_OFFSET -#define S1COORD GR_VERTEX_SOW_TMU1_OFFSET -#define T1COORD GR_VERTEX_TOW_TMU1_OFFSET - - - -#ifdef __i386__ -#define FXCOLOR4( c ) (* (int *)c) -#else -#define FXCOLOR4( c ) ( \ - ( ((unsigned int)(c[3]))<<24 ) | \ - ( ((unsigned int)(c[2]))<<16 ) | \ - ( ((unsigned int)(c[1]))<<8 ) | \ - ( (unsigned int)(c[0])) ) -#endif - -#define TDFXPACKCOLOR1555( r, g, b, a ) \ - ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ - ((a) ? 0x8000 : 0)) -#define TDFXPACKCOLOR565( r, g, b ) \ - ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) -#define TDFXPACKCOLOR8888( r, g, b, a ) \ - (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) - - - -/* fastpath flags first - */ -#define SETUP_TMU0 0x1 -#define SETUP_TMU1 0x2 -#define SETUP_RGBA 0x4 -#define SETUP_SNAP 0x8 -#define SETUP_XYZW 0x10 -#define SETUP_PTEX 0x20 -#define SETUP_PSIZ 0x40 -#define SETUP_SPEC 0x80 -#define SETUP_FOGC 0x100 -#define MAX_SETUP 0x200 - - -#define FX_NUM_TMU 2 - -#define FX_TMU0 GR_TMU0 -#define FX_TMU1 GR_TMU1 -#define FX_TMU_SPLIT 98 -#define FX_TMU_BOTH 99 -#define FX_TMU_NONE 100 - -/* Used for fxMesa->lastUnitsMode */ - -#define FX_UM_NONE 0x00000000 - -#define FX_UM_E0_REPLACE 0x00000001 -#define FX_UM_E0_MODULATE 0x00000002 -#define FX_UM_E0_DECAL 0x00000004 -#define FX_UM_E0_BLEND 0x00000008 -#define FX_UM_E0_ADD 0x00000010 - -#define FX_UM_E1_REPLACE 0x00000020 -#define FX_UM_E1_MODULATE 0x00000040 -#define FX_UM_E1_DECAL 0x00000080 -#define FX_UM_E1_BLEND 0x00000100 -#define FX_UM_E1_ADD 0x00000200 - -#define FX_UM_E_ENVMODE 0x000003ff - -#define FX_UM_E0_ALPHA 0x00001000 -#define FX_UM_E0_LUMINANCE 0x00002000 -#define FX_UM_E0_LUMINANCE_ALPHA 0x00004000 -#define FX_UM_E0_INTENSITY 0x00008000 -#define FX_UM_E0_RGB 0x00010000 -#define FX_UM_E0_RGBA 0x00020000 - -#define FX_UM_E1_ALPHA 0x00040000 -#define FX_UM_E1_LUMINANCE 0x00080000 -#define FX_UM_E1_LUMINANCE_ALPHA 0x00100000 -#define FX_UM_E1_INTENSITY 0x00200000 -#define FX_UM_E1_RGB 0x00400000 -#define FX_UM_E1_RGBA 0x00800000 - -#define FX_UM_E_IFMT 0x00fff000 - -#define FX_UM_COLOR_ITERATED 0x01000000 -#define FX_UM_COLOR_CONSTANT 0x02000000 -#define FX_UM_ALPHA_ITERATED 0x04000000 -#define FX_UM_ALPHA_CONSTANT 0x08000000 - - -/* for Voodoo3/Banshee's grColorCombine() and grAlphaCombine() */ -struct tdfx_combine { - GrCombineFunction_t Function; /* Combine function */ - GrCombineFactor_t Factor; /* Combine scale factor */ - GrCombineLocal_t Local; /* Local combine source */ - GrCombineOther_t Other; /* Other combine source */ - FxBool Invert; /* Combine result inversion flag */ -}; - -/* for Voodoo3's grTexCombine() */ -struct tdfx_texcombine { - GrCombineFunction_t FunctionRGB; - GrCombineFactor_t FactorRGB; - GrCombineFunction_t FunctionAlpha; - GrCombineFactor_t FactorAlpha; - FxBool InvertRGB; - FxBool InvertAlpha; -}; - - -/* for Voodoo5's grColorCombineExt() */ -struct tdfx_combine_color_ext { - GrCCUColor_t SourceA; - GrCombineMode_t ModeA; - GrCCUColor_t SourceB; - GrCombineMode_t ModeB; - GrCCUColor_t SourceC; - FxBool InvertC; - GrCCUColor_t SourceD; - FxBool InvertD; - FxU32 Shift; - FxBool Invert; -}; - -/* for Voodoo5's grAlphaCombineExt() */ -struct tdfx_combine_alpha_ext { - GrACUColor_t SourceA; - GrCombineMode_t ModeA; - GrACUColor_t SourceB; - GrCombineMode_t ModeB; - GrACUColor_t SourceC; - FxBool InvertC; - GrACUColor_t SourceD; - FxBool InvertD; - FxU32 Shift; - FxBool Invert; -}; - -/* for Voodoo5's grTexColorCombineExt() */ -struct tdfx_color_texenv { - GrTCCUColor_t SourceA; - GrCombineMode_t ModeA; - GrTCCUColor_t SourceB; - GrCombineMode_t ModeB; - GrTCCUColor_t SourceC; - FxBool InvertC; - GrTCCUColor_t SourceD; - FxBool InvertD; - FxU32 Shift; - FxBool Invert; -}; - -/* for Voodoo5's grTexAlphaCombineExt() */ -struct tdfx_alpha_texenv { - GrTACUColor_t SourceA; - GrCombineMode_t ModeA; - GrTACUColor_t SourceB; - GrCombineMode_t ModeB; - GrTACUColor_t SourceC; - FxBool InvertC; - GrTCCUColor_t SourceD; - FxBool InvertD; - FxU32 Shift; - FxBool Invert; -}; - -/* Voodoo5's texture combine environment */ -struct tdfx_texcombine_ext { - struct tdfx_alpha_texenv Alpha; - struct tdfx_color_texenv Color; - GrColor_t EnvColor; -}; - - -/* - Memory range from startAddr to endAddr-1 -*/ -typedef struct MemRange_t -{ - struct MemRange_t *next; - FxU32 startAddr, endAddr; -} -MemRange; - -typedef struct -{ - GLsizei width, height; /* image size */ - GLint wScale, hScale; /* image scale factor */ - GrTextureFormat_t glideFormat; /* Glide image format */ -} -tfxMipMapLevel; - -/* - * TDFX-specific texture object data. This hangs off of the - * struct gl_texture_object DriverData pointer. - */ -typedef struct tfxTexInfo_t -{ - struct tfxTexInfo_t *next; - struct gl_texture_object *tObj; - - GLuint lastTimeUsed; - FxU32 whichTMU; - GLboolean isInTM; - - MemRange *tm[FX_NUM_TMU]; - - GLint minLevel, maxLevel; - GLint baseLevelInternalFormat; - - GrTexInfo info; - - GrTextureFilterMode_t minFilt; - GrTextureFilterMode_t maxFilt; - FxBool LODblend; - - GrTextureClampMode_t sClamp; - GrTextureClampMode_t tClamp; - - GrMipMapMode_t mmMode; - - GLfloat sScale, tScale; - - GrTexTable_t paltype; - GuTexPalette palette; - - GLboolean fixedPalette; - GLboolean validated; - - GLboolean padded; -} -tfxTexInfo; - -typedef struct -{ - GLuint swapBuffer; - GLuint reqTexUpload; - GLuint texUpload; - GLuint memTexUpload; -} -tfxStats; - - - -typedef struct -{ - /* Alpha test */ - - GLboolean alphaTestEnabled; - GrCmpFnc_t alphaTestFunc; - GLfloat alphaTestRefValue; - - /* Blend function */ - - GLboolean blendEnabled; - GrAlphaBlendFnc_t blendSrcFuncRGB; - GrAlphaBlendFnc_t blendDstFuncRGB; - GrAlphaBlendFnc_t blendSrcFuncAlpha; - GrAlphaBlendFnc_t blendDstFuncAlpha; - GrAlphaBlendOp_t blendEqRGB; - GrAlphaBlendOp_t blendEqAlpha; - - /* Depth test */ - - GLboolean depthTestEnabled; - GLboolean depthMask; - GrCmpFnc_t depthTestFunc; - FxI32 depthBias; - - /* Stencil */ - - GLboolean stencilEnabled; - GrCmpFnc_t stencilFunction; /* Stencil function */ - GrStencil_t stencilRefValue; /* Stencil reference value */ - GrStencil_t stencilValueMask; /* Value mask */ - GrStencil_t stencilWriteMask; /* Write mask */ - GrCmpFnc_t stencilFailFunc; /* Stencil fail function */ - GrCmpFnc_t stencilZFailFunc; /* Stencil pass, depth fail function */ - GrCmpFnc_t stencilZPassFunc; /* Stencil pass, depth pass function */ - GrStencil_t stencilClear; /* Buffer clear value */ -} -tfxUnitsState; - - - - -/* Flags for fxMesa->new_state - */ -#define FX_NEW_TEXTURING 0x1 -#define FX_NEW_BLEND 0x2 -#define FX_NEW_ALPHA 0x4 -#define FX_NEW_DEPTH 0x8 -#define FX_NEW_FOG 0x10 -#define FX_NEW_SCISSOR 0x20 -#define FX_NEW_COLOR_MASK 0x40 -#define FX_NEW_CULL 0x80 -#define FX_NEW_STENCIL 0x100 - - -#define FX_CONTEXT(ctx) ((fxMesaContext)((ctx)->DriverCtx)) - -#define FX_TEXTURE_DATA(texUnit) fxTMGetTexInfo((texUnit)->_Current) - -#define fxTMGetTexInfo(o) ((tfxTexInfo*)((o)->DriverData)) - -#define FX_MIPMAP_DATA(img) ((tfxMipMapLevel *) (img)->DriverData) - -#define BEGIN_BOARD_LOCK() -#define END_BOARD_LOCK() -#define BEGIN_CLIP_LOOP() -#define END_CLIP_LOOP() - - - - -/* Covers the state referenced by IsInHardware: - */ -#define _FX_NEW_IS_IN_HARDWARE (_NEW_TEXTURE| \ - _NEW_HINT| \ - _NEW_STENCIL| \ - _NEW_BUFFERS| \ - _NEW_COLOR| \ - _NEW_LIGHT) - -/* Covers the state referenced by fxDDChooseRenderState - */ -#define _FX_NEW_RENDERSTATE (_FX_NEW_IS_IN_HARDWARE | \ - _DD_NEW_FLATSHADE | \ - _DD_NEW_TRI_LIGHT_TWOSIDE| \ - _DD_NEW_TRI_OFFSET | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_SMOOTH | \ - _DD_NEW_TRI_STIPPLE | \ - _DD_NEW_LINE_SMOOTH | \ - _DD_NEW_LINE_STIPPLE | \ - _DD_NEW_LINE_WIDTH | \ - _DD_NEW_POINT_SMOOTH | \ - _DD_NEW_POINT_SIZE | \ - _NEW_LINE) - - -/* Covers the state referenced by fxDDChooseSetupFunction. - */ -#define _FX_NEW_SETUP_FUNCTION (_NEW_LIGHT| \ - _NEW_FOG| \ - _NEW_TEXTURE| \ - _NEW_COLOR) \ - - -/* lookup table for scaling y bit colors up to 8 bits */ -extern GLuint FX_rgb_scale_4[16]; -extern GLuint FX_rgb_scale_5[32]; -extern GLuint FX_rgb_scale_6[64]; - -typedef void (*fx_tri_func) (fxMesaContext, GrVertex *, GrVertex *, GrVertex *); -typedef void (*fx_line_func) (fxMesaContext, GrVertex *, GrVertex *); -typedef void (*fx_point_func) (fxMesaContext, GrVertex *); - -struct tfxMesaContext -{ - GrTexTable_t glbPalType; - GuTexPalette glbPalette; - - GLcontext *glCtx; /* the core Mesa context */ - GLvisual *glVis; /* describes the color buffer */ - GLframebuffer *glBuffer; /* the ancillary buffers */ - - GLint board; /* the board used for this context */ - GLint width, height; /* size of color buffer */ - - GrBuffer_t currentFB; - - GLboolean bgrOrder; - GrColor_t color; - GrColor_t clearC; - GrAlpha_t clearA; - GLuint constColor; - GrCullMode_t cullMode; - - tfxUnitsState unitsState; - tfxUnitsState restoreUnitsState; /* saved during multipass */ - GLboolean multipass; /* true when drawing intermediate pass */ - - GLuint new_state; - GLuint new_gl_state; - - /* Texture Memory Manager Data - */ - GLuint texBindNumber; - GLint tmuSrc; - GLuint lastUnitsMode; - GLuint freeTexMem[FX_NUM_TMU]; - MemRange *tmPool; - MemRange *tmFree[FX_NUM_TMU]; - - GLenum fogTableMode; - GLfloat fogDensity; - GLfloat fogStart, fogEnd; - GrFog_t *fogTable; - GLint textureAlign; - GLint textureMaxLod; - - /* Vertex building and storage: - */ - GLuint tmu_source[FX_NUM_TMU]; - GLuint SetupIndex; - GLuint stw_hint_state; /* for grHints */ - GrVertex *verts; - GLboolean snapVertices; /* needed for older Voodoo hardware */ - - /* Rasterization: - */ - GLuint render_index; - GLuint fallback; - GLenum render_primitive; - GLenum raster_primitive; - - /* Current rasterization functions - */ - fx_point_func draw_point; - fx_line_func draw_line; - fx_tri_func draw_tri; - - - /* Keep texture scales somewhere handy: - */ - GLfloat s0scale; - GLfloat s1scale; - GLfloat t0scale; - GLfloat t1scale; - - GLfloat inv_s0scale; - GLfloat inv_s1scale; - GLfloat inv_t0scale; - GLfloat inv_t1scale; - - /* Glide stuff - */ - tfxStats stats; - void *state; - - /* Options */ - - GLboolean verbose; - GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */ - GLboolean haveHwAlpha; - GLboolean haveHwStencil; - GLboolean haveZBuffer; - GLboolean haveDoubleBuffer; - GLboolean haveGlobalPaletteTexture; - GLint swapInterval; - GLint maxPendingSwapBuffers; - - GrContext_t glideContext; - - int screen_width; - int screen_height; - int clipMinX; - int clipMaxX; - int clipMinY; - int clipMaxY; - - int colDepth; - GLboolean fsaa; - - /* Glide (per card) capabilities. These get mirrored - * from `glbHWConfig' when creating a new context... - */ - GrSstType type; - FxBool HavePalExt; /* PALETTE6666 */ - FxBool HavePixExt; /* PIXEXT */ - FxBool HaveTexFmt; /* TEXFMT */ - FxBool HaveCmbExt; /* COMBINE */ - FxBool HaveMirExt; /* TEXMIRROR */ - FxBool HaveTexUma; /* TEXUMA */ - FxBool HaveTexus2; /* Texus 2 - FXT1 */ - struct tdfx_glide Glide; - char rendererString[64]; -}; - - -extern void fxSetupFXUnits(GLcontext *); -extern void fxSetupDDPointers(GLcontext *); - -/* fxvb.c: - */ -extern void fxAllocVB(GLcontext * ctx); -extern void fxFreeVB(GLcontext * ctx); -extern void fxPrintSetupFlags(char *msg, GLuint flags ); -extern void fxCheckTexSizes( GLcontext *ctx ); -extern void fxBuildVertices( GLcontext *ctx, GLuint start, GLuint end, - GLuint newinputs ); -extern void fxChooseVertexState( GLcontext *ctx ); - - - - - - -/* fxtrifuncs: - */ -extern void fxDDInitTriFuncs(GLcontext *); -extern void fxDDChooseRenderState(GLcontext * ctx); - - -extern void fxUpdateDDSpanPointers(GLcontext *); -extern void fxSetupDDSpanPointers(GLcontext *); - -extern void fxPrintTextureData(tfxTexInfo * ti); - -extern const struct gl_texture_format * -fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, - GLenum srcFormat, GLenum srcType ); -extern void fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, - GLint internalFormat, GLint width, GLint height, - GLint border, GLenum format, GLenum type, - const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); -extern void fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); -extern void fxDDCompressedTexImage2D(GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLsizei width, GLsizei height, GLint border, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); -extern void fxDDCompressedTexSubImage2D(GLcontext *ctx, GLenum target, - GLint level, GLint xoffset, - GLint yoffset, GLsizei width, - GLint height, GLenum format, - GLsizei imageSize, const GLvoid *data, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); -extern void fxDDTexImage1D(GLcontext * ctx, GLenum target, GLint level, - GLint internalFormat, GLint width, - GLint border, GLenum format, GLenum type, - const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); -extern void fxDDTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, - GLint xoffset, GLint width, - GLenum format, GLenum type, - const GLvoid * pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage); -extern GLboolean fxDDTestProxyTexImage (GLcontext *ctx, GLenum target, - GLint level, GLint internalFormat, - GLenum format, GLenum type, - GLint width, GLint height, - GLint depth, GLint border); -extern void fxDDTexEnv(GLcontext *, GLenum, GLenum, const GLfloat *); -extern void fxDDTexParam(GLcontext *, GLenum, struct gl_texture_object *, - GLenum, const GLfloat *); -extern void fxDDTexBind(GLcontext *, GLenum, struct gl_texture_object *); -extern struct gl_texture_object *fxDDNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ); -extern void fxDDTexDel(GLcontext *, struct gl_texture_object *); -extern GLboolean fxDDIsTextureResident(GLcontext *, struct gl_texture_object *); -extern void fxDDTexPalette(GLcontext *, struct gl_texture_object *); -extern void fxDDTexUseGlbPalette(GLcontext *, GLboolean); - -extern void fxDDEnable(GLcontext *, GLenum, GLboolean); -extern void fxDDAlphaFunc(GLcontext *, GLenum, GLfloat); -extern void fxDDBlendFuncSeparate(GLcontext *, GLenum, GLenum, GLenum, GLenum); -extern void fxDDBlendEquationSeparate(GLcontext *, GLenum, GLenum); -extern void fxDDDepthMask(GLcontext *, GLboolean); -extern void fxDDDepthFunc(GLcontext *, GLenum); -extern void fxDDStencilFuncSeparate (GLcontext *ctx, GLenum face, GLenum func, GLint ref, GLuint mask); -extern void fxDDStencilMaskSeparate (GLcontext *ctx, GLenum face, GLuint mask); -extern void fxDDStencilOpSeparate (GLcontext *ctx, GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); - -extern void fxDDInitExtensions(GLcontext * ctx); - -extern void fxTMInit(fxMesaContext ctx); -extern void fxTMClose(fxMesaContext ctx); -extern void fxTMRestoreTextures_NoLock(fxMesaContext ctx); -extern void fxTMMoveInTM(fxMesaContext, struct gl_texture_object *, GLint); -extern void fxTMMoveOutTM(fxMesaContext, struct gl_texture_object *); -#define fxTMMoveOutTM_NoLock fxTMMoveOutTM -extern void fxTMFreeTexture(fxMesaContext, struct gl_texture_object *); -extern void fxTMReloadMipMapLevel(fxMesaContext, struct gl_texture_object *, - GLint); -extern void fxTMReloadSubMipMapLevel(fxMesaContext, - struct gl_texture_object *, GLint, GLint, - GLint); -extern int fxTMCheckStartAddr (fxMesaContext fxMesa, GLint tmu, tfxTexInfo *ti); - -extern void fxTexGetFormat(GLcontext *, GLenum, GrTextureFormat_t *, GLint *); /* [koolsmoky] */ - -extern int fxTexGetInfo(int, int, GrLOD_t *, GrAspectRatio_t *, - float *, float *, int *, int *); - -extern void fxDDScissor(GLcontext * ctx, - GLint x, GLint y, GLsizei w, GLsizei h); -extern void fxDDFogfv(GLcontext * ctx, GLenum pname, const GLfloat * params); -extern void fxDDColorMask(GLcontext * ctx, - GLboolean r, GLboolean g, GLboolean b, GLboolean a); - -extern void fxDDWriteDepthSpan(GLcontext * ctx, GLuint n, GLint x, GLint y, - const GLuint depth[], const GLubyte mask[]); - -extern void fxDDReadDepthSpan(GLcontext * ctx, GLuint n, GLint x, GLint y, - GLuint depth[]); - -extern void fxDDWriteDepthPixels(GLcontext * ctx, GLuint n, - const GLint x[], const GLint y[], - const GLuint depth[], const GLubyte mask[]); - -extern void fxDDReadDepthPixels(GLcontext * ctx, GLuint n, - const GLint x[], const GLint y[], - GLuint depth[]); - -extern void fxDDShadeModel(GLcontext * ctx, GLenum mode); - -extern void fxDDCullFace(GLcontext * ctx, GLenum mode); -extern void fxDDFrontFace(GLcontext * ctx, GLenum mode); - -extern void fxPrintRenderState(const char *msg, GLuint state); -extern void fxPrintHintState(const char *msg, GLuint state); - -extern int fxDDInitFxMesaContext(fxMesaContext fxMesa); -extern void fxDDDestroyFxMesaContext(fxMesaContext fxMesa); - - -extern void fxSetScissorValues(GLcontext * ctx); -extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa, - struct gl_texture_object *tObj, GLint where); - -extern void fxCheckIsInHardware(GLcontext *ctx); - -/* fxsetup: - * semi-private functions - */ -void fxSetupCull (GLcontext * ctx); -void fxSetupScissor (GLcontext * ctx); -void fxSetupColorMask (GLcontext * ctx); -void fxSetupBlend (GLcontext *ctx); -void fxSetupDepthTest (GLcontext *ctx); -void fxSetupTexture (GLcontext *ctx); -void fxSetupStencil (GLcontext *ctx); -void fxSetupStencilFace (GLcontext *ctx, GLint face); - -/* Flags for software fallback cases */ -#define FX_FALLBACK_TEXTURE_MAP 0x0001 -#define FX_FALLBACK_DRAW_BUFFER 0x0002 -#define FX_FALLBACK_SPECULAR 0x0004 -#define FX_FALLBACK_STENCIL 0x0008 -#define FX_FALLBACK_RENDER_MODE 0x0010 -#define FX_FALLBACK_LOGICOP 0x0020 -#define FX_FALLBACK_TEXTURE_ENV 0x0040 -#define FX_FALLBACK_TEXTURE_BORDER 0x0080 -#define FX_FALLBACK_COLORMASK 0x0100 -#define FX_FALLBACK_BLEND 0x0200 -#define FX_FALLBACK_TEXTURE_MULTI 0x0400 - -extern GLuint fx_check_IsInHardware(GLcontext *ctx); - -/*** - *** CNORM: clamp float to [0,1] and map to float in [0,255] - ***/ -#if defined(USE_IEEE) && !defined(DEBUG) -#define IEEE_0996 0x3f7f0000 /* 0.996 or so */ -#define CNORM(N, F) \ - do { \ - fi_type __tmp; \ - __tmp.f = (F); \ - if (__tmp.i < 0) \ - N = 0; \ - else if (__tmp.i >= IEEE_0996) \ - N = 255.0f; \ - else { \ - N = (F) * 255.0f; \ - } \ - } while (0) -#else -#define CNORM(n, f) \ - n = (CLAMP((f), 0.0F, 1.0F) * 255.0F) -#endif - -/* run-time debugging */ -#ifndef FX_DEBUG -#define FX_DEBUG 0 -#endif -#if FX_DEBUG -extern int TDFX_DEBUG; -#else -#define TDFX_DEBUG 0 -#endif - -/* dirty hacks */ -#define FX_RESCALE_BIG_TEXURES_HACK 1 -#define FX_COMPRESS_S3TC_AS_FXT1_HACK 1 - -#endif diff --git a/src/mesa/drivers/glide/fxg.c b/src/mesa/drivers/glide/fxg.c deleted file mode 100644 index afb9441ade..0000000000 --- a/src/mesa/drivers/glide/fxg.c +++ /dev/null @@ -1,2309 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Mesa/FX device driver. Interface to Glide3. - * - * Copyright (c) 2003 - Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#ifdef FX - -#include -#include -#include -#include - -#define FX_TRAP_GLIDE_internal -#include "fxg.h" - - - -/****************************************************************************\ -* logging * -\****************************************************************************/ -#if FX_TRAP_GLIDE -#define TRAP_LOG trp_printf -#ifdef __GNUC__ -__attribute__ ((format(printf, 1, 2))) -#endif /* __GNUC__ */ -int trp_printf (const char *format, ...) -{ - va_list arg; - int n; - FILE *trap_file; - va_start(arg, format); - trap_file = fopen("trap.log", "a"); - if (trap_file == NULL) { - trap_file = stderr; - } - n = vfprintf(trap_file, format, arg); - fclose(trap_file); - va_end(arg); - return n; -} -#else /* FX_TRAP_GLIDE */ -#ifdef __GNUC__ -#define TRAP_LOG(format, ...) do {} while (0) -#else /* __GNUC__ */ -#define TRAP_LOG 0 && (unsigned long) -#endif /* __GNUC__ */ -#endif /* FX_TRAP_GLIDE */ - - - -#if FX_TRAP_GLIDE -/****************************************************************************\ -* helpers * -\****************************************************************************/ - -#define GOT "\t" - -const char *TRP_BOOL (FxBool b) -{ - return b ? "FXTRUE" : "FXFALSE"; -} - -#define TRAP_CASE_STRING(name) case name: return #name -#define TRAP_NODEFAULT default: assert(0) - -const char *TRP_PARAM (FxU32 mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_PARAM_DISABLE); - TRAP_CASE_STRING(GR_PARAM_ENABLE); - TRAP_NODEFAULT; - } -} - -const char *TRP_VTX (FxU32 param) -{ - switch (param) { - TRAP_CASE_STRING(GR_PARAM_XY); - TRAP_CASE_STRING(GR_PARAM_Z); - TRAP_CASE_STRING(GR_PARAM_W); - TRAP_CASE_STRING(GR_PARAM_Q); - TRAP_CASE_STRING(GR_PARAM_FOG_EXT); - TRAP_CASE_STRING(GR_PARAM_A); - TRAP_CASE_STRING(GR_PARAM_RGB); - TRAP_CASE_STRING(GR_PARAM_PARGB); - TRAP_CASE_STRING(GR_PARAM_ST0); - TRAP_CASE_STRING(GR_PARAM_ST1); - TRAP_CASE_STRING(GR_PARAM_ST2); - TRAP_CASE_STRING(GR_PARAM_Q0); - TRAP_CASE_STRING(GR_PARAM_Q1); - TRAP_CASE_STRING(GR_PARAM_Q2); - TRAP_NODEFAULT; - } -} - -const char *TRP_ARRAY (FxU32 mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_POINTS); - TRAP_CASE_STRING(GR_LINE_STRIP); - TRAP_CASE_STRING(GR_LINES); - TRAP_CASE_STRING(GR_POLYGON); - TRAP_CASE_STRING(GR_TRIANGLE_STRIP); - TRAP_CASE_STRING(GR_TRIANGLE_FAN); - TRAP_CASE_STRING(GR_TRIANGLES); - TRAP_CASE_STRING(GR_TRIANGLE_STRIP_CONTINUE); - TRAP_CASE_STRING(GR_TRIANGLE_FAN_CONTINUE); - TRAP_NODEFAULT; - } -} - -const char *TRP_BUFFER (GrBuffer_t buffer) -{ - switch (buffer) { - TRAP_CASE_STRING(GR_BUFFER_FRONTBUFFER); - TRAP_CASE_STRING(GR_BUFFER_BACKBUFFER); - TRAP_CASE_STRING(GR_BUFFER_AUXBUFFER); - TRAP_CASE_STRING(GR_BUFFER_DEPTHBUFFER); - TRAP_CASE_STRING(GR_BUFFER_ALPHABUFFER); - TRAP_CASE_STRING(GR_BUFFER_TRIPLEBUFFER); - TRAP_CASE_STRING(GR_BUFFER_TEXTUREBUFFER_EXT); - TRAP_CASE_STRING(GR_BUFFER_TEXTUREAUXBUFFER_EXT); - TRAP_NODEFAULT; - } -} - -const char *TRP_ORIGIN (GrOriginLocation_t origin_location) -{ - switch (origin_location) { - TRAP_CASE_STRING(GR_ORIGIN_UPPER_LEFT); - TRAP_CASE_STRING(GR_ORIGIN_LOWER_LEFT); - TRAP_CASE_STRING(GR_ORIGIN_ANY); - TRAP_NODEFAULT; - } -} - -const char *TRP_REFRESH (GrScreenRefresh_t refresh_rate) -{ - switch (refresh_rate) { - TRAP_CASE_STRING(GR_REFRESH_60Hz); - TRAP_CASE_STRING(GR_REFRESH_70Hz); - TRAP_CASE_STRING(GR_REFRESH_72Hz); - TRAP_CASE_STRING(GR_REFRESH_75Hz); - TRAP_CASE_STRING(GR_REFRESH_80Hz); - TRAP_CASE_STRING(GR_REFRESH_90Hz); - TRAP_CASE_STRING(GR_REFRESH_100Hz); - TRAP_CASE_STRING(GR_REFRESH_85Hz); - TRAP_CASE_STRING(GR_REFRESH_120Hz); - TRAP_CASE_STRING(GR_REFRESH_NONE); - TRAP_NODEFAULT; - } -} - -const char *TRP_COLFMT (GrColorFormat_t color_format) -{ - switch (color_format) { - TRAP_CASE_STRING(GR_COLORFORMAT_ARGB); - TRAP_CASE_STRING(GR_COLORFORMAT_ABGR); - TRAP_CASE_STRING(GR_COLORFORMAT_RGBA); - TRAP_CASE_STRING(GR_COLORFORMAT_BGRA); - TRAP_NODEFAULT; - } -} - -const char *TRP_RESOLUTION (GrScreenResolution_t screen_resolution) -{ - switch (screen_resolution) { - TRAP_CASE_STRING(GR_RESOLUTION_320x200); - TRAP_CASE_STRING(GR_RESOLUTION_320x240); - TRAP_CASE_STRING(GR_RESOLUTION_400x256); - TRAP_CASE_STRING(GR_RESOLUTION_512x384); - TRAP_CASE_STRING(GR_RESOLUTION_640x200); - TRAP_CASE_STRING(GR_RESOLUTION_640x350); - TRAP_CASE_STRING(GR_RESOLUTION_640x400); - TRAP_CASE_STRING(GR_RESOLUTION_640x480); - TRAP_CASE_STRING(GR_RESOLUTION_800x600); - TRAP_CASE_STRING(GR_RESOLUTION_960x720); - TRAP_CASE_STRING(GR_RESOLUTION_856x480); - TRAP_CASE_STRING(GR_RESOLUTION_512x256); - TRAP_CASE_STRING(GR_RESOLUTION_1024x768); - TRAP_CASE_STRING(GR_RESOLUTION_1280x1024); - TRAP_CASE_STRING(GR_RESOLUTION_1600x1200); - TRAP_CASE_STRING(GR_RESOLUTION_400x300); - TRAP_CASE_STRING(GR_RESOLUTION_1152x864); - TRAP_CASE_STRING(GR_RESOLUTION_1280x960); - TRAP_CASE_STRING(GR_RESOLUTION_1600x1024); - TRAP_CASE_STRING(GR_RESOLUTION_1792x1344); - TRAP_CASE_STRING(GR_RESOLUTION_1856x1392); - TRAP_CASE_STRING(GR_RESOLUTION_1920x1440); - TRAP_CASE_STRING(GR_RESOLUTION_2048x1536); - TRAP_CASE_STRING(GR_RESOLUTION_2048x2048); - TRAP_CASE_STRING(GR_RESOLUTION_NONE); - TRAP_NODEFAULT; - } -} - -const char *TRP_BLEND (GrAlphaBlendFnc_t func) -{ - switch (func) { - TRAP_CASE_STRING(GR_BLEND_ZERO); - TRAP_CASE_STRING(GR_BLEND_SRC_ALPHA); - TRAP_CASE_STRING(GR_BLEND_SRC_COLOR); - /*TRAP_CASE_STRING(GR_BLEND_DST_COLOR); ==GR_BLEND_SRC_COLOR*/ - TRAP_CASE_STRING(GR_BLEND_DST_ALPHA); - TRAP_CASE_STRING(GR_BLEND_ONE); - TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SRC_ALPHA); - TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SRC_COLOR); - /*TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_DST_COLOR); ==GR_BLEND_ONE_MINUS_SRC_COLOR*/ - TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_DST_ALPHA); - TRAP_CASE_STRING(GR_BLEND_SAME_COLOR_EXT); - /*TRAP_CASE_STRING(GR_BLEND_RESERVED_8); ==GR_BLEND_SAME_COLOR_EXT*/ - TRAP_CASE_STRING(GR_BLEND_ONE_MINUS_SAME_COLOR_EXT); - /*TRAP_CASE_STRING(GR_BLEND_RESERVED_9); ==GR_BLEND_ONE_MINUS_SAME_COLOR_EXT*/ - TRAP_CASE_STRING(GR_BLEND_RESERVED_A); - TRAP_CASE_STRING(GR_BLEND_RESERVED_B); - TRAP_CASE_STRING(GR_BLEND_RESERVED_C); - TRAP_CASE_STRING(GR_BLEND_RESERVED_D); - TRAP_CASE_STRING(GR_BLEND_RESERVED_E); - TRAP_CASE_STRING(GR_BLEND_ALPHA_SATURATE); - /*TRAP_CASE_STRING(GR_BLEND_PREFOG_COLOR); ==GR_BLEND_ALPHA_SATURATE*/ - TRAP_NODEFAULT; - } -} - -const char *TRP_CMBFUNC (GrCombineFunction_t cfunc) -{ - switch (cfunc) { - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_ZERO); - /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_NONE); ==GR_COMBINE_FUNCTION_ZERO*/ - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_LOCAL); - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_LOCAL_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER); - /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND_OTHER); ==GR_COMBINE_FUNCTION_SCALE_OTHER*/ - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL); - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL); - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL); - /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND); ==GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL*/ - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL); - /*TRAP_CASE_STRING(GR_COMBINE_FUNCTION_BLEND_LOCAL); ==GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL*/ - TRAP_CASE_STRING(GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA); - TRAP_NODEFAULT; - } -} - -const char *TRP_CMBFACT (GrCombineFactor_t cfactor) -{ - switch (cfactor) { - TRAP_CASE_STRING(GR_COMBINE_FACTOR_ZERO); - /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_NONE); ==GR_COMBINE_FACTOR_ZERO*/ - TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOCAL); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_OTHER_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOCAL_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_TEXTURE_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_TEXTURE_RGB); - /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_DETAIL_FACTOR); ==GR_COMBINE_FACTOR_TEXTURE_ALPHA*/ - /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_LOD_FRACTION); ==GR_COMBINE_FACTOR_TEXTURE_RGB ???*/ - TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOCAL); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA); - TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA); - /*TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR); ==GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA*/ - TRAP_CASE_STRING(GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION); - TRAP_NODEFAULT; - } -} - -const char *TRP_CMBLOCAL (GrCombineLocal_t clocal) -{ - switch (clocal) { - TRAP_CASE_STRING(GR_COMBINE_LOCAL_ITERATED); - TRAP_CASE_STRING(GR_COMBINE_LOCAL_CONSTANT); - /*TRAP_CASE_STRING(GR_COMBINE_LOCAL_NONE); ==GR_COMBINE_LOCAL_CONSTANT*/ - TRAP_CASE_STRING(GR_COMBINE_LOCAL_DEPTH); - TRAP_NODEFAULT; - } -} - -const char *TRP_CMBOTHER (GrCombineOther_t cother) -{ - switch (cother) { - TRAP_CASE_STRING(GR_COMBINE_OTHER_ITERATED); - TRAP_CASE_STRING(GR_COMBINE_OTHER_TEXTURE); - TRAP_CASE_STRING(GR_COMBINE_OTHER_CONSTANT); - /*TRAP_CASE_STRING(GR_COMBINE_OTHER_NONE); ==GR_COMBINE_OTHER_CONSTANT*/ - TRAP_NODEFAULT; - } -} - -const char *TRP_CMPFUNC (GrCmpFnc_t function) -{ - switch (function) { - TRAP_CASE_STRING(GR_CMP_NEVER); - TRAP_CASE_STRING(GR_CMP_LESS); - TRAP_CASE_STRING(GR_CMP_EQUAL); - TRAP_CASE_STRING(GR_CMP_LEQUAL); - TRAP_CASE_STRING(GR_CMP_GREATER); - TRAP_CASE_STRING(GR_CMP_NOTEQUAL); - TRAP_CASE_STRING(GR_CMP_GEQUAL); - TRAP_CASE_STRING(GR_CMP_ALWAYS); - TRAP_NODEFAULT; - } -} - -const char *TRP_CKMODE (GrChromakeyMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_CHROMAKEY_DISABLE); - TRAP_CASE_STRING(GR_CHROMAKEY_ENABLE); - TRAP_NODEFAULT; - } -} - -const char *TRP_CULLMODE (GrCullMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_CULL_DISABLE); - TRAP_CASE_STRING(GR_CULL_NEGATIVE); - TRAP_CASE_STRING(GR_CULL_POSITIVE); - TRAP_NODEFAULT; - } -} - -const char *TRP_DEPTHMODE (GrDepthBufferMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_DEPTHBUFFER_DISABLE); - TRAP_CASE_STRING(GR_DEPTHBUFFER_ZBUFFER); - TRAP_CASE_STRING(GR_DEPTHBUFFER_WBUFFER); - TRAP_CASE_STRING(GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS); - TRAP_CASE_STRING(GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS); - TRAP_NODEFAULT; - } -} - -const char *TRP_DITHERMODE (GrDitherMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_DITHER_DISABLE); - TRAP_CASE_STRING(GR_DITHER_2x2); - TRAP_CASE_STRING(GR_DITHER_4x4); - TRAP_NODEFAULT; - } -} - -const char *TRP_FOGMODE (GrFogMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_FOG_DISABLE); - TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); - TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_Q); - /*TRAP_CASE_STRING(GR_FOG_WITH_TABLE_ON_W); ==GR_FOG_WITH_TABLE_ON_Q*/ - TRAP_CASE_STRING(GR_FOG_WITH_ITERATED_Z); - TRAP_CASE_STRING(GR_FOG_WITH_ITERATED_ALPHA_EXT); - TRAP_CASE_STRING(GR_FOG_MULT2); - TRAP_CASE_STRING(GR_FOG_ADD2); - TRAP_NODEFAULT; - } -} - -const char *TRP_GETNAME (FxU32 pname) -{ - switch (pname) { - TRAP_CASE_STRING(GR_BITS_DEPTH); - TRAP_CASE_STRING(GR_BITS_RGBA); - TRAP_CASE_STRING(GR_FIFO_FULLNESS); - TRAP_CASE_STRING(GR_FOG_TABLE_ENTRIES); - TRAP_CASE_STRING(GR_GAMMA_TABLE_ENTRIES); - TRAP_CASE_STRING(GR_GLIDE_STATE_SIZE); - TRAP_CASE_STRING(GR_GLIDE_VERTEXLAYOUT_SIZE); - TRAP_CASE_STRING(GR_IS_BUSY); - TRAP_CASE_STRING(GR_LFB_PIXEL_PIPE); - TRAP_CASE_STRING(GR_MAX_TEXTURE_SIZE); - TRAP_CASE_STRING(GR_MAX_TEXTURE_ASPECT_RATIO); - TRAP_CASE_STRING(GR_MEMORY_FB); - TRAP_CASE_STRING(GR_MEMORY_TMU); - TRAP_CASE_STRING(GR_MEMORY_UMA); - TRAP_CASE_STRING(GR_NUM_BOARDS); - TRAP_CASE_STRING(GR_NON_POWER_OF_TWO_TEXTURES); - TRAP_CASE_STRING(GR_NUM_FB); - TRAP_CASE_STRING(GR_NUM_SWAP_HISTORY_BUFFER); - TRAP_CASE_STRING(GR_NUM_TMU); - TRAP_CASE_STRING(GR_PENDING_BUFFERSWAPS); - TRAP_CASE_STRING(GR_REVISION_FB); - TRAP_CASE_STRING(GR_REVISION_TMU); - TRAP_CASE_STRING(GR_STATS_LINES); - TRAP_CASE_STRING(GR_STATS_PIXELS_AFUNC_FAIL); - TRAP_CASE_STRING(GR_STATS_PIXELS_CHROMA_FAIL); - TRAP_CASE_STRING(GR_STATS_PIXELS_DEPTHFUNC_FAIL); - TRAP_CASE_STRING(GR_STATS_PIXELS_IN); - TRAP_CASE_STRING(GR_STATS_PIXELS_OUT); - TRAP_CASE_STRING(GR_STATS_PIXELS); - TRAP_CASE_STRING(GR_STATS_POINTS); - TRAP_CASE_STRING(GR_STATS_TRIANGLES_IN); - TRAP_CASE_STRING(GR_STATS_TRIANGLES_OUT); - TRAP_CASE_STRING(GR_STATS_TRIANGLES); - TRAP_CASE_STRING(GR_SWAP_HISTORY); - TRAP_CASE_STRING(GR_SUPPORTS_PASSTHRU); - TRAP_CASE_STRING(GR_TEXTURE_ALIGN); - TRAP_CASE_STRING(GR_VIDEO_POSITION); - TRAP_CASE_STRING(GR_VIEWPORT); - TRAP_CASE_STRING(GR_WDEPTH_MIN_MAX); - TRAP_CASE_STRING(GR_ZDEPTH_MIN_MAX); - TRAP_CASE_STRING(GR_VERTEX_PARAMETER); - TRAP_CASE_STRING(GR_BITS_GAMMA); - TRAP_CASE_STRING(GR_GET_RESERVED_1); - TRAP_NODEFAULT; - } -} - -const char *TRP_GETSTRING (FxU32 pname) -{ - switch (pname) { - TRAP_CASE_STRING(GR_EXTENSION); - TRAP_CASE_STRING(GR_HARDWARE); - TRAP_CASE_STRING(GR_RENDERER); - TRAP_CASE_STRING(GR_VENDOR); - TRAP_CASE_STRING(GR_VERSION); - TRAP_NODEFAULT; - } -} - -const char *TRP_ENABLE (GrEnableMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_AA_ORDERED); - TRAP_CASE_STRING(GR_ALLOW_MIPMAP_DITHER); - TRAP_CASE_STRING(GR_PASSTHRU); - TRAP_CASE_STRING(GR_SHAMELESS_PLUG); - TRAP_CASE_STRING(GR_VIDEO_SMOOTHING); - TRAP_CASE_STRING(GR_TEXTURE_UMA_EXT); - TRAP_CASE_STRING(GR_STENCIL_MODE_EXT); - TRAP_CASE_STRING(GR_OPENGL_MODE_EXT); - TRAP_NODEFAULT; - } -} - -const char *TRP_COORD (GrCoordinateSpaceMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_WINDOW_COORDS); - TRAP_CASE_STRING(GR_CLIP_COORDS); - TRAP_NODEFAULT; - } -} - -const char *TRP_STIPPLEMODE (GrStippleMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_STIPPLE_DISABLE); - TRAP_CASE_STRING(GR_STIPPLE_PATTERN); - TRAP_CASE_STRING(GR_STIPPLE_ROTATE); - TRAP_NODEFAULT; - } -} - -const char *TRP_LODLEVEL (GrLOD_t lod) -{ - switch (lod) { - TRAP_CASE_STRING(GR_LOD_LOG2_2048); - TRAP_CASE_STRING(GR_LOD_LOG2_1024); - TRAP_CASE_STRING(GR_LOD_LOG2_512); - TRAP_CASE_STRING(GR_LOD_LOG2_256); - TRAP_CASE_STRING(GR_LOD_LOG2_128); - TRAP_CASE_STRING(GR_LOD_LOG2_64); - TRAP_CASE_STRING(GR_LOD_LOG2_32); - TRAP_CASE_STRING(GR_LOD_LOG2_16); - TRAP_CASE_STRING(GR_LOD_LOG2_8); - TRAP_CASE_STRING(GR_LOD_LOG2_4); - TRAP_CASE_STRING(GR_LOD_LOG2_2); - TRAP_CASE_STRING(GR_LOD_LOG2_1); - TRAP_NODEFAULT; - } -} - -const char *TRP_ASPECTRATIO (GrAspectRatio_t aspect) -{ - switch (aspect) { - TRAP_CASE_STRING(GR_ASPECT_LOG2_8x1); - TRAP_CASE_STRING(GR_ASPECT_LOG2_4x1); - TRAP_CASE_STRING(GR_ASPECT_LOG2_2x1); - TRAP_CASE_STRING(GR_ASPECT_LOG2_1x1); - TRAP_CASE_STRING(GR_ASPECT_LOG2_1x2); - TRAP_CASE_STRING(GR_ASPECT_LOG2_1x4); - TRAP_CASE_STRING(GR_ASPECT_LOG2_1x8); - TRAP_NODEFAULT; - } -} - -const char *TRP_TEXFMT (GrTextureFormat_t fmt) -{ - switch (fmt) { - TRAP_CASE_STRING(GR_TEXFMT_8BIT); - /*TRAP_CASE_STRING(GR_TEXFMT_RGB_332); ==GR_TEXFMT_8BIT*/ - TRAP_CASE_STRING(GR_TEXFMT_YIQ_422); - TRAP_CASE_STRING(GR_TEXFMT_ALPHA_8); - TRAP_CASE_STRING(GR_TEXFMT_INTENSITY_8); - TRAP_CASE_STRING(GR_TEXFMT_ALPHA_INTENSITY_44); - TRAP_CASE_STRING(GR_TEXFMT_P_8); - TRAP_CASE_STRING(GR_TEXFMT_RSVD0); - /*TRAP_CASE_STRING(GR_TEXFMT_P_8_6666); ==GR_TEXFMT_RSVD0*/ - /*TRAP_CASE_STRING(GR_TEXFMT_P_8_6666_EXT); ==GR_TEXFMT_RSVD0*/ - TRAP_CASE_STRING(GR_TEXFMT_RSVD1); - TRAP_CASE_STRING(GR_TEXFMT_16BIT); - /*TRAP_CASE_STRING(GR_TEXFMT_ARGB_8332); ==GR_TEXFMT_16BIT*/ - TRAP_CASE_STRING(GR_TEXFMT_AYIQ_8422); - TRAP_CASE_STRING(GR_TEXFMT_RGB_565); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_1555); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_4444); - TRAP_CASE_STRING(GR_TEXFMT_ALPHA_INTENSITY_88); - TRAP_CASE_STRING(GR_TEXFMT_AP_88); - TRAP_CASE_STRING(GR_TEXFMT_RSVD2); - /*TRAP_CASE_STRING(GR_TEXFMT_RSVD4); ==GR_TEXFMT_RSVD2*/ - TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_FXT1); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_8888); - TRAP_CASE_STRING(GR_TEXFMT_YUYV_422); - TRAP_CASE_STRING(GR_TEXFMT_UYVY_422); - TRAP_CASE_STRING(GR_TEXFMT_AYUV_444); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT1); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT2); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT3); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT4); - TRAP_CASE_STRING(GR_TEXFMT_ARGB_CMP_DXT5); - TRAP_CASE_STRING(GR_TEXTFMT_RGB_888); - TRAP_NODEFAULT; - } -} - -const char *TRP_EVENODD (FxU32 evenOdd) -{ - switch (evenOdd) { - TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_EVEN); - TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_ODD); - TRAP_CASE_STRING(GR_MIPMAPLEVELMASK_BOTH); - TRAP_NODEFAULT; - } -} - -const char *TRP_NCC (GrNCCTable_t table) -{ - switch (table) { - TRAP_CASE_STRING(GR_NCCTABLE_NCC0); - TRAP_CASE_STRING(GR_NCCTABLE_NCC1); - TRAP_NODEFAULT; - } -} - -const char *TRP_CLAMPMODE (GrTextureClampMode_t clampmode) -{ - switch (clampmode) { - TRAP_CASE_STRING(GR_TEXTURECLAMP_WRAP); - TRAP_CASE_STRING(GR_TEXTURECLAMP_CLAMP); - TRAP_CASE_STRING(GR_TEXTURECLAMP_MIRROR_EXT); - TRAP_NODEFAULT; - } -} - -const char *TRP_TEXFILTER (GrTextureFilterMode_t filter_mode) -{ - switch (filter_mode) { - TRAP_CASE_STRING(GR_TEXTUREFILTER_POINT_SAMPLED); - TRAP_CASE_STRING(GR_TEXTUREFILTER_BILINEAR); - TRAP_NODEFAULT; - } -} - -const char *TRP_TABLE (GrTexTable_t type) -{ - switch (type) { - TRAP_CASE_STRING(GR_TEXTABLE_NCC0); - TRAP_CASE_STRING(GR_TEXTABLE_NCC1); - TRAP_CASE_STRING(GR_TEXTABLE_PALETTE); - TRAP_CASE_STRING(GR_TEXTABLE_PALETTE_6666_EXT); - TRAP_NODEFAULT; - } -} - -const char *TRP_MIPMODE (GrMipMapMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_MIPMAP_DISABLE); - TRAP_CASE_STRING(GR_MIPMAP_NEAREST); - TRAP_CASE_STRING(GR_MIPMAP_NEAREST_DITHER); - TRAP_NODEFAULT; - } -} - -const char *TRP_TEXBASERANGE (GrTexBaseRange_t range) -{ - switch (range) { - TRAP_CASE_STRING(GR_TEXBASE_2048); - TRAP_CASE_STRING(GR_TEXBASE_1024); - TRAP_CASE_STRING(GR_TEXBASE_512); - TRAP_CASE_STRING(GR_TEXBASE_256_TO_1); - TRAP_CASE_STRING(GR_TEXBASE_256); - TRAP_CASE_STRING(GR_TEXBASE_128); - TRAP_CASE_STRING(GR_TEXBASE_64); - TRAP_CASE_STRING(GR_TEXBASE_32_TO_1); - TRAP_NODEFAULT; - } -} - -const char *TRP_LOCKTYPE (GrLock_t type) -{ - switch (type) { - TRAP_CASE_STRING(GR_LFB_READ_ONLY); - TRAP_CASE_STRING(GR_LFB_WRITE_ONLY); - /*TRAP_CASE_STRING(GR_LFB_IDLE); ==GR_LFB_READ_ONLY*/ - TRAP_CASE_STRING(GR_LFB_NOIDLE); - TRAP_CASE_STRING(GR_LFB_WRITE_ONLY_EXPLICIT_EXT); - TRAP_NODEFAULT; - } -} - -const char *TRP_WRITEMODE (GrLfbWriteMode_t writeMode) -{ - switch (writeMode) { - TRAP_CASE_STRING(GR_LFBWRITEMODE_565); - TRAP_CASE_STRING(GR_LFBWRITEMODE_555); - TRAP_CASE_STRING(GR_LFBWRITEMODE_1555); - TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED1); - TRAP_CASE_STRING(GR_LFBWRITEMODE_888); - TRAP_CASE_STRING(GR_LFBWRITEMODE_8888); - TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED2); - TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED3); - TRAP_CASE_STRING(GR_LFBWRITEMODE_Z32); - TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED5); - TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED6); - TRAP_CASE_STRING(GR_LFBWRITEMODE_RESERVED7); - TRAP_CASE_STRING(GR_LFBWRITEMODE_565_DEPTH); - TRAP_CASE_STRING(GR_LFBWRITEMODE_555_DEPTH); - TRAP_CASE_STRING(GR_LFBWRITEMODE_1555_DEPTH); - TRAP_CASE_STRING(GR_LFBWRITEMODE_ZA16); - TRAP_CASE_STRING(GR_LFBWRITEMODE_ANY); - TRAP_NODEFAULT; - } -} - -const char *TRP_SRCFMT (GrLfbSrcFmt_t src_format) -{ - switch (src_format) { - TRAP_CASE_STRING(GR_LFB_SRC_FMT_565); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_555); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_1555); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_888); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_8888); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_565_DEPTH); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_555_DEPTH); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_1555_DEPTH); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_ZA16); - TRAP_CASE_STRING(GR_LFB_SRC_FMT_RLE16); - TRAP_CASE_STRING(GR_LFBWRITEMODE_Z32); /*???*/ - TRAP_NODEFAULT; - } -} - -const char *TRP_CRMODE (GrChromaRangeMode_t mode) -{ - switch (mode) { - TRAP_CASE_STRING(GR_CHROMARANGE_DISABLE_EXT); - /*TRAP_CASE_STRING(GR_CHROMARANGE_RGB_ALL_EXT); ==GR_CHROMARANGE_DISABLE_EXT*/ - TRAP_CASE_STRING(GR_CHROMARANGE_ENABLE_EXT); - TRAP_NODEFAULT; - } -} - -const char *TRP_PIXFMT (GrPixelFormat_t pixelformat) -{ - switch (pixelformat) { - TRAP_CASE_STRING(GR_PIXFMT_I_8); - TRAP_CASE_STRING(GR_PIXFMT_AI_88); - TRAP_CASE_STRING(GR_PIXFMT_RGB_565); - TRAP_CASE_STRING(GR_PIXFMT_ARGB_1555); - TRAP_CASE_STRING(GR_PIXFMT_ARGB_8888); - TRAP_CASE_STRING(GR_PIXFMT_AA_2_RGB_565); - TRAP_CASE_STRING(GR_PIXFMT_AA_2_ARGB_1555); - TRAP_CASE_STRING(GR_PIXFMT_AA_2_ARGB_8888); - TRAP_CASE_STRING(GR_PIXFMT_AA_4_RGB_565); - TRAP_CASE_STRING(GR_PIXFMT_AA_4_ARGB_1555); - TRAP_CASE_STRING(GR_PIXFMT_AA_4_ARGB_8888); - TRAP_CASE_STRING(GR_PIXFMT_AA_8_RGB_565); - TRAP_CASE_STRING(GR_PIXFMT_AA_8_ARGB_1555); - TRAP_CASE_STRING(GR_PIXFMT_AA_8_ARGB_8888); - TRAP_NODEFAULT; - } -} - -const char *TRP_STENCILOP (GrStencilOp_t op) -{ - switch (op) { - TRAP_CASE_STRING(GR_STENCILOP_KEEP); - TRAP_CASE_STRING(GR_STENCILOP_ZERO); - TRAP_CASE_STRING(GR_STENCILOP_REPLACE); - TRAP_CASE_STRING(GR_STENCILOP_INCR_CLAMP); - TRAP_CASE_STRING(GR_STENCILOP_DECR_CLAMP); - TRAP_CASE_STRING(GR_STENCILOP_INVERT); - TRAP_CASE_STRING(GR_STENCILOP_INCR_WRAP); - TRAP_CASE_STRING(GR_STENCILOP_DECR_WRAP); - TRAP_NODEFAULT; - } -} - -const char *TRP_BLENDOP (GrAlphaBlendOp_t op) -{ - switch (op) { - TRAP_CASE_STRING(GR_BLEND_OP_ADD); - TRAP_CASE_STRING(GR_BLEND_OP_SUB); - TRAP_CASE_STRING(GR_BLEND_OP_REVSUB); - TRAP_NODEFAULT; - } -} - -const char *TRP_CU (GrCCUColor_t a) -{ - switch (a) { - TRAP_CASE_STRING(GR_CMBX_ZERO); - TRAP_CASE_STRING(GR_CMBX_TEXTURE_ALPHA); - TRAP_CASE_STRING(GR_CMBX_ALOCAL); - TRAP_CASE_STRING(GR_CMBX_AOTHER); - TRAP_CASE_STRING(GR_CMBX_B); - TRAP_CASE_STRING(GR_CMBX_CONSTANT_ALPHA); - TRAP_CASE_STRING(GR_CMBX_CONSTANT_COLOR); - TRAP_CASE_STRING(GR_CMBX_DETAIL_FACTOR); - TRAP_CASE_STRING(GR_CMBX_ITALPHA); - TRAP_CASE_STRING(GR_CMBX_ITRGB); - TRAP_CASE_STRING(GR_CMBX_LOCAL_TEXTURE_ALPHA); - TRAP_CASE_STRING(GR_CMBX_LOCAL_TEXTURE_RGB); - TRAP_CASE_STRING(GR_CMBX_LOD_FRAC); - TRAP_CASE_STRING(GR_CMBX_OTHER_TEXTURE_ALPHA); - TRAP_CASE_STRING(GR_CMBX_OTHER_TEXTURE_RGB); - TRAP_CASE_STRING(GR_CMBX_TEXTURE_RGB); - TRAP_CASE_STRING(GR_CMBX_TMU_CALPHA); - TRAP_CASE_STRING(GR_CMBX_TMU_CCOLOR); - TRAP_NODEFAULT; - } -} - -const char *TRP_CMBMODE (GrCombineMode_t a_mode) -{ - switch (a_mode) { - TRAP_CASE_STRING(GR_FUNC_MODE_ZERO); - TRAP_CASE_STRING(GR_FUNC_MODE_X); - TRAP_CASE_STRING(GR_FUNC_MODE_ONE_MINUS_X); - TRAP_CASE_STRING(GR_FUNC_MODE_NEGATIVE_X); - TRAP_CASE_STRING(GR_FUNC_MODE_X_MINUS_HALF); - TRAP_NODEFAULT; - } -} - -const char *TRP_TMU (GrChipID_t tmu) -{ - switch (tmu) { - TRAP_CASE_STRING(GR_TMU0); - TRAP_CASE_STRING(GR_TMU1); - TRAP_NODEFAULT; - } -} - -const char *TRP_TXDITHER (FxU32 dither) -{ - switch (dither) { - TRAP_CASE_STRING(TX_DITHER_NONE); - TRAP_CASE_STRING(TX_DITHER_4x4); - TRAP_CASE_STRING(TX_DITHER_ERR); - TRAP_NODEFAULT; - } -} - -const char *TRP_TXCOMPRESS (FxU32 compress) -{ - switch (compress) { - TRAP_CASE_STRING(TX_COMPRESSION_STATISTICAL); - TRAP_CASE_STRING(TX_COMPRESSION_HEURISTIC); - TRAP_NODEFAULT; - } -} - - - -/****************************************************************************\ -* REAL POINTERS * -\****************************************************************************/ - -/* -** glide extensions -*/ -void (FX_CALL *real_grSetNumPendingBuffers) (FxI32 NumPendingBuffers); -char * (FX_CALL *real_grGetRegistryOrEnvironmentStringExt) (char *theEntry); -void (FX_CALL *real_grGetGammaTableExt) (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); -void (FX_CALL *real_grChromaRangeModeExt) (GrChromakeyMode_t mode); -void (FX_CALL *real_grChromaRangeExt) (GrColor_t color, GrColor_t range, GrChromaRangeMode_t match_mode); -void (FX_CALL *real_grTexChromaModeExt) (GrChipID_t tmu, GrChromakeyMode_t mode); -void (FX_CALL *real_grTexChromaRangeExt) (GrChipID_t tmu, GrColor_t min, GrColor_t max, GrTexChromakeyMode_t mode); - -/* pointcast */ -void (FX_CALL *real_grTexDownloadTableExt) (GrChipID_t tmu, GrTexTable_t type, void *data); -void (FX_CALL *real_grTexDownloadTablePartialExt) (GrChipID_t tmu, GrTexTable_t type, void *data, int start, int end); -void (FX_CALL *real_grTexNCCTableExt) (GrChipID_t tmu, GrNCCTable_t table); - -/* tbext */ -void (FX_CALL *real_grTextureBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); -void (FX_CALL *real_grTextureAuxBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); -void (FX_CALL *real_grAuxBufferExt) (GrBuffer_t buffer); - -/* napalm */ -GrContext_t (FX_CALL *real_grSstWinOpenExt) (FxU32 hWnd, GrScreenResolution_t resolution, GrScreenRefresh_t refresh, GrColorFormat_t format, GrOriginLocation_t origin, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers); -void (FX_CALL *real_grStencilFuncExt) (GrCmpFnc_t fnc, GrStencil_t ref, GrStencil_t mask); -void (FX_CALL *real_grStencilMaskExt) (GrStencil_t value); -void (FX_CALL *real_grStencilOpExt) (GrStencilOp_t stencil_fail, GrStencilOp_t depth_fail, GrStencilOp_t depth_pass); -void (FX_CALL *real_grLfbConstantStencilExt) (GrStencil_t value); -void (FX_CALL *real_grBufferClearExt) (GrColor_t color, GrAlpha_t alpha, FxU32 depth, GrStencil_t stencil); -void (FX_CALL *real_grColorCombineExt) (GrCCUColor_t a, GrCombineMode_t a_mode, GrCCUColor_t b, GrCombineMode_t b_mode, GrCCUColor_t c, FxBool c_invert, GrCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); -void (FX_CALL *real_grAlphaCombineExt) (GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); -void (FX_CALL *real_grTexColorCombineExt) (GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); -void (FX_CALL *real_grTexAlphaCombineExt) (GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); -void (FX_CALL *real_grConstantColorValueExt) (GrChipID_t tmu, GrColor_t value); -void (FX_CALL *real_grColorMaskExt) (FxBool r, FxBool g, FxBool b, FxBool a); -void (FX_CALL *real_grAlphaBlendFunctionExt) (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendOp_t rgb_op, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df, GrAlphaBlendOp_t alpha_op); -void (FX_CALL *real_grTBufferWriteMaskExt) (FxU32 tmask); - -/* -** texus -*/ -void (FX_CALL *real_txImgQuantize) (char *dst, char *src, int w, int h, FxU32 format, FxU32 dither); -void (FX_CALL *real_txMipQuantize) (TxMip *pxMip, TxMip *txMip, int fmt, FxU32 d, FxU32 comp); -void (FX_CALL *real_txPalToNcc) (GuNccTable *ncc_table, const FxU32 *pal); - - - -/****************************************************************************\ -* DEBUG HOOKS * -\****************************************************************************/ - -/* -** rendering functions -*/ -void FX_CALL trap_grDrawPoint (const void *pt) -{ -#define FN_NAME "grDrawPoint" - TRAP_LOG("%s(%p)\n", FN_NAME, pt); - grDrawPoint(pt); -#undef FN_NAME -} - -void FX_CALL trap_grDrawLine (const void *v1, - const void *v2) -{ -#define FN_NAME "grDrawLine" - TRAP_LOG("%s(%p, %p)\n", FN_NAME, v1, v2); - grDrawLine(v1, v2); -#undef FN_NAME -} - -void FX_CALL trap_grDrawTriangle (const void *a, - const void *b, - const void *c) -{ -#define FN_NAME "grDrawTriangle" - TRAP_LOG("%s(%p, %p, %p)\n", FN_NAME, a, b, c); - grDrawTriangle(a, b, c); -#undef FN_NAME -} - -void FX_CALL trap_grVertexLayout (FxU32 param, - FxI32 offset, - FxU32 mode) -{ -#define FN_NAME "grVertexLayout" - TRAP_LOG("%s(%s, %ld, %s)\n", FN_NAME, TRP_VTX(param), offset, TRP_PARAM(mode)); - grVertexLayout(param, offset, mode); -#undef FN_NAME -} - -void FX_CALL trap_grDrawVertexArray (FxU32 mode, - FxU32 Count, - void *pointers) -{ -#define FN_NAME "grDrawVertexArray" - TRAP_LOG("%s(%s, %lu, %p)\n", FN_NAME, TRP_ARRAY(mode), Count, pointers); - grDrawVertexArray(mode, Count, pointers); -#undef FN_NAME -} - -void FX_CALL trap_grDrawVertexArrayContiguous (FxU32 mode, - FxU32 Count, - void *pointers, - FxU32 stride) -{ -#define FN_NAME "grDrawVertexArrayContiguous" - TRAP_LOG("%s(%s, %lu, %p, %lu)\n", FN_NAME, TRP_ARRAY(mode), Count, pointers, stride); - grDrawVertexArrayContiguous(mode, Count, pointers, stride); -#undef FN_NAME -} - -/* -** Antialiasing Functions -*/ -void FX_CALL trap_grAADrawTriangle (const void *a, - const void *b, - const void *c, - FxBool ab_antialias, - FxBool bc_antialias, - FxBool ca_antialias) -{ -#define FN_NAME "grAADrawTriangle" - TRAP_LOG("%s(%p, %p, %p, %s, %s, %s)\n", FN_NAME, a, b, c, TRP_BOOL(ab_antialias), TRP_BOOL(bc_antialias), TRP_BOOL(ca_antialias)); - grAADrawTriangle(a, b, c, ab_antialias, bc_antialias, ca_antialias); -#undef FN_NAME -} - -/* -** buffer management -*/ -void FX_CALL trap_grBufferClear (GrColor_t color, - GrAlpha_t alpha, - FxU32 depth) -{ -#define FN_NAME "grBufferClear" - TRAP_LOG("%s(%08lx, %02x, %08lx)\n", FN_NAME, color, alpha, depth); - grBufferClear(color, alpha, depth); -#undef FN_NAME -} - -void FX_CALL trap_grBufferSwap (FxU32 swap_interval) -{ -#define FN_NAME "grBufferSwap" - TRAP_LOG("%s(%lu)\n", FN_NAME, swap_interval); - grBufferSwap(swap_interval); -#undef FN_NAME -} - -void FX_CALL trap_grRenderBuffer (GrBuffer_t buffer) -{ -#define FN_NAME "grRenderBuffer" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BUFFER(buffer)); - grRenderBuffer(buffer); -#undef FN_NAME -} - -/* -** error management -*/ -void FX_CALL trap_grErrorSetCallback (GrErrorCallbackFnc_t fnc) -{ -#define FN_NAME "grErrorSetCallback" - TRAP_LOG("%s(%p)\n", FN_NAME, (void *)fnc); - grErrorSetCallback(fnc); -#undef FN_NAME -} - -/* -** SST routines -*/ -void FX_CALL trap_grFinish (void) -{ -#define FN_NAME "grFinish" - TRAP_LOG("%s()\n", FN_NAME); - grFinish(); -#undef FN_NAME -} - -void FX_CALL trap_grFlush (void) -{ -#define FN_NAME "grFlush" - TRAP_LOG("%s()\n", FN_NAME); - grFlush(); -#undef FN_NAME -} - -GrContext_t FX_CALL trap_grSstWinOpen (FxU32 hWnd, - GrScreenResolution_t screen_resolution, - GrScreenRefresh_t refresh_rate, - GrColorFormat_t color_format, - GrOriginLocation_t origin_location, - int nColBuffers, - int nAuxBuffers) -{ -#define FN_NAME "grSstWinOpen" - GrContext_t rv; - TRAP_LOG("%s(%08lx, %s, %s, %s, %s, %d, %d)\n", FN_NAME, hWnd, TRP_RESOLUTION(screen_resolution), TRP_REFRESH(refresh_rate), TRP_COLFMT(color_format), TRP_ORIGIN(origin_location), nColBuffers, nAuxBuffers); - rv = grSstWinOpen(hWnd, screen_resolution, refresh_rate, color_format, origin_location, nColBuffers, nAuxBuffers); - TRAP_LOG(GOT "%p\n", (void *)rv); - return rv; -#undef FN_NAME -} - -FxBool FX_CALL trap_grSstWinClose (GrContext_t context) -{ -#define FN_NAME "grSstWinClose" - FxBool rv; - TRAP_LOG("%s(%p)\n", FN_NAME, (void *)context); - rv = grSstWinClose(context); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -FxBool FX_CALL trap_grSelectContext (GrContext_t context) -{ -#define FN_NAME "grSelectContext" - FxBool rv; - TRAP_LOG("%s(%p)\n", FN_NAME, (void *)context); - rv = grSelectContext(context); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -void FX_CALL trap_grSstOrigin (GrOriginLocation_t origin) -{ -#define FN_NAME "grSstOrigin" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ORIGIN(origin)); - grSstOrigin(origin); -#undef FN_NAME -} - -void FX_CALL trap_grSstSelect (int which_sst) -{ -#define FN_NAME "grSstSelect" - TRAP_LOG("%s(%d)\n", FN_NAME, which_sst); - grSstSelect(which_sst); -#undef FN_NAME -} - -/* -** Glide configuration and special effect maintenance functions -*/ -void FX_CALL trap_grAlphaBlendFunction (GrAlphaBlendFnc_t rgb_sf, - GrAlphaBlendFnc_t rgb_df, - GrAlphaBlendFnc_t alpha_sf, - GrAlphaBlendFnc_t alpha_df) -{ -#define FN_NAME "grAlphaBlendFunction" - TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_BLEND(rgb_sf), TRP_BLEND(rgb_df), TRP_BLEND(alpha_sf), TRP_BLEND(alpha_df)); - grAlphaBlendFunction(rgb_sf, rgb_df, alpha_sf, alpha_df); -#undef FN_NAME -} - -void FX_CALL trap_grAlphaCombine (GrCombineFunction_t function, - GrCombineFactor_t factor, - GrCombineLocal_t local, - GrCombineOther_t other, - FxBool invert) -{ -#define FN_NAME "grAlphaCombine" - TRAP_LOG("%s(%s, %s, %s, %s, %s)\n", FN_NAME, TRP_CMBFUNC(function), TRP_CMBFACT(factor), TRP_CMBLOCAL(local), TRP_CMBOTHER(other), TRP_BOOL(invert)); - grAlphaCombine(function, factor, local, other, invert); -#undef FN_NAME -} - -void FX_CALL trap_grAlphaControlsITRGBLighting (FxBool enable) -{ -#define FN_NAME "grAlphaControlsITRGBLighting" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BOOL(enable)); - grAlphaControlsITRGBLighting(enable); -#undef FN_NAME -} - -void FX_CALL trap_grAlphaTestFunction (GrCmpFnc_t function) -{ -#define FN_NAME "grAlphaTestFunction" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CMPFUNC(function)); - grAlphaTestFunction(function); -#undef FN_NAME -} - -void FX_CALL trap_grAlphaTestReferenceValue (GrAlpha_t value) -{ -#define FN_NAME "grAlphaTestReferenceValue" - TRAP_LOG("%s(%02x)\n", FN_NAME, value); - grAlphaTestReferenceValue(value); -#undef FN_NAME -} - -void FX_CALL trap_grChromakeyMode (GrChromakeyMode_t mode) -{ -#define FN_NAME "grChromakeyMode" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CKMODE(mode)); - grChromakeyMode(mode); -#undef FN_NAME -} - -void FX_CALL trap_grChromakeyValue (GrColor_t value) -{ -#define FN_NAME "grChromakeyValue" - TRAP_LOG("%s(%08lx)\n", FN_NAME, value); - grChromakeyValue(value); -#undef FN_NAME -} - -void FX_CALL trap_grClipWindow (FxU32 minx, - FxU32 miny, - FxU32 maxx, - FxU32 maxy) -{ -#define FN_NAME "grClipWindow" - TRAP_LOG("%s(%lu, %lu, %lu, %lu)\n", FN_NAME, minx, miny, maxx, maxy); - grClipWindow(minx, miny, maxx, maxy); -#undef FN_NAME -} - -void FX_CALL trap_grColorCombine (GrCombineFunction_t function, - GrCombineFactor_t factor, - GrCombineLocal_t local, - GrCombineOther_t other, - FxBool invert) -{ -#define FN_NAME "grColorCombine" - TRAP_LOG("%s(%s, %s, %s, %s, %s)\n", FN_NAME, TRP_CMBFUNC(function), TRP_CMBFACT(factor), TRP_CMBLOCAL(local), TRP_CMBOTHER(other), TRP_BOOL(invert)); - grColorCombine(function, factor, local, other, invert); -#undef FN_NAME -} - -void FX_CALL trap_grColorMask (FxBool rgb, - FxBool a) -{ -#define FN_NAME "grColorMask" - TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_BOOL(rgb), TRP_BOOL(a)); - grColorMask(rgb, a); -#undef FN_NAME -} - -void FX_CALL trap_grCullMode (GrCullMode_t mode) -{ -#define FN_NAME "grCullMode" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CULLMODE(mode)); - grCullMode(mode); -#undef FN_NAME -} - -void FX_CALL trap_grConstantColorValue (GrColor_t value) -{ -#define FN_NAME "grConstantColorValue" - TRAP_LOG("%s(%08lx)\n", FN_NAME, value); - grConstantColorValue(value); -#undef FN_NAME -} - -void FX_CALL trap_grDepthBiasLevel (FxI32 level) -{ -#define FN_NAME "grDepthBiasLevel" - TRAP_LOG("%s(%ld)\n", FN_NAME, level); - grDepthBiasLevel(level); -#undef FN_NAME -} - -void FX_CALL trap_grDepthBufferFunction (GrCmpFnc_t function) -{ -#define FN_NAME "grDepthBufferFunction" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CMPFUNC(function)); - grDepthBufferFunction(function); -#undef FN_NAME -} - -void FX_CALL trap_grDepthBufferMode (GrDepthBufferMode_t mode) -{ -#define FN_NAME "grDepthBufferMode" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_DEPTHMODE(mode)); - grDepthBufferMode(mode); -#undef FN_NAME -} - -void FX_CALL trap_grDepthMask (FxBool mask) -{ -#define FN_NAME "grDepthMask" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BOOL(mask)); - grDepthMask(mask); -#undef FN_NAME -} - -void FX_CALL trap_grDisableAllEffects (void) -{ -#define FN_NAME "grDisableAllEffects" - TRAP_LOG("%s()\n", FN_NAME); - grDisableAllEffects(); -#undef FN_NAME -} - -void FX_CALL trap_grDitherMode (GrDitherMode_t mode) -{ -#define FN_NAME "grDitherMode" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_DITHERMODE(mode)); - grDitherMode(mode); -#undef FN_NAME -} - -void FX_CALL trap_grFogColorValue (GrColor_t fogcolor) -{ -#define FN_NAME "grFogColorValue" - TRAP_LOG("%s(%08lx)\n", FN_NAME, fogcolor); - grFogColorValue(fogcolor); -#undef FN_NAME -} - -void FX_CALL trap_grFogMode (GrFogMode_t mode) -{ -#define FN_NAME "grFogMode" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_FOGMODE(mode)); - grFogMode(mode); -#undef FN_NAME -} - -void FX_CALL trap_grFogTable (const GrFog_t ft[]) -{ -#define FN_NAME "grFogTable" - TRAP_LOG("%s(%p)\n", FN_NAME, ft); - grFogTable(ft); -#undef FN_NAME -} - -void FX_CALL trap_grLoadGammaTable (FxU32 nentries, - FxU32 *red, - FxU32 *green, - FxU32 *blue) -{ -#define FN_NAME "grLoadGammaTable" - TRAP_LOG("%s(%lu, %p, %p, %p)\n", FN_NAME, nentries, (void *)red, (void *)green, (void *)blue); - grLoadGammaTable(nentries, red, green, blue); -#undef FN_NAME -} - -void FX_CALL trap_grSplash (float x, - float y, - float width, - float height, - FxU32 frame) -{ -#define FN_NAME "grSplash" - TRAP_LOG("%s(%f, %f, %f, %f, %lu)\n", FN_NAME, x, y, width, height, frame); - grSplash(x, y, width, height, frame); -#undef FN_NAME -} - -FxU32 FX_CALL trap_grGet (FxU32 pname, - FxU32 plength, - FxI32 *params) -{ -#define FN_NAME "grGet" - FxU32 rv, i; - TRAP_LOG("%s(%s, %lu, %p)\n", FN_NAME, TRP_GETNAME(pname), plength, (void *)params); - rv = grGet(pname, plength, params); - TRAP_LOG(GOT "["); - for (i = 0; i < (rv/sizeof(FxI32)); i++) { - TRAP_LOG("%s%ld", i ? ", " : "", params[i]); - } - TRAP_LOG("]\n"); - return rv; -#undef FN_NAME -} - -const char *FX_CALL trap_grGetString (FxU32 pname) -{ -#define FN_NAME "grGetString" - const char *rv; - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_GETSTRING(pname)); - rv = grGetString(pname); - if (rv) { - TRAP_LOG(GOT "\"%s\"\n", rv); - } else { - TRAP_LOG(GOT "NULL\n"); - } - return rv; -#undef FN_NAME -} - -FxI32 FX_CALL trap_grQueryResolutions (const GrResolution *resTemplate, - GrResolution *output) -{ -#define FN_NAME "grQueryResolutions" - FxI32 rv; - TRAP_LOG("%s(%p, %p)\n", FN_NAME, (void *)resTemplate, (void *)output); - rv = grQueryResolutions(resTemplate, output); - TRAP_LOG(GOT "%ld\n", rv); - return rv; -#undef FN_NAME -} - -FxBool FX_CALL trap_grReset (FxU32 what) -{ -#define FN_NAME "grReset" - FxBool rv; - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_GETNAME(what)); - rv = grReset(what); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -GrProc FX_CALL trap_grGetProcAddress (char *procName) -{ -#define FN_NAME "grGetProcAddress" - GrProc rv; - TRAP_LOG("%s(%s)\n", FN_NAME, procName); - rv = grGetProcAddress(procName); - TRAP_LOG(GOT "%p\n", (void *)rv); - return rv; -#undef FN_NAME -} - -void FX_CALL trap_grEnable (GrEnableMode_t mode) -{ -#define FN_NAME "grEnable" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ENABLE(mode)); - grEnable(mode); -#undef FN_NAME -} - -void FX_CALL trap_grDisable (GrEnableMode_t mode) -{ -#define FN_NAME "grDisable" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_ENABLE(mode)); - grDisable(mode); -#undef FN_NAME -} - -void FX_CALL trap_grCoordinateSpace (GrCoordinateSpaceMode_t mode) -{ -#define FN_NAME "grCoordinateSpace" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_COORD(mode)); - grCoordinateSpace(mode); -#undef FN_NAME -} - -void FX_CALL trap_grDepthRange (FxFloat n, - FxFloat f) -{ -#define FN_NAME "grDepthRange" - TRAP_LOG("%s(%f, %f)\n", FN_NAME, n, f); - grDepthRange(n, f); -#undef FN_NAME -} - -void FX_CALL trap_grStippleMode (GrStippleMode_t mode) -{ -#define FN_NAME "grStippleMode" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_STIPPLEMODE(mode)); - grStippleMode(mode); /* some Glide libs don't have it; not used anyway */ -#undef FN_NAME -} - -void FX_CALL trap_grStipplePattern (GrStipplePattern_t mode) -{ -#define FN_NAME "grStipplePattern" - TRAP_LOG("%s(%08lx)\n", FN_NAME, mode); - grStipplePattern(mode); /* some Glide libs don't have it; not used anyway */ -#undef FN_NAME -} - -void FX_CALL trap_grViewport (FxI32 x, - FxI32 y, - FxI32 width, - FxI32 height) -{ -#define FN_NAME "grViewport" - TRAP_LOG("%s(%ld, %ld, %ld, %ld)\n", FN_NAME, x, y, width, height); - grViewport(x, y, width, height); -#undef FN_NAME -} - -/* -** texture mapping control functions -*/ -FxU32 FX_CALL trap_grTexCalcMemRequired (GrLOD_t lodmin, - GrLOD_t lodmax, - GrAspectRatio_t aspect, - GrTextureFormat_t fmt) -{ -#define FN_NAME "grTexCalcMemRequired" - FxU32 rv; - TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_LODLEVEL(lodmin), TRP_LODLEVEL(lodmax), TRP_ASPECTRATIO(aspect), TRP_TEXFMT(fmt)); - rv = grTexCalcMemRequired(lodmin, lodmax, aspect, fmt); - TRAP_LOG(GOT "%lu\n", rv); - return rv; -#undef FN_NAME -} - -FxU32 FX_CALL trap_grTexTextureMemRequired (FxU32 evenOdd, - GrTexInfo *info) -{ -#define FN_NAME "grTexTextureMemRequired" - FxU32 rv; - TRAP_LOG("%s(%s, %p)\n", FN_NAME, TRP_EVENODD(evenOdd), (void *)info); - rv = grTexTextureMemRequired(evenOdd, info); - TRAP_LOG(GOT "%lu\n", rv); - return rv; -#undef FN_NAME -} - -FxU32 FX_CALL trap_grTexMinAddress (GrChipID_t tmu) -{ -#define FN_NAME "grTexMinAddress" - FxU32 rv; - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_TMU(tmu)); - rv = grTexMinAddress(tmu); - TRAP_LOG(GOT "%lu\n", rv); - return rv; -#undef FN_NAME -} - -FxU32 FX_CALL trap_grTexMaxAddress (GrChipID_t tmu) -{ -#define FN_NAME "grTexMaxAddress" - FxU32 rv; - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_TMU(tmu)); - rv = grTexMaxAddress(tmu); - TRAP_LOG(GOT "%lu\n", rv); - return rv; -#undef FN_NAME -} - -void FX_CALL trap_grTexNCCTable (GrNCCTable_t table) -{ -#define FN_NAME "grTexNCCTable" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_NCC(table)); - grTexNCCTable(table); -#undef FN_NAME -} - -void FX_CALL trap_grTexSource (GrChipID_t tmu, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info) -{ -#define FN_NAME "grTexSource" - TRAP_LOG("%s(%s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_EVENODD(evenOdd), (void *)info); - grTexSource(tmu, startAddress, evenOdd, info); -#undef FN_NAME -} - -void FX_CALL trap_grTexClampMode (GrChipID_t tmu, - GrTextureClampMode_t s_clampmode, - GrTextureClampMode_t t_clampmode) -{ -#define FN_NAME "grTexClampMode" - TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CLAMPMODE(s_clampmode), TRP_CLAMPMODE(t_clampmode)); - grTexClampMode(tmu, s_clampmode, t_clampmode); -#undef FN_NAME -} - -void FX_CALL trap_grTexCombine (GrChipID_t tmu, - GrCombineFunction_t rgb_function, - GrCombineFactor_t rgb_factor, - GrCombineFunction_t alpha_function, - GrCombineFactor_t alpha_factor, - FxBool rgb_invert, - FxBool alpha_invert) -{ -#define FN_NAME "grTexCombine" - TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CMBFUNC(rgb_function), TRP_CMBFACT(rgb_factor), TRP_CMBFUNC(alpha_function), TRP_CMBFACT(alpha_factor), TRP_BOOL(rgb_invert), TRP_BOOL(alpha_invert)); - grTexCombine(tmu, rgb_function, rgb_factor, alpha_function, alpha_factor, rgb_invert, alpha_invert); -#undef FN_NAME -} - -void FX_CALL trap_grTexDetailControl (GrChipID_t tmu, - int lod_bias, - FxU8 detail_scale, - float detail_max) -{ -#define FN_NAME "grTexDetailControl" - TRAP_LOG("%s(%s, %u, %d, %f)\n", FN_NAME, TRP_TMU(tmu), lod_bias, detail_scale, detail_max); - grTexDetailControl(tmu, lod_bias, detail_scale, detail_max); -#undef FN_NAME -} - -void FX_CALL trap_grTexFilterMode (GrChipID_t tmu, - GrTextureFilterMode_t minfilter_mode, - GrTextureFilterMode_t magfilter_mode) -{ -#define FN_NAME "grTexFilterMode" - TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_TEXFILTER(minfilter_mode), TRP_TEXFILTER(magfilter_mode)); - grTexFilterMode(tmu, minfilter_mode, magfilter_mode); -#undef FN_NAME -} - -void FX_CALL trap_grTexLodBiasValue (GrChipID_t tmu, - float bias) -{ -#define FN_NAME "grTexLodBiasValue" - TRAP_LOG("%s(%s, %f)\n", FN_NAME, TRP_TMU(tmu), bias); - grTexLodBiasValue(tmu, bias); -#undef FN_NAME -} - -void FX_CALL trap_grTexDownloadMipMap (GrChipID_t tmu, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info) -{ -#define FN_NAME "grTexDownloadMipMap" - TRAP_LOG("%s(%s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_EVENODD(evenOdd), (void *)info); - grTexDownloadMipMap(tmu, startAddress, evenOdd, info); -#undef FN_NAME -} - -void FX_CALL trap_grTexDownloadMipMapLevel (GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - void *data) -{ -#define FN_NAME "grTexDownloadMipMapLevel" - TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s, %p)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLod), TRP_LODLEVEL(largeLod), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(evenOdd), data); - grTexDownloadMipMapLevel(tmu, startAddress, thisLod, largeLod, aspectRatio, format, evenOdd, data); -#undef FN_NAME -} - -FxBool FX_CALL trap_grTexDownloadMipMapLevelPartial (GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLod, - GrLOD_t largeLod, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 evenOdd, - void *data, - int start, - int end) -{ -#define FN_NAME "grTexDownloadMipMapLevelPartial" - FxBool rv; - TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s, %p, %d, %d)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLod), TRP_LODLEVEL(largeLod), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(evenOdd), data, start, end); - rv = grTexDownloadMipMapLevelPartial(tmu, startAddress, thisLod, largeLod, aspectRatio, format, evenOdd, data, start, end); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -void FX_CALL trap_grTexDownloadTable (GrTexTable_t type, - void *data) -{ -#define FN_NAME "grTexDownloadTable" - TRAP_LOG("%s(%s, %p)\n", FN_NAME, TRP_TABLE(type), data); - grTexDownloadTable(type, data); -#undef FN_NAME -} - -void FX_CALL trap_grTexDownloadTablePartial (GrTexTable_t type, - void *data, - int start, - int end) -{ -#define FN_NAME "grTexDownloadTablePartial" - TRAP_LOG("%s(%s, %p, %d, %d)\n", FN_NAME, TRP_TABLE(type), data, start, end); - grTexDownloadTablePartial(type, data, start, end); -#undef FN_NAME -} - -void FX_CALL trap_grTexMipMapMode (GrChipID_t tmu, - GrMipMapMode_t mode, - FxBool lodBlend) -{ -#define FN_NAME "grTexMipMapMode" - TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_MIPMODE(mode), TRP_BOOL(lodBlend)); - grTexMipMapMode(tmu, mode, lodBlend); -#undef FN_NAME -} - -void FX_CALL trap_grTexMultibase (GrChipID_t tmu, - FxBool enable) -{ -#define FN_NAME "grTexMultibase" - TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_BOOL(enable)); - grTexMultibase(tmu, enable); -#undef FN_NAME -} - -void FX_CALL trap_grTexMultibaseAddress (GrChipID_t tmu, - GrTexBaseRange_t range, - FxU32 startAddress, - FxU32 evenOdd, - GrTexInfo *info) -{ -#define FN_NAME "grTexMultibaseAddress" - TRAP_LOG("%s(%s, %s, %08lx, %s, %p)\n", FN_NAME, TRP_TMU(tmu), TRP_TEXBASERANGE(range), startAddress, TRP_EVENODD(evenOdd), (void *)info); - grTexMultibaseAddress(tmu, range, startAddress, evenOdd, info); -#undef FN_NAME -} - -/* -** linear frame buffer functions -*/ -FxBool FX_CALL trap_grLfbLock (GrLock_t type, - GrBuffer_t buffer, - GrLfbWriteMode_t writeMode, - GrOriginLocation_t origin, - FxBool pixelPipeline, - GrLfbInfo_t *info) -{ -#define FN_NAME "grLfbLock" - FxBool rv; - TRAP_LOG("%s(%s, %s, %s, %s, %s, %p)\n", FN_NAME, TRP_LOCKTYPE(type), TRP_BUFFER(buffer), TRP_WRITEMODE(writeMode), TRP_ORIGIN(origin), TRP_BOOL(pixelPipeline), (void *)info); - rv = grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -FxBool FX_CALL trap_grLfbUnlock (GrLock_t type, - GrBuffer_t buffer) -{ -#define FN_NAME "grLfbUnlock" - FxBool rv; - TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_LOCKTYPE(type), TRP_BUFFER(buffer)); - rv = grLfbUnlock(type, buffer); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -void FX_CALL trap_grLfbConstantAlpha (GrAlpha_t alpha) -{ -#define FN_NAME "grLfbConstantAlpha" - TRAP_LOG("%s(%02x)\n", FN_NAME, alpha); - grLfbConstantAlpha(alpha); -#undef FN_NAME -} - -void FX_CALL trap_grLfbConstantDepth (FxU32 depth) -{ -#define FN_NAME "grLfbConstantDepth" - TRAP_LOG("%s(%08lx)\n", FN_NAME, depth); - grLfbConstantDepth(depth); -#undef FN_NAME -} - -void FX_CALL trap_grLfbWriteColorSwizzle (FxBool swizzleBytes, - FxBool swapWords) -{ -#define FN_NAME "grLfbWriteColorSwizzle" - TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_BOOL(swizzleBytes), TRP_BOOL(swapWords)); - grLfbWriteColorSwizzle(swizzleBytes, swapWords); -#undef FN_NAME -} - -void FX_CALL trap_grLfbWriteColorFormat (GrColorFormat_t colorFormat) -{ -#define FN_NAME "grLfbWriteColorFormat" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_COLFMT(colorFormat)); - grLfbWriteColorFormat(colorFormat); -#undef FN_NAME -} - -FxBool FX_CALL trap_grLfbWriteRegion (GrBuffer_t dst_buffer, - FxU32 dst_x, - FxU32 dst_y, - GrLfbSrcFmt_t src_format, - FxU32 src_width, - FxU32 src_height, - FxBool pixelPipeline, - FxI32 src_stride, - void *src_data) -{ -#define FN_NAME "grLfbWriteRegion" - FxBool rv; - TRAP_LOG("%s(%s, %lu, %lu, %s, %lu, %lu, %s, %ld, %p)\n", FN_NAME, TRP_BUFFER(dst_buffer), dst_x, dst_y, TRP_SRCFMT(src_format), src_width, src_height, TRP_BOOL(pixelPipeline), src_stride, src_data); - rv = grLfbWriteRegion(dst_buffer, dst_x, dst_y, src_format, src_width, src_height, pixelPipeline, src_stride, src_data); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -FxBool FX_CALL trap_grLfbReadRegion (GrBuffer_t src_buffer, - FxU32 src_x, - FxU32 src_y, - FxU32 src_width, - FxU32 src_height, - FxU32 dst_stride, - void *dst_data) -{ -#define FN_NAME "grLfbReadRegion" - FxBool rv; - TRAP_LOG("%s(%s, %lu, %lu, %lu, %lu, %ld, %p)\n", FN_NAME, TRP_BUFFER(src_buffer), src_x, src_y, src_width, src_height, dst_stride, dst_data); - rv = grLfbReadRegion(src_buffer, src_x, src_y, src_width, src_height, dst_stride, dst_data); - TRAP_LOG(GOT "%s\n", TRP_BOOL(rv)); - return rv; -#undef FN_NAME -} - -/* -** glide management functions -*/ -void FX_CALL trap_grGlideInit (void) -{ -#define FN_NAME "grGlideInit" - TRAP_LOG("%s()\n", FN_NAME); - grGlideInit(); -#undef FN_NAME -} - -void FX_CALL trap_grGlideShutdown (void) -{ -#define FN_NAME "grGlideShutdown" - TRAP_LOG("%s()\n", FN_NAME); - grGlideShutdown(); -#undef FN_NAME -} - -void FX_CALL trap_grGlideGetState (void *state) -{ -#define FN_NAME "grGlideGetState" - TRAP_LOG("%s(%p)\n", FN_NAME, state); - grGlideGetState(state); -#undef FN_NAME -} - -void FX_CALL trap_grGlideSetState (const void *state) -{ -#define FN_NAME "grGlideSetState" - TRAP_LOG("%s(%p)\n", FN_NAME, state); - grGlideSetState(state); -#undef FN_NAME -} - -void FX_CALL trap_grGlideGetVertexLayout (void *layout) -{ -#define FN_NAME "grGlideGetVertexLayout" - TRAP_LOG("%s(%p)\n", FN_NAME, layout); - grGlideGetVertexLayout(layout); -#undef FN_NAME -} - -void FX_CALL trap_grGlideSetVertexLayout (const void *layout) -{ -#define FN_NAME "grGlideSetVertexLayout" - TRAP_LOG("%s(%p)\n", FN_NAME, layout); - grGlideSetVertexLayout(layout); -#undef FN_NAME -} - -/* -** glide utility functions -*/ -void FX_CALL trap_guGammaCorrectionRGB (FxFloat red, - FxFloat green, - FxFloat blue) -{ -#define FN_NAME "guGammaCorrectionRGB" - TRAP_LOG("%s(%f, %f, %f)\n", FN_NAME, red, green, blue); - guGammaCorrectionRGB(red, green, blue); -#undef FN_NAME -} - -float FX_CALL trap_guFogTableIndexToW (int i) -{ -#define FN_NAME "guFogTableIndexToW" - float rv; - TRAP_LOG("%s(%d)\n", FN_NAME, i); - rv = guFogTableIndexToW(i); - TRAP_LOG(GOT "%f\n", rv); - return rv; -#undef FN_NAME -} - -void FX_CALL trap_guFogGenerateExp (GrFog_t *fogtable, - float density) -{ -#define FN_NAME "guFogGenerateExp" - TRAP_LOG("%s(%p, %f)\n", FN_NAME, fogtable, density); - guFogGenerateExp(fogtable, density); -#undef FN_NAME -} - -void FX_CALL trap_guFogGenerateExp2 (GrFog_t *fogtable, - float density) -{ -#define FN_NAME "guFogGenerateExp2" - TRAP_LOG("%s(%p, %f)\n", FN_NAME, fogtable, density); - guFogGenerateExp2(fogtable, density); -#undef FN_NAME -} - -void FX_CALL trap_guFogGenerateLinear (GrFog_t *fogtable, - float nearZ, - float farZ) -{ -#define FN_NAME "guFogGenerateLinear" - TRAP_LOG("%s(%p, %f, %f)\n", FN_NAME, fogtable, nearZ, farZ); - guFogGenerateLinear(fogtable, nearZ, farZ); -#undef FN_NAME -} - -/* -** glide extensions -*/ -void FX_CALL trap_grSetNumPendingBuffers (FxI32 NumPendingBuffers) -{ -#define FN_NAME "grSetNumPendingBuffers" - TRAP_LOG("%s(%ld)\n", FN_NAME, NumPendingBuffers); - assert(real_grSetNumPendingBuffers); - (*real_grSetNumPendingBuffers)(NumPendingBuffers); -#undef FN_NAME -} - -char *FX_CALL trap_grGetRegistryOrEnvironmentStringExt (char *theEntry) -{ -#define FN_NAME "grGetRegistryOrEnvironmentStringExt" - char *rv; - TRAP_LOG("%s(\"%s\")\n", FN_NAME, theEntry); - assert(real_grGetRegistryOrEnvironmentStringExt); - rv = (*real_grGetRegistryOrEnvironmentStringExt)(theEntry); - if (rv) { - TRAP_LOG(GOT "\"%s\"\n", rv); - } else { - TRAP_LOG(GOT "NULL\n"); - } - return rv; -#undef FN_NAME -} - -void FX_CALL trap_grGetGammaTableExt (FxU32 nentries, - FxU32 *red, - FxU32 *green, - FxU32 *blue) -{ -#define FN_NAME "grGetGammaTableExt" - TRAP_LOG("%s(%lu, %p, %p, %p)\n", FN_NAME, nentries, (void *)red, (void *)green, (void *)blue); - assert(real_grGetGammaTableExt); - (*real_grGetGammaTableExt)(nentries, red, green, blue); -#undef FN_NAME -} - -void FX_CALL trap_grChromaRangeModeExt (GrChromakeyMode_t mode) -{ -#define FN_NAME "grChromaRangeModeExt" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_CKMODE(mode)); - assert(real_grChromaRangeModeExt); - (*real_grChromaRangeModeExt)(mode); -#undef FN_NAME -} - -void FX_CALL trap_grChromaRangeExt (GrColor_t color, - GrColor_t range, - GrChromaRangeMode_t match_mode) -{ -#define FN_NAME "grChromaRangeExt" - TRAP_LOG("%s(%08lx, %08lx, %s)\n", FN_NAME, color, range, TRP_CRMODE(match_mode)); - assert(real_grChromaRangeExt); - (*real_grChromaRangeExt)(color, range, match_mode); -#undef FN_NAME -} - -void FX_CALL trap_grTexChromaModeExt (GrChipID_t tmu, - GrChromakeyMode_t mode) -{ -#define FN_NAME "grTexChromaModeExt" - TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CKMODE(mode)); - assert(real_grTexChromaModeExt); - (*real_grTexChromaModeExt)(tmu, mode); -#undef FN_NAME -} - -void FX_CALL trap_grTexChromaRangeExt (GrChipID_t tmu, - GrColor_t min, - GrColor_t max, - GrTexChromakeyMode_t mode) -{ -#define FN_NAME "grTexChromaRangeExt" - TRAP_LOG("%s(%s, %08lx, %08lx, %s)\n", FN_NAME, TRP_TMU(tmu), min, max, TRP_CRMODE(mode)); - assert(real_grTexChromaRangeExt); - (*real_grTexChromaRangeExt)(tmu, min, max, mode); -#undef FN_NAME -} - - /* pointcast */ -void FX_CALL trap_grTexDownloadTableExt (GrChipID_t tmu, - GrTexTable_t type, - void *data) -{ -#define FN_NAME "grTexDownloadTableExt" - TRAP_LOG("%s(%s, %s, %p)\n", FN_NAME, TRP_TMU(tmu), TRP_TABLE(type), data); - assert(real_grTexDownloadTableExt); - (*real_grTexDownloadTableExt)(tmu, type, data); -#undef FN_NAME -} - -void FX_CALL trap_grTexDownloadTablePartialExt (GrChipID_t tmu, - GrTexTable_t type, - void *data, - int start, - int end) -{ -#define FN_NAME "grTexDownloadTablePartialExt" - TRAP_LOG("%s(%s, %s, %p, %d, %d)\n", FN_NAME, TRP_TMU(tmu), TRP_TABLE(type), data, start, end); - assert(real_grTexDownloadTablePartialExt); - (*real_grTexDownloadTablePartialExt)(tmu, type, data, start, end); -#undef FN_NAME -} - -void FX_CALL trap_grTexNCCTableExt (GrChipID_t tmu, - GrNCCTable_t table) -{ -#define FN_NAME "grTexNCCTableExt" - TRAP_LOG("%s(%s, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_NCC(table)); - assert(real_grTexNCCTableExt); - (*real_grTexNCCTableExt)(tmu, table); -#undef FN_NAME -} - - /* tbext */ -void FX_CALL trap_grTextureBufferExt (GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLOD, - GrLOD_t largeLOD, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 odd_even_mask) -{ -#define FN_NAME "grTextureBufferExt" - TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLOD), TRP_LODLEVEL(largeLOD), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(odd_even_mask)); - assert(real_grTextureBufferExt); - (*real_grTextureBufferExt)(tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask); -#undef FN_NAME -} - -void FX_CALL trap_grTextureAuxBufferExt (GrChipID_t tmu, - FxU32 startAddress, - GrLOD_t thisLOD, - GrLOD_t largeLOD, - GrAspectRatio_t aspectRatio, - GrTextureFormat_t format, - FxU32 odd_even_mask) -{ -#define FN_NAME "grTextureAuxBufferExt" - TRAP_LOG("%s(%s, %08lx, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_TMU(tmu), startAddress, TRP_LODLEVEL(thisLOD), TRP_LODLEVEL(largeLOD), TRP_ASPECTRATIO(aspectRatio), TRP_TEXFMT(format), TRP_EVENODD(odd_even_mask)); - assert(real_grTextureAuxBufferExt); - (*real_grTextureAuxBufferExt)(tmu, startAddress, thisLOD, largeLOD, aspectRatio, format, odd_even_mask); -#undef FN_NAME -} - -void FX_CALL trap_grAuxBufferExt (GrBuffer_t buffer) -{ -#define FN_NAME "grAuxBufferExt" - TRAP_LOG("%s(%s)\n", FN_NAME, TRP_BUFFER(buffer)); - assert(real_grAuxBufferExt); - (*real_grAuxBufferExt)(buffer); -#undef FN_NAME -} - - /* napalm */ -GrContext_t FX_CALL trap_grSstWinOpenExt (FxU32 hWnd, - GrScreenResolution_t resolution, - GrScreenRefresh_t refresh, - GrColorFormat_t format, - GrOriginLocation_t origin, - GrPixelFormat_t pixelformat, - int nColBuffers, - int nAuxBuffers) -{ -#define FN_NAME "grSstWinOpenExt" - GrContext_t rv; - TRAP_LOG("%s(%08lx, %s, %s, %s, %s, %s, %d, %d)\n", FN_NAME, hWnd, TRP_RESOLUTION(resolution), TRP_REFRESH(refresh), TRP_COLFMT(format), TRP_ORIGIN(origin), TRP_PIXFMT(pixelformat), nColBuffers, nAuxBuffers); - assert(real_grSstWinOpenExt); - rv = (*real_grSstWinOpenExt)(hWnd, resolution, refresh, format, origin, pixelformat, nColBuffers, nAuxBuffers); - TRAP_LOG(GOT "%p\n", (void *)rv); - return rv; -#undef FN_NAME -} - -void FX_CALL trap_grStencilFuncExt (GrCmpFnc_t fnc, - GrStencil_t ref, - GrStencil_t mask) -{ -#define FN_NAME "grStencilFuncExt" - TRAP_LOG("%s(%s, %02x, %02x)\n", FN_NAME, TRP_CMPFUNC(fnc), ref, mask); - assert(real_grStencilFuncExt); - (*real_grStencilFuncExt)(fnc, ref, mask); -#undef FN_NAME -} - -void FX_CALL trap_grStencilMaskExt (GrStencil_t value) -{ -#define FN_NAME "grStencilMaskExt" - TRAP_LOG("%s(%02x)\n", FN_NAME, value); - assert(real_grStencilMaskExt); - (*real_grStencilMaskExt)(value); -#undef FN_NAME -} - -void FX_CALL trap_grStencilOpExt (GrStencilOp_t stencil_fail, - GrStencilOp_t depth_fail, - GrStencilOp_t depth_pass) -{ -#define FN_NAME "grStencilOpExt" - TRAP_LOG("%s(%s, %s, %s)\n", FN_NAME, TRP_STENCILOP(stencil_fail), TRP_STENCILOP(depth_fail), TRP_STENCILOP(depth_pass)); - assert(real_grStencilOpExt); - (*real_grStencilOpExt)(stencil_fail, depth_fail, depth_pass); -#undef FN_NAME -} - -void FX_CALL trap_grLfbConstantStencilExt (GrStencil_t value) -{ -#define FN_NAME "grLfbConstantStencilExt" - TRAP_LOG("%s(%02x)\n", FN_NAME, value); - assert(real_grLfbConstantStencilExt); - (*real_grLfbConstantStencilExt)(value); -#undef FN_NAME -} - -void FX_CALL trap_grBufferClearExt (GrColor_t color, - GrAlpha_t alpha, - FxU32 depth, - GrStencil_t stencil) -{ -#define FN_NAME "grBufferClearExt" - TRAP_LOG("%s(%08lx, %02x, %08lx, %02x)\n", FN_NAME, color, alpha, depth, stencil); - assert(real_grBufferClearExt); - (*real_grBufferClearExt)(color, alpha, depth, stencil); -#undef FN_NAME -} - -void FX_CALL trap_grColorCombineExt (GrCCUColor_t a, - GrCombineMode_t a_mode, - GrCCUColor_t b, - GrCombineMode_t b_mode, - GrCCUColor_t c, - FxBool c_invert, - GrCCUColor_t d, - FxBool d_invert, - FxU32 shift, - FxBool invert) -{ -#define FN_NAME "grColorCombineExt" - TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); - assert(real_grColorCombineExt); - (*real_grColorCombineExt)(a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); -#undef FN_NAME -} - -void FX_CALL trap_grAlphaCombineExt (GrACUColor_t a, - GrCombineMode_t a_mode, - GrACUColor_t b, - GrCombineMode_t b_mode, - GrACUColor_t c, - FxBool c_invert, - GrACUColor_t d, - FxBool d_invert, - FxU32 shift, - FxBool invert) -{ -#define FN_NAME "grAlphaCombineExt" - TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); - assert(real_grAlphaCombineExt); - (*real_grAlphaCombineExt)(a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); -#undef FN_NAME -} - -void FX_CALL trap_grTexColorCombineExt (GrChipID_t tmu, - GrTCCUColor_t a, - GrCombineMode_t a_mode, - GrTCCUColor_t b, - GrCombineMode_t b_mode, - GrTCCUColor_t c, - FxBool c_invert, - GrTCCUColor_t d, - FxBool d_invert, - FxU32 shift, - FxBool invert) -{ -#define FN_NAME "grTexColorCombineExt" - TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); - assert(real_grTexColorCombineExt); - (*real_grTexColorCombineExt)(tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); -#undef FN_NAME -} - -void FX_CALL trap_grTexAlphaCombineExt (GrChipID_t tmu, - GrTACUColor_t a, - GrCombineMode_t a_mode, - GrTACUColor_t b, - GrCombineMode_t b_mode, - GrTACUColor_t c, - FxBool c_invert, - GrTACUColor_t d, - FxBool d_invert, - FxU32 shift, - FxBool invert) -{ -#define FN_NAME "grTexAlphaCombineExt" - TRAP_LOG("%s(%s, %s, %s, %s, %s, %s, %s, %s, %s, %lu, %s)\n", FN_NAME, TRP_TMU(tmu), TRP_CU(a), TRP_CMBMODE(a_mode), TRP_CU(b), TRP_CMBMODE(b_mode), TRP_CU(c), TRP_BOOL(c_invert), TRP_CU(d), TRP_BOOL(d_invert), shift, TRP_BOOL(invert)); - assert(real_grTexAlphaCombineExt); - (*real_grTexAlphaCombineExt)(tmu, a, a_mode, b, b_mode, c, c_invert, d, d_invert, shift, invert); -#undef FN_NAME -} - -void FX_CALL trap_grConstantColorValueExt (GrChipID_t tmu, - GrColor_t value) -{ -#define FN_NAME "grConstantColorValueExt" - TRAP_LOG("%s(%s, %08lx)\n", FN_NAME, TRP_TMU(tmu), value); - assert(real_grConstantColorValueExt); - (*real_grConstantColorValueExt)(tmu, value); -#undef FN_NAME -} - -void FX_CALL trap_grColorMaskExt (FxBool r, - FxBool g, - FxBool b, - FxBool a) -{ -#define FN_NAME "grColorMaskExt" - TRAP_LOG("%s(%s, %s, %s, %s)\n", FN_NAME, TRP_BOOL(r), TRP_BOOL(g), TRP_BOOL(b), TRP_BOOL(a)); - assert(real_grColorMaskExt); - (*real_grColorMaskExt)(r, g, b, a); -#undef FN_NAME -} - -void FX_CALL trap_grAlphaBlendFunctionExt (GrAlphaBlendFnc_t rgb_sf, - GrAlphaBlendFnc_t rgb_df, - GrAlphaBlendOp_t rgb_op, - GrAlphaBlendFnc_t alpha_sf, - GrAlphaBlendFnc_t alpha_df, - GrAlphaBlendOp_t alpha_op) -{ -#define FN_NAME "grAlphaBlendFunctionExt" - TRAP_LOG("%s(%s, %s, %s, %s, %s, %s)\n", FN_NAME, TRP_BLEND(rgb_sf), TRP_BLEND(rgb_df), TRP_BLENDOP(rgb_op), TRP_BLEND(alpha_sf), TRP_BLEND(alpha_df), TRP_BLENDOP(alpha_op)); - assert(real_grAlphaBlendFunctionExt); - (*real_grAlphaBlendFunctionExt)(rgb_sf, rgb_df, rgb_op, alpha_sf, alpha_df, alpha_op); -#undef FN_NAME -} - -void FX_CALL trap_grTBufferWriteMaskExt (FxU32 tmask) -{ -#define FN_NAME "grTBufferWriteMaskExt" - TRAP_LOG("%s(%08lx)\n", FN_NAME, tmask); - assert(real_grTBufferWriteMaskExt); - (*real_grTBufferWriteMaskExt)(tmask); -#undef FN_NAME -} - -/* -** texus functions -*/ -void FX_CALL trap_txImgQuantize (char *dst, - char *src, - int w, - int h, - FxU32 format, - FxU32 dither) -{ -#define FN_NAME "txImgQuantize" - TRAP_LOG("%s(%p, %p, %d, %d, %s, %s)\n", FN_NAME, dst, src, w, h, TRP_TEXFMT(format), TRP_TXDITHER(dither)); - assert(real_txImgQuantize); - (*real_txImgQuantize)(dst, src, w, h, format, dither); -#undef FN_NAME -} - -void FX_CALL trap_txMipQuantize (TxMip *pxMip, - TxMip *txMip, - int fmt, - FxU32 d, - FxU32 comp) -{ -#define FN_NAME "txMipQuantize" - TRAP_LOG("%s(%p, %p, %s, %s, %s)\n", FN_NAME, (void *)pxMip, (void *)txMip, TRP_TEXFMT(fmt), TRP_TXDITHER(d), TRP_TXCOMPRESS(comp)); - assert(real_txMipQuantize); - (*real_txMipQuantize)(pxMip, txMip, fmt, d, comp); -#undef FN_NAME -} - -void FX_CALL trap_txPalToNcc (GuNccTable *ncc_table, - const FxU32 *pal) -{ -#define FN_NAME "txPalToNcc" - TRAP_LOG("%s(%p, %p)\n", FN_NAME, (void *)ncc_table, (void *)pal); - assert(real_txPalToNcc); - (*real_txPalToNcc)(ncc_table, pal); -#undef FN_NAME -} -#endif - - - -/****************************************************************************\ -* housekeeping (fake pointers) * -\****************************************************************************/ -char *FX_CALL fake_grGetRegistryOrEnvironmentStringExt (char *theEntry) -{ - return getenv(theEntry); -} - -void FX_CALL fake_grTexDownloadTableExt (GrChipID_t tmu, - GrTexTable_t type, - void *data) -{ - (void)tmu; - grTexDownloadTable(type, data); -} - -void FX_CALL fake_grTexDownloadTablePartialExt (GrChipID_t tmu, - GrTexTable_t type, - void *data, - int start, - int end) -{ - (void)tmu; - grTexDownloadTablePartial(type, data, start, end); -} - -void FX_CALL fake_grTexNCCTableExt (GrChipID_t tmu, - GrNCCTable_t table) -{ - (void)tmu; - grTexNCCTable(table); -} - - - -/****************************************************************************\ -* interface * -\****************************************************************************/ -void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast) -{ -/* GET_EXT_ADDR: get function pointer - * GET_EXT_FAKE: get function pointer if possible, else use a fake function - * GET_EXT_NULL: get function pointer if possible, else leave NULL pointer - */ -#if FX_TRAP_GLIDE -#define GET_EXT_ADDR(name) *(GrProc *)&real_##name = grGetProcAddress(#name), Glide->name = trap_##name -#define GET_EXT_FAKE(name) GET_EXT_ADDR(name); if (real_##name == NULL) real_##name = fake_##name -#define GET_EXT_NULL(name) GET_EXT_ADDR(name); if (real_##name == NULL) Glide->name = NULL -#else /* FX_TRAP_GLIDE */ -#define GET_EXT_ADDR(name) *(GrProc *)&Glide->name = grGetProcAddress(#name) -#define GET_EXT_FAKE(name) GET_EXT_ADDR(name); if (Glide->name == NULL) Glide->name = fake_##name -#define GET_EXT_NULL(name) GET_EXT_ADDR(name) -#endif /* FX_TRAP_GLIDE */ - - /* - ** glide extensions - */ - GET_EXT_NULL(grSetNumPendingBuffers); - GET_EXT_FAKE(grGetRegistryOrEnvironmentStringExt); - GET_EXT_ADDR(grGetGammaTableExt); - GET_EXT_ADDR(grChromaRangeModeExt); - GET_EXT_ADDR(grChromaRangeExt); - GET_EXT_ADDR(grTexChromaModeExt); - GET_EXT_ADDR(grTexChromaRangeExt); - /* pointcast */ - if (pointcast) { - GET_EXT_FAKE(grTexDownloadTableExt); - GET_EXT_FAKE(grTexDownloadTablePartialExt); - GET_EXT_FAKE(grTexNCCTableExt); - } else { - Glide->grTexDownloadTableExt = fake_grTexDownloadTableExt; - Glide->grTexDownloadTablePartialExt = fake_grTexDownloadTablePartialExt; - Glide->grTexNCCTableExt = fake_grTexNCCTableExt; - } - /* tbext */ - GET_EXT_ADDR(grTextureBufferExt); - GET_EXT_ADDR(grTextureAuxBufferExt); - GET_EXT_ADDR(grAuxBufferExt); - /* napalm */ - GET_EXT_ADDR(grSstWinOpenExt); - GET_EXT_ADDR(grStencilFuncExt); - GET_EXT_ADDR(grStencilMaskExt); - GET_EXT_ADDR(grStencilOpExt); - GET_EXT_ADDR(grLfbConstantStencilExt); - GET_EXT_ADDR(grBufferClearExt); - GET_EXT_ADDR(grColorCombineExt); - GET_EXT_ADDR(grAlphaCombineExt); - GET_EXT_ADDR(grTexColorCombineExt); - GET_EXT_ADDR(grTexAlphaCombineExt); - GET_EXT_ADDR(grConstantColorValueExt); - GET_EXT_ADDR(grColorMaskExt); - GET_EXT_ADDR(grAlphaBlendFunctionExt); - GET_EXT_ADDR(grTBufferWriteMaskExt); - - /* - ** texus - */ - GET_EXT_NULL(txImgQuantize); - GET_EXT_NULL(txMipQuantize); - GET_EXT_NULL(txPalToNcc); - -#undef GET_EXT_ADDR -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxg.h b/src/mesa/drivers/glide/fxg.h deleted file mode 100644 index e712011168..0000000000 --- a/src/mesa/drivers/glide/fxg.h +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.0.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Mesa/FX device driver. Interface to Glide3. - * - * Copyright (c) 2003 - Daniel Borca - * Email : dborca@users.sourceforge.net - * Web : http://www.geocities.com/dborca - */ - - -#ifndef TDFX_GLIDE_H_included -#define TDFX_GLIDE_H_included - -#include -#include - -#ifndef FX_TRAP_GLIDE -#define FX_TRAP_GLIDE 0 -#endif - -#if FX_TRAP_GLIDE -/* -** rendering functions -*/ -void FX_CALL trap_grDrawPoint (const void *pt); -void FX_CALL trap_grDrawLine (const void *v1, const void *v2); -void FX_CALL trap_grDrawTriangle (const void *a, const void *b, const void *c); -void FX_CALL trap_grVertexLayout (FxU32 param, FxI32 offset, FxU32 mode); -void FX_CALL trap_grDrawVertexArray (FxU32 mode, FxU32 Count, void *pointers); -void FX_CALL trap_grDrawVertexArrayContiguous (FxU32 mode, FxU32 Count, void *pointers, FxU32 stride); - -/* -** Antialiasing Functions -*/ -void FX_CALL trap_grAADrawTriangle (const void *a, const void *b, const void *c, FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias); - -/* -** buffer management -*/ -void FX_CALL trap_grBufferClear (GrColor_t color, GrAlpha_t alpha, FxU32 depth); -void FX_CALL trap_grBufferSwap (FxU32 swap_interval); -void FX_CALL trap_grRenderBuffer (GrBuffer_t buffer); - -/* -** error management -*/ -void FX_CALL trap_grErrorSetCallback (GrErrorCallbackFnc_t fnc); - -/* -** SST routines -*/ -void FX_CALL trap_grFinish (void); -void FX_CALL trap_grFlush (void); -GrContext_t FX_CALL trap_grSstWinOpen (FxU32 hWnd, GrScreenResolution_t screen_resolution, GrScreenRefresh_t refresh_rate, GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers); -FxBool FX_CALL trap_grSstWinClose (GrContext_t context); -FxBool FX_CALL trap_grSelectContext (GrContext_t context); -void FX_CALL trap_grSstOrigin (GrOriginLocation_t origin); -void FX_CALL trap_grSstSelect (int which_sst); - -/* -** Glide configuration and special effect maintenance functions -*/ -void FX_CALL trap_grAlphaBlendFunction (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df); -void FX_CALL trap_grAlphaCombine (GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); -void FX_CALL trap_grAlphaControlsITRGBLighting (FxBool enable); -void FX_CALL trap_grAlphaTestFunction (GrCmpFnc_t function); -void FX_CALL trap_grAlphaTestReferenceValue (GrAlpha_t value); -void FX_CALL trap_grChromakeyMode (GrChromakeyMode_t mode); -void FX_CALL trap_grChromakeyValue (GrColor_t value); -void FX_CALL trap_grClipWindow (FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy); -void FX_CALL trap_grColorCombine (GrCombineFunction_t function, GrCombineFactor_t factor, GrCombineLocal_t local, GrCombineOther_t other, FxBool invert); -void FX_CALL trap_grColorMask (FxBool rgb, FxBool a); -void FX_CALL trap_grCullMode (GrCullMode_t mode); -void FX_CALL trap_grConstantColorValue (GrColor_t value); -void FX_CALL trap_grDepthBiasLevel (FxI32 level); -void FX_CALL trap_grDepthBufferFunction (GrCmpFnc_t function); -void FX_CALL trap_grDepthBufferMode (GrDepthBufferMode_t mode); -void FX_CALL trap_grDepthMask (FxBool mask); -void FX_CALL trap_grDisableAllEffects (void); -void FX_CALL trap_grDitherMode (GrDitherMode_t mode); -void FX_CALL trap_grFogColorValue (GrColor_t fogcolor); -void FX_CALL trap_grFogMode (GrFogMode_t mode); -void FX_CALL trap_grFogTable (const GrFog_t ft[]); -void FX_CALL trap_grLoadGammaTable (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); -void FX_CALL trap_grSplash (float x, float y, float width, float height, FxU32 frame); -FxU32 FX_CALL trap_grGet (FxU32 pname, FxU32 plength, FxI32 *params); -const char * FX_CALL trap_grGetString (FxU32 pname); -FxI32 FX_CALL trap_grQueryResolutions (const GrResolution *resTemplate, GrResolution *output); -FxBool FX_CALL trap_grReset (FxU32 what); -GrProc FX_CALL trap_grGetProcAddress (char *procName); -void FX_CALL trap_grEnable (GrEnableMode_t mode); -void FX_CALL trap_grDisable (GrEnableMode_t mode); -void FX_CALL trap_grCoordinateSpace (GrCoordinateSpaceMode_t mode); -void FX_CALL trap_grDepthRange (FxFloat n, FxFloat f); -void FX_CALL trap_grStippleMode (GrStippleMode_t mode); -void FX_CALL trap_grStipplePattern (GrStipplePattern_t mode); -void FX_CALL trap_grViewport (FxI32 x, FxI32 y, FxI32 width, FxI32 height); - -/* -** texture mapping control functions -*/ -FxU32 FX_CALL trap_grTexCalcMemRequired (GrLOD_t lodmin, GrLOD_t lodmax, GrAspectRatio_t aspect, GrTextureFormat_t fmt); -FxU32 FX_CALL trap_grTexTextureMemRequired (FxU32 evenOdd, GrTexInfo *info); -FxU32 FX_CALL trap_grTexMinAddress (GrChipID_t tmu); -FxU32 FX_CALL trap_grTexMaxAddress (GrChipID_t tmu); -void FX_CALL trap_grTexNCCTable (GrNCCTable_t table); -void FX_CALL trap_grTexSource (GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info); -void FX_CALL trap_grTexClampMode (GrChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode); -void FX_CALL trap_grTexCombine (GrChipID_t tmu, GrCombineFunction_t rgb_function, GrCombineFactor_t rgb_factor, GrCombineFunction_t alpha_function, GrCombineFactor_t alpha_factor, FxBool rgb_invert, FxBool alpha_invert); -void FX_CALL trap_grTexDetailControl (GrChipID_t tmu, int lod_bias, FxU8 detail_scale, float detail_max); -void FX_CALL trap_grTexFilterMode (GrChipID_t tmu, GrTextureFilterMode_t minfilter_mode, GrTextureFilterMode_t magfilter_mode); -void FX_CALL trap_grTexLodBiasValue (GrChipID_t tmu, float bias); -void FX_CALL trap_grTexDownloadMipMap (GrChipID_t tmu, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info); -void FX_CALL trap_grTexDownloadMipMapLevel (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod, GrLOD_t largeLod, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 evenOdd, void *data); -FxBool FX_CALL trap_grTexDownloadMipMapLevelPartial (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLod, GrLOD_t largeLod, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 evenOdd, void *data, int start, int end); -void FX_CALL trap_grTexDownloadTable (GrTexTable_t type, void *data); -void FX_CALL trap_grTexDownloadTablePartial (GrTexTable_t type, void *data, int start, int end); -void FX_CALL trap_grTexMipMapMode (GrChipID_t tmu, GrMipMapMode_t mode, FxBool lodBlend); -void FX_CALL trap_grTexMultibase (GrChipID_t tmu, FxBool enable); -void FX_CALL trap_grTexMultibaseAddress (GrChipID_t tmu, GrTexBaseRange_t range, FxU32 startAddress, FxU32 evenOdd, GrTexInfo *info); - -/* -** linear frame buffer functions -*/ -FxBool FX_CALL trap_grLfbLock (GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, FxBool pixelPipeline, GrLfbInfo_t *info); -FxBool FX_CALL trap_grLfbUnlock (GrLock_t type, GrBuffer_t buffer); -void FX_CALL trap_grLfbConstantAlpha (GrAlpha_t alpha); -void FX_CALL trap_grLfbConstantDepth (FxU32 depth); -void FX_CALL trap_grLfbWriteColorSwizzle (FxBool swizzleBytes, FxBool swapWords); -void FX_CALL trap_grLfbWriteColorFormat (GrColorFormat_t colorFormat); -FxBool FX_CALL trap_grLfbWriteRegion (GrBuffer_t dst_buffer, FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format, FxU32 src_width, FxU32 src_height, FxBool pixelPipeline, FxI32 src_stride, void *src_data); -FxBool FX_CALL trap_grLfbReadRegion (GrBuffer_t src_buffer, FxU32 src_x, FxU32 src_y, FxU32 src_width, FxU32 src_height, FxU32 dst_stride, void *dst_data); - -/* -** glide management functions -*/ -void FX_CALL trap_grGlideInit (void); -void FX_CALL trap_grGlideShutdown (void); -void FX_CALL trap_grGlideGetState (void *state); -void FX_CALL trap_grGlideSetState (const void *state); -void FX_CALL trap_grGlideGetVertexLayout (void *layout); -void FX_CALL trap_grGlideSetVertexLayout (const void *layout); - -/* -** glide utility functions -*/ -void FX_CALL trap_guGammaCorrectionRGB (FxFloat red, FxFloat green, FxFloat blue); -float FX_CALL trap_guFogTableIndexToW (int i); -void FX_CALL trap_guFogGenerateExp (GrFog_t *fogtable, float density); -void FX_CALL trap_guFogGenerateExp2 (GrFog_t *fogtable, float density); -void FX_CALL trap_guFogGenerateLinear (GrFog_t *fogtable, float nearZ, float farZ); - -#ifndef FX_TRAP_GLIDE_internal -/* -** rendering functions -*/ -#define grDrawPoint trap_grDrawPoint -#define grDrawLine trap_grDrawLine -#define grDrawTriangle trap_grDrawTriangle -#define grVertexLayout trap_grVertexLayout -#define grDrawVertexArray trap_grDrawVertexArray -#define grDrawVertexArrayContiguous trap_grDrawVertexArrayContiguous - -/* -** Antialiasing Functions -*/ -#define grAADrawTriangle trap_grAADrawTriangle - -/* -** buffer management -*/ -#define grBufferClear trap_grBufferClear -#define grBufferSwap trap_grBufferSwap -#define grRenderBuffer trap_grRenderBuffer - -/* -** error management -*/ -#define grErrorSetCallback trap_grErrorSetCallback - -/* -** SST routines -*/ -#define grFinish trap_grFinish -#define grFlush trap_grFlush -#define grSstWinOpen trap_grSstWinOpen -#define grSstWinClose trap_grSstWinClose -#define grSelectContext trap_grSelectContext -#define grSstOrigin trap_grSstOrigin -#define grSstSelect trap_grSstSelect - -/* -** Glide configuration and special effect maintenance functions -*/ -#define grAlphaBlendFunction trap_grAlphaBlendFunction -#define grAlphaCombine trap_grAlphaCombine -#define grAlphaControlsITRGBLighting trap_grAlphaControlsITRGBLighting -#define grAlphaTestFunction trap_grAlphaTestFunction -#define grAlphaTestReferenceValue trap_grAlphaTestReferenceValue -#define grChromakeyMode trap_grChromakeyMode -#define grChromakeyValue trap_grChromakeyValue -#define grClipWindow trap_grClipWindow -#define grColorCombine trap_grColorCombine -#define grColorMask trap_grColorMask -#define grCullMode trap_grCullMode -#define grConstantColorValue trap_grConstantColorValue -#define grDepthBiasLevel trap_grDepthBiasLevel -#define grDepthBufferFunction trap_grDepthBufferFunction -#define grDepthBufferMode trap_grDepthBufferMode -#define grDepthMask trap_grDepthMask -#define grDisableAllEffects trap_grDisableAllEffects -#define grDitherMode trap_grDitherMode -#define grFogColorValue trap_grFogColorValue -#define grFogMode trap_grFogMode -#define grFogTable trap_grFogTable -#define grLoadGammaTable trap_grLoadGammaTable -#define grSplash trap_grSplash -#define grGet trap_grGet -#define grGetString trap_grGetString -#define grQueryResolutions trap_grQueryResolutions -#define grReset trap_grReset -#define grGetProcAddress trap_grGetProcAddress -#define grEnable trap_grEnable -#define grDisable trap_grDisable -#define grCoordinateSpace trap_grCoordinateSpace -#define grDepthRange trap_grDepthRange -#define grStippleMode trap_grStippleMode -#define grStipplePattern trap_grStipplePattern -#define grViewport trap_grViewport - -/* -** texture mapping control functions -*/ -#define grTexCalcMemRequired trap_grTexCalcMemRequired -#define grTexTextureMemRequired trap_grTexTextureMemRequired -#define grTexMinAddress trap_grTexMinAddress -#define grTexMaxAddress trap_grTexMaxAddress -#define grTexNCCTable trap_grTexNCCTable -#define grTexSource trap_grTexSource -#define grTexClampMode trap_grTexClampMode -#define grTexCombine trap_grTexCombine -#define grTexDetailControl trap_grTexDetailControl -#define grTexFilterMode trap_grTexFilterMode -#define grTexLodBiasValue trap_grTexLodBiasValue -#define grTexDownloadMipMap trap_grTexDownloadMipMap -#define grTexDownloadMipMapLevel trap_grTexDownloadMipMapLevel -#define grTexDownloadMipMapLevelPartial trap_grTexDownloadMipMapLevelPartial -#define grTexDownloadTable trap_grTexDownloadTable -#define grTexDownloadTablePartial trap_grTexDownloadTablePartial -#define grTexMipMapMode trap_grTexMipMapMode -#define grTexMultibase trap_grTexMultibase -#define grTexMultibaseAddress trap_grTexMultibaseAddress - -/* -** linear frame buffer functions -*/ -#define grLfbLock trap_grLfbLock -#define grLfbUnlock trap_grLfbUnlock -#define grLfbConstantAlpha trap_grLfbConstantAlpha -#define grLfbConstantDepth trap_grLfbConstantDepth -#define grLfbWriteColorSwizzle trap_grLfbWriteColorSwizzle -#define grLfbWriteColorFormat trap_grLfbWriteColorFormat -#define grLfbWriteRegion trap_grLfbWriteRegion -#define grLfbReadRegion trap_grLfbReadRegion - -/* -** glide management functions -*/ -#define grGlideInit trap_grGlideInit -#define grGlideShutdown trap_grGlideShutdown -#define grGlideGetState trap_grGlideGetState -#define grGlideSetState trap_grGlideSetState -#define grGlideGetVertexLayout trap_grGlideGetVertexLayout -#define grGlideSetVertexLayout trap_grGlideSetVertexLayout - -/* -** glide utility functions -*/ -#define guGammaCorrectionRGB trap_guGammaCorrectionRGB -#define guFogTableIndexToW trap_guFogTableIndexToW -#define guFogGenerateExp trap_guFogGenerateExp -#define guFogGenerateExp2 trap_guFogGenerateExp2 -#define guFogGenerateLinear trap_guFogGenerateLinear -#endif /* FX_TRAP_GLIDE_internal */ -#endif /* FX_TRAP_GLIDE */ - - - -/* */ -#define TX_MAX_LEVEL 16 -typedef struct _TxMip { - int format; - int width; - int height; - int depth; - int size; - void *data[TX_MAX_LEVEL]; - FxU32 pal[256]; -} TxMip; - -#define TX_DITHER_NONE 0x00000000 -#define TX_DITHER_4x4 0x00000001 -#define TX_DITHER_ERR 0x00000002 - -#define TX_COMPRESSION_STATISTICAL 0x00000000 -#define TX_COMPRESSION_HEURISTIC 0x00000010 -/* */ - - - -struct tdfx_glide { - /* - ** glide extensions - */ - void (FX_CALL *grSetNumPendingBuffers) (FxI32 NumPendingBuffers); - char * (FX_CALL *grGetRegistryOrEnvironmentStringExt) (char *theEntry); - void (FX_CALL *grGetGammaTableExt) (FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue); - void (FX_CALL *grChromaRangeModeExt) (GrChromakeyMode_t mode); - void (FX_CALL *grChromaRangeExt) (GrColor_t color, GrColor_t range, GrChromaRangeMode_t match_mode); - void (FX_CALL *grTexChromaModeExt) (GrChipID_t tmu, GrChromakeyMode_t mode); - void (FX_CALL *grTexChromaRangeExt) (GrChipID_t tmu, GrColor_t min, GrColor_t max, GrTexChromakeyMode_t mode); - - /* pointcast */ - void (FX_CALL *grTexDownloadTableExt) (GrChipID_t tmu, GrTexTable_t type, void *data); - void (FX_CALL *grTexDownloadTablePartialExt) (GrChipID_t tmu, GrTexTable_t type, void *data, int start, int end); - void (FX_CALL *grTexNCCTableExt) (GrChipID_t tmu, GrNCCTable_t table); - - /* tbext */ - void (FX_CALL *grTextureBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); - void (FX_CALL *grTextureAuxBufferExt) (GrChipID_t tmu, FxU32 startAddress, GrLOD_t thisLOD, GrLOD_t largeLOD, GrAspectRatio_t aspectRatio, GrTextureFormat_t format, FxU32 odd_even_mask); - void (FX_CALL *grAuxBufferExt) (GrBuffer_t buffer); - - /* napalm */ - GrContext_t (FX_CALL *grSstWinOpenExt) (FxU32 hWnd, GrScreenResolution_t resolution, GrScreenRefresh_t refresh, GrColorFormat_t format, GrOriginLocation_t origin, GrPixelFormat_t pixelformat, int nColBuffers, int nAuxBuffers); - void (FX_CALL *grStencilFuncExt) (GrCmpFnc_t fnc, GrStencil_t ref, GrStencil_t mask); - void (FX_CALL *grStencilMaskExt) (GrStencil_t value); - void (FX_CALL *grStencilOpExt) (GrStencilOp_t stencil_fail, GrStencilOp_t depth_fail, GrStencilOp_t depth_pass); - void (FX_CALL *grLfbConstantStencilExt) (GrStencil_t value); - void (FX_CALL *grBufferClearExt) (GrColor_t color, GrAlpha_t alpha, FxU32 depth, GrStencil_t stencil); - void (FX_CALL *grColorCombineExt) (GrCCUColor_t a, GrCombineMode_t a_mode, GrCCUColor_t b, GrCombineMode_t b_mode, GrCCUColor_t c, FxBool c_invert, GrCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); - void (FX_CALL *grAlphaCombineExt) (GrACUColor_t a, GrCombineMode_t a_mode, GrACUColor_t b, GrCombineMode_t b_mode, GrACUColor_t c, FxBool c_invert, GrACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); - void (FX_CALL *grTexColorCombineExt) (GrChipID_t tmu, GrTCCUColor_t a, GrCombineMode_t a_mode, GrTCCUColor_t b, GrCombineMode_t b_mode, GrTCCUColor_t c, FxBool c_invert, GrTCCUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); - void (FX_CALL *grTexAlphaCombineExt) (GrChipID_t tmu, GrTACUColor_t a, GrCombineMode_t a_mode, GrTACUColor_t b, GrCombineMode_t b_mode, GrTACUColor_t c, FxBool c_invert, GrTACUColor_t d, FxBool d_invert, FxU32 shift, FxBool invert); - void (FX_CALL *grConstantColorValueExt) (GrChipID_t tmu, GrColor_t value); - void (FX_CALL *grColorMaskExt) (FxBool r, FxBool g, FxBool b, FxBool a); - void (FX_CALL *grAlphaBlendFunctionExt) (GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df, GrAlphaBlendOp_t rgb_op, GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df, GrAlphaBlendOp_t alpha_op); - void (FX_CALL *grTBufferWriteMaskExt) (FxU32 tmask); - - /* - ** Texus2 functions - */ - void (FX_CALL *txImgQuantize) (char *dst, char *src, int w, int h, FxU32 format, FxU32 dither); - void (FX_CALL *txMipQuantize) (TxMip *pxMip, TxMip *txMip, int fmt, FxU32 d, FxU32 comp); - void (FX_CALL *txPalToNcc) (GuNccTable *ncc_table, const FxU32 *pal); -}; - -void tdfx_hook_glide (struct tdfx_glide *Glide, int pointcast); - -#endif diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c deleted file mode 100644 index 1fedf2ab96..0000000000 --- a/src/mesa/drivers/glide/fxglidew.c +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - -/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#if defined(FX) -#include "fxglidew.h" -#include "fxdrv.h" - -#include -#include - -FxI32 -FX_grGetInteger_NoLock(FxU32 pname) -{ - FxI32 result; - - if (grGet(pname, 4, &result)) { - return result; - } - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "FX_grGetInteger_NoLock: wrong parameter (%lx)\n", pname); - } - return -1; -} - -FxBool -FX_grSstControl(FxU32 code) -{ - /* The glide 3 sources call for grEnable/grDisable to be called in exchange - * for grSstControl. */ - switch (code) { - case GR_CONTROL_ACTIVATE: - grEnable(GR_PASSTHRU); - break; - case GR_CONTROL_DEACTIVATE: - grDisable(GR_PASSTHRU); - break; - } - /* Appearently GR_CONTROL_RESIZE can be ignored. */ - return 1; /* OK? */ -} - - -int -FX_grSstScreenWidth() -{ - FxI32 result[4]; - - BEGIN_BOARD_LOCK(); - grGet(GR_VIEWPORT, sizeof(FxI32) * 4, result); - END_BOARD_LOCK(); - - return result[2]; -} - -int -FX_grSstScreenHeight() -{ - FxI32 result[4]; - - BEGIN_BOARD_LOCK(); - grGet(GR_VIEWPORT, sizeof(FxI32) * 4, result); - END_BOARD_LOCK(); - - return result[3]; -} - -void -FX_grSstPerfStats(GrSstPerfStats_t * st) -{ - FxI32 n; - grGet(GR_STATS_PIXELS_IN, 4, &n); - st->pixelsIn = n; - grGet(GR_STATS_PIXELS_CHROMA_FAIL, 4, &n); - st->chromaFail = n; - grGet(GR_STATS_PIXELS_DEPTHFUNC_FAIL, 4, &n); - st->zFuncFail = n; - grGet(GR_STATS_PIXELS_AFUNC_FAIL, 4, &n); - st->aFuncFail = n; - grGet(GR_STATS_PIXELS_OUT, 4, &n); - st->pixelsOut = n; -} - -void -FX_setupGrVertexLayout(void) -{ - BEGIN_BOARD_LOCK(); - grReset(GR_VERTEX_PARAMETER); - - grCoordinateSpace(GR_WINDOW_COORDS); - grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE); -#if FX_PACKEDCOLOR - grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PARGB_OFFSET << 2, GR_PARAM_ENABLE); -#else /* !FX_PACKEDCOLOR */ - grVertexLayout(GR_PARAM_RGB, GR_VERTEX_RGB_OFFSET << 2, GR_PARAM_ENABLE); - grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE); -#endif /* !FX_PACKEDCOLOR */ - grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE); - grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE); - grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, - GR_PARAM_ENABLE); - grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, - GR_PARAM_DISABLE); - grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, - GR_PARAM_DISABLE); - grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, - GR_PARAM_DISABLE); - END_BOARD_LOCK(); -} - -void -FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask) -{ - switch (hintType) { - case GR_HINT_STWHINT: - { - if (hintMask & GR_STWHINT_W_DIFF_TMU0) - grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, - GR_PARAM_ENABLE); - else - grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, - GR_PARAM_DISABLE); - - if (hintMask & GR_STWHINT_ST_DIFF_TMU1) - grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, - GR_PARAM_ENABLE); - else - grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, - GR_PARAM_DISABLE); - - if (hintMask & GR_STWHINT_W_DIFF_TMU1) - grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, - GR_PARAM_ENABLE); - else - grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, - GR_PARAM_DISABLE); - - } - } -} - -/* - * Glide3 doesn't have the grSstQueryHardware function anymore. - * Instead, we call grGet() and fill in the data structures ourselves. - */ -int -FX_grSstQueryHardware(GrHwConfiguration * config) -{ - int i, j; - int numFB; - - BEGIN_BOARD_LOCK(); - - grGet(GR_NUM_BOARDS, 4, (void *) &(config->num_sst)); - if (config->num_sst == 0) - return 0; - - for (i = 0; i < config->num_sst; i++) { - FxI32 result; - const char *extension; - - grSstSelect(i); - - extension = grGetString(GR_HARDWARE); - if (strstr(extension, "Rush")) { - config->SSTs[i].type = GR_SSTTYPE_SST96; - } else if (strstr(extension, "Voodoo2")) { - config->SSTs[i].type = GR_SSTTYPE_Voodoo2; - } else if (strstr(extension, "Voodoo Banshee")) { - config->SSTs[i].type = GR_SSTTYPE_Banshee; - } else if (strstr(extension, "Voodoo3")) { - config->SSTs[i].type = GR_SSTTYPE_Voodoo3; - } else if (strstr(extension, "Voodoo4")) { - config->SSTs[i].type = GR_SSTTYPE_Voodoo4; - } else if (strstr(extension, "Voodoo5")) { - config->SSTs[i].type = GR_SSTTYPE_Voodoo5; - } else { - config->SSTs[i].type = GR_SSTTYPE_VOODOO; - } - - grGet(GR_MEMORY_FB, 4, &result); - config->SSTs[i].fbRam = result / (1024 * 1024); - - grGet(GR_NUM_TMU, 4, &result); - config->SSTs[i].nTexelfx = result; - - grGet(GR_REVISION_FB, 4, &result); - config->SSTs[i].fbiRev = result; - - for (j = 0; j < config->SSTs[i].nTexelfx; j++) { - grGet(GR_MEMORY_TMU, 4, &result); - config->SSTs[i].tmuConfig[j].tmuRam = result / (1024 * 1024); - grGet(GR_REVISION_TMU, 4, &result); - config->SSTs[i].tmuConfig[j].tmuRev = result; - } - - extension = grGetString(GR_EXTENSION); - config->SSTs[i].HavePalExt = (strstr(extension, " PALETTE6666 ") != NULL); - config->SSTs[i].HavePixExt = (strstr(extension, " PIXEXT ") != NULL); - config->SSTs[i].HaveTexFmt = (strstr(extension, " TEXFMT ") != NULL); - config->SSTs[i].HaveCmbExt = (strstr(extension, " COMBINE ") != NULL); - config->SSTs[i].HaveMirExt = (strstr(extension, " TEXMIRROR ") != NULL); - config->SSTs[i].HaveTexUma = (strstr(extension, " TEXUMA ") != NULL); - - /* number of Voodoo chips */ - grGet(GR_NUM_FB, 4, (void *) &numFB); - config->SSTs[i].numChips = numFB; - - } - - tdfx_hook_glide(&config->Glide, getenv("MESA_FX_POINTCAST") != NULL); - - END_BOARD_LOCK(); - return 1; -} - - - -#else - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_glidew(void); -int -gl_fx_dummy_function_glidew(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxglidew.h b/src/mesa/drivers/glide/fxglidew.h deleted file mode 100644 index a19d0b58c7..0000000000 --- a/src/mesa/drivers/glide/fxglidew.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - - -#ifndef __FX_GLIDE_WARPER__ -#define __FX_GLIDE_WARPER__ - - -#include "fxg.h" - -#ifndef FX_PACKEDCOLOR -#define FX_PACKEDCOLOR 1 -#endif - -#define MAX_NUM_SST 4 - -enum { - GR_SSTTYPE_VOODOO = 0, - GR_SSTTYPE_SST96 = 1, - GR_SSTTYPE_AT3D = 2, - GR_SSTTYPE_Voodoo2 = 3, - GR_SSTTYPE_Banshee = 4, - GR_SSTTYPE_Voodoo3 = 5, - GR_SSTTYPE_Voodoo4 = 6, - GR_SSTTYPE_Voodoo5 = 7 -}; - -#define GrState void - -typedef int GrSstType; - -typedef struct GrTMUConfig_St { - int tmuRev; /* Rev of Texelfx chip */ - int tmuRam; /* 1, 2, or 4 MB */ -} GrTMUConfig_t; - -typedef struct { - int num_sst; /* # of HW units in the system */ - struct SstCard_St { - GrSstType type; /* Which hardware is it? */ - int fbRam; /* 1, 2, or 4 MB */ - int fbiRev; /* Rev of Pixelfx chip */ - int nTexelfx; /* How many texelFX chips are there? */ - int numChips; /* Number of Voodoo chips */ - GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU]; /* Configuration of the Texelfx chips */ - /* Glide3 extensions */ - FxBool HavePalExt; /* PALETTE6666 */ - FxBool HavePixExt; /* PIXEXT */ - FxBool HaveTexFmt; /* TEXFMT */ - FxBool HaveCmbExt; /* COMBINE */ - FxBool HaveMirExt; /* TEXMIRROR */ - FxBool HaveTexUma; /* TEXUMA */ - } - SSTs[MAX_NUM_SST]; /* configuration for each board */ - struct tdfx_glide Glide; -} GrHwConfiguration; - - - -typedef FxU32 GrHint_t; -#define GR_HINTTYPE_MIN 0 -#define GR_HINT_STWHINT 0 - -typedef FxU32 GrSTWHint_t; -#define GR_STWHINT_W_DIFF_FBI FXBIT(0) -#define GR_STWHINT_W_DIFF_TMU0 FXBIT(1) -#define GR_STWHINT_ST_DIFF_TMU0 FXBIT(2) -#define GR_STWHINT_W_DIFF_TMU1 FXBIT(3) -#define GR_STWHINT_ST_DIFF_TMU1 FXBIT(4) -#define GR_STWHINT_W_DIFF_TMU2 FXBIT(5) -#define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6) - -#define GR_CONTROL_ACTIVATE 1 -#define GR_CONTROL_DEACTIVATE 0 - - - -/* -** move the vertex layout defintion to application -*/ -typedef struct { - float sow; /* s texture ordinate (s over w) */ - float tow; /* t texture ordinate (t over w) */ - float oow; /* 1/w (used mipmapping - really 0xfff/w) */ -} GrTmuVertex; - -#if FX_PACKEDCOLOR -typedef struct { - float x, y; /* X and Y in screen space */ - float ooz; /* 65535/Z (used for Z-buffering) */ - float oow; /* 1/W (used for W-buffering, texturing) */ - unsigned char pargb[4]; /* B, G, R, A [0..255] */ - GrTmuVertex tmuvtx[GLIDE_NUM_TMU]; - float fog; /* fog coordinate */ - unsigned char pspec[4]; /* B, G, R, A [0..255] */ - float psize; /* point size */ - long pad[16 - 14]; /* ensure 64b structure */ -} GrVertex; - -#define GR_VERTEX_X_OFFSET 0 -#define GR_VERTEX_Y_OFFSET 1 -#define GR_VERTEX_OOZ_OFFSET 2 -#define GR_VERTEX_OOW_OFFSET 3 -#define GR_VERTEX_PARGB_OFFSET 4 -#define GR_VERTEX_SOW_TMU0_OFFSET 5 -#define GR_VERTEX_TOW_TMU0_OFFSET 6 -#define GR_VERTEX_OOW_TMU0_OFFSET 7 -#define GR_VERTEX_SOW_TMU1_OFFSET 8 -#define GR_VERTEX_TOW_TMU1_OFFSET 9 -#define GR_VERTEX_OOW_TMU1_OFFSET 10 -#define GR_VERTEX_FOG_OFFSET 11 -#define GR_VERTEX_PSPEC_OFFSET 12 -#else /* !FX_PACKEDCOLOR */ -typedef struct { - float x, y; /* X and Y in screen space */ - float ooz; /* 65535/Z (used for Z-buffering) */ - float oow; /* 1/W (used for W-buffering, texturing) */ - float r, g, b, a; /* R, G, B, A [0..255] */ - GrTmuVertex tmuvtx[GLIDE_NUM_TMU]; - float fog; /* fog coordinate */ - float r1, g1, b1; /* R, G, B [0..255] */ - float psize; /* point size */ - long pad[20 - 19]; /* ensure multiple of 16 */ -} GrVertex; - -#define GR_VERTEX_X_OFFSET 0 -#define GR_VERTEX_Y_OFFSET 1 -#define GR_VERTEX_OOZ_OFFSET 2 -#define GR_VERTEX_OOW_OFFSET 3 -#define GR_VERTEX_RGB_OFFSET 4 -#define GR_VERTEX_A_OFFSET 7 -#define GR_VERTEX_SOW_TMU0_OFFSET 8 -#define GR_VERTEX_TOW_TMU0_OFFSET 9 -#define GR_VERTEX_OOW_TMU0_OFFSET 10 -#define GR_VERTEX_SOW_TMU1_OFFSET 11 -#define GR_VERTEX_TOW_TMU1_OFFSET 12 -#define GR_VERTEX_OOW_TMU1_OFFSET 13 -#define GR_VERTEX_FOG_OFFSET 14 -#define GR_VERTEX_SPEC_OFFSET 15 -#endif /* !FX_PACKEDCOLOR */ - - - -/* - * For Lod/LodLog2 conversion. - */ -#define FX_largeLodLog2(info) (info).largeLodLog2 -#define FX_aspectRatioLog2(info) (info).aspectRatioLog2 -#define FX_smallLodLog2(info) (info).smallLodLog2 -#define FX_lodToValue(val) ((int)(GR_LOD_LOG2_256-val)) -#define FX_largeLodValue(info) ((int)(GR_LOD_LOG2_256-(info).largeLodLog2)) -#define FX_smallLodValue(info) ((int)(GR_LOD_LOG2_256-(info).smallLodLog2)) -#define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_LOG2_256-val)) - - - -/* - * Query - */ -extern int FX_grSstScreenWidth(void); -extern int FX_grSstScreenHeight(void); -extern void FX_grSstPerfStats(GrSstPerfStats_t *st); -extern int FX_grSstQueryHardware(GrHwConfiguration *config); -#define FX_grGetInteger FX_grGetInteger_NoLock -extern FxI32 FX_grGetInteger_NoLock(FxU32 pname); - - - -/* - * GrHints - */ -#define FX_grHints FX_grHints_NoLock -extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask); - - - -/* - * Needed for Glide3 only, to set up Glide2 compatible vertex layout. - */ -extern void FX_setupGrVertexLayout(void); - - - -/* - * grSstControl stuff - */ -extern FxBool FX_grSstControl(FxU32 code); - -#define FX_grBufferClear(c, a, d) \ - do { \ - BEGIN_CLIP_LOOP(); \ - grBufferClear(c, a, d); \ - END_CLIP_LOOP(); \ - } while (0) - - - -#endif /* __FX_GLIDE_WARPER__ */ diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c deleted file mode 100644 index 9bb352fcb8..0000000000 --- a/src/mesa/drivers/glide/fxsetup.c +++ /dev/null @@ -1,2220 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - -/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#if defined(FX) - -#include "fxdrv.h" -#include "main/enums.h" -#include "main/formats.h" -#include "main/texstore.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "swrast/swrast.h" - - -static void -fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - GLint minl, maxl; - - if (ti->validated) { - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxTexValidate(NOP)\n"); - } - return; - } - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxTexValidate(%p (%d))\n", (void *)tObj, tObj->Name); - } - - ti->tObj = tObj; - minl = ti->minLevel = tObj->BaseLevel; - maxl = ti->maxLevel = MIN2(tObj->MaxLevel, tObj->Image[0][0]->MaxLog2); - -#if FX_RESCALE_BIG_TEXURES_HACK -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - /* [dBorca] - * Fake textures larger than HW supports: - * 1) we have mipmaps. Then we just push up to the first supported - * LOD. A possible drawback is that Mesa will ignore the skipped - * LODs on further texture handling. - * Will this interfere with GL_TEXTURE_[MIN|BASE]_LEVEL? How? - * 2) we don't have mipmaps. We need to rescale the big LOD in place. - * The above approach is somehow dumb! we might have rescaled - * once in TexImage2D to accomodate aspect ratio, and now we - * are rescaling again. The thing is, in TexImage2D we don't - * know whether we'll hit 1) or 2) by the time of validation. - */ - if ((tObj->MinFilter == GL_NEAREST) || (tObj->MinFilter == GL_LINEAR)) { - /* no mipmaps! */ - struct gl_texture_image *texImage = tObj->Image[0][minl]; - tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - GLint _w, _h, maxSize = 1 << fxMesa->textureMaxLod; - if ((mml->width > maxSize) || (mml->height > maxSize)) { - /* need to rescale */ - GLint texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); - GLvoid *texImage_Data = texImage->Data; - _w = MIN2(texImage->Width, maxSize); - _h = MIN2(texImage->Height, maxSize); - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxTexValidate: rescaling %d x %d -> %d x %d\n", - texImage->Width, texImage->Height, _w, _h); - } - /* we should leave these as is and... (!) */ - texImage->Width = _w; - texImage->Height = _h; - fxTexGetInfo(_w, _h, NULL, NULL, NULL, NULL, - &(mml->wScale), &(mml->hScale)); - _w *= mml->wScale; - _h *= mml->hScale; - texImage->Data = malloc(_w * _h * texelBytes); - _mesa_rescale_teximage2d(texelBytes, - mml->width, - _w * texelBytes, /* dst stride */ - mml->width, mml->height, /* src */ - _w, _h, /* dst */ - texImage_Data /*src*/, texImage->Data /*dst*/ ); - free(texImage_Data); - mml->width = _w; - mml->height = _h; - /* (!) ... and set mml->wScale = _w / texImage->Width */ - } - } else { - /* mipmapping */ - if (maxl - minl > fxMesa->textureMaxLod) { - /* skip a certain number of LODs */ - minl += maxl - fxMesa->textureMaxLod; - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxTexValidate: skipping %d LODs\n", minl - ti->minLevel); - } - ti->minLevel = tObj->BaseLevel = minl; - } - } -} -#endif - - fxTexGetInfo(tObj->Image[0][minl]->Width, tObj->Image[0][minl]->Height, - &(FX_largeLodLog2(ti->info)), &(FX_aspectRatioLog2(ti->info)), - &(ti->sScale), &(ti->tScale), - NULL, NULL); - - if ((tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) - fxTexGetInfo(tObj->Image[0][maxl]->Width, tObj->Image[0][maxl]->Height, - &(FX_smallLodLog2(ti->info)), NULL, - NULL, NULL, NULL, NULL); - else - FX_smallLodLog2(ti->info) = FX_largeLodLog2(ti->info); - - /* [dBorca] this is necessary because of fxDDCompressedTexImage2D */ - if (ti->padded) { - struct gl_texture_image *texImage = tObj->Image[0][minl]; - tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - if (mml->wScale != 1 || mml->hScale != 1) { - ti->sScale /= mml->wScale; - ti->tScale /= mml->hScale; - } - } - - ti->baseLevelInternalFormat = tObj->Image[0][minl]->Format; - - ti->validated = GL_TRUE; - - ti->info.data = NULL; -} - -static void -fxPrintUnitsMode(const char *msg, GLuint mode) -{ - fprintf(stderr, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", - msg, - mode, - (mode & FX_UM_E0_REPLACE) ? "E0_REPLACE, " : "", - (mode & FX_UM_E0_MODULATE) ? "E0_MODULATE, " : "", - (mode & FX_UM_E0_DECAL) ? "E0_DECAL, " : "", - (mode & FX_UM_E0_BLEND) ? "E0_BLEND, " : "", - (mode & FX_UM_E1_REPLACE) ? "E1_REPLACE, " : "", - (mode & FX_UM_E1_MODULATE) ? "E1_MODULATE, " : "", - (mode & FX_UM_E1_DECAL) ? "E1_DECAL, " : "", - (mode & FX_UM_E1_BLEND) ? "E1_BLEND, " : "", - (mode & FX_UM_E0_ALPHA) ? "E0_ALPHA, " : "", - (mode & FX_UM_E0_LUMINANCE) ? "E0_LUMINANCE, " : "", - (mode & FX_UM_E0_LUMINANCE_ALPHA) ? "E0_LUMINANCE_ALPHA, " : "", - (mode & FX_UM_E0_INTENSITY) ? "E0_INTENSITY, " : "", - (mode & FX_UM_E0_RGB) ? "E0_RGB, " : "", - (mode & FX_UM_E0_RGBA) ? "E0_RGBA, " : "", - (mode & FX_UM_E1_ALPHA) ? "E1_ALPHA, " : "", - (mode & FX_UM_E1_LUMINANCE) ? "E1_LUMINANCE, " : "", - (mode & FX_UM_E1_LUMINANCE_ALPHA) ? "E1_LUMINANCE_ALPHA, " : "", - (mode & FX_UM_E1_INTENSITY) ? "E1_INTENSITY, " : "", - (mode & FX_UM_E1_RGB) ? "E1_RGB, " : "", - (mode & FX_UM_E1_RGBA) ? "E1_RGBA, " : "", - (mode & FX_UM_COLOR_ITERATED) ? "COLOR_ITERATED, " : "", - (mode & FX_UM_COLOR_CONSTANT) ? "COLOR_CONSTANT, " : "", - (mode & FX_UM_ALPHA_ITERATED) ? "ALPHA_ITERATED, " : "", - (mode & FX_UM_ALPHA_CONSTANT) ? "ALPHA_CONSTANT, " : ""); -} - -static GLuint -fxGetTexSetConfiguration(GLcontext * ctx, - struct gl_texture_object *tObj0, - struct gl_texture_object *tObj1) -{ - GLuint unitsmode = 0; - GLuint envmode = 0; - GLuint ifmt = 0; - - if ((ctx->Light.ShadeModel == GL_SMOOTH) || 1 || - (ctx->Point.SmoothFlag) || - (ctx->Line.SmoothFlag) || - (ctx->Polygon.SmoothFlag)) unitsmode |= FX_UM_ALPHA_ITERATED; - else - unitsmode |= FX_UM_ALPHA_CONSTANT; - - if (ctx->Light.ShadeModel == GL_SMOOTH || 1) - unitsmode |= FX_UM_COLOR_ITERATED; - else - unitsmode |= FX_UM_COLOR_CONSTANT; - - - - /* - OpenGL Feeds Texture 0 into Texture 1 - Glide Feeds Texture 1 into Texture 0 - */ - if (tObj0) { - tfxTexInfo *ti0 = fxTMGetTexInfo(tObj0); - - switch (ti0->baseLevelInternalFormat) { - case GL_ALPHA: - ifmt |= FX_UM_E0_ALPHA; - break; - case GL_LUMINANCE: - ifmt |= FX_UM_E0_LUMINANCE; - break; - case GL_LUMINANCE_ALPHA: - ifmt |= FX_UM_E0_LUMINANCE_ALPHA; - break; - case GL_INTENSITY: - ifmt |= FX_UM_E0_INTENSITY; - break; - case GL_RGB: - ifmt |= FX_UM_E0_RGB; - break; - case GL_RGBA: - ifmt |= FX_UM_E0_RGBA; - break; - } - - switch (ctx->Texture.Unit[0].EnvMode) { - case GL_DECAL: - envmode |= FX_UM_E0_DECAL; - break; - case GL_MODULATE: - envmode |= FX_UM_E0_MODULATE; - break; - case GL_REPLACE: - envmode |= FX_UM_E0_REPLACE; - break; - case GL_BLEND: - envmode |= FX_UM_E0_BLEND; - break; - case GL_ADD: - envmode |= FX_UM_E0_ADD; - break; - default: - /* do nothing */ - break; - } - } - - if (tObj1) { - tfxTexInfo *ti1 = fxTMGetTexInfo(tObj1); - - switch (ti1->baseLevelInternalFormat) { - case GL_ALPHA: - ifmt |= FX_UM_E1_ALPHA; - break; - case GL_LUMINANCE: - ifmt |= FX_UM_E1_LUMINANCE; - break; - case GL_LUMINANCE_ALPHA: - ifmt |= FX_UM_E1_LUMINANCE_ALPHA; - break; - case GL_INTENSITY: - ifmt |= FX_UM_E1_INTENSITY; - break; - case GL_RGB: - ifmt |= FX_UM_E1_RGB; - break; - case GL_RGBA: - ifmt |= FX_UM_E1_RGBA; - break; - default: - /* do nothing */ - break; - } - - switch (ctx->Texture.Unit[1].EnvMode) { - case GL_DECAL: - envmode |= FX_UM_E1_DECAL; - break; - case GL_MODULATE: - envmode |= FX_UM_E1_MODULATE; - break; - case GL_REPLACE: - envmode |= FX_UM_E1_REPLACE; - break; - case GL_BLEND: - envmode |= FX_UM_E1_BLEND; - break; - case GL_ADD: - envmode |= FX_UM_E1_ADD; - break; - default: - /* do nothing */ - break; - } - } - - unitsmode |= (ifmt | envmode); - - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fxPrintUnitsMode("fxGetTexSetConfiguration", unitsmode); - - return unitsmode; -} - -/************************************************************************/ -/************************* Rendering Mode SetUp *************************/ -/************************************************************************/ - -/************************* Single Texture Set ***************************/ - -static void -fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - int tmu; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupSingleTMU_NoLock(%p (%d))\n", (void *)tObj, tObj->Name); - } - - ti->lastTimeUsed = fxMesa->texBindNumber; - - /* Make sure we're not loaded incorrectly */ - if (ti->isInTM) { - if (ti->LODblend) { - if (ti->whichTMU != FX_TMU_SPLIT) - fxTMMoveOutTM(fxMesa, tObj); - } - else { - if (ti->whichTMU == FX_TMU_SPLIT) - fxTMMoveOutTM(fxMesa, tObj); - } - } - - /* Make sure we're loaded correctly */ - if (!ti->isInTM) { - if (ti->LODblend) - fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU_SPLIT); - else { - if (fxMesa->haveTwoTMUs) { - if (fxTMCheckStartAddr(fxMesa, FX_TMU0, ti)) { - fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0); - } - else { - fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU1); - } - } - else - fxTMMoveInTM_NoLock(fxMesa, tObj, FX_TMU0); - } - } - - if (ti->LODblend && ti->whichTMU == FX_TMU_SPLIT) { - /* broadcast */ - if ((ti->info.format == GR_TEXFMT_P_8) - && (!fxMesa->haveGlobalPaletteTexture)) { - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupSingleTMU_NoLock: uploading texture palette\n"); - } - grTexDownloadTable(ti->paltype, &(ti->palette)); - } - - grTexClampMode(GR_TMU0, ti->sClamp, ti->tClamp); - grTexClampMode(GR_TMU1, ti->sClamp, ti->tClamp); - grTexFilterMode(GR_TMU0, ti->minFilt, ti->maxFilt); - grTexFilterMode(GR_TMU1, ti->minFilt, ti->maxFilt); - grTexMipMapMode(GR_TMU0, ti->mmMode, ti->LODblend); - grTexMipMapMode(GR_TMU1, ti->mmMode, ti->LODblend); - - grTexSource(GR_TMU0, ti->tm[FX_TMU0]->startAddr, - GR_MIPMAPLEVELMASK_ODD, &(ti->info)); - grTexSource(GR_TMU1, ti->tm[FX_TMU1]->startAddr, - GR_MIPMAPLEVELMASK_EVEN, &(ti->info)); - } - else { - if (ti->whichTMU == FX_TMU_BOTH) - tmu = FX_TMU0; - else - tmu = ti->whichTMU; - - /* pointcast */ - if ((ti->info.format == GR_TEXFMT_P_8) - && (!fxMesa->haveGlobalPaletteTexture)) { - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupSingleTMU_NoLock: uploading texture palette\n"); - } - fxMesa->Glide.grTexDownloadTableExt(tmu, ti->paltype, &(ti->palette)); - } - - /* KW: The alternative is to do the download to the other tmu. If - * we get to this point, I think it means we are thrashing the - * texture memory, so perhaps it's not a good idea. - */ - if (ti->LODblend && (TDFX_DEBUG & VERBOSE_DRIVER)) { - fprintf(stderr, "fxSetupSingleTMU_NoLock: not blending texture - only one tmu\n"); - } - - grTexClampMode(tmu, ti->sClamp, ti->tClamp); - grTexFilterMode(tmu, ti->minFilt, ti->maxFilt); - grTexMipMapMode(tmu, ti->mmMode, FXFALSE); - - grTexSource(tmu, ti->tm[tmu]->startAddr, GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); - } -} - -static void -fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) -{ - struct tdfx_texcombine tex0, tex1; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSelectSingleTMUSrc_NoLock(%d, %d)\n", tmu, LODblend); - } - - tex0.InvertRGB = FXFALSE; - tex0.InvertAlpha = FXFALSE; - tex1.InvertRGB = FXFALSE; - tex1.InvertAlpha = FXFALSE; - - if (LODblend) { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION; - - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - fxMesa->tmuSrc = FX_TMU_SPLIT; - } - else { - if (tmu != FX_TMU1) { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex0.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex0.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - fxMesa->tmuSrc = FX_TMU0; - } - else { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - /* correct values to set TMU0 in passthrough mode */ - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; - - fxMesa->tmuSrc = FX_TMU1; - } - } - - grTexCombine(GR_TMU0, - tex0.FunctionRGB, - tex0.FactorRGB, - tex0.FunctionAlpha, - tex0.FactorAlpha, - tex0.InvertRGB, - tex0.InvertAlpha); - if (fxMesa->haveTwoTMUs) { - grTexCombine(GR_TMU1, - tex1.FunctionRGB, - tex1.FactorRGB, - tex1.FunctionAlpha, - tex1.FactorAlpha, - tex1.InvertRGB, - tex1.InvertAlpha); - } -} - -static void -fxSetupTextureSingleTMU_NoLock(GLcontext * ctx, GLuint textureset) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - struct tdfx_combine alphaComb, colorComb; - GrCombineLocal_t localc, locala; - GLuint unitsmode; - GLint ifmt; - tfxTexInfo *ti; - struct gl_texture_object *tObj = ctx->Texture.Unit[textureset]._Current; - int tmu; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureSingleTMU_NoLock(%d)\n", textureset); - } - - ti = fxTMGetTexInfo(tObj); - - fxTexValidate(ctx, tObj); - - fxSetupSingleTMU_NoLock(fxMesa, tObj); - - if (ti->whichTMU == FX_TMU_BOTH) - tmu = FX_TMU0; - else - tmu = ti->whichTMU; - if (fxMesa->tmuSrc != tmu) - fxSelectSingleTMUSrc_NoLock(fxMesa, tmu, ti->LODblend); - - if (textureset == 0 || !fxMesa->haveTwoTMUs) - unitsmode = fxGetTexSetConfiguration(ctx, tObj, NULL); - else - unitsmode = fxGetTexSetConfiguration(ctx, NULL, tObj); - -/* if(fxMesa->lastUnitsMode==unitsmode) */ -/* return; */ - - fxMesa->lastUnitsMode = unitsmode; - - fxMesa->stw_hint_state = 0; - FX_grHints_NoLock(GR_HINT_STWHINT, 0); - - ifmt = ti->baseLevelInternalFormat; - - if (unitsmode & FX_UM_ALPHA_ITERATED) - locala = GR_COMBINE_LOCAL_ITERATED; - else - locala = GR_COMBINE_LOCAL_CONSTANT; - - if (unitsmode & FX_UM_COLOR_ITERATED) - localc = GR_COMBINE_LOCAL_ITERATED; - else - localc = GR_COMBINE_LOCAL_CONSTANT; - - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fxSetupTextureSingleTMU_NoLock: envmode is %s\n", - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[textureset].EnvMode)); - - alphaComb.Local = locala; - alphaComb.Invert = FXFALSE; - colorComb.Local = localc; - colorComb.Invert = FXFALSE; - - switch (ctx->Texture.Unit[textureset].EnvMode) { - case GL_DECAL: - alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_NONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - - colorComb.Function = GR_COMBINE_FUNCTION_BLEND; - colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - break; - case GL_MODULATE: - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - - if (ifmt == GL_ALPHA) { - colorComb.Function = GR_COMBINE_FUNCTION_LOCAL; - colorComb.Factor = GR_COMBINE_FACTOR_NONE; - colorComb.Other = GR_COMBINE_OTHER_NONE; - } else { - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_LOCAL; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - break; - case GL_BLEND: - if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) { - /* Av = Af */ - alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_NONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - } - else if (ifmt == GL_INTENSITY) { - /* Av = Af * (1 - It) + Ac * It */ - alphaComb.Function = GR_COMBINE_FUNCTION_BLEND; - alphaComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA; - alphaComb.Other = GR_COMBINE_OTHER_CONSTANT; - } - else { - /* Av = Af * At */ - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - - if (ifmt == GL_ALPHA) { - colorComb.Function = GR_COMBINE_FUNCTION_LOCAL; - colorComb.Factor = GR_COMBINE_FACTOR_NONE; - colorComb.Other = GR_COMBINE_OTHER_NONE; - } else { - if (fxMesa->type >= GR_SSTTYPE_Voodoo2) { - colorComb.Function = GR_COMBINE_FUNCTION_BLEND; - colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_RGB; - colorComb.Other = GR_COMBINE_OTHER_CONSTANT; - } else if (ifmt == GL_INTENSITY) { - /* just a hack: RGB == ALPHA */ - colorComb.Function = GR_COMBINE_FUNCTION_BLEND; - colorComb.Factor = GR_COMBINE_FACTOR_TEXTURE_ALPHA; - colorComb.Other = GR_COMBINE_OTHER_CONSTANT; - } else { - /* Only Voodoo^2 can GL_BLEND (GR_COMBINE_FACTOR_TEXTURE_RGB) - * These settings assume that the TexEnv color is black and - * incoming fragment color is white. - */ - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_ONE; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - colorComb.Invert = FXTRUE; - _mesa_problem(NULL, "can't GL_BLEND with SST1"); - } - } - - grConstantColorValue( - (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[0] * 255.0f)) ) | - (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[1] * 255.0f)) << 8) | - (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[2] * 255.0f)) << 16) | - (((GLuint)(ctx->Texture.Unit[textureset].EnvColor[3] * 255.0f)) << 24)); - break; - case GL_REPLACE: - if ((ifmt == GL_RGB) || (ifmt == GL_LUMINANCE)) { - alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_NONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - } else { - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_ONE; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - - if (ifmt == GL_ALPHA) { - colorComb.Function = GR_COMBINE_FUNCTION_LOCAL; - colorComb.Factor = GR_COMBINE_FACTOR_NONE; - colorComb.Other = GR_COMBINE_OTHER_NONE; - } else { - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_ONE; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - break; - case GL_ADD: - if (ifmt == GL_ALPHA || - ifmt == GL_LUMINANCE_ALPHA || - ifmt == GL_RGBA) { - /* product of texel and fragment alpha */ - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - else if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) { - /* fragment alpha is unchanged */ - alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_NONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - } - else { - /* sum of texel and fragment alpha */ - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_ONE; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - - if (ifmt == GL_ALPHA) { - /* rgb unchanged */ - colorComb.Function = GR_COMBINE_FUNCTION_LOCAL; - colorComb.Factor = GR_COMBINE_FACTOR_NONE; - colorComb.Other = GR_COMBINE_OTHER_NONE; - } - else { - /* sum of texel and fragment rgb */ - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - colorComb.Factor = GR_COMBINE_FACTOR_ONE; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - break; - default: - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureSingleTMU_NoLock: %x Texture.EnvMode not yet supported\n", - ctx->Texture.Unit[textureset].EnvMode); - } - return; - } - - grAlphaCombine(alphaComb.Function, - alphaComb.Factor, - alphaComb.Local, - alphaComb.Other, - alphaComb.Invert); - grColorCombine(colorComb.Function, - colorComb.Factor, - colorComb.Local, - colorComb.Other, - colorComb.Invert); -} - -#if 00 -static void -fxSetupTextureSingleTMU(GLcontext * ctx, GLuint textureset) -{ - BEGIN_BOARD_LOCK(); - fxSetupTextureSingleTMU_NoLock(ctx, textureset); - END_BOARD_LOCK(); -} -#endif - - -/************************* Double Texture Set ***************************/ - -static void -fxSetupDoubleTMU_NoLock(fxMesaContext fxMesa, - struct gl_texture_object *tObj0, - struct gl_texture_object *tObj1) -{ -#define T0_NOT_IN_TMU 0x01 -#define T1_NOT_IN_TMU 0x02 -#define T0_IN_TMU0 0x04 -#define T1_IN_TMU0 0x08 -#define T0_IN_TMU1 0x10 -#define T1_IN_TMU1 0x20 - - tfxTexInfo *ti0 = fxTMGetTexInfo(tObj0); - tfxTexInfo *ti1 = fxTMGetTexInfo(tObj1); - GLuint tstate = 0; - int tmu0 = 0, tmu1 = 1; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupDoubleTMU_NoLock(...)\n"); - } - - /* We shouldn't need to do this. There is something wrong with - mutlitexturing when the TMUs are swapped. So, we're forcing - them to always be loaded correctly. !!! */ - if (ti0->whichTMU == FX_TMU1) - fxTMMoveOutTM_NoLock(fxMesa, tObj0); - if (ti1->whichTMU == FX_TMU0) - fxTMMoveOutTM_NoLock(fxMesa, tObj1); - - if (ti0->isInTM) { - switch (ti0->whichTMU) { - case FX_TMU0: - tstate |= T0_IN_TMU0; - break; - case FX_TMU1: - tstate |= T0_IN_TMU1; - break; - case FX_TMU_BOTH: - tstate |= T0_IN_TMU0 | T0_IN_TMU1; - break; - case FX_TMU_SPLIT: - tstate |= T0_NOT_IN_TMU; - break; - } - } - else - tstate |= T0_NOT_IN_TMU; - - if (ti1->isInTM) { - switch (ti1->whichTMU) { - case FX_TMU0: - tstate |= T1_IN_TMU0; - break; - case FX_TMU1: - tstate |= T1_IN_TMU1; - break; - case FX_TMU_BOTH: - tstate |= T1_IN_TMU0 | T1_IN_TMU1; - break; - case FX_TMU_SPLIT: - tstate |= T1_NOT_IN_TMU; - break; - } - } - else - tstate |= T1_NOT_IN_TMU; - - ti0->lastTimeUsed = fxMesa->texBindNumber; - ti1->lastTimeUsed = fxMesa->texBindNumber; - - /* Move texture maps into TMUs */ - - if (!(((tstate & T0_IN_TMU0) && (tstate & T1_IN_TMU1)) || - ((tstate & T0_IN_TMU1) && (tstate & T1_IN_TMU0)))) { - if (tObj0 == tObj1) - fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU_BOTH); - else { - /* Find the minimal way to correct the situation */ - if ((tstate & T0_IN_TMU0) || (tstate & T1_IN_TMU1)) { - /* We have one in the standard order, setup the other */ - if (tstate & T0_IN_TMU0) { /* T0 is in TMU0, put T1 in TMU1 */ - fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU1); - } - else { - fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU0); - } - /* tmu0 and tmu1 are setup */ - } - else if ((tstate & T0_IN_TMU1) || (tstate & T1_IN_TMU0)) { - /* we have one in the reverse order, setup the other */ - if (tstate & T1_IN_TMU0) { /* T1 is in TMU0, put T0 in TMU1 */ - fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU1); - } - else { - fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU0); - } - tmu0 = 1; - tmu1 = 0; - } - else { /* Nothing is loaded */ - fxTMMoveInTM_NoLock(fxMesa, tObj0, FX_TMU0); - fxTMMoveInTM_NoLock(fxMesa, tObj1, FX_TMU1); - /* tmu0 and tmu1 are setup */ - } - } - } - - /* [dBorca] Hack alert: - * we put these in reverse order, so that if we can't - * do _REAL_ pointcast, the TMU0 table gets broadcasted - */ - if (!fxMesa->haveGlobalPaletteTexture) { - /* pointcast */ - if (ti1->info.format == GR_TEXFMT_P_8) { - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupDoubleTMU_NoLock: uploading texture palette for TMU1\n"); - } - fxMesa->Glide.grTexDownloadTableExt(ti1->whichTMU, ti1->paltype, &(ti1->palette)); - } - if (ti0->info.format == GR_TEXFMT_P_8) { - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupDoubleTMU_NoLock: uploading texture palette for TMU0\n"); - } - fxMesa->Glide.grTexDownloadTableExt(ti0->whichTMU, ti0->paltype, &(ti0->palette)); - } - } - - grTexSource(tmu0, ti0->tm[tmu0]->startAddr, - GR_MIPMAPLEVELMASK_BOTH, &(ti0->info)); - grTexClampMode(tmu0, ti0->sClamp, ti0->tClamp); - grTexFilterMode(tmu0, ti0->minFilt, ti0->maxFilt); - grTexMipMapMode(tmu0, ti0->mmMode, FXFALSE); - - grTexSource(tmu1, ti1->tm[tmu1]->startAddr, - GR_MIPMAPLEVELMASK_BOTH, &(ti1->info)); - grTexClampMode(tmu1, ti1->sClamp, ti1->tClamp); - grTexFilterMode(tmu1, ti1->minFilt, ti1->maxFilt); - grTexMipMapMode(tmu1, ti1->mmMode, FXFALSE); - -#undef T0_NOT_IN_TMU -#undef T1_NOT_IN_TMU -#undef T0_IN_TMU0 -#undef T1_IN_TMU0 -#undef T0_IN_TMU1 -#undef T1_IN_TMU1 -} - -static void -fxSetupTextureDoubleTMU_NoLock(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - struct tdfx_combine alphaComb, colorComb; - struct tdfx_texcombine tex0, tex1; - GrCombineLocal_t localc, locala; - tfxTexInfo *ti0, *ti1; - struct gl_texture_object *tObj0 = ctx->Texture.Unit[1]._Current; - struct gl_texture_object *tObj1 = ctx->Texture.Unit[0]._Current; - GLuint envmode, ifmt, unitsmode; - int tmu0 = 0, tmu1 = 1; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureDoubleTMU_NoLock(...)\n"); - } - - ti0 = fxTMGetTexInfo(tObj0); - fxTexValidate(ctx, tObj0); - - ti1 = fxTMGetTexInfo(tObj1); - fxTexValidate(ctx, tObj1); - - fxSetupDoubleTMU_NoLock(fxMesa, tObj0, tObj1); - - unitsmode = fxGetTexSetConfiguration(ctx, tObj0, tObj1); - -/* if(fxMesa->lastUnitsMode==unitsmode) */ -/* return; */ - - fxMesa->lastUnitsMode = unitsmode; - - fxMesa->stw_hint_state |= GR_STWHINT_ST_DIFF_TMU1; - FX_grHints_NoLock(GR_HINT_STWHINT, fxMesa->stw_hint_state); - - envmode = unitsmode & FX_UM_E_ENVMODE; - ifmt = unitsmode & FX_UM_E_IFMT; - - if (unitsmode & FX_UM_ALPHA_ITERATED) - locala = GR_COMBINE_LOCAL_ITERATED; - else - locala = GR_COMBINE_LOCAL_CONSTANT; - - if (unitsmode & FX_UM_COLOR_ITERATED) - localc = GR_COMBINE_LOCAL_ITERATED; - else - localc = GR_COMBINE_LOCAL_CONSTANT; - - - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fxSetupTextureDoubleTMU_NoLock: envmode is %s/%s\n", - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode), - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode)); - - - if ((ti0->whichTMU == FX_TMU1) || (ti1->whichTMU == FX_TMU0)) { - tmu0 = 1; - tmu1 = 0; - } - fxMesa->tmuSrc = FX_TMU_BOTH; - - tex0.InvertRGB = FXFALSE; - tex0.InvertAlpha = FXFALSE; - tex1.InvertRGB = FXFALSE; - tex1.InvertAlpha = FXFALSE; - alphaComb.Local = locala; - alphaComb.Invert = FXFALSE; - colorComb.Local = localc; - colorComb.Invert = FXFALSE; - - switch (envmode) { - case (FX_UM_E0_MODULATE | FX_UM_E1_MODULATE): - { - GLboolean isalpha[FX_NUM_TMU]; - - isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA); - isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA); - - if (isalpha[FX_TMU1]) { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - tex1.InvertRGB = FXTRUE; - } else { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - } - - if (isalpha[FX_TMU0]) { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL; - } else { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL; - } - - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_LOCAL; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - break; - } - case (FX_UM_E0_REPLACE | FX_UM_E1_BLEND): /* Only for GLQuake */ - if (tmu0 == FX_TMU1) { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - tex1.InvertRGB = FXTRUE; - - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL; - } - else { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE_MINUS_LOCAL; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE_MINUS_LOCAL; - } - - alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_NONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_ONE; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - break; - case (FX_UM_E0_REPLACE | FX_UM_E1_MODULATE): /* Quake 2 and 3 */ - if (tmu1 == FX_TMU1) { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - tex1.InvertAlpha = FXTRUE; - - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorAlpha = GR_COMBINE_FACTOR_LOCAL; - } - else { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - tex0.FunctionRGB = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_LOCAL; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_BLEND_OTHER; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; - } - - if (ti0->baseLevelInternalFormat == GL_RGB) { - alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_NONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - } else { - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_ONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - } - - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_ONE; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - break; - - - case (FX_UM_E0_MODULATE | FX_UM_E1_ADD): /* Quake 3 Sky */ - { - GLboolean isalpha[FX_NUM_TMU]; - - isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA); - isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA); - - if (isalpha[FX_TMU1]) { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - tex1.InvertRGB = FXTRUE; - } else { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - } - - if (isalpha[FX_TMU0]) { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; - } else { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; - } - - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_LOCAL; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_LOCAL; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - break; - } - - case (FX_UM_E0_REPLACE | FX_UM_E1_ADD): /* Vulpine Sky */ - { - GLboolean isalpha[FX_NUM_TMU]; - - isalpha[tmu0] = (ti0->baseLevelInternalFormat == GL_ALPHA); - isalpha[tmu1] = (ti1->baseLevelInternalFormat == GL_ALPHA); - - if (isalpha[FX_TMU1]) { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - tex1.InvertRGB = FXTRUE; - } else { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - } - - if (isalpha[FX_TMU0]) { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; - } else { - tex0.FunctionRGB = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - tex0.FactorRGB = GR_COMBINE_FACTOR_ONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL; - tex0.FactorAlpha = GR_COMBINE_FACTOR_ONE; - } - - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_ONE; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_ONE; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - break; - } - - case (FX_UM_E0_MODULATE | FX_UM_E1_REPLACE): /* Homeworld2 */ - { - tex1.FunctionRGB = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex1.FunctionAlpha = GR_COMBINE_FUNCTION_ZERO; - tex1.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - tex0.FunctionRGB = GR_COMBINE_FUNCTION_LOCAL; - tex0.FactorRGB = GR_COMBINE_FACTOR_NONE; - tex0.FunctionAlpha = GR_COMBINE_FUNCTION_LOCAL; - tex0.FactorAlpha = GR_COMBINE_FACTOR_NONE; - - if (ifmt & (FX_UM_E0_RGB | FX_UM_E0_LUMINANCE)) { - alphaComb.Function = GR_COMBINE_FUNCTION_LOCAL; - alphaComb.Factor = GR_COMBINE_FACTOR_NONE; - alphaComb.Other = GR_COMBINE_OTHER_NONE; - } else { - alphaComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - alphaComb.Factor = GR_COMBINE_FACTOR_ONE; - alphaComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - - if (ifmt & FX_UM_E0_ALPHA) { - colorComb.Function = GR_COMBINE_FUNCTION_LOCAL; - colorComb.Factor = GR_COMBINE_FACTOR_NONE; - colorComb.Other = GR_COMBINE_OTHER_NONE; - } else { - colorComb.Function = GR_COMBINE_FUNCTION_SCALE_OTHER; - colorComb.Factor = GR_COMBINE_FACTOR_ONE; - colorComb.Other = GR_COMBINE_OTHER_TEXTURE; - } - break; - } - default: - fprintf(stderr, "fxSetupTextureDoubleTMU_NoLock: Unexpected dual texture mode encountered\n"); - return; - } - - grAlphaCombine(alphaComb.Function, - alphaComb.Factor, - alphaComb.Local, - alphaComb.Other, - alphaComb.Invert); - grColorCombine(colorComb.Function, - colorComb.Factor, - colorComb.Local, - colorComb.Other, - colorComb.Invert); - grTexCombine(GR_TMU0, - tex0.FunctionRGB, - tex0.FactorRGB, - tex0.FunctionAlpha, - tex0.FactorAlpha, - tex0.InvertRGB, - tex0.InvertAlpha); - grTexCombine(GR_TMU1, - tex1.FunctionRGB, - tex1.FactorRGB, - tex1.FunctionAlpha, - tex1.FactorAlpha, - tex1.InvertRGB, - tex1.InvertAlpha); -} - -/************************* No Texture ***************************/ - -static void -fxSetupTextureNone_NoLock(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrCombineLocal_t localc, locala; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureNone_NoLock(...)\n"); - } - - if ((ctx->Light.ShadeModel == GL_SMOOTH) || 1 || - (ctx->Point.SmoothFlag) || - (ctx->Line.SmoothFlag) || - (ctx->Polygon.SmoothFlag)) locala = GR_COMBINE_LOCAL_ITERATED; - else - locala = GR_COMBINE_LOCAL_CONSTANT; - - if (ctx->Light.ShadeModel == GL_SMOOTH || 1) - localc = GR_COMBINE_LOCAL_ITERATED; - else - localc = GR_COMBINE_LOCAL_CONSTANT; - - grAlphaCombine(GR_COMBINE_FUNCTION_LOCAL, - GR_COMBINE_FACTOR_NONE, - locala, - GR_COMBINE_OTHER_NONE, - FXFALSE); - - grColorCombine(GR_COMBINE_FUNCTION_LOCAL, - GR_COMBINE_FACTOR_NONE, - localc, - GR_COMBINE_OTHER_NONE, - FXFALSE); - - fxMesa->lastUnitsMode = FX_UM_NONE; -} - -#include "fxsetup.h" - -/************************************************************************/ -/************************** Texture Mode SetUp **************************/ -/************************************************************************/ - -static void -fxSetupTexture_NoLock(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTexture_NoLock(...)\n"); - } - - if (fxMesa->HaveCmbExt) { - /* Texture Combine, Color Combine and Alpha Combine. */ - if ((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) && - (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) && - fxMesa->haveTwoTMUs) { - fxSetupTextureDoubleTMUNapalm_NoLock(ctx); - } - else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { - fxSetupTextureSingleTMUNapalm_NoLock(ctx, 0); - } - else if (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { - fxSetupTextureSingleTMUNapalm_NoLock(ctx, 1); - } - else { - fxSetupTextureNoneNapalm_NoLock(ctx); - } - } else { - /* Texture Combine, Color Combine and Alpha Combine. */ - if ((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) && - (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) && - fxMesa->haveTwoTMUs) { - fxSetupTextureDoubleTMU_NoLock(ctx); - } - else if (ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { - fxSetupTextureSingleTMU_NoLock(ctx, 0); - } - else if (ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) { - fxSetupTextureSingleTMU_NoLock(ctx, 1); - } - else { - fxSetupTextureNone_NoLock(ctx); - } - } -} - -void -fxSetupTexture(GLcontext * ctx) -{ - BEGIN_BOARD_LOCK(); - fxSetupTexture_NoLock(ctx); - END_BOARD_LOCK(); -} - -/************************************************************************/ -/**************************** Blend SetUp *******************************/ -/************************************************************************/ - -void -fxDDBlendFuncSeparate(GLcontext * ctx, GLenum sfactor, GLenum dfactor, GLenum asfactor, GLenum adfactor) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - GLboolean isNapalm = (fxMesa->type >= GR_SSTTYPE_Voodoo4); - GLboolean have32bpp = (fxMesa->colDepth == 32); - GLboolean haveAlpha = fxMesa->haveHwAlpha; - GrAlphaBlendFnc_t sfact, dfact, asfact, adfact; - - /* - * 15/16 BPP alpha channel alpha blending modes - * 0x0 AZERO Zero - * 0x4 AONE One - * - * 32 BPP alpha channel alpha blending modes - * 0x0 AZERO Zero - * 0x1 ASRC_ALPHA Source alpha - * 0x3 ADST_ALPHA Destination alpha - * 0x4 AONE One - * 0x5 AOMSRC_ALPHA 1 - Source alpha - * 0x7 AOMDST_ALPHA 1 - Destination alpha - * - * If we don't have HW alpha buffer: - * DST_ALPHA == 1 - * ONE_MINUS_DST_ALPHA == 0 - * Unsupported modes are: - * 1 if used as src blending factor - * 0 if used as dst blending factor - */ - - switch (sfactor) { - case GL_ZERO: - sfact = GR_BLEND_ZERO; - break; - case GL_ONE: - sfact = GR_BLEND_ONE; - break; - case GL_DST_COLOR: - sfact = GR_BLEND_DST_COLOR; - break; - case GL_ONE_MINUS_DST_COLOR: - sfact = GR_BLEND_ONE_MINUS_DST_COLOR; - break; - case GL_SRC_ALPHA: - sfact = GR_BLEND_SRC_ALPHA; - break; - case GL_ONE_MINUS_SRC_ALPHA: - sfact = GR_BLEND_ONE_MINUS_SRC_ALPHA; - break; - case GL_DST_ALPHA: - sfact = haveAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/; - break; - case GL_ONE_MINUS_DST_ALPHA: - sfact = haveAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/; - break; - case GL_SRC_ALPHA_SATURATE: - sfact = GR_BLEND_ALPHA_SATURATE; - break; - case GL_SRC_COLOR: - if (isNapalm) { - sfact = GR_BLEND_SAME_COLOR_EXT; - break; - } - case GL_ONE_MINUS_SRC_COLOR: - if (isNapalm) { - sfact = GR_BLEND_ONE_MINUS_SAME_COLOR_EXT; - break; - } - default: - sfact = GR_BLEND_ONE; - break; - } - - switch (asfactor) { - case GL_ZERO: - asfact = GR_BLEND_ZERO; - break; - case GL_ONE: - asfact = GR_BLEND_ONE; - break; - case GL_SRC_COLOR: - case GL_SRC_ALPHA: - asfact = have32bpp ? GR_BLEND_SRC_ALPHA : GR_BLEND_ONE/*bad*/; - break; - case GL_ONE_MINUS_SRC_COLOR: - case GL_ONE_MINUS_SRC_ALPHA: - asfact = have32bpp ? GR_BLEND_ONE_MINUS_SRC_ALPHA : GR_BLEND_ONE/*bad*/; - break; - case GL_DST_COLOR: - case GL_DST_ALPHA: - asfact = (have32bpp && haveAlpha) ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/; - break; - case GL_ONE_MINUS_DST_COLOR: - case GL_ONE_MINUS_DST_ALPHA: - asfact = (have32bpp && haveAlpha) ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/; - break; - case GL_SRC_ALPHA_SATURATE: - asfact = GR_BLEND_ONE; - break; - default: - asfact = GR_BLEND_ONE; - break; - } - - switch (dfactor) { - case GL_ZERO: - dfact = GR_BLEND_ZERO; - break; - case GL_ONE: - dfact = GR_BLEND_ONE; - break; - case GL_SRC_COLOR: - dfact = GR_BLEND_SRC_COLOR; - break; - case GL_ONE_MINUS_SRC_COLOR: - dfact = GR_BLEND_ONE_MINUS_SRC_COLOR; - break; - case GL_SRC_ALPHA: - dfact = GR_BLEND_SRC_ALPHA; - break; - case GL_ONE_MINUS_SRC_ALPHA: - dfact = GR_BLEND_ONE_MINUS_SRC_ALPHA; - break; - case GL_DST_ALPHA: - dfact = haveAlpha ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/; - break; - case GL_ONE_MINUS_DST_ALPHA: - dfact = haveAlpha ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/; - break; - case GL_DST_COLOR: - if (isNapalm) { - dfact = GR_BLEND_SAME_COLOR_EXT; - break; - } - case GL_ONE_MINUS_DST_COLOR: - if (isNapalm) { - dfact = GR_BLEND_ONE_MINUS_SAME_COLOR_EXT; - break; - } - default: - dfact = GR_BLEND_ZERO; - break; - } - - switch (adfactor) { - case GL_ZERO: - adfact = GR_BLEND_ZERO; - break; - case GL_ONE: - adfact = GR_BLEND_ONE; - break; - case GL_SRC_COLOR: - case GL_SRC_ALPHA: - adfact = have32bpp ? GR_BLEND_SRC_ALPHA : GR_BLEND_ZERO/*bad*/; - break; - case GL_ONE_MINUS_SRC_COLOR: - case GL_ONE_MINUS_SRC_ALPHA: - adfact = have32bpp ? GR_BLEND_ONE_MINUS_SRC_ALPHA : GR_BLEND_ZERO/*bad*/; - break; - case GL_DST_COLOR: - case GL_DST_ALPHA: - adfact = (have32bpp && haveAlpha) ? GR_BLEND_DST_ALPHA : GR_BLEND_ONE/*bad*/; - break; - case GL_ONE_MINUS_DST_COLOR: - case GL_ONE_MINUS_DST_ALPHA: - adfact = (have32bpp && haveAlpha) ? GR_BLEND_ONE_MINUS_DST_ALPHA : GR_BLEND_ZERO/*bad*/; - break; - default: - adfact = GR_BLEND_ZERO; - break; - } - - if ((sfact != us->blendSrcFuncRGB) || (asfact != us->blendSrcFuncAlpha)) { - us->blendSrcFuncRGB = sfact; - us->blendSrcFuncAlpha = asfact; - fxMesa->new_state |= FX_NEW_BLEND; - } - - if ((dfact != us->blendDstFuncRGB) || (adfact != us->blendDstFuncAlpha)) { - us->blendDstFuncRGB = dfact; - us->blendDstFuncAlpha = adfact; - fxMesa->new_state |= FX_NEW_BLEND; - } -} - -void -fxDDBlendEquationSeparate(GLcontext * ctx, GLenum modeRGB, GLenum modeA) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - GrAlphaBlendOp_t q; - - switch (modeRGB) { - case GL_FUNC_ADD: - q = GR_BLEND_OP_ADD; - break; - case GL_FUNC_SUBTRACT: - q = GR_BLEND_OP_SUB; - break; - case GL_FUNC_REVERSE_SUBTRACT: - q = GR_BLEND_OP_REVSUB; - break; - default: - q = us->blendEqRGB; - } - if (q != us->blendEqRGB) { - us->blendEqRGB = q; - fxMesa->new_state |= FX_NEW_BLEND; - } - - switch (modeA) { - case GL_FUNC_ADD: - q = GR_BLEND_OP_ADD; - break; - case GL_FUNC_SUBTRACT: - q = GR_BLEND_OP_SUB; - break; - case GL_FUNC_REVERSE_SUBTRACT: - q = GR_BLEND_OP_REVSUB; - break; - default: - q = us->blendEqAlpha; - } - if (q != us->blendEqAlpha) { - us->blendEqAlpha = q; - fxMesa->new_state |= FX_NEW_BLEND; - } -} - -void -fxSetupBlend(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (fxMesa->HavePixExt) { - if (us->blendEnabled) { - fxMesa->Glide.grAlphaBlendFunctionExt(us->blendSrcFuncRGB, us->blendDstFuncRGB, - us->blendEqRGB, - us->blendSrcFuncAlpha, us->blendDstFuncAlpha, - us->blendEqAlpha); - } else { - fxMesa->Glide.grAlphaBlendFunctionExt(GR_BLEND_ONE, GR_BLEND_ZERO, - GR_BLEND_OP_ADD, - GR_BLEND_ONE, GR_BLEND_ZERO, - GR_BLEND_OP_ADD); - } - } else { - if (us->blendEnabled) { - grAlphaBlendFunction(us->blendSrcFuncRGB, us->blendDstFuncRGB, - us->blendSrcFuncAlpha, us->blendDstFuncAlpha); - } else { - grAlphaBlendFunction(GR_BLEND_ONE, GR_BLEND_ZERO, - GR_BLEND_ONE, GR_BLEND_ZERO); - } - } -} - -/************************************************************************/ -/************************** Alpha Test SetUp ****************************/ -/************************************************************************/ - -void -fxDDAlphaFunc(GLcontext * ctx, GLenum func, GLfloat ref) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if ( - (us->alphaTestFunc != func) - || - (us->alphaTestRefValue != ref) - ) { - us->alphaTestFunc = func; - us->alphaTestRefValue = ref; - fxMesa->new_state |= FX_NEW_ALPHA; - } -} - -static void -fxSetupAlphaTest(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (us->alphaTestEnabled) { - GrAlpha_t ref = (GLint) (us->alphaTestRefValue * 255.0); - grAlphaTestFunction(us->alphaTestFunc - GL_NEVER + GR_CMP_NEVER); - grAlphaTestReferenceValue(ref); - } - else - grAlphaTestFunction(GR_CMP_ALWAYS); -} - -/************************************************************************/ -/************************** Depth Test SetUp ****************************/ -/************************************************************************/ - -void -fxDDDepthFunc(GLcontext * ctx, GLenum func) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (us->depthTestFunc != func) { - us->depthTestFunc = func; - fxMesa->new_state |= FX_NEW_DEPTH; - } -} - -void -fxDDDepthMask(GLcontext * ctx, GLboolean flag) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (flag != us->depthMask) { - us->depthMask = flag; - fxMesa->new_state |= FX_NEW_DEPTH; - } -} - -void -fxSetupDepthTest(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (us->depthTestEnabled) { - grDepthBufferFunction(us->depthTestFunc - GL_NEVER + GR_CMP_NEVER); - grDepthMask(us->depthMask); - } - else { - grDepthBufferFunction(GR_CMP_ALWAYS); - grDepthMask(FXFALSE); - } -} - -/************************************************************************/ -/************************** Stencil SetUp *******************************/ -/************************************************************************/ - -static GrStencil_t convertGLStencilOp( GLenum op ) -{ - switch ( op ) { - case GL_KEEP: - return GR_STENCILOP_KEEP; - case GL_ZERO: - return GR_STENCILOP_ZERO; - case GL_REPLACE: - return GR_STENCILOP_REPLACE; - case GL_INCR: - return GR_STENCILOP_INCR_CLAMP; - case GL_DECR: - return GR_STENCILOP_DECR_CLAMP; - case GL_INVERT: - return GR_STENCILOP_INVERT; - case GL_INCR_WRAP_EXT: - return GR_STENCILOP_INCR_WRAP; - case GL_DECR_WRAP_EXT: - return GR_STENCILOP_DECR_WRAP; - default: - _mesa_problem( NULL, "bad stencil op in convertGLStencilOp" ); - } - return GR_STENCILOP_KEEP; /* never get, silence compiler warning */ -} - -void -fxDDStencilFuncSeparate (GLcontext *ctx, GLenum face, GLenum func, - GLint ref, GLuint mask) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (ctx->Stencil.ActiveFace) { - return; - } - - if ( - (us->stencilFunction != func) - || - (us->stencilRefValue != ref) - || - (us->stencilValueMask != mask) - ) { - us->stencilFunction = func; - us->stencilRefValue = ref; - us->stencilValueMask = mask; - fxMesa->new_state |= FX_NEW_STENCIL; - } -} - -void -fxDDStencilMaskSeparate (GLcontext *ctx, GLenum face, GLuint mask) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (ctx->Stencil.ActiveFace) { - return; - } - - if (us->stencilWriteMask != mask) { - us->stencilWriteMask = mask; - fxMesa->new_state |= FX_NEW_STENCIL; - } -} - -void -fxDDStencilOpSeparate (GLcontext *ctx, GLenum face, GLenum sfail, - GLenum zfail, GLenum zpass) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (ctx->Stencil.ActiveFace) { - return; - } - - if ( - (us->stencilFailFunc != sfail) - || - (us->stencilZFailFunc != zfail) - || - (us->stencilZPassFunc != zpass) - ) { - us->stencilFailFunc = sfail; - us->stencilZFailFunc = zfail; - us->stencilZPassFunc = zpass; - fxMesa->new_state |= FX_NEW_STENCIL; - } -} - -void -fxSetupStencil (GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (us->stencilEnabled) { - GrCmpFnc_t stencilFailFunc = GR_STENCILOP_KEEP; - GrCmpFnc_t stencilZFailFunc = GR_STENCILOP_KEEP; - GrCmpFnc_t stencilZPassFunc = GR_STENCILOP_KEEP; - if (!fxMesa->multipass) { - stencilFailFunc = convertGLStencilOp(us->stencilFailFunc); - stencilZFailFunc = convertGLStencilOp(us->stencilZFailFunc); - stencilZPassFunc = convertGLStencilOp(us->stencilZPassFunc); - } - grEnable(GR_STENCIL_MODE_EXT); - fxMesa->Glide.grStencilOpExt(stencilFailFunc, - stencilZFailFunc, - stencilZPassFunc); - fxMesa->Glide.grStencilFuncExt(us->stencilFunction - GL_NEVER + GR_CMP_NEVER, - us->stencilRefValue, - us->stencilValueMask); - fxMesa->Glide.grStencilMaskExt(us->stencilWriteMask); - } else { - grDisable(GR_STENCIL_MODE_EXT); - } -} - -void -fxSetupStencilFace (GLcontext * ctx, GLint face) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (us->stencilEnabled) { - GrCmpFnc_t stencilFailFunc = GR_STENCILOP_KEEP; - GrCmpFnc_t stencilZFailFunc = GR_STENCILOP_KEEP; - GrCmpFnc_t stencilZPassFunc = GR_STENCILOP_KEEP; - if (!fxMesa->multipass) { - stencilFailFunc = convertGLStencilOp(ctx->Stencil.FailFunc[face]); - stencilZFailFunc = convertGLStencilOp(ctx->Stencil.ZFailFunc[face]); - stencilZPassFunc = convertGLStencilOp(ctx->Stencil.ZPassFunc[face]); - } - grEnable(GR_STENCIL_MODE_EXT); - fxMesa->Glide.grStencilOpExt(stencilFailFunc, - stencilZFailFunc, - stencilZPassFunc); - fxMesa->Glide.grStencilFuncExt(ctx->Stencil.Function[face] - GL_NEVER + GR_CMP_NEVER, - ctx->Stencil.Ref[face], - ctx->Stencil.ValueMask[face]); - fxMesa->Glide.grStencilMaskExt(ctx->Stencil.WriteMask[face]); - } else { - grDisable(GR_STENCIL_MODE_EXT); - } -} - -/************************************************************************/ -/**************************** Color Mask SetUp **************************/ -/************************************************************************/ - -void -fxDDColorMask(GLcontext * ctx, - GLboolean r, GLboolean g, GLboolean b, GLboolean a) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - fxMesa->new_state |= FX_NEW_COLOR_MASK; - (void) r; - (void) g; - (void) b; - (void) a; -} - -void -fxSetupColorMask(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (fxMesa->colDepth == 32) { - /* 32bpp mode */ - fxMesa->Glide.grColorMaskExt(ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP] && fxMesa->haveHwAlpha); - } - else { - /* 15/16 bpp mode */ - grColorMask(ctx->Color.ColorMask[RCOMP] | - ctx->Color.ColorMask[GCOMP] | - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP] && fxMesa->haveHwAlpha); - } -} - - - - -/************************************************************************/ -/**************************** Fog Mode SetUp ****************************/ -/************************************************************************/ - -/* - * This is called during state update in order to update the Glide fog state. - */ -static void -fxSetupFog(GLcontext * ctx) -{ - if (ctx->Fog.Enabled /*&& ctx->FogMode==FOG_FRAGMENT */ ) { - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - /* update fog color */ - GLubyte col[4]; - col[0] = (unsigned int) (255 * ctx->Fog.Color[0]); - col[1] = (unsigned int) (255 * ctx->Fog.Color[1]); - col[2] = (unsigned int) (255 * ctx->Fog.Color[2]); - col[3] = (unsigned int) (255 * ctx->Fog.Color[3]); - grFogColorValue(FXCOLOR4(col)); - - if (fxMesa->fogTableMode != ctx->Fog.Mode || - fxMesa->fogDensity != ctx->Fog.Density || - fxMesa->fogStart != ctx->Fog.Start || - fxMesa->fogEnd != ctx->Fog.End) { - /* reload the fog table */ - switch (ctx->Fog.Mode) { - case GL_LINEAR: - guFogGenerateLinear(fxMesa->fogTable, ctx->Fog.Start, - ctx->Fog.End); - if (fxMesa->fogTable[0] > 63) { - /* [dBorca] Hack alert: - * As per Glide3 Programming Guide: - * The difference between consecutive fog values - * must be less than 64. - */ - fxMesa->fogTable[0] = 63; - } - break; - case GL_EXP: - guFogGenerateExp(fxMesa->fogTable, ctx->Fog.Density); - break; - case GL_EXP2: - guFogGenerateExp2(fxMesa->fogTable, ctx->Fog.Density); - break; - default: - ; - } - fxMesa->fogTableMode = ctx->Fog.Mode; - fxMesa->fogDensity = ctx->Fog.Density; - fxMesa->fogStart = ctx->Fog.Start; - fxMesa->fogEnd = ctx->Fog.End; - } - - grFogTable(fxMesa->fogTable); - if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) { - grVertexLayout(GR_PARAM_FOG_EXT, GR_VERTEX_FOG_OFFSET << 2, - GR_PARAM_ENABLE); - grFogMode(GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT); - } else { - grVertexLayout(GR_PARAM_FOG_EXT, GR_VERTEX_FOG_OFFSET << 2, - GR_PARAM_DISABLE); - grFogMode(GR_FOG_WITH_TABLE_ON_Q); - } - } - else { - grFogMode(GR_FOG_DISABLE); - } -} - -void -fxDDFogfv(GLcontext * ctx, GLenum pname, const GLfloat * params) -{ - FX_CONTEXT(ctx)->new_state |= FX_NEW_FOG; - switch (pname) { - case GL_FOG_COORDINATE_SOURCE_EXT: { - GLenum p = (GLenum)*params; - if (p == GL_FOG_COORDINATE_EXT) { - _swrast_allow_vertex_fog(ctx, GL_TRUE); - _swrast_allow_pixel_fog(ctx, GL_FALSE); - _tnl_allow_vertex_fog( ctx, GL_TRUE); - _tnl_allow_pixel_fog( ctx, GL_FALSE); - } else { - _swrast_allow_vertex_fog(ctx, GL_FALSE); - _swrast_allow_pixel_fog(ctx, GL_TRUE); - _tnl_allow_vertex_fog( ctx, GL_FALSE); - _tnl_allow_pixel_fog( ctx, GL_TRUE); - } - break; - } - default: - ; - } -} - -/************************************************************************/ -/************************** Scissor Test SetUp **************************/ -/************************************************************************/ - -/* This routine is used in managing the lock state, and therefore can't lock */ -void -fxSetScissorValues(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - int xmin, xmax; - int ymin, ymax; - - if (ctx->Scissor.Enabled) { - xmin = ctx->Scissor.X; - xmax = ctx->Scissor.X + ctx->Scissor.Width; - ymin = ctx->Scissor.Y; - ymax = ctx->Scissor.Y + ctx->Scissor.Height; - - if (xmin < 0) - xmin = 0; - if (xmax > fxMesa->width) - xmax = fxMesa->width; - if (ymin < fxMesa->screen_height - fxMesa->height) - ymin = fxMesa->screen_height - fxMesa->height; - if (ymax > fxMesa->screen_height - 0) - ymax = fxMesa->screen_height - 0; - } - else { - xmin = 0; - ymin = 0; - xmax = fxMesa->width; - ymax = fxMesa->height; - } - - fxMesa->clipMinX = xmin; - fxMesa->clipMinY = ymin; - fxMesa->clipMaxX = xmax; - fxMesa->clipMaxY = ymax; - grClipWindow(xmin, ymin, xmax, ymax); -} - -void -fxSetupScissor(GLcontext * ctx) -{ - BEGIN_BOARD_LOCK(); - fxSetScissorValues(ctx); - END_BOARD_LOCK(); -} - -void -fxDDScissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - FX_CONTEXT(ctx)->new_state |= FX_NEW_SCISSOR; -} - -/************************************************************************/ -/*************************** Cull mode setup ****************************/ -/************************************************************************/ - - -void -fxDDCullFace(GLcontext * ctx, GLenum mode) -{ - (void) mode; - FX_CONTEXT(ctx)->new_state |= FX_NEW_CULL; -} - -void -fxDDFrontFace(GLcontext * ctx, GLenum mode) -{ - (void) mode; - FX_CONTEXT(ctx)->new_state |= FX_NEW_CULL; -} - - -void -fxSetupCull(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrCullMode_t mode = GR_CULL_DISABLE; - - if (ctx->Polygon.CullFlag && (fxMesa->raster_primitive == GL_TRIANGLES)) { - switch (ctx->Polygon.CullFaceMode) { - case GL_BACK: - if (ctx->Polygon.FrontFace == GL_CCW) - mode = GR_CULL_NEGATIVE; - else - mode = GR_CULL_POSITIVE; - break; - case GL_FRONT: - if (ctx->Polygon.FrontFace == GL_CCW) - mode = GR_CULL_POSITIVE; - else - mode = GR_CULL_NEGATIVE; - break; - case GL_FRONT_AND_BACK: - /* Handled as a fallback on triangles in tdfx_tris.c */ - return; - default: - ASSERT(0); - break; - } - } - - if (fxMesa->cullMode != mode) { - fxMesa->cullMode = mode; - grCullMode(mode); - } -} - - -/************************************************************************/ -/****************************** DD Enable ******************************/ -/************************************************************************/ - -void -fxDDEnable(GLcontext * ctx, GLenum cap, GLboolean state) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "%s(%s)\n", state ? "fxDDEnable" : "fxDDDisable", - _mesa_lookup_enum_by_nr(cap)); - } - - switch (cap) { - case GL_ALPHA_TEST: - if (state != us->alphaTestEnabled) { - us->alphaTestEnabled = state; - fxMesa->new_state |= FX_NEW_ALPHA; - } - break; - case GL_BLEND: - if (state != us->blendEnabled) { - us->blendEnabled = state; - fxMesa->new_state |= FX_NEW_BLEND; - } - break; - case GL_DEPTH_TEST: - if (state != us->depthTestEnabled) { - us->depthTestEnabled = state; - fxMesa->new_state |= FX_NEW_DEPTH; - } - break; - case GL_STENCIL_TEST: - if (fxMesa->haveHwStencil && state != us->stencilEnabled) { - us->stencilEnabled = state; - fxMesa->new_state |= FX_NEW_STENCIL; - } - break; - case GL_DITHER: - if (state) { - grDitherMode(GR_DITHER_4x4); - } - else { - grDitherMode(GR_DITHER_DISABLE); - } - break; - case GL_SCISSOR_TEST: - fxMesa->new_state |= FX_NEW_SCISSOR; - break; - case GL_SHARED_TEXTURE_PALETTE_EXT: - fxDDTexUseGlbPalette(ctx, state); - break; - case GL_FOG: - fxMesa->new_state |= FX_NEW_FOG; - break; - case GL_CULL_FACE: - fxMesa->new_state |= FX_NEW_CULL; - break; - case GL_LINE_SMOOTH: - case GL_LINE_STIPPLE: - case GL_POINT_SMOOTH: - case GL_POLYGON_SMOOTH: - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - fxMesa->new_state |= FX_NEW_TEXTURING; - break; - default: - ; /* XXX no-op? */ - } -} - - - - -/************************************************************************/ -/************************** Changes to units state **********************/ -/************************************************************************/ - - -/* All units setup is handled under texture setup. - */ -void -fxDDShadeModel(GLcontext * ctx, GLenum mode) -{ - FX_CONTEXT(ctx)->new_state |= FX_NEW_TEXTURING; -} - - - -/************************************************************************/ -/****************************** Units SetUp *****************************/ -/************************************************************************/ -static void -fx_print_state_flags(const char *msg, GLuint flags) -{ - fprintf(stderr, - "%s: (0x%x) %s%s%s%s%s%s%s%s\n", - msg, - flags, - (flags & FX_NEW_TEXTURING) ? "texture, " : "", - (flags & FX_NEW_BLEND) ? "blend, " : "", - (flags & FX_NEW_ALPHA) ? "alpha, " : "", - (flags & FX_NEW_FOG) ? "fog, " : "", - (flags & FX_NEW_SCISSOR) ? "scissor, " : "", - (flags & FX_NEW_COLOR_MASK) ? "colormask, " : "", - (flags & FX_NEW_CULL) ? "cull, " : "", - (flags & FX_NEW_STENCIL) ? "stencil, " : ""); -} - -void -fxSetupFXUnits(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLuint newstate = fxMesa->new_state; - - if (TDFX_DEBUG & VERBOSE_DRIVER) - fx_print_state_flags("fxSetupFXUnits", newstate); - - if (newstate) { - if (newstate & FX_NEW_TEXTURING) - fxSetupTexture(ctx); - - if (newstate & FX_NEW_BLEND) - fxSetupBlend(ctx); - - if (newstate & FX_NEW_ALPHA) - fxSetupAlphaTest(ctx); - - if (newstate & FX_NEW_DEPTH) - fxSetupDepthTest(ctx); - - if (newstate & FX_NEW_STENCIL) - fxSetupStencil(ctx); - - if (newstate & FX_NEW_FOG) - fxSetupFog(ctx); - - if (newstate & FX_NEW_SCISSOR) - fxSetupScissor(ctx); - - if (newstate & FX_NEW_COLOR_MASK) - fxSetupColorMask(ctx); - - if (newstate & FX_NEW_CULL) - fxSetupCull(ctx); - - fxMesa->new_state = 0; - } -} - - - -#else - - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_setup(void); -int -gl_fx_dummy_function_setup(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxsetup.h b/src/mesa/drivers/glide/fxsetup.h deleted file mode 100644 index 9d337d4b0d..0000000000 --- a/src/mesa/drivers/glide/fxsetup.h +++ /dev/null @@ -1,850 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - -/* fxsetup.c - 3Dfx VooDoo rendering mode setup functions */ -/* This code belongs to fxsetup.c, but I didn't want to clutter - * the original code with Napalm specifics, in order to keep things - * clear -- especially for backward compatibility. I should have - * put it into another .c file, but I didn't want to export so many - * things... - * The point is, Napalm uses a different technique for texture env. - * SST1 Single texturing: - * setup standard grTexCombine - * fiddle with grColorCombine/grAlphaCombine - * SST1 Multi texturing: - * fiddle with grTexCombine/grColorCombine/grAlphaCombine - * Napalm Single texturing: - * setup standard grColorCombineExt/grAlphaCombineExt - * fiddle with grTexColorCombine/grTexAlphaCombine - * Napalm Multi texturing: - * setup standard grColorCombineExt/grAlphaCombineExt - * fiddle with grTexColorCombine/grTexAlphaCombine - */ - -/* - * These macros are used below when handling COMBINE_EXT. - */ -#define TEXENV_OPERAND_INVERTED(operand) \ - (((operand) == GL_ONE_MINUS_SRC_ALPHA) \ - || ((operand) == GL_ONE_MINUS_SRC_COLOR)) -#define TEXENV_OPERAND_ALPHA(operand) \ - (((operand) == GL_SRC_ALPHA) || ((operand) == GL_ONE_MINUS_SRC_ALPHA)) -#define TEXENV_SETUP_ARG_A(param, source, operand, iteratedAlpha) \ - switch (source) { \ - case GL_TEXTURE: \ - param = GR_CMBX_LOCAL_TEXTURE_ALPHA; \ - break; \ - case GL_CONSTANT_EXT: \ - param = GR_CMBX_TMU_CALPHA; \ - break; \ - case GL_PRIMARY_COLOR_EXT: \ - param = GR_CMBX_ITALPHA; \ - break; \ - case GL_PREVIOUS_EXT: \ - param = iteratedAlpha; \ - break; \ - default: \ - /* \ - * This is here just to keep from getting \ - * compiler warnings. \ - */ \ - param = GR_CMBX_ZERO; \ - break; \ - } - -#define TEXENV_SETUP_ARG_RGB(param, source, operand, iteratedColor, iteratedAlpha) \ - if (!TEXENV_OPERAND_ALPHA(operand)) { \ - switch (source) { \ - case GL_TEXTURE: \ - param = GR_CMBX_LOCAL_TEXTURE_RGB; \ - break; \ - case GL_CONSTANT_EXT: \ - param = GR_CMBX_TMU_CCOLOR; \ - break; \ - case GL_PRIMARY_COLOR_EXT: \ - param = GR_CMBX_ITRGB; \ - break; \ - case GL_PREVIOUS_EXT: \ - param = iteratedColor; \ - break; \ - default: \ - /* \ - * This is here just to keep from getting \ - * compiler warnings. \ - */ \ - param = GR_CMBX_ZERO; \ - break; \ - } \ - } else { \ - switch (source) { \ - case GL_TEXTURE: \ - param = GR_CMBX_LOCAL_TEXTURE_ALPHA; \ - break; \ - case GL_CONSTANT_EXT: \ - param = GR_CMBX_TMU_CALPHA; \ - break; \ - case GL_PRIMARY_COLOR_EXT: \ - param = GR_CMBX_ITALPHA; \ - break; \ - case GL_PREVIOUS_EXT: \ - param = iteratedAlpha; \ - break; \ - default: \ - /* \ - * This is here just to keep from getting \ - * compiler warnings. \ - */ \ - param = GR_CMBX_ZERO; \ - break; \ - } \ - } - -#define TEXENV_SETUP_MODE_RGB(param, operand) \ - switch (operand) { \ - case GL_SRC_COLOR: \ - case GL_SRC_ALPHA: \ - param = GR_FUNC_MODE_X; \ - break; \ - case GL_ONE_MINUS_SRC_ALPHA: \ - case GL_ONE_MINUS_SRC_COLOR: \ - param = GR_FUNC_MODE_ONE_MINUS_X; \ - break; \ - default: \ - param = GR_FUNC_MODE_ZERO; \ - break; \ - } - -#define TEXENV_SETUP_MODE_A(param, operand) \ - switch (operand) { \ - case GL_SRC_ALPHA: \ - param = GR_FUNC_MODE_X; \ - break; \ - case GL_ONE_MINUS_SRC_ALPHA: \ - param = GR_FUNC_MODE_ONE_MINUS_X; \ - break; \ - default: \ - param = GR_FUNC_MODE_ZERO; \ - break; \ - } - -static void -fxSetupTextureEnvNapalm_NoLock(GLcontext * ctx, GLuint textureset, GLuint tmu, GLboolean iterated) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[textureset]; - struct tdfx_combine_alpha_ext alphaComb; - struct tdfx_combine_color_ext colorComb; - const GLfloat *envColor = texUnit->EnvColor; - GrCombineLocal_t localc, locala; /* fragmentColor/Alpha */ - GLint ifmt; - tfxTexInfo *ti; - struct gl_texture_object *tObj = texUnit->_Current; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureEnvNapalm_NoLock(unit %u, TMU %u, iterated %d)\n", - textureset, tmu, iterated); - } - - ti = fxTMGetTexInfo(tObj); - - ifmt = ti->baseLevelInternalFormat; - - if (iterated) { - /* we don't have upstream TMU */ - locala = GR_CMBX_ITALPHA; - localc = GR_CMBX_ITRGB; - } else { - /* we have upstream TMU */ - locala = GR_CMBX_OTHER_TEXTURE_ALPHA; - localc = GR_CMBX_OTHER_TEXTURE_RGB; - } - - alphaComb.InvertD = FXFALSE; - alphaComb.Shift = 0; - alphaComb.Invert = FXFALSE; - colorComb.InvertD = FXFALSE; - colorComb.Shift = 0; - colorComb.Invert = FXFALSE; - - switch (texUnit->EnvMode) { - case GL_DECAL: - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - - colorComb.SourceA = GR_CMBX_LOCAL_TEXTURE_RGB; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = localc; - colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X; - colorComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA; - colorComb.InvertC = FXFALSE; - colorComb.SourceD = GR_CMBX_B; - break; - case GL_MODULATE: - if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) { - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - } else { - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA; - alphaComb.InvertC = FXFALSE; - alphaComb.SourceD = GR_CMBX_ZERO; - } - - if (ifmt == GL_ALPHA) { - colorComb.SourceA = localc; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_X; - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - } else { - colorComb.SourceA = localc; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_X; - colorComb.SourceC = GR_CMBX_LOCAL_TEXTURE_RGB; - colorComb.InvertC = FXFALSE; - colorComb.SourceD = GR_CMBX_ZERO; - } - break; - case GL_BLEND: - if (ifmt == GL_INTENSITY) { - alphaComb.SourceA = GR_CMBX_TMU_CALPHA; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = locala; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA; - alphaComb.InvertC = FXFALSE; - alphaComb.SourceD = GR_CMBX_ZERO; - } else { - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA; - alphaComb.InvertC = FXFALSE; - alphaComb.SourceD = GR_CMBX_ZERO; - } - - if (ifmt == GL_ALPHA) { - colorComb.SourceA = localc; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_X; - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - } else { - colorComb.SourceA = GR_CMBX_TMU_CCOLOR; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = localc; - colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X; - colorComb.SourceC = GR_CMBX_LOCAL_TEXTURE_RGB; - colorComb.InvertC = FXFALSE; - colorComb.SourceD = GR_CMBX_B; - } - - fxMesa->Glide.grConstantColorValueExt(tmu, - (((GLuint)(envColor[0] * 255.0f)) ) | - (((GLuint)(envColor[1] * 255.0f)) << 8) | - (((GLuint)(envColor[2] * 255.0f)) << 16) | - (((GLuint)(envColor[3] * 255.0f)) << 24)); - break; - case GL_REPLACE: - if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) { - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - } else { - alphaComb.SourceA = GR_CMBX_LOCAL_TEXTURE_ALPHA; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - } - - if (ifmt == GL_ALPHA) { - colorComb.SourceA = localc; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_X; - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - } else { - colorComb.SourceA = GR_CMBX_LOCAL_TEXTURE_RGB; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_X; - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - } - break; - case GL_ADD: - if (ifmt == GL_LUMINANCE || ifmt == GL_RGB) { - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - } else if (ifmt == GL_INTENSITY) { - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_LOCAL_TEXTURE_ALPHA; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - } else { - alphaComb.SourceA = locala; - alphaComb.ModeA = GR_FUNC_MODE_X; - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_X; - alphaComb.SourceC = GR_CMBX_LOCAL_TEXTURE_ALPHA; - alphaComb.InvertC = FXFALSE; - alphaComb.SourceD = GR_CMBX_ZERO; - } - - if (ifmt == GL_ALPHA) { - colorComb.SourceA = localc; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_X; - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - } else { - colorComb.SourceA = localc; - colorComb.ModeA = GR_FUNC_MODE_X; - colorComb.SourceB = GR_CMBX_LOCAL_TEXTURE_RGB; - colorComb.ModeB = GR_FUNC_MODE_X; - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - } - break; - /* COMBINE_EXT */ - case GL_COMBINE_EXT: - /* XXX todo - INCOMPLETE!!! */ - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) { -#if 1 - fprintf(stderr, "COMBINE_EXT: %s + %s\n", - _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB), - _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); -#else - fprintf(stderr, "Texture Unit %d\n", textureset); - fprintf(stderr, " GL_TEXTURE_ENV_MODE = %s\n", _mesa_lookup_enum_by_nr(texUnit->EnvMode)); - fprintf(stderr, " GL_COMBINE_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB)); - fprintf(stderr, " GL_COMBINE_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); - fprintf(stderr, " GL_SOURCE0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[0])); - fprintf(stderr, " GL_SOURCE1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[1])); - fprintf(stderr, " GL_SOURCE2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceRGB[2])); - fprintf(stderr, " GL_SOURCE0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[0])); - fprintf(stderr, " GL_SOURCE1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[1])); - fprintf(stderr, " GL_SOURCE2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.SourceA[2])); - fprintf(stderr, " GL_OPERAND0_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[0])); - fprintf(stderr, " GL_OPERAND1_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[1])); - fprintf(stderr, " GL_OPERAND2_RGB = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandRGB[2])); - fprintf(stderr, " GL_OPERAND0_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[0])); - fprintf(stderr, " GL_OPERAND1_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[1])); - fprintf(stderr, " GL_OPERAND2_ALPHA = %s\n", _mesa_lookup_enum_by_nr(texUnit->Combine.OperandA[2])); - fprintf(stderr, " GL_RGB_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftRGB); - fprintf(stderr, " GL_ALPHA_SCALE = %d\n", 1 << texUnit->Combine.ScaleShiftA); - fprintf(stderr, " GL_TEXTURE_ENV_COLOR = (%f, %f, %f, %f)\n", envColor[0], envColor[1], envColor[2], envColor[3]); -#endif - } - - alphaComb.Shift = texUnit->Combine.ScaleShiftA; - colorComb.Shift = texUnit->Combine.ScaleShiftRGB; - - switch (texUnit->Combine.ModeRGB) { - case GL_MODULATE: - /* Arg0 * Arg1 == (A + 0) * C + 0 */ - TEXENV_SETUP_ARG_RGB(colorComb.SourceA, - texUnit->Combine.SourceRGB[0], - texUnit->Combine.OperandRGB[0], - localc, locala); - TEXENV_SETUP_MODE_RGB(colorComb.ModeA, - texUnit->Combine.OperandRGB[0]); - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_ZERO; - TEXENV_SETUP_ARG_RGB(colorComb.SourceC, - texUnit->Combine.SourceRGB[1], - texUnit->Combine.OperandRGB[1], - localc, locala); - colorComb.InvertC = TEXENV_OPERAND_INVERTED( - texUnit->Combine.OperandRGB[1]); - colorComb.SourceD = GR_CMBX_ZERO; - break; - case GL_REPLACE: - /* Arg0 == (A + 0) * 1 + 0 */ - TEXENV_SETUP_ARG_RGB(colorComb.SourceA, - texUnit->Combine.SourceRGB[0], - texUnit->Combine.OperandRGB[0], - localc, locala); - TEXENV_SETUP_MODE_RGB(colorComb.ModeA, - texUnit->Combine.OperandRGB[0]); - colorComb.SourceB = GR_CMBX_ZERO; - colorComb.ModeB = GR_FUNC_MODE_ZERO; - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - break; - case GL_ADD: - /* Arg0 + Arg1 = (A + B) * 1 + 0 */ - TEXENV_SETUP_ARG_RGB(colorComb.SourceA, - texUnit->Combine.SourceRGB[0], - texUnit->Combine.OperandRGB[0], - localc, locala); - TEXENV_SETUP_MODE_RGB(colorComb.ModeA, - texUnit->Combine.OperandRGB[0]); - TEXENV_SETUP_ARG_RGB(colorComb.SourceB, - texUnit->Combine.SourceRGB[1], - texUnit->Combine.OperandRGB[1], - localc, locala); - TEXENV_SETUP_MODE_RGB(colorComb.ModeB, - texUnit->Combine.OperandRGB[1]); - colorComb.SourceC = GR_CMBX_ZERO; - colorComb.InvertC = FXTRUE; - colorComb.SourceD = GR_CMBX_ZERO; - break; - case GL_INTERPOLATE_EXT: - /* Arg0 * Arg2 + Arg1 * (1 - Arg2) == - * (Arg0 - Arg1) * Arg2 + Arg1 == (A - B) * C + D - */ - TEXENV_SETUP_ARG_RGB(colorComb.SourceA, - texUnit->Combine.SourceRGB[0], - texUnit->Combine.OperandRGB[0], - localc, locala); - TEXENV_SETUP_MODE_RGB(colorComb.ModeA, - texUnit->Combine.OperandRGB[0]); - TEXENV_SETUP_ARG_RGB(colorComb.SourceB, - texUnit->Combine.SourceRGB[1], - texUnit->Combine.OperandRGB[1], - localc, locala); - if (TEXENV_OPERAND_INVERTED(texUnit->Combine.OperandRGB[1])) { - /* Hack alert!!! This case is wrong!!! */ - fprintf(stderr, "COMBINE_EXT_color: WRONG!!!\n"); - colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X; - } else { - colorComb.ModeB = GR_FUNC_MODE_NEGATIVE_X; - } - /* - * The Source/Operand for the C value must - * specify some kind of alpha value. - */ - TEXENV_SETUP_ARG_A(colorComb.SourceC, - texUnit->Combine.SourceRGB[2], - texUnit->Combine.OperandRGB[2], - locala); - colorComb.InvertC = FXFALSE; - colorComb.SourceD = GR_CMBX_B; - break; - default: - fprintf(stderr, "COMBINE_EXT_color: %s\n", - _mesa_lookup_enum_by_nr(texUnit->Combine.ModeRGB)); - } - - switch (texUnit->Combine.ModeA) { - case GL_MODULATE: - /* Arg0 * Arg1 == (A + 0) * C + 0 */ - TEXENV_SETUP_ARG_A(alphaComb.SourceA, - texUnit->Combine.SourceA[0], - texUnit->Combine.OperandA[0], - locala); - TEXENV_SETUP_MODE_A(alphaComb.ModeA, - texUnit->Combine.OperandA[0]); - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_ZERO; - TEXENV_SETUP_ARG_A(alphaComb.SourceC, - texUnit->Combine.SourceA[1], - texUnit->Combine.OperandA[1], - locala); - alphaComb.InvertC = TEXENV_OPERAND_INVERTED( - texUnit->Combine.OperandA[1]); - alphaComb.SourceD = GR_CMBX_ZERO; - break; - case GL_REPLACE: - /* Arg0 == (A + 0) * 1 + 0 */ - TEXENV_SETUP_ARG_A(alphaComb.SourceA, - texUnit->Combine.SourceA[0], - texUnit->Combine.OperandA[0], - locala); - TEXENV_SETUP_MODE_A(alphaComb.ModeA, - texUnit->Combine.OperandA[0]); - alphaComb.SourceB = GR_CMBX_ZERO; - alphaComb.ModeB = GR_FUNC_MODE_ZERO; - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - break; - case GL_ADD: - /* Arg0 + Arg1 = (A + B) * 1 + 0 */ - TEXENV_SETUP_ARG_A(alphaComb.SourceA, - texUnit->Combine.SourceA[0], - texUnit->Combine.OperandA[0], - locala); - TEXENV_SETUP_MODE_A(alphaComb.ModeA, - texUnit->Combine.OperandA[0]); - TEXENV_SETUP_ARG_A(alphaComb.SourceB, - texUnit->Combine.SourceA[1], - texUnit->Combine.OperandA[1], - locala); - TEXENV_SETUP_MODE_A(alphaComb.ModeB, - texUnit->Combine.OperandA[1]); - alphaComb.SourceC = GR_CMBX_ZERO; - alphaComb.InvertC = FXTRUE; - alphaComb.SourceD = GR_CMBX_ZERO; - break; - default: - fprintf(stderr, "COMBINE_EXT_alpha: %s\n", - _mesa_lookup_enum_by_nr(texUnit->Combine.ModeA)); - } - - fxMesa->Glide.grConstantColorValueExt(tmu, - (((GLuint)(envColor[0] * 255.0f)) ) | - (((GLuint)(envColor[1] * 255.0f)) << 8) | - (((GLuint)(envColor[2] * 255.0f)) << 16) | - (((GLuint)(envColor[3] * 255.0f)) << 24)); - break; - - default: - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureEnvNapalm_NoLock: %x Texture.EnvMode not yet supported\n", - texUnit->EnvMode); - } - return; - } - - /* On Napalm we simply put the color combine unit into passthrough mode - * and do everything we need with the texture combine units. */ - fxMesa->Glide.grColorCombineExt(GR_CMBX_TEXTURE_RGB, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); - fxMesa->Glide.grAlphaCombineExt(GR_CMBX_TEXTURE_ALPHA, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); - - fxMesa->Glide.grTexAlphaCombineExt(tmu, - alphaComb.SourceA, - alphaComb.ModeA, - alphaComb.SourceB, - alphaComb.ModeB, - alphaComb.SourceC, - alphaComb.InvertC, - alphaComb.SourceD, - alphaComb.InvertD, - alphaComb.Shift, - alphaComb.Invert); - fxMesa->Glide.grTexColorCombineExt(tmu, - colorComb.SourceA, - colorComb.ModeA, - colorComb.SourceB, - colorComb.ModeB, - colorComb.SourceC, - colorComb.InvertC, - colorComb.SourceD, - colorComb.InvertD, - colorComb.Shift, - colorComb.Invert); -} - - -/************************* Single Texture Set ***************************/ - -static void -fxSelectSingleTMUSrcNapalm_NoLock(fxMesaContext fxMesa, GLint tmu, FxBool LODblend) -{ - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSelectSingleTMUSrcNapalm_NoLock(%d, %d)\n", tmu, LODblend); - } - - if (LODblend) { - /* XXX todo - GR_CMBX_LOD_FRAC? */ - fxMesa->tmuSrc = FX_TMU_SPLIT; - } - else { - if (tmu != FX_TMU1) { - /* disable tex1 */ - if (fxMesa->haveTwoTMUs) { - fxMesa->Glide.grTexAlphaCombineExt(FX_TMU1, - GR_CMBX_ZERO, - GR_FUNC_MODE_ZERO, - GR_CMBX_ZERO, - GR_FUNC_MODE_ZERO, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); - fxMesa->Glide.grTexColorCombineExt(FX_TMU1, - GR_CMBX_ZERO, - GR_FUNC_MODE_ZERO, - GR_CMBX_ZERO, - GR_FUNC_MODE_ZERO, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); - } - - fxMesa->tmuSrc = FX_TMU0; - } - else { -#if 1 - grTexCombine(GR_TMU0, - GR_COMBINE_FUNCTION_BLEND, - GR_COMBINE_FACTOR_ONE, - GR_COMBINE_FUNCTION_BLEND, - GR_COMBINE_FACTOR_ONE, - FXFALSE, - FXFALSE); -#else - /* [dBorca] why, oh why? doesn't work! stupid Glide? */ - fxMesa->Glide.grTexAlphaCombineExt(FX_TMU0, - GR_CMBX_OTHER_TEXTURE_ALPHA, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); - fxMesa->Glide.grTexColorCombineExt(FX_TMU0, - GR_CMBX_OTHER_TEXTURE_RGB, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); -#endif - - fxMesa->tmuSrc = FX_TMU1; - } - } -} - -static void -fxSetupTextureSingleTMUNapalm_NoLock(GLcontext * ctx, GLuint textureset) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLuint unitsmode; - tfxTexInfo *ti; - struct gl_texture_object *tObj = ctx->Texture.Unit[textureset]._Current; - int tmu; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureSingleTMUNapalm_NoLock(%d)\n", textureset); - } - - ti = fxTMGetTexInfo(tObj); - - fxTexValidate(ctx, tObj); - - fxSetupSingleTMU_NoLock(fxMesa, tObj); - - if (ti->whichTMU == FX_TMU_BOTH) - tmu = FX_TMU0; - else - tmu = ti->whichTMU; - if (fxMesa->tmuSrc != tmu) - fxSelectSingleTMUSrcNapalm_NoLock(fxMesa, tmu, ti->LODblend); - - if (textureset == 0 || !fxMesa->haveTwoTMUs) - unitsmode = fxGetTexSetConfiguration(ctx, tObj, NULL); - else - unitsmode = fxGetTexSetConfiguration(ctx, NULL, tObj); - -/* if(fxMesa->lastUnitsMode==unitsmode) */ -/* return; */ - - fxMesa->lastUnitsMode = unitsmode; - - fxMesa->stw_hint_state = 0; - FX_grHints_NoLock(GR_HINT_STWHINT, 0); - - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fxSetupTextureSingleTMUNapalm_NoLock: envmode is %s\n", - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[textureset].EnvMode)); - - /* [dBorca] Hack alert: - * what if we're in split mode? (LODBlend) - * also should we update BOTH TMUs in FX_TMU_BOTH mode? - */ - fxSetupTextureEnvNapalm_NoLock(ctx, textureset, tmu, GL_TRUE); -} - - -/************************* Double Texture Set ***************************/ - -static void -fxSetupTextureDoubleTMUNapalm_NoLock(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxTexInfo *ti0, *ti1; - struct gl_texture_object *tObj0 = ctx->Texture.Unit[1]._Current; - struct gl_texture_object *tObj1 = ctx->Texture.Unit[0]._Current; - GLuint unitsmode; - int tmu0 = 0, tmu1 = 1; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureDoubleTMUNapalm_NoLock(...)\n"); - } - - ti0 = fxTMGetTexInfo(tObj0); - fxTexValidate(ctx, tObj0); - - ti1 = fxTMGetTexInfo(tObj1); - fxTexValidate(ctx, tObj1); - - fxSetupDoubleTMU_NoLock(fxMesa, tObj0, tObj1); - - unitsmode = fxGetTexSetConfiguration(ctx, tObj0, tObj1); - -/* if(fxMesa->lastUnitsMode==unitsmode) */ -/* return; */ - - fxMesa->lastUnitsMode = unitsmode; - - fxMesa->stw_hint_state |= GR_STWHINT_ST_DIFF_TMU1; - FX_grHints_NoLock(GR_HINT_STWHINT, fxMesa->stw_hint_state); - - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) - fprintf(stderr, "fxSetupTextureDoubleTMUNapalm_NoLock: envmode is %s/%s\n", - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[0].EnvMode), - _mesa_lookup_enum_by_nr(ctx->Texture.Unit[1].EnvMode)); - - - if ((ti0->whichTMU == FX_TMU1) || (ti1->whichTMU == FX_TMU0)) { - tmu0 = 1; - tmu1 = 0; - } - fxMesa->tmuSrc = FX_TMU_BOTH; - - /* OpenGL vs Glide texture pipeline */ - fxSetupTextureEnvNapalm_NoLock(ctx, 0, 1, GL_TRUE); - fxSetupTextureEnvNapalm_NoLock(ctx, 1, 0, GL_FALSE); -} - -/************************* No Texture ***************************/ - -static void -fxSetupTextureNoneNapalm_NoLock(GLcontext * ctx) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxSetupTextureNoneNapalm_NoLock(...)\n"); - } - - /* the combiner formula is: (A + B) * C + D - ** - ** a = tc_otherselect - ** a_mode = tc_invert_other - ** b = tc_localselect - ** b_mode = tc_invert_local - ** c = (tc_mselect, tc_mselect_7) - ** d = (tc_add_clocal, tc_add_alocal) - ** shift = tc_outshift - ** invert = tc_invert_output - */ - - fxMesa->Glide.grColorCombineExt(GR_CMBX_ITRGB, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - GR_FUNC_MODE_ZERO, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); - fxMesa->Glide.grAlphaCombineExt(GR_CMBX_ITALPHA, - GR_FUNC_MODE_X, - GR_CMBX_ZERO, - GR_FUNC_MODE_ZERO, - GR_CMBX_ZERO, - FXTRUE, - GR_CMBX_ZERO, - FXFALSE, - 0, - FXFALSE); - - fxMesa->lastUnitsMode = FX_UM_NONE; -} diff --git a/src/mesa/drivers/glide/fxtexman.c b/src/mesa/drivers/glide/fxtexman.c deleted file mode 100644 index 940c8fd0b9..0000000000 --- a/src/mesa/drivers/glide/fxtexman.c +++ /dev/null @@ -1,874 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * David Bucciarelli - * Brian Paul - * Daryll Strauss - * Keith Whitwell - * Daniel Borca - * Hiroshi Morii - */ - -/* fxtexman.c - 3Dfx VooDoo texture memory functions */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#if defined(FX) - -#include "hash.h" -#include "fxdrv.h" - -int texSwaps = 0; -static FxU32 texBoundMask; - -#define FX_2MB_SPLIT 0x200000 - -static struct gl_texture_object *fxTMFindOldestObject(fxMesaContext fxMesa, - int tmu); - - -#ifdef TEXSANITY -static void -fubar() -{ -} - - /* Sanity Check */ -static void -sanity(fxMesaContext fxMesa) -{ - MemRange *tmp, *prev, *pos; - - prev = 0; - tmp = fxMesa->tmFree[0]; - while (tmp) { - if (!tmp->startAddr && !tmp->endAddr) { - fprintf(stderr, "Textures fubar\n"); - fubar(); - } - if (tmp->startAddr >= tmp->endAddr) { - fprintf(stderr, "Node fubar\n"); - fubar(); - } - if (prev && (prev->startAddr >= tmp->startAddr || - prev->endAddr > tmp->startAddr)) { - fprintf(stderr, "Sorting fubar\n"); - fubar(); - } - prev = tmp; - tmp = tmp->next; - } - prev = 0; - tmp = fxMesa->tmFree[1]; - while (tmp) { - if (!tmp->startAddr && !tmp->endAddr) { - fprintf(stderr, "Textures fubar\n"); - fubar(); - } - if (tmp->startAddr >= tmp->endAddr) { - fprintf(stderr, "Node fubar\n"); - fubar(); - } - if (prev && (prev->startAddr >= tmp->startAddr || - prev->endAddr > tmp->startAddr)) { - fprintf(stderr, "Sorting fubar\n"); - fubar(); - } - prev = tmp; - tmp = tmp->next; - } -} -#endif - -static MemRange * -fxTMNewRangeNode(fxMesaContext fxMesa, FxU32 start, FxU32 end) -{ - MemRange *result = 0; - - if (fxMesa->tmPool) { - result = fxMesa->tmPool; - fxMesa->tmPool = fxMesa->tmPool->next; - } - else { - if (!(result = MALLOC(sizeof(MemRange)))) { - fprintf(stderr, "fxTMNewRangeNode: ERROR: out of memory!\n"); - fxCloseHardware(); - exit(-1); - } - } - result->startAddr = start; - result->endAddr = end; - return result; -} - -#if 1 -#define fxTMDeleteRangeNode(fxMesa, range) \ - do { \ - range->next = fxMesa->tmPool; \ - fxMesa->tmPool = range; \ - } while (0); -#else -static void -fxTMDeleteRangeNode(fxMesaContext fxMesa, MemRange * range) -{ - range->next = fxMesa->tmPool; - fxMesa->tmPool = range; -} -#endif - -static void -fxTMUInit(fxMesaContext fxMesa, int tmu) -{ - MemRange *tmn, *last; - FxU32 start, end, blockstart, blockend, chunk; - - start = grTexMinAddress(tmu); - end = grTexMaxAddress(tmu); - - chunk = (fxMesa->type >= GR_SSTTYPE_Banshee) ? (end - start) : FX_2MB_SPLIT; - - if (fxMesa->verbose) { - fprintf(stderr, "Voodoo TMU%d configuration:\n", tmu); - } - - fxMesa->freeTexMem[tmu] = end - start; - fxMesa->tmFree[tmu] = NULL; - - last = 0; - blockstart = start; - while (blockstart < end) { - if (blockstart + chunk > end) - blockend = end; - else - blockend = blockstart + chunk; - - if (fxMesa->verbose) - fprintf(stderr, "Voodoo %08u-%08u\n", - (unsigned int) blockstart, (unsigned int) blockend); - - tmn = fxTMNewRangeNode(fxMesa, blockstart, blockend); - tmn->next = NULL; - - - if (last) - last->next = tmn; - else - fxMesa->tmFree[tmu] = tmn; - last = tmn; - - blockstart += chunk; - } -} - -static int -fxTMFindStartAddr(fxMesaContext fxMesa, GLint tmu, int size) -{ - MemRange *prev, *tmp; - int result; - struct gl_texture_object *obj; - - if (fxMesa->HaveTexUma) { - tmu = FX_TMU0; - } - - while (1) { - prev = 0; - tmp = fxMesa->tmFree[tmu]; - while (tmp) { - if (tmp->endAddr - tmp->startAddr >= size) { /* Fits here */ - result = tmp->startAddr; - tmp->startAddr += size; - if (tmp->startAddr == tmp->endAddr) { /* Empty */ - if (prev) { - prev->next = tmp->next; - } - else { - fxMesa->tmFree[tmu] = tmp->next; - } - fxTMDeleteRangeNode(fxMesa, tmp); - } - fxMesa->freeTexMem[tmu] -= size; - return result; - } - prev = tmp; - tmp = tmp->next; - } - /* No free space. Discard oldest */ - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxTMFindStartAddr: No free space. Discard oldest\n"); - } - obj = fxTMFindOldestObject(fxMesa, tmu); - if (!obj) { - fprintf(stderr, "fxTMFindStartAddr: ERROR: No space for texture\n"); - return -1; - } - fxTMMoveOutTM(fxMesa, obj); - texSwaps++; - } -} - -int fxTMCheckStartAddr (fxMesaContext fxMesa, GLint tmu, tfxTexInfo *ti) -{ - MemRange *tmp; - int size; - - if (fxMesa->HaveTexUma) { - return FXTRUE; - } - - size = grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); - - tmp = fxMesa->tmFree[tmu]; - while (tmp) { - if (tmp->endAddr - tmp->startAddr >= size) { /* Fits here */ - return FXTRUE; - } - tmp = tmp->next; - } - - return FXFALSE; -} - -static void -fxTMRemoveRange(fxMesaContext fxMesa, GLint tmu, MemRange * range) -{ - MemRange *tmp, *prev; - - if (fxMesa->HaveTexUma) { - tmu = FX_TMU0; - } - - if (range->startAddr == range->endAddr) { - fxTMDeleteRangeNode(fxMesa, range); - return; - } - fxMesa->freeTexMem[tmu] += range->endAddr - range->startAddr; - prev = 0; - tmp = fxMesa->tmFree[tmu]; - while (tmp) { - if (range->startAddr > tmp->startAddr) { - prev = tmp; - tmp = tmp->next; - } - else - break; - } - /* When we create the regions, we make a split at the 2MB boundary. - Now we have to make sure we don't join those 2MB boundary regions - back together again. */ - range->next = tmp; - if (tmp) { - if (range->endAddr == tmp->startAddr - && tmp->startAddr & texBoundMask) { - /* Combine */ - tmp->startAddr = range->startAddr; - fxTMDeleteRangeNode(fxMesa, range); - range = tmp; - } - } - if (prev) { - if (prev->endAddr == range->startAddr - && range->startAddr & texBoundMask) { - /* Combine */ - prev->endAddr = range->endAddr; - prev->next = range->next; - fxTMDeleteRangeNode(fxMesa, range); - } - else - prev->next = range; - } - else { - fxMesa->tmFree[tmu] = range; - } -} - -static struct gl_texture_object * -fxTMFindOldestObject(fxMesaContext fxMesa, int tmu) -{ - GLuint age, old, lasttime, bindnumber; - GLfloat lowestPriority; - struct gl_texture_object *obj, *lowestPriorityObj; - struct _mesa_HashTable *textures = fxMesa->glCtx->Shared->TexObjects; - GLuint id; - - if (!_mesa_HashFirstEntry(textures)) - return 0; - - obj = NULL; - old = 0; - - lowestPriorityObj = NULL; - lowestPriority = 1.0F; - - bindnumber = fxMesa->texBindNumber; - - for (id = _mesa_HashFirstEntry(textures); - id; - id = _mesa_HashNextEntry(textures, id)) { - struct gl_texture_object *tmp - = (struct gl_texture_object *) _mesa_HashLookup(textures, id); - tfxTexInfo *info = fxTMGetTexInfo(tmp); - - if (info && info->isInTM && - ((info->whichTMU == tmu) || - (info->whichTMU == FX_TMU_BOTH) || - (info->whichTMU == FX_TMU_SPLIT) || - fxMesa->HaveTexUma - ) - ) { - lasttime = info->lastTimeUsed; - - if (lasttime > bindnumber) - age = bindnumber + (UINT_MAX - lasttime + 1); /* TO DO: check wrap around */ - else - age = bindnumber - lasttime; - - if (age >= old) { - old = age; - obj = tmp; - } - - /* examine priority */ - if (tmp->Priority < lowestPriority) { - lowestPriority = tmp->Priority; - lowestPriorityObj = tmp; - } - } - } - - if (lowestPriorityObj != NULL) { - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxTMFindOldestObject: %d pri=%f\n", lowestPriorityObj->Name, lowestPriority); - } - return lowestPriorityObj; - } - else { - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - if (obj != NULL) { - fprintf(stderr, "fxTMFindOldestObject: %d age=%d\n", obj->Name, old); - } - } - return obj; - } -} - -static MemRange * -fxTMAddObj(fxMesaContext fxMesa, - struct gl_texture_object *tObj, GLint tmu, int texmemsize) -{ - FxI32 startAddr; - MemRange *range; - - startAddr = fxTMFindStartAddr(fxMesa, tmu, texmemsize); - if (startAddr < 0) - return 0; - range = fxTMNewRangeNode(fxMesa, startAddr, startAddr + texmemsize); - return range; -} - -/* External Functions */ - -void -fxTMMoveInTM_NoLock(fxMesaContext fxMesa, struct gl_texture_object *tObj, - GLint where) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - int i, l; - int texmemsize; - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxTMMoveInTM_NoLock(%d)\n", tObj->Name); - } - - fxMesa->stats.reqTexUpload++; - - if (!ti->validated) { - fprintf(stderr, "fxTMMoveInTM_NoLock: INTERNAL ERROR: not validated\n"); - fxCloseHardware(); - exit(-1); - } - - if (ti->isInTM) { - if (ti->whichTMU == where) - return; - if (where == FX_TMU_SPLIT || ti->whichTMU == FX_TMU_SPLIT) - fxTMMoveOutTM_NoLock(fxMesa, tObj); - else { - if (ti->whichTMU == FX_TMU_BOTH) - return; - where = FX_TMU_BOTH; - } - } - - if (TDFX_DEBUG & (VERBOSE_DRIVER | VERBOSE_TEXTURE)) { - fprintf(stderr, "fxTMMoveInTM_NoLock: downloading %p (%d) in texture memory in %d\n", - (void *)tObj, tObj->Name, where); - } - - ti->whichTMU = (FxU32) where; - - switch (where) { - case FX_TMU0: - case FX_TMU1: - texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); - ti->tm[where] = fxTMAddObj(fxMesa, tObj, where, texmemsize); - fxMesa->stats.memTexUpload += texmemsize; - - for (i = FX_largeLodValue(ti->info), l = ti->minLevel; - i <= FX_smallLodValue(ti->info); i++, l++) { - struct gl_texture_image *texImage = tObj->Image[0][l]; - grTexDownloadMipMapLevel(where, - ti->tm[where]->startAddr, - FX_valueToLod(i), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, - texImage->Data); - } - break; - case FX_TMU_SPLIT: - texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_ODD, &(ti->info)); - ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize); - fxMesa->stats.memTexUpload += texmemsize; - - texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_EVEN, &(ti->info)); - ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize); - fxMesa->stats.memTexUpload += texmemsize; - - for (i = FX_largeLodValue(ti->info), l = ti->minLevel; - i <= FX_smallLodValue(ti->info); i++, l++) { - struct gl_texture_image *texImage = tObj->Image[0][l]; - - grTexDownloadMipMapLevel(GR_TMU0, - ti->tm[FX_TMU0]->startAddr, - FX_valueToLod(i), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_ODD, - texImage->Data); - - grTexDownloadMipMapLevel(GR_TMU1, - ti->tm[FX_TMU1]->startAddr, - FX_valueToLod(i), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_EVEN, - texImage->Data); - } - break; - case FX_TMU_BOTH: - texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info)); - ti->tm[FX_TMU0] = fxTMAddObj(fxMesa, tObj, FX_TMU0, texmemsize); - fxMesa->stats.memTexUpload += texmemsize; - - /*texmemsize = (int)grTexTextureMemRequired(GR_MIPMAPLEVELMASK_BOTH, &(ti->info));*/ - ti->tm[FX_TMU1] = fxTMAddObj(fxMesa, tObj, FX_TMU1, texmemsize); - fxMesa->stats.memTexUpload += texmemsize; - - for (i = FX_largeLodValue(ti->info), l = ti->minLevel; - i <= FX_smallLodValue(ti->info); i++, l++) { - struct gl_texture_image *texImage = tObj->Image[0][l]; - grTexDownloadMipMapLevel(GR_TMU0, - ti->tm[FX_TMU0]->startAddr, - FX_valueToLod(i), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, - texImage->Data); - - grTexDownloadMipMapLevel(GR_TMU1, - ti->tm[FX_TMU1]->startAddr, - FX_valueToLod(i), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, - texImage->Data); - } - break; - default: - fprintf(stderr, "fxTMMoveInTM_NoLock: INTERNAL ERROR: wrong tmu (%d)\n", where); - fxCloseHardware(); - exit(-1); - } - - fxMesa->stats.texUpload++; - - ti->isInTM = GL_TRUE; -} - - -void -fxTMMoveInTM(fxMesaContext fxMesa, struct gl_texture_object *tObj, - GLint where) -{ - BEGIN_BOARD_LOCK(); - fxTMMoveInTM_NoLock(fxMesa, tObj, where); - END_BOARD_LOCK(); -} - - -void -fxTMReloadMipMapLevel(fxMesaContext fxMesa, struct gl_texture_object *tObj, - GLint level) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - GrLOD_t lodlevel; - GLint tmu; - struct gl_texture_image *texImage = tObj->Image[0][level]; - tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxTMReloadMipMapLevel(%p (%d), %d)\n", (void *)tObj, tObj->Name, level); - } - - assert(mml); - assert(mml->width > 0); - assert(mml->height > 0); - assert(mml->glideFormat > 0); - assert(ti->isInTM); - - if (!ti->validated) { - fprintf(stderr, "fxTMReloadMipMapLevel: INTERNAL ERROR: not validated\n"); - fxCloseHardware(); - exit(-1); - } - - tmu = (int) ti->whichTMU; - fxMesa->stats.reqTexUpload++; - fxMesa->stats.texUpload++; - - lodlevel = ti->info.largeLodLog2 - (level - ti->minLevel); - - switch (tmu) { - case FX_TMU0: - case FX_TMU1: - grTexDownloadMipMapLevel(tmu, - ti->tm[tmu]->startAddr, - lodlevel, - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, texImage->Data); - break; - case FX_TMU_SPLIT: - grTexDownloadMipMapLevel(GR_TMU0, - ti->tm[GR_TMU0]->startAddr, - lodlevel, - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_ODD, texImage->Data); - - grTexDownloadMipMapLevel(GR_TMU1, - ti->tm[GR_TMU1]->startAddr, - lodlevel, - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_EVEN, texImage->Data); - break; - case FX_TMU_BOTH: - grTexDownloadMipMapLevel(GR_TMU0, - ti->tm[GR_TMU0]->startAddr, - lodlevel, - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, texImage->Data); - - grTexDownloadMipMapLevel(GR_TMU1, - ti->tm[GR_TMU1]->startAddr, - lodlevel, - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, texImage->Data); - break; - - default: - fprintf(stderr, "fxTMReloadMipMapLevel: INTERNAL ERROR: wrong tmu (%d)\n", tmu); - fxCloseHardware(); - exit(-1); - } -} - -void -fxTMReloadSubMipMapLevel(fxMesaContext fxMesa, - struct gl_texture_object *tObj, - GLint level, GLint yoffset, GLint height) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - GrLOD_t lodlevel; - unsigned short *data; - GLint tmu; - struct gl_texture_image *texImage = tObj->Image[0][level]; - tfxMipMapLevel *mml = FX_MIPMAP_DATA(texImage); - - assert(mml); - - if (!ti->validated) { - fprintf(stderr, "fxTMReloadSubMipMapLevel: INTERNAL ERROR: not validated\n"); - fxCloseHardware(); - exit(-1); - } - - tmu = (int) ti->whichTMU; - fxTMMoveInTM(fxMesa, tObj, tmu); - - fxTexGetInfo(mml->width, mml->height, - &lodlevel, NULL, NULL, NULL, NULL, NULL); - - if ((ti->info.format == GR_TEXFMT_INTENSITY_8) || - (ti->info.format == GR_TEXFMT_P_8) || - (ti->info.format == GR_TEXFMT_ALPHA_8)) - data = (GLushort *) texImage->Data + ((yoffset * mml->width) >> 1); - else - data = (GLushort *) texImage->Data + yoffset * mml->width; - - switch (tmu) { - case FX_TMU0: - case FX_TMU1: - grTexDownloadMipMapLevelPartial(tmu, - ti->tm[tmu]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel) - + level), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, data, - yoffset, yoffset + height - 1); - break; - case FX_TMU_SPLIT: - grTexDownloadMipMapLevelPartial(GR_TMU0, - ti->tm[FX_TMU0]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel) - + level), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_ODD, data, - yoffset, yoffset + height - 1); - - grTexDownloadMipMapLevelPartial(GR_TMU1, - ti->tm[FX_TMU1]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel) - + level), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_EVEN, data, - yoffset, yoffset + height - 1); - break; - case FX_TMU_BOTH: - grTexDownloadMipMapLevelPartial(GR_TMU0, - ti->tm[FX_TMU0]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel) - + level), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, data, - yoffset, yoffset + height - 1); - - grTexDownloadMipMapLevelPartial(GR_TMU1, - ti->tm[FX_TMU1]->startAddr, - FX_valueToLod(FX_lodToValue(lodlevel) - + level), - FX_largeLodLog2(ti->info), - FX_aspectRatioLog2(ti->info), - ti->info.format, - GR_MIPMAPLEVELMASK_BOTH, data, - yoffset, yoffset + height - 1); - break; - default: - fprintf(stderr, "fxTMReloadSubMipMapLevel: INTERNAL ERROR: wrong tmu (%d)\n", tmu); - fxCloseHardware(); - exit(-1); - } -} - -void -fxTMMoveOutTM(fxMesaContext fxMesa, struct gl_texture_object *tObj) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxTMMoveOutTM(%p (%d))\n", (void *)tObj, tObj->Name); - } - - if (!ti->isInTM) - return; - - switch (ti->whichTMU) { - case FX_TMU0: - case FX_TMU1: - fxTMRemoveRange(fxMesa, (int) ti->whichTMU, ti->tm[ti->whichTMU]); - break; - case FX_TMU_SPLIT: - case FX_TMU_BOTH: - fxTMRemoveRange(fxMesa, FX_TMU0, ti->tm[FX_TMU0]); - fxTMRemoveRange(fxMesa, FX_TMU1, ti->tm[FX_TMU1]); - break; - default: - fprintf(stderr, "fxTMMoveOutTM: INTERNAL ERROR: bad TMU (%ld)\n", ti->whichTMU); - fxCloseHardware(); - exit(-1); - } - - ti->isInTM = GL_FALSE; - ti->whichTMU = FX_TMU_NONE; -} - -void -fxTMFreeTexture(fxMesaContext fxMesa, struct gl_texture_object *tObj) -{ - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - int i; - - if (TDFX_DEBUG & VERBOSE_TEXTURE) { - fprintf(stderr, "fxTMFreeTexture(%p (%d))\n", (void *)tObj, tObj->Name); - } - - fxTMMoveOutTM(fxMesa, tObj); - - for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { - struct gl_texture_image *texImage = tObj->Image[0][i]; - if (texImage) { - if (texImage->DriverData) { - FREE(texImage->DriverData); - texImage->DriverData = NULL; - } - } - } - switch (ti->whichTMU) { - case FX_TMU0: - case FX_TMU1: - fxTMDeleteRangeNode(fxMesa, ti->tm[ti->whichTMU]); - break; - case FX_TMU_SPLIT: - case FX_TMU_BOTH: - fxTMDeleteRangeNode(fxMesa, ti->tm[FX_TMU0]); - fxTMDeleteRangeNode(fxMesa, ti->tm[FX_TMU1]); - break; - } -} - -void -fxTMInit(fxMesaContext fxMesa) -{ - fxMesa->texBindNumber = 0; - fxMesa->tmPool = 0; - - if (fxMesa->HaveTexUma) { - grEnable(GR_TEXTURE_UMA_EXT); - } - - fxTMUInit(fxMesa, FX_TMU0); - - if (!fxMesa->HaveTexUma && fxMesa->haveTwoTMUs) - fxTMUInit(fxMesa, FX_TMU1); - - texBoundMask = (fxMesa->type >= GR_SSTTYPE_Banshee) ? -1 : (FX_2MB_SPLIT - 1); -} - -void -fxTMClose(fxMesaContext fxMesa) -{ - MemRange *tmp, *next; - - tmp = fxMesa->tmPool; - while (tmp) { - next = tmp->next; - FREE(tmp); - tmp = next; - } - tmp = fxMesa->tmFree[FX_TMU0]; - while (tmp) { - next = tmp->next; - FREE(tmp); - tmp = next; - } - if (fxMesa->haveTwoTMUs) { - tmp = fxMesa->tmFree[FX_TMU1]; - while (tmp) { - next = tmp->next; - FREE(tmp); - tmp = next; - } - } -} - -void -fxTMRestoreTextures_NoLock(fxMesaContext ctx) -{ - struct _mesa_HashTable *textures = ctx->glCtx->Shared->TexObjects; - GLuint id; - - for (id = _mesa_HashFirstEntry(textures); - id; - id = _mesa_HashNextEntry(textures, id)) { - struct gl_texture_object *tObj - = (struct gl_texture_object *) _mesa_HashLookup(textures, id); - tfxTexInfo *ti = fxTMGetTexInfo(tObj); - if (ti && ti->isInTM) { - int i; - for (i = 0; i < MAX_TEXTURE_UNITS; i++) { - if (ctx->glCtx->Texture.Unit[i]._Current == tObj) { - /* Force the texture onto the board, as it could be in use */ - int where = ti->whichTMU; - fxTMMoveOutTM_NoLock(ctx, tObj); - fxTMMoveInTM_NoLock(ctx, tObj, where); - break; - } - } - if (i == MAX_TEXTURE_UNITS) /* Mark the texture as off the board */ - fxTMMoveOutTM_NoLock(ctx, tObj); - } - } -} - -#else - - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_texman(void); -int -gl_fx_dummy_function_texman(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c deleted file mode 100644 index aff91fe7d4..0000000000 --- a/src/mesa/drivers/glide/fxtris.c +++ /dev/null @@ -1,1832 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * Keith Whitwell - * Daniel Borca - */ - -#include "glheader.h" - -#ifdef FX - -#include "main/imports.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -#include "fxdrv.h" - - -static GLboolean fxMultipass_ColorSum (GLcontext *ctx, GLuint pass); - - -/* - * Subpixel offsets to adjust Mesa's (true) window coordinates to - * Glide coordinates. We need these to ensure precise rasterization. - * Otherwise, we'll fail a bunch of conformance tests. - */ -#define TRI_X_OFFSET ( 0.0F) -#define TRI_Y_OFFSET ( 0.0F) -#define LINE_X_OFFSET ( 0.0F) -#define LINE_Y_OFFSET ( 0.125F) -#define PNT_X_OFFSET ( 0.375F) -#define PNT_Y_OFFSET ( 0.375F) - -static void fxRasterPrimitive( GLcontext *ctx, GLenum prim ); -static void fxRenderPrimitive( GLcontext *ctx, GLenum prim ); - -static GLenum reduced_prim[GL_POLYGON+1] = { - GL_POINTS, - GL_LINES, - GL_LINES, - GL_LINES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES -}; - -/*********************************************************************** - * Macros for t_dd_tritmp.h to draw basic primitives * - ***********************************************************************/ - -#define TRI( a, b, c ) \ -do { \ - if (DO_FALLBACK) \ - fxMesa->draw_tri( fxMesa, a, b, c ); \ - else \ - grDrawTriangle( a, b, c ); \ -} while (0) \ - -#define QUAD( a, b, c, d ) \ -do { \ - if (DO_FALLBACK) { \ - fxMesa->draw_tri( fxMesa, a, b, d ); \ - fxMesa->draw_tri( fxMesa, b, c, d ); \ - } else { \ - GrVertex *_v_[4]; \ - _v_[0] = d; \ - _v_[1] = a; \ - _v_[2] = b; \ - _v_[3] = c; \ - grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);\ - /*grDrawTriangle( a, b, d );*/ \ - /*grDrawTriangle( b, c, d );*/ \ - } \ -} while (0) - -#define LINE( v0, v1 ) \ -do { \ - if (DO_FALLBACK) \ - fxMesa->draw_line( fxMesa, v0, v1 ); \ - else { \ - v0->x += LINE_X_OFFSET - TRI_X_OFFSET; \ - v0->y += LINE_Y_OFFSET - TRI_Y_OFFSET; \ - v1->x += LINE_X_OFFSET - TRI_X_OFFSET; \ - v1->y += LINE_Y_OFFSET - TRI_Y_OFFSET; \ - grDrawLine( v0, v1 ); \ - v0->x -= LINE_X_OFFSET - TRI_X_OFFSET; \ - v0->y -= LINE_Y_OFFSET - TRI_Y_OFFSET; \ - v1->x -= LINE_X_OFFSET - TRI_X_OFFSET; \ - v1->y -= LINE_Y_OFFSET - TRI_Y_OFFSET; \ - } \ -} while (0) - -#define POINT( v0 ) \ -do { \ - if (DO_FALLBACK) \ - fxMesa->draw_point( fxMesa, v0 ); \ - else { \ - v0->x += PNT_X_OFFSET - TRI_X_OFFSET; \ - v0->y += PNT_Y_OFFSET - TRI_Y_OFFSET; \ - grDrawPoint( v0 ); \ - v0->x -= PNT_X_OFFSET - TRI_X_OFFSET; \ - v0->y -= PNT_Y_OFFSET - TRI_Y_OFFSET; \ - } \ -} while (0) - - -/*********************************************************************** - * Fallback to swrast for basic primitives * - ***********************************************************************/ - -/* Build an SWvertex from a hardware vertex. - * - * This code is hit only when a mix of accelerated and unaccelerated - * primitives are being drawn, and only for the unaccelerated - * primitives. - */ -static void -fx_translate_vertex( GLcontext *ctx, const GrVertex *src, SWvertex *dst) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLuint ts0 = fxMesa->tmu_source[0]; - GLuint ts1 = fxMesa->tmu_source[1]; - GLfloat w = 1.0F / src->oow; - - dst->win[0] = src->x; - dst->win[1] = src->y; - dst->win[2] = src->ooz; - dst->win[3] = src->oow; - -#if FX_PACKEDCOLOR - dst->color[0] = src->pargb[2]; - dst->color[1] = src->pargb[1]; - dst->color[2] = src->pargb[0]; - dst->color[3] = src->pargb[3]; - - dst->specular[0] = src->pspec[2]; - dst->specular[1] = src->pspec[1]; - dst->specular[2] = src->pspec[0]; -#else /* !FX_PACKEDCOLOR */ - dst->color[0] = src->r; - dst->color[1] = src->g; - dst->color[2] = src->b; - dst->color[3] = src->a; - - dst->specular[0] = src->r1; - dst->specular[1] = src->g1; - dst->specular[2] = src->g1; -#endif /* !FX_PACKEDCOLOR */ - - dst->texcoord[ts0][0] = fxMesa->inv_s0scale * src->tmuvtx[0].sow * w; - dst->texcoord[ts0][1] = fxMesa->inv_t0scale * src->tmuvtx[0].tow * w; - - if (fxMesa->stw_hint_state & GR_STWHINT_W_DIFF_TMU0) - dst->texcoord[ts0][3] = src->tmuvtx[0].oow * w; - else - dst->texcoord[ts0][3] = 1.0F; - - if (fxMesa->SetupIndex & SETUP_TMU1) { - dst->texcoord[ts1][0] = fxMesa->inv_s1scale * src->tmuvtx[1].sow * w; - dst->texcoord[ts1][1] = fxMesa->inv_t1scale * src->tmuvtx[1].tow * w; - - if (fxMesa->stw_hint_state & GR_STWHINT_W_DIFF_TMU1) - dst->texcoord[ts1][3] = src->tmuvtx[1].oow * w; - else - dst->texcoord[ts1][3] = 1.0F; - } - - dst->pointSize = src->psize; -} - - -static void -fx_fallback_tri( fxMesaContext fxMesa, - GrVertex *v0, - GrVertex *v1, - GrVertex *v2 ) -{ - GLcontext *ctx = fxMesa->glCtx; - SWvertex v[3]; - - fx_translate_vertex( ctx, v0, &v[0] ); - fx_translate_vertex( ctx, v1, &v[1] ); - fx_translate_vertex( ctx, v2, &v[2] ); - _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); -} - - -static void -fx_fallback_line( fxMesaContext fxMesa, - GrVertex *v0, - GrVertex *v1 ) -{ - GLcontext *ctx = fxMesa->glCtx; - SWvertex v[2]; - fx_translate_vertex( ctx, v0, &v[0] ); - fx_translate_vertex( ctx, v1, &v[1] ); - _swrast_Line( ctx, &v[0], &v[1] ); -} - - -static void -fx_fallback_point( fxMesaContext fxMesa, - GrVertex *v0 ) -{ - GLcontext *ctx = fxMesa->glCtx; - SWvertex v[1]; - fx_translate_vertex( ctx, v0, &v[0] ); - _swrast_Point( ctx, &v[0] ); -} - -/*********************************************************************** - * Functions to draw basic primitives * - ***********************************************************************/ - -static void fx_print_vertex( GLcontext *ctx, const GrVertex *v ) -{ - fprintf(stderr, "fx_print_vertex:\n"); - - fprintf(stderr, "\tvertex at %p\n", (void *) v); - - fprintf(stderr, "\tx %f y %f z %f oow %f\n", v->x, v->y, v->ooz, v->oow); -#if FX_PACKEDCOLOR - fprintf(stderr, "\tr %d g %d b %d a %d\n", v->pargb[2], v->pargb[1], v->pargb[0], v->pargb[3]); -#else /* !FX_PACKEDCOLOR */ - fprintf(stderr, "\tr %f g %f b %f a %f\n", v->r, v->g, v->b, v->a); -#endif /* !FX_PACKEDCOLOR */ - - fprintf(stderr, "\n"); -} - -#define DO_FALLBACK 0 - -/* Need to do clip loop at each triangle when mixing swrast and hw - * rendering. These functions are only used when mixed-mode rendering - * is occurring. - */ -static void fx_draw_triangle( fxMesaContext fxMesa, - GrVertex *v0, - GrVertex *v1, - GrVertex *v2 ) -{ - BEGIN_CLIP_LOOP(); - TRI( v0, v1, v2 ); - END_CLIP_LOOP(); -} - -static void fx_draw_line( fxMesaContext fxMesa, - GrVertex *v0, - GrVertex *v1 ) -{ - /* No support for wide lines (avoid wide/aa line fallback). - */ - BEGIN_CLIP_LOOP(); - LINE(v0, v1); - END_CLIP_LOOP(); -} - -static void fx_draw_point( fxMesaContext fxMesa, - GrVertex *v0 ) -{ - /* No support for wide points. - */ - BEGIN_CLIP_LOOP(); - POINT( v0 ); - END_CLIP_LOOP(); -} - -#ifndef M_2PI -#define M_2PI 6.28318530717958647692528676655901 -#endif -#define __GL_COSF cos -#define __GL_SINF sin -static void fx_draw_point_sprite ( fxMesaContext fxMesa, - GrVertex *v0, GLfloat psize ) -{ - const GLcontext *ctx = fxMesa->glCtx; - - GLfloat radius; - GrVertex _v_[4]; - GLuint ts0 = fxMesa->tmu_source[0]; - GLuint ts1 = fxMesa->tmu_source[1]; - GLfloat w = v0->oow; - GLfloat u0scale = fxMesa->s0scale * w; - GLfloat v0scale = fxMesa->t0scale * w; - GLfloat u1scale = fxMesa->s1scale * w; - GLfloat v1scale = fxMesa->t1scale * w; - - radius = psize / 2.0F; - _v_[0] = *v0; - _v_[1] = *v0; - _v_[2] = *v0; - _v_[3] = *v0; - /* CLIP_LOOP ?!? */ - /* point coverage? */ - /* we don't care about culling here (see fxSetupCull) */ - - if (ctx->Point.SpriteOrigin == GL_UPPER_LEFT) { - _v_[0].x -= radius; - _v_[0].y += radius; - _v_[1].x += radius; - _v_[1].y += radius; - _v_[2].x += radius; - _v_[2].y -= radius; - _v_[3].x -= radius; - _v_[3].y -= radius; - } else { - _v_[0].x -= radius; - _v_[0].y -= radius; - _v_[1].x += radius; - _v_[1].y -= radius; - _v_[2].x += radius; - _v_[2].y += radius; - _v_[3].x -= radius; - _v_[3].y += radius; - } - - if (ctx->Point.CoordReplace[ts0]) { - _v_[0].tmuvtx[0].sow = 0; - _v_[0].tmuvtx[0].tow = 0; - _v_[1].tmuvtx[0].sow = u0scale; - _v_[1].tmuvtx[0].tow = 0; - _v_[2].tmuvtx[0].sow = u0scale; - _v_[2].tmuvtx[0].tow = v0scale; - _v_[3].tmuvtx[0].sow = 0; - _v_[3].tmuvtx[0].tow = v0scale; - } - if (ctx->Point.CoordReplace[ts1]) { - _v_[0].tmuvtx[1].sow = 0; - _v_[0].tmuvtx[1].tow = 0; - _v_[1].tmuvtx[1].sow = u1scale; - _v_[1].tmuvtx[1].tow = 0; - _v_[2].tmuvtx[1].sow = u1scale; - _v_[2].tmuvtx[1].tow = v1scale; - _v_[3].tmuvtx[1].sow = 0; - _v_[3].tmuvtx[1].tow = v1scale; - } - - grDrawVertexArrayContiguous(GR_TRIANGLE_FAN, 4, _v_, sizeof(GrVertex)); -} - -static void fx_draw_point_wide ( fxMesaContext fxMesa, - GrVertex *v0 ) -{ - GLint i, n; - GLfloat ang, radius, oon; - GrVertex vtxB, vtxC; - GrVertex *_v_[3]; - - const GLcontext *ctx = fxMesa->glCtx; - const GLfloat psize = (ctx->_TriangleCaps & DD_POINT_ATTEN) - ? CLAMP(v0->psize, ctx->Point.MinSize, ctx->Point.MaxSize) - : ctx->Point._Size; /* clamped */ - - if (ctx->Point.PointSprite) { - fx_draw_point_sprite(fxMesa, v0, psize); - return; - } - - _v_[0] = v0; - _v_[1] = &vtxB; - _v_[2] = &vtxC; - - radius = psize / 2.0F; - n = IROUND(psize * 2); /* radius x 4 */ - if (n < 4) n = 4; - oon = 1.0F / (GLfloat)n; - - /* CLIP_LOOP ?!? */ - /* point coverage? */ - /* we don't care about culling here (see fxSetupCull) */ - - vtxB = *v0; - vtxC = *v0; - - vtxB.x += radius; - ang = M_2PI * oon; - vtxC.x += radius * __GL_COSF(ang); - vtxC.y += radius * __GL_SINF(ang); - grDrawVertexArray(GR_TRIANGLE_FAN, 3, _v_); - for (i = 2; i <= n; i++) { - ang = M_2PI * i * oon; - vtxC.x = v0->x + radius * __GL_COSF(ang); - vtxC.y = v0->y + radius * __GL_SINF(ang); - grDrawVertexArray(GR_TRIANGLE_FAN_CONTINUE, 1, &_v_[2]); - } -} - -static void fx_render_pw_verts( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - (void) flags; - - fxRenderPrimitive( ctx, GL_POINTS ); - - for ( ; start < count ; start++) - fx_draw_point_wide(fxMesa, fxVB + start); -} - -static void fx_render_pw_elts ( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; - (void) flags; - - fxRenderPrimitive( ctx, GL_POINTS ); - - for ( ; start < count ; start++) - fx_draw_point_wide(fxMesa, fxVB + elt[start]); -} - -static void fx_draw_point_wide_aa ( fxMesaContext fxMesa, - GrVertex *v0 ) -{ - GLint i, n; - GLfloat ang, radius, oon; - GrVertex vtxB, vtxC; - - const GLcontext *ctx = fxMesa->glCtx; - const GLfloat psize = (ctx->_TriangleCaps & DD_POINT_ATTEN) - ? CLAMP(v0->psize, ctx->Point.MinSize, ctx->Point.MaxSize) - : ctx->Point._Size; /* clamped */ - - if (ctx->Point.PointSprite) { - fx_draw_point_sprite(fxMesa, v0, psize); - return; - } - - radius = psize / 2.0F; - n = IROUND(psize * 2); /* radius x 4 */ - if (n < 4) n = 4; - oon = 1.0F / (GLfloat)n; - - /* CLIP_LOOP ?!? */ - /* point coverage? */ - /* we don't care about culling here (see fxSetupCull) */ - - vtxB = *v0; - vtxC = *v0; - - vtxB.x += radius; - for (i = 1; i <= n; i++) { - ang = M_2PI * i * oon; - vtxC.x = v0->x + radius * __GL_COSF(ang); - vtxC.y = v0->y + radius * __GL_SINF(ang); - grAADrawTriangle( v0, &vtxB, &vtxC, FXFALSE, FXTRUE, FXFALSE); - /*grDrawTriangle( v0, &vtxB, &vtxC);*/ - vtxB.x = vtxC.x; - vtxB.y = vtxC.y; - } -} -#undef __GLCOSF -#undef __GLSINF -#undef M_2PI - -#undef DO_FALLBACK - - -#define FX_UNFILLED_BIT 0x1 -#define FX_OFFSET_BIT 0x2 -#define FX_TWOSIDE_BIT 0x4 -#define FX_FLAT_BIT 0x8 -#define FX_TWOSTENCIL_BIT 0x10 -#define FX_FALLBACK_BIT 0x20 -#define FX_MAX_TRIFUNC 0x40 - -static struct { - tnl_points_func points; - tnl_line_func line; - tnl_triangle_func triangle; - tnl_quad_func quad; -} rast_tab[FX_MAX_TRIFUNC]; - -#define DO_FALLBACK (IND & FX_FALLBACK_BIT) -#define DO_OFFSET (IND & FX_OFFSET_BIT) -#define DO_UNFILLED (IND & FX_UNFILLED_BIT) -#define DO_TWOSIDE (IND & FX_TWOSIDE_BIT) -#define DO_FLAT (IND & FX_FLAT_BIT) -#define DO_TWOSTENCIL (IND & FX_TWOSTENCIL_BIT) -#define DO_TRI 1 -#define DO_QUAD 1 -#define DO_LINE 1 -#define DO_POINTS 1 -#define DO_FULL_QUAD 1 - -#define HAVE_RGBA 1 -#define HAVE_SPEC 1 -#define HAVE_HW_FLATSHADE 0 -#define HAVE_BACK_COLORS 0 -#define VERTEX GrVertex -#define TAB rast_tab - -#define DEPTH_SCALE 1.0 -#define UNFILLED_TRI unfilled_tri -#define UNFILLED_QUAD unfilled_quad -#define VERT_X(_v) _v->x -#define VERT_Y(_v) _v->y -#define VERT_Z(_v) _v->ooz -#define AREA_IS_CCW( a ) IS_NEGATIVE( a ) -#define GET_VERTEX(e) (fxMesa->verts + e) - - -#if FX_PACKEDCOLOR -#define VERT_SET_RGBA( dst, f ) \ -do { \ - UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[2], f[0]);\ - UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[1], f[1]);\ - UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[0], f[2]);\ - UNCLAMPED_FLOAT_TO_UBYTE(dst->pargb[3], f[3]);\ -} while (0) - -#define VERT_COPY_RGBA( v0, v1 ) \ - *(GLuint *)&v0->pargb = *(GLuint *)&v1->pargb - -#define VERT_SAVE_RGBA( idx ) \ - *(GLuint *)&color[idx] = *(GLuint *)&v[idx]->pargb - -#define VERT_RESTORE_RGBA( idx ) \ - *(GLuint *)&v[idx]->pargb = *(GLuint *)&color[idx] - - -#define VERT_SET_SPEC( dst, f ) \ -do { \ - UNCLAMPED_FLOAT_TO_UBYTE(dst->pspec[2], f[0]);\ - UNCLAMPED_FLOAT_TO_UBYTE(dst->pspec[1], f[1]);\ - UNCLAMPED_FLOAT_TO_UBYTE(dst->pspec[0], f[2]);\ -} while (0) - -#define VERT_COPY_SPEC( v0, v1 ) \ - *(GLuint *)&v0->pspec = *(GLuint *)&v1->pspec - -#define VERT_SAVE_SPEC( idx ) \ - *(GLuint *)&spec[idx] = *(GLuint *)&v[idx]->pspec - -#define VERT_RESTORE_SPEC( idx ) \ - *(GLuint *)&v[idx]->pspec = *(GLuint *)&spec[idx] - - -#define LOCAL_VARS(n) \ - fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GLubyte color[n][4], spec[n][4]; \ - (void) color; (void) spec; -#else /* !FX_PACKEDCOLOR */ -#define VERT_SET_RGBA( dst, f ) \ -do { \ - CNORM(dst->r, f[0]); \ - CNORM(dst->g, f[1]); \ - CNORM(dst->b, f[2]); \ - CNORM(dst->a, f[3]); \ -} while (0) - -#define VERT_COPY_RGBA( v0, v1 ) \ -do { \ - COPY_FLOAT(v0->r, v1->r); \ - COPY_FLOAT(v0->g, v1->g); \ - COPY_FLOAT(v0->b, v1->b); \ - COPY_FLOAT(v0->a, v1->a); \ -} while (0) - -#define VERT_SAVE_RGBA( idx ) \ -do { \ - COPY_FLOAT(color[idx][0], v[idx]->r); \ - COPY_FLOAT(color[idx][1], v[idx]->g); \ - COPY_FLOAT(color[idx][2], v[idx]->b); \ - COPY_FLOAT(color[idx][3], v[idx]->a); \ -} while (0) - -#define VERT_RESTORE_RGBA( idx ) \ -do { \ - COPY_FLOAT(v[idx]->r, color[idx][0]); \ - COPY_FLOAT(v[idx]->g, color[idx][1]); \ - COPY_FLOAT(v[idx]->b, color[idx][2]); \ - COPY_FLOAT(v[idx]->a, color[idx][3]); \ -} while (0) - - -#define VERT_SET_SPEC( dst, f ) \ -do { \ - CNORM(dst->r1, f[0]); \ - CNORM(dst->g1, f[1]); \ - CNORM(dst->b1, f[2]); \ -} while (0) - -#define VERT_COPY_SPEC( v0, v1 ) \ -do { \ - COPY_FLOAT(v0->r1, v1->r1); \ - COPY_FLOAT(v0->g1, v1->g1); \ - COPY_FLOAT(v0->b1, v1->b1); \ -} while (0) - -#define VERT_SAVE_SPEC( idx ) \ -do { \ - COPY_FLOAT(spec[idx][0], v[idx]->r1); \ - COPY_FLOAT(spec[idx][1], v[idx]->g1); \ - COPY_FLOAT(spec[idx][2], v[idx]->b1); \ -} while (0) - -#define VERT_RESTORE_SPEC( idx ) \ -do { \ - COPY_FLOAT(v[idx]->r1, spec[idx][0]); \ - COPY_FLOAT(v[idx]->g1, spec[idx][1]); \ - COPY_FLOAT(v[idx]->b1, spec[idx][2]); \ -} while (0) - - -#define LOCAL_VARS(n) \ - fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GLfloat color[n][4], spec[n][4]; \ - (void) color; (void) spec; -#endif /* !FX_PACKEDCOLOR */ - - -/*********************************************************************** - * Twoside stencil * - ***********************************************************************/ -#define SETUP_STENCIL(f) if (f) fxSetupStencilFace(ctx, f) -#define UNSET_STENCIL(f) if (f) fxSetupStencil(ctx) - - -/*********************************************************************** - * Functions to draw basic unfilled primitives * - ***********************************************************************/ - -#define RASTERIZE(x) if (fxMesa->raster_primitive != reduced_prim[x]) \ - fxRasterPrimitive( ctx, reduced_prim[x] ) -#define RENDER_PRIMITIVE fxMesa->render_primitive -#define IND FX_FALLBACK_BIT -#define TAG(x) x -#include "tnl_dd/t_dd_unfilled.h" -#undef IND - -/*********************************************************************** - * Functions to draw GL primitives * - ***********************************************************************/ - -#define IND (0) -#define TAG(x) x -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT) -#define TAG(x) x##_twoside_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_FALLBACK_BIT) -#define TAG(x) x##_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT) -#define TAG(x) x##_offset_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT) -#define TAG(x) x##_twoside_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT) -#define TAG(x) x##_twoside_offset_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT) -#define TAG(x) x##_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT) -#define TAG(x) x##_offset_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT) -#define TAG(x) x##_twoside_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \ - FX_FALLBACK_BIT) -#define TAG(x) x##_twoside_offset_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - - -/* Fx doesn't support provoking-vertex flat-shading? - */ -#define IND (FX_FLAT_BIT) -#define TAG(x) x##_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_FLAT_BIT) -#define TAG(x) x##_offset_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_offset_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT|FX_FLAT_BIT) -#define TAG(x) x##_unfilled_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT) -#define TAG(x) x##_offset_unfilled_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_unfilled_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_offset_unfilled_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_offset_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_offset_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_unfilled_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_offset_unfilled_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_unfilled_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \ - FX_FALLBACK_BIT|FX_FLAT_BIT) -#define TAG(x) x##_twoside_offset_unfilled_fallback_flat -#include "tnl_dd/t_dd_tritmp.h" - - -/* 2-sided stencil begin */ -#define IND (FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_unfilled_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_unfilled_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_unfilled_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_unfilled_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_unfilled_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_unfilled_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_unfilled_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \ - FX_FALLBACK_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_unfilled_fallback_twostencil -#include "tnl_dd/t_dd_tritmp.h" - - -/* Fx doesn't support provoking-vertex flat-shading? - */ -#define IND (FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_unfilled_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_unfilled_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_unfilled_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_unfilled_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_unfilled_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_OFFSET_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_offset_unfilled_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_UNFILLED_BIT|FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_unfilled_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FX_TWOSIDE_BIT|FX_OFFSET_BIT|FX_UNFILLED_BIT| \ - FX_FALLBACK_BIT|FX_FLAT_BIT|FX_TWOSTENCIL_BIT) -#define TAG(x) x##_twoside_offset_unfilled_fallback_flat_twostencil -#include "tnl_dd/t_dd_tritmp.h" -/* 2-sided stencil end */ - - -static void init_rast_tab( void ) -{ - init(); - init_offset(); - init_twoside(); - init_twoside_offset(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_twoside_offset_unfilled(); - init_fallback(); - init_offset_fallback(); - init_twoside_fallback(); - init_twoside_offset_fallback(); - init_unfilled_fallback(); - init_offset_unfilled_fallback(); - init_twoside_unfilled_fallback(); - init_twoside_offset_unfilled_fallback(); - - init_flat(); - init_offset_flat(); - init_twoside_flat(); - init_twoside_offset_flat(); - init_unfilled_flat(); - init_offset_unfilled_flat(); - init_twoside_unfilled_flat(); - init_twoside_offset_unfilled_flat(); - init_fallback_flat(); - init_offset_fallback_flat(); - init_twoside_fallback_flat(); - init_twoside_offset_fallback_flat(); - init_unfilled_fallback_flat(); - init_offset_unfilled_fallback_flat(); - init_twoside_unfilled_fallback_flat(); - init_twoside_offset_unfilled_fallback_flat(); - - /* 2-sided stencil begin */ - init_twostencil(); - init_offset_twostencil(); - init_twoside_twostencil(); - init_twoside_offset_twostencil(); - init_unfilled_twostencil(); - init_offset_unfilled_twostencil(); - init_twoside_unfilled_twostencil(); - init_twoside_offset_unfilled_twostencil(); - init_fallback_twostencil(); - init_offset_fallback_twostencil(); - init_twoside_fallback_twostencil(); - init_twoside_offset_fallback_twostencil(); - init_unfilled_fallback_twostencil(); - init_offset_unfilled_fallback_twostencil(); - init_twoside_unfilled_fallback_twostencil(); - init_twoside_offset_unfilled_fallback_twostencil(); - - init_flat_twostencil(); - init_offset_flat_twostencil(); - init_twoside_flat_twostencil(); - init_twoside_offset_flat_twostencil(); - init_unfilled_flat_twostencil(); - init_offset_unfilled_flat_twostencil(); - init_twoside_unfilled_flat_twostencil(); - init_twoside_offset_unfilled_flat_twostencil(); - init_fallback_flat_twostencil(); - init_offset_fallback_flat_twostencil(); - init_twoside_fallback_flat_twostencil(); - init_twoside_offset_fallback_flat_twostencil(); - init_unfilled_fallback_flat_twostencil(); - init_offset_unfilled_fallback_flat_twostencil(); - init_twoside_unfilled_fallback_flat_twostencil(); - init_twoside_offset_unfilled_fallback_flat_twostencil(); - /* 2-sided stencil end */ -} - - -/**********************************************************************/ -/* Render whole begin/end objects */ -/**********************************************************************/ - - -/* Accelerate vertex buffer rendering when renderindex == 0 and - * there is no clipping. - */ -#define INIT(x) fxRenderPrimitive( ctx, x ) - -static void fx_render_vb_points( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - GLint i; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_points\n"); - } - - INIT(GL_POINTS); - - /* Adjust point coords */ - for (i = start; i < count; i++) { - fxVB[i].x += PNT_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y += PNT_Y_OFFSET - TRI_Y_OFFSET; - } - - grDrawVertexArrayContiguous( GR_POINTS, count-start, - fxVB + start, sizeof(GrVertex)); - /* restore point coords */ - for (i = start; i < count; i++) { - fxVB[i].x -= PNT_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y -= PNT_Y_OFFSET - TRI_Y_OFFSET; - } -} - -static void fx_render_vb_line_strip( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - GLint i; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_line_strip\n"); - } - - INIT(GL_LINE_STRIP); - - /* adjust line coords */ - for (i = start; i < count; i++) { - fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET; - } - - grDrawVertexArrayContiguous( GR_LINE_STRIP, count-start, - fxVB + start, sizeof(GrVertex)); - - /* restore line coords */ - for (i = start; i < count; i++) { - fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET; - } -} - -static void fx_render_vb_line_loop( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - GLint i; - GLint j = start; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_line_loop\n"); - } - - INIT(GL_LINE_LOOP); - - if (!(flags & PRIM_BEGIN)) { - j++; - } - - /* adjust line coords */ - for (i = start; i < count; i++) { - fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET; - } - - grDrawVertexArrayContiguous( GR_LINE_STRIP, count-j, - fxVB + j, sizeof(GrVertex)); - - if (flags & PRIM_END) - grDrawLine( fxVB + (count - 1), - fxVB + start ); - - /* restore line coords */ - for (i = start; i < count; i++) { - fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET; - } -} - -static void fx_render_vb_lines( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - GLint i; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_lines\n"); - } - - INIT(GL_LINES); - - /* adjust line coords */ - for (i = start; i < count; i++) { - fxVB[i].x += LINE_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y += LINE_Y_OFFSET - TRI_Y_OFFSET; - } - - grDrawVertexArrayContiguous( GR_LINES, count-start, - fxVB + start, sizeof(GrVertex)); - - /* restore line coords */ - for (i = start; i < count; i++) { - fxVB[i].x -= LINE_X_OFFSET - TRI_X_OFFSET; - fxVB[i].y -= LINE_Y_OFFSET - TRI_Y_OFFSET; - } -} - -static void fx_render_vb_triangles( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - GLuint j; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_triangles\n"); - } - - INIT(GL_TRIANGLES); - - for (j=start+2; jverts; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_tri_strip\n"); - } - - INIT(GL_TRIANGLE_STRIP); - - /* no GR_TRIANGLE_STRIP_CONTINUE?!? */ - - grDrawVertexArrayContiguous( GR_TRIANGLE_STRIP, count-start, - fxVB + start, sizeof(GrVertex)); -} - - -static void fx_render_vb_tri_fan( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_tri_fan\n"); - } - - INIT(GL_TRIANGLE_FAN); - - grDrawVertexArrayContiguous( GR_TRIANGLE_FAN, count-start, - fxVB + start, sizeof(GrVertex) ); -} - -static void fx_render_vb_quads( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - GLuint i; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_quads\n"); - } - - INIT(GL_QUADS); - - for (i = start + 3 ; i < count ; i += 4 ) { -#define VERT(x) (fxVB + (x)) - GrVertex *_v_[4]; - _v_[0] = VERT(i); - _v_[1] = VERT(i-3); - _v_[2] = VERT(i-2); - _v_[3] = VERT(i-1); - grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_); - /*grDrawTriangle( VERT(i-3), VERT(i-2), VERT(i) );*/ - /*grDrawTriangle( VERT(i-2), VERT(i-1), VERT(i) );*/ -#undef VERT - } -} - -static void fx_render_vb_quad_strip( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_quad_strip\n"); - } - - INIT(GL_QUAD_STRIP); - - count -= (count-start)&1; - - grDrawVertexArrayContiguous( GR_TRIANGLE_STRIP, - count-start, fxVB + start, sizeof(GrVertex)); -} - -static void fx_render_vb_poly( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GrVertex *fxVB = fxMesa->verts; - (void) flags; - - if (TDFX_DEBUG & VERBOSE_VARRAY) { - fprintf(stderr, "fx_render_vb_poly\n"); - } - - INIT(GL_POLYGON); - - grDrawVertexArrayContiguous( GR_POLYGON, count-start, - fxVB + start, sizeof(GrVertex)); -} - -static void fx_render_vb_noop( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - (void) (ctx && start && count && flags); -} - -static void (*fx_render_tab_verts[GL_POLYGON+2])(GLcontext *, - GLuint, - GLuint, - GLuint) = -{ - fx_render_vb_points, - fx_render_vb_lines, - fx_render_vb_line_loop, - fx_render_vb_line_strip, - fx_render_vb_triangles, - fx_render_vb_tri_strip, - fx_render_vb_tri_fan, - fx_render_vb_quads, - fx_render_vb_quad_strip, - fx_render_vb_poly, - fx_render_vb_noop, -}; -#undef INIT - - -/**********************************************************************/ -/* Render whole (indexed) begin/end objects */ -/**********************************************************************/ - - -#define VERT(x) (vertptr + x) - -#define RENDER_POINTS( start, count ) \ - for ( ; start < count ; start++) \ - grDrawPoint( VERT(ELT(start)) ); - -#define RENDER_LINE( v0, v1 ) \ - grDrawLine( VERT(v0), VERT(v1) ) - -#define RENDER_TRI( v0, v1, v2 ) \ - grDrawTriangle( VERT(v0), VERT(v1), VERT(v2) ) - -#define RENDER_QUAD( v0, v1, v2, v3 ) \ - do { \ - GrVertex *_v_[4]; \ - _v_[0] = VERT(v3);\ - _v_[1] = VERT(v0);\ - _v_[2] = VERT(v1);\ - _v_[3] = VERT(v2);\ - grDrawVertexArray(GR_TRIANGLE_FAN, 4, _v_);\ - /*grDrawTriangle( VERT(v0), VERT(v1), VERT(v3) );*/\ - /*grDrawTriangle( VERT(v1), VERT(v2), VERT(v3) );*/\ - } while (0) - -#define INIT(x) fxRenderPrimitive( ctx, x ) - -#undef LOCAL_VARS -#define LOCAL_VARS \ - fxMesaContext fxMesa = FX_CONTEXT(ctx); \ - GrVertex *vertptr = fxMesa->verts; \ - const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ - (void) elt; - -#define RESET_STIPPLE -#define RESET_OCCLUSION -#define PRESERVE_VB_DEFS - -/* Elts, no clipping. - */ -#undef ELT -#undef TAG -#define TAG(x) fx_##x##_elts -#define ELT(x) elt[x] -#include "tnl_dd/t_dd_rendertmp.h" - -/* Verts, no clipping. - */ -#undef ELT -#undef TAG -#define TAG(x) fx_##x##_verts -#define ELT(x) x -/*#include "tnl_dd/t_dd_rendertmp.h"*/ /* we have fx_render_vb_* now */ - - - -/**********************************************************************/ -/* Render clipped primitives */ -/**********************************************************************/ - - - -static void fxRenderClippedPoly( GLcontext *ctx, const GLuint *elts, - GLuint n ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint prim = fxMesa->render_primitive; - - /* Render the new vertices as an unclipped polygon. - */ - { - GLuint *tmp = VB->Elts; - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, - PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; - } - - /* Restore the render primitive - */ - if (prim != GL_POLYGON) - tnl->Driver.Render.PrimitiveNotify( ctx, prim ); -} - - -static void fxFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts, - GLuint n ) -{ - int i; - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - GrVertex *vertptr = fxMesa->verts; - if (n == 3) { - grDrawTriangle( VERT(elts[0]), VERT(elts[1]), VERT(elts[2]) ); - } else if (n <= 32) { - GrVertex *newvptr[32]; - for (i = 0 ; i < n ; i++) { - newvptr[i] = VERT(elts[i]); - } - grDrawVertexArray(GR_TRIANGLE_FAN, n, newvptr); - } else { - const GrVertex *start = VERT(elts[0]); - for (i = 2 ; i < n ; i++) { - grDrawTriangle( start, VERT(elts[i-1]), VERT(elts[i]) ); - } - } -} - -/**********************************************************************/ -/* Choose render functions */ -/**********************************************************************/ - - -#define POINT_FALLBACK (DD_POINT_SMOOTH) -#define LINE_FALLBACK (DD_LINE_STIPPLE) -#define TRI_FALLBACK (DD_TRI_SMOOTH | DD_TRI_STIPPLE) -#define ANY_FALLBACK_FLAGS (POINT_FALLBACK | LINE_FALLBACK | TRI_FALLBACK) -#define ANY_RASTER_FLAGS (DD_FLATSHADE | DD_TRI_LIGHT_TWOSIDE | DD_TRI_OFFSET \ - | DD_TRI_UNFILLED | DD_TRI_TWOSTENCIL) - - - -void fxDDChooseRenderState(GLcontext *ctx) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint index = 0; - - if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) { - if (flags & ANY_RASTER_FLAGS) { - if (flags & DD_TRI_TWOSTENCIL) index |= FX_TWOSTENCIL_BIT; - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= FX_TWOSIDE_BIT; - if (flags & DD_TRI_OFFSET) index |= FX_OFFSET_BIT; - if (flags & DD_TRI_UNFILLED) index |= FX_UNFILLED_BIT; - if (flags & DD_FLATSHADE) index |= FX_FLAT_BIT; - } - - fxMesa->draw_point = fx_draw_point; - fxMesa->draw_line = fx_draw_line; - fxMesa->draw_tri = fx_draw_triangle; - - /* Hook in fallbacks for specific primitives. */ - if (flags & (POINT_FALLBACK| - LINE_FALLBACK| - TRI_FALLBACK)) - { - if (fxMesa->verbose) { - fprintf(stderr, "Voodoo ! fallback (%x), raster (%x)\n", - flags & ANY_FALLBACK_FLAGS, flags & ANY_RASTER_FLAGS); - } - - if (flags & POINT_FALLBACK) - fxMesa->draw_point = fx_fallback_point; - - if (flags & LINE_FALLBACK) - fxMesa->draw_line = fx_fallback_line; - - if (flags & TRI_FALLBACK) - fxMesa->draw_tri = fx_fallback_tri; - - index |= FX_FALLBACK_BIT; - } - } - - tnl->Driver.Render.Points = rast_tab[index].points; - tnl->Driver.Render.Line = rast_tab[index].line; - tnl->Driver.Render.ClippedLine = rast_tab[index].line; - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (index == 0) { - tnl->Driver.Render.PrimTabVerts = fx_render_tab_verts; - tnl->Driver.Render.PrimTabElts = fx_render_tab_elts; - tnl->Driver.Render.ClippedPolygon = fxFastRenderClippedPoly; - } else { - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ClippedPolygon = fxRenderClippedPoly; - } - - fxMesa->render_index = index; - - /* [dBorca] Hack alert: more a trick than a real plug-in!!! */ - if (flags & (DD_POINT_SIZE | DD_POINT_ATTEN)) { - /* We need to set the point primitive to go through "rast_tab", - * to make sure "POINT" calls "fxMesa->draw_point" instead of - * "grDrawPoint". We can achieve this by using FX_FALLBACK_BIT - * (not really a total rasterization fallback, so we don't alter - * "fxMesa->render_index"). If we get here with DD_POINT_SMOOTH, - * we're done, cos we've already set _tnl_render_tab_{verts|elts} - * above. Otherwise, the T&L engine can optimize point rendering - * by using fx_render_tab_{verts|elts} hence the extra work. - */ - if (flags & DD_POINT_SMOOTH) { - fxMesa->draw_point = fx_draw_point_wide_aa; - } else { - fxMesa->draw_point = fx_draw_point_wide; - fx_render_tab_verts[0] = fx_render_pw_verts; - fx_render_tab_elts[0] = fx_render_pw_elts; - } - tnl->Driver.Render.Points = rast_tab[index|FX_FALLBACK_BIT].points; - } else { - fx_render_tab_verts[0] = fx_render_vb_points; - fx_render_tab_elts[0] = fx_render_points_elts; - } -} - - -/**********************************************************************/ -/* Runtime render state and callbacks */ -/**********************************************************************/ - -static void fxRunPipeline( GLcontext *ctx ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLuint new_gl_state = fxMesa->new_gl_state; - - if (TDFX_DEBUG & VERBOSE_PIPELINE) { - fprintf(stderr, "fxRunPipeline()\n"); - } - -#if 0 - /* Recalculate fog table on projection matrix changes. This used to - * be triggered by the NearFar callback. - */ - if (new_gl_state & _NEW_PROJECTION) - fxMesa->new_state |= FX_NEW_FOG; -#endif - - if (new_gl_state & _FX_NEW_IS_IN_HARDWARE) - fxCheckIsInHardware(ctx); - - if (fxMesa->new_state) - fxSetupFXUnits(ctx); - - if (!fxMesa->fallback) { - if (new_gl_state & _FX_NEW_RENDERSTATE) - fxDDChooseRenderState(ctx); - - if (new_gl_state & _FX_NEW_SETUP_FUNCTION) - fxChooseVertexState(ctx); - } - - if (new_gl_state & _NEW_TEXTURE) { - struct gl_texture_unit *t0 = &ctx->Texture.Unit[fxMesa->tmu_source[0]]; - struct gl_texture_unit *t1 = &ctx->Texture.Unit[fxMesa->tmu_source[1]]; - - if (t0->_Current && FX_TEXTURE_DATA(t0)) { - fxMesa->s0scale = FX_TEXTURE_DATA(t0)->sScale; - fxMesa->t0scale = FX_TEXTURE_DATA(t0)->tScale; - fxMesa->inv_s0scale = 1.0F / fxMesa->s0scale; - fxMesa->inv_t0scale = 1.0F / fxMesa->t0scale; - } - - if (t1->_Current && FX_TEXTURE_DATA(t1)) { - fxMesa->s1scale = FX_TEXTURE_DATA(t1)->sScale; - fxMesa->t1scale = FX_TEXTURE_DATA(t1)->tScale; - fxMesa->inv_s1scale = 1.0F / fxMesa->s1scale; - fxMesa->inv_t1scale = 1.0F / fxMesa->t1scale; - } - } - - fxMesa->new_gl_state = 0; - - _tnl_run_pipeline( ctx ); -} - - - -/* Always called between RenderStart and RenderFinish --> We already - * hold the lock. - */ -static void fxRasterPrimitive( GLcontext *ctx, GLenum prim ) -{ - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - - fxMesa->raster_primitive = prim; - - fxSetupCull(ctx); -} - - - -/* Determine the rasterized primitive when not drawing unfilled - * polygons. - */ -static void fxRenderPrimitive( GLcontext *ctx, GLenum prim ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLuint rprim = reduced_prim[prim]; - - fxMesa->render_primitive = prim; - - if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) - return; - - if (fxMesa->raster_primitive != rprim) { - fxRasterPrimitive( ctx, rprim ); - } -} - -static void fxRenderFinish( GLcontext *ctx ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - - if (fxMesa->render_index & FX_FALLBACK_BIT) - _swrast_flush( ctx ); -} - - - -/**********************************************************************/ -/* Manage total rasterization fallbacks */ -/**********************************************************************/ - -static char *fallbackStrings[] = { - "3D/Rect/Cube Texture map", - "glDrawBuffer(GL_FRONT_AND_BACK)", - "Separate specular color", - "glEnable/Disable(GL_STENCIL_TEST)", - "glRenderMode(selection or feedback)", - "glLogicOp()", - "Texture env mode", - "Texture border", - "glColorMask", - "blend mode", - "multitex" -}; - - -static char *getFallbackString(GLuint bit) -{ - int i = 0; - while (bit > 1) { - i++; - bit >>= 1; - } - return fallbackStrings[i]; -} - - -void fxCheckIsInHardware( GLcontext *ctx ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = fxMesa->fallback; - GLuint newfallback = fxMesa->fallback = fx_check_IsInHardware( ctx ); - - if (newfallback) { - if (oldfallback == 0) { - if (fxMesa->verbose) { - fprintf(stderr, "Voodoo ! enter SW 0x%08x %s\n", newfallback, getFallbackString(newfallback)); - } - _swsetup_Wakeup( ctx ); - } - } - else { - if (oldfallback) { - _swrast_flush( ctx ); - tnl->Driver.Render.Start = fxCheckTexSizes; - tnl->Driver.Render.Finish = fxRenderFinish; - tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; - tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; - tnl->Driver.Render.BuildVertices = fxBuildVertices; - fxChooseVertexState(ctx); - fxDDChooseRenderState(ctx); - if (fxMesa->verbose) { - fprintf(stderr, "Voodoo ! leave SW 0x%08x %s\n", oldfallback, getFallbackString(oldfallback)); - } - } - tnl->Driver.Render.Multipass = NULL; - if (HAVE_SPEC && NEED_SECONDARY_COLOR(ctx)) { - tnl->Driver.Render.Multipass = fxMultipass_ColorSum; - /* obey stencil, but do not change it */ - fxMesa->multipass = GL_TRUE; - if (fxMesa->unitsState.stencilEnabled) { - fxMesa->new_state |= FX_NEW_STENCIL; - } - } - } -} - -void fxDDInitTriFuncs( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - static int firsttime = 1; - - if (firsttime) { - init_rast_tab(); - firsttime = 0; - } - - tnl->Driver.RunPipeline = fxRunPipeline; - tnl->Driver.Render.Start = fxCheckTexSizes; - tnl->Driver.Render.Finish = fxRenderFinish; - tnl->Driver.Render.PrimitiveNotify = fxRenderPrimitive; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; - tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; - tnl->Driver.Render.BuildVertices = fxBuildVertices; - tnl->Driver.Render.Multipass = NULL; - - (void) fx_print_vertex; -} - - -/* [dBorca] Hack alert: - * doesn't work with blending. - */ -static GLboolean -fxMultipass_ColorSum (GLcontext *ctx, GLuint pass) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - tfxUnitsState *us = &fxMesa->unitsState; - - static int t0 = 0; - static int t1 = 0; - - switch (pass) { - case 1: /* first pass: the TEXTURED triangles are drawn */ - /* set stencil's real values */ - fxMesa->multipass = GL_FALSE; - if (us->stencilEnabled) { - fxSetupStencil(ctx); - } - /* save per-pass data */ - fxMesa->restoreUnitsState = *us; - /* turn off texturing */ - t0 = ctx->Texture.Unit[0]._ReallyEnabled; - t1 = ctx->Texture.Unit[1]._ReallyEnabled; - ctx->Texture.Unit[0]._ReallyEnabled = 0; - ctx->Texture.Unit[1]._ReallyEnabled = 0; - /* SUM the colors */ - fxDDBlendEquationSeparate(ctx, GL_FUNC_ADD, GL_FUNC_ADD); - fxDDBlendFuncSeparate(ctx, GL_ONE, GL_ONE, GL_ZERO, GL_ONE); - fxDDEnable(ctx, GL_BLEND, GL_TRUE); - /* make sure we draw only where we want to */ - if (us->depthTestEnabled) { - switch (us->depthTestFunc) { - default: - fxDDDepthFunc(ctx, GL_EQUAL); - case GL_NEVER: - case GL_ALWAYS: - ; - } - fxDDDepthMask(ctx, GL_FALSE); - } - /* switch to secondary colors */ -#if FX_PACKEDCOLOR - grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PSPEC_OFFSET << 2, GR_PARAM_ENABLE); -#else /* !FX_PACKEDCOLOR */ - grVertexLayout(GR_PARAM_RGB, GR_VERTEX_SPEC_OFFSET << 2, GR_PARAM_ENABLE); -#endif /* !FX_PACKEDCOLOR */ - /* don't advertise new state */ - fxMesa->new_state = 0; - break; - case 2: /* 2nd pass (last): the secondary color is summed over texture */ - /* restore original state */ - *us = fxMesa->restoreUnitsState; - /* restore texturing */ - ctx->Texture.Unit[0]._ReallyEnabled = t0; - ctx->Texture.Unit[1]._ReallyEnabled = t1; - /* revert to primary colors */ -#if FX_PACKEDCOLOR - grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PARGB_OFFSET << 2, GR_PARAM_ENABLE); -#else /* !FX_PACKEDCOLOR */ - grVertexLayout(GR_PARAM_RGB, GR_VERTEX_RGB_OFFSET << 2, GR_PARAM_ENABLE); -#endif /* !FX_PACKEDCOLOR */ - break; - default: - assert(0); /* NOTREACHED */ - } - - /* update HW state */ - fxSetupBlend(ctx); - fxSetupDepthTest(ctx); - fxSetupTexture(ctx); - - return (pass == 1); -} - - -#else - - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_tris(void); -int -gl_fx_dummy_function_tris(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c deleted file mode 100644 index 64453cbe4b..0000000000 --- a/src/mesa/drivers/glide/fxvb.c +++ /dev/null @@ -1,838 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * Keith Whitwell - * Daniel Borca - */ - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#ifdef FX - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "math/m_translate.h" -#include "swrast_setup/swrast_setup.h" - -#include "tnl/tnl.h" -#include "tnl/t_context.h" - -#include "fxdrv.h" - - -static void copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - GrVertex *dst = fxMesa->verts + edst; - GrVertex *src = fxMesa->verts + esrc; - -#if FX_PACKEDCOLOR - *(GLuint *)&dst->pargb = *(GLuint *)&src->pargb; -#else /* !FX_PACKEDCOLOR */ - COPY_FLOAT(dst->r, src->r); - COPY_FLOAT(dst->g, src->g); - COPY_FLOAT(dst->b, src->b); - COPY_FLOAT(dst->a, src->a); -#endif /* !FX_PACKEDCOLOR */ -} - -static void copy_pv2( GLcontext *ctx, GLuint edst, GLuint esrc ) -{ - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - GrVertex *dst = fxMesa->verts + edst; - GrVertex *src = fxMesa->verts + esrc; - -#if FX_PACKEDCOLOR - *(GLuint *)&dst->pargb = *(GLuint *)&src->pargb; - *(GLuint *)&dst->pspec = *(GLuint *)&src->pspec; -#else /* !FX_PACKEDCOLOR */ - COPY_FLOAT(dst->r, src->r); - COPY_FLOAT(dst->g, src->g); - COPY_FLOAT(dst->b, src->b); - COPY_FLOAT(dst->a, src->a); - COPY_FLOAT(dst->r1, src->r1); - COPY_FLOAT(dst->g1, src->g1); - COPY_FLOAT(dst->b1, src->b1); -#endif /* !FX_PACKEDCOLOR */ -} - -static struct { - void (*emit) (GLcontext *ctx, GLuint start, GLuint end, void *dest); - tnl_copy_pv_func copy_pv; - tnl_interp_func interp; - GLboolean (*check_tex_sizes) (GLcontext *ctx); - GLuint vertex_format; -} setup_tab[MAX_SETUP]; - - -#define GET_COLOR(ptr, idx) ((ptr)->data[idx]) - - -static void interp_extras( GLcontext *ctx, - GLfloat t, - GLuint dst, GLuint out, GLuint in, - GLboolean force_boundary ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - if (VB->BackfaceColorPtr) { - /* If stride is zero, BackfaceColorPtr is constant across the VB, so - * there is no point interpolating between two values as they will - * be identical. This case is handled in t_dd_tritmp.h - */ - if (VB->BackfaceColorPtr->stride) { - assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat)); - INTERP_4F( t, - GET_COLOR(VB->BackfaceColorPtr, dst), - GET_COLOR(VB->BackfaceColorPtr, out), - GET_COLOR(VB->BackfaceColorPtr, in) ); - } - - if (VB->BackfaceSecondaryColorPtr) { - INTERP_3F( t, - GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), - GET_COLOR(VB->BackfaceSecondaryColorPtr, out), - GET_COLOR(VB->BackfaceSecondaryColorPtr, in) ); - } - } - - if (VB->EdgeFlag) { - VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary; - } - - setup_tab[FX_CONTEXT(ctx)->SetupIndex].interp(ctx, t, dst, out, in, - force_boundary); -} - -static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - if (VB->BackfaceColorPtr) { - COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst), - GET_COLOR(VB->BackfaceColorPtr, src) ); - - if (VB->BackfaceSecondaryColorPtr) { - COPY_3FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), - GET_COLOR(VB->BackfaceSecondaryColorPtr, src) ); - } - } - - setup_tab[FX_CONTEXT(ctx)->SetupIndex].copy_pv(ctx, dst, src); -} - - -#define IND (SETUP_XYZW|SETUP_RGBA) -#define TAG(x) x##_wg -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0) -#define TAG(x) x##_wgt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1) -#define TAG(x) x##_wgt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX) -#define TAG(x) x##_wgpt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX) -#define TAG(x) x##_wgpt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_PSIZ) -#define TAG(x) x##_wga -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ) -#define TAG(x) x##_wgt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ) -#define TAG(x) x##_wgt0t1a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_wgpt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_wgpt0t1a -#include "fxvbtmp.h" - - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC) -#define TAG(x) x##_2wg -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0) -#define TAG(x) x##_2wgt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1) -#define TAG(x) x##_2wgt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX) -#define TAG(x) x##_2wgpt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX) -#define TAG(x) x##_2wgpt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ) -#define TAG(x) x##_2wga -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ) -#define TAG(x) x##_2wgt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ) -#define TAG(x) x##_2wgt0t1a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_2wgpt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_2wgpt0t1a -#include "fxvbtmp.h" - -/* fog { */ -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_FOGC) -#define TAG(x) x##_wgf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_FOGC) -#define TAG(x) x##_wgt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|SETUP_FOGC) -#define TAG(x) x##_wgt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_wgpt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_wgpt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wgaf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wgt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wgt0t1af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wgpt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wgpt0t1af -#include "fxvbtmp.h" - - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_FOGC) -#define TAG(x) x##_2wgf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_FOGC) -#define TAG(x) x##_2wgt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|SETUP_FOGC) -#define TAG(x) x##_2wgt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_2wgpt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_2wgpt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wgaf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wgt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wgt0t1af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wgpt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1|\ - SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wgpt0t1af -#include "fxvbtmp.h" -/* fog } */ - - -/* Snapping for voodoo-1 - */ -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA) -#define TAG(x) x##_wsg -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0) -#define TAG(x) x##_wsgt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1) -#define TAG(x) x##_wsgt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_PTEX) -#define TAG(x) x##_wsgpt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX) -#define TAG(x) x##_wsgpt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_PSIZ) -#define TAG(x) x##_wsga -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ) -#define TAG(x) x##_wsgt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PSIZ) -#define TAG(x) x##_wsgt0t1a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_wsgpt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_wsgpt0t1a -#include "fxvbtmp.h" - - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC) -#define TAG(x) x##_2wsg -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0) -#define TAG(x) x##_2wsgt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1) -#define TAG(x) x##_2wsgt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_PTEX) -#define TAG(x) x##_2wsgpt0 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX) -#define TAG(x) x##_2wsgpt0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ) -#define TAG(x) x##_2wsga -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ) -#define TAG(x) x##_2wsgt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PSIZ) -#define TAG(x) x##_2wsgt0t1a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_2wsgpt0a -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ) -#define TAG(x) x##_2wsgpt0t1a -#include "fxvbtmp.h" - -/* fog { */ -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_FOGC) -#define TAG(x) x##_wsgf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|SETUP_FOGC) -#define TAG(x) x##_wsgt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1|SETUP_FOGC) -#define TAG(x) x##_wsgt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_wsgpt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_wsgpt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wsgaf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wsgt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wsgt0t1af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wsgpt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_wsgpt0t1af -#include "fxvbtmp.h" - - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_FOGC) -#define TAG(x) x##_2wsgf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_FOGC) -#define TAG(x) x##_2wsgt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1|SETUP_FOGC) -#define TAG(x) x##_2wsgt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_2wsgpt0f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX|SETUP_FOGC) -#define TAG(x) x##_2wsgpt0t1f -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wsgaf -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wsgt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wsgt0t1af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wsgpt0af -#include "fxvbtmp.h" - -#define IND (SETUP_XYZW|SETUP_SNAP|SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|\ - SETUP_TMU1|SETUP_PTEX|SETUP_PSIZ|SETUP_FOGC) -#define TAG(x) x##_2wsgpt0t1af -#include "fxvbtmp.h" -/* fog } */ - - -/* Vertex repair (multipass rendering) - */ -#define IND (SETUP_RGBA) -#define TAG(x) x##_g -#include "fxvbtmp.h" - -#define IND (SETUP_TMU0) -#define TAG(x) x##_t0 -#include "fxvbtmp.h" - -#define IND (SETUP_TMU0|SETUP_TMU1) -#define TAG(x) x##_t0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_RGBA|SETUP_TMU0) -#define TAG(x) x##_gt0 -#include "fxvbtmp.h" - -#define IND (SETUP_RGBA|SETUP_TMU0|SETUP_TMU1) -#define TAG(x) x##_gt0t1 -#include "fxvbtmp.h" - - -#define IND (SETUP_RGBA|SETUP_SPEC) -#define TAG(x) x##_2g -#include "fxvbtmp.h" - -#define IND (SETUP_TMU0|SETUP_SPEC) -#define TAG(x) x##_2t0 -#include "fxvbtmp.h" - -#define IND (SETUP_TMU0|SETUP_SPEC|SETUP_TMU1) -#define TAG(x) x##_2t0t1 -#include "fxvbtmp.h" - -#define IND (SETUP_RGBA|SETUP_SPEC|SETUP_TMU0) -#define TAG(x) x##_2gt0 -#include "fxvbtmp.h" - -#define IND (SETUP_RGBA|SETUP_SPEC|SETUP_TMU0|SETUP_TMU1) -#define TAG(x) x##_2gt0t1 -#include "fxvbtmp.h" - - - -static void init_setup_tab( void ) -{ - init_wg(); - init_wgt0(); - init_wgt0t1(); - init_wgpt0(); - init_wgpt0t1(); - init_wga(); - init_wgt0a(); - init_wgt0t1a(); - init_wgpt0a(); - init_wgpt0t1a(); - init_2wg(); - init_2wgt0(); - init_2wgt0t1(); - init_2wgpt0(); - init_2wgpt0t1(); - init_2wga(); - init_2wgt0a(); - init_2wgt0t1a(); - init_2wgpt0a(); - init_2wgpt0t1a(); - init_wgf(); - init_wgt0f(); - init_wgt0t1f(); - init_wgpt0f(); - init_wgpt0t1f(); - init_wgaf(); - init_wgt0af(); - init_wgt0t1af(); - init_wgpt0af(); - init_wgpt0t1af(); - init_2wgf(); - init_2wgt0f(); - init_2wgt0t1f(); - init_2wgpt0f(); - init_2wgpt0t1f(); - init_2wgaf(); - init_2wgt0af(); - init_2wgt0t1af(); - init_2wgpt0af(); - init_2wgpt0t1af(); - - init_wsg(); - init_wsgt0(); - init_wsgt0t1(); - init_wsgpt0(); - init_wsgpt0t1(); - init_wsga(); - init_wsgt0a(); - init_wsgt0t1a(); - init_wsgpt0a(); - init_wsgpt0t1a(); - init_2wsg(); - init_2wsgt0(); - init_2wsgt0t1(); - init_2wsgpt0(); - init_2wsgpt0t1(); - init_2wsga(); - init_2wsgt0a(); - init_2wsgt0t1a(); - init_2wsgpt0a(); - init_2wsgpt0t1a(); - init_wsgf(); - init_wsgt0f(); - init_wsgt0t1f(); - init_wsgpt0f(); - init_wsgpt0t1f(); - init_wsgaf(); - init_wsgt0af(); - init_wsgt0t1af(); - init_wsgpt0af(); - init_wsgpt0t1af(); - init_2wsgf(); - init_2wsgt0f(); - init_2wsgt0t1f(); - init_2wsgpt0f(); - init_2wsgpt0t1f(); - init_2wsgaf(); - init_2wsgt0af(); - init_2wsgt0t1af(); - init_2wsgpt0af(); - init_2wsgpt0t1af(); - - init_g(); - init_t0(); - init_t0t1(); - init_gt0(); - init_gt0t1(); - init_2g(); - init_2t0(); - init_2t0t1(); - init_2gt0(); - init_2gt0t1(); -} - - -void fxPrintSetupFlags(char *msg, GLuint flags ) -{ - fprintf(stderr, "%s(%x): %s%s%s%s%s%s%s%s\n", - msg, - (int)flags, - (flags & SETUP_XYZW) ? " xyzw," : "", - (flags & SETUP_SNAP) ? " snap," : "", - (flags & SETUP_RGBA) ? " rgba," : "", - (flags & SETUP_TMU0) ? " tex-0," : "", - (flags & SETUP_TMU1) ? " tex-1," : "", - (flags & SETUP_PSIZ) ? " psiz," : "", - (flags & SETUP_SPEC) ? " spec," : "", - (flags & SETUP_FOGC) ? " fog," : ""); -} - - - -void fxCheckTexSizes( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - - if (!setup_tab[fxMesa->SetupIndex].check_tex_sizes(ctx)) { - GLuint ind = fxMesa->SetupIndex |= (SETUP_PTEX|SETUP_RGBA); - - /* Tdfx handles projective textures nicely; just have to change - * up to the new vertex format. - */ - if (setup_tab[ind].vertex_format != fxMesa->stw_hint_state) { - - fxMesa->stw_hint_state = setup_tab[ind].vertex_format; - FX_grHints(GR_HINT_STWHINT, fxMesa->stw_hint_state); - - /* This is required as we have just changed the vertex - * format, so the interp routines must also change. - * In the unfilled and twosided cases we are using the - * Extras ones anyway, so leave them in place. - */ - if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - tnl->Driver.Render.Interp = setup_tab[fxMesa->SetupIndex].interp; - } - } - } -} - - -void fxBuildVertices( GLcontext *ctx, GLuint start, GLuint end, - GLuint newinputs ) -{ - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - GrVertex *v = (fxMesa->verts + start); - - if (!newinputs) - return; - - if (newinputs & VERT_BIT_POS) { - setup_tab[fxMesa->SetupIndex].emit( ctx, start, end, v ); - } else { - GLuint ind = 0; - - if (newinputs & VERT_BIT_COLOR0) - ind |= SETUP_RGBA; - - if (newinputs & VERT_BIT_COLOR1) - ind |= SETUP_SPEC; - - if (newinputs & VERT_BIT_FOG) - ind |= SETUP_FOGC; - - if (newinputs & VERT_BIT_TEX0) - ind |= SETUP_TMU0; - - if (newinputs & VERT_BIT_TEX1) - ind |= SETUP_TMU0|SETUP_TMU1; - - if (fxMesa->SetupIndex & SETUP_PTEX) - ind = ~0; - - ind &= fxMesa->SetupIndex; - - if (ind) { - setup_tab[ind].emit( ctx, start, end, v ); - } - } -} - - -void fxChooseVertexState( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - GLuint ind = SETUP_XYZW|SETUP_RGBA; - - if (fxMesa->snapVertices) - ind |= SETUP_SNAP; - - fxMesa->tmu_source[0] = 0; - fxMesa->tmu_source[1] = 1; - - if (ctx->Texture._EnabledUnits & 0x2) { - if (ctx->Texture._EnabledUnits & 0x1) { - ind |= SETUP_TMU1; - } - ind |= SETUP_TMU0; - fxMesa->tmu_source[0] = 1; - fxMesa->tmu_source[1] = 0; - } - else if (ctx->Texture._EnabledUnits & 0x1) { - ind |= SETUP_TMU0; - } - - if (ctx->_TriangleCaps & DD_POINT_ATTEN) { - ind |= SETUP_PSIZ; - } - - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { - ind |= SETUP_SPEC; - } - - if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT) { - ind |= SETUP_FOGC; - } - - fxMesa->SetupIndex = ind; - - if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { - tnl->Driver.Render.Interp = interp_extras; - tnl->Driver.Render.CopyPV = copy_pv_extras; - } else { - tnl->Driver.Render.Interp = setup_tab[ind].interp; - tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv; - } - - if (setup_tab[ind].vertex_format != fxMesa->stw_hint_state) { - fxMesa->stw_hint_state = setup_tab[ind].vertex_format; - FX_grHints(GR_HINT_STWHINT, fxMesa->stw_hint_state); - } -} - - - -void fxAllocVB( GLcontext *ctx ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - GLuint size = TNL_CONTEXT(ctx)->vb.Size; - static int firsttime = 1; - if (firsttime) { - init_setup_tab(); - firsttime = 0; - } - - fxMesa->verts = (GrVertex *)_mesa_align_malloc(size * sizeof(GrVertex), 32); - fxMesa->SetupIndex = SETUP_XYZW|SETUP_RGBA; -} - - -void fxFreeVB( GLcontext *ctx ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - if (fxMesa->verts) { - _mesa_align_free(fxMesa->verts); - fxMesa->verts = 0; - } -} -#else - - -/* - * Need this to provide at least one external definition. - */ - -extern int gl_fx_dummy_function_vb(void); -int -gl_fx_dummy_function_vb(void) -{ - return 0; -} - -#endif /* FX */ diff --git a/src/mesa/drivers/glide/fxvbtmp.h b/src/mesa/drivers/glide/fxvbtmp.h deleted file mode 100644 index f7893c1573..0000000000 --- a/src/mesa/drivers/glide/fxvbtmp.h +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * Keith Whitwell - * Daniel Borca - */ - - -#define VIEWPORT_X(dst,x) dst = s[0] * x + s[12] -#define VIEWPORT_Y(dst,y) dst = s[5] * y + s[13] -#define VIEWPORT_Z(dst,z) dst = s[10] * z + s[14] - -static void TAG(emit)( GLcontext *ctx, - GLuint start, GLuint end, - void *dest ) -{ - fxMesaContext fxMesa = FX_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLuint tmu0_source = fxMesa->tmu_source[0]; - GLuint tmu1_source = fxMesa->tmu_source[1]; - GLfloat (*tc0)[4], (*tc1)[4]; - GLfloat (*col)[4], (*spec)[4]; - GLuint tc0_stride, tc1_stride, col_stride, spec_stride; - GLuint tc0_size, tc1_size, col_size; - GLfloat (*proj)[4] = VB->NdcPtr->data; - GLuint proj_stride = VB->NdcPtr->stride; - GLfloat (*psize)[4]; - GLuint psize_stride; - GLfloat (*fog)[4]; - GLuint fog_stride; - GrVertex *v = (GrVertex *)dest; - GLfloat u0scale,v0scale,u1scale,v1scale; - const GLubyte *mask = VB->ClipMask; - const GLfloat *const s = ctx->Viewport._WindowMap.m; - int i; - - if (IND & SETUP_PSIZ) { - psize = VB->PointSizePtr->data; - psize_stride = VB->PointSizePtr->stride; - } - - if (IND & SETUP_TMU0) { - tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->data; - tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->stride; - u0scale = fxMesa->s0scale; - v0scale = fxMesa->t0scale; - if (IND & SETUP_PTEX) - tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->size; - } - - if (IND & SETUP_TMU1) { - tc1 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->data; - tc1_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->stride; - u1scale = fxMesa->s1scale; /* wrong if tmu1_source == 0, possible? */ - v1scale = fxMesa->t1scale; - if (IND & SETUP_PTEX) - tc1_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->size; - } - - if (IND & SETUP_RGBA) { - col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; - col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; - col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size; - } - - if (IND & SETUP_SPEC) { - spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data; - spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride; - } - - if (IND & SETUP_FOGC) { - fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; - fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; - } - - if (start) { - proj = (GLfloat (*)[4])((GLubyte *)proj + start * proj_stride); - if (IND & SETUP_PSIZ) - psize = (GLfloat (*)[4])((GLubyte *)psize + start * psize_stride); - if (IND & SETUP_TMU0) - tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + start * tc0_stride); - if (IND & SETUP_TMU1) - tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + start * tc1_stride); - if (IND & SETUP_RGBA) - STRIDE_4F(col, start * col_stride); - if (IND & SETUP_SPEC) - STRIDE_4F(spec, start * spec_stride); - if (IND & SETUP_FOGC) - fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride); - } - - for (i=start; i < end; i++, v++) { - if (IND & SETUP_PSIZ) { - v->psize = psize[0][0]; - psize = (GLfloat (*)[4])((GLubyte *)psize + psize_stride); - } - - if (IND & SETUP_XYZW) { - if (mask[i] == 0) { - /* unclipped */ - VIEWPORT_X(v->x, proj[0][0]); - VIEWPORT_Y(v->y, proj[0][1]); - VIEWPORT_Z(v->ooz, proj[0][2]); - v->oow = proj[0][3]; - - if (IND & SETUP_SNAP) { -#if defined(USE_IEEE) - const float snapper = (3L << 18); - v->x += snapper; - v->x -= snapper; - v->y += snapper; - v->y -= snapper; -#else - v->x = ((int) (v->x * 16.0f)) * (1.0f / 16.0f); - v->y = ((int) (v->y * 16.0f)) * (1.0f / 16.0f); -#endif - } - } else { - /* clipped */ - v->oow = 1.0; - } - - proj = (GLfloat (*)[4])((GLubyte *)proj + proj_stride); - } - if (IND & SETUP_RGBA) { -#if FX_PACKEDCOLOR - UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[2], col[0][0]); - UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[1], col[0][1]); - UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[0], col[0][2]); - if (col_size == 4) { - UNCLAMPED_FLOAT_TO_UBYTE(v->pargb[3], col[0][3]); - } else { - v->pargb[3] = 255; - } -#else /* !FX_PACKEDCOLOR */ - CNORM(v->r, col[0][0]); - CNORM(v->g, col[0][1]); - CNORM(v->b, col[0][2]); - if (col_size == 4) { - CNORM(v->a, col[0][3]); - } else { - v->a = 255.0f; - } -#endif /* !FX_PACKEDCOLOR */ - STRIDE_4F(col, col_stride); - } - if (IND & SETUP_SPEC) { -#if FX_PACKEDCOLOR - UNCLAMPED_FLOAT_TO_UBYTE(v->pspec[2], spec[0][0]); - UNCLAMPED_FLOAT_TO_UBYTE(v->pspec[1], spec[0][1]); - UNCLAMPED_FLOAT_TO_UBYTE(v->pspec[0], spec[0][2]); -#else /* !FX_PACKEDCOLOR */ - CNORM(v->r1, spec[0][0]); - CNORM(v->g1, spec[0][1]); - CNORM(v->b1, spec[0][2]); -#endif /* !FX_PACKEDCOLOR */ - STRIDE_4F(spec, spec_stride); - } - if (IND & SETUP_FOGC) { - v->fog = CLAMP(fog[0][0], 0.0f, 1.0f); - fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride); - } - if (IND & SETUP_TMU0) { - GLfloat w = v->oow; - v->tmuvtx[0].sow = tc0[0][0] * u0scale * w; - v->tmuvtx[0].tow = tc0[0][1] * v0scale * w; - if (IND & SETUP_PTEX) { - v->tmuvtx[0].oow = w; - if (tc0_size == 4) - v->tmuvtx[0].oow *= tc0[0][3]; - } - tc0 = (GLfloat (*)[4])((GLubyte *)tc0 + tc0_stride); - } - if (IND & SETUP_TMU1) { - GLfloat w = v->oow; - v->tmuvtx[1].sow = tc1[0][0] * u1scale * w; - v->tmuvtx[1].tow = tc1[0][1] * v1scale * w; - if (IND & SETUP_PTEX) { - v->tmuvtx[1].oow = w; - if (tc1_size == 4) - v->tmuvtx[1].oow *= tc1[0][3]; - } - tc1 = (GLfloat (*)[4])((GLubyte *)tc1 + tc1_stride); - } - } -} - -#if (IND & SETUP_XYZW) && (IND & SETUP_RGBA) - -static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) -{ -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - if (IND & SETUP_PTEX) - return GL_TRUE; - - if (IND & SETUP_TMU0) { - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - - if (IND & SETUP_TMU1) { - if (VB->AttribPtr[_TNL_ATTRIB_TEX0] == 0) - VB->AttribPtr[_TNL_ATTRIB_TEX0] = VB->AttribPtr[_TNL_ATTRIB_TEX1]; - - if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) - return GL_FALSE; - } - - if (VB->AttribPtr[_TNL_ATTRIB_TEX0] && - VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) - return GL_FALSE; - } - - return GL_TRUE; -} - -static void TAG(interp)( GLcontext *ctx, - GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary ) -{ - fxMesaContext fxMesa = FX_CONTEXT( ctx ); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - const GLfloat *dstclip = VB->ClipPtr->data[edst]; - const GLfloat oow = (dstclip[3] == 0.0F) ? 1.0F : (1.0F / dstclip[3]); - const GLfloat *const s = ctx->Viewport._WindowMap.m; - GrVertex *fxverts = fxMesa->verts; - GrVertex *dst = (GrVertex *) (fxverts + edst); - const GrVertex *out = (const GrVertex *) (fxverts + eout); - const GrVertex *in = (const GrVertex *) (fxverts + ein); - const GLfloat wout = oow / out->oow; - const GLfloat win = oow / in->oow; - - VIEWPORT_X(dst->x, dstclip[0] * oow); - VIEWPORT_Y(dst->y, dstclip[1] * oow); - VIEWPORT_Z(dst->ooz, dstclip[2] * oow); - dst->oow = oow; - - if (IND & SETUP_SNAP) { -#if defined(USE_IEEE) - const float snapper = (3L << 18); - dst->x += snapper; - dst->x -= snapper; - dst->y += snapper; - dst->y -= snapper; -#else - dst->x = ((int) (dst->x * 16.0f)) * (1.0f / 16.0f); - dst->y = ((int) (dst->y * 16.0f)) * (1.0f / 16.0f); -#endif - } - - -#if FX_PACKEDCOLOR - INTERP_UB( t, dst->pargb[0], out->pargb[0], in->pargb[0] ); - INTERP_UB( t, dst->pargb[1], out->pargb[1], in->pargb[1] ); - INTERP_UB( t, dst->pargb[2], out->pargb[2], in->pargb[2] ); - INTERP_UB( t, dst->pargb[3], out->pargb[3], in->pargb[3] ); -#else /* !FX_PACKEDCOLOR */ - INTERP_F( t, dst->r, out->r, in->r ); - INTERP_F( t, dst->g, out->g, in->g ); - INTERP_F( t, dst->b, out->b, in->b ); - INTERP_F( t, dst->a, out->a, in->a ); -#endif /* !FX_PACKEDCOLOR */ - - if (IND & SETUP_SPEC) { -#if FX_PACKEDCOLOR - INTERP_UB( t, dst->pspec[0], out->pspec[0], in->pspec[0] ); - INTERP_UB( t, dst->pspec[1], out->pspec[1], in->pspec[1] ); - INTERP_UB( t, dst->pspec[2], out->pspec[2], in->pspec[2] ); -#else /* !FX_PACKEDCOLOR */ - INTERP_F( t, dst->r1, out->r1, in->r1 ); - INTERP_F( t, dst->g1, out->g1, in->g1 ); - INTERP_F( t, dst->b1, out->b1, in->b1 ); -#endif /* !FX_PACKEDCOLOR */ - } - - if (IND & SETUP_FOGC) { - INTERP_F( t, dst->fog, out->fog, in->fog ); - } - - if (IND & SETUP_TMU0) { - INTERP_F( t, - dst->tmuvtx[0].sow, - out->tmuvtx[0].sow * wout, - in->tmuvtx[0].sow * win ); - INTERP_F( t, - dst->tmuvtx[0].tow, - out->tmuvtx[0].tow * wout, - in->tmuvtx[0].tow * win ); - if (IND & SETUP_PTEX) { - INTERP_F( t, - dst->tmuvtx[0].oow, - out->tmuvtx[0].oow * wout, - in->tmuvtx[0].oow * win ); - } - } - - if (IND & SETUP_TMU1) { - INTERP_F( t, - dst->tmuvtx[1].sow, - out->tmuvtx[1].sow * wout, - in->tmuvtx[1].sow * win ); - INTERP_F( t, - dst->tmuvtx[1].tow, - out->tmuvtx[1].tow * wout, - in->tmuvtx[1].tow * win ); - if (IND & SETUP_PTEX) { - INTERP_F( t, - dst->tmuvtx[1].oow, - out->tmuvtx[1].oow * wout, - in->tmuvtx[1].oow * win ); - } - } -} -#endif - - -static void TAG(init)( void ) -{ - setup_tab[IND].emit = TAG(emit); - - if (IND & SETUP_SPEC) { - setup_tab[IND].copy_pv = copy_pv2; - } else { - setup_tab[IND].copy_pv = copy_pv; - } - -#if ((IND & SETUP_XYZW) && (IND & SETUP_RGBA)) - setup_tab[IND].check_tex_sizes = TAG(check_tex_sizes); - setup_tab[IND].interp = TAG(interp); - - setup_tab[IND].vertex_format = 0; - if (IND & SETUP_PTEX) { - setup_tab[IND].vertex_format |= GR_STWHINT_W_DIFF_TMU0; - } - -#if (IND & SETUP_TMU1) - setup_tab[IND].vertex_format |= GR_STWHINT_ST_DIFF_TMU1; - if (IND & SETUP_PTEX) { - setup_tab[IND].vertex_format |= GR_STWHINT_W_DIFF_TMU1; - } -#endif - -#endif -} - - -#undef IND -#undef TAG -- cgit v1.2.3 From 40c6bb58be4bc2be3c4901fe8b945d2a12983af6 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 16:10:09 -0500 Subject: Drop classic mesa svga driver --- Makefile | 2 - include/GL/svgamesa.h | 97 ------- src/mesa/drivers/svga/svgamesa.c | 516 ------------------------------------- src/mesa/drivers/svga/svgamesa15.c | 220 ---------------- src/mesa/drivers/svga/svgamesa15.h | 42 --- src/mesa/drivers/svga/svgamesa16.c | 218 ---------------- src/mesa/drivers/svga/svgamesa16.h | 43 ---- src/mesa/drivers/svga/svgamesa24.c | 242 ----------------- src/mesa/drivers/svga/svgamesa24.h | 43 ---- src/mesa/drivers/svga/svgamesa32.c | 223 ---------------- src/mesa/drivers/svga/svgamesa32.h | 43 ---- src/mesa/drivers/svga/svgamesa8.c | 196 -------------- src/mesa/drivers/svga/svgamesa8.h | 43 ---- src/mesa/drivers/svga/svgapix.h | 70 ----- 14 files changed, 1998 deletions(-) delete mode 100644 include/GL/svgamesa.h delete mode 100644 src/mesa/drivers/svga/svgamesa.c delete mode 100644 src/mesa/drivers/svga/svgamesa15.c delete mode 100644 src/mesa/drivers/svga/svgamesa15.h delete mode 100644 src/mesa/drivers/svga/svgamesa16.c delete mode 100644 src/mesa/drivers/svga/svgamesa16.h delete mode 100644 src/mesa/drivers/svga/svgamesa24.c delete mode 100644 src/mesa/drivers/svga/svgamesa24.h delete mode 100644 src/mesa/drivers/svga/svgamesa32.c delete mode 100644 src/mesa/drivers/svga/svgamesa32.h delete mode 100644 src/mesa/drivers/svga/svgamesa8.c delete mode 100644 src/mesa/drivers/svga/svgamesa8.h delete mode 100644 src/mesa/drivers/svga/svgapix.h (limited to 'src') diff --git a/Makefile b/Makefile index f2ec3bf20f..0e70ef5d97 100644 --- a/Makefile +++ b/Makefile @@ -221,7 +221,6 @@ MAIN_FILES = \ $(DIRECTORY)/include/GL/mesa_wgl.h \ $(DIRECTORY)/include/GL/mglmesa.h \ $(DIRECTORY)/include/GL/osmesa.h \ - $(DIRECTORY)/include/GL/svgamesa.h \ $(DIRECTORY)/include/GL/vms_x_fix.h \ $(DIRECTORY)/include/GL/wglext.h \ $(DIRECTORY)/include/GL/wmesa.h \ @@ -274,7 +273,6 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \ $(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \ $(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \ - $(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \ $(DIRECTORY)/src/mesa/drivers/windows/*/*.def \ $(DIRECTORY)/src/mesa/drivers/x11/Makefile \ diff --git a/include/GL/svgamesa.h b/include/GL/svgamesa.h deleted file mode 100644 index 67c0e4c5c6..0000000000 --- a/include/GL/svgamesa.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * Copyright (C) 1995-2001 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA/Mesa interface for Linux. - */ - - -/* - * Intro to using the VGA/Mesa interface - * - * 1. #include the file - * 2. Call vga_init() to initialize the SVGA library. - * 3. Call vga_setmode() to specify the screen size and color depth. - * 4. Call SVGAMesaCreateContext() to setup a Mesa context. If using 8-bit - * color Mesa assumes color index mode, if using 16-bit or deeper color - * Mesa assumes RGB mode. - * 5. Call SVGAMesaMakeCurrent() to activate the Mesa context. - * 6. You can now use the Mesa API functions. - * 7. Before exiting, call SVGAMesaDestroyContext() then vga_setmode(TEXT) - * to restore the original text screen. - * - * Notes - * 1. You must run your executable as root (or use the set UID-bit) because - * the SVGA library requires it. - * 2. The SVGA driver is not fully implemented yet. See svgamesa.c for what - * has to be done yet. - */ - - -#ifndef SVGAMESA_H -#define SVGAMESA_H - - -#define SVGAMESA_MAJOR_VERSION 4 -#define SVGAMESA_MINOR_VERSION 0 - - -#ifdef __cplusplus -extern "C" { -#endif - - -#include "GL/gl.h" - - - -/* - * This is the SVGAMesa context 'handle': - */ -typedef struct svgamesa_context *SVGAMesaContext; - - - -/* - * doubleBuffer flag new in version 2.4 - */ -extern int SVGAMesaInit( int GraphMode ); - -extern int SVGAMesaClose( void ); - -extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ); - -extern void SVGAMesaDestroyContext( SVGAMesaContext ctx ); - -extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx ); - -extern void SVGAMesaSwapBuffers( void ); - -extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue); - -extern SVGAMesaContext SVGAMesaGetCurrentContext( void ); - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c deleted file mode 100644 index 5afa8e188b..0000000000 --- a/src/mesa/drivers/svga/svgamesa.c +++ /dev/null @@ -1,516 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#ifdef SVGA - -#include -#include -#include -#include -#include "GL/svgamesa.h" -#include "main/buffers.h" -#include "main/context.h" -#include "main/extensions.h" -#include "main/imports.h" -#include "main/matrix.h" -#include "main/mtypes.h" -#include "swrast/swrast.h" -#include "svgapix.h" -#include "svgamesa8.h" -#include "svgamesa15.h" -#include "svgamesa16.h" -#include "svgamesa24.h" -#include "svgamesa32.h" - -struct svga_buffer SVGABuffer; -vga_modeinfo * SVGAInfo; -SVGAMesaContext SVGAMesa; /* the current context */ - -#ifdef SVGA_DEBUG - -#include -#include - -FILE * logfile; -char cbuf[1024]={0}; - -void SVGAlog(char * what) -{ - logfile=fopen("svgamesa.log","a"); - if (!logfile) return; - fprintf(logfile,"%s\n",what); - fclose(logfile); -} -#endif - -/**********************************************************************/ -/***** Init stuff... *****/ -/**********************************************************************/ - -int SVGAMesaInit( int GraphMode ) -{ - vga_init(); - if (!vga_hasmode(GraphMode)) - { - fprintf(stderr,"GraphMode %d unavailable...",GraphMode); -#ifdef SVGA_DEBUG - SVGAlog("SVGAMesaInit: invalid GraphMode (doesn't exist)"); -#endif - return(1); - } - SVGAInfo=vga_getmodeinfo(GraphMode); - if (SVGAInfo->flags & IS_MODEX) - { - fprintf(stderr,"ModeX not implemented..."); -#ifdef SVGA_DEBUG - SVGAlog("SVGAMesaInit: invalid GraphMode (ModeX)"); -#endif - return(2); - } - if (!SVGAInfo->bytesperpixel) - { - fprintf(stderr,"1 / 4 bit color not implemented..."); -#ifdef SVGA_DEBUG - SVGAlog("SVGAMesaInit: invalid GraphMode (1 or 4 bit)"); -#endif - return(3); - } - switch (SVGAInfo->colors) { - case 256: SVGABuffer.Depth = 8; break; - case 32768: SVGABuffer.Depth = 15; break; - case 65536: SVGABuffer.Depth = 16; break; - default: SVGABuffer.Depth = SVGAInfo->bytesperpixel<<3; break; - } - SVGABuffer.BufferSize=SVGAInfo->linewidth*SVGAInfo->height; -#ifdef SVGA_DEBUG - sprintf(cbuf,"SVGAMesaInit: double buffer info.\n" \ - " depth : %d\n" \ - " mode : %d\n" \ - " width : %d\n" \ - " height : %d\n" \ - " bufsize: %d\n", \ - SVGABuffer.Depth,GraphMode,SVGAInfo->linewidth, \ - SVGAInfo->height,SVGABuffer.BufferSize); - SVGAlog(cbuf); -#endif - SVGABuffer.FrontBuffer=(void*)malloc(SVGABuffer.BufferSize + 4); - if (!SVGABuffer.FrontBuffer) { - { - fprintf(stderr,"Not enough RAM for FRONT_LEFT_BUFFER..."); -#ifdef SVGA_DEBUG - SVGAlog("SVGAMesaInit: Not enough RAM (front buffer)"); -#endif - return(4); - } - } -#ifdef SVGA_DEBUG - sprintf(cbuf,"SVGAMesaInit: FrontBuffer - %p",SVGABuffer.FrontBuffer); - SVGAlog(cbuf); -#endif - SVGABuffer.BackBuffer=(void*)malloc(SVGABuffer.BufferSize + 4); - if (!SVGABuffer.BackBuffer) { - { - free(SVGABuffer.FrontBuffer); - fprintf(stderr,"Not enough RAM for BACK_LEFT_BUFFER..."); -#ifdef SVGA_DEBUG - SVGAlog("SVGAMesaInit: Not enough RAM (back buffer)"); -#endif - return(5); - } - } -#ifdef SVGA_DEBUG - sprintf(cbuf,"SVGAMesaInit: BackBuffer - %p",SVGABuffer.BackBuffer); - SVGAlog(cbuf); -#endif - - vga_setmode(GraphMode); - SVGABuffer.VideoRam=vga_getgraphmem(); -#ifdef SVGA_DEBUG - sprintf(cbuf,"SVGAMesaInit: VRAM - %p",SVGABuffer.VideoRam); - SVGAlog(cbuf); - sprintf(cbuf,"SVGAMesaInit: done. (Mode %d)",GraphMode); - SVGAlog(cbuf); -#endif - - SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer; - SVGABuffer.ReadBuffer = SVGABuffer.BackBuffer; - - return 0; -} - -int SVGAMesaClose( void ) -{ - vga_setmode(TEXT); - free(SVGABuffer.FrontBuffer); - free(SVGABuffer.BackBuffer); - return 0; -} - -void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue) -{ - if (ndx<256) - vga_setpalette(ndx, red>>2, green>>2, blue>>2); -} - -/**********************************************************************/ -/***** Miscellaneous functions *****/ -/**********************************************************************/ - -static void copy_buffer( const GLubyte * buffer) { - int size = SVGABuffer.BufferSize, page = 0; - -#ifdef SVGA_DEBUG - sprintf(cbuf,"copy_buffer: copy %p to %p",buffer,SVGABuffer.VideoRam); - SVGAlog(cbuf); -#endif - - while(size>0) { - vga_setpage(page++); - if (size>>16) { - memcpy(SVGABuffer.VideoRam,buffer,0x10000); - buffer+=0x10000; - }else{ - memcpy(SVGABuffer.VideoRam,buffer,size & 0xffff); - } - size-=0xffff; - } -} - -static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) -{ - *width = SVGAMesa->width = vga_getxdim(); - *height = SVGAMesa->height = vga_getydim(); -} - -/** - * We only implement this function as a mechanism to check if the - * framebuffer size has changed (and update corresponding state). - */ -static void viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - GLuint newWidth, newHeight; - GLframebuffer *buffer = ctx->WinSysDrawBuffer; - get_buffer_size( buffer, &newWidth, &newHeight ); - if (buffer->Width != newWidth || buffer->Height != newHeight) { - _mesa_resize_framebuffer(ctx, buffer, newWidth, newHeight ); - } -} - -static void set_buffer( GLcontext *ctx, GLframebuffer *colorBuffer, - GLenum buffer ) -{ - /* We can ignore colorBuffer since we don't support a MakeCurrentRead() - * function. - */ - (void) colorBuffer; - - if (buffer == GL_FRONT_LEFT) { - SVGABuffer.ReadBuffer = SVGABuffer.FrontBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer; -#if 0 - void * tmpptr; - /* vga_waitretrace(); */ - copy_buffer(SVGABuffer.FrontBuffer); - tmpptr=SVGABuffer.BackBuffer; - SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer; - SVGABuffer.FrontBuffer=tmpptr; -#endif - } - else if (buffer == GL_BACK_LEFT) { - SVGABuffer.ReadBuffer = SVGABuffer.BackBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer; -#if 0 - /* vga_waitretrace(); */ - copy_buffer(SVGABuffer.BackBuffer); -#endif - } -} - -/**********************************************************************/ -/***** *****/ -/**********************************************************************/ - -static void svgamesa_update_state( GLcontext *ctx, GLuint new_state ) -{ - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); - - /* Initialize all the pointers in the DD struct. Do this whenever */ - /* a new context is made current or we change buffers via set_buffer! */ - - ctx->Driver.UpdateState = svgamesa_update_state; - - ctx->Driver.GetBufferSize = get_buffer_size; - ctx->Driver.Viewport = viewport; - - /* Fill in the swrast driver interface: - */ - swdd->SetBuffer = set_buffer; - - switch (SVGABuffer.Depth) { - case 8: ctx->Driver.ClearIndex = __clear_index8; - ctx->Driver.Clear = __clear8; - - swdd->ReadCI32Span = __read_ci32_span8; - swdd->ReadCI32Pixels = __read_ci32_pixels8; - swdd->WriteCI8Span = __write_ci8_span8; - swdd->WriteCI32Span = __write_ci32_span8; - swdd->WriteCI32Pixels = __write_ci32_pixels8; - swdd->WriteMonoCISpan = __write_mono_ci_span8; - swdd->WriteMonoCIPixels = __write_mono_ci_pixels8; -#ifdef SVGA_DEBUG - SVGAlog("SVGAUpdateState: 8 bit mode."); -#endif - - break; - case 15: ctx->Driver.ClearColor = __clear_color15; - ctx->Driver.Clear = __clear15; - - swdd->ReadRGBASpan = __read_rgba_span15; - swdd->ReadRGBAPixels = __read_rgba_pixels15; - swdd->WriteRGBASpan = __write_rgba_span15; - swdd->WriteRGBAPixels = __write_rgba_pixels15; - swdd->WriteMonoRGBASpan = __write_mono_rgba_span15; - swdd->WriteMonoRGBAPixels = __write_mono_rgba_pixels15; -#ifdef SVGA_DEBUG - SVGAlog("SVGAUpdateState: 15 bit mode."); -#endif - break; - case 16: ctx->Driver.ClearColor = __clear_color16; - ctx->Driver.Clear = __clear16; - - swdd->ReadRGBASpan = __read_rgba_span16; - swdd->ReadRGBAPixels = __read_rgba_pixels16; - swdd->WriteRGBASpan = __write_rgba_span16; - swdd->WriteRGBAPixels = __write_rgba_pixels16; - swdd->WriteMonoRGBASpan = __write_mono_rgba_span16; - swdd->WriteMonoRGBAPixels = __write_mono_rgba_pixels16; - break; -#ifdef SVGA_DEBUG - SVGAlog("SVGAUpdateState: 16 bit mode."); -#endif - case 24: ctx->Driver.ClearColor = __clear_color24; - ctx->Driver.Clear = __clear24; - - swdd->ReadRGBASpan = __read_rgba_span24; - swdd->ReadRGBAPixels = __read_rgba_pixels24; - swdd->WriteRGBASpan = __write_rgba_span24; - swdd->WriteRGBAPixels = __write_rgba_pixels24; - swdd->WriteMonoRGBASpan = __write_mono_rgba_span24; - swdd->WriteMonoRGBAPixels = __write_mono_rgba_pixels24; - break; -#ifdef SVGA_DEBUG - SVGAlog("SVGAUpdateState: 32 bit mode."); -#endif - case 32: ctx->Driver.ClearColor = __clear_color32; - ctx->Driver.Clear = __clear32; - - swdd->ReadRGBASpan = __read_rgba_span32; - swdd->ReadRGBAPixels = __read_rgba_pixels32; - swdd->WriteRGBASpan = __write_rgba_span32; - swdd->WriteRGBAPixels = __write_rgba_pixels32; - swdd->WriteMonoRGBASpan = __write_mono_rgba_span32; - swdd->WriteMonoRGBAPixels = __write_mono_rgba_pixels32; - } -} - -/* - * Create a new VGA/Mesa context and return a handle to it. - */ -SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) -{ - SVGAMesaContext ctx; -#ifndef DEV - GLboolean rgb_flag; - GLfloat redscale, greenscale, bluescale, alphascale; - GLint index_bits; - GLint redbits, greenbits, bluebits, alphabits; - - /* determine if we're in RGB or color index mode */ - if ((SVGABuffer.Depth==32) || (SVGABuffer.Depth==24)) { - rgb_flag = GL_TRUE; - redscale = greenscale = bluescale = alphascale = 255.0; - redbits = greenbits = bluebits = 8; - alphabits = 0; - index_bits = 0; - } - else if (SVGABuffer.Depth==8) { - rgb_flag = GL_FALSE; - redscale = greenscale = bluescale = alphascale = 0.0; - redbits = greenbits = bluebits = alphabits = 0; - index_bits = 8; - } - else if (SVGABuffer.Depth==15) { - rgb_flag = GL_TRUE; - redscale = greenscale = bluescale = alphascale = 31.0; - redbits = greenbits = bluebits = 5; - alphabits = 0; - index_bits = 0; - } - else if (SVGABuffer.Depth==16) { - rgb_flag = GL_TRUE; - redscale = bluescale = alphascale = 31.0; - greenscale = 63.0; - redbits = bluebits = 5; - greenbits = 6; - alphabits = 0; - index_bits = 0; - } - - ctx = (SVGAMesaContext) calloc( 1, sizeof(struct svgamesa_context) ); - if (!ctx) { - return NULL; - } - - ctx->gl_vis = _mesa_create_visual( rgb_flag, - doubleBuffer, - GL_FALSE, /* stereo */ - redbits, greenbits, - bluebits, alphabits, - index_bits, - 16, /* depth_size */ - 8, /* stencil_size */ - 16, 16, 16, 16, /* accum_size */ - 1 /* samples */ - ); - - ctx->gl_ctx = _mesa_create_context( ctx->gl_vis, - NULL, /* share list context */ - (void *) ctx, GL_FALSE ); - - _mesa_enable_sw_extensions(ctx->gl_ctx); - _mesa_enable_1_3_extensions(ctx->gl_ctx); - - _mesa_init_driver_functions(&ctx->Driver); - - ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis, - ctx->gl_vis->depthBits > 0, - ctx->gl_vis->stencilBits > 0, - ctx->gl_vis->accumRedBits > 0, - ctx->gl_vis->alphaBits > 0 ); - - ctx->width = ctx->height = 0; /* temporary until first "make-current" */ -#endif - return ctx; -} - -/* - * Destroy the given VGA/Mesa context. - */ -void SVGAMesaDestroyContext( SVGAMesaContext ctx ) -{ -#ifndef DEV - if (ctx) { - _mesa_destroy_visual( ctx->gl_vis ); - _mesa_destroy_context( ctx->gl_ctx ); - free( ctx ); - if (ctx==SVGAMesa) { - SVGAMesa = NULL; - } - } -#endif -} - -/* - * Make the specified VGA/Mesa context the current one. - */ -void SVGAMesaMakeCurrent( SVGAMesaContext ctx ) -{ -#ifndef DEV - SVGAMesa = ctx; - svgamesa_update_state( ctx->gl_ctx, ~0 ); - _mesa_make_current( ctx->gl_ctx, ctx->gl_buffer ); - - if (ctx->width==0 || ctx->height==0) { - ctx->width = vga_getxdim(); - ctx->height = vga_getydim(); - } -#endif -} - -/* - * Return a handle to the current VGA/Mesa context. - */ -SVGAMesaContext SVGAMesaGetCurrentContext( void ) -{ - return SVGAMesa; -} - -/* - * Swap front/back buffers for current context if double buffered. - */ -void SVGAMesaSwapBuffers( void ) -{ -#if 000 - void * tmpptr; -#endif - - /* vga_waitretrace(); */ - copy_buffer(SVGABuffer.BackBuffer); - -#ifndef DEV - _mesa_notifySwapBuffers( SVGAMesa->gl_ctx ); - if (SVGAMesa->gl_vis->doubleBufferMode) -#endif /* DEV */ - { -#ifdef SVGA_DEBUG - sprintf(cbuf,"SVGAMesaSwapBuffers : Swapping..."); - SVGAlog(cbuf); -#endif /* SVGA_DEBUG */ -#if 000 - tmpptr=SVGABuffer.BackBuffer; - SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer; - SVGABuffer.FrontBuffer=tmpptr; -#endif -#ifdef SVGA_DEBUG - sprintf(cbuf,"SVGAMesaSwapBuffers : WriteBuffer : %p\n" - " Readbuffer : %p", \ - SVGABuffer.BackBuffer, SVGABuffer.FrontBuffer ); - SVGAlog(cbuf); -#endif /* SVGA_DEBUG */ - } -} - -#else /*SVGA*/ - -/* - * Need this to provide at least one external definition when SVGA is - * not defined on the compiler command line. - */ -extern int gl_svga_dummy_function(void); -int gl_svga_dummy_function(void) -{ - return 0; -} - -#endif /*SVGA*/ - diff --git a/src/mesa/drivers/svga/svgamesa15.c b/src/mesa/drivers/svga/svgamesa15.c deleted file mode 100644 index 934aaa33fb..0000000000 --- a/src/mesa/drivers/svga/svgamesa15.c +++ /dev/null @@ -1,220 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#ifdef SVGA - -#include "svgapix.h" -#include "svgamesa15.h" -#include "swrast/swrast.h" - - -static void __svga_drawpixel15(int x, int y, unsigned long c) -{ - unsigned long offset; - GLshort *shortBuffer=(void *)SVGABuffer.DrawBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - shortBuffer[offset]=c; -} - -static unsigned long __svga_getpixel15(int x, int y) -{ - unsigned long offset; - GLshort *shortBuffer=(void *)SVGABuffer.ReadBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - return shortBuffer[offset]; -} - -void __clear_color15( GLcontext *ctx, const GLfloat color[4] ) -{ - GLubyte col[3]; - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - SVGAMesa->clear_hicolor=(col[0]>>3)<<10 | (col[1]>>3)<<5 | (col[2]>>3); -/* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/ -} - -void __clear15( GLcontext *ctx, GLbitfield mask ) -{ - int i, j; - int x = ctx->DrawBuffer->_Xmin; - int y = ctx->DrawBuffer->_Ymin; - int width = ctx->DrawBuffer->_Xmax - x; - int height = ctx->DrawBuffer->_Ymax - y; - GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) - - if (mask & DD_FRONT_LEFT_BIT) { - GLshort *shortBuffer=(void *)SVGABuffer.FrontBuffer; - if (all) { - for (i=0;iclear_hicolor; - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer; - for (i=x;iclear_hicolor); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_FRONT_LEFT_BIT; - } - if (mask & DD_BACK_LEFT_BIT) { - GLshort *shortBuffer=(void *)SVGABuffer.BackBuffer; - if (all) { - for (i=0;iclear_hicolor; - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer; - for (i=x;iclear_hicolor); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_BACK_LEFT_BIT; - } - - if (mask) - _swrast_Clear( ctx, mask ); -} - -void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - int i; - if (mask) { - /* draw some pixels */ - for (i=0; i>3)<<10 | \ - (rgba[i][GCOMP]>>3)<<5 | \ - (rgba[i][BCOMP]>>3)); - } - } - } - else { - /* draw all pixels */ - for (i=0; i>3)<<10 | \ - (rgba[i][GCOMP]>>3)<<5 | \ - (rgba[i][BCOMP]>>3)); - } - } -} - -void __write_mono_rgba_span15( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[]) -{ - GLushort hicolor = (color[RCOMP] >> 3) << 10 | - (color[GCOMP] >> 3) << 5 | - (color[BCOMP] >> 3); - int i; - for (i=0; i>10)<<3) & 0xff; - rgba[i][GCOMP] = ((pix>> 5)<<3) & 0xff; - rgba[i][BCOMP] = ((pix )<<3) & 0xff; - } -} - -void __write_rgba_pixels15( const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - int i; - for (i=0; i>3)<<10 | \ - (rgba[i][GCOMP]>>3)<<5 | \ - (rgba[i][BCOMP]>>3)); - } - } -} - - -void __write_mono_rgba_pixels15( const GLcontext *ctx, - GLuint n, - const GLint x[], const GLint y[], - const GLchan color[4], const GLubyte mask[] ) -{ - GLushort hicolor = (color[RCOMP] >> 3) << 10 | - (color[GCOMP] >> 3) << 5 | - (color[BCOMP] >> 3); - int i; - /* use current rgb color */ - for (i=0; i>10)<<3) & 0xff; - rgba[i][GCOMP] = ((pix>> 5)<<3) & 0xff; - rgba[i][BCOMP] = ((pix )<<3) & 0xff; - } -} - -#else - - -/* silence compiler warning */ -extern void _mesa_svga15_dummy_function(void); -void _mesa_svga15_dummy_function(void) -{ -} - - -#endif diff --git a/src/mesa/drivers/svga/svgamesa15.h b/src/mesa/drivers/svga/svgamesa15.h deleted file mode 100644 index d453fb8d35..0000000000 --- a/src/mesa/drivers/svga/svgamesa15.h +++ /dev/null @@ -1,42 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - - -#ifndef SVGA_MESA_15_H -#define SVGA_MESA_15_H - -extern void __clear_color15( GLcontext *ctx, const GLfloat color[4] ); -extern void __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); -extern void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); -extern void __read_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); -extern void __write_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[] ); -extern void __read_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); - -#endif /* SVGA_MESA_15_H */ diff --git a/src/mesa/drivers/svga/svgamesa16.c b/src/mesa/drivers/svga/svgamesa16.c deleted file mode 100644 index 9fc8c786e8..0000000000 --- a/src/mesa/drivers/svga/svgamesa16.c +++ /dev/null @@ -1,218 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#ifdef SVGA - -#include "svgapix.h" -#include "svgamesa16.h" -#include "swrast/swrast.h" - - -static void __svga_drawpixel16(int x, int y, unsigned long c) -{ - unsigned long offset; - GLshort *shortBuffer=(void *)SVGABuffer.DrawBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - shortBuffer[offset]=c; -} - -static unsigned long __svga_getpixel16(int x, int y) -{ - unsigned long offset; - - GLshort *shortBuffer=(void *)SVGABuffer.ReadBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - return shortBuffer[offset]; -} - -void __clear_color16( GLcontext *ctx, const GLfloat color[4] ) -{ - GLubyte col[3]; - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - SVGAMesa->clear_hicolor = (col[0] >> 3) << 11 | - (col[1] >> 2) << 5 | - (col[2] >> 3); -/* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */ -} - -void __clear16( GLcontext *ctx, GLbitfield mask ) -{ - int i,j; - int x = ctx->DrawBuffer->_Xmin; - int y = ctx->DrawBuffer->_Ymin; - int width = ctx->DrawBuffer->_Xmax - x; - int height = ctx->DrawBuffer->_Ymax - y; - GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) - - if (mask & DD_FRONT_LEFT_BIT) { - if (all) { - GLshort *shortBuffer=(void *)SVGABuffer.FrontBuffer; - for (i=0;iclear_hicolor; - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer; - for (i=x;iclear_hicolor); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_FRONT_LEFT_BIT; - } - if (mask & DD_BACK_LEFT_BIT) { - if (all) { - GLshort *shortBuffer=(void *)SVGABuffer.BackBuffer; - for (i=0;iclear_hicolor; - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer; - for (i=x;iclear_hicolor); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_BACK_LEFT_BIT; - } - - if (mask) - _swrast_Clear( ctx, mask ); -} - -void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - int i; - if (mask) { - /* draw some pixels */ - for (i=0; i>3)<<11 | \ - (rgba[i][GCOMP]>>2)<<5 | \ - (rgba[i][BCOMP]>>3)); - } - } - } - else { - /* draw all pixels */ - for (i=0; i>3)<<11 | \ - (rgba[i][GCOMP]>>2)<<5 | \ - (rgba[i][BCOMP]>>3)); - } - } -} - -void __write_mono_rgba_span16( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - const GLchan color[4], const GLubyte mask[]) -{ - GLushort hicolor=(color[RCOMP]>>3)<<11 | (color[GCOMP]>>2)<<5 | (color[BCOMP]>>3); - int i; - for (i=0; i>11)<<3) & 0xff; - rgba[i][GCOMP] = ((pix>> 5)<<2) & 0xff; - rgba[i][BCOMP] = ((pix )<<3) & 0xff; - } -} - -void __write_rgba_pixels16( const GLcontext *ctx, - GLuint n, const GLint x[], const GLint y[], - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - int i; - for (i=0; i>3)<<11 | \ - (rgba[i][GCOMP]>>2)<<5 | \ - (rgba[i][BCOMP]>>3)); - } - } -} - - -void __write_mono_rgba_pixels16( const GLcontext *ctx, - GLuint n, - const GLint x[], const GLint y[], - const GLchan color[4], const GLubyte mask[] ) -{ - GLushort hicolor=(color[RCOMP]>>3)<<11 | (color[GCOMP]>>2)<<5 | (color[BCOMP]>>3); - int i; - for (i=0; i>11)<<3) & 0xff; - rgba[i][GCOMP] = ((pix>> 5)<<2) & 0xff; - rgba[i][BCOMP] = ((pix )<<3) & 0xff; - } -} - -#else - - -/* silence compiler warning */ -extern void _mesa_svga16_dummy_function(void); -void _mesa_svga16_dummy_function(void) -{ -} - - -#endif diff --git a/src/mesa/drivers/svga/svgamesa16.h b/src/mesa/drivers/svga/svgamesa16.h deleted file mode 100644 index b80cd3dd7e..0000000000 --- a/src/mesa/drivers/svga/svgamesa16.h +++ /dev/null @@ -1,43 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - - -#ifndef SVGA_MESA_16_H -#define SVGA_MESA_16_H - -extern void __clear_color16( GLcontext *ctx, const GLfloat color[4] ); -extern void __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); -extern void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); -extern void __read_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); -extern void __write_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[] ); -extern void __read_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); - -#endif /* SVGA_MESA_16_H */ - diff --git a/src/mesa/drivers/svga/svgamesa24.c b/src/mesa/drivers/svga/svgamesa24.c deleted file mode 100644 index f2ec9c0364..0000000000 --- a/src/mesa/drivers/svga/svgamesa24.c +++ /dev/null @@ -1,242 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#ifdef SVGA - -#include "svgapix.h" -#include "svgamesa24.h" -#include "swrast/swrast.h" - - -#if 0 -/* this doesn't compile with GCC on RedHat 6.1 */ -static INLINE int RGB2BGR24(int c) -{ - asm("rorw $8, %0\n" - "rorl $16, %0\n" - "rorw $8, %0\n" - "shrl $8, %0\n" - : "=q"(c):"0"(c)); - return c; -} -#else -static unsigned long RGB2BGR24(unsigned long color) -{ - return (color & 0xff00)|(color>>16)|((color & 0xff)<<16); -} -#endif - -static void __svga_drawpixel24(int x, int y, GLubyte r, GLubyte g, GLubyte b) -{ - unsigned long offset; - - _RGB *rgbBuffer=(void *)SVGABuffer.DrawBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - - rgbBuffer[offset].r=r; - rgbBuffer[offset].g=g; - rgbBuffer[offset].b=b; -} - -static unsigned long __svga_getpixel24(int x, int y) -{ - unsigned long offset; - - _RGB *rgbBuffer=(void *)SVGABuffer.ReadBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - return rgbBuffer[offset].r<<16 | rgbBuffer[offset].g<<8 | rgbBuffer[offset].b; -} - -void __clear_color24( GLcontext *ctx, const GLfloat color[4] ) -{ - GLubyte col[3]; - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - SVGAMesa->clear_red = col[0]; - SVGAMesa->clear_green = col[1]; - SVGAMesa->clear_blue = col[2]; -/* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */ -} - -void __clear24( GLcontext *ctx, GLbitfield mask ) -{ - int i,j; - int x = ctx->DrawBuffer->_Xmin; - int y = ctx->DrawBuffer->_Ymin; - int width = ctx->DrawBuffer->_Xmax - x; - int height = ctx->DrawBuffer->_Ymax - y; - GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) - - if (mask & DD_FRONT_LEFT_BIT) { - if (all) { - _RGB *rgbBuffer=(void *)SVGABuffer.FrontBuffer; - for (i=0;iclear_red; - rgbBuffer[i].g=SVGAMesa->clear_green; - rgbBuffer[i].b=SVGAMesa->clear_blue; - } - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer; - for (i=x;iclear_red, - SVGAMesa->clear_green, - SVGAMesa->clear_blue); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_FRONT_LEFT_BIT; - } - if (mask & DD_BACK_LEFT_BIT) { - if (all) { - _RGB *rgbBuffer=(void *)SVGABuffer.BackBuffer; - for (i=0;iclear_red; - rgbBuffer[i].g=SVGAMesa->clear_green; - rgbBuffer[i].b=SVGAMesa->clear_blue; - } - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer; - for (i=x;iclear_red, - SVGAMesa->clear_green, - SVGAMesa->clear_blue); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_BACK_LEFT_BIT; - } - - if (mask) - _swrast_Clear( ctx, mask ); -} - -void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - int i; - if (mask) { - /* draw some pixels */ - for (i=0; i (Mesa 3.2) - */ - - -#ifndef SVGA_MESA_24_H -#define SVGA_MESA_24_H - -extern void __clear_color24( GLcontext *ctx, const GLfloat color[4] ); -extern void __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); -extern void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); -extern void __read_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); -extern void __write_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[] ); -extern void __read_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); - -#endif /* SVGA_MESA_24_H */ - diff --git a/src/mesa/drivers/svga/svgamesa32.c b/src/mesa/drivers/svga/svgamesa32.c deleted file mode 100644 index 8eea3cbe64..0000000000 --- a/src/mesa/drivers/svga/svgamesa32.c +++ /dev/null @@ -1,223 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#ifdef SVGA - -#include "svgapix.h" -#include "svgamesa32.h" -#include "swrast/swrast.h" - - -#if 0 -/* this doesn't compile with GCC on RedHat 6.1 */ -static INLINE int RGB2BGR32(int c) -{ - asm("rorw $8, %0\n" - "rorl $16, %0\n" - "rorw $8, %0\n" - "shrl $8, %0\n" - : "=q"(c):"0"(c)); - return c; -} -#else -static unsigned long RGB2BGR32(unsigned long color) -{ - return (color & 0xff00)|(color>>16)|((color & 0xff)<<16); -} -#endif - -static void __svga_drawpixel32(int x, int y, unsigned long c) -{ - unsigned long offset; - - GLint *intBuffer=(void *)SVGABuffer.DrawBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - intBuffer[offset]=c; -} - -static unsigned long __svga_getpixel32(int x, int y) -{ - unsigned long offset; - - const GLint *intBuffer=(void *)SVGABuffer.ReadBuffer; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->width + x; - return intBuffer[offset]; -} - -void __clear_color32( GLcontext *ctx, const GLfloat color[4] ) -{ - GLubyte col[3]; - CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); - SVGAMesa->clear_truecolor = (col[0] << 16) | (col[1] << 8) | col[2]; -} - -void __clear32( GLcontext *ctx, GLbitfield mask ) -{ - int i,j; - int x = ctx->DrawBuffer->_Xmin; - int y = ctx->DrawBuffer->_Ymin; - int width = ctx->DrawBuffer->_Xmax - x; - int height = ctx->DrawBuffer->_Ymax - y; - GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) - - if (mask & DD_FRONT_LEFT_BIT) { - if (all) { - GLint *intBuffer=(void *)SVGABuffer.FrontBuffer; - for (i=0;iclear_truecolor; - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer; - for (i=x;iclear_truecolor); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_FRONT_LEFT_BIT; - } - if (mask & DD_BACK_LEFT_BIT) { - if (all) { - GLint *intBuffer=(void *)SVGABuffer.BackBuffer; - for (i=0;iclear_truecolor; - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer; - for (i=x;iclear_truecolor); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_BACK_LEFT_BIT; - } - - if (mask) - _swrast_Clear( ctx, mask ); -} - -void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, - const GLubyte rgba[][4], const GLubyte mask[] ) -{ - int i; - if (mask) { - /* draw some pixels */ - for (i=0; i (Mesa 3.2) - */ - - -#ifndef SVGA_MESA_32_H -#define SVGA_MESA_32_H - -extern void __clear_color32( GLcontext *ctx, const GLfloat color[4] ); -extern void __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); -extern void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLchan color[4], const GLubyte mask[]); -extern void __read_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] ); -extern void __write_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] ); -extern void __write_mono_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLchan color[4], const GLubyte mask[] ); -extern void __read_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] ); - -#endif /* SVGA_MESA_32_H */ - diff --git a/src/mesa/drivers/svga/svgamesa8.c b/src/mesa/drivers/svga/svgamesa8.c deleted file mode 100644 index 2f7048a930..0000000000 --- a/src/mesa/drivers/svga/svgamesa8.c +++ /dev/null @@ -1,196 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - -#ifdef HAVE_CONFIG_H -#include "conf.h" -#endif - -#ifdef SVGA - - -#include "svgapix.h" -#include "svgamesa8.h" -#include "swrast/swrast.h" - - -static void __svga_drawpixel8(int x, int y, unsigned long c) -{ - unsigned long offset; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->linewidth + x; - SVGABuffer.DrawBuffer[offset]=c; -} - -static unsigned long __svga_getpixel8(int x, int y) -{ - unsigned long offset; - y = SVGAInfo->height-y-1; - offset = y * SVGAInfo->linewidth + x; - return SVGABuffer.ReadBuffer[offset]; -} - -void __clear_index8( GLcontext *ctx, GLuint index ) -{ - SVGAMesa->clear_index = index; -} - -void __clear8( GLcontext *ctx, GLbitfield mask ) -{ - int i,j; - int x = ctx->DrawBuffer->_Xmin; - int y = ctx->DrawBuffer->_Ymin; - int width = ctx->DrawBuffer->_Xmax - x; - int height = ctx->DrawBuffer->_Ymax - y; - GLboolean all = (width == ctx->DrawBuffer->Width && height == ctx->DrawBuffer->height) - - if (mask & DD_FRONT_LEFT_BIT) { - if (all) { - memset(SVGABuffer.FrontBuffer, SVGAMesa->clear_index, SVGABuffer.BufferSize); - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer; - for (i=x;iclear_index); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_FRONT_LEFT_BIT; - } - if (mask & DD_BACK_LEFT_BIT) { - if (all) { - memset(SVGABuffer.BackBuffer, SVGAMesa->clear_index, SVGABuffer.BufferSize); - } - else { - GLubyte *tmp = SVGABuffer.DrawBuffer; - SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer; - for (i=x;iclear_index); - SVGABuffer.DrawBuffer = tmp; - } - mask &= ~DD_BACK_LEFT_BIT; - } - - if (mask) - _swrast_Clear( ctx, mask ); -} - -void __write_ci32_span8( const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const GLuint index[], const GLubyte mask[] ) -{ - int i; - for (i=0;i (Mesa 3.2) - */ - - -#ifndef SVGA_MESA_8_H -#define SVGA_MESA_8_H - -extern void __clear_index8( GLcontext *ctx, GLuint index ); -extern void __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height ); -extern void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] ); -extern void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] ); -extern void __write_mono_ci_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint colorIndex, const GLubyte mask[] ); -extern void __read_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[]); -extern void __write_ci32_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[] ); -extern void __write_mono_ci_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint colorIndex, const GLubyte mask[] ); -extern void __read_ci32_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint index[], const GLubyte mask[] ); - -#endif /* SVGA_MESA_15_H */ diff --git a/src/mesa/drivers/svga/svgapix.h b/src/mesa/drivers/svga/svgapix.h deleted file mode 100644 index c8cee37ca6..0000000000 --- a/src/mesa/drivers/svga/svgapix.h +++ /dev/null @@ -1,70 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 5.0 - * Copyright (C) 1995-2002 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * SVGA driver for Mesa. - * Original author: Brian Paul - * Additional authors: Slawomir Szczyrba (Mesa 3.2) - */ - - -#ifndef SVGAPIX_H -#define SVGAPIX_H - -#include "GL/gl.h" -#include "GL/svgamesa.h" -#include "main/context.h" -#include "main/colormac.h" -#include "vga.h" - -struct svgamesa_context { - GLcontext *gl_ctx; /* the core Mesa context */ - GLvisual *gl_vis; /* describes the color buffer */ - GLframebuffer *gl_buffer; /* the ancillary buffers */ - GLuint clear_index; /* current clear index */ - GLint clear_red, - clear_green, - clear_blue; /* current clear rgb color */ - GLuint clear_truecolor; /* current clear rgb color */ - GLushort hicolor; /* current hicolor */ - GLushort clear_hicolor; /* current clear hicolor */ - GLint width, height; /* size of color buffer */ - GLint depth; /* bits per pixel (8,16,24 or 32) */ -}; - -typedef struct { GLubyte b,g,r; } _RGB; - -struct svga_buffer { - GLint Depth; - GLint BufferSize; - GLubyte * FrontBuffer; - GLubyte * BackBuffer; - GLubyte * VideoRam; - GLubyte * DrawBuffer; /* == FrontBuffer or BackBuffer */ - GLubyte * ReadBuffer; /* == FrontBuffer or BackBuffer */ -}; - -extern struct svga_buffer SVGABuffer; -extern vga_modeinfo * SVGAInfo; -extern SVGAMesaContext SVGAMesa; /* the current context */ - -#endif /* SVGAPIX_H */ -- cgit v1.2.3 From 79aeafd3ca3680c28f6d47a21a501334844f4475 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 16:12:58 -0500 Subject: Drop fb, ffb and gamma dri drivers --- configure.ac | 13 +- src/mesa/drivers/dri/fb/Doxyfile | 232 - src/mesa/drivers/dri/fb/Makefile | 24 - src/mesa/drivers/dri/fb/fb_dri.c | 792 --- src/mesa/drivers/dri/ffb/Makefile | 35 - src/mesa/drivers/dri/ffb/ffb_bitmap.c | 158 - src/mesa/drivers/dri/ffb/ffb_bitmap.h | 7 - src/mesa/drivers/dri/ffb/ffb_clear.c | 335 -- src/mesa/drivers/dri/ffb/ffb_clear.h | 6 - src/mesa/drivers/dri/ffb/ffb_context.h | 305 -- src/mesa/drivers/dri/ffb/ffb_dd.c | 115 - src/mesa/drivers/dri/ffb/ffb_dd.h | 36 - src/mesa/drivers/dri/ffb/ffb_depth.c | 243 - src/mesa/drivers/dri/ffb/ffb_depth.h | 7 - src/mesa/drivers/dri/ffb/ffb_fifo.h | 27 - src/mesa/drivers/dri/ffb/ffb_fog.c | 73 - src/mesa/drivers/dri/ffb/ffb_lines.c | 107 - src/mesa/drivers/dri/ffb/ffb_lines.h | 17 - src/mesa/drivers/dri/ffb/ffb_linetmp.h | 80 - src/mesa/drivers/dri/ffb/ffb_lock.h | 36 - src/mesa/drivers/dri/ffb/ffb_points.c | 91 - src/mesa/drivers/dri/ffb/ffb_points.h | 14 - src/mesa/drivers/dri/ffb/ffb_pointtmp.h | 54 - src/mesa/drivers/dri/ffb/ffb_rendertmp.h | 645 --- src/mesa/drivers/dri/ffb/ffb_span.c | 127 - src/mesa/drivers/dri/ffb/ffb_span.h | 9 - src/mesa/drivers/dri/ffb/ffb_state.c | 1222 ----- src/mesa/drivers/dri/ffb/ffb_state.h | 12 - src/mesa/drivers/dri/ffb/ffb_stencil.c | 224 - src/mesa/drivers/dri/ffb/ffb_stencil.h | 7 - src/mesa/drivers/dri/ffb/ffb_tex.c | 35 - src/mesa/drivers/dri/ffb/ffb_tex.h | 34 - src/mesa/drivers/dri/ffb/ffb_tris.c | 945 ---- src/mesa/drivers/dri/ffb/ffb_tris.h | 25 - src/mesa/drivers/dri/ffb/ffb_tritmp.h | 238 - src/mesa/drivers/dri/ffb/ffb_vb.c | 207 - src/mesa/drivers/dri/ffb/ffb_vb.h | 44 - src/mesa/drivers/dri/ffb/ffb_vbtmp.h | 150 - src/mesa/drivers/dri/ffb/ffb_vtxfmt.c | 414 -- src/mesa/drivers/dri/ffb/ffb_vtxfmt.h | 7 - src/mesa/drivers/dri/ffb/ffb_xmesa.c | 729 --- src/mesa/drivers/dri/ffb/ffb_xmesa.h | 25 - src/mesa/drivers/dri/ffb/server/ffb_dac.h | 366 -- src/mesa/drivers/dri/ffb/server/ffb_drishare.h | 47 - src/mesa/drivers/dri/ffb/server/ffb_regs.h | 508 -- src/mesa/drivers/dri/gamma/Makefile | 34 - src/mesa/drivers/dri/gamma/gamma_client.h | 6184 ---------------------- src/mesa/drivers/dri/gamma/gamma_context.c | 229 - src/mesa/drivers/dri/gamma/gamma_context.h | 401 -- src/mesa/drivers/dri/gamma/gamma_dd.c | 110 - src/mesa/drivers/dri/gamma/gamma_inithw.c | 551 -- src/mesa/drivers/dri/gamma/gamma_lock.c | 60 - src/mesa/drivers/dri/gamma/gamma_lock.h | 84 - src/mesa/drivers/dri/gamma/gamma_macros.h | 323 -- src/mesa/drivers/dri/gamma/gamma_regs.h | 658 --- src/mesa/drivers/dri/gamma/gamma_render.c | 221 - src/mesa/drivers/dri/gamma/gamma_screen.c | 147 - src/mesa/drivers/dri/gamma/gamma_screen.h | 30 - src/mesa/drivers/dri/gamma/gamma_span.c | 315 -- src/mesa/drivers/dri/gamma/gamma_state.c | 1721 ------ src/mesa/drivers/dri/gamma/gamma_tex.c | 434 -- src/mesa/drivers/dri/gamma/gamma_texmem.c | 535 -- src/mesa/drivers/dri/gamma/gamma_texstate.c | 215 - src/mesa/drivers/dri/gamma/gamma_tris.c | 660 --- src/mesa/drivers/dri/gamma/gamma_tris.h | 36 - src/mesa/drivers/dri/gamma/gamma_tritmp.h | 496 -- src/mesa/drivers/dri/gamma/gamma_vb.c | 361 -- src/mesa/drivers/dri/gamma/gamma_vb.h | 60 - src/mesa/drivers/dri/gamma/gamma_xmesa.c | 273 - src/mesa/drivers/dri/gamma/server/glint_common.h | 63 - src/mesa/drivers/dri/gamma/server/glint_dri.h | 122 - 71 files changed, 5 insertions(+), 23145 deletions(-) delete mode 100644 src/mesa/drivers/dri/fb/Doxyfile delete mode 100644 src/mesa/drivers/dri/fb/Makefile delete mode 100644 src/mesa/drivers/dri/fb/fb_dri.c delete mode 100644 src/mesa/drivers/dri/ffb/Makefile delete mode 100644 src/mesa/drivers/dri/ffb/ffb_bitmap.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_bitmap.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_clear.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_clear.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_context.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_dd.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_dd.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_depth.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_depth.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_fifo.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_fog.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_lines.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_lines.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_linetmp.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_lock.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_points.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_points.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_pointtmp.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_rendertmp.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_span.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_span.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_state.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_state.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_stencil.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_stencil.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_tex.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_tex.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_tris.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_tris.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_tritmp.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_vb.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_vb.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_vbtmp.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_vtxfmt.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_vtxfmt.h delete mode 100644 src/mesa/drivers/dri/ffb/ffb_xmesa.c delete mode 100644 src/mesa/drivers/dri/ffb/ffb_xmesa.h delete mode 100644 src/mesa/drivers/dri/ffb/server/ffb_dac.h delete mode 100644 src/mesa/drivers/dri/ffb/server/ffb_drishare.h delete mode 100644 src/mesa/drivers/dri/ffb/server/ffb_regs.h delete mode 100644 src/mesa/drivers/dri/gamma/Makefile delete mode 100644 src/mesa/drivers/dri/gamma/gamma_client.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_context.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_context.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_dd.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_inithw.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_lock.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_lock.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_macros.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_regs.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_render.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_screen.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_screen.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_span.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_state.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_tex.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_texmem.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_texstate.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_tris.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_tris.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_tritmp.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_vb.c delete mode 100644 src/mesa/drivers/dri/gamma/gamma_vb.h delete mode 100644 src/mesa/drivers/dri/gamma/gamma_xmesa.c delete mode 100644 src/mesa/drivers/dri/gamma/server/glint_common.h delete mode 100644 src/mesa/drivers/dri/gamma/server/glint_dri.h (limited to 'src') diff --git a/configure.ac b/configure.ac index b4561000d2..d108ecdad2 100644 --- a/configure.ac +++ b/configure.ac @@ -720,10 +720,9 @@ if test "$mesa_driver" = dri; then case "$host_cpu" in x86_64) - # ffb, gamma, and sis are missing because they have not be - # converted to use the new interface. i810 are missing - # because there is no x86-64 system where they could *ever* - # be used. + # sis is missing because they have not be converted to use + # the new interface. i810 are missing because there is no + # x86-64 system where they could *ever* be used. if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \ savage tdfx unichrome swrast" @@ -739,7 +738,7 @@ if test "$mesa_driver" = dri; then sparc*) # Build only the drivers for cards that exist on sparc` if test "x$DRI_DIRS" = "xyes"; then - DRI_DIRS="mach64 r128 r200 r300 r600 radeon ffb swrast" + DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast" fi ;; esac @@ -755,8 +754,6 @@ if test "$mesa_driver" = dri; then CXXFLAGS="$CXXFLAGS -ansi -pedantic" fi - # ffb and gamma are missing because they have not been converted - # to use the new interface. if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \ unichrome savage sis swrast" @@ -778,7 +775,7 @@ if test "$mesa_driver" = dri; then # default drivers if test "x$DRI_DIRS" = "xyes"; then DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \ - savage sis tdfx unichrome ffb swrast" + savage sis tdfx unichrome swrast" fi DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'` diff --git a/src/mesa/drivers/dri/fb/Doxyfile b/src/mesa/drivers/dri/fb/Doxyfile deleted file mode 100644 index 31256db834..0000000000 --- a/src/mesa/drivers/dri/fb/Doxyfile +++ /dev/null @@ -1,232 +0,0 @@ -# Doxyfile 1.3.2-Gideon - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = fb -PROJECT_NUMBER = $VERSION$ -OUTPUT_DIRECTORY = -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ALIASES = -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -SHOW_USED_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = /home/temp/Mesa/src/drv/fb -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.C \ - *.H \ - *.tlh \ - *.diff \ - *.patch \ - *.moc \ - *.xpm -RECURSIVE = yes -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = yes -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO -CGI_NAME = search.cgi -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = /usr/local/bin/ -EXT_DOC_PATHS = diff --git a/src/mesa/drivers/dri/fb/Makefile b/src/mesa/drivers/dri/fb/Makefile deleted file mode 100644 index 848e2041e2..0000000000 --- a/src/mesa/drivers/dri/fb/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# src/mesa/drivers/dri/fb/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = fb_dri.so - - -DRIVER_SOURCES = \ - fb_dri.c \ - $(EGL_SOURCES) - - -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - -# XXX not 100% sure this is right -#WINDOW_SYSTEM = solo - -include ../Makefile.template - diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c deleted file mode 100644 index ac07e57db1..0000000000 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ /dev/null @@ -1,792 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Minimal swrast-based dri loadable driver. - * - * Todo: - * -- Use malloced (rather than framebuffer) memory for backbuffer - * -- 32bpp is hardwared -- fix - * - * NOTES: - * -- No mechanism for cliprects or resize notification -- - * assumes this is a fullscreen device. - * -- No locking -- assumes this is the only driver accessing this - * device. - * -- Doesn't (yet) make use of any acceleration or other interfaces - * provided by fb. Would be entirely happy working against any - * fullscreen interface. - * -- HOWEVER: only a small number of pixelformats are supported, and - * the mechanism for choosing between them makes some assumptions - * that may not be valid everywhere. - */ - -#include "driver.h" -#include "drm.h" -#include "utils.h" -#include "drirenderbuffer.h" - -#include "buffers.h" -#include "main/extensions.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/tcontext.h" -#include "tnl/t_pipeline.h" -#include "drivers/common/driverfuncs.h" - -void fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis); - -typedef struct { - GLcontext *glCtx; /* Mesa context */ - - struct { - __DRIcontext *context; - __DRIscreen *screen; - __DRIdrawable *drawable; /* drawable bound to this ctx */ - } dri; - -} fbContext, *fbContextPtr; - -#define FB_CONTEXT(ctx) ((fbContextPtr)(ctx->DriverCtx)) - - -static const GLubyte * -get_string(GLcontext *ctx, GLenum pname) -{ - (void) ctx; - switch (pname) { - case GL_RENDERER: - return (const GLubyte *) "Mesa dumb framebuffer"; - default: - return NULL; - } -} - - -static void -update_state( GLcontext *ctx, GLuint new_state ) -{ - /* not much to do here - pass it on */ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); -} - - -/** - * Called by ctx->Driver.GetBufferSize from in core Mesa to query the - * current framebuffer size. - */ -static void -get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - fbContextPtr fbmesa = FB_CONTEXT(ctx); - - *width = fbmesa->dri.drawable->w; - *height = fbmesa->dri.drawable->h; -} - - -static void -updateFramebufferSize(GLcontext *ctx) -{ - fbContextPtr fbmesa = FB_CONTEXT(ctx); - struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; - if (fbmesa->dri.drawable->w != fb->Width || - fbmesa->dri.drawable->h != fb->Height) { - driUpdateFramebufferSize(ctx, fbmesa->dri.drawable); - } -} - -static void -viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) -{ - /* XXX this should be called after we acquire the DRI lock, not here */ - updateFramebufferSize(ctx); -} - - -static void -init_core_functions( struct dd_function_table *functions ) -{ - functions->GetString = get_string; - functions->UpdateState = update_state; - functions->GetBufferSize = get_buffer_size; - functions->Viewport = viewport; - - functions->Clear = _swrast_Clear; /* could accelerate with blits */ -} - - -/* - * Generate code for span functions. - */ - -/* 24-bit BGR */ -#define NAME(PREFIX) PREFIX##_B8G8R8 -#define FORMAT GL_RGBA8 -#define SPAN_VARS \ - driRenderbuffer *drb = (driRenderbuffer *) rb; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 3; -#define INC_PIXEL_PTR(P) P += 3 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - DST[0] = VALUE[BCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[2] = VALUE[RCOMP] -#define FETCH_PIXEL(DST, SRC) \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0]; \ - DST[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - - -/* 32-bit BGRA */ -#define NAME(PREFIX) PREFIX##_B8G8R8A8 -#define FORMAT GL_RGBA8 -#define SPAN_VARS \ - driRenderbuffer *drb = (driRenderbuffer *) rb; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 4; -#define INC_PIXEL_PTR(P) P += 4 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - DST[0] = VALUE[BCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[2] = VALUE[RCOMP]; \ - DST[3] = VALUE[ACOMP] -#define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ - DST[0] = VALUE[BCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[2] = VALUE[RCOMP]; \ - DST[3] = 0xff -#define FETCH_PIXEL(DST, SRC) \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0]; \ - DST[ACOMP] = SRC[3] - -#include "swrast/s_spantemp.h" - - -/* 16-bit BGR (XXX implement dithering someday) */ -#define NAME(PREFIX) PREFIX##_B5G6R5 -#define FORMAT GL_RGBA8 -#define SPAN_VARS \ - driRenderbuffer *drb = (driRenderbuffer *) rb; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 2; -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 8) | (((VALUE[GCOMP]) & 0xfc) << 3) | ((VALUE[BCOMP]) >> 3) ) -#define FETCH_PIXEL(DST, SRC) \ - DST[RCOMP] = ( (((SRC[0]) >> 8) & 0xf8) | (((SRC[0]) >> 11) & 0x7) ); \ - DST[GCOMP] = ( (((SRC[0]) >> 3) & 0xfc) | (((SRC[0]) >> 5) & 0x3) ); \ - DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \ - DST[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - - -/* 15-bit BGR (XXX implement dithering someday) */ -#define NAME(PREFIX) PREFIX##_B5G5R5 -#define FORMAT GL_RGBA8 -#define SPAN_VARS \ - driRenderbuffer *drb = (driRenderbuffer *) rb; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLushort *P = (GLushort *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X) * 2; -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - DST[0] = ( (((VALUE[RCOMP]) & 0xf8) << 7) | (((VALUE[GCOMP]) & 0xf8) << 2) | ((VALUE[BCOMP]) >> 3) ) -#define FETCH_PIXEL(DST, SRC) \ - DST[RCOMP] = ( (((SRC[0]) >> 7) & 0xf8) | (((SRC[0]) >> 10) & 0x7) ); \ - DST[GCOMP] = ( (((SRC[0]) >> 2) & 0xf8) | (((SRC[0]) >> 5) & 0x7) ); \ - DST[BCOMP] = ( (((SRC[0]) << 3) & 0xf8) | (((SRC[0]) ) & 0x7) ); \ - DST[ACOMP] = 0xff - -#include "swrast/s_spantemp.h" - - -/* 8-bit color index */ -#define NAME(PREFIX) PREFIX##_CI8 -#define FORMAT GL_COLOR_INDEX8_EXT -#define SPAN_VARS \ - driRenderbuffer *drb = (driRenderbuffer *) rb; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)drb->Base.Data + (drb->Base.Height - (Y)) * drb->pitch + (X); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - *DST = VALUE[0] -#define FETCH_PIXEL(DST, SRC) \ - DST = SRC[0] - -#include "swrast/s_spantemp.h" - - - -void -fbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) -{ - ASSERT(drb->Base.InternalFormat == GL_RGBA); - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - drb->Base.GetRow = get_row_B5G6R5; - drb->Base.GetValues = get_values_B5G6R5; - drb->Base.PutRow = put_row_B5G6R5; - drb->Base.PutMonoRow = put_mono_row_B5G6R5; - drb->Base.PutRowRGB = put_row_rgb_B5G6R5; - drb->Base.PutValues = put_values_B5G6R5; - drb->Base.PutMonoValues = put_mono_values_B5G6R5; - } - else if (vis->redBits == 5 && vis->greenBits == 5 && vis->blueBits == 5) { - drb->Base.GetRow = get_row_B5G5R5; - drb->Base.GetValues = get_values_B5G5R5; - drb->Base.PutRow = put_row_B5G5R5; - drb->Base.PutMonoRow = put_mono_row_B5G5R5; - drb->Base.PutRowRGB = put_row_rgb_B5G5R5; - drb->Base.PutValues = put_values_B5G5R5; - drb->Base.PutMonoValues = put_mono_values_B5G5R5; - } - else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8 - && vis->alphaBits == 8) { - drb->Base.GetRow = get_row_B8G8R8A8; - drb->Base.GetValues = get_values_B8G8R8A8; - drb->Base.PutRow = put_row_B8G8R8A8; - drb->Base.PutMonoRow = put_mono_row_B8G8R8A8; - drb->Base.PutRowRGB = put_row_rgb_B8G8R8A8; - drb->Base.PutValues = put_values_B8G8R8A8; - drb->Base.PutMonoValues = put_mono_values_B8G8R8A8; - } - else if (vis->redBits == 8 && vis->greenBits == 8 && vis->blueBits == 8 - && vis->alphaBits == 0) { - drb->Base.GetRow = get_row_B8G8R8; - drb->Base.GetValues = get_values_B8G8R8; - drb->Base.PutRow = put_row_B8G8R8; - drb->Base.PutMonoRow = put_mono_row_B8G8R8; - drb->Base.PutRowRGB = put_row_rgb_B8G8R8; - drb->Base.PutValues = put_values_B8G8R8; - drb->Base.PutMonoValues = put_mono_values_B8G8R8; - } - else if (vis->indexBits == 8) { - drb->Base.GetRow = get_row_CI8; - drb->Base.GetValues = get_values_CI8; - drb->Base.PutRow = put_row_CI8; - drb->Base.PutMonoRow = put_mono_row_CI8; - drb->Base.PutValues = put_values_CI8; - drb->Base.PutMonoValues = put_mono_values_CI8; - } - } - else { - /* hardware z/stencil/etc someday */ - } -} - - - -/* Initialize the driver specific screen private data. - */ -static GLboolean -fbInitDriver( __DRIscreen *sPriv ) -{ - sPriv->private = NULL; - return GL_TRUE; -} - -static void -fbDestroyScreen( __DRIscreen *sPriv ) -{ -} - - -/* Create the device specific context. - */ -static GLboolean -fbCreateContext( const __GLcontextModes *glVisual, - __DRIcontext *driContextPriv, - void *sharedContextPrivate) -{ - fbContextPtr fbmesa; - GLcontext *ctx, *shareCtx; - struct dd_function_table functions; - - assert(glVisual); - assert(driContextPriv); - - /* Allocate the Fb context */ - fbmesa = (fbContextPtr) calloc(1, sizeof(*fbmesa) ); - if ( !fbmesa ) - return GL_FALSE; - - /* Init default driver functions then plug in our FBdev-specific functions - */ - _mesa_init_driver_functions(&functions); - init_core_functions(&functions); - - /* Allocate the Mesa context */ - if (sharedContextPrivate) - shareCtx = ((fbContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - - ctx = fbmesa->glCtx = _mesa_create_context(glVisual, shareCtx, - &functions, (void *) fbmesa); - if (!fbmesa->glCtx) { - free(fbmesa); - return GL_FALSE; - } - driContextPriv->driverPrivate = fbmesa; - - /* Create module contexts */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - _swsetup_Wakeup( ctx ); - - - /* use default TCL pipeline */ - { - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.RunPipeline = _tnl_run_pipeline; - } - - _mesa_enable_sw_extensions(ctx); - - return GL_TRUE; -} - - -static void -fbDestroyContext( __DRIcontext *driContextPriv ) -{ - GET_CURRENT_CONTEXT(ctx); - fbContextPtr fbmesa = (fbContextPtr) driContextPriv->driverPrivate; - fbContextPtr current = ctx ? FB_CONTEXT(ctx) : NULL; - - /* check if we're deleting the currently bound context */ - if (fbmesa == current) { - _mesa_make_current(NULL, NULL, NULL); - } - - /* Free fb context resources */ - if ( fbmesa ) { - _swsetup_DestroyContext( fbmesa->glCtx ); - _tnl_DestroyContext( fbmesa->glCtx ); - _vbo_DestroyContext( fbmesa->glCtx ); - _swrast_DestroyContext( fbmesa->glCtx ); - - /* free the Mesa context */ - fbmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context( fbmesa->glCtx ); - - free( fbmesa ); - } -} - - -/* Create and initialize the Mesa and driver specific pixmap buffer - * data. - */ -static GLboolean -fbCreateBuffer( __DRIscreen *driScrnPriv, - __DRIdrawable *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - struct gl_framebuffer *mesa_framebuffer; - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - const GLboolean swDepth = mesaVis->depthBits > 0; - const GLboolean swAlpha = mesaVis->alphaBits > 0; - const GLboolean swAccum = mesaVis->accumRedBits > 0; - const GLboolean swStencil = mesaVis->stencilBits > 0; - - mesa_framebuffer = _mesa_create_framebuffer(mesaVis); - if (!mesa_framebuffer) - return 0; - - /* XXX double-check these parameters (bpp vs cpp, etc) */ - { - driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, - driScrnPriv->pFB, - driScrnPriv->fbBPP / 8, - driScrnPriv->fbOrigin, - driScrnPriv->fbStride, - driDrawPriv); - fbSetSpanFunctions(drb, mesaVis); - _mesa_add_renderbuffer(mesa_framebuffer, - BUFFER_FRONT_LEFT, &drb->Base); - } - if (mesaVis->doubleBufferMode) { - /* XXX what are the correct origin/stride values? */ - GLvoid *backBuf = malloc(driScrnPriv->fbStride - * driScrnPriv->fbHeight); - driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, - backBuf, - driScrnPriv->fbBPP /8, - driScrnPriv->fbOrigin, - driScrnPriv->fbStride, - driDrawPriv); - fbSetSpanFunctions(drb, mesaVis); - _mesa_add_renderbuffer(mesa_framebuffer, - BUFFER_BACK_LEFT, &drb->Base); - } - - _mesa_add_soft_renderbuffers(mesa_framebuffer, - GL_FALSE, /* color */ - swDepth, - swStencil, - swAccum, - swAlpha, /* or always zero? */ - GL_FALSE /* aux */); - - driDrawPriv->driverPrivate = mesa_framebuffer; - - return 1; - } -} - - -static void -fbDestroyBuffer(__DRIdrawable *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - - - -/* If the backbuffer is on a videocard, this is extraordinarily slow! - */ -static void -fbSwapBuffers( __DRIdrawable *dPriv ) -{ - struct gl_framebuffer *mesa_framebuffer = (struct gl_framebuffer *)dPriv->driverPrivate; - struct gl_renderbuffer * front_renderbuffer = mesa_framebuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer; - void *frontBuffer = front_renderbuffer->Data; - int currentPitch = ((driRenderbuffer *)front_renderbuffer)->pitch; - void *backBuffer = mesa_framebuffer->Attachment[BUFFER_BACK_LEFT].Renderbuffer->Data; - - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - fbContextPtr fbmesa = (fbContextPtr) dPriv->driContextPriv->driverPrivate; - GLcontext *ctx = fbmesa->glCtx; - - if (ctx->Visual.doubleBufferMode) { - int i; - int offset = 0; - char *tmp = malloc(currentPitch); - - _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ - - ASSERT(frontBuffer); - ASSERT(backBuffer); - - for (i = 0; i < dPriv->h; i++) { - memcpy(tmp, (char *) backBuffer + offset, currentPitch); - memcpy((char *) frontBuffer + offset, tmp, currentPitch); - offset += currentPitch; - } - - free(tmp); - } - } - else { - /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "fbSwapBuffers: drawable has no context!\n"); - } -} - - -/* Force the context `c' to be the current context and associate with it - * buffer `b'. - */ -static GLboolean -fbMakeCurrent( __DRIcontext *driContextPriv, - __DRIdrawable *driDrawPriv, - __DRIdrawable *driReadPriv ) -{ - if ( driContextPriv ) { - fbContextPtr newFbCtx = - (fbContextPtr) driContextPriv->driverPrivate; - - newFbCtx->dri.drawable = driDrawPriv; - - _mesa_make_current( newFbCtx->glCtx, - driDrawPriv->driverPrivate, - driReadPriv->driverPrivate); - } else { - _mesa_make_current( NULL, NULL, NULL ); - } - - return GL_TRUE; -} - - -/* Force the context `c' to be unbound from its buffer. - */ -static GLboolean -fbUnbindContext( __DRIcontext *driContextPriv ) -{ - return GL_TRUE; -} - -static struct __DriverAPIRec fbAPI = { - .InitDriver = fbInitDriver, - .DestroyScreen = fbDestroyScreen, - .CreateContext = fbCreateContext, - .DestroyContext = fbDestroyContext, - .CreateBuffer = fbCreateBuffer, - .DestroyBuffer = fbDestroyBuffer, - .SwapBuffers = fbSwapBuffers, - .MakeCurrent = fbMakeCurrent, - .UnbindContext = fbUnbindContext, -}; - - - -static int -__driValidateMode(const DRIDriverContext *ctx ) -{ - return 1; -} - -static int -__driInitFBDev( struct DRIDriverContextRec *ctx ) -{ - /* Note that drmOpen will try to load the kernel module, if needed. */ - /* we need a fbdev drm driver - it will only track maps */ - ctx->drmFD = drmOpen("radeon", NULL ); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - ctx->shared.SAREASize = SAREA_MAX; - - if (drmAddMap( ctx->drmFD, - 0, - ctx->shared.SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &ctx->shared.hSAREA) < 0) - { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - ctx->shared.SAREASize, - (unsigned long) ctx->shared.hSAREA); - - if (drmMap( ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - (unsigned long) ctx->shared.hSAREA, ctx->pSAREA, - ctx->shared.SAREASize); - - /* Need to AddMap the framebuffer and mmio regions here: - */ - if (drmAddMap( ctx->drmFD, - (drm_handle_t)ctx->FBStart, - ctx->FBSize, - DRM_FRAME_BUFFER, -#ifndef _EMBEDDED - 0, -#else - DRM_READ_ONLY, -#endif - &ctx->shared.hFrameBuffer) < 0) - { - fprintf(stderr, "[drm] drmAddMap framebuffer failed\n"); - return 0; - } - - fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n", - (unsigned long) ctx->shared.hFrameBuffer); - - return 1; -} - -static void -__driHaltFBDev( struct DRIDriverContextRec *ctx ) -{ -} - -struct DRIDriverRec __driDriver = { - __driValidateMode, - __driValidateMode, - __driInitFBDev, - __driHaltFBDev -}; - -static __GLcontextModes * -fbFillInModes( __DRIscreen *psp, - unsigned pixel_bits, unsigned depth_bits, - unsigned stencil_bits, GLboolean have_back_buffer ) -{ - __GLcontextModes * modes; - __GLcontextModes * m; - unsigned num_modes; - unsigned depth_buffer_factor; - unsigned back_buffer_factor; - GLenum fb_format; - GLenum fb_type; - - /* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy - * enough to add support. Basically, if a context is created with an - * fbconfig where the swap method is GLX_SWAP_COPY_OML, pageflipping - * will never be used. - */ - static const GLenum back_buffer_modes[] = { - GLX_NONE, GLX_SWAP_UNDEFINED_OML /*, GLX_SWAP_COPY_OML */ - }; - - uint8_t depth_bits_array[2]; - uint8_t stencil_bits_array[2]; - - - depth_bits_array[0] = depth_bits; - depth_bits_array[1] = depth_bits; - - /* Just like with the accumulation buffer, always provide some modes - * with a stencil buffer. It will be a sw fallback, but some apps won't - * care about that. - */ - stencil_bits_array[0] = 0; - stencil_bits_array[1] = (stencil_bits == 0) ? 8 : stencil_bits; - - depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 2 : 1; - back_buffer_factor = (have_back_buffer) ? 2 : 1; - - num_modes = depth_buffer_factor * back_buffer_factor * 4; - - if ( pixel_bits == 16 ) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; - } - else { - fb_format = GL_RGBA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } - - modes = (*psp->contextModes->createContextModes)( num_modes, sizeof( __GLcontextModes ) ); - m = modes; - if ( ! driFillInModes( & m, fb_format, fb_type, - depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor, - GLX_TRUE_COLOR ) ) { - fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", - __func__, __LINE__ ); - return NULL; - } - - if ( ! driFillInModes( & m, fb_format, fb_type, - depth_bits_array, stencil_bits_array, depth_buffer_factor, - back_buffer_modes, back_buffer_factor, - GLX_DIRECT_COLOR ) ) { - fprintf( stderr, "[%s:%u] Error creating FBConfig!\n", - __func__, __LINE__ ); - return NULL; - } - - /* Mark the visual as slow if there are "fake" stencil bits. - */ - for ( m = modes ; m != NULL ; m = m->next ) { - if ( (m->stencilBits != 0) && (m->stencilBits != stencil_bits) ) { - m->visualRating = GLX_SLOW_CONFIG; - } - } - - return modes; -} - - -/** - * This is the bootstrap function for the driver. libGL supplies all of the - * requisite information about the system, and the driver initializes itself. - * This routine also fills in the linked list pointed to by \c driver_modes - * with the \c __GLcontextModes that the driver can support for windows or - * pbuffers. - * - * \return A pointer to a \c __DRIscreen on success, or \c NULL on - * failure. - */ -PUBLIC -void * __driCreateNewScreen( __DRInativeDisplay *dpy, int scrn, __DRIscreen *psc, - const __GLcontextModes * modes, - const __DRIversion * ddx_version, - const __DRIversion * dri_version, - const __DRIversion * drm_version, - const __DRIframebuffer * frame_buffer, - drmAddress pSAREA, int fd, - int internal_api_version, - __GLcontextModes ** driver_modes ) -{ - __DRIscreen *psp; - static const __DRIversion ddx_expected = { 4, 0, 0 }; - static const __DRIversion dri_expected = { 4, 0, 0 }; - static const __DRIversion drm_expected = { 1, 5, 0 }; - - - if ( ! driCheckDriDdxDrmVersions2( "fb", - dri_version, & dri_expected, - ddx_version, & ddx_expected, - drm_version, & drm_expected ) ) { - return NULL; - } - - psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL, - ddx_version, dri_version, drm_version, - frame_buffer, pSAREA, fd, - internal_api_version, &fbAPI); - if ( psp != NULL ) { - *driver_modes = fbFillInModes( psp, psp->fbBPP, - (psp->fbBPP == 16) ? 16 : 24, - (psp->fbBPP == 16) ? 0 : 8, - 1); - } - - return (void *) psp; -} - -/* This is the table of extensions that the loader will dlsym() for. */ -PUBLIC const __DRIextension *__driDriverExtensions[] = { - &driCoreExtension.base, - &driLegacyExtension.base, - NULL -}; diff --git a/src/mesa/drivers/dri/ffb/Makefile b/src/mesa/drivers/dri/ffb/Makefile deleted file mode 100644 index e9da8f9066..0000000000 --- a/src/mesa/drivers/dri/ffb/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# src/mesa/drivers/dri/ffb/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = ffb_dri.so - -# not yet -# MINIGLX_SOURCES = server/ffb_dri.c - -DRIVER_SOURCES = \ - ffb_bitmap.c \ - ffb_clear.c \ - ffb_dd.c \ - ffb_depth.c \ - ffb_fog.c \ - ffb_lines.c \ - ffb_points.c \ - ffb_span.c \ - ffb_state.c \ - ffb_stencil.c \ - ffb_tex.c \ - ffb_tris.c \ - ffb_vb.c \ - ffb_xmesa.c - -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) - - -ASM_SOURCES = - -include ../Makefile.template - diff --git a/src/mesa/drivers/dri/ffb/ffb_bitmap.c b/src/mesa/drivers/dri/ffb/ffb_bitmap.c deleted file mode 100644 index b71a552c9d..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_bitmap.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "ffb_context.h" -#include "ffb_state.h" -#include "ffb_lock.h" -#include "ffb_bitmap.h" -#include "swrast/swrast.h" -#include "main/macros.h" - -/* Compute ceiling of integer quotient of A divided by B: */ -#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) - -#undef FFB_BITMAP_TRACE - -static void -ffb_bitmap(GLcontext *ctx, GLint px, GLint py, - GLsizei width, GLsizei height, - const struct gl_pixelstore_attrib *unpack, - const GLubyte *bitmap) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_fbcPtr ffb = fmesa->regs; - __DRIdrawable *dPriv = fmesa->driDrawable; - unsigned int ppc, pixel; - GLint row, col, row_stride; - const GLubyte *src; - char *buf; - - if (fmesa->bad_fragment_attrs != 0) - _swrast_Bitmap(ctx, px, py, width, - height, unpack, bitmap); - - pixel = (((((GLuint)(ctx->Current.RasterColor[0] * 255.0f)) & 0xff) << 0) | - ((((GLuint)(ctx->Current.RasterColor[1] * 255.0f)) & 0xff) << 8) | - ((((GLuint)(ctx->Current.RasterColor[2] * 255.0f)) & 0xff) << 16) | - ((((GLuint)(ctx->Current.RasterColor[3] * 255.0f)) & 0xff) << 24)); - -#ifdef FFB_BITMAP_TRACE - fprintf(stderr, "ffb_bitmap: ppc(%08x) fbc(%08x) cmp(%08x) pixel(%08x)\n", - fmesa->ppc, fmesa->fbc, fmesa->cmp, pixel); -#endif - - LOCK_HARDWARE(fmesa); - fmesa->hw_locked = 1; - - if (fmesa->state_dirty) - ffbSyncHardware(fmesa); - - ppc = fmesa->ppc; - - FFBFifo(fmesa, 4); - ffb->ppc = ((ppc & - ~(FFB_PPC_TBE_MASK | FFB_PPC_ZS_MASK | FFB_PPC_CS_MASK | FFB_PPC_XS_MASK)) - | (FFB_PPC_TBE_TRANSPARENT | FFB_PPC_ZS_CONST | FFB_PPC_CS_CONST | - (ctx->Color.BlendEnabled ? FFB_PPC_XS_CONST : FFB_PPC_XS_WID))); - ffb->constz = ((GLuint) (ctx->Current.RasterPos[2] * 0x0fffffff)); - ffb->fg = pixel; - ffb->fontinc = (0 << 16) | 32; - - buf = (char *)(fmesa->sfb32 + (dPriv->x << 2) + (dPriv->y << 13)); - - row_stride = (unpack->Alignment * CEILING(width, 8 * unpack->Alignment)); - src = (const GLubyte *) (bitmap + - (unpack->SkipRows * row_stride) + - (unpack->SkipPixels / 8)); - if (unpack->LsbFirst == GL_TRUE) { - for (row = 0; row < height; row++, src += row_stride) { - const GLubyte *row_src = src; - GLuint base_x, base_y; - - base_x = dPriv->x + px; - base_y = dPriv->y + (dPriv->h - (py + row)); - - FFBFifo(fmesa, 1); - ffb->fontxy = (base_y << 16) | base_x; - - for (col = 0; col < width; col += 32, row_src += 4) { - GLint bitnum, font_w = (width - col); - GLuint font_data; - - if (font_w > 32) - font_w = 32; - font_data = 0; - for (bitnum = 0; bitnum < 32; bitnum++) { - const GLubyte val = row_src[bitnum >> 3]; - - if (val & (1 << (bitnum & (8 - 1)))) - font_data |= (1 << (31 - bitnum)); - } - - FFBFifo(fmesa, 2); - ffb->fontw = font_w; - ffb->font = font_data; - } - } - } else { - for (row = 0; row < height; row++, src += row_stride) { - const GLubyte *row_src = src; - GLuint base_x, base_y; - - base_x = dPriv->x + px; - base_y = dPriv->y + (dPriv->h - (py + row)); - - FFBFifo(fmesa, 1); - ffb->fontxy = (base_y << 16) | base_x; - - for (col = 0; col < width; col += 32, row_src += 4) { - GLint font_w = (width - col); - - if (font_w > 32) - font_w = 32; - FFBFifo(fmesa, 2); - ffb->fontw = font_w; - ffb->font = (((unsigned int)row_src[0]) << 24 | - ((unsigned int)row_src[1]) << 16 | - ((unsigned int)row_src[2]) << 8 | - ((unsigned int)row_src[3]) << 0); - } - } - } - - FFBFifo(fmesa, 1); - ffb->ppc = ppc; - fmesa->ffbScreen->rp_active = 1; - - UNLOCK_HARDWARE(fmesa); - fmesa->hw_locked = 0; -} - -void ffbDDInitBitmapFuncs(GLcontext *ctx) -{ - ctx->Driver.Bitmap = ffb_bitmap; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_bitmap.h b/src/mesa/drivers/dri/ffb/ffb_bitmap.h deleted file mode 100644 index 0ccbc57bd0..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_bitmap.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef _FFB_BITMAP_H -#define _FFB_BITMAP_H - -extern void ffbDDInitBitmapFuncs(GLcontext *); - -#endif /* !(_FFB_BITMAP_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c deleted file mode 100644 index aa3fa0a86c..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_clear.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" - -#include "main/mm.h" -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_context.h" -#include "ffb_vb.h" -#include "ffb_clear.h" -#include "ffb_lock.h" - -#undef CLEAR_TRACE - -#define BOX_AREA(__w, __h) ((int)(__w) * (int)(__h)) - -/* Compute the page aligned box for a page mode fast fill. - * In 'ework' this returns greater than zero if there are some odd - * edges to take care of which are outside of the page aligned area. - * It will place less than zero there if the box is too small, - * indicating that a different method must be used to fill it. - */ -#define CreatorPageFillParms(ffp, x, y, w, h, px, py, pw, ph, ework) \ -do { int xdiff, ydiff; \ - int pf_bh = ffp->pagefill_height; \ - int pf_bw = ffp->pagefill_width; \ - py = ((y + (pf_bh - 1)) & ~(pf_bh - 1)); \ - ydiff = py - y; \ - px = ffp->Pf_AlignTab[x + (pf_bw - 1)]; \ - xdiff = px - x; \ - ph = ((h - ydiff) & ~(pf_bh - 1)); \ - if(ph <= 0) \ - ework = -1; \ - else { \ - pw = ffp->Pf_AlignTab[w - xdiff]; \ - if(pw <= 0) { \ - ework = -1; \ - } else { \ - ework = (((xdiff > 0) || \ - (ydiff > 0) || \ - ((w - pw) > 0) || \ - ((h - ph) > 0))) ? 1 : 0; \ - } \ - } \ -} while(0); - -struct ff_fixups { - int x, y, width, height; -}; - -/* Compute fixups of non-page aligned areas after a page fill. - * Return the number of fixups needed. - */ -static INLINE int -CreatorComputePageFillFixups(struct ff_fixups *fixups, - int x, int y, int w, int h, - int paligned_x, int paligned_y, - int paligned_w, int paligned_h) -{ - int nfixups = 0; - - /* FastFill Left */ - if(paligned_x != x) { - fixups[nfixups].x = x; - fixups[nfixups].y = paligned_y; - fixups[nfixups].width = paligned_x - x; - fixups[nfixups].height = paligned_h; - nfixups++; - } - /* FastFill Top */ - if(paligned_y != y) { - fixups[nfixups].x = x; - fixups[nfixups].y = y; - fixups[nfixups].width = w; - fixups[nfixups].height = paligned_y - y; - nfixups++; - } - /* FastFill Right */ - if((x+w) != (paligned_x+paligned_w)) { - fixups[nfixups].x = (paligned_x+paligned_w); - fixups[nfixups].y = paligned_y; - fixups[nfixups].width = (x+w) - fixups[nfixups].x; - fixups[nfixups].height = paligned_h; - nfixups++; - } - /* FastFill Bottom */ - if((y+h) != (paligned_y+paligned_h)) { - fixups[nfixups].x = x; - fixups[nfixups].y = (paligned_y+paligned_h); - fixups[nfixups].width = w; - fixups[nfixups].height = (y+h) - fixups[nfixups].y; - nfixups++; - } - return nfixups; -} - -static void -ffb_do_clear(GLcontext *ctx, __DRIdrawable *dPriv) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - FFBDRIPtr gDRIPriv = (FFBDRIPtr) fmesa->driScreen->pDevPriv; - ffb_fbcPtr ffb = fmesa->regs; - drm_clip_rect_t *box = dPriv->pClipRects; - int nc = dPriv->numClipRects; - GLint cx, cy, cw, ch; - - /* compute region after locking: */ - cx = ctx->DrawBuffer->_Xmin; - cy = ctx->DrawBuffer->_Ymin; - cw = ctx->DrawBuffer->_Xmax - cx; - ch = ctx->DrawBuffer->_Ymax - cy; - - cy = dPriv->h - cy - ch; - cx += dPriv->x; - cy += dPriv->y; - - while (nc--) { - GLint x = box[nc].x1; - GLint y = box[nc].y1; - GLint width = box[nc].x2 - x; - GLint height = box[nc].y2 - y; - int paligned_y, paligned_x; - int paligned_h, paligned_w = 0; - int extra_work; - - if (BOX_AREA(width, height) < gDRIPriv->fastfill_small_area) { - FFBFifo(fmesa, 5); - ffb->drawop = FFB_DRAWOP_RECTANGLE; - ffb->by = y; - ffb->bx = x; - ffb->bh = height; - ffb->bw = width; - continue; - } - - FFBFifo(fmesa, 1); - ffb->drawop = FFB_DRAWOP_FASTFILL; - - if (gDRIPriv->disable_pagefill || - (width < (gDRIPriv->pagefill_width<<1)) || - (height < (gDRIPriv->pagefill_height<<1))) - goto do_fastfill; - - CreatorPageFillParms(gDRIPriv, - x, y, width, height, - paligned_x, paligned_y, - paligned_w, paligned_h, extra_work); - - if (extra_work < 0 || - BOX_AREA(paligned_w, paligned_h) < gDRIPriv->pagefill_small_area) { - do_fastfill: - FFBFifo(fmesa, 10); - ffb->by = FFB_FASTFILL_COLOR_BLK; - ffb->dy = 0; - ffb->dx = 0; - ffb->bh = gDRIPriv->fastfill_height; - ffb->bw = (gDRIPriv->fastfill_width * 4); - ffb->by = FFB_FASTFILL_BLOCK; - ffb->dy = y; - ffb->dx = x; - ffb->bh = (height + (y & (gDRIPriv->fastfill_height - 1))); - ffb->bx = (width + (x & (gDRIPriv->fastfill_width - 1))); - continue; - } - - /* Ok, page fill is possible and worth it. */ - FFBFifo(fmesa, 15); - ffb->by = FFB_FASTFILL_COLOR_BLK; - ffb->dy = 0; - ffb->dx = 0; - ffb->bh = gDRIPriv->fastfill_height; - ffb->bw = gDRIPriv->fastfill_width * 4; - ffb->by = FFB_FASTFILL_BLOCK_X; - ffb->dy = 0; - ffb->dx = 0; - ffb->bh = gDRIPriv->pagefill_height; - ffb->bw = gDRIPriv->pagefill_width * 4; - ffb->by = FFB_FASTFILL_PAGE; - ffb->dy = paligned_y; - ffb->dx = paligned_x; - ffb->bh = paligned_h; - ffb->bx = paligned_w; - - if (extra_work) { - struct ff_fixups local_fixups[4]; - int nfixups; - - nfixups = CreatorComputePageFillFixups(local_fixups, - x, y, width, height, - paligned_x, paligned_y, - paligned_w, paligned_h); - FFBFifo(fmesa, 5 + (nfixups * 5)); - ffb->by = FFB_FASTFILL_COLOR_BLK; - ffb->dy = 0; - ffb->dx = 0; - ffb->bh = gDRIPriv->fastfill_height; - ffb->bw = gDRIPriv->fastfill_width * 4; - - while (--nfixups >= 0) { - int xx, yy, ww, hh; - - xx = local_fixups[nfixups].x; - yy = local_fixups[nfixups].y; - ffb->dy = yy; - ffb->dx = xx; - ww = (local_fixups[nfixups].width + - (xx & (gDRIPriv->fastfill_width - 1))); - hh = (local_fixups[nfixups].height + - (yy & (gDRIPriv->fastfill_height - 1))); - if (nfixups != 0) { - ffb->by = FFB_FASTFILL_BLOCK; - ffb->bh = hh; - ffb->bw = ww; - } else { - ffb->bh = hh; - ffb->by = FFB_FASTFILL_BLOCK; - ffb->bx = ww; - } - } - } - } -} - -void ffbDDClear(GLcontext *ctx, GLbitfield mask) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - unsigned int stcmask = BUFFER_BIT_STENCIL; - -#ifdef CLEAR_TRACE - fprintf(stderr, "ffbDDClear: mask(%08x) \n", mask); -#endif - if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)) - stcmask = 0; - - if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | BUFFER_BIT_DEPTH | stcmask)) { - ffb_fbcPtr ffb = fmesa->regs; - unsigned int fbc, ppc; - - fbc = (FFB_FBC_XE_ON); - ppc = (FFB_PPC_ACE_DISABLE | FFB_PPC_DCE_DISABLE | - FFB_PPC_ABE_DISABLE | FFB_PPC_VCE_DISABLE | - FFB_PPC_APE_DISABLE | FFB_PPC_XS_WID | - FFB_PPC_ZS_CONST | FFB_PPC_CS_CONST); - - /* Y/X enables must be both on or both off. */ - if (mask & (BUFFER_BIT_DEPTH | stcmask)) { - fbc |= (FFB_FBC_ZE_ON | FFB_FBC_YE_ON | FFB_FBC_WB_C); - } else - fbc |= FFB_FBC_ZE_OFF | FFB_FBC_YE_OFF; - - /* All RGB enables must be both on or both off. */ - if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) { - if (mask & BUFFER_BIT_FRONT_LEFT) { - if (fmesa->back_buffer == 0) - fbc |= FFB_FBC_WB_B; - else - fbc |= FFB_FBC_WB_A; - } - if (mask & BUFFER_BIT_BACK_LEFT) { - if (fmesa->back_buffer == 0) - fbc |= FFB_FBC_WB_A; - else - fbc |= FFB_FBC_WB_B; - } - fbc |= FFB_FBC_RGBE_ON; - } else - fbc |= FFB_FBC_RGBE_OFF; - - LOCK_HARDWARE(fmesa); - - if (dPriv->numClipRects) { - FFBFifo(fmesa, 8); - ffb->fbc = fbc; - ffb->ppc = ppc; - ffb->xclip = FFB_XCLIP_TEST_ALWAYS; - ffb->cmp = 0x80808080; - ffb->rop = FFB_ROP_NEW; - - if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) - ffb->fg = fmesa->clear_pixel; - if (mask & BUFFER_BIT_DEPTH) - ffb->constz = fmesa->clear_depth; - if (mask & stcmask) - ffb->consty = fmesa->clear_stencil; - - ffb_do_clear(ctx, dPriv); - - FFBFifo(fmesa, 6); - ffb->ppc = fmesa->ppc; - ffb->fbc = fmesa->fbc; - ffb->xclip = fmesa->xclip; - ffb->cmp = fmesa->cmp; - ffb->rop = fmesa->rop; - ffb->drawop = fmesa->drawop; - if (mask & stcmask) - ffb->consty = fmesa->consty; - fmesa->ffbScreen->rp_active = 1; - } - - UNLOCK_HARDWARE(fmesa); - - mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | - BUFFER_BIT_DEPTH | stcmask); - } - - if (mask) - _swrast_Clear(ctx, mask); -} - diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.h b/src/mesa/drivers/dri/ffb/ffb_clear.h deleted file mode 100644 index c3b8ce714b..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_clear.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _FFB_CLEAR_H -#define _FFB_CLEAR_H - -extern void ffbDDClear(GLcontext *ctx, GLbitfield mask); - -#endif /* !(_FFB_CLEAR_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_context.h b/src/mesa/drivers/dri/ffb/ffb_context.h deleted file mode 100644 index 4d1d53ff59..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_context.h +++ /dev/null @@ -1,305 +0,0 @@ - -#ifndef _FFB_CONTEXT_H -#define _FFB_CONTEXT_H - -#include "dri_util.h" -#include "drm.h" - -#include "main/mtypes.h" - -#include "ffb_xmesa.h" - -typedef struct { - GLfloat alpha; - GLfloat red; - GLfloat green; - GLfloat blue; -} ffb_color; - -#define FFB_GET_ALPHA(VTX) \ - FFB_COLOR_FROM_FLOAT((VTX)->color[0].alpha) -#define FFB_GET_RED(VTX) \ - FFB_COLOR_FROM_FLOAT((VTX)->color[0].red) -#define FFB_GET_GREEN(VTX) \ - FFB_COLOR_FROM_FLOAT((VTX)->color[0].green) -#define FFB_GET_BLUE(VTX) \ - FFB_COLOR_FROM_FLOAT((VTX)->color[0].blue) - -typedef struct { - GLfloat x, y, z; - ffb_color color[2]; -} ffb_vertex; - -#define FFB_DELAYED_VIEWPORT_VARS \ - GLfloat VP_SX = fmesa->hw_viewport[MAT_SX]; \ - GLfloat VP_TX = fmesa->hw_viewport[MAT_TX]; \ - GLfloat VP_SY = fmesa->hw_viewport[MAT_SY]; \ - GLfloat VP_TY = fmesa->hw_viewport[MAT_TY]; \ - GLfloat VP_SZ = fmesa->hw_viewport[MAT_SZ]; \ - GLfloat VP_TZ = fmesa->hw_viewport[MAT_TZ]; \ - (void) VP_SX; (void) VP_SY; (void) VP_SZ; \ - (void) VP_TX; (void) VP_TY; (void) VP_TZ - -#define FFB_GET_Z(VTX) \ - FFB_Z_FROM_FLOAT(VP_SZ * (VTX)->z + VP_TZ) -#define FFB_GET_Y(VTX) \ - FFB_XY_FROM_FLOAT(VP_SY * (VTX)->y + VP_TY) -#define FFB_GET_X(VTX) \ - FFB_XY_FROM_FLOAT(VP_SX * (VTX)->x + VP_TX) - -typedef void (*ffb_point_func)(GLcontext *, ffb_vertex *); -typedef void (*ffb_line_func)(GLcontext *, ffb_vertex *, ffb_vertex *); -typedef void (*ffb_tri_func)(GLcontext *, ffb_vertex *, ffb_vertex *, - ffb_vertex *); -typedef void (*ffb_quad_func)(GLcontext *, ffb_vertex *, ffb_vertex *, - ffb_vertex *, ffb_vertex *); - -/* Immediate mode fast-path support. */ -typedef struct { - GLfloat obj[4]; - GLfloat normal[4]; - GLfloat clip[4]; - GLuint mask; - GLfloat color[4]; - GLfloat win[4]; - GLfloat eye[4]; -} ffbTnlVertex, *ffbTnlVertexPtr; - -typedef void (*ffb_interp_func)(GLfloat t, - ffbTnlVertex *O, - const ffbTnlVertex *I, - const ffbTnlVertex *J); - -struct ffb_current_state { - GLfloat color[4]; - GLfloat normal[4]; - GLfloat specular[4]; -}; - -struct ffb_light_state { - GLfloat base_color[3]; - GLfloat base_alpha; -}; - -struct ffb_vertex_state { - struct ffb_current_state current; - struct ffb_light_state light; -}; - -struct ffb_imm_vertex { - ffbTnlVertex vertices[8]; - ffbTnlVertex *v0; - ffbTnlVertex *v1; - ffbTnlVertex *v2; - ffbTnlVertex *v3; - - void (*save_vertex)(GLcontext *ctx, ffbTnlVertex *v); - void (*flush_vertex)(GLcontext *ctx, ffbTnlVertex *v); - - ffb_interp_func interp; - - GLuint prim, format; - - GLvertexformat vtxfmt; -}; - -typedef struct ffb_context_t { - GLcontext *glCtx; - GLframebuffer *glBuffer; - - ffb_fbcPtr regs; - volatile char *sfb32; - - int hw_locked; - - int back_buffer; /* 0 = bufferA, 1 = bufferB */ - - /* Viewport matrix. */ - GLfloat hw_viewport[16]; -#define SUBPIXEL_X (-0.5F) -#define SUBPIXEL_Y (-0.5F + 0.125) - - /* Vertices in driver format. */ - ffb_vertex *verts; - - /* Rasterization functions. */ - ffb_point_func draw_point; - ffb_line_func draw_line; - ffb_tri_func draw_tri; - ffb_quad_func draw_quad; - - GLenum raster_primitive; - GLenum render_primitive; - - GLfloat backface_sign; - GLfloat depth_scale; - - GLfloat ffb_2_30_fixed_scale; - GLfloat ffb_one_over_2_30_fixed_scale; - GLfloat ffb_16_16_fixed_scale; - GLfloat ffb_one_over_16_16_fixed_scale; - GLfloat ffb_ubyte_color_scale; - GLfloat ffb_zero; - - /* Immediate mode state. */ - struct ffb_vertex_state vtx_state; - struct ffb_imm_vertex imm; - - /* Debugging knobs. */ - GLboolean debugFallbacks; - - /* This records state bits when a per-fragment attribute has - * been set which prevents us from rendering in hardware. - * - * As attributes change, some of these bits may clear as - * we move back within the chips capabilities. If they - * all clear, we return to full hw rendering. - */ - unsigned int bad_fragment_attrs; -#define FFB_BADATTR_FOG 0x00000001 /* Bad fog possible only when < FFB2 */ -#define FFB_BADATTR_BLENDFUNC 0x00000002 /* Any non-const func based upon dst alpha */ -#define FFB_BADATTR_BLENDROP 0x00000004 /* Blend enabled and LogicOP != GL_COPY */ -#define FFB_BADATTR_BLENDEQN 0x00000008 /* Blend equation other than ADD */ -#define FFB_BADATTR_STENCIL 0x00000010 /* Stencil enabled when < FFB2+ */ -#define FFB_BADATTR_TEXTURE 0x00000020 /* Texture enabled */ -#define FFB_BADATTR_SWONLY 0x00000040 /* Environment var set */ - - unsigned int state_dirty; - unsigned int state_fifo_ents; -#define FFB_STATE_FBC 0x00000001 -#define FFB_STATE_PPC 0x00000002 -#define FFB_STATE_DRAWOP 0x00000004 -#define FFB_STATE_ROP 0x00000008 -#define FFB_STATE_LPAT 0x00000010 -#define FFB_STATE_PMASK 0x00000020 -#define FFB_STATE_XPMASK 0x00000040 -#define FFB_STATE_YPMASK 0x00000080 -#define FFB_STATE_ZPMASK 0x00000100 -#define FFB_STATE_XCLIP 0x00000200 -#define FFB_STATE_CMP 0x00000400 -#define FFB_STATE_MATCHAB 0x00000800 -#define FFB_STATE_MAGNAB 0x00001000 -#define FFB_STATE_MATCHC 0x00002000 -#define FFB_STATE_MAGNC 0x00004000 -#define FFB_STATE_DCUE 0x00008000 -#define FFB_STATE_BLEND 0x00010000 -#define FFB_STATE_CLIP 0x00020000 -#define FFB_STATE_STENCIL 0x00040000 -#define FFB_STATE_APAT 0x00080000 -#define FFB_STATE_WID 0x00100000 -#define FFB_STATE_ALL 0x001fffff - - unsigned int state_all_fifo_ents; - -#define FFB_MAKE_DIRTY(FMESA, STATE_MASK, FIFO_ENTS) \ -do { if ((STATE_MASK) & ~((FMESA)->state_dirty)) { \ - (FMESA)->state_dirty |= (STATE_MASK); \ - (FMESA)->state_fifo_ents += FIFO_ENTS; \ - } \ -} while (0) - - /* General hw reg state. */ - unsigned int fbc; - unsigned int ppc; - unsigned int drawop; - unsigned int rop; - - unsigned int lpat; -#define FFB_LPAT_BAD 0xffffffff - - unsigned int wid; - unsigned int pmask; - unsigned int xpmask; - unsigned int ypmask; - unsigned int zpmask; - unsigned int xclip; - unsigned int cmp; - unsigned int matchab; - unsigned int magnab; - unsigned int matchc; - unsigned int magnc; - - /* Depth cue unit hw reg state. */ - unsigned int dcss; /* All FFB */ - unsigned int dcsf; /* All FFB */ - unsigned int dcsb; /* All FFB */ - unsigned int dczf; /* All FFB */ - unsigned int dczb; /* All FFB */ - unsigned int dcss1; /* >=FFB2 only */ - unsigned int dcss2; /* >=FFB2 only */ - unsigned int dcss3; /* >=FFB2 only */ - unsigned int dcs2; /* >=FFB2 only */ - unsigned int dcs3; /* >=FFB2 only */ - unsigned int dcs4; /* >=FFB2 only */ - unsigned int dcd2; /* >=FFB2 only */ - unsigned int dcd3; /* >=FFB2 only */ - unsigned int dcd4; /* >=FFB2 only */ - - /* Blend unit hw reg state. */ - unsigned int blendc; - unsigned int blendc1; - unsigned int blendc2; - - /* ViewPort clipping hw reg state. */ - unsigned int vclipmin; - unsigned int vclipmax; - unsigned int vclipzmin; - unsigned int vclipzmax; - struct { - unsigned int min; - unsigned int max; - } aux_clips[4]; - - /* Stencil control hw reg state. >=FFB2+ only. */ - unsigned int stencil; - unsigned int stencilctl; - unsigned int consty; /* Stencil Ref */ - - /* Area pattern (used for polygon stipples). */ - unsigned int pattern[32]; - - /* Fog state. */ - float Znear, Zfar; - - drm_context_t hHWContext; - drm_hw_lock_t *driHwLock; - int driFd; - - unsigned int clear_pixel; - unsigned int clear_depth; - unsigned int clear_stencil; - - unsigned int setupindex; - unsigned int setupnewinputs; - unsigned int new_gl_state; - - __DRIdrawable *driDrawable; - __DRIscreen *driScreen; - ffbScreenPrivate *ffbScreen; - ffb_dri_state_t *ffb_sarea; -} ffbContextRec, *ffbContextPtr; - -#define FFB_CONTEXT(ctx) ((ffbContextPtr)((ctx)->DriverCtx)) - -/* We want the depth values written during software rendering - * to match what the hardware is going to put there when we - * hw render. - * - * The Z buffer is 28 bits deep. Smooth shaded primitives - * specify a 2:30 signed fixed point Z value in the range 0.0 - * to 1.0 inclusive. - * - * So for example, when hw rendering, the largest Z value of - * 1.0 would produce a value of 0x0fffffff in the actual Z - * buffer, which is the maximum value. - * - * Mesa's depth type is a 32-bit uint, so we use the following macro - * to convert to/from FFB hw Z values. Note we also have to clear - * out the top bits as that is where the Y (stencil) buffer is stored - * and during hw Z buffer reads it is always there. (During writes - * we tell the hw to discard those top 4 bits). - */ -#define Z_TO_MESA(VAL) ((GLuint)(((VAL) & 0x0fffffff) << (32 - 28))) -#define Z_FROM_MESA(VAL) (((GLuint)((GLdouble)(VAL))) >> (32 - 28)) - -#endif /* !(_FFB_CONTEXT_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_dd.c b/src/mesa/drivers/dri/ffb/ffb_dd.c deleted file mode 100644 index 91b6d3153a..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_dd.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000, 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" -#include "main/mm.h" -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_context.h" -#include "ffb_clear.h" -#include "ffb_lock.h" - -#define FFB_DATE "20021125" - -PUBLIC const char __driConfigOptions[] = { 0 }; -const GLuint __driNConfigOptions = 0; - -/* Mesa's Driver Functions */ - -static const GLubyte *ffbDDGetString(GLcontext *ctx, GLenum name) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - static char buffer[128]; - - switch (name) { - case GL_VENDOR: - return (GLubyte *) "David S. Miller"; - - case GL_RENDERER: - sprintf(buffer, "Mesa DRI FFB " FFB_DATE); - - if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2) - strncat(buffer, " FFB2", 5); - if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS) - strncat(buffer, " FFB2PLUS", 9); - if (fmesa->ffb_sarea->flags & FFB_DRI_PAC1) - strncat(buffer, " PAC1", 5); - if (fmesa->ffb_sarea->flags & FFB_DRI_PAC2) - strncat(buffer, " PAC2", 5); - -#ifdef USE_SPARC_ASM - strncat(buffer, " Sparc", 6); -#endif - - return (GLubyte *) buffer; - - default: - return NULL; - }; -} - - -static void ffbBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) -{ - GET_CURRENT_CONTEXT(ctx); - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - LOCK_HARDWARE(fmesa); - *width = fmesa->driDrawable->w; - *height = fmesa->driDrawable->h; - UNLOCK_HARDWARE(fmesa); -} - -void ffbDDExtensionsInit(GLcontext *ctx) -{ - /* Nothing for now until we start to add - * real acceleration. -DaveM - */ - - /* XXX Need to turn off GL_EXT_blend_func_separate for one. - * XXX Also BlendEquation should be turned off too, what - * XXX EXT is that assosciated with? - */ -} - -static void ffbDDFinish(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - LOCK_HARDWARE(fmesa); - FFBWait(fmesa, fmesa->regs); - UNLOCK_HARDWARE(fmesa); -} - -void ffbDDInitDriverFuncs(GLcontext *ctx) -{ - ctx->Driver.GetBufferSize = ffbBufferSize; - ctx->Driver.GetString = ffbDDGetString; - ctx->Driver.Clear = ffbDDClear; - - ctx->Driver.Finish = ffbDDFinish; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_dd.h b/src/mesa/drivers/dri/ffb/ffb_dd.h deleted file mode 100644 index 1198cda30a..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_dd.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D. - * Copyright (C) 2000 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#ifndef _FFB_DD_H -#define _FFB_DD_H - -#include "main/context.h" - -void ffbDDInitDriverFuncs(GLcontext *ctx); -void ffbDDExtensionsInit(GLcontext *ctx); - -#endif /* !(_FFB_DD_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_depth.c b/src/mesa/drivers/dri/ffb/ffb_depth.c deleted file mode 100644 index d19385b776..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_depth.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_context.h" -#include "ffb_depth.h" -#include "ffb_lock.h" - - -#undef DEPTH_TRACE - -static void FFBWriteDepthSpan( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, - const GLubyte mask[] ) -{ - const GLuint *depth = (const GLuint *) values; -#ifdef DEPTH_TRACE - fprintf(stderr, "FFBWriteDepthSpan: n(%d) x(%d) y(%d)\n", - (int) n, x, y); -#endif - if (ctx->Depth.Mask) { - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - GLuint *zptr; - GLuint i; - - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 2); - fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_ON | - FFB_FBC_YE_OFF | FFB_FBC_RGBE_OFF); - fmesa->regs->ppc = FFB_PPC_ZS_VAR; - FFBWait(fmesa, fmesa->regs); - - y = (dPriv->h - y); - zptr = (GLuint *) - ((char *)fmesa->sfb32 + - ((dPriv->x + x) << 2) + - ((dPriv->y + y) << 13)); - - for (i = 0; i < n; i++) { - if (mask[i]) { - *zptr = Z_FROM_MESA(depth[i]); - } - zptr++; - } - - FFBFifo(fmesa, 2); - fmesa->regs->fbc = fmesa->fbc; - fmesa->regs->ppc = fmesa->ppc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); - } -} - -static void FFBWriteMonoDepthSpan( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *value, const GLubyte mask[] ) -{ - const GLuint depthVal = *((GLuint *) value); - GLuint depths[MAX_WIDTH]; - GLuint i; - for (i = 0; i < n; i++) - depths[i] = depthVal; - FFBWriteDepthSpan(ctx, rb, n, x, y, depths, mask); -} - -static void FFBWriteDepthPixels( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], - const GLint y[], - const void *values, - const GLubyte mask[] ) -{ - const GLuint *depth = (const GLuint *) values; -#ifdef DEPTH_TRACE - fprintf(stderr, "FFBWriteDepthPixels: n(%d)\n", (int) n); -#endif - if (ctx->Depth.Mask) { - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - char *zbase; - GLuint i; - - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 2); - fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_ON | - FFB_FBC_YE_OFF | FFB_FBC_RGBE_OFF); - fmesa->regs->ppc = FFB_PPC_ZS_VAR; - fmesa->ffbScreen->rp_active = 1; - FFBWait(fmesa, fmesa->regs); - - zbase = ((char *)fmesa->sfb32 + - (dPriv->x << 2) + (dPriv->y << 13)); - - for (i = 0; i < n; i++) { - GLint y1 = (dPriv->h - y[i]); - GLint x1 = x[i]; - GLuint *zptr; - - zptr = (GLuint *) - (zbase + (x1 << 2) + (y1 << 13)); - if (mask[i]) - *zptr = Z_FROM_MESA(depth[i]); - } - - FFBFifo(fmesa, 2); - fmesa->regs->fbc = fmesa->fbc; - fmesa->regs->ppc = fmesa->ppc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); - } -} - -static void FFBReadDepthSpan( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - void *values ) -{ - GLuint *depth = (GLuint *) values; - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - GLuint *zptr; - GLuint i; - -#ifdef DEPTH_TRACE - fprintf(stderr, "FFBReadDepthSpan: n(%d) x(%d) y(%d)\n", - (int) n, x, y); -#endif - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 1); - fmesa->regs->fbc = FFB_FBC_RB_C; - fmesa->ffbScreen->rp_active = 1; - FFBWait(fmesa, fmesa->regs); - - y = (dPriv->h - y); - zptr = (GLuint *) - ((char *)fmesa->sfb32 + - ((dPriv->x + x) << 2) + - ((dPriv->y + y) << 13)); - - for (i = 0; i < n; i++) { - depth[i] = Z_TO_MESA(*zptr); - zptr++; - } - - FFBFifo(fmesa, 1); - fmesa->regs->fbc = fmesa->fbc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); -} - -static void FFBReadDepthPixels( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - void *values ) -{ - GLuint *depth = (GLuint *) values; - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - char *zbase; - GLuint i; - -#ifdef DEPTH_TRACE - fprintf(stderr, "FFBReadDepthPixels: n(%d)\n", (int) n); -#endif - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 1); - fmesa->regs->fbc = FFB_FBC_RB_C; - fmesa->ffbScreen->rp_active = 1; - FFBWait(fmesa, fmesa->regs); - - zbase = ((char *)fmesa->sfb32 + - (dPriv->x << 2) + (dPriv->y << 13)); - - for (i = 0; i < n; i++) { - GLint y1 = (dPriv->h - y[i]); - GLint x1 = x[i]; - GLuint *zptr; - - zptr = (GLuint *) - (zbase + (x1 << 2) + (y1 << 13)); - depth[i] = Z_TO_MESA(*zptr); - } - - FFBFifo(fmesa, 1); - fmesa->regs->fbc = fmesa->fbc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); -} - -/** - * Plug in the Get/Put routines for the given driRenderbuffer. - */ -void -ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis) -{ - assert(drb->Base.InternalFormat == GL_DEPTH_COMPONENT16); - drb->Base.GetRow = FFBReadDepthSpan; - drb->Base.GetValues = FFBReadDepthPixels; - drb->Base.PutRow = FFBWriteDepthSpan; - drb->Base.PutMonoRow = FFBWriteMonoDepthSpan; - drb->Base.PutValues = FFBWriteDepthPixels; - drb->Base.PutMonoValues = NULL; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_depth.h b/src/mesa/drivers/dri/ffb/ffb_depth.h deleted file mode 100644 index 8a1829ed49..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_depth.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef _FFB_DEPTH_H -#define _FFB_DEPTH_H - -void ffbSetDepthFunctions(driRenderbuffer *drb, const GLvisual *vis); - -#endif /* !(_FFB_DEPTH_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_fifo.h b/src/mesa/drivers/dri/ffb/ffb_fifo.h deleted file mode 100644 index a175f38643..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_fifo.h +++ /dev/null @@ -1,27 +0,0 @@ - -#ifndef _FFB_FIFO_H -#define _FFB_FIFO_H - -#define FFBFifo(__fmesa, __n) \ -do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \ - int __cur_slots = __fScrn->fifo_cache; \ - if ((__cur_slots - (__n)) < 0) { \ - ffb_fbcPtr __ffb = __fmesa->regs; \ - do { __cur_slots = (((int)__ffb->ucsr & FFB_UCSR_FIFO_MASK) - 4); \ - } while ((__cur_slots - (__n)) < 0); \ - } (__fScrn)->fifo_cache = (__cur_slots - (__n)); \ -} while(0) - -#define FFBWait(__fmesa, __ffb) \ -do { ffbScreenPrivate *__fScrn = (__fmesa)->ffbScreen; \ - if (__fScrn->rp_active) { \ - unsigned int __regval = (__ffb)->ucsr; \ - while((__regval & FFB_UCSR_ALL_BUSY) != 0) { \ - __regval = (__ffb)->ucsr; \ - } \ - __fScrn->fifo_cache = ((int)(__regval & FFB_UCSR_FIFO_MASK)) - 4; \ - __fScrn->rp_active = 0; \ - } \ -} while(0) - -#endif /* !(_FFB_FIFO_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_fog.c b/src/mesa/drivers/dri/ffb/ffb_fog.c deleted file mode 100644 index e6eca2390e..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_fog.c +++ /dev/null @@ -1,73 +0,0 @@ - -/* FFB fog support: - * - * There are two levels of support for FOG in the Creator3D series. - * Both involve a depth cue unit and 1 or 4 slope factors and scales - * for varying the pixel intensity. - * - * Chips prior to FFB2 only have a single set of such settings, FFB2 - * and later have 4 settings. - * - * The basic depth cueing equation is: - * - * C_final = dcsf(z) * C_orig + (1 - dcsf(z)) * C_fog - * - * C_final -- The final color passed to blend unit or frame - * buffer (if blending is disabled). - * - * C_orig -- The color we start with, which comes either from - * the raster processor or cpu writes to the smart - * framebuffer aperture. - * - * C_fog -- This is the "fog" color, ie. the desired color - * at the deepest Z. - * - * dcsf(z) -- The depth cue scale as a function of Z. - * - * With pre-FFB2 chips there are four parameters to control the depth - * cue scaling. Here is a diagram: - * - * 1.0 ------------- - * | | | | - * | | | | - * Sfront XXXXX---+---+ - * | |X | | - * dcsf(z) | | X | | - * | | X| | - * Sback +---+---XXXXX - * | | | | - * 0.0 ------------- - * 0.0 Zf Zb 1.0 - * - * z - * Therefore: - * - * for Zf < z < Zb - * - * dcsf(z) = Sback + ((Sfront - Sback) / (Zf - Zb)) * (Zb - z) - * - * for z <= Zf - * - * dcsf(z) = Sfront - * - * for z >= Zb - * - * dcsf(z) = Sback - * - * With FFB2 and later, 3 more slope regions are provided, the first of - * them starts at the end of the region defined above and ends at a - * specified depth value, the next slop region starts there and ends - * at the next specified depth value, and so on. Each of the 3 slope - * regions also have scale and slope settings of their own. - * - * The C_fog color is programmed into the alpha blending unit color1 - * and color2 registers as follows: - * - * color1: -(C_fog) - * color2: C_fog - bg - * - * If alpha blending is disabled, the bg factor is zero. Note that - * the alpha blending color registers specify each of the RGB values - * as 9 bit 1:8 signed numbers in the range -1.00 to 0.ff inclusive. - * (ie. 0x100 == -1.00 and 0x0ff == +0.ff) - */ diff --git a/src/mesa/drivers/dri/ffb/ffb_lines.c b/src/mesa/drivers/dri/ffb/ffb_lines.c deleted file mode 100644 index 6dca4edd29..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_lines.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000, 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" -#include "main/mm.h" -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_context.h" -#include "ffb_vb.h" -#include "ffb_lines.h" - -#undef FFB_LINE_TRACE - -#define FFB_LINE_FLAT_BIT 0x01 -#define FFB_LINE_ALPHA_BIT 0x02 -#define MAX_FFB_LINE_FUNCS 0x04 - -static ffb_line_func ffb_line_tab[MAX_FFB_LINE_FUNCS]; - -/* If the line is not wide, we can support all of the line - * patterning and smooth shading features of OpenGL fully. - */ - -#define IND (0) -#define TAG(x) x -#include "ffb_linetmp.h" - -#define IND (FFB_LINE_FLAT_BIT) -#define TAG(x) x##_flat -#include "ffb_linetmp.h" - -#define IND (FFB_LINE_ALPHA_BIT) -#define TAG(x) x##_alpha -#include "ffb_linetmp.h" - -#define IND (FFB_LINE_ALPHA_BIT|FFB_LINE_FLAT_BIT) -#define TAG(x) x##_alpha_flat -#include "ffb_linetmp.h" - -void ffbDDLinefuncInit(void) -{ - init(); - init_flat(); - init_alpha(); - init_alpha_flat(); -} - -static void ffb_dd_line( GLcontext *ctx, GLuint e0, GLuint e1 ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_vertex *v0 = &fmesa->verts[e0]; - ffb_vertex *v1 = &fmesa->verts[e1]; - fmesa->draw_line( ctx, v0, v1 ); -} - -void ffbChooseLineState(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint ind = 0; - - tnl->Driver.Render.Line = ffb_dd_line; - - if (flags & DD_FLATSHADE) - ind |= FFB_LINE_FLAT_BIT; - - if ((flags & DD_LINE_STIPPLE) != 0 && - fmesa->lpat == FFB_LPAT_BAD) { - fmesa->draw_line = ffb_fallback_line; - return; - } - - /* If blending or the alpha test is enabled we need to - * provide alpha components to the chip, else we can - * do without it and thus feed vertex data to the chip - * more efficiently. - */ - if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled) - ind |= FFB_LINE_ALPHA_BIT; - - fmesa->draw_line = ffb_line_tab[ind]; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_lines.h b/src/mesa/drivers/dri/ffb/ffb_lines.h deleted file mode 100644 index ddb9365653..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_lines.h +++ /dev/null @@ -1,17 +0,0 @@ - -#ifndef _FFB_LINES_H -#define _FFB_LINES_H - -#include "ffb_context.h" - -#define _FFB_NEW_LINE (_DD_NEW_FLATSHADE | \ - _DD_NEW_LINE_WIDTH | \ - _DD_NEW_LINE_STIPPLE | \ - _DD_NEW_LINE_SMOOTH | \ - _NEW_COLOR) - -extern void ffbDDLinefuncInit(void); -extern void ffbChooseLineState(GLcontext *); -extern void ffb_fallback_line( GLcontext *ctx, ffb_vertex *v0, ffb_vertex *v1 ); - -#endif /* !(_FFB_LINES_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_linetmp.h b/src/mesa/drivers/dri/ffb/ffb_linetmp.h deleted file mode 100644 index 10e1375259..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_linetmp.h +++ /dev/null @@ -1,80 +0,0 @@ - -static INLINE void TAG(ffb_line)(GLcontext *ctx, ffb_vertex *v0, - ffb_vertex *v1 ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_fbcPtr ffb = fmesa->regs; -#if (IND & FFB_LINE_FLAT_BIT) - const GLuint const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( v1->color[0] ); -#endif - FFB_DELAYED_VIEWPORT_VARS; - -#ifdef FFB_LINE_TRACE - fprintf(stderr, "FFB: ffb_line [" -#if (IND & FFB_LINE_FLAT_BIT) - " FLAT" -#endif -#if (IND & FFB_LINE_ALPHA_BIT) - " ALPHA" -#endif - " ]\n"); -#endif - -#if (IND & FFB_LINE_FLAT_BIT) - FFBFifo(fmesa, 1); - ffb->fg = const_fg; -#ifdef FFB_LINE_TRACE - fprintf(stderr, "FFB: ffb_line confg_fg[%08x]\n", const_fg); -#endif -#endif - -#if (IND & FFB_LINE_FLAT_BIT) - /* (2 * 3) + 1 */ - FFBFifo(fmesa, 7); -#else -#if (IND & FFB_LINE_ALPHA_BIT) - /* (2 * 7) + 1 */ - FFBFifo(fmesa, 15); -#else - /* (2 * 6) + 1 */ - FFBFifo(fmesa, 13); -#endif -#endif - - /* Using DDLINE or AALINE, init the line pattern state. */ - ffb->lpat = fmesa->lpat; - -#if !(IND & FFB_LINE_FLAT_BIT) -#if (IND & FFB_LINE_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v0); -#endif - ffb->red = FFB_GET_RED(v0); - ffb->green = FFB_GET_GREEN(v0); - ffb->blue = FFB_GET_BLUE(v0); -#endif - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - -#if !(IND & FFB_LINE_FLAT_BIT) -#if (IND & FFB_LINE_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v1); -#endif - ffb->red = FFB_GET_RED(v1); - ffb->green = FFB_GET_GREEN(v1); - ffb->blue = FFB_GET_BLUE(v1); -#endif - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(init)(void) -{ - ffb_line_tab[IND] = TAG(ffb_line); -} - -#undef IND -#undef TAG diff --git a/src/mesa/drivers/dri/ffb/ffb_lock.h b/src/mesa/drivers/dri/ffb/ffb_lock.h deleted file mode 100644 index 1fd3eb5512..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_lock.h +++ /dev/null @@ -1,36 +0,0 @@ - -#ifndef _FFB_LOCK_H -#define _FFB_LOCK_H - -#include "ffb_context.h" - -extern void ffbXMesaUpdateState(ffbContextPtr fmesa); -#define FFB_UPDATE_STATE(fmesa) ffbXMesaUpdateState(fmesa) - -/* Lock the hardware and validate our state. This hardware can only ever - * exist on SPARC platforms. Don't bother building the real LOCK_HARDWARE and - * UNLOCK_HARDWARE code on non-SPARC platforms. The only reason the driver - * gets built on non-SPARC is to catch build breakages earlier. - */ -#if !defined(__sparc__) -#define LOCK_HARDWARE(fmesa) -#define UNLOCK_HARDWARE(fmesa) -#else -#define LOCK_HARDWARE(fmesa) \ - do { \ - DRM_CAS_RESULT(__ret); \ - DRM_CAS(fmesa->driHwLock, fmesa->hHWContext, \ - (DRM_LOCK_HELD | fmesa->hHWContext), __ret);\ - if (__ret) { \ - drmGetLock(fmesa->driFd, fmesa->hHWContext, 0); \ - FFB_UPDATE_STATE(fmesa); \ - } \ - } while (0) - - -/* Unlock the hardware. */ -#define UNLOCK_HARDWARE(fmesa) \ - DRM_UNLOCK(fmesa->driFd, fmesa->driHwLock, fmesa->hHWContext); -#endif - -#endif /* !(_FFB_LOCK_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_points.c b/src/mesa/drivers/dri/ffb/ffb_points.c deleted file mode 100644 index 5bf4f8f070..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_points.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000, 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" -#include "ffb_dd.h" -#include "ffb_context.h" -#include "ffb_vb.h" -#include "ffb_points.h" - - -#undef FFB_POINT_TRACE - -#define FFB_POINT_AA_BIT 0x01 - -static ffb_point_func ffb_point_tab[0x08]; - -#define IND (0) -#define TAG(x) x -#include "ffb_pointtmp.h" - -#define IND (FFB_POINT_AA_BIT) -#define TAG(x) x##_aa -#include "ffb_pointtmp.h" - -void ffbDDPointfuncInit(void) -{ - init(); - init_aa(); -} - -static void ffb_dd_points( GLcontext *ctx, GLuint first, GLuint last ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT( ctx )->vb; - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_vertex *fverts = fmesa->verts; - int i; - - if (VB->Elts == 0) { - for ( i = first ; i < last ; i++ ) { - if ( VB->ClipMask[i] == 0 ) { - fmesa->draw_point( ctx, &fverts[i] ); - } - } - } else { - for ( i = first ; i < last ; i++ ) { - GLuint e = VB->Elts[i]; - if ( VB->ClipMask[e] == 0 ) { - fmesa->draw_point( ctx, &fverts[e] ); - } - } - } -} - -void ffbChoosePointState(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint ind = 0; - - tnl->Driver.Render.Points = ffb_dd_points; - - if (flags & DD_POINT_SMOOTH) - ind |= FFB_POINT_AA_BIT; - - fmesa->draw_point = ffb_point_tab[ind]; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_points.h b/src/mesa/drivers/dri/ffb/ffb_points.h deleted file mode 100644 index a7229de7f1..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_points.h +++ /dev/null @@ -1,14 +0,0 @@ - -#ifndef _FFB_POINTS_H -#define _FFB_POINTS_H - -extern void ffbDDPointfuncInit(void); - -#define _FFB_NEW_POINT (_DD_NEW_POINT_SIZE | \ - _DD_NEW_POINT_SMOOTH | \ - _NEW_COLOR) - -extern void ffbChoosePointState(GLcontext *); -extern void ffb_fallback_point( GLcontext *ctx, ffb_vertex *v0 ); - -#endif /* !(_FFB_POINTS_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_pointtmp.h b/src/mesa/drivers/dri/ffb/ffb_pointtmp.h deleted file mode 100644 index 3003de70c6..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_pointtmp.h +++ /dev/null @@ -1,54 +0,0 @@ - -static INLINE void TAG(ffb_draw_point)(GLcontext *ctx, ffb_vertex *tmp ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_fbcPtr ffb = fmesa->regs; - FFB_DELAYED_VIEWPORT_VARS; - -#ifdef FFB_POINT_TRACE - fprintf(stderr, "FFB: ffb_point [" -#if (IND & FFB_POINT_AA_BIT) - "AA" -#endif - "] X(%f) Y(%f) Z(%f)\n", - tmp->x, tmp->y, tmp->z); -#endif - -#if (IND & FFB_POINT_AA_BIT) - FFBFifo(fmesa, 4); - - ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( tmp->color[0] ); - ffb->z = FFB_GET_Z(tmp); - ffb->y = FFB_GET_Y(tmp) + 0x8000 /* FIX ME */; - ffb->x = FFB_GET_X(tmp) + 0x8000 /* FIX ME */; -#else - { - unsigned int const_fg, const_z, h, w; - - const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( tmp->color[0] ); - const_z = Z_FROM_MESA(FFB_Z_TO_FLOAT(FFB_GET_Z(tmp))); - h = FFB_GET_Y(tmp) >> 16; - w = FFB_GET_X(tmp) >> 16; -#ifdef FFB_POINT_TRACE - fprintf(stderr, "FFB: ffb_point fg(%08x) z(%08x) h(%08x) w(%08x)\n", - const_fg, const_z, h, w); -#endif - FFBFifo(fmesa, 4); - ffb->fg = const_fg; - ffb->constz = const_z; - ffb->bh = h; - ffb->bw = w; - } -#endif - - fmesa->ffbScreen->rp_active = 1; -} - - -static void TAG(init)(void) -{ - ffb_point_tab[IND] = TAG(ffb_draw_point); -} - -#undef IND -#undef TAG diff --git a/src/mesa/drivers/dri/ffb/ffb_rendertmp.h b/src/mesa/drivers/dri/ffb/ffb_rendertmp.h deleted file mode 100644 index 64141c2c5f..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_rendertmp.h +++ /dev/null @@ -1,645 +0,0 @@ - -#define IMPL_LOCAL_VARS \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); \ - ffb_fbcPtr ffb = fmesa->regs; \ - const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ - FFB_DELAYED_VIEWPORT_VARS; \ - (void) fmesa; (void) ffb; (void) elt - -#if (IND & FFB_FLAT_BIT) -#define FFB_DECLARE_CACHED_COLOR(NAME) \ - unsigned int NAME; -#define FFB_COMPUTE_CACHED_COLOR(NAME, VTX) \ - NAME = FFB_PACK_CONST_UBYTE_ARGB_COLOR((VTX)->color[0]) -#define FFB_CACHED_COLOR_SAME(NAME1, NAME2) \ - ((NAME1) == (NAME2)) -#define FFB_CACHED_COLOR_SET(NAME) \ - ffb->fg = (NAME) -#define FFB_CACHED_COLOR_UPDATE(NAME1, NAME2) \ - ffb->fg = (NAME1) = (NAME2) -#define FFB_SET_PRIM_COLOR(COLOR_VERTEX) \ - ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR((COLOR_VERTEX)->color[0]) -#define FFB_PRIM_COLOR_COST 1 -#define FFB_SET_VERTEX_COLOR(VTX) /**/ -#define FFB_VERTEX_COLOR_COST 0 -#else -#define FFB_DECLARE_CACHED_COLOR(NAME) /**/ -#define FFB_COMPUTE_CACHED_COLOR(NAME, VTX) /**/ -#define FFB_CACHED_COLOR_SAME(NAME1, NAME2) 0 -#define FFB_CACHED_COLOR_SET(NAME1) /**/ -#define FFB_CACHED_COLOR_UPDATE(NAME1, NAME2) /**/ -#define FFB_SET_PRIM_COLOR(COLOR_VERTEX) /**/ -#define FFB_PRIM_COLOR_COST 0 -#if (IND & FFB_ALPHA_BIT) -#define FFB_SET_VERTEX_COLOR(VTX) \ - ffb->alpha = FFB_GET_ALPHA(VTX); \ - ffb->red = FFB_GET_RED(VTX); \ - ffb->green = FFB_GET_GREEN(VTX); \ - ffb->blue = FFB_GET_BLUE(VTX) -#define FFB_VERTEX_COLOR_COST 4 -#else -#define FFB_SET_VERTEX_COLOR(VTX) \ - ffb->red = FFB_GET_RED(VTX); \ - ffb->green = FFB_GET_GREEN(VTX); \ - ffb->blue = FFB_GET_BLUE(VTX) -#define FFB_VERTEX_COLOR_COST 3 -#endif -#endif - -#define RESET_STIPPLE ffb->lpat = fmesa->lpat; - -#if !(IND & (FFB_TRI_CULL_BIT)) -static void TAG(ffb_vb_points)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_POINTS); - if (ctx->_TriangleCaps & DD_POINT_SMOOTH) { - for (i = start; i < count; i++) { - ffb_vertex *v0 = &fmesa->verts[ELT(i)]; - - FFBFifo(fmesa, 4); - ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR(v0->color[0]); - ffb->z = FFB_GET_Z(v0); - ffb->y = FFB_GET_Y(v0) + 0x8000 /* FIX ME */; - ffb->x = FFB_GET_X(v0) + 0x8000 /* FIX ME */; - } - } else { - for (i = start; i < count; i++) { - ffb_vertex *v0 = &fmesa->verts[ELT(i)]; - FFBFifo(fmesa, 4); - ffb->fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR(v0->color[0]); - ffb->constz = Z_FROM_MESA(FFB_Z_TO_FLOAT(FFB_GET_Z(v0))); - ffb->bh = FFB_GET_Y(v0) >> 16; - ffb->bw = FFB_GET_X(v0) >> 16; - } - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_vb_lines)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_LINES); - for (i = start + 1; i < count; i += 2) { - ffb_vertex *v0 = &fmesa->verts[i - 1]; - ffb_vertex *v1 = &fmesa->verts[i - 0]; - - FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 2) + 6)); - - RESET_STIPPLE; - - FFB_SET_PRIM_COLOR(v1); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - } -} - -static void TAG(ffb_vb_line_loop)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_LINE_LOOP); - if ((flags & PRIM_BEGIN) != 0) { - ffb_vertex *v0 = &fmesa->verts[ELT(start + 0)]; - ffb_vertex *v1 = &fmesa->verts[ELT(start + 1)]; - - FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST + - ((FFB_VERTEX_COLOR_COST * 2) + (3 * 2)))); - - RESET_STIPPLE; - - FFB_SET_PRIM_COLOR(v1); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - } - for (i = start + 2; i < count; i++) { - ffb_vertex *v0 = &fmesa->verts[ELT(i)]; - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST + 3))); - - FFB_SET_PRIM_COLOR(v0); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->y = FFB_GET_Y(v0); - ffb->x = FFB_GET_X(v0); - } - if ((flags & PRIM_END) != 0) { - ffb_vertex *v0 = &fmesa->verts[ELT(start)]; - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST + 3))); - - FFB_SET_PRIM_COLOR(v0); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->y = FFB_GET_Y(v0); - ffb->x = FFB_GET_X(v0); - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_vb_line_strip)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - FFB_DECLARE_CACHED_COLOR(cached_fg) - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_LINE_STRIP); - FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST + - ((FFB_VERTEX_COLOR_COST * 2) + (3 * 2)))); - - RESET_STIPPLE; - - { - ffb_vertex *v0 = &fmesa->verts[ELT(start + 0)]; - ffb_vertex *v1 = &fmesa->verts[ELT(start + 1)]; - - FFB_COMPUTE_CACHED_COLOR(cached_fg, v0); - FFB_CACHED_COLOR_SET(cached_fg); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - } - - for (i = start + 2; i < count; i++) { - ffb_vertex *v1 = &fmesa->verts[ELT(i - 0)]; - FFB_DECLARE_CACHED_COLOR(new_fg) - - FFB_COMPUTE_CACHED_COLOR(new_fg, v1); - if (FFB_CACHED_COLOR_SAME(cached_fg, new_fg)) { - FFBFifo(fmesa, ((FFB_VERTEX_COLOR_COST * 1) + (3 * 1))); - } else { - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 1) + (3 * 1))); - FFB_CACHED_COLOR_UPDATE(cached_fg, new_fg); - } - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - } - - fmesa->ffbScreen->rp_active = 1; -} -#endif /* !(IND & (FFB_TRI_CULL_BIT)) */ - -/* OK, now things start getting fun :-) */ -#if (IND & (FFB_TRI_CULL_BIT)) -#define FFB_AREA_DECLARE GLfloat cc, ex, ey, fx, fy; -#define FFB_COMPUTE_AREA_TRI(V0, V1, V2) \ -{ ex = (V1)->x - (V0)->x; \ - ey = (V1)->y - (V0)->y; \ - fx = (V2)->x - (V0)->x; \ - fy = (V2)->y - (V0)->y; \ - cc = ex*fy-ey*fx; \ -} -#define FFB_COMPUTE_AREA_QUAD(V0, V1, V2, V3) \ -{ ex = (V2)->x - (V0)->x; \ - ey = (V2)->y - (V0)->y; \ - fx = (V3)->x - (V1)->x; \ - fy = (V3)->y - (V1)->y; \ - cc = ex*fy-ey*fx; \ -} -#else -#define FFB_AREA_DECLARE /**/ -#define FFB_COMPUTE_AREA_TRI(V0, V1, V2) do { } while(0) -#define FFB_COMPUTE_AREA_QUAD(V0, V1, V2, V3) do { } while(0) -#endif - -#if (IND & FFB_TRI_CULL_BIT) -#define FFB_CULL_TRI(CULL_ACTION) \ - if (cc * fmesa->backface_sign > fmesa->ffb_zero) { \ - CULL_ACTION \ - } -#define FFB_CULL_QUAD(CULL_ACTION) \ - if (cc * fmesa->backface_sign > fmesa->ffb_zero) { \ - CULL_ACTION \ - } -#else -#define FFB_CULL_TRI(CULL_ACTION) do { } while (0) -#define FFB_CULL_QUAD(CULL_ACTION) do { } while (0) -#endif - -static void TAG(ffb_vb_triangles)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_TRIANGLES); - for (i = start + 2; i < count; i += 3) { - ffb_vertex *v0 = &fmesa->verts[ELT(i - 2)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i - 1)]; - ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)]; - FFB_AREA_DECLARE - - FFB_COMPUTE_AREA_TRI(v0, v1, v2); - FFB_CULL_TRI(continue;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 3) + 9)); - FFB_SET_PRIM_COLOR(v2); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_vb_tri_strip)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - GLint parity = 0; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_TRIANGLE_STRIP); - - i = start + 2; - goto something_clipped; - - something_clipped: - for (; i < count; i++, parity ^= 1) { - ffb_vertex *v0 = &fmesa->verts[ELT(i - 2 + parity)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i - 1 - parity)]; - ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)]; - FFB_AREA_DECLARE - - FFB_COMPUTE_AREA_TRI(v0, v1, v2); - FFB_CULL_TRI(continue;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 3) + 9)); - FFB_SET_PRIM_COLOR(v2); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - - i++; - parity ^= 1; - break; - } - - for (; i < count; i++, parity ^= 1) { - ffb_vertex *v0 = &fmesa->verts[ELT(i - 2 + parity)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i - 1 - parity)]; - ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)]; - FFB_AREA_DECLARE - (void) v0; (void) v1; - - FFB_COMPUTE_AREA_TRI(v0, v1, v2); - FFB_CULL_TRI(i++; parity^=1; goto something_clipped;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 1) + 3)); - FFB_SET_PRIM_COLOR(v2); - - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_vb_tri_fan)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_TRIANGLE_FAN); - - i = start + 2; - goto something_clipped; - - something_clipped: - for ( ; i < count; i++) { - ffb_vertex *v0 = &fmesa->verts[ELT(start)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i - 1)]; - ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)]; - FFB_AREA_DECLARE - - FFB_COMPUTE_AREA_TRI(v0, v1, v2); - FFB_CULL_TRI(continue;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 3) + 9)); - FFB_SET_PRIM_COLOR(v2); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - - i++; - break; - } - - for (; i < count; i++) { - ffb_vertex *v0 = &fmesa->verts[ELT(start)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i - 1)]; - ffb_vertex *v2 = &fmesa->verts[ELT(i - 0)]; - FFB_AREA_DECLARE - (void) v0; (void) v1; - - FFB_COMPUTE_AREA_TRI(v0, v1, v2); - FFB_CULL_TRI(i++; goto something_clipped;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 1) + 3)); - FFB_SET_PRIM_COLOR(v2); - - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->dmyf = FFB_GET_Y(v2); - ffb->dmxf = FFB_GET_X(v2); - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_vb_poly)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_POLYGON); - - /* XXX Optimize XXX */ - for (i = start + 2; i < count; i++) { - ffb_vertex *v0 = &fmesa->verts[ELT(i - 1)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i)]; - ffb_vertex *v2 = &fmesa->verts[ELT(start)]; - FFB_AREA_DECLARE - - FFB_COMPUTE_AREA_TRI(v0, v1, v2); - FFB_CULL_TRI(continue;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 3) + 9)); - FFB_SET_PRIM_COLOR(v2); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_vb_quads)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_QUADS); - - for (i = start + 3; i < count; i += 4) { - ffb_vertex *v0 = &fmesa->verts[ELT(i - 3)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i - 2)]; - ffb_vertex *v2 = &fmesa->verts[ELT(i - 1)]; - ffb_vertex *v3 = &fmesa->verts[ELT(i - 0)]; - FFB_AREA_DECLARE - - FFB_COMPUTE_AREA_QUAD(v0, v1, v2, v3); - FFB_CULL_QUAD(continue;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 4) + 12)); - FFB_SET_PRIM_COLOR(v3); - - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - - FFB_SET_VERTEX_COLOR(v3); - ffb->z = FFB_GET_Z(v3); - ffb->dmyf = FFB_GET_Y(v3); - ffb->dmxf = FFB_GET_X(v3); - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_vb_quad_strip)(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - GLint i; - IMPL_LOCAL_VARS; - -#ifdef FFB_RENDER_TRACE - fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n", - __FUNCTION__, start, count, flags); -#endif - ffbRenderPrimitive(ctx, GL_QUAD_STRIP); - - /* XXX Optimize XXX */ - for (i = start + 3; i < count; i += 2) { - ffb_vertex *v0 = &fmesa->verts[ELT(i - 1)]; - ffb_vertex *v1 = &fmesa->verts[ELT(i - 3)]; - ffb_vertex *v2 = &fmesa->verts[ELT(i - 2)]; - ffb_vertex *v3 = &fmesa->verts[ELT(i - 0)]; - FFB_AREA_DECLARE - - FFB_COMPUTE_AREA_QUAD(v0, v1, v2, v3); - FFB_CULL_QUAD(continue;); - - FFBFifo(fmesa, (FFB_PRIM_COLOR_COST + - (FFB_VERTEX_COLOR_COST * 4) + 12)); - FFB_SET_PRIM_COLOR(v3); - - FFB_DUMP_VERTEX(v0); - FFB_SET_VERTEX_COLOR(v0); - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_DUMP_VERTEX(v1); - FFB_SET_VERTEX_COLOR(v1); - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_DUMP_VERTEX(v2); - FFB_SET_VERTEX_COLOR(v2); - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - - FFB_DUMP_VERTEX(v3); - FFB_SET_VERTEX_COLOR(v3); - ffb->z = FFB_GET_Z(v3); - ffb->dmyf = FFB_GET_Y(v3); - ffb->dmxf = FFB_GET_X(v3); - } - - fmesa->ffbScreen->rp_active = 1; -} - -static void (*TAG(render_tab)[GL_POLYGON + 2])(GLcontext *, GLuint, GLuint, GLuint) = -{ -#if !(IND & (FFB_TRI_CULL_BIT)) - TAG(ffb_vb_points), - TAG(ffb_vb_lines), - TAG(ffb_vb_line_loop), - TAG(ffb_vb_line_strip), -#else - NULL, - NULL, - NULL, - NULL, -#endif - TAG(ffb_vb_triangles), - TAG(ffb_vb_tri_strip), - TAG(ffb_vb_tri_fan), - TAG(ffb_vb_quads), - TAG(ffb_vb_quad_strip), - TAG(ffb_vb_poly), - ffb_vb_noop, -}; - -#undef IND -#undef TAG - -#undef IMPL_LOCAL_VARS -#undef FFB_DECLARE_CACHED_COLOR -#undef FFB_COMPUTE_CACHED_COLOR -#undef FFB_CACHED_COLOR_SAME -#undef FFB_CACHED_COLOR_SET -#undef FFB_CACHED_COLOR_UPDATE -#undef FFB_SET_PRIM_COLOR -#undef FFB_PRIM_COLOR_COST -#undef FFB_SET_VERTEX_COLOR -#undef FFB_VERTEX_COLOR_COST -#undef RESET_STIPPLE -#undef FFB_AREA_DECLARE -#undef FFB_COMPUTE_AREA_TRI -#undef FFB_COMPUTE_AREA_QUAD -#undef FFB_CULL_TRI -#undef FFB_CULL_QUAD diff --git a/src/mesa/drivers/dri/ffb/ffb_span.c b/src/mesa/drivers/dri/ffb/ffb_span.c deleted file mode 100644 index 61901cccad..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_span.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_context.h" -#include "ffb_lock.h" - -#define DBG 0 - -#define HW_LOCK() \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); \ - if (!fmesa->hw_locked) \ - LOCK_HARDWARE(fmesa); - -#define HW_UNLOCK() \ - if (!fmesa->hw_locked) \ - UNLOCK_HARDWARE(fmesa); \ - -#define LOCAL_VARS \ - __DRIdrawable *dPriv = fmesa->driDrawable; \ - GLuint height = dPriv->h; \ - GLuint p; \ - char *buf; \ - (void) p - -#define INIT_MONO_PIXEL(p, color) \ - p = ((color[0] << 0) | \ - (color[1] << 8) | \ - (color[2] << 16)) - -/* We use WID clipping, so this test always passes. */ -#define CLIPPIXEL(__x, __y) (1) - -/* And also, due to WID clipping, we need not do anything - * special here. - */ -#define CLIPSPAN(__x,__y,__n,__x1,__n1,__i) \ - __n1 = __n; \ - __x1 = __x; \ - -#define HW_CLIPLOOP() \ -do { unsigned int fbc, ppc, cmp; \ - FFBWait(fmesa, fmesa->regs); \ - fbc = fmesa->regs->fbc; ppc = fmesa->regs->ppc; cmp = fmesa->regs->cmp; \ - fmesa->regs->fbc = ((fbc & \ - ~(FFB_FBC_WB_C | FFB_FBC_ZE_MASK | FFB_FBC_RGBE_MASK)) \ - | (FFB_FBC_ZE_OFF | FFB_FBC_RGBE_MASK)); \ - fmesa->regs->ppc = ((ppc & \ - ~(FFB_PPC_XS_MASK | FFB_PPC_ABE_MASK | FFB_PPC_DCE_MASK | \ - FFB_PPC_APE_MASK | FFB_PPC_CS_MASK)) \ - | (FFB_PPC_XS_WID | FFB_PPC_ABE_DISABLE | \ - FFB_PPC_DCE_DISABLE | FFB_PPC_APE_DISABLE | \ - FFB_PPC_CS_VAR)); \ - fmesa->regs->cmp = ((cmp & ~(0xff << 16)) | (0x80 << 16)); \ - fmesa->ffbScreen->rp_active = 1; \ - FFBWait(fmesa, fmesa->regs); \ - buf = (char *)(fmesa->sfb32 + (dPriv->x << 2) + (dPriv->y << 13));\ - if (dPriv->numClipRects) { - -#define HW_ENDCLIPLOOP() \ - } \ - fmesa->regs->fbc = fbc; \ - fmesa->regs->ppc = ppc; \ - fmesa->regs->cmp = cmp; \ - fmesa->ffbScreen->rp_active = 1; \ -} while(0) - -#define Y_FLIP(__y) (height - __y - 1) - -#define READ_RGBA(rgba,__x,__y) \ -do { GLuint p = *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)); \ - rgba[0] = (p >> 0) & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = (p >> 16) & 0xff; \ - rgba[3] = 0xff; \ -} while(0) - -#define WRITE_RGBA(__x, __y, __r, __g, __b, __a) \ - *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)) = \ - ((((__r) & 0xff) << 0) | \ - (((__g) & 0xff) << 8) | \ - (((__b) & 0xff) << 16)) - -#define WRITE_PIXEL(__x, __y, __p) \ - *(GLuint *)(buf + ((__x)<<2) + ((__y)<<13)) = (__p) - -#define TAG(x) ffb##x##_888 - -#include "spantmp.h" - -/** - * Plug in the Get/Put routines for the given driRenderbuffer. - */ -void -ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) -{ - assert(vis->redBits == 8); - assert(vis->greenBits == 8); - assert(vis->blueBits == 8); - ffbInitPointers_888(&drb->Base); -} diff --git a/src/mesa/drivers/dri/ffb/ffb_span.h b/src/mesa/drivers/dri/ffb/ffb_span.h deleted file mode 100644 index 37506cf30e..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_span.h +++ /dev/null @@ -1,9 +0,0 @@ - -#ifndef _FFB_SPAN_H -#define _FFB_SPAN_H - -#include "drirenderbuffer.h" - -void ffbSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis); - -#endif /* !(_FFB_SPAN_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c deleted file mode 100644 index c09d2fef83..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_state.c +++ /dev/null @@ -1,1222 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000, 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" -#include "main/colormac.h" -#include "main/enums.h" - -#include "vbo/vbo.h" -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" - -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_context.h" -#include "ffb_tris.h" -#include "ffb_state.h" - -#undef STATE_TRACE - -static unsigned int ffbComputeAlphaFunc(GLcontext *ctx) -{ - unsigned int xclip; - GLubyte alphaRef; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDAlphaFunc: func(%s) ref(%02x)\n", - _mesa_lookup_enum_by_nr(ctx->Color.AlphaFunc), - ctx->Color.AlphaRef & 0xff); -#endif - - switch (ctx->Color.AlphaFunc) { - case GL_NEVER: xclip = FFB_XCLIP_TEST_NEVER; break; - case GL_LESS: xclip = FFB_XCLIP_TEST_LT; break; - case GL_EQUAL: xclip = FFB_XCLIP_TEST_EQ; break; - case GL_LEQUAL: xclip = FFB_XCLIP_TEST_LE; break; - case GL_GREATER: xclip = FFB_XCLIP_TEST_GT; break; - case GL_NOTEQUAL: xclip = FFB_XCLIP_TEST_NE; break; - case GL_GEQUAL: xclip = FFB_XCLIP_TEST_GE; break; - case GL_ALWAYS: xclip = FFB_XCLIP_TEST_ALWAYS; break; - - default: - return FFB_XCLIP_TEST_ALWAYS | 0x00; - } - - CLAMPED_FLOAT_TO_UBYTE(alphaRef, ctx->Color.AlphaRef); - xclip |= (alphaRef & 0xff); - - return xclip; -} - -static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - if (ctx->Color.AlphaEnabled) { - unsigned int xclip = ffbComputeAlphaFunc(ctx); - - if (fmesa->xclip != xclip) { - fmesa->xclip = xclip; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_XCLIP, 1); - } - } -} - -static void ffbDDBlendEquationSeparate(GLcontext *ctx, - GLenum modeRGB, GLenum modeA) -{ - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDBlendEquation: mode(%s)\n", - _mesa_lookup_enum_by_nr(modeRGB)); -#endif - assert( modeRGB == modeA ); - FALLBACK( ctx, (modeRGB != GL_FUNC_ADD), FFB_BADATTR_BLENDEQN); -} - -static void ffbDDBlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB, - GLenum dfactorRGB, GLenum sfactorA, - GLenum dfactorA) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int blendc = 1 << 4; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDBlendFuncSeparate: sRGB(%s) dRGB(%s) sA(%s) dA(%s)\n", - _mesa_lookup_enum_by_nr(sfactorRGB), - _mesa_lookup_enum_by_nr(dfactorRGB), - _mesa_lookup_enum_by_nr(sfactorA), - _mesa_lookup_enum_by_nr(dfactorA)); -#endif - switch (ctx->Color.BlendSrcRGB) { - case GL_ZERO: - blendc |= (0 << 0); - break; - - case GL_ONE: - blendc |= (1 << 0); - break; - - case GL_ONE_MINUS_SRC_ALPHA: - blendc |= (2 << 0); - break; - - case GL_SRC_ALPHA: - blendc |= (3 << 0); - break; - - default: - if (ctx->Color.BlendEnabled) - FALLBACK( ctx, FFB_BADATTR_BLENDFUNC, GL_TRUE ); - return; - }; - - switch (ctx->Color.BlendDstRGB) { - case GL_ZERO: - blendc |= (0 << 2); - break; - - case GL_ONE: - blendc |= (1 << 2); - break; - - case GL_ONE_MINUS_SRC_ALPHA: - blendc |= (2 << 2); - break; - - case GL_SRC_ALPHA: - blendc |= (3 << 2); - break; - - default: - if (ctx->Color.BlendEnabled) - FALLBACK( ctx, FFB_BADATTR_BLENDFUNC, GL_TRUE ); - return; - }; - - if (ctx->Color.BlendEnabled && - ctx->Color.ColorLogicOpEnabled && - ctx->Color.LogicOp != GL_COPY) { - /* We could avoid this if sfactor is GL_ONE and - * dfactor is GL_ZERO. I do not think that is even - * worthwhile to check because if someone is using - * blending they use more interesting settings and - * also it would add more state tracking to a lot - * of the code in this file. - */ - FALLBACK(ctx, FFB_BADATTR_BLENDROP, GL_TRUE); - return; - } - - FALLBACK( ctx, (FFB_BADATTR_BLENDFUNC|FFB_BADATTR_BLENDROP), GL_FALSE ); - - if (blendc != fmesa->blendc) { - fmesa->blendc = blendc; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_BLEND, 1); - } -} - -static void ffbDDDepthFunc(GLcontext *ctx, GLenum func) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLuint cmp; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDDepthFunc: func(%s)\n", - _mesa_lookup_enum_by_nr(func)); -#endif - - switch (func) { - case GL_NEVER: - cmp = FFB_CMP_MAGN_NEVER; - break; - case GL_ALWAYS: - cmp = FFB_CMP_MAGN_ALWAYS; - break; - case GL_LESS: - cmp = FFB_CMP_MAGN_LT; - break; - case GL_LEQUAL: - cmp = FFB_CMP_MAGN_LE; - break; - case GL_EQUAL: - cmp = FFB_CMP_MAGN_EQ; - break; - case GL_GREATER: - cmp = FFB_CMP_MAGN_GT; - break; - case GL_GEQUAL: - cmp = FFB_CMP_MAGN_GE; - break; - case GL_NOTEQUAL: - cmp = FFB_CMP_MAGN_NE; - break; - default: - return; - }; - - if (! ctx->Depth.Test) - cmp = FFB_CMP_MAGN_ALWAYS; - - cmp <<= 16; - cmp = (fmesa->cmp & ~(0xff<<16)) | cmp; - if (cmp != fmesa->cmp) { - fmesa->cmp = cmp; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_CMP, 1); - } -} - -static void ffbDDDepthMask(GLcontext *ctx, GLboolean flag) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLuint fbc = fmesa->fbc; - GLboolean enabled_now; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDDepthMask: flag(%d)\n", flag); -#endif - - if ((fbc & FFB_FBC_ZE_MASK) == FFB_FBC_ZE_OFF) - enabled_now = GL_FALSE; - else - enabled_now = GL_TRUE; - - if (flag != enabled_now) { - fbc &= ~FFB_FBC_ZE_MASK; - if (flag) { - fbc |= FFB_FBC_WB_C | FFB_FBC_ZE_ON; - } else { - fbc |= FFB_FBC_ZE_OFF; - fbc &= ~FFB_FBC_WB_C; - } - fmesa->fbc = fbc; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1); - } -} - -static void -ffbDDStencilFuncSeparate(GLcontext *ctx, GLenum face, GLenum func, - GLint ref, GLuint mask) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int stencil, stencilctl, consty; - - /* We will properly update sw/hw state when stenciling is - * enabled. - */ - if (! ctx->Stencil._Enabled) - return; - - stencilctl = fmesa->stencilctl; - stencilctl &= ~(7 << 16); - - switch (func) { - case GL_ALWAYS: stencilctl |= (0 << 16); break; - case GL_GREATER: stencilctl |= (1 << 16); break; - case GL_EQUAL: stencilctl |= (2 << 16); break; - case GL_GEQUAL: stencilctl |= (3 << 16); break; - case GL_NEVER: stencilctl |= (4 << 16); break; - case GL_LEQUAL: stencilctl |= (5 << 16); break; - case GL_NOTEQUAL: stencilctl |= (6 << 16); break; - case GL_LESS: stencilctl |= (7 << 16); break; - - default: - return; - }; - - consty = ref & 0xf; - - stencil = fmesa->stencil; - stencil &= ~(0xf << 20); - stencil |= (mask & 0xf) << 20; - - if (fmesa->stencil != stencil || - fmesa->stencilctl != stencilctl || - fmesa->consty != consty) { - fmesa->stencil = stencil; - fmesa->stencilctl = stencilctl; - fmesa->consty = consty; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_STENCIL, 6); - } -} - -static void -ffbDDStencilMaskSeparate(GLcontext *ctx, GLenum face, GLuint mask) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - mask &= 0xf; - if (fmesa->ypmask != mask) { - fmesa->ypmask = mask; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_YPMASK, 1); - } -} - -static void -ffbDDStencilOpSeparate(GLcontext *ctx, GLenum face, GLenum fail, - GLenum zfail, GLenum zpass) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int stencilctl; - - /* We will properly update sw/hw state when stenciling is - * enabled. - */ - if (! ctx->Stencil._Enabled) - return; - - stencilctl = fmesa->stencilctl; - stencilctl &= ~(0xfff00000); - - switch (fail) { - case GL_ZERO: stencilctl |= (0 << 28); break; - case GL_KEEP: stencilctl |= (1 << 28); break; - case GL_INVERT: stencilctl |= (2 << 28); break; - case GL_REPLACE: stencilctl |= (3 << 28); break; - case GL_INCR: stencilctl |= (4 << 28); break; - case GL_DECR: stencilctl |= (5 << 28); break; - - default: - return; - }; - - switch (zfail) { - case GL_ZERO: stencilctl |= (0 << 24); break; - case GL_KEEP: stencilctl |= (1 << 24); break; - case GL_INVERT: stencilctl |= (2 << 24); break; - case GL_REPLACE: stencilctl |= (3 << 24); break; - case GL_INCR: stencilctl |= (4 << 24); break; - case GL_DECR: stencilctl |= (5 << 24); break; - - default: - return; - }; - - switch (zpass) { - case GL_ZERO: stencilctl |= (0 << 20); break; - case GL_KEEP: stencilctl |= (1 << 20); break; - case GL_INVERT: stencilctl |= (2 << 20); break; - case GL_REPLACE: stencilctl |= (3 << 20); break; - case GL_INCR: stencilctl |= (4 << 20); break; - case GL_DECR: stencilctl |= (5 << 20); break; - - default: - return; - }; - - if (fmesa->stencilctl != stencilctl) { - fmesa->stencilctl = stencilctl; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_STENCIL, 6); - } -} - -static void ffbCalcViewportRegs(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - GLuint xmin, xmax, ymin, ymax, zmin, zmax; - unsigned int vcmin, vcmax; - - xmin = ctx->Viewport.X + dPriv->x; - xmax = xmin + ctx->Viewport.Width; - ymax = dPriv->y + dPriv->h - ctx->Viewport.Y; - ymin = ymax - ctx->Viewport.Height; - if (ctx->Scissor.Enabled) { - GLuint sc_xmin, sc_xmax, sc_ymin, sc_ymax; - - sc_xmin = ctx->Viewport.X + dPriv->x; - sc_xmax = sc_xmin + ctx->Viewport.Width; - sc_ymax = dPriv->y + dPriv->h - ctx->Viewport.Y; - sc_ymin = sc_ymax - ctx->Viewport.Height; - if (sc_xmin > xmin) - xmin = sc_xmin; - if (sc_xmax < xmax) - xmax = sc_xmax; - if (sc_ymin > ymin) - ymin = sc_ymin; - if (sc_ymax < ymax) - ymax = sc_ymax; - } - zmin = ((GLdouble)ctx->Viewport.Near * 0x0fffffff); - zmax = ((GLdouble)ctx->Viewport.Far * 0x0fffffff); - - vcmin = ((ymin & 0xffff) << 16) | (xmin & 0xffff); - vcmax = ((ymax & 0xffff) << 16) | (xmax & 0xffff); - if (fmesa->vclipmin != vcmin || - fmesa->vclipmax != vcmax || - fmesa->vclipzmin != zmin || - fmesa->vclipzmax != zmax) { - fmesa->vclipmin = vcmin; - fmesa->vclipmax = vcmax; - fmesa->vclipzmin = zmin; - fmesa->vclipzmax = zmax; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_CLIP, (4 + (4 * 2))); - } -} - -void ffbCalcViewport(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - const GLfloat *v = ctx->Viewport._WindowMap.m; - GLfloat *m = fmesa->hw_viewport; - __DRIdrawable *dPriv = fmesa->driDrawable; - - m[MAT_SX] = v[MAT_SX]; - m[MAT_TX] = v[MAT_TX] + dPriv->x + SUBPIXEL_X; - m[MAT_SY] = - v[MAT_SY]; - m[MAT_TY] = - v[MAT_TY] + dPriv->h + dPriv->y + SUBPIXEL_Y; - m[MAT_SZ] = v[MAT_SZ] * ((GLdouble)1.0 / (GLdouble)0x0fffffff); - m[MAT_TZ] = v[MAT_TZ] * ((GLdouble)1.0 / (GLdouble)0x0fffffff); - - fmesa->depth_scale = ((GLdouble)1.0 / (GLdouble)0x0fffffff); - - ffbCalcViewportRegs(ctx); - - fmesa->setupnewinputs |= VERT_BIT_POS; -} - -static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height) -{ - ffbCalcViewport(ctx); -} - -static void ffbDDDepthRange(GLcontext *ctx, GLclampd nearval, GLclampd farval) -{ - ffbCalcViewport(ctx); -} - -static void ffbDDScissor(GLcontext *ctx, GLint cx, GLint cy, - GLsizei cw, GLsizei ch) -{ - ffbCalcViewport(ctx); -} - -static void ffbDDDrawBuffer(GLcontext *ctx, GLenum buffer) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int fbc = fmesa->fbc; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDDrawBuffer: mode(%s)\n", - _mesa_lookup_enum_by_nr(buffer)); -#endif - fbc &= ~(FFB_FBC_WB_AB | FFB_FBC_RB_MASK); - switch (buffer) { - case GL_FRONT: - if (fmesa->back_buffer == 0) - fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B; - else - fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A; - break; - - case GL_BACK: - if (fmesa->back_buffer == 0) - fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A; - else - fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B; - break; - - case GL_FRONT_AND_BACK: - fbc |= FFB_FBC_WB_AB; - break; - - default: - return; - }; - - if (fbc != fmesa->fbc) { - fmesa->fbc = fbc; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1); - } -} - - -static void ffbDDReadBuffer(GLcontext *ctx, GLenum buffer) -{ - /* no-op, unless you implement h/w glRead/CopyPixels */ -} - - -/* - * Specifies buffer for sw fallbacks (spans) - */ -#if 000 -/* XXX - * This function is obsolete. It's not clear how this really effected - * span reading/writing above. The span functions should use the - * incoming driRenderbuffer (gl_renderbuffer) pointer to determine how - * to read from the specified bufer. - */ -static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, - GLuint bufferBit) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int fbc = fmesa->fbc; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDSetReadBuffer: mode(%s)\n", - _mesa_lookup_enum_by_nr(buffer)); -#endif - fbc &= ~(FFB_FBC_RB_MASK); - switch (bufferBit) { - case BUFFER_BIT_FRONT_LEFT: - if (fmesa->back_buffer == 0) - fbc |= FFB_FBC_RB_B; - else - fbc |= FFB_FBC_RB_A; - break; - - case BUFFER_BIT_BACK_LEFT: - if (fmesa->back_buffer == 0) - fbc |= FFB_FBC_RB_A; - else - fbc |= FFB_FBC_RB_B; - break; - - default: - _mesa_problem(ctx, "Unexpected buffer in ffbDDSetBuffer()"); - return; - }; - - if (fbc != fmesa->fbc) { - fmesa->fbc = fbc; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1); - } -} -#endif - - -static void ffbDDClearColor(GLcontext *ctx, const GLfloat color[4]) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLubyte c[4]; - CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); - - fmesa->clear_pixel = ((c[0] << 0) | - (c[1] << 8) | - (c[2] << 16)); -} - -static void ffbDDClearDepth(GLcontext *ctx, GLclampd depth) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - fmesa->clear_depth = Z_FROM_MESA(depth * 4294967295.0f); -} - -static void ffbDDClearStencil(GLcontext *ctx, GLint stencil) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - fmesa->clear_stencil = stencil & 0xf; -} - -/* XXX Actually, should I be using FBC controls for this? -DaveM */ -static void ffbDDColorMask(GLcontext *ctx, - GLboolean r, GLboolean g, - GLboolean b, GLboolean a) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int new_pmask = 0x0; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDColorMask: r(%d) g(%d) b(%d) a(%d)\n", - r, g, b, a); -#endif - if (r) - new_pmask |= 0x000000ff; - if (g) - new_pmask |= 0x0000ff00; - if (b) - new_pmask |= 0x00ff0000; - if (a) - new_pmask |= 0xff000000; - - if (fmesa->pmask != new_pmask) { - fmesa->pmask = new_pmask; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_PMASK, 1); - } -} - -static void ffbDDLogicOp(GLcontext *ctx, GLenum op) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int rop; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDLogicOp: op(%s)\n", - _mesa_lookup_enum_by_nr(op)); -#endif - switch (op) { - case GL_CLEAR: rop = FFB_ROP_ZERO; break; - case GL_SET: rop = FFB_ROP_ONES; break; - case GL_COPY: rop = FFB_ROP_NEW; break; - case GL_AND: rop = FFB_ROP_NEW_AND_OLD; break; - case GL_NAND: rop = FFB_ROP_NEW_AND_NOLD; break; - case GL_OR: rop = FFB_ROP_NEW_OR_OLD; break; - case GL_NOR: rop = FFB_ROP_NEW_OR_NOLD; break; - case GL_XOR: rop = FFB_ROP_NEW_XOR_OLD; break; - case GL_NOOP: rop = FFB_ROP_OLD; break; - case GL_COPY_INVERTED: rop = FFB_ROP_NNEW; break; - case GL_INVERT: rop = FFB_ROP_NOLD; break; - case GL_EQUIV: rop = FFB_ROP_NNEW_XOR_NOLD; break; - case GL_AND_REVERSE: rop = FFB_ROP_NEW_AND_NOLD; break; - case GL_AND_INVERTED: rop = FFB_ROP_NNEW_AND_OLD; break; - case GL_OR_REVERSE: rop = FFB_ROP_NEW_OR_NOLD; break; - case GL_OR_INVERTED: rop = FFB_ROP_NNEW_OR_OLD; break; - - default: - return; - }; - - rop |= fmesa->rop & ~0xff; - if (rop != fmesa->rop) { - fmesa->rop = rop; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_ROP, 1); - - if (op == GL_COPY) - FALLBACK( ctx, FFB_BADATTR_BLENDROP, GL_FALSE ); - } -} - -#if 0 -/* XXX Also need to track near/far just like 3dfx driver. - * XXX - * XXX Actually, that won't work, because the 3dfx chip works by - * XXX having 1/w coordinates fed to it for each primitive, and - * XXX it uses this to index it's 64 entry fog table. - */ -static void ffb_fog_linear(GLcontext *ctx, ffbContextPtr fmesa) -{ - GLfloat c = ctx->ProjectionMatrix.m[10]; - GLfloat d = ctx->ProjectionMatrix.m[14]; - GLfloat tz = ctx->Viewport.WindowMap.m[MAT_TZ]; - GLfloat szInv = 1.0F / ctx->Viewport.WindowMap.m[MAT_SZ]; - GLfloat fogEnd = ctx->Fog.End; - GLfloat fogScale = 1.0F / (ctx->Fog.End - ctx->Fog.Start); - GLfloat ndcz; - GLfloat eyez; - GLfloat Zzero, Zone; - unsigned int zb, zf; - - /* Compute the Z at which f reaches 0.0, this is the full - * saturation point. - * - * Thus compute Z (as seen by the chip during rendering), - * such that: - * - * 0.0 = (fogEnd - eyez) * fogScale - * - * fogScale is usually not zero, thus we are looking for: - * - * fogEnd = eyez - * - * fogEnd = -d / (c + ((Z - tz) * szInv)) - * fogEnd * (c + ((Z - tz) * szInv)) = -d - * (c + ((Z - tz) * szInv)) = -d / fogEnd - * (Z - tz) * szInv = (-d / fogEnd) - c - * (Z - tz) = ((-d / fogEnd) - c) / szInv - * Z = (((-d / fogEnd) - c) / szInv) + tz - */ - Zzero = (((-d / fogEnd) - c) / szInv) + tz; - - /* Compute the Z at which f reaches 1.0, this is where - * the incoming frag's full intensity is shown. This - * equation is: - * - * 1.0 = (fogEnd - eyez) - * - * We are looking for: - * - * 1.0 + eyez = fogEnd - * - * 1.0 + (-d / (c + ((Z - tz) * szInv))) = fogEnd - * -d / (c + ((Z - tz) * szInv)) = fogEnd - 1.0 - * -d / (FogEnd - 1.0) = (c + ((Z - tz) * szInv)) - * (-d / (fogEnd - 1.0)) - c = ((Z - tz) * szInv) - * ((-d / (fogEnd - 1.0)) - c) / szInv = (Z - tz) - * (((-d / (fogEnd - 1.0)) - c) / szInv) + tz = Z - */ - Zone = (((-d / (fogEnd - 1.0)) - c) / szInv) + tz; - - /* FFB's Zfront must be less than Zback, thus we may have - * to invert Sf/Sb to satisfy this constraint. - */ - if (Zzero < Zone) { - sf = 0.0; - sb = 1.0; - zf = Z_FROM_MESA(Zzero); - zb = Z_FROM_MESA(Zone); - } else { - sf = 1.0; - sb = 0.0; - zf = Z_FROM_MESA(Zone); - zb = Z_FROM_MESA(Zzero); - } -} -#endif - -static void ffbDDFogfv(GLcontext *ctx, GLenum pname, const GLfloat *param) -{ -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDFogfv: pname(%s)\n", _mesa_lookup_enum_by_nr(pname)); -#endif -} - -static void ffbDDLineStipple(GLcontext *ctx, GLint factor, GLushort pattern) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDLineStipple: factor(%d) pattern(%04x)\n", - factor, pattern); -#endif - if (ctx->Line.StippleFlag) { - factor = ctx->Line.StippleFactor; - pattern = ctx->Line.StipplePattern; - if ((GLuint) factor > 15) { - fmesa->lpat = FFB_LPAT_BAD; - } else { - fmesa->lpat = ((factor << FFB_LPAT_SCALEVAL_SHIFT) | - (0 << FFB_LPAT_PATLEN_SHIFT) | - ((pattern & 0xffff) << FFB_LPAT_PATTERN_SHIFT)); - } - } else { - fmesa->lpat = 0; - } -} - -void ffbXformAreaPattern(ffbContextPtr fmesa, const GLubyte *mask) -{ - __DRIdrawable *dPriv = fmesa->driDrawable; - int i, lines, xoff; - - lines = 0; - i = (dPriv->y + dPriv->h) & (32 - 1); - xoff = dPriv->x & (32 - 1); - while (lines++ < 32) { - GLuint raw = - (((GLuint)mask[0] << 24) | - ((GLuint)mask[1] << 16) | - ((GLuint)mask[2] << 8) | - ((GLuint)mask[3] << 0)); - - fmesa->pattern[i] = - (raw << xoff) | (raw >> (32 - xoff)); - i = (i - 1) & (32 - 1); - mask += 4; - } - - FFB_MAKE_DIRTY(fmesa, FFB_STATE_APAT, 32); -} - -static void ffbDDPolygonStipple(GLcontext *ctx, const GLubyte *mask) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDPolygonStipple: state(%d)\n", - ctx->Polygon.StippleFlag); -#endif - ffbXformAreaPattern(fmesa, mask); -} - -static void ffbDDEnable(GLcontext *ctx, GLenum cap, GLboolean state) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - unsigned int tmp; - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDEnable: %s state(%d)\n", - _mesa_lookup_enum_by_nr(cap), state); -#endif - switch (cap) { - case GL_ALPHA_TEST: - if (state) - tmp = ffbComputeAlphaFunc(ctx); - else - tmp = FFB_XCLIP_TEST_ALWAYS; - - if (tmp != fmesa->xclip) { - fmesa->xclip = tmp; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_XCLIP, 1); - } - break; - - case GL_BLEND: - tmp = (fmesa->ppc & ~FFB_PPC_ABE_MASK); - if (state) { - tmp |= FFB_PPC_ABE_ENABLE; - } else { - tmp |= FFB_PPC_ABE_DISABLE; - } - if (fmesa->ppc != tmp) { - fmesa->ppc = tmp; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_PPC, 1); - ffbDDBlendFuncSeparate(ctx, 0, 0, 0, 0 ); - } - break; - - case GL_DEPTH_TEST: - if (state) - tmp = 0x0fffffff; - else - tmp = 0x00000000; - if (tmp != fmesa->magnc) { - unsigned int fbc = fmesa->fbc; - fbc &= ~FFB_FBC_ZE_MASK; - if (state) - fbc |= FFB_FBC_ZE_ON; - else - fbc |= FFB_FBC_ZE_OFF; - fmesa->fbc = fbc; - ffbDDDepthFunc(ctx, ctx->Depth.Func); - fmesa->magnc = tmp; - FFB_MAKE_DIRTY(fmesa, (FFB_STATE_MAGNC | FFB_STATE_FBC), 2); - } - break; - - case GL_SCISSOR_TEST: - ffbDDScissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height); - break; - - case GL_STENCIL_TEST: - if (!(fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)) { - FALLBACK( ctx, FFB_BADATTR_STENCIL, state ); - } - - tmp = fmesa->fbc & ~FFB_FBC_YE_MASK; - if (state) { - ffbDDStencilFuncSeparate(ctx, GL_FRONT, - ctx->Stencil.Function[0], - ctx->Stencil.Ref[0], - ctx->Stencil.ValueMask[0]); - ffbDDStencilMaskSeparate(ctx, GL_FRONT, - ctx->Stencil.WriteMask[0]); - ffbDDStencilOpSeparate(ctx, GL_FRONT, - ctx->Stencil.FailFunc[0], - ctx->Stencil.ZFailFunc[0], - ctx->Stencil.ZPassFunc[0]); - tmp |= FFB_FBC_YE_MASK; - } else { - fmesa->stencil = 0xf0000000; - fmesa->stencilctl = 0x33300000; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_STENCIL, 6); - tmp |= FFB_FBC_YE_OFF; - } - if (tmp != fmesa->fbc) { - fmesa->fbc = tmp; - FFB_MAKE_DIRTY(fmesa, FFB_STATE_FBC, 1); - } - break; - - case GL_FOG: - /* Until I implement the fog support... */ - FALLBACK( ctx, FFB_BADATTR_FOG, state ); - break; - - case GL_LINE_STIPPLE: - if (! state) - fmesa->lpat = 0; - else - ffbDDLineStipple(ctx, - ctx->Line.StippleFactor, - ctx->Line.StipplePattern); - break; - - case GL_POLYGON_STIPPLE: - /* Do nothing, we interrogate the state during - * reduced primitive changes. Since our caller - * will set NEW_POLYGON in the ctx NewState this - * will cause the driver rasterization functions - * to be reevaluated, which will cause us to force - * a reduced primitive change next rendering pass - * and it all works out. - */ - break; - - default: - break; - }; -} - -void ffbSyncHardware(ffbContextPtr fmesa) -{ - ffb_fbcPtr ffb = fmesa->regs; - unsigned int dirty; - int i; - - FFBFifo(fmesa, fmesa->state_fifo_ents); - - dirty = fmesa->state_dirty; - if (dirty & (FFB_STATE_FBC | FFB_STATE_PPC | FFB_STATE_DRAWOP | - FFB_STATE_ROP | FFB_STATE_LPAT | FFB_STATE_WID)) { - if (dirty & FFB_STATE_FBC) - ffb->fbc = fmesa->fbc; - if (dirty & FFB_STATE_PPC) - ffb->ppc = fmesa->ppc; - if (dirty & FFB_STATE_DRAWOP) - ffb->drawop = fmesa->drawop; - if (dirty & FFB_STATE_ROP) - ffb->rop = fmesa->rop; - if (dirty & FFB_STATE_LPAT) - ffb->rop = fmesa->lpat; - if (dirty & FFB_STATE_WID) - ffb->wid = fmesa->wid; - } - if (dirty & (FFB_STATE_PMASK | FFB_STATE_XPMASK | FFB_STATE_YPMASK | - FFB_STATE_ZPMASK | FFB_STATE_XCLIP | FFB_STATE_CMP | - FFB_STATE_MATCHAB | FFB_STATE_MAGNAB | FFB_STATE_MATCHC | - FFB_STATE_MAGNC)) { - if (dirty & FFB_STATE_PMASK) - ffb->pmask = fmesa->pmask; - if (dirty & FFB_STATE_XPMASK) - ffb->xpmask = fmesa->xpmask; - if (dirty & FFB_STATE_YPMASK) - ffb->ypmask = fmesa->ypmask; - if (dirty & FFB_STATE_ZPMASK) - ffb->zpmask = fmesa->zpmask; - if (dirty & FFB_STATE_XCLIP) - ffb->xclip = fmesa->xclip; - if (dirty & FFB_STATE_CMP) - ffb->cmp = fmesa->cmp; - if (dirty & FFB_STATE_MATCHAB) - ffb->matchab = fmesa->matchab; - if (dirty & FFB_STATE_MAGNAB) - ffb->magnab = fmesa->magnab; - if (dirty & FFB_STATE_MATCHC) - ffb->matchc = fmesa->matchc; - if (dirty & FFB_STATE_MAGNC) - ffb->magnc = fmesa->magnc; - } - - if (dirty & FFB_STATE_DCUE) { - ffb->dcss = fmesa->dcss; - ffb->dcsf = fmesa->dcsf; - ffb->dcsb = fmesa->dcsb; - ffb->dczf = fmesa->dczf; - ffb->dczb = fmesa->dczb; - if (fmesa->ffb_sarea->flags & (FFB_DRI_FFB2 | FFB_DRI_FFB2PLUS)) { - ffb->dcss1 = fmesa->dcss1; - ffb->dcss2 = fmesa->dcss2; - ffb->dcss3 = fmesa->dcss3; - ffb->dcs2 = fmesa->dcs2; - ffb->dcs3 = fmesa->dcs3; - ffb->dcs4 = fmesa->dcs4; - ffb->dcd2 = fmesa->dcd2; - ffb->dcd3 = fmesa->dcd3; - ffb->dcd4 = fmesa->dcd4; - } - } - - if (dirty & FFB_STATE_BLEND) { - ffb->blendc = fmesa->blendc; - ffb->blendc1 = fmesa->blendc1; - ffb->blendc2 = fmesa->blendc2; - } - - if (dirty & FFB_STATE_CLIP) { - ffb->vclipmin = fmesa->vclipmin; - ffb->vclipmax = fmesa->vclipmax; - ffb->vclipzmin = fmesa->vclipzmin; - ffb->vclipzmax = fmesa->vclipzmax; - for (i = 0; i < 4; i++) { - ffb->auxclip[i].min = fmesa->aux_clips[i].min; - ffb->auxclip[i].max = fmesa->aux_clips[i].max; - } - } - - if ((dirty & FFB_STATE_STENCIL) && - (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)) { - ffb->stencil = fmesa->stencil; - ffb->stencilctl = fmesa->stencilctl; - ffb->fbc = FFB_FBC_WB_C; - ffb->rawstencilctl = (fmesa->stencilctl | (1 << 19)); - ffb->fbc = fmesa->fbc; - ffb->consty = fmesa->consty; - } - - if (dirty & FFB_STATE_APAT) { - for (i = 0; i < 32; i++) - ffb->pattern[i] = fmesa->pattern[i]; - } - - fmesa->state_dirty = 0; - fmesa->state_fifo_ents = 0; - fmesa->ffbScreen->rp_active = 1; -} - -static void ffbDDUpdateState(GLcontext *ctx, GLuint newstate) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - /* When we are hw rendering, changing certain kinds of - * state does not require flushing all of our context. - */ - if (fmesa->bad_fragment_attrs == 0 && - (newstate & ~_NEW_COLOR) == 0) - return; - - _swrast_InvalidateState( ctx, newstate ); - _swsetup_InvalidateState( ctx, newstate ); - _vbo_InvalidateState( ctx, newstate ); - _tnl_InvalidateState( ctx, newstate ); - - if (newstate & _NEW_TEXTURE) - FALLBACK( ctx, FFB_BADATTR_TEXTURE, - (ctx->Texture._EnabledUnits != 0)); - -#ifdef STATE_TRACE - fprintf(stderr, "ffbDDUpdateState: newstate(%08x)\n", newstate); -#endif - - fmesa->new_gl_state |= newstate; - - /* Force a reduced primitive change next rendering - * pass. - */ - fmesa->raster_primitive = GL_POLYGON + 1; - -#if 0 - /* When the modelview matrix changes, this changes what - * the eye coordinates will be so we have to recompute - * the depth cueing parameters. - * - * XXX DD_HAVE_HARDWARE_FOG. - */ - if (ctx->Fog.Enabled && (newstate & _NEW_MODELVIEW)) - ffb_update_fog(); -#endif -} - - -void ffbDDInitStateFuncs(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - ctx->Driver.UpdateState = ffbDDUpdateState; - - ctx->Driver.Enable = ffbDDEnable; - ctx->Driver.AlphaFunc = ffbDDAlphaFunc; - ctx->Driver.BlendEquationSeparate = ffbDDBlendEquationSeparate; - ctx->Driver.BlendFuncSeparate = ffbDDBlendFuncSeparate; - ctx->Driver.DepthFunc = ffbDDDepthFunc; - ctx->Driver.DepthMask = ffbDDDepthMask; - ctx->Driver.Fogfv = ffbDDFogfv; - ctx->Driver.LineStipple = ffbDDLineStipple; - ctx->Driver.PolygonStipple = ffbDDPolygonStipple; - ctx->Driver.Scissor = ffbDDScissor; - ctx->Driver.ColorMask = ffbDDColorMask; - ctx->Driver.LogicOpcode = ffbDDLogicOp; - ctx->Driver.Viewport = ffbDDViewport; - ctx->Driver.DepthRange = ffbDDDepthRange; - - if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS) { - ctx->Driver.StencilFuncSeparate = ffbDDStencilFuncSeparate; - ctx->Driver.StencilMaskSeparate = ffbDDStencilMaskSeparate; - ctx->Driver.StencilOpSeparate = ffbDDStencilOpSeparate; - } - - ctx->Driver.DrawBuffer = ffbDDDrawBuffer; - ctx->Driver.ReadBuffer = ffbDDReadBuffer; - ctx->Driver.ClearColor = ffbDDClearColor; - ctx->Driver.ClearDepth = ffbDDClearDepth; - ctx->Driver.ClearStencil = ffbDDClearStencil; - - /* We will support color index modes later... -DaveM */ - /* - ctx->Driver.ClearIndex = 0; - ctx->Driver.IndexMask = 0; - */ -} - -void ffbDDInitContextHwState(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - int fifo_count = 0; - int i; - - fmesa->hw_locked = 0; - - fmesa->bad_fragment_attrs = 0; - fmesa->state_dirty = FFB_STATE_ALL; - fmesa->new_gl_state = ~0; - - fifo_count = 1; - fmesa->fbc = (FFB_FBC_WE_FORCEON | FFB_FBC_WM_COMBINED | - FFB_FBC_SB_BOTH | FFB_FBC_ZE_MASK | - FFB_FBC_YE_OFF | FFB_FBC_XE_OFF | - FFB_FBC_RGBE_MASK); - if (ctx->Visual.doubleBufferMode) { - /* Buffer B is the initial back buffer. */ - fmesa->back_buffer = 1; - fmesa->fbc |= FFB_FBC_WB_BC | FFB_FBC_RB_B; - } else { - fmesa->back_buffer = 0; - fmesa->fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A; - } - - fifo_count += 1; - fmesa->ppc = (FFB_PPC_ACE_DISABLE | FFB_PPC_DCE_DISABLE | - FFB_PPC_ABE_DISABLE | FFB_PPC_VCE_3D | - FFB_PPC_APE_DISABLE | FFB_PPC_TBE_OPAQUE | - FFB_PPC_ZS_CONST | FFB_PPC_YS_CONST | - FFB_PPC_XS_WID | FFB_PPC_CS_VAR); - - fifo_count += 3; - fmesa->drawop = FFB_DRAWOP_RECTANGLE; - - /* GL_COPY is the default LogicOp. */ - fmesa->rop = (FFB_ROP_NEW << 16) | (FFB_ROP_NEW << 8) | FFB_ROP_NEW; - - /* No line patterning enabled. */ - fmesa->lpat = 0x00000000; - - /* We do not know the WID value until the first context switch. */ - fifo_count += 1; - fmesa->wid = ~0; - - fifo_count += 5; - - /* ColorMask, all enabled. */ - fmesa->pmask = 0xffffffff; - - fmesa->xpmask = 0x000000ff; - fmesa->ypmask = 0x0000000f; - fmesa->zpmask = 0x0fffffff; - - /* AlphaFunc GL_ALWAYS, AlphaRef 0 */ - fmesa->xclip = FFB_XCLIP_TEST_ALWAYS | 0x00; - - /* This sets us up to use WID clipping (so the DRI clipping - * rectangle is unneeded by us). All other match and magnitude - * tests are set to pass. - */ - fifo_count += 5; - fmesa->cmp = ((FFB_CMP_MATCH_ALWAYS << 24) | /* MATCH C */ - (FFB_CMP_MAGN_ALWAYS << 16) | /* MAGN C */ - (FFB_CMP_MATCH_EQ << 8) | /* MATCH AB */ - (FFB_CMP_MAGN_ALWAYS << 0)); /* MAGN AB */ - fmesa->matchab = 0xff000000; - fmesa->magnab = 0x00000000; - fmesa->matchc = 0x00000000; - fmesa->magnc = 0x00000000; - - /* Depth cue parameters, all zeros to start. */ - fifo_count += 14; - fmesa->dcss = 0x00000000; - fmesa->dcsf = 0x00000000; - fmesa->dcsb = 0x00000000; - fmesa->dczf = 0x00000000; - fmesa->dczb = 0x00000000; - fmesa->dcss1 = 0x00000000; - fmesa->dcss2 = 0x00000000; - fmesa->dcss3 = 0x00000000; - fmesa->dcs2 = 0x00000000; - fmesa->dcs3 = 0x00000000; - fmesa->dcs4 = 0x00000000; - fmesa->dcd2 = 0x00000000; - fmesa->dcd3 = 0x00000000; - fmesa->dcd4 = 0x00000000; - - /* Alpha blending unit state. */ - fifo_count += 3; - fmesa->blendc = (1 << 0) | (0 << 2); /* src(GL_ONE) | dst(GL_ZERO) */ - fmesa->blendc1 = 0x00000000; - fmesa->blendc2 = 0x00000000; - - /* ViewPort clip state. */ - fifo_count += 4 + (4 * 2); - fmesa->vclipmin = 0x00000000; - fmesa->vclipmax = 0xffffffff; - fmesa->vclipzmin = 0x00000000; - fmesa->vclipzmax = 0x0fffffff; - for (i = 0; i < 4; i++) { - fmesa->aux_clips[0].min = 0x00000000; - fmesa->aux_clips[0].max = 0x00000000; - } - - /* Stenciling state. */ - fifo_count += 6; - fmesa->stencil = 0xf0000000; /* Stencil MASK, Y plane */ - fmesa->stencilctl = 0x33300000; /* All stencil tests disabled */ - fmesa->consty = 0x0; - - /* Area pattern, used for polygon stipples. */ - fifo_count += 32; - for (i = 0; i < 32; i++) - fmesa->pattern[i] = 0x00000000; - - fmesa->state_fifo_ents = fifo_count; - fmesa->state_all_fifo_ents = fifo_count; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_state.h b/src/mesa/drivers/dri/ffb/ffb_state.h deleted file mode 100644 index 19e72085fd..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_state.h +++ /dev/null @@ -1,12 +0,0 @@ - -#ifndef _FFB_STATE_H -#define _FFB_STATE_H - -extern void ffbDDInitStateFuncs(GLcontext *); -extern void ffbDDInitContextHwState(GLcontext *); - -extern void ffbCalcViewport(GLcontext *); -extern void ffbXformAreaPattern(ffbContextPtr, const GLubyte *); -extern void ffbSyncHardware(ffbContextPtr fmesa); - -#endif /* !(_FFB_STATE_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_stencil.c b/src/mesa/drivers/dri/ffb/ffb_stencil.c deleted file mode 100644 index 10cdfbc616..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_stencil.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/mtypes.h" -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_context.h" -#include "ffb_stencil.h" -#include "ffb_lock.h" - -#undef STENCIL_TRACE - -static void FFBWriteStencilSpan( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - const void *values, const GLubyte mask[] ) -{ - const GLubyte *stencil = (const GLubyte *) values; -#ifdef STENCIL_TRACE - fprintf(stderr, "FFBWriteStencilSpan: n(%d) x(%d) y(%d)\n", - (int) n, x, y); -#endif - if (ctx->Depth.Mask) { - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - GLuint *zptr; - GLuint i; - - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 2); - fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_OFF | - FFB_FBC_YE_ON | FFB_FBC_RGBE_OFF); - fmesa->regs->ppc = FFB_PPC_YS_VAR; - FFBWait(fmesa, fmesa->regs); - - y = (dPriv->h - y); - zptr = (GLuint *) - ((char *)fmesa->sfb32 + - ((dPriv->x + x) << 2) + - ((dPriv->y + y) << 13)); - - for (i = 0; i < n; i++) { - if (mask[i]) - *zptr = (stencil[i] & 0xf) << 28; - zptr++; - } - - FFBFifo(fmesa, 2); - fmesa->regs->fbc = fmesa->fbc; - fmesa->regs->ppc = fmesa->ppc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); - } -} - -static void FFBWriteStencilPixels( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, - const GLint x[], const GLint y[], - const void *values, const GLubyte mask[] ) -{ - const GLubyte *stencil = (const GLubyte *) values; -#ifdef STENCIL_TRACE - fprintf(stderr, "FFBWriteStencilPixels: n(%d)\n", (int) n); -#endif - if (ctx->Depth.Mask) { - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - char *zbase; - GLuint i; - - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 2); - fmesa->regs->fbc = (FFB_FBC_WB_C | FFB_FBC_ZE_OFF | - FFB_FBC_YE_ON | FFB_FBC_RGBE_OFF); - fmesa->regs->ppc = FFB_PPC_YS_VAR; - fmesa->ffbScreen->rp_active = 1; - FFBWait(fmesa, fmesa->regs); - - zbase = ((char *)fmesa->sfb32 + - (dPriv->x << 2) + (dPriv->y << 13)); - - for (i = 0; i < n; i++) { - GLint y1 = (dPriv->h - y[i]); - GLint x1 = x[i]; - GLuint *zptr; - - zptr = (GLuint *) - (zbase + (x1 << 2) + (y1 << 13)); - if (mask[i]) - *zptr = (stencil[i] & 0xf) << 28; - } - - FFBFifo(fmesa, 2); - fmesa->regs->fbc = fmesa->fbc; - fmesa->regs->ppc = fmesa->ppc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); - } -} - -static void FFBReadStencilSpan( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, - void *values) -{ - GLubyte *stencil = (GLubyte *) values; - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - GLuint *zptr; - GLuint i; - -#ifdef STENCIL_TRACE - fprintf(stderr, "FFBReadStencilSpan: n(%d) x(%d) y(%d)\n", - (int) n, x, y); -#endif - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 1); - fmesa->regs->fbc = FFB_FBC_RB_C; - fmesa->ffbScreen->rp_active = 1; - FFBWait(fmesa, fmesa->regs); - - y = (dPriv->h - y); - zptr = (GLuint *) - ((char *)fmesa->sfb32 + - ((dPriv->x + x) << 2) + - ((dPriv->y + y) << 13)); - - for (i = 0; i < n; i++) { - stencil[i] = (*zptr >> 28) & 0xf; - zptr++; - } - - FFBFifo(fmesa, 1); - fmesa->regs->fbc = fmesa->fbc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); -} - -static void FFBReadStencilPixels( GLcontext *ctx, - struct gl_renderbuffer *rb, - GLuint n, const GLint x[], const GLint y[], - void *values ) -{ - GLubyte *stencil = (GLubyte *) values; - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - __DRIdrawable *dPriv = fmesa->driDrawable; - char *zbase; - GLuint i; - -#ifdef STENCIL_TRACE - fprintf(stderr, "FFBReadStencilPixels: n(%d)\n", (int) n); -#endif - if (!fmesa->hw_locked) - LOCK_HARDWARE(fmesa); - FFBFifo(fmesa, 1); - fmesa->regs->fbc = FFB_FBC_RB_C; - fmesa->ffbScreen->rp_active = 1; - FFBWait(fmesa, fmesa->regs); - - zbase = ((char *)fmesa->sfb32 + - (dPriv->x << 2) + (dPriv->y << 13)); - - for (i = 0; i < n; i++) { - GLint y1 = (dPriv->h - y[i]); - GLint x1 = x[i]; - GLuint *zptr; - - zptr = (GLuint *) - (zbase + (x1 << 2) + (y1 << 13)); - stencil[i] = (*zptr >> 28) & 0xf; - } - - FFBFifo(fmesa, 1); - fmesa->regs->fbc = fmesa->fbc; - fmesa->ffbScreen->rp_active = 1; - if (!fmesa->hw_locked) - UNLOCK_HARDWARE(fmesa); -} - -/** - * Plug in the Get/Put routines for the given driRenderbuffer. - */ -void -ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis) -{ - assert(drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT); - drb->Base.GetRow = FFBReadStencilSpan; - drb->Base.GetValues = FFBReadStencilPixels; - drb->Base.PutRow = FFBWriteStencilSpan; - /*drb->Base.PutMonoRow = FFBWriteMonoStencilSpan;*/ - drb->Base.PutValues = FFBWriteStencilPixels; - drb->Base.PutMonoValues = NULL; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_stencil.h b/src/mesa/drivers/dri/ffb/ffb_stencil.h deleted file mode 100644 index 2d529980d1..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_stencil.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef _FFB_STENCIL_H -#define _FFB_STENCIL_H - -void ffbSetStencilFunctions(driRenderbuffer *drb, const GLvisual *vis); - -#endif /* !(_FFB_STENCIL_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_tex.c b/src/mesa/drivers/dri/ffb/ffb_tex.c deleted file mode 100644 index 95058e9069..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_tex.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "ffb_tex.h" - -/* No texture unit, all software. */ -void ffbDDInitTexFuncs(GLcontext *ctx) -{ -} diff --git a/src/mesa/drivers/dri/ffb/ffb_tex.h b/src/mesa/drivers/dri/ffb/ffb_tex.h deleted file mode 100644 index 4032e73209..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_tex.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D. - * Copyright (C) 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#ifndef _FFB_TEX_H -#define _FFB_TEX_H - -extern void ffbDDInitTexFuncs(GLcontext *ctx); - -#endif /* !(_FFB_DD_H) */ - diff --git a/src/mesa/drivers/dri/ffb/ffb_tris.c b/src/mesa/drivers/dri/ffb/ffb_tris.c deleted file mode 100644 index 8bf5ae498f..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_tris.c +++ /dev/null @@ -1,945 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000, 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "swrast/swrast.h" -#include "swrast/s_context.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - -#include "ffb_context.h" -#include "ffb_tris.h" -#include "ffb_lines.h" -#include "ffb_lock.h" -#include "ffb_points.h" -#include "ffb_state.h" -#include "ffb_vb.h" - -#undef TRI_DEBUG -#undef FFB_RENDER_TRACE -#undef STATE_TRACE - -#ifdef TRI_DEBUG -static void ffb_print_vertex(const ffb_vertex *v) -{ - fprintf(stderr, "Vertex @(%p): " - "X[%f] Y[%f] Z[%f]\n", - v, v->x, v->y, v->z); - fprintf(stderr, "Vertex @(%p): " - "A[%f] R[%f] G[%f] B[%f]\n", - v, - v->color[0].alpha, - v->color[0].red, - v->color[0].green, - v->color[0].blue); -} -#define FFB_DUMP_VERTEX(V) ffb_print_vertex(V) -#else -#define FFB_DUMP_VERTEX(V) do { } while(0) -#endif - -#define FFB_ALPHA_BIT 0x01 -#define FFB_FLAT_BIT 0x02 -#define FFB_TRI_CULL_BIT 0x04 -#define MAX_FFB_RENDER_FUNCS 0x08 - -/*********************************************************************** - * Build low-level triangle/quad rasterize functions * - ***********************************************************************/ - -#define FFB_TRI_FLAT_BIT 0x01 -#define FFB_TRI_ALPHA_BIT 0x02 -/*#define FFB_TRI_CULL_BIT 0x04*/ - -static ffb_tri_func ffb_tri_tab[0x8]; -static ffb_quad_func ffb_quad_tab[0x8]; - -#define IND (0) -#define TAG(x) x -#include "ffb_tritmp.h" - -#define IND (FFB_TRI_FLAT_BIT) -#define TAG(x) x##_flat -#include "ffb_tritmp.h" - -#define IND (FFB_TRI_CULL_BIT) -#define TAG(x) x##_cull -#include "ffb_tritmp.h" - -#define IND (FFB_TRI_CULL_BIT|FFB_TRI_FLAT_BIT) -#define TAG(x) x##_cull_flat -#include "ffb_tritmp.h" - -#define IND (FFB_TRI_ALPHA_BIT) -#define TAG(x) x##_alpha -#include "ffb_tritmp.h" - -#define IND (FFB_TRI_ALPHA_BIT|FFB_TRI_FLAT_BIT) -#define TAG(x) x##_alpha_flat -#include "ffb_tritmp.h" - -#define IND (FFB_TRI_ALPHA_BIT|FFB_TRI_CULL_BIT) -#define TAG(x) x##_alpha_cull -#include "ffb_tritmp.h" - -#define IND (FFB_TRI_ALPHA_BIT|FFB_TRI_CULL_BIT|FFB_TRI_FLAT_BIT) -#define TAG(x) x##_alpha_cull_flat -#include "ffb_tritmp.h" - -static void init_tri_tab(void) -{ - ffb_init(); - ffb_init_flat(); - ffb_init_cull(); - ffb_init_cull_flat(); - ffb_init_alpha(); - ffb_init_alpha_flat(); - ffb_init_alpha_cull(); - ffb_init_alpha_cull_flat(); -} - -/* Build a SWvertex from a hardware vertex. */ -static void ffb_translate_vertex(GLcontext *ctx, const ffb_vertex *src, - SWvertex *dst) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLfloat *m = ctx->Viewport._WindowMap.m; - const GLfloat sx = m[0]; - const GLfloat sy = m[5]; - const GLfloat sz = m[10]; - const GLfloat tx = m[12]; - const GLfloat ty = m[13]; - const GLfloat tz = m[14]; - - dst->attrib[FRAG_ATTRIB_WPOS][0] = sx * src->x + tx; - dst->attrib[FRAG_ATTRIB_WPOS][1] = sy * src->y + ty; - dst->attrib[FRAG_ATTRIB_WPOS][2] = sz * src->z + tz; - dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; - - dst->color[0] = FFB_UBYTE_FROM_COLOR(src->color[0].red); - dst->color[1] = FFB_UBYTE_FROM_COLOR(src->color[0].green); - dst->color[2] = FFB_UBYTE_FROM_COLOR(src->color[0].blue); - dst->color[3] = FFB_UBYTE_FROM_COLOR(src->color[0].alpha); -} - -/*********************************************************************** - * Build fallback triangle/quad rasterize functions * - ***********************************************************************/ - -static void ffb_fallback_triangle(GLcontext *ctx, ffb_vertex *v0, - ffb_vertex *v1, ffb_vertex *v2) -{ - SWvertex v[3]; - - ffb_translate_vertex(ctx, v0, &v[0]); - ffb_translate_vertex(ctx, v1, &v[1]); - ffb_translate_vertex(ctx, v2, &v[2]); - - _swrast_Triangle(ctx, &v[0], &v[1], &v[2]); -} - -static void ffb_fallback_quad(GLcontext *ctx, - ffb_vertex *v0, ffb_vertex *v1, - ffb_vertex *v2, ffb_vertex *v3) -{ - SWvertex v[4]; - - ffb_translate_vertex(ctx, v0, &v[0]); - ffb_translate_vertex(ctx, v1, &v[1]); - ffb_translate_vertex(ctx, v2, &v[2]); - ffb_translate_vertex(ctx, v3, &v[3]); - - _swrast_Quad(ctx, &v[0], &v[1], &v[2], &v[3]); -} - -void ffb_fallback_line(GLcontext *ctx, ffb_vertex *v0, ffb_vertex *v1) -{ - SWvertex v[2]; - - ffb_translate_vertex(ctx, v0, &v[0]); - ffb_translate_vertex(ctx, v1, &v[1]); - - _swrast_Line(ctx, &v[0], &v[1]); -} - -void ffb_fallback_point(GLcontext *ctx, ffb_vertex *v0) -{ - SWvertex v[1]; - - ffb_translate_vertex(ctx, v0, &v[0]); - - _swrast_Point(ctx, &v[0]); -} - -/*********************************************************************** - * Rasterization functions for culled tris/quads * - ***********************************************************************/ - -static void ffb_nodraw_triangle(GLcontext *ctx, ffb_vertex *v0, - ffb_vertex *v1, ffb_vertex *v2) -{ - (void) (ctx && v0 && v1 && v2); -} - -static void ffb_nodraw_quad(GLcontext *ctx, - ffb_vertex *v0, ffb_vertex *v1, - ffb_vertex *v2, ffb_vertex *v3) -{ - (void) (ctx && v0 && v1 && v2 && v3); -} - -static void ffb_update_cullsign(GLcontext *ctx) -{ - GLfloat backface_sign = 1; - - switch (ctx->Polygon.CullFaceMode) { - case GL_BACK: - if (ctx->Polygon.FrontFace==GL_CCW) - backface_sign = -1; - break; - - case GL_FRONT: - if (ctx->Polygon.FrontFace!=GL_CCW) - backface_sign = -1; - break; - - default: - break; - }; - - FFB_CONTEXT(ctx)->backface_sign = backface_sign; -} - -/*********************************************************************** - * Choose triangle/quad rasterize functions * - ***********************************************************************/ - -void ffbChooseTriangleState(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint ind = 0; - - if (flags & DD_TRI_SMOOTH) { - fmesa->draw_tri = ffb_fallback_triangle; - fmesa->draw_quad = ffb_fallback_quad; - return; - } - - if (flags & DD_FLATSHADE) - ind |= FFB_TRI_FLAT_BIT; - - if (ctx->Polygon.CullFlag) { - if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) { - fmesa->draw_tri = ffb_nodraw_triangle; - fmesa->draw_quad = ffb_nodraw_quad; - return; - } - - ind |= FFB_TRI_CULL_BIT; - ffb_update_cullsign(ctx); - } else - FFB_CONTEXT(ctx)->backface_sign = 0; - - /* If blending or the alpha test is enabled we need to - * provide alpha components to the chip, else we can - * do without it and thus feed vertex data to the chip - * more efficiently. - */ - if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled) - ind |= FFB_TRI_ALPHA_BIT; - - fmesa->draw_tri = ffb_tri_tab[ind]; - fmesa->draw_quad = ffb_quad_tab[ind]; -} - -static const GLenum reduced_prim[GL_POLYGON+1] = { - GL_POINTS, - GL_LINES, - GL_LINES, - GL_LINES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES, - GL_TRIANGLES -}; - -static void ffbRenderPrimitive(GLcontext *ctx, GLenum prim); -static void ffbRasterPrimitive(GLcontext *ctx, GLenum rprim); - -/*********************************************************************** - * Build render functions from dd templates * - ***********************************************************************/ - -#define FFB_OFFSET_BIT 0x01 -#define FFB_TWOSIDE_BIT 0x02 -#define FFB_UNFILLED_BIT 0x04 -#define FFB_MAX_TRIFUNC 0x08 - -static struct { - tnl_triangle_func triangle; - tnl_quad_func quad; -} rast_tab[FFB_MAX_TRIFUNC]; - -#define DO_OFFSET (IND & FFB_OFFSET_BIT) -#define DO_UNFILLED (IND & FFB_UNFILLED_BIT) -#define DO_TWOSIDE (IND & FFB_TWOSIDE_BIT) -#define DO_FLAT 0 -#define DO_QUAD 1 -#define DO_FULL_QUAD 1 -#define DO_TRI 1 -#define DO_LINE 0 -#define DO_POINTS 0 - -#define QUAD( a, b, c, d ) fmesa->draw_quad( ctx, a, b, c, d ) -#define TRI( a, b, c ) fmesa->draw_tri( ctx, a, b, c ) -#define LINE( a, b ) fmesa->draw_line( ctx, a, b ) -#define POINT( a ) fmesa->draw_point( ctx, a ) - -#define HAVE_BACK_COLORS 1 -#define HAVE_RGBA 1 -#define HAVE_SPEC 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX ffb_vertex -#define TAB rast_tab - -#define UNFILLED_TRI unfilled_tri -#define UNFILLED_QUAD unfilled_quad -#define DEPTH_SCALE (fmesa->depth_scale) -#define VERT_X(_v) (_v->x) -#define VERT_Y(_v) (_v->y) -#define VERT_Z(_v) (_v->z) -#define AREA_IS_CCW( a ) (a < fmesa->ffb_zero) -#define GET_VERTEX(e) (&fmesa->verts[e]) -#define INSANE_VERTICES -#define VERT_SET_Z(v,val) ((v)->z = (val)) -#define VERT_Z_ADD(v,val) ((v)->z += (val)) - -#define VERT_COPY_RGBA1( _v ) _v->color[0] = _v->color[1] -#define VERT_COPY_RGBA( v0, v1 ) v0->color[0] = v1->color[0] -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->color[0] -#define VERT_RESTORE_RGBA( idx ) v[idx]->color[0] = color[idx] - -#define LOCAL_VARS(n) \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); \ - __DRIdrawable *dPriv = fmesa->driDrawable; \ - ffb_color color[n] = { { 0 } }; \ - (void) color; (void) dPriv; - -/*********************************************************************** - * Helpers for rendering unfilled primitives * - ***********************************************************************/ - -#define RASTERIZE(x) if (fmesa->raster_primitive != reduced_prim[x]) \ - ffbRasterPrimitive( ctx, reduced_prim[x] ) -#define RENDER_PRIMITIVE fmesa->render_primitive -#define TAG(x) x -#include "tnl_dd/t_dd_unfilled.h" - -/*********************************************************************** - * Generate GL render functions * - ***********************************************************************/ - -#define IND (0) -#define TAG(x) x -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FFB_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FFB_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FFB_TWOSIDE_BIT|FFB_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FFB_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FFB_OFFSET_BIT|FFB_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FFB_TWOSIDE_BIT|FFB_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (FFB_TWOSIDE_BIT|FFB_OFFSET_BIT|FFB_UNFILLED_BIT) -#define TAG(x) x##_twoside_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -static void init_rast_tab( void ) -{ - init(); - init_offset(); - init_twoside(); - init_twoside_offset(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_twoside_offset_unfilled(); -} - -/**********************************************************************/ -/* Render clipped primitives */ -/**********************************************************************/ - -static void ffbRenderClippedPolygon(GLcontext *ctx, const GLuint *elts, GLuint n) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint prim = fmesa->render_primitive; - - /* Render the new vertices as an unclipped polygon. */ - { - GLuint *tmp = VB->Elts; - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON](ctx, 0, n, PRIM_BEGIN|PRIM_END); - VB->Elts = tmp; - } - - /* Restore the render primitive. */ - if (prim != GL_POLYGON) - tnl->Driver.Render.PrimitiveNotify(ctx, prim); -} - -static void ffbRenderClippedLine(GLcontext *ctx, GLuint ii, GLuint jj) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line(ctx, ii, jj); -} - -/**********************************************************************/ -/* Render unclipped begin/end objects */ -/**********************************************************************/ - -static void ffb_vb_noop(GLcontext *ctx, GLuint start, GLuint count, GLuint flags) -{ - (void)(ctx && start && count && flags); -} - -#define ELT(x) x - -#define IND 0 -#define TAG(x) x -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT) -#define TAG(x) x##_flat -#include "ffb_rendertmp.h" - -#define IND (FFB_ALPHA_BIT) -#define TAG(x) x##_alpha -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT) -#define TAG(x) x##_flat_alpha -#include "ffb_rendertmp.h" - -#define IND (FFB_TRI_CULL_BIT) -#define TAG(x) x##_tricull -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT | FFB_TRI_CULL_BIT) -#define TAG(x) x##_flat_tricull -#include "ffb_rendertmp.h" - -#define IND (FFB_ALPHA_BIT | FFB_TRI_CULL_BIT) -#define TAG(x) x##_alpha_tricull -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT | FFB_TRI_CULL_BIT) -#define TAG(x) x##_flat_alpha_tricull -#include "ffb_rendertmp.h" - -#undef ELT -#define ELT(x) elt[x] - -#define IND 0 -#define TAG(x) x##_elt -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT) -#define TAG(x) x##_flat_elt -#include "ffb_rendertmp.h" - -#define IND (FFB_ALPHA_BIT) -#define TAG(x) x##_alpha_elt -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT) -#define TAG(x) x##_flat_alpha_elt -#include "ffb_rendertmp.h" - -#define IND (FFB_TRI_CULL_BIT) -#define TAG(x) x##_tricull_elt -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT | FFB_TRI_CULL_BIT) -#define TAG(x) x##_flat_tricull_elt -#include "ffb_rendertmp.h" - -#define IND (FFB_ALPHA_BIT | FFB_TRI_CULL_BIT) -#define TAG(x) x##_alpha_tricull_elt -#include "ffb_rendertmp.h" - -#define IND (FFB_FLAT_BIT | FFB_ALPHA_BIT | FFB_TRI_CULL_BIT) -#define TAG(x) x##_flat_alpha_tricull_elt -#include "ffb_rendertmp.h" - -static void *render_tabs[MAX_FFB_RENDER_FUNCS]; -static void *render_tabs_elt[MAX_FFB_RENDER_FUNCS]; - -static void init_render_tab(void) -{ - int i; - - render_tabs[0] = render_tab; - render_tabs[FFB_FLAT_BIT] = render_tab_flat; - render_tabs[FFB_ALPHA_BIT] = render_tab_alpha; - render_tabs[FFB_FLAT_BIT|FFB_ALPHA_BIT] = render_tab_flat_alpha; - render_tabs[FFB_TRI_CULL_BIT] = render_tab_tricull; - render_tabs[FFB_FLAT_BIT|FFB_TRI_CULL_BIT] = render_tab_flat_tricull; - render_tabs[FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] = render_tab_alpha_tricull; - render_tabs[FFB_FLAT_BIT|FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] = - render_tab_flat_alpha_tricull; - - render_tabs_elt[0] = render_tab_elt; - render_tabs_elt[FFB_FLAT_BIT] = render_tab_flat_elt; - render_tabs_elt[FFB_ALPHA_BIT] = render_tab_alpha_elt; - render_tabs_elt[FFB_FLAT_BIT|FFB_ALPHA_BIT] = render_tab_flat_alpha_elt; - render_tabs_elt[FFB_TRI_CULL_BIT] = render_tab_tricull_elt; - render_tabs_elt[FFB_FLAT_BIT|FFB_TRI_CULL_BIT] = render_tab_flat_tricull_elt; - render_tabs_elt[FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] = render_tab_alpha_tricull_elt; - render_tabs_elt[FFB_FLAT_BIT|FFB_ALPHA_BIT|FFB_TRI_CULL_BIT] = - render_tab_flat_alpha_tricull_elt; - - for (i = 0; i < MAX_FFB_RENDER_FUNCS; i++) { - tnl_render_func *rf = render_tabs[i]; - tnl_render_func *rfe = render_tabs_elt[i]; - - if (i & FFB_TRI_CULL_BIT) { - int from_idx = (i & ~FFB_TRI_CULL_BIT); - tnl_render_func *rf_from = render_tabs[from_idx]; - tnl_render_func *rfe_from = render_tabs_elt[from_idx]; - int j; - - for (j = GL_POINTS; j < GL_TRIANGLES; j++) { - rf[j] = rf_from[j]; - rfe[j] = rfe_from[j]; - } - } - } -} - -/**********************************************************************/ -/* Choose render functions */ -/**********************************************************************/ - -#ifdef FFB_RENDER_TRACE -static void ffbPrintRenderFlags(GLuint index, GLuint render_index) -{ - fprintf(stderr, - "ffbChooseRenderState: " - "index(%s%s%s) " - "render_index(%s%s%s)\n", - ((index & FFB_TWOSIDE_BIT) ? "twoside " : ""), - ((index & FFB_OFFSET_BIT) ? "offset " : ""), - ((index & FFB_UNFILLED_BIT) ? "unfilled " : ""), - ((render_index & FFB_FLAT_BIT) ? "flat " : ""), - ((render_index & FFB_ALPHA_BIT) ? "alpha " : ""), - ((render_index & FFB_TRI_CULL_BIT) ? "tricull " : "")); -} -#endif - -void ffbChooseRenderState(GLcontext *ctx) -{ - GLuint flags = ctx->_TriangleCaps; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint index = 0; - - /* Per-primitive fallbacks and the selection of fmesa->draw_* are - * handled elsewhere. - */ - if (flags & DD_TRI_LIGHT_TWOSIDE) - index |= FFB_TWOSIDE_BIT; - - if (flags & DD_TRI_OFFSET) - index |= FFB_OFFSET_BIT; - - if (flags & DD_TRI_UNFILLED) - index |= FFB_UNFILLED_BIT; - - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (index == 0) { - GLuint render_index = 0; - - if (flags & DD_FLATSHADE) - render_index |= FFB_FLAT_BIT; - - if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled) - render_index |= FFB_ALPHA_BIT; - - if (ctx->Polygon.CullFlag) - render_index |= FFB_TRI_CULL_BIT; - -#ifdef FFB_RENDER_TRACE - ffbPrintRenderFlags(index, render_index); -#endif - tnl->Driver.Render.PrimTabVerts = render_tabs[render_index]; - tnl->Driver.Render.PrimTabElts = render_tabs_elt[render_index]; - } else { -#ifdef FFB_RENDER_TRACE - ffbPrintRenderFlags(index, 0); -#endif - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - } - - tnl->Driver.Render.ClippedPolygon = ffbRenderClippedPolygon; - tnl->Driver.Render.ClippedLine = ffbRenderClippedLine; -} - -static void ffbRunPipeline(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - if (fmesa->bad_fragment_attrs == 0 && - fmesa->new_gl_state) { - if (fmesa->new_gl_state & _FFB_NEW_TRIANGLE) - ffbChooseTriangleState(ctx); - if (fmesa->new_gl_state & _FFB_NEW_LINE) - ffbChooseLineState(ctx); - if (fmesa->new_gl_state & _FFB_NEW_POINT) - ffbChoosePointState(ctx); - if (fmesa->new_gl_state & _FFB_NEW_RENDER) - ffbChooseRenderState(ctx); - if (fmesa->new_gl_state & _FFB_NEW_VERTEX) - ffbChooseVertexState(ctx); - - fmesa->new_gl_state = 0; - } - - _tnl_run_pipeline(ctx); -} - -static void ffbRenderStart(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - LOCK_HARDWARE(fmesa); - fmesa->hw_locked = 1; - - if (fmesa->state_dirty != 0) - ffbSyncHardware(fmesa); -} - -static void ffbRenderFinish(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - UNLOCK_HARDWARE(fmesa); - fmesa->hw_locked = 0; -} - -/* Even when doing full software rendering we need to - * wrap render{start,finish} so that the hardware is kept - * in sync (because multipass rendering changes the write - * buffer etc.) - */ -static void ffbSWRenderStart(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - LOCK_HARDWARE(fmesa); - fmesa->hw_locked = 1; - - if (fmesa->state_dirty != 0) - ffbSyncHardware(fmesa); -} - -static void ffbSWRenderFinish(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - UNLOCK_HARDWARE(fmesa); - fmesa->hw_locked = 0; -} - -static void ffbRasterPrimitive(GLcontext *ctx, GLenum rprim) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLuint drawop, fbc, ppc; - int do_sw = 0; - - fmesa->raster_primitive = rprim; - - drawop = fmesa->drawop; - fbc = fmesa->fbc; - ppc = fmesa->ppc & ~(FFB_PPC_ZS_MASK | FFB_PPC_CS_MASK); - -#ifdef STATE_TRACE - fprintf(stderr, - "ffbReducedPrimitiveChange: rprim(%d) ", rprim); -#endif - switch(rprim) { - case GL_POINTS: -#ifdef STATE_TRACE - fprintf(stderr, "GL_POINTS "); -#endif - if (fmesa->draw_point == ffb_fallback_point) { - do_sw = 1; - break; - } - - if (ctx->Point.SmoothFlag) { - ppc |= (FFB_PPC_ZS_VAR | FFB_PPC_CS_CONST); - drawop = FFB_DRAWOP_AADOT; - } else { - ppc |= (FFB_PPC_ZS_CONST | FFB_PPC_CS_CONST); - drawop = FFB_DRAWOP_DOT; - } - break; - - case GL_LINES: -#ifdef STATE_TRACE - fprintf(stderr, "GL_LINES "); -#endif - if (fmesa->draw_line == ffb_fallback_line) { - do_sw = 1; - break; - } - - if (ctx->_TriangleCaps & DD_FLATSHADE) { - ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_CONST; - } else { - ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_VAR; - } - if (ctx->Line.SmoothFlag) - drawop = FFB_DRAWOP_AALINE; - else - drawop = FFB_DRAWOP_DDLINE; - break; - - case GL_TRIANGLES: -#ifdef STATE_TRACE - fprintf(stderr, "GL_POLYGON "); -#endif - if (fmesa->draw_tri == ffb_fallback_triangle) { - do_sw = 1; - break; - } - - ppc &= ~FFB_PPC_APE_MASK; - if (ctx->Polygon.StippleFlag) - ppc |= FFB_PPC_APE_ENABLE; - else - ppc |= FFB_PPC_APE_DISABLE; - - if (ctx->_TriangleCaps & DD_FLATSHADE) { - ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_CONST; - } else { - ppc |= FFB_PPC_ZS_VAR | FFB_PPC_CS_VAR; - } - drawop = FFB_DRAWOP_TRIANGLE; - break; - - default: -#ifdef STATE_TRACE - fprintf(stderr, "unknown %d!\n", rprim); -#endif - return; - }; - -#ifdef STATE_TRACE - fprintf(stderr, "do_sw(%d) ", do_sw); -#endif - if (do_sw != 0) { - fbc &= ~(FFB_FBC_WB_C); - fbc &= ~(FFB_FBC_ZE_MASK | FFB_FBC_RGBE_MASK); - fbc |= FFB_FBC_ZE_OFF | FFB_FBC_RGBE_MASK; - ppc &= ~(FFB_PPC_XS_MASK | FFB_PPC_ABE_MASK | - FFB_PPC_DCE_MASK | FFB_PPC_APE_MASK); - ppc |= (FFB_PPC_ZS_VAR | FFB_PPC_CS_VAR | FFB_PPC_XS_WID | - FFB_PPC_ABE_DISABLE | FFB_PPC_DCE_DISABLE | - FFB_PPC_APE_DISABLE); - } else { - fbc |= FFB_FBC_WB_C; - fbc &= ~(FFB_FBC_RGBE_MASK); - fbc |= FFB_FBC_RGBE_MASK; - ppc &= ~(FFB_PPC_ABE_MASK | FFB_PPC_XS_MASK); - if (ctx->Color.BlendEnabled) { - if ((rprim == GL_POINTS && !ctx->Point.SmoothFlag) || - (rprim != GL_POINTS && ctx->_TriangleCaps & DD_FLATSHADE)) - ppc |= FFB_PPC_ABE_ENABLE | FFB_PPC_XS_CONST; - else - ppc |= FFB_PPC_ABE_ENABLE | FFB_PPC_XS_VAR; - } else { - ppc |= FFB_PPC_ABE_DISABLE | FFB_PPC_XS_WID; - } - } -#ifdef STATE_TRACE - fprintf(stderr, "fbc(%08x) ppc(%08x)\n", fbc, ppc); -#endif - - FFBFifo(fmesa, 4); - if (fmesa->drawop != drawop) - fmesa->regs->drawop = fmesa->drawop = drawop; - if (fmesa->fbc != fbc) - fmesa->regs->fbc = fmesa->fbc = fbc; - if (fmesa->ppc != ppc) - fmesa->regs->ppc = fmesa->ppc = ppc; - if (do_sw != 0) { - fmesa->regs->cmp = - (fmesa->cmp & ~(0xff<<16)) | (0x80 << 16); - } else - fmesa->regs->cmp = fmesa->cmp; -} - -static void ffbRenderPrimitive(GLcontext *ctx, GLenum prim) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLuint rprim = reduced_prim[prim]; - - fmesa->render_primitive = prim; - - if (rprim == GL_TRIANGLES && (ctx->_TriangleCaps & DD_TRI_UNFILLED)) - return; - - if (fmesa->raster_primitive != rprim) { - ffbRasterPrimitive( ctx, rprim ); - } -} - - - - -/**********************************************************************/ -/* Transition to/from hardware rasterization. */ -/**********************************************************************/ - -static char *fallbackStrings[] = { - "Fog enabled", - "Blend function", - "Blend ROP", - "Blend equation", - "Stencil", - "Texture", - "LIBGL_SOFTWARE_RENDERING" -}; - -static char *getFallbackString(GLuint bit) -{ - int i = 0; - - while (bit > 1) { - i++; - bit >>= 1; - } - return fallbackStrings[i]; -} - -void ffbFallback( GLcontext *ctx, GLuint bit, GLboolean mode ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = fmesa->bad_fragment_attrs; - - if (mode) { - fmesa->bad_fragment_attrs |= bit; - if (oldfallback == 0) { -/* FFB_FIREVERTICES(fmesa); */ - _swsetup_Wakeup( ctx ); - if (fmesa->debugFallbacks) - fprintf(stderr, "FFB begin software fallback: 0x%x %s\n", - bit, getFallbackString(bit)); - } - } else { - fmesa->bad_fragment_attrs &= ~bit; - if (oldfallback == bit) { - _swrast_flush( ctx ); - - tnl->Driver.Render.Start = ffbRenderStart; - tnl->Driver.Render.PrimitiveNotify = ffbRenderPrimitive; - tnl->Driver.Render.Finish = ffbRenderFinish; - fmesa->new_gl_state = ~0; - - /* Just re-choose everything: - */ - ffbChooseVertexState(ctx); - ffbChooseRenderState(ctx); - ffbChooseTriangleState(ctx); - ffbChooseLineState(ctx); - ffbChoosePointState(ctx); - - if (fmesa->debugFallbacks) - fprintf(stderr, "FFB end software fallback: 0x%x %s\n", - bit, getFallbackString(bit)); - } - } -} - -/**********************************************************************/ -/* Initialization. */ -/**********************************************************************/ - -void ffbDDInitRenderFuncs( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - SWcontext *swrast = SWRAST_CONTEXT(ctx); - static int firsttime = 1; - - if (firsttime) { - init_rast_tab(); - init_tri_tab(); - init_render_tab(); - firsttime = 0; - } - - tnl->Driver.RunPipeline = ffbRunPipeline; - tnl->Driver.Render.Start = ffbRenderStart; - tnl->Driver.Render.Finish = ffbRenderFinish; - tnl->Driver.Render.PrimitiveNotify = ffbRenderPrimitive; - tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - - swrast->Driver.SpanRenderStart = ffbSWRenderStart; - swrast->Driver.SpanRenderFinish = ffbSWRenderFinish; -} diff --git a/src/mesa/drivers/dri/ffb/ffb_tris.h b/src/mesa/drivers/dri/ffb/ffb_tris.h deleted file mode 100644 index 116b8e07f1..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_tris.h +++ /dev/null @@ -1,25 +0,0 @@ - -#ifndef _FFB_TRIS_H -#define _FFB_TRIS_H - -extern void ffbDDInitRenderFuncs( GLcontext *ctx ); - - -#define _FFB_NEW_RENDER (_DD_NEW_TRI_LIGHT_TWOSIDE | \ - _DD_NEW_TRI_OFFSET | \ - _DD_NEW_TRI_UNFILLED) - -extern void ffbChooseRenderState(GLcontext *ctx); - - -#define _FFB_NEW_TRIANGLE (_DD_NEW_TRI_SMOOTH | \ - _DD_NEW_FLATSHADE | \ - _NEW_POLYGON | \ - _NEW_COLOR) - -extern void ffbChooseTriangleState(GLcontext *ctx); - -extern void ffbFallback( GLcontext *ctx, GLuint bit, GLboolean mode ); -#define FALLBACK( ctx, bit, mode ) ffbFallback( ctx, bit, mode ) - -#endif /* !(_FFB_TRIS_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_tritmp.h b/src/mesa/drivers/dri/ffb/ffb_tritmp.h deleted file mode 100644 index 324a871ec4..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_tritmp.h +++ /dev/null @@ -1,238 +0,0 @@ - -static void TAG(ffb_triangle)( GLcontext *ctx, - ffb_vertex *v0, - ffb_vertex *v1, - ffb_vertex *v2 ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_fbcPtr ffb = fmesa->regs; -#if (IND & FFB_TRI_FLAT_BIT) - GLuint const_fg; -#endif - FFB_DELAYED_VIEWPORT_VARS; - -#ifdef TRI_DEBUG - fprintf(stderr, "FFB: ffb_triangle [" -#if (IND & FFB_TRI_CULL_BIT) - " CULL" -#endif -#if (IND & FFB_TRI_FLAT_BIT) - " FLAT" -#endif -#if (IND & FFB_TRI_ALPHA_BIT) - " ALPHA" -#endif - " ]\n"); -#endif - -#if (IND & FFB_TRI_CULL_BIT) - { /* NOTE: These are not viewport transformed yet. */ - GLfloat ex = v1->x - v0->x; - GLfloat ey = v1->y - v0->y; - GLfloat fx = v2->x - v0->x; - GLfloat fy = v2->y - v0->y; - GLfloat c = ex*fy-ey*fx; - - /* Culled... */ - if (c * fmesa->backface_sign > fmesa->ffb_zero) - return; - } -#endif - -#if (IND & FFB_TRI_FLAT_BIT) - const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( v2->color[0] ); -#ifdef TRI_DEBUG - fprintf(stderr, "FFB_tri: const_fg %08x (B[%f] G[%f] R[%f])\n", - const_fg, - FFB_2_30_FIXED_TO_FLOAT(v2->color[0].blue), - FFB_2_30_FIXED_TO_FLOAT(v2->color[0].green), - FFB_2_30_FIXED_TO_FLOAT(v2->color[0].red)); -#endif -#endif - - -#if (IND & FFB_TRI_FLAT_BIT) - FFBFifo(fmesa, 1); - ffb->fg = const_fg; -#endif - -#if (IND & FFB_TRI_FLAT_BIT) - FFBFifo(fmesa, 9); -#else -#if (IND & FFB_TRI_ALPHA_BIT) - FFBFifo(fmesa, 21); -#else - FFBFifo(fmesa, 18); -#endif -#endif - - FFB_DUMP_VERTEX(v0); -#if !(IND & FFB_TRI_FLAT_BIT) -#if (IND & FFB_TRI_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v0); -#endif - ffb->red = FFB_GET_RED(v0); - ffb->green = FFB_GET_GREEN(v0); - ffb->blue = FFB_GET_BLUE(v0); -#endif - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_DUMP_VERTEX(v1); -#if !(IND & FFB_TRI_FLAT_BIT) -#if (IND & FFB_TRI_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v1); -#endif - ffb->red = FFB_GET_RED(v1); - ffb->green = FFB_GET_GREEN(v1); - ffb->blue = FFB_GET_BLUE(v1); -#endif - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_DUMP_VERTEX(v2); -#if !(IND & FFB_TRI_FLAT_BIT) -#if (IND & FFB_TRI_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v2); -#endif - ffb->red = FFB_GET_RED(v2); - ffb->green = FFB_GET_GREEN(v2); - ffb->blue = FFB_GET_BLUE(v2); -#endif - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - - fmesa->ffbScreen->rp_active = 1; -} - - -static void TAG(ffb_quad)(GLcontext *ctx, - ffb_vertex *v0, - ffb_vertex *v1, - ffb_vertex *v2, - ffb_vertex *v3 ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_fbcPtr ffb = fmesa->regs; -#if (IND & FFB_TRI_FLAT_BIT) - GLuint const_fg; -#endif - FFB_DELAYED_VIEWPORT_VARS; - -#ifdef TRI_DEBUG - fprintf(stderr, "FFB: ffb_quad [" -#if (IND & FFB_TRI_CULL_BIT) - " CULL" -#endif -#if (IND & FFB_TRI_FLAT_BIT) - " FLAT" -#endif -#if (IND & FFB_TRI_ALPHA_BIT) - " ALPHA" -#endif - " ]\n"); -#endif /* TRI_DEBUG */ - -#if (IND & FFB_TRI_CULL_BIT) - { /* NOTE: These are not viewport transformed yet. */ - GLfloat ex = v2->x - v0->x; - GLfloat ey = v2->y - v0->y; - GLfloat fx = v3->x - v1->x; - GLfloat fy = v3->y - v1->y; - GLfloat c = ex*fy-ey*fx; - - /* Culled... */ - if (c * fmesa->backface_sign > fmesa->ffb_zero) - return; - } -#endif - -#if (IND & FFB_TRI_FLAT_BIT) - const_fg = FFB_PACK_CONST_UBYTE_ARGB_COLOR( v3->color[0] ); -#ifdef TRI_DEBUG - fprintf(stderr, "FFB_quad: const_fg %08x (B[%f] G[%f] R[%f])\n", - const_fg, - FFB_2_30_FIXED_TO_FLOAT(v3->color[0].blue), - FFB_2_30_FIXED_TO_FLOAT(v3->color[0].green), - FFB_2_30_FIXED_TO_FLOAT(v3->color[0].red)); -#endif -#endif - - -#if (IND & FFB_TRI_FLAT_BIT) - FFBFifo(fmesa, 13); - ffb->fg = const_fg; -#else -#if (IND & FFB_TRI_ALPHA_BIT) - FFBFifo(fmesa, 28); -#else - FFBFifo(fmesa, 24); -#endif -#endif - - FFB_DUMP_VERTEX(v0); -#if !(IND & FFB_TRI_FLAT_BIT) -#if (IND & FFB_TRI_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v0); -#endif - ffb->red = FFB_GET_RED(v0); - ffb->green = FFB_GET_GREEN(v0); - ffb->blue = FFB_GET_BLUE(v0); -#endif - ffb->z = FFB_GET_Z(v0); - ffb->ryf = FFB_GET_Y(v0); - ffb->rxf = FFB_GET_X(v0); - - FFB_DUMP_VERTEX(v1); -#if !(IND & FFB_TRI_FLAT_BIT) -#if (IND & FFB_TRI_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v1); -#endif - ffb->red = FFB_GET_RED(v1); - ffb->green = FFB_GET_GREEN(v1); - ffb->blue = FFB_GET_BLUE(v1); -#endif - ffb->z = FFB_GET_Z(v1); - ffb->y = FFB_GET_Y(v1); - ffb->x = FFB_GET_X(v1); - - FFB_DUMP_VERTEX(v2); -#if !(IND & FFB_TRI_FLAT_BIT) -#if (IND & FFB_TRI_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v2); -#endif - ffb->red = FFB_GET_RED(v2); - ffb->green = FFB_GET_GREEN(v2); - ffb->blue = FFB_GET_BLUE(v2); -#endif - ffb->z = FFB_GET_Z(v2); - ffb->y = FFB_GET_Y(v2); - ffb->x = FFB_GET_X(v2); - - FFB_DUMP_VERTEX(v3); -#if !(IND & FFB_TRI_FLAT_BIT) -#if (IND & FFB_TRI_ALPHA_BIT) - ffb->alpha = FFB_GET_ALPHA(v3); -#endif - ffb->red = FFB_GET_RED(v3); - ffb->green = FFB_GET_GREEN(v3); - ffb->blue = FFB_GET_BLUE(v3); -#endif - ffb->z = FFB_GET_Z(v3); - ffb->dmyf = FFB_GET_Y(v3); - ffb->dmxf = FFB_GET_X(v3); - - fmesa->ffbScreen->rp_active = 1; -} - -static void TAG(ffb_init)(void) -{ - ffb_tri_tab[IND] = TAG(ffb_triangle); - ffb_quad_tab[IND] = TAG(ffb_quad); -} - -#undef IND -#undef TAG diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.c b/src/mesa/drivers/dri/ffb/ffb_vb.c deleted file mode 100644 index a53e7c7431..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_vb.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000, 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "ffb_xmesa.h" -#include "ffb_context.h" -#include "ffb_vb.h" -#include "main/imports.h" -#include "tnl/t_context.h" - -#undef VB_DEBUG - -static void ffb_copy_pv_oneside(GLcontext *ctx, GLuint edst, GLuint esrc) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_vertex *dst = &fmesa->verts[edst]; - ffb_vertex *src = &fmesa->verts[esrc]; - -#ifdef VB_DEBUG - fprintf(stderr, "ffb_copy_pv_oneside: edst(%d) esrc(%d)\n", edst, esrc); -#endif - dst->color[0].alpha = src->color[0].alpha; - dst->color[0].red = src->color[0].red; - dst->color[0].green = src->color[0].green; - dst->color[0].blue = src->color[0].blue; -} - -static void ffb_copy_pv_twoside(GLcontext *ctx, GLuint edst, GLuint esrc) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - ffb_vertex *dst = &fmesa->verts[edst]; - ffb_vertex *src = &fmesa->verts[esrc]; - -#ifdef VB_DEBUG - fprintf(stderr, "ffb_copy_pv_twoside: edst(%d) esrc(%d)\n", edst, esrc); -#endif - dst->color[0].alpha = src->color[0].alpha; - dst->color[0].red = src->color[0].red; - dst->color[0].green = src->color[0].green; - dst->color[0].blue = src->color[0].blue; - dst->color[1].alpha = src->color[1].alpha; - dst->color[1].red = src->color[1].red; - dst->color[1].green = src->color[1].green; - dst->color[1].blue = src->color[1].blue; -} - -#define FFB_VB_RGBA_BIT 0x01 -#define FFB_VB_XYZ_BIT 0x02 -#define FFB_VB_TWOSIDE_BIT 0x04 -#define FFB_VB_MAX 0x08 - -typedef void (*ffb_emit_func)(GLcontext *, GLuint, GLuint); - -static struct { - ffb_emit_func emit; - tnl_interp_func interp; -} setup_tab[FFB_VB_MAX]; - - -#define IND (FFB_VB_XYZ_BIT) -#define TAG(x) x##_w -#include "ffb_vbtmp.h" - -#define IND (FFB_VB_RGBA_BIT) -#define TAG(x) x##_g -#include "ffb_vbtmp.h" - -#define IND (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT) -#define TAG(x) x##_wg -#include "ffb_vbtmp.h" - -#define IND (FFB_VB_TWOSIDE_BIT) -#define TAG(x) x##_t -#include "ffb_vbtmp.h" - -#define IND (FFB_VB_XYZ_BIT | FFB_VB_TWOSIDE_BIT) -#define TAG(x) x##_wt -#include "ffb_vbtmp.h" - -#define IND (FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT) -#define TAG(x) x##_gt -#include "ffb_vbtmp.h" - -#define IND (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT) -#define TAG(x) x##_wgt -#include "ffb_vbtmp.h" - -static void init_setup_tab( void ) -{ - init_w(); - init_g(); - init_wg(); - init_t(); - init_wt(); - init_gt(); - init_wgt(); -} - -#ifdef VB_DEBUG -static void ffbPrintSetupFlags(char *msg, GLuint flags) -{ - fprintf(stderr, "%s(%x): %s%s%s\n", - msg, - (int)flags, - (flags & FFB_VB_XYZ_BIT) ? " xyz," : "", - (flags & FFB_VB_RGBA_BIT) ? " rgba," : "", - (flags & FFB_VB_TWOSIDE_BIT) ? " twoside," : ""); -} -#endif - -static void ffbDDBuildVertices(GLcontext *ctx, GLuint start, GLuint count, - GLuint newinputs) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - newinputs |= fmesa->setupnewinputs; - fmesa->setupnewinputs = 0; - - if (!newinputs) - return; - - if (newinputs & VERT_BIT_POS) { - setup_tab[fmesa->setupindex].emit(ctx, start, count); - } else { - GLuint ind = 0; - - if (newinputs & VERT_BIT_COLOR0) - ind |= (FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT); - - ind &= fmesa->setupindex; - - if (ind) - setup_tab[ind].emit(ctx, start, count); - } -} - -void ffbChooseVertexState( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - int ind = FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT; - - if (ctx->_TriangleCaps & DD_TRI_LIGHT_TWOSIDE) - ind |= FFB_VB_TWOSIDE_BIT; - -#ifdef VB_DEBUG - ffbPrintSetupFlags("ffb: full setup function", ind); -#endif - - fmesa->setupindex = ind; - - tnl->Driver.Render.BuildVertices = ffbDDBuildVertices; - tnl->Driver.Render.Interp = setup_tab[ind].interp; - if (ind & FFB_VB_TWOSIDE_BIT) - tnl->Driver.Render.CopyPV = ffb_copy_pv_twoside; - else - tnl->Driver.Render.CopyPV = ffb_copy_pv_oneside; -} - -void ffbInitVB( GLcontext *ctx ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLuint size = TNL_CONTEXT(ctx)->vb.Size; - - fmesa->verts = (ffb_vertex *)_mesa_align_malloc(size * sizeof(ffb_vertex), 32); - - { - static int firsttime = 1; - if (firsttime) { - init_setup_tab(); - firsttime = 0; - } - } -} - - -void ffbFreeVB( GLcontext *ctx ) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - if (fmesa->verts) { - _mesa_align_free(fmesa->verts); - fmesa->verts = 0; - } -} diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.h b/src/mesa/drivers/dri/ffb/ffb_vb.h deleted file mode 100644 index 238b9940bf..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_vb.h +++ /dev/null @@ -1,44 +0,0 @@ - -#ifndef _FFB_VB_H -#define _FFB_VB_H - -#include "main/mtypes.h" -#include "main/macros.h" -#include "tnl/t_context.h" -#include "swrast/swrast.h" - -#define __FFB_2_30_FIXED_SCALE 1073741824.0f -#define FFB_2_30_FLOAT_TO_FIXED(X) \ - (IROUND((X) * fmesa->ffb_2_30_fixed_scale)) -#define FFB_2_30_FIXED_TO_FLOAT(X) \ - (((GLfloat)(X)) * fmesa->ffb_one_over_2_30_fixed_scale) - -#define __FFB_16_16_FIXED_SCALE 65536.0f -#define FFB_16_16_FLOAT_TO_FIXED(X) \ - (IROUND((X) * fmesa->ffb_16_16_fixed_scale)) -#define FFB_16_16_FIXED_TO_FLOAT(X) \ - (((GLfloat)(X)) * fmesa->ffb_one_over_16_16_fixed_scale) - -#define FFB_Z_FROM_FLOAT(VAL) FFB_2_30_FLOAT_TO_FIXED(VAL) -#define FFB_Z_TO_FLOAT(VAL) FFB_2_30_FIXED_TO_FLOAT(VAL) -#define FFB_XY_FROM_FLOAT(VAL) FFB_16_16_FLOAT_TO_FIXED(VAL) -#define FFB_XY_TO_FLOAT(VAL) FFB_16_16_FIXED_TO_FLOAT(VAL) - -#define FFB_UBYTE_FROM_COLOR(VAL) ((IROUND((VAL) * fmesa->ffb_ubyte_color_scale))) - -#define FFB_PACK_CONST_UBYTE_ARGB_COLOR(C) \ - ((FFB_UBYTE_FROM_COLOR(C.alpha) << 24) | \ - (FFB_UBYTE_FROM_COLOR(C.blue) << 16) | \ - (FFB_UBYTE_FROM_COLOR(C.green) << 8) | \ - (FFB_UBYTE_FROM_COLOR(C.red) << 0)) - -#define FFB_COLOR_FROM_FLOAT(VAL) FFB_2_30_FLOAT_TO_FIXED(VAL) - -#define _FFB_NEW_VERTEX (_DD_NEW_TRI_LIGHT_TWOSIDE) - -extern void ffbDDSetupInit(void); -extern void ffbChooseVertexState(GLcontext *); -extern void ffbInitVB( GLcontext *ctx ); -extern void ffbFreeVB( GLcontext *ctx ); - -#endif /* !(_FFB_VB_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h b/src/mesa/drivers/dri/ffb/ffb_vbtmp.h deleted file mode 100644 index c548ef3ad5..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h +++ /dev/null @@ -1,150 +0,0 @@ - -static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); -#if defined(VB_DEBUG) || (IND & (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT)) - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; -#endif -#if (IND & (FFB_VB_RGBA_BIT)) - GLfloat (*col0)[4]; - GLuint col0_stride; -#if (IND & (FFB_VB_TWOSIDE_BIT)) - GLfloat (*col1)[4]; - GLuint col1_stride; -#endif -#endif -#if (IND & FFB_VB_XYZ_BIT) - GLfloat (*proj)[4] = VB->NdcPtr->data; - GLuint proj_stride = VB->NdcPtr->stride; - const GLubyte *mask = VB->ClipMask; -#endif - ffb_vertex *v = &fmesa->verts[start]; - int i; - -#ifdef VB_DEBUG - fprintf(stderr, "FFB: ffb_emit [" -#if (IND & (FFB_VB_XYZ_BIT)) - " XYZ" -#endif -#if (IND & (FFB_VB_RGBA_BIT)) - " RGBA" -#endif -#if (IND & (FFB_VB_TWOSIDE_BIT)) - " TWOSIDE" -#endif - "] start(%d) end(%d) import(%d)\n", - start, end, - VB->importable_data); -#endif - -#if (IND & (FFB_VB_RGBA_BIT)) - col0 = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; - col0_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; -#if (IND & (FFB_VB_TWOSIDE_BIT)) - col1 = VB->BackfaceColorPtr->data; - col1_stride = VB->BackfaceColorPtr->stride; -#endif -#endif - - { - if (start) { -#if (IND & (FFB_VB_XYZ_BIT)) - proj = (GLfloat (*)[4])((GLubyte *)proj + start * proj_stride); -#endif -#if (IND & (FFB_VB_RGBA_BIT)) - col0 = (GLfloat (*)[4])((GLubyte *)col0 + start * col0_stride); -#if (IND & (FFB_VB_TWOSIDE_BIT)) - col1 = (GLfloat (*)[4])((GLubyte *)col1 + start * col1_stride); -#endif -#endif - } - for (i = start; i < end; i++, v++) { -#if (IND & (FFB_VB_XYZ_BIT)) - if (mask[i] == 0) { - v->x = proj[0][0]; - v->y = proj[0][1]; - v->z = proj[0][2]; - } - proj = (GLfloat (*)[4])((GLubyte *)proj + proj_stride); -#endif -#if (IND & (FFB_VB_RGBA_BIT)) - v->color[0].alpha = CLAMP(col0[0][3], 0.0f, 1.0f); - v->color[0].red = CLAMP(col0[0][0], 0.0f, 1.0f); - v->color[0].green = CLAMP(col0[0][1], 0.0f, 1.0f); - v->color[0].blue = CLAMP(col0[0][2], 0.0f, 1.0f); - col0 = (GLfloat (*)[4])((GLubyte *)col0 + col0_stride); -#if (IND & (FFB_VB_TWOSIDE_BIT)) - v->color[1].alpha = CLAMP(col1[0][3], 0.0f, 1.0f); - v->color[1].red = CLAMP(col1[0][0], 0.0f, 1.0f); - v->color[1].green = CLAMP(col1[0][1], 0.0f, 1.0f); - v->color[1].blue = CLAMP(col1[0][2], 0.0f, 1.0f); - col1 = (GLfloat (*)[4])((GLubyte *)col1 + col1_stride); -#endif -#endif - } - } -} - -static void TAG(interp)(GLcontext *ctx, GLfloat t, - GLuint edst, GLuint eout, GLuint ein, - GLboolean force_boundary) -{ -#if (IND & (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT)) - ffbContextPtr fmesa = FFB_CONTEXT(ctx); -#endif -#if (IND & (FFB_VB_XYZ_BIT)) - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - const GLfloat *dstclip = VB->ClipPtr->data[edst]; - GLfloat oow = 1.0 / dstclip[3]; -#endif -#if (IND & (FFB_VB_XYZ_BIT | FFB_VB_RGBA_BIT)) - ffb_vertex *dst = &fmesa->verts[edst]; -#endif -#if (IND & (FFB_VB_RGBA_BIT)) - ffb_vertex *in = &fmesa->verts[eout]; - ffb_vertex *out = &fmesa->verts[ein]; -#endif - -#ifdef VB_DEBUG - fprintf(stderr, "FFB: ffb_interp [" -#if (IND & (FFB_VB_XYZ_BIT)) - " XYZ" -#endif -#if (IND & (FFB_VB_RGBA_BIT)) - " RGBA" -#endif -#if (IND & (FFB_VB_TWOSIDE_BIT)) - " TWOSIDE" -#endif - "] edst(%d) eout(%d) ein(%d)\n", - edst, eout, ein); -#endif - -#if (IND & (FFB_VB_XYZ_BIT)) - dst->x = dstclip[0] * oow; - dst->y = dstclip[1] * oow; - dst->z = dstclip[2] * oow; -#endif - -#if (IND & (FFB_VB_RGBA_BIT)) - INTERP_F(t, dst->color[0].alpha, out->color[0].alpha, in->color[0].alpha); - INTERP_F(t, dst->color[0].red, out->color[0].red, in->color[0].red); - INTERP_F(t, dst->color[0].green, out->color[0].green, in->color[0].green); - INTERP_F(t, dst->color[0].blue, out->color[0].blue, in->color[0].blue); -#if (IND & (FFB_VB_TWOSIDE_BIT)) - INTERP_F(t, dst->color[1].alpha, out->color[1].alpha, in->color[1].alpha); - INTERP_F(t, dst->color[1].red, out->color[1].red, in->color[1].red); - INTERP_F(t, dst->color[1].green, out->color[1].green, in->color[1].green); - INTERP_F(t, dst->color[1].blue, out->color[1].blue, in->color[1].blue); -#endif -#endif -} - -static void TAG(init)(void) -{ - setup_tab[IND].emit = TAG(emit); - setup_tab[IND].interp = TAG(interp); -} - -#undef IND -#undef TAG diff --git a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c deleted file mode 100644 index 90f44b0e91..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c +++ /dev/null @@ -1,414 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "main/glheader.h" -#include "api_noop.h" -#include "main/context.h" -#include "light.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "vtxfmt.h" -#include "ffb_xmesa.h" -#include "ffb_context.h" -#include "ffb_vb.h" -#include "tnl/tnl.h" -#include "tnl/tcontext.h" - -#include "ffb_vtxfmt.h" - -#define TNL_VERTEX ffbTnlVertex - -#define INTERP_RGBA(t, out, a, b) \ -do { \ - GLint i; \ - for ( i = 0 ; i < 4 ; i++ ) { \ - GLfloat fa = a[i]; \ - GLfloat fb = b[i]; \ - out[i] = LINTERP( t, fa, fb ); \ - } \ -} while (0) - -/* Color functions: */ - -static INLINE void ffb_recalc_base_color(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - struct gl_light *light; - - COPY_3V(fmesa->vtx_state.light.base_color, ctx->Light._BaseColor[0]); - foreach (light, &ctx->Light.EnabledList) { - ACC_3V(fmesa->vtx_state.light.base_color, - light->_MatAmbient[0]); - } - - fmesa->vtx_state.light.base_alpha = ctx->Light._BaseAlpha[0]; -} - -#define GET_CURRENT \ - GET_CURRENT_CONTEXT(ctx); \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx) - -#define CURRENT_COLOR(COMP) fmesa->vtx_state.current.color[COMP] -#define CURRENT_SPECULAR(COMP) fmesa->vtx_state.current.specular[COMP] -#define COLOR_IS_FLOAT -#define RECALC_BASE_COLOR(ctx) ffb_recalc_base_color(ctx) - -#define TAG(x) ffb_##x -#include "tnl_dd/t_dd_imm_capi.h" - -/* Normal functions: */ - -struct ffb_norm_tab { - void (*normal3f_multi)(GLfloat x, GLfloat y, GLfloat z); - void (*normal3fv_multi)(const GLfloat *v); - void (*normal3f_single)(GLfloat x, GLfloat y, GLfloat z); - void (*normal3fv_single)(const GLfloat *v); -}; - -static struct ffb_norm_tab norm_tab[0x4]; - -#define HAVE_HW_LIGHTING 0 -#define GET_CURRENT_VERTEX \ - GET_CURRENT_CONTEXT(ctx); \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); \ - ffbTnlVertexPtr v = fmesa->imm.v0 - -#define CURRENT_NORMAL fmesa->vtx_state.current.normal -#define BASE_COLOR fmesa->vtx_state.light.base_color -#define BASE_ALPHA fmesa->vtx_state.light.base_alpha -#define VERT_COLOR( COMP ) v->color[COMP] -#define VERT_COLOR_IS_FLOAT - -#define IND (0) -#define TAG(x) ffb_##x -#define PRESERVE_NORMAL_DEFS -#include "tnl_dd/t_dd_imm_napi.h" - -#define IND (NORM_RESCALE) -#define TAG(x) ffb_##x##_rescale -#define PRESERVE_NORMAL_DEFS -#include "tnl_dd/t_dd_imm_napi.h" - -#define IND (NORM_NORMALIZE) -#define TAG(x) ffb_##x##_normalize -#include "tnl_dd/t_dd_imm_napi.h" - -static void ffb_init_norm_funcs(void) -{ - ffb_init_norm(); - ffb_init_norm_rescale(); - ffb_init_norm_normalize(); -} - -static void choose_normals(void) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint index; - - if (ctx->Light.Enabled) { - if (ctx->Transform.Normalize) { - index = NORM_NORMALIZE; - } else if (!ctx->Transform.RescaleNormals && - ctx->_ModelViewInvScale != 1.0) { - index = NORM_RESCALE; - } else { - index = 0; - } - - if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) { - SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_single); - SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_single); - } else { - SET_Normal3f(ctx->Exec, norm_tab[index].normal3f_multi); - SET_Normal3fv(ctx->Exec, norm_tab[index].normal3fv_multi); - } - } else { - SET_Normal3f(ctx->Exec, _mesa_noop_Normal3f); - SET_Normal3fv(ctx->Exec, _mesa_noop_Normal3fv); - } -} - -static void ffb_choose_Normal3f(GLfloat x, GLfloat y, GLfloat z) -{ - choose_normals(); - CALL_Normal3f(GET_DISPATCH(), (x, y, z)); -} - -static void ffb_choose_Normal3fv(const GLfloat *v) -{ - choose_normals(); - CALL_Normal3fv(GET_DISPATCH(), (v)); -} - -/* Vertex functions: */ - -#define GET_CURRENT_VERTEX \ - GET_CURRENT_CONTEXT(ctx); \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); \ - ffbTnlVertexPtr v = fmesa->imm.v0 - -#define CURRENT_VERTEX v->obj -#define SAVE_VERTEX fmesa->imm.save_vertex(ctx, v) - -#define TAG(x) ffb_##x -#include "tnl_dd/t_dd_imm_vapi.h" - -struct ffb_vert_tab { - void (*save_vertex)(GLcontext *ctx, ffbTnlVertexPtr v); - void (*interpolate_vertex)(GLfloat t, - ffbTnlVertex *O, - const ffbTnlVertex *I, - const ffbTnlVertex *J); -}; - -static struct ffb_vert_tab vert_tab[0xf]; - -#define VTX_NORMAL 0x0 -#define VTX_RGBA 0x1 - -#define LOCAL_VARS \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx) - -#define CURRENT_COLOR fmesa->vtx_state.current.color -#define COLOR_IS_FLOAT -#define FLUSH_VERTEX fmesa->imm.flush_vertex( ctx, v ); - -#define IND (VTX_NORMAL) -#define TAG(x) ffb_##x##_NORMAL -#define PRESERVE_VERTEX_DEFS -#include "tnl_dd/t_dd_imm_vertex.h" - -#define IND (VTX_RGBA) -#define TAG(x) ffb_##x##_RGBA -#include "tnl_dd/t_dd_imm_vertex.h" - -static void ffb_init_vert_funcs( void ) -{ - ffb_init_vert_NORMAL(); - ffb_init_vert_RGBA(); -} - -#define LOCAL_VARS \ - ffbContextPtr fmesa = FFB_CONTEXT(ctx) - -#define GET_INTERP_FUNC \ - ffb_interp_func interp = fmesa->imm.interp - -#define FLUSH_VERTEX fmesa->imm.flush_vertex -#define IMM_VERTEX( V ) fmesa->imm.V -#define IMM_VERTICES( n ) fmesa->imm.vertices[n] - -#define EMIT_VERTEX_USES_HWREGS - -/* XXX Implement me XXX */ -#define EMIT_VERTEX_TRI(VTX0, VTX1, VTX2) \ - do { } while (0) -#define EMIT_VERTEX_LINE(VTX0, VTX1) \ - do { } while (0) -#define EMIT_VERTEX_POINT(VTX0) \ - do { } while (0) - -#define TAG(x) ffb_##x -#include "tnl_dd/t_dd_imm_primtmp.h" - -/* Bzzt: Material changes are lost on fallback. */ -static void ffb_Materialfv(GLenum face, GLenum pname, - const GLfloat *params) -{ - GET_CURRENT_CONTEXT(ctx); - - _mesa_noop_Materialfv( face, pname, params ); - ffb_recalc_base_color( ctx ); -} - -/* Fallback functions: */ - -static void ffb_do_fallback(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - struct ffb_current_state *current = &fmesa->vtx_state.current; - - /* Tell tnl to restore its exec vtxfmt, rehook its driver callbacks - * and revive internal state that depended on those callbacks: - */ - _tnl_wakeup_exec(ctx); - - /* Replay enough vertices that the current primitive is continued - * correctly: - */ - if (fmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END ) - CALL_Begin(GET_DISPATCH(), (fmesa->imm.prim)); - - if (ctx->Light.Enabled) { - /* Catch ColorMaterial */ - CALL_Color4fv(GET_DISPATCH(), (ctx->Current.Color)); - CALL_Normal3fv(GET_DISPATCH(), (current->normal)); - } else { - CALL_Color4fv(GET_DISPATCH(), (current->color)); - } -} - -#define PRE_LOOPBACK( FUNC ) do { \ - GET_CURRENT_CONTEXT(ctx); \ - ffb_do_fallback( ctx ); \ -} while (0) - -#define TAG(x) ffb_fallback_##x -#include "vtxfmt_tmp.h" - -static void ffb_Begin(GLenum prim) -{ - GET_CURRENT_CONTEXT(ctx); - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - if (prim > GL_POLYGON) { - _mesa_error( ctx, GL_INVALID_ENUM, "glBegin" ); - return; - } - - if (fmesa->imm.prim != PRIM_OUTSIDE_BEGIN_END) { - _mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" ); - return; - } - - ctx->Driver.NeedFlush |= (FLUSH_STORED_VERTICES | - FLUSH_UPDATE_CURRENT); - - fmesa->imm.prim = prim; - fmesa->imm.v0 = &fmesa->imm.vertices[0]; - fmesa->imm.save_vertex = ffb_save_vertex_RGBA; - fmesa->imm.flush_vertex = ffb_flush_tab[prim]; - - /* XXX Lock hardware, update FBC, PPC, DRAWOP, etc. XXX */ -} - -static void ffb_End(void) -{ - GET_CURRENT_CONTEXT(ctx); - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - - if (fmesa->imm.prim == PRIM_OUTSIDE_BEGIN_END) { - _mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" ); - return; - } - - fmesa->imm.prim = PRIM_OUTSIDE_BEGIN_END; - - ctx->Driver.NeedFlush &= ~(FLUSH_STORED_VERTICES | - FLUSH_UPDATE_CURRENT); - - /* XXX Unlock hardware, etc. */ -} - -void ffbInitTnlModule(GLcontext *ctx) -{ - ffbContextPtr fmesa = FFB_CONTEXT(ctx); - GLvertexformat *vfmt = &(fmesa->imm.vtxfmt); - - /* Work in progress... */ - return; - - ffb_init_norm_funcs(); - ffb_init_vert_funcs(); - - /* start by initializing to no-op functions */ - _mesa_noop_vtxfmt_init(vfmt); - - /* Handled fully in supported states: */ - vfmt->ArrayElement = NULL; /* FIXME: ... */ - vfmt->Color3f = ffb_choose_Color3f; - vfmt->Color3fv = ffb_choose_Color3fv; - vfmt->Color3ub = ffb_choose_Color3ub; - vfmt->Color3ubv = ffb_choose_Color3ubv; - vfmt->Color4f = ffb_choose_Color4f; - vfmt->Color4fv = ffb_choose_Color4fv; - vfmt->Color4ub = ffb_choose_Color4ub; - vfmt->Color4ubv = ffb_choose_Color4ubv; - vfmt->FogCoordfvEXT = ffb_FogCoordfvEXT; - vfmt->FogCoordfEXT = ffb_FogCoordfEXT; - vfmt->Materialfv = ffb_Materialfv; - vfmt->MultiTexCoord1fARB = ffb_fallback_MultiTexCoord1fARB; - vfmt->MultiTexCoord1fvARB = ffb_fallback_MultiTexCoord1fvARB; - vfmt->MultiTexCoord2fARB = ffb_fallback_MultiTexCoord2fARB; - vfmt->MultiTexCoord2fvARB = ffb_fallback_MultiTexCoord2fvARB; - vfmt->MultiTexCoord3fARB = ffb_fallback_MultiTexCoord3fARB; - vfmt->MultiTexCoord3fvARB = ffb_fallback_MultiTexCoord3fvARB; - vfmt->MultiTexCoord4fARB = ffb_fallback_MultiTexCoord4fARB; - vfmt->MultiTexCoord4fvARB = ffb_fallback_MultiTexCoord4fvARB; - vfmt->Normal3f = ffb_choose_Normal3f; - vfmt->Normal3fv = ffb_choose_Normal3fv; - vfmt->SecondaryColor3ubEXT = ffb_SecondaryColor3ubEXT; - vfmt->SecondaryColor3ubvEXT = ffb_SecondaryColor3ubvEXT; - vfmt->SecondaryColor3fEXT = ffb_SecondaryColor3fEXT; - vfmt->SecondaryColor3fvEXT = ffb_SecondaryColor3fvEXT; - vfmt->TexCoord1f = ffb_fallback_TexCoord1f; - vfmt->TexCoord1fv = ffb_fallback_TexCoord1fv; - vfmt->TexCoord2f = ffb_fallback_TexCoord2f; - vfmt->TexCoord2fv = ffb_fallback_TexCoord2fv; - vfmt->TexCoord3f = ffb_fallback_TexCoord3f; - vfmt->TexCoord3fv = ffb_fallback_TexCoord3fv; - vfmt->TexCoord4f = ffb_fallback_TexCoord4f; - vfmt->TexCoord4fv = ffb_fallback_TexCoord4fv; - - vfmt->Vertex2f = ffb_Vertex2f; - vfmt->Vertex2fv = ffb_Vertex2fv; - vfmt->Vertex3f = ffb_Vertex3f; - vfmt->Vertex3fv = ffb_Vertex3fv; - vfmt->Vertex4f = ffb_Vertex4f; - vfmt->Vertex4fv = ffb_Vertex4fv; - - vfmt->Begin = ffb_Begin; - vfmt->End = ffb_End; - - vfmt->DrawArrays = NULL; - vfmt->DrawElements = NULL; - - /* Active but unsupported -- fallback if we receive these: - * - * All of these fallbacks can be fixed with additional code, except - * CallList, unless we build a play_immediate_noop() command which - * turns an immediate back into glBegin/glEnd commands... - */ - vfmt->CallList = ffb_fallback_CallList; - vfmt->EvalCoord1f = ffb_fallback_EvalCoord1f; - vfmt->EvalCoord1fv = ffb_fallback_EvalCoord1fv; - vfmt->EvalCoord2f = ffb_fallback_EvalCoord2f; - vfmt->EvalCoord2fv = ffb_fallback_EvalCoord2fv; - vfmt->EvalMesh1 = ffb_fallback_EvalMesh1; - vfmt->EvalMesh2 = ffb_fallback_EvalMesh2; - vfmt->EvalPoint1 = ffb_fallback_EvalPoint1; - vfmt->EvalPoint2 = ffb_fallback_EvalPoint2; - - vfmt->prefer_float_colors = GL_TRUE; - - fmesa->imm.prim = PRIM_OUTSIDE_BEGIN_END; - - /* THIS IS A HACK! */ - _mesa_install_exec_vtxfmt( ctx, vfmt ); -} diff --git a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h deleted file mode 100644 index 4d9125cd15..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.h +++ /dev/null @@ -1,7 +0,0 @@ - -#ifndef _FFB_VTXFMT_H -#define _FFB_VTXFMT_H - -extern void ffbInitTnlModule(GLcontext *); - -#endif /* !(_FFB_VTXFMT_H) */ diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c deleted file mode 100644 index bd1044a2bf..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ /dev/null @@ -1,729 +0,0 @@ -/* - * - * GLX Hardware Device Driver for Sun Creator/Creator3D - * Copyright (C) 2000, 2001 David S. Miller - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE - * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * - * David S. Miller - */ - -#include "ffb_xmesa.h" -#include "main/context.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/simple_list.h" -#include "main/imports.h" -#include "utils.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" -#include "vbo/vbo.h" -#include "drivers/common/driverfuncs.h" - -#include "ffb_context.h" -#include "ffb_dd.h" -#include "ffb_span.h" -#include "ffb_depth.h" -#include "ffb_stencil.h" -#include "ffb_clear.h" -#include "ffb_vb.h" -#include "ffb_tris.h" -#include "ffb_lines.h" -#include "ffb_points.h" -#include "ffb_state.h" -#include "ffb_lock.h" -#include "ffb_vtxfmt.h" -#include "ffb_bitmap.h" - -#include "drm_sarea.h" - -#include "drirenderbuffer.h" - -static GLboolean -ffbInitDriver(__DRIscreen *sPriv) -{ - ffbScreenPrivate *ffbScreen; - FFBDRIPtr gDRIPriv = (FFBDRIPtr) sPriv->pDevPriv; - drmAddress map; - - if (getenv("LIBGL_FORCE_XSERVER")) - return GL_FALSE; - - - if (sPriv->devPrivSize != sizeof(FFBDRIRec)) { - fprintf(stderr,"\nERROR! sizeof(FFBDRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - - /* Allocate the private area. */ - ffbScreen = (ffbScreenPrivate *) MALLOC(sizeof(ffbScreenPrivate)); - if (!ffbScreen) - return GL_FALSE; - - /* Map FBC registers. */ - if (drmMap(sPriv->fd, - gDRIPriv->hFbcRegs, - gDRIPriv->sFbcRegs, - &map)) { - FREE(ffbScreen); - return GL_FALSE; - } - ffbScreen->regs = (ffb_fbcPtr) map; - - /* Map ramdac registers. */ - if (drmMap(sPriv->fd, - gDRIPriv->hDacRegs, - gDRIPriv->sDacRegs, - &map)) { - drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs); - FREE(ffbScreen); - return GL_FALSE; - } - ffbScreen->dac = (ffb_dacPtr) map; - - /* Map "Smart" framebuffer views. */ - if (drmMap(sPriv->fd, - gDRIPriv->hSfb8r, - gDRIPriv->sSfb8r, - &map)) { - drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs); - drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs); - FREE(ffbScreen); - return GL_FALSE; - } - ffbScreen->sfb8r = (volatile char *) map; - - if (drmMap(sPriv->fd, - gDRIPriv->hSfb32, - gDRIPriv->sSfb32, - &map)) { - drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs); - drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs); - drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r); - FREE(ffbScreen); - return GL_FALSE; - } - ffbScreen->sfb32 = (volatile char *) map; - - if (drmMap(sPriv->fd, - gDRIPriv->hSfb64, - gDRIPriv->sSfb64, - &map)) { - drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs); - drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs); - drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r); - drmUnmap((drmAddress)ffbScreen->sfb32, gDRIPriv->sSfb32); - FREE(ffbScreen); - return GL_FALSE; - } - ffbScreen->sfb64 = (volatile char *) map; - - ffbScreen->fifo_cache = 0; - ffbScreen->rp_active = 0; - - ffbScreen->sPriv = sPriv; - sPriv->private = (void *) ffbScreen; - - ffbDDLinefuncInit(); - ffbDDPointfuncInit(); - - return GL_TRUE; -} - - -static void -ffbDestroyScreen(__DRIscreen *sPriv) -{ - ffbScreenPrivate *ffbScreen = sPriv->private; - FFBDRIPtr gDRIPriv = (FFBDRIPtr) sPriv->pDevPriv; - - drmUnmap((drmAddress)ffbScreen->regs, gDRIPriv->sFbcRegs); - drmUnmap((drmAddress)ffbScreen->dac, gDRIPriv->sDacRegs); - drmUnmap((drmAddress)ffbScreen->sfb8r, gDRIPriv->sSfb8r); - drmUnmap((drmAddress)ffbScreen->sfb32, gDRIPriv->sSfb32); - drmUnmap((drmAddress)ffbScreen->sfb64, gDRIPriv->sSfb64); - - FREE(ffbScreen); -} - -static const struct tnl_pipeline_stage *ffb_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - /* REMOVE: fog coord stage */ - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - /* REMOVE: point attenuation stage */ - &_tnl_render_stage, - 0, -}; - -/* Create and initialize the Mesa and driver specific context data */ -static GLboolean -ffbCreateContext(const __GLcontextModes *mesaVis, - __DRIcontext *driContextPriv, - void *sharedContextPrivate) -{ - ffbContextPtr fmesa; - GLcontext *ctx, *shareCtx; - __DRIscreen *sPriv; - ffbScreenPrivate *ffbScreen; - char *debug; - struct dd_function_table functions; - - /* Allocate ffb context */ - fmesa = (ffbContextPtr) CALLOC(sizeof(ffbContextRec)); - if (!fmesa) - return GL_FALSE; - - _mesa_init_driver_functions(&functions); - - /* Allocate Mesa context */ - if (sharedContextPrivate) - shareCtx = ((ffbContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - fmesa->glCtx = _mesa_create_context(mesaVis, shareCtx, - &functions, fmesa); - if (!fmesa->glCtx) { - FREE(fmesa); - return GL_FALSE; - } - driContextPriv->driverPrivate = fmesa; - ctx = fmesa->glCtx; - - sPriv = driContextPriv->driScreenPriv; - ffbScreen = (ffbScreenPrivate *) sPriv->private; - - /* Dri stuff. */ - fmesa->hHWContext = driContextPriv->hHWContext; - fmesa->driFd = sPriv->fd; - fmesa->driHwLock = &sPriv->pSAREA->lock; - - fmesa->ffbScreen = ffbScreen; - fmesa->driScreen = sPriv; - fmesa->ffb_sarea = FFB_DRISHARE(sPriv->pSAREA); - - /* Register and framebuffer pointers. */ - fmesa->regs = ffbScreen->regs; - fmesa->sfb32 = ffbScreen->sfb32; - - ffbDDInitContextHwState(ctx); - - /* Default clear and depth colors. */ - { - GLubyte r = (GLint) (ctx->Color.ClearColor[0] * 255.0F); - GLubyte g = (GLint) (ctx->Color.ClearColor[1] * 255.0F); - GLubyte b = (GLint) (ctx->Color.ClearColor[2] * 255.0F); - - fmesa->clear_pixel = ((r << 0) | - (g << 8) | - (b << 16)); - } - fmesa->clear_depth = Z_FROM_MESA(ctx->Depth.Clear * 4294967295.0f); - fmesa->clear_stencil = ctx->Stencil.Clear & 0xf; - - /* No wide points. */ - ctx->Const.MinPointSize = 1.0; - ctx->Const.MinPointSizeAA = 1.0; - ctx->Const.MaxPointSize = 1.0; - ctx->Const.MaxPointSizeAA = 1.0; - - /* Disable wide lines as we can't antialias them correctly in - * hardware. - */ - ctx->Const.MinLineWidth = 1.0; - ctx->Const.MinLineWidthAA = 1.0; - ctx->Const.MaxLineWidth = 1.0; - ctx->Const.MaxLineWidthAA = 1.0; - ctx->Const.LineWidthGranularity = 1.0; - - ctx->Const.MaxDrawBuffers = 1; - - /* Instead of having GCC emit these constants a zillion times - * everywhere in the driver, put them here. - */ - fmesa->ffb_2_30_fixed_scale = __FFB_2_30_FIXED_SCALE; - fmesa->ffb_one_over_2_30_fixed_scale = (1.0 / __FFB_2_30_FIXED_SCALE); - fmesa->ffb_16_16_fixed_scale = __FFB_16_16_FIXED_SCALE; - fmesa->ffb_one_over_16_16_fixed_scale = (1.0 / __FFB_16_16_FIXED_SCALE); - fmesa->ffb_ubyte_color_scale = 255.0f; - fmesa->ffb_zero = 0.0f; - - fmesa->debugFallbacks = GL_FALSE; - debug = getenv("LIBGL_DEBUG"); - if (debug && strstr(debug, "fallbacks")) - fmesa->debugFallbacks = GL_TRUE; - - /* Initialize the software rasterizer and helper modules. */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - - /* All of this need only be done once for a new context. */ - /* XXX these should be moved right after the - * _mesa_init_driver_functions() call above. - */ - ffbDDExtensionsInit(ctx); - ffbDDInitDriverFuncs(ctx); - ffbDDInitStateFuncs(ctx); - ffbDDInitRenderFuncs(ctx); - /*ffbDDInitTexFuncs(ctx); not needed */ - ffbDDInitBitmapFuncs(ctx); - ffbInitVB(ctx); - -#if 0 - ffbInitTnlModule(ctx); -#endif - - _tnl_destroy_pipeline(ctx); - _tnl_install_pipeline(ctx, ffb_pipeline); - - return GL_TRUE; -} - -static void -ffbDestroyContext(__DRIcontext *driContextPriv) -{ - ffbContextPtr fmesa = (ffbContextPtr) driContextPriv->driverPrivate; - - if (fmesa) { - ffbFreeVB(fmesa->glCtx); - - _swsetup_DestroyContext( fmesa->glCtx ); - _tnl_DestroyContext( fmesa->glCtx ); - _vbo_DestroyContext( fmesa->glCtx ); - _swrast_DestroyContext( fmesa->glCtx ); - - /* free the Mesa context */ - fmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(fmesa->glCtx); - - FREE(fmesa); - } -} - -/* Create and initialize the Mesa and driver specific pixmap buffer data */ -static GLboolean -ffbCreateBuffer(__DRIscreen *driScrnPriv, - __DRIdrawable *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - /* Mesa checks for pitch > 0, but ffb doesn't use pitches */ - int bogusPitch = 1; - int bpp = 4; /* we've always got a 32bpp framebuffer */ - int offset = 0; /* always at 0 for offset */ - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } else { - GLboolean swStencil = (mesaVis->stencilBits > 0 && - mesaVis->depthBits != 24); - struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); - - { - driRenderbuffer *frontRb - = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, bpp, offset, bogusPitch, - driDrawPriv); - ffbSetSpanFunctions(frontRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); - } - - if (mesaVis->doubleBufferMode) { - driRenderbuffer *backRb - = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, bpp, offset, bogusPitch, - driDrawPriv); - ffbSetSpanFunctions(backRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); - } - - if (mesaVis->depthBits == 16) { - driRenderbuffer *depthRb - = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, bpp, offset, - bogusPitch, driDrawPriv); - ffbSetDepthFunctions(depthRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - - if (mesaVis->stencilBits > 0 && !swStencil) { - driRenderbuffer *stencilRb - = driNewRenderbuffer(MESA_FORMAT_S8, NULL, bpp, offset, - bogusPitch, driDrawPriv); - ffbSetStencilFunctions(stencilRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); - } - - _mesa_add_soft_renderbuffers(fb, - GL_FALSE, /* color */ - GL_FALSE, /* depth */ - swStencil, - mesaVis->accumRedBits > 0, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - driDrawPriv->driverPrivate = (void *) fb; - - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -ffbDestroyBuffer(__DRIdrawable *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - - -#define USE_FAST_SWAP - -static void -ffbSwapBuffers( __DRIdrawable *dPriv ) -{ - ffbContextPtr fmesa = (ffbContextPtr) dPriv->driContextPriv->driverPrivate; - unsigned int fbc, wid, wid_reg_val, dac_db_bit; - unsigned int shadow_dac_addr, active_dac_addr; - ffb_fbcPtr ffb; - ffb_dacPtr dac; - - if (fmesa == NULL || - fmesa->glCtx->Visual.doubleBufferMode == 0) - return; - - /* Flush pending rendering commands */ - _mesa_notifySwapBuffers(fmesa->glCtx); - - ffb = fmesa->regs; - dac = fmesa->ffbScreen->dac; - - fbc = fmesa->fbc; - wid = fmesa->wid; - - /* Swap the buffer we render into and read pixels from. */ - fmesa->back_buffer ^= 1; - - /* If we are writing into both buffers, don't mess with - * the WB setting. - */ - if ((fbc & FFB_FBC_WB_AB) != FFB_FBC_WB_AB) { - if ((fbc & FFB_FBC_WB_A) != 0) - fbc = (fbc & ~FFB_FBC_WB_A) | FFB_FBC_WB_B; - else - fbc = (fbc & ~FFB_FBC_WB_B) | FFB_FBC_WB_A; - } - - /* But either way, we must flip the read buffer setting. */ - if ((fbc & FFB_FBC_RB_A) != 0) - fbc = (fbc & ~FFB_FBC_RB_A) | FFB_FBC_RB_B; - else - fbc = (fbc & ~FFB_FBC_RB_B) | FFB_FBC_RB_A; - - LOCK_HARDWARE(fmesa); - - if (fmesa->fbc != fbc) { - FFBFifo(fmesa, 1); - ffb->fbc = fmesa->fbc = fbc; - fmesa->ffbScreen->rp_active = 1; - } - - /* And swap the buffer displayed in the WID. */ - if (fmesa->ffb_sarea->flags & FFB_DRI_PAC1) { - shadow_dac_addr = FFBDAC_PAC1_SPWLUT(wid); - active_dac_addr = FFBDAC_PAC1_APWLUT(wid); - dac_db_bit = FFBDAC_PAC1_WLUT_DB; - } else { - shadow_dac_addr = FFBDAC_PAC2_SPWLUT(wid); - active_dac_addr = FFBDAC_PAC2_APWLUT(wid); - dac_db_bit = FFBDAC_PAC2_WLUT_DB; - } - - FFBWait(fmesa, ffb); - - wid_reg_val = DACCFG_READ(dac, active_dac_addr); - if (fmesa->back_buffer == 0) - wid_reg_val |= dac_db_bit; - else - wid_reg_val &= ~dac_db_bit; -#ifdef USE_FAST_SWAP - DACCFG_WRITE(dac, active_dac_addr, wid_reg_val); -#else - DACCFG_WRITE(dac, shadow_dac_addr, wid_reg_val); - - /* Schedule the window transfer. */ - DACCFG_WRITE(dac, FFBDAC_CFG_WTCTRL, - (FFBDAC_CFG_WTCTRL_TCMD | FFBDAC_CFG_WTCTRL_TE)); - - { - int limit = 1000000; - while (limit--) { - unsigned int wtctrl = DACCFG_READ(dac, FFBDAC_CFG_WTCTRL); - - if ((wtctrl & FFBDAC_CFG_WTCTRL_DS) == 0) - break; - } - } -#endif - - UNLOCK_HARDWARE(fmesa); -} - -static void ffb_init_wid(ffbContextPtr fmesa, unsigned int wid) -{ - ffb_dacPtr dac = fmesa->ffbScreen->dac; - unsigned int wid_reg_val, dac_db_bit, active_dac_addr; - unsigned int shadow_dac_addr; - - if (fmesa->ffb_sarea->flags & FFB_DRI_PAC1) { - shadow_dac_addr = FFBDAC_PAC1_SPWLUT(wid); - active_dac_addr = FFBDAC_PAC1_APWLUT(wid); - dac_db_bit = FFBDAC_PAC1_WLUT_DB; - } else { - shadow_dac_addr = FFBDAC_PAC2_SPWLUT(wid); - active_dac_addr = FFBDAC_PAC2_APWLUT(wid); - dac_db_bit = FFBDAC_PAC2_WLUT_DB; - } - - wid_reg_val = DACCFG_READ(dac, active_dac_addr); - wid_reg_val &= ~dac_db_bit; -#ifdef USE_FAST_SWAP - DACCFG_WRITE(dac, active_dac_addr, wid_reg_val); -#else - DACCFG_WRITE(dac, shadow_dac_addr, wid_reg_val); - - /* Schedule the window transfer. */ - DACCFG_WRITE(dac, FFBDAC_CFG_WTCTRL, - (FFBDAC_CFG_WTCTRL_TCMD | FFBDAC_CFG_WTCTRL_TE)); - - { - int limit = 1000000; - while (limit--) { - unsigned int wtctrl = DACCFG_READ(dac, FFBDAC_CFG_WTCTRL); - - if ((wtctrl & FFBDAC_CFG_WTCTRL_DS) == 0) - break; - } - } -#endif -} - -/* Force the context `c' to be the current context and associate with it - buffer `b' */ -static GLboolean -ffbMakeCurrent(__DRIcontext *driContextPriv, - __DRIdrawable *driDrawPriv, - __DRIdrawable *driReadPriv) -{ - if (driContextPriv) { - ffbContextPtr fmesa = (ffbContextPtr) driContextPriv->driverPrivate; - int first_time; - - fmesa->driDrawable = driDrawPriv; - - _mesa_make_current(fmesa->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate); - - first_time = 0; - if (fmesa->wid == ~0) { - first_time = 1; - if (getenv("LIBGL_SOFTWARE_RENDERING")) - FALLBACK( fmesa->glCtx, FFB_BADATTR_SWONLY, GL_TRUE ); - } - - LOCK_HARDWARE(fmesa); - if (first_time) { - fmesa->wid = fmesa->ffb_sarea->wid_table[driDrawPriv->index]; - ffb_init_wid(fmesa, fmesa->wid); - } - - fmesa->state_dirty |= FFB_STATE_ALL; - fmesa->state_fifo_ents = fmesa->state_all_fifo_ents; - ffbSyncHardware(fmesa); - UNLOCK_HARDWARE(fmesa); - - if (first_time) { - /* Also, at the first switch to a new context, - * we need to clear all the hw buffers. - */ - ffbDDClear(fmesa->glCtx, - (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT | - BUFFER_BIT_DEPTH | BUFFER_BIT_STENCIL)); - } - } else { - _mesa_make_current(NULL, NULL, NULL); - } - - return GL_TRUE; -} - -/* Force the context `c' to be unbound from its buffer */ -static GLboolean -ffbUnbindContext(__DRIcontext *driContextPriv) -{ - return GL_TRUE; -} - -void ffbXMesaUpdateState(ffbContextPtr fmesa) -{ - __DRIdrawable *dPriv = fmesa->driDrawable; - __DRIscreen *sPriv = fmesa->driScreen; - int stamp = dPriv->lastStamp; - - DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv); - - if (dPriv->lastStamp != stamp) { - GLcontext *ctx = fmesa->glCtx; - - ffbCalcViewport(ctx); - driUpdateFramebufferSize(ctx, dPriv); - if (ctx->Polygon.StippleFlag) { - ffbXformAreaPattern(fmesa, - (const GLubyte *)ctx->PolygonStipple); - } - } -} - -static const __DRIconfig ** -ffbFillInModes( __DRIscreen *psp, - unsigned pixel_bits, unsigned depth_bits, - unsigned stencil_bits, GLboolean have_back_buffer ) -{ - __DRIconfig **configs; - __GLcontextModes *m; - unsigned depth_buffer_factor; - unsigned back_buffer_factor; - GLenum fb_format; - GLenum fb_type; - int i; - - /* GLX_SWAP_COPY_OML is only supported because the FFB driver doesn't - * support pageflipping at all. - */ - static const GLenum back_buffer_modes[] = { - GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML - }; - - uint8_t depth_bits_array[3]; - uint8_t stencil_bits_array[3]; - uint8_t msaa_samples_array[1]; - - depth_bits_array[0] = 0; - depth_bits_array[1] = depth_bits; - depth_bits_array[2] = depth_bits; - - /* Just like with the accumulation buffer, always provide some modes - * with a stencil buffer. It will be a sw fallback, but some apps won't - * care about that. - */ - stencil_bits_array[0] = 0; - stencil_bits_array[1] = 0; - stencil_bits_array[2] = (stencil_bits == 0) ? 8 : stencil_bits; - - msaa_samples_array[0] = 0; - - depth_buffer_factor = ((depth_bits != 0) || (stencil_bits != 0)) ? 3 : 1; - back_buffer_factor = (have_back_buffer) ? 3 : 1; - - if ( pixel_bits == 16 ) { - fb_format = GL_RGB; - fb_type = GL_UNSIGNED_SHORT_5_6_5; - } - else { - fb_format = GL_BGRA; - fb_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } - - configs = driCreateConfigs(fb_format, fb_type, - depth_bits_array, stencil_bits_array, - depth_buffer_factor, back_buffer_modes, - back_buffer_factor, - msaa_samples_array, 1, GL_TRUE); - if (configs == NULL) { - fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, - __LINE__); - return NULL; - } - - /* Mark the visual as slow if there are "fake" stencil bits. - */ - for (i = 0; configs[i]; i++) { - m = &configs[i]->modes; - if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) { - m->visualRating = GLX_SLOW_CONFIG; - } - } - - return (const __DRIconfig **) configs; -} - - -/** - * This is the driver specific part of the createNewScreen entry point. - * - * \todo maybe fold this into intelInitDriver - * - * \return the __GLcontextModes supported by this driver - */ -static const __DRIconfig ** -ffbInitScreen(__DRIscreen *psp) -{ - static const __DRIversion ddx_expected = { 0, 1, 1 }; - static const __DRIversion dri_expected = { 4, 0, 0 }; - static const __DRIversion drm_expected = { 0, 0, 1 }; - - if ( ! driCheckDriDdxDrmVersions2( "ffb", - &psp->dri_version, & dri_expected, - &psp->ddx_version, & ddx_expected, - &psp->drm_version, & drm_expected ) ) - return NULL; - - if (!ffbInitDriver(psp)) - return NULL; - - return ffbFillInModes( psp, 32, 16, 0, GL_TRUE ); -} - -const struct __DriverAPIRec driDriverAPI = { - .InitScreen = ffbInitScreen, - .DestroyScreen = ffbDestroyScreen, - .CreateContext = ffbCreateContext, - .DestroyContext = ffbDestroyContext, - .CreateBuffer = ffbCreateBuffer, - .DestroyBuffer = ffbDestroyBuffer, - .SwapBuffers = ffbSwapBuffers, - .MakeCurrent = ffbMakeCurrent, - .UnbindContext = ffbUnbindContext, - .GetSwapInfo = NULL, - .GetDrawableMSC = NULL, - .WaitForMSC = NULL, - .WaitForSBC = NULL, - .SwapBuffersMSC = NULL -}; - -/* This is the table of extensions that the loader will dlsym() for. */ -PUBLIC const __DRIextension *__driDriverExtensions[] = { - &driCoreExtension.base, - &driLegacyExtension.base, - NULL -}; diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.h b/src/mesa/drivers/dri/ffb/ffb_xmesa.h deleted file mode 100644 index 2b1740d221..0000000000 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.h +++ /dev/null @@ -1,25 +0,0 @@ - -#ifndef _FFB_XMESA_H_ -#define _FFB_XMESA_H_ - -#include -#include "dri_util.h" -#include "main/mtypes.h" -#include "ffb_drishare.h" -#include "ffb_regs.h" -#include "ffb_dac.h" -#include "ffb_fifo.h" - -typedef struct { - __DRIscreen *sPriv; - ffb_fbcPtr regs; - ffb_dacPtr dac; - volatile char *sfb8r; - volatile char *sfb32; - volatile char *sfb64; - - int fifo_cache; - int rp_active; -} ffbScreenPrivate; - -#endif /* !(_FFB_XMESA_H) */ diff --git a/src/mesa/drivers/dri/ffb/server/ffb_dac.h b/src/mesa/drivers/dri/ffb/server/ffb_dac.h deleted file mode 100644 index ac4a75b459..0000000000 --- a/src/mesa/drivers/dri/ffb/server/ffb_dac.h +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Acceleration for the Creator and Creator3D framebuffer - DAC register layout. - * - * Copyright (C) 2000 David S. Miller (davem@redhat.com) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DAVID MILLER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef _FFB_DAC_H -#define _FFB_DAC_H - -#define Bool int - -/* FFB utilizes two different ramdac chips: - * - * 1) BT9068 "Pacifica1", used in all FFB1 and - * FFB2 boards. - * - * 2) BT498(a) "Pacifica2", used in FFB2+ and - * AFB boards. - * - * They are mostly equivalent, except in a few key areas: - * - * 1) WID register layout - * 2) Number of CLUT tables - * 3) Presence of Window Address Mask register - * 4) Method of GAMMA correction support - */ - -/* NOTE: All addresses described in this file are DAC - * indirect addresses. - */ - -/* DAC color values are in the following format. */ -#define FFBDAC_COLOR_BLUE 0x00ff0000 -#define FFBDAC_COLOR_BLUE_SHFT 16 -#define FFBDAC_COLOR_GREEN 0x0000ff00 -#define FFBDAC_COLOR_GREEN_SHFT 8 -#define FFBDAC_COLOR_RED 0x000000ff -#define FFBDAC_COLOR_RED_SHFT 0 - -/* Cursor DAC register addresses. */ -#define FFBDAC_CUR_BITMAP_P0 0x000 /* Plane 0 cursor bitmap */ -#define FFBDAC_CUR_BITMAP_P1 0x080 /* Plane 1 cursor bitmap */ -#define FFBDAC_CUR_CTRL 0x100 /* Cursor control */ -#define FFBDAC_CUR_COLOR0 0x101 /* Cursor Color 0 */ -#define FFBDAC_CUR_COLOR1 0x102 /* Cursor Color 1 (bg) */ -#define FFBDAC_CUR_COLOR2 0x103 /* Cursor Color 2 (fg) */ -#define FFBDAC_CUR_POS 0x104 /* Active cursor position */ - -/* Cursor control register. - * WARNING: Be careful, reverse logic on these bits. - */ -#define FFBDAC_CUR_CTRL_P0 0x00000001 /* Plane0 display disable */ -#define FFBDAC_CUR_CTRL_P1 0x00000002 /* Plane1 display disable */ - -/* Active cursor position register */ -#define FFBDAC_CUR_POS_Y_SIGN 0x80000000 /* Sign of Y position */ -#define FFBDAC_CUR_POS_Y 0x0fff0000 /* Y position */ -#define FFBDAC_CUR_POS_X_SIGN 0x00008000 /* Sign of X position */ -#define FFBDAC_CUR_POS_X 0x00000fff /* X position */ - -/* Configuration and Palette DAC register addresses. */ -#define FFBDAC_CFG_PPLLCTRL 0x0000 /* Pixel PLL Control */ -#define FFBDAC_CFG_GPLLCTRL 0x0001 /* General Purpose PLL Control */ -#define FFBDAC_CFG_PFCTRL 0x1000 /* Pixel Format Control */ -#define FFBDAC_CFG_UCTRL 0x1001 /* User Control */ -#define FFBDAC_CFG_CLUP_BASE 0x2000 /* Color Lookup Palette */ -#define FFBDAC_CFG_CLUP(entry) (FFBDAC_CFG_CLUP_BASE + ((entry) * 0x100)) -#define FFBDAC_PAC2_SOVWLUT0 0x3100 /* Shadow Overlay Window Lookup 0*/ -#define FFBDAC_PAC2_SOVWLUT1 0x3101 /* Shadow Overlay Window Lookup 1*/ -#define FFBDAC_PAC2_SOVWLUT2 0x3102 /* Shadow Overlay Window Lookup 2*/ -#define FFBDAC_PAC2_SOVWLUT3 0x3103 /* Shadow Overlay Window Lookup 3*/ -#define FFBDAC_PAC2_AOVWLUT0 0x3210 /* Active Overlay Window Lookup 0*/ -#define FFBDAC_PAC2_AOVWLUT1 0x3211 /* Active Overlay Window Lookup 1*/ -#define FFBDAC_PAC2_AOVWLUT2 0x3212 /* Active Overlay Window Lookup 2*/ -#define FFBDAC_PAC2_AOVWLUT3 0x3213 /* Active Overlay Window Lookup 3*/ -#define FFBDAC_CFG_WTCTRL 0x3150 /* Window Transfer Control */ -#define FFBDAC_CFG_TMCTRL 0x3151 /* Transparent Mask Control */ -#define FFBDAC_CFG_TCOLORKEY 0x3152 /* Transparent Color Key */ -#define FFBDAC_CFG_WAMASK 0x3153 /* Window Address Mask (PAC2 only) */ -#define FFBDAC_PAC1_SPWLUT_BASE 0x3100 /* Shadow Primary Window Lookups */ -#define FFBDAC_PAC1_SPWLUT(entry) (FFBDAC_PAC1_SPWLUT_BASE + (entry)) -#define FFBDAC_PAC1_APWLUT_BASE 0x3120 /* Active Primary Window Lookups */ -#define FFBDAC_PAC1_APWLUT(entry) (FFBDAC_PAC1_APWLUT_BASE + (entry)) -#define FFBDAC_PAC2_SPWLUT_BASE 0x3200 /* Shadow Primary Window Lookups */ -#define FFBDAC_PAC2_SPWLUT(entry) (FFBDAC_PAC2_SPWLUT_BASE + (entry)) -#define FFBDAC_PAC2_APWLUT_BASE 0x3240 /* Active Primary Window Lookups */ -#define FFBDAC_PAC2_APWLUT(entry) (FFBDAC_PAC2_APWLUT_BASE + (entry)) -#define FFBDAC_CFG_SANAL 0x5000 /* Signature Analysis Control */ -#define FFBDAC_CFG_DACCTRL 0x5001 /* DAC Control */ -#define FFBDAC_CFG_TGEN 0x6000 /* Timing Generator Control */ -#define FFBDAC_CFG_VBNP 0x6001 /* Vertical Blank Negation Point */ -#define FFBDAC_CFG_VBAP 0x6002 /* Vertical Blank Assertion Point*/ -#define FFBDAC_CFG_VSNP 0x6003 /* Vertical Sync Negation Point */ -#define FFBDAC_CFG_VSAP 0x6004 /* Vertical Sync Assertion Point */ -#define FFBDAC_CFG_HSNP 0x6005 /* Horz Serration Negation Point */ -#define FFBDAC_CFG_HBNP 0x6006 /* Horz Blank Negation Point */ -#define FFBDAC_CFG_HBAP 0x6007 /* Horz Blank Assertion Point */ -#define FFBDAC_CFG_HSYNCNP 0x6008 /* Horz Sync Negation Point */ -#define FFBDAC_CFG_HSYNCAP 0x6009 /* Horz Sync Assertion Point */ -#define FFBDAC_CFG_HSCENNP 0x600A /* Horz SCEN Negation Point */ -#define FFBDAC_CFG_HSCENAP 0x600B /* Horz SCEN Assertion Point */ -#define FFBDAC_CFG_EPNP 0x600C /* Eql'zing Pulse Negation Point */ -#define FFBDAC_CFG_EINP 0x600D /* Eql'zing Intvl Negation Point */ -#define FFBDAC_CFG_EIAP 0x600E /* Eql'zing Intvl Assertion Point*/ -#define FFBDAC_CFG_TGVC 0x600F /* Timing Generator Vert Counter */ -#define FFBDAC_CFG_TGHC 0x6010 /* Timing Generator Horz Counter */ -#define FFBDAC_CFG_DID 0x8000 /* Device Identification */ -#define FFBDAC_CFG_MPDATA 0x8001 /* Monitor Port Data */ -#define FFBDAC_CFG_MPSENSE 0x8002 /* Monitor Port Sense */ - -/* Pixel PLL Control Register */ -#define FFBDAC_CFG_PPLLCTRL_M 0x0000007f /* PLL VCO Multiplicand */ -#define FFBDAC_CFG_PPLLCTRL_D 0x00000780 /* PLL VCO Divisor */ -#define FFBDAC_CFG_PPLLCTRL_PFD 0x00001800 /* Post VCO Frequency Divider */ -#define FFBDAC_CFG_PPLLCTRL_EN 0x00004000 /* Enable PLL as pixel clock src */ - -/* General Purpose PLL Control Register */ -#define FFBDAC_CFG_GPLLCTRL_M 0x0000007f /* PLL VCO Multiplicand */ -#define FFBDAC_CFG_GPLLCTRL_D 0x00000780 /* PLL VCO Divisor */ -#define FFBDAC_CFG_GPLLCTRL_PFD 0x00001800 /* Post VCO Frequency Divider */ -#define FFBDAC_CFG_GPLLCTRL_EN 0x00004000 /* Enable PLL as Gen. Purpose clk*/ - -/* Pixel Format Control Register */ -#define FFBDAC_CFG_PFCTRL_2_1 0x00000000 /* 2:1 pixel interleave format */ -#define FFBDAC_CFG_PFCTRL_4_1 0x00000001 /* 4:1 pixel interleave format */ -#define FFBDAC_CFG_PFCTRL_42_1 0x00000002 /* 4/2:1 pixel interleave format */ -#define FFBDAC_CFG_PFCTRL_82_1 0x00000003 /* 8/2:1 pixel interleave format */ - -/* User Control Register */ -#define FFBDAC_UCTRL_IPDISAB 0x00000001 /* Disable input pullup resistors*/ -#define FFBDAC_UCTRL_ABLANK 0x00000002 /* Asynchronous Blank */ -#define FFBDAC_UCTRL_DBENAB 0x00000004 /* Double-Buffer Enable */ -#define FFBDAC_UCTRL_OVENAB 0x00000008 /* Overlay Enable */ -#define FFBDAC_UCTRL_WMODE 0x00000030 /* Window Mode */ -#define FFBDAC_UCTRL_WM_COMB 0x00000000 /* Window Mode = Combined */ -#define FFBDAC_UCTRL_WM_S4 0x00000010 /* Window Mode = Seperate_4 */ -#define FFBDAC_UCTRL_WM_S8 0x00000020 /* Window Mode = Seperate_8 */ -#define FFBDAC_UCTRL_WM_RESV 0x00000030 /* Window Mode = reserved */ -#define FFBDAC_UCTRL_MANREV 0x00000f00 /* 4-bit Manufacturing Revision */ - -/* Overlay Window Lookup Registers (PAC2 only) */ -#define FFBDAC_CFG_OVWLUT_PSEL 0x0000000f /* Palette Section, Seperate_4 */ -#define FFBDAC_CFG_OVWLUT_PTBL 0x00000030 /* Palette Table */ -#define FFBDAC_CFG_OVWLUT_LKUP 0x00000100 /* 1 = Use palette, 0 = Bypass */ -#define FFBDAC_CFG_OVWLUT_OTYP 0x00000c00 /* Overlay Type */ -#define FFBDAC_CFG_OVWLUT_O_N 0x00000000 /* Overlay Type - None */ -#define FFBDAC_CFG_OVWLUT_O_T 0x00000400 /* Overlay Type - Transparent */ -#define FFBDAC_CFG_OVWLUT_O_O 0x00000800 /* Overlay Type - Opaque */ -#define FFBDAC_CFG_OVWLUT_O_R 0x00000c00 /* Overlay Type - Reserved */ -#define FFBDAC_CFG_OVWLUT_PCS 0x00003000 /* Psuedocolor Src */ -#define FFBDAC_CFG_OVWLUT_P_XO 0x00000000 /* Psuedocolor Src - XO[7:0] */ -#define FFBDAC_CFG_OVWLUT_P_R 0x00001000 /* Psuedocolor Src - R[7:0] */ -#define FFBDAC_CFG_OVWLUT_P_G 0x00002000 /* Psuedocolor Src - G[7:0] */ -#define FFBDAC_CFG_OVWLUT_P_B 0x00003000 /* Psuedocolor Src - B[7:0] */ - -/* Window Transfer Control Register */ -#define FFBDAC_CFG_WTCTRL_DS 0x00000001 /* Device Status, 1 = Busy */ -#define FFBDAC_CFG_WTCTRL_TCMD 0x00000002 /* Transfer Command - * 1 = Transfer, 0 = No Action - */ -#define FFBDAC_CFG_WTCTRL_TE 0x00000004 /* Transfer Event - * 1 = Next Frame, 0 = Next Field - */ -#define FFBDAC_CFG_WTCTRL_DRD 0x00000008 /* Drawing Data - * 1 = Local Drawing Active - * 0 = Local Drawing Idle - */ -#define FFBDAC_CFG_WTCTRL_DRS 0x00000010 /* Drawing Status - * 1 = Network Drawing Active - * 0 = Network Drawing Idle - */ - -/* Transparent Mask Control Register */ -#define FFBDAC_CFG_TMCTRL_OMSK 0x000000ff /* Overlay Mask */ - -/* Transparent Color Key Register */ -#define FFBDAC_CFG_TCOLORKEY_K 0x000000ff /* Overlay Color Key */ - -/* Window Address Mask Register (PAC2 only) */ -#define FFBDAC_CFG_WAMASK_PMSK 0x0000003f /* PWLUT select PMASK */ -#define FFBDAC_CFG_WAMASK_OMSK 0x00000300 /* OWLUT control OMASK */ - -/* (non-Overlay) Window Lookup Table Registers, PAC1 format */ -#define FFBDAC_PAC1_WLUT_DB 0x00000020 /* 0 = Buffer A, 1 = Buffer B */ -#define FFBDAC_PAC1_WLUT_C 0x0000001c /* C: Color Model Selection */ -#define FFBDAC_PAC1_WLUT_C_8P 0x00000000 /* C: 8bpp Pseudocolor */ -#define FFBDAC_PAC1_WLUT_C_8LG 0x00000004 /* C: 8bpp Linear Grey */ -#define FFBDAC_PAC1_WLUT_C_8NG 0x00000008 /* C: 8bpp Non-Linear Grey */ -#define FFBDAC_PAC1_WLUT_C_24D 0x00000010 /* C: 24bpp Directcolor */ -#define FFBDAC_PAC1_WLUT_C_24LT 0x00000014 /* C: 24bpp Linear Truecolor */ -#define FFBDAC_PAC1_WLUT_C_24NT 0x00000018 /* C: 24bpp Non-Linear Truecolor */ -#define FFBDAC_PAC1_WLUT_PCS 0x00000003 /* Pseudocolor Src */ -#define FFBDAC_PAC1_WLUT_P_XO 0x00000000 /* Pseudocolor Src - XO[7:0] */ -#define FFBDAC_PAC1_WLUT_P_R 0x00000001 /* Pseudocolor Src - R[7:0] */ -#define FFBDAC_PAC1_WLUT_P_G 0x00000002 /* Pseudocolor Src - G[7:0] */ -#define FFBDAC_PAC1_WLUT_P_B 0x00000003 /* Pseudocolor Src - B[7:0] */ - -/* (non-Overlay) Window Lookup Table Registers, PAC2 format */ -#define FFBDAC_PAC2_WLUT_PTBL 0x00000030 /* Palette Table Entry */ -#define FFBDAC_PAC2_WLUT_LKUP 0x00000100 /* 1 = Use palette, 0 = Bypass */ -#define FFBDAC_PAC2_WLUT_PCS 0x00003000 /* Pseudocolor Src */ -#define FFBDAC_PAC2_WLUT_P_XO 0x00000000 /* Pseudocolor Src - XO[7:0] */ -#define FFBDAC_PAC2_WLUT_P_R 0x00001000 /* Pseudocolor Src - R[7:0] */ -#define FFBDAC_PAC2_WLUT_P_G 0x00002000 /* Pseudocolor Src - G[7:0] */ -#define FFBDAC_PAC2_WLUT_P_B 0x00003000 /* Pseudocolor Src - B[7:0] */ -#define FFBDAC_PAC2_WLUT_DEPTH 0x00004000 /* 0 = Pseudocolor, 1 = Truecolor*/ -#define FFBDAC_PAC2_WLUT_DB 0x00008000 /* 0 = Buffer A, 1 = Buffer B */ - -/* Signature Analysis Control Register */ -#define FFBDAC_CFG_SANAL_SRR 0x000000ff /* DAC Seed/Result for Red */ -#define FFBDAC_CFG_SANAL_SRG 0x0000ff00 /* DAC Seed/Result for Green */ -#define FFBDAC_CFG_SANAL_SRB 0x00ff0000 /* DAC Seed/Result for Blue */ -#define FFBDAC_CFG_SANAL_RQST 0x01000000 /* Signature Capture Request */ -#define FFBDAC_CFG_SANAL_BSY 0x02000000 /* Signature Analysis Busy */ -#define FFBDAC_CFG_SANAL_DSM 0x04000000 /* Data Strobe Mode - * 0 = Signature Analysis Mode - * 1 = Data Strobe Mode - */ - -/* DAC Control Register */ -#define FFBDAC_CFG_DACCTRL_O2 0x00000003 /* Operand 2 Select - * 00 = Normal Operation - * 01 = Select 145mv Reference - * 10 = Select Blue DAC Output - * 11 = Reserved - */ -#define FFBDAC_CFG_DACCTRL_O1 0x0000000c /* Operand 1 Select - * 00 = Normal Operation - * 01 = Select Green DAC Output - * 10 = Select Red DAC Output - * 11 = Reserved - */ -#define FFBDAC_CFG_DACCTRL_CR 0x00000010 /* Comparator Result - * 0 = operand1 < operand2 - * 1 = operand1 > operand2 - */ -#define FFBDAC_CFG_DACCTRL_SGE 0x00000020 /* Sync-on-Green Enable */ -#define FFBDAC_CFG_DACCTRL_PE 0x00000040 /* Pedestal Enable */ -#define FFBDAC_CFG_DACCTRL_VPD 0x00000080 /* VSYNC* Pin Disable */ -#define FFBDAC_CFG_DACCTRL_SPB 0x00000100 /* Sync Polarity Bit - * 0 = VSYNC* and CSYNC* active low - * 1 = VSYNC* and CSYNC* active high - */ - -/* Timing Generator Control Register */ -#define FFBDAC_CFG_TGEN_VIDE 0x00000001 /* Video Enable */ -#define FFBDAC_CFG_TGEN_TGE 0x00000002 /* Timing Generator Enable */ -#define FFBDAC_CFG_TGEN_HSD 0x00000004 /* HSYNC* Disabled */ -#define FFBDAC_CFG_TGEN_VSD 0x00000008 /* VSYNC* Disabled */ -#define FFBDAC_CFG_TGEN_EQD 0x00000010 /* Equalization Disabled */ -#define FFBDAC_CFG_TGEN_MM 0x00000020 /* 0 = Slave, 1 = Master */ -#define FFBDAC_CFG_TGEN_IM 0x00000040 /* 1 = Interlaced Mode */ - -/* Device Identification Register, should be 0xA236E1AD for FFB bt497/bt498 */ -#define FFBDAC_CFG_DID_ONE 0x00000001 /* Always set */ -#define FFBDAC_CFG_DID_MANUF 0x00000ffe /* Manufacturer ID */ -#define FFBDAC_CFG_DID_PNUM 0x0ffff000 /* Device Part Number */ -#define FFBDAC_CFG_DID_REV 0xf0000000 /* Device Revision */ - -/* Monitor Port Data Register */ -#define FFBDAC_CFG_MPDATA_SCL 0x00000001 /* SCL Data */ -#define FFBDAC_CFG_MPDATA_SDA 0x00000002 /* SDA Data */ - -/* Monitor Port Sense Register */ -#define FFBDAC_CFG_MPSENSE_SCL 0x00000001 /* SCL Sense */ -#define FFBDAC_CFG_MPSENSE_SDA 0x00000002 /* SDA Sense */ - -/* DAC register access shorthands. */ -#define DACCUR_READ(DAC, ADDR) ((DAC)->cur = (ADDR), (DAC)->curdata) -#define DACCUR_WRITE(DAC, ADDR, VAL) ((DAC)->cur = (ADDR), (DAC)->curdata = (VAL)) -#define DACCFG_READ(DAC, ADDR) ((DAC)->cfg = (ADDR), (DAC)->cfgdata) -#define DACCFG_WRITE(DAC, ADDR, VAL) ((DAC)->cfg = (ADDR), (DAC)->cfgdata = (VAL)) - -typedef struct ffb_dac_hwstate { - unsigned int ppllctrl; - unsigned int gpllctrl; - unsigned int pfctrl; - unsigned int uctrl; - unsigned int clut[256 * 4]; /* One 256 entry clut on PAC1, 4 on PAC2 */ - unsigned int ovluts[4]; /* Overlay WLUTS, PAC2 only */ - unsigned int wtctrl; - unsigned int tmctrl; - unsigned int tcolorkey; - unsigned int wamask; - unsigned int pwluts[64]; - unsigned int dacctrl; - unsigned int tgen; - unsigned int vbnp; - unsigned int vbap; - unsigned int vsnp; - unsigned int vsap; - unsigned int hsnp; - unsigned int hbnp; - unsigned int hbap; - unsigned int hsyncnp; - unsigned int hsyncap; - unsigned int hscennp; - unsigned int hscenap; - unsigned int epnp; - unsigned int einp; - unsigned int eiap; -} ffb_dac_hwstate_t; - -typedef struct { - Bool InUse; - - /* The following fields are undefined unless InUse is TRUE. */ - int refcount; - Bool canshare; - unsigned int wlut_regval; - int buffer; /* 0 = Buffer A, 1 = Buffer B */ - int depth; /* 8 or 32 bpp */ - int greyscale; /* 1 = greyscale, 0 = color */ - int linear; /* 1 = linear, 0 = non-linear */ - int direct; /* 1 = 24bpp directcolor */ - int channel; /* 0 = X, 1 = R, 2 = G, 3 = B */ - int palette; /* Only PAC2 has multiple CLUTs */ -} ffb_wid_info_t; - -#define FFB_MAX_PWIDS 64 -typedef struct { - int num_wids; - int wid_shift; /* To get X channel value */ - ffb_wid_info_t wid_pool[FFB_MAX_PWIDS]; -} ffb_wid_pool_t; - -typedef struct ffb_dac_info { - unsigned int flags; -#define FFB_DAC_PAC1 0x00000001 /* Pacifica1 DAC, BT9068 */ -#define FFB_DAC_PAC2 0x00000002 /* Pacifica2 DAC, BT498 */ -#define FFB_DAC_ICURCTL 0x00000004 /* Inverted CUR_CTRL bits */ - - unsigned int kernel_wid; - - /* These registers need to be modified when changing DAC - * timing state, so at init time we capture their values. - */ - unsigned int ffbcfg0; - unsigned int ffbcfg2; - unsigned int ffb_passin_ctrl; /* FFB2+/AFB only */ - - ffb_dac_hwstate_t kern_dac_state; - ffb_dac_hwstate_t x_dac_state; - - ffb_wid_pool_t wid_table; -} ffb_dac_info_t; - -#endif /* _FFB_DAC_H */ diff --git a/src/mesa/drivers/dri/ffb/server/ffb_drishare.h b/src/mesa/drivers/dri/ffb/server/ffb_drishare.h deleted file mode 100644 index 69fefa3f0a..0000000000 --- a/src/mesa/drivers/dri/ffb/server/ffb_drishare.h +++ /dev/null @@ -1,47 +0,0 @@ - -#ifndef _FFB_DRISHARE_H -#define _FFB_DRISHARE_H - -typedef struct ffb_dri_state { - int flags; -#define FFB_DRI_FFB2 0x00000001 -#define FFB_DRI_FFB2PLUS 0x00000002 -#define FFB_DRI_PAC1 0x00000004 -#define FFB_DRI_PAC2 0x00000008 - - /* Indexed by DRI drawable id. */ -#define FFB_DRI_NWIDS 64 - unsigned int wid_table[FFB_DRI_NWIDS]; -} ffb_dri_state_t; - -#define FFB_DRISHARE(SAREA) \ - ((ffb_dri_state_t *) (((char *)(SAREA)) + sizeof(drm_sarea_t))) - -typedef struct { - drm_handle_t hFbcRegs; - drmSize sFbcRegs; - - drm_handle_t hDacRegs; - drmSize sDacRegs; - - drm_handle_t hSfb8r; - drmSize sSfb8r; - - drm_handle_t hSfb32; - drmSize sSfb32; - - drm_handle_t hSfb64; - drmSize sSfb64; - - /* Fastfill/Pagefill parameters. */ - unsigned char disable_pagefill; - int fastfill_small_area; - int pagefill_small_area; - int fastfill_height; - int fastfill_width; - int pagefill_height; - int pagefill_width; - short Pf_AlignTab[0x800]; -} FFBDRIRec, *FFBDRIPtr; - -#endif /* !(_FFB_DRISHARE_H) */ diff --git a/src/mesa/drivers/dri/ffb/server/ffb_regs.h b/src/mesa/drivers/dri/ffb/server/ffb_regs.h deleted file mode 100644 index bda5840d60..0000000000 --- a/src/mesa/drivers/dri/ffb/server/ffb_regs.h +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Acceleration for the Creator and Creator3D framebuffer - register layout. - * - * Copyright (C) 1998,1999,2000 Jakub Jelinek (jakub@redhat.com) - * Copyright (C) 1998 Michal Rehacek (majkl@iname.com) - * Copyright (C) 1999 David S. Miller (davem@redhat.com) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * JAKUB JELINEK, MICHAL REHACEK, OR DAVID MILLER BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -#ifndef FFBREGS_H -#define FFBREGS_H - -/* Auxilliary clips. */ -typedef struct { - volatile unsigned int min; - volatile unsigned int max; -} ffb_auxclip, *ffb_auxclipPtr; - -/* FFB register set. */ -typedef struct _ffb_fbc { - /* Next vertex registers, on the right we list which drawops - * use said register and the logical name the register has in - * that context. - */ /* DESCRIPTION DRAWOP(NAME) */ -/*0x00*/unsigned int pad1[3]; /* Reserved */ -/*0x0c*/volatile unsigned int alpha; /* ALPHA Transparency */ -/*0x10*/volatile unsigned int red; /* RED */ -/*0x14*/volatile unsigned int green; /* GREEN */ -/*0x18*/volatile unsigned int blue; /* BLUE */ -/*0x1c*/volatile unsigned int z; /* DEPTH */ -/*0x20*/volatile unsigned int y; /* Y triangle(DOYF) */ - /* aadot(DYF) */ - /* ddline(DYF) */ - /* aaline(DYF) */ -/*0x24*/volatile unsigned int x; /* X triangle(DOXF) */ - /* aadot(DXF) */ - /* ddline(DXF) */ - /* aaline(DXF) */ -/*0x28*/unsigned int pad2[2]; /* Reserved */ -/*0x30*/volatile unsigned int ryf; /* Y (alias to DOYF) ddline(RYF) */ - /* aaline(RYF) */ - /* triangle(RYF) */ -/*0x34*/volatile unsigned int rxf; /* X ddline(RXF) */ - /* aaline(RXF) */ - /* triangle(RXF) */ -/*0x38*/unsigned int pad3[2]; /* Reserved */ -/*0x40*/volatile unsigned int dmyf; /* Y (alias to DOYF) triangle(DMYF) */ -/*0x44*/volatile unsigned int dmxf; /* X triangle(DMXF) */ -/*0x48*/unsigned int pad4[2]; /* Reserved */ -/*0x50*/volatile unsigned int ebyi; /* Y (alias to RYI) polygon(EBYI) */ -/*0x54*/volatile unsigned int ebxi; /* X polygon(EBXI) */ -/*0x58*/unsigned int pad5[2]; /* Reserved */ -/*0x60*/volatile unsigned int by; /* Y brline(RYI) */ - /* fastfill(OP) */ - /* polygon(YI) */ - /* rectangle(YI) */ - /* bcopy(SRCY) */ - /* vscroll(SRCY) */ -/*0x64*/volatile unsigned int bx; /* X brline(RXI) */ - /* polygon(XI) */ - /* rectangle(XI) */ - /* bcopy(SRCX) */ - /* vscroll(SRCX) */ - /* fastfill(GO) */ -/*0x68*/volatile unsigned int dy; /* destination Y fastfill(DSTY) */ - /* bcopy(DSRY) */ - /* vscroll(DSRY) */ -/*0x6c*/volatile unsigned int dx; /* destination X fastfill(DSTX) */ - /* bcopy(DSTX) */ - /* vscroll(DSTX) */ -/*0x70*/volatile unsigned int bh; /* Y (alias to RYI) brline(DYI) */ - /* dot(DYI) */ - /* polygon(ETYI) */ - /* Height fastfill(H) */ - /* bcopy(H) */ - /* vscroll(H) */ - /* Y count fastfill(NY) */ -/*0x74*/volatile unsigned int bw; /* X dot(DXI) */ - /* brline(DXI) */ - /* polygon(ETXI) */ - /* fastfill(W) */ - /* bcopy(W) */ - /* vscroll(W) */ - /* fastfill(NX) */ -/*0x78*/unsigned int pad6[2]; /* Reserved */ -/*0x80*/unsigned int pad7[32]; /* Reserved */ - - /* Setup Unit's vertex state register */ -/*100*/ volatile unsigned int suvtx; -/*104*/ unsigned int pad8[63]; /* Reserved */ - - /* Frame Buffer Control Registers */ -/*200*/ volatile unsigned int ppc; /* Pixel Processor Control */ -/*204*/ volatile unsigned int wid; /* Current WID */ -/*208*/ volatile unsigned int fg; /* FG data */ -/*20c*/ volatile unsigned int bg; /* BG data */ -/*210*/ volatile unsigned int consty; /* Constant Y */ -/*214*/ volatile unsigned int constz; /* Constant Z */ -/*218*/ volatile unsigned int xclip; /* X Clip */ -/*21c*/ volatile unsigned int dcss; /* Depth Cue Scale Slope */ -/*220*/ volatile unsigned int vclipmin; /* Viewclip XY Min Bounds */ -/*224*/ volatile unsigned int vclipmax; /* Viewclip XY Max Bounds */ -/*228*/ volatile unsigned int vclipzmin; /* Viewclip Z Min Bounds */ -/*22c*/ volatile unsigned int vclipzmax; /* Viewclip Z Max Bounds */ -/*230*/ volatile unsigned int dcsf; /* Depth Cue Scale Front Bound */ -/*234*/ volatile unsigned int dcsb; /* Depth Cue Scale Back Bound */ -/*238*/ volatile unsigned int dczf; /* Depth Cue Z Front */ -/*23c*/ volatile unsigned int dczb; /* Depth Cue Z Back */ -/*240*/ unsigned int pad9; /* Reserved */ -/*244*/ volatile unsigned int blendc; /* Alpha Blend Control */ -/*248*/ volatile unsigned int blendc1; /* Alpha Blend Color 1 */ -/*24c*/ volatile unsigned int blendc2; /* Alpha Blend Color 2 */ -/*250*/ volatile unsigned int fbramitc; /* FB RAM Interleave Test Control */ -/*254*/ volatile unsigned int fbc; /* Frame Buffer Control */ -/*258*/ volatile unsigned int rop; /* Raster OPeration */ -/*25c*/ volatile unsigned int cmp; /* Frame Buffer Compare */ -/*260*/ volatile unsigned int matchab; /* Buffer AB Match Mask */ -/*264*/ volatile unsigned int matchc; /* Buffer C(YZ) Match Mask */ -/*268*/ volatile unsigned int magnab; /* Buffer AB Magnitude Mask */ -/*26c*/ volatile unsigned int magnc; /* Buffer C(YZ) Magnitude Mask */ -/*270*/ volatile unsigned int fbcfg0; /* Frame Buffer Config 0 */ -/*274*/ volatile unsigned int fbcfg1; /* Frame Buffer Config 1 */ -/*278*/ volatile unsigned int fbcfg2; /* Frame Buffer Config 2 */ -/*27c*/ volatile unsigned int fbcfg3; /* Frame Buffer Config 3 */ -/*280*/ volatile unsigned int ppcfg; /* Pixel Processor Config */ -/*284*/ volatile unsigned int pick; /* Picking Control */ -/*288*/ volatile unsigned int fillmode; /* FillMode */ -/*28c*/ volatile unsigned int fbramwac; /* FB RAM Write Address Control */ -/*290*/ volatile unsigned int pmask; /* RGB PlaneMask */ -/*294*/ volatile unsigned int xpmask; /* X PlaneMask */ -/*298*/ volatile unsigned int ypmask; /* Y PlaneMask */ -/*29c*/ volatile unsigned int zpmask; /* Z PlaneMask */ -/*2a0*/ ffb_auxclip auxclip[4]; /* Auxilliary Viewport Clip */ - - /* New 3dRAM III support regs */ -/*2c0*/ volatile unsigned int rawblend2; -/*2c4*/ volatile unsigned int rawpreblend; -/*2c8*/ volatile unsigned int rawstencil; -/*2cc*/ volatile unsigned int rawstencilctl; -/*2d0*/ volatile unsigned int threedram1; -/*2d4*/ volatile unsigned int threedram2; -/*2d8*/ volatile unsigned int passin; -/*2dc*/ volatile unsigned int rawclrdepth; -/*2e0*/ volatile unsigned int rawpmask; -/*2e4*/ volatile unsigned int rawcsrc; -/*2e8*/ volatile unsigned int rawmatch; -/*2ec*/ volatile unsigned int rawmagn; -/*2f0*/ volatile unsigned int rawropblend; -/*2f4*/ volatile unsigned int rawcmp; -/*2f8*/ volatile unsigned int rawwac; -/*2fc*/ volatile unsigned int fbramid; - -/*300*/ volatile unsigned int drawop; /* Draw OPeration */ -/*304*/ unsigned int pad10[2]; /* Reserved */ -/*30c*/ volatile unsigned int lpat; /* Line Pattern control */ -/*310*/ unsigned int pad11; /* Reserved */ -/*314*/ volatile unsigned int fontxy; /* XY Font coordinate */ -/*318*/ volatile unsigned int fontw; /* Font Width */ -/*31c*/ volatile unsigned int fontinc; /* Font Increment */ -/*320*/ volatile unsigned int font; /* Font bits */ -/*324*/ unsigned int pad12[3]; /* Reserved */ -/*330*/ volatile unsigned int blend2; -/*334*/ volatile unsigned int preblend; -/*338*/ volatile unsigned int stencil; -/*33c*/ volatile unsigned int stencilctl; - -/*340*/ unsigned int pad13[4]; /* Reserved */ -/*350*/ volatile unsigned int dcss1; /* Depth Cue Scale Slope 1 */ -/*354*/ volatile unsigned int dcss2; /* Depth Cue Scale Slope 2 */ -/*358*/ volatile unsigned int dcss3; /* Depth Cue Scale Slope 3 */ -/*35c*/ volatile unsigned int widpmask; -/*360*/ volatile unsigned int dcs2; -/*364*/ volatile unsigned int dcs3; -/*368*/ volatile unsigned int dcs4; -/*36c*/ unsigned int pad14; /* Reserved */ -/*370*/ volatile unsigned int dcd2; -/*374*/ volatile unsigned int dcd3; -/*378*/ volatile unsigned int dcd4; -/*37c*/ unsigned int pad15; /* Reserved */ -/*380*/ volatile unsigned int pattern[32]; /* area Pattern */ -/*400*/ unsigned int pad16[8]; /* Reserved */ -/*420*/ volatile unsigned int reset; /* chip RESET */ -/*424*/ unsigned int pad17[247]; /* Reserved */ -/*800*/ volatile unsigned int devid; /* Device ID */ -/*804*/ unsigned int pad18[63]; /* Reserved */ -/*900*/ volatile unsigned int ucsr; /* User Control & Status Register */ -/*904*/ unsigned int pad19[31]; /* Reserved */ -/*980*/ volatile unsigned int mer; /* Mode Enable Register */ -/*984*/ unsigned int pad20[1439]; /* Reserved */ -} ffb_fbc, *ffb_fbcPtr; - -/* Draw operations */ -#define FFB_DRAWOP_DOT 0x00 -#define FFB_DRAWOP_AADOT 0x01 -#define FFB_DRAWOP_BRLINECAP 0x02 -#define FFB_DRAWOP_BRLINEOPEN 0x03 -#define FFB_DRAWOP_DDLINE 0x04 -#define FFB_DRAWOP_AALINE 0x05 -#define FFB_DRAWOP_TRIANGLE 0x06 -#define FFB_DRAWOP_POLYGON 0x07 -#define FFB_DRAWOP_RECTANGLE 0x08 -#define FFB_DRAWOP_FASTFILL 0x09 -#define FFB_DRAWOP_BCOPY 0x0a /* Not implemented in any FFB, VIS is faster */ -#define FFB_DRAWOP_VSCROLL 0x0b /* Up to 12x faster than BCOPY, 3-4x faster than VIS */ - -/* FastFill operation codes. */ -#define FFB_FASTFILL_PAGE 0x01 -#define FFB_FASTFILL_BLOCK 0x02 -#define FFB_FASTFILL_COLOR_BLK 0x03 -#define FFB_FASTFILL_BLOCK_X 0x04 - -/* Spanfill Unit Line Pattern */ -#define FFB_LPAT_SCALEPTR 0xf0000000 -#define FFB_LPAT_SCALEPTR_SHIFT 28 -#define FFB_LPAT_PATPTR 0x0f000000 -#define FFB_LPAT_PATPTR_SHIFT 24 -#define FFB_LPAT_SCALEVAL 0x00f00000 -#define FFB_LPAT_SCALEVAL_SHIFT 20 -#define FFB_LPAT_PATLEN 0x000f0000 -#define FFB_LPAT_PATLEN_SHIFT 16 -#define FFB_LPAT_PATTERN 0x0000ffff -#define FFB_LPAT_PATTERN_SHIFT 0 - -/* Pixel processor control */ -/* Force WID */ -#define FFB_PPC_FW_DISABLE 0x800000 -#define FFB_PPC_FW_ENABLE 0xc00000 -#define FFB_PPC_FW_MASK 0xc00000 -/* Auxiliary clip */ -#define FFB_PPC_ACE_DISABLE 0x040000 -#define FFB_PPC_ACE_AUX_SUB 0x080000 -#define FFB_PPC_ACE_AUX_ADD 0x0c0000 -#define FFB_PPC_ACE_MASK 0x0c0000 -/* Depth cue */ -#define FFB_PPC_DCE_DISABLE 0x020000 -#define FFB_PPC_DCE_ENABLE 0x030000 -#define FFB_PPC_DCE_MASK 0x030000 -/* Alpha blend */ -#define FFB_PPC_ABE_DISABLE 0x008000 -#define FFB_PPC_ABE_ENABLE 0x00c000 -#define FFB_PPC_ABE_MASK 0x00c000 -/* View clip */ -#define FFB_PPC_VCE_DISABLE 0x001000 -#define FFB_PPC_VCE_2D 0x002000 -#define FFB_PPC_VCE_3D 0x003000 -#define FFB_PPC_VCE_MASK 0x003000 -/* Area pattern */ -#define FFB_PPC_APE_DISABLE 0x000800 -#define FFB_PPC_APE_ENABLE 0x000c00 -#define FFB_PPC_APE_MASK 0x000c00 -/* Transparent background */ -#define FFB_PPC_TBE_OPAQUE 0x000200 -#define FFB_PPC_TBE_TRANSPARENT 0x000300 -#define FFB_PPC_TBE_MASK 0x000300 -/* Z source */ -#define FFB_PPC_ZS_VAR 0x000080 -#define FFB_PPC_ZS_CONST 0x0000c0 -#define FFB_PPC_ZS_MASK 0x0000c0 -/* Y source */ -#define FFB_PPC_YS_VAR 0x000020 -#define FFB_PPC_YS_CONST 0x000030 -#define FFB_PPC_YS_MASK 0x000030 -/* X source */ -#define FFB_PPC_XS_WID 0x000004 -#define FFB_PPC_XS_VAR 0x000008 -#define FFB_PPC_XS_CONST 0x00000c -#define FFB_PPC_XS_MASK 0x00000c -/* Color (BGR) source */ -#define FFB_PPC_CS_VAR 0x000002 -#define FFB_PPC_CS_CONST 0x000003 -#define FFB_PPC_CS_MASK 0x000003 - -/* X Clip */ -#define FFB_XCLIP_XREF 0x000000ff -#define FFB_XCLIP_TEST_MASK 0x00070000 -#define FFB_XCLIP_TEST_ALWAYS 0x00000000 -#define FFB_XCLIP_TEST_GT 0x00010000 -#define FFB_XCLIP_TEST_EQ 0x00020000 -#define FFB_XCLIP_TEST_GE 0x00030000 -#define FFB_XCLIP_TEST_NEVER 0x00040000 -#define FFB_XCLIP_TEST_LE 0x00050000 -#define FFB_XCLIP_TEST_NE 0x00060000 -#define FFB_XCLIP_TEST_LT 0x00070000 - -/* FB Control register */ -/* Write buffer dest */ -#define FFB_FBC_WB_A 0x20000000 -#define FFB_FBC_WB_B 0x40000000 -#define FFB_FBC_WB_AB 0x60000000 -#define FFB_FBC_WB_C 0x80000000 -#define FFB_FBC_WB_AC 0xa0000000 -#define FFB_FBC_WB_BC 0xc0000000 -#define FFB_FBC_WB_ABC 0xe0000000 -#define FFB_FBC_WB_MASK 0xe0000000 -/* Write enable */ -#define FFB_FBC_WE_FORCEOFF 0x00100000 -#define FFB_FBC_WE_FORCEON 0x00200000 -#define FFB_FBC_WE_USE_WMASK 0x00300000 -#define FFB_FBC_WE_MASK 0x00300000 -/* Write group mode */ -#define FFB_FBC_WM_RSVD 0x00040000 -#define FFB_FBC_WM_COMBINED 0x00080000 -#define FFB_FBC_WM_SEPARATE 0x000c0000 -#define FFB_FBC_WM_MASK 0x000c0000 -/* Read buffer src */ -#define FFB_FBC_RB_A 0x00004000 -#define FFB_FBC_RB_B 0x00008000 -#define FFB_FBC_RB_C 0x0000c000 -#define FFB_FBC_RB_MASK 0x0000c000 -/* Stereo buf dest */ -#define FFB_FBC_SB_LEFT 0x00001000 -#define FFB_FBC_SB_RIGHT 0x00002000 -#define FFB_FBC_SB_BOTH 0x00003000 -#define FFB_FBC_SB_MASK 0x00003000 -/* Z plane group enable */ -#define FFB_FBC_ZE_OFF 0x00000400 -#define FFB_FBC_ZE_ON 0x00000800 -#define FFB_FBC_ZE_MASK 0x00000c00 -/* Y plane group enable */ -#define FFB_FBC_YE_OFF 0x00000100 -#define FFB_FBC_YE_ON 0x00000200 -#define FFB_FBC_YE_MASK 0x00000300 -/* X plane group enable */ -#define FFB_FBC_XE_OFF 0x00000040 -#define FFB_FBC_XE_ON 0x00000080 -#define FFB_FBC_XE_MASK 0x000000c0 -/* B plane group enable */ -#define FFB_FBC_BE_OFF 0x00000010 -#define FFB_FBC_BE_ON 0x00000020 -#define FFB_FBC_BE_MASK 0x00000030 -/* G plane group enable */ -#define FFB_FBC_GE_OFF 0x00000004 -#define FFB_FBC_GE_ON 0x00000008 -#define FFB_FBC_GE_MASK 0x0000000c -/* R plane group enable */ -#define FFB_FBC_RE_OFF 0x00000001 -#define FFB_FBC_RE_ON 0x00000002 -#define FFB_FBC_RE_MASK 0x00000003 -/* Combined */ -#define FFB_FBC_RGBE_OFF 0x00000015 -#define FFB_FBC_RGBE_ON 0x0000002a -#define FFB_FBC_RGBE_MASK 0x0000003f - -/* Raster OP */ -#define FFB_ROP_YZ_MASK 0x008f0000 -#define FFB_ROP_X_MASK 0x00008f00 -#define FFB_ROP_RGB_MASK 0x0000008f - -/* Now the rops themselves which get shifted into the - * above fields. - */ -#define FFB_ROP_EDIT_BIT 0x80 -#define FFB_ROP_ZERO 0x80 -#define FFB_ROP_NEW_AND_OLD 0x81 -#define FFB_ROP_NEW_AND_NOLD 0x82 -#define FFB_ROP_NEW 0x83 -#define FFB_ROP_NNEW_AND_OLD 0x84 -#define FFB_ROP_OLD 0x85 -#define FFB_ROP_NEW_XOR_OLD 0x86 -#define FFB_ROP_NEW_OR_OLD 0x87 -#define FFB_ROP_NNEW_AND_NOLD 0x88 -#define FFB_ROP_NNEW_XOR_NOLD 0x89 -#define FFB_ROP_NOLD 0x8a -#define FFB_ROP_NEW_OR_NOLD 0x8b -#define FFB_ROP_NNEW 0x8c -#define FFB_ROP_NNEW_OR_OLD 0x8d -#define FFB_ROP_NNEW_OR_NOLD 0x8e -#define FFB_ROP_ONES 0x8f - -/* FB Compare */ -#define FFB_CMP_MATCHC_MASK 0x8f000000 -#define FFB_CMP_MAGNC_MASK 0x00870000 -#define FFB_CMP_MATCHAB_MASK 0x0000ff00 -#define FFB_CMP_MAGNAB_MASK 0x000000ff - -/* Compare Match codes */ -#define FFB_CMP_MATCH_EDIT_BIT 0x80 -#define FFB_CMP_MATCH_ALWAYS 0x80 -#define FFB_CMP_MATCH_NEVER 0x81 -#define FFB_CMP_MATCH_EQ 0x82 -#define FFB_CMP_MATCH_NE 0x83 -#define FFB_CMP_MATCH_A_ALWAYS 0xc0 -#define FFB_CMP_MATCH_B_ALWAYS 0xa0 - -/* Compare Magnitude codes */ -#define FFB_CMP_MAGN_EDIT_BIT 0x80 -#define FFB_CMP_MAGN_ALWAYS 0x80 -#define FFB_CMP_MAGN_GT 0x81 -#define FFB_CMP_MAGN_EQ 0x82 -#define FFB_CMP_MAGN_GE 0x83 -#define FFB_CMP_MAGN_NEVER 0x84 -#define FFB_CMP_MAGN_LE 0x85 -#define FFB_CMP_MAGN_NE 0x86 -#define FFB_CMP_MAGN_LT 0x87 -#define FFB_CMP_MAGN_A_ALWAYS 0xc0 -#define FFB_CMP_MAGN_B_ALWAYS 0xa0 - -/* User Control and Status */ -#define FFB_UCSR_FIFO_MASK 0x00000fff -#define FFB_UCSR_PICK_NO_HIT 0x00020000 -#define FFB_UCSR_PICK_HIT 0x00030000 -#define FFB_UCSR_PICK_DISABLE 0x00080000 -#define FFB_UCSR_PICK_ENABLE 0x000c0000 -#define FFB_UCSR_FB_BUSY 0x01000000 -#define FFB_UCSR_RP_BUSY 0x02000000 -#define FFB_UCSR_ALL_BUSY (FFB_UCSR_RP_BUSY|FFB_UCSR_FB_BUSY) -#define FFB_UCSR_READ_ERR 0x40000000 -#define FFB_UCSR_FIFO_OVFL 0x80000000 -#define FFB_UCSR_ALL_ERRORS (FFB_UCSR_READ_ERR|FFB_UCSR_FIFO_OVFL) - -/* Mode Enable Register */ -#define FFB_MER_EIRA 0x00000080 /* Enable read-ahead, increasing */ -#define FFB_MER_EDRA 0x000000c0 /* Enable read-ahead, decreasing */ -#define FFB_MER_DRA 0x00000040 /* No read-ahead */ - -/* FBram Config 0 */ -#define FFB_FBCFG0_RFTIME 0xff800000 -#define FFB_FBCFG0_XMAX 0x007c0000 -#define FFB_FBCFG0_YMAX 0x0003ffc0 -#define FFB_FBCFG0_RES_MASK 0x00000030 -#define FFB_FBCFG0_RES_HIGH 0x00000030 /* 1920x1360 */ -#define FFB_FBCFG0_RES_STD 0x00000020 /* 1280x1024 */ -#define FFB_FBCFG0_RES_STEREO 0x00000010 /* 960x580 */ -#define FFB_FBCFG0_RES_PRTRAIT 0x00000000 /* 1280x2048 */ -#define FFB_FBCFG0_ITRLACE 0x00000000 -#define FFB_FBCFG0_SEQUENTIAL 0x00000008 -#define FFB_FBCFG0_DRENA 0x00000004 -#define FFB_FBCFG0_BPMODE 0x00000002 -#define FFB_FBCFG0_RFRSH_RST 0x00000001 - -typedef struct _ffb_dac { - volatile unsigned int cfg; - volatile unsigned int cfgdata; - volatile unsigned int cur; - volatile unsigned int curdata; -} ffb_dac, *ffb_dacPtr; - -/* Writing 2 32-bit registers at a time using 64-bit stores. -DaveM */ -#if defined(__GNUC__) && defined(USE_VIS) -/* 64-bit register writing support. - * Note: "lo" means "low address". - */ -#define FFB_WRITE64_COMMON(__regp, __lo32, __hi32, REG0, REG1) \ -do { __extension__ register unsigned int __r0 __asm__(""#REG0); \ - __extension__ register unsigned int __r1 __asm__(""#REG1); \ - __r0 = (__lo32); \ - __r1 = (__hi32); \ - __asm__ __volatile__ ("sllx\t%0, 32, %%g1\n\t" \ - "srl\t%1, 0, %1\n\t" \ - "or\t%%g1, %1, %%g1\n\t" \ - "stx\t%%g1, %2" \ - : : "r" (__r0), "r" (__r1), "m" (*(__regp)) : "g1"); \ -} while(0) - -#define FFB_WRITE64P(__regp, __srcp) \ -do { __asm__ __volatile__ ("ldx\t%0, %%g2;" \ - "stx\t%%g2, %1" \ - : : "m" (*(__srcp)), "m" (*(__regp)) \ - : "g2"); \ -} while(0) - -#define FFB_WRITE64(__regp, __lo32, __hi32) \ - FFB_WRITE64_COMMON(__regp, __lo32, __hi32, g2, g3) -#define FFB_WRITE64_2(__regp, __lo32, __hi32) \ - FFB_WRITE64_COMMON(__regp, __lo32, __hi32, g4, g5) -#define FFB_WRITE64_3(__regp, __lo32, __hi32) \ - FFB_WRITE64_COMMON(__regp, __lo32, __hi32, o4, o5) - -#else /* Do not use 64-bit writes. */ - -#define FFB_WRITE64(__regp, __lo32, __hi32) \ -do { volatile unsigned int *__p = (__regp); \ - *__p = (__lo32); \ - *(__p + 1) = (__hi32); \ -} while(0) - -#define FFB_WRITE64P(__regp, __srcp) \ -do { volatile unsigned int *__p = (__regp); \ - unsigned int *__q = (__srcp); \ - *__p = *__q; \ - *(__p + 1) = *(__q + 1); \ -} while(0) - -#define FFB_WRITE64_2(__regp, __lo32, __hi32) \ - FFB_WRITE64(__regp, __lo32, __hi32) -#define FFB_WRITE64_3(__regp, __lo32, __hi32) \ - FFB_WRITE64(__regp, __lo32, __hi32) -#endif - -#endif /* FFBREGS_H */ diff --git a/src/mesa/drivers/dri/gamma/Makefile b/src/mesa/drivers/dri/gamma/Makefile deleted file mode 100644 index 09df1578fc..0000000000 --- a/src/mesa/drivers/dri/gamma/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# src/mesa/drivers/dri/gamma/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = gamma_dri.so - -# Not yet -# MINIGLX_SOURCES = server/gamma_dri.c - -DRIVER_SOURCES = \ - gamma_context.c \ - gamma_dd.c \ - gamma_inithw.c \ - gamma_lock.c \ - gamma_render.c \ - gamma_screen.c \ - gamma_span.c \ - gamma_state.c \ - gamma_tex.c \ - gamma_texmem.c \ - gamma_texstate.c \ - gamma_tris.c \ - gamma_vb.c \ - gamma_xmesa.c - -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - -include ../Makefile.template - diff --git a/src/mesa/drivers/dri/gamma/gamma_client.h b/src/mesa/drivers/dri/gamma/gamma_client.h deleted file mode 100644 index 6dcf2e9438..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_client.h +++ /dev/null @@ -1,6184 +0,0 @@ -/* Automaticallly generated -- do not edit */ -#ifndef _GLINT_CLIENT_H_ -#define _GLINT_CLIENT_H_ -/* **********************************************************************/ -/* START OF glint_extra.h INCLUSION */ -/* **********************************************************************/ - -/* glint_extra.h - * Created: Fri Apr 2 23:32:05 1999 by faith@precisioninsight.com - * Revised: Fri Apr 2 23:33:00 1999 by faith@precisioninsight.com - * - * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * - */ - -#define AreaStippleEnable 0x00001 -#define LineStippleEnable 0x00002 -#define GResetLineStipple 0x00004 -#define FastFillEnable 0x00008 -#define PrimitiveLine 0x00000 -#define PrimitiveTrapezoid 0x00040 -#define PrimitivePoint 0x00080 -#define PrimitiveRectangle 0x000C0 -#define AntialiasEnable 0x00100 -#define AntialiasingQuality 0x00200 -#define UsePointTable 0x00400 -#define SyncOnBitMask 0x00800 -#define SyncOnHostData 0x01000 -#define TextureEnable 0x02000 -#define FogEnable 0x04000 -#define CoverageEnable 0x08000 -#define SubPixelCorrectionEnable 0x10000 -#define SpanOperation 0x40000 - - -/* **********************************************************************/ -/* END OF glint_extra.h INCLUSION */ -/* **********************************************************************/ - - -#define GlintResetStatus 0x0000 -#define GlintResetStatusReg 0 -#define GlintResetStatusOff 0x0000 -#define GlintResetStatusSec 0x0000 -#define GlintResetStatusSecReg 2 -#define GlintResetStatusSecOff 0x0000 - -#define GlintIntEnable 0x0008 -#define GlintIntEnableReg 0 -#define GlintIntEnableOff 0x0008 -#define GlintIntEnableSec 0x0008 -#define GlintIntEnableSecReg 2 -#define GlintIntEnableSecOff 0x0008 - -#define GlintIntFlags 0x0010 -#define GlintIntFlagsReg 0 -#define GlintIntFlagsOff 0x0010 -#define GlintIntFlagsSec 0x0010 -#define GlintIntFlagsSecReg 2 -#define GlintIntFlagsSecOff 0x0010 - -#define GlintInFIFOSpace 0x0018 -#define GlintInFIFOSpaceReg 0 -#define GlintInFIFOSpaceOff 0x0018 -#define GlintInFIFOSpaceSec 0x0018 -#define GlintInFIFOSpaceSecReg 2 -#define GlintInFIFOSpaceSecOff 0x0018 - -#define GlintOutFIFOWords 0x0020 -#define GlintOutFIFOWordsReg 0 -#define GlintOutFIFOWordsOff 0x0020 -#define GlintOutFIFOWordsSec 0x0020 -#define GlintOutFIFOWordsSecReg 2 -#define GlintOutFIFOWordsSecOff 0x0020 - -#define GlintDMAAddress 0x0028 -#define GlintDMAAddressReg 0 -#define GlintDMAAddressOff 0x0028 -#define GlintDMAAddressSec 0x0028 -#define GlintDMAAddressSecReg 2 -#define GlintDMAAddressSecOff 0x0028 - -#define GlintDMACount 0x0030 -#define GlintDMACountReg 0 -#define GlintDMACountOff 0x0030 -#define GlintDMACountSec 0x0030 -#define GlintDMACountSecReg 2 -#define GlintDMACountSecOff 0x0030 - -#define GlintErrorFlags 0x0038 -#define GlintErrorFlagsReg 0 -#define GlintErrorFlagsOff 0x0038 -#define GlintErrorFlagsSec 0x0038 -#define GlintErrorFlagsSecReg 2 -#define GlintErrorFlagsSecOff 0x0038 - -#define GlintVClkCtl 0x0040 -#define GlintVClkCtlReg 0 -#define GlintVClkCtlOff 0x0040 -#define GlintVClkCtlSec 0x0040 -#define GlintVClkCtlSecReg 2 -#define GlintVClkCtlSecOff 0x0040 - -#define GlintTestRegister 0x0048 -#define GlintTestRegisterReg 0 -#define GlintTestRegisterOff 0x0048 -#define GlintTestRegisterSec 0x0048 -#define GlintTestRegisterSecReg 2 -#define GlintTestRegisterSecOff 0x0048 - -#define GlintAperture0 0x0050 -#define GlintAperture0Reg 0 -#define GlintAperture0Off 0x0050 -#define GlintAperture0Sec 0x0050 -#define GlintAperture0SecReg 2 -#define GlintAperture0SecOff 0x0050 - -#define GlintAperture1 0x0058 -#define GlintAperture1Reg 0 -#define GlintAperture1Off 0x0058 -#define GlintAperture1Sec 0x0058 -#define GlintAperture1SecReg 2 -#define GlintAperture1SecOff 0x0058 - -#define GlintDMAControl 0x0060 -#define GlintDMAControlReg 0 -#define GlintDMAControlOff 0x0060 -#define GlintDMAControlSec 0x0060 -#define GlintDMAControlSecReg 2 -#define GlintDMAControlSecOff 0x0060 - -#define GlintFIFODis 0x0068 -#define GlintFIFODisReg 0 -#define GlintFIFODisOff 0x0068 -#define GlintFIFODisSec 0x0068 -#define GlintFIFODisSecReg 2 -#define GlintFIFODisSecOff 0x0068 - -#define GlintLBMemoryCtl 0x1000 -#define GlintLBMemoryCtlReg 1 -#define GlintLBMemoryCtlOff 0x0000 -#define GlintLBMemoryCtlSec 0x1000 -#define GlintLBMemoryCtlSecReg 3 -#define GlintLBMemoryCtlSecOff 0x0000 - -#define GlintLBMemoryEDO 0x1008 -#define GlintLBMemoryEDOReg 1 -#define GlintLBMemoryEDOOff 0x0008 -#define GlintLBMemoryEDOSec 0x1008 -#define GlintLBMemoryEDOSecReg 3 -#define GlintLBMemoryEDOSecOff 0x0008 - -#define GlintFBMemoryCtl 0x1800 -#define GlintFBMemoryCtlReg 1 -#define GlintFBMemoryCtlOff 0x0800 -#define GlintFBMemoryCtlSec 0x1800 -#define GlintFBMemoryCtlSecReg 3 -#define GlintFBMemoryCtlSecOff 0x0800 - -#define GlintFBModeSel 0x1808 -#define GlintFBModeSelReg 1 -#define GlintFBModeSelOff 0x0808 -#define GlintFBModeSelSec 0x1808 -#define GlintFBModeSelSecReg 3 -#define GlintFBModeSelSecOff 0x0808 - -#define GlintFBGCWrMask 0x1810 -#define GlintFBGCWrMaskReg 1 -#define GlintFBGCWrMaskOff 0x0810 -#define GlintFBGCWrMaskSec 0x1810 -#define GlintFBGCWrMaskSecReg 3 -#define GlintFBGCWrMaskSecOff 0x0810 - -#define GlintFBGCColorLower 0x1818 -#define GlintFBGCColorLowerReg 1 -#define GlintFBGCColorLowerOff 0x0818 -#define GlintFBGCColorLowerSec 0x1818 -#define GlintFBGCColorLowerSecReg 3 -#define GlintFBGCColorLowerSecOff 0x0818 - -#define GlintFBTXMemCtl 0x1820 -#define GlintFBTXMemCtlReg 1 -#define GlintFBTXMemCtlOff 0x0820 -#define GlintFBTXMemCtlSec 0x1820 -#define GlintFBTXMemCtlSecReg 3 -#define GlintFBTXMemCtlSecOff 0x0820 - -#define GlintFBWrMask 0x1830 -#define GlintFBWrMaskReg 1 -#define GlintFBWrMaskOff 0x0830 -#define GlintFBWrMaskSec 0x1830 -#define GlintFBWrMaskSecReg 3 -#define GlintFBWrMaskSecOff 0x0830 - -#define GlintFBGCColorUpper 0x1838 -#define GlintFBGCColorUpperReg 1 -#define GlintFBGCColorUpperOff 0x0838 -#define GlintFBGCColorUpperSec 0x1838 -#define GlintFBGCColorUpperSecReg 3 -#define GlintFBGCColorUpperSecOff 0x0838 - -#define GlintVTGHLimit 0x3000 -#define GlintVTGHLimitReg 1 -#define GlintVTGHLimitOff 0x2000 -#define GlintVTGHLimitSec 0x3000 -#define GlintVTGHLimitSecReg 3 -#define GlintVTGHLimitSecOff 0x2000 - -#define GlintVTGHSyncStart 0x3008 -#define GlintVTGHSyncStartReg 1 -#define GlintVTGHSyncStartOff 0x2008 -#define GlintVTGHSyncStartSec 0x3008 -#define GlintVTGHSyncStartSecReg 3 -#define GlintVTGHSyncStartSecOff 0x2008 - -#define GlintVTGHSyncEnd 0x3010 -#define GlintVTGHSyncEndReg 1 -#define GlintVTGHSyncEndOff 0x2010 -#define GlintVTGHSyncEndSec 0x3010 -#define GlintVTGHSyncEndSecReg 3 -#define GlintVTGHSyncEndSecOff 0x2010 - -#define GlintVTGHBlankEnd 0x3018 -#define GlintVTGHBlankEndReg 1 -#define GlintVTGHBlankEndOff 0x2018 -#define GlintVTGHBlankEndSec 0x3018 -#define GlintVTGHBlankEndSecReg 3 -#define GlintVTGHBlankEndSecOff 0x2018 - -#define GlintVTGVLimit 0x3020 -#define GlintVTGVLimitReg 1 -#define GlintVTGVLimitOff 0x2020 -#define GlintVTGVLimitSec 0x3020 -#define GlintVTGVLimitSecReg 3 -#define GlintVTGVLimitSecOff 0x2020 - -#define GlintVTGVSyncStart 0x3028 -#define GlintVTGVSyncStartReg 1 -#define GlintVTGVSyncStartOff 0x2028 -#define GlintVTGVSyncStartSec 0x3028 -#define GlintVTGVSyncStartSecReg 3 -#define GlintVTGVSyncStartSecOff 0x2028 - -#define GlintVTGVSyncEnd 0x3030 -#define GlintVTGVSyncEndReg 1 -#define GlintVTGVSyncEndOff 0x2030 -#define GlintVTGVSyncEndSec 0x3030 -#define GlintVTGVSyncEndSecReg 3 -#define GlintVTGVSyncEndSecOff 0x2030 - -#define GlintVTGVBlankEnd 0x3038 -#define GlintVTGVBlankEndReg 1 -#define GlintVTGVBlankEndOff 0x2038 -#define GlintVTGVBlankEndSec 0x3038 -#define GlintVTGVBlankEndSecReg 3 -#define GlintVTGVBlankEndSecOff 0x2038 - -#define GlintVTGHGateStart 0x3040 -#define GlintVTGHGateStartReg 1 -#define GlintVTGHGateStartOff 0x2040 -#define GlintVTGHGateStartSec 0x3040 -#define GlintVTGHGateStartSecReg 3 -#define GlintVTGHGateStartSecOff 0x2040 - -#define GlintVTGHGateEnd 0x3048 -#define GlintVTGHGateEndReg 1 -#define GlintVTGHGateEndOff 0x2048 -#define GlintVTGHGateEndSec 0x3048 -#define GlintVTGHGateEndSecReg 3 -#define GlintVTGHGateEndSecOff 0x2048 - -#define GlintVTGVGateStart 0x3050 -#define GlintVTGVGateStartReg 1 -#define GlintVTGVGateStartOff 0x2050 -#define GlintVTGVGateStartSec 0x3050 -#define GlintVTGVGateStartSecReg 3 -#define GlintVTGVGateStartSecOff 0x2050 - -#define GlintVTGVGateEnd 0x3058 -#define GlintVTGVGateEndReg 1 -#define GlintVTGVGateEndOff 0x2058 -#define GlintVTGVGateEndSec 0x3058 -#define GlintVTGVGateEndSecReg 3 -#define GlintVTGVGateEndSecOff 0x2058 - -#define GlintVTGPolarity 0x3060 -#define GlintVTGPolarityReg 1 -#define GlintVTGPolarityOff 0x2060 -#define GlintVTGPolaritySec 0x3060 -#define GlintVTGPolaritySecReg 3 -#define GlintVTGPolaritySecOff 0x2060 - -#define GlintVTGFrameRowAddr 0x3068 -#define GlintVTGFrameRowAddrReg 1 -#define GlintVTGFrameRowAddrOff 0x2068 -#define GlintVTGFrameRowAddrSec 0x3068 -#define GlintVTGFrameRowAddrSecReg 3 -#define GlintVTGFrameRowAddrSecOff 0x2068 - -#define GlintVTGVLineNumber 0x3070 -#define GlintVTGVLineNumberReg 1 -#define GlintVTGVLineNumberOff 0x2070 -#define GlintVTGVLineNumberSec 0x3070 -#define GlintVTGVLineNumberSecReg 3 -#define GlintVTGVLineNumberSecOff 0x2070 - -#define GlintVTGSerialClk 0x3078 -#define GlintVTGSerialClkReg 1 -#define GlintVTGSerialClkOff 0x2078 -#define GlintVTGSerialClkSec 0x3078 -#define GlintVTGSerialClkSecReg 3 -#define GlintVTGSerialClkSecOff 0x2078 - -#define GlintVTGModeCtl 0x3080 -#define GlintVTGModeCtlReg 1 -#define GlintVTGModeCtlOff 0x2080 -#define GlintVTGModeCtlSec 0x3080 -#define GlintVTGModeCtlSecReg 3 -#define GlintVTGModeCtlSecOff 0x2080 - -#define GlintOutputFIFO 0x2000 -#define GlintOutputFIFOReg 1 -#define GlintOutputFIFOOff 0x1000 -#define GlintOutputFIFOSec 0x2000 -#define GlintOutputFIFOSecReg 3 -#define GlintOutputFIFOSecOff 0x1000 - -#define GlintGInFIFOSpace 0x0018 -#define GlintGInFIFOSpaceReg 0 -#define GlintGInFIFOSpaceOff 0x0018 - -#define GlintGDMAAddress 0x0028 -#define GlintGDMAAddressReg 0 -#define GlintGDMAAddressOff 0x0028 - -#define GlintGDMACount 0x0030 -#define GlintGDMACountReg 0 -#define GlintGDMACountOff 0x0030 - -#define GlintGDMAControl 0x0060 -#define GlintGDMAControlReg 0 -#define GlintGDMAControlOff 0x0060 - -#define GlintGOutDMA 0x0080 -#define GlintGOutDMAReg 0 -#define GlintGOutDMAOff 0x0080 - -#define GlintGOutDMACount 0x0088 -#define GlintGOutDMACountReg 0 -#define GlintGOutDMACountOff 0x0088 - -#define GlintGResetStatus 0x0800 -#define GlintGResetStatusReg 0 -#define GlintGResetStatusOff 0x0800 - -#define GlintGIntEnable 0x0808 -#define GlintGIntEnableReg 0 -#define GlintGIntEnableOff 0x0808 - -#define GlintGIntFlags 0x0810 -#define GlintGIntFlagsReg 0 -#define GlintGIntFlagsOff 0x0810 - -#define GlintGErrorFlags 0x0838 -#define GlintGErrorFlagsReg 0 -#define GlintGErrorFlagsOff 0x0838 - -#define GlintGTestRegister 0x0848 -#define GlintGTestRegisterReg 0 -#define GlintGTestRegisterOff 0x0848 - -#define GlintGFIFODis 0x0868 -#define GlintGFIFODisReg 0 -#define GlintGFIFODisOff 0x0868 - -#define GlintGChipConfig 0x0870 -#define GlintGChipConfigReg 0 -#define GlintGChipConfigOff 0x0870 - -#define GlintGCSRAperture 0x0878 -#define GlintGCSRApertureReg 0 -#define GlintGCSRApertureOff 0x0878 - -#define GlintGPageTableAddr 0x0c00 -#define GlintGPageTableAddrReg 0 -#define GlintGPageTableAddrOff 0x0c00 - -#define GlintGPageTableLength 0x0c08 -#define GlintGPageTableLengthReg 0 -#define GlintGPageTableLengthOff 0x0c08 - -#define GlintGDelayTimer 0x0c38 -#define GlintGDelayTimerReg 0 -#define GlintGDelayTimerOff 0x0c38 - -#define GlintGCommandMode 0x0c40 -#define GlintGCommandModeReg 0 -#define GlintGCommandModeOff 0x0c40 - -#define GlintGCommandIntEnable 0x0c48 -#define GlintGCommandIntEnableReg 0 -#define GlintGCommandIntEnableOff 0x0c48 - -#define GlintGCommandIntFlags 0x0c50 -#define GlintGCommandIntFlagsReg 0 -#define GlintGCommandIntFlagsOff 0x0c50 - -#define GlintGCommandErrorFlags 0x0c58 -#define GlintGCommandErrorFlagsReg 0 -#define GlintGCommandErrorFlagsOff 0x0c58 - -#define GlintGCommandStatus 0x0c60 -#define GlintGCommandStatusReg 0 -#define GlintGCommandStatusOff 0x0c60 - -#define GlintGCommandFaultingAddr 0x0c68 -#define GlintGCommandFaultingAddrReg 0 -#define GlintGCommandFaultingAddrOff 0x0c68 - -#define GlintGVertexFaultingAddr 0x0c70 -#define GlintGVertexFaultingAddrReg 0 -#define GlintGVertexFaultingAddrOff 0x0c70 - -#define GlintGWriteFaultingAddr 0x0c88 -#define GlintGWriteFaultingAddrReg 0 -#define GlintGWriteFaultingAddrOff 0x0c88 - -#define GlintGFeedbackSelectCount 0x0c98 -#define GlintGFeedbackSelectCountReg 0 -#define GlintGFeedbackSelectCountOff 0x0c98 - -#define GlintGGammaProcessorMode 0x0cb8 -#define GlintGGammaProcessorModeReg 0 -#define GlintGGammaProcessorModeOff 0x0cb8 - -#define GlintGVGAShadow 0x0d00 -#define GlintGVGAShadowReg 0 -#define GlintGVGAShadowOff 0x0d00 - -#define GlintGMultGLINTAperture 0x0d08 -#define GlintGMultGLINTApertureReg 0 -#define GlintGMultGLINTApertureOff 0x0d08 - -#define GlintGMultGLINT1 0x0d10 -#define GlintGMultGLINT1Reg 0 -#define GlintGMultGLINT1Off 0x0d10 - -#define GlintGMultGLINT2 0x0d18 -#define GlintGMultGLINT2Reg 0 -#define GlintGMultGLINT2Off 0x0d18 - -#define GlintStartXDom 0x8000 -#define GlintStartXDomTag 0x0000 -#define GlintStartXDomReg 1 -#define GlintStartXDomOff 0x7000 -#define GlintStartXDomSec 0x8000 -#define GlintStartXDomSecReg 3 -#define GlintStartXDomSecOff 0x7000 - -#define GlintdXDom 0x8008 -#define GlintdXDomTag 0x0001 -#define GlintdXDomReg 1 -#define GlintdXDomOff 0x7008 -#define GlintdXDomSec 0x8008 -#define GlintdXDomSecReg 3 -#define GlintdXDomSecOff 0x7008 - -#define GlintStartXSub 0x8010 -#define GlintStartXSubTag 0x0002 -#define GlintStartXSubReg 1 -#define GlintStartXSubOff 0x7010 -#define GlintStartXSubSec 0x8010 -#define GlintStartXSubSecReg 3 -#define GlintStartXSubSecOff 0x7010 - -#define GlintdXSub 0x8018 -#define GlintdXSubTag 0x0003 -#define GlintdXSubReg 1 -#define GlintdXSubOff 0x7018 -#define GlintdXSubSec 0x8018 -#define GlintdXSubSecReg 3 -#define GlintdXSubSecOff 0x7018 - -#define GlintStartY 0x8020 -#define GlintStartYTag 0x0004 -#define GlintStartYReg 1 -#define GlintStartYOff 0x7020 -#define GlintStartYSec 0x8020 -#define GlintStartYSecReg 3 -#define GlintStartYSecOff 0x7020 - -#define GlintdY 0x8028 -#define GlintdYTag 0x0005 -#define GlintdYReg 1 -#define GlintdYOff 0x7028 -#define GlintdYSec 0x8028 -#define GlintdYSecReg 3 -#define GlintdYSecOff 0x7028 - -#define GlintGLINTCount 0x8030 -#define GlintGLINTCountTag 0x0006 -#define GlintGLINTCountReg 1 -#define GlintGLINTCountOff 0x7030 -#define GlintGLINTCountSec 0x8030 -#define GlintGLINTCountSecReg 3 -#define GlintGLINTCountSecOff 0x7030 - -#define GlintRender 0x8038 -#define GlintRenderTag 0x0007 -#define GlintRenderReg 1 -#define GlintRenderOff 0x7038 -#define GlintRenderSec 0x8038 -#define GlintRenderSecReg 3 -#define GlintRenderSecOff 0x7038 - -#define GlintContinueNewLine 0x8040 -#define GlintContinueNewLineTag 0x0008 -#define GlintContinueNewLineReg 1 -#define GlintContinueNewLineOff 0x7040 -#define GlintContinueNewLineSec 0x8040 -#define GlintContinueNewLineSecReg 3 -#define GlintContinueNewLineSecOff 0x7040 - -#define GlintContinueNewDom 0x8048 -#define GlintContinueNewDomTag 0x0009 -#define GlintContinueNewDomReg 1 -#define GlintContinueNewDomOff 0x7048 -#define GlintContinueNewDomSec 0x8048 -#define GlintContinueNewDomSecReg 3 -#define GlintContinueNewDomSecOff 0x7048 - -#define GlintContinueNewSub 0x8050 -#define GlintContinueNewSubTag 0x000a -#define GlintContinueNewSubReg 1 -#define GlintContinueNewSubOff 0x7050 -#define GlintContinueNewSubSec 0x8050 -#define GlintContinueNewSubSecReg 3 -#define GlintContinueNewSubSecOff 0x7050 - -#define GlintContinue 0x8058 -#define GlintContinueTag 0x000b -#define GlintContinueReg 1 -#define GlintContinueOff 0x7058 -#define GlintContinueSec 0x8058 -#define GlintContinueSecReg 3 -#define GlintContinueSecOff 0x7058 - -#define GlintFlushSpan 0x8060 -#define GlintFlushSpanTag 0x000c -#define GlintFlushSpanReg 1 -#define GlintFlushSpanOff 0x7060 -#define GlintFlushSpanSec 0x8060 -#define GlintFlushSpanSecReg 3 -#define GlintFlushSpanSecOff 0x7060 - -#define GlintBitMaskPattern 0x8068 -#define GlintBitMaskPatternTag 0x000d -#define GlintBitMaskPatternReg 1 -#define GlintBitMaskPatternOff 0x7068 -#define GlintBitMaskPatternSec 0x8068 -#define GlintBitMaskPatternSecReg 3 -#define GlintBitMaskPatternSecOff 0x7068 - -#define GlintPointTable0 0x8080 -#define GlintPointTable0Tag 0x0010 -#define GlintPointTable0Reg 1 -#define GlintPointTable0Off 0x7080 -#define GlintPointTable0Sec 0x8080 -#define GlintPointTable0SecReg 3 -#define GlintPointTable0SecOff 0x7080 - -#define GlintPointTable1 0x8088 -#define GlintPointTable1Tag 0x0011 -#define GlintPointTable1Reg 1 -#define GlintPointTable1Off 0x7088 -#define GlintPointTable1Sec 0x8088 -#define GlintPointTable1SecReg 3 -#define GlintPointTable1SecOff 0x7088 - -#define GlintPointTable2 0x8090 -#define GlintPointTable2Tag 0x0012 -#define GlintPointTable2Reg 1 -#define GlintPointTable2Off 0x7090 -#define GlintPointTable2Sec 0x8090 -#define GlintPointTable2SecReg 3 -#define GlintPointTable2SecOff 0x7090 - -#define GlintPointTable3 0x8098 -#define GlintPointTable3Tag 0x0013 -#define GlintPointTable3Reg 1 -#define GlintPointTable3Off 0x7098 -#define GlintPointTable3Sec 0x8098 -#define GlintPointTable3SecReg 3 -#define GlintPointTable3SecOff 0x7098 - -#define GlintRasterizerMode 0x80a0 -#define GlintRasterizerModeTag 0x0014 -#define GlintRasterizerModeReg 1 -#define GlintRasterizerModeOff 0x70a0 -#define GlintRasterizerModeSec 0x80a0 -#define GlintRasterizerModeSecReg 3 -#define GlintRasterizerModeSecOff 0x70a0 - -#define GlintYLimits 0x80a8 -#define GlintYLimitsTag 0x0015 -#define GlintYLimitsReg 1 -#define GlintYLimitsOff 0x70a8 -#define GlintYLimitsSec 0x80a8 -#define GlintYLimitsSecReg 3 -#define GlintYLimitsSecOff 0x70a8 - -#define GlintScanLineOwnership 0x80b0 -#define GlintScanLineOwnershipTag 0x0016 -#define GlintScanLineOwnershipReg 1 -#define GlintScanLineOwnershipOff 0x70b0 -#define GlintScanLineOwnershipSec 0x80b0 -#define GlintScanLineOwnershipSecReg 3 -#define GlintScanLineOwnershipSecOff 0x70b0 - -#define GlintWaitForCompletion 0x80b8 -#define GlintWaitForCompletionTag 0x0017 -#define GlintWaitForCompletionReg 1 -#define GlintWaitForCompletionOff 0x70b8 -#define GlintWaitForCompletionSec 0x80b8 -#define GlintWaitForCompletionSecReg 3 -#define GlintWaitForCompletionSecOff 0x70b8 - -#define GlintPixelSize 0x80c0 -#define GlintPixelSizeTag 0x0018 -#define GlintPixelSizeReg 1 -#define GlintPixelSizeOff 0x70c0 -#define GlintPixelSizeSec 0x80c0 -#define GlintPixelSizeSecReg 3 -#define GlintPixelSizeSecOff 0x70c0 - -#define GlintScissorMode 0x8180 -#define GlintScissorModeTag 0x0030 -#define GlintScissorModeReg 1 -#define GlintScissorModeOff 0x7180 -#define GlintScissorModeSec 0x8180 -#define GlintScissorModeSecReg 3 -#define GlintScissorModeSecOff 0x7180 - -#define GlintScissorMinXY 0x8188 -#define GlintScissorMinXYTag 0x0031 -#define GlintScissorMinXYReg 1 -#define GlintScissorMinXYOff 0x7188 -#define GlintScissorMinXYSec 0x8188 -#define GlintScissorMinXYSecReg 3 -#define GlintScissorMinXYSecOff 0x7188 - -#define GlintScissorMaxXY 0x8190 -#define GlintScissorMaxXYTag 0x0032 -#define GlintScissorMaxXYReg 1 -#define GlintScissorMaxXYOff 0x7190 -#define GlintScissorMaxXYSec 0x8190 -#define GlintScissorMaxXYSecReg 3 -#define GlintScissorMaxXYSecOff 0x7190 - -#define GlintScreenSize 0x8198 -#define GlintScreenSizeTag 0x0033 -#define GlintScreenSizeReg 1 -#define GlintScreenSizeOff 0x7198 -#define GlintScreenSizeSec 0x8198 -#define GlintScreenSizeSecReg 3 -#define GlintScreenSizeSecOff 0x7198 - -#define GlintAreaStippleMode 0x81a0 -#define GlintAreaStippleModeTag 0x0034 -#define GlintAreaStippleModeReg 1 -#define GlintAreaStippleModeOff 0x71a0 -#define GlintAreaStippleModeSec 0x81a0 -#define GlintAreaStippleModeSecReg 3 -#define GlintAreaStippleModeSecOff 0x71a0 - -#define GlintLineStippleMode 0x81a8 -#define GlintLineStippleModeTag 0x0035 -#define GlintLineStippleModeReg 1 -#define GlintLineStippleModeOff 0x71a8 -#define GlintLineStippleModeSec 0x81a8 -#define GlintLineStippleModeSecReg 3 -#define GlintLineStippleModeSecOff 0x71a8 - -#define GlintLoadLineStippleCounters 0x81b0 -#define GlintLoadLineStippleCountersTag 0x0036 -#define GlintLoadLineStippleCountersReg 1 -#define GlintLoadLineStippleCountersOff 0x71b0 -#define GlintLoadLineStippleCountersSec 0x81b0 -#define GlintLoadLineStippleCountersSecReg 3 -#define GlintLoadLineStippleCountersSecOff 0x71b0 - -#define GlintUpdateLineStippleCounters 0x81b8 -#define GlintUpdateLineStippleCountersTag 0x0037 -#define GlintUpdateLineStippleCountersReg 1 -#define GlintUpdateLineStippleCountersOff 0x71b8 -#define GlintUpdateLineStippleCountersSec 0x81b8 -#define GlintUpdateLineStippleCountersSecReg 3 -#define GlintUpdateLineStippleCountersSecOff 0x71b8 - -#define GlintSaveLineStippleState 0x81c0 -#define GlintSaveLineStippleStateTag 0x0038 -#define GlintSaveLineStippleStateReg 1 -#define GlintSaveLineStippleStateOff 0x71c0 -#define GlintSaveLineStippleStateSec 0x81c0 -#define GlintSaveLineStippleStateSecReg 3 -#define GlintSaveLineStippleStateSecOff 0x71c0 - -#define GlintWindowOrigin 0x81c8 -#define GlintWindowOriginTag 0x0039 -#define GlintWindowOriginReg 1 -#define GlintWindowOriginOff 0x71c8 -#define GlintWindowOriginSec 0x81c8 -#define GlintWindowOriginSecReg 3 -#define GlintWindowOriginSecOff 0x71c8 - -#define GlintAreaStipplePattern0 0x8200 -#define GlintAreaStipplePattern0Tag 0x0040 -#define GlintAreaStipplePattern0Reg 1 -#define GlintAreaStipplePattern0Off 0x7200 -#define GlintAreaStipplePattern0Sec 0x8200 -#define GlintAreaStipplePattern0SecReg 3 -#define GlintAreaStipplePattern0SecOff 0x7200 - -#define GlintAreaStipplePattern1 0x8208 -#define GlintAreaStipplePattern1Tag 0x0041 -#define GlintAreaStipplePattern1Reg 1 -#define GlintAreaStipplePattern1Off 0x7208 -#define GlintAreaStipplePattern1Sec 0x8208 -#define GlintAreaStipplePattern1SecReg 3 -#define GlintAreaStipplePattern1SecOff 0x7208 - -#define GlintAreaStipplePattern2 0x8210 -#define GlintAreaStipplePattern2Tag 0x0042 -#define GlintAreaStipplePattern2Reg 1 -#define GlintAreaStipplePattern2Off 0x7210 -#define GlintAreaStipplePattern2Sec 0x8210 -#define GlintAreaStipplePattern2SecReg 3 -#define GlintAreaStipplePattern2SecOff 0x7210 - -#define GlintAreaStipplePattern3 0x8218 -#define GlintAreaStipplePattern3Tag 0x0043 -#define GlintAreaStipplePattern3Reg 1 -#define GlintAreaStipplePattern3Off 0x7218 -#define GlintAreaStipplePattern3Sec 0x8218 -#define GlintAreaStipplePattern3SecReg 3 -#define GlintAreaStipplePattern3SecOff 0x7218 - -#define GlintAreaStipplePattern4 0x8220 -#define GlintAreaStipplePattern4Tag 0x0044 -#define GlintAreaStipplePattern4Reg 1 -#define GlintAreaStipplePattern4Off 0x7220 -#define GlintAreaStipplePattern4Sec 0x8220 -#define GlintAreaStipplePattern4SecReg 3 -#define GlintAreaStipplePattern4SecOff 0x7220 - -#define GlintAreaStipplePattern5 0x8228 -#define GlintAreaStipplePattern5Tag 0x0045 -#define GlintAreaStipplePattern5Reg 1 -#define GlintAreaStipplePattern5Off 0x7228 -#define GlintAreaStipplePattern5Sec 0x8228 -#define GlintAreaStipplePattern5SecReg 3 -#define GlintAreaStipplePattern5SecOff 0x7228 - -#define GlintAreaStipplePattern6 0x8230 -#define GlintAreaStipplePattern6Tag 0x0046 -#define GlintAreaStipplePattern6Reg 1 -#define GlintAreaStipplePattern6Off 0x7230 -#define GlintAreaStipplePattern6Sec 0x8230 -#define GlintAreaStipplePattern6SecReg 3 -#define GlintAreaStipplePattern6SecOff 0x7230 - -#define GlintAreaStipplePattern7 0x8238 -#define GlintAreaStipplePattern7Tag 0x0047 -#define GlintAreaStipplePattern7Reg 1 -#define GlintAreaStipplePattern7Off 0x7238 -#define GlintAreaStipplePattern7Sec 0x8238 -#define GlintAreaStipplePattern7SecReg 3 -#define GlintAreaStipplePattern7SecOff 0x7238 - -#define GlintAreaStipplePattern8 0x8240 -#define GlintAreaStipplePattern8Tag 0x0048 -#define GlintAreaStipplePattern8Reg 1 -#define GlintAreaStipplePattern8Off 0x7240 -#define GlintAreaStipplePattern8Sec 0x8240 -#define GlintAreaStipplePattern8SecReg 3 -#define GlintAreaStipplePattern8SecOff 0x7240 - -#define GlintAreaStipplePattern9 0x8248 -#define GlintAreaStipplePattern9Tag 0x0049 -#define GlintAreaStipplePattern9Reg 1 -#define GlintAreaStipplePattern9Off 0x7248 -#define GlintAreaStipplePattern9Sec 0x8248 -#define GlintAreaStipplePattern9SecReg 3 -#define GlintAreaStipplePattern9SecOff 0x7248 - -#define GlintAreaStipplePattern10 0x8250 -#define GlintAreaStipplePattern10Tag 0x004a -#define GlintAreaStipplePattern10Reg 1 -#define GlintAreaStipplePattern10Off 0x7250 -#define GlintAreaStipplePattern10Sec 0x8250 -#define GlintAreaStipplePattern10SecReg 3 -#define GlintAreaStipplePattern10SecOff 0x7250 - -#define GlintAreaStipplePattern11 0x8258 -#define GlintAreaStipplePattern11Tag 0x004b -#define GlintAreaStipplePattern11Reg 1 -#define GlintAreaStipplePattern11Off 0x7258 -#define GlintAreaStipplePattern11Sec 0x8258 -#define GlintAreaStipplePattern11SecReg 3 -#define GlintAreaStipplePattern11SecOff 0x7258 - -#define GlintAreaStipplePattern12 0x8260 -#define GlintAreaStipplePattern12Tag 0x004c -#define GlintAreaStipplePattern12Reg 1 -#define GlintAreaStipplePattern12Off 0x7260 -#define GlintAreaStipplePattern12Sec 0x8260 -#define GlintAreaStipplePattern12SecReg 3 -#define GlintAreaStipplePattern12SecOff 0x7260 - -#define GlintAreaStipplePattern13 0x8268 -#define GlintAreaStipplePattern13Tag 0x004d -#define GlintAreaStipplePattern13Reg 1 -#define GlintAreaStipplePattern13Off 0x7268 -#define GlintAreaStipplePattern13Sec 0x8268 -#define GlintAreaStipplePattern13SecReg 3 -#define GlintAreaStipplePattern13SecOff 0x7268 - -#define GlintAreaStipplePattern14 0x8270 -#define GlintAreaStipplePattern14Tag 0x004e -#define GlintAreaStipplePattern14Reg 1 -#define GlintAreaStipplePattern14Off 0x7270 -#define GlintAreaStipplePattern14Sec 0x8270 -#define GlintAreaStipplePattern14SecReg 3 -#define GlintAreaStipplePattern14SecOff 0x7270 - -#define GlintAreaStipplePattern15 0x8278 -#define GlintAreaStipplePattern15Tag 0x004f -#define GlintAreaStipplePattern15Reg 1 -#define GlintAreaStipplePattern15Off 0x7278 -#define GlintAreaStipplePattern15Sec 0x8278 -#define GlintAreaStipplePattern15SecReg 3 -#define GlintAreaStipplePattern15SecOff 0x7278 - -#define GlintAreaStipplePattern16 0x8280 -#define GlintAreaStipplePattern16Tag 0x0050 -#define GlintAreaStipplePattern16Reg 1 -#define GlintAreaStipplePattern16Off 0x7280 -#define GlintAreaStipplePattern16Sec 0x8280 -#define GlintAreaStipplePattern16SecReg 3 -#define GlintAreaStipplePattern16SecOff 0x7280 - -#define GlintAreaStipplePattern17 0x8288 -#define GlintAreaStipplePattern17Tag 0x0051 -#define GlintAreaStipplePattern17Reg 1 -#define GlintAreaStipplePattern17Off 0x7288 -#define GlintAreaStipplePattern17Sec 0x8288 -#define GlintAreaStipplePattern17SecReg 3 -#define GlintAreaStipplePattern17SecOff 0x7288 - -#define GlintAreaStipplePattern18 0x8290 -#define GlintAreaStipplePattern18Tag 0x0052 -#define GlintAreaStipplePattern18Reg 1 -#define GlintAreaStipplePattern18Off 0x7290 -#define GlintAreaStipplePattern18Sec 0x8290 -#define GlintAreaStipplePattern18SecReg 3 -#define GlintAreaStipplePattern18SecOff 0x7290 - -#define GlintAreaStipplePattern19 0x8298 -#define GlintAreaStipplePattern19Tag 0x0053 -#define GlintAreaStipplePattern19Reg 1 -#define GlintAreaStipplePattern19Off 0x7298 -#define GlintAreaStipplePattern19Sec 0x8298 -#define GlintAreaStipplePattern19SecReg 3 -#define GlintAreaStipplePattern19SecOff 0x7298 - -#define GlintAreaStipplePattern20 0x82a0 -#define GlintAreaStipplePattern20Tag 0x0054 -#define GlintAreaStipplePattern20Reg 1 -#define GlintAreaStipplePattern20Off 0x72a0 -#define GlintAreaStipplePattern20Sec 0x82a0 -#define GlintAreaStipplePattern20SecReg 3 -#define GlintAreaStipplePattern20SecOff 0x72a0 - -#define GlintAreaStipplePattern21 0x82a8 -#define GlintAreaStipplePattern21Tag 0x0055 -#define GlintAreaStipplePattern21Reg 1 -#define GlintAreaStipplePattern21Off 0x72a8 -#define GlintAreaStipplePattern21Sec 0x82a8 -#define GlintAreaStipplePattern21SecReg 3 -#define GlintAreaStipplePattern21SecOff 0x72a8 - -#define GlintAreaStipplePattern22 0x82b0 -#define GlintAreaStipplePattern22Tag 0x0056 -#define GlintAreaStipplePattern22Reg 1 -#define GlintAreaStipplePattern22Off 0x72b0 -#define GlintAreaStipplePattern22Sec 0x82b0 -#define GlintAreaStipplePattern22SecReg 3 -#define GlintAreaStipplePattern22SecOff 0x72b0 - -#define GlintAreaStipplePattern23 0x82b8 -#define GlintAreaStipplePattern23Tag 0x0057 -#define GlintAreaStipplePattern23Reg 1 -#define GlintAreaStipplePattern23Off 0x72b8 -#define GlintAreaStipplePattern23Sec 0x82b8 -#define GlintAreaStipplePattern23SecReg 3 -#define GlintAreaStipplePattern23SecOff 0x72b8 - -#define GlintAreaStipplePattern24 0x82c0 -#define GlintAreaStipplePattern24Tag 0x0058 -#define GlintAreaStipplePattern24Reg 1 -#define GlintAreaStipplePattern24Off 0x72c0 -#define GlintAreaStipplePattern24Sec 0x82c0 -#define GlintAreaStipplePattern24SecReg 3 -#define GlintAreaStipplePattern24SecOff 0x72c0 - -#define GlintAreaStipplePattern25 0x82c8 -#define GlintAreaStipplePattern25Tag 0x0059 -#define GlintAreaStipplePattern25Reg 1 -#define GlintAreaStipplePattern25Off 0x72c8 -#define GlintAreaStipplePattern25Sec 0x82c8 -#define GlintAreaStipplePattern25SecReg 3 -#define GlintAreaStipplePattern25SecOff 0x72c8 - -#define GlintAreaStipplePattern26 0x82d0 -#define GlintAreaStipplePattern26Tag 0x005a -#define GlintAreaStipplePattern26Reg 1 -#define GlintAreaStipplePattern26Off 0x72d0 -#define GlintAreaStipplePattern26Sec 0x82d0 -#define GlintAreaStipplePattern26SecReg 3 -#define GlintAreaStipplePattern26SecOff 0x72d0 - -#define GlintAreaStipplePattern27 0x82d8 -#define GlintAreaStipplePattern27Tag 0x005b -#define GlintAreaStipplePattern27Reg 1 -#define GlintAreaStipplePattern27Off 0x72d8 -#define GlintAreaStipplePattern27Sec 0x82d8 -#define GlintAreaStipplePattern27SecReg 3 -#define GlintAreaStipplePattern27SecOff 0x72d8 - -#define GlintAreaStipplePattern28 0x82e0 -#define GlintAreaStipplePattern28Tag 0x005c -#define GlintAreaStipplePattern28Reg 1 -#define GlintAreaStipplePattern28Off 0x72e0 -#define GlintAreaStipplePattern28Sec 0x82e0 -#define GlintAreaStipplePattern28SecReg 3 -#define GlintAreaStipplePattern28SecOff 0x72e0 - -#define GlintAreaStipplePattern29 0x82e8 -#define GlintAreaStipplePattern29Tag 0x005d -#define GlintAreaStipplePattern29Reg 1 -#define GlintAreaStipplePattern29Off 0x72e8 -#define GlintAreaStipplePattern29Sec 0x82e8 -#define GlintAreaStipplePattern29SecReg 3 -#define GlintAreaStipplePattern29SecOff 0x72e8 - -#define GlintAreaStipplePattern30 0x82f0 -#define GlintAreaStipplePattern30Tag 0x005e -#define GlintAreaStipplePattern30Reg 1 -#define GlintAreaStipplePattern30Off 0x72f0 -#define GlintAreaStipplePattern30Sec 0x82f0 -#define GlintAreaStipplePattern30SecReg 3 -#define GlintAreaStipplePattern30SecOff 0x72f0 - -#define GlintAreaStipplePattern31 0x82f8 -#define GlintAreaStipplePattern31Tag 0x005f -#define GlintAreaStipplePattern31Reg 1 -#define GlintAreaStipplePattern31Off 0x72f8 -#define GlintAreaStipplePattern31Sec 0x82f8 -#define GlintAreaStipplePattern31SecReg 3 -#define GlintAreaStipplePattern31SecOff 0x72f8 - -#define GlintRouterMode 0x8840 -#define GlintRouterModeTag 0x0108 -#define GlintRouterModeReg 1 -#define GlintRouterModeOff 0x7840 -#define GlintRouterModeSec 0x8840 -#define GlintRouterModeSecReg 3 -#define GlintRouterModeSecOff 0x7840 - -#define GlintTextureAddressMode 0x8380 -#define GlintTextureAddressModeTag 0x0070 -#define GlintTextureAddressModeReg 1 -#define GlintTextureAddressModeOff 0x7380 -#define GlintTextureAddressModeSec 0x8380 -#define GlintTextureAddressModeSecReg 3 -#define GlintTextureAddressModeSecOff 0x7380 - -#define GlintSStart 0x8388 -#define GlintSStartTag 0x0071 -#define GlintSStartReg 1 -#define GlintSStartOff 0x7388 -#define GlintSStartSec 0x8388 -#define GlintSStartSecReg 3 -#define GlintSStartSecOff 0x7388 - -#define GlintdSdx 0x8390 -#define GlintdSdxTag 0x0072 -#define GlintdSdxReg 1 -#define GlintdSdxOff 0x7390 -#define GlintdSdxSec 0x8390 -#define GlintdSdxSecReg 3 -#define GlintdSdxSecOff 0x7390 - -#define GlintdSdyDom 0x8398 -#define GlintdSdyDomTag 0x0073 -#define GlintdSdyDomReg 1 -#define GlintdSdyDomOff 0x7398 -#define GlintdSdyDomSec 0x8398 -#define GlintdSdyDomSecReg 3 -#define GlintdSdyDomSecOff 0x7398 - -#define GlintTStart 0x83a0 -#define GlintTStartTag 0x0074 -#define GlintTStartReg 1 -#define GlintTStartOff 0x73a0 -#define GlintTStartSec 0x83a0 -#define GlintTStartSecReg 3 -#define GlintTStartSecOff 0x73a0 - -#define GlintdTdx 0x83a8 -#define GlintdTdxTag 0x0075 -#define GlintdTdxReg 1 -#define GlintdTdxOff 0x73a8 -#define GlintdTdxSec 0x83a8 -#define GlintdTdxSecReg 3 -#define GlintdTdxSecOff 0x73a8 - -#define GlintdTdyDom 0x83b0 -#define GlintdTdyDomTag 0x0076 -#define GlintdTdyDomReg 1 -#define GlintdTdyDomOff 0x73b0 -#define GlintdTdyDomSec 0x83b0 -#define GlintdTdyDomSecReg 3 -#define GlintdTdyDomSecOff 0x73b0 - -#define GlintQStart 0x83b8 -#define GlintQStartTag 0x0077 -#define GlintQStartReg 1 -#define GlintQStartOff 0x73b8 -#define GlintQStartSec 0x83b8 -#define GlintQStartSecReg 3 -#define GlintQStartSecOff 0x73b8 - -#define GlintdQdx 0x83c0 -#define GlintdQdxTag 0x0078 -#define GlintdQdxReg 1 -#define GlintdQdxOff 0x73c0 -#define GlintdQdxSec 0x83c0 -#define GlintdQdxSecReg 3 -#define GlintdQdxSecOff 0x73c0 - -#define GlintdQdyDom 0x83c8 -#define GlintdQdyDomTag 0x0079 -#define GlintdQdyDomReg 1 -#define GlintdQdyDomOff 0x73c8 -#define GlintdQdyDomSec 0x83c8 -#define GlintdQdyDomSecReg 3 -#define GlintdQdyDomSecOff 0x73c8 - -#define GlintLOD 0x83d0 -#define GlintLODTag 0x007a -#define GlintLODReg 1 -#define GlintLODOff 0x73d0 -#define GlintLODSec 0x83d0 -#define GlintLODSecReg 3 -#define GlintLODSecOff 0x73d0 - -#define GlintdSdy 0x83d8 -#define GlintdSdyTag 0x007b -#define GlintdSdyReg 1 -#define GlintdSdyOff 0x73d8 -#define GlintdSdySec 0x83d8 -#define GlintdSdySecReg 3 -#define GlintdSdySecOff 0x73d8 - -#define GlintdTdy 0x83e0 -#define GlintdTdyTag 0x007c -#define GlintdTdyReg 1 -#define GlintdTdyOff 0x73e0 -#define GlintdTdySec 0x83e0 -#define GlintdTdySecReg 3 -#define GlintdTdySecOff 0x73e0 - -#define GlintdQdy 0x83e8 -#define GlintdQdyTag 0x007d -#define GlintdQdyReg 1 -#define GlintdQdyOff 0x73e8 -#define GlintdQdySec 0x83e8 -#define GlintdQdySecReg 3 -#define GlintdQdySecOff 0x73e8 - -#define GlintTextureReadMode 0x8480 -#define GlintTextureReadModeTag 0x0090 -#define GlintTextureReadModeReg 1 -#define GlintTextureReadModeOff 0x7480 -#define GlintTextureReadModeSec 0x8480 -#define GlintTextureReadModeSecReg 3 -#define GlintTextureReadModeSecOff 0x7480 - -#define GlintTextureFormat 0x8488 -#define GlintTextureFormatTag 0x0091 -#define GlintTextureFormatReg 1 -#define GlintTextureFormatOff 0x7488 -#define GlintTextureFormatSec 0x8488 -#define GlintTextureFormatSecReg 3 -#define GlintTextureFormatSecOff 0x7488 - -#define GlintTextureCacheControl 0x8490 -#define GlintTextureCacheControlTag 0x0092 -#define GlintTextureCacheControlReg 1 -#define GlintTextureCacheControlOff 0x7490 -#define GlintTextureCacheControlSec 0x8490 -#define GlintTextureCacheControlSecReg 3 -#define GlintTextureCacheControlSecOff 0x7490 - -#define GlintGLINTBorderColor 0x84a8 -#define GlintGLINTBorderColorTag 0x0095 -#define GlintGLINTBorderColorReg 1 -#define GlintGLINTBorderColorOff 0x74a8 -#define GlintGLINTBorderColorSec 0x84a8 -#define GlintGLINTBorderColorSecReg 3 -#define GlintGLINTBorderColorSecOff 0x74a8 - -#define GlintTexelLUTIndex 0x84c0 -#define GlintTexelLUTIndexTag 0x0098 -#define GlintTexelLUTIndexReg 1 -#define GlintTexelLUTIndexOff 0x74c0 -#define GlintTexelLUTIndexSec 0x84c0 -#define GlintTexelLUTIndexSecReg 3 -#define GlintTexelLUTIndexSecOff 0x74c0 - -#define GlintTexelLUTData 0x84c8 -#define GlintTexelLUTDataTag 0x0099 -#define GlintTexelLUTDataReg 1 -#define GlintTexelLUTDataOff 0x74c8 -#define GlintTexelLUTDataSec 0x84c8 -#define GlintTexelLUTDataSecReg 3 -#define GlintTexelLUTDataSecOff 0x74c8 - -#define GlintTexelLUTAddress 0x84d0 -#define GlintTexelLUTAddressTag 0x009a -#define GlintTexelLUTAddressReg 1 -#define GlintTexelLUTAddressOff 0x74d0 -#define GlintTexelLUTAddressSec 0x84d0 -#define GlintTexelLUTAddressSecReg 3 -#define GlintTexelLUTAddressSecOff 0x74d0 - -#define GlintTexelLUTTransfer 0x84d8 -#define GlintTexelLUTTransferTag 0x009b -#define GlintTexelLUTTransferReg 1 -#define GlintTexelLUTTransferOff 0x74d8 -#define GlintTexelLUTTransferSec 0x84d8 -#define GlintTexelLUTTransferSecReg 3 -#define GlintTexelLUTTransferSecOff 0x74d8 - -#define GlintTextureFilterMode 0x84e0 -#define GlintTextureFilterModeTag 0x009c -#define GlintTextureFilterModeReg 1 -#define GlintTextureFilterModeOff 0x74e0 -#define GlintTextureFilterModeSec 0x84e0 -#define GlintTextureFilterModeSecReg 3 -#define GlintTextureFilterModeSecOff 0x74e0 - -#define GlintTextureChromaUpper 0x84e8 -#define GlintTextureChromaUpperTag 0x009d -#define GlintTextureChromaUpperReg 1 -#define GlintTextureChromaUpperOff 0x74e8 -#define GlintTextureChromaUpperSec 0x84e8 -#define GlintTextureChromaUpperSecReg 3 -#define GlintTextureChromaUpperSecOff 0x74e8 - -#define GlintTextureChromaLower 0x84f0 -#define GlintTextureChromaLowerTag 0x009e -#define GlintTextureChromaLowerReg 1 -#define GlintTextureChromaLowerOff 0x74f0 -#define GlintTextureChromaLowerSec 0x84f0 -#define GlintTextureChromaLowerSecReg 3 -#define GlintTextureChromaLowerSecOff 0x74f0 - -#define GlintTxBaseAddr0 0x8500 -#define GlintTxBaseAddr0Tag 0x00a0 -#define GlintTxBaseAddr0Reg 1 -#define GlintTxBaseAddr0Off 0x7500 -#define GlintTxBaseAddr0Sec 0x8500 -#define GlintTxBaseAddr0SecReg 3 -#define GlintTxBaseAddr0SecOff 0x7500 - -#define GlintTxBaseAddr1 0x8508 -#define GlintTxBaseAddr1Tag 0x00a1 -#define GlintTxBaseAddr1Reg 1 -#define GlintTxBaseAddr1Off 0x7508 -#define GlintTxBaseAddr1Sec 0x8508 -#define GlintTxBaseAddr1SecReg 3 -#define GlintTxBaseAddr1SecOff 0x7508 - -#define GlintTxBaseAddr2 0x8510 -#define GlintTxBaseAddr2Tag 0x00a2 -#define GlintTxBaseAddr2Reg 1 -#define GlintTxBaseAddr2Off 0x7510 -#define GlintTxBaseAddr2Sec 0x8510 -#define GlintTxBaseAddr2SecReg 3 -#define GlintTxBaseAddr2SecOff 0x7510 - -#define GlintTxBaseAddr3 0x8518 -#define GlintTxBaseAddr3Tag 0x00a3 -#define GlintTxBaseAddr3Reg 1 -#define GlintTxBaseAddr3Off 0x7518 -#define GlintTxBaseAddr3Sec 0x8518 -#define GlintTxBaseAddr3SecReg 3 -#define GlintTxBaseAddr3SecOff 0x7518 - -#define GlintTxBaseAddr4 0x8520 -#define GlintTxBaseAddr4Tag 0x00a4 -#define GlintTxBaseAddr4Reg 1 -#define GlintTxBaseAddr4Off 0x7520 -#define GlintTxBaseAddr4Sec 0x8520 -#define GlintTxBaseAddr4SecReg 3 -#define GlintTxBaseAddr4SecOff 0x7520 - -#define GlintTxBaseAddr5 0x8528 -#define GlintTxBaseAddr5Tag 0x00a5 -#define GlintTxBaseAddr5Reg 1 -#define GlintTxBaseAddr5Off 0x7528 -#define GlintTxBaseAddr5Sec 0x8528 -#define GlintTxBaseAddr5SecReg 3 -#define GlintTxBaseAddr5SecOff 0x7528 - -#define GlintTxBaseAddr6 0x8530 -#define GlintTxBaseAddr6Tag 0x00a6 -#define GlintTxBaseAddr6Reg 1 -#define GlintTxBaseAddr6Off 0x7530 -#define GlintTxBaseAddr6Sec 0x8530 -#define GlintTxBaseAddr6SecReg 3 -#define GlintTxBaseAddr6SecOff 0x7530 - -#define GlintTxBaseAddr7 0x8538 -#define GlintTxBaseAddr7Tag 0x00a7 -#define GlintTxBaseAddr7Reg 1 -#define GlintTxBaseAddr7Off 0x7538 -#define GlintTxBaseAddr7Sec 0x8538 -#define GlintTxBaseAddr7SecReg 3 -#define GlintTxBaseAddr7SecOff 0x7538 - -#define GlintTxBaseAddr8 0x8540 -#define GlintTxBaseAddr8Tag 0x00a8 -#define GlintTxBaseAddr8Reg 1 -#define GlintTxBaseAddr8Off 0x7540 -#define GlintTxBaseAddr8Sec 0x8540 -#define GlintTxBaseAddr8SecReg 3 -#define GlintTxBaseAddr8SecOff 0x7540 - -#define GlintTxBaseAddr9 0x8548 -#define GlintTxBaseAddr9Tag 0x00a9 -#define GlintTxBaseAddr9Reg 1 -#define GlintTxBaseAddr9Off 0x7548 -#define GlintTxBaseAddr9Sec 0x8548 -#define GlintTxBaseAddr9SecReg 3 -#define GlintTxBaseAddr9SecOff 0x7548 - -#define GlintTxBaseAddr10 0x8550 -#define GlintTxBaseAddr10Tag 0x00aa -#define GlintTxBaseAddr10Reg 1 -#define GlintTxBaseAddr10Off 0x7550 -#define GlintTxBaseAddr10Sec 0x8550 -#define GlintTxBaseAddr10SecReg 3 -#define GlintTxBaseAddr10SecOff 0x7550 - -#define GlintTxBaseAddr11 0x8558 -#define GlintTxBaseAddr11Tag 0x00ab -#define GlintTxBaseAddr11Reg 1 -#define GlintTxBaseAddr11Off 0x7558 -#define GlintTxBaseAddr11Sec 0x8558 -#define GlintTxBaseAddr11SecReg 3 -#define GlintTxBaseAddr11SecOff 0x7558 - -#define GlintTxBaseAddr12 0x8560 -#define GlintTxBaseAddr12Tag 0x00ac -#define GlintTxBaseAddr12Reg 1 -#define GlintTxBaseAddr12Off 0x7560 -#define GlintTxBaseAddr12Sec 0x8560 -#define GlintTxBaseAddr12SecReg 3 -#define GlintTxBaseAddr12SecOff 0x7560 - -#define GlintTexelLUT0 0x8e80 -#define GlintTexelLUT0Tag 0x01d0 -#define GlintTexelLUT0Reg 1 -#define GlintTexelLUT0Off 0x7e80 -#define GlintTexelLUT0Sec 0x8e80 -#define GlintTexelLUT0SecReg 3 -#define GlintTexelLUT0SecOff 0x7e80 - -#define GlintTexelLUT1 0x8e88 -#define GlintTexelLUT1Tag 0x01d1 -#define GlintTexelLUT1Reg 1 -#define GlintTexelLUT1Off 0x7e88 -#define GlintTexelLUT1Sec 0x8e88 -#define GlintTexelLUT1SecReg 3 -#define GlintTexelLUT1SecOff 0x7e88 - -#define GlintTexelLUT2 0x8e90 -#define GlintTexelLUT2Tag 0x01d2 -#define GlintTexelLUT2Reg 1 -#define GlintTexelLUT2Off 0x7e90 -#define GlintTexelLUT2Sec 0x8e90 -#define GlintTexelLUT2SecReg 3 -#define GlintTexelLUT2SecOff 0x7e90 - -#define GlintTexelLUT3 0x8e98 -#define GlintTexelLUT3Tag 0x01d3 -#define GlintTexelLUT3Reg 1 -#define GlintTexelLUT3Off 0x7e98 -#define GlintTexelLUT3Sec 0x8e98 -#define GlintTexelLUT3SecReg 3 -#define GlintTexelLUT3SecOff 0x7e98 - -#define GlintTexelLUT4 0x8ea0 -#define GlintTexelLUT4Tag 0x01d4 -#define GlintTexelLUT4Reg 1 -#define GlintTexelLUT4Off 0x7ea0 -#define GlintTexelLUT4Sec 0x8ea0 -#define GlintTexelLUT4SecReg 3 -#define GlintTexelLUT4SecOff 0x7ea0 - -#define GlintTexelLUT5 0x8ea8 -#define GlintTexelLUT5Tag 0x01d5 -#define GlintTexelLUT5Reg 1 -#define GlintTexelLUT5Off 0x7ea8 -#define GlintTexelLUT5Sec 0x8ea8 -#define GlintTexelLUT5SecReg 3 -#define GlintTexelLUT5SecOff 0x7ea8 - -#define GlintTexelLUT6 0x8eb0 -#define GlintTexelLUT6Tag 0x01d6 -#define GlintTexelLUT6Reg 1 -#define GlintTexelLUT6Off 0x7eb0 -#define GlintTexelLUT6Sec 0x8eb0 -#define GlintTexelLUT6SecReg 3 -#define GlintTexelLUT6SecOff 0x7eb0 - -#define GlintTexelLUT7 0x8eb8 -#define GlintTexelLUT7Tag 0x01d7 -#define GlintTexelLUT7Reg 1 -#define GlintTexelLUT7Off 0x7eb8 -#define GlintTexelLUT7Sec 0x8eb8 -#define GlintTexelLUT7SecReg 3 -#define GlintTexelLUT7SecOff 0x7eb8 - -#define GlintTexelLUT8 0x8ec0 -#define GlintTexelLUT8Tag 0x01d8 -#define GlintTexelLUT8Reg 1 -#define GlintTexelLUT8Off 0x7ec0 -#define GlintTexelLUT8Sec 0x8ec0 -#define GlintTexelLUT8SecReg 3 -#define GlintTexelLUT8SecOff 0x7ec0 - -#define GlintTexelLUT9 0x8ec8 -#define GlintTexelLUT9Tag 0x01d9 -#define GlintTexelLUT9Reg 1 -#define GlintTexelLUT9Off 0x7ec8 -#define GlintTexelLUT9Sec 0x8ec8 -#define GlintTexelLUT9SecReg 3 -#define GlintTexelLUT9SecOff 0x7ec8 - -#define GlintTexelLUT10 0x8ed0 -#define GlintTexelLUT10Tag 0x01da -#define GlintTexelLUT10Reg 1 -#define GlintTexelLUT10Off 0x7ed0 -#define GlintTexelLUT10Sec 0x8ed0 -#define GlintTexelLUT10SecReg 3 -#define GlintTexelLUT10SecOff 0x7ed0 - -#define GlintTexelLUT11 0x8ed8 -#define GlintTexelLUT11Tag 0x01db -#define GlintTexelLUT11Reg 1 -#define GlintTexelLUT11Off 0x7ed8 -#define GlintTexelLUT11Sec 0x8ed8 -#define GlintTexelLUT11SecReg 3 -#define GlintTexelLUT11SecOff 0x7ed8 - -#define GlintTexelLUT12 0x8ee0 -#define GlintTexelLUT12Tag 0x01dc -#define GlintTexelLUT12Reg 1 -#define GlintTexelLUT12Off 0x7ee0 -#define GlintTexelLUT12Sec 0x8ee0 -#define GlintTexelLUT12SecReg 3 -#define GlintTexelLUT12SecOff 0x7ee0 - -#define GlintTexelLUT13 0x8ee8 -#define GlintTexelLUT13Tag 0x01dd -#define GlintTexelLUT13Reg 1 -#define GlintTexelLUT13Off 0x7ee8 -#define GlintTexelLUT13Sec 0x8ee8 -#define GlintTexelLUT13SecReg 3 -#define GlintTexelLUT13SecOff 0x7ee8 - -#define GlintTexelLUT14 0x8ef0 -#define GlintTexelLUT14Tag 0x01de -#define GlintTexelLUT14Reg 1 -#define GlintTexelLUT14Off 0x7ef0 -#define GlintTexelLUT14Sec 0x8ef0 -#define GlintTexelLUT14SecReg 3 -#define GlintTexelLUT14SecOff 0x7ef0 - -#define GlintTexelLUT15 0x8ef8 -#define GlintTexelLUT15Tag 0x01df -#define GlintTexelLUT15Reg 1 -#define GlintTexelLUT15Off 0x7ef8 -#define GlintTexelLUT15Sec 0x8ef8 -#define GlintTexelLUT15SecReg 3 -#define GlintTexelLUT15SecOff 0x7ef8 - -#define GlintTexel0 0x8600 -#define GlintTexel0Tag 0x00c0 -#define GlintTexel0Reg 1 -#define GlintTexel0Off 0x7600 -#define GlintTexel0Sec 0x8600 -#define GlintTexel0SecReg 3 -#define GlintTexel0SecOff 0x7600 - -#define GlintTexel1 0x8608 -#define GlintTexel1Tag 0x00c1 -#define GlintTexel1Reg 1 -#define GlintTexel1Off 0x7608 -#define GlintTexel1Sec 0x8608 -#define GlintTexel1SecReg 3 -#define GlintTexel1SecOff 0x7608 - -#define GlintTexel2 0x8610 -#define GlintTexel2Tag 0x00c2 -#define GlintTexel2Reg 1 -#define GlintTexel2Off 0x7610 -#define GlintTexel2Sec 0x8610 -#define GlintTexel2SecReg 3 -#define GlintTexel2SecOff 0x7610 - -#define GlintTexel3 0x8618 -#define GlintTexel3Tag 0x00c3 -#define GlintTexel3Reg 1 -#define GlintTexel3Off 0x7618 -#define GlintTexel3Sec 0x8618 -#define GlintTexel3SecReg 3 -#define GlintTexel3SecOff 0x7618 - -#define GlintTexel4 0x8620 -#define GlintTexel4Tag 0x00c4 -#define GlintTexel4Reg 1 -#define GlintTexel4Off 0x7620 -#define GlintTexel4Sec 0x8620 -#define GlintTexel4SecReg 3 -#define GlintTexel4SecOff 0x7620 - -#define GlintTexel5 0x8628 -#define GlintTexel5Tag 0x00c5 -#define GlintTexel5Reg 1 -#define GlintTexel5Off 0x7628 -#define GlintTexel5Sec 0x8628 -#define GlintTexel5SecReg 3 -#define GlintTexel5SecOff 0x7628 - -#define GlintTexel6 0x8630 -#define GlintTexel6Tag 0x00c6 -#define GlintTexel6Reg 1 -#define GlintTexel6Off 0x7630 -#define GlintTexel6Sec 0x8630 -#define GlintTexel6SecReg 3 -#define GlintTexel6SecOff 0x7630 - -#define GlintTexel7 0x8638 -#define GlintTexel7Tag 0x00c7 -#define GlintTexel7Reg 1 -#define GlintTexel7Off 0x7638 -#define GlintTexel7Sec 0x8638 -#define GlintTexel7SecReg 3 -#define GlintTexel7SecOff 0x7638 - -#define GlintInterp0 0x8640 -#define GlintInterp0Tag 0x00c8 -#define GlintInterp0Reg 1 -#define GlintInterp0Off 0x7640 -#define GlintInterp0Sec 0x8640 -#define GlintInterp0SecReg 3 -#define GlintInterp0SecOff 0x7640 - -#define GlintInterp1 0x8648 -#define GlintInterp1Tag 0x00c9 -#define GlintInterp1Reg 1 -#define GlintInterp1Off 0x7648 -#define GlintInterp1Sec 0x8648 -#define GlintInterp1SecReg 3 -#define GlintInterp1SecOff 0x7648 - -#define GlintInterp2 0x8650 -#define GlintInterp2Tag 0x00ca -#define GlintInterp2Reg 1 -#define GlintInterp2Off 0x7650 -#define GlintInterp2Sec 0x8650 -#define GlintInterp2SecReg 3 -#define GlintInterp2SecOff 0x7650 - -#define GlintInterp3 0x8658 -#define GlintInterp3Tag 0x00cb -#define GlintInterp3Reg 1 -#define GlintInterp3Off 0x7658 -#define GlintInterp3Sec 0x8658 -#define GlintInterp3SecReg 3 -#define GlintInterp3SecOff 0x7658 - -#define GlintInterp4 0x8660 -#define GlintInterp4Tag 0x00cc -#define GlintInterp4Reg 1 -#define GlintInterp4Off 0x7660 -#define GlintInterp4Sec 0x8660 -#define GlintInterp4SecReg 3 -#define GlintInterp4SecOff 0x7660 - -#define GlintTextureFilter 0x8668 -#define GlintTextureFilterTag 0x00cd -#define GlintTextureFilterReg 1 -#define GlintTextureFilterOff 0x7668 -#define GlintTextureFilterSec 0x8668 -#define GlintTextureFilterSecReg 3 -#define GlintTextureFilterSecOff 0x7668 - -#define GlintTextureColorMode 0x8680 -#define GlintTextureColorModeTag 0x00d0 -#define GlintTextureColorModeReg 1 -#define GlintTextureColorModeOff 0x7680 -#define GlintTextureColorModeSec 0x8680 -#define GlintTextureColorModeSecReg 3 -#define GlintTextureColorModeSecOff 0x7680 - -#define GlintTextureEnvColor 0x8688 -#define GlintTextureEnvColorTag 0x00d1 -#define GlintTextureEnvColorReg 1 -#define GlintTextureEnvColorOff 0x7688 -#define GlintTextureEnvColorSec 0x8688 -#define GlintTextureEnvColorSecReg 3 -#define GlintTextureEnvColorSecOff 0x7688 - -#define GlintFogMode 0x8690 -#define GlintFogModeTag 0x00d2 -#define GlintFogModeReg 1 -#define GlintFogModeOff 0x7690 -#define GlintFogModeSec 0x8690 -#define GlintFogModeSecReg 3 -#define GlintFogModeSecOff 0x7690 - -#define GlintFogColor 0x8698 -#define GlintFogColorTag 0x00d3 -#define GlintFogColorReg 1 -#define GlintFogColorOff 0x7698 -#define GlintFogColorSec 0x8698 -#define GlintFogColorSecReg 3 -#define GlintFogColorSecOff 0x7698 - -#define GlintFStart 0x86a0 -#define GlintFStartTag 0x00d4 -#define GlintFStartReg 1 -#define GlintFStartOff 0x76a0 -#define GlintFStartSec 0x86a0 -#define GlintFStartSecReg 3 -#define GlintFStartSecOff 0x76a0 - -#define GlintdFdx 0x86a8 -#define GlintdFdxTag 0x00d5 -#define GlintdFdxReg 1 -#define GlintdFdxOff 0x76a8 -#define GlintdFdxSec 0x86a8 -#define GlintdFdxSecReg 3 -#define GlintdFdxSecOff 0x76a8 - -#define GlintdFdyDom 0x86b0 -#define GlintdFdyDomTag 0x00d6 -#define GlintdFdyDomReg 1 -#define GlintdFdyDomOff 0x76b0 -#define GlintdFdyDomSec 0x86b0 -#define GlintdFdyDomSecReg 3 -#define GlintdFdyDomSecOff 0x76b0 - -#define GlintKsStart 0x86c8 -#define GlintKsStartTag 0x00d9 -#define GlintKsStartReg 1 -#define GlintKsStartOff 0x76c8 -#define GlintKsStartSec 0x86c8 -#define GlintKsStartSecReg 3 -#define GlintKsStartSecOff 0x76c8 - -#define GlintdKsdx 0x86d0 -#define GlintdKsdxTag 0x00da -#define GlintdKsdxReg 1 -#define GlintdKsdxOff 0x76d0 -#define GlintdKsdxSec 0x86d0 -#define GlintdKsdxSecReg 3 -#define GlintdKsdxSecOff 0x76d0 - -#define GlintdKsdyDom 0x86d8 -#define GlintdKsdyDomTag 0x00db -#define GlintdKsdyDomReg 1 -#define GlintdKsdyDomOff 0x76d8 -#define GlintdKsdyDomSec 0x86d8 -#define GlintdKsdyDomSecReg 3 -#define GlintdKsdyDomSecOff 0x76d8 - -#define GlintKdStart 0x86e0 -#define GlintKdStartTag 0x00dc -#define GlintKdStartReg 1 -#define GlintKdStartOff 0x76e0 -#define GlintKdStartSec 0x86e0 -#define GlintKdStartSecReg 3 -#define GlintKdStartSecOff 0x76e0 - -#define GlintdKdStart 0x86e8 -#define GlintdKdStartTag 0x00dd -#define GlintdKdStartReg 1 -#define GlintdKdStartOff 0x76e8 -#define GlintdKdStartSec 0x86e8 -#define GlintdKdStartSecReg 3 -#define GlintdKdStartSecOff 0x76e8 - -#define GlintdKddyDom 0x86f0 -#define GlintdKddyDomTag 0x00de -#define GlintdKddyDomReg 1 -#define GlintdKddyDomOff 0x76f0 -#define GlintdKddyDomSec 0x86f0 -#define GlintdKddyDomSecReg 3 -#define GlintdKddyDomSecOff 0x76f0 - -#define GlintRStart 0x8780 -#define GlintRStartTag 0x00f0 -#define GlintRStartReg 1 -#define GlintRStartOff 0x7780 -#define GlintRStartSec 0x8780 -#define GlintRStartSecReg 3 -#define GlintRStartSecOff 0x7780 - -#define GlintdRdx 0x8788 -#define GlintdRdxTag 0x00f1 -#define GlintdRdxReg 1 -#define GlintdRdxOff 0x7788 -#define GlintdRdxSec 0x8788 -#define GlintdRdxSecReg 3 -#define GlintdRdxSecOff 0x7788 - -#define GlintdRdyDom 0x8790 -#define GlintdRdyDomTag 0x00f2 -#define GlintdRdyDomReg 1 -#define GlintdRdyDomOff 0x7790 -#define GlintdRdyDomSec 0x8790 -#define GlintdRdyDomSecReg 3 -#define GlintdRdyDomSecOff 0x7790 - -#define GlintGStart 0x8798 -#define GlintGStartTag 0x00f3 -#define GlintGStartReg 1 -#define GlintGStartOff 0x7798 -#define GlintGStartSec 0x8798 -#define GlintGStartSecReg 3 -#define GlintGStartSecOff 0x7798 - -#define GlintdGdx 0x87a0 -#define GlintdGdxTag 0x00f4 -#define GlintdGdxReg 1 -#define GlintdGdxOff 0x77a0 -#define GlintdGdxSec 0x87a0 -#define GlintdGdxSecReg 3 -#define GlintdGdxSecOff 0x77a0 - -#define GlintdGdyDom 0x87a8 -#define GlintdGdyDomTag 0x00f5 -#define GlintdGdyDomReg 1 -#define GlintdGdyDomOff 0x77a8 -#define GlintdGdyDomSec 0x87a8 -#define GlintdGdyDomSecReg 3 -#define GlintdGdyDomSecOff 0x77a8 - -#define GlintBStart 0x87b0 -#define GlintBStartTag 0x00f6 -#define GlintBStartReg 1 -#define GlintBStartOff 0x77b0 -#define GlintBStartSec 0x87b0 -#define GlintBStartSecReg 3 -#define GlintBStartSecOff 0x77b0 - -#define GlintdBdx 0x87b8 -#define GlintdBdxTag 0x00f7 -#define GlintdBdxReg 1 -#define GlintdBdxOff 0x77b8 -#define GlintdBdxSec 0x87b8 -#define GlintdBdxSecReg 3 -#define GlintdBdxSecOff 0x77b8 - -#define GlintdBdyDom 0x87c0 -#define GlintdBdyDomTag 0x00f8 -#define GlintdBdyDomReg 1 -#define GlintdBdyDomOff 0x77c0 -#define GlintdBdyDomSec 0x87c0 -#define GlintdBdyDomSecReg 3 -#define GlintdBdyDomSecOff 0x77c0 - -#define GlintAStart 0x87c8 -#define GlintAStartTag 0x00f9 -#define GlintAStartReg 1 -#define GlintAStartOff 0x77c8 -#define GlintAStartSec 0x87c8 -#define GlintAStartSecReg 3 -#define GlintAStartSecOff 0x77c8 - -#define GlintdAdx 0x87d0 -#define GlintdAdxTag 0x00fa -#define GlintdAdxReg 1 -#define GlintdAdxOff 0x77d0 -#define GlintdAdxSec 0x87d0 -#define GlintdAdxSecReg 3 -#define GlintdAdxSecOff 0x77d0 - -#define GlintdAdyDom 0x87d8 -#define GlintdAdyDomTag 0x00fb -#define GlintdAdyDomReg 1 -#define GlintdAdyDomOff 0x77d8 -#define GlintdAdyDomSec 0x87d8 -#define GlintdAdyDomSecReg 3 -#define GlintdAdyDomSecOff 0x77d8 - -#define GlintColorDDAMode 0x87e0 -#define GlintColorDDAModeTag 0x00fc -#define GlintColorDDAModeReg 1 -#define GlintColorDDAModeOff 0x77e0 -#define GlintColorDDAModeSec 0x87e0 -#define GlintColorDDAModeSecReg 3 -#define GlintColorDDAModeSecOff 0x77e0 - -#define GlintConstantColor 0x87e8 -#define GlintConstantColorTag 0x00fd -#define GlintConstantColorReg 1 -#define GlintConstantColorOff 0x77e8 -#define GlintConstantColorSec 0x87e8 -#define GlintConstantColorSecReg 3 -#define GlintConstantColorSecOff 0x77e8 - -#define GlintGLINTColor 0x87f0 -#define GlintGLINTColorTag 0x00fe -#define GlintGLINTColorReg 1 -#define GlintGLINTColorOff 0x77f0 -#define GlintGLINTColorSec 0x87f0 -#define GlintGLINTColorSecReg 3 -#define GlintGLINTColorSecOff 0x77f0 - -#define GlintAlphaTestMode 0x8800 -#define GlintAlphaTestModeTag 0x0100 -#define GlintAlphaTestModeReg 1 -#define GlintAlphaTestModeOff 0x7800 -#define GlintAlphaTestModeSec 0x8800 -#define GlintAlphaTestModeSecReg 3 -#define GlintAlphaTestModeSecOff 0x7800 - -#define GlintAntialiasMode 0x8808 -#define GlintAntialiasModeTag 0x0101 -#define GlintAntialiasModeReg 1 -#define GlintAntialiasModeOff 0x7808 -#define GlintAntialiasModeSec 0x8808 -#define GlintAntialiasModeSecReg 3 -#define GlintAntialiasModeSecOff 0x7808 - -#define GlintAlphaBlendMode 0x8810 -#define GlintAlphaBlendModeTag 0x0102 -#define GlintAlphaBlendModeReg 1 -#define GlintAlphaBlendModeOff 0x7810 -#define GlintAlphaBlendModeSec 0x8810 -#define GlintAlphaBlendModeSecReg 3 -#define GlintAlphaBlendModeSecOff 0x7810 - -#define GlintChromaUpper 0x8f08 -#define GlintChromaUpperTag 0x01e1 -#define GlintChromaUpperReg 1 -#define GlintChromaUpperOff 0x7f08 -#define GlintChromaUpperSec 0x8f08 -#define GlintChromaUpperSecReg 3 -#define GlintChromaUpperSecOff 0x7f08 - -#define GlintChromaLower 0x8f10 -#define GlintChromaLowerTag 0x01e2 -#define GlintChromaLowerReg 1 -#define GlintChromaLowerOff 0x7f10 -#define GlintChromaLowerSec 0x8f10 -#define GlintChromaLowerSecReg 3 -#define GlintChromaLowerSecOff 0x7f10 - -#define GlintChromaTestMode 0x8f18 -#define GlintChromaTestModeTag 0x01e3 -#define GlintChromaTestModeReg 1 -#define GlintChromaTestModeOff 0x7f18 -#define GlintChromaTestModeSec 0x8f18 -#define GlintChromaTestModeSecReg 3 -#define GlintChromaTestModeSecOff 0x7f18 - -#define GlintDitherMode 0x8818 -#define GlintDitherModeTag 0x0103 -#define GlintDitherModeReg 1 -#define GlintDitherModeOff 0x7818 -#define GlintDitherModeSec 0x8818 -#define GlintDitherModeSecReg 3 -#define GlintDitherModeSecOff 0x7818 - -#define GlintFBSoftwareWriteMask 0x8820 -#define GlintFBSoftwareWriteMaskTag 0x0104 -#define GlintFBSoftwareWriteMaskReg 1 -#define GlintFBSoftwareWriteMaskOff 0x7820 -#define GlintFBSoftwareWriteMaskSec 0x8820 -#define GlintFBSoftwareWriteMaskSecReg 3 -#define GlintFBSoftwareWriteMaskSecOff 0x7820 - -#define GlintLogicalOpMode 0x8828 -#define GlintLogicalOpModeTag 0x0105 -#define GlintLogicalOpModeReg 1 -#define GlintLogicalOpModeOff 0x7828 -#define GlintLogicalOpModeSec 0x8828 -#define GlintLogicalOpModeSecReg 3 -#define GlintLogicalOpModeSecOff 0x7828 - -#define GlintFBWriteData 0x8830 -#define GlintFBWriteDataTag 0x0106 -#define GlintFBWriteDataReg 1 -#define GlintFBWriteDataOff 0x7830 -#define GlintFBWriteDataSec 0x8830 -#define GlintFBWriteDataSecReg 3 -#define GlintFBWriteDataSecOff 0x7830 - -#define GlintLBReadMode 0x8880 -#define GlintLBReadModeTag 0x0110 -#define GlintLBReadModeReg 1 -#define GlintLBReadModeOff 0x7880 -#define GlintLBReadModeSec 0x8880 -#define GlintLBReadModeSecReg 3 -#define GlintLBReadModeSecOff 0x7880 - -#define GlintLBReadFormat 0x8888 -#define GlintLBReadFormatTag 0x0111 -#define GlintLBReadFormatReg 1 -#define GlintLBReadFormatOff 0x7888 -#define GlintLBReadFormatSec 0x8888 -#define GlintLBReadFormatSecReg 3 -#define GlintLBReadFormatSecOff 0x7888 - -#define GlintLBSourceOffset 0x8890 -#define GlintLBSourceOffsetTag 0x0112 -#define GlintLBSourceOffsetReg 1 -#define GlintLBSourceOffsetOff 0x7890 -#define GlintLBSourceOffsetSec 0x8890 -#define GlintLBSourceOffsetSecReg 3 -#define GlintLBSourceOffsetSecOff 0x7890 - -#define GlintLBStencil 0x88a8 -#define GlintLBStencilTag 0x0115 -#define GlintLBStencilReg 1 -#define GlintLBStencilOff 0x78a8 -#define GlintLBStencilSec 0x88a8 -#define GlintLBStencilSecReg 3 -#define GlintLBStencilSecOff 0x78a8 - -#define GlintLBDepth 0x88b0 -#define GlintLBDepthTag 0x0116 -#define GlintLBDepthReg 1 -#define GlintLBDepthOff 0x78b0 -#define GlintLBDepthSec 0x88b0 -#define GlintLBDepthSecReg 3 -#define GlintLBDepthSecOff 0x78b0 - -#define GlintLBWindowBase 0x88b8 -#define GlintLBWindowBaseTag 0x0117 -#define GlintLBWindowBaseReg 1 -#define GlintLBWindowBaseOff 0x78b8 -#define GlintLBWindowBaseSec 0x88b8 -#define GlintLBWindowBaseSecReg 3 -#define GlintLBWindowBaseSecOff 0x78b8 - -#define GlintLBWriteMode 0x88c0 -#define GlintLBWriteModeTag 0x0118 -#define GlintLBWriteModeReg 1 -#define GlintLBWriteModeOff 0x78c0 -#define GlintLBWriteModeSec 0x88c0 -#define GlintLBWriteModeSecReg 3 -#define GlintLBWriteModeSecOff 0x78c0 - -#define GlintLBWriteFormat 0x88c8 -#define GlintLBWriteFormatTag 0x0119 -#define GlintLBWriteFormatReg 1 -#define GlintLBWriteFormatOff 0x78c8 -#define GlintLBWriteFormatSec 0x88c8 -#define GlintLBWriteFormatSecReg 3 -#define GlintLBWriteFormatSecOff 0x78c8 - -#define GlintTextureData 0x88e8 -#define GlintTextureDataTag 0x011d -#define GlintTextureDataReg 1 -#define GlintTextureDataOff 0x78e8 -#define GlintTextureDataSec 0x88e8 -#define GlintTextureDataSecReg 3 -#define GlintTextureDataSecOff 0x78e8 - -#define GlintTextureDownloadOffset 0x88f0 -#define GlintTextureDownloadOffsetTag 0x011e -#define GlintTextureDownloadOffsetReg 1 -#define GlintTextureDownloadOffsetOff 0x78f0 -#define GlintTextureDownloadOffsetSec 0x88f0 -#define GlintTextureDownloadOffsetSecReg 3 -#define GlintTextureDownloadOffsetSecOff 0x78f0 - -#define GlintLBWindowOffset 0x88f8 -#define GlintLBWindowOffsetTag 0x011f -#define GlintLBWindowOffsetReg 1 -#define GlintLBWindowOffsetOff 0x78f8 -#define GlintLBWindowOffsetSec 0x88f8 -#define GlintLBWindowOffsetSecReg 3 -#define GlintLBWindowOffsetSecOff 0x78f8 - -#define GlintGLINTWindow 0x8980 -#define GlintGLINTWindowTag 0x0130 -#define GlintGLINTWindowReg 1 -#define GlintGLINTWindowOff 0x7980 -#define GlintGLINTWindowSec 0x8980 -#define GlintGLINTWindowSecReg 3 -#define GlintGLINTWindowSecOff 0x7980 - -#define GlintStencilMode 0x8988 -#define GlintStencilModeTag 0x0131 -#define GlintStencilModeReg 1 -#define GlintStencilModeOff 0x7988 -#define GlintStencilModeSec 0x8988 -#define GlintStencilModeSecReg 3 -#define GlintStencilModeSecOff 0x7988 - -#define GlintStencilData 0x8990 -#define GlintStencilDataTag 0x0132 -#define GlintStencilDataReg 1 -#define GlintStencilDataOff 0x7990 -#define GlintStencilDataSec 0x8990 -#define GlintStencilDataSecReg 3 -#define GlintStencilDataSecOff 0x7990 - -#define GlintGLINTStencil 0x8998 -#define GlintGLINTStencilTag 0x0133 -#define GlintGLINTStencilReg 1 -#define GlintGLINTStencilOff 0x7998 -#define GlintGLINTStencilSec 0x8998 -#define GlintGLINTStencilSecReg 3 -#define GlintGLINTStencilSecOff 0x7998 - -#define GlintDepthMode 0x89a0 -#define GlintDepthModeTag 0x0134 -#define GlintDepthModeReg 1 -#define GlintDepthModeOff 0x79a0 -#define GlintDepthModeSec 0x89a0 -#define GlintDepthModeSecReg 3 -#define GlintDepthModeSecOff 0x79a0 - -#define GlintGLINTDepth 0x89a8 -#define GlintGLINTDepthTag 0x0135 -#define GlintGLINTDepthReg 1 -#define GlintGLINTDepthOff 0x79a8 -#define GlintGLINTDepthSec 0x89a8 -#define GlintGLINTDepthSecReg 3 -#define GlintGLINTDepthSecOff 0x79a8 - -#define GlintZStartU 0x89b0 -#define GlintZStartUTag 0x0136 -#define GlintZStartUReg 1 -#define GlintZStartUOff 0x79b0 -#define GlintZStartUSec 0x89b0 -#define GlintZStartUSecReg 3 -#define GlintZStartUSecOff 0x79b0 - -#define GlintZStartL 0x89b8 -#define GlintZStartLTag 0x0137 -#define GlintZStartLReg 1 -#define GlintZStartLOff 0x79b8 -#define GlintZStartLSec 0x89b8 -#define GlintZStartLSecReg 3 -#define GlintZStartLSecOff 0x79b8 - -#define GlintdZdxU 0x89c0 -#define GlintdZdxUTag 0x0138 -#define GlintdZdxUReg 1 -#define GlintdZdxUOff 0x79c0 -#define GlintdZdxUSec 0x89c0 -#define GlintdZdxUSecReg 3 -#define GlintdZdxUSecOff 0x79c0 - -#define GlintdZdxL 0x89c8 -#define GlintdZdxLTag 0x0139 -#define GlintdZdxLReg 1 -#define GlintdZdxLOff 0x79c8 -#define GlintdZdxLSec 0x89c8 -#define GlintdZdxLSecReg 3 -#define GlintdZdxLSecOff 0x79c8 - -#define GlintdZdyDomU 0x89d0 -#define GlintdZdyDomUTag 0x013a -#define GlintdZdyDomUReg 1 -#define GlintdZdyDomUOff 0x79d0 -#define GlintdZdyDomUSec 0x89d0 -#define GlintdZdyDomUSecReg 3 -#define GlintdZdyDomUSecOff 0x79d0 - -#define GlintdZdyDomL 0x89d8 -#define GlintdZdyDomLTag 0x013b -#define GlintdZdyDomLReg 1 -#define GlintdZdyDomLOff 0x79d8 -#define GlintdZdyDomLSec 0x89d8 -#define GlintdZdyDomLSecReg 3 -#define GlintdZdyDomLSecOff 0x79d8 - -#define GlintFastClearDepth 0x89e0 -#define GlintFastClearDepthTag 0x013c -#define GlintFastClearDepthReg 1 -#define GlintFastClearDepthOff 0x79e0 -#define GlintFastClearDepthSec 0x89e0 -#define GlintFastClearDepthSecReg 3 -#define GlintFastClearDepthSecOff 0x79e0 - -#define GlintFBReadMode 0x8a80 -#define GlintFBReadModeTag 0x0150 -#define GlintFBReadModeReg 1 -#define GlintFBReadModeOff 0x7a80 -#define GlintFBReadModeSec 0x8a80 -#define GlintFBReadModeSecReg 3 -#define GlintFBReadModeSecOff 0x7a80 - -#define GlintFBSourceOffset 0x8a88 -#define GlintFBSourceOffsetTag 0x0151 -#define GlintFBSourceOffsetReg 1 -#define GlintFBSourceOffsetOff 0x7a88 -#define GlintFBSourceOffsetSec 0x8a88 -#define GlintFBSourceOffsetSecReg 3 -#define GlintFBSourceOffsetSecOff 0x7a88 - -#define GlintFBPixelOffset 0x8a90 -#define GlintFBPixelOffsetTag 0x0152 -#define GlintFBPixelOffsetReg 1 -#define GlintFBPixelOffsetOff 0x7a90 -#define GlintFBPixelOffsetSec 0x8a90 -#define GlintFBPixelOffsetSecReg 3 -#define GlintFBPixelOffsetSecOff 0x7a90 - -#define GlintFBColor 0x8a98 -#define GlintFBColorTag 0x0153 -#define GlintFBColorReg 1 -#define GlintFBColorOff 0x7a98 -#define GlintFBColorSec 0x8a98 -#define GlintFBColorSecReg 3 -#define GlintFBColorSecOff 0x7a98 - -#define GlintFBData 0x8aa0 -#define GlintFBDataTag 0x0154 -#define GlintFBDataReg 1 -#define GlintFBDataOff 0x7aa0 -#define GlintFBDataSec 0x8aa0 -#define GlintFBDataSecReg 3 -#define GlintFBDataSecOff 0x7aa0 - -#define GlintFBSourceData 0x8aa8 -#define GlintFBSourceDataTag 0x0155 -#define GlintFBSourceDataReg 1 -#define GlintFBSourceDataOff 0x7aa8 -#define GlintFBSourceDataSec 0x8aa8 -#define GlintFBSourceDataSecReg 3 -#define GlintFBSourceDataSecOff 0x7aa8 - -#define GlintFBWindowBase 0x8ab0 -#define GlintFBWindowBaseTag 0x0156 -#define GlintFBWindowBaseReg 1 -#define GlintFBWindowBaseOff 0x7ab0 -#define GlintFBWindowBaseSec 0x8ab0 -#define GlintFBWindowBaseSecReg 3 -#define GlintFBWindowBaseSecOff 0x7ab0 - -#define GlintFBWriteMode 0x8ab8 -#define GlintFBWriteModeTag 0x0157 -#define GlintFBWriteModeReg 1 -#define GlintFBWriteModeOff 0x7ab8 -#define GlintFBWriteModeSec 0x8ab8 -#define GlintFBWriteModeSecReg 3 -#define GlintFBWriteModeSecOff 0x7ab8 - -#define GlintFBHardwareWriteMask 0x8ac0 -#define GlintFBHardwareWriteMaskTag 0x0158 -#define GlintFBHardwareWriteMaskReg 1 -#define GlintFBHardwareWriteMaskOff 0x7ac0 -#define GlintFBHardwareWriteMaskSec 0x8ac0 -#define GlintFBHardwareWriteMaskSecReg 3 -#define GlintFBHardwareWriteMaskSecOff 0x7ac0 - -#define GlintFBBlockColor 0x8ac8 -#define GlintFBBlockColorTag 0x0159 -#define GlintFBBlockColorReg 1 -#define GlintFBBlockColorOff 0x7ac8 -#define GlintFBBlockColorSec 0x8ac8 -#define GlintFBBlockColorSecReg 3 -#define GlintFBBlockColorSecOff 0x7ac8 - -#define GlintPatternRamMode 0x8af8 -#define GlintPatternRamModeTag 0x015f -#define GlintPatternRamModeReg 1 -#define GlintPatternRamModeOff 0x7af8 -#define GlintPatternRamModeSec 0x8af8 -#define GlintPatternRamModeSecReg 3 -#define GlintPatternRamModeSecOff 0x7af8 - -#define GlintPatternRamData0 0x8b00 -#define GlintPatternRamData0Tag 0x0160 -#define GlintPatternRamData0Reg 1 -#define GlintPatternRamData0Off 0x7b00 -#define GlintPatternRamData0Sec 0x8b00 -#define GlintPatternRamData0SecReg 3 -#define GlintPatternRamData0SecOff 0x7b00 - -#define GlintPatternRamData1 0x8b08 -#define GlintPatternRamData1Tag 0x0161 -#define GlintPatternRamData1Reg 1 -#define GlintPatternRamData1Off 0x7b08 -#define GlintPatternRamData1Sec 0x8b08 -#define GlintPatternRamData1SecReg 3 -#define GlintPatternRamData1SecOff 0x7b08 - -#define GlintPatternRamData2 0x8b10 -#define GlintPatternRamData2Tag 0x0162 -#define GlintPatternRamData2Reg 1 -#define GlintPatternRamData2Off 0x7b10 -#define GlintPatternRamData2Sec 0x8b10 -#define GlintPatternRamData2SecReg 3 -#define GlintPatternRamData2SecOff 0x7b10 - -#define GlintPatternRamData3 0x8b18 -#define GlintPatternRamData3Tag 0x0163 -#define GlintPatternRamData3Reg 1 -#define GlintPatternRamData3Off 0x7b18 -#define GlintPatternRamData3Sec 0x8b18 -#define GlintPatternRamData3SecReg 3 -#define GlintPatternRamData3SecOff 0x7b18 - -#define GlintPatternRamData4 0x8b20 -#define GlintPatternRamData4Tag 0x0164 -#define GlintPatternRamData4Reg 1 -#define GlintPatternRamData4Off 0x7b20 -#define GlintPatternRamData4Sec 0x8b20 -#define GlintPatternRamData4SecReg 3 -#define GlintPatternRamData4SecOff 0x7b20 - -#define GlintPatternRamData5 0x8b28 -#define GlintPatternRamData5Tag 0x0165 -#define GlintPatternRamData5Reg 1 -#define GlintPatternRamData5Off 0x7b28 -#define GlintPatternRamData5Sec 0x8b28 -#define GlintPatternRamData5SecReg 3 -#define GlintPatternRamData5SecOff 0x7b28 - -#define GlintPatternRamData6 0x8b30 -#define GlintPatternRamData6Tag 0x0166 -#define GlintPatternRamData6Reg 1 -#define GlintPatternRamData6Off 0x7b30 -#define GlintPatternRamData6Sec 0x8b30 -#define GlintPatternRamData6SecReg 3 -#define GlintPatternRamData6SecOff 0x7b30 - -#define GlintPatternRamData7 0x8b38 -#define GlintPatternRamData7Tag 0x0167 -#define GlintPatternRamData7Reg 1 -#define GlintPatternRamData7Off 0x7b38 -#define GlintPatternRamData7Sec 0x8b38 -#define GlintPatternRamData7SecReg 3 -#define GlintPatternRamData7SecOff 0x7b38 - -#define GlintPatternRamData8 0x8b40 -#define GlintPatternRamData8Tag 0x0168 -#define GlintPatternRamData8Reg 1 -#define GlintPatternRamData8Off 0x7b40 -#define GlintPatternRamData8Sec 0x8b40 -#define GlintPatternRamData8SecReg 3 -#define GlintPatternRamData8SecOff 0x7b40 - -#define GlintPatternRamData9 0x8b48 -#define GlintPatternRamData9Tag 0x0169 -#define GlintPatternRamData9Reg 1 -#define GlintPatternRamData9Off 0x7b48 -#define GlintPatternRamData9Sec 0x8b48 -#define GlintPatternRamData9SecReg 3 -#define GlintPatternRamData9SecOff 0x7b48 - -#define GlintPatternRamData10 0x8b50 -#define GlintPatternRamData10Tag 0x016a -#define GlintPatternRamData10Reg 1 -#define GlintPatternRamData10Off 0x7b50 -#define GlintPatternRamData10Sec 0x8b50 -#define GlintPatternRamData10SecReg 3 -#define GlintPatternRamData10SecOff 0x7b50 - -#define GlintPatternRamData11 0x8b58 -#define GlintPatternRamData11Tag 0x016b -#define GlintPatternRamData11Reg 1 -#define GlintPatternRamData11Off 0x7b58 -#define GlintPatternRamData11Sec 0x8b58 -#define GlintPatternRamData11SecReg 3 -#define GlintPatternRamData11SecOff 0x7b58 - -#define GlintPatternRamData12 0x8b60 -#define GlintPatternRamData12Tag 0x016c -#define GlintPatternRamData12Reg 1 -#define GlintPatternRamData12Off 0x7b60 -#define GlintPatternRamData12Sec 0x8b60 -#define GlintPatternRamData12SecReg 3 -#define GlintPatternRamData12SecOff 0x7b60 - -#define GlintPatternRamData13 0x8b68 -#define GlintPatternRamData13Tag 0x016d -#define GlintPatternRamData13Reg 1 -#define GlintPatternRamData13Off 0x7b68 -#define GlintPatternRamData13Sec 0x8b68 -#define GlintPatternRamData13SecReg 3 -#define GlintPatternRamData13SecOff 0x7b68 - -#define GlintPatternRamData14 0x8b70 -#define GlintPatternRamData14Tag 0x016e -#define GlintPatternRamData14Reg 1 -#define GlintPatternRamData14Off 0x7b70 -#define GlintPatternRamData14Sec 0x8b70 -#define GlintPatternRamData14SecReg 3 -#define GlintPatternRamData14SecOff 0x7b70 - -#define GlintPatternRamData15 0x8b78 -#define GlintPatternRamData15Tag 0x016f -#define GlintPatternRamData15Reg 1 -#define GlintPatternRamData15Off 0x7b78 -#define GlintPatternRamData15Sec 0x8b78 -#define GlintPatternRamData15SecReg 3 -#define GlintPatternRamData15SecOff 0x7b78 - -#define GlintPatternRamData16 0x8b80 -#define GlintPatternRamData16Tag 0x0170 -#define GlintPatternRamData16Reg 1 -#define GlintPatternRamData16Off 0x7b80 -#define GlintPatternRamData16Sec 0x8b80 -#define GlintPatternRamData16SecReg 3 -#define GlintPatternRamData16SecOff 0x7b80 - -#define GlintPatternRamData17 0x8b88 -#define GlintPatternRamData17Tag 0x0171 -#define GlintPatternRamData17Reg 1 -#define GlintPatternRamData17Off 0x7b88 -#define GlintPatternRamData17Sec 0x8b88 -#define GlintPatternRamData17SecReg 3 -#define GlintPatternRamData17SecOff 0x7b88 - -#define GlintPatternRamData18 0x8b90 -#define GlintPatternRamData18Tag 0x0172 -#define GlintPatternRamData18Reg 1 -#define GlintPatternRamData18Off 0x7b90 -#define GlintPatternRamData18Sec 0x8b90 -#define GlintPatternRamData18SecReg 3 -#define GlintPatternRamData18SecOff 0x7b90 - -#define GlintPatternRamData19 0x8b98 -#define GlintPatternRamData19Tag 0x0173 -#define GlintPatternRamData19Reg 1 -#define GlintPatternRamData19Off 0x7b98 -#define GlintPatternRamData19Sec 0x8b98 -#define GlintPatternRamData19SecReg 3 -#define GlintPatternRamData19SecOff 0x7b98 - -#define GlintPatternRamData20 0x8ba0 -#define GlintPatternRamData20Tag 0x0174 -#define GlintPatternRamData20Reg 1 -#define GlintPatternRamData20Off 0x7ba0 -#define GlintPatternRamData20Sec 0x8ba0 -#define GlintPatternRamData20SecReg 3 -#define GlintPatternRamData20SecOff 0x7ba0 - -#define GlintPatternRamData21 0x8ba8 -#define GlintPatternRamData21Tag 0x0175 -#define GlintPatternRamData21Reg 1 -#define GlintPatternRamData21Off 0x7ba8 -#define GlintPatternRamData21Sec 0x8ba8 -#define GlintPatternRamData21SecReg 3 -#define GlintPatternRamData21SecOff 0x7ba8 - -#define GlintPatternRamData22 0x8bb0 -#define GlintPatternRamData22Tag 0x0176 -#define GlintPatternRamData22Reg 1 -#define GlintPatternRamData22Off 0x7bb0 -#define GlintPatternRamData22Sec 0x8bb0 -#define GlintPatternRamData22SecReg 3 -#define GlintPatternRamData22SecOff 0x7bb0 - -#define GlintPatternRamData23 0x8bb8 -#define GlintPatternRamData23Tag 0x0177 -#define GlintPatternRamData23Reg 1 -#define GlintPatternRamData23Off 0x7bb8 -#define GlintPatternRamData23Sec 0x8bb8 -#define GlintPatternRamData23SecReg 3 -#define GlintPatternRamData23SecOff 0x7bb8 - -#define GlintPatternRamData24 0x8bc0 -#define GlintPatternRamData24Tag 0x0178 -#define GlintPatternRamData24Reg 1 -#define GlintPatternRamData24Off 0x7bc0 -#define GlintPatternRamData24Sec 0x8bc0 -#define GlintPatternRamData24SecReg 3 -#define GlintPatternRamData24SecOff 0x7bc0 - -#define GlintPatternRamData25 0x8bc8 -#define GlintPatternRamData25Tag 0x0179 -#define GlintPatternRamData25Reg 1 -#define GlintPatternRamData25Off 0x7bc8 -#define GlintPatternRamData25Sec 0x8bc8 -#define GlintPatternRamData25SecReg 3 -#define GlintPatternRamData25SecOff 0x7bc8 - -#define GlintPatternRamData26 0x8bd0 -#define GlintPatternRamData26Tag 0x017a -#define GlintPatternRamData26Reg 1 -#define GlintPatternRamData26Off 0x7bd0 -#define GlintPatternRamData26Sec 0x8bd0 -#define GlintPatternRamData26SecReg 3 -#define GlintPatternRamData26SecOff 0x7bd0 - -#define GlintPatternRamData27 0x8bd8 -#define GlintPatternRamData27Tag 0x017b -#define GlintPatternRamData27Reg 1 -#define GlintPatternRamData27Off 0x7bd8 -#define GlintPatternRamData27Sec 0x8bd8 -#define GlintPatternRamData27SecReg 3 -#define GlintPatternRamData27SecOff 0x7bd8 - -#define GlintPatternRamData28 0x8be0 -#define GlintPatternRamData28Tag 0x017c -#define GlintPatternRamData28Reg 1 -#define GlintPatternRamData28Off 0x7be0 -#define GlintPatternRamData28Sec 0x8be0 -#define GlintPatternRamData28SecReg 3 -#define GlintPatternRamData28SecOff 0x7be0 - -#define GlintPatternRamData29 0x8be8 -#define GlintPatternRamData29Tag 0x017d -#define GlintPatternRamData29Reg 1 -#define GlintPatternRamData29Off 0x7be8 -#define GlintPatternRamData29Sec 0x8be8 -#define GlintPatternRamData29SecReg 3 -#define GlintPatternRamData29SecOff 0x7be8 - -#define GlintPatternRamData30 0x8bf0 -#define GlintPatternRamData30Tag 0x017e -#define GlintPatternRamData30Reg 1 -#define GlintPatternRamData30Off 0x7bf0 -#define GlintPatternRamData30Sec 0x8bf0 -#define GlintPatternRamData30SecReg 3 -#define GlintPatternRamData30SecOff 0x7bf0 - -#define GlintPatternRamData31 0x8bf8 -#define GlintPatternRamData31Tag 0x017f -#define GlintPatternRamData31Reg 1 -#define GlintPatternRamData31Off 0x7bf8 -#define GlintPatternRamData31Sec 0x8bf8 -#define GlintPatternRamData31SecReg 3 -#define GlintPatternRamData31SecOff 0x7bf8 - -#define GlintFBBlockColorU 0x8c68 -#define GlintFBBlockColorUTag 0x018d -#define GlintFBBlockColorUReg 1 -#define GlintFBBlockColorUOff 0x7c68 -#define GlintFBBlockColorUSec 0x8c68 -#define GlintFBBlockColorUSecReg 3 -#define GlintFBBlockColorUSecOff 0x7c68 - -#define GlintFBBlockColorL 0x8c70 -#define GlintFBBlockColorLTag 0x018e -#define GlintFBBlockColorLReg 1 -#define GlintFBBlockColorLOff 0x7c70 -#define GlintFBBlockColorLSec 0x8c70 -#define GlintFBBlockColorLSecReg 3 -#define GlintFBBlockColorLSecOff 0x7c70 - -#define GlintSuspendUntilFrameBlank 0x8c78 -#define GlintSuspendUntilFrameBlankTag 0x018f -#define GlintSuspendUntilFrameBlankReg 1 -#define GlintSuspendUntilFrameBlankOff 0x7c78 -#define GlintSuspendUntilFrameBlankSec 0x8c78 -#define GlintSuspendUntilFrameBlankSecReg 3 -#define GlintSuspendUntilFrameBlankSecOff 0x7c78 - -#define GlintFilterMode 0x8c00 -#define GlintFilterModeTag 0x0180 -#define GlintFilterModeReg 1 -#define GlintFilterModeOff 0x7c00 -#define GlintFilterModeSec 0x8c00 -#define GlintFilterModeSecReg 3 -#define GlintFilterModeSecOff 0x7c00 - -#define GlintStatisticMode 0x8c08 -#define GlintStatisticModeTag 0x0181 -#define GlintStatisticModeReg 1 -#define GlintStatisticModeOff 0x7c08 -#define GlintStatisticModeSec 0x8c08 -#define GlintStatisticModeSecReg 3 -#define GlintStatisticModeSecOff 0x7c08 - -#define GlintMinRegion 0x8c10 -#define GlintMinRegionTag 0x0182 -#define GlintMinRegionReg 1 -#define GlintMinRegionOff 0x7c10 -#define GlintMinRegionSec 0x8c10 -#define GlintMinRegionSecReg 3 -#define GlintMinRegionSecOff 0x7c10 - -#define GlintMaxRegion 0x8c18 -#define GlintMaxRegionTag 0x0183 -#define GlintMaxRegionReg 1 -#define GlintMaxRegionOff 0x7c18 -#define GlintMaxRegionSec 0x8c18 -#define GlintMaxRegionSecReg 3 -#define GlintMaxRegionSecOff 0x7c18 - -#define GlintResetPickResult 0x8c20 -#define GlintResetPickResultTag 0x0184 -#define GlintResetPickResultReg 1 -#define GlintResetPickResultOff 0x7c20 -#define GlintResetPickResultSec 0x8c20 -#define GlintResetPickResultSecReg 3 -#define GlintResetPickResultSecOff 0x7c20 - -#define GlintMitHitRegion 0x8c28 -#define GlintMitHitRegionTag 0x0185 -#define GlintMitHitRegionReg 1 -#define GlintMitHitRegionOff 0x7c28 -#define GlintMitHitRegionSec 0x8c28 -#define GlintMitHitRegionSecReg 3 -#define GlintMitHitRegionSecOff 0x7c28 - -#define GlintMaxHitRegion 0x8c30 -#define GlintMaxHitRegionTag 0x0186 -#define GlintMaxHitRegionReg 1 -#define GlintMaxHitRegionOff 0x7c30 -#define GlintMaxHitRegionSec 0x8c30 -#define GlintMaxHitRegionSecReg 3 -#define GlintMaxHitRegionSecOff 0x7c30 - -#define GlintPickResult 0x8c38 -#define GlintPickResultTag 0x0187 -#define GlintPickResultReg 1 -#define GlintPickResultOff 0x7c38 -#define GlintPickResultSec 0x8c38 -#define GlintPickResultSecReg 3 -#define GlintPickResultSecOff 0x7c38 - -#define GlintGLINTSync 0x8c40 -#define GlintGLINTSyncTag 0x0188 -#define GlintGLINTSyncReg 1 -#define GlintGLINTSyncOff 0x7c40 -#define GlintGLINTSyncSec 0x8c40 -#define GlintGLINTSyncSecReg 3 -#define GlintGLINTSyncSecOff 0x7c40 - -#define GlintKsRStart 0x8c80 -#define GlintKsRStartTag 0x0190 -#define GlintKsRStartReg 1 -#define GlintKsRStartOff 0x7c80 -#define GlintKsRStartSec 0x8c80 -#define GlintKsRStartSecReg 3 -#define GlintKsRStartSecOff 0x7c80 - -#define GlintdKsRdx 0x8c88 -#define GlintdKsRdxTag 0x0191 -#define GlintdKsRdxReg 1 -#define GlintdKsRdxOff 0x7c88 -#define GlintdKsRdxSec 0x8c88 -#define GlintdKsRdxSecReg 3 -#define GlintdKsRdxSecOff 0x7c88 - -#define GlintdKsRdyDom 0x8c90 -#define GlintdKsRdyDomTag 0x0192 -#define GlintdKsRdyDomReg 1 -#define GlintdKsRdyDomOff 0x7c90 -#define GlintdKsRdyDomSec 0x8c90 -#define GlintdKsRdyDomSecReg 3 -#define GlintdKsRdyDomSecOff 0x7c90 - -#define GlintKsGStart 0x8c98 -#define GlintKsGStartTag 0x0193 -#define GlintKsGStartReg 1 -#define GlintKsGStartOff 0x7c98 -#define GlintKsGStartSec 0x8c98 -#define GlintKsGStartSecReg 3 -#define GlintKsGStartSecOff 0x7c98 - -#define GlintdKsGdx 0x8ca0 -#define GlintdKsGdxTag 0x0194 -#define GlintdKsGdxReg 1 -#define GlintdKsGdxOff 0x7ca0 -#define GlintdKsGdxSec 0x8ca0 -#define GlintdKsGdxSecReg 3 -#define GlintdKsGdxSecOff 0x7ca0 - -#define GlintdKsGdyDom 0x8ca8 -#define GlintdKsGdyDomTag 0x0195 -#define GlintdKsGdyDomReg 1 -#define GlintdKsGdyDomOff 0x7ca8 -#define GlintdKsGdyDomSec 0x8ca8 -#define GlintdKsGdyDomSecReg 3 -#define GlintdKsGdyDomSecOff 0x7ca8 - -#define GlintKsBStart 0x8cb0 -#define GlintKsBStartTag 0x0196 -#define GlintKsBStartReg 1 -#define GlintKsBStartOff 0x7cb0 -#define GlintKsBStartSec 0x8cb0 -#define GlintKsBStartSecReg 3 -#define GlintKsBStartSecOff 0x7cb0 - -#define GlintdKsBdx 0x8cb8 -#define GlintdKsBdxTag 0x0197 -#define GlintdKsBdxReg 1 -#define GlintdKsBdxOff 0x7cb8 -#define GlintdKsBdxSec 0x8cb8 -#define GlintdKsBdxSecReg 3 -#define GlintdKsBdxSecOff 0x7cb8 - -#define GlintdKsBdyDom 0x8cc0 -#define GlintdKsBdyDomTag 0x0198 -#define GlintdKsBdyDomReg 1 -#define GlintdKsBdyDomOff 0x7cc0 -#define GlintdKsBdyDomSec 0x8cc0 -#define GlintdKsBdyDomSecReg 3 -#define GlintdKsBdyDomSecOff 0x7cc0 - -#define GlintKdRStart 0x8d00 -#define GlintKdRStartTag 0x01a0 -#define GlintKdRStartReg 1 -#define GlintKdRStartOff 0x7d00 -#define GlintKdRStartSec 0x8d00 -#define GlintKdRStartSecReg 3 -#define GlintKdRStartSecOff 0x7d00 - -#define GlintdKdRdx 0x8d08 -#define GlintdKdRdxTag 0x01a1 -#define GlintdKdRdxReg 1 -#define GlintdKdRdxOff 0x7d08 -#define GlintdKdRdxSec 0x8d08 -#define GlintdKdRdxSecReg 3 -#define GlintdKdRdxSecOff 0x7d08 - -#define GlintdKdRdyDom 0x8d10 -#define GlintdKdRdyDomTag 0x01a2 -#define GlintdKdRdyDomReg 1 -#define GlintdKdRdyDomOff 0x7d10 -#define GlintdKdRdyDomSec 0x8d10 -#define GlintdKdRdyDomSecReg 3 -#define GlintdKdRdyDomSecOff 0x7d10 - -#define GlintKdGStart 0x8d18 -#define GlintKdGStartTag 0x01a3 -#define GlintKdGStartReg 1 -#define GlintKdGStartOff 0x7d18 -#define GlintKdGStartSec 0x8d18 -#define GlintKdGStartSecReg 3 -#define GlintKdGStartSecOff 0x7d18 - -#define GlintdKdGdx 0x8d20 -#define GlintdKdGdxTag 0x01a4 -#define GlintdKdGdxReg 1 -#define GlintdKdGdxOff 0x7d20 -#define GlintdKdGdxSec 0x8d20 -#define GlintdKdGdxSecReg 3 -#define GlintdKdGdxSecOff 0x7d20 - -#define GlintdKdGdyDom 0x8d28 -#define GlintdKdGdyDomTag 0x01a5 -#define GlintdKdGdyDomReg 1 -#define GlintdKdGdyDomOff 0x7d28 -#define GlintdKdGdyDomSec 0x8d28 -#define GlintdKdGdyDomSecReg 3 -#define GlintdKdGdyDomSecOff 0x7d28 - -#define GlintKdBStart 0x8d30 -#define GlintKdBStartTag 0x01a6 -#define GlintKdBStartReg 1 -#define GlintKdBStartOff 0x7d30 -#define GlintKdBStartSec 0x8d30 -#define GlintKdBStartSecReg 3 -#define GlintKdBStartSecOff 0x7d30 - -#define GlintdKdBdx 0x8d38 -#define GlintdKdBdxTag 0x01a7 -#define GlintdKdBdxReg 1 -#define GlintdKdBdxOff 0x7d38 -#define GlintdKdBdxSec 0x8d38 -#define GlintdKdBdxSecReg 3 -#define GlintdKdBdxSecOff 0x7d38 - -#define GlintdKdBdyDom 0x8d40 -#define GlintdKdBdyDomTag 0x01a8 -#define GlintdKdBdyDomReg 1 -#define GlintdKdBdyDomOff 0x7d40 -#define GlintdKdBdyDomSec 0x8d40 -#define GlintdKdBdyDomSecReg 3 -#define GlintdKdBdyDomSecOff 0x7d40 - -#define GlintContextDump 0x8dc0 -#define GlintContextDumpTag 0x01b8 -#define GlintContextDumpReg 1 -#define GlintContextDumpOff 0x7dc0 - -#define GlintContextRestore 0x8dc8 -#define GlintContextRestoreTag 0x01b9 -#define GlintContextRestoreReg 1 -#define GlintContextRestoreOff 0x7dc8 - -#define GlintContextData 0x8dd0 -#define GlintContextDataTag 0x01ba -#define GlintContextDataReg 1 -#define GlintContextDataOff 0x7dd0 - -#define GlintFeedbackToken 0x8f80 -#define GlintFeedbackTokenTag 0x01f0 -#define GlintFeedbackTokenReg 1 -#define GlintFeedbackTokenOff 0x7f80 - -#define GlintFeedbackX 0x8f88 -#define GlintFeedbackXTag 0x01f1 -#define GlintFeedbackXReg 1 -#define GlintFeedbackXOff 0x7f88 - -#define GlintFeedbackY 0x8f90 -#define GlintFeedbackYTag 0x01f2 -#define GlintFeedbackYReg 1 -#define GlintFeedbackYOff 0x7f90 - -#define GlintFeedbackZ 0x8f98 -#define GlintFeedbackZTag 0x01f3 -#define GlintFeedbackZReg 1 -#define GlintFeedbackZOff 0x7f98 - -#define GlintFeedbackW 0x8fa0 -#define GlintFeedbackWTag 0x01f4 -#define GlintFeedbackWReg 1 -#define GlintFeedbackWOff 0x7fa0 - -#define GlintFeedbackRed 0x8fa8 -#define GlintFeedbackRedTag 0x01f5 -#define GlintFeedbackRedReg 1 -#define GlintFeedbackRedOff 0x7fa8 - -#define GlintFeedbackGreen 0x8fb0 -#define GlintFeedbackGreenTag 0x01f6 -#define GlintFeedbackGreenReg 1 -#define GlintFeedbackGreenOff 0x7fb0 - -#define GlintFeedbackBlue 0x8fb8 -#define GlintFeedbackBlueTag 0x01f7 -#define GlintFeedbackBlueReg 1 -#define GlintFeedbackBlueOff 0x7fb8 - -#define GlintFeedbackAlpha 0x8fc0 -#define GlintFeedbackAlphaTag 0x01f8 -#define GlintFeedbackAlphaReg 1 -#define GlintFeedbackAlphaOff 0x7fc0 - -#define GlintFeedbackS 0x8fc8 -#define GlintFeedbackSTag 0x01f9 -#define GlintFeedbackSReg 1 -#define GlintFeedbackSOff 0x7fc8 - -#define GlintFeedbackT 0x8fd0 -#define GlintFeedbackTTag 0x01fa -#define GlintFeedbackTReg 1 -#define GlintFeedbackTOff 0x7fd0 - -#define GlintFeedbackR 0x8fd8 -#define GlintFeedbackRTag 0x01fb -#define GlintFeedbackRReg 1 -#define GlintFeedbackROff 0x7fd8 - -#define GlintFeedbackQ 0x8fe0 -#define GlintFeedbackQTag 0x01fc -#define GlintFeedbackQReg 1 -#define GlintFeedbackQOff 0x7fe0 - -#define GlintSelectRecord 0x8fe8 -#define GlintSelectRecordTag 0x01fd -#define GlintSelectRecordReg 1 -#define GlintSelectRecordOff 0x7fe8 - -#define GlintPassThrough 0x8ff0 -#define GlintPassThroughTag 0x01fe -#define GlintPassThroughReg 1 -#define GlintPassThroughOff 0x7ff0 - -#define GlintEndOfFeedback 0x8ff8 -#define GlintEndOfFeedbackTag 0x01ff -#define GlintEndOfFeedbackReg 1 -#define GlintEndOfFeedbackOff 0x7ff8 - -#define GlintV0FixedS 0x9000 -#define GlintV0FixedSTag 0x0200 -#define GlintV0FixedSReg 1 -#define GlintV0FixedSOff 0x8000 - -#define GlintV0FixedT 0x9008 -#define GlintV0FixedTTag 0x0201 -#define GlintV0FixedTReg 1 -#define GlintV0FixedTOff 0x8008 - -#define GlintV0FixedQ 0x9010 -#define GlintV0FixedQTag 0x0202 -#define GlintV0FixedQReg 1 -#define GlintV0FixedQOff 0x8010 - -#define GlintV0FixedKs 0x9018 -#define GlintV0FixedKsTag 0x0203 -#define GlintV0FixedKsReg 1 -#define GlintV0FixedKsOff 0x8018 - -#define GlintV0FixedKd 0x9020 -#define GlintV0FixedKdTag 0x0204 -#define GlintV0FixedKdReg 1 -#define GlintV0FixedKdOff 0x8020 - -#define GlintV0FixedR 0x9028 -#define GlintV0FixedRTag 0x0205 -#define GlintV0FixedRReg 1 -#define GlintV0FixedROff 0x8028 - -#define GlintV0FixedG 0x9030 -#define GlintV0FixedGTag 0x0206 -#define GlintV0FixedGReg 1 -#define GlintV0FixedGOff 0x8030 - -#define GlintV0FixedB 0x9038 -#define GlintV0FixedBTag 0x0207 -#define GlintV0FixedBReg 1 -#define GlintV0FixedBOff 0x8038 - -#define GlintV0FixedA 0x9040 -#define GlintV0FixedATag 0x0208 -#define GlintV0FixedAReg 1 -#define GlintV0FixedAOff 0x8040 - -#define GlintV0FixedF 0x9048 -#define GlintV0FixedFTag 0x0209 -#define GlintV0FixedFReg 1 -#define GlintV0FixedFOff 0x8048 - -#define GlintV0FixedX 0x9050 -#define GlintV0FixedXTag 0x020a -#define GlintV0FixedXReg 1 -#define GlintV0FixedXOff 0x8050 - -#define GlintV0FixedY 0x9058 -#define GlintV0FixedYTag 0x020b -#define GlintV0FixedYReg 1 -#define GlintV0FixedYOff 0x8058 - -#define GlintV0FixedZ 0x9060 -#define GlintV0FixedZTag 0x020c -#define GlintV0FixedZReg 1 -#define GlintV0FixedZOff 0x8060 - -#define GlintV1FixedS 0x9080 -#define GlintV1FixedSTag 0x0210 -#define GlintV1FixedSReg 1 -#define GlintV1FixedSOff 0x8080 - -#define GlintV1FixedT 0x9088 -#define GlintV1FixedTTag 0x0211 -#define GlintV1FixedTReg 1 -#define GlintV1FixedTOff 0x8088 - -#define GlintV1FixedQ 0x9090 -#define GlintV1FixedQTag 0x0212 -#define GlintV1FixedQReg 1 -#define GlintV1FixedQOff 0x8090 - -#define GlintV1FixedKs 0x9098 -#define GlintV1FixedKsTag 0x0213 -#define GlintV1FixedKsReg 1 -#define GlintV1FixedKsOff 0x8098 - -#define GlintV1FixedKd 0x90a0 -#define GlintV1FixedKdTag 0x0214 -#define GlintV1FixedKdReg 1 -#define GlintV1FixedKdOff 0x80a0 - -#define GlintV1FixedR 0x90a8 -#define GlintV1FixedRTag 0x0215 -#define GlintV1FixedRReg 1 -#define GlintV1FixedROff 0x80a8 - -#define GlintV1FixedG 0x90b0 -#define GlintV1FixedGTag 0x0216 -#define GlintV1FixedGReg 1 -#define GlintV1FixedGOff 0x80b0 - -#define GlintV1FixedB 0x90b8 -#define GlintV1FixedBTag 0x0217 -#define GlintV1FixedBReg 1 -#define GlintV1FixedBOff 0x80b8 - -#define GlintV1FixedA 0x90c0 -#define GlintV1FixedATag 0x0218 -#define GlintV1FixedAReg 1 -#define GlintV1FixedAOff 0x80c0 - -#define GlintV1FixedF 0x90c8 -#define GlintV1FixedFTag 0x0219 -#define GlintV1FixedFReg 1 -#define GlintV1FixedFOff 0x80c8 - -#define GlintV1FixedX 0x90d0 -#define GlintV1FixedXTag 0x021a -#define GlintV1FixedXReg 1 -#define GlintV1FixedXOff 0x80d0 - -#define GlintV1FixedY 0x90d8 -#define GlintV1FixedYTag 0x021b -#define GlintV1FixedYReg 1 -#define GlintV1FixedYOff 0x80d8 - -#define GlintV1FixedZ 0x90e0 -#define GlintV1FixedZTag 0x021c -#define GlintV1FixedZReg 1 -#define GlintV1FixedZOff 0x80e0 - -#define GlintV2FixedS 0x9100 -#define GlintV2FixedSTag 0x0220 -#define GlintV2FixedSReg 1 -#define GlintV2FixedSOff 0x8100 - -#define GlintV2FixedT 0x9108 -#define GlintV2FixedTTag 0x0221 -#define GlintV2FixedTReg 1 -#define GlintV2FixedTOff 0x8108 - -#define GlintV2FixedQ 0x9110 -#define GlintV2FixedQTag 0x0222 -#define GlintV2FixedQReg 1 -#define GlintV2FixedQOff 0x8110 - -#define GlintV2FixedKs 0x9118 -#define GlintV2FixedKsTag 0x0223 -#define GlintV2FixedKsReg 1 -#define GlintV2FixedKsOff 0x8118 - -#define GlintV2FixedKd 0x9120 -#define GlintV2FixedKdTag 0x0224 -#define GlintV2FixedKdReg 1 -#define GlintV2FixedKdOff 0x8120 - -#define GlintV2FixedR 0x9128 -#define GlintV2FixedRTag 0x0225 -#define GlintV2FixedRReg 1 -#define GlintV2FixedROff 0x8128 - -#define GlintV2FixedG 0x9130 -#define GlintV2FixedGTag 0x0226 -#define GlintV2FixedGReg 1 -#define GlintV2FixedGOff 0x8130 - -#define GlintV2FixedB 0x9138 -#define GlintV2FixedBTag 0x0227 -#define GlintV2FixedBReg 1 -#define GlintV2FixedBOff 0x8138 - -#define GlintV2FixedA 0x9140 -#define GlintV2FixedATag 0x0228 -#define GlintV2FixedAReg 1 -#define GlintV2FixedAOff 0x8140 - -#define GlintV2FixedF 0x9148 -#define GlintV2FixedFTag 0x0229 -#define GlintV2FixedFReg 1 -#define GlintV2FixedFOff 0x8148 - -#define GlintV2FixedX 0x9150 -#define GlintV2FixedXTag 0x022a -#define GlintV2FixedXReg 1 -#define GlintV2FixedXOff 0x8150 - -#define GlintV2FixedY 0x9158 -#define GlintV2FixedYTag 0x022b -#define GlintV2FixedYReg 1 -#define GlintV2FixedYOff 0x8158 - -#define GlintV2FixedZ 0x9160 -#define GlintV2FixedZTag 0x022c -#define GlintV2FixedZReg 1 -#define GlintV2FixedZOff 0x8160 - -#define GlintV0FloatS 0x9180 -#define GlintV0FloatSTag 0x0230 -#define GlintV0FloatSReg 1 -#define GlintV0FloatSOff 0x8180 - -#define GlintV0FloatT 0x9188 -#define GlintV0FloatTTag 0x0231 -#define GlintV0FloatTReg 1 -#define GlintV0FloatTOff 0x8188 - -#define GlintV0FloatQ 0x9190 -#define GlintV0FloatQTag 0x0232 -#define GlintV0FloatQReg 1 -#define GlintV0FloatQOff 0x8190 - -#define GlintV0FloatKs 0x9198 -#define GlintV0FloatKsTag 0x0233 -#define GlintV0FloatKsReg 1 -#define GlintV0FloatKsOff 0x8198 - -#define GlintV0FloatKd 0x91a0 -#define GlintV0FloatKdTag 0x0234 -#define GlintV0FloatKdReg 1 -#define GlintV0FloatKdOff 0x81a0 - -#define GlintV0FloatR 0x91a8 -#define GlintV0FloatRTag 0x0235 -#define GlintV0FloatRReg 1 -#define GlintV0FloatROff 0x81a8 - -#define GlintV0FloatG 0x91b0 -#define GlintV0FloatGTag 0x0236 -#define GlintV0FloatGReg 1 -#define GlintV0FloatGOff 0x81b0 - -#define GlintV0FloatB 0x91b8 -#define GlintV0FloatBTag 0x0237 -#define GlintV0FloatBReg 1 -#define GlintV0FloatBOff 0x81b8 - -#define GlintV0FloatA 0x91c0 -#define GlintV0FloatATag 0x0238 -#define GlintV0FloatAReg 1 -#define GlintV0FloatAOff 0x81c0 - -#define GlintV0FloatF 0x91c8 -#define GlintV0FloatFTag 0x0239 -#define GlintV0FloatFReg 1 -#define GlintV0FloatFOff 0x81c8 - -#define GlintV0FloatX 0x91d0 -#define GlintV0FloatXTag 0x023a -#define GlintV0FloatXReg 1 -#define GlintV0FloatXOff 0x81d0 - -#define GlintV0FloatY 0x91d8 -#define GlintV0FloatYTag 0x023b -#define GlintV0FloatYReg 1 -#define GlintV0FloatYOff 0x81d8 - -#define GlintV0FloatZ 0x91e0 -#define GlintV0FloatZTag 0x023c -#define GlintV0FloatZReg 1 -#define GlintV0FloatZOff 0x81e0 - -#define GlintV1FloatS 0x9200 -#define GlintV1FloatSTag 0x0240 -#define GlintV1FloatSReg 1 -#define GlintV1FloatSOff 0x8200 - -#define GlintV1FloatT 0x9208 -#define GlintV1FloatTTag 0x0241 -#define GlintV1FloatTReg 1 -#define GlintV1FloatTOff 0x8208 - -#define GlintV1FloatQ 0x9210 -#define GlintV1FloatQTag 0x0242 -#define GlintV1FloatQReg 1 -#define GlintV1FloatQOff 0x8210 - -#define GlintV1FloatKs 0x9218 -#define GlintV1FloatKsTag 0x0243 -#define GlintV1FloatKsReg 1 -#define GlintV1FloatKsOff 0x8218 - -#define GlintV1FloatKd 0x9220 -#define GlintV1FloatKdTag 0x0244 -#define GlintV1FloatKdReg 1 -#define GlintV1FloatKdOff 0x8220 - -#define GlintV1FloatR 0x9228 -#define GlintV1FloatRTag 0x0245 -#define GlintV1FloatRReg 1 -#define GlintV1FloatROff 0x8228 - -#define GlintV1FloatG 0x9230 -#define GlintV1FloatGTag 0x0246 -#define GlintV1FloatGReg 1 -#define GlintV1FloatGOff 0x8230 - -#define GlintV1FloatB 0x9238 -#define GlintV1FloatBTag 0x0247 -#define GlintV1FloatBReg 1 -#define GlintV1FloatBOff 0x8238 - -#define GlintV1FloatA 0x9240 -#define GlintV1FloatATag 0x0248 -#define GlintV1FloatAReg 1 -#define GlintV1FloatAOff 0x8240 - -#define GlintV1FloatF 0x9248 -#define GlintV1FloatFTag 0x0249 -#define GlintV1FloatFReg 1 -#define GlintV1FloatFOff 0x8248 - -#define GlintV1FloatX 0x9250 -#define GlintV1FloatXTag 0x024a -#define GlintV1FloatXReg 1 -#define GlintV1FloatXOff 0x8250 - -#define GlintV1FloatY 0x9258 -#define GlintV1FloatYTag 0x024b -#define GlintV1FloatYReg 1 -#define GlintV1FloatYOff 0x8258 - -#define GlintV1FloatZ 0x9260 -#define GlintV1FloatZTag 0x024c -#define GlintV1FloatZReg 1 -#define GlintV1FloatZOff 0x8260 - -#define GlintV2FloatS 0x9280 -#define GlintV2FloatSTag 0x0250 -#define GlintV2FloatSReg 1 -#define GlintV2FloatSOff 0x8280 - -#define GlintV2FloatT 0x9288 -#define GlintV2FloatTTag 0x0251 -#define GlintV2FloatTReg 1 -#define GlintV2FloatTOff 0x8288 - -#define GlintV2FloatQ 0x9290 -#define GlintV2FloatQTag 0x0252 -#define GlintV2FloatQReg 1 -#define GlintV2FloatQOff 0x8290 - -#define GlintV2FloatKs 0x9298 -#define GlintV2FloatKsTag 0x0253 -#define GlintV2FloatKsReg 1 -#define GlintV2FloatKsOff 0x8298 - -#define GlintV2FloatKd 0x92a0 -#define GlintV2FloatKdTag 0x0254 -#define GlintV2FloatKdReg 1 -#define GlintV2FloatKdOff 0x82a0 - -#define GlintV2FloatR 0x92a8 -#define GlintV2FloatRTag 0x0255 -#define GlintV2FloatRReg 1 -#define GlintV2FloatROff 0x82a8 - -#define GlintV2FloatG 0x92b0 -#define GlintV2FloatGTag 0x0256 -#define GlintV2FloatGReg 1 -#define GlintV2FloatGOff 0x82b0 - -#define GlintV2FloatB 0x92b8 -#define GlintV2FloatBTag 0x0257 -#define GlintV2FloatBReg 1 -#define GlintV2FloatBOff 0x82b8 - -#define GlintV2FloatA 0x92c0 -#define GlintV2FloatATag 0x0258 -#define GlintV2FloatAReg 1 -#define GlintV2FloatAOff 0x82c0 - -#define GlintV2FloatF 0x92c8 -#define GlintV2FloatFTag 0x0259 -#define GlintV2FloatFReg 1 -#define GlintV2FloatFOff 0x82c8 - -#define GlintV2FloatX 0x92d0 -#define GlintV2FloatXTag 0x025a -#define GlintV2FloatXReg 1 -#define GlintV2FloatXOff 0x82d0 - -#define GlintV2FloatY 0x92d8 -#define GlintV2FloatYTag 0x025b -#define GlintV2FloatYReg 1 -#define GlintV2FloatYOff 0x82d8 - -#define GlintV2FloatZ 0x92e0 -#define GlintV2FloatZTag 0x025c -#define GlintV2FloatZReg 1 -#define GlintV2FloatZOff 0x82e0 - -#define GlintDeltaMode 0x9300 -#define GlintDeltaModeTag 0x0260 -#define GlintDeltaModeReg 1 -#define GlintDeltaModeOff 0x8300 - -#define GlintDrawTriangle 0x9308 -#define GlintDrawTriangleTag 0x0261 -#define GlintDrawTriangleReg 1 -#define GlintDrawTriangleOff 0x8308 - -#define GlintRepeatTriangle 0x9310 -#define GlintRepeatTriangleTag 0x0262 -#define GlintRepeatTriangleReg 1 -#define GlintRepeatTriangleOff 0x8310 - -#define GlintDrawLine01 0x9318 -#define GlintDrawLine01Tag 0x0263 -#define GlintDrawLine01Reg 1 -#define GlintDrawLine01Off 0x8318 - -#define GlintDrawLine10 0x9320 -#define GlintDrawLine10Tag 0x0264 -#define GlintDrawLine10Reg 1 -#define GlintDrawLine10Off 0x8320 - -#define GlintRepeatLine 0x9328 -#define GlintRepeatLineTag 0x0265 -#define GlintRepeatLineReg 1 -#define GlintRepeatLineOff 0x8328 - -#define GlintEpilogueTag 0x9368 -#define GlintEpilogueTagTag 0x026d -#define GlintEpilogueTagReg 1 -#define GlintEpilogueTagOff 0x8368 - -#define GlintEpilogueData 0x9370 -#define GlintEpilogueDataTag 0x026e -#define GlintEpilogueDataReg 1 -#define GlintEpilogueDataOff 0x8370 - -#define GlintBroadcastMask 0x9378 -#define GlintBroadcastMaskTag 0x026f -#define GlintBroadcastMaskReg 1 -#define GlintBroadcastMaskOff 0x8378 - -#define GlintXBias 0x9480 -#define GlintXBiasTag 0x0290 -#define GlintXBiasReg 1 -#define GlintXBiasOff 0x8480 - -#define GlintYBias 0x9488 -#define GlintYBiasTag 0x0291 -#define GlintYBiasReg 1 -#define GlintYBiasOff 0x8488 - -#define GlintPointMode 0x9490 -#define GlintPointModeTag 0x0292 -#define GlintPointModeReg 1 -#define GlintPointModeOff 0x8490 - -#define GlintPointSize 0x9498 -#define GlintPointSizeTag 0x0293 -#define GlintPointSizeReg 1 -#define GlintPointSizeOff 0x8498 - -#define GlintAApointSize 0x94a0 -#define GlintAApointSizeTag 0x0294 -#define GlintAApointSizeReg 1 -#define GlintAApointSizeOff 0x84a0 - -#define GlintLineMode 0x94a8 -#define GlintLineModeTag 0x0295 -#define GlintLineModeReg 1 -#define GlintLineModeOff 0x84a8 - -#define GlintLineWidth 0x94b0 -#define GlintLineWidthTag 0x0296 -#define GlintLineWidthReg 1 -#define GlintLineWidthOff 0x84b0 - -#define GlintLineWidthOffset 0x94b8 -#define GlintLineWidthOffsetTag 0x0297 -#define GlintLineWidthOffsetReg 1 -#define GlintLineWidthOffsetOff 0x84b8 - -#define GlintAAlineWidth 0x94c0 -#define GlintAAlineWidthTag 0x0298 -#define GlintAAlineWidthReg 1 -#define GlintAAlineWidthOff 0x84c0 - -#define GlintTriangleMode 0x94c8 -#define GlintTriangleModeTag 0x0299 -#define GlintTriangleModeReg 1 -#define GlintTriangleModeOff 0x84c8 - -#define GlintRectangleMode 0x94d0 -#define GlintRectangleModeTag 0x029a -#define GlintRectangleModeReg 1 -#define GlintRectangleModeOff 0x84d0 - -#define GlintRectangleWidth 0x94d8 -#define GlintRectangleWidthTag 0x029b -#define GlintRectangleWidthReg 1 -#define GlintRectangleWidthOff 0x84d8 - -#define GlintRectangleHeight 0x94e0 -#define GlintRectangleHeightTag 0x029c -#define GlintRectangleHeightReg 1 -#define GlintRectangleHeightOff 0x84e0 - -#define GlintRectangle2DMode 0x94e8 -#define GlintRectangle2DModeTag 0x029d -#define GlintRectangle2DModeReg 1 -#define GlintRectangle2DModeOff 0x84e8 - -#define GlintRectangle2DControl 0x94f0 -#define GlintRectangle2DControlTag 0x029e -#define GlintRectangle2DControlReg 1 -#define GlintRectangle2DControlOff 0x84f0 - -#define GlintTransformMode 0x9508 -#define GlintTransformModeTag 0x02a1 -#define GlintTransformModeReg 1 -#define GlintTransformModeOff 0x8508 - -#define GlintGeometryMode 0x9510 -#define GlintGeometryModeTag 0x02a2 -#define GlintGeometryModeReg 1 -#define GlintGeometryModeOff 0x8510 - -#define GlintNormalizeMode 0x9518 -#define GlintNormalizeModeTag 0x02a3 -#define GlintNormalizeModeReg 1 -#define GlintNormalizeModeOff 0x8518 - -#define GlintLightingMode 0x9520 -#define GlintLightingModeTag 0x02a4 -#define GlintLightingModeReg 1 -#define GlintLightingModeOff 0x8520 - -#define GlintColorMaterialMode 0x9528 -#define GlintColorMaterialModeTag 0x02a5 -#define GlintColorMaterialModeReg 1 -#define GlintColorMaterialModeOff 0x8528 - -#define GlintMaterialMode 0x9530 -#define GlintMaterialModeTag 0x02a6 -#define GlintMaterialModeReg 1 -#define GlintMaterialModeOff 0x8530 - -#define GlintSelectResult 0x9580 -#define GlintSelectResultTag 0x02b0 -#define GlintSelectResultReg 1 -#define GlintSelectResultOff 0x8580 - -#define GlintBegin 0x9590 -#define GlintBeginTag 0x02b2 -#define GlintBeginReg 1 -#define GlintBeginOff 0x8590 - -#define GlintEnd 0x9598 -#define GlintEndTag 0x02b3 -#define GlintEndReg 1 -#define GlintEndOff 0x8598 - -#define GlintEdgeFlag 0x95a0 -#define GlintEdgeFlagTag 0x02b4 -#define GlintEdgeFlagReg 1 -#define GlintEdgeFlagOff 0x85a0 - -#define GlintObjectIDvalue 0x95a8 -#define GlintObjectIDvalueTag 0x02b5 -#define GlintObjectIDvalueReg 1 -#define GlintObjectIDvalueOff 0x85a8 - -#define GlintIncrementObjectID 0x95b0 -#define GlintIncrementObjectIDTag 0x02b6 -#define GlintIncrementObjectIDReg 1 -#define GlintIncrementObjectIDOff 0x85b0 - -#define GlintTransformCurrent 0x95b8 -#define GlintTransformCurrentTag 0x02b7 -#define GlintTransformCurrentReg 1 -#define GlintTransformCurrentOff 0x85b8 - -#define GlintSaveCurrent 0x95c8 -#define GlintSaveCurrentTag 0x02b9 -#define GlintSaveCurrentReg 1 -#define GlintSaveCurrentOff 0x85c8 - -#define GlintRestoreCurrent 0x95d0 -#define GlintRestoreCurrentTag 0x02ba -#define GlintRestoreCurrentReg 1 -#define GlintRestoreCurrentOff 0x85d0 - -#define GlintInitNames 0x95d8 -#define GlintInitNamesTag 0x02bb -#define GlintInitNamesReg 1 -#define GlintInitNamesOff 0x85d8 - -#define GlintPushName 0x95e0 -#define GlintPushNameTag 0x02bc -#define GlintPushNameReg 1 -#define GlintPushNameOff 0x85e0 - -#define GlintPopName 0x95e8 -#define GlintPopNameTag 0x02bd -#define GlintPopNameReg 1 -#define GlintPopNameOff 0x85e8 - -#define GlintLoadName 0x95f0 -#define GlintLoadNameTag 0x02be -#define GlintLoadNameReg 1 -#define GlintLoadNameOff 0x85f0 - -#define GlintGeomRectangle 0x96a0 -#define GlintGeomRectangleTag 0x02d4 -#define GlintGeomRectangleReg 1 -#define GlintGeomRectangleOff 0x86a0 - -#define GlintDrawRectangle2D 0x97a0 -#define GlintDrawRectangle2DTag 0x02f4 -#define GlintDrawRectangle2DReg 1 -#define GlintDrawRectangle2DOff 0x87a0 - -#define GlintNz 0x9800 -#define GlintNzTag 0x0300 -#define GlintNzReg 1 -#define GlintNzOff 0x8800 - -#define GlintNy 0x9808 -#define GlintNyTag 0x0301 -#define GlintNyReg 1 -#define GlintNyOff 0x8808 - -#define GlintNx 0x9810 -#define GlintNxTag 0x0302 -#define GlintNxReg 1 -#define GlintNxOff 0x8810 - -#define GlintCa 0x9818 -#define GlintCaTag 0x0303 -#define GlintCaReg 1 -#define GlintCaOff 0x8818 - -#define GlintCb 0x9820 -#define GlintCbTag 0x0304 -#define GlintCbReg 1 -#define GlintCbOff 0x8820 - -#define GlintCg 0x9828 -#define GlintCgTag 0x0305 -#define GlintCgReg 1 -#define GlintCgOff 0x8828 - -#define GlintCr3 0x9830 -#define GlintCr3Tag 0x0306 -#define GlintCr3Reg 1 -#define GlintCr3Off 0x8830 - -#define GlintCr4 0x9838 -#define GlintCr4Tag 0x0307 -#define GlintCr4Reg 1 -#define GlintCr4Off 0x8838 - -#define GlintTt2 0x9840 -#define GlintTt2Tag 0x0308 -#define GlintTt2Reg 1 -#define GlintTt2Off 0x8840 - -#define GlintTs2 0x9848 -#define GlintTs2Tag 0x0309 -#define GlintTs2Reg 1 -#define GlintTs2Off 0x8848 - -#define GlintVw 0x9850 -#define GlintVwTag 0x030a -#define GlintVwReg 1 -#define GlintVwOff 0x8850 - -#define GlintVz 0x9858 -#define GlintVzTag 0x030b -#define GlintVzReg 1 -#define GlintVzOff 0x8858 - -#define GlintVy 0x9860 -#define GlintVyTag 0x030c -#define GlintVyReg 1 -#define GlintVyOff 0x8860 - -#define GlintVx2 0x9868 -#define GlintVx2Tag 0x030d -#define GlintVx2Reg 1 -#define GlintVx2Off 0x8868 - -#define GlintVx3 0x9870 -#define GlintVx3Tag 0x030e -#define GlintVx3Reg 1 -#define GlintVx3Off 0x8870 - -#define GlintVx4 0x9878 -#define GlintVx4Tag 0x030f -#define GlintVx4Reg 1 -#define GlintVx4Off 0x8878 - -#define GlintFNz 0x9880 -#define GlintFNzTag 0x0310 -#define GlintFNzReg 1 -#define GlintFNzOff 0x8880 - -#define GlintFNy 0x9888 -#define GlintFNyTag 0x0311 -#define GlintFNyReg 1 -#define GlintFNyOff 0x8888 - -#define GlintFNx 0x9890 -#define GlintFNxTag 0x0312 -#define GlintFNxReg 1 -#define GlintFNxOff 0x8890 - -#define GlintPackedColor3 0x9898 -#define GlintPackedColor3Tag 0x0313 -#define GlintPackedColor3Reg 1 -#define GlintPackedColor3Off 0x8898 - -#define GlintPackedColor4 0x98a0 -#define GlintPackedColor4Tag 0x0314 -#define GlintPackedColor4Reg 1 -#define GlintPackedColor4Off 0x88a0 - -#define GlintTq4 0x98a8 -#define GlintTq4Tag 0x0315 -#define GlintTq4Reg 1 -#define GlintTq4Off 0x88a8 - -#define GlintTr4 0x98b0 -#define GlintTr4Tag 0x0316 -#define GlintTr4Reg 1 -#define GlintTr4Off 0x88b0 - -#define GlintTt4 0x98b8 -#define GlintTt4Tag 0x0317 -#define GlintTt4Reg 1 -#define GlintTt4Off 0x88b8 - -#define GlintTs4 0x98c0 -#define GlintTs4Tag 0x0318 -#define GlintTs4Reg 1 -#define GlintTs4Off 0x88c0 - -#define GlintRPw 0x98c8 -#define GlintRPwTag 0x0319 -#define GlintRPwReg 1 -#define GlintRPwOff 0x88c8 - -#define GlintRPz 0x98d0 -#define GlintRPzTag 0x031a -#define GlintRPzReg 1 -#define GlintRPzOff 0x88d0 - -#define GlintRPy 0x98d8 -#define GlintRPyTag 0x031b -#define GlintRPyReg 1 -#define GlintRPyOff 0x88d8 - -#define GlintRPx2 0x98e0 -#define GlintRPx2Tag 0x031c -#define GlintRPx2Reg 1 -#define GlintRPx2Off 0x88e0 - -#define GlintRPx3 0x98e8 -#define GlintRPx3Tag 0x031d -#define GlintRPx3Reg 1 -#define GlintRPx3Off 0x88e8 - -#define GlintRPx4 0x98f0 -#define GlintRPx4Tag 0x031e -#define GlintRPx4Reg 1 -#define GlintRPx4Off 0x88f0 - -#define GlintTs1 0x98f8 -#define GlintTs1Tag 0x031f -#define GlintTs1Reg 1 -#define GlintTs1Off 0x88f8 - -#define GlintModelViewMatrix0 0x9900 -#define GlintModelViewMatrix0Tag 0x0320 -#define GlintModelViewMatrix0Reg 1 -#define GlintModelViewMatrix0Off 0x8900 - -#define GlintModelViewMatrix1 0x9908 -#define GlintModelViewMatrix1Tag 0x0321 -#define GlintModelViewMatrix1Reg 1 -#define GlintModelViewMatrix1Off 0x8908 - -#define GlintModelViewMatrix2 0x9910 -#define GlintModelViewMatrix2Tag 0x0322 -#define GlintModelViewMatrix2Reg 1 -#define GlintModelViewMatrix2Off 0x8910 - -#define GlintModelViewMatrix3 0x9918 -#define GlintModelViewMatrix3Tag 0x0323 -#define GlintModelViewMatrix3Reg 1 -#define GlintModelViewMatrix3Off 0x8918 - -#define GlintModelViewMatrix4 0x9920 -#define GlintModelViewMatrix4Tag 0x0324 -#define GlintModelViewMatrix4Reg 1 -#define GlintModelViewMatrix4Off 0x8920 - -#define GlintModelViewMatrix5 0x9928 -#define GlintModelViewMatrix5Tag 0x0325 -#define GlintModelViewMatrix5Reg 1 -#define GlintModelViewMatrix5Off 0x8928 - -#define GlintModelViewMatrix6 0x9930 -#define GlintModelViewMatrix6Tag 0x0326 -#define GlintModelViewMatrix6Reg 1 -#define GlintModelViewMatrix6Off 0x8930 - -#define GlintModelViewMatrix7 0x9938 -#define GlintModelViewMatrix7Tag 0x0327 -#define GlintModelViewMatrix7Reg 1 -#define GlintModelViewMatrix7Off 0x8938 - -#define GlintModelViewMatrix8 0x9940 -#define GlintModelViewMatrix8Tag 0x0328 -#define GlintModelViewMatrix8Reg 1 -#define GlintModelViewMatrix8Off 0x8940 - -#define GlintModelViewMatrix9 0x9948 -#define GlintModelViewMatrix9Tag 0x0329 -#define GlintModelViewMatrix9Reg 1 -#define GlintModelViewMatrix9Off 0x8948 - -#define GlintModelViewMatrix10 0x9950 -#define GlintModelViewMatrix10Tag 0x032a -#define GlintModelViewMatrix10Reg 1 -#define GlintModelViewMatrix10Off 0x8950 - -#define GlintModelViewMatrix11 0x9958 -#define GlintModelViewMatrix11Tag 0x032b -#define GlintModelViewMatrix11Reg 1 -#define GlintModelViewMatrix11Off 0x8958 - -#define GlintModelViewMatrix12 0x9960 -#define GlintModelViewMatrix12Tag 0x032c -#define GlintModelViewMatrix12Reg 1 -#define GlintModelViewMatrix12Off 0x8960 - -#define GlintModelViewMatrix13 0x9968 -#define GlintModelViewMatrix13Tag 0x032d -#define GlintModelViewMatrix13Reg 1 -#define GlintModelViewMatrix13Off 0x8968 - -#define GlintModelViewMatrix14 0x9970 -#define GlintModelViewMatrix14Tag 0x032e -#define GlintModelViewMatrix14Reg 1 -#define GlintModelViewMatrix14Off 0x8970 - -#define GlintModelViewMatrix15 0x9978 -#define GlintModelViewMatrix15Tag 0x032f -#define GlintModelViewMatrix15Reg 1 -#define GlintModelViewMatrix15Off 0x8978 - -#define GlintModelViewProjectionMatrix0 0x9980 -#define GlintModelViewProjectionMatrix0Tag 0x0330 -#define GlintModelViewProjectionMatrix0Reg 1 -#define GlintModelViewProjectionMatrix0Off 0x8980 - -#define GlintModelViewProjectionMatrix1 0x9988 -#define GlintModelViewProjectionMatrix1Tag 0x0331 -#define GlintModelViewProjectionMatrix1Reg 1 -#define GlintModelViewProjectionMatrix1Off 0x8988 - -#define GlintModelViewProjectionMatrix2 0x9990 -#define GlintModelViewProjectionMatrix2Tag 0x0332 -#define GlintModelViewProjectionMatrix2Reg 1 -#define GlintModelViewProjectionMatrix2Off 0x8990 - -#define GlintModelViewProjectionMatrix3 0x9998 -#define GlintModelViewProjectionMatrix3Tag 0x0333 -#define GlintModelViewProjectionMatrix3Reg 1 -#define GlintModelViewProjectionMatrix3Off 0x8998 - -#define GlintModelViewProjectionMatrix4 0x99a0 -#define GlintModelViewProjectionMatrix4Tag 0x0334 -#define GlintModelViewProjectionMatrix4Reg 1 -#define GlintModelViewProjectionMatrix4Off 0x89a0 - -#define GlintModelViewProjectionMatrix5 0x99a8 -#define GlintModelViewProjectionMatrix5Tag 0x0335 -#define GlintModelViewProjectionMatrix5Reg 1 -#define GlintModelViewProjectionMatrix5Off 0x89a8 - -#define GlintModelViewProjectionMatrix6 0x99b0 -#define GlintModelViewProjectionMatrix6Tag 0x0336 -#define GlintModelViewProjectionMatrix6Reg 1 -#define GlintModelViewProjectionMatrix6Off 0x89b0 - -#define GlintModelViewProjectionMatrix7 0x99b8 -#define GlintModelViewProjectionMatrix7Tag 0x0337 -#define GlintModelViewProjectionMatrix7Reg 1 -#define GlintModelViewProjectionMatrix7Off 0x89b8 - -#define GlintModelViewProjectionMatrix8 0x99c0 -#define GlintModelViewProjectionMatrix8Tag 0x0338 -#define GlintModelViewProjectionMatrix8Reg 1 -#define GlintModelViewProjectionMatrix8Off 0x89c0 - -#define GlintModelViewProjectionMatrix9 0x99c8 -#define GlintModelViewProjectionMatrix9Tag 0x0339 -#define GlintModelViewProjectionMatrix9Reg 1 -#define GlintModelViewProjectionMatrix9Off 0x89c8 - -#define GlintModelViewProjectionMatrix10 0x99d0 -#define GlintModelViewProjectionMatrix10Tag 0x033a -#define GlintModelViewProjectionMatrix10Reg 1 -#define GlintModelViewProjectionMatrix10Off 0x89d0 - -#define GlintModelViewProjectionMatrix11 0x99d8 -#define GlintModelViewProjectionMatrix11Tag 0x033b -#define GlintModelViewProjectionMatrix11Reg 1 -#define GlintModelViewProjectionMatrix11Off 0x89d8 - -#define GlintModelViewProjectionMatrix12 0x99e0 -#define GlintModelViewProjectionMatrix12Tag 0x033c -#define GlintModelViewProjectionMatrix12Reg 1 -#define GlintModelViewProjectionMatrix12Off 0x89e0 - -#define GlintModelViewProjectionMatrix13 0x99e8 -#define GlintModelViewProjectionMatrix13Tag 0x033d -#define GlintModelViewProjectionMatrix13Reg 1 -#define GlintModelViewProjectionMatrix13Off 0x89e8 - -#define GlintModelViewProjectionMatrix14 0x99f0 -#define GlintModelViewProjectionMatrix14Tag 0x033e -#define GlintModelViewProjectionMatrix14Reg 1 -#define GlintModelViewProjectionMatrix14Off 0x89f0 - -#define GlintModelViewProjectionMatrix15 0x99f8 -#define GlintModelViewProjectionMatrix15Tag 0x033f -#define GlintModelViewProjectionMatrix15Reg 1 -#define GlintModelViewProjectionMatrix15Off 0x89f8 - -#define GlintNormalMatrix0 0x9a00 -#define GlintNormalMatrix0Tag 0x0340 -#define GlintNormalMatrix0Reg 1 -#define GlintNormalMatrix0Off 0x8a00 - -#define GlintNormalMatrix1 0x9a08 -#define GlintNormalMatrix1Tag 0x0341 -#define GlintNormalMatrix1Reg 1 -#define GlintNormalMatrix1Off 0x8a08 - -#define GlintNormalMatrix2 0x9a10 -#define GlintNormalMatrix2Tag 0x0342 -#define GlintNormalMatrix2Reg 1 -#define GlintNormalMatrix2Off 0x8a10 - -#define GlintNormalMatrix3 0x9a18 -#define GlintNormalMatrix3Tag 0x0343 -#define GlintNormalMatrix3Reg 1 -#define GlintNormalMatrix3Off 0x8a18 - -#define GlintNormalMatrix4 0x9a20 -#define GlintNormalMatrix4Tag 0x0344 -#define GlintNormalMatrix4Reg 1 -#define GlintNormalMatrix4Off 0x8a20 - -#define GlintNormalMatrix5 0x9a28 -#define GlintNormalMatrix5Tag 0x0345 -#define GlintNormalMatrix5Reg 1 -#define GlintNormalMatrix5Off 0x8a28 - -#define GlintNormalMatrix6 0x9a30 -#define GlintNormalMatrix6Tag 0x0346 -#define GlintNormalMatrix6Reg 1 -#define GlintNormalMatrix6Off 0x8a30 - -#define GlintNormalMatrix7 0x9a38 -#define GlintNormalMatrix7Tag 0x0347 -#define GlintNormalMatrix7Reg 1 -#define GlintNormalMatrix7Off 0x8a38 - -#define GlintNormalMatrix8 0x9a40 -#define GlintNormalMatrix8Tag 0x0348 -#define GlintNormalMatrix8Reg 1 -#define GlintNormalMatrix8Off 0x8a40 - -#define GlintTextureMatrix0 0x9a80 -#define GlintTextureMatrix0Tag 0x0350 -#define GlintTextureMatrix0Reg 1 -#define GlintTextureMatrix0Off 0x8a80 - -#define GlintTextureMatrix1 0x9a88 -#define GlintTextureMatrix1Tag 0x0351 -#define GlintTextureMatrix1Reg 1 -#define GlintTextureMatrix1Off 0x8a88 - -#define GlintTextureMatrix2 0x9a90 -#define GlintTextureMatrix2Tag 0x0352 -#define GlintTextureMatrix2Reg 1 -#define GlintTextureMatrix2Off 0x8a90 - -#define GlintTextureMatrix3 0x9a98 -#define GlintTextureMatrix3Tag 0x0353 -#define GlintTextureMatrix3Reg 1 -#define GlintTextureMatrix3Off 0x8a98 - -#define GlintTextureMatrix4 0x9aa0 -#define GlintTextureMatrix4Tag 0x0354 -#define GlintTextureMatrix4Reg 1 -#define GlintTextureMatrix4Off 0x8aa0 - -#define GlintTextureMatrix5 0x9aa8 -#define GlintTextureMatrix5Tag 0x0355 -#define GlintTextureMatrix5Reg 1 -#define GlintTextureMatrix5Off 0x8aa8 - -#define GlintTextureMatrix6 0x9ab0 -#define GlintTextureMatrix6Tag 0x0356 -#define GlintTextureMatrix6Reg 1 -#define GlintTextureMatrix6Off 0x8ab0 - -#define GlintTextureMatrix7 0x9ab8 -#define GlintTextureMatrix7Tag 0x0357 -#define GlintTextureMatrix7Reg 1 -#define GlintTextureMatrix7Off 0x8ab8 - -#define GlintTextureMatrix8 0x9ac0 -#define GlintTextureMatrix8Tag 0x0358 -#define GlintTextureMatrix8Reg 1 -#define GlintTextureMatrix8Off 0x8ac0 - -#define GlintTextureMatrix9 0x9ac8 -#define GlintTextureMatrix9Tag 0x0359 -#define GlintTextureMatrix9Reg 1 -#define GlintTextureMatrix9Off 0x8ac8 - -#define GlintTextureMatrix10 0x9ad0 -#define GlintTextureMatrix10Tag 0x035a -#define GlintTextureMatrix10Reg 1 -#define GlintTextureMatrix10Off 0x8ad0 - -#define GlintTextureMatrix11 0x9ad8 -#define GlintTextureMatrix11Tag 0x035b -#define GlintTextureMatrix11Reg 1 -#define GlintTextureMatrix11Off 0x8ad8 - -#define GlintTextureMatrix12 0x9ae0 -#define GlintTextureMatrix12Tag 0x035c -#define GlintTextureMatrix12Reg 1 -#define GlintTextureMatrix12Off 0x8ae0 - -#define GlintTextureMatrix13 0x9ae8 -#define GlintTextureMatrix13Tag 0x035d -#define GlintTextureMatrix13Reg 1 -#define GlintTextureMatrix13Off 0x8ae8 - -#define GlintTextureMatrix14 0x9af0 -#define GlintTextureMatrix14Tag 0x035e -#define GlintTextureMatrix14Reg 1 -#define GlintTextureMatrix14Off 0x8af0 - -#define GlintTextureMatrix15 0x9af8 -#define GlintTextureMatrix15Tag 0x035f -#define GlintTextureMatrix15Reg 1 -#define GlintTextureMatrix15Off 0x8af8 - -#define GlintTexGen0 0x9b00 -#define GlintTexGen0Tag 0x0360 -#define GlintTexGen0Reg 1 -#define GlintTexGen0Off 0x8b00 - -#define GlintTexGen1 0x9b08 -#define GlintTexGen1Tag 0x0361 -#define GlintTexGen1Reg 1 -#define GlintTexGen1Off 0x8b08 - -#define GlintTexGen2 0x9b10 -#define GlintTexGen2Tag 0x0362 -#define GlintTexGen2Reg 1 -#define GlintTexGen2Off 0x8b10 - -#define GlintTexGen3 0x9b18 -#define GlintTexGen3Tag 0x0363 -#define GlintTexGen3Reg 1 -#define GlintTexGen3Off 0x8b18 - -#define GlintTexGen4 0x9b20 -#define GlintTexGen4Tag 0x0364 -#define GlintTexGen4Reg 1 -#define GlintTexGen4Off 0x8b20 - -#define GlintTexGen5 0x9b28 -#define GlintTexGen5Tag 0x0365 -#define GlintTexGen5Reg 1 -#define GlintTexGen5Off 0x8b28 - -#define GlintTexGen6 0x9b30 -#define GlintTexGen6Tag 0x0366 -#define GlintTexGen6Reg 1 -#define GlintTexGen6Off 0x8b30 - -#define GlintTexGen7 0x9b38 -#define GlintTexGen7Tag 0x0367 -#define GlintTexGen7Reg 1 -#define GlintTexGen7Off 0x8b38 - -#define GlintTexGen8 0x9b40 -#define GlintTexGen8Tag 0x0368 -#define GlintTexGen8Reg 1 -#define GlintTexGen8Off 0x8b40 - -#define GlintTexGen9 0x9b48 -#define GlintTexGen9Tag 0x0369 -#define GlintTexGen9Reg 1 -#define GlintTexGen9Off 0x8b48 - -#define GlintTexGen10 0x9b50 -#define GlintTexGen10Tag 0x036a -#define GlintTexGen10Reg 1 -#define GlintTexGen10Off 0x8b50 - -#define GlintTexGen11 0x9b58 -#define GlintTexGen11Tag 0x036b -#define GlintTexGen11Reg 1 -#define GlintTexGen11Off 0x8b58 - -#define GlintTexGen12 0x9b60 -#define GlintTexGen12Tag 0x036c -#define GlintTexGen12Reg 1 -#define GlintTexGen12Off 0x8b60 - -#define GlintTexGen13 0x9b68 -#define GlintTexGen13Tag 0x036d -#define GlintTexGen13Reg 1 -#define GlintTexGen13Off 0x8b68 - -#define GlintTexGen14 0x9b70 -#define GlintTexGen14Tag 0x036e -#define GlintTexGen14Reg 1 -#define GlintTexGen14Off 0x8b70 - -#define GlintTexGen15 0x9b78 -#define GlintTexGen15Tag 0x036f -#define GlintTexGen15Reg 1 -#define GlintTexGen15Off 0x8b78 - -#define GlintViewPortScaleX 0x9b80 -#define GlintViewPortScaleXTag 0x0370 -#define GlintViewPortScaleXReg 1 -#define GlintViewPortScaleXOff 0x8b80 - -#define GlintViewPortScaleY 0x9b88 -#define GlintViewPortScaleYTag 0x0371 -#define GlintViewPortScaleYReg 1 -#define GlintViewPortScaleYOff 0x8b88 - -#define GlintViewPortScaleZ 0x9b90 -#define GlintViewPortScaleZTag 0x0372 -#define GlintViewPortScaleZReg 1 -#define GlintViewPortScaleZOff 0x8b90 - -#define GlintViewPortOffsetX 0x9b98 -#define GlintViewPortOffsetXTag 0x0373 -#define GlintViewPortOffsetXReg 1 -#define GlintViewPortOffsetXOff 0x8b98 - -#define GlintViewPortOffsetY 0x9ba0 -#define GlintViewPortOffsetYTag 0x0374 -#define GlintViewPortOffsetYReg 1 -#define GlintViewPortOffsetYOff 0x8ba0 - -#define GlintViewPortOffsetZ 0x9ba8 -#define GlintViewPortOffsetZTag 0x0375 -#define GlintViewPortOffsetZReg 1 -#define GlintViewPortOffsetZOff 0x8ba8 - -#define GlintFogDensity 0x9bb0 -#define GlintFogDensityTag 0x0376 -#define GlintFogDensityReg 1 -#define GlintFogDensityOff 0x8bb0 - -#define GlintFogScale 0x9bb8 -#define GlintFogScaleTag 0x0377 -#define GlintFogScaleReg 1 -#define GlintFogScaleOff 0x8bb8 - -#define GlintFogEnd 0x9bc0 -#define GlintFogEndTag 0x0378 -#define GlintFogEndReg 1 -#define GlintFogEndOff 0x8bc0 - -#define GlintPolygonOffsetFactor 0x9bc8 -#define GlintPolygonOffsetFactorTag 0x0379 -#define GlintPolygonOffsetFactorReg 1 -#define GlintPolygonOffsetFactorOff 0x8bc8 - -#define GlintPolygonOffsetBias 0x9bd0 -#define GlintPolygonOffsetBiasTag 0x037a -#define GlintPolygonOffsetBiasReg 1 -#define GlintPolygonOffsetBiasOff 0x8bd0 - -#define GlintLineClipLengthThreshold 0x9bd8 -#define GlintLineClipLengthThresholdTag 0x037b -#define GlintLineClipLengthThresholdReg 1 -#define GlintLineClipLengthThresholdOff 0x8bd8 - -#define GlintTriangleClipAreaThreshold 0x9be0 -#define GlintTriangleClipAreaThresholdTag 0x037c -#define GlintTriangleClipAreaThresholdReg 1 -#define GlintTriangleClipAreaThresholdOff 0x8be0 - -#define GlintRasterPosXIncrement 0x9be8 -#define GlintRasterPosXIncrementTag 0x037d -#define GlintRasterPosXIncrementReg 1 -#define GlintRasterPosXIncrementOff 0x8be8 - -#define GlintRasterPosYIncrement 0x9bf0 -#define GlintRasterPosYIncrementTag 0x037e -#define GlintRasterPosYIncrementReg 1 -#define GlintRasterPosYIncrementOff 0x8bf0 - -#define GlintUserClip0X 0x9c00 -#define GlintUserClip0XTag 0x0380 -#define GlintUserClip0XReg 1 -#define GlintUserClip0XOff 0x8c00 - -#define GlintUserClip0Y 0x9c08 -#define GlintUserClip0YTag 0x0381 -#define GlintUserClip0YReg 1 -#define GlintUserClip0YOff 0x8c08 - -#define GlintUserClip0Z 0x9c10 -#define GlintUserClip0ZTag 0x0382 -#define GlintUserClip0ZReg 1 -#define GlintUserClip0ZOff 0x8c10 - -#define GlintUserClip0W 0x9c18 -#define GlintUserClip0WTag 0x0383 -#define GlintUserClip0WReg 1 -#define GlintUserClip0WOff 0x8c18 - -#define GlintUserClip1X 0x9c20 -#define GlintUserClip1XTag 0x0384 -#define GlintUserClip1XReg 1 -#define GlintUserClip1XOff 0x8c20 - -#define GlintUserClip1Y 0x9c28 -#define GlintUserClip1YTag 0x0385 -#define GlintUserClip1YReg 1 -#define GlintUserClip1YOff 0x8c28 - -#define GlintUserClip1Z 0x9c30 -#define GlintUserClip1ZTag 0x0386 -#define GlintUserClip1ZReg 1 -#define GlintUserClip1ZOff 0x8c30 - -#define GlintUserClip1W 0x9c38 -#define GlintUserClip1WTag 0x0387 -#define GlintUserClip1WReg 1 -#define GlintUserClip1WOff 0x8c38 - -#define GlintUserClip2X 0x9c40 -#define GlintUserClip2XTag 0x0388 -#define GlintUserClip2XReg 1 -#define GlintUserClip2XOff 0x8c40 - -#define GlintUserClip2Y 0x9c48 -#define GlintUserClip2YTag 0x0389 -#define GlintUserClip2YReg 1 -#define GlintUserClip2YOff 0x8c48 - -#define GlintUserClip2Z 0x9c50 -#define GlintUserClip2ZTag 0x038a -#define GlintUserClip2ZReg 1 -#define GlintUserClip2ZOff 0x8c50 - -#define GlintUserClip2W 0x9c58 -#define GlintUserClip2WTag 0x038b -#define GlintUserClip2WReg 1 -#define GlintUserClip2WOff 0x8c58 - -#define GlintUserClip3X 0x9c60 -#define GlintUserClip3XTag 0x038c -#define GlintUserClip3XReg 1 -#define GlintUserClip3XOff 0x8c60 - -#define GlintUserClip3Y 0x9c68 -#define GlintUserClip3YTag 0x038d -#define GlintUserClip3YReg 1 -#define GlintUserClip3YOff 0x8c68 - -#define GlintUserClip3Z 0x9c70 -#define GlintUserClip3ZTag 0x038e -#define GlintUserClip3ZReg 1 -#define GlintUserClip3ZOff 0x8c70 - -#define GlintUserClip3W 0x9c78 -#define GlintUserClip3WTag 0x038f -#define GlintUserClip3WReg 1 -#define GlintUserClip3WOff 0x8c78 - -#define GlintUserClip4X 0x9c80 -#define GlintUserClip4XTag 0x0390 -#define GlintUserClip4XReg 1 -#define GlintUserClip4XOff 0x8c80 - -#define GlintUserClip4Y 0x9c88 -#define GlintUserClip4YTag 0x0391 -#define GlintUserClip4YReg 1 -#define GlintUserClip4YOff 0x8c88 - -#define GlintUserClip4Z 0x9c90 -#define GlintUserClip4ZTag 0x0392 -#define GlintUserClip4ZReg 1 -#define GlintUserClip4ZOff 0x8c90 - -#define GlintUserClip4W 0x9c98 -#define GlintUserClip4WTag 0x0393 -#define GlintUserClip4WReg 1 -#define GlintUserClip4WOff 0x8c98 - -#define GlintUserClip5X 0x9ca0 -#define GlintUserClip5XTag 0x0394 -#define GlintUserClip5XReg 1 -#define GlintUserClip5XOff 0x8ca0 - -#define GlintUserClip5Y 0x9ca8 -#define GlintUserClip5YTag 0x0395 -#define GlintUserClip5YReg 1 -#define GlintUserClip5YOff 0x8ca8 - -#define GlintUserClip5Z 0x9cb0 -#define GlintUserClip5ZTag 0x0396 -#define GlintUserClip5ZReg 1 -#define GlintUserClip5ZOff 0x8cb0 - -#define GlintUserClip5W 0x9cb8 -#define GlintUserClip5WTag 0x0397 -#define GlintUserClip5WReg 1 -#define GlintUserClip5WOff 0x8cb8 - -#define GlintRasterPosXOffset 0x9ce8 -#define GlintRasterPosXOffsetTag 0x039d -#define GlintRasterPosXOffsetReg 1 -#define GlintRasterPosXOffsetOff 0x8ce8 - -#define GlintRasterPosYOffset 0x9cf0 -#define GlintRasterPosYOffsetTag 0x039e -#define GlintRasterPosYOffsetReg 1 -#define GlintRasterPosYOffsetOff 0x8cf0 - -#define GlintAttenuationCutOff 0x9cf8 -#define GlintAttenuationCutOffTag 0x039f -#define GlintAttenuationCutOffReg 1 -#define GlintAttenuationCutOffOff 0x8cf8 - -#define GlintLight0Mode 0x9d00 -#define GlintLight0ModeTag 0x03a0 -#define GlintLight0ModeReg 1 -#define GlintLight0ModeOff 0x8d00 - -#define GlintLight0AmbientIntensityRed 0x9d08 -#define GlintLight0AmbientIntensityRedTag 0x03a1 -#define GlintLight0AmbientIntensityRedReg 1 -#define GlintLight0AmbientIntensityRedOff 0x8d08 - -#define GlintLight0AmbientIntensityGreen 0x9d10 -#define GlintLight0AmbientIntensityGreenTag 0x03a2 -#define GlintLight0AmbientIntensityGreenReg 1 -#define GlintLight0AmbientIntensityGreenOff 0x8d10 - -#define GlintLight0AmbientIntensityBlue 0x9d18 -#define GlintLight0AmbientIntensityBlueTag 0x03a3 -#define GlintLight0AmbientIntensityBlueReg 1 -#define GlintLight0AmbientIntensityBlueOff 0x8d18 - -#define GlintLight0DiffuseIntensityRed 0x9d20 -#define GlintLight0DiffuseIntensityRedTag 0x03a4 -#define GlintLight0DiffuseIntensityRedReg 1 -#define GlintLight0DiffuseIntensityRedOff 0x8d20 - -#define GlintLight0DiffuseIntensityGreen 0x9d28 -#define GlintLight0DiffuseIntensityGreenTag 0x03a5 -#define GlintLight0DiffuseIntensityGreenReg 1 -#define GlintLight0DiffuseIntensityGreenOff 0x8d28 - -#define GlintLight0DiffuseIntensityBlue 0x9d30 -#define GlintLight0DiffuseIntensityBlueTag 0x03a6 -#define GlintLight0DiffuseIntensityBlueReg 1 -#define GlintLight0DiffuseIntensityBlueOff 0x8d30 - -#define GlintLight0SpecularIntensityRed 0x9d38 -#define GlintLight0SpecularIntensityRedTag 0x03a7 -#define GlintLight0SpecularIntensityRedReg 1 -#define GlintLight0SpecularIntensityRedOff 0x8d38 - -#define GlintLight0SpecularIntensityGreen 0x9d40 -#define GlintLight0SpecularIntensityGreenTag 0x03a8 -#define GlintLight0SpecularIntensityGreenReg 1 -#define GlintLight0SpecularIntensityGreenOff 0x8d40 - -#define GlintLight0SpecularIntensityBlue 0x9d48 -#define GlintLight0SpecularIntensityBlueTag 0x03a9 -#define GlintLight0SpecularIntensityBlueReg 1 -#define GlintLight0SpecularIntensityBlueOff 0x8d48 - -#define GlintLight0PositionX 0x9d50 -#define GlintLight0PositionXTag 0x03aa -#define GlintLight0PositionXReg 1 -#define GlintLight0PositionXOff 0x8d50 - -#define GlintLight0PositionY 0x9d58 -#define GlintLight0PositionYTag 0x03ab -#define GlintLight0PositionYReg 1 -#define GlintLight0PositionYOff 0x8d58 - -#define GlintLight0PositionZ 0x9d60 -#define GlintLight0PositionZTag 0x03ac -#define GlintLight0PositionZReg 1 -#define GlintLight0PositionZOff 0x8d60 - -#define GlintLight0PositionW 0x9d68 -#define GlintLight0PositionWTag 0x03ad -#define GlintLight0PositionWReg 1 -#define GlintLight0PositionWOff 0x8d68 - -#define GlintLight0SpotlightDirectionX 0x9d70 -#define GlintLight0SpotlightDirectionXTag 0x03ae -#define GlintLight0SpotlightDirectionXReg 1 -#define GlintLight0SpotlightDirectionXOff 0x8d70 - -#define GlintLight0SpotlightDirectionY 0x9d78 -#define GlintLight0SpotlightDirectionYTag 0x03af -#define GlintLight0SpotlightDirectionYReg 1 -#define GlintLight0SpotlightDirectionYOff 0x8d78 - -#define GlintLight0SpotlightDirectionZ 0x9d80 -#define GlintLight0SpotlightDirectionZTag 0x03b0 -#define GlintLight0SpotlightDirectionZReg 1 -#define GlintLight0SpotlightDirectionZOff 0x8d80 - -#define GlintLight0SpotlightExponent 0x9d88 -#define GlintLight0SpotlightExponentTag 0x03b1 -#define GlintLight0SpotlightExponentReg 1 -#define GlintLight0SpotlightExponentOff 0x8d88 - -#define GlintLight0CosSpotlightCutoffAngle 0x9d90 -#define GlintLight0CosSpotlightCutoffAngleTag 0x03b2 -#define GlintLight0CosSpotlightCutoffAngleReg 1 -#define GlintLight0CosSpotlightCutoffAngleOff 0x8d90 - -#define GlintLight0ConstantAttenuation 0x9d98 -#define GlintLight0ConstantAttenuationTag 0x03b3 -#define GlintLight0ConstantAttenuationReg 1 -#define GlintLight0ConstantAttenuationOff 0x8d98 - -#define GlintLight0LinearAttenuation 0x9da0 -#define GlintLight0LinearAttenuationTag 0x03b4 -#define GlintLight0LinearAttenuationReg 1 -#define GlintLight0LinearAttenuationOff 0x8da0 - -#define GlintLight0QuadraticAttenuation 0x9da8 -#define GlintLight0QuadraticAttenuationTag 0x03b5 -#define GlintLight0QuadraticAttenuationReg 1 -#define GlintLight0QuadraticAttenuationOff 0x8da8 - -#define GlintLight1Mode 0x9db0 -#define GlintLight1ModeTag 0x03b6 -#define GlintLight1ModeReg 1 -#define GlintLight1ModeOff 0x8db0 - -#define GlintLight1AmbientIntensityRed 0x9db8 -#define GlintLight1AmbientIntensityRedTag 0x03b7 -#define GlintLight1AmbientIntensityRedReg 1 -#define GlintLight1AmbientIntensityRedOff 0x8db8 - -#define GlintLight1AmbientIntensityGreen 0x9dc0 -#define GlintLight1AmbientIntensityGreenTag 0x03b8 -#define GlintLight1AmbientIntensityGreenReg 1 -#define GlintLight1AmbientIntensityGreenOff 0x8dc0 - -#define GlintLight1AmbientIntensityBlue 0x9dc8 -#define GlintLight1AmbientIntensityBlueTag 0x03b9 -#define GlintLight1AmbientIntensityBlueReg 1 -#define GlintLight1AmbientIntensityBlueOff 0x8dc8 - -#define GlintLight1DiffuseIntensityRed 0x9dd0 -#define GlintLight1DiffuseIntensityRedTag 0x03ba -#define GlintLight1DiffuseIntensityRedReg 1 -#define GlintLight1DiffuseIntensityRedOff 0x8dd0 - -#define GlintLight1DiffuseIntensityGreen 0x9dd8 -#define GlintLight1DiffuseIntensityGreenTag 0x03bb -#define GlintLight1DiffuseIntensityGreenReg 1 -#define GlintLight1DiffuseIntensityGreenOff 0x8dd8 - -#define GlintLight1DiffuseIntensityBlue 0x9de0 -#define GlintLight1DiffuseIntensityBlueTag 0x03bc -#define GlintLight1DiffuseIntensityBlueReg 1 -#define GlintLight1DiffuseIntensityBlueOff 0x8de0 - -#define GlintLight1SpecularIntensityRed 0x9de8 -#define GlintLight1SpecularIntensityRedTag 0x03bd -#define GlintLight1SpecularIntensityRedReg 1 -#define GlintLight1SpecularIntensityRedOff 0x8de8 - -#define GlintLight1SpecularIntensityGreen 0x9df0 -#define GlintLight1SpecularIntensityGreenTag 0x03be -#define GlintLight1SpecularIntensityGreenReg 1 -#define GlintLight1SpecularIntensityGreenOff 0x8df0 - -#define GlintLight1SpecularIntensityBlue 0x9df8 -#define GlintLight1SpecularIntensityBlueTag 0x03bf -#define GlintLight1SpecularIntensityBlueReg 1 -#define GlintLight1SpecularIntensityBlueOff 0x8df8 - -#define GlintLight1PositionX 0x9e00 -#define GlintLight1PositionXTag 0x03c0 -#define GlintLight1PositionXReg 1 -#define GlintLight1PositionXOff 0x8e00 - -#define GlintLight1PositionY 0x9e08 -#define GlintLight1PositionYTag 0x03c1 -#define GlintLight1PositionYReg 1 -#define GlintLight1PositionYOff 0x8e08 - -#define GlintLight1PositionZ 0x9e10 -#define GlintLight1PositionZTag 0x03c2 -#define GlintLight1PositionZReg 1 -#define GlintLight1PositionZOff 0x8e10 - -#define GlintLight1PositionW 0x9e18 -#define GlintLight1PositionWTag 0x03c3 -#define GlintLight1PositionWReg 1 -#define GlintLight1PositionWOff 0x8e18 - -#define GlintLight1SpotlightDirectionX 0x9e20 -#define GlintLight1SpotlightDirectionXTag 0x03c4 -#define GlintLight1SpotlightDirectionXReg 1 -#define GlintLight1SpotlightDirectionXOff 0x8e20 - -#define GlintLight1SpotlightDirectionY 0x9e28 -#define GlintLight1SpotlightDirectionYTag 0x03c5 -#define GlintLight1SpotlightDirectionYReg 1 -#define GlintLight1SpotlightDirectionYOff 0x8e28 - -#define GlintLight1SpotlightDirectionZ 0x9e30 -#define GlintLight1SpotlightDirectionZTag 0x03c6 -#define GlintLight1SpotlightDirectionZReg 1 -#define GlintLight1SpotlightDirectionZOff 0x8e30 - -#define GlintLight1SpotlightExponent 0x9e38 -#define GlintLight1SpotlightExponentTag 0x03c7 -#define GlintLight1SpotlightExponentReg 1 -#define GlintLight1SpotlightExponentOff 0x8e38 - -#define GlintLight1CosSpotlightCutoffAngle 0x9e40 -#define GlintLight1CosSpotlightCutoffAngleTag 0x03c8 -#define GlintLight1CosSpotlightCutoffAngleReg 1 -#define GlintLight1CosSpotlightCutoffAngleOff 0x8e40 - -#define GlintLight1ConstantAttenuation 0x9e48 -#define GlintLight1ConstantAttenuationTag 0x03c9 -#define GlintLight1ConstantAttenuationReg 1 -#define GlintLight1ConstantAttenuationOff 0x8e48 - -#define GlintLight1LinearAttenuation 0x9e50 -#define GlintLight1LinearAttenuationTag 0x03ca -#define GlintLight1LinearAttenuationReg 1 -#define GlintLight1LinearAttenuationOff 0x8e50 - -#define GlintLight1QuadraticAttenuation 0x9e58 -#define GlintLight1QuadraticAttenuationTag 0x03cb -#define GlintLight1QuadraticAttenuationReg 1 -#define GlintLight1QuadraticAttenuationOff 0x8e58 - -#define GlintLight2Mode 0x9e60 -#define GlintLight2ModeTag 0x03cc -#define GlintLight2ModeReg 1 -#define GlintLight2ModeOff 0x8e60 - -#define GlintLight2AmbientIntensityRed 0x9e68 -#define GlintLight2AmbientIntensityRedTag 0x03cd -#define GlintLight2AmbientIntensityRedReg 1 -#define GlintLight2AmbientIntensityRedOff 0x8e68 - -#define GlintLight2AmbientIntensityGreen 0x9e70 -#define GlintLight2AmbientIntensityGreenTag 0x03ce -#define GlintLight2AmbientIntensityGreenReg 1 -#define GlintLight2AmbientIntensityGreenOff 0x8e70 - -#define GlintLight2AmbientIntensityBlue 0x9e78 -#define GlintLight2AmbientIntensityBlueTag 0x03cf -#define GlintLight2AmbientIntensityBlueReg 1 -#define GlintLight2AmbientIntensityBlueOff 0x8e78 - -#define GlintLight2DiffuseIntensityRed 0x9e80 -#define GlintLight2DiffuseIntensityRedTag 0x03d0 -#define GlintLight2DiffuseIntensityRedReg 1 -#define GlintLight2DiffuseIntensityRedOff 0x8e80 - -#define GlintLight2DiffuseIntensityGreen 0x9e88 -#define GlintLight2DiffuseIntensityGreenTag 0x03d1 -#define GlintLight2DiffuseIntensityGreenReg 1 -#define GlintLight2DiffuseIntensityGreenOff 0x8e88 - -#define GlintLight2DiffuseIntensityBlue 0x9e90 -#define GlintLight2DiffuseIntensityBlueTag 0x03d2 -#define GlintLight2DiffuseIntensityBlueReg 1 -#define GlintLight2DiffuseIntensityBlueOff 0x8e90 - -#define GlintLight2SpecularIntensityRed 0x9e98 -#define GlintLight2SpecularIntensityRedTag 0x03d3 -#define GlintLight2SpecularIntensityRedReg 1 -#define GlintLight2SpecularIntensityRedOff 0x8e98 - -#define GlintLight2SpecularIntensityGreen 0x9ea0 -#define GlintLight2SpecularIntensityGreenTag 0x03d4 -#define GlintLight2SpecularIntensityGreenReg 1 -#define GlintLight2SpecularIntensityGreenOff 0x8ea0 - -#define GlintLight2SpecularIntensityBlue 0x9ea8 -#define GlintLight2SpecularIntensityBlueTag 0x03d5 -#define GlintLight2SpecularIntensityBlueReg 1 -#define GlintLight2SpecularIntensityBlueOff 0x8ea8 - -#define GlintLight2PositionX 0x9eb0 -#define GlintLight2PositionXTag 0x03d6 -#define GlintLight2PositionXReg 1 -#define GlintLight2PositionXOff 0x8eb0 - -#define GlintLight2PositionY 0x9eb8 -#define GlintLight2PositionYTag 0x03d7 -#define GlintLight2PositionYReg 1 -#define GlintLight2PositionYOff 0x8eb8 - -#define GlintLight2PositionZ 0x9ec0 -#define GlintLight2PositionZTag 0x03d8 -#define GlintLight2PositionZReg 1 -#define GlintLight2PositionZOff 0x8ec0 - -#define GlintLight2PositionW 0x9ec8 -#define GlintLight2PositionWTag 0x03d9 -#define GlintLight2PositionWReg 1 -#define GlintLight2PositionWOff 0x8ec8 - -#define GlintLight2SpotlightDirectionX 0x9ed0 -#define GlintLight2SpotlightDirectionXTag 0x03da -#define GlintLight2SpotlightDirectionXReg 1 -#define GlintLight2SpotlightDirectionXOff 0x8ed0 - -#define GlintLight2SpotlightDirectionY 0x9ed8 -#define GlintLight2SpotlightDirectionYTag 0x03db -#define GlintLight2SpotlightDirectionYReg 1 -#define GlintLight2SpotlightDirectionYOff 0x8ed8 - -#define GlintLight2SpotlightDirectionZ 0x9ee0 -#define GlintLight2SpotlightDirectionZTag 0x03dc -#define GlintLight2SpotlightDirectionZReg 1 -#define GlintLight2SpotlightDirectionZOff 0x8ee0 - -#define GlintLight2SpotlightExponent 0x9ee8 -#define GlintLight2SpotlightExponentTag 0x03dd -#define GlintLight2SpotlightExponentReg 1 -#define GlintLight2SpotlightExponentOff 0x8ee8 - -#define GlintLight2CosSpotlightCutoffAngle 0x9ef0 -#define GlintLight2CosSpotlightCutoffAngleTag 0x03de -#define GlintLight2CosSpotlightCutoffAngleReg 1 -#define GlintLight2CosSpotlightCutoffAngleOff 0x8ef0 - -#define GlintLight2ConstantAttenuation 0x9ef8 -#define GlintLight2ConstantAttenuationTag 0x03df -#define GlintLight2ConstantAttenuationReg 1 -#define GlintLight2ConstantAttenuationOff 0x8ef8 - -#define GlintLight2LinearAttenuation 0x9f00 -#define GlintLight2LinearAttenuationTag 0x03e0 -#define GlintLight2LinearAttenuationReg 1 -#define GlintLight2LinearAttenuationOff 0x8f00 - -#define GlintLight2QuadraticAttenuation 0x9f08 -#define GlintLight2QuadraticAttenuationTag 0x03e1 -#define GlintLight2QuadraticAttenuationReg 1 -#define GlintLight2QuadraticAttenuationOff 0x8f08 - -#define GlintLight3Mode 0x9f10 -#define GlintLight3ModeTag 0x03e2 -#define GlintLight3ModeReg 1 -#define GlintLight3ModeOff 0x8f10 - -#define GlintLight3AmbientIntensityRed 0x9f18 -#define GlintLight3AmbientIntensityRedTag 0x03e3 -#define GlintLight3AmbientIntensityRedReg 1 -#define GlintLight3AmbientIntensityRedOff 0x8f18 - -#define GlintLight3AmbientIntensityGreen 0x9f20 -#define GlintLight3AmbientIntensityGreenTag 0x03e4 -#define GlintLight3AmbientIntensityGreenReg 1 -#define GlintLight3AmbientIntensityGreenOff 0x8f20 - -#define GlintLight3AmbientIntensityBlue 0x9f28 -#define GlintLight3AmbientIntensityBlueTag 0x03e5 -#define GlintLight3AmbientIntensityBlueReg 1 -#define GlintLight3AmbientIntensityBlueOff 0x8f28 - -#define GlintLight3DiffuseIntensityRed 0x9f30 -#define GlintLight3DiffuseIntensityRedTag 0x03e6 -#define GlintLight3DiffuseIntensityRedReg 1 -#define GlintLight3DiffuseIntensityRedOff 0x8f30 - -#define GlintLight3DiffuseIntensityGreen 0x9f38 -#define GlintLight3DiffuseIntensityGreenTag 0x03e7 -#define GlintLight3DiffuseIntensityGreenReg 1 -#define GlintLight3DiffuseIntensityGreenOff 0x8f38 - -#define GlintLight3DiffuseIntensityBlue 0x9f40 -#define GlintLight3DiffuseIntensityBlueTag 0x03e8 -#define GlintLight3DiffuseIntensityBlueReg 1 -#define GlintLight3DiffuseIntensityBlueOff 0x8f40 - -#define GlintLight3SpecularIntensityRed 0x9f48 -#define GlintLight3SpecularIntensityRedTag 0x03e9 -#define GlintLight3SpecularIntensityRedReg 1 -#define GlintLight3SpecularIntensityRedOff 0x8f48 - -#define GlintLight3SpecularIntensityGreen 0x9f50 -#define GlintLight3SpecularIntensityGreenTag 0x03ea -#define GlintLight3SpecularIntensityGreenReg 1 -#define GlintLight3SpecularIntensityGreenOff 0x8f50 - -#define GlintLight3SpecularIntensityBlue 0x9f58 -#define GlintLight3SpecularIntensityBlueTag 0x03eb -#define GlintLight3SpecularIntensityBlueReg 1 -#define GlintLight3SpecularIntensityBlueOff 0x8f58 - -#define GlintLight3PositionX 0x9f60 -#define GlintLight3PositionXTag 0x03ec -#define GlintLight3PositionXReg 1 -#define GlintLight3PositionXOff 0x8f60 - -#define GlintLight3PositionY 0x9f68 -#define GlintLight3PositionYTag 0x03ed -#define GlintLight3PositionYReg 1 -#define GlintLight3PositionYOff 0x8f68 - -#define GlintLight3PositionZ 0x9f70 -#define GlintLight3PositionZTag 0x03ee -#define GlintLight3PositionZReg 1 -#define GlintLight3PositionZOff 0x8f70 - -#define GlintLight3PositionW 0x9f78 -#define GlintLight3PositionWTag 0x03ef -#define GlintLight3PositionWReg 1 -#define GlintLight3PositionWOff 0x8f78 - -#define GlintLight3SpotlightDirectionX 0x9f80 -#define GlintLight3SpotlightDirectionXTag 0x03f0 -#define GlintLight3SpotlightDirectionXReg 1 -#define GlintLight3SpotlightDirectionXOff 0x8f80 - -#define GlintLight3SpotlightDirectionY 0x9f88 -#define GlintLight3SpotlightDirectionYTag 0x03f1 -#define GlintLight3SpotlightDirectionYReg 1 -#define GlintLight3SpotlightDirectionYOff 0x8f88 - -#define GlintLight3SpotlightDirectionZ 0x9f90 -#define GlintLight3SpotlightDirectionZTag 0x03f2 -#define GlintLight3SpotlightDirectionZReg 1 -#define GlintLight3SpotlightDirectionZOff 0x8f90 - -#define GlintLight3SpotlightExponent 0x9f98 -#define GlintLight3SpotlightExponentTag 0x03f3 -#define GlintLight3SpotlightExponentReg 1 -#define GlintLight3SpotlightExponentOff 0x8f98 - -#define GlintLight3CosSpotlightCutoffAngle 0x9fa0 -#define GlintLight3CosSpotlightCutoffAngleTag 0x03f4 -#define GlintLight3CosSpotlightCutoffAngleReg 1 -#define GlintLight3CosSpotlightCutoffAngleOff 0x8fa0 - -#define GlintLight3ConstantAttenuation 0x9fa8 -#define GlintLight3ConstantAttenuationTag 0x03f5 -#define GlintLight3ConstantAttenuationReg 1 -#define GlintLight3ConstantAttenuationOff 0x8fa8 - -#define GlintLight3LinearAttenuation 0x9fb0 -#define GlintLight3LinearAttenuationTag 0x03f6 -#define GlintLight3LinearAttenuationReg 1 -#define GlintLight3LinearAttenuationOff 0x8fb0 - -#define GlintLight3QuadraticAttenuation 0x9fb8 -#define GlintLight3QuadraticAttenuationTag 0x03f7 -#define GlintLight3QuadraticAttenuationReg 1 -#define GlintLight3QuadraticAttenuationOff 0x8fb8 - -#define GlintLight4Mode 0x9fc0 -#define GlintLight4ModeTag 0x03f8 -#define GlintLight4ModeReg 1 -#define GlintLight4ModeOff 0x8fc0 - -#define GlintLight4AmbientIntensityRed 0x9fc8 -#define GlintLight4AmbientIntensityRedTag 0x03f9 -#define GlintLight4AmbientIntensityRedReg 1 -#define GlintLight4AmbientIntensityRedOff 0x8fc8 - -#define GlintLight4AmbientIntensityGreen 0x9fd0 -#define GlintLight4AmbientIntensityGreenTag 0x03fa -#define GlintLight4AmbientIntensityGreenReg 1 -#define GlintLight4AmbientIntensityGreenOff 0x8fd0 - -#define GlintLight4AmbientIntensityBlue 0x9fd8 -#define GlintLight4AmbientIntensityBlueTag 0x03fb -#define GlintLight4AmbientIntensityBlueReg 1 -#define GlintLight4AmbientIntensityBlueOff 0x8fd8 - -#define GlintLight4DiffuseIntensityRed 0x9fe0 -#define GlintLight4DiffuseIntensityRedTag 0x03fc -#define GlintLight4DiffuseIntensityRedReg 1 -#define GlintLight4DiffuseIntensityRedOff 0x8fe0 - -#define GlintLight4DiffuseIntensityGreen 0x9fe8 -#define GlintLight4DiffuseIntensityGreenTag 0x03fd -#define GlintLight4DiffuseIntensityGreenReg 1 -#define GlintLight4DiffuseIntensityGreenOff 0x8fe8 - -#define GlintLight4DiffuseIntensityBlue 0x9ff0 -#define GlintLight4DiffuseIntensityBlueTag 0x03fe -#define GlintLight4DiffuseIntensityBlueReg 1 -#define GlintLight4DiffuseIntensityBlueOff 0x8ff0 - -#define GlintLight4SpecularIntensityRed 0x9ff8 -#define GlintLight4SpecularIntensityRedTag 0x03ff -#define GlintLight4SpecularIntensityRedReg 1 -#define GlintLight4SpecularIntensityRedOff 0x8ff8 - -#define GlintLight4SpecularIntensityGreen 0xa000 -#define GlintLight4SpecularIntensityGreenTag 0x0400 -#define GlintLight4SpecularIntensityGreenReg 1 -#define GlintLight4SpecularIntensityGreenOff 0x9000 - -#define GlintLight4SpecularIntensityBlue 0xa008 -#define GlintLight4SpecularIntensityBlueTag 0x0401 -#define GlintLight4SpecularIntensityBlueReg 1 -#define GlintLight4SpecularIntensityBlueOff 0x9008 - -#define GlintLight4PositionX 0xa010 -#define GlintLight4PositionXTag 0x0402 -#define GlintLight4PositionXReg 1 -#define GlintLight4PositionXOff 0x9010 - -#define GlintLight4PositionY 0xa018 -#define GlintLight4PositionYTag 0x0403 -#define GlintLight4PositionYReg 1 -#define GlintLight4PositionYOff 0x9018 - -#define GlintLight4PositionZ 0xa020 -#define GlintLight4PositionZTag 0x0404 -#define GlintLight4PositionZReg 1 -#define GlintLight4PositionZOff 0x9020 - -#define GlintLight4PositionW 0xa028 -#define GlintLight4PositionWTag 0x0405 -#define GlintLight4PositionWReg 1 -#define GlintLight4PositionWOff 0x9028 - -#define GlintLight4SpotlightDirectionX 0xa030 -#define GlintLight4SpotlightDirectionXTag 0x0406 -#define GlintLight4SpotlightDirectionXReg 1 -#define GlintLight4SpotlightDirectionXOff 0x9030 - -#define GlintLight4SpotlightDirectionY 0xa038 -#define GlintLight4SpotlightDirectionYTag 0x0407 -#define GlintLight4SpotlightDirectionYReg 1 -#define GlintLight4SpotlightDirectionYOff 0x9038 - -#define GlintLight4SpotlightDirectionZ 0xa040 -#define GlintLight4SpotlightDirectionZTag 0x0408 -#define GlintLight4SpotlightDirectionZReg 1 -#define GlintLight4SpotlightDirectionZOff 0x9040 - -#define GlintLight4SpotlightExponent 0xa048 -#define GlintLight4SpotlightExponentTag 0x0409 -#define GlintLight4SpotlightExponentReg 1 -#define GlintLight4SpotlightExponentOff 0x9048 - -#define GlintLight4CosSpotlightCutoffAngle 0xa050 -#define GlintLight4CosSpotlightCutoffAngleTag 0x040a -#define GlintLight4CosSpotlightCutoffAngleReg 1 -#define GlintLight4CosSpotlightCutoffAngleOff 0x9050 - -#define GlintLight4ConstantAttenuation 0xa058 -#define GlintLight4ConstantAttenuationTag 0x040b -#define GlintLight4ConstantAttenuationReg 1 -#define GlintLight4ConstantAttenuationOff 0x9058 - -#define GlintLight4LinearAttenuation 0xa060 -#define GlintLight4LinearAttenuationTag 0x040c -#define GlintLight4LinearAttenuationReg 1 -#define GlintLight4LinearAttenuationOff 0x9060 - -#define GlintLight4QuadraticAttenuation 0xa068 -#define GlintLight4QuadraticAttenuationTag 0x040d -#define GlintLight4QuadraticAttenuationReg 1 -#define GlintLight4QuadraticAttenuationOff 0x9068 - -#define GlintLight5Mode 0xa070 -#define GlintLight5ModeTag 0x040e -#define GlintLight5ModeReg 1 -#define GlintLight5ModeOff 0x9070 - -#define GlintLight5AmbientIntensityRed 0xa078 -#define GlintLight5AmbientIntensityRedTag 0x040f -#define GlintLight5AmbientIntensityRedReg 1 -#define GlintLight5AmbientIntensityRedOff 0x9078 - -#define GlintLight5AmbientIntensityGreen 0xa080 -#define GlintLight5AmbientIntensityGreenTag 0x0410 -#define GlintLight5AmbientIntensityGreenReg 1 -#define GlintLight5AmbientIntensityGreenOff 0x9080 - -#define GlintLight5AmbientIntensityBlue 0xa088 -#define GlintLight5AmbientIntensityBlueTag 0x0411 -#define GlintLight5AmbientIntensityBlueReg 1 -#define GlintLight5AmbientIntensityBlueOff 0x9088 - -#define GlintLight5DiffuseIntensityRed 0xa090 -#define GlintLight5DiffuseIntensityRedTag 0x0412 -#define GlintLight5DiffuseIntensityRedReg 1 -#define GlintLight5DiffuseIntensityRedOff 0x9090 - -#define GlintLight5DiffuseIntensityGreen 0xa098 -#define GlintLight5DiffuseIntensityGreenTag 0x0413 -#define GlintLight5DiffuseIntensityGreenReg 1 -#define GlintLight5DiffuseIntensityGreenOff 0x9098 - -#define GlintLight5DiffuseIntensityBlue 0xa0a0 -#define GlintLight5DiffuseIntensityBlueTag 0x0414 -#define GlintLight5DiffuseIntensityBlueReg 1 -#define GlintLight5DiffuseIntensityBlueOff 0x90a0 - -#define GlintLight5SpecularIntensityRed 0xa0a8 -#define GlintLight5SpecularIntensityRedTag 0x0415 -#define GlintLight5SpecularIntensityRedReg 1 -#define GlintLight5SpecularIntensityRedOff 0x90a8 - -#define GlintLight5SpecularIntensityGreen 0xa0b0 -#define GlintLight5SpecularIntensityGreenTag 0x0416 -#define GlintLight5SpecularIntensityGreenReg 1 -#define GlintLight5SpecularIntensityGreenOff 0x90b0 - -#define GlintLight5SpecularIntensityBlue 0xa0b8 -#define GlintLight5SpecularIntensityBlueTag 0x0417 -#define GlintLight5SpecularIntensityBlueReg 1 -#define GlintLight5SpecularIntensityBlueOff 0x90b8 - -#define GlintLight5PositionX 0xa0c0 -#define GlintLight5PositionXTag 0x0418 -#define GlintLight5PositionXReg 1 -#define GlintLight5PositionXOff 0x90c0 - -#define GlintLight5PositionY 0xa0c8 -#define GlintLight5PositionYTag 0x0419 -#define GlintLight5PositionYReg 1 -#define GlintLight5PositionYOff 0x90c8 - -#define GlintLight5PositionZ 0xa0d0 -#define GlintLight5PositionZTag 0x041a -#define GlintLight5PositionZReg 1 -#define GlintLight5PositionZOff 0x90d0 - -#define GlintLight5PositionW 0xa0d8 -#define GlintLight5PositionWTag 0x041b -#define GlintLight5PositionWReg 1 -#define GlintLight5PositionWOff 0x90d8 - -#define GlintLight5SpotlightDirectionX 0xa0e0 -#define GlintLight5SpotlightDirectionXTag 0x041c -#define GlintLight5SpotlightDirectionXReg 1 -#define GlintLight5SpotlightDirectionXOff 0x90e0 - -#define GlintLight5SpotlightDirectionY 0xa0e8 -#define GlintLight5SpotlightDirectionYTag 0x041d -#define GlintLight5SpotlightDirectionYReg 1 -#define GlintLight5SpotlightDirectionYOff 0x90e8 - -#define GlintLight5SpotlightDirectionZ 0xa0f0 -#define GlintLight5SpotlightDirectionZTag 0x041e -#define GlintLight5SpotlightDirectionZReg 1 -#define GlintLight5SpotlightDirectionZOff 0x90f0 - -#define GlintLight5SpotlightExponent 0xa0f8 -#define GlintLight5SpotlightExponentTag 0x041f -#define GlintLight5SpotlightExponentReg 1 -#define GlintLight5SpotlightExponentOff 0x90f8 - -#define GlintLight5CosSpotlightCutoffAngle 0xa100 -#define GlintLight5CosSpotlightCutoffAngleTag 0x0420 -#define GlintLight5CosSpotlightCutoffAngleReg 1 -#define GlintLight5CosSpotlightCutoffAngleOff 0x9100 - -#define GlintLight5ConstantAttenuation 0xa108 -#define GlintLight5ConstantAttenuationTag 0x0421 -#define GlintLight5ConstantAttenuationReg 1 -#define GlintLight5ConstantAttenuationOff 0x9108 - -#define GlintLight5LinearAttenuation 0xa110 -#define GlintLight5LinearAttenuationTag 0x0422 -#define GlintLight5LinearAttenuationReg 1 -#define GlintLight5LinearAttenuationOff 0x9110 - -#define GlintLight5QuadraticAttenuation 0xa118 -#define GlintLight5QuadraticAttenuationTag 0x0423 -#define GlintLight5QuadraticAttenuationReg 1 -#define GlintLight5QuadraticAttenuationOff 0x9118 - -#define GlintLight6Mode 0xa120 -#define GlintLight6ModeTag 0x0424 -#define GlintLight6ModeReg 1 -#define GlintLight6ModeOff 0x9120 - -#define GlintLight6AmbientIntensityRed 0xa128 -#define GlintLight6AmbientIntensityRedTag 0x0425 -#define GlintLight6AmbientIntensityRedReg 1 -#define GlintLight6AmbientIntensityRedOff 0x9128 - -#define GlintLight6AmbientIntensityGreen 0xa130 -#define GlintLight6AmbientIntensityGreenTag 0x0426 -#define GlintLight6AmbientIntensityGreenReg 1 -#define GlintLight6AmbientIntensityGreenOff 0x9130 - -#define GlintLight6AmbientIntensityBlue 0xa138 -#define GlintLight6AmbientIntensityBlueTag 0x0427 -#define GlintLight6AmbientIntensityBlueReg 1 -#define GlintLight6AmbientIntensityBlueOff 0x9138 - -#define GlintLight6DiffuseIntensityRed 0xa140 -#define GlintLight6DiffuseIntensityRedTag 0x0428 -#define GlintLight6DiffuseIntensityRedReg 1 -#define GlintLight6DiffuseIntensityRedOff 0x9140 - -#define GlintLight6DiffuseIntensityGreen 0xa148 -#define GlintLight6DiffuseIntensityGreenTag 0x0429 -#define GlintLight6DiffuseIntensityGreenReg 1 -#define GlintLight6DiffuseIntensityGreenOff 0x9148 - -#define GlintLight6DiffuseIntensityBlue 0xa150 -#define GlintLight6DiffuseIntensityBlueTag 0x042a -#define GlintLight6DiffuseIntensityBlueReg 1 -#define GlintLight6DiffuseIntensityBlueOff 0x9150 - -#define GlintLight6SpecularIntensityRed 0xa158 -#define GlintLight6SpecularIntensityRedTag 0x042b -#define GlintLight6SpecularIntensityRedReg 1 -#define GlintLight6SpecularIntensityRedOff 0x9158 - -#define GlintLight6SpecularIntensityGreen 0xa160 -#define GlintLight6SpecularIntensityGreenTag 0x042c -#define GlintLight6SpecularIntensityGreenReg 1 -#define GlintLight6SpecularIntensityGreenOff 0x9160 - -#define GlintLight6SpecularIntensityBlue 0xa168 -#define GlintLight6SpecularIntensityBlueTag 0x042d -#define GlintLight6SpecularIntensityBlueReg 1 -#define GlintLight6SpecularIntensityBlueOff 0x9168 - -#define GlintLight6PositionX 0xa170 -#define GlintLight6PositionXTag 0x042e -#define GlintLight6PositionXReg 1 -#define GlintLight6PositionXOff 0x9170 - -#define GlintLight6PositionY 0xa178 -#define GlintLight6PositionYTag 0x042f -#define GlintLight6PositionYReg 1 -#define GlintLight6PositionYOff 0x9178 - -#define GlintLight6PositionZ 0xa180 -#define GlintLight6PositionZTag 0x0430 -#define GlintLight6PositionZReg 1 -#define GlintLight6PositionZOff 0x9180 - -#define GlintLight6PositionW 0xa188 -#define GlintLight6PositionWTag 0x0431 -#define GlintLight6PositionWReg 1 -#define GlintLight6PositionWOff 0x9188 - -#define GlintLight6SpotlightDirectionX 0xa190 -#define GlintLight6SpotlightDirectionXTag 0x0432 -#define GlintLight6SpotlightDirectionXReg 1 -#define GlintLight6SpotlightDirectionXOff 0x9190 - -#define GlintLight6SpotlightDirectionY 0xa198 -#define GlintLight6SpotlightDirectionYTag 0x0433 -#define GlintLight6SpotlightDirectionYReg 1 -#define GlintLight6SpotlightDirectionYOff 0x9198 - -#define GlintLight6SpotlightDirectionZ 0xa1a0 -#define GlintLight6SpotlightDirectionZTag 0x0434 -#define GlintLight6SpotlightDirectionZReg 1 -#define GlintLight6SpotlightDirectionZOff 0x91a0 - -#define GlintLight6SpotlightExponent 0xa1a8 -#define GlintLight6SpotlightExponentTag 0x0435 -#define GlintLight6SpotlightExponentReg 1 -#define GlintLight6SpotlightExponentOff 0x91a8 - -#define GlintLight6CosSpotlightCutoffAngle 0xa1b0 -#define GlintLight6CosSpotlightCutoffAngleTag 0x0436 -#define GlintLight6CosSpotlightCutoffAngleReg 1 -#define GlintLight6CosSpotlightCutoffAngleOff 0x91b0 - -#define GlintLight6ConstantAttenuation 0xa1b8 -#define GlintLight6ConstantAttenuationTag 0x0437 -#define GlintLight6ConstantAttenuationReg 1 -#define GlintLight6ConstantAttenuationOff 0x91b8 - -#define GlintLight6LinearAttenuation 0xa1c0 -#define GlintLight6LinearAttenuationTag 0x0438 -#define GlintLight6LinearAttenuationReg 1 -#define GlintLight6LinearAttenuationOff 0x91c0 - -#define GlintLight6QuadraticAttenuation 0xa1c8 -#define GlintLight6QuadraticAttenuationTag 0x0439 -#define GlintLight6QuadraticAttenuationReg 1 -#define GlintLight6QuadraticAttenuationOff 0x91c8 - -#define GlintLight7Mode 0xa1d0 -#define GlintLight7ModeTag 0x043a -#define GlintLight7ModeReg 1 -#define GlintLight7ModeOff 0x91d0 - -#define GlintLight7AmbientIntensityRed 0xa1d8 -#define GlintLight7AmbientIntensityRedTag 0x043b -#define GlintLight7AmbientIntensityRedReg 1 -#define GlintLight7AmbientIntensityRedOff 0x91d8 - -#define GlintLight7AmbientIntensityGreen 0xa1e0 -#define GlintLight7AmbientIntensityGreenTag 0x043c -#define GlintLight7AmbientIntensityGreenReg 1 -#define GlintLight7AmbientIntensityGreenOff 0x91e0 - -#define GlintLight7AmbientIntensityBlue 0xa1e8 -#define GlintLight7AmbientIntensityBlueTag 0x043d -#define GlintLight7AmbientIntensityBlueReg 1 -#define GlintLight7AmbientIntensityBlueOff 0x91e8 - -#define GlintLight7DiffuseIntensityRed 0xa1f0 -#define GlintLight7DiffuseIntensityRedTag 0x043e -#define GlintLight7DiffuseIntensityRedReg 1 -#define GlintLight7DiffuseIntensityRedOff 0x91f0 - -#define GlintLight7DiffuseIntensityGreen 0xa1f8 -#define GlintLight7DiffuseIntensityGreenTag 0x043f -#define GlintLight7DiffuseIntensityGreenReg 1 -#define GlintLight7DiffuseIntensityGreenOff 0x91f8 - -#define GlintLight7DiffuseIntensityBlue 0xa200 -#define GlintLight7DiffuseIntensityBlueTag 0x0440 -#define GlintLight7DiffuseIntensityBlueReg 1 -#define GlintLight7DiffuseIntensityBlueOff 0x9200 - -#define GlintLight7SpecularIntensityRed 0xa208 -#define GlintLight7SpecularIntensityRedTag 0x0441 -#define GlintLight7SpecularIntensityRedReg 1 -#define GlintLight7SpecularIntensityRedOff 0x9208 - -#define GlintLight7SpecularIntensityGreen 0xa210 -#define GlintLight7SpecularIntensityGreenTag 0x0442 -#define GlintLight7SpecularIntensityGreenReg 1 -#define GlintLight7SpecularIntensityGreenOff 0x9210 - -#define GlintLight7SpecularIntensityBlue 0xa218 -#define GlintLight7SpecularIntensityBlueTag 0x0443 -#define GlintLight7SpecularIntensityBlueReg 1 -#define GlintLight7SpecularIntensityBlueOff 0x9218 - -#define GlintLight7PositionX 0xa220 -#define GlintLight7PositionXTag 0x0444 -#define GlintLight7PositionXReg 1 -#define GlintLight7PositionXOff 0x9220 - -#define GlintLight7PositionY 0xa228 -#define GlintLight7PositionYTag 0x0445 -#define GlintLight7PositionYReg 1 -#define GlintLight7PositionYOff 0x9228 - -#define GlintLight7PositionZ 0xa230 -#define GlintLight7PositionZTag 0x0446 -#define GlintLight7PositionZReg 1 -#define GlintLight7PositionZOff 0x9230 - -#define GlintLight7PositionW 0xa238 -#define GlintLight7PositionWTag 0x0447 -#define GlintLight7PositionWReg 1 -#define GlintLight7PositionWOff 0x9238 - -#define GlintLight7SpotlightDirectionX 0xa240 -#define GlintLight7SpotlightDirectionXTag 0x0448 -#define GlintLight7SpotlightDirectionXReg 1 -#define GlintLight7SpotlightDirectionXOff 0x9240 - -#define GlintLight7SpotlightDirectionY 0xa248 -#define GlintLight7SpotlightDirectionYTag 0x0449 -#define GlintLight7SpotlightDirectionYReg 1 -#define GlintLight7SpotlightDirectionYOff 0x9248 - -#define GlintLight7SpotlightDirectionZ 0xa250 -#define GlintLight7SpotlightDirectionZTag 0x044a -#define GlintLight7SpotlightDirectionZReg 1 -#define GlintLight7SpotlightDirectionZOff 0x9250 - -#define GlintLight7SpotlightExponent 0xa258 -#define GlintLight7SpotlightExponentTag 0x044b -#define GlintLight7SpotlightExponentReg 1 -#define GlintLight7SpotlightExponentOff 0x9258 - -#define GlintLight7CosSpotlightCutoffAngle 0xa260 -#define GlintLight7CosSpotlightCutoffAngleTag 0x044c -#define GlintLight7CosSpotlightCutoffAngleReg 1 -#define GlintLight7CosSpotlightCutoffAngleOff 0x9260 - -#define GlintLight7ConstantAttenuation 0xa268 -#define GlintLight7ConstantAttenuationTag 0x044d -#define GlintLight7ConstantAttenuationReg 1 -#define GlintLight7ConstantAttenuationOff 0x9268 - -#define GlintLight7LinearAttenuation 0xa270 -#define GlintLight7LinearAttenuationTag 0x044e -#define GlintLight7LinearAttenuationReg 1 -#define GlintLight7LinearAttenuationOff 0x9270 - -#define GlintLight7QuadraticAttenuation 0xa278 -#define GlintLight7QuadraticAttenuationTag 0x044f -#define GlintLight7QuadraticAttenuationReg 1 -#define GlintLight7QuadraticAttenuationOff 0x9278 - -#define GlintLight8Mode 0xa280 -#define GlintLight8ModeTag 0x0450 -#define GlintLight8ModeReg 1 -#define GlintLight8ModeOff 0x9280 - -#define GlintLight8AmbientIntensityRed 0xa288 -#define GlintLight8AmbientIntensityRedTag 0x0451 -#define GlintLight8AmbientIntensityRedReg 1 -#define GlintLight8AmbientIntensityRedOff 0x9288 - -#define GlintLight8AmbientIntensityGreen 0xa290 -#define GlintLight8AmbientIntensityGreenTag 0x0452 -#define GlintLight8AmbientIntensityGreenReg 1 -#define GlintLight8AmbientIntensityGreenOff 0x9290 - -#define GlintLight8AmbientIntensityBlue 0xa298 -#define GlintLight8AmbientIntensityBlueTag 0x0453 -#define GlintLight8AmbientIntensityBlueReg 1 -#define GlintLight8AmbientIntensityBlueOff 0x9298 - -#define GlintLight8DiffuseIntensityRed 0xa2a0 -#define GlintLight8DiffuseIntensityRedTag 0x0454 -#define GlintLight8DiffuseIntensityRedReg 1 -#define GlintLight8DiffuseIntensityRedOff 0x92a0 - -#define GlintLight8DiffuseIntensityGreen 0xa2a8 -#define GlintLight8DiffuseIntensityGreenTag 0x0455 -#define GlintLight8DiffuseIntensityGreenReg 1 -#define GlintLight8DiffuseIntensityGreenOff 0x92a8 - -#define GlintLight8DiffuseIntensityBlue 0xa2b0 -#define GlintLight8DiffuseIntensityBlueTag 0x0456 -#define GlintLight8DiffuseIntensityBlueReg 1 -#define GlintLight8DiffuseIntensityBlueOff 0x92b0 - -#define GlintLight8SpecularIntensityRed 0xa2b8 -#define GlintLight8SpecularIntensityRedTag 0x0457 -#define GlintLight8SpecularIntensityRedReg 1 -#define GlintLight8SpecularIntensityRedOff 0x92b8 - -#define GlintLight8SpecularIntensityGreen 0xa2c0 -#define GlintLight8SpecularIntensityGreenTag 0x0458 -#define GlintLight8SpecularIntensityGreenReg 1 -#define GlintLight8SpecularIntensityGreenOff 0x92c0 - -#define GlintLight8SpecularIntensityBlue 0xa2c8 -#define GlintLight8SpecularIntensityBlueTag 0x0459 -#define GlintLight8SpecularIntensityBlueReg 1 -#define GlintLight8SpecularIntensityBlueOff 0x92c8 - -#define GlintLight8PositionX 0xa2d0 -#define GlintLight8PositionXTag 0x045a -#define GlintLight8PositionXReg 1 -#define GlintLight8PositionXOff 0x92d0 - -#define GlintLight8PositionY 0xa2d8 -#define GlintLight8PositionYTag 0x045b -#define GlintLight8PositionYReg 1 -#define GlintLight8PositionYOff 0x92d8 - -#define GlintLight8PositionZ 0xa2e0 -#define GlintLight8PositionZTag 0x045c -#define GlintLight8PositionZReg 1 -#define GlintLight8PositionZOff 0x92e0 - -#define GlintLight8PositionW 0xa2e8 -#define GlintLight8PositionWTag 0x045d -#define GlintLight8PositionWReg 1 -#define GlintLight8PositionWOff 0x92e8 - -#define GlintLight8SpotlightDirectionX 0xa2f0 -#define GlintLight8SpotlightDirectionXTag 0x045e -#define GlintLight8SpotlightDirectionXReg 1 -#define GlintLight8SpotlightDirectionXOff 0x92f0 - -#define GlintLight8SpotlightDirectionY 0xa2f8 -#define GlintLight8SpotlightDirectionYTag 0x045f -#define GlintLight8SpotlightDirectionYReg 1 -#define GlintLight8SpotlightDirectionYOff 0x92f8 - -#define GlintLight8SpotlightDirectionZ 0xa300 -#define GlintLight8SpotlightDirectionZTag 0x0460 -#define GlintLight8SpotlightDirectionZReg 1 -#define GlintLight8SpotlightDirectionZOff 0x9300 - -#define GlintLight8SpotlightExponent 0xa308 -#define GlintLight8SpotlightExponentTag 0x0461 -#define GlintLight8SpotlightExponentReg 1 -#define GlintLight8SpotlightExponentOff 0x9308 - -#define GlintLight8CosSpotlightCutoffAngle 0xa310 -#define GlintLight8CosSpotlightCutoffAngleTag 0x0462 -#define GlintLight8CosSpotlightCutoffAngleReg 1 -#define GlintLight8CosSpotlightCutoffAngleOff 0x9310 - -#define GlintLight8ConstantAttenuation 0xa318 -#define GlintLight8ConstantAttenuationTag 0x0463 -#define GlintLight8ConstantAttenuationReg 1 -#define GlintLight8ConstantAttenuationOff 0x9318 - -#define GlintLight8LinearAttenuation 0xa320 -#define GlintLight8LinearAttenuationTag 0x0464 -#define GlintLight8LinearAttenuationReg 1 -#define GlintLight8LinearAttenuationOff 0x9320 - -#define GlintLight8QuadraticAttenuation 0xa328 -#define GlintLight8QuadraticAttenuationTag 0x0465 -#define GlintLight8QuadraticAttenuationReg 1 -#define GlintLight8QuadraticAttenuationOff 0x9328 - -#define GlintLight9Mode 0xa330 -#define GlintLight9ModeTag 0x0466 -#define GlintLight9ModeReg 1 -#define GlintLight9ModeOff 0x9330 - -#define GlintLight9AmbientIntensityRed 0xa338 -#define GlintLight9AmbientIntensityRedTag 0x0467 -#define GlintLight9AmbientIntensityRedReg 1 -#define GlintLight9AmbientIntensityRedOff 0x9338 - -#define GlintLight9AmbientIntensityGreen 0xa340 -#define GlintLight9AmbientIntensityGreenTag 0x0468 -#define GlintLight9AmbientIntensityGreenReg 1 -#define GlintLight9AmbientIntensityGreenOff 0x9340 - -#define GlintLight9AmbientIntensityBlue 0xa348 -#define GlintLight9AmbientIntensityBlueTag 0x0469 -#define GlintLight9AmbientIntensityBlueReg 1 -#define GlintLight9AmbientIntensityBlueOff 0x9348 - -#define GlintLight9DiffuseIntensityRed 0xa350 -#define GlintLight9DiffuseIntensityRedTag 0x046a -#define GlintLight9DiffuseIntensityRedReg 1 -#define GlintLight9DiffuseIntensityRedOff 0x9350 - -#define GlintLight9DiffuseIntensityGreen 0xa358 -#define GlintLight9DiffuseIntensityGreenTag 0x046b -#define GlintLight9DiffuseIntensityGreenReg 1 -#define GlintLight9DiffuseIntensityGreenOff 0x9358 - -#define GlintLight9DiffuseIntensityBlue 0xa360 -#define GlintLight9DiffuseIntensityBlueTag 0x046c -#define GlintLight9DiffuseIntensityBlueReg 1 -#define GlintLight9DiffuseIntensityBlueOff 0x9360 - -#define GlintLight9SpecularIntensityRed 0xa368 -#define GlintLight9SpecularIntensityRedTag 0x046d -#define GlintLight9SpecularIntensityRedReg 1 -#define GlintLight9SpecularIntensityRedOff 0x9368 - -#define GlintLight9SpecularIntensityGreen 0xa370 -#define GlintLight9SpecularIntensityGreenTag 0x046e -#define GlintLight9SpecularIntensityGreenReg 1 -#define GlintLight9SpecularIntensityGreenOff 0x9370 - -#define GlintLight9SpecularIntensityBlue 0xa378 -#define GlintLight9SpecularIntensityBlueTag 0x046f -#define GlintLight9SpecularIntensityBlueReg 1 -#define GlintLight9SpecularIntensityBlueOff 0x9378 - -#define GlintLight9PositionX 0xa380 -#define GlintLight9PositionXTag 0x0470 -#define GlintLight9PositionXReg 1 -#define GlintLight9PositionXOff 0x9380 - -#define GlintLight9PositionY 0xa388 -#define GlintLight9PositionYTag 0x0471 -#define GlintLight9PositionYReg 1 -#define GlintLight9PositionYOff 0x9388 - -#define GlintLight9PositionZ 0xa390 -#define GlintLight9PositionZTag 0x0472 -#define GlintLight9PositionZReg 1 -#define GlintLight9PositionZOff 0x9390 - -#define GlintLight9PositionW 0xa398 -#define GlintLight9PositionWTag 0x0473 -#define GlintLight9PositionWReg 1 -#define GlintLight9PositionWOff 0x9398 - -#define GlintLight9SpotlightDirectionX 0xa3a0 -#define GlintLight9SpotlightDirectionXTag 0x0474 -#define GlintLight9SpotlightDirectionXReg 1 -#define GlintLight9SpotlightDirectionXOff 0x93a0 - -#define GlintLight9SpotlightDirectionY 0xa3a8 -#define GlintLight9SpotlightDirectionYTag 0x0475 -#define GlintLight9SpotlightDirectionYReg 1 -#define GlintLight9SpotlightDirectionYOff 0x93a8 - -#define GlintLight9SpotlightDirectionZ 0xa3b0 -#define GlintLight9SpotlightDirectionZTag 0x0476 -#define GlintLight9SpotlightDirectionZReg 1 -#define GlintLight9SpotlightDirectionZOff 0x93b0 - -#define GlintLight9SpotlightExponent 0xa3b8 -#define GlintLight9SpotlightExponentTag 0x0477 -#define GlintLight9SpotlightExponentReg 1 -#define GlintLight9SpotlightExponentOff 0x93b8 - -#define GlintLight9CosSpotlightCutoffAngle 0xa3c0 -#define GlintLight9CosSpotlightCutoffAngleTag 0x0478 -#define GlintLight9CosSpotlightCutoffAngleReg 1 -#define GlintLight9CosSpotlightCutoffAngleOff 0x93c0 - -#define GlintLight9ConstantAttenuation 0xa3c8 -#define GlintLight9ConstantAttenuationTag 0x0479 -#define GlintLight9ConstantAttenuationReg 1 -#define GlintLight9ConstantAttenuationOff 0x93c8 - -#define GlintLight9LinearAttenuation 0xa3d0 -#define GlintLight9LinearAttenuationTag 0x047a -#define GlintLight9LinearAttenuationReg 1 -#define GlintLight9LinearAttenuationOff 0x93d0 - -#define GlintLight9QuadraticAttenuation 0xa3d8 -#define GlintLight9QuadraticAttenuationTag 0x047b -#define GlintLight9QuadraticAttenuationReg 1 -#define GlintLight9QuadraticAttenuationOff 0x93d8 - -#define GlintLight10Mode 0xa3e0 -#define GlintLight10ModeTag 0x047c -#define GlintLight10ModeReg 1 -#define GlintLight10ModeOff 0x93e0 - -#define GlintLight10AmbientIntensityRed 0xa3e8 -#define GlintLight10AmbientIntensityRedTag 0x047d -#define GlintLight10AmbientIntensityRedReg 1 -#define GlintLight10AmbientIntensityRedOff 0x93e8 - -#define GlintLight10AmbientIntensityGreen 0xa3f0 -#define GlintLight10AmbientIntensityGreenTag 0x047e -#define GlintLight10AmbientIntensityGreenReg 1 -#define GlintLight10AmbientIntensityGreenOff 0x93f0 - -#define GlintLight10AmbientIntensityBlue 0xa3f8 -#define GlintLight10AmbientIntensityBlueTag 0x047f -#define GlintLight10AmbientIntensityBlueReg 1 -#define GlintLight10AmbientIntensityBlueOff 0x93f8 - -#define GlintLight10DiffuseIntensityRed 0xa400 -#define GlintLight10DiffuseIntensityRedTag 0x0480 -#define GlintLight10DiffuseIntensityRedReg 1 -#define GlintLight10DiffuseIntensityRedOff 0x9400 - -#define GlintLight10DiffuseIntensityGreen 0xa408 -#define GlintLight10DiffuseIntensityGreenTag 0x0481 -#define GlintLight10DiffuseIntensityGreenReg 1 -#define GlintLight10DiffuseIntensityGreenOff 0x9408 - -#define GlintLight10DiffuseIntensityBlue 0xa410 -#define GlintLight10DiffuseIntensityBlueTag 0x0482 -#define GlintLight10DiffuseIntensityBlueReg 1 -#define GlintLight10DiffuseIntensityBlueOff 0x9410 - -#define GlintLight10SpecularIntensityRed 0xa418 -#define GlintLight10SpecularIntensityRedTag 0x0483 -#define GlintLight10SpecularIntensityRedReg 1 -#define GlintLight10SpecularIntensityRedOff 0x9418 - -#define GlintLight10SpecularIntensityGreen 0xa420 -#define GlintLight10SpecularIntensityGreenTag 0x0484 -#define GlintLight10SpecularIntensityGreenReg 1 -#define GlintLight10SpecularIntensityGreenOff 0x9420 - -#define GlintLight10SpecularIntensityBlue 0xa428 -#define GlintLight10SpecularIntensityBlueTag 0x0485 -#define GlintLight10SpecularIntensityBlueReg 1 -#define GlintLight10SpecularIntensityBlueOff 0x9428 - -#define GlintLight10PositionX 0xa430 -#define GlintLight10PositionXTag 0x0486 -#define GlintLight10PositionXReg 1 -#define GlintLight10PositionXOff 0x9430 - -#define GlintLight10PositionY 0xa438 -#define GlintLight10PositionYTag 0x0487 -#define GlintLight10PositionYReg 1 -#define GlintLight10PositionYOff 0x9438 - -#define GlintLight10PositionZ 0xa440 -#define GlintLight10PositionZTag 0x0488 -#define GlintLight10PositionZReg 1 -#define GlintLight10PositionZOff 0x9440 - -#define GlintLight10PositionW 0xa448 -#define GlintLight10PositionWTag 0x0489 -#define GlintLight10PositionWReg 1 -#define GlintLight10PositionWOff 0x9448 - -#define GlintLight10SpotlightDirectionX 0xa450 -#define GlintLight10SpotlightDirectionXTag 0x048a -#define GlintLight10SpotlightDirectionXReg 1 -#define GlintLight10SpotlightDirectionXOff 0x9450 - -#define GlintLight10SpotlightDirectionY 0xa458 -#define GlintLight10SpotlightDirectionYTag 0x048b -#define GlintLight10SpotlightDirectionYReg 1 -#define GlintLight10SpotlightDirectionYOff 0x9458 - -#define GlintLight10SpotlightDirectionZ 0xa460 -#define GlintLight10SpotlightDirectionZTag 0x048c -#define GlintLight10SpotlightDirectionZReg 1 -#define GlintLight10SpotlightDirectionZOff 0x9460 - -#define GlintLight10SpotlightExponent 0xa468 -#define GlintLight10SpotlightExponentTag 0x048d -#define GlintLight10SpotlightExponentReg 1 -#define GlintLight10SpotlightExponentOff 0x9468 - -#define GlintLight10CosSpotlightCutoffAngle 0xa470 -#define GlintLight10CosSpotlightCutoffAngleTag 0x048e -#define GlintLight10CosSpotlightCutoffAngleReg 1 -#define GlintLight10CosSpotlightCutoffAngleOff 0x9470 - -#define GlintLight10ConstantAttenuation 0xa478 -#define GlintLight10ConstantAttenuationTag 0x048f -#define GlintLight10ConstantAttenuationReg 1 -#define GlintLight10ConstantAttenuationOff 0x9478 - -#define GlintLight10LinearAttenuation 0xa480 -#define GlintLight10LinearAttenuationTag 0x0490 -#define GlintLight10LinearAttenuationReg 1 -#define GlintLight10LinearAttenuationOff 0x9480 - -#define GlintLight10QuadraticAttenuation 0xa488 -#define GlintLight10QuadraticAttenuationTag 0x0491 -#define GlintLight10QuadraticAttenuationReg 1 -#define GlintLight10QuadraticAttenuationOff 0x9488 - -#define GlintLight11Mode 0xa490 -#define GlintLight11ModeTag 0x0492 -#define GlintLight11ModeReg 1 -#define GlintLight11ModeOff 0x9490 - -#define GlintLight11AmbientIntensiveRed 0xa498 -#define GlintLight11AmbientIntensiveRedTag 0x0493 -#define GlintLight11AmbientIntensiveRedReg 1 -#define GlintLight11AmbientIntensiveRedOff 0x9498 - -#define GlintLight11AmbientIntensityGreen 0xa4a0 -#define GlintLight11AmbientIntensityGreenTag 0x0494 -#define GlintLight11AmbientIntensityGreenReg 1 -#define GlintLight11AmbientIntensityGreenOff 0x94a0 - -#define GlintLight11AmbientIntensityBlue 0xa4a8 -#define GlintLight11AmbientIntensityBlueTag 0x0495 -#define GlintLight11AmbientIntensityBlueReg 1 -#define GlintLight11AmbientIntensityBlueOff 0x94a8 - -#define GlintLight11DiffuseIntensityRed 0xa4b0 -#define GlintLight11DiffuseIntensityRedTag 0x0496 -#define GlintLight11DiffuseIntensityRedReg 1 -#define GlintLight11DiffuseIntensityRedOff 0x94b0 - -#define GlintLight11DiffuseIntensityGreen 0xa4b8 -#define GlintLight11DiffuseIntensityGreenTag 0x0497 -#define GlintLight11DiffuseIntensityGreenReg 1 -#define GlintLight11DiffuseIntensityGreenOff 0x94b8 - -#define GlintLight11DiffuseIntensityBlue 0xa4c0 -#define GlintLight11DiffuseIntensityBlueTag 0x0498 -#define GlintLight11DiffuseIntensityBlueReg 1 -#define GlintLight11DiffuseIntensityBlueOff 0x94c0 - -#define GlintLight11SpecularIntensityRed 0xa4c8 -#define GlintLight11SpecularIntensityRedTag 0x0499 -#define GlintLight11SpecularIntensityRedReg 1 -#define GlintLight11SpecularIntensityRedOff 0x94c8 - -#define GlintLight11SpecularIntensityGreen 0xa4d0 -#define GlintLight11SpecularIntensityGreenTag 0x049a -#define GlintLight11SpecularIntensityGreenReg 1 -#define GlintLight11SpecularIntensityGreenOff 0x94d0 - -#define GlintLight11SpecularIntensityBlue 0xa4d8 -#define GlintLight11SpecularIntensityBlueTag 0x049b -#define GlintLight11SpecularIntensityBlueReg 1 -#define GlintLight11SpecularIntensityBlueOff 0x94d8 - -#define GlintLight11PositionX 0xa4e0 -#define GlintLight11PositionXTag 0x049c -#define GlintLight11PositionXReg 1 -#define GlintLight11PositionXOff 0x94e0 - -#define GlintLight11PositionY 0xa4e8 -#define GlintLight11PositionYTag 0x049d -#define GlintLight11PositionYReg 1 -#define GlintLight11PositionYOff 0x94e8 - -#define GlintLight11PositionZ 0xa4f0 -#define GlintLight11PositionZTag 0x049e -#define GlintLight11PositionZReg 1 -#define GlintLight11PositionZOff 0x94f0 - -#define GlintLight11PositionW 0xa4f8 -#define GlintLight11PositionWTag 0x049f -#define GlintLight11PositionWReg 1 -#define GlintLight11PositionWOff 0x94f8 - -#define GlintLight11SpotlightDirectionX 0xa500 -#define GlintLight11SpotlightDirectionXTag 0x04a0 -#define GlintLight11SpotlightDirectionXReg 1 -#define GlintLight11SpotlightDirectionXOff 0x9500 - -#define GlintLight11SpotlightDirectionY 0xa508 -#define GlintLight11SpotlightDirectionYTag 0x04a1 -#define GlintLight11SpotlightDirectionYReg 1 -#define GlintLight11SpotlightDirectionYOff 0x9508 - -#define GlintLight11SpotlightDirectionZ 0xa510 -#define GlintLight11SpotlightDirectionZTag 0x04a2 -#define GlintLight11SpotlightDirectionZReg 1 -#define GlintLight11SpotlightDirectionZOff 0x9510 - -#define GlintLight11SpotlightExponent 0xa518 -#define GlintLight11SpotlightExponentTag 0x04a3 -#define GlintLight11SpotlightExponentReg 1 -#define GlintLight11SpotlightExponentOff 0x9518 - -#define GlintLight11CosSpotlightCutoffAngle 0xa520 -#define GlintLight11CosSpotlightCutoffAngleTag 0x04a4 -#define GlintLight11CosSpotlightCutoffAngleReg 1 -#define GlintLight11CosSpotlightCutoffAngleOff 0x9520 - -#define GlintLight11ConstantAttenuation 0xa528 -#define GlintLight11ConstantAttenuationTag 0x04a5 -#define GlintLight11ConstantAttenuationReg 1 -#define GlintLight11ConstantAttenuationOff 0x9528 - -#define GlintLight11LinearAttenuation 0xa530 -#define GlintLight11LinearAttenuationTag 0x04a6 -#define GlintLight11LinearAttenuationReg 1 -#define GlintLight11LinearAttenuationOff 0x9530 - -#define GlintLight11QuadraticAttenuation 0xa538 -#define GlintLight11QuadraticAttenuationTag 0x04a7 -#define GlintLight11QuadraticAttenuationReg 1 -#define GlintLight11QuadraticAttenuationOff 0x9538 - -#define GlintLight12Mode 0xa540 -#define GlintLight12ModeTag 0x04a8 -#define GlintLight12ModeReg 1 -#define GlintLight12ModeOff 0x9540 - -#define GlintLight12AmbientIntensityRed 0xa548 -#define GlintLight12AmbientIntensityRedTag 0x04a9 -#define GlintLight12AmbientIntensityRedReg 1 -#define GlintLight12AmbientIntensityRedOff 0x9548 - -#define GlintLight12AmbientIntensityGreen 0xa550 -#define GlintLight12AmbientIntensityGreenTag 0x04aa -#define GlintLight12AmbientIntensityGreenReg 1 -#define GlintLight12AmbientIntensityGreenOff 0x9550 - -#define GlintLight12AmbientIntensityBlue 0xa558 -#define GlintLight12AmbientIntensityBlueTag 0x04ab -#define GlintLight12AmbientIntensityBlueReg 1 -#define GlintLight12AmbientIntensityBlueOff 0x9558 - -#define GlintLight12DiffuseIntensityRed 0xa560 -#define GlintLight12DiffuseIntensityRedTag 0x04ac -#define GlintLight12DiffuseIntensityRedReg 1 -#define GlintLight12DiffuseIntensityRedOff 0x9560 - -#define GlintLight12DiffuseIntensityGreen 0xa568 -#define GlintLight12DiffuseIntensityGreenTag 0x04ad -#define GlintLight12DiffuseIntensityGreenReg 1 -#define GlintLight12DiffuseIntensityGreenOff 0x9568 - -#define GlintLight12DiffuseIntensityBlue 0xa570 -#define GlintLight12DiffuseIntensityBlueTag 0x04ae -#define GlintLight12DiffuseIntensityBlueReg 1 -#define GlintLight12DiffuseIntensityBlueOff 0x9570 - -#define GlintLight12SpecularIntensityRed 0xa578 -#define GlintLight12SpecularIntensityRedTag 0x04af -#define GlintLight12SpecularIntensityRedReg 1 -#define GlintLight12SpecularIntensityRedOff 0x9578 - -#define GlintLight12SpecularIntensityGreen 0xa580 -#define GlintLight12SpecularIntensityGreenTag 0x04b0 -#define GlintLight12SpecularIntensityGreenReg 1 -#define GlintLight12SpecularIntensityGreenOff 0x9580 - -#define GlintLight12SpecularIntensityBlue 0xa588 -#define GlintLight12SpecularIntensityBlueTag 0x04b1 -#define GlintLight12SpecularIntensityBlueReg 1 -#define GlintLight12SpecularIntensityBlueOff 0x9588 - -#define GlintLight12PositionX 0xa590 -#define GlintLight12PositionXTag 0x04b2 -#define GlintLight12PositionXReg 1 -#define GlintLight12PositionXOff 0x9590 - -#define GlintLight12PositionY 0xa598 -#define GlintLight12PositionYTag 0x04b3 -#define GlintLight12PositionYReg 1 -#define GlintLight12PositionYOff 0x9598 - -#define GlintLight12PositionZ 0xa5a0 -#define GlintLight12PositionZTag 0x04b4 -#define GlintLight12PositionZReg 1 -#define GlintLight12PositionZOff 0x95a0 - -#define GlintLight12PositionW 0xa5a8 -#define GlintLight12PositionWTag 0x04b5 -#define GlintLight12PositionWReg 1 -#define GlintLight12PositionWOff 0x95a8 - -#define GlintLight12SpotlightDirectionX 0xa5b0 -#define GlintLight12SpotlightDirectionXTag 0x04b6 -#define GlintLight12SpotlightDirectionXReg 1 -#define GlintLight12SpotlightDirectionXOff 0x95b0 - -#define GlintLight12SpotlightDirectionY 0xa5b8 -#define GlintLight12SpotlightDirectionYTag 0x04b7 -#define GlintLight12SpotlightDirectionYReg 1 -#define GlintLight12SpotlightDirectionYOff 0x95b8 - -#define GlintLight12SpotlightDirectionZ 0xa5c0 -#define GlintLight12SpotlightDirectionZTag 0x04b8 -#define GlintLight12SpotlightDirectionZReg 1 -#define GlintLight12SpotlightDirectionZOff 0x95c0 - -#define GlintLight12SpotlightExponent 0xa5c8 -#define GlintLight12SpotlightExponentTag 0x04b9 -#define GlintLight12SpotlightExponentReg 1 -#define GlintLight12SpotlightExponentOff 0x95c8 - -#define GlintLight12CosSpotlightCutoffAngle 0xa5d0 -#define GlintLight12CosSpotlightCutoffAngleTag 0x04ba -#define GlintLight12CosSpotlightCutoffAngleReg 1 -#define GlintLight12CosSpotlightCutoffAngleOff 0x95d0 - -#define GlintLight12ConstantAttenuation 0xa5d8 -#define GlintLight12ConstantAttenuationTag 0x04bb -#define GlintLight12ConstantAttenuationReg 1 -#define GlintLight12ConstantAttenuationOff 0x95d8 - -#define GlintLight12LinearAttenuation 0xa5e0 -#define GlintLight12LinearAttenuationTag 0x04bc -#define GlintLight12LinearAttenuationReg 1 -#define GlintLight12LinearAttenuationOff 0x95e0 - -#define GlintLight12QuadraticAttenuation 0xa5e8 -#define GlintLight12QuadraticAttenuationTag 0x04bd -#define GlintLight12QuadraticAttenuationReg 1 -#define GlintLight12QuadraticAttenuationOff 0x95e8 - -#define GlintLight13Mode 0xa5f0 -#define GlintLight13ModeTag 0x04be -#define GlintLight13ModeReg 1 -#define GlintLight13ModeOff 0x95f0 - -#define GlintLight13AmbientIntensityRed 0xa5f8 -#define GlintLight13AmbientIntensityRedTag 0x04bf -#define GlintLight13AmbientIntensityRedReg 1 -#define GlintLight13AmbientIntensityRedOff 0x95f8 - -#define GlintLight13AmbientIntensityGreen 0xa600 -#define GlintLight13AmbientIntensityGreenTag 0x04c0 -#define GlintLight13AmbientIntensityGreenReg 1 -#define GlintLight13AmbientIntensityGreenOff 0x9600 - -#define GlintLight13AmbientIntensityBlue 0xa608 -#define GlintLight13AmbientIntensityBlueTag 0x04c1 -#define GlintLight13AmbientIntensityBlueReg 1 -#define GlintLight13AmbientIntensityBlueOff 0x9608 - -#define GlintLight13DiffuseIntensityRed 0xa610 -#define GlintLight13DiffuseIntensityRedTag 0x04c2 -#define GlintLight13DiffuseIntensityRedReg 1 -#define GlintLight13DiffuseIntensityRedOff 0x9610 - -#define GlintLight13DiffuseIntensityGreen 0xa618 -#define GlintLight13DiffuseIntensityGreenTag 0x04c3 -#define GlintLight13DiffuseIntensityGreenReg 1 -#define GlintLight13DiffuseIntensityGreenOff 0x9618 - -#define GlintLight13DiffuseIntensityBlue 0xa620 -#define GlintLight13DiffuseIntensityBlueTag 0x04c4 -#define GlintLight13DiffuseIntensityBlueReg 1 -#define GlintLight13DiffuseIntensityBlueOff 0x9620 - -#define GlintLight13SpecularIntensityRed 0xa628 -#define GlintLight13SpecularIntensityRedTag 0x04c5 -#define GlintLight13SpecularIntensityRedReg 1 -#define GlintLight13SpecularIntensityRedOff 0x9628 - -#define GlintLight13SpecularIntensityGreen 0xa630 -#define GlintLight13SpecularIntensityGreenTag 0x04c6 -#define GlintLight13SpecularIntensityGreenReg 1 -#define GlintLight13SpecularIntensityGreenOff 0x9630 - -#define GlintLight13SpecularIntensityBlue 0xa638 -#define GlintLight13SpecularIntensityBlueTag 0x04c7 -#define GlintLight13SpecularIntensityBlueReg 1 -#define GlintLight13SpecularIntensityBlueOff 0x9638 - -#define GlintLight13PositionX 0xa640 -#define GlintLight13PositionXTag 0x04c8 -#define GlintLight13PositionXReg 1 -#define GlintLight13PositionXOff 0x9640 - -#define GlintLight13PositionY 0xa648 -#define GlintLight13PositionYTag 0x04c9 -#define GlintLight13PositionYReg 1 -#define GlintLight13PositionYOff 0x9648 - -#define GlintLight13PositionZ 0xa650 -#define GlintLight13PositionZTag 0x04ca -#define GlintLight13PositionZReg 1 -#define GlintLight13PositionZOff 0x9650 - -#define GlintLight13PositionW 0xa658 -#define GlintLight13PositionWTag 0x04cb -#define GlintLight13PositionWReg 1 -#define GlintLight13PositionWOff 0x9658 - -#define GlintLight13SpotlightDirectionX 0xa660 -#define GlintLight13SpotlightDirectionXTag 0x04cc -#define GlintLight13SpotlightDirectionXReg 1 -#define GlintLight13SpotlightDirectionXOff 0x9660 - -#define GlintLight13SpotlightDirectionY 0xa668 -#define GlintLight13SpotlightDirectionYTag 0x04cd -#define GlintLight13SpotlightDirectionYReg 1 -#define GlintLight13SpotlightDirectionYOff 0x9668 - -#define GlintLight13SpotlightDirectionZ 0xa670 -#define GlintLight13SpotlightDirectionZTag 0x04ce -#define GlintLight13SpotlightDirectionZReg 1 -#define GlintLight13SpotlightDirectionZOff 0x9670 - -#define GlintLight13SpotlightExponent 0xa678 -#define GlintLight13SpotlightExponentTag 0x04cf -#define GlintLight13SpotlightExponentReg 1 -#define GlintLight13SpotlightExponentOff 0x9678 - -#define GlintLight13CosSpotlightCutoffAngle 0xa680 -#define GlintLight13CosSpotlightCutoffAngleTag 0x04d0 -#define GlintLight13CosSpotlightCutoffAngleReg 1 -#define GlintLight13CosSpotlightCutoffAngleOff 0x9680 - -#define GlintLight13ConstantAttenuation 0xa688 -#define GlintLight13ConstantAttenuationTag 0x04d1 -#define GlintLight13ConstantAttenuationReg 1 -#define GlintLight13ConstantAttenuationOff 0x9688 - -#define GlintLight13LinearAttenuation 0xa690 -#define GlintLight13LinearAttenuationTag 0x04d2 -#define GlintLight13LinearAttenuationReg 1 -#define GlintLight13LinearAttenuationOff 0x9690 - -#define GlintLight13QuadraticAttenuation 0xa698 -#define GlintLight13QuadraticAttenuationTag 0x04d3 -#define GlintLight13QuadraticAttenuationReg 1 -#define GlintLight13QuadraticAttenuationOff 0x9698 - -#define GlintLight14Mode 0xa6a0 -#define GlintLight14ModeTag 0x04d4 -#define GlintLight14ModeReg 1 -#define GlintLight14ModeOff 0x96a0 - -#define GlintLight14AmbientIntensityRed 0xa6a8 -#define GlintLight14AmbientIntensityRedTag 0x04d5 -#define GlintLight14AmbientIntensityRedReg 1 -#define GlintLight14AmbientIntensityRedOff 0x96a8 - -#define GlintLight14AmbientIntensityGreen 0xa6b0 -#define GlintLight14AmbientIntensityGreenTag 0x04d6 -#define GlintLight14AmbientIntensityGreenReg 1 -#define GlintLight14AmbientIntensityGreenOff 0x96b0 - -#define GlintLight14AmbientIntensityBlue 0xa6b8 -#define GlintLight14AmbientIntensityBlueTag 0x04d7 -#define GlintLight14AmbientIntensityBlueReg 1 -#define GlintLight14AmbientIntensityBlueOff 0x96b8 - -#define GlintLight14DiffuseIntensityRed 0xa6c0 -#define GlintLight14DiffuseIntensityRedTag 0x04d8 -#define GlintLight14DiffuseIntensityRedReg 1 -#define GlintLight14DiffuseIntensityRedOff 0x96c0 - -#define GlintLight14DiffuseIntensityGreen 0xa6c8 -#define GlintLight14DiffuseIntensityGreenTag 0x04d9 -#define GlintLight14DiffuseIntensityGreenReg 1 -#define GlintLight14DiffuseIntensityGreenOff 0x96c8 - -#define GlintLight14DiffuseIntensityBlue 0xa6d0 -#define GlintLight14DiffuseIntensityBlueTag 0x04da -#define GlintLight14DiffuseIntensityBlueReg 1 -#define GlintLight14DiffuseIntensityBlueOff 0x96d0 - -#define GlintLight14SpecularIntensityRed 0xa6d8 -#define GlintLight14SpecularIntensityRedTag 0x04db -#define GlintLight14SpecularIntensityRedReg 1 -#define GlintLight14SpecularIntensityRedOff 0x96d8 - -#define GlintLight14SpecularIntensityGreen 0xa6e0 -#define GlintLight14SpecularIntensityGreenTag 0x04dc -#define GlintLight14SpecularIntensityGreenReg 1 -#define GlintLight14SpecularIntensityGreenOff 0x96e0 - -#define GlintLight14SpecularIntensityBlue 0xa6e8 -#define GlintLight14SpecularIntensityBlueTag 0x04dd -#define GlintLight14SpecularIntensityBlueReg 1 -#define GlintLight14SpecularIntensityBlueOff 0x96e8 - -#define GlintLight14PositionX 0xa6f0 -#define GlintLight14PositionXTag 0x04de -#define GlintLight14PositionXReg 1 -#define GlintLight14PositionXOff 0x96f0 - -#define GlintLight14PositionY 0xa6f8 -#define GlintLight14PositionYTag 0x04df -#define GlintLight14PositionYReg 1 -#define GlintLight14PositionYOff 0x96f8 - -#define GlintLight14PositionZ 0xa700 -#define GlintLight14PositionZTag 0x04e0 -#define GlintLight14PositionZReg 1 -#define GlintLight14PositionZOff 0x9700 - -#define GlintLight14PositionW 0xa708 -#define GlintLight14PositionWTag 0x04e1 -#define GlintLight14PositionWReg 1 -#define GlintLight14PositionWOff 0x9708 - -#define GlintLight14SpotlightDirectionX 0xa710 -#define GlintLight14SpotlightDirectionXTag 0x04e2 -#define GlintLight14SpotlightDirectionXReg 1 -#define GlintLight14SpotlightDirectionXOff 0x9710 - -#define GlintLight14SpotlightDirectionY 0xa718 -#define GlintLight14SpotlightDirectionYTag 0x04e3 -#define GlintLight14SpotlightDirectionYReg 1 -#define GlintLight14SpotlightDirectionYOff 0x9718 - -#define GlintLight14SpotlightDirectionZ 0xa720 -#define GlintLight14SpotlightDirectionZTag 0x04e4 -#define GlintLight14SpotlightDirectionZReg 1 -#define GlintLight14SpotlightDirectionZOff 0x9720 - -#define GlintLight14SpotlightExponent 0xa728 -#define GlintLight14SpotlightExponentTag 0x04e5 -#define GlintLight14SpotlightExponentReg 1 -#define GlintLight14SpotlightExponentOff 0x9728 - -#define GlintLight14CosSpotlightCutoffAngle 0xa730 -#define GlintLight14CosSpotlightCutoffAngleTag 0x04e6 -#define GlintLight14CosSpotlightCutoffAngleReg 1 -#define GlintLight14CosSpotlightCutoffAngleOff 0x9730 - -#define GlintLight14ConstantAttenuation 0xa738 -#define GlintLight14ConstantAttenuationTag 0x04e7 -#define GlintLight14ConstantAttenuationReg 1 -#define GlintLight14ConstantAttenuationOff 0x9738 - -#define GlintLight14LinearAttenuation 0xa740 -#define GlintLight14LinearAttenuationTag 0x04e8 -#define GlintLight14LinearAttenuationReg 1 -#define GlintLight14LinearAttenuationOff 0x9740 - -#define GlintLight14QuadraticAttenuation 0xa748 -#define GlintLight14QuadraticAttenuationTag 0x04e9 -#define GlintLight14QuadraticAttenuationReg 1 -#define GlintLight14QuadraticAttenuationOff 0x9748 - -#define GlintLight15Mode 0xa750 -#define GlintLight15ModeTag 0x04ea -#define GlintLight15ModeReg 1 -#define GlintLight15ModeOff 0x9750 - -#define GlintLight15AmbientIntensityRed 0xa758 -#define GlintLight15AmbientIntensityRedTag 0x04eb -#define GlintLight15AmbientIntensityRedReg 1 -#define GlintLight15AmbientIntensityRedOff 0x9758 - -#define GlintLight15AmbientIntensityGreen 0xa760 -#define GlintLight15AmbientIntensityGreenTag 0x04ec -#define GlintLight15AmbientIntensityGreenReg 1 -#define GlintLight15AmbientIntensityGreenOff 0x9760 - -#define GlintLight15AmbientIntensityBlue 0xa768 -#define GlintLight15AmbientIntensityBlueTag 0x04ed -#define GlintLight15AmbientIntensityBlueReg 1 -#define GlintLight15AmbientIntensityBlueOff 0x9768 - -#define GlintLight15DiffuseIntensityRed 0xa770 -#define GlintLight15DiffuseIntensityRedTag 0x04ee -#define GlintLight15DiffuseIntensityRedReg 1 -#define GlintLight15DiffuseIntensityRedOff 0x9770 - -#define GlintLight15DiffuseIntensityGreen 0xa778 -#define GlintLight15DiffuseIntensityGreenTag 0x04ef -#define GlintLight15DiffuseIntensityGreenReg 1 -#define GlintLight15DiffuseIntensityGreenOff 0x9778 - -#define GlintLight15DiffuseIntensityBlue 0xa780 -#define GlintLight15DiffuseIntensityBlueTag 0x04f0 -#define GlintLight15DiffuseIntensityBlueReg 1 -#define GlintLight15DiffuseIntensityBlueOff 0x9780 - -#define GlintLight15SpecularIntensityRed 0xa788 -#define GlintLight15SpecularIntensityRedTag 0x04f1 -#define GlintLight15SpecularIntensityRedReg 1 -#define GlintLight15SpecularIntensityRedOff 0x9788 - -#define GlintLight15SpecularIntensityGreen 0xa790 -#define GlintLight15SpecularIntensityGreenTag 0x04f2 -#define GlintLight15SpecularIntensityGreenReg 1 -#define GlintLight15SpecularIntensityGreenOff 0x9790 - -#define GlintLight15SpecularIntensityBlue 0xa798 -#define GlintLight15SpecularIntensityBlueTag 0x04f3 -#define GlintLight15SpecularIntensityBlueReg 1 -#define GlintLight15SpecularIntensityBlueOff 0x9798 - -#define GlintLight15PositionX 0xa7a0 -#define GlintLight15PositionXTag 0x04f4 -#define GlintLight15PositionXReg 1 -#define GlintLight15PositionXOff 0x97a0 - -#define GlintLight15PositionY 0xa7a8 -#define GlintLight15PositionYTag 0x04f5 -#define GlintLight15PositionYReg 1 -#define GlintLight15PositionYOff 0x97a8 - -#define GlintLight15PositionZ 0xa7b0 -#define GlintLight15PositionZTag 0x04f6 -#define GlintLight15PositionZReg 1 -#define GlintLight15PositionZOff 0x97b0 - -#define GlintLight15PositionW 0xa7b8 -#define GlintLight15PositionWTag 0x04f7 -#define GlintLight15PositionWReg 1 -#define GlintLight15PositionWOff 0x97b8 - -#define GlintLight15SpotlightDirectionX 0xa7c0 -#define GlintLight15SpotlightDirectionXTag 0x04f8 -#define GlintLight15SpotlightDirectionXReg 1 -#define GlintLight15SpotlightDirectionXOff 0x97c0 - -#define GlintLight15SpotlightDirectionY 0xa7c8 -#define GlintLight15SpotlightDirectionYTag 0x04f9 -#define GlintLight15SpotlightDirectionYReg 1 -#define GlintLight15SpotlightDirectionYOff 0x97c8 - -#define GlintLight15SpotlightDirectionZ 0xa7d0 -#define GlintLight15SpotlightDirectionZTag 0x04fa -#define GlintLight15SpotlightDirectionZReg 1 -#define GlintLight15SpotlightDirectionZOff 0x97d0 - -#define GlintLight15SpotlightExponent 0xa7d8 -#define GlintLight15SpotlightExponentTag 0x04fb -#define GlintLight15SpotlightExponentReg 1 -#define GlintLight15SpotlightExponentOff 0x97d8 - -#define GlintLight15CosSpotlightCutoffAngle 0xa7e0 -#define GlintLight15CosSpotlightCutoffAngleTag 0x04fc -#define GlintLight15CosSpotlightCutoffAngleReg 1 -#define GlintLight15CosSpotlightCutoffAngleOff 0x97e0 - -#define GlintLight15ConstantAttenuation 0xa7e8 -#define GlintLight15ConstantAttenuationTag 0x04fd -#define GlintLight15ConstantAttenuationReg 1 -#define GlintLight15ConstantAttenuationOff 0x97e8 - -#define GlintLight15LinearAttenuation 0xa7f0 -#define GlintLight15LinearAttenuationTag 0x04fe -#define GlintLight15LinearAttenuationReg 1 -#define GlintLight15LinearAttenuationOff 0x97f0 - -#define GlintLight15QuadraticAttenuation 0xa7f8 -#define GlintLight15QuadraticAttenuationTag 0x04ff -#define GlintLight15QuadraticAttenuationReg 1 -#define GlintLight15QuadraticAttenuationOff 0x97f8 - -#define GlintSceneAmbientColorRed 0xa800 -#define GlintSceneAmbientColorRedTag 0x0500 -#define GlintSceneAmbientColorRedReg 1 -#define GlintSceneAmbientColorRedOff 0x9800 - -#define GlintSceneAmbientColorGreen 0xa808 -#define GlintSceneAmbientColorGreenTag 0x0501 -#define GlintSceneAmbientColorGreenReg 1 -#define GlintSceneAmbientColorGreenOff 0x9808 - -#define GlintSceneAmbientColorBlue 0xa810 -#define GlintSceneAmbientColorBlueTag 0x0502 -#define GlintSceneAmbientColorBlueReg 1 -#define GlintSceneAmbientColorBlueOff 0x9810 - -#define GlintFrontAmbientColorRed 0xa880 -#define GlintFrontAmbientColorRedTag 0x0510 -#define GlintFrontAmbientColorRedReg 1 -#define GlintFrontAmbientColorRedOff 0x9880 - -#define GlintFrontAmbientColorGreen 0xa888 -#define GlintFrontAmbientColorGreenTag 0x0511 -#define GlintFrontAmbientColorGreenReg 1 -#define GlintFrontAmbientColorGreenOff 0x9888 - -#define GlintFrontAmbientColorBlue 0xa890 -#define GlintFrontAmbientColorBlueTag 0x0512 -#define GlintFrontAmbientColorBlueReg 1 -#define GlintFrontAmbientColorBlueOff 0x9890 - -#define GlintFrontDiffuseColorRed 0xa898 -#define GlintFrontDiffuseColorRedTag 0x0513 -#define GlintFrontDiffuseColorRedReg 1 -#define GlintFrontDiffuseColorRedOff 0x9898 - -#define GlintFrontDiffuseColorGreen 0xa8a0 -#define GlintFrontDiffuseColorGreenTag 0x0514 -#define GlintFrontDiffuseColorGreenReg 1 -#define GlintFrontDiffuseColorGreenOff 0x98a0 - -#define GlintFrontDiffuseColorBlue 0xa8a8 -#define GlintFrontDiffuseColorBlueTag 0x0515 -#define GlintFrontDiffuseColorBlueReg 1 -#define GlintFrontDiffuseColorBlueOff 0x98a8 - -#define GlintFrontAlpha 0xa8b0 -#define GlintFrontAlphaTag 0x0516 -#define GlintFrontAlphaReg 1 -#define GlintFrontAlphaOff 0x98b0 - -#define GlintFrontSpecularColorRed 0xa8b8 -#define GlintFrontSpecularColorRedTag 0x0517 -#define GlintFrontSpecularColorRedReg 1 -#define GlintFrontSpecularColorRedOff 0x98b8 - -#define GlintFrontSpecularColorGreen 0xa8c0 -#define GlintFrontSpecularColorGreenTag 0x0518 -#define GlintFrontSpecularColorGreenReg 1 -#define GlintFrontSpecularColorGreenOff 0x98c0 - -#define GlintFrontSpecularColorBlue 0xa8c8 -#define GlintFrontSpecularColorBlueTag 0x0519 -#define GlintFrontSpecularColorBlueReg 1 -#define GlintFrontSpecularColorBlueOff 0x98c8 - -#define GlintFrontEmissiveColorRed 0xa8d0 -#define GlintFrontEmissiveColorRedTag 0x051a -#define GlintFrontEmissiveColorRedReg 1 -#define GlintFrontEmissiveColorRedOff 0x98d0 - -#define GlintFrontEmissiveColorGreen 0xa8d8 -#define GlintFrontEmissiveColorGreenTag 0x051b -#define GlintFrontEmissiveColorGreenReg 1 -#define GlintFrontEmissiveColorGreenOff 0x98d8 - -#define GlintFrontEmissiveColorBlue 0xa8e0 -#define GlintFrontEmissiveColorBlueTag 0x051c -#define GlintFrontEmissiveColorBlueReg 1 -#define GlintFrontEmissiveColorBlueOff 0x98e0 - -#define GlintFrontSpecularExponent 0xa8e8 -#define GlintFrontSpecularExponentTag 0x051d -#define GlintFrontSpecularExponentReg 1 -#define GlintFrontSpecularExponentOff 0x98e8 - -#define GlintBackAmbientColorRed 0xa900 -#define GlintBackAmbientColorRedTag 0x0520 -#define GlintBackAmbientColorRedReg 1 -#define GlintBackAmbientColorRedOff 0x9900 - -#define GlintBackAmbientColorGreen 0xa908 -#define GlintBackAmbientColorGreenTag 0x0521 -#define GlintBackAmbientColorGreenReg 1 -#define GlintBackAmbientColorGreenOff 0x9908 - -#define GlintBackAmbientColorBlue 0xa910 -#define GlintBackAmbientColorBlueTag 0x0522 -#define GlintBackAmbientColorBlueReg 1 -#define GlintBackAmbientColorBlueOff 0x9910 - -#define GlintBackDiffuseColorRed 0xa918 -#define GlintBackDiffuseColorRedTag 0x0523 -#define GlintBackDiffuseColorRedReg 1 -#define GlintBackDiffuseColorRedOff 0x9918 - -#define GlintBackDiffuseColorGreen 0xa920 -#define GlintBackDiffuseColorGreenTag 0x0524 -#define GlintBackDiffuseColorGreenReg 1 -#define GlintBackDiffuseColorGreenOff 0x9920 - -#define GlintBackDiffuseColorBlue 0xa928 -#define GlintBackDiffuseColorBlueTag 0x0525 -#define GlintBackDiffuseColorBlueReg 1 -#define GlintBackDiffuseColorBlueOff 0x9928 - -#define GlintBackAlpha 0xa930 -#define GlintBackAlphaTag 0x0526 -#define GlintBackAlphaReg 1 -#define GlintBackAlphaOff 0x9930 - -#define GlintBackSpecularColorRed 0xa938 -#define GlintBackSpecularColorRedTag 0x0527 -#define GlintBackSpecularColorRedReg 1 -#define GlintBackSpecularColorRedOff 0x9938 - -#define GlintBackSpecularColorGreen 0xa940 -#define GlintBackSpecularColorGreenTag 0x0528 -#define GlintBackSpecularColorGreenReg 1 -#define GlintBackSpecularColorGreenOff 0x9940 - -#define GlintBackSpecularColorBlue 0xa948 -#define GlintBackSpecularColorBlueTag 0x0529 -#define GlintBackSpecularColorBlueReg 1 -#define GlintBackSpecularColorBlueOff 0x9948 - -#define GlintBackEmissiveColorRed 0xa950 -#define GlintBackEmissiveColorRedTag 0x052a -#define GlintBackEmissiveColorRedReg 1 -#define GlintBackEmissiveColorRedOff 0x9950 - -#define GlintBackEmissiveColorGreen 0xa958 -#define GlintBackEmissiveColorGreenTag 0x052b -#define GlintBackEmissiveColorGreenReg 1 -#define GlintBackEmissiveColorGreenOff 0x9958 - -#define GlintBackEmissiveColorBlue 0xa960 -#define GlintBackEmissiveColorBlueTag 0x052c -#define GlintBackEmissiveColorBlueReg 1 -#define GlintBackEmissiveColorBlueOff 0x9960 - -#define GlintBackSpecularExponent 0xa968 -#define GlintBackSpecularExponentTag 0x052d -#define GlintBackSpecularExponentReg 1 -#define GlintBackSpecularExponentOff 0x9968 - -#define GlintDMAAddr 0xa980 -#define GlintDMAAddrTag 0x0530 -#define GlintDMAAddrReg 1 -#define GlintDMAAddrOff 0x9980 - -#define GlintGammaDMACount 0xa988 -#define GlintGammaDMACountTag 0x0531 -#define GlintGammaDMACountReg 1 -#define GlintGammaDMACountOff 0x9988 - -#define GlintCommandInterrupt 0xa990 -#define GlintCommandInterruptTag 0x0532 -#define GlintCommandInterruptReg 1 -#define GlintCommandInterruptOff 0x9990 - -#define GlintDMACall 0xa998 -#define GlintDMACallTag 0x0533 -#define GlintDMACallReg 1 -#define GlintDMACallOff 0x9998 - -#define GlintDMAReturn 0xa9a0 -#define GlintDMAReturnTag 0x0534 -#define GlintDMAReturnReg 1 -#define GlintDMAReturnOff 0x99a0 - -#define GlintDMARectangularRead 0xa9a8 -#define GlintDMARectangularReadTag 0x0535 -#define GlintDMARectangularReadReg 1 -#define GlintDMARectangularReadOff 0x99a8 - -#define GlintDMARectangleReadAddress 0xa9b0 -#define GlintDMARectangleReadAddressTag 0x0536 -#define GlintDMARectangleReadAddressReg 1 -#define GlintDMARectangleReadAddressOff 0x99b0 - -#define GlintDMARectangleReadLinePitch 0xa9b8 -#define GlintDMARectangleReadLinePitchTag 0x0537 -#define GlintDMARectangleReadLinePitchReg 1 -#define GlintDMARectangleReadLinePitchOff 0x99b8 - -#define GlintDMARectangleReadTarget 0xa9c0 -#define GlintDMARectangleReadTargetTag 0x0538 -#define GlintDMARectangleReadTargetReg 1 -#define GlintDMARectangleReadTargetOff 0x99c0 - -#define GlintDMARectangleWrite 0xa9c8 -#define GlintDMARectangleWriteTag 0x0539 -#define GlintDMARectangleWriteReg 1 -#define GlintDMARectangleWriteOff 0x99c8 - -#define GlintDMARectangleWriteAddress 0xa9d0 -#define GlintDMARectangleWriteAddressTag 0x053a -#define GlintDMARectangleWriteAddressReg 1 -#define GlintDMARectangleWriteAddressOff 0x99d0 - -#define GlintDMARectangleWriteLinePitch 0xa9d8 -#define GlintDMARectangleWriteLinePitchTag 0x053b -#define GlintDMARectangleWriteLinePitchReg 1 -#define GlintDMARectangleWriteLinePitchOff 0x99d8 - -#define GlintDMAOutputAddress 0xa9e0 -#define GlintDMAOutputAddressTag 0x053c -#define GlintDMAOutputAddressReg 1 -#define GlintDMAOutputAddressOff 0x99e0 - -#define GlintDMAOutputCount 0xa9e8 -#define GlintDMAOutputCountTag 0x053d -#define GlintDMAOutputCountReg 1 -#define GlintDMAOutputCountOff 0x99e8 - -#define GlintDMAReadGLINTSource 0xa9f0 -#define GlintDMAReadGLINTSourceTag 0x053e -#define GlintDMAReadGLINTSourceReg 1 -#define GlintDMAReadGLINTSourceOff 0x99f0 - -#define GlintDMAFeedback 0xaa10 -#define GlintDMAFeedbackTag 0x0542 -#define GlintDMAFeedbackReg 1 -#define GlintDMAFeedbackOff 0x9a10 - -#define GlintTransformModeAnd 0xaa80 -#define GlintTransformModeAndTag 0x0550 -#define GlintTransformModeAndReg 1 -#define GlintTransformModeAndOff 0x9a80 - -#define GlintTransformModeOr 0xaa88 -#define GlintTransformModeOrTag 0x0551 -#define GlintTransformModeOrReg 1 -#define GlintTransformModeOrOff 0x9a88 - -#define GlintGeometryModeAnd 0xaa90 -#define GlintGeometryModeAndTag 0x0552 -#define GlintGeometryModeAndReg 1 -#define GlintGeometryModeAndOff 0x9a90 - -#define GlintGeometryModeOr 0xaa98 -#define GlintGeometryModeOrTag 0x0553 -#define GlintGeometryModeOrReg 1 -#define GlintGeometryModeOrOff 0x9a98 - -#define GlintNormalizeModeAnd 0xaaa0 -#define GlintNormalizeModeAndTag 0x0554 -#define GlintNormalizeModeAndReg 1 -#define GlintNormalizeModeAndOff 0x9aa0 - -#define GlintNormalizeModeOr 0xaaa8 -#define GlintNormalizeModeOrTag 0x0555 -#define GlintNormalizeModeOrReg 1 -#define GlintNormalizeModeOrOff 0x9aa8 - -#define GlintLightingModeAnd 0xaab0 -#define GlintLightingModeAndTag 0x0556 -#define GlintLightingModeAndReg 1 -#define GlintLightingModeAndOff 0x9ab0 - -#define GlintLightingModeOr 0xaab8 -#define GlintLightingModeOrTag 0x0557 -#define GlintLightingModeOrReg 1 -#define GlintLightingModeOrOff 0x9ab8 - -#define GlintColorMaterialModeAnd 0xaac0 -#define GlintColorMaterialModeAndTag 0x0558 -#define GlintColorMaterialModeAndReg 1 -#define GlintColorMaterialModeAndOff 0x9ac0 - -#define GlintColorMaterialModeOr 0xaac8 -#define GlintColorMaterialModeOrTag 0x0559 -#define GlintColorMaterialModeOrReg 1 -#define GlintColorMaterialModeOrOff 0x9ac8 - -#define GlintDeltaModeAnd 0xaad0 -#define GlintDeltaModeAndTag 0x055a -#define GlintDeltaModeAndReg 1 -#define GlintDeltaModeAndOff 0x9ad0 - -#define GlintDeltaModeOr 0xaad8 -#define GlintDeltaModeOrTag 0x055b -#define GlintDeltaModeOrReg 1 -#define GlintDeltaModeOrOff 0x9ad8 - -#define GlintPointModeAnd 0xaae0 -#define GlintPointModeAndTag 0x055c -#define GlintPointModeAndReg 1 -#define GlintPointModeAndOff 0x9ae0 - -#define GlintPointModeOr 0xaae8 -#define GlintPointModeOrTag 0x055d -#define GlintPointModeOrReg 1 -#define GlintPointModeOrOff 0x9ae8 - -#define GlintLineModeAnd 0xaaf0 -#define GlintLineModeAndTag 0x055e -#define GlintLineModeAndReg 1 -#define GlintLineModeAndOff 0x9af0 - -#define GlintLineModeOr 0xaaf8 -#define GlintLineModeOrTag 0x055f -#define GlintLineModeOrReg 1 -#define GlintLineModeOrOff 0x9af8 - -#define GlintTriangleModeAnd 0xab00 -#define GlintTriangleModeAndTag 0x0560 -#define GlintTriangleModeAndReg 1 -#define GlintTriangleModeAndOff 0x9b00 - -#define GlintTriangleModeOr 0xab08 -#define GlintTriangleModeOrTag 0x0561 -#define GlintTriangleModeOrReg 1 -#define GlintTriangleModeOrOff 0x9b08 - -#define GlintMaterialModeAnd 0xab10 -#define GlintMaterialModeAndTag 0x0562 -#define GlintMaterialModeAndReg 1 -#define GlintMaterialModeAndOff 0x9b10 - -#define GlintMaterialModeOr 0xab18 -#define GlintMaterialModeOrTag 0x0563 -#define GlintMaterialModeOrReg 1 -#define GlintMaterialModeOrOff 0x9b18 - -#define GlintWindowAnd 0xab80 -#define GlintWindowAndTag 0x0570 -#define GlintWindowAndReg 1 -#define GlintWindowAndOff 0x9b80 - -#define GlintWindowOr 0xab88 -#define GlintWindowOrTag 0x0571 -#define GlintWindowOrReg 1 -#define GlintWindowOrOff 0x9b88 - -#define GlintLBReadModeAnd 0xab90 -#define GlintLBReadModeAndTag 0x0572 -#define GlintLBReadModeAndReg 1 -#define GlintLBReadModeAndOff 0x9b90 - -#define GlintLBReadModeOr 0xab98 -#define GlintLBReadModeOrTag 0x0573 -#define GlintLBReadModeOrReg 1 -#define GlintLBReadModeOrOff 0x9b98 -#endif diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c deleted file mode 100644 index 5e666c5c8c..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_context.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * 3DLabs Gamma driver. - * - */ -#include "gamma_context.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "drivers/common/driverfuncs.h" - -#include "main/context.h" -#include "main/simple_list.h" -#include "main/imports.h" -#include "main/matrix.h" -#include "main/extensions.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif -#include "main/simple_list.h" -#include "main/mm.h" - - -#include "gamma_vb.h" -#include "gamma_tris.h" -#include "gamma_macros.h" - -extern const struct tnl_pipeline_stage _gamma_render_stage; - -static const struct tnl_pipeline_stage *gamma_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - /* REMOVE: point attenuation stage */ -#if 1 - &_gamma_render_stage, /* ADD: unclipped rastersetup-to-dma */ -#endif - &_tnl_render_stage, - 0, -}; - -GLboolean gammaCreateContext( const __GLcontextModes *glVisual, - __DRIcontext *driContextPriv, - void *sharedContextPrivate) -{ - GLcontext *ctx, *shareCtx; - __DRIscreen *sPriv = driContextPriv->driScreenPriv; - gammaContextPtr gmesa; - gammaScreenPtr gammascrn; - GLINTSAREADRIPtr saPriv=(GLINTSAREADRIPtr)(((char*)sPriv->pSAREA)+ - sizeof(drm_sarea_t)); - struct dd_function_table functions; - - gmesa = (gammaContextPtr) CALLOC( sizeof(*gmesa) ); - if (!gmesa) - return GL_FALSE; - - /* Init default driver functions then plug in our gamma-specific functions - * (the texture functions are especially important) - */ - _mesa_init_driver_functions( &functions ); - gammaDDInitTextureFuncs( &functions ); - - /* Allocate the Mesa context */ - if (sharedContextPrivate) - shareCtx = ((gammaContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - - gmesa->glCtx = _mesa_create_context(glVisual, shareCtx, - &functions, (void *) gmesa); - if (!gmesa->glCtx) { - FREE(gmesa); - return GL_FALSE; - } - - gmesa->driContext = driContextPriv; - gmesa->driScreen = sPriv; - gmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ - - gmesa->hHWContext = driContextPriv->hHWContext; - gmesa->driHwLock = &sPriv->pSAREA->lock; - gmesa->driFd = sPriv->fd; - gmesa->sarea = saPriv; - - gammascrn = gmesa->gammaScreen = (gammaScreenPtr)(sPriv->private); - - ctx = gmesa->glCtx; - - ctx->Const.MaxTextureLevels = GAMMA_TEX_MAXLEVELS; - ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */ - ctx->Const.MaxTextureImageUnits = 1; - ctx->Const.MaxTextureCoordUnits = 1; - - ctx->Const.MinLineWidth = 0.0; - ctx->Const.MaxLineWidth = 255.0; - - ctx->Const.MinLineWidthAA = 0.0; - ctx->Const.MaxLineWidthAA = 65536.0; - - ctx->Const.MinPointSize = 0.0; - ctx->Const.MaxPointSize = 255.0; - - ctx->Const.MinPointSizeAA = 0.5; /* 4x4 quality mode */ - ctx->Const.MaxPointSizeAA = 16.0; - ctx->Const.PointSizeGranularity = 0.25; - - ctx->Const.MaxDrawBuffers = 1; - - gmesa->texHeap = mmInit( 0, gmesa->gammaScreen->textureSize ); - - make_empty_list(&gmesa->TexObjList); - make_empty_list(&gmesa->SwappedOut); - - gmesa->CurrentTexObj[0] = 0; - gmesa->CurrentTexObj[1] = 0; /* Permedia 3, second texture */ - - gmesa->RenderIndex = ~0; - - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - - /* Install the customized pipeline: - */ - _tnl_destroy_pipeline( ctx ); - _tnl_install_pipeline( ctx, gamma_pipeline ); - - /* Configure swrast & TNL to match hardware characteristics: - */ - _swrast_allow_pixel_fog( ctx, GL_FALSE ); - _swrast_allow_vertex_fog( ctx, GL_TRUE ); - _tnl_allow_pixel_fog( ctx, GL_FALSE ); - _tnl_allow_vertex_fog( ctx, GL_TRUE ); - - gammaInitVB( ctx ); - gammaDDInitExtensions( ctx ); - /* XXX these should really go right after _mesa_init_driver_functions() */ - gammaDDInitDriverFuncs( ctx ); - gammaDDInitStateFuncs( ctx ); - gammaDDInitSpanFuncs( ctx ); - gammaDDInitTriFuncs( ctx ); - gammaDDInitState( gmesa ); - - gammaInitTextureObjects( ctx ); - - driContextPriv->driverPrivate = (void *)gmesa; - - GET_FIRST_DMA(gmesa->driFd, gmesa->hHWContext, - 1, &gmesa->bufIndex, &gmesa->bufSize, - &gmesa->buf, &gmesa->bufCount, gammascrn); - -#ifdef DO_VALIDATE - GET_FIRST_DMA(gmesa->driFd, gmesa->hHWContext, - 1, &gmesa->WCbufIndex, &gmesa->WCbufSize, - &gmesa->WCbuf, &gmesa->WCbufCount, gammascrn); -#endif - - switch (glVisual->depthBits) { - case 16: - gmesa->DeltaMode = DM_Depth16; - gmesa->depth_scale = 1.0f / 0xffff; - break; - case 24: - gmesa->DeltaMode = DM_Depth24; - gmesa->depth_scale = 1.0f / 0xffffff; - break; - case 32: - gmesa->DeltaMode = DM_Depth32; - gmesa->depth_scale = 1.0f / 0xffffffff; - break; - default: - break; - } - - gmesa->DepthSize = glVisual->depthBits; - gmesa->Flags = GAMMA_FRONT_BUFFER; - gmesa->Flags |= (glVisual->doubleBufferMode ? GAMMA_BACK_BUFFER : 0); - gmesa->Flags |= (gmesa->DepthSize > 0 ? GAMMA_DEPTH_BUFFER : 0); - - gmesa->EnabledFlags = GAMMA_FRONT_BUFFER; - gmesa->EnabledFlags |= (glVisual->doubleBufferMode ? GAMMA_BACK_BUFFER : 0); - - - if (gmesa->Flags & GAMMA_BACK_BUFFER) { - gmesa->readOffset = gmesa->drawOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp; - } else { - gmesa->readOffset = gmesa->drawOffset = 0; - } - - gammaInitHW( gmesa ); - - driContextPriv->driverPrivate = (void *)gmesa; - - return GL_TRUE; -} diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h deleted file mode 100644 index b03dfa6fb4..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_context.h +++ /dev/null @@ -1,401 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - */ - -#ifndef _GAMMA_CONTEXT_H_ -#define _GAMMA_CONTEXT_H_ - -#include "dri_util.h" -#include "drm.h" -#include "drm_sarea.h" -#include "main/colormac.h" -#include "gamma_regs.h" -#include "gamma_screen.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "glint_dri.h" -#include "main/mm.h" - -typedef union { - unsigned int i; - float f; -} dmaBufRec, *dmaBuf; - -/* Flags for context */ -#define GAMMA_FRONT_BUFFER 0x00000001 -#define GAMMA_BACK_BUFFER 0x00000002 -#define GAMMA_DEPTH_BUFFER 0x00000004 -#define GAMMA_STENCIL_BUFFER 0x00000008 -#define GAMMA_ACCUM_BUFFER 0x00000010 - -#define GAMMA_MAX_TEXTURE_SIZE 2048 - -/* These are the minimum requirements and should probably be increased */ -#define MAX_MODELVIEW_STACK 16 -#define MAX_PROJECTION_STACK 2 -#define MAX_TEXTURE_STACK 2 - -extern void gammaDDUpdateHWState(GLcontext *ctx); -extern gammaScreenPtr gammaCreateScreen(__DRIscreen *sPriv); -extern void gammaDestroyScreen(__DRIscreen *sPriv); -extern GLboolean gammaCreateContext( const __GLcontextModes *glVisual, - __DRIcontext *driContextPriv, - void *sharedContextPrivate); - -#define GAMMA_UPLOAD_ALL 0xffffffff -#define GAMMA_UPLOAD_CLIPRECTS 0x00000002 -#define GAMMA_UPLOAD_ALPHA 0x00000004 -#define GAMMA_UPLOAD_BLEND 0x00000008 -#define GAMMA_UPLOAD_DEPTH 0x00000010 -#define GAMMA_UPLOAD_VIEWPORT 0x00000020 -#define GAMMA_UPLOAD_SHADE 0x00000040 -#define GAMMA_UPLOAD_CLIP 0x00000080 -#define GAMMA_UPLOAD_MASKS 0x00000100 -#define GAMMA_UPLOAD_WINDOW 0x00000200 /* defunct */ -#define GAMMA_UPLOAD_GEOMETRY 0x00000400 -#define GAMMA_UPLOAD_POLYGON 0x00000800 -#define GAMMA_UPLOAD_DITHER 0x00001000 -#define GAMMA_UPLOAD_LOGICOP 0x00002000 -#define GAMMA_UPLOAD_FOG 0x00004000 -#define GAMMA_UPLOAD_LIGHT 0x00008000 -#define GAMMA_UPLOAD_CONTEXT 0x00010000 -#define GAMMA_UPLOAD_TEX0 0x00020000 -#define GAMMA_UPLOAD_STIPPLE 0x00040000 -#define GAMMA_UPLOAD_TRANSFORM 0x00080000 -#define GAMMA_UPLOAD_LINEMODE 0x00100000 -#define GAMMA_UPLOAD_POINTMODE 0x00200000 -#define GAMMA_UPLOAD_TRIMODE 0x00400000 - -#define GAMMA_NEW_CLIP 0x00000001 -#define GAMMA_NEW_WINDOW 0x00000002 -#define GAMMA_NEW_CONTEXT 0x00000004 -#define GAMMA_NEW_TEXTURE 0x00000008 /* defunct */ -#define GAMMA_NEW_ALPHA 0x00000010 -#define GAMMA_NEW_DEPTH 0x00000020 -#define GAMMA_NEW_MASKS 0x00000040 -#define GAMMA_NEW_POLYGON 0x00000080 -#define GAMMA_NEW_CULL 0x00000100 -#define GAMMA_NEW_LOGICOP 0x00000200 -#define GAMMA_NEW_FOG 0x00000400 -#define GAMMA_NEW_LIGHT 0x00000800 -#define GAMMA_NEW_STIPPLE 0x00001000 -#define GAMMA_NEW_ALL 0xffffffff - -#define GAMMA_FALLBACK_TRI 0x00000001 -#define GAMMA_FALLBACK_TEXTURE 0x00000002 - -#define FLUSH_BATCH(gmesa) do { \ - /*FLUSH_DMA_BUFFER(gmesa);*/ \ -} while(0) - -struct gamma_context; -typedef struct gamma_context gammaContextRec; -typedef struct gamma_context *gammaContextPtr; -typedef struct gamma_texture_object_t *gammaTextureObjectPtr; - -#define VALID_GAMMA_TEXTURE_OBJECT(tobj) (tobj) - -#define GAMMA_TEX_MAXLEVELS 12 /* 2K x 2K */ - -/* For shared texture space managment, these texture objects may also - * be used as proxies for regions of texture memory containing other - * client's textures. Such proxy textures (not to be confused with GL - * proxy textures) are subject to the same LRU aging we use for our - * own private textures, and thus we have a mechanism where we can - * fairly decide between kicking out our own textures and those of - * other clients. - * - * Non-local texture objects have a valid MemBlock to describe the - * region managed by the other client, and can be identified by - * 't->globj == 0' - */ -struct gamma_texture_object_t { - struct gamma_texture_object_t *next, *prev; - - GLuint age; - struct gl_texture_object *globj; - - int Pitch; - int Height; - int texelBytes; - int totalSize; - int bound; - - struct mem_block *MemBlock; - char * BufAddr; - - GLuint min_level; - GLuint max_level; - GLuint dirty_images; - - GLint firstLevel, lastLevel; /* upload tObj->Image[0][first .. lastLevel] */ - - struct { - const struct gl_texture_image *image; - int offset; /* into BufAddr */ - int height; - int internalFormat; - } image[GAMMA_TEX_MAXLEVELS]; - - uint32_t TextureBaseAddr[GAMMA_TEX_MAXLEVELS]; - uint32_t TextureAddressMode; - uint32_t TextureColorMode; - uint32_t TextureFilterMode; - uint32_t TextureFormat; - uint32_t TextureReadMode; - uint32_t TextureBorderColor; -}; - -#define GAMMA_NO_PALETTE 0x0 -#define GAMMA_USE_PALETTE 0x1 -#define GAMMA_UPDATE_PALETTE 0x2 -#define GAMMA_FALLBACK_PALETTE 0x4 - -void gammaUpdateTextureState( GLcontext *ctx ); - -void gammaDestroyTexObj( gammaContextPtr gmesa, gammaTextureObjectPtr t ); -void gammaSwapOutTexObj( gammaContextPtr gmesa, gammaTextureObjectPtr t ); -void gammaUploadTexImages( gammaContextPtr gmesa, gammaTextureObjectPtr t ); - -void gammaResetGlobalLRU( gammaContextPtr gmesa ); -void gammaUpdateTexLRU( gammaContextPtr gmesa, gammaTextureObjectPtr t ); -void gammaTexturesGone( gammaContextPtr gmesa, - GLuint start, GLuint end, - GLuint in_use ); - -void gammaEmitHwState( gammaContextPtr gmesa ); -void gammaDDInitExtensions( GLcontext *ctx ); -void gammaDDInitDriverFuncs( GLcontext *ctx ); -void gammaDDInitSpanFuncs( GLcontext *ctx ); -void gammaDDInitState( gammaContextPtr gmesa ); -void gammaInitHW( gammaContextPtr gmesa ); -void gammaDDInitStateFuncs( GLcontext *ctx ); -void gammaDDInitTextureFuncs( struct dd_function_table *table ); -void gammaInitTextureObjects( GLcontext *ctx ); -void gammaDDInitTriFuncs( GLcontext *ctx ); - -void gammaUpdateWindow( GLcontext *ctx ); -void gammaUpdateViewportOffset( GLcontext *ctx ); - -void gammaPrintLocalLRU( gammaContextPtr gmesa ); -void gammaPrintGlobalLRU( gammaContextPtr gmesa ); - -extern void gammaFallback( gammaContextPtr gmesa, GLuint bit, GLboolean mode ); -#define FALLBACK( imesa, bit, mode ) gammaFallback( imesa, bit, mode ) - -/* Use the templated vertex formats. Only one of these is used in gamma. - */ -#define TAG(x) gamma##x -#include "tnl_dd/t_dd_vertex.h" -#undef TAG - -typedef void (*gamma_quad_func)( gammaContextPtr, - const gammaVertex *, - const gammaVertex *, - const gammaVertex *, - const gammaVertex * ); -typedef void (*gamma_tri_func)( gammaContextPtr, - const gammaVertex *, - const gammaVertex *, - const gammaVertex * ); -typedef void (*gamma_line_func)( gammaContextPtr, - const gammaVertex *, - const gammaVertex * ); -typedef void (*gamma_point_func)( gammaContextPtr, - const gammaVertex * ); - - -struct gamma_context { - GLcontext *glCtx; /* Mesa context */ - - __DRIcontext *driContext; - __DRIscreen *driScreen; - __DRIdrawable *driDrawable; - - GLuint new_gl_state; - GLuint new_state; - GLuint dirty; - - GLINTSAREADRIPtr sarea; - - /* Mirrors of some DRI state - */ - drm_context_t hHWContext; - drm_hw_lock_t *driHwLock; - int driFd; - - GLuint numClipRects; /* Cliprects for the draw buffer */ - drm_clip_rect_t *pClipRects; - - dmaBuf buf; /* DMA buffer for regular cmds */ - int bufIndex; - int bufSize; - int bufCount; - - dmaBuf WCbuf; /* DMA buffer for window changed cmds */ - int WCbufIndex; - int WCbufSize; - int WCbufCount; - - gammaScreenPtr gammaScreen; /* Screen private DRI data */ - - int drawOffset; - int readOffset; - - gamma_point_func draw_point; - gamma_line_func draw_line; - gamma_tri_func draw_tri; - gamma_quad_func draw_quad; - - GLuint Fallback; - GLuint RenderIndex; - GLuint SetupNewInputs; - GLuint SetupIndex; - - GLuint vertex_format; - GLuint vertex_size; - GLuint vertex_stride_shift; - GLubyte *verts; - - GLfloat hw_viewport[16]; - GLuint hw_primitive; - GLenum render_primitive; - - GLfloat depth_scale; - - gammaTextureObjectPtr CurrentTexObj[2]; - struct gamma_texture_object_t TexObjList; - struct gamma_texture_object_t SwappedOut; - GLenum TexEnvImageFmt[2]; - - struct mem_block *texHeap; - - unsigned int lastSwap; - int texAge; - int ctxAge; - int dirtyAge; - unsigned int lastStamp; - - - uint32_t ClearColor; - uint32_t Color; - uint32_t DitherMode; - uint32_t ClearDepth; - uint32_t FogMode; - uint32_t AreaStippleMode; - uint32_t LBReadFormat; - uint32_t LBWriteFormat; - uint32_t LineMode; - uint32_t PointMode; - uint32_t TriangleMode; - uint32_t AntialiasMode; - GLfloat ViewportScaleX; - GLfloat ViewportScaleY; - GLfloat ViewportScaleZ; - GLfloat ViewportOffsetX; - GLfloat ViewportOffsetY; - GLfloat ViewportOffsetZ; - int MatrixMode; - int DepthMode; - int TransformMode; - int LBReadMode; - int FBReadMode; - int FBWindowBase; - int LBWindowBase; - int ColorDDAMode; - int GeometryMode; - int AlphaTestMode; - int AlphaBlendMode; - int AB_FBReadMode; - int AB_FBReadMode_Save; - int DeltaMode; - int ColorMaterialMode; - int FBHardwareWriteMask; - int MaterialMode; - int NormalizeMode; - int LightingMode; - int Light0Mode; - int Light1Mode; - int Light2Mode; - int Light3Mode; - int Light4Mode; - int Light5Mode; - int Light6Mode; - int Light7Mode; - int Light8Mode; - int Light9Mode; - int Light10Mode; - int Light11Mode; - int Light12Mode; - int Light13Mode; - int Light14Mode; - int Light15Mode; - int LogicalOpMode; - int ScissorMode; - int ScissorMaxXY; - int ScissorMinXY; - int Window; /* GID part probably should be in draw priv */ - int WindowOrigin; - int x, y, w, h; /* Probably should be in drawable priv */ - int FrameCount; /* Probably should be in drawable priv */ - int NotClipped; /* Probably should be in drawable priv */ - int WindowChanged; /* Probably should be in drawabl... */ - int Flags; - int EnabledFlags; - int DepthSize; - int Begin; - GLenum ErrorValue; - int Texture1DEnabled; - int Texture2DEnabled; - - float ModelView[16]; - float Proj[16]; - float ModelViewProj[16]; - float Texture[16]; - - float ModelViewStack[(MAX_MODELVIEW_STACK-1)*16]; - int ModelViewCount; - float ProjStack[(MAX_PROJECTION_STACK-1)*16]; - int ProjCount; - float TextureStack[(MAX_TEXTURE_STACK-1)*16]; - int TextureCount; -}; - -static INLINE GLuint gammaPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) -{ - switch ( cpp ) { - case 2: - return PACK_COLOR_565( r, g, b ); - case 4: - return PACK_COLOR_8888( a, r, g, b ); - default: - return 0; - } -} - -#define GAMMA_CONTEXT(ctx) ((gammaContextPtr)(ctx->DriverCtx)) - -#endif /* _GAMMA_CONTEXT_H_ */ diff --git a/src/mesa/drivers/dri/gamma/gamma_dd.c b/src/mesa/drivers/dri/gamma/gamma_dd.c deleted file mode 100644 index 389d2231e7..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_dd.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - */ - -#include "gamma_context.h" -#include "gamma_vb.h" -#include "gamma_lock.h" -#include "gamma_macros.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif - -#include "main/context.h" -#include "swrast/swrast.h" - -#define GAMMA_DATE "20021125" - - -/* Return the width and height of the current color buffer. - */ -static void gammaDDGetBufferSize( GLframebuffer *buffer, - GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - GAMMAHW_LOCK( gmesa ); - *width = gmesa->driDrawable->w; - *height = gmesa->driDrawable->h; - GAMMAHW_UNLOCK( gmesa ); -} - - -/* Return various strings for glGetString(). - */ -static const GLubyte *gammaDDGetString( GLcontext *ctx, GLenum name ) -{ - static char buffer[128]; - - switch ( name ) { - case GL_VENDOR: - return (GLubyte *)"VA Linux Systems, Inc."; - - case GL_RENDERER: - sprintf( buffer, "Mesa DRI Gamma " GAMMA_DATE ); - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif - return (GLubyte *)buffer; - - default: - return NULL; - } -} - -/* Enable the extensions supported by this driver. - */ -void gammaDDInitExtensions( GLcontext *ctx ) -{ - /* None... */ -} - -/* Initialize the driver's misc functions. - */ -void gammaDDInitDriverFuncs( GLcontext *ctx ) -{ - ctx->Driver.GetBufferSize = gammaDDGetBufferSize; - ctx->Driver.GetString = gammaDDGetString; -} diff --git a/src/mesa/drivers/dri/gamma/gamma_inithw.c b/src/mesa/drivers/dri/gamma/gamma_inithw.c deleted file mode 100644 index 735acb7a57..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_inithw.c +++ /dev/null @@ -1,551 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * Kevin E. Martin - * - */ - -#include "gamma_context.h" -#include "gamma_macros.h" -#include "glint_dri.h" - -void gammaInitHW( gammaContextPtr gmesa ) -{ - GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv; - int i; - - if (gDRIPriv->numMultiDevices == 2) { - /* Set up each MX's ScanLineOwnership for OpenGL */ - CHECK_DMA_BUFFER(gmesa, 5); - WRITE(gmesa->buf, BroadcastMask, 1); - WRITE(gmesa->buf, ScanLineOwnership, 5); /* Use bottom left as [0,0] */ - WRITE(gmesa->buf, BroadcastMask, 2); - WRITE(gmesa->buf, ScanLineOwnership, 1); /* Use bottom left as [0,0] */ - /* Broadcast to both MX's */ - WRITE(gmesa->buf, BroadcastMask, 3); - FLUSH_DMA_BUFFER(gmesa); - } - - gmesa->AlphaBlendMode = (AlphaBlendModeDisable | - AB_Src_One | - AB_Dst_Zero | - AB_NoAlphaBufferPresent | - AB_ColorFmt_8888 | - AB_ColorOrder_RGB | - AB_OpenGLType | - AB_AlphaDst_FBData | - AB_ColorConversionScale | - AB_AlphaConversionScale); - - gmesa->DitherMode = DitherModeEnable | DM_ColorOrder_RGB; - - switch (gmesa->gammaScreen->cpp) { - case 2: - gmesa->DitherMode |= DM_ColorFmt_5555; - gmesa->AlphaBlendMode |= AB_ColorFmt_5555; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PixelSize, 1); - break; - case 4: - gmesa->DitherMode |= DM_ColorFmt_8888; - gmesa->AlphaBlendMode |= AB_ColorFmt_8888; - WRITE(gmesa->buf, PixelSize, 0); - break; - } - - /* FIXME for stencil, gid, etc */ - switch (gmesa->DepthSize) { - case 16: - gmesa->LBReadFormat = - (LBRF_DepthWidth16 | - LBRF_StencilWidth8 | - LBRF_StencilPos16 | - LBRF_FrameCount8 | - LBRF_FrameCountPos24 | - LBRF_GIDWidth4 | - LBRF_GIDPos32 ); - gmesa->LBWriteFormat = - (LBRF_DepthWidth16 | - LBRF_StencilWidth8 | - LBRF_StencilPos16 | - LBRF_FrameCount8 | - LBRF_FrameCountPos24 | - LBRF_GIDWidth4 | - LBRF_GIDPos32 ); - break; - case 24: - gmesa->LBReadFormat = - (LBRF_DepthWidth24 | - LBRF_StencilWidth8 | - LBRF_StencilPos24 | - LBRF_FrameCount8 | - LBRF_FrameCountPos32 | - LBRF_GIDWidth4 | - LBRF_GIDPos36 ); - gmesa->LBWriteFormat = - (LBRF_DepthWidth24 | - LBRF_StencilWidth8 | - LBRF_StencilPos24 | - LBRF_FrameCount8 | - LBRF_FrameCountPos32 | - LBRF_GIDWidth4 | - LBRF_GIDPos36 ); - break; - case 32: - gmesa->LBReadFormat = - (LBRF_DepthWidth32 | - LBRF_StencilWidth8 | - LBRF_StencilPos32 | - LBRF_FrameCount8 | - LBRF_FrameCountPos40 | - LBRF_GIDWidth4 | - LBRF_GIDPos44 ); - gmesa->LBWriteFormat = - (LBRF_DepthWidth32 | - LBRF_StencilWidth8 | - LBRF_StencilPos32 | - LBRF_FrameCount8 | - LBRF_FrameCountPos40 | - LBRF_GIDWidth4 | - LBRF_GIDPos44 ); - break; - } - - gmesa->FBHardwareWriteMask = 0xffffffff; - gmesa->FogMode = FogModeDisable; - gmesa->ClearDepth = 0xffffffff; - gmesa->AreaStippleMode = AreaStippleModeDisable; - gmesa->x = 0; - gmesa->y = 0; - gmesa->w = 0; - gmesa->h = 0; - gmesa->FrameCount = 0; - gmesa->MatrixMode = GL_MODELVIEW; - gmesa->ModelViewCount = 0; - gmesa->ProjCount = 0; - gmesa->TextureCount = 0; - gmesa->PointMode = PM_AntialiasQuality_4x4; - gmesa->LineMode = LM_AntialiasQuality_4x4; - gmesa->TriangleMode = TM_AntialiasQuality_4x4; - gmesa->AntialiasMode = AntialiasModeDisable; - - for (i = 0; i < 16; i++) - if (i % 5 == 0) - gmesa->ModelView[i] = - gmesa->Proj[i] = - gmesa->ModelViewProj[i] = - gmesa->Texture[i] = 1.0; - else - gmesa->ModelView[i] = - gmesa->Proj[i] = - gmesa->ModelViewProj[i] = - gmesa->Texture[i] = 0.0; - - gmesa->LBReadMode = (LBReadSrcDisable | - LBReadDstDisable | - LBDataTypeDefault | - LBWindowOriginBot | - gDRIPriv->pprod); - gmesa->FBReadMode = (FBReadSrcDisable | - FBReadDstDisable | - FBDataTypeDefault | - FBWindowOriginBot | - gDRIPriv->pprod); - - if (gDRIPriv->numMultiDevices == 2) { - gmesa->LBReadMode |= LBScanLineInt2; - gmesa->FBReadMode |= FBScanLineInt2; - gmesa->LBWindowBase = gmesa->driScreen->fbWidth * - (gmesa->driScreen->fbHeight/2 - 1); - gmesa->FBWindowBase = gmesa->driScreen->fbWidth * - (gmesa->driScreen->fbHeight/2 - 1); - } else { - gmesa->LBWindowBase = gmesa->driScreen->fbWidth * - (gmesa->driScreen->fbHeight - 1); - gmesa->FBWindowBase = gmesa->driScreen->fbWidth * - (gmesa->driScreen->fbHeight - 1); - } - - gmesa->Begin = (B_AreaStippleDisable | - B_LineStippleDisable | - B_AntiAliasDisable | - B_TextureDisable | - B_FogDisable | - B_SubPixelCorrectEnable | - B_PrimType_Null); - - gmesa->ColorDDAMode = (ColorDDAEnable | - ColorDDAGouraud); - - gmesa->GeometryMode = (GM_TextureDisable | - GM_FogDisable | - GM_FogExp | - GM_FrontPolyFill | - GM_BackPolyFill | - GM_FrontFaceCCW | - GM_PolyCullDisable | - GM_PolyCullBack | - GM_ClipShortLinesDisable | - GM_ClipSmallTrisDisable | - GM_RenderMode | - GM_Feedback2D | - GM_CullFaceNormDisable | - GM_AutoFaceNormDisable | - GM_GouraudShading | - GM_UserClipNone | - GM_PolyOffsetPointDisable | - GM_PolyOffsetLineDisable | - GM_PolyOffsetFillDisable | - GM_InvertFaceNormCullDisable); - - gmesa->AlphaTestMode = (AlphaTestModeDisable | - AT_Always); - - gmesa->AB_FBReadMode_Save = gmesa->AB_FBReadMode = 0; - - gmesa->Window = (WindowEnable | /* For GID testing */ - W_PassIfEqual | - (0 << 5)); /* GID part is set from draw priv (below) */ - - gmesa->NotClipped = GL_FALSE; - gmesa->WindowChanged = GL_TRUE; - - gmesa->Texture1DEnabled = GL_FALSE; - gmesa->Texture2DEnabled = GL_FALSE; - - gmesa->DepthMode |= (DepthModeDisable | - DM_WriteMask | - DM_Less); - - gmesa->DeltaMode |= (DM_SubPixlCorrectionEnable | - DM_SmoothShadingEnable | - DM_Target500TXMX); - - gmesa->LightingMode = LightingModeDisable | LightingModeSpecularEnable; - gmesa->Light0Mode = LNM_Off; - gmesa->Light1Mode = LNM_Off; - gmesa->Light2Mode = LNM_Off; - gmesa->Light3Mode = LNM_Off; - gmesa->Light4Mode = LNM_Off; - gmesa->Light5Mode = LNM_Off; - gmesa->Light6Mode = LNM_Off; - gmesa->Light7Mode = LNM_Off; - gmesa->Light8Mode = LNM_Off; - gmesa->Light9Mode = LNM_Off; - gmesa->Light10Mode = LNM_Off; - gmesa->Light11Mode = LNM_Off; - gmesa->Light12Mode = LNM_Off; - gmesa->Light13Mode = LNM_Off; - gmesa->Light14Mode = LNM_Off; - gmesa->Light15Mode = LNM_Off; - - gmesa->LogicalOpMode = LogicalOpModeDisable; - - gmesa->MaterialMode = MaterialModeDisable; - - gmesa->ScissorMode = UserScissorDisable | ScreenScissorDisable; - - gmesa->TransformMode = XM_UseModelViewProjMatrix | - XM_TexGenModeS_None | - XM_TexGenModeT_None | - XM_TexGenModeR_None | - XM_TexGenModeQ_None; - - CHECK_DMA_BUFFER(gmesa, 20); - WRITE(gmesa->buf, LineStippleMode, 0); - WRITE(gmesa->buf, RouterMode, 0); - WRITE(gmesa->buf, TextureAddressMode, 0); - WRITE(gmesa->buf, TextureReadMode, 0); - WRITE(gmesa->buf, TextureFilterMode, 0); - WRITE(gmesa->buf, TextureColorMode, 0); - WRITE(gmesa->buf, StencilMode, 0); - WRITE(gmesa->buf, PatternRamMode, 0); - WRITE(gmesa->buf, ChromaTestMode, 0); - WRITE(gmesa->buf, StatisticMode, 0); - WRITE(gmesa->buf, AreaStippleMode, gmesa->AreaStippleMode); - WRITE(gmesa->buf, ScissorMode, gmesa->ScissorMode); - WRITE(gmesa->buf, FogMode, gmesa->FogMode); - WRITE(gmesa->buf, AntialiasMode, gmesa->AntialiasMode); - WRITE(gmesa->buf, LogicalOpMode, gmesa->LogicalOpMode); - WRITE(gmesa->buf, TriangleMode, gmesa->TriangleMode); - WRITE(gmesa->buf, PointMode, gmesa->PointMode); - WRITE(gmesa->buf, LineMode, gmesa->LineMode); - WRITE(gmesa->buf, LBWriteFormat, gmesa->LBWriteFormat); - WRITE(gmesa->buf, LBReadFormat, gmesa->LBReadFormat); - - /* Framebuffer initialization */ - CHECK_DMA_BUFFER(gmesa, 10); - WRITE(gmesa->buf, FBSourceData, 0); - WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode); - if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER) { - if (gDRIPriv->numMultiDevices == 2) { - WRITE(gmesa->buf, FBPixelOffset, - (gmesa->driScreen->fbHeight/2)*gmesa->driScreen->fbWidth); - } else { - WRITE(gmesa->buf, FBPixelOffset, - gmesa->driScreen->fbHeight*gmesa->driScreen->fbWidth); - } - } else - WRITE(gmesa->buf, FBPixelOffset, 0); - WRITE(gmesa->buf, FBSourceOffset, 0); - WRITE(gmesa->buf, FBHardwareWriteMask, 0xffffffff); - WRITE(gmesa->buf, FBSoftwareWriteMask, 0xffffffff); - WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable); - WRITE(gmesa->buf, FBWindowBase, gmesa->FBWindowBase); - WRITE(gmesa->buf, ScreenSize, ((gmesa->driScreen->fbHeight << 16) | - (gmesa->driScreen->fbWidth))); - WRITE(gmesa->buf, WindowOrigin, 0x00000000); - - /* Localbuffer initialization */ - CHECK_DMA_BUFFER(gmesa, 5); - WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode); - WRITE(gmesa->buf, LBSourceOffset, 0); - WRITE(gmesa->buf, LBWriteMode, LBWriteModeEnable); - WRITE(gmesa->buf, LBWindowOffset, 0); - WRITE(gmesa->buf, LBWindowBase, gmesa->LBWindowBase); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Rectangle2DControl, 1); - - CHECK_DMA_BUFFER(gmesa, 11); - WRITE(gmesa->buf, DepthMode, gmesa->DepthMode); - WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode); - WRITE(gmesa->buf, FBBlockColor, 0x00000000); - WRITE(gmesa->buf, ConstantColor, 0x00000000); - WRITE(gmesa->buf, AlphaTestMode, gmesa->AlphaTestMode); - WRITE(gmesa->buf, AlphaBlendMode, gmesa->AlphaBlendMode); - WRITE(gmesa->buf, DitherMode, gmesa->DitherMode); - if (gDRIPriv->numMultiDevices == 2) - WRITE(gmesa->buf, RasterizerMode, RM_MultiGLINT | RM_BiasCoordNearHalf); - else - WRITE(gmesa->buf, RasterizerMode, RM_BiasCoordNearHalf); - WRITE(gmesa->buf, GLINTWindow, gmesa->Window); - WRITE(gmesa->buf, FastClearDepth, gmesa->ClearDepth); - WRITE(gmesa->buf, GLINTDepth, gmesa->ClearDepth); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, EdgeFlag, EdgeFlagEnable); - - CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, ModelViewMatrix0, 1.0); - WRITEF(gmesa->buf, ModelViewMatrix1, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix2, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix3, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix4, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix5, 1.0); - WRITEF(gmesa->buf, ModelViewMatrix6, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix7, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix8, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix9, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix10, 1.0); - WRITEF(gmesa->buf, ModelViewMatrix11, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix12, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix13, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix14, 0.0); - WRITEF(gmesa->buf, ModelViewMatrix15, 1.0); - - CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, ModelViewProjectionMatrix0, 1.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix1, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix2, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix3, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix4, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix5, 1.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix6, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix7, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix8, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix9, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix10, 1.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix11, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix12, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix13, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix14, 0.0); - WRITEF(gmesa->buf, ModelViewProjectionMatrix15, 1.0); - - CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, TextureMatrix0, 1.0); - WRITEF(gmesa->buf, TextureMatrix1, 0.0); - WRITEF(gmesa->buf, TextureMatrix2, 0.0); - WRITEF(gmesa->buf, TextureMatrix3, 0.0); - WRITEF(gmesa->buf, TextureMatrix4, 0.0); - WRITEF(gmesa->buf, TextureMatrix5, 1.0); - WRITEF(gmesa->buf, TextureMatrix6, 0.0); - WRITEF(gmesa->buf, TextureMatrix7, 0.0); - WRITEF(gmesa->buf, TextureMatrix8, 0.0); - WRITEF(gmesa->buf, TextureMatrix9, 0.0); - WRITEF(gmesa->buf, TextureMatrix10, 1.0); - WRITEF(gmesa->buf, TextureMatrix11, 0.0); - WRITEF(gmesa->buf, TextureMatrix12, 0.0); - WRITEF(gmesa->buf, TextureMatrix13, 0.0); - WRITEF(gmesa->buf, TextureMatrix14, 0.0); - WRITEF(gmesa->buf, TextureMatrix15, 1.0); - - CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, TexGen0, 0.0); - WRITEF(gmesa->buf, TexGen1, 0.0); - WRITEF(gmesa->buf, TexGen2, 0.0); - WRITEF(gmesa->buf, TexGen3, 0.0); - WRITEF(gmesa->buf, TexGen4, 0.0); - WRITEF(gmesa->buf, TexGen5, 0.0); - WRITEF(gmesa->buf, TexGen6, 0.0); - WRITEF(gmesa->buf, TexGen7, 0.0); - WRITEF(gmesa->buf, TexGen8, 0.0); - WRITEF(gmesa->buf, TexGen9, 0.0); - WRITEF(gmesa->buf, TexGen10, 0.0); - WRITEF(gmesa->buf, TexGen11, 0.0); - WRITEF(gmesa->buf, TexGen12, 0.0); - WRITEF(gmesa->buf, TexGen13, 0.0); - WRITEF(gmesa->buf, TexGen14, 0.0); - WRITEF(gmesa->buf, TexGen15, 0.0); - - CHECK_DMA_BUFFER(gmesa, 9); - WRITEF(gmesa->buf, NormalMatrix0, 1.0); - WRITEF(gmesa->buf, NormalMatrix1, 0.0); - WRITEF(gmesa->buf, NormalMatrix2, 0.0); - WRITEF(gmesa->buf, NormalMatrix3, 0.0); - WRITEF(gmesa->buf, NormalMatrix4, 1.0); - WRITEF(gmesa->buf, NormalMatrix5, 0.0); - WRITEF(gmesa->buf, NormalMatrix6, 0.0); - WRITEF(gmesa->buf, NormalMatrix7, 0.0); - WRITEF(gmesa->buf, NormalMatrix8, 1.0); - - CHECK_DMA_BUFFER(gmesa, 3); - WRITEF(gmesa->buf, FogDensity, 0.0); - WRITEF(gmesa->buf, FogEnd, 0.0); - WRITEF(gmesa->buf, FogScale, 0.0); - - CHECK_DMA_BUFFER(gmesa, 2); - WRITEF(gmesa->buf, LineClipLengthThreshold, 0.0); - WRITEF(gmesa->buf, TriangleClipAreaThreshold, 0.0); - - CHECK_DMA_BUFFER(gmesa, 5); - WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode); - WRITE(gmesa->buf, NormalizeMode, NormalizeModeDisable); - WRITE(gmesa->buf, LightingMode, gmesa->LightingMode); - WRITE(gmesa->buf, ColorMaterialMode, ColorMaterialModeDisable); - WRITE(gmesa->buf, MaterialMode, MaterialModeDisable); - - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, FrontSpecularExponent, 0); /* fixed point */ - WRITE(gmesa->buf, BackSpecularExponent, 0); /* fixed point */ - - CHECK_DMA_BUFFER(gmesa, 29); - WRITEF(gmesa->buf, FrontAmbientColorRed, 0.2); - WRITEF(gmesa->buf, FrontAmbientColorGreen, 0.2); - WRITEF(gmesa->buf, FrontAmbientColorBlue, 0.2); - WRITEF(gmesa->buf, BackAmbientColorRed, 0.2); - WRITEF(gmesa->buf, BackAmbientColorGreen, 0.2); - WRITEF(gmesa->buf, BackAmbientColorBlue, 0.2); - WRITEF(gmesa->buf, FrontDiffuseColorRed, 0.8); - WRITEF(gmesa->buf, FrontDiffuseColorGreen, 0.8); - WRITEF(gmesa->buf, FrontDiffuseColorBlue, 0.8); - WRITEF(gmesa->buf, BackDiffuseColorRed, 0.8); - WRITEF(gmesa->buf, BackDiffuseColorGreen, 0.8); - WRITEF(gmesa->buf, BackDiffuseColorBlue, 0.8); - WRITEF(gmesa->buf, FrontSpecularColorRed, 0.0); - WRITEF(gmesa->buf, FrontSpecularColorGreen, 0.0); - WRITEF(gmesa->buf, FrontSpecularColorBlue, 0.0); - WRITEF(gmesa->buf, BackSpecularColorRed, 0.0); - WRITEF(gmesa->buf, BackSpecularColorGreen, 0.0); - WRITEF(gmesa->buf, BackSpecularColorBlue, 0.0); - WRITEF(gmesa->buf, FrontEmissiveColorRed, 0.0); - WRITEF(gmesa->buf, FrontEmissiveColorGreen, 0.0); - WRITEF(gmesa->buf, FrontEmissiveColorBlue, 0.0); - WRITEF(gmesa->buf, BackEmissiveColorRed, 0.0); - WRITEF(gmesa->buf, BackEmissiveColorGreen, 0.0); - WRITEF(gmesa->buf, BackEmissiveColorBlue, 0.0); - WRITEF(gmesa->buf, SceneAmbientColorRed, 0.2); - WRITEF(gmesa->buf, SceneAmbientColorGreen, 0.2); - WRITEF(gmesa->buf, SceneAmbientColorBlue, 0.2); - WRITEF(gmesa->buf, FrontAlpha, 1.0); - WRITEF(gmesa->buf, BackAlpha, 1.0); - - CHECK_DMA_BUFFER(gmesa, 7); - WRITE(gmesa->buf, PointSize, 1); - WRITEF(gmesa->buf, AApointSize, 1.0); - WRITE(gmesa->buf, LineWidth, 1); - WRITEF(gmesa->buf, AAlineWidth, 1.0); - WRITE(gmesa->buf, LineWidthOffset, 0); - WRITE(gmesa->buf, TransformMode, gmesa->TransformMode); - WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode); - - CHECK_DMA_BUFFER(gmesa, 16); - WRITE(gmesa->buf, Light0Mode, LNM_Off); - WRITE(gmesa->buf, Light1Mode, LNM_Off); - WRITE(gmesa->buf, Light2Mode, LNM_Off); - WRITE(gmesa->buf, Light3Mode, LNM_Off); - WRITE(gmesa->buf, Light4Mode, LNM_Off); - WRITE(gmesa->buf, Light5Mode, LNM_Off); - WRITE(gmesa->buf, Light6Mode, LNM_Off); - WRITE(gmesa->buf, Light7Mode, LNM_Off); - WRITE(gmesa->buf, Light8Mode, LNM_Off); - WRITE(gmesa->buf, Light9Mode, LNM_Off); - WRITE(gmesa->buf, Light10Mode, LNM_Off); - WRITE(gmesa->buf, Light11Mode, LNM_Off); - WRITE(gmesa->buf, Light12Mode, LNM_Off); - WRITE(gmesa->buf, Light13Mode, LNM_Off); - WRITE(gmesa->buf, Light14Mode, LNM_Off); - WRITE(gmesa->buf, Light15Mode, LNM_Off); - - CHECK_DMA_BUFFER(gmesa, 22); - WRITEF(gmesa->buf, Light0AmbientIntensityBlue, 0.0); - WRITEF(gmesa->buf, Light0AmbientIntensityGreen, 0.0); - WRITEF(gmesa->buf, Light0AmbientIntensityRed, 0.0); - WRITEF(gmesa->buf, Light0DiffuseIntensityBlue, 1.0); - WRITEF(gmesa->buf, Light0DiffuseIntensityGreen, 1.0); - WRITEF(gmesa->buf, Light0DiffuseIntensityRed, 1.0); - WRITEF(gmesa->buf, Light0SpecularIntensityBlue, 1.0); - WRITEF(gmesa->buf, Light0SpecularIntensityGreen, 1.0); - WRITEF(gmesa->buf, Light0SpecularIntensityRed, 1.0); - WRITEF(gmesa->buf, Light0SpotlightDirectionZ, 0.0); - WRITEF(gmesa->buf, Light0SpotlightDirectionY, 0.0); - WRITEF(gmesa->buf, Light0SpotlightDirectionX, -1.0); - WRITEF(gmesa->buf, Light0SpotlightExponent, 0.0); - WRITEF(gmesa->buf, Light0PositionZ, 0.0); - WRITEF(gmesa->buf, Light0PositionY, 0.0); - WRITEF(gmesa->buf, Light0PositionX, 1.0); - WRITEF(gmesa->buf, Light0PositionW, 0.0); - WRITEF(gmesa->buf, Light0CosSpotlightCutoffAngle, -1.0); - WRITEF(gmesa->buf, Light0ConstantAttenuation, 1.0); - WRITEF(gmesa->buf, Light0LinearAttenuation, 0.0); - WRITEF(gmesa->buf, Light0QuadraticAttenuation,0.0); - - CHECK_DMA_BUFFER(gmesa, 2); - WRITEF(gmesa->buf, XBias, 0.0); - WRITEF(gmesa->buf, YBias, 0.0); - - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, ViewPortScaleX, gmesa->driScreen->fbWidth/4); - WRITEF(gmesa->buf, ViewPortScaleY, gmesa->driScreen->fbHeight/4); - WRITEF(gmesa->buf, ViewPortScaleZ, 1.0f); - WRITEF(gmesa->buf, ViewPortOffsetX, gmesa->x); - WRITEF(gmesa->buf, ViewPortOffsetY, gmesa->y); - WRITEF(gmesa->buf, ViewPortOffsetZ, 0.0f); - - CHECK_DMA_BUFFER(gmesa, 3); - WRITEF(gmesa->buf, Nz, 1.0); - WRITEF(gmesa->buf, Ny, 0.0); - WRITEF(gmesa->buf, Nx, 0.0); - - /* Send the initialization commands to the HW */ - FLUSH_DMA_BUFFER(gmesa); -} diff --git a/src/mesa/drivers/dri/gamma/gamma_lock.c b/src/mesa/drivers/dri/gamma/gamma_lock.c deleted file mode 100644 index c58b59aa1b..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_lock.c +++ /dev/null @@ -1,60 +0,0 @@ - -#include "gamma_context.h" -#include "gamma_lock.h" -#include "drirenderbuffer.h" - -#ifdef DEBUG_LOCKING -char *prevLockFile = NULL; -int prevLockLine = 0; -#endif - - -/* Update the hardware state. This is called if another context has - * grabbed the hardware lock, which includes the X server. This - * function also updates the driver's window state after the X server - * moves, resizes or restacks a window -- the change will be reflected - * in the drawable position and clip rects. Since the X server grabs - * the hardware lock when it changes the window state, this routine will - * automatically be called after such a change. - */ -void gammaGetLock( gammaContextPtr gmesa, GLuint flags ) -{ - __DRIdrawable *dPriv = gmesa->driDrawable; - __DRIscreen *sPriv = gmesa->driScreen; - - drmGetLock( gmesa->driFd, gmesa->hHWContext, flags ); - - /* The window might have moved, so we might need to get new clip - * rects. - * - * NOTE: This releases and regrabs the hw lock to allow the X server - * to respond to the DRI protocol request for new drawable info. - * Since the hardware state depends on having the latest drawable - * clip rects, all state checking must be done _after_ this call. - */ - DRI_VALIDATE_DRAWABLE_INFO( sPriv, dPriv ); - - if ( gmesa->lastStamp != dPriv->lastStamp ) { - driUpdateFramebufferSize(gmesa->glCtx, dPriv); - gmesa->lastStamp = dPriv->lastStamp; - gmesa->new_state |= GAMMA_NEW_WINDOW | GAMMA_NEW_CLIP; - } - - gmesa->numClipRects = dPriv->numClipRects; - gmesa->pClipRects = dPriv->pClipRects; - -#if 0 - gmesa->dirty = ~0; - - if ( sarea->ctxOwner != gmesa->hHWContext ) { - sarea->ctxOwner = gmesa->hHWContext; - gmesa->dirty = GAMMA_UPLOAD_ALL; - } - - for ( i = 0 ; i < gmesa->lastTexHeap ; i++ ) { - if ( sarea->texAge[i] != gmesa->lastTexAge[i] ) { - gammaAgeTextures( gmesa, i ); - } - } -#endif -} diff --git a/src/mesa/drivers/dri/gamma/gamma_lock.h b/src/mesa/drivers/dri/gamma/gamma_lock.h deleted file mode 100644 index 2d117320da..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_lock.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef __GAMMA_LOCK_H__ -#define __GAMMA_LOCK_H__ - -extern void gammaGetLock( gammaContextPtr gmesa, GLuint flags ); - -/* Turn DEBUG_LOCKING on to find locking conflicts. - */ -#define DEBUG_LOCKING 0 - -#if DEBUG_LOCKING -extern char *prevLockFile; -extern int prevLockLine; - -#define DEBUG_LOCK() \ - do { \ - prevLockFile = (__FILE__); \ - prevLockLine = (__LINE__); \ - } while (0) - -#define DEBUG_RESET() \ - do { \ - prevLockFile = 0; \ - prevLockLine = 0; \ - } while (0) - -#define DEBUG_CHECK_LOCK() \ - do { \ - if ( prevLockFile ) { \ - fprintf( stderr, \ - "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \ - prevLockFile, prevLockLine, __FILE__, __LINE__ ); \ - exit( 1 ); \ - } \ - } while (0) - -#else - -#define DEBUG_LOCK() -#define DEBUG_RESET() -#define DEBUG_CHECK_LOCK() - -#endif - -/* - * !!! We may want to separate locks from locks with validation. This - * could be used to improve performance for those things commands that - * do not do any drawing !!! - */ - -/* Lock the hardware and validate our state. - */ -#define LOCK_HARDWARE( gmesa ) \ - do { \ - char __ret = 0; \ - DEBUG_CHECK_LOCK(); \ - DRM_CAS( gmesa->driHwLock, gmesa->hHWContext, \ - (DRM_LOCK_HELD | gmesa->hHWContext), __ret ); \ - if ( __ret ) \ - gammaGetLock( gmesa, 0 ); \ - DEBUG_LOCK(); \ - } while (0) - -/* Unlock the hardware. - */ -#define UNLOCK_HARDWARE( gmesa ) \ - do { \ - DRM_UNLOCK( gmesa->driFd, \ - gmesa->driHwLock, \ - gmesa->hHWContext ); \ - DEBUG_RESET(); \ - } while (0) - -#define GAMMAHW_LOCK( gmesa ) \ - DRM_UNLOCK(gmesa->driFd, gmesa->driHwLock, gmesa->hHWContext); \ - DRM_SPINLOCK(&gmesa->driScreen->pSAREA->drawable_lock, \ - gmesa->driScreen->drawLockID); \ - VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa); - -#define GAMMAHW_UNLOCK( gmesa ) \ - DRM_SPINUNLOCK(&gmesa->driScreen->pSAREA->drawable_lock, \ - gmesa->driScreen->drawLockID); \ - VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa); - -#endif /* __GAMMA_LOCK_H__ */ diff --git a/src/mesa/drivers/dri/gamma/gamma_macros.h b/src/mesa/drivers/dri/gamma/gamma_macros.h deleted file mode 100644 index d962dcdb56..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_macros.h +++ /dev/null @@ -1,323 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - */ - -#ifndef _GAMMA_MACROS_H_ -#define _GAMMA_MACROS_H_ - -#define DEBUG_DRMDMA -#define DEBUG_ERRORS -#define DEBUG_COMMANDS_NOT -#define DEBUG_VERBOSE_NOT -#define DEBUG_VERBOSE_EXTRA_NOT - -#define RANDOMIZE_COLORS_NOT -#define TURN_OFF_CLEARS_NOT -#define CULL_ALL_PRIMS_NOT -#define TURN_OFF_DEPTH_NOT -#define TURN_OFF_BLEND_NOT -#define FAST_CLEAR_4_NOT -#define FORCE_DEPTH32_NOT -#define DONT_SEND_DMA_NOT -#define TURN_OFF_FCP_NOT -#define TURN_OFF_TEXTURES_NOT -#define DO_VALIDATE - -#define GAMMA_DMA_BUFFER_SIZE 4096 - -#if 0 -#define GAMMA_DMA_SEND_FLAGS DRM_DMA_PRIORITY -#define GAMMA_DMA_SEND_FLAGS DRM_DMA_BLOCK -#else -/* MUST use non-blocking dma flags for drawable lock routines */ -#define GAMMA_DMA_SEND_FLAGS 0 -#endif - -#if 0 -#define GAMMA_DMA_GET_FLAGS \ - (DRM_DMA_SMALLER_OK | DRM_DMA_LARGER_OK | DRM_DMA_WAIT) -#else -#define GAMMA_DMA_GET_FLAGS DRM_DMA_WAIT -#endif - -#if defined(DEBUG_DRMDMA) || defined(DEBUG_COMMANDS) || defined(DEBUG_VERBOSE) -#include -#endif - -/* Note: The argument to DEBUG_GLCMDS() _must_ be enclosed in parenthesis */ -#ifdef DEBUG_VERBOSE -#define DEBUG_GLCMDS(s) printf s -#else -#define DEBUG_GLCMDS(s) -#endif - -/* Note: The argument to DEBUG_DMACMDS() _must_ be enclosed in parenthesis */ -#ifdef DEBUG_DRMDMA -#define DEBUG_DMACMDS(s) printf s -#else -#define DEBUG_DMACMDS(s) -#endif - -/* Note: The argument to DEBUG_WRITE() _must_ be enclosed in parenthesis */ -#ifdef DEBUG_COMMANDS -#define DEBUG_WRITE(s) printf s -#else -#define DEBUG_WRITE(s) -#endif - -/* Note: The argument to DEBUG_ERROR() _must_ be enclosed in parenthesis */ -#ifdef DEBUG_ERRORS -#define DEBUG_ERROR(s) printf s -#else -#define DEBUG_ERROR(s) -#endif - -#define WRITEV(buf,val1,val2,val3,val4) \ -do { \ - buf++->i = 0x9C008300; \ - buf++->f = val1; \ - buf++->f = val2; \ - buf++->f = val3; \ - buf++->f = val4; \ -} while (0) - -#define WRITE(buf,reg,val) \ -do { \ - buf++->i = Glint##reg##Tag; \ - buf++->i = val; \ - DEBUG_WRITE(("WRITE(buf, %s, 0x%08x);\n", #reg, (int)val)); \ -} while (0) - -#define WRITEF(buf,reg,val) \ -do { \ - buf++->i = Glint##reg##Tag; \ - buf++->f = val; \ - DEBUG_WRITE(("WRITEF(buf, %s, %f);\n", #reg, (float)val)); \ -} while (0) - -#define CHECK_WC_DMA_BUFFER(gcp,n) \ -do { \ - (gcp)->WCbufCount += (n<<1); \ -} while (0) - -#define CHECK_DMA_BUFFER(gcp,n) \ -do { \ - if ((gcp)->bufCount+(n<<1) >= (gcp)->bufSize) \ - PROCESS_DMA_BUFFER(gcp); \ - (gcp)->bufCount += (n<<1); \ -} while (0) - -#define CHECK_DMA_BUFFER2(gcp,n) \ -do { \ - if ((gcp)->bufCount+n >= (gcp)->bufSize) \ - PROCESS_DMA_BUFFER(gcp); \ - (gcp)->bufCount += n; \ -} while (0) - -#define FLUSH_DMA_BUFFER(gcp) \ -do { \ - if (gcp->bufCount) \ - PROCESS_DMA_BUFFER(gcp); \ -} while (0) - -#ifdef DONT_SEND_DMA -#define GET_DMA(fd, hHWCtx, n, idx, size) -#define SEND_DMA(fd, hHWCtx,n, idx, cnt) -#else -#define GET_DMA(fd, hHWCtx, n, idx, size) \ -do { \ - drmDMAReq dma; \ - int retcode, i; \ - \ - dma.context = (hHWCtx); \ - dma.send_count = 0; \ - dma.send_list = NULL; \ - dma.send_sizes = NULL; \ - dma.flags = GAMMA_DMA_GET_FLAGS; \ - dma.request_count = (n); \ - dma.request_size = GAMMA_DMA_BUFFER_SIZE; \ - dma.request_list = (idx); \ - dma.request_sizes = (size); \ - \ - do { \ - if ((retcode = drmDMA((fd), &dma))) { \ - DEBUG_DMACMDS(("drmDMA returned %d\n", retcode)); \ - } \ - } while (!(dma).granted_count); \ - \ - for (i = 0; i < (n); i++) { \ - (size)[i] >>= 2; /* Convert from bytes to words */ \ - } \ -} while (0) - -#define SEND_DMA(fd, hHWCtx, n, idx, cnt) \ -do { \ - drmDMAReq dma; \ - int retcode, i; \ - \ - for (i = 0; i < (n); i++) { \ - (cnt)[i] <<= 2; /* Convert from words to bytes */ \ - } \ - \ - dma.context = (hHWCtx); \ - dma.send_count = 1; \ - dma.send_list = (idx); \ - dma.send_sizes = (cnt); \ - dma.flags = GAMMA_DMA_SEND_FLAGS; \ - dma.request_count = 0; \ - dma.request_size = 0; \ - dma.request_list = NULL; \ - dma.request_sizes = NULL; \ - \ - if ((retcode = drmDMA((fd), &dma))) { \ - DEBUG_DMACMDS(("drmDMA returned %d\n", retcode)); \ - } \ - \ - for (i = 0; i < (n); i++) { \ - (cnt)[i] = 0; \ - } \ -} while (0) -#endif - -#define GET_FIRST_DMA(fd, hHWCtx, n, idx, size, buf, cnt, gPriv) \ -do { \ - int i; \ - \ - GET_DMA(fd, hHWCtx, n, idx, size); \ - \ - for (i = 0; i < (n); i++) { \ - (buf)[i] = (dmaBuf)(gPriv)->bufs->list[(idx)[i]].address; \ - (cnt)[i] = 0; \ - } \ -} while (0) - -#define PROCESS_DMA_BUFFER_TOP_HALF(gcp) \ -do { \ - SEND_DMA((gcp)->driFd, \ - (gcp)->hHWContext, 1, &(gcp)->bufIndex, &(gcp)->bufCount); \ -} while (0) - -#define PROCESS_DMA_BUFFER_BOTTOM_HALF(gcp) \ -do { \ - GET_DMA((gcp)->driFd, \ - (gcp)->hHWContext, 1, &(gcp)->bufIndex, &(gcp)->bufSize); \ - \ - (gcp)->buf = \ - (dmaBuf)(gcp)->gammaScreen->bufs->list[(gcp)->bufIndex].address; \ -} while (0) - -#define PROCESS_DMA_BUFFER(gcp) \ -do { \ - VALIDATE_DRAWABLE_INFO(gcp); \ - PROCESS_DMA_BUFFER_TOP_HALF(gcp); \ - PROCESS_DMA_BUFFER_BOTTOM_HALF(gcp); \ -} while (0) - -#ifdef DO_VALIDATE -#define VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp) \ -do { \ - /*__DRIscreen *psp = gcp->driScreen;*/ \ - __DRIdrawable *pdp = gcp->driDrawable; \ - \ - if (*(pdp->pStamp) != pdp->lastStamp) { \ - int old_index = pdp->index; \ - while (*(pdp->pStamp) != pdp->lastStamp) { \ - DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp); \ - } \ - if (pdp->index != old_index) { \ - gcp->Window &= ~W_GIDMask; \ - gcp->Window |= (pdp->index << 5); \ - CHECK_WC_DMA_BUFFER(gcp, 1); \ - WRITE(gcp->WCbuf, GLINTWindow, gcp->Window|(gcp->FrameCount<<9));\ - } \ - \ - gammaUpdateViewportOffset( gcp->glCtx); \ - \ - if (pdp->numClipRects == 1 && \ - pdp->pClipRects->x1 == pdp->x && \ - pdp->pClipRects->x2 == (pdp->x+pdp->w) && \ - pdp->pClipRects->y1 == pdp->y && \ - pdp->pClipRects->y2 == (pdp->y+pdp->h)) { \ - CHECK_WC_DMA_BUFFER(gcp, 1); \ - WRITE(gcp->WCbuf, Rectangle2DControl, 0); \ - gcp->NotClipped = GL_TRUE; \ - } else { \ - CHECK_WC_DMA_BUFFER(gcp, 1); \ - WRITE(gcp->WCbuf, Rectangle2DControl, 1); \ - gcp->NotClipped = GL_FALSE; \ - } \ - gcp->WindowChanged = GL_TRUE; \ - \ - if (gcp->WCbufCount) { \ - SEND_DMA((gcp)->gammaScreen->driScreen->fd, \ - (gcp)->hHWContext, 1, &(gcp)->WCbufIndex, \ - &(gcp)->WCbufCount); \ - (gcp)->WCbufIndex = -1; \ - } \ - } \ -} while (0) - -#define VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gcp) \ -do { \ - if ((gcp)->WCbufIndex < 0) { \ - GET_DMA((gcp)->gammaScreen->driScreen->fd, \ - (gcp)->hHWContext, 1, &(gcp)->WCbufIndex, \ - &(gcp)->WCbufSize); \ - \ - (gcp)->WCbuf = \ - (dmaBuf)(gcp)->gammaScreen->bufs-> \ - list[(gcp)->WCbufIndex].address; \ - } \ -} while (0) - -#define VALIDATE_DRAWABLE_INFO(gcp) \ -do { \ - __DRIscreen *psp = gcp->driScreen; \ -if (gcp->driDrawable) { \ - DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ - VALIDATE_DRAWABLE_INFO_NO_LOCK(gcp); \ - DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); \ - VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gcp); \ -} \ -} while (0) -#else -#define VALIDATE_DRAWABLE_INFO(gcp) -#endif - -#define CALC_LOG2(l2,s) \ -do { \ - int __s = s; \ - l2 = 0; \ - while (__s > 1) { ++l2; __s >>= 1; } \ -} while (0) - -#endif /* _GAMMA_MACROS_H_ */ diff --git a/src/mesa/drivers/dri/gamma/gamma_regs.h b/src/mesa/drivers/dri/gamma/gamma_regs.h deleted file mode 100644 index 9e1c735019..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_regs.h +++ /dev/null @@ -1,658 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - */ - -#ifndef _GAMMA_REGS_H_ -#define _GAMMA_REGS_H_ - -#include "gamma_client.h" - -/**************** MX FLAGS ****************/ -/* FBReadMode */ -#define FBReadSrcDisable 0x00000000 -#define FBReadSrcEnable 0x00000200 -#define FBReadDstDisable 0x00000000 -#define FBReadDstEnable 0x00000400 -#define FBDataTypeDefault 0x00000000 -#define FBDataTypeColor 0x00008000 -#define FBWindowOriginTop 0x00000000 -#define FBWindowOriginBot 0x00010000 -#define FBScanLineInt1 0x00000000 -#define FBScanLineInt2 0x00800000 -#define FBScanLineInt4 0x01000000 -#define FBScanLineInt8 0x01800000 -#define FBSrcAddrConst 0x00000000 -#define FBSrcAddrIndex 0x10000000 -#define FBSrcAddrCoord 0x20000000 - -/* LBReadMode */ -#define LBPartialProdMask 0x000001ff -#define LBReadSrcDisable 0x00000000 -#define LBReadSrcEnable 0x00000200 -#define LBReadDstDisable 0x00000000 -#define LBReadDstEnable 0x00000400 -#define LBDataTypeDefault 0x00000000 -#define LBDataTypeStencil 0x00010000 -#define LBDataTypeDepth 0x00020000 -#define LBWindowOriginTop 0x00000000 -#define LBWindowOriginBot 0x00040000 -#define LBScanLineInt1 0x00000000 -#define LBScanLineInt2 0x00100000 -#define LBScanLineInt4 0x00200000 -#define LBScanLineInt8 0x00300000 - -/* ColorDDAMode */ -#define ColorDDADisable 0x00000000 -#define ColorDDAEnable 0x00000001 -#define ColorDDAFlat 0x00000000 -#define ColorDDAGouraud 0x00000002 -#define ColorDDAShadingMask 0x00000002 - -/* AlphaTestMode */ -#define AlphaTestModeDisable 0x00000000 -#define AlphaTestModeEnable 0x00000001 -#define AT_Never 0x00000000 -#define AT_Less 0x00000002 -#define AT_Equal 0x00000004 -#define AT_LessEqual 0x00000006 -#define AT_Greater 0x00000008 -#define AT_NotEqual 0x0000000a -#define AT_GreaterEqual 0x0000000c -#define AT_Always 0x0000000e -#define AT_CompareMask 0x0000000e -#define AT_RefValueMask 0x00000ff0 - -/* AlphaBlendMode */ -#define AlphaBlendModeDisable 0x00000000 -#define AlphaBlendModeEnable 0x00000001 -#define AB_Src_Zero 0x00000000 -#define AB_Src_One 0x00000002 -#define AB_Src_DstColor 0x00000004 -#define AB_Src_OneMinusDstColor 0x00000006 -#define AB_Src_SrcAlpha 0x00000008 -#define AB_Src_OneMinusSrcAlpha 0x0000000a -#define AB_Src_DstAlpha 0x0000000c -#define AB_Src_OneMinusDstAlpha 0x0000000e -#define AB_Src_SrcAlphaSaturate 0x00000010 -#define AB_SrcBlendMask 0x0000001e -#define AB_Dst_Zero 0x00000000 -#define AB_Dst_One 0x00000020 -#define AB_Dst_SrcColor 0x00000040 -#define AB_Dst_OneMinusSrcColor 0x00000060 -#define AB_Dst_SrcAlpha 0x00000080 -#define AB_Dst_OneMinusSrcAlpha 0x000000a0 -#define AB_Dst_DstAlpha 0x000000c0 -#define AB_Dst_OneMinusDstAlpha 0x000000e0 -#define AB_DstBlendMask 0x000000e0 -#define AB_ColorFmt_8888 0x00000000 -#define AB_ColorFmt_5555 0x00000100 -#define AB_ColorFmt_4444 0x00000200 -#define AB_ColorFmt_4444Front 0x00000300 -#define AB_ColorFmt_4444Back 0x00000400 -#define AB_ColorFmt_332Front 0x00000500 -#define AB_ColorFmt_332Back 0x00000600 -#define AB_ColorFmt_121Front 0x00000700 -#define AB_ColorFmt_121Back 0x00000800 -#define AB_ColorFmt_555Back 0x00000d00 -#define AB_ColorFmt_CI8 0x00000e00 -#define AB_ColorFmt_CI4 0x00000f00 -#define AB_AlphaBufferPresent 0x00000000 -#define AB_NoAlphaBufferPresent 0x00001000 -#define AB_ColorOrder_BGR 0x00000000 -#define AB_ColorOrder_RGB 0x00002000 -#define AB_OpenGLType 0x00000000 -#define AB_QuickDraw3DType 0x00004000 -#define AB_AlphaDst_FBData 0x00000000 -#define AB_AlphaDst_FBSourceData 0x00008000 -#define AB_ColorConversionScale 0x00000000 -#define AB_ColorConversionShift 0x00010000 -#define AB_AlphaConversionScale 0x00000000 -#define AB_AlphaConversionShift 0x00020000 - -/* AntialiasMode */ -#define AntialiasModeDisable 0x00000000 -#define AntialiasModeEnable 0x00000001 - -/* AreaStippleMode */ -#define AreaStippleModeDisable 0x00000000 -#define AreaStippleModeEnable 0x00000001 -#define ASM_X32 0x00000008 -#define ASM_Y32 0x00000040 - -/* DepthMode */ -#define DepthModeDisable 0x00000000 -#define DepthModeEnable 0x00000001 -#define DM_WriteMask 0x00000002 -#define DM_SourceFragment 0x00000000 -#define DM_SourceLBData 0x00000004 -#define DM_SourceDepthRegister 0x00000008 -#define DM_SourceLBSourceData 0x0000000c -#define DM_SourceMask 0x0000000c -#define DM_Never 0x00000000 -#define DM_Less 0x00000010 -#define DM_Equal 0x00000020 -#define DM_LessEqual 0x00000030 -#define DM_Greater 0x00000040 -#define DM_NotEqual 0x00000050 -#define DM_GreaterEqual 0x00000060 -#define DM_Always 0x00000070 -#define DM_CompareMask 0x00000070 - -/* FBWriteMode */ -#define FBWriteModeDisable 0x00000000 -#define FBWriteModeEnable 0x00000001 -#define FBW_UploadColorData 0x00000008 - -/* FogMode */ -#define FogModeDisable 0x00000000 -#define FogModeEnable 0x00000001 - -/* LBWriteMode */ -#define LBWriteModeDisable 0x00000000 -#define LBWriteModeEnable 0x00000001 -#define LBW_UploadNone 0x00000000 -#define LBW_UploadDepth 0x00000002 -#define LBW_UploadStencil 0x00000004 - -/* LBRead/Write Format */ -#define LBRF_DepthWidth15 0x03 /* only permedia */ -#define LBRF_DepthWidth16 0x00 -#define LBRF_DepthWidth24 0x01 -#define LBRF_DepthWidth32 0x02 -#define LBRF_StencilWidth0 (0 << 2) -#define LBRF_StencilWidth4 (1 << 2) -#define LBRF_StencilWidth8 (2 << 2) -#define LBRF_StencilPos16 (0 << 4) -#define LBRF_StencilPos20 (1 << 4) -#define LBRF_StencilPos24 (2 << 4) -#define LBRF_StencilPos28 (3 << 4) -#define LBRF_StencilPos32 (4 << 4) -#define LBRF_FrameCount0 (0 << 7) -#define LBRF_FrameCount4 (1 << 7) -#define LBRF_FrameCount8 (2 << 7) -#define LBRF_FrameCountPos16 (0 << 9) -#define LBRF_FrameCountPos20 (1 << 9) -#define LBRF_FrameCountPos24 (2 << 9) -#define LBRF_FrameCountPos28 (3 << 9) -#define LBRF_FrameCountPos32 (4 << 9) -#define LBRF_FrameCountPos36 (5 << 9) -#define LBRF_FrameCountPos40 (6 << 9) -#define LBRF_GIDWidth0 (0 << 12) -#define LBRF_GIDWidth4 (1 << 12) -#define LBRF_GIDPos16 (0 << 13) -#define LBRF_GIDPos20 (1 << 13) -#define LBRF_GIDPos24 (2 << 13) -#define LBRF_GIDPos28 (3 << 13) -#define LBRF_GIDPos32 (4 << 13) -#define LBRF_GIDPos36 (5 << 13) -#define LBRF_GIDPos40 (6 << 13) -#define LBRF_GIDPos44 (7 << 13) -#define LBRF_GIDPos48 (8 << 13) -#define LBRF_Compact32 (1 << 17) - -/* StencilMode */ -#define StencilDisable 0x00000000 -#define StencilEnable 0x00000001 - -/* RouterMode */ -#define R_Order_TextureDepth 0x00000000 -#define R_Order_DepthTexture 0x00000001 - -/* ScissorMode */ -#define UserScissorDisable 0x00000000 -#define UserScissorEnable 0x00000001 -#define ScreenScissorDisable 0x00000000 -#define ScreenScissorEnable 0x00000002 - -/* DitherMode */ -#define DitherModeDisable 0x00000000 -#define DitherModeEnable 0x00000001 -#define DM_DitherDisable 0x00000000 -#define DM_DitherEnable 0x00000002 -#define DM_ColorFmt_8888 0x00000000 -#define DM_ColorFmt_5555 0x00000004 -#define DM_ColorFmt_4444 0x00000008 -#define DM_ColorFmt_4444Front 0x0000000c -#define DM_ColorFmt_4444Back 0x00000010 -#define DM_ColorFmt_332Front 0x00000014 -#define DM_ColorFmt_332Back 0x00000018 -#define DM_ColorFmt_121Front 0x0000001c -#define DM_ColorFmt_121Back 0x00000020 -#define DM_ColorFmt_555Back 0x00000024 -#define DM_ColorFmt_CI8 0x00000028 -#define DM_ColorFmt_CI4 0x0000002c -#define DM_XOffsetMask 0x000000c0 -#define DM_YOffsetMask 0x00000300 -#define DM_ColorOrder_BGR 0x00000000 -#define DM_ColorOrder_RGB 0x00000400 -#define DM_AlphaDitherDefault 0x00000000 -#define DM_AlphaDitherNone 0x00004000 -#define DM_Truncate 0x00000000 -#define DM_Round 0x00008000 - -/* RasterizerMode */ -#define RM_MirrorBitMask 0x00000001 -#define RM_InvertBitMask 0x00000002 -#define RM_FractionAdjNo 0x00000000 -#define RM_FractionAdjZero 0x00000004 -#define RM_FractionAdjHalf 0x00000008 -#define RM_FractionAdjNearHalf 0x0000000c -#define RM_BiasCoordZero 0x00000000 -#define RM_BiasCoordHalf 0x00000010 -#define RM_BiasCoordNearHalf 0x00000020 -#define RM_BitMaskByteSwap_ABCD 0x00000000 -#define RM_BitMaskByteSwap_BADC 0x00000080 -#define RM_BitMaskByteSwap_CDAB 0x00000100 -#define RM_BitMaskByteSwap_DCBA 0x00000180 -#define RM_BitMaskPacked 0x00000000 -#define RM_BitMaskEveryScanline 0x00000200 -#define RM_BitMaskOffsetMask 0x00007c00 -#define RM_HostDataByteSwap_ABCD 0x00000000 -#define RM_HostDataByteSwap_BADC 0x00008000 -#define RM_HostDataByteSwap_CDAB 0x00010000 -#define RM_HostDataByteSwap_DCBA 0x00018000 -#define RM_SingleGLINT 0x00000000 -#define RM_MultiGLINT 0x00020000 -#define RM_YLimitsEnable 0x00040000 - -/* Window */ -#define WindowDisable 0x00000000 -#define WindowEnable 0x00000001 -#define W_AlwaysPass 0x00000000 -#define W_NeverPass 0x00000002 -#define W_PassIfEqual 0x00000004 -#define W_PassIfNotEqual 0x00000006 -#define W_CompareMask 0x00000006 -#define W_ForceLBUpdate 0x00000008 -#define W_LBUpdateFromSource 0x00000000 -#define W_LBUpdateFromRegisters 0x00000010 -#define W_GIDMask 0x000001e0 -#define W_FrameCountMask 0x0001fe00 -#define W_StencilFCP 0x00020000 -#define W_DepthFCP 0x00040000 -#define W_OverrideWriteFiltering 0x00080000 - -/* TextureAddressMode */ -#define TextureAddressModeDisable 0x00000000 -#define TextureAddressModeEnable 0x00000001 -#define TAM_SWrap_Clamp 0x00000000 -#define TAM_SWrap_Repeat 0x00000002 -#define TAM_SWrap_Mirror 0x00000004 -#define TAM_SWrap_Mask 0x00000006 -#define TAM_TWrap_Clamp 0x00000000 -#define TAM_TWrap_Repeat 0x00000008 -#define TAM_TWrap_Mirror 0x00000010 -#define TAM_TWrap_Mask 0x00000018 -#define TAM_Operation_2D 0x00000000 -#define TAM_Operation_3D 0x00000020 -#define TAM_InhibitDDAInit 0x00000040 -#define TAM_LODDisable 0x00000000 -#define TAM_LODEnable 0x00000080 -#define TAM_DY_Disable 0x00000000 -#define TAM_DY_Enable 0x00000100 -#define TAM_WidthMask 0x00001e00 -#define TAM_HeightMask 0x0001e000 -#define TAM_TexMapType_1D 0x00000000 -#define TAM_TexMapType_2D 0x00020000 -#define TAM_TexMapType_Mask 0x00020000 - -/* TextureReadMode */ -#define TextureReadModeDisable 0x00000000 -#define TextureReadModeEnable 0x00000001 -#define TRM_WidthMask 0x0000001e -#define TRM_HeightMask 0x000001e0 -#define TRM_Depth1 0x00000000 -#define TRM_Depth2 0x00000200 -#define TRM_Depth4 0x00000400 -#define TRM_Depth8 0x00000600 -#define TRM_Depth16 0x00000800 -#define TRM_Depth32 0x00000a00 -#define TRM_DepthMask 0x00000e00 -#define TRM_Border 0x00001000 -#define TRM_Patch 0x00002000 -#define TRM_Mag_Nearest 0x00000000 -#define TRM_Mag_Linear 0x00004000 -#define TRM_Mag_Mask 0x00004000 -#define TRM_Min_Nearest 0x00000000 -#define TRM_Min_Linear 0x00008000 -#define TRM_Min_NearestMMNearest 0x00010000 -#define TRM_Min_NearestMMLinear 0x00018000 -#define TRM_Min_LinearMMNearest 0x00020000 -#define TRM_Min_LinearMMLinear 0x00028000 -#define TRM_Min_Mask 0x00038000 -#define TRM_UWrap_Clamp 0x00000000 -#define TRM_UWrap_Repeat 0x00040000 -#define TRM_UWrap_Mirror 0x00080000 -#define TRM_UWrap_Mask 0x000c0000 -#define TRM_VWrap_Clamp 0x00000000 -#define TRM_VWrap_Repeat 0x00100000 -#define TRM_VWrap_Mirror 0x00200000 -#define TRM_VWrap_Mask 0x00300000 -#define TRM_TexMapType_1D 0x00000000 -#define TRM_TexMapType_2D 0x00400000 -#define TRM_TexMapType_Mask 0x00400000 -#define TRM_MipMapDisable 0x00000000 -#define TRM_MipMapEnable 0x00800000 -#define TRM_PrimaryCacheDisable 0x00000000 -#define TRM_PrimaryCacheEnable 0x01000000 -#define TRM_FBSourceAddr_None 0x00000000 -#define TRM_FBSourceAddr_Index 0x02000000 -#define TRM_FBSourceAddr_Coord 0x04000000 -#define TRM_BorderClamp 0x08000000 - -/* TextureColorMode */ -#define TextureColorModeDisable 0x00000000 -#define TextureColorModeEnable 0x00000001 -#define TCM_Modulate 0x00000000 -#define TCM_Decal 0x00000002 -#define TCM_Blend 0x00000004 -#define TCM_Replace 0x00000006 -#define TCM_ApplicationMask 0x0000000e -#define TCM_OpenGLType 0x00000000 -#define TCM_QuickDraw3DType 0x00000010 -#define TCM_KdDDA_Disable 0x00000000 -#define TCM_KdDDA_Enable 0x00000020 -#define TCM_KsDDA_Disable 0x00000000 -#define TCM_KsDDA_Enable 0x00000040 -#define TCM_BaseFormat_Alpha 0x00000000 -#define TCM_BaseFormat_Lum 0x00000080 -#define TCM_BaseFormat_LumAlpha 0x00000100 -#define TCM_BaseFormat_Intensity 0x00000180 -#define TCM_BaseFormat_RGB 0x00000200 -#define TCM_BaseFormat_RGBA 0x00000280 -#define TCM_BaseFormatMask 0x00000380 -#define TCM_LoadMode_None 0x00000000 -#define TCM_LoadMode_Ks 0x00000400 -#define TCM_LoadMode_Kd 0x00000800 - -/* TextureCacheControl */ -#define TCC_Invalidate 0x00000001 -#define TCC_Disable 0x00000000 -#define TCC_Enable 0x00000002 - -/* TextureFilterMode */ -#define TextureFilterModeDisable 0x00000000 -#define TextureFilterModeEnable 0x00000001 -#define TFM_AlphaMapEnable 0x00000002 -#define TFM_AlphaMapSense 0x00000004 - -/* TextureFormat */ -#define TF_LittleEndian 0x00000000 -#define TF_BigEndian 0x00000001 -#define TF_16Bit_565 0x00000000 -#define TF_16Bit_555 0x00000002 -#define TF_ColorOrder_BGR 0x00000000 -#define TF_ColorOrder_RGB 0x00000004 -#define TF_Compnents_1 0x00000000 -#define TF_Compnents_2 0x00000008 -#define TF_Compnents_3 0x00000010 -#define TF_Compnents_4 0x00000018 -#define TF_CompnentsMask 0x00000018 -#define TF_OutputFmt_Texel 0x00000000 -#define TF_OutputFmt_Color 0x00000020 -#define TF_OutputFmt_BitMask 0x00000040 -#define TF_OutputFmtMask 0x00000060 -#define TF_MirrorEnable 0x00000080 -#define TF_InvertEnable 0x00000100 -#define TF_ByteSwapEnable 0x00000200 -#define TF_LUTOffsetMask 0x0003fc00 -#define TF_OneCompFmt_Lum 0x00000000 -#define TF_OneCompFmt_Alpha 0x00040000 -#define TF_OneCompFmt_Intensity 0x00080000 -#define TF_OneCompFmt_Mask 0x000c0000 -/**************** MX FLAGS ****************/ - -/************** GAMMA FLAGS ***************/ -/* GeometryMode */ -#define GM_TextureDisable 0x00000000 -#define GM_TextureEnable 0x00000001 -#define GM_FogDisable 0x00000000 -#define GM_FogEnable 0x00000002 -#define GM_FogLinear 0x00000000 -#define GM_FogExp 0x00000004 -#define GM_FogExpSquared 0x00000008 -#define GM_FogMask 0x0000000C -#define GM_FrontPolyPoint 0x00000000 -#define GM_FrontPolyLine 0x00000010 -#define GM_FrontPolyFill 0x00000020 -#define GM_BackPolyPoint 0x00000000 -#define GM_BackPolyLine 0x00000040 -#define GM_BackPolyFill 0x00000080 -#define GM_FB_PolyMask 0x000000F0 -#define GM_FrontFaceCW 0x00000000 -#define GM_FrontFaceCCW 0x00000100 -#define GM_FFMask 0x00000100 -#define GM_PolyCullDisable 0x00000000 -#define GM_PolyCullEnable 0x00000200 -#define GM_PolyCullFront 0x00000000 -#define GM_PolyCullBack 0x00000400 -#define GM_PolyCullBoth 0x00000800 -#define GM_PolyCullMask 0x00000c00 -#define GM_ClipShortLinesDisable 0x00000000 -#define GM_ClipShortLinesEnable 0x00001000 -#define GM_ClipSmallTrisDisable 0x00000000 -#define GM_ClipSmallTrisEnable 0x00002000 -#define GM_RenderMode 0x00000000 -#define GM_SelectMode 0x00004000 -#define GM_FeedbackMode 0x00008000 -#define GM_Feedback2D 0x00000000 -#define GM_Feedback3D 0x00010000 -#define GM_Feedback3DColor 0x00020000 -#define GM_Feedback3DColorTexture 0x00030000 -#define GM_Feedback4DColorTexture 0x00040000 -#define GM_CullFaceNormDisable 0x00000000 -#define GM_CullFaceNormEnable 0x00080000 -#define GM_AutoFaceNormDisable 0x00000000 -#define GM_AutoFaceNormEnable 0x00100000 -#define GM_GouraudShading 0x00000000 -#define GM_FlatShading 0x00200000 -#define GM_ShadingMask 0x00200000 -#define GM_UserClipNone 0x00000000 -#define GM_UserClip0 0x00400000 -#define GM_UserClip1 0x00800000 -#define GM_UserClip2 0x01000000 -#define GM_UserClip3 0x02000000 -#define GM_UserClip4 0x04000000 -#define GM_UserClip5 0x08000000 -#define GM_PolyOffsetPointDisable 0x00000000 -#define GM_PolyOffsetPointEnable 0x10000000 -#define GM_PolyOffsetLineDisable 0x00000000 -#define GM_PolyOffsetLineEnable 0x20000000 -#define GM_PolyOffsetFillDisable 0x00000000 -#define GM_PolyOffsetFillEnable 0x40000000 -#define GM_InvertFaceNormCullDisable 0x00000000 -#define GM_InvertFaceNormCullEnable 0x80000000 - -/* Begin */ -#define B_AreaStippleDisable 0x00000000 -#define B_AreaStippleEnable 0x00000001 -#define B_LineStippleDisable 0x00000000 -#define B_LineStippleEnable 0x00000002 -#define B_AntiAliasDisable 0x00000000 -#define B_AntiAliasEnable 0x00000100 -#define B_TextureDisable 0x00000000 -#define B_TextureEnable 0x00002000 -#define B_FogDisable 0x00000000 -#define B_FogEnable 0x00004000 -#define B_SubPixelCorrectDisable 0x00000000 -#define B_SubPixelCorrectEnable 0x00010000 -#define B_PrimType_Null 0x00000000 -#define B_PrimType_Points 0x10000000 -#define B_PrimType_Lines 0x20000000 -#define B_PrimType_LineLoop 0x30000000 -#define B_PrimType_LineStrip 0x40000000 -#define B_PrimType_Triangles 0x50000000 -#define B_PrimType_TriangleStrip 0x60000000 -#define B_PrimType_TriangleFan 0x70000000 -#define B_PrimType_Quads 0x80000000 -#define B_PrimType_QuadStrip 0x90000000 -#define B_PrimType_Polygon 0xa0000000 -#define B_PrimType_Mask 0xf0000000 - -/* EdgeFlag */ -#define EdgeFlagDisable 0x00000000 -#define EdgeFlagEnable 0x00000001 - -/* NormalizeMode */ -#define NormalizeModeDisable 0x00000000 -#define NormalizeModeEnable 0x00000001 -#define FaceNormalDisable 0x00000000 -#define FaceNormalEnable 0x00000002 -#define InvertAutoFaceNormal 0x00000004 - -/* LightingMode */ -#define LightingModeDisable 0x00000000 -#define LightingModeEnable 0x00000001 -#define LightingModeTwoSides 0x00000004 -#define LightingModeLocalViewer 0x00000008 -#define LightingModeSpecularEnable 0x00008000 - -/* Light0Mode */ -#define Light0ModeDisable 0x00000000 -#define Light0ModeEnable 0x00000001 -#define Light0ModeSpotLight 0x00000002 -#define Light0ModeAttenuation 0x00000004 -#define Light0ModeLocal 0x00000008 - -/* Light0Mode */ -#define Light1ModeDisable 0x00000000 -#define Light1ModeEnable 0x00000001 -#define Light1ModeSpotLight 0x00000002 -#define Light1ModeAttenuation 0x00000004 -#define Light1ModeLocal 0x00000008 - -/* ColorMaterialMode */ -#define ColorMaterialModeDisable 0x00000000 -#define ColorMaterialModeEnable 0x00000001 -#define ColorMaterialModeFront 0x00000000 -#define ColorMaterialModeBack 0x00000002 -#define ColorMaterialModeFrontAndBack 0x00000004 -#define ColorMaterialModeEmission 0x00000000 -#define ColorMaterialModeAmbient 0x00000008 -#define ColorMaterialModeDiffuse 0x00000010 -#define ColorMaterialModeSpecular 0x00000018 -#define ColorMaterialModeAmbAndDiff 0x00000020 -#define ColorMaterialModeMask 0x0000003e - -/* MaterialMode */ -#define MaterialModeDisable 0x00000000 -#define MaterialModeEnable 0x00000001 -#define MaterialModeTwoSides 0x00000080 - -/* DeltaMode */ -#define DM_Target300SX 0x00000000 -#define DM_Target500TXMX 0x00000001 -#define DM_Depth16 0x00000004 -#define DM_Depth24 0x00000008 -#define DM_Depth32 0x0000000c -#define DM_FogEnable 0x00000010 -#define DM_TextureEnable 0x00000020 -#define DM_SmoothShadingEnable 0x00000040 -#define DM_DepthEnable 0x00000080 -#define DM_SpecularEnable 0x00000100 -#define DM_DiffuseEnable 0x00000200 -#define DM_SubPixlCorrectionEnable 0x00000400 -#define DM_DiamondExit 0x00000800 -#define DM_NoDraw 0x00001000 -#define DM_ClampEnable 0x00002000 -#define DM_TextureParameterAsGiven 0x00000000 -#define DM_TextureParameterClamped 0x00004000 -#define DM_TextureParameterNormalized 0x00008000 -#define DM_BiasCoords 0x00080000 -#define DM_ColorDiffuse 0x00100000 -#define DM_ColorSpecular 0x00200000 -#define DM_FlatShadingMethod 0x00400000 - -/* PointMode */ -#define PM_AntialiasDisable 0x00000000 -#define PM_AntialiasEnable 0x00000001 -#define PM_AntialiasQuality_4x4 0x00000000 -#define PM_AntialiasQuality_8x8 0x00000002 - -/* LogicalOpMode */ -#define LogicalOpModeDisable 0x00000000 -#define LogicalOpModeEnable 0x00000001 -#define LogicalOpModeMask 0x0000001e - -/* LineMode */ -#define LM_StippleDisable 0x00000000 -#define LM_StippleEnable 0x00000001 -#define LM_RepeatFactorMask 0x000003fe -#define LM_StippleMask 0x03fffc00 -#define LM_MirrorDisable 0x00000000 -#define LM_MirrorEnable 0x04000000 -#define LM_AntialiasDisable 0x00000000 -#define LM_AntialiasEnable 0x08000000 -#define LM_AntialiasQuality_4x4 0x00000000 -#define LM_AntialiasQuality_8x8 0x10000000 - -/* TriangleMode */ -#define TM_AntialiasDisable 0x00000000 -#define TM_AntialiasEnable 0x00000001 -#define TM_AntialiasQuality_4x4 0x00000000 -#define TM_AntialiasQuality_8x8 0x00000002 -#define TM_UseTriPacketInterface 0x00000004 - -/* TransformMode */ -#define XM_UseModelViewMatrix 0x00000001 -#define XM_UseModelViewProjMatrix 0x00000002 -#define XM_XformNormals 0x00000004 -#define XM_XformFaceNormals 0x00000008 -#define XM_XformTexture 0x00000010 -#define XM_XMask 0x00000013 -#define XM_TexGenModeS_None 0x00000000 -#define XM_TexGenModeS_ObjLinear 0x00000020 -#define XM_TexGenModeS_EyeLinear 0x00000040 -#define XM_TexGenModeS_SphereMap 0x00000060 -#define XM_TexGenModeT_None 0x00000000 -#define XM_TexGenModeT_ObjLinear 0x00000080 -#define XM_TexGenModeT_EyeLinear 0x00000100 -#define XM_TexGenModeT_SphereMap 0x00000180 -#define XM_TexGenModeR_None 0x00000000 -#define XM_TexGenModeR_ObjLinear 0x00000200 -#define XM_TexGenModeR_EyeLinear 0x00000400 -#define XM_TexGenModeR_SphereMap 0x00000600 -#define XM_TexGenModeQ_None 0x00000000 -#define XM_TexGenModeQ_ObjLinear 0x00000800 -#define XM_TexGenModeQ_EyeLinear 0x00001000 -#define XM_TexGenModeQQSphereMap 0x00001800 -#define XM_TexGenS 0x00002000 -#define XM_TexGenT 0x00004000 -#define XM_TexGenR 0x00008000 -#define XM_TexGenQ 0x00010000 - -/* LightNMode */ -#define LNM_Off 0x00000000 -#define LNM_On 0x00000001 -/************** GAMMA FLAGS ***************/ - -#endif /* _GAMMA_REGS_H_ */ diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c deleted file mode 100644 index 3c2fa507a9..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * 3DLabs Gamma driver. - * - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/imports.h" -#include "main/mtypes.h" - -#include "tnl/t_context.h" - -#include "gamma_context.h" -#include "gamma_macros.h" -#include "gamma_tris.h" -#include "gamma_vb.h" - - -/* !! Should template this eventually !! */ - -static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLfloat (*coord)[4]; - GLuint coord_stride; - GLfloat (*col)[4]; - GLuint col_stride; - int i; - GLuint tc0_stride = 0; - GLfloat (*tc0)[4] = 0; - GLuint tc0_size = 0; - - col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; - col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; - - if (ctx->Texture.Unit[0]._ReallyEnabled) { - tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0]->stride; - tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0]->data; - tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0]->size; - coord = VB->ClipPtr->data; - coord_stride = VB->ClipPtr->stride; - } else { - coord = VB->NdcPtr->data; - coord_stride = VB->NdcPtr->stride; - } - - if (ctx->Texture.Unit[0]._ReallyEnabled && tc0_size == 4) { - for (i=start; i < end; i++) { - CHECK_DMA_BUFFER(gmesa, 9); - WRITEF(gmesa->buf, Tq4, tc0[i][3]); - WRITEF(gmesa->buf, Tr4, tc0[i][2]); - WRITEF(gmesa->buf, Tt4, tc0[i][0]); - WRITEF(gmesa->buf, Ts4, tc0[i][1]); - WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); - WRITEF(gmesa->buf, Vw, coord[i][3]); - WRITEF(gmesa->buf, Vz, coord[i][2]); - WRITEF(gmesa->buf, Vy, coord[i][1]); - WRITEF(gmesa->buf, Vx4, coord[i][0]); - } - } else if (ctx->Texture.Unit[0]._ReallyEnabled && tc0_size == 2) { - for (i=start; i < end; i++) { - CHECK_DMA_BUFFER(gmesa, 7); - WRITEF(gmesa->buf, Tt2, tc0[i][0]); - WRITEF(gmesa->buf, Ts2, tc0[i][1]); - WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); - WRITEF(gmesa->buf, Vw, coord[i][3]); - WRITEF(gmesa->buf, Vz, coord[i][2]); - WRITEF(gmesa->buf, Vy, coord[i][1]); - WRITEF(gmesa->buf, Vx4, coord[i][0]); - } - } else { - for (i=start; i < end; i++) { - CHECK_DMA_BUFFER(gmesa, 4); - WRITE(gmesa->buf, PackedColor4, *(uint32_t*)col[i]); - WRITEF(gmesa->buf, Vz, coord[i][2]); - WRITEF(gmesa->buf, Vy, coord[i][1]); - WRITEF(gmesa->buf, Vx3, coord[i][0]); - } - } -} - -#define HAVE_POINTS 1 -#define HAVE_LINES 1 -#define HAVE_LINE_STRIPS 1 -#define HAVE_TRIANGLES 1 -#define HAVE_TRI_STRIPS 1 -#define HAVE_TRI_STRIP_1 0 -#define HAVE_TRI_FANS 1 -#define HAVE_QUADS 1 -#define HAVE_QUAD_STRIPS 1 -#define HAVE_POLYGONS 1 - -#define HAVE_ELTS 0 - - -static const GLuint hw_prim[GL_POLYGON+1] = { - B_PrimType_Points, - B_PrimType_Lines, - B_PrimType_LineLoop, - B_PrimType_LineStrip, - B_PrimType_Triangles, - B_PrimType_TriangleStrip, - B_PrimType_TriangleFan, - B_PrimType_Quads, - B_PrimType_QuadStrip, - B_PrimType_Polygon -}; - -static INLINE void gammaStartPrimitive( gammaContextPtr gmesa, GLenum prim ) -{ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Begin, gmesa->Begin | hw_prim[prim]); -} - -static INLINE void gammaEndPrimitive( gammaContextPtr gmesa ) -{ - GLcontext *ctx = gmesa->glCtx; - - if ( ctx->Line.SmoothFlag || - ctx->Polygon.SmoothFlag || - ctx->Point.SmoothFlag ) { - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, FlushSpan, 0); - } - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, End, 0); -} - -#define LOCAL_VARS gammaContextPtr gmesa = GAMMA_CONTEXT(ctx) -#define INIT( prim ) gammaStartPrimitive( gmesa, prim ) -#define FLUSH() gammaEndPrimitive( gmesa ) -#define GET_CURRENT_VB_MAX_VERTS() \ - (gmesa->bufSize - gmesa->bufCount) / 2 -#define GET_SUBSEQUENT_VB_MAX_VERTS() \ - GAMMA_DMA_BUFFER_SIZE / 2 - -#define ALLOC_VERTS( nr ) (void *)0 /* todo: explicit alloc */ -#define EMIT_VERTS( ctx, j, nr, buf ) (gamma_emit(ctx, j, (j)+(nr)), (void *)0) - -#define TAG(x) gamma_##x -#include "tnl_dd/t_dd_dmatmp.h" - - -/**********************************************************************/ -/* Render pipeline stage */ -/**********************************************************************/ - - -static GLboolean gamma_run_render( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint i; - tnl_render_func *tab; - - /* GH: THIS IS A HACK!!! */ - if (VB->ClipOrMask || gmesa->RenderIndex != 0) - return GL_TRUE; /* don't handle clipping here */ - - /* We don't do elts */ - if (VB->Elts || !gamma_validate_render( ctx, VB )) - return GL_TRUE; - - tab = TAG(render_tab_verts); - - tnl->Driver.Render.Start( ctx ); - - for (i = 0 ; i < VB->PrimitiveCount ; i++) - { - GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); - GLuint start = VB->Primitive[i].start; - GLuint length = VB->Primitive[i].count; - - if (!length) - continue; - - tab[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim); - } - - tnl->Driver.Render.Finish( ctx ); - - return GL_FALSE; /* finished the pipe */ -} - - -const struct tnl_pipeline_stage _gamma_render_stage = -{ - "gamma render", - NULL, - NULL, - NULL, - NULL, - gamma_run_render /* run */ -}; diff --git a/src/mesa/drivers/dri/gamma/gamma_screen.c b/src/mesa/drivers/dri/gamma/gamma_screen.c deleted file mode 100644 index 47862f1d77..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_screen.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - */ - -#include "gamma_context.h" -#include "gamma_vb.h" -#include "glint_dri.h" - -#include "main/imports.h" - -gammaScreenPtr gammaCreateScreen( __DRIscreen *sPriv ) -{ - gammaScreenPtr gammaScreen; - GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)sPriv->pDevPriv; - int i; - - if (sPriv->devPrivSize != sizeof(GLINTDRIRec)) { - fprintf(stderr,"\nERROR! sizeof(GLINTDRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - -#if 0 - /* Check the DRI externsion version */ - if ( sPriv->driMajor != 3 || sPriv->driMinor != 1 ) { - __driUtilMessage( "Gamma DRI driver expected DRI version 4.0.x " - "but got version %d.%d.%d", - sPriv->driMajor, sPriv->driMinor, sPriv->driPatch ); - return NULL; - } - - /* Check that the DDX driver version is compatible */ - if ( sPriv->ddxMajor != 4 || - sPriv->ddxMinor != 0 || - sPriv->ddxPatch < 0 ) { - __driUtilMessage( "r128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch ); - return GL_FALSE; - } - - /* Check that the DRM driver version is compatible */ - if ( sPriv->drmMajor != 2 || - sPriv->drmMinor != 1 || - sPriv->drmPatch < 0 ) { - __driUtilMessage( "r128 DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch ); - return GL_FALSE; - } -#endif - - /* Allocate the private area */ - gammaScreen = (gammaScreenPtr) CALLOC( sizeof(*gammaScreen) ); - if ( !gammaScreen ) return NULL; - - gammaScreen->regionCount = 4; /* Magic number. Can we fix this? */ - - gammaScreen->regions = CALLOC(gammaScreen->regionCount * - sizeof(gammaRegion)); - - gammaScreen->regions[0].handle = gDRIPriv->registers0.handle; - gammaScreen->regions[0].size = gDRIPriv->registers0.size; - gammaScreen->regions[1].handle = gDRIPriv->registers1.handle; - gammaScreen->regions[1].size = gDRIPriv->registers1.size; - gammaScreen->regions[2].handle = gDRIPriv->registers2.handle; - gammaScreen->regions[2].size = gDRIPriv->registers2.size; - gammaScreen->regions[3].handle = gDRIPriv->registers3.handle; - gammaScreen->regions[3].size = gDRIPriv->registers3.size; - - /* Next, map all the regions */ - for (i = 0; i < gammaScreen->regionCount; i++) { - if (drmMap(sPriv->fd, - gammaScreen->regions[i].handle, - gammaScreen->regions[i].size, - &gammaScreen->regions[i].map)) { - while (--i > 0) { - (void)drmUnmap(gammaScreen->regions[i].map, - gammaScreen->regions[i].size); - } - return GL_FALSE; - } - } - - /* Get the list of dma buffers */ - gammaScreen->bufs = drmMapBufs(sPriv->fd); - - if (!gammaScreen->bufs) { - while (gammaScreen->regionCount > 0) { - (void)drmUnmap(gammaScreen->regions[gammaScreen->regionCount].map, - gammaScreen->regions[gammaScreen->regionCount].size); - gammaScreen->regionCount--; - } - return GL_FALSE; - } - - gammaScreen->textureSize = gDRIPriv->textureSize; - gammaScreen->logTextureGranularity = gDRIPriv->logTextureGranularity; - gammaScreen->cpp = gDRIPriv->cpp; - gammaScreen->frontOffset = gDRIPriv->frontOffset; - gammaScreen->frontPitch = gDRIPriv->frontPitch; - gammaScreen->backOffset = gDRIPriv->backOffset; - gammaScreen->backPitch = gDRIPriv->backPitch; - gammaScreen->backX = gDRIPriv->backX; - gammaScreen->backY = gDRIPriv->backY; - gammaScreen->depthOffset = gDRIPriv->depthOffset; - gammaScreen->depthPitch = gDRIPriv->depthPitch; - - gammaScreen->driScreen = sPriv; - - return gammaScreen; -} - -/* Destroy the device specific screen private data struct. - */ -void gammaDestroyScreen( __DRIscreen *sPriv ) -{ - gammaScreenPtr gammaScreen = (gammaScreenPtr)sPriv->private; - - /* First, unmap the dma buffers */ - drmUnmapBufs( gammaScreen->bufs ); - - /* Next, unmap all the regions */ - while (gammaScreen->regionCount > 0) { - (void)drmUnmap(gammaScreen->regions[gammaScreen->regionCount].map, - gammaScreen->regions[gammaScreen->regionCount].size); - gammaScreen->regionCount--; - } - FREE(gammaScreen->regions); - FREE(gammaScreen); -} diff --git a/src/mesa/drivers/dri/gamma/gamma_screen.h b/src/mesa/drivers/dri/gamma/gamma_screen.h deleted file mode 100644 index c716ea89c2..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_screen.h +++ /dev/null @@ -1,30 +0,0 @@ -typedef struct _gammaRegion { - drm_handle_t handle; - drmSize size; - drmAddress map; -} gammaRegion, *gammaRegionPtr; - -typedef struct { - - int regionCount; /* Count of register regions */ - gammaRegion *regions; /* Vector of mapped region info */ - - drmBufMapPtr bufs; /* Map of DMA buffers */ - - __DRIscreen *driScreen; /* Back pointer to DRI screen */ - - int cpp; - int frontPitch; - int frontOffset; - - int backPitch; - int backOffset; - int backX; - int backY; - - int depthOffset; - int depthPitch; - - int textureSize; - int logTextureGranularity; -} gammaScreenRec, *gammaScreenPtr; diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c deleted file mode 100644 index 00160f760b..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_span.c +++ /dev/null @@ -1,315 +0,0 @@ - -#include "gamma_context.h" -#include "gamma_lock.h" -#include "gamma_macros.h" -#include "main/colormac.h" - -#include "swrast/swrast.h" - -#define DBG 0 - -#define LOCAL_VARS \ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \ - gammaScreenPtr gammascrn = gmesa->gammaScreen; \ - __DRIscreen *sPriv = gmesa->driScreen; \ - __DRIdrawable *dPriv = gmesa->driDrawable; \ - GLuint pitch = sPriv->fbWidth * gammascrn->cpp; \ - GLuint height = dPriv->h; \ - char *buf = (char *)(sPriv->pFB + \ - gmesa->drawOffset + \ - (dPriv->x * gammascrn->cpp) + \ - (dPriv->y * pitch)); \ - GLuint p; \ - (void) buf; (void) p - -/* FIXME! Depth/Stencil read/writes don't work ! */ -#define LOCAL_DEPTH_VARS \ - gammaScreenPtr gammascrn = gmesa->gammaScreen; \ - __DRIdrawable *dPriv = gmesa->driDrawable; \ - __DRIscreen *sPriv = gmesa->driScreen; \ - GLuint pitch = gammascrn->depthPitch; \ - GLuint height = dPriv->h; \ - char *buf = (char *)(sPriv->pFB + \ - gammascrn->depthOffset + \ - dPriv->x * gammascrn->cpp + \ - dPriv->y * pitch) - -#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS - -#define Y_FLIP( _y ) (height - _y - 1) - -#define HW_LOCK() \ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \ - FLUSH_DMA_BUFFER(gmesa); \ - gammaGetLock( gmesa, DRM_LOCK_FLUSH | DRM_LOCK_QUIESCENT ); \ - GAMMAHW_LOCK( gmesa ); - -#define HW_UNLOCK() GAMMAHW_UNLOCK( gmesa ) - - - -/* ================================================================ - * Color buffer - */ - -/* 16 bit, RGB565 color spanline and pixel functions - */ -#define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_565( color[0], color[1], color[2] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 8) | \ - (((int)g & 0xfc) << 3) | \ - (((int)b & 0xf8) >> 3)) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \ - rgba[0] = (p >> 8) & 0xf8; \ - rgba[1] = (p >> 3) & 0xfc; \ - rgba[2] = (p << 3) & 0xf8; \ - rgba[3] = 0xff; \ - if ( rgba[0] & 0x08 ) rgba[0] |= 0x07; \ - if ( rgba[1] & 0x04 ) rgba[1] |= 0x03; \ - if ( rgba[2] & 0x08 ) rgba[2] |= 0x07; \ - } while (0) - -#define TAG(x) gamma##x##_RGB565 -#include "spantmp.h" - - -/* 32 bit, ARGB8888 color spanline and pixel functions - */ - -#undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \ - (g << 8) | \ - (r << 16) | \ - (a << 24) ) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ -do { \ - GLuint p = *(GLuint *)(buf + _x*4 + _y*pitch); \ - rgba[0] = (p >> 16) & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = (p >> 24) & 0xff; \ -} while (0) - -#define TAG(x) gamma##x##_ARGB8888 -#include "spantmp.h" - - -/* 16 bit depthbuffer functions. - */ -#define VALUE_TYPE GLushort - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLushort *)(buf + (_x)*2 + (_y)*pitch) = d; - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch); - -#define TAG(x) gamma##x##_16 -#include "depthtmp.h" - - -#if 0 /* Unused */ -/* 32 bit depthbuffer functions. - */ -#define VALUE_TYPE GLuint - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = d; - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); - -#define TAG(x) gamma##x##_32 -#include "depthtmp.h" -#endif - - -/* 24/8 bit interleaved depth/stencil functions - */ -#define VALUE_TYPE GLuint - -#define WRITE_DEPTH( _x, _y, d ) { \ - GLuint tmp = *(GLuint *)(buf + (_x)*4 + (_y)*pitch); \ - tmp &= 0xff; \ - tmp |= (d) & 0xffffff00; \ - *(GLuint *)(buf + (_x)*4 + (_y)*pitch) = tmp; \ -} - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint *)(buf + (_x)*4 + (_y)*pitch) & ~0xff; - - -#define TAG(x) gamma##x##_24_8 -#include "depthtmp.h" - -#if 0 -#define WRITE_STENCIL( _x, _y, d ) { \ - GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \ - tmp &= 0xffffff00; \ - tmp |= d & 0xff; \ - *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \ -} - -#define READ_STENCIL( d, _x, _y ) \ - d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xff; - -#define TAG(x) gamma##x##_24_8 -#include "stenciltmp.h" - -static void gammaReadRGBASpan8888( const GLcontext *ctx, - GLuint n, GLint x, GLint y, - GLubyte rgba[][4]) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - gammaScreenPtr gammascrn = gmesa->gammaScreen; - uint32_t dwords1, dwords2, i = 0; - char *src = (char *)rgba[0]; - GLuint read = n * gammascrn->cpp; /* Number of bytes we are expecting */ - uint32_t data; - - FLUSH_DMA_BUFFER(gmesa); - CHECK_DMA_BUFFER(gmesa, 16); - WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode & ~(LBReadSrcEnable | LBReadDstEnable)); - WRITE(gmesa->buf, ColorDDAMode, ColorDDAEnable); - WRITE(gmesa->buf, LBWriteMode, LBWriteModeDisable); - WRITE(gmesa->buf, FBReadMode, (gmesa->FBReadMode & ~FBReadSrcEnable) | FBReadDstEnable | FBDataTypeColor); - WRITE(gmesa->buf, FilterMode, 0x200); /* Pass FBColorData */ - WRITE(gmesa->buf, FBWriteMode, FBW_UploadColorData | FBWriteModeDisable); - WRITE(gmesa->buf, StartXSub, (x+n)<<16); - WRITE(gmesa->buf, StartXDom, x<<16); - WRITE(gmesa->buf, StartY, y<<16); - WRITE(gmesa->buf, GLINTCount, 1); - WRITE(gmesa->buf, dXDom, 0<<16); - WRITE(gmesa->buf, dXSub, 0<<16); - WRITE(gmesa->buf, dY, 1<<16); - WRITE(gmesa->buf, Render, PrimitiveTrapezoid); - FLUSH_DMA_BUFFER(gmesa); - -moredata: - - dwords1 = *(volatile uint32_t*)(void *)(((uint8_t*)gammascrn->regions[0].map) + (GlintOutFIFOWords)); - dwords2 = *(volatile uint32_t*)(void *)(((uint8_t*)gammascrn->regions[2].map) + (GlintOutFIFOWords)); - - if (dwords1) { - memcpy(src, (char*)gammascrn->regions[1].map + 0x1000, dwords1 << 2); - src += dwords1 << 2; - read -= dwords1 << 2; - } - if (dwords2) { - memcpy(src, (char*)gammascrn->regions[3].map + 0x1000, dwords2 << 2); - src += dwords2 << 2; - read -= dwords2 << 2; - } - - if (read) - goto moredata; - -done: - - CHECK_DMA_BUFFER(gmesa, 6); - WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode); - WRITE(gmesa->buf, LBWriteMode, LBWriteModeEnable); - WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode); - WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode); - WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable); - WRITE(gmesa->buf, FilterMode, 0x400); -} -#endif - -static void gammaSetBuffer( GLcontext *ctx, - GLframebuffer *colorBuffer, - GLuint bufferBit ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - switch ( bufferBit ) { - case BUFFER_BIT_FRONT_LEFT: - gmesa->readOffset = 0; - break; - case BUFFER_BIT_BACK_LEFT: - gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp; - break; - default: - _mesa_problem(ctx, "Unexpected buffer 0x%x in gammaSetBuffer()", bufferBit); - } -} - - -void gammaDDInitSpanFuncs( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx); - - swdd->SetBuffer = gammaSetBuffer; - - switch ( gmesa->gammaScreen->cpp ) { - case 2: - swdd->WriteRGBASpan = gammaWriteRGBASpan_RGB565; - swdd->WriteRGBSpan = gammaWriteRGBSpan_RGB565; - swdd->WriteMonoRGBASpan = gammaWriteMonoRGBASpan_RGB565; - swdd->WriteRGBAPixels = gammaWriteRGBAPixels_RGB565; - swdd->WriteMonoRGBAPixels = gammaWriteMonoRGBAPixels_RGB565; - swdd->ReadRGBASpan = gammaReadRGBASpan_RGB565; - swdd->ReadRGBAPixels = gammaReadRGBAPixels_RGB565; - break; - - case 4: - swdd->WriteRGBASpan = gammaWriteRGBASpan_ARGB8888; - swdd->WriteRGBSpan = gammaWriteRGBSpan_ARGB8888; - swdd->WriteMonoRGBASpan = gammaWriteMonoRGBASpan_ARGB8888; - swdd->WriteRGBAPixels = gammaWriteRGBAPixels_ARGB8888; - swdd->WriteMonoRGBAPixels = gammaWriteMonoRGBAPixels_ARGB8888; -#if 1 - swdd->ReadRGBASpan = gammaReadRGBASpan_ARGB8888; -#else - swdd->ReadRGBASpan = gammaReadRGBASpan8888; -#endif - swdd->ReadRGBAPixels = gammaReadRGBAPixels_ARGB8888; - break; - - default: - break; - } - - switch ( gmesa->glCtx->Visual.depthBits ) { - case 16: - swdd->ReadDepthSpan = gammaReadDepthSpan_16; - swdd->WriteDepthSpan = gammaWriteDepthSpan_16; - swdd->ReadDepthPixels = gammaReadDepthPixels_16; - swdd->WriteDepthPixels = gammaWriteDepthPixels_16; - break; - - case 24: - swdd->ReadDepthSpan = gammaReadDepthSpan_24_8; - swdd->WriteDepthSpan = gammaWriteDepthSpan_24_8; - swdd->ReadDepthPixels = gammaReadDepthPixels_24_8; - swdd->WriteDepthPixels = gammaWriteDepthPixels_24_8; - -#if 0 - swdd->ReadStencilSpan = gammaReadStencilSpan_24_8; - swdd->WriteStencilSpan = gammaWriteStencilSpan_24_8; - swdd->ReadStencilPixels = gammaReadStencilPixels_24_8; - swdd->WriteStencilPixels = gammaWriteStencilPixels_24_8; -#endif - break; - - default: - break; - } -} diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c deleted file mode 100644 index c628457fba..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_state.c +++ /dev/null @@ -1,1721 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * 3DLabs Gamma driver - */ - -#include "gamma_context.h" -#include "gamma_macros.h" -#include "main/macros.h" -#include "glint_dri.h" -#include "main/colormac.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" -#include "tnl/tnl.h" - -#define ENABLELIGHTING 0 - -/* ============================================================= - * Alpha blending - */ - -static void gammaUpdateAlphaMode( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t a = gmesa->AlphaTestMode; - uint32_t b = gmesa->AlphaBlendMode; - uint32_t f = gmesa->AB_FBReadMode_Save = 0; - GLubyte refByte = (GLint) (ctx->Color.AlphaRef * 255.0); - - a &= ~(AT_CompareMask | AT_RefValueMask); - b &= ~(AB_SrcBlendMask | AB_DstBlendMask); - - a |= refByte << 4; - - switch ( ctx->Color.AlphaFunc ) { - case GL_NEVER: - a |= AT_Never; - break; - case GL_LESS: - a |= AT_Less; - break; - case GL_EQUAL: - a |= AT_Equal; - break; - case GL_LEQUAL: - a |= AT_LessEqual; - break; - case GL_GEQUAL: - a |= AT_GreaterEqual; - break; - case GL_GREATER: - a |= AT_Greater; - break; - case GL_NOTEQUAL: - a |= AT_NotEqual; - break; - case GL_ALWAYS: - a |= AT_Always; - break; - } - - if ( ctx->Color.AlphaEnabled ) { - f |= FBReadDstEnable; - a |= AlphaTestModeEnable; - } else { - a &= ~AlphaTestModeEnable; - } - - switch ( ctx->Color.BlendSrcRGB ) { - case GL_ZERO: - b |= AB_Src_Zero; - break; - case GL_ONE: - b |= AB_Src_One; - break; - case GL_DST_COLOR: - b |= AB_Src_DstColor; - break; - case GL_ONE_MINUS_DST_COLOR: - b |= AB_Src_OneMinusDstColor; - break; - case GL_SRC_ALPHA: - b |= AB_Src_SrcAlpha; - break; - case GL_ONE_MINUS_SRC_ALPHA: - b |= AB_Src_OneMinusSrcAlpha; - break; - case GL_DST_ALPHA: - b |= AB_Src_DstAlpha; - f |= FBReadSrcEnable; - break; - case GL_ONE_MINUS_DST_ALPHA: - b |= AB_Src_OneMinusDstAlpha; - f |= FBReadSrcEnable; - break; - case GL_SRC_ALPHA_SATURATE: - b |= AB_Src_SrcAlphaSaturate; - break; - } - - switch ( ctx->Color.BlendDstRGB ) { - case GL_ZERO: - b |= AB_Dst_Zero; - break; - case GL_ONE: - b |= AB_Dst_One; - break; - case GL_SRC_COLOR: - b |= AB_Dst_SrcColor; - break; - case GL_ONE_MINUS_SRC_COLOR: - b |= AB_Dst_OneMinusSrcColor; - break; - case GL_SRC_ALPHA: - b |= AB_Dst_SrcAlpha; - break; - case GL_ONE_MINUS_SRC_ALPHA: - b |= AB_Dst_OneMinusSrcAlpha; - break; - case GL_DST_ALPHA: - b |= AB_Dst_DstAlpha; - f |= FBReadSrcEnable; - break; - case GL_ONE_MINUS_DST_ALPHA: - b |= AB_Dst_OneMinusDstAlpha; - f |= FBReadSrcEnable; - break; - } - - if ( ctx->Color.BlendEnabled ) { - f |= FBReadDstEnable; - b |= AlphaBlendModeEnable; - } else { - b &= ~AlphaBlendModeEnable; - } - - if ( gmesa->AlphaTestMode != a ) { - gmesa->AlphaTestMode = a; - gmesa->dirty |= GAMMA_UPLOAD_ALPHA; - } - if ( gmesa->AlphaBlendMode != b) { - gmesa->AlphaBlendMode = b; - gmesa->dirty |= GAMMA_UPLOAD_BLEND; - } - gmesa->AB_FBReadMode_Save = f; -} - -static void gammaDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - (void) ref; - - FLUSH_BATCH( gmesa ); - - gmesa->new_state |= GAMMA_NEW_ALPHA; -} - -static void gammaDDBlendEquationSeparate( GLcontext *ctx, - GLenum modeRGB, GLenum modeA ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - assert( modeRGB == modeA ); - FLUSH_BATCH( gmesa ); - - gmesa->new_state |= GAMMA_NEW_ALPHA; -} - -static void gammaDDBlendFuncSeparate( GLcontext *ctx, - GLenum sfactorRGB, GLenum dfactorRGB, - GLenum sfactorA, GLenum dfactorA ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - - gmesa->new_state |= GAMMA_NEW_ALPHA; -} - - -/* ================================================================ - * Buffer clear - */ - -static void gammaDDClear( GLcontext *ctx, GLbitfield mask ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)gmesa->driScreen->pDevPriv; - GLuint temp = 0; - - FLUSH_BATCH( gmesa ); - - /* Update and emit any new state. We need to do this here to catch - * changes to the masks. - * FIXME: Just update the masks? - */ - if ( gmesa->new_state ) - gammaDDUpdateHWState( ctx ); - -#ifdef DO_VALIDATE - /* Flush any partially filled buffers */ - FLUSH_DMA_BUFFER(gmesa); - - DRM_SPINLOCK(&gmesa->driScreen->pSAREA->drawable_lock, - gmesa->driScreen->drawLockID); - VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa); -#endif - - if (mask & BUFFER_BIT_DEPTH) { - /* Turn off writes the FB */ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, FBWriteMode, FBWriteModeDisable); - - mask &= ~BUFFER_BIT_DEPTH; - - /* - * Turn Rectangle2DControl off when the window is not clipped - * (i.e., the GID tests are not necessary). This dramatically - * increases the performance of the depth clears. - */ - if (!gmesa->NotClipped) { - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Rectangle2DControl, 1); - } - - temp = (gmesa->LBReadMode & LBPartialProdMask) | LBWindowOriginBot; - if (gDRIPriv->numMultiDevices == 2) temp |= LBScanLineInt2; - - CHECK_DMA_BUFFER(gmesa, 5); - WRITE(gmesa->buf, LBReadMode, temp); - WRITE(gmesa->buf, DeltaMode, DM_DepthEnable); - WRITE(gmesa->buf, DepthMode, (DepthModeEnable | - DM_Always | - DM_SourceDepthRegister | - DM_WriteMask)); - WRITE(gmesa->buf, GLINTDepth, gmesa->ClearDepth); - - /* Increment the frame count */ - gmesa->FrameCount++; -#ifdef FAST_CLEAR_4 - gmesa->FrameCount &= 0x0f; -#else - gmesa->FrameCount &= 0xff; -#endif - - /* Force FCP to be written */ - WRITE(gmesa->buf, GLINTWindow, (WindowEnable | - W_PassIfEqual | - (gmesa->Window & W_GIDMask) | - W_DepthFCP | - W_LBUpdateFromRegisters | - W_OverrideWriteFiltering | - (gmesa->FrameCount << 9))); - - /* Clear part of the depth and FCP buffers */ - { - int y = gmesa->driScreen->fbHeight - gmesa->driDrawable->y - gmesa->driDrawable->h; - int x = gmesa->driDrawable->x; - int w = gmesa->driDrawable->w; - int h = gmesa->driDrawable->h; -#ifndef TURN_OFF_FCP - float hsub = h; - - if (gmesa->WindowChanged) { - gmesa->WindowChanged = GL_FALSE; - } else { -#ifdef FAST_CLEAR_4 - hsub /= 16; -#else - hsub /= 256; -#endif - - /* Handle the case where the height < # of FCPs */ - if (hsub < 1.0) { - if (gmesa->FrameCount > h) - gmesa->FrameCount = 0; - h = 1; - y += gmesa->FrameCount; - } else { - h = (gmesa->FrameCount+1)*hsub; - h -= (int)(gmesa->FrameCount*hsub); - y += gmesa->FrameCount*hsub; - } - } -#endif - if (h && w) { -#if 0 - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, Rectangle2DMode, ((h & 0xfff)<<12) | - (w & 0xfff) ); - WRITE(gmesa->buf, DrawRectangle2D, ((y & 0xffff)<<16) | - (x & 0xffff) ); -#else - CHECK_DMA_BUFFER(gmesa, 8); - WRITE(gmesa->buf, StartXDom, x<<16); - WRITE(gmesa->buf, StartY, y<<16); - WRITE(gmesa->buf, StartXSub, (x+w)<<16); - WRITE(gmesa->buf, GLINTCount, h); - WRITE(gmesa->buf, dY, 1<<16); - WRITE(gmesa->buf, dXDom, 0<<16); - WRITE(gmesa->buf, dXSub, 0<<16); - WRITE(gmesa->buf, Render, 0x00000040); /* NOT_DONE */ -#endif - } - } - - CHECK_DMA_BUFFER(gmesa, 6); - WRITE(gmesa->buf, DepthMode, gmesa->DepthMode); - WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode); - WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode); - WRITE(gmesa->buf, GLINTWindow, gmesa->Window); - WRITE(gmesa->buf, FastClearDepth, gmesa->ClearDepth); - WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable); - - /* Turn on Depth FCP */ - if (gmesa->Window & W_DepthFCP) { - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, WindowOr, (gmesa->FrameCount << 9)); - } - - /* Turn off GID clipping if window is not clipped */ - if (gmesa->NotClipped) { - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Rectangle2DControl, 0); - } - } - - if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)) { - int y = gmesa->driScreen->fbHeight - gmesa->driDrawable->y - gmesa->driDrawable->h; - int x = gmesa->driDrawable->x; - int w = gmesa->driDrawable->w; - int h = gmesa->driDrawable->h; - - mask &= ~(BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT); - - if (x < 0) { w -= -x; x = 0; } - - /* Turn on GID clipping if window is clipped */ - if (!gmesa->NotClipped) { - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Rectangle2DControl, 1); - } - - CHECK_DMA_BUFFER(gmesa, 18); - WRITE(gmesa->buf, FBBlockColor, gmesa->ClearColor); - WRITE(gmesa->buf, ColorDDAMode, ColorDDADisable); - WRITE(gmesa->buf, FBWriteMode, FBWriteModeEnable); - WRITE(gmesa->buf, DepthMode, 0); - WRITE(gmesa->buf, DeltaMode, 0); - WRITE(gmesa->buf, AlphaBlendMode, 0); -#if 1 - WRITE(gmesa->buf, dY, 1<<16); - WRITE(gmesa->buf, dXDom, 0<<16); - WRITE(gmesa->buf, dXSub, 0<<16); - WRITE(gmesa->buf, StartXSub, (x+w)<<16); - WRITE(gmesa->buf, GLINTCount, h); - WRITE(gmesa->buf, StartXDom, x<<16); - WRITE(gmesa->buf, StartY, y<<16); - WRITE(gmesa->buf, Render, 0x00000048); /* NOT_DONE */ -#else - WRITE(gmesa->buf, Rectangle2DMode, (((h & 0xfff)<<12) | - (w & 0xfff))); - WRITE(gmesa->buf, DrawRectangle2D, (((y & 0xffff)<<16) | - (x & 0xffff))); -#endif - WRITE(gmesa->buf, DepthMode, gmesa->DepthMode); - WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode); - WRITE(gmesa->buf, AlphaBlendMode, gmesa->AlphaBlendMode); - WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode); - - /* Turn off GID clipping if window is clipped */ - if (gmesa->NotClipped) { - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Rectangle2DControl, 0); - } - } - -#ifdef DO_VALIDATE - PROCESS_DMA_BUFFER_TOP_HALF(gmesa); - - DRM_SPINUNLOCK(&gmesa->driScreen->pSAREA->drawable_lock, - gmesa->driScreen->drawLockID); - VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa); - - PROCESS_DMA_BUFFER_BOTTOM_HALF(gmesa); -#endif - - if ( mask ) - _swrast_Clear( ctx, mask ); -} - -/* ============================================================= - * Depth testing - */ - -static void gammaUpdateZMode( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t z = gmesa->DepthMode; - uint32_t delta = gmesa->DeltaMode; - uint32_t window = gmesa->Window; - uint32_t lbread = gmesa->LBReadMode; - - z &= ~DM_CompareMask; - - switch ( ctx->Depth.Func ) { - case GL_NEVER: - z |= DM_Never; - break; - case GL_ALWAYS: - z |= DM_Always; - break; - case GL_LESS: - z |= DM_Less; - break; - case GL_LEQUAL: - z |= DM_LessEqual; - break; - case GL_EQUAL: - z |= DM_Equal; - break; - case GL_GEQUAL: - z |= DM_GreaterEqual; - break; - case GL_GREATER: - z |= DM_Greater; - break; - case GL_NOTEQUAL: - z |= DM_NotEqual; - break; - } - - if ( ctx->Depth.Test ) { - z |= DepthModeEnable; - delta |= DM_DepthEnable; - window |= W_DepthFCP; - lbread |= LBReadDstEnable; - } else { - z &= ~DepthModeEnable; - delta &= ~DM_DepthEnable; - window &= ~W_DepthFCP; - lbread &= ~LBReadDstEnable; - } - - if ( ctx->Depth.Mask ) { - z |= DM_WriteMask; - } else { - z &= ~DM_WriteMask; - } - -#if 0 - if ( gmesa->DepthMode != z ){ -#endif - gmesa->DepthMode = z; - gmesa->DeltaMode = delta; - gmesa->Window = window; - gmesa->LBReadMode = lbread; - gmesa->dirty |= GAMMA_UPLOAD_DEPTH; -#if 0 - } -#endif -} - -static void gammaDDDepthFunc( GLcontext *ctx, GLenum func ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_DEPTH; -} - -static void gammaDDDepthMask( GLcontext *ctx, GLboolean flag ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_DEPTH; -} - -static void gammaDDClearDepth( GLcontext *ctx, GLclampd d ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - switch ( gmesa->DepthSize ) { - case 16: - gmesa->ClearDepth = d * 0x0000ffff; - break; - case 24: - gmesa->ClearDepth = d * 0x00ffffff; - break; - case 32: - gmesa->ClearDepth = d * 0xffffffff; - break; - } -} - -static void gammaDDFinish( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_DMA_BUFFER(gmesa); -} - -static void gammaDDFlush( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_DMA_BUFFER(gmesa); -} - -/* ============================================================= - * Fog - */ - -static void gammaUpdateFogAttrib( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t f = gmesa->FogMode; - uint32_t g = gmesa->GeometryMode; - uint32_t d = gmesa->DeltaMode; - - if (ctx->Fog.Enabled) { - f |= FogModeEnable; - g |= GM_FogEnable; - d |= DM_FogEnable; - } else { - f &= ~FogModeEnable; - g &= ~GM_FogEnable; - d &= ~DM_FogEnable; - } - - g &= ~GM_FogMask; - - switch (ctx->Fog.Mode) { - case GL_LINEAR: - g |= GM_FogLinear; - break; - case GL_EXP: - g |= GM_FogExp; - break; - case GL_EXP2: - g |= GM_FogExpSquared; - break; - } - - if ( gmesa->FogMode != f ) { - gmesa->FogMode = f; - gmesa->dirty |= GAMMA_UPLOAD_FOG; - } - - if ( gmesa->GeometryMode != g ) { - gmesa->GeometryMode = g; - gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY; - } - - if ( gmesa->DeltaMode != d ) { - gmesa->DeltaMode = d; - gmesa->dirty |= GAMMA_UPLOAD_DEPTH; - } -} - -#if 0 -static void gammaDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_FOG; -} -#endif - -/* ============================================================= - * Lines - */ -static void gammaDDLineWidth( GLcontext *ctx, GLfloat width ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - CHECK_DMA_BUFFER(gmesa, 3); - WRITE(gmesa->buf, LineWidth, (GLuint)width); - WRITEF(gmesa->buf, AAlineWidth, width); - WRITE(gmesa->buf, LineWidthOffset, (GLuint)(width-1)/2); -} - -static void gammaDDLineStipple( GLcontext *ctx, GLint factor, GLushort pattern ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - gmesa->LineMode &= ~(LM_StippleMask | LM_RepeatFactorMask); - gmesa->LineMode |= ((GLuint)(factor - 1) << 1) | ((GLuint)pattern << 10); - - gmesa->dirty |= GAMMA_UPLOAD_LINEMODE; -} - - - -/* ============================================================= - * Points - */ -static void gammaDDPointSize( GLcontext *ctx, GLfloat size ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, PointSize, (GLuint)size); - WRITEF(gmesa->buf, AApointSize, size); -} - -/* ============================================================= - * Polygon - */ - -static void gammaUpdatePolygon( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t g = gmesa->GeometryMode; - - g &= ~(GM_PolyOffsetFillEnable | GM_PolyOffsetPointEnable | - GM_PolyOffsetLineEnable); - - if (ctx->Polygon.OffsetFill) g |= GM_PolyOffsetFillEnable; - if (ctx->Polygon.OffsetPoint) g |= GM_PolyOffsetPointEnable; - if (ctx->Polygon.OffsetLine) g |= GM_PolyOffsetLineEnable; - - g &= ~GM_FB_PolyMask; - - switch (ctx->Polygon.FrontMode) { - case GL_FILL: - g |= GM_FrontPolyFill; - break; - case GL_LINE: - g |= GM_FrontPolyLine; - break; - case GL_POINT: - g |= GM_FrontPolyPoint; - break; - } - - switch (ctx->Polygon.BackMode) { - case GL_FILL: - g |= GM_BackPolyFill; - break; - case GL_LINE: - g |= GM_BackPolyLine; - break; - case GL_POINT: - g |= GM_BackPolyPoint; - break; - } - - if ( gmesa->GeometryMode != g ) { - gmesa->GeometryMode = g; - gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY; - } - - gmesa->dirty |= GAMMA_UPLOAD_POLYGON; -} - -static void gammaDDPolygonMode( GLcontext *ctx, GLenum face, GLenum mode) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - - gmesa->new_state |= GAMMA_NEW_POLYGON; -} - -static void gammaUpdateStipple( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - - if (ctx->Polygon.StippleFlag) { - gmesa->AreaStippleMode |= AreaStippleModeEnable/* | ASM_X32 | ASM_Y32*/; - } else { - gmesa->AreaStippleMode &= ~AreaStippleModeEnable; - } - - gmesa->dirty |= GAMMA_UPLOAD_STIPPLE; -} - -static void gammaDDPolygonStipple( GLcontext *ctx, const GLubyte *mask) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_STIPPLE; -} - -/* ============================================================= - * Clipping - */ - -static void gammaUpdateClipping( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - GLint x1, y1, x2, y2; - - if ( gmesa->driDrawable ) { - x1 = gmesa->driDrawable->x + ctx->Scissor.X; - y1 = gmesa->driScreen->fbHeight - - (gmesa->driDrawable->y + - gmesa->driDrawable->h) + ctx->Scissor.Y; - x2 = x1 + ctx->Scissor.Width; - y2 = y1 + ctx->Scissor.Height; - - gmesa->ScissorMinXY = x1 | (y1 << 16); - gmesa->ScissorMaxXY = x2 | (y2 << 16); - if (ctx->Scissor.Enabled) - gmesa->ScissorMode |= UserScissorEnable; - else - gmesa->ScissorMode &= ~UserScissorEnable; - - gmesa->dirty |= GAMMA_UPLOAD_CLIP; - } -} - -static void gammaDDScissor( GLcontext *ctx, - GLint x, GLint y, GLsizei w, GLsizei h ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_CLIP; -} - -/* ============================================================= - * Culling - */ - -static void gammaUpdateCull( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t g = gmesa->GeometryMode; - - g &= ~(GM_PolyCullMask | GM_FFMask); - - if (ctx->Polygon.FrontFace == GL_CCW) { - g |= GM_FrontFaceCCW; - } else { - g |= GM_FrontFaceCW; - } - - switch ( ctx->Polygon.CullFaceMode ) { - case GL_FRONT: - g |= GM_PolyCullFront; - break; - case GL_BACK: - g |= GM_PolyCullBack; - break; - case GL_FRONT_AND_BACK: - g |= GM_PolyCullBoth; - break; - } - - if ( ctx->Polygon.CullFlag ) { - g |= GM_PolyCullEnable; - } else { - g &= ~GM_PolyCullEnable; - } - - if ( gmesa->GeometryMode != g ) { - gmesa->GeometryMode = g; - gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY; - } -} - -static void gammaDDCullFace( GLcontext *ctx, GLenum mode ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_CULL; -} - -static void gammaDDFrontFace( GLcontext *ctx, GLenum mode ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_CULL; -} - -/* ============================================================= - * Masks - */ - -static void gammaUpdateMasks( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - - GLuint mask = gammaPackColor( gmesa->gammaScreen->cpp, - ctx->Color.ColorMask[0][RCOMP], - ctx->Color.ColorMask[0][GCOMP], - ctx->Color.ColorMask[0][BCOMP], - ctx->Color.ColorMask[0][ACOMP] ); - - if (gmesa->gammaScreen->cpp == 2) mask |= mask << 16; - - if ( gmesa->FBHardwareWriteMask != mask ) { - gmesa->FBHardwareWriteMask = mask; - gmesa->dirty |= GAMMA_UPLOAD_MASKS; - } -} - -static void gammaDDColorMask( GLcontext *ctx, GLboolean r, GLboolean g, - GLboolean b, GLboolean a) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_MASKS; -} - -/* ============================================================= - * Rendering attributes - * - * We really don't want to recalculate all this every time we bind a - * texture. These things shouldn't change all that often, so it makes - * sense to break them out of the core texture state update routines. - */ - -#if ENABLELIGHTING -static void gammaDDLightfv(GLcontext *ctx, GLenum light, GLenum pname, - const GLfloat *params, GLint nParams) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - GLfloat l,x,y,z,w; - - switch(light) { - case GL_LIGHT0: - switch (pname) { - case GL_AMBIENT: - CHECK_DMA_BUFFER(gmesa, 3); - /* We don't do alpha */ - WRITEF(gmesa->buf, Light0AmbientIntensityBlue, params[2]); - WRITEF(gmesa->buf, Light0AmbientIntensityGreen, params[1]); - WRITEF(gmesa->buf, Light0AmbientIntensityRed, params[0]); - break; - case GL_DIFFUSE: - CHECK_DMA_BUFFER(gmesa, 3); - /* We don't do alpha */ - WRITEF(gmesa->buf, Light0DiffuseIntensityBlue, params[2]); - WRITEF(gmesa->buf, Light0DiffuseIntensityGreen, params[1]); - WRITEF(gmesa->buf, Light0DiffuseIntensityRed, params[0]); - break; - case GL_SPECULAR: - CHECK_DMA_BUFFER(gmesa, 3); - /* We don't do alpha */ - WRITEF(gmesa->buf, Light0SpecularIntensityBlue, params[2]); - WRITEF(gmesa->buf, Light0SpecularIntensityGreen, params[1]); - WRITEF(gmesa->buf, Light0SpecularIntensityRed, params[0]); - break; - case GL_POSITION: - /* Normalize */ - x = params[0]; y = params[1]; z = params[2]; w = params[3]; - l = sqrt(x*x + y*y + z*z + w*w); - w /= l; - x /= l; - y /= l; - z /= l; - if (params[3] != 0.0) { - gmesa->Light0Mode |= Light0ModeAttenuation; - gmesa->Light0Mode |= Light0ModeLocal; - } else { - gmesa->Light0Mode &= ~Light0ModeAttenuation; - gmesa->Light0Mode &= ~Light0ModeLocal; - } - CHECK_DMA_BUFFER(gmesa, 5); - WRITE(gmesa->buf, Light0Mode, gmesa->Light0Mode); - WRITEF(gmesa->buf, Light0PositionW, w); - WRITEF(gmesa->buf, Light0PositionZ, z); - WRITEF(gmesa->buf, Light0PositionY, y); - WRITEF(gmesa->buf, Light0PositionX, x); - break; - case GL_SPOT_DIRECTION: - CHECK_DMA_BUFFER(gmesa, 3); - /* WRITEF(gmesa->buf, Light0SpotlightDirectionW, params[3]); */ - WRITEF(gmesa->buf, Light0SpotlightDirectionZ, params[2]); - WRITEF(gmesa->buf, Light0SpotlightDirectionY, params[1]); - WRITEF(gmesa->buf, Light0SpotlightDirectionX, params[0]); - break; - case GL_SPOT_EXPONENT: - CHECK_DMA_BUFFER(gmesa, 1); - WRITEF(gmesa->buf, Light0SpotlightExponent, params[0]); - break; - case GL_SPOT_CUTOFF: - if (params[0] != 180.0) - gmesa->Light0Mode |= Light0ModeSpotLight; - else - gmesa->Light0Mode &= ~Light0ModeSpotLight; - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, Light0Mode, gmesa->Light0Mode); - WRITEF(gmesa->buf, Light0CosSpotlightCutoffAngle, cos(params[0]*DEG2RAD)); - break; - case GL_CONSTANT_ATTENUATION: - CHECK_DMA_BUFFER(gmesa, 1); - WRITEF(gmesa->buf, Light0ConstantAttenuation, params[0]); - break; - case GL_LINEAR_ATTENUATION: - CHECK_DMA_BUFFER(gmesa, 1); - WRITEF(gmesa->buf, Light0LinearAttenuation, params[0]); - break; - case GL_QUADRATIC_ATTENUATION: - CHECK_DMA_BUFFER(gmesa, 1); - WRITEF(gmesa->buf, Light0QuadraticAttenuation, params[0]); - break; - } - break; - } -} - -static void gammaDDLightModelfv( GLcontext *ctx, GLenum pname, - const GLfloat *params ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - switch (pname) { - case GL_LIGHT_MODEL_AMBIENT: - CHECK_DMA_BUFFER(gmesa, 3); - /* We don't do alpha */ - WRITEF(gmesa->buf, SceneAmbientColorBlue, params[2]); - WRITEF(gmesa->buf, SceneAmbientColorGreen, params[1]); - WRITEF(gmesa->buf, SceneAmbientColorRed, params[0]); - break; - case GL_LIGHT_MODEL_LOCAL_VIEWER: - if (params[0] != 0.0) - gmesa->LightingMode |= LightingModeLocalViewer; - else - gmesa->LightingMode &= ~LightingModeLocalViewer; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, LightingMode, gmesa->LightingMode); - break; - case GL_LIGHT_MODEL_TWO_SIDE: - if (params[0] == 1.0f) { - gmesa->LightingMode |= LightingModeTwoSides; - gmesa->MaterialMode |= MaterialModeTwoSides; - } else { - gmesa->LightingMode &= ~LightingModeTwoSides; - gmesa->MaterialMode &= ~MaterialModeTwoSides; - } - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, LightingMode, gmesa->LightingMode); - WRITE(gmesa->buf, MaterialMode, gmesa->MaterialMode); - break; - } -} -#endif - -static void gammaDDShadeModel( GLcontext *ctx, GLenum mode ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - uint32_t g = gmesa->GeometryMode; - uint32_t c = gmesa->ColorDDAMode; - - g &= ~GM_ShadingMask; - c &= ~ColorDDAShadingMask; - - switch ( mode ) { - case GL_FLAT: - g |= GM_FlatShading; - c |= ColorDDAFlat; - break; - case GL_SMOOTH: - g |= GM_GouraudShading; - c |= ColorDDAGouraud; - break; - default: - return; - } - - if ( gmesa->ColorDDAMode != c ) { - FLUSH_BATCH( gmesa ); - gmesa->ColorDDAMode = c; - - gmesa->dirty |= GAMMA_UPLOAD_SHADE; - } - - if ( gmesa->GeometryMode != g ) { - FLUSH_BATCH( gmesa ); - gmesa->GeometryMode = g; - - gmesa->dirty |= GAMMA_UPLOAD_GEOMETRY; - } -} - -/* ============================================================= - * Miscellaneous - */ - -static void gammaDDClearColor( GLcontext *ctx, const GLfloat color[4]) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - GLubyte c[4]; - UNCLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); - UNCLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); - UNCLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); - UNCLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); - - gmesa->ClearColor = gammaPackColor( gmesa->gammaScreen->cpp, - c[0], c[1], c[2], c[3] ); - - if (gmesa->gammaScreen->cpp == 2) gmesa->ClearColor |= gmesa->ClearColor<<16; -} - - -static void gammaDDLogicalOpcode( GLcontext *ctx, GLenum opcode ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - - if ( ctx->Color.ColorLogicOpEnabled ) { - gmesa->LogicalOpMode = opcode << 1 | LogicalOpModeEnable; - } else { - gmesa->LogicalOpMode = LogicalOpModeDisable; - } - - gmesa->dirty |= GAMMA_UPLOAD_LOGICOP; -} - -static void gammaDDDrawBuffer( GLcontext *ctx, GLenum mode ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - FLUSH_BATCH( gmesa ); - - switch ( mode ) { - case GL_FRONT_LEFT: - gmesa->drawOffset = gmesa->readOffset = 0; - break; - case GL_BACK_LEFT: - gmesa->drawOffset = gmesa->readOffset = gmesa->driScreen->fbHeight * gmesa->driScreen->fbWidth * gmesa->gammaScreen->cpp; - break; - } -} - -static void gammaDDReadBuffer( GLcontext *ctx, GLenum mode ) -{ - /* XXX anything? */ -} - -/* ============================================================= - * Window position and viewport transformation - */ - -void gammaUpdateWindow( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - __DRIdrawable *dPriv = gmesa->driDrawable; - GLfloat xoffset = (GLfloat)dPriv->x; - GLfloat yoffset = gmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h; - const GLfloat *v = ctx->Viewport._WindowMap.m; - - GLfloat sx = v[MAT_SX]; - GLfloat tx = v[MAT_TX] + xoffset; - GLfloat sy = v[MAT_SY]; - GLfloat ty = v[MAT_TY] + yoffset; - GLfloat sz = v[MAT_SZ] * gmesa->depth_scale; - GLfloat tz = v[MAT_TZ] * gmesa->depth_scale; - - gmesa->dirty |= GAMMA_UPLOAD_VIEWPORT; - - gmesa->ViewportScaleX = sx; - gmesa->ViewportScaleY = sy; - gmesa->ViewportScaleZ = sz; - gmesa->ViewportOffsetX = tx; - gmesa->ViewportOffsetY = ty; - gmesa->ViewportOffsetZ = tz; -} - - - -static void gammaDDViewport( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - gammaUpdateWindow( ctx ); -} - -static void gammaDDDepthRange( GLcontext *ctx, GLclampd nearval, - GLclampd farval ) -{ - gammaUpdateWindow( ctx ); -} - -void gammaUpdateViewportOffset( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - __DRIdrawable *dPriv = gmesa->driDrawable; - GLfloat xoffset = (GLfloat)dPriv->x; - GLfloat yoffset = gmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h; - const GLfloat *v = ctx->Viewport._WindowMap.m; - - GLfloat tx = v[MAT_TX] + xoffset; - GLfloat ty = v[MAT_TY] + yoffset; - - if ( gmesa->ViewportOffsetX != tx || - gmesa->ViewportOffsetY != ty ) - { - gmesa->ViewportOffsetX = tx; - gmesa->ViewportOffsetY = ty; - - gmesa->new_state |= GAMMA_NEW_WINDOW; - } - - gmesa->new_state |= GAMMA_NEW_CLIP; -} - -#if 0 -/* - * Matrix - */ - -static void gammaLoadHWMatrix(GLcontext *ctx) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - const GLfloat *m; - - gmesa->TransformMode &= ~XM_XformTexture; - - switch (ctx->Transform.MatrixMode) { - case GL_MODELVIEW: - gmesa->TransformMode |= XM_UseModelViewMatrix; - m = ctx->ModelviewMatrixStack.Top->m; - CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, ModelViewMatrix0, m[0]); - WRITEF(gmesa->buf, ModelViewMatrix1, m[1]); - WRITEF(gmesa->buf, ModelViewMatrix2, m[2]); - WRITEF(gmesa->buf, ModelViewMatrix3, m[3]); - WRITEF(gmesa->buf, ModelViewMatrix4, m[4]); - WRITEF(gmesa->buf, ModelViewMatrix5, m[5]); - WRITEF(gmesa->buf, ModelViewMatrix6, m[6]); - WRITEF(gmesa->buf, ModelViewMatrix7, m[7]); - WRITEF(gmesa->buf, ModelViewMatrix8, m[8]); - WRITEF(gmesa->buf, ModelViewMatrix9, m[9]); - WRITEF(gmesa->buf, ModelViewMatrix10, m[10]); - WRITEF(gmesa->buf, ModelViewMatrix11, m[11]); - WRITEF(gmesa->buf, ModelViewMatrix12, m[12]); - WRITEF(gmesa->buf, ModelViewMatrix13, m[13]); - WRITEF(gmesa->buf, ModelViewMatrix14, m[14]); - WRITEF(gmesa->buf, ModelViewMatrix15, m[15]); - break; - case GL_PROJECTION: - m = ctx->ProjectionMatrixStack.Top->m; - CHECK_DMA_BUFFER(gmesa, 16); - WRITEF(gmesa->buf, ModelViewProjectionMatrix0, m[0]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix1, m[1]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix2, m[2]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix3, m[3]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix4, m[4]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix5, m[5]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix6, m[6]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix7, m[7]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix8, m[8]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix9, m[9]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix10, m[10]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix11, m[11]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix12, m[12]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix13, m[13]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix14, m[14]); - WRITEF(gmesa->buf, ModelViewProjectionMatrix15, m[15]); - break; - case GL_TEXTURE: - m = ctx->TextureMatrixStack[0].Top->m; - CHECK_DMA_BUFFER(gmesa, 16); - gmesa->TransformMode |= XM_XformTexture; - WRITEF(gmesa->buf, TextureMatrix0, m[0]); - WRITEF(gmesa->buf, TextureMatrix1, m[1]); - WRITEF(gmesa->buf, TextureMatrix2, m[2]); - WRITEF(gmesa->buf, TextureMatrix3, m[3]); - WRITEF(gmesa->buf, TextureMatrix4, m[4]); - WRITEF(gmesa->buf, TextureMatrix5, m[5]); - WRITEF(gmesa->buf, TextureMatrix6, m[6]); - WRITEF(gmesa->buf, TextureMatrix7, m[7]); - WRITEF(gmesa->buf, TextureMatrix8, m[8]); - WRITEF(gmesa->buf, TextureMatrix9, m[9]); - WRITEF(gmesa->buf, TextureMatrix10, m[10]); - WRITEF(gmesa->buf, TextureMatrix11, m[11]); - WRITEF(gmesa->buf, TextureMatrix12, m[12]); - WRITEF(gmesa->buf, TextureMatrix13, m[13]); - WRITEF(gmesa->buf, TextureMatrix14, m[14]); - WRITEF(gmesa->buf, TextureMatrix15, m[15]); - break; - - default: - /* ERROR!!! -- how did this happen? */ - break; - } - - gmesa->dirty |= GAMMA_UPLOAD_TRANSFORM; -} -#endif - -/* ============================================================= - * State enable/disable - */ - -static void gammaDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - switch ( cap ) { - case GL_ALPHA_TEST: - case GL_BLEND: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_ALPHA; - break; - - case GL_CULL_FACE: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_CULL; - break; - - case GL_DEPTH_TEST: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_DEPTH; - break; - - case GL_DITHER: - do { - uint32_t d = gmesa->DitherMode; - FLUSH_BATCH( gmesa ); - - if ( state ) { - d |= DM_DitherEnable; - } else { - d &= ~DM_DitherEnable; - } - - if ( gmesa->DitherMode != d ) { - gmesa->DitherMode = d; - gmesa->dirty |= GAMMA_UPLOAD_DITHER; - } - } while (0); - break; - -#if 0 - case GL_FOG: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_FOG; - break; -#endif - - case GL_INDEX_LOGIC_OP: - case GL_COLOR_LOGIC_OP: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_LOGICOP; - break; - -#if ENABLELIGHTING - case GL_LIGHTING: - do { - uint32_t l = gmesa->LightingMode; - FLUSH_BATCH( gmesa ); - - if ( state ) { - l |= LightingModeEnable; - } else { - l &= ~LightingModeEnable; - } - - if ( gmesa->LightingMode != l ) { - gmesa->LightingMode = l; - gmesa->dirty |= GAMMA_UPLOAD_LIGHT; - } - } while (0); - break; - - case GL_COLOR_MATERIAL: - do { - uint32_t m = gmesa->MaterialMode; - FLUSH_BATCH( gmesa ); - - if ( state ) { - m |= MaterialModeEnable; - } else { - m &= ~MaterialModeEnable; - } - - if ( gmesa->MaterialMode != m ) { - gmesa->MaterialMode = m; - gmesa->dirty |= GAMMA_UPLOAD_LIGHT; - } - } while (0); - break; -#endif - - case GL_LINE_SMOOTH: - FLUSH_BATCH( gmesa ); - if ( state ) { - gmesa->AntialiasMode |= AntialiasModeEnable; - gmesa->LineMode |= LM_AntialiasEnable; - } else { - gmesa->AntialiasMode &= ~AntialiasModeEnable; - gmesa->LineMode &= ~LM_AntialiasEnable; - } - gmesa->dirty |= GAMMA_UPLOAD_LINEMODE; - break; - - case GL_POINT_SMOOTH: - FLUSH_BATCH( gmesa ); - if ( state ) { - gmesa->AntialiasMode |= AntialiasModeEnable; - gmesa->PointMode |= PM_AntialiasEnable; - } else { - gmesa->AntialiasMode &= ~AntialiasModeEnable; - gmesa->PointMode &= ~PM_AntialiasEnable; - } - gmesa->dirty |= GAMMA_UPLOAD_POINTMODE; - break; - - case GL_POLYGON_SMOOTH: - FLUSH_BATCH( gmesa ); - if ( state ) { - gmesa->AntialiasMode |= AntialiasModeEnable; - gmesa->TriangleMode |= TM_AntialiasEnable; - } else { - gmesa->AntialiasMode &= ~AntialiasModeEnable; - gmesa->TriangleMode &= ~TM_AntialiasEnable; - } - gmesa->dirty |= GAMMA_UPLOAD_TRIMODE; - break; - - case GL_SCISSOR_TEST: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_CLIP; - break; - - case GL_POLYGON_OFFSET_FILL: - case GL_POLYGON_OFFSET_POINT: - case GL_POLYGON_OFFSET_LINE: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_POLYGON; - break; - - case GL_LINE_STIPPLE: - FLUSH_BATCH( gmesa ); - if ( state ) - gmesa->LineMode |= LM_StippleEnable; - else - gmesa->LineMode &= ~LM_StippleEnable; - gmesa->dirty |= GAMMA_UPLOAD_LINEMODE; - break; - - case GL_POLYGON_STIPPLE: - FLUSH_BATCH( gmesa ); - gmesa->new_state |= GAMMA_NEW_STIPPLE; - break; - - default: - return; - } -} - -/* ============================================================= - * State initialization, management - */ - - -/* - * Load the current context's state into the hardware. - * - * NOTE: Be VERY careful about ensuring the context state is marked for - * upload, the only place it shouldn't be uploaded is when the setup - * state has changed in ReducedPrimitiveChange as this comes right after - * a state update. - * - * Blits of any type should always upload the context and masks after - * they are done. - */ -void gammaEmitHwState( gammaContextPtr gmesa ) -{ - if (!gmesa->driDrawable) return; - - if (!gmesa->dirty) return; - -#ifdef DO_VALIDATE - /* Flush any partially filled buffers */ - FLUSH_DMA_BUFFER(gmesa); - - DRM_SPINLOCK(&gmesa->driScreen->pSAREA->drawable_lock, - gmesa->driScreen->drawLockID); - VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa); -#endif - - if (gmesa->dirty & GAMMA_UPLOAD_VIEWPORT) { - gmesa->dirty &= ~GAMMA_UPLOAD_VIEWPORT; - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, ViewPortOffsetX, gmesa->ViewportOffsetX); - WRITEF(gmesa->buf, ViewPortOffsetY, gmesa->ViewportOffsetY); - WRITEF(gmesa->buf, ViewPortOffsetZ, gmesa->ViewportOffsetZ); - WRITEF(gmesa->buf, ViewPortScaleX, gmesa->ViewportScaleX); - WRITEF(gmesa->buf, ViewPortScaleY, gmesa->ViewportScaleY); - WRITEF(gmesa->buf, ViewPortScaleZ, gmesa->ViewportScaleZ); - } - if ( (gmesa->dirty & GAMMA_UPLOAD_POINTMODE) || - (gmesa->dirty & GAMMA_UPLOAD_LINEMODE) || - (gmesa->dirty & GAMMA_UPLOAD_TRIMODE) ) { - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, AntialiasMode, gmesa->AntialiasMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_POINTMODE) { - gmesa->dirty &= ~GAMMA_UPLOAD_POINTMODE; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PointMode, gmesa->PointMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_LINEMODE) { - gmesa->dirty &= ~GAMMA_UPLOAD_LINEMODE; - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, LineMode, gmesa->LineMode); - WRITE(gmesa->buf, LineStippleMode, gmesa->LineMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_TRIMODE) { - gmesa->dirty &= ~GAMMA_UPLOAD_TRIMODE; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TriangleMode, gmesa->TriangleMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_FOG) { - GLchan c[3], col; - UNCLAMPED_FLOAT_TO_RGB_CHAN( c, gmesa->glCtx->Fog.Color ); - col = gammaPackColor(4, c[0], c[1], c[2], 0); - gmesa->dirty &= ~GAMMA_UPLOAD_FOG; - CHECK_DMA_BUFFER(gmesa, 5); -#if 0 - WRITE(gmesa->buf, FogMode, gmesa->FogMode); - WRITE(gmesa->buf, FogColor, col); - WRITEF(gmesa->buf, FStart, gmesa->glCtx->Fog.Start); -#endif - WRITEF(gmesa->buf, FogEnd, gmesa->glCtx->Fog.End); - WRITEF(gmesa->buf, FogDensity, gmesa->glCtx->Fog.Density); - WRITEF(gmesa->buf, FogScale, - 1.0f/(gmesa->glCtx->Fog.End - gmesa->glCtx->Fog.Start)); - } - if (gmesa->dirty & GAMMA_UPLOAD_DITHER) { - gmesa->dirty &= ~GAMMA_UPLOAD_DITHER; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, DitherMode, gmesa->DitherMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_LOGICOP) { - gmesa->dirty &= ~GAMMA_UPLOAD_LOGICOP; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, LogicalOpMode, gmesa->LogicalOpMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_CLIP) { - gmesa->dirty &= ~GAMMA_UPLOAD_CLIP; - CHECK_DMA_BUFFER(gmesa, 3); - WRITE(gmesa->buf, ScissorMinXY, gmesa->ScissorMinXY); - WRITE(gmesa->buf, ScissorMaxXY, gmesa->ScissorMaxXY); - WRITE(gmesa->buf, ScissorMode, gmesa->ScissorMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_MASKS) { - gmesa->dirty &= ~GAMMA_UPLOAD_MASKS; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, FBHardwareWriteMask, gmesa->FBHardwareWriteMask); - } - if (gmesa->dirty & GAMMA_UPLOAD_ALPHA) { - gmesa->dirty &= ~GAMMA_UPLOAD_ALPHA; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, AlphaTestMode, gmesa->AlphaTestMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_BLEND) { - gmesa->dirty &= ~GAMMA_UPLOAD_BLEND; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, AlphaBlendMode, gmesa->AlphaBlendMode); - } - CHECK_DMA_BUFFER(gmesa, 1); - if (gmesa->glCtx->Color.BlendEnabled || gmesa->glCtx->Color.AlphaEnabled) { - WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode | gmesa->AB_FBReadMode_Save); - } else { - WRITE(gmesa->buf, FBReadMode, gmesa->FBReadMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_LIGHT) { - gmesa->dirty &= ~GAMMA_UPLOAD_LIGHT; - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, LightingMode, gmesa->LightingMode); - WRITE(gmesa->buf, MaterialMode, gmesa->MaterialMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_SHADE) { - gmesa->dirty &= ~GAMMA_UPLOAD_SHADE; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, ColorDDAMode, gmesa->ColorDDAMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_POLYGON) { - gmesa->dirty &= ~GAMMA_UPLOAD_POLYGON; - CHECK_DMA_BUFFER(gmesa, 2); - WRITEF(gmesa->buf, PolygonOffsetBias, gmesa->glCtx->Polygon.OffsetUnits); - WRITEF(gmesa->buf, PolygonOffsetFactor, gmesa->glCtx->Polygon.OffsetFactor); - } - if (gmesa->dirty & GAMMA_UPLOAD_STIPPLE) { - gmesa->dirty &= ~GAMMA_UPLOAD_STIPPLE; - CHECK_DMA_BUFFER(gmesa, 33); - WRITE(gmesa->buf, AreaStippleMode, gmesa->AreaStippleMode); - WRITE(gmesa->buf, AreaStipplePattern0, gmesa->glCtx->PolygonStipple[0]); - WRITE(gmesa->buf, AreaStipplePattern1, gmesa->glCtx->PolygonStipple[1]); - WRITE(gmesa->buf, AreaStipplePattern2, gmesa->glCtx->PolygonStipple[2]); - WRITE(gmesa->buf, AreaStipplePattern3, gmesa->glCtx->PolygonStipple[3]); - WRITE(gmesa->buf, AreaStipplePattern4, gmesa->glCtx->PolygonStipple[4]); - WRITE(gmesa->buf, AreaStipplePattern5, gmesa->glCtx->PolygonStipple[5]); - WRITE(gmesa->buf, AreaStipplePattern6, gmesa->glCtx->PolygonStipple[6]); - WRITE(gmesa->buf, AreaStipplePattern7, gmesa->glCtx->PolygonStipple[7]); - WRITE(gmesa->buf, AreaStipplePattern8, gmesa->glCtx->PolygonStipple[8]); - WRITE(gmesa->buf, AreaStipplePattern9, gmesa->glCtx->PolygonStipple[9]); - WRITE(gmesa->buf, AreaStipplePattern10, gmesa->glCtx->PolygonStipple[10]); - WRITE(gmesa->buf, AreaStipplePattern11, gmesa->glCtx->PolygonStipple[11]); - WRITE(gmesa->buf, AreaStipplePattern12, gmesa->glCtx->PolygonStipple[12]); - WRITE(gmesa->buf, AreaStipplePattern13, gmesa->glCtx->PolygonStipple[13]); - WRITE(gmesa->buf, AreaStipplePattern14, gmesa->glCtx->PolygonStipple[14]); - WRITE(gmesa->buf, AreaStipplePattern15, gmesa->glCtx->PolygonStipple[15]); - WRITE(gmesa->buf, AreaStipplePattern16, gmesa->glCtx->PolygonStipple[16]); - WRITE(gmesa->buf, AreaStipplePattern17, gmesa->glCtx->PolygonStipple[17]); - WRITE(gmesa->buf, AreaStipplePattern18, gmesa->glCtx->PolygonStipple[18]); - WRITE(gmesa->buf, AreaStipplePattern19, gmesa->glCtx->PolygonStipple[19]); - WRITE(gmesa->buf, AreaStipplePattern20, gmesa->glCtx->PolygonStipple[20]); - WRITE(gmesa->buf, AreaStipplePattern21, gmesa->glCtx->PolygonStipple[21]); - WRITE(gmesa->buf, AreaStipplePattern22, gmesa->glCtx->PolygonStipple[22]); - WRITE(gmesa->buf, AreaStipplePattern23, gmesa->glCtx->PolygonStipple[23]); - WRITE(gmesa->buf, AreaStipplePattern24, gmesa->glCtx->PolygonStipple[24]); - WRITE(gmesa->buf, AreaStipplePattern25, gmesa->glCtx->PolygonStipple[25]); - WRITE(gmesa->buf, AreaStipplePattern26, gmesa->glCtx->PolygonStipple[26]); - WRITE(gmesa->buf, AreaStipplePattern27, gmesa->glCtx->PolygonStipple[27]); - WRITE(gmesa->buf, AreaStipplePattern28, gmesa->glCtx->PolygonStipple[28]); - WRITE(gmesa->buf, AreaStipplePattern29, gmesa->glCtx->PolygonStipple[29]); - WRITE(gmesa->buf, AreaStipplePattern30, gmesa->glCtx->PolygonStipple[30]); - WRITE(gmesa->buf, AreaStipplePattern31, gmesa->glCtx->PolygonStipple[31]); - } - if (gmesa->dirty & GAMMA_UPLOAD_DEPTH) { - gmesa->dirty &= ~GAMMA_UPLOAD_DEPTH; - CHECK_DMA_BUFFER(gmesa, 4); - WRITE(gmesa->buf, DepthMode, gmesa->DepthMode); - WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode); - WRITE(gmesa->buf, GLINTWindow,gmesa->Window | (gmesa->FrameCount << 9)); - WRITE(gmesa->buf, LBReadMode, gmesa->LBReadMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_GEOMETRY) { - gmesa->dirty &= ~GAMMA_UPLOAD_GEOMETRY; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_TRANSFORM) { - gmesa->dirty &= ~GAMMA_UPLOAD_TRANSFORM; - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TransformMode, gmesa->TransformMode); - } - if (gmesa->dirty & GAMMA_UPLOAD_TEX0) { - gammaTextureObjectPtr curTex = gmesa->CurrentTexObj[0]; - gmesa->dirty &= ~GAMMA_UPLOAD_TEX0; - if (curTex) { - CHECK_DMA_BUFFER(gmesa, 21); - WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode | GM_TextureEnable); - WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode | DM_TextureEnable); - WRITE(gmesa->buf, TextureAddressMode, curTex->TextureAddressMode); - WRITE(gmesa->buf, TextureReadMode, curTex->TextureReadMode); - WRITE(gmesa->buf, TextureColorMode, curTex->TextureColorMode); - WRITE(gmesa->buf, TextureFilterMode, curTex->TextureFilterMode); - WRITE(gmesa->buf, TextureFormat, curTex->TextureFormat); - WRITE(gmesa->buf, GLINTBorderColor, curTex->TextureBorderColor); - WRITE(gmesa->buf, TxBaseAddr0, curTex->TextureBaseAddr[0]); - WRITE(gmesa->buf, TxBaseAddr1, curTex->TextureBaseAddr[1]); - WRITE(gmesa->buf, TxBaseAddr2, curTex->TextureBaseAddr[2]); - WRITE(gmesa->buf, TxBaseAddr3, curTex->TextureBaseAddr[3]); - WRITE(gmesa->buf, TxBaseAddr4, curTex->TextureBaseAddr[4]); - WRITE(gmesa->buf, TxBaseAddr5, curTex->TextureBaseAddr[5]); - WRITE(gmesa->buf, TxBaseAddr6, curTex->TextureBaseAddr[6]); - WRITE(gmesa->buf, TxBaseAddr7, curTex->TextureBaseAddr[7]); - WRITE(gmesa->buf, TxBaseAddr8, curTex->TextureBaseAddr[8]); - WRITE(gmesa->buf, TxBaseAddr9, curTex->TextureBaseAddr[9]); - WRITE(gmesa->buf, TxBaseAddr10, curTex->TextureBaseAddr[10]); - WRITE(gmesa->buf, TxBaseAddr11, curTex->TextureBaseAddr[11]); - WRITE(gmesa->buf, TextureCacheControl, (TCC_Enable | TCC_Invalidate)); - } else { - CHECK_DMA_BUFFER(gmesa, 6); - WRITE(gmesa->buf, GeometryMode, gmesa->GeometryMode); - WRITE(gmesa->buf, DeltaMode, gmesa->DeltaMode); - WRITE(gmesa->buf, TextureAddressMode, TextureAddressModeDisable); - WRITE(gmesa->buf, TextureReadMode, TextureReadModeDisable); - WRITE(gmesa->buf, TextureFilterMode, TextureFilterModeDisable); - WRITE(gmesa->buf, TextureColorMode, TextureColorModeDisable); - } - } -#ifdef DO_VALIDATE - PROCESS_DMA_BUFFER_TOP_HALF(gmesa); - - DRM_SPINUNLOCK(&gmesa->driScreen->pSAREA->drawable_lock, - gmesa->driScreen->drawLockID); - VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa); - - PROCESS_DMA_BUFFER_BOTTOM_HALF(gmesa); -#endif -} - -void gammaDDUpdateHWState( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - int new_state = gmesa->new_state; - - if ( new_state ) - { - FLUSH_BATCH( gmesa ); - - gmesa->new_state = 0; - - /* Update the various parts of the context's state. - */ - if ( new_state & GAMMA_NEW_ALPHA ) - gammaUpdateAlphaMode( ctx ); - - if ( new_state & GAMMA_NEW_DEPTH ) - gammaUpdateZMode( ctx ); - - if ( new_state & GAMMA_NEW_FOG ) - gammaUpdateFogAttrib( ctx ); - - if ( new_state & GAMMA_NEW_CLIP ) - gammaUpdateClipping( ctx ); - - if ( new_state & GAMMA_NEW_POLYGON ) - gammaUpdatePolygon( ctx ); - - if ( new_state & GAMMA_NEW_CULL ) - gammaUpdateCull( ctx ); - - if ( new_state & GAMMA_NEW_MASKS ) - gammaUpdateMasks( ctx ); - - if ( new_state & GAMMA_NEW_WINDOW ) - gammaUpdateWindow( ctx ); - - if ( new_state & GAMMA_NEW_STIPPLE ) - gammaUpdateStipple( ctx ); - } - - /* HACK ! */ - - gammaEmitHwState( gmesa ); -} - - -static void gammaDDUpdateState( GLcontext *ctx, GLuint new_state ) -{ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - GAMMA_CONTEXT(ctx)->new_gl_state |= new_state; -} - - -/* Initialize the context's hardware state. - */ -void gammaDDInitState( gammaContextPtr gmesa ) -{ - gmesa->new_state = 0; -} - -/* Initialize the driver's state functions. - */ -void gammaDDInitStateFuncs( GLcontext *ctx ) -{ - ctx->Driver.UpdateState = gammaDDUpdateState; - - ctx->Driver.Clear = gammaDDClear; - ctx->Driver.ClearIndex = NULL; - ctx->Driver.ClearColor = gammaDDClearColor; - ctx->Driver.DrawBuffer = gammaDDDrawBuffer; - ctx->Driver.ReadBuffer = gammaDDReadBuffer; - - ctx->Driver.IndexMask = NULL; - ctx->Driver.ColorMask = gammaDDColorMask; - - ctx->Driver.AlphaFunc = gammaDDAlphaFunc; - ctx->Driver.BlendEquationSeparate = gammaDDBlendEquationSeparate; - ctx->Driver.BlendFuncSeparate = gammaDDBlendFuncSeparate; - ctx->Driver.ClearDepth = gammaDDClearDepth; - ctx->Driver.CullFace = gammaDDCullFace; - ctx->Driver.FrontFace = gammaDDFrontFace; - ctx->Driver.DepthFunc = gammaDDDepthFunc; - ctx->Driver.DepthMask = gammaDDDepthMask; - ctx->Driver.DepthRange = gammaDDDepthRange; - ctx->Driver.Enable = gammaDDEnable; - ctx->Driver.Finish = gammaDDFinish; - ctx->Driver.Flush = gammaDDFlush; -#if 0 - ctx->Driver.Fogfv = gammaDDFogfv; -#endif - ctx->Driver.Hint = NULL; - ctx->Driver.LineWidth = gammaDDLineWidth; - ctx->Driver.LineStipple = gammaDDLineStipple; -#if ENABLELIGHTING - ctx->Driver.Lightfv = gammaDDLightfv; - ctx->Driver.LightModelfv = gammaDDLightModelfv; -#endif - ctx->Driver.LogicOpcode = gammaDDLogicalOpcode; - ctx->Driver.PointSize = gammaDDPointSize; - ctx->Driver.PolygonMode = gammaDDPolygonMode; - ctx->Driver.PolygonStipple = gammaDDPolygonStipple; - ctx->Driver.Scissor = gammaDDScissor; - ctx->Driver.ShadeModel = gammaDDShadeModel; - ctx->Driver.Viewport = gammaDDViewport; -} diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c deleted file mode 100644 index bef8cf27db..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_tex.c +++ /dev/null @@ -1,434 +0,0 @@ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/colormac.h" -#include "main/imports.h" -#include "main/simple_list.h" -#include "main/enums.h" -#include "main/mm.h" -#include "main/texstore.h" -#include "main/teximage.h" -#include "main/texobj.h" - -#include "swrast/swrast.h" - -#include "gamma_context.h" - - -/* - * Compute the 'S2.4' lod bias factor from the floating point OpenGL bias. - */ -#if 0 -static GLuint gammaComputeLodBias(GLfloat bias) -{ - return bias; -} -#endif - -static void gammaSetTexWrapping(gammaTextureObjectPtr t, - GLenum wraps, GLenum wrapt) -{ - uint32_t t1 = t->TextureAddressMode; - uint32_t t2 = t->TextureReadMode; - - t1 &= ~(TAM_SWrap_Mask | TAM_TWrap_Mask); - t2 &= ~(TRM_UWrap_Mask | TRM_VWrap_Mask); - - if (wraps != GL_CLAMP) { - t1 |= TAM_SWrap_Repeat; - t2 |= TRM_UWrap_Repeat; - } - - if (wrapt != GL_CLAMP) { - t1 |= TAM_TWrap_Repeat; - t2 |= TRM_VWrap_Repeat; - } - - t->TextureAddressMode = t1; - t->TextureReadMode = t2; -} - - -static void gammaSetTexFilter(gammaContextPtr gmesa, - gammaTextureObjectPtr t, - GLenum minf, GLenum magf, - GLfloat bias) -{ - uint32_t t1 = t->TextureAddressMode; - uint32_t t2 = t->TextureReadMode; - - t2 &= ~(TRM_Mag_Mask | TRM_Min_Mask); - - switch (minf) { - case GL_NEAREST: - t1 &= ~TAM_LODEnable; - t2 &= ~TRM_MipMapEnable; - t2 |= TRM_Min_Nearest; - break; - case GL_LINEAR: - t1 &= ~TAM_LODEnable; - t2 &= ~TRM_MipMapEnable; - t2 |= TRM_Min_Linear; - break; - case GL_NEAREST_MIPMAP_NEAREST: - t2 |= TRM_Min_NearestMMNearest; - break; - case GL_LINEAR_MIPMAP_NEAREST: - t2 |= TRM_Min_LinearMMNearest; - break; - case GL_NEAREST_MIPMAP_LINEAR: - t2 |= TRM_Min_NearestMMLinear; - break; - case GL_LINEAR_MIPMAP_LINEAR: - t2 |= TRM_Min_LinearMMLinear; - break; - default: - break; - } - - switch (magf) { - case GL_NEAREST: - t2 |= TRM_Mag_Nearest; - break; - case GL_LINEAR: - t2 |= TRM_Mag_Linear; - break; - default: - break; - } - - t->TextureAddressMode = t1; - t->TextureReadMode = t2; -} - - -static void gammaSetTexBorderColor(gammaContextPtr gmesa, - gammaTextureObjectPtr t, - const GLfloat color[4]) -{ - GLubyte c[4]; - CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); - t->TextureBorderColor = PACK_COLOR_8888(c[0], c[1], c[2], c[3]); -} - - -static void gammaTexParameter( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj, - GLenum pname, const GLfloat *params ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData; - if (!t) - return; - - /* Can't do the update now as we don't know whether to flush - * vertices or not. Setting gmesa->new_state means that - * gammaUpdateTextureState() will be called before any triangles are - * rendered. If a statechange has occurred, it will be detected at - * that point, and buffered vertices flushed. - */ - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_MAG_FILTER: - { - GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; - gammaSetTexFilter( gmesa, t, tObj->MinFilter, tObj->MagFilter, bias ); - } - break; - - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - gammaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); - break; - - case GL_TEXTURE_BORDER_COLOR: - gammaSetTexBorderColor( gmesa, t, tObj->BorderColor.f ); - break; - - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative for Radeon. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - gammaSwapOutTexObj( gmesa, t ); - break; - - default: - return; - } - - if (t == gmesa->CurrentTexObj[0]) - gmesa->dirty |= GAMMA_UPLOAD_TEX0; - -#if 0 - if (t == gmesa->CurrentTexObj[1]) { - gmesa->dirty |= GAMMA_UPLOAD_TEX1; - } -#endif -} - - -static void gammaTexEnv( GLcontext *ctx, GLenum target, - GLenum pname, const GLfloat *param ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT( ctx ); - GLuint unit = ctx->Texture.CurrentUnit; - - /* Only one env color. Need a fallback if env colors are different - * and texture setup references env color in both units. - */ - switch (pname) { - case GL_TEXTURE_ENV_COLOR: { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLfloat *fc = texUnit->EnvColor; - GLuint r, g, b, a, col; - CLAMPED_FLOAT_TO_UBYTE(r, fc[0]); - CLAMPED_FLOAT_TO_UBYTE(g, fc[1]); - CLAMPED_FLOAT_TO_UBYTE(b, fc[2]); - CLAMPED_FLOAT_TO_UBYTE(a, fc[3]); - - col = ((a << 24) | - (r << 16) | - (g << 8) | - (b << 0)); - - break; - } - case GL_TEXTURE_ENV_MODE: - gmesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */ - break; - - case GL_TEXTURE_LOD_BIAS_EXT: -#if 0 /* ?!?!?! */ - { - struct gl_texture_object *tObj = ctx->Texture.Unit[unit]._Current; - gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData; - (void) t; - /* XXX Looks like there's something missing here */ - } -#endif - break; - - default: - break; - } -} - -#if 0 -static void gammaTexImage1D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData; - if (t) { - gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t ); - } - _mesa_store_teximage1d( ctx, target, level, internalFormat, - width, border, format, type, - pixels, pack, texObj, texImage ); -} -#endif - -#if 0 -static void gammaTexSubImage1D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData; - if (t) { - gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t ); - } - _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, - format, type, pixels, pack, texObj, - texImage); -} -#endif - -static void gammaTexImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData; - if (t) { - gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t ); - } - _mesa_store_teximage2d( ctx, target, level, internalFormat, - width, height, border, format, type, - pixels, packing, texObj, texImage ); -} - -static void gammaTexSubImage2D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - gammaTextureObjectPtr t = (gammaTextureObjectPtr) texObj->DriverData; - if (t) { - gammaSwapOutTexObj( GAMMA_CONTEXT(ctx), t ); - } - _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, - height, format, type, pixels, packing, texObj, - texImage); -} - -static void gammaBindTexture( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT( ctx ); - gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData; - - if (!t) { - GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; - t = CALLOC_STRUCT(gamma_texture_object_t); - - /* Initialize non-image-dependent parts of the state: - */ - t->globj = tObj; - - t->TextureAddressMode = TextureAddressModeEnable | TAM_Operation_3D | - TAM_DY_Enable | TAM_LODEnable; - t->TextureReadMode = TextureReadModeEnable | TRM_PrimaryCacheEnable | - TRM_MipMapEnable | TRM_BorderClamp | TRM_Border; - t->TextureColorMode = TextureColorModeEnable; - t->TextureFilterMode = TextureFilterModeEnable; - - if (target == GL_TEXTURE_2D) { - t->TextureAddressMode |= TAM_TexMapType_2D; - t->TextureReadMode |= TRM_TexMapType_2D; - } - else if (target == GL_TEXTURE_1D) { - t->TextureAddressMode |= TAM_TexMapType_1D; - t->TextureReadMode |= TRM_TexMapType_1D; - } - - t->TextureColorMode = TextureColorModeEnable; - - t->TextureFilterMode = TextureFilterModeEnable; - -#ifdef MESA_LITTLE_ENDIAN - t->TextureFormat = (TF_LittleEndian | -#else - t->TextureFormat = (TF_BigEndian | -#endif - TF_ColorOrder_RGB | - TF_OutputFmt_Texel); - - t->dirty_images = ~0; - - tObj->DriverData = t; - make_empty_list( t ); - - gammaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); - gammaSetTexFilter( gmesa, t, tObj->MinFilter, tObj->MagFilter, bias ); - gammaSetTexBorderColor( gmesa, t, tObj->BorderColor.f ); - } -} - -static void gammaDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) -{ - gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData; - - if (t) { - gammaContextPtr gmesa = GAMMA_CONTEXT( ctx ); -#if 0 - if (gmesa) - GAMMA_FIREVERTICES( gmesa ); -#endif - gammaDestroyTexObj( gmesa, t ); - tObj->DriverData = 0; - } - /* Free mipmap images and the texture object itself */ - _mesa_delete_texture_object(ctx, tObj); -} - -static GLboolean gammaIsTextureResident( GLcontext *ctx, - struct gl_texture_object *tObj ) -{ - gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData; - return t && t->MemBlock; -} - -#ifdef UNUSED -/** - * Allocate a new texture object. - * Called via ctx->Driver.NewTextureObject. - * Note: this function will be called during context creation to - * allocate the default texture objects. - * Note: we could use containment here to 'derive' the driver-specific - * texture object from the core mesa gl_texture_object. Not done at this time. - */ -static struct gl_texture_object * -gammaNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ) -{ - struct gl_texture_object *obj; - obj = _mesa_new_texture_object(ctx, name, target); - return obj; -} -#endif - -void gammaInitTextureObjects( GLcontext *ctx ) -{ - struct gl_texture_object *texObj; - GLuint tmp = ctx->Texture.CurrentUnit; - - ctx->Texture.CurrentUnit = 0; - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_1D_INDEX]; - gammaBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; - gammaBindTexture( ctx, GL_TEXTURE_2D, texObj ); - -#if 0 - ctx->Texture.CurrentUnit = 1; - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_1D_INDEX]; - gammaBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_2D_INDEX]; - gammaBindTexture( ctx, GL_TEXTURE_2D, texObj ); -#endif - - ctx->Texture.CurrentUnit = tmp; -} - - -void gammaDDInitTextureFuncs( struct dd_function_table *functions ) -{ - functions->TexEnv = gammaTexEnv; - functions->TexImage2D = gammaTexImage2D; - functions->TexSubImage2D = gammaTexSubImage2D; - functions->BindTexture = gammaBindTexture; - functions->DeleteTexture = gammaDeleteTexture; - functions->TexParameter = gammaTexParameter; - functions->IsTextureResident = gammaIsTextureResident; -} diff --git a/src/mesa/drivers/dri/gamma/gamma_texmem.c b/src/mesa/drivers/dri/gamma/gamma_texmem.c deleted file mode 100644 index 45a0c0148e..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_texmem.c +++ /dev/null @@ -1,535 +0,0 @@ - -#include -#include - -#include "main/glheader.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" - -#include "main/mm.h" -#include "glint_dri.h" -#include "gamma_context.h" -#include "gamma_lock.h" -#include "gamma_macros.h" - -void gammaDestroyTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t) -{ - if (!t) return; - - /* This is sad - need to sync *in case* we upload a texture - * to this newly free memory... - */ - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (gmesa && t->age > gmesa->dirtyAge) - gmesa->dirtyAge = t->age; - } - - if (t->globj) - t->globj->DriverData = 0; - - if (gmesa) { - if (gmesa->CurrentTexObj[0] == t) { - gmesa->CurrentTexObj[0] = 0; - gmesa->dirty &= ~GAMMA_UPLOAD_TEX0; - } - -#if 0 - if (gmesa->CurrentTexObj[1] == t) { - gmesa->CurrentTexObj[1] = 0; - gmesa->dirty &= ~GAMMA_UPLOAD_TEX1; - } -#endif - } - - remove_from_list(t); - free(t); -} - - -void gammaSwapOutTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t) -{ -/* fprintf(stderr, "%s\n", __FUNCTION__); */ - - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (t->age > gmesa->dirtyAge) - gmesa->dirtyAge = t->age; - } - - t->dirty_images = ~0; - move_to_tail(&(gmesa->SwappedOut), t); -} - - - -/* Upload an image from mesa's internal copy. - */ -static void gammaUploadTexLevel( gammaContextPtr gmesa, gammaTextureObjectPtr t, int level ) -{ - const struct gl_texture_image *image = t->image[level].image; - int i,j; - int l2d; -#if 0 - int offset = 0; -#endif - int words, depthLog2; - - /* fprintf(stderr, "%s\n", __FUNCTION__); */ - - l2d = 5; /* 32bits per texel == 1<<5 */ - - if (level == 0) { - t->TextureAddressMode &= ~(TAM_WidthMask | TAM_HeightMask); - t->TextureAddressMode |= (image->WidthLog2 << 9) | - (image->HeightLog2 << 13); - t->TextureReadMode &= ~(TRM_WidthMask | TRM_HeightMask | - TRM_DepthMask | TRM_Border | - TRM_Patch); - t->TextureReadMode |= (image->WidthLog2 << 1) | - (image->HeightLog2 << 5) | - (l2d << 9); - t->TextureFormat &= ~(TF_CompnentsMask | TF_OneCompFmt_Mask); - } - - t->TextureBaseAddr[level] = /* ??? */ - (unsigned long)(t->image[level].offset + t->BufAddr) << 5; - - CALC_LOG2(depthLog2, 1<Width * image->Height) >> (5-depthLog2); - - CHECK_DMA_BUFFER(gmesa, 3); - WRITE(gmesa->buf, LBWindowBase, t->TextureBaseAddr[level] >> 5); - WRITE(gmesa->buf, TextureCacheControl, (TCC_Enable | TCC_Invalidate)); - WRITE(gmesa->buf, WaitForCompletion, 0); - FLUSH_DMA_BUFFER(gmesa); - - switch (t->image[level].internalFormat) { - case GL_RGB: - case 3: - { - GLubyte *src = (GLubyte *)image->Data; - - if (level == 0) - t->TextureFormat |= TF_Compnents_3; - -#if 0 /* This is the texture download code we SHOULD be using */ - /* In the routines below, but this causes an DMA overrun - WHY ? */ - while (offset < words) { - int count = gmesa->bufSize; - int i; - count -= 3; - if (count > words-offset) count = words-offset; - - gmesa->buf->i = GlintTextureDownloadOffsetTag; - gmesa->buf++; - gmesa->buf->i = offset; - gmesa->buf++; - gmesa->buf->i = (GlintTextureDataTag | ((count-1) << 16)); - gmesa->buf++; - - for (i = 0; i < count; i++) { - gmesa->buf->i = PACK_COLOR_565(src[0],src[1],src[2]); - gmesa->buf++; - src += 3; - } - - gmesa->bufCount = count+3; /* texture data + 3 values */ - offset += count; - - FLUSH_DMA_BUFFER(gmesa); - } -#else - /* The UGLY way, and SLOW !, but the above sometimes causes - * a DMA overrun error ??? FIXME ! */ - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureDownloadOffset, 0); - for (i = 0; i < words; i++) { - unsigned int data; - data = PACK_COLOR_565(src[0],src[1],src[2]); - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureData, data); - src += 3; - } - FLUSH_DMA_BUFFER(gmesa); -#endif - } - break; - - case GL_RGBA: - case 4: - { - GLubyte *src = (GLubyte *)image->Data; - - if (level == 0) - t->TextureFormat |= TF_Compnents_4; - - /* The UGLY way, and SLOW !, but the above sometimes causes - * a DMA overrun error ??? FIXME ! */ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureDownloadOffset, 0); - for (i = 0; i < words; i++) { - unsigned int data; - data = PACK_COLOR_8888(src[0],src[1],src[2],src[3]); - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureData, data); - src += 4; - } - FLUSH_DMA_BUFFER(gmesa); - } - break; - - case GL_LUMINANCE: - { - GLubyte *src = (GLubyte *)image->Data; - - if (level == 0) - t->TextureFormat |= TF_Compnents_1 | TF_OneCompFmt_Lum; - - /* The UGLY way, and SLOW !, but the above sometimes causes - * a DMA overrun error ??? FIXME ! */ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureDownloadOffset, 0); - for (i = 0; i < words; i++) { - unsigned int data; - data = PACK_COLOR_888(src[0],src[0],src[0]); - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureData, data); - src ++; - } - FLUSH_DMA_BUFFER(gmesa); - } - break; - - case GL_INTENSITY: - { - GLubyte *src = (GLubyte *)image->Data; - - if (level == 0) - t->TextureFormat |= TF_Compnents_1 | TF_OneCompFmt_Intensity; - - /* The UGLY way, and SLOW !, but the above sometimes causes - * a DMA overrun error ??? FIXME ! */ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureDownloadOffset, 0); - for (i = 0; i < words; i++) { - unsigned int data; - data = PACK_COLOR_8888(src[0],src[0],src[0],src[0]); - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureData, data); - src ++; - } - FLUSH_DMA_BUFFER(gmesa); - } - break; - - case GL_LUMINANCE_ALPHA: - { - GLubyte *src = (GLubyte *)image->Data; - - if (level == 0) - t->TextureFormat |= TF_Compnents_2; - - /* The UGLY way, and SLOW !, but the above sometimes causes - * a DMA overrun error ??? FIXME ! */ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureDownloadOffset, 0); - for (i = 0; i < words; i++) { - unsigned int data; - data = PACK_COLOR_8888(src[0],src[0],src[0],src[1]); - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureData, data); - src += 2; - } - FLUSH_DMA_BUFFER(gmesa); - } - break; - - case GL_ALPHA: - { - GLubyte *src = (GLubyte *)image->Data; - - if (level == 0) - t->TextureFormat |= TF_Compnents_1 | TF_OneCompFmt_Alpha; - - /* The UGLY way, and SLOW !, but the above sometimes causes - * a DMA overrun error ??? FIXME ! */ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureDownloadOffset, 0); - for (i = 0; i < words; i++) { - unsigned int data; - data = PACK_COLOR_8888(255,255,255,src[0]); - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, TextureData, data); - src += 1; - } - FLUSH_DMA_BUFFER(gmesa); - } - break; - - /* TODO: Translate color indices *now*: - */ - case GL_COLOR_INDEX: - { - GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = src[0]; - src += 1; - } - } - } - break; - - default: - fprintf(stderr, "Not supported texture format %s\n", - _mesa_lookup_enum_by_nr(image->Format)); - } - - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, WaitForCompletion, 0); - WRITE(gmesa->buf, LBWindowBase, gmesa->LBWindowBase); -} - -void gammaPrintLocalLRU( gammaContextPtr gmesa ) -{ - gammaTextureObjectPtr t; - int sz = 1 << (gmesa->gammaScreen->logTextureGranularity); - - foreach( t, &gmesa->TexObjList ) { - if (!t->globj) - fprintf(stderr, "Placeholder %d at %x sz %x\n", - t->MemBlock->ofs / sz, - t->MemBlock->ofs, - t->MemBlock->size); - else - fprintf(stderr, "Texture at %x sz %x\n", - t->MemBlock->ofs, - t->MemBlock->size); - - } -} - -void gammaPrintGlobalLRU( gammaContextPtr gmesa ) -{ - int i, j; - GAMMATextureRegionPtr list = gmesa->sarea->texList; - - for (i = 0, j = GAMMA_NR_TEX_REGIONS ; i < GAMMA_NR_TEX_REGIONS ; i++) { - fprintf(stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev); - j = list[j].next; - if (j == GAMMA_NR_TEX_REGIONS) break; - } - - if (j != GAMMA_NR_TEX_REGIONS) - fprintf(stderr, "Loop detected in global LRU\n"); -} - - -void gammaResetGlobalLRU( gammaContextPtr gmesa ) -{ - GAMMATextureRegionPtr list = gmesa->sarea->texList; - int sz = 1 << gmesa->gammaScreen->logTextureGranularity; - int i; - - /* (Re)initialize the global circular LRU list. The last element - * in the array (GAMMA_NR_TEX_REGIONS) is the sentinal. Keeping it - * at the end of the array allows it to be addressed rationally - * when looking up objects at a particular location in texture - * memory. - */ - for (i = 0 ; (i+1) * sz <= gmesa->gammaScreen->textureSize ; i++) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = GAMMA_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = GAMMA_NR_TEX_REGIONS; - list[GAMMA_NR_TEX_REGIONS].prev = i; - list[GAMMA_NR_TEX_REGIONS].next = 0; - gmesa->sarea->texAge = 0; -} - - -void gammaUpdateTexLRU( gammaContextPtr gmesa, gammaTextureObjectPtr t ) -{ - int i; - int logsz = gmesa->gammaScreen->logTextureGranularity; - int start = t->MemBlock->ofs >> logsz; - int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz; - GAMMATextureRegionPtr list = gmesa->sarea->texList; - - gmesa->texAge = ++gmesa->sarea->texAge; - - /* Update our local LRU - */ - move_to_head( &(gmesa->TexObjList), t ); - - /* Update the global LRU - */ - for (i = start ; i <= end ; i++) { - - list[i].in_use = 1; - list[i].age = gmesa->texAge; - - /* remove_from_list(i) - */ - list[(unsigned)list[i].next].prev = list[i].prev; - list[(unsigned)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) - */ - list[i].prev = GAMMA_NR_TEX_REGIONS; - list[i].next = list[GAMMA_NR_TEX_REGIONS].next; - list[(unsigned)list[GAMMA_NR_TEX_REGIONS].next].prev = i; - list[GAMMA_NR_TEX_REGIONS].next = i; - } -} - - -/* Called for every shared texture region which has increased in age - * since we last held the lock. - * - * Figures out which of our textures have been ejected by other clients, - * and pushes a placeholder texture onto the LRU list to represent - * the other client's textures. - */ -void gammaTexturesGone( gammaContextPtr gmesa, - GLuint offset, - GLuint size, - GLuint in_use ) -{ - gammaTextureObjectPtr t, tmp; - - foreach_s ( t, tmp, &gmesa->TexObjList ) { - - if (t->MemBlock->ofs >= offset + size || - t->MemBlock->ofs + t->MemBlock->size <= offset) - continue; - - /* It overlaps - kick it off. Need to hold onto the currently bound - * objects, however. - */ - gammaSwapOutTexObj( gmesa, t ); - } - - if (in_use) { - t = (gammaTextureObjectPtr) calloc(1,sizeof(*t)); - if (!t) return; - - t->MemBlock = mmAllocMem( gmesa->texHeap, size, 0, offset); - insert_at_head( &gmesa->TexObjList, t ); - } - - /* Reload any lost textures referenced by current vertex buffer. - */ -#if 0 - if (gmesa->vertex_buffer) { - int i, j; - - fprintf(stderr, "\n\nreload tex\n"); - - for (i = 0 ; i < gmesa->statenr ; i++) { - for (j = 0 ; j < 2 ; j++) { - gammaTextureObjectPtr t = gmesa->state_tex[j][i]; - if (t) { - if (t->MemBlock == 0) - gammaUploadTexImages( gmesa, t ); - } - } - } - - /* Hard to do this with the lock held: - */ -/* GAMMA_FIREVERTICES( gmesa ); */ - } -#endif -} - - - - - -/* This is called with the lock held. May have to eject our own and/or - * other client's texture objects to make room for the upload. - */ -void gammaUploadTexImages( gammaContextPtr gmesa, gammaTextureObjectPtr t ) -{ - int i; - int ofs; - int numLevels; - - /* /fprintf(stderr, "%s\n", __FUNCTION__); */ -#if 0 - LOCK_HARDWARE( gmesa ); -#endif - - /* Do we need to eject LRU texture objects? - */ - if (!t->MemBlock) { - while (1) - { - t->MemBlock = mmAllocMem( gmesa->texHeap, t->totalSize, 12, 0 ); - if (t->MemBlock) - break; - - if (gmesa->TexObjList.prev == gmesa->CurrentTexObj[0] || - gmesa->TexObjList.prev == gmesa->CurrentTexObj[1]) { - fprintf(stderr, "Hit bound texture in upload\n"); - gammaPrintLocalLRU( gmesa ); - return; - } - - if (gmesa->TexObjList.prev == &(gmesa->TexObjList)) { - fprintf(stderr, "Failed to upload texture, sz %d\n", t->totalSize); - mmDumpMemInfo( gmesa->texHeap ); - return; - } - - gammaSwapOutTexObj( gmesa, gmesa->TexObjList.prev ); - } - - ofs = t->MemBlock->ofs; - t->BufAddr = (char *)(unsigned long)(gmesa->LBWindowBase + ofs); /* ??? */ - - if (t == gmesa->CurrentTexObj[0]) - gmesa->dirty |= GAMMA_UPLOAD_TEX0; - -#if 0 - if (t == gmesa->CurrentTexObj[1]) - gmesa->dirty |= GAMMA_UPLOAD_TEX1; -#endif - - gammaUpdateTexLRU( gmesa, t ); - } - -#if 0 - if (gmesa->dirtyAge >= GET_DISPATCH_AGE(gmesa)) - gammaWaitAgeLocked( gmesa, gmesa->dirtyAge ); -#endif - - numLevels = t->lastLevel - t->firstLevel + 1; - for (i = 0 ; i < numLevels ; i++) - if (t->dirty_images & (1<dirty_images = 0; - -#if 0 - UNLOCK_HARDWARE( gmesa ); -#endif -} diff --git a/src/mesa/drivers/dri/gamma/gamma_texstate.c b/src/mesa/drivers/dri/gamma/gamma_texstate.c deleted file mode 100644 index 46f39135dc..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_texstate.c +++ /dev/null @@ -1,215 +0,0 @@ - -#include -#include - -#include "main/glheader.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" - -#include "main/mm.h" -#include "gamma_context.h" - -static void gammaSetTexImages( gammaContextPtr gmesa, - struct gl_texture_object *tObj ) -{ - GLuint height, width, pitch, i, log_pitch; - gammaTextureObjectPtr t = (gammaTextureObjectPtr) tObj->DriverData; - const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel]; - GLint firstLevel, lastLevel, numLevels; - GLint log2Width, log2Height; - - /* fprintf(stderr, "%s\n", __FUNCTION__); */ - - t->texelBytes = 2; - - /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. - */ - if (tObj->MinFilter == GL_LINEAR || tObj->MinFilter == GL_NEAREST) { - firstLevel = lastLevel = tObj->BaseLevel; - } - else { - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - } - - /* save these values */ - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; - - numLevels = lastLevel - firstLevel + 1; - - log2Width = tObj->Image[0][firstLevel]->WidthLog2; - log2Height = tObj->Image[0][firstLevel]->HeightLog2; - - - /* Figure out the amount of memory required to hold all the mipmap - * levels. Choose the smallest pitch to accomodate the largest - * mipmap: - */ - width = tObj->Image[0][firstLevel]->Width * t->texelBytes; - for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 ) - log_pitch++; - - /* All images must be loaded at this pitch. Count the number of - * lines required: - */ - for ( height = i = 0 ; i < numLevels ; i++ ) { - t->image[i].image = tObj->Image[0][firstLevel + i]; - t->image[i].offset = height * pitch; - t->image[i].internalFormat = baseImage->Format; - height += t->image[i].image->Height; - t->TextureBaseAddr[i] = /* ??? */ - (unsigned long)(t->image[i].offset + t->BufAddr) << 5; - - } - - t->Pitch = pitch; - t->totalSize = height*pitch; - t->max_level = i-1; - gmesa->dirty |= GAMMA_UPLOAD_TEX0 /* | GAMMA_UPLOAD_TEX1*/; - - gammaUploadTexImages( gmesa, t ); -} - -static void gammaUpdateTexEnv( GLcontext *ctx, GLuint unit ) -{ - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *tObj = texUnit->_Current; - const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format; - gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData; - GLuint tc; - - /* fprintf(stderr, "%s\n", __FUNCTION__); */ - - tc = t->TextureColorMode & ~(TCM_BaseFormatMask | TCM_ApplicationMask); - - switch (format) { - case GL_RGB: - tc |= TCM_BaseFormat_RGB; - break; - case GL_LUMINANCE: - tc |= TCM_BaseFormat_Lum; - break; - case GL_ALPHA: - tc |= TCM_BaseFormat_Alpha; - break; - case GL_LUMINANCE_ALPHA: - tc |= TCM_BaseFormat_LumAlpha; - break; - case GL_INTENSITY: - tc |= TCM_BaseFormat_Intensity; - break; - case GL_RGBA: - tc |= TCM_BaseFormat_RGBA; - break; - case GL_COLOR_INDEX: - break; - } - - switch (texUnit->EnvMode) { - case GL_REPLACE: - tc |= TCM_Replace; - break; - case GL_MODULATE: - tc |= TCM_Modulate; - break; - case GL_ADD: - /* do nothing ???*/ - break; - case GL_DECAL: - tc |= TCM_Decal; - break; - case GL_BLEND: - tc |= TCM_Blend; - break; - default: - fprintf(stderr, "unknown tex env mode"); - return; - } - - t->TextureColorMode = tc; -} - - - - -static void gammaUpdateTexUnit( GLcontext *ctx, GLuint unit ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - - /* fprintf(stderr, "%s\n", __FUNCTION__); */ - - if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) - { - struct gl_texture_object *tObj = texUnit->_Current; - gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData; - - /* Upload teximages (not pipelined) - */ - if (t->dirty_images) { - gammaSetTexImages( gmesa, tObj ); - if (!t->MemBlock) { - FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE ); - return; - } - } - -#if 0 - if (tObj->Image[0][tObj->BaseLevel]->Border > 0) { - FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE ); - return; - } -#endif - - /* Update state if this is a different texture object to last - * time. - */ - if (gmesa->CurrentTexObj[unit] != t) { - gmesa->dirty |= GAMMA_UPLOAD_TEX0 /* << unit */; - gmesa->CurrentTexObj[unit] = t; - gammaUpdateTexLRU( gmesa, t ); /* done too often */ - } - - /* Update texture environment if texture object image format or - * texture environment state has changed. - */ - if (tObj->Image[0][tObj->BaseLevel]->Format != gmesa->TexEnvImageFmt[unit]) { - gmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format; - gammaUpdateTexEnv( ctx, unit ); - } - } - else if (texUnit->_ReallyEnabled) { - FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE ); - } - else /*if (gmesa->CurrentTexObj[unit])*/ { - gmesa->CurrentTexObj[unit] = 0; - gmesa->TexEnvImageFmt[unit] = 0; - gmesa->dirty &= ~(GAMMA_UPLOAD_TEX0< - * Keith Whitwell, - * - * 3DLabs Gamma driver. - */ - -#include "gamma_context.h" -#include "gamma_macros.h" -#include "gamma_vb.h" -#include "gamma_tris.h" - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - - -/*********************************************************************** - * Build hardware rasterization functions * - ***********************************************************************/ - -#define GAMMA_RAST_ALPHA_BIT 0x01 -#define GAMMA_RAST_TEX_BIT 0x02 -#define GAMMA_RAST_FLAT_BIT 0x04 - -static gamma_point_func gamma_point_tab[0x8]; -static gamma_line_func gamma_line_tab[0x8]; -static gamma_tri_func gamma_tri_tab[0x8]; -static gamma_quad_func gamma_quad_tab[0x8]; - -#define IND (0) -#define TAG(x) x -#include "gamma_tritmp.h" - -#define IND (GAMMA_RAST_ALPHA_BIT) -#define TAG(x) x##_alpha -#include "gamma_tritmp.h" - -#define IND (GAMMA_RAST_TEX_BIT) -#define TAG(x) x##_tex -#include "gamma_tritmp.h" - -#define IND (GAMMA_RAST_ALPHA_BIT|GAMMA_RAST_TEX_BIT) -#define TAG(x) x##_alpha_tex -#include "gamma_tritmp.h" - -#define IND (GAMMA_RAST_FLAT_BIT) -#define TAG(x) x##_flat -#include "gamma_tritmp.h" - -#define IND (GAMMA_RAST_ALPHA_BIT|GAMMA_RAST_FLAT_BIT) -#define TAG(x) x##_alpha_flat -#include "gamma_tritmp.h" - -#define IND (GAMMA_RAST_TEX_BIT|GAMMA_RAST_FLAT_BIT) -#define TAG(x) x##_tex_flat -#include "gamma_tritmp.h" - -#define IND (GAMMA_RAST_ALPHA_BIT|GAMMA_RAST_TEX_BIT|GAMMA_RAST_FLAT_BIT) -#define TAG(x) x##_alpha_tex_flat -#include "gamma_tritmp.h" - - -static void init_rast_tab( void ) -{ - gamma_init(); - gamma_init_alpha(); - gamma_init_tex(); - gamma_init_alpha_tex(); - gamma_init_flat(); - gamma_init_alpha_flat(); - gamma_init_tex_flat(); - gamma_init_alpha_tex_flat(); -} - -/*********************************************************************** - * Rasterization fallback helpers * - ***********************************************************************/ - - -/* This code is hit only when a mix of accelerated and unaccelerated - * primitives are being drawn, and only for the unaccelerated - * primitives. - */ -static void -gamma_fallback_quad( gammaContextPtr gmesa, - const gammaVertex *v0, - const gammaVertex *v1, - const gammaVertex *v2, - const gammaVertex *v3 ) -{ - GLcontext *ctx = gmesa->glCtx; - SWvertex v[4]; - gamma_translate_vertex( ctx, v0, &v[0] ); - gamma_translate_vertex( ctx, v1, &v[1] ); - gamma_translate_vertex( ctx, v2, &v[2] ); - gamma_translate_vertex( ctx, v3, &v[3] ); - _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] ); -} - -static void -gamma_fallback_tri( gammaContextPtr gmesa, - const gammaVertex *v0, - const gammaVertex *v1, - const gammaVertex *v2 ) -{ - GLcontext *ctx = gmesa->glCtx; - SWvertex v[3]; - gamma_translate_vertex( ctx, v0, &v[0] ); - gamma_translate_vertex( ctx, v1, &v[1] ); - gamma_translate_vertex( ctx, v2, &v[2] ); - _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); -} - -static void -gamma_fallback_line( gammaContextPtr gmesa, - const gammaVertex *v0, - const gammaVertex *v1 ) -{ - GLcontext *ctx = gmesa->glCtx; - SWvertex v[2]; - gamma_translate_vertex( ctx, v0, &v[0] ); - gamma_translate_vertex( ctx, v1, &v[1] ); - _swrast_Line( ctx, &v[0], &v[1] ); -} - - -#if 0 -static void -gamma_fallback_point( gammaContextPtr gmesa, - const gammaVertex *v0 ) -{ - GLcontext *ctx = gmesa->glCtx; - SWvertex v[1]; - gamma_translate_vertex( ctx, v0, &v[0] ); - _swrast_Point( ctx, &v[0] ); -} -#endif - - -/*********************************************************************** - * Choose rasterization functions * - ***********************************************************************/ - -#define _GAMMA_NEW_RASTER_STATE (_NEW_FOG | \ - _NEW_TEXTURE | \ - _DD_NEW_TRI_SMOOTH | \ - _DD_NEW_LINE_SMOOTH | \ - _DD_NEW_POINT_SMOOTH | \ - _DD_NEW_TRI_STIPPLE | \ - _DD_NEW_LINE_STIPPLE) - -#define LINE_FALLBACK (0) -#define TRI_FALLBACK (0) - -static void gammaChooseRasterState(GLcontext *ctx) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint ind = 0; - - if ( ctx->Line.SmoothFlag || - ctx->Polygon.SmoothFlag || - ctx->Point.SmoothFlag ) - gmesa->Begin |= B_AntiAliasEnable; - else - gmesa->Begin &= ~B_AntiAliasEnable; - - if ( ctx->Texture.Unit[0]._ReallyEnabled ) { - ind |= GAMMA_RAST_TEX_BIT; - gmesa->Begin |= B_TextureEnable; - } else - gmesa->Begin &= ~B_TextureEnable; - - if (flags & DD_LINE_STIPPLE) - gmesa->Begin |= B_LineStippleEnable; - else - gmesa->Begin &= ~B_LineStippleEnable; - - if (flags & DD_TRI_STIPPLE) - gmesa->Begin |= B_AreaStippleEnable; - else - gmesa->Begin &= ~B_AreaStippleEnable; - - if (ctx->Fog.Enabled) - gmesa->Begin |= B_FogEnable; - else - gmesa->Begin &= ~B_FogEnable; - - if (ctx->Color.BlendEnabled || ctx->Color.AlphaEnabled) - ind |= GAMMA_RAST_ALPHA_BIT; - - if ( flags & DD_FLATSHADE ) - ind |= GAMMA_RAST_FLAT_BIT; - - gmesa->draw_line = gamma_line_tab[ind]; - gmesa->draw_tri = gamma_tri_tab[ind]; - gmesa->draw_quad = gamma_quad_tab[ind]; - gmesa->draw_point = gamma_point_tab[ind]; - - /* Hook in fallbacks for specific primitives. CURRENTLY DISABLED - */ - if (flags & LINE_FALLBACK) - gmesa->draw_line = gamma_fallback_line; - - if (flags & TRI_FALLBACK) { - gmesa->draw_tri = gamma_fallback_tri; - gmesa->draw_quad = gamma_fallback_quad; - } -} - - - - -/*********************************************************************** - * Macros for t_dd_tritmp.h to draw basic primitives * - ***********************************************************************/ - -#define TRI( a, b, c ) \ -do { \ - gmesa->draw_tri( gmesa, a, b, c ); \ -} while (0) - -#define QUAD( a, b, c, d ) \ -do { \ - gmesa->draw_quad( gmesa, a, b, c, d ); \ -} while (0) - -#define LINE( v0, v1 ) \ -do { \ - gmesa->draw_line( gmesa, v0, v1 ); \ -} while (0) - -#define POINT( v0 ) \ -do { \ - gmesa->draw_point( gmesa, v0 ); \ -} while (0) - - -/*********************************************************************** - * Build render functions from dd templates * - ***********************************************************************/ - -#define GAMMA_OFFSET_BIT 0x01 -#define GAMMA_TWOSIDE_BIT 0x02 -#define GAMMA_UNFILLED_BIT 0x04 -#define GAMMA_FALLBACK_BIT 0x08 -#define GAMMA_MAX_TRIFUNC 0x10 - - -static struct { - tnl_points_func points; - tnl_line_func line; - tnl_triangle_func triangle; - tnl_quad_func quad; -} rast_tab[GAMMA_MAX_TRIFUNC]; - - -#define DO_FALLBACK (IND & GAMMA_FALLBACK_BIT) -#define DO_OFFSET 0 /* (IND & GAMMA_OFFSET_BIT) */ -#define DO_UNFILLED 0 /* (IND & GAMMA_UNFILLED_BIT) */ -#define DO_TWOSIDE (IND & GAMMA_TWOSIDE_BIT) -#define DO_FLAT 0 -#define DO_TRI 1 -#define DO_QUAD 1 -#define DO_LINE 1 -#define DO_POINTS 1 -#define DO_FULL_QUAD 1 - -#define HAVE_RGBA 1 -#define HAVE_SPEC 0 -#define HAVE_BACK_COLORS 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX gammaVertex -#define TAB rast_tab - -#define DEPTH_SCALE 1.0 -#define UNFILLED_TRI unfilled_tri -#define UNFILLED_QUAD unfilled_quad -#define VERT_X(_v) _v->v.x -#define VERT_Y(_v) _v->v.y -#define VERT_Z(_v) _v->v.z -#define AREA_IS_CCW( a ) (a > 0) -#define GET_VERTEX(e) (gmesa->verts + (e * gmesa->vertex_size * sizeof(int))) - -#define VERT_SET_RGBA( v, c ) \ -do { \ - UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][0], (c)[0]); \ - UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][1], (c)[1]); \ - UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][2], (c)[2]); \ - UNCLAMPED_FLOAT_TO_UBYTE(v->ub4[4][3], (c)[3]); \ -} while (0) -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4] -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx] - -#define LOCAL_VARS(n) \ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \ - GLuint color[n] = { 0 }; \ - (void) color; - - -/*********************************************************************** - * Helpers for rendering unfilled primitives * - ***********************************************************************/ - -static const GLuint hw_prim[GL_POLYGON+1] = { - B_PrimType_Points, - B_PrimType_Lines, - B_PrimType_Lines, - B_PrimType_Lines, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles -}; - -static void gammaResetLineStipple( GLcontext *ctx ); -static void gammaRasterPrimitive( GLcontext *ctx, GLuint hwprim ); -static void gammaRenderPrimitive( GLcontext *ctx, GLenum prim ); - -#define RASTERIZE(x) if (gmesa->hw_primitive != hw_prim[x]) \ - gammaRasterPrimitive( ctx, hw_prim[x] ) -#define RENDER_PRIMITIVE gmesa->render_primitive -#define TAG(x) x -#define IND GAMMA_FALLBACK_BIT -#include "tnl_dd/t_dd_unfilled.h" -#undef IND - -/*********************************************************************** - * Generate GL render functions * - ***********************************************************************/ - -#define IND (0) -#define TAG(x) x -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (GAMMA_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (GAMMA_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (GAMMA_TWOSIDE_BIT|GAMMA_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (GAMMA_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (GAMMA_OFFSET_BIT|GAMMA_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (GAMMA_TWOSIDE_BIT|GAMMA_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (GAMMA_TWOSIDE_BIT|GAMMA_OFFSET_BIT|GAMMA_UNFILLED_BIT) -#define TAG(x) x##_twoside_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - - - -static void init_render_tab( void ) -{ - init(); - init_offset(); - init_twoside(); - init_twoside_offset(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_twoside_offset_unfilled(); -} - - -/**********************************************************************/ -/* Render unclipped begin/end objects */ -/**********************************************************************/ - -#define VERT(x) (gammaVertex *)(gammaverts + (x * size * sizeof(int))) -#define RENDER_POINTS( start, count ) \ - for ( ; start < count ; start++) \ - gmesa->draw_point( gmesa, VERT(start) ) -#define RENDER_LINE( v0, v1 ) \ - gmesa->draw_line( gmesa, VERT(v0), VERT(v1) ) -#define RENDER_TRI( v0, v1, v2 ) \ - gmesa->draw_tri( gmesa, VERT(v0), VERT(v1), VERT(v2) ) -#define RENDER_QUAD( v0, v1, v2, v3 ) \ - gmesa->draw_quad( gmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) -#define INIT(x) gammaRenderPrimitive( ctx, x ); -#undef LOCAL_VARS -#define LOCAL_VARS \ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \ - const GLuint size = gmesa->vertex_size; \ - const char *gammaverts = (char *)gmesa->verts; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) stipple; -#define RESET_STIPPLE if ( stipple ) gammaResetLineStipple( ctx ); -#define RESET_OCCLUSION -#define PRESERVE_VB_DEFS -#define ELT(x) (x) -#define TAG(x) gamma_##x##_verts -#include "tnl/t_vb_rendertmp.h" - - -/**********************************************************************/ -/* Render clipped primitives */ -/**********************************************************************/ - -static void gammaRenderClippedPoly( GLcontext *ctx, const GLuint *elts, - GLuint n ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint prim = gmesa->render_primitive; - - /* Render the new vertices as an unclipped polygon. - */ - { - GLuint *tmp = VB->Elts; - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; - } - - /* Restore the render primitive - */ - if (prim != GL_POLYGON) - tnl->Driver.Render.PrimitiveNotify( ctx, prim ); -} - -static void gammaRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line( ctx, ii, jj ); -} - - -/**********************************************************************/ -/* Choose render functions */ -/**********************************************************************/ - - - -#define _GAMMA_NEW_RENDERSTATE (_DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE | \ - _DD_NEW_TRI_OFFSET) - -#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) - -static void gammaChooseRenderState(GLcontext *ctx) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint index = 0; - - if (flags & ANY_RASTER_FLAGS) { - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= GAMMA_TWOSIDE_BIT; - if (flags & DD_TRI_OFFSET) index |= GAMMA_OFFSET_BIT; - if (flags & DD_TRI_UNFILLED) index |= GAMMA_UNFILLED_BIT; - } - - if (gmesa->RenderIndex != index) { - gmesa->RenderIndex = index; - - tnl->Driver.Render.Points = rast_tab[index].points; - tnl->Driver.Render.Line = rast_tab[index].line; - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (gmesa->RenderIndex == 0) - tnl->Driver.Render.PrimTabVerts = gamma_render_tab_verts; - else - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ClippedLine = gammaRenderClippedLine; - tnl->Driver.Render.ClippedPolygon = gammaRenderClippedPoly; - } -} - - -/**********************************************************************/ -/* High level hooks for t_vb_render.c */ -/**********************************************************************/ - - - -/* Determine the rasterized primitive when not drawing unfilled - * polygons. - * - * Used only for the default render stage which always decomposes - * primitives to trianges/lines/points. For the accelerated stage, - * which renders strips as strips, the equivalent calculations are - * performed in gammarender.c. - */ - -static void gammaRasterPrimitive( GLcontext *ctx, GLuint hwprim ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - if (gmesa->hw_primitive != hwprim) - gmesa->hw_primitive = hwprim; -} - -static void gammaRenderPrimitive( GLcontext *ctx, GLenum prim ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - gmesa->render_primitive = prim; -} - -static void gammaRunPipeline( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - if ( gmesa->new_state ) - gammaDDUpdateHWState( ctx ); - - if (gmesa->new_gl_state) { - if (gmesa->new_gl_state & _NEW_TEXTURE) - gammaUpdateTextureState( ctx ); - - if (!gmesa->Fallback) { - if (gmesa->new_gl_state & _GAMMA_NEW_VERTEX) - gammaChooseVertexState( ctx ); - - if (gmesa->new_gl_state & _GAMMA_NEW_RASTER_STATE) - gammaChooseRasterState( ctx ); - - if (gmesa->new_gl_state & _GAMMA_NEW_RENDERSTATE) - gammaChooseRenderState( ctx ); - } - - gmesa->new_gl_state = 0; - } - - _tnl_run_pipeline( ctx ); -} - -static void gammaRenderStart( GLcontext *ctx ) -{ - /* Check for projective texturing. Make sure all texcoord - * pointers point to something. (fix in mesa?) - */ - gammaCheckTexSizes( ctx ); -} - -static void gammaRenderFinish( GLcontext *ctx ) -{ - if (0) - _swrast_flush( ctx ); /* never needed */ -} - -static void gammaResetLineStipple( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - - /* Reset the hardware stipple counter. - */ - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, UpdateLineStippleCounters, 0); -} - - -/**********************************************************************/ -/* Transition to/from hardware rasterization. */ -/**********************************************************************/ - - -void gammaFallback( gammaContextPtr gmesa, GLuint bit, GLboolean mode ) -{ - GLcontext *ctx = gmesa->glCtx; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = gmesa->Fallback; - - if (mode) { - gmesa->Fallback |= bit; - if (oldfallback == 0) { - _swsetup_Wakeup( ctx ); - _tnl_need_projected_coords( ctx, GL_TRUE ); - gmesa->RenderIndex = ~0; - } - } - else { - gmesa->Fallback &= ~bit; - if (oldfallback == bit) { - _swrast_flush( ctx ); - tnl->Driver.Render.Start = gammaRenderStart; - tnl->Driver.Render.PrimitiveNotify = gammaRenderPrimitive; - tnl->Driver.Render.Finish = gammaRenderFinish; - tnl->Driver.Render.BuildVertices = gammaBuildVertices; - tnl->Driver.Render.ResetLineStipple = gammaResetLineStipple; - gmesa->new_gl_state |= (_GAMMA_NEW_RENDERSTATE| - _GAMMA_NEW_RASTER_STATE| - _GAMMA_NEW_VERTEX); - } - } -} - - -/**********************************************************************/ -/* Initialization. */ -/**********************************************************************/ - - -void gammaDDInitTriFuncs( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - static int firsttime = 1; - - if (firsttime) { - init_rast_tab(); - init_render_tab(); - firsttime = 0; - } - - gmesa->RenderIndex = ~0; - - tnl->Driver.RunPipeline = gammaRunPipeline; - tnl->Driver.Render.Start = gammaRenderStart; - tnl->Driver.Render.Finish = gammaRenderFinish; - tnl->Driver.Render.PrimitiveNotify = gammaRenderPrimitive; - tnl->Driver.Render.ResetLineStipple = gammaResetLineStipple; - tnl->Driver.Render.BuildVertices = gammaBuildVertices; -} diff --git a/src/mesa/drivers/dri/gamma/gamma_tris.h b/src/mesa/drivers/dri/gamma/gamma_tris.h deleted file mode 100644 index 02bec28690..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_tris.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * Keith Whitwell, - * - * 3DLabs Gamma driver. - */ - -#ifndef _GAMMA_TRIS_H -#define _GAMMA_TRIS_H - -extern void gammaDDTrifuncInit(void); -extern void gammaDDChooseTriRenderState(GLcontext *); - - - -#endif /* !(_GAMMA_TRIS_H) */ diff --git a/src/mesa/drivers/dri/gamma/gamma_tritmp.h b/src/mesa/drivers/dri/gamma/gamma_tritmp.h deleted file mode 100644 index bea2508d4a..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_tritmp.h +++ /dev/null @@ -1,496 +0,0 @@ - -static void TAG(gamma_point)( gammaContextPtr gmesa, - const gammaVertex *v0 ) -{ - uint32_t vColor; - uint32_t vBegin; - - vBegin = gmesa->Begin | B_PrimType_Points; - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Begin, vBegin); - -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v0->v.color.alpha << 24) | - (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v0->v.u0); - WRITEF(gmesa->buf, Ts2, v0->v.v0); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, FlushSpan, 0); -#endif - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, End, 0); -} - -static void TAG(gamma_line)( gammaContextPtr gmesa, - const gammaVertex *v0, - const gammaVertex *v1 ) -{ - uint32_t vColor; - uint32_t vBegin; - - vBegin = gmesa->Begin | B_PrimType_Lines; - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Begin, vBegin); - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v0->v.color.alpha << 24) | - (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#else -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v1->v.color.alpha << 24) | - (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v0->v.u0); - WRITEF(gmesa->buf, Ts2, v0->v.v0); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v1->v.color.alpha << 24) | - (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v1->v.u0); - WRITEF(gmesa->buf, Ts2, v1->v.v0); - WRITEF(gmesa->buf, Vw, v1->v.w); - WRITEF(gmesa->buf, Vz, v1->v.z); - WRITEF(gmesa->buf, Vy, v1->v.y); - WRITEF(gmesa->buf, Vx4, v1->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v1->v.w); - WRITEF(gmesa->buf, Vz, v1->v.z); - WRITEF(gmesa->buf, Vy, v1->v.y); - WRITEF(gmesa->buf, Vx4, v1->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, FlushSpan, 0); -#endif - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, End, 0); -} - -static void TAG(gamma_triangle)( gammaContextPtr gmesa, - const gammaVertex *v0, - const gammaVertex *v1, - const gammaVertex *v2 ) -{ - uint32_t vColor; - uint32_t vBegin; - - vBegin = gmesa->Begin | B_PrimType_Triangles; - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Begin, vBegin); - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v0->v.color.alpha << 24) | - (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#else -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v2->v.color.alpha << 24) | - (v2->v.color.blue << 16) | - (v2->v.color.green << 8) | - (v2->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v2->v.color.blue << 16) | - (v2->v.color.green << 8) | - (v2->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v0->v.u0); - WRITEF(gmesa->buf, Ts2, v0->v.v0); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v1->v.color.alpha << 24) | - (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v1->v.u0); - WRITEF(gmesa->buf, Ts2, v1->v.v0); - WRITEF(gmesa->buf, Vw, v1->v.w); - WRITEF(gmesa->buf, Vz, v1->v.z); - WRITEF(gmesa->buf, Vy, v1->v.y); - WRITEF(gmesa->buf, Vx4, v1->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v1->v.w); - WRITEF(gmesa->buf, Vz, v1->v.z); - WRITEF(gmesa->buf, Vy, v1->v.y); - WRITEF(gmesa->buf, Vx4, v1->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v2->v.color.alpha << 24) | - (v2->v.color.blue << 16) | - (v2->v.color.green << 8) | - (v2->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v2->v.color.blue << 16) | - (v2->v.color.green << 8) | - (v2->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v2->v.u0); - WRITEF(gmesa->buf, Ts2, v2->v.v0); - WRITEF(gmesa->buf, Vw, v2->v.w); - WRITEF(gmesa->buf, Vz, v2->v.z); - WRITEF(gmesa->buf, Vy, v2->v.y); - WRITEF(gmesa->buf, Vx4, v2->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v2->v.w); - WRITEF(gmesa->buf, Vz, v2->v.z); - WRITEF(gmesa->buf, Vy, v2->v.y); - WRITEF(gmesa->buf, Vx4, v2->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, FlushSpan, 0); -#endif - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, End, 0); -} - -static void TAG(gamma_quad)( gammaContextPtr gmesa, - const gammaVertex *v0, - const gammaVertex *v1, - const gammaVertex *v2, - const gammaVertex *v3 ) -{ - uint32_t vColor; - uint32_t vBegin; - - vBegin = gmesa->Begin | B_PrimType_Quads; - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, Begin, vBegin); - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v0->v.color.alpha << 24) | - (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v0->v.color.blue << 16) | - (v0->v.color.green << 8) | - (v0->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#else -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v3->v.color.alpha << 24) | - (v3->v.color.blue << 16) | - (v3->v.color.green << 8) | - (v3->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v3->v.color.blue << 16) | - (v3->v.color.green << 8) | - (v3->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v0->v.u0); - WRITEF(gmesa->buf, Ts2, v0->v.v0); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v0->v.w); - WRITEF(gmesa->buf, Vz, v0->v.z); - WRITEF(gmesa->buf, Vy, v0->v.y); - WRITEF(gmesa->buf, Vx4, v0->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v1->v.color.alpha << 24) | - (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v1->v.color.blue << 16) | - (v1->v.color.green << 8) | - (v1->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v1->v.u0); - WRITEF(gmesa->buf, Ts2, v1->v.v0); - WRITEF(gmesa->buf, Vw, v1->v.w); - WRITEF(gmesa->buf, Vz, v1->v.z); - WRITEF(gmesa->buf, Vy, v1->v.y); - WRITEF(gmesa->buf, Vx4, v1->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v1->v.w); - WRITEF(gmesa->buf, Vz, v1->v.z); - WRITEF(gmesa->buf, Vy, v1->v.y); - WRITEF(gmesa->buf, Vx4, v1->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v2->v.color.alpha << 24) | - (v2->v.color.blue << 16) | - (v2->v.color.green << 8) | - (v2->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v2->v.color.blue << 16) | - (v2->v.color.green << 8) | - (v2->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v2->v.u0); - WRITEF(gmesa->buf, Ts2, v2->v.v0); - WRITEF(gmesa->buf, Vw, v2->v.w); - WRITEF(gmesa->buf, Vz, v2->v.z); - WRITEF(gmesa->buf, Vy, v2->v.y); - WRITEF(gmesa->buf, Vx4, v2->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v2->v.w); - WRITEF(gmesa->buf, Vz, v2->v.z); - WRITEF(gmesa->buf, Vy, v2->v.y); - WRITEF(gmesa->buf, Vx4, v2->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) -#if (IND & GAMMA_RAST_ALPHA_BIT) - vColor = (v3->v.color.alpha << 24) | - (v3->v.color.blue << 16) | - (v3->v.color.green << 8) | - (v3->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor4, vColor); -#else - vColor = (v3->v.color.blue << 16) | - (v3->v.color.green << 8) | - (v3->v.color.red << 0); - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, PackedColor3, vColor); -#endif -#endif - -#if (IND & GAMMA_RAST_TEX_BIT) - CHECK_DMA_BUFFER(gmesa, 6); - WRITEF(gmesa->buf, Tt2, v3->v.u0); - WRITEF(gmesa->buf, Ts2, v3->v.v0); - WRITEF(gmesa->buf, Vw, v3->v.w); - WRITEF(gmesa->buf, Vz, v3->v.z); - WRITEF(gmesa->buf, Vy, v3->v.y); - WRITEF(gmesa->buf, Vx4, v3->v.x); -#else - CHECK_DMA_BUFFER(gmesa, 4); - WRITEF(gmesa->buf, Vw, v3->v.w); - WRITEF(gmesa->buf, Vz, v3->v.z); - WRITEF(gmesa->buf, Vy, v3->v.y); - WRITEF(gmesa->buf, Vx4, v3->v.x); -#endif - -#if !(IND & GAMMA_RAST_FLAT_BIT) - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, FlushSpan, 0); -#endif - - CHECK_DMA_BUFFER(gmesa, 1); - WRITE(gmesa->buf, End, 0); -} - -static void TAG(gamma_init)(void) -{ - gamma_point_tab[IND] = TAG(gamma_point); - gamma_line_tab[IND] = TAG(gamma_line); - gamma_tri_tab[IND] = TAG(gamma_triangle); - gamma_quad_tab[IND] = TAG(gamma_quad); -} - -#undef IND -#undef TAG diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.c b/src/mesa/drivers/dri/gamma/gamma_vb.c deleted file mode 100644 index c9c1ebf62a..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_vb.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * Keith Whitwell, - * - * 3DLabs Gamma driver. - */ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast_setup/swrast_setup.h" -#include "tnl/t_context.h" -#include "tnl/tnl.h" - -#include "gamma_context.h" -#include "gamma_vb.h" -#include "gamma_tris.h" - - -#define GAMMA_TEX0_BIT 0x1 -#define GAMMA_RGBA_BIT 0x2 -#define GAMMA_XYZW_BIT 0x4 -#define GAMMA_PTEX_BIT 0x8 -#define GAMMA_FOG_BIT 0x10 -#define GAMMA_SPEC_BIT 0x20 -#define GAMMA_MAX_SETUP 0x40 - -static struct { - void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); - tnl_interp_func interp; - tnl_copy_pv_func copy_pv; - GLboolean (*check_tex_sizes)( GLcontext *ctx ); - GLuint vertex_size; - GLuint vertex_format; -} setup_tab[GAMMA_MAX_SETUP]; - -#define TINY_VERTEX_FORMAT 1 -#define NOTEX_VERTEX_FORMAT 2 -#define TEX0_VERTEX_FORMAT 3 -#define TEX1_VERTEX_FORMAT 0 -#define PROJ_TEX1_VERTEX_FORMAT 0 -#define TEX2_VERTEX_FORMAT 0 -#define TEX3_VERTEX_FORMAT 0 -#define PROJ_TEX3_VERTEX_FORMAT 0 - -#define DO_XYZW (IND & GAMMA_XYZW_BIT) -#define DO_RGBA (IND & GAMMA_RGBA_BIT) -#define DO_SPEC (IND & GAMMA_SPEC_BIT) -#define DO_FOG (IND & GAMMA_FOG_BIT) -#define DO_TEX0 (IND & GAMMA_TEX0_BIT) -#define DO_TEX1 0 -#define DO_TEX2 0 -#define DO_TEX3 0 -#define DO_PTEX (IND & GAMMA_PTEX_BIT) - -#define VERTEX gammaVertex -#define VERTEX_COLOR gamma_color_t -#define GET_VIEWPORT_MAT() 0 -#define GET_TEXSOURCE(n) n -#define GET_VERTEX_FORMAT() GAMMA_CONTEXT(ctx)->vertex_format -#define GET_VERTEX_STORE() GAMMA_CONTEXT(ctx)->verts -#define GET_VERTEX_SIZE() GAMMA_CONTEXT(ctx)->vertex_size * sizeof(GLuint) -#define INVALIDATE_STORED_VERTICES() - -#define HAVE_HW_VIEWPORT 1 -#define HAVE_HW_DIVIDE 1 -#define HAVE_RGBA_COLOR 0 /* we're BGRA */ -#define HAVE_TINY_VERTICES 1 -#define HAVE_NOTEX_VERTICES 1 -#define HAVE_TEX0_VERTICES 1 -#define HAVE_TEX1_VERTICES 0 -#define HAVE_TEX2_VERTICES 0 -#define HAVE_TEX3_VERTICES 0 -#define HAVE_PTEX_VERTICES 1 - -#define PTEX_FALLBACK() /* never needed */ - -#define INTERP_VERTEX setup_tab[GAMMA_CONTEXT(ctx)->SetupIndex].interp -#define COPY_PV_VERTEX setup_tab[GAMMA_CONTEXT(ctx)->SetupIndex].copy_pv - - - -/*********************************************************************** - * Generate pv-copying and translation functions * - ***********************************************************************/ - -#define TAG(x) gamma_##x -#include "tnl_dd/t_dd_vb.c" - -/*********************************************************************** - * Generate vertex emit and interp functions * - ***********************************************************************/ - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT) -#define TAG(x) x##_wg -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT) -#define TAG(x) x##_wgs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_wgt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_TEX0_BIT|GAMMA_PTEX_BIT) -#define TAG(x) x##_wgpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_wgst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT|\ - GAMMA_PTEX_BIT) -#define TAG(x) x##_wgspt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT) -#define TAG(x) x##_wgf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT) -#define TAG(x) x##_wgfs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_wgft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT|\ - GAMMA_PTEX_BIT) -#define TAG(x) x##_wgfpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|\ - GAMMA_TEX0_BIT) -#define TAG(x) x##_wgfst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_XYZW_BIT|GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|\ - GAMMA_TEX0_BIT|GAMMA_PTEX_BIT) -#define TAG(x) x##_wgfspt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_TEX0_BIT) -#define TAG(x) x##_t0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_FOG_BIT) -#define TAG(x) x##_f -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_FOG_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_ft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT) -#define TAG(x) x##_g -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT|GAMMA_SPEC_BIT) -#define TAG(x) x##_gs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_gt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_gst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT) -#define TAG(x) x##_gf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT) -#define TAG(x) x##_gfs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_gft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (GAMMA_RGBA_BIT|GAMMA_FOG_BIT|GAMMA_SPEC_BIT|GAMMA_TEX0_BIT) -#define TAG(x) x##_gfst0 -#include "tnl_dd/t_dd_vbtmp.h" - -static void init_setup_tab( void ) -{ - init_wg(); - init_wgs(); - init_wgt0(); - init_wgpt0(); - init_wgst0(); - init_wgspt0(); - init_wgf(); - init_wgfs(); - init_wgft0(); - init_wgfpt0(); - init_wgfst0(); - init_wgfspt0(); - init_t0(); - init_f(); - init_ft0(); - init_g(); - init_gs(); - init_gt0(); - init_gst0(); - init_gf(); - init_gfs(); - init_gft0(); - init_gfst0(); -} - -void gammaCheckTexSizes( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - gammaContextPtr gmesa = GAMMA_CONTEXT( ctx ); - - if (!setup_tab[gmesa->SetupIndex].check_tex_sizes(ctx)) { - /* Invalidate stored verts - */ - gmesa->SetupNewInputs = ~0; - gmesa->SetupIndex |= GAMMA_PTEX_BIT; - - if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - tnl->Driver.Render.Interp = setup_tab[gmesa->SetupIndex].interp; - tnl->Driver.Render.CopyPV = setup_tab[gmesa->SetupIndex].copy_pv; - } - } -} - -void gammaBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT( ctx ); - GLuint stride = gmesa->vertex_size * sizeof(int); - GLubyte *v = ((GLubyte *)gmesa->verts + (start * stride)); - - newinputs |= gmesa->SetupNewInputs; - gmesa->SetupNewInputs = 0; - - if (!newinputs) - return; - - if (newinputs & VERT_BIT_POS) { - setup_tab[gmesa->SetupIndex].emit( ctx, start, count, v, stride ); - } else { - GLuint ind = 0; - - if (newinputs & VERT_BIT_COLOR0) - ind |= GAMMA_RGBA_BIT; - - if (newinputs & VERT_BIT_COLOR1) - ind |= GAMMA_SPEC_BIT; - - if (newinputs & VERT_BIT_TEX0) - ind |= GAMMA_TEX0_BIT; - - if (newinputs & VERT_BIT_FOG) - ind |= GAMMA_FOG_BIT; - - if (gmesa->SetupIndex & GAMMA_PTEX_BIT) - ind = ~0; - - ind &= gmesa->SetupIndex; - - if (ind) { - setup_tab[ind].emit( ctx, start, count, v, stride ); - } - } -} - -void gammaChooseVertexState( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint ind = GAMMA_XYZW_BIT|GAMMA_RGBA_BIT; - - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - ind |= GAMMA_SPEC_BIT; - - if (ctx->Fog.Enabled) - ind |= GAMMA_FOG_BIT; - - if (ctx->Texture.Unit[0]._ReallyEnabled) { - _tnl_need_projected_coords( ctx, GL_FALSE ); - ind |= GAMMA_TEX0_BIT; - } else - _tnl_need_projected_coords( ctx, GL_FALSE ); - - gmesa->SetupIndex = ind; - - if (setup_tab[ind].vertex_format != gmesa->vertex_format) { - gmesa->vertex_format = setup_tab[ind].vertex_format; - gmesa->vertex_size = setup_tab[ind].vertex_size; - } - - if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { - tnl->Driver.Render.Interp = gamma_interp_extras; - tnl->Driver.Render.CopyPV = gamma_copy_pv_extras; - } else { - tnl->Driver.Render.Interp = setup_tab[ind].interp; - tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv; - } -} - - -void gammaInitVB( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - GLuint size = TNL_CONTEXT(ctx)->vb.Size; - - gmesa->verts = (GLubyte *)_mesa_align_malloc(size * 4 * 16, 32); - - { - static int firsttime = 1; - if (firsttime) { - init_setup_tab(); - firsttime = 0; - gmesa->vertex_size = 16; /* FIXME - only one vertex setup */ - } - } -} - - -void gammaFreeVB( GLcontext *ctx ) -{ - gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); - if (gmesa->verts) { - _mesa_align_free(gmesa->verts); - gmesa->verts = 0; - } -} diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.h b/src/mesa/drivers/dri/gamma/gamma_vb.h deleted file mode 100644 index 8701226f59..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_vb.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * Keith Whitwell, - * - * 3DLabs Gamma driver. - */ - -#ifndef GAMMAVB_INC -#define GAMMAVB_INC - -#include "main/mtypes.h" -#include "swrast/swrast.h" - -#define _GAMMA_NEW_VERTEX (_NEW_TEXTURE | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE) - - -extern void gammaChooseVertexState( GLcontext *ctx ); -extern void gammaCheckTexSizes( GLcontext *ctx ); -extern void gammaBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ); - - -extern void gamma_import_float_colors( GLcontext *ctx ); -extern void gamma_import_float_spec_colors( GLcontext *ctx ); - -extern void gamma_translate_vertex( GLcontext *ctx, - const gammaVertex *src, - SWvertex *dst ); - -extern void gammaInitVB( GLcontext *ctx ); -extern void gammaFreeVB( GLcontext *ctx ); - -extern void gamma_print_vertex( GLcontext *ctx, const gammaVertex *v ); -extern void gammaPrintSetupFlags(char *msg, GLuint flags ); - -#endif diff --git a/src/mesa/drivers/dri/gamma/gamma_xmesa.c b/src/mesa/drivers/dri/gamma/gamma_xmesa.c deleted file mode 100644 index 622121eed4..0000000000 --- a/src/mesa/drivers/dri/gamma/gamma_xmesa.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2001 by Alan Hourihane. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * 3DLabs Gamma driver - */ - -#include "gamma_context.h" -#include "gamma_macros.h" -#include "gamma_vb.h" -#include "main/context.h" -#include "main/matrix.h" -#include "glint_dri.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "vbo/vbo.h" - -static GLboolean -gammaInitDriver(__DRIscreen *sPriv) -{ - sPriv->private = (void *) gammaCreateScreen( sPriv ); - - if (!sPriv->private) { - gammaDestroyScreen( sPriv ); - return GL_FALSE; - } - - return GL_TRUE; -} - -static void -gammaDestroyContext(__DRIcontext *driContextPriv) -{ - gammaContextPtr gmesa = (gammaContextPtr)driContextPriv->driverPrivate; - - if (gmesa) { - _swsetup_DestroyContext( gmesa->glCtx ); - _tnl_DestroyContext( gmesa->glCtx ); - _vbo_DestroyContext( gmesa->glCtx ); - _swrast_DestroyContext( gmesa->glCtx ); - - gammaFreeVB( gmesa->glCtx ); - - /* free the Mesa context */ - gmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(gmesa->glCtx); - - FREE(gmesa); - driContextPriv->driverPrivate = NULL; - } -} - - -static GLboolean -gammaCreateBuffer( __DRIscreen *driScrnPriv, - __DRIdrawable *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - driDrawPriv->driverPrivate = (void *) - _mesa_create_framebuffer(mesaVis, - GL_FALSE, /* software depth buffer? */ - mesaVis->stencilBits > 0, - mesaVis->accumRedBits > 0, - mesaVis->alphaBits > 0 - ); - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -gammaDestroyBuffer(__DRIdrawable *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - -static void -gammaSwapBuffers( __DRIdrawable *dPriv ) -{ - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - gammaContextPtr gmesa; - __DRIscreen *driScrnPriv; - GLcontext *ctx; - - gmesa = (gammaContextPtr) dPriv->driContextPriv->driverPrivate; - ctx = gmesa->glCtx; - driScrnPriv = gmesa->driScreen; - - _mesa_notifySwapBuffers(ctx); - - VALIDATE_DRAWABLE_INFO(gmesa); - - /* Flush any partially filled buffers */ - FLUSH_DMA_BUFFER(gmesa); - - DRM_SPINLOCK(&driScrnPriv->pSAREA->drawable_lock, - driScrnPriv->drawLockID); - VALIDATE_DRAWABLE_INFO_NO_LOCK(gmesa); - - if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER) { - int src, dst, x0, y0, x1, h; - int i; - int nRect = dPriv->numClipRects; - drm_clip_rect_t *pRect = dPriv->pClipRects; - __DRIscreen *driScrnPriv = gmesa->driScreen; - GLINTDRIPtr gDRIPriv = (GLINTDRIPtr)driScrnPriv->pDevPriv; - - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, FBReadMode, (gmesa->FBReadMode | - FBReadSrcEnable)); - WRITE(gmesa->buf, LBWriteMode, LBWriteModeDisable); - - for (i = 0; i < nRect; i++, pRect++) { - x0 = pRect->x1; - x1 = pRect->x2; - h = pRect->y2 - pRect->y1; - - y0 = driScrnPriv->fbHeight - (pRect->y1+h); - if (gDRIPriv->numMultiDevices == 2) - src = (y0/2)*driScrnPriv->fbWidth+x0; - else - src = y0*driScrnPriv->fbWidth+x0; - - y0 += driScrnPriv->fbHeight; - if (gDRIPriv->numMultiDevices == 2) - dst = (y0/2)*driScrnPriv->fbWidth+x0; - else - dst = y0*driScrnPriv->fbWidth+x0; - - CHECK_DMA_BUFFER(gmesa, 9); - WRITE(gmesa->buf, StartXDom, x0<<16); /* X0dest */ - WRITE(gmesa->buf, StartY, y0<<16); /* Y0dest */ - WRITE(gmesa->buf, StartXSub, x1<<16); /* X1dest */ - WRITE(gmesa->buf, GLINTCount, h); /* H */ - WRITE(gmesa->buf, dY, 1<<16); /* ydir */ - WRITE(gmesa->buf, dXDom, 0<<16); - WRITE(gmesa->buf, dXSub, 0<<16); - WRITE(gmesa->buf, FBSourceOffset, (dst-src)); - WRITE(gmesa->buf, Render, 0x00040048); /* NOT_DONE */ - } - - /* - ** NOTE: FBSourceOffset (above) is backwards from what is - ** described in the manual (i.e., dst-src instead of src-dst) - ** due to our using the bottom-left window origin instead of the - ** top-left window origin. - */ - - /* Restore FBReadMode */ - CHECK_DMA_BUFFER(gmesa, 2); - WRITE(gmesa->buf, FBReadMode, (gmesa->FBReadMode | - gmesa->AB_FBReadMode)); - WRITE(gmesa->buf, LBWriteMode, LBWriteModeEnable); - } - - if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER) - PROCESS_DMA_BUFFER_TOP_HALF(gmesa); - - DRM_SPINUNLOCK(&driScrnPriv->pSAREA->drawable_lock, - driScrnPriv->drawLockID); - VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(gmesa); - - if (gmesa->EnabledFlags & GAMMA_BACK_BUFFER) - PROCESS_DMA_BUFFER_BOTTOM_HALF(gmesa); - } else { - _mesa_problem(NULL, "gammaSwapBuffers: drawable has no context!\n"); - } -} - -static GLboolean -gammaMakeCurrent(__DRIcontext *driContextPriv, - __DRIdrawable *driDrawPriv, - __DRIdrawable *driReadPriv) -{ - if (driContextPriv) { - GET_CURRENT_CONTEXT(ctx); - gammaContextPtr oldGammaCtx = ctx ? GAMMA_CONTEXT(ctx) : NULL; - gammaContextPtr newGammaCtx = (gammaContextPtr) driContextPriv->driverPrivate; - - if ( newGammaCtx != oldGammaCtx ) { - newGammaCtx->dirty = ~0; - } - - if (newGammaCtx->driDrawable != driDrawPriv) { - newGammaCtx->driDrawable = driDrawPriv; - gammaUpdateWindow ( newGammaCtx->glCtx ); - gammaUpdateViewportOffset( newGammaCtx->glCtx ); - } - -#if 0 - newGammaCtx->Window &= ~W_GIDMask; - newGammaCtx->Window |= (driDrawPriv->index << 5); - CHECK_DMA_BUFFER(newGammaCtx,1); - WRITE(newGammaCtx->buf, GLINTWindow, newGammaCtx->Window); -#endif - -newGammaCtx->new_state |= GAMMA_NEW_WINDOW; /* FIXME */ - - _mesa_make_current2( newGammaCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - } else { - _mesa_make_current( 0, 0 ); - } - return GL_TRUE; -} - - -static GLboolean -gammaUnbindContext( __DRIcontext *driContextPriv ) -{ - return GL_TRUE; -} - -const struct __DriverAPIRec driDriverAPI = { - gammaInitDriver, - gammaDestroyScreen, - gammaCreateContext, - gammaDestroyContext, - gammaCreateBuffer, - gammaDestroyBuffer, - gammaSwapBuffers, - gammaMakeCurrent, - gammaUnbindContext -}; - - - -/* - * This is the bootstrap function for the driver. - * The __driCreateScreen name is the symbol that libGL.so fetches. - * Return: pointer to a __DRIscreen. - */ -void *__driCreateScreen(Display *dpy, int scrn, __DRIscreen *psc, - int numConfigs, __GLXvisualConfig *config) -{ - __DRIscreen *psp; - psp = __driUtilCreateScreen(dpy, scrn, psc, numConfigs, config, &gammaAPI); - return (void *) psp; -} - -/* This is the table of extensions that the loader will dlsym() for. */ -PUBLIC const __DRIextension *__driDriverExtensions[] = { - &driCoreExtension.base, - &driLegacyExtension.base, - NULL -}; diff --git a/src/mesa/drivers/dri/gamma/server/glint_common.h b/src/mesa/drivers/dri/gamma/server/glint_common.h deleted file mode 100644 index 36554e4ac2..0000000000 --- a/src/mesa/drivers/dri/gamma/server/glint_common.h +++ /dev/null @@ -1,63 +0,0 @@ -/* glint_common.h -- common header definitions for Gamma 2D/3D/DRM suite - * - * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Converted to common header format: - * Jens Owen - * - * - */ - -#ifndef _GLINT_COMMON_H_ -#define _GLINT_COMMON_H_ - -/* - * WARNING: If you change any of these defines, make sure to change - * the kernel include file as well (gamma_drm.h) - */ - -/* Driver specific DRM command indices - * NOTE: these are not OS specific, but they are driver specific - */ -#define DRM_GAMMA_INIT 0x00 -#define DRM_GAMMA_COPY 0x01 - -typedef struct { - enum { - GAMMA_INIT_DMA = 0x01, - GAMMA_CLEANUP_DMA = 0x02 - } func; - int sarea_priv_offset; - int pcimode; - unsigned int mmio0; - unsigned int mmio1; - unsigned int mmio2; - unsigned int mmio3; - unsigned int buffers_offset; - int num_rast; -} drmGAMMAInit; - -extern int drmGAMMAInitDMA( int fd, drmGAMMAInit *info ); -extern int drmGAMMACleanupDMA( int fd ); - -#endif diff --git a/src/mesa/drivers/dri/gamma/server/glint_dri.h b/src/mesa/drivers/dri/gamma/server/glint_dri.h deleted file mode 100644 index df1992a5d1..0000000000 --- a/src/mesa/drivers/dri/gamma/server/glint_dri.h +++ /dev/null @@ -1,122 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Author: - * Jens Owen - * - */ - -#ifndef _GLINT_DRI_H_ -#define _GLINT_DRI_H_ - -#include "xf86drm.h" -#include "glint_common.h" - -typedef struct { - unsigned int GDeltaMode; - unsigned int GDepthMode; - unsigned int GGeometryMode; - unsigned int GTransformMode; -} GAMMAContextRegionRec, *GAMMAContextRegionPtr; - -typedef struct { - unsigned char next, prev; /* indices to form a circular LRU */ - unsigned char in_use; /* owned by a client, or free? */ - int age; /* tracked by clients to update local LRU's */ -} GAMMATextureRegionRec, *GAMMATextureRegionPtr; - -typedef struct { - GAMMAContextRegionRec context_state; - - unsigned int dirty; - - /* Maintain an LRU of contiguous regions of texture space. If - * you think you own a region of texture memory, and it has an - * age different to the one you set, then you are mistaken and - * it has been stolen by another client. If global texAge - * hasn't changed, there is no need to walk the list. - * - * These regions can be used as a proxy for the fine-grained - * texture information of other clients - by maintaining them - * in the same lru which is used to age their own textures, - * clients have an approximate lru for the whole of global - * texture space, and can make informed decisions as to which - * areas to kick out. There is no need to choose whether to - * kick out your own texture or someone else's - simply eject - * them all in LRU order. - */ - -#define GAMMA_NR_TEX_REGIONS 64 - GAMMATextureRegionRec texList[GAMMA_NR_TEX_REGIONS+1]; - /* Last elt is sentinal */ - int texAge; /* last time texture was uploaded */ - int last_enqueue; /* last time a buffer was enqueued */ - int last_dispatch; /* age of the most recently dispatched buffer */ - int last_quiescent; /* */ - int ctxOwner; /* last context to upload state */ - - int vertex_prim; -} GLINTSAREADRIRec, *GLINTSAREADRIPtr; - -/* - * Glint specific record passed back to client driver - * via DRIGetDeviceInfo request - */ -typedef struct { - drmRegion registers0; - drmRegion registers1; - drmRegion registers2; - drmRegion registers3; - int numMultiDevices; - int pprod; - int cpp; - int frontOffset; - int frontPitch; - int backOffset; - int backPitch; - int backX; - int backY; - int depthOffset; - int depthPitch; - int textureSize; - int logTextureGranularity; -} GLINTDRIRec, *GLINTDRIPtr; - -#define GLINT_DRI_BUF_COUNT 256 -#define GLINT_DRI_BUF_SIZE 4096 - -#define GAMMA_NR_TEX_REGIONS 64 - -#define DMA_WRITE(val,reg) \ -do { \ - pGlint->buf2D++ = Glint##reg##Tag; \ - pGlint->buf2D++ = val; \ -} while (0) - -#endif /* _GLINT_DRI_H_ */ -- cgit v1.2.3 From a9e36696837b2c31ecee4017a0adffbd987c1eff Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 16:17:04 -0500 Subject: Remove remaining miniglx references --- configs/linux-solo | 54 ---- docs/MiniGLX.html | 534 ------------------------------------ doxygen/Makefile | 3 +- doxygen/miniglx.doxy | 179 ------------ include/GL/miniglx.h | 482 --------------------------------- progs/miniglx/.gitignore | 6 - progs/miniglx/Makefile | 61 ----- progs/miniglx/glfbdevtest.c | 477 -------------------------------- progs/miniglx/manytex.c | 381 -------------------------- progs/miniglx/miniglxsample.c | 128 --------- progs/miniglx/miniglxtest.c | 272 ------------------- progs/miniglx/sample_server.c | 111 -------- progs/miniglx/sample_server2.c | 228 ---------------- progs/miniglx/texline.c | 267 ------------------ src/glut/mini/Makefile | 103 ------- src/glut/mini/bitmap.c | 56 ---- src/glut/mini/callback.c | 152 ----------- src/glut/mini/color.c | 46 ---- src/glut/mini/globals.c | 61 ----- src/glut/mini/glut.pc.in | 13 - src/glut/mini/init.c | 59 ---- src/glut/mini/internal.h | 78 ------ src/glut/mini/menu.c | 86 ------ src/glut/mini/models.c | 598 ----------------------------------------- src/glut/mini/overlay.c | 60 ----- src/glut/mini/state.c | 70 ----- src/glut/mini/teapot.c | 212 --------------- src/glut/mini/window.c | 273 ------------------- 28 files changed, 1 insertion(+), 5049 deletions(-) delete mode 100644 configs/linux-solo delete mode 100644 docs/MiniGLX.html delete mode 100644 doxygen/miniglx.doxy delete mode 100644 include/GL/miniglx.h delete mode 100644 progs/miniglx/.gitignore delete mode 100644 progs/miniglx/Makefile delete mode 100644 progs/miniglx/glfbdevtest.c delete mode 100644 progs/miniglx/manytex.c delete mode 100644 progs/miniglx/miniglxsample.c delete mode 100644 progs/miniglx/miniglxtest.c delete mode 100644 progs/miniglx/sample_server.c delete mode 100644 progs/miniglx/sample_server2.c delete mode 100644 progs/miniglx/texline.c delete mode 100644 src/glut/mini/Makefile delete mode 100644 src/glut/mini/bitmap.c delete mode 100644 src/glut/mini/callback.c delete mode 100644 src/glut/mini/color.c delete mode 100644 src/glut/mini/globals.c delete mode 100644 src/glut/mini/glut.pc.in delete mode 100644 src/glut/mini/init.c delete mode 100644 src/glut/mini/internal.h delete mode 100644 src/glut/mini/menu.c delete mode 100644 src/glut/mini/models.c delete mode 100644 src/glut/mini/overlay.c delete mode 100644 src/glut/mini/state.c delete mode 100644 src/glut/mini/teapot.c delete mode 100644 src/glut/mini/window.c (limited to 'src') diff --git a/configs/linux-solo b/configs/linux-solo deleted file mode 100644 index 247a2d489a..0000000000 --- a/configs/linux-solo +++ /dev/null @@ -1,54 +0,0 @@ -# Configuration for linux-solo: Linux DRI hardware drivers for fbdev - -include $(TOP)/configs/default - -CONFIG_NAME = linux-solo - -# Compiler and flags -CC = gcc -CXX = g++ - -WARN_FLAGS = -Wall -Wundef -OPT_FLAGS = -O3 -g -PIC_FLAGS = -fPIC - -# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. -ARCH_FLAGS ?= - -# DRM and pciaccess -LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm) -LIBDRM_LIB = $(shell pkg-config --libs libdrm) -PCIACCESS_CFLAGS = $(shell pkg-config --cflags pciaccess) -PCIACCESS_LIB = $(shell pkg-config --libs pciaccess) - - -DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \ - -D_BSD_SOURCE -D_GNU_SOURCE -DHAVE_POSIX_MEMALIGN \ - -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \ - -DHAVE_ALIAS - -CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \ - $(ASM_FLAGS) -std=c99 -ffast-math - -CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) - -# Work around aliasing bugs - developers should comment this out -CFLAGS += -fno-strict-aliasing -CXXFLAGS += -fno-strict-aliasing - -MESA_ASM_SOURCES = - -# Library/program dependencies -DRI_LIB_DEPS = -lm -lpthread -lexpat -ldl -L$(TOP)/$(LIB_DIR) $(PCIACCESS_LIB) -GL_LIB_DEPS = -lm -lpthread -ldl -GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lm -APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lpthread - -# Directories -SRC_DIRS = glx/mini gallium mesa glu glut/mini glew -DRIVER_DIRS = dri -PROGRAM_DIRS = miniglx - -#DRI_DIRS = ffb gamma sis savage tdfx unichrome fb -DRI_DIRS = i810 i915tex i915 mach64 mga r128 r200 radeon diff --git a/docs/MiniGLX.html b/docs/MiniGLX.html deleted file mode 100644 index e7ebae6851..0000000000 --- a/docs/MiniGLX.html +++ /dev/null @@ -1,534 +0,0 @@ - - - - Mini GLX Specification - - -

-
Mini GLX Specification
-

-

-
Tungsten Graphics, Inc.
-
-January 20, 2003
-
-
-

-

Copyright © 2002-2003 by Tungsten Graphics, Inc., Cedar Park, -Texas. All Rights Reserved.
-
-Permission is granted to make and distribute verbatim copies of this -document provided the copyright notice and this permission notice are -preserved on all copies.
-
-

-

1. Introduction

-

The Mini GLX interface facilitates OpenGL rendering on embedded -devices. The interface is a subset of the GLX interface, plus a minimal -set of Xlib-like functions.

-

Programs written to the Mini GLX specification should run unchanged -on systems with the X Window System and the GLX extension. The intention -is to allow flexibility for prototyping and testing.

-

This document serves as both the reference guide and programming -guide for Mini GLX.
-
-

-

2. Mini GLX Concepts

-

The OpenGL specification does not describe how OpenGL rendering -contexts and drawing surfaces (i.e. the frame buffer) are created and -managed. Rather, this is handled by an OpenGL window system interface, -such as Mini GLX.

-

There are three main datatypes or resources managed by Mini GLX. The -resources and their corresponding GLX or Xlib data types are:

- - - - - - - - - - - - - - - - - - - -
ResourceData type
pixel formatsX Visual and XVisualInfo
drawing surfacesX Window or GLXDrawable
rendering contextsGLXContext
-

Pixel formats or X Visuals describe the per-pixel attributes of the -frame buffer. For example, bits per color component, Z buffer size, -stencil size, TrueColor vs PseudoColor, etc.

-

Drawing surfaces or X Windows typically describe a spatial -allocation of the frame buffer (i.e. the position and size of a -rectangular region of pixels). Since MiniGLX doesn't really support a -window system, the window is effectively the entire frame buffer.

-

A rendering context represents the current OpenGL state such as -current drawing color, line width, blending mode, texture parameters, -etc. Several rendering contexts can be created but only one can be in -use at any given time.

-

The Mini GLX interface provides all the functions needed for -choosing pixel formats, create drawing surfaces, creating rendering -contexts and binding rendering contexts to drawing surfaces.
-
-

-

3. Using Mini GLX

-

To use the Mini GLX interface in your application, include the -GL/miniglx.h header file at compile time:

-
#include <GL/miniglx.h>
-
-Applications should link with libGL.so (i.e. gcc -myprogram.o -lGL -o myprogram).  libGL.so implements the -MiniGLX API functions and, in turn, loads a hardware-specific device -driver (such as radeon_dri.so) at runtime.  The -environment variable LIBGL_DRIVERS_PATH should name the -directory where these modules are located.
-
-The remainder of this section describes the MiniGLX API functions.
-
-

3.1 Initialization

-

The XOpenDisplay function is used to initialize the graphics system:

-
-
Display *XOpenDisplay(const char *displayname)
-
-

The displayName parameter is currently ignored in Mini -GLX. It is recommended that NULL be passed as thedisplayName -parameter.

-

If XOpenDisplay is able to initialize the graphics system a pointer -to a Display will be returned. Otherwise, NULL will be returned.

-

3.2 Choosing a Visual

-

A visual (i.e. pixel format) must be chosen before a drawing surface -or rendering context can be created. This is done with the -glXChooseVisual function:

-
-
XVisualInfo *glXChooseVisual(Display *dpy, int screen, const int *attribList)
-
-

dpy is a pointer to the display returned by -XOpenDisplay.

-

screen is currently ignored by Mini GLX and should be -zero.

-

attribList is a list of GLX attributes which describe -the desired pixel format. It is terminated by the token None. -The attributes are as follows:

-
-
-
GLX_USE_GL
-
This attribute should always be present in order to maintain -compatibility with GLX.
-
GLX_RGBA
-
If present, only RGBA pixel formats will be considered. -Otherwise, only color index formats are considered.
-
GLX_DOUBLEBUFFER
-
if present, only double-buffered pixel formats will be chosen.
-
GLX_RED_SIZE n
-
Must be followed by a non-negative integer indicating the -minimum number of bits per red pixel component that is acceptable.
-
GLX_GREEN_SIZE n
-
Must be followed by a non-negative integer indicating the -minimum number of bits per green pixel component that is acceptable.
-
GLX_BLUE_SIZE n
-
Must be followed by a non-negative integer indicating the -minimum number of bits per blue pixel component that is acceptable.
-
GLX_ALPHA_SIZE n
-
Must be followed by a non-negative integer indicating the -minimum number of bits per alpha pixel component that is acceptable.
-
GLX_STENCIL_SIZE n
-
Must be followed by a non-negative integer indicating the -minimum number of bits per stencil value that is acceptable.
-
None
-
This token is used to terminate the attribute list.
-
-
-

glXChooseVisual will return a pointer to an XVisualInfo object which -most closely matches the requirements of the attribute list. If there -is no visual which matches the request, NULL will be returned.

-

Note that visuals with accumulation buffers and depth buffers are -not available.
-
-

-

3.3 Creating a Drawing Surface

-

Drawing surfaces are created as X windows.  For Mini GLX, -windows are full-screen; they cover the entire frame buffer. - Also, Mini GLX imposes a limit of one window. A second window -cannot be created until the first one is destroyed.

-

3.3.1 Window Creation

-

The XCreateWindow function is used to create a drawing surface:

-
-
Window XCreateWindow( Display *display,
Window parent,
int x, int y,
unsigned int width, unsigned int height,
unsigned int borderWidth,
int depth,
unsigned int class,
Visual *visual,
unsigned long valuemask,
XSetWindowAttributes *attributes )
-
-

The parameters are as follows:

-
-
-
display
-
A Display pointer, as returned by XOpenDisplay.
-
parent
-
The parent window for the new window. For Mini GLX, this -should beRootWindow(dpy, 0).
-
x, y
-
The position of the window. For Mini GLX, both values should -be zero.
-
width, height
-
The size of the window. For Mini GLX, this specifies the -desired screen size such as 1024, 768 or 1280, 1024.
-
borderWidth
-
This parameter should be zero.
-
depth
-
The pixel depth for the window. For Mini GLX this should be -the depth found in the XVisualInfo object returned by glxChooseVisual.
-
class
-
The window class. For Mini GLX this value should be InputOutput.
-
visual
-
This parameter should be the visual field of the XVisualInfo -object returned by glxChooseVisual.
-
valuemask
-
This parameter indicates which fields of the XSetWindowAttributes -are to be used. For Mini GLX this is typically the bitmaskCWBackPixel -| CWBorderPixel | CWColormap.
-
attributes
-
Initial window attributes. Of the fields in the XSetWindowAttributes -structure, thebackground_pixel, border_pixel -and colormap fields should be set.  See the discussion -below regarding colormaps.
-
-
-

XCreateWindow will return a window handle if it succeeds -or zero if it fails.

-

3.3.2 Window Mapping

-

To display the window the XMapWindow function must be called:

-
-
void XMapWindow(Display *dpy, Window w)
-
-

This function does nothing in Mini GLX but is required for Xlib/GLX -compatibility

-

3.3.3 Colormaps
-

-

Xlib requires specification of a colormap when creating a window. - For purposes of interoperability, Mini GLX requires this as well, -though the colormap is not actually used.  The XCreateColormap -function is used to create a colormap:

-
Colormap XCreateColormap(Display *dpy, Window window, -Visual *visual, int alloc)
-
-

The parameters are as follows:
-

-
-
-
dpy
-
The display handle as returned by XOpenDisplay.
-
window
-
This parameter is ignored by Mini GLX but should be the value -returned by the RootWindow(dpy, 0) macro.
-
-
visual
-
This parameter is ignored by Mini GLX but should be the visual -field of the XVisualInfo object returned by glXChooseVisual.
-
alloc
-
This parameter is ignored by Mini GLX but should be set to AllocNone.
-
-
-
-

3.4 Creating a Rendering Context

-

An OpenGL rendering context is created with the glXCreateContext -function:

-
-
GLXContext glXCreateContext(Display *dpy, XVisualInfo *visInfo, GLXContext shareList, Bool direct)
-
-

The parameters are as follows:

-
-
-
dpy
-
The display handle as returned by XOpenDisplay.
-
visInfo
-
The visual as returned by glXChooseVisual.
-
shareList
-
If non-zero, texture objects and display lists are shared with -the named rendering context. If zero, texture objects and display lists -will (initially) be private to this context. They may be shared when a -subsequent context is created.
-
direct
-
Specifies whether direct or indirect rendering is desired. For -Mini GLX this value is ignored but it should be set to True.
-
-
-

glXCreateContext will return a GLXContext handle if it -succeeds or zero if it fails due to invalid parameter or insufficient -resources.
-
-

-

3.5 Binding a Rendering Context

-

The final step before beginning OpenGL rendering is to bind (i.e. -activate) a rendering context and drawing surface with the -glXMakeCurrent function:

-
-
Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable, GLXContext ctx)
-
-

The parameters are as follows:

-
-
-
dpy
-
The display handle, as returned by XOpenDisplay.
-
drawable
-
The window or drawable to bind to the rendering context. This -should be the value returned by XCreateWindow.
-
ctx
-
The rendering context to bind, as returned by glXCreateContext.
-
-
-

If glXMakeCurrent succeeds True is returned. Otherwise False is -returned to indicate an invalid display, window or context parameter.

-

After the rendering context has been bound to the drawing surface -OpenGL rendering can begin.

-

The current rendering context may be unbound by calling -glXMakeCurrent with the window and context parameters set to zero.

-

An application may create any number of rendering contexts and bind -them as needed. Note that binding a rendering context is generally not a -light-weight operation.  Most simple OpenGL applications create -only one rendering context.
-
-

-

3.6 Color Buffer Swapping

-

A double buffered window has two color buffers: a front buffer and a -back buffer. Normally, rendering is directed to the back buffer while -the front buffer is displayed. When rendering of a frame is finished -the front and back buffers are swapped to provide the illusion of -instanteous screen updates.

-

The color buffers for a particular window (i.e. drawable) may be -swapped with the glXSwapBuffers command:

-
-
void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
-
-Any pending rendering commands will be completed before the buffer swap -takes place.
-
-Calling glXSwapBuffers on a window which is single-buffered has no -effect.
-
-

3.7 Releasing Resources

-

3.7.1 Releasing Rendering Contexts

-

A rendering context may be destroyed by calling glXDestroyContext:

-
-
void glXDestroyContext(Display *dpy, GLXContext ctx)
-
-

3.7.2 Releasing Windows

-

A window may be destroyed by calling XDestroyWindow:

-
-
void XDestroyWindow(Display *dpy, Window window)
-
-

3.7.3 Releasing Visuals

-

An XVisualInfo object may be freed by calling XFree:

-
-
void XFree(void *data)
-
-

3.7.4 Releasing Colormaps

-

A colormap may be freed by calling XFreeColormap:

-
-
void XFreeColormap(Display *dpy, Colormap colormap)
-
-

3.7.4 Releasing Display Resources

-

When the application is about to exit, the resources associated with -the graphics system can be released by calling XCloseDisplay:

-
-
void XCloseDisplay(Display *dpy)
-
-

The display handle becomes invalid at this point.
-
-

-

3.8 Query Functions

-

3.8.1 Querying Available Visuals

-A list of all available visuals can be obtained with the XGetVisualInfo -function:
-
-
XVisualInfo -*XGetVisualInfo(Display *dpy, long vinfo_mask, XVisualInfo -*vinfo_template, int *nitems_return)
-
-
-The parameters are as follows:
-
-
-
dpy
-
The display handle, as returned by XOpenDisplay.
-
vinfo_mask
-
A bitmask indicating which fields of the vinfo_template are to -be matched.  The value must be VisualScreenMask.
-
vinfo_template
-
A template whose fields indicate which visual attributes must -be matched by the results.  The screen field of this structure must -be zero.
-
nitems_return
-
Returns the number of visuals returned.
-
-
-The return value is the address of an array of all available visuals.
-
-An example of using XGetVisualInfo to get all available visuals follows:
-
-
XVisualInfo visTemplate, *results;
-int numVisuals;
-Display *dpy = XOpenDisplay(NULL);
-visTemplate.screen = 0;
-results = XGetVisualInfo(dpy, VisualScreenMask, &visTemplate, -&numVisuals);
-
-
-

3.8.2 Querying Visual Attributes

-

The GLX attributes of an X visual may be queried with the -glXGetConfig function:

-
-
int glXGetConfig(Display *dpy, XVisualInfo *vis, int attribute, int *value)
-
-

The parameters are as follows:

-
-
-
dpy
-
The display handle, as returned by XOpenDisplay.
-
vis
-
The visual, as returned by glXChooseVisual.
-
attribute
-
The attribute to query. The attributes are listed below.
-
value
-
Pointer to an integer in which the result of the query will be -stored.
-
-
-

The return value will be zero if no error occurs. - GLX_INVALID_ATTRIBUTE will be returned if the attribute -parameter is invalid.  GLX_BAD_VISUAL will be returned -if the XVisualInfo parameter is invalid.

-

The following attributes may be queried:

-
-
-
GLX_USE_GL
-
The result will be True or False to -indicate if OpenGL rendering is supported with the visual. Mini GLX -always return True.
-
GLX_RGBA
-
The result will be True for RGBA visuals or False -for color index visuals.
-
GLX_DOUBLEBUFFER
-
The result will be True if the visual has two -color buffers or False if the visual has one color buffer.
-
GLX_RED_SIZE
-
The result will be the number of red bits per pixel.
-
GLX_GREEN_SIZE
-
The result will be the number of green bits per pixel.
-
GLX_BLUE_SIZE
-
The result will be the number of blue bits per pixel.
-
GLX_ALPHA_SIZE
-
The result will be the number of alpha bits per pixel.
-
GLX_DEPTH_SIZE
-
The result will be the number of bits per Z value.
-
GLX_STENCIL_SIZE
-
The result will be the number of bits per stencil value.
-
-
-
-
-

3.8.3 Querying the Current Rendering Context

-

The current rendering context can be queried with -glXGetCurrentContext:

-
-
GLXContext glXGetCurrentContext(void)
-
-

Zero will be returned if no context is currently bound.
-
-

-

3.8.4 Querying the Current Drawable

-

The current drawable (i.e. window or drawing surface) can be queried -with glXGetCurrentDrawable:

-
-
GLXDrawable glXGetCurrentDrawable(void)
-
-

Zero will be returned if no drawable is currently bound.
-
-

-

3.8.5 Function Address Queries

-

The glXGetProcAddress function will return the address of any -available OpenGL or Mini GLX function:

-
-
void *glXGetProcAddress(const GLubyte *procName)
-
-

If procName is a valid function name, a pointer to that -function will be returned.  Otherwise, NULL will be returned.

-

The purpose of glXGetProcAddress is to facilitate using future -extensions to OpenGL or Mini GLX. If a future version of the library -adds new extension functions they'll be accessible via -glXGetProcAddress. The alternative is to hard-code calls to the new -functions in the application but doing so will prevent linking the -application with older versions of the library.
-
-

-

3.9 Versioning

-The Mini GLX version can be queried at run time with glXQueryVersion: -
-
Bool glXQueryVersion(Display *dpy, int *major, int *minor)
-
-

major will be set to the major version number andminor -will be set to the minor version number.True will be -returned if the function succeeds. False will be returned -if the function fails due to invalid parameters. The dpy -argument is currently ignored, but should be the value returned by -XOpenDisplay.

-

At compile time, the Mini GLX interface version can be tested with -the MINI_GLX_VERSION_1_x preprocessor tokens. For example, if -version 1.0 of Mini GLX is supported, then MINI_GLX_VERSION_1_0 -will be defined. If version 1.1 of Mini GLX is supported, then -MINI_GLX_VERSION_1_1 will be defined.

-

At the time of writing the current Mini GLX version is 1.0.
-
-

-

4.0 Interoperability with GLX and Xlib

-While Mini GLX strives to be compatible with GLX and Xlib there are -some unavoidable differences which must be taken into consideration.
-

4.1 Public vs Private Structures

-The structure of many X data types is public.  For example, the Display -data type is defined as a structure in /usr/include/X11/Xlib.h and -programmers may access any fields of that structure at will.  Mini -GLX also defines a Display data type but its fields are hidden and not -visiblein miniglx.h.  Duplicating the Xlib -declaration for the Display data type in minigl.h would -require defining a large number of other superfluous Xlib datatypes.
-
-Mini GLX users are discouraged from directly accessing the fields of -Xlib data types to maximize portability - though this is unavoidable to -some extent.  For example, the XVisualInfo and XSetWindowAtttributes -data types must be completely public. -

4.2 Macros

-In some cases, Xlib defines macros which are meant to be used instead -of direct structure accesses.  For example, the RootWindow(dpy, -screen) macro returns the root window for a given screen on a -given display.  Unfortunately, macros do nothing to aid in ABI -compatibility since they are resolved at compile time instead of at -link/run time.
-
-Mini GLX also defines a RootWindow macro since it's -essential for creating windows.  But the implementation of this -macro by Xlib and Mini GLX is completely different.
-

4.3 Summary

-Because Xlib and Mini GLX define data types and macros differently, -Mini GLX applications must be recompiled when retargeting Mini GLX or -native Xlib/GLX.  That is, applications can't simply be re-linked -because of ABI incompatibilities.
-
-Nevertheless, the fact that Mini GLX programs can be recompiled for -Xlib and GLX increases portability and flexibility for testing and -prototyping.
-
-

5.0 Example Program

-

This section shows an example program which uses the Mini GLX -interface. The program simply draws several frames of a rotating square.
-

-

The program may be compiled for use with Xlib/GLX or Mini GLX by -setting the USE_MINIGLX token to 0 or 1, respectively. - Note that the only difference is the header files which are -included.
-

-

-

#define USE_MINIGLX 1 /* 1 = use Mini GLX, 0 = use Xlib/GLX */

#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>

#if USE_MINIGLX
#include <GL/miniglx.h>
#else
#include <GL/glx.h>
#include <X11/Xlib.h>
#endif

/*
* Create a simple double-buffered RGBA window.
*/
static Window
MakeWindow(Display * dpy, unsigned int width, unsigned int height)
{
int visAttributes[] = {
GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
None
};
XSetWindowAttributes attr;
unsigned long attrMask;
Window root;
Window win;
GLXContext ctx;
XVisualInfo *visinfo;

root = RootWindow(dpy, 0);

/* Choose GLX visual / pixel format */
visinfo = glXChooseVisual(dpy, 0, visAttributes);
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}

/* Create the window */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
attrMask = CWBackPixel | CWBorderPixel | CWColormap;
win = XCreateWindow(dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, attrMask, &attr);
if (!win) {
printf("Error: XCreateWindow failed\n");
exit(1);
}

/* Display the window */
XMapWindow(dpy, win);

/* Create GLX rendering context */
ctx = glXCreateContext(dpy, visinfo, NULL, True);
if (!ctx) {
printf("Error: glXCreateContext failed\n");
exit(1);
}

/* Bind the rendering context and window */
glXMakeCurrent(dpy, win, ctx);

return win;
}


/*
* Draw a few frames of a rotating square.
*/
static void
DrawFrames(Display * dpy, Window win)
{
int angle;
glShadeModel(GL_FLAT);
glClearColor(0.5, 0.5, 0.5, 1.0);
for (angle = 0; angle < 360; angle += 10) {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 0.0);
glPushMatrix();
glRotatef(angle, 0, 0, 1);
glRectf(-0.8, -0.8, 0.8, 0.8);
glPopMatrix();
glXSwapBuffers(dpy, win);
}
}


int
main(int argc, char *argv[])
{
Display *dpy;
Window win;

dpy = XOpenDisplay(NULL);
if (!dpy) {
printf("Error: XOpenDisplay failed\n");
return 1;
}

win = MakeWindow(dpy, 300, 300);

DrawFrames(dpy, win);

return 0;
}
-
- - diff --git a/doxygen/Makefile b/doxygen/Makefile index 15ade4043b..120372e1da 100644 --- a/doxygen/Makefile +++ b/doxygen/Makefile @@ -22,8 +22,7 @@ full: $(FULL:.doxy=.tag) SUBSET = \ main.doxy \ - math.doxy \ - miniglx.doxy + math.doxy subset: $(SUBSET:.doxy=.tag) $(foreach FILE,$(SUBSET),doxygen $(FILE);) diff --git a/doxygen/miniglx.doxy b/doxygen/miniglx.doxy deleted file mode 100644 index 61c376caf2..0000000000 --- a/doxygen/miniglx.doxy +++ /dev/null @@ -1,179 +0,0 @@ -# Doxyfile 0.1 - -#--------------------------------------------------------------------------- -# General configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = "MiniGLX" -PROJECT_NUMBER = -OUTPUT_DIRECTORY = -OUTPUT_LANGUAGE = English -EXTRACT_ALL = NO -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -INTERNAL_DOCS = YES -STRIP_CODE_COMMENTS = YES -CASE_SENSE_NAMES = YES -SHORT_NAMES = NO -HIDE_SCOPE_NAMES = NO -VERBATIM_HEADERS = NO -SHOW_INCLUDE_FILES = NO -JAVADOC_AUTOBRIEF = NO -INHERIT_DOCS = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -ALIASES = -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -OPTIMIZE_OUTPUT_FOR_C = NO -SHOW_USED_FILES = YES -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = YES -WARNINGS = YES -WARN_IF_UNDOCUMENTED = NO -WARN_FORMAT = -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = ../src/glx/mini/ ../include/GL/miniglx.h -FILE_PATTERNS = *.h *.c -RECURSIVE = NO -EXCLUDE = ../src/glx/mini/glapi.c -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = miniglx -HTML_HEADER = header_subset.html -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = -MAN_EXTENSION = -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = ../include/ -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- -TAGFILES = \ - core_subset.tag=../core_subset \ - math_subset.tag=../math_subset -GENERATE_TAGFILE = miniglx.tag -ALLEXTERNALS = NO -PERL_PATH = -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -TEMPLATE_RELATIONS = YES -HIDE_UNDOC_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO -CGI_NAME = -CGI_URL = -DOC_URL = -DOC_ABSPATH = -BIN_ABSPATH = -EXT_DOC_PATHS = diff --git a/include/GL/miniglx.h b/include/GL/miniglx.h deleted file mode 100644 index 8c6180be60..0000000000 --- a/include/GL/miniglx.h +++ /dev/null @@ -1,482 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -/** - * \file miniglx.h - * \brief Mini GLX interface functions. - * \author Brian Paul - * - * See comments miniglx.c for more information. - */ - -#ifndef MINIGLX_H -#define MINIGLX_H - -#include -#include - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \name Replacement Xlib/GLX types - */ -/*@{*/ -/** - * \brief Boolean type. - * - * It can have the values #True or #False. - */ -#ifndef MINIGLX_NO_XTYPES -typedef int Bool; -#endif -typedef int MINI_Bool; - -/** - * \brief Color map. - * - * Alias for private ::MiniGLXColormapRec structure. - */ -typedef struct MiniGLXColormapRec *MINI_Colormap; -#ifndef MINIGLX_NO_XTYPES -typedef struct MiniGLXColormapRec *Colormap; -#endif - -/** - * \brief Window attributes. - */ -typedef struct MiniGLXSetWindowAttributesRec { - int background_pixel; /**< \brief background pixel */ - int border_pixel; /**< \brief border pixel value */ - MINI_Colormap colormap; /**< \brief color map to be associated with window */ - int event_mask; /**< \brief set of events that should be saved */ -} XSetWindowAttributes; - -/** - * \brief Visual. - * - * Alias for the private ::MiniGLXVisualRec structure. - * - * \sa \ref datatypes. - */ -typedef struct MiniGLXVisualRec Visual; - -/** - * \brief Visual information. - * - * \sa \ref datatypes. - */ -#ifndef MINIGLX_NO_XTYPES -typedef unsigned long VisualID; -#endif -typedef unsigned long MINI_VisualID; -typedef struct MiniGLXXVisualInfoRec { - Visual *visual; /**< \brief pointer to the GLX Visual */ - MINI_VisualID visualid; /**< \brief visual ID */ - int screen; /**< \brief screen number */ - int depth; /**< \brief bit depth */ -#if defined(__cplusplus) || defined(c_plusplus) - int c_class; /**< \brief class */ -#else - int class; /**< \brief class */ -#endif - int bits_per_rgb; /**< \brief total bits per pixel */ -} XVisualInfo; - -/** - * \brief GLX Frame Buffer Configuration (for pbuffers) - * \sa \ref datatypes. - */ -typedef struct MiniGLXFBConfigRec { - XVisualInfo *visInfo; -} GLXFBConfig; - - -/** - * \brief Display handle. - * - * Alias for the private ::MiniGLXDisplayRec structure. - * - * \sa \ref datatypes. - */ -#ifndef MINIGLX_NO_XTYPES -typedef struct MiniGLXDisplayRec Display; -#endif -typedef struct MiniGLXDisplayRec MINI_Display; - -/** - * \brief Window handle. - * - * Alias for the private ::MiniGLXWindowRec structure. - * - * \sa \ref datatypes. - */ -#ifndef MINIGLX_NO_XTYPES -typedef struct MiniGLXWindowRec *Window; -#endif -typedef struct MiniGLXWindowRec *MINI_Window; - -/** - * \brief Drawable. - * - * Alias for the private ::MiniGLXWindowRec structure. - * - * For Mini GLX only the full-screen window can be used as source and - * destination in graphics operations. - * - * \sa \ref datatypes. - */ -#ifndef MINIGLX_NO_XTYPES -typedef struct MiniGLXWindowRec *Drawable; -#endif -typedef struct MiniGLXWindowRec *MINI_Drawable; - -/** - * \brief GLX drawable. - * - * Alias for the private ::MiniGLXWindowRec structure. - * - * Same as #Drawable. - * - * \sa \ref datatypes. - */ -typedef struct MiniGLXWindowRec *GLXDrawable; - -/** - * \brief GLX pbuffer. - * - * Alias for the private ::MiniGLXWindowRec structure. - * - * Same as #Drawable. - * - * \sa \ref datatypes. - */ -typedef struct MiniGLXWindowRec *GLXPbuffer; - -/** - * \brief GLX context. - * - * Alias for the private ::MiniGLXContext structure. - * - * \sa \ref datatypes. - */ -typedef struct MiniGLXContextRec *GLXContext; -/*@}*/ - - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - MINI_Bool send_event; /* true if this came from a SendEvent request */ - MINI_Display *display; /* Display the event was read from */ - MINI_Window window; - int x, y; - int width, height; - int count; /* if non-zero, at least this many more */ -} XExposeEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - MINI_Bool send_event; /* true if this came from a SendEvent request */ - MINI_Display *display; /* Display the event was read from */ - MINI_Window parent; /* parent of the window */ - MINI_Window window; /* window id of window created */ - int x, y; /* window location */ - int width, height; /* size of window */ - int border_width; /* border width */ - MINI_Bool override_redirect; /* creation should be overridden */ -} XCreateWindowEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - MINI_Bool send_event; /* true if this came from a SendEvent request */ - MINI_Display *display; /* Display the event was read from */ - MINI_Window event; - MINI_Window window; -} XDestroyWindowEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - MINI_Bool send_event; /* true if this came from a SendEvent request */ - MINI_Display *display; /* Display the event was read from */ - MINI_Window event; - MINI_Window window; - MINI_Bool from_configure; -} XUnmapEvent; - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - MINI_Bool send_event; /* true if this came from a SendEvent request */ - MINI_Display *display; /* Display the event was read from */ - MINI_Window event; - MINI_Window window; - MINI_Bool override_redirect; /* boolean, is override set... */ -} XMapEvent; - - -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - MINI_Bool send_event; /* true if this came from a SendEvent request */ - MINI_Display *display; /* Display the event was read from */ - MINI_Window parent; - MINI_Window window; -} XMapRequestEvent; - -typedef union _XEvent { - int type; /* must not be changed; first element */ - XExposeEvent xexpose; - XCreateWindowEvent xcreatewindow; - XDestroyWindowEvent xdestroywindow; - XUnmapEvent xunmap; - XMapEvent xmap; - XMapRequestEvent xmaprequest; - long pad[24]; -} XEvent; - - -/** - * \name Xlib constants - */ -/*@{*/ -#define False 0 -#define True 1 -#define None 0 -#define AllocNone 0 -#define InputOutput 1 -#define ExposureMask (1L<<15) -#define StructureNotifyMask (1L<<17) -#define CWBackPixel (1L<<1) -#define CWBorderPixel (1L<<3) -#define CWEventMask (1L<<11) -#define CWColormap (1L<<13) -#define PseudoColor 3 -#define TrueColor 4 -#define VisualIDMask 0x1 -#define VisualScreenMask 0x2 -#define Expose 12 -#define CreateNotify 16 -#define DestroyNotify 17 -#define UnmapNotify 18 -#define MapNotify 19 -#define MapRequest 20 - -/*@}*/ - -/** - * \name Standard GLX tokens - */ -/*@{*/ -#define GLX_USE_GL 1 -#define GLX_BUFFER_SIZE 2 -#define GLX_LEVEL 3 -#define GLX_RGBA 4 -#define GLX_DOUBLEBUFFER 5 -#define GLX_STEREO 6 -#define GLX_AUX_BUFFERS 7 -#define GLX_RED_SIZE 8 -#define GLX_GREEN_SIZE 9 -#define GLX_BLUE_SIZE 10 -#define GLX_ALPHA_SIZE 11 -#define GLX_DEPTH_SIZE 12 -#define GLX_STENCIL_SIZE 13 -#define GLX_ACCUM_RED_SIZE 14 -#define GLX_ACCUM_GREEN_SIZE 15 -#define GLX_ACCUM_BLUE_SIZE 16 -#define GLX_ACCUM_ALPHA_SIZE 17 -#define GLX_BAD_ATTRIBUTE 1 -#define GLX_BAD_VISUAL 4 -/*@}*/ - - -/** - * \name Unique to Mini GLX - * - * At compile time, the Mini GLX interface version can be tested with the - * MINI_GLX_VERSION_1_x preprocessor tokens. - * - * \sa glXQueryVersion() - */ -/*@{*/ -/** \brief Defined if version 1.0 of Mini GLX is supported. */ -#define MINI_GLX_VERSION_1_0 1 -/** \brief Defined if version 1.1 of Mini GLX is supported. */ -#define MINI_GLX_VERSION_1_1 1 -/*@}*/ - - -/** - * \name Server-specific functions - */ -extern MINI_Display * -__miniglx_StartServer( const char *display_name ); - -extern int -__miniglx_Select( MINI_Display *dpy, int maxfd, - fd_set *rfds, fd_set *wfds, fd_set *xfds, - struct timeval *tv ); - - -/** - * \name Simulated Xlib functions - */ -/*@{*/ -extern MINI_Display * -XOpenDisplay( const char *dpy_name ); - - -extern void -XCloseDisplay( MINI_Display *display ); - -extern MINI_Window -XCreateWindow( MINI_Display *display, MINI_Window parent, int x, int y, - unsigned int width, unsigned int height, - unsigned int border_width, int depth, unsigned int winclass, - Visual *visual, unsigned long valuemask, - XSetWindowAttributes *attributes ); - -extern int -XNextEvent(MINI_Display *display, XEvent *event_return); - -extern MINI_Bool -XCheckMaskEvent( MINI_Display *dpy, long event_mask, XEvent *event_return ); - -/** - * \brief Return the root window. - * - * \param display the display handle. It is ignored by Mini GLX, but should be - * the value returned by XOpenDisplay(). - * \param screen the screen number on the host server. It is ignored by Mini - * GLX but should be zero. - * - * \return the root window. Always zero on Mini GLX. - */ -#define RootWindow(display, screen) 0 -#define DefaultScreen(dpy) 0 - -extern void -XDestroyWindow( MINI_Display *display, MINI_Window w ); - -extern void -XMapWindow( MINI_Display *display, MINI_Window w ); - -/* Should clients have access to this? - */ -extern void -XUnmapWindow( MINI_Display *display, MINI_Window w ); - -extern MINI_Colormap -XCreateColormap( MINI_Display *display, MINI_Window w, Visual *visual, int alloc ); - -extern void -XFreeColormap( MINI_Display *display, MINI_Colormap cmap ); - -extern void -XFree( void *data ); - -extern XVisualInfo * -XGetVisualInfo( MINI_Display *display, long vinfo_mask, - XVisualInfo *vinfo_template, int *nitems_return ); -/*@}*/ - - - -/** - * \name GLX functions - */ -/*@{*/ -extern XVisualInfo* -glXChooseVisual( MINI_Display *dpy, int screen, int *attribList ); - -extern int -glXGetConfig( MINI_Display *dpy, XVisualInfo *vis, int attrib, int *value ); - -extern GLXContext -glXCreateContext( MINI_Display *dpy, XVisualInfo *vis, - GLXContext shareList, MINI_Bool direct ); - -extern void -glXDestroyContext( MINI_Display *dpy, GLXContext ctx ); - -extern MINI_Bool -glXMakeCurrent( MINI_Display *dpy, GLXDrawable drawable, GLXContext ctx); - -extern void -glXSwapBuffers( MINI_Display *dpy, GLXDrawable drawable ); - -extern GLXContext -glXGetCurrentContext( void ); - -extern GLXDrawable -glXGetCurrentDrawable( void ); - -extern void -(*glXGetProcAddress(const GLubyte *procname))( void ); - -extern MINI_Bool -glXQueryVersion( MINI_Display *dpy, int *major, int *minor ); - -/* Added in MiniGLX 1.1 */ -extern GLXPbuffer -glXCreatePbuffer( MINI_Display *dpy, GLXFBConfig config, const int *attribList ); - -extern void -glXDestroyPbuffer( MINI_Display *dpy, GLXPbuffer pbuf ); - -extern GLXFBConfig * -glXChooseFBConfig( MINI_Display *dpy, int screen, const int *attribList, - int *nitems ); - -extern XVisualInfo * -glXGetVisualFromFBConfig( MINI_Display *dpy, GLXFBConfig config ); - -extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, - size_t size, float readFreq, - float writeFreq, float priority); - -extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer); - -extern GLuint glXGetMemoryOffsetMESA( Display *dpy, int scrn, - const void *pointer ); -/*@}*/ - -extern void -__glXScrEnableExtension( void *, const char * name ); - -/*@}*/ - - -#ifdef __cplusplus -} -#endif - -#endif /* MINIGLX_H */ diff --git a/progs/miniglx/.gitignore b/progs/miniglx/.gitignore deleted file mode 100644 index f630f591f6..0000000000 --- a/progs/miniglx/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -manytex -miniglxsample -miniglxtest -sample_server -sample_server2 -texline diff --git a/progs/miniglx/Makefile b/progs/miniglx/Makefile deleted file mode 100644 index e6f5fa558e..0000000000 --- a/progs/miniglx/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# Makefile for miniglx demo programs - -TOP = ../.. - -include $(TOP)/configs/current - - -SOURCES = miniglxtest.c \ - miniglxsample.c \ - sample_server.c \ - sample_server2.c \ - manytex.c \ - texline.c - -OBJECTS = $(SOURCES:.c=.o) - -PROGS = $(SOURCES:%.c=%) - -INCLUDES = \ - -I. \ - -I$(TOP)/include - -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) - - -##### RULES ##### - -.SUFFIXES: -.SUFFIXES: .c - -.c: - $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ - - -##### TARGETS ##### - -default: depend $(PROGS) - -clean: - -rm -f $(PROGS) - -rm -f *.o - - -depend: $(SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -include depend diff --git a/progs/miniglx/glfbdevtest.c b/progs/miniglx/glfbdevtest.c deleted file mode 100644 index d4efb96930..0000000000 --- a/progs/miniglx/glfbdevtest.c +++ /dev/null @@ -1,477 +0,0 @@ - -/* - * Test the GLFBDev interface. Only tested with radeonfb driver!!!! - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "GL/glfbdev.h" - -#define DEFAULT_DEPTH 8 - -static struct fb_fix_screeninfo FixedInfo; -static struct fb_var_screeninfo VarInfo, OrigVarInfo; -static int DesiredDepth = 0; -static int OriginalVT = -1; -static int ConsoleFD = -1; -static int FrameBufferFD = -1; -static caddr_t FrameBuffer = (caddr_t) -1; -static caddr_t MMIOAddress = (caddr_t) -1; - - -static void -print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s) -{ - static const char *visuals[] = { - "MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR", - "DIRECTCOLOR", "STATIC_PSEUDOCOLOR" - }; - - printf("%s info -----------------------\n", s); - printf("id = %16s\n", fixed->id); - printf("smem_start = 0x%x\n", fixed->smem_start); - printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len); - printf("type = 0x%x\n", fixed->type); - printf("type_aux = 0x%x\n", fixed->type_aux); - printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]); - printf("xpanstep = %d\n", fixed->xpanstep); - printf("ypanstep = %d\n", fixed->ypanstep); - printf("ywrapstep = %d\n", fixed->ywrapstep); - printf("line_length = %d\n", fixed->line_length); - printf("mmio_start = 0x%x\n", fixed->mmio_start); - printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len); - printf("accel = 0x%x\n", fixed->accel); -} - - -static void -print_var_info(const struct fb_var_screeninfo *var, const char *s) -{ - printf("%s info -----------------------\n", s); - printf("xres = %d\n", var->xres); - printf("yres = %d\n", var->yres); - printf("xres_virtual = %d\n", var->xres_virtual); - printf("yres_virtual = %d\n", var->yres_virtual); - printf("xoffset = %d\n", var->xoffset); - printf("yoffset = %d\n", var->yoffset); - printf("bits_per_pixel = %d\n", var->bits_per_pixel); - printf("grayscale = %d\n", var->grayscale); - - printf("red.offset = %d length = %d msb_right = %d\n", - var->red.offset, var->red.length, var->red.msb_right); - printf("green.offset = %d length = %d msb_right = %d\n", - var->green.offset, var->green.length, var->green.msb_right); - printf("blue.offset = %d length = %d msb_right = %d\n", - var->blue.offset, var->blue.length, var->blue.msb_right); - printf("transp.offset = %d length = %d msb_right = %d\n", - var->transp.offset, var->transp.length, var->transp.msb_right); - - printf("nonstd = %d\n", var->nonstd); - printf("activate = %d\n", var->activate); - printf("height = %d mm\n", var->height); - printf("width = %d mm\n", var->width); - printf("accel_flags = 0x%x\n", var->accel_flags); - printf("pixclock = %d\n", var->pixclock); - printf("left_margin = %d\n", var->left_margin); - printf("right_margin = %d\n", var->right_margin); - printf("upper_margin = %d\n", var->upper_margin); - printf("lower_margin = %d\n", var->lower_margin); - printf("hsync_len = %d\n", var->hsync_len); - printf("vsync_len = %d\n", var->vsync_len); - printf("sync = %d\n", var->sync); - printf("vmode = %d\n", var->vmode); -} - - -static void -signal_handler(int signumber) -{ - signal(signumber, SIG_IGN); /* prevent recursion! */ - fprintf(stderr, "error: got signal %d (exiting)\n", signumber); - exit(1); -} - - -static void -initialize_fbdev( void ) -{ - char ttystr[1000]; - int fd, vtnumber, ttyfd; - int sz; - - if (geteuid()) { - fprintf(stderr, "error: you need to be root\n"); - exit(1); - } - -#if 1 - /* open the framebuffer device */ - FrameBufferFD = open("/dev/fb0", O_RDWR); - if (FrameBufferFD < 0) { - fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); - exit(1); - } -#endif - - /* open /dev/tty0 and get the vt number */ - if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) { - fprintf(stderr, "error opening /dev/tty0\n"); - exit(1); - } - if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) { - fprintf(stderr, "error: couldn't get a free vt\n"); - exit(1); - } - close(fd); - - /* open the console tty */ - sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */ - ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0); - if (ConsoleFD < 0) { - fprintf(stderr, "error couldn't open console fd\n"); - exit(1); - } - - /* save current vt number */ - { - struct vt_stat vts; - if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0) - OriginalVT = vts.v_active; - } - - /* disconnect from controlling tty */ - ttyfd = open("/dev/tty", O_RDWR); - if (ttyfd >= 0) { - ioctl(ttyfd, TIOCNOTTY, 0); - close(ttyfd); - } - - /* some magic to restore the vt when we exit */ - { - struct vt_mode vt; - if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0) - printf("ioctl VT_ACTIVATE: %s\n", strerror(errno)); - if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0) - printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno)); - - if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) { - fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno)); - exit(1); - } - - vt.mode = VT_PROCESS; - vt.relsig = SIGUSR1; - vt.acqsig = SIGUSR1; - if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) { - fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n", - strerror(errno)); - exit(1); - } - } - - /* go into graphics mode */ - if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) { - fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n", - strerror(errno)); - exit(1); - } - - -#if 0 - /* open the framebuffer device */ - FrameBufferFD = open("/dev/fb0", O_RDWR); - if (FrameBufferFD < 0) { - fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno)); - exit(1); - } -#endif - - /* Get the fixed screen info */ - if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", - strerror(errno)); - exit(1); - } - - print_fixed_info(&FixedInfo, "Fixed"); - - - /* get the variable screen info */ - if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) { - fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", - strerror(errno)); - exit(1); - } - - print_var_info(&OrigVarInfo, "Orig Var"); - - /* operate on a copy */ - VarInfo = OrigVarInfo; - - /* set the depth, resolution, etc */ - DesiredDepth = 32; - if (DesiredDepth) - VarInfo.bits_per_pixel = DesiredDepth; - - if (VarInfo.bits_per_pixel == 16) { - VarInfo.red.offset = 11; - VarInfo.green.offset = 5; - VarInfo.blue.offset = 0; - VarInfo.red.length = 5; - VarInfo.green.length = 6; - VarInfo.blue.length = 5; - VarInfo.transp.offset = 0; - VarInfo.transp.length = 0; - } - else if (VarInfo.bits_per_pixel == 32) { - VarInfo.red.offset = 16; - VarInfo.green.offset = 8; - VarInfo.blue.offset = 0; - VarInfo.transp.offset = 24; - VarInfo.red.length = 8; - VarInfo.green.length = 8; - VarInfo.blue.length = 8; - VarInfo.transp.length = 8; - } - /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */ - VarInfo.xres_virtual = VarInfo.xres = 1280; - VarInfo.yres_virtual = VarInfo.yres = 1024; - VarInfo.pixclock = 7408; - VarInfo.left_margin = 248; - VarInfo.right_margin = 16; - VarInfo.upper_margin = 38; - VarInfo.lower_margin = 1; - VarInfo.hsync_len = 144; - VarInfo.vsync_len = 3; - - VarInfo.xoffset = 0; - VarInfo.yoffset = 0; - VarInfo.nonstd = 0; - VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */ - - /* set new variable screen info */ - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - exit(1); - } - - print_var_info(&VarInfo, "New Var"); - - if (FixedInfo.visual != FB_VISUAL_TRUECOLOR && - FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) { - fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual); - exit(1); - } - - /* initialize colormap */ - if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { - struct fb_cmap cmap; - unsigned short red[256], green[256], blue[256]; - int i; - - /* we're assuming 256 entries here */ - printf("initializing directcolor colormap\n"); - cmap.start = 0; - cmap.len = 256; - cmap.red = red; - cmap.green = green; - cmap.blue = blue; - cmap.transp = NULL; - for (i = 0; i < cmap.len; i++) { - red[i] = green[i] = blue[i] = (i << 8) | i; - } - if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) { - fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i); - } - } - - /* - * fbdev says the frame buffer is at offset zero, and the mmio region - * is immediately after. - */ - - /* mmap the framebuffer into our address space */ - FrameBuffer = (caddr_t) mmap(0, /* start */ - FixedInfo.smem_len, /* bytes */ - PROT_READ | PROT_WRITE, /* prot */ - MAP_SHARED, /* flags */ - FrameBufferFD, /* fd */ - 0 /* offset */); - if (FrameBuffer == (caddr_t) - 1) { - fprintf(stderr, "error: unable to mmap framebuffer: %s\n", - strerror(errno)); - exit(1); - } - printf("FrameBuffer = %p\n", FrameBuffer); - -#if 1 - /* mmap the MMIO region into our address space */ - MMIOAddress = (caddr_t) mmap(0, /* start */ - FixedInfo.mmio_len, /* bytes */ - PROT_READ | PROT_WRITE, /* prot */ - MAP_SHARED, /* flags */ - FrameBufferFD, /* fd */ - FixedInfo.smem_len /* offset */); - if (MMIOAddress == (caddr_t) - 1) { - fprintf(stderr, "error: unable to mmap mmio region: %s\n", - strerror(errno)); - } - printf("MMIOAddress = %p\n", MMIOAddress); - - /* try out some simple MMIO register reads */ - if (1) - { - typedef unsigned int CARD32; - typedef unsigned char CARD8; -#define RADEON_CONFIG_MEMSIZE 0x00f8 -#define RADEON_MEM_SDRAM_MODE_REG 0x0158 -#define MMIO_IN32(base, offset) \ - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) -#define INREG(addr) MMIO_IN32(MMIOAddress, addr) - int sz, type; - const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"}; - sz = INREG(RADEON_CONFIG_MEMSIZE); - type = INREG(RADEON_MEM_SDRAM_MODE_REG); - printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024); - printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n", - type >> 30, typeStr[type>>30]); - } -#endif - -} - - -static void -shutdown_fbdev( void ) -{ - struct vt_mode VT; - - printf("cleaning up...\n"); - /* restore original variable screen info */ - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) { - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - exit(1); - } - - munmap(MMIOAddress, FixedInfo.mmio_len); - munmap(FrameBuffer, FixedInfo.smem_len); - close(FrameBufferFD); - - /* restore text mode */ - ioctl(ConsoleFD, KDSETMODE, KD_TEXT); - - /* set vt */ - if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) { - VT.mode = VT_AUTO; - ioctl(ConsoleFD, VT_SETMODE, &VT); - } - - /* restore original vt */ - if (OriginalVT >= 0) { - ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT); - OriginalVT = -1; - } - - close(ConsoleFD); -} - - -static void -gltest( void ) -{ - static const int attribs[] = { - GLFBDEV_DOUBLE_BUFFER, - GLFBDEV_DEPTH_SIZE, 16, - GLFBDEV_NONE - }; - GLFBDevContextPtr ctx; - GLFBDevBufferPtr buf; - GLFBDevVisualPtr vis; - int bytes, r, g, b, a; - float ang; - - printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR)); - printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION)); - - /* framebuffer size */ - bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8; - - vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs ); - assert(vis); - - buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes ); - assert(buf); - - ctx = glFBDevCreateContext( vis, NULL ); - assert(buf); - - b = glFBDevMakeCurrent( ctx, buf, buf ); - assert(b); - - /*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/ - glGetIntegerv(GL_RED_BITS, &r); - glGetIntegerv(GL_GREEN_BITS, &g); - glGetIntegerv(GL_BLUE_BITS, &b); - glGetIntegerv(GL_ALPHA_BITS, &a); - printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n", - r, g, b, a); - - glClearColor(0.5, 0.5, 1.0, 0); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glFrustum(-1, 1, -1, 1, 2, 30); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef(0, 0, -15); - glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - for (ang = 0; ang <= 180; ang += 15) { - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glPushMatrix(); - glRotatef(ang, 1, 0, 0); - glutSolidTorus(1, 3, 40, 20); - glPopMatrix(); - glFBDevSwapBuffers(buf); - } - - /* clean up */ - b = glFBDevMakeCurrent( NULL, NULL, NULL); - assert(b); - - glFBDevDestroyContext(ctx); - glFBDevDestroyBuffer(buf); - glFBDevDestroyVisual(vis); -} - - -int -main( int argc, char *argv[] ) -{ - signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */ - signal(SIGSEGV, signal_handler); /* catch segfaults */ - - initialize_fbdev(); - gltest(); - shutdown_fbdev(); - - return 0; -} diff --git a/progs/miniglx/manytex.c b/progs/miniglx/manytex.c deleted file mode 100644 index 74b06649f6..0000000000 --- a/progs/miniglx/manytex.c +++ /dev/null @@ -1,381 +0,0 @@ - -/* - * test handling of many texture maps - * Also tests texture priority and residency. - * - * Brian Paul - * August 2, 2000 - */ - - -#include -#include -#include -#include -#include -#include - - -static GLint NumTextures = 20; -static GLuint *TextureID = NULL; -static GLint *TextureWidth = NULL, *TextureHeight = NULL; -static GLboolean *TextureResidency = NULL; -static GLint TexWidth = 128, TexHeight = 128; -static GLfloat Zrot = 0; -static GLboolean Anim = GL_TRUE; -static GLint WinWidth = 500, WinHeight = 400; -static GLboolean MipMap = GL_FALSE; -static GLboolean LinearFilter = GL_FALSE; -static GLboolean RandomSize = GL_FALSE; -static GLint Rows, Columns; -static GLint LowPriorityCount = 0; - - -static void Idle( void ) -{ - Zrot += 1.0; - glutPostRedisplay(); -} - - -static void Display( void ) -{ - GLfloat spacing = WinWidth / Columns; - GLfloat size = spacing * 0.4; - GLint i; - - /* test residency */ - if (0) - { - GLboolean b; - GLint i, resident; - b = glAreTexturesResident(NumTextures, TextureID, TextureResidency); - if (b) { - printf("all resident\n"); - } - else { - resident = 0; - for (i = 0; i < NumTextures; i++) { - if (TextureResidency[i]) { - resident++; - } - } - printf("%d of %d texture resident\n", resident, NumTextures); - } - } - - /* render the textured quads */ - glClear( GL_COLOR_BUFFER_BIT ); - for (i = 0; i < NumTextures; i++) { - GLint row = i / Columns; - GLint col = i % Columns; - GLfloat x = col * spacing + spacing * 0.5; - GLfloat y = row * spacing + spacing * 0.5; - - GLfloat maxDim = (TextureWidth[i] > TextureHeight[i]) - ? TextureWidth[i] : TextureHeight[i]; - GLfloat w = TextureWidth[i] / maxDim; - GLfloat h = TextureHeight[i] / maxDim; - - glPushMatrix(); - glTranslatef(x, y, 0.0); - glRotatef(Zrot, 0, 0, 1); - glScalef(size, size, 1); - - glBindTexture(GL_TEXTURE_2D, TextureID[i]); - glBegin(GL_POLYGON); -#if 0 - glTexCoord2f(0, 0); glVertex2f(-1, -1); - glTexCoord2f(1, 0); glVertex2f( 1, -1); - glTexCoord2f(1, 1); glVertex2f( 1, 1); - glTexCoord2f(0, 1); glVertex2f(-1, 1); -#else - glTexCoord2f(0, 0); glVertex2f(-w, -h); - glTexCoord2f(1, 0); glVertex2f( w, -h); - glTexCoord2f(1, 1); glVertex2f( w, h); - glTexCoord2f(0, 1); glVertex2f(-w, h); -#endif - glEnd(); - glPopMatrix(); - } - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - WinWidth = width; - WinHeight = height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glOrtho(0, width, 0, height, -1, 1); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); -} - - -/* - * Return a random int in [min, max]. - */ -static int RandomInt(int min, int max) -{ - int i = rand(); - int j = i % (max - min + 1); - return min + j; -} - - - -static void Init( void ) -{ - GLint i; - - if (RandomSize) { - printf("Creating %d %s random-size textures, ", NumTextures, - MipMap ? "Mipmapped" : "non-Mipmapped"); - } - else { - printf("Creating %d %s %d x %d textures, ", NumTextures, - MipMap ? "Mipmapped" : "non-Mipmapped", - TexWidth, TexHeight); - } - - if (LinearFilter) { - printf("bilinear filtering\n"); - } - else { - printf("nearest filtering\n"); - } - - - /* compute number of rows and columns of rects */ - { - GLfloat area = (GLfloat) (WinWidth * WinHeight) / (GLfloat) NumTextures; - GLfloat edgeLen = sqrt(area); - - Columns = WinWidth / edgeLen; - Rows = (NumTextures + Columns - 1) / Columns; - printf("Rows: %d Cols: %d\n", Rows, Columns); - } - - - if (!TextureID) { - TextureID = (GLuint *) malloc(sizeof(GLuint) * NumTextures); - assert(TextureID); - glGenTextures(NumTextures, TextureID); - } - - if (!TextureResidency) { - TextureResidency = (GLboolean *) malloc(sizeof(GLboolean) * NumTextures); - assert(TextureResidency); - } - - if (!TextureWidth) { - TextureWidth = (GLint *) malloc(sizeof(GLint) * NumTextures); - assert(TextureWidth); - } - if (!TextureHeight) { - TextureHeight = (GLint *) malloc(sizeof(GLint) * NumTextures); - assert(TextureHeight); - } - - for (i = 0; i < NumTextures; i++) { - GLubyte color[4]; - GLubyte *texImage; - GLint j, row, col; - - row = i / Columns; - col = i % Columns; - - glBindTexture(GL_TEXTURE_2D, TextureID[i]); - - if (i < LowPriorityCount) - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY, 0.5F); - - if (RandomSize) { -#if 0 - int k = (glutGet(GLUT_ELAPSED_TIME) % 7) + 2; - TexWidth = 1 << k; - TexHeight = 1 << k; -#else - TexWidth = 1 << RandomInt(2, 7); - TexHeight = 1 << RandomInt(2, 7); - printf("Random size of %3d: %d x %d\n", i, TexWidth, TexHeight); -#endif - } - - TextureWidth[i] = TexWidth; - TextureHeight[i] = TexHeight; - - texImage = (GLubyte*) malloc(4 * TexWidth * TexHeight * sizeof(GLubyte)); - assert(texImage); - - /* determine texture color */ - color[0] = (GLint) (255.0 * ((float) col / (Columns - 1))); - color[1] = 127; - color[2] = (GLint) (255.0 * ((float) row / (Rows - 1))); - color[3] = 255; - - /* fill in solid-colored teximage */ - for (j = 0; j < TexWidth * TexHeight; j++) { - texImage[j*4+0] = color[0]; - texImage[j*4+1] = color[1]; - texImage[j*4+2] = color[2]; - texImage[j*4+3] = color[3]; - } - - if (MipMap) { - GLint level = 0; - GLint w = TexWidth, h = TexHeight; - while (1) { - glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w, h, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texImage); - if (w == 1 && h == 1) - break; - if (w > 1) - w /= 2; - if (h > 1) - h /= 2; - level++; - /*printf("%d: %d x %d\n", level, w, h);*/ - } - if (LinearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_NEAREST_MIPMAP_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - } - else { - /* Set corners to white */ - int k = 0; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth - 1) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth * TexHeight - TexWidth) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - k = (TexWidth * TexHeight - 1) * 4; - texImage[k+0] = texImage[k+1] = texImage[k+2] = texImage[k+3] = 255; - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TexWidth, TexHeight, 0, - GL_RGBA, GL_UNSIGNED_BYTE, texImage); - if (LinearFilter) { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - } - else { - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - } - } - - free(texImage); - } - - glEnable(GL_TEXTURE_2D); -} - - -static void Key( unsigned char key, int x, int y ) -{ - const GLfloat step = 3.0; - (void) x; - (void) y; - switch (key) { - case 'a': - Anim = !Anim; - if (Anim) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 's': - Idle(); - break; - case 'z': - Zrot -= step; - break; - case 'Z': - Zrot += step; - break; - case ' ': - Init(); - break; - case 27: - exit(0); - break; - } - glutPostRedisplay(); -} - - -int main( int argc, char *argv[] ) -{ - GLint i; - - glutInit( &argc, argv ); - glutInitWindowPosition( 0, 0 ); - glutInitWindowSize( WinWidth, WinHeight ); - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - glutCreateWindow(argv[0]); - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutDisplayFunc( Display ); - if (Anim) - glutIdleFunc(Idle); - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-n") == 0) { - NumTextures = atoi(argv[i+1]); - if (NumTextures <= 0) { - printf("Error, bad number of textures\n"); - return 1; - } - i++; - } - else if (strcmp(argv[i], "-mipmap") == 0) { - MipMap = GL_TRUE; - } - else if (strcmp(argv[i], "-linear") == 0) { - LinearFilter = GL_TRUE; - } - else if (strcmp(argv[i], "-size") == 0) { - TexWidth = atoi(argv[i+1]); - TexHeight = atoi(argv[i+2]); - assert(TexWidth >= 1); - assert(TexHeight >= 1); - i += 2; - } - else if (strcmp(argv[i], "-randomsize") == 0) { - RandomSize = GL_TRUE; - } - else if (strcmp(argv[i], "-lowpri") == 0) { - LowPriorityCount = atoi(argv[i+1]); - i++; - } - else { - printf("Usage:\n"); - printf(" manytex [options]\n"); - printf("Options:\n"); - printf(" -n \n"); - printf(" -size - specify texture size\n"); - printf(" -randomsize - use random size textures\n"); - printf(" -mipmap - generate mipmaps\n"); - printf(" -linear - use linear filtering instead of nearest\n"); - printf(" -lowpri - Set lower priority on textures\n"); - return 0; - } - } - - Init(); - - glutMainLoop(); - - return 0; -} diff --git a/progs/miniglx/miniglxsample.c b/progs/miniglx/miniglxsample.c deleted file mode 100644 index d4d6729f93..0000000000 --- a/progs/miniglx/miniglxsample.c +++ /dev/null @@ -1,128 +0,0 @@ - -#define USE_MINIGLX 1 /* 1 = use Mini GLX, 0 = use Xlib/GLX */ - -#include -#include -#include -#include - -#if USE_MINIGLX -#include -#else -#include -#include -#endif - -static void _subset_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) -{ - glBegin( GL_QUADS ); - glVertex2f( x1, y1 ); - glVertex2f( x2, y1 ); - glVertex2f( x2, y2 ); - glVertex2f( x1, y2 ); - glEnd(); -} - - -/* - * Create a simple double-buffered RGBA window. - */ -static Window -MakeWindow(Display * dpy, unsigned int width, unsigned int height) -{ - int visAttributes[] = { - GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DOUBLEBUFFER, - None - }; - XSetWindowAttributes attr; - unsigned long attrMask; - Window root; - Window win; - GLXContext ctx; - XVisualInfo *visinfo; - - root = RootWindow(dpy, 0); - - /* Choose GLX visual / pixel format */ - visinfo = glXChooseVisual(dpy, 0, visAttributes); - if (!visinfo) { - printf("Error: couldn't get an RGB, Double-buffered visual\n"); - exit(1); - } - - /* Create the window */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); - attrMask = CWBackPixel | CWBorderPixel | CWColormap; - win = XCreateWindow(dpy, root, 0, 0, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, attrMask, &attr); - if (!win) { - printf("Error: XCreateWindow failed\n"); - exit(1); - } - - /* Display the window */ - XMapWindow(dpy, win); - - /* Create GLX rendering context */ - ctx = glXCreateContext(dpy, visinfo, NULL, True); - if (!ctx) { - printf("Error: glXCreateContext failed\n"); - exit(1); - } - - /* Bind the rendering context and window */ - glXMakeCurrent(dpy, win, ctx); - - glViewport(0, 0, width, height); - - return win; -} - - -/* - * Draw a few frames of a rotating square. - */ -static void -DrawFrames(Display * dpy, Window win) -{ - int angle; - glShadeModel(GL_FLAT); - glClearColor(0.5, 0.5, 0.5, 1.0); - for (angle = 0; angle < 360; angle += 10) { - glClear(GL_COLOR_BUFFER_BIT); - glColor3f(1.0, 1.0, 0.0); - glPushMatrix(); - glRotatef(angle, 0, 0, 1); - _subset_Rectf(-0.8, -0.8, 0.8, 0.8); - glPopMatrix(); - glXSwapBuffers(dpy, win); - sleep(1); - } -} - - -int -main(int argc, char *argv[]) -{ - Display *dpy; - Window win; - - dpy = XOpenDisplay(NULL); - if (!dpy) { - printf("Error: XOpenDisplay failed\n"); - return 1; - } - - win = MakeWindow(dpy, 300, 300); - - DrawFrames(dpy, win); - - return 0; -} diff --git a/progs/miniglx/miniglxtest.c b/progs/miniglx/miniglxtest.c deleted file mode 100644 index 85c25be4ed..0000000000 --- a/progs/miniglx/miniglxtest.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Test the mini GLX interface. - */ - - -#include -#include -#include -#include -#include -#define USE_MINI_GLX 1 -#if USE_MINI_GLX -#include -#else -#include -#endif - -static GLXContext ctx; - -static GLuint NumFrames = 100; -static GLuint NumDisplays = 1; -static GLboolean Texture = GL_FALSE; -static GLboolean SingleBuffer = GL_FALSE; -static GLboolean Sleeps = GL_TRUE; - - -static void -rect(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) -{ - glBegin(GL_QUADS); - glTexCoord2f(0, 0); glColor3f(0, 0, 1); glVertex2f(x1, y1); - glTexCoord2f(1, 0); glColor3f(1, 0, 0); glVertex2f(x2, y1); - glTexCoord2f(1, 1); glColor3f(0, 1, 0); glVertex2f(x2, y2); - glTexCoord2f(0, 1); glColor3f(0, 0, 0); glVertex2f(x1, y2); - glEnd(); -} - - -static void -redraw(Display *dpy, Window w, int rot) -{ - GLfloat a; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(rot, 0, 0, 1); - glScalef(.5, .5, .5); - for (a = 0.0; a < 360.0; a += 30.0) { - glPushMatrix(); - glRotatef(a, 0, 0, 1); - glRotatef(40, 1, 0, 0); - glColor3f(a / 360.0, 1-a/360.0, 0); - rect(0.3, -0.25, 1.5, 0.25); - glPopMatrix(); - } - glPopMatrix(); - - if (SingleBuffer) - glFlush(); - else - glXSwapBuffers(dpy, w); -} - - -static Window -make_window(Display *dpy, unsigned int width, unsigned int height) -{ - int attrib_single[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 1, - None }; - int attrib_double[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 1, - GLX_DOUBLEBUFFER, - None }; - int *attrib = SingleBuffer ? attrib_single : attrib_double; - int scrnum = 0; - XSetWindowAttributes attr; - unsigned long mask; - Window root; - Window win; - XVisualInfo *visinfo; - - root = RootWindow(dpy, scrnum); - - if (!(visinfo = glXChooseVisual(dpy, scrnum, attrib))) { - printf("Error: couldn't get an RGB, Double-buffered visual\n"); - exit(1); - } - - if (!(ctx = glXCreateContext(dpy, visinfo, NULL, True))) { - printf("Error: glXCreateContext failed\n"); - exit(1); - } - - /* window attributes */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap(dpy, root, visinfo->visual, AllocNone); - attr.event_mask = StructureNotifyMask | ExposureMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - - win = XCreateWindow(dpy, root, 0, 0, width, height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr); - if (!win) { - printf("Error: XCreateWindow failed\n"); - exit(1); - } - - glXMakeCurrent(dpy, win, ctx); - - glViewport(0, 0, width, height); - - return win; -} - - -static void -event_loop(Display *dpy, Window win) -{ - int i; - - printf("Drawing %d frames\n", NumFrames); - - for (i = 0; i < NumFrames; i++) { - redraw(dpy, win, -i*2); - if (Sleeps) { - usleep(20000); - } - } -} - - -static int -runtest(void) -{ - Display *dpy; - Window win; - - dpy = XOpenDisplay(NULL); - if (!dpy) { - printf("Error: XOpenDisplay failed\n"); - return 1; - } - - win = make_window(dpy, 800, 600); - - srand(getpid()); - - /* init GL state */ - glClearColor(0.5, 0.5, 0.5, 1.0); - glEnable(GL_DEPTH_TEST); - if (Texture) { - GLubyte image[16][16][4]; - GLint i, j; - for (i = 0; i < 16; i++) { - for (j = 0; j < 16; j++) { - if (((i / 2) ^ (j / 2)) & 1) { - image[i][j][0] = 255; - image[i][j][1] = 255; - image[i][j][2] = 255; - image[i][j][3] = 255; - } - else { - image[i][j][0] = 128; - image[i][j][1] = 128; - image[i][j][2] = 128; - image[i][j][3] = 128; - } - } - } - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, - GL_RGBA, GL_UNSIGNED_BYTE, image); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glEnable(GL_TEXTURE_2D); - } - if (SingleBuffer) { - glDrawBuffer(GL_FRONT); - glReadBuffer(GL_FRONT); - } - else { - glDrawBuffer(GL_BACK); - } - - XMapWindow(dpy, win); - - /* wait for window to get mapped */ - { - XEvent e; - while (1) { - XNextEvent(dpy, &e); - if (e.type == MapNotify && e.xmap.window == win) { - break; - } - } - } - - event_loop(dpy, win); - - glXDestroyContext(dpy, ctx); - XDestroyWindow(dpy, win); - - XCloseDisplay(dpy); - - return 0; -} - - -static void -usage(void) -{ - printf("Usage:\n"); - printf(" -f N render N frames (default %d)\n", NumFrames); - printf(" -d N do N display cycles\n"); - printf(" -t texturing\n"); - printf(" -s single buffering\n"); - printf(" -n no usleep() delay\n"); -} - - -static void -parse_args(int argc, char *argv[]) -{ - int i; - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-f") == 0) { - NumFrames = atoi(argv[i + 1]); - i++; - } - else if (strcmp(argv[i], "-d") == 0) { - NumDisplays = atoi(argv[i + 1]); - i++; - } - else if (strcmp(argv[i], "-n") == 0) { - Sleeps = GL_FALSE; - } - else if (strcmp(argv[i], "-s") == 0) { - SingleBuffer = GL_TRUE; - } - else if (strcmp(argv[i], "-t") == 0) { - Texture = GL_TRUE; - } - else { - usage(); - exit(1); - } - } -} - - -int -main(int argc, char *argv[]) -{ - int i; - - parse_args(argc, argv); - - for (i = 0; i < NumDisplays; i++) { - if (runtest() != 0) - break; - } - - return 0; -} diff --git a/progs/miniglx/sample_server.c b/progs/miniglx/sample_server.c deleted file mode 100644 index 62456eca25..0000000000 --- a/progs/miniglx/sample_server.c +++ /dev/null @@ -1,111 +0,0 @@ - -/* - * Sample server that just keeps first available window mapped. - */ - - -#include -#include -#include -#include - -struct client { - struct client *next; - Window windowid; - int mappable; -}; - -struct client *clients = 0, *mapped_client = 0; - - -static struct client *find_client( Window id ) -{ - struct client *c; - - for (c = clients ; c ; c = c->next) - if (c->windowid == id) - return c; - - return 0; -} - -int main( int argc, char *argv[] ) -{ - Display *dpy; - XEvent ev; - - dpy = __miniglx_StartServer(NULL); - if (!dpy) { - fprintf(stderr, "Error: __miniglx_StartServer failed\n"); - return 1; - } - - while (XNextEvent( dpy, &ev )) { - struct client *c; - - switch (ev.type) { - case MapRequest: - fprintf(stderr, "MapRequest\n"); - c = find_client(ev.xmaprequest.window); - if (!c) break; - c->mappable = True; - break; - - case UnmapNotify: - fprintf(stderr, "UnmapNotify\n"); - c = find_client(ev.xunmap.window); - if (!c) break; - c->mappable = False; - if (c == mapped_client) - mapped_client = 0; - break; - - case CreateNotify: - fprintf(stderr, "CreateNotify\n"); - c = malloc(sizeof(*c)); - c->next = clients; - c->windowid = ev.xcreatewindow.window; - c->mappable = False; - clients = c; - break; - - case DestroyNotify: - fprintf(stderr, "DestroyNotify\n"); - c = find_client(ev.xdestroywindow.window); - if (!c) break; - if (c == clients) - clients = c->next; - else { - struct client *t; - for (t = clients ; t->next != c ; t = t->next) - ; - t->next = c->next; - } - - if (c == mapped_client) - mapped_client = 0; - - free(c); - break; - - default: - break; - } - - /* Search for first mappable client if none already mapped. - */ - if (!mapped_client) { - for (c = clients ; c ; c = c->next) { - if (c->mappable) { - XMapWindow( dpy, c->windowid ); - mapped_client = c; - break; - } - } - } - } - - XCloseDisplay( dpy ); - - return 0; -} diff --git a/progs/miniglx/sample_server2.c b/progs/miniglx/sample_server2.c deleted file mode 100644 index efd382a6d9..0000000000 --- a/progs/miniglx/sample_server2.c +++ /dev/null @@ -1,228 +0,0 @@ - -/* - * Sample server that just keeps first available window mapped. - * - * It also reads and echos anything that happens on stdin as an - * example of tracking events from sources other than miniglx clients. - * - * It reads & writes without blocking, so that eg. piping a lot of - * text to stdin and then hitting 'ctrl-S' on the output stream won't - * cause it to stop handling miniglx events. - * - * See select_tut in the linux manual pages for a good overview of the - * select(2) system call. - */ - - -#include -#include -#include -#include -#include -#include -#include -#include - -struct client { - struct client *next; - Window windowid; - int mappable; -}; - -struct client *clients = 0, *mapped_client = 0; - -#define BUFSZ 4096 -char rbuf[BUFSZ]; -int rbuf_count; - - -static struct client *find_client( Window id ) -{ - struct client *c; - - for (c = clients ; c ; c = c->next) - if (c->windowid == id) - return c; - - return 0; -} - -int main( int argc, char *argv[] ) -{ - Display *dpy; - XEvent ev; - int autostart = 0; - - if (argc == 2 && strcmp(argv[1], "-autostart") == 0) - autostart = 1; - - dpy = __miniglx_StartServer(NULL); - if (!dpy) { - fprintf(stderr, "Error: __miniglx_StartServer failed\n"); - return 1; - } - - /* How is vt switching communicated through the XNextEvent interface? - */ - while (1) { - int r, n; - struct timeval tv; - fd_set rfds, wfds; - int bored = 0; - - FD_ZERO(&rfds); - FD_ZERO(&wfds); - tv.tv_sec = 1; - tv.tv_usec = 0; - - if (rbuf_count) { - FD_SET( 1, &wfds ); /* notify when we can write out buffer */ - n = 1; - } - else { - FD_SET( 0, &rfds ); /* else notify when new data to read */ - n = 0; - } - - /* __miniglx_Select waits until any of these file groups becomes - * readable/writable/etc (like regular select), until timeout - * expires (like regular select), until a signal is received - * (like regular select) or until an event is available for - * XCheckMaskEvent(). - */ - r = __miniglx_Select( dpy, n+1, &rfds, &wfds, 0, &tv ); - - /* This can happen if select() is interrupted by a signal: - */ - if (r < 0 && errno != EINTR && errno != EAGAIN) { - perror ("select()"); - exit (1); - } - - if (tv.tv_sec == 0 && tv.tv_usec == 0) - bored = 1; - - /* Check and handle events on our local file descriptors - */ - if (FD_ISSET( 0, &rfds )) { - /* Something on stdin */ - assert(rbuf_count == 0); - r = read(0, rbuf, BUFSZ); - if (r < 1) { - perror("read"); - abort(); - } - rbuf_count = r; - } - - if (FD_ISSET( 1, &wfds )) { - /* Can write to stdout */ - assert(rbuf_count > 0); - r = write(1, rbuf, rbuf_count); - if (r < 1) { - perror("write"); - abort(); - } - rbuf_count -= r; - if (rbuf_count) - memmove(rbuf + r, rbuf, rbuf_count); - } - - - /* Check and handle events generated by miniglx: - */ - while (XCheckMaskEvent( dpy, ~0, &ev )) { - struct client *c; - bored = 0; - - fprintf(stderr, "Received event %d\n", ev.type); - - switch (ev.type) { - case CreateNotify: - fprintf(stderr, "CreateNotify -- new client\n"); - c = malloc(sizeof(*c)); - c->next = clients; - c->windowid = ev.xcreatewindow.window; - c->mappable = False; - clients = c; - break; - - case DestroyNotify: - fprintf(stderr, "DestroyNotify\n"); - c = find_client(ev.xdestroywindow.window); - if (!c) break; - if (c == clients) - clients = c->next; - else { - struct client *t; - for (t = clients ; t->next != c ; t = t->next) - ; - t->next = c->next; - } - - if (c == mapped_client) - mapped_client = 0; - - free(c); - break; - - case MapRequest: - fprintf(stderr, "MapRequest\n"); - c = find_client(ev.xmaprequest.window); - if (!c) break; - c->mappable = True; - break; - - case UnmapNotify: - fprintf(stderr, "UnmapNotify\n"); - c = find_client(ev.xunmap.window); - if (!c) break; - c->mappable = False; - if (c == mapped_client) - mapped_client = 0; - break; - - default: - break; - } - } - - - /* Search for first mappable client if none already mapped. - */ - if (!mapped_client) { - struct client *c; - for (c = clients ; c ; c = c->next) { - if (c->mappable) { - XMapWindow( dpy, c->windowid ); - mapped_client = c; - break; - } - } - if (!clients && autostart) { - system("nohup ./texline &"); - system("nohup ./manytex &"); - } - } - else if (bored) { - struct client *c; - /* bored of mapped client now, let's try & find another one */ - for (c = mapped_client->next ; c && !c->mappable ; c = c->next) - ; - if (!c) - for (c = clients ; c && !c->mappable ; c = c->next) - ; - if (c && c != mapped_client) { - XUnmapWindow( dpy, mapped_client->windowid ); - XMapWindow( dpy, c->windowid ); - mapped_client = c; - } - else - fprintf(stderr, "I'm bored!\n"); - } - } - - XCloseDisplay( dpy ); - - return 0; -} diff --git a/progs/miniglx/texline.c b/progs/miniglx/texline.c deleted file mode 100644 index 098077f247..0000000000 --- a/progs/miniglx/texline.c +++ /dev/null @@ -1,267 +0,0 @@ - -/* - * Test textured lines. - * - * Brian Paul - * September 2000 - */ - - -#include -#include -#include -#include -#include "../util/readtex.c" /* I know, this is a hack. */ - -#define TEXTURE_FILE "../images/girl.rgb" - -static GLboolean Antialias = GL_FALSE; -static GLboolean Animate = GL_FALSE; -static GLint Texture = 1; -static GLboolean Stipple = GL_FALSE; -static GLfloat LineWidth = 1.0; - -static GLfloat Xrot = -60.0, Yrot = 0.0, Zrot = 0.0; -static GLfloat DYrot = 1.0; -static GLboolean Points = GL_FALSE; -static GLfloat Scale = 1.0; - -static void Idle( void ) -{ - if (Animate) { - Zrot += DYrot; - glutPostRedisplay(); - } -} - - -static void Display( void ) -{ - GLfloat x, y, s, t; - - glClear( GL_COLOR_BUFFER_BIT ); - - glPushMatrix(); - glRotatef(Xrot, 1.0, 0.0, 0.0); - glRotatef(Yrot, 0.0, 1.0, 0.0); - glRotatef(Zrot, 0.0, 0.0, 1.0); - glScalef(Scale, Scale, Scale); - - if (Texture) - glColor3f(1, 1, 1); - - if (Points) { - glBegin(GL_POINTS); - for (t = 0.0; t <= 1.0; t += 0.025) { - for (s = 0.0; s <= 1.0; s += 0.025) { - x = s * 2.0 - 1.0; - y = t * 2.0 - 1.0; - if (!Texture) - glColor3f(1, 0, 1); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, t, s); - glTexCoord2f(s, t); - glVertex2f(x, y); - } - } - glEnd(); - } - else { - glBegin(GL_LINES); - for (t = 0.0; t <= 1.0; t += 0.025) { - x = t * 2.0 - 1.0; - if (!Texture) - glColor3f(1, 0, 1); - glTexCoord2f(t, 0.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, t); - glVertex2f(x, -1.0); - if (!Texture) - glColor3f(0, 1, 0); - glTexCoord2f(t, 1.0); - glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 1.0, t); - glVertex2f(x, 1.0); - } - glEnd(); - } - - glPopMatrix(); - - glutSwapBuffers(); -} - - -static void Reshape( int width, int height ) -{ - GLfloat ar = (float) width / height; - glViewport( 0, 0, width, height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -ar, ar, -1.0, 1.0, 10.0, 100.0 ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -12.0 ); -} - - -static void Key( unsigned char key, int x, int y ) -{ - (void) x; - (void) y; - switch (key) { - case 'a': - Antialias = !Antialias; - if (Antialias) { - glEnable(GL_LINE_SMOOTH); - glEnable(GL_POINT_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } - else { - glDisable(GL_LINE_SMOOTH); - glDisable(GL_POINT_SMOOTH); - glDisable(GL_BLEND); - } - break; - case 't': - Texture++; - if (Texture > 2) - Texture = 0; - if (Texture == 0) { - glActiveTextureARB(GL_TEXTURE0_ARB); - glDisable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - } - else if (Texture == 1) { - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glDisable(GL_TEXTURE_2D); - } - else { - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glEnable(GL_TEXTURE_2D); - } - break; - case 'w': - LineWidth -= 0.25; - if (LineWidth < 0.25) - LineWidth = 0.25; - glLineWidth(LineWidth); - glPointSize(LineWidth); - break; - case 'W': - LineWidth += 0.25; - if (LineWidth > 8.0) - LineWidth = 8.0; - glLineWidth(LineWidth); - glPointSize(LineWidth); - break; - case 'p': - Points = !Points; - break; - case 's': - Stipple = !Stipple; - if (Stipple) - glEnable(GL_LINE_STIPPLE); - else - glDisable(GL_LINE_STIPPLE); - break; - case ' ': - Animate = !Animate; - if (Animate) - glutIdleFunc(Idle); - else - glutIdleFunc(NULL); - break; - case 27: - exit(0); - break; - } - printf("LineWidth, PointSize = %f\n", LineWidth); - glutPostRedisplay(); -} - - -static void SpecialKey( int key, int x, int y ) -{ - float step = 3.0; - (void) x; - (void) y; - - switch (key) { - case GLUT_KEY_UP: - Xrot += step; - break; - case GLUT_KEY_DOWN: - Xrot -= step; - break; - case GLUT_KEY_LEFT: - Yrot += step; - break; - case GLUT_KEY_RIGHT: - Yrot -= step; - break; - } - glutPostRedisplay(); -} - - -static void Init( int argc, char *argv[] ) -{ - GLuint u; - for (u = 0; u < 2; u++) { - glActiveTextureARB(GL_TEXTURE0_ARB + u); - glBindTexture(GL_TEXTURE_2D, 10+u); - if (u == 0) - glEnable(GL_TEXTURE_2D); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - if (u == 0) - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - else - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); - - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) { - printf("Error: couldn't load texture image\n"); - exit(1); - } - } - - glLineStipple(1, 0xff); - - if (argc > 1 && strcmp(argv[1], "-info")==0) { - printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); - printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION)); - printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR)); - printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS)); - } -} - - -int main( int argc, char *argv[] ) -{ - glutInit( &argc, argv ); - glutInitWindowSize( 400, 300 ); - - glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); - - glutCreateWindow(argv[0] ); - - Init(argc, argv); - - glutReshapeFunc( Reshape ); - glutKeyboardFunc( Key ); - glutSpecialFunc( SpecialKey ); - glutDisplayFunc( Display ); - if (Animate) - glutIdleFunc( Idle ); - - glutMainLoop(); - return 0; -} diff --git a/src/glut/mini/Makefile b/src/glut/mini/Makefile deleted file mode 100644 index b82a758d2c..0000000000 --- a/src/glut/mini/Makefile +++ /dev/null @@ -1,103 +0,0 @@ -# subset glut - -TOP = ../../.. -include $(TOP)/configs/current - -MARK = $(TOP)/src/glut/glx - -GLUT_MAJOR = 3 -GLUT_MINOR = 7 -GLUT_TINY = 1 - -INCLUDES = -I$(TOP)/include -I$(MARK) - -CORE_SOURCES = \ - bitmap.c \ - callback.c \ - color.c \ - globals.c \ - init.c \ - menu.c \ - models.c \ - overlay.c \ - state.c \ - teapot.c \ - window.c - - -MARK_SOURCES = \ - $(MARK)/glut_8x13.c \ - $(MARK)/glut_9x15.c \ - $(MARK)/glut_hel10.c \ - $(MARK)/glut_hel12.c \ - $(MARK)/glut_hel18.c \ - $(MARK)/glut_tr10.c \ - $(MARK)/glut_tr24.c - -SOURCES = $(CORE_SOURCES) $(MARK_SOURCES) - -OBJECTS = $(SOURCES:.c=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) - - -# Make the library -$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ - $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ - $(MKLIB_OPTIONS) $(OBJECTS) - - -# Run 'make -f Makefile.solo dep' to update the dependencies if you change -# what's included by any source file. -depend: $(SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -# glut pkgconfig file -pcedit = sed \ - -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \ - -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ - -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ - -e 's,@VERSION@,$(GLUT_MAJOR).$(GLUT_MINOR).$(GLUT_TINY),' \ - -e 's,@GLUT_PC_REQ_PRIV@,$(GLUT_PC_REQ_PRIV),' \ - -e 's,@GLUT_PC_LIB_PRIV@,$(GLUT_PC_LIB_PRIV),' \ - -e 's,@GLUT_PC_CFLAGS@,$(GLUT_PC_CFLAGS),' \ - -e 's,@GLUT_LIB@,$(GLUT_LIB),' -glut.pc: glut.pc.in - $(pcedit) $< > $@ - -install: glut.pc - $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL - $(MINSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) -m 644 glut.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig - - -# Remove .o and backup files -clean: depend - -rm -f depend depend.bak - -rm -f *.o *~ *.o *~ *.so *.pc libglut.so.3.7 - -include depend diff --git a/src/glut/mini/bitmap.c b/src/glut/mini/bitmap.c deleted file mode 100644 index 55a031af0a..0000000000 --- a/src/glut/mini/bitmap.c +++ /dev/null @@ -1,56 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include "glutbitmap.h" - -void APIENTRY -glutBitmapCharacter(GLUTbitmapFont font, int c) -{ - const BitmapCharRec *ch; - BitmapFontPtr fontinfo; - GLfloat swapbytes, lsbfirst, rowlength; - GLfloat skiprows, skippixels, alignment; - -#if defined(_WIN32) - fontinfo = (BitmapFontPtr) __glutFont(font); -#else - fontinfo = (BitmapFontPtr) font; -#endif - - if (c < fontinfo->first || - c >= fontinfo->first + fontinfo->num_chars) - return; - ch = fontinfo->ch[c - fontinfo->first]; - if (ch) { - /* Save current modes. */ -/* glGetFloatv(GL_UNPACK_SWAP_BYTES, &swapbytes); */ -/* glGetFloatv(GL_UNPACK_LSB_FIRST, &lsbfirst); */ -/* glGetFloatv(GL_UNPACK_ROW_LENGTH, &rowlength); */ -/* glGetFloatv(GL_UNPACK_SKIP_ROWS, &skiprows); */ -/* glGetFloatv(GL_UNPACK_SKIP_PIXELS, &skippixels); */ - glGetFloatv(GL_UNPACK_ALIGNMENT, &alignment); - /* Little endian machines (DEC Alpha for example) could - benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE - instead of GL_FALSE, but this would require changing the - generated bitmaps too. */ -/* glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); */ -/* glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); */ -/* glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); */ -/* glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); */ -/* glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); */ - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, - ch->advance, 0, ch->bitmap); - /* Restore saved modes. */ -/* glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); */ -/* glPixelStorei(GL_UNPACK_LSB_FIRST, (int)lsbfirst); */ -/* glPixelStorei(GL_UNPACK_ROW_LENGTH, (int)rowlength); */ -/* glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); */ -/* glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); */ - glPixelStorei(GL_UNPACK_ALIGNMENT, (int)alignment); - } -} diff --git a/src/glut/mini/callback.c b/src/glut/mini/callback.c deleted file mode 100644 index d4e3101cc0..0000000000 --- a/src/glut/mini/callback.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "GL/glut.h" -#include "internal.h" - - -void APIENTRY glutDisplayFunc (void (GLUTCALLBACK *func) (void)) -{ - display_func = func; -} - - -void APIENTRY glutReshapeFunc (void (GLUTCALLBACK *func) (int width, int height)) -{ - reshape_func = func; -} - - -void APIENTRY glutKeyboardFunc (void (GLUTCALLBACK *func) (unsigned char key, int x, int y)) -{ - keyboard_func = func; -} - - -void APIENTRY glutMouseFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y)) -{ - mouse_func = func; -} - - -void APIENTRY glutMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) -{ - motion_func = func; -} - - -void APIENTRY glutPassiveMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) -{ - passive_motion_func = func; -} - - -void APIENTRY glutEntryFunc (void (GLUTCALLBACK *func) (int state)) -{ - entry_func = func; -} - - -void APIENTRY glutVisibilityFunc (void (GLUTCALLBACK *func) (int state)) -{ - visibility_func = func; -} - - -void APIENTRY glutIdleFunc (void (GLUTCALLBACK *func) (void)) -{ - idle_func = func; -} - - -void APIENTRY glutTimerFunc (unsigned int millis, void (GLUTCALLBACK *func) (int value), int value) -{ -} - - -void APIENTRY glutMenuStateFunc (void (GLUTCALLBACK *func) (int state)) -{ - menu_state_func = func; -} - - -void APIENTRY glutSpecialFunc (void (GLUTCALLBACK *func) (int key, int x, int y)) -{ - special_func = func; -} - - -void APIENTRY glutSpaceballMotionFunc (void (GLUTCALLBACK *func) (int x, int y, int z)) -{ -} - - -void APIENTRY glutSpaceballRotateFunc (void (GLUTCALLBACK *func) (int x, int y, int z)) -{ -} - - -void APIENTRY glutSpaceballButtonFunc (void (GLUTCALLBACK *func) (int button, int state)) -{ -} - - -void APIENTRY glutButtonBoxFunc (void (GLUTCALLBACK *func) (int button, int state)) -{ -} - - -void APIENTRY glutDialsFunc (void (GLUTCALLBACK *func) (int dial, int value)) -{ -} - - -void APIENTRY glutTabletMotionFunc (void (GLUTCALLBACK *func) (int x, int y)) -{ -} - - -void APIENTRY glutTabletButtonFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y)) -{ -} - - -void APIENTRY glutMenuStatusFunc (void (GLUTCALLBACK *func) (int status, int x, int y)) -{ -} - - -void APIENTRY glutOverlayDisplayFunc (void (GLUTCALLBACK *func) (void)) -{ -} - - -void APIENTRY glutWindowStatusFunc (void (GLUTCALLBACK *func) (int state)) -{ -} diff --git a/src/glut/mini/color.c b/src/glut/mini/color.c deleted file mode 100644 index b53c5b669e..0000000000 --- a/src/glut/mini/color.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "GL/glut.h" - - -void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) -{ -} - - -GLfloat APIENTRY glutGetColor (int ndx, int component) -{ - return 0.0; -} - - -void APIENTRY glutCopyColormap (int win) -{ -} diff --git a/src/glut/mini/globals.c b/src/glut/mini/globals.c deleted file mode 100644 index 76db53c695..0000000000 --- a/src/glut/mini/globals.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "GL/glut.h" -#include "internal.h" - -GLenum g_display_mode = 0; -GLuint g_width = DEFAULT_WIDTH; -GLuint g_height = DEFAULT_HEIGHT; -GLint g_mouse = GL_FALSE; -GLboolean g_redisplay = GL_FALSE; -GLint g_xpos = 0; -GLint g_ypos = 0; - -void (GLUTCALLBACK *display_func) (void) = 0; -void (GLUTCALLBACK *reshape_func) (int width, int height) = 0; -void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y) = 0; -void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y) = 0; -void (GLUTCALLBACK *motion_func) (int x, int y) = 0; -void (GLUTCALLBACK *passive_motion_func) (int x, int y) = 0; -void (GLUTCALLBACK *entry_func) (int state) = 0; -void (GLUTCALLBACK *visibility_func) (int state) = 0; -void (GLUTCALLBACK *idle_func) (void) = 0; -void (GLUTCALLBACK *menu_state_func) (int state) = 0; -void (GLUTCALLBACK *special_func) (int key, int x, int y) = 0; -void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z) = 0; -void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z) = 0; -void (GLUTCALLBACK *spaceball_button_func) (int button, int state) = 0; -void (GLUTCALLBACK *button_box_func) (int button, int state) = 0; -void (GLUTCALLBACK *dials_func) (int dial, int value) = 0; -void (GLUTCALLBACK *tablet_motion_func) (int x, int y) = 0; -void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y) = 0; -void (GLUTCALLBACK *menu_status_func) (int status, int x, int y) = 0; -void (GLUTCALLBACK *overlay_display_func) (void) = 0; -void (GLUTCALLBACK *window_status_func) (int state) = 0; diff --git a/src/glut/mini/glut.pc.in b/src/glut/mini/glut.pc.in deleted file mode 100644 index 151dd0b802..0000000000 --- a/src/glut/mini/glut.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix=@INSTALL_DIR@ -exec_prefix=${prefix} -libdir=@INSTALL_LIB_DIR@ -includedir=@INSTALL_INC_DIR@ - -Name: glut -Description: Mesa OpenGL Utility Toolkit library -Requires: gl glu -Requires.private: @GLUT_PC_REQ_PRIV@ -Version: @VERSION@ -Libs: -L${libdir} -l@GLUT_LIB@ -Libs.private: @GLUT_PC_LIB_PRIV@ -Cflags: -I${includedir} @GLUT_PC_CFLAGS@ diff --git a/src/glut/mini/init.c b/src/glut/mini/init.c deleted file mode 100644 index 5588db9aba..0000000000 --- a/src/glut/mini/init.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "GL/glut.h" -#include "internal.h" - - -void APIENTRY glutInit (int *argcp, char **argv) -{ - glutGet(GLUT_ELAPSED_TIME); -} - - -void APIENTRY glutInitDisplayMode (unsigned int mode) -{ - g_display_mode = mode; -} - - -void APIENTRY glutInitWindowPosition (int x, int y) -{ - g_xpos = x; - g_ypos = y; -} - - -void APIENTRY glutInitWindowSize (int width, int height) -{ - g_width = width; - g_height = height; -} - - diff --git a/src/glut/mini/internal.h b/src/glut/mini/internal.h deleted file mode 100644 index ccd12e54af..0000000000 --- a/src/glut/mini/internal.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.0 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef INTERNAL_H_included -#define INTERNAL_H_included - - -#include "GL/glut.h" -/* #include "pc_hw/pc_hw.h" */ - - -#define MAX_WINDOWS 4 - -#define DEFAULT_WIDTH 640 -#define DEFAULT_HEIGHT 480 -#define DEFAULT_BPP 16 - -#define DEPTH_SIZE 16 -#define STENCIL_SIZE 8 -#define ACCUM_SIZE 16 - -extern GLenum g_display_mode; -extern GLuint g_width; -extern GLuint g_height; -extern GLint g_mouse; -extern GLboolean g_redisplay; -extern GLint g_xpos; -extern GLint g_ypos; - -extern void (GLUTCALLBACK *display_func) (void); -extern void (GLUTCALLBACK *reshape_func) (int width, int height); -extern void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y); -extern void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y); -extern void (GLUTCALLBACK *motion_func) (int x, int y); -extern void (GLUTCALLBACK *passive_motion_func) (int x, int y); -extern void (GLUTCALLBACK *entry_func) (int state); -extern void (GLUTCALLBACK *visibility_func) (int state); -extern void (GLUTCALLBACK *idle_func) (void); -extern void (GLUTCALLBACK *menu_state_func) (int state); -extern void (GLUTCALLBACK *special_func) (int key, int x, int y); -extern void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z); -extern void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z); -extern void (GLUTCALLBACK *spaceball_button_func) (int button, int state); -extern void (GLUTCALLBACK *button_box_func) (int button, int state); -extern void (GLUTCALLBACK *dials_func) (int dial, int value); -extern void (GLUTCALLBACK *tablet_motion_func) (int x, int y); -extern void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y); -extern void (GLUTCALLBACK *menu_status_func) (int status, int x, int y); -extern void (GLUTCALLBACK *overlay_display_func) (void); -extern void (GLUTCALLBACK *window_status_func) (int state); - -#endif diff --git a/src/glut/mini/menu.c b/src/glut/mini/menu.c deleted file mode 100644 index 3c571647b1..0000000000 --- a/src/glut/mini/menu.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "GL/glut.h" - - -int APIENTRY glutCreateMenu (void (GLUTCALLBACK *func) (int)) -{ - return 0; -} - -void APIENTRY glutDestroyMenu (int menu) -{ -} - - -int APIENTRY glutGetMenu (void) -{ - return 0; -} - - -void APIENTRY glutSetMenu (int menu) -{ -} - - -void APIENTRY glutAddMenuEntry (const char *label, int value) -{ -} - - -void APIENTRY glutAddSubMenu (const char *label, int submenu) -{ -} - - -void APIENTRY glutChangeToMenuEntry (int item, const char *label, int value) -{ -} - - -void APIENTRY glutChangeToSubMenu (int item, const char *label, int submenu) -{ -} - - -void APIENTRY glutRemoveMenuItem (int item) -{ -} - - -void APIENTRY glutAttachMenu (int button) -{ -} - - -void APIENTRY glutDetachMenu (int button) -{ -} diff --git a/src/glut/mini/models.c b/src/glut/mini/models.c deleted file mode 100644 index 3f955b88ff..0000000000 --- a/src/glut/mini/models.c +++ /dev/null @@ -1,598 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/** -(c) Copyright 1993, Silicon Graphics, Inc. - -ALL RIGHTS RESERVED - -Permission to use, copy, modify, and distribute this software -for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that -both the copyright notice and this permission notice appear in -supporting documentation, and that the name of Silicon -Graphics, Inc. not be used in advertising or publicity -pertaining to distribution of the software without specific, -written prior permission. - -THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU -"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR -OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO -EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE -ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, -INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, -SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR -NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR -PERFORMANCE OF THIS SOFTWARE. - -US Government Users Restricted Rights - -Use, duplication, or disclosure by the Government is subject to -restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -(c)(1)(ii) of the Rights in Technical Data and Computer -Software clause at DFARS 252.227-7013 and/or in similar or -successor clauses in the FAR or the DOD or NASA FAR -Supplement. Unpublished-- rights reserved under the copyright -laws of the United States. Contractor/manufacturer is Silicon -Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA -94039-7311. - -OpenGL(TM) is a trademark of Silicon Graphics, Inc. -*/ - -#include -#include -#include -#include "GL/glut.h" - -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -static GLUquadricObj *quadObj; - -#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } - -static void -initQuadObj(void) -{ - quadObj = gluNewQuadric(); -/* if (!quadObj) - __glutFatalError("out of memory."); */ -} - -/* CENTRY */ -void APIENTRY -glutWireSphere(GLdouble radius, GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_LINE); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluSphere(quadObj, radius, slices, stacks); -} - -void APIENTRY -glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_FILL); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluSphere(quadObj, radius, slices, stacks); -} - -void APIENTRY -glutWireCone(GLdouble base, GLdouble height, - GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_LINE); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluCylinder(quadObj, base, 0.0, height, slices, stacks); -} - -void APIENTRY -glutSolidCone(GLdouble base, GLdouble height, - GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_FILL); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluCylinder(quadObj, base, 0.0, height, slices, stacks); -} - -/* ENDCENTRY */ - -static void -drawBox(GLfloat size, GLenum type) -{ - static GLfloat n[6][3] = - { - {-1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {1.0, 0.0, 0.0}, - {0.0, -1.0, 0.0}, - {0.0, 0.0, 1.0}, - {0.0, 0.0, -1.0} - }; - static GLint faces[6][4] = - { - {0, 1, 2, 3}, - {3, 2, 6, 7}, - {7, 6, 5, 4}, - {4, 5, 1, 0}, - {5, 6, 2, 1}, - {7, 4, 0, 3} - }; - GLfloat v[8][3]; - GLint i; - - v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; - v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; - v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; - v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; - v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; - v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; - - for (i = 5; i >= 0; i--) { - glBegin(type); - glNormal3fv(&n[i][0]); - glVertex3fv(&v[faces[i][0]][0]); - glVertex3fv(&v[faces[i][1]][0]); - glVertex3fv(&v[faces[i][2]][0]); - glVertex3fv(&v[faces[i][3]][0]); - glEnd(); - } -} - -/* CENTRY */ -void APIENTRY -glutWireCube(GLdouble size) -{ - drawBox(size, GL_LINE_LOOP); -} - -void APIENTRY -glutSolidCube(GLdouble size) -{ - drawBox(size, GL_QUADS); -} - -/* ENDCENTRY */ - -static void -doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) -{ - int i, j; - GLfloat theta, phi, theta1; - GLfloat cosTheta, sinTheta; - GLfloat cosTheta1, sinTheta1; - GLfloat ringDelta, sideDelta; - - ringDelta = 2.0 * M_PI / rings; - sideDelta = 2.0 * M_PI / nsides; - - theta = 0.0; - cosTheta = 1.0; - sinTheta = 0.0; - for (i = rings - 1; i >= 0; i--) { - theta1 = theta + ringDelta; - cosTheta1 = cos(theta1); - sinTheta1 = sin(theta1); - glBegin(GL_QUAD_STRIP); - phi = 0.0; - for (j = nsides; j >= 0; j--) { - GLfloat cosPhi, sinPhi, dist; - - phi += sideDelta; - cosPhi = cos(phi); - sinPhi = sin(phi); - dist = R + r * cosPhi; - - glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); - glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); - glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); - glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); - } - glEnd(); - theta = theta1; - cosTheta = cosTheta1; - sinTheta = sinTheta1; - } -} - -/* CENTRY */ -void APIENTRY -glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, - GLint nsides, GLint rings) -{ - glPushAttrib(GL_POLYGON_BIT); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - doughnut(innerRadius, outerRadius, nsides, rings); - glPopAttrib(); -} - -void APIENTRY -glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, - GLint nsides, GLint rings) -{ - doughnut(innerRadius, outerRadius, nsides, rings); -} - -/* ENDCENTRY */ - -static GLfloat dodec[20][3]; - -static void -initDodecahedron(void) -{ - GLfloat alpha, beta; - - alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); - beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - - 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); - /* *INDENT-OFF* */ - dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; - dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; - dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; - dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; - dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; - dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; - dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; - dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; - dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; - dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; - dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; - dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; - dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; - dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; - dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; - dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; - dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; - dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; - dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; - dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; - /* *INDENT-ON* */ - -} - -#define DIFF3(_a,_b,_c) { \ - (_c)[0] = (_a)[0] - (_b)[0]; \ - (_c)[1] = (_a)[1] - (_b)[1]; \ - (_c)[2] = (_a)[2] - (_b)[2]; \ -} - -static void -crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) -{ - GLfloat p[3]; /* in case prod == v1 or v2 */ - - p[0] = v1[1] * v2[2] - v2[1] * v1[2]; - p[1] = v1[2] * v2[0] - v2[2] * v1[0]; - p[2] = v1[0] * v2[1] - v2[0] * v1[1]; - prod[0] = p[0]; - prod[1] = p[1]; - prod[2] = p[2]; -} - -static void -normalize(GLfloat v[3]) -{ - GLfloat d; - - d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - if (d == 0.0) { -/* __glutWarning("normalize: zero length vector"); */ - v[0] = d = 1.0; - } - d = 1 / d; - v[0] *= d; - v[1] *= d; - v[2] *= d; -} - -static void -pentagon(int a, int b, int c, int d, int e, GLenum shadeType) -{ - GLfloat n0[3], d1[3], d2[3]; - - DIFF3(dodec[a], dodec[b], d1); - DIFF3(dodec[b], dodec[c], d2); - crossprod(d1, d2, n0); - normalize(n0); - - glBegin(shadeType); - glNormal3fv(n0); - glVertex3fv(&dodec[a][0]); - glVertex3fv(&dodec[b][0]); - glVertex3fv(&dodec[c][0]); - glVertex3fv(&dodec[d][0]); - glVertex3fv(&dodec[e][0]); - glEnd(); -} - -static void -dodecahedron(GLenum type) -{ - static int inited = 0; - - if (inited == 0) { - inited = 1; - initDodecahedron(); - } - pentagon(0, 1, 9, 16, 5, type); - pentagon(1, 0, 3, 18, 7, type); - pentagon(1, 7, 11, 10, 9, type); - pentagon(11, 7, 18, 19, 6, type); - pentagon(8, 17, 16, 9, 10, type); - pentagon(2, 14, 15, 6, 19, type); - pentagon(2, 13, 12, 4, 14, type); - pentagon(2, 19, 18, 3, 13, type); - pentagon(3, 0, 5, 12, 13, type); - pentagon(6, 15, 8, 10, 11, type); - pentagon(4, 17, 8, 15, 14, type); - pentagon(4, 12, 5, 16, 17, type); -} - -/* CENTRY */ -void APIENTRY -glutWireDodecahedron(void) -{ - dodecahedron(GL_LINE_LOOP); -} - -void APIENTRY -glutSolidDodecahedron(void) -{ - dodecahedron(GL_TRIANGLE_FAN); -} - -/* ENDCENTRY */ - -static void -recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, - GLenum shadeType) -{ - GLfloat q0[3], q1[3]; - - DIFF3(n1, n2, q0); - DIFF3(n2, n3, q1); - crossprod(q0, q1, q1); - normalize(q1); - - glBegin(shadeType); - glNormal3fv(q1); - glVertex3fv(n1); - glVertex3fv(n2); - glVertex3fv(n3); - glEnd(); -} - -static void -subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, - GLenum shadeType) -{ - int depth; - GLfloat w0[3], w1[3], w2[3]; - GLfloat l; - int i, j, k, n; - - depth = 1; - for (i = 0; i < depth; i++) { - for (j = 0; i + j < depth; j++) { - k = depth - i - j; - for (n = 0; n < 3; n++) { - w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; - w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) - / depth; - w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) - / depth; - } - l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); - w0[0] /= l; - w0[1] /= l; - w0[2] /= l; - l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); - w1[0] /= l; - w1[1] /= l; - w1[2] /= l; - l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); - w2[0] /= l; - w2[1] /= l; - w2[2] /= l; - recorditem(w1, w0, w2, shadeType); - } - } -} - -static void -drawtriangle(int i, GLfloat data[][3], int ndx[][3], - GLenum shadeType) -{ - GLfloat *x0, *x1, *x2; - - x0 = data[ndx[i][0]]; - x1 = data[ndx[i][1]]; - x2 = data[ndx[i][2]]; - subdivide(x0, x1, x2, shadeType); -} - -/* octahedron data: The octahedron produced is centered at the - origin and has radius 1.0 */ -static GLfloat odata[6][3] = -{ - {1.0, 0.0, 0.0}, - {-1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {0.0, -1.0, 0.0}, - {0.0, 0.0, 1.0}, - {0.0, 0.0, -1.0} -}; - -static int ondex[8][3] = -{ - {0, 4, 2}, - {1, 2, 4}, - {0, 3, 4}, - {1, 4, 3}, - {0, 2, 5}, - {1, 5, 2}, - {0, 5, 3}, - {1, 3, 5} -}; - -static void -octahedron(GLenum shadeType) -{ - int i; - - for (i = 7; i >= 0; i--) { - drawtriangle(i, odata, ondex, shadeType); - } -} - -/* CENTRY */ -void APIENTRY -glutWireOctahedron(void) -{ - octahedron(GL_LINE_LOOP); -} - -void APIENTRY -glutSolidOctahedron(void) -{ - octahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ - -/* icosahedron data: These numbers are rigged to make an - icosahedron of radius 1.0 */ - -#define X .525731112119133606 -#define Z .850650808352039932 - -static GLfloat idata[12][3] = -{ - {-X, 0, Z}, - {X, 0, Z}, - {-X, 0, -Z}, - {X, 0, -Z}, - {0, Z, X}, - {0, Z, -X}, - {0, -Z, X}, - {0, -Z, -X}, - {Z, X, 0}, - {-Z, X, 0}, - {Z, -X, 0}, - {-Z, -X, 0} -}; - -static int index[20][3] = -{ - {0, 4, 1}, - {0, 9, 4}, - {9, 5, 4}, - {4, 5, 8}, - {4, 8, 1}, - {8, 10, 1}, - {8, 3, 10}, - {5, 3, 8}, - {5, 2, 3}, - {2, 7, 3}, - {7, 10, 3}, - {7, 6, 10}, - {7, 11, 6}, - {11, 0, 6}, - {0, 1, 6}, - {6, 1, 10}, - {9, 0, 11}, - {9, 11, 2}, - {9, 2, 5}, - {7, 2, 11}, -}; - -static void -icosahedron(GLenum shadeType) -{ - int i; - - for (i = 19; i >= 0; i--) { - drawtriangle(i, idata, index, shadeType); - } -} - -/* CENTRY */ -void APIENTRY -glutWireIcosahedron(void) -{ - icosahedron(GL_LINE_LOOP); -} - -void APIENTRY -glutSolidIcosahedron(void) -{ - icosahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ - -/* tetrahedron data: */ - -#define T 1.73205080756887729 - -static GLfloat tdata[4][3] = -{ - {T, T, T}, - {T, -T, -T}, - {-T, T, -T}, - {-T, -T, T} -}; - -static int tndex[4][3] = -{ - {0, 1, 3}, - {2, 1, 0}, - {3, 2, 0}, - {1, 2, 3} -}; - -static void -tetrahedron(GLenum shadeType) -{ - int i; - - for (i = 3; i >= 0; i--) - drawtriangle(i, tdata, tndex, shadeType); -} - -/* CENTRY */ -void APIENTRY -glutWireTetrahedron(void) -{ - tetrahedron(GL_LINE_LOOP); -} - -void APIENTRY -glutSolidTetrahedron(void) -{ - tetrahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ diff --git a/src/glut/mini/overlay.c b/src/glut/mini/overlay.c deleted file mode 100644 index fc8a8e5b0d..0000000000 --- a/src/glut/mini/overlay.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "GL/glut.h" - - -void APIENTRY glutEstablishOverlay (void) -{ -} - - -void APIENTRY glutRemoveOverlay (void) -{ -} - - -void APIENTRY glutUseLayer (GLenum layer) -{ -} - - -void APIENTRY glutPostOverlayRedisplay (void) -{ -} - - -void APIENTRY glutShowOverlay (void) -{ -} - - -void APIENTRY glutHideOverlay (void) -{ -} diff --git a/src/glut/mini/state.c b/src/glut/mini/state.c deleted file mode 100644 index 81aefc53bd..0000000000 --- a/src/glut/mini/state.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.0 for Mesa 4.0 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include "GL/glut.h" -#include - - -#define TIMEDELTA(dest, src1, src2) { \ - if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \ - (dest).tv_usec += 1000000; \ - (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \ - } else { \ - (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \ - } \ -} - -int APIENTRY glutGet (GLenum type) -{ - - switch (type) { - case GLUT_WINDOW_RGBA: - return 1; - case GLUT_ELAPSED_TIME: { - static int inited = 0; - static struct timeval elapsed, beginning, now; - if (!inited) { - gettimeofday(&beginning, 0); - inited = 1; - } - gettimeofday(&now, 0); - TIMEDELTA(elapsed, now, beginning); - /* Return elapsed milliseconds. */ - return (int) ((elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000)); - } - default: - return 0; - } -} - - -int APIENTRY glutDeviceGet (GLenum type) -{ - return 0; -} diff --git a/src/glut/mini/teapot.c b/src/glut/mini/teapot.c deleted file mode 100644 index aa96fcbbbd..0000000000 --- a/src/glut/mini/teapot.c +++ /dev/null @@ -1,212 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/** -(c) Copyright 1993, Silicon Graphics, Inc. - -ALL RIGHTS RESERVED - -Permission to use, copy, modify, and distribute this software -for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that -both the copyright notice and this permission notice appear in -supporting documentation, and that the name of Silicon -Graphics, Inc. not be used in advertising or publicity -pertaining to distribution of the software without specific, -written prior permission. - -THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU -"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR -OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO -EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE -ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, -INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, -SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR -NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR -PERFORMANCE OF THIS SOFTWARE. - -US Government Users Restricted Rights - -Use, duplication, or disclosure by the Government is subject to -restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -(c)(1)(ii) of the Rights in Technical Data and Computer -Software clause at DFARS 252.227-7013 and/or in similar or -successor clauses in the FAR or the DOD or NASA FAR -Supplement. Unpublished-- rights reserved under the copyright -laws of the United States. Contractor/manufacturer is Silicon -Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA -94039-7311. - -OpenGL(TM) is a trademark of Silicon Graphics, Inc. -*/ - -#include -#include -#include "GL/glut.h" - -/* Rim, body, lid, and bottom data must be reflected in x and - y; handle and spout data across the y axis only. */ - -static int patchdata[][16] = -{ - /* rim */ - {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15}, - /* body */ - {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27}, - {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40}, - /* lid */ - {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, - 101, 0, 1, 2, 3,}, - {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117}, - /* bottom */ - {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, - 125, 120, 40, 39, 38, 37}, - /* handle */ - {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56}, - {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 28, 65, 66, 67}, - /* spout */ - {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83}, - {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95} -}; -/* *INDENT-OFF* */ - -static float cpdata[][3] = -{ - {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, - -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, - {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, - 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, - 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, - 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, - {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, - 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, - {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, - 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, - 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, - {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, - {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, - -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, - -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, - 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, - 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, - 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, - {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, - -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, - 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, - -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, - 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, - 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, - 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, - {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, - -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, - 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, - {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, - {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, - {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, - 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, - 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, - -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, - 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, - 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, - 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, - {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, - -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, - 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, - {0.84, -1.5, 0.075} -}; - -static float tex[2][2][2] = -{ - { {0, 0}, - {1, 0}}, - { {0, 1}, - {1, 1}} -}; - -/* *INDENT-ON* */ - -static void -teapot(GLint grid, GLdouble scale, GLenum type) -{ - float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; - long i, j, k, l; - - glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); - glEnable(GL_AUTO_NORMAL); - glEnable(GL_NORMALIZE); - glEnable(GL_MAP2_VERTEX_3); - glEnable(GL_MAP2_TEXTURE_COORD_2); - glPushMatrix(); - glRotatef(270.0, 1.0, 0.0, 0.0); - glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); - glTranslatef(0.0, 0.0, -1.5); - for (i = 0; i < 10; i++) { - for (j = 0; j < 4; j++) { - for (k = 0; k < 4; k++) { - for (l = 0; l < 3; l++) { - p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 1) - q[j][k][l] *= -1.0; - if (i < 6) { - r[j][k][l] = - cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 0) - r[j][k][l] *= -1.0; - s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - if (l == 0) - s[j][k][l] *= -1.0; - if (l == 1) - s[j][k][l] *= -1.0; - } - } - } - } - glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, - &tex[0][0][0]); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &p[0][0][0]); - glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &q[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - if (i < 6) { - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &r[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &s[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - } - } - glPopMatrix(); - glPopAttrib(); -} - -/* CENTRY */ -void APIENTRY -glutSolidTeapot(GLdouble scale) -{ - teapot(7, scale, GL_FILL); -} - -void APIENTRY -glutWireTeapot(GLdouble scale) -{ - teapot(10, scale, GL_LINE); -} - -/* ENDCENTRY */ diff --git a/src/glut/mini/window.c b/src/glut/mini/window.c deleted file mode 100644 index 5a59e64de6..0000000000 --- a/src/glut/mini/window.c +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 4.1 - * Copyright (C) 1995-1998 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * DOS/DJGPP glut driver v1.2 for Mesa 4.1 - * - * Copyright (C) 2002 - Borca Daniel - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include "GL/glut.h" -#include "internal.h" - -#define USE_MINI_GLX 1 -#if USE_MINI_GLX -#include "GL/miniglx.h" -#else -#include -#endif - - - -static GLXContext context = 0; -static Window win; -static XVisualInfo *visinfo = 0; -static Display *dpy = 0; - - -int APIENTRY glutCreateWindow (const char *title) -{ - XSetWindowAttributes attr; - unsigned long mask; - GLXContext ctx; - int scrnum = 0; - Window root = RootWindow( dpy, scrnum ); - - if (win) - return 0; - - if (!dpy) { - dpy = XOpenDisplay(NULL); - if (!dpy) { - printf("Error: XOpenDisplay failed\n"); - exit(1); - } - } - - if (!visinfo) { - int attrib[] = {GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - GLX_DEPTH_SIZE, 1, - GLX_DOUBLEBUFFER, - None }; - - - visinfo = glXChooseVisual( dpy, scrnum, attrib ); - if (!visinfo) { - printf("Error: couldn't get an RGB, Double-buffered visual\n"); - exit(1); - } - } - - /* window attributes */ - attr.background_pixel = 0; - attr.border_pixel = 0; - attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); - attr.event_mask = StructureNotifyMask | ExposureMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; - - win = XCreateWindow( dpy, root, g_xpos, g_ypos, g_width, g_height, - 0, visinfo->depth, InputOutput, - visinfo->visual, mask, &attr ); - if (!win) { - printf("Error: XCreateWindow failed\n"); - exit(1); - } - - ctx = glXCreateContext( dpy, visinfo, NULL, True ); - if (!ctx) { - printf("Error: glXCreateContext failed\n"); - exit(1); - } - - if (!glXMakeCurrent( dpy, win, ctx )) { - printf("Error: glXMakeCurrent failed\n"); - exit(1); - } - - if (!(g_display_mode & GLUT_DOUBLE)) - glDrawBuffer( GL_FRONT ); - - - XMapWindow( dpy, win ); - -#if !USE_MINI_GLX - { - XEvent e; - while (1) { - XNextEvent( dpy, &e ); - if (e.type == MapNotify && e.xmap.window == win) { - break; - } - } - } -#endif - - return 1; -} - - -int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height) -{ - return GL_FALSE; -} - - -void APIENTRY glutDestroyWindow (int idx) -{ - if (dpy && win) - XDestroyWindow( dpy, win ); - - if (dpy) - XCloseDisplay( dpy ); - - win = 0; - dpy = 0; -} - - -void APIENTRY glutPostRedisplay (void) -{ - g_redisplay = GL_TRUE; -} - - -void APIENTRY glutSwapBuffers (void) -{ -/* if (g_mouse) pc_scare_mouse(); */ - if (dpy && win) glXSwapBuffers( dpy, win ); -/* if (g_mouse) pc_unscare_mouse(); */ -} - - -int APIENTRY glutGetWindow (void) -{ - return 0; -} - - -void APIENTRY glutSetWindow (int win) -{ -} - - -void APIENTRY glutSetWindowTitle (const char *title) -{ -} - - -void APIENTRY glutSetIconTitle (const char *title) -{ -} - - -void APIENTRY glutPositionWindow (int x, int y) -{ -} - - -void APIENTRY glutReshapeWindow (int width, int height) -{ -} - - -void APIENTRY glutPopWindow (void) -{ -} - - -void APIENTRY glutPushWindow (void) -{ -} - - -void APIENTRY glutIconifyWindow (void) -{ -} - - -void APIENTRY glutShowWindow (void) -{ -} - - -void APIENTRY glutHideWindow (void) -{ -} - -void APIENTRY glutMainLoop (void) -{ - GLboolean idle; - GLboolean have_event; - XEvent evt; - int visible = 0; - - glutPostRedisplay(); - if (reshape_func) reshape_func(g_width, g_height); - - while (GL_TRUE) { - idle = GL_TRUE; - - - if (visible && idle_func) - have_event = XCheckMaskEvent( dpy, ~0, &evt ); - else - have_event = XNextEvent( dpy, &evt ); - - if (have_event) { - idle = GL_FALSE; - switch(evt.type) { - case MapNotify: - if (visibility_func) { - visibility_func(GLUT_VISIBLE); - } - visible = 1; - break; - case UnmapNotify: - if (visibility_func) { - visibility_func(GLUT_NOT_VISIBLE); - } - visible = 0; - break; - case Expose: - g_redisplay = 1; - break; - } - } - - if (visible && g_redisplay && display_func) { - idle = GL_FALSE; - g_redisplay = GL_FALSE; - - display_func(); - } - - if (visible && idle && idle_func) { - idle_func(); - } - } -} -- cgit v1.2.3 From b15fe60ba568ff28de38dd0dc834fb9198650002 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 16:19:20 -0500 Subject: Drop unused glut subdirectories --- src/glut/dos/PC_HW/pc_hw.c | 163 - src/glut/dos/PC_HW/pc_hw.h | 229 -- src/glut/dos/PC_HW/pc_irq.S | 182 - src/glut/dos/PC_HW/pc_keyb.c | 540 --- src/glut/dos/PC_HW/pc_mouse.c | 293 -- src/glut/dos/PC_HW/pc_timer.c | 327 -- src/glut/dos/bitmap.c | 115 - src/glut/dos/callback.c | 204 -- src/glut/dos/color.c | 53 - src/glut/dos/extens.c | 70 - src/glut/dos/f8x13.c | 1183 ------- src/glut/dos/f9x15.c | 1407 -------- src/glut/dos/hel10.c | 1019 ------ src/glut/dos/hel12.c | 1029 ------ src/glut/dos/hel18.c | 1138 ------- src/glut/dos/init.c | 223 -- src/glut/dos/internal.h | 197 -- src/glut/dos/loop.c | 245 -- src/glut/dos/menu.c | 130 - src/glut/dos/mouse.c | 55 - src/glut/dos/mroman.c | 2779 --------------- src/glut/dos/overlay.c | 93 - src/glut/dos/roman.c | 2779 --------------- src/glut/dos/shapes.c | 1143 ------- src/glut/dos/state.c | 238 -- src/glut/dos/stroke.c | 118 - src/glut/dos/teapot.c | 201 -- src/glut/dos/tr10.c | 1018 ------ src/glut/dos/tr24.c | 1301 ------- src/glut/dos/util.c | 74 - src/glut/dos/window.c | 329 -- src/glut/fbdev/Makefile | 94 - src/glut/fbdev/bitmap.c | 78 - src/glut/fbdev/callback.c | 171 - src/glut/fbdev/colormap.c | 177 - src/glut/fbdev/cursor.c | 272 -- src/glut/fbdev/cursors.h | 7099 --------------------------------------- src/glut/fbdev/ext.c | 154 - src/glut/fbdev/fbdev.c | 940 ------ src/glut/fbdev/gamemode.c | 306 -- src/glut/fbdev/input.c | 828 ----- src/glut/fbdev/internal.h | 177 - src/glut/fbdev/menu.c | 309 -- src/glut/fbdev/overlay.c | 57 - src/glut/fbdev/state.c | 197 -- src/glut/fbdev/stroke.c | 81 - src/glut/fbdev/vidresize.c | 55 - src/glut/os2/Makefile | 420 --- src/glut/os2/WarpWin.cpp | 419 --- src/glut/os2/glutOverlay.cpp | 133 - src/glut/os2/glut_8x13.cpp | 2076 ------------ src/glut/os2/glut_9x15.cpp | 2077 ------------ src/glut/os2/glut_bitmap.cpp | 57 - src/glut/os2/glut_cindex.cpp | 258 -- src/glut/os2/glut_cmap.cpp | 399 --- src/glut/os2/glut_cursor.cpp | 210 -- src/glut/os2/glut_event.cpp | 1399 -------- src/glut/os2/glut_ext.cpp | 204 -- src/glut/os2/glut_fullscrn.cpp | 38 - src/glut/os2/glut_gamemode.cpp | 679 ---- src/glut/os2/glut_get.cpp | 232 -- src/glut/os2/glut_hel10.cpp | 1781 ---------- src/glut/os2/glut_hel12.cpp | 1791 ---------- src/glut/os2/glut_hel18.cpp | 1900 ----------- src/glut/os2/glut_init.cpp | 451 --- src/glut/os2/glut_input.cpp | 628 ---- src/glut/os2/glut_key.cpp | 29 - src/glut/os2/glut_keyctrl.cpp | 29 - src/glut/os2/glut_keyup.cpp | 29 - src/glut/os2/glut_mesa.cpp | 57 - src/glut/os2/glut_modifier.cpp | 31 - src/glut/os2/glut_roman.cpp | 2451 -------------- src/glut/os2/glut_shapes.cpp | 595 ---- src/glut/os2/glut_stroke.cpp | 42 - src/glut/os2/glut_swap.cpp | 67 - src/glut/os2/glut_teapot.cpp | 210 -- src/glut/os2/glut_tr24.cpp | 2063 ------------ src/glut/os2/glut_util.cpp | 90 - src/glut/os2/glut_vidresize.cpp | 232 -- src/glut/os2/glut_warp.cpp | 29 - src/glut/os2/glut_win.cpp | 1220 ------- src/glut/os2/glut_winmisc.cpp | 126 - src/glut/os2/glutbitmap.h | 32 - src/glut/os2/glutos2.h | 36 - src/glut/os2/glutstroke.h | 42 - src/glut/os2/layerutil.h | 59 - src/glut/os2/libGlut.DEF | 94 - src/glut/os2/os2_glx.cpp | 145 - src/glut/os2/os2_menu.cpp | 532 --- src/glut/os2/os2_winproc.cpp | 1296 ------- src/glut/os2/src-glut_os2pm.zip | Bin 141239 -> 0 bytes 91 files changed, 54558 deletions(-) delete mode 100644 src/glut/dos/PC_HW/pc_hw.c delete mode 100644 src/glut/dos/PC_HW/pc_hw.h delete mode 100644 src/glut/dos/PC_HW/pc_irq.S delete mode 100644 src/glut/dos/PC_HW/pc_keyb.c delete mode 100644 src/glut/dos/PC_HW/pc_mouse.c delete mode 100644 src/glut/dos/PC_HW/pc_timer.c delete mode 100644 src/glut/dos/bitmap.c delete mode 100644 src/glut/dos/callback.c delete mode 100644 src/glut/dos/color.c delete mode 100644 src/glut/dos/extens.c delete mode 100644 src/glut/dos/f8x13.c delete mode 100644 src/glut/dos/f9x15.c delete mode 100644 src/glut/dos/hel10.c delete mode 100644 src/glut/dos/hel12.c delete mode 100644 src/glut/dos/hel18.c delete mode 100644 src/glut/dos/init.c delete mode 100644 src/glut/dos/internal.h delete mode 100644 src/glut/dos/loop.c delete mode 100644 src/glut/dos/menu.c delete mode 100644 src/glut/dos/mouse.c delete mode 100644 src/glut/dos/mroman.c delete mode 100644 src/glut/dos/overlay.c delete mode 100644 src/glut/dos/roman.c delete mode 100644 src/glut/dos/shapes.c delete mode 100644 src/glut/dos/state.c delete mode 100644 src/glut/dos/stroke.c delete mode 100644 src/glut/dos/teapot.c delete mode 100644 src/glut/dos/tr10.c delete mode 100644 src/glut/dos/tr24.c delete mode 100644 src/glut/dos/util.c delete mode 100644 src/glut/dos/window.c delete mode 100644 src/glut/fbdev/Makefile delete mode 100644 src/glut/fbdev/bitmap.c delete mode 100644 src/glut/fbdev/callback.c delete mode 100644 src/glut/fbdev/colormap.c delete mode 100644 src/glut/fbdev/cursor.c delete mode 100644 src/glut/fbdev/cursors.h delete mode 100644 src/glut/fbdev/ext.c delete mode 100644 src/glut/fbdev/fbdev.c delete mode 100644 src/glut/fbdev/gamemode.c delete mode 100644 src/glut/fbdev/input.c delete mode 100644 src/glut/fbdev/internal.h delete mode 100644 src/glut/fbdev/menu.c delete mode 100644 src/glut/fbdev/overlay.c delete mode 100644 src/glut/fbdev/state.c delete mode 100644 src/glut/fbdev/stroke.c delete mode 100644 src/glut/fbdev/vidresize.c delete mode 100644 src/glut/os2/Makefile delete mode 100644 src/glut/os2/WarpWin.cpp delete mode 100644 src/glut/os2/glutOverlay.cpp delete mode 100644 src/glut/os2/glut_8x13.cpp delete mode 100644 src/glut/os2/glut_9x15.cpp delete mode 100644 src/glut/os2/glut_bitmap.cpp delete mode 100644 src/glut/os2/glut_cindex.cpp delete mode 100644 src/glut/os2/glut_cmap.cpp delete mode 100644 src/glut/os2/glut_cursor.cpp delete mode 100644 src/glut/os2/glut_event.cpp delete mode 100644 src/glut/os2/glut_ext.cpp delete mode 100644 src/glut/os2/glut_fullscrn.cpp delete mode 100644 src/glut/os2/glut_gamemode.cpp delete mode 100644 src/glut/os2/glut_get.cpp delete mode 100644 src/glut/os2/glut_hel10.cpp delete mode 100644 src/glut/os2/glut_hel12.cpp delete mode 100644 src/glut/os2/glut_hel18.cpp delete mode 100644 src/glut/os2/glut_init.cpp delete mode 100644 src/glut/os2/glut_input.cpp delete mode 100644 src/glut/os2/glut_key.cpp delete mode 100644 src/glut/os2/glut_keyctrl.cpp delete mode 100644 src/glut/os2/glut_keyup.cpp delete mode 100644 src/glut/os2/glut_mesa.cpp delete mode 100644 src/glut/os2/glut_modifier.cpp delete mode 100644 src/glut/os2/glut_roman.cpp delete mode 100644 src/glut/os2/glut_shapes.cpp delete mode 100644 src/glut/os2/glut_stroke.cpp delete mode 100644 src/glut/os2/glut_swap.cpp delete mode 100644 src/glut/os2/glut_teapot.cpp delete mode 100644 src/glut/os2/glut_tr24.cpp delete mode 100644 src/glut/os2/glut_util.cpp delete mode 100644 src/glut/os2/glut_vidresize.cpp delete mode 100644 src/glut/os2/glut_warp.cpp delete mode 100644 src/glut/os2/glut_win.cpp delete mode 100644 src/glut/os2/glut_winmisc.cpp delete mode 100644 src/glut/os2/glutbitmap.h delete mode 100644 src/glut/os2/glutos2.h delete mode 100644 src/glut/os2/glutstroke.h delete mode 100644 src/glut/os2/layerutil.h delete mode 100644 src/glut/os2/libGlut.DEF delete mode 100644 src/glut/os2/os2_glx.cpp delete mode 100644 src/glut/os2/os2_menu.cpp delete mode 100644 src/glut/os2/os2_winproc.cpp delete mode 100644 src/glut/os2/src-glut_os2pm.zip (limited to 'src') diff --git a/src/glut/dos/PC_HW/pc_hw.c b/src/glut/dos/PC_HW/pc_hw.c deleted file mode 100644 index 100b372165..0000000000 --- a/src/glut/dos/PC_HW/pc_hw.c +++ /dev/null @@ -1,163 +0,0 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include /* for mode definitions */ -#include -#include -#include - -#include "pc_hw.h" - - -/* - * atexit - */ -#define MAX_ATEXIT 32 - -static volatile int atexitcnt; -static VFUNC atexittbl[MAX_ATEXIT]; - - -static void __attribute__((destructor)) -doexit (void) -{ - while (atexitcnt) atexittbl[--atexitcnt](); -} - - -int -pc_clexit (VFUNC f) -{ - int i; - - for (i = 0; i < atexitcnt; i++) { - if (atexittbl[i] == f) { - for (atexitcnt--; i < atexitcnt; i++) atexittbl[i] = atexittbl[i+1]; - atexittbl[i] = 0; - return 0; - } - } - return -1; -} - - -int -pc_atexit (VFUNC f) -{ - pc_clexit(f); - if (atexitcnt < MAX_ATEXIT) { - atexittbl[atexitcnt++] = f; - return 0; - } - return -1; -} - - -/* - * locked memory allocation - */ -void * -pc_malloc (size_t size) -{ - void *p = malloc(size); - - if (p) { - if (_go32_dpmi_lock_data(p, size)) { - free(p); - return NULL; - } - } - - return p; -} - - -/* - * standard redirection - */ -static char outname[L_tmpnam]; -static int h_out, h_outbak; -static char errname[L_tmpnam]; -static int h_err, h_errbak; - - -int -pc_open_stdout (void) -{ - tmpnam(outname); - - if ((h_out=open(outname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { - h_outbak = dup(STDOUT_FILENO); - fflush(stdout); - dup2(h_out, STDOUT_FILENO); - } - - return h_out; -} - - -void -pc_close_stdout (void) -{ - FILE *f; - char *line = alloca(512); - - if (h_out > 0) { - dup2(h_outbak, STDOUT_FILENO); - close(h_out); - close(h_outbak); - - f = fopen(outname, "rt"); - while (fgets(line, 512, f)) { - fputs(line, stdout); - } - fclose(f); - - remove(outname); - } -} - - -int -pc_open_stderr (void) -{ - tmpnam(errname); - - if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) { - h_errbak = dup(STDERR_FILENO); - fflush(stderr); - dup2(h_err, STDERR_FILENO); - } - - return h_err; -} - - -void -pc_close_stderr (void) -{ - FILE *f; - char *line = alloca(512); - - if (h_err > 0) { - dup2(h_errbak, STDERR_FILENO); - close(h_err); - close(h_errbak); - - f = fopen(errname, "rt"); - while (fgets(line, 512, f)) { - fputs(line, stderr); - } - fclose(f); - - remove(errname); - } -} diff --git a/src/glut/dos/PC_HW/pc_hw.h b/src/glut/dos/PC_HW/pc_hw.h deleted file mode 100644 index 41948ec991..0000000000 --- a/src/glut/dos/PC_HW/pc_hw.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * PC/HW routine collection v1.4 for DOS/DJGPP - * - * Copyright (C) 2002 - Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#ifndef PC_HW_H_included -#define PC_HW_H_included - -#include -#include - -/* - * misc C definitions - */ -#define FALSE 0 -#define TRUE !FALSE - -#define SQR(x) ((x) * (x)) - -#define MIN(x,y) (((x) < (y)) ? (x) : (y)) -#define MAX(x,y) (((x) > (y)) ? (x) : (y)) -#define MID(x,y,z) MAX((x), MIN((y), (z))) - -typedef void (*VFUNC) (void); -typedef void (*PFUNC) (void *); -typedef void (*MFUNC) (int x, int y, int z, int b); - -/* - * atexit - */ -int pc_atexit (VFUNC f); -int pc_clexit (VFUNC f); - -/* - * locked memory - */ -#define ENDOFUNC(x) static void x##_end() { } -#define LOCKFUNC(x) _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x) -#define LOCKDATA(x) _go32_dpmi_lock_data((void *)&x, sizeof(x)) -#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l) - -void *pc_malloc (size_t size); - -/* - * IRQ - */ -#define ENABLE() __asm __volatile ("sti") -#define DISABLE() __asm __volatile ("cli") - -extern int pc_install_irq (int i, int (*handler) ()); -extern int pc_remove_irq (int i); - -/* - * keyboard - */ -#define KB_SHIFT_FLAG 0x0001 -#define KB_CTRL_FLAG 0x0002 -#define KB_ALT_FLAG 0x0004 -#define KB_LWIN_FLAG 0x0008 -#define KB_RWIN_FLAG 0x0010 -#define KB_MENU_FLAG 0x0020 -#define KB_SCROLOCK_FLAG 0x0100 -#define KB_NUMLOCK_FLAG 0x0200 -#define KB_CAPSLOCK_FLAG 0x0400 -#define KB_INALTSEQ_FLAG 0x0800 -#define KB_ACCENT1_FLAG 0x1000 -#define KB_ACCENT2_FLAG 0x2000 -#define KB_ACCENT3_FLAG 0x4000 -#define KB_ACCENT4_FLAG 0x8000 - -#define KEY_A 1 -#define KEY_B 2 -#define KEY_C 3 -#define KEY_D 4 -#define KEY_E 5 -#define KEY_F 6 -#define KEY_G 7 -#define KEY_H 8 -#define KEY_I 9 -#define KEY_J 10 -#define KEY_K 11 -#define KEY_L 12 -#define KEY_M 13 -#define KEY_N 14 -#define KEY_O 15 -#define KEY_P 16 -#define KEY_Q 17 -#define KEY_R 18 -#define KEY_S 19 -#define KEY_T 20 -#define KEY_U 21 -#define KEY_V 22 -#define KEY_W 23 -#define KEY_X 24 -#define KEY_Y 25 -#define KEY_Z 26 -#define KEY_0 27 -#define KEY_1 28 -#define KEY_2 29 -#define KEY_3 30 -#define KEY_4 31 -#define KEY_5 32 -#define KEY_6 33 -#define KEY_7 34 -#define KEY_8 35 -#define KEY_9 36 -#define KEY_0_PAD 37 -#define KEY_1_PAD 38 -#define KEY_2_PAD 39 -#define KEY_3_PAD 40 -#define KEY_4_PAD 41 -#define KEY_5_PAD 42 -#define KEY_6_PAD 43 -#define KEY_7_PAD 44 -#define KEY_8_PAD 45 -#define KEY_9_PAD 46 -#define KEY_F1 47 -#define KEY_F2 48 -#define KEY_F3 49 -#define KEY_F4 50 -#define KEY_F5 51 -#define KEY_F6 52 -#define KEY_F7 53 -#define KEY_F8 54 -#define KEY_F9 55 -#define KEY_F10 56 -#define KEY_F11 57 -#define KEY_F12 58 -#define KEY_ESC 59 -#define KEY_TILDE 60 -#define KEY_MINUS 61 -#define KEY_EQUALS 62 -#define KEY_BACKSPACE 63 -#define KEY_TAB 64 -#define KEY_OPENBRACE 65 -#define KEY_CLOSEBRACE 66 -#define KEY_ENTER 67 -#define KEY_COLON 68 -#define KEY_QUOTE 69 -#define KEY_BACKSLASH 70 -#define KEY_BACKSLASH2 71 -#define KEY_COMMA 72 -#define KEY_STOP 73 -#define KEY_SLASH 74 -#define KEY_SPACE 75 -#define KEY_INSERT 76 -#define KEY_DEL 77 -#define KEY_HOME 78 -#define KEY_END 79 -#define KEY_PGUP 80 -#define KEY_PGDN 81 -#define KEY_LEFT 82 -#define KEY_RIGHT 83 -#define KEY_UP 84 -#define KEY_DOWN 85 -#define KEY_SLASH_PAD 86 -#define KEY_ASTERISK 87 -#define KEY_MINUS_PAD 88 -#define KEY_PLUS_PAD 89 -#define KEY_DEL_PAD 90 -#define KEY_ENTER_PAD 91 -#define KEY_PRTSCR 92 -#define KEY_PAUSE 93 -#define KEY_ABNT_C1 94 -#define KEY_YEN 95 -#define KEY_KANA 96 -#define KEY_CONVERT 97 -#define KEY_NOCONVERT 98 -#define KEY_AT 99 -#define KEY_CIRCUMFLEX 100 -#define KEY_COLON2 101 -#define KEY_KANJI 102 - -#define KEY_MODIFIERS 103 - -#define KEY_LSHIFT 103 -#define KEY_RSHIFT 104 -#define KEY_LCONTROL 105 -#define KEY_RCONTROL 106 -#define KEY_ALT 107 -#define KEY_ALTGR 108 -#define KEY_LWIN 109 -#define KEY_RWIN 110 -#define KEY_MENU 111 -#define KEY_SCRLOCK 112 -#define KEY_NUMLOCK 113 -#define KEY_CAPSLOCK 114 - -#define KEY_MAX 115 - -int pc_install_keyb (void); -void pc_remove_keyb (void); -int pc_keypressed (void); -int pc_readkey (void); -int pc_keydown (int code); -int pc_keyshifts (void); - -/* - * timer - */ -int pc_install_int (PFUNC func, void *parm, unsigned int freq); -int pc_remove_int (int fid); -int pc_adjust_int (int fid, unsigned int freq); -void pc_remove_timer (void); - -/* - * mouse - */ -int pc_install_mouse (void); -void pc_remove_mouse (void); -MFUNC pc_install_mouse_handler (MFUNC handler); -void pc_mouse_area (int x1, int y1, int x2, int y2); -void pc_mouse_speed (int xspeed, int yspeed); -int pc_query_mouse (int *x, int *y, int *z); -void pc_warp_mouse (int x, int y); - -/* - * standard redirection - */ -int pc_open_stdout (void); -int pc_open_stderr (void); -void pc_close_stdout (void); -void pc_close_stderr (void); - -#endif diff --git a/src/glut/dos/PC_HW/pc_irq.S b/src/glut/dos/PC_HW/pc_irq.S deleted file mode 100644 index 7d62ac74ce..0000000000 --- a/src/glut/dos/PC_HW/pc_irq.S +++ /dev/null @@ -1,182 +0,0 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - - .file "pc_irq.S" - - .text - -#define IRQ_STACK_SIZE 16384 - -#define IRQ_WRAPPER_LEN (__irq_wrapper_1-__irq_wrapper_0) -#define IRQ_OLD (__irq_old_0-__irq_wrapper_0) -#define IRQ_HOOK (__irq_hook_0-__irq_wrapper_0) -#define IRQ_STACK (__irq_stack_0-__irq_wrapper_0) - - .balign 4 -common: - movw $0x0400, %ax - int $0x31 - - movl %ss:8(%ebp), %ebx - cmpl $15, %ebx - jbe 0f - fail: - orl $-1, %eax - popl %edi - popl %ebx - leave - ret - - 0: - movl %ebx, %edi - imull $IRQ_WRAPPER_LEN, %edi - addl $__irq_wrapper_0, %edi - - cmpb $7, %bl - jbe 1f - movb %dl, %dh - subb $8, %dh - 1: - addb %dh, %bl - ret - - .balign 4 - .global _pc_install_irq -_pc_install_irq: - pushl %ebp - movl %esp, %ebp - pushl %ebx - pushl %edi - - call common - - cmpl $0, IRQ_HOOK(%edi) - jne fail - - pushl $IRQ_WRAPPER_LEN - pushl %edi - call __go32_dpmi_lock_code - addl $8, %esp - testl %eax, %eax - jnz fail - - pushl $IRQ_STACK_SIZE - call _pc_malloc - popl %edx - testl %eax, %eax - jz fail - addl %edx, %eax - movl %eax, IRQ_STACK(%edi) - - movl ___djgpp_ds_alias, %eax - movl %eax, IRQ_STACK+4(%edi) - - movl %ss:12(%ebp), %eax - movl %eax, IRQ_HOOK(%edi) - - movw $0x0204, %ax - int $0x31 - movl %edx, IRQ_OLD(%edi) - movw %cx, IRQ_OLD+4(%edi) - movw $0x0205, %ax - movl %edi, %edx - movl %cs, %ecx - int $0x31 - - done: - xorl %eax, %eax - popl %edi - popl %ebx - leave - ret - - .balign 4 - .global _pc_remove_irq -_pc_remove_irq: - pushl %ebp - movl %esp, %ebp - pushl %ebx - pushl %edi - - call common - - cmpl $0, IRQ_HOOK(%edi) - je fail - - movl $0, IRQ_HOOK(%edi) - - movw $0x0205, %ax - movl IRQ_OLD(%edi), %edx - movl IRQ_OLD+4(%edi), %ecx - int $0x31 - - movl IRQ_STACK(%edi), %eax - subl $IRQ_STACK_SIZE, %eax - pushl %eax - call _free - popl %eax - - jmp done - -#define WRAPPER(x) ; \ - .balign 4 ; \ -__irq_wrapper_##x: ; \ - pushal ; \ - pushl %ds ; \ - pushl %es ; \ - pushl %fs ; \ - pushl %gs ; \ - movl %ss, %ebx ; \ - movl %esp, %esi ; \ - lss %cs:__irq_stack_##x, %esp ; \ - pushl %ss ; \ - pushl %ss ; \ - popl %es ; \ - popl %ds ; \ - movl ___djgpp_dos_sel, %fs ; \ - pushl %fs ; \ - popl %gs ; \ - call *__irq_hook_##x ; \ - movl %ebx, %ss ; \ - movl %esi, %esp ; \ - testl %eax, %eax ; \ - popl %gs ; \ - popl %fs ; \ - popl %es ; \ - popl %ds ; \ - popal ; \ - jz __irq_ignore_##x ; \ -__irq_bypass_##x: ; \ - ljmp *%cs:__irq_old_##x ; \ -__irq_ignore_##x: ; \ - iret ; \ - .balign 4 ; \ -__irq_old_##x: ; \ - .long 0, 0 ; \ -__irq_hook_##x: ; \ - .long 0 ; \ -__irq_stack_##x: ; \ - .long 0, 0 - - WRAPPER(0); - WRAPPER(1); - WRAPPER(2); - WRAPPER(3); - WRAPPER(4); - WRAPPER(5); - WRAPPER(6); - WRAPPER(7); - WRAPPER(8); - WRAPPER(9); - WRAPPER(10); - WRAPPER(11); - WRAPPER(12); - WRAPPER(13); - WRAPPER(14); - WRAPPER(15); diff --git a/src/glut/dos/PC_HW/pc_keyb.c b/src/glut/dos/PC_HW/pc_keyb.c deleted file mode 100644 index d7e3257b9d..0000000000 --- a/src/glut/dos/PC_HW/pc_keyb.c +++ /dev/null @@ -1,540 +0,0 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include - -#include "pc_hw.h" - - -#define KEYB_IRQ 1 - -#define KEY_BUFFER_SIZE 64 - -#define KB_MODIFIERS (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG | KB_LWIN_FLAG | KB_RWIN_FLAG | KB_MENU_FLAG) -#define KB_LED_FLAGS (KB_SCROLOCK_FLAG | KB_NUMLOCK_FLAG | KB_CAPSLOCK_FLAG) - -static int keyboard_installed; - -static volatile struct { - volatile int start, end; - volatile int key[KEY_BUFFER_SIZE]; -} key_buffer; - -static volatile int key_enhanced, key_pause_loop, key_shifts; -static int leds_ok = TRUE; -static int in_a_terrupt = FALSE; -static volatile char pc_key[KEY_MAX]; - - -/* convert Allegro format scancodes into key_shifts flag bits */ -static unsigned short modifier_table[KEY_MAX - KEY_MODIFIERS] = { - KB_SHIFT_FLAG, KB_SHIFT_FLAG, KB_CTRL_FLAG, - KB_CTRL_FLAG, KB_ALT_FLAG, KB_ALT_FLAG, - KB_LWIN_FLAG, KB_RWIN_FLAG, KB_MENU_FLAG, - KB_SCROLOCK_FLAG, KB_NUMLOCK_FLAG, KB_CAPSLOCK_FLAG -}; - - -/* lookup table for converting hardware scancodes into Allegro format */ -static unsigned char hw_to_mycode[128] = { - /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, - /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, - /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, - /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, - /* 0x10 */ KEY_Q, KEY_W, KEY_E, KEY_R, - /* 0x14 */ KEY_T, KEY_Y, KEY_U, KEY_I, - /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, - /* 0x1C */ KEY_ENTER, KEY_LCONTROL, KEY_A, KEY_S, - /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, - /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, - /* 0x28 */ KEY_QUOTE, KEY_TILDE, KEY_LSHIFT, KEY_BACKSLASH, - /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, - /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, - /* 0x34 */ KEY_STOP, KEY_SLASH, KEY_RSHIFT, KEY_ASTERISK, - /* 0x38 */ KEY_ALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, - /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, - /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, - /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_SCRLOCK, KEY_7_PAD, - /* 0x48 */ KEY_8_PAD, KEY_9_PAD, KEY_MINUS_PAD, KEY_4_PAD, - /* 0x4C */ KEY_5_PAD, KEY_6_PAD, KEY_PLUS_PAD, KEY_1_PAD, - /* 0x50 */ KEY_2_PAD, KEY_3_PAD, KEY_0_PAD, KEY_DEL_PAD, - /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, - /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, - /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, - /* 0x60 */ 0, 0, 0, 0, - /* 0x64 */ 0, 0, 0, 0, - /* 0x68 */ 0, 0, 0, 0, - /* 0x6C */ 0, 0, 0, 0, - /* 0x70 */ KEY_KANA, 0, 0, KEY_ABNT_C1, - /* 0x74 */ 0, 0, 0, 0, - /* 0x78 */ 0, KEY_CONVERT, 0, KEY_NOCONVERT, - /* 0x7C */ 0, KEY_YEN, 0, 0 -}; - - -/* lookup table for converting extended hardware codes into Allegro format */ -static unsigned char hw_to_mycode_ex[128] = { - /* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2, - /* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6, - /* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0, - /* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB, - /* 0x10 */ KEY_CIRCUMFLEX, KEY_AT, KEY_COLON2, KEY_R, - /* 0x14 */ KEY_KANJI, KEY_Y, KEY_U, KEY_I, - /* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE, - /* 0x1C */ KEY_ENTER_PAD, KEY_RCONTROL, KEY_A, KEY_S, - /* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H, - /* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON, - /* 0x28 */ KEY_QUOTE, KEY_TILDE, 0, KEY_BACKSLASH, - /* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V, - /* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA, - /* 0x34 */ KEY_STOP, KEY_SLASH_PAD, 0, KEY_PRTSCR, - /* 0x38 */ KEY_ALTGR, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, - /* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5, - /* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9, - /* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_PAUSE, KEY_HOME, - /* 0x48 */ KEY_UP, KEY_PGUP, KEY_MINUS_PAD, KEY_LEFT, - /* 0x4C */ KEY_5_PAD, KEY_RIGHT, KEY_PLUS_PAD, KEY_END, - /* 0x50 */ KEY_DOWN, KEY_PGDN, KEY_INSERT, KEY_DEL, - /* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11, - /* 0x58 */ KEY_F12, 0, 0, KEY_LWIN, - /* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0, - /* 0x60 */ 0, 0, 0, 0, - /* 0x64 */ 0, 0, 0, 0, - /* 0x68 */ 0, 0, 0, 0, - /* 0x6C */ 0, 0, 0, 0, - /* 0x70 */ 0, 0, 0, 0, - /* 0x74 */ 0, 0, 0, 0, - /* 0x78 */ 0, 0, 0, 0, - /* 0x7C */ 0, 0, 0, 0 -}; - - -/* default mapping table for the US keyboard layout */ -static unsigned short standard_key_ascii_table[KEY_MAX] = { - /* start */ 0, - /* alphabet */ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ '/', '*', '-', '+', '.', 13, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - -/* capslock mapping table for the US keyboard layout */ -static unsigned short standard_key_capslock_table[KEY_MAX] = { - /* start */ 0, - /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - /* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ', - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ '/', '*', '-', '+', '.', 13, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - -/* shifted mapping table for the US keyboard layout */ -static unsigned short standard_key_shift_table[KEY_MAX] = { - /* start */ 0, - /* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - /* numbers */ ')', '!', '@', '#', '$', '%', '^', '&', '*', '(', - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, '~', '_', '+', 8, 9, '{', '}', 13, ':', '"', '|', '|', '<', '>', '?', ' ', - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ '/', '*', '-', '+', '.', 13, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - -/* ctrl+key mapping table for the US keyboard layout */ -static unsigned short standard_key_control_table[KEY_MAX] = { - /* start */ 0, - /* alphabet */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - /* numbers */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - /* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - /* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* misc chars */ 27, 2, 2, 2, 127, 127, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, 2, - /* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, - /* numpad */ 2, 2, 2, 2, 2, 10, - /* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - - -/* convert numeric pad scancodes into arrow codes */ -static unsigned char numlock_table[10] = { - KEY_INSERT, KEY_END, KEY_DOWN, KEY_PGDN, KEY_LEFT, - KEY_5_PAD, KEY_RIGHT, KEY_HOME, KEY_UP, KEY_PGUP -}; - - -/* kb_wait_for_write_ready: - * Wait for the keyboard controller to set the ready-for-write bit. - */ -static __inline int -kb_wait_for_write_ready (void) -{ - int timeout = 4096; - - while ((timeout > 0) && (inportb(0x64) & 2)) timeout--; - - return (timeout > 0); -} - - -/* kb_wait_for_read_ready: - * Wait for the keyboard controller to set the ready-for-read bit. - */ -static __inline int -kb_wait_for_read_ready (void) -{ - int timeout = 16384; - - while ((timeout > 0) && (!(inportb(0x64) & 1))) timeout--; - - return (timeout > 0); -} - - -/* kb_send_data: - * Sends a byte to the keyboard controller. Returns 1 if all OK. - */ -static __inline int -kb_send_data (unsigned char data) -{ - int resends = 4; - int timeout, temp; - - do { - if (!kb_wait_for_write_ready()) - return 0; - - outportb(0x60, data); - timeout = 4096; - - while (--timeout > 0) { - if (!kb_wait_for_read_ready()) - return 0; - - temp = inportb(0x60); - - if (temp == 0xFA) - return 1; - - if (temp == 0xFE) - break; - } - } while ((resends-- > 0) && (timeout > 0)); - - return 0; -} - - -static void -update_leds (int leds) -{ - if (leds_ok) { - if (!in_a_terrupt) - DISABLE(); - - if (!kb_send_data(0xED)) { - kb_send_data(0xF4); - leds_ok = FALSE; - } else if (!kb_send_data((leds >> 8) & 7)) { - kb_send_data(0xF4); - leds_ok = FALSE; - } - - if (!in_a_terrupt) - ENABLE(); - } -} ENDOFUNC(update_leds) - - -static void -inject_key (int scancode) -{ - unsigned short *table; - - if ((scancode >= KEY_0_PAD) && (scancode <= KEY_9_PAD)) { - if (((key_shifts & KB_NUMLOCK_FLAG) != 0) == ((key_shifts & KB_SHIFT_FLAG) != 0)) { - scancode = numlock_table[scancode - KEY_0_PAD]; - } - table = standard_key_ascii_table; - } else if (key_shifts & KB_CTRL_FLAG) { - table = standard_key_control_table; - } else if (key_shifts & KB_SHIFT_FLAG) { - if (key_shifts & KB_CAPSLOCK_FLAG) { - if (standard_key_ascii_table[scancode] == standard_key_capslock_table[scancode]) { - table = standard_key_shift_table; - } else { - table = standard_key_ascii_table; - } - } else { - table = standard_key_shift_table; - } - } else if (key_shifts & KB_CAPSLOCK_FLAG) { - table = standard_key_capslock_table; - } else { - table = standard_key_ascii_table; - } - - key_buffer.key[key_buffer.end++] = (scancode << 16) | table[scancode]; - - if (key_buffer.end >= KEY_BUFFER_SIZE) - key_buffer.end = 0; - if (key_buffer.end == key_buffer.start) { - key_buffer.start++; - if (key_buffer.start >= KEY_BUFFER_SIZE) - key_buffer.start = 0; - } -} ENDOFUNC(inject_key) - - -static void -handle_code (int scancode, int keycode) -{ - in_a_terrupt++; - - if (keycode == 0) { /* pause */ - inject_key(scancode); - pc_key[KEY_PAUSE] ^= TRUE; - } else if (scancode) { - int flag; - - if (scancode >= KEY_MODIFIERS) { - flag = modifier_table[scancode - KEY_MODIFIERS]; - } else { - flag = 0; - } - if ((char)keycode < 0) { /* release */ - pc_key[scancode] = FALSE; - if (flag & KB_MODIFIERS) { - key_shifts &= ~flag; - } - } else { /* keypress */ - pc_key[scancode] = TRUE; - if (flag & KB_MODIFIERS) { - key_shifts |= flag; - } - if (flag & KB_LED_FLAGS) { - key_shifts ^= flag; - update_leds(key_shifts); - } - if (scancode < KEY_MODIFIERS) { - inject_key(scancode); - } - } - } - - in_a_terrupt--; -} ENDOFUNC(handle_code) - - -static int -keyboard () -{ - unsigned char temp, scancode; - - temp = inportb(0x60); - - if (temp <= 0xe1) { - if (key_pause_loop) { - if (!--key_pause_loop) handle_code(KEY_PAUSE, 0); - } else - switch (temp) { - case 0xe0: - key_enhanced = TRUE; - break; - case 0xe1: - key_pause_loop = 5; - break; - default: - if (key_enhanced) { - key_enhanced = FALSE; - scancode = hw_to_mycode_ex[temp & 0x7f]; - } else { - scancode = hw_to_mycode[temp & 0x7f]; - } - handle_code(scancode, temp); - } - } - - if (((temp==0x4F)||(temp==0x53))&&(key_shifts&KB_CTRL_FLAG)&&(key_shifts&KB_ALT_FLAG)) { - /* Hack alert: - * only SIGINT (but not Ctrl-Break) - * calls the destructors and will safely clean up - */ - __asm("\n\ - movb $0x79, %%al \n\ - call ___djgpp_hw_exception \n\ - ":::"%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory"); - } - - __asm("\n\ - inb $0x61, %%al \n\ - movb %%al, %%ah \n\ - orb $0x80, %%al \n\ - outb %%al, $0x61 \n\ - xchgb %%al, %%ah \n\ - outb %%al, $0x61 \n\ - movb $0x20, %%al \n\ - outb %%al, $0x20 \n\ - ":::"%eax"); - return 0; -} ENDOFUNC(keyboard) - - -int -pc_keypressed (void) -{ - return (key_buffer.start!=key_buffer.end); -} - - -int -pc_readkey (void) -{ - if (keyboard_installed) { - int key; - - while (key_buffer.start == key_buffer.end) { - __dpmi_yield(); - } - - DISABLE(); - key = key_buffer.key[key_buffer.start++]; - if (key_buffer.start >= KEY_BUFFER_SIZE) - key_buffer.start = 0; - ENABLE(); - - return key; - } else { - return 0; - } -} - - -int -pc_keydown (int code) -{ - return pc_key[code]; -} - - -int -pc_keyshifts (void) -{ - return key_shifts; -} - - -void -pc_remove_keyb (void) -{ - if (keyboard_installed) { - int s1, s2, s3; - - keyboard_installed = FALSE; - pc_clexit(pc_remove_keyb); - - DISABLE(); - _farsetsel(__djgpp_dos_sel); - _farnspokew(0x41c, _farnspeekw(0x41a)); - - s1 = _farnspeekb(0x417) & 0x80; - s2 = _farnspeekb(0x418) & 0xFC; - s3 = _farnspeekb(0x496) & 0xF3; - - if (pc_key[KEY_RSHIFT]) { s1 |= 1; } - if (pc_key[KEY_LSHIFT]) { s1 |= 2; } - if (pc_key[KEY_LCONTROL]) { s2 |= 1; s1 |= 4; } - if (pc_key[KEY_ALT]) { s1 |= 8; s2 |= 2; } - if (pc_key[KEY_RCONTROL]) { s1 |= 4; s3 |= 4; } - if (pc_key[KEY_ALTGR]) { s1 |= 8; s3 |= 8; } - - if (key_shifts & KB_SCROLOCK_FLAG) s1 |= 16; - if (key_shifts & KB_NUMLOCK_FLAG) s1 |= 32; - if (key_shifts & KB_CAPSLOCK_FLAG) s1 |= 64; - - _farnspokeb(0x417, s1); - _farnspokeb(0x418, s2); - _farnspokeb(0x496, s3); - update_leds(key_shifts); - - ENABLE(); - pc_remove_irq(KEYB_IRQ); - } -} - - -int -pc_install_keyb (void) -{ - if (keyboard_installed || pc_install_irq(KEYB_IRQ, keyboard)) { - return -1; - } else { - int s1, s2, s3; - - LOCKDATA(key_buffer); - LOCKDATA(key_enhanced); - LOCKDATA(key_pause_loop); - LOCKDATA(key_shifts); - LOCKDATA(leds_ok); - LOCKDATA(in_a_terrupt); - LOCKDATA(pc_key); - LOCKDATA(modifier_table); - LOCKDATA(hw_to_mycode); - LOCKDATA(hw_to_mycode_ex); - LOCKDATA(standard_key_ascii_table); - LOCKDATA(standard_key_capslock_table); - LOCKDATA(standard_key_shift_table); - LOCKDATA(standard_key_control_table); - LOCKDATA(numlock_table); - LOCKFUNC(update_leds); - LOCKFUNC(inject_key); - LOCKFUNC(handle_code); - LOCKFUNC(keyboard); - - DISABLE(); - _farsetsel(__djgpp_dos_sel); - _farnspokew(0x41c, _farnspeekw(0x41a)); - - key_shifts = 0; - s1 = _farnspeekb(0x417); - s2 = _farnspeekb(0x418); - s3 = _farnspeekb(0x496); - - if (s1 & 1) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_RSHIFT] = TRUE; } - if (s1 & 2) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_LSHIFT] = TRUE; } - if (s2 & 1) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_LCONTROL] = TRUE; } - if (s2 & 2) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALT] = TRUE; } - if (s3 & 4) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_RCONTROL] = TRUE; } - if (s3 & 8) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALTGR] = TRUE; } - - if (s1 & 16) key_shifts |= KB_SCROLOCK_FLAG; - if (s1 & 32) key_shifts |= KB_NUMLOCK_FLAG; - if (s1 & 64) key_shifts |= KB_CAPSLOCK_FLAG; - update_leds(key_shifts); - - key_enhanced = key_pause_loop = 0; - key_buffer.start = key_buffer.end = 0; - ENABLE(); - - pc_atexit(pc_remove_keyb); - keyboard_installed = TRUE; - return 0; - } -} diff --git a/src/glut/dos/PC_HW/pc_mouse.c b/src/glut/dos/PC_HW/pc_mouse.c deleted file mode 100644 index 5bf99d367f..0000000000 --- a/src/glut/dos/PC_HW/pc_mouse.c +++ /dev/null @@ -1,293 +0,0 @@ -/* - * PC/HW routine collection v1.3 for DOS/DJGPP - * - * Copyright (C) 2002 - Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include -#include - -#include "pc_hw.h" - - -#define PC_CUTE_WHEEL 1 /* CuteMouse WheelAPI */ - -#define MOUSE_STACK_SIZE 16384 - -#define CLEAR_MICKEYS() \ - do { \ - __asm __volatile ("movw $0xb, %%ax; int $0x33":::"%eax", "%ecx", "%edx"); \ - ox = oy = 0; \ - } while (0) - -extern void mouse_wrap (void); -extern int mouse_wrap_end[]; - -static MFUNC mouse_func; -static long mouse_callback; -static __dpmi_regs mouse_regs; - -static volatile struct { - volatile int x, y, z, b; -} pc_mouse; - -static int minx = 0; -static int maxx = 319; -static int miny = 0; -static int maxy = 199; -static int minz = 0; -static int maxz = 255; - -static int sx = 2; -static int sy = 2; - -static int emulat3 = FALSE; - -static int ox, oy; - - -static void -mouse (__dpmi_regs *r) -{ - int nx = (signed short)r->x.si / sx; - int ny = (signed short)r->x.di / sy; - int dx = nx - ox; - int dy = ny - oy; -#if PC_CUTE_WHEEL - int dz = (signed char)r->h.bh; -#endif - ox = nx; - oy = ny; - - pc_mouse.b = r->h.bl; - pc_mouse.x = MID(minx, pc_mouse.x + dx, maxx); - pc_mouse.y = MID(miny, pc_mouse.y + dy, maxy); -#if PC_CUTE_WHEEL - pc_mouse.z = MID(minz, pc_mouse.z + dz, maxz); -#endif - - if (emulat3) { - if ((pc_mouse.b & 3) == 3) { - pc_mouse.b = 4; - } - } - - if (mouse_func) { - mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); - } -} ENDOFUNC(mouse) - - -void -pc_remove_mouse (void) -{ - if (mouse_callback) { - pc_clexit(pc_remove_mouse); - __asm("\n\ - movl %%edx, %%ecx \n\ - shrl $16, %%ecx \n\ - movw $0x0304, %%ax \n\ - int $0x31 \n\ - movw $0x000c, %%ax \n\ - xorl %%ecx, %%ecx \n\ - int $0x33 \n\ - "::"d"(mouse_callback):"%eax", "%ecx"); - - mouse_callback = 0; - - free((void *)(mouse_wrap_end[0] - MOUSE_STACK_SIZE)); - } -} - - -int -pc_install_mouse (void) -{ - int buttons; - - /* fail if already call-backed */ - if (mouse_callback) { - return 0; - } - - /* reset mouse and get status */ - __asm("\n\ - xorl %%eax, %%eax \n\ - int $0x33 \n\ - andl %%ebx, %%eax \n\ - movl %%eax, %0 \n\ - ":"=g" (buttons)::"%eax", "%ebx"); - if (!buttons) { - return 0; - } - - /* lock wrapper */ - LOCKDATA(mouse_func); - LOCKDATA(mouse_callback); - LOCKDATA(mouse_regs); - LOCKDATA(pc_mouse); - LOCKDATA(minx); - LOCKDATA(maxx); - LOCKDATA(miny); - LOCKDATA(maxy); - LOCKDATA(minz); - LOCKDATA(maxz); - LOCKDATA(sx); - LOCKDATA(sy); - LOCKDATA(emulat3); - LOCKDATA(ox); - LOCKDATA(oy); - LOCKFUNC(mouse); - LOCKFUNC(mouse_wrap); - - mouse_wrap_end[1] = __djgpp_ds_alias; - /* grab a locked stack */ - if ((mouse_wrap_end[0] = (int)pc_malloc(MOUSE_STACK_SIZE)) == NULL) { - return 0; - } - - /* try to hook a call-back */ - __asm("\n\ - pushl %%ds \n\ - pushl %%es \n\ - movw $0x0303, %%ax \n\ - pushl %%ds \n\ - pushl %%cs \n\ - popl %%ds \n\ - popl %%es \n\ - int $0x31 \n\ - popl %%es \n\ - popl %%ds \n\ - jc 0f \n\ - shll $16, %%ecx \n\ - movw %%dx, %%cx \n\ - movl %%ecx, %0 \n\ - 0: \n\ - ":"=g"(mouse_callback) - :"S" (mouse_wrap), "D"(&mouse_regs) - :"%eax", "%ecx", "%edx"); - if (!mouse_callback) { - free((void *)mouse_wrap_end[0]); - return 0; - } - - /* adjust stack */ - mouse_wrap_end[0] += MOUSE_STACK_SIZE; - - /* install the handler */ - mouse_regs.x.ax = 0x000c; -#if PC_CUTE_WHEEL - mouse_regs.x.cx = 0x7f | 0x80; -#else - mouse_regs.x.cx = 0x7f; -#endif - mouse_regs.x.dx = mouse_callback & 0xffff; - mouse_regs.x.es = mouse_callback >> 16; - __dpmi_int(0x33, &mouse_regs); - - CLEAR_MICKEYS(); - - emulat3 = (buttons < 3); - pc_atexit(pc_remove_mouse); - return buttons; -} - - -MFUNC -pc_install_mouse_handler (MFUNC handler) -{ - MFUNC old; - - if (!mouse_callback && !pc_install_mouse()) { - return NULL; - } - - old = mouse_func; - mouse_func = handler; - return old; -} - - -void -pc_mouse_area (int x1, int y1, int x2, int y2) -{ - minx = x1; - maxx = x2; - miny = y1; - maxy = y2; -} - - -void -pc_mouse_speed (int xspeed, int yspeed) -{ - DISABLE(); - - sx = MAX(1, xspeed); - sy = MAX(1, yspeed); - - ENABLE(); -} - - -int -pc_query_mouse (int *x, int *y, int *z) -{ - *x = pc_mouse.x; - *y = pc_mouse.y; - *z = pc_mouse.z; - return pc_mouse.b; -} - - -void -pc_warp_mouse (int x, int y) -{ - CLEAR_MICKEYS(); - - pc_mouse.x = MID(minx, x, maxx); - pc_mouse.y = MID(miny, y, maxy); - - if (mouse_func) { - mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b); - } -} - - -/* Hack alert: - * `mouse_wrap_end' actually holds the - * address of stack in a safe data selector. - */ -__asm("\n\ - .text \n\ - .p2align 5,,31 \n\ - .global _mouse_wrap \n\ -_mouse_wrap: \n\ - cld \n\ - lodsl \n\ - movl %eax, %es:42(%edi) \n\ - addw $4, %es:46(%edi) \n\ - pushl %es \n\ - movl %ss, %ebx \n\ - movl %esp, %esi \n\ - lss %cs:_mouse_wrap_end, %esp\n\ - pushl %ss \n\ - pushl %ss \n\ - popl %es \n\ - popl %ds \n\ - movl ___djgpp_dos_sel, %fs \n\ - pushl %fs \n\ - popl %gs \n\ - pushl %edi \n\ - call _mouse \n\ - popl %edi \n\ - movl %ebx, %ss \n\ - movl %esi, %esp \n\ - popl %es \n\ - iret \n\ - .global _mouse_wrap_end \n\ -_mouse_wrap_end:.long 0, 0"); diff --git a/src/glut/dos/PC_HW/pc_timer.c b/src/glut/dos/PC_HW/pc_timer.c deleted file mode 100644 index e7cbe70a1f..0000000000 --- a/src/glut/dos/PC_HW/pc_timer.c +++ /dev/null @@ -1,327 +0,0 @@ -/* - * PC/HW routine collection v1.5 for DOS/DJGPP - * - * Copyright (C) 2002 - Daniel Borca - * Email : dborca@yahoo.com - * Web : http://www.geocities.com/dborca - */ - - -#include -#include - -#include "pc_hw.h" - -#define TIMER_IRQ 0 - -#define MAX_TIMERS 8 - -#define PIT_FREQ 0x1234DD - -#define ADJUST(timer, basefreq) timer.counter = PIT_FREQ * timer.freq / SQR(basefreq) - -#define unvolatile(__v, __t) __extension__ ({union { volatile __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;}) - -static int timer_installed; - -typedef struct { - volatile unsigned int counter, clock_ticks, freq; - volatile PFUNC func; - volatile void *parm; -} TIMER; - -static TIMER timer_main, timer_func[MAX_TIMERS]; - - -/* Desc: main timer callback - * - * In : - - * Out : 0 to bypass BIOS, 1 to chain to BIOS - * - * Note: - - */ -static int -timer () -{ - int i; - - for (i = 0; i < MAX_TIMERS; i++) { - TIMER *t = &timer_func[i]; - if (t->func) { - t->clock_ticks += t->counter; - if (t->clock_ticks >= timer_main.counter) { - t->clock_ticks -= timer_main.counter; - t->func(unvolatile(t->parm, void *)); - } - } - } - - timer_main.clock_ticks += timer_main.counter; - if (timer_main.clock_ticks >= 0x10000) { - timer_main.clock_ticks -= 0x10000; - return 1; - } else { - outportb(0x20, 0x20); - return 0; - } -} ENDOFUNC(timer) - - -/* Desc: uninstall timer engine - * - * In : - - * Out : - - * - * Note: - - */ -void -pc_remove_timer (void) -{ - if (timer_installed) { - timer_installed = FALSE; - pc_clexit(pc_remove_timer); - - DISABLE(); - outportb(0x43, 0x34); - outportb(0x40, 0); - outportb(0x40, 0); - ENABLE(); - - pc_remove_irq(TIMER_IRQ); - } -} - - -/* Desc: remove timerfunc - * - * In : timerfunc id - * Out : 0 if success - * - * Note: tries to relax the main timer whenever possible - */ -int -pc_remove_int (int fid) -{ - int i; - unsigned int freq = 0; - - /* are we installed? */ - if (!timer_installed) { - return -1; - } - - /* sanity check */ - if ((fid < 0) || (fid >= MAX_TIMERS) || (timer_func[fid].func == NULL)) { - return -1; - } - timer_func[fid].func = NULL; - - /* scan for maximum frequency */ - for (i = 0; i < MAX_TIMERS; i++) { - TIMER *t = &timer_func[i]; - if (t->func) { - if (freq < t->freq) { - freq = t->freq; - } - } - } - - /* if there are no callbacks left, cleanup */ - if (!freq) { - pc_remove_timer(); - return 0; - } - - /* if we just lowered the maximum frequency, try to relax the timer engine */ - if (freq < timer_main.freq) { - unsigned int new_counter = PIT_FREQ / freq; - - DISABLE(); - - for (i = 0; i < MAX_TIMERS; i++) { - if (timer_func[i].func) { - ADJUST(timer_func[i], freq); - } - } - - outportb(0x43, 0x34); - outportb(0x40, (unsigned char)new_counter); - outportb(0x40, (unsigned char)(new_counter>>8)); - timer_main.clock_ticks = 0; - timer_main.counter = new_counter; - timer_main.freq = freq; - - ENABLE(); - } - - return 0; -} ENDOFUNC(pc_remove_int) - - -/* Desc: adjust timerfunc - * - * In : timerfunc id, new frequency (Hz) - * Out : 0 if success - * - * Note: might change the main timer frequency - */ -int -pc_adjust_int (int fid, unsigned int freq) -{ - int i; - - /* are we installed? */ - if (!timer_installed) { - return -1; - } - - /* sanity check */ - if ((fid < 0) || (fid >= MAX_TIMERS) || (timer_func[fid].func == NULL)) { - return -1; - } - timer_func[fid].freq = freq; - - /* scan for maximum frequency */ - freq = 0; - for (i = 0; i < MAX_TIMERS; i++) { - TIMER *t = &timer_func[i]; - if (t->func) { - if (freq < t->freq) { - freq = t->freq; - } - } - } - - /* update main timer / sons to match highest frequency */ - DISABLE(); - - /* using '>' is correct still (and avoids updating - * the HW timer too often), but doesn't relax the timer! - */ - if (freq != timer_main.freq) { - unsigned int new_counter = PIT_FREQ / freq; - - for (i = 0; i < MAX_TIMERS; i++) { - if (timer_func[i].func) { - ADJUST(timer_func[i], freq); - } - } - - outportb(0x43, 0x34); - outportb(0x40, (unsigned char)new_counter); - outportb(0x40, (unsigned char)(new_counter>>8)); - timer_main.clock_ticks = 0; - timer_main.counter = new_counter; - timer_main.freq = freq; - } else { - ADJUST(timer_func[fid], timer_main.freq); - } - - ENABLE(); - - return 0; -} ENDOFUNC(pc_adjust_int) - - -/* Desc: install timer engine - * - * In : - - * Out : 0 for success - * - * Note: initial frequency is 18.2 Hz - */ -static int -install_timer (void) -{ - if (timer_installed || pc_install_irq(TIMER_IRQ, timer)) { - return -1; - } else { - memset(timer_func, 0, sizeof(timer_func)); - - LOCKDATA(timer_func); - LOCKDATA(timer_main); - LOCKFUNC(timer); - LOCKFUNC(pc_adjust_int); - LOCKFUNC(pc_remove_int); - - timer_main.counter = 0x10000; - - DISABLE(); - outportb(0x43, 0x34); - outportb(0x40, 0); - outportb(0x40, 0); - timer_main.clock_ticks = 0; - ENABLE(); - - pc_atexit(pc_remove_timer); - timer_installed = TRUE; - return 0; - } -} - - -/* Desc: install timerfunc - * - * In : callback function, opaque pointer to be passed to callee, freq (Hz) - * Out : timerfunc id (0 .. MAX_TIMERS-1) - * - * Note: returns -1 if error - */ -int -pc_install_int (PFUNC func, void *parm, unsigned int freq) -{ - int i; - TIMER *t = NULL; - - /* ensure the timer engine is set up */ - if (!timer_installed) { - if (install_timer()) { - return -1; - } - } - - /* find an empty slot */ - for (i = 0; i < MAX_TIMERS; i++) { - if (!timer_func[i].func) { - t = &timer_func[i]; - break; - } - } - if (t == NULL) { - return -1; - } - - DISABLE(); - - t->func = func; - t->parm = parm; - t->freq = freq; - t->clock_ticks = 0; - - /* update main timer / sons to match highest frequency */ - if (freq > timer_main.freq) { - unsigned int new_counter = PIT_FREQ / freq; - - for (i = 0; i < MAX_TIMERS; i++) { - if (timer_func[i].func) { - ADJUST(timer_func[i], freq); - } - } - - outportb(0x43, 0x34); - outportb(0x40, (unsigned char)new_counter); - outportb(0x40, (unsigned char)(new_counter>>8)); - timer_main.clock_ticks = 0; - timer_main.counter = new_counter; - timer_main.freq = freq; - } else { - /* t == &timer_func[i] */ - ADJUST(timer_func[i], timer_main.freq); - } - - i = t - timer_func; - - ENABLE(); - - return i; -} diff --git a/src/glut/dos/bitmap.c b/src/glut/dos/bitmap.c deleted file mode 100644 index 6d6b91e1c7..0000000000 --- a/src/glut/dos/bitmap.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "internal.h" - - -void APIENTRY -glutBitmapCharacter (void *font, int c) -{ - const GLUTBitmapFont *bfp = _glut_font(font); - const GLUTBitmapChar *bcp; - - if (c >= bfp->num || !(bcp = bfp->table[c])) - return; - - glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); - - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glBitmap(bcp->width, bcp->height, bcp->xorig, bcp->yorig, - bcp->xmove, 0, bcp->bitmap); - - glPopClientAttrib(); -} - - -void APIENTRY -glutBitmapString (void *font, const unsigned char *string) -{ - const GLUTBitmapFont *bfp = _glut_font(font); - const GLUTBitmapChar *bcp; - unsigned char c; - - glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); - - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - - while ((c = *(string++))) { - if (c < bfp->num && (bcp = bfp->table[c])) - glBitmap(bcp->width, bcp->height, bcp->xorig, - bcp->yorig, bcp->xmove, 0, bcp->bitmap); - } - - glPopClientAttrib(); -} - - -int APIENTRY -glutBitmapWidth (void *font, int c) -{ - const GLUTBitmapFont *bfp = _glut_font(font); - const GLUTBitmapChar *bcp; - - if (c >= bfp->num || !(bcp = bfp->table[c])) - return 0; - - return bcp->xmove; -} - - -int APIENTRY -glutBitmapLength (void *font, const unsigned char *string) -{ - const GLUTBitmapFont *bfp = _glut_font(font); - const GLUTBitmapChar *bcp; - unsigned char c; - int length = 0; - - while ((c = *(string++))) { - if (c < bfp->num && (bcp = bfp->table[c])) - length += bcp->xmove; - } - - return length; -} - - -int APIENTRY -glutBitmapHeight (void *font) -{ - const GLUTBitmapFont *bfp = _glut_font(font); - - return bfp->height; -} diff --git a/src/glut/dos/callback.c b/src/glut/dos/callback.c deleted file mode 100644 index b6cc58feae..0000000000 --- a/src/glut/dos/callback.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "internal.h" - - -GLUTSShotCB _glut_timer_cb[MAX_TIMER_CB]; - -GLUTidleCB _glut_idle_func = NULL; - - -void APIENTRY -glutDisplayFunc (GLUTdisplayCB func) -{ - _glut_current->display = func; -} - - -void APIENTRY -glutReshapeFunc (GLUTreshapeCB func) -{ - _glut_current->reshape = func; -} - - -void APIENTRY -glutKeyboardFunc (GLUTkeyboardCB func) -{ - _glut_current->keyboard = func; -} - - -void APIENTRY -glutMouseFunc (GLUTmouseCB func) -{ - _glut_current->mouse = func; -} - - -void APIENTRY -glutMotionFunc (GLUTmotionCB func) -{ - _glut_current->motion = func; -} - - -void APIENTRY -glutPassiveMotionFunc (GLUTpassiveCB func) -{ - _glut_current->passive = func; -} - - -void APIENTRY -glutEntryFunc (GLUTentryCB func) -{ - _glut_current->entry = func; -} - - -void APIENTRY -glutVisibilityFunc (GLUTvisibilityCB func) -{ - _glut_current->visibility = func; -} - - -void APIENTRY -glutWindowStatusFunc (GLUTwindowStatusCB func) -{ - _glut_current->windowStatus = func; -} - - -void APIENTRY -glutIdleFunc (GLUTidleCB func) -{ - _glut_idle_func = func; -} - - -void APIENTRY -glutTimerFunc (unsigned int millis, GLUTtimerCB func, int value) -{ - int i; - - if (millis > 0) { - for (i = 0; i < MAX_TIMER_CB; i++) { - GLUTSShotCB *cb = &_glut_timer_cb[i]; - if (cb->func == NULL) { - cb->value = value; - cb->func = func; - cb->time = glutGet(GLUT_ELAPSED_TIME) + millis; - break; - } - } - } -} - - -void APIENTRY -glutSpecialFunc (GLUTspecialCB func) -{ - _glut_current->special = func; -} - - -void APIENTRY -glutSpaceballMotionFunc (GLUTspaceMotionCB func) -{ - _glut_current->spaceMotion = func; -} - - -void APIENTRY -glutSpaceballRotateFunc (GLUTspaceRotateCB func) -{ - _glut_current->spaceRotate = func; -} - - -void APIENTRY -glutSpaceballButtonFunc (GLUTspaceButtonCB func) -{ - _glut_current->spaceButton = func; -} - - -void APIENTRY -glutDialsFunc (GLUTdialsCB func) -{ - _glut_current->dials = func; -} - - -void APIENTRY -glutButtonBoxFunc (GLUTbuttonBoxCB func) -{ - _glut_current->buttonBox = func; -} - - -void APIENTRY -glutTabletMotionFunc (GLUTtabletMotionCB func) -{ - _glut_current->tabletMotion = func; -} - - -void APIENTRY -glutTabletButtonFunc (GLUTtabletButtonCB func) -{ - _glut_current->tabletButton = func; -} - - -void APIENTRY -glutJoystickFunc (GLUTjoystickCB func, int interval) -{ - _glut_current->joystick = func; -} - - -void APIENTRY -glutKeyboardUpFunc (GLUTkeyboardCB func) -{ - _glut_current->keyboardUp = func; -} - - -void APIENTRY -glutSpecialUpFunc (GLUTspecialCB func) -{ - _glut_current->specialUp = func; -} - - -void APIENTRY -glutMouseWheelFunc (GLUTmouseWheelCB func) -{ - _glut_current->mouseWheel = func; -} diff --git a/src/glut/dos/color.c b/src/glut/dos/color.c deleted file mode 100644 index 5ffc1209a2..0000000000 --- a/src/glut/dos/color.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "internal.h" - - -#define CLAMP(i) ((i) > 1.0F ? 1.0F : ((i) < 0.0F ? 0.0F : (i))) - - -void APIENTRY -glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue) -{ - if (_glut_default.mode & GLUT_INDEX) { - if ((ndx >= 0) && (ndx < (256 - RESERVED_COLORS))) { - DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue)); - } - } -} - - -GLfloat APIENTRY -glutGetColor (int ndx, int component) -{ - return 0.0; -} - - -void APIENTRY -glutCopyColormap (int win) -{ -} diff --git a/src/glut/dos/extens.c b/src/glut/dos/extens.c deleted file mode 100644 index 8bb867264e..0000000000 --- a/src/glut/dos/extens.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include - -#include "internal.h" - - -int APIENTRY -glutExtensionSupported (const char *extension) -{ - static const GLubyte *extensions = NULL; - const GLubyte *last, *where; - - /* Extension names should not have spaces. */ - if (strchr(extension, ' ') || *extension == '\0') { - return GL_FALSE; - } - - /* Not my problem if you don't have a valid OpenGL context */ - if (!extensions) { - extensions = glGetString(GL_EXTENSIONS); - } - if (!extensions) { - return GL_FALSE; - } - - /* Take care of sub-strings etc. */ - for (last = extensions;;) { - if ((where = (GLubyte *)strstr((const char *)last, extension)) == NULL) { - return GL_FALSE; - } - last = where + strlen(extension); - if (where == extensions || *(where - 1) == ' ') { - if (*last == ' ' || *last == '\0') { - return GL_TRUE; - } - } - } -} - - -GLUTproc APIENTRY -glutGetProcAddress (const char *procName) -{ - /* TODO - handle glut namespace */ - return (GLUTproc)DMesaGetProcAddress(procName); -} diff --git a/src/glut/dos/f8x13.c b/src/glut/dos/f8x13.c deleted file mode 100644 index bbf58b52b1..0000000000 --- a/src/glut/dos/f8x13.c +++ /dev/null @@ -1,1183 +0,0 @@ -/* autogenerated by bdf2c! do not edit */ - -/* "Public domain font. Share and enjoy." */ - - -#include "internal.h" -/* -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; -*/ - - -static const unsigned char ch0data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch0 = { 8, 13, 0, 2, 8, ch0data }; - -static const unsigned char ch1data[] = { - 0x0,0x0,0x0,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch1 = { 8, 13, 0, 2, 8, ch1data }; - -static const unsigned char ch2data[] = { - 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x0 -}; -static const GLUTBitmapChar ch2 = { 8, 13, 0, 2, 8, ch2data }; - -static const unsigned char ch3data[] = { - 0x8,0x8,0x8,0x3e,0x88,0x88,0xf8,0x88,0x88,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch3 = { 8, 13, 0, 2, 8, ch3data }; - -static const unsigned char ch4data[] = { - 0x10,0x10,0x1c,0x10,0x9e,0x80,0xe0,0x80,0xf0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch4 = { 8, 13, 0, 2, 8, ch4data }; - -static const unsigned char ch5data[] = { - 0x22,0x22,0x3c,0x22,0x3c,0x78,0x80,0x80,0x78,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch5 = { 8, 13, 0, 2, 8, ch5data }; - -static const unsigned char ch6data[] = { - 0x20,0x20,0x3c,0x20,0x3e,0xf8,0x80,0x80,0x80,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch6 = { 8, 13, 0, 2, 8, ch6data }; - -static const unsigned char ch7data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x38,0x44,0x44,0x38,0x0,0x0 -}; -static const GLUTBitmapChar ch7 = { 8, 13, 0, 2, 8, ch7data }; - -static const unsigned char ch8data[] = { - 0x0,0x0,0xfe,0x10,0x10,0xfe,0x10,0x10,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch8 = { 8, 13, 0, 2, 8, ch8data }; - -static const unsigned char ch9data[] = { - 0x3e,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch9 = { 8, 13, 0, 2, 8, ch9data }; - -static const unsigned char ch10data[] = { - 0x8,0x8,0x8,0x8,0x3e,0x20,0x50,0x88,0x88,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch10 = { 8, 13, 0, 2, 8, ch10data }; - -static const unsigned char ch11data[] = { - 0x0,0x0,0x0,0x0,0x0,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch11 = { 8, 13, 0, 2, 8, ch11data }; - -static const unsigned char ch12data[] = { - 0x10,0x10,0x10,0x10,0x10,0xf0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch12 = { 8, 13, 0, 2, 8, ch12data }; - -static const unsigned char ch13data[] = { - 0x10,0x10,0x10,0x10,0x10,0x1f,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch13 = { 8, 13, 0, 2, 8, ch13data }; - -static const unsigned char ch14data[] = { - 0x0,0x0,0x0,0x0,0x0,0x1f,0x10,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch14 = { 8, 13, 0, 2, 8, ch14data }; - -static const unsigned char ch15data[] = { - 0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch15 = { 8, 13, 0, 2, 8, ch15data }; - -static const unsigned char ch16data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch16 = { 8, 13, 0, 2, 8, ch16data }; - -static const unsigned char ch17data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch17 = { 8, 13, 0, 2, 8, ch17data }; - -static const unsigned char ch18data[] = { - 0x0,0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch18 = { 8, 13, 0, 2, 8, ch18data }; - -static const unsigned char ch19data[] = { - 0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch19 = { 8, 13, 0, 2, 8, ch19data }; - -static const unsigned char ch20data[] = { - 0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch20 = { 8, 13, 0, 2, 8, ch20data }; - -static const unsigned char ch21data[] = { - 0x10,0x10,0x10,0x10,0x10,0x1f,0x10,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch21 = { 8, 13, 0, 2, 8, ch21data }; - -static const unsigned char ch22data[] = { - 0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch22 = { 8, 13, 0, 2, 8, ch22data }; - -static const unsigned char ch23data[] = { - 0x0,0x0,0x0,0x0,0x0,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch23 = { 8, 13, 0, 2, 8, ch23data }; - -static const unsigned char ch24data[] = { - 0x10,0x10,0x10,0x10,0x10,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch24 = { 8, 13, 0, 2, 8, ch24data }; - -static const unsigned char ch25data[] = { - 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch25 = { 8, 13, 0, 2, 8, ch25data }; - -static const unsigned char ch26data[] = { - 0x0,0x0,0xfe,0x2,0x8,0x20,0x80,0x20,0x8,0x2,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch26 = { 8, 13, 0, 2, 8, ch26data }; - -static const unsigned char ch27data[] = { - 0x0,0x0,0xfe,0x80,0x20,0x8,0x2,0x8,0x20,0x80,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch27 = { 8, 13, 0, 2, 8, ch27data }; - -static const unsigned char ch28data[] = { - 0x0,0x0,0x44,0x24,0x24,0x24,0x24,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch28 = { 8, 13, 0, 2, 8, ch28data }; - -static const unsigned char ch29data[] = { - 0x0,0x0,0x80,0x40,0xfe,0x10,0xfe,0x4,0x2,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch29 = { 8, 13, 0, 2, 8, ch29data }; - -static const unsigned char ch30data[] = { - 0x0,0x0,0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c,0x0,0x0 -}; -static const GLUTBitmapChar ch30 = { 8, 13, 0, 2, 8, ch30data }; - -static const unsigned char ch31data[] = { - 0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch31 = { 8, 13, 0, 2, 8, ch31data }; - -static const unsigned char ch32data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch32 = { 8, 13, 0, 2, 8, ch32data }; - -static const unsigned char ch33data[] = { - 0x0,0x0,0x10,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch33 = { 8, 13, 0, 2, 8, ch33data }; - -static const unsigned char ch34data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x24,0x24,0x0,0x0 -}; -static const GLUTBitmapChar ch34 = { 8, 13, 0, 2, 8, ch34data }; - -static const unsigned char ch35data[] = { - 0x0,0x0,0x0,0x24,0x24,0x7e,0x24,0x7e,0x24,0x24,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch35 = { 8, 13, 0, 2, 8, ch35data }; - -static const unsigned char ch36data[] = { - 0x0,0x0,0x0,0x10,0x78,0x14,0x38,0x50,0x3c,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch36 = { 8, 13, 0, 2, 8, ch36data }; - -static const unsigned char ch37data[] = { - 0x0,0x0,0x44,0x2a,0x24,0x10,0x8,0x8,0x24,0x52,0x22,0x0,0x0 -}; -static const GLUTBitmapChar ch37 = { 8, 13, 0, 2, 8, ch37data }; - -static const unsigned char ch38data[] = { - 0x0,0x0,0x3a,0x44,0x4a,0x30,0x48,0x48,0x30,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch38 = { 8, 13, 0, 2, 8, ch38data }; - -static const unsigned char ch39data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x30,0x38,0x0,0x0 -}; -static const GLUTBitmapChar ch39 = { 8, 13, 0, 2, 8, ch39data }; - -static const unsigned char ch40data[] = { - 0x0,0x0,0x4,0x8,0x8,0x10,0x10,0x10,0x8,0x8,0x4,0x0,0x0 -}; -static const GLUTBitmapChar ch40 = { 8, 13, 0, 2, 8, ch40data }; - -static const unsigned char ch41data[] = { - 0x0,0x0,0x20,0x10,0x10,0x8,0x8,0x8,0x10,0x10,0x20,0x0,0x0 -}; -static const GLUTBitmapChar ch41 = { 8, 13, 0, 2, 8, ch41data }; - -static const unsigned char ch42data[] = { - 0x0,0x0,0x0,0x0,0x24,0x18,0x7e,0x18,0x24,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch42 = { 8, 13, 0, 2, 8, ch42data }; - -static const unsigned char ch43data[] = { - 0x0,0x0,0x0,0x0,0x10,0x10,0x7c,0x10,0x10,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch43 = { 8, 13, 0, 2, 8, ch43data }; - -static const unsigned char ch44data[] = { - 0x0,0x40,0x30,0x38,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch44 = { 8, 13, 0, 2, 8, ch44data }; - -static const unsigned char ch45data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch45 = { 8, 13, 0, 2, 8, ch45data }; - -static const unsigned char ch46data[] = { - 0x0,0x10,0x38,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch46 = { 8, 13, 0, 2, 8, ch46data }; - -static const unsigned char ch47data[] = { - 0x0,0x0,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x2,0x0,0x0 -}; -static const GLUTBitmapChar ch47 = { 8, 13, 0, 2, 8, ch47data }; - -static const unsigned char ch48data[] = { - 0x0,0x0,0x18,0x24,0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x0,0x0 -}; -static const GLUTBitmapChar ch48 = { 8, 13, 0, 2, 8, ch48data }; - -static const unsigned char ch49data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x50,0x30,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch49 = { 8, 13, 0, 2, 8, ch49data }; - -static const unsigned char ch50data[] = { - 0x0,0x0,0x7e,0x40,0x20,0x18,0x4,0x2,0x42,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch50 = { 8, 13, 0, 2, 8, ch50data }; - -static const unsigned char ch51data[] = { - 0x0,0x0,0x3c,0x42,0x2,0x2,0x1c,0x8,0x4,0x2,0x7e,0x0,0x0 -}; -static const GLUTBitmapChar ch51 = { 8, 13, 0, 2, 8, ch51data }; - -static const unsigned char ch52data[] = { - 0x0,0x0,0x4,0x4,0x7e,0x44,0x44,0x24,0x14,0xc,0x4,0x0,0x0 -}; -static const GLUTBitmapChar ch52 = { 8, 13, 0, 2, 8, ch52data }; - -static const unsigned char ch53data[] = { - 0x0,0x0,0x3c,0x42,0x2,0x2,0x62,0x5c,0x40,0x40,0x7e,0x0,0x0 -}; -static const GLUTBitmapChar ch53 = { 8, 13, 0, 2, 8, ch53data }; - -static const unsigned char ch54data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x62,0x5c,0x40,0x40,0x20,0x1c,0x0,0x0 -}; -static const GLUTBitmapChar ch54 = { 8, 13, 0, 2, 8, ch54data }; - -static const unsigned char ch55data[] = { - 0x0,0x0,0x20,0x20,0x10,0x10,0x8,0x8,0x4,0x2,0x7e,0x0,0x0 -}; -static const GLUTBitmapChar ch55 = { 8, 13, 0, 2, 8, ch55data }; - -static const unsigned char ch56data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x3c,0x42,0x42,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch56 = { 8, 13, 0, 2, 8, ch56data }; - -static const unsigned char ch57data[] = { - 0x0,0x0,0x38,0x4,0x2,0x2,0x3a,0x46,0x42,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch57 = { 8, 13, 0, 2, 8, ch57data }; - -static const unsigned char ch58data[] = { - 0x0,0x10,0x38,0x10,0x0,0x0,0x10,0x38,0x10,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch58 = { 8, 13, 0, 2, 8, ch58data }; - -static const unsigned char ch59data[] = { - 0x0,0x40,0x30,0x38,0x0,0x0,0x10,0x38,0x10,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch59 = { 8, 13, 0, 2, 8, ch59data }; - -static const unsigned char ch60data[] = { - 0x0,0x0,0x2,0x4,0x8,0x10,0x20,0x10,0x8,0x4,0x2,0x0,0x0 -}; -static const GLUTBitmapChar ch60 = { 8, 13, 0, 2, 8, ch60data }; - -static const unsigned char ch61data[] = { - 0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch61 = { 8, 13, 0, 2, 8, ch61data }; - -static const unsigned char ch62data[] = { - 0x0,0x0,0x40,0x20,0x10,0x8,0x4,0x8,0x10,0x20,0x40,0x0,0x0 -}; -static const GLUTBitmapChar ch62 = { 8, 13, 0, 2, 8, ch62data }; - -static const unsigned char ch63data[] = { - 0x0,0x0,0x8,0x0,0x8,0x8,0x4,0x2,0x42,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch63 = { 8, 13, 0, 2, 8, ch63data }; - -static const unsigned char ch64data[] = { - 0x0,0x0,0x3c,0x40,0x4a,0x56,0x52,0x4e,0x42,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch64 = { 8, 13, 0, 2, 8, ch64data }; - -static const unsigned char ch65data[] = { - 0x0,0x0,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x24,0x18,0x0,0x0 -}; -static const GLUTBitmapChar ch65 = { 8, 13, 0, 2, 8, ch65data }; - -static const unsigned char ch66data[] = { - 0x0,0x0,0xfc,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc,0x0,0x0 -}; -static const GLUTBitmapChar ch66 = { 8, 13, 0, 2, 8, ch66data }; - -static const unsigned char ch67data[] = { - 0x0,0x0,0x3c,0x42,0x40,0x40,0x40,0x40,0x40,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch67 = { 8, 13, 0, 2, 8, ch67data }; - -static const unsigned char ch68data[] = { - 0x0,0x0,0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc,0x0,0x0 -}; -static const GLUTBitmapChar ch68 = { 8, 13, 0, 2, 8, ch68data }; - -static const unsigned char ch69data[] = { - 0x0,0x0,0x7e,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e,0x0,0x0 -}; -static const GLUTBitmapChar ch69 = { 8, 13, 0, 2, 8, ch69data }; - -static const unsigned char ch70data[] = { - 0x0,0x0,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0x7e,0x0,0x0 -}; -static const GLUTBitmapChar ch70 = { 8, 13, 0, 2, 8, ch70data }; - -static const unsigned char ch71data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x4e,0x40,0x40,0x40,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch71 = { 8, 13, 0, 2, 8, ch71data }; - -static const unsigned char ch72data[] = { - 0x0,0x0,0x42,0x42,0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x0,0x0 -}; -static const GLUTBitmapChar ch72 = { 8, 13, 0, 2, 8, ch72data }; - -static const unsigned char ch73data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x0 -}; -static const GLUTBitmapChar ch73 = { 8, 13, 0, 2, 8, ch73data }; - -static const unsigned char ch74data[] = { - 0x0,0x0,0x38,0x44,0x4,0x4,0x4,0x4,0x4,0x4,0x1e,0x0,0x0 -}; -static const GLUTBitmapChar ch74 = { 8, 13, 0, 2, 8, ch74data }; - -static const unsigned char ch75data[] = { - 0x0,0x0,0x42,0x44,0x48,0x50,0x60,0x50,0x48,0x44,0x42,0x0,0x0 -}; -static const GLUTBitmapChar ch75 = { 8, 13, 0, 2, 8, ch75data }; - -static const unsigned char ch76data[] = { - 0x0,0x0,0x7e,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x0 -}; -static const GLUTBitmapChar ch76 = { 8, 13, 0, 2, 8, ch76data }; - -static const unsigned char ch77data[] = { - 0x0,0x0,0x82,0x82,0x82,0x92,0x92,0xaa,0xc6,0x82,0x82,0x0,0x0 -}; -static const GLUTBitmapChar ch77 = { 8, 13, 0, 2, 8, ch77data }; - -static const unsigned char ch78data[] = { - 0x0,0x0,0x42,0x42,0x42,0x46,0x4a,0x52,0x62,0x42,0x42,0x0,0x0 -}; -static const GLUTBitmapChar ch78 = { 8, 13, 0, 2, 8, ch78data }; - -static const unsigned char ch79data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch79 = { 8, 13, 0, 2, 8, ch79data }; - -static const unsigned char ch80data[] = { - 0x0,0x0,0x40,0x40,0x40,0x40,0x7c,0x42,0x42,0x42,0x7c,0x0,0x0 -}; -static const GLUTBitmapChar ch80 = { 8, 13, 0, 2, 8, ch80data }; - -static const unsigned char ch81data[] = { - 0x0,0x2,0x3c,0x4a,0x52,0x42,0x42,0x42,0x42,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch81 = { 8, 13, 0, 2, 8, ch81data }; - -static const unsigned char ch82data[] = { - 0x0,0x0,0x42,0x44,0x48,0x50,0x7c,0x42,0x42,0x42,0x7c,0x0,0x0 -}; -static const GLUTBitmapChar ch82 = { 8, 13, 0, 2, 8, ch82data }; - -static const unsigned char ch83data[] = { - 0x0,0x0,0x3c,0x42,0x2,0x2,0x3c,0x40,0x40,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch83 = { 8, 13, 0, 2, 8, ch83data }; - -static const unsigned char ch84data[] = { - 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe,0x0,0x0 -}; -static const GLUTBitmapChar ch84 = { 8, 13, 0, 2, 8, ch84data }; - -static const unsigned char ch85data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x0 -}; -static const GLUTBitmapChar ch85 = { 8, 13, 0, 2, 8, ch85data }; - -static const unsigned char ch86data[] = { - 0x0,0x0,0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,0x0,0x0 -}; -static const GLUTBitmapChar ch86 = { 8, 13, 0, 2, 8, ch86data }; - -static const unsigned char ch87data[] = { - 0x0,0x0,0x44,0xaa,0x92,0x92,0x92,0x82,0x82,0x82,0x82,0x0,0x0 -}; -static const GLUTBitmapChar ch87 = { 8, 13, 0, 2, 8, ch87data }; - -static const unsigned char ch88data[] = { - 0x0,0x0,0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82,0x0,0x0 -}; -static const GLUTBitmapChar ch88 = { 8, 13, 0, 2, 8, ch88data }; - -static const unsigned char ch89data[] = { - 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,0x0,0x0 -}; -static const GLUTBitmapChar ch89 = { 8, 13, 0, 2, 8, ch89data }; - -static const unsigned char ch90data[] = { - 0x0,0x0,0x7e,0x40,0x40,0x20,0x10,0x8,0x4,0x2,0x7e,0x0,0x0 -}; -static const GLUTBitmapChar ch90 = { 8, 13, 0, 2, 8, ch90data }; - -static const unsigned char ch91data[] = { - 0x0,0x0,0x3c,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch91 = { 8, 13, 0, 2, 8, ch91data }; - -static const unsigned char ch92data[] = { - 0x0,0x0,0x2,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x80,0x0,0x0 -}; -static const GLUTBitmapChar ch92 = { 8, 13, 0, 2, 8, ch92data }; - -static const unsigned char ch93data[] = { - 0x0,0x0,0x78,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x78,0x0,0x0 -}; -static const GLUTBitmapChar ch93 = { 8, 13, 0, 2, 8, ch93data }; - -static const unsigned char ch94data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x44,0x28,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch94 = { 8, 13, 0, 2, 8, ch94data }; - -static const unsigned char ch95data[] = { - 0x0,0xfe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch95 = { 8, 13, 0, 2, 8, ch95data }; - -static const unsigned char ch96data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x18,0x38,0x0,0x0 -}; -static const GLUTBitmapChar ch96 = { 8, 13, 0, 2, 8, ch96data }; - -static const unsigned char ch97data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch97 = { 8, 13, 0, 2, 8, ch97data }; - -static const unsigned char ch98data[] = { - 0x0,0x0,0x5c,0x62,0x42,0x42,0x62,0x5c,0x40,0x40,0x40,0x0,0x0 -}; -static const GLUTBitmapChar ch98 = { 8, 13, 0, 2, 8, ch98data }; - -static const unsigned char ch99data[] = { - 0x0,0x0,0x3c,0x42,0x40,0x40,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch99 = { 8, 13, 0, 2, 8, ch99data }; - -static const unsigned char ch100data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x42,0x46,0x3a,0x2,0x2,0x2,0x0,0x0 -}; -static const GLUTBitmapChar ch100 = { 8, 13, 0, 2, 8, ch100data }; - -static const unsigned char ch101data[] = { - 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch101 = { 8, 13, 0, 2, 8, ch101data }; - -static const unsigned char ch102data[] = { - 0x0,0x0,0x20,0x20,0x20,0x20,0x7c,0x20,0x20,0x22,0x1c,0x0,0x0 -}; -static const GLUTBitmapChar ch102 = { 8, 13, 0, 2, 8, ch102data }; - -static const unsigned char ch103data[] = { - 0x3c,0x42,0x3c,0x40,0x38,0x44,0x44,0x3a,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch103 = { 8, 13, 0, 2, 8, ch103data }; - -static const unsigned char ch104data[] = { - 0x0,0x0,0x42,0x42,0x42,0x42,0x62,0x5c,0x40,0x40,0x40,0x0,0x0 -}; -static const GLUTBitmapChar ch104 = { 8, 13, 0, 2, 8, ch104data }; - -static const unsigned char ch105data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch105 = { 8, 13, 0, 2, 8, ch105data }; - -static const unsigned char ch106data[] = { - 0x38,0x44,0x44,0x4,0x4,0x4,0x4,0xc,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch106 = { 8, 13, 0, 2, 8, ch106data }; - -static const unsigned char ch107data[] = { - 0x0,0x0,0x42,0x44,0x48,0x70,0x48,0x44,0x40,0x40,0x40,0x0,0x0 -}; -static const GLUTBitmapChar ch107 = { 8, 13, 0, 2, 8, ch107data }; - -static const unsigned char ch108data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x30,0x0,0x0 -}; -static const GLUTBitmapChar ch108 = { 8, 13, 0, 2, 8, ch108data }; - -static const unsigned char ch109data[] = { - 0x0,0x0,0x82,0x92,0x92,0x92,0x92,0xec,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch109 = { 8, 13, 0, 2, 8, ch109data }; - -static const unsigned char ch110data[] = { - 0x0,0x0,0x42,0x42,0x42,0x42,0x62,0x5c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch110 = { 8, 13, 0, 2, 8, ch110data }; - -static const unsigned char ch111data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch111 = { 8, 13, 0, 2, 8, ch111data }; - -static const unsigned char ch112data[] = { - 0x40,0x40,0x40,0x5c,0x62,0x42,0x62,0x5c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch112 = { 8, 13, 0, 2, 8, ch112data }; - -static const unsigned char ch113data[] = { - 0x2,0x2,0x2,0x3a,0x46,0x42,0x46,0x3a,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch113 = { 8, 13, 0, 2, 8, ch113data }; - -static const unsigned char ch114data[] = { - 0x0,0x0,0x20,0x20,0x20,0x20,0x22,0x5c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch114 = { 8, 13, 0, 2, 8, ch114data }; - -static const unsigned char ch115data[] = { - 0x0,0x0,0x3c,0x42,0xc,0x30,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch115 = { 8, 13, 0, 2, 8, ch115data }; - -static const unsigned char ch116data[] = { - 0x0,0x0,0x1c,0x22,0x20,0x20,0x20,0x7c,0x20,0x20,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch116 = { 8, 13, 0, 2, 8, ch116data }; - -static const unsigned char ch117data[] = { - 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch117 = { 8, 13, 0, 2, 8, ch117data }; - -static const unsigned char ch118data[] = { - 0x0,0x0,0x10,0x28,0x28,0x44,0x44,0x44,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch118 = { 8, 13, 0, 2, 8, ch118data }; - -static const unsigned char ch119data[] = { - 0x0,0x0,0x44,0xaa,0x92,0x92,0x82,0x82,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch119 = { 8, 13, 0, 2, 8, ch119data }; - -static const unsigned char ch120data[] = { - 0x0,0x0,0x42,0x24,0x18,0x18,0x24,0x42,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch120 = { 8, 13, 0, 2, 8, ch120data }; - -static const unsigned char ch121data[] = { - 0x3c,0x42,0x2,0x3a,0x46,0x42,0x42,0x42,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch121 = { 8, 13, 0, 2, 8, ch121data }; - -static const unsigned char ch122data[] = { - 0x0,0x0,0x7e,0x20,0x10,0x8,0x4,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch122 = { 8, 13, 0, 2, 8, ch122data }; - -static const unsigned char ch123data[] = { - 0x0,0x0,0xe,0x10,0x10,0x8,0x30,0x8,0x10,0x10,0xe,0x0,0x0 -}; -static const GLUTBitmapChar ch123 = { 8, 13, 0, 2, 8, ch123data }; - -static const unsigned char ch124data[] = { - 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch124 = { 8, 13, 0, 2, 8, ch124data }; - -static const unsigned char ch125data[] = { - 0x0,0x0,0x70,0x8,0x8,0x10,0xc,0x10,0x8,0x8,0x70,0x0,0x0 -}; -static const GLUTBitmapChar ch125 = { 8, 13, 0, 2, 8, ch125data }; - -static const unsigned char ch126data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x48,0x54,0x24,0x0,0x0 -}; -static const GLUTBitmapChar ch126 = { 8, 13, 0, 2, 8, ch126data }; - -static const unsigned char ch127data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch127 = { 8, 13, 0, 2, 8, ch127data }; - -static const unsigned char ch160data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch160 = { 8, 13, 0, 2, 8, ch160data }; - -static const unsigned char ch161data[] = { - 0x0,0x0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x0,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch161 = { 8, 13, 0, 2, 8, ch161data }; - -static const unsigned char ch162data[] = { - 0x0,0x0,0x0,0x10,0x38,0x54,0x50,0x50,0x54,0x38,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch162 = { 8, 13, 0, 2, 8, ch162data }; - -static const unsigned char ch163data[] = { - 0x0,0x0,0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c,0x0,0x0 -}; -static const GLUTBitmapChar ch163 = { 8, 13, 0, 2, 8, ch163data }; - -static const unsigned char ch164data[] = { - 0x0,0x0,0x0,0x42,0x3c,0x24,0x24,0x3c,0x42,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch164 = { 8, 13, 0, 2, 8, ch164data }; - -static const unsigned char ch165data[] = { - 0x0,0x0,0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82,0x0,0x0 -}; -static const GLUTBitmapChar ch165 = { 8, 13, 0, 2, 8, ch165data }; - -static const unsigned char ch166data[] = { - 0x0,0x0,0x10,0x10,0x10,0x10,0x0,0x10,0x10,0x10,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch166 = { 8, 13, 0, 2, 8, ch166data }; - -static const unsigned char ch167data[] = { - 0x0,0x0,0x18,0x24,0x4,0x18,0x24,0x24,0x18,0x20,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch167 = { 8, 13, 0, 2, 8, ch167data }; - -static const unsigned char ch168data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6c,0x0,0x0 -}; -static const GLUTBitmapChar ch168 = { 8, 13, 0, 2, 8, ch168data }; - -static const unsigned char ch169data[] = { - 0x0,0x0,0x0,0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,0x38,0x0 -}; -static const GLUTBitmapChar ch169 = { 8, 13, 0, 2, 8, ch169data }; - -static const unsigned char ch170data[] = { - 0x0,0x0,0x0,0x0,0x7c,0x0,0x3c,0x44,0x3c,0x4,0x38,0x0,0x0 -}; -static const GLUTBitmapChar ch170 = { 8, 13, 0, 2, 8, ch170data }; - -static const unsigned char ch171data[] = { - 0x0,0x0,0x0,0x12,0x24,0x48,0x90,0x48,0x24,0x12,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch171 = { 8, 13, 0, 2, 8, ch171data }; - -static const unsigned char ch172data[] = { - 0x0,0x0,0x0,0x2,0x2,0x2,0x7e,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch172 = { 8, 13, 0, 2, 8, ch172data }; - -static const unsigned char ch173data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch173 = { 8, 13, 0, 2, 8, ch173data }; - -static const unsigned char ch174data[] = { - 0x0,0x0,0x0,0x38,0x44,0xaa,0xb2,0xaa,0xaa,0x92,0x44,0x38,0x0 -}; -static const GLUTBitmapChar ch174 = { 8, 13, 0, 2, 8, ch174data }; - -static const unsigned char ch175data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0 -}; -static const GLUTBitmapChar ch175 = { 8, 13, 0, 2, 8, ch175data }; - -static const unsigned char ch176data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x24,0x24,0x18,0x0,0x0 -}; -static const GLUTBitmapChar ch176 = { 8, 13, 0, 2, 8, ch176data }; - -static const unsigned char ch177data[] = { - 0x0,0x0,0x0,0x7c,0x0,0x10,0x10,0x7c,0x10,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch177 = { 8, 13, 0, 2, 8, ch177data }; - -static const unsigned char ch178data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x78,0x40,0x30,0x8,0x48,0x30,0x0 -}; -static const GLUTBitmapChar ch178 = { 8, 13, 0, 2, 8, ch178data }; - -static const unsigned char ch179data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x30,0x48,0x8,0x10,0x48,0x30,0x0 -}; -static const GLUTBitmapChar ch179 = { 8, 13, 0, 2, 8, ch179data }; - -static const unsigned char ch180data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch180 = { 8, 13, 0, 2, 8, ch180data }; - -static const unsigned char ch181data[] = { - 0x0,0x40,0x5a,0x66,0x42,0x42,0x42,0x42,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch181 = { 8, 13, 0, 2, 8, ch181data }; - -static const unsigned char ch182data[] = { - 0x0,0x0,0x14,0x14,0x14,0x14,0x34,0x74,0x74,0x74,0x3e,0x0,0x0 -}; -static const GLUTBitmapChar ch182 = { 8, 13, 0, 2, 8, ch182data }; - -static const unsigned char ch183data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch183 = { 8, 13, 0, 2, 8, ch183data }; - -static const unsigned char ch184data[] = { - 0x18,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch184 = { 8, 13, 0, 2, 8, ch184data }; - -static const unsigned char ch185data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x70,0x20,0x20,0x20,0x60,0x20,0x0 -}; -static const GLUTBitmapChar ch185 = { 8, 13, 0, 2, 8, ch185data }; - -static const unsigned char ch186data[] = { - 0x0,0x0,0x0,0x0,0x0,0x78,0x0,0x30,0x48,0x48,0x30,0x0,0x0 -}; -static const GLUTBitmapChar ch186 = { 8, 13, 0, 2, 8, ch186data }; - -static const unsigned char ch187data[] = { - 0x0,0x0,0x0,0x90,0x48,0x24,0x12,0x24,0x48,0x90,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch187 = { 8, 13, 0, 2, 8, ch187data }; - -static const unsigned char ch188data[] = { - 0x0,0x0,0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40,0x0 -}; -static const GLUTBitmapChar ch188 = { 8, 13, 0, 2, 8, ch188data }; - -static const unsigned char ch189data[] = { - 0x0,0x0,0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40,0x0 -}; -static const GLUTBitmapChar ch189 = { 8, 13, 0, 2, 8, ch189data }; - -static const unsigned char ch190data[] = { - 0x0,0x0,0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60,0x0 -}; -static const GLUTBitmapChar ch190 = { 8, 13, 0, 2, 8, ch190data }; - -static const unsigned char ch191data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x40,0x20,0x10,0x10,0x0,0x10,0x0,0x0 -}; -static const GLUTBitmapChar ch191 = { 8, 13, 0, 2, 8, ch191data }; - -static const unsigned char ch192data[] = { - 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch192 = { 8, 13, 0, 2, 8, ch192data }; - -static const unsigned char ch193data[] = { - 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch193 = { 8, 13, 0, 2, 8, ch193data }; - -static const unsigned char ch194data[] = { - 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch194 = { 8, 13, 0, 2, 8, ch194data }; - -static const unsigned char ch195data[] = { - 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x28,0x14,0x0 -}; -static const GLUTBitmapChar ch195 = { 8, 13, 0, 2, 8, ch195data }; - -static const unsigned char ch196data[] = { - 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch196 = { 8, 13, 0, 2, 8, ch196data }; - -static const unsigned char ch197data[] = { - 0x0,0x0,0x42,0x42,0x7e,0x42,0x42,0x24,0x18,0x18,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch197 = { 8, 13, 0, 2, 8, ch197data }; - -static const unsigned char ch198data[] = { - 0x0,0x0,0x9e,0x90,0x90,0xf0,0x9c,0x90,0x90,0x90,0x6e,0x0,0x0 -}; -static const GLUTBitmapChar ch198 = { 8, 13, 0, 2, 8, ch198data }; - -static const unsigned char ch199data[] = { - 0x10,0x8,0x3c,0x42,0x40,0x40,0x40,0x40,0x40,0x42,0x3c,0x0,0x0 -}; -static const GLUTBitmapChar ch199 = { 8, 13, 0, 2, 8, ch199data }; - -static const unsigned char ch200data[] = { - 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch200 = { 8, 13, 0, 2, 8, ch200data }; - -static const unsigned char ch201data[] = { - 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch201 = { 8, 13, 0, 2, 8, ch201data }; - -static const unsigned char ch202data[] = { - 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch202 = { 8, 13, 0, 2, 8, ch202data }; - -static const unsigned char ch203data[] = { - 0x0,0x0,0x7e,0x40,0x40,0x78,0x40,0x40,0x7e,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch203 = { 8, 13, 0, 2, 8, ch203data }; - -static const unsigned char ch204data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch204 = { 8, 13, 0, 2, 8, ch204data }; - -static const unsigned char ch205data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch205 = { 8, 13, 0, 2, 8, ch205data }; - -static const unsigned char ch206data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch206 = { 8, 13, 0, 2, 8, ch206data }; - -static const unsigned char ch207data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x10,0x7c,0x0,0x28,0x28,0x0 -}; -static const GLUTBitmapChar ch207 = { 8, 13, 0, 2, 8, ch207data }; - -static const unsigned char ch208data[] = { - 0x0,0x0,0xfc,0x42,0x42,0x42,0xe2,0x42,0x42,0x42,0xfc,0x0,0x0 -}; -static const GLUTBitmapChar ch208 = { 8, 13, 0, 2, 8, ch208data }; - -static const unsigned char ch209data[] = { - 0x0,0x0,0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x0,0x28,0x14,0x0 -}; -static const GLUTBitmapChar ch209 = { 8, 13, 0, 2, 8, ch209data }; - -static const unsigned char ch210data[] = { - 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch210 = { 8, 13, 0, 2, 8, ch210data }; - -static const unsigned char ch211data[] = { - 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch211 = { 8, 13, 0, 2, 8, ch211data }; - -static const unsigned char ch212data[] = { - 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch212 = { 8, 13, 0, 2, 8, ch212data }; - -static const unsigned char ch213data[] = { - 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x14,0x0 -}; -static const GLUTBitmapChar ch213 = { 8, 13, 0, 2, 8, ch213data }; - -static const unsigned char ch214data[] = { - 0x0,0x0,0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28,0x0 -}; -static const GLUTBitmapChar ch214 = { 8, 13, 0, 2, 8, ch214data }; - -static const unsigned char ch215data[] = { - 0x0,0x0,0x0,0x42,0x24,0x18,0x18,0x24,0x42,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch215 = { 8, 13, 0, 2, 8, ch215data }; - -static const unsigned char ch216data[] = { - 0x0,0x40,0x3c,0x62,0x52,0x52,0x52,0x4a,0x4a,0x46,0x3c,0x2,0x0 -}; -static const GLUTBitmapChar ch216 = { 8, 13, 0, 2, 8, ch216data }; - -static const unsigned char ch217data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch217 = { 8, 13, 0, 2, 8, ch217data }; - -static const unsigned char ch218data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch218 = { 8, 13, 0, 2, 8, ch218data }; - -static const unsigned char ch219data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch219 = { 8, 13, 0, 2, 8, ch219data }; - -static const unsigned char ch220data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch220 = { 8, 13, 0, 2, 8, ch220data }; - -static const unsigned char ch221data[] = { - 0x0,0x0,0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch221 = { 8, 13, 0, 2, 8, ch221data }; - -static const unsigned char ch222data[] = { - 0x0,0x0,0x40,0x40,0x40,0x7c,0x42,0x42,0x42,0x7c,0x40,0x0,0x0 -}; -static const GLUTBitmapChar ch222 = { 8, 13, 0, 2, 8, ch222data }; - -static const unsigned char ch223data[] = { - 0x0,0x40,0x5c,0x62,0x42,0x42,0x7c,0x42,0x42,0x3c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch223 = { 8, 13, 0, 2, 8, ch223data }; - -static const unsigned char ch224data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch224 = { 8, 13, 0, 2, 8, ch224data }; - -static const unsigned char ch225data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch225 = { 8, 13, 0, 2, 8, ch225data }; - -static const unsigned char ch226data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch226 = { 8, 13, 0, 2, 8, ch226data }; - -static const unsigned char ch227data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x28,0x14,0x0 -}; -static const GLUTBitmapChar ch227 = { 8, 13, 0, 2, 8, ch227data }; - -static const unsigned char ch228data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch228 = { 8, 13, 0, 2, 8, ch228data }; - -static const unsigned char ch229data[] = { - 0x0,0x0,0x3a,0x46,0x42,0x3e,0x2,0x3c,0x0,0x18,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch229 = { 8, 13, 0, 2, 8, ch229data }; - -static const unsigned char ch230data[] = { - 0x0,0x0,0x6c,0x92,0x90,0x7c,0x12,0x6c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch230 = { 8, 13, 0, 2, 8, ch230data }; - -static const unsigned char ch231data[] = { - 0x10,0x8,0x3c,0x42,0x40,0x40,0x42,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch231 = { 8, 13, 0, 2, 8, ch231data }; - -static const unsigned char ch232data[] = { - 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch232 = { 8, 13, 0, 2, 8, ch232data }; - -static const unsigned char ch233data[] = { - 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch233 = { 8, 13, 0, 2, 8, ch233data }; - -static const unsigned char ch234data[] = { - 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch234 = { 8, 13, 0, 2, 8, ch234data }; - -static const unsigned char ch235data[] = { - 0x0,0x0,0x3c,0x42,0x40,0x7e,0x42,0x3c,0x0,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch235 = { 8, 13, 0, 2, 8, ch235data }; - -static const unsigned char ch236data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x10,0x20,0x0 -}; -static const GLUTBitmapChar ch236 = { 8, 13, 0, 2, 8, ch236data }; - -static const unsigned char ch237data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x20,0x10,0x0 -}; -static const GLUTBitmapChar ch237 = { 8, 13, 0, 2, 8, ch237data }; - -static const unsigned char ch238data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x48,0x30,0x0 -}; -static const GLUTBitmapChar ch238 = { 8, 13, 0, 2, 8, ch238data }; - -static const unsigned char ch239data[] = { - 0x0,0x0,0x7c,0x10,0x10,0x10,0x10,0x30,0x0,0x0,0x28,0x28,0x0 -}; -static const GLUTBitmapChar ch239 = { 8, 13, 0, 2, 8, ch239data }; - -static const unsigned char ch240data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x4,0x28,0x18,0x24,0x0 -}; -static const GLUTBitmapChar ch240 = { 8, 13, 0, 2, 8, ch240data }; - -static const unsigned char ch241data[] = { - 0x0,0x0,0x42,0x42,0x42,0x42,0x62,0x5c,0x0,0x0,0x28,0x14,0x0 -}; -static const GLUTBitmapChar ch241 = { 8, 13, 0, 2, 8, ch241data }; - -static const unsigned char ch242data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch242 = { 8, 13, 0, 2, 8, ch242data }; - -static const unsigned char ch243data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch243 = { 8, 13, 0, 2, 8, ch243data }; - -static const unsigned char ch244data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch244 = { 8, 13, 0, 2, 8, ch244data }; - -static const unsigned char ch245data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x28,0x14,0x0 -}; -static const GLUTBitmapChar ch245 = { 8, 13, 0, 2, 8, ch245data }; - -static const unsigned char ch246data[] = { - 0x0,0x0,0x3c,0x42,0x42,0x42,0x42,0x3c,0x0,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch246 = { 8, 13, 0, 2, 8, ch246data }; - -static const unsigned char ch247data[] = { - 0x0,0x0,0x0,0x10,0x10,0x0,0x7c,0x0,0x10,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch247 = { 8, 13, 0, 2, 8, ch247data }; - -static const unsigned char ch248data[] = { - 0x0,0x40,0x3c,0x62,0x52,0x4a,0x46,0x3c,0x2,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch248 = { 8, 13, 0, 2, 8, ch248data }; - -static const unsigned char ch249data[] = { - 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x8,0x10,0x0 -}; -static const GLUTBitmapChar ch249 = { 8, 13, 0, 2, 8, ch249data }; - -static const unsigned char ch250data[] = { - 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch250 = { 8, 13, 0, 2, 8, ch250data }; - -static const unsigned char ch251data[] = { - 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x24,0x18,0x0 -}; -static const GLUTBitmapChar ch251 = { 8, 13, 0, 2, 8, ch251data }; - -static const unsigned char ch252data[] = { - 0x0,0x0,0x3a,0x44,0x44,0x44,0x44,0x44,0x0,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch252 = { 8, 13, 0, 2, 8, ch252data }; - -static const unsigned char ch253data[] = { - 0x3c,0x42,0x2,0x3a,0x46,0x42,0x42,0x42,0x0,0x0,0x10,0x8,0x0 -}; -static const GLUTBitmapChar ch253 = { 8, 13, 0, 2, 8, ch253data }; - -static const unsigned char ch254data[] = { - 0x40,0x40,0x5c,0x62,0x42,0x42,0x62,0x5c,0x40,0x40,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch254 = { 8, 13, 0, 2, 8, ch254data }; - -static const unsigned char ch255data[] = { - 0x3c,0x42,0x2,0x3a,0x46,0x42,0x42,0x42,0x0,0x0,0x24,0x24,0x0 -}; -static const GLUTBitmapChar ch255 = { 8, 13, 0, 2, 8, ch255data }; - - -static const GLUTBitmapChar *chars[] = { - &ch0, &ch1, &ch2, &ch3, &ch4, &ch5, &ch6, &ch7, - &ch8, &ch9, &ch10, &ch11, &ch12, &ch13, &ch14, &ch15, - &ch16, &ch17, &ch18, &ch19, &ch20, &ch21, &ch22, &ch23, - &ch24, &ch25, &ch26, &ch27, &ch28, &ch29, &ch30, &ch31, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, &ch127, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, - &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, - &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, - &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, - &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, - &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, - &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, - &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, - &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, - &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, - &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, - &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 -}; - -const GLUTBitmapFont glutBitmap8By13 = { - "-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-80-ISO8859-1", - 13, 256, chars -}; diff --git a/src/glut/dos/f9x15.c b/src/glut/dos/f9x15.c deleted file mode 100644 index 0e7cd6da51..0000000000 --- a/src/glut/dos/f9x15.c +++ /dev/null @@ -1,1407 +0,0 @@ -/* autogenerated by bdf2c! do not edit */ - -/* "Public domain terminal emulator font. Share and enjoy." */ - - -#include "internal.h" -/* -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; -*/ - - -static const unsigned char ch0data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch0 = { 9, 15, 0, 3, 9, ch0data }; - -static const unsigned char ch1data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x1c,0x0,0x3e,0x0,0x7f,0x0,0x3e,0x0, - 0x1c,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch1 = { 9, 15, 0, 3, 9, ch1data }; - -static const unsigned char ch2data[] = { - 0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0, - 0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x55,0x0,0xaa,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch2 = { 9, 15, 0, 3, 9, ch2data }; - -static const unsigned char ch3data[] = { - 0x0,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x1f,0x0,0x0,0x0,0x44,0x0,0x44,0x0, - 0x7c,0x0,0x44,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch3 = { 9, 15, 0, 3, 9, ch3data }; - -static const unsigned char ch4data[] = { - 0x0,0x0,0x8,0x0,0x8,0x0,0xe,0x0,0x8,0x0,0xf,0x0,0x40,0x0,0x40,0x0, - 0x70,0x0,0x40,0x0,0x78,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch4 = { 9, 15, 0, 3, 9, ch4data }; - -static const unsigned char ch5data[] = { - 0x0,0x0,0x11,0x0,0x11,0x0,0x1e,0x0,0x11,0x0,0x1e,0x0,0x0,0x0,0x3c,0x0, - 0x40,0x0,0x40,0x0,0x3c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch5 = { 9, 15, 0, 3, 9, ch5data }; - -static const unsigned char ch6data[] = { - 0x0,0x0,0x10,0x0,0x10,0x0,0x1e,0x0,0x10,0x0,0x1f,0x0,0x0,0x0,0x7c,0x0, - 0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch6 = { 9, 15, 0, 3, 9, ch6data }; - -static const unsigned char ch7data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch7 = { 9, 15, 0, 3, 9, ch7data }; - -static const unsigned char ch8data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x8,0x0,0x8,0x0,0x7f,0x0,0x8,0x0, - 0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch8 = { 9, 15, 0, 3, 9, ch8data }; - -static const unsigned char ch9data[] = { - 0x0,0x0,0x1f,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x44,0x0,0x4c,0x0, - 0x54,0x0,0x64,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch9 = { 9, 15, 0, 3, 9, ch9data }; - -static const unsigned char ch10data[] = { - 0x0,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x1f,0x0,0x0,0x0,0x10,0x0, - 0x28,0x0,0x44,0x0,0x44,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch10 = { 9, 15, 0, 3, 9, ch10data }; - -static const unsigned char ch11data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch11 = { 9, 15, 0, 3, 9, ch11data }; - -static const unsigned char ch12data[] = { - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf8,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch12 = { 9, 15, 0, 3, 9, ch12data }; - -static const unsigned char ch13data[] = { - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf,0x80,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch13 = { 9, 15, 0, 3, 9, ch13data }; - -static const unsigned char ch14data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0x80,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch14 = { 9, 15, 0, 3, 9, ch14data }; - -static const unsigned char ch15data[] = { - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch15 = { 9, 15, 0, 3, 9, ch15data }; - -static const unsigned char ch16data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch16 = { 9, 15, 0, 3, 9, ch16data }; - -static const unsigned char ch17data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch17 = { 9, 15, 0, 3, 9, ch17data }; - -static const unsigned char ch18data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch18 = { 9, 15, 0, 3, 9, ch18data }; - -static const unsigned char ch19data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch19 = { 9, 15, 0, 3, 9, ch19data }; - -static const unsigned char ch20data[] = { - 0x0,0x0,0x0,0x0,0xff,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch20 = { 9, 15, 0, 3, 9, ch20data }; - -static const unsigned char ch21data[] = { - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf,0x80,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch21 = { 9, 15, 0, 3, 9, ch21data }; - -static const unsigned char ch22data[] = { - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xf8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch22 = { 9, 15, 0, 3, 9, ch22data }; - -static const unsigned char ch23data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0x80,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch23 = { 9, 15, 0, 3, 9, ch23data }; - -static const unsigned char ch24data[] = { - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch24 = { 9, 15, 0, 3, 9, ch24data }; - -static const unsigned char ch25data[] = { - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch25 = { 9, 15, 0, 3, 9, ch25data }; - -static const unsigned char ch26data[] = { - 0x0,0x0,0x3f,0x0,0x0,0x0,0x1,0x0,0x2,0x0,0x4,0x0,0x8,0x0,0x10,0x0, - 0x10,0x0,0x8,0x0,0x4,0x0,0x2,0x0,0x1,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch26 = { 9, 15, 0, 3, 9, ch26data }; - -static const unsigned char ch27data[] = { - 0x0,0x0,0x7f,0x0,0x0,0x0,0x40,0x0,0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0, - 0x4,0x0,0x8,0x0,0x10,0x0,0x20,0x0,0x40,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch27 = { 9, 15, 0, 3, 9, ch27data }; - -static const unsigned char ch28data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x12,0x0,0x12,0x0,0x12,0x0,0x12,0x0, - 0x12,0x0,0x7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch28 = { 9, 15, 0, 3, 9, ch28data }; - -static const unsigned char ch29data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x20,0x0,0x7f,0x0,0x8,0x0,0x7f,0x0, - 0x2,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch29 = { 9, 15, 0, 3, 9, ch29data }; - -static const unsigned char ch30data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x2e,0x0,0x51,0x0,0x30,0x0,0x10,0x0,0x10,0x0, - 0x7c,0x0,0x10,0x0,0x10,0x0,0x11,0x0,0xe,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch30 = { 9, 15, 0, 3, 9, ch30data }; - -static const unsigned char ch31data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0xc,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch31 = { 9, 15, 0, 3, 9, ch31data }; - -static const unsigned char ch32data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch32 = { 9, 15, 0, 3, 9, ch32data }; - -static const unsigned char ch33data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch33 = { 9, 15, 0, 3, 9, ch33data }; - -static const unsigned char ch34data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x12,0x0,0x12,0x0,0x12,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch34 = { 9, 15, 0, 3, 9, ch34data }; - -static const unsigned char ch35data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x24,0x0,0x24,0x0,0x7e,0x0,0x24,0x0, - 0x24,0x0,0x7e,0x0,0x24,0x0,0x24,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch35 = { 9, 15, 0, 3, 9, ch35data }; - -static const unsigned char ch36data[] = { - 0x0,0x0,0x0,0x0,0x8,0x0,0x3e,0x0,0x49,0x0,0x9,0x0,0x9,0x0,0xa,0x0, - 0x1c,0x0,0x28,0x0,0x48,0x0,0x49,0x0,0x3e,0x0,0x8,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch36 = { 9, 15, 0, 3, 9, ch36data }; - -static const unsigned char ch37data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x42,0x0,0x25,0x0,0x25,0x0,0x12,0x0,0x8,0x0, - 0x8,0x0,0x24,0x0,0x52,0x0,0x52,0x0,0x21,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch37 = { 9, 15, 0, 3, 9, ch37data }; - -static const unsigned char ch38data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x31,0x0,0x4a,0x0,0x44,0x0,0x4a,0x0,0x31,0x0, - 0x30,0x0,0x48,0x0,0x48,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch38 = { 9, 15, 0, 3, 9, ch38data }; - -static const unsigned char ch39data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x10,0x0,0x8,0x0,0x4,0x0,0x6,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch39 = { 9, 15, 0, 3, 9, ch39data }; - -static const unsigned char ch40data[] = { - 0x0,0x0,0x0,0x0,0x4,0x0,0x8,0x0,0x8,0x0,0x10,0x0,0x10,0x0,0x10,0x0, - 0x10,0x0,0x10,0x0,0x10,0x0,0x8,0x0,0x8,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch40 = { 9, 15, 0, 3, 9, ch40data }; - -static const unsigned char ch41data[] = { - 0x0,0x0,0x0,0x0,0x10,0x0,0x8,0x0,0x8,0x0,0x4,0x0,0x4,0x0,0x4,0x0, - 0x4,0x0,0x4,0x0,0x4,0x0,0x8,0x0,0x8,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch41 = { 9, 15, 0, 3, 9, ch41data }; - -static const unsigned char ch42data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x49,0x0,0x2a,0x0,0x1c,0x0, - 0x2a,0x0,0x49,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch42 = { 9, 15, 0, 3, 9, ch42data }; - -static const unsigned char ch43data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x7f,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch43 = { 9, 15, 0, 3, 9, ch43data }; - -static const unsigned char ch44data[] = { - 0x8,0x0,0x4,0x0,0x4,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch44 = { 9, 15, 0, 3, 9, ch44data }; - -static const unsigned char ch45data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch45 = { 9, 15, 0, 3, 9, ch45data }; - -static const unsigned char ch46data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch46 = { 9, 15, 0, 3, 9, ch46data }; - -static const unsigned char ch47data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x20,0x0,0x20,0x0,0x10,0x0,0x8,0x0, - 0x8,0x0,0x4,0x0,0x2,0x0,0x2,0x0,0x1,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch47 = { 9, 15, 0, 3, 9, ch47data }; - -static const unsigned char ch48data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch48 = { 9, 15, 0, 3, 9, ch48data }; - -static const unsigned char ch49data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x48,0x0,0x28,0x0,0x18,0x0,0x8,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch49 = { 9, 15, 0, 3, 9, ch49data }; - -static const unsigned char ch50data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x40,0x0,0x20,0x0,0x18,0x0,0x4,0x0, - 0x2,0x0,0x1,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch50 = { 9, 15, 0, 3, 9, ch50data }; - -static const unsigned char ch51data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x1,0x0,0x1,0x0,0x1,0x0, - 0xe,0x0,0x4,0x0,0x2,0x0,0x1,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch51 = { 9, 15, 0, 3, 9, ch51data }; - -static const unsigned char ch52data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x2,0x0,0x2,0x0,0x7f,0x0,0x42,0x0, - 0x22,0x0,0x12,0x0,0xa,0x0,0x6,0x0,0x2,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch52 = { 9, 15, 0, 3, 9, ch52data }; - -static const unsigned char ch53data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x1,0x0,0x1,0x0,0x1,0x0, - 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch53 = { 9, 15, 0, 3, 9, ch53data }; - -static const unsigned char ch54data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x61,0x0, - 0x5e,0x0,0x40,0x0,0x40,0x0,0x20,0x0,0x1e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch54 = { 9, 15, 0, 3, 9, ch54data }; - -static const unsigned char ch55data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x10,0x0,0x10,0x0,0x8,0x0, - 0x4,0x0,0x2,0x0,0x1,0x0,0x1,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch55 = { 9, 15, 0, 3, 9, ch55data }; - -static const unsigned char ch56data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x22,0x0, - 0x1c,0x0,0x22,0x0,0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch56 = { 9, 15, 0, 3, 9, ch56data }; - -static const unsigned char ch57data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x2,0x0,0x1,0x0,0x1,0x0,0x3d,0x0, - 0x43,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch57 = { 9, 15, 0, 3, 9, ch57data }; - -static const unsigned char ch58data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch58 = { 9, 15, 0, 3, 9, ch58data }; - -static const unsigned char ch59data[] = { - 0x8,0x0,0x4,0x0,0x4,0x0,0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0xc,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch59 = { 9, 15, 0, 3, 9, ch59data }; - -static const unsigned char ch60data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x4,0x0,0x8,0x0,0x10,0x0,0x20,0x0, - 0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0,0x2,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch60 = { 9, 15, 0, 3, 9, ch60data }; - -static const unsigned char ch61data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x0,0x0,0x0,0x0, - 0x7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch61 = { 9, 15, 0, 3, 9, ch61data }; - -static const unsigned char ch62data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0,0x2,0x0, - 0x2,0x0,0x4,0x0,0x8,0x0,0x10,0x0,0x20,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch62 = { 9, 15, 0, 3, 9, ch62data }; - -static const unsigned char ch63data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x4,0x0, - 0x2,0x0,0x1,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch63 = { 9, 15, 0, 3, 9, ch63data }; - -static const unsigned char ch64data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x4d,0x0,0x53,0x0, - 0x51,0x0,0x4f,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch64 = { 9, 15, 0, 3, 9, ch64data }; - -static const unsigned char ch65data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch65 = { 9, 15, 0, 3, 9, ch65data }; - -static const unsigned char ch66data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0, - 0x3e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch66 = { 9, 15, 0, 3, 9, ch66data }; - -static const unsigned char ch67data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, - 0x40,0x0,0x40,0x0,0x40,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch67 = { 9, 15, 0, 3, 9, ch67data }; - -static const unsigned char ch68data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0, - 0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch68 = { 9, 15, 0, 3, 9, ch68data }; - -static const unsigned char ch69data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0, - 0x3c,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch69 = { 9, 15, 0, 3, 9, ch69data }; - -static const unsigned char ch70data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0, - 0x3c,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch70 = { 9, 15, 0, 3, 9, ch70data }; - -static const unsigned char ch71data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x47,0x0, - 0x40,0x0,0x40,0x0,0x40,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch71 = { 9, 15, 0, 3, 9, ch71data }; - -static const unsigned char ch72data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x7f,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch72 = { 9, 15, 0, 3, 9, ch72data }; - -static const unsigned char ch73data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch73 = { 9, 15, 0, 3, 9, ch73data }; - -static const unsigned char ch74data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x42,0x0,0x2,0x0,0x2,0x0,0x2,0x0, - 0x2,0x0,0x2,0x0,0x2,0x0,0x2,0x0,0xf,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch74 = { 9, 15, 0, 3, 9, ch74data }; - -static const unsigned char ch75data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x42,0x0,0x44,0x0,0x48,0x0,0x50,0x0, - 0x70,0x0,0x48,0x0,0x44,0x0,0x42,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch75 = { 9, 15, 0, 3, 9, ch75data }; - -static const unsigned char ch76data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0, - 0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch76 = { 9, 15, 0, 3, 9, ch76data }; - -static const unsigned char ch77data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x49,0x0,0x49,0x0, - 0x55,0x0,0x55,0x0,0x63,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch77 = { 9, 15, 0, 3, 9, ch77data }; - -static const unsigned char ch78data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x43,0x0,0x45,0x0, - 0x49,0x0,0x51,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch78 = { 9, 15, 0, 3, 9, ch78data }; - -static const unsigned char ch79data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch79 = { 9, 15, 0, 3, 9, ch79data }; - -static const unsigned char ch80data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x40,0x0, - 0x7e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch80 = { 9, 15, 0, 3, 9, ch80data }; - -static const unsigned char ch81data[] = { - 0x0,0x0,0x3,0x0,0x4,0x0,0x3e,0x0,0x49,0x0,0x51,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch81 = { 9, 15, 0, 3, 9, ch81data }; - -static const unsigned char ch82data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x42,0x0,0x44,0x0,0x48,0x0, - 0x7e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch82 = { 9, 15, 0, 3, 9, ch82data }; - -static const unsigned char ch83data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x1,0x0,0x6,0x0, - 0x38,0x0,0x40,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch83 = { 9, 15, 0, 3, 9, ch83data }; - -static const unsigned char ch84data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch84 = { 9, 15, 0, 3, 9, ch84data }; - -static const unsigned char ch85data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch85 = { 9, 15, 0, 3, 9, ch85data }; - -static const unsigned char ch86data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x14,0x0,0x14,0x0,0x14,0x0,0x22,0x0, - 0x22,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch86 = { 9, 15, 0, 3, 9, ch86data }; - -static const unsigned char ch87data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x49,0x0, - 0x49,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch87 = { 9, 15, 0, 3, 9, ch87data }; - -static const unsigned char ch88data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0, - 0x8,0x0,0x14,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch88 = { 9, 15, 0, 3, 9, ch88data }; - -static const unsigned char ch89data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x14,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch89 = { 9, 15, 0, 3, 9, ch89data }; - -static const unsigned char ch90data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x40,0x0,0x40,0x0,0x20,0x0,0x10,0x0, - 0x8,0x0,0x4,0x0,0x2,0x0,0x1,0x0,0x7f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch90 = { 9, 15, 0, 3, 9, ch90data }; - -static const unsigned char ch91data[] = { - 0x0,0x0,0x0,0x0,0x1e,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0, - 0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x1e,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch91 = { 9, 15, 0, 3, 9, ch91data }; - -static const unsigned char ch92data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x2,0x0,0x2,0x0,0x4,0x0,0x8,0x0, - 0x8,0x0,0x10,0x0,0x20,0x0,0x20,0x0,0x40,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch92 = { 9, 15, 0, 3, 9, ch92data }; - -static const unsigned char ch93data[] = { - 0x0,0x0,0x0,0x0,0x3c,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0, - 0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x4,0x0,0x3c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch93 = { 9, 15, 0, 3, 9, ch93data }; - -static const unsigned char ch94data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch94 = { 9, 15, 0, 3, 9, ch94data }; - -static const unsigned char ch95data[] = { - 0x0,0x0,0x0,0x0,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch95 = { 9, 15, 0, 3, 9, ch95data }; - -static const unsigned char ch96data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x2,0x0,0x4,0x0,0x8,0x0,0x18,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch96 = { 9, 15, 0, 3, 9, ch96data }; - -static const unsigned char ch97data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, - 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch97 = { 9, 15, 0, 3, 9, ch97data }; - -static const unsigned char ch98data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch98 = { 9, 15, 0, 3, 9, ch98data }; - -static const unsigned char ch99data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch99 = { 9, 15, 0, 3, 9, ch99data }; - -static const unsigned char ch100data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x43,0x0,0x3d,0x0,0x1,0x0,0x1,0x0,0x1,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch100 = { 9, 15, 0, 3, 9, ch100data }; - -static const unsigned char ch101data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch101 = { 9, 15, 0, 3, 9, ch101data }; - -static const unsigned char ch102data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x10,0x0,0x7c,0x0, - 0x10,0x0,0x10,0x0,0x11,0x0,0x11,0x0,0xe,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch102 = { 9, 15, 0, 3, 9, ch102data }; - -static const unsigned char ch103data[] = { - 0x3e,0x0,0x41,0x0,0x41,0x0,0x3e,0x0,0x40,0x0,0x3c,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x3d,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch103 = { 9, 15, 0, 3, 9, ch103data }; - -static const unsigned char ch104data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch104 = { 9, 15, 0, 3, 9, ch104data }; - -static const unsigned char ch105data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch105 = { 9, 15, 0, 3, 9, ch105data }; - -static const unsigned char ch106data[] = { - 0x3c,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x2,0x0,0x2,0x0,0x2,0x0,0x2,0x0, - 0x2,0x0,0xe,0x0,0x0,0x0,0x0,0x0,0x6,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch106 = { 9, 15, 0, 3, 9, ch106data }; - -static const unsigned char ch107data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x46,0x0,0x58,0x0,0x60,0x0,0x58,0x0, - 0x46,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch107 = { 9, 15, 0, 3, 9, ch107data }; - -static const unsigned char ch108data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch108 = { 9, 15, 0, 3, 9, ch108data }; - -static const unsigned char ch109data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x49,0x0,0x49,0x0,0x49,0x0,0x49,0x0, - 0x49,0x0,0x76,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch109 = { 9, 15, 0, 3, 9, ch109data }; - -static const unsigned char ch110data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x61,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch110 = { 9, 15, 0, 3, 9, ch110data }; - -static const unsigned char ch111data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch111 = { 9, 15, 0, 3, 9, ch111data }; - -static const unsigned char ch112data[] = { - 0x40,0x0,0x40,0x0,0x40,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x61,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch112 = { 9, 15, 0, 3, 9, ch112data }; - -static const unsigned char ch113data[] = { - 0x1,0x0,0x1,0x0,0x1,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x43,0x0,0x3d,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch113 = { 9, 15, 0, 3, 9, ch113data }; - -static const unsigned char ch114data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x21,0x0, - 0x31,0x0,0x4e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch114 = { 9, 15, 0, 3, 9, ch114data }; - -static const unsigned char ch115data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x1,0x0,0x3e,0x0,0x40,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch115 = { 9, 15, 0, 3, 9, ch115data }; - -static const unsigned char ch116data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0xe,0x0,0x11,0x0,0x10,0x0,0x10,0x0,0x10,0x0, - 0x10,0x0,0x7e,0x0,0x10,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch116 = { 9, 15, 0, 3, 9, ch116data }; - -static const unsigned char ch117data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch117 = { 9, 15, 0, 3, 9, ch117data }; - -static const unsigned char ch118data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x14,0x0,0x14,0x0,0x22,0x0,0x22,0x0, - 0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch118 = { 9, 15, 0, 3, 9, ch118data }; - -static const unsigned char ch119data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x49,0x0, - 0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch119 = { 9, 15, 0, 3, 9, ch119data }; - -static const unsigned char ch120data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0,0x14,0x0, - 0x22,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch120 = { 9, 15, 0, 3, 9, ch120data }; - -static const unsigned char ch121data[] = { - 0x3c,0x0,0x42,0x0,0x2,0x0,0x3a,0x0,0x46,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch121 = { 9, 15, 0, 3, 9, ch121data }; - -static const unsigned char ch122data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x10,0x0,0x8,0x0,0x4,0x0, - 0x2,0x0,0x7f,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch122 = { 9, 15, 0, 3, 9, ch122data }; - -static const unsigned char ch123data[] = { - 0x0,0x0,0x0,0x0,0x7,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x4,0x0,0x18,0x0, - 0x18,0x0,0x4,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x7,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch123 = { 9, 15, 0, 3, 9, ch123data }; - -static const unsigned char ch124data[] = { - 0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch124 = { 9, 15, 0, 3, 9, ch124data }; - -static const unsigned char ch125data[] = { - 0x0,0x0,0x0,0x0,0x70,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x10,0x0,0xc,0x0, - 0xc,0x0,0x10,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x70,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch125 = { 9, 15, 0, 3, 9, ch125data }; - -static const unsigned char ch126data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x46,0x0,0x49,0x0,0x31,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch126 = { 9, 15, 0, 3, 9, ch126data }; - -static const unsigned char ch127data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch127 = { 9, 15, 0, 3, 9, ch127data }; - -static const unsigned char ch160data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch160 = { 9, 15, 0, 3, 9, ch160data }; - -static const unsigned char ch161data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch161 = { 9, 15, 0, 3, 9, ch161data }; - -static const unsigned char ch162data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x3c,0x0,0x52,0x0,0x50,0x0,0x48,0x0, - 0x4a,0x0,0x3c,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch162 = { 9, 15, 0, 3, 9, ch162data }; - -static const unsigned char ch163data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x2e,0x0,0x51,0x0,0x30,0x0,0x10,0x0,0x10,0x0, - 0x7c,0x0,0x10,0x0,0x10,0x0,0x11,0x0,0xe,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch163 = { 9, 15, 0, 3, 9, ch163data }; - -static const unsigned char ch164data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x3e,0x0, - 0x22,0x0,0x22,0x0,0x3e,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch164 = { 9, 15, 0, 3, 9, ch164data }; - -static const unsigned char ch165data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x3e,0x0,0x8,0x0, - 0x3e,0x0,0x14,0x0,0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch165 = { 9, 15, 0, 3, 9, ch165data }; - -static const unsigned char ch166data[] = { - 0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0, - 0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch166 = { 9, 15, 0, 3, 9, ch166data }; - -static const unsigned char ch167data[] = { - 0x0,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x2,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, - 0x22,0x0,0x1c,0x0,0x20,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch167 = { 9, 15, 0, 3, 9, ch167data }; - -static const unsigned char ch168data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch168 = { 9, 15, 0, 3, 9, ch168data }; - -static const unsigned char ch169data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x42,0x0,0x99,0x0,0xa5,0x0, - 0xa1,0x0,0xa5,0x0,0x99,0x0,0x42,0x0,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch169 = { 9, 15, 0, 3, 9, ch169data }; - -static const unsigned char ch170data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1f,0x0,0x0,0x0, - 0xf,0x0,0x12,0x0,0xe,0x0,0x12,0x0,0xc,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch170 = { 9, 15, 0, 3, 9, ch170data }; - -static const unsigned char ch171data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9,0x0,0x12,0x0,0x24,0x0,0x48,0x0, - 0x48,0x0,0x24,0x0,0x12,0x0,0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch171 = { 9, 15, 0, 3, 9, ch171data }; - -static const unsigned char ch172data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x2,0x0,0x2,0x0, - 0x7e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch172 = { 9, 15, 0, 3, 9, ch172data }; - -static const unsigned char ch173data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch173 = { 9, 15, 0, 3, 9, ch173data }; - -static const unsigned char ch174data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3c,0x0,0x42,0x0,0xa5,0x0,0xa9,0x0, - 0xbd,0x0,0xa5,0x0,0xb9,0x0,0x42,0x0,0x3c,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch174 = { 9, 15, 0, 3, 9, ch174data }; - -static const unsigned char ch175data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch175 = { 9, 15, 0, 3, 9, ch175data }; - -static const unsigned char ch176data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0xc,0x0,0x12,0x0,0x12,0x0,0xc,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch176 = { 9, 15, 0, 3, 9, ch176data }; - -static const unsigned char ch177data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x0,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x7f,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch177 = { 9, 15, 0, 3, 9, ch177data }; - -static const unsigned char ch178data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x78,0x0, - 0x40,0x0,0x30,0x0,0x8,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch178 = { 9, 15, 0, 3, 9, ch178data }; - -static const unsigned char ch179data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x30,0x0, - 0x48,0x0,0x8,0x0,0x10,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch179 = { 9, 15, 0, 3, 9, ch179data }; - -static const unsigned char ch180data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch180 = { 9, 15, 0, 3, 9, ch180data }; - -static const unsigned char ch181data[] = { - 0x0,0x0,0x40,0x0,0x40,0x0,0x5d,0x0,0x63,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch181 = { 9, 15, 0, 3, 9, ch181data }; - -static const unsigned char ch182data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x5,0x0,0x5,0x0,0x5,0x0,0x5,0x0,0x5,0x0, - 0x3d,0x0,0x45,0x0,0x45,0x0,0x45,0x0,0x3f,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch182 = { 9, 15, 0, 3, 9, ch182data }; - -static const unsigned char ch183data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0x0, - 0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch183 = { 9, 15, 0, 3, 9, ch183data }; - -static const unsigned char ch184data[] = { - 0x18,0x0,0x24,0x0,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch184 = { 9, 15, 0, 3, 9, ch184data }; - -static const unsigned char ch185data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x70,0x0, - 0x20,0x0,0x20,0x0,0x20,0x0,0x60,0x0,0x20,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch185 = { 9, 15, 0, 3, 9, ch185data }; - -static const unsigned char ch186data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, - 0x7c,0x0,0x0,0x0,0x38,0x0,0x44,0x0,0x44,0x0,0x38,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch186 = { 9, 15, 0, 3, 9, ch186data }; - -static const unsigned char ch187data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x48,0x0,0x24,0x0,0x12,0x0,0x9,0x0, - 0x9,0x0,0x12,0x0,0x24,0x0,0x48,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch187 = { 9, 15, 0, 3, 9, ch187data }; - -static const unsigned char ch188data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0xd,0x0,0x9,0x0,0x5,0x0,0x73,0x0, - 0x21,0x0,0x20,0x0,0x20,0x0,0x60,0x0,0x20,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch188 = { 9, 15, 0, 3, 9, ch188data }; - -static const unsigned char ch189data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0xf,0x0,0x8,0x0,0x6,0x0,0x1,0x0,0x79,0x0, - 0x26,0x0,0x20,0x0,0x20,0x0,0x60,0x0,0x20,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch189 = { 9, 15, 0, 3, 9, ch189data }; - -static const unsigned char ch190data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x0,0xd,0x0,0x9,0x0,0x5,0x0,0x33,0x0, - 0x49,0x0,0x8,0x0,0x10,0x0,0x48,0x0,0x30,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch190 = { 9, 15, 0, 3, 9, ch190data }; - -static const unsigned char ch191data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x40,0x0,0x20,0x0, - 0x10,0x0,0x8,0x0,0x8,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch191 = { 9, 15, 0, 3, 9, ch191data }; - -static const unsigned char ch192data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch192 = { 9, 15, 0, 3, 9, ch192data }; - -static const unsigned char ch193data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch193 = { 9, 15, 0, 3, 9, ch193data }; - -static const unsigned char ch194data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch194 = { 9, 15, 0, 3, 9, ch194data }; - -static const unsigned char ch195data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch195 = { 9, 15, 0, 3, 9, ch195data }; - -static const unsigned char ch196data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x22,0x0,0x1c,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch196 = { 9, 15, 0, 3, 9, ch196data }; - -static const unsigned char ch197data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x22,0x0,0x1c,0x0,0x8,0x0,0x14,0x0,0x8,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch197 = { 9, 15, 0, 3, 9, ch197data }; - -static const unsigned char ch198data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x4f,0x0,0x48,0x0,0x48,0x0,0x48,0x0,0x7e,0x0, - 0x48,0x0,0x48,0x0,0x48,0x0,0x48,0x0,0x37,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch198 = { 9, 15, 0, 3, 9, ch198data }; - -static const unsigned char ch199data[] = { - 0x18,0x0,0x24,0x0,0xc,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, - 0x40,0x0,0x40,0x0,0x40,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch199 = { 9, 15, 0, 3, 9, ch199data }; - -static const unsigned char ch200data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, - 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch200 = { 9, 15, 0, 3, 9, ch200data }; - -static const unsigned char ch201data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, - 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch201 = { 9, 15, 0, 3, 9, ch201data }; - -static const unsigned char ch202data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, - 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch202 = { 9, 15, 0, 3, 9, ch202data }; - -static const unsigned char ch203data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0x0,0x20,0x0,0x20,0x0,0x20,0x0,0x3c,0x0, - 0x20,0x0,0x20,0x0,0x7f,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch203 = { 9, 15, 0, 3, 9, ch203data }; - -static const unsigned char ch204data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch204 = { 9, 15, 0, 3, 9, ch204data }; - -static const unsigned char ch205data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch205 = { 9, 15, 0, 3, 9, ch205data }; - -static const unsigned char ch206data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch206 = { 9, 15, 0, 3, 9, ch206data }; - -static const unsigned char ch207data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x8,0x0,0x3e,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch207 = { 9, 15, 0, 3, 9, ch207data }; - -static const unsigned char ch208data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x7e,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x21,0x0, - 0x79,0x0,0x21,0x0,0x21,0x0,0x21,0x0,0x7e,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch208 = { 9, 15, 0, 3, 9, ch208data }; - -static const unsigned char ch209data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x43,0x0,0x45,0x0,0x49,0x0,0x49,0x0, - 0x51,0x0,0x61,0x0,0x41,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch209 = { 9, 15, 0, 3, 9, ch209data }; - -static const unsigned char ch210data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch210 = { 9, 15, 0, 3, 9, ch210data }; - -static const unsigned char ch211data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch211 = { 9, 15, 0, 3, 9, ch211data }; - -static const unsigned char ch212data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch212 = { 9, 15, 0, 3, 9, ch212data }; - -static const unsigned char ch213data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch213 = { 9, 15, 0, 3, 9, ch213data }; - -static const unsigned char ch214data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch214 = { 9, 15, 0, 3, 9, ch214data }; - -static const unsigned char ch215data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x22,0x0,0x14,0x0,0x8,0x0, - 0x14,0x0,0x22,0x0,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch215 = { 9, 15, 0, 3, 9, ch215data }; - -static const unsigned char ch216data[] = { - 0x0,0x0,0x0,0x0,0x40,0x0,0x3e,0x0,0x61,0x0,0x51,0x0,0x51,0x0,0x49,0x0, - 0x49,0x0,0x45,0x0,0x45,0x0,0x43,0x0,0x3e,0x0,0x1,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch216 = { 9, 15, 0, 3, 9, ch216data }; - -static const unsigned char ch217data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch217 = { 9, 15, 0, 3, 9, ch217data }; - -static const unsigned char ch218data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch218 = { 9, 15, 0, 3, 9, ch218data }; - -static const unsigned char ch219data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch219 = { 9, 15, 0, 3, 9, ch219data }; - -static const unsigned char ch220data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch220 = { 9, 15, 0, 3, 9, ch220data }; - -static const unsigned char ch221data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x14,0x0, - 0x22,0x0,0x41,0x0,0x41,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch221 = { 9, 15, 0, 3, 9, ch221data }; - -static const unsigned char ch222data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x40,0x0,0x40,0x0,0x7e,0x0,0x41,0x0, - 0x41,0x0,0x41,0x0,0x7e,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch222 = { 9, 15, 0, 3, 9, ch222data }; - -static const unsigned char ch223data[] = { - 0x0,0x0,0x0,0x0,0x40,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x7e,0x0, - 0x41,0x0,0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch223 = { 9, 15, 0, 3, 9, ch223data }; - -static const unsigned char ch224data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, - 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch224 = { 9, 15, 0, 3, 9, ch224data }; - -static const unsigned char ch225data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, - 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch225 = { 9, 15, 0, 3, 9, ch225data }; - -static const unsigned char ch226data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, - 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch226 = { 9, 15, 0, 3, 9, ch226data }; - -static const unsigned char ch227data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, - 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch227 = { 9, 15, 0, 3, 9, ch227data }; - -static const unsigned char ch228data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, - 0x1,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch228 = { 9, 15, 0, 3, 9, ch228data }; - -static const unsigned char ch229data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x43,0x0,0x41,0x0,0x3f,0x0,0x1,0x0, - 0x1,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x12,0x0,0xc,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch229 = { 9, 15, 0, 3, 9, ch229data }; - -static const unsigned char ch230data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x37,0x0,0x49,0x0,0x48,0x0,0x3e,0x0,0x9,0x0, - 0x49,0x0,0x36,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch230 = { 9, 15, 0, 3, 9, ch230data }; - -static const unsigned char ch231data[] = { - 0x18,0x0,0x24,0x0,0xc,0x0,0x3e,0x0,0x41,0x0,0x40,0x0,0x40,0x0,0x40,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch231 = { 9, 15, 0, 3, 9, ch231data }; - -static const unsigned char ch232data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch232 = { 9, 15, 0, 3, 9, ch232data }; - -static const unsigned char ch233data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch233 = { 9, 15, 0, 3, 9, ch233data }; - -static const unsigned char ch234data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch234 = { 9, 15, 0, 3, 9, ch234data }; - -static const unsigned char ch235data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x40,0x0,0x40,0x0,0x7f,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch235 = { 9, 15, 0, 3, 9, ch235data }; - -static const unsigned char ch236data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch236 = { 9, 15, 0, 3, 9, ch236data }; - -static const unsigned char ch237data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch237 = { 9, 15, 0, 3, 9, ch237data }; - -static const unsigned char ch238data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x24,0x0,0x18,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch238 = { 9, 15, 0, 3, 9, ch238data }; - -static const unsigned char ch239data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, - 0x8,0x0,0x38,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch239 = { 9, 15, 0, 3, 9, ch239data }; - -static const unsigned char ch240data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x4,0x0,0x28,0x0,0x18,0x0,0x24,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch240 = { 9, 15, 0, 3, 9, ch240data }; - -static const unsigned char ch241data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x61,0x0,0x5e,0x0,0x0,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch241 = { 9, 15, 0, 3, 9, ch241data }; - -static const unsigned char ch242data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch242 = { 9, 15, 0, 3, 9, ch242data }; - -static const unsigned char ch243data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch243 = { 9, 15, 0, 3, 9, ch243data }; - -static const unsigned char ch244data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch244 = { 9, 15, 0, 3, 9, ch244data }; - -static const unsigned char ch245data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x28,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch245 = { 9, 15, 0, 3, 9, ch245data }; - -static const unsigned char ch246data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3e,0x0,0x41,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x41,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch246 = { 9, 15, 0, 3, 9, ch246data }; - -static const unsigned char ch247data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x8,0x0,0x1c,0x0,0x8,0x0,0x0,0x0,0x7f,0x0, - 0x0,0x0,0x8,0x0,0x1c,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch247 = { 9, 15, 0, 3, 9, ch247data }; - -static const unsigned char ch248data[] = { - 0x0,0x0,0x0,0x0,0x40,0x0,0x3e,0x0,0x51,0x0,0x51,0x0,0x49,0x0,0x45,0x0, - 0x45,0x0,0x3e,0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch248 = { 9, 15, 0, 3, 9, ch248data }; - -static const unsigned char ch249data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0xc,0x0,0x10,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch249 = { 9, 15, 0, 3, 9, ch249data }; - -static const unsigned char ch250data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch250 = { 9, 15, 0, 3, 9, ch250data }; - -static const unsigned char ch251data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x22,0x0,0x1c,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch251 = { 9, 15, 0, 3, 9, ch251data }; - -static const unsigned char ch252data[] = { - 0x0,0x0,0x0,0x0,0x0,0x0,0x3d,0x0,0x42,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch252 = { 9, 15, 0, 3, 9, ch252data }; - -static const unsigned char ch253data[] = { - 0x3c,0x0,0x42,0x0,0x2,0x0,0x3a,0x0,0x46,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x18,0x0,0x4,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch253 = { 9, 15, 0, 3, 9, ch253data }; - -static const unsigned char ch254data[] = { - 0x40,0x0,0x40,0x0,0x40,0x0,0x5e,0x0,0x61,0x0,0x41,0x0,0x41,0x0,0x41,0x0, - 0x61,0x0,0x5e,0x0,0x40,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch254 = { 9, 15, 0, 3, 9, ch254data }; - -static const unsigned char ch255data[] = { - 0x3c,0x0,0x42,0x0,0x2,0x0,0x3a,0x0,0x46,0x0,0x42,0x0,0x42,0x0,0x42,0x0, - 0x42,0x0,0x42,0x0,0x0,0x0,0x0,0x0,0x14,0x0,0x14,0x0,0x0,0x0 -}; -static const GLUTBitmapChar ch255 = { 9, 15, 0, 3, 9, ch255data }; - - -static const GLUTBitmapChar *chars[] = { - &ch0, &ch1, &ch2, &ch3, &ch4, &ch5, &ch6, &ch7, - &ch8, &ch9, &ch10, &ch11, &ch12, &ch13, &ch14, &ch15, - &ch16, &ch17, &ch18, &ch19, &ch20, &ch21, &ch22, &ch23, - &ch24, &ch25, &ch26, &ch27, &ch28, &ch29, &ch30, &ch31, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, &ch127, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, - &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, - &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, - &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, - &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, - &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, - &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, - &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, - &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, - &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, - &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, - &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 -}; - -const GLUTBitmapFont glutBitmap9By15 = { - "-Misc-Fixed-Medium-R-Normal--15-140-75-75-C-90-ISO8859-1", - 15, 256, chars -}; diff --git a/src/glut/dos/hel10.c b/src/glut/dos/hel10.c deleted file mode 100644 index 3d24ffee1c..0000000000 --- a/src/glut/dos/hel10.c +++ /dev/null @@ -1,1019 +0,0 @@ -/* autogenerated by bdf2c! do not edit */ - -/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ - - -#include "internal.h" -/* -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; -*/ - - -static const unsigned char ch32data[] = { - 0x0 -}; -static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 3, ch32data }; - -static const unsigned char ch33data[] = { - 0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch33 = { 1, 8, -1, 0, 3, ch33data }; - -static const unsigned char ch34data[] = { - 0xa0,0xa0 -}; -static const GLUTBitmapChar ch34 = { 3, 2, -1, -6, 4, ch34data }; - -static const unsigned char ch35data[] = { - 0x50,0x50,0xf8,0x28,0x7c,0x28,0x28 -}; -static const GLUTBitmapChar ch35 = { 6, 7, 0, 0, 6, ch35data }; - -static const unsigned char ch36data[] = { - 0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20 -}; -static const GLUTBitmapChar ch36 = { 5, 9, 0, 1, 6, ch36data }; - -static const unsigned char ch37data[] = { - 0x26,0x29,0x16,0x10,0x8,0x68,0x94,0x64 -}; -static const GLUTBitmapChar ch37 = { 8, 8, 0, 0, 9, ch37data }; - -static const unsigned char ch38data[] = { - 0x64,0x98,0x98,0xa4,0x60,0x50,0x50,0x20 -}; -static const GLUTBitmapChar ch38 = { 6, 8, -1, 0, 8, ch38data }; - -static const unsigned char ch39data[] = { - 0x80,0x40,0x40 -}; -static const GLUTBitmapChar ch39 = { 2, 3, -1, -5, 3, ch39data }; - -static const unsigned char ch40data[] = { - 0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x40,0x40,0x20 -}; -static const GLUTBitmapChar ch40 = { 3, 10, 0, 2, 4, ch40data }; - -static const unsigned char ch41data[] = { - 0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,0x80 -}; -static const GLUTBitmapChar ch41 = { 3, 10, -1, 2, 4, ch41data }; - -static const unsigned char ch42data[] = { - 0xa0,0x40,0xa0 -}; -static const GLUTBitmapChar ch42 = { 3, 3, 0, -5, 4, ch42data }; - -static const unsigned char ch43data[] = { - 0x20,0x20,0xf8,0x20,0x20 -}; -static const GLUTBitmapChar ch43 = { 5, 5, 0, -1, 6, ch43data }; - -static const unsigned char ch44data[] = { - 0x80,0x40,0x40 -}; -static const GLUTBitmapChar ch44 = { 2, 3, 0, 2, 3, ch44data }; - -static const unsigned char ch45data[] = { - 0xf8 -}; -static const GLUTBitmapChar ch45 = { 5, 1, -1, -3, 7, ch45data }; - -static const unsigned char ch46data[] = { - 0x80 -}; -static const GLUTBitmapChar ch46 = { 1, 1, -1, 0, 3, ch46data }; - -static const unsigned char ch47data[] = { - 0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20 -}; -static const GLUTBitmapChar ch47 = { 3, 8, 0, 0, 3, ch47data }; - -static const unsigned char ch48data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch48 = { 5, 8, 0, 0, 6, ch48data }; - -static const unsigned char ch49data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x40 -}; -static const GLUTBitmapChar ch49 = { 2, 8, -1, 0, 6, ch49data }; - -static const unsigned char ch50data[] = { - 0xf8,0x80,0x40,0x30,0x8,0x8,0x88,0x70 -}; -static const GLUTBitmapChar ch50 = { 5, 8, 0, 0, 6, ch50data }; - -static const unsigned char ch51data[] = { - 0x70,0x88,0x8,0x8,0x30,0x8,0x88,0x70 -}; -static const GLUTBitmapChar ch51 = { 5, 8, 0, 0, 6, ch51data }; - -static const unsigned char ch52data[] = { - 0x10,0x10,0xf8,0x90,0x50,0x50,0x30,0x10 -}; -static const GLUTBitmapChar ch52 = { 5, 8, 0, 0, 6, ch52data }; - -static const unsigned char ch53data[] = { - 0x70,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8 -}; -static const GLUTBitmapChar ch53 = { 5, 8, 0, 0, 6, ch53data }; - -static const unsigned char ch54data[] = { - 0x70,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70 -}; -static const GLUTBitmapChar ch54 = { 5, 8, 0, 0, 6, ch54data }; - -static const unsigned char ch55data[] = { - 0x40,0x40,0x20,0x20,0x10,0x10,0x8,0xf8 -}; -static const GLUTBitmapChar ch55 = { 5, 8, 0, 0, 6, ch55data }; - -static const unsigned char ch56data[] = { - 0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch56 = { 5, 8, 0, 0, 6, ch56data }; - -static const unsigned char ch57data[] = { - 0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch57 = { 5, 8, 0, 0, 6, ch57data }; - -static const unsigned char ch58data[] = { - 0x80,0x0,0x0,0x0,0x0,0x80 -}; -static const GLUTBitmapChar ch58 = { 1, 6, -1, 0, 3, ch58data }; - -static const unsigned char ch59data[] = { - 0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40 -}; -static const GLUTBitmapChar ch59 = { 2, 8, 0, 2, 3, ch59data }; - -static const unsigned char ch60data[] = { - 0x20,0x40,0x80,0x40,0x20 -}; -static const GLUTBitmapChar ch60 = { 3, 5, -1, -1, 6, ch60data }; - -static const unsigned char ch61data[] = { - 0xf0,0x0,0xf0 -}; -static const GLUTBitmapChar ch61 = { 4, 3, 0, -2, 5, ch61data }; - -static const unsigned char ch62data[] = { - 0x80,0x40,0x20,0x40,0x80 -}; -static const GLUTBitmapChar ch62 = { 3, 5, -1, -1, 6, ch62data }; - -static const unsigned char ch63data[] = { - 0x40,0x0,0x40,0x40,0x20,0x10,0x90,0x60 -}; -static const GLUTBitmapChar ch63 = { 4, 8, -1, 0, 6, ch63data }; - -static const unsigned char ch64data[] = { - 0x3e,0x0,0x40,0x0,0x9b,0x0,0xa4,0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,0x40, - 0x20,0x80,0x1f,0x0 -}; -static const GLUTBitmapChar ch64 = { 10, 10, 0, 2, 11, ch64data }; - -static const unsigned char ch65data[] = { - 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10 -}; -static const GLUTBitmapChar ch65 = { 7, 8, 0, 0, 7, ch65data }; - -static const unsigned char ch66data[] = { - 0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0 -}; -static const GLUTBitmapChar ch66 = { 5, 8, -1, 0, 7, ch66data }; - -static const unsigned char ch67data[] = { - 0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78 -}; -static const GLUTBitmapChar ch67 = { 6, 8, -1, 0, 8, ch67data }; - -static const unsigned char ch68data[] = { - 0xf0,0x88,0x84,0x84,0x84,0x84,0x88,0xf0 -}; -static const GLUTBitmapChar ch68 = { 6, 8, -1, 0, 8, ch68data }; - -static const unsigned char ch69data[] = { - 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8 -}; -static const GLUTBitmapChar ch69 = { 5, 8, -1, 0, 7, ch69data }; - -static const unsigned char ch70data[] = { - 0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8 -}; -static const GLUTBitmapChar ch70 = { 5, 8, -1, 0, 6, ch70data }; - -static const unsigned char ch71data[] = { - 0x74,0x8c,0x84,0x8c,0x80,0x80,0x84,0x78 -}; -static const GLUTBitmapChar ch71 = { 6, 8, -1, 0, 8, ch71data }; - -static const unsigned char ch72data[] = { - 0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84 -}; -static const GLUTBitmapChar ch72 = { 6, 8, -1, 0, 8, ch72data }; - -static const unsigned char ch73data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch73 = { 1, 8, -1, 0, 3, ch73data }; - -static const unsigned char ch74data[] = { - 0x60,0x90,0x10,0x10,0x10,0x10,0x10,0x10 -}; -static const GLUTBitmapChar ch74 = { 4, 8, 0, 0, 5, ch74data }; - -static const unsigned char ch75data[] = { - 0x88,0x88,0x90,0x90,0xe0,0xa0,0x90,0x88 -}; -static const GLUTBitmapChar ch75 = { 5, 8, -1, 0, 7, ch75data }; - -static const unsigned char ch76data[] = { - 0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch76 = { 4, 8, -1, 0, 6, ch76data }; - -static const unsigned char ch77data[] = { - 0x92,0x92,0x92,0xaa,0xaa,0xc6,0xc6,0x82 -}; -static const GLUTBitmapChar ch77 = { 7, 8, -1, 0, 9, ch77data }; - -static const unsigned char ch78data[] = { - 0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4 -}; -static const GLUTBitmapChar ch78 = { 6, 8, -1, 0, 8, ch78data }; - -static const unsigned char ch79data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78 -}; -static const GLUTBitmapChar ch79 = { 6, 8, -1, 0, 8, ch79data }; - -static const unsigned char ch80data[] = { - 0x80,0x80,0x80,0x80,0xf0,0x88,0x88,0xf0 -}; -static const GLUTBitmapChar ch80 = { 5, 8, -1, 0, 7, ch80data }; - -static const unsigned char ch81data[] = { - 0x2,0x7c,0x8c,0x94,0x84,0x84,0x84,0x84,0x78 -}; -static const GLUTBitmapChar ch81 = { 7, 9, -1, 1, 8, ch81data }; - -static const unsigned char ch82data[] = { - 0x88,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0 -}; -static const GLUTBitmapChar ch82 = { 5, 8, -1, 0, 7, ch82data }; - -static const unsigned char ch83data[] = { - 0x70,0x88,0x88,0x8,0x70,0x80,0x88,0x70 -}; -static const GLUTBitmapChar ch83 = { 5, 8, -1, 0, 7, ch83data }; - -static const unsigned char ch84data[] = { - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8 -}; -static const GLUTBitmapChar ch84 = { 5, 8, 0, 0, 5, ch84data }; - -static const unsigned char ch85data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84 -}; -static const GLUTBitmapChar ch85 = { 6, 8, -1, 0, 8, ch85data }; - -static const unsigned char ch86data[] = { - 0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82 -}; -static const GLUTBitmapChar ch86 = { 7, 8, 0, 0, 7, ch86data }; - -static const unsigned char ch87data[] = { - 0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80 -}; -static const GLUTBitmapChar ch87 = { 9, 8, 0, 0, 9, ch87data }; - -static const unsigned char ch88data[] = { - 0x88,0x88,0x50,0x50,0x20,0x50,0x88,0x88 -}; -static const GLUTBitmapChar ch88 = { 5, 8, -1, 0, 7, ch88data }; - -static const unsigned char ch89data[] = { - 0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82 -}; -static const GLUTBitmapChar ch89 = { 7, 8, 0, 0, 7, ch89data }; - -static const unsigned char ch90data[] = { - 0xf8,0x80,0x40,0x20,0x20,0x10,0x8,0xf8 -}; -static const GLUTBitmapChar ch90 = { 5, 8, -1, 0, 7, ch90data }; - -static const unsigned char ch91data[] = { - 0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 -}; -static const GLUTBitmapChar ch91 = { 2, 10, -1, 2, 3, ch91data }; - -static const unsigned char ch92data[] = { - 0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80 -}; -static const GLUTBitmapChar ch92 = { 3, 8, 0, 0, 3, ch92data }; - -static const unsigned char ch93data[] = { - 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0 -}; -static const GLUTBitmapChar ch93 = { 2, 10, 0, 2, 3, ch93data }; - -static const unsigned char ch94data[] = { - 0x88,0x50,0x50,0x20,0x20 -}; -static const GLUTBitmapChar ch94 = { 5, 5, 0, -3, 6, ch94data }; - -static const unsigned char ch95data[] = { - 0xfc -}; -static const GLUTBitmapChar ch95 = { 6, 1, 0, 2, 6, ch95data }; - -static const unsigned char ch96data[] = { - 0x80,0x80,0x40 -}; -static const GLUTBitmapChar ch96 = { 2, 3, 0, -5, 3, ch96data }; - -static const unsigned char ch97data[] = { - 0x68,0x90,0x90,0x70,0x10,0xe0 -}; -static const GLUTBitmapChar ch97 = { 5, 6, 0, 0, 5, ch97data }; - -static const unsigned char ch98data[] = { - 0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80 -}; -static const GLUTBitmapChar ch98 = { 5, 8, 0, 0, 6, ch98data }; - -static const unsigned char ch99data[] = { - 0x60,0x90,0x80,0x80,0x90,0x60 -}; -static const GLUTBitmapChar ch99 = { 4, 6, 0, 0, 5, ch99data }; - -static const unsigned char ch100data[] = { - 0x68,0x98,0x88,0x88,0x98,0x68,0x8,0x8 -}; -static const GLUTBitmapChar ch100 = { 5, 8, 0, 0, 6, ch100data }; - -static const unsigned char ch101data[] = { - 0x60,0x90,0x80,0xf0,0x90,0x60 -}; -static const GLUTBitmapChar ch101 = { 4, 6, 0, 0, 5, ch101data }; - -static const unsigned char ch102data[] = { - 0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30 -}; -static const GLUTBitmapChar ch102 = { 4, 8, 0, 0, 4, ch102data }; - -static const unsigned char ch103data[] = { - 0x70,0x8,0x68,0x98,0x88,0x88,0x98,0x68 -}; -static const GLUTBitmapChar ch103 = { 5, 8, 0, 2, 6, ch103data }; - -static const unsigned char ch104data[] = { - 0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 -}; -static const GLUTBitmapChar ch104 = { 5, 8, 0, 0, 6, ch104data }; - -static const unsigned char ch105data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 -}; -static const GLUTBitmapChar ch105 = { 1, 8, 0, 0, 2, ch105data }; - -static const unsigned char ch106data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 -}; -static const GLUTBitmapChar ch106 = { 1, 9, 0, 1, 2, ch106data }; - -static const unsigned char ch107data[] = { - 0x90,0x90,0xa0,0xc0,0xa0,0x90,0x80,0x80 -}; -static const GLUTBitmapChar ch107 = { 4, 8, 0, 0, 5, ch107data }; - -static const unsigned char ch108data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch108 = { 1, 8, 0, 0, 2, ch108data }; - -static const unsigned char ch109data[] = { - 0x92,0x92,0x92,0x92,0x92,0xec -}; -static const GLUTBitmapChar ch109 = { 7, 6, 0, 0, 8, ch109data }; - -static const unsigned char ch110data[] = { - 0x88,0x88,0x88,0x88,0xc8,0xb0 -}; -static const GLUTBitmapChar ch110 = { 5, 6, 0, 0, 6, ch110data }; - -static const unsigned char ch111data[] = { - 0x70,0x88,0x88,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch111 = { 5, 6, 0, 0, 6, ch111data }; - -static const unsigned char ch112data[] = { - 0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0 -}; -static const GLUTBitmapChar ch112 = { 5, 8, 0, 2, 6, ch112data }; - -static const unsigned char ch113data[] = { - 0x8,0x8,0x68,0x98,0x88,0x88,0x98,0x68 -}; -static const GLUTBitmapChar ch113 = { 5, 8, 0, 2, 6, ch113data }; - -static const unsigned char ch114data[] = { - 0x80,0x80,0x80,0x80,0xc0,0xa0 -}; -static const GLUTBitmapChar ch114 = { 3, 6, 0, 0, 4, ch114data }; - -static const unsigned char ch115data[] = { - 0x60,0x90,0x10,0x60,0x90,0x60 -}; -static const GLUTBitmapChar ch115 = { 4, 6, 0, 0, 5, ch115data }; - -static const unsigned char ch116data[] = { - 0x60,0x40,0x40,0x40,0x40,0xe0,0x40,0x40 -}; -static const GLUTBitmapChar ch116 = { 3, 8, 0, 0, 4, ch116data }; - -static const unsigned char ch117data[] = { - 0x70,0x90,0x90,0x90,0x90,0x90 -}; -static const GLUTBitmapChar ch117 = { 4, 6, 0, 0, 5, ch117data }; - -static const unsigned char ch118data[] = { - 0x20,0x20,0x50,0x50,0x88,0x88 -}; -static const GLUTBitmapChar ch118 = { 5, 6, 0, 0, 6, ch118data }; - -static const unsigned char ch119data[] = { - 0x28,0x28,0x54,0x54,0x92,0x92 -}; -static const GLUTBitmapChar ch119 = { 7, 6, 0, 0, 8, ch119data }; - -static const unsigned char ch120data[] = { - 0x88,0x88,0x50,0x20,0x50,0x88 -}; -static const GLUTBitmapChar ch120 = { 5, 6, 0, 0, 6, ch120data }; - -static const unsigned char ch121data[] = { - 0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90 -}; -static const GLUTBitmapChar ch121 = { 4, 8, 0, 2, 5, ch121data }; - -static const unsigned char ch122data[] = { - 0xf0,0x80,0x40,0x20,0x10,0xf0 -}; -static const GLUTBitmapChar ch122 = { 4, 6, 0, 0, 5, ch122data }; - -static const unsigned char ch123data[] = { - 0x20,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20 -}; -static const GLUTBitmapChar ch123 = { 3, 10, 0, 2, 3, ch123data }; - -static const unsigned char ch124data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch124 = { 1, 10, -1, 2, 3, ch124data }; - -static const unsigned char ch125data[] = { - 0x80,0x40,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80 -}; -static const GLUTBitmapChar ch125 = { 3, 10, 0, 2, 3, ch125data }; - -static const unsigned char ch126data[] = { - 0x98,0x64 -}; -static const GLUTBitmapChar ch126 = { 6, 2, 0, -3, 7, ch126data }; - -static const unsigned char ch160data[] = { - 0x0 -}; -static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 3, ch160data }; - -static const unsigned char ch161data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 -}; -static const GLUTBitmapChar ch161 = { 1, 8, -1, 2, 3, ch161data }; - -static const unsigned char ch162data[] = { - 0x40,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x10 -}; -static const GLUTBitmapChar ch162 = { 5, 8, 0, 1, 6, ch162data }; - -static const unsigned char ch163data[] = { - 0xb0,0x48,0x40,0x40,0xe0,0x40,0x48,0x30 -}; -static const GLUTBitmapChar ch163 = { 5, 8, 0, 0, 6, ch163data }; - -static const unsigned char ch164data[] = { - 0x90,0x60,0x90,0x90,0x60,0x90 -}; -static const GLUTBitmapChar ch164 = { 4, 6, 0, -1, 5, ch164data }; - -static const unsigned char ch165data[] = { - 0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88 -}; -static const GLUTBitmapChar ch165 = { 5, 8, 0, 0, 6, ch165data }; - -static const unsigned char ch166data[] = { - 0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch166 = { 1, 10, -1, 2, 3, ch166data }; - -static const unsigned char ch167data[] = { - 0x70,0x88,0x18,0x70,0xc8,0x98,0x70,0xc0,0x88,0x70 -}; -static const GLUTBitmapChar ch167 = { 5, 10, 0, 2, 6, ch167data }; - -static const unsigned char ch168data[] = { - 0xa0 -}; -static const GLUTBitmapChar ch168 = { 3, 1, 0, -7, 3, ch168data }; - -static const unsigned char ch169data[] = { - 0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38 -}; -static const GLUTBitmapChar ch169 = { 7, 7, -1, 0, 9, ch169data }; - -static const unsigned char ch170data[] = { - 0xe0,0x0,0xa0,0x20,0xe0 -}; -static const GLUTBitmapChar ch170 = { 3, 5, 0, -3, 4, ch170data }; - -static const unsigned char ch171data[] = { - 0x28,0x50,0xa0,0x50,0x28 -}; -static const GLUTBitmapChar ch171 = { 5, 5, 0, 0, 6, ch171data }; - -static const unsigned char ch172data[] = { - 0x8,0x8,0xf8 -}; -static const GLUTBitmapChar ch172 = { 5, 3, -1, -2, 7, ch172data }; - -static const unsigned char ch173data[] = { - 0xe0 -}; -static const GLUTBitmapChar ch173 = { 3, 1, 0, -3, 4, ch173data }; - -static const unsigned char ch174data[] = { - 0x38,0x44,0xaa,0xb2,0xba,0x44,0x38 -}; -static const GLUTBitmapChar ch174 = { 7, 7, -1, 0, 9, ch174data }; - -static const unsigned char ch175data[] = { - 0xe0 -}; -static const GLUTBitmapChar ch175 = { 3, 1, 0, -7, 3, ch175data }; - -static const unsigned char ch176data[] = { - 0x60,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch176 = { 4, 4, 0, -3, 4, ch176data }; - -static const unsigned char ch177data[] = { - 0xf8,0x0,0x20,0x20,0xf8,0x20,0x20 -}; -static const GLUTBitmapChar ch177 = { 5, 7, 0, 0, 6, ch177data }; - -static const unsigned char ch178data[] = { - 0xe0,0x40,0xa0,0x60 -}; -static const GLUTBitmapChar ch178 = { 3, 4, 0, -3, 3, ch178data }; - -static const unsigned char ch179data[] = { - 0xc0,0x20,0x40,0xe0 -}; -static const GLUTBitmapChar ch179 = { 3, 4, 0, -3, 3, ch179data }; - -static const unsigned char ch180data[] = { - 0x80,0x40 -}; -static const GLUTBitmapChar ch180 = { 2, 2, 0, -6, 3, ch180data }; - -static const unsigned char ch181data[] = { - 0x80,0x80,0xf0,0x90,0x90,0x90,0x90,0x90 -}; -static const GLUTBitmapChar ch181 = { 4, 8, 0, 2, 5, ch181data }; - -static const unsigned char ch182data[] = { - 0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c -}; -static const GLUTBitmapChar ch182 = { 6, 10, 0, 2, 6, ch182data }; - -static const unsigned char ch183data[] = { - 0xc0 -}; -static const GLUTBitmapChar ch183 = { 2, 1, 0, -3, 3, ch183data }; - -static const unsigned char ch184data[] = { - 0xc0,0x40 -}; -static const GLUTBitmapChar ch184 = { 2, 2, 0, 2, 3, ch184data }; - -static const unsigned char ch185data[] = { - 0x40,0x40,0xc0,0x40 -}; -static const GLUTBitmapChar ch185 = { 2, 4, 0, -3, 3, ch185data }; - -static const unsigned char ch186data[] = { - 0xe0,0x0,0xe0,0xa0,0xe0 -}; -static const GLUTBitmapChar ch186 = { 3, 5, 0, -3, 4, ch186data }; - -static const unsigned char ch187data[] = { - 0xa0,0x50,0x28,0x50,0xa0 -}; -static const GLUTBitmapChar ch187 = { 5, 5, 0, 0, 6, ch187data }; - -static const unsigned char ch188data[] = { - 0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0x48,0x0,0x44,0x0,0xc4,0x0,0x42,0x0 -}; -static const GLUTBitmapChar ch188 = { 9, 8, 0, 0, 9, ch188data }; - -static const unsigned char ch189data[] = { - 0x27,0x12,0x15,0xb,0x48,0x44,0xc4,0x42 -}; -static const GLUTBitmapChar ch189 = { 8, 8, 0, 0, 9, ch189data }; - -static const unsigned char ch190data[] = { - 0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0xc8,0x0,0x24,0x0,0x44,0x0,0xe2,0x0 -}; -static const GLUTBitmapChar ch190 = { 9, 8, 0, 0, 9, ch190data }; - -static const unsigned char ch191data[] = { - 0x60,0x90,0x80,0x40,0x20,0x20,0x0,0x20 -}; -static const GLUTBitmapChar ch191 = { 4, 8, -1, 2, 6, ch191data }; - -static const unsigned char ch192data[] = { - 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch192 = { 7, 11, 0, 0, 7, ch192data }; - -static const unsigned char ch193data[] = { - 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch193 = { 7, 11, 0, 0, 7, ch193data }; - -static const unsigned char ch194data[] = { - 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch194 = { 7, 11, 0, 0, 7, ch194data }; - -static const unsigned char ch195data[] = { - 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x14 -}; -static const GLUTBitmapChar ch195 = { 7, 11, 0, 0, 7, ch195data }; - -static const unsigned char ch196data[] = { - 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28 -}; -static const GLUTBitmapChar ch196 = { 7, 10, 0, 0, 7, ch196data }; - -static const unsigned char ch197data[] = { - 0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x10,0x28,0x10 -}; -static const GLUTBitmapChar ch197 = { 7, 11, 0, 0, 7, ch197data }; - -static const unsigned char ch198data[] = { - 0x8f,0x80,0x88,0x0,0x78,0x0,0x48,0x0,0x2f,0x80,0x28,0x0,0x18,0x0,0x1f,0x80 -}; -static const GLUTBitmapChar ch198 = { 9, 8, 0, 0, 10, ch198data }; - -static const unsigned char ch199data[] = { - 0x30,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78 -}; -static const GLUTBitmapChar ch199 = { 6, 10, -1, 2, 8, ch199data }; - -static const unsigned char ch200data[] = { - 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch200 = { 5, 11, -1, 0, 7, ch200data }; - -static const unsigned char ch201data[] = { - 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch201 = { 5, 11, -1, 0, 7, ch201data }; - -static const unsigned char ch202data[] = { - 0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch202 = { 5, 11, -1, 0, 7, ch202data }; - -static const unsigned char ch203data[] = { - 0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x50 -}; -static const GLUTBitmapChar ch203 = { 5, 10, -1, 0, 7, ch203data }; - -static const unsigned char ch204data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch204 = { 2, 11, 0, 0, 3, ch204data }; - -static const unsigned char ch205data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 -}; -static const GLUTBitmapChar ch205 = { 2, 11, -1, 0, 3, ch205data }; - -static const unsigned char ch206data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch206 = { 3, 11, 0, 0, 3, ch206data }; - -static const unsigned char ch207data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 -}; -static const GLUTBitmapChar ch207 = { 3, 10, 0, 0, 3, ch207data }; - -static const unsigned char ch208data[] = { - 0x78,0x44,0x42,0x42,0xf2,0x42,0x44,0x78 -}; -static const GLUTBitmapChar ch208 = { 7, 8, 0, 0, 8, ch208data }; - -static const unsigned char ch209data[] = { - 0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch209 = { 6, 11, -1, 0, 8, ch209data }; - -static const unsigned char ch210data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch210 = { 6, 11, -1, 0, 8, ch210data }; - -static const unsigned char ch211data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch211 = { 6, 11, -1, 0, 8, ch211data }; - -static const unsigned char ch212data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch212 = { 6, 11, -1, 0, 8, ch212data }; - -static const unsigned char ch213data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch213 = { 6, 11, -1, 0, 8, ch213data }; - -static const unsigned char ch214data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x48 -}; -static const GLUTBitmapChar ch214 = { 6, 10, -1, 0, 8, ch214data }; - -static const unsigned char ch215data[] = { - 0x88,0x50,0x20,0x50,0x88 -}; -static const GLUTBitmapChar ch215 = { 5, 5, 0, -1, 6, ch215data }; - -static const unsigned char ch216data[] = { - 0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4 -}; -static const GLUTBitmapChar ch216 = { 6, 10, -1, 1, 8, ch216data }; - -static const unsigned char ch217data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch217 = { 6, 11, -1, 0, 8, ch217data }; - -static const unsigned char ch218data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch218 = { 6, 11, -1, 0, 8, ch218data }; - -static const unsigned char ch219data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch219 = { 6, 11, -1, 0, 8, ch219data }; - -static const unsigned char ch220data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48 -}; -static const GLUTBitmapChar ch220 = { 6, 10, -1, 0, 8, ch220data }; - -static const unsigned char ch221data[] = { - 0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch221 = { 7, 11, 0, 0, 7, ch221data }; - -static const unsigned char ch222data[] = { - 0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,0x80 -}; -static const GLUTBitmapChar ch222 = { 5, 8, -1, 0, 7, ch222data }; - -static const unsigned char ch223data[] = { - 0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch223 = { 4, 8, 0, 0, 5, ch223data }; - -static const unsigned char ch224data[] = { - 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch224 = { 5, 9, 0, 0, 5, ch224data }; - -static const unsigned char ch225data[] = { - 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch225 = { 5, 9, 0, 0, 5, ch225data }; - -static const unsigned char ch226data[] = { - 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch226 = { 5, 9, 0, 0, 5, ch226data }; - -static const unsigned char ch227data[] = { - 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0xa0,0x50 -}; -static const GLUTBitmapChar ch227 = { 5, 9, 0, 0, 5, ch227data }; - -static const unsigned char ch228data[] = { - 0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50 -}; -static const GLUTBitmapChar ch228 = { 5, 8, 0, 0, 5, ch228data }; - -static const unsigned char ch229data[] = { - 0x68,0x90,0x90,0x70,0x10,0xe0,0x20,0x50,0x20 -}; -static const GLUTBitmapChar ch229 = { 5, 9, 0, 0, 5, ch229data }; - -static const unsigned char ch230data[] = { - 0x6c,0x92,0x90,0x7e,0x12,0xec -}; -static const GLUTBitmapChar ch230 = { 7, 6, 0, 0, 8, ch230data }; - -static const unsigned char ch231data[] = { - 0x60,0x20,0x60,0x90,0x80,0x80,0x90,0x60 -}; -static const GLUTBitmapChar ch231 = { 4, 8, 0, 2, 5, ch231data }; - -static const unsigned char ch232data[] = { - 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch232 = { 4, 9, 0, 0, 5, ch232data }; - -static const unsigned char ch233data[] = { - 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch233 = { 4, 9, 0, 0, 5, ch233data }; - -static const unsigned char ch234data[] = { - 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch234 = { 4, 9, 0, 0, 5, ch234data }; - -static const unsigned char ch235data[] = { - 0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50 -}; -static const GLUTBitmapChar ch235 = { 4, 8, 0, 0, 5, ch235data }; - -static const unsigned char ch236data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch236 = { 2, 9, 1, 0, 2, ch236data }; - -static const unsigned char ch237data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 -}; -static const GLUTBitmapChar ch237 = { 2, 9, 0, 0, 2, ch237data }; - -static const unsigned char ch238data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch238 = { 3, 9, 1, 0, 2, ch238data }; - -static const unsigned char ch239data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 -}; -static const GLUTBitmapChar ch239 = { 3, 8, 0, 0, 2, ch239data }; - -static const unsigned char ch240data[] = { - 0x70,0x88,0x88,0x88,0x88,0x78,0x90,0x60,0x50 -}; -static const GLUTBitmapChar ch240 = { 5, 9, 0, 0, 6, ch240data }; - -static const unsigned char ch241data[] = { - 0x90,0x90,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50 -}; -static const GLUTBitmapChar ch241 = { 4, 9, 0, 0, 5, ch241data }; - -static const unsigned char ch242data[] = { - 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch242 = { 5, 9, 0, 0, 6, ch242data }; - -static const unsigned char ch243data[] = { - 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch243 = { 5, 9, 0, 0, 6, ch243data }; - -static const unsigned char ch244data[] = { - 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch244 = { 5, 9, 0, 0, 6, ch244data }; - -static const unsigned char ch245data[] = { - 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch245 = { 5, 9, 0, 0, 6, ch245data }; - -static const unsigned char ch246data[] = { - 0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50 -}; -static const GLUTBitmapChar ch246 = { 5, 8, 0, 0, 6, ch246data }; - -static const unsigned char ch247data[] = { - 0x20,0x0,0xf8,0x0,0x20 -}; -static const GLUTBitmapChar ch247 = { 5, 5, 0, -1, 6, ch247data }; - -static const unsigned char ch248data[] = { - 0x70,0x88,0xc8,0xa8,0x98,0x74 -}; -static const GLUTBitmapChar ch248 = { 6, 6, 0, 0, 6, ch248data }; - -static const unsigned char ch249data[] = { - 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch249 = { 4, 9, 0, 0, 5, ch249data }; - -static const unsigned char ch250data[] = { - 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch250 = { 4, 9, 0, 0, 5, ch250data }; - -static const unsigned char ch251data[] = { - 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch251 = { 4, 9, 0, 0, 5, ch251data }; - -static const unsigned char ch252data[] = { - 0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50 -}; -static const GLUTBitmapChar ch252 = { 4, 8, 0, 0, 5, ch252data }; - -static const unsigned char ch253data[] = { - 0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch253 = { 4, 11, 0, 2, 5, ch253data }; - -static const unsigned char ch254data[] = { - 0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80 -}; -static const GLUTBitmapChar ch254 = { 5, 10, 0, 2, 6, ch254data }; - -static const unsigned char ch255data[] = { - 0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x50 -}; -static const GLUTBitmapChar ch255 = { 4, 10, 0, 2, 5, ch255data }; - - -static const GLUTBitmapChar *chars[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, - &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, - &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, - &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, - &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, - &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, - &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, - &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, - &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, - &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, - &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, - &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 -}; - -const GLUTBitmapFont glutBitmapHelvetica10 = { - "-Adobe-Helvetica-Medium-R-Normal--10-100-75-75-P-56-ISO8859-1", - 13, 256, chars -}; diff --git a/src/glut/dos/hel12.c b/src/glut/dos/hel12.c deleted file mode 100644 index 0fe8b0919b..0000000000 --- a/src/glut/dos/hel12.c +++ /dev/null @@ -1,1029 +0,0 @@ -/* autogenerated by bdf2c! do not edit */ - -/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ - - -#include "internal.h" -/* -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; -*/ - - -static const unsigned char ch32data[] = { - 0x0 -}; -static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 4, ch32data }; - -static const unsigned char ch33data[] = { - 0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch33 = { 1, 9, -1, 0, 3, ch33data }; - -static const unsigned char ch34data[] = { - 0xa0,0xa0,0xa0 -}; -static const GLUTBitmapChar ch34 = { 3, 3, -1, -6, 5, ch34data }; - -static const unsigned char ch35data[] = { - 0x50,0x50,0x50,0xfc,0x28,0xfc,0x28,0x28 -}; -static const GLUTBitmapChar ch35 = { 6, 8, 0, 0, 7, ch35data }; - -static const unsigned char ch36data[] = { - 0x20,0x70,0xa8,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20 -}; -static const GLUTBitmapChar ch36 = { 5, 10, -1, 1, 7, ch36data }; - -static const unsigned char ch37data[] = { - 0x23,0x0,0x14,0x80,0x14,0x80,0x13,0x0,0x8,0x0,0x68,0x0,0x94,0x0,0x94,0x0, - 0x62,0x0 -}; -static const GLUTBitmapChar ch37 = { 9, 9, -1, 0, 11, ch37data }; - -static const unsigned char ch38data[] = { - 0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,0x30 -}; -static const GLUTBitmapChar ch38 = { 7, 9, -1, 0, 9, ch38data }; - -static const unsigned char ch39data[] = { - 0x80,0x40,0xc0 -}; -static const GLUTBitmapChar ch39 = { 2, 3, -1, -6, 3, ch39data }; - -static const unsigned char ch40data[] = { - 0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20 -}; -static const GLUTBitmapChar ch40 = { 3, 12, -1, 3, 4, ch40data }; - -static const unsigned char ch41data[] = { - 0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80 -}; -static const GLUTBitmapChar ch41 = { 3, 12, 0, 3, 4, ch41data }; - -static const unsigned char ch42data[] = { - 0xa0,0x40,0xa0 -}; -static const GLUTBitmapChar ch42 = { 3, 3, -1, -6, 5, ch42data }; - -static const unsigned char ch43data[] = { - 0x20,0x20,0xf8,0x20,0x20 -}; -static const GLUTBitmapChar ch43 = { 5, 5, -1, -1, 7, ch43data }; - -static const unsigned char ch44data[] = { - 0x80,0x40,0x40 -}; -static const GLUTBitmapChar ch44 = { 2, 3, -1, 2, 4, ch44data }; - -static const unsigned char ch45data[] = { - 0xf8 -}; -static const GLUTBitmapChar ch45 = { 5, 1, -1, -3, 8, ch45data }; - -static const unsigned char ch46data[] = { - 0x80 -}; -static const GLUTBitmapChar ch46 = { 1, 1, -1, 0, 3, ch46data }; - -static const unsigned char ch47data[] = { - 0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10 -}; -static const GLUTBitmapChar ch47 = { 4, 9, 0, 0, 4, ch47data }; - -static const unsigned char ch48data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch48 = { 5, 9, -1, 0, 7, ch48data }; - -static const unsigned char ch49data[] = { - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x20 -}; -static const GLUTBitmapChar ch49 = { 3, 9, -1, 0, 7, ch49data }; - -static const unsigned char ch50data[] = { - 0xf8,0x80,0x80,0x40,0x20,0x10,0x8,0x88,0x70 -}; -static const GLUTBitmapChar ch50 = { 5, 9, -1, 0, 7, ch50data }; - -static const unsigned char ch51data[] = { - 0x70,0x88,0x88,0x8,0x8,0x30,0x8,0x88,0x70 -}; -static const GLUTBitmapChar ch51 = { 5, 9, -1, 0, 7, ch51data }; - -static const unsigned char ch52data[] = { - 0x8,0x8,0xfc,0x88,0x48,0x28,0x28,0x18,0x8 -}; -static const GLUTBitmapChar ch52 = { 6, 9, 0, 0, 7, ch52data }; - -static const unsigned char ch53data[] = { - 0x70,0x88,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8 -}; -static const GLUTBitmapChar ch53 = { 5, 9, -1, 0, 7, ch53data }; - -static const unsigned char ch54data[] = { - 0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70 -}; -static const GLUTBitmapChar ch54 = { 5, 9, -1, 0, 7, ch54data }; - -static const unsigned char ch55data[] = { - 0x40,0x40,0x20,0x20,0x20,0x10,0x10,0x8,0xf8 -}; -static const GLUTBitmapChar ch55 = { 5, 9, -1, 0, 7, ch55data }; - -static const unsigned char ch56data[] = { - 0x70,0x88,0x88,0x88,0x88,0x70,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch56 = { 5, 9, -1, 0, 7, ch56data }; - -static const unsigned char ch57data[] = { - 0x70,0x88,0x8,0x8,0x78,0x88,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch57 = { 5, 9, -1, 0, 7, ch57data }; - -static const unsigned char ch58data[] = { - 0x80,0x0,0x0,0x0,0x0,0x80 -}; -static const GLUTBitmapChar ch58 = { 1, 6, -1, 0, 3, ch58data }; - -static const unsigned char ch59data[] = { - 0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40 -}; -static const GLUTBitmapChar ch59 = { 2, 8, 0, 2, 3, ch59data }; - -static const unsigned char ch60data[] = { - 0xc,0x30,0xc0,0x30,0xc -}; -static const GLUTBitmapChar ch60 = { 6, 5, 0, -1, 7, ch60data }; - -static const unsigned char ch61data[] = { - 0xf8,0x0,0xf8 -}; -static const GLUTBitmapChar ch61 = { 5, 3, -1, -2, 7, ch61data }; - -static const unsigned char ch62data[] = { - 0xc0,0x30,0xc,0x30,0xc0 -}; -static const GLUTBitmapChar ch62 = { 6, 5, -1, -1, 7, ch62data }; - -static const unsigned char ch63data[] = { - 0x20,0x0,0x20,0x20,0x10,0x10,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch63 = { 5, 9, -1, 0, 7, ch63data }; - -static const unsigned char ch64data[] = { - 0x3e,0x0,0x40,0x0,0x9b,0x0,0xa6,0x80,0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40, - 0x60,0x80,0x1f,0x0 -}; -static const GLUTBitmapChar ch64 = { 10, 10, -1, 1, 12, ch64data }; - -static const unsigned char ch65data[] = { - 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x28,0x10 -}; -static const GLUTBitmapChar ch65 = { 7, 9, -1, 0, 9, ch65data }; - -static const unsigned char ch66data[] = { - 0xf8,0x84,0x84,0x84,0xf8,0x84,0x84,0x84,0xf8 -}; -static const GLUTBitmapChar ch66 = { 6, 9, -1, 0, 8, ch66data }; - -static const unsigned char ch67data[] = { - 0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c -}; -static const GLUTBitmapChar ch67 = { 7, 9, -1, 0, 9, ch67data }; - -static const unsigned char ch68data[] = { - 0xf8,0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8 -}; -static const GLUTBitmapChar ch68 = { 7, 9, -1, 0, 9, ch68data }; - -static const unsigned char ch69data[] = { - 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc -}; -static const GLUTBitmapChar ch69 = { 6, 9, -1, 0, 8, ch69data }; - -static const unsigned char ch70data[] = { - 0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0xfc -}; -static const GLUTBitmapChar ch70 = { 6, 9, -1, 0, 8, ch70data }; - -static const unsigned char ch71data[] = { - 0x3a,0x46,0x82,0x82,0x8e,0x80,0x80,0x42,0x3c -}; -static const GLUTBitmapChar ch71 = { 7, 9, -1, 0, 9, ch71data }; - -static const unsigned char ch72data[] = { - 0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82 -}; -static const GLUTBitmapChar ch72 = { 7, 9, -1, 0, 9, ch72data }; - -static const unsigned char ch73data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch73 = { 1, 9, -1, 0, 3, ch73data }; - -static const unsigned char ch74data[] = { - 0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x8,0x8 -}; -static const GLUTBitmapChar ch74 = { 5, 9, -1, 0, 7, ch74data }; - -static const unsigned char ch75data[] = { - 0x82,0x84,0x88,0x90,0xe0,0xa0,0x90,0x88,0x84 -}; -static const GLUTBitmapChar ch75 = { 7, 9, -1, 0, 8, ch75data }; - -static const unsigned char ch76data[] = { - 0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch76 = { 5, 9, -1, 0, 7, ch76data }; - -static const unsigned char ch77data[] = { - 0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80, - 0x80,0x80 -}; -static const GLUTBitmapChar ch77 = { 9, 9, -1, 0, 11, ch77data }; - -static const unsigned char ch78data[] = { - 0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82 -}; -static const GLUTBitmapChar ch78 = { 7, 9, -1, 0, 9, ch78data }; - -static const unsigned char ch79data[] = { - 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c -}; -static const GLUTBitmapChar ch79 = { 8, 9, -1, 0, 10, ch79data }; - -static const unsigned char ch80data[] = { - 0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8 -}; -static const GLUTBitmapChar ch80 = { 6, 9, -1, 0, 8, ch80data }; - -static const unsigned char ch81data[] = { - 0x3d,0x42,0x85,0x89,0x81,0x81,0x81,0x42,0x3c -}; -static const GLUTBitmapChar ch81 = { 8, 9, -1, 0, 10, ch81data }; - -static const unsigned char ch82data[] = { - 0x84,0x84,0x84,0x88,0xf8,0x84,0x84,0x84,0xf8 -}; -static const GLUTBitmapChar ch82 = { 6, 9, -1, 0, 8, ch82data }; - -static const unsigned char ch83data[] = { - 0x78,0x84,0x84,0x4,0x18,0x60,0x80,0x84,0x78 -}; -static const GLUTBitmapChar ch83 = { 6, 9, -1, 0, 8, ch83data }; - -static const unsigned char ch84data[] = { - 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe -}; -static const GLUTBitmapChar ch84 = { 7, 9, 0, 0, 7, ch84data }; - -static const unsigned char ch85data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84 -}; -static const GLUTBitmapChar ch85 = { 6, 9, -1, 0, 8, ch85data }; - -static const unsigned char ch86data[] = { - 0x10,0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82 -}; -static const GLUTBitmapChar ch86 = { 7, 9, -1, 0, 9, ch86data }; - -static const unsigned char ch87data[] = { - 0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0x49,0x0,0x88,0x80,0x88,0x80, - 0x88,0x80 -}; -static const GLUTBitmapChar ch87 = { 9, 9, -1, 0, 11, ch87data }; - -static const unsigned char ch88data[] = { - 0x82,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x82 -}; -static const GLUTBitmapChar ch88 = { 7, 9, -1, 0, 9, ch88data }; - -static const unsigned char ch89data[] = { - 0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82 -}; -static const GLUTBitmapChar ch89 = { 7, 9, -1, 0, 9, ch89data }; - -static const unsigned char ch90data[] = { - 0xfe,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe -}; -static const GLUTBitmapChar ch90 = { 7, 9, -1, 0, 9, ch90data }; - -static const unsigned char ch91data[] = { - 0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 -}; -static const GLUTBitmapChar ch91 = { 2, 12, -1, 3, 3, ch91data }; - -static const unsigned char ch92data[] = { - 0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80 -}; -static const GLUTBitmapChar ch92 = { 4, 9, 0, 0, 4, ch92data }; - -static const unsigned char ch93data[] = { - 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0 -}; -static const GLUTBitmapChar ch93 = { 2, 12, 0, 3, 3, ch93data }; - -static const unsigned char ch94data[] = { - 0x88,0x50,0x20 -}; -static const GLUTBitmapChar ch94 = { 5, 3, 0, -5, 6, ch94data }; - -static const unsigned char ch95data[] = { - 0xfe -}; -static const GLUTBitmapChar ch95 = { 7, 1, 0, 2, 7, ch95data }; - -static const unsigned char ch96data[] = { - 0xc0,0x80,0x40 -}; -static const GLUTBitmapChar ch96 = { 2, 3, 0, -6, 3, ch96data }; - -static const unsigned char ch97data[] = { - 0x74,0x88,0x88,0x78,0x8,0x88,0x70 -}; -static const GLUTBitmapChar ch97 = { 6, 7, -1, 0, 7, ch97data }; - -static const unsigned char ch98data[] = { - 0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 -}; -static const GLUTBitmapChar ch98 = { 5, 9, -1, 0, 7, ch98data }; - -static const unsigned char ch99data[] = { - 0x70,0x88,0x80,0x80,0x80,0x88,0x70 -}; -static const GLUTBitmapChar ch99 = { 5, 7, -1, 0, 7, ch99data }; - -static const unsigned char ch100data[] = { - 0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x8,0x8 -}; -static const GLUTBitmapChar ch100 = { 5, 9, -1, 0, 7, ch100data }; - -static const unsigned char ch101data[] = { - 0x70,0x88,0x80,0xf8,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch101 = { 5, 7, -1, 0, 7, ch101data }; - -static const unsigned char ch102data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30 -}; -static const GLUTBitmapChar ch102 = { 4, 9, 0, 0, 3, ch102data }; - -static const unsigned char ch103data[] = { - 0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68 -}; -static const GLUTBitmapChar ch103 = { 5, 10, -1, 3, 7, ch103data }; - -static const unsigned char ch104data[] = { - 0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 -}; -static const GLUTBitmapChar ch104 = { 5, 9, -1, 0, 7, ch104data }; - -static const unsigned char ch105data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 -}; -static const GLUTBitmapChar ch105 = { 1, 9, -1, 0, 3, ch105data }; - -static const unsigned char ch106data[] = { - 0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40 -}; -static const GLUTBitmapChar ch106 = { 2, 12, 0, 3, 3, ch106data }; - -static const unsigned char ch107data[] = { - 0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,0x80 -}; -static const GLUTBitmapChar ch107 = { 5, 9, -1, 0, 6, ch107data }; - -static const unsigned char ch108data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch108 = { 1, 9, -1, 0, 3, ch108data }; - -static const unsigned char ch109data[] = { - 0x92,0x92,0x92,0x92,0x92,0xda,0xa4 -}; -static const GLUTBitmapChar ch109 = { 7, 7, -1, 0, 9, ch109data }; - -static const unsigned char ch110data[] = { - 0x88,0x88,0x88,0x88,0x88,0xc8,0xb0 -}; -static const GLUTBitmapChar ch110 = { 5, 7, -1, 0, 7, ch110data }; - -static const unsigned char ch111data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch111 = { 5, 7, -1, 0, 7, ch111data }; - -static const unsigned char ch112data[] = { - 0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0 -}; -static const GLUTBitmapChar ch112 = { 5, 10, -1, 3, 7, ch112data }; - -static const unsigned char ch113data[] = { - 0x8,0x8,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68 -}; -static const GLUTBitmapChar ch113 = { 5, 10, -1, 3, 7, ch113data }; - -static const unsigned char ch114data[] = { - 0x80,0x80,0x80,0x80,0x80,0xc0,0xa0 -}; -static const GLUTBitmapChar ch114 = { 3, 7, -1, 0, 4, ch114data }; - -static const unsigned char ch115data[] = { - 0x60,0x90,0x10,0x60,0x80,0x90,0x60 -}; -static const GLUTBitmapChar ch115 = { 4, 7, -1, 0, 6, ch115data }; - -static const unsigned char ch116data[] = { - 0x60,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x40 -}; -static const GLUTBitmapChar ch116 = { 3, 9, 0, 0, 3, ch116data }; - -static const unsigned char ch117data[] = { - 0x68,0x98,0x88,0x88,0x88,0x88,0x88 -}; -static const GLUTBitmapChar ch117 = { 5, 7, -1, 0, 7, ch117data }; - -static const unsigned char ch118data[] = { - 0x20,0x20,0x50,0x50,0x88,0x88,0x88 -}; -static const GLUTBitmapChar ch118 = { 5, 7, -1, 0, 7, ch118data }; - -static const unsigned char ch119data[] = { - 0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80 -}; -static const GLUTBitmapChar ch119 = { 9, 7, 0, 0, 9, ch119data }; - -static const unsigned char ch120data[] = { - 0x84,0x84,0x48,0x30,0x30,0x48,0x84 -}; -static const GLUTBitmapChar ch120 = { 6, 7, 0, 0, 6, ch120data }; - -static const unsigned char ch121data[] = { - 0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88 -}; -static const GLUTBitmapChar ch121 = { 5, 10, -1, 3, 7, ch121data }; - -static const unsigned char ch122data[] = { - 0xf0,0x80,0x40,0x40,0x20,0x10,0xf0 -}; -static const GLUTBitmapChar ch122 = { 4, 7, -1, 0, 6, ch122data }; - -static const unsigned char ch123data[] = { - 0x30,0x40,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30 -}; -static const GLUTBitmapChar ch123 = { 4, 12, 0, 3, 4, ch123data }; - -static const unsigned char ch124data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch124 = { 1, 12, -1, 3, 3, ch124data }; - -static const unsigned char ch125data[] = { - 0xc0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xc0 -}; -static const GLUTBitmapChar ch125 = { 4, 12, 0, 3, 4, ch125data }; - -static const unsigned char ch126data[] = { - 0x98,0x64 -}; -static const GLUTBitmapChar ch126 = { 6, 2, 0, -3, 7, ch126data }; - -static const unsigned char ch160data[] = { - 0x0 -}; -static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 4, ch160data }; - -static const unsigned char ch161data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80 -}; -static const GLUTBitmapChar ch161 = { 1, 10, -1, 3, 3, ch161data }; - -static const unsigned char ch162data[] = { - 0x40,0x70,0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10 -}; -static const GLUTBitmapChar ch162 = { 5, 9, -1, 1, 7, ch162data }; - -static const unsigned char ch163data[] = { - 0xb0,0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30 -}; -static const GLUTBitmapChar ch163 = { 5, 9, -1, 0, 7, ch163data }; - -static const unsigned char ch164data[] = { - 0x84,0x78,0x48,0x48,0x78,0x84 -}; -static const GLUTBitmapChar ch164 = { 6, 6, 0, -1, 7, ch164data }; - -static const unsigned char ch165data[] = { - 0x20,0x20,0xf8,0x20,0xf8,0x20,0x50,0x88,0x88 -}; -static const GLUTBitmapChar ch165 = { 5, 9, -1, 0, 7, ch165data }; - -static const unsigned char ch166data[] = { - 0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch166 = { 1, 11, -1, 2, 3, ch166data }; - -static const unsigned char ch167data[] = { - 0x70,0x88,0x8,0x30,0x48,0x88,0x88,0x90,0x60,0x80,0x88,0x70 -}; -static const GLUTBitmapChar ch167 = { 5, 12, 0, 3, 6, ch167data }; - -static const unsigned char ch168data[] = { - 0xa0 -}; -static const GLUTBitmapChar ch168 = { 3, 1, 0, -8, 3, ch168data }; - -static const unsigned char ch169data[] = { - 0x3e,0x0,0x41,0x0,0x9c,0x80,0xa2,0x80,0xa0,0x80,0xa2,0x80,0x9c,0x80,0x41,0x0, - 0x3e,0x0 -}; -static const GLUTBitmapChar ch169 = { 9, 9, -1, 0, 11, ch169data }; - -static const unsigned char ch170data[] = { - 0xe0,0x0,0xa0,0x20,0xe0 -}; -static const GLUTBitmapChar ch170 = { 3, 5, -1, -4, 5, ch170data }; - -static const unsigned char ch171data[] = { - 0x28,0x50,0xa0,0x50,0x28 -}; -static const GLUTBitmapChar ch171 = { 5, 5, -1, -1, 7, ch171data }; - -static const unsigned char ch172data[] = { - 0x4,0x4,0x4,0xfc -}; -static const GLUTBitmapChar ch172 = { 6, 4, -1, -2, 8, ch172data }; - -static const unsigned char ch173data[] = { - 0xf0 -}; -static const GLUTBitmapChar ch173 = { 4, 1, 0, -3, 5, ch173data }; - -static const unsigned char ch174data[] = { - 0x3e,0x0,0x41,0x0,0x94,0x80,0x94,0x80,0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x0, - 0x3e,0x0 -}; -static const GLUTBitmapChar ch174 = { 9, 9, -1, 0, 11, ch174data }; - -static const unsigned char ch175data[] = { - 0xf0 -}; -static const GLUTBitmapChar ch175 = { 4, 1, 0, -8, 4, ch175data }; - -static const unsigned char ch176data[] = { - 0x60,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch176 = { 4, 4, 0, -4, 5, ch176data }; - -static const unsigned char ch177data[] = { - 0xf8,0x0,0x20,0x20,0xf8,0x20,0x20 -}; -static const GLUTBitmapChar ch177 = { 5, 7, -1, 0, 7, ch177data }; - -static const unsigned char ch178data[] = { - 0xf0,0x40,0x20,0x90,0x60 -}; -static const GLUTBitmapChar ch178 = { 4, 5, 0, -3, 4, ch178data }; - -static const unsigned char ch179data[] = { - 0xc0,0x20,0x40,0x20,0xe0 -}; -static const GLUTBitmapChar ch179 = { 3, 5, 0, -3, 4, ch179data }; - -static const unsigned char ch180data[] = { - 0x80,0x40 -}; -static const GLUTBitmapChar ch180 = { 2, 2, 0, -8, 2, ch180data }; - -static const unsigned char ch181data[] = { - 0x80,0x80,0x80,0xe8,0x98,0x88,0x88,0x88,0x88,0x88 -}; -static const GLUTBitmapChar ch181 = { 5, 10, -1, 3, 7, ch181data }; - -static const unsigned char ch182data[] = { - 0x28,0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c -}; -static const GLUTBitmapChar ch182 = { 6, 12, 0, 3, 7, ch182data }; - -static const unsigned char ch183data[] = { - 0x80 -}; -static const GLUTBitmapChar ch183 = { 1, 1, -1, -3, 3, ch183data }; - -static const unsigned char ch184data[] = { - 0xc0,0x20,0x20,0x40 -}; -static const GLUTBitmapChar ch184 = { 3, 4, 0, 3, 3, ch184data }; - -static const unsigned char ch185data[] = { - 0x40,0x40,0x40,0xc0,0x40 -}; -static const GLUTBitmapChar ch185 = { 2, 5, -1, -3, 4, ch185data }; - -static const unsigned char ch186data[] = { - 0xe0,0x0,0xe0,0xa0,0xe0 -}; -static const GLUTBitmapChar ch186 = { 3, 5, -1, -4, 5, ch186data }; - -static const unsigned char ch187data[] = { - 0xa0,0x50,0x28,0x50,0xa0 -}; -static const GLUTBitmapChar ch187 = { 5, 5, -1, -1, 7, ch187data }; - -static const unsigned char ch188data[] = { - 0x41,0x0,0x27,0x80,0x15,0x0,0x13,0x0,0x49,0x0,0x44,0x0,0x44,0x0,0xc2,0x0, - 0x41,0x0 -}; -static const GLUTBitmapChar ch188 = { 9, 9, 0, 0, 10, ch188data }; - -static const unsigned char ch189data[] = { - 0x47,0x80,0x22,0x0,0x11,0x0,0x14,0x80,0x4b,0x0,0x48,0x0,0x44,0x0,0xc2,0x0, - 0x41,0x0 -}; -static const GLUTBitmapChar ch189 = { 9, 9, 0, 0, 10, ch189data }; - -static const unsigned char ch190data[] = { - 0x21,0x0,0x17,0x80,0x15,0x0,0xb,0x0,0xc9,0x0,0x24,0x0,0x44,0x0,0x22,0x0, - 0xe1,0x0 -}; -static const GLUTBitmapChar ch190 = { 9, 9, 0, 0, 10, ch190data }; - -static const unsigned char ch191data[] = { - 0x70,0x88,0x88,0x40,0x40,0x20,0x20,0x0,0x20 -}; -static const GLUTBitmapChar ch191 = { 5, 9, -1, 3, 7, ch191data }; - -static const unsigned char ch192data[] = { - 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch192 = { 7, 12, -1, 0, 9, ch192data }; - -static const unsigned char ch193data[] = { - 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch193 = { 7, 12, -1, 0, 9, ch193data }; - -static const unsigned char ch194data[] = { - 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch194 = { 7, 12, -1, 0, 9, ch194data }; - -static const unsigned char ch195data[] = { - 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x14 -}; -static const GLUTBitmapChar ch195 = { 7, 12, -1, 0, 9, ch195data }; - -static const unsigned char ch196data[] = { - 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28 -}; -static const GLUTBitmapChar ch196 = { 7, 11, -1, 0, 9, ch196data }; - -static const unsigned char ch197data[] = { - 0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,0x28,0x10 -}; -static const GLUTBitmapChar ch197 = { 7, 12, -1, 0, 9, ch197data }; - -static const unsigned char ch198data[] = { - 0x8f,0x80,0x88,0x0,0x88,0x0,0x78,0x0,0x4f,0x80,0x48,0x0,0x28,0x0,0x28,0x0, - 0x1f,0x80 -}; -static const GLUTBitmapChar ch198 = { 9, 9, -1, 0, 11, ch198data }; - -static const unsigned char ch199data[] = { - 0x30,0x8,0x8,0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c -}; -static const GLUTBitmapChar ch199 = { 7, 12, -1, 3, 9, ch199data }; - -static const unsigned char ch200data[] = { - 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch200 = { 6, 12, -1, 0, 8, ch200data }; - -static const unsigned char ch201data[] = { - 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch201 = { 6, 12, -1, 0, 8, ch201data }; - -static const unsigned char ch202data[] = { - 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch202 = { 6, 12, -1, 0, 8, ch202data }; - -static const unsigned char ch203data[] = { - 0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28 -}; -static const GLUTBitmapChar ch203 = { 6, 11, -1, 0, 8, ch203data }; - -static const unsigned char ch204data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch204 = { 2, 12, 0, 0, 3, ch204data }; - -static const unsigned char ch205data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 -}; -static const GLUTBitmapChar ch205 = { 2, 12, -1, 0, 3, ch205data }; - -static const unsigned char ch206data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch206 = { 3, 12, 0, 0, 3, ch206data }; - -static const unsigned char ch207data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 -}; -static const GLUTBitmapChar ch207 = { 3, 11, 0, 0, 3, ch207data }; - -static const unsigned char ch208data[] = { - 0x7c,0x42,0x41,0x41,0xf1,0x41,0x41,0x42,0x7c -}; -static const GLUTBitmapChar ch208 = { 8, 9, 0, 0, 9, ch208data }; - -static const unsigned char ch209data[] = { - 0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,0x0,0x28,0x14 -}; -static const GLUTBitmapChar ch209 = { 7, 12, -1, 0, 9, ch209data }; - -static const unsigned char ch210data[] = { - 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x10 -}; -static const GLUTBitmapChar ch210 = { 8, 12, -1, 0, 10, ch210data }; - -static const unsigned char ch211data[] = { - 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x4 -}; -static const GLUTBitmapChar ch211 = { 8, 12, -1, 0, 10, ch211data }; - -static const unsigned char ch212data[] = { - 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x14,0x8 -}; -static const GLUTBitmapChar ch212 = { 8, 12, -1, 0, 10, ch212data }; - -static const unsigned char ch213data[] = { - 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x28,0x14 -}; -static const GLUTBitmapChar ch213 = { 8, 12, -1, 0, 10, ch213data }; - -static const unsigned char ch214data[] = { - 0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x24 -}; -static const GLUTBitmapChar ch214 = { 8, 11, -1, 0, 10, ch214data }; - -static const unsigned char ch215data[] = { - 0x88,0x50,0x20,0x50,0x88 -}; -static const GLUTBitmapChar ch215 = { 5, 5, -1, -1, 7, ch215data }; - -static const unsigned char ch216data[] = { - 0x80,0x0,0x5e,0x0,0x21,0x0,0x50,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80, - 0x21,0x0,0x1e,0x80,0x0,0x40 -}; -static const GLUTBitmapChar ch216 = { 10, 11, 0, 1, 10, ch216data }; - -static const unsigned char ch217data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch217 = { 6, 12, -1, 0, 8, ch217data }; - -static const unsigned char ch218data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch218 = { 6, 12, -1, 0, 8, ch218data }; - -static const unsigned char ch219data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch219 = { 6, 12, -1, 0, 8, ch219data }; - -static const unsigned char ch220data[] = { - 0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48 -}; -static const GLUTBitmapChar ch220 = { 6, 11, -1, 0, 8, ch220data }; - -static const unsigned char ch221data[] = { - 0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch221 = { 7, 12, -1, 0, 9, ch221data }; - -static const unsigned char ch222data[] = { - 0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,0x80 -}; -static const GLUTBitmapChar ch222 = { 6, 9, -1, 0, 8, ch222data }; - -static const unsigned char ch223data[] = { - 0xb0,0x88,0x88,0x88,0xb0,0x88,0x88,0x88,0x70 -}; -static const GLUTBitmapChar ch223 = { 5, 9, -1, 0, 7, ch223data }; - -static const unsigned char ch224data[] = { - 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch224 = { 6, 10, -1, 0, 7, ch224data }; - -static const unsigned char ch225data[] = { - 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch225 = { 6, 10, -1, 0, 7, ch225data }; - -static const unsigned char ch226data[] = { - 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch226 = { 6, 10, -1, 0, 7, ch226data }; - -static const unsigned char ch227data[] = { - 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch227 = { 6, 10, -1, 0, 7, ch227data }; - -static const unsigned char ch228data[] = { - 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50 -}; -static const GLUTBitmapChar ch228 = { 6, 9, -1, 0, 7, ch228data }; - -static const unsigned char ch229data[] = { - 0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x30,0x48,0x30 -}; -static const GLUTBitmapChar ch229 = { 6, 10, -1, 0, 7, ch229data }; - -static const unsigned char ch230data[] = { - 0x77,0x0,0x88,0x80,0x88,0x0,0x7f,0x80,0x8,0x80,0x88,0x80,0x77,0x0 -}; -static const GLUTBitmapChar ch230 = { 9, 7, -1, 0, 11, ch230data }; - -static const unsigned char ch231data[] = { - 0x60,0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,0x70 -}; -static const GLUTBitmapChar ch231 = { 5, 10, -1, 3, 7, ch231data }; - -static const unsigned char ch232data[] = { - 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch232 = { 5, 10, -1, 0, 7, ch232data }; - -static const unsigned char ch233data[] = { - 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch233 = { 5, 10, -1, 0, 7, ch233data }; - -static const unsigned char ch234data[] = { - 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch234 = { 5, 10, -1, 0, 7, ch234data }; - -static const unsigned char ch235data[] = { - 0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50 -}; -static const GLUTBitmapChar ch235 = { 5, 9, -1, 0, 7, ch235data }; - -static const unsigned char ch236data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch236 = { 2, 10, 0, 0, 3, ch236data }; - -static const unsigned char ch237data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40 -}; -static const GLUTBitmapChar ch237 = { 2, 10, -1, 0, 3, ch237data }; - -static const unsigned char ch238data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch238 = { 3, 10, 0, 0, 3, ch238data }; - -static const unsigned char ch239data[] = { - 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0 -}; -static const GLUTBitmapChar ch239 = { 3, 9, 0, 0, 3, ch239data }; - -static const unsigned char ch240data[] = { - 0x70,0x88,0x88,0x88,0x88,0x78,0x8,0x50,0x30,0x68 -}; -static const GLUTBitmapChar ch240 = { 5, 10, -1, 0, 7, ch240data }; - -static const unsigned char ch241data[] = { - 0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch241 = { 5, 10, -1, 0, 7, ch241data }; - -static const unsigned char ch242data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch242 = { 5, 10, -1, 0, 7, ch242data }; - -static const unsigned char ch243data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch243 = { 5, 10, -1, 0, 7, ch243data }; - -static const unsigned char ch244data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch244 = { 5, 10, -1, 0, 7, ch244data }; - -static const unsigned char ch245data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch245 = { 5, 10, -1, 0, 7, ch245data }; - -static const unsigned char ch246data[] = { - 0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50 -}; -static const GLUTBitmapChar ch246 = { 5, 9, -1, 0, 7, ch246data }; - -static const unsigned char ch247data[] = { - 0x20,0x0,0xf8,0x0,0x20 -}; -static const GLUTBitmapChar ch247 = { 5, 5, -1, -1, 7, ch247data }; - -static const unsigned char ch248data[] = { - 0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a -}; -static const GLUTBitmapChar ch248 = { 7, 7, 0, 0, 7, ch248data }; - -static const unsigned char ch249data[] = { - 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch249 = { 5, 10, -1, 0, 7, ch249data }; - -static const unsigned char ch250data[] = { - 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch250 = { 5, 10, -1, 0, 7, ch250data }; - -static const unsigned char ch251data[] = { - 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch251 = { 5, 10, -1, 0, 7, ch251data }; - -static const unsigned char ch252data[] = { - 0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50 -}; -static const GLUTBitmapChar ch252 = { 5, 9, -1, 0, 7, ch252data }; - -static const unsigned char ch253data[] = { - 0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch253 = { 5, 13, -1, 3, 7, ch253data }; - -static const unsigned char ch254data[] = { - 0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80 -}; -static const GLUTBitmapChar ch254 = { 5, 12, -1, 3, 7, ch254data }; - -static const unsigned char ch255data[] = { - 0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,0x88,0x88,0x0,0x50 -}; -static const GLUTBitmapChar ch255 = { 5, 12, -1, 3, 7, ch255data }; - - -static const GLUTBitmapChar *chars[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, - &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, - &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, - &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, - &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, - &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, - &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, - &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, - &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, - &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, - &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, - &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 -}; - -const GLUTBitmapFont glutBitmapHelvetica12 = { - "-Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO8859-1", - 15, 256, chars -}; diff --git a/src/glut/dos/hel18.c b/src/glut/dos/hel18.c deleted file mode 100644 index f4d4340e3e..0000000000 --- a/src/glut/dos/hel18.c +++ /dev/null @@ -1,1138 +0,0 @@ -/* autogenerated by bdf2c! do not edit */ - -/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ - - -#include "internal.h" -/* -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; -*/ - - -static const unsigned char ch32data[] = { - 0x0 -}; -static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 5, ch32data }; - -static const unsigned char ch33data[] = { - 0xc0,0xc0,0x0,0x0,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch33 = { 2, 14, -2, 0, 6, ch33data }; - -static const unsigned char ch34data[] = { - 0x90,0x90,0xd8,0xd8,0xd8 -}; -static const GLUTBitmapChar ch34 = { 5, 5, 0, -9, 5, ch34data }; - -static const unsigned char ch35data[] = { - 0x24,0x0,0x24,0x0,0x24,0x0,0xff,0x80,0xff,0x80,0x12,0x0,0x12,0x0,0x12,0x0, - 0x7f,0xc0,0x7f,0xc0,0x9,0x0,0x9,0x0,0x9,0x0 -}; -static const GLUTBitmapChar ch35 = { 10, 13, 0, 0, 10, ch35data }; - -static const unsigned char ch36data[] = { - 0x8,0x0,0x8,0x0,0x3e,0x0,0x7f,0x0,0xeb,0x80,0xc9,0x80,0x9,0x80,0xf,0x0, - 0x3e,0x0,0x78,0x0,0xe8,0x0,0xc8,0x0,0xcb,0x0,0x7f,0x0,0x3e,0x0,0x8,0x0 -}; -static const GLUTBitmapChar ch36 = { 9, 16, -1, 2, 10, ch36data }; - -static const unsigned char ch37data[] = { - 0x18,0x78,0x18,0xfc,0xc,0xcc,0xc,0xcc,0x6,0xfc,0x6,0x78,0x3,0x0,0x7b,0x0, - 0xfd,0x80,0xcd,0x80,0xcc,0xc0,0xfc,0xc0,0x78,0x60 -}; -static const GLUTBitmapChar ch37 = { 14, 13, -1, 0, 16, ch37data }; - -static const unsigned char ch38data[] = { - 0x3c,0x70,0x7e,0xe0,0xe7,0xc0,0xc3,0x80,0xc3,0xc0,0xc6,0xc0,0xee,0xc0,0x7c,0x0, - 0x3c,0x0,0x66,0x0,0x66,0x0,0x7e,0x0,0x3c,0x0 -}; -static const GLUTBitmapChar ch38 = { 12, 13, -1, 0, 13, ch38data }; - -static const unsigned char ch39data[] = { - 0x80,0x40,0x40,0xc0,0xc0 -}; -static const GLUTBitmapChar ch39 = { 2, 5, -1, -9, 4, ch39data }; - -static const unsigned char ch40data[] = { - 0x10,0x30,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60, - 0x30,0x10 -}; -static const GLUTBitmapChar ch40 = { 4, 18, -1, 4, 6, ch40data }; - -static const unsigned char ch41data[] = { - 0x80,0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60, - 0xc0,0x80 -}; -static const GLUTBitmapChar ch41 = { 4, 18, -1, 4, 6, ch41data }; - -static const unsigned char ch42data[] = { - 0x88,0x70,0x70,0xf8,0x20,0x20 -}; -static const GLUTBitmapChar ch42 = { 5, 6, -1, -8, 7, ch42data }; - -static const unsigned char ch43data[] = { - 0x18,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,0x18 -}; -static const GLUTBitmapChar ch43 = { 8, 10, -1, 0, 10, ch43data }; - -static const unsigned char ch44data[] = { - 0x80,0x40,0x40,0xc0,0xc0 -}; -static const GLUTBitmapChar ch44 = { 2, 5, -1, 3, 5, ch44data }; - -static const unsigned char ch45data[] = { - 0xff,0xff -}; -static const GLUTBitmapChar ch45 = { 8, 2, -1, -4, 11, ch45data }; - -static const unsigned char ch46data[] = { - 0xc0,0xc0 -}; -static const GLUTBitmapChar ch46 = { 2, 2, -1, 0, 5, ch46data }; - -static const unsigned char ch47data[] = { - 0xc0,0xc0,0x40,0x40,0x60,0x60,0x20,0x20,0x30,0x30,0x10,0x10,0x18,0x18 -}; -static const GLUTBitmapChar ch47 = { 5, 14, 0, 0, 5, ch47data }; - -static const unsigned char ch48data[] = { - 0x3c,0x7e,0x66,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x7e,0x3c -}; -static const GLUTBitmapChar ch48 = { 8, 13, -1, 0, 10, ch48data }; - -static const unsigned char ch49data[] = { - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0xf8,0x18 -}; -static const GLUTBitmapChar ch49 = { 5, 13, -2, 0, 10, ch49data }; - -static const unsigned char ch50data[] = { - 0xff,0xff,0xc0,0xe0,0x70,0x38,0x1c,0xe,0x7,0x3,0xc3,0xfe,0x3c -}; -static const GLUTBitmapChar ch50 = { 8, 13, -1, 0, 10, ch50data }; - -static const unsigned char ch51data[] = { - 0x3c,0x7e,0xc7,0xc3,0x3,0x7,0x1e,0x1c,0x6,0xc3,0xc3,0x7e,0x3c -}; -static const GLUTBitmapChar ch51 = { 8, 13, -1, 0, 10, ch51data }; - -static const unsigned char ch52data[] = { - 0x3,0x0,0x3,0x0,0x3,0x0,0xff,0x80,0xff,0x80,0xc3,0x0,0x63,0x0,0x33,0x0, - 0x33,0x0,0x1b,0x0,0xf,0x0,0x7,0x0,0x3,0x0 -}; -static const GLUTBitmapChar ch52 = { 9, 13, -1, 0, 10, ch52data }; - -static const unsigned char ch53data[] = { - 0x7c,0xfe,0xc7,0xc3,0x3,0x3,0xc7,0xfe,0xfc,0xc0,0xc0,0xfe,0xfe -}; -static const GLUTBitmapChar ch53 = { 8, 13, -1, 0, 10, ch53data }; - -static const unsigned char ch54data[] = { - 0x3c,0x7e,0xe3,0xc3,0xc3,0xc3,0xfe,0xdc,0xc0,0xc0,0x63,0x7f,0x3c -}; -static const GLUTBitmapChar ch54 = { 8, 13, -1, 0, 10, ch54data }; - -static const unsigned char ch55data[] = { - 0x60,0x60,0x30,0x30,0x30,0x18,0x18,0xc,0xc,0x6,0x3,0xff,0xff -}; -static const GLUTBitmapChar ch55 = { 8, 13, -1, 0, 10, ch55data }; - -static const unsigned char ch56data[] = { - 0x3c,0x7e,0xe7,0xc3,0xc3,0x66,0x7e,0x66,0xc3,0xc3,0xe7,0x7e,0x3c -}; -static const GLUTBitmapChar ch56 = { 8, 13, -1, 0, 10, ch56data }; - -static const unsigned char ch57data[] = { - 0x7c,0xfe,0xc6,0x3,0x3,0x3b,0x7f,0xc3,0xc3,0xc3,0xc7,0x7e,0x3c -}; -static const GLUTBitmapChar ch57 = { 8, 13, -1, 0, 10, ch57data }; - -static const unsigned char ch58data[] = { - 0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch58 = { 2, 10, -1, 0, 5, ch58data }; - -static const unsigned char ch59data[] = { - 0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch59 = { 2, 13, -1, 3, 5, ch59data }; - -static const unsigned char ch60data[] = { - 0x3,0xf,0x3c,0x70,0xc0,0x70,0x3c,0xf,0x3 -}; -static const GLUTBitmapChar ch60 = { 8, 9, -1, 0, 10, ch60data }; - -static const unsigned char ch61data[] = { - 0xfe,0xfe,0x0,0x0,0xfe,0xfe -}; -static const GLUTBitmapChar ch61 = { 7, 6, -2, -2, 11, ch61data }; - -static const unsigned char ch62data[] = { - 0xc0,0xf0,0x3c,0xe,0x3,0xe,0x3c,0xf0,0xc0 -}; -static const GLUTBitmapChar ch62 = { 8, 9, -1, 0, 10, ch62data }; - -static const unsigned char ch63data[] = { - 0x30,0x30,0x0,0x0,0x30,0x30,0x30,0x38,0x1c,0xe,0xc6,0xc6,0xfe,0x7c -}; -static const GLUTBitmapChar ch63 = { 7, 14, -1, 0, 10, ch63data }; - -static const unsigned char ch64data[] = { - 0x7,0xe0,0x1f,0xf0,0x38,0x0,0x70,0x0,0x67,0x70,0xcf,0xf8,0xcc,0xcc,0xcc,0x66, - 0xcc,0x66,0xcc,0x63,0xc6,0x33,0x67,0x73,0x63,0xb3,0x30,0x6,0x1c,0xe,0xf,0xfc, - 0x3,0xf0 -}; -static const GLUTBitmapChar ch64 = { 16, 17, -1, 3, 18, ch64data }; - -static const unsigned char ch65data[] = { - 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, - 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch65 = { 12, 14, 0, 0, 12, ch65data }; - -static const unsigned char ch66data[] = { - 0xff,0x80,0xff,0xc0,0xc0,0xe0,0xc0,0x60,0xc0,0x60,0xc0,0xe0,0xff,0xc0,0xff,0x80, - 0xc1,0x80,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 -}; -static const GLUTBitmapChar ch66 = { 11, 14, -1, 0, 13, ch66data }; - -static const unsigned char ch67data[] = { - 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, - 0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 -}; -static const GLUTBitmapChar ch67 = { 12, 14, -1, 0, 14, ch67data }; - -static const unsigned char ch68data[] = { - 0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, - 0xc0,0x60,0xc0,0x60,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 -}; -static const GLUTBitmapChar ch68 = { 11, 14, -1, 0, 13, ch68data }; - -static const unsigned char ch69data[] = { - 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80 -}; -static const GLUTBitmapChar ch69 = { 9, 14, -1, 0, 11, ch69data }; - -static const unsigned char ch70data[] = { - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80 -}; -static const GLUTBitmapChar ch70 = { 9, 14, -1, 0, 11, ch70data }; - -static const unsigned char ch71data[] = { - 0xf,0xb0,0x3f,0xf0,0x70,0x70,0x60,0x30,0xe0,0x30,0xc1,0xf0,0xc1,0xf0,0xc0,0x0, - 0xc0,0x0,0xe0,0x30,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 -}; -static const GLUTBitmapChar ch71 = { 12, 14, -1, 0, 14, ch71data }; - -static const unsigned char ch72data[] = { - 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xff,0xe0,0xff,0xe0, - 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60 -}; -static const GLUTBitmapChar ch72 = { 11, 14, -1, 0, 13, ch72data }; - -static const unsigned char ch73data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch73 = { 2, 14, -2, 0, 6, ch73data }; - -static const unsigned char ch74data[] = { - 0x3c,0x7e,0xe7,0xc3,0xc3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3 -}; -static const GLUTBitmapChar ch74 = { 8, 14, -1, 0, 10, ch74data }; - -static const unsigned char ch75data[] = { - 0xc0,0x70,0xc0,0xe0,0xc1,0xc0,0xc3,0x80,0xc7,0x0,0xce,0x0,0xfc,0x0,0xf8,0x0, - 0xdc,0x0,0xce,0x0,0xc7,0x0,0xc3,0x80,0xc1,0xc0,0xc0,0xe0 -}; -static const GLUTBitmapChar ch75 = { 12, 14, -1, 0, 13, ch75data }; - -static const unsigned char ch76data[] = { - 0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch76 = { 8, 14, -1, 0, 10, ch76data }; - -static const unsigned char ch77data[] = { - 0xc3,0xc,0xc3,0xc,0xc7,0x8c,0xc4,0x8c,0xcc,0xcc,0xcc,0xcc,0xd8,0x6c,0xd8,0x6c, - 0xf0,0x3c,0xf0,0x3c,0xe0,0x1c,0xe0,0x1c,0xc0,0xc,0xc0,0xc -}; -static const GLUTBitmapChar ch77 = { 14, 14, -1, 0, 16, ch77data }; - -static const unsigned char ch78data[] = { - 0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, - 0xcc,0x60,0xd8,0x60,0xf0,0x60,0xf0,0x60,0xe0,0x60,0xc0,0x60 -}; -static const GLUTBitmapChar ch78 = { 11, 14, -1, 0, 13, ch78data }; - -static const unsigned char ch79data[] = { - 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, - 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 -}; -static const GLUTBitmapChar ch79 = { 13, 14, -1, 0, 15, ch79data }; - -static const unsigned char ch80data[] = { - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80, - 0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 -}; -static const GLUTBitmapChar ch80 = { 10, 14, -1, 0, 12, ch80data }; - -static const unsigned char ch81data[] = { - 0x0,0x30,0xf,0xb0,0x3f,0xe0,0x70,0xf0,0x61,0xb0,0xe1,0xb8,0xc0,0x18,0xc0,0x18, - 0xc0,0x18,0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80 -}; -static const GLUTBitmapChar ch81 = { 13, 15, -1, 1, 15, ch81data }; - -static const unsigned char ch82data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0x80,0xc1,0x80,0xff,0x0,0xff,0x80, - 0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0 -}; -static const GLUTBitmapChar ch82 = { 10, 14, -1, 0, 12, ch82data }; - -static const unsigned char ch83data[] = { - 0x3f,0x0,0x7f,0xc0,0xe0,0xe0,0xc0,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,0x1f,0x0, - 0x7c,0x0,0xe0,0x0,0xc0,0x60,0xe0,0xe0,0x7f,0xc0,0x1f,0x0 -}; -static const GLUTBitmapChar ch83 = { 11, 14, -1, 0, 13, ch83data }; - -static const unsigned char ch84data[] = { - 0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0, - 0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xff,0xc0,0xff,0xc0 -}; -static const GLUTBitmapChar ch84 = { 10, 14, -1, 0, 12, ch84data }; - -static const unsigned char ch85data[] = { - 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, - 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60 -}; -static const GLUTBitmapChar ch85 = { 11, 14, -1, 0, 13, ch85data }; - -static const unsigned char ch86data[] = { - 0x6,0x0,0xf,0x0,0xf,0x0,0x19,0x80,0x19,0x80,0x19,0x80,0x30,0xc0,0x30,0xc0, - 0x30,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30 -}; -static const GLUTBitmapChar ch86 = { 12, 14, -1, 0, 14, ch86data }; - -static const unsigned char ch87data[] = { - 0x18,0x18,0x18,0x18,0x1c,0x38,0x34,0x2c,0x36,0x6c,0x36,0x6c,0x66,0x66,0x66,0x66, - 0x62,0x46,0x63,0xc6,0xc3,0xc3,0xc1,0x83,0xc1,0x83,0xc1,0x83 -}; -static const GLUTBitmapChar ch87 = { 16, 14, -1, 0, 18, ch87data }; - -static const unsigned char ch88data[] = { - 0xc0,0x60,0xe0,0xe0,0x60,0xc0,0x71,0xc0,0x31,0x80,0x1b,0x0,0xe,0x0,0xe,0x0, - 0x1b,0x0,0x31,0x80,0x71,0xc0,0x60,0xc0,0xe0,0xe0,0xc0,0x60 -}; -static const GLUTBitmapChar ch88 = { 11, 14, -1, 0, 13, ch88data }; - -static const unsigned char ch89data[] = { - 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, - 0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30 -}; -static const GLUTBitmapChar ch89 = { 12, 14, -1, 0, 14, ch89data }; - -static const unsigned char ch90data[] = { - 0xff,0xc0,0xff,0xc0,0xc0,0x0,0x60,0x0,0x30,0x0,0x18,0x0,0x1c,0x0,0xc,0x0, - 0x6,0x0,0x3,0x0,0x1,0x80,0x0,0xc0,0xff,0xc0,0xff,0xc0 -}; -static const GLUTBitmapChar ch90 = { 10, 14, -1, 0, 12, ch90data }; - -static const unsigned char ch91data[] = { - 0xf0,0xf0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xf0,0xf0 -}; -static const GLUTBitmapChar ch91 = { 4, 18, -1, 4, 5, ch91data }; - -static const unsigned char ch92data[] = { - 0x18,0x18,0x10,0x10,0x30,0x30,0x20,0x20,0x60,0x60,0x40,0x40,0xc0,0xc0 -}; -static const GLUTBitmapChar ch92 = { 5, 14, 0, 0, 5, ch92data }; - -static const unsigned char ch93data[] = { - 0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0xf0,0xf0 -}; -static const GLUTBitmapChar ch93 = { 4, 18, 0, 4, 5, ch93data }; - -static const unsigned char ch94data[] = { - 0x82,0xc6,0x6c,0x38,0x10 -}; -static const GLUTBitmapChar ch94 = { 7, 5, -1, -8, 9, ch94data }; - -static const unsigned char ch95data[] = { - 0xff,0xc0,0xff,0xc0 -}; -static const GLUTBitmapChar ch95 = { 10, 2, 0, 4, 10, ch95data }; - -static const unsigned char ch96data[] = { - 0xc0,0xc0,0x80,0x80,0x40 -}; -static const GLUTBitmapChar ch96 = { 2, 5, -1, -9, 4, ch96data }; - -static const unsigned char ch97data[] = { - 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c -}; -static const GLUTBitmapChar ch97 = { 7, 10, -1, 0, 9, ch97data }; - -static const unsigned char ch98data[] = { - 0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0, - 0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0 -}; -static const GLUTBitmapChar ch98 = { 9, 14, -1, 0, 11, ch98data }; - -static const unsigned char ch99data[] = { - 0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e -}; -static const GLUTBitmapChar ch99 = { 8, 10, -1, 0, 10, ch99data }; - -static const unsigned char ch100data[] = { - 0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80, - 0x7f,0x80,0x3d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80 -}; -static const GLUTBitmapChar ch100 = { 9, 14, -1, 0, 11, ch100data }; - -static const unsigned char ch101data[] = { - 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c -}; -static const GLUTBitmapChar ch101 = { 8, 10, -1, 0, 10, ch101data }; - -static const unsigned char ch102data[] = { - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x3c,0x1c -}; -static const GLUTBitmapChar ch102 = { 6, 14, 0, 0, 6, ch102data }; - -static const unsigned char ch103data[] = { - 0x1c,0x0,0x7f,0x0,0x63,0x0,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, - 0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x7f,0x80,0x3d,0x80 -}; -static const GLUTBitmapChar ch103 = { 9, 14, -1, 4, 11, ch103data }; - -static const unsigned char ch104data[] = { - 0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0xc0,0xc0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch104 = { 8, 14, -1, 0, 10, ch104data }; - -static const unsigned char ch105data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch105 = { 2, 14, -1, 0, 4, ch105data }; - -static const unsigned char ch106data[] = { - 0xe0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x0, - 0x30,0x30 -}; -static const GLUTBitmapChar ch106 = { 4, 18, 1, 4, 4, ch106data }; - -static const unsigned char ch107data[] = { - 0xc7,0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xd8,0xcc,0xc6,0xc0,0xc0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch107 = { 8, 14, -1, 0, 9, ch107data }; - -static const unsigned char ch108data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch108 = { 2, 14, -1, 0, 4, ch108data }; - -static const unsigned char ch109data[] = { - 0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xe7,0x30, - 0xde,0xf0,0xcc,0x60 -}; -static const GLUTBitmapChar ch109 = { 12, 10, -1, 0, 14, ch109data }; - -static const unsigned char ch110data[] = { - 0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce -}; -static const GLUTBitmapChar ch110 = { 8, 10, -1, 0, 10, ch110data }; - -static const unsigned char ch111data[] = { - 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, - 0x7f,0x0,0x3e,0x0 -}; -static const GLUTBitmapChar ch111 = { 9, 10, -1, 0, 11, ch111data }; - -static const unsigned char ch112data[] = { - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, - 0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0 -}; -static const GLUTBitmapChar ch112 = { 9, 14, -1, 4, 11, ch112data }; - -static const unsigned char ch113data[] = { - 0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, - 0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,0x7f,0x80,0x3d,0x80 -}; -static const GLUTBitmapChar ch113 = { 9, 14, -1, 4, 11, ch113data }; - -static const unsigned char ch114data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xd8,0xd8 -}; -static const GLUTBitmapChar ch114 = { 5, 10, -1, 0, 6, ch114data }; - -static const unsigned char ch115data[] = { - 0x78,0xfc,0xc6,0x6,0x3e,0xfc,0xc0,0xc6,0x7e,0x3c -}; -static const GLUTBitmapChar ch115 = { 7, 10, -1, 0, 9, ch115data }; - -static const unsigned char ch116data[] = { - 0x18,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x30 -}; -static const GLUTBitmapChar ch116 = { 6, 13, 0, 0, 6, ch116data }; - -static const unsigned char ch117data[] = { - 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3 -}; -static const GLUTBitmapChar ch117 = { 8, 10, -1, 0, 10, ch117data }; - -static const unsigned char ch118data[] = { - 0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3 -}; -static const GLUTBitmapChar ch118 = { 8, 10, -1, 0, 10, ch118data }; - -static const unsigned char ch119data[] = { - 0x19,0x80,0x19,0x80,0x39,0xc0,0x29,0x40,0x69,0x60,0x66,0x60,0x66,0x60,0xc6,0x30, - 0xc6,0x30,0xc6,0x30 -}; -static const GLUTBitmapChar ch119 = { 12, 10, -1, 0, 14, ch119data }; - -static const unsigned char ch120data[] = { - 0xc3,0xe7,0x66,0x3c,0x18,0x18,0x3c,0x66,0xe7,0xc3 -}; -static const GLUTBitmapChar ch120 = { 8, 10, -1, 0, 10, ch120data }; - -static const unsigned char ch121data[] = { - 0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3 -}; -static const GLUTBitmapChar ch121 = { 8, 14, -1, 4, 10, ch121data }; - -static const unsigned char ch122data[] = { - 0xfe,0xfe,0xc0,0x60,0x30,0x18,0xc,0x6,0xfe,0xfe -}; -static const GLUTBitmapChar ch122 = { 7, 10, -1, 0, 9, ch122data }; - -static const unsigned char ch123data[] = { - 0xc,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x30,0x30,0x30, - 0x18,0xc -}; -static const GLUTBitmapChar ch123 = { 6, 18, 0, 4, 6, ch123data }; - -static const unsigned char ch124data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0 -}; -static const GLUTBitmapChar ch124 = { 2, 18, -1, 4, 4, ch124data }; - -static const unsigned char ch125data[] = { - 0xc0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0xc,0x18,0x30,0x30,0x30,0x30,0x30, - 0x60,0xc0 -}; -static const GLUTBitmapChar ch125 = { 6, 18, 0, 4, 6, ch125data }; - -static const unsigned char ch126data[] = { - 0xcc,0x7e,0x33 -}; -static const GLUTBitmapChar ch126 = { 8, 3, -1, -4, 10, ch126data }; - -static const unsigned char ch160data[] = { - 0x0 -}; -static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 5, ch160data }; - -static const unsigned char ch161data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x0,0x0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch161 = { 2, 14, -2, 4, 6, ch161data }; - -static const unsigned char ch162data[] = { - 0x10,0x10,0x3e,0x7f,0x6b,0xc8,0xc8,0xc8,0xc8,0x6b,0x7f,0x3e,0x4,0x4 -}; -static const GLUTBitmapChar ch162 = { 8, 14, -1, 2, 10, ch162data }; - -static const unsigned char ch163data[] = { - 0xdf,0x0,0xff,0x80,0x60,0x80,0x30,0x0,0x18,0x0,0x18,0x0,0x7e,0x0,0x30,0x0, - 0x60,0x0,0x61,0x80,0x61,0x80,0x3f,0x0,0x1e,0x0 -}; -static const GLUTBitmapChar ch163 = { 9, 13, 0, 0, 10, ch163data }; - -static const unsigned char ch164data[] = { - 0xc3,0xff,0x66,0x66,0x66,0xff,0xc3 -}; -static const GLUTBitmapChar ch164 = { 8, 7, -1, -3, 10, ch164data }; - -static const unsigned char ch165data[] = { - 0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x3c,0x66,0x66,0x66,0xc3,0xc3 -}; -static const GLUTBitmapChar ch165 = { 8, 13, -1, 0, 10, ch165data }; - -static const unsigned char ch166data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0 -}; -static const GLUTBitmapChar ch166 = { 2, 17, -1, 3, 4, ch166data }; - -static const unsigned char ch167data[] = { - 0x3c,0x7e,0xc3,0xc3,0x7,0xe,0x3e,0x73,0xe3,0xc3,0xc7,0x6e,0x7c,0xf0,0xc3,0xc3, - 0x7e,0x3c -}; -static const GLUTBitmapChar ch167 = { 8, 18, -1, 4, 10, ch167data }; - -static const unsigned char ch168data[] = { - 0xd8,0xd8 -}; -static const GLUTBitmapChar ch168 = { 5, 2, 0, -11, 6, ch168data }; - -static const unsigned char ch169data[] = { - 0xf,0x80,0x30,0x60,0x40,0x10,0x47,0x10,0x88,0x88,0x90,0x8,0x90,0x8,0x90,0x8, - 0x88,0x88,0x47,0x10,0x40,0x10,0x30,0x60,0xf,0x80 -}; -static const GLUTBitmapChar ch169 = { 13, 13, -1, 0, 15, ch169data }; - -static const unsigned char ch170data[] = { - 0xf8,0x0,0x68,0xd8,0x48,0x38,0xc8,0x70 -}; -static const GLUTBitmapChar ch170 = { 5, 8, -1, -6, 7, ch170data }; - -static const unsigned char ch171data[] = { - 0x12,0x36,0x6c,0xd8,0xd8,0x6c,0x36,0x12 -}; -static const GLUTBitmapChar ch171 = { 7, 8, -1, -1, 9, ch171data }; - -static const unsigned char ch172data[] = { - 0x1,0x80,0x1,0x80,0x1,0x80,0xff,0x80,0xff,0x80 -}; -static const GLUTBitmapChar ch172 = { 9, 5, -1, -3, 11, ch172data }; - -static const unsigned char ch173data[] = { - 0xf8,0xf8 -}; -static const GLUTBitmapChar ch173 = { 5, 2, -1, -4, 7, ch173data }; - -static const unsigned char ch174data[] = { - 0xf,0x80,0x30,0x60,0x40,0x10,0x48,0x50,0x88,0x88,0x89,0x8,0x8f,0x88,0x88,0x48, - 0x88,0x48,0x4f,0x90,0x40,0x10,0x30,0x60,0xf,0x80 -}; -static const GLUTBitmapChar ch174 = { 13, 13, -1, 0, 14, ch174data }; - -static const unsigned char ch175data[] = { - 0xf8 -}; -static const GLUTBitmapChar ch175 = { 5, 1, 0, -12, 5, ch175data }; - -static const unsigned char ch176data[] = { - 0x70,0xd8,0x88,0xd8,0x70 -}; -static const GLUTBitmapChar ch176 = { 5, 5, -1, -8, 7, ch176data }; - -static const unsigned char ch177data[] = { - 0xff,0xff,0x0,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18 -}; -static const GLUTBitmapChar ch177 = { 8, 11, -1, 0, 10, ch177data }; - -static const unsigned char ch178data[] = { - 0xf8,0xf8,0x60,0x30,0x18,0x98,0xf8,0x70 -}; -static const GLUTBitmapChar ch178 = { 5, 8, 0, -5, 6, ch178data }; - -static const unsigned char ch179data[] = { - 0x70,0xf8,0x98,0x30,0x30,0x98,0xf8,0x70 -}; -static const GLUTBitmapChar ch179 = { 5, 8, 0, -5, 6, ch179data }; - -static const unsigned char ch180data[] = { - 0xc0,0x60,0x30 -}; -static const GLUTBitmapChar ch180 = { 4, 3, 0, -11, 4, ch180data }; - -static const unsigned char ch181data[] = { - 0xc0,0xc0,0xc0,0xc0,0xdb,0xff,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3 -}; -static const GLUTBitmapChar ch181 = { 8, 14, -1, 4, 10, ch181data }; - -static const unsigned char ch182data[] = { - 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x32,0x72,0xf2,0xf2,0xf2,0xf2, - 0x72,0x3f -}; -static const GLUTBitmapChar ch182 = { 8, 18, -1, 4, 10, ch182data }; - -static const unsigned char ch183data[] = { - 0xc0,0xc0 -}; -static const GLUTBitmapChar ch183 = { 2, 2, -1, -4, 4, ch183data }; - -static const unsigned char ch184data[] = { - 0xf0,0xd8,0x18,0x70,0x60 -}; -static const GLUTBitmapChar ch184 = { 5, 5, 0, 4, 5, ch184data }; - -static const unsigned char ch185data[] = { - 0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60 -}; -static const GLUTBitmapChar ch185 = { 3, 8, -1, -5, 6, ch185data }; - -static const unsigned char ch186data[] = { - 0xf8,0x0,0x70,0xd8,0x88,0x88,0xd8,0x70 -}; -static const GLUTBitmapChar ch186 = { 5, 8, -1, -6, 7, ch186data }; - -static const unsigned char ch187data[] = { - 0x90,0xd8,0x6c,0x36,0x36,0x6c,0xd8,0x90 -}; -static const GLUTBitmapChar ch187 = { 7, 8, -1, -1, 9, ch187data }; - -static const unsigned char ch188data[] = { - 0x30,0x30,0x30,0x30,0x19,0xf8,0xd,0xb0,0xc,0xf0,0x66,0x70,0x62,0x30,0x63,0x10, - 0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60 -}; -static const GLUTBitmapChar ch188 = { 13, 13, -1, 0, 15, ch188data }; - -static const unsigned char ch189data[] = { - 0x30,0xf8,0x30,0xf8,0x18,0x60,0xc,0x30,0xc,0x18,0x66,0x98,0x62,0xf8,0x63,0x70, - 0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60 -}; -static const GLUTBitmapChar ch189 = { 13, 13, -1, 0, 15, ch189data }; - -static const unsigned char ch190data[] = { - 0x18,0x18,0x18,0x18,0xc,0xfc,0x6,0xd8,0x6,0x78,0x73,0x38,0xf9,0x18,0x99,0x88, - 0x30,0xc0,0x30,0xc0,0x98,0x60,0xf8,0x30,0x70,0x30 -}; -static const GLUTBitmapChar ch190 = { 14, 13, 0, 0, 15, ch190data }; - -static const unsigned char ch191data[] = { - 0x7c,0xfe,0xc6,0xc6,0xe0,0x70,0x38,0x18,0x18,0x18,0x0,0x0,0x18,0x18 -}; -static const GLUTBitmapChar ch191 = { 7, 14, -1, 4, 10, ch191data }; - -static const unsigned char ch192data[] = { - 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, - 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, - 0xc,0x0,0x18,0x0 -}; -static const GLUTBitmapChar ch192 = { 12, 18, 0, 0, 12, ch192data }; - -static const unsigned char ch193data[] = { - 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, - 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, - 0x3,0x0,0x1,0x80 -}; -static const GLUTBitmapChar ch193 = { 12, 18, 0, 0, 12, ch193data }; - -static const unsigned char ch194data[] = { - 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, - 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, - 0xf,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch194 = { 12, 18, 0, 0, 12, ch194data }; - -static const unsigned char ch195data[] = { - 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, - 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x13,0x0, - 0x16,0x80,0xc,0x80 -}; -static const GLUTBitmapChar ch195 = { 12, 18, 0, 0, 12, ch195data }; - -static const unsigned char ch196data[] = { - 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, - 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, - 0x19,0x80 -}; -static const GLUTBitmapChar ch196 = { 12, 17, 0, 0, 12, ch196data }; - -static const unsigned char ch197data[] = { - 0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, - 0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, - 0x19,0x80,0xf,0x0 -}; -static const GLUTBitmapChar ch197 = { 12, 18, 0, 0, 12, ch197data }; - -static const unsigned char ch198data[] = { - 0xc1,0xff,0xc1,0xff,0x61,0x80,0x61,0x80,0x7f,0x80,0x3f,0x80,0x31,0xfe,0x31,0xfe, - 0x19,0x80,0x19,0x80,0xd,0x80,0xd,0x80,0x7,0xff,0x7,0xff -}; -static const GLUTBitmapChar ch198 = { 16, 14, -1, 0, 18, ch198data }; - -static const unsigned char ch199data[] = { - 0x1e,0x0,0x1b,0x0,0x3,0x0,0xe,0x0,0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30, - 0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70, - 0x3f,0xe0,0xf,0x80 -}; -static const GLUTBitmapChar ch199 = { 12, 18, -1, 4, 14, ch199data }; - -static const unsigned char ch200data[] = { - 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, - 0x18,0x0,0x30,0x0 -}; -static const GLUTBitmapChar ch200 = { 9, 18, -1, 0, 11, ch200data }; - -static const unsigned char ch201data[] = { - 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, - 0x6,0x0,0x3,0x0 -}; -static const GLUTBitmapChar ch201 = { 9, 18, -1, 0, 11, ch201data }; - -static const unsigned char ch202data[] = { - 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, - 0x1e,0x0,0xc,0x0 -}; -static const GLUTBitmapChar ch202 = { 9, 18, -1, 0, 11, ch202data }; - -static const unsigned char ch203data[] = { - 0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, - 0x33,0x0 -}; -static const GLUTBitmapChar ch203 = { 9, 17, -1, 0, 11, ch203data }; - -static const unsigned char ch204data[] = { - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x30, - 0x60,0xc0 -}; -static const GLUTBitmapChar ch204 = { 4, 18, 0, 0, 6, ch204data }; - -static const unsigned char ch205data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0xc0, - 0x60,0x30 -}; -static const GLUTBitmapChar ch205 = { 4, 18, -2, 0, 6, ch205data }; - -static const unsigned char ch206data[] = { - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, - 0x78,0x30 -}; -static const GLUTBitmapChar ch206 = { 6, 18, 0, 0, 6, ch206data }; - -static const unsigned char ch207data[] = { - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, - 0xcc -}; -static const GLUTBitmapChar ch207 = { 6, 17, 0, 0, 6, ch207data }; - -static const unsigned char ch208data[] = { - 0x7f,0x80,0x7f,0xc0,0x60,0xe0,0x60,0x60,0x60,0x30,0x60,0x30,0xfc,0x30,0xfc,0x30, - 0x60,0x30,0x60,0x30,0x60,0x60,0x60,0xe0,0x7f,0xc0,0x7f,0x80 -}; -static const GLUTBitmapChar ch208 = { 12, 14, 0, 0, 13, ch208data }; - -static const unsigned char ch209data[] = { - 0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, - 0xcc,0x60,0xd8,0x60,0xd8,0x60,0xf0,0x60,0xe0,0x60,0xe0,0x60,0x0,0x0,0x13,0x0, - 0x16,0x80,0xc,0x80 -}; -static const GLUTBitmapChar ch209 = { 11, 18, -1, 0, 13, ch209data }; - -static const unsigned char ch210data[] = { - 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, - 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, - 0x6,0x0,0xc,0x0 -}; -static const GLUTBitmapChar ch210 = { 13, 18, -1, 0, 15, ch210data }; - -static const unsigned char ch211data[] = { - 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, - 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, - 0x1,0x80,0x0,0xc0 -}; -static const GLUTBitmapChar ch211 = { 13, 18, -1, 0, 15, ch211data }; - -static const unsigned char ch212data[] = { - 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, - 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xc,0xc0, - 0x7,0x80,0x3,0x0 -}; -static const GLUTBitmapChar ch212 = { 13, 18, -1, 0, 15, ch212data }; - -static const unsigned char ch213data[] = { - 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, - 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x9,0x80, - 0xb,0x40,0x6,0x40 -}; -static const GLUTBitmapChar ch213 = { 13, 18, -1, 0, 15, ch213data }; - -static const unsigned char ch214data[] = { - 0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, - 0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xd,0x80, - 0xd,0x80 -}; -static const GLUTBitmapChar ch214 = { 13, 17, -1, 0, 15, ch214data }; - -static const unsigned char ch215data[] = { - 0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,0x61,0x80, - 0xc0,0xc0 -}; -static const GLUTBitmapChar ch215 = { 10, 9, 0, 0, 10, ch215data }; - -static const unsigned char ch216data[] = { - 0xc7,0xc0,0xff,0xf0,0x78,0x38,0x38,0x18,0x6c,0x1c,0x6e,0xc,0x67,0xc,0x63,0x8c, - 0x61,0xcc,0x70,0xdc,0x30,0x78,0x38,0x38,0x1f,0xfc,0x7,0xcc -}; -static const GLUTBitmapChar ch216 = { 14, 14, 0, 0, 15, ch216data }; - -static const unsigned char ch217data[] = { - 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, - 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x6,0x0, - 0xc,0x0,0x18,0x0 -}; -static const GLUTBitmapChar ch217 = { 11, 18, -1, 0, 13, ch217data }; - -static const unsigned char ch218data[] = { - 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, - 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0xc,0x0, - 0x6,0x0,0x3,0x0 -}; -static const GLUTBitmapChar ch218 = { 11, 18, -1, 0, 13, ch218data }; - -static const unsigned char ch219data[] = { - 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, - 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, - 0xf,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch219 = { 11, 18, -1, 0, 13, ch219data }; - -static const unsigned char ch220data[] = { - 0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, - 0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, - 0x19,0x80 -}; -static const GLUTBitmapChar ch220 = { 11, 17, -1, 0, 13, ch220data }; - -static const unsigned char ch221data[] = { - 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, - 0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,0x0,0x0,0x6,0x0, - 0x3,0x0,0x1,0x80 -}; -static const GLUTBitmapChar ch221 = { 12, 18, -1, 0, 14, ch221data }; - -static const unsigned char ch222data[] = { - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc1,0xc0,0xff,0x80,0xff,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0 -}; -static const GLUTBitmapChar ch222 = { 10, 14, -1, 0, 12, ch222data }; - -static const unsigned char ch223data[] = { - 0xdc,0xde,0xc6,0xc6,0xc6,0xc6,0xdc,0xdc,0xc6,0xc6,0xc6,0xc6,0x7c,0x38 -}; -static const GLUTBitmapChar ch223 = { 7, 14, -1, 0, 9, ch223data }; - -static const unsigned char ch224data[] = { - 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x18,0x30,0x60 -}; -static const GLUTBitmapChar ch224 = { 7, 14, -1, 0, 9, ch224data }; - -static const unsigned char ch225data[] = { - 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x30,0x18,0xc -}; -static const GLUTBitmapChar ch225 = { 7, 14, -1, 0, 9, ch225data }; - -static const unsigned char ch226data[] = { - 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x66,0x3c,0x18 -}; -static const GLUTBitmapChar ch226 = { 7, 14, -1, 0, 9, ch226data }; - -static const unsigned char ch227data[] = { - 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x4c,0x5a,0x32 -}; -static const GLUTBitmapChar ch227 = { 7, 14, -1, 0, 9, ch227data }; - -static const unsigned char ch228data[] = { - 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x6c,0x6c -}; -static const GLUTBitmapChar ch228 = { 7, 13, -1, 0, 9, ch228data }; - -static const unsigned char ch229data[] = { - 0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x38,0x6c,0x6c,0x38 -}; -static const GLUTBitmapChar ch229 = { 7, 14, -1, 0, 9, ch229data }; - -static const unsigned char ch230data[] = { - 0x75,0xe0,0xef,0xf8,0xc7,0x18,0xc6,0x0,0xe6,0x0,0x7f,0xf8,0xe,0x18,0xc6,0x18, - 0xef,0xf0,0x7d,0xe0 -}; -static const GLUTBitmapChar ch230 = { 13, 10, -1, 0, 15, ch230data }; - -static const unsigned char ch231data[] = { - 0x78,0x6c,0xc,0x38,0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e -}; -static const GLUTBitmapChar ch231 = { 8, 14, -1, 4, 10, ch231data }; - -static const unsigned char ch232data[] = { - 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0x30,0x60 -}; -static const GLUTBitmapChar ch232 = { 8, 14, -1, 0, 10, ch232data }; - -static const unsigned char ch233data[] = { - 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0xc,0x6 -}; -static const GLUTBitmapChar ch233 = { 8, 14, -1, 0, 10, ch233data }; - -static const unsigned char ch234data[] = { - 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x66,0x3c,0x18 -}; -static const GLUTBitmapChar ch234 = { 8, 14, -1, 0, 10, ch234data }; - -static const unsigned char ch235data[] = { - 0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x36,0x36 -}; -static const GLUTBitmapChar ch235 = { 8, 13, -1, 0, 10, ch235data }; - -static const unsigned char ch236data[] = { - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0x30,0x60,0xc0 -}; -static const GLUTBitmapChar ch236 = { 4, 14, 0, 0, 4, ch236data }; - -static const unsigned char ch237data[] = { - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xc0,0x60,0x30 -}; -static const GLUTBitmapChar ch237 = { 4, 14, 0, 0, 4, ch237data }; - -static const unsigned char ch238data[] = { - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,0x78,0x30 -}; -static const GLUTBitmapChar ch238 = { 6, 14, 1, 0, 4, ch238data }; - -static const unsigned char ch239data[] = { - 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xd8,0xd8 -}; -static const GLUTBitmapChar ch239 = { 5, 13, 0, 0, 4, ch239data }; - -static const unsigned char ch240data[] = { - 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, - 0x7f,0x0,0x3e,0x0,0x4c,0x0,0x38,0x0,0x36,0x0,0x60,0x0 -}; -static const GLUTBitmapChar ch240 = { 9, 14, -1, 0, 11, ch240data }; - -static const unsigned char ch241data[] = { - 0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0x0,0x4c,0x5a,0x32 -}; -static const GLUTBitmapChar ch241 = { 8, 14, -1, 0, 10, ch241data }; - -static const unsigned char ch242data[] = { - 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, - 0x7f,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x18,0x0,0x30,0x0 -}; -static const GLUTBitmapChar ch242 = { 9, 14, -1, 0, 11, ch242data }; - -static const unsigned char ch243data[] = { - 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, - 0x7f,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0xc,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch243 = { 9, 14, -1, 0, 11, ch243data }; - -static const unsigned char ch244data[] = { - 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, - 0x7f,0x0,0x3e,0x0,0x0,0x0,0x33,0x0,0x1e,0x0,0xc,0x0 -}; -static const GLUTBitmapChar ch244 = { 9, 14, -1, 0, 11, ch244data }; - -static const unsigned char ch245data[] = { - 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, - 0x7f,0x0,0x3e,0x0,0x0,0x0,0x26,0x0,0x2d,0x0,0x19,0x0 -}; -static const GLUTBitmapChar ch245 = { 9, 14, -1, 0, 11, ch245data }; - -static const unsigned char ch246data[] = { - 0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, - 0x7f,0x0,0x3e,0x0,0x0,0x0,0x36,0x0,0x36,0x0 -}; -static const GLUTBitmapChar ch246 = { 9, 13, -1, 0, 11, ch246data }; - -static const unsigned char ch247data[] = { - 0x18,0x18,0x0,0xff,0xff,0x0,0x18,0x18 -}; -static const GLUTBitmapChar ch247 = { 8, 8, -1, -1, 10, ch247data }; - -static const unsigned char ch248data[] = { - 0xce,0x0,0x7f,0x80,0x31,0x80,0x78,0xc0,0x6c,0xc0,0x66,0xc0,0x63,0xc0,0x31,0x80, - 0x3f,0xc0,0xe,0x60 -}; -static const GLUTBitmapChar ch248 = { 11, 10, 0, 0, 11, ch248data }; - -static const unsigned char ch249data[] = { - 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0xc,0x18,0x30 -}; -static const GLUTBitmapChar ch249 = { 8, 14, -1, 0, 10, ch249data }; - -static const unsigned char ch250data[] = { - 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x18,0xc,0x6 -}; -static const GLUTBitmapChar ch250 = { 8, 14, -1, 0, 10, ch250data }; - -static const unsigned char ch251data[] = { - 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x3c,0x18 -}; -static const GLUTBitmapChar ch251 = { 8, 14, -1, 0, 10, ch251data }; - -static const unsigned char ch252data[] = { - 0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x66 -}; -static const GLUTBitmapChar ch252 = { 8, 13, -1, 0, 10, ch252data }; - -static const unsigned char ch253data[] = { - 0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x18, - 0xc,0x6 -}; -static const GLUTBitmapChar ch253 = { 8, 18, -1, 4, 10, ch253data }; - -static const unsigned char ch254data[] = { - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, - 0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0, - 0xc0,0x0,0xc0,0x0 -}; -static const GLUTBitmapChar ch254 = { 9, 18, -1, 4, 11, ch254data }; - -static const unsigned char ch255data[] = { - 0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x66, - 0x66 -}; -static const GLUTBitmapChar ch255 = { 8, 17, -1, 4, 10, ch255data }; - - -static const GLUTBitmapChar *chars[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, - &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, - &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, - &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, - &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, - &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, - &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, - &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, - &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, - &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, - &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, - &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 -}; - -const GLUTBitmapFont glutBitmapHelvetica18 = { - "-Adobe-Helvetica-Medium-R-Normal--18-180-75-75-P-98-ISO8859-1", - 22, 256, chars -}; diff --git a/src/glut/dos/init.c b/src/glut/dos/init.c deleted file mode 100644 index 3a98dcf0a4..0000000000 --- a/src/glut/dos/init.c +++ /dev/null @@ -1,223 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include -#include -#include -#include - -#include "internal.h" - - -char *__glutProgramName = NULL; - -GLUTvisual _glut_visual = { - 16, 8, 16, 8, 16, /* bpp, alpha, depth, stencil, accum */ - - { 0, 0 }, 0, /* geometry */ - - 0 /* flags */ -}; - -GLUTdefault _glut_default = { - 0, 0, /* glutInitWindowPosition */ - 300, 300, /* glutInitWindowSize */ - 0 /* glutInitDisplayMode */ -}; - -GLuint _glut_fps = 0; - -static char *init_string; - - -void -_glut_fatal (char *format,...) -{ - va_list args; - - va_start(args, format); - fprintf(stderr, "GLUT: Fatal Error in %s: ", - __glutProgramName ? __glutProgramName : "(unamed)"); - vfprintf(stderr, format, args); - va_end(args); - putc('\n', stderr); - exit(1); -} - - -/* strdup is actually not a standard ANSI C or POSIX routine - * so implement a private one for GLUT. - */ -static char * -_glut_strdup (const char *string) -{ - if (string != NULL) { - int len = strlen(string) + 1; - char *p = malloc(len); - if (p != NULL) { - return strcpy(p, string); - } - } - return NULL; -} - - -void APIENTRY -glutInit (int *argc, char **argv) -{ - char *str; - const char *env; - - if ((env = getenv("DMESA_GLUT_BPP")) != NULL) { - _glut_visual.bpp = atoi(env); - } - if ((env = getenv("DMESA_GLUT_ALPHA")) != NULL) { - _glut_visual.alpha = atoi(env); - } - if ((env = getenv("DMESA_GLUT_DEPTH")) != NULL) { - _glut_visual.depth = atoi(env); - } - if ((env = getenv("DMESA_GLUT_STENCIL")) != NULL) { - _glut_visual.stencil = atoi(env); - } - if ((env = getenv("DMESA_GLUT_ACCUM")) != NULL) { - _glut_visual.accum = atoi(env); - } - if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) { - _glut_visual.refresh = atoi(env); - } - - /* Determine program name. */ - str = strrchr(argv[0], '/'); - if (str == NULL) { - str = argv[0]; - } else { - str++; - } - __glutProgramName = _glut_strdup(str); - - /* check if GLUT_FPS env var is set */ - if ((env = getenv("GLUT_FPS")) != NULL) { - if ((_glut_fps = atoi(env)) <= 0) { - _glut_fps = 5000; /* 5000 milliseconds */ - } - } - - /* Initialize timer */ - glutGet(GLUT_ELAPSED_TIME); -} - - -void APIENTRY -glutInitDisplayMode (unsigned int mode) -{ - _glut_default.mode = mode; -} - - -void APIENTRY -glutInitWindowPosition (int x, int y) -{ - _glut_default.x = x; - _glut_default.y = y; -} - - -void APIENTRY -glutInitWindowSize (int width, int height) -{ - _glut_default.width = width; - _glut_default.height = height; -} - - -void APIENTRY -glutInitDisplayString (const char *string) -{ - init_string = _glut_strdup(string); -} - - -void APIENTRY -glutSetOption (GLenum pname, int value) -{ - switch (pname) { - case GLUT_INIT_WINDOW_X: - _glut_default.x = value; - break; - case GLUT_INIT_WINDOW_Y: - _glut_default.y = value; - break; - } -} - - -void APIENTRY -glutForceJoystickFunc (void) -{ -} - - -void APIENTRY -glutIgnoreKeyRepeat (int ignore) -{ -} - - -void APIENTRY -glutSetKeyRepeat (int repeatMode) -{ -} - - -void APIENTRY -glutVideoPan (int x, int y, int w, int h) -{ -} - - -int APIENTRY -glutVideoResizeGet( GLenum eWhat ) -{ - return 0; -} - - -void APIENTRY -glutSetupVideoResizing (void) -{ -} - - -void APIENTRY -glutStopVideoResizing (void) -{ -} - - -void APIENTRY -glutVideoResize (int x, int y, int w, int h) -{ -} diff --git a/src/glut/dos/internal.h b/src/glut/dos/internal.h deleted file mode 100644 index 063c2d00d9..0000000000 --- a/src/glut/dos/internal.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef INTERNAL_H_included -#define INTERNAL_H_included - -#include - -#include "GL/dmesa.h" - - -#define MAX_WINDOWS 2 -#define MAX_TIMER_CB 8 -#define RESERVED_COLORS 0 - - -/* GLUT function types */ -typedef void (GLUTCALLBACK *GLUTdisplayCB) (void); -typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int); -typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int); -typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int); -typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int); -typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int); -typedef void (GLUTCALLBACK *GLUTentryCB) (int); -typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int); -typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int); -typedef void (GLUTCALLBACK *GLUTidleCB) (void); -typedef void (GLUTCALLBACK *GLUTtimerCB) (int); -typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */ -typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTselectCB) (int); -typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int); -typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int); -typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int); -typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int); -typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int); -typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int); -typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int); - -typedef void (GLUTCALLBACK *GLUTdestroyCB) (void); -typedef void (GLUTCALLBACK *GLUTmouseWheelCB) (int, int, int, int); -typedef void (GLUTCALLBACK *GLUTmenuDestroyCB) (void); - - -typedef struct { - GLuint bpp, alpha; - GLuint depth, stencil; - GLuint accum; - - GLint geometry[2]; - GLuint refresh; - - GLint flags; -} GLUTvisual; - -typedef struct { - GLint x, y; - GLint width, height; - GLuint mode; -} GLUTdefault; - -typedef struct { - void (*func) (int); - int value; - int time; -} GLUTSShotCB; - -typedef struct GLUTwindow { - int num; /* window id */ - - DMesaContext context; - DMesaBuffer buffer; - - int show_mouse; - GLboolean redisplay; - - /* GLUT settable or visible window state. */ - int xpos; - int ypos; - int width; /* window width in pixels */ - int height; /* window height in pixels */ - - /* Per-window callbacks. */ - GLUTdisplayCB display; /* redraw */ - GLUTreshapeCB reshape; /* resize (width,height) */ - GLUTmouseCB mouse; /* mouse (button,state,x,y) */ - GLUTmotionCB motion; /* motion (x,y) */ - GLUTpassiveCB passive; /* passive motion (x,y) */ - GLUTentryCB entry; /* window entry/exit (state) */ - GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ - GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */ - GLUTwindowStatusCB windowStatus; /* window status */ - GLUTvisibilityCB visibility; /* visibility */ - GLUTspecialCB special; /* special key */ - GLUTspecialCB specialUp; /* special up key */ - GLUTbuttonBoxCB buttonBox; /* button box */ - GLUTdialsCB dials; /* dials */ - GLUTspaceMotionCB spaceMotion; /* Spaceball motion */ - GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */ - GLUTspaceButtonCB spaceButton; /* Spaceball button */ - GLUTtabletMotionCB tabletMotion; /* tablet motion */ - GLUTtabletButtonCB tabletButton; /* tablet button */ - GLUTjoystickCB joystick; /* joystick */ - - GLUTdestroyCB destroy; /* destroy */ - GLUTmouseWheelCB mouseWheel; /* mouse wheel */ - - /* specific data */ - void *data; -} GLUTwindow; - -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; - -typedef struct { - const GLfloat x, y; -} GLUTStrokeVertex; - -typedef struct { - const unsigned num; - const GLUTStrokeVertex *vertex; -} GLUTStrokeStrip; - -typedef struct { - const GLfloat right; - const unsigned num; - const GLUTStrokeStrip *strip; -} GLUTStrokeChar; - -typedef struct { - const char *name; - const unsigned num; - const GLUTStrokeChar *const *table; - const GLfloat height; - const GLfloat descent; -} GLUTStrokeFont; - - -extern char *__glutProgramName; - -extern GLUTvisual _glut_visual; -extern GLUTdefault _glut_default; - -extern GLuint _glut_fps; -extern GLUTidleCB _glut_idle_func; -extern GLUTmenuStatusCB _glut_menu_status_func; -extern GLUTSShotCB _glut_timer_cb[]; - -extern GLUTwindow *_glut_current, *_glut_windows[]; - -extern int _glut_mouse; /* number of buttons, if mouse installed */ -extern int _glut_mouse_x, _glut_mouse_y; /* mouse coords, relative to current win */ - - -extern void _glut_mouse_init (void); -extern void _glut_fatal(char *format,...); -extern void *_glut_font (void *font); - - -#include "pc_hw/pc_hw.h" - -#endif diff --git a/src/glut/dos/loop.c b/src/glut/dos/loop.c deleted file mode 100644 index 36c3adc3ff..0000000000 --- a/src/glut/dos/loop.c +++ /dev/null @@ -1,245 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include - -#include -#include "GL/dmesa.h" - -#include "PC_HW/pc_hw.h" -#include "internal.h" - - -static int looping = 0; - - -#define DO_REDISPLAY(w, ccin, ccout) \ - do { \ - if (w->redisplay && w->display) { \ - int rv = GL_TRUE; \ - \ - idle = GL_FALSE; \ - w->redisplay = GL_FALSE; \ - \ - /* test IN condition (whether we need to `MakeCurrent') */\ - if (ccin) { \ - rv = DMesaMakeCurrent(w->context, w->buffer); \ - } \ - \ - /* do the display only if `MakeCurrent' didn't failed */ \ - if (rv) { \ - if (w->show_mouse && !(_glut_default.mode & GLUT_DOUBLE)) {\ - /* XXX scare mouse */ \ - w->display(); \ - /* XXX unscare mouse */ \ - } else { \ - w->display(); \ - } \ - \ - /* update OUT condition */ \ - ccout; \ - } \ - } \ - } while (0) - - -void APIENTRY -glutMainLoopEvent (void) -{ - int i, n; - GLUTwindow *w; - GLboolean idle; - static int old_mouse_x = 0; - static int old_mouse_y = 0; - static int old_mouse_b = 0; - - static GLboolean virgin = GL_TRUE; - if (virgin) { - pc_install_keyb(); - _glut_mouse_init(); - - for (i = 0; i < MAX_WINDOWS; i++) { - w = _glut_windows[i]; - if (w != NULL) { - glutSetWindow(w->num); - glutPostRedisplay(); - if (w->reshape) { - w->reshape(w->width, w->height); - } - if (w->visibility) { - w->visibility(GLUT_VISIBLE); - } - } - } - virgin = GL_FALSE; - } - - idle = GL_TRUE; - - n = 0; - for (i = 0; i < MAX_WINDOWS; i++) { - w = _glut_windows[i]; - if ((w != NULL) && (w != _glut_current)) { - /* 1) redisplay `w' - * 2) `MakeCurrent' always - * 3) update number of non-default windows - */ - DO_REDISPLAY(w, GL_TRUE, n++); - } - } - /* 1) redisplay `_glut_current' - * 2) `MakeCurrent' only if we previously did non-default windows - * 3) don't update anything - */ - DO_REDISPLAY(_glut_current, n, n); - - if (_glut_mouse) { - int mouse_x; - int mouse_y; - int mouse_z; - int mouse_b; - - /* query mouse */ - mouse_b = pc_query_mouse(&mouse_x, &mouse_y, &mouse_z); - - /* relative to window coordinates */ - _glut_mouse_x = mouse_x - _glut_current->xpos; - _glut_mouse_y = mouse_y - _glut_current->ypos; - - /* mouse was moved? */ - if ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y)) { - idle = GL_FALSE; - old_mouse_x = mouse_x; - old_mouse_y = mouse_y; - - if (mouse_b) { - /* any button pressed */ - if (_glut_current->motion) { - _glut_current->motion(_glut_mouse_x, _glut_mouse_y); - } - } else { - /* no button pressed */ - if (_glut_current->passive) { - _glut_current->passive(_glut_mouse_x, _glut_mouse_y); - } - } - } - - /* button state changed? */ - if (mouse_b != old_mouse_b) { - GLUTmouseCB mouse_func; - - if ((mouse_func = _glut_current->mouse)) { - if ((old_mouse_b & 1) && !(mouse_b & 1)) - mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, _glut_mouse_x, _glut_mouse_y); - else if (!(old_mouse_b & 1) && (mouse_b & 1)) - mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, _glut_mouse_x, _glut_mouse_y); - - if ((old_mouse_b & 2) && !(mouse_b & 2)) - mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, _glut_mouse_x, _glut_mouse_y); - else if (!(old_mouse_b & 2) && (mouse_b & 2)) - mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, _glut_mouse_x, _glut_mouse_y); - - if ((old_mouse_b & 4) && !(mouse_b & 4)) - mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, _glut_mouse_x, _glut_mouse_y); - else if (!(old_mouse_b & 3) && (mouse_b & 4)) - mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, _glut_mouse_x, _glut_mouse_y); - } - - idle = GL_FALSE; - old_mouse_b = mouse_b; - } - } - - if (pc_keypressed()) { - int key; - int glut_key; - - idle = GL_FALSE; - key = pc_readkey(); - - switch (key>>16) { - case KEY_F1: glut_key = GLUT_KEY_F1; goto special; - case KEY_F2: glut_key = GLUT_KEY_F2; goto special; - case KEY_F3: glut_key = GLUT_KEY_F3; goto special; - case KEY_F4: glut_key = GLUT_KEY_F4; goto special; - case KEY_F5: glut_key = GLUT_KEY_F5; goto special; - case KEY_F6: glut_key = GLUT_KEY_F6; goto special; - case KEY_F7: glut_key = GLUT_KEY_F7; goto special; - case KEY_F8: glut_key = GLUT_KEY_F8; goto special; - case KEY_F9: glut_key = GLUT_KEY_F9; goto special; - case KEY_F10: glut_key = GLUT_KEY_F10; goto special; - case KEY_F11: glut_key = GLUT_KEY_F11; goto special; - case KEY_F12: glut_key = GLUT_KEY_F12; goto special; - case KEY_LEFT: glut_key = GLUT_KEY_LEFT; goto special; - case KEY_UP: glut_key = GLUT_KEY_UP; goto special; - case KEY_RIGHT: glut_key = GLUT_KEY_RIGHT; goto special; - case KEY_DOWN: glut_key = GLUT_KEY_DOWN; goto special; - case KEY_PGUP: glut_key = GLUT_KEY_PAGE_UP; goto special; - case KEY_PGDN: glut_key = GLUT_KEY_PAGE_DOWN; goto special; - case KEY_HOME: glut_key = GLUT_KEY_HOME; goto special; - case KEY_END: glut_key = GLUT_KEY_END; goto special; - case KEY_INSERT: glut_key = GLUT_KEY_INSERT; goto special; - special: - if (_glut_current->special) { - _glut_current->special(glut_key, _glut_mouse_x, _glut_mouse_y); - } - break; - default: - if (_glut_current->keyboard) { - _glut_current->keyboard(key & 0xFF, _glut_mouse_x, _glut_mouse_y); - } - } - } - - if (idle && _glut_idle_func) - _glut_idle_func(); - - for (i = 0; i < MAX_TIMER_CB; i++) { - int time = glutGet(GLUT_ELAPSED_TIME); - GLUTSShotCB *cb = &_glut_timer_cb[i]; - if (cb->func && (time >= cb->time)) { - cb->func(cb->value); - cb->func = NULL; - } - } -} - - -void APIENTRY -glutMainLoop (void) -{ - looping++; - while (looping) { - glutMainLoopEvent(); - } -} - - -void APIENTRY -glutLeaveMainLoop (void) -{ - looping--; -} diff --git a/src/glut/dos/menu.c b/src/glut/dos/menu.c deleted file mode 100644 index 857d2b4a46..0000000000 --- a/src/glut/dos/menu.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "internal.h" - - -GLUTmenuStatusCB _glut_menu_status_func = NULL; - - -void APIENTRY -glutMenuStateFunc (GLUTmenuStateCB func) -{ - _glut_menu_status_func = (GLUTmenuStatusCB)func; -} - - -void APIENTRY -glutMenuStatusFunc (GLUTmenuStatusCB func) -{ - _glut_menu_status_func = func; -} - - -int APIENTRY -glutCreateMenu (GLUTselectCB func) -{ - return 0; -} - - -void APIENTRY -glutDestroyMenu (int menu) -{ -} - - -int APIENTRY -glutGetMenu (void) -{ - return 0; -} - - -void APIENTRY -glutSetMenu (int menu) -{ -} - - -void APIENTRY -glutAddMenuEntry (const char *label, int value) -{ -} - - -void APIENTRY -glutAddSubMenu (const char *label, int submenu) -{ -} - - -void APIENTRY -glutChangeToMenuEntry (int item, const char *label, int value) -{ -} - - -void APIENTRY -glutChangeToSubMenu (int item, const char *label, int submenu) -{ -} - - -void APIENTRY -glutRemoveMenuItem (int item) -{ -} - - -void APIENTRY -glutAttachMenu (int button) -{ -} - - -void APIENTRY -glutDetachMenu (int button) -{ -} - - -void APIENTRY -glutMenuDestroyFunc ( void (* callback)( void ) ) -{ -} - - -void * APIENTRY -glutGetMenuData (void) -{ - return NULL; -} - - -void APIENTRY -glutSetMenuData (void *data) -{ -} diff --git a/src/glut/dos/mouse.c b/src/glut/dos/mouse.c deleted file mode 100644 index 945e2a5c14..0000000000 --- a/src/glut/dos/mouse.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "internal.h" - - -int _glut_mouse; -int _glut_mouse_x = 0, _glut_mouse_y = 0; - - -void -_glut_mouse_init (void) -{ - if ((_glut_mouse = pc_install_mouse())) { - pc_mouse_area(_glut_current->xpos, _glut_current->ypos, _glut_current->xpos + _glut_current->width - 1, _glut_current->ypos + _glut_current->height - 1); - - _glut_current->show_mouse = (_glut_current->mouse || _glut_current->motion || _glut_current->passive); - } -} - - -void APIENTRY -glutSetCursor (int cursor) -{ - /* XXX completely futile until full mouse support (maybe never) */ -} - - -void APIENTRY -glutWarpPointer (int x, int y) -{ - pc_warp_mouse(x, y); -} diff --git a/src/glut/dos/mroman.c b/src/glut/dos/mroman.c deleted file mode 100644 index 137458b754..0000000000 --- a/src/glut/dos/mroman.c +++ /dev/null @@ -1,2779 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#include "internal.h" - -/* char: 0x20 */ - -static const GLUTStrokeChar ch32 = {104.7619f,0,NULL}; - -/* char: 0x21 */ - -static const GLUTStrokeVertex ch33st0[] = -{ - {52.3810f,100.0000f}, - {52.3810f,33.3333f} -}; - -static const GLUTStrokeVertex ch33st1[] = -{ - {52.3810f,9.5238f}, - {47.6191f,4.7619f}, - {52.3810f,0.0000f}, - {57.1429f,4.7619f}, - {52.3810f,9.5238f} -}; - -static const GLUTStrokeStrip ch33st[] = -{ - {2,ch33st0}, - {5,ch33st1} -}; - -static const GLUTStrokeChar ch33 = {104.7619f,2,ch33st}; - -/* char: 0x22 */ - -static const GLUTStrokeVertex ch34st0[] = -{ - {33.3334f,100.0000f}, - {33.3334f,66.6667f} -}; - -static const GLUTStrokeVertex ch34st1[] = -{ - {71.4286f,100.0000f}, - {71.4286f,66.6667f} -}; - -static const GLUTStrokeStrip ch34st[] = -{ - {2,ch34st0}, - {2,ch34st1} -}; - -static const GLUTStrokeChar ch34 = {104.7619f,2,ch34st}; - -/* char: 0x23 */ - -static const GLUTStrokeVertex ch35st0[] = -{ - {54.7619f,119.0476f}, - {21.4286f,-33.3333f} -}; - -static const GLUTStrokeVertex ch35st1[] = -{ - {83.3334f,119.0476f}, - {50.0000f,-33.3333f} -}; - -static const GLUTStrokeVertex ch35st2[] = -{ - {21.4286f,57.1429f}, - {88.0952f,57.1429f} -}; - -static const GLUTStrokeVertex ch35st3[] = -{ - {16.6667f,28.5714f}, - {83.3334f,28.5714f} -}; - -static const GLUTStrokeStrip ch35st[] = -{ - {2,ch35st0}, - {2,ch35st1}, - {2,ch35st2}, - {2,ch35st3} -}; - -static const GLUTStrokeChar ch35 = {104.7619f,4,ch35st}; - -/* char: 0x24 */ - -static const GLUTStrokeVertex ch36st0[] = -{ - {42.8571f,119.0476f}, - {42.8571f,-19.0476f} -}; - -static const GLUTStrokeVertex ch36st1[] = -{ - {61.9047f,119.0476f}, - {61.9047f,-19.0476f} -}; - -static const GLUTStrokeVertex ch36st2[] = -{ - {85.7143f,85.7143f}, - {76.1905f,95.2381f}, - {61.9047f,100.0000f}, - {42.8571f,100.0000f}, - {28.5714f,95.2381f}, - {19.0476f,85.7143f}, - {19.0476f,76.1905f}, - {23.8095f,66.6667f}, - {28.5714f,61.9048f}, - {38.0952f,57.1429f}, - {66.6666f,47.6190f}, - {76.1905f,42.8571f}, - {80.9524f,38.0952f}, - {85.7143f,28.5714f}, - {85.7143f,14.2857f}, - {76.1905f,4.7619f}, - {61.9047f,0.0000f}, - {42.8571f,0.0000f}, - {28.5714f,4.7619f}, - {19.0476f,14.2857f} -}; - -static const GLUTStrokeStrip ch36st[] = -{ - {2,ch36st0}, - {2,ch36st1}, - {20,ch36st2} -}; - -static const GLUTStrokeChar ch36 = {104.7619f,3,ch36st}; - -/* char: 0x25 */ - -static const GLUTStrokeVertex ch37st0[] = -{ - {95.2381f,100.0000f}, - {9.5238f,0.0000f} -}; - -static const GLUTStrokeVertex ch37st1[] = -{ - {33.3333f,100.0000f}, - {42.8571f,90.4762f}, - {42.8571f,80.9524f}, - {38.0952f,71.4286f}, - {28.5714f,66.6667f}, - {19.0476f,66.6667f}, - {9.5238f,76.1905f}, - {9.5238f,85.7143f}, - {14.2857f,95.2381f}, - {23.8095f,100.0000f}, - {33.3333f,100.0000f}, - {42.8571f,95.2381f}, - {57.1428f,90.4762f}, - {71.4286f,90.4762f}, - {85.7143f,95.2381f}, - {95.2381f,100.0000f} -}; - -static const GLUTStrokeVertex ch37st2[] = -{ - {76.1905f,33.3333f}, - {66.6667f,28.5714f}, - {61.9048f,19.0476f}, - {61.9048f,9.5238f}, - {71.4286f,0.0000f}, - {80.9524f,0.0000f}, - {90.4762f,4.7619f}, - {95.2381f,14.2857f}, - {95.2381f,23.8095f}, - {85.7143f,33.3333f}, - {76.1905f,33.3333f} -}; - -static const GLUTStrokeStrip ch37st[] = -{ - {2,ch37st0}, - {16,ch37st1}, - {11,ch37st2} -}; - -static const GLUTStrokeChar ch37 = {104.7619f,3,ch37st}; - -/* char: 0x26 */ - -static const GLUTStrokeVertex ch38st0[] = -{ - {100.0000f,57.1429f}, - {100.0000f,61.9048f}, - {95.2381f,66.6667f}, - {90.4762f,66.6667f}, - {85.7143f,61.9048f}, - {80.9524f,52.3810f}, - {71.4286f,28.5714f}, - {61.9048f,14.2857f}, - {52.3809f,4.7619f}, - {42.8571f,0.0000f}, - {23.8095f,0.0000f}, - {14.2857f,4.7619f}, - {9.5238f,9.5238f}, - {4.7619f,19.0476f}, - {4.7619f,28.5714f}, - {9.5238f,38.0952f}, - {14.2857f,42.8571f}, - {47.6190f,61.9048f}, - {52.3809f,66.6667f}, - {57.1429f,76.1905f}, - {57.1429f,85.7143f}, - {52.3809f,95.2381f}, - {42.8571f,100.0000f}, - {33.3333f,95.2381f}, - {28.5714f,85.7143f}, - {28.5714f,76.1905f}, - {33.3333f,61.9048f}, - {42.8571f,47.6190f}, - {66.6667f,14.2857f}, - {76.1905f,4.7619f}, - {85.7143f,0.0000f}, - {95.2381f,0.0000f}, - {100.0000f,4.7619f}, - {100.0000f,9.5238f} -}; - -static const GLUTStrokeStrip ch38st[] = -{ - {34,ch38st0} -}; - -static const GLUTStrokeChar ch38 = {104.7619f,1,ch38st}; - -/* char: 0x27 */ - -static const GLUTStrokeVertex ch39st0[] = -{ - {52.3810f,100.0000f}, - {52.3810f,66.6667f} -}; - -static const GLUTStrokeStrip ch39st[] = -{ - {2,ch39st0} -}; - -static const GLUTStrokeChar ch39 = {104.7619f,1,ch39st}; - -/* char: 0x28 */ - -static const GLUTStrokeVertex ch40st0[] = -{ - {69.0476f,119.0476f}, - {59.5238f,109.5238f}, - {50.0000f,95.2381f}, - {40.4762f,76.1905f}, - {35.7143f,52.3810f}, - {35.7143f,33.3333f}, - {40.4762f,9.5238f}, - {50.0000f,-9.5238f}, - {59.5238f,-23.8095f}, - {69.0476f,-33.3333f} -}; - -static const GLUTStrokeStrip ch40st[] = -{ - {10,ch40st0} -}; - -static const GLUTStrokeChar ch40 = {104.7619f,1,ch40st}; - -/* char: 0x29 */ - -static const GLUTStrokeVertex ch41st0[] = -{ - {35.7143f,119.0476f}, - {45.2381f,109.5238f}, - {54.7619f,95.2381f}, - {64.2857f,76.1905f}, - {69.0476f,52.3810f}, - {69.0476f,33.3333f}, - {64.2857f,9.5238f}, - {54.7619f,-9.5238f}, - {45.2381f,-23.8095f}, - {35.7143f,-33.3333f} -}; - -static const GLUTStrokeStrip ch41st[] = -{ - {10,ch41st0} -}; - -static const GLUTStrokeChar ch41 = {104.7619f,1,ch41st}; - -/* char: 0x2a */ - -static const GLUTStrokeVertex ch42st0[] = -{ - {52.3810f,71.4286f}, - {52.3810f,14.2857f} -}; - -static const GLUTStrokeVertex ch42st1[] = -{ - {28.5715f,57.1429f}, - {76.1905f,28.5714f} -}; - -static const GLUTStrokeVertex ch42st2[] = -{ - {76.1905f,57.1429f}, - {28.5715f,28.5714f} -}; - -static const GLUTStrokeStrip ch42st[] = -{ - {2,ch42st0}, - {2,ch42st1}, - {2,ch42st2} -}; - -static const GLUTStrokeChar ch42 = {104.7619f,3,ch42st}; - -/* char: 0x2b */ - -static const GLUTStrokeVertex ch43st0[] = -{ - {52.3809f,85.7143f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeVertex ch43st1[] = -{ - {9.5238f,42.8571f}, - {95.2381f,42.8571f} -}; - -static const GLUTStrokeStrip ch43st[] = -{ - {2,ch43st0}, - {2,ch43st1} -}; - -static const GLUTStrokeChar ch43 = {104.7619f,2,ch43st}; - -/* char: 0x2c */ - -static const GLUTStrokeVertex ch44st0[] = -{ - {57.1429f,4.7619f}, - {52.3810f,0.0000f}, - {47.6191f,4.7619f}, - {52.3810f,9.5238f}, - {57.1429f,4.7619f}, - {57.1429f,-4.7619f}, - {52.3810f,-14.2857f}, - {47.6191f,-19.0476f} -}; - -static const GLUTStrokeStrip ch44st[] = -{ - {8,ch44st0} -}; - -static const GLUTStrokeChar ch44 = {104.7619f,1,ch44st}; - -/* char: 0x2d */ - -static const GLUTStrokeVertex ch45st0[] = -{ - {9.5238f,42.8571f}, - {95.2381f,42.8571f} -}; - -static const GLUTStrokeStrip ch45st[] = -{ - {2,ch45st0} -}; - -static const GLUTStrokeChar ch45 = {104.7619f,1,ch45st}; - -/* char: 0x2e */ - -static const GLUTStrokeVertex ch46st0[] = -{ - {52.3810f,9.5238f}, - {47.6191f,4.7619f}, - {52.3810f,0.0000f}, - {57.1429f,4.7619f}, - {52.3810f,9.5238f} -}; - -static const GLUTStrokeStrip ch46st[] = -{ - {5,ch46st0} -}; - -static const GLUTStrokeChar ch46 = {104.7619f,1,ch46st}; - -/* char: 0x2f */ - -static const GLUTStrokeVertex ch47st0[] = -{ - {19.0476f,-14.2857f}, - {85.7143f,100.0000f} -}; - -static const GLUTStrokeStrip ch47st[] = -{ - {2,ch47st0} -}; - -static const GLUTStrokeChar ch47 = {104.7619f,1,ch47st}; - -/* char: 0x30 */ - -static const GLUTStrokeVertex ch48st0[] = -{ - {47.6190f,100.0000f}, - {33.3333f,95.2381f}, - {23.8095f,80.9524f}, - {19.0476f,57.1429f}, - {19.0476f,42.8571f}, - {23.8095f,19.0476f}, - {33.3333f,4.7619f}, - {47.6190f,0.0000f}, - {57.1428f,0.0000f}, - {71.4286f,4.7619f}, - {80.9524f,19.0476f}, - {85.7143f,42.8571f}, - {85.7143f,57.1429f}, - {80.9524f,80.9524f}, - {71.4286f,95.2381f}, - {57.1428f,100.0000f}, - {47.6190f,100.0000f} -}; - -static const GLUTStrokeStrip ch48st[] = -{ - {17,ch48st0} -}; - -static const GLUTStrokeChar ch48 = {104.7619f,1,ch48st}; - -/* char: 0x31 */ - -static const GLUTStrokeVertex ch49st0[] = -{ - {40.4762f,80.9524f}, - {50.0000f,85.7143f}, - {64.2857f,100.0000f}, - {64.2857f,0.0000f} -}; - -static const GLUTStrokeStrip ch49st[] = -{ - {4,ch49st0} -}; - -static const GLUTStrokeChar ch49 = {104.7619f,1,ch49st}; - -/* char: 0x32 */ - -static const GLUTStrokeVertex ch50st0[] = -{ - {23.8095f,76.1905f}, - {23.8095f,80.9524f}, - {28.5714f,90.4762f}, - {33.3333f,95.2381f}, - {42.8571f,100.0000f}, - {61.9047f,100.0000f}, - {71.4286f,95.2381f}, - {76.1905f,90.4762f}, - {80.9524f,80.9524f}, - {80.9524f,71.4286f}, - {76.1905f,61.9048f}, - {66.6666f,47.6190f}, - {19.0476f,0.0000f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeStrip ch50st[] = -{ - {14,ch50st0} -}; - -static const GLUTStrokeChar ch50 = {104.7619f,1,ch50st}; - -/* char: 0x33 */ - -static const GLUTStrokeVertex ch51st0[] = -{ - {28.5714f,100.0000f}, - {80.9524f,100.0000f}, - {52.3809f,61.9048f}, - {66.6666f,61.9048f}, - {76.1905f,57.1429f}, - {80.9524f,52.3810f}, - {85.7143f,38.0952f}, - {85.7143f,28.5714f}, - {80.9524f,14.2857f}, - {71.4286f,4.7619f}, - {57.1428f,0.0000f}, - {42.8571f,0.0000f}, - {28.5714f,4.7619f}, - {23.8095f,9.5238f}, - {19.0476f,19.0476f} -}; - -static const GLUTStrokeStrip ch51st[] = -{ - {15,ch51st0} -}; - -static const GLUTStrokeChar ch51 = {104.7619f,1,ch51st}; - -/* char: 0x34 */ - -static const GLUTStrokeVertex ch52st0[] = -{ - {64.2857f,100.0000f}, - {16.6667f,33.3333f}, - {88.0952f,33.3333f} -}; - -static const GLUTStrokeVertex ch52st1[] = -{ - {64.2857f,100.0000f}, - {64.2857f,0.0000f} -}; - -static const GLUTStrokeStrip ch52st[] = -{ - {3,ch52st0}, - {2,ch52st1} -}; - -static const GLUTStrokeChar ch52 = {104.7619f,2,ch52st}; - -/* char: 0x35 */ - -static const GLUTStrokeVertex ch53st0[] = -{ - {76.1905f,100.0000f}, - {28.5714f,100.0000f}, - {23.8095f,57.1429f}, - {28.5714f,61.9048f}, - {42.8571f,66.6667f}, - {57.1428f,66.6667f}, - {71.4286f,61.9048f}, - {80.9524f,52.3810f}, - {85.7143f,38.0952f}, - {85.7143f,28.5714f}, - {80.9524f,14.2857f}, - {71.4286f,4.7619f}, - {57.1428f,0.0000f}, - {42.8571f,0.0000f}, - {28.5714f,4.7619f}, - {23.8095f,9.5238f}, - {19.0476f,19.0476f} -}; - -static const GLUTStrokeStrip ch53st[] = -{ - {17,ch53st0} -}; - -static const GLUTStrokeChar ch53 = {104.7619f,1,ch53st}; - -/* char: 0x36 */ - -static const GLUTStrokeVertex ch54st0[] = -{ - {78.5714f,85.7143f}, - {73.8096f,95.2381f}, - {59.5238f,100.0000f}, - {50.0000f,100.0000f}, - {35.7143f,95.2381f}, - {26.1905f,80.9524f}, - {21.4286f,57.1429f}, - {21.4286f,33.3333f}, - {26.1905f,14.2857f}, - {35.7143f,4.7619f}, - {50.0000f,0.0000f}, - {54.7619f,0.0000f}, - {69.0476f,4.7619f}, - {78.5714f,14.2857f}, - {83.3334f,28.5714f}, - {83.3334f,33.3333f}, - {78.5714f,47.6190f}, - {69.0476f,57.1429f}, - {54.7619f,61.9048f}, - {50.0000f,61.9048f}, - {35.7143f,57.1429f}, - {26.1905f,47.6190f}, - {21.4286f,33.3333f} -}; - -static const GLUTStrokeStrip ch54st[] = -{ - {23,ch54st0} -}; - -static const GLUTStrokeChar ch54 = {104.7619f,1,ch54st}; - -/* char: 0x37 */ - -static const GLUTStrokeVertex ch55st0[] = -{ - {85.7143f,100.0000f}, - {38.0952f,0.0000f} -}; - -static const GLUTStrokeVertex ch55st1[] = -{ - {19.0476f,100.0000f}, - {85.7143f,100.0000f} -}; - -static const GLUTStrokeStrip ch55st[] = -{ - {2,ch55st0}, - {2,ch55st1} -}; - -static const GLUTStrokeChar ch55 = {104.7619f,2,ch55st}; - -/* char: 0x38 */ - -static const GLUTStrokeVertex ch56st0[] = -{ - {42.8571f,100.0000f}, - {28.5714f,95.2381f}, - {23.8095f,85.7143f}, - {23.8095f,76.1905f}, - {28.5714f,66.6667f}, - {38.0952f,61.9048f}, - {57.1428f,57.1429f}, - {71.4286f,52.3810f}, - {80.9524f,42.8571f}, - {85.7143f,33.3333f}, - {85.7143f,19.0476f}, - {80.9524f,9.5238f}, - {76.1905f,4.7619f}, - {61.9047f,0.0000f}, - {42.8571f,0.0000f}, - {28.5714f,4.7619f}, - {23.8095f,9.5238f}, - {19.0476f,19.0476f}, - {19.0476f,33.3333f}, - {23.8095f,42.8571f}, - {33.3333f,52.3810f}, - {47.6190f,57.1429f}, - {66.6666f,61.9048f}, - {76.1905f,66.6667f}, - {80.9524f,76.1905f}, - {80.9524f,85.7143f}, - {76.1905f,95.2381f}, - {61.9047f,100.0000f}, - {42.8571f,100.0000f} -}; - -static const GLUTStrokeStrip ch56st[] = -{ - {29,ch56st0} -}; - -static const GLUTStrokeChar ch56 = {104.7619f,1,ch56st}; - -/* char: 0x39 */ - -static const GLUTStrokeVertex ch57st0[] = -{ - {83.3334f,66.6667f}, - {78.5714f,52.3810f}, - {69.0476f,42.8571f}, - {54.7619f,38.0952f}, - {50.0000f,38.0952f}, - {35.7143f,42.8571f}, - {26.1905f,52.3810f}, - {21.4286f,66.6667f}, - {21.4286f,71.4286f}, - {26.1905f,85.7143f}, - {35.7143f,95.2381f}, - {50.0000f,100.0000f}, - {54.7619f,100.0000f}, - {69.0476f,95.2381f}, - {78.5714f,85.7143f}, - {83.3334f,66.6667f}, - {83.3334f,42.8571f}, - {78.5714f,19.0476f}, - {69.0476f,4.7619f}, - {54.7619f,0.0000f}, - {45.2381f,0.0000f}, - {30.9524f,4.7619f}, - {26.1905f,14.2857f} -}; - -static const GLUTStrokeStrip ch57st[] = -{ - {23,ch57st0} -}; - -static const GLUTStrokeChar ch57 = {104.7619f,1,ch57st}; - -/* char: 0x3a */ - -static const GLUTStrokeVertex ch58st0[] = -{ - {52.3810f,66.6667f}, - {47.6191f,61.9048f}, - {52.3810f,57.1429f}, - {57.1429f,61.9048f}, - {52.3810f,66.6667f} -}; - -static const GLUTStrokeVertex ch58st1[] = -{ - {52.3810f,9.5238f}, - {47.6191f,4.7619f}, - {52.3810f,0.0000f}, - {57.1429f,4.7619f}, - {52.3810f,9.5238f} -}; - -static const GLUTStrokeStrip ch58st[] = -{ - {5,ch58st0}, - {5,ch58st1} -}; - -static const GLUTStrokeChar ch58 = {104.7619f,2,ch58st}; - -/* char: 0x3b */ - -static const GLUTStrokeVertex ch59st0[] = -{ - {52.3810f,66.6667f}, - {47.6191f,61.9048f}, - {52.3810f,57.1429f}, - {57.1429f,61.9048f}, - {52.3810f,66.6667f} -}; - -static const GLUTStrokeVertex ch59st1[] = -{ - {57.1429f,4.7619f}, - {52.3810f,0.0000f}, - {47.6191f,4.7619f}, - {52.3810f,9.5238f}, - {57.1429f,4.7619f}, - {57.1429f,-4.7619f}, - {52.3810f,-14.2857f}, - {47.6191f,-19.0476f} -}; - -static const GLUTStrokeStrip ch59st[] = -{ - {5,ch59st0}, - {8,ch59st1} -}; - -static const GLUTStrokeChar ch59 = {104.7619f,2,ch59st}; - -/* char: 0x3c */ - -static const GLUTStrokeVertex ch60st0[] = -{ - {90.4762f,85.7143f}, - {14.2857f,42.8571f}, - {90.4762f,0.0000f} -}; - -static const GLUTStrokeStrip ch60st[] = -{ - {3,ch60st0} -}; - -static const GLUTStrokeChar ch60 = {104.7619f,1,ch60st}; - -/* char: 0x3d */ - -static const GLUTStrokeVertex ch61st0[] = -{ - {9.5238f,57.1429f}, - {95.2381f,57.1429f} -}; - -static const GLUTStrokeVertex ch61st1[] = -{ - {9.5238f,28.5714f}, - {95.2381f,28.5714f} -}; - -static const GLUTStrokeStrip ch61st[] = -{ - {2,ch61st0}, - {2,ch61st1} -}; - -static const GLUTStrokeChar ch61 = {104.7619f,2,ch61st}; - -/* char: 0x3e */ - -static const GLUTStrokeVertex ch62st0[] = -{ - {14.2857f,85.7143f}, - {90.4762f,42.8571f}, - {14.2857f,0.0000f} -}; - -static const GLUTStrokeStrip ch62st[] = -{ - {3,ch62st0} -}; - -static const GLUTStrokeChar ch62 = {104.7619f,1,ch62st}; - -/* char: 0x3f */ - -static const GLUTStrokeVertex ch63st0[] = -{ - {23.8095f,76.1905f}, - {23.8095f,80.9524f}, - {28.5714f,90.4762f}, - {33.3333f,95.2381f}, - {42.8571f,100.0000f}, - {61.9047f,100.0000f}, - {71.4285f,95.2381f}, - {76.1905f,90.4762f}, - {80.9524f,80.9524f}, - {80.9524f,71.4286f}, - {76.1905f,61.9048f}, - {71.4285f,57.1429f}, - {52.3809f,47.6190f}, - {52.3809f,33.3333f} -}; - -static const GLUTStrokeVertex ch63st1[] = -{ - {52.3809f,9.5238f}, - {47.6190f,4.7619f}, - {52.3809f,0.0000f}, - {57.1428f,4.7619f}, - {52.3809f,9.5238f} -}; - -static const GLUTStrokeStrip ch63st[] = -{ - {14,ch63st0}, - {5,ch63st1} -}; - -static const GLUTStrokeChar ch63 = {104.7619f,2,ch63st}; - -/* char: 0x40 */ - -static const GLUTStrokeVertex ch64st0[] = -{ - {64.2857f,52.3810f}, - {54.7619f,57.1429f}, - {45.2381f,57.1429f}, - {40.4762f,47.6190f}, - {40.4762f,42.8571f}, - {45.2381f,33.3333f}, - {54.7619f,33.3333f}, - {64.2857f,38.0952f} -}; - -static const GLUTStrokeVertex ch64st1[] = -{ - {64.2857f,57.1429f}, - {64.2857f,38.0952f}, - {69.0476f,33.3333f}, - {78.5714f,33.3333f}, - {83.3334f,42.8571f}, - {83.3334f,47.6190f}, - {78.5714f,61.9048f}, - {69.0476f,71.4286f}, - {54.7619f,76.1905f}, - {50.0000f,76.1905f}, - {35.7143f,71.4286f}, - {26.1905f,61.9048f}, - {21.4286f,47.6190f}, - {21.4286f,42.8571f}, - {26.1905f,28.5714f}, - {35.7143f,19.0476f}, - {50.0000f,14.2857f}, - {54.7619f,14.2857f}, - {69.0476f,19.0476f} -}; - -static const GLUTStrokeStrip ch64st[] = -{ - {8,ch64st0}, - {19,ch64st1} -}; - -static const GLUTStrokeChar ch64 = {104.7619f,2,ch64st}; - -/* char: 0x41 */ - -static const GLUTStrokeVertex ch65st0[] = -{ - {52.3809f,100.0000f}, - {14.2857f,0.0000f} -}; - -static const GLUTStrokeVertex ch65st1[] = -{ - {52.3809f,100.0000f}, - {90.4762f,0.0000f} -}; - -static const GLUTStrokeVertex ch65st2[] = -{ - {28.5714f,33.3333f}, - {76.1905f,33.3333f} -}; - -static const GLUTStrokeStrip ch65st[] = -{ - {2,ch65st0}, - {2,ch65st1}, - {2,ch65st2} -}; - -static const GLUTStrokeChar ch65 = {104.7619f,3,ch65st}; - -/* char: 0x42 */ - -static const GLUTStrokeVertex ch66st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch66st1[] = -{ - {19.0476f,100.0000f}, - {61.9047f,100.0000f}, - {76.1905f,95.2381f}, - {80.9524f,90.4762f}, - {85.7143f,80.9524f}, - {85.7143f,71.4286f}, - {80.9524f,61.9048f}, - {76.1905f,57.1429f}, - {61.9047f,52.3810f} -}; - -static const GLUTStrokeVertex ch66st2[] = -{ - {19.0476f,52.3810f}, - {61.9047f,52.3810f}, - {76.1905f,47.6190f}, - {80.9524f,42.8571f}, - {85.7143f,33.3333f}, - {85.7143f,19.0476f}, - {80.9524f,9.5238f}, - {76.1905f,4.7619f}, - {61.9047f,0.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeStrip ch66st[] = -{ - {2,ch66st0}, - {9,ch66st1}, - {10,ch66st2} -}; - -static const GLUTStrokeChar ch66 = {104.7619f,3,ch66st}; - -/* char: 0x43 */ - -static const GLUTStrokeVertex ch67st0[] = -{ - {88.0952f,76.1905f}, - {83.3334f,85.7143f}, - {73.8096f,95.2381f}, - {64.2857f,100.0000f}, - {45.2381f,100.0000f}, - {35.7143f,95.2381f}, - {26.1905f,85.7143f}, - {21.4286f,76.1905f}, - {16.6667f,61.9048f}, - {16.6667f,38.0952f}, - {21.4286f,23.8095f}, - {26.1905f,14.2857f}, - {35.7143f,4.7619f}, - {45.2381f,0.0000f}, - {64.2857f,0.0000f}, - {73.8096f,4.7619f}, - {83.3334f,14.2857f}, - {88.0952f,23.8095f} -}; - -static const GLUTStrokeStrip ch67st[] = -{ - {18,ch67st0} -}; - -static const GLUTStrokeChar ch67 = {104.7619f,1,ch67st}; - -/* char: 0x44 */ - -static const GLUTStrokeVertex ch68st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch68st1[] = -{ - {19.0476f,100.0000f}, - {52.3809f,100.0000f}, - {66.6666f,95.2381f}, - {76.1905f,85.7143f}, - {80.9524f,76.1905f}, - {85.7143f,61.9048f}, - {85.7143f,38.0952f}, - {80.9524f,23.8095f}, - {76.1905f,14.2857f}, - {66.6666f,4.7619f}, - {52.3809f,0.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeStrip ch68st[] = -{ - {2,ch68st0}, - {12,ch68st1} -}; - -static const GLUTStrokeChar ch68 = {104.7619f,2,ch68st}; - -/* char: 0x45 */ - -static const GLUTStrokeVertex ch69st0[] = -{ - {21.4286f,100.0000f}, - {21.4286f,0.0000f} -}; - -static const GLUTStrokeVertex ch69st1[] = -{ - {21.4286f,100.0000f}, - {83.3334f,100.0000f} -}; - -static const GLUTStrokeVertex ch69st2[] = -{ - {21.4286f,52.3810f}, - {59.5238f,52.3810f} -}; - -static const GLUTStrokeVertex ch69st3[] = -{ - {21.4286f,0.0000f}, - {83.3334f,0.0000f} -}; - -static const GLUTStrokeStrip ch69st[] = -{ - {2,ch69st0}, - {2,ch69st1}, - {2,ch69st2}, - {2,ch69st3} -}; - -static const GLUTStrokeChar ch69 = {104.7619f,4,ch69st}; - -/* char: 0x46 */ - -static const GLUTStrokeVertex ch70st0[] = -{ - {21.4286f,100.0000f}, - {21.4286f,0.0000f} -}; - -static const GLUTStrokeVertex ch70st1[] = -{ - {21.4286f,100.0000f}, - {83.3334f,100.0000f} -}; - -static const GLUTStrokeVertex ch70st2[] = -{ - {21.4286f,52.3810f}, - {59.5238f,52.3810f} -}; - -static const GLUTStrokeStrip ch70st[] = -{ - {2,ch70st0}, - {2,ch70st1}, - {2,ch70st2} -}; - -static const GLUTStrokeChar ch70 = {104.7619f,3,ch70st}; - -/* char: 0x47 */ - -static const GLUTStrokeVertex ch71st0[] = -{ - {88.0952f,76.1905f}, - {83.3334f,85.7143f}, - {73.8096f,95.2381f}, - {64.2857f,100.0000f}, - {45.2381f,100.0000f}, - {35.7143f,95.2381f}, - {26.1905f,85.7143f}, - {21.4286f,76.1905f}, - {16.6667f,61.9048f}, - {16.6667f,38.0952f}, - {21.4286f,23.8095f}, - {26.1905f,14.2857f}, - {35.7143f,4.7619f}, - {45.2381f,0.0000f}, - {64.2857f,0.0000f}, - {73.8096f,4.7619f}, - {83.3334f,14.2857f}, - {88.0952f,23.8095f}, - {88.0952f,38.0952f} -}; - -static const GLUTStrokeVertex ch71st1[] = -{ - {64.2857f,38.0952f}, - {88.0952f,38.0952f} -}; - -static const GLUTStrokeStrip ch71st[] = -{ - {19,ch71st0}, - {2,ch71st1} -}; - -static const GLUTStrokeChar ch71 = {104.7619f,2,ch71st}; - -/* char: 0x48 */ - -static const GLUTStrokeVertex ch72st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch72st1[] = -{ - {85.7143f,100.0000f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeVertex ch72st2[] = -{ - {19.0476f,52.3810f}, - {85.7143f,52.3810f} -}; - -static const GLUTStrokeStrip ch72st[] = -{ - {2,ch72st0}, - {2,ch72st1}, - {2,ch72st2} -}; - -static const GLUTStrokeChar ch72 = {104.7619f,3,ch72st}; - -/* char: 0x49 */ - -static const GLUTStrokeVertex ch73st0[] = -{ - {52.3810f,100.0000f}, - {52.3810f,0.0000f} -}; - -static const GLUTStrokeStrip ch73st[] = -{ - {2,ch73st0} -}; - -static const GLUTStrokeChar ch73 = {104.7619f,1,ch73st}; - -/* char: 0x4a */ - -static const GLUTStrokeVertex ch74st0[] = -{ - {76.1905f,100.0000f}, - {76.1905f,23.8095f}, - {71.4286f,9.5238f}, - {66.6667f,4.7619f}, - {57.1429f,0.0000f}, - {47.6191f,0.0000f}, - {38.0953f,4.7619f}, - {33.3334f,9.5238f}, - {28.5715f,23.8095f}, - {28.5715f,33.3333f} -}; - -static const GLUTStrokeStrip ch74st[] = -{ - {10,ch74st0} -}; - -static const GLUTStrokeChar ch74 = {104.7619f,1,ch74st}; - -/* char: 0x4b */ - -static const GLUTStrokeVertex ch75st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch75st1[] = -{ - {85.7143f,100.0000f}, - {19.0476f,33.3333f} -}; - -static const GLUTStrokeVertex ch75st2[] = -{ - {42.8571f,57.1429f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeStrip ch75st[] = -{ - {2,ch75st0}, - {2,ch75st1}, - {2,ch75st2} -}; - -static const GLUTStrokeChar ch75 = {104.7619f,3,ch75st}; - -/* char: 0x4c */ - -static const GLUTStrokeVertex ch76st0[] = -{ - {23.8095f,100.0000f}, - {23.8095f,0.0000f} -}; - -static const GLUTStrokeVertex ch76st1[] = -{ - {23.8095f,0.0000f}, - {80.9524f,0.0000f} -}; - -static const GLUTStrokeStrip ch76st[] = -{ - {2,ch76st0}, - {2,ch76st1} -}; - -static const GLUTStrokeChar ch76 = {104.7619f,2,ch76st}; - -/* char: 0x4d */ - -static const GLUTStrokeVertex ch77st0[] = -{ - {14.2857f,100.0000f}, - {14.2857f,0.0000f} -}; - -static const GLUTStrokeVertex ch77st1[] = -{ - {14.2857f,100.0000f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeVertex ch77st2[] = -{ - {90.4762f,100.0000f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeVertex ch77st3[] = -{ - {90.4762f,100.0000f}, - {90.4762f,0.0000f} -}; - -static const GLUTStrokeStrip ch77st[] = -{ - {2,ch77st0}, - {2,ch77st1}, - {2,ch77st2}, - {2,ch77st3} -}; - -static const GLUTStrokeChar ch77 = {104.7619f,4,ch77st}; - -/* char: 0x4e */ - -static const GLUTStrokeVertex ch78st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch78st1[] = -{ - {19.0476f,100.0000f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeVertex ch78st2[] = -{ - {85.7143f,100.0000f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeStrip ch78st[] = -{ - {2,ch78st0}, - {2,ch78st1}, - {2,ch78st2} -}; - -static const GLUTStrokeChar ch78 = {104.7619f,3,ch78st}; - -/* char: 0x4f */ - -static const GLUTStrokeVertex ch79st0[] = -{ - {42.8571f,100.0000f}, - {33.3333f,95.2381f}, - {23.8095f,85.7143f}, - {19.0476f,76.1905f}, - {14.2857f,61.9048f}, - {14.2857f,38.0952f}, - {19.0476f,23.8095f}, - {23.8095f,14.2857f}, - {33.3333f,4.7619f}, - {42.8571f,0.0000f}, - {61.9047f,0.0000f}, - {71.4286f,4.7619f}, - {80.9524f,14.2857f}, - {85.7143f,23.8095f}, - {90.4762f,38.0952f}, - {90.4762f,61.9048f}, - {85.7143f,76.1905f}, - {80.9524f,85.7143f}, - {71.4286f,95.2381f}, - {61.9047f,100.0000f}, - {42.8571f,100.0000f} -}; - -static const GLUTStrokeStrip ch79st[] = -{ - {21,ch79st0} -}; - -static const GLUTStrokeChar ch79 = {104.7619f,1,ch79st}; - -/* char: 0x50 */ - -static const GLUTStrokeVertex ch80st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch80st1[] = -{ - {19.0476f,100.0000f}, - {61.9047f,100.0000f}, - {76.1905f,95.2381f}, - {80.9524f,90.4762f}, - {85.7143f,80.9524f}, - {85.7143f,66.6667f}, - {80.9524f,57.1429f}, - {76.1905f,52.3810f}, - {61.9047f,47.6190f}, - {19.0476f,47.6190f} -}; - -static const GLUTStrokeStrip ch80st[] = -{ - {2,ch80st0}, - {10,ch80st1} -}; - -static const GLUTStrokeChar ch80 = {104.7619f,2,ch80st}; - -/* char: 0x51 */ - -static const GLUTStrokeVertex ch81st0[] = -{ - {42.8571f,100.0000f}, - {33.3333f,95.2381f}, - {23.8095f,85.7143f}, - {19.0476f,76.1905f}, - {14.2857f,61.9048f}, - {14.2857f,38.0952f}, - {19.0476f,23.8095f}, - {23.8095f,14.2857f}, - {33.3333f,4.7619f}, - {42.8571f,0.0000f}, - {61.9047f,0.0000f}, - {71.4286f,4.7619f}, - {80.9524f,14.2857f}, - {85.7143f,23.8095f}, - {90.4762f,38.0952f}, - {90.4762f,61.9048f}, - {85.7143f,76.1905f}, - {80.9524f,85.7143f}, - {71.4286f,95.2381f}, - {61.9047f,100.0000f}, - {42.8571f,100.0000f} -}; - -static const GLUTStrokeVertex ch81st1[] = -{ - {57.1428f,19.0476f}, - {85.7143f,-9.5238f} -}; - -static const GLUTStrokeStrip ch81st[] = -{ - {21,ch81st0}, - {2,ch81st1} -}; - -static const GLUTStrokeChar ch81 = {104.7619f,2,ch81st}; - -/* char: 0x52 */ - -static const GLUTStrokeVertex ch82st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch82st1[] = -{ - {19.0476f,100.0000f}, - {61.9047f,100.0000f}, - {76.1905f,95.2381f}, - {80.9524f,90.4762f}, - {85.7143f,80.9524f}, - {85.7143f,71.4286f}, - {80.9524f,61.9048f}, - {76.1905f,57.1429f}, - {61.9047f,52.3810f}, - {19.0476f,52.3810f} -}; - -static const GLUTStrokeVertex ch82st2[] = -{ - {52.3809f,52.3810f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeStrip ch82st[] = -{ - {2,ch82st0}, - {10,ch82st1}, - {2,ch82st2} -}; - -static const GLUTStrokeChar ch82 = {104.7619f,3,ch82st}; - -/* char: 0x53 */ - -static const GLUTStrokeVertex ch83st0[] = -{ - {85.7143f,85.7143f}, - {76.1905f,95.2381f}, - {61.9047f,100.0000f}, - {42.8571f,100.0000f}, - {28.5714f,95.2381f}, - {19.0476f,85.7143f}, - {19.0476f,76.1905f}, - {23.8095f,66.6667f}, - {28.5714f,61.9048f}, - {38.0952f,57.1429f}, - {66.6666f,47.6190f}, - {76.1905f,42.8571f}, - {80.9524f,38.0952f}, - {85.7143f,28.5714f}, - {85.7143f,14.2857f}, - {76.1905f,4.7619f}, - {61.9047f,0.0000f}, - {42.8571f,0.0000f}, - {28.5714f,4.7619f}, - {19.0476f,14.2857f} -}; - -static const GLUTStrokeStrip ch83st[] = -{ - {20,ch83st0} -}; - -static const GLUTStrokeChar ch83 = {104.7619f,1,ch83st}; - -/* char: 0x54 */ - -static const GLUTStrokeVertex ch84st0[] = -{ - {52.3809f,100.0000f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeVertex ch84st1[] = -{ - {19.0476f,100.0000f}, - {85.7143f,100.0000f} -}; - -static const GLUTStrokeStrip ch84st[] = -{ - {2,ch84st0}, - {2,ch84st1} -}; - -static const GLUTStrokeChar ch84 = {104.7619f,2,ch84st}; - -/* char: 0x55 */ - -static const GLUTStrokeVertex ch85st0[] = -{ - {19.0476f,100.0000f}, - {19.0476f,28.5714f}, - {23.8095f,14.2857f}, - {33.3333f,4.7619f}, - {47.6190f,0.0000f}, - {57.1428f,0.0000f}, - {71.4286f,4.7619f}, - {80.9524f,14.2857f}, - {85.7143f,28.5714f}, - {85.7143f,100.0000f} -}; - -static const GLUTStrokeStrip ch85st[] = -{ - {10,ch85st0} -}; - -static const GLUTStrokeChar ch85 = {104.7619f,1,ch85st}; - -/* char: 0x56 */ - -static const GLUTStrokeVertex ch86st0[] = -{ - {14.2857f,100.0000f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeVertex ch86st1[] = -{ - {90.4762f,100.0000f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeStrip ch86st[] = -{ - {2,ch86st0}, - {2,ch86st1} -}; - -static const GLUTStrokeChar ch86 = {104.7619f,2,ch86st}; - -/* char: 0x57 */ - -static const GLUTStrokeVertex ch87st0[] = -{ - {4.7619f,100.0000f}, - {28.5714f,0.0000f} -}; - -static const GLUTStrokeVertex ch87st1[] = -{ - {52.3809f,100.0000f}, - {28.5714f,0.0000f} -}; - -static const GLUTStrokeVertex ch87st2[] = -{ - {52.3809f,100.0000f}, - {76.1905f,0.0000f} -}; - -static const GLUTStrokeVertex ch87st3[] = -{ - {100.0000f,100.0000f}, - {76.1905f,0.0000f} -}; - -static const GLUTStrokeStrip ch87st[] = -{ - {2,ch87st0}, - {2,ch87st1}, - {2,ch87st2}, - {2,ch87st3} -}; - -static const GLUTStrokeChar ch87 = {104.7619f,4,ch87st}; - -/* char: 0x58 */ - -static const GLUTStrokeVertex ch88st0[] = -{ - {19.0476f,100.0000f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeVertex ch88st1[] = -{ - {85.7143f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeStrip ch88st[] = -{ - {2,ch88st0}, - {2,ch88st1} -}; - -static const GLUTStrokeChar ch88 = {104.7619f,2,ch88st}; - -/* char: 0x59 */ - -static const GLUTStrokeVertex ch89st0[] = -{ - {14.2857f,100.0000f}, - {52.3809f,52.3810f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeVertex ch89st1[] = -{ - {90.4762f,100.0000f}, - {52.3809f,52.3810f} -}; - -static const GLUTStrokeStrip ch89st[] = -{ - {3,ch89st0}, - {2,ch89st1} -}; - -static const GLUTStrokeChar ch89 = {104.7619f,2,ch89st}; - -/* char: 0x5a */ - -static const GLUTStrokeVertex ch90st0[] = -{ - {85.7143f,100.0000f}, - {19.0476f,0.0000f} -}; - -static const GLUTStrokeVertex ch90st1[] = -{ - {19.0476f,100.0000f}, - {85.7143f,100.0000f} -}; - -static const GLUTStrokeVertex ch90st2[] = -{ - {19.0476f,0.0000f}, - {85.7143f,0.0000f} -}; - -static const GLUTStrokeStrip ch90st[] = -{ - {2,ch90st0}, - {2,ch90st1}, - {2,ch90st2} -}; - -static const GLUTStrokeChar ch90 = {104.7619f,3,ch90st}; - -/* char: 0x5b */ - -static const GLUTStrokeVertex ch91st0[] = -{ - {35.7143f,119.0476f}, - {35.7143f,-33.3333f} -}; - -static const GLUTStrokeVertex ch91st1[] = -{ - {40.4762f,119.0476f}, - {40.4762f,-33.3333f} -}; - -static const GLUTStrokeVertex ch91st2[] = -{ - {35.7143f,119.0476f}, - {69.0476f,119.0476f} -}; - -static const GLUTStrokeVertex ch91st3[] = -{ - {35.7143f,-33.3333f}, - {69.0476f,-33.3333f} -}; - -static const GLUTStrokeStrip ch91st[] = -{ - {2,ch91st0}, - {2,ch91st1}, - {2,ch91st2}, - {2,ch91st3} -}; - -static const GLUTStrokeChar ch91 = {104.7619f,4,ch91st}; - -/* char: 0x5c */ - -static const GLUTStrokeVertex ch92st0[] = -{ - {19.0476f,100.0000f}, - {85.7143f,-14.2857f} -}; - -static const GLUTStrokeStrip ch92st[] = -{ - {2,ch92st0} -}; - -static const GLUTStrokeChar ch92 = {104.7619f,1,ch92st}; - -/* char: 0x5d */ - -static const GLUTStrokeVertex ch93st0[] = -{ - {64.2857f,119.0476f}, - {64.2857f,-33.3333f} -}; - -static const GLUTStrokeVertex ch93st1[] = -{ - {69.0476f,119.0476f}, - {69.0476f,-33.3333f} -}; - -static const GLUTStrokeVertex ch93st2[] = -{ - {35.7143f,119.0476f}, - {69.0476f,119.0476f} -}; - -static const GLUTStrokeVertex ch93st3[] = -{ - {35.7143f,-33.3333f}, - {69.0476f,-33.3333f} -}; - -static const GLUTStrokeStrip ch93st[] = -{ - {2,ch93st0}, - {2,ch93st1}, - {2,ch93st2}, - {2,ch93st3} -}; - -static const GLUTStrokeChar ch93 = {104.7619f,4,ch93st}; - -/* char: 0x5e */ - -static const GLUTStrokeVertex ch94st0[] = -{ - {52.3809f,109.5238f}, - {14.2857f,42.8571f} -}; - -static const GLUTStrokeVertex ch94st1[] = -{ - {52.3809f,109.5238f}, - {90.4762f,42.8571f} -}; - -static const GLUTStrokeStrip ch94st[] = -{ - {2,ch94st0}, - {2,ch94st1} -}; - -static const GLUTStrokeChar ch94 = {104.7619f,2,ch94st}; - -/* char: 0x5f */ - -static const GLUTStrokeVertex ch95st0[] = -{ - {0.0000f,-33.3333f}, - {104.7619f,-33.3333f}, - {104.7619f,-28.5714f}, - {0.0000f,-28.5714f}, - {0.0000f,-33.3333f} -}; - -static const GLUTStrokeStrip ch95st[] = -{ - {5,ch95st0} -}; - -static const GLUTStrokeChar ch95 = {104.7619f,1,ch95st}; - -/* char: 0x60 */ - -static const GLUTStrokeVertex ch96st0[] = -{ - {42.8572f,100.0000f}, - {66.6667f,71.4286f} -}; - -static const GLUTStrokeVertex ch96st1[] = -{ - {42.8572f,100.0000f}, - {38.0953f,95.2381f}, - {66.6667f,71.4286f} -}; - -static const GLUTStrokeStrip ch96st[] = -{ - {2,ch96st0}, - {3,ch96st1} -}; - -static const GLUTStrokeChar ch96 = {104.7619f,2,ch96st}; - -/* char: 0x61 */ - -static const GLUTStrokeVertex ch97st0[] = -{ - {80.9524f,66.6667f}, - {80.9524f,0.0000f} -}; - -static const GLUTStrokeVertex ch97st1[] = -{ - {80.9524f,52.3810f}, - {71.4285f,61.9048f}, - {61.9047f,66.6667f}, - {47.6190f,66.6667f}, - {38.0952f,61.9048f}, - {28.5714f,52.3810f}, - {23.8095f,38.0952f}, - {23.8095f,28.5714f}, - {28.5714f,14.2857f}, - {38.0952f,4.7619f}, - {47.6190f,0.0000f}, - {61.9047f,0.0000f}, - {71.4285f,4.7619f}, - {80.9524f,14.2857f} -}; - -static const GLUTStrokeStrip ch97st[] = -{ - {2,ch97st0}, - {14,ch97st1} -}; - -static const GLUTStrokeChar ch97 = {104.7619f,2,ch97st}; - -/* char: 0x62 */ - -static const GLUTStrokeVertex ch98st0[] = -{ - {23.8095f,100.0000f}, - {23.8095f,0.0000f} -}; - -static const GLUTStrokeVertex ch98st1[] = -{ - {23.8095f,52.3810f}, - {33.3333f,61.9048f}, - {42.8571f,66.6667f}, - {57.1428f,66.6667f}, - {66.6666f,61.9048f}, - {76.1905f,52.3810f}, - {80.9524f,38.0952f}, - {80.9524f,28.5714f}, - {76.1905f,14.2857f}, - {66.6666f,4.7619f}, - {57.1428f,0.0000f}, - {42.8571f,0.0000f}, - {33.3333f,4.7619f}, - {23.8095f,14.2857f} -}; - -static const GLUTStrokeStrip ch98st[] = -{ - {2,ch98st0}, - {14,ch98st1} -}; - -static const GLUTStrokeChar ch98 = {104.7619f,2,ch98st}; - -/* char: 0x63 */ - -static const GLUTStrokeVertex ch99st0[] = -{ - {80.9524f,52.3810f}, - {71.4285f,61.9048f}, - {61.9047f,66.6667f}, - {47.6190f,66.6667f}, - {38.0952f,61.9048f}, - {28.5714f,52.3810f}, - {23.8095f,38.0952f}, - {23.8095f,28.5714f}, - {28.5714f,14.2857f}, - {38.0952f,4.7619f}, - {47.6190f,0.0000f}, - {61.9047f,0.0000f}, - {71.4285f,4.7619f}, - {80.9524f,14.2857f} -}; - -static const GLUTStrokeStrip ch99st[] = -{ - {14,ch99st0} -}; - -static const GLUTStrokeChar ch99 = {104.7619f,1,ch99st}; - -/* char: 0x64 */ - -static const GLUTStrokeVertex ch100st0[] = -{ - {80.9524f,100.0000f}, - {80.9524f,0.0000f} -}; - -static const GLUTStrokeVertex ch100st1[] = -{ - {80.9524f,52.3810f}, - {71.4285f,61.9048f}, - {61.9047f,66.6667f}, - {47.6190f,66.6667f}, - {38.0952f,61.9048f}, - {28.5714f,52.3810f}, - {23.8095f,38.0952f}, - {23.8095f,28.5714f}, - {28.5714f,14.2857f}, - {38.0952f,4.7619f}, - {47.6190f,0.0000f}, - {61.9047f,0.0000f}, - {71.4285f,4.7619f}, - {80.9524f,14.2857f} -}; - -static const GLUTStrokeStrip ch100st[] = -{ - {2,ch100st0}, - {14,ch100st1} -}; - -static const GLUTStrokeChar ch100 = {104.7619f,2,ch100st}; - -/* char: 0x65 */ - -static const GLUTStrokeVertex ch101st0[] = -{ - {23.8095f,38.0952f}, - {80.9524f,38.0952f}, - {80.9524f,47.6190f}, - {76.1905f,57.1429f}, - {71.4285f,61.9048f}, - {61.9047f,66.6667f}, - {47.6190f,66.6667f}, - {38.0952f,61.9048f}, - {28.5714f,52.3810f}, - {23.8095f,38.0952f}, - {23.8095f,28.5714f}, - {28.5714f,14.2857f}, - {38.0952f,4.7619f}, - {47.6190f,0.0000f}, - {61.9047f,0.0000f}, - {71.4285f,4.7619f}, - {80.9524f,14.2857f} -}; - -static const GLUTStrokeStrip ch101st[] = -{ - {17,ch101st0} -}; - -static const GLUTStrokeChar ch101 = {104.7619f,1,ch101st}; - -/* char: 0x66 */ - -static const GLUTStrokeVertex ch102st0[] = -{ - {71.4286f,100.0000f}, - {61.9048f,100.0000f}, - {52.3810f,95.2381f}, - {47.6191f,80.9524f}, - {47.6191f,0.0000f} -}; - -static const GLUTStrokeVertex ch102st1[] = -{ - {33.3334f,66.6667f}, - {66.6667f,66.6667f} -}; - -static const GLUTStrokeStrip ch102st[] = -{ - {5,ch102st0}, - {2,ch102st1} -}; - -static const GLUTStrokeChar ch102 = {104.7619f,2,ch102st}; - -/* char: 0x67 */ - -static const GLUTStrokeVertex ch103st0[] = -{ - {80.9524f,66.6667f}, - {80.9524f,-9.5238f}, - {76.1905f,-23.8095f}, - {71.4285f,-28.5714f}, - {61.9047f,-33.3333f}, - {47.6190f,-33.3333f}, - {38.0952f,-28.5714f} -}; - -static const GLUTStrokeVertex ch103st1[] = -{ - {80.9524f,52.3810f}, - {71.4285f,61.9048f}, - {61.9047f,66.6667f}, - {47.6190f,66.6667f}, - {38.0952f,61.9048f}, - {28.5714f,52.3810f}, - {23.8095f,38.0952f}, - {23.8095f,28.5714f}, - {28.5714f,14.2857f}, - {38.0952f,4.7619f}, - {47.6190f,0.0000f}, - {61.9047f,0.0000f}, - {71.4285f,4.7619f}, - {80.9524f,14.2857f} -}; - -static const GLUTStrokeStrip ch103st[] = -{ - {7,ch103st0}, - {14,ch103st1} -}; - -static const GLUTStrokeChar ch103 = {104.7619f,2,ch103st}; - -/* char: 0x68 */ - -static const GLUTStrokeVertex ch104st0[] = -{ - {26.1905f,100.0000f}, - {26.1905f,0.0000f} -}; - -static const GLUTStrokeVertex ch104st1[] = -{ - {26.1905f,47.6190f}, - {40.4762f,61.9048f}, - {50.0000f,66.6667f}, - {64.2857f,66.6667f}, - {73.8095f,61.9048f}, - {78.5715f,47.6190f}, - {78.5715f,0.0000f} -}; - -static const GLUTStrokeStrip ch104st[] = -{ - {2,ch104st0}, - {7,ch104st1} -}; - -static const GLUTStrokeChar ch104 = {104.7619f,2,ch104st}; - -/* char: 0x69 */ - -static const GLUTStrokeVertex ch105st0[] = -{ - {47.6191f,100.0000f}, - {52.3810f,95.2381f}, - {57.1429f,100.0000f}, - {52.3810f,104.7619f}, - {47.6191f,100.0000f} -}; - -static const GLUTStrokeVertex ch105st1[] = -{ - {52.3810f,66.6667f}, - {52.3810f,0.0000f} -}; - -static const GLUTStrokeStrip ch105st[] = -{ - {5,ch105st0}, - {2,ch105st1} -}; - -static const GLUTStrokeChar ch105 = {104.7619f,2,ch105st}; - -/* char: 0x6a */ - -static const GLUTStrokeVertex ch106st0[] = -{ - {57.1429f,100.0000f}, - {61.9048f,95.2381f}, - {66.6667f,100.0000f}, - {61.9048f,104.7619f}, - {57.1429f,100.0000f} -}; - -static const GLUTStrokeVertex ch106st1[] = -{ - {61.9048f,66.6667f}, - {61.9048f,-14.2857f}, - {57.1429f,-28.5714f}, - {47.6191f,-33.3333f}, - {38.0953f,-33.3333f} -}; - -static const GLUTStrokeStrip ch106st[] = -{ - {5,ch106st0}, - {5,ch106st1} -}; - -static const GLUTStrokeChar ch106 = {104.7619f,2,ch106st}; - -/* char: 0x6b */ - -static const GLUTStrokeVertex ch107st0[] = -{ - {26.1905f,100.0000f}, - {26.1905f,0.0000f} -}; - -static const GLUTStrokeVertex ch107st1[] = -{ - {73.8095f,66.6667f}, - {26.1905f,19.0476f} -}; - -static const GLUTStrokeVertex ch107st2[] = -{ - {45.2381f,38.0952f}, - {78.5715f,0.0000f} -}; - -static const GLUTStrokeStrip ch107st[] = -{ - {2,ch107st0}, - {2,ch107st1}, - {2,ch107st2} -}; - -static const GLUTStrokeChar ch107 = {104.7619f,3,ch107st}; - -/* char: 0x6c */ - -static const GLUTStrokeVertex ch108st0[] = -{ - {52.3810f,100.0000f}, - {52.3810f,0.0000f} -}; - -static const GLUTStrokeStrip ch108st[] = -{ - {2,ch108st0} -}; - -static const GLUTStrokeChar ch108 = {104.7619f,1,ch108st}; - -/* char: 0x6d */ - -static const GLUTStrokeVertex ch109st0[] = -{ - {0.0000f,66.6667f}, - {0.0000f,0.0000f} -}; - -static const GLUTStrokeVertex ch109st1[] = -{ - {0.0000f,47.6190f}, - {14.2857f,61.9048f}, - {23.8095f,66.6667f}, - {38.0952f,66.6667f}, - {47.6190f,61.9048f}, - {52.3810f,47.6190f}, - {52.3810f,0.0000f} -}; - -static const GLUTStrokeVertex ch109st2[] = -{ - {52.3810f,47.6190f}, - {66.6667f,61.9048f}, - {76.1905f,66.6667f}, - {90.4762f,66.6667f}, - {100.0000f,61.9048f}, - {104.7619f,47.6190f}, - {104.7619f,0.0000f} -}; - -static const GLUTStrokeStrip ch109st[] = -{ - {2,ch109st0}, - {7,ch109st1}, - {7,ch109st2} -}; - -static const GLUTStrokeChar ch109 = {104.7619f,3,ch109st}; - -/* char: 0x6e */ - -static const GLUTStrokeVertex ch110st0[] = -{ - {26.1905f,66.6667f}, - {26.1905f,0.0000f} -}; - -static const GLUTStrokeVertex ch110st1[] = -{ - {26.1905f,47.6190f}, - {40.4762f,61.9048f}, - {50.0000f,66.6667f}, - {64.2857f,66.6667f}, - {73.8095f,61.9048f}, - {78.5715f,47.6190f}, - {78.5715f,0.0000f} -}; - -static const GLUTStrokeStrip ch110st[] = -{ - {2,ch110st0}, - {7,ch110st1} -}; - -static const GLUTStrokeChar ch110 = {104.7619f,2,ch110st}; - -/* char: 0x6f */ - -static const GLUTStrokeVertex ch111st0[] = -{ - {45.2381f,66.6667f}, - {35.7143f,61.9048f}, - {26.1905f,52.3810f}, - {21.4286f,38.0952f}, - {21.4286f,28.5714f}, - {26.1905f,14.2857f}, - {35.7143f,4.7619f}, - {45.2381f,0.0000f}, - {59.5238f,0.0000f}, - {69.0476f,4.7619f}, - {78.5714f,14.2857f}, - {83.3334f,28.5714f}, - {83.3334f,38.0952f}, - {78.5714f,52.3810f}, - {69.0476f,61.9048f}, - {59.5238f,66.6667f}, - {45.2381f,66.6667f} -}; - -static const GLUTStrokeStrip ch111st[] = -{ - {17,ch111st0} -}; - -static const GLUTStrokeChar ch111 = {104.7619f,1,ch111st}; - -/* char: 0x70 */ - -static const GLUTStrokeVertex ch112st0[] = -{ - {23.8095f,66.6667f}, - {23.8095f,-33.3333f} -}; - -static const GLUTStrokeVertex ch112st1[] = -{ - {23.8095f,52.3810f}, - {33.3333f,61.9048f}, - {42.8571f,66.6667f}, - {57.1428f,66.6667f}, - {66.6666f,61.9048f}, - {76.1905f,52.3810f}, - {80.9524f,38.0952f}, - {80.9524f,28.5714f}, - {76.1905f,14.2857f}, - {66.6666f,4.7619f}, - {57.1428f,0.0000f}, - {42.8571f,0.0000f}, - {33.3333f,4.7619f}, - {23.8095f,14.2857f} -}; - -static const GLUTStrokeStrip ch112st[] = -{ - {2,ch112st0}, - {14,ch112st1} -}; - -static const GLUTStrokeChar ch112 = {104.7619f,2,ch112st}; - -/* char: 0x71 */ - -static const GLUTStrokeVertex ch113st0[] = -{ - {80.9524f,66.6667f}, - {80.9524f,-33.3333f} -}; - -static const GLUTStrokeVertex ch113st1[] = -{ - {80.9524f,52.3810f}, - {71.4285f,61.9048f}, - {61.9047f,66.6667f}, - {47.6190f,66.6667f}, - {38.0952f,61.9048f}, - {28.5714f,52.3810f}, - {23.8095f,38.0952f}, - {23.8095f,28.5714f}, - {28.5714f,14.2857f}, - {38.0952f,4.7619f}, - {47.6190f,0.0000f}, - {61.9047f,0.0000f}, - {71.4285f,4.7619f}, - {80.9524f,14.2857f} -}; - -static const GLUTStrokeStrip ch113st[] = -{ - {2,ch113st0}, - {14,ch113st1} -}; - -static const GLUTStrokeChar ch113 = {104.7619f,2,ch113st}; - -/* char: 0x72 */ - -static const GLUTStrokeVertex ch114st0[] = -{ - {33.3334f,66.6667f}, - {33.3334f,0.0000f} -}; - -static const GLUTStrokeVertex ch114st1[] = -{ - {33.3334f,38.0952f}, - {38.0953f,52.3810f}, - {47.6191f,61.9048f}, - {57.1429f,66.6667f}, - {71.4286f,66.6667f} -}; - -static const GLUTStrokeStrip ch114st[] = -{ - {2,ch114st0}, - {5,ch114st1} -}; - -static const GLUTStrokeChar ch114 = {104.7619f,2,ch114st}; - -/* char: 0x73 */ - -static const GLUTStrokeVertex ch115st0[] = -{ - {78.5715f,52.3810f}, - {73.8095f,61.9048f}, - {59.5238f,66.6667f}, - {45.2381f,66.6667f}, - {30.9524f,61.9048f}, - {26.1905f,52.3810f}, - {30.9524f,42.8571f}, - {40.4762f,38.0952f}, - {64.2857f,33.3333f}, - {73.8095f,28.5714f}, - {78.5715f,19.0476f}, - {78.5715f,14.2857f}, - {73.8095f,4.7619f}, - {59.5238f,0.0000f}, - {45.2381f,0.0000f}, - {30.9524f,4.7619f}, - {26.1905f,14.2857f} -}; - -static const GLUTStrokeStrip ch115st[] = -{ - {17,ch115st0} -}; - -static const GLUTStrokeChar ch115 = {104.7619f,1,ch115st}; - -/* char: 0x74 */ - -static const GLUTStrokeVertex ch116st0[] = -{ - {47.6191f,100.0000f}, - {47.6191f,19.0476f}, - {52.3810f,4.7619f}, - {61.9048f,0.0000f}, - {71.4286f,0.0000f} -}; - -static const GLUTStrokeVertex ch116st1[] = -{ - {33.3334f,66.6667f}, - {66.6667f,66.6667f} -}; - -static const GLUTStrokeStrip ch116st[] = -{ - {5,ch116st0}, - {2,ch116st1} -}; - -static const GLUTStrokeChar ch116 = {104.7619f,2,ch116st}; - -/* char: 0x75 */ - -static const GLUTStrokeVertex ch117st0[] = -{ - {26.1905f,66.6667f}, - {26.1905f,19.0476f}, - {30.9524f,4.7619f}, - {40.4762f,0.0000f}, - {54.7619f,0.0000f}, - {64.2857f,4.7619f}, - {78.5715f,19.0476f} -}; - -static const GLUTStrokeVertex ch117st1[] = -{ - {78.5715f,66.6667f}, - {78.5715f,0.0000f} -}; - -static const GLUTStrokeStrip ch117st[] = -{ - {7,ch117st0}, - {2,ch117st1} -}; - -static const GLUTStrokeChar ch117 = {104.7619f,2,ch117st}; - -/* char: 0x76 */ - -static const GLUTStrokeVertex ch118st0[] = -{ - {23.8095f,66.6667f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeVertex ch118st1[] = -{ - {80.9524f,66.6667f}, - {52.3809f,0.0000f} -}; - -static const GLUTStrokeStrip ch118st[] = -{ - {2,ch118st0}, - {2,ch118st1} -}; - -static const GLUTStrokeChar ch118 = {104.7619f,2,ch118st}; - -/* char: 0x77 */ - -static const GLUTStrokeVertex ch119st0[] = -{ - {14.2857f,66.6667f}, - {33.3333f,0.0000f} -}; - -static const GLUTStrokeVertex ch119st1[] = -{ - {52.3809f,66.6667f}, - {33.3333f,0.0000f} -}; - -static const GLUTStrokeVertex ch119st2[] = -{ - {52.3809f,66.6667f}, - {71.4286f,0.0000f} -}; - -static const GLUTStrokeVertex ch119st3[] = -{ - {90.4762f,66.6667f}, - {71.4286f,0.0000f} -}; - -static const GLUTStrokeStrip ch119st[] = -{ - {2,ch119st0}, - {2,ch119st1}, - {2,ch119st2}, - {2,ch119st3} -}; - -static const GLUTStrokeChar ch119 = {104.7619f,4,ch119st}; - -/* char: 0x78 */ - -static const GLUTStrokeVertex ch120st0[] = -{ - {26.1905f,66.6667f}, - {78.5715f,0.0000f} -}; - -static const GLUTStrokeVertex ch120st1[] = -{ - {78.5715f,66.6667f}, - {26.1905f,0.0000f} -}; - -static const GLUTStrokeStrip ch120st[] = -{ - {2,ch120st0}, - {2,ch120st1} -}; - -static const GLUTStrokeChar ch120 = {104.7619f,2,ch120st}; - -/* char: 0x79 */ - -static const GLUTStrokeVertex ch121st0[] = -{ - {26.1905f,66.6667f}, - {54.7619f,0.0000f} -}; - -static const GLUTStrokeVertex ch121st1[] = -{ - {83.3334f,66.6667f}, - {54.7619f,0.0000f}, - {45.2381f,-19.0476f}, - {35.7143f,-28.5714f}, - {26.1905f,-33.3333f}, - {21.4286f,-33.3333f} -}; - -static const GLUTStrokeStrip ch121st[] = -{ - {2,ch121st0}, - {6,ch121st1} -}; - -static const GLUTStrokeChar ch121 = {104.7619f,2,ch121st}; - -/* char: 0x7a */ - -static const GLUTStrokeVertex ch122st0[] = -{ - {78.5715f,66.6667f}, - {26.1905f,0.0000f} -}; - -static const GLUTStrokeVertex ch122st1[] = -{ - {26.1905f,66.6667f}, - {78.5715f,66.6667f} -}; - -static const GLUTStrokeVertex ch122st2[] = -{ - {26.1905f,0.0000f}, - {78.5715f,0.0000f} -}; - -static const GLUTStrokeStrip ch122st[] = -{ - {2,ch122st0}, - {2,ch122st1}, - {2,ch122st2} -}; - -static const GLUTStrokeChar ch122 = {104.7619f,3,ch122st}; - -/* char: 0x7b */ - -static const GLUTStrokeVertex ch123st0[] = -{ - {64.2857f,119.0476f}, - {54.7619f,114.2857f}, - {50.0000f,109.5238f}, - {45.2381f,100.0000f}, - {45.2381f,90.4762f}, - {50.0000f,80.9524f}, - {54.7619f,76.1905f}, - {59.5238f,66.6667f}, - {59.5238f,57.1429f}, - {50.0000f,47.6190f} -}; - -static const GLUTStrokeVertex ch123st1[] = -{ - {54.7619f,114.2857f}, - {50.0000f,104.7619f}, - {50.0000f,95.2381f}, - {54.7619f,85.7143f}, - {59.5238f,80.9524f}, - {64.2857f,71.4286f}, - {64.2857f,61.9048f}, - {59.5238f,52.3810f}, - {40.4762f,42.8571f}, - {59.5238f,33.3333f}, - {64.2857f,23.8095f}, - {64.2857f,14.2857f}, - {59.5238f,4.7619f}, - {54.7619f,0.0000f}, - {50.0000f,-9.5238f}, - {50.0000f,-19.0476f}, - {54.7619f,-28.5714f} -}; - -static const GLUTStrokeVertex ch123st2[] = -{ - {50.0000f,38.0952f}, - {59.5238f,28.5714f}, - {59.5238f,19.0476f}, - {54.7619f,9.5238f}, - {50.0000f,4.7619f}, - {45.2381f,-4.7619f}, - {45.2381f,-14.2857f}, - {50.0000f,-23.8095f}, - {54.7619f,-28.5714f}, - {64.2857f,-33.3333f} -}; - -static const GLUTStrokeStrip ch123st[] = -{ - {10,ch123st0}, - {17,ch123st1}, - {10,ch123st2} -}; - -static const GLUTStrokeChar ch123 = {104.7619f,3,ch123st}; - -/* char: 0x7c */ - -static const GLUTStrokeVertex ch124st0[] = -{ - {52.3810f,119.0476f}, - {52.3810f,-33.3333f} -}; - -static const GLUTStrokeStrip ch124st[] = -{ - {2,ch124st0} -}; - -static const GLUTStrokeChar ch124 = {104.7619f,1,ch124st}; - -/* char: 0x7d */ - -static const GLUTStrokeVertex ch125st0[] = -{ - {40.4762f,119.0476f}, - {50.0000f,114.2857f}, - {54.7619f,109.5238f}, - {59.5238f,100.0000f}, - {59.5238f,90.4762f}, - {54.7619f,80.9524f}, - {50.0000f,76.1905f}, - {45.2381f,66.6667f}, - {45.2381f,57.1429f}, - {54.7619f,47.6190f} -}; - -static const GLUTStrokeVertex ch125st1[] = -{ - {50.0000f,114.2857f}, - {54.7619f,104.7619f}, - {54.7619f,95.2381f}, - {50.0000f,85.7143f}, - {45.2381f,80.9524f}, - {40.4762f,71.4286f}, - {40.4762f,61.9048f}, - {45.2381f,52.3810f}, - {64.2857f,42.8571f}, - {45.2381f,33.3333f}, - {40.4762f,23.8095f}, - {40.4762f,14.2857f}, - {45.2381f,4.7619f}, - {50.0000f,0.0000f}, - {54.7619f,-9.5238f}, - {54.7619f,-19.0476f}, - {50.0000f,-28.5714f} -}; - -static const GLUTStrokeVertex ch125st2[] = -{ - {54.7619f,38.0952f}, - {45.2381f,28.5714f}, - {45.2381f,19.0476f}, - {50.0000f,9.5238f}, - {54.7619f,4.7619f}, - {59.5238f,-4.7619f}, - {59.5238f,-14.2857f}, - {54.7619f,-23.8095f}, - {50.0000f,-28.5714f}, - {40.4762f,-33.3333f} -}; - -static const GLUTStrokeStrip ch125st[] = -{ - {10,ch125st0}, - {17,ch125st1}, - {10,ch125st2} -}; - -static const GLUTStrokeChar ch125 = {104.7619f,3,ch125st}; - -/* char: 0x7e */ - -static const GLUTStrokeVertex ch126st0[] = -{ - {9.5238f,28.5714f}, - {9.5238f,38.0952f}, - {14.2857f,52.3810f}, - {23.8095f,57.1429f}, - {33.3333f,57.1429f}, - {42.8571f,52.3810f}, - {61.9048f,38.0952f}, - {71.4286f,33.3333f}, - {80.9524f,33.3333f}, - {90.4762f,38.0952f}, - {95.2381f,47.6190f} -}; - -static const GLUTStrokeVertex ch126st1[] = -{ - {9.5238f,38.0952f}, - {14.2857f,47.6190f}, - {23.8095f,52.3810f}, - {33.3333f,52.3810f}, - {42.8571f,47.6190f}, - {61.9048f,33.3333f}, - {71.4286f,28.5714f}, - {80.9524f,28.5714f}, - {90.4762f,33.3333f}, - {95.2381f,47.6190f}, - {95.2381f,57.1429f} -}; - -static const GLUTStrokeStrip ch126st[] = -{ - {11,ch126st0}, - {11,ch126st1} -}; - -static const GLUTStrokeChar ch126 = {104.7619f,2,ch126st}; - -static const GLUTStrokeChar *chars[] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126 -}; - -const GLUTStrokeFont glutStrokeMonoRoman = {"MonoRoman",128,chars,152.3809f,33.3333f}; diff --git a/src/glut/dos/overlay.c b/src/glut/dos/overlay.c deleted file mode 100644 index 46d3a39577..0000000000 --- a/src/glut/dos/overlay.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "internal.h" - - -int APIENTRY -glutLayerGet (GLenum info) -{ - switch (info) { - case GLUT_OVERLAY_POSSIBLE: - case GLUT_HAS_OVERLAY: - return GL_FALSE; - case GLUT_LAYER_IN_USE: - return GLUT_NORMAL; - case GLUT_NORMAL_DAMAGED: - return GL_FALSE; - case GLUT_OVERLAY_DAMAGED: - case GLUT_TRANSPARENT_INDEX: - default: - return -1; - } -} - - -void APIENTRY -glutOverlayDisplayFunc (GLUTdisplayCB func) -{ -} - - -void APIENTRY -glutEstablishOverlay (void) -{ -} - - -void APIENTRY -glutRemoveOverlay (void) -{ -} - - -void APIENTRY -glutUseLayer (GLenum layer) -{ -} - - -void APIENTRY -glutPostOverlayRedisplay (void) -{ -} - - -void APIENTRY -glutShowOverlay (void) -{ -} - - -void APIENTRY -glutHideOverlay (void) -{ -} - - -void APIENTRY -glutPostWindowOverlayRedisplay (int win) -{ -} diff --git a/src/glut/dos/roman.c b/src/glut/dos/roman.c deleted file mode 100644 index c30d76eb3f..0000000000 --- a/src/glut/dos/roman.c +++ /dev/null @@ -1,2779 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#include "internal.h" - -/* char: 0x20 */ - -static const GLUTStrokeChar ch32 = {104.7619f,0,NULL}; - -/* char: 0x21 */ - -static const GLUTStrokeVertex ch33st0[] = -{ - {13.3819f,100.0000f}, - {13.3819f,33.3333f} -}; - -static const GLUTStrokeVertex ch33st1[] = -{ - {13.3819f,9.5238f}, - {8.6200f,4.7619f}, - {13.3819f,0.0000f}, - {18.1438f,4.7619f}, - {13.3819f,9.5238f} -}; - -static const GLUTStrokeStrip ch33st[] = -{ - {2,ch33st0}, - {5,ch33st1} -}; - -static const GLUTStrokeChar ch33 = {26.6238f,2,ch33st}; - -/* char: 0x22 */ - -static const GLUTStrokeVertex ch34st0[] = -{ - {4.0200f,100.0000f}, - {4.0200f,66.6667f} -}; - -static const GLUTStrokeVertex ch34st1[] = -{ - {42.1152f,100.0000f}, - {42.1152f,66.6667f} -}; - -static const GLUTStrokeStrip ch34st[] = -{ - {2,ch34st0}, - {2,ch34st1} -}; - -static const GLUTStrokeChar ch34 = {51.4352f,2,ch34st}; - -/* char: 0x23 */ - -static const GLUTStrokeVertex ch35st0[] = -{ - {41.2952f,119.0476f}, - {7.9619f,-33.3333f} -}; - -static const GLUTStrokeVertex ch35st1[] = -{ - {69.8667f,119.0476f}, - {36.5333f,-33.3333f} -}; - -static const GLUTStrokeVertex ch35st2[] = -{ - {7.9619f,57.1429f}, - {74.6286f,57.1429f} -}; - -static const GLUTStrokeVertex ch35st3[] = -{ - {3.2000f,28.5714f}, - {69.8667f,28.5714f} -}; - -static const GLUTStrokeStrip ch35st[] = -{ - {2,ch35st0}, - {2,ch35st1}, - {2,ch35st2}, - {2,ch35st3} -}; - -static const GLUTStrokeChar ch35 = {79.4886f,4,ch35st}; - -/* char: 0x24 */ - -static const GLUTStrokeVertex ch36st0[] = -{ - {28.6295f,119.0476f}, - {28.6295f,-19.0476f} -}; - -static const GLUTStrokeVertex ch36st1[] = -{ - {47.6771f,119.0476f}, - {47.6771f,-19.0476f} -}; - -static const GLUTStrokeVertex ch36st2[] = -{ - {71.4867f,85.7143f}, - {61.9629f,95.2381f}, - {47.6771f,100.0000f}, - {28.6295f,100.0000f}, - {14.3438f,95.2381f}, - {4.8200f,85.7143f}, - {4.8200f,76.1905f}, - {9.5819f,66.6667f}, - {14.3438f,61.9048f}, - {23.8676f,57.1429f}, - {52.4390f,47.6190f}, - {61.9629f,42.8571f}, - {66.7248f,38.0952f}, - {71.4867f,28.5714f}, - {71.4867f,14.2857f}, - {61.9629f,4.7619f}, - {47.6771f,0.0000f}, - {28.6295f,0.0000f}, - {14.3438f,4.7619f}, - {4.8200f,14.2857f} -}; - -static const GLUTStrokeStrip ch36st[] = -{ - {2,ch36st0}, - {2,ch36st1}, - {20,ch36st2} -}; - -static const GLUTStrokeChar ch36 = {76.2067f,3,ch36st}; - -/* char: 0x25 */ - -static const GLUTStrokeVertex ch37st0[] = -{ - {92.0743f,100.0000f}, - {6.3600f,0.0000f} -}; - -static const GLUTStrokeVertex ch37st1[] = -{ - {30.1695f,100.0000f}, - {39.6933f,90.4762f}, - {39.6933f,80.9524f}, - {34.9314f,71.4286f}, - {25.4076f,66.6667f}, - {15.8838f,66.6667f}, - {6.3600f,76.1905f}, - {6.3600f,85.7143f}, - {11.1219f,95.2381f}, - {20.6457f,100.0000f}, - {30.1695f,100.0000f}, - {39.6933f,95.2381f}, - {53.9790f,90.4762f}, - {68.2648f,90.4762f}, - {82.5505f,95.2381f}, - {92.0743f,100.0000f} -}; - -static const GLUTStrokeVertex ch37st2[] = -{ - {73.0267f,33.3333f}, - {63.5029f,28.5714f}, - {58.7410f,19.0476f}, - {58.7410f,9.5238f}, - {68.2648f,0.0000f}, - {77.7886f,0.0000f}, - {87.3124f,4.7619f}, - {92.0743f,14.2857f}, - {92.0743f,23.8095f}, - {82.5505f,33.3333f}, - {73.0267f,33.3333f} -}; - -static const GLUTStrokeStrip ch37st[] = -{ - {2,ch37st0}, - {16,ch37st1}, - {11,ch37st2} -}; - -static const GLUTStrokeChar ch37 = {96.5743f,3,ch37st}; - -/* char: 0x26 */ - -static const GLUTStrokeVertex ch38st0[] = -{ - {101.2181f,57.1429f}, - {101.2181f,61.9048f}, - {96.4562f,66.6667f}, - {91.6943f,66.6667f}, - {86.9324f,61.9048f}, - {82.1705f,52.3810f}, - {72.6467f,28.5714f}, - {63.1229f,14.2857f}, - {53.5990f,4.7619f}, - {44.0752f,0.0000f}, - {25.0276f,0.0000f}, - {15.5038f,4.7619f}, - {10.7419f,9.5238f}, - {5.9800f,19.0476f}, - {5.9800f,28.5714f}, - {10.7419f,38.0952f}, - {15.5038f,42.8571f}, - {48.8371f,61.9048f}, - {53.5990f,66.6667f}, - {58.3610f,76.1905f}, - {58.3610f,85.7143f}, - {53.5990f,95.2381f}, - {44.0752f,100.0000f}, - {34.5514f,95.2381f}, - {29.7895f,85.7143f}, - {29.7895f,76.1905f}, - {34.5514f,61.9048f}, - {44.0752f,47.6190f}, - {67.8848f,14.2857f}, - {77.4086f,4.7619f}, - {86.9324f,0.0000f}, - {96.4562f,0.0000f}, - {101.2181f,4.7619f}, - {101.2181f,9.5238f} -}; - -static const GLUTStrokeStrip ch38st[] = -{ - {34,ch38st0} -}; - -static const GLUTStrokeChar ch38 = {101.7581f,1,ch38st}; - -/* char: 0x27 */ - -static const GLUTStrokeVertex ch39st0[] = -{ - {4.4400f,100.0000f}, - {4.4400f,66.6667f} -}; - -static const GLUTStrokeStrip ch39st[] = -{ - {2,ch39st0} -}; - -static const GLUTStrokeChar ch39 = {13.6200f,1,ch39st}; - -/* char: 0x28 */ - -static const GLUTStrokeVertex ch40st0[] = -{ - {40.9133f,119.0476f}, - {31.3895f,109.5238f}, - {21.8657f,95.2381f}, - {12.3419f,76.1905f}, - {7.5800f,52.3810f}, - {7.5800f,33.3333f}, - {12.3419f,9.5238f}, - {21.8657f,-9.5238f}, - {31.3895f,-23.8095f}, - {40.9133f,-33.3333f} -}; - -static const GLUTStrokeStrip ch40st[] = -{ - {10,ch40st0} -}; - -static const GLUTStrokeChar ch40 = {47.1733f,1,ch40st}; - -/* char: 0x29 */ - -static const GLUTStrokeVertex ch41st0[] = -{ - {5.2800f,119.0476f}, - {14.8038f,109.5238f}, - {24.3276f,95.2381f}, - {33.8514f,76.1905f}, - {38.6133f,52.3810f}, - {38.6133f,33.3333f}, - {33.8514f,9.5238f}, - {24.3276f,-9.5238f}, - {14.8038f,-23.8095f}, - {5.2800f,-33.3333f} -}; - -static const GLUTStrokeStrip ch41st[] = -{ - {10,ch41st0} -}; - -static const GLUTStrokeChar ch41 = {47.5333f,1,ch41st}; - -/* char: 0x2a */ - -static const GLUTStrokeVertex ch42st0[] = -{ - {30.7695f,71.4286f}, - {30.7695f,14.2857f} -}; - -static const GLUTStrokeVertex ch42st1[] = -{ - {6.9600f,57.1429f}, - {54.5790f,28.5714f} -}; - -static const GLUTStrokeVertex ch42st2[] = -{ - {54.5790f,57.1429f}, - {6.9600f,28.5714f} -}; - -static const GLUTStrokeStrip ch42st[] = -{ - {2,ch42st0}, - {2,ch42st1}, - {2,ch42st2} -}; - -static const GLUTStrokeChar ch42 = {59.4390f,3,ch42st}; - -/* char: 0x2b */ - -static const GLUTStrokeVertex ch43st0[] = -{ - {48.8371f,85.7143f}, - {48.8371f,0.0000f} -}; - -static const GLUTStrokeVertex ch43st1[] = -{ - {5.9800f,42.8571f}, - {91.6943f,42.8571f} -}; - -static const GLUTStrokeStrip ch43st[] = -{ - {2,ch43st0}, - {2,ch43st1} -}; - -static const GLUTStrokeChar ch43 = {97.2543f,2,ch43st}; - -/* char: 0x2c */ - -static const GLUTStrokeVertex ch44st0[] = -{ - {18.2838f,4.7619f}, - {13.5219f,0.0000f}, - {8.7600f,4.7619f}, - {13.5219f,9.5238f}, - {18.2838f,4.7619f}, - {18.2838f,-4.7619f}, - {13.5219f,-14.2857f}, - {8.7600f,-19.0476f} -}; - -static const GLUTStrokeStrip ch44st[] = -{ - {8,ch44st0} -}; - -static const GLUTStrokeChar ch44 = {26.0638f,1,ch44st}; - -/* char: 0x2d */ - -static const GLUTStrokeVertex ch45st0[] = -{ - {7.3800f,42.8571f}, - {93.0943f,42.8571f} -}; - -static const GLUTStrokeStrip ch45st[] = -{ - {2,ch45st0} -}; - -static const GLUTStrokeChar ch45 = {100.7543f,1,ch45st}; - -/* char: 0x2e */ - -static const GLUTStrokeVertex ch46st0[] = -{ - {13.1019f,9.5238f}, - {8.3400f,4.7619f}, - {13.1019f,0.0000f}, - {17.8638f,4.7619f}, - {13.1019f,9.5238f} -}; - -static const GLUTStrokeStrip ch46st[] = -{ - {5,ch46st0} -}; - -static const GLUTStrokeChar ch46 = {26.4838f,1,ch46st}; - -/* char: 0x2f */ - -static const GLUTStrokeVertex ch47st0[] = -{ - {7.2400f,-14.2857f}, - {73.9067f,100.0000f} -}; - -static const GLUTStrokeStrip ch47st[] = -{ - {2,ch47st0} -}; - -static const GLUTStrokeChar ch47 = {82.1067f,1,ch47st}; - -/* char: 0x30 */ - -static const GLUTStrokeVertex ch48st0[] = -{ - {33.5514f,100.0000f}, - {19.2657f,95.2381f}, - {9.7419f,80.9524f}, - {4.9800f,57.1429f}, - {4.9800f,42.8571f}, - {9.7419f,19.0476f}, - {19.2657f,4.7619f}, - {33.5514f,0.0000f}, - {43.0752f,0.0000f}, - {57.3610f,4.7619f}, - {66.8848f,19.0476f}, - {71.6467f,42.8571f}, - {71.6467f,57.1429f}, - {66.8848f,80.9524f}, - {57.3610f,95.2381f}, - {43.0752f,100.0000f}, - {33.5514f,100.0000f} -}; - -static const GLUTStrokeStrip ch48st[] = -{ - {17,ch48st0} -}; - -static const GLUTStrokeChar ch48 = {77.0667f,1,ch48st}; - -/* char: 0x31 */ - -static const GLUTStrokeVertex ch49st0[] = -{ - {11.8200f,80.9524f}, - {21.3438f,85.7143f}, - {35.6295f,100.0000f}, - {35.6295f,0.0000f} -}; - -static const GLUTStrokeStrip ch49st[] = -{ - {4,ch49st0} -}; - -static const GLUTStrokeChar ch49 = {66.5295f,1,ch49st}; - -/* char: 0x32 */ - -static const GLUTStrokeVertex ch50st0[] = -{ - {10.1819f,76.1905f}, - {10.1819f,80.9524f}, - {14.9438f,90.4762f}, - {19.7057f,95.2381f}, - {29.2295f,100.0000f}, - {48.2771f,100.0000f}, - {57.8010f,95.2381f}, - {62.5629f,90.4762f}, - {67.3248f,80.9524f}, - {67.3248f,71.4286f}, - {62.5629f,61.9048f}, - {53.0390f,47.6190f}, - {5.4200f,0.0000f}, - {72.0867f,0.0000f} -}; - -static const GLUTStrokeStrip ch50st[] = -{ - {14,ch50st0} -}; - -static const GLUTStrokeChar ch50 = {77.6467f,1,ch50st}; - -/* char: 0x33 */ - -static const GLUTStrokeVertex ch51st0[] = -{ - {14.5238f,100.0000f}, - {66.9048f,100.0000f}, - {38.3333f,61.9048f}, - {52.6190f,61.9048f}, - {62.1429f,57.1429f}, - {66.9048f,52.3810f}, - {71.6667f,38.0952f}, - {71.6667f,28.5714f}, - {66.9048f,14.2857f}, - {57.3810f,4.7619f}, - {43.0952f,0.0000f}, - {28.8095f,0.0000f}, - {14.5238f,4.7619f}, - {9.7619f,9.5238f}, - {5.0000f,19.0476f} -}; - -static const GLUTStrokeStrip ch51st[] = -{ - {15,ch51st0} -}; - -static const GLUTStrokeChar ch51 = {77.0467f,1,ch51st}; - -/* char: 0x34 */ - -static const GLUTStrokeVertex ch52st0[] = -{ - {51.4990f,100.0000f}, - {3.8800f,33.3333f}, - {75.3086f,33.3333f} -}; - -static const GLUTStrokeVertex ch52st1[] = -{ - {51.4990f,100.0000f}, - {51.4990f,0.0000f} -}; - -static const GLUTStrokeStrip ch52st[] = -{ - {3,ch52st0}, - {2,ch52st1} -}; - -static const GLUTStrokeChar ch52 = {80.1686f,2,ch52st}; - -/* char: 0x35 */ - -static const GLUTStrokeVertex ch53st0[] = -{ - {62.0029f,100.0000f}, - {14.3838f,100.0000f}, - {9.6219f,57.1429f}, - {14.3838f,61.9048f}, - {28.6695f,66.6667f}, - {42.9552f,66.6667f}, - {57.2410f,61.9048f}, - {66.7648f,52.3810f}, - {71.5267f,38.0952f}, - {71.5267f,28.5714f}, - {66.7648f,14.2857f}, - {57.2410f,4.7619f}, - {42.9552f,0.0000f}, - {28.6695f,0.0000f}, - {14.3838f,4.7619f}, - {9.6219f,9.5238f}, - {4.8600f,19.0476f} -}; - -static const GLUTStrokeStrip ch53st[] = -{ - {17,ch53st0} -}; - -static const GLUTStrokeChar ch53 = {77.6867f,1,ch53st}; - -/* char: 0x36 */ - -static const GLUTStrokeVertex ch54st0[] = -{ - {62.7229f,85.7143f}, - {57.9610f,95.2381f}, - {43.6752f,100.0000f}, - {34.1514f,100.0000f}, - {19.8657f,95.2381f}, - {10.3419f,80.9524f}, - {5.5800f,57.1429f}, - {5.5800f,33.3333f}, - {10.3419f,14.2857f}, - {19.8657f,4.7619f}, - {34.1514f,0.0000f}, - {38.9133f,0.0000f}, - {53.1990f,4.7619f}, - {62.7229f,14.2857f}, - {67.4848f,28.5714f}, - {67.4848f,33.3333f}, - {62.7229f,47.6190f}, - {53.1990f,57.1429f}, - {38.9133f,61.9048f}, - {34.1514f,61.9048f}, - {19.8657f,57.1429f}, - {10.3419f,47.6190f}, - {5.5800f,33.3333f} -}; - -static const GLUTStrokeStrip ch54st[] = -{ - {23,ch54st0} -}; - -static const GLUTStrokeChar ch54 = {73.8048f,1,ch54st}; - -/* char: 0x37 */ - -static const GLUTStrokeVertex ch55st0[] = -{ - {72.2267f,100.0000f}, - {24.6076f,0.0000f} -}; - -static const GLUTStrokeVertex ch55st1[] = -{ - {5.5600f,100.0000f}, - {72.2267f,100.0000f} -}; - -static const GLUTStrokeStrip ch55st[] = -{ - {2,ch55st0}, - {2,ch55st1} -}; - -static const GLUTStrokeChar ch55 = {77.2267f,2,ch55st}; - -/* char: 0x38 */ - -static const GLUTStrokeVertex ch56st0[] = -{ - {29.4095f,100.0000f}, - {15.1238f,95.2381f}, - {10.3619f,85.7143f}, - {10.3619f,76.1905f}, - {15.1238f,66.6667f}, - {24.6476f,61.9048f}, - {43.6952f,57.1429f}, - {57.9810f,52.3810f}, - {67.5048f,42.8571f}, - {72.2667f,33.3333f}, - {72.2667f,19.0476f}, - {67.5048f,9.5238f}, - {62.7429f,4.7619f}, - {48.4571f,0.0000f}, - {29.4095f,0.0000f}, - {15.1238f,4.7619f}, - {10.3619f,9.5238f}, - {5.6000f,19.0476f}, - {5.6000f,33.3333f}, - {10.3619f,42.8571f}, - {19.8857f,52.3810f}, - {34.1714f,57.1429f}, - {53.2190f,61.9048f}, - {62.7429f,66.6667f}, - {67.5048f,76.1905f}, - {67.5048f,85.7143f}, - {62.7429f,95.2381f}, - {48.4571f,100.0000f}, - {29.4095f,100.0000f} -}; - -static const GLUTStrokeStrip ch56st[] = -{ - {29,ch56st0} -}; - -static const GLUTStrokeChar ch56 = {77.6667f,1,ch56st}; - -/* char: 0x39 */ - -static const GLUTStrokeVertex ch57st0[] = -{ - {68.5048f,66.6667f}, - {63.7429f,52.3810f}, - {54.2190f,42.8571f}, - {39.9333f,38.0952f}, - {35.1714f,38.0952f}, - {20.8857f,42.8571f}, - {11.3619f,52.3810f}, - {6.6000f,66.6667f}, - {6.6000f,71.4286f}, - {11.3619f,85.7143f}, - {20.8857f,95.2381f}, - {35.1714f,100.0000f}, - {39.9333f,100.0000f}, - {54.2190f,95.2381f}, - {63.7429f,85.7143f}, - {68.5048f,66.6667f}, - {68.5048f,42.8571f}, - {63.7429f,19.0476f}, - {54.2190f,4.7619f}, - {39.9333f,0.0000f}, - {30.4095f,0.0000f}, - {16.1238f,4.7619f}, - {11.3619f,14.2857f} -}; - -static const GLUTStrokeStrip ch57st[] = -{ - {23,ch57st0} -}; - -static const GLUTStrokeChar ch57 = {74.0648f,1,ch57st}; - -/* char: 0x3a */ - -static const GLUTStrokeVertex ch58st0[] = -{ - {14.0819f,66.6667f}, - {9.3200f,61.9048f}, - {14.0819f,57.1429f}, - {18.8438f,61.9048f}, - {14.0819f,66.6667f} -}; - -static const GLUTStrokeVertex ch58st1[] = -{ - {14.0819f,9.5238f}, - {9.3200f,4.7619f}, - {14.0819f,0.0000f}, - {18.8438f,4.7619f}, - {14.0819f,9.5238f} -}; - -static const GLUTStrokeStrip ch58st[] = -{ - {5,ch58st0}, - {5,ch58st1} -}; - -static const GLUTStrokeChar ch58 = {26.2238f,2,ch58st}; - -/* char: 0x3b */ - -static const GLUTStrokeVertex ch59st0[] = -{ - {12.9619f,66.6667f}, - {8.2000f,61.9048f}, - {12.9619f,57.1429f}, - {17.7238f,61.9048f}, - {12.9619f,66.6667f} -}; - -static const GLUTStrokeVertex ch59st1[] = -{ - {17.7238f,4.7619f}, - {12.9619f,0.0000f}, - {8.2000f,4.7619f}, - {12.9619f,9.5238f}, - {17.7238f,4.7619f}, - {17.7238f,-4.7619f}, - {12.9619f,-14.2857f}, - {8.2000f,-19.0476f} -}; - -static const GLUTStrokeStrip ch59st[] = -{ - {5,ch59st0}, - {8,ch59st1} -}; - -static const GLUTStrokeChar ch59 = {26.3038f,2,ch59st}; - -/* char: 0x3c */ - -static const GLUTStrokeVertex ch60st0[] = -{ - {79.2505f,85.7143f}, - {3.0600f,42.8571f}, - {79.2505f,0.0000f} -}; - -static const GLUTStrokeStrip ch60st[] = -{ - {3,ch60st0} -}; - -static const GLUTStrokeChar ch60 = {81.6105f,1,ch60st}; - -/* char: 0x3d */ - -static const GLUTStrokeVertex ch61st0[] = -{ - {5.7000f,57.1429f}, - {91.4143f,57.1429f} -}; - -static const GLUTStrokeVertex ch61st1[] = -{ - {5.7000f,28.5714f}, - {91.4143f,28.5714f} -}; - -static const GLUTStrokeStrip ch61st[] = -{ - {2,ch61st0}, - {2,ch61st1} -}; - -static const GLUTStrokeChar ch61 = {97.2543f,2,ch61st}; - -/* char: 0x3e */ - -static const GLUTStrokeVertex ch62st0[] = -{ - {2.7800f,85.7143f}, - {78.9705f,42.8571f}, - {2.7800f,0.0000f} -}; - -static const GLUTStrokeStrip ch62st[] = -{ - {3,ch62st0} -}; - -static const GLUTStrokeChar ch62 = {81.6105f,1,ch62st}; - -/* char: 0x3f */ - -static const GLUTStrokeVertex ch63st0[] = -{ - {8.4200f,76.1905f}, - {8.4200f,80.9524f}, - {13.1819f,90.4762f}, - {17.9438f,95.2381f}, - {27.4676f,100.0000f}, - {46.5152f,100.0000f}, - {56.0390f,95.2381f}, - {60.8010f,90.4762f}, - {65.5629f,80.9524f}, - {65.5629f,71.4286f}, - {60.8010f,61.9048f}, - {56.0390f,57.1429f}, - {36.9914f,47.6190f}, - {36.9914f,33.3333f} -}; - -static const GLUTStrokeVertex ch63st1[] = -{ - {36.9914f,9.5238f}, - {32.2295f,4.7619f}, - {36.9914f,0.0000f}, - {41.7533f,4.7619f}, - {36.9914f,9.5238f} -}; - -static const GLUTStrokeStrip ch63st[] = -{ - {14,ch63st0}, - {5,ch63st1} -}; - -static const GLUTStrokeChar ch63 = {73.9029f,2,ch63st}; - -/* char: 0x40 */ - -static const GLUTStrokeVertex ch64st0[] = -{ - {49.2171f,52.3810f}, - {39.6933f,57.1429f}, - {30.1695f,57.1429f}, - {25.4076f,47.6190f}, - {25.4076f,42.8571f}, - {30.1695f,33.3333f}, - {39.6933f,33.3333f}, - {49.2171f,38.0952f} -}; - -static const GLUTStrokeVertex ch64st1[] = -{ - {49.2171f,57.1429f}, - {49.2171f,38.0952f}, - {53.9790f,33.3333f}, - {63.5029f,33.3333f}, - {68.2648f,42.8571f}, - {68.2648f,47.6190f}, - {63.5029f,61.9048f}, - {53.9790f,71.4286f}, - {39.6933f,76.1905f}, - {34.9314f,76.1905f}, - {20.6457f,71.4286f}, - {11.1219f,61.9048f}, - {6.3600f,47.6190f}, - {6.3600f,42.8571f}, - {11.1219f,28.5714f}, - {20.6457f,19.0476f}, - {34.9314f,14.2857f}, - {39.6933f,14.2857f}, - {53.9790f,19.0476f} -}; - -static const GLUTStrokeStrip ch64st[] = -{ - {8,ch64st0}, - {19,ch64st1} -}; - -static const GLUTStrokeChar ch64 = {74.3648f,2,ch64st}; - -/* char: 0x41 */ - -static const GLUTStrokeVertex ch65st0[] = -{ - {40.5952f,100.0000f}, - {2.5000f,0.0000f} -}; - -static const GLUTStrokeVertex ch65st1[] = -{ - {40.5952f,100.0000f}, - {78.6905f,0.0000f} -}; - -static const GLUTStrokeVertex ch65st2[] = -{ - {16.7857f,33.3333f}, - {64.4048f,33.3333f} -}; - -static const GLUTStrokeStrip ch65st[] = -{ - {2,ch65st0}, - {2,ch65st1}, - {2,ch65st2} -}; - -static const GLUTStrokeChar ch65 = {80.4905f,3,ch65st}; - -/* char: 0x42 */ - -static const GLUTStrokeVertex ch66st0[] = -{ - {11.4200f,100.0000f}, - {11.4200f,0.0000f} -}; - -static const GLUTStrokeVertex ch66st1[] = -{ - {11.4200f,100.0000f}, - {54.2771f,100.0000f}, - {68.5629f,95.2381f}, - {73.3248f,90.4762f}, - {78.0867f,80.9524f}, - {78.0867f,71.4286f}, - {73.3248f,61.9048f}, - {68.5629f,57.1429f}, - {54.2771f,52.3810f} -}; - -static const GLUTStrokeVertex ch66st2[] = -{ - {11.4200f,52.3810f}, - {54.2771f,52.3810f}, - {68.5629f,47.6190f}, - {73.3248f,42.8571f}, - {78.0867f,33.3333f}, - {78.0867f,19.0476f}, - {73.3248f,9.5238f}, - {68.5629f,4.7619f}, - {54.2771f,0.0000f}, - {11.4200f,0.0000f} -}; - -static const GLUTStrokeStrip ch66st[] = -{ - {2,ch66st0}, - {9,ch66st1}, - {10,ch66st2} -}; - -static const GLUTStrokeChar ch66 = {83.6267f,3,ch66st}; - -/* char: 0x43 */ - -static const GLUTStrokeVertex ch67st0[] = -{ - {78.0886f,76.1905f}, - {73.3267f,85.7143f}, - {63.8029f,95.2381f}, - {54.2790f,100.0000f}, - {35.2314f,100.0000f}, - {25.7076f,95.2381f}, - {16.1838f,85.7143f}, - {11.4219f,76.1905f}, - {6.6600f,61.9048f}, - {6.6600f,38.0952f}, - {11.4219f,23.8095f}, - {16.1838f,14.2857f}, - {25.7076f,4.7619f}, - {35.2314f,0.0000f}, - {54.2790f,0.0000f}, - {63.8029f,4.7619f}, - {73.3267f,14.2857f}, - {78.0886f,23.8095f} -}; - -static const GLUTStrokeStrip ch67st[] = -{ - {18,ch67st0} -}; - -static const GLUTStrokeChar ch67 = {84.4886f,1,ch67st}; - -/* char: 0x44 */ - -static const GLUTStrokeVertex ch68st0[] = -{ - {11.9600f,100.0000f}, - {11.9600f,0.0000f} -}; - -static const GLUTStrokeVertex ch68st1[] = -{ - {11.9600f,100.0000f}, - {45.2933f,100.0000f}, - {59.5790f,95.2381f}, - {69.1029f,85.7143f}, - {73.8648f,76.1905f}, - {78.6267f,61.9048f}, - {78.6267f,38.0952f}, - {73.8648f,23.8095f}, - {69.1029f,14.2857f}, - {59.5790f,4.7619f}, - {45.2933f,0.0000f}, - {11.9600f,0.0000f} -}; - -static const GLUTStrokeStrip ch68st[] = -{ - {2,ch68st0}, - {12,ch68st1} -}; - -static const GLUTStrokeChar ch68 = {85.2867f,2,ch68st}; - -/* char: 0x45 */ - -static const GLUTStrokeVertex ch69st0[] = -{ - {11.4200f,100.0000f}, - {11.4200f,0.0000f} -}; - -static const GLUTStrokeVertex ch69st1[] = -{ - {11.4200f,100.0000f}, - {73.3248f,100.0000f} -}; - -static const GLUTStrokeVertex ch69st2[] = -{ - {11.4200f,52.3810f}, - {49.5152f,52.3810f} -}; - -static const GLUTStrokeVertex ch69st3[] = -{ - {11.4200f,0.0000f}, - {73.3248f,0.0000f} -}; - -static const GLUTStrokeStrip ch69st[] = -{ - {2,ch69st0}, - {2,ch69st1}, - {2,ch69st2}, - {2,ch69st3} -}; - -static const GLUTStrokeChar ch69 = {78.1848f,4,ch69st}; - -/* char: 0x46 */ - -static const GLUTStrokeVertex ch70st0[] = -{ - {11.4200f,100.0000f}, - {11.4200f,0.0000f} -}; - -static const GLUTStrokeVertex ch70st1[] = -{ - {11.4200f,100.0000f}, - {73.3248f,100.0000f} -}; - -static const GLUTStrokeVertex ch70st2[] = -{ - {11.4200f,52.3810f}, - {49.5152f,52.3810f} -}; - -static const GLUTStrokeStrip ch70st[] = -{ - {2,ch70st0}, - {2,ch70st1}, - {2,ch70st2} -}; - -static const GLUTStrokeChar ch70 = {78.7448f,3,ch70st}; - -/* char: 0x47 */ - -static const GLUTStrokeVertex ch71st0[] = -{ - {78.4886f,76.1905f}, - {73.7267f,85.7143f}, - {64.2029f,95.2381f}, - {54.6790f,100.0000f}, - {35.6314f,100.0000f}, - {26.1076f,95.2381f}, - {16.5838f,85.7143f}, - {11.8219f,76.1905f}, - {7.0600f,61.9048f}, - {7.0600f,38.0952f}, - {11.8219f,23.8095f}, - {16.5838f,14.2857f}, - {26.1076f,4.7619f}, - {35.6314f,0.0000f}, - {54.6790f,0.0000f}, - {64.2029f,4.7619f}, - {73.7267f,14.2857f}, - {78.4886f,23.8095f}, - {78.4886f,38.0952f} -}; - -static const GLUTStrokeVertex ch71st1[] = -{ - {54.6790f,38.0952f}, - {78.4886f,38.0952f} -}; - -static const GLUTStrokeStrip ch71st[] = -{ - {19,ch71st0}, - {2,ch71st1} -}; - -static const GLUTStrokeChar ch71 = {89.7686f,2,ch71st}; - -/* char: 0x48 */ - -static const GLUTStrokeVertex ch72st0[] = -{ - {11.4200f,100.0000f}, - {11.4200f,0.0000f} -}; - -static const GLUTStrokeVertex ch72st1[] = -{ - {78.0867f,100.0000f}, - {78.0867f,0.0000f} -}; - -static const GLUTStrokeVertex ch72st2[] = -{ - {11.4200f,52.3810f}, - {78.0867f,52.3810f} -}; - -static const GLUTStrokeStrip ch72st[] = -{ - {2,ch72st0}, - {2,ch72st1}, - {2,ch72st2} -}; - -static const GLUTStrokeChar ch72 = {89.0867f,3,ch72st}; - -/* char: 0x49 */ - -static const GLUTStrokeVertex ch73st0[] = -{ - {10.8600f,100.0000f}, - {10.8600f,0.0000f} -}; - -static const GLUTStrokeStrip ch73st[] = -{ - {2,ch73st0} -}; - -static const GLUTStrokeChar ch73 = {21.3000f,1,ch73st}; - -/* char: 0x4a */ - -static const GLUTStrokeVertex ch74st0[] = -{ - {50.1190f,100.0000f}, - {50.1190f,23.8095f}, - {45.3571f,9.5238f}, - {40.5952f,4.7619f}, - {31.0714f,0.0000f}, - {21.5476f,0.0000f}, - {12.0238f,4.7619f}, - {7.2619f,9.5238f}, - {2.5000f,23.8095f}, - {2.5000f,33.3333f} -}; - -static const GLUTStrokeStrip ch74st[] = -{ - {10,ch74st0} -}; - -static const GLUTStrokeChar ch74 = {59.9990f,1,ch74st}; - -/* char: 0x4b */ - -static const GLUTStrokeVertex ch75st0[] = -{ - {11.2800f,100.0000f}, - {11.2800f,0.0000f} -}; - -static const GLUTStrokeVertex ch75st1[] = -{ - {77.9467f,100.0000f}, - {11.2800f,33.3333f} -}; - -static const GLUTStrokeVertex ch75st2[] = -{ - {35.0895f,57.1429f}, - {77.9467f,0.0000f} -}; - -static const GLUTStrokeStrip ch75st[] = -{ - {2,ch75st0}, - {2,ch75st1}, - {2,ch75st2} -}; - -static const GLUTStrokeChar ch75 = {79.3267f,3,ch75st}; - -/* char: 0x4c */ - -static const GLUTStrokeVertex ch76st0[] = -{ - {11.6800f,100.0000f}, - {11.6800f,0.0000f} -}; - -static const GLUTStrokeVertex ch76st1[] = -{ - {11.6800f,0.0000f}, - {68.8229f,0.0000f} -}; - -static const GLUTStrokeStrip ch76st[] = -{ - {2,ch76st0}, - {2,ch76st1} -}; - -static const GLUTStrokeChar ch76 = {71.3229f,2,ch76st}; - -/* char: 0x4d */ - -static const GLUTStrokeVertex ch77st0[] = -{ - {10.8600f,100.0000f}, - {10.8600f,0.0000f} -}; - -static const GLUTStrokeVertex ch77st1[] = -{ - {10.8600f,100.0000f}, - {48.9552f,0.0000f} -}; - -static const GLUTStrokeVertex ch77st2[] = -{ - {87.0505f,100.0000f}, - {48.9552f,0.0000f} -}; - -static const GLUTStrokeVertex ch77st3[] = -{ - {87.0505f,100.0000f}, - {87.0505f,0.0000f} -}; - -static const GLUTStrokeStrip ch77st[] = -{ - {2,ch77st0}, - {2,ch77st1}, - {2,ch77st2}, - {2,ch77st3} -}; - -static const GLUTStrokeChar ch77 = {97.2105f,4,ch77st}; - -/* char: 0x4e */ - -static const GLUTStrokeVertex ch78st0[] = -{ - {11.1400f,100.0000f}, - {11.1400f,0.0000f} -}; - -static const GLUTStrokeVertex ch78st1[] = -{ - {11.1400f,100.0000f}, - {77.8067f,0.0000f} -}; - -static const GLUTStrokeVertex ch78st2[] = -{ - {77.8067f,100.0000f}, - {77.8067f,0.0000f} -}; - -static const GLUTStrokeStrip ch78st[] = -{ - {2,ch78st0}, - {2,ch78st1}, - {2,ch78st2} -}; - -static const GLUTStrokeChar ch78 = {88.8067f,3,ch78st}; - -/* char: 0x4f */ - -static const GLUTStrokeVertex ch79st0[] = -{ - {34.8114f,100.0000f}, - {25.2876f,95.2381f}, - {15.7638f,85.7143f}, - {11.0019f,76.1905f}, - {6.2400f,61.9048f}, - {6.2400f,38.0952f}, - {11.0019f,23.8095f}, - {15.7638f,14.2857f}, - {25.2876f,4.7619f}, - {34.8114f,0.0000f}, - {53.8590f,0.0000f}, - {63.3829f,4.7619f}, - {72.9067f,14.2857f}, - {77.6686f,23.8095f}, - {82.4305f,38.0952f}, - {82.4305f,61.9048f}, - {77.6686f,76.1905f}, - {72.9067f,85.7143f}, - {63.3829f,95.2381f}, - {53.8590f,100.0000f}, - {34.8114f,100.0000f} -}; - -static const GLUTStrokeStrip ch79st[] = -{ - {21,ch79st0} -}; - -static const GLUTStrokeChar ch79 = {88.8305f,1,ch79st}; - -/* char: 0x50 */ - -static const GLUTStrokeVertex ch80st0[] = -{ - {12.1000f,100.0000f}, - {12.1000f,0.0000f} -}; - -static const GLUTStrokeVertex ch80st1[] = -{ - {12.1000f,100.0000f}, - {54.9571f,100.0000f}, - {69.2429f,95.2381f}, - {74.0048f,90.4762f}, - {78.7667f,80.9524f}, - {78.7667f,66.6667f}, - {74.0048f,57.1429f}, - {69.2429f,52.3810f}, - {54.9571f,47.6190f}, - {12.1000f,47.6190f} -}; - -static const GLUTStrokeStrip ch80st[] = -{ - {2,ch80st0}, - {10,ch80st1} -}; - -static const GLUTStrokeChar ch80 = {85.6667f,2,ch80st}; - -/* char: 0x51 */ - -static const GLUTStrokeVertex ch81st0[] = -{ - {33.8714f,100.0000f}, - {24.3476f,95.2381f}, - {14.8238f,85.7143f}, - {10.0619f,76.1905f}, - {5.3000f,61.9048f}, - {5.3000f,38.0952f}, - {10.0619f,23.8095f}, - {14.8238f,14.2857f}, - {24.3476f,4.7619f}, - {33.8714f,0.0000f}, - {52.9190f,0.0000f}, - {62.4429f,4.7619f}, - {71.9667f,14.2857f}, - {76.7286f,23.8095f}, - {81.4905f,38.0952f}, - {81.4905f,61.9048f}, - {76.7286f,76.1905f}, - {71.9667f,85.7143f}, - {62.4429f,95.2381f}, - {52.9190f,100.0000f}, - {33.8714f,100.0000f} -}; - -static const GLUTStrokeVertex ch81st1[] = -{ - {48.1571f,19.0476f}, - {76.7286f,-9.5238f} -}; - -static const GLUTStrokeStrip ch81st[] = -{ - {21,ch81st0}, - {2,ch81st1} -}; - -static const GLUTStrokeChar ch81 = {88.0905f,2,ch81st}; - -/* char: 0x52 */ - -static const GLUTStrokeVertex ch82st0[] = -{ - {11.6800f,100.0000f}, - {11.6800f,0.0000f} -}; - -static const GLUTStrokeVertex ch82st1[] = -{ - {11.6800f,100.0000f}, - {54.5371f,100.0000f}, - {68.8229f,95.2381f}, - {73.5848f,90.4762f}, - {78.3467f,80.9524f}, - {78.3467f,71.4286f}, - {73.5848f,61.9048f}, - {68.8229f,57.1429f}, - {54.5371f,52.3810f}, - {11.6800f,52.3810f} -}; - -static const GLUTStrokeVertex ch82st2[] = -{ - {45.0133f,52.3810f}, - {78.3467f,0.0000f} -}; - -static const GLUTStrokeStrip ch82st[] = -{ - {2,ch82st0}, - {10,ch82st1}, - {2,ch82st2} -}; - -static const GLUTStrokeChar ch82 = {82.3667f,3,ch82st}; - -/* char: 0x53 */ - -static const GLUTStrokeVertex ch83st0[] = -{ - {74.6667f,85.7143f}, - {65.1429f,95.2381f}, - {50.8571f,100.0000f}, - {31.8095f,100.0000f}, - {17.5238f,95.2381f}, - {8.0000f,85.7143f}, - {8.0000f,76.1905f}, - {12.7619f,66.6667f}, - {17.5238f,61.9048f}, - {27.0476f,57.1429f}, - {55.6190f,47.6190f}, - {65.1429f,42.8571f}, - {69.9048f,38.0952f}, - {74.6667f,28.5714f}, - {74.6667f,14.2857f}, - {65.1429f,4.7619f}, - {50.8571f,0.0000f}, - {31.8095f,0.0000f}, - {17.5238f,4.7619f}, - {8.0000f,14.2857f} -}; - -static const GLUTStrokeStrip ch83st[] = -{ - {20,ch83st0} -}; - -static const GLUTStrokeChar ch83 = {80.8267f,1,ch83st}; - -/* char: 0x54 */ - -static const GLUTStrokeVertex ch84st0[] = -{ - {35.6933f,100.0000f}, - {35.6933f,0.0000f} -}; - -static const GLUTStrokeVertex ch84st1[] = -{ - {2.3600f,100.0000f}, - {69.0267f,100.0000f} -}; - -static const GLUTStrokeStrip ch84st[] = -{ - {2,ch84st0}, - {2,ch84st1} -}; - -static const GLUTStrokeChar ch84 = {71.9467f,2,ch84st}; - -/* char: 0x55 */ - -static const GLUTStrokeVertex ch85st0[] = -{ - {11.5400f,100.0000f}, - {11.5400f,28.5714f}, - {16.3019f,14.2857f}, - {25.8257f,4.7619f}, - {40.1114f,0.0000f}, - {49.6352f,0.0000f}, - {63.9210f,4.7619f}, - {73.4448f,14.2857f}, - {78.2067f,28.5714f}, - {78.2067f,100.0000f} -}; - -static const GLUTStrokeStrip ch85st[] = -{ - {10,ch85st0} -}; - -static const GLUTStrokeChar ch85 = {89.4867f,1,ch85st}; - -/* char: 0x56 */ - -static const GLUTStrokeVertex ch86st0[] = -{ - {2.3600f,100.0000f}, - {40.4552f,0.0000f} -}; - -static const GLUTStrokeVertex ch86st1[] = -{ - {78.5505f,100.0000f}, - {40.4552f,0.0000f} -}; - -static const GLUTStrokeStrip ch86st[] = -{ - {2,ch86st0}, - {2,ch86st1} -}; - -static const GLUTStrokeChar ch86 = {81.6105f,2,ch86st}; - -/* char: 0x57 */ - -static const GLUTStrokeVertex ch87st0[] = -{ - {2.2200f,100.0000f}, - {26.0295f,0.0000f} -}; - -static const GLUTStrokeVertex ch87st1[] = -{ - {49.8390f,100.0000f}, - {26.0295f,0.0000f} -}; - -static const GLUTStrokeVertex ch87st2[] = -{ - {49.8390f,100.0000f}, - {73.6486f,0.0000f} -}; - -static const GLUTStrokeVertex ch87st3[] = -{ - {97.4581f,100.0000f}, - {73.6486f,0.0000f} -}; - -static const GLUTStrokeStrip ch87st[] = -{ - {2,ch87st0}, - {2,ch87st1}, - {2,ch87st2}, - {2,ch87st3} -}; - -static const GLUTStrokeChar ch87 = {100.5181f,4,ch87st}; - -/* char: 0x58 */ - -static const GLUTStrokeVertex ch88st0[] = -{ - {2.5000f,100.0000f}, - {69.1667f,0.0000f} -}; - -static const GLUTStrokeVertex ch88st1[] = -{ - {69.1667f,100.0000f}, - {2.5000f,0.0000f} -}; - -static const GLUTStrokeStrip ch88st[] = -{ - {2,ch88st0}, - {2,ch88st1} -}; - -static const GLUTStrokeChar ch88 = {72.3667f,2,ch88st}; - -/* char: 0x59 */ - -static const GLUTStrokeVertex ch89st0[] = -{ - {1.5200f,100.0000f}, - {39.6152f,52.3810f}, - {39.6152f,0.0000f} -}; - -static const GLUTStrokeVertex ch89st1[] = -{ - {77.7105f,100.0000f}, - {39.6152f,52.3810f} -}; - -static const GLUTStrokeStrip ch89st[] = -{ - {3,ch89st0}, - {2,ch89st1} -}; - -static const GLUTStrokeChar ch89 = {79.6505f,2,ch89st}; - -/* char: 0x5a */ - -static const GLUTStrokeVertex ch90st0[] = -{ - {69.1667f,100.0000f}, - {2.5000f,0.0000f} -}; - -static const GLUTStrokeVertex ch90st1[] = -{ - {2.5000f,100.0000f}, - {69.1667f,100.0000f} -}; - -static const GLUTStrokeVertex ch90st2[] = -{ - {2.5000f,0.0000f}, - {69.1667f,0.0000f} -}; - -static const GLUTStrokeStrip ch90st[] = -{ - {2,ch90st0}, - {2,ch90st1}, - {2,ch90st2} -}; - -static const GLUTStrokeChar ch90 = {73.7467f,3,ch90st}; - -/* char: 0x5b */ - -static const GLUTStrokeVertex ch91st0[] = -{ - {7.7800f,119.0476f}, - {7.7800f,-33.3333f} -}; - -static const GLUTStrokeVertex ch91st1[] = -{ - {12.5419f,119.0476f}, - {12.5419f,-33.3333f} -}; - -static const GLUTStrokeVertex ch91st2[] = -{ - {7.7800f,119.0476f}, - {41.1133f,119.0476f} -}; - -static const GLUTStrokeVertex ch91st3[] = -{ - {7.7800f,-33.3333f}, - {41.1133f,-33.3333f} -}; - -static const GLUTStrokeStrip ch91st[] = -{ - {2,ch91st0}, - {2,ch91st1}, - {2,ch91st2}, - {2,ch91st3} -}; - -static const GLUTStrokeChar ch91 = {46.1133f,4,ch91st}; - -/* char: 0x5c */ - -static const GLUTStrokeVertex ch92st0[] = -{ - {5.8400f,100.0000f}, - {72.5067f,-14.2857f} -}; - -static const GLUTStrokeStrip ch92st[] = -{ - {2,ch92st0} -}; - -static const GLUTStrokeChar ch92 = {78.2067f,1,ch92st}; - -/* char: 0x5d */ - -static const GLUTStrokeVertex ch93st0[] = -{ - {33.0114f,119.0476f}, - {33.0114f,-33.3333f} -}; - -static const GLUTStrokeVertex ch93st1[] = -{ - {37.7733f,119.0476f}, - {37.7733f,-33.3333f} -}; - -static const GLUTStrokeVertex ch93st2[] = -{ - {4.4400f,119.0476f}, - {37.7733f,119.0476f} -}; - -static const GLUTStrokeVertex ch93st3[] = -{ - {4.4400f,-33.3333f}, - {37.7733f,-33.3333f} -}; - -static const GLUTStrokeStrip ch93st[] = -{ - {2,ch93st0}, - {2,ch93st1}, - {2,ch93st2}, - {2,ch93st3} -}; - -static const GLUTStrokeChar ch93 = {46.3933f,4,ch93st}; - -/* char: 0x5e */ - -static const GLUTStrokeVertex ch94st0[] = -{ - {44.0752f,109.5238f}, - {5.9800f,42.8571f} -}; - -static const GLUTStrokeVertex ch94st1[] = -{ - {44.0752f,109.5238f}, - {82.1705f,42.8571f} -}; - -static const GLUTStrokeStrip ch94st[] = -{ - {2,ch94st0}, - {2,ch94st1} -}; - -static const GLUTStrokeChar ch94 = {90.2305f,2,ch94st}; - -/* char: 0x5f */ - -static const GLUTStrokeVertex ch95st0[] = -{ - {-1.1000f,-33.3333f}, - {103.6619f,-33.3333f}, - {103.6619f,-28.5714f}, - {-1.1000f,-28.5714f}, - {-1.1000f,-33.3333f} -}; - -static const GLUTStrokeStrip ch95st[] = -{ - {5,ch95st0} -}; - -static const GLUTStrokeChar ch95 = {104.0619f,1,ch95st}; - -/* char: 0x60 */ - -static const GLUTStrokeVertex ch96st0[] = -{ - {33.0219f,100.0000f}, - {56.8314f,71.4286f} -}; - -static const GLUTStrokeVertex ch96st1[] = -{ - {33.0219f,100.0000f}, - {28.2600f,95.2381f}, - {56.8314f,71.4286f} -}; - -static const GLUTStrokeStrip ch96st[] = -{ - {2,ch96st0}, - {3,ch96st1} -}; - -static const GLUTStrokeChar ch96 = {83.5714f,2,ch96st}; - -/* char: 0x61 */ - -static const GLUTStrokeVertex ch97st0[] = -{ - {63.8229f,66.6667f}, - {63.8229f,0.0000f} -}; - -static const GLUTStrokeVertex ch97st1[] = -{ - {63.8229f,52.3810f}, - {54.2990f,61.9048f}, - {44.7752f,66.6667f}, - {30.4895f,66.6667f}, - {20.9657f,61.9048f}, - {11.4419f,52.3810f}, - {6.6800f,38.0952f}, - {6.6800f,28.5714f}, - {11.4419f,14.2857f}, - {20.9657f,4.7619f}, - {30.4895f,0.0000f}, - {44.7752f,0.0000f}, - {54.2990f,4.7619f}, - {63.8229f,14.2857f} -}; - -static const GLUTStrokeStrip ch97st[] = -{ - {2,ch97st0}, - {14,ch97st1} -}; - -static const GLUTStrokeChar ch97 = {66.6029f,2,ch97st}; - -/* char: 0x62 */ - -static const GLUTStrokeVertex ch98st0[] = -{ - {8.7600f,100.0000f}, - {8.7600f,0.0000f} -}; - -static const GLUTStrokeVertex ch98st1[] = -{ - {8.7600f,52.3810f}, - {18.2838f,61.9048f}, - {27.8076f,66.6667f}, - {42.0933f,66.6667f}, - {51.6171f,61.9048f}, - {61.1410f,52.3810f}, - {65.9029f,38.0952f}, - {65.9029f,28.5714f}, - {61.1410f,14.2857f}, - {51.6171f,4.7619f}, - {42.0933f,0.0000f}, - {27.8076f,0.0000f}, - {18.2838f,4.7619f}, - {8.7600f,14.2857f} -}; - -static const GLUTStrokeStrip ch98st[] = -{ - {2,ch98st0}, - {14,ch98st1} -}; - -static const GLUTStrokeChar ch98 = {70.4629f,2,ch98st}; - -/* char: 0x63 */ - -static const GLUTStrokeVertex ch99st0[] = -{ - {62.6629f,52.3810f}, - {53.1390f,61.9048f}, - {43.6152f,66.6667f}, - {29.3295f,66.6667f}, - {19.8057f,61.9048f}, - {10.2819f,52.3810f}, - {5.5200f,38.0952f}, - {5.5200f,28.5714f}, - {10.2819f,14.2857f}, - {19.8057f,4.7619f}, - {29.3295f,0.0000f}, - {43.6152f,0.0000f}, - {53.1390f,4.7619f}, - {62.6629f,14.2857f} -}; - -static const GLUTStrokeStrip ch99st[] = -{ - {14,ch99st0} -}; - -static const GLUTStrokeChar ch99 = {68.9229f,1,ch99st}; - -/* char: 0x64 */ - -static const GLUTStrokeVertex ch100st0[] = -{ - {61.7829f,100.0000f}, - {61.7829f,0.0000f} -}; - -static const GLUTStrokeVertex ch100st1[] = -{ - {61.7829f,52.3810f}, - {52.2590f,61.9048f}, - {42.7352f,66.6667f}, - {28.4495f,66.6667f}, - {18.9257f,61.9048f}, - {9.4019f,52.3810f}, - {4.6400f,38.0952f}, - {4.6400f,28.5714f}, - {9.4019f,14.2857f}, - {18.9257f,4.7619f}, - {28.4495f,0.0000f}, - {42.7352f,0.0000f}, - {52.2590f,4.7619f}, - {61.7829f,14.2857f} -}; - -static const GLUTStrokeStrip ch100st[] = -{ - {2,ch100st0}, - {14,ch100st1} -}; - -static const GLUTStrokeChar ch100 = {70.2629f,2,ch100st}; - -/* char: 0x65 */ - -static const GLUTStrokeVertex ch101st0[] = -{ - {5.7200f,38.0952f}, - {62.8629f,38.0952f}, - {62.8629f,47.6190f}, - {58.1010f,57.1429f}, - {53.3390f,61.9048f}, - {43.8152f,66.6667f}, - {29.5295f,66.6667f}, - {20.0057f,61.9048f}, - {10.4819f,52.3810f}, - {5.7200f,38.0952f}, - {5.7200f,28.5714f}, - {10.4819f,14.2857f}, - {20.0057f,4.7619f}, - {29.5295f,0.0000f}, - {43.8152f,0.0000f}, - {53.3390f,4.7619f}, - {62.8629f,14.2857f} -}; - -static const GLUTStrokeStrip ch101st[] = -{ - {17,ch101st0} -}; - -static const GLUTStrokeChar ch101 = {68.5229f,1,ch101st}; - -/* char: 0x66 */ - -static const GLUTStrokeVertex ch102st0[] = -{ - {38.7752f,100.0000f}, - {29.2514f,100.0000f}, - {19.7276f,95.2381f}, - {14.9657f,80.9524f}, - {14.9657f,0.0000f} -}; - -static const GLUTStrokeVertex ch102st1[] = -{ - {0.6800f,66.6667f}, - {34.0133f,66.6667f} -}; - -static const GLUTStrokeStrip ch102st[] = -{ - {5,ch102st0}, - {2,ch102st1} -}; - -static const GLUTStrokeChar ch102 = {38.6552f,2,ch102st}; - -/* char: 0x67 */ - -static const GLUTStrokeVertex ch103st0[] = -{ - {62.5029f,66.6667f}, - {62.5029f,-9.5238f}, - {57.7410f,-23.8095f}, - {52.9790f,-28.5714f}, - {43.4552f,-33.3333f}, - {29.1695f,-33.3333f}, - {19.6457f,-28.5714f} -}; - -static const GLUTStrokeVertex ch103st1[] = -{ - {62.5029f,52.3810f}, - {52.9790f,61.9048f}, - {43.4552f,66.6667f}, - {29.1695f,66.6667f}, - {19.6457f,61.9048f}, - {10.1219f,52.3810f}, - {5.3600f,38.0952f}, - {5.3600f,28.5714f}, - {10.1219f,14.2857f}, - {19.6457f,4.7619f}, - {29.1695f,0.0000f}, - {43.4552f,0.0000f}, - {52.9790f,4.7619f}, - {62.5029f,14.2857f} -}; - -static const GLUTStrokeStrip ch103st[] = -{ - {7,ch103st0}, - {14,ch103st1} -}; - -static const GLUTStrokeChar ch103 = {70.9829f,2,ch103st}; - -/* char: 0x68 */ - -static const GLUTStrokeVertex ch104st0[] = -{ - {9.6000f,100.0000f}, - {9.6000f,0.0000f} -}; - -static const GLUTStrokeVertex ch104st1[] = -{ - {9.6000f,47.6190f}, - {23.8857f,61.9048f}, - {33.4095f,66.6667f}, - {47.6952f,66.6667f}, - {57.2190f,61.9048f}, - {61.9810f,47.6190f}, - {61.9810f,0.0000f} -}; - -static const GLUTStrokeStrip ch104st[] = -{ - {2,ch104st0}, - {7,ch104st1} -}; - -static const GLUTStrokeChar ch104 = {71.0210f,2,ch104st}; - -/* char: 0x69 */ - -static const GLUTStrokeVertex ch105st0[] = -{ - {10.0200f,100.0000f}, - {14.7819f,95.2381f}, - {19.5438f,100.0000f}, - {14.7819f,104.7619f}, - {10.0200f,100.0000f} -}; - -static const GLUTStrokeVertex ch105st1[] = -{ - {14.7819f,66.6667f}, - {14.7819f,0.0000f} -}; - -static const GLUTStrokeStrip ch105st[] = -{ - {5,ch105st0}, - {2,ch105st1} -}; - -static const GLUTStrokeChar ch105 = {28.8638f,2,ch105st}; - -/* char: 0x6a */ - -static const GLUTStrokeVertex ch106st0[] = -{ - {17.3876f,100.0000f}, - {22.1495f,95.2381f}, - {26.9114f,100.0000f}, - {22.1495f,104.7619f}, - {17.3876f,100.0000f} -}; - -static const GLUTStrokeVertex ch106st1[] = -{ - {22.1495f,66.6667f}, - {22.1495f,-14.2857f}, - {17.3876f,-28.5714f}, - {7.8638f,-33.3333f}, - {-1.6600f,-33.3333f} -}; - -static const GLUTStrokeStrip ch106st[] = -{ - {5,ch106st0}, - {5,ch106st1} -}; - -static const GLUTStrokeChar ch106 = {36.2314f,2,ch106st}; - -/* char: 0x6b */ - -static const GLUTStrokeVertex ch107st0[] = -{ - {9.6000f,100.0000f}, - {9.6000f,0.0000f} -}; - -static const GLUTStrokeVertex ch107st1[] = -{ - {57.2190f,66.6667f}, - {9.6000f,19.0476f} -}; - -static const GLUTStrokeVertex ch107st2[] = -{ - {28.6476f,38.0952f}, - {61.9810f,0.0000f} -}; - -static const GLUTStrokeStrip ch107st[] = -{ - {2,ch107st0}, - {2,ch107st1}, - {2,ch107st2} -}; - -static const GLUTStrokeChar ch107 = {62.5210f,3,ch107st}; - -/* char: 0x6c */ - -static const GLUTStrokeVertex ch108st0[] = -{ - {10.0200f,100.0000f}, - {10.0200f,0.0000f} -}; - -static const GLUTStrokeStrip ch108st[] = -{ - {2,ch108st0} -}; - -static const GLUTStrokeChar ch108 = {19.3400f,1,ch108st}; - -/* char: 0x6d */ - -static const GLUTStrokeVertex ch109st0[] = -{ - {9.6000f,66.6667f}, - {9.6000f,0.0000f} -}; - -static const GLUTStrokeVertex ch109st1[] = -{ - {9.6000f,47.6190f}, - {23.8857f,61.9048f}, - {33.4095f,66.6667f}, - {47.6952f,66.6667f}, - {57.2190f,61.9048f}, - {61.9810f,47.6190f}, - {61.9810f,0.0000f} -}; - -static const GLUTStrokeVertex ch109st2[] = -{ - {61.9810f,47.6190f}, - {76.2667f,61.9048f}, - {85.7905f,66.6667f}, - {100.0762f,66.6667f}, - {109.6000f,61.9048f}, - {114.3619f,47.6190f}, - {114.3619f,0.0000f} -}; - -static const GLUTStrokeStrip ch109st[] = -{ - {2,ch109st0}, - {7,ch109st1}, - {7,ch109st2} -}; - -static const GLUTStrokeChar ch109 = {123.9619f,3,ch109st}; - -/* char: 0x6e */ - -static const GLUTStrokeVertex ch110st0[] = -{ - {9.1800f,66.6667f}, - {9.1800f,0.0000f} -}; - -static const GLUTStrokeVertex ch110st1[] = -{ - {9.1800f,47.6190f}, - {23.4657f,61.9048f}, - {32.9895f,66.6667f}, - {47.2752f,66.6667f}, - {56.7990f,61.9048f}, - {61.5610f,47.6190f}, - {61.5610f,0.0000f} -}; - -static const GLUTStrokeStrip ch110st[] = -{ - {2,ch110st0}, - {7,ch110st1} -}; - -static const GLUTStrokeChar ch110 = {70.8810f,2,ch110st}; - -/* char: 0x6f */ - -static const GLUTStrokeVertex ch111st0[] = -{ - {28.7895f,66.6667f}, - {19.2657f,61.9048f}, - {9.7419f,52.3810f}, - {4.9800f,38.0952f}, - {4.9800f,28.5714f}, - {9.7419f,14.2857f}, - {19.2657f,4.7619f}, - {28.7895f,0.0000f}, - {43.0752f,0.0000f}, - {52.5990f,4.7619f}, - {62.1229f,14.2857f}, - {66.8848f,28.5714f}, - {66.8848f,38.0952f}, - {62.1229f,52.3810f}, - {52.5990f,61.9048f}, - {43.0752f,66.6667f}, - {28.7895f,66.6667f} -}; - -static const GLUTStrokeStrip ch111st[] = -{ - {17,ch111st0} -}; - -static const GLUTStrokeChar ch111 = {71.7448f,1,ch111st}; - -/* char: 0x70 */ - -static const GLUTStrokeVertex ch112st0[] = -{ - {9.4600f,66.6667f}, - {9.4600f,-33.3333f} -}; - -static const GLUTStrokeVertex ch112st1[] = -{ - {9.4600f,52.3810f}, - {18.9838f,61.9048f}, - {28.5076f,66.6667f}, - {42.7933f,66.6667f}, - {52.3171f,61.9048f}, - {61.8410f,52.3810f}, - {66.6029f,38.0952f}, - {66.6029f,28.5714f}, - {61.8410f,14.2857f}, - {52.3171f,4.7619f}, - {42.7933f,0.0000f}, - {28.5076f,0.0000f}, - {18.9838f,4.7619f}, - {9.4600f,14.2857f} -}; - -static const GLUTStrokeStrip ch112st[] = -{ - {2,ch112st0}, - {14,ch112st1} -}; - -static const GLUTStrokeChar ch112 = {70.8029f,2,ch112st}; - -/* char: 0x71 */ - -static const GLUTStrokeVertex ch113st0[] = -{ - {61.9829f,66.6667f}, - {61.9829f,-33.3333f} -}; - -static const GLUTStrokeVertex ch113st1[] = -{ - {61.9829f,52.3810f}, - {52.4590f,61.9048f}, - {42.9352f,66.6667f}, - {28.6495f,66.6667f}, - {19.1257f,61.9048f}, - {9.6019f,52.3810f}, - {4.8400f,38.0952f}, - {4.8400f,28.5714f}, - {9.6019f,14.2857f}, - {19.1257f,4.7619f}, - {28.6495f,0.0000f}, - {42.9352f,0.0000f}, - {52.4590f,4.7619f}, - {61.9829f,14.2857f} -}; - -static const GLUTStrokeStrip ch113st[] = -{ - {2,ch113st0}, - {14,ch113st1} -}; - -static const GLUTStrokeChar ch113 = {70.7429f,2,ch113st}; - -/* char: 0x72 */ - -static const GLUTStrokeVertex ch114st0[] = -{ - {9.4600f,66.6667f}, - {9.4600f,0.0000f} -}; - -static const GLUTStrokeVertex ch114st1[] = -{ - {9.4600f,38.0952f}, - {14.2219f,52.3810f}, - {23.7457f,61.9048f}, - {33.2695f,66.6667f}, - {47.5552f,66.6667f} -}; - -static const GLUTStrokeStrip ch114st[] = -{ - {2,ch114st0}, - {5,ch114st1} -}; - -static const GLUTStrokeChar ch114 = {49.4952f,2,ch114st}; - -/* char: 0x73 */ - -static const GLUTStrokeVertex ch115st0[] = -{ - {57.0810f,52.3810f}, - {52.3190f,61.9048f}, - {38.0333f,66.6667f}, - {23.7476f,66.6667f}, - {9.4619f,61.9048f}, - {4.7000f,52.3810f}, - {9.4619f,42.8571f}, - {18.9857f,38.0952f}, - {42.7952f,33.3333f}, - {52.3190f,28.5714f}, - {57.0810f,19.0476f}, - {57.0810f,14.2857f}, - {52.3190f,4.7619f}, - {38.0333f,0.0000f}, - {23.7476f,0.0000f}, - {9.4619f,4.7619f}, - {4.7000f,14.2857f} -}; - -static const GLUTStrokeStrip ch115st[] = -{ - {17,ch115st0} -}; - -static const GLUTStrokeChar ch115 = {62.3210f,1,ch115st}; - -/* char: 0x74 */ - -static const GLUTStrokeVertex ch116st0[] = -{ - {14.8257f,100.0000f}, - {14.8257f,19.0476f}, - {19.5876f,4.7619f}, - {29.1114f,0.0000f}, - {38.6352f,0.0000f} -}; - -static const GLUTStrokeVertex ch116st1[] = -{ - {0.5400f,66.6667f}, - {33.8733f,66.6667f} -}; - -static const GLUTStrokeStrip ch116st[] = -{ - {5,ch116st0}, - {2,ch116st1} -}; - -static const GLUTStrokeChar ch116 = {39.3152f,2,ch116st}; - -/* char: 0x75 */ - -static const GLUTStrokeVertex ch117st0[] = -{ - {9.4600f,66.6667f}, - {9.4600f,19.0476f}, - {14.2219f,4.7619f}, - {23.7457f,0.0000f}, - {38.0314f,0.0000f}, - {47.5552f,4.7619f}, - {61.8410f,19.0476f} -}; - -static const GLUTStrokeVertex ch117st1[] = -{ - {61.8410f,66.6667f}, - {61.8410f,0.0000f} -}; - -static const GLUTStrokeStrip ch117st[] = -{ - {7,ch117st0}, - {2,ch117st1} -}; - -static const GLUTStrokeChar ch117 = {71.1610f,2,ch117st}; - -/* char: 0x76 */ - -static const GLUTStrokeVertex ch118st0[] = -{ - {1.8000f,66.6667f}, - {30.3714f,0.0000f} -}; - -static const GLUTStrokeVertex ch118st1[] = -{ - {58.9429f,66.6667f}, - {30.3714f,0.0000f} -}; - -static const GLUTStrokeStrip ch118st[] = -{ - {2,ch118st0}, - {2,ch118st1} -}; - -static const GLUTStrokeChar ch118 = {60.6029f,2,ch118st}; - -/* char: 0x77 */ - -static const GLUTStrokeVertex ch119st0[] = -{ - {2.5000f,66.6667f}, - {21.5476f,0.0000f} -}; - -static const GLUTStrokeVertex ch119st1[] = -{ - {40.5952f,66.6667f}, - {21.5476f,0.0000f} -}; - -static const GLUTStrokeVertex ch119st2[] = -{ - {40.5952f,66.6667f}, - {59.6429f,0.0000f} -}; - -static const GLUTStrokeVertex ch119st3[] = -{ - {78.6905f,66.6667f}, - {59.6429f,0.0000f} -}; - -static const GLUTStrokeStrip ch119st[] = -{ - {2,ch119st0}, - {2,ch119st1}, - {2,ch119st2}, - {2,ch119st3} -}; - -static const GLUTStrokeChar ch119 = {80.4905f,4,ch119st}; - -/* char: 0x78 */ - -static const GLUTStrokeVertex ch120st0[] = -{ - {1.6600f,66.6667f}, - {54.0410f,0.0000f} -}; - -static const GLUTStrokeVertex ch120st1[] = -{ - {54.0410f,66.6667f}, - {1.6600f,0.0000f} -}; - -static const GLUTStrokeStrip ch120st[] = -{ - {2,ch120st0}, - {2,ch120st1} -}; - -static const GLUTStrokeChar ch120 = {56.4010f,2,ch120st}; - -/* char: 0x79 */ - -static const GLUTStrokeVertex ch121st0[] = -{ - {6.5619f,66.6667f}, - {35.1333f,0.0000f} -}; - -static const GLUTStrokeVertex ch121st1[] = -{ - {63.7048f,66.6667f}, - {35.1333f,0.0000f}, - {25.6095f,-19.0476f}, - {16.0857f,-28.5714f}, - {6.5619f,-33.3333f}, - {1.8000f,-33.3333f} -}; - -static const GLUTStrokeStrip ch121st[] = -{ - {2,ch121st0}, - {6,ch121st1} -}; - -static const GLUTStrokeChar ch121 = {66.0648f,2,ch121st}; - -/* char: 0x7a */ - -static const GLUTStrokeVertex ch122st0[] = -{ - {56.8210f,66.6667f}, - {4.4400f,0.0000f} -}; - -static const GLUTStrokeVertex ch122st1[] = -{ - {4.4400f,66.6667f}, - {56.8210f,66.6667f} -}; - -static const GLUTStrokeVertex ch122st2[] = -{ - {4.4400f,0.0000f}, - {56.8210f,0.0000f} -}; - -static const GLUTStrokeStrip ch122st[] = -{ - {2,ch122st0}, - {2,ch122st1}, - {2,ch122st2} -}; - -static const GLUTStrokeChar ch122 = {61.8210f,3,ch122st}; - -/* char: 0x7b */ - -static const GLUTStrokeVertex ch123st0[] = -{ - {31.1895f,119.0476f}, - {21.6657f,114.2857f}, - {16.9038f,109.5238f}, - {12.1419f,100.0000f}, - {12.1419f,90.4762f}, - {16.9038f,80.9524f}, - {21.6657f,76.1905f}, - {26.4276f,66.6667f}, - {26.4276f,57.1429f}, - {16.9038f,47.6190f} -}; - -static const GLUTStrokeVertex ch123st1[] = -{ - {21.6657f,114.2857f}, - {16.9038f,104.7619f}, - {16.9038f,95.2381f}, - {21.6657f,85.7143f}, - {26.4276f,80.9524f}, - {31.1895f,71.4286f}, - {31.1895f,61.9048f}, - {26.4276f,52.3810f}, - {7.3800f,42.8571f}, - {26.4276f,33.3333f}, - {31.1895f,23.8095f}, - {31.1895f,14.2857f}, - {26.4276f,4.7619f}, - {21.6657f,0.0000f}, - {16.9038f,-9.5238f}, - {16.9038f,-19.0476f}, - {21.6657f,-28.5714f} -}; - -static const GLUTStrokeVertex ch123st2[] = -{ - {16.9038f,38.0952f}, - {26.4276f,28.5714f}, - {26.4276f,19.0476f}, - {21.6657f,9.5238f}, - {16.9038f,4.7619f}, - {12.1419f,-4.7619f}, - {12.1419f,-14.2857f}, - {16.9038f,-23.8095f}, - {21.6657f,-28.5714f}, - {31.1895f,-33.3333f} -}; - -static const GLUTStrokeStrip ch123st[] = -{ - {10,ch123st0}, - {17,ch123st1}, - {10,ch123st2} -}; - -static const GLUTStrokeChar ch123 = {41.6295f,3,ch123st}; - -/* char: 0x7c */ - -static const GLUTStrokeVertex ch124st0[] = -{ - {11.5400f,119.0476f}, - {11.5400f,-33.3333f} -}; - -static const GLUTStrokeStrip ch124st[] = -{ - {2,ch124st0} -}; - -static const GLUTStrokeChar ch124 = {23.7800f,1,ch124st}; - -/* char: 0x7d */ - -static const GLUTStrokeVertex ch125st0[] = -{ - {9.1800f,119.0476f}, - {18.7038f,114.2857f}, - {23.4657f,109.5238f}, - {28.2276f,100.0000f}, - {28.2276f,90.4762f}, - {23.4657f,80.9524f}, - {18.7038f,76.1905f}, - {13.9419f,66.6667f}, - {13.9419f,57.1429f}, - {23.4657f,47.6190f} -}; - -static const GLUTStrokeVertex ch125st1[] = -{ - {18.7038f,114.2857f}, - {23.4657f,104.7619f}, - {23.4657f,95.2381f}, - {18.7038f,85.7143f}, - {13.9419f,80.9524f}, - {9.1800f,71.4286f}, - {9.1800f,61.9048f}, - {13.9419f,52.3810f}, - {32.9895f,42.8571f}, - {13.9419f,33.3333f}, - {9.1800f,23.8095f}, - {9.1800f,14.2857f}, - {13.9419f,4.7619f}, - {18.7038f,0.0000f}, - {23.4657f,-9.5238f}, - {23.4657f,-19.0476f}, - {18.7038f,-28.5714f} -}; - -static const GLUTStrokeVertex ch125st2[] = -{ - {23.4657f,38.0952f}, - {13.9419f,28.5714f}, - {13.9419f,19.0476f}, - {18.7038f,9.5238f}, - {23.4657f,4.7619f}, - {28.2276f,-4.7619f}, - {28.2276f,-14.2857f}, - {23.4657f,-23.8095f}, - {18.7038f,-28.5714f}, - {9.1800f,-33.3333f} -}; - -static const GLUTStrokeStrip ch125st[] = -{ - {10,ch125st0}, - {17,ch125st1}, - {10,ch125st2} -}; - -static const GLUTStrokeChar ch125 = {41.4695f,3,ch125st}; - -/* char: 0x7e */ - -static const GLUTStrokeVertex ch126st0[] = -{ - {2.9200f,28.5714f}, - {2.9200f,38.0952f}, - {7.6819f,52.3810f}, - {17.2057f,57.1429f}, - {26.7295f,57.1429f}, - {36.2533f,52.3810f}, - {55.3010f,38.0952f}, - {64.8248f,33.3333f}, - {74.3486f,33.3333f}, - {83.8724f,38.0952f}, - {88.6343f,47.6190f} -}; - -static const GLUTStrokeVertex ch126st1[] = -{ - {2.9200f,38.0952f}, - {7.6819f,47.6190f}, - {17.2057f,52.3810f}, - {26.7295f,52.3810f}, - {36.2533f,47.6190f}, - {55.3010f,33.3333f}, - {64.8248f,28.5714f}, - {74.3486f,28.5714f}, - {83.8724f,33.3333f}, - {88.6343f,47.6190f}, - {88.6343f,57.1429f} -}; - -static const GLUTStrokeStrip ch126st[] = -{ - {11,ch126st0}, - {11,ch126st1} -}; - -static const GLUTStrokeChar ch126 = {91.2743f,2,ch126st}; - -static const GLUTStrokeChar *chars[] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126 -}; - -const GLUTStrokeFont glutStrokeRoman = {"Roman",128,chars,152.3809f,33.3333f}; diff --git a/src/glut/dos/shapes.c b/src/glut/dos/shapes.c deleted file mode 100644 index 4edebe90ed..0000000000 --- a/src/glut/dos/shapes.c +++ /dev/null @@ -1,1143 +0,0 @@ -/* - * freeglut_geometry.c - * - * Freeglut geometry rendering methods. - * - * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. - * Written by Pawel W. Olszta, - * Creation date: Fri Dec 3 1999 - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include -#include "internal.h" - -/* - * TODO BEFORE THE STABLE RELEASE: - * - * Following functions have been contributed by Andreas Umbach. - * - * glutWireCube() -- looks OK - * glutSolidCube() -- OK - * - * Those functions have been implemented by John Fay. - * - * glutWireTorus() -- looks OK - * glutSolidTorus() -- looks OK - * glutWireDodecahedron() -- looks OK - * glutSolidDodecahedron() -- looks OK - * glutWireOctahedron() -- looks OK - * glutSolidOctahedron() -- looks OK - * glutWireTetrahedron() -- looks OK - * glutSolidTetrahedron() -- looks OK - * glutWireIcosahedron() -- looks OK - * glutSolidIcosahedron() -- looks OK - * - * The Following functions have been updated by Nigel Stewart, based - * on FreeGLUT 2.0.0 implementations: - * - * glutWireSphere() -- looks OK - * glutSolidSphere() -- looks OK - * glutWireCone() -- looks OK - * glutSolidCone() -- looks OK - */ - - -/* -- INTERFACE FUNCTIONS -------------------------------------------------- */ - -/* - * Draws a wireframed cube. Code contributed by Andreas Umbach - */ -void GLUTAPIENTRY glutWireCube( GLdouble dSize ) -{ - double size = dSize * 0.5; - -# define V(a,b,c) glVertex3d( a size, b size, c size ); -# define N(a,b,c) glNormal3d( a, b, c ); - - /* - * PWO: I dared to convert the code to use macros... - */ - glBegin( GL_LINE_LOOP ); N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-); V(+,+,-); V(+,+,+); glEnd(); - glBegin( GL_LINE_LOOP ); N( 0.0, 1.0, 0.0); V(+,+,+); V(+,+,-); V(-,+,-); V(-,+,+); glEnd(); - glBegin( GL_LINE_LOOP ); N( 0.0, 0.0, 1.0); V(+,+,+); V(-,+,+); V(-,-,+); V(+,-,+); glEnd(); - glBegin( GL_LINE_LOOP ); N(-1.0, 0.0, 0.0); V(-,-,+); V(-,+,+); V(-,+,-); V(-,-,-); glEnd(); - glBegin( GL_LINE_LOOP ); N( 0.0,-1.0, 0.0); V(-,-,+); V(-,-,-); V(+,-,-); V(+,-,+); glEnd(); - glBegin( GL_LINE_LOOP ); N( 0.0, 0.0,-1.0); V(-,-,-); V(-,+,-); V(+,+,-); V(+,-,-); glEnd(); - -# undef V -# undef N -} - -/* - * Draws a solid cube. Code contributed by Andreas Umbach - */ -void GLUTAPIENTRY glutSolidCube( GLdouble dSize ) -{ - double size = dSize * 0.5; - -# define V(a,b,c) glVertex3d( a size, b size, c size ); -# define N(a,b,c) glNormal3d( a, b, c ); - - /* - * PWO: Again, I dared to convert the code to use macros... - */ - glBegin( GL_QUADS ); - N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-); V(+,+,-); V(+,+,+); - N( 0.0, 1.0, 0.0); V(+,+,+); V(+,+,-); V(-,+,-); V(-,+,+); - N( 0.0, 0.0, 1.0); V(+,+,+); V(-,+,+); V(-,-,+); V(+,-,+); - N(-1.0, 0.0, 0.0); V(-,-,+); V(-,+,+); V(-,+,-); V(-,-,-); - N( 0.0,-1.0, 0.0); V(-,-,+); V(-,-,-); V(+,-,-); V(+,-,+); - N( 0.0, 0.0,-1.0); V(-,-,-); V(-,+,-); V(+,+,-); V(+,-,-); - glEnd(); - -# undef V -# undef N -} - -/* - * Compute lookup table of cos and sin values forming a cirle - * - * Notes: - * It is the responsibility of the caller to free these tables - * The size of the table is (n+1) to form a connected loop - * The last entry is exactly the same as the first - * The sign of n can be flipped to get the reverse loop - */ - -static void circleTable(double **sint,double **cost,const int n) -{ - int i; - - /* Table size, the sign of n flips the circle direction */ - - const int size = abs(n); - - /* Determine the angle between samples */ - - const double angle = 2*M_PI/(double)n; - - /* Allocate memory for n samples, plus duplicate of first entry at the end */ - - *sint = (double *) calloc(sizeof(double), size+1); - *cost = (double *) calloc(sizeof(double), size+1); - - /* Bail out if memory allocation fails, fgError never returns */ - - if (!(*sint) || !(*cost)) - { - free(*sint); - free(*cost); - _glut_fatal("Failed to allocate memory in circleTable"); - } - - /* Compute cos and sin around the circle */ - - for (i=0; i=0; j--) - { - glNormal3d(cost1[j]*r1, sint1[j]*r1, z1 ); - glVertex3d(cost1[j]*r1*radius, sint1[j]*r1*radius, z1*radius); - } - - glEnd(); - - /* Cover each stack with a quad strip, except the top and bottom stacks */ - - for( i=1; i=0; j--) - glVertex3d(cost[j]*radius, sint[j]*radius, height); - glEnd(); - - /* Do the stacks */ - - z0 = 0.0; - z1 = zStep; - - for (i=1; i<=stacks; i++) - { - if (i==stacks) - z1 = height; - - glBegin(GL_QUAD_STRIP); - for (j=0; j<=slices; j++ ) - { - glNormal3d(cost[j], sint[j], 0.0 ); - glVertex3d(cost[j]*radius, sint[j]*radius, z0 ); - glVertex3d(cost[j]*radius, sint[j]*radius, z1 ); - } - glEnd(); - - z0 = z1; z1 += zStep; - } - - /* Release sin and cos tables */ - - free(sint); - free(cost); -} - -/* - * Draws a wire cylinder - */ -void GLUTAPIENTRY glutWireCylinder(GLdouble radius, GLdouble height, GLint slices, GLint stacks) -{ - int i,j; - - /* Step in z and radius as stacks are drawn. */ - - double z = 0.0; - const double zStep = height/stacks; - - /* Pre-computed circle */ - - double *sint,*cost; - circleTable(&sint,&cost,-slices); - - /* Draw the stacks... */ - - for (i=0; i<=stacks; i++) - { - if (i==stacks) - z = height; - - glBegin(GL_LINE_LOOP); - - for( j=0; j - -#include "internal.h" - - -#define FREQUENCY 100 /* set this to zero to use the default timer */ - - -static int timer_installed; -#if FREQUENCY -static volatile int ticks; - - -static void -ticks_timer (void *p) -{ - (void)p; - ticks++; -} ENDOFUNC(ticks_timer) -#else -#include - -static struct timeval then; -#endif - - -int APIENTRY -glutGet (GLenum type) -{ - switch (type) { - case GLUT_WINDOW_X: - return _glut_current->xpos; - case GLUT_WINDOW_Y: - return _glut_current->ypos; - case GLUT_WINDOW_WIDTH: - return _glut_current->width; - case GLUT_WINDOW_HEIGHT: - return _glut_current->height; - case GLUT_WINDOW_STENCIL_SIZE: - return _glut_visual.stencil; - case GLUT_WINDOW_DEPTH_SIZE: - return _glut_visual.depth; - case GLUT_WINDOW_RGBA: - return !(_glut_default.mode & GLUT_INDEX); - case GLUT_WINDOW_COLORMAP_SIZE: - return (_glut_default.mode & GLUT_INDEX) ? (256 - RESERVED_COLORS) : 0; - case GLUT_SCREEN_WIDTH: - return _glut_visual.geometry[0]; - case GLUT_SCREEN_HEIGHT: - return _glut_visual.geometry[1]; - case GLUT_INIT_WINDOW_X: - return _glut_default.x; - case GLUT_INIT_WINDOW_Y: - return _glut_default.y; - case GLUT_INIT_WINDOW_WIDTH: - return _glut_default.width; - case GLUT_INIT_WINDOW_HEIGHT: - return _glut_default.height; - case GLUT_INIT_DISPLAY_MODE: - return _glut_default.mode; - case GLUT_ELAPSED_TIME: -#if FREQUENCY - if (!timer_installed) { - timer_installed = GL_TRUE; - LOCKDATA(ticks); - LOCKFUNC(ticks_timer); - pc_install_int(ticks_timer, NULL, FREQUENCY); - } - return ticks * 1000 / FREQUENCY; -#else - if (!timer_installed) { - timer_installed = GL_TRUE; - gettimeofday(&then, NULL); - return 0; - } else { - struct timeval now; - gettimeofday(&now, NULL); - return (now.tv_usec - then.tv_usec) / 1000 + - (now.tv_sec - then.tv_sec) * 1000; - } -#endif - default: - return -1; - } -} - - -int APIENTRY -glutDeviceGet (GLenum type) -{ - switch (type) { - case GLUT_HAS_KEYBOARD: - return GL_TRUE; - case GLUT_HAS_MOUSE: - return (_glut_mouse != 0); - case GLUT_NUM_MOUSE_BUTTONS: - return _glut_mouse; - case GLUT_HAS_SPACEBALL: - case GLUT_HAS_DIAL_AND_BUTTON_BOX: - case GLUT_HAS_TABLET: - return GL_FALSE; - case GLUT_NUM_SPACEBALL_BUTTONS: - case GLUT_NUM_BUTTON_BOX_BUTTONS: - case GLUT_NUM_DIALS: - case GLUT_NUM_TABLET_BUTTONS: - return 0; - default: - return -1; - } -} - - -int APIENTRY -glutGetModifiers (void) -{ - int mod = 0; - int shifts = pc_keyshifts(); - - if (shifts & (KB_SHIFT_FLAG | KB_CAPSLOCK_FLAG)) { - mod |= GLUT_ACTIVE_SHIFT; - } - - if (shifts & KB_ALT_FLAG) { - mod |= GLUT_ACTIVE_ALT; - } - - if (shifts & KB_CTRL_FLAG) { - mod |= GLUT_ACTIVE_CTRL; - } - - return mod; -} - - -void APIENTRY -glutReportErrors (void) -{ - /* reports all the OpenGL errors that happened till now */ -} - - -/* GAME MODE - * Hack alert: incomplete... what is GameMode, anyway? - */ -static GLint game; -static GLboolean game_possible; -static GLboolean game_active; -static GLuint game_width; -static GLuint game_height; -static GLuint game_bpp; -static GLuint game_refresh; - - -void APIENTRY -glutGameModeString (const char *string) -{ - if (sscanf(string, "%ux%u:%u@%u", &game_width, &game_height, &game_bpp, &game_refresh) == 4) { - game_possible = GL_TRUE; - } -} - - -int APIENTRY -glutGameModeGet (GLenum mode) -{ - switch (mode) { - case GLUT_GAME_MODE_ACTIVE: - return game_active; - case GLUT_GAME_MODE_POSSIBLE: - return game_possible && !_glut_current; - case GLUT_GAME_MODE_WIDTH: - return game_active ? (int)game_width : -1; - case GLUT_GAME_MODE_HEIGHT: - return game_active ? (int)game_height : -1; - case GLUT_GAME_MODE_PIXEL_DEPTH: - return game_active ? (int)game_bpp : -1; - case GLUT_GAME_MODE_REFRESH_RATE: - return game_active ? (int)game_refresh : -1; - default: - return -1; - } -} - - -int APIENTRY -glutEnterGameMode (void) -{ - if (glutGameModeGet(GLUT_GAME_MODE_POSSIBLE)) { - _glut_visual.bpp = game_bpp; - _glut_visual.refresh = game_refresh; - - glutInitWindowSize(game_width, game_height); - - if ((game = glutCreateWindow("")) > 0) { - game_active = GL_TRUE; - } - - return game; - } else { - return 0; - } -} - - -void GLUTAPIENTRY -glutLeaveGameMode (void) -{ - if (glutGameModeGet(GLUT_GAME_MODE_ACTIVE)) { - game_active = GL_FALSE; - - glutDestroyWindow(game); - } -} diff --git a/src/glut/dos/stroke.c b/src/glut/dos/stroke.c deleted file mode 100644 index aa2c06a7db..0000000000 --- a/src/glut/dos/stroke.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * FxGLUT version 0.12 - GLUT for Voodoo 1 and 2 under Linux - * Copyright (C) 1999 Christopher John Purnell - * cjp@lost.org.uk - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "internal.h" - - -void -glutStrokeCharacter (void *font, int c) -{ - const GLUTStrokeFont *sfp = _glut_font(font); - const GLUTStrokeChar *scp; - const GLUTStrokeStrip *ssp; - const GLUTStrokeVertex *svp; - unsigned i, j; - - if (((unsigned)c) >= sfp->num || !(scp = sfp->table[c])) - return; - - ssp = scp->strip; - - for (i = 0; i < scp->num; i++, ssp++) { - svp = ssp->vertex; - - glBegin(GL_LINE_STRIP); - for (j = 0; j < ssp->num; j++, svp++) { - glVertex2f(svp->x, svp->y); - } - glEnd(); - } - - glTranslatef(scp->right, 0.0, 0.0); -} - - -void -glutStrokeString (void *font, const unsigned char *string) -{ - const GLUTStrokeFont *sfp = _glut_font(font); - const GLUTStrokeChar *scp; - const GLUTStrokeStrip *ssp; - const GLUTStrokeVertex *svp; - unsigned char c; - unsigned i, j; - - while ((c = *(string++))) { - if (c < sfp->num && (scp = sfp->table[c])) { - ssp = scp->strip; - - for (i = 0; i < scp->num; i++, ssp++) { - svp = ssp->vertex; - - glBegin(GL_LINE_STRIP); - for (j = 0; j < ssp->num; j++, svp++) { - glVertex2f(svp->x, svp->y); - } - glEnd(); - } - - glTranslatef(scp->right, 0.0, 0.0); - } - } -} - - -int -glutStrokeWidth (void *font, int c) -{ - const GLUTStrokeFont *sfp = _glut_font(font); - const GLUTStrokeChar *scp; - - if (((unsigned)c) >= sfp->num || !(scp = sfp->table[c])) - return 0; - - return scp->right; -} - - -int -glutStrokeLength (void *font, const unsigned char *string) -{ - const GLUTStrokeFont *sfp = _glut_font(font); - const GLUTStrokeChar *scp; - unsigned char c; - int length = 0; - - while ((c = *(string++))) { - if (c < sfp->num && (scp = sfp->table[c])) - length += scp->right; - } - - return length; -} - - -GLfloat -glutStrokeHeight (void *font) -{ - const GLUTStrokeFont *sfp = _glut_font(font); - - return sfp->height; -} diff --git a/src/glut/dos/teapot.c b/src/glut/dos/teapot.c deleted file mode 100644 index 8d02eb49f3..0000000000 --- a/src/glut/dos/teapot.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * (c) Copyright 1993, Silicon Graphics, Inc. - * - * ALL RIGHTS RESERVED - * - * Permission to use, copy, modify, and distribute this software - * for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that - * both the copyright notice and this permission notice appear in - * supporting documentation, and that the name of Silicon - * Graphics, Inc. not be used in advertising or publicity - * pertaining to distribution of the software without specific, - * written prior permission. - * - * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU - * "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR - * OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO - * EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE - * ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, - * INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, - * SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR - * NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY - * OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * US Government Users Restricted Rights - * - * Use, duplication, or disclosure by the Government is subject to - * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph - * (c)(1)(ii) of the Rights in Technical Data and Computer - * Software clause at DFARS 252.227-7013 and/or in similar or - * successor clauses in the FAR or the DOD or NASA FAR - * Supplement. Unpublished-- rights reserved under the copyright - * laws of the United States. Contractor/manufacturer is Silicon - * Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA - * 94039-7311. - * - * OpenGL(TM) is a trademark of Silicon Graphics, Inc. - */ - -#include "internal.h" - -/* - * Rim, body, lid, and bottom data must be reflected in x and y; - * handle and spout data across the y axis only. - */ -static int patchdata[][16] = -{ - { 102, 103, 104, 105, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15 }, /* rim */ - { 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27 }, /* body */ - { 24, 25, 26, 27, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40 }, - { 96, 96, 96, 96, 97, 98, 99, 100, - 101, 101, 101, 101, 0, 1, 2, 3 }, /* lid */ - { 0, 1, 2, 3, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117 }, - { 118, 118, 118, 118, 124, 122, 119, 121, - 123, 126, 125, 120, 40, 39, 38, 37 }, /* bottom */ - { 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56 }, /* handle */ - { 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 28, 65, 66, 67 }, - { 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83 }, /* spout */ - { 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95 } -}; - -static float cpdata[][3] = -{ - {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, - {0,-0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, - {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, - {1.4375, 0, 2.53125}, {1.4375, -0.805, 2.53125}, - {0.805, -1.4375, 2.53125}, {0, -1.4375, 2.53125}, - {1.5, 0, 2.4}, {1.5, -0.84, 2.4}, {0.84, -1.5, 2.4}, - {0, -1.5, 2.4}, {1.75, 0, 1.875}, {1.75, -0.98, 1.875}, - {0.98, -1.75, 1.875}, {0, -1.75, 1.875}, {2, 0, 1.35}, - {2, -1.12, 1.35}, {1.12, -2, 1.35}, {0, -2, 1.35}, {2, 0, 0.9}, - {2, -1.12, 0.9}, {1.12, -2, 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, - {2, 0, 0.45}, {2, -1.12, 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, - {1.5, 0, 0.225}, {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, - {0, -1.5, 0.225}, {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, - {0.84, -1.5, 0.15}, {0, -1.5, 0.15}, {-1.6, 0, 2.025}, - {-1.6, -0.3, 2.025}, {-1.5, -0.3, 2.25}, {-1.5, 0, 2.25}, - {-2.3, 0, 2.025}, {-2.3, -0.3, 2.025}, {-2.5, -0.3, 2.25}, - {-2.5, 0, 2.25}, {-2.7, 0, 2.025}, {-2.7, -0.3, 2.025}, - {-3, -0.3, 2.25}, {-3, 0, 2.25}, {-2.7, 0, 1.8}, - {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, {-3, 0, 1.8}, - {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, -0.3, 1.35}, - {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, 1.125}, - {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, -0.3, 0.9}, - {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, 1.425}, - {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, 0.6}, - {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, 0.825}, - {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, - {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, - {2.7, -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, - {2.8, 0, 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, - {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, - {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, - {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, - {0, 0, 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, - {0.45, -0.8, 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, - {1.4, -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, - {0.4, 0, 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, - {0, -0.4, 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, - {0.728, -1.3, 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, - {1.3, -0.728, 2.4}, {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, - {0, 0, 0}, {1.425, -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, - {0.798, -1.425, 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, - {1.5, -0.84, 0.075}, {0.84, -1.5, 0.075} -}; - -static float tex[2][2][2] = -{ - { {0, 0}, {1, 0} }, - { {0, 1}, {1, 1} } -}; - -static void teapot( GLint grid, GLdouble scale, GLenum type ) -{ - float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; - long i, j, k, l; - - glPushAttrib( GL_ENABLE_BIT | GL_EVAL_BIT ); - glEnable( GL_AUTO_NORMAL ); - glEnable( GL_NORMALIZE ); - glEnable( GL_MAP2_VERTEX_3 ); - glEnable( GL_MAP2_TEXTURE_COORD_2 ); - - glPushMatrix(); - glRotatef(270.0, 1.0, 0.0, 0.0); - glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); - glTranslatef(0.0, 0.0, -1.5); - - for (i = 0; i < 10; i++) - { - for (j = 0; j < 4; j++) - { - for (k = 0; k < 4; k++) - { - for (l = 0; l < 3; l++) - { - p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 1) - q[j][k][l] *= -1.0; - if (i < 6) - { - r[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 0) - r[j][k][l] *= -1.0; - s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - if (l == 0) - s[j][k][l] *= -1.0; - if (l == 1) - s[j][k][l] *= -1.0; - } - } - } - } - - glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, - &tex[0][0][0]); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &p[0][0][0]); - glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &q[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - if (i < 6) - { - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &r[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &s[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - } - } - - glPopMatrix(); - glPopAttrib(); -} - -void glutWireTeapot(GLdouble size) -{ - teapot(10, size, GL_LINE); -} - -void glutSolidTeapot(GLdouble size) -{ - teapot(7, size, GL_FILL); -} diff --git a/src/glut/dos/tr10.c b/src/glut/dos/tr10.c deleted file mode 100644 index a1e03f3e1b..0000000000 --- a/src/glut/dos/tr10.c +++ /dev/null @@ -1,1018 +0,0 @@ -/* autogenerated by bdf2c! do not edit */ - -/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ - - -#include "internal.h" -/* -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; -*/ - - -static const unsigned char ch32data[] = { - 0x0 -}; -static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 2, ch32data }; - -static const unsigned char ch33data[] = { - 0x80,0x0,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch33 = { 1, 7, -1, 0, 3, ch33data }; - -static const unsigned char ch34data[] = { - 0xa0,0xa0 -}; -static const GLUTBitmapChar ch34 = { 3, 2, 0, -5, 4, ch34data }; - -static const unsigned char ch35data[] = { - 0x50,0x50,0xf8,0x50,0xf8,0x50,0x50 -}; -static const GLUTBitmapChar ch35 = { 5, 7, 0, 0, 5, ch35data }; - -static const unsigned char ch36data[] = { - 0x20,0xe0,0x90,0x10,0x60,0x80,0x90,0x70,0x20 -}; -static const GLUTBitmapChar ch36 = { 4, 9, 0, 1, 5, ch36data }; - -static const unsigned char ch37data[] = { - 0x44,0x2a,0x2a,0x56,0xa8,0xa4,0x7e -}; -static const GLUTBitmapChar ch37 = { 7, 7, 0, 0, 8, ch37data }; - -static const unsigned char ch38data[] = { - 0x76,0x8d,0x98,0x74,0x6e,0x50,0x30 -}; -static const GLUTBitmapChar ch38 = { 8, 7, 0, 0, 8, ch38data }; - -static const unsigned char ch39data[] = { - 0x40,0xc0 -}; -static const GLUTBitmapChar ch39 = { 2, 2, 0, -5, 3, ch39data }; - -static const unsigned char ch40data[] = { - 0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20 -}; -static const GLUTBitmapChar ch40 = { 3, 9, 0, 2, 4, ch40data }; - -static const unsigned char ch41data[] = { - 0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80 -}; -static const GLUTBitmapChar ch41 = { 3, 9, 0, 2, 4, ch41data }; - -static const unsigned char ch42data[] = { - 0xa0,0x40,0xa0 -}; -static const GLUTBitmapChar ch42 = { 3, 3, 0, -4, 5, ch42data }; - -static const unsigned char ch43data[] = { - 0x20,0x20,0xf8,0x20,0x20 -}; -static const GLUTBitmapChar ch43 = { 5, 5, 0, 0, 6, ch43data }; - -static const unsigned char ch44data[] = { - 0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch44 = { 1, 3, -1, 2, 3, ch44data }; - -static const unsigned char ch45data[] = { - 0xf0 -}; -static const GLUTBitmapChar ch45 = { 4, 1, -1, -2, 7, ch45data }; - -static const unsigned char ch46data[] = { - 0x80 -}; -static const GLUTBitmapChar ch46 = { 1, 1, -1, 0, 3, ch46data }; - -static const unsigned char ch47data[] = { - 0x80,0x80,0x40,0x40,0x40,0x20,0x20 -}; -static const GLUTBitmapChar ch47 = { 3, 7, 0, 0, 3, ch47data }; - -static const unsigned char ch48data[] = { - 0x60,0x90,0x90,0x90,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch48 = { 4, 7, 0, 0, 5, ch48data }; - -static const unsigned char ch49data[] = { - 0xe0,0x40,0x40,0x40,0x40,0xc0,0x40 -}; -static const GLUTBitmapChar ch49 = { 3, 7, -1, 0, 5, ch49data }; - -static const unsigned char ch50data[] = { - 0xf0,0x40,0x20,0x20,0x10,0x90,0x60 -}; -static const GLUTBitmapChar ch50 = { 4, 7, 0, 0, 5, ch50data }; - -static const unsigned char ch51data[] = { - 0xe0,0x10,0x10,0x60,0x10,0x90,0x60 -}; -static const GLUTBitmapChar ch51 = { 4, 7, 0, 0, 5, ch51data }; - -static const unsigned char ch52data[] = { - 0x10,0x10,0xf8,0x90,0x50,0x30,0x10 -}; -static const GLUTBitmapChar ch52 = { 5, 7, 0, 0, 5, ch52data }; - -static const unsigned char ch53data[] = { - 0xe0,0x90,0x10,0x10,0xe0,0x40,0x70 -}; -static const GLUTBitmapChar ch53 = { 4, 7, 0, 0, 5, ch53data }; - -static const unsigned char ch54data[] = { - 0x60,0x90,0x90,0x90,0xe0,0x40,0x30 -}; -static const GLUTBitmapChar ch54 = { 4, 7, 0, 0, 5, ch54data }; - -static const unsigned char ch55data[] = { - 0x40,0x40,0x40,0x20,0x20,0x90,0xf0 -}; -static const GLUTBitmapChar ch55 = { 4, 7, 0, 0, 5, ch55data }; - -static const unsigned char ch56data[] = { - 0x60,0x90,0x90,0x60,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch56 = { 4, 7, 0, 0, 5, ch56data }; - -static const unsigned char ch57data[] = { - 0xc0,0x20,0x70,0x90,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch57 = { 4, 7, 0, 0, 5, ch57data }; - -static const unsigned char ch58data[] = { - 0x80,0x0,0x0,0x0,0x80 -}; -static const GLUTBitmapChar ch58 = { 1, 5, -1, 0, 3, ch58data }; - -static const unsigned char ch59data[] = { - 0x80,0x80,0x80,0x0,0x0,0x0,0x80 -}; -static const GLUTBitmapChar ch59 = { 1, 7, -1, 2, 3, ch59data }; - -static const unsigned char ch60data[] = { - 0x20,0x40,0x80,0x40,0x20 -}; -static const GLUTBitmapChar ch60 = { 3, 5, -1, 0, 5, ch60data }; - -static const unsigned char ch61data[] = { - 0xf8,0x0,0xf8 -}; -static const GLUTBitmapChar ch61 = { 5, 3, 0, -1, 6, ch61data }; - -static const unsigned char ch62data[] = { - 0x80,0x40,0x20,0x40,0x80 -}; -static const GLUTBitmapChar ch62 = { 3, 5, 0, 0, 5, ch62data }; - -static const unsigned char ch63data[] = { - 0x40,0x0,0x40,0x40,0x20,0xa0,0xe0 -}; -static const GLUTBitmapChar ch63 = { 3, 7, 0, 0, 4, ch63data }; - -static const unsigned char ch64data[] = { - 0x3e,0x40,0x92,0xad,0xa5,0xa5,0x9d,0x42,0x3c -}; -static const GLUTBitmapChar ch64 = { 8, 9, 0, 2, 9, ch64data }; - -static const unsigned char ch65data[] = { - 0xee,0x44,0x7c,0x28,0x28,0x38,0x10 -}; -static const GLUTBitmapChar ch65 = { 7, 7, 0, 0, 8, ch65data }; - -static const unsigned char ch66data[] = { - 0xf0,0x48,0x48,0x70,0x48,0x48,0xf0 -}; -static const GLUTBitmapChar ch66 = { 5, 7, 0, 0, 6, ch66data }; - -static const unsigned char ch67data[] = { - 0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c -}; -static const GLUTBitmapChar ch67 = { 6, 7, 0, 0, 7, ch67data }; - -static const unsigned char ch68data[] = { - 0xf8,0x4c,0x44,0x44,0x44,0x4c,0xf8 -}; -static const GLUTBitmapChar ch68 = { 6, 7, 0, 0, 7, ch68data }; - -static const unsigned char ch69data[] = { - 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8 -}; -static const GLUTBitmapChar ch69 = { 5, 7, 0, 0, 6, ch69data }; - -static const unsigned char ch70data[] = { - 0xe0,0x40,0x40,0x70,0x40,0x48,0xf8 -}; -static const GLUTBitmapChar ch70 = { 5, 7, 0, 0, 6, ch70data }; - -static const unsigned char ch71data[] = { - 0x78,0xc4,0x84,0x9c,0x80,0xc4,0x7c -}; -static const GLUTBitmapChar ch71 = { 6, 7, 0, 0, 7, ch71data }; - -static const unsigned char ch72data[] = { - 0xee,0x44,0x44,0x7c,0x44,0x44,0xee -}; -static const GLUTBitmapChar ch72 = { 7, 7, 0, 0, 8, ch72data }; - -static const unsigned char ch73data[] = { - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0 -}; -static const GLUTBitmapChar ch73 = { 3, 7, 0, 0, 4, ch73data }; - -static const unsigned char ch74data[] = { - 0xc0,0xa0,0x20,0x20,0x20,0x20,0x70 -}; -static const GLUTBitmapChar ch74 = { 4, 7, 0, 0, 4, ch74data }; - -static const unsigned char ch75data[] = { - 0xec,0x48,0x50,0x60,0x50,0x48,0xec -}; -static const GLUTBitmapChar ch75 = { 6, 7, 0, 0, 7, ch75data }; - -static const unsigned char ch76data[] = { - 0xf8,0x48,0x40,0x40,0x40,0x40,0xe0 -}; -static const GLUTBitmapChar ch76 = { 5, 7, 0, 0, 6, ch76data }; - -static const unsigned char ch77data[] = { - 0xeb,0x80,0x49,0x0,0x55,0x0,0x55,0x0,0x63,0x0,0x63,0x0,0xe3,0x80 -}; -static const GLUTBitmapChar ch77 = { 9, 7, 0, 0, 10, ch77data }; - -static const unsigned char ch78data[] = { - 0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee -}; -static const GLUTBitmapChar ch78 = { 7, 7, 0, 0, 8, ch78data }; - -static const unsigned char ch79data[] = { - 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78 -}; -static const GLUTBitmapChar ch79 = { 6, 7, 0, 0, 7, ch79data }; - -static const unsigned char ch80data[] = { - 0xe0,0x40,0x40,0x70,0x48,0x48,0xf0 -}; -static const GLUTBitmapChar ch80 = { 5, 7, 0, 0, 6, ch80data }; - -static const unsigned char ch81data[] = { - 0xc,0x18,0x70,0xcc,0x84,0x84,0x84,0xcc,0x78 -}; -static const GLUTBitmapChar ch81 = { 6, 9, 0, 2, 7, ch81data }; - -static const unsigned char ch82data[] = { - 0xec,0x48,0x50,0x70,0x48,0x48,0xf0 -}; -static const GLUTBitmapChar ch82 = { 6, 7, 0, 0, 7, ch82data }; - -static const unsigned char ch83data[] = { - 0xe0,0x90,0x10,0x60,0xc0,0x90,0x70 -}; -static const GLUTBitmapChar ch83 = { 4, 7, 0, 0, 5, ch83data }; - -static const unsigned char ch84data[] = { - 0x70,0x20,0x20,0x20,0x20,0xa8,0xf8 -}; -static const GLUTBitmapChar ch84 = { 5, 7, 0, 0, 6, ch84data }; - -static const unsigned char ch85data[] = { - 0x38,0x6c,0x44,0x44,0x44,0x44,0xee -}; -static const GLUTBitmapChar ch85 = { 7, 7, 0, 0, 8, ch85data }; - -static const unsigned char ch86data[] = { - 0x10,0x10,0x28,0x28,0x6c,0x44,0xee -}; -static const GLUTBitmapChar ch86 = { 7, 7, 0, 0, 8, ch86data }; - -static const unsigned char ch87data[] = { - 0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0xc9,0x80,0x88,0x80,0xdd,0xc0 -}; -static const GLUTBitmapChar ch87 = { 10, 7, 0, 0, 10, ch87data }; - -static const unsigned char ch88data[] = { - 0xee,0x44,0x28,0x10,0x28,0x44,0xee -}; -static const GLUTBitmapChar ch88 = { 7, 7, 0, 0, 8, ch88data }; - -static const unsigned char ch89data[] = { - 0x38,0x10,0x10,0x28,0x28,0x44,0xee -}; -static const GLUTBitmapChar ch89 = { 7, 7, 0, 0, 8, ch89data }; - -static const unsigned char ch90data[] = { - 0xf8,0x88,0x40,0x20,0x10,0x88,0xf8 -}; -static const GLUTBitmapChar ch90 = { 5, 7, 0, 0, 6, ch90data }; - -static const unsigned char ch91data[] = { - 0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 -}; -static const GLUTBitmapChar ch91 = { 2, 9, 0, 2, 3, ch91data }; - -static const unsigned char ch92data[] = { - 0x20,0x20,0x40,0x40,0x40,0x80,0x80 -}; -static const GLUTBitmapChar ch92 = { 3, 7, 0, 0, 3, ch92data }; - -static const unsigned char ch93data[] = { - 0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0 -}; -static const GLUTBitmapChar ch93 = { 2, 9, 0, 2, 3, ch93data }; - -static const unsigned char ch94data[] = { - 0xa0,0xa0,0x40 -}; -static const GLUTBitmapChar ch94 = { 3, 3, -1, -4, 5, ch94data }; - -static const unsigned char ch95data[] = { - 0xf8 -}; -static const GLUTBitmapChar ch95 = { 5, 1, 0, 3, 5, ch95data }; - -static const unsigned char ch96data[] = { - 0xc0,0x80 -}; -static const GLUTBitmapChar ch96 = { 2, 2, 0, -5, 3, ch96data }; - -static const unsigned char ch97data[] = { - 0xe0,0xa0,0x60,0x20,0xc0 -}; -static const GLUTBitmapChar ch97 = { 3, 5, 0, 0, 4, ch97data }; - -static const unsigned char ch98data[] = { - 0xe0,0x90,0x90,0x90,0xe0,0x80,0x80 -}; -static const GLUTBitmapChar ch98 = { 4, 7, 0, 0, 5, ch98data }; - -static const unsigned char ch99data[] = { - 0x60,0x80,0x80,0x80,0x60 -}; -static const GLUTBitmapChar ch99 = { 3, 5, 0, 0, 4, ch99data }; - -static const unsigned char ch100data[] = { - 0x68,0x90,0x90,0x90,0x70,0x10,0x30 -}; -static const GLUTBitmapChar ch100 = { 5, 7, 0, 0, 5, ch100data }; - -static const unsigned char ch101data[] = { - 0x60,0x80,0xc0,0xa0,0x60 -}; -static const GLUTBitmapChar ch101 = { 3, 5, 0, 0, 4, ch101data }; - -static const unsigned char ch102data[] = { - 0xe0,0x40,0x40,0x40,0xe0,0x40,0x30 -}; -static const GLUTBitmapChar ch102 = { 4, 7, 0, 0, 4, ch102data }; - -static const unsigned char ch103data[] = { - 0xe0,0x90,0x60,0x40,0xa0,0xa0,0x70 -}; -static const GLUTBitmapChar ch103 = { 4, 7, 0, 2, 5, ch103data }; - -static const unsigned char ch104data[] = { - 0xd8,0x90,0x90,0x90,0xe0,0x80,0x80 -}; -static const GLUTBitmapChar ch104 = { 5, 7, 0, 0, 5, ch104data }; - -static const unsigned char ch105data[] = { - 0x40,0x40,0x40,0x40,0xc0,0x0,0x40 -}; -static const GLUTBitmapChar ch105 = { 2, 7, 0, 0, 3, ch105data }; - -static const unsigned char ch106data[] = { - 0x80,0x40,0x40,0x40,0x40,0x40,0xc0,0x0,0x40 -}; -static const GLUTBitmapChar ch106 = { 2, 9, 0, 2, 3, ch106data }; - -static const unsigned char ch107data[] = { - 0x98,0x90,0xe0,0xa0,0x90,0x80,0x80 -}; -static const GLUTBitmapChar ch107 = { 5, 7, 0, 0, 5, ch107data }; - -static const unsigned char ch108data[] = { - 0xe0,0x40,0x40,0x40,0x40,0x40,0xc0 -}; -static const GLUTBitmapChar ch108 = { 3, 7, 0, 0, 4, ch108data }; - -static const unsigned char ch109data[] = { - 0xdb,0x92,0x92,0x92,0xec -}; -static const GLUTBitmapChar ch109 = { 8, 5, 0, 0, 8, ch109data }; - -static const unsigned char ch110data[] = { - 0xd8,0x90,0x90,0x90,0xe0 -}; -static const GLUTBitmapChar ch110 = { 5, 5, 0, 0, 5, ch110data }; - -static const unsigned char ch111data[] = { - 0x60,0x90,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch111 = { 4, 5, 0, 0, 5, ch111data }; - -static const unsigned char ch112data[] = { - 0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0 -}; -static const GLUTBitmapChar ch112 = { 4, 7, 0, 2, 5, ch112data }; - -static const unsigned char ch113data[] = { - 0x38,0x10,0x70,0x90,0x90,0x90,0x70 -}; -static const GLUTBitmapChar ch113 = { 5, 7, 0, 2, 5, ch113data }; - -static const unsigned char ch114data[] = { - 0xe0,0x40,0x40,0x60,0xa0 -}; -static const GLUTBitmapChar ch114 = { 3, 5, 0, 0, 4, ch114data }; - -static const unsigned char ch115data[] = { - 0xe0,0x20,0x60,0x80,0xe0 -}; -static const GLUTBitmapChar ch115 = { 3, 5, 0, 0, 4, ch115data }; - -static const unsigned char ch116data[] = { - 0x30,0x40,0x40,0x40,0xe0,0x40 -}; -static const GLUTBitmapChar ch116 = { 4, 6, 0, 0, 4, ch116data }; - -static const unsigned char ch117data[] = { - 0x68,0x90,0x90,0x90,0x90 -}; -static const GLUTBitmapChar ch117 = { 5, 5, 0, 0, 5, ch117data }; - -static const unsigned char ch118data[] = { - 0x20,0x60,0x50,0x90,0xd8 -}; -static const GLUTBitmapChar ch118 = { 5, 5, 0, 0, 5, ch118data }; - -static const unsigned char ch119data[] = { - 0x28,0x6c,0x54,0x92,0xdb -}; -static const GLUTBitmapChar ch119 = { 8, 5, 0, 0, 8, ch119data }; - -static const unsigned char ch120data[] = { - 0xd8,0x50,0x20,0x50,0xd8 -}; -static const GLUTBitmapChar ch120 = { 5, 5, 0, 0, 6, ch120data }; - -static const unsigned char ch121data[] = { - 0x40,0x40,0x20,0x30,0x50,0x48,0xdc -}; -static const GLUTBitmapChar ch121 = { 6, 7, 1, 2, 5, ch121data }; - -static const unsigned char ch122data[] = { - 0xf0,0x90,0x40,0x20,0xf0 -}; -static const GLUTBitmapChar ch122 = { 4, 5, 0, 0, 5, ch122data }; - -static const unsigned char ch123data[] = { - 0x20,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20 -}; -static const GLUTBitmapChar ch123 = { 3, 9, 0, 2, 4, ch123data }; - -static const unsigned char ch124data[] = { - 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch124 = { 1, 9, 0, 2, 2, ch124data }; - -static const unsigned char ch125data[] = { - 0x80,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80 -}; -static const GLUTBitmapChar ch125 = { 3, 9, 0, 2, 4, ch125data }; - -static const unsigned char ch126data[] = { - 0x98,0x64 -}; -static const GLUTBitmapChar ch126 = { 6, 2, 0, -2, 7, ch126data }; - -static const unsigned char ch160data[] = { - 0x0 -}; -static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 2, ch160data }; - -static const unsigned char ch161data[] = { - 0x80,0x80,0x80,0x80,0x80,0x0,0x80 -}; -static const GLUTBitmapChar ch161 = { 1, 7, -1, 2, 3, ch161data }; - -static const unsigned char ch162data[] = { - 0x80,0xe0,0x90,0x80,0x90,0x70,0x10 -}; -static const GLUTBitmapChar ch162 = { 4, 7, 0, 1, 5, ch162data }; - -static const unsigned char ch163data[] = { - 0xf0,0xc8,0x40,0xe0,0x40,0x50,0x30 -}; -static const GLUTBitmapChar ch163 = { 5, 7, 0, 0, 5, ch163data }; - -static const unsigned char ch164data[] = { - 0x88,0x70,0x50,0x50,0x70,0x88 -}; -static const GLUTBitmapChar ch164 = { 5, 6, 0, -1, 5, ch164data }; - -static const unsigned char ch165data[] = { - 0x70,0x20,0xf8,0x20,0xd8,0x50,0x88 -}; -static const GLUTBitmapChar ch165 = { 5, 7, 0, 0, 5, ch165data }; - -static const unsigned char ch166data[] = { - 0x80,0x80,0x80,0x0,0x80,0x80,0x80 -}; -static const GLUTBitmapChar ch166 = { 1, 7, 0, 0, 2, ch166data }; - -static const unsigned char ch167data[] = { - 0xe0,0x90,0x20,0x50,0x90,0xa0,0x40,0x90,0x70 -}; -static const GLUTBitmapChar ch167 = { 4, 9, 0, 1, 5, ch167data }; - -static const unsigned char ch168data[] = { - 0xa0 -}; -static const GLUTBitmapChar ch168 = { 3, 1, -1, -6, 5, ch168data }; - -static const unsigned char ch169data[] = { - 0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38 -}; -static const GLUTBitmapChar ch169 = { 7, 7, -1, 0, 9, ch169data }; - -static const unsigned char ch170data[] = { - 0xe0,0x0,0xa0,0x20,0xc0 -}; -static const GLUTBitmapChar ch170 = { 3, 5, 0, -2, 4, ch170data }; - -static const unsigned char ch171data[] = { - 0x50,0xa0,0xa0,0x50 -}; -static const GLUTBitmapChar ch171 = { 4, 4, 0, -1, 5, ch171data }; - -static const unsigned char ch172data[] = { - 0x8,0x8,0xf8 -}; -static const GLUTBitmapChar ch172 = { 5, 3, -1, -1, 7, ch172data }; - -static const unsigned char ch173data[] = { - 0xe0 -}; -static const GLUTBitmapChar ch173 = { 3, 1, 0, -2, 4, ch173data }; - -static const unsigned char ch174data[] = { - 0x38,0x44,0xaa,0xb2,0xba,0x44,0x38 -}; -static const GLUTBitmapChar ch174 = { 7, 7, -1, 0, 9, ch174data }; - -static const unsigned char ch175data[] = { - 0xe0 -}; -static const GLUTBitmapChar ch175 = { 3, 1, 0, -6, 4, ch175data }; - -static const unsigned char ch176data[] = { - 0x60,0x90,0x90,0x60 -}; -static const GLUTBitmapChar ch176 = { 4, 4, 0, -3, 4, ch176data }; - -static const unsigned char ch177data[] = { - 0xf8,0x0,0x20,0x20,0xf8,0x20,0x20 -}; -static const GLUTBitmapChar ch177 = { 5, 7, 0, 0, 6, ch177data }; - -static const unsigned char ch178data[] = { - 0xe0,0x40,0xa0,0x60 -}; -static const GLUTBitmapChar ch178 = { 3, 4, 0, -3, 3, ch178data }; - -static const unsigned char ch179data[] = { - 0xc0,0x20,0x40,0xe0 -}; -static const GLUTBitmapChar ch179 = { 3, 4, 0, -3, 3, ch179data }; - -static const unsigned char ch180data[] = { - 0x80,0x40 -}; -static const GLUTBitmapChar ch180 = { 2, 2, 0, -5, 3, ch180data }; - -static const unsigned char ch181data[] = { - 0x80,0x80,0xe8,0x90,0x90,0x90,0x90 -}; -static const GLUTBitmapChar ch181 = { 5, 7, 0, 2, 5, ch181data }; - -static const unsigned char ch182data[] = { - 0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c -}; -static const GLUTBitmapChar ch182 = { 6, 9, 0, 2, 6, ch182data }; - -static const unsigned char ch183data[] = { - 0x80 -}; -static const GLUTBitmapChar ch183 = { 1, 1, 0, -2, 2, ch183data }; - -static const unsigned char ch184data[] = { - 0xc0,0x20,0x40 -}; -static const GLUTBitmapChar ch184 = { 3, 3, 0, 3, 4, ch184data }; - -static const unsigned char ch185data[] = { - 0xe0,0x40,0xc0,0x40 -}; -static const GLUTBitmapChar ch185 = { 3, 4, 0, -3, 3, ch185data }; - -static const unsigned char ch186data[] = { - 0xe0,0x0,0x40,0xa0,0x40 -}; -static const GLUTBitmapChar ch186 = { 3, 5, 0, -2, 4, ch186data }; - -static const unsigned char ch187data[] = { - 0xa0,0x50,0x50,0xa0 -}; -static const GLUTBitmapChar ch187 = { 4, 4, 0, -1, 5, ch187data }; - -static const unsigned char ch188data[] = { - 0x44,0x3e,0x2c,0xf4,0x48,0xc8,0x44 -}; -static const GLUTBitmapChar ch188 = { 7, 7, 0, 0, 8, ch188data }; - -static const unsigned char ch189data[] = { - 0x4e,0x24,0x2a,0xf6,0x48,0xc8,0x44 -}; -static const GLUTBitmapChar ch189 = { 7, 7, 0, 0, 8, ch189data }; - -static const unsigned char ch190data[] = { - 0x44,0x3e,0x2c,0xd4,0x28,0x48,0xe4 -}; -static const GLUTBitmapChar ch190 = { 7, 7, 0, 0, 8, ch190data }; - -static const unsigned char ch191data[] = { - 0xe0,0xa0,0x80,0x40,0x40,0x0,0x40 -}; -static const GLUTBitmapChar ch191 = { 3, 7, 0, 2, 4, ch191data }; - -static const unsigned char ch192data[] = { - 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch192 = { 7, 10, 0, 0, 8, ch192data }; - -static const unsigned char ch193data[] = { - 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch193 = { 7, 10, 0, 0, 8, ch193data }; - -static const unsigned char ch194data[] = { - 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch194 = { 7, 10, 0, 0, 8, ch194data }; - -static const unsigned char ch195data[] = { - 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28,0x14 -}; -static const GLUTBitmapChar ch195 = { 7, 10, 0, 0, 8, ch195data }; - -static const unsigned char ch196data[] = { - 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x0,0x28 -}; -static const GLUTBitmapChar ch196 = { 7, 9, 0, 0, 8, ch196data }; - -static const unsigned char ch197data[] = { - 0xee,0x44,0x7c,0x28,0x28,0x38,0x10,0x10,0x28,0x10 -}; -static const GLUTBitmapChar ch197 = { 7, 10, 0, 0, 8, ch197data }; - -static const unsigned char ch198data[] = { - 0xef,0x49,0x78,0x2e,0x28,0x39,0x1f -}; -static const GLUTBitmapChar ch198 = { 8, 7, 0, 0, 9, ch198data }; - -static const unsigned char ch199data[] = { - 0x60,0x10,0x20,0x78,0xc4,0x80,0x80,0x80,0xc4,0x7c -}; -static const GLUTBitmapChar ch199 = { 6, 10, 0, 3, 7, ch199data }; - -static const unsigned char ch200data[] = { - 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch200 = { 5, 10, 0, 0, 6, ch200data }; - -static const unsigned char ch201data[] = { - 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch201 = { 5, 10, 0, 0, 6, ch201data }; - -static const unsigned char ch202data[] = { - 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch202 = { 5, 10, 0, 0, 6, ch202data }; - -static const unsigned char ch203data[] = { - 0xf8,0x48,0x40,0x70,0x40,0x48,0xf8,0x0,0x50 -}; -static const GLUTBitmapChar ch203 = { 5, 9, 0, 0, 6, ch203data }; - -static const unsigned char ch204data[] = { - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch204 = { 3, 10, 0, 0, 4, ch204data }; - -static const unsigned char ch205data[] = { - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch205 = { 3, 10, 0, 0, 4, ch205data }; - -static const unsigned char ch206data[] = { - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch206 = { 3, 10, 0, 0, 4, ch206data }; - -static const unsigned char ch207data[] = { - 0xe0,0x40,0x40,0x40,0x40,0x40,0xe0,0x0,0xa0 -}; -static const GLUTBitmapChar ch207 = { 3, 9, 0, 0, 4, ch207data }; - -static const unsigned char ch208data[] = { - 0xf8,0x4c,0x44,0xe4,0x44,0x4c,0xf8 -}; -static const GLUTBitmapChar ch208 = { 6, 7, 0, 0, 7, ch208data }; - -static const unsigned char ch209data[] = { - 0xe4,0x4c,0x4c,0x54,0x54,0x64,0xee,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch209 = { 7, 10, 0, 0, 8, ch209data }; - -static const unsigned char ch210data[] = { - 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch210 = { 6, 10, 0, 0, 7, ch210data }; - -static const unsigned char ch211data[] = { - 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch211 = { 6, 10, 0, 0, 7, ch211data }; - -static const unsigned char ch212data[] = { - 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch212 = { 6, 10, 0, 0, 7, ch212data }; - -static const unsigned char ch213data[] = { - 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50,0x28 -}; -static const GLUTBitmapChar ch213 = { 6, 10, 0, 0, 7, ch213data }; - -static const unsigned char ch214data[] = { - 0x78,0xcc,0x84,0x84,0x84,0xcc,0x78,0x0,0x50 -}; -static const GLUTBitmapChar ch214 = { 6, 9, 0, 0, 7, ch214data }; - -static const unsigned char ch215data[] = { - 0x88,0x50,0x20,0x50,0x88 -}; -static const GLUTBitmapChar ch215 = { 5, 5, 0, 0, 6, ch215data }; - -static const unsigned char ch216data[] = { - 0x80,0x7c,0x66,0x52,0x52,0x4a,0x66,0x3e,0x1 -}; -static const GLUTBitmapChar ch216 = { 8, 9, 0, 1, 8, ch216data }; - -static const unsigned char ch217data[] = { - 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x20 -}; -static const GLUTBitmapChar ch217 = { 7, 10, 0, 0, 8, ch217data }; - -static const unsigned char ch218data[] = { - 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch218 = { 7, 10, 0, 0, 8, ch218data }; - -static const unsigned char ch219data[] = { - 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28,0x10 -}; -static const GLUTBitmapChar ch219 = { 7, 10, 0, 0, 8, ch219data }; - -static const unsigned char ch220data[] = { - 0x38,0x6c,0x44,0x44,0x44,0x44,0xee,0x0,0x28 -}; -static const GLUTBitmapChar ch220 = { 7, 9, 0, 0, 8, ch220data }; - -static const unsigned char ch221data[] = { - 0x38,0x10,0x10,0x28,0x28,0x44,0xee,0x0,0x10,0x8 -}; -static const GLUTBitmapChar ch221 = { 7, 10, 0, 0, 8, ch221data }; - -static const unsigned char ch222data[] = { - 0xe0,0x40,0x70,0x48,0x70,0x40,0xe0 -}; -static const GLUTBitmapChar ch222 = { 5, 7, 0, 0, 6, ch222data }; - -static const unsigned char ch223data[] = { - 0xe0,0x50,0x50,0x60,0x50,0x50,0x20 -}; -static const GLUTBitmapChar ch223 = { 4, 7, 0, 0, 5, ch223data }; - -static const unsigned char ch224data[] = { - 0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch224 = { 3, 8, 0, 0, 4, ch224data }; - -static const unsigned char ch225data[] = { - 0xe0,0xa0,0x60,0x20,0xc0,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch225 = { 3, 8, 0, 0, 4, ch225data }; - -static const unsigned char ch226data[] = { - 0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch226 = { 3, 8, 0, 0, 4, ch226data }; - -static const unsigned char ch227data[] = { - 0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0,0x50 -}; -static const GLUTBitmapChar ch227 = { 4, 8, 0, 0, 4, ch227data }; - -static const unsigned char ch228data[] = { - 0xe0,0xa0,0x60,0x20,0xc0,0x0,0xa0 -}; -static const GLUTBitmapChar ch228 = { 3, 7, 0, 0, 4, ch228data }; - -static const unsigned char ch229data[] = { - 0xe0,0xa0,0x60,0x20,0xc0,0x40,0xa0,0x40 -}; -static const GLUTBitmapChar ch229 = { 3, 8, 0, 0, 4, ch229data }; - -static const unsigned char ch230data[] = { - 0xd8,0xa0,0x70,0x28,0xd8 -}; -static const GLUTBitmapChar ch230 = { 5, 5, 0, 0, 6, ch230data }; - -static const unsigned char ch231data[] = { - 0xc0,0x20,0x40,0x60,0x80,0x80,0x80,0x60 -}; -static const GLUTBitmapChar ch231 = { 3, 8, 0, 3, 4, ch231data }; - -static const unsigned char ch232data[] = { - 0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch232 = { 3, 8, 0, 0, 4, ch232data }; - -static const unsigned char ch233data[] = { - 0x60,0x80,0xc0,0xa0,0x60,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch233 = { 3, 8, 0, 0, 4, ch233data }; - -static const unsigned char ch234data[] = { - 0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch234 = { 3, 8, 0, 0, 4, ch234data }; - -static const unsigned char ch235data[] = { - 0x60,0x80,0xc0,0xa0,0x60,0x0,0xa0 -}; -static const GLUTBitmapChar ch235 = { 3, 7, 0, 0, 4, ch235data }; - -static const unsigned char ch236data[] = { - 0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x80 -}; -static const GLUTBitmapChar ch236 = { 3, 8, 0, 0, 4, ch236data }; - -static const unsigned char ch237data[] = { - 0xe0,0x40,0x40,0x40,0xc0,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch237 = { 3, 8, 0, 0, 4, ch237data }; - -static const unsigned char ch238data[] = { - 0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch238 = { 3, 8, 0, 0, 4, ch238data }; - -static const unsigned char ch239data[] = { - 0xe0,0x40,0x40,0x40,0xc0,0x0,0xa0 -}; -static const GLUTBitmapChar ch239 = { 3, 7, 0, 0, 4, ch239data }; - -static const unsigned char ch240data[] = { - 0x60,0x90,0x90,0x90,0x70,0xa0,0x70,0x40 -}; -static const GLUTBitmapChar ch240 = { 4, 8, 0, 0, 5, ch240data }; - -static const unsigned char ch241data[] = { - 0xd8,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50 -}; -static const GLUTBitmapChar ch241 = { 5, 8, 0, 0, 5, ch241data }; - -static const unsigned char ch242data[] = { - 0x60,0x90,0x90,0x90,0x60,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch242 = { 4, 8, 0, 0, 5, ch242data }; - -static const unsigned char ch243data[] = { - 0x60,0x90,0x90,0x90,0x60,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch243 = { 4, 8, 0, 0, 5, ch243data }; - -static const unsigned char ch244data[] = { - 0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x40 -}; -static const GLUTBitmapChar ch244 = { 4, 8, 0, 0, 5, ch244data }; - -static const unsigned char ch245data[] = { - 0x60,0x90,0x90,0x90,0x60,0x0,0xa0,0x50 -}; -static const GLUTBitmapChar ch245 = { 4, 8, 0, 0, 5, ch245data }; - -static const unsigned char ch246data[] = { - 0x60,0x90,0x90,0x90,0x60,0x0,0xa0 -}; -static const GLUTBitmapChar ch246 = { 4, 7, 0, 0, 5, ch246data }; - -static const unsigned char ch247data[] = { - 0x20,0x0,0xf8,0x0,0x20 -}; -static const GLUTBitmapChar ch247 = { 5, 5, 0, 0, 6, ch247data }; - -static const unsigned char ch248data[] = { - 0x80,0x70,0x48,0x48,0x48,0x38,0x4 -}; -static const GLUTBitmapChar ch248 = { 6, 7, 1, 1, 5, ch248data }; - -static const unsigned char ch249data[] = { - 0x68,0x90,0x90,0x90,0x90,0x0,0x20,0x40 -}; -static const GLUTBitmapChar ch249 = { 5, 8, 0, 0, 5, ch249data }; - -static const unsigned char ch250data[] = { - 0x68,0x90,0x90,0x90,0x90,0x0,0x40,0x20 -}; -static const GLUTBitmapChar ch250 = { 5, 8, 0, 0, 5, ch250data }; - -static const unsigned char ch251data[] = { - 0x68,0x90,0x90,0x90,0x90,0x0,0x50,0x20 -}; -static const GLUTBitmapChar ch251 = { 5, 8, 0, 0, 5, ch251data }; - -static const unsigned char ch252data[] = { - 0x68,0x90,0x90,0x90,0x90,0x0,0x50 -}; -static const GLUTBitmapChar ch252 = { 5, 7, 0, 0, 5, ch252data }; - -static const unsigned char ch253data[] = { - 0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0x20,0x10 -}; -static const GLUTBitmapChar ch253 = { 5, 10, 0, 2, 5, ch253data }; - -static const unsigned char ch254data[] = { - 0xc0,0x80,0xe0,0x90,0x90,0x90,0xe0,0x80,0x80 -}; -static const GLUTBitmapChar ch254 = { 4, 9, 0, 2, 5, ch254data }; - -static const unsigned char ch255data[] = { - 0x80,0xc0,0x40,0x60,0xa0,0x90,0xb8,0x0,0xa0 -}; -static const GLUTBitmapChar ch255 = { 5, 9, 0, 2, 5, ch255data }; - - -static const GLUTBitmapChar *chars[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, - &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, - &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, - &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, - &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, - &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, - &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, - &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, - &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, - &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, - &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, - &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 -}; - -const GLUTBitmapFont glutBitmapTimesRoman10 = { - "-Adobe-Times-Medium-R-Normal--10-100-75-75-P-54-ISO8859-1", - 13, 256, chars -}; diff --git a/src/glut/dos/tr24.c b/src/glut/dos/tr24.c deleted file mode 100644 index 2dd2a78c83..0000000000 --- a/src/glut/dos/tr24.c +++ /dev/null @@ -1,1301 +0,0 @@ -/* autogenerated by bdf2c! do not edit */ - -/* "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved." */ - - -#include "internal.h" -/* -typedef struct { - int width, height; - int xorig, yorig; - int xmove; - const unsigned char *bitmap; -} GLUTBitmapChar; - -typedef struct { - const char *name; - int height; - int num; - const GLUTBitmapChar *const *table; -} GLUTBitmapFont; -*/ - - -static const unsigned char ch32data[] = { - 0x0 -}; -static const GLUTBitmapChar ch32 = { 1, 1, 0, 0, 6, ch32data }; - -static const unsigned char ch33data[] = { - 0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0 -}; -static const GLUTBitmapChar ch33 = { 2, 17, -3, 0, 8, ch33data }; - -static const unsigned char ch34data[] = { - 0x88,0xcc,0xcc,0xcc,0xcc -}; -static const GLUTBitmapChar ch34 = { 6, 5, -1, -12, 10, ch34data }; - -static const unsigned char ch35data[] = { - 0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0xff,0xc0,0xff,0xc0,0x11,0x0, - 0x11,0x0,0x11,0x0,0x7f,0xe0,0x7f,0xe0,0x8,0x80,0x8,0x80,0x8,0x80,0x8,0x80, - 0x8,0x80 -}; -static const GLUTBitmapChar ch35 = { 11, 17, -1, 0, 13, ch35data }; - -static const unsigned char ch36data[] = { - 0x4,0x0,0x4,0x0,0x3f,0x0,0xe5,0xc0,0xc4,0xc0,0x84,0x60,0x84,0x60,0x4,0x60, - 0x4,0xe0,0x7,0xc0,0x7,0x80,0x1e,0x0,0x3c,0x0,0x74,0x0,0x64,0x0,0x64,0x20, - 0x64,0x60,0x34,0xe0,0x1f,0x80,0x4,0x0,0x4,0x0 -}; -static const GLUTBitmapChar ch36 = { 11, 21, 0, 2, 12, ch36data }; - -static const unsigned char ch37data[] = { - 0x30,0x3c,0x0,0x18,0x72,0x0,0xc,0x61,0x0,0x4,0x60,0x80,0x6,0x60,0x80,0x3, - 0x30,0x80,0x1,0x19,0x80,0x1,0x8f,0x0,0x78,0xc0,0x0,0xe4,0x40,0x0,0xc2,0x60, - 0x0,0xc1,0x30,0x0,0xc1,0x10,0x0,0x61,0x18,0x0,0x33,0xfc,0x0,0x1e,0xc,0x0 -}; -static const GLUTBitmapChar ch37 = { 17, 16, -1, 0, 19, ch37data }; - -static const unsigned char ch38data[] = { - 0x3c,0x3c,0x7f,0x7e,0xe1,0xe1,0xc0,0xc0,0xc1,0xc0,0xc1,0xa0,0x63,0x20,0x37,0x10, - 0x1e,0x18,0xe,0x3e,0xf,0x0,0x1d,0x80,0x18,0xc0,0x18,0x40,0x18,0x40,0xc,0xc0, - 0x7,0x80 -}; -static const GLUTBitmapChar ch38 = { 16, 17, -1, 0, 18, ch38data }; - -static const unsigned char ch39data[] = { - 0xc0,0x60,0x20,0xe0,0xc0 -}; -static const GLUTBitmapChar ch39 = { 3, 5, -3, -12, 8, ch39data }; - -static const unsigned char ch40data[] = { - 0x4,0x8,0x10,0x30,0x20,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60, - 0x60,0x20,0x30,0x10,0x8,0x4 -}; -static const GLUTBitmapChar ch40 = { 6, 22, -1, 5, 8, ch40data }; - -static const unsigned char ch41data[] = { - 0x80,0x40,0x20,0x30,0x10,0x18,0x18,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x18, - 0x18,0x10,0x30,0x20,0x40,0x80 -}; -static const GLUTBitmapChar ch41 = { 6, 22, -1, 5, 8, ch41data }; - -static const unsigned char ch42data[] = { - 0x8,0x0,0x1c,0x0,0xc9,0x80,0xeb,0x80,0x1c,0x0,0xeb,0x80,0xc9,0x80,0x1c,0x0, - 0x8,0x0 -}; -static const GLUTBitmapChar ch42 = { 9, 9, -2, -8, 12, ch42data }; - -static const unsigned char ch43data[] = { - 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xff,0xf0,0xff,0xf0,0x6,0x0, - 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch43 = { 12, 12, -1, -1, 14, ch43data }; - -static const unsigned char ch44data[] = { - 0xc0,0x60,0x20,0xe0,0xc0 -}; -static const GLUTBitmapChar ch44 = { 3, 5, -2, 3, 7, ch44data }; - -static const unsigned char ch45data[] = { - 0xff,0xf0,0xff,0xf0 -}; -static const GLUTBitmapChar ch45 = { 12, 2, -1, -6, 14, ch45data }; - -static const unsigned char ch46data[] = { - 0xc0,0xc0 -}; -static const GLUTBitmapChar ch46 = { 2, 2, -2, 0, 6, ch46data }; - -static const unsigned char ch47data[] = { - 0xc0,0xc0,0xc0,0x60,0x60,0x20,0x30,0x30,0x10,0x18,0x18,0x8,0xc,0xc,0x4,0x6, - 0x6,0x3,0x3,0x3 -}; -static const GLUTBitmapChar ch47 = { 8, 20, 1, 3, 7, ch47data }; - -static const unsigned char ch48data[] = { - 0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0xe1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x61,0x80,0x61,0x80,0x33,0x0, - 0x1e,0x0 -}; -static const GLUTBitmapChar ch48 = { 10, 17, -1, 0, 12, ch48data }; - -static const unsigned char ch49data[] = { - 0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x18, - 0x8 -}; -static const GLUTBitmapChar ch49 = { 8, 17, -2, 0, 12, ch49data }; - -static const unsigned char ch50data[] = { - 0xff,0x80,0xff,0xc0,0x60,0x40,0x30,0x0,0x18,0x0,0xc,0x0,0x4,0x0,0x6,0x0, - 0x3,0x0,0x3,0x0,0x1,0x80,0x1,0x80,0x81,0x80,0x81,0x80,0x43,0x80,0x7f,0x0, - 0x1c,0x0 -}; -static const GLUTBitmapChar ch50 = { 10, 17, -1, 0, 12, ch50data }; - -static const unsigned char ch51data[] = { - 0x78,0x0,0xe6,0x0,0xc3,0x0,0x1,0x0,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0x80, - 0x7,0x0,0x1e,0x0,0xc,0x0,0x6,0x0,0x83,0x0,0x83,0x0,0x47,0x0,0x7e,0x0, - 0x1c,0x0 -}; -static const GLUTBitmapChar ch51 = { 9, 17, -1, 0, 12, ch51data }; - -static const unsigned char ch52data[] = { - 0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0xff,0xc0,0xff,0xc0,0xc3,0x0,0x43,0x0, - 0x63,0x0,0x23,0x0,0x33,0x0,0x13,0x0,0x1b,0x0,0xb,0x0,0x7,0x0,0x7,0x0, - 0x3,0x0 -}; -static const GLUTBitmapChar ch52 = { 10, 17, -1, 0, 12, ch52data }; - -static const unsigned char ch53data[] = { - 0x7e,0x0,0xe3,0x80,0xc1,0x80,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x1,0xc0, - 0x3,0x80,0xf,0x80,0x7e,0x0,0x78,0x0,0x60,0x0,0x20,0x0,0x20,0x0,0x1f,0x80, - 0x1f,0xc0 -}; -static const GLUTBitmapChar ch53 = { 10, 17, -1, 0, 12, ch53data }; - -static const unsigned char ch54data[] = { - 0x1e,0x0,0x7b,0x80,0x61,0x80,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc1,0x80,0xf3,0x80,0xee,0x0,0x60,0x0,0x70,0x0,0x30,0x0,0x18,0x0,0xe,0x0, - 0x3,0xc0 -}; -static const GLUTBitmapChar ch54 = { 10, 17, -1, 0, 12, ch54data }; - -static const unsigned char ch55data[] = { - 0x18,0x0,0x18,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0x4,0x0,0x6,0x0,0x6,0x0, - 0x2,0x0,0x3,0x0,0x3,0x0,0x1,0x0,0x1,0x80,0x81,0x80,0xc0,0xc0,0xff,0xc0, - 0x7f,0xc0 -}; -static const GLUTBitmapChar ch55 = { 10, 17, -1, 0, 12, ch55data }; - -static const unsigned char ch56data[] = { - 0x1e,0x0,0x73,0x80,0xe1,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x41,0xc0,0x61,0x80, - 0x37,0x0,0x1e,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, - 0x1e,0x0 -}; -static const GLUTBitmapChar ch56 = { 10, 17, -1, 0, 12, ch56data }; - -static const unsigned char ch57data[] = { - 0xf0,0x0,0x1c,0x0,0x6,0x0,0x3,0x0,0x3,0x80,0x1,0x80,0x1d,0x80,0x73,0xc0, - 0x61,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0x61,0x80,0x77,0x80, - 0x1e,0x0 -}; -static const GLUTBitmapChar ch57 = { 10, 17, -1, 0, 12, ch57data }; - -static const unsigned char ch58data[] = { - 0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch58 = { 2, 11, -2, 0, 6, ch58data }; - -static const unsigned char ch59data[] = { - 0xc0,0x60,0x20,0xe0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0 -}; -static const GLUTBitmapChar ch59 = { 3, 14, -2, 3, 7, ch59data }; - -static const unsigned char ch60data[] = { - 0x0,0x60,0x1,0xc0,0x7,0x0,0x1c,0x0,0x70,0x0,0xc0,0x0,0x70,0x0,0x1c,0x0, - 0x7,0x0,0x1,0xc0,0x0,0x60 -}; -static const GLUTBitmapChar ch60 = { 11, 11, -1, -1, 13, ch60data }; - -static const unsigned char ch61data[] = { - 0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0 -}; -static const GLUTBitmapChar ch61 = { 12, 6, -1, -4, 14, ch61data }; - -static const unsigned char ch62data[] = { - 0xc0,0x0,0x70,0x0,0x1c,0x0,0x7,0x0,0x1,0xc0,0x0,0x60,0x1,0xc0,0x7,0x0, - 0x1c,0x0,0x70,0x0,0xc0,0x0 -}; -static const GLUTBitmapChar ch62 = { 11, 11, -1, -1, 13, ch62data }; - -static const unsigned char ch63data[] = { - 0x30,0x30,0x0,0x0,0x10,0x10,0x10,0x18,0x18,0xc,0xe,0x7,0xc3,0xc3,0x83,0xc6, - 0x7c -}; -static const GLUTBitmapChar ch63 = { 8, 17, -2, 0, 11, ch63data }; - -static const unsigned char ch64data[] = { - 0x3,0xf0,0x0,0xe,0xc,0x0,0x18,0x0,0x0,0x30,0x0,0x0,0x61,0xde,0x0,0x63, - 0x7b,0x0,0xc6,0x39,0x80,0xc6,0x18,0x80,0xc6,0x18,0xc0,0xc6,0x18,0x40,0xc6,0xc, - 0x40,0xc3,0xc,0x40,0xc3,0x8c,0x40,0xe1,0xfc,0x40,0x60,0xec,0xc0,0x70,0x0,0x80, - 0x38,0x1,0x80,0x1c,0x3,0x0,0xf,0xe,0x0,0x3,0xf8,0x0 -}; -static const GLUTBitmapChar ch64 = { 18, 20, -2, 3, 22, ch64data }; - -static const unsigned char ch65data[] = { - 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, - 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, - 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, - 0x0,0x80,0x0 -}; -static const GLUTBitmapChar ch65 = { 17, 17, 0, 0, 17, ch65data }; - -static const unsigned char ch66data[] = { - 0xff,0xe0,0x30,0x78,0x30,0x18,0x30,0xc,0x30,0xc,0x30,0xc,0x30,0x18,0x30,0x38, - 0x3f,0xe0,0x30,0x40,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, - 0xff,0xc0 -}; -static const GLUTBitmapChar ch66 = { 14, 17, -1, 0, 16, ch66data }; - -static const unsigned char ch67data[] = { - 0x7,0xe0,0x1e,0x38,0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, - 0x7,0xe4 -}; -static const GLUTBitmapChar ch67 = { 14, 17, -1, 0, 16, ch67data }; - -static const unsigned char ch68data[] = { - 0xff,0xc0,0x30,0x70,0x30,0x38,0x30,0xc,0x30,0xc,0x30,0x6,0x30,0x6,0x30,0x6, - 0x30,0x6,0x30,0x6,0x30,0x6,0x30,0x6,0x30,0xc,0x30,0xc,0x30,0x38,0x30,0x70, - 0xff,0xc0 -}; -static const GLUTBitmapChar ch68 = { 15, 17, -1, 0, 17, ch68data }; - -static const unsigned char ch69data[] = { - 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, - 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, - 0xff,0xf0 -}; -static const GLUTBitmapChar ch69 = { 13, 17, -1, 0, 15, ch69data }; - -static const unsigned char ch70data[] = { - 0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x20,0x30,0x20, - 0x3f,0xe0,0x30,0x20,0x30,0x20,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, - 0xff,0xf0 -}; -static const GLUTBitmapChar ch70 = { 12, 17, -1, 0, 14, ch70data }; - -static const unsigned char ch71data[] = { - 0x7,0xe0,0x1e,0x38,0x38,0x1c,0x60,0xc,0x60,0xc,0xc0,0xc,0xc0,0xc,0xc0,0x3f, - 0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, - 0x7,0xe4 -}; -static const GLUTBitmapChar ch71 = { 16, 17, -1, 0, 18, ch71data }; - -static const unsigned char ch72data[] = { - 0xfc,0x1f,0x80,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30, - 0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x3f,0xfe,0x0,0x30,0x6,0x0,0x30,0x6, - 0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0, - 0xfc,0x1f,0x80 -}; -static const GLUTBitmapChar ch72 = { 17, 17, -1, 0, 19, ch72data }; - -static const unsigned char ch73data[] = { - 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0xfc -}; -static const GLUTBitmapChar ch73 = { 6, 17, -1, 0, 8, ch73data }; - -static const unsigned char ch74data[] = { - 0x78,0x0,0xcc,0x0,0xc6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, - 0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, - 0x1f,0x80 -}; -static const GLUTBitmapChar ch74 = { 9, 17, -1, 0, 11, ch74data }; - -static const unsigned char ch75data[] = { - 0xfc,0x1f,0x30,0xe,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0xe0,0x31,0xc0,0x33,0x80, - 0x3f,0x0,0x3e,0x0,0x33,0x0,0x31,0x80,0x30,0xc0,0x30,0x60,0x30,0x30,0x30,0x18, - 0xfc,0x7e -}; -static const GLUTBitmapChar ch75 = { 16, 17, -1, 0, 17, ch75data }; - -static const unsigned char ch76data[] = { - 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, - 0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, - 0xfc,0x0 -}; -static const GLUTBitmapChar ch76 = { 13, 17, -1, 0, 14, ch76data }; - -static const unsigned char ch77data[] = { - 0xf8,0x21,0xf8,0x20,0x60,0x60,0x20,0x60,0x60,0x20,0xd0,0x60,0x20,0xd0,0x60,0x21, - 0x88,0x60,0x21,0x88,0x60,0x23,0x8,0x60,0x23,0x4,0x60,0x26,0x4,0x60,0x26,0x2, - 0x60,0x2c,0x2,0x60,0x2c,0x2,0x60,0x38,0x1,0x60,0x38,0x1,0x60,0x30,0x0,0xe0, - 0xf0,0x0,0xf8 -}; -static const GLUTBitmapChar ch77 = { 21, 17, -1, 0, 22, ch77data }; - -static const unsigned char ch78data[] = { - 0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, - 0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, - 0xf0,0x1f -}; -static const GLUTBitmapChar ch78 = { 16, 17, -1, 0, 18, ch78data }; - -static const unsigned char ch79data[] = { - 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, - 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, - 0x7,0xe0 -}; -static const GLUTBitmapChar ch79 = { 16, 17, -1, 0, 18, ch79data }; - -static const unsigned char ch80data[] = { - 0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, - 0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, - 0xff,0xc0 -}; -static const GLUTBitmapChar ch80 = { 13, 17, -1, 0, 15, ch80data }; - -static const unsigned char ch81data[] = { - 0x0,0xf,0x0,0x38,0x0,0x70,0x0,0xe0,0x1,0xc0,0x7,0xe0,0x1c,0x38,0x38,0x1c, - 0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3, - 0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,0x7,0xe0 -}; -static const GLUTBitmapChar ch81 = { 16, 22, -1, 5, 18, ch81data }; - -static const unsigned char ch82data[] = { - 0xfc,0x1e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x60,0x30,0xc0,0x31,0xc0,0x33,0x80, - 0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x38,0x30,0x18,0x30,0x38,0x30,0x30,0x30,0x70, - 0xff,0xc0 -}; -static const GLUTBitmapChar ch82 = { 15, 17, -1, 0, 16, ch82data }; - -static const unsigned char ch83data[] = { - 0x9e,0x0,0xf1,0x80,0xc0,0xc0,0x80,0x60,0x80,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0, - 0xf,0x80,0x1e,0x0,0x78,0x0,0xe0,0x0,0xc0,0x40,0xc0,0x40,0xc0,0xc0,0x63,0xc0, - 0x1e,0x40 -}; -static const GLUTBitmapChar ch83 = { 11, 17, -1, 0, 13, ch83data }; - -static const unsigned char ch84data[] = { - 0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0, - 0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x83,0x4,0x83,0x4,0xc3,0xc, - 0xff,0xfc -}; -static const GLUTBitmapChar ch84 = { 14, 17, -1, 0, 16, ch84data }; - -static const unsigned char ch85data[] = { - 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0xfc,0x1f -}; -static const GLUTBitmapChar ch85 = { 16, 17, -1, 0, 18, ch85data }; - -static const unsigned char ch86data[] = { - 0x1,0x80,0x0,0x1,0x80,0x0,0x1,0x80,0x0,0x3,0xc0,0x0,0x3,0x40,0x0,0x3, - 0x60,0x0,0x6,0x20,0x0,0x6,0x20,0x0,0x6,0x30,0x0,0xc,0x10,0x0,0xc,0x18, - 0x0,0x18,0x8,0x0,0x18,0x8,0x0,0x18,0xc,0x0,0x30,0x4,0x0,0x30,0x6,0x0, - 0xfc,0x1f,0x80 -}; -static const GLUTBitmapChar ch86 = { 17, 17, 0, 0, 17, ch86data }; - -static const unsigned char ch87data[] = { - 0x1,0x83,0x0,0x1,0x83,0x0,0x1,0x83,0x80,0x3,0x87,0x80,0x3,0x46,0x80,0x3, - 0x46,0xc0,0x6,0x46,0x40,0x6,0x4c,0x40,0x6,0x4c,0x60,0xc,0x2c,0x60,0xc,0x2c, - 0x20,0x18,0x2c,0x20,0x18,0x18,0x30,0x18,0x18,0x10,0x30,0x18,0x10,0x30,0x18,0x18, - 0xfc,0x7e,0x7e -}; -static const GLUTBitmapChar ch87 = { 23, 17, 0, 0, 23, ch87data }; - -static const unsigned char ch88data[] = { - 0xfc,0xf,0xc0,0x30,0x3,0x80,0x18,0x7,0x0,0x8,0xe,0x0,0x4,0xc,0x0,0x6, - 0x18,0x0,0x2,0x38,0x0,0x1,0x70,0x0,0x0,0xe0,0x0,0x0,0xc0,0x0,0x1,0xc0, - 0x0,0x3,0xa0,0x0,0x3,0x10,0x0,0x6,0x8,0x0,0xe,0xc,0x0,0x1c,0x6,0x0, - 0x7e,0xf,0x80 -}; -static const GLUTBitmapChar ch88 = { 18, 17, 0, 0, 18, ch88data }; - -static const unsigned char ch89data[] = { - 0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, - 0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, - 0xfc,0x3f -}; -static const GLUTBitmapChar ch89 = { 16, 17, 0, 0, 16, ch89data }; - -static const unsigned char ch90data[] = { - 0xff,0xf8,0xe0,0x18,0x70,0x8,0x30,0x8,0x38,0x0,0x18,0x0,0x1c,0x0,0xe,0x0, - 0x6,0x0,0x7,0x0,0x3,0x0,0x3,0x80,0x1,0xc0,0x80,0xc0,0x80,0xe0,0xc0,0x70, - 0xff,0xf0 -}; -static const GLUTBitmapChar ch90 = { 13, 17, -1, 0, 15, ch90data }; - -static const unsigned char ch91data[] = { - 0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0xc0,0xc0,0xf8 -}; -static const GLUTBitmapChar ch91 = { 5, 21, -2, 4, 8, ch91data }; - -static const unsigned char ch92data[] = { - 0x6,0x6,0x4,0xc,0xc,0x8,0x18,0x18,0x10,0x30,0x30,0x20,0x60,0x60,0x40,0xc0, - 0xc0 -}; -static const GLUTBitmapChar ch92 = { 7, 17, 0, 0, 7, ch92data }; - -static const unsigned char ch93data[] = { - 0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x18,0x18,0x18,0x18,0xf8 -}; -static const GLUTBitmapChar ch93 = { 5, 21, -1, 4, 8, ch93data }; - -static const unsigned char ch94data[] = { - 0x80,0x80,0xc1,0x80,0x41,0x0,0x63,0x0,0x22,0x0,0x36,0x0,0x14,0x0,0x1c,0x0, - 0x8,0x0 -}; -static const GLUTBitmapChar ch94 = { 9, 9, -1, -8, 11, ch94data }; - -static const unsigned char ch95data[] = { - 0xff,0xf8,0xff,0xf8 -}; -static const GLUTBitmapChar ch95 = { 13, 2, 0, 5, 13, ch95data }; - -static const unsigned char ch96data[] = { - 0x60,0xe0,0x80,0xc0,0x60 -}; -static const GLUTBitmapChar ch96 = { 3, 5, -2, -12, 7, ch96data }; - -static const unsigned char ch97data[] = { - 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, - 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0 -}; -static const GLUTBitmapChar ch97 = { 9, 12, -1, 0, 11, ch97data }; - -static const unsigned char ch98data[] = { - 0x5e,0x0,0x73,0x80,0x61,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x61,0x80,0x73,0x80,0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, - 0xe0,0x0 -}; -static const GLUTBitmapChar ch98 = { 10, 17, -1, 0, 12, ch98data }; - -static const unsigned char ch99data[] = { - 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, - 0xc0,0x0,0x41,0x80,0x63,0x80,0x1f,0x0 -}; -static const GLUTBitmapChar ch99 = { 9, 12, -1, 0, 11, ch99data }; - -static const unsigned char ch100data[] = { - 0x1e,0xc0,0x73,0x80,0x61,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80, - 0xc1,0x80,0x61,0x80,0x73,0x80,0x1d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, - 0x3,0x80 -}; -static const GLUTBitmapChar ch100 = { 10, 17, -1, 0, 12, ch100data }; - -static const unsigned char ch101data[] = { - 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, - 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0 -}; -static const GLUTBitmapChar ch101 = { 9, 12, -1, 0, 11, ch101data }; - -static const unsigned char ch102data[] = { - 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x30,0x30,0x30,0x16, - 0xe -}; -static const GLUTBitmapChar ch102 = { 7, 17, 0, 0, 7, ch102data }; - -static const unsigned char ch103data[] = { - 0x3f,0x0,0xf1,0xc0,0xc0,0x60,0xc0,0x20,0x60,0x60,0x3f,0xc0,0x7f,0x0,0x60,0x0, - 0x30,0x0,0x3e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, - 0x1f,0xc0 -}; -static const GLUTBitmapChar ch103 = { 11, 17, -1, 5, 12, ch103data }; - -static const unsigned char ch104data[] = { - 0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x71,0xc0,0x6f,0x80,0x67,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, - 0xe0,0x0 -}; -static const GLUTBitmapChar ch104 = { 11, 17, -1, 0, 13, ch104data }; - -static const unsigned char ch105data[] = { - 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x0,0x0,0x60, - 0x60 -}; -static const GLUTBitmapChar ch105 = { 4, 17, -1, 0, 6, ch105data }; - -static const unsigned char ch106data[] = { - 0xc0,0xe0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0x70,0x0,0x0,0x0,0x30,0x30 -}; -static const GLUTBitmapChar ch106 = { 4, 22, 0, 5, 6, ch106data }; - -static const unsigned char ch107data[] = { - 0xf3,0xe0,0x61,0xc0,0x63,0x80,0x67,0x0,0x6e,0x0,0x6c,0x0,0x78,0x0,0x68,0x0, - 0x64,0x0,0x66,0x0,0x63,0x0,0x67,0xc0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, - 0xe0,0x0 -}; -static const GLUTBitmapChar ch107 = { 11, 17, -1, 0, 12, ch107data }; - -static const unsigned char ch108data[] = { - 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, - 0xe0 -}; -static const GLUTBitmapChar ch108 = { 4, 17, -1, 0, 6, ch108data }; - -static const unsigned char ch109data[] = { - 0xf1,0xe3,0xc0,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60, - 0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x71,0xe3,0x80,0x6f,0x9f, - 0x0,0xe7,0xe,0x0 -}; -static const GLUTBitmapChar ch109 = { 18, 12, -1, 0, 20, ch109data }; - -static const unsigned char ch110data[] = { - 0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0 -}; -static const GLUTBitmapChar ch110 = { 11, 12, -1, 0, 13, ch110data }; - -static const unsigned char ch111data[] = { - 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0 -}; -static const GLUTBitmapChar ch111 = { 10, 12, -1, 0, 12, ch111data }; - -static const unsigned char ch112data[] = { - 0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, - 0xee,0x0 -}; -static const GLUTBitmapChar ch112 = { 10, 17, -1, 5, 12, ch112data }; - -static const unsigned char ch113data[] = { - 0x3,0xc0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1d,0x80,0x73,0x80,0x61,0x80, - 0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x73,0x80, - 0x1d,0x80 -}; -static const GLUTBitmapChar ch113 = { 10, 17, -1, 5, 12, ch113data }; - -static const unsigned char ch114data[] = { - 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x76,0x6e,0xe6 -}; -static const GLUTBitmapChar ch114 = { 7, 12, -1, 0, 8, ch114data }; - -static const unsigned char ch115data[] = { - 0xf8,0xc6,0x83,0x3,0x7,0x1e,0x7c,0x70,0xe0,0xc2,0x66,0x3e -}; -static const GLUTBitmapChar ch115 = { 8, 12, -1, 0, 10, ch115data }; - -static const unsigned char ch116data[] = { - 0x1c,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x70,0x30,0x10 -}; -static const GLUTBitmapChar ch116 = { 7, 15, 0, 0, 7, ch116data }; - -static const unsigned char ch117data[] = { - 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0 -}; -static const GLUTBitmapChar ch117 = { 11, 12, -1, 0, 13, ch117data }; - -static const unsigned char ch118data[] = { - 0x4,0x0,0xe,0x0,0xe,0x0,0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80, - 0x30,0x80,0x60,0x80,0x60,0xc0,0xf1,0xe0 -}; -static const GLUTBitmapChar ch118 = { 11, 12, 0, 0, 11, ch118data }; - -static const unsigned char ch119data[] = { - 0x4,0x10,0x0,0xe,0x38,0x0,0xe,0x38,0x0,0x1a,0x28,0x0,0x1a,0x64,0x0,0x19, - 0x64,0x0,0x31,0x64,0x0,0x30,0xc2,0x0,0x30,0xc2,0x0,0x60,0xc2,0x0,0x60,0xc3, - 0x0,0xf1,0xe7,0x80 -}; -static const GLUTBitmapChar ch119 = { 17, 12, 0, 0, 17, ch119data }; - -static const unsigned char ch120data[] = { - 0xf1,0xe0,0x60,0xc0,0x21,0x80,0x33,0x80,0x1b,0x0,0xe,0x0,0xc,0x0,0x1a,0x0, - 0x39,0x0,0x31,0x80,0x60,0xc0,0xf1,0xe0 -}; -static const GLUTBitmapChar ch120 = { 11, 12, -1, 0, 13, ch120data }; - -static const unsigned char ch121data[] = { - 0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, - 0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, - 0xf1,0xe0 -}; -static const GLUTBitmapChar ch121 = { 11, 17, 0, 5, 11, ch121data }; - -static const unsigned char ch122data[] = { - 0xff,0xc3,0x61,0x70,0x30,0x38,0x18,0x1c,0xe,0x86,0xc3,0xff -}; -static const GLUTBitmapChar ch122 = { 8, 12, -1, 0, 10, ch122data }; - -static const unsigned char ch123data[] = { - 0x7,0xc,0x18,0x18,0x18,0x18,0x18,0x18,0x10,0x30,0x20,0xc0,0x20,0x30,0x10,0x18, - 0x18,0x18,0x18,0x18,0xc,0x7 -}; -static const GLUTBitmapChar ch123 = { 8, 22, -1, 5, 10, ch123data }; - -static const unsigned char ch124data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0 -}; -static const GLUTBitmapChar ch124 = { 2, 17, -2, 0, 6, ch124data }; - -static const unsigned char ch125data[] = { - 0xe0,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x8,0xc,0x4,0x3,0x4,0xc,0x8,0x18, - 0x18,0x18,0x18,0x18,0x30,0xe0 -}; -static const GLUTBitmapChar ch125 = { 8, 22, -1, 5, 10, ch125data }; - -static const unsigned char ch126data[] = { - 0x83,0x80,0xc7,0xc0,0x7c,0x60,0x38,0x20 -}; -static const GLUTBitmapChar ch126 = { 11, 4, -1, -5, 13, ch126data }; - -static const unsigned char ch160data[] = { - 0x0 -}; -static const GLUTBitmapChar ch160 = { 1, 1, 0, 0, 6, ch160data }; - -static const unsigned char ch161data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0, - 0xc0 -}; -static const GLUTBitmapChar ch161 = { 2, 17, -4, 5, 8, ch161data }; - -static const unsigned char ch162data[] = { - 0x40,0x0,0x40,0x0,0x3e,0x0,0x7f,0x0,0x70,0x80,0xd0,0x0,0xc8,0x0,0xc8,0x0, - 0xc8,0x0,0xc4,0x0,0xc4,0x0,0x43,0x80,0x63,0x80,0x1f,0x0,0x1,0x0,0x1,0x0 -}; -static const GLUTBitmapChar ch162 = { 9, 16, -1, 2, 12, ch162data }; - -static const unsigned char ch163data[] = { - 0xe7,0x80,0xbe,0xc0,0x78,0x40,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, - 0x30,0x0,0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x31,0x80,0x19,0x80, - 0xf,0x0 -}; -static const GLUTBitmapChar ch163 = { 10, 17, -1, 0, 12, ch163data }; - -static const unsigned char ch164data[] = { - 0xc0,0x60,0xee,0xe0,0x7f,0xc0,0x31,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x31,0x80,0x7f,0xc0,0xee,0xe0,0xc0,0x60 -}; -static const GLUTBitmapChar ch164 = { 11, 12, -1, -3, 13, ch164data }; - -static const unsigned char ch165data[] = { - 0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x1f,0xe0,0x3,0x0,0x1f,0xe0, - 0x3,0x0,0x7,0x80,0xc,0x80,0xc,0xc0,0x18,0x40,0x18,0x60,0x30,0x20,0x70,0x30, - 0xf8,0x7c -}; -static const GLUTBitmapChar ch165 = { 14, 17, 0, 0, 14, ch165data }; - -static const unsigned char ch166data[] = { - 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0 -}; -static const GLUTBitmapChar ch166 = { 2, 17, -2, 0, 6, ch166data }; - -static const unsigned char ch167data[] = { - 0x38,0x64,0x62,0x6,0xe,0x1c,0x38,0x74,0xe2,0xc3,0x83,0x87,0x4e,0x3c,0x38,0x70, - 0x60,0x46,0x26,0x1c -}; -static const GLUTBitmapChar ch167 = { 8, 20, -2, 2, 12, ch167data }; - -static const unsigned char ch168data[] = { - 0xcc,0xcc -}; -static const GLUTBitmapChar ch168 = { 6, 2, -1, -14, 8, ch168data }; - -static const unsigned char ch169data[] = { - 0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x61,0xc3,0x0,0x47,0x71,0x0,0xc4, - 0x19,0x80,0x8c,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x8c,0x0, - 0x80,0xc4,0x19,0x80,0x47,0x31,0x0,0x61,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, - 0x7,0xf0,0x0 -}; -static const GLUTBitmapChar ch169 = { 17, 17, -1, 0, 19, ch169data }; - -static const unsigned char ch170data[] = { - 0x7e,0x0,0x76,0xcc,0xcc,0x7c,0xc,0xcc,0x78 -}; -static const GLUTBitmapChar ch170 = { 7, 9, 0, -8, 8, ch170data }; - -static const unsigned char ch171data[] = { - 0x8,0x80,0x19,0x80,0x33,0x0,0x66,0x0,0xcc,0x0,0xcc,0x0,0x66,0x0,0x33,0x0, - 0x19,0x80,0x8,0x80 -}; -static const GLUTBitmapChar ch171 = { 9, 10, -2, -1, 13, ch171data }; - -static const unsigned char ch172data[] = { - 0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0xff,0xf0,0xff,0xf0 -}; -static const GLUTBitmapChar ch172 = { 12, 7, -1, -3, 14, ch172data }; - -static const unsigned char ch173data[] = { - 0xfe,0xfe -}; -static const GLUTBitmapChar ch173 = { 7, 2, -1, -5, 9, ch173data }; - -static const unsigned char ch174data[] = { - 0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x60,0x3,0x0,0x47,0x19,0x0,0xc2, - 0x31,0x80,0x82,0x20,0x80,0x82,0x40,0x80,0x83,0xe0,0x80,0x82,0x30,0x80,0x82,0x10, - 0x80,0xc2,0x11,0x80,0x42,0x31,0x0,0x67,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, - 0x7,0xf0,0x0 -}; -static const GLUTBitmapChar ch174 = { 17, 17, -1, 0, 19, ch174data }; - -static const unsigned char ch175data[] = { - 0xfc,0xfc -}; -static const GLUTBitmapChar ch175 = { 6, 2, -1, -14, 8, ch175data }; - -static const unsigned char ch176data[] = { - 0x38,0x44,0x82,0x82,0x82,0x44,0x38 -}; -static const GLUTBitmapChar ch176 = { 7, 7, -1, -10, 9, ch176data }; - -static const unsigned char ch177data[] = { - 0xff,0xf0,0xff,0xf0,0x0,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, - 0xff,0xf0,0xff,0xf0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch177 = { 12, 15, -1, 0, 14, ch177data }; - -static const unsigned char ch178data[] = { - 0xfc,0x44,0x20,0x30,0x10,0x8,0xc,0x8c,0x4c,0x38 -}; -static const GLUTBitmapChar ch178 = { 6, 10, 0, -7, 7, ch178data }; - -static const unsigned char ch179data[] = { - 0x70,0x88,0x8c,0xc,0x8,0x30,0x8,0x8c,0x4c,0x38 -}; -static const GLUTBitmapChar ch179 = { 6, 10, 0, -7, 7, ch179data }; - -static const unsigned char ch180data[] = { - 0x80,0x60,0x38,0x18 -}; -static const GLUTBitmapChar ch180 = { 5, 4, -2, -13, 8, ch180data }; - -static const unsigned char ch181data[] = { - 0x40,0x0,0xe0,0x0,0xc0,0x0,0x40,0x0,0x40,0x0,0x5c,0xe0,0x7e,0xc0,0x71,0xc0, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0xe1,0xc0 -}; -static const GLUTBitmapChar ch181 = { 11, 17, -1, 5, 13, ch181data }; - -static const unsigned char ch182data[] = { - 0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0, - 0x9,0x0,0x9,0x0,0x9,0x0,0x19,0x0,0x39,0x0,0x79,0x0,0x79,0x0,0xf9,0x0, - 0xf9,0x0,0xf9,0x0,0x79,0x0,0x79,0x0,0x39,0x0,0x1f,0x80 -}; -static const GLUTBitmapChar ch182 = { 9, 22, -1, 5, 11, ch182data }; - -static const unsigned char ch183data[] = { - 0xc0,0xc0 -}; -static const GLUTBitmapChar ch183 = { 2, 2, -2, -6, 6, ch183data }; - -static const unsigned char ch184data[] = { - 0x78,0xcc,0xc,0x3c,0x30,0x10 -}; -static const GLUTBitmapChar ch184 = { 6, 6, -1, 6, 8, ch184data }; - -static const unsigned char ch185data[] = { - 0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20 -}; -static const GLUTBitmapChar ch185 = { 5, 10, -1, -7, 7, ch185data }; - -static const unsigned char ch186data[] = { - 0xfc,0x0,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0x78 -}; -static const GLUTBitmapChar ch186 = { 6, 9, -1, -8, 8, ch186data }; - -static const unsigned char ch187data[] = { - 0x88,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,0x19,0x80,0x19,0x80,0x33,0x0,0x66,0x0, - 0xcc,0x0,0x88,0x0 -}; -static const GLUTBitmapChar ch187 = { 9, 10, -2, -1, 12, ch187data }; - -static const unsigned char ch188data[] = { - 0x30,0x4,0x10,0x4,0x18,0xff,0x8,0x44,0xc,0x64,0x6,0x24,0x2,0x14,0xfb,0x1c, - 0x21,0xc,0x21,0x84,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, - 0x20,0x8 -}; -static const GLUTBitmapChar ch188 = { 16, 17, -1, 0, 18, ch188data }; - -static const unsigned char ch189data[] = { - 0x30,0x7e,0x10,0x22,0x18,0x10,0x8,0x18,0xc,0x8,0x6,0x4,0x2,0x6,0xfb,0x46, - 0x21,0x26,0x21,0x9c,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, - 0x20,0x8 -}; -static const GLUTBitmapChar ch189 = { 15, 17, -1, 0, 18, ch189data }; - -static const unsigned char ch190data[] = { - 0x18,0x2,0x0,0x8,0x2,0x0,0xc,0x7f,0x80,0x4,0x22,0x0,0x6,0x32,0x0,0x3, - 0x12,0x0,0x1,0xa,0x0,0x71,0x8e,0x0,0x88,0x86,0x0,0x8c,0xc2,0x0,0xc,0x60, - 0x0,0x8,0x20,0x0,0x30,0x30,0x0,0x8,0x10,0x0,0x8c,0x18,0x0,0x4c,0xc,0x0, - 0x38,0x4,0x0 -}; -static const GLUTBitmapChar ch190 = { 17, 17, 0, 0, 18, ch190data }; - -static const unsigned char ch191data[] = { - 0x3e,0x63,0xc1,0xc3,0xc3,0xe0,0x70,0x30,0x38,0x18,0x18,0x8,0x8,0x0,0x0,0xc, - 0xc -}; -static const GLUTBitmapChar ch191 = { 8, 17, -1, 5, 11, ch191data }; - -static const unsigned char ch192data[] = { - 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, - 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, - 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, - 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0xc0,0x0,0x3,0x80,0x0,0x3, - 0x0,0x0 -}; -static const GLUTBitmapChar ch192 = { 17, 22, 0, 0, 17, ch192data }; - -static const unsigned char ch193data[] = { - 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, - 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, - 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, - 0x0,0x80,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xc0,0x0,0x0,0x70,0x0,0x0, - 0x30,0x0 -}; -static const GLUTBitmapChar ch193 = { 17, 22, 0, 0, 17, ch193data }; - -static const unsigned char ch194data[] = { - 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, - 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, - 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, - 0x0,0x80,0x0,0x0,0x0,0x0,0x8,0x10,0x0,0x6,0x60,0x0,0x3,0xc0,0x0,0x1, - 0x80,0x0 -}; -static const GLUTBitmapChar ch194 = { 17, 22, 0, 0, 17, ch194data }; - -static const unsigned char ch195data[] = { - 0xfc,0x1f,0x80,0x30,0x7,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, - 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, - 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, - 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0xe0,0x0,0x3,0x90,0x0 -}; -static const GLUTBitmapChar ch195 = { 17, 21, 0, 0, 17, ch195data }; - -static const unsigned char ch196data[] = { - 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, - 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, - 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, - 0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x30,0x0,0x6,0x30,0x0 -}; -static const GLUTBitmapChar ch196 = { 17, 21, 0, 0, 17, ch196data }; - -static const unsigned char ch197data[] = { - 0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, - 0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, - 0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, - 0x0,0x80,0x0,0x1,0xc0,0x0,0x2,0x20,0x0,0x2,0x20,0x0,0x1,0xc0,0x0 -}; -static const GLUTBitmapChar ch197 = { 17, 21, 0, 0, 17, ch197data }; - -static const unsigned char ch198data[] = { - 0xf9,0xff,0xf0,0x30,0x60,0x30,0x10,0x60,0x10,0x10,0x60,0x10,0x18,0x60,0x0,0x8, - 0x60,0x0,0xf,0xe0,0x80,0xc,0x60,0x80,0x4,0x7f,0x80,0x4,0x60,0x80,0x6,0x60, - 0x80,0x2,0x60,0x0,0x2,0x60,0x0,0x1,0x60,0x20,0x1,0x60,0x20,0x1,0xe0,0x60, - 0x3,0xff,0xe0 -}; -static const GLUTBitmapChar ch198 = { 20, 17, 0, 0, 21, ch198data }; - -static const unsigned char ch199data[] = { - 0x7,0x80,0xc,0xc0,0x0,0xc0,0x3,0xc0,0x3,0x0,0x1,0x0,0x7,0xe0,0x1e,0x38, - 0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, - 0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,0x7,0xe4 -}; -static const GLUTBitmapChar ch199 = { 14, 23, -1, 6, 16, ch199data }; - -static const unsigned char ch200data[] = { - 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, - 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, - 0xff,0xf0,0x0,0x0,0x1,0x0,0x6,0x0,0x1c,0x0,0x18,0x0 -}; -static const GLUTBitmapChar ch200 = { 13, 22, -1, 0, 15, ch200data }; - -static const unsigned char ch201data[] = { - 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, - 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, - 0xff,0xf0,0x0,0x0,0x4,0x0,0x3,0x0,0x1,0xc0,0x0,0xc0 -}; -static const GLUTBitmapChar ch201 = { 13, 22, -1, 0, 15, ch201data }; - -static const unsigned char ch202data[] = { - 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, - 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, - 0xff,0xf0,0x0,0x0,0x10,0x20,0xc,0xc0,0x7,0x80,0x3,0x0 -}; -static const GLUTBitmapChar ch202 = { 13, 22, -1, 0, 15, ch202data }; - -static const unsigned char ch203data[] = { - 0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, - 0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, - 0xff,0xf0,0x0,0x0,0x0,0x0,0x19,0x80,0x19,0x80 -}; -static const GLUTBitmapChar ch203 = { 13, 21, -1, 0, 15, ch203data }; - -static const unsigned char ch204data[] = { - 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0xfc,0x0,0x8,0x30,0xe0,0xc0 -}; -static const GLUTBitmapChar ch204 = { 6, 22, -1, 0, 8, ch204data }; - -static const unsigned char ch205data[] = { - 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0xfc,0x0,0x40,0x30,0x1c,0xc -}; -static const GLUTBitmapChar ch205 = { 6, 22, -1, 0, 8, ch205data }; - -static const unsigned char ch206data[] = { - 0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, - 0x7e,0x0,0x81,0x66,0x3c,0x18 -}; -static const GLUTBitmapChar ch206 = { 8, 22, -1, 0, 8, ch206data }; - -static const unsigned char ch207data[] = { - 0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0xfc,0x0,0x0,0xcc,0xcc -}; -static const GLUTBitmapChar ch207 = { 6, 21, -1, 0, 8, ch207data }; - -static const unsigned char ch208data[] = { - 0x7f,0xe0,0x18,0x38,0x18,0x1c,0x18,0x6,0x18,0x6,0x18,0x3,0x18,0x3,0x18,0x3, - 0xff,0x3,0x18,0x3,0x18,0x3,0x18,0x3,0x18,0x6,0x18,0x6,0x18,0x1c,0x18,0x38, - 0x7f,0xe0 -}; -static const GLUTBitmapChar ch208 = { 16, 17, 0, 0, 17, ch208data }; - -static const unsigned char ch209data[] = { - 0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, - 0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, - 0xf0,0x1f,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90 -}; -static const GLUTBitmapChar ch209 = { 16, 21, -1, 0, 18, ch209data }; - -static const unsigned char ch210data[] = { - 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, - 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, - 0x7,0xe0,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch210 = { 16, 22, -1, 0, 18, ch210data }; - -static const unsigned char ch211data[] = { - 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, - 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, - 0x7,0xe0,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30 -}; -static const GLUTBitmapChar ch211 = { 16, 22, -1, 0, 18, ch211data }; - -static const unsigned char ch212data[] = { - 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, - 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, - 0x7,0xe0,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80 -}; -static const GLUTBitmapChar ch212 = { 16, 22, -1, 0, 18, ch212data }; - -static const unsigned char ch213data[] = { - 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, - 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, - 0x7,0xe0,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90 -}; -static const GLUTBitmapChar ch213 = { 16, 21, -1, 0, 18, ch213data }; - -static const unsigned char ch214data[] = { - 0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, - 0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, - 0x7,0xe0,0x0,0x0,0x0,0x0,0x6,0x60,0x6,0x60 -}; -static const GLUTBitmapChar ch214 = { 16, 21, -1, 0, 18, ch214data }; - -static const unsigned char ch215data[] = { - 0x80,0x40,0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0, - 0x61,0x80,0xc0,0xc0,0x80,0x40 -}; -static const GLUTBitmapChar ch215 = { 10, 11, -2, -1, 14, ch215data }; - -static const unsigned char ch216data[] = { - 0x20,0x0,0x27,0xe0,0x1c,0x38,0x38,0x1c,0x68,0x6,0x64,0x6,0xc2,0x3,0xc2,0x3, - 0xc1,0x3,0xc1,0x3,0xc0,0x83,0xc0,0x83,0xc0,0x43,0x60,0x46,0x60,0x26,0x38,0x1c, - 0x1c,0x38,0x7,0xe4,0x0,0x4 -}; -static const GLUTBitmapChar ch216 = { 16, 19, -1, 1, 18, ch216data }; - -static const unsigned char ch217data[] = { - 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0xfc,0x1f,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch217 = { 16, 22, -1, 0, 18, ch217data }; - -static const unsigned char ch218data[] = { - 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0xfc,0x1f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30 -}; -static const GLUTBitmapChar ch218 = { 16, 22, -1, 0, 18, ch218data }; - -static const unsigned char ch219data[] = { - 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0xfc,0x1f,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80 -}; -static const GLUTBitmapChar ch219 = { 16, 22, -1, 0, 18, ch219data }; - -static const unsigned char ch220data[] = { - 0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, - 0xfc,0x1f,0x0,0x0,0x0,0x0,0x6,0x30,0x6,0x30 -}; -static const GLUTBitmapChar ch220 = { 16, 21, -1, 0, 18, ch220data }; - -static const unsigned char ch221data[] = { - 0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, - 0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, - 0xfc,0x3f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30 -}; -static const GLUTBitmapChar ch221 = { 16, 22, 0, 0, 16, ch221data }; - -static const unsigned char ch222data[] = { - 0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18, - 0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,0x3f,0xc0,0x30,0x0,0x30,0x0,0x30,0x0, - 0xfc,0x0 -}; -static const GLUTBitmapChar ch222 = { 13, 17, -1, 0, 15, ch222data }; - -static const unsigned char ch223data[] = { - 0xe7,0x0,0x6c,0x80,0x6c,0xc0,0x60,0xc0,0x60,0xc0,0x61,0xc0,0x61,0x80,0x63,0x80, - 0x67,0x0,0x6c,0x0,0x63,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, - 0x1e,0x0 -}; -static const GLUTBitmapChar ch223 = { 10, 17, -1, 0, 12, ch223data }; - -static const unsigned char ch224data[] = { - 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, - 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, - 0x60,0x0 -}; -static const GLUTBitmapChar ch224 = { 9, 17, -1, 0, 11, ch224data }; - -static const unsigned char ch225data[] = { - 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, - 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, - 0x3,0x0 -}; -static const GLUTBitmapChar ch225 = { 9, 17, -1, 0, 11, ch225data }; - -static const unsigned char ch226data[] = { - 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, - 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x42,0x0,0x24,0x0,0x3c,0x0, - 0x18,0x0 -}; -static const GLUTBitmapChar ch226 = { 9, 17, -1, 0, 11, ch226data }; - -static const unsigned char ch227data[] = { - 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, - 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x5c,0x0,0x3a,0x0 -}; -static const GLUTBitmapChar ch227 = { 9, 16, -1, 0, 11, ch227data }; - -static const unsigned char ch228data[] = { - 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, - 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x66,0x0,0x66,0x0 -}; -static const GLUTBitmapChar ch228 = { 9, 16, -1, 0, 11, ch228data }; - -static const unsigned char ch229data[] = { - 0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, - 0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, - 0x1c,0x0 -}; -static const GLUTBitmapChar ch229 = { 9, 17, -1, 0, 11, ch229data }; - -static const unsigned char ch230data[] = { - 0x70,0xf0,0xfb,0xf8,0xc7,0x84,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0xfc, - 0x3,0xc,0x63,0xc,0x67,0x98,0x3c,0xf0 -}; -static const GLUTBitmapChar ch230 = { 14, 12, -1, 0, 16, ch230data }; - -static const unsigned char ch231data[] = { - 0x3c,0x0,0x66,0x0,0x6,0x0,0x1e,0x0,0x18,0x0,0x8,0x0,0x1e,0x0,0x7f,0x0, - 0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x41,0x80, - 0x63,0x80,0x1f,0x0 -}; -static const GLUTBitmapChar ch231 = { 9, 18, -1, 6, 11, ch231data }; - -static const unsigned char ch232data[] = { - 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, - 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, - 0x60,0x0 -}; -static const GLUTBitmapChar ch232 = { 9, 17, -1, 0, 11, ch232data }; - -static const unsigned char ch233data[] = { - 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, - 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, - 0x3,0x0 -}; -static const GLUTBitmapChar ch233 = { 9, 17, -1, 0, 11, ch233data }; - -static const unsigned char ch234data[] = { - 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, - 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, - 0xc,0x0 -}; -static const GLUTBitmapChar ch234 = { 9, 17, -1, 0, 11, ch234data }; - -static const unsigned char ch235data[] = { - 0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, - 0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 -}; -static const GLUTBitmapChar ch235 = { 9, 16, -1, 0, 11, ch235data }; - -static const unsigned char ch236data[] = { - 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x8,0x30,0xe0, - 0xc0 -}; -static const GLUTBitmapChar ch236 = { 5, 17, 0, 0, 6, ch236data }; - -static const unsigned char ch237data[] = { - 0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x80,0x60,0x38, - 0x18 -}; -static const GLUTBitmapChar ch237 = { 5, 17, -1, 0, 6, ch237data }; - -static const unsigned char ch238data[] = { - 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x84,0x48,0x78, - 0x30 -}; -static const GLUTBitmapChar ch238 = { 6, 17, 0, 0, 6, ch238data }; - -static const unsigned char ch239data[] = { - 0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x0,0xcc,0xcc -}; -static const GLUTBitmapChar ch239 = { 6, 16, 0, 0, 6, ch239data }; - -static const unsigned char ch240data[] = { - 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1f,0x0,0xc6,0x0,0x3c,0x0,0x1e,0x0,0x71,0x80, - 0xc0,0x0 -}; -static const GLUTBitmapChar ch240 = { 10, 17, -1, 0, 12, ch240data }; - -static const unsigned char ch241data[] = { - 0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80 -}; -static const GLUTBitmapChar ch241 = { 11, 16, -1, 0, 13, ch241data }; - -static const unsigned char ch242data[] = { - 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, - 0x30,0x0 -}; -static const GLUTBitmapChar ch242 = { 10, 17, -1, 0, 12, ch242data }; - -static const unsigned char ch243data[] = { - 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, - 0x1,0x80 -}; -static const GLUTBitmapChar ch243 = { 10, 17, -1, 0, 12, ch243data }; - -static const unsigned char ch244data[] = { - 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, - 0xc,0x0 -}; -static const GLUTBitmapChar ch244 = { 10, 17, -1, 0, 12, ch244data }; - -static const unsigned char ch245data[] = { - 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80 -}; -static const GLUTBitmapChar ch245 = { 10, 16, -1, 0, 12, ch245data }; - -static const unsigned char ch246data[] = { - 0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, - 0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 -}; -static const GLUTBitmapChar ch246 = { 10, 16, -1, 0, 12, ch246data }; - -static const unsigned char ch247data[] = { - 0x6,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0, - 0x6,0x0,0x6,0x0 -}; -static const GLUTBitmapChar ch247 = { 12, 10, -1, -2, 14, ch247data }; - -static const unsigned char ch248data[] = { - 0xc0,0x0,0xde,0x0,0x73,0x80,0x71,0x80,0xd0,0xc0,0xd8,0xc0,0xc8,0xc0,0xcc,0xc0, - 0xc4,0xc0,0xc6,0xc0,0x63,0x80,0x73,0x80,0x1e,0xc0,0x0,0xc0 -}; -static const GLUTBitmapChar ch248 = { 10, 14, -1, 1, 12, ch248data }; - -static const unsigned char ch249data[] = { - 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, - 0x30,0x0 -}; -static const GLUTBitmapChar ch249 = { 11, 17, -1, 0, 13, ch249data }; - -static const unsigned char ch250data[] = { - 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, - 0x1,0x80 -}; -static const GLUTBitmapChar ch250 = { 11, 17, -1, 0, 13, ch250data }; - -static const unsigned char ch251data[] = { - 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, - 0xc,0x0 -}; -static const GLUTBitmapChar ch251 = { 11, 17, -1, 0, 13, ch251data }; - -static const unsigned char ch252data[] = { - 0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 -}; -static const GLUTBitmapChar ch252 = { 11, 16, -1, 0, 13, ch252data }; - -static const unsigned char ch253data[] = { - 0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, - 0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, - 0xf1,0xe0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,0x1,0x80 -}; -static const GLUTBitmapChar ch253 = { 11, 22, 0, 5, 11, ch253data }; - -static const unsigned char ch254data[] = { - 0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, - 0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, - 0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0xe0,0x0 -}; -static const GLUTBitmapChar ch254 = { 10, 22, -1, 5, 12, ch254data }; - -static const unsigned char ch255data[] = { - 0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, - 0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, - 0xf1,0xe0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0 -}; -static const GLUTBitmapChar ch255 = { 11, 21, 0, 5, 11, ch255data }; - - -static const GLUTBitmapChar *chars[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch32, &ch33, &ch34, &ch35, &ch36, &ch37, &ch38, &ch39, - &ch40, &ch41, &ch42, &ch43, &ch44, &ch45, &ch46, &ch47, - &ch48, &ch49, &ch50, &ch51, &ch52, &ch53, &ch54, &ch55, - &ch56, &ch57, &ch58, &ch59, &ch60, &ch61, &ch62, &ch63, - &ch64, &ch65, &ch66, &ch67, &ch68, &ch69, &ch70, &ch71, - &ch72, &ch73, &ch74, &ch75, &ch76, &ch77, &ch78, &ch79, - &ch80, &ch81, &ch82, &ch83, &ch84, &ch85, &ch86, &ch87, - &ch88, &ch89, &ch90, &ch91, &ch92, &ch93, &ch94, &ch95, - &ch96, &ch97, &ch98, &ch99, &ch100, &ch101, &ch102, &ch103, - &ch104, &ch105, &ch106, &ch107, &ch108, &ch109, &ch110, &ch111, - &ch112, &ch113, &ch114, &ch115, &ch116, &ch117, &ch118, &ch119, - &ch120, &ch121, &ch122, &ch123, &ch124, &ch125, &ch126, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - &ch160, &ch161, &ch162, &ch163, &ch164, &ch165, &ch166, &ch167, - &ch168, &ch169, &ch170, &ch171, &ch172, &ch173, &ch174, &ch175, - &ch176, &ch177, &ch178, &ch179, &ch180, &ch181, &ch182, &ch183, - &ch184, &ch185, &ch186, &ch187, &ch188, &ch189, &ch190, &ch191, - &ch192, &ch193, &ch194, &ch195, &ch196, &ch197, &ch198, &ch199, - &ch200, &ch201, &ch202, &ch203, &ch204, &ch205, &ch206, &ch207, - &ch208, &ch209, &ch210, &ch211, &ch212, &ch213, &ch214, &ch215, - &ch216, &ch217, &ch218, &ch219, &ch220, &ch221, &ch222, &ch223, - &ch224, &ch225, &ch226, &ch227, &ch228, &ch229, &ch230, &ch231, - &ch232, &ch233, &ch234, &ch235, &ch236, &ch237, &ch238, &ch239, - &ch240, &ch241, &ch242, &ch243, &ch244, &ch245, &ch246, &ch247, - &ch248, &ch249, &ch250, &ch251, &ch252, &ch253, &ch254, &ch255 -}; - -const GLUTBitmapFont glutBitmapTimesRoman24 = { - "-Adobe-Times-Medium-R-Normal--24-240-75-75-P-124-ISO8859-1", - 28, 256, chars -}; diff --git a/src/glut/dos/util.c b/src/glut/dos/util.c deleted file mode 100644 index df126443d3..0000000000 --- a/src/glut/dos/util.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "internal.h" - - -extern GLUTStrokeFont glutStrokeRoman, glutStrokeMonoRoman; -extern GLUTBitmapFont glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18; - -/* To get around the fact that DJGPP DXEs only allow functions - to be exported and no data addresses (as Unix DSOs support), the - GLUT API constants such as GLUT_STROKE_ROMAN have to get passed - through a case statement to get mapped to the actual data structure - address. */ -void * -_glut_font (void *font) -{ - switch ((int)font) { - case (int)GLUT_STROKE_ROMAN: - return &glutStrokeRoman; - case (int)GLUT_STROKE_MONO_ROMAN: - return &glutStrokeMonoRoman; - case (int)GLUT_BITMAP_9_BY_15: - return &glutBitmap9By15; - case (int)GLUT_BITMAP_8_BY_13: - return &glutBitmap8By13; - case (int)GLUT_BITMAP_TIMES_ROMAN_10: - return &glutBitmapTimesRoman10; - case (int)GLUT_BITMAP_TIMES_ROMAN_24: - return &glutBitmapTimesRoman24; - case (int)GLUT_BITMAP_HELVETICA_10: - return &glutBitmapHelvetica10; - case (int)GLUT_BITMAP_HELVETICA_12: - return &glutBitmapHelvetica12; - case (int)GLUT_BITMAP_HELVETICA_18: - return &glutBitmapHelvetica18; - default: - if ((font == &glutStrokeRoman) || - (font == &glutStrokeMonoRoman) || - (font == &glutBitmap9By15) || - (font == &glutBitmap8By13) || - (font == &glutBitmapTimesRoman10) || - (font == &glutBitmapTimesRoman24) || - (font == &glutBitmapHelvetica10) || - (font == &glutBitmapHelvetica12) || - (font == &glutBitmapHelvetica18)) { - return font; - } - _glut_fatal("bad font!"); - return NULL; - } -} diff --git a/src/glut/dos/window.c b/src/glut/dos/window.c deleted file mode 100644 index 610cf36dcc..0000000000 --- a/src/glut/dos/window.c +++ /dev/null @@ -1,329 +0,0 @@ -/* - * DOS/DJGPP Mesa Utility Toolkit - * Version: 1.0 - * - * Copyright (C) 2005 Daniel Borca All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * DANIEL BORCA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include - -#include "internal.h" - - -static GLuint swaptime, swapcount; - -static DMesaVisual visual = NULL; - -GLUTwindow *_glut_current, *_glut_windows[MAX_WINDOWS]; - - -static void -clean (void) -{ - int i; - - for (i=1; i<=MAX_WINDOWS; i++) { - glutDestroyWindow(i); - } - if (visual) DMesaDestroyVisual(visual); - - pc_close_stdout(); - pc_close_stderr(); -} - - -static GLUTwindow * -_glut_window (int win) -{ - if (win > 0 && --win < MAX_WINDOWS) { - return _glut_windows[win]; - } - return NULL; -} - - -int APIENTRY -glutCreateWindow (const char *title) -{ - int i; - int m8width = (_glut_default.width + 7) & ~7; - - if (!(_glut_default.mode & GLUT_DOUBLE)) { - return 0; - } - - /* We set the Visual once. This will be our desktop (graphic mode). - * We should do this in the `glutInit' code, but we don't have any idea - * about its geometry. Supposedly, when we are about to create one - * window, we have a slight idea about resolution. - */ - if (!visual) { - if ((visual=DMesaCreateVisual(_glut_default.x + m8width, _glut_default.y + _glut_default.height, _glut_visual.bpp, _glut_visual.refresh, - GLUT_SINGLE, - !(_glut_default.mode & GLUT_INDEX), - (_glut_default.mode & GLUT_ALPHA ) ? _glut_visual.alpha : 0, - (_glut_default.mode & GLUT_DEPTH ) ? _glut_visual.depth : 0, - (_glut_default.mode & GLUT_STENCIL) ? _glut_visual.stencil : 0, - (_glut_default.mode & GLUT_ACCUM ) ? _glut_visual.accum : 0))==NULL) { - return 0; - } - - DMesaGetIntegerv(DMESA_GET_SCREEN_SIZE, _glut_visual.geometry); - DMesaGetIntegerv(DMESA_GET_DRIVER_CAPS, &_glut_visual.flags); - - /* Also hook stdio/stderr once */ - pc_open_stdout(); - pc_open_stderr(); - pc_atexit(clean); - } - - /* Search for an empty slot. - * Each window has its own rendering Context and its own Buffer. - */ - for (i=0; inum = ++i; - w->xpos = _glut_default.x; - w->ypos = _glut_default.y; - w->width = m8width; - w->height = _glut_default.height; - w->context = c; - w->buffer = b; - - return i; - } - } - - return 0; -} - - -int APIENTRY -glutCreateSubWindow (int win, int x, int y, int width, int height) -{ - return GL_FALSE; -} - - -void APIENTRY -glutDestroyWindow (int win) -{ - GLUTwindow *w = _glut_window(win); - if (w != NULL) { - if (w->destroy) { - w->destroy(); - } - DMesaMakeCurrent(NULL, NULL); - DMesaDestroyBuffer(w->buffer); - DMesaDestroyContext(w->context); - free(w); - _glut_windows[win - 1] = NULL; - } -} - - -void APIENTRY -glutPostRedisplay (void) -{ - _glut_current->redisplay = GL_TRUE; -} - - -void APIENTRY -glutSwapBuffers (void) -{ - if (_glut_current->show_mouse) { - /* XXX scare mouse */ - DMesaSwapBuffers(_glut_current->buffer); - /* XXX unscare mouse */ - } else { - DMesaSwapBuffers(_glut_current->buffer); - } - - if (_glut_fps) { - GLint t = glutGet(GLUT_ELAPSED_TIME); - swapcount++; - if (swaptime == 0) - swaptime = t; - else if (t - swaptime > _glut_fps) { - double time = 0.001 * (t - swaptime); - double fps = (double)swapcount / time; - fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", swapcount, time, fps); - swaptime = t; - swapcount = 0; - } - } -} - - -int APIENTRY -glutGetWindow (void) -{ - return _glut_current->num; -} - - -void APIENTRY -glutSetWindow (int win) -{ - GLUTwindow *w = _glut_window(win); - if (w != NULL) { - _glut_current = w; - DMesaMakeCurrent(_glut_current->context, _glut_current->buffer); - } -} - - -void APIENTRY -glutSetWindowTitle (const char *title) -{ -} - - -void APIENTRY -glutSetIconTitle (const char *title) -{ -} - - -void APIENTRY -glutPositionWindow (int x, int y) -{ - if (DMesaMoveBuffer(x, y)) { - _glut_current->xpos = x; - _glut_current->ypos = y; - } -} - - -void APIENTRY -glutReshapeWindow (int width, int height) -{ - if (DMesaResizeBuffer(width, height)) { - _glut_current->width = width; - _glut_current->height = height; - if (_glut_current->reshape) { - _glut_current->reshape(width, height); - } else { - glViewport(0, 0, width, height); - } - } -} - - -void APIENTRY -glutFullScreen (void) -{ -} - - -void APIENTRY -glutPopWindow (void) -{ -} - - -void APIENTRY -glutPushWindow (void) -{ -} - - -void APIENTRY -glutIconifyWindow (void) -{ -} - - -void APIENTRY -glutShowWindow (void) -{ -} - - -void APIENTRY -glutHideWindow (void) -{ -} - - -void APIENTRY -glutCloseFunc (GLUTdestroyCB destroy) -{ - _glut_current->destroy = destroy; -} - - -void APIENTRY -glutPostWindowRedisplay (int win) -{ - GLUTwindow *w = _glut_window(win); - if (w != NULL) { - w->redisplay = GL_TRUE; - } -} - - -void * APIENTRY -glutGetWindowData (void) -{ - return _glut_current->data; -} - - -void APIENTRY -glutSetWindowData (void *data) -{ - _glut_current->data = data; -} diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile deleted file mode 100644 index c150ea88dc..0000000000 --- a/src/glut/fbdev/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# subset glut - -TOP = ../../.. -include $(TOP)/configs/current - -GLX_SHARED = $(TOP)/src/glut/glx -MINI_SHARED = $(TOP)/src/glut/mini - -GLUT_MAJOR = 3 -GLUT_MINOR = 7 -GLUT_TINY = 1 - -INCLUDES = -I$(TOP)/include -I$(GLX_SHARED) - -CORE_SOURCES = \ - fbdev.c \ - colormap.c \ - cursor.c \ - menu.c \ - overlay.c \ - ext.c \ - state.c \ - input.c \ - callback.c \ - gamemode.c \ - vidresize.c \ - bitmap.c \ - stroke.c - -GLX_SHARED_SOURCES = \ - $(GLX_SHARED)/glut_8x13.c \ - $(GLX_SHARED)/glut_9x15.c \ - $(GLX_SHARED)/glut_hel10.c \ - $(GLX_SHARED)/glut_hel12.c \ - $(GLX_SHARED)/glut_hel18.c \ - $(GLX_SHARED)/glut_tr10.c \ - $(GLX_SHARED)/glut_tr24.c \ - $(GLX_SHARED)/glut_mroman.c \ - $(GLX_SHARED)/glut_roman.c \ - -MINI_SHARED_SOURCES = \ - $(MINI_SHARED)/models.c \ - $(MINI_SHARED)/teapot.c - -SOURCES = $(CORE_SOURCES) $(GLX_SHARED_SOURCES) $(MINI_SHARED_SOURCES) - -OBJECTS = $(SOURCES:.c=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) - - -# Make the library -$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(MKLIB) -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ - $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ - $(MKLIB_OPTIONS) $(OBJECTS) - -install: - $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL - $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR) - $(INSTALL) -m 644 $(TOP)/include/GL/glut.h $(DESTDIR)$(INSTALL_INC_DIR)/GL - $(MINSTALL) $(TOP)/$(LIB_DIR)/libglut* $(DESTDIR)$(INSTALL_LIB_DIR) - -# Run 'make -f Makefile.solo dep' to update the dependencies if you change -# what's included by any source file. -depend: $(SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -# Remove .o and backup files -clean: depend - -rm -f depend depend.bak - -rm -f *.o *~ *.o *~ *.so libglut.so.3.7 - -include depend diff --git a/src/glut/fbdev/bitmap.c b/src/glut/fbdev/bitmap.c deleted file mode 100644 index 5dbb330cc2..0000000000 --- a/src/glut/fbdev/bitmap.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - * - * To improve on this library, maybe support subwindows or overlays, - * I (sean at depagnier dot com) will do my best to help. - */ - - -#include "glutbitmap.h" - -void glutBitmapCharacter(GLUTbitmapFont font, int c) -{ - const BitmapCharRec *ch; - BitmapFontPtr fi = (BitmapFontPtr) font; - - if (c < fi->first || - c >= fi->first + fi->num_chars) - return; - ch = fi->ch[c - fi->first]; - if (!ch) - return; - - glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); - - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, - ch->advance, 0, ch->bitmap); - glPopClientAttrib(); -} - -int glutBitmapWidth (GLUTbitmapFont font, int c) -{ - const BitmapCharRec *ch; - BitmapFontPtr fi = (BitmapFontPtr) font; - - if (c < fi->first || c >= fi->first + fi->num_chars) - return 0; - ch = fi->ch[c - fi->first]; - if (ch) - return ch->advance; - return 0; -} - -int glutBitmapLength(GLUTbitmapFont font, const unsigned char *string) -{ - int length = 0; - - for (; *string; string++) - length += glutBitmapWidth(font, *string); - return length; -} diff --git a/src/glut/fbdev/callback.c b/src/glut/fbdev/callback.c deleted file mode 100644 index 8c039f530b..0000000000 --- a/src/glut/fbdev/callback.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include - -#include - -#include "internal.h" - -void (*DisplayFunc)(void) = NULL; -void (*ReshapeFunc)(int width, int height) = NULL; -void (*KeyboardFunc)(unsigned char key, int x, int y) = NULL; -void (*KeyboardUpFunc)(unsigned char key, int x, int y) = NULL; -void (*MouseFunc)(int key, int state, int x, int y) = NULL; -void (*MotionFunc)(int x, int y) = NULL; -void (*PassiveMotionFunc)(int x, int y) = NULL; -void (*VisibilityFunc)(int state) = NULL; -void (*SpecialFunc)(int key, int x, int y) = NULL; -void (*SpecialUpFunc)(int key, int x, int y) = NULL; -void (*IdleFunc)(void) = NULL; -void (*MenuStatusFunc)(int state, int x, int y) = NULL; -void (*MenuStateFunc)(int state) = NULL; - -void glutDisplayFunc(void (*func)(void)) -{ - DisplayFunc = func; -} - -void glutOverlayDisplayFunc(void (*func)(void)) -{ -} - -void glutWindowStatusFunc(void (*func)(int state)) -{ -} - -void glutReshapeFunc(void (*func)(int width, int height)) -{ - ReshapeFunc = func; -} - -void glutKeyboardFunc(void (*func)(unsigned char key, int x, int y)) -{ - KeyboardFunc = func; -} - -void glutKeyboardUpFunc(void (*func)(unsigned char key, int x, int y)) -{ - KeyboardUpFunc = func; -} - -void glutMouseFunc(void (*func)(int button, int state, int x, int y)) -{ - MouseFunc = func; -} - -void glutMotionFunc(void (*func)(int x, int y)) -{ - MotionFunc = func; -} - -void glutPassiveMotionFunc(void (*func)(int x, int y)) -{ - PassiveMotionFunc = func; -} - -void glutJoystickFunc(void (*func)(unsigned int buttonMask, - int x, int y, int z), int pollInterval) -{ -} - -void glutVisibilityFunc(void (*func)(int state)) -{ - VisibilityFunc = func; -} - -void glutEntryFunc(void (*func)(int state)) -{ -} - -void glutSpecialFunc(void (*func)(int key, int x, int y)) -{ - SpecialFunc = func; -} - -void glutSpecialUpFunc(void (*func)(int key, int x, int y)) -{ - SpecialUpFunc = func; -} - -void glutSpaceballMotionFunc(void (*func)(int x, int y, int z)) -{ -} - -void glutSpaceballRotateFunc(void (*func)(int x, int y, int z)) -{ -} - -void glutSpaceballButtonFunc(void (*func)(int button, int state)) -{ -} - -void glutButtonBoxFunc(void (*func)(int button, int state)) -{ -} - -void glutDialsFunc(void (*func)(int dial, int value)) -{ -} - -void glutTabletMotionFunc(void (*func)(int x, int y)) -{ -} - -void glutTabletButtonFunc(void (*func)(int button, int state, - int x, int y)) -{ -} - -void glutMenuStatusFunc(void (*func)(int status, int x, int y)) -{ - MenuStatusFunc = func; -} - -void glutMenuStateFunc(void (*func)(int status)) -{ - MenuStateFunc = func; -} - -void glutIdleFunc(void (*func)(void)) -{ - IdleFunc = func; -} - -void glutTimerFunc(unsigned int msecs, - void (*func)(int value), int value) -{ - struct GlutTimer **head = &GlutTimers, *timer = malloc(sizeof *timer); - timer->time = glutGet(GLUT_ELAPSED_TIME) + msecs; - timer->func = func; - timer->value = value; - - while(*head && (*head)->time < timer->time) - head = &(*head)->next; - - timer->next = *head; - *head = timer; -} diff --git a/src/glut/fbdev/colormap.c b/src/glut/fbdev/colormap.c deleted file mode 100644 index 3e72a7b051..0000000000 --- a/src/glut/fbdev/colormap.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include -#include - -#include - -#include -#include - -#include "internal.h" - -#define TOCMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat) ((1<<16) - 1)) -#define TORMAP(x)(unsigned short)((x<0?0:x>1?1:x)*(GLfloat)(REVERSECMAPSIZE-1)) -#define FROMCMAP(x) (GLfloat)x / (GLfloat)((1<<16) - 1) - -static struct fb_cmap ColorMap, OriginalColorMap; - -unsigned short RedColorMap[256], GreenColorMap[256], BlueColorMap[256]; - -unsigned char ReverseColorMap[REVERSECMAPSIZE] - [REVERSECMAPSIZE] - [REVERSECMAPSIZE]; - -static void FindReverseMap(int r, int g, int b) -{ - static int count; - int i, shift = 16 - REVERSECMAPSIZELOG; - unsigned int minv = -1, mini = 0; - for(i=0; i<256; i++) { - int val = 0; - val += abs(r-(RedColorMap[i]>>shift)); - val += abs(g-(GreenColorMap[i]>>shift)); - val += abs(b-(BlueColorMap[i]>>shift)); - if(val < minv) { - minv = val; - mini = i; - } - } - ReverseColorMap[r][g][b] = mini; -} - -static void FillItemReverseColorMap(int r, int g, int b) -{ - FindReverseMap(r, g, b); - if(r > 0) - FindReverseMap(r-1, g, b); - if(r < REVERSECMAPSIZE - 1) - FindReverseMap(r+1, g, b); - if(g > 0) - FindReverseMap(r, g-1, b); - if(g < REVERSECMAPSIZE - 1) - FindReverseMap(r, g+1, b); - if(b > 0) - FindReverseMap(r, g, b-1); - if(b < REVERSECMAPSIZE - 1) - FindReverseMap(r, g, b+1); -} - -static void FillReverseColorMap(void) -{ - int r, g, b; - for(r = 0; r < REVERSECMAPSIZE; r++) - for(g = 0; g < REVERSECMAPSIZE; g++) - for(b = 0; b < REVERSECMAPSIZE; b++) - FindReverseMap(r, g, b); -} - -void RestoreColorMap(void) -{ - if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) - return; - - if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &ColorMap) < 0) - sprintf(exiterror, "ioctl(FBIOPUTCMAP) failed!\n"); -} - -void LoadColorMap(void) -{ - if(FixedInfo.visual == FB_VISUAL_TRUECOLOR) - return; - - ColorMap.start = 0; - ColorMap.red = RedColorMap; - ColorMap.green = GreenColorMap; - ColorMap.blue = BlueColorMap; - ColorMap.transp = NULL; - - if(DisplayMode & GLUT_INDEX) { - ColorMap.len = 256; - - if (ioctl(FrameBufferFD, FBIOGETCMAP, (void *) &ColorMap) < 0) - sprintf(exiterror, "ioctl(FBIOGETCMAP) failed!\n"); - - FillReverseColorMap(); - } else { - int rcols = 1 << VarInfo.red.length; - int gcols = 1 << VarInfo.green.length; - int bcols = 1 << VarInfo.blue.length; - - int i; - - ColorMap.len = gcols; - - for (i = 0; i < rcols ; i++) - RedColorMap[i] = (65536/(rcols-1)) * i; - - for (i = 0; i < gcols ; i++) - GreenColorMap[i] = (65536/(gcols-1)) * i; - - for (i = 0; i < bcols ; i++) - BlueColorMap[i] = (65536/(bcols-1)) * i; - - RestoreColorMap(); - } -} - -void glutSetColor(int cell, GLfloat red, GLfloat green, GLfloat blue) -{ - if(cell < 0 || cell >= 256) - return; - - RedColorMap[cell] = TOCMAP(red); - GreenColorMap[cell] = TOCMAP(green); - BlueColorMap[cell] = TOCMAP(blue); - - RestoreColorMap(); - - FillItemReverseColorMap(TORMAP(red), TORMAP(green), TORMAP(blue)); -} - -GLfloat glutGetColor(int cell, int component) -{ - if(!(DisplayMode & GLUT_INDEX)) - return -1.0; - - if(cell < 0 || cell > 256) - return -1.0; - - switch(component) { - case GLUT_RED: - return FROMCMAP(RedColorMap[cell]); - case GLUT_GREEN: - return FROMCMAP(GreenColorMap[cell]); - case GLUT_BLUE: - return FROMCMAP(BlueColorMap[cell]); - } - return -1.0; -} - -void glutCopyColormap(int win) -{ -} diff --git a/src/glut/fbdev/cursor.c b/src/glut/fbdev/cursor.c deleted file mode 100644 index 4bb2b7fba0..0000000000 --- a/src/glut/fbdev/cursor.c +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -/* these routines are written to access graphics memory directly, not using mesa - to render the cursor, this is faster, it would be good to use a hardware - cursor if it exists instead */ - -#include -#include -#include -#include - -#include - -#include - -#include "internal.h" -#include "cursors.h" - -int CurrentCursor = GLUT_CURSOR_LEFT_ARROW; - -static int LastMouseX, LastMouseY; -static unsigned char *MouseBuffer; - -void InitializeCursor(void) -{ - if(!MouseBuffer && (MouseBuffer = malloc(CURSOR_WIDTH * CURSOR_HEIGHT - * VarInfo.bits_per_pixel / 8)) == NULL) { - sprintf(exiterror, "malloc failure\n"); - exit(0); - } - - MouseX = VarInfo.xres / 2; - MouseY = VarInfo.yres / 2; -} - -void EraseCursor(void) -{ - int off = LastMouseY * FixedInfo.line_length - + LastMouseX * VarInfo.bits_per_pixel / 8; - int stride = CURSOR_WIDTH * VarInfo.bits_per_pixel / 8; - int i; - - unsigned char *src = MouseBuffer; - - if(!MouseVisible || CurrentCursor < 0 || CurrentCursor >= NUM_CURSORS) - return; - - for(i = 0; i (int)VarInfo.xres - CURSOR_WIDTH) - LastMouseX = VarInfo.xres - CURSOR_WIDTH; - else - LastMouseX = x; - - if(y < 0) - LastMouseY = 0; - else - if(y > (int)VarInfo.yres - CURSOR_HEIGHT) - LastMouseY = VarInfo.yres - CURSOR_HEIGHT; - else - LastMouseY = y; - - bypp = VarInfo.bits_per_pixel / 8; - off = LastMouseY * FixedInfo.line_length + LastMouseX * bypp; - stride = CURSOR_WIDTH * bypp; - for(i = 0; i= NUM_CURSORS) - return; - - px = MouseX - CursorsXOffset[CurrentCursor]; - py = MouseY - CursorsYOffset[CurrentCursor]; - - SaveCursor(px, py); - - xoff = 0; - if(px < 0) - xoff = -px; - - xlen = CURSOR_WIDTH; - if(px + CURSOR_WIDTH > VarInfo.xres) - xlen = VarInfo.xres - px; - - yoff = 0; - if(py < 0) - yoff = -py; - - ylen = CURSOR_HEIGHT; - if(py + CURSOR_HEIGHT > VarInfo.yres) - ylen = VarInfo.yres - py; - - bypp = VarInfo.bits_per_pixel / 8; - - c = BackBuffer + FixedInfo.line_length * (py + yoff) + (px + xoff) * bypp; - cstride = FixedInfo.line_length - bypp * (xlen - xoff); - - d = Cursors[CurrentCursor] + (CURSOR_WIDTH * yoff + xoff)*4; - dstride = (CURSOR_WIDTH - xlen + xoff) * 4; - - switch(bypp) { - case 1: - { - const int shift = 8 - REVERSECMAPSIZELOG; - for(i = yoff; i < ylen; i++) { - for(j = xoff; j < xlen; j++) { - if(d[3] < 220) - *c = ReverseColorMap - [(d[0]+(((int)(RedColorMap[c[0]]>>8)*d[3])>>8))>>shift] - [(d[1]+(((int)(GreenColorMap[c[0]]>>8)*d[3])>>8))>>shift] - [(d[2]+(((int)(BlueColorMap[c[0]]>>8)*d[3])>>8))>>shift]; - c++; - d+=4; - } - d += dstride; - c += cstride; - } - } break; - case 2: - { - uint16_t *e = (void*)c; - cstride /= 2; - for(i = yoff; i < ylen; i++) { - for(j = xoff; j < xlen; j++) { - if(d[3] < 220) - e[0] = ((((d[0] + (((int)(((e[0] >> 8) & 0xf8) - | ((c[0] >> 11) & 0x7)) * d[3]) >> 8)) & 0xf8) << 8) - | (((d[1] + (((int)(((e[0] >> 3) & 0xfc) - | ((e[0] >> 5) & 0x3)) * d[3]) >> 8)) & 0xfc) << 3) - | ((d[2] + (((int)(((e[0] << 3) & 0xf8) - | (e[0] & 0x7)) * d[3]) >> 8)) >> 3)); - - e++; - d+=4; - } - d += dstride; - e += cstride; - } - } break; - case 3: - case 4: - for(i = yoff; i < ylen; i++) { - for(j = xoff; j < xlen; j++) { - if(d[3] < 220) { - c[0] = d[0] + (((int)c[0] * d[3]) >> 8); - c[1] = d[1] + (((int)c[1] * d[3]) >> 8); - c[2] = d[2] + (((int)c[2] * d[3]) >> 8); - } - - c+=bypp; - d+=4; - } - d += dstride; - c += cstride; - } break; - } -} - -#define MIN(x, y) x < y ? x : y -void SwapCursor(void) -{ - int px = MouseX - CursorsXOffset[CurrentCursor]; - int py = MouseY - CursorsYOffset[CurrentCursor]; - - int minx = MIN(px, LastMouseX); - int sizex = abs(px - LastMouseX); - - int miny = MIN(py, LastMouseY); - int sizey = abs(py - LastMouseY); - - if(MouseVisible) - DrawCursor(); - - /* now update the portion of the screen that has changed, this is also - used to hide the mouse if MouseVisible is 0 */ - if(DisplayMode & GLUT_DOUBLE && ((sizex || sizey) || !MouseVisible)) { - int off, stride, i; - if(minx < 0) - minx = 0; - if(miny < 0) - miny = 0; - - if(minx + sizex > VarInfo.xres - CURSOR_WIDTH) - sizex = VarInfo.xres - CURSOR_WIDTH - minx; - if(miny + sizey > VarInfo.yres - CURSOR_HEIGHT) - sizey = VarInfo.yres - CURSOR_HEIGHT - miny; - off = FixedInfo.line_length * miny - + minx * VarInfo.bits_per_pixel / 8; - stride = (sizex + CURSOR_WIDTH) * VarInfo.bits_per_pixel / 8; - - for(i = 0; i < sizey + CURSOR_HEIGHT; i++) { - memcpy(FrameBuffer+off, BackBuffer+off, stride); - off += FixedInfo.line_length; - } - } -} - -void glutWarpPointer(int x, int y) -{ - if(x < 0) - x = 0; - if(x >= VarInfo.xres) - x = VarInfo.xres - 1; - MouseX = x; - - if(y < 0) - y = 0; - if(y >= VarInfo.yres) - y = VarInfo.yres - 1; - MouseY = y; - - EraseCursor(); - SwapCursor(); -} - -void glutSetCursor(int cursor) -{ - if(cursor == GLUT_CURSOR_FULL_CROSSHAIR) - cursor = GLUT_CURSOR_CROSSHAIR; - - EraseCursor(); - MouseVisible = 1; - CurrentCursor = cursor; - SwapCursor(); -} diff --git a/src/glut/fbdev/cursors.h b/src/glut/fbdev/cursors.h deleted file mode 100644 index b1f8c3cde4..0000000000 --- a/src/glut/fbdev/cursors.h +++ /dev/null @@ -1,7099 +0,0 @@ -/* These cursor images were generated from png files - included in xorg. - - They are in the format RGBA and are each 32x32 - the RGB components have already been multiplied - by the alpha, and the alpha is already inverted */ - -#define CURSOR_WIDTH 32 -#define CURSOR_HEIGHT 32 - -int CursorsXOffset[20]={16, 4, 9, 16, 7, 16, 10, 8, 8, 11, - 16, 13, 12, 20, 3, 28, 3, 28, 28, 3}; -int CursorsYOffset[20]={4, 4, 2, 20, 28, 14, 0, 8, 14, 11, - 14, 12, 3, 28, 18, 12, 3, 3, 26, 26}; - -const unsigned char Cursors[][CURSOR_WIDTH * CURSOR_HEIGHT * 4] = { - { - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, - 0, 0, 0, 76, 0, 0, 0, 100, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, - 127, 127, 127, 64, 0, 0, 0, 64, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 210, 2, 2, 2, 73, 127, 127, 127, 64, - 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 251, - 0, 0, 0, 247, 0, 0, 0, 248, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, - 2, 2, 2, 73, 127, 127, 127, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 248, 0, 0, 0, 236, - 0, 0, 0, 227, 0, 0, 0, 229, 0, 0, 0, 240, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, - 127, 127, 127, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 254, - 0, 0, 0, 248, 0, 0, 0, 234, 0, 0, 0, 221, - 0, 0, 0, 217, 0, 0, 0, 218, 0, 0, 0, 228, - 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 210, 2, 2, 2, 73, 127, 127, 127, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 64, 0, 0, 0, 248, - 0, 0, 0, 234, 0, 0, 0, 221, 0, 0, 0, 216, - 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, - 2, 2, 2, 73, 127, 127, 127, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 62, 0, 0, 0, 234, - 0, 0, 0, 221, 0, 0, 0, 216, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, - 127, 127, 127, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 189, 189, 189, 62, 0, 0, 0, 59, 0, 0, 0, 221, - 0, 0, 0, 216, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 210, 2, 2, 2, 73, 127, 127, 127, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 62, - 189, 189, 189, 59, 0, 0, 0, 55, 0, 0, 0, 216, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, - 2, 2, 2, 73, 127, 127, 127, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 59, - 189, 189, 189, 55, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 210, 2, 2, 2, 73, - 127, 127, 127, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 189, 189, 189, 62, 189, 189, 189, 59, 189, 189, 189, 55, - 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 222, 2, 2, 2, 73, 127, 127, 127, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 62, - 189, 189, 189, 59, 189, 189, 189, 55, 190, 190, 190, 54, - 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 189, 26, 26, 26, 64, 130, 130, 130, 64, - 187, 187, 187, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 59, - 189, 189, 189, 55, 190, 190, 190, 54, 190, 190, 190, 54, - 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 174, 0, 0, 0, 94, - 23, 23, 23, 64, 104, 104, 104, 64, 178, 178, 178, 64, - 189, 189, 189, 62, 189, 189, 189, 59, 189, 189, 189, 55, - 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 201, 0, 0, 0, 97, 56, 56, 56, 62, - 189, 189, 189, 59, 189, 189, 189, 55, 190, 190, 190, 54, - 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 91, 133, 133, 133, 61, - 189, 189, 189, 56, 190, 190, 190, 54, 148, 148, 148, 54, - 127, 127, 127, 54, 186, 186, 186, 54, 190, 190, 190, 54, - 190, 190, 190, 54, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 198, 26, 26, 26, 63, 189, 189, 189, 60, - 189, 189, 189, 55, 190, 190, 190, 54, 56, 56, 56, 54, - 0, 0, 0, 67, 20, 20, 20, 54, 101, 101, 101, 54, - 175, 175, 175, 54, 0, 0, 0, 54, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 118, 107, 107, 107, 64, 189, 189, 189, 62, - 189, 189, 189, 57, 165, 165, 165, 55, 2, 2, 2, 59, - 0, 0, 0, 203, 0, 0, 0, 172, 0, 0, 0, 105, - 5, 5, 5, 56, 0, 0, 0, 72, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 225, - 8, 8, 8, 64, 178, 178, 178, 64, 189, 189, 189, 63, - 190, 190, 190, 61, 88, 88, 88, 59, 0, 0, 0, 119, - 0, 0, 0, 218, 0, 0, 0, 216, 0, 0, 0, 215, - 0, 0, 0, 202, 0, 0, 0, 207, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 144, - 80, 80, 80, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 184, 184, 184, 64, 14, 14, 14, 63, 0, 0, 0, 202, - 0, 0, 0, 222, 0, 0, 0, 216, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 243, 0, 0, 0, 73, - 160, 160, 160, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 122, 122, 122, 64, 0, 0, 0, 102, 0, 0, 0, 237, - 0, 0, 0, 220, 0, 0, 0, 216, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 216, - 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 225, - 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 207, 23, 23, 23, 64, - 169, 169, 169, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 41, 41, 41, 64, 0, 0, 0, 178, 0, 0, 0, 229, - 0, 0, 0, 217, 0, 0, 0, 216, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 216, - 0, 0, 0, 218, 0, 0, 0, 219, 0, 0, 0, 217, - 0, 0, 0, 216, 0, 0, 0, 217, 0, 0, 0, 228, - 0, 0, 0, 247, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 249, 0, 0, 0, 135, - 2, 2, 2, 70, 62, 62, 62, 64, 110, 110, 110, 64, - 0, 0, 0, 78, 0, 0, 0, 234, 0, 0, 0, 222, - 0, 0, 0, 216, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 217, - 0, 0, 0, 227, 0, 0, 0, 235, 0, 0, 0, 230, - 0, 0, 0, 225, 0, 0, 0, 226, 0, 0, 0, 239, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 237, 0, 0, 0, 165, 0, 0, 0, 111, - 0, 0, 0, 179, 0, 0, 0, 232, 0, 0, 0, 218, - 0, 0, 0, 216, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 215, 0, 0, 0, 216, 0, 0, 0, 221, - 0, 0, 0, 239, 0, 0, 0, 250, 0, 0, 0, 249, - 0, 0, 0, 245, 0, 0, 0, 246, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 245, 0, 0, 0, 224, 0, 0, 0, 216, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 216, 0, 0, 0, 217, 0, 0, 0, 228, - 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 242, 0, 0, 0, 222, 0, 0, 0, 216, - 0, 0, 0, 215, 0, 0, 0, 215, 0, 0, 0, 215, - 0, 0, 0, 216, 0, 0, 0, 219, 0, 0, 0, 236, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 246, 0, 0, 0, 228, 0, 0, 0, 218, - 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 216, - 0, 0, 0, 216, 0, 0, 0, 225, 0, 0, 0, 244, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 243, 0, 0, 0, 231, - 0, 0, 0, 223, 0, 0, 0, 219, 0, 0, 0, 217, - 0, 0, 0, 220, 0, 0, 0, 234, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 249, - 0, 0, 0, 242, 0, 0, 0, 235, 0, 0, 0, 231, - 0, 0, 0, 235, 0, 0, 0, 247, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 100, - 0, 0, 0, 76, 0, 0, 0, 210, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 127, 127, 127, 64, 2, 2, 2, 73, 0, 0, 0, 210, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 127, 127, 127, 64, 2, 2, 2, 73, - 0, 0, 0, 210, 0, 0, 0, 255, 0, 0, 0, 252, - 0, 0, 0, 248, 0, 0, 0, 248, 0, 0, 0, 251, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 127, 127, 127, 64, - 2, 2, 2, 73, 0, 0, 0, 208, 0, 0, 0, 241, - 0, 0, 0, 230, 0, 0, 0, 228, 0, 0, 0, 237, - 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 127, 127, 127, 64, 2, 2, 2, 71, 0, 0, 0, 189, - 0, 0, 0, 219, 0, 0, 0, 218, 0, 0, 0, 222, - 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 127, 127, 127, 62, 2, 2, 2, 64, - 0, 0, 0, 179, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 249, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 127, 127, 127, 57, - 3, 3, 3, 62, 0, 0, 0, 179, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 235, - 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 127, 127, 127, 54, 3, 3, 3, 62, 0, 0, 0, 179, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 222, - 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 127, 127, 127, 54, 3, 3, 3, 62, - 0, 0, 0, 179, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 249, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 190, 190, 190, 54, 127, 127, 127, 54, - 3, 3, 3, 62, 0, 0, 0, 179, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 235, - 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 127, 127, 127, 54, 3, 3, 3, 62, 0, 0, 0, 179, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 222, - 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 190, 190, 190, 54, 127, 127, 127, 54, 3, 3, 3, 62, - 0, 0, 0, 189, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 249, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 186, 186, 186, 54, 130, 130, 130, 54, 26, 26, 26, 54, - 0, 0, 0, 161, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 235, - 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 178, 178, 178, 54, 103, 103, 103, 54, - 23, 23, 23, 54, 0, 0, 0, 79, 0, 0, 0, 148, - 0, 0, 0, 214, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 222, - 0, 0, 0, 235, 0, 0, 0, 249, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 56, 56, 56, 54, 0, 0, 0, 82, - 0, 0, 0, 171, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 222, 0, 0, 0, 235, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 187, 187, 187, 64, - 127, 127, 127, 64, 147, 147, 147, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 133, 133, 133, 54, 0, 0, 0, 77, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 218, 0, 0, 0, 224, 0, 0, 0, 243, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 64, - 175, 175, 175, 64, 100, 100, 100, 64, 20, 20, 20, 64, - 0, 0, 0, 79, 56, 56, 56, 62, 189, 189, 189, 57, - 190, 190, 190, 54, 190, 190, 190, 54, 26, 26, 26, 54, - 0, 0, 0, 169, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 222, 0, 0, 0, 241, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 85, - 5, 5, 5, 67, 0, 0, 0, 124, 0, 0, 0, 204, - 0, 0, 0, 240, 2, 2, 2, 68, 165, 165, 165, 57, - 190, 190, 190, 54, 190, 190, 190, 54, 106, 106, 106, 54, - 0, 0, 0, 100, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 218, - 0, 0, 0, 221, 0, 0, 0, 230, 0, 0, 0, 246, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 246, - 0, 0, 0, 240, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 132, 88, 88, 88, 57, - 190, 190, 190, 54, 190, 190, 190, 54, 178, 178, 178, 54, - 8, 8, 8, 54, 0, 0, 0, 192, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 219, 0, 0, 0, 227, - 0, 0, 0, 236, 0, 0, 0, 245, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 209, 14, 14, 14, 57, - 184, 184, 184, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 80, 80, 80, 54, 0, 0, 0, 123, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 223, 0, 0, 0, 239, - 0, 0, 0, 251, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 246, 0, 0, 0, 92, - 121, 121, 121, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 160, 160, 160, 54, 0, 0, 0, 62, 0, 0, 0, 207, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 221, 0, 0, 0, 238, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 248, 0, 0, 0, 166, - 41, 41, 41, 55, 190, 190, 190, 54, 189, 189, 189, 55, - 169, 169, 169, 55, 23, 23, 23, 55, 0, 0, 0, 176, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 218, 0, 0, 0, 230, - 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 234, - 0, 0, 0, 71, 109, 109, 109, 57, 62, 62, 62, 58, - 2, 2, 2, 65, 0, 0, 0, 122, 0, 0, 0, 214, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 223, - 0, 0, 0, 241, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 178, 0, 0, 0, 109, 0, 0, 0, 163, - 0, 0, 0, 233, 0, 0, 0, 240, 0, 0, 0, 222, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 219, - 0, 0, 0, 233, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 247, 0, 0, 0, 229, - 0, 0, 0, 218, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 226, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 237, - 0, 0, 0, 221, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, - 0, 0, 0, 226, 0, 0, 0, 218, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 219, - 0, 0, 0, 229, 0, 0, 0, 246, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 235, 0, 0, 0, 222, 0, 0, 0, 219, - 0, 0, 0, 220, 0, 0, 0, 224, 0, 0, 0, 232, - 0, 0, 0, 243, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 247, 0, 0, 0, 236, 0, 0, 0, 232, - 0, 0, 0, 236, 0, 0, 0, 243, 0, 0, 0, 249, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 13, 14, 20, 170, 45, 49, 63, 26, - 50, 52, 63, 26, 63, 67, 78, 80, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 17, 18, 21, 197, 36, 36, 41, 108, 53, 53, 63, 0, - 58, 57, 69, 0, 76, 81, 96, 28, 62, 65, 76, 129, - 16, 17, 19, 233, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 4, 4, 17, 55, 94, 94, 99, 0, 210, 213, 218, 0, - 206, 209, 214, 0, 117, 118, 124, 0, 23, 24, 36, 0, - 31, 33, 38, 210, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 13, 12, 22, 55, 100, 100, 103, 0, 202, 204, 208, 0, - 193, 195, 200, 0, 122, 123, 128, 0, 29, 30, 39, 0, - 29, 32, 36, 210, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 14, 14, 25, 55, 101, 101, 104, 0, 201, 203, 208, 0, - 193, 195, 200, 0, 121, 121, 127, 0, 32, 32, 43, 0, - 28, 31, 37, 210, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 17, 16, 27, 55, 101, 101, 104, 0, 200, 203, 207, 0, - 193, 196, 201, 0, 119, 120, 125, 0, 33, 33, 44, 0, - 26, 29, 36, 187, 0, 0, 0, 189, 0, 0, 0, 189, - 0, 0, 0, 203, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 17, 16, 27, 55, 101, 101, 104, 0, 199, 201, 206, 0, - 194, 196, 200, 0, 118, 119, 124, 0, 36, 36, 46, 0, - 24, 27, 34, 173, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 187, 0, 0, 0, 220, 0, 0, 0, 248, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 18, 17, 28, 55, 102, 103, 106, 0, 202, 205, 210, 0, - 198, 200, 205, 0, 117, 118, 123, 0, 40, 40, 51, 0, - 7, 7, 9, 169, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 240, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 20, 19, 29, 55, 104, 104, 107, 0, 204, 206, 212, 0, - 201, 203, 208, 0, 117, 117, 123, 0, 34, 35, 47, 0, - 13, 15, 19, 160, 12, 13, 17, 164, 13, 14, 17, 164, - 13, 14, 17, 164, 14, 15, 18, 164, 12, 13, 15, 224, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 2, 2, 6, 197, 22, 22, 30, 20, 33, 33, 39, 20, - 19, 20, 25, 163, 0, 0, 0, 255, 0, 0, 0, 255, - 23, 22, 33, 55, 103, 103, 106, 0, 205, 207, 212, 0, - 202, 204, 210, 0, 114, 114, 121, 0, 27, 27, 36, 0, - 41, 45, 56, 0, 43, 46, 58, 0, 38, 41, 54, 0, - 52, 54, 65, 0, 49, 51, 64, 0, 51, 54, 66, 45, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 9, 9, 9, 28, 79, 80, 85, 0, 82, 82, 89, 0, - 52, 54, 63, 77, 25, 28, 34, 151, 0, 0, 0, 255, - 23, 22, 33, 55, 103, 103, 106, 0, 207, 209, 213, 0, - 205, 207, 212, 0, 112, 113, 119, 0, 33, 32, 42, 0, - 72, 73, 78, 0, 36, 36, 47, 0, 30, 30, 41, 0, - 74, 75, 81, 0, 45, 44, 52, 0, 39, 40, 50, 22, - 41, 42, 49, 126, 25, 26, 30, 211, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 26, 26, 26, 25, 211, 213, 218, 0, 214, 217, 221, 0, - 67, 67, 77, 0, 21, 20, 26, 50, 5, 5, 7, 246, - 25, 24, 32, 50, 103, 103, 106, 0, 209, 211, 215, 0, - 208, 210, 214, 0, 111, 112, 118, 0, 60, 60, 70, 0, - 209, 210, 214, 0, 98, 99, 106, 0, 77, 76, 83, 0, - 204, 206, 210, 0, 67, 68, 74, 0, 34, 34, 44, 0, - 2, 2, 20, 0, 58, 61, 70, 143, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 2, 2, 2, 104, 73, 74, 78, 0, 216, 218, 222, 0, - 191, 193, 199, 0, 149, 150, 156, 3, 23, 23, 36, 11, - 33, 32, 40, 0, 97, 97, 101, 0, 209, 211, 216, 0, - 208, 210, 214, 0, 113, 113, 119, 0, 57, 56, 65, 0, - 204, 205, 209, 0, 99, 99, 105, 0, 78, 77, 84, 0, - 198, 200, 205, 0, 70, 69, 77, 0, 87, 86, 93, 0, - 167, 168, 173, 0, 73, 74, 83, 2, 45, 47, 54, 101, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 2, 218, 27, 27, 31, 61, 130, 131, 135, 0, - 197, 198, 203, 0, 183, 184, 190, 0, 90, 90, 100, 0, - 38, 37, 47, 0, 103, 103, 108, 0, 210, 212, 216, 0, - 210, 212, 217, 0, 159, 160, 164, 0, 108, 109, 114, 0, - 209, 211, 215, 0, 148, 149, 153, 0, 122, 122, 127, 0, - 202, 204, 209, 0, 78, 78, 87, 0, 112, 112, 118, 0, - 201, 203, 208, 0, 68, 67, 74, 0, 39, 40, 46, 89, - 0, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 2, 2, 3, 198, 17, 16, 26, 0, - 163, 165, 169, 0, 203, 205, 209, 0, 222, 224, 228, 0, - 62, 61, 70, 0, 107, 107, 114, 0, 209, 211, 216, 0, - 225, 227, 231, 0, 213, 215, 220, 0, 209, 212, 216, 0, - 214, 216, 220, 0, 212, 214, 218, 0, 205, 208, 213, 0, - 210, 212, 217, 0, 66, 67, 74, 0, 107, 108, 113, 0, - 202, 204, 208, 0, 68, 68, 75, 0, 38, 38, 46, 63, - 0, 0, 0, 178, 0, 0, 0, 190, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 3, 3, 4, 209, 21, 20, 31, 0, - 170, 172, 176, 0, 209, 211, 216, 0, 210, 212, 216, 0, - 55, 54, 63, 0, 107, 108, 114, 0, 209, 212, 216, 0, - 230, 232, 236, 0, 239, 242, 245, 0, 236, 238, 242, 0, - 234, 237, 241, 0, 229, 232, 237, 0, 219, 221, 227, 0, - 209, 211, 216, 0, 194, 197, 202, 0, 204, 206, 211, 0, - 205, 207, 211, 0, 67, 67, 74, 0, 36, 38, 45, 63, - 0, 0, 0, 178, 0, 0, 0, 184, 0, 0, 0, 219, - 0, 0, 0, 242, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 3, 3, 3, 226, 5, 5, 14, 93, - 110, 111, 119, 22, 177, 179, 183, 0, 215, 217, 221, 0, - 111, 111, 120, 0, 155, 156, 162, 0, 213, 215, 220, 0, - 228, 231, 234, 0, 233, 236, 240, 0, 232, 235, 240, 0, - 229, 231, 236, 0, 225, 227, 231, 0, 217, 220, 225, 0, - 211, 213, 218, 0, 203, 205, 211, 0, 201, 203, 208, 0, - 214, 216, 221, 0, 66, 66, 72, 0, 36, 38, 45, 63, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 221, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 10, 9, 20, 65, 87, 87, 93, 0, 229, 231, 234, 0, - 210, 212, 216, 0, 205, 207, 212, 0, 213, 215, 221, 0, - 221, 224, 229, 0, 226, 229, 234, 0, 226, 229, 234, 0, - 221, 223, 228, 0, 216, 219, 224, 0, 213, 215, 221, 0, - 209, 211, 216, 0, 203, 206, 212, 0, 201, 203, 208, 0, - 214, 217, 221, 0, 63, 62, 68, 0, 36, 37, 44, 63, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 179, 0, 0, 0, 209, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 247, 14, 14, 17, 170, 36, 37, 48, 0, - 204, 206, 209, 0, 212, 214, 220, 0, 212, 214, 219, 0, - 215, 218, 224, 0, 219, 222, 227, 0, 218, 221, 227, 0, - 215, 217, 223, 0, 211, 213, 219, 0, 209, 211, 217, 0, - 206, 208, 215, 0, 206, 209, 215, 0, 212, 214, 219, 0, - 217, 219, 224, 0, 53, 52, 59, 0, 34, 36, 44, 63, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 205, 28, 27, 35, 0, - 198, 199, 203, 0, 211, 214, 219, 0, 207, 210, 215, 0, - 208, 210, 216, 0, 209, 212, 218, 0, 210, 212, 217, 0, - 206, 209, 215, 0, 204, 207, 213, 0, 200, 203, 209, 0, - 198, 201, 206, 0, 206, 209, 215, 0, 201, 203, 207, 0, - 152, 154, 160, 0, 41, 43, 51, 58, 14, 14, 18, 124, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 1, 205, 5, 5, 18, 0, - 207, 209, 213, 0, 221, 223, 227, 0, 205, 207, 212, 0, - 200, 203, 209, 0, 203, 206, 212, 0, 202, 205, 211, 0, - 200, 202, 208, 0, 197, 199, 205, 0, 195, 198, 203, 0, - 193, 195, 200, 0, 196, 198, 203, 0, 154, 155, 160, 0, - 36, 36, 42, 0, 43, 49, 60, 108, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 1, 244, - 32, 31, 42, 14, 115, 115, 120, 0, 195, 197, 201, 0, - 195, 197, 202, 0, 196, 199, 204, 0, 196, 199, 205, 0, - 196, 198, 203, 0, 194, 196, 201, 0, 191, 194, 199, 0, - 191, 193, 197, 0, 191, 193, 198, 0, 156, 157, 162, 0, - 32, 31, 38, 0, 44, 48, 59, 108, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 25, 25, 36, 16, 109, 110, 114, 0, 198, 200, 205, 0, - 194, 196, 201, 0, 195, 197, 203, 0, 195, 198, 203, 0, - 194, 197, 202, 0, 194, 196, 200, 0, 193, 195, 199, 0, - 191, 193, 198, 0, 191, 193, 197, 0, 156, 158, 163, 0, - 28, 27, 34, 0, 29, 32, 39, 126, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 9, 9, 21, 39, 81, 82, 86, 1, 176, 178, 182, 22, - 170, 171, 175, 21, 170, 172, 176, 15, 171, 173, 176, 15, - 170, 171, 175, 15, 169, 171, 175, 15, 168, 170, 174, 16, - 168, 170, 173, 22, 168, 170, 174, 22, 136, 138, 141, 15, - 18, 18, 23, 0, 25, 27, 33, 134, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 204, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 248, 0, 0, 0, 77, 0, 0, 0, 52, - 0, 0, 0, 49, 0, 0, 0, 36, 0, 0, 0, 36, - 0, 0, 0, 36, 0, 0, 0, 36, 0, 0, 0, 36, - 0, 0, 0, 38, 0, 0, 0, 38, 0, 0, 0, 36, - 0, 0, 0, 109, 1, 1, 1, 176, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 200, 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 241, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 223, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 184, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 223, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 184, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 231, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 191, - 0, 0, 0, 178, 0, 0, 0, 183, 0, 0, 0, 183, - 0, 0, 0, 183, 0, 0, 0, 183, 0, 0, 0, 183, - 0, 0, 0, 183, 0, 0, 0, 183, 0, 0, 0, 185, - 0, 0, 0, 185, 0, 0, 0, 182, 0, 0, 0, 178, - 0, 0, 0, 235, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 200, 0, 0, 0, 193, 0, 0, 0, 193, - 0, 0, 0, 193, 0, 0, 0, 193, 0, 0, 0, 193, - 0, 0, 0, 193, 0, 0, 0, 193, 0, 0, 0, 194, - 0, 0, 0, 194, 0, 0, 0, 193, 0, 0, 0, 221, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 7, 7, 7, 246, 14, 14, 14, 239, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 45, 45, 45, 164, - 51, 51, 51, 83, 47, 47, 47, 67, 53, 53, 53, 61, - 45, 45, 45, 54, 50, 50, 50, 64, 55, 55, 55, 135, - 24, 24, 24, 223, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 8, 8, 8, 243, 39, 39, 39, 111, 7, 7, 7, 50, - 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, - 0, 0, 0, 50, 0, 0, 0, 50, 1, 1, 1, 50, - 37, 37, 37, 61, 48, 48, 48, 177, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 59, 59, 59, 100, 3, 3, 3, 50, 2, 2, 2, 50, - 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, - 0, 0, 0, 50, 0, 0, 0, 50, 1, 1, 1, 50, - 4, 4, 4, 50, 44, 44, 44, 56, 26, 26, 26, 226, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 6, 6, 6, 248, - 35, 35, 35, 54, 1, 1, 1, 50, 2, 2, 2, 50, - 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, - 0, 0, 0, 50, 0, 0, 0, 50, 0, 0, 0, 50, - 1, 1, 1, 50, 31, 31, 31, 50, 44, 44, 44, 205, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 252, - 38, 38, 38, 55, 16, 16, 16, 50, 2, 2, 2, 50, - 1, 1, 1, 50, 1, 1, 1, 50, 0, 0, 0, 50, - 0, 0, 0, 50, 1, 1, 1, 50, 1, 1, 1, 48, - 5, 5, 5, 44, 30, 30, 30, 42, 35, 35, 35, 171, - 0, 0, 0, 208, 0, 0, 0, 210, 0, 0, 0, 243, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 77, 77, 77, 56, 39, 39, 39, 51, 2, 2, 2, 50, - 14, 14, 14, 50, 12, 12, 12, 50, 2, 2, 2, 50, - 3, 3, 3, 50, 13, 13, 13, 45, 2, 2, 2, 36, - 4, 4, 4, 35, 65, 65, 65, 36, 39, 39, 39, 134, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 203, 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 101, 101, 101, 58, 45, 45, 45, 66, 98, 98, 98, 50, - 161, 161, 161, 50, 155, 155, 155, 50, 16, 16, 16, 50, - 112, 112, 112, 44, 161, 161, 161, 35, 131, 131, 131, 35, - 14, 14, 14, 35, 108, 108, 108, 54, 7, 7, 7, 172, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 191, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 84, 84, 84, 117, 14, 14, 14, 50, 149, 149, 149, 50, - 163, 163, 163, 50, 148, 148, 148, 50, 41, 41, 41, 49, - 106, 106, 106, 35, 163, 163, 163, 35, 163, 163, 163, 35, - 33, 33, 33, 35, 84, 84, 84, 63, 15, 15, 15, 166, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 238, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 72, 72, 72, 70, 5, 5, 5, 50, 65, 65, 65, 50, - 108, 108, 108, 50, 58, 58, 58, 50, 125, 125, 125, 50, - 79, 79, 79, 35, 97, 97, 97, 35, 80, 80, 80, 35, - 6, 6, 6, 35, 36, 36, 36, 40, 27, 27, 27, 153, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 238, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 14, 14, 14, 239, 57, 57, 57, 141, 71, 71, 71, 102, - 61, 61, 61, 87, 12, 12, 12, 50, 154, 154, 154, 52, - 94, 94, 94, 35, 38, 38, 38, 41, 70, 70, 70, 87, - 69, 69, 69, 54, 30, 30, 30, 147, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 233, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 100, 100, 100, 99, - 100, 100, 100, 102, 48, 48, 48, 57, 23, 23, 23, 50, - 42, 42, 42, 39, 92, 92, 92, 50, 50, 50, 50, 129, - 49, 49, 49, 135, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 186, 0, 0, 0, 245, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 21, 21, 21, 227, - 33, 33, 33, 206, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 28, 28, 28, 214, 43, 43, 43, 50, - 111, 111, 111, 105, 99, 99, 99, 63, 103, 103, 103, 60, - 105, 105, 105, 45, 114, 114, 114, 59, 67, 67, 67, 60, - 50, 50, 50, 102, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 8, 8, 8, 171, 35, 35, 35, 145, - 0, 0, 0, 178, 0, 0, 0, 196, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 3, 3, 3, 251, 55, 55, 55, 66, - 29, 29, 29, 51, 18, 18, 18, 225, 0, 0, 0, 255, - 0, 0, 0, 255, 38, 38, 38, 205, 30, 30, 30, 51, - 105, 105, 105, 57, 102, 102, 102, 63, 99, 99, 99, 56, - 112, 112, 112, 42, 113, 113, 113, 46, 19, 19, 19, 35, - 41, 41, 41, 111, 0, 0, 0, 178, 0, 0, 0, 178, - 23, 23, 23, 158, 52, 52, 52, 65, 55, 55, 55, 36, - 13, 13, 13, 168, 0, 0, 0, 180, 0, 0, 0, 239, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 42, 42, 42, 206, 24, 24, 24, 50, - 6, 6, 6, 50, 47, 47, 47, 178, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 48, 48, 48, 168, - 24, 24, 24, 52, 32, 32, 32, 50, 63, 63, 63, 50, - 40, 40, 40, 43, 14, 14, 14, 37, 38, 38, 38, 60, - 17, 17, 17, 165, 0, 0, 0, 178, 29, 29, 29, 147, - 40, 40, 40, 48, 55, 55, 55, 48, 49, 49, 49, 38, - 9, 9, 9, 170, 0, 0, 0, 211, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 45, 45, 45, 137, 4, 4, 4, 50, - 3, 3, 3, 50, 44, 44, 44, 68, 38, 38, 38, 203, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 26, 26, 26, 193, 41, 41, 41, 72, 39, 39, 39, 57, - 14, 14, 14, 71, 22, 22, 22, 140, 1, 1, 1, 211, - 0, 0, 0, 202, 36, 36, 36, 137, 31, 31, 31, 46, - 16, 16, 16, 35, 87, 87, 87, 50, 24, 24, 24, 47, - 23, 23, 23, 191, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 32, 32, 32, 198, 30, 30, 30, 60, 65, 65, 65, 62, - 38, 38, 38, 50, 6, 6, 6, 50, 24, 24, 24, 50, - 55, 55, 55, 110, 38, 38, 38, 199, 3, 3, 3, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 252, - 2, 2, 2, 252, 11, 11, 11, 237, 11, 11, 11, 167, - 15, 15, 15, 115, 40, 40, 40, 40, 76, 76, 76, 62, - 84, 84, 84, 47, 53, 53, 53, 39, 36, 36, 36, 39, - 20, 20, 20, 192, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 80, 80, 80, 119, 2, 2, 2, 50, 20, 20, 20, 50, - 41, 41, 41, 67, 64, 64, 64, 50, 10, 10, 10, 50, - 2, 2, 2, 50, 14, 14, 14, 50, 51, 51, 51, 66, - 60, 60, 60, 120, 8, 8, 8, 244, 0, 0, 0, 255, - 12, 12, 12, 214, 51, 51, 51, 83, 24, 24, 24, 36, - 15, 15, 15, 39, 93, 93, 93, 41, 55, 55, 55, 64, - 47, 47, 47, 118, 38, 38, 38, 150, 41, 41, 41, 145, - 2, 2, 2, 214, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 222, 0, 0, 0, 194, - 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 21, 21, 21, 231, 90, 90, 90, 96, 51, 51, 51, 185, - 0, 0, 0, 255, 13, 13, 13, 239, 9, 9, 9, 227, - 55, 55, 55, 102, 36, 36, 36, 54, 42, 42, 42, 36, - 96, 96, 96, 35, 73, 73, 73, 88, 24, 24, 24, 75, - 7, 7, 7, 50, 13, 13, 13, 50, 62, 62, 62, 40, - 80, 80, 80, 78, 38, 38, 38, 148, 0, 0, 0, 178, - 0, 0, 0, 179, 0, 0, 0, 181, 2, 2, 2, 177, - 1, 1, 1, 234, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 206, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 57, 57, 57, 191, 24, 24, 24, 50, 25, 25, 25, 106, - 8, 8, 8, 232, 8, 8, 8, 244, 3, 3, 3, 251, - 73, 73, 73, 148, 66, 66, 66, 97, 55, 55, 55, 38, - 7, 7, 7, 35, 3, 3, 3, 40, 40, 40, 40, 50, - 77, 77, 77, 93, 80, 80, 80, 106, 34, 34, 34, 51, - 44, 44, 44, 45, 26, 26, 26, 102, 14, 14, 14, 148, - 44, 44, 44, 141, 65, 65, 65, 133, 55, 55, 55, 82, - 29, 29, 29, 77, 46, 46, 46, 194, 0, 0, 0, 198, - 0, 0, 0, 178, 0, 0, 0, 189, 0, 0, 0, 180, - 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 58, 58, 58, 57, 35, 35, 35, 65, - 14, 14, 14, 51, 17, 17, 17, 52, 15, 15, 15, 60, - 4, 4, 4, 48, 1, 1, 1, 38, 30, 30, 30, 38, - 56, 56, 56, 61, 49, 49, 49, 114, 23, 23, 23, 173, - 33, 33, 33, 182, 60, 60, 60, 84, 45, 45, 45, 57, - 35, 35, 35, 50, 14, 14, 14, 45, 60, 60, 60, 50, - 38, 38, 38, 46, 18, 18, 18, 47, 4, 4, 4, 50, - 6, 6, 6, 48, 35, 35, 35, 140, 0, 0, 0, 181, - 0, 0, 0, 184, 0, 0, 0, 182, 0, 0, 0, 178, - 0, 0, 0, 236, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 57, 57, 57, 131, 34, 34, 34, 51, - 28, 28, 28, 52, 58, 58, 58, 50, 36, 36, 36, 50, - 54, 54, 54, 48, 46, 46, 46, 104, 23, 23, 23, 158, - 1, 1, 1, 177, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 190, 13, 13, 13, 206, - 43, 43, 43, 187, 60, 60, 60, 112, 54, 54, 54, 57, - 85, 85, 85, 58, 87, 87, 87, 60, 39, 39, 39, 41, - 60, 60, 60, 71, 16, 16, 16, 169, 0, 0, 0, 189, - 0, 0, 0, 192, 0, 0, 0, 203, 0, 0, 0, 205, - 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 35, 35, 35, 119, 12, 12, 12, 50, - 76, 76, 76, 62, 46, 46, 46, 98, 51, 51, 51, 169, - 11, 11, 11, 216, 0, 0, 0, 191, 0, 0, 0, 204, - 0, 0, 0, 229, 0, 0, 0, 217, 0, 0, 0, 212, - 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 179, 0, 0, 0, 223, 18, 18, 18, 195, - 56, 56, 56, 84, 15, 15, 15, 36, 6, 6, 6, 35, - 46, 46, 46, 121, 0, 0, 0, 211, 0, 0, 0, 238, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 38, 38, 38, 194, 50, 50, 50, 115, - 51, 51, 51, 158, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 234, 0, 0, 0, 182, 0, 0, 0, 225, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 226, 0, 0, 0, 201, 0, 0, 0, 180, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 180, 53, 53, 53, 102, 58, 58, 58, 62, - 35, 35, 35, 166, 0, 0, 0, 240, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 227, - 0, 0, 0, 220, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 247, 0, 0, 0, 178, 0, 0, 0, 180, - 0, 0, 0, 203, 0, 0, 0, 207, 0, 0, 0, 213, - 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 190, 0, 0, 0, 213, - 0, 0, 0, 218, 1, 1, 1, 177, 1, 1, 1, 177, - 0, 0, 0, 178, 0, 0, 0, 182, 0, 0, 0, 194, - 0, 0, 0, 190, 0, 0, 0, 183, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 198, 0, 0, 0, 184, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 186, 0, 0, 0, 214, - 0, 0, 0, 237, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 235, 0, 0, 0, 220, - 0, 0, 0, 199, 0, 0, 0, 178, 0, 0, 0, 181, - 0, 0, 0, 181, 0, 0, 0, 180, 0, 0, 0, 178, - 0, 0, 0, 187, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 202, 0, 0, 0, 178, - 0, 0, 0, 183, 0, 0, 0, 178, 0, 0, 0, 192, - 0, 0, 0, 223, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 245, 0, 0, 0, 214, - 0, 0, 0, 179, 0, 0, 0, 184, 0, 0, 0, 178, - 0, 0, 0, 218, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 210, 0, 0, 0, 178, - 0, 0, 0, 191, 0, 0, 0, 241, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 245, 0, 0, 0, 188, 0, 0, 0, 178, - 0, 0, 0, 226, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 239, 0, 0, 0, 237, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 13, 13, 13, 233, 58, 58, 58, 179, - 87, 87, 87, 150, 89, 89, 89, 146, 68, 68, 68, 166, - 23, 23, 23, 213, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 22, 22, 22, 226, - 150, 150, 150, 90, 239, 239, 239, 8, 249, 249, 249, 0, - 242, 242, 242, 0, 243, 243, 243, 0, 248, 248, 248, 0, - 248, 248, 248, 2, 180, 180, 180, 46, 50, 50, 50, 175, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 35, 35, 35, 212, 220, 220, 220, 26, - 245, 245, 245, 0, 197, 197, 197, 0, 159, 159, 159, 1, - 134, 134, 134, 21, 133, 133, 133, 30, 178, 178, 178, 6, - 219, 219, 219, 0, 242, 242, 242, 0, 229, 229, 229, 2, - 83, 83, 83, 126, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 4, 4, 4, 247, 200, 200, 200, 43, 246, 246, 246, 0, - 175, 175, 175, 0, 82, 82, 82, 54, 12, 12, 12, 200, - 0, 0, 0, 253, 0, 0, 0, 255, 3, 3, 3, 229, - 81, 81, 81, 103, 216, 216, 216, 2, 239, 239, 239, 0, - 216, 216, 216, 2, 45, 45, 45, 167, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 80, 80, 80, 160, 254, 254, 254, 0, 206, 206, 206, 0, - 104, 104, 104, 36, 1, 1, 1, 239, 0, 0, 0, 255, - 0, 0, 0, 246, 0, 0, 0, 207, 0, 0, 0, 182, - 0, 0, 0, 178, 75, 75, 75, 96, 242, 242, 242, 0, - 231, 231, 231, 0, 140, 140, 140, 31, 0, 0, 0, 202, - 0, 0, 0, 243, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 163, 163, 163, 75, 243, 243, 243, 0, 177, 177, 177, 0, - 36, 36, 36, 155, 0, 0, 0, 255, 0, 0, 0, 239, - 0, 0, 0, 185, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 1, 1, 1, 177, 203, 203, 203, 20, - 242, 242, 242, 0, 183, 183, 183, 2, 5, 5, 5, 156, - 0, 0, 0, 182, 0, 0, 0, 232, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 141, 141, 141, 57, 162, 162, 162, 11, 139, 139, 139, 6, - 3, 3, 3, 229, 0, 0, 0, 250, 0, 0, 0, 187, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 195, - 0, 0, 0, 236, 0, 0, 0, 252, 168, 168, 168, 66, - 243, 243, 243, 0, 178, 178, 178, 1, 10, 10, 10, 145, - 0, 0, 0, 178, 0, 0, 0, 182, 0, 0, 0, 242, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 247, 2, 2, 2, 228, - 0, 0, 0, 254, 0, 0, 0, 218, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 194, 0, 0, 0, 252, - 0, 0, 0, 255, 2, 2, 2, 251, 207, 207, 207, 32, - 234, 234, 234, 0, 154, 154, 154, 5, 2, 2, 2, 183, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 204, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 191, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 234, 0, 0, 0, 255, - 0, 0, 0, 255, 105, 105, 105, 137, 253, 253, 253, 0, - 196, 196, 196, 0, 88, 88, 88, 64, 0, 0, 0, 246, - 0, 0, 0, 179, 0, 0, 0, 178, 0, 0, 0, 184, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 183, 0, 0, 0, 179, - 0, 0, 0, 183, 0, 0, 0, 253, 0, 0, 0, 254, - 99, 99, 99, 143, 248, 248, 248, 3, 213, 213, 213, 0, - 126, 126, 126, 10, 13, 13, 13, 203, 0, 0, 0, 255, - 0, 0, 0, 186, 0, 0, 0, 178, 0, 0, 0, 180, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 247, - 0, 0, 0, 242, 2, 2, 2, 252, 126, 126, 126, 115, - 251, 251, 251, 1, 213, 213, 213, 0, 130, 130, 130, 6, - 24, 24, 24, 170, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 184, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 1, 1, 1, 253, 138, 138, 138, 104, 252, 252, 252, 0, - 202, 202, 202, 0, 119, 119, 119, 11, 21, 21, 21, 175, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 214, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 206, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 87, 87, 87, 155, 252, 252, 252, 1, 200, 200, 200, 0, - 113, 113, 113, 19, 13, 13, 13, 197, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 218, 0, 0, 0, 179, - 0, 0, 0, 178, 0, 0, 0, 183, 0, 0, 0, 244, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 250, - 211, 211, 211, 30, 231, 231, 231, 0, 139, 139, 139, 5, - 13, 13, 13, 196, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 210, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 181, 0, 0, 0, 233, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 32, 32, 32, 207, - 252, 252, 252, 1, 208, 208, 208, 0, 85, 85, 85, 78, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 205, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 182, - 0, 0, 0, 233, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 58, 58, 58, 176, - 253, 253, 253, 0, 195, 195, 195, 0, 59, 59, 59, 128, - 0, 0, 0, 255, 0, 0, 0, 218, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 185, 0, 0, 0, 240, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 49, 49, 49, 177, - 174, 174, 174, 17, 134, 134, 134, 17, 35, 35, 35, 153, - 0, 0, 0, 250, 0, 0, 0, 182, 0, 0, 0, 178, - 0, 0, 0, 182, 0, 0, 0, 241, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 254, - 0, 0, 0, 231, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 211, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 1, 1, 1, 252, - 0, 0, 0, 252, 0, 0, 0, 252, 0, 0, 0, 254, - 0, 0, 0, 220, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 228, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 176, 176, 176, 51, - 238, 238, 238, 0, 230, 230, 230, 0, 55, 55, 55, 148, - 0, 0, 0, 219, 0, 0, 0, 179, 0, 0, 0, 179, - 0, 0, 0, 234, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 182, 182, 182, 51, - 252, 252, 252, 0, 204, 204, 204, 0, 46, 46, 46, 148, - 0, 0, 0, 253, 0, 0, 0, 250, 0, 0, 0, 250, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 4, 4, 4, 245, - 31, 31, 31, 206, 37, 37, 37, 199, 195, 195, 195, 40, - 249, 249, 249, 0, 200, 200, 200, 0, 80, 80, 80, 108, - 49, 49, 49, 186, 31, 31, 31, 197, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 3, 3, 3, 247, - 182, 182, 182, 40, 251, 251, 251, 0, 254, 254, 254, 0, - 253, 253, 253, 0, 236, 236, 236, 0, 247, 247, 247, 0, - 204, 204, 204, 0, 49, 49, 49, 97, 0, 0, 0, 184, - 0, 0, 0, 236, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 41, 41, 41, 186, 233, 233, 233, 1, 250, 250, 250, 0, - 254, 254, 254, 0, 249, 249, 249, 0, 197, 197, 197, 0, - 100, 100, 100, 25, 0, 0, 0, 173, 0, 0, 0, 178, - 0, 0, 0, 234, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 127, 127, 127, 87, 243, 243, 243, 0, - 252, 252, 252, 0, 223, 223, 223, 0, 151, 151, 151, 0, - 23, 23, 23, 123, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 224, 0, 0, 0, 241, 0, 0, 0, 245, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 12, 12, 12, 228, 209, 209, 209, 14, - 243, 243, 243, 0, 184, 184, 184, 0, 78, 78, 78, 47, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 227, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 77, 77, 77, 143, - 231, 231, 231, 0, 135, 135, 135, 3, 11, 11, 11, 146, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 195, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 1, 1, 1, 250, - 154, 154, 154, 48, 56, 56, 56, 104, 0, 0, 0, 190, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 179, 0, 0, 0, 238, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 21, 21, 21, 201, 3, 3, 3, 233, 0, 0, 0, 235, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 206, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 205, 0, 0, 0, 178, 0, 0, 0, 182, - 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 247, 0, 0, 0, 183, 0, 0, 0, 217, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 229, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 3, 2, 251, - 14, 20, 12, 231, 23, 36, 18, 210, 28, 45, 22, 199, - 29, 47, 23, 197, 28, 48, 21, 194, 20, 35, 15, 211, - 5, 8, 4, 244, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 32, 43, 28, 204, 79, 121, 65, 112, 100, 173, 76, 47, - 95, 180, 66, 38, 82, 175, 50, 38, 77, 169, 46, 38, - 74, 166, 44, 38, 68, 162, 37, 38, 67, 161, 36, 38, - 62, 155, 30, 42, 63, 138, 38, 74, 43, 96, 26, 129, - 16, 38, 9, 202, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 1, 1, 1, 253, 39, 54, 33, 191, 95, 142, 79, 88, - 107, 184, 82, 38, 83, 175, 52, 38, 54, 149, 22, 38, - 33, 116, 5, 38, 24, 98, 0, 42, 21, 83, 0, 66, - 17, 68, 0, 99, 15, 60, 0, 116, 12, 51, 0, 134, - 13, 52, 0, 134, 17, 66, 0, 117, 27, 92, 5, 85, - 36, 114, 10, 54, 34, 95, 13, 106, 10, 23, 5, 220, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 54, 94, 41, 123, 0, 1, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 24, 33, 22, 216, - 99, 140, 86, 93, 107, 185, 81, 38, 87, 181, 55, 38, - 52, 147, 20, 39, 26, 102, 0, 38, 18, 75, 0, 62, - 7, 30, 0, 156, 0, 3, 0, 240, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 2, 0, 248, 11, 44, 0, 167, 27, 94, 4, 76, - 0, 3, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 12, 16, 10, 235, 78, 157, 52, 42, 9, 37, 0, 179, - 1, 1, 1, 253, 70, 93, 62, 148, 116, 182, 94, 43, - 96, 184, 66, 38, 68, 174, 33, 38, 37, 134, 5, 39, - 22, 90, 0, 39, 9, 35, 0, 126, 0, 1, 0, 248, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 245, 0, 0, 0, 236, 0, 0, 0, 232, - 0, 0, 0, 229, 0, 0, 0, 227, 0, 0, 0, 231, - 0, 0, 0, 239, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 42, 64, 35, 177, 79, 171, 49, 38, 26, 102, 1, 80, - 78, 106, 69, 133, 117, 188, 94, 38, 82, 182, 49, 38, - 53, 168, 15, 38, 32, 129, 0, 39, 22, 89, 0, 39, - 7, 29, 0, 148, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 246, 0, 0, 0, 214, 0, 0, 0, 185, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 181, 0, 0, 0, 194, - 0, 0, 0, 217, 0, 0, 0, 246, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 72, 117, 57, 115, 78, 178, 45, 39, 49, 164, 11, 38, - 91, 182, 61, 39, 81, 182, 47, 38, 49, 172, 7, 38, - 35, 141, 0, 38, 23, 95, 0, 38, 7, 28, 0, 150, - 0, 0, 0, 255, 0, 0, 0, 244, 0, 0, 0, 208, - 0, 0, 0, 180, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 179, 0, 0, 0, 187, - 0, 0, 0, 201, 0, 0, 0, 208, 0, 0, 0, 215, - 0, 0, 0, 219, 0, 0, 0, 215, 0, 0, 0, 206, - 0, 0, 0, 195, 0, 0, 0, 184, 0, 0, 0, 218, - 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 1, 252, - 96, 164, 73, 58, 72, 179, 36, 38, 48, 173, 6, 38, - 54, 175, 13, 38, 47, 173, 5, 35, 39, 160, 0, 34, - 29, 120, 0, 38, 14, 56, 0, 98, 0, 0, 0, 250, - 0, 0, 0, 214, 0, 0, 0, 180, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 181, - 0, 0, 0, 208, 0, 0, 0, 243, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 246, 0, 0, 0, 208, - 0, 0, 0, 222, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 26, 38, 22, 209, - 96, 178, 69, 42, 62, 178, 24, 38, 43, 172, 0, 38, - 43, 172, 0, 38, 42, 171, 0, 32, 37, 149, 0, 29, - 26, 104, 0, 38, 3, 14, 0, 189, 0, 0, 0, 188, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 188, 0, 0, 0, 243, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 56, 89, 45, 148, - 87, 181, 55, 39, 53, 175, 12, 38, 43, 172, 0, 38, - 43, 172, 0, 38, 42, 172, 0, 28, 37, 152, 0, 27, - 29, 118, 0, 38, 9, 25, 3, 153, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 192, 0, 0, 0, 248, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 85, 141, 67, 86, - 77, 179, 42, 40, 47, 173, 5, 38, 42, 171, 0, 38, - 41, 166, 0, 36, 39, 159, 0, 27, 37, 150, 0, 27, - 38, 147, 2, 27, 50, 149, 17, 29, 35, 95, 15, 76, - 7, 20, 3, 154, 0, 0, 0, 178, 0, 0, 0, 191, - 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, - 3, 12, 0, 217, 3, 12, 0, 228, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 11, 16, 10, 236, 101, 177, 75, 44, - 62, 171, 26, 38, 38, 150, 0, 38, 34, 139, 0, 38, - 32, 129, 0, 33, 29, 117, 0, 27, 25, 104, 0, 29, - 20, 85, 0, 40, 15, 60, 0, 71, 9, 36, 0, 108, - 2, 9, 0, 156, 0, 0, 0, 179, 0, 0, 0, 241, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 1, 0, 249, 3, 14, 0, 209, - 8, 35, 0, 157, 15, 59, 0, 105, 21, 85, 0, 55, - 53, 129, 27, 39, 32, 53, 25, 186, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 40, 62, 33, 179, 75, 161, 46, 38, - 30, 117, 1, 38, 26, 104, 0, 39, 20, 83, 0, 61, - 14, 56, 0, 84, 7, 32, 0, 114, 2, 12, 0, 150, - 0, 0, 0, 175, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 203, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 2, 0, 246, 4, 17, 0, 200, 9, 38, 0, 151, - 15, 61, 0, 100, 22, 89, 0, 52, 27, 107, 0, 39, - 29, 120, 0, 38, 33, 131, 0, 38, 54, 155, 19, 38, - 98, 175, 73, 45, 8, 11, 7, 241, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 33, 63, 22, 159, 15, 54, 2, 119, - 7, 29, 0, 171, 2, 9, 0, 223, 0, 0, 0, 249, - 0, 0, 0, 181, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 205, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 11, 41, 1, 159, - 33, 107, 8, 47, 33, 119, 5, 38, 31, 125, 0, 40, - 33, 132, 0, 38, 35, 142, 0, 38, 38, 152, 0, 38, - 40, 161, 0, 38, 46, 168, 5, 38, 78, 180, 43, 39, - 80, 134, 62, 93, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 231, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 184, - 0, 0, 0, 218, 0, 0, 0, 254, 0, 0, 0, 254, - 16, 40, 8, 197, 41, 116, 16, 90, 38, 147, 2, 38, - 39, 160, 0, 38, 43, 171, 0, 38, 43, 172, 0, 39, - 43, 172, 0, 38, 54, 175, 14, 38, 87, 181, 56, 39, - 52, 83, 41, 154, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 245, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 179, - 0, 0, 0, 183, 0, 0, 0, 198, 0, 0, 0, 215, - 0, 0, 0, 235, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 3, 14, 0, 211, 28, 114, 0, 38, - 38, 155, 0, 38, 43, 172, 0, 38, 43, 172, 0, 38, - 43, 172, 0, 38, 63, 178, 25, 38, 96, 178, 68, 39, - 22, 32, 19, 186, 0, 0, 0, 205, 0, 0, 0, 187, - 0, 0, 0, 178, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 188, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 183, - 0, 0, 0, 201, 0, 0, 0, 219, 0, 0, 0, 237, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 11, 44, 0, 123, 29, 117, 0, 38, - 39, 160, 0, 38, 43, 172, 0, 36, 44, 173, 1, 33, - 45, 173, 3, 31, 72, 179, 37, 28, 92, 158, 69, 45, - 1, 1, 1, 177, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 205, - 0, 0, 0, 222, 0, 0, 0, 240, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 3, 12, 0, 206, 22, 89, 0, 42, 34, 138, 0, 37, - 44, 170, 2, 29, 65, 178, 26, 27, 69, 179, 32, 27, - 52, 172, 12, 27, 83, 181, 51, 27, 68, 110, 53, 85, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 10, 0, 212, - 17, 69, 0, 54, 29, 118, 0, 38, 43, 161, 4, 38, - 67, 178, 31, 38, 104, 186, 76, 33, 92, 155, 71, 50, - 39, 148, 4, 28, 88, 179, 57, 27, 37, 58, 30, 129, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 185, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 3, 13, 0, 200, 17, 71, 0, 52, - 28, 115, 0, 39, 49, 159, 13, 39, 77, 181, 44, 38, - 105, 186, 79, 38, 115, 160, 100, 72, 15, 20, 14, 175, - 21, 87, 0, 65, 90, 168, 63, 31, 8, 12, 7, 168, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 206, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 1, 4, 0, 239, - 6, 26, 0, 188, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 1, 4, 0, 239, - 8, 32, 0, 151, 19, 79, 0, 45, 34, 124, 4, 39, - 64, 168, 30, 38, 94, 184, 64, 38, 118, 183, 96, 42, - 78, 108, 68, 130, 7, 8, 7, 232, 0, 0, 0, 179, - 7, 29, 0, 134, 65, 120, 47, 64, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 227, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 1, 7, 0, 237, - 30, 95, 8, 95, 28, 96, 6, 83, 9, 38, 0, 170, - 5, 22, 0, 201, 1, 7, 0, 234, 0, 2, 0, 245, - 0, 3, 0, 242, 2, 9, 0, 226, 3, 16, 0, 209, - 7, 30, 0, 171, 11, 46, 0, 131, 20, 83, 0, 50, - 29, 112, 1, 38, 54, 147, 22, 38, 89, 181, 58, 38, - 110, 184, 86, 39, 94, 137, 80, 95, 28, 36, 25, 214, - 0, 0, 0, 253, 0, 0, 0, 198, 0, 0, 0, 178, - 0, 0, 0, 177, 19, 30, 14, 149, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 179, - 0, 0, 0, 248, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 16, 44, 6, 186, 43, 118, 18, 76, - 52, 143, 21, 39, 45, 133, 16, 38, 35, 120, 8, 41, - 33, 115, 5, 40, 37, 122, 8, 38, 38, 125, 10, 38, - 44, 133, 13, 38, 51, 144, 20, 38, 65, 161, 33, 38, - 88, 179, 58, 38, 109, 182, 85, 41, 85, 126, 72, 107, - 30, 40, 27, 208, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 202, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 179, - 0, 0, 0, 192, 0, 0, 0, 178, 0, 0, 0, 194, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 11, 24, 7, 222, 32, 64, 21, 172, 43, 97, 25, 128, - 65, 128, 44, 96, 74, 143, 51, 79, 76, 139, 55, 85, - 75, 136, 54, 88, 71, 127, 52, 100, 65, 109, 50, 123, - 54, 83, 44, 155, 17, 23, 15, 228, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 199, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 180, 0, 0, 0, 225, - 0, 0, 0, 237, 0, 0, 0, 178, 0, 0, 0, 215, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 229, 0, 0, 0, 243, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 230, 0, 0, 0, 191, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 194, 0, 0, 0, 240, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 197, 0, 0, 0, 237, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 229, 0, 0, 0, 187, 0, 0, 0, 206, - 0, 0, 0, 226, 0, 0, 0, 237, 0, 0, 0, 245, - 0, 0, 0, 248, 0, 0, 0, 242, 0, 0, 0, 236, - 0, 0, 0, 227, 0, 0, 0, 214, 0, 0, 0, 191, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 188, 0, 0, 0, 225, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 213, - 0, 0, 0, 185, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 178, - 0, 0, 0, 178, 0, 0, 0, 178, 0, 0, 0, 192, - 0, 0, 0, 226, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 239, 0, 0, 0, 223, - 0, 0, 0, 208, 0, 0, 0, 201, 0, 0, 0, 199, - 0, 0, 0, 200, 0, 0, 0, 204, 0, 0, 0, 209, - 0, 0, 0, 219, 0, 0, 0, 237, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 13, 5, 13, 201, - 32, 13, 24, 144, 1, 0, 1, 248, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 18, 8, 16, 185, 130, 40, 22, 23, - 146, 46, 22, 6, 35, 13, 21, 148, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 2, 1, 2, 245, 95, 32, 25, 56, 169, 58, 22, 0, - 163, 57, 25, 0, 104, 34, 24, 42, 3, 1, 4, 238, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 1, 3, 242, - 15, 8, 20, 186, 148, 60, 31, 10, 172, 86, 59, 0, - 176, 89, 55, 0, 134, 48, 24, 15, 18, 10, 24, 174, - 3, 2, 5, 238, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 68, 55, 76, 108, - 79, 54, 76, 73, 188, 142, 152, 0, 189, 159, 185, 0, - 180, 98, 70, 0, 149, 69, 43, 14, 123, 103, 128, 49, - 42, 32, 48, 150, 0, 0, 0, 252, 0, 0, 0, 240, - 0, 0, 0, 233, 0, 0, 0, 248, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 13, 7, 17, 198, 160, 134, 161, 15, - 152, 121, 143, 18, 198, 177, 205, 0, 205, 187, 216, 0, - 175, 106, 91, 0, 172, 95, 70, 9, 205, 182, 205, 3, - 103, 85, 109, 67, 0, 0, 0, 240, 0, 0, 0, 215, - 0, 0, 0, 209, 0, 0, 0, 231, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 42, 28, 45, 144, 196, 173, 202, 0, - 194, 164, 189, 0, 214, 198, 226, 0, 210, 193, 222, 0, - 162, 91, 82, 0, 179, 102, 82, 1, 200, 177, 206, 0, - 111, 88, 114, 49, 0, 0, 0, 223, 0, 0, 0, 205, - 0, 0, 0, 203, 0, 0, 0, 218, 0, 0, 0, 247, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 62, 45, 68, 115, 197, 176, 207, 0, - 195, 168, 195, 0, 216, 200, 227, 0, 203, 183, 212, 0, - 157, 84, 74, 0, 159, 84, 72, 4, 198, 177, 208, 0, - 92, 72, 98, 69, 0, 0, 0, 214, 0, 0, 0, 203, - 0, 0, 0, 202, 0, 0, 0, 210, 0, 0, 0, 233, - 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 84, 66, 91, 87, 202, 183, 212, 0, - 191, 164, 193, 0, 217, 202, 227, 0, 197, 173, 203, 0, - 173, 113, 112, 0, 163, 96, 92, 4, 202, 184, 214, 0, - 76, 58, 80, 81, 0, 0, 0, 205, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 203, 0, 0, 0, 210, - 0, 0, 0, 234, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 109, 88, 117, 56, 199, 176, 204, 0, - 199, 179, 211, 0, 216, 201, 227, 0, 197, 170, 200, 0, - 185, 139, 148, 0, 168, 107, 108, 4, 199, 180, 210, 0, - 59, 42, 62, 97, 0, 0, 0, 202, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 204, - 0, 0, 0, 225, 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 2, 1, 3, 244, 128, 103, 133, 36, 190, 164, 193, 0, - 202, 180, 212, 0, 215, 198, 226, 0, 200, 173, 201, 0, - 188, 154, 171, 0, 168, 115, 123, 4, 190, 166, 196, 0, - 43, 29, 45, 118, 0, 0, 0, 202, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 204, - 0, 0, 0, 225, 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 13, 6, 14, 207, 148, 121, 151, 22, 206, 183, 213, 0, - 191, 155, 180, 0, 209, 186, 214, 0, 205, 178, 203, 0, - 222, 205, 227, 0, 190, 160, 184, 0, 187, 161, 191, 1, - 28, 17, 29, 138, 0, 0, 0, 202, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 205, - 0, 0, 0, 228, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 0, 1, 250, 31, 19, 33, 162, - 142, 119, 147, 36, 213, 193, 222, 0, 210, 186, 214, 0, - 209, 163, 170, 0, 213, 185, 210, 0, 207, 182, 209, 0, - 215, 185, 213, 0, 221, 198, 223, 0, 193, 166, 193, 1, - 56, 36, 56, 92, 1, 0, 1, 197, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 206, - 0, 0, 0, 231, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 34, 20, 35, 155, 187, 162, 190, 9, - 221, 199, 224, 0, 177, 134, 184, 0, 157, 93, 100, 0, - 182, 112, 102, 0, 155, 80, 71, 0, 176, 123, 133, 0, - 208, 157, 181, 0, 212, 171, 194, 0, 215, 185, 211, 0, - 166, 132, 156, 10, 13, 6, 14, 162, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 207, - 0, 0, 0, 235, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 82, 54, 73, 85, 182, 138, 159, 2, - 184, 134, 149, 2, 195, 142, 153, 0, 180, 102, 88, 0, - 200, 155, 159, 0, 149, 81, 74, 0, 173, 85, 67, 0, - 197, 146, 156, 0, 190, 134, 142, 0, 166, 113, 125, 5, - 119, 78, 95, 34, 14, 6, 14, 163, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 208, - 0, 0, 0, 238, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 10, 5, 11, 217, 27, 12, 23, 175, - 84, 42, 55, 77, 173, 95, 89, 0, 201, 134, 117, 0, - 203, 150, 161, 0, 200, 151, 161, 0, 168, 83, 53, 0, - 217, 130, 88, 0, 171, 82, 67, 0, 108, 50, 62, 24, - 10, 4, 9, 177, 0, 0, 0, 202, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 209, - 0, 0, 0, 238, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 73, 31, 42, 96, 183, 96, 77, 0, 180, 123, 107, 30, - 201, 147, 131, 15, 218, 183, 141, 0, 217, 157, 84, 1, - 189, 117, 83, 22, 180, 92, 74, 0, 101, 46, 59, 37, - 2, 0, 1, 198, 0, 0, 0, 202, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 205, - 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 111, 57, 68, 63, 215, 153, 138, 0, 155, 112, 104, 64, - 47, 23, 29, 187, 102, 67, 55, 115, 77, 44, 41, 119, - 148, 103, 100, 49, 207, 145, 147, 0, 104, 52, 61, 56, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 204, - 0, 0, 0, 217, 0, 0, 0, 246, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 18, 8, 13, 219, - 176, 138, 147, 29, 229, 204, 199, 0, 139, 106, 109, 89, - 0, 0, 0, 254, 0, 0, 0, 245, 17, 8, 11, 202, - 191, 165, 167, 25, 228, 210, 213, 0, 131, 93, 105, 54, - 0, 0, 0, 201, 0, 0, 0, 202, 0, 0, 0, 202, - 0, 0, 0, 202, 0, 0, 0, 202, 0, 0, 0, 212, - 0, 0, 0, 235, 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 51, 36, 41, 183, - 226, 225, 225, 5, 231, 231, 231, 0, 158, 142, 148, 75, - 0, 0, 0, 255, 0, 0, 0, 254, 22, 12, 15, 221, - 173, 173, 173, 59, 197, 197, 197, 30, 118, 108, 111, 92, - 0, 0, 0, 204, 0, 0, 0, 203, 0, 0, 0, 203, - 0, 0, 0, 203, 0, 0, 0, 203, 0, 0, 0, 220, - 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 8, 7, 8, 246, - 86, 86, 86, 160, 107, 107, 107, 136, 35, 35, 35, 216, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 2, 2, 2, 232, 9, 9, 9, 199, 0, 0, 0, 215, - 0, 0, 0, 226, 0, 0, 0, 220, 0, 0, 0, 220, - 0, 0, 0, 214, 0, 0, 0, 205, 0, 0, 0, 224, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, - 0, 0, 0, 229, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 249, 0, 0, 0, 249, 0, 0, 0, 247, - 0, 0, 0, 227, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, - 0, 0, 0, 221, 0, 0, 0, 207, 0, 0, 0, 229, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 227, 0, 0, 0, 212, 0, 0, 0, 230, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 231, 0, 0, 0, 222, 0, 0, 0, 239, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 245, 0, 0, 0, 240, 0, 0, 0, 247, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 250, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 28, 28, 28, 226, 34, 34, 34, 220, 34, 34, 34, 220, - 34, 34, 34, 220, 34, 34, 34, 220, 34, 34, 34, 220, - 34, 34, 34, 220, 15, 15, 15, 239, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 55, 55, 55, 189, - 44, 45, 45, 114, 28, 31, 32, 83, 36, 42, 43, 83, - 38, 45, 47, 83, 38, 45, 47, 83, 27, 30, 31, 83, - 28, 29, 30, 85, 62, 62, 62, 136, 22, 22, 22, 232, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 59, 59, 59, 148, - 127, 122, 98, 16, 12, 24, 26, 0, 18, 31, 34, 0, - 14, 26, 29, 0, 12, 23, 26, 0, 9, 19, 21, 0, - 23, 33, 34, 0, 106, 95, 73, 66, 57, 57, 57, 197, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 60, 60, 60, 142, - 175, 160, 127, 25, 117, 114, 93, 7, 174, 154, 118, 0, - 200, 173, 128, 0, 189, 161, 115, 0, 135, 116, 80, 0, - 76, 70, 55, 35, 127, 111, 79, 60, 58, 58, 58, 196, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 55, 55, 55, 194, 81, 76, 68, 99, - 232, 207, 156, 1, 198, 176, 143, 0, 194, 184, 170, 0, - 182, 177, 169, 0, 184, 178, 169, 0, 190, 175, 155, 0, - 181, 153, 112, 0, 133, 111, 75, 32, 71, 70, 69, 133, - 17, 17, 17, 237, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 29, 29, 29, 225, 74, 73, 69, 112, 213, 187, 139, 9, - 197, 185, 168, 0, 179, 178, 176, 0, 190, 190, 190, 0, - 158, 158, 157, 0, 171, 170, 169, 0, 159, 157, 156, 0, - 165, 160, 156, 0, 187, 163, 127, 0, 120, 102, 71, 45, - 71, 71, 71, 138, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 227, 0, 0, 0, 237, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 67, 67, 67, 161, 160, 144, 113, 43, 202, 181, 151, 0, - 192, 192, 192, 0, 208, 209, 209, 0, 197, 197, 197, 0, - 207, 208, 208, 0, 200, 200, 200, 0, 187, 187, 186, 0, - 139, 137, 140, 0, 151, 146, 141, 0, 196, 164, 117, 0, - 80, 73, 60, 78, 37, 37, 37, 174, 0, 0, 0, 204, - 0, 0, 0, 206, 0, 0, 0, 219, 0, 0, 0, 244, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 8, 8, 8, 246, - 72, 71, 69, 119, 221, 192, 144, 2, 189, 186, 182, 0, - 181, 182, 181, 0, 181, 186, 190, 0, 203, 205, 207, 0, - 214, 215, 215, 0, 211, 212, 212, 0, 184, 184, 186, 0, - 185, 185, 186, 0, 147, 144, 143, 0, 187, 169, 146, 0, - 126, 104, 68, 39, 75, 75, 75, 130, 2, 2, 2, 202, - 0, 0, 0, 207, 0, 0, 0, 218, 0, 0, 0, 242, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 22, 22, 22, 232, - 93, 89, 80, 98, 212, 186, 142, 0, 184, 183, 182, 0, - 206, 207, 207, 0, 210, 212, 213, 0, 183, 185, 189, 0, - 164, 171, 179, 0, 170, 172, 176, 0, 205, 206, 207, 0, - 214, 215, 215, 0, 165, 163, 162, 0, 181, 173, 162, 0, - 186, 153, 98, 10, 71, 63, 50, 77, 47, 47, 47, 166, - 0, 0, 0, 205, 0, 0, 0, 210, 0, 0, 0, 229, - 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 22, 22, 22, 232, - 93, 87, 77, 96, 210, 185, 141, 0, 164, 162, 160, 0, - 201, 202, 202, 0, 217, 219, 219, 0, 213, 214, 214, 0, - 150, 158, 168, 0, 189, 191, 193, 0, 213, 214, 214, 0, - 215, 216, 216, 0, 159, 157, 156, 0, 182, 174, 162, 0, - 194, 158, 100, 3, 87, 72, 51, 61, 52, 52, 52, 162, - 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 212, - 0, 0, 0, 235, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 12, 12, 12, 242, - 73, 71, 67, 113, 213, 182, 130, 0, 178, 177, 175, 0, - 172, 172, 171, 0, 215, 216, 216, 0, 199, 199, 199, 0, - 183, 183, 182, 0, 181, 180, 179, 0, 211, 212, 212, 0, - 211, 212, 212, 0, 154, 152, 151, 0, 193, 181, 162, 0, - 127, 103, 67, 32, 68, 68, 68, 116, 12, 12, 12, 194, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 206, - 0, 0, 0, 220, 0, 0, 0, 246, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 66, 66, 66, 150, 162, 137, 94, 30, 185, 170, 150, 0, - 143, 141, 140, 0, 203, 203, 203, 0, 186, 186, 185, 0, - 169, 172, 180, 0, 182, 183, 185, 0, 197, 197, 197, 0, - 181, 180, 179, 0, 144, 140, 137, 0, 187, 161, 122, 0, - 82, 71, 52, 67, 50, 50, 50, 163, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 211, 0, 0, 0, 237, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 45, 45, 45, 209, 73, 66, 54, 97, 197, 165, 113, 2, - 177, 172, 165, 0, 138, 136, 136, 0, 166, 164, 164, 0, - 176, 175, 176, 0, 186, 185, 185, 0, 166, 164, 163, 0, - 164, 161, 160, 0, 182, 165, 143, 0, 140, 115, 75, 21, - 69, 68, 68, 110, 5, 5, 5, 199, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 207, 0, 0, 0, 223, 0, 0, 0, 248, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 69, 69, 69, 168, 94, 84, 64, 78, - 210, 181, 129, 1, 182, 167, 146, 0, 166, 162, 160, 0, - 154, 150, 147, 0, 155, 152, 151, 0, 175, 170, 164, 0, - 182, 161, 131, 0, 144, 118, 77, 15, 64, 61, 56, 93, - 34, 34, 34, 176, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 207, 0, 0, 0, 225, 0, 0, 0, 248, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 4, 4, 4, 250, 63, 63, 63, 139, - 179, 156, 111, 28, 156, 141, 103, 7, 199, 170, 120, 0, - 183, 156, 114, 0, 177, 149, 108, 0, 153, 126, 86, 0, - 101, 87, 62, 26, 104, 87, 60, 49, 66, 66, 66, 150, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 213, 0, 0, 0, 239, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 58, 58, 58, 145, - 135, 123, 89, 9, 6, 18, 21, 0, 14, 23, 23, 0, - 23, 23, 18, 0, 16, 16, 13, 0, 3, 10, 11, 0, - 18, 24, 21, 0, 103, 87, 60, 54, 53, 53, 53, 161, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 206, - 0, 0, 0, 223, 0, 0, 0, 248, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 67, 67, 67, 165, - 31, 31, 29, 86, 1, 6, 8, 44, 6, 18, 21, 44, - 7, 22, 24, 44, 2, 8, 9, 43, 0, 2, 3, 41, - 7, 10, 10, 40, 49, 48, 46, 93, 35, 35, 35, 175, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 215, - 0, 0, 0, 238, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 4, 4, 4, 250, - 59, 59, 59, 187, 59, 59, 59, 180, 59, 59, 59, 180, - 59, 59, 59, 180, 59, 59, 59, 180, 59, 59, 59, 175, - 59, 59, 59, 159, 43, 43, 43, 170, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 205, 0, 0, 0, 211, 0, 0, 0, 233, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 233, 0, 0, 0, 212, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 207, 0, 0, 0, 218, 0, 0, 0, 243, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 237, 0, 0, 0, 212, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 206, 0, 0, 0, 220, 0, 0, 0, 246, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 250, 0, 0, 0, 238, 0, 0, 0, 233, - 0, 0, 0, 233, 0, 0, 0, 233, 0, 0, 0, 233, - 0, 0, 0, 234, 0, 0, 0, 242, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 237, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 65, - 0, 0, 0, 77, 0, 0, 0, 95, 0, 0, 0, 76, - 0, 0, 0, 195, 0, 0, 0, 209, 0, 0, 0, 105, - 0, 0, 0, 77, 0, 0, 0, 95, 0, 0, 0, 77, - 0, 0, 0, 245, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 101, 136, 136, 136, 67, - 171, 171, 171, 79, 174, 174, 174, 80, 174, 174, 174, 80, - 103, 103, 103, 60, 87, 87, 87, 59, 171, 171, 171, 79, - 174, 174, 174, 80, 174, 174, 174, 80, 158, 158, 158, 75, - 5, 5, 5, 69, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 77, 158, 158, 158, 75, - 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, - 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, - 174, 174, 174, 80, 174, 174, 174, 80, 165, 165, 165, 78, - 5, 5, 5, 51, 0, 0, 0, 237, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 245, 5, 5, 5, 67, - 10, 10, 10, 68, 8, 8, 8, 52, 105, 105, 105, 64, - 174, 174, 174, 80, 174, 174, 174, 80, 125, 125, 125, 66, - 10, 10, 10, 57, 10, 10, 10, 63, 8, 8, 8, 81, - 0, 0, 0, 215, 0, 0, 0, 253, 0, 0, 0, 253, - 0, 0, 0, 252, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 7, 7, 7, 56, - 174, 174, 174, 80, 174, 174, 174, 80, 17, 17, 17, 38, - 0, 0, 0, 218, 0, 0, 0, 214, 0, 0, 0, 210, - 0, 0, 0, 228, 0, 0, 0, 235, 0, 0, 0, 236, - 0, 0, 0, 231, 0, 0, 0, 229, 0, 0, 0, 230, - 0, 0, 0, 233, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 75, - 174, 174, 174, 80, 173, 173, 173, 79, 9, 9, 9, 53, - 0, 0, 0, 210, 0, 0, 0, 209, 0, 0, 0, 209, - 0, 0, 0, 209, 0, 0, 0, 211, 0, 0, 0, 212, - 0, 0, 0, 209, 0, 0, 0, 209, 0, 0, 0, 209, - 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 59, - 174, 174, 174, 80, 173, 173, 173, 79, 12, 12, 12, 62, - 0, 0, 0, 212, 0, 0, 0, 207, 0, 0, 0, 206, - 0, 0, 0, 205, 0, 0, 0, 205, 0, 0, 0, 205, - 0, 0, 0, 205, 0, 0, 0, 206, 0, 0, 0, 207, - 0, 0, 0, 211, 0, 0, 0, 231, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 82, - 174, 174, 174, 80, 173, 173, 173, 80, 12, 12, 12, 66, - 0, 0, 0, 231, 0, 0, 0, 226, 0, 0, 0, 222, - 0, 0, 0, 211, 0, 0, 0, 205, 0, 0, 0, 205, - 0, 0, 0, 209, 0, 0, 0, 221, 0, 0, 0, 226, - 0, 0, 0, 230, 0, 0, 0, 243, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 65, - 174, 174, 174, 80, 174, 174, 174, 80, 10, 10, 10, 58, - 0, 0, 0, 251, 0, 0, 0, 250, 0, 0, 0, 244, - 0, 0, 0, 223, 0, 0, 0, 207, 0, 0, 0, 205, - 0, 0, 0, 219, 0, 0, 0, 242, 0, 0, 0, 249, - 0, 0, 0, 251, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 82, - 174, 174, 174, 80, 174, 174, 174, 80, 7, 7, 7, 48, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, - 0, 0, 0, 229, 0, 0, 0, 208, 0, 0, 0, 207, - 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 76, - 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 73, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 75, - 174, 174, 174, 80, 174, 174, 174, 80, 13, 13, 13, 80, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 89, - 174, 174, 174, 80, 174, 174, 174, 80, 11, 11, 11, 65, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 89, - 174, 174, 174, 80, 174, 174, 174, 80, 8, 8, 8, 51, - 0, 0, 0, 237, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 69, - 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 70, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 80, - 174, 174, 174, 80, 174, 174, 174, 80, 13, 13, 13, 80, - 0, 0, 0, 234, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 87, - 174, 174, 174, 80, 174, 174, 174, 80, 11, 11, 11, 64, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 87, - 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 73, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 95, - 174, 174, 174, 80, 174, 174, 174, 80, 12, 12, 12, 73, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 9, 9, 9, 61, - 174, 174, 174, 80, 174, 174, 174, 80, 25, 25, 25, 55, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 229, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 245, 6, 6, 6, 78, - 7, 7, 7, 53, 10, 10, 10, 61, 105, 105, 105, 64, - 174, 174, 174, 80, 174, 174, 174, 80, 125, 125, 125, 66, - 12, 12, 12, 68, 9, 9, 9, 58, 6, 6, 6, 63, - 0, 0, 0, 210, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 84, 158, 158, 158, 75, - 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, - 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, - 174, 174, 174, 80, 174, 174, 174, 80, 150, 150, 150, 71, - 7, 7, 7, 62, 0, 0, 0, 209, 0, 0, 0, 207, - 0, 0, 0, 226, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 88, 147, 147, 147, 72, - 174, 174, 174, 80, 174, 174, 174, 80, 174, 174, 174, 80, - 103, 103, 103, 60, 87, 87, 87, 59, 171, 171, 171, 79, - 174, 174, 174, 80, 174, 174, 174, 80, 157, 157, 157, 74, - 8, 8, 8, 82, 0, 0, 0, 193, 0, 0, 0, 207, - 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 81, - 0, 0, 0, 87, 0, 0, 0, 95, 0, 0, 0, 82, - 0, 0, 0, 195, 0, 0, 0, 209, 0, 0, 0, 81, - 0, 0, 0, 74, 0, 0, 0, 87, 0, 0, 0, 74, - 0, 0, 0, 198, 0, 0, 0, 205, 0, 0, 0, 205, - 0, 0, 0, 219, 0, 0, 0, 242, 0, 0, 0, 249, - 0, 0, 0, 251, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, - 0, 0, 0, 228, 0, 0, 0, 206, 0, 0, 0, 191, - 0, 0, 0, 211, 0, 0, 0, 205, 0, 0, 0, 205, - 0, 0, 0, 209, 0, 0, 0, 221, 0, 0, 0, 226, - 0, 0, 0, 230, 0, 0, 0, 243, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 234, - 0, 0, 0, 212, 0, 0, 0, 207, 0, 0, 0, 206, - 0, 0, 0, 205, 0, 0, 0, 205, 0, 0, 0, 205, - 0, 0, 0, 205, 0, 0, 0, 206, 0, 0, 0, 207, - 0, 0, 0, 211, 0, 0, 0, 231, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 235, - 0, 0, 0, 213, 0, 0, 0, 209, 0, 0, 0, 209, - 0, 0, 0, 209, 0, 0, 0, 211, 0, 0, 0, 212, - 0, 0, 0, 209, 0, 0, 0, 209, 0, 0, 0, 209, - 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, - 0, 0, 0, 235, 0, 0, 0, 230, 0, 0, 0, 229, - 0, 0, 0, 231, 0, 0, 0, 235, 0, 0, 0, 236, - 0, 0, 0, 231, 0, 0, 0, 229, 0, 0, 0, 230, - 0, 0, 0, 233, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 252, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 252, 0, 0, 0, 253, 0, 0, 0, 253, - 0, 0, 0, 252, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 168, 0, 0, 0, 162, - 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 168, 160, 160, 160, 64, 172, 172, 172, 64, - 12, 12, 12, 145, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 252, - 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 247, 0, 0, 0, 235, - 0, 0, 0, 234, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 234, 0, 0, 0, 214, - 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 168, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 112, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 100, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 157, 0, 0, 0, 144, 0, 0, 0, 130, - 0, 0, 0, 129, 0, 0, 0, 169, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 168, 160, 160, 160, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 189, 189, 189, 63, 190, 190, 190, 57, 189, 189, 189, 52, - 189, 189, 189, 52, 112, 112, 112, 57, 0, 0, 0, 213, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 162, 172, 172, 172, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 189, 189, 189, 63, 190, 190, 190, 57, 189, 189, 189, 52, - 189, 189, 189, 52, 124, 124, 124, 57, 0, 0, 0, 207, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 246, 12, 12, 12, 145, - 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 136, - 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 135, - 23, 23, 23, 98, 189, 189, 189, 63, 189, 189, 189, 63, - 44, 44, 44, 89, 23, 23, 23, 133, 23, 23, 23, 133, - 23, 23, 23, 131, 23, 23, 23, 121, 23, 23, 23, 110, - 23, 23, 23, 110, 5, 5, 5, 146, 0, 0, 0, 246, - 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, - 0, 0, 0, 147, 189, 189, 189, 58, 190, 190, 190, 57, - 23, 23, 23, 122, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 228, 0, 0, 0, 217, 0, 0, 0, 206, - 0, 0, 0, 205, 0, 0, 0, 215, 0, 0, 0, 227, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 237, - 0, 0, 0, 250, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 235, - 0, 0, 0, 135, 190, 190, 190, 52, 189, 189, 189, 52, - 23, 23, 23, 111, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 206, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 206, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 209, 0, 0, 0, 217, - 0, 0, 0, 241, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 234, - 0, 0, 0, 134, 189, 189, 189, 52, 189, 189, 189, 52, - 23, 23, 23, 110, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 206, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 208, 0, 0, 0, 216, - 0, 0, 0, 240, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, - 0, 0, 0, 146, 189, 189, 189, 57, 189, 189, 189, 57, - 23, 23, 23, 120, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 224, 0, 0, 0, 215, 0, 0, 0, 206, - 0, 0, 0, 205, 0, 0, 0, 214, 0, 0, 0, 224, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 227, 0, 0, 0, 234, - 0, 0, 0, 248, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 157, 189, 189, 189, 63, 189, 189, 189, 63, - 23, 23, 23, 133, 0, 0, 0, 250, 0, 0, 0, 250, - 0, 0, 0, 246, 0, 0, 0, 227, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 224, 0, 0, 0, 245, - 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 250, - 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 252, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 168, 160, 160, 160, 64, 172, 172, 172, 64, - 12, 12, 12, 145, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 168, 0, 0, 0, 162, - 0, 0, 0, 246, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 234, 0, 0, 0, 214, - 0, 0, 0, 212, 0, 0, 0, 231, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 247, 0, 0, 0, 235, - 0, 0, 0, 234, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 252, - 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 201, - 0, 0, 0, 201, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 192, 107, 107, 107, 67, - 107, 107, 107, 67, 0, 0, 0, 192, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 192, 107, 107, 107, 67, 190, 190, 190, 64, - 190, 190, 190, 64, 107, 107, 107, 67, 0, 0, 0, 192, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 192, - 107, 107, 107, 67, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 107, 107, 107, 67, - 0, 0, 0, 192, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 192, 107, 107, 107, 67, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 107, 107, 107, 67, 0, 0, 0, 192, 0, 0, 0, 250, - 0, 0, 0, 239, 0, 0, 0, 239, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 201, 107, 107, 107, 67, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 106, 106, 106, 65, 0, 0, 0, 184, - 0, 0, 0, 216, 0, 0, 0, 216, 0, 0, 0, 234, - 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 204, 23, 23, 23, 136, 23, 23, 23, 136, - 23, 23, 23, 136, 23, 23, 23, 100, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 100, 23, 23, 23, 135, - 23, 23, 23, 132, 23, 23, 23, 122, 0, 0, 0, 170, - 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 215, - 0, 0, 0, 234, 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 249, - 0, 0, 0, 234, 0, 0, 0, 215, 0, 0, 0, 206, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 206, - 0, 0, 0, 215, 0, 0, 0, 234, 0, 0, 0, 249, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 155, 0, 0, 0, 234, - 0, 0, 0, 215, 0, 0, 0, 206, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 206, 0, 0, 0, 215, 0, 0, 0, 234, - 0, 0, 0, 250, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 189, 189, 189, 64, 0, 0, 0, 148, 0, 0, 0, 218, - 0, 0, 0, 209, 0, 0, 0, 207, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 205, - 0, 0, 0, 207, 0, 0, 0, 209, 0, 0, 0, 218, - 0, 0, 0, 240, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 189, 189, 189, 64, 0, 0, 0, 150, 0, 0, 0, 229, - 0, 0, 0, 226, 0, 0, 0, 224, 0, 0, 0, 215, - 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 215, - 0, 0, 0, 224, 0, 0, 0, 226, 0, 0, 0, 229, - 0, 0, 0, 242, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 158, 0, 0, 0, 250, - 0, 0, 0, 250, 0, 0, 0, 246, 0, 0, 0, 227, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 227, - 0, 0, 0, 246, 0, 0, 0, 250, 0, 0, 0, 250, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 180, 68, 68, 68, 88, 71, 71, 71, 88, - 71, 71, 71, 88, 71, 71, 71, 76, 190, 190, 190, 64, - 190, 190, 190, 64, 71, 71, 71, 76, 71, 71, 71, 88, - 71, 71, 71, 88, 68, 68, 68, 87, 0, 0, 0, 160, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 225, 62, 62, 62, 82, 187, 187, 187, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 187, 187, 187, 64, 62, 62, 62, 80, 0, 0, 0, 202, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 230, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 225, 62, 62, 62, 82, - 187, 187, 187, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 187, 187, 187, 64, - 62, 62, 62, 82, 0, 0, 0, 221, 0, 0, 0, 229, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 229, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 225, - 62, 62, 62, 82, 187, 187, 187, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 186, 186, 186, 63, 61, 61, 61, 79, - 0, 0, 0, 216, 0, 0, 0, 243, 0, 0, 0, 225, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 225, - 0, 0, 0, 243, 0, 0, 0, 246, 0, 0, 0, 247, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 225, 62, 62, 62, 82, 187, 187, 187, 64, - 187, 187, 187, 63, 62, 62, 62, 76, 0, 0, 0, 197, - 0, 0, 0, 220, 0, 0, 0, 218, 0, 0, 0, 212, - 0, 0, 0, 205, 0, 0, 0, 205, 0, 0, 0, 212, - 0, 0, 0, 218, 0, 0, 0, 220, 0, 0, 0, 224, - 0, 0, 0, 240, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 225, 62, 62, 62, 82, - 62, 62, 62, 81, 0, 0, 0, 213, 0, 0, 0, 221, - 0, 0, 0, 208, 0, 0, 0, 206, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 205, - 0, 0, 0, 206, 0, 0, 0, 208, 0, 0, 0, 221, - 0, 0, 0, 242, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 234, - 0, 0, 0, 234, 0, 0, 0, 252, 0, 0, 0, 239, - 0, 0, 0, 219, 0, 0, 0, 207, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 207, 0, 0, 0, 219, 0, 0, 0, 239, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 251, - 0, 0, 0, 238, 0, 0, 0, 219, 0, 0, 0, 207, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 207, - 0, 0, 0, 219, 0, 0, 0, 238, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 238, 0, 0, 0, 219, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 219, - 0, 0, 0, 238, 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 239, - 0, 0, 0, 221, 0, 0, 0, 221, 0, 0, 0, 239, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, - 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 20, 20, 20, 148, 15, 15, 15, 160, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 28, 28, 28, 128, 7, 7, 7, 177, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 246, 34, 34, 34, 122, - 168, 168, 168, 64, 36, 36, 36, 133, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 73, 73, 73, 95, 149, 149, 149, 64, - 16, 16, 16, 152, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 236, 52, 52, 52, 103, 179, 179, 179, 64, - 190, 190, 190, 64, 36, 36, 36, 133, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 253, 0, 0, 0, 254, - 0, 0, 0, 255, 73, 73, 73, 95, 190, 190, 190, 64, - 164, 164, 164, 64, 29, 29, 29, 128, 0, 0, 0, 249, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 222, - 75, 75, 75, 87, 186, 186, 186, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 87, 87, 87, 83, 63, 63, 63, 117, - 63, 63, 63, 117, 63, 63, 63, 117, 63, 63, 63, 116, - 63, 63, 63, 111, 63, 63, 63, 109, 63, 63, 63, 115, - 63, 63, 63, 117, 112, 112, 112, 73, 190, 190, 190, 64, - 190, 190, 190, 64, 176, 176, 176, 64, 47, 47, 47, 108, - 0, 0, 0, 238, 0, 0, 0, 239, 0, 0, 0, 234, - 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 36, 36, 36, 106, - 187, 187, 187, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 63, 189, 189, 189, 59, - 189, 189, 189, 54, 189, 189, 189, 55, 189, 189, 189, 62, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 173, 173, 173, 64, - 11, 11, 11, 141, 0, 0, 0, 229, 0, 0, 0, 212, - 0, 0, 0, 225, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 234, - 56, 56, 56, 100, 181, 181, 181, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 70, 70, 70, 91, 42, 42, 42, 138, - 42, 42, 42, 133, 42, 42, 42, 122, 42, 42, 42, 113, - 42, 42, 42, 111, 42, 42, 42, 117, 42, 42, 42, 131, - 42, 42, 42, 136, 99, 99, 99, 75, 190, 190, 190, 63, - 190, 190, 190, 63, 167, 167, 167, 63, 32, 32, 32, 122, - 0, 0, 0, 241, 0, 0, 0, 226, 0, 0, 0, 207, - 0, 0, 0, 208, 0, 0, 0, 222, 0, 0, 0, 243, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 245, 37, 37, 37, 118, 170, 170, 170, 64, - 190, 190, 190, 64, 35, 35, 35, 133, 0, 0, 0, 247, - 0, 0, 0, 227, 0, 0, 0, 210, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 210, 0, 0, 0, 222, - 0, 0, 0, 226, 73, 73, 73, 84, 189, 189, 189, 57, - 151, 151, 151, 57, 18, 18, 18, 129, 0, 0, 0, 224, - 0, 0, 0, 224, 0, 0, 0, 214, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 207, 0, 0, 0, 219, - 0, 0, 0, 241, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 22, 22, 22, 141, - 156, 156, 156, 64, 36, 36, 36, 132, 0, 0, 0, 235, - 0, 0, 0, 211, 0, 0, 0, 205, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 205, 0, 0, 0, 206, - 0, 0, 0, 206, 73, 73, 73, 77, 131, 131, 131, 54, - 8, 8, 8, 140, 0, 0, 0, 206, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 205, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 207, - 0, 0, 0, 225, 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 10, 10, 10, 170, 11, 11, 11, 173, 0, 0, 0, 245, - 0, 0, 0, 224, 0, 0, 0, 209, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 209, 0, 0, 0, 219, - 0, 0, 0, 222, 20, 20, 20, 129, 2, 2, 2, 173, - 0, 0, 0, 222, 0, 0, 0, 222, 0, 0, 0, 222, - 0, 0, 0, 221, 0, 0, 0, 212, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 206, 0, 0, 0, 217, - 0, 0, 0, 238, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 247, 0, 0, 0, 227, 0, 0, 0, 210, - 0, 0, 0, 205, 0, 0, 0, 216, 0, 0, 0, 242, - 0, 0, 0, 250, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 247, 0, 0, 0, 226, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 220, 0, 0, 0, 241, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 231, - 0, 0, 0, 213, 0, 0, 0, 218, 0, 0, 0, 246, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 228, 0, 0, 0, 211, - 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, - 0, 0, 0, 236, 0, 0, 0, 231, 0, 0, 0, 249, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 237, 0, 0, 0, 231, - 0, 0, 0, 246, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 252, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 180, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 171, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 180, 139, 139, 139, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 157, 157, 157, 64, 5, 5, 5, 157, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 171, 157, 157, 157, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 172, 172, 172, 64, 8, 8, 8, 148, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 5, 5, 5, 157, - 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 136, - 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 135, - 23, 23, 23, 134, 23, 23, 23, 133, 23, 23, 23, 133, - 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, - 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, - 23, 23, 23, 133, 9, 9, 9, 144, 0, 0, 0, 242, - 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 252, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 248, - 0, 0, 0, 236, 0, 0, 0, 194, 0, 0, 0, 173, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 235, - 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 236, - 0, 0, 0, 178, 83, 83, 83, 60, 127, 127, 127, 52, - 3, 3, 3, 140, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 213, - 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 195, - 83, 83, 83, 61, 189, 189, 189, 52, 189, 189, 189, 52, - 127, 127, 127, 52, 3, 3, 3, 139, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 212, - 0, 0, 0, 232, 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 210, 82, 82, 82, 71, - 190, 190, 190, 58, 189, 189, 189, 57, 189, 189, 189, 57, - 189, 189, 189, 57, 127, 127, 127, 57, 2, 2, 2, 150, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 224, - 0, 0, 0, 224, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 227, 0, 0, 0, 231, - 0, 0, 0, 245, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 210, 83, 83, 83, 73, 190, 190, 190, 64, - 189, 189, 189, 63, 186, 186, 186, 63, 189, 189, 189, 63, - 186, 186, 186, 63, 189, 189, 189, 63, 127, 127, 127, 63, - 3, 3, 3, 167, 0, 0, 0, 245, 0, 0, 0, 235, - 0, 0, 0, 233, 0, 0, 0, 243, 0, 0, 0, 249, - 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 250, - 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 251, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 210, - 83, 83, 83, 73, 190, 190, 190, 64, 190, 190, 190, 64, - 83, 83, 83, 64, 166, 166, 166, 64, 190, 190, 190, 64, - 68, 68, 68, 64, 181, 181, 181, 64, 190, 190, 190, 64, - 127, 127, 127, 63, 3, 3, 3, 158, 0, 0, 0, 218, - 0, 0, 0, 215, 0, 0, 0, 231, 0, 0, 0, 248, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 210, 83, 83, 83, 73, - 190, 190, 190, 64, 190, 190, 190, 64, 83, 83, 83, 73, - 0, 0, 0, 139, 166, 166, 166, 64, 190, 190, 190, 64, - 23, 23, 23, 118, 44, 44, 44, 94, 180, 180, 180, 63, - 189, 189, 189, 59, 127, 127, 127, 54, 3, 3, 3, 139, - 0, 0, 0, 206, 0, 0, 0, 213, 0, 0, 0, 231, - 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 210, 83, 83, 83, 73, 190, 190, 190, 64, - 190, 190, 190, 64, 83, 83, 83, 73, 0, 0, 0, 210, - 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, - 23, 23, 23, 135, 0, 0, 0, 233, 44, 44, 44, 87, - 181, 181, 181, 54, 189, 189, 189, 52, 127, 127, 127, 51, - 2, 2, 2, 137, 0, 0, 0, 205, 0, 0, 0, 213, - 0, 0, 0, 231, 0, 0, 0, 248, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 213, - 83, 83, 83, 73, 190, 190, 190, 64, 190, 190, 190, 64, - 83, 83, 83, 73, 0, 0, 0, 210, 0, 0, 0, 255, - 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, - 24, 24, 24, 132, 0, 0, 0, 236, 0, 0, 0, 202, - 44, 44, 44, 76, 180, 180, 180, 51, 189, 189, 189, 51, - 127, 127, 127, 51, 3, 3, 3, 139, 0, 0, 0, 205, - 0, 0, 0, 213, 0, 0, 0, 231, 0, 0, 0, 248, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 189, - 127, 127, 127, 64, 190, 190, 190, 64, 83, 83, 83, 73, - 0, 0, 0, 210, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 183, 166, 166, 166, 64, 189, 189, 189, 63, - 23, 23, 23, 124, 0, 0, 0, 217, 0, 0, 0, 207, - 0, 0, 0, 191, 44, 44, 44, 76, 180, 180, 180, 51, - 160, 160, 160, 51, 14, 14, 14, 115, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 213, 0, 0, 0, 231, - 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 2, 2, 2, 171, 56, 56, 56, 73, 0, 0, 0, 210, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 183, 165, 165, 165, 63, 189, 189, 189, 59, - 23, 23, 23, 114, 0, 0, 0, 207, 0, 0, 0, 206, - 0, 0, 0, 214, 0, 0, 0, 202, 41, 41, 41, 77, - 17, 17, 17, 102, 0, 0, 0, 212, 0, 0, 0, 216, - 0, 0, 0, 208, 0, 0, 0, 206, 0, 0, 0, 213, - 0, 0, 0, 231, 0, 0, 0, 248, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 181, 166, 166, 166, 59, 190, 190, 190, 54, - 23, 23, 23, 109, 0, 0, 0, 207, 0, 0, 0, 217, - 0, 0, 0, 233, 0, 0, 0, 229, 0, 0, 0, 209, - 0, 0, 0, 207, 0, 0, 0, 223, 0, 0, 0, 235, - 0, 0, 0, 221, 0, 0, 0, 208, 0, 0, 0, 206, - 0, 0, 0, 213, 0, 0, 0, 231, 0, 0, 0, 248, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 175, 165, 165, 165, 55, 189, 189, 189, 52, - 23, 23, 23, 110, 0, 0, 0, 217, 0, 0, 0, 236, - 0, 0, 0, 248, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 247, - 0, 0, 0, 240, 0, 0, 0, 221, 0, 0, 0, 208, - 0, 0, 0, 206, 0, 0, 0, 214, 0, 0, 0, 235, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 173, 166, 166, 166, 54, 189, 189, 189, 52, - 23, 23, 23, 117, 0, 0, 0, 236, 0, 0, 0, 250, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 249, - 0, 0, 0, 252, 0, 0, 0, 241, 0, 0, 0, 221, - 0, 0, 0, 209, 0, 0, 0, 212, 0, 0, 0, 232, - 0, 0, 0, 251, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 180, 166, 166, 166, 58, 189, 189, 189, 56, - 24, 24, 24, 127, 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 241, - 0, 0, 0, 226, 0, 0, 0, 229, 0, 0, 0, 245, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 183, 165, 165, 165, 63, 189, 189, 189, 62, - 23, 23, 23, 134, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 248, 0, 0, 0, 249, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 183, 166, 166, 166, 64, 190, 190, 190, 64, - 23, 23, 23, 136, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 228, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 204, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 233, 0, 0, 0, 210, - 0, 0, 0, 207, 0, 0, 0, 226, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 235, 0, 0, 0, 213, - 0, 0, 0, 211, 0, 0, 0, 229, 0, 0, 0, 250, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 245, 0, 0, 0, 233, - 0, 0, 0, 231, 0, 0, 0, 241, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 252, - 0, 0, 0, 252, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 207, - 0, 0, 0, 164, 0, 0, 0, 164, 0, 0, 0, 230, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 185, 185, 185, 64, 161, 161, 161, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, - 0, 0, 0, 240, 0, 0, 0, 229, 0, 0, 0, 231, - 0, 0, 0, 244, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, - 0, 0, 0, 228, 0, 0, 0, 210, 0, 0, 0, 213, - 0, 0, 0, 235, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, - 0, 0, 0, 226, 0, 0, 0, 207, 0, 0, 0, 210, - 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, - 0, 0, 0, 226, 0, 0, 0, 207, 0, 0, 0, 210, - 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 13, 13, 13, 137, - 35, 35, 35, 104, 0, 0, 0, 241, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, - 0, 0, 0, 193, 47, 47, 47, 67, 1, 1, 1, 149, - 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 12, 12, 12, 148, 153, 153, 153, 64, - 177, 177, 177, 64, 37, 37, 37, 101, 0, 0, 0, 241, - 0, 0, 0, 255, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 213, - 73, 73, 73, 69, 187, 187, 187, 52, 117, 117, 117, 54, - 0, 0, 0, 180, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 5, 5, 5, 166, 136, 136, 136, 64, - 190, 190, 190, 64, 176, 176, 176, 64, 37, 37, 37, 101, - 0, 0, 0, 242, 0, 0, 0, 255, 23, 23, 23, 136, - 190, 190, 190, 64, 166, 166, 166, 64, 0, 0, 0, 183, - 0, 0, 0, 255, 0, 0, 0, 218, 72, 72, 72, 76, - 187, 187, 187, 57, 189, 189, 189, 52, 94, 94, 94, 58, - 0, 0, 0, 191, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 6, 6, 6, 159, - 137, 137, 137, 64, 190, 190, 190, 64, 176, 176, 176, 64, - 36, 36, 36, 101, 0, 0, 0, 242, 23, 23, 23, 135, - 189, 189, 189, 62, 165, 165, 165, 62, 0, 0, 0, 182, - 0, 0, 0, 218, 73, 73, 73, 77, 188, 188, 188, 63, - 189, 189, 189, 57, 95, 95, 95, 56, 0, 0, 0, 166, - 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 6, 6, 6, 159, 137, 137, 137, 64, 190, 190, 190, 64, - 176, 176, 176, 64, 36, 36, 36, 101, 23, 23, 23, 119, - 189, 189, 189, 57, 166, 166, 166, 56, 0, 0, 0, 140, - 71, 71, 71, 77, 188, 188, 188, 64, 189, 189, 189, 63, - 96, 96, 96, 61, 0, 0, 0, 162, 0, 0, 0, 210, - 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 6, 6, 6, 158, 138, 138, 138, 64, - 190, 190, 190, 64, 176, 176, 176, 63, 60, 60, 60, 58, - 190, 190, 190, 53, 166, 166, 166, 52, 71, 71, 71, 55, - 188, 188, 188, 60, 189, 189, 189, 63, 96, 96, 96, 68, - 0, 0, 0, 176, 0, 0, 0, 207, 0, 0, 0, 210, - 0, 0, 0, 233, 0, 0, 0, 252, 0, 0, 0, 250, - 0, 0, 0, 235, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 6, 6, 6, 157, - 138, 138, 138, 64, 189, 189, 189, 63, 182, 182, 182, 59, - 190, 190, 190, 54, 185, 185, 185, 51, 187, 187, 187, 52, - 189, 189, 189, 55, 97, 97, 97, 65, 0, 0, 0, 192, - 0, 0, 0, 226, 0, 0, 0, 207, 0, 0, 0, 210, - 0, 0, 0, 233, 0, 0, 0, 247, 0, 0, 0, 235, - 0, 0, 0, 216, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 6, 6, 6, 157, 138, 138, 138, 64, 189, 189, 189, 62, - 190, 190, 190, 58, 189, 189, 189, 54, 189, 189, 189, 51, - 97, 97, 97, 56, 0, 0, 0, 172, 0, 0, 0, 234, - 0, 0, 0, 223, 0, 0, 0, 207, 0, 0, 0, 209, - 0, 0, 0, 228, 0, 0, 0, 232, 0, 0, 0, 216, - 0, 0, 0, 206, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 6, 6, 6, 156, 139, 139, 139, 64, - 189, 189, 189, 62, 190, 190, 190, 58, 98, 98, 98, 58, - 0, 0, 0, 160, 0, 0, 0, 208, 0, 0, 0, 216, - 0, 0, 0, 214, 0, 0, 0, 206, 0, 0, 0, 207, - 0, 0, 0, 216, 0, 0, 0, 214, 0, 0, 0, 206, - 0, 0, 0, 207, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 7, 7, 7, 155, - 139, 139, 139, 64, 99, 99, 99, 67, 0, 0, 0, 180, - 0, 0, 0, 214, 0, 0, 0, 206, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 204, 0, 0, 0, 205, - 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 207, - 0, 0, 0, 217, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 4, 4, 4, 172, 0, 0, 0, 200, 0, 0, 0, 248, - 0, 0, 0, 232, 0, 0, 0, 214, 0, 0, 0, 206, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 204, 0, 0, 0, 207, 0, 0, 0, 217, - 0, 0, 0, 237, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 2, 2, 2, 165, 5, 5, 5, 153, - 5, 5, 5, 153, 5, 5, 5, 153, 5, 5, 5, 153, - 5, 5, 5, 153, 5, 5, 5, 153, 5, 5, 5, 153, - 5, 5, 5, 153, 5, 5, 5, 153, 5, 5, 5, 153, - 5, 5, 5, 148, 5, 5, 5, 137, 6, 6, 6, 127, - 6, 6, 6, 123, 5, 5, 5, 122, 5, 5, 5, 122, - 1, 1, 1, 141, 0, 0, 0, 217, 0, 0, 0, 237, - 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 6, 6, 6, 154, 161, 161, 161, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 62, 190, 190, 190, 58, - 189, 189, 189, 54, 189, 189, 189, 51, 189, 189, 189, 52, - 143, 143, 143, 54, 0, 0, 0, 167, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 8, 8, 8, 149, 169, 169, 169, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 62, - 190, 190, 190, 58, 190, 190, 190, 54, 189, 189, 189, 55, - 153, 153, 153, 59, 0, 0, 0, 171, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 247, 7, 7, 7, 152, 19, 19, 19, 140, - 19, 19, 19, 140, 19, 19, 19, 140, 19, 19, 19, 140, - 19, 19, 19, 140, 19, 19, 19, 139, 19, 19, 19, 137, - 19, 19, 19, 136, 19, 19, 19, 136, 19, 19, 19, 136, - 19, 19, 19, 136, 19, 19, 19, 135, 19, 19, 19, 135, - 19, 19, 19, 133, 19, 19, 19, 129, 19, 19, 19, 130, - 4, 4, 4, 154, 0, 0, 0, 247, 0, 0, 0, 250, - 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 245, 0, 0, 0, 231, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 225, 0, 0, 0, 223, 0, 0, 0, 224, - 0, 0, 0, 225, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 251, 0, 0, 0, 232, 0, 0, 0, 212, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 231, - 0, 0, 0, 228, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 204, 92, 92, 92, 68, - 106, 106, 106, 65, 0, 0, 0, 188, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 224, 0, 0, 0, 213, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 212, 79, 79, 79, 77, 105, 105, 105, 68, - 1, 1, 1, 191, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 253, 0, 0, 0, 205, - 88, 88, 88, 73, 189, 189, 189, 64, 188, 188, 188, 64, - 45, 45, 45, 85, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 250, - 0, 0, 0, 239, 0, 0, 0, 184, 98, 98, 98, 68, - 189, 189, 189, 64, 187, 187, 187, 64, 68, 68, 68, 82, - 0, 0, 0, 220, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 253, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 238, - 1, 1, 1, 162, 108, 108, 108, 57, 190, 190, 190, 58, - 184, 184, 184, 63, 60, 60, 60, 86, 0, 0, 0, 226, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 239, - 0, 0, 0, 235, 0, 0, 0, 247, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 2, 2, 2, 166, - 117, 117, 117, 54, 189, 189, 189, 52, 181, 181, 181, 56, - 52, 52, 52, 90, 0, 0, 0, 231, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 249, 0, 0, 0, 234, 0, 0, 0, 216, - 0, 0, 0, 213, 0, 0, 0, 229, 0, 0, 0, 249, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 3, 3, 3, 170, 126, 126, 126, 59, - 190, 190, 190, 52, 178, 178, 178, 52, 44, 44, 44, 86, - 0, 0, 0, 231, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 249, - 0, 0, 0, 233, 0, 0, 0, 214, 0, 0, 0, 206, - 0, 0, 0, 208, 0, 0, 0, 225, 0, 0, 0, 247, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 6, 6, 6, 161, 135, 135, 135, 63, 190, 190, 190, 58, - 185, 185, 185, 52, 70, 70, 70, 52, 33, 33, 33, 104, - 33, 33, 33, 128, 33, 33, 33, 132, 33, 33, 33, 132, - 32, 32, 32, 131, 32, 32, 32, 129, 32, 32, 32, 121, - 32, 32, 32, 112, 33, 33, 33, 106, 32, 32, 32, 107, - 32, 32, 32, 112, 30, 30, 30, 123, 0, 0, 0, 209, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 178, - 140, 140, 140, 64, 190, 190, 190, 63, 190, 190, 190, 58, - 190, 190, 190, 52, 189, 189, 189, 52, 189, 189, 189, 56, - 189, 189, 189, 62, 190, 190, 190, 64, 190, 190, 190, 64, - 189, 189, 189, 62, 189, 189, 189, 58, 190, 190, 190, 53, - 189, 189, 189, 51, 189, 189, 189, 52, 189, 189, 189, 56, - 190, 190, 190, 60, 175, 175, 175, 63, 0, 0, 0, 174, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 224, - 64, 64, 64, 84, 186, 186, 186, 63, 190, 190, 190, 58, - 185, 185, 185, 52, 136, 136, 136, 52, 136, 136, 136, 56, - 135, 135, 135, 62, 135, 135, 135, 64, 135, 135, 135, 62, - 135, 135, 135, 58, 135, 135, 135, 53, 135, 135, 135, 51, - 135, 135, 135, 52, 135, 135, 135, 56, 135, 135, 135, 61, - 135, 135, 135, 63, 125, 125, 125, 64, 0, 0, 0, 175, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 229, 56, 56, 56, 88, 183, 183, 183, 58, - 190, 190, 190, 52, 112, 112, 112, 52, 1, 1, 1, 132, - 0, 0, 0, 212, 0, 0, 0, 211, 0, 0, 0, 195, - 0, 0, 0, 181, 0, 0, 0, 176, 0, 0, 0, 177, - 0, 0, 0, 186, 0, 0, 0, 201, 0, 0, 0, 209, - 0, 0, 0, 210, 0, 0, 0, 211, 0, 0, 0, 238, - 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 246, - 0, 0, 0, 246, 0, 0, 0, 247, 0, 0, 0, 247, - 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 232, 47, 47, 47, 87, - 180, 180, 180, 52, 189, 189, 189, 52, 122, 122, 122, 57, - 3, 3, 3, 166, 0, 0, 0, 227, 0, 0, 0, 211, - 0, 0, 0, 205, 0, 0, 0, 204, 0, 0, 0, 205, - 0, 0, 0, 211, 0, 0, 0, 217, 0, 0, 0, 219, - 0, 0, 0, 219, 0, 0, 0, 219, 0, 0, 0, 219, - 0, 0, 0, 219, 0, 0, 0, 219, 0, 0, 0, 219, - 0, 0, 0, 219, 0, 0, 0, 219, 0, 0, 0, 222, - 0, 0, 0, 237, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 218, - 40, 40, 40, 83, 176, 176, 176, 52, 189, 189, 189, 56, - 130, 130, 130, 59, 5, 5, 5, 139, 0, 0, 0, 205, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 205, 0, 0, 0, 206, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 209, - 0, 0, 0, 230, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, - 0, 0, 0, 199, 34, 34, 34, 86, 172, 172, 172, 56, - 189, 189, 189, 60, 137, 137, 137, 57, 8, 8, 8, 127, - 0, 0, 0, 204, 0, 0, 0, 204, 0, 0, 0, 205, - 0, 0, 0, 210, 0, 0, 0, 215, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 217, - 0, 0, 0, 217, 0, 0, 0, 217, 0, 0, 0, 220, - 0, 0, 0, 236, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, - 0, 0, 0, 209, 0, 0, 0, 199, 28, 28, 28, 99, - 168, 168, 168, 62, 190, 190, 190, 61, 145, 145, 145, 57, - 11, 11, 11, 120, 0, 0, 0, 205, 0, 0, 0, 206, - 0, 0, 0, 217, 0, 0, 0, 234, 0, 0, 0, 242, - 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 244, - 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 244, - 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 245, - 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 158, 190, 190, 190, 64, - 190, 190, 190, 64, 20, 20, 20, 139, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, - 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 218, - 23, 23, 23, 118, 162, 162, 162, 64, 175, 175, 175, 62, - 35, 35, 35, 94, 0, 0, 0, 211, 0, 0, 0, 205, - 0, 0, 0, 209, 0, 0, 0, 224, 0, 0, 0, 243, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 1, 1, 1, 160, 181, 181, 181, 64, - 187, 187, 187, 64, 14, 14, 14, 141, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, - 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 224, - 0, 0, 0, 245, 19, 19, 19, 133, 32, 32, 32, 113, - 0, 0, 0, 235, 0, 0, 0, 229, 0, 0, 0, 212, - 0, 0, 0, 206, 0, 0, 0, 209, 0, 0, 0, 224, - 0, 0, 0, 243, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 235, 36, 36, 36, 110, - 43, 43, 43, 103, 0, 0, 0, 225, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, - 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 224, - 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 247, 0, 0, 0, 230, - 0, 0, 0, 212, 0, 0, 0, 206, 0, 0, 0, 209, - 0, 0, 0, 223, 0, 0, 0, 242, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 232, - 0, 0, 0, 209, 0, 0, 0, 206, 0, 0, 0, 224, - 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 248, - 0, 0, 0, 231, 0, 0, 0, 213, 0, 0, 0, 206, - 0, 0, 0, 209, 0, 0, 0, 226, 0, 0, 0, 248, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 233, - 0, 0, 0, 209, 0, 0, 0, 207, 0, 0, 0, 224, - 0, 0, 0, 249, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 248, 0, 0, 0, 232, 0, 0, 0, 214, - 0, 0, 0, 211, 0, 0, 0, 228, 0, 0, 0, 248, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 236, - 0, 0, 0, 214, 0, 0, 0, 210, 0, 0, 0, 229, - 0, 0, 0, 250, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 236, - 0, 0, 0, 233, 0, 0, 0, 245, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 247, - 0, 0, 0, 234, 0, 0, 0, 231, 0, 0, 0, 243, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 173, - 0, 0, 0, 182, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 191, 0, 0, 0, 215, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 5, 5, 5, 158, 155, 155, 155, 64, - 137, 137, 137, 64, 0, 0, 0, 181, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 2, 2, 2, 174, - 125, 125, 125, 64, 80, 80, 80, 74, 0, 0, 0, 212, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 57, 57, 57, 72, - 190, 190, 190, 64, 189, 189, 189, 64, 79, 79, 79, 74, - 0, 0, 0, 213, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 207, - 87, 87, 87, 72, 190, 190, 190, 64, 189, 189, 189, 64, - 79, 79, 79, 74, 0, 0, 0, 213, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 252, 0, 0, 0, 253, - 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 207, 87, 87, 87, 72, 190, 190, 190, 64, - 189, 189, 189, 64, 78, 78, 78, 75, 0, 0, 0, 213, - 0, 0, 0, 247, 0, 0, 0, 236, 0, 0, 0, 238, - 0, 0, 0, 250, 23, 23, 23, 135, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 160, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 206, 89, 89, 89, 71, - 190, 190, 190, 64, 189, 189, 189, 64, 78, 78, 78, 73, - 0, 0, 0, 193, 0, 0, 0, 214, 0, 0, 0, 216, - 0, 0, 0, 234, 23, 23, 23, 132, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 206, - 89, 89, 89, 71, 190, 190, 190, 64, 189, 189, 189, 62, - 77, 77, 77, 66, 0, 0, 0, 174, 0, 0, 0, 206, - 0, 0, 0, 215, 23, 23, 23, 123, 189, 189, 189, 63, - 190, 190, 190, 64, 0, 0, 0, 160, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 232, 0, 0, 0, 190, 0, 0, 0, 190, - 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, - 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, - 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, - 0, 0, 0, 141, 90, 90, 90, 64, 190, 190, 190, 63, - 188, 188, 188, 60, 76, 76, 76, 64, 0, 0, 0, 174, - 0, 0, 0, 206, 23, 23, 23, 113, 189, 189, 189, 59, - 189, 189, 189, 63, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 160, 158, 158, 158, 64, 158, 158, 158, 64, - 158, 158, 158, 64, 158, 158, 158, 64, 158, 158, 158, 64, - 158, 158, 158, 64, 158, 158, 158, 64, 158, 158, 158, 64, - 158, 158, 158, 64, 158, 158, 158, 64, 158, 158, 158, 64, - 158, 158, 158, 64, 158, 158, 158, 64, 187, 187, 187, 64, - 189, 189, 189, 63, 188, 188, 188, 60, 76, 76, 76, 64, - 0, 0, 0, 176, 23, 23, 23, 109, 190, 190, 190, 54, - 189, 189, 189, 59, 0, 0, 0, 157, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 63, 132, 132, 132, 60, - 0, 0, 0, 158, 23, 23, 23, 110, 189, 189, 189, 52, - 190, 190, 190, 54, 0, 0, 0, 149, 0, 0, 0, 250, - 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 200, 32, 32, 32, 127, 32, 32, 32, 127, - 32, 32, 32, 127, 32, 32, 32, 127, 32, 32, 32, 127, - 32, 32, 32, 126, 32, 32, 32, 126, 32, 32, 32, 124, - 32, 32, 32, 124, 32, 32, 32, 124, 32, 32, 32, 124, - 32, 32, 32, 110, 71, 71, 71, 63, 187, 187, 187, 63, - 189, 189, 189, 63, 134, 134, 134, 63, 4, 4, 4, 157, - 0, 0, 0, 234, 23, 23, 23, 116, 189, 189, 189, 51, - 189, 189, 189, 52, 0, 0, 0, 136, 0, 0, 0, 235, - 0, 0, 0, 250, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 244, 0, 0, 0, 233, - 0, 0, 0, 231, 0, 0, 0, 231, 0, 0, 0, 219, - 38, 38, 38, 92, 176, 176, 176, 58, 190, 190, 190, 58, - 134, 134, 134, 58, 5, 5, 5, 145, 0, 0, 0, 231, - 0, 0, 0, 227, 23, 23, 23, 116, 189, 189, 189, 52, - 189, 189, 189, 51, 0, 0, 0, 129, 0, 0, 0, 216, - 0, 0, 0, 234, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 232, 0, 0, 0, 212, - 0, 0, 0, 209, 0, 0, 0, 197, 37, 37, 37, 82, - 177, 177, 177, 52, 190, 190, 190, 52, 135, 135, 135, 52, - 5, 5, 5, 131, 0, 0, 0, 209, 0, 0, 0, 209, - 0, 0, 0, 208, 23, 23, 23, 110, 189, 189, 189, 51, - 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 206, - 0, 0, 0, 217, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 232, 0, 0, 0, 211, - 0, 0, 0, 196, 37, 37, 37, 81, 176, 176, 176, 52, - 189, 189, 189, 52, 135, 135, 135, 52, 5, 5, 5, 131, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 207, 23, 23, 23, 110, 189, 189, 189, 51, - 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 206, - 0, 0, 0, 216, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 242, 0, 0, 0, 218, - 36, 36, 36, 89, 177, 177, 177, 57, 190, 190, 190, 57, - 136, 136, 136, 57, 5, 5, 5, 145, 0, 0, 0, 228, - 0, 0, 0, 228, 0, 0, 0, 228, 0, 0, 0, 228, - 0, 0, 0, 225, 24, 24, 24, 115, 189, 189, 189, 52, - 189, 189, 189, 51, 0, 0, 0, 129, 0, 0, 0, 214, - 0, 0, 0, 232, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 35, 35, 35, 99, - 176, 176, 176, 63, 189, 189, 189, 63, 136, 136, 136, 63, - 6, 6, 6, 157, 0, 0, 0, 250, 0, 0, 0, 250, - 0, 0, 0, 250, 0, 0, 0, 250, 0, 0, 0, 247, - 0, 0, 0, 235, 23, 23, 23, 116, 189, 189, 189, 51, - 189, 189, 189, 51, 0, 0, 0, 135, 0, 0, 0, 232, - 0, 0, 0, 248, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 24, 24, 24, 117, - 167, 167, 167, 64, 137, 137, 137, 64, 6, 6, 6, 159, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 239, - 0, 0, 0, 220, 23, 23, 23, 111, 189, 189, 189, 51, - 189, 189, 189, 54, 0, 0, 0, 147, 0, 0, 0, 249, - 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, - 21, 21, 21, 128, 6, 6, 6, 161, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 240, 0, 0, 0, 220, - 0, 0, 0, 208, 10, 10, 10, 116, 176, 176, 176, 54, - 163, 163, 163, 58, 0, 0, 0, 165, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 240, 0, 0, 0, 220, 0, 0, 0, 208, - 0, 0, 0, 206, 0, 0, 0, 202, 17, 17, 17, 123, - 13, 13, 13, 140, 0, 0, 0, 248, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 248, - 0, 0, 0, 226, 0, 0, 0, 208, 0, 0, 0, 206, - 0, 0, 0, 214, 0, 0, 0, 232, 0, 0, 0, 248, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, - 0, 0, 0, 229, 0, 0, 0, 212, 0, 0, 0, 214, - 0, 0, 0, 232, 0, 0, 0, 248, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 246, 0, 0, 0, 233, 0, 0, 0, 236, - 0, 0, 0, 249, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 251, 0, 0, 0, 252, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 180, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 159, 0, 0, 0, 159, - 0, 0, 0, 159, 0, 0, 0, 168, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 177, 142, 142, 142, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 160, 160, 160, 64, 0, 0, 0, 168, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 172, 172, 172, 64, 0, 0, 0, 162, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 44, 44, 44, 91, 23, 23, 23, 136, - 23, 23, 23, 136, 23, 23, 23, 136, 23, 23, 23, 135, - 23, 23, 23, 134, 23, 23, 23, 133, 23, 23, 23, 133, - 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, - 23, 23, 23, 133, 23, 23, 23, 133, 23, 23, 23, 133, - 23, 23, 23, 133, 12, 12, 12, 141, 0, 0, 0, 242, - 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 252, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 248, - 0, 0, 0, 236, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 234, - 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 216, 0, 0, 0, 158, 0, 0, 0, 148, - 0, 0, 0, 135, 0, 0, 0, 131, 0, 0, 0, 131, - 0, 0, 0, 131, 0, 0, 0, 131, 0, 0, 0, 131, - 0, 0, 0, 131, 0, 0, 0, 131, 0, 0, 0, 131, - 0, 0, 0, 131, 0, 0, 0, 177, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 214, - 0, 0, 0, 235, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 189, 189, 189, 58, - 190, 190, 190, 52, 189, 189, 189, 51, 189, 189, 189, 51, - 189, 189, 189, 52, 189, 189, 189, 52, 189, 189, 189, 52, - 189, 189, 189, 52, 189, 189, 189, 52, 189, 189, 189, 52, - 189, 189, 189, 52, 0, 0, 0, 129, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 212, - 0, 0, 0, 234, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 189, 189, 189, 52, 189, 189, 189, 51, 189, 189, 189, 54, - 189, 189, 189, 56, 189, 189, 189, 57, 189, 189, 189, 57, - 189, 189, 189, 57, 189, 189, 189, 57, 189, 189, 189, 57, - 189, 189, 189, 57, 0, 0, 0, 141, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 231, - 0, 0, 0, 245, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 189, 189, 189, 52, 171, 171, 171, 52, 29, 29, 29, 59, - 0, 0, 0, 146, 0, 0, 0, 156, 0, 0, 0, 154, - 0, 0, 0, 154, 0, 0, 0, 154, 0, 0, 0, 154, - 0, 0, 0, 154, 0, 0, 0, 209, 0, 0, 0, 246, - 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 246, - 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 249, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 172, 172, 172, 52, 189, 189, 189, 52, 171, 171, 171, 57, - 29, 29, 29, 106, 0, 0, 0, 234, 0, 0, 0, 232, - 0, 0, 0, 230, 0, 0, 0, 229, 0, 0, 0, 229, - 0, 0, 0, 229, 0, 0, 0, 229, 0, 0, 0, 229, - 0, 0, 0, 229, 0, 0, 0, 229, 0, 0, 0, 229, - 0, 0, 0, 230, 0, 0, 0, 232, 0, 0, 0, 243, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 29, 29, 29, 55, 171, 171, 171, 52, 189, 189, 189, 57, - 171, 171, 171, 62, 29, 29, 29, 98, 0, 0, 0, 204, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 212, 0, 0, 0, 232, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 0, 0, 0, 122, 29, 29, 29, 88, 171, 171, 171, 57, - 189, 189, 189, 62, 172, 172, 172, 57, 30, 30, 30, 88, - 0, 0, 0, 197, 0, 0, 0, 204, 0, 0, 0, 204, - 0, 0, 0, 205, 0, 0, 0, 207, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 212, 0, 0, 0, 232, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 0, 0, 0, 129, 0, 0, 0, 200, 29, 29, 29, 95, - 171, 171, 171, 62, 190, 190, 190, 57, 172, 172, 172, 52, - 29, 29, 29, 87, 0, 0, 0, 197, 0, 0, 0, 204, - 0, 0, 0, 208, 0, 0, 0, 219, 0, 0, 0, 228, - 0, 0, 0, 230, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 230, 0, 0, 0, 232, 0, 0, 0, 243, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 218, - 29, 29, 29, 105, 172, 172, 172, 57, 189, 189, 189, 52, - 172, 172, 172, 51, 29, 29, 29, 87, 0, 0, 0, 197, - 0, 0, 0, 207, 0, 0, 0, 220, 0, 0, 0, 239, - 0, 0, 0, 249, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 251, 0, 0, 0, 252, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 237, 29, 29, 29, 99, 172, 172, 172, 52, - 189, 189, 189, 51, 172, 172, 172, 52, 29, 29, 29, 88, - 0, 0, 0, 198, 0, 0, 0, 209, 0, 0, 0, 223, - 0, 0, 0, 243, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 246, 0, 0, 0, 222, 29, 29, 29, 89, - 172, 172, 172, 52, 189, 189, 189, 55, 171, 171, 171, 55, - 30, 30, 30, 88, 0, 0, 0, 198, 0, 0, 0, 209, - 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 201, - 30, 30, 30, 88, 171, 171, 171, 57, 189, 189, 189, 60, - 163, 163, 163, 56, 3, 3, 3, 120, 0, 0, 0, 205, - 0, 0, 0, 209, 0, 0, 0, 223, 0, 0, 0, 243, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 23, 23, 23, 136, 0, 0, 0, 255, - 0, 0, 0, 159, 189, 189, 189, 63, 190, 190, 190, 57, - 0, 0, 0, 129, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 208, - 0, 0, 0, 201, 29, 29, 29, 96, 163, 163, 163, 62, - 44, 44, 44, 89, 0, 0, 0, 208, 0, 0, 0, 209, - 0, 0, 0, 205, 0, 0, 0, 209, 0, 0, 0, 223, - 0, 0, 0, 243, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 162, 172, 172, 172, 64, - 181, 181, 181, 64, 14, 14, 14, 139, 0, 0, 0, 255, - 0, 0, 0, 216, 0, 0, 0, 157, 0, 0, 0, 144, - 0, 0, 0, 176, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 221, 3, 3, 3, 145, - 0, 0, 0, 235, 0, 0, 0, 243, 0, 0, 0, 223, - 0, 0, 0, 209, 0, 0, 0, 205, 0, 0, 0, 209, - 0, 0, 0, 223, 0, 0, 0, 243, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 246, 12, 12, 12, 145, - 14, 14, 14, 139, 0, 0, 0, 237, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, - 0, 0, 0, 208, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 246, 0, 0, 0, 229, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 230, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 243, - 0, 0, 0, 223, 0, 0, 0, 209, 0, 0, 0, 205, - 0, 0, 0, 209, 0, 0, 0, 224, 0, 0, 0, 244, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, - 0, 0, 0, 208, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 246, 0, 0, 0, 230, 0, 0, 0, 208, - 0, 0, 0, 208, 0, 0, 0, 230, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 243, 0, 0, 0, 223, 0, 0, 0, 209, - 0, 0, 0, 205, 0, 0, 0, 213, 0, 0, 0, 235, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 230, - 0, 0, 0, 208, 0, 0, 0, 207, 0, 0, 0, 226, - 0, 0, 0, 246, 0, 0, 0, 232, 0, 0, 0, 212, - 0, 0, 0, 212, 0, 0, 0, 232, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 243, 0, 0, 0, 224, - 0, 0, 0, 213, 0, 0, 0, 222, 0, 0, 0, 242, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 233, - 0, 0, 0, 212, 0, 0, 0, 211, 0, 0, 0, 230, - 0, 0, 0, 249, 0, 0, 0, 243, 0, 0, 0, 232, - 0, 0, 0, 232, 0, 0, 0, 243, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 244, - 0, 0, 0, 235, 0, 0, 0, 242, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, - 0, 0, 0, 232, 0, 0, 0, 230, 0, 0, 0, 243, - 0, 0, 0, 253, 0, 0, 0, 253, 0, 0, 0, 252, - 0, 0, 0, 252, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 252, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 251, 0, 0, 0, 251, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 242, 2, 2, 2, 158, 3, 3, 3, 156, - 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, - 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, - 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, - 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, - 3, 3, 3, 156, 3, 3, 3, 156, 3, 3, 3, 156, - 1, 1, 1, 183, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 16, 16, 16, 137, 176, 176, 176, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 128, 128, 128, 64, 0, 0, 0, 197, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 18, 18, 18, 134, 180, 180, 180, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 172, 172, 172, 64, 0, 0, 0, 178, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 237, 11, 11, 11, 145, 17, 17, 17, 143, - 17, 17, 17, 143, 17, 17, 17, 143, 17, 17, 17, 143, - 17, 17, 17, 143, 17, 17, 17, 143, 17, 17, 17, 142, - 16, 16, 16, 142, 16, 16, 16, 141, 16, 16, 16, 141, - 16, 16, 16, 141, 16, 16, 16, 141, 16, 16, 16, 141, - 16, 16, 16, 141, 53, 53, 53, 86, 189, 189, 189, 64, - 172, 172, 172, 64, 0, 0, 0, 176, 0, 0, 0, 253, - 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 249, 0, 0, 0, 239, - 0, 0, 0, 236, 0, 0, 0, 236, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 40, 40, 40, 110, 189, 189, 189, 59, - 172, 172, 172, 59, 0, 0, 0, 164, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 207, 10, 10, 10, 150, - 10, 10, 10, 150, 10, 10, 10, 150, 10, 10, 10, 150, - 10, 10, 10, 148, 10, 10, 10, 139, 10, 10, 10, 128, - 10, 10, 10, 125, 10, 10, 10, 125, 10, 10, 10, 125, - 10, 10, 10, 125, 9, 9, 9, 125, 0, 0, 0, 182, - 0, 0, 0, 211, 40, 40, 40, 99, 189, 189, 189, 53, - 172, 172, 172, 53, 0, 0, 0, 147, 0, 0, 0, 211, - 0, 0, 0, 211, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 7, 7, 7, 152, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 189, 189, 189, 63, 190, 190, 190, 58, 189, 189, 189, 53, - 189, 189, 189, 52, 189, 189, 189, 51, 189, 189, 189, 51, - 189, 189, 189, 51, 175, 175, 175, 51, 0, 0, 0, 141, - 0, 0, 0, 206, 40, 40, 40, 96, 189, 189, 189, 51, - 172, 172, 172, 51, 0, 0, 0, 143, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 6, 6, 6, 152, 176, 176, 176, 64, - 176, 176, 176, 64, 176, 176, 176, 64, 176, 176, 176, 64, - 176, 176, 176, 64, 176, 176, 176, 61, 176, 176, 176, 57, - 177, 177, 177, 55, 185, 185, 185, 55, 189, 189, 189, 55, - 189, 189, 189, 55, 175, 175, 175, 55, 0, 0, 0, 151, - 0, 0, 0, 221, 40, 40, 40, 103, 189, 189, 189, 55, - 172, 172, 172, 55, 0, 0, 0, 154, 0, 0, 0, 221, - 0, 0, 0, 221, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 220, 0, 0, 0, 173, - 0, 0, 0, 173, 0, 0, 0, 173, 0, 0, 0, 173, - 0, 0, 0, 173, 0, 0, 0, 172, 0, 0, 0, 150, - 46, 46, 46, 63, 181, 181, 181, 61, 190, 190, 190, 61, - 190, 190, 190, 61, 175, 175, 175, 61, 0, 0, 0, 167, - 0, 0, 0, 245, 39, 39, 39, 115, 190, 190, 190, 61, - 172, 172, 172, 61, 0, 0, 0, 170, 0, 0, 0, 245, - 0, 0, 0, 246, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 234, 47, 47, 47, 91, - 181, 181, 181, 59, 189, 189, 189, 59, 163, 163, 163, 59, - 189, 189, 189, 59, 175, 175, 175, 59, 0, 0, 0, 160, - 0, 0, 0, 234, 40, 40, 40, 110, 189, 189, 189, 59, - 172, 172, 172, 59, 0, 0, 0, 163, 0, 0, 0, 236, - 0, 0, 0, 245, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 235, 47, 47, 47, 92, 180, 180, 180, 59, - 190, 190, 190, 54, 156, 156, 156, 53, 30, 30, 30, 58, - 189, 189, 189, 53, 175, 175, 175, 53, 0, 0, 0, 144, - 0, 0, 0, 210, 39, 39, 39, 98, 189, 189, 189, 53, - 172, 172, 172, 53, 0, 0, 0, 146, 0, 0, 0, 214, - 0, 0, 0, 232, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 235, - 48, 48, 48, 92, 182, 182, 182, 63, 190, 190, 190, 58, - 156, 156, 156, 53, 16, 16, 16, 108, 13, 13, 13, 117, - 189, 189, 189, 52, 174, 174, 174, 52, 0, 0, 0, 141, - 0, 0, 0, 206, 39, 39, 39, 96, 189, 189, 189, 51, - 172, 172, 172, 51, 0, 0, 0, 142, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 234, 49, 49, 49, 92, - 182, 182, 182, 64, 189, 189, 189, 64, 155, 155, 155, 61, - 15, 15, 15, 121, 0, 0, 0, 224, 13, 13, 13, 129, - 190, 190, 190, 56, 175, 175, 175, 56, 0, 0, 0, 153, - 0, 0, 0, 217, 39, 39, 39, 98, 189, 189, 189, 51, - 172, 172, 172, 51, 0, 0, 0, 142, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 234, 49, 49, 49, 92, 182, 182, 182, 64, - 190, 190, 190, 64, 155, 155, 155, 64, 15, 15, 15, 133, - 0, 0, 0, 248, 0, 0, 0, 250, 13, 13, 13, 143, - 190, 190, 190, 62, 175, 175, 175, 62, 0, 0, 0, 163, - 0, 0, 0, 222, 39, 39, 39, 98, 189, 189, 189, 51, - 172, 172, 172, 51, 0, 0, 0, 142, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 234, - 49, 49, 49, 91, 182, 182, 182, 64, 190, 190, 190, 64, - 155, 155, 155, 64, 15, 15, 15, 135, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 13, 13, 13, 146, - 189, 189, 189, 64, 175, 175, 175, 61, 0, 0, 0, 153, - 0, 0, 0, 210, 39, 39, 39, 96, 189, 189, 189, 52, - 172, 172, 172, 52, 0, 0, 0, 142, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 234, 49, 49, 49, 91, - 182, 182, 182, 64, 190, 190, 190, 64, 154, 154, 154, 64, - 14, 14, 14, 135, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 13, 13, 13, 146, - 189, 189, 189, 62, 174, 174, 174, 57, 0, 0, 0, 143, - 0, 0, 0, 205, 40, 40, 40, 97, 190, 190, 190, 54, - 172, 172, 172, 54, 0, 0, 0, 143, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 5, 5, 5, 141, 167, 167, 167, 64, - 190, 190, 190, 64, 154, 154, 154, 64, 14, 14, 14, 136, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 13, 13, 13, 142, - 189, 189, 189, 57, 175, 175, 175, 53, 0, 0, 0, 140, - 0, 0, 0, 208, 40, 40, 40, 102, 189, 189, 189, 59, - 172, 172, 172, 57, 0, 0, 0, 144, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 244, 33, 33, 33, 106, - 138, 138, 138, 64, 13, 13, 13, 136, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 245, 11, 11, 11, 132, - 163, 163, 163, 53, 151, 151, 151, 51, 0, 0, 0, 143, - 0, 0, 0, 220, 39, 39, 39, 111, 189, 189, 189, 62, - 172, 172, 172, 58, 0, 0, 0, 144, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 244, - 0, 0, 0, 177, 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 245, 0, 0, 0, 227, 0, 0, 0, 186, - 0, 0, 0, 150, 0, 0, 0, 152, 0, 0, 0, 204, - 0, 0, 0, 240, 16, 16, 16, 137, 150, 150, 150, 63, - 117, 117, 117, 58, 0, 0, 0, 160, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 246, - 0, 0, 0, 227, 0, 0, 0, 211, 0, 0, 0, 205, - 0, 0, 0, 208, 0, 0, 0, 221, 0, 0, 0, 240, - 0, 0, 0, 252, 0, 0, 0, 249, 0, 0, 0, 186, - 0, 0, 0, 183, 0, 0, 0, 208, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 237, - 0, 0, 0, 214, 0, 0, 0, 206, 0, 0, 0, 208, - 0, 0, 0, 221, 0, 0, 0, 240, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, - 0, 0, 0, 231, 0, 0, 0, 209, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 243, - 0, 0, 0, 222, 0, 0, 0, 211, 0, 0, 0, 221, - 0, 0, 0, 240, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, - 0, 0, 0, 232, 0, 0, 0, 211, 0, 0, 0, 211, - 0, 0, 0, 231, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 252, - 0, 0, 0, 242, 0, 0, 0, 233, 0, 0, 0, 242, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 242, 0, 0, 0, 230, 0, 0, 0, 230, - 0, 0, 0, 242, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 251, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 251, 0, 0, 0, 251, - 0, 0, 0, 253, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 213, - 0, 0, 0, 218, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 210, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 245, - 0, 0, 0, 221, 0, 0, 0, 221, 0, 0, 0, 245, - 0, 0, 0, 255, 7, 7, 7, 164, 128, 128, 128, 64, - 117, 117, 117, 64, 0, 0, 0, 188, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 16, 16, 16, 133, - 111, 111, 111, 64, 8, 8, 8, 154, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 161, - 134, 134, 134, 64, 134, 134, 134, 64, 0, 0, 0, 161, - 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 2, 2, 2, 154, 156, 156, 156, 64, - 190, 190, 190, 64, 148, 148, 148, 64, 12, 12, 12, 143, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 159, - 190, 190, 190, 64, 190, 190, 190, 64, 0, 0, 0, 159, - 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 233, 50, 50, 50, 92, - 182, 182, 182, 64, 190, 190, 190, 64, 155, 155, 155, 64, - 16, 16, 16, 133, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 254, 0, 0, 0, 159, - 190, 190, 190, 64, 190, 190, 190, 64, 0, 0, 0, 159, - 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 64, - 190, 190, 190, 64, 0, 0, 0, 159, 0, 0, 0, 254, - 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 238, - 42, 42, 42, 99, 177, 177, 177, 64, 190, 190, 190, 64, - 161, 161, 161, 64, 22, 22, 22, 123, 0, 0, 0, 248, - 0, 0, 0, 246, 0, 0, 0, 240, 0, 0, 0, 154, - 189, 189, 189, 64, 190, 190, 190, 64, 0, 0, 0, 159, - 0, 0, 0, 255, 23, 23, 23, 136, 189, 189, 189, 64, - 189, 189, 189, 62, 0, 0, 0, 148, 0, 0, 0, 238, - 0, 0, 0, 246, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 242, 34, 34, 34, 106, 173, 173, 173, 64, - 190, 190, 190, 64, 167, 167, 167, 64, 27, 27, 27, 110, - 0, 0, 0, 218, 0, 0, 0, 215, 0, 0, 0, 140, - 190, 190, 190, 61, 189, 189, 189, 64, 0, 0, 0, 159, - 0, 0, 0, 255, 23, 23, 23, 136, 190, 190, 190, 63, - 190, 190, 190, 58, 0, 0, 0, 133, 0, 0, 0, 214, - 0, 0, 0, 233, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 247, 27, 27, 27, 115, - 167, 167, 167, 64, 190, 190, 190, 63, 173, 173, 173, 59, - 34, 34, 34, 88, 0, 0, 0, 195, 0, 0, 0, 130, - 190, 190, 190, 56, 190, 190, 190, 61, 0, 0, 0, 159, - 0, 0, 0, 255, 23, 23, 23, 136, 189, 189, 189, 63, - 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, - 0, 0, 0, 230, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 249, - 22, 22, 22, 123, 161, 161, 161, 64, 190, 190, 190, 61, - 177, 177, 177, 56, 42, 42, 42, 81, 0, 0, 0, 115, - 190, 190, 190, 52, 189, 189, 189, 56, 0, 0, 0, 154, - 0, 0, 0, 253, 23, 23, 23, 136, 189, 189, 189, 63, - 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 16, 16, 16, 133, 155, 155, 155, 63, - 190, 190, 190, 61, 181, 181, 181, 56, 50, 50, 50, 52, - 189, 189, 189, 51, 190, 190, 190, 52, 0, 0, 0, 141, - 0, 0, 0, 242, 23, 23, 23, 134, 189, 189, 189, 63, - 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 12, 12, 12, 143, - 147, 147, 147, 64, 190, 190, 190, 61, 185, 185, 185, 56, - 189, 189, 189, 53, 189, 189, 189, 51, 0, 0, 0, 131, - 0, 0, 0, 222, 23, 23, 23, 127, 189, 189, 189, 62, - 190, 190, 190, 57, 0, 0, 0, 129, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 190, 55, 55, 55, 109, - 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 109, - 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 109, - 64, 64, 64, 67, 173, 173, 173, 64, 190, 190, 190, 61, - 189, 189, 189, 57, 189, 189, 189, 53, 0, 0, 0, 128, - 0, 0, 0, 208, 23, 23, 23, 116, 189, 189, 189, 59, - 189, 189, 189, 57, 0, 0, 0, 129, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 159, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 189, 189, 189, 64, - 189, 189, 189, 62, 190, 190, 190, 57, 0, 0, 0, 131, - 0, 0, 0, 205, 23, 23, 23, 110, 190, 190, 190, 54, - 190, 190, 190, 54, 0, 0, 0, 129, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 165, 111, 111, 111, 64, - 111, 111, 111, 64, 111, 111, 111, 64, 111, 111, 111, 64, - 111, 111, 111, 64, 111, 111, 111, 64, 111, 111, 111, 64, - 111, 111, 111, 64, 111, 111, 111, 64, 111, 111, 111, 64, - 111, 111, 111, 64, 111, 111, 111, 62, 0, 0, 0, 146, - 0, 0, 0, 212, 23, 23, 23, 109, 189, 189, 189, 51, - 189, 189, 189, 52, 0, 0, 0, 128, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 244, - 0, 0, 0, 244, 0, 0, 0, 244, 0, 0, 0, 244, - 0, 0, 0, 244, 0, 0, 0, 243, 0, 0, 0, 240, - 0, 0, 0, 236, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 234, 0, 0, 0, 236, - 0, 0, 0, 222, 23, 23, 23, 111, 189, 189, 189, 51, - 189, 189, 189, 51, 0, 0, 0, 127, 0, 0, 0, 208, - 0, 0, 0, 229, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 228, 0, 0, 0, 221, - 0, 0, 0, 221, 0, 0, 0, 221, 0, 0, 0, 221, - 0, 0, 0, 221, 0, 0, 0, 219, 0, 0, 0, 207, - 0, 0, 0, 194, 0, 0, 0, 191, 0, 0, 0, 191, - 0, 0, 0, 191, 0, 0, 0, 191, 0, 0, 0, 190, - 0, 0, 0, 186, 23, 23, 23, 100, 189, 189, 189, 51, - 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 208, - 0, 0, 0, 230, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 193, 106, 106, 106, 65, 134, 134, 134, 64, - 134, 134, 134, 64, 134, 134, 134, 64, 134, 134, 134, 64, - 134, 134, 134, 64, 134, 134, 134, 63, 133, 133, 133, 58, - 133, 133, 133, 53, 133, 133, 133, 52, 133, 133, 133, 52, - 133, 133, 133, 52, 133, 133, 133, 52, 133, 133, 133, 52, - 133, 133, 133, 51, 141, 141, 141, 51, 189, 189, 189, 51, - 189, 189, 189, 51, 0, 0, 0, 128, 0, 0, 0, 209, - 0, 0, 0, 230, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 159, 184, 184, 184, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 190, 190, 190, 63, 189, 189, 189, 59, - 189, 189, 189, 55, 190, 190, 190, 54, 190, 190, 190, 54, - 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 190, 190, 190, 54, 190, 190, 190, 54, 190, 190, 190, 54, - 177, 177, 177, 54, 0, 0, 0, 137, 0, 0, 0, 220, - 0, 0, 0, 237, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 233, 33, 33, 33, 117, 55, 55, 55, 109, - 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 109, - 55, 55, 55, 109, 55, 55, 55, 109, 55, 55, 55, 107, - 55, 55, 55, 105, 55, 55, 55, 105, 55, 55, 55, 105, - 55, 55, 55, 105, 55, 55, 55, 105, 55, 55, 55, 105, - 55, 55, 55, 105, 55, 55, 55, 105, 55, 55, 55, 105, - 23, 23, 23, 124, 0, 0, 0, 232, 0, 0, 0, 244, - 0, 0, 0, 249, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 249, 0, 0, 0, 240, - 0, 0, 0, 236, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 236, - 0, 0, 0, 235, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 236, 0, 0, 0, 216, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 252, 0, 0, 0, 233, 0, 0, 0, 212, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 254, 0, 0, 0, 245, 0, 0, 0, 230, - 0, 0, 0, 226, 0, 0, 0, 225, 0, 0, 0, 225, - 0, 0, 0, 225, 0, 0, 0, 225, 0, 0, 0, 225, - 0, 0, 0, 225, 0, 0, 0, 225, 0, 0, 0, 225, - 0, 0, 0, 225, 0, 0, 0, 225, 0, 0, 0, 225, - 0, 0, 0, 225, - },{ - 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 243, - 0, 0, 0, 241, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 203, 87, 87, 87, 69, - 100, 100, 100, 65, 4, 4, 4, 179, 0, 0, 0, 255, - 0, 0, 0, 249, 0, 0, 0, 228, 0, 0, 0, 228, - 0, 0, 0, 247, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 219, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 166, 123, 123, 123, 64, 126, 126, 126, 64, - 3, 3, 3, 155, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 4, 4, 4, 171, 101, 101, 101, 65, - 19, 19, 19, 130, 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 185, 185, 185, 64, 190, 190, 190, 64, - 6, 6, 6, 152, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 7, 7, 7, 160, 134, 134, 134, 64, 190, 190, 190, 64, - 161, 161, 161, 64, 7, 7, 7, 144, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 185, 185, 185, 64, 189, 189, 189, 62, - 6, 6, 6, 143, 0, 0, 0, 239, 0, 0, 0, 249, - 0, 0, 0, 254, 0, 0, 0, 253, 10, 10, 10, 149, - 142, 142, 142, 64, 190, 190, 190, 64, 186, 186, 186, 64, - 66, 66, 66, 82, 0, 0, 0, 221, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 254, - 0, 0, 0, 253, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 185, 185, 185, 63, 189, 189, 189, 59, - 5, 5, 5, 128, 0, 0, 0, 215, 0, 0, 0, 235, - 0, 0, 0, 248, 14, 14, 14, 135, 150, 150, 150, 59, - 189, 189, 189, 59, 183, 183, 183, 62, 57, 57, 57, 87, - 0, 0, 0, 227, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 253, 0, 0, 0, 246, - 0, 0, 0, 238, 0, 0, 0, 245, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 185, 185, 185, 63, 189, 189, 189, 57, - 6, 6, 6, 124, 0, 0, 0, 208, 0, 0, 0, 225, - 19, 19, 19, 125, 156, 156, 156, 58, 190, 190, 190, 53, - 179, 179, 179, 54, 48, 48, 48, 87, 0, 0, 0, 231, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 253, 0, 0, 0, 243, 0, 0, 0, 225, - 0, 0, 0, 214, 0, 0, 0, 224, 0, 0, 0, 244, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, - 6, 6, 6, 124, 0, 0, 0, 202, 24, 24, 24, 106, - 163, 163, 163, 62, 189, 189, 189, 57, 176, 176, 176, 52, - 40, 40, 40, 83, 0, 0, 0, 217, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 253, - 0, 0, 0, 242, 0, 0, 0, 223, 0, 0, 0, 209, - 0, 0, 0, 206, 0, 0, 0, 213, 0, 0, 0, 236, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, - 6, 6, 6, 115, 30, 30, 30, 90, 169, 169, 169, 57, - 189, 189, 189, 62, 171, 171, 171, 57, 33, 33, 33, 87, - 0, 0, 0, 199, 0, 0, 0, 232, 0, 0, 0, 252, - 0, 0, 0, 255, 0, 0, 0, 252, 0, 0, 0, 241, - 0, 0, 0, 222, 0, 0, 0, 208, 0, 0, 0, 205, - 0, 0, 0, 210, 0, 0, 0, 225, 0, 0, 0, 245, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, - 43, 43, 43, 53, 173, 173, 173, 52, 190, 190, 190, 57, - 166, 166, 166, 62, 27, 27, 27, 102, 0, 0, 0, 200, - 0, 0, 0, 209, 0, 0, 0, 232, 0, 0, 0, 252, - 0, 0, 0, 252, 0, 0, 0, 240, 0, 0, 0, 221, - 0, 0, 0, 208, 0, 0, 0, 205, 0, 0, 0, 210, - 0, 0, 0, 226, 0, 0, 0, 245, 0, 0, 0, 253, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, - 180, 180, 180, 52, 189, 189, 189, 52, 160, 160, 160, 57, - 21, 21, 21, 120, 0, 0, 0, 222, 0, 0, 0, 207, - 0, 0, 0, 209, 0, 0, 0, 231, 0, 0, 0, 248, - 0, 0, 0, 239, 0, 0, 0, 220, 0, 0, 0, 208, - 0, 0, 0, 205, 0, 0, 0, 211, 0, 0, 0, 227, - 0, 0, 0, 246, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, - 189, 189, 189, 52, 175, 175, 175, 52, 58, 58, 58, 59, - 42, 42, 42, 115, 42, 42, 42, 109, 42, 42, 42, 99, - 42, 42, 42, 100, 41, 41, 41, 110, 42, 42, 42, 114, - 42, 42, 42, 106, 2, 2, 2, 153, 0, 0, 0, 205, - 0, 0, 0, 212, 0, 0, 0, 229, 0, 0, 0, 246, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 164, 184, 184, 184, 63, 189, 189, 189, 57, - 189, 189, 189, 52, 189, 189, 189, 52, 190, 190, 190, 57, - 189, 189, 189, 62, 189, 189, 189, 57, 189, 189, 189, 52, - 189, 189, 189, 52, 190, 190, 190, 54, 190, 190, 190, 54, - 189, 189, 189, 52, 12, 12, 12, 118, 0, 0, 0, 212, - 0, 0, 0, 230, 0, 0, 0, 247, 0, 0, 0, 254, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 166, 123, 123, 123, 63, 126, 126, 126, 57, - 126, 126, 126, 52, 126, 126, 126, 52, 126, 126, 126, 57, - 126, 126, 126, 62, 126, 126, 126, 57, 126, 126, 126, 52, - 126, 126, 126, 51, 126, 126, 126, 52, 126, 126, 126, 51, - 126, 126, 126, 51, 8, 8, 8, 126, 0, 0, 0, 231, - 0, 0, 0, 247, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 132, 0, 0, 0, 255, - 0, 0, 0, 248, 0, 0, 0, 224, 0, 0, 0, 203, - 0, 0, 0, 186, 0, 0, 0, 186, 0, 0, 0, 205, - 0, 0, 0, 220, 0, 0, 0, 204, 0, 0, 0, 186, - 0, 0, 0, 183, 0, 0, 0, 183, 0, 0, 0, 183, - 0, 0, 0, 187, 0, 0, 0, 216, 0, 0, 0, 239, - 0, 0, 0, 244, 0, 0, 0, 245, 0, 0, 0, 245, - 0, 0, 0, 246, 0, 0, 0, 246, 0, 0, 0, 251, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 26, 26, 26, 126, 0, 0, 0, 238, - 0, 0, 0, 238, 0, 0, 0, 233, 0, 0, 0, 212, - 0, 0, 0, 193, 0, 0, 0, 194, 0, 0, 0, 213, - 0, 0, 0, 229, 0, 0, 0, 212, 0, 0, 0, 193, - 0, 0, 0, 190, 0, 0, 0, 190, 0, 0, 0, 190, - 0, 0, 0, 193, 0, 0, 0, 200, 0, 0, 0, 217, - 0, 0, 0, 218, 0, 0, 0, 218, 0, 0, 0, 218, - 0, 0, 0, 218, 0, 0, 0, 221, 0, 0, 0, 238, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 161, 188, 188, 188, 64, - 190, 190, 190, 64, 127, 127, 127, 64, 117, 117, 117, 64, - 117, 117, 117, 64, 117, 117, 117, 63, 117, 117, 117, 57, - 117, 117, 117, 52, 117, 117, 117, 52, 117, 117, 117, 57, - 117, 117, 117, 62, 117, 117, 117, 57, 117, 117, 117, 52, - 117, 117, 117, 51, 117, 117, 117, 51, 117, 117, 117, 51, - 117, 117, 117, 51, 104, 104, 104, 52, 6, 6, 6, 136, - 0, 0, 0, 206, 0, 0, 0, 206, 0, 0, 0, 206, - 0, 0, 0, 206, 0, 0, 0, 210, 0, 0, 0, 232, - 0, 0, 0, 252, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 163, 179, 179, 179, 64, - 190, 190, 190, 64, 190, 190, 190, 64, 190, 190, 190, 64, - 190, 190, 190, 64, 189, 189, 189, 63, 189, 189, 189, 57, - 189, 189, 189, 52, 189, 189, 189, 52, 190, 190, 190, 57, - 189, 189, 189, 62, 189, 189, 189, 59, 189, 189, 189, 55, - 189, 189, 189, 55, 189, 189, 189, 55, 189, 189, 189, 55, - 189, 189, 189, 55, 189, 189, 189, 55, 34, 34, 34, 104, - 0, 0, 0, 218, 0, 0, 0, 218, 0, 0, 0, 218, - 0, 0, 0, 218, 0, 0, 0, 221, 0, 0, 0, 238, - 0, 0, 0, 253, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 236, 37, 37, 37, 108, - 73, 73, 73, 91, 73, 73, 73, 91, 73, 73, 73, 91, - 73, 73, 73, 91, 73, 73, 73, 89, 73, 73, 73, 80, - 73, 73, 73, 73, 73, 73, 73, 74, 73, 73, 73, 81, - 73, 73, 73, 88, 73, 73, 73, 88, 74, 74, 74, 87, - 73, 73, 73, 87, 73, 73, 73, 87, 73, 73, 73, 87, - 73, 73, 73, 87, 61, 61, 61, 88, 0, 0, 0, 191, - 0, 0, 0, 243, 0, 0, 0, 243, 0, 0, 0, 243, - 0, 0, 0, 243, 0, 0, 0, 245, 0, 0, 0, 249, - 0, 0, 0, 254, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 227, - 0, 0, 0, 207, 0, 0, 0, 206, 0, 0, 0, 219, - 0, 0, 0, 233, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 235, - 0, 0, 0, 235, 0, 0, 0, 235, 0, 0, 0, 238, - 0, 0, 0, 248, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 250, 0, 0, 0, 227, - 0, 0, 0, 207, 0, 0, 0, 205, 0, 0, 0, 207, - 0, 0, 0, 209, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 210, - 0, 0, 0, 210, 0, 0, 0, 210, 0, 0, 0, 215, - 0, 0, 0, 234, 0, 0, 0, 252, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 251, 0, 0, 0, 232, - 0, 0, 0, 211, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 207, - 0, 0, 0, 207, 0, 0, 0, 207, 0, 0, 0, 211, - 0, 0, 0, 231, 0, 0, 0, 251, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 255, - 0, 0, 0, 255, 0, 0, 0, 254, 0, 0, 0, 245, - 0, 0, 0, 231, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 226, - 0, 0, 0, 226, 0, 0, 0, 226, 0, 0, 0, 230, - 0, 0, 0, 243, 0, 0, 0, 254, 0, 0, 0, 255, - 0, 0, 0, 255, - }}; - -#define NUM_CURSORS sizeof(Cursors) / sizeof(Cursors[0]) diff --git a/src/glut/fbdev/ext.c b/src/glut/fbdev/ext.c deleted file mode 100644 index 65953e705b..0000000000 --- a/src/glut/fbdev/ext.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include - -#include -#include - -#include "internal.h" - -void glutReportErrors(void) -{ - GLenum error; - - while ((error = glGetError()) != GL_NO_ERROR) - sprintf(exiterror, "GL error: %s", gluErrorString(error)); -} - -static struct { - const char *name; - const GLUTproc address; -} glut_functions[] = { - { "glutInit", (const GLUTproc) glutInit }, - { "glutInitDisplayMode", (const GLUTproc) glutInitDisplayMode }, - { "glutInitWindowPosition", (const GLUTproc) glutInitWindowPosition }, - { "glutInitWindowSize", (const GLUTproc) glutInitWindowSize }, - { "glutMainLoop", (const GLUTproc) glutMainLoop }, - { "glutCreateWindow", (const GLUTproc) glutCreateWindow }, - { "glutCreateSubWindow", (const GLUTproc) glutCreateSubWindow }, - { "glutDestroyWindow", (const GLUTproc) glutDestroyWindow }, - { "glutPostRedisplay", (const GLUTproc) glutPostRedisplay }, - { "glutSwapBuffers", (const GLUTproc) glutSwapBuffers }, - { "glutGetWindow", (const GLUTproc) glutGetWindow }, - { "glutSetWindow", (const GLUTproc) glutSetWindow }, - { "glutSetWindowTitle", (const GLUTproc) glutSetWindowTitle }, - { "glutSetIconTitle", (const GLUTproc) glutSetIconTitle }, - { "glutPositionWindow", (const GLUTproc) glutPositionWindow }, - { "glutReshapeWindow", (const GLUTproc) glutReshapeWindow }, - { "glutPopWindow", (const GLUTproc) glutPopWindow }, - { "glutPushWindow", (const GLUTproc) glutPushWindow }, - { "glutIconifyWindow", (const GLUTproc) glutIconifyWindow }, - { "glutShowWindow", (const GLUTproc) glutShowWindow }, - { "glutHideWindow", (const GLUTproc) glutHideWindow }, - { "glutFullScreen", (const GLUTproc) glutFullScreen }, - { "glutSetCursor", (const GLUTproc) glutSetCursor }, - { "glutWarpPointer", (const GLUTproc) glutWarpPointer }, - { "glutEstablishOverlay", (const GLUTproc) glutEstablishOverlay }, - { "glutRemoveOverlay", (const GLUTproc) glutRemoveOverlay }, - { "glutUseLayer", (const GLUTproc) glutUseLayer }, - { "glutPostOverlayRedisplay", (const GLUTproc) glutPostOverlayRedisplay }, - { "glutShowOverlay", (const GLUTproc) glutShowOverlay }, - { "glutHideOverlay", (const GLUTproc) glutHideOverlay }, - { "glutCreateMenu", (const GLUTproc) glutCreateMenu }, - { "glutDestroyMenu", (const GLUTproc) glutDestroyMenu }, - { "glutGetMenu", (const GLUTproc) glutGetMenu }, - { "glutSetMenu", (const GLUTproc) glutSetMenu }, - { "glutAddMenuEntry", (const GLUTproc) glutAddMenuEntry }, - { "glutAddSubMenu", (const GLUTproc) glutAddSubMenu }, - { "glutChangeToMenuEntry", (const GLUTproc) glutChangeToMenuEntry }, - { "glutChangeToSubMenu", (const GLUTproc) glutChangeToSubMenu }, - { "glutRemoveMenuItem", (const GLUTproc) glutRemoveMenuItem }, - { "glutAttachMenu", (const GLUTproc) glutAttachMenu }, - { "glutDetachMenu", (const GLUTproc) glutDetachMenu }, - { "glutDisplayFunc", (const GLUTproc) glutDisplayFunc }, - { "glutReshapeFunc", (const GLUTproc) glutReshapeFunc }, - { "glutKeyboardFunc", (const GLUTproc) glutKeyboardFunc }, - { "glutMouseFunc", (const GLUTproc) glutMouseFunc }, - { "glutMotionFunc", (const GLUTproc) glutMotionFunc }, - { "glutPassiveMotionFunc", (const GLUTproc) glutPassiveMotionFunc }, - { "glutEntryFunc", (const GLUTproc) glutEntryFunc }, - { "glutVisibilityFunc", (const GLUTproc) glutVisibilityFunc }, - { "glutIdleFunc", (const GLUTproc) glutIdleFunc }, - { "glutTimerFunc", (const GLUTproc) glutTimerFunc }, - { "glutMenuStateFunc", (const GLUTproc) glutMenuStateFunc }, - { "glutSpecialFunc", (const GLUTproc) glutSpecialFunc }, - { "glutSpaceballRotateFunc", (const GLUTproc) glutSpaceballRotateFunc }, - { "glutButtonBoxFunc", (const GLUTproc) glutButtonBoxFunc }, - { "glutDialsFunc", (const GLUTproc) glutDialsFunc }, - { "glutTabletMotionFunc", (const GLUTproc) glutTabletMotionFunc }, - { "glutTabletButtonFunc", (const GLUTproc) glutTabletButtonFunc }, - { "glutMenuStatusFunc", (const GLUTproc) glutMenuStatusFunc }, - { "glutOverlayDisplayFunc", (const GLUTproc) glutOverlayDisplayFunc }, - { "glutSetColor", (const GLUTproc) glutSetColor }, - { "glutGetColor", (const GLUTproc) glutGetColor }, - { "glutCopyColormap", (const GLUTproc) glutCopyColormap }, - { "glutGet", (const GLUTproc) glutGet }, - { "glutDeviceGet", (const GLUTproc) glutDeviceGet }, - { "glutExtensionSupported", (const GLUTproc) glutExtensionSupported }, - { "glutGetModifiers", (const GLUTproc) glutGetModifiers }, - { "glutLayerGet", (const GLUTproc) glutLayerGet }, - { "glutGetProcAddress", (const GLUTproc) glutGetProcAddress }, - { "glutBitmapCharacter", (const GLUTproc) glutBitmapCharacter }, - { "glutBitmapWidth", (const GLUTproc) glutBitmapWidth }, - { "glutStrokeCharacter", (const GLUTproc) glutStrokeCharacter }, - { "glutStrokeWidth", (const GLUTproc) glutStrokeWidth }, - { "glutBitmapLength", (const GLUTproc) glutBitmapLength }, - { "glutStrokeLength", (const GLUTproc) glutStrokeLength }, - { "glutWireSphere", (const GLUTproc) glutWireSphere }, - { "glutSolidSphere", (const GLUTproc) glutSolidSphere }, - { "glutWireCone", (const GLUTproc) glutWireCone }, - { "glutSolidCone", (const GLUTproc) glutSolidCone }, - { "glutWireCube", (const GLUTproc) glutWireCube }, - { "glutSolidCube", (const GLUTproc) glutSolidCube }, - { "glutWireTorus", (const GLUTproc) glutWireTorus }, - { "glutSolidTorus", (const GLUTproc) glutSolidTorus }, - { "glutWireDodecahedron", (const GLUTproc) glutWireDodecahedron }, - { "glutSolidDodecahedron", (const GLUTproc) glutSolidDodecahedron }, - { "glutWireTeapot", (const GLUTproc) glutWireTeapot }, - { "glutSolidTeapot", (const GLUTproc) glutSolidTeapot }, - { "glutWireOctahedron", (const GLUTproc) glutWireOctahedron }, - { "glutSolidOctahedron", (const GLUTproc) glutSolidOctahedron }, - { "glutWireTetrahedron", (const GLUTproc) glutWireTetrahedron }, - { "glutSolidTetrahedron", (const GLUTproc) glutSolidTetrahedron }, - { "glutWireIcosahedron", (const GLUTproc) glutWireIcosahedron }, - { "glutSolidIcosahedron", (const GLUTproc) glutSolidIcosahedron }, - { "glutReportErrors", (const GLUTproc) glutReportErrors }, - { NULL, NULL } -}; - -GLUTproc glutGetProcAddress(const char *procName) -{ - /* Try GLUT functions first */ - int i; - for (i = 0; glut_functions[i].name; i++) { - if (strcmp(glut_functions[i].name, procName) == 0) - return glut_functions[i].address; - } - - /* Try core GL functions */ - return (GLUTproc) glFBDevGetProcAddress(procName); -} diff --git a/src/glut/fbdev/fbdev.c b/src/glut/fbdev/fbdev.c deleted file mode 100644 index 80237f5bc7..0000000000 --- a/src/glut/fbdev/fbdev.c +++ /dev/null @@ -1,940 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - * - * To improve on this library, maybe support subwindows or overlays, - * I (sean at depagnier dot com) will do my best to help. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include - -#include "internal.h" - -#define FBMODES "/etc/fb.modes" - -struct fb_fix_screeninfo FixedInfo; -struct fb_var_screeninfo VarInfo; -static struct fb_var_screeninfo OrigVarInfo; - -static int DesiredDepth = 0; - -int FrameBufferFD = -1; -unsigned char *FrameBuffer; -unsigned char *BackBuffer = NULL; -int DisplayMode; - -struct GlutTimer *GlutTimers = NULL; - -struct timeval StartTime; - -/* per window data */ -GLFBDevContextPtr Context; -GLFBDevBufferPtr Buffer; -GLFBDevVisualPtr Visual; - -int Redisplay; -int Visible; -int VisibleSwitch; -int Active; -static int Resized; -/* we have to poll to see if we are visible - on a framebuffer that is not active */ -int VisiblePoll; -int Swapping, VTSwitch; -static int FramebufferIndex; - -static int Initialized; - -char exiterror[256]; - -/* test if the active console is attached to the same framebuffer */ -void TestVisible(void) { - struct fb_con2fbmap confb; - struct vt_stat st; - int ret; - ioctl(ConsoleFD, VT_GETSTATE, &st); - confb.console = st.v_active; - - ret = ioctl(FrameBufferFD, FBIOGET_CON2FBMAP, &confb); - - if(ret == -1 || confb.framebuffer == FramebufferIndex) { - VisibleSwitch = 1; - Visible = 0; - VisiblePoll = 0; - } -} - -static void Cleanup(void) -{ - /* do not handle this signal when cleaning up */ - signal(SIGWINCH, SIG_IGN); - - if(GameMode) - glutLeaveGameMode(); - - if(ConsoleFD != -1) - RestoreVT(); - - /* close mouse */ - CloseMouse(); - - if(Visual) - glutDestroyWindow(1); - - /* restore original variable screen info */ - if(FrameBufferFD != -1) { - OrigVarInfo.xoffset = 0; - OrigVarInfo.yoffset = 0; - - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - - if(FrameBuffer) - munmap(FrameBuffer, FixedInfo.smem_len); - close(FrameBufferFD); - - } - - /* free allocated back buffer */ - if(DisplayMode & GLUT_DOUBLE) - free(BackBuffer); - - /* free menu items */ - FreeMenus(); - - if(exiterror[0]) - fprintf(stderr, "[glfbdev glut] %s", exiterror); - } - -static void CrashHandler(int sig) -{ - sprintf(exiterror, "Caught signal %d, cleaning up\n", sig); - exit(0); -} - -static void removeArgs(int *argcp, char **argv, int num) -{ - int i; - for (i = 0; argv[i+num]; i++) - argv[i] = argv[i+num]; - - argv[i] = NULL; - *argcp -= num; -} - -#define REQPARAM(PARAM) \ - if (i >= *argcp - 1) { \ - fprintf(stderr, PARAM" requires a parameter\n"); \ - exit(0); \ - } - -void glutInit (int *argcp, char **argv) -{ - int i, nomouse = 0, nokeyboard = 0, usestdin = 0; - int RequiredWidth = 0, RequiredHeight; - char *fbdev; - - stack_t stack; - struct sigaction sa; - - /* parse out args */ - for (i = 1; i < *argcp;) { - if (!strcmp(argv[i], "-geometry")) { - REQPARAM("geometry"); - if(sscanf(argv[i+1], "%dx%d", &RequiredWidth, - &RequiredHeight) != 2) { - fprintf(stderr,"Please specify geometry as widthxheight\n"); - exit(0); - } - removeArgs(argcp, &argv[i], 2); - } else - if (!strcmp(argv[i], "-bpp")) { - REQPARAM("bpp"); - if(sscanf(argv[i+1], "%d", &DesiredDepth) != 1) { - fprintf(stderr, "Please specify a parameter for bpp\n"); - exit(0); - } - removeArgs(argcp, &argv[i], 2); - } else - if (!strcmp(argv[i], "-vt")) { - REQPARAM("vt"); - if(sscanf(argv[i+1], "%d", &CurrentVT) != 1) { - fprintf(stderr, "Please specify a parameter for vt\n"); - exit(0); - } - removeArgs(argcp, &argv[i], 2); - } else - if (!strcmp(argv[i], "-mousespeed")) { - REQPARAM("mousespeed"); - if(sscanf(argv[i+1], "%lf", &MouseSpeed) != 1) { - fprintf(stderr, "Please specify a mouse speed, eg: 2.5\n"); - exit(0); - } - removeArgs(argcp, &argv[i], 2); - } else - if (!strcmp(argv[i], "-nomouse")) { - nomouse = 1; - removeArgs(argcp, &argv[i], 1); - } else - if (!strcmp(argv[i], "-nokeyboard")) { - nokeyboard = 1; - removeArgs(argcp, &argv[i], 1); - } else - if (!strcmp(argv[i], "-stdin")) { - usestdin = 1; - removeArgs(argcp, &argv[i], 1); - } else - if (!strcmp(argv[i], "-gpmmouse")) { -#ifdef HAVE_GPM - GpmMouse = 1; -#else - fprintf(stderr, "gpm support not compiled\n"); - exit(0); -#endif - removeArgs(argcp, &argv[i], 1); - } else - if (!strcmp(argv[i], "--")) { - removeArgs(argcp, &argv[i], 1); - break; - } else - i++; - } - - gettimeofday(&StartTime, 0); - atexit(Cleanup); - - /* set up SIGSEGV to use alternate stack */ - stack.ss_flags = 0; - stack.ss_size = SIGSTKSZ; - if(!(stack.ss_sp = malloc(SIGSTKSZ))) - sprintf(exiterror, "Failed to allocate alternate stack for SIGSEGV!\n"); - - sigaltstack(&stack, NULL); - - sa.sa_handler = CrashHandler; - sa.sa_flags = SA_ONSTACK; - sigemptyset(&sa.sa_mask); - sigaction(SIGSEGV, &sa, NULL); - - signal(SIGINT, CrashHandler); - signal(SIGTERM, CrashHandler); - signal(SIGABRT, CrashHandler); - - if(nomouse == 0) - InitializeMouse(); - if(nokeyboard == 0) - InitializeVT(usestdin); - - fbdev = getenv("FRAMEBUFFER"); - if(fbdev) { -#ifdef MULTIHEAD - if(!sscanf(fbdev, "/dev/fb%d", &FramebufferIndex)) - if(!sscanf(fbdev, "/dev/fb/%d", &FramebufferIndex)) - sprintf(exiterror, "Could not determine Framebuffer index!\n"); -#endif - } else { - static char fb[128]; - struct fb_con2fbmap confb; - int fd = open("/dev/fb0", O_RDWR); - - FramebufferIndex = 0; - - confb.console = CurrentVT; - if(ioctl(fd, FBIOGET_CON2FBMAP, &confb) != -1) - FramebufferIndex = confb.framebuffer; - sprintf(fb, "/dev/fb%d", FramebufferIndex); - fbdev = fb; - close(fd); - } - - /* open the framebuffer device */ - FrameBufferFD = open(fbdev, O_RDWR); - if (FrameBufferFD < 0) { - sprintf(exiterror, "Error opening %s: %s\n", fbdev, strerror(errno)); - exit(0); - } - - /* get the fixed screen info */ - if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { - sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", - strerror(errno)); - exit(0); - } - - /* get the variable screen info */ - if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) { - sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", - strerror(errno)); - exit(0); - } - - /* operate on a copy */ - VarInfo = OrigVarInfo; - - /* set the depth, resolution, etc */ - if(RequiredWidth) - if(!ParseFBModes(RequiredWidth, RequiredWidth, RequiredHeight, - RequiredHeight, 0, MAX_VSYNC)) { - sprintf(exiterror, "No mode (%dx%d) found in "FBMODES"\n", - RequiredWidth, RequiredHeight); - exit(0); - } - - Initialized = 1; -} - -void glutInitDisplayMode (unsigned int mode) -{ - DisplayMode = mode; -} - -static const char *GetStrVal(const char *p, int *set, int min, int max) -{ - char *endptr; - int comp = *p, val; - - if(p[1] == '=') - p++; - - if(*p == '\0') - return p; - - val = strtol(p+1, &endptr, 10); - - if(endptr == p+1) - return p; - - switch(comp) { - case '!': - if(val == min) - val = max; - else - val = min; - break; - case '<': - val = min; - break; - case '>': - val = max; - break; - } - - if(val < min || val > max) { - sprintf(exiterror, "display string value out of range\n"); - exit(0); - } - - *set = val; - - return endptr; -} - -static void SetAttrib(int val, int attr) -{ - if(val) - DisplayMode |= attr; - else - DisplayMode &= ~attr; -} - -void glutInitDisplayString(const char *string) -{ - const char *p = string; - int val; - while(*p) { - if(*p == ' ') - p++; - else - if(memcmp(p, "acca", 4) == 0) { - p = GetStrVal(p+4, &AccumSize, 1, 32); - SetAttrib(AccumSize, GLUT_ACCUM); - } else - if(memcmp(p, "acc", 3) == 0) { - p = GetStrVal(p+3, &AccumSize, 1, 32); - SetAttrib(AccumSize, GLUT_ACCUM); - } else - if(memcmp(p, "depth", 5) == 0) { - p = GetStrVal(p+5, &DepthSize, 12, 32); - SetAttrib(DepthSize, GLUT_DEPTH); - } else - if(memcmp(p, "double", 6) == 0) { - val = 1; - p = GetStrVal(p+6, &val, 0, 1); - SetAttrib(val, GLUT_DOUBLE); - } else - if(memcmp(p, "index", 5) == 0) { - val = 1; - p = GetStrVal(p+5, &val, 0, 1); - SetAttrib(val, GLUT_INDEX); - } else - if(memcmp(p, "stencil", 7) == 0) { - p = GetStrVal(p+7, &StencilSize, 0, 1); - SetAttrib(StencilSize, GLUT_STENCIL); - } else - if(memcmp(p, "samples", 7) == 0) { - NumSamples = 1; - p = GetStrVal(p+7, &NumSamples, 0, 16); - SetAttrib(NumSamples, GLUT_MULTISAMPLE); - } else - if(p = strchr(p, ' ')) - p++; - else - break; - } -} - -void glutInitWindowPosition (int x, int y) -{ -} - -void glutInitWindowSize (int width, int height) -{ -} - -static void ProcessTimers(void) -{ - while(GlutTimers && GlutTimers->time <= glutGet(GLUT_ELAPSED_TIME)) { - struct GlutTimer *timer = GlutTimers; - GlutTimers = timer->next; - timer->func(timer->value); - free(timer); - } -} - -void glutMainLoop(void) -{ - int idleiters; - - if(ReshapeFunc) - ReshapeFunc(VarInfo.xres, VarInfo.yres); - - if(!DisplayFunc) { - sprintf(exiterror, "Fatal Error: No Display Function registered\n"); - exit(0); - } - - for(;;) { - ProcessTimers(); - - if(Active) - ReceiveInput(); - else - if(VisiblePoll) - TestVisible(); - - if(IdleFunc) - IdleFunc(); - - if(VisibleSwitch) { - VisibleSwitch = 0; - if(VisibilityFunc) - VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE); - } - - if(Resized) { - SetVideoMode(); - CreateBuffer(); - - if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { - sprintf(exiterror, "Failure to Make Current\n"); - exit(0); - } - - InitializeMenus(); - - if(ReshapeFunc) - ReshapeFunc(VarInfo.xres, VarInfo.yres); - - Redisplay = 1; - Resized = 0; - } - - if(Visible && Redisplay) { - Redisplay = 0; - EraseCursor(); - DisplayFunc(); - if(!(DisplayMode & GLUT_DOUBLE)) { - if(ActiveMenu) - DrawMenus(); - DrawCursor(); - } - idleiters = 0; - } else { - /* we sleep if not receiving redisplays, and - the main loop is running faster than 2khz */ - - static int lasttime; - int time = glutGet(GLUT_ELAPSED_TIME); - if(time > lasttime) { - if(idleiters >= 2) - usleep(100); - - idleiters = 0; - lasttime = time; - } - idleiters++; - } - } -} - -int ParseFBModes(int minw, int maxw, int minh, int maxh, int minf, int maxf) -{ - char buf[1024]; - struct fb_var_screeninfo vi = VarInfo; - - FILE *fbmodes = fopen(FBMODES, "r"); - - if(!fbmodes) { - sprintf(exiterror, "Warning: could not open "FBMODES"\n"); - return 0; - } - - while(fgets(buf, sizeof buf, fbmodes)) { - char *c; - int v, bpp, freq; - - if(!(c = strstr(buf, "geometry"))) - continue; - v = sscanf(c, "geometry %d %d %d %d %d", &vi.xres, &vi.yres, - &vi.xres_virtual, &vi.yres_virtual, &bpp); - if(v != 5) - continue; - - if(maxw < minw) { - if(maxw < vi.xres && minw > vi.xres) - continue; - } else - if(maxw < vi.xres || minw > vi.xres) - continue; - - if(maxh < minh) { - if(maxh < vi.yres && minh > vi.yres) - continue; - } else - if(maxh < vi.yres || minh > vi.yres) - continue; - - fgets(buf, sizeof buf, fbmodes); - if(!(c = strstr(buf, "timings"))) - continue; - - v = sscanf(c, "timings %d %d %d %d %d %d %d", &vi.pixclock, - &vi.left_margin, &vi.right_margin, &vi.upper_margin, - &vi.lower_margin, &vi.hsync_len, &vi.vsync_len); - - if(v != 7) - continue; - - freq = 1E12/vi.pixclock - /(vi.left_margin + vi.xres + vi.right_margin + vi.hsync_len) - /(vi.upper_margin + vi.yres + vi.lower_margin + vi.vsync_len); - - if(maxf < minf) { - if(maxf < freq && minf > freq) - continue; - } else - if(maxf < freq || minf > freq) - continue; - - VarInfo = vi; - fclose(fbmodes); - return 1; - } - - fclose(fbmodes); - - return 0; -} - -void SetVideoMode(void) -{ - /* set new variable screen info */ - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { - sprintf(exiterror, "FBIOPUT_VSCREENINFO failed: %s\n", strerror(errno)); - strcat(exiterror, "Perhaps the device does not support the selected mode\n"); - exit(0); - } - - /* reload the screen info to update rgb bits */ - if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &VarInfo)) { - sprintf(exiterror, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n", - strerror(errno)); - exit(0); - } - - /* reload the fixed info to update color mode */ - if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) { - sprintf(exiterror, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n", - strerror(errno)); - exit(0); - } - - if (DesiredDepth && DesiredDepth != VarInfo.bits_per_pixel) { - sprintf(exiterror, "error: Could not set set %d bpp\n", DesiredDepth); - exit(0); - } - - if(DisplayMode & GLUT_INDEX && FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) { - sprintf(exiterror, "error: Could not set 8 bit color mode\n"); - exit(0); - } - - /* initialize colormap */ - LoadColorMap(); -} - -void CreateBuffer(void) -{ - int size = VarInfo.xres_virtual * VarInfo.yres_virtual - * VarInfo.bits_per_pixel / 8; - - /* mmap the framebuffer into our address space */ - if(FrameBuffer) - munmap(FrameBuffer, FixedInfo.smem_len); - FrameBuffer = mmap(0, FixedInfo.smem_len, PROT_READ | PROT_WRITE, - MAP_SHARED, FrameBufferFD, 0); - if (FrameBuffer == MAP_FAILED) { - sprintf(exiterror, "error: unable to mmap framebuffer: %s\n", - strerror(errno)); - exit(0); - } - - if(DisplayMode & GLUT_DOUBLE) { - free(BackBuffer); - if(!(BackBuffer = malloc(size))) { - sprintf(exiterror, "Failed to allocate double buffer\n"); - exit(0); - } - } else - BackBuffer = FrameBuffer; - - if(Buffer) - glFBDevDestroyBuffer(Buffer); - - if(!(Buffer = glFBDevCreateBuffer( &FixedInfo, &VarInfo, Visual, - FrameBuffer, BackBuffer, size))) { - sprintf(exiterror, "Failure to create Buffer\n"); - exit(0); - } -} - -void CreateVisual(void) -{ - int i, mask = DisplayMode; - int attribs[20]; - for(i=0; i 0) - InitializeVT(0); - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) { - sprintf(exiterror, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - exit(0); - } - - RestoreColorMap(); - - Redisplay = 1; - VisibleSwitch = 1; - Visible = 1; -} - -void glutIconifyWindow(void) -{ - RestoreVT(); - signal(SIGCONT, UnIconifyWindow); - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) - fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n", - strerror(errno)); - - raise(SIGSTOP); -} - -void glutSetWindowTitle(const char *name) -{ - /* escape code to set title in screen */ - if(getenv("TERM") && memcmp(getenv("TERM"), "screen", 6) == 0) - printf("\033k%s\033\\", name); -} - -void glutSetIconTitle(const char *name) -{ -} diff --git a/src/glut/fbdev/gamemode.c b/src/glut/fbdev/gamemode.c deleted file mode 100644 index 30be36af7a..0000000000 --- a/src/glut/fbdev/gamemode.c +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include -#include -#include - -#include - -#include - -#include "internal.h" - -int GameMode; - -static int ModePossible, DispChanged; -static struct fb_var_screeninfo NormVarInfo, GameVarInfo; - -static GLFBDevContextPtr GameContext; -static GLFBDevVisualPtr NormVisual; - -/* storage for non-gamemode callbacks */ -void (*KeyFuncs[2])(unsigned char key, int x, int y); -static void (*NormFuncs[8])(); - -static const char*SetOpers(const char *p, unsigned int *min, unsigned int *max) -{ - char *endptr; - int comp = *p, val, neq = 0; - - if(p[1] == '=') { - neq = 0; - p++; - } - - val = strtol(p+1, &endptr, 10); - if(endptr == p+1) - return p; - - switch(comp) { - case '=': - *min = *max = val; - break; - case '!': - *min = val + 1; - *max = val - 1; - break; - case '<': - *max = val - neq; - break; - case '>': - *min = val + neq; - break; - } - return endptr; -} - -void glutGameModeString(const char *string) -{ - const char *p = string; - unsigned int minb = 15, maxb = 32; - unsigned int minw = 0, maxw = -1; - unsigned int minh, maxh = -1; - unsigned int minf = 0, maxf = MAX_VSYNC; - char *endptr; - int count = -1, val; - - ModePossible = 0; - - if(DisplayMode & GLUT_INDEX) - minb = maxb = 8; - - again: - count++; - if((val = strtol(p, &endptr, 10)) && *endptr=='x') { - maxw = minw = val; - p = endptr + 1; - maxh = minh = strtol(p, &endptr, 10); - p = endptr; - goto again; - } - - if(*p == ':') { - minb = strtol(p+1, &endptr, 10); - p = endptr; - if(DisplayMode & GLUT_INDEX) { - if(minb != 8) - return; - } else - if(minb != 15 && minb != 16 && minb != 24 && minb != 32) - return; - maxb = minb; - goto again; - } - - if(*p == '@') { - minf = strtol(p+1, &endptr, 10) - 5; - maxf = minf + 10; - p = endptr; - goto again; - } - - if(count == 0) - while(*p) { - if(*p == ' ') - p++; - else - if(memcmp(p, "bpp", 3) == 0) - p = SetOpers(p+3, &minb, &maxb); - else - if(memcmp(p, "height", 6) == 0) - p = SetOpers(p+6, &minh, &maxh); - else - if(memcmp(p, "hertz", 5) == 0) - p = SetOpers(p+5, &minf, &maxf); - else - if(memcmp(p, "width", 5) == 0) - p = SetOpers(p+5, &minw, &maxw); - else - if(p = strchr(p, ' ')) - p++; - else - break; - } - - NormVarInfo = VarInfo; - if(!ParseFBModes(minw, maxw, minh, maxh, minf, maxf)) - return; - - GameVarInfo = VarInfo; - VarInfo = NormVarInfo; - - /* determine optimal bitdepth, make sure we have enough video memory */ - if(VarInfo.bits_per_pixel && VarInfo.bits_per_pixel <= maxb) - GameVarInfo.bits_per_pixel = VarInfo.bits_per_pixel; - else - GameVarInfo.bits_per_pixel = maxb; - - while(FixedInfo.smem_len < GameVarInfo.xres * GameVarInfo.yres - * GameVarInfo.bits_per_pixel / 8) { - if(GameVarInfo.bits_per_pixel < minb) - return; - GameVarInfo.bits_per_pixel = ((GameVarInfo.bits_per_pixel+1)/8)*8-8; - } - - ModePossible = 1; -} - -int glutEnterGameMode(void) -{ - if(ActiveMenu) - return 0; - - if(!ModePossible) - return 0; - - if(GameMode) { - if(!memcmp(&GameVarInfo, &VarInfo, sizeof VarInfo)) { - DispChanged = 0; - return 1; - } - glutLeaveGameMode(); - } - - if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &GameVarInfo)) - return 0; - - NormVarInfo = VarInfo; - VarInfo = GameVarInfo; - - NormVisual = Visual; - SetVideoMode(); - CreateVisual(); - CreateBuffer(); - - if(!(GameContext = glFBDevCreateContext(Visual, NULL))) { - sprintf(exiterror, "Failure to create Context\n"); - exit(0); - } - - if(!glFBDevMakeCurrent( GameContext, Buffer, Buffer )) { - sprintf(exiterror, "Failure to Make Game Current\n"); - exit(0); - } - - InitializeCursor(); - - KeyFuncs[0] = KeyboardFunc; - KeyFuncs[1] = KeyboardUpFunc; - - NormFuncs[0] = DisplayFunc; - NormFuncs[1] = ReshapeFunc; - NormFuncs[2] = MouseFunc; - NormFuncs[3] = MotionFunc; - NormFuncs[4] = PassiveMotionFunc; - NormFuncs[5] = VisibilityFunc; - NormFuncs[6] = SpecialFunc; - NormFuncs[7] = SpecialUpFunc; - - DisplayFunc = NULL; - ReshapeFunc = NULL; - KeyboardFunc = NULL; - KeyboardUpFunc = NULL; - MouseFunc = NULL; - MotionFunc = NULL; - PassiveMotionFunc = NULL; - VisibilityFunc = NULL; - SpecialFunc = SpecialUpFunc = NULL; - - DispChanged = 1; - GameMode = 1; - Visible = 1; - VisibleSwitch = 1; - Redisplay = 1; - return 1; -} - -void glutLeaveGameMode(void) -{ - if(!GameMode) - return; - - glFBDevDestroyContext(GameContext); - glFBDevDestroyVisual(Visual); - - VarInfo = NormVarInfo; - Visual = NormVisual; - - if(Visual) { - SetVideoMode(); - CreateBuffer(); - - if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { - sprintf(exiterror, "Failure to Make Current\n"); - exit(0); - } - - Redisplay = 1; - } - - KeyboardFunc = KeyFuncs[0]; - KeyboardUpFunc = KeyFuncs[1]; - - DisplayFunc = NormFuncs[0]; - ReshapeFunc = NormFuncs[1]; - MouseFunc = NormFuncs[2]; - MotionFunc = NormFuncs[3]; - PassiveMotionFunc = NormFuncs[4]; - VisibilityFunc = NormFuncs[5]; - SpecialFunc = NormFuncs[6]; - SpecialUpFunc = NormFuncs[7]; - - GameMode = 0; -} - -int glutGameModeGet(GLenum mode) { - switch(mode) { - case GLUT_GAME_MODE_ACTIVE: - return GameMode; - case GLUT_GAME_MODE_POSSIBLE: - return ModePossible; - case GLUT_GAME_MODE_DISPLAY_CHANGED: - return DispChanged; - } - - if(!ModePossible) - return -1; - - switch(mode) { - case GLUT_GAME_MODE_WIDTH: - return GameVarInfo.xres; - case GLUT_GAME_MODE_HEIGHT: - return GameVarInfo.yres; - case GLUT_GAME_MODE_PIXEL_DEPTH: - return GameVarInfo.bits_per_pixel; - case GLUT_GAME_MODE_REFRESH_RATE: - return 1E12/GameVarInfo.pixclock - / (GameVarInfo.left_margin + GameVarInfo.xres - + GameVarInfo.right_margin + GameVarInfo.hsync_len) - / (GameVarInfo.upper_margin + GameVarInfo.yres - + GameVarInfo.lower_margin + GameVarInfo.vsync_len); - } -} diff --git a/src/glut/fbdev/input.c b/src/glut/fbdev/input.c deleted file mode 100644 index 1445682c76..0000000000 --- a/src/glut/fbdev/input.c +++ /dev/null @@ -1,828 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include - -#include "internal.h" - -#define MOUSEDEV "/dev/gpmdata" - -#ifdef HAVE_GPM -#include -int GpmMouse; -#endif - -int CurrentVT = 0; -int ConsoleFD = -1; - -int KeyboardModifiers; - -int MouseX, MouseY; -int NumMouseButtons; - -double MouseSpeed = 0; - -int KeyRepeatMode = GLUT_KEY_REPEAT_DEFAULT; - -int MouseVisible = 0; -int LastMouseTime = 0; - -static int OldKDMode = -1; -static int OldMode = KD_TEXT; -static struct vt_mode OldVTMode; -static struct termios OldTermios; - -static int KeyboardLedState; - -static int MouseFD; - -static int kbdpipe[2]; - -static int LastStdinKeyTime, LastStdinSpecialKey = -1, LastStdinCode = -1; - -#define MODIFIER(mod) \ - KeyboardModifiers = release ? KeyboardModifiers & ~mod \ - : KeyboardModifiers | mod; - -/* signal handler attached to SIGIO on keyboard input, vt - switching and modifiers is handled in the signal handler - other keypresses read from a pipe that leaves the handler - if a program locks up the glut loop, you can still switch - vts and kill it without Alt-SysRq hack */ -static void KeyboardHandler(int sig) -{ - unsigned char code; - - while(read(ConsoleFD, &code, 1) == 1) { - int release, labelval; - struct kbentry entry; - static int lalt; /* only left alt does vt switch */ - - release = code & 0x80; - - entry.kb_index = code & 0x7F; - entry.kb_table = 0; - - if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { - sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); - exit(0); - } - - labelval = entry.kb_value; - - switch(labelval) { - case K_SHIFT: - case K_SHIFTL: - MODIFIER(GLUT_ACTIVE_SHIFT); - continue; - case K_CTRL: - MODIFIER(GLUT_ACTIVE_CTRL); - continue; - case K_ALT: - lalt = !release; - case K_ALTGR: - MODIFIER(GLUT_ACTIVE_ALT); - continue; - } - - if(lalt && !release) { - /* VT switch, we must do it */ - int vt = -1; - struct vt_stat st; - if(labelval >= K_F1 && labelval <= K_F12) - vt = labelval - K_F1 + 1; - - if(labelval == K_LEFT) - if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) - vt = st.v_active - 1; - - if(labelval == K_RIGHT) - if(ioctl(ConsoleFD, VT_GETSTATE, &st) >= 0) - vt = st.v_active + 1; - - if(vt != -1) { - if(Swapping) - VTSwitch = vt; - else - if(ioctl(ConsoleFD, VT_ACTIVATE, vt) < 0) - sprintf(exiterror, "Error switching console\n"); - continue; - } - } - write(kbdpipe[1], &code, 1); - } -} - -static void LedModifier(int led, int release) -{ - static int releaseflag = K_CAPS | K_NUM | K_HOLD; - if(release) - releaseflag |= led; - else - if(releaseflag & led) { - KeyboardLedState ^= led; - releaseflag &= ~led; - } - - ioctl(ConsoleFD, KDSKBLED, KeyboardLedState); - ioctl(ConsoleFD, KDSETLED, 0x80); -} - -static void HandleKeyPress(unsigned char key, int up) -{ - if(up) { - if(KeyboardUpFunc) - KeyboardUpFunc(key, MouseX, MouseY); - } else - if(KeyboardFunc) - KeyboardFunc(key, MouseX, MouseY); - else - if(key == 27) - exit(0); /* no handler, to provide a way to exit */ -} - -static void HandleSpecialPress(int key, int up) -{ - if(up) { - if(SpecialUpFunc) - SpecialUpFunc(key, MouseX, MouseY); - } else - if(SpecialFunc) - SpecialFunc(key, MouseX, MouseY); -} - -static void ReleaseStdinKey(void) -{ - if(LastStdinSpecialKey != -1) { - HandleSpecialPress(LastStdinSpecialKey, 1); - LastStdinSpecialKey = -1; - } - if(LastStdinCode != -1) { - HandleKeyPress(LastStdinCode, 1); - LastStdinCode = -1; - } -} - -#define READKEY read(kbdpipe[0], &code, 1) -static int ReadKey(void) -{ - int release, labelval, labelvalnoshift; - unsigned char code; - int specialkey = 0; - struct kbentry entry; - - if(READKEY != 1) { - /* if we are reading from stdin, we detect key releases when the key - does not repeat after a given timeout */ - if(ConsoleFD == 0 && LastStdinKeyTime + 100 < glutGet(GLUT_ELAPSED_TIME)) - ReleaseStdinKey(); - return 0; - } - - if(code == 0) - return 0; - - /* stdin input escape code based */ - if(ConsoleFD == 0) { - KeyboardModifiers = 0; - altset: - if(code == 27 && READKEY == 1) { - if(code != 91) { - KeyboardModifiers |= GLUT_ACTIVE_ALT; - goto altset; - } - READKEY; - switch(code) { - case 68: - specialkey = GLUT_KEY_LEFT; break; - case 65: - specialkey = GLUT_KEY_UP; break; - case 67: - specialkey = GLUT_KEY_RIGHT; break; - case 66: - specialkey = GLUT_KEY_DOWN; break; - case 52: - specialkey = GLUT_KEY_END; READKEY; break; - case 53: - specialkey = GLUT_KEY_PAGE_UP; READKEY; break; - case 54: - specialkey = GLUT_KEY_PAGE_DOWN; READKEY; break; - case 49: - READKEY; - if(code == 126) - specialkey = GLUT_KEY_HOME; - else { - specialkey = GLUT_KEY_F1 + code - 50; - READKEY; - } - break; - case 50: - READKEY; - if(code == 126) - specialkey = GLUT_KEY_INSERT; - else { - if(code > '1') - code--; - if(code > '6') - code--; - if(code > '3') { - KeyboardModifiers |= GLUT_ACTIVE_SHIFT; - code -= 12; - } - specialkey = GLUT_KEY_F1 + code - 40; - READKEY; - } - break; - case 51: - READKEY; - if(code == 126) { - code = '\b'; - goto stdkey; - } - KeyboardModifiers |= GLUT_ACTIVE_SHIFT; - specialkey = GLUT_KEY_F1 + code - 45; - READKEY; - break; - case 91: - READKEY; - specialkey = GLUT_KEY_F1 + code - 65; - break; - default: - return 0; - } - } - - if(specialkey) { - LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); - - if(LastStdinSpecialKey != specialkey) { - ReleaseStdinKey(); - HandleSpecialPress(specialkey, 0); - LastStdinSpecialKey = specialkey; - LastStdinKeyTime += 200; /* initial repeat */ - } else - if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) - HandleSpecialPress(specialkey, 0); - } else { - if(code >= 1 && code <= 26 && code != '\r') { - KeyboardModifiers |= GLUT_ACTIVE_CTRL; - code += 'a' - 1; - } - if((code >= 43 && code <= 34) || (code == 60) - || (code >= 62 && code <= 90) || (code == 94) - || (code == 95) || (code >= 123 && code <= 126)) - KeyboardModifiers |= GLUT_ACTIVE_SHIFT; - - stdkey: - LastStdinKeyTime = glutGet(GLUT_ELAPSED_TIME); - if(LastStdinCode != code) { - ReleaseStdinKey(); - HandleKeyPress(code, 0); - LastStdinCode = code; - LastStdinKeyTime += 200; /* initial repeat */ - } else - if(KeyRepeatMode != GLUT_KEY_REPEAT_OFF) - HandleSpecialPress(code, 0); - } - return 1; - } - - /* linux kbd reading */ - release = code & 0x80; - code &= 0x7F; - - if(KeyRepeatMode == GLUT_KEY_REPEAT_OFF) { - static char keystates[128]; - if(release) - keystates[code] = 0; - else { - if(keystates[code]) - return 1; - keystates[code] = 1; - } - } - - entry.kb_index = code; - entry.kb_table = 0; - - if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { - sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); - exit(0); - } - - labelvalnoshift = entry.kb_value; - - if(KeyboardModifiers & GLUT_ACTIVE_SHIFT) - entry.kb_table |= K_SHIFTTAB; - - if (ioctl(ConsoleFD, KDGKBENT, &entry) < 0) { - sprintf(exiterror, "ioctl(KDGKBENT) failed.\n"); - exit(0); - } - - labelval = entry.kb_value; - - switch(labelvalnoshift) { - case K_CAPS: - LedModifier(LED_CAP, release); - return 0; - case K_NUM: - LedModifier(LED_NUM, release); - return 0; - case K_HOLD: /* scroll lock suspends glut */ - LedModifier(LED_SCR, release); - while(KeyboardLedState & LED_SCR) { - usleep(10000); - ReadKey(); - } - return 0; - } - - /* we could queue keypresses here */ - if(KeyboardLedState & LED_SCR) - return 0; - - if(labelvalnoshift >= K_F1 && labelvalnoshift <= K_F12) - specialkey = GLUT_KEY_F1 + labelvalnoshift - K_F1; - else - switch(labelvalnoshift) { - case K_LEFT: - specialkey = GLUT_KEY_LEFT; break; - case K_UP: - specialkey = GLUT_KEY_UP; break; - case K_RIGHT: - specialkey = GLUT_KEY_RIGHT; break; - case K_DOWN: - specialkey = GLUT_KEY_DOWN; break; - case K_PGUP: - specialkey = GLUT_KEY_PAGE_UP; break; - case K_PGDN: - specialkey = GLUT_KEY_PAGE_DOWN; break; - case K_FIND: - specialkey = GLUT_KEY_HOME; break; - case K_SELECT: - specialkey = GLUT_KEY_END; break; - case K_INSERT: - specialkey = GLUT_KEY_INSERT; break; - case K_REMOVE: - labelval = '\b'; - break; - case K_ENTER: - labelval = '\r'; break; - } - - /* likely a keypad input, but depends on keyboard mapping, ignore */ - if(labelval == 512) - return 1; - - /* dispatch callback */ - if(specialkey) - HandleSpecialPress(specialkey, release); - else { - char c = labelval; - - if(KeyboardLedState & LED_CAP) { - if(c >= 'A' && c <= 'Z') - c += 'a' - 'A'; - else - if(c >= 'a' && c <= 'z') - c += 'A' - 'a'; - } - HandleKeyPress(c, release); - } - return 1; -} - -void glutIgnoreKeyRepeat(int ignore) -{ - KeyRepeatMode = ignore ? GLUT_KEY_REPEAT_OFF : GLUT_KEY_REPEAT_ON; -} - -void glutSetKeyRepeat(int repeatMode) -{ - KeyRepeatMode = repeatMode; -} - -void glutForceJoystickFunc(void) -{ -} - -static void HandleMousePress(int button, int pressed) -{ - if(TryMenu(button, pressed)) - return; - - if(MouseFunc) - MouseFunc(button, pressed ? GLUT_DOWN : GLUT_UP, MouseX, MouseY); -} - -static int ReadMouse(void) -{ - int l, r, m; - static int ll, lm, lr; - signed char dx, dy; - -#ifdef HAVE_GPM - if(GpmMouse) { - Gpm_Event event; - struct pollfd pfd; - pfd.fd = gpm_fd; - pfd.events = POLLIN; - if(poll(&pfd, 1, 1) != 1) - return 0; - - if(Gpm_GetEvent(&event) != 1) - return 0; - - l = event.buttons & GPM_B_LEFT; - m = event.buttons & GPM_B_MIDDLE; - r = event.buttons & GPM_B_RIGHT; - - /* gpm is weird in that it gives a button number when the button - is released, with type set to GPM_UP, this is only a problem - if it is the last button released */ - - if(event.type & GPM_UP) - if(event.buttons == GPM_B_LEFT || event.buttons == GPM_B_MIDDLE || - event.buttons == GPM_B_RIGHT || event.buttons == GPM_B_FOURTH) - l = m = r = 0; - - dx = event.dx; - dy = event.dy; - } else -#endif - { - char data[4]; - - if(MouseFD == -1) - return 0; - - if(read(MouseFD, data, 4) != 4) - return 0; - - l = ((data[0] & 0x20) >> 3); - m = ((data[3] & 0x10) >> 3); - r = ((data[0] & 0x10) >> 4); - - dx = (((data[0] & 0x03) << 6) | (data[1] & 0x3F)); - dy = (((data[0] & 0x0C) << 4) | (data[2] & 0x3F)); - } - - MouseX += dx * MouseSpeed; - if(MouseX < 0) - MouseX = 0; - else - if(MouseX >= VarInfo.xres) - MouseX = VarInfo.xres - 1; - - MouseY += dy * MouseSpeed; - if(MouseY < 0) - MouseY = 0; - else - if(MouseY >= VarInfo.yres) - MouseY = VarInfo.yres - 1; - - if(l != ll) - HandleMousePress(GLUT_LEFT_BUTTON, l); - if(m != lm) - HandleMousePress(GLUT_MIDDLE_BUTTON, m); - if(r != lr) - HandleMousePress(GLUT_RIGHT_BUTTON, r); - - ll = l, lm = m, lr = r; - - if(dx || dy || !MouseVisible) { - if(l || m || r) { - if(MotionFunc) - MotionFunc(MouseX, MouseY); - } else - if(PassiveMotionFunc) - PassiveMotionFunc(MouseX, MouseY); - - EraseCursor(); - - MouseVisible = 1; - - if(ActiveMenu) - Redisplay = 1; - else - SwapCursor(); - } - - LastMouseTime = glutGet(GLUT_ELAPSED_TIME); - - return 1; -} - -void ReceiveInput(void) -{ - if(ConsoleFD != -1) - while(ReadKey()); - - while(ReadMouse()); - - /* implement a 2 second timeout on the mouse */ - if(MouseVisible && glutGet(GLUT_ELAPSED_TIME) - LastMouseTime > 2000) { - EraseCursor(); - MouseVisible = 0; - SwapCursor(); - } -} - -static void VTSwitchHandler(int sig) -{ - struct vt_stat st; - switch(sig) { - case SIGUSR1: - ioctl(ConsoleFD, VT_RELDISP, 1); - Active = 0; -#ifdef MULTIHEAD - VisiblePoll = 1; - TestVisible(); -#else - VisibleSwitch = 1; - Visible = 0; -#endif - break; - case SIGUSR2: - ioctl(ConsoleFD, VT_GETSTATE, &st); - if(st.v_active) - ioctl(ConsoleFD, VT_RELDISP, VT_ACKACQ); - - RestoreColorMap(); - - Active = 1; - Visible = 1; - VisibleSwitch = 1; - - Redisplay = 1; - break; - } -} - -void InitializeVT(int usestdin) -{ - struct termios tio; - struct vt_mode vt; - char console[128]; - - signal(SIGIO, SIG_IGN); - - Active = 1; - - if(usestdin) { - ConsoleFD = 0; - goto setattribs; - } - - /* detect the current vt if it was not specified */ - if(CurrentVT == 0) { - int fd = open("/dev/tty", O_RDWR | O_NDELAY, 0); - struct vt_stat st; - if(fd == -1) { - sprintf(exiterror, "Failed to open /dev/tty\n"); - exit(0); - } - - if(ioctl(fd, VT_GETSTATE, &st) == -1) { - fprintf(stderr, "Could not detect current vt, specify with -vt\n"); - fprintf(stderr, "Defaulting to stdin input\n"); - ConsoleFD = 0; - close(fd); - goto setattribs; - } - - CurrentVT = st.v_active; - close(fd); - } - - /* if we close with the modifier set in glutIconifyWindow, we won't - get the signal when they are released, so set to zero here */ - KeyboardModifiers = 0; - - /* open the console tty */ - sprintf(console, "/dev/tty%d", CurrentVT); - ConsoleFD = open(console, O_RDWR | O_NDELAY, 0); - if (ConsoleFD < 0) { - sprintf(exiterror, "error couldn't open %s," - " defaulting to stdin \n", console); - ConsoleFD = 0; - goto setattribs; - } - - signal(SIGUSR1, VTSwitchHandler); - signal(SIGUSR2, VTSwitchHandler); - - if (ioctl(ConsoleFD, VT_GETMODE, &OldVTMode) < 0) { - sprintf(exiterror,"Failed to grab %s, defaulting to stdin\n", console); - close(ConsoleFD); - ConsoleFD = 0; - goto setattribs; - } - - vt = OldVTMode; - - vt.mode = VT_PROCESS; - vt.waitv = 0; - vt.relsig = SIGUSR1; - vt.acqsig = SIGUSR2; - if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) { - sprintf(exiterror, "error: ioctl(VT_SETMODE) failed: %s\n", - strerror(errno)); - close(ConsoleFD); - ConsoleFD = 0; - exit(1); - } - - if (ioctl(ConsoleFD, KDGKBMODE, &OldKDMode) < 0) { - sprintf(exiterror, "Warning: ioctl KDGKBMODE failed!\n"); - OldKDMode = K_XLATE; - } - - /* use SIGIO so VT switching can work if the program is locked */ - signal(SIGIO, KeyboardHandler); - - pipe(kbdpipe); - - if(fcntl(kbdpipe[0], F_SETFL, O_NONBLOCK | O_ASYNC) < 0) { - sprintf(exiterror, "Failed to set keyboard to non-blocking\n"); - exit(0); - } - - fcntl(ConsoleFD, F_SETOWN, getpid()); - - if(ioctl(ConsoleFD, KDGETMODE, &OldMode) < 0) - sprintf(exiterror, "Warning: Failed to get terminal mode\n"); - -#ifdef HAVE_GPM - if(!GpmMouse) -#endif - if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) - sprintf(exiterror,"Warning: Failed to set terminal to graphics\n"); - - if(ioctl(ConsoleFD, KDSKBMODE, K_MEDIUMRAW) < 0) { - sprintf(exiterror, "ioctl KDSKBMODE failed!\n"); - exit(0); - } - - if(ioctl(ConsoleFD, KDGKBLED, &KeyboardLedState) < 0) { - sprintf(exiterror, "ioctl KDGKBLED failed!\n"); - exit(0); - } - - setattribs: - /* enable async input input */ - if(fcntl(ConsoleFD, F_SETFL, O_ASYNC) < 0) { - sprintf(exiterror, "Failed to set O_ASYNC mode on fd %d\n", ConsoleFD); - exit(0); - } - - /* save old terminos settings */ - if (tcgetattr(ConsoleFD, &OldTermios) < 0) { - sprintf(exiterror, "tcgetattr failed\n"); - exit(0); - } - - tio = OldTermios; - - /* terminos settings for straight-through mode */ - tio.c_lflag &= ~(ICANON | ECHO | ISIG); - tio.c_iflag &= ~(ISTRIP | IGNCR | ICRNL | INLCR | IXOFF | IXON); - tio.c_iflag |= IGNBRK; - - tio.c_cc[VMIN] = 0; - tio.c_cc[VTIME] = 0; - - if (tcsetattr(ConsoleFD, TCSANOW, &tio) < 0) { - sprintf(exiterror, "tcsetattr failed\n"); - exit(0); - } -} - -void RestoreVT(void) -{ - if(ConsoleFD < 0) - return; - - if (tcsetattr(ConsoleFD, TCSANOW, &OldTermios) < 0) - sprintf(exiterror, "tcsetattr failed\n"); - - /* setting the mode to text from graphics restores the colormap */ - if( -#ifdef HAVE_GPM - !GpmMouse || -#endif - ConsoleFD == 0) - if(ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) - goto skipioctl; /* no need to fail twice */ - - if(ioctl(ConsoleFD, KDSETMODE, OldMode) < 0) - fprintf(stderr, "ioctl KDSETMODE failed!\n"); - - skipioctl: - - if(ConsoleFD == 0) - return; - - /* restore keyboard state */ - if (ioctl(ConsoleFD, VT_SETMODE, &OldVTMode) < 0) - fprintf(stderr, "Failed to set vtmode\n"); - - if (ioctl(ConsoleFD, KDSKBMODE, OldKDMode) < 0) - fprintf(stderr, "ioctl KDSKBMODE failed!\n"); - - close(ConsoleFD); - - close(kbdpipe[0]); - close(kbdpipe[1]); -} - -void InitializeMouse(void) -{ -#ifdef HAVE_GPM - if(!GpmMouse) -#endif - { - const char *mousedev = getenv("MOUSE"); - if(!mousedev) - mousedev = MOUSEDEV; - if((MouseFD = open(mousedev, O_RDONLY | O_NONBLOCK)) >= 0) { - if(!MouseSpeed) - MouseSpeed = 1; - NumMouseButtons = 3; - return; - } - } -#ifdef HAVE_GPM - { - Gpm_Connect conn; - int c; - conn.eventMask = ~0; /* Want to know about all the events */ - conn.defaultMask = 0; /* don't handle anything by default */ - conn.minMod = 0; /* want everything */ - conn.maxMod = ~0; /* all modifiers included */ - if(Gpm_Open(&conn, 0) != -1) { - if(!MouseSpeed) - MouseSpeed = 8; - NumMouseButtons = 3; - return; - } - fprintf(stderr, "Cannot open gpmctl.\n"); - } -#endif - fprintf(stderr,"Cannot open %s.\n" - "Continuing without Mouse\n", MOUSEDEV); -} - -void CloseMouse(void) -{ -#ifdef HAVE_GPM - if(GpmMouse) { - if(NumMouseButtons) - Gpm_Close(); - } else -#endif - if(MouseFD >= 0) - close(MouseFD); -} diff --git a/src/glut/fbdev/internal.h b/src/glut/fbdev/internal.h deleted file mode 100644 index 0a159d96b0..0000000000 --- a/src/glut/fbdev/internal.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include -#include -#include - -#define MULTIHEAD /* enable multihead hacks, - it allows the program to continue drawing - without reading input when a second fbdev - has keyboard focus it can cause - screen corruption that requires C-l to fix */ -#define HAVE_GPM - -#define MAX_VSYNC 200 - -/* this causes these symbols to not be exported */ -#pragma GCC visibility push(hidden) - - -/* --------- fbdev ------------ */ -extern int Redisplay; -extern int Visible; -extern int VisibleSwitch; -extern int Active; -extern int VisiblePoll; -extern int Swapping, VTSwitch; - -void TestVisible(void); -int ParseFBModes(int, int, int, int, int, int); -void SetVideoMode(void); -void CreateBuffer(void); -void CreateVisual(void); - -extern int FrameBufferFD; -extern unsigned char *FrameBuffer; -extern unsigned char *BackBuffer; -extern int DisplayMode; - -extern char exiterror[256]; - -extern struct fb_fix_screeninfo FixedInfo; -extern struct fb_var_screeninfo VarInfo; - -extern GLFBDevContextPtr Context; -extern GLFBDevBufferPtr Buffer; -extern GLFBDevVisualPtr Visual; - -/* --- colormap --- */ -#define REVERSECMAPSIZELOG 3 -#define REVERSECMAPSIZE (1< -#include -#include - -#include - -#include - -#include "internal.h" - -#define MENU_FONT_WIDTH 9 -#define MENU_FONT_HEIGHT 15 -#define MENU_FONT GLUT_BITMAP_9_BY_15 -#define SUBMENU_OFFSET 20 - -struct GlutMenu *Menus; -int ActiveMenu; -int CurrentMenu; - -static double MenuProjection[16]; - -static int AttachedMenus[3]; -static int NumMenus = 1; -static int SelectedMenu; - -void InitializeMenus(void) -{ - glPushAttrib(GL_TRANSFORM_BIT); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - gluOrtho2D(0.0, VarInfo.xres, VarInfo.yres, 0.0); - glGetDoublev(GL_PROJECTION_MATRIX, MenuProjection); - - glPopMatrix(); - glPopAttrib(); -} - -void FreeMenus(void) -{ - int i, j; - - for(i = 1; i= *y && MouseY < *y + MENU_FONT_HEIGHT && - MouseX >= x && MouseX < x + Menus[menu].width) { - a = 1; - SelectedMenu = menu; - ret = 0; - Menus[menu].selected = i; - glColor3f(1,0,0); - } else - glColor3f(1,1,1); - - *y += MENU_FONT_HEIGHT; - glRasterPos2i(x, *y); - for(; *s; s++) - glutBitmapCharacter(MENU_FONT, *s); - - if(Menus[menu].selected == i) - if(Menus[menu].Items[i].submenu) - if(DrawMenu(Menus[menu].Items[i].submenu, x - + SUBMENU_OFFSET, y)) { - if(!a) - Menus[menu].selected = -1; - } else - ret = 0; - } - return ret; -} - -void DrawMenus(void) -{ - int x, y; - - if(GameMode) - return; - - x = Menus[ActiveMenu].x; - y = Menus[ActiveMenu].y; - - /* save old settings */ - glPushAttrib(GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT - | GL_ENABLE_BIT | GL_VIEWPORT_BIT); - - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadMatrixd(MenuProjection); - glViewport(0, 0, VarInfo.xres, VarInfo.yres); - - glDisable(GL_DEPTH_TEST); - glDisable(GL_ALPHA_TEST); - glDisable(GL_LIGHTING); - glDisable(GL_FOG); - glDisable(GL_TEXTURE_2D); - glEnable(GL_COLOR_LOGIC_OP); - glLogicOp(GL_AND_REVERSE); - - if(DrawMenu(ActiveMenu, x, &y)) - Menus[ActiveMenu].selected = -1; - - /* restore settings */ - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - - glPopAttrib(); -} - -void OpenMenu(void) -{ - if(MenuStatusFunc) - MenuStatusFunc(GLUT_MENU_IN_USE, MouseX, MouseY); - if(MenuStateFunc) - MenuStateFunc(GLUT_MENU_IN_USE); - Menus[ActiveMenu].x = MouseX-Menus[ActiveMenu].width/2; - - if(Menus[ActiveMenu].x < 0) - Menus[ActiveMenu].x = 0; - if(Menus[ActiveMenu].x + Menus[ActiveMenu].width >= VarInfo.xres) - Menus[ActiveMenu].x = VarInfo.xres - Menus[ActiveMenu].width - 1; - - Menus[ActiveMenu].y = MouseY-Menus[ActiveMenu].NumItems*MENU_FONT_HEIGHT/2; - Menus[ActiveMenu].selected = -1; -} - -void CloseMenu(void) -{ - if(MenuStatusFunc) - MenuStatusFunc(GLUT_MENU_NOT_IN_USE, MouseX, MouseY); - if(MenuStateFunc) - MenuStateFunc(GLUT_MENU_NOT_IN_USE); - if(SelectedMenu > 0) { - int selected = Menus[SelectedMenu].selected; - if(selected >= 0) - if(Menus[SelectedMenu].Items[selected].submenu == 0) - Menus[SelectedMenu].func(Menus[SelectedMenu].Items - [selected].value); - } - -} - -/* glut menu functions */ - -int glutCreateMenu(void (*func)(int value)) -{ - CurrentMenu = NumMenus; - NumMenus++; - Menus = realloc(Menus, sizeof(*Menus) * NumMenus); - Menus[CurrentMenu].NumItems = 0; - Menus[CurrentMenu].Items = NULL; - Menus[CurrentMenu].func = func; - Menus[CurrentMenu].width = 0; - return CurrentMenu; -} - -void glutSetMenu(int menu) -{ - CurrentMenu = menu; -} - -int glutGetMenu(void) -{ - return CurrentMenu; -} - -void glutDestroyMenu(int menu) -{ - if(menu == CurrentMenu) - CurrentMenu = 0; -} - -static void NameMenuEntry(int entry, const char *name) -{ - int cm = CurrentMenu; - if(!(Menus[cm].Items[entry-1].name = realloc(Menus[cm].Items[entry-1].name, - strlen(name) + 1))) { - sprintf(exiterror, "realloc failed in NameMenuEntry\n"); - exit(0); - } - strcpy(Menus[cm].Items[entry-1].name, name); - if(strlen(name) * MENU_FONT_WIDTH > Menus[cm].width) - Menus[cm].width = strlen(name) * MENU_FONT_WIDTH; -} - -static int AddMenuItem(const char *name) -{ - int cm = CurrentMenu; - int item = Menus[cm].NumItems++; - if(!(Menus[cm].Items = realloc(Menus[cm].Items, - Menus[cm].NumItems * sizeof(*Menus[0].Items)))) { - sprintf(exiterror, "realloc failed in AddMenuItem\n"); - exit(0); - } - Menus[cm].Items[item].name = NULL; - NameMenuEntry(item+1, name); - return item; -} - -void glutAddMenuEntry(const char *name, int value) -{ - int item = AddMenuItem(name); - Menus[CurrentMenu].Items[item].value = value; - Menus[CurrentMenu].Items[item].submenu = 0; -} - -void glutAddSubMenu(const char *name, int menu) -{ - int item = AddMenuItem(name); - if(menu == CurrentMenu) { - sprintf(exiterror, "Recursive menus not supported\n"); - exit(0); - } - Menus[CurrentMenu].Items[item].submenu = menu; -} - -void glutChangeToMenuEntry(int entry, const char *name, int value) -{ - NameMenuEntry(entry, name); - Menus[CurrentMenu].Items[entry-1].value = value; - Menus[CurrentMenu].Items[entry-1].submenu = 0; -} - -void glutChangeToSubMenu(int entry, const char *name, int menu) -{ - NameMenuEntry(entry, name); - Menus[CurrentMenu].Items[entry-1].submenu = menu; -} - -void glutRemoveMenuItem(int entry) -{ - memmove(Menus[CurrentMenu].Items + entry - 1, - Menus[CurrentMenu].Items + entry, - sizeof(*Menus[0].Items) * (Menus[CurrentMenu].NumItems - entry)); - Menus[CurrentMenu].NumItems--; -} - -void glutAttachMenu(int button) -{ - AttachedMenus[button] = CurrentMenu; -} - -void glutDetachMenu(int button) -{ - AttachedMenus[button] = 0; -} diff --git a/src/glut/fbdev/overlay.c b/src/glut/fbdev/overlay.c deleted file mode 100644 index 374cf30e7d..0000000000 --- a/src/glut/fbdev/overlay.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include -#include - -void glutEstablishOverlay(void) -{ - exit(0); -} - -void glutUseLayer(GLenum layer) -{ -} - -void glutRemoveOverlay(void) -{ -} - -void glutPostOverlayRedisplay(void) -{ -} - -void glutPostWindowOverlayRedisplay(int win) -{ -} - -void glutShowOverlay(void) -{ -} - -void glutHideOverlay(void) -{ -} diff --git a/src/glut/fbdev/state.c b/src/glut/fbdev/state.c deleted file mode 100644 index 212a04aa02..0000000000 --- a/src/glut/fbdev/state.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -#include -#include - -#include - -#include - -#include "../../mesa/main/config.h" - -#include "internal.h" - -int AccumSize = 16; /* per channel size of accumulation buffer */ -int DepthSize = DEFAULT_SOFTWARE_DEPTH_BITS; -int StencilSize = STENCIL_BITS; -int NumSamples = 4; - -int glutGet(GLenum state) -{ - switch(state) { - case GLUT_WINDOW_X: - return 0; - case GLUT_WINDOW_Y: - return 0; - case GLUT_INIT_WINDOW_WIDTH: - case GLUT_WINDOW_WIDTH: - case GLUT_SCREEN_WIDTH: - return VarInfo.xres; - case GLUT_INIT_WINDOW_HEIGHT: - case GLUT_WINDOW_HEIGHT: - case GLUT_SCREEN_HEIGHT: - return VarInfo.yres; - case GLUT_WINDOW_BUFFER_SIZE: - return VarInfo.bits_per_pixel; - case GLUT_WINDOW_STENCIL_SIZE: - return StencilSize; - case GLUT_WINDOW_DEPTH_SIZE: - return DepthSize; - case GLUT_WINDOW_RED_SIZE: - return VarInfo.red.length; - case GLUT_WINDOW_GREEN_SIZE: - return VarInfo.green.length; - case GLUT_WINDOW_BLUE_SIZE: - return VarInfo.green.length; - case GLUT_WINDOW_ALPHA_SIZE: - return VarInfo.transp.length; - case GLUT_WINDOW_ACCUM_RED_SIZE: - case GLUT_WINDOW_ACCUM_GREEN_SIZE: - case GLUT_WINDOW_ACCUM_BLUE_SIZE: - case GLUT_WINDOW_ACCUM_ALPHA_SIZE: - return AccumSize; - case GLUT_WINDOW_DOUBLEBUFFER: - if(DisplayMode & GLUT_DOUBLE) - return 1; - return 0; - case GLUT_WINDOW_RGBA: - if(DisplayMode & GLUT_INDEX) - return 0; - return 1; - case GLUT_WINDOW_PARENT: - return 0; - case GLUT_WINDOW_NUM_CHILDREN: - return 0; - case GLUT_WINDOW_COLORMAP_SIZE: - if(DisplayMode & GLUT_INDEX) - return 256; - return 0; - case GLUT_WINDOW_NUM_SAMPLES: - return NumSamples; - case GLUT_WINDOW_STEREO: - return 0; - case GLUT_WINDOW_CURSOR: - return CurrentCursor; - case GLUT_SCREEN_WIDTH_MM: - return VarInfo.width; - case GLUT_SCREEN_HEIGHT_MM: - return VarInfo.height; - case GLUT_MENU_NUM_ITEMS: - if(CurrentMenu) - return Menus[CurrentMenu].NumItems; - return 0; - case GLUT_DISPLAY_MODE_POSSIBLE: - if((DisplayMode & GLUT_MULTISAMPLE) - || (DisplayMode & GLUT_STEREO) - || (DisplayMode & GLUT_LUMINANCE) - || (DisplayMode & GLUT_ALPHA) && (DisplayMode & GLUT_INDEX)) - return 0; - return 1; - case GLUT_INIT_DISPLAY_MODE: - return DisplayMode; - case GLUT_INIT_WINDOW_X: - case GLUT_INIT_WINDOW_Y: - return 0; - case GLUT_ELAPSED_TIME: - { - static struct timeval tv; - gettimeofday(&tv, 0); - return 1000 * (tv.tv_sec - StartTime.tv_sec) - + (tv.tv_usec - StartTime.tv_usec) / 1000; - } - } - return -1; -} - -int glutLayerGet(GLenum info) -{ - switch(info) { - case GLUT_OVERLAY_POSSIBLE: - return 0; - case GLUT_LAYER_IN_USE: - return GLUT_NORMAL; - case GLUT_HAS_OVERLAY: - return 0; - case GLUT_TRANSPARENT_INDEX: - return -1; - case GLUT_NORMAL_DAMAGED: - return Redisplay; - case GLUT_OVERLAY_DAMAGED: - return -1; - } - return -1; -} - -int glutDeviceGet(GLenum info) -{ - switch(info) { - case GLUT_HAS_KEYBOARD: - return ConsoleFD != -1 ? 1 : 0; - case GLUT_HAS_MOUSE: - case GLUT_NUM_MOUSE_BUTTONS: - return NumMouseButtons; - case GLUT_HAS_SPACEBALL: - case GLUT_HAS_DIAL_AND_BUTTON_BOX: - case GLUT_HAS_TABLET: - return 0; - case GLUT_NUM_SPACEBALL_BUTTONS: - case GLUT_NUM_BUTTON_BOX_BUTTONS: - case GLUT_NUM_DIALS: - case GLUT_NUM_TABLET_BUTTONS: - return 0; - case GLUT_DEVICE_IGNORE_KEY_REPEAT: - return KeyRepeatMode == GLUT_KEY_REPEAT_OFF; - case GLUT_DEVICE_KEY_REPEAT: - return KeyRepeatMode; - case GLUT_JOYSTICK_POLL_RATE: - case GLUT_HAS_JOYSTICK: - case GLUT_JOYSTICK_BUTTONS: - case GLUT_JOYSTICK_AXES: - return 0; - } - return -1; -} - -int glutGetModifiers(void){ - return KeyboardModifiers; -} - -int glutExtensionSupported(const char *extension) -{ - const char *exts = (const char *) glGetString(GL_EXTENSIONS); - const char *start = exts; - int len = strlen(extension); - for(;;) { - const char *p = strstr(exts, extension); - if(!p) - break; - if((p == start || p[-1] == ' ') && (p[len] == ' ' || p[len] == 0)) - return 1; - exts = p + len; - } - return 0; -} diff --git a/src/glut/fbdev/stroke.c b/src/glut/fbdev/stroke.c deleted file mode 100644 index 1943ac661b..0000000000 --- a/src/glut/fbdev/stroke.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - * - * To improve on this library, maybe support subwindows or overlays, - * I (sean at depagnier dot com) will do my best to help. - */ - -#include -#include "glutstroke.h" - -void glutStrokeCharacter(GLUTstrokeFont font, int c) -{ - const StrokeCharRec *ch; - const StrokeRec *stroke; - const CoordRec *coord; - StrokeFontPtr fontinfo = (StrokeFontPtr) font; - int i, j; - - if (c < 0 || c >= fontinfo->num_chars) - return; - ch = &(fontinfo->ch[c]); - if (ch) { - for (i = ch->num_strokes, stroke = ch->stroke; - i > 0; i--, stroke++) { - glBegin(GL_LINE_STRIP); - for (j = stroke->num_coords, coord = stroke->coord; - j > 0; j--, coord++) { - glVertex2f(coord->x, coord->y); - } - glEnd(); - } - glTranslatef(ch->right, 0.0, 0.0); - } -} - -int glutStrokeWidth(GLUTstrokeFont font, int c) -{ - StrokeFontPtr fontinfo; - const StrokeCharRec *ch; - - fontinfo = (StrokeFontPtr) font; - - if (c < 0 || c >= fontinfo->num_chars) - return 0; - ch = &(fontinfo->ch[c]); - if (ch) - return ch->right; - - return 0; -} - -int glutStrokeLength(GLUTstrokeFont font, const unsigned char *string) -{ - int length = 0; - - for (; *string; string++) - length += glutStrokeWidth(font, *string); - return length; -} diff --git a/src/glut/fbdev/vidresize.c b/src/glut/fbdev/vidresize.c deleted file mode 100644 index 960b018623..0000000000 --- a/src/glut/fbdev/vidresize.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * Copyright (C) 1995-2006 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -/* - * Library for glut using mesa fbdev driver - * - * Written by Sean D'Epagnier (c) 2006 - */ - -/* Notice, if you know how to implement these functions correctly - please proceed */ - -#include - -#include - -#include "internal.h" - -int glutVideoResizeGet(GLenum param) -{ - return 0; -} - -void glutSetupVideoResizing(void) -{ -} - -void glutStopVideoResizing(void) -{ -} - -void glutVideoResize(int x, int y, int width, int height) -{ -} - -void glutVideoPan(int x, int y, int width, int height) -{ -} diff --git a/src/glut/os2/Makefile b/src/glut/os2/Makefile deleted file mode 100644 index 102a8b688d..0000000000 --- a/src/glut/os2/Makefile +++ /dev/null @@ -1,420 +0,0 @@ -# Makefile -# Created by IBM WorkFrame/2 MakeMake at 12:46:25 on 3 June 2003 -# -# The actions included in this make file are: -# Compile::C++ Compiler -# Link::Linker -# Lib::Import Lib - -.SUFFIXES: - -.SUFFIXES: \ - .LIB .cpp .dll .obj - -.cpp.obj: - @echo " Compile::C++ Compiler " - icc.exe /I..\ /I..\X86 /I..\GL /I..\swrast /I..\swrast_setup /Ss /Wcmpcndcnscnvcpydclenuextgeninilanobsordparporppcprorearettrdtruund /Tx /O /Gm /Ge- /G5 /Gf /Gi /Oi /C %s - -{G:\EVGEN\MESA5\src-glut.os2pm}.cpp.obj: - @echo " Compile::C++ Compiler " - icc.exe /I..\ /I..\X86 /I..\GL /I..\swrast /I..\swrast_setup /Ss /Wcmpcndcnscnvcpydclenuextgeninilanobsordparporppcprorearettrdtruund /Tx /O /Gm /Ge- /G5 /Gf /Gi /Oi /C %s - -.dll.LIB: - @echo " Lib::Import Lib " - implib.exe %|dpfF.LIB %s - -{G:\EVGEN\MESA5\src-glut.os2pm}.dll.LIB: - @echo " Lib::Import Lib " - implib.exe %|dpfF.LIB %s - -all: \ - .\libGlut.LIB - -.\libGlut.dll: \ - .\os2_winproc.obj \ - .\WarpWin.obj \ - .\glutOverlay.obj \ - .\glut_8x13.obj \ - .\glut_9x15.obj \ - .\glut_bitmap.obj \ - .\glut_cindex.obj \ - .\glut_cmap.obj \ - .\glut_cursor.obj \ - .\glut_event.obj \ - .\glut_ext.obj \ - .\glut_fullscrn.obj \ - .\glut_gamemode.obj \ - .\glut_get.obj \ - .\glut_hel10.obj \ - .\glut_hel12.obj \ - .\glut_hel18.obj \ - .\glut_init.obj \ - .\glut_input.obj \ - .\glut_key.obj \ - .\glut_keyctrl.obj \ - .\glut_keyup.obj \ - .\glut_mesa.obj \ - .\glut_modifier.obj \ - .\glut_roman.obj \ - .\glut_shapes.obj \ - .\glut_stroke.obj \ - .\glut_swap.obj \ - .\glut_teapot.obj \ - .\glut_tr24.obj \ - .\glut_util.obj \ - .\glut_vidresize.obj \ - .\glut_warp.obj \ - .\glut_win.obj \ - .\glut_winmisc.obj \ - .\os2_glx.obj \ - .\os2_menu.obj \ - ..\si-glu\libGLU.lib \ - ..\MesaDll\MesaGL2.lib \ - ..\drv\DrvLoad\MesaDrvLoad.lib \ - {$(LIB)}libGlut.DEF - @echo " Link::Linker " - icc.exe @<< - /B" /dbgpack /exepack:2 /st:200000 /packd /optfunc" - /FelibGlut.dll - ..\si-glu\libGLU.lib - ..\MesaDll\MesaGL2.lib - ..\drv\DrvLoad\MesaDrvLoad.lib - libGlut.DEF - .\os2_winproc.obj - .\WarpWin.obj - .\glutOverlay.obj - .\glut_8x13.obj - .\glut_9x15.obj - .\glut_bitmap.obj - .\glut_cindex.obj - .\glut_cmap.obj - .\glut_cursor.obj - .\glut_event.obj - .\glut_ext.obj - .\glut_fullscrn.obj - .\glut_gamemode.obj - .\glut_get.obj - .\glut_hel10.obj - .\glut_hel12.obj - .\glut_hel18.obj - .\glut_init.obj - .\glut_input.obj - .\glut_key.obj - .\glut_keyctrl.obj - .\glut_keyup.obj - .\glut_mesa.obj - .\glut_modifier.obj - .\glut_roman.obj - .\glut_shapes.obj - .\glut_stroke.obj - .\glut_swap.obj - .\glut_teapot.obj - .\glut_tr24.obj - .\glut_util.obj - .\glut_vidresize.obj - .\glut_warp.obj - .\glut_win.obj - .\glut_winmisc.obj - .\os2_glx.obj - .\os2_menu.obj -<< - -.\os2_winproc.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\os2_winproc.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \ - gl\os2mesa.h \ - gl\gl.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2mesadef.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}context.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glapi.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}mtypes.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glheader.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}config.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glapitable.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glthread.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}math/m_matrix.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}Trace/tr_context.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}dd.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}conf.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_config.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/glext.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}Xthreads.h - -.\os2_menu.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\os2_menu.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\os2_glx.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\os2_glx.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - gl\os2mesa.h \ - gl\gl.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h - -.\glut_winmisc.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_winmisc.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_win.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_win.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutos2.h \ - gl\os2mesa.h \ - gl\gl.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}gl_mangle.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}GL/os2_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}os2_config.h - -.\glut_warp.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_warp.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_vidresize.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_vidresize.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_util.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_util.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_tr24.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_tr24.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h - -.\glut_teapot.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_teapot.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_swap.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_swap.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_stroke.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_stroke.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_shapes.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_shapes.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_roman.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_roman.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h - -.\glut_modifier.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_modifier.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_mesa.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_mesa.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_keyup.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_keyup.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_keyctrl.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_keyctrl.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_key.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_key.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_input.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_input.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_init.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_init.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_hel18.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_hel18.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h - -.\glut_hel12.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_hel12.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h - -.\glut_hel10.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_hel10.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h - -.\glut_get.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_get.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_gamemode.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_gamemode.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_fullscrn.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_fullscrn.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_ext.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_ext.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_event.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_event.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_cursor.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_cursor.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_cmap.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_cmap.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}layerutil.h - -.\glut_cindex.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_cindex.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_bitmap.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_bitmap.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\glut_9x15.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_9x15.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h - -.\glut_8x13.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glut_8x13.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h - -.\glutOverlay.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\glutOverlay.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutint.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutbitmap.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutstroke.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}glutwin32.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_x11.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}win32_glx.h - -.\WarpWin.obj: \ - G:\EVGEN\MESA5\src-glut.os2pm\WarpWin.cpp \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpWin.h \ - {G:\EVGEN\MESA5\src-glut.os2pm;..\;..\X86;..\GL;..\swrast;..\swrast_setup;$(INCLUDE);}WarpGL.h - -.\libGlut.LIB: \ - .\libGlut.dll diff --git a/src/glut/os2/WarpWin.cpp b/src/glut/os2/WarpWin.cpp deleted file mode 100644 index 71cc8e1bc9..0000000000 --- a/src/glut/os2/WarpWin.cpp +++ /dev/null @@ -1,419 +0,0 @@ -/* WarpWin.c */ -/* glut for Warp */ -#include -#include - -#include "WarpWin.h" -#include "WarpGL.h" - -#define POKA 0 - -/* global variables that must be set for some functions to operate - correctly. */ -HDC XHDC; -HWND XHWND; - - -void -XStoreColor(Display* display, Colormap colormap, XColor* color) -{ - /* KLUDGE: set XHDC to 0 if the palette should NOT be realized after - setting the color. set XHDC to the correct HDC if it should. */ - - LONG pe; - ULONG cclr; - int r,g,b; - /* X11 stores color from 0-65535, Win32 expects them to be 0-256, so - twiddle the bits ( / 256). */ - r = color->red / 256; - g = color->green / 256; - b = color->blue / 256; - pe = LONGFromRGB(r,g,b); - /* make sure we use this flag, otherwise the colors might get mapped - to another place in the colormap, and when we glIndex() that - color, it may have moved (argh!!) */ - pe |= (PC_NOCOLLAPSE<<24); -/* This function changes the entries in a palette. */ -#if POKA -OS2: - rc = GpiSetPaletteEntries(colormap,LCOLF_CONSECRGB, color->pixel, 1, &pe); - GpiSelectPalette(hps,colormap); - WinRealizePalette(hwnd,hps,&cclr); -source Win: - if (XHDC) { - UnrealizeObject(colormap); - SelectPalette(XHDC, colormap, FALSE); - RealizePalette(XHDC); - - } -#endif -} - -void -XSetWindowColormap(Display* display, Window window, Colormap colormap) -{ -#if POKA - HDC hdc = GetDC(window); - - /* if the third parameter is FALSE, the logical colormap is copied - into the device palette when the application is in the - foreground, if it is TRUE, the colors are mapped into the current - palette in the best possible way. */ - SelectPalette(hdc, colormap, FALSE); - RealizePalette(hdc); - - /* note that we don't have to release the DC, since our window class - uses the WC_OWNDC flag! */ -#endif -} - - -/* display, root and visual - don't used at all */ -Colormap -XCreateColormap(Display* display, Window root, Visual* visual, int alloc) -{ - /* KLUDGE: this function needs XHDC to be set to the HDC currently - being operated on before it is invoked! */ - - HPAL palette; - int n; -#if POKA - PIXELFORMATDESCRIPTOR pfd; - LOGPALETTE *logical; - - /* grab the pixel format */ - memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); - DescribePixelFormat(XHDC, GetPixelFormat(XHDC), - sizeof(PIXELFORMATDESCRIPTOR), &pfd); - - if (!(pfd.dwFlags & PFD_NEED_PALETTE || - pfd.iPixelType == PFD_TYPE_COLORINDEX)) - { - return 0; - } - - n = 1 << pfd.cColorBits; - - /* allocate a bunch of memory for the logical palette (assume 256 - colors in a Win32 palette */ - logical = (LOGPALETTE*)malloc(sizeof(LOGPALETTE) + - sizeof(PALETTEENTRY) * n); - memset(logical, 0, sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * n); - - /* set the entries in the logical palette */ - logical->palVersion = 0x300; - logical->palNumEntries = n; - - /* start with a copy of the current system palette */ - GetSystemPaletteEntries(XHDC, 0, 256, &logical->palPalEntry[0]); - - if (pfd.iPixelType == PFD_TYPE_RGBA) { - int redMask = (1 << pfd.cRedBits) - 1; - int greenMask = (1 << pfd.cGreenBits) - 1; - int blueMask = (1 << pfd.cBlueBits) - 1; - int i; - - /* fill in an RGBA color palette */ - for (i = 0; i < n; ++i) { - logical->palPalEntry[i].peRed = - (((i >> pfd.cRedShift) & redMask) * 255) / redMask; - logical->palPalEntry[i].peGreen = - (((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask; - logical->palPalEntry[i].peBlue = - (((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask; - logical->palPalEntry[i].peFlags = 0; - } - } - - palette = CreatePalette(logical); - free(logical); - - SelectPalette(XHDC, palette, FALSE); - RealizePalette(XHDC); -#endif /* POKA */ - - return palette; -} - - - -int GetSystemMetrics( int mode) -{ RECTL rect; - - switch(mode) - { case SM_CXSCREEN: - WinQueryWindowRect(HWND_DESKTOP,&rect); - return (rect.xRight-rect.xLeft); - break; - case SM_CYSCREEN: - WinQueryWindowRect(HWND_DESKTOP,&rect); - return (rect.yTop-rect.yBottom); - break; - default: ; - } - return 0; -} -/* - * XParseGeometry parses strings of the form - * "=x{+-}{+-}", where - * width, height, xoffset, and yoffset are unsigned integers. - * Example: "=80x24+300-49" - * The equal sign is optional. - * It returns a bitmask that indicates which of the four values - * were actually found in the string. For each value found, - * the corresponding argument is updated; for each value - * not found, the corresponding argument is left unchanged. - */ - -static int -ReadInteger(char *string, char **NextString) -{ - register int Result = 0; - int Sign = 1; - - if (*string == '+') - string++; - else if (*string == '-') - { - string++; - Sign = -1; - } - for (; (*string >= '0') && (*string <= '9'); string++) - { - Result = (Result * 10) + (*string - '0'); - } - *NextString = string; - if (Sign >= 0) - return (Result); - else - return (-Result); -} - -int XParseGeometry(char *string, int *x, int *y, unsigned int *width, unsigned int *height) -{ - int mask = NoValue; - register char *strind; - unsigned int tempWidth, tempHeight; - int tempX, tempY; - char *nextCharacter; - - if ( (string == NULL) || (*string == '\0')) return(mask); - if (*string == '=') - string++; /* ignore possible '=' at beg of geometry spec */ - - strind = (char *)string; - if (*strind != '+' && *strind != '-' && *strind != 'x') { - tempWidth = ReadInteger(strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - mask |= WidthValue; - } - - if (*strind == 'x' || *strind == 'X') { - strind++; - tempHeight = ReadInteger(strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - mask |= HeightValue; - } - - if ((*strind == '+') || (*strind == '-')) { - if (*strind == '-') { - strind++; - tempX = -ReadInteger(strind, &nextCharacter); - if (strind == nextCharacter) - return (0); - strind = nextCharacter; - mask |= XNegative; - - } - else - { strind++; - tempX = ReadInteger(strind, &nextCharacter); - if (strind == nextCharacter) - return(0); - strind = nextCharacter; - } - mask |= XValue; - if ((*strind == '+') || (*strind == '-')) { - if (*strind == '-') { - strind++; - tempY = -ReadInteger(strind, &nextCharacter); - if (strind == nextCharacter) - return(0); - strind = nextCharacter; - mask |= YNegative; - - } - else - { - strind++; - tempY = ReadInteger(strind, &nextCharacter); - if (strind == nextCharacter) - return(0); - strind = nextCharacter; - } - mask |= YValue; - } - } - - /* If strind isn't at the end of the string the it's an invalid - geometry specification. */ - - if (*strind != '\0') return (0); - - if (mask & XValue) - *x = tempX; - if (mask & YValue) - *y = tempY; - if (mask & WidthValue) - *width = tempWidth; - if (mask & HeightValue) - *height = tempHeight; - return (mask); -} - -int gettimeofday(struct timeval* tp, void* tzp) -{ - DATETIME DateTime; - APIRET ulrc; /* Return Code. */ - - ulrc = DosGetDateTime(&DateTime); - tp->tv_sec = 60 * (60*DateTime.hours + DateTime.minutes) + DateTime.seconds; - tp->tv_usec = DateTime.hundredths * 10000; - return 0; -} - - -int -XPending(Display* display) -{ - /* similar functionality...I don't think that it is exact, but this - will have to do. */ - QMSG msg; - extern HAB hab; /* PM anchor block handle */ - -//?? WinPeekMsg(hab - return WinPeekMsg(hab, &msg, NULLHANDLE, 0, 0, PM_NOREMOVE); -} - -void -__glutAdjustCoords(Window parent, int* x, int* y, int* width, int* height) -{ - RECTL rect; - - /* adjust the window rectangle because Win32 thinks that the x, y, - width & height are the WHOLE window (including decorations), - whereas GLUT treats the x, y, width & height as only the CLIENT - area of the window. */ - rect.xLeft = *x; rect.yTop = *y; - rect.xRight = *x + *width; rect.yBottom = *y + *height; - - /* must adjust the coordinates according to the correct style - because depending on the style, there may or may not be - borders. */ -//?? AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | -//?? (parent ? WS_CHILD : WS_OVERLAPPEDWINDOW), -//?? FALSE); - /* FALSE in the third parameter = window has no menu bar */ - - /* readjust if the x and y are offscreen */ - if(rect.xLeft < 0) { - *x = 0; - } else { - *x = rect.xLeft; - } - - if(rect.yTop < 0) { - *y = 0; - } else { - *y = rect.yTop; - } - - *width = rect.xRight - rect.xLeft; /* adjusted width */ - *height = -(rect.yBottom - rect.yTop); /* adjusted height */ -} - - -int -__glutGetTransparentPixel(Display * dpy, XVisualInfo * vinfo) -{ - /* the transparent pixel on Win32 is always index number 0. So if - we put this routine in this file, we can avoid compiling the - whole of layerutil.c which is where this routine normally comes - from. */ - return 0; -} - -/* Translate point coordinates src_x and src_y from src to dst */ - -Bool -XTranslateCoordinates(Display *display, Window src, Window dst, - int src_x, int src_y, - int* dest_x_return, int* dest_y_return, - Window* child_return) -{ - SWP swp_src,swp_dst; - - WinQueryWindowPos(src,&swp_src); - WinQueryWindowPos(dst,&swp_dst); - - *dest_x_return = src_x + swp_src.x - swp_dst.x; - *dest_y_return = src_y + swp_src.y - swp_dst.y; - - /* just to make compilers happy...we don't use the return value. */ - return True; -} - -Status -XGetGeometry(Display* display, Window window, Window* root_return, - int* x_return, int* y_return, - unsigned int* width_return, unsigned int* height_return, - unsigned int *border_width_return, unsigned int* depth_return) -{ - /* KLUDGE: doesn't return the border_width or depth or root, x & y - are in screen coordinates. */ - SWP swp_src; - WinQueryWindowPos(window,&swp_src); - - *x_return = swp_src.x; - *y_return = swp_src.y; - *width_return = swp_src.cx; - *height_return = swp_src.cy; - - /* just to make compilers happy...we don't use the return value. */ - return 1; -} - -/* Get Display Width in millimeters */ -int -DisplayWidthMM(Display* display, int screen) -{ - int width; - LONG *pVC_Caps; - pVC_Caps = GetVideoConfig(NULLHANDLE); - width = (int)( 0.001 * pVC_Caps[CAPS_WIDTH] / pVC_Caps[CAPS_HORIZONTAL_RESOLUTION]);/* mm */ - return width; -} - -/* Get Display Height in millimeters */ -int -DisplayHeightMM(Display* display, int screen) -{ - int height; - LONG *pVC_Caps; - pVC_Caps = GetVideoConfig(NULLHANDLE); - height = (int)( 0.001 * pVC_Caps[CAPS_HEIGHT] / pVC_Caps[CAPS_VERTICAL_RESOLUTION]); /* mm */ - return height; -} - -void ScreenToClient( HWND hwnd, POINTL *point) -{ - SWP swp_src; - WinQueryWindowPos(hwnd,&swp_src); - point->x -= swp_src.x; - point->y -= swp_src.y; -} - diff --git a/src/glut/os2/glutOverlay.cpp b/src/glut/os2/glutOverlay.cpp deleted file mode 100644 index d57c4e7418..0000000000 --- a/src/glut/os2/glutOverlay.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/*********************************************************** - * Copyright (C) 1997, Be Inc. All rights reserved. - * - * FILE: glutOverlay.cpp - * - * DESCRIPTION: we don't support overlays, so this code is - * really simple - ***********************************************************/ - -/*********************************************************** - * Headers - ***********************************************************/ -#include -#include "glutint.h" -#include "glutbitmap.h" -#include "glutstroke.h" - -GLUTAPI void GLUTAPIENTRY -glutEstablishOverlay(void) -{ - __glutFatalError("OS2PM lacks overlay support."); -} - -GLUTAPI void GLUTAPIENTRY -glutUseLayer(GLenum layer) { - // ignore -} - -GLUTAPI void GLUTAPIENTRY -glutRemoveOverlay(void) { - // ignore -} - -GLUTAPI void GLUTAPIENTRY -glutPostOverlayRedisplay(void) { - // ignore -} - -GLUTAPI void GLUTAPIENTRY -glutShowOverlay(void) { - // ignore -} - -GLUTAPI void GLUTAPIENTRY glutHideOverlay(void) -{ - // ignore -} - -int GLUTAPIENTRY -glutLayerGet(GLenum param) -{ - // ignore -} - -/*********************************************************** - * Unsupported callbacks - ***********************************************************/ -GLUTAPI void GLUTAPIENTRY -glutOverlayDisplayFunc(GLUTdisplayCB displayFunc) -{ -} - -GLUTAPI void GLUTAPIENTRY -glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc) -{ -} - -GLUTAPI void GLUTAPIENTRY -glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc) -{ -} - -GLUTAPI void GLUTAPIENTRY -glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc) -{ -} - -GLUTAPI void GLUTAPIENTRY -glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc) -{ -} - -GLUTAPI void GLUTAPIENTRY -glutDialsFunc(GLUTdialsCB dialsFunc) -{ -} - -GLUTAPI void GLUTAPIENTRY -glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc) -{ -} - -GLUTAPI void GLUTAPIENTRY -glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc) -{ -} -GLUTAPI void GLUTAPIENTRY -glutPostWindowOverlayRedisplay(int win) -{ // -} - -void GLUTAPIENTRY -glutInitDisplayString(const char *string) -{ // -} -void GLUTAPIENTRY -glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval) -{ // -} - -void GLUTAPIENTRY -glutForceJoystickFunc(void) -{ // -} - - -int GLUTAPIENTRY -glutBitmapWidth(GLUTbitmapFont font, int c) -{ return 0; -} -int GLUTAPIENTRY -glutBitmapLength(GLUTbitmapFont font, const unsigned char *string) -{ // - return 0; -} -int GLUTAPIENTRY -glutStrokeWidth(GLUTstrokeFont font, int c) -{ return 0; -} -int GLUTAPIENTRY -glutStrokeLength(GLUTstrokeFont font, const unsigned char *string) -{ return 0; -} diff --git a/src/glut/os2/glut_8x13.cpp b/src/glut/os2/glut_8x13.cpp deleted file mode 100644 index 29ea6ea070..0000000000 --- a/src/glut/os2/glut_8x13.cpp +++ /dev/null @@ -1,2076 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#define glutBitmap8By13 XXX -#include "glutbitmap.h" -#undef glutBitmap8By13 - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch0data[] = { 0x0 }; -static const BitmapCharRec ch0 = {1,1,0,0,8,ch0data}; -#else -static const BitmapCharRec ch0 = {0,0,0,0,8,0}; -#endif - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch32data[] = { 0x0 }; -static const BitmapCharRec ch32 = {1,1,0,0,8,ch32data}; -#else -static const BitmapCharRec ch32 = {0,0,0,0,8,0}; -#endif - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch127data[] = { 0x0 }; -static const BitmapCharRec ch127 = {1,1,0,0,8,ch127data}; -#else -static const BitmapCharRec ch127 = {0,0,0,0,8,0}; -#endif - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch160data[] = { 0x0 }; -static const BitmapCharRec ch160 = {1,1,0,0,8,ch160data}; -#else -static const BitmapCharRec ch160 = {0,0,0,0,8,0}; -#endif - -/* char: 0xff */ - -static const GLubyte ch255data[] = { -0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch255 = {6,12,-1,2,8,ch255data}; - -/* char: 0xfe */ - -static const GLubyte ch254data[] = { -0x80,0x80,0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80, -}; - -static const BitmapCharRec ch254 = {6,10,-1,2,8,ch254data}; - -/* char: 0xfd */ - -static const GLubyte ch253data[] = { -0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x0,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch253 = {6,12,-1,2,8,ch253data}; - -/* char: 0xfc */ - -static const GLubyte ch252data[] = { -0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch252 = {6,10,-1,0,8,ch252data}; - -/* char: 0xfb */ - -static const GLubyte ch251data[] = { -0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch251 = {6,10,-1,0,8,ch251data}; - -/* char: 0xfa */ - -static const GLubyte ch250data[] = { -0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch250 = {6,10,-1,0,8,ch250data}; - -/* char: 0xf9 */ - -static const GLubyte ch249data[] = { -0x74,0x88,0x88,0x88,0x88,0x88,0x0,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch249 = {6,10,-1,0,8,ch249data}; - -/* char: 0xf8 */ - -static const GLubyte ch248data[] = { -0x80,0x78,0xc4,0xa4,0x94,0x8c,0x78,0x4, -}; - -static const BitmapCharRec ch248 = {6,8,-1,1,8,ch248data}; - -/* char: 0xf7 */ - -static const GLubyte ch247data[] = { -0x20,0x20,0x0,0xf8,0x0,0x20,0x20, -}; - -static const BitmapCharRec ch247 = {5,7,-1,-1,8,ch247data}; - -/* char: 0xf6 */ - -static const GLubyte ch246data[] = { -0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch246 = {6,10,-1,0,8,ch246data}; - -/* char: 0xf5 */ - -static const GLubyte ch245data[] = { -0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch245 = {6,10,-1,0,8,ch245data}; - -/* char: 0xf4 */ - -static const GLubyte ch244data[] = { -0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch244 = {6,10,-1,0,8,ch244data}; - -/* char: 0xf3 */ - -static const GLubyte ch243data[] = { -0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch243 = {6,10,-1,0,8,ch243data}; - -/* char: 0xf2 */ - -static const GLubyte ch242data[] = { -0x78,0x84,0x84,0x84,0x84,0x78,0x0,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch242 = {6,10,-1,0,8,ch242data}; - -/* char: 0xf1 */ - -static const GLubyte ch241data[] = { -0x84,0x84,0x84,0x84,0xc4,0xb8,0x0,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch241 = {6,10,-1,0,8,ch241data}; - -/* char: 0xf0 */ - -static const GLubyte ch240data[] = { -0x78,0x84,0x84,0x84,0x84,0x78,0x8,0x50,0x30,0x48, -}; - -static const BitmapCharRec ch240 = {6,10,-1,0,8,ch240data}; - -/* char: 0xef */ - -static const GLubyte ch239data[] = { -0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x50,0x50, -}; - -static const BitmapCharRec ch239 = {5,10,-1,0,8,ch239data}; - -/* char: 0xee */ - -static const GLubyte ch238data[] = { -0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x90,0x60, -}; - -static const BitmapCharRec ch238 = {5,10,-1,0,8,ch238data}; - -/* char: 0xed */ - -static const GLubyte ch237data[] = { -0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x40,0x20, -}; - -static const BitmapCharRec ch237 = {5,10,-1,0,8,ch237data}; - -/* char: 0xec */ - -static const GLubyte ch236data[] = { -0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch236 = {5,10,-1,0,8,ch236data}; - -/* char: 0xeb */ - -static const GLubyte ch235data[] = { -0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch235 = {6,10,-1,0,8,ch235data}; - -/* char: 0xea */ - -static const GLubyte ch234data[] = { -0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch234 = {6,10,-1,0,8,ch234data}; - -/* char: 0xe9 */ - -static const GLubyte ch233data[] = { -0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch233 = {6,10,-1,0,8,ch233data}; - -/* char: 0xe8 */ - -static const GLubyte ch232data[] = { -0x78,0x84,0x80,0xfc,0x84,0x78,0x0,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch232 = {6,10,-1,0,8,ch232data}; - -/* char: 0xe7 */ - -static const GLubyte ch231data[] = { -0x20,0x10,0x78,0x84,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch231 = {6,8,-1,2,8,ch231data}; - -/* char: 0xe6 */ - -static const GLubyte ch230data[] = { -0x6c,0x92,0x90,0x7c,0x12,0x6c, -}; - -static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; - -/* char: 0xe5 */ - -static const GLubyte ch229data[] = { -0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x30,0x48,0x30, -}; - -static const BitmapCharRec ch229 = {6,10,-1,0,8,ch229data}; - -/* char: 0xe4 */ - -static const GLubyte ch228data[] = { -0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch228 = {6,10,-1,0,8,ch228data}; - -/* char: 0xe3 */ - -static const GLubyte ch227data[] = { -0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch227 = {6,10,-1,0,8,ch227data}; - -/* char: 0xe2 */ - -static const GLubyte ch226data[] = { -0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch226 = {6,10,-1,0,8,ch226data}; - -/* char: 0xe1 */ - -static const GLubyte ch225data[] = { -0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch225 = {6,10,-1,0,8,ch225data}; - -/* char: 0xe0 */ - -static const GLubyte ch224data[] = { -0x74,0x8c,0x84,0x7c,0x4,0x78,0x0,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch224 = {6,10,-1,0,8,ch224data}; - -/* char: 0xdf */ - -static const GLubyte ch223data[] = { -0x80,0xb8,0xc4,0x84,0x84,0xf8,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch223 = {6,9,-1,1,8,ch223data}; - -/* char: 0xde */ - -static const GLubyte ch222data[] = { -0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80, -}; - -static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; - -/* char: 0xdd */ - -static const GLubyte ch221data[] = { -0x20,0x20,0x20,0x20,0x50,0x88,0x88,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch221 = {5,10,-1,0,8,ch221data}; - -/* char: 0xdc */ - -static const GLubyte ch220data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; - -/* char: 0xdb */ - -static const GLubyte ch219data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch219 = {6,10,-1,0,8,ch219data}; - -/* char: 0xda */ - -static const GLubyte ch218data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch218 = {6,10,-1,0,8,ch218data}; - -/* char: 0xd9 */ - -static const GLubyte ch217data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch217 = {6,10,-1,0,8,ch217data}; - -/* char: 0xd8 */ - -static const GLubyte ch216data[] = { -0x80,0x78,0xc4,0xa4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, -}; - -static const BitmapCharRec ch216 = {6,11,-1,1,8,ch216data}; - -/* char: 0xd7 */ - -static const GLubyte ch215data[] = { -0x84,0x48,0x30,0x30,0x48,0x84, -}; - -static const BitmapCharRec ch215 = {6,6,-1,-1,8,ch215data}; - -/* char: 0xd6 */ - -static const GLubyte ch214data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch214 = {7,10,0,0,8,ch214data}; - -/* char: 0xd5 */ - -static const GLubyte ch213data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x14, -}; - -static const BitmapCharRec ch213 = {7,10,0,0,8,ch213data}; - -/* char: 0xd4 */ - -static const GLubyte ch212data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x24,0x18, -}; - -static const BitmapCharRec ch212 = {7,10,0,0,8,ch212data}; - -/* char: 0xd3 */ - -static const GLubyte ch211data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch211 = {7,10,0,0,8,ch211data}; - -/* char: 0xd2 */ - -static const GLubyte ch210data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x8,0x10, -}; - -static const BitmapCharRec ch210 = {7,10,0,0,8,ch210data}; - -/* char: 0xd1 */ - -static const GLubyte ch209data[] = { -0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x0,0x28,0x14, -}; - -static const BitmapCharRec ch209 = {7,10,0,0,8,ch209data}; - -/* char: 0xd0 */ - -static const GLubyte ch208data[] = { -0xfc,0x42,0x42,0x42,0xe2,0x42,0x42,0x42,0xfc, -}; - -static const BitmapCharRec ch208 = {7,9,0,0,8,ch208data}; - -/* char: 0xcf */ - -static const GLubyte ch207data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, -}; - -static const BitmapCharRec ch207 = {5,10,-1,0,8,ch207data}; - -/* char: 0xce */ - -static const GLubyte ch206data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch206 = {5,10,-1,0,8,ch206data}; - -/* char: 0xcd */ - -static const GLubyte ch205data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch205 = {5,10,-1,0,8,ch205data}; - -/* char: 0xcc */ - -static const GLubyte ch204data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch204 = {5,10,-1,0,8,ch204data}; - -/* char: 0xcb */ - -static const GLubyte ch203data[] = { -0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch203 = {6,10,-1,0,8,ch203data}; - -/* char: 0xca */ - -static const GLubyte ch202data[] = { -0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch202 = {6,10,-1,0,8,ch202data}; - -/* char: 0xc9 */ - -static const GLubyte ch201data[] = { -0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch201 = {6,10,-1,0,8,ch201data}; - -/* char: 0xc8 */ - -static const GLubyte ch200data[] = { -0xfc,0x80,0x80,0xf0,0x80,0x80,0xfc,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch200 = {6,10,-1,0,8,ch200data}; - -/* char: 0xc7 */ - -static const GLubyte ch199data[] = { -0x20,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch199 = {6,11,-1,2,8,ch199data}; - -/* char: 0xc6 */ - -static const GLubyte ch198data[] = { -0x9e,0x90,0x90,0xf0,0x9c,0x90,0x90,0x90,0x6e, -}; - -static const BitmapCharRec ch198 = {7,9,0,0,8,ch198data}; - -/* char: 0xc5 */ - -static const GLubyte ch197data[] = { -0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x30,0x48,0x30, -}; - -static const BitmapCharRec ch197 = {6,10,-1,0,8,ch197data}; - -/* char: 0xc4 */ - -static const GLubyte ch196data[] = { -0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x48, -}; - -static const BitmapCharRec ch196 = {6,10,-1,0,8,ch196data}; - -/* char: 0xc3 */ - -static const GLubyte ch195data[] = { -0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch195 = {6,10,-1,0,8,ch195data}; - -/* char: 0xc2 */ - -static const GLubyte ch194data[] = { -0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x48,0x30, -}; - -static const BitmapCharRec ch194 = {6,10,-1,0,8,ch194data}; - -/* char: 0xc1 */ - -static const GLubyte ch193data[] = { -0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch193 = {6,10,-1,0,8,ch193data}; - -/* char: 0xc0 */ - -static const GLubyte ch192data[] = { -0x84,0x84,0xfc,0x84,0x84,0x48,0x30,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch192 = {6,10,-1,0,8,ch192data}; - -/* char: 0xbf */ - -static const GLubyte ch191data[] = { -0x78,0x84,0x84,0x80,0x40,0x20,0x20,0x0,0x20, -}; - -static const BitmapCharRec ch191 = {6,9,-1,0,8,ch191data}; - -/* char: 0xbe */ - -static const GLubyte ch190data[] = { -0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, -}; - -static const BitmapCharRec ch190 = {7,10,0,0,8,ch190data}; - -/* char: 0xbd */ - -static const GLubyte ch189data[] = { -0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch189 = {7,10,0,0,8,ch189data}; - -/* char: 0xbc */ - -static const GLubyte ch188data[] = { -0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch188 = {7,10,0,0,8,ch188data}; - -/* char: 0xbb */ - -static const GLubyte ch187data[] = { -0x90,0x48,0x24,0x12,0x24,0x48,0x90, -}; - -static const BitmapCharRec ch187 = {7,7,0,-1,8,ch187data}; - -/* char: 0xba */ - -static const GLubyte ch186data[] = { -0xf0,0x0,0x60,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch186 = {4,6,-1,-3,8,ch186data}; - -/* char: 0xb9 */ - -static const GLubyte ch185data[] = { -0xe0,0x40,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch185 = {3,6,-1,-4,8,ch185data}; - -/* char: 0xb8 */ - -static const GLubyte ch184data[] = { -0xc0,0x40, -}; - -static const BitmapCharRec ch184 = {2,2,-3,2,8,ch184data}; - -/* char: 0xb7 */ - -static const GLubyte ch183data[] = { -0xc0, -}; - -static const BitmapCharRec ch183 = {2,1,-3,-4,8,ch183data}; - -/* char: 0xb6 */ - -static const GLubyte ch182data[] = { -0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, -}; - -static const BitmapCharRec ch182 = {6,9,-1,0,8,ch182data}; - -/* char: 0xb5 */ - -static const GLubyte ch181data[] = { -0x80,0xb4,0xcc,0x84,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch181 = {6,7,-1,1,8,ch181data}; - -/* char: 0xb4 */ - -static const GLubyte ch180data[] = { -0x80,0x40, -}; - -static const BitmapCharRec ch180 = {2,2,-3,-8,8,ch180data}; - -/* char: 0xb3 */ - -static const GLubyte ch179data[] = { -0x60,0x90,0x10,0x20,0x90,0x60, -}; - -static const BitmapCharRec ch179 = {4,6,-1,-4,8,ch179data}; - -/* char: 0xb2 */ - -static const GLubyte ch178data[] = { -0xf0,0x80,0x60,0x10,0x90,0x60, -}; - -static const BitmapCharRec ch178 = {4,6,-1,-4,8,ch178data}; - -/* char: 0xb1 */ - -static const GLubyte ch177data[] = { -0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, -}; - -static const BitmapCharRec ch177 = {5,7,-1,-1,8,ch177data}; - -/* char: 0xb0 */ - -static const GLubyte ch176data[] = { -0x60,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch176 = {4,4,-2,-5,8,ch176data}; - -/* char: 0xaf */ - -static const GLubyte ch175data[] = { -0xfc, -}; - -static const BitmapCharRec ch175 = {6,1,-1,-8,8,ch175data}; - -/* char: 0xae */ - -static const GLubyte ch174data[] = { -0x38,0x44,0xaa,0xb2,0xaa,0xaa,0x92,0x44,0x38, -}; - -static const BitmapCharRec ch174 = {7,9,0,-1,8,ch174data}; - -/* char: 0xad */ - -static const GLubyte ch173data[] = { -0xfc, -}; - -static const BitmapCharRec ch173 = {6,1,-1,-4,8,ch173data}; - -/* char: 0xac */ - -static const GLubyte ch172data[] = { -0x4,0x4,0x4,0xfc, -}; - -static const BitmapCharRec ch172 = {6,4,-1,-1,8,ch172data}; - -/* char: 0xab */ - -static const GLubyte ch171data[] = { -0x12,0x24,0x48,0x90,0x48,0x24,0x12, -}; - -static const BitmapCharRec ch171 = {7,7,0,-1,8,ch171data}; - -/* char: 0xaa */ - -static const GLubyte ch170data[] = { -0xf8,0x0,0x78,0x88,0x78,0x8,0x70, -}; - -static const BitmapCharRec ch170 = {5,7,-1,-2,8,ch170data}; - -/* char: 0xa9 */ - -static const GLubyte ch169data[] = { -0x38,0x44,0x92,0xaa,0xa2,0xaa,0x92,0x44,0x38, -}; - -static const BitmapCharRec ch169 = {7,9,0,-1,8,ch169data}; - -/* char: 0xa8 */ - -static const GLubyte ch168data[] = { -0xd8, -}; - -static const BitmapCharRec ch168 = {5,1,-1,-8,8,ch168data}; - -/* char: 0xa7 */ - -static const GLubyte ch167data[] = { -0x60,0x90,0x10,0x60,0x90,0x90,0x60,0x80,0x90,0x60, -}; - -static const BitmapCharRec ch167 = {4,10,-2,0,8,ch167data}; - -/* char: 0xa6 */ - -static const GLubyte ch166data[] = { -0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch166 = {1,9,-3,0,8,ch166data}; - -/* char: 0xa5 */ - -static const GLubyte ch165data[] = { -0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch165 = {7,9,0,0,8,ch165data}; - -/* char: 0xa4 */ - -static const GLubyte ch164data[] = { -0x84,0x78,0x48,0x48,0x78,0x84, -}; - -static const BitmapCharRec ch164 = {6,6,-1,-1,8,ch164data}; - -/* char: 0xa3 */ - -static const GLubyte ch163data[] = { -0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, -}; - -static const BitmapCharRec ch163 = {7,9,0,0,8,ch163data}; - -/* char: 0xa2 */ - -static const GLubyte ch162data[] = { -0x20,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x20, -}; - -static const BitmapCharRec ch162 = {5,8,-1,-1,8,ch162data}; - -/* char: 0xa1 */ - -static const GLubyte ch161data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, -}; - -static const BitmapCharRec ch161 = {1,9,-3,0,8,ch161data}; - -/* char: 0x7e '~' */ - -static const GLubyte ch126data[] = { -0x90,0xa8,0x48, -}; - -static const BitmapCharRec ch126 = {5,3,-1,-6,8,ch126data}; - -/* char: 0x7d '}' */ - -static const GLubyte ch125data[] = { -0xe0,0x10,0x10,0x20,0x18,0x20,0x10,0x10,0xe0, -}; - -static const BitmapCharRec ch125 = {5,9,-1,0,8,ch125data}; - -/* char: 0x7c '|' */ - -static const GLubyte ch124data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch124 = {1,9,-3,0,8,ch124data}; - -/* char: 0x7b '{' */ - -static const GLubyte ch123data[] = { -0x38,0x40,0x40,0x20,0xc0,0x20,0x40,0x40,0x38, -}; - -static const BitmapCharRec ch123 = {5,9,-2,0,8,ch123data}; - -/* char: 0x7a 'z' */ - -static const GLubyte ch122data[] = { -0xfc,0x40,0x20,0x10,0x8,0xfc, -}; - -static const BitmapCharRec ch122 = {6,6,-1,0,8,ch122data}; - -/* char: 0x79 'y' */ - -static const GLubyte ch121data[] = { -0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch121 = {6,8,-1,2,8,ch121data}; - -/* char: 0x78 'x' */ - -static const GLubyte ch120data[] = { -0x84,0x48,0x30,0x30,0x48,0x84, -}; - -static const BitmapCharRec ch120 = {6,6,-1,0,8,ch120data}; - -/* char: 0x77 'w' */ - -static const GLubyte ch119data[] = { -0x44,0xaa,0x92,0x92,0x82,0x82, -}; - -static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; - -/* char: 0x76 'v' */ - -static const GLubyte ch118data[] = { -0x20,0x50,0x50,0x88,0x88,0x88, -}; - -static const BitmapCharRec ch118 = {5,6,-1,0,8,ch118data}; - -/* char: 0x75 'u' */ - -static const GLubyte ch117data[] = { -0x74,0x88,0x88,0x88,0x88,0x88, -}; - -static const BitmapCharRec ch117 = {6,6,-1,0,8,ch117data}; - -/* char: 0x74 't' */ - -static const GLubyte ch116data[] = { -0x38,0x44,0x40,0x40,0x40,0xf8,0x40,0x40, -}; - -static const BitmapCharRec ch116 = {6,8,-1,0,8,ch116data}; - -/* char: 0x73 's' */ - -static const GLubyte ch115data[] = { -0x78,0x84,0x18,0x60,0x84,0x78, -}; - -static const BitmapCharRec ch115 = {6,6,-1,0,8,ch115data}; - -/* char: 0x72 'r' */ - -static const GLubyte ch114data[] = { -0x40,0x40,0x40,0x40,0x44,0xb8, -}; - -static const BitmapCharRec ch114 = {6,6,-1,0,8,ch114data}; - -/* char: 0x71 'q' */ - -static const GLubyte ch113data[] = { -0x4,0x4,0x4,0x74,0x8c,0x84,0x8c,0x74, -}; - -static const BitmapCharRec ch113 = {6,8,-1,2,8,ch113data}; - -/* char: 0x70 'p' */ - -static const GLubyte ch112data[] = { -0x80,0x80,0x80,0xb8,0xc4,0x84,0xc4,0xb8, -}; - -static const BitmapCharRec ch112 = {6,8,-1,2,8,ch112data}; - -/* char: 0x6f 'o' */ - -static const GLubyte ch111data[] = { -0x78,0x84,0x84,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch111 = {6,6,-1,0,8,ch111data}; - -/* char: 0x6e 'n' */ - -static const GLubyte ch110data[] = { -0x84,0x84,0x84,0x84,0xc4,0xb8, -}; - -static const BitmapCharRec ch110 = {6,6,-1,0,8,ch110data}; - -/* char: 0x6d 'm' */ - -static const GLubyte ch109data[] = { -0x82,0x92,0x92,0x92,0x92,0xec, -}; - -static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; - -/* char: 0x6c 'l' */ - -static const GLubyte ch108data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x60, -}; - -static const BitmapCharRec ch108 = {5,9,-1,0,8,ch108data}; - -/* char: 0x6b 'k' */ - -static const GLubyte ch107data[] = { -0x84,0x88,0x90,0xe0,0x90,0x88,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch107 = {6,9,-1,0,8,ch107data}; - -/* char: 0x6a 'j' */ - -static const GLubyte ch106data[] = { -0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x18,0x0,0x8, -}; - -static const BitmapCharRec ch106 = {5,10,-1,2,8,ch106data}; - -/* char: 0x69 'i' */ - -static const GLubyte ch105data[] = { -0xf8,0x20,0x20,0x20,0x20,0x60,0x0,0x20, -}; - -static const BitmapCharRec ch105 = {5,8,-1,0,8,ch105data}; - -/* char: 0x68 'h' */ - -static const GLubyte ch104data[] = { -0x84,0x84,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch104 = {6,9,-1,0,8,ch104data}; - -/* char: 0x67 'g' */ - -static const GLubyte ch103data[] = { -0x78,0x84,0x78,0x80,0x70,0x88,0x88,0x74, -}; - -static const BitmapCharRec ch103 = {6,8,-1,2,8,ch103data}; - -/* char: 0x66 'f' */ - -static const GLubyte ch102data[] = { -0x40,0x40,0x40,0x40,0xf8,0x40,0x40,0x44,0x38, -}; - -static const BitmapCharRec ch102 = {6,9,-1,0,8,ch102data}; - -/* char: 0x65 'e' */ - -static const GLubyte ch101data[] = { -0x78,0x84,0x80,0xfc,0x84,0x78, -}; - -static const BitmapCharRec ch101 = {6,6,-1,0,8,ch101data}; - -/* char: 0x64 'd' */ - -static const GLubyte ch100data[] = { -0x74,0x8c,0x84,0x84,0x8c,0x74,0x4,0x4,0x4, -}; - -static const BitmapCharRec ch100 = {6,9,-1,0,8,ch100data}; - -/* char: 0x63 'c' */ - -static const GLubyte ch99data[] = { -0x78,0x84,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch99 = {6,6,-1,0,8,ch99data}; - -/* char: 0x62 'b' */ - -static const GLubyte ch98data[] = { -0xb8,0xc4,0x84,0x84,0xc4,0xb8,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch98 = {6,9,-1,0,8,ch98data}; - -/* char: 0x61 'a' */ - -static const GLubyte ch97data[] = { -0x74,0x8c,0x84,0x7c,0x4,0x78, -}; - -static const BitmapCharRec ch97 = {6,6,-1,0,8,ch97data}; - -/* char: 0x60 '`' */ - -static const GLubyte ch96data[] = { -0x10,0x60,0xe0, -}; - -static const BitmapCharRec ch96 = {4,3,-2,-6,8,ch96data}; - -/* char: 0x5f '_' */ - -static const GLubyte ch95data[] = { -0xfe, -}; - -static const BitmapCharRec ch95 = {7,1,0,1,8,ch95data}; - -/* char: 0x5e '^' */ - -static const GLubyte ch94data[] = { -0x88,0x50,0x20, -}; - -static const BitmapCharRec ch94 = {5,3,-1,-6,8,ch94data}; - -/* char: 0x5d ']' */ - -static const GLubyte ch93data[] = { -0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, -}; - -static const BitmapCharRec ch93 = {4,9,-1,0,8,ch93data}; - -/* char: 0x5c '\' */ - -static const GLubyte ch92data[] = { -0x2,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x80, -}; - -static const BitmapCharRec ch92 = {7,9,0,0,8,ch92data}; - -/* char: 0x5b '[' */ - -static const GLubyte ch91data[] = { -0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, -}; - -static const BitmapCharRec ch91 = {4,9,-2,0,8,ch91data}; - -/* char: 0x5a 'Z' */ - -static const GLubyte ch90data[] = { -0xfc,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0xfc, -}; - -static const BitmapCharRec ch90 = {6,9,-1,0,8,ch90data}; - -/* char: 0x59 'Y' */ - -static const GLubyte ch89data[] = { -0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch89 = {7,9,0,0,8,ch89data}; - -/* char: 0x58 'X' */ - -static const GLubyte ch88data[] = { -0x82,0x82,0x44,0x28,0x10,0x28,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch88 = {7,9,0,0,8,ch88data}; - -/* char: 0x57 'W' */ - -static const GLubyte ch87data[] = { -0x44,0xaa,0x92,0x92,0x92,0x82,0x82,0x82,0x82, -}; - -static const BitmapCharRec ch87 = {7,9,0,0,8,ch87data}; - -/* char: 0x56 'V' */ - -static const GLubyte ch86data[] = { -0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch86 = {7,9,0,0,8,ch86data}; - -/* char: 0x55 'U' */ - -static const GLubyte ch85data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; - -/* char: 0x54 'T' */ - -static const GLubyte ch84data[] = { -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, -}; - -static const BitmapCharRec ch84 = {7,9,0,0,8,ch84data}; - -/* char: 0x53 'S' */ - -static const GLubyte ch83data[] = { -0x78,0x84,0x4,0x4,0x78,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; - -/* char: 0x52 'R' */ - -static const GLubyte ch82data[] = { -0x84,0x88,0x90,0xa0,0xf8,0x84,0x84,0x84,0xf8, -}; - -static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; - -/* char: 0x51 'Q' */ - -static const GLubyte ch81data[] = { -0x4,0x78,0x94,0xa4,0x84,0x84,0x84,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch81 = {6,10,-1,1,8,ch81data}; - -/* char: 0x50 'P' */ - -static const GLubyte ch80data[] = { -0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, -}; - -static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; - -/* char: 0x4f 'O' */ - -static const GLubyte ch79data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch79 = {6,9,-1,0,8,ch79data}; - -/* char: 0x4e 'N' */ - -static const GLubyte ch78data[] = { -0x84,0x84,0x84,0x8c,0x94,0xa4,0xc4,0x84,0x84, -}; - -static const BitmapCharRec ch78 = {6,9,-1,0,8,ch78data}; - -/* char: 0x4d 'M' */ - -static const GLubyte ch77data[] = { -0x82,0x82,0x82,0x92,0x92,0xaa,0xc6,0x82,0x82, -}; - -static const BitmapCharRec ch77 = {7,9,0,0,8,ch77data}; - -/* char: 0x4c 'L' */ - -static const GLubyte ch76data[] = { -0xfc,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch76 = {6,9,-1,0,8,ch76data}; - -/* char: 0x4b 'K' */ - -static const GLubyte ch75data[] = { -0x84,0x88,0x90,0xa0,0xc0,0xa0,0x90,0x88,0x84, -}; - -static const BitmapCharRec ch75 = {6,9,-1,0,8,ch75data}; - -/* char: 0x4a 'J' */ - -static const GLubyte ch74data[] = { -0x70,0x88,0x8,0x8,0x8,0x8,0x8,0x8,0x3c, -}; - -static const BitmapCharRec ch74 = {6,9,-1,0,8,ch74data}; - -/* char: 0x49 'I' */ - -static const GLubyte ch73data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, -}; - -static const BitmapCharRec ch73 = {5,9,-1,0,8,ch73data}; - -/* char: 0x48 'H' */ - -static const GLubyte ch72data[] = { -0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch72 = {6,9,-1,0,8,ch72data}; - -/* char: 0x47 'G' */ - -static const GLubyte ch71data[] = { -0x74,0x8c,0x84,0x9c,0x80,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch71 = {6,9,-1,0,8,ch71data}; - -/* char: 0x46 'F' */ - -static const GLubyte ch70data[] = { -0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, -}; - -static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; - -/* char: 0x45 'E' */ - -static const GLubyte ch69data[] = { -0xfc,0x80,0x80,0x80,0xf0,0x80,0x80,0x80,0xfc, -}; - -static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; - -/* char: 0x44 'D' */ - -static const GLubyte ch68data[] = { -0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, -}; - -static const BitmapCharRec ch68 = {7,9,0,0,8,ch68data}; - -/* char: 0x43 'C' */ - -static const GLubyte ch67data[] = { -0x78,0x84,0x80,0x80,0x80,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch67 = {6,9,-1,0,8,ch67data}; - -/* char: 0x42 'B' */ - -static const GLubyte ch66data[] = { -0xfc,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, -}; - -static const BitmapCharRec ch66 = {7,9,0,0,8,ch66data}; - -/* char: 0x41 'A' */ - -static const GLubyte ch65data[] = { -0x84,0x84,0x84,0xfc,0x84,0x84,0x84,0x48,0x30, -}; - -static const BitmapCharRec ch65 = {6,9,-1,0,8,ch65data}; - -/* char: 0x40 '@' */ - -static const GLubyte ch64data[] = { -0x78,0x80,0x94,0xac,0xa4,0x9c,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch64 = {6,9,-1,0,8,ch64data}; - -/* char: 0x3f '?' */ - -static const GLubyte ch63data[] = { -0x10,0x0,0x10,0x10,0x8,0x4,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch63 = {6,9,-1,0,8,ch63data}; - -/* char: 0x3e '>' */ - -static const GLubyte ch62data[] = { -0x80,0x40,0x20,0x10,0x8,0x10,0x20,0x40,0x80, -}; - -static const BitmapCharRec ch62 = {5,9,-1,0,8,ch62data}; - -/* char: 0x3d '=' */ - -static const GLubyte ch61data[] = { -0xfc,0x0,0x0,0xfc, -}; - -static const BitmapCharRec ch61 = {6,4,-1,-2,8,ch61data}; - -/* char: 0x3c '<' */ - -static const GLubyte ch60data[] = { -0x8,0x10,0x20,0x40,0x80,0x40,0x20,0x10,0x8, -}; - -static const BitmapCharRec ch60 = {5,9,-2,0,8,ch60data}; - -/* char: 0x3b ';' */ - -static const GLubyte ch59data[] = { -0x80,0x60,0x70,0x0,0x0,0x20,0x70,0x20, -}; - -static const BitmapCharRec ch59 = {4,8,-1,1,8,ch59data}; - -/* char: 0x3a ':' */ - -static const GLubyte ch58data[] = { -0x40,0xe0,0x40,0x0,0x0,0x40,0xe0,0x40, -}; - -static const BitmapCharRec ch58 = {3,8,-2,1,8,ch58data}; - -/* char: 0x39 '9' */ - -static const GLubyte ch57data[] = { -0x70,0x8,0x4,0x4,0x74,0x8c,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch57 = {6,9,-1,0,8,ch57data}; - -/* char: 0x38 '8' */ - -static const GLubyte ch56data[] = { -0x78,0x84,0x84,0x84,0x78,0x84,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch56 = {6,9,-1,0,8,ch56data}; - -/* char: 0x37 '7' */ - -static const GLubyte ch55data[] = { -0x40,0x40,0x20,0x20,0x10,0x10,0x8,0x4,0xfc, -}; - -static const BitmapCharRec ch55 = {6,9,-1,0,8,ch55data}; - -/* char: 0x36 '6' */ - -static const GLubyte ch54data[] = { -0x78,0x84,0x84,0xc4,0xb8,0x80,0x80,0x40,0x38, -}; - -static const BitmapCharRec ch54 = {6,9,-1,0,8,ch54data}; - -/* char: 0x35 '5' */ - -static const GLubyte ch53data[] = { -0x78,0x84,0x4,0x4,0xc4,0xb8,0x80,0x80,0xfc, -}; - -static const BitmapCharRec ch53 = {6,9,-1,0,8,ch53data}; - -/* char: 0x34 '4' */ - -static const GLubyte ch52data[] = { -0x8,0x8,0xfc,0x88,0x88,0x48,0x28,0x18,0x8, -}; - -static const BitmapCharRec ch52 = {6,9,-1,0,8,ch52data}; - -/* char: 0x33 '3' */ - -static const GLubyte ch51data[] = { -0x78,0x84,0x4,0x4,0x38,0x10,0x8,0x4,0xfc, -}; - -static const BitmapCharRec ch51 = {6,9,-1,0,8,ch51data}; - -/* char: 0x32 '2' */ - -static const GLubyte ch50data[] = { -0xfc,0x80,0x40,0x30,0x8,0x4,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch50 = {6,9,-1,0,8,ch50data}; - -/* char: 0x31 '1' */ - -static const GLubyte ch49data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, -}; - -static const BitmapCharRec ch49 = {5,9,-1,0,8,ch49data}; - -/* char: 0x30 '0' */ - -static const GLubyte ch48data[] = { -0x30,0x48,0x84,0x84,0x84,0x84,0x84,0x48,0x30, -}; - -static const BitmapCharRec ch48 = {6,9,-1,0,8,ch48data}; - -/* char: 0x2f '/' */ - -static const GLubyte ch47data[] = { -0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0x2, -}; - -static const BitmapCharRec ch47 = {7,9,0,0,8,ch47data}; - -/* char: 0x2e '.' */ - -static const GLubyte ch46data[] = { -0x40,0xe0,0x40, -}; - -static const BitmapCharRec ch46 = {3,3,-2,1,8,ch46data}; - -/* char: 0x2d '-' */ - -static const GLubyte ch45data[] = { -0xfc, -}; - -static const BitmapCharRec ch45 = {6,1,-1,-4,8,ch45data}; - -/* char: 0x2c ',' */ - -static const GLubyte ch44data[] = { -0x80,0x60,0x70, -}; - -static const BitmapCharRec ch44 = {4,3,-1,1,8,ch44data}; - -/* char: 0x2b '+' */ - -static const GLubyte ch43data[] = { -0x20,0x20,0xf8,0x20,0x20, -}; - -static const BitmapCharRec ch43 = {5,5,-1,-2,8,ch43data}; - -/* char: 0x2a '*' */ - -static const GLubyte ch42data[] = { -0x48,0x30,0xfc,0x30,0x48, -}; - -static const BitmapCharRec ch42 = {6,5,-1,-2,8,ch42data}; - -/* char: 0x29 ')' */ - -static const GLubyte ch41data[] = { -0x80,0x40,0x40,0x20,0x20,0x20,0x40,0x40,0x80, -}; - -static const BitmapCharRec ch41 = {3,9,-2,0,8,ch41data}; - -/* char: 0x28 '(' */ - -static const GLubyte ch40data[] = { -0x20,0x40,0x40,0x80,0x80,0x80,0x40,0x40,0x20, -}; - -static const BitmapCharRec ch40 = {3,9,-3,0,8,ch40data}; - -/* char: 0x27 ''' */ - -static const GLubyte ch39data[] = { -0x80,0x60,0x70, -}; - -static const BitmapCharRec ch39 = {4,3,-1,-6,8,ch39data}; - -/* char: 0x26 '&' */ - -static const GLubyte ch38data[] = { -0x74,0x88,0x94,0x60,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch38 = {6,7,-1,0,8,ch38data}; - -/* char: 0x25 '%' */ - -static const GLubyte ch37data[] = { -0x88,0x54,0x48,0x20,0x10,0x10,0x48,0xa4,0x44, -}; - -static const BitmapCharRec ch37 = {6,9,-1,0,8,ch37data}; - -/* char: 0x24 '$' */ - -static const GLubyte ch36data[] = { -0x20,0xf0,0x28,0x70,0xa0,0x78,0x20, -}; - -static const BitmapCharRec ch36 = {5,7,-1,-1,8,ch36data}; - -/* char: 0x23 '#' */ - -static const GLubyte ch35data[] = { -0x48,0x48,0xfc,0x48,0xfc,0x48,0x48, -}; - -static const BitmapCharRec ch35 = {6,7,-1,-1,8,ch35data}; - -/* char: 0x22 '"' */ - -static const GLubyte ch34data[] = { -0x90,0x90,0x90, -}; - -static const BitmapCharRec ch34 = {4,3,-2,-6,8,ch34data}; - -/* char: 0x21 '!' */ - -static const GLubyte ch33data[] = { -0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch33 = {1,9,-3,0,8,ch33data}; - -/* char: 0x1f */ - -static const GLubyte ch31data[] = { -0x80, -}; - -static const BitmapCharRec ch31 = {1,1,-3,-3,8,ch31data}; - -/* char: 0x1e */ - -static const GLubyte ch30data[] = { -0xdc,0x62,0x20,0x20,0x20,0x70,0x20,0x22,0x1c, -}; - -static const BitmapCharRec ch30 = {7,9,0,0,8,ch30data}; - -/* char: 0x1d */ - -static const GLubyte ch29data[] = { -0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, -}; - -static const BitmapCharRec ch29 = {7,7,0,0,8,ch29data}; - -/* char: 0x1c */ - -static const GLubyte ch28data[] = { -0x88,0x48,0x48,0x48,0x48,0xfc, -}; - -static const BitmapCharRec ch28 = {6,6,-1,0,8,ch28data}; - -/* char: 0x1b */ - -static const GLubyte ch27data[] = { -0xfe,0x80,0x20,0x8,0x2,0x8,0x20,0x80, -}; - -static const BitmapCharRec ch27 = {7,8,0,0,8,ch27data}; - -/* char: 0x1a */ - -static const GLubyte ch26data[] = { -0xfe,0x2,0x8,0x20,0x80,0x20,0x8,0x2, -}; - -static const BitmapCharRec ch26 = {7,8,0,0,8,ch26data}; - -/* char: 0x19 */ - -static const GLubyte ch25data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch25 = {1,13,-3,2,8,ch25data}; - -/* char: 0x18 */ - -static const GLubyte ch24data[] = { -0x10,0x10,0x10,0x10,0x10,0xff, -}; - -static const BitmapCharRec ch24 = {8,6,0,2,8,ch24data}; - -/* char: 0x17 */ - -static const GLubyte ch23data[] = { -0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -}; - -static const BitmapCharRec ch23 = {8,8,0,-3,8,ch23data}; - -/* char: 0x16 */ - -static const GLubyte ch22data[] = { -0x10,0x10,0x10,0x10,0x10,0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -}; - -static const BitmapCharRec ch22 = {4,13,0,2,8,ch22data}; - -/* char: 0x15 */ - -static const GLubyte ch21data[] = { -0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch21 = {5,13,-3,2,8,ch21data}; - -/* char: 0x14 */ - -static const GLubyte ch20data[] = { -0xff, -}; - -static const BitmapCharRec ch20 = {8,1,0,1,8,ch20data}; - -/* char: 0x13 */ - -static const GLubyte ch19data[] = { -0xff, -}; - -static const BitmapCharRec ch19 = {8,1,0,-1,8,ch19data}; - -/* char: 0x12 */ - -static const GLubyte ch18data[] = { -0xff, -}; - -static const BitmapCharRec ch18 = {8,1,0,-3,8,ch18data}; - -/* char: 0x11 */ - -static const GLubyte ch17data[] = { -0xff, -}; - -static const BitmapCharRec ch17 = {8,1,0,-5,8,ch17data}; - -/* char: 0x10 */ - -static const GLubyte ch16data[] = { -0xff, -}; - -static const BitmapCharRec ch16 = {8,1,0,-7,8,ch16data}; - -/* char: 0xf */ - -static const GLubyte ch15data[] = { -0x10,0x10,0x10,0x10,0x10,0xff,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -}; - -static const BitmapCharRec ch15 = {8,13,0,2,8,ch15data}; - -/* char: 0xe */ - -static const GLubyte ch14data[] = { -0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch14 = {5,8,-3,-3,8,ch14data}; - -/* char: 0xd */ - -static const GLubyte ch13data[] = { -0x80,0x80,0x80,0x80,0x80,0xf8, -}; - -static const BitmapCharRec ch13 = {5,6,-3,2,8,ch13data}; - -/* char: 0xc */ - -static const GLubyte ch12data[] = { -0x10,0x10,0x10,0x10,0x10,0xf0, -}; - -static const BitmapCharRec ch12 = {4,6,0,2,8,ch12data}; - -/* char: 0xb */ - -static const GLubyte ch11data[] = { -0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10, -}; - -static const BitmapCharRec ch11 = {4,8,0,-3,8,ch11data}; - -/* char: 0xa */ - -static const GLubyte ch10data[] = { -0x8,0x8,0x8,0x8,0x3e,0x20,0x50,0x88,0x88, -}; - -static const BitmapCharRec ch10 = {7,9,0,2,8,ch10data}; - -/* char: 0x9 */ - -static const GLubyte ch9data[] = { -0x3e,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, -}; - -static const BitmapCharRec ch9 = {7,9,0,2,8,ch9data}; - -/* char: 0x8 */ - -static const GLubyte ch8data[] = { -0xfe,0x10,0x10,0xfe,0x10,0x10, -}; - -static const BitmapCharRec ch8 = {7,6,0,0,8,ch8data}; - -/* char: 0x7 */ - -static const GLubyte ch7data[] = { -0x70,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch7 = {5,4,-1,-5,8,ch7data}; - -/* char: 0x6 */ - -static const GLubyte ch6data[] = { -0x20,0x20,0x3c,0x20,0x3e,0xf8,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch6 = {7,9,0,2,8,ch6data}; - -/* char: 0x5 */ - -static const GLubyte ch5data[] = { -0x22,0x22,0x3c,0x22,0x3c,0x78,0x80,0x80,0x78, -}; - -static const BitmapCharRec ch5 = {7,9,0,2,8,ch5data}; - -/* char: 0x4 */ - -static const GLubyte ch4data[] = { -0x10,0x10,0x1c,0x10,0x9e,0x80,0xe0,0x80,0xf0, -}; - -static const BitmapCharRec ch4 = {7,9,0,2,8,ch4data}; - -/* char: 0x3 */ - -static const GLubyte ch3data[] = { -0x8,0x8,0x8,0x3e,0x88,0x88,0xf8,0x88,0x88, -}; - -static const BitmapCharRec ch3 = {7,9,0,2,8,ch3data}; - -/* char: 0x2 */ - -static const GLubyte ch2data[] = { -0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, -}; - -static const BitmapCharRec ch2 = {8,12,0,2,8,ch2data}; - -/* char: 0x1 */ - -static const GLubyte ch1data[] = { -0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, -}; - -static const BitmapCharRec ch1 = {7,7,0,-1,8,ch1data}; - -static const BitmapCharRec * const chars[] = { -&ch0, -&ch1, -&ch2, -&ch3, -&ch4, -&ch5, -&ch6, -&ch7, -&ch8, -&ch9, -&ch10, -&ch11, -&ch12, -&ch13, -&ch14, -&ch15, -&ch16, -&ch17, -&ch18, -&ch19, -&ch20, -&ch21, -&ch22, -&ch23, -&ch24, -&ch25, -&ch26, -&ch27, -&ch28, -&ch29, -&ch30, -&ch31, -&ch32, -&ch33, -&ch34, -&ch35, -&ch36, -&ch37, -&ch38, -&ch39, -&ch40, -&ch41, -&ch42, -&ch43, -&ch44, -&ch45, -&ch46, -&ch47, -&ch48, -&ch49, -&ch50, -&ch51, -&ch52, -&ch53, -&ch54, -&ch55, -&ch56, -&ch57, -&ch58, -&ch59, -&ch60, -&ch61, -&ch62, -&ch63, -&ch64, -&ch65, -&ch66, -&ch67, -&ch68, -&ch69, -&ch70, -&ch71, -&ch72, -&ch73, -&ch74, -&ch75, -&ch76, -&ch77, -&ch78, -&ch79, -&ch80, -&ch81, -&ch82, -&ch83, -&ch84, -&ch85, -&ch86, -&ch87, -&ch88, -&ch89, -&ch90, -&ch91, -&ch92, -&ch93, -&ch94, -&ch95, -&ch96, -&ch97, -&ch98, -&ch99, -&ch100, -&ch101, -&ch102, -&ch103, -&ch104, -&ch105, -&ch106, -&ch107, -&ch108, -&ch109, -&ch110, -&ch111, -&ch112, -&ch113, -&ch114, -&ch115, -&ch116, -&ch117, -&ch118, -&ch119, -&ch120, -&ch121, -&ch122, -&ch123, -&ch124, -&ch125, -&ch126, -&ch127, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -&ch160, -&ch161, -&ch162, -&ch163, -&ch164, -&ch165, -&ch166, -&ch167, -&ch168, -&ch169, -&ch170, -&ch171, -&ch172, -&ch173, -&ch174, -&ch175, -&ch176, -&ch177, -&ch178, -&ch179, -&ch180, -&ch181, -&ch182, -&ch183, -&ch184, -&ch185, -&ch186, -&ch187, -&ch188, -&ch189, -&ch190, -&ch191, -&ch192, -&ch193, -&ch194, -&ch195, -&ch196, -&ch197, -&ch198, -&ch199, -&ch200, -&ch201, -&ch202, -&ch203, -&ch204, -&ch205, -&ch206, -&ch207, -&ch208, -&ch209, -&ch210, -&ch211, -&ch212, -&ch213, -&ch214, -&ch215, -&ch216, -&ch217, -&ch218, -&ch219, -&ch220, -&ch221, -&ch222, -&ch223, -&ch224, -&ch225, -&ch226, -&ch227, -&ch228, -&ch229, -&ch230, -&ch231, -&ch232, -&ch233, -&ch234, -&ch235, -&ch236, -&ch237, -&ch238, -&ch239, -&ch240, -&ch241, -&ch242, -&ch243, -&ch244, -&ch245, -&ch246, -&ch247, -&ch248, -&ch249, -&ch250, -&ch251, -&ch252, -&ch253, -&ch254, -&ch255, -}; - -#if !defined(__IBMCPP__) -const -#endif -BitmapFontRec glutBitmap8By13 = { -"-misc-fixed-medium-r-normal--13-120-75-75-C-80-iso8859-1", -256, -0, -chars -}; - diff --git a/src/glut/os2/glut_9x15.cpp b/src/glut/os2/glut_9x15.cpp deleted file mode 100644 index d228a2b150..0000000000 --- a/src/glut/os2/glut_9x15.cpp +++ /dev/null @@ -1,2077 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#define glutBitmap9By15 XXX -#include "glutbitmap.h" -#undef glutBitmap9By15 - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch0data[] = { 0x0 }; -static const BitmapCharRec ch0 = {1,1,0,0,9,ch0data}; -#else -static const BitmapCharRec ch0 = {0,0,0,0,9,0}; -#endif - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch32data[] = { 0x0 }; -static const BitmapCharRec ch32 = {1,1,0,0,9,ch32data}; -#else -static const BitmapCharRec ch32 = {0,0,0,0,9,0}; -#endif - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch127data[] = { 0x0 }; -static const BitmapCharRec ch127 = {1,1,0,0,9,ch127data}; -#else -static const BitmapCharRec ch127 = {0,0,0,0,9,0}; -#endif - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch160data[] = { 0x0 }; -static const BitmapCharRec ch160 = {1,1,0,0,9,ch160data}; -#else -static const BitmapCharRec ch160 = {0,0,0,0,9,0}; -#endif - -/* char: 0xff */ - -static const GLubyte ch255data[] = { -0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch255 = {6,14,-1,3,9,ch255data}; - -/* char: 0xfe */ - -static const GLubyte ch254data[] = { -0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80, -}; - -static const BitmapCharRec ch254 = {7,12,-1,3,9,ch254data}; - -/* char: 0xfd */ - -static const GLubyte ch253data[] = { -0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch253 = {6,14,-1,3,9,ch253data}; - -/* char: 0xfc */ - -static const GLubyte ch252data[] = { -0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch252 = {7,11,-1,0,9,ch252data}; - -/* char: 0xfb */ - -static const GLubyte ch251data[] = { -0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch251 = {7,11,-1,0,9,ch251data}; - -/* char: 0xfa */ - -static const GLubyte ch250data[] = { -0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch250 = {7,11,-1,0,9,ch250data}; - -/* char: 0xf9 */ - -static const GLubyte ch249data[] = { -0x7a,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch249 = {7,11,-1,0,9,ch249data}; - -/* char: 0xf8 */ - -static const GLubyte ch248data[] = { -0x80,0x7c,0xa2,0xa2,0x92,0x8a,0x8a,0x7c,0x2, -}; - -static const BitmapCharRec ch248 = {7,9,-1,1,9,ch248data}; - -/* char: 0xf7 */ - -static const GLubyte ch247data[] = { -0x10,0x38,0x10,0x0,0xfe,0x0,0x10,0x38,0x10, -}; - -static const BitmapCharRec ch247 = {7,9,-1,0,9,ch247data}; - -/* char: 0xf6 */ - -static const GLubyte ch246data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch246 = {7,11,-1,0,9,ch246data}; - -/* char: 0xf5 */ - -static const GLubyte ch245data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch245 = {7,11,-1,0,9,ch245data}; - -/* char: 0xf4 */ - -static const GLubyte ch244data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch244 = {7,11,-1,0,9,ch244data}; - -/* char: 0xf3 */ - -static const GLubyte ch243data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch243 = {7,11,-1,0,9,ch243data}; - -/* char: 0xf2 */ - -static const GLubyte ch242data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch242 = {7,11,-1,0,9,ch242data}; - -/* char: 0xf1 */ - -static const GLubyte ch241data[] = { -0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x0,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch241 = {7,11,-1,0,9,ch241data}; - -/* char: 0xf0 */ - -static const GLubyte ch240data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c,0x8,0x50,0x30,0x48, -}; - -static const BitmapCharRec ch240 = {7,11,-1,0,9,ch240data}; - -/* char: 0xef */ - -static const GLubyte ch239data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x50,0x50, -}; - -static const BitmapCharRec ch239 = {5,11,-2,0,9,ch239data}; - -/* char: 0xee */ - -static const GLubyte ch238data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x90,0x60, -}; - -static const BitmapCharRec ch238 = {5,11,-2,0,9,ch238data}; - -/* char: 0xed */ - -static const GLubyte ch237data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60,0x10, -}; - -static const BitmapCharRec ch237 = {5,11,-2,0,9,ch237data}; - -/* char: 0xec */ - -static const GLubyte ch236data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x30,0x40, -}; - -static const BitmapCharRec ch236 = {5,11,-2,0,9,ch236data}; - -/* char: 0xeb */ - -static const GLubyte ch235data[] = { -0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch235 = {7,11,-1,0,9,ch235data}; - -/* char: 0xea */ - -static const GLubyte ch234data[] = { -0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch234 = {7,11,-1,0,9,ch234data}; - -/* char: 0xe9 */ - -static const GLubyte ch233data[] = { -0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch233 = {7,11,-1,0,9,ch233data}; - -/* char: 0xe8 */ - -static const GLubyte ch232data[] = { -0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c,0x0,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch232 = {7,11,-1,0,9,ch232data}; - -/* char: 0xe7 */ - -static const GLubyte ch231data[] = { -0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, -}; - -static const BitmapCharRec ch231 = {7,10,-1,3,9,ch231data}; - -/* char: 0xe6 */ - -static const GLubyte ch230data[] = { -0x6e,0x92,0x90,0x7c,0x12,0x92,0x6c, -}; - -static const BitmapCharRec ch230 = {7,7,-1,0,9,ch230data}; - -/* char: 0xe5 */ - -static const GLubyte ch229data[] = { -0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x18,0x24,0x18, -}; - -static const BitmapCharRec ch229 = {7,11,-1,0,9,ch229data}; - -/* char: 0xe4 */ - -static const GLubyte ch228data[] = { -0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch228 = {7,11,-1,0,9,ch228data}; - -/* char: 0xe3 */ - -static const GLubyte ch227data[] = { -0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch227 = {7,11,-1,0,9,ch227data}; - -/* char: 0xe2 */ - -static const GLubyte ch226data[] = { -0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch226 = {7,11,-1,0,9,ch226data}; - -/* char: 0xe1 */ - -static const GLubyte ch225data[] = { -0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch225 = {7,11,-1,0,9,ch225data}; - -/* char: 0xe0 */ - -static const GLubyte ch224data[] = { -0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c,0x0,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch224 = {7,11,-1,0,9,ch224data}; - -/* char: 0xdf */ - -static const GLubyte ch223data[] = { -0x80,0xbc,0xc2,0x82,0x82,0xfc,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch223 = {7,9,-1,1,9,ch223data}; - -/* char: 0xde */ - -static const GLubyte ch222data[] = { -0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc,0x80,0x80, -}; - -static const BitmapCharRec ch222 = {7,10,-1,0,9,ch222data}; - -/* char: 0xdd */ - -static const GLubyte ch221data[] = { -0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch221 = {7,11,-1,0,9,ch221data}; - -/* char: 0xdc */ - -static const GLubyte ch220data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch220 = {7,11,-1,0,9,ch220data}; - -/* char: 0xdb */ - -static const GLubyte ch219data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch219 = {7,11,-1,0,9,ch219data}; - -/* char: 0xda */ - -static const GLubyte ch218data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch218 = {7,11,-1,0,9,ch218data}; - -/* char: 0xd9 */ - -static const GLubyte ch217data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch217 = {7,11,-1,0,9,ch217data}; - -/* char: 0xd8 */ - -static const GLubyte ch216data[] = { -0x80,0x7c,0xc2,0xa2,0xa2,0x92,0x92,0x8a,0x8a,0x86,0x7c,0x2, -}; - -static const BitmapCharRec ch216 = {7,12,-1,1,9,ch216data}; - -/* char: 0xd7 */ - -static const GLubyte ch215data[] = { -0x82,0x44,0x28,0x10,0x28,0x44,0x82, -}; - -static const BitmapCharRec ch215 = {7,7,-1,-1,9,ch215data}; - -/* char: 0xd6 */ - -static const GLubyte ch214data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch214 = {7,11,-1,0,9,ch214data}; - -/* char: 0xd5 */ - -static const GLubyte ch213data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch213 = {7,11,-1,0,9,ch213data}; - -/* char: 0xd4 */ - -static const GLubyte ch212data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch212 = {7,11,-1,0,9,ch212data}; - -/* char: 0xd3 */ - -static const GLubyte ch211data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch211 = {7,11,-1,0,9,ch211data}; - -/* char: 0xd2 */ - -static const GLubyte ch210data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x7c,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch210 = {7,11,-1,0,9,ch210data}; - -/* char: 0xd1 */ - -static const GLubyte ch209data[] = { -0x82,0x86,0x8a,0x92,0x92,0xa2,0xc2,0x82,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch209 = {7,11,-1,0,9,ch209data}; - -/* char: 0xd0 */ - -static const GLubyte ch208data[] = { -0xfc,0x42,0x42,0x42,0x42,0xf2,0x42,0x42,0x42,0xfc, -}; - -static const BitmapCharRec ch208 = {7,10,-1,0,9,ch208data}; - -/* char: 0xcf */ - -static const GLubyte ch207data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x50,0x50, -}; - -static const BitmapCharRec ch207 = {5,11,-2,0,9,ch207data}; - -/* char: 0xce */ - -static const GLubyte ch206data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x88,0x70, -}; - -static const BitmapCharRec ch206 = {5,11,-2,0,9,ch206data}; - -/* char: 0xcd */ - -static const GLubyte ch205data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x60,0x10, -}; - -static const BitmapCharRec ch205 = {5,11,-2,0,9,ch205data}; - -/* char: 0xcc */ - -static const GLubyte ch204data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xf8,0x0,0x30,0x40, -}; - -static const BitmapCharRec ch204 = {5,11,-2,0,9,ch204data}; - -/* char: 0xcb */ - -static const GLubyte ch203data[] = { -0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch203 = {7,11,-1,0,9,ch203data}; - -/* char: 0xca */ - -static const GLubyte ch202data[] = { -0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch202 = {7,11,-1,0,9,ch202data}; - -/* char: 0xc9 */ - -static const GLubyte ch201data[] = { -0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch201 = {7,11,-1,0,9,ch201data}; - -/* char: 0xc8 */ - -static const GLubyte ch200data[] = { -0xfe,0x40,0x40,0x40,0x78,0x40,0x40,0xfe,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch200 = {7,11,-1,0,9,ch200data}; - -/* char: 0xc7 */ - -static const GLubyte ch199data[] = { -0x30,0x48,0x18,0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, -}; - -static const BitmapCharRec ch199 = {7,13,-1,3,9,ch199data}; - -/* char: 0xc6 */ - -static const GLubyte ch198data[] = { -0x9e,0x90,0x90,0x90,0xfc,0x90,0x90,0x90,0x90,0x6e, -}; - -static const BitmapCharRec ch198 = {7,10,-1,0,9,ch198data}; - -/* char: 0xc5 */ - -static const GLubyte ch197data[] = { -0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x10,0x28,0x10, -}; - -static const BitmapCharRec ch197 = {7,11,-1,0,9,ch197data}; - -/* char: 0xc4 */ - -static const GLubyte ch196data[] = { -0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x28,0x28, -}; - -static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; - -/* char: 0xc3 */ - -static const GLubyte ch195data[] = { -0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch195 = {7,11,-1,0,9,ch195data}; - -/* char: 0xc2 */ - -static const GLubyte ch194data[] = { -0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x44,0x38, -}; - -static const BitmapCharRec ch194 = {7,11,-1,0,9,ch194data}; - -/* char: 0xc1 */ - -static const GLubyte ch193data[] = { -0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x30,0x8, -}; - -static const BitmapCharRec ch193 = {7,11,-1,0,9,ch193data}; - -/* char: 0xc0 */ - -static const GLubyte ch192data[] = { -0x82,0x82,0x82,0xfe,0x82,0x82,0x44,0x38,0x0,0x18,0x20, -}; - -static const BitmapCharRec ch192 = {7,11,-1,0,9,ch192data}; - -/* char: 0xbf */ - -static const GLubyte ch191data[] = { -0x7c,0x82,0x82,0x80,0x40,0x20,0x10,0x10,0x0,0x10, -}; - -static const BitmapCharRec ch191 = {7,10,-1,0,9,ch191data}; - -/* char: 0xbe */ - -static const GLubyte ch190data[] = { -0x6,0x1a,0x12,0xa,0x66,0x92,0x10,0x20,0x90,0x60, -}; - -static const BitmapCharRec ch190 = {7,10,-1,0,9,ch190data}; - -/* char: 0xbd */ - -static const GLubyte ch189data[] = { -0x1e,0x10,0xc,0x2,0xf2,0x4c,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch189 = {7,10,-1,0,9,ch189data}; - -/* char: 0xbc */ - -static const GLubyte ch188data[] = { -0x6,0x1a,0x12,0xa,0xe6,0x42,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch188 = {7,10,-1,0,9,ch188data}; - -/* char: 0xbb */ - -static const GLubyte ch187data[] = { -0x90,0x48,0x24,0x12,0x12,0x24,0x48,0x90, -}; - -static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; - -/* char: 0xba */ - -static const GLubyte ch186data[] = { -0xf8,0x0,0x70,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch186 = {5,6,-1,-5,9,ch186data}; - -/* char: 0xb9 */ - -static const GLubyte ch185data[] = { -0xe0,0x40,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch185 = {3,6,-1,-4,9,ch185data}; - -/* char: 0xb8 */ - -static const GLubyte ch184data[] = { -0x60,0x90,0x30, -}; - -static const BitmapCharRec ch184 = {4,3,-2,3,9,ch184data}; - -/* char: 0xb7 */ - -static const GLubyte ch183data[] = { -0xc0,0xc0, -}; - -static const BitmapCharRec ch183 = {2,2,-4,-4,9,ch183data}; - -/* char: 0xb6 */ - -static const GLubyte ch182data[] = { -0xa,0xa,0xa,0xa,0xa,0x7a,0x8a,0x8a,0x8a,0x7e, -}; - -static const BitmapCharRec ch182 = {7,10,-1,0,9,ch182data}; - -/* char: 0xb5 */ - -static const GLubyte ch181data[] = { -0x80,0x80,0xba,0xc6,0x82,0x82,0x82,0x82,0x82, -}; - -static const BitmapCharRec ch181 = {7,9,-1,2,9,ch181data}; - -/* char: 0xb4 */ - -static const GLubyte ch180data[] = { -0xc0,0x20, -}; - -static const BitmapCharRec ch180 = {3,2,-3,-9,9,ch180data}; - -/* char: 0xb3 */ - -static const GLubyte ch179data[] = { -0x60,0x90,0x10,0x20,0x90,0x60, -}; - -static const BitmapCharRec ch179 = {4,6,-1,-4,9,ch179data}; - -/* char: 0xb2 */ - -static const GLubyte ch178data[] = { -0xf0,0x80,0x60,0x10,0x90,0x60, -}; - -static const BitmapCharRec ch178 = {4,6,-1,-4,9,ch178data}; - -/* char: 0xb1 */ - -static const GLubyte ch177data[] = { -0xfe,0x0,0x10,0x10,0x10,0xfe,0x10,0x10,0x10, -}; - -static const BitmapCharRec ch177 = {7,9,-1,-1,9,ch177data}; - -/* char: 0xb0 */ - -static const GLubyte ch176data[] = { -0x60,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch176 = {4,4,-3,-6,9,ch176data}; - -/* char: 0xaf */ - -static const GLubyte ch175data[] = { -0xfc, -}; - -static const BitmapCharRec ch175 = {6,1,-1,-9,9,ch175data}; - -/* char: 0xae */ - -static const GLubyte ch174data[] = { -0x3c,0x42,0xa5,0xa9,0xbd,0xa5,0xb9,0x42,0x3c, -}; - -static const BitmapCharRec ch174 = {8,9,0,-1,9,ch174data}; - -/* char: 0xad */ - -static const GLubyte ch173data[] = { -0xfc, -}; - -static const BitmapCharRec ch173 = {6,1,-1,-4,9,ch173data}; - -/* char: 0xac */ - -static const GLubyte ch172data[] = { -0x4,0x4,0x4,0xfc, -}; - -static const BitmapCharRec ch172 = {6,4,-1,-2,9,ch172data}; - -/* char: 0xab */ - -static const GLubyte ch171data[] = { -0x12,0x24,0x48,0x90,0x90,0x48,0x24,0x12, -}; - -static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; - -/* char: 0xaa */ - -static const GLubyte ch170data[] = { -0xf8,0x0,0x78,0x90,0x70,0x90,0x60, -}; - -static const BitmapCharRec ch170 = {5,7,-3,-3,9,ch170data}; - -/* char: 0xa9 */ - -static const GLubyte ch169data[] = { -0x3c,0x42,0x99,0xa5,0xa1,0xa5,0x99,0x42,0x3c, -}; - -static const BitmapCharRec ch169 = {8,9,0,-1,9,ch169data}; - -/* char: 0xa8 */ - -static const GLubyte ch168data[] = { -0xa0,0xa0, -}; - -static const BitmapCharRec ch168 = {3,2,-3,-9,9,ch168data}; - -/* char: 0xa7 */ - -static const GLubyte ch167data[] = { -0x70,0x88,0x8,0x70,0x88,0x88,0x88,0x70,0x80,0x88,0x70, -}; - -static const BitmapCharRec ch167 = {5,11,-2,1,9,ch167data}; - -/* char: 0xa6 */ - -static const GLubyte ch166data[] = { -0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch166 = {1,11,-4,1,9,ch166data}; - -/* char: 0xa5 */ - -static const GLubyte ch165data[] = { -0x10,0x10,0x10,0x7c,0x10,0x7c,0x28,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch165 = {7,10,-1,0,9,ch165data}; - -/* char: 0xa4 */ - -static const GLubyte ch164data[] = { -0x82,0x7c,0x44,0x44,0x7c,0x82, -}; - -static const BitmapCharRec ch164 = {7,6,-1,-3,9,ch164data}; - -/* char: 0xa3 */ - -static const GLubyte ch163data[] = { -0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, -}; - -static const BitmapCharRec ch163 = {7,10,-1,0,9,ch163data}; - -/* char: 0xa2 */ - -static const GLubyte ch162data[] = { -0x40,0x78,0xa4,0xa0,0x90,0x94,0x78,0x8, -}; - -static const BitmapCharRec ch162 = {6,8,-1,0,9,ch162data}; - -/* char: 0xa1 */ - -static const GLubyte ch161data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80, -}; - -static const BitmapCharRec ch161 = {1,11,-4,0,9,ch161data}; - -/* char: 0x7e '~' */ - -static const GLubyte ch126data[] = { -0x8c,0x92,0x62, -}; - -static const BitmapCharRec ch126 = {7,3,-1,-7,9,ch126data}; - -/* char: 0x7d '}' */ - -static const GLubyte ch125data[] = { -0xe0,0x10,0x10,0x10,0x20,0x18,0x18,0x20,0x10,0x10,0x10,0xe0, -}; - -static const BitmapCharRec ch125 = {5,12,-1,1,9,ch125data}; - -/* char: 0x7c '|' */ - -static const GLubyte ch124data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch124 = {1,12,-4,1,9,ch124data}; - -/* char: 0x7b '{' */ - -static const GLubyte ch123data[] = { -0x38,0x40,0x40,0x40,0x20,0xc0,0xc0,0x20,0x40,0x40,0x40,0x38, -}; - -static const BitmapCharRec ch123 = {5,12,-3,1,9,ch123data}; - -/* char: 0x7a 'z' */ - -static const GLubyte ch122data[] = { -0xfe,0x40,0x20,0x10,0x8,0x4,0xfe, -}; - -static const BitmapCharRec ch122 = {7,7,-1,0,9,ch122data}; - -/* char: 0x79 'y' */ - -static const GLubyte ch121data[] = { -0x78,0x84,0x4,0x74,0x8c,0x84,0x84,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch121 = {6,10,-1,3,9,ch121data}; - -/* char: 0x78 'x' */ - -static const GLubyte ch120data[] = { -0x82,0x44,0x28,0x10,0x28,0x44,0x82, -}; - -static const BitmapCharRec ch120 = {7,7,-1,0,9,ch120data}; - -/* char: 0x77 'w' */ - -static const GLubyte ch119data[] = { -0x44,0xaa,0x92,0x92,0x92,0x82,0x82, -}; - -static const BitmapCharRec ch119 = {7,7,-1,0,9,ch119data}; - -/* char: 0x76 'v' */ - -static const GLubyte ch118data[] = { -0x10,0x28,0x28,0x44,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch118 = {7,7,-1,0,9,ch118data}; - -/* char: 0x75 'u' */ - -static const GLubyte ch117data[] = { -0x7a,0x84,0x84,0x84,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch117 = {7,7,-1,0,9,ch117data}; - -/* char: 0x74 't' */ - -static const GLubyte ch116data[] = { -0x1c,0x22,0x20,0x20,0x20,0x20,0xfc,0x20,0x20, -}; - -static const BitmapCharRec ch116 = {7,9,-1,0,9,ch116data}; - -/* char: 0x73 's' */ - -static const GLubyte ch115data[] = { -0x7c,0x82,0x2,0x7c,0x80,0x82,0x7c, -}; - -static const BitmapCharRec ch115 = {7,7,-1,0,9,ch115data}; - -/* char: 0x72 'r' */ - -static const GLubyte ch114data[] = { -0x40,0x40,0x40,0x40,0x42,0x62,0x9c, -}; - -static const BitmapCharRec ch114 = {7,7,-1,0,9,ch114data}; - -/* char: 0x71 'q' */ - -static const GLubyte ch113data[] = { -0x2,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x86,0x7a, -}; - -static const BitmapCharRec ch113 = {7,10,-1,3,9,ch113data}; - -/* char: 0x70 'p' */ - -static const GLubyte ch112data[] = { -0x80,0x80,0x80,0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc, -}; - -static const BitmapCharRec ch112 = {7,10,-1,3,9,ch112data}; - -/* char: 0x6f 'o' */ - -static const GLubyte ch111data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch111 = {7,7,-1,0,9,ch111data}; - -/* char: 0x6e 'n' */ - -static const GLubyte ch110data[] = { -0x82,0x82,0x82,0x82,0x82,0xc2,0xbc, -}; - -static const BitmapCharRec ch110 = {7,7,-1,0,9,ch110data}; - -/* char: 0x6d 'm' */ - -static const GLubyte ch109data[] = { -0x82,0x92,0x92,0x92,0x92,0x92,0xec, -}; - -static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; - -/* char: 0x6c 'l' */ - -static const GLubyte ch108data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0, -}; - -static const BitmapCharRec ch108 = {5,10,-2,0,9,ch108data}; - -/* char: 0x6b 'k' */ - -static const GLubyte ch107data[] = { -0x82,0x8c,0xb0,0xc0,0xb0,0x8c,0x82,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch107 = {7,10,-1,0,9,ch107data}; - -/* char: 0x6a 'j' */ - -static const GLubyte ch106data[] = { -0x78,0x84,0x84,0x84,0x4,0x4,0x4,0x4,0x4,0x1c,0x0,0x0,0xc, -}; - -static const BitmapCharRec ch106 = {6,13,-1,3,9,ch106data}; - -/* char: 0x69 'i' */ - -static const GLubyte ch105data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0xe0,0x0,0x0,0x60, -}; - -static const BitmapCharRec ch105 = {5,10,-2,0,9,ch105data}; - -/* char: 0x68 'h' */ - -static const GLubyte ch104data[] = { -0x82,0x82,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch104 = {7,10,-1,0,9,ch104data}; - -/* char: 0x67 'g' */ - -static const GLubyte ch103data[] = { -0x7c,0x82,0x82,0x7c,0x80,0x78,0x84,0x84,0x84,0x7a, -}; - -static const BitmapCharRec ch103 = {7,10,-1,3,9,ch103data}; - -/* char: 0x66 'f' */ - -static const GLubyte ch102data[] = { -0x20,0x20,0x20,0x20,0xf8,0x20,0x20,0x22,0x22,0x1c, -}; - -static const BitmapCharRec ch102 = {7,10,-1,0,9,ch102data}; - -/* char: 0x65 'e' */ - -static const GLubyte ch101data[] = { -0x7c,0x80,0x80,0xfe,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch101 = {7,7,-1,0,9,ch101data}; - -/* char: 0x64 'd' */ - -static const GLubyte ch100data[] = { -0x7a,0x86,0x82,0x82,0x82,0x86,0x7a,0x2,0x2,0x2, -}; - -static const BitmapCharRec ch100 = {7,10,-1,0,9,ch100data}; - -/* char: 0x63 'c' */ - -static const GLubyte ch99data[] = { -0x7c,0x82,0x80,0x80,0x80,0x82,0x7c, -}; - -static const BitmapCharRec ch99 = {7,7,-1,0,9,ch99data}; - -/* char: 0x62 'b' */ - -static const GLubyte ch98data[] = { -0xbc,0xc2,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch98 = {7,10,-1,0,9,ch98data}; - -/* char: 0x61 'a' */ - -static const GLubyte ch97data[] = { -0x7a,0x86,0x82,0x7e,0x2,0x2,0x7c, -}; - -static const BitmapCharRec ch97 = {7,7,-1,0,9,ch97data}; - -/* char: 0x60 '`' */ - -static const GLubyte ch96data[] = { -0x10,0x20,0x40,0xc0, -}; - -static const BitmapCharRec ch96 = {4,4,-3,-6,9,ch96data}; - -/* char: 0x5f '_' */ - -static const GLubyte ch95data[] = { -0xff, -}; - -static const BitmapCharRec ch95 = {8,1,0,1,9,ch95data}; - -/* char: 0x5e '^' */ - -static const GLubyte ch94data[] = { -0x82,0x44,0x28,0x10, -}; - -static const BitmapCharRec ch94 = {7,4,-1,-6,9,ch94data}; - -/* char: 0x5d ']' */ - -static const GLubyte ch93data[] = { -0xf0,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xf0, -}; - -static const BitmapCharRec ch93 = {4,12,-2,1,9,ch93data}; - -/* char: 0x5c '\' */ - -static const GLubyte ch92data[] = { -0x2,0x4,0x4,0x8,0x10,0x10,0x20,0x40,0x40,0x80, -}; - -static const BitmapCharRec ch92 = {7,10,-1,0,9,ch92data}; - -/* char: 0x5b '[' */ - -static const GLubyte ch91data[] = { -0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xf0, -}; - -static const BitmapCharRec ch91 = {4,12,-3,1,9,ch91data}; - -/* char: 0x5a 'Z' */ - -static const GLubyte ch90data[] = { -0xfe,0x80,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, -}; - -static const BitmapCharRec ch90 = {7,10,-1,0,9,ch90data}; - -/* char: 0x59 'Y' */ - -static const GLubyte ch89data[] = { -0x10,0x10,0x10,0x10,0x10,0x10,0x28,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch89 = {7,10,-1,0,9,ch89data}; - -/* char: 0x58 'X' */ - -static const GLubyte ch88data[] = { -0x82,0x82,0x44,0x28,0x10,0x10,0x28,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch88 = {7,10,-1,0,9,ch88data}; - -/* char: 0x57 'W' */ - -static const GLubyte ch87data[] = { -0x44,0xaa,0x92,0x92,0x92,0x92,0x82,0x82,0x82,0x82, -}; - -static const BitmapCharRec ch87 = {7,10,-1,0,9,ch87data}; - -/* char: 0x56 'V' */ - -static const GLubyte ch86data[] = { -0x10,0x28,0x28,0x28,0x44,0x44,0x44,0x82,0x82,0x82, -}; - -static const BitmapCharRec ch86 = {7,10,-1,0,9,ch86data}; - -/* char: 0x55 'U' */ - -static const GLubyte ch85data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82, -}; - -static const BitmapCharRec ch85 = {7,10,-1,0,9,ch85data}; - -/* char: 0x54 'T' */ - -static const GLubyte ch84data[] = { -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, -}; - -static const BitmapCharRec ch84 = {7,10,-1,0,9,ch84data}; - -/* char: 0x53 'S' */ - -static const GLubyte ch83data[] = { -0x7c,0x82,0x82,0x2,0xc,0x70,0x80,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch83 = {7,10,-1,0,9,ch83data}; - -/* char: 0x52 'R' */ - -static const GLubyte ch82data[] = { -0x82,0x82,0x84,0x88,0x90,0xfc,0x82,0x82,0x82,0xfc, -}; - -static const BitmapCharRec ch82 = {7,10,-1,0,9,ch82data}; - -/* char: 0x51 'Q' */ - -static const GLubyte ch81data[] = { -0x6,0x8,0x7c,0x92,0xa2,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch81 = {7,12,-1,2,9,ch81data}; - -/* char: 0x50 'P' */ - -static const GLubyte ch80data[] = { -0x80,0x80,0x80,0x80,0x80,0xfc,0x82,0x82,0x82,0xfc, -}; - -static const BitmapCharRec ch80 = {7,10,-1,0,9,ch80data}; - -/* char: 0x4f 'O' */ - -static const GLubyte ch79data[] = { -0x7c,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch79 = {7,10,-1,0,9,ch79data}; - -/* char: 0x4e 'N' */ - -static const GLubyte ch78data[] = { -0x82,0x82,0x82,0x86,0x8a,0x92,0xa2,0xc2,0x82,0x82, -}; - -static const BitmapCharRec ch78 = {7,10,-1,0,9,ch78data}; - -/* char: 0x4d 'M' */ - -static const GLubyte ch77data[] = { -0x82,0x82,0x82,0x92,0x92,0xaa,0xaa,0xc6,0x82,0x82, -}; - -static const BitmapCharRec ch77 = {7,10,-1,0,9,ch77data}; - -/* char: 0x4c 'L' */ - -static const GLubyte ch76data[] = { -0xfe,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch76 = {7,10,-1,0,9,ch76data}; - -/* char: 0x4b 'K' */ - -static const GLubyte ch75data[] = { -0x82,0x84,0x88,0x90,0xa0,0xe0,0x90,0x88,0x84,0x82, -}; - -static const BitmapCharRec ch75 = {7,10,-1,0,9,ch75data}; - -/* char: 0x4a 'J' */ - -static const GLubyte ch74data[] = { -0x78,0x84,0x4,0x4,0x4,0x4,0x4,0x4,0x4,0x1e, -}; - -static const BitmapCharRec ch74 = {7,10,-1,0,9,ch74data}; - -/* char: 0x49 'I' */ - -static const GLubyte ch73data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, -}; - -static const BitmapCharRec ch73 = {5,10,-2,0,9,ch73data}; - -/* char: 0x48 'H' */ - -static const GLubyte ch72data[] = { -0x82,0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, -}; - -static const BitmapCharRec ch72 = {7,10,-1,0,9,ch72data}; - -/* char: 0x47 'G' */ - -static const GLubyte ch71data[] = { -0x7c,0x82,0x82,0x82,0x8e,0x80,0x80,0x80,0x82,0x7c, -}; - -static const BitmapCharRec ch71 = {7,10,-1,0,9,ch71data}; - -/* char: 0x46 'F' */ - -static const GLubyte ch70data[] = { -0x40,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, -}; - -static const BitmapCharRec ch70 = {7,10,-1,0,9,ch70data}; - -/* char: 0x45 'E' */ - -static const GLubyte ch69data[] = { -0xfe,0x40,0x40,0x40,0x40,0x78,0x40,0x40,0x40,0xfe, -}; - -static const BitmapCharRec ch69 = {7,10,-1,0,9,ch69data}; - -/* char: 0x44 'D' */ - -static const GLubyte ch68data[] = { -0xfc,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0xfc, -}; - -static const BitmapCharRec ch68 = {7,10,-1,0,9,ch68data}; - -/* char: 0x43 'C' */ - -static const GLubyte ch67data[] = { -0x7c,0x82,0x80,0x80,0x80,0x80,0x80,0x80,0x82,0x7c, -}; - -static const BitmapCharRec ch67 = {7,10,-1,0,9,ch67data}; - -/* char: 0x42 'B' */ - -static const GLubyte ch66data[] = { -0xfc,0x42,0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0xfc, -}; - -static const BitmapCharRec ch66 = {7,10,-1,0,9,ch66data}; - -/* char: 0x41 'A' */ - -static const GLubyte ch65data[] = { -0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x44,0x28,0x10, -}; - -static const BitmapCharRec ch65 = {7,10,-1,0,9,ch65data}; - -/* char: 0x40 '@' */ - -static const GLubyte ch64data[] = { -0x7c,0x80,0x80,0x9a,0xa6,0xa2,0x9e,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch64 = {7,10,-1,0,9,ch64data}; - -/* char: 0x3f '?' */ - -static const GLubyte ch63data[] = { -0x10,0x0,0x10,0x10,0x8,0x4,0x2,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch63 = {7,10,-1,0,9,ch63data}; - -/* char: 0x3e '>' */ - -static const GLubyte ch62data[] = { -0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, -}; - -static const BitmapCharRec ch62 = {5,10,-2,0,9,ch62data}; - -/* char: 0x3d '=' */ - -static const GLubyte ch61data[] = { -0xfe,0x0,0x0,0xfe, -}; - -static const BitmapCharRec ch61 = {7,4,-1,-2,9,ch61data}; - -/* char: 0x3c '<' */ - -static const GLubyte ch60data[] = { -0x8,0x10,0x20,0x40,0x80,0x80,0x40,0x20,0x10,0x8, -}; - -static const BitmapCharRec ch60 = {5,10,-2,0,9,ch60data}; - -/* char: 0x3b ';' */ - -static const GLubyte ch59data[] = { -0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch59 = {2,10,-4,3,9,ch59data}; - -/* char: 0x3a ':' */ - -static const GLubyte ch58data[] = { -0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch58 = {2,7,-4,0,9,ch58data}; - -/* char: 0x39 '9' */ - -static const GLubyte ch57data[] = { -0x78,0x4,0x2,0x2,0x7a,0x86,0x82,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch57 = {7,10,-1,0,9,ch57data}; - -/* char: 0x38 '8' */ - -static const GLubyte ch56data[] = { -0x38,0x44,0x82,0x82,0x44,0x38,0x44,0x82,0x44,0x38, -}; - -static const BitmapCharRec ch56 = {7,10,-1,0,9,ch56data}; - -/* char: 0x37 '7' */ - -static const GLubyte ch55data[] = { -0x40,0x40,0x20,0x20,0x10,0x8,0x4,0x2,0x2,0xfe, -}; - -static const BitmapCharRec ch55 = {7,10,-1,0,9,ch55data}; - -/* char: 0x36 '6' */ - -static const GLubyte ch54data[] = { -0x7c,0x82,0x82,0x82,0xc2,0xbc,0x80,0x80,0x40,0x3c, -}; - -static const BitmapCharRec ch54 = {7,10,-1,0,9,ch54data}; - -/* char: 0x35 '5' */ - -static const GLubyte ch53data[] = { -0x7c,0x82,0x2,0x2,0x2,0xc2,0xbc,0x80,0x80,0xfe, -}; - -static const BitmapCharRec ch53 = {7,10,-1,0,9,ch53data}; - -/* char: 0x34 '4' */ - -static const GLubyte ch52data[] = { -0x4,0x4,0x4,0xfe,0x84,0x44,0x24,0x14,0xc,0x4, -}; - -static const BitmapCharRec ch52 = {7,10,-1,0,9,ch52data}; - -/* char: 0x33 '3' */ - -static const GLubyte ch51data[] = { -0x7c,0x82,0x2,0x2,0x2,0x1c,0x8,0x4,0x2,0xfe, -}; - -static const BitmapCharRec ch51 = {7,10,-1,0,9,ch51data}; - -/* char: 0x32 '2' */ - -static const GLubyte ch50data[] = { -0xfe,0x80,0x40,0x30,0x8,0x4,0x2,0x82,0x82,0x7c, -}; - -static const BitmapCharRec ch50 = {7,10,-1,0,9,ch50data}; - -/* char: 0x31 '1' */ - -static const GLubyte ch49data[] = { -0xfe,0x10,0x10,0x10,0x10,0x10,0x90,0x50,0x30,0x10, -}; - -static const BitmapCharRec ch49 = {7,10,-1,0,9,ch49data}; - -/* char: 0x30 '0' */ - -static const GLubyte ch48data[] = { -0x38,0x44,0x82,0x82,0x82,0x82,0x82,0x82,0x44,0x38, -}; - -static const BitmapCharRec ch48 = {7,10,-1,0,9,ch48data}; - -/* char: 0x2f '/' */ - -static const GLubyte ch47data[] = { -0x80,0x40,0x40,0x20,0x10,0x10,0x8,0x4,0x4,0x2, -}; - -static const BitmapCharRec ch47 = {7,10,-1,0,9,ch47data}; - -/* char: 0x2e '.' */ - -static const GLubyte ch46data[] = { -0xc0,0xc0, -}; - -static const BitmapCharRec ch46 = {2,2,-4,0,9,ch46data}; - -/* char: 0x2d '-' */ - -static const GLubyte ch45data[] = { -0xfe, -}; - -static const BitmapCharRec ch45 = {7,1,-1,-4,9,ch45data}; - -/* char: 0x2c ',' */ - -static const GLubyte ch44data[] = { -0x80,0x40,0x40,0xc0,0xc0, -}; - -static const BitmapCharRec ch44 = {2,5,-4,3,9,ch44data}; - -/* char: 0x2b '+' */ - -static const GLubyte ch43data[] = { -0x10,0x10,0x10,0xfe,0x10,0x10,0x10, -}; - -static const BitmapCharRec ch43 = {7,7,-1,-1,9,ch43data}; - -/* char: 0x2a '*' */ - -static const GLubyte ch42data[] = { -0x10,0x92,0x54,0x38,0x54,0x92,0x10, -}; - -static const BitmapCharRec ch42 = {7,7,-1,-1,9,ch42data}; - -/* char: 0x29 ')' */ - -static const GLubyte ch41data[] = { -0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, -}; - -static const BitmapCharRec ch41 = {3,12,-3,1,9,ch41data}; - -/* char: 0x28 '(' */ - -static const GLubyte ch40data[] = { -0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, -}; - -static const BitmapCharRec ch40 = {3,12,-3,1,9,ch40data}; - -/* char: 0x27 ''' */ - -static const GLubyte ch39data[] = { -0x80,0x40,0x20,0x30, -}; - -static const BitmapCharRec ch39 = {4,4,-3,-6,9,ch39data}; - -/* char: 0x26 '&' */ - -static const GLubyte ch38data[] = { -0x62,0x94,0x88,0x94,0x62,0x60,0x90,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch38 = {7,10,-1,0,9,ch38data}; - -/* char: 0x25 '%' */ - -static const GLubyte ch37data[] = { -0x84,0x4a,0x4a,0x24,0x10,0x10,0x48,0xa4,0xa4,0x42, -}; - -static const BitmapCharRec ch37 = {7,10,-1,0,9,ch37data}; - -/* char: 0x24 '$' */ - -static const GLubyte ch36data[] = { -0x10,0x7c,0x92,0x12,0x12,0x14,0x38,0x50,0x90,0x92,0x7c,0x10, -}; - -static const BitmapCharRec ch36 = {7,12,-1,1,9,ch36data}; - -/* char: 0x23 '#' */ - -static const GLubyte ch35data[] = { -0x48,0x48,0xfc,0x48,0x48,0xfc,0x48,0x48, -}; - -static const BitmapCharRec ch35 = {6,8,-1,-1,9,ch35data}; - -/* char: 0x22 '"' */ - -static const GLubyte ch34data[] = { -0x90,0x90,0x90, -}; - -static const BitmapCharRec ch34 = {4,3,-3,-7,9,ch34data}; - -/* char: 0x21 '!' */ - -static const GLubyte ch33data[] = { -0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch33 = {1,11,-4,0,9,ch33data}; - -/* char: 0x1f */ - -static const GLubyte ch31data[] = { -0xc0,0xc0, -}; - -static const BitmapCharRec ch31 = {2,2,-4,-2,9,ch31data}; - -/* char: 0x1e */ - -static const GLubyte ch30data[] = { -0x5c,0xa2,0x60,0x20,0x20,0xf8,0x20,0x20,0x22,0x1c, -}; - -static const BitmapCharRec ch30 = {7,10,-1,0,9,ch30data}; - -/* char: 0x1d */ - -static const GLubyte ch29data[] = { -0x80,0x40,0xfe,0x10,0xfe,0x4,0x2, -}; - -static const BitmapCharRec ch29 = {7,7,-1,0,9,ch29data}; - -/* char: 0x1c */ - -static const GLubyte ch28data[] = { -0x44,0x24,0x24,0x24,0x24,0x24,0xfe, -}; - -static const BitmapCharRec ch28 = {7,7,-1,0,9,ch28data}; - -/* char: 0x1b */ - -static const GLubyte ch27data[] = { -0xfe,0x0,0x80,0x40,0x20,0x10,0x8,0x8,0x10,0x20,0x40,0x80, -}; - -static const BitmapCharRec ch27 = {7,12,-1,2,9,ch27data}; - -/* char: 0x1a */ - -static const GLubyte ch26data[] = { -0xfc,0x0,0x4,0x8,0x10,0x20,0x40,0x40,0x20,0x10,0x8,0x4, -}; - -static const BitmapCharRec ch26 = {6,12,-2,2,9,ch26data}; - -/* char: 0x19 */ - -static const GLubyte ch25data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch25 = {1,15,-4,3,9,ch25data}; - -/* char: 0x18 */ - -static const GLubyte ch24data[] = { -0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80, -}; - -static const BitmapCharRec ch24 = {9,7,0,3,9,ch24data}; - -/* char: 0x17 */ - -static const GLubyte ch23data[] = { -0xff,0x80,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, -0x8,0x0, -}; - -static const BitmapCharRec ch23 = {9,9,0,-3,9,ch23data}; - -/* char: 0x16 */ - -static const GLubyte ch22data[] = { -0x8,0x8,0x8,0x8,0x8,0x8,0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, -}; - -static const BitmapCharRec ch22 = {5,15,0,3,9,ch22data}; - -/* char: 0x15 */ - -static const GLubyte ch21data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch21 = {5,15,-4,3,9,ch21data}; - -/* char: 0x14 */ - -static const GLubyte ch20data[] = { -0xff,0x80, -}; - -static const BitmapCharRec ch20 = {9,1,0,1,9,ch20data}; - -/* char: 0x13 */ - -static const GLubyte ch19data[] = { -0xff,0x80, -}; - -static const BitmapCharRec ch19 = {9,1,0,-1,9,ch19data}; - -/* char: 0x12 */ - -static const GLubyte ch18data[] = { -0xff,0x80, -}; - -static const BitmapCharRec ch18 = {9,1,0,-3,9,ch18data}; - -/* char: 0x11 */ - -static const GLubyte ch17data[] = { -0xff,0x80, -}; - -static const BitmapCharRec ch17 = {9,1,0,-5,9,ch17data}; - -/* char: 0x10 */ - -static const GLubyte ch16data[] = { -0xff,0x80, -}; - -static const BitmapCharRec ch16 = {9,1,0,-7,9,ch16data}; - -/* char: 0xf */ - -static const GLubyte ch15data[] = { -0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0xff,0x80,0x8,0x0, -0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0, -}; - -static const BitmapCharRec ch15 = {9,15,0,3,9,ch15data}; - -/* char: 0xe */ - -static const GLubyte ch14data[] = { -0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch14 = {5,9,-4,-3,9,ch14data}; - -/* char: 0xd */ - -static const GLubyte ch13data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0xf8, -}; - -static const BitmapCharRec ch13 = {5,7,-4,3,9,ch13data}; - -/* char: 0xc */ - -static const GLubyte ch12data[] = { -0x8,0x8,0x8,0x8,0x8,0x8,0xf8, -}; - -static const BitmapCharRec ch12 = {5,7,0,3,9,ch12data}; - -/* char: 0xb */ - -static const GLubyte ch11data[] = { -0xf8,0x8,0x8,0x8,0x8,0x8,0x8,0x8,0x8, -}; - -static const BitmapCharRec ch11 = {5,9,0,-3,9,ch11data}; - -/* char: 0xa */ - -static const GLubyte ch10data[] = { -0x8,0x8,0x8,0x8,0x3e,0x0,0x20,0x50,0x88,0x88, -}; - -static const BitmapCharRec ch10 = {7,10,-1,2,9,ch10data}; - -/* char: 0x9 */ - -static const GLubyte ch9data[] = { -0x3e,0x20,0x20,0x20,0x20,0x88,0x98,0xa8,0xc8,0x88, -}; - -static const BitmapCharRec ch9 = {7,10,-1,2,9,ch9data}; - -/* char: 0x8 */ - -static const GLubyte ch8data[] = { -0xfe,0x10,0x10,0xfe,0x10,0x10, -}; - -static const BitmapCharRec ch8 = {7,6,-1,0,9,ch8data}; - -/* char: 0x7 */ - -static const GLubyte ch7data[] = { -0x70,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch7 = {5,4,-2,-6,9,ch7data}; - -/* char: 0x6 */ - -static const GLubyte ch6data[] = { -0x20,0x20,0x3c,0x20,0x3e,0x0,0xf8,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch6 = {7,10,-1,2,9,ch6data}; - -/* char: 0x5 */ - -static const GLubyte ch5data[] = { -0x22,0x22,0x3c,0x22,0x3c,0x0,0x78,0x80,0x80,0x78, -}; - -static const BitmapCharRec ch5 = {7,10,-1,2,9,ch5data}; - -/* char: 0x4 */ - -static const GLubyte ch4data[] = { -0x10,0x10,0x1c,0x10,0x1e,0x80,0x80,0xe0,0x80,0xf0, -}; - -static const BitmapCharRec ch4 = {7,10,-1,2,9,ch4data}; - -/* char: 0x3 */ - -static const GLubyte ch3data[] = { -0x8,0x8,0x8,0x3e,0x0,0x88,0x88,0xf8,0x88,0x88, -}; - -static const BitmapCharRec ch3 = {7,10,-1,2,9,ch3data}; - -/* char: 0x2 */ - -static const GLubyte ch2data[] = { -0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, -}; - -static const BitmapCharRec ch2 = {8,14,0,3,9,ch2data}; - -/* char: 0x1 */ - -static const GLubyte ch1data[] = { -0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10, -}; - -static const BitmapCharRec ch1 = {7,7,-1,0,9,ch1data}; - -static const BitmapCharRec * const chars[] = { -&ch0, -&ch1, -&ch2, -&ch3, -&ch4, -&ch5, -&ch6, -&ch7, -&ch8, -&ch9, -&ch10, -&ch11, -&ch12, -&ch13, -&ch14, -&ch15, -&ch16, -&ch17, -&ch18, -&ch19, -&ch20, -&ch21, -&ch22, -&ch23, -&ch24, -&ch25, -&ch26, -&ch27, -&ch28, -&ch29, -&ch30, -&ch31, -&ch32, -&ch33, -&ch34, -&ch35, -&ch36, -&ch37, -&ch38, -&ch39, -&ch40, -&ch41, -&ch42, -&ch43, -&ch44, -&ch45, -&ch46, -&ch47, -&ch48, -&ch49, -&ch50, -&ch51, -&ch52, -&ch53, -&ch54, -&ch55, -&ch56, -&ch57, -&ch58, -&ch59, -&ch60, -&ch61, -&ch62, -&ch63, -&ch64, -&ch65, -&ch66, -&ch67, -&ch68, -&ch69, -&ch70, -&ch71, -&ch72, -&ch73, -&ch74, -&ch75, -&ch76, -&ch77, -&ch78, -&ch79, -&ch80, -&ch81, -&ch82, -&ch83, -&ch84, -&ch85, -&ch86, -&ch87, -&ch88, -&ch89, -&ch90, -&ch91, -&ch92, -&ch93, -&ch94, -&ch95, -&ch96, -&ch97, -&ch98, -&ch99, -&ch100, -&ch101, -&ch102, -&ch103, -&ch104, -&ch105, -&ch106, -&ch107, -&ch108, -&ch109, -&ch110, -&ch111, -&ch112, -&ch113, -&ch114, -&ch115, -&ch116, -&ch117, -&ch118, -&ch119, -&ch120, -&ch121, -&ch122, -&ch123, -&ch124, -&ch125, -&ch126, -&ch127, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -&ch160, -&ch161, -&ch162, -&ch163, -&ch164, -&ch165, -&ch166, -&ch167, -&ch168, -&ch169, -&ch170, -&ch171, -&ch172, -&ch173, -&ch174, -&ch175, -&ch176, -&ch177, -&ch178, -&ch179, -&ch180, -&ch181, -&ch182, -&ch183, -&ch184, -&ch185, -&ch186, -&ch187, -&ch188, -&ch189, -&ch190, -&ch191, -&ch192, -&ch193, -&ch194, -&ch195, -&ch196, -&ch197, -&ch198, -&ch199, -&ch200, -&ch201, -&ch202, -&ch203, -&ch204, -&ch205, -&ch206, -&ch207, -&ch208, -&ch209, -&ch210, -&ch211, -&ch212, -&ch213, -&ch214, -&ch215, -&ch216, -&ch217, -&ch218, -&ch219, -&ch220, -&ch221, -&ch222, -&ch223, -&ch224, -&ch225, -&ch226, -&ch227, -&ch228, -&ch229, -&ch230, -&ch231, -&ch232, -&ch233, -&ch234, -&ch235, -&ch236, -&ch237, -&ch238, -&ch239, -&ch240, -&ch241, -&ch242, -&ch243, -&ch244, -&ch245, -&ch246, -&ch247, -&ch248, -&ch249, -&ch250, -&ch251, -&ch252, -&ch253, -&ch254, -&ch255, -}; -#if !defined(__IBMCPP__) -const -#endif - BitmapFontRec glutBitmap9By15 = { -"-misc-fixed-medium-r-normal--15-140-75-75-C-90-iso8859-1", -256, -0, -chars -}; - diff --git a/src/glut/os2/glut_bitmap.cpp b/src/glut/os2/glut_bitmap.cpp deleted file mode 100644 index 40530b69c1..0000000000 --- a/src/glut/os2/glut_bitmap.cpp +++ /dev/null @@ -1,57 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include "glutint.h" -#include "glutbitmap.h" - -void GLUTAPIENTRY -glutBitmapCharacter(GLUTbitmapFont font, int c) -{ - const BitmapCharRec *ch; - BitmapFontPtr fontinfo; - GLint swapbytes, lsbfirst, rowlength; - GLint skiprows, skippixels, alignment; - -#if defined(_WIN32) - fontinfo = (BitmapFontPtr) __glutFont(font); -#else - fontinfo = (BitmapFontPtr) font; -#endif - - if (c < fontinfo->first || - c >= fontinfo->first + fontinfo->num_chars) - return; - ch = fontinfo->ch[c - fontinfo->first]; - if (ch) { - /* Save current modes. */ - glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes); - glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst); - glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength); - glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows); - glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels); - glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment); - /* Little endian machines (DEC Alpha for example) could - benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE - instead of GL_FALSE, but this would require changing the - generated bitmaps too. */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); - glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glBitmap(ch->width, ch->height, ch->xorig, ch->yorig, - ch->advance, 0, ch->bitmap); - /* Restore saved modes. */ - glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes); - glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst); - glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength); - glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels); - glPixelStorei(GL_UNPACK_ALIGNMENT, alignment); - } -} diff --git a/src/glut/os2/glut_cindex.cpp b/src/glut/os2/glut_cindex.cpp deleted file mode 100644 index fa6d2f12d6..0000000000 --- a/src/glut/os2/glut_cindex.cpp +++ /dev/null @@ -1,258 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include "glutint.h" - -#if defined(__OS2PM__) - #define IsWindowVisible WinIsWindowVisible -#endif - -#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i))) - -/* CENTRY */ -void GLUTAPIENTRY -glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue) -{ - GLUTcolormap *cmap, *newcmap; - XVisualInfo *vis; - XColor color; - int i; - - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { - cmap = __glutCurrentWindow->colormap; - vis = __glutCurrentWindow->vis; - } else { - cmap = __glutCurrentWindow->overlay->colormap; - vis = __glutCurrentWindow->overlay->vis; - if (ndx == __glutCurrentWindow->overlay->transparentPixel) { - __glutWarning( - "glutSetColor: cannot set color of overlay transparent index %d\n", - ndx); - return; - } - } - - if (!cmap) { - __glutWarning("glutSetColor: current window is RGBA"); - return; - } -#if defined(_WIN32) || defined(__OS2PM__) - if (ndx >= 256 || /* always assume 256 colors on Win32 */ -#else - if (ndx >= vis->visual->map_entries || -#endif - ndx < 0) { - __glutWarning("glutSetColor: index %d out of range", ndx); - return; - } - if (cmap->refcnt > 1) { - newcmap = __glutAssociateNewColormap(vis); - cmap->refcnt--; - /* Wouldn't it be nice if XCopyColormapAndFree could be - told not to free the old colormap's entries! */ - for (i = cmap->size - 1; i >= 0; i--) { - if (i == ndx) { - /* We are going to set this cell shortly! */ - continue; - } - if (cmap->cells[i].component[GLUT_RED] >= 0.0) { - color.pixel = i; - newcmap->cells[i].component[GLUT_RED] = - cmap->cells[i].component[GLUT_RED]; - color.red = (GLfloat) 0xffff * - cmap->cells[i].component[GLUT_RED]; - newcmap->cells[i].component[GLUT_GREEN] = - cmap->cells[i].component[GLUT_GREEN]; - color.green = (GLfloat) 0xffff * - cmap->cells[i].component[GLUT_GREEN]; - newcmap->cells[i].component[GLUT_BLUE] = - cmap->cells[i].component[GLUT_BLUE]; - color.blue = (GLfloat) 0xffff * - cmap->cells[i].component[GLUT_BLUE]; - color.flags = DoRed | DoGreen | DoBlue; -#if defined(_WIN32) || defined(__OS2PM__) - if (IsWindowVisible(__glutCurrentWindow->win)) { - XHDC = __glutCurrentWindow->hdc; - } else { - XHDC = 0; - } -#endif - XStoreColor(__glutDisplay, newcmap->cmap, &color); - } else { - /* Leave unallocated entries unallocated. */ - } - } - cmap = newcmap; - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { - __glutCurrentWindow->colormap = cmap; - __glutCurrentWindow->cmap = cmap->cmap; - } else { - __glutCurrentWindow->overlay->colormap = cmap; - __glutCurrentWindow->overlay->cmap = cmap->cmap; - } - XSetWindowColormap(__glutDisplay, - __glutCurrentWindow->renderWin, cmap->cmap); - -#if !defined(_WIN32) && !defined(__OS2PM__) - { - GLUTwindow *toplevel; - - toplevel = __glutToplevelOf(__glutCurrentWindow); - if (toplevel->cmap != cmap->cmap) { - __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); - } - } -#endif - } - color.pixel = ndx; - red = CLAMP(red); - cmap->cells[ndx].component[GLUT_RED] = red; - color.red = (GLfloat) 0xffff *red; - green = CLAMP(green); - cmap->cells[ndx].component[GLUT_GREEN] = green; - color.green = (GLfloat) 0xffff *green; - blue = CLAMP(blue); - cmap->cells[ndx].component[GLUT_BLUE] = blue; - color.blue = (GLfloat) 0xffff *blue; - color.flags = DoRed | DoGreen | DoBlue; -#if defined(_WIN32) || defined(__OS2PM__) - if (IsWindowVisible(__glutCurrentWindow->win)) { - XHDC = __glutCurrentWindow->hdc; - } else { - XHDC = 0; - } -#endif - XStoreColor(__glutDisplay, cmap->cmap, &color); -} - -GLfloat GLUTAPIENTRY -glutGetColor(int ndx, int comp) -{ - GLUTcolormap *colormap; - XVisualInfo *vis; - - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { - colormap = __glutCurrentWindow->colormap; - vis = __glutCurrentWindow->vis; - } else { - colormap = __glutCurrentWindow->overlay->colormap; - vis = __glutCurrentWindow->overlay->vis; - if (ndx == __glutCurrentWindow->overlay->transparentPixel) { - __glutWarning("glutGetColor: requesting overlay transparent index %d\n", - ndx); - return -1.0; - } - } - - if (!colormap) { - __glutWarning("glutGetColor: current window is RGBA"); - return -1.0; - } -#if defined(_WIN32) || defined(__OS2PM__) -#define OUT_OF_RANGE_NDX(ndx) (ndx >= 256 || ndx < 0) -#else -#define OUT_OF_RANGE_NDX(ndx) (ndx >= vis->visual->map_entries || ndx < 0) -#endif - if (OUT_OF_RANGE_NDX(ndx)) { - __glutWarning("glutGetColor: index %d out of range", ndx); - return -1.0; - } - return colormap->cells[ndx].component[comp]; -} - -void GLUTAPIENTRY -glutCopyColormap(int winnum) -{ - GLUTwindow *window = __glutWindowList[winnum - 1]; - GLUTcolormap *oldcmap, *newcmap; - XVisualInfo *dstvis; - - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { - oldcmap = __glutCurrentWindow->colormap; - dstvis = __glutCurrentWindow->vis; - newcmap = window->colormap; - } else { - oldcmap = __glutCurrentWindow->overlay->colormap; - dstvis = __glutCurrentWindow->overlay->vis; - if (!window->overlay) { - __glutWarning("glutCopyColormap: window %d has no overlay", winnum); - return; - } - newcmap = window->overlay->colormap; - } - - if (!oldcmap) { - __glutWarning("glutCopyColormap: destination colormap must be color index"); - return; - } - if (!newcmap) { - __glutWarning( - "glutCopyColormap: source colormap of window %d must be color index", - winnum); - return; - } - if (newcmap == oldcmap) { - /* Source and destination are the same; now copy needed. */ - return; - } -#if !defined(_WIN32) && !defined(__OS2PM__) - /* Play safe: compare visual IDs, not Visual*'s. */ - if (newcmap->visual->visualid == oldcmap->visual->visualid) { -#endif - /* Visuals match! "Copy" by reference... */ - __glutFreeColormap(oldcmap); - newcmap->refcnt++; - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { - __glutCurrentWindow->colormap = newcmap; - __glutCurrentWindow->cmap = newcmap->cmap; - } else { - __glutCurrentWindow->overlay->colormap = newcmap; - __glutCurrentWindow->overlay->cmap = newcmap->cmap; - } - XSetWindowColormap(__glutDisplay, __glutCurrentWindow->renderWin, - newcmap->cmap); -#if !defined(_WIN32) && !defined(__OS2PM__) - __glutPutOnWorkList(__glutToplevelOf(window), GLUT_COLORMAP_WORK); -bla bla bla - - } else { - GLUTcolormap *copycmap; - XColor color; - int i, last; - - /* Visuals different - need a distinct X colormap! */ - copycmap = __glutAssociateNewColormap(dstvis); - /* Wouldn't it be nice if XCopyColormapAndFree could be - told not to free the old colormap's entries! */ - last = newcmap->size; - if (last > copycmap->size) { - last = copycmap->size; - } - for (i = last - 1; i >= 0; i--) { - if (newcmap->cells[i].component[GLUT_RED] >= 0.0) { - color.pixel = i; - copycmap->cells[i].component[GLUT_RED] = - newcmap->cells[i].component[GLUT_RED]; - color.red = (GLfloat) 0xffff * - newcmap->cells[i].component[GLUT_RED]; - copycmap->cells[i].component[GLUT_GREEN] = - newcmap->cells[i].component[GLUT_GREEN]; - color.green = (GLfloat) 0xffff * - newcmap->cells[i].component[GLUT_GREEN]; - copycmap->cells[i].component[GLUT_BLUE] = - newcmap->cells[i].component[GLUT_BLUE]; - color.blue = (GLfloat) 0xffff * - newcmap->cells[i].component[GLUT_BLUE]; - color.flags = DoRed | DoGreen | DoBlue; - XStoreColor(__glutDisplay, copycmap->cmap, &color); - } - } - } -#endif -} -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_cmap.cpp b/src/glut/os2/glut_cmap.cpp deleted file mode 100644 index afe44f0aca..0000000000 --- a/src/glut/os2/glut_cmap.cpp +++ /dev/null @@ -1,399 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1996, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#ifdef __VMS -//EK#include -#endif - -#include -#include -#include /* SunOS multithreaded assert() needs . Lame. */ -#include -#if !defined(_WIN32) && !defined(__OS2__) - #include - #include - #include /* for XA_RGB_DEFAULT_MAP atom */ - #if defined(__vms) - #include /* for XmuLookupStandardColormap */ - #else - #include /* for XmuLookupStandardColormap */ - #endif -#endif - -/* SGI optimization introduced in IRIX 6.3 to avoid X server - round trips for interning common X atoms. */ -#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) -#include -#else -#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) -#endif - -#include "glutint.h" -#include "layerutil.h" - -GLUTcolormap *__glutColormapList = NULL; - -GLUTcolormap * -__glutAssociateNewColormap(XVisualInfo * vis) -{ - GLUTcolormap *cmap; - int transparentPixel, i; - unsigned long pixels[255]; - - cmap = (GLUTcolormap *) malloc(sizeof(GLUTcolormap)); - if (!cmap) - __glutFatalError("out of memory."); -#if defined(_WIN32) || defined(__OS2__) - pixels[0] = 0; /* avoid compilation warnings on win32 */ - cmap->visual = 0; - cmap->size = 256; /* always assume 256 on Win32 */ -#else - cmap->visual = vis->visual; - cmap->size = vis->visual->map_entries; -#endif - cmap->refcnt = 1; - cmap->cells = (GLUTcolorcell *) - malloc(sizeof(GLUTcolorcell) * cmap->size); - if (!cmap->cells) - __glutFatalError("out of memory."); - /* make all color cell entries be invalid */ - for (i = cmap->size - 1; i >= 0; i--) { - cmap->cells[i].component[GLUT_RED] = -1.0; - cmap->cells[i].component[GLUT_GREEN] = -1.0; - cmap->cells[i].component[GLUT_BLUE] = -1.0; - } - transparentPixel = __glutGetTransparentPixel(__glutDisplay, vis); - if (transparentPixel == -1 || transparentPixel >= cmap->size) { - - /* If there is no transparent pixel or if the transparent - pixel is outside the range of valid colormap cells (HP - can implement their overlays this smart way since their - transparent pixel is 255), we can AllocAll the colormap. - See note below. */ - - cmap->cmap = XCreateColormap(__glutDisplay, - __glutRoot, cmap->visual, AllocAll); - } else { - - /* On machines where zero (or some other value in the range - of 0 through map_entries-1), BadAlloc may be generated - when an AllocAll overlay colormap is allocated since the - transparent pixel precludes all the cells in the colormap - being allocated (the transparent pixel is pre-allocated). - So in this case, use XAllocColorCells to allocate - map_entries-1 pixels (that is, all but the transparent - pixel. */ - -#if defined(_WIN32) || defined(__OS2__) - cmap->cmap = XCreateColormap(__glutDisplay, - __glutRoot, 0, AllocNone); -#else - cmap->cmap = XCreateColormap(__glutDisplay, - __glutRoot, vis->visual, AllocNone); - XAllocColorCells(__glutDisplay, cmap->cmap, False, 0, 0, - pixels, cmap->size - 1); -#endif - } - cmap->next = __glutColormapList; - __glutColormapList = cmap; - return cmap; -} - -static GLUTcolormap * -associateColormap(XVisualInfo * vis) -{ -#if !defined(_WIN32) && !defined(__OS2__) - GLUTcolormap *cmap = __glutColormapList; - - while (cmap != NULL) { - /* Play safe: compare visual IDs, not Visual*'s. */ - if (cmap->visual->visualid == vis->visual->visualid) { - /* Already have created colormap for the visual. */ - cmap->refcnt++; - return cmap; - } - cmap = cmap->next; - } -#endif - return __glutAssociateNewColormap(vis); -} - -void -__glutSetupColormap(XVisualInfo * vi, GLUTcolormap ** colormap, Colormap * cmap) -{ -#if defined(_WIN32) || defined(__OS2__) - if (vi->dwFlags & PFD_NEED_PALETTE || vi->iPixelType == PFD_TYPE_COLORINDEX) { - *colormap = associateColormap(vi); - *cmap = (*colormap)->cmap; - } else { - *colormap = NULL; - *cmap = 0; - } -#else - Status status; - XStandardColormap *standardCmaps; - int i, numCmaps; - static Atom hpColorRecoveryAtom = -1; - int isRGB, visualClass, rc; - -#if defined(__cplusplus) || defined(c_plusplus) - visualClass = vi->c_class; -#else - visualClass = vi->class; -#endif - switch (visualClass) { - case PseudoColor: - /* Mesa might return a PseudoColor visual for RGB mode. */ - rc = glXGetConfig(__glutDisplay, vi, GLX_RGBA, &isRGB); - if (rc == 0 && isRGB) { - /* Must be Mesa. */ - *colormap = NULL; - if (MaxCmapsOfScreen(DefaultScreenOfDisplay(__glutDisplay)) == 1 - && vi->visual == DefaultVisual(__glutDisplay, __glutScreen)) { - char *privateCmap = getenv("MESA_PRIVATE_CMAP"); - - if (privateCmap) { - /* User doesn't want to share colormaps. */ - *cmap = XCreateColormap(__glutDisplay, __glutRoot, - vi->visual, AllocNone); - } else { - /* Share the root colormap. */ - *cmap = DefaultColormap(__glutDisplay, __glutScreen); - } - } else { - /* Get our own PseudoColor colormap. */ - *cmap = XCreateColormap(__glutDisplay, __glutRoot, - vi->visual, AllocNone); - } - } else { - /* CI mode, real GLX never returns a PseudoColor visual - for RGB mode. */ - *colormap = associateColormap(vi); - *cmap = (*colormap)->cmap; - } - break; - case TrueColor: - case DirectColor: - *colormap = NULL; /* NULL if RGBA */ - - /* Hewlett-Packard supports a feature called "HP Color - Recovery". Mesa has code to use HP Color Recovery. For - Mesa to use this feature, the atom - _HP_RGB_SMOOTH_MAP_LIST must be defined on the root - window AND the colormap obtainable by XGetRGBColormaps - for that atom must be set on the window. If that - colormap is not set, the output will look stripy. */ - - if (hpColorRecoveryAtom == -1) { - char *xvendor; - -#define VENDOR_HP "Hewlett-Packard" - - /* Only makes sense to make XInternAtom round-trip if we - know that we are connected to an HP X server. */ - xvendor = ServerVendor(__glutDisplay); - if (!strncmp(xvendor, VENDOR_HP, sizeof(VENDOR_HP) - 1)) { - hpColorRecoveryAtom = XInternAtom(__glutDisplay, "_HP_RGB_SMOOTH_MAP_LIST", True); - } else { - hpColorRecoveryAtom = None; - } - } - if (hpColorRecoveryAtom != None) { - status = XGetRGBColormaps(__glutDisplay, __glutRoot, - &standardCmaps, &numCmaps, hpColorRecoveryAtom); - if (status == 1) { - for (i = 0; i < numCmaps; i++) { - if (standardCmaps[i].visualid == vi->visualid) { - *cmap = standardCmaps[i].colormap; - XFree(standardCmaps); - return; - } - } - XFree(standardCmaps); - } - } -#ifndef SOLARIS_2_4_BUG - /* Solaris 2.4 and 2.5 have a bug in their - XmuLookupStandardColormap implementations. Please - compile your Solaris 2.4 or 2.5 version of GLUT with - -DSOLARIS_2_4_BUG to work around this bug. The symptom - of the bug is that programs will get a BadMatch error - from X_CreateWindow when creating a GLUT window because - Solaris 2.4 and 2.5 create a corrupted RGB_DEFAULT_MAP - property. Note that this workaround prevents Colormap - sharing between applications, perhaps leading - unnecessary colormap installations or colormap flashing. - Sun fixed this bug in Solaris 2.6. */ - status = XmuLookupStandardColormap(__glutDisplay, - vi->screen, vi->visualid, vi->depth, XA_RGB_DEFAULT_MAP, - /* replace */ False, /* retain */ True); - if (status == 1) { - status = XGetRGBColormaps(__glutDisplay, __glutRoot, - &standardCmaps, &numCmaps, XA_RGB_DEFAULT_MAP); - if (status == 1) { - for (i = 0; i < numCmaps; i++) { - if (standardCmaps[i].visualid == vi->visualid) { - *cmap = standardCmaps[i].colormap; - XFree(standardCmaps); - return; - } - } - XFree(standardCmaps); - } - } -#endif - /* If no standard colormap but TrueColor, just make a - private one. */ - /* XXX Should do a better job of internal sharing for - privately allocated TrueColor colormaps. */ - /* XXX DirectColor probably needs ramps hand initialized! */ - *cmap = XCreateColormap(__glutDisplay, __glutRoot, - vi->visual, AllocNone); - break; - case StaticColor: - case StaticGray: - case GrayScale: - /* Mesa supports these visuals */ - *colormap = NULL; - *cmap = XCreateColormap(__glutDisplay, __glutRoot, - vi->visual, AllocNone); - break; - default: - __glutFatalError( - "could not allocate colormap for visual type: %d.", - visualClass); - } - return; -#endif -} - -#if !defined(_WIN32) && !defined(__OS2__) -static int -findColormaps(GLUTwindow * window, - Window * winlist, Colormap * cmaplist, int num, int max) -{ - GLUTwindow *child; - int i; - - /* Do not allow more entries that maximum number of - colormaps! */ - if (num >= max) - return num; - /* Is cmap for this window already on the list? */ - for (i = 0; i < num; i++) { - if (cmaplist[i] == window->cmap) - goto normalColormapAlreadyListed; - } - /* Not found on the list; add colormap and window. */ - winlist[num] = window->win; - cmaplist[num] = window->cmap; - num++; - -normalColormapAlreadyListed: - - /* Repeat above but for the overlay colormap if there one. */ - if (window->overlay) { - if (num >= max) - return num; - for (i = 0; i < num; i++) { - if (cmaplist[i] == window->overlay->cmap) - goto overlayColormapAlreadyListed; - } - winlist[num] = window->overlay->win; - cmaplist[num] = window->overlay->cmap; - num++; - } -overlayColormapAlreadyListed: - - /* Recursively search children. */ - child = window->children; - while (child) { - num = findColormaps(child, winlist, cmaplist, num, max); - child = child->siblings; - } - return num; -} - -void -__glutEstablishColormapsProperty(GLUTwindow * window) -{ - /* this routine is strictly X. Win32 doesn't need to do - anything of this sort (but has to do other wacky stuff - later). */ - static Atom wmColormapWindows = None; - Window *winlist; - Colormap *cmaplist; - Status status; - int maxcmaps, num; - - assert(!window->parent); - maxcmaps = MaxCmapsOfScreen(ScreenOfDisplay(__glutDisplay, - __glutScreen)); - /* For portability reasons we don't use alloca for winlist - and cmaplist, but we could. */ - winlist = (Window *) malloc(maxcmaps * sizeof(Window)); - cmaplist = (Colormap *) malloc(maxcmaps * sizeof(Colormap)); - num = findColormaps(window, winlist, cmaplist, 0, maxcmaps); - if (num < 2) { - /* Property no longer needed; remove it. */ - wmColormapWindows = XSGIFastInternAtom(__glutDisplay, - "WM_COLORMAP_WINDOWS", SGI_XA_WM_COLORMAP_WINDOWS, False); - if (wmColormapWindows == None) { - __glutWarning("Could not intern X atom for WM_COLORMAP_WINDOWS."); - return; - } - XDeleteProperty(__glutDisplay, window->win, wmColormapWindows); - } else { - status = XSetWMColormapWindows(__glutDisplay, window->win, - winlist, num); - /* XSetWMColormapWindows should always work unless the - WM_COLORMAP_WINDOWS property cannot be intern'ed. We - check to be safe. */ - if (status == False) - __glutFatalError("XSetWMColormapWindows returned False."); - } - /* For portability reasons we don't use alloca for winlist - and cmaplist, but we could. */ - free(winlist); - free(cmaplist); -} - -GLUTwindow * -__glutToplevelOf(GLUTwindow * window) -{ - while (window->parent) { - window = window->parent; - } - return window; -} -#endif - -void -__glutFreeColormap(GLUTcolormap * cmap) -{ - GLUTcolormap *cur, **prev; - - cmap->refcnt--; - if (cmap->refcnt == 0) { - /* remove from colormap list */ - cur = __glutColormapList; - prev = &__glutColormapList; - while (cur) { - if (cur == cmap) { - *prev = cmap->next; - break; - } - prev = &(cur->next); - cur = cur->next; - } - /* actually free colormap */ - XFreeColormap(__glutDisplay, cmap->cmap); - free(cmap->cells); - free(cmap); - } -} - diff --git a/src/glut/os2/glut_cursor.cpp b/src/glut/os2/glut_cursor.cpp deleted file mode 100644 index 0db0aa64a4..0000000000 --- a/src/glut/os2/glut_cursor.cpp +++ /dev/null @@ -1,210 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1995, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include "glutint.h" - -#if !defined(_WIN32) && !defined(__OS2PM__) -#include /* For XA_CURSOR */ -#include -#endif - -typedef struct _CursorTable { -#if defined(_WIN32) - char* glyph; -#else - int glyph; -#endif - Cursor cursor; -} CursorTable; -/* *INDENT-OFF* */ - -static CursorTable cursorTable[] = { - {XC_arrow, None}, /* GLUT_CURSOR_RIGHT_ARROW */ - {XC_top_left_arrow, None}, /* GLUT_CURSOR_LEFT_ARROW */ - {XC_hand1, None}, /* GLUT_CURSOR_INFO */ - {XC_pirate, None}, /* GLUT_CURSOR_DESTROY */ - {XC_question_arrow, None}, /* GLUT_CURSOR_HELP */ - {XC_exchange, None}, /* GLUT_CURSOR_CYCLE */ - {XC_spraycan, None}, /* GLUT_CURSOR_SPRAY */ - {XC_watch, None}, /* GLUT_CURSOR_WAIT */ - {XC_xterm, None}, /* GLUT_CURSOR_TEXT */ - {XC_crosshair, None}, /* GLUT_CURSOR_CROSSHAIR */ - {XC_sb_v_double_arrow, None}, /* GLUT_CURSOR_UP_DOWN */ - {XC_sb_h_double_arrow, None}, /* GLUT_CURSOR_LEFT_RIGHT */ - {XC_top_side, None}, /* GLUT_CURSOR_TOP_SIDE */ - {XC_bottom_side, None}, /* GLUT_CURSOR_BOTTOM_SIDE */ - {XC_left_side, None}, /* GLUT_CURSOR_LEFT_SIDE */ - {XC_right_side, None}, /* GLUT_CURSOR_RIGHT_SIDE */ - {XC_top_left_corner, None}, /* GLUT_CURSOR_TOP_LEFT_CORNER */ - {XC_top_right_corner, None}, /* GLUT_CURSOR_TOP_RIGHT_CORNER */ - {XC_bottom_right_corner, None}, /* GLUT_CURSOR_BOTTOM_RIGHT_CORNER */ - {XC_bottom_left_corner, None}, /* GLUT_CURSOR_BOTTOM_LEFT_CORNER */ -}; -/* *INDENT-ON* */ - -#if !defined(_WIN32) && !defined(__OS2PM__) -static Cursor blankCursor = None; -static Cursor fullCrosshairCusor = None; - -/* SGI X server's support a special property called the - _SGI_CROSSHAIR_CURSOR that when installed as a window's - cursor, becomes a full screen crosshair cursor. SGI - has special cursor generation hardware for this case. */ -static Cursor -getFullCrosshairCursor(void) -{ - Cursor cursor; - Atom crosshairAtom, actualType; - int rc, actualFormat; - unsigned long n, left; - unsigned long *value; - - if (fullCrosshairCusor == None) { - crosshairAtom = XInternAtom(__glutDisplay, - "_SGI_CROSSHAIR_CURSOR", True); - if (crosshairAtom != None) { - value = 0; /* Make compiler happy. */ - rc = XGetWindowProperty(__glutDisplay, __glutRoot, - crosshairAtom, 0, 1, False, XA_CURSOR, &actualType, - &actualFormat, &n, &left, (unsigned char **) &value); - if (rc == Success && actualFormat == 32 && n >= 1) { - cursor = value[0]; - XFree(value); - return cursor; - } - } - } - return XCreateFontCursor(__glutDisplay, XC_crosshair); -} - -/* X11 forces you to create a blank cursor if you want - to disable the cursor. */ -static Cursor -makeBlankCursor(void) -{ - static char data[1] = - {0}; - Cursor cursor; - Pixmap blank; - XColor dummy; - - blank = XCreateBitmapFromData(__glutDisplay, __glutRoot, - data, 1, 1); - if (blank == None) - __glutFatalError("out of memory."); - cursor = XCreatePixmapCursor(__glutDisplay, blank, blank, - &dummy, &dummy, 0, 0); - XFreePixmap(__glutDisplay, blank); - - return cursor; -} -#endif /* !_WIN32 && !__OS2PM__*/ - -/* Win32 and X11 use this same function to accomplish - fairly different tasks. X11 lets you just define the - cursor for a window and the window system takes care - of making sure that the window's cursor is installed - when the mouse is in the window. Win32 requires the - application to handle a WM_SETCURSOR message to install - the right cursor when windows are entered. Think of - the Win32 __glutSetCursor (called from __glutWindowProc) - as "install cursor". Think of the X11 __glutSetCursor - (called from glutSetCursor) as "define cursor". */ -void -__glutSetCursor(GLUTwindow *window) -{ - int cursor = window->cursor; - Cursor xcursor = 0; - - if (cursor >= 0 && - cursor < sizeof(cursorTable) / sizeof(cursorTable[0])) { - if (cursorTable[cursor].cursor == None) { - cursorTable[cursor].cursor = XCreateFontCursor(__glutDisplay, - cursorTable[cursor].glyph); - } - xcursor = cursorTable[cursor].cursor; - } else { - /* Special cases. */ - switch (cursor) { - case GLUT_CURSOR_INHERIT: -#if defined(_WIN32) - while (window->parent) { - window = window->parent; - if (window->cursor != GLUT_CURSOR_INHERIT) { - __glutSetCursor(window); - return; - } - } - /* XXX Default to an arrow cursor. Is this - right or should we be letting the default - window proc be installing some system cursor? */ - xcursor = cursorTable[0].cursor; - if (xcursor == NULL) { - xcursor = - cursorTable[0].cursor = - LoadCursor(NULL, cursorTable[0].glyph); - } - -#elif defined(__OS2PM__) -//todo - xcursor = None; - -#else - xcursor = None; -#endif - break; - case GLUT_CURSOR_NONE: -#if defined(_WIN32) || defined(__OS2PM__) - xcursor = NULL; -#else - if (blankCursor == None) { - blankCursor = makeBlankCursor(); - } - xcursor = blankCursor; -#endif - break; - case GLUT_CURSOR_FULL_CROSSHAIR: -#if defined(_WIN32) - xcursor = (HICON) IDC_CROSS; -#elif defined(__OS2PM__) -//todo -#else - if (fullCrosshairCusor == None) { - fullCrosshairCusor = getFullCrosshairCursor(); - } - xcursor = fullCrosshairCusor; -#endif - break; - } - } - XDefineCursor(__glutDisplay, - window->win, xcursor); - XFlush(__glutDisplay); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutSetCursor(int cursor) -{ -#ifdef _WIN32 - POINT point; - - __glutCurrentWindow->cursor = cursor; - /* Are we in the window right now? If so, - install the cursor. */ - GetCursorPos(&point); - if (__glutCurrentWindow->win == WindowFromPoint(point)) { - __glutSetCursor(__glutCurrentWindow); - } -#elif defined(__OS2PM__) -//todo -#else - __glutCurrentWindow->cursor = cursor; - __glutSetCursor(__glutCurrentWindow); -#endif -} -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_event.cpp b/src/glut/os2/glut_event.cpp deleted file mode 100644 index 4ece82e52b..0000000000 --- a/src/glut/os2/glut_event.cpp +++ /dev/null @@ -1,1399 +0,0 @@ -/* glut_event.c */ -/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1997, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#ifdef __VMS -#include -#endif - -#include -#include -#include -#include -#include /* Some FD_ZERO macros use memset without - prototyping memset. */ - -/* Much of the following #ifdef logic to include the proper - prototypes for the select system call is based on logic - from the X11R6.3 version of . */ - -#if !defined(_WIN32) -# ifdef __sgi -# include /* prototype for bzero used by FD_ZERO */ -# endif -# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) -# include /* select system call interface */ -# ifdef luna -# include -# endif -# endif - /* AIX 4.2 fubar-ed , so go to heroic measures to get it */ -# if defined(AIXV4) && !defined(NFDBITS) -# include -# endif -#endif /* !_WIN32 */ - -#include - -#if defined(__OS2__) -//??? ­ ä¨£  ?? # include -#elif !defined(_WIN32) -# if defined(__vms) && ( __VMS_VER < 70000000 ) -# include -# else -# ifndef __vms -# include -# endif -# endif -# include -# include -# include -#else -# ifdef __CYGWIN32__ -# include -# else -# include -# endif -# ifdef __hpux - /* XXX Bert Gijsbers reports that HP-UX - needs different keysyms for the End, Insert, and Delete keys - to work on an HP 715. It would be better if HP generated - standard keysyms for standard keys. */ -# include -# endif -#endif /* !_WIN32 */ - -#include "glutint.h" - -#if defined(__vms) && ( __VMS_VER < 70000000 ) -#include -#include -extern int SYS$CLREF(int efn); -extern int SYS$SETIMR(unsigned int efn, struct timeval6 *timeout, void *ast, - unsigned int request_id, unsigned int flags); -extern int SYS$WFLOR(unsigned int efn, unsigned int mask); -extern int SYS$CANTIM(unsigned int request_id, unsigned int mode); -#endif /* __vms, VMs 6.2 or earlier */ - -static GLUTtimer *freeTimerList = NULL; - -GLUTidleCB __glutIdleFunc = NULL; -GLUTtimer *__glutTimerList = NULL; -#ifdef SUPPORT_FORTRAN -GLUTtimer *__glutNewTimer; -#endif -GLUTwindow *__glutWindowWorkList = NULL; -GLUTmenu *__glutMappedMenu; -GLUTmenu *__glutCurrentMenu = NULL; - -void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *); -#if !defined(_WIN32) && !defined(__OS2__) -void (*__glutMenuItemEnterOrLeave)(GLUTmenuItem * item, int num, int type) = NULL; -void (*__glutFinishMenu)(Window win, int x, int y); -void (*__glutPaintMenu)(GLUTmenu * menu); -void (*__glutStartMenu)(GLUTmenu * menu, GLUTwindow * window, int x, int y, int x_win, int y_win); -GLUTmenu * (*__glutGetMenuByNum)(int menunum); -GLUTmenuItem * (*__glutGetMenuItem)(GLUTmenu * menu, Window win, int *which); -GLUTmenu * (*__glutGetMenu)(Window win); -#endif - -Atom __glutMotifHints = None; -/* Modifier mask of ~0 implies not in core input callback. */ -unsigned int __glutModifierMask = (unsigned int) ~0; -int __glutWindowDamaged = 0; - -void GLUTAPIENTRY -glutIdleFunc(GLUTidleCB idleFunc) -{ - __glutIdleFunc = idleFunc; -} - -void GLUTAPIENTRY -glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value) -{ - GLUTtimer *timer, *other; - GLUTtimer **prevptr; -#ifdef OLD_VMS - struct timeval6 now; -#else - struct timeval now; -#endif - - if (!timerFunc) - return; - - if (freeTimerList) { - timer = freeTimerList; - freeTimerList = timer->next; - } else { - timer = (GLUTtimer *) malloc(sizeof(GLUTtimer)); - if (!timer) - __glutFatalError("out of memory."); - } - - timer->func = timerFunc; -#if defined(__vms) && ( __VMS_VER < 70000000 ) - /* VMS time is expressed in units of 100 ns */ - timer->timeout.val = interval * TICKS_PER_MILLISECOND; -#else - timer->timeout.tv_sec = (int) interval / 1000; - timer->timeout.tv_usec = (int) (interval % 1000) * 1000; -#endif - timer->value = value; - timer->next = NULL; - GETTIMEOFDAY(&now); - ADD_TIME(timer->timeout, timer->timeout, now); - prevptr = &__glutTimerList; - other = *prevptr; - while (other && IS_AFTER(other->timeout, timer->timeout)) { - prevptr = &other->next; - other = *prevptr; - } - timer->next = other; -#ifdef SUPPORT_FORTRAN - __glutNewTimer = timer; /* for Fortran binding! */ -#endif - *prevptr = timer; -} - -void -handleTimeouts(void) -{ -#ifdef OLD_VMS - struct timeval6 now; -#else - struct timeval now; -#endif - GLUTtimer *timer; - - /* Assumption is that __glutTimerList is already determined - to be non-NULL. */ - GETTIMEOFDAY(&now); - while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) { - timer = __glutTimerList; - timer->func(timer->value); - __glutTimerList = timer->next; - timer->next = freeTimerList; - freeTimerList = timer; - if (!__glutTimerList) - break; - } -} - -void -__glutPutOnWorkList(GLUTwindow * window, int workMask) -{ - if (window->workMask) { - /* Already on list; just OR in new workMask. */ - window->workMask |= workMask; - } else { - /* Update work mask and add to window work list. */ - window->workMask = workMask; - /* Assert that if the window does not have a - workMask already, the window should definitely - not be the head of the work list. */ - assert(window != __glutWindowWorkList); - window->prevWorkWin = __glutWindowWorkList; - __glutWindowWorkList = window; - } -} - -void -__glutPostRedisplay(GLUTwindow * window, int layerMask) -{ - int shown = (layerMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) ? - window->shownState : window->overlay->shownState; - - /* Post a redisplay if the window is visible (or the - visibility of the window is unknown, ie. window->visState - == -1) _and_ the layer is known to be shown. */ - if (window->visState != GLUT_HIDDEN - && window->visState != GLUT_FULLY_COVERED && shown) { - __glutPutOnWorkList(window, layerMask); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutPostRedisplay(void) -{ - __glutPostRedisplay(__glutCurrentWindow, GLUT_REDISPLAY_WORK); -} - -/* The advantage of this routine is that it saves the cost of a - glutSetWindow call (entailing an expensive OpenGL context switch), - particularly useful when multiple windows need redisplays posted at - the same times. See also glutPostWindowOverlayRedisplay. */ -void GLUTAPIENTRY -glutPostWindowRedisplay(int win) -{ - __glutPostRedisplay(__glutWindowList[win - 1], GLUT_REDISPLAY_WORK); -} - -/* ENDCENTRY */ -static GLUTeventParser *eventParserList = NULL; - -/* __glutRegisterEventParser allows another module to register - to intercept X events types not otherwise acted on by the - GLUT processEventsAndTimeouts routine. The X Input - extension support code uses an event parser for handling X - Input extension events. */ - -void -__glutRegisterEventParser(GLUTeventParser * parser) -{ - parser->next = eventParserList; - eventParserList = parser; -} - -static void -markWindowHidden(GLUTwindow * window) -{ - if (GLUT_HIDDEN != window->visState) { - GLUTwindow *child; - - if (window->windowStatus) { - window->visState = GLUT_HIDDEN; - __glutSetWindow(window); - window->windowStatus(GLUT_HIDDEN); - } - /* An unmap is only reported on a single window; its - descendents need to know they are no longer visible. */ - child = window->children; - while (child) { - markWindowHidden(child); - child = child->siblings; - } - } -} - -#if !defined(_WIN32) && !defined(__OS2__) - -static void -purgeStaleWindow(Window win) -{ - GLUTstale **pEntry = &__glutStaleWindowList; - GLUTstale *entry = __glutStaleWindowList; - - /* Tranverse singly-linked stale window list look for the - window ID. */ - while (entry) { - if (entry->win == win) { - /* Found it; delete it. */ - *pEntry = entry->next; - free(entry); - return; - } else { - pEntry = &entry->next; - entry = *pEntry; - } - } -} - -/* Unlike XNextEvent, if a signal arrives, - interruptibleXNextEvent will return (with a zero return - value). This helps GLUT drop out of XNextEvent if a signal - is delivered. The intent is so that a GLUT program can call - glutIdleFunc in a signal handler to register an idle func - and then immediately get dropped into the idle func (after - returning from the signal handler). The idea is to make - GLUT's main loop reliably interruptible by signals. */ -static int -interruptibleXNextEvent(Display * dpy, XEvent * event) -{ - fd_set fds; - int rc; - - /* Flush X protocol since XPending does not do this - implicitly. */ - XFlush(__glutDisplay); - for (;;) { - if (XPending(__glutDisplay)) { - XNextEvent(dpy, event); - return 1; - } -#ifndef VMS - /* the combination ConectionNumber-select is buggy on VMS. Sometimes it - * fails. This part of the code hangs the program on VMS7.2. But even - * without it the program seems to run correctly. - * Note that this is a bug in the VMS/DECWindows run-time-libraries. - * Compaq engeneering does not want or is not able to make a fix. - * (last sentence is a quotation from Compaq when I reported the - * problem January 2000) */ - FD_ZERO(&fds); - FD_SET(__glutConnectionFD, &fds); - rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, NULL); - if (rc < 0) { - if (errno == EINTR) { - return 0; - } else { - __glutFatalError("select error."); - } - } -#endif - } -} - -#endif - -static void -processEventsAndTimeouts(void) -{ - do { -#if defined(__OS2__) - QMSG qmsg; /* message from message queue */ - extern HAB hab; /* PM anchor block handle */ - - if(! WinGetMsg( hab, &qmsg, 0UL, 0UL, 0UL ) ) - exit(0); - WinDispatchMsg( hab, /* PM anchor block handle */ - &qmsg ); /* pointer to message */ - -#elif defined(_WIN32) - MSG event; - - if(!GetMessage(&event, NULL, 0, 0)) /* bail if no more messages */ - exit(0); - TranslateMessage(&event); /* translate virtual-key messages */ - DispatchMessage(&event); /* call the window proc */ - /* see win32_event.c for event (message) processing procedures */ -#else - static int mappedMenuButton; - GLUTeventParser *parser; - XEvent event, ahead; - GLUTwindow *window; - GLUTkeyboardCB keyboard; - GLUTspecialCB special; - int gotEvent, width, height; - - gotEvent = interruptibleXNextEvent(__glutDisplay, &event); - if (gotEvent) { - switch (event.type) { - case MappingNotify: - XRefreshKeyboardMapping((XMappingEvent *) & event); - break; - case ConfigureNotify: - window = __glutGetWindow(event.xconfigure.window); - if (window) { - if (window->win != event.xconfigure.window) { - /* Ignore ConfigureNotify sent to the overlay - planes. GLUT could get here because overlays - select for StructureNotify events to receive - DestroyNotify. */ - break; - } - width = event.xconfigure.width; - height = event.xconfigure.height; - if (width != window->width || height != window->height) { - if (window->overlay) { - XResizeWindow(__glutDisplay, window->overlay->win, width, height); - } - window->width = width; - window->height = height; - __glutSetWindow(window); - /* Do not execute OpenGL out of sequence with - respect to the XResizeWindow request! */ - glXWaitX(); - window->reshape(width, height); - window->forceReshape = False; - /* A reshape should be considered like posting a - repair; this is necessary for the "Mesa - glXSwapBuffers to repair damage" hack to operate - correctly. Without it, there's not an initial - back buffer render from which to blit from when - damage happens to the window. */ - __glutPostRedisplay(window, GLUT_REPAIR_WORK); - } - } - break; - case Expose: - /* compress expose events */ - while (XEventsQueued(__glutDisplay, QueuedAfterReading) - > 0) { - XPeekEvent(__glutDisplay, &ahead); - if (ahead.type != Expose || - ahead.xexpose.window != event.xexpose.window) { - break; - } - XNextEvent(__glutDisplay, &event); - } - if (event.xexpose.count == 0) { - GLUTmenu *menu; - - if (__glutMappedMenu && - (menu = __glutGetMenu(event.xexpose.window))) { - __glutPaintMenu(menu); - } else { - window = __glutGetWindow(event.xexpose.window); - if (window) { - if (window->win == event.xexpose.window) { - __glutPostRedisplay(window, GLUT_REPAIR_WORK); - } else if (window->overlay && window->overlay->win == event.xexpose.window) { - __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK); - } - } - } - } else { - /* there are more exposes to read; wait to redisplay */ - } - break; - case ButtonPress: - case ButtonRelease: - if (__glutMappedMenu && event.type == ButtonRelease - && mappedMenuButton == event.xbutton.button) { - /* Menu is currently popped up and its button is - released. */ - __glutFinishMenu(event.xbutton.window, event.xbutton.x, event.xbutton.y); - } else { - window = __glutGetWindow(event.xbutton.window); - if (window) { - GLUTmenu *menu; - int menuNum; - - menuNum = window->menu[event.xbutton.button - 1]; - /* Make sure that __glutGetMenuByNum is only called if there - really is a menu present. */ - if ((menuNum > 0) && (menu = __glutGetMenuByNum(menuNum))) { - if (event.type == ButtonPress && !__glutMappedMenu) { - __glutStartMenu(menu, window, - event.xbutton.x_root, event.xbutton.y_root, - event.xbutton.x, event.xbutton.y); - mappedMenuButton = event.xbutton.button; - } else { - /* Ignore a release of a button with a menu - attatched to it when no menu is popped up, - or ignore a press when another menu is - already popped up. */ - } - } else if (window->mouse) { - __glutSetWindow(window); - __glutModifierMask = event.xbutton.state; - window->mouse(event.xbutton.button - 1, - event.type == ButtonRelease ? - GLUT_UP : GLUT_DOWN, - event.xbutton.x, event.xbutton.y); - __glutModifierMask = ~0; - } else { - /* Stray mouse events. Ignore. */ - } - } else { - /* Window might have been destroyed and all the - events for the window may not yet be received. */ - } - } - break; - case MotionNotify: - if (!__glutMappedMenu) { - window = __glutGetWindow(event.xmotion.window); - if (window) { - /* If motion function registered _and_ buttons held - * down, call motion function... */ - if (window->motion && event.xmotion.state & - (Button1Mask | Button2Mask | Button3Mask)) { - __glutSetWindow(window); - window->motion(event.xmotion.x, event.xmotion.y); - } - /* If passive motion function registered _and_ - buttons not held down, call passive motion - function... */ - else if (window->passive && - ((event.xmotion.state & - (Button1Mask | Button2Mask | Button3Mask)) == - 0)) { - __glutSetWindow(window); - window->passive(event.xmotion.x, - event.xmotion.y); - } - } - } else { - /* Motion events are thrown away when a pop up menu - is active. */ - } - break; - case KeyPress: - case KeyRelease: - window = __glutGetWindow(event.xkey.window); - if (!window) { - break; - } - if (event.type == KeyPress) { - keyboard = window->keyboard; - } else { - - /* If we are ignoring auto repeated keys for this window, - check if the next event in the X event queue is a KeyPress - for the exact same key (and at the exact same time) as the - key being released. The X11 protocol will send auto - repeated keys as such KeyRelease/KeyPress pairs. */ - - if (window->ignoreKeyRepeat) { - if (XEventsQueued(__glutDisplay, QueuedAfterReading)) { - XPeekEvent(__glutDisplay, &ahead); - if (ahead.type == KeyPress - && ahead.xkey.window == event.xkey.window - && ahead.xkey.keycode == event.xkey.keycode - && ahead.xkey.time == event.xkey.time) { - /* Pop off the repeated KeyPress and ignore - the auto repeated KeyRelease/KeyPress pair. */ - XNextEvent(__glutDisplay, &event); - break; - } - } - } - keyboard = window->keyboardUp; - } - if (keyboard) { - char tmp[1]; - int rc; - - rc = XLookupString(&event.xkey, tmp, sizeof(tmp), - NULL, NULL); - if (rc) { - __glutSetWindow(window); - __glutModifierMask = event.xkey.state; - keyboard(tmp[0], - event.xkey.x, event.xkey.y); - __glutModifierMask = ~0; - break; - } - } - if (event.type == KeyPress) { - special = window->special; - } else { - special = window->specialUp; - } - if (special) { - KeySym ks; - int key; - -/* Introduced in X11R6: (Partial list of) Keypad Functions. Define - in place in case compiling against an older pre-X11R6 - X11/keysymdef.h file. */ -#ifndef XK_KP_Home -#define XK_KP_Home 0xFF95 -#endif -#ifndef XK_KP_Left -#define XK_KP_Left 0xFF96 -#endif -#ifndef XK_KP_Up -#define XK_KP_Up 0xFF97 -#endif -#ifndef XK_KP_Right -#define XK_KP_Right 0xFF98 -#endif -#ifndef XK_KP_Down -#define XK_KP_Down 0xFF99 -#endif -#ifndef XK_KP_Prior -#define XK_KP_Prior 0xFF9A -#endif -#ifndef XK_KP_Next -#define XK_KP_Next 0xFF9B -#endif -#ifndef XK_KP_End -#define XK_KP_End 0xFF9C -#endif -#ifndef XK_KP_Insert -#define XK_KP_Insert 0xFF9E -#endif -#ifndef XK_KP_Delete -#define XK_KP_Delete 0xFF9F -#endif - - ks = XLookupKeysym((XKeyEvent *) & event, 0); - /* XXX Verbose, but makes no assumptions about keysym - layout. */ - switch (ks) { -/* *INDENT-OFF* */ - /* function keys */ - case XK_F1: key = GLUT_KEY_F1; break; - case XK_F2: key = GLUT_KEY_F2; break; - case XK_F3: key = GLUT_KEY_F3; break; - case XK_F4: key = GLUT_KEY_F4; break; - case XK_F5: key = GLUT_KEY_F5; break; - case XK_F6: key = GLUT_KEY_F6; break; - case XK_F7: key = GLUT_KEY_F7; break; - case XK_F8: key = GLUT_KEY_F8; break; - case XK_F9: key = GLUT_KEY_F9; break; - case XK_F10: key = GLUT_KEY_F10; break; - case XK_F11: key = GLUT_KEY_F11; break; - case XK_F12: key = GLUT_KEY_F12; break; - /* directional keys */ - case XK_KP_Left: - case XK_Left: key = GLUT_KEY_LEFT; break; - case XK_KP_Up: /* Introduced in X11R6. */ - case XK_Up: key = GLUT_KEY_UP; break; - case XK_KP_Right: /* Introduced in X11R6. */ - case XK_Right: key = GLUT_KEY_RIGHT; break; - case XK_KP_Down: /* Introduced in X11R6. */ - case XK_Down: key = GLUT_KEY_DOWN; break; -/* *INDENT-ON* */ - - case XK_KP_Prior: /* Introduced in X11R6. */ - case XK_Prior: - /* XK_Prior same as X11R6's XK_Page_Up */ - key = GLUT_KEY_PAGE_UP; - break; - case XK_KP_Next: /* Introduced in X11R6. */ - case XK_Next: - /* XK_Next same as X11R6's XK_Page_Down */ - key = GLUT_KEY_PAGE_DOWN; - break; - case XK_KP_Home: /* Introduced in X11R6. */ - case XK_Home: - key = GLUT_KEY_HOME; - break; -#ifdef __hpux - case XK_Select: -#endif - case XK_KP_End: /* Introduced in X11R6. */ - case XK_End: - key = GLUT_KEY_END; - break; -#ifdef __hpux - case XK_InsertChar: -#endif - case XK_KP_Insert: /* Introduced in X11R6. */ - case XK_Insert: - key = GLUT_KEY_INSERT; - break; -#ifdef __hpux - case XK_DeleteChar: -#endif - case XK_KP_Delete: /* Introduced in X11R6. */ - /* The Delete character is really an ASCII key. */ - __glutSetWindow(window); - keyboard(127, /* ASCII Delete character. */ - event.xkey.x, event.xkey.y); - goto skip; - default: - goto skip; - } - __glutSetWindow(window); - __glutModifierMask = event.xkey.state; - special(key, event.xkey.x, event.xkey.y); - __glutModifierMask = ~0; - skip:; - } - break; - case EnterNotify: - case LeaveNotify: - if (event.xcrossing.mode != NotifyNormal || - event.xcrossing.detail == NotifyNonlinearVirtual || - event.xcrossing.detail == NotifyVirtual) { - - /* Careful to ignore Enter/LeaveNotify events that - come from the pop-up menu pointer grab and ungrab. - Also, ignore "virtual" Enter/LeaveNotify events - since they represent the pointer passing through - the window hierarchy without actually entering or - leaving the actual real estate of a window. */ - - break; - } - if (__glutMappedMenu) { - GLUTmenuItem *item; - int num; - - item = __glutGetMenuItem(__glutMappedMenu, - event.xcrossing.window, &num); - if (item) { - __glutMenuItemEnterOrLeave(item, num, event.type); - break; - } - } - window = __glutGetWindow(event.xcrossing.window); - if (window) { - if (window->entry) { - if (event.type == EnterNotify) { - - /* With overlays established, X can report two - enter events for both the overlay and normal - plane window. Do not generate a second enter - callback if we reported one without an - intervening leave. */ - - if (window->entryState != EnterNotify) { - int num = window->num; - Window xid = window->win; - - window->entryState = EnterNotify; - __glutSetWindow(window); - window->entry(GLUT_ENTERED); - - if (__glutMappedMenu) { - - /* Do not generate any passive motion events - when menus are in use. */ - - } else { - - /* An EnterNotify event can result in a - "compound" callback if a passive motion - callback is also registered. In this case, - be a little paranoid about the possibility - the window could have been destroyed in the - entry callback. */ - - window = __glutWindowList[num]; - if (window && window->passive && window->win == xid) { - __glutSetWindow(window); - window->passive(event.xcrossing.x, event.xcrossing.y); - } - } - } - } else { - if (window->entryState != LeaveNotify) { - - /* When an overlay is established for a window - already mapped and with the pointer in it, - the X server will generate a leave/enter - event pair as the pointer leaves (without - moving) from the normal plane X window to - the newly mapped overlay X window (or vice - versa). This enter/leave pair should not be - reported to the GLUT program since the pair - is a consequence of creating (or destroying) - the overlay, not an actual leave from the - GLUT window. */ - - if (XEventsQueued(__glutDisplay, QueuedAfterReading)) { - XPeekEvent(__glutDisplay, &ahead); - if (ahead.type == EnterNotify && - __glutGetWindow(ahead.xcrossing.window) == window) { - XNextEvent(__glutDisplay, &event); - break; - } - } - window->entryState = LeaveNotify; - __glutSetWindow(window); - window->entry(GLUT_LEFT); - } - } - } else if (window->passive) { - __glutSetWindow(window); - window->passive(event.xcrossing.x, event.xcrossing.y); - } - } - break; - case UnmapNotify: - /* MapNotify events are not needed to maintain - visibility state since VisibilityNotify events will - be delivered when a window becomes visible from - mapping. However, VisibilityNotify events are not - delivered when a window is unmapped (for the window - or its children). */ - window = __glutGetWindow(event.xunmap.window); - if (window) { - if (window->win != event.xconfigure.window) { - /* Ignore UnmapNotify sent to the overlay planes. - GLUT could get here because overlays select for - StructureNotify events to receive DestroyNotify. - */ - break; - } - markWindowHidden(window); - } - break; - case VisibilityNotify: - window = __glutGetWindow(event.xvisibility.window); - if (window) { - /* VisibilityUnobscured+1 = GLUT_FULLY_RETAINED, - VisibilityPartiallyObscured+1 = - GLUT_PARTIALLY_RETAINED, VisibilityFullyObscured+1 - = GLUT_FULLY_COVERED. */ - int visState = event.xvisibility.state + 1; - - if (visState != window->visState) { - if (window->windowStatus) { - window->visState = visState; - __glutSetWindow(window); - window->windowStatus(visState); - } - } - } - break; - case ClientMessage: - if (event.xclient.data.l[0] == __glutWMDeleteWindow) - exit(0); - break; - case DestroyNotify: - purgeStaleWindow(event.xdestroywindow.window); - break; - case CirculateNotify: - case CreateNotify: - case GravityNotify: - case ReparentNotify: - /* Uninteresting to GLUT (but possible for GLUT to - receive). */ - break; - default: - /* Pass events not directly handled by the GLUT main - event loop to any event parsers that have been - registered. In this way, X Input extension events - are passed to the correct handler without forcing - all GLUT programs to support X Input event handling. - */ - parser = eventParserList; - while (parser) { - if (parser->func(&event)) - break; - parser = parser->next; - } - break; - } - } -#endif /* _WIN32 */ - if (__glutTimerList) { - handleTimeouts(); - } - } - while (XPending(__glutDisplay)); -} - -static void -waitForSomething(void) -{ -#if defined(__vms) && ( __VMS_VER < 70000000 ) - static struct timeval6 zerotime = - {0}; - unsigned int timer_efn; -#define timer_id 'glut' /* random :-) number */ - unsigned int wait_mask; -#else - static struct timeval zerotime = - {0, 0}; -#if defined(__OS2__) - -#elif !defined(_WIN32) - fd_set fds; -#endif -#endif -#ifdef OLD_VMS - struct timeval6 now, timeout, waittime; -#else - struct timeval now, timeout, waittime; -#endif -#if !defined(_WIN32) - int rc; -#endif - - /* Flush X protocol since XPending does not do this - implicitly. */ - XFlush(__glutDisplay); - if (XPending(__glutDisplay)) { - /* It is possible (but quite rare) that XFlush may have - needed to wait for a writable X connection file - descriptor, and in the process, may have had to read off - X protocol from the file descriptor. If XPending is true, - this case occured and we should avoid waiting in select - since X protocol buffered within Xlib is due to be - processed and potentially no more X protocol is on the - file descriptor, so we would risk waiting improperly in - select. */ - goto immediatelyHandleXinput; - } -#if defined(__vms) && ( __VMS_VER < 70000000 ) - timeout = __glutTimerList->timeout; - GETTIMEOFDAY(&now); - wait_mask = 1 << (__glutConnectionFD & 31); - if (IS_AFTER(now, timeout)) { - /* We need an event flag for the timer. */ - /* XXX The `right' way to do this is to use LIB$GET_EF, but - since it needs to be in the same cluster as the EFN for - the display, we will have hack it. */ - timer_efn = __glutConnectionFD - 1; - if ((timer_efn / 32) != (__glutConnectionFD / 32)) { - timer_efn = __glutConnectionFD + 1; - } - rc = SYS$CLREF(timer_efn); - rc = SYS$SETIMR(timer_efn, &timeout, NULL, timer_id, 0); - wait_mask |= 1 << (timer_efn & 31); - } else { - timer_efn = 0; - } - rc = SYS$WFLOR(__glutConnectionFD, wait_mask); - if (timer_efn != 0 && SYS$CLREF(timer_efn) == SS$_WASCLR) { - rc = SYS$CANTIM(timer_id, PSL$C_USER); - } - /* XXX There does not seem to be checking of "rc" in the code - above. Can any of the SYS$ routines above fail? */ -#else /* not vms6.2 or lower */ -#if defined(__OS2__) - -#elif !defined(_WIN32) - FD_ZERO(&fds); - FD_SET(__glutConnectionFD, &fds); -#endif - timeout = __glutTimerList->timeout; - GETTIMEOFDAY(&now); - if (IS_AFTER(now, timeout)) { - TIMEDELTA(waittime, timeout, now); - } else { - waittime = zerotime; - } - -#if defined(__OS2__) - DosSleep(0); -#elif !defined(_WIN32) - rc = select(__glutConnectionFD + 1, &fds, - NULL, NULL, &waittime); - if (rc < 0 && errno != EINTR) - __glutFatalError("select error."); -#else - - MsgWaitForMultipleObjects(0, NULL, FALSE, - waittime.tv_sec*1000 + waittime.tv_usec/1000, QS_ALLINPUT); - -#endif -#endif /* not vms6.2 or lower */ - /* Without considering the cause of select unblocking, check - for pending X events and handle any timeouts (by calling - processEventsAndTimeouts). We always look for X events - even if select returned with 0 (indicating a timeout); - otherwise we risk starving X event processing by continous - timeouts. */ - if (XPending(__glutDisplay)) { - immediatelyHandleXinput: - processEventsAndTimeouts(); - } else { - if (__glutTimerList) - handleTimeouts(); - } -} - -static void -idleWait(void) -{ - if (XPending(__glutDisplay)) { - processEventsAndTimeouts(); - } else { - if (__glutTimerList) { - handleTimeouts(); - } - } - /* Make sure idle func still exists! */ - if (__glutIdleFunc) { - __glutIdleFunc(); - } -} - -static GLUTwindow **beforeEnd; - -static GLUTwindow * -processWindowWorkList(GLUTwindow * window) -{ - int workMask; - - if (window->prevWorkWin) { - window->prevWorkWin = processWindowWorkList(window->prevWorkWin); - } else { - beforeEnd = &window->prevWorkWin; - } - - /* Capture work mask for work that needs to be done to this - window, then clear the window's work mask (excepting the - dummy work bit, see below). Then, process the captured - work mask. This allows callbacks in the processing the - captured work mask to set the window's work mask for - subsequent processing. */ - - workMask = window->workMask; - assert((workMask & GLUT_DUMMY_WORK) == 0); - - /* Set the dummy work bit, clearing all other bits, to - indicate that the window is currently on the window work - list _and_ that the window's work mask is currently being - processed. This convinces __glutPutOnWorkList that this - window is on the work list still. */ - window->workMask = GLUT_DUMMY_WORK; - - /* Optimization: most of the time, the work to do is a - redisplay and not these other types of work. Check for - the following cases as a group to before checking each one - individually one by one. This saves about 25 MIPS - instructions in the common redisplay only case. */ - if (workMask & (GLUT_EVENT_MASK_WORK | GLUT_DEVICE_MASK_WORK | - GLUT_CONFIGURE_WORK | GLUT_COLORMAP_WORK | GLUT_MAP_WORK)) { - -#if !defined(_WIN32) && !defined(__OS2__) - /* Be sure to set event mask BEFORE map window is done. */ - if (workMask & GLUT_EVENT_MASK_WORK) { - long eventMask; - - /* Make sure children are not propogating events this - window is selecting for. Be sure to do this before - enabling events on the children's parent. */ - if (window->children) { - GLUTwindow *child = window->children; - unsigned long attribMask = CWDontPropagate; - XSetWindowAttributes wa; - - wa.do_not_propagate_mask = window->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK; - if (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) { - wa.event_mask = child->eventMask | (window->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK); - attribMask |= CWEventMask; - } - do { - XChangeWindowAttributes(__glutDisplay, child->win, - attribMask, &wa); - child = child->siblings; - } while (child); - } - eventMask = window->eventMask; - if (window->parent && window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) - eventMask |= (window->parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK); - XSelectInput(__glutDisplay, window->win, eventMask); - if (window->overlay) - XSelectInput(__glutDisplay, window->overlay->win, - window->eventMask & GLUT_OVERLAY_EVENT_FILTER_MASK); - } -#endif /* !_WIN32 */ - /* Be sure to set device mask BEFORE map window is done. */ - if (workMask & GLUT_DEVICE_MASK_WORK) { - __glutUpdateInputDeviceMaskFunc(window); - } - /* Be sure to configure window BEFORE map window is done. */ - if (workMask & GLUT_CONFIGURE_WORK) { -#if defined(__OS2__) - RECTL changes; - -#elif defined(_WIN32) - RECT changes; - POINT point; - UINT flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER - | SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER; - - GetClientRect(window->win, &changes); - - /* If this window is a toplevel window, translate the 0,0 client - coordinate into a screen coordinate for proper placement. */ - if (!window->parent) { - point.x = 0; - point.y = 0; - ClientToScreen(window->win, &point); - changes.left = point.x; - changes.top = point.y; - } - if (window->desiredConfMask & (CWX | CWY)) { - changes.left = window->desiredX; - changes.top = window->desiredY; - flags &= ~SWP_NOMOVE; - } - if (window->desiredConfMask & (CWWidth | CWHeight)) { - changes.right = changes.left + window->desiredWidth; - changes.bottom = changes.top + window->desiredHeight; - flags &= ~SWP_NOSIZE; - /* XXX If overlay exists, resize the overlay here, ie. - if (window->overlay) ... */ - } - if (window->desiredConfMask & CWStackMode) { - flags &= ~SWP_NOZORDER; - /* XXX Overlay support might require something special here. */ - } - - /* Adjust the window rectangle because Win32 thinks that the x, y, - width & height are the WHOLE window (including decorations), - whereas GLUT treats the x, y, width & height as only the CLIENT - area of the window. Only do this to top level windows - that are not in game mode (since game mode windows do - not have any decorations). */ - if (!window->parent && window != __glutGameModeWindow) { - AdjustWindowRect(&changes, - WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - FALSE); - } - - /* Do the repositioning, moving, and push/pop. */ - SetWindowPos(window->win, - window->desiredStack == Above ? HWND_TOP : HWND_NOTOPMOST, - changes.left, changes.top, - changes.right - changes.left, changes.bottom - changes.top, - flags); - - /* Zero out the mask. */ - window->desiredConfMask = 0; - - /* This hack causes the window to go back to the right position - when it is taken out of fullscreen mode. */ - if (workMask & GLUT_FULL_SCREEN_WORK) { - window->desiredConfMask |= CWX | CWY; - window->desiredX = point.x; - window->desiredY = point.y; - } -#else /* !_WIN32 */ - XWindowChanges changes; - - changes.x = window->desiredX; - changes.y = window->desiredY; - if (window->desiredConfMask & (CWWidth | CWHeight)) { - changes.width = window->desiredWidth; - changes.height = window->desiredHeight; - if (window->overlay) - XResizeWindow(__glutDisplay, window->overlay->win, - window->desiredWidth, window->desiredHeight); - if (__glutMotifHints != None) { - if (workMask & GLUT_FULL_SCREEN_WORK) { - MotifWmHints hints; - - hints.flags = MWM_HINTS_DECORATIONS; - hints.decorations = 0; /* Absolutely no - decorations. */ - XChangeProperty(__glutDisplay, window->win, - __glutMotifHints, __glutMotifHints, 32, - PropModeReplace, (unsigned char *) &hints, 4); - if (workMask & GLUT_MAP_WORK) { - /* Handle case where glutFullScreen is called - before the first time that the window is - mapped. Some window managers will randomly or - interactively position the window the first - time it is mapped if the window's - WM_NORMAL_HINTS property does not request an - explicit position. We don't want any such - window manager interaction when going - fullscreen. Overwrite the WM_NORMAL_HINTS - property installed by glutCreateWindow's - XSetWMProperties property with one explicitly - requesting a fullscreen window. */ - XSizeHints hints; - - hints.flags = USPosition | USSize; - hints.x = 0; - hints.y = 0; - hints.width = window->desiredWidth; - hints.height = window->desiredHeight; - XSetWMNormalHints(__glutDisplay, window->win, &hints); - } - } else { - XDeleteProperty(__glutDisplay, window->win, __glutMotifHints); - } - } - } - if (window->desiredConfMask & CWStackMode) { - changes.stack_mode = window->desiredStack; - /* Do not let glutPushWindow push window beneath the - underlay. */ - if (window->parent && window->parent->overlay - && window->desiredStack == Below) { - changes.stack_mode = Above; - changes.sibling = window->parent->overlay->win; - window->desiredConfMask |= CWSibling; - } - } - XConfigureWindow(__glutDisplay, window->win, - window->desiredConfMask, &changes); - window->desiredConfMask = 0; -#endif - } -#if !defined(_WIN32) && !defined(__OS2__) - /* Be sure to establish the colormaps BEFORE map window is - done. */ - if (workMask & GLUT_COLORMAP_WORK) { - __glutEstablishColormapsProperty(window); - } -#endif - if (workMask & GLUT_MAP_WORK) { - switch (window->desiredMapState) { - case WithdrawnState: - if (window->parent) { - XUnmapWindow(__glutDisplay, window->win); - } else { - XWithdrawWindow(__glutDisplay, window->win, - __glutScreen); - } - window->shownState = 0; - break; - case NormalState: - XMapWindow(__glutDisplay, window->win); - window->shownState = 1; - break; -#ifdef _WIN32 - case GameModeState: /* Not an Xlib value. */ - ShowWindow(window->win, SW_SHOW); - window->shownState = 1; - break; -#endif - case IconicState: - XIconifyWindow(__glutDisplay, window->win, __glutScreen); - window->shownState = 0; - break; - } - } - } - if (workMask & (GLUT_REDISPLAY_WORK | GLUT_OVERLAY_REDISPLAY_WORK | GLUT_REPAIR_WORK | GLUT_OVERLAY_REPAIR_WORK)) { - if (window->forceReshape) { - /* Guarantee that before a display callback is generated - for a window, a reshape callback must be generated. */ - __glutSetWindow(window); - window->reshape(window->width, window->height); - window->forceReshape = False; - - /* Setting the redisplay bit on the first reshape is - necessary to make the "Mesa glXSwapBuffers to repair - damage" hack operate correctly. Without indicating a - redisplay is necessary, there's not an initial back - buffer render from which to blit from when damage - happens to the window. */ - workMask |= GLUT_REDISPLAY_WORK; - } - /* The code below is more involved than otherwise necessary - because it is paranoid about the overlay or entire window - being removed or destroyed in the course of the callbacks. - Notice how the global __glutWindowDamaged is used to record - the layers' damage status. See the code in glutLayerGet for - how __glutWindowDamaged is used. The point is to not have to - update the "damaged" field after the callback since the - window (or overlay) may be destroyed (or removed) when the - callback returns. */ - - if (window->overlay && window->overlay->display) { - int num = window->num; - Window xid = window->overlay ? window->overlay->win : None; - - /* If an overlay display callback is registered, we - differentiate between a redisplay needed for the - overlay and/or normal plane. If there is no overlay - display callback registered, we simply use the - standard display callback. */ - - if (workMask & (GLUT_REDISPLAY_WORK | GLUT_REPAIR_WORK)) { - if (__glutMesaSwapHackSupport) { - if (window->usedSwapBuffers) { - if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) { - SWAP_BUFFERS_WINDOW(window); - goto skippedDisplayCallback1; - } - } - } - /* Render to normal plane. */ -#ifdef _WIN32 - window->renderDc = window->hdc; -#endif - window->renderWin = window->win; - window->renderCtx = window->ctx; - __glutWindowDamaged = (workMask & GLUT_REPAIR_WORK); - __glutSetWindow(window); - window->usedSwapBuffers = 0; - window->display(); - __glutWindowDamaged = 0; - - skippedDisplayCallback1:; - } - if (workMask & (GLUT_OVERLAY_REDISPLAY_WORK | GLUT_OVERLAY_REPAIR_WORK)) { - window = __glutWindowList[num]; - if (window && window->overlay && - window->overlay->win == xid && window->overlay->display) { - - /* Render to overlay. */ -#ifdef _WIN32 - window->renderDc = window->overlay->hdc; -#endif - window->renderWin = window->overlay->win; - window->renderCtx = window->overlay->ctx; - __glutWindowDamaged = (workMask & GLUT_OVERLAY_REPAIR_WORK); - __glutSetWindow(window); - window->overlay->display(); - __glutWindowDamaged = 0; - } else { - /* Overlay may have since been destroyed or the - overlay callback may have been disabled during - normal display callback. */ - } - } - } else { - if (__glutMesaSwapHackSupport) { - if (!window->overlay && window->usedSwapBuffers) { - if ((workMask & (GLUT_REPAIR_WORK | GLUT_REDISPLAY_WORK)) == GLUT_REPAIR_WORK) { - SWAP_BUFFERS_WINDOW(window); - goto skippedDisplayCallback2; - } - } - } - /* Render to normal plane (and possibly overlay). */ - __glutWindowDamaged = (workMask & (GLUT_OVERLAY_REPAIR_WORK | GLUT_REPAIR_WORK)); - __glutSetWindow(window); - window->usedSwapBuffers = 0; - window->display(); - __glutWindowDamaged = 0; - - skippedDisplayCallback2:; - } - } - /* Combine workMask with window->workMask to determine what - finish and debug work there is. */ - workMask |= window->workMask; - - if (workMask & GLUT_FINISH_WORK) { - /* Finish work makes sure a glFinish gets done to indirect - rendering contexts. Indirect contexts tend to have much - longer latency because lots of OpenGL extension requests - can queue up in the X protocol stream. __glutSetWindow - is where the finish works gets queued for indirect - contexts. */ - __glutSetWindow(window); - glFinish(); - } - if (workMask & GLUT_DEBUG_WORK) { - __glutSetWindow(window); - glutReportErrors(); - } - /* Strip out dummy, finish, and debug work bits. */ - window->workMask &= ~(GLUT_DUMMY_WORK | GLUT_FINISH_WORK | GLUT_DEBUG_WORK); - if (window->workMask) { - /* Leave on work list. */ - return window; - } else { - /* Remove current window from work list. */ - return window->prevWorkWin; - } -} - -#ifndef _WIN32 -static /* X11 implementations do not need this global. */ -#endif -void -__glutProcessWindowWorkLists(void) -{ - if (__glutWindowWorkList) { - GLUTwindow *remainder, *work; - - work = __glutWindowWorkList; - __glutWindowWorkList = NULL; - if (work) { - remainder = processWindowWorkList(work); - if (remainder) { - *beforeEnd = __glutWindowWorkList; - __glutWindowWorkList = remainder; - } - } - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutMainLoop(void) -{ -#if !defined(_WIN32) - if (!__glutDisplay) - __glutFatalUsage("main loop entered with out proper initialization."); -#endif - if (!__glutWindowListSize) - __glutFatalUsage( - "main loop entered with no windows created."); - for (;;) { - __glutProcessWindowWorkLists(); - if (__glutIdleFunc || __glutWindowWorkList) { - idleWait(); - } else { - if (__glutTimerList) { - waitForSomething(); - } else { - processEventsAndTimeouts(); - } - } - } -} -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_ext.cpp b/src/glut/os2/glut_ext.cpp deleted file mode 100644 index 6617fd6edb..0000000000 --- a/src/glut/os2/glut_ext.cpp +++ /dev/null @@ -1,204 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include - -#include "glutint.h" - -/* CENTRY */ -int GLUTAPIENTRY -glutExtensionSupported(const char *extension) -{ - static const GLubyte *extensions = NULL; - const GLubyte *start; - GLubyte *where, *terminator; - - /* Extension names should not have spaces. */ - where = (GLubyte *) strchr(extension, ' '); - if (where || *extension == '\0') - return 0; - - if (!extensions) { - extensions = glGetString(GL_EXTENSIONS); - } - /* It takes a bit of care to be fool-proof about parsing the - OpenGL extensions string. Don't be fooled by sub-strings, - etc. */ - start = extensions; - for (;;) { - /* If your application crashes in the strstr routine below, - you are probably calling glutExtensionSupported without - having a current window. Calling glGetString without - a current OpenGL context has unpredictable results. - Please fix your program. */ - where = (GLubyte *) strstr((const char *) start, extension); - if (!where) - break; - terminator = where + strlen(extension); - if (where == start || *(where - 1) == ' ') { - if (*terminator == ' ' || *terminator == '\0') { - return 1; - } - } - start = terminator; - } - return 0; -} - - -struct name_address_pair { - const char *name; - const void *address; -}; - -static struct name_address_pair glut_functions[] = { - { "glutInit", (const void *) glutInit }, - { "glutInitDisplayMode", (const void *) glutInitDisplayMode }, - { "glutInitDisplayString", (const void *) glutInitDisplayString }, - { "glutInitWindowPosition", (const void *) glutInitWindowPosition }, - { "glutInitWindowSize", (const void *) glutInitWindowSize }, - { "glutMainLoop", (const void *) glutMainLoop }, - { "glutCreateWindow", (const void *) glutCreateWindow }, - { "glutCreateSubWindow", (const void *) glutCreateSubWindow }, - { "glutDestroyWindow", (const void *) glutDestroyWindow }, - { "glutPostRedisplay", (const void *) glutPostRedisplay }, - { "glutPostWindowRedisplay", (const void *) glutPostWindowRedisplay }, - { "glutSwapBuffers", (const void *) glutSwapBuffers }, - { "glutGetWindow", (const void *) glutGetWindow }, - { "glutSetWindow", (const void *) glutSetWindow }, - { "glutSetWindowTitle", (const void *) glutSetWindowTitle }, - { "glutSetIconTitle", (const void *) glutSetIconTitle }, - { "glutPositionWindow", (const void *) glutPositionWindow }, - { "glutReshapeWindow", (const void *) glutReshapeWindow }, - { "glutPopWindow", (const void *) glutPopWindow }, - { "glutPushWindow", (const void *) glutPushWindow }, - { "glutIconifyWindow", (const void *) glutIconifyWindow }, - { "glutShowWindow", (const void *) glutShowWindow }, - { "glutHideWindow", (const void *) glutHideWindow }, - { "glutFullScreen", (const void *) glutFullScreen }, - { "glutSetCursor", (const void *) glutSetCursor }, - { "glutWarpPointer", (const void *) glutWarpPointer }, - { "glutEstablishOverlay", (const void *) glutEstablishOverlay }, - { "glutRemoveOverlay", (const void *) glutRemoveOverlay }, - { "glutUseLayer", (const void *) glutUseLayer }, - { "glutPostOverlayRedisplay", (const void *) glutPostOverlayRedisplay }, - { "glutPostWindowOverlayRedisplay", (const void *) glutPostWindowOverlayRedisplay }, - { "glutShowOverlay", (const void *) glutShowOverlay }, - { "glutHideOverlay", (const void *) glutHideOverlay }, - { "glutCreateMenu", (const void *) glutCreateMenu }, - { "glutDestroyMenu", (const void *) glutDestroyMenu }, - { "glutGetMenu", (const void *) glutGetMenu }, - { "glutSetMenu", (const void *) glutSetMenu }, - { "glutAddMenuEntry", (const void *) glutAddMenuEntry }, - { "glutAddSubMenu", (const void *) glutAddSubMenu }, - { "glutChangeToMenuEntry", (const void *) glutChangeToMenuEntry }, - { "glutChangeToSubMenu", (const void *) glutChangeToSubMenu }, - { "glutRemoveMenuItem", (const void *) glutRemoveMenuItem }, - { "glutAttachMenu", (const void *) glutAttachMenu }, - { "glutDetachMenu", (const void *) glutDetachMenu }, - { "glutDisplayFunc", (const void *) glutDisplayFunc }, - { "glutReshapeFunc", (const void *) glutReshapeFunc }, - { "glutKeyboardFunc", (const void *) glutKeyboardFunc }, - { "glutMouseFunc", (const void *) glutMouseFunc }, - { "glutMotionFunc", (const void *) glutMotionFunc }, - { "glutPassiveMotionFunc", (const void *) glutPassiveMotionFunc }, - { "glutEntryFunc", (const void *) glutEntryFunc }, - { "glutVisibilityFunc", (const void *) glutVisibilityFunc }, - { "glutIdleFunc", (const void *) glutIdleFunc }, - { "glutTimerFunc", (const void *) glutTimerFunc }, - { "glutMenuStateFunc", (const void *) glutMenuStateFunc }, - { "glutSpecialFunc", (const void *) glutSpecialFunc }, - { "glutSpaceballMotionFunc", (const void *) glutSpaceballMotionFunc }, - { "glutSpaceballRotateFunc", (const void *) glutSpaceballRotateFunc }, - { "glutSpaceballButtonFunc", (const void *) glutSpaceballButtonFunc }, - { "glutButtonBoxFunc", (const void *) glutButtonBoxFunc }, - { "glutDialsFunc", (const void *) glutDialsFunc }, - { "glutTabletMotionFunc", (const void *) glutTabletMotionFunc }, - { "glutTabletButtonFunc", (const void *) glutTabletButtonFunc }, - { "glutMenuStatusFunc", (const void *) glutMenuStatusFunc }, - { "glutOverlayDisplayFunc", (const void *) glutOverlayDisplayFunc }, - { "glutWindowStatusFunc", (const void *) glutWindowStatusFunc }, - { "glutKeyboardUpFunc", (const void *) glutKeyboardUpFunc }, - { "glutSpecialUpFunc", (const void *) glutSpecialUpFunc }, - { "glutJoystickFunc", (const void *) glutJoystickFunc }, - { "glutSetColor", (const void *) glutSetColor }, - { "glutGetColor", (const void *) glutGetColor }, - { "glutCopyColormap", (const void *) glutCopyColormap }, - { "glutGet", (const void *) glutGet }, - { "glutDeviceGet", (const void *) glutDeviceGet }, - { "glutExtensionSupported", (const void *) glutExtensionSupported }, - { "glutGetModifiers", (const void *) glutGetModifiers }, - { "glutLayerGet", (const void *) glutLayerGet }, - { "glutGetProcAddress", (const void *) glutGetProcAddress }, - { "glutBitmapCharacter", (const void *) glutBitmapCharacter }, - { "glutBitmapWidth", (const void *) glutBitmapWidth }, - { "glutStrokeCharacter", (const void *) glutStrokeCharacter }, - { "glutStrokeWidth", (const void *) glutStrokeWidth }, - { "glutBitmapLength", (const void *) glutBitmapLength }, - { "glutStrokeLength", (const void *) glutStrokeLength }, - { "glutWireSphere", (const void *) glutWireSphere }, - { "glutSolidSphere", (const void *) glutSolidSphere }, - { "glutWireCone", (const void *) glutWireCone }, - { "glutSolidCone", (const void *) glutSolidCone }, - { "glutWireCube", (const void *) glutWireCube }, - { "glutSolidCube", (const void *) glutSolidCube }, - { "glutWireTorus", (const void *) glutWireTorus }, - { "glutSolidTorus", (const void *) glutSolidTorus }, - { "glutWireDodecahedron", (const void *) glutWireDodecahedron }, - { "glutSolidDodecahedron", (const void *) glutSolidDodecahedron }, - { "glutWireTeapot", (const void *) glutWireTeapot }, - { "glutSolidTeapot", (const void *) glutSolidTeapot }, - { "glutWireOctahedron", (const void *) glutWireOctahedron }, - { "glutSolidOctahedron", (const void *) glutSolidOctahedron }, - { "glutWireTetrahedron", (const void *) glutWireTetrahedron }, - { "glutSolidTetrahedron", (const void *) glutSolidTetrahedron }, - { "glutWireIcosahedron", (const void *) glutWireIcosahedron }, - { "glutSolidIcosahedron", (const void *) glutSolidIcosahedron }, - { "glutVideoResizeGet", (const void *) glutVideoResizeGet }, - { "glutSetupVideoResizing", (const void *) glutSetupVideoResizing }, - { "glutStopVideoResizing", (const void *) glutStopVideoResizing }, - { "glutVideoResize", (const void *) glutVideoResize }, - { "glutVideoPan", (const void *) glutVideoPan }, - { "glutReportErrors", (const void *) glutReportErrors }, - { "glutIgnoreKeyRepeat", (const void *) glutIgnoreKeyRepeat }, - { "glutSetKeyRepeat", (const void *) glutSetKeyRepeat }, - { "glutForceJoystickFunc", (const void *) glutForceJoystickFunc }, - { "glutGameModeString", (const void *) glutGameModeString }, - { "glutEnterGameMode", (const void *) glutEnterGameMode }, - { "glutLeaveGameMode", (const void *) glutLeaveGameMode }, - { "glutGameModeGet", (const void *) glutGameModeGet }, - { NULL, NULL } -}; - - -/* XXX This isn't an official GLUT function, yet */ -void * GLUTAPIENTRY -glutGetProcAddress(const char *procName) -{ - /* Try GLUT functions first */ - int i; - for (i = 0; glut_functions[i].name; i++) { - if (strcmp(glut_functions[i].name, procName) == 0) - return (void *) glut_functions[i].address; - } - - /* Try core GL functions */ -#if defined(_WIN32) - return (void *) wglGetProcAddress((LPCSTR) procName); - -#elif defined(__OS2PM__) - return (void *) wglGetProcAddress((char *) procName); -#elif defined(GLX_ARB_get_proc_address) - return (void *) glXGetProcAddressARB((const GLubyte *) procName); -#else - return NULL; -#endif -} - - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_fullscrn.cpp b/src/glut/os2/glut_fullscrn.cpp deleted file mode 100644 index 584aba4fd8..0000000000 --- a/src/glut/os2/glut_fullscrn.cpp +++ /dev/null @@ -1,38 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1995, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include - -#include "glutint.h" - -/* CENTRY */ -void GLUTAPIENTRY -glutFullScreen(void) -{ - assert(!__glutCurrentWindow->parent); - IGNORE_IN_GAME_MODE(); -#if !defined(_WIN32) && !defined(__OS2PM__) - if (__glutMotifHints == None) { - __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", - SGI_XA__MOTIF_WM_HINTS, 0); - if (__glutMotifHints == None) { - __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS."); - } - } -#endif - - __glutCurrentWindow->desiredX = 0; - __glutCurrentWindow->desiredY = 0; - __glutCurrentWindow->desiredWidth = __glutScreenWidth; - __glutCurrentWindow->desiredHeight = __glutScreenHeight; - __glutCurrentWindow->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; - - __glutPutOnWorkList(__glutCurrentWindow, - GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_gamemode.cpp b/src/glut/os2/glut_gamemode.cpp deleted file mode 100644 index 1756e8a4b5..0000000000 --- a/src/glut/os2/glut_gamemode.cpp +++ /dev/null @@ -1,679 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - - -#include -#include -#include -#include - -#include "glutint.h" - -#if !defined(_WIN32) && !defined(__OS2__) -#include -#include - -/* SGI optimization introduced in IRIX 6.3 to avoid X server - round trips for interning common X atoms. */ -#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) -#include -#else -#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) -#endif -#endif /* not _WIN32 */ - -int __glutDisplaySettingsChanged = 0; -static DisplayMode *dmodes, *currentDm = NULL; -static int ndmodes = -1; -GLUTwindow *__glutGameModeWindow = NULL; - -#ifdef TEST -static char *compstr[] = -{ - "none", "=", "!=", "<=", ">=", ">", "<", "~" -}; -static char *capstr[] = -{ - "width", "height", "bpp", "hertz", "num" -}; -#endif - -#if defined(__OS2__) -void -#else -void __cdecl -#endif -__glutCloseDownGameMode(void) -{ - if (__glutDisplaySettingsChanged) { -#ifdef _WIN32 - /* Assumes that display settings have been changed, that - is __glutDisplaySettingsChanged is true. */ - ChangeDisplaySettings(NULL, 0); -#endif - __glutDisplaySettingsChanged = 0; - } - __glutGameModeWindow = NULL; -} - -void GLUTAPIENTRY -glutLeaveGameMode(void) -{ - if (__glutGameModeWindow == NULL) { - __glutWarning("not in game mode so cannot leave game mode"); - return; - } - __glutDestroyWindow(__glutGameModeWindow, - __glutGameModeWindow); - XFlush(__glutDisplay); - __glutGameModeWindow = NULL; -} - -#ifdef _WIN32 - -/* Same values as from MSDN's SetDisp.c example. */ -#define MIN_WIDTH 400 -#define MIN_FREQUENCY 60 - -static void -initGameModeSupport(void) -{ - DEVMODE dm; - DWORD mode; - int i; - - if (ndmodes >= 0) { - /* ndmodes is initially -1 to indicate no - dmodes allocated yet. */ - return; - } - - /* Determine how many display modes there are. */ - ndmodes = 0; - mode = 0; - while (EnumDisplaySettings(NULL, mode, &dm)) { - if (dm.dmPelsWidth >= MIN_WIDTH && - (dm.dmDisplayFrequency == 0 || - dm.dmDisplayFrequency >= MIN_FREQUENCY)) { - ndmodes++; - } - mode++; - } - - /* Allocate memory for a list of all the display modes. */ - dmodes = (DisplayMode*) - malloc(ndmodes * sizeof(DisplayMode)); - - /* Now that we know how many display modes to expect, - enumerate them again and save the information in - the list we allocated above. */ - i = 0; - mode = 0; - while (EnumDisplaySettings(NULL, mode, &dm)) { - /* Try to reject any display settings that seem unplausible. */ - if (dm.dmPelsWidth >= MIN_WIDTH && - (dm.dmDisplayFrequency == 0 || - dm.dmDisplayFrequency >= MIN_FREQUENCY)) { - dmodes[i].devmode = dm; - dmodes[i].valid = 1; /* XXX Not used for now. */ - dmodes[i].cap[DM_WIDTH] = dm.dmPelsWidth; - dmodes[i].cap[DM_HEIGHT] = dm.dmPelsHeight; - dmodes[i].cap[DM_PIXEL_DEPTH] = dm.dmBitsPerPel; - if (dm.dmDisplayFrequency == 0) { - /* Guess a reasonable guess. */ - /* Lame Windows 95 version of EnumDisplaySettings. */ - dmodes[i].cap[DM_HERTZ] = 60; - } else { - dmodes[i].cap[DM_HERTZ] = dm.dmDisplayFrequency; - } - i++; - } - mode++; - } - - assert(i == ndmodes); -} - -#else - -/* X Windows version of initGameModeSupport. */ -static void -initGameModeSupport(void) -{ - if (ndmodes >= 0) { - /* ndmodes is initially -1 to indicate no - dmodes allocated yet. */ - return; - } - - /* Determine how many display modes there are. */ - ndmodes = 0; -} - -#endif - -/* This routine is based on similiar code in glut_dstr.c */ -static DisplayMode * -findMatch(DisplayMode * dmodes, int ndmodes, - Criterion * criteria, int ncriteria) -{ - DisplayMode *found; - int *bestScore, *thisScore; - int i, j, numok, result = 0, worse, better; - - found = NULL; - numok = 1; /* "num" capability is indexed from 1, - not 0. */ - - /* XXX alloca canidate. */ - bestScore = (int *) malloc(ncriteria * sizeof(int)); - if (!bestScore) { - __glutFatalError("out of memory."); - } - for (j = 0; j < ncriteria; j++) { - /* Very negative number. */ - bestScore[j] = -32768; - } - - /* XXX alloca canidate. */ - thisScore = (int *) malloc(ncriteria * sizeof(int)); - if (!thisScore) { - __glutFatalError("out of memory."); - } - - for (i = 0; i < ndmodes; i++) { - if (dmodes[i].valid) { - worse = 0; - better = 0; - - for (j = 0; j < ncriteria; j++) { - int cap, cvalue, dvalue; - - cap = criteria[j].capability; - cvalue = criteria[j].value; - if (cap == NUM) { - dvalue = numok; - } else { - dvalue = dmodes[i].cap[cap]; - } -#ifdef TEST - if (verbose) - printf(" %s %s %d to %d\n", - capstr[cap], compstr[criteria[j].comparison], cvalue, dvalue); -#endif - switch (criteria[j].comparison) { - case EQ: - result = cvalue == dvalue; - thisScore[j] = 1; - break; - case NEQ: - result = cvalue != dvalue; - thisScore[j] = 1; - break; - case LT: - result = dvalue < cvalue; - thisScore[j] = dvalue - cvalue; - break; - case GT: - result = dvalue > cvalue; - thisScore[j] = dvalue - cvalue; - break; - case LTE: - result = dvalue <= cvalue; - thisScore[j] = dvalue - cvalue; - break; - case GTE: - result = (dvalue >= cvalue); - thisScore[j] = dvalue - cvalue; - break; - case MIN: - result = dvalue >= cvalue; - thisScore[j] = cvalue - dvalue; - break; - } - -#ifdef TEST - if (verbose) - printf(" result=%d score=%d bestScore=%d\n", result, thisScore[j], bestScore[j]); -#endif - - if (result) { - if (better || thisScore[j] > bestScore[j]) { - better = 1; - } else if (thisScore[j] == bestScore[j]) { - /* Keep looking. */ - } else { - goto nextDM; - } - } else { - if (cap == NUM) { - worse = 1; - } else { - goto nextDM; - } - } - - } - - if (better && !worse) { - found = &dmodes[i]; - for (j = 0; j < ncriteria; j++) { - bestScore[j] = thisScore[j]; - } - } - numok++; - - nextDM:; - - } - } - free(bestScore); - free(thisScore); - return found; -} - -/** - * Parses strings in the form of: - * 800x600 - * 800x600:16 - * 800x600@60 - * 800x600:16@60 - * @60 - * :16 - * :16@60 - * NOTE that @ before : is not parsed. - */ -static int -specialCaseParse(char *word, Criterion * criterion, int mask) -{ - char *xstr, *response; - int got; - int width, height, bpp, hertz; - - switch(word[0]) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - /* The WWWxHHH case. */ - if (mask & (1 << DM_WIDTH)) { - return -1; - } - xstr = strpbrk(&word[1], "x"); - if (xstr) { - width = (int) strtol(word, &response, 0); - if (response == word || response[0] != 'x') { - /* Not a valid number OR needs to be followed by 'x'. */ - return -1; - } - height = (int) strtol(&xstr[1], &response, 0); - if (response == &xstr[1]) { - /* Not a valid number. */ - return -1; - } - criterion[0].capability = DM_WIDTH; - criterion[0].comparison = EQ; - criterion[0].value = width; - criterion[1].capability = DM_HEIGHT; - criterion[1].comparison = EQ; - criterion[1].value = height; - got = specialCaseParse(response, - &criterion[2], 1 << DM_WIDTH); - if (got >= 0) { - return got + 2; - } else { - return -1; - } - } - return -1; - case ':': - /* The :BPP case. */ - if (mask & (1 << DM_PIXEL_DEPTH)) { - return -1; - } - bpp = (int) strtol(&word[1], &response, 0); - if (response == &word[1]) { - /* Not a valid number. */ - return -1; - } - criterion[0].capability = DM_PIXEL_DEPTH; - criterion[0].comparison = EQ; - criterion[0].value = bpp; - got = specialCaseParse(response, - &criterion[1], (1 << DM_WIDTH) | (1 << DM_PIXEL_DEPTH)); - if (got >= 0) { - return got + 1; - } else { - return -1; - } - case '@': - /* The @HZ case. */ - if (mask & (1 << DM_HERTZ)) { - return -1; - } - hertz = (int) strtol(&word[1], &response, 0); - if (response == &word[1]) { - /* Not a valid number. */ - return -1; - } - criterion[0].capability = DM_HERTZ; - criterion[0].comparison = EQ; - criterion[0].value = hertz; - got = specialCaseParse(response, - &criterion[1], ~DM_HERTZ); - if (got >= 0) { - return got + 1; - } else { - return -1; - } - case '\0': - return 0; - } - return -1; -} - -/* This routine is based on similiar code in glut_dstr.c */ -static int -parseCriteria(char *word, Criterion * criterion) -{ - char *cstr, *vstr, *response; - int comparator, value = 0; - - cstr = strpbrk(word, "=>': - if (cstr[1] == '=') { - comparator = GTE; - vstr = &cstr[2]; - } else { - comparator = GT; - vstr = &cstr[1]; - } - break; - case '<': - if (cstr[1] == '=') { - comparator = LTE; - vstr = &cstr[2]; - } else { - comparator = LT; - vstr = &cstr[1]; - } - break; - case '!': - if (cstr[1] == '=') { - comparator = NEQ; - vstr = &cstr[2]; - } else { - return -1; - } - break; - default: - return -1; - } - value = (int) strtol(vstr, &response, 0); - if (response == vstr) { - /* Not a valid number. */ - return -1; - } - *cstr = '\0'; - } else { - comparator = NONE; - } - switch (word[0]) { - case 'b': - if (!strcmp(word, "bpp")) { - criterion[0].capability = DM_PIXEL_DEPTH; - if (comparator == NONE) { - return -1; - } else { - criterion[0].comparison = comparator; - criterion[0].value = value; - return 1; - } - } - return -1; - case 'h': - if (!strcmp(word, "height")) { - criterion[0].capability = DM_HEIGHT; - if (comparator == NONE) { - return -1; - } else { - criterion[0].comparison = comparator; - criterion[0].value = value; - return 1; - } - } - if (!strcmp(word, "hertz")) { - criterion[0].capability = DM_HERTZ; - if (comparator == NONE) { - return -1; - } else { - criterion[0].comparison = comparator; - criterion[0].value = value; - return 1; - } - } - return -1; - case 'n': - if (!strcmp(word, "num")) { - criterion[0].capability = DM_NUM; - if (comparator == NONE) { - return -1; - } else { - criterion[0].comparison = comparator; - criterion[0].value = value; - return 1; - } - } - return -1; - case 'w': - if (!strcmp(word, "width")) { - criterion[0].capability = DM_WIDTH; - if (comparator == NONE) { - return -1; - } else { - criterion[0].comparison = comparator; - criterion[0].value = value; - return 1; - } - } - return -1; - } - if (comparator == NONE) { - return specialCaseParse(word, criterion, 0); - } - return -1; -} - -/* This routine is based on similiar code in glut_dstr.c */ -static Criterion * -parseDisplayString(const char *display, int *ncriteria) -{ - Criterion *criteria = NULL; - int n, parsed; - char *copy, *word; - - copy = __glutStrdup(display); - /* Attempt to estimate how many criteria entries should be - needed. */ - n = 0; - word = strtok(copy, " \t"); - while (word) { - n++; - word = strtok(NULL, " \t"); - } - /* Allocate number of words of criteria. A word - could contain as many as four criteria in the - worst case. Example: 800x600:16@60 */ - criteria = (Criterion *) malloc(4 * n * sizeof(Criterion)); - if (!criteria) { - __glutFatalError("out of memory."); - } - - /* Re-copy the copy of the display string. */ - strcpy(copy, display); - - n = 0; - word = strtok(copy, " \t"); - while (word) { - parsed = parseCriteria(word, &criteria[n]); - if (parsed >= 0) { - n += parsed; - } else { - __glutWarning("Unrecognized game mode string word: %s (ignoring)\n", word); - } - word = strtok(NULL, " \t"); - } - - free(copy); - *ncriteria = n; - return criteria; -} - -void GLUTAPIENTRY -glutGameModeString(const char *string) -{ - Criterion *criteria; - int ncriteria; - - initGameModeSupport(); - criteria = parseDisplayString(string, &ncriteria); - currentDm = findMatch(dmodes, ndmodes, criteria, ncriteria); - free(criteria); -} - -int GLUTAPIENTRY -glutEnterGameMode(void) -{ - GLUTwindow *window; - int width, height; - Window win; - - if (__glutMappedMenu) { - __glutFatalUsage("entering game mode not allowed while menus in use"); - } - if (__glutGameModeWindow) { - /* Already in game mode, so blow away game mode - window so apps can change resolutions. */ - window = __glutGameModeWindow; - /* Setting the game mode window to NULL tricks - the window destroy code into not undoing the - screen display change since we plan on immediately - doing another mode change. */ - __glutGameModeWindow = NULL; - __glutDestroyWindow(window, window); - } - - /* Assume default screen size until we find out if we - can actually change the display settings. */ - width = __glutScreenWidth; - height = __glutScreenHeight; - - if (currentDm) { -#ifdef _WIN32 - LONG status; - static int registered = 0; - - status = ChangeDisplaySettings(¤tDm->devmode, - CDS_FULLSCREEN); - if (status == DISP_CHANGE_SUCCESSFUL) { - __glutDisplaySettingsChanged = 1; - width = currentDm->cap[DM_WIDTH]; - height = currentDm->cap[DM_HEIGHT]; - if (!registered) { - atexit(__glutCloseDownGameMode); - registered = 1; - } - } else { - /* Switch back to default resolution. */ - ChangeDisplaySettings(NULL, 0); - } -#endif - } - - window = __glutCreateWindow(NULL, 0, 0, - width, height, /* game mode */ 1); - win = window->win; - -#if !defined(_WIN32) && !defined(__OS2__) - if (__glutMotifHints == None) { - __glutMotifHints = XSGIFastInternAtom(__glutDisplay, "_MOTIF_WM_HINTS", - SGI_XA__MOTIF_WM_HINTS, 0); - if (__glutMotifHints == None) { - __glutWarning("Could not intern X atom for _MOTIF_WM_HINTS."); - } - } - - /* Game mode window is a toplevel window. */ - XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1); -#endif - - /* Schedule the fullscreen property to be added and to - make sure the window is configured right. Win32 - doesn't need this. */ - window->desiredX = 0; - window->desiredY = 0; - window->desiredWidth = width; - window->desiredHeight = height; - window->desiredConfMask |= CWX | CWY | CWWidth | CWHeight; -#ifdef _WIN32 - /* Win32 does not want to use GLUT_FULL_SCREEN_WORK - for game mode because we need to be maximizing - the window in game mode, not just sizing it to - take up the full screen. The Win32-ness of game - mode happens when you pass 1 in the gameMode parameter - to __glutCreateWindow above. A gameMode of creates - a WS_POPUP window, not a standard WS_OVERLAPPEDWINDOW - window. WS_POPUP ensures the taskbar is hidden. */ - __glutPutOnWorkList(window, - GLUT_CONFIGURE_WORK); -#else - __glutPutOnWorkList(window, - GLUT_CONFIGURE_WORK | GLUT_FULL_SCREEN_WORK); -#endif - - __glutGameModeWindow = window; - return window->num + 1; -} - -int GLUTAPIENTRY -glutGameModeGet(GLenum mode) -{ - switch (mode) { - case GLUT_GAME_MODE_ACTIVE: - return __glutGameModeWindow != NULL; - case GLUT_GAME_MODE_POSSIBLE: - return currentDm != NULL; - case GLUT_GAME_MODE_WIDTH: - return currentDm ? currentDm->cap[DM_WIDTH] : -1; - case GLUT_GAME_MODE_HEIGHT: - return currentDm ? currentDm->cap[DM_HEIGHT] : -1; - case GLUT_GAME_MODE_PIXEL_DEPTH: - return currentDm ? currentDm->cap[DM_PIXEL_DEPTH] : -1; - case GLUT_GAME_MODE_REFRESH_RATE: - return currentDm ? currentDm->cap[DM_HERTZ] : -1; - case GLUT_GAME_MODE_DISPLAY_CHANGED: - return __glutDisplaySettingsChanged; - default: - return -1; - } -} diff --git a/src/glut/os2/glut_get.cpp b/src/glut/os2/glut_get.cpp deleted file mode 100644 index 8921e9ab03..0000000000 --- a/src/glut/os2/glut_get.cpp +++ /dev/null @@ -1,232 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include /* SunOS 4 needs NULL defined for GETTIMEOFDAY macro. */ -#include "glutint.h" - -/* CENTRY */ -int GLUTAPIENTRY -glutGet(GLenum param) -{ - Window win, root; - int x, y, value; - unsigned int width, height, border, depth; - - switch (param) { - case GLUT_INIT_WINDOW_X: - return __glutInitX; - case GLUT_INIT_WINDOW_Y: - return __glutInitY; - case GLUT_INIT_WINDOW_WIDTH: - return __glutInitWidth; - case GLUT_INIT_WINDOW_HEIGHT: - return __glutInitHeight; - case GLUT_INIT_DISPLAY_MODE: - return __glutDisplayMode; - case GLUT_WINDOW_X: - XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, - __glutRoot, 0, 0, &x, &y, &win); - return x; - case GLUT_WINDOW_Y: - XTranslateCoordinates(__glutDisplay, __glutCurrentWindow->win, - __glutRoot, 0, 0, &x, &y, &win); - return y; - case GLUT_WINDOW_WIDTH: - if (!__glutCurrentWindow->reshape) { - XGetGeometry(__glutDisplay, __glutCurrentWindow->win, - &root, &x, &y, - &width, &height, &border, &depth); - return width; - } - return __glutCurrentWindow->width; - case GLUT_WINDOW_HEIGHT: - if (!__glutCurrentWindow->reshape) { - XGetGeometry(__glutDisplay, __glutCurrentWindow->win, - &root, &x, &y, - &width, &height, &border, &depth); - return height; - } - return __glutCurrentWindow->height; -#ifdef __OS2__ - #define GET_CONFIG(attrib) \ - { if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) \ - glXGetConfig( __glutCurrentWindow->vis, attrib, &value); \ - else \ - glXGetConfig(__glutCurrentWindow->overlay->vis, attrib, &value); \ - } \ - -#else - -#define GET_CONFIG(attrib) { \ - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { \ - glXGetConfig(__glutDisplay, __glutCurrentWindow->vis, \ - attrib, &value); \ - } else { \ - glXGetConfig(__glutDisplay, __glutCurrentWindow->overlay->vis, \ - attrib, &value); \ - } \ -} -#endif - - case GLUT_WINDOW_BUFFER_SIZE: - GET_CONFIG(GLX_BUFFER_SIZE); - return value; - case GLUT_WINDOW_STENCIL_SIZE: - GET_CONFIG(GLX_STENCIL_SIZE); - return value; - case GLUT_WINDOW_DEPTH_SIZE: - GET_CONFIG(GLX_DEPTH_SIZE); - return value; - case GLUT_WINDOW_RED_SIZE: - GET_CONFIG(GLX_RED_SIZE); - return value; - case GLUT_WINDOW_GREEN_SIZE: - GET_CONFIG(GLX_GREEN_SIZE); - return value; - case GLUT_WINDOW_BLUE_SIZE: - GET_CONFIG(GLX_BLUE_SIZE); - return value; - case GLUT_WINDOW_ALPHA_SIZE: - GET_CONFIG(GLX_ALPHA_SIZE); - return value; - case GLUT_WINDOW_ACCUM_RED_SIZE: - GET_CONFIG(GLX_ACCUM_RED_SIZE); - return value; - case GLUT_WINDOW_ACCUM_GREEN_SIZE: - GET_CONFIG(GLX_ACCUM_GREEN_SIZE); - return value; - case GLUT_WINDOW_ACCUM_BLUE_SIZE: - GET_CONFIG(GLX_ACCUM_BLUE_SIZE); - return value; - case GLUT_WINDOW_ACCUM_ALPHA_SIZE: - GET_CONFIG(GLX_ACCUM_ALPHA_SIZE); - return value; - case GLUT_WINDOW_DOUBLEBUFFER: - GET_CONFIG(GLX_DOUBLEBUFFER); - return value; - case GLUT_WINDOW_RGBA: - GET_CONFIG(GLX_RGBA); - return value; - case GLUT_WINDOW_COLORMAP_SIZE: - GET_CONFIG(GLX_RGBA); - if (value) { - return 0; - } else { -#if defined(_WIN32) || defined(__OS2__) - /* KLUDGE: we always assume 256 colors in CI mode on - Win32 */ - return 256; -#else - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { - return __glutCurrentWindow->vis->visual->map_entries; - } else { - return __glutCurrentWindow->overlay->vis->visual->map_entries; - } -#endif /* _WIN32 */ - } - case GLUT_WINDOW_PARENT: - return __glutCurrentWindow->parent ? - __glutCurrentWindow->parent->num + 1 : 0; - case GLUT_WINDOW_NUM_CHILDREN: - { - int num = 0; - GLUTwindow *children = __glutCurrentWindow->children; - - while (children) { - num++; - children = children->siblings; - } - return num; - } - case GLUT_WINDOW_NUM_SAMPLES: -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample) - if (__glutIsSupportedByGLX("GLX_SGIS_multisample")) { - GET_CONFIG(GLX_SAMPLES_SGIS); - return value; - } else { - return 0; - } -#else - /* Independent of GLX server support, multisampling not - supported by GLX client-side. */ - return 0; -#endif - case GLUT_WINDOW_STEREO: - GET_CONFIG(GLX_STEREO); - return value; - case GLUT_WINDOW_CURSOR: - return __glutCurrentWindow->cursor; - case GLUT_SCREEN_WIDTH: - return DisplayWidth(__glutDisplay, __glutScreen); - case GLUT_SCREEN_HEIGHT: - return DisplayHeight(__glutDisplay, __glutScreen); - case GLUT_SCREEN_WIDTH_MM: - return DisplayWidthMM(__glutDisplay, __glutScreen); - case GLUT_SCREEN_HEIGHT_MM: - return DisplayHeightMM(__glutDisplay, __glutScreen); - case GLUT_MENU_NUM_ITEMS: - return __glutCurrentMenu->num; - case GLUT_DISPLAY_MODE_POSSIBLE: - { - XVisualInfo *vi; - Bool dummy, visAlloced; - void *fbc; - -#if defined(_WIN32) - /* Our fake glXChooseVisual (which is called by - __glutDetermineVisual) needs an HDC to work with, so grab one - from the "root" window. */ - XHDC = GetDC(GetDesktopWindow()); -#endif - vi = __glutDetermineWindowVisual(&dummy, &visAlloced, &fbc); -#if defined(_WIN32) - ReleaseDC(GetDesktopWindow(), XHDC); -#endif - if (vi) { - if (visAlloced) - XFree(vi); - return 1; - } - return 0; - } - case GLUT_ELAPSED_TIME: - { -#ifdef OLD_VMS - struct timeval6 elapsed, beginning, now; -#else - struct timeval elapsed, beginning, now; -#endif - - __glutInitTime(&beginning); - GETTIMEOFDAY(&now); - TIMEDELTA(elapsed, now, beginning); - /* Return elapsed milliseconds. */ -#if defined(__vms) && ( __VMS_VER < 70000000 ) - return (int) (elapsed.val / TICKS_PER_MILLISECOND); -#else - return (int) ((elapsed.tv_sec * 1000) + (elapsed.tv_usec / 1000)); -#endif - } - case GLUT_WINDOW_FORMAT_ID: -#if defined(__OS2__) - return wglGetPixelFormat(__glutCurrentWindow->hdc); -#elif defined(_WIN32) - return GetPixelFormat(__glutCurrentWindow->hdc); -#else - if (__glutCurrentWindow->renderWin == __glutCurrentWindow->win) { - return (int) __glutCurrentWindow->vis->visualid; - } else { - return (int) __glutCurrentWindow->overlay->vis->visualid; - } -#endif - default: - __glutWarning("invalid glutGet parameter: %d", param); - return -1; - } -} -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_hel10.cpp b/src/glut/os2/glut_hel10.cpp deleted file mode 100644 index a9f08ff133..0000000000 --- a/src/glut/os2/glut_hel10.cpp +++ /dev/null @@ -1,1781 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#define glutBitmapHelvetica10 XXX -#include "glutbitmap.h" -#undef glutBitmapHelvetica10 - -/* char: 0xff */ - -static const GLubyte ch255data[] = { -0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x50, -}; - -static const BitmapCharRec ch255 = {4,10,0,2,5,ch255data}; - -/* char: 0xfe */ - -static const GLubyte ch254data[] = { -0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, -}; - -static const BitmapCharRec ch254 = {5,10,0,2,6,ch254data}; - -/* char: 0xfd */ - -static const GLubyte ch253data[] = { -0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch253 = {4,11,0,2,5,ch253data}; - -/* char: 0xfc */ - -static const GLubyte ch252data[] = { -0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50, -}; - -static const BitmapCharRec ch252 = {4,8,0,0,5,ch252data}; - -/* char: 0xfb */ - -static const GLubyte ch251data[] = { -0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch251 = {4,9,0,0,5,ch251data}; - -/* char: 0xfa */ - -static const GLubyte ch250data[] = { -0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x40,0x20, -}; - -static const BitmapCharRec ch250 = {4,9,0,0,5,ch250data}; - -/* char: 0xf9 */ - -static const GLubyte ch249data[] = { -0x70,0x90,0x90,0x90,0x90,0x90,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch249 = {4,9,0,0,5,ch249data}; - -/* char: 0xf8 */ - -static const GLubyte ch248data[] = { -0x70,0x88,0xc8,0xa8,0x98,0x74, -}; - -static const BitmapCharRec ch248 = {6,6,0,0,6,ch248data}; - -/* char: 0xf7 */ - -static const GLubyte ch247data[] = { -0x20,0x0,0xf8,0x0,0x20, -}; - -static const BitmapCharRec ch247 = {5,5,0,-1,6,ch247data}; - -/* char: 0xf6 */ - -static const GLubyte ch246data[] = { -0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50, -}; - -static const BitmapCharRec ch246 = {5,8,0,0,6,ch246data}; - -/* char: 0xf5 */ - -static const GLubyte ch245data[] = { -0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch245 = {5,9,0,0,6,ch245data}; - -/* char: 0xf4 */ - -static const GLubyte ch244data[] = { -0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch244 = {5,9,0,0,6,ch244data}; - -/* char: 0xf3 */ - -static const GLubyte ch243data[] = { -0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch243 = {5,9,0,0,6,ch243data}; - -/* char: 0xf2 */ - -static const GLubyte ch242data[] = { -0x70,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch242 = {5,9,0,0,6,ch242data}; - -/* char: 0xf1 */ - -static const GLubyte ch241data[] = { -0x90,0x90,0x90,0x90,0x90,0xe0,0x0,0xa0,0x50, -}; - -static const BitmapCharRec ch241 = {4,9,0,0,5,ch241data}; - -/* char: 0xf0 */ - -static const GLubyte ch240data[] = { -0x70,0x88,0x88,0x88,0x88,0x78,0x90,0x60,0x50, -}; - -static const BitmapCharRec ch240 = {5,9,0,0,6,ch240data}; - -/* char: 0xef */ - -static const GLubyte ch239data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, -}; - -static const BitmapCharRec ch239 = {3,8,0,0,2,ch239data}; - -/* char: 0xee */ - -static const GLubyte ch238data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, -}; - -static const BitmapCharRec ch238 = {3,9,1,0,2,ch238data}; - -/* char: 0xed */ - -static const GLubyte ch237data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, -}; - -static const BitmapCharRec ch237 = {2,9,0,0,2,ch237data}; - -/* char: 0xec */ - -static const GLubyte ch236data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, -}; - -static const BitmapCharRec ch236 = {2,9,1,0,2,ch236data}; - -/* char: 0xeb */ - -static const GLubyte ch235data[] = { -0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50, -}; - -static const BitmapCharRec ch235 = {4,8,0,0,5,ch235data}; - -/* char: 0xea */ - -static const GLubyte ch234data[] = { -0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch234 = {4,9,0,0,5,ch234data}; - -/* char: 0xe9 */ - -static const GLubyte ch233data[] = { -0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x40,0x20, -}; - -static const BitmapCharRec ch233 = {4,9,0,0,5,ch233data}; - -/* char: 0xe8 */ - -static const GLubyte ch232data[] = { -0x60,0x90,0x80,0xf0,0x90,0x60,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch232 = {4,9,0,0,5,ch232data}; - -/* char: 0xe7 */ - -static const GLubyte ch231data[] = { -0x60,0x20,0x60,0x90,0x80,0x80,0x90,0x60, -}; - -static const BitmapCharRec ch231 = {4,8,0,2,5,ch231data}; - -/* char: 0xe6 */ - -static const GLubyte ch230data[] = { -0x6c,0x92,0x90,0x7e,0x12,0xec, -}; - -static const BitmapCharRec ch230 = {7,6,0,0,8,ch230data}; - -/* char: 0xe5 */ - -static const GLubyte ch229data[] = { -0x68,0x90,0x90,0x70,0x10,0xe0,0x20,0x50,0x20, -}; - -static const BitmapCharRec ch229 = {5,9,0,0,5,ch229data}; - -/* char: 0xe4 */ - -static const GLubyte ch228data[] = { -0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50, -}; - -static const BitmapCharRec ch228 = {5,8,0,0,5,ch228data}; - -/* char: 0xe3 */ - -static const GLubyte ch227data[] = { -0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0xa0,0x50, -}; - -static const BitmapCharRec ch227 = {5,9,0,0,5,ch227data}; - -/* char: 0xe2 */ - -static const GLubyte ch226data[] = { -0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch226 = {5,9,0,0,5,ch226data}; - -/* char: 0xe1 */ - -static const GLubyte ch225data[] = { -0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch225 = {5,9,0,0,5,ch225data}; - -/* char: 0xe0 */ - -static const GLubyte ch224data[] = { -0x68,0x90,0x90,0x70,0x10,0xe0,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch224 = {5,9,0,0,5,ch224data}; - -/* char: 0xdf */ - -static const GLubyte ch223data[] = { -0xa0,0x90,0x90,0x90,0xa0,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch223 = {4,8,0,0,5,ch223data}; - -/* char: 0xde */ - -static const GLubyte ch222data[] = { -0x80,0x80,0xf0,0x88,0x88,0xf0,0x80,0x80, -}; - -static const BitmapCharRec ch222 = {5,8,-1,0,7,ch222data}; - -/* char: 0xdd */ - -static const GLubyte ch221data[] = { -0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch221 = {7,11,0,0,7,ch221data}; - -/* char: 0xdc */ - -static const GLubyte ch220data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, -}; - -static const BitmapCharRec ch220 = {6,10,-1,0,8,ch220data}; - -/* char: 0xdb */ - -static const GLubyte ch219data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, -}; - -static const BitmapCharRec ch219 = {6,11,-1,0,8,ch219data}; - -/* char: 0xda */ - -static const GLubyte ch218data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch218 = {6,11,-1,0,8,ch218data}; - -/* char: 0xd9 */ - -static const GLubyte ch217data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch217 = {6,11,-1,0,8,ch217data}; - -/* char: 0xd8 */ - -static const GLubyte ch216data[] = { -0x80,0x78,0xc4,0xa4,0xa4,0x94,0x94,0x8c,0x78,0x4, -}; - -static const BitmapCharRec ch216 = {6,10,-1,1,8,ch216data}; - -/* char: 0xd7 */ - -static const GLubyte ch215data[] = { -0x88,0x50,0x20,0x50,0x88, -}; - -static const BitmapCharRec ch215 = {5,5,0,-1,6,ch215data}; - -/* char: 0xd6 */ - -static const GLubyte ch214data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x48, -}; - -static const BitmapCharRec ch214 = {6,10,-1,0,8,ch214data}; - -/* char: 0xd5 */ - -static const GLubyte ch213data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch213 = {6,11,-1,0,8,ch213data}; - -/* char: 0xd4 */ - -static const GLubyte ch212data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x28,0x10, -}; - -static const BitmapCharRec ch212 = {6,11,-1,0,8,ch212data}; - -/* char: 0xd3 */ - -static const GLubyte ch211data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch211 = {6,11,-1,0,8,ch211data}; - -/* char: 0xd2 */ - -static const GLubyte ch210data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch210 = {6,11,-1,0,8,ch210data}; - -/* char: 0xd1 */ - -static const GLubyte ch209data[] = { -0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch209 = {6,11,-1,0,8,ch209data}; - -/* char: 0xd0 */ - -static const GLubyte ch208data[] = { -0x78,0x44,0x42,0x42,0xf2,0x42,0x44,0x78, -}; - -static const BitmapCharRec ch208 = {7,8,0,0,8,ch208data}; - -/* char: 0xcf */ - -static const GLubyte ch207data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, -}; - -static const BitmapCharRec ch207 = {3,10,0,0,3,ch207data}; - -/* char: 0xce */ - -static const GLubyte ch206data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, -}; - -static const BitmapCharRec ch206 = {3,11,0,0,3,ch206data}; - -/* char: 0xcd */ - -static const GLubyte ch205data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, -}; - -static const BitmapCharRec ch205 = {2,11,-1,0,3,ch205data}; - -/* char: 0xcc */ - -static const GLubyte ch204data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, -}; - -static const BitmapCharRec ch204 = {2,11,0,0,3,ch204data}; - -/* char: 0xcb */ - -static const GLubyte ch203data[] = { -0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x50, -}; - -static const BitmapCharRec ch203 = {5,10,-1,0,7,ch203data}; - -/* char: 0xca */ - -static const GLubyte ch202data[] = { -0xf8,0x80,0x80,0xf8,0x80,0x80,0x80,0xf8,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch202 = {5,11,-1,0,7,ch202data}; - -/* char: 0xc9 */ - -static const GLubyte ch201data[] = { -0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch201 = {5,11,-1,0,7,ch201data}; - -/* char: 0xc8 */ - -static const GLubyte ch200data[] = { -0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch200 = {5,11,-1,0,7,ch200data}; - -/* char: 0xc7 */ - -static const GLubyte ch199data[] = { -0x30,0x10,0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch199 = {6,10,-1,2,8,ch199data}; - -/* char: 0xc6 */ - -static const GLubyte ch198data[] = { -0x8f,0x80,0x88,0x0,0x78,0x0,0x48,0x0,0x2f,0x80,0x28,0x0,0x18,0x0,0x1f,0x80, -}; - -static const BitmapCharRec ch198 = {9,8,0,0,10,ch198data}; - -/* char: 0xc5 */ - -static const GLubyte ch197data[] = { -0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x10,0x28,0x10, -}; - -static const BitmapCharRec ch197 = {7,11,0,0,7,ch197data}; - -/* char: 0xc4 */ - -static const GLubyte ch196data[] = { -0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28, -}; - -static const BitmapCharRec ch196 = {7,10,0,0,7,ch196data}; - -/* char: 0xc3 */ - -static const GLubyte ch195data[] = { -0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x14, -}; - -static const BitmapCharRec ch195 = {7,11,0,0,7,ch195data}; - -/* char: 0xc2 */ - -static const GLubyte ch194data[] = { -0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x28,0x10, -}; - -static const BitmapCharRec ch194 = {7,11,0,0,7,ch194data}; - -/* char: 0xc1 */ - -static const GLubyte ch193data[] = { -0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch193 = {7,11,0,0,7,ch193data}; - -/* char: 0xc0 */ - -static const GLubyte ch192data[] = { -0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch192 = {7,11,0,0,7,ch192data}; - -/* char: 0xbf */ - -static const GLubyte ch191data[] = { -0x60,0x90,0x80,0x40,0x20,0x20,0x0,0x20, -}; - -static const BitmapCharRec ch191 = {4,8,-1,2,6,ch191data}; - -/* char: 0xbe */ - -static const GLubyte ch190data[] = { -0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0xc8,0x0,0x24,0x0,0x44,0x0,0xe2,0x0, -}; - -static const BitmapCharRec ch190 = {9,8,0,0,9,ch190data}; - -/* char: 0xbd */ - -static const GLubyte ch189data[] = { -0x27,0x12,0x15,0xb,0x48,0x44,0xc4,0x42, -}; - -static const BitmapCharRec ch189 = {8,8,0,0,9,ch189data}; - -/* char: 0xbc */ - -static const GLubyte ch188data[] = { -0x21,0x0,0x17,0x80,0x13,0x0,0x9,0x0,0x48,0x0,0x44,0x0,0xc4,0x0,0x42,0x0, -}; - -static const BitmapCharRec ch188 = {9,8,0,0,9,ch188data}; - -/* char: 0xbb */ - -static const GLubyte ch187data[] = { -0xa0,0x50,0x28,0x50,0xa0, -}; - -static const BitmapCharRec ch187 = {5,5,0,0,6,ch187data}; - -/* char: 0xba */ - -static const GLubyte ch186data[] = { -0xe0,0x0,0xe0,0xa0,0xe0, -}; - -static const BitmapCharRec ch186 = {3,5,0,-3,4,ch186data}; - -/* char: 0xb9 */ - -static const GLubyte ch185data[] = { -0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch185 = {2,4,0,-3,3,ch185data}; - -/* char: 0xb8 */ - -static const GLubyte ch184data[] = { -0xc0,0x40, -}; - -static const BitmapCharRec ch184 = {2,2,0,2,3,ch184data}; - -/* char: 0xb7 */ - -static const GLubyte ch183data[] = { -0xc0, -}; - -static const BitmapCharRec ch183 = {2,1,0,-3,3,ch183data}; - -/* char: 0xb6 */ - -static const GLubyte ch182data[] = { -0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x7c, -}; - -static const BitmapCharRec ch182 = {6,10,0,2,6,ch182data}; - -/* char: 0xb5 */ - -static const GLubyte ch181data[] = { -0x80,0x80,0xf0,0x90,0x90,0x90,0x90,0x90, -}; - -static const BitmapCharRec ch181 = {4,8,0,2,5,ch181data}; - -/* char: 0xb4 */ - -static const GLubyte ch180data[] = { -0x80,0x40, -}; - -static const BitmapCharRec ch180 = {2,2,0,-6,3,ch180data}; - -/* char: 0xb3 */ - -static const GLubyte ch179data[] = { -0xc0,0x20,0x40,0xe0, -}; - -static const BitmapCharRec ch179 = {3,4,0,-3,3,ch179data}; - -/* char: 0xb2 */ - -static const GLubyte ch178data[] = { -0xe0,0x40,0xa0,0x60, -}; - -static const BitmapCharRec ch178 = {3,4,0,-3,3,ch178data}; - -/* char: 0xb1 */ - -static const GLubyte ch177data[] = { -0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, -}; - -static const BitmapCharRec ch177 = {5,7,0,0,6,ch177data}; - -/* char: 0xb0 */ - -static const GLubyte ch176data[] = { -0x60,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch176 = {4,4,0,-3,4,ch176data}; - -/* char: 0xaf */ - -static const GLubyte ch175data[] = { -0xe0, -}; - -static const BitmapCharRec ch175 = {3,1,0,-7,3,ch175data}; - -/* char: 0xae */ - -static const GLubyte ch174data[] = { -0x38,0x44,0xaa,0xb2,0xba,0x44,0x38, -}; - -static const BitmapCharRec ch174 = {7,7,-1,0,9,ch174data}; - -/* char: 0xad */ - -static const GLubyte ch173data[] = { -0xe0, -}; - -static const BitmapCharRec ch173 = {3,1,0,-3,4,ch173data}; - -/* char: 0xac */ - -static const GLubyte ch172data[] = { -0x8,0x8,0xf8, -}; - -static const BitmapCharRec ch172 = {5,3,-1,-2,7,ch172data}; - -/* char: 0xab */ - -static const GLubyte ch171data[] = { -0x28,0x50,0xa0,0x50,0x28, -}; - -static const BitmapCharRec ch171 = {5,5,0,0,6,ch171data}; - -/* char: 0xaa */ - -static const GLubyte ch170data[] = { -0xe0,0x0,0xa0,0x20,0xe0, -}; - -static const BitmapCharRec ch170 = {3,5,0,-3,4,ch170data}; - -/* char: 0xa9 */ - -static const GLubyte ch169data[] = { -0x38,0x44,0x9a,0xa2,0x9a,0x44,0x38, -}; - -static const BitmapCharRec ch169 = {7,7,-1,0,9,ch169data}; - -/* char: 0xa8 */ - -static const GLubyte ch168data[] = { -0xa0, -}; - -static const BitmapCharRec ch168 = {3,1,0,-7,3,ch168data}; - -/* char: 0xa7 */ - -static const GLubyte ch167data[] = { -0x70,0x88,0x18,0x70,0xc8,0x98,0x70,0xc0,0x88,0x70, -}; - -static const BitmapCharRec ch167 = {5,10,0,2,6,ch167data}; - -/* char: 0xa6 */ - -static const GLubyte ch166data[] = { -0x80,0x80,0x80,0x80,0x0,0x0,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch166 = {1,10,-1,2,3,ch166data}; - -/* char: 0xa5 */ - -static const GLubyte ch165data[] = { -0x20,0xf8,0x20,0xf8,0x50,0x50,0x88,0x88, -}; - -static const BitmapCharRec ch165 = {5,8,0,0,6,ch165data}; - -/* char: 0xa4 */ - -static const GLubyte ch164data[] = { -0x90,0x60,0x90,0x90,0x60,0x90, -}; - -static const BitmapCharRec ch164 = {4,6,0,-1,5,ch164data}; - -/* char: 0xa3 */ - -static const GLubyte ch163data[] = { -0xb0,0x48,0x40,0x40,0xe0,0x40,0x48,0x30, -}; - -static const BitmapCharRec ch163 = {5,8,0,0,6,ch163data}; - -/* char: 0xa2 */ - -static const GLubyte ch162data[] = { -0x40,0x70,0xa8,0xa0,0xa0,0xa8,0x70,0x10, -}; - -static const BitmapCharRec ch162 = {5,8,0,1,6,ch162data}; - -/* char: 0xa1 */ - -static const GLubyte ch161data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, -}; - -static const BitmapCharRec ch161 = {1,8,-1,2,3,ch161data}; - -/* char: 0xa0 */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch160data[] = { 0x0 }; -static const BitmapCharRec ch160 = {1,1,0,0,3,ch160data}; -#else -static const BitmapCharRec ch160 = {0,0,0,0,3,0}; -#endif - -/* char: 0x7e '~' */ - -static const GLubyte ch126data[] = { -0x98,0x64, -}; - -static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; - -/* char: 0x7d '}' */ - -static const GLubyte ch125data[] = { -0x80,0x40,0x40,0x40,0x40,0x20,0x40,0x40,0x40,0x80, -}; - -static const BitmapCharRec ch125 = {3,10,0,2,3,ch125data}; - -/* char: 0x7c '|' */ - -static const GLubyte ch124data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch124 = {1,10,-1,2,3,ch124data}; - -/* char: 0x7b '{' */ - -static const GLubyte ch123data[] = { -0x20,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x20, -}; - -static const BitmapCharRec ch123 = {3,10,0,2,3,ch123data}; - -/* char: 0x7a 'z' */ - -static const GLubyte ch122data[] = { -0xf0,0x80,0x40,0x20,0x10,0xf0, -}; - -static const BitmapCharRec ch122 = {4,6,0,0,5,ch122data}; - -/* char: 0x79 'y' */ - -static const GLubyte ch121data[] = { -0x80,0x40,0x40,0x60,0xa0,0xa0,0x90,0x90, -}; - -static const BitmapCharRec ch121 = {4,8,0,2,5,ch121data}; - -/* char: 0x78 'x' */ - -static const GLubyte ch120data[] = { -0x88,0x88,0x50,0x20,0x50,0x88, -}; - -static const BitmapCharRec ch120 = {5,6,0,0,6,ch120data}; - -/* char: 0x77 'w' */ - -static const GLubyte ch119data[] = { -0x28,0x28,0x54,0x54,0x92,0x92, -}; - -static const BitmapCharRec ch119 = {7,6,0,0,8,ch119data}; - -/* char: 0x76 'v' */ - -static const GLubyte ch118data[] = { -0x20,0x20,0x50,0x50,0x88,0x88, -}; - -static const BitmapCharRec ch118 = {5,6,0,0,6,ch118data}; - -/* char: 0x75 'u' */ - -static const GLubyte ch117data[] = { -0x70,0x90,0x90,0x90,0x90,0x90, -}; - -static const BitmapCharRec ch117 = {4,6,0,0,5,ch117data}; - -/* char: 0x74 't' */ - -static const GLubyte ch116data[] = { -0x60,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, -}; - -static const BitmapCharRec ch116 = {3,8,0,0,4,ch116data}; - -/* char: 0x73 's' */ - -static const GLubyte ch115data[] = { -0x60,0x90,0x10,0x60,0x90,0x60, -}; - -static const BitmapCharRec ch115 = {4,6,0,0,5,ch115data}; - -/* char: 0x72 'r' */ - -static const GLubyte ch114data[] = { -0x80,0x80,0x80,0x80,0xc0,0xa0, -}; - -static const BitmapCharRec ch114 = {3,6,0,0,4,ch114data}; - -/* char: 0x71 'q' */ - -static const GLubyte ch113data[] = { -0x8,0x8,0x68,0x98,0x88,0x88,0x98,0x68, -}; - -static const BitmapCharRec ch113 = {5,8,0,2,6,ch113data}; - -/* char: 0x70 'p' */ - -static const GLubyte ch112data[] = { -0x80,0x80,0xb0,0xc8,0x88,0x88,0xc8,0xb0, -}; - -static const BitmapCharRec ch112 = {5,8,0,2,6,ch112data}; - -/* char: 0x6f 'o' */ - -static const GLubyte ch111data[] = { -0x70,0x88,0x88,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch111 = {5,6,0,0,6,ch111data}; - -/* char: 0x6e 'n' */ - -static const GLubyte ch110data[] = { -0x88,0x88,0x88,0x88,0xc8,0xb0, -}; - -static const BitmapCharRec ch110 = {5,6,0,0,6,ch110data}; - -/* char: 0x6d 'm' */ - -static const GLubyte ch109data[] = { -0x92,0x92,0x92,0x92,0x92,0xec, -}; - -static const BitmapCharRec ch109 = {7,6,0,0,8,ch109data}; - -/* char: 0x6c 'l' */ - -static const GLubyte ch108data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch108 = {1,8,0,0,2,ch108data}; - -/* char: 0x6b 'k' */ - -static const GLubyte ch107data[] = { -0x90,0x90,0xa0,0xc0,0xa0,0x90,0x80,0x80, -}; - -static const BitmapCharRec ch107 = {4,8,0,0,5,ch107data}; - -/* char: 0x6a 'j' */ - -static const GLubyte ch106data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, -}; - -static const BitmapCharRec ch106 = {1,9,0,1,2,ch106data}; - -/* char: 0x69 'i' */ - -static const GLubyte ch105data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, -}; - -static const BitmapCharRec ch105 = {1,8,0,0,2,ch105data}; - -/* char: 0x68 'h' */ - -static const GLubyte ch104data[] = { -0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, -}; - -static const BitmapCharRec ch104 = {5,8,0,0,6,ch104data}; - -/* char: 0x67 'g' */ - -static const GLubyte ch103data[] = { -0x70,0x8,0x68,0x98,0x88,0x88,0x98,0x68, -}; - -static const BitmapCharRec ch103 = {5,8,0,2,6,ch103data}; - -/* char: 0x66 'f' */ - -static const GLubyte ch102data[] = { -0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, -}; - -static const BitmapCharRec ch102 = {4,8,0,0,4,ch102data}; - -/* char: 0x65 'e' */ - -static const GLubyte ch101data[] = { -0x60,0x90,0x80,0xf0,0x90,0x60, -}; - -static const BitmapCharRec ch101 = {4,6,0,0,5,ch101data}; - -/* char: 0x64 'd' */ - -static const GLubyte ch100data[] = { -0x68,0x98,0x88,0x88,0x98,0x68,0x8,0x8, -}; - -static const BitmapCharRec ch100 = {5,8,0,0,6,ch100data}; - -/* char: 0x63 'c' */ - -static const GLubyte ch99data[] = { -0x60,0x90,0x80,0x80,0x90,0x60, -}; - -static const BitmapCharRec ch99 = {4,6,0,0,5,ch99data}; - -/* char: 0x62 'b' */ - -static const GLubyte ch98data[] = { -0xb0,0xc8,0x88,0x88,0xc8,0xb0,0x80,0x80, -}; - -static const BitmapCharRec ch98 = {5,8,0,0,6,ch98data}; - -/* char: 0x61 'a' */ - -static const GLubyte ch97data[] = { -0x68,0x90,0x90,0x70,0x10,0xe0, -}; - -static const BitmapCharRec ch97 = {5,6,0,0,5,ch97data}; - -/* char: 0x60 '`' */ - -static const GLubyte ch96data[] = { -0x80,0x80,0x40, -}; - -static const BitmapCharRec ch96 = {2,3,0,-5,3,ch96data}; - -/* char: 0x5f '_' */ - -static const GLubyte ch95data[] = { -0xfc, -}; - -static const BitmapCharRec ch95 = {6,1,0,2,6,ch95data}; - -/* char: 0x5e '^' */ - -static const GLubyte ch94data[] = { -0x88,0x50,0x50,0x20,0x20, -}; - -static const BitmapCharRec ch94 = {5,5,0,-3,6,ch94data}; - -/* char: 0x5d ']' */ - -static const GLubyte ch93data[] = { -0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, -}; - -static const BitmapCharRec ch93 = {2,10,0,2,3,ch93data}; - -/* char: 0x5c '\' */ - -static const GLubyte ch92data[] = { -0x20,0x20,0x40,0x40,0x40,0x40,0x80,0x80, -}; - -static const BitmapCharRec ch92 = {3,8,0,0,3,ch92data}; - -/* char: 0x5b '[' */ - -static const GLubyte ch91data[] = { -0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, -}; - -static const BitmapCharRec ch91 = {2,10,-1,2,3,ch91data}; - -/* char: 0x5a 'Z' */ - -static const GLubyte ch90data[] = { -0xf8,0x80,0x40,0x20,0x20,0x10,0x8,0xf8, -}; - -static const BitmapCharRec ch90 = {5,8,-1,0,7,ch90data}; - -/* char: 0x59 'Y' */ - -static const GLubyte ch89data[] = { -0x10,0x10,0x10,0x28,0x28,0x44,0x44,0x82, -}; - -static const BitmapCharRec ch89 = {7,8,0,0,7,ch89data}; - -/* char: 0x58 'X' */ - -static const GLubyte ch88data[] = { -0x88,0x88,0x50,0x50,0x20,0x50,0x88,0x88, -}; - -static const BitmapCharRec ch88 = {5,8,-1,0,7,ch88data}; - -/* char: 0x57 'W' */ - -static const GLubyte ch87data[] = { -0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, -}; - -static const BitmapCharRec ch87 = {9,8,0,0,9,ch87data}; - -/* char: 0x56 'V' */ - -static const GLubyte ch86data[] = { -0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch86 = {7,8,0,0,7,ch86data}; - -/* char: 0x55 'U' */ - -static const GLubyte ch85data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch85 = {6,8,-1,0,8,ch85data}; - -/* char: 0x54 'T' */ - -static const GLubyte ch84data[] = { -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xf8, -}; - -static const BitmapCharRec ch84 = {5,8,0,0,5,ch84data}; - -/* char: 0x53 'S' */ - -static const GLubyte ch83data[] = { -0x70,0x88,0x88,0x8,0x70,0x80,0x88,0x70, -}; - -static const BitmapCharRec ch83 = {5,8,-1,0,7,ch83data}; - -/* char: 0x52 'R' */ - -static const GLubyte ch82data[] = { -0x88,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, -}; - -static const BitmapCharRec ch82 = {5,8,-1,0,7,ch82data}; - -/* char: 0x51 'Q' */ - -static const GLubyte ch81data[] = { -0x2,0x7c,0x8c,0x94,0x84,0x84,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch81 = {7,9,-1,1,8,ch81data}; - -/* char: 0x50 'P' */ - -static const GLubyte ch80data[] = { -0x80,0x80,0x80,0x80,0xf0,0x88,0x88,0xf0, -}; - -static const BitmapCharRec ch80 = {5,8,-1,0,7,ch80data}; - -/* char: 0x4f 'O' */ - -static const GLubyte ch79data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x78, -}; - -static const BitmapCharRec ch79 = {6,8,-1,0,8,ch79data}; - -/* char: 0x4e 'N' */ - -static const GLubyte ch78data[] = { -0x8c,0x8c,0x94,0x94,0xa4,0xa4,0xc4,0xc4, -}; - -static const BitmapCharRec ch78 = {6,8,-1,0,8,ch78data}; - -/* char: 0x4d 'M' */ - -static const GLubyte ch77data[] = { -0x92,0x92,0x92,0xaa,0xaa,0xc6,0xc6,0x82, -}; - -static const BitmapCharRec ch77 = {7,8,-1,0,9,ch77data}; - -/* char: 0x4c 'L' */ - -static const GLubyte ch76data[] = { -0xf0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch76 = {4,8,-1,0,6,ch76data}; - -/* char: 0x4b 'K' */ - -static const GLubyte ch75data[] = { -0x88,0x88,0x90,0x90,0xe0,0xa0,0x90,0x88, -}; - -static const BitmapCharRec ch75 = {5,8,-1,0,7,ch75data}; - -/* char: 0x4a 'J' */ - -static const GLubyte ch74data[] = { -0x60,0x90,0x10,0x10,0x10,0x10,0x10,0x10, -}; - -static const BitmapCharRec ch74 = {4,8,0,0,5,ch74data}; - -/* char: 0x49 'I' */ - -static const GLubyte ch73data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch73 = {1,8,-1,0,3,ch73data}; - -/* char: 0x48 'H' */ - -static const GLubyte ch72data[] = { -0x84,0x84,0x84,0x84,0xfc,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch72 = {6,8,-1,0,8,ch72data}; - -/* char: 0x47 'G' */ - -static const GLubyte ch71data[] = { -0x74,0x8c,0x84,0x8c,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch71 = {6,8,-1,0,8,ch71data}; - -/* char: 0x46 'F' */ - -static const GLubyte ch70data[] = { -0x80,0x80,0x80,0x80,0xf0,0x80,0x80,0xf8, -}; - -static const BitmapCharRec ch70 = {5,8,-1,0,6,ch70data}; - -/* char: 0x45 'E' */ - -static const GLubyte ch69data[] = { -0xf8,0x80,0x80,0x80,0xf8,0x80,0x80,0xf8, -}; - -static const BitmapCharRec ch69 = {5,8,-1,0,7,ch69data}; - -/* char: 0x44 'D' */ - -static const GLubyte ch68data[] = { -0xf0,0x88,0x84,0x84,0x84,0x84,0x88,0xf0, -}; - -static const BitmapCharRec ch68 = {6,8,-1,0,8,ch68data}; - -/* char: 0x43 'C' */ - -static const GLubyte ch67data[] = { -0x78,0x84,0x80,0x80,0x80,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch67 = {6,8,-1,0,8,ch67data}; - -/* char: 0x42 'B' */ - -static const GLubyte ch66data[] = { -0xf0,0x88,0x88,0x88,0xf0,0x88,0x88,0xf0, -}; - -static const BitmapCharRec ch66 = {5,8,-1,0,7,ch66data}; - -/* char: 0x41 'A' */ - -static const GLubyte ch65data[] = { -0x82,0x82,0x7c,0x44,0x28,0x28,0x10,0x10, -}; - -static const BitmapCharRec ch65 = {7,8,0,0,7,ch65data}; - -/* char: 0x40 '@' */ - -static const GLubyte ch64data[] = { -0x3e,0x0,0x40,0x0,0x9b,0x0,0xa4,0x80,0xa4,0x80,0xa2,0x40,0x92,0x40,0x4d,0x40, -0x20,0x80,0x1f,0x0, -}; - -static const BitmapCharRec ch64 = {10,10,0,2,11,ch64data}; - -/* char: 0x3f '?' */ - -static const GLubyte ch63data[] = { -0x40,0x0,0x40,0x40,0x20,0x10,0x90,0x60, -}; - -static const BitmapCharRec ch63 = {4,8,-1,0,6,ch63data}; - -/* char: 0x3e '>' */ - -static const GLubyte ch62data[] = { -0x80,0x40,0x20,0x40,0x80, -}; - -static const BitmapCharRec ch62 = {3,5,-1,-1,6,ch62data}; - -/* char: 0x3d '=' */ - -static const GLubyte ch61data[] = { -0xf0,0x0,0xf0, -}; - -static const BitmapCharRec ch61 = {4,3,0,-2,5,ch61data}; - -/* char: 0x3c '<' */ - -static const GLubyte ch60data[] = { -0x20,0x40,0x80,0x40,0x20, -}; - -static const BitmapCharRec ch60 = {3,5,-1,-1,6,ch60data}; - -/* char: 0x3b ';' */ - -static const GLubyte ch59data[] = { -0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, -}; - -static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; - -/* char: 0x3a ':' */ - -static const GLubyte ch58data[] = { -0x80,0x0,0x0,0x0,0x0,0x80, -}; - -static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; - -/* char: 0x39 '9' */ - -static const GLubyte ch57data[] = { -0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch57 = {5,8,0,0,6,ch57data}; - -/* char: 0x38 '8' */ - -static const GLubyte ch56data[] = { -0x70,0x88,0x88,0x88,0x70,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch56 = {5,8,0,0,6,ch56data}; - -/* char: 0x37 '7' */ - -static const GLubyte ch55data[] = { -0x40,0x40,0x20,0x20,0x10,0x10,0x8,0xf8, -}; - -static const BitmapCharRec ch55 = {5,8,0,0,6,ch55data}; - -/* char: 0x36 '6' */ - -static const GLubyte ch54data[] = { -0x70,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, -}; - -static const BitmapCharRec ch54 = {5,8,0,0,6,ch54data}; - -/* char: 0x35 '5' */ - -static const GLubyte ch53data[] = { -0x70,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, -}; - -static const BitmapCharRec ch53 = {5,8,0,0,6,ch53data}; - -/* char: 0x34 '4' */ - -static const GLubyte ch52data[] = { -0x10,0x10,0xf8,0x90,0x50,0x50,0x30,0x10, -}; - -static const BitmapCharRec ch52 = {5,8,0,0,6,ch52data}; - -/* char: 0x33 '3' */ - -static const GLubyte ch51data[] = { -0x70,0x88,0x8,0x8,0x30,0x8,0x88,0x70, -}; - -static const BitmapCharRec ch51 = {5,8,0,0,6,ch51data}; - -/* char: 0x32 '2' */ - -static const GLubyte ch50data[] = { -0xf8,0x80,0x40,0x30,0x8,0x8,0x88,0x70, -}; - -static const BitmapCharRec ch50 = {5,8,0,0,6,ch50data}; - -/* char: 0x31 '1' */ - -static const GLubyte ch49data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch49 = {2,8,-1,0,6,ch49data}; - -/* char: 0x30 '0' */ - -static const GLubyte ch48data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch48 = {5,8,0,0,6,ch48data}; - -/* char: 0x2f '/' */ - -static const GLubyte ch47data[] = { -0x80,0x80,0x40,0x40,0x40,0x40,0x20,0x20, -}; - -static const BitmapCharRec ch47 = {3,8,0,0,3,ch47data}; - -/* char: 0x2e '.' */ - -static const GLubyte ch46data[] = { -0x80, -}; - -static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; - -/* char: 0x2d '-' */ - -static const GLubyte ch45data[] = { -0xf8, -}; - -static const BitmapCharRec ch45 = {5,1,-1,-3,7,ch45data}; - -/* char: 0x2c ',' */ - -static const GLubyte ch44data[] = { -0x80,0x40,0x40, -}; - -static const BitmapCharRec ch44 = {2,3,0,2,3,ch44data}; - -/* char: 0x2b '+' */ - -static const GLubyte ch43data[] = { -0x20,0x20,0xf8,0x20,0x20, -}; - -static const BitmapCharRec ch43 = {5,5,0,-1,6,ch43data}; - -/* char: 0x2a '*' */ - -static const GLubyte ch42data[] = { -0xa0,0x40,0xa0, -}; - -static const BitmapCharRec ch42 = {3,3,0,-5,4,ch42data}; - -/* char: 0x29 ')' */ - -static const GLubyte ch41data[] = { -0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x40,0x40,0x80, -}; - -static const BitmapCharRec ch41 = {3,10,-1,2,4,ch41data}; - -/* char: 0x28 '(' */ - -static const GLubyte ch40data[] = { -0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x40,0x40,0x20, -}; - -static const BitmapCharRec ch40 = {3,10,0,2,4,ch40data}; - -/* char: 0x27 ''' */ - -static const GLubyte ch39data[] = { -0x80,0x40,0x40, -}; - -static const BitmapCharRec ch39 = {2,3,-1,-5,3,ch39data}; - -/* char: 0x26 '&' */ - -static const GLubyte ch38data[] = { -0x64,0x98,0x98,0xa4,0x60,0x50,0x50,0x20, -}; - -static const BitmapCharRec ch38 = {6,8,-1,0,8,ch38data}; - -/* char: 0x25 '%' */ - -static const GLubyte ch37data[] = { -0x26,0x29,0x16,0x10,0x8,0x68,0x94,0x64, -}; - -static const BitmapCharRec ch37 = {8,8,0,0,9,ch37data}; - -/* char: 0x24 '$' */ - -static const GLubyte ch36data[] = { -0x20,0x70,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, -}; - -static const BitmapCharRec ch36 = {5,9,0,1,6,ch36data}; - -/* char: 0x23 '#' */ - -static const GLubyte ch35data[] = { -0x50,0x50,0xf8,0x28,0x7c,0x28,0x28, -}; - -static const BitmapCharRec ch35 = {6,7,0,0,6,ch35data}; - -/* char: 0x22 '"' */ - -static const GLubyte ch34data[] = { -0xa0,0xa0, -}; - -static const BitmapCharRec ch34 = {3,2,-1,-6,4,ch34data}; - -/* char: 0x21 '!' */ - -static const GLubyte ch33data[] = { -0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch33 = {1,8,-1,0,3,ch33data}; - -/* char: 0x20 ' ' */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch32data[] = { 0x0 }; -static const BitmapCharRec ch32 = {0,0,0,0,3,ch32data}; -#else -static const BitmapCharRec ch32 = {0,0,0,0,3,0}; -#endif - -static const BitmapCharRec * const chars[] = { -&ch32, -&ch33, -&ch34, -&ch35, -&ch36, -&ch37, -&ch38, -&ch39, -&ch40, -&ch41, -&ch42, -&ch43, -&ch44, -&ch45, -&ch46, -&ch47, -&ch48, -&ch49, -&ch50, -&ch51, -&ch52, -&ch53, -&ch54, -&ch55, -&ch56, -&ch57, -&ch58, -&ch59, -&ch60, -&ch61, -&ch62, -&ch63, -&ch64, -&ch65, -&ch66, -&ch67, -&ch68, -&ch69, -&ch70, -&ch71, -&ch72, -&ch73, -&ch74, -&ch75, -&ch76, -&ch77, -&ch78, -&ch79, -&ch80, -&ch81, -&ch82, -&ch83, -&ch84, -&ch85, -&ch86, -&ch87, -&ch88, -&ch89, -&ch90, -&ch91, -&ch92, -&ch93, -&ch94, -&ch95, -&ch96, -&ch97, -&ch98, -&ch99, -&ch100, -&ch101, -&ch102, -&ch103, -&ch104, -&ch105, -&ch106, -&ch107, -&ch108, -&ch109, -&ch110, -&ch111, -&ch112, -&ch113, -&ch114, -&ch115, -&ch116, -&ch117, -&ch118, -&ch119, -&ch120, -&ch121, -&ch122, -&ch123, -&ch124, -&ch125, -&ch126, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -&ch160, -&ch161, -&ch162, -&ch163, -&ch164, -&ch165, -&ch166, -&ch167, -&ch168, -&ch169, -&ch170, -&ch171, -&ch172, -&ch173, -&ch174, -&ch175, -&ch176, -&ch177, -&ch178, -&ch179, -&ch180, -&ch181, -&ch182, -&ch183, -&ch184, -&ch185, -&ch186, -&ch187, -&ch188, -&ch189, -&ch190, -&ch191, -&ch192, -&ch193, -&ch194, -&ch195, -&ch196, -&ch197, -&ch198, -&ch199, -&ch200, -&ch201, -&ch202, -&ch203, -&ch204, -&ch205, -&ch206, -&ch207, -&ch208, -&ch209, -&ch210, -&ch211, -&ch212, -&ch213, -&ch214, -&ch215, -&ch216, -&ch217, -&ch218, -&ch219, -&ch220, -&ch221, -&ch222, -&ch223, -&ch224, -&ch225, -&ch226, -&ch227, -&ch228, -&ch229, -&ch230, -&ch231, -&ch232, -&ch233, -&ch234, -&ch235, -&ch236, -&ch237, -&ch238, -&ch239, -&ch240, -&ch241, -&ch242, -&ch243, -&ch244, -&ch245, -&ch246, -&ch247, -&ch248, -&ch249, -&ch250, -&ch251, -&ch252, -&ch253, -&ch254, -&ch255, -}; - -#if !defined(__IBMCPP__) -const -#endif -BitmapFontRec glutBitmapHelvetica10 = { -"-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1", -224, -32, -chars -}; - diff --git a/src/glut/os2/glut_hel12.cpp b/src/glut/os2/glut_hel12.cpp deleted file mode 100644 index f615fbb2f8..0000000000 --- a/src/glut/os2/glut_hel12.cpp +++ /dev/null @@ -1,1791 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#define glutBitmapHelvetica12 XXX -#include "glutbitmap.h" -#undef glutBitmapHelvetica12 - -/* char: 0xff */ - -static const GLubyte ch255data[] = { -0xc0,0x20,0x20,0x20,0x30,0x50,0x50,0x48,0x88,0x88,0x0,0x50, -}; - -static const BitmapCharRec ch255 = {5,12,-1,3,7,ch255data}; - -/* char: 0xfe */ - -static const GLubyte ch254data[] = { -0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, -}; - -static const BitmapCharRec ch254 = {5,12,-1,3,7,ch254data}; - -/* char: 0xfd */ - -static const GLubyte ch253data[] = { -0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch253 = {5,13,-1,3,7,ch253data}; - -/* char: 0xfc */ - -static const GLubyte ch252data[] = { -0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50, -}; - -static const BitmapCharRec ch252 = {5,9,-1,0,7,ch252data}; - -/* char: 0xfb */ - -static const GLubyte ch251data[] = { -0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch251 = {5,10,-1,0,7,ch251data}; - -/* char: 0xfa */ - -static const GLubyte ch250data[] = { -0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch250 = {5,10,-1,0,7,ch250data}; - -/* char: 0xf9 */ - -static const GLubyte ch249data[] = { -0x68,0x98,0x88,0x88,0x88,0x88,0x88,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch249 = {5,10,-1,0,7,ch249data}; - -/* char: 0xf8 */ - -static const GLubyte ch248data[] = { -0xb8,0x44,0x64,0x54,0x4c,0x44,0x3a, -}; - -static const BitmapCharRec ch248 = {7,7,0,0,7,ch248data}; - -/* char: 0xf7 */ - -static const GLubyte ch247data[] = { -0x20,0x0,0xf8,0x0,0x20, -}; - -static const BitmapCharRec ch247 = {5,5,-1,-1,7,ch247data}; - -/* char: 0xf6 */ - -static const GLubyte ch246data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50, -}; - -static const BitmapCharRec ch246 = {5,9,-1,0,7,ch246data}; - -/* char: 0xf5 */ - -static const GLubyte ch245data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch245 = {5,10,-1,0,7,ch245data}; - -/* char: 0xf4 */ - -static const GLubyte ch244data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch244 = {5,10,-1,0,7,ch244data}; - -/* char: 0xf3 */ - -static const GLubyte ch243data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch243 = {5,10,-1,0,7,ch243data}; - -/* char: 0xf2 */ - -static const GLubyte ch242data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x70,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch242 = {5,10,-1,0,7,ch242data}; - -/* char: 0xf1 */ - -static const GLubyte ch241data[] = { -0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch241 = {5,10,-1,0,7,ch241data}; - -/* char: 0xf0 */ - -static const GLubyte ch240data[] = { -0x70,0x88,0x88,0x88,0x88,0x78,0x8,0x50,0x30,0x68, -}; - -static const BitmapCharRec ch240 = {5,10,-1,0,7,ch240data}; - -/* char: 0xef */ - -static const GLubyte ch239data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, -}; - -static const BitmapCharRec ch239 = {3,9,0,0,3,ch239data}; - -/* char: 0xee */ - -static const GLubyte ch238data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, -}; - -static const BitmapCharRec ch238 = {3,10,0,0,3,ch238data}; - -/* char: 0xed */ - -static const GLubyte ch237data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, -}; - -static const BitmapCharRec ch237 = {2,10,-1,0,3,ch237data}; - -/* char: 0xec */ - -static const GLubyte ch236data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, -}; - -static const BitmapCharRec ch236 = {2,10,0,0,3,ch236data}; - -/* char: 0xeb */ - -static const GLubyte ch235data[] = { -0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50, -}; - -static const BitmapCharRec ch235 = {5,9,-1,0,7,ch235data}; - -/* char: 0xea */ - -static const GLubyte ch234data[] = { -0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch234 = {5,10,-1,0,7,ch234data}; - -/* char: 0xe9 */ - -static const GLubyte ch233data[] = { -0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch233 = {5,10,-1,0,7,ch233data}; - -/* char: 0xe8 */ - -static const GLubyte ch232data[] = { -0x70,0x88,0x80,0xf8,0x88,0x88,0x70,0x0,0x20,0x40, -}; - -static const BitmapCharRec ch232 = {5,10,-1,0,7,ch232data}; - -/* char: 0xe7 */ - -static const GLubyte ch231data[] = { -0x60,0x10,0x20,0x70,0x88,0x80,0x80,0x80,0x88,0x70, -}; - -static const BitmapCharRec ch231 = {5,10,-1,3,7,ch231data}; - -/* char: 0xe6 */ - -static const GLubyte ch230data[] = { -0x77,0x0,0x88,0x80,0x88,0x0,0x7f,0x80,0x8,0x80,0x88,0x80,0x77,0x0, -}; - -static const BitmapCharRec ch230 = {9,7,-1,0,11,ch230data}; - -/* char: 0xe5 */ - -static const GLubyte ch229data[] = { -0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x30,0x48,0x30, -}; - -static const BitmapCharRec ch229 = {6,10,-1,0,7,ch229data}; - -/* char: 0xe4 */ - -static const GLubyte ch228data[] = { -0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50, -}; - -static const BitmapCharRec ch228 = {6,9,-1,0,7,ch228data}; - -/* char: 0xe3 */ - -static const GLubyte ch227data[] = { -0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x28, -}; - -static const BitmapCharRec ch227 = {6,10,-1,0,7,ch227data}; - -/* char: 0xe2 */ - -static const GLubyte ch226data[] = { -0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x50,0x20, -}; - -static const BitmapCharRec ch226 = {6,10,-1,0,7,ch226data}; - -/* char: 0xe1 */ - -static const GLubyte ch225data[] = { -0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x20,0x10, -}; - -static const BitmapCharRec ch225 = {6,10,-1,0,7,ch225data}; - -/* char: 0xe0 */ - -static const GLubyte ch224data[] = { -0x74,0x88,0x88,0x78,0x8,0x88,0x70,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch224 = {6,10,-1,0,7,ch224data}; - -/* char: 0xdf */ - -static const GLubyte ch223data[] = { -0xb0,0x88,0x88,0x88,0xb0,0x88,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch223 = {5,9,-1,0,7,ch223data}; - -/* char: 0xde */ - -static const GLubyte ch222data[] = { -0x80,0x80,0xf8,0x84,0x84,0x84,0xf8,0x80,0x80, -}; - -static const BitmapCharRec ch222 = {6,9,-1,0,8,ch222data}; - -/* char: 0xdd */ - -static const GLubyte ch221data[] = { -0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch221 = {7,12,-1,0,9,ch221data}; - -/* char: 0xdc */ - -static const GLubyte ch220data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x48, -}; - -static const BitmapCharRec ch220 = {6,11,-1,0,8,ch220data}; - -/* char: 0xdb */ - -static const GLubyte ch219data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x28,0x10, -}; - -static const BitmapCharRec ch219 = {6,12,-1,0,8,ch219data}; - -/* char: 0xda */ - -static const GLubyte ch218data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch218 = {6,12,-1,0,8,ch218data}; - -/* char: 0xd9 */ - -static const GLubyte ch217data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch217 = {6,12,-1,0,8,ch217data}; - -/* char: 0xd8 */ - -static const GLubyte ch216data[] = { -0x80,0x0,0x5e,0x0,0x21,0x0,0x50,0x80,0x48,0x80,0x44,0x80,0x44,0x80,0x42,0x80, -0x21,0x0,0x1e,0x80,0x0,0x40, -}; - -static const BitmapCharRec ch216 = {10,11,0,1,10,ch216data}; - -/* char: 0xd7 */ - -static const GLubyte ch215data[] = { -0x88,0x50,0x20,0x50,0x88, -}; - -static const BitmapCharRec ch215 = {5,5,-1,-1,7,ch215data}; - -/* char: 0xd6 */ - -static const GLubyte ch214data[] = { -0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x24, -}; - -static const BitmapCharRec ch214 = {8,11,-1,0,10,ch214data}; - -/* char: 0xd5 */ - -static const GLubyte ch213data[] = { -0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x28,0x14, -}; - -static const BitmapCharRec ch213 = {8,12,-1,0,10,ch213data}; - -/* char: 0xd4 */ - -static const GLubyte ch212data[] = { -0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x14,0x8, -}; - -static const BitmapCharRec ch212 = {8,12,-1,0,10,ch212data}; - -/* char: 0xd3 */ - -static const GLubyte ch211data[] = { -0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x4, -}; - -static const BitmapCharRec ch211 = {8,12,-1,0,10,ch211data}; - -/* char: 0xd2 */ - -static const GLubyte ch210data[] = { -0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c,0x0,0x8,0x10, -}; - -static const BitmapCharRec ch210 = {8,12,-1,0,10,ch210data}; - -/* char: 0xd1 */ - -static const GLubyte ch209data[] = { -0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82,0x0,0x28,0x14, -}; - -static const BitmapCharRec ch209 = {7,12,-1,0,9,ch209data}; - -/* char: 0xd0 */ - -static const GLubyte ch208data[] = { -0x7c,0x42,0x41,0x41,0xf1,0x41,0x41,0x42,0x7c, -}; - -static const BitmapCharRec ch208 = {8,9,0,0,9,ch208data}; - -/* char: 0xcf */ - -static const GLubyte ch207data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0, -}; - -static const BitmapCharRec ch207 = {3,11,0,0,3,ch207data}; - -/* char: 0xce */ - -static const GLubyte ch206data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0xa0,0x40, -}; - -static const BitmapCharRec ch206 = {3,12,0,0,3,ch206data}; - -/* char: 0xcd */ - -static const GLubyte ch205data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80,0x40, -}; - -static const BitmapCharRec ch205 = {2,12,-1,0,3,ch205data}; - -/* char: 0xcc */ - -static const GLubyte ch204data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40,0x80, -}; - -static const BitmapCharRec ch204 = {2,12,0,0,3,ch204data}; - -/* char: 0xcb */ - -static const GLubyte ch203data[] = { -0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28, -}; - -static const BitmapCharRec ch203 = {6,11,-1,0,8,ch203data}; - -/* char: 0xca */ - -static const GLubyte ch202data[] = { -0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x28,0x10, -}; - -static const BitmapCharRec ch202 = {6,12,-1,0,8,ch202data}; - -/* char: 0xc9 */ - -static const GLubyte ch201data[] = { -0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch201 = {6,12,-1,0,8,ch201data}; - -/* char: 0xc8 */ - -static const GLubyte ch200data[] = { -0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch200 = {6,12,-1,0,8,ch200data}; - -/* char: 0xc7 */ - -static const GLubyte ch199data[] = { -0x30,0x8,0x8,0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, -}; - -static const BitmapCharRec ch199 = {7,12,-1,3,9,ch199data}; - -/* char: 0xc6 */ - -static const GLubyte ch198data[] = { -0x8f,0x80,0x88,0x0,0x88,0x0,0x78,0x0,0x4f,0x80,0x48,0x0,0x28,0x0,0x28,0x0, -0x1f,0x80, -}; - -static const BitmapCharRec ch198 = {9,9,-1,0,11,ch198data}; - -/* char: 0xc5 */ - -static const GLubyte ch197data[] = { -0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x10,0x28,0x10, -}; - -static const BitmapCharRec ch197 = {7,12,-1,0,9,ch197data}; - -/* char: 0xc4 */ - -static const GLubyte ch196data[] = { -0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28, -}; - -static const BitmapCharRec ch196 = {7,11,-1,0,9,ch196data}; - -/* char: 0xc3 */ - -static const GLubyte ch195data[] = { -0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x14, -}; - -static const BitmapCharRec ch195 = {7,12,-1,0,9,ch195data}; - -/* char: 0xc2 */ - -static const GLubyte ch194data[] = { -0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x28,0x10, -}; - -static const BitmapCharRec ch194 = {7,12,-1,0,9,ch194data}; - -/* char: 0xc1 */ - -static const GLubyte ch193data[] = { -0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x8, -}; - -static const BitmapCharRec ch193 = {7,12,-1,0,9,ch193data}; - -/* char: 0xc0 */ - -static const GLubyte ch192data[] = { -0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x10,0x10,0x0,0x10,0x20, -}; - -static const BitmapCharRec ch192 = {7,12,-1,0,9,ch192data}; - -/* char: 0xbf */ - -static const GLubyte ch191data[] = { -0x70,0x88,0x88,0x40,0x40,0x20,0x20,0x0,0x20, -}; - -static const BitmapCharRec ch191 = {5,9,-1,3,7,ch191data}; - -/* char: 0xbe */ - -static const GLubyte ch190data[] = { -0x21,0x0,0x17,0x80,0x15,0x0,0xb,0x0,0xc9,0x0,0x24,0x0,0x44,0x0,0x22,0x0, -0xe1,0x0, -}; - -static const BitmapCharRec ch190 = {9,9,0,0,10,ch190data}; - -/* char: 0xbd */ - -static const GLubyte ch189data[] = { -0x47,0x80,0x22,0x0,0x11,0x0,0x14,0x80,0x4b,0x0,0x48,0x0,0x44,0x0,0xc2,0x0, -0x41,0x0, -}; - -static const BitmapCharRec ch189 = {9,9,0,0,10,ch189data}; - -/* char: 0xbc */ - -static const GLubyte ch188data[] = { -0x41,0x0,0x27,0x80,0x15,0x0,0x13,0x0,0x49,0x0,0x44,0x0,0x44,0x0,0xc2,0x0, -0x41,0x0, -}; - -static const BitmapCharRec ch188 = {9,9,0,0,10,ch188data}; - -/* char: 0xbb */ - -static const GLubyte ch187data[] = { -0xa0,0x50,0x28,0x50,0xa0, -}; - -static const BitmapCharRec ch187 = {5,5,-1,-1,7,ch187data}; - -/* char: 0xba */ - -static const GLubyte ch186data[] = { -0xe0,0x0,0xe0,0xa0,0xe0, -}; - -static const BitmapCharRec ch186 = {3,5,-1,-4,5,ch186data}; - -/* char: 0xb9 */ - -static const GLubyte ch185data[] = { -0x40,0x40,0x40,0xc0,0x40, -}; - -static const BitmapCharRec ch185 = {2,5,-1,-3,4,ch185data}; - -/* char: 0xb8 */ - -static const GLubyte ch184data[] = { -0xc0,0x20,0x20,0x40, -}; - -static const BitmapCharRec ch184 = {3,4,0,3,3,ch184data}; - -/* char: 0xb7 */ - -static const GLubyte ch183data[] = { -0x80, -}; - -static const BitmapCharRec ch183 = {1,1,-1,-3,3,ch183data}; - -/* char: 0xb6 */ - -static const GLubyte ch182data[] = { -0x28,0x28,0x28,0x28,0x28,0x28,0x68,0xe8,0xe8,0xe8,0x68,0x3c, -}; - -static const BitmapCharRec ch182 = {6,12,0,3,7,ch182data}; - -/* char: 0xb5 */ - -static const GLubyte ch181data[] = { -0x80,0x80,0x80,0xe8,0x98,0x88,0x88,0x88,0x88,0x88, -}; - -static const BitmapCharRec ch181 = {5,10,-1,3,7,ch181data}; - -/* char: 0xb4 */ - -static const GLubyte ch180data[] = { -0x80,0x40, -}; - -static const BitmapCharRec ch180 = {2,2,0,-8,2,ch180data}; - -/* char: 0xb3 */ - -static const GLubyte ch179data[] = { -0xc0,0x20,0x40,0x20,0xe0, -}; - -static const BitmapCharRec ch179 = {3,5,0,-3,4,ch179data}; - -/* char: 0xb2 */ - -static const GLubyte ch178data[] = { -0xf0,0x40,0x20,0x90,0x60, -}; - -static const BitmapCharRec ch178 = {4,5,0,-3,4,ch178data}; - -/* char: 0xb1 */ - -static const GLubyte ch177data[] = { -0xf8,0x0,0x20,0x20,0xf8,0x20,0x20, -}; - -static const BitmapCharRec ch177 = {5,7,-1,0,7,ch177data}; - -/* char: 0xb0 */ - -static const GLubyte ch176data[] = { -0x60,0x90,0x90,0x60, -}; - -static const BitmapCharRec ch176 = {4,4,0,-4,5,ch176data}; - -/* char: 0xaf */ - -static const GLubyte ch175data[] = { -0xf0, -}; - -static const BitmapCharRec ch175 = {4,1,0,-8,4,ch175data}; - -/* char: 0xae */ - -static const GLubyte ch174data[] = { -0x3e,0x0,0x41,0x0,0x94,0x80,0x94,0x80,0x98,0x80,0x94,0x80,0x9c,0x80,0x41,0x0, -0x3e,0x0, -}; - -static const BitmapCharRec ch174 = {9,9,-1,0,11,ch174data}; - -/* char: 0xad */ - -static const GLubyte ch173data[] = { -0xf0, -}; - -static const BitmapCharRec ch173 = {4,1,0,-3,5,ch173data}; - -/* char: 0xac */ - -static const GLubyte ch172data[] = { -0x4,0x4,0x4,0xfc, -}; - -static const BitmapCharRec ch172 = {6,4,-1,-2,8,ch172data}; - -/* char: 0xab */ - -static const GLubyte ch171data[] = { -0x28,0x50,0xa0,0x50,0x28, -}; - -static const BitmapCharRec ch171 = {5,5,-1,-1,7,ch171data}; - -/* char: 0xaa */ - -static const GLubyte ch170data[] = { -0xe0,0x0,0xa0,0x20,0xe0, -}; - -static const BitmapCharRec ch170 = {3,5,-1,-4,5,ch170data}; - -/* char: 0xa9 */ - -static const GLubyte ch169data[] = { -0x3e,0x0,0x41,0x0,0x9c,0x80,0xa2,0x80,0xa0,0x80,0xa2,0x80,0x9c,0x80,0x41,0x0, -0x3e,0x0, -}; - -static const BitmapCharRec ch169 = {9,9,-1,0,11,ch169data}; - -/* char: 0xa8 */ - -static const GLubyte ch168data[] = { -0xa0, -}; - -static const BitmapCharRec ch168 = {3,1,0,-8,3,ch168data}; - -/* char: 0xa7 */ - -static const GLubyte ch167data[] = { -0x70,0x88,0x8,0x30,0x48,0x88,0x88,0x90,0x60,0x80,0x88,0x70, -}; - -static const BitmapCharRec ch167 = {5,12,0,3,6,ch167data}; - -/* char: 0xa6 */ - -static const GLubyte ch166data[] = { -0x80,0x80,0x80,0x80,0x0,0x0,0x0,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch166 = {1,11,-1,2,3,ch166data}; - -/* char: 0xa5 */ - -static const GLubyte ch165data[] = { -0x20,0x20,0xf8,0x20,0xf8,0x20,0x50,0x88,0x88, -}; - -static const BitmapCharRec ch165 = {5,9,-1,0,7,ch165data}; - -/* char: 0xa4 */ - -static const GLubyte ch164data[] = { -0x84,0x78,0x48,0x48,0x78,0x84, -}; - -static const BitmapCharRec ch164 = {6,6,0,-1,7,ch164data}; - -/* char: 0xa3 */ - -static const GLubyte ch163data[] = { -0xb0,0x48,0x20,0x20,0xf0,0x40,0x40,0x48,0x30, -}; - -static const BitmapCharRec ch163 = {5,9,-1,0,7,ch163data}; - -/* char: 0xa2 */ - -static const GLubyte ch162data[] = { -0x40,0x70,0xc8,0xa0,0xa0,0xa0,0xa8,0x70,0x10, -}; - -static const BitmapCharRec ch162 = {5,9,-1,1,7,ch162data}; - -/* char: 0xa1 */ - -static const GLubyte ch161data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, -}; - -static const BitmapCharRec ch161 = {1,10,-1,3,3,ch161data}; - -/* char: 0xa0 */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch160data[] = { 0x0 }; -static const BitmapCharRec ch160 = {1,1,0,0,4,ch160data}; -#else -static const BitmapCharRec ch160 = {0,0,0,0,4,0}; -#endif - -/* char: 0x7e '~' */ - -static const GLubyte ch126data[] = { -0x98,0x64, -}; - -static const BitmapCharRec ch126 = {6,2,0,-3,7,ch126data}; - -/* char: 0x7d '}' */ - -static const GLubyte ch125data[] = { -0xc0,0x20,0x20,0x20,0x20,0x20,0x10,0x20,0x20,0x20,0x20,0xc0, -}; - -static const BitmapCharRec ch125 = {4,12,0,3,4,ch125data}; - -/* char: 0x7c '|' */ - -static const GLubyte ch124data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch124 = {1,12,-1,3,3,ch124data}; - -/* char: 0x7b '{' */ - -static const GLubyte ch123data[] = { -0x30,0x40,0x40,0x40,0x40,0x40,0x80,0x40,0x40,0x40,0x40,0x30, -}; - -static const BitmapCharRec ch123 = {4,12,0,3,4,ch123data}; - -/* char: 0x7a 'z' */ - -static const GLubyte ch122data[] = { -0xf0,0x80,0x40,0x40,0x20,0x10,0xf0, -}; - -static const BitmapCharRec ch122 = {4,7,-1,0,6,ch122data}; - -/* char: 0x79 'y' */ - -static const GLubyte ch121data[] = { -0x80,0x40,0x20,0x20,0x50,0x50,0x90,0x88,0x88,0x88, -}; - -static const BitmapCharRec ch121 = {5,10,-1,3,7,ch121data}; - -/* char: 0x78 'x' */ - -static const GLubyte ch120data[] = { -0x84,0x84,0x48,0x30,0x30,0x48,0x84, -}; - -static const BitmapCharRec ch120 = {6,7,0,0,6,ch120data}; - -/* char: 0x77 'w' */ - -static const GLubyte ch119data[] = { -0x22,0x0,0x22,0x0,0x55,0x0,0x49,0x0,0x49,0x0,0x88,0x80,0x88,0x80, -}; - -static const BitmapCharRec ch119 = {9,7,0,0,9,ch119data}; - -/* char: 0x76 'v' */ - -static const GLubyte ch118data[] = { -0x20,0x20,0x50,0x50,0x88,0x88,0x88, -}; - -static const BitmapCharRec ch118 = {5,7,-1,0,7,ch118data}; - -/* char: 0x75 'u' */ - -static const GLubyte ch117data[] = { -0x68,0x98,0x88,0x88,0x88,0x88,0x88, -}; - -static const BitmapCharRec ch117 = {5,7,-1,0,7,ch117data}; - -/* char: 0x74 't' */ - -static const GLubyte ch116data[] = { -0x60,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x40, -}; - -static const BitmapCharRec ch116 = {3,9,0,0,3,ch116data}; - -/* char: 0x73 's' */ - -static const GLubyte ch115data[] = { -0x60,0x90,0x10,0x60,0x80,0x90,0x60, -}; - -static const BitmapCharRec ch115 = {4,7,-1,0,6,ch115data}; - -/* char: 0x72 'r' */ - -static const GLubyte ch114data[] = { -0x80,0x80,0x80,0x80,0x80,0xc0,0xa0, -}; - -static const BitmapCharRec ch114 = {3,7,-1,0,4,ch114data}; - -/* char: 0x71 'q' */ - -static const GLubyte ch113data[] = { -0x8,0x8,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, -}; - -static const BitmapCharRec ch113 = {5,10,-1,3,7,ch113data}; - -/* char: 0x70 'p' */ - -static const GLubyte ch112data[] = { -0x80,0x80,0x80,0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0, -}; - -static const BitmapCharRec ch112 = {5,10,-1,3,7,ch112data}; - -/* char: 0x6f 'o' */ - -static const GLubyte ch111data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch111 = {5,7,-1,0,7,ch111data}; - -/* char: 0x6e 'n' */ - -static const GLubyte ch110data[] = { -0x88,0x88,0x88,0x88,0x88,0xc8,0xb0, -}; - -static const BitmapCharRec ch110 = {5,7,-1,0,7,ch110data}; - -/* char: 0x6d 'm' */ - -static const GLubyte ch109data[] = { -0x92,0x92,0x92,0x92,0x92,0xda,0xa4, -}; - -static const BitmapCharRec ch109 = {7,7,-1,0,9,ch109data}; - -/* char: 0x6c 'l' */ - -static const GLubyte ch108data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch108 = {1,9,-1,0,3,ch108data}; - -/* char: 0x6b 'k' */ - -static const GLubyte ch107data[] = { -0x88,0x90,0xa0,0xc0,0xc0,0xa0,0x90,0x80,0x80, -}; - -static const BitmapCharRec ch107 = {5,9,-1,0,6,ch107data}; - -/* char: 0x6a 'j' */ - -static const GLubyte ch106data[] = { -0x80,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x0,0x40, -}; - -static const BitmapCharRec ch106 = {2,12,0,3,3,ch106data}; - -/* char: 0x69 'i' */ - -static const GLubyte ch105data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0,0x80, -}; - -static const BitmapCharRec ch105 = {1,9,-1,0,3,ch105data}; - -/* char: 0x68 'h' */ - -static const GLubyte ch104data[] = { -0x88,0x88,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, -}; - -static const BitmapCharRec ch104 = {5,9,-1,0,7,ch104data}; - -/* char: 0x67 'g' */ - -static const GLubyte ch103data[] = { -0x70,0x88,0x8,0x68,0x98,0x88,0x88,0x88,0x98,0x68, -}; - -static const BitmapCharRec ch103 = {5,10,-1,3,7,ch103data}; - -/* char: 0x66 'f' */ - -static const GLubyte ch102data[] = { -0x40,0x40,0x40,0x40,0x40,0x40,0xe0,0x40,0x30, -}; - -static const BitmapCharRec ch102 = {4,9,0,0,3,ch102data}; - -/* char: 0x65 'e' */ - -static const GLubyte ch101data[] = { -0x70,0x88,0x80,0xf8,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch101 = {5,7,-1,0,7,ch101data}; - -/* char: 0x64 'd' */ - -static const GLubyte ch100data[] = { -0x68,0x98,0x88,0x88,0x88,0x98,0x68,0x8,0x8, -}; - -static const BitmapCharRec ch100 = {5,9,-1,0,7,ch100data}; - -/* char: 0x63 'c' */ - -static const GLubyte ch99data[] = { -0x70,0x88,0x80,0x80,0x80,0x88,0x70, -}; - -static const BitmapCharRec ch99 = {5,7,-1,0,7,ch99data}; - -/* char: 0x62 'b' */ - -static const GLubyte ch98data[] = { -0xb0,0xc8,0x88,0x88,0x88,0xc8,0xb0,0x80,0x80, -}; - -static const BitmapCharRec ch98 = {5,9,-1,0,7,ch98data}; - -/* char: 0x61 'a' */ - -static const GLubyte ch97data[] = { -0x74,0x88,0x88,0x78,0x8,0x88,0x70, -}; - -static const BitmapCharRec ch97 = {6,7,-1,0,7,ch97data}; - -/* char: 0x60 '`' */ - -static const GLubyte ch96data[] = { -0xc0,0x80,0x40, -}; - -static const BitmapCharRec ch96 = {2,3,0,-6,3,ch96data}; - -/* char: 0x5f '_' */ - -static const GLubyte ch95data[] = { -0xfe, -}; - -static const BitmapCharRec ch95 = {7,1,0,2,7,ch95data}; - -/* char: 0x5e '^' */ - -static const GLubyte ch94data[] = { -0x88,0x50,0x20, -}; - -static const BitmapCharRec ch94 = {5,3,0,-5,6,ch94data}; - -/* char: 0x5d ']' */ - -static const GLubyte ch93data[] = { -0xc0,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0xc0, -}; - -static const BitmapCharRec ch93 = {2,12,0,3,3,ch93data}; - -/* char: 0x5c '\' */ - -static const GLubyte ch92data[] = { -0x10,0x10,0x20,0x20,0x20,0x40,0x40,0x80,0x80, -}; - -static const BitmapCharRec ch92 = {4,9,0,0,4,ch92data}; - -/* char: 0x5b '[' */ - -static const GLubyte ch91data[] = { -0xc0,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0, -}; - -static const BitmapCharRec ch91 = {2,12,-1,3,3,ch91data}; - -/* char: 0x5a 'Z' */ - -static const GLubyte ch90data[] = { -0xfe,0x80,0x40,0x20,0x10,0x8,0x4,0x2,0xfe, -}; - -static const BitmapCharRec ch90 = {7,9,-1,0,9,ch90data}; - -/* char: 0x59 'Y' */ - -static const GLubyte ch89data[] = { -0x10,0x10,0x10,0x10,0x28,0x44,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch89 = {7,9,-1,0,9,ch89data}; - -/* char: 0x58 'X' */ - -static const GLubyte ch88data[] = { -0x82,0x44,0x44,0x28,0x10,0x28,0x44,0x44,0x82, -}; - -static const BitmapCharRec ch88 = {7,9,-1,0,9,ch88data}; - -/* char: 0x57 'W' */ - -static const GLubyte ch87data[] = { -0x22,0x0,0x22,0x0,0x22,0x0,0x55,0x0,0x55,0x0,0x49,0x0,0x88,0x80,0x88,0x80, -0x88,0x80, -}; - -static const BitmapCharRec ch87 = {9,9,-1,0,11,ch87data}; - -/* char: 0x56 'V' */ - -static const GLubyte ch86data[] = { -0x10,0x10,0x28,0x28,0x44,0x44,0x44,0x82,0x82, -}; - -static const BitmapCharRec ch86 = {7,9,-1,0,9,ch86data}; - -/* char: 0x55 'U' */ - -static const GLubyte ch85data[] = { -0x78,0x84,0x84,0x84,0x84,0x84,0x84,0x84,0x84, -}; - -static const BitmapCharRec ch85 = {6,9,-1,0,8,ch85data}; - -/* char: 0x54 'T' */ - -static const GLubyte ch84data[] = { -0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0xfe, -}; - -static const BitmapCharRec ch84 = {7,9,0,0,7,ch84data}; - -/* char: 0x53 'S' */ - -static const GLubyte ch83data[] = { -0x78,0x84,0x84,0x4,0x18,0x60,0x80,0x84,0x78, -}; - -static const BitmapCharRec ch83 = {6,9,-1,0,8,ch83data}; - -/* char: 0x52 'R' */ - -static const GLubyte ch82data[] = { -0x84,0x84,0x84,0x88,0xf8,0x84,0x84,0x84,0xf8, -}; - -static const BitmapCharRec ch82 = {6,9,-1,0,8,ch82data}; - -/* char: 0x51 'Q' */ - -static const GLubyte ch81data[] = { -0x3d,0x42,0x85,0x89,0x81,0x81,0x81,0x42,0x3c, -}; - -static const BitmapCharRec ch81 = {8,9,-1,0,10,ch81data}; - -/* char: 0x50 'P' */ - -static const GLubyte ch80data[] = { -0x80,0x80,0x80,0x80,0xf8,0x84,0x84,0x84,0xf8, -}; - -static const BitmapCharRec ch80 = {6,9,-1,0,8,ch80data}; - -/* char: 0x4f 'O' */ - -static const GLubyte ch79data[] = { -0x3c,0x42,0x81,0x81,0x81,0x81,0x81,0x42,0x3c, -}; - -static const BitmapCharRec ch79 = {8,9,-1,0,10,ch79data}; - -/* char: 0x4e 'N' */ - -static const GLubyte ch78data[] = { -0x82,0x86,0x8a,0x8a,0x92,0xa2,0xa2,0xc2,0x82, -}; - -static const BitmapCharRec ch78 = {7,9,-1,0,9,ch78data}; - -/* char: 0x4d 'M' */ - -static const GLubyte ch77data[] = { -0x88,0x80,0x88,0x80,0x94,0x80,0x94,0x80,0xa2,0x80,0xa2,0x80,0xc1,0x80,0xc1,0x80, -0x80,0x80, -}; - -static const BitmapCharRec ch77 = {9,9,-1,0,11,ch77data}; - -/* char: 0x4c 'L' */ - -static const GLubyte ch76data[] = { -0xf8,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch76 = {5,9,-1,0,7,ch76data}; - -/* char: 0x4b 'K' */ - -static const GLubyte ch75data[] = { -0x82,0x84,0x88,0x90,0xe0,0xa0,0x90,0x88,0x84, -}; - -static const BitmapCharRec ch75 = {7,9,-1,0,8,ch75data}; - -/* char: 0x4a 'J' */ - -static const GLubyte ch74data[] = { -0x70,0x88,0x88,0x8,0x8,0x8,0x8,0x8,0x8, -}; - -static const BitmapCharRec ch74 = {5,9,-1,0,7,ch74data}; - -/* char: 0x49 'I' */ - -static const GLubyte ch73data[] = { -0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch73 = {1,9,-1,0,3,ch73data}; - -/* char: 0x48 'H' */ - -static const GLubyte ch72data[] = { -0x82,0x82,0x82,0x82,0xfe,0x82,0x82,0x82,0x82, -}; - -static const BitmapCharRec ch72 = {7,9,-1,0,9,ch72data}; - -/* char: 0x47 'G' */ - -static const GLubyte ch71data[] = { -0x3a,0x46,0x82,0x82,0x8e,0x80,0x80,0x42,0x3c, -}; - -static const BitmapCharRec ch71 = {7,9,-1,0,9,ch71data}; - -/* char: 0x46 'F' */ - -static const GLubyte ch70data[] = { -0x80,0x80,0x80,0x80,0xf8,0x80,0x80,0x80,0xfc, -}; - -static const BitmapCharRec ch70 = {6,9,-1,0,8,ch70data}; - -/* char: 0x45 'E' */ - -static const GLubyte ch69data[] = { -0xfc,0x80,0x80,0x80,0xfc,0x80,0x80,0x80,0xfc, -}; - -static const BitmapCharRec ch69 = {6,9,-1,0,8,ch69data}; - -/* char: 0x44 'D' */ - -static const GLubyte ch68data[] = { -0xf8,0x84,0x82,0x82,0x82,0x82,0x82,0x84,0xf8, -}; - -static const BitmapCharRec ch68 = {7,9,-1,0,9,ch68data}; - -/* char: 0x43 'C' */ - -static const GLubyte ch67data[] = { -0x3c,0x42,0x80,0x80,0x80,0x80,0x80,0x42,0x3c, -}; - -static const BitmapCharRec ch67 = {7,9,-1,0,9,ch67data}; - -/* char: 0x42 'B' */ - -static const GLubyte ch66data[] = { -0xf8,0x84,0x84,0x84,0xf8,0x84,0x84,0x84,0xf8, -}; - -static const BitmapCharRec ch66 = {6,9,-1,0,8,ch66data}; - -/* char: 0x41 'A' */ - -static const GLubyte ch65data[] = { -0x82,0x82,0x82,0x7c,0x44,0x44,0x28,0x28,0x10, -}; - -static const BitmapCharRec ch65 = {7,9,-1,0,9,ch65data}; - -/* char: 0x40 '@' */ - -static const GLubyte ch64data[] = { -0x3e,0x0,0x40,0x0,0x9b,0x0,0xa6,0x80,0xa2,0x40,0xa2,0x40,0x92,0x40,0x4d,0x40, -0x60,0x80,0x1f,0x0, -}; - -static const BitmapCharRec ch64 = {10,10,-1,1,12,ch64data}; - -/* char: 0x3f '?' */ - -static const GLubyte ch63data[] = { -0x20,0x0,0x20,0x20,0x10,0x10,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch63 = {5,9,-1,0,7,ch63data}; - -/* char: 0x3e '>' */ - -static const GLubyte ch62data[] = { -0xc0,0x30,0xc,0x30,0xc0, -}; - -static const BitmapCharRec ch62 = {6,5,-1,-1,7,ch62data}; - -/* char: 0x3d '=' */ - -static const GLubyte ch61data[] = { -0xf8,0x0,0xf8, -}; - -static const BitmapCharRec ch61 = {5,3,-1,-2,7,ch61data}; - -/* char: 0x3c '<' */ - -static const GLubyte ch60data[] = { -0xc,0x30,0xc0,0x30,0xc, -}; - -static const BitmapCharRec ch60 = {6,5,0,-1,7,ch60data}; - -/* char: 0x3b ';' */ - -static const GLubyte ch59data[] = { -0x80,0x40,0x40,0x0,0x0,0x0,0x0,0x40, -}; - -static const BitmapCharRec ch59 = {2,8,0,2,3,ch59data}; - -/* char: 0x3a ':' */ - -static const GLubyte ch58data[] = { -0x80,0x0,0x0,0x0,0x0,0x80, -}; - -static const BitmapCharRec ch58 = {1,6,-1,0,3,ch58data}; - -/* char: 0x39 '9' */ - -static const GLubyte ch57data[] = { -0x70,0x88,0x8,0x8,0x78,0x88,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch57 = {5,9,-1,0,7,ch57data}; - -/* char: 0x38 '8' */ - -static const GLubyte ch56data[] = { -0x70,0x88,0x88,0x88,0x88,0x70,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch56 = {5,9,-1,0,7,ch56data}; - -/* char: 0x37 '7' */ - -static const GLubyte ch55data[] = { -0x40,0x40,0x20,0x20,0x20,0x10,0x10,0x8,0xf8, -}; - -static const BitmapCharRec ch55 = {5,9,-1,0,7,ch55data}; - -/* char: 0x36 '6' */ - -static const GLubyte ch54data[] = { -0x70,0x88,0x88,0x88,0xc8,0xb0,0x80,0x88,0x70, -}; - -static const BitmapCharRec ch54 = {5,9,-1,0,7,ch54data}; - -/* char: 0x35 '5' */ - -static const GLubyte ch53data[] = { -0x70,0x88,0x88,0x8,0x8,0xf0,0x80,0x80,0xf8, -}; - -static const BitmapCharRec ch53 = {5,9,-1,0,7,ch53data}; - -/* char: 0x34 '4' */ - -static const GLubyte ch52data[] = { -0x8,0x8,0xfc,0x88,0x48,0x28,0x28,0x18,0x8, -}; - -static const BitmapCharRec ch52 = {6,9,0,0,7,ch52data}; - -/* char: 0x33 '3' */ - -static const GLubyte ch51data[] = { -0x70,0x88,0x88,0x8,0x8,0x30,0x8,0x88,0x70, -}; - -static const BitmapCharRec ch51 = {5,9,-1,0,7,ch51data}; - -/* char: 0x32 '2' */ - -static const GLubyte ch50data[] = { -0xf8,0x80,0x80,0x40,0x20,0x10,0x8,0x88,0x70, -}; - -static const BitmapCharRec ch50 = {5,9,-1,0,7,ch50data}; - -/* char: 0x31 '1' */ - -static const GLubyte ch49data[] = { -0x20,0x20,0x20,0x20,0x20,0x20,0x20,0xe0,0x20, -}; - -static const BitmapCharRec ch49 = {3,9,-1,0,7,ch49data}; - -/* char: 0x30 '0' */ - -static const GLubyte ch48data[] = { -0x70,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x70, -}; - -static const BitmapCharRec ch48 = {5,9,-1,0,7,ch48data}; - -/* char: 0x2f '/' */ - -static const GLubyte ch47data[] = { -0x80,0x80,0x40,0x40,0x40,0x20,0x20,0x10,0x10, -}; - -static const BitmapCharRec ch47 = {4,9,0,0,4,ch47data}; - -/* char: 0x2e '.' */ - -static const GLubyte ch46data[] = { -0x80, -}; - -static const BitmapCharRec ch46 = {1,1,-1,0,3,ch46data}; - -/* char: 0x2d '-' */ - -static const GLubyte ch45data[] = { -0xf8, -}; - -static const BitmapCharRec ch45 = {5,1,-1,-3,8,ch45data}; - -/* char: 0x2c ',' */ - -static const GLubyte ch44data[] = { -0x80,0x40,0x40, -}; - -static const BitmapCharRec ch44 = {2,3,-1,2,4,ch44data}; - -/* char: 0x2b '+' */ - -static const GLubyte ch43data[] = { -0x20,0x20,0xf8,0x20,0x20, -}; - -static const BitmapCharRec ch43 = {5,5,-1,-1,7,ch43data}; - -/* char: 0x2a '*' */ - -static const GLubyte ch42data[] = { -0xa0,0x40,0xa0, -}; - -static const BitmapCharRec ch42 = {3,3,-1,-6,5,ch42data}; - -/* char: 0x29 ')' */ - -static const GLubyte ch41data[] = { -0x80,0x40,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x40,0x40,0x80, -}; - -static const BitmapCharRec ch41 = {3,12,0,3,4,ch41data}; - -/* char: 0x28 '(' */ - -static const GLubyte ch40data[] = { -0x20,0x40,0x40,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x40,0x20, -}; - -static const BitmapCharRec ch40 = {3,12,-1,3,4,ch40data}; - -/* char: 0x27 ''' */ - -static const GLubyte ch39data[] = { -0x80,0x40,0xc0, -}; - -static const BitmapCharRec ch39 = {2,3,-1,-6,3,ch39data}; - -/* char: 0x26 '&' */ - -static const GLubyte ch38data[] = { -0x72,0x8c,0x84,0x8a,0x50,0x30,0x48,0x48,0x30, -}; - -static const BitmapCharRec ch38 = {7,9,-1,0,9,ch38data}; - -/* char: 0x25 '%' */ - -static const GLubyte ch37data[] = { -0x23,0x0,0x14,0x80,0x14,0x80,0x13,0x0,0x8,0x0,0x68,0x0,0x94,0x0,0x94,0x0, -0x62,0x0, -}; - -static const BitmapCharRec ch37 = {9,9,-1,0,11,ch37data}; - -/* char: 0x24 '$' */ - -static const GLubyte ch36data[] = { -0x20,0x70,0xa8,0xa8,0x28,0x70,0xa0,0xa8,0x70,0x20, -}; - -static const BitmapCharRec ch36 = {5,10,-1,1,7,ch36data}; - -/* char: 0x23 '#' */ - -static const GLubyte ch35data[] = { -0x50,0x50,0x50,0xfc,0x28,0xfc,0x28,0x28, -}; - -static const BitmapCharRec ch35 = {6,8,0,0,7,ch35data}; - -/* char: 0x22 '"' */ - -static const GLubyte ch34data[] = { -0xa0,0xa0,0xa0, -}; - -static const BitmapCharRec ch34 = {3,3,-1,-6,5,ch34data}; - -/* char: 0x21 '!' */ - -static const GLubyte ch33data[] = { -0x80,0x0,0x80,0x80,0x80,0x80,0x80,0x80,0x80, -}; - -static const BitmapCharRec ch33 = {1,9,-1,0,3,ch33data}; - -/* char: 0x20 ' ' */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch32data[] = { 0x0 }; -static const BitmapCharRec ch32 = {1,1,0,0,4,ch32data}; -#else -static const BitmapCharRec ch32 = {0,0,0,0,4,0}; -#endif - -static const BitmapCharRec * const chars[] = { -&ch32, -&ch33, -&ch34, -&ch35, -&ch36, -&ch37, -&ch38, -&ch39, -&ch40, -&ch41, -&ch42, -&ch43, -&ch44, -&ch45, -&ch46, -&ch47, -&ch48, -&ch49, -&ch50, -&ch51, -&ch52, -&ch53, -&ch54, -&ch55, -&ch56, -&ch57, -&ch58, -&ch59, -&ch60, -&ch61, -&ch62, -&ch63, -&ch64, -&ch65, -&ch66, -&ch67, -&ch68, -&ch69, -&ch70, -&ch71, -&ch72, -&ch73, -&ch74, -&ch75, -&ch76, -&ch77, -&ch78, -&ch79, -&ch80, -&ch81, -&ch82, -&ch83, -&ch84, -&ch85, -&ch86, -&ch87, -&ch88, -&ch89, -&ch90, -&ch91, -&ch92, -&ch93, -&ch94, -&ch95, -&ch96, -&ch97, -&ch98, -&ch99, -&ch100, -&ch101, -&ch102, -&ch103, -&ch104, -&ch105, -&ch106, -&ch107, -&ch108, -&ch109, -&ch110, -&ch111, -&ch112, -&ch113, -&ch114, -&ch115, -&ch116, -&ch117, -&ch118, -&ch119, -&ch120, -&ch121, -&ch122, -&ch123, -&ch124, -&ch125, -&ch126, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -&ch160, -&ch161, -&ch162, -&ch163, -&ch164, -&ch165, -&ch166, -&ch167, -&ch168, -&ch169, -&ch170, -&ch171, -&ch172, -&ch173, -&ch174, -&ch175, -&ch176, -&ch177, -&ch178, -&ch179, -&ch180, -&ch181, -&ch182, -&ch183, -&ch184, -&ch185, -&ch186, -&ch187, -&ch188, -&ch189, -&ch190, -&ch191, -&ch192, -&ch193, -&ch194, -&ch195, -&ch196, -&ch197, -&ch198, -&ch199, -&ch200, -&ch201, -&ch202, -&ch203, -&ch204, -&ch205, -&ch206, -&ch207, -&ch208, -&ch209, -&ch210, -&ch211, -&ch212, -&ch213, -&ch214, -&ch215, -&ch216, -&ch217, -&ch218, -&ch219, -&ch220, -&ch221, -&ch222, -&ch223, -&ch224, -&ch225, -&ch226, -&ch227, -&ch228, -&ch229, -&ch230, -&ch231, -&ch232, -&ch233, -&ch234, -&ch235, -&ch236, -&ch237, -&ch238, -&ch239, -&ch240, -&ch241, -&ch242, -&ch243, -&ch244, -&ch245, -&ch246, -&ch247, -&ch248, -&ch249, -&ch250, -&ch251, -&ch252, -&ch253, -&ch254, -&ch255, -}; - -#if !defined(__IBMCPP__) -const -#endif -BitmapFontRec glutBitmapHelvetica12 = { -"-adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1", -224, -32, -chars -}; - diff --git a/src/glut/os2/glut_hel18.cpp b/src/glut/os2/glut_hel18.cpp deleted file mode 100644 index 8fe76332b2..0000000000 --- a/src/glut/os2/glut_hel18.cpp +++ /dev/null @@ -1,1900 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#define glutBitmapHelvetica18 XXX -#include "glutbitmap.h" -#undef glutBitmapHelvetica18 - -/* char: 0xff */ - -static const GLubyte ch255data[] = { -0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x66, -0x66, -}; - -static const BitmapCharRec ch255 = {8,17,-1,4,10,ch255data}; - -/* char: 0xfe */ - -static const GLubyte ch254data[] = { -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, -0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0, -0xc0,0x0,0xc0,0x0, -}; - -static const BitmapCharRec ch254 = {9,18,-1,4,11,ch254data}; - -/* char: 0xfd */ - -static const GLubyte ch253data[] = { -0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3,0x0,0x18, -0xc,0x6, -}; - -static const BitmapCharRec ch253 = {8,18,-1,4,10,ch253data}; - -/* char: 0xfc */ - -static const GLubyte ch252data[] = { -0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x66, -}; - -static const BitmapCharRec ch252 = {8,13,-1,0,10,ch252data}; - -/* char: 0xfb */ - -static const GLubyte ch251data[] = { -0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x66,0x3c,0x18, -}; - -static const BitmapCharRec ch251 = {8,14,-1,0,10,ch251data}; - -/* char: 0xfa */ - -static const GLubyte ch250data[] = { -0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0x18,0xc,0x6, -}; - -static const BitmapCharRec ch250 = {8,14,-1,0,10,ch250data}; - -/* char: 0xf9 */ - -static const GLubyte ch249data[] = { -0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x0,0xc,0x18,0x30, -}; - -static const BitmapCharRec ch249 = {8,14,-1,0,10,ch249data}; - -/* char: 0xf8 */ - -static const GLubyte ch248data[] = { -0xce,0x0,0x7f,0x80,0x31,0x80,0x78,0xc0,0x6c,0xc0,0x66,0xc0,0x63,0xc0,0x31,0x80, -0x3f,0xc0,0xe,0x60, -}; - -static const BitmapCharRec ch248 = {11,10,0,0,11,ch248data}; - -/* char: 0xf7 */ - -static const GLubyte ch247data[] = { -0x18,0x18,0x0,0xff,0xff,0x0,0x18,0x18, -}; - -static const BitmapCharRec ch247 = {8,8,-1,-1,10,ch247data}; - -/* char: 0xf6 */ - -static const GLubyte ch246data[] = { -0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, -0x7f,0x0,0x3e,0x0,0x0,0x0,0x36,0x0,0x36,0x0, -}; - -static const BitmapCharRec ch246 = {9,13,-1,0,11,ch246data}; - -/* char: 0xf5 */ - -static const GLubyte ch245data[] = { -0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, -0x7f,0x0,0x3e,0x0,0x0,0x0,0x26,0x0,0x2d,0x0,0x19,0x0, -}; - -static const BitmapCharRec ch245 = {9,14,-1,0,11,ch245data}; - -/* char: 0xf4 */ - -static const GLubyte ch244data[] = { -0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, -0x7f,0x0,0x3e,0x0,0x0,0x0,0x33,0x0,0x1e,0x0,0xc,0x0, -}; - -static const BitmapCharRec ch244 = {9,14,-1,0,11,ch244data}; - -/* char: 0xf3 */ - -static const GLubyte ch243data[] = { -0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, -0x7f,0x0,0x3e,0x0,0x0,0x0,0x18,0x0,0xc,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch243 = {9,14,-1,0,11,ch243data}; - -/* char: 0xf2 */ - -static const GLubyte ch242data[] = { -0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, -0x7f,0x0,0x3e,0x0,0x0,0x0,0xc,0x0,0x18,0x0,0x30,0x0, -}; - -static const BitmapCharRec ch242 = {9,14,-1,0,11,ch242data}; - -/* char: 0xf1 */ - -static const GLubyte ch241data[] = { -0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0x0,0x4c,0x5a,0x32, -}; - -static const BitmapCharRec ch241 = {8,14,-1,0,10,ch241data}; - -/* char: 0xf0 */ - -static const GLubyte ch240data[] = { -0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, -0x7f,0x0,0x3e,0x0,0x4c,0x0,0x38,0x0,0x36,0x0,0x60,0x0, -}; - -static const BitmapCharRec ch240 = {9,14,-1,0,11,ch240data}; - -/* char: 0xef */ - -static const GLubyte ch239data[] = { -0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xd8,0xd8, -}; - -static const BitmapCharRec ch239 = {5,13,0,0,4,ch239data}; - -/* char: 0xee */ - -static const GLubyte ch238data[] = { -0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc,0x78,0x30, -}; - -static const BitmapCharRec ch238 = {6,14,1,0,4,ch238data}; - -/* char: 0xed */ - -static const GLubyte ch237data[] = { -0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0xc0,0x60,0x30, -}; - -static const BitmapCharRec ch237 = {4,14,0,0,4,ch237data}; - -/* char: 0xec */ - -static const GLubyte ch236data[] = { -0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x0,0x30,0x60,0xc0, -}; - -static const BitmapCharRec ch236 = {4,14,0,0,4,ch236data}; - -/* char: 0xeb */ - -static const GLubyte ch235data[] = { -0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x36,0x36, -}; - -static const BitmapCharRec ch235 = {8,13,-1,0,10,ch235data}; - -/* char: 0xea */ - -static const GLubyte ch234data[] = { -0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x66,0x3c,0x18, -}; - -static const BitmapCharRec ch234 = {8,14,-1,0,10,ch234data}; - -/* char: 0xe9 */ - -static const GLubyte ch233data[] = { -0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0xc,0x6, -}; - -static const BitmapCharRec ch233 = {8,14,-1,0,10,ch233data}; - -/* char: 0xe8 */ - -static const GLubyte ch232data[] = { -0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c,0x0,0x18,0x30,0x60, -}; - -static const BitmapCharRec ch232 = {8,14,-1,0,10,ch232data}; - -/* char: 0xe7 */ - -static const GLubyte ch231data[] = { -0x78,0x6c,0xc,0x38,0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, -}; - -static const BitmapCharRec ch231 = {8,14,-1,4,10,ch231data}; - -/* char: 0xe6 */ - -static const GLubyte ch230data[] = { -0x75,0xe0,0xef,0xf8,0xc7,0x18,0xc6,0x0,0xe6,0x0,0x7f,0xf8,0xe,0x18,0xc6,0x18, -0xef,0xf0,0x7d,0xe0, -}; - -static const BitmapCharRec ch230 = {13,10,-1,0,15,ch230data}; - -/* char: 0xe5 */ - -static const GLubyte ch229data[] = { -0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x38,0x6c,0x6c,0x38, -}; - -static const BitmapCharRec ch229 = {7,14,-1,0,9,ch229data}; - -/* char: 0xe4 */ - -static const GLubyte ch228data[] = { -0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x6c,0x6c, -}; - -static const BitmapCharRec ch228 = {7,13,-1,0,9,ch228data}; - -/* char: 0xe3 */ - -static const GLubyte ch227data[] = { -0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x4c,0x5a,0x32, -}; - -static const BitmapCharRec ch227 = {7,14,-1,0,9,ch227data}; - -/* char: 0xe2 */ - -static const GLubyte ch226data[] = { -0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x66,0x3c,0x18, -}; - -static const BitmapCharRec ch226 = {7,14,-1,0,9,ch226data}; - -/* char: 0xe1 */ - -static const GLubyte ch225data[] = { -0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x30,0x18,0xc, -}; - -static const BitmapCharRec ch225 = {7,14,-1,0,9,ch225data}; - -/* char: 0xe0 */ - -static const GLubyte ch224data[] = { -0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c,0x0,0x18,0x30,0x60, -}; - -static const BitmapCharRec ch224 = {7,14,-1,0,9,ch224data}; - -/* char: 0xdf */ - -static const GLubyte ch223data[] = { -0xdc,0xde,0xc6,0xc6,0xc6,0xc6,0xdc,0xdc,0xc6,0xc6,0xc6,0xc6,0x7c,0x38, -}; - -static const BitmapCharRec ch223 = {7,14,-1,0,9,ch223data}; - -/* char: 0xde */ - -static const GLubyte ch222data[] = { -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc1,0xc0,0xff,0x80,0xff,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, -}; - -static const BitmapCharRec ch222 = {10,14,-1,0,12,ch222data}; - -/* char: 0xdd */ - -static const GLubyte ch221data[] = { -0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, -0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30,0x0,0x0,0x6,0x0, -0x3,0x0,0x1,0x80, -}; - -static const BitmapCharRec ch221 = {12,18,-1,0,14,ch221data}; - -/* char: 0xdc */ - -static const GLubyte ch220data[] = { -0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, -0x19,0x80, -}; - -static const BitmapCharRec ch220 = {11,17,-1,0,13,ch220data}; - -/* char: 0xdb */ - -static const GLubyte ch219data[] = { -0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x19,0x80, -0xf,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch219 = {11,18,-1,0,13,ch219data}; - -/* char: 0xda */ - -static const GLubyte ch218data[] = { -0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0xc,0x0, -0x6,0x0,0x3,0x0, -}; - -static const BitmapCharRec ch218 = {11,18,-1,0,13,ch218data}; - -/* char: 0xd9 */ - -static const GLubyte ch217data[] = { -0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0x0,0x0,0x6,0x0, -0xc,0x0,0x18,0x0, -}; - -static const BitmapCharRec ch217 = {11,18,-1,0,13,ch217data}; - -/* char: 0xd8 */ - -static const GLubyte ch216data[] = { -0xc7,0xc0,0xff,0xf0,0x78,0x38,0x38,0x18,0x6c,0x1c,0x6e,0xc,0x67,0xc,0x63,0x8c, -0x61,0xcc,0x70,0xdc,0x30,0x78,0x38,0x38,0x1f,0xfc,0x7,0xcc, -}; - -static const BitmapCharRec ch216 = {14,14,0,0,15,ch216data}; - -/* char: 0xd7 */ - -static const GLubyte ch215data[] = { -0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0,0x61,0x80, -0xc0,0xc0, -}; - -static const BitmapCharRec ch215 = {10,9,0,0,10,ch215data}; - -/* char: 0xd6 */ - -static const GLubyte ch214data[] = { -0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, -0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xd,0x80, -0xd,0x80, -}; - -static const BitmapCharRec ch214 = {13,17,-1,0,15,ch214data}; - -/* char: 0xd5 */ - -static const GLubyte ch213data[] = { -0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, -0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x9,0x80, -0xb,0x40,0x6,0x40, -}; - -static const BitmapCharRec ch213 = {13,18,-1,0,15,ch213data}; - -/* char: 0xd4 */ - -static const GLubyte ch212data[] = { -0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, -0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0xc,0xc0, -0x7,0x80,0x3,0x0, -}; - -static const BitmapCharRec ch212 = {13,18,-1,0,15,ch212data}; - -/* char: 0xd3 */ - -static const GLubyte ch211data[] = { -0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, -0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, -0x1,0x80,0x0,0xc0, -}; - -static const BitmapCharRec ch211 = {13,18,-1,0,15,ch211data}; - -/* char: 0xd2 */ - -static const GLubyte ch210data[] = { -0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, -0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80,0x0,0x0,0x3,0x0, -0x6,0x0,0xc,0x0, -}; - -static const BitmapCharRec ch210 = {13,18,-1,0,15,ch210data}; - -/* char: 0xd1 */ - -static const GLubyte ch209data[] = { -0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, -0xcc,0x60,0xd8,0x60,0xd8,0x60,0xf0,0x60,0xe0,0x60,0xe0,0x60,0x0,0x0,0x13,0x0, -0x16,0x80,0xc,0x80, -}; - -static const BitmapCharRec ch209 = {11,18,-1,0,13,ch209data}; - -/* char: 0xd0 */ - -static const GLubyte ch208data[] = { -0x7f,0x80,0x7f,0xc0,0x60,0xe0,0x60,0x60,0x60,0x30,0x60,0x30,0xfc,0x30,0xfc,0x30, -0x60,0x30,0x60,0x30,0x60,0x60,0x60,0xe0,0x7f,0xc0,0x7f,0x80, -}; - -static const BitmapCharRec ch208 = {12,14,0,0,13,ch208data}; - -/* char: 0xcf */ - -static const GLubyte ch207data[] = { -0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, -0xcc, -}; - -static const BitmapCharRec ch207 = {6,17,0,0,6,ch207data}; - -/* char: 0xce */ - -static const GLubyte ch206data[] = { -0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0xcc, -0x78,0x30, -}; - -static const BitmapCharRec ch206 = {6,18,0,0,6,ch206data}; - -/* char: 0xcd */ - -static const GLubyte ch205data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0xc0, -0x60,0x30, -}; - -static const BitmapCharRec ch205 = {4,18,-2,0,6,ch205data}; - -/* char: 0xcc */ - -static const GLubyte ch204data[] = { -0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x30, -0x60,0xc0, -}; - -static const BitmapCharRec ch204 = {4,18,0,0,6,ch204data}; - -/* char: 0xcb */ - -static const GLubyte ch203data[] = { -0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, -0x33,0x0, -}; - -static const BitmapCharRec ch203 = {9,17,-1,0,11,ch203data}; - -/* char: 0xca */ - -static const GLubyte ch202data[] = { -0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0x33,0x0, -0x1e,0x0,0xc,0x0, -}; - -static const BitmapCharRec ch202 = {9,18,-1,0,11,ch202data}; - -/* char: 0xc9 */ - -static const GLubyte ch201data[] = { -0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, -0x6,0x0,0x3,0x0, -}; - -static const BitmapCharRec ch201 = {9,18,-1,0,11,ch201data}; - -/* char: 0xc8 */ - -static const GLubyte ch200data[] = { -0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80,0x0,0x0,0xc,0x0, -0x18,0x0,0x30,0x0, -}; - -static const BitmapCharRec ch200 = {9,18,-1,0,11,ch200data}; - -/* char: 0xc7 */ - -static const GLubyte ch199data[] = { -0x1e,0x0,0x1b,0x0,0x3,0x0,0xe,0x0,0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30, -0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70, -0x3f,0xe0,0xf,0x80, -}; - -static const BitmapCharRec ch199 = {12,18,-1,4,14,ch199data}; - -/* char: 0xc6 */ - -static const GLubyte ch198data[] = { -0xc1,0xff,0xc1,0xff,0x61,0x80,0x61,0x80,0x7f,0x80,0x3f,0x80,0x31,0xfe,0x31,0xfe, -0x19,0x80,0x19,0x80,0xd,0x80,0xd,0x80,0x7,0xff,0x7,0xff, -}; - -static const BitmapCharRec ch198 = {16,14,-1,0,18,ch198data}; - -/* char: 0xc5 */ - -static const GLubyte ch197data[] = { -0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, -0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, -0x19,0x80,0xf,0x0, -}; - -static const BitmapCharRec ch197 = {12,18,0,0,12,ch197data}; - -/* char: 0xc4 */ - -static const GLubyte ch196data[] = { -0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, -0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, -0x19,0x80, -}; - -static const BitmapCharRec ch196 = {12,17,0,0,12,ch196data}; - -/* char: 0xc3 */ - -static const GLubyte ch195data[] = { -0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, -0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x13,0x0, -0x16,0x80,0xc,0x80, -}; - -static const BitmapCharRec ch195 = {12,18,0,0,12,ch195data}; - -/* char: 0xc2 */ - -static const GLubyte ch194data[] = { -0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, -0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x19,0x80, -0xf,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch194 = {12,18,0,0,12,ch194data}; - -/* char: 0xc1 */ - -static const GLubyte ch193data[] = { -0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, -0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, -0x3,0x0,0x1,0x80, -}; - -static const BitmapCharRec ch193 = {12,18,0,0,12,ch193data}; - -/* char: 0xc0 */ - -static const GLubyte ch192data[] = { -0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, -0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0,0x0,0x0,0x6,0x0, -0xc,0x0,0x18,0x0, -}; - -static const BitmapCharRec ch192 = {12,18,0,0,12,ch192data}; - -/* char: 0xbf */ - -static const GLubyte ch191data[] = { -0x7c,0xfe,0xc6,0xc6,0xe0,0x70,0x38,0x18,0x18,0x18,0x0,0x0,0x18,0x18, -}; - -static const BitmapCharRec ch191 = {7,14,-1,4,10,ch191data}; - -/* char: 0xbe */ - -static const GLubyte ch190data[] = { -0x18,0x18,0x18,0x18,0xc,0xfc,0x6,0xd8,0x6,0x78,0x73,0x38,0xf9,0x18,0x99,0x88, -0x30,0xc0,0x30,0xc0,0x98,0x60,0xf8,0x30,0x70,0x30, -}; - -static const BitmapCharRec ch190 = {14,13,0,0,15,ch190data}; - -/* char: 0xbd */ - -static const GLubyte ch189data[] = { -0x30,0xf8,0x30,0xf8,0x18,0x60,0xc,0x30,0xc,0x18,0x66,0x98,0x62,0xf8,0x63,0x70, -0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, -}; - -static const BitmapCharRec ch189 = {13,13,-1,0,15,ch189data}; - -/* char: 0xbc */ - -static const GLubyte ch188data[] = { -0x30,0x30,0x30,0x30,0x19,0xf8,0xd,0xb0,0xc,0xf0,0x66,0x70,0x62,0x30,0x63,0x10, -0x61,0x80,0x61,0x80,0xe0,0xc0,0xe0,0x60,0x60,0x60, -}; - -static const BitmapCharRec ch188 = {13,13,-1,0,15,ch188data}; - -/* char: 0xbb */ - -static const GLubyte ch187data[] = { -0x90,0xd8,0x6c,0x36,0x36,0x6c,0xd8,0x90, -}; - -static const BitmapCharRec ch187 = {7,8,-1,-1,9,ch187data}; - -/* char: 0xba */ - -static const GLubyte ch186data[] = { -0xf8,0x0,0x70,0xd8,0x88,0x88,0xd8,0x70, -}; - -static const BitmapCharRec ch186 = {5,8,-1,-6,7,ch186data}; - -/* char: 0xb9 */ - -static const GLubyte ch185data[] = { -0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60, -}; - -static const BitmapCharRec ch185 = {3,8,-1,-5,6,ch185data}; - -/* char: 0xb8 */ - -static const GLubyte ch184data[] = { -0xf0,0xd8,0x18,0x70,0x60, -}; - -static const BitmapCharRec ch184 = {5,5,0,4,5,ch184data}; - -/* char: 0xb7 */ - -static const GLubyte ch183data[] = { -0xc0,0xc0, -}; - -static const BitmapCharRec ch183 = {2,2,-1,-4,4,ch183data}; - -/* char: 0xb6 */ - -static const GLubyte ch182data[] = { -0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x32,0x72,0xf2,0xf2,0xf2,0xf2, -0x72,0x3f, -}; - -static const BitmapCharRec ch182 = {8,18,-1,4,10,ch182data}; - -/* char: 0xb5 */ - -static const GLubyte ch181data[] = { -0xc0,0xc0,0xc0,0xc0,0xdb,0xff,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, -}; - -static const BitmapCharRec ch181 = {8,14,-1,4,10,ch181data}; - -/* char: 0xb4 */ - -static const GLubyte ch180data[] = { -0xc0,0x60,0x30, -}; - -static const BitmapCharRec ch180 = {4,3,0,-11,4,ch180data}; - -/* char: 0xb3 */ - -static const GLubyte ch179data[] = { -0x70,0xf8,0x98,0x30,0x30,0x98,0xf8,0x70, -}; - -static const BitmapCharRec ch179 = {5,8,0,-5,6,ch179data}; - -/* char: 0xb2 */ - -static const GLubyte ch178data[] = { -0xf8,0xf8,0x60,0x30,0x18,0x98,0xf8,0x70, -}; - -static const BitmapCharRec ch178 = {5,8,0,-5,6,ch178data}; - -/* char: 0xb1 */ - -static const GLubyte ch177data[] = { -0xff,0xff,0x0,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18, -}; - -static const BitmapCharRec ch177 = {8,11,-1,0,10,ch177data}; - -/* char: 0xb0 */ - -static const GLubyte ch176data[] = { -0x70,0xd8,0x88,0xd8,0x70, -}; - -static const BitmapCharRec ch176 = {5,5,-1,-8,7,ch176data}; - -/* char: 0xaf */ - -static const GLubyte ch175data[] = { -0xf8, -}; - -static const BitmapCharRec ch175 = {5,1,0,-12,5,ch175data}; - -/* char: 0xae */ - -static const GLubyte ch174data[] = { -0xf,0x80,0x30,0x60,0x40,0x10,0x48,0x50,0x88,0x88,0x89,0x8,0x8f,0x88,0x88,0x48, -0x88,0x48,0x4f,0x90,0x40,0x10,0x30,0x60,0xf,0x80, -}; - -static const BitmapCharRec ch174 = {13,13,-1,0,14,ch174data}; - -/* char: 0xad */ - -static const GLubyte ch173data[] = { -0xf8,0xf8, -}; - -static const BitmapCharRec ch173 = {5,2,-1,-4,7,ch173data}; - -/* char: 0xac */ - -static const GLubyte ch172data[] = { -0x1,0x80,0x1,0x80,0x1,0x80,0xff,0x80,0xff,0x80, -}; - -static const BitmapCharRec ch172 = {9,5,-1,-3,11,ch172data}; - -/* char: 0xab */ - -static const GLubyte ch171data[] = { -0x12,0x36,0x6c,0xd8,0xd8,0x6c,0x36,0x12, -}; - -static const BitmapCharRec ch171 = {7,8,-1,-1,9,ch171data}; - -/* char: 0xaa */ - -static const GLubyte ch170data[] = { -0xf8,0x0,0x68,0xd8,0x48,0x38,0xc8,0x70, -}; - -static const BitmapCharRec ch170 = {5,8,-1,-6,7,ch170data}; - -/* char: 0xa9 */ - -static const GLubyte ch169data[] = { -0xf,0x80,0x30,0x60,0x40,0x10,0x47,0x10,0x88,0x88,0x90,0x8,0x90,0x8,0x90,0x8, -0x88,0x88,0x47,0x10,0x40,0x10,0x30,0x60,0xf,0x80, -}; - -static const BitmapCharRec ch169 = {13,13,-1,0,15,ch169data}; - -/* char: 0xa8 */ - -static const GLubyte ch168data[] = { -0xd8,0xd8, -}; - -static const BitmapCharRec ch168 = {5,2,0,-11,6,ch168data}; - -/* char: 0xa7 */ - -static const GLubyte ch167data[] = { -0x3c,0x7e,0xc3,0xc3,0x7,0xe,0x3e,0x73,0xe3,0xc3,0xc7,0x6e,0x7c,0xf0,0xc3,0xc3, -0x7e,0x3c, -}; - -static const BitmapCharRec ch167 = {8,18,-1,4,10,ch167data}; - -/* char: 0xa6 */ - -static const GLubyte ch166data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0, -}; - -static const BitmapCharRec ch166 = {2,17,-1,3,4,ch166data}; - -/* char: 0xa5 */ - -static const GLubyte ch165data[] = { -0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x3c,0x66,0x66,0x66,0xc3,0xc3, -}; - -static const BitmapCharRec ch165 = {8,13,-1,0,10,ch165data}; - -/* char: 0xa4 */ - -static const GLubyte ch164data[] = { -0xc3,0xff,0x66,0x66,0x66,0xff,0xc3, -}; - -static const BitmapCharRec ch164 = {8,7,-1,-3,10,ch164data}; - -/* char: 0xa3 */ - -static const GLubyte ch163data[] = { -0xdf,0x0,0xff,0x80,0x60,0x80,0x30,0x0,0x18,0x0,0x18,0x0,0x7e,0x0,0x30,0x0, -0x60,0x0,0x61,0x80,0x61,0x80,0x3f,0x0,0x1e,0x0, -}; - -static const BitmapCharRec ch163 = {9,13,0,0,10,ch163data}; - -/* char: 0xa2 */ - -static const GLubyte ch162data[] = { -0x10,0x10,0x3e,0x7f,0x6b,0xc8,0xc8,0xc8,0xc8,0x6b,0x7f,0x3e,0x4,0x4, -}; - -static const BitmapCharRec ch162 = {8,14,-1,2,10,ch162data}; - -/* char: 0xa1 */ - -static const GLubyte ch161data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x40,0x40,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch161 = {2,14,-2,4,6,ch161data}; - -/* char: 0xa0 */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch160data[] = { 0x0 }; -static const BitmapCharRec ch160 = {1,1,0,0,5,ch160data}; -#else -static const BitmapCharRec ch160 = {0,0,0,0,5,0}; -#endif - -/* char: 0x7e '~' */ - -static const GLubyte ch126data[] = { -0xcc,0x7e,0x33, -}; - -static const BitmapCharRec ch126 = {8,3,-1,-4,10,ch126data}; - -/* char: 0x7d '}' */ - -static const GLubyte ch125data[] = { -0xc0,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0xc,0x18,0x30,0x30,0x30,0x30,0x30, -0x60,0xc0, -}; - -static const BitmapCharRec ch125 = {6,18,0,4,6,ch125data}; - -/* char: 0x7c '|' */ - -static const GLubyte ch124data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0, -}; - -static const BitmapCharRec ch124 = {2,18,-1,4,4,ch124data}; - -/* char: 0x7b '{' */ - -static const GLubyte ch123data[] = { -0xc,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0xc0,0x60,0x30,0x30,0x30,0x30,0x30, -0x18,0xc, -}; - -static const BitmapCharRec ch123 = {6,18,0,4,6,ch123data}; - -/* char: 0x7a 'z' */ - -static const GLubyte ch122data[] = { -0xfe,0xfe,0xc0,0x60,0x30,0x18,0xc,0x6,0xfe,0xfe, -}; - -static const BitmapCharRec ch122 = {7,10,-1,0,9,ch122data}; - -/* char: 0x79 'y' */ - -static const GLubyte ch121data[] = { -0x70,0x70,0x18,0x18,0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, -}; - -static const BitmapCharRec ch121 = {8,14,-1,4,10,ch121data}; - -/* char: 0x78 'x' */ - -static const GLubyte ch120data[] = { -0xc3,0xe7,0x66,0x3c,0x18,0x18,0x3c,0x66,0xe7,0xc3, -}; - -static const BitmapCharRec ch120 = {8,10,-1,0,10,ch120data}; - -/* char: 0x77 'w' */ - -static const GLubyte ch119data[] = { -0x19,0x80,0x19,0x80,0x39,0xc0,0x29,0x40,0x69,0x60,0x66,0x60,0x66,0x60,0xc6,0x30, -0xc6,0x30,0xc6,0x30, -}; - -static const BitmapCharRec ch119 = {12,10,-1,0,14,ch119data}; - -/* char: 0x76 'v' */ - -static const GLubyte ch118data[] = { -0x18,0x18,0x3c,0x24,0x66,0x66,0x66,0xc3,0xc3,0xc3, -}; - -static const BitmapCharRec ch118 = {8,10,-1,0,10,ch118data}; - -/* char: 0x75 'u' */ - -static const GLubyte ch117data[] = { -0x73,0xfb,0xc7,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3, -}; - -static const BitmapCharRec ch117 = {8,10,-1,0,10,ch117data}; - -/* char: 0x74 't' */ - -static const GLubyte ch116data[] = { -0x18,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x30, -}; - -static const BitmapCharRec ch116 = {6,13,0,0,6,ch116data}; - -/* char: 0x73 's' */ - -static const GLubyte ch115data[] = { -0x78,0xfc,0xc6,0x6,0x3e,0xfc,0xc0,0xc6,0x7e,0x3c, -}; - -static const BitmapCharRec ch115 = {7,10,-1,0,9,ch115data}; - -/* char: 0x72 'r' */ - -static const GLubyte ch114data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xe0,0xd8,0xd8, -}; - -static const BitmapCharRec ch114 = {5,10,-1,0,6,ch114data}; - -/* char: 0x71 'q' */ - -static const GLubyte ch113data[] = { -0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, -0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80,0x7f,0x80,0x3d,0x80, -}; - -static const BitmapCharRec ch113 = {9,14,-1,4,11,ch113data}; - -/* char: 0x70 'p' */ - -static const GLubyte ch112data[] = { -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80, -0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0,0xff,0x0,0xde,0x0, -}; - -static const BitmapCharRec ch112 = {9,14,-1,4,11,ch112data}; - -/* char: 0x6f 'o' */ - -static const GLubyte ch111data[] = { -0x3e,0x0,0x7f,0x0,0x63,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x0, -0x7f,0x0,0x3e,0x0, -}; - -static const BitmapCharRec ch111 = {9,10,-1,0,11,ch111data}; - -/* char: 0x6e 'n' */ - -static const GLubyte ch110data[] = { -0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce, -}; - -static const BitmapCharRec ch110 = {8,10,-1,0,10,ch110data}; - -/* char: 0x6d 'm' */ - -static const GLubyte ch109data[] = { -0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xc6,0x30,0xe7,0x30, -0xde,0xf0,0xcc,0x60, -}; - -static const BitmapCharRec ch109 = {12,10,-1,0,14,ch109data}; - -/* char: 0x6c 'l' */ - -static const GLubyte ch108data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -}; - -static const BitmapCharRec ch108 = {2,14,-1,0,4,ch108data}; - -/* char: 0x6b 'k' */ - -static const GLubyte ch107data[] = { -0xc7,0xc6,0xce,0xcc,0xd8,0xf8,0xf0,0xd8,0xcc,0xc6,0xc0,0xc0,0xc0,0xc0, -}; - -static const BitmapCharRec ch107 = {8,14,-1,0,9,ch107data}; - -/* char: 0x6a 'j' */ - -static const GLubyte ch106data[] = { -0xe0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x0,0x0, -0x30,0x30, -}; - -static const BitmapCharRec ch106 = {4,18,1,4,4,ch106data}; - -/* char: 0x69 'i' */ - -static const GLubyte ch105data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch105 = {2,14,-1,0,4,ch105data}; - -/* char: 0x68 'h' */ - -static const GLubyte ch104data[] = { -0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xe3,0xdf,0xce,0xc0,0xc0,0xc0,0xc0, -}; - -static const BitmapCharRec ch104 = {8,14,-1,0,10,ch104data}; - -/* char: 0x67 'g' */ - -static const GLubyte ch103data[] = { -0x1c,0x0,0x7f,0x0,0x63,0x0,0x1,0x80,0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80, -0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x7f,0x80,0x3d,0x80, -}; - -static const BitmapCharRec ch103 = {9,14,-1,4,11,ch103data}; - -/* char: 0x66 'f' */ - -static const GLubyte ch102data[] = { -0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfc,0xfc,0x30,0x30,0x3c,0x1c, -}; - -static const BitmapCharRec ch102 = {6,14,0,0,6,ch102data}; - -/* char: 0x65 'e' */ - -static const GLubyte ch101data[] = { -0x3c,0x7f,0xe3,0xc0,0xc0,0xff,0xc3,0xc3,0x7e,0x3c, -}; - -static const BitmapCharRec ch101 = {8,10,-1,0,10,ch101data}; - -/* char: 0x64 'd' */ - -static const GLubyte ch100data[] = { -0x3d,0x80,0x7f,0x80,0x63,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x63,0x80, -0x7f,0x80,0x3d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, -}; - -static const BitmapCharRec ch100 = {9,14,-1,0,11,ch100data}; - -/* char: 0x63 'c' */ - -static const GLubyte ch99data[] = { -0x3e,0x7f,0x63,0xc0,0xc0,0xc0,0xc0,0x63,0x7f,0x3e, -}; - -static const BitmapCharRec ch99 = {8,10,-1,0,10,ch99data}; - -/* char: 0x62 'b' */ - -static const GLubyte ch98data[] = { -0xde,0x0,0xff,0x0,0xe3,0x0,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xe3,0x0, -0xff,0x0,0xde,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, -}; - -static const BitmapCharRec ch98 = {9,14,-1,0,11,ch98data}; - -/* char: 0x61 'a' */ - -static const GLubyte ch97data[] = { -0x76,0xee,0xc6,0xc6,0xe6,0x7e,0xe,0xc6,0xee,0x7c, -}; - -static const BitmapCharRec ch97 = {7,10,-1,0,9,ch97data}; - -/* char: 0x60 '`' */ - -static const GLubyte ch96data[] = { -0xc0,0xc0,0x80,0x80,0x40, -}; - -static const BitmapCharRec ch96 = {2,5,-1,-9,4,ch96data}; - -/* char: 0x5f '_' */ - -static const GLubyte ch95data[] = { -0xff,0xc0,0xff,0xc0, -}; - -static const BitmapCharRec ch95 = {10,2,0,4,10,ch95data}; - -/* char: 0x5e '^' */ - -static const GLubyte ch94data[] = { -0x82,0xc6,0x6c,0x38,0x10, -}; - -static const BitmapCharRec ch94 = {7,5,-1,-8,9,ch94data}; - -/* char: 0x5d ']' */ - -static const GLubyte ch93data[] = { -0xf0,0xf0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0xf0,0xf0, -}; - -static const BitmapCharRec ch93 = {4,18,0,4,5,ch93data}; - -/* char: 0x5c '\' */ - -static const GLubyte ch92data[] = { -0x18,0x18,0x10,0x10,0x30,0x30,0x20,0x20,0x60,0x60,0x40,0x40,0xc0,0xc0, -}; - -static const BitmapCharRec ch92 = {5,14,0,0,5,ch92data}; - -/* char: 0x5b '[' */ - -static const GLubyte ch91data[] = { -0xf0,0xf0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xf0,0xf0, -}; - -static const BitmapCharRec ch91 = {4,18,-1,4,5,ch91data}; - -/* char: 0x5a 'Z' */ - -static const GLubyte ch90data[] = { -0xff,0xc0,0xff,0xc0,0xc0,0x0,0x60,0x0,0x30,0x0,0x18,0x0,0x1c,0x0,0xc,0x0, -0x6,0x0,0x3,0x0,0x1,0x80,0x0,0xc0,0xff,0xc0,0xff,0xc0, -}; - -static const BitmapCharRec ch90 = {10,14,-1,0,12,ch90data}; - -/* char: 0x59 'Y' */ - -static const GLubyte ch89data[] = { -0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xf,0x0,0x19,0x80, -0x30,0xc0,0x30,0xc0,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, -}; - -static const BitmapCharRec ch89 = {12,14,-1,0,14,ch89data}; - -/* char: 0x58 'X' */ - -static const GLubyte ch88data[] = { -0xc0,0x60,0xe0,0xe0,0x60,0xc0,0x71,0xc0,0x31,0x80,0x1b,0x0,0xe,0x0,0xe,0x0, -0x1b,0x0,0x31,0x80,0x71,0xc0,0x60,0xc0,0xe0,0xe0,0xc0,0x60, -}; - -static const BitmapCharRec ch88 = {11,14,-1,0,13,ch88data}; - -/* char: 0x57 'W' */ - -static const GLubyte ch87data[] = { -0x18,0x18,0x18,0x18,0x1c,0x38,0x34,0x2c,0x36,0x6c,0x36,0x6c,0x66,0x66,0x66,0x66, -0x62,0x46,0x63,0xc6,0xc3,0xc3,0xc1,0x83,0xc1,0x83,0xc1,0x83, -}; - -static const BitmapCharRec ch87 = {16,14,-1,0,18,ch87data}; - -/* char: 0x56 'V' */ - -static const GLubyte ch86data[] = { -0x6,0x0,0xf,0x0,0xf,0x0,0x19,0x80,0x19,0x80,0x19,0x80,0x30,0xc0,0x30,0xc0, -0x30,0xc0,0x60,0x60,0x60,0x60,0x60,0x60,0xc0,0x30,0xc0,0x30, -}; - -static const BitmapCharRec ch86 = {12,14,-1,0,14,ch86data}; - -/* char: 0x55 'U' */ - -static const GLubyte ch85data[] = { -0x1f,0x0,0x7f,0xc0,0x60,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -}; - -static const BitmapCharRec ch85 = {11,14,-1,0,13,ch85data}; - -/* char: 0x54 'T' */ - -static const GLubyte ch84data[] = { -0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0, -0xc,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0xff,0xc0,0xff,0xc0, -}; - -static const BitmapCharRec ch84 = {10,14,-1,0,12,ch84data}; - -/* char: 0x53 'S' */ - -static const GLubyte ch83data[] = { -0x3f,0x0,0x7f,0xc0,0xe0,0xe0,0xc0,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0,0x1f,0x0, -0x7c,0x0,0xe0,0x0,0xc0,0x60,0xe0,0xe0,0x7f,0xc0,0x1f,0x0, -}; - -static const BitmapCharRec ch83 = {11,14,-1,0,13,ch83data}; - -/* char: 0x52 'R' */ - -static const GLubyte ch82data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0x80,0xc1,0x80,0xff,0x0,0xff,0x80, -0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, -}; - -static const BitmapCharRec ch82 = {10,14,-1,0,12,ch82data}; - -/* char: 0x51 'Q' */ - -static const GLubyte ch81data[] = { -0x0,0x30,0xf,0xb0,0x3f,0xe0,0x70,0xf0,0x61,0xb0,0xe1,0xb8,0xc0,0x18,0xc0,0x18, -0xc0,0x18,0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, -}; - -static const BitmapCharRec ch81 = {13,15,-1,1,15,ch81data}; - -/* char: 0x50 'P' */ - -static const GLubyte ch80data[] = { -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x80, -0xc1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, -}; - -static const BitmapCharRec ch80 = {10,14,-1,0,12,ch80data}; - -/* char: 0x4f 'O' */ - -static const GLubyte ch79data[] = { -0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x38,0xc0,0x18,0xc0,0x18,0xc0,0x18, -0xc0,0x18,0xe0,0x38,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, -}; - -static const BitmapCharRec ch79 = {13,14,-1,0,15,ch79data}; - -/* char: 0x4e 'N' */ - -static const GLubyte ch78data[] = { -0xc0,0x60,0xc0,0xe0,0xc1,0xe0,0xc1,0xe0,0xc3,0x60,0xc6,0x60,0xc6,0x60,0xcc,0x60, -0xcc,0x60,0xd8,0x60,0xf0,0x60,0xf0,0x60,0xe0,0x60,0xc0,0x60, -}; - -static const BitmapCharRec ch78 = {11,14,-1,0,13,ch78data}; - -/* char: 0x4d 'M' */ - -static const GLubyte ch77data[] = { -0xc3,0xc,0xc3,0xc,0xc7,0x8c,0xc4,0x8c,0xcc,0xcc,0xcc,0xcc,0xd8,0x6c,0xd8,0x6c, -0xf0,0x3c,0xf0,0x3c,0xe0,0x1c,0xe0,0x1c,0xc0,0xc,0xc0,0xc, -}; - -static const BitmapCharRec ch77 = {14,14,-1,0,16,ch77data}; - -/* char: 0x4c 'L' */ - -static const GLubyte ch76data[] = { -0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -}; - -static const BitmapCharRec ch76 = {8,14,-1,0,10,ch76data}; - -/* char: 0x4b 'K' */ - -static const GLubyte ch75data[] = { -0xc0,0x70,0xc0,0xe0,0xc1,0xc0,0xc3,0x80,0xc7,0x0,0xce,0x0,0xfc,0x0,0xf8,0x0, -0xdc,0x0,0xce,0x0,0xc7,0x0,0xc3,0x80,0xc1,0xc0,0xc0,0xe0, -}; - -static const BitmapCharRec ch75 = {12,14,-1,0,13,ch75data}; - -/* char: 0x4a 'J' */ - -static const GLubyte ch74data[] = { -0x3c,0x7e,0xe7,0xc3,0xc3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3,0x3, -}; - -static const BitmapCharRec ch74 = {8,14,-1,0,10,ch74data}; - -/* char: 0x49 'I' */ - -static const GLubyte ch73data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -}; - -static const BitmapCharRec ch73 = {2,14,-2,0,6,ch73data}; - -/* char: 0x48 'H' */ - -static const GLubyte ch72data[] = { -0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xff,0xe0,0xff,0xe0, -0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -}; - -static const BitmapCharRec ch72 = {11,14,-1,0,13,ch72data}; - -/* char: 0x47 'G' */ - -static const GLubyte ch71data[] = { -0xf,0xb0,0x3f,0xf0,0x70,0x70,0x60,0x30,0xe0,0x30,0xc1,0xf0,0xc1,0xf0,0xc0,0x0, -0xc0,0x0,0xe0,0x30,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, -}; - -static const BitmapCharRec ch71 = {12,14,-1,0,14,ch71data}; - -/* char: 0x46 'F' */ - -static const GLubyte ch70data[] = { -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, -}; - -static const BitmapCharRec ch70 = {9,14,-1,0,11,ch70data}; - -/* char: 0x45 'E' */ - -static const GLubyte ch69data[] = { -0xff,0x80,0xff,0x80,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x0,0xff,0x0, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80,0xff,0x80, -}; - -static const BitmapCharRec ch69 = {9,14,-1,0,11,ch69data}; - -/* char: 0x44 'D' */ - -static const GLubyte ch68data[] = { -0xff,0x0,0xff,0x80,0xc1,0xc0,0xc0,0xc0,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60, -0xc0,0x60,0xc0,0x60,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, -}; - -static const BitmapCharRec ch68 = {11,14,-1,0,13,ch68data}; - -/* char: 0x43 'C' */ - -static const GLubyte ch67data[] = { -0xf,0x80,0x3f,0xe0,0x70,0x70,0x60,0x30,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, -0xc0,0x0,0xe0,0x0,0x60,0x30,0x70,0x70,0x3f,0xe0,0xf,0x80, -}; - -static const BitmapCharRec ch67 = {12,14,-1,0,14,ch67data}; - -/* char: 0x42 'B' */ - -static const GLubyte ch66data[] = { -0xff,0x80,0xff,0xc0,0xc0,0xe0,0xc0,0x60,0xc0,0x60,0xc0,0xe0,0xff,0xc0,0xff,0x80, -0xc1,0x80,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0xff,0x80,0xff,0x0, -}; - -static const BitmapCharRec ch66 = {11,14,-1,0,13,ch66data}; - -/* char: 0x41 'A' */ - -static const GLubyte ch65data[] = { -0xc0,0x30,0xc0,0x30,0x60,0x60,0x60,0x60,0x7f,0xe0,0x3f,0xc0,0x30,0xc0,0x30,0xc0, -0x19,0x80,0x19,0x80,0xf,0x0,0xf,0x0,0x6,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch65 = {12,14,0,0,12,ch65data}; - -/* char: 0x40 '@' */ - -static const GLubyte ch64data[] = { -0x7,0xe0,0x1f,0xf0,0x38,0x0,0x70,0x0,0x67,0x70,0xcf,0xf8,0xcc,0xcc,0xcc,0x66, -0xcc,0x66,0xcc,0x63,0xc6,0x33,0x67,0x73,0x63,0xb3,0x30,0x6,0x1c,0xe,0xf,0xfc, -0x3,0xf0, -}; - -static const BitmapCharRec ch64 = {16,17,-1,3,18,ch64data}; - -/* char: 0x3f '?' */ - -static const GLubyte ch63data[] = { -0x30,0x30,0x0,0x0,0x30,0x30,0x30,0x38,0x1c,0xe,0xc6,0xc6,0xfe,0x7c, -}; - -static const BitmapCharRec ch63 = {7,14,-1,0,10,ch63data}; - -/* char: 0x3e '>' */ - -static const GLubyte ch62data[] = { -0xc0,0xf0,0x3c,0xe,0x3,0xe,0x3c,0xf0,0xc0, -}; - -static const BitmapCharRec ch62 = {8,9,-1,0,10,ch62data}; - -/* char: 0x3d '=' */ - -static const GLubyte ch61data[] = { -0xfe,0xfe,0x0,0x0,0xfe,0xfe, -}; - -static const BitmapCharRec ch61 = {7,6,-2,-2,11,ch61data}; - -/* char: 0x3c '<' */ - -static const GLubyte ch60data[] = { -0x3,0xf,0x3c,0x70,0xc0,0x70,0x3c,0xf,0x3, -}; - -static const BitmapCharRec ch60 = {8,9,-1,0,10,ch60data}; - -/* char: 0x3b ';' */ - -static const GLubyte ch59data[] = { -0x80,0x40,0x40,0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch59 = {2,13,-1,3,5,ch59data}; - -/* char: 0x3a ':' */ - -static const GLubyte ch58data[] = { -0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch58 = {2,10,-1,0,5,ch58data}; - -/* char: 0x39 '9' */ - -static const GLubyte ch57data[] = { -0x7c,0xfe,0xc6,0x3,0x3,0x3b,0x7f,0xc3,0xc3,0xc3,0xc7,0x7e,0x3c, -}; - -static const BitmapCharRec ch57 = {8,13,-1,0,10,ch57data}; - -/* char: 0x38 '8' */ - -static const GLubyte ch56data[] = { -0x3c,0x7e,0xe7,0xc3,0xc3,0x66,0x7e,0x66,0xc3,0xc3,0xe7,0x7e,0x3c, -}; - -static const BitmapCharRec ch56 = {8,13,-1,0,10,ch56data}; - -/* char: 0x37 '7' */ - -static const GLubyte ch55data[] = { -0x60,0x60,0x30,0x30,0x30,0x18,0x18,0xc,0xc,0x6,0x3,0xff,0xff, -}; - -static const BitmapCharRec ch55 = {8,13,-1,0,10,ch55data}; - -/* char: 0x36 '6' */ - -static const GLubyte ch54data[] = { -0x3c,0x7e,0xe3,0xc3,0xc3,0xc3,0xfe,0xdc,0xc0,0xc0,0x63,0x7f,0x3c, -}; - -static const BitmapCharRec ch54 = {8,13,-1,0,10,ch54data}; - -/* char: 0x35 '5' */ - -static const GLubyte ch53data[] = { -0x7c,0xfe,0xc7,0xc3,0x3,0x3,0xc7,0xfe,0xfc,0xc0,0xc0,0xfe,0xfe, -}; - -static const BitmapCharRec ch53 = {8,13,-1,0,10,ch53data}; - -/* char: 0x34 '4' */ - -static const GLubyte ch52data[] = { -0x3,0x0,0x3,0x0,0x3,0x0,0xff,0x80,0xff,0x80,0xc3,0x0,0x63,0x0,0x33,0x0, -0x33,0x0,0x1b,0x0,0xf,0x0,0x7,0x0,0x3,0x0, -}; - -static const BitmapCharRec ch52 = {9,13,-1,0,10,ch52data}; - -/* char: 0x33 '3' */ - -static const GLubyte ch51data[] = { -0x3c,0x7e,0xc7,0xc3,0x3,0x7,0x1e,0x1c,0x6,0xc3,0xc3,0x7e,0x3c, -}; - -static const BitmapCharRec ch51 = {8,13,-1,0,10,ch51data}; - -/* char: 0x32 '2' */ - -static const GLubyte ch50data[] = { -0xff,0xff,0xc0,0xe0,0x70,0x38,0x1c,0xe,0x7,0x3,0xc3,0xfe,0x3c, -}; - -static const BitmapCharRec ch50 = {8,13,-1,0,10,ch50data}; - -/* char: 0x31 '1' */ - -static const GLubyte ch49data[] = { -0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0xf8,0x18, -}; - -static const BitmapCharRec ch49 = {5,13,-2,0,10,ch49data}; - -/* char: 0x30 '0' */ - -static const GLubyte ch48data[] = { -0x3c,0x7e,0x66,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x66,0x7e,0x3c, -}; - -static const BitmapCharRec ch48 = {8,13,-1,0,10,ch48data}; - -/* char: 0x2f '/' */ - -static const GLubyte ch47data[] = { -0xc0,0xc0,0x40,0x40,0x60,0x60,0x20,0x20,0x30,0x30,0x10,0x10,0x18,0x18, -}; - -static const BitmapCharRec ch47 = {5,14,0,0,5,ch47data}; - -/* char: 0x2e '.' */ - -static const GLubyte ch46data[] = { -0xc0,0xc0, -}; - -static const BitmapCharRec ch46 = {2,2,-1,0,5,ch46data}; - -/* char: 0x2d '-' */ - -static const GLubyte ch45data[] = { -0xff,0xff, -}; - -static const BitmapCharRec ch45 = {8,2,-1,-4,11,ch45data}; - -/* char: 0x2c ',' */ - -static const GLubyte ch44data[] = { -0x80,0x40,0x40,0xc0,0xc0, -}; - -static const BitmapCharRec ch44 = {2,5,-1,3,5,ch44data}; - -/* char: 0x2b '+' */ - -static const GLubyte ch43data[] = { -0x18,0x18,0x18,0x18,0xff,0xff,0x18,0x18,0x18,0x18, -}; - -static const BitmapCharRec ch43 = {8,10,-1,0,10,ch43data}; - -/* char: 0x2a '*' */ - -static const GLubyte ch42data[] = { -0x88,0x70,0x70,0xf8,0x20,0x20, -}; - -static const BitmapCharRec ch42 = {5,6,-1,-8,7,ch42data}; - -/* char: 0x29 ')' */ - -static const GLubyte ch41data[] = { -0x80,0xc0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60, -0xc0,0x80, -}; - -static const BitmapCharRec ch41 = {4,18,-1,4,6,ch41data}; - -/* char: 0x28 '(' */ - -static const GLubyte ch40data[] = { -0x10,0x30,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60,0x60, -0x30,0x10, -}; - -static const BitmapCharRec ch40 = {4,18,-1,4,6,ch40data}; - -/* char: 0x27 ''' */ - -static const GLubyte ch39data[] = { -0x80,0x40,0x40,0xc0,0xc0, -}; - -static const BitmapCharRec ch39 = {2,5,-1,-9,4,ch39data}; - -/* char: 0x26 '&' */ - -static const GLubyte ch38data[] = { -0x3c,0x70,0x7e,0xe0,0xe7,0xc0,0xc3,0x80,0xc3,0xc0,0xc6,0xc0,0xee,0xc0,0x7c,0x0, -0x3c,0x0,0x66,0x0,0x66,0x0,0x7e,0x0,0x3c,0x0, -}; - -static const BitmapCharRec ch38 = {12,13,-1,0,13,ch38data}; - -/* char: 0x25 '%' */ - -static const GLubyte ch37data[] = { -0x18,0x78,0x18,0xfc,0xc,0xcc,0xc,0xcc,0x6,0xfc,0x6,0x78,0x3,0x0,0x7b,0x0, -0xfd,0x80,0xcd,0x80,0xcc,0xc0,0xfc,0xc0,0x78,0x60, -}; - -static const BitmapCharRec ch37 = {14,13,-1,0,16,ch37data}; - -/* char: 0x24 '$' */ - -static const GLubyte ch36data[] = { -0x8,0x0,0x8,0x0,0x3e,0x0,0x7f,0x0,0xeb,0x80,0xc9,0x80,0x9,0x80,0xf,0x0, -0x3e,0x0,0x78,0x0,0xe8,0x0,0xc8,0x0,0xcb,0x0,0x7f,0x0,0x3e,0x0,0x8,0x0, -}; - -static const BitmapCharRec ch36 = {9,16,-1,2,10,ch36data}; - -/* char: 0x23 '#' */ - -static const GLubyte ch35data[] = { -0x24,0x0,0x24,0x0,0x24,0x0,0xff,0x80,0xff,0x80,0x12,0x0,0x12,0x0,0x12,0x0, -0x7f,0xc0,0x7f,0xc0,0x9,0x0,0x9,0x0,0x9,0x0, -}; - -static const BitmapCharRec ch35 = {10,13,0,0,10,ch35data}; - -/* char: 0x22 '"' */ - -static const GLubyte ch34data[] = { -0x90,0x90,0xd8,0xd8,0xd8, -}; - -static const BitmapCharRec ch34 = {5,5,0,-9,5,ch34data}; - -/* char: 0x21 '!' */ - -static const GLubyte ch33data[] = { -0xc0,0xc0,0x0,0x0,0x80,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -}; - -static const BitmapCharRec ch33 = {2,14,-2,0,6,ch33data}; - -/* char: 0x20 ' ' */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch32data[] = { 0x0 }; -static const BitmapCharRec ch32 = {1,1,0,0,5,ch32data}; -#else -static const BitmapCharRec ch32 = {0,0,0,0,5,0}; -#endif - -static const BitmapCharRec * const chars[] = { -&ch32, -&ch33, -&ch34, -&ch35, -&ch36, -&ch37, -&ch38, -&ch39, -&ch40, -&ch41, -&ch42, -&ch43, -&ch44, -&ch45, -&ch46, -&ch47, -&ch48, -&ch49, -&ch50, -&ch51, -&ch52, -&ch53, -&ch54, -&ch55, -&ch56, -&ch57, -&ch58, -&ch59, -&ch60, -&ch61, -&ch62, -&ch63, -&ch64, -&ch65, -&ch66, -&ch67, -&ch68, -&ch69, -&ch70, -&ch71, -&ch72, -&ch73, -&ch74, -&ch75, -&ch76, -&ch77, -&ch78, -&ch79, -&ch80, -&ch81, -&ch82, -&ch83, -&ch84, -&ch85, -&ch86, -&ch87, -&ch88, -&ch89, -&ch90, -&ch91, -&ch92, -&ch93, -&ch94, -&ch95, -&ch96, -&ch97, -&ch98, -&ch99, -&ch100, -&ch101, -&ch102, -&ch103, -&ch104, -&ch105, -&ch106, -&ch107, -&ch108, -&ch109, -&ch110, -&ch111, -&ch112, -&ch113, -&ch114, -&ch115, -&ch116, -&ch117, -&ch118, -&ch119, -&ch120, -&ch121, -&ch122, -&ch123, -&ch124, -&ch125, -&ch126, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -&ch160, -&ch161, -&ch162, -&ch163, -&ch164, -&ch165, -&ch166, -&ch167, -&ch168, -&ch169, -&ch170, -&ch171, -&ch172, -&ch173, -&ch174, -&ch175, -&ch176, -&ch177, -&ch178, -&ch179, -&ch180, -&ch181, -&ch182, -&ch183, -&ch184, -&ch185, -&ch186, -&ch187, -&ch188, -&ch189, -&ch190, -&ch191, -&ch192, -&ch193, -&ch194, -&ch195, -&ch196, -&ch197, -&ch198, -&ch199, -&ch200, -&ch201, -&ch202, -&ch203, -&ch204, -&ch205, -&ch206, -&ch207, -&ch208, -&ch209, -&ch210, -&ch211, -&ch212, -&ch213, -&ch214, -&ch215, -&ch216, -&ch217, -&ch218, -&ch219, -&ch220, -&ch221, -&ch222, -&ch223, -&ch224, -&ch225, -&ch226, -&ch227, -&ch228, -&ch229, -&ch230, -&ch231, -&ch232, -&ch233, -&ch234, -&ch235, -&ch236, -&ch237, -&ch238, -&ch239, -&ch240, -&ch241, -&ch242, -&ch243, -&ch244, -&ch245, -&ch246, -&ch247, -&ch248, -&ch249, -&ch250, -&ch251, -&ch252, -&ch253, -&ch254, -&ch255, -}; - -#if !defined(__IBMCPP__) -const -#endif -BitmapFontRec glutBitmapHelvetica18 = { -"-adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1", -224, -32, -chars -}; - diff --git a/src/glut/os2/glut_init.cpp b/src/glut/os2/glut_init.cpp deleted file mode 100644 index 9e9f2e366e..0000000000 --- a/src/glut/os2/glut_init.cpp +++ /dev/null @@ -1,451 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#ifdef __VMS -#include -#endif - -#include -#include -#include - -#if !defined(_WIN32) && !defined(__OS2__) - #include - #include -#endif - -/* SGI optimization introduced in IRIX 6.3 to avoid X server - round trips for interning common X atoms. */ -#if defined(_SGI_EXTRA_PREDEFINES) && !defined(NO_FAST_ATOMS) -#include -#else -#define XSGIFastInternAtom(dpy,string,fast_name,how) XInternAtom(dpy,string,how) -#endif - -#include "glutint.h" - -/* GLUT inter-file variables */ -/* *INDENT-OFF* */ -char *__glutProgramName = NULL; -int __glutArgc = 0; -char **__glutArgv = NULL; -char *__glutGeometry = NULL; -Display *__glutDisplay = NULL; -int __glutScreen; -Window __glutRoot; -int __glutScreenHeight; -int __glutScreenWidth; -GLboolean __glutIconic = GL_FALSE; -GLboolean __glutDebug = GL_FALSE; -unsigned int __glutDisplayMode = - GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH; -char *__glutDisplayString = NULL; -int __glutConnectionFD; -XSizeHints __glutSizeHints = {0}; -int __glutInitWidth = 300, __glutInitHeight = 300; -int __glutInitX = -1, __glutInitY = -1; -GLboolean __glutForceDirect = GL_FALSE, - __glutTryDirect = GL_TRUE; -Atom __glutWMDeleteWindow; -/* *INDENT-ON* */ - -#ifdef _WIN32 -void (__cdecl *__glutExitFunc)(int retval) = NULL; -#endif - -static Bool synchronize = False; - -#if defined(__OS2__) - -MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); -MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); - - -void __glutOpenOS2Connection(char* display) -{ - static char *classname=NULL; -extern HAB hab; /* PM anchor block handle */ -ERRORID erridErrorCode;/* last error id code */ -int ii; - - /* Make sure we register the window only once. */ - if(classname) - return; - - classname = "GLUT"; - - if ( !WinRegisterClass( hab, /* PM anchor block handle */ - classname,/* window class name */ - GlutWindowProc,/* address of window procedure*/ - CS_SIZEREDRAW, /* |CS_SYNCPAINT size changes cause redrawing */ - 0UL ) ) /* window data */ - { erridErrorCode = WinGetLastError(hab); - ii = erridErrorCode; - return; - } - - classname = "GLUTCHILD"; - - if ( !WinRegisterClass( hab, /* PM anchor block handle */ - classname,/* window class name */ - GlutWindowChildProc,/* address of window procedure*/ - CS_SIZEREDRAW, /* size changes cause redrawing */ - 0UL ) ) /* window data */ - { erridErrorCode = WinGetLastError(hab); - ii = erridErrorCode; - return; - } - - __glutScreenWidth = GetSystemMetrics(SM_CXSCREEN); - __glutScreenHeight = GetSystemMetrics(SM_CYSCREEN); - - /* Set the root window to NULL because windows creates a top-level - window when the parent is NULL. X creates a top-level window - when the parent is the root window. */ - __glutRoot = NULLHANDLE; - - /* Set the display to 1 -- we shouldn't be using this anywhere - (except as an argument to X calls). */ - __glutDisplay = (Display*)1; - - /* There isn't any concept of multiple screens in Win32, therefore, - we don't need to keep track of the screen we're on... it's always - the same one. */ - __glutScreen = 0; -} - -#elif defined(_WIN32) - -#ifdef __BORLANDC__ -#include /* For masking floating point exceptions. */ -#endif - -void -__glutOpenWin32Connection(char* display) -{ - static char *classname; - WNDCLASS wc; - HINSTANCE hInstance = GetModuleHandle(NULL); - - /* Make sure we register the window only once. */ - if(classname) - return; - -#ifdef __BORLANDC__ - /* Under certain conditions (e.g. while rendering solid surfaces with - lighting enabled) Microsoft OpenGL libraries cause some illegal - operations like floating point overflow or division by zero. The - default behaviour of Microsoft compilers is to mask (ignore) - floating point exceptions, while Borland compilers do not. The - following function of Borland RTL allows to mask exceptions. - Advice from Pier Giorgio Esposito (mc2172@mclink.it). */ - _control87(MCW_EM,MCW_EM); -#endif - - classname = "GLUT"; - - /* Clear (important!) and then fill in the window class structure. */ - memset(&wc, 0, sizeof(WNDCLASS)); - wc.style = CS_OWNDC; - wc.lpfnWndProc = (WNDPROC)__glutWindowProc; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, "GLUT_ICON"); - wc.hCursor = LoadCursor(hInstance, IDC_ARROW); - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; - wc.lpszClassName = classname; - - /* Fill in a default icon if one isn't specified as a resource. */ - if(!wc.hIcon) - wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); - - if(!RegisterClass(&wc)) { - __glutFatalError("RegisterClass() failed:" - "Cannot register GLUT window class."); - } - - __glutScreenWidth = GetSystemMetrics(SM_CXSCREEN); - __glutScreenHeight = GetSystemMetrics(SM_CYSCREEN); - - /* Set the root window to NULL because windows creates a top-level - window when the parent is NULL. X creates a top-level window - when the parent is the root window. */ - __glutRoot = NULL; - - /* Set the display to 1 -- we shouldn't be using this anywhere - (except as an argument to X calls). */ - __glutDisplay = (Display*)1; - - /* There isn't any concept of multiple screens in Win32, therefore, - we don't need to keep track of the screen we're on... it's always - the same one. */ - __glutScreen = 0; -} -#else /* !_WIN32 */ -void -__glutOpenXConnection(char *display) -{ - int errorBase, eventBase; - - __glutDisplay = XOpenDisplay(display); - if (!__glutDisplay) - __glutFatalError("could not open display: %s", - XDisplayName(display)); - if (synchronize) - XSynchronize(__glutDisplay, True); - if (!glXQueryExtension(__glutDisplay, &errorBase, &eventBase)) - __glutFatalError( - "OpenGL GLX extension not supported by display: %s", - XDisplayName(display)); - __glutScreen = DefaultScreen(__glutDisplay); - __glutRoot = RootWindow(__glutDisplay, __glutScreen); - __glutScreenWidth = DisplayWidth(__glutDisplay, __glutScreen); - __glutScreenHeight = DisplayHeight(__glutDisplay, - __glutScreen); - __glutConnectionFD = ConnectionNumber(__glutDisplay); - __glutWMDeleteWindow = XSGIFastInternAtom(__glutDisplay, - "WM_DELETE_WINDOW", SGI_XA_WM_DELETE_WINDOW, False); -} -#endif /* _WIN32 */ - -void -#ifdef OLD_VMS - __glutInitTime(struct timeval6 *beginning) -#else - __glutInitTime(struct timeval *beginning) -#endif -{ - static int beenhere = 0; -#ifdef OLD_VMS - static struct timeval6 genesis; -#else - static struct timeval genesis; -#endif - - if (!beenhere) { - GETTIMEOFDAY(&genesis); - beenhere = 1; - } - *beginning = genesis; -} - -static void -removeArgs(int *argcp, char **argv, int numToRemove) -{ - int i, j; - - for (i = 0, j = numToRemove; argv[j]; i++, j++) { - argv[i] = argv[j]; - } - argv[i] = NULL; - *argcp -= numToRemove; -} - -void GLUTAPIENTRY -glutInit(int *argcp, char **argv) -{ - char *display = NULL; - char *str, *geometry = NULL; -#ifdef OLD_VMS - struct timeval6 unused; -#else - struct timeval unused; -#endif - int i; - - if (__glutDisplay) { - __glutWarning("glutInit being called a second time."); - return; - } - /* Determine temporary program name. */ - str = strrchr(argv[0], '/'); - if (str == NULL) { - __glutProgramName = argv[0]; - } else { - __glutProgramName = str + 1; - } - - /* Make private copy of command line arguments. */ - __glutArgc = *argcp; - __glutArgv = (char **) malloc(__glutArgc * sizeof(char *)); - if (!__glutArgv) - __glutFatalError("out of memory."); - for (i = 0; i < __glutArgc; i++) { - __glutArgv[i] = __glutStrdup(argv[i]); - if (!__glutArgv[i]) - __glutFatalError("out of memory."); - } - - /* determine permanent program name */ - str = strrchr(__glutArgv[0], '/'); - if (str == NULL) { - __glutProgramName = __glutArgv[0]; - } else { - __glutProgramName = str + 1; - } - - /* parse arguments for standard options */ - for (i = 1; i < __glutArgc; i++) { - if (!strcmp(__glutArgv[i], "-display")) { -#if defined(_WIN32) - __glutWarning("-display option not supported by Win32 GLUT."); -#endif - if (++i >= __glutArgc) { - __glutFatalError( - "follow -display option with X display name."); - } - display = __glutArgv[i]; - removeArgs(argcp, &argv[1], 2); - } else if (!strcmp(__glutArgv[i], "-geometry")) { - if (++i >= __glutArgc) { - __glutFatalError( - "follow -geometry option with geometry parameter."); - } - geometry = __glutArgv[i]; - removeArgs(argcp, &argv[1], 2); - } else if (!strcmp(__glutArgv[i], "-direct")) { -#if defined(_WIN32) - __glutWarning("-direct option not supported by Win32 GLUT."); -#endif - if (!__glutTryDirect) - __glutFatalError( - "cannot force both direct and indirect rendering."); - __glutForceDirect = GL_TRUE; - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-indirect")) { -#if defined(_WIN32) - __glutWarning("-indirect option not supported by Win32 GLUT."); -#endif - if (__glutForceDirect) - __glutFatalError( - "cannot force both direct and indirect rendering."); - __glutTryDirect = GL_FALSE; - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-iconic")) { - __glutIconic = GL_TRUE; - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-gldebug")) { - __glutDebug = GL_TRUE; - removeArgs(argcp, &argv[1], 1); - } else if (!strcmp(__glutArgv[i], "-sync")) { -#if defined(_WIN32) - __glutWarning("-sync option not supported by Win32 GLUT."); -#endif - synchronize = GL_TRUE; - removeArgs(argcp, &argv[1], 1); - } else { - /* Once unknown option encountered, stop command line - processing. */ - break; - } - } -#if defined(__OS2__) - __glutOpenOS2Connection(display); -#elif defined(_WIN32) - __glutOpenWin32Connection(display); -#else - __glutOpenXConnection(display); -#endif - if (geometry) { - int flags, x, y, width, height; - - /* Fix bogus "{width|height} may be used before set" - warning */ - width = 0; - height = 0; - - flags = XParseGeometry(geometry, &x, &y, - (unsigned int *) &width, (unsigned int *) &height); - if (WidthValue & flags) { - /* Careful because X does not allow zero or negative - width windows */ - if (width > 0) - __glutInitWidth = width; - } - if (HeightValue & flags) { - /* Careful because X does not allow zero or negative - height windows */ - if (height > 0) - __glutInitHeight = height; - } - glutInitWindowSize(__glutInitWidth, __glutInitHeight); - if (XValue & flags) { - if (XNegative & flags) - x = DisplayWidth(__glutDisplay, __glutScreen) + - x - __glutSizeHints.width; - /* Play safe: reject negative X locations */ - if (x >= 0) - __glutInitX = x; - } - if (YValue & flags) { - if (YNegative & flags) - y = DisplayHeight(__glutDisplay, __glutScreen) + - y - __glutSizeHints.height; - /* Play safe: reject negative Y locations */ - if (y >= 0) - __glutInitY = y; - } - glutInitWindowPosition(__glutInitX, __glutInitY); - } - __glutInitTime(&unused); - - /* check if GLUT_FPS env var is set */ - { - const char *fps = getenv("GLUT_FPS"); - if (fps) { - sscanf(fps, "%d", &__glutFPS); - if (__glutFPS <= 0) - __glutFPS = 5000; /* 5000 milliseconds */ - } - } -} - -#ifdef _WIN32 -void APIENTRY -__glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int)) -{ - __glutExitFunc = exitfunc; - glutInit(argcp, argv); -} -#endif - -/* CENTRY */ -void GLUTAPIENTRY -glutInitWindowPosition(int x, int y) -{ - __glutInitX = x; - __glutInitY = y; - if (x >= 0 && y >= 0) { - __glutSizeHints.x = x; - __glutSizeHints.y = y; - __glutSizeHints.flags |= USPosition; - } else { - __glutSizeHints.flags &= ~USPosition; - } -} - -void GLUTAPIENTRY -glutInitWindowSize(int width, int height) -{ - __glutInitWidth = width; - __glutInitHeight = height; - if (width > 0 && height > 0) { - __glutSizeHints.width = width; - __glutSizeHints.height = height; - __glutSizeHints.flags |= USSize; - } else { - __glutSizeHints.flags &= ~USSize; - } -} - -void GLUTAPIENTRY -glutInitDisplayMode(unsigned int mask) -{ - __glutDisplayMode = mask; -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_input.cpp b/src/glut/os2/glut_input.cpp deleted file mode 100644 index e65b691cb1..0000000000 --- a/src/glut/os2/glut_input.cpp +++ /dev/null @@ -1,628 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include -#include -#include - -#include "glutint.h" -#define POFIG 0 -#if POFIG - -int __glutNumDials = 0; -int __glutNumSpaceballButtons = 0; -int __glutNumButtonBoxButtons = 0; -int __glutNumTabletButtons = 0; -int __glutNumMouseButtons = 3; /* Good guess. */ -XDevice *__glutTablet = NULL; -XDevice *__glutDials = NULL; -XDevice *__glutSpaceball = NULL; - -int __glutHasJoystick = 0; -int __glutNumJoystickButtons = 0; -int __glutNumJoystickAxes = 0; - -#if !defined(_WIN32) -typedef struct _Range { - int min; - int range; -} Range; - -#define NUM_SPACEBALL_AXIS 6 -#define NUM_TABLET_AXIS 2 -#define NUM_DIALS_AXIS 8 - -Range __glutSpaceballRange[NUM_SPACEBALL_AXIS]; -Range __glutTabletRange[NUM_TABLET_AXIS]; -int *__glutDialsResolution; - -/* Safely assumes 0 is an illegal event type for X Input - extension events. */ -int __glutDeviceMotionNotify = 0; -int __glutDeviceButtonPress = 0; -int __glutDeviceButtonPressGrab = 0; -int __glutDeviceButtonRelease = 0; -int __glutDeviceStateNotify = 0; - -static int -normalizeTabletPos(int axis, int rawValue) -{ - assert(rawValue >= __glutTabletRange[axis].min); - assert(rawValue <= __glutTabletRange[axis].min - + __glutTabletRange[axis].range); - /* Normalize rawValue to between 0 and 4000. */ - return ((rawValue - __glutTabletRange[axis].min) * 4000) / - __glutTabletRange[axis].range; -} - -static int -normalizeDialAngle(int axis, int rawValue) -{ - /* XXX Assumption made that the resolution of the device is - number of clicks for one complete dial revolution. This - is true for SGI's dial & button box. */ - return (rawValue * 360.0) / __glutDialsResolution[axis]; -} - -static int -normalizeSpaceballAngle(int axis, int rawValue) -{ - assert(rawValue >= __glutSpaceballRange[axis].min); - assert(rawValue <= __glutSpaceballRange[axis].min + - __glutSpaceballRange[axis].range); - /* Normalize rawValue to between -1800 and 1800. */ - return ((rawValue - __glutSpaceballRange[axis].min) * 3600) / - __glutSpaceballRange[axis].range - 1800; -} - -static int -normalizeSpaceballDelta(int axis, int rawValue) -{ - assert(rawValue >= __glutSpaceballRange[axis].min); - assert(rawValue <= __glutSpaceballRange[axis].min + - __glutSpaceballRange[axis].range); - /* Normalize rawValue to between -1000 and 1000. */ - return ((rawValue - __glutSpaceballRange[axis].min) * 2000) / - __glutSpaceballRange[axis].range - 1000; -} - -static void -queryTabletPos(GLUTwindow * window) -{ - XDeviceState *state; - XInputClass *any; - XValuatorState *v; - int i; - - state = XQueryDeviceState(__glutDisplay, __glutTablet); - any = state->data; - for (i = 0; i < state->num_classes; i++) { -#if defined(__cplusplus) || defined(c_plusplus) - switch (any->c_class) { -#else - switch (any->class) { -#endif - case ValuatorClass: - v = (XValuatorState *) any; - if (v->num_valuators < 2) - goto end; - if (window->tabletPos[0] == -1) - window->tabletPos[0] = normalizeTabletPos(0, v->valuators[0]); - if (window->tabletPos[1] == -1) - window->tabletPos[1] = normalizeTabletPos(1, v->valuators[1]); - } - any = (XInputClass *) ((char *) any + any->length); - } -end: - XFreeDeviceState(state); -} - -static void -tabletPosChange(GLUTwindow * window, int first, int count, int *data) -{ - int i, value, genEvent = 0; - - for (i = first; i < first + count; i++) { - switch (i) { - case 0: /* X axis */ - case 1: /* Y axis */ - value = normalizeTabletPos(i, data[i - first]); - if (value != window->tabletPos[i]) { - window->tabletPos[i] = value; - genEvent = 1; - } - break; - } - } - if (window->tabletPos[0] == -1 || window->tabletPos[1] == -1) - queryTabletPos(window); - if (genEvent) - window->tabletMotion(window->tabletPos[0], window->tabletPos[1]); -} -#endif /* !_WIN32 */ - -static int -__glutProcessDeviceEvents(XEvent * event) -{ -#if !defined(_WIN32) - GLUTwindow *window; - - /* XXX Ugly code fan out. */ - - /* Can't use switch/case since X Input event types are - dynamic. */ - - if (__glutDeviceMotionNotify && event->type == __glutDeviceMotionNotify) { - XDeviceMotionEvent *devmot = (XDeviceMotionEvent *) event; - - window = __glutGetWindow(devmot->window); - if (window) { - if (__glutTablet - && devmot->deviceid == __glutTablet->device_id - && window->tabletMotion) { - tabletPosChange(window, devmot->first_axis, devmot->axes_count, - devmot->axis_data); - } else if (__glutDials - && devmot->deviceid == __glutDials->device_id - && window->dials) { - int i, first = devmot->first_axis, count = devmot->axes_count; - - for (i = first; i < first + count; i++) - window->dials(i + 1, - normalizeDialAngle(i, devmot->axis_data[i - first])); - } else if (__glutSpaceball - && devmot->deviceid == __glutSpaceball->device_id) { - /* XXX Assume that space ball motion events come in as - all the first 6 axes. Assume first 3 axes are XYZ - translations; second 3 axes are XYZ rotations. */ - if (devmot->first_axis == 0 && devmot->axes_count == 6) { - if (window->spaceMotion) - window->spaceMotion( - normalizeSpaceballDelta(0, devmot->axis_data[0]), - normalizeSpaceballDelta(1, devmot->axis_data[1]), - normalizeSpaceballDelta(2, devmot->axis_data[2])); - if (window->spaceRotate) - window->spaceRotate( - normalizeSpaceballAngle(3, devmot->axis_data[3]), - normalizeSpaceballAngle(4, devmot->axis_data[4]), - normalizeSpaceballAngle(5, devmot->axis_data[5])); - } - } - return 1; - } - } else if (__glutDeviceButtonPress - && event->type == __glutDeviceButtonPress) { - XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event; - - window = __glutGetWindow(devbtn->window); - if (window) { - if (__glutTablet - && devbtn->deviceid == __glutTablet->device_id - && window->tabletButton - && devbtn->first_axis == 0 - && devbtn->axes_count == 2) { - tabletPosChange(window, devbtn->first_axis, devbtn->axes_count, - devbtn->axis_data); - window->tabletButton(devbtn->button, GLUT_DOWN, - window->tabletPos[0], window->tabletPos[1]); - } else if (__glutDials - && devbtn->deviceid == __glutDials->device_id - && window->buttonBox) { - window->buttonBox(devbtn->button, GLUT_DOWN); - } else if (__glutSpaceball - && devbtn->deviceid == __glutSpaceball->device_id - && window->spaceButton) { - window->spaceButton(devbtn->button, GLUT_DOWN); - } - return 1; - } - } else if (__glutDeviceButtonRelease - && event->type == __glutDeviceButtonRelease) { - XDeviceButtonEvent *devbtn = (XDeviceButtonEvent *) event; - - window = __glutGetWindow(devbtn->window); - if (window) { - if (__glutTablet - && devbtn->deviceid == __glutTablet->device_id - && window->tabletButton - && devbtn->first_axis == 0 - && devbtn->axes_count == 2) { - tabletPosChange(window, devbtn->first_axis, devbtn->axes_count, - devbtn->axis_data); - window->tabletButton(devbtn->button, GLUT_UP, - window->tabletPos[0], window->tabletPos[1]); - } else if (__glutDials - && devbtn->deviceid == __glutDials->device_id - && window->buttonBox) { - window->buttonBox(devbtn->button, GLUT_UP); - } else if (__glutSpaceball - && devbtn->deviceid == __glutSpaceball->device_id - && window->spaceButton) { - window->spaceButton(devbtn->button, GLUT_UP); - } - return 1; - } - } -#else - { - JOYINFOEX info; - JOYCAPS joyCaps; - - memset(&info, 0, sizeof(JOYINFOEX)); - info.dwSize = sizeof(JOYINFOEX); - info.dwFlags = JOY_RETURNALL; - - if (joyGetPosEx(JOYSTICKID1,&info) != JOYERR_NOERROR) { - __glutHasJoystick = 1; - joyGetDevCaps(JOYSTICKID1, &joyCaps, sizeof(joyCaps)); - __glutNumJoystickButtons = joyCaps.wNumButtons; - __glutNumJoystickAxes = joyCaps.wNumAxes; - } else { - __glutHasJoystick = 0; - __glutNumJoystickButtons = 0; - __glutNumJoystickAxes = 0; - } - } -#endif /* !_WIN32 */ - return 0; -} - -static GLUTeventParser eventParser = -{__glutProcessDeviceEvents, NULL}; - -static void -addDeviceEventParser(void) -{ - static Bool been_here = False; - - if (been_here) - return; - been_here = True; - __glutRegisterEventParser(&eventParser); -} - -static int -probeDevices(void) -{ - static Bool been_here = False; - static int support; -#if !defined(_WIN32) - XExtensionVersion *version; - XDeviceInfoPtr device_info, device; - XAnyClassPtr any; - XButtonInfoPtr b; - XValuatorInfoPtr v; - XAxisInfoPtr a; - int num_dev = 0, btns = 0, dials = 0; - int i, j, k; -#endif /* !_WIN32 */ - - if (been_here) { - return support; - } - been_here = True; - -#if !defined(_WIN32) - version = XGetExtensionVersion(__glutDisplay, "XInputExtension"); - /* Ugh. XInput extension API forces annoying cast of a pointer - to a long so it can be compared with the NoSuchExtension - value (#defined to 1). */ - if (version == NULL || ((long) version) == NoSuchExtension) { - support = 0; - return support; - } - XFree(version); - device_info = XListInputDevices(__glutDisplay, &num_dev); - if (device_info) { - for (i = 0; i < num_dev; i++) { - /* XXX These are SGI names for these devices; - unfortunately, no good standard exists for standard - types of X input extension devices. */ - - device = &device_info[i]; - any = (XAnyClassPtr) device->inputclassinfo; - - if (!__glutSpaceball && !strcmp(device->name, "spaceball")) { - v = NULL; - b = NULL; - for (j = 0; j < device->num_classes; j++) { -#if defined(__cplusplus) || defined(c_plusplus) - switch (any->c_class) { -#else - switch (any->class) { -#endif - case ButtonClass: - b = (XButtonInfoPtr) any; - btns = b->num_buttons; - break; - case ValuatorClass: - v = (XValuatorInfoPtr) any; - /* Sanity check: at least 6 valuators? */ - if (v->num_axes < NUM_SPACEBALL_AXIS) - goto skip_device; - a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); - for (k = 0; k < NUM_SPACEBALL_AXIS; k++, a++) { - __glutSpaceballRange[k].min = a->min_value; - __glutSpaceballRange[k].range = a->max_value - a->min_value; - } - break; - } - any = (XAnyClassPtr) ((char *) any + any->length); - } - if (v) { - __glutSpaceball = XOpenDevice(__glutDisplay, device->id); - if (__glutSpaceball) { - __glutNumSpaceballButtons = btns; - addDeviceEventParser(); - } - } - } else if (!__glutDials && !strcmp(device->name, "dial+buttons")) { - v = NULL; - b = NULL; - for (j = 0; j < device->num_classes; j++) { -#if defined(__cplusplus) || defined(c_plusplus) - switch (any->c_class) { -#else - switch (any->class) { -#endif - case ButtonClass: - b = (XButtonInfoPtr) any; - btns = b->num_buttons; - break; - case ValuatorClass: - v = (XValuatorInfoPtr) any; - /* Sanity check: at least 8 valuators? */ - if (v->num_axes < NUM_DIALS_AXIS) - goto skip_device; - dials = v->num_axes; - __glutDialsResolution = (int *) malloc(sizeof(int) * dials); - a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); - for (k = 0; k < dials; k++, a++) { - __glutDialsResolution[k] = a->resolution; - } - break; - } - any = (XAnyClassPtr) ((char *) any + any->length); - } - if (v) { - __glutDials = XOpenDevice(__glutDisplay, device->id); - if (__glutDials) { - __glutNumButtonBoxButtons = btns; - __glutNumDials = dials; - addDeviceEventParser(); - } - } - } else if (!__glutTablet && !strcmp(device->name, "tablet")) { - v = NULL; - b = NULL; - for (j = 0; j < device->num_classes; j++) { -#if defined(__cplusplus) || defined(c_plusplus) - switch (any->c_class) { -#else - switch (any->class) { -#endif - case ButtonClass: - b = (XButtonInfoPtr) any; - btns = b->num_buttons; - break; - case ValuatorClass: - v = (XValuatorInfoPtr) any; - /* Sanity check: exactly 2 valuators? */ - if (v->num_axes != NUM_TABLET_AXIS) - goto skip_device; - a = (XAxisInfoPtr) ((char *) v + sizeof(XValuatorInfo)); - for (k = 0; k < NUM_TABLET_AXIS; k++, a++) { - __glutTabletRange[k].min = a->min_value; - __glutTabletRange[k].range = a->max_value - a->min_value; - } - break; - } - any = (XAnyClassPtr) ((char *) any + any->length); - } - if (v) { - __glutTablet = XOpenDevice(__glutDisplay, device->id); - if (__glutTablet) { - __glutNumTabletButtons = btns; - addDeviceEventParser(); - } - } - } else if (!strcmp(device->name, "mouse")) { - for (j = 0; j < device->num_classes; j++) { -#if defined(__cplusplus) || defined(c_plusplus) - if (any->c_class == ButtonClass) { -#else - if (any->class == ButtonClass) { -#endif - b = (XButtonInfoPtr) any; - __glutNumMouseButtons = b->num_buttons; - } - any = (XAnyClassPtr) ((char *) any + any->length); - } - } - skip_device:; - } - XFreeDeviceList(device_info); - } -#else /* _WIN32 */ - __glutNumMouseButtons = GetSystemMetrics(SM_CMOUSEBUTTONS); -#endif /* !_WIN32 */ - /* X Input extension might be supported, but only if there is - a tablet, dials, or spaceball do we claim devices are - supported. */ - support = __glutTablet || __glutDials || __glutSpaceball; - return support; -} - -void -__glutUpdateInputDeviceMask(GLUTwindow * window) -{ -#if !defined(_WIN32) - /* 5 (dial and buttons) + 5 (tablet locator and buttons) + 5 - (Spaceball buttons and axis) = 15 */ - XEventClass eventList[15]; - int rc, numEvents; - - rc = probeDevices(); - if (rc) { - numEvents = 0; - if (__glutTablet) { - if (window->tabletMotion) { - DeviceMotionNotify(__glutTablet, __glutDeviceMotionNotify, - eventList[numEvents]); - numEvents++; - } - if (window->tabletButton) { - DeviceButtonPress(__glutTablet, __glutDeviceButtonPress, - eventList[numEvents]); - numEvents++; - DeviceButtonPressGrab(__glutTablet, __glutDeviceButtonPressGrab, - eventList[numEvents]); - numEvents++; - DeviceButtonRelease(__glutTablet, __glutDeviceButtonRelease, - eventList[numEvents]); - numEvents++; - } - if (window->tabletMotion || window->tabletButton) { - DeviceStateNotify(__glutTablet, __glutDeviceStateNotify, - eventList[numEvents]); - numEvents++; - } - } - if (__glutDials) { - if (window->dials) { - DeviceMotionNotify(__glutDials, __glutDeviceMotionNotify, - eventList[numEvents]); - numEvents++; - } - if (window->buttonBox) { - DeviceButtonPress(__glutDials, __glutDeviceButtonPress, - eventList[numEvents]); - numEvents++; - DeviceButtonPressGrab(__glutDials, __glutDeviceButtonPressGrab, - eventList[numEvents]); - numEvents++; - DeviceButtonRelease(__glutDials, __glutDeviceButtonRelease, - eventList[numEvents]); - numEvents++; - } - if (window->dials || window->buttonBox) { - DeviceStateNotify(__glutDials, __glutDeviceStateNotify, - eventList[numEvents]); - numEvents++; - } - } - if (__glutSpaceball) { - if (window->spaceMotion || window->spaceRotate) { - DeviceMotionNotify(__glutSpaceball, __glutDeviceMotionNotify, - eventList[numEvents]); - numEvents++; - } - if (window->spaceButton) { - DeviceButtonPress(__glutSpaceball, __glutDeviceButtonPress, - eventList[numEvents]); - numEvents++; - DeviceButtonPressGrab(__glutSpaceball, __glutDeviceButtonPressGrab, - eventList[numEvents]); - numEvents++; - DeviceButtonRelease(__glutSpaceball, __glutDeviceButtonRelease, - eventList[numEvents]); - numEvents++; - } - if (window->spaceMotion || window->spaceRotate || window->spaceButton) { - DeviceStateNotify(__glutSpaceball, __glutDeviceStateNotify, - eventList[numEvents]); - numEvents++; - } - } -#if 0 - if (window->children) { - GLUTwindow *child = window->children; - - do { - XChangeDeviceDontPropagateList(__glutDisplay, child->win, - numEvents, eventList, AddToList); - child = child->siblings; - } while (child); - } -#endif - XSelectExtensionEvent(__glutDisplay, window->win, - eventList, numEvents); - if (window->overlay) { - XSelectExtensionEvent(__glutDisplay, window->overlay->win, - eventList, numEvents); - } - } else { - /* X Input extension not supported; no chance for exotic - input devices. */ - } -#endif /* !_WIN32 */ -} - -#endif //POFIG - -/* CENTRY */ -int GLUTAPIENTRY -glutDeviceGet(GLenum param) -{ -#if POFIG - probeDevices(); -#endif - switch (param) { - case GLUT_HAS_KEYBOARD: - case GLUT_HAS_MOUSE: - /* Assume window system always has mouse and keyboard. */ - return 1; -#if POFIG - case GLUT_HAS_SPACEBALL: - return __glutSpaceball != NULL; - case GLUT_HAS_DIAL_AND_BUTTON_BOX: - return __glutDials != NULL; - case GLUT_HAS_TABLET: - return __glutTablet != NULL; - case GLUT_NUM_MOUSE_BUTTONS: - return __glutNumMouseButtons; - case GLUT_NUM_SPACEBALL_BUTTONS: - return __glutNumSpaceballButtons; - case GLUT_NUM_BUTTON_BOX_BUTTONS: - return __glutNumButtonBoxButtons; - case GLUT_NUM_DIALS: - return __glutNumDials; - case GLUT_NUM_TABLET_BUTTONS: - return __glutNumTabletButtons; - case GLUT_DEVICE_IGNORE_KEY_REPEAT: - return __glutCurrentWindow->ignoreKeyRepeat; -#ifndef _WIN32 - case GLUT_DEVICE_KEY_REPEAT: - { - XKeyboardState state; - - XGetKeyboardControl(__glutDisplay, &state); - return state.global_auto_repeat; - } - case GLUT_JOYSTICK_POLL_RATE: - return 0; -#else - case GLUT_DEVICE_KEY_REPEAT: - /* Win32 cannot globally disable key repeat. */ - return GLUT_KEY_REPEAT_ON; - case GLUT_JOYSTICK_POLL_RATE: - return __glutCurrentWindow->joyPollInterval; -#endif - case GLUT_HAS_JOYSTICK: - return __glutHasJoystick; - case GLUT_JOYSTICK_BUTTONS: - return __glutNumJoystickButtons; - case GLUT_JOYSTICK_AXES: - return __glutNumJoystickAxes; -#endif //POFIG - default: - __glutWarning("invalid glutDeviceGet parameter: %d", param); - return -1; - } -} -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_key.cpp b/src/glut/os2/glut_key.cpp deleted file mode 100644 index 3e1f7e52c1..0000000000 --- a/src/glut/os2/glut_key.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include - -#include "glutint.h" - -/* CENTRY */ -void GLUTAPIENTRY -glutKeyboardFunc(GLUTkeyboardCB keyboardFunc) -{ - __glutChangeWindowEventMask(KeyPressMask, - keyboardFunc != NULL || __glutCurrentWindow->special != NULL); - __glutCurrentWindow->keyboard = keyboardFunc; -} - -void GLUTAPIENTRY -glutSpecialFunc(GLUTspecialCB specialFunc) -{ - __glutChangeWindowEventMask(KeyPressMask, - specialFunc != NULL || __glutCurrentWindow->keyboard != NULL); - __glutCurrentWindow->special = specialFunc; -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_keyctrl.cpp b/src/glut/os2/glut_keyctrl.cpp deleted file mode 100644 index ddac630509..0000000000 --- a/src/glut/os2/glut_keyctrl.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1996, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include "glutint.h" - -/* CENTRY */ -void GLUTAPIENTRY -glutIgnoreKeyRepeat(int ignore) -{ - __glutCurrentWindow->ignoreKeyRepeat = ignore; -} - -void GLUTAPIENTRY -glutSetKeyRepeat(int repeatMode) -{ -#if !defined(_WIN32) && !defined(__OS2PM__) - XKeyboardControl values; - - /* GLUT's repeatMode #define's match the Xlib API values. */ - values.auto_repeat_mode = repeatMode; - XChangeKeyboardControl(__glutDisplay, KBAutoRepeatMode, &values); -#endif -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_keyup.cpp b/src/glut/os2/glut_keyup.cpp deleted file mode 100644 index c33770f1be..0000000000 --- a/src/glut/os2/glut_keyup.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include - -#include "glutint.h" - -/* CENTRY */ -void GLUTAPIENTRY -glutKeyboardUpFunc(GLUTkeyboardCB keyboardUpFunc) -{ - __glutChangeWindowEventMask(KeyReleaseMask, - keyboardUpFunc != NULL || __glutCurrentWindow->specialUp != NULL); - __glutCurrentWindow->keyboardUp = keyboardUpFunc; -} - -void GLUTAPIENTRY -glutSpecialUpFunc(GLUTspecialCB specialUpFunc) -{ - __glutChangeWindowEventMask(KeyReleaseMask, - specialUpFunc != NULL || __glutCurrentWindow->keyboardUp != NULL); - __glutCurrentWindow->specialUp = specialUpFunc; -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_mesa.cpp b/src/glut/os2/glut_mesa.cpp deleted file mode 100644 index 7e202fa078..0000000000 --- a/src/glut/os2/glut_mesa.cpp +++ /dev/null @@ -1,57 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1996. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include -#include "glutint.h" - -int __glutMesaSwapHackSupport = 0; /* Not supported until - proven otherwise. */ - -/* Use the "Mesa swap hack" if reasonable if and only if - MESA_SWAP_HACK is set to something whose first character is - not "N" or "n" AND "Brian Paul" is the vendor string AND - "Mesa X11"* (or "Mesa" for backward compatibility) is the - renderer string. - - Anyone who modifies Mesa so that glXSwapBuffers does not - simply blit the previously rendered back buffer should - change either their vendor or renderer string to avoid - confusing GLUT. */ - -void -__glutDetermineMesaSwapHackSupport(void) -{ - static int doneAlready = 0; - char *env, *vendor, *renderer; - - if (doneAlready) - return; - env = getenv("MESA_SWAP_HACK"); - if (env) { - if ((env[0] != 'n') && (env[0] != 'N')) { - vendor = (char *) glGetString(GL_VENDOR); - renderer = (char *) glGetString(GL_RENDERER); - - /* Old versions of X11 Mesa uses the renderer string - "Mesa"; Brian plans to start using "Mesa X11" to - distinguish the X version of Mesa from other flavor - such as Windows or 3Dfx. */ - -#define MESA_X11 "Mesa X11" - - /* XXX At some point in the future, eliminate the - backward compatibility for the old "Mesa" renderer - string. */ - - if (!strcmp(vendor, "Brian Paul") && (!strcmp(renderer, "Mesa") || - !strncmp(renderer, MESA_X11, sizeof(MESA_X11) - 1))) - __glutMesaSwapHackSupport = 1; - } - } - doneAlready = 1; -} diff --git a/src/glut/os2/glut_modifier.cpp b/src/glut/os2/glut_modifier.cpp deleted file mode 100644 index 7e0e67a21f..0000000000 --- a/src/glut/os2/glut_modifier.cpp +++ /dev/null @@ -1,31 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include "glutint.h" - -/* CENTRY */ -int GLUTAPIENTRY -glutGetModifiers(void) -{ - int modifiers; - - if(__glutModifierMask == (unsigned int) ~0) { - __glutWarning( - "glutCurrentModifiers: do not call outside core input callback."); - return 0; - } - modifiers = 0; - if(__glutModifierMask & (ShiftMask|LockMask)) - modifiers |= GLUT_ACTIVE_SHIFT; - if(__glutModifierMask & ControlMask) - modifiers |= GLUT_ACTIVE_CTRL; - if(__glutModifierMask & Mod1Mask) - modifiers |= GLUT_ACTIVE_ALT; - return modifiers; -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_roman.cpp b/src/glut/os2/glut_roman.cpp deleted file mode 100644 index af2b4ec956..0000000000 --- a/src/glut/os2/glut_roman.cpp +++ /dev/null @@ -1,2451 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#include "glutstroke.h" - -/* char: 33 '!' */ - -static const CoordRec char33_stroke0[] = { - { 13.3819, 100 }, - { 13.3819, 33.3333 }, -}; - -static const CoordRec char33_stroke1[] = { - { 13.3819, 9.5238 }, - { 8.62, 4.7619 }, - { 13.3819, 0 }, - { 18.1438, 4.7619 }, - { 13.3819, 9.5238 }, -}; - -static const StrokeRec char33[] = { - { 2, char33_stroke0 }, - { 5, char33_stroke1 }, -}; - -/* char: 34 '"' */ - -static const CoordRec char34_stroke0[] = { - { 4.02, 100 }, - { 4.02, 66.6667 }, -}; - -static const CoordRec char34_stroke1[] = { - { 42.1152, 100 }, - { 42.1152, 66.6667 }, -}; - -static const StrokeRec char34[] = { - { 2, char34_stroke0 }, - { 2, char34_stroke1 }, -}; - -/* char: 35 '#' */ - -static const CoordRec char35_stroke0[] = { - { 41.2952, 119.048 }, - { 7.9619, -33.3333 }, -}; - -static const CoordRec char35_stroke1[] = { - { 69.8667, 119.048 }, - { 36.5333, -33.3333 }, -}; - -static const CoordRec char35_stroke2[] = { - { 7.9619, 57.1429 }, - { 74.6286, 57.1429 }, -}; - -static const CoordRec char35_stroke3[] = { - { 3.2, 28.5714 }, - { 69.8667, 28.5714 }, -}; - -static const StrokeRec char35[] = { - { 2, char35_stroke0 }, - { 2, char35_stroke1 }, - { 2, char35_stroke2 }, - { 2, char35_stroke3 }, -}; - -/* char: 36 '$' */ - -static const CoordRec char36_stroke0[] = { - { 28.6295, 119.048 }, - { 28.6295, -19.0476 }, -}; - -static const CoordRec char36_stroke1[] = { - { 47.6771, 119.048 }, - { 47.6771, -19.0476 }, -}; - -static const CoordRec char36_stroke2[] = { - { 71.4867, 85.7143 }, - { 61.9629, 95.2381 }, - { 47.6771, 100 }, - { 28.6295, 100 }, - { 14.3438, 95.2381 }, - { 4.82, 85.7143 }, - { 4.82, 76.1905 }, - { 9.5819, 66.6667 }, - { 14.3438, 61.9048 }, - { 23.8676, 57.1429 }, - { 52.439, 47.619 }, - { 61.9629, 42.8571 }, - { 66.7248, 38.0952 }, - { 71.4867, 28.5714 }, - { 71.4867, 14.2857 }, - { 61.9629, 4.7619 }, - { 47.6771, 0 }, - { 28.6295, 0 }, - { 14.3438, 4.7619 }, - { 4.82, 14.2857 }, -}; - -static const StrokeRec char36[] = { - { 2, char36_stroke0 }, - { 2, char36_stroke1 }, - { 20, char36_stroke2 }, -}; - -/* char: 37 '%' */ - -static const CoordRec char37_stroke0[] = { - { 92.0743, 100 }, - { 6.36, 0 }, -}; - -static const CoordRec char37_stroke1[] = { - { 30.1695, 100 }, - { 39.6933, 90.4762 }, - { 39.6933, 80.9524 }, - { 34.9314, 71.4286 }, - { 25.4076, 66.6667 }, - { 15.8838, 66.6667 }, - { 6.36, 76.1905 }, - { 6.36, 85.7143 }, - { 11.1219, 95.2381 }, - { 20.6457, 100 }, - { 30.1695, 100 }, - { 39.6933, 95.2381 }, - { 53.979, 90.4762 }, - { 68.2648, 90.4762 }, - { 82.5505, 95.2381 }, - { 92.0743, 100 }, -}; - -static const CoordRec char37_stroke2[] = { - { 73.0267, 33.3333 }, - { 63.5029, 28.5714 }, - { 58.741, 19.0476 }, - { 58.741, 9.5238 }, - { 68.2648, 0 }, - { 77.7886, 0 }, - { 87.3124, 4.7619 }, - { 92.0743, 14.2857 }, - { 92.0743, 23.8095 }, - { 82.5505, 33.3333 }, - { 73.0267, 33.3333 }, -}; - -static const StrokeRec char37[] = { - { 2, char37_stroke0 }, - { 16, char37_stroke1 }, - { 11, char37_stroke2 }, -}; - -/* char: 38 '&' */ - -static const CoordRec char38_stroke0[] = { - { 101.218, 57.1429 }, - { 101.218, 61.9048 }, - { 96.4562, 66.6667 }, - { 91.6943, 66.6667 }, - { 86.9324, 61.9048 }, - { 82.1705, 52.381 }, - { 72.6467, 28.5714 }, - { 63.1229, 14.2857 }, - { 53.599, 4.7619 }, - { 44.0752, 0 }, - { 25.0276, 0 }, - { 15.5038, 4.7619 }, - { 10.7419, 9.5238 }, - { 5.98, 19.0476 }, - { 5.98, 28.5714 }, - { 10.7419, 38.0952 }, - { 15.5038, 42.8571 }, - { 48.8371, 61.9048 }, - { 53.599, 66.6667 }, - { 58.361, 76.1905 }, - { 58.361, 85.7143 }, - { 53.599, 95.2381 }, - { 44.0752, 100 }, - { 34.5514, 95.2381 }, - { 29.7895, 85.7143 }, - { 29.7895, 76.1905 }, - { 34.5514, 61.9048 }, - { 44.0752, 47.619 }, - { 67.8848, 14.2857 }, - { 77.4086, 4.7619 }, - { 86.9324, 0 }, - { 96.4562, 0 }, - { 101.218, 4.7619 }, - { 101.218, 9.5238 }, -}; - -static const StrokeRec char38[] = { - { 34, char38_stroke0 }, -}; - -/* char: 39 ''' */ - -static const CoordRec char39_stroke0[] = { - { 4.44, 100 }, - { 4.44, 66.6667 }, -}; - -static const StrokeRec char39[] = { - { 2, char39_stroke0 }, -}; - -/* char: 40 '(' */ - -static const CoordRec char40_stroke0[] = { - { 40.9133, 119.048 }, - { 31.3895, 109.524 }, - { 21.8657, 95.2381 }, - { 12.3419, 76.1905 }, - { 7.58, 52.381 }, - { 7.58, 33.3333 }, - { 12.3419, 9.5238 }, - { 21.8657, -9.5238 }, - { 31.3895, -23.8095 }, - { 40.9133, -33.3333 }, -}; - -static const StrokeRec char40[] = { - { 10, char40_stroke0 }, -}; - -/* char: 41 ')' */ - -static const CoordRec char41_stroke0[] = { - { 5.28, 119.048 }, - { 14.8038, 109.524 }, - { 24.3276, 95.2381 }, - { 33.8514, 76.1905 }, - { 38.6133, 52.381 }, - { 38.6133, 33.3333 }, - { 33.8514, 9.5238 }, - { 24.3276, -9.5238 }, - { 14.8038, -23.8095 }, - { 5.28, -33.3333 }, -}; - -static const StrokeRec char41[] = { - { 10, char41_stroke0 }, -}; - -/* char: 42 '*' */ - -static const CoordRec char42_stroke0[] = { - { 30.7695, 71.4286 }, - { 30.7695, 14.2857 }, -}; - -static const CoordRec char42_stroke1[] = { - { 6.96, 57.1429 }, - { 54.579, 28.5714 }, -}; - -static const CoordRec char42_stroke2[] = { - { 54.579, 57.1429 }, - { 6.96, 28.5714 }, -}; - -static const StrokeRec char42[] = { - { 2, char42_stroke0 }, - { 2, char42_stroke1 }, - { 2, char42_stroke2 }, -}; - -/* char: 43 '+' */ - -static const CoordRec char43_stroke0[] = { - { 48.8371, 85.7143 }, - { 48.8371, 0 }, -}; - -static const CoordRec char43_stroke1[] = { - { 5.98, 42.8571 }, - { 91.6943, 42.8571 }, -}; - -static const StrokeRec char43[] = { - { 2, char43_stroke0 }, - { 2, char43_stroke1 }, -}; - -/* char: 44 ',' */ - -static const CoordRec char44_stroke0[] = { - { 18.2838, 4.7619 }, - { 13.5219, 0 }, - { 8.76, 4.7619 }, - { 13.5219, 9.5238 }, - { 18.2838, 4.7619 }, - { 18.2838, -4.7619 }, - { 13.5219, -14.2857 }, - { 8.76, -19.0476 }, -}; - -static const StrokeRec char44[] = { - { 8, char44_stroke0 }, -}; - -/* char: 45 '-' */ - -static const CoordRec char45_stroke0[] = { - { 7.38, 42.8571 }, - { 93.0943, 42.8571 }, -}; - -static const StrokeRec char45[] = { - { 2, char45_stroke0 }, -}; - -/* char: 46 '.' */ - -static const CoordRec char46_stroke0[] = { - { 13.1019, 9.5238 }, - { 8.34, 4.7619 }, - { 13.1019, 0 }, - { 17.8638, 4.7619 }, - { 13.1019, 9.5238 }, -}; - -static const StrokeRec char46[] = { - { 5, char46_stroke0 }, -}; - -/* char: 47 '/' */ - -static const CoordRec char47_stroke0[] = { - { 7.24, -14.2857 }, - { 73.9067, 100 }, -}; - -static const StrokeRec char47[] = { - { 2, char47_stroke0 }, -}; - -/* char: 48 '0' */ - -static const CoordRec char48_stroke0[] = { - { 33.5514, 100 }, - { 19.2657, 95.2381 }, - { 9.7419, 80.9524 }, - { 4.98, 57.1429 }, - { 4.98, 42.8571 }, - { 9.7419, 19.0476 }, - { 19.2657, 4.7619 }, - { 33.5514, 0 }, - { 43.0752, 0 }, - { 57.361, 4.7619 }, - { 66.8848, 19.0476 }, - { 71.6467, 42.8571 }, - { 71.6467, 57.1429 }, - { 66.8848, 80.9524 }, - { 57.361, 95.2381 }, - { 43.0752, 100 }, - { 33.5514, 100 }, -}; - -static const StrokeRec char48[] = { - { 17, char48_stroke0 }, -}; - -/* char: 49 '1' */ - -static const CoordRec char49_stroke0[] = { - { 11.82, 80.9524 }, - { 21.3438, 85.7143 }, - { 35.6295, 100 }, - { 35.6295, 0 }, -}; - -static const StrokeRec char49[] = { - { 4, char49_stroke0 }, -}; - -/* char: 50 '2' */ - -static const CoordRec char50_stroke0[] = { - { 10.1819, 76.1905 }, - { 10.1819, 80.9524 }, - { 14.9438, 90.4762 }, - { 19.7057, 95.2381 }, - { 29.2295, 100 }, - { 48.2771, 100 }, - { 57.801, 95.2381 }, - { 62.5629, 90.4762 }, - { 67.3248, 80.9524 }, - { 67.3248, 71.4286 }, - { 62.5629, 61.9048 }, - { 53.039, 47.619 }, - { 5.42, 0 }, - { 72.0867, 0 }, -}; - -static const StrokeRec char50[] = { - { 14, char50_stroke0 }, -}; - -/* char: 51 '3' */ - -static const CoordRec char51_stroke0[] = { - { 14.5238, 100 }, - { 66.9048, 100 }, - { 38.3333, 61.9048 }, - { 52.619, 61.9048 }, - { 62.1429, 57.1429 }, - { 66.9048, 52.381 }, - { 71.6667, 38.0952 }, - { 71.6667, 28.5714 }, - { 66.9048, 14.2857 }, - { 57.381, 4.7619 }, - { 43.0952, 0 }, - { 28.8095, 0 }, - { 14.5238, 4.7619 }, - { 9.7619, 9.5238 }, - { 5, 19.0476 }, -}; - -static const StrokeRec char51[] = { - { 15, char51_stroke0 }, -}; - -/* char: 52 '4' */ - -static const CoordRec char52_stroke0[] = { - { 51.499, 100 }, - { 3.88, 33.3333 }, - { 75.3086, 33.3333 }, -}; - -static const CoordRec char52_stroke1[] = { - { 51.499, 100 }, - { 51.499, 0 }, -}; - -static const StrokeRec char52[] = { - { 3, char52_stroke0 }, - { 2, char52_stroke1 }, -}; - -/* char: 53 '5' */ - -static const CoordRec char53_stroke0[] = { - { 62.0029, 100 }, - { 14.3838, 100 }, - { 9.6219, 57.1429 }, - { 14.3838, 61.9048 }, - { 28.6695, 66.6667 }, - { 42.9552, 66.6667 }, - { 57.241, 61.9048 }, - { 66.7648, 52.381 }, - { 71.5267, 38.0952 }, - { 71.5267, 28.5714 }, - { 66.7648, 14.2857 }, - { 57.241, 4.7619 }, - { 42.9552, 0 }, - { 28.6695, 0 }, - { 14.3838, 4.7619 }, - { 9.6219, 9.5238 }, - { 4.86, 19.0476 }, -}; - -static const StrokeRec char53[] = { - { 17, char53_stroke0 }, -}; - -/* char: 54 '6' */ - -static const CoordRec char54_stroke0[] = { - { 62.7229, 85.7143 }, - { 57.961, 95.2381 }, - { 43.6752, 100 }, - { 34.1514, 100 }, - { 19.8657, 95.2381 }, - { 10.3419, 80.9524 }, - { 5.58, 57.1429 }, - { 5.58, 33.3333 }, - { 10.3419, 14.2857 }, - { 19.8657, 4.7619 }, - { 34.1514, 0 }, - { 38.9133, 0 }, - { 53.199, 4.7619 }, - { 62.7229, 14.2857 }, - { 67.4848, 28.5714 }, - { 67.4848, 33.3333 }, - { 62.7229, 47.619 }, - { 53.199, 57.1429 }, - { 38.9133, 61.9048 }, - { 34.1514, 61.9048 }, - { 19.8657, 57.1429 }, - { 10.3419, 47.619 }, - { 5.58, 33.3333 }, -}; - -static const StrokeRec char54[] = { - { 23, char54_stroke0 }, -}; - -/* char: 55 '7' */ - -static const CoordRec char55_stroke0[] = { - { 72.2267, 100 }, - { 24.6076, 0 }, -}; - -static const CoordRec char55_stroke1[] = { - { 5.56, 100 }, - { 72.2267, 100 }, -}; - -static const StrokeRec char55[] = { - { 2, char55_stroke0 }, - { 2, char55_stroke1 }, -}; - -/* char: 56 '8' */ - -static const CoordRec char56_stroke0[] = { - { 29.4095, 100 }, - { 15.1238, 95.2381 }, - { 10.3619, 85.7143 }, - { 10.3619, 76.1905 }, - { 15.1238, 66.6667 }, - { 24.6476, 61.9048 }, - { 43.6952, 57.1429 }, - { 57.981, 52.381 }, - { 67.5048, 42.8571 }, - { 72.2667, 33.3333 }, - { 72.2667, 19.0476 }, - { 67.5048, 9.5238 }, - { 62.7429, 4.7619 }, - { 48.4571, 0 }, - { 29.4095, 0 }, - { 15.1238, 4.7619 }, - { 10.3619, 9.5238 }, - { 5.6, 19.0476 }, - { 5.6, 33.3333 }, - { 10.3619, 42.8571 }, - { 19.8857, 52.381 }, - { 34.1714, 57.1429 }, - { 53.219, 61.9048 }, - { 62.7429, 66.6667 }, - { 67.5048, 76.1905 }, - { 67.5048, 85.7143 }, - { 62.7429, 95.2381 }, - { 48.4571, 100 }, - { 29.4095, 100 }, -}; - -static const StrokeRec char56[] = { - { 29, char56_stroke0 }, -}; - -/* char: 57 '9' */ - -static const CoordRec char57_stroke0[] = { - { 68.5048, 66.6667 }, - { 63.7429, 52.381 }, - { 54.219, 42.8571 }, - { 39.9333, 38.0952 }, - { 35.1714, 38.0952 }, - { 20.8857, 42.8571 }, - { 11.3619, 52.381 }, - { 6.6, 66.6667 }, - { 6.6, 71.4286 }, - { 11.3619, 85.7143 }, - { 20.8857, 95.2381 }, - { 35.1714, 100 }, - { 39.9333, 100 }, - { 54.219, 95.2381 }, - { 63.7429, 85.7143 }, - { 68.5048, 66.6667 }, - { 68.5048, 42.8571 }, - { 63.7429, 19.0476 }, - { 54.219, 4.7619 }, - { 39.9333, 0 }, - { 30.4095, 0 }, - { 16.1238, 4.7619 }, - { 11.3619, 14.2857 }, -}; - -static const StrokeRec char57[] = { - { 23, char57_stroke0 }, -}; - -/* char: 58 ':' */ - -static const CoordRec char58_stroke0[] = { - { 14.0819, 66.6667 }, - { 9.32, 61.9048 }, - { 14.0819, 57.1429 }, - { 18.8438, 61.9048 }, - { 14.0819, 66.6667 }, -}; - -static const CoordRec char58_stroke1[] = { - { 14.0819, 9.5238 }, - { 9.32, 4.7619 }, - { 14.0819, 0 }, - { 18.8438, 4.7619 }, - { 14.0819, 9.5238 }, -}; - -static const StrokeRec char58[] = { - { 5, char58_stroke0 }, - { 5, char58_stroke1 }, -}; - -/* char: 59 ';' */ - -static const CoordRec char59_stroke0[] = { - { 12.9619, 66.6667 }, - { 8.2, 61.9048 }, - { 12.9619, 57.1429 }, - { 17.7238, 61.9048 }, - { 12.9619, 66.6667 }, -}; - -static const CoordRec char59_stroke1[] = { - { 17.7238, 4.7619 }, - { 12.9619, 0 }, - { 8.2, 4.7619 }, - { 12.9619, 9.5238 }, - { 17.7238, 4.7619 }, - { 17.7238, -4.7619 }, - { 12.9619, -14.2857 }, - { 8.2, -19.0476 }, -}; - -static const StrokeRec char59[] = { - { 5, char59_stroke0 }, - { 8, char59_stroke1 }, -}; - -/* char: 60 '<' */ - -static const CoordRec char60_stroke0[] = { - { 79.2505, 85.7143 }, - { 3.06, 42.8571 }, - { 79.2505, 0 }, -}; - -static const StrokeRec char60[] = { - { 3, char60_stroke0 }, -}; - -/* char: 61 '=' */ - -static const CoordRec char61_stroke0[] = { - { 5.7, 57.1429 }, - { 91.4143, 57.1429 }, -}; - -static const CoordRec char61_stroke1[] = { - { 5.7, 28.5714 }, - { 91.4143, 28.5714 }, -}; - -static const StrokeRec char61[] = { - { 2, char61_stroke0 }, - { 2, char61_stroke1 }, -}; - -/* char: 62 '>' */ - -static const CoordRec char62_stroke0[] = { - { 2.78, 85.7143 }, - { 78.9705, 42.8571 }, - { 2.78, 0 }, -}; - -static const StrokeRec char62[] = { - { 3, char62_stroke0 }, -}; - -/* char: 63 '?' */ - -static const CoordRec char63_stroke0[] = { - { 8.42, 76.1905 }, - { 8.42, 80.9524 }, - { 13.1819, 90.4762 }, - { 17.9438, 95.2381 }, - { 27.4676, 100 }, - { 46.5152, 100 }, - { 56.039, 95.2381 }, - { 60.801, 90.4762 }, - { 65.5629, 80.9524 }, - { 65.5629, 71.4286 }, - { 60.801, 61.9048 }, - { 56.039, 57.1429 }, - { 36.9914, 47.619 }, - { 36.9914, 33.3333 }, -}; - -static const CoordRec char63_stroke1[] = { - { 36.9914, 9.5238 }, - { 32.2295, 4.7619 }, - { 36.9914, 0 }, - { 41.7533, 4.7619 }, - { 36.9914, 9.5238 }, -}; - -static const StrokeRec char63[] = { - { 14, char63_stroke0 }, - { 5, char63_stroke1 }, -}; - -/* char: 64 '@' */ - -static const CoordRec char64_stroke0[] = { - { 49.2171, 52.381 }, - { 39.6933, 57.1429 }, - { 30.1695, 57.1429 }, - { 25.4076, 47.619 }, - { 25.4076, 42.8571 }, - { 30.1695, 33.3333 }, - { 39.6933, 33.3333 }, - { 49.2171, 38.0952 }, -}; - -static const CoordRec char64_stroke1[] = { - { 49.2171, 57.1429 }, - { 49.2171, 38.0952 }, - { 53.979, 33.3333 }, - { 63.5029, 33.3333 }, - { 68.2648, 42.8571 }, - { 68.2648, 47.619 }, - { 63.5029, 61.9048 }, - { 53.979, 71.4286 }, - { 39.6933, 76.1905 }, - { 34.9314, 76.1905 }, - { 20.6457, 71.4286 }, - { 11.1219, 61.9048 }, - { 6.36, 47.619 }, - { 6.36, 42.8571 }, - { 11.1219, 28.5714 }, - { 20.6457, 19.0476 }, - { 34.9314, 14.2857 }, - { 39.6933, 14.2857 }, - { 53.979, 19.0476 }, -}; - -static const StrokeRec char64[] = { - { 8, char64_stroke0 }, - { 19, char64_stroke1 }, -}; - -/* char: 65 'A' */ - -static const CoordRec char65_stroke0[] = { - { 40.5952, 100 }, - { 2.5, 0 }, -}; - -static const CoordRec char65_stroke1[] = { - { 40.5952, 100 }, - { 78.6905, 0 }, -}; - -static const CoordRec char65_stroke2[] = { - { 16.7857, 33.3333 }, - { 64.4048, 33.3333 }, -}; - -static const StrokeRec char65[] = { - { 2, char65_stroke0 }, - { 2, char65_stroke1 }, - { 2, char65_stroke2 }, -}; - -/* char: 66 'B' */ - -static const CoordRec char66_stroke0[] = { - { 11.42, 100 }, - { 11.42, 0 }, -}; - -static const CoordRec char66_stroke1[] = { - { 11.42, 100 }, - { 54.2771, 100 }, - { 68.5629, 95.2381 }, - { 73.3248, 90.4762 }, - { 78.0867, 80.9524 }, - { 78.0867, 71.4286 }, - { 73.3248, 61.9048 }, - { 68.5629, 57.1429 }, - { 54.2771, 52.381 }, -}; - -static const CoordRec char66_stroke2[] = { - { 11.42, 52.381 }, - { 54.2771, 52.381 }, - { 68.5629, 47.619 }, - { 73.3248, 42.8571 }, - { 78.0867, 33.3333 }, - { 78.0867, 19.0476 }, - { 73.3248, 9.5238 }, - { 68.5629, 4.7619 }, - { 54.2771, 0 }, - { 11.42, 0 }, -}; - -static const StrokeRec char66[] = { - { 2, char66_stroke0 }, - { 9, char66_stroke1 }, - { 10, char66_stroke2 }, -}; - -/* char: 67 'C' */ - -static const CoordRec char67_stroke0[] = { - { 78.0886, 76.1905 }, - { 73.3267, 85.7143 }, - { 63.8029, 95.2381 }, - { 54.279, 100 }, - { 35.2314, 100 }, - { 25.7076, 95.2381 }, - { 16.1838, 85.7143 }, - { 11.4219, 76.1905 }, - { 6.66, 61.9048 }, - { 6.66, 38.0952 }, - { 11.4219, 23.8095 }, - { 16.1838, 14.2857 }, - { 25.7076, 4.7619 }, - { 35.2314, 0 }, - { 54.279, 0 }, - { 63.8029, 4.7619 }, - { 73.3267, 14.2857 }, - { 78.0886, 23.8095 }, -}; - -static const StrokeRec char67[] = { - { 18, char67_stroke0 }, -}; - -/* char: 68 'D' */ - -static const CoordRec char68_stroke0[] = { - { 11.96, 100 }, - { 11.96, 0 }, -}; - -static const CoordRec char68_stroke1[] = { - { 11.96, 100 }, - { 45.2933, 100 }, - { 59.579, 95.2381 }, - { 69.1029, 85.7143 }, - { 73.8648, 76.1905 }, - { 78.6267, 61.9048 }, - { 78.6267, 38.0952 }, - { 73.8648, 23.8095 }, - { 69.1029, 14.2857 }, - { 59.579, 4.7619 }, - { 45.2933, 0 }, - { 11.96, 0 }, -}; - -static const StrokeRec char68[] = { - { 2, char68_stroke0 }, - { 12, char68_stroke1 }, -}; - -/* char: 69 'E' */ - -static const CoordRec char69_stroke0[] = { - { 11.42, 100 }, - { 11.42, 0 }, -}; - -static const CoordRec char69_stroke1[] = { - { 11.42, 100 }, - { 73.3248, 100 }, -}; - -static const CoordRec char69_stroke2[] = { - { 11.42, 52.381 }, - { 49.5152, 52.381 }, -}; - -static const CoordRec char69_stroke3[] = { - { 11.42, 0 }, - { 73.3248, 0 }, -}; - -static const StrokeRec char69[] = { - { 2, char69_stroke0 }, - { 2, char69_stroke1 }, - { 2, char69_stroke2 }, - { 2, char69_stroke3 }, -}; - -/* char: 70 'F' */ - -static const CoordRec char70_stroke0[] = { - { 11.42, 100 }, - { 11.42, 0 }, -}; - -static const CoordRec char70_stroke1[] = { - { 11.42, 100 }, - { 73.3248, 100 }, -}; - -static const CoordRec char70_stroke2[] = { - { 11.42, 52.381 }, - { 49.5152, 52.381 }, -}; - -static const StrokeRec char70[] = { - { 2, char70_stroke0 }, - { 2, char70_stroke1 }, - { 2, char70_stroke2 }, -}; - -/* char: 71 'G' */ - -static const CoordRec char71_stroke0[] = { - { 78.4886, 76.1905 }, - { 73.7267, 85.7143 }, - { 64.2029, 95.2381 }, - { 54.679, 100 }, - { 35.6314, 100 }, - { 26.1076, 95.2381 }, - { 16.5838, 85.7143 }, - { 11.8219, 76.1905 }, - { 7.06, 61.9048 }, - { 7.06, 38.0952 }, - { 11.8219, 23.8095 }, - { 16.5838, 14.2857 }, - { 26.1076, 4.7619 }, - { 35.6314, 0 }, - { 54.679, 0 }, - { 64.2029, 4.7619 }, - { 73.7267, 14.2857 }, - { 78.4886, 23.8095 }, - { 78.4886, 38.0952 }, -}; - -static const CoordRec char71_stroke1[] = { - { 54.679, 38.0952 }, - { 78.4886, 38.0952 }, -}; - -static const StrokeRec char71[] = { - { 19, char71_stroke0 }, - { 2, char71_stroke1 }, -}; - -/* char: 72 'H' */ - -static const CoordRec char72_stroke0[] = { - { 11.42, 100 }, - { 11.42, 0 }, -}; - -static const CoordRec char72_stroke1[] = { - { 78.0867, 100 }, - { 78.0867, 0 }, -}; - -static const CoordRec char72_stroke2[] = { - { 11.42, 52.381 }, - { 78.0867, 52.381 }, -}; - -static const StrokeRec char72[] = { - { 2, char72_stroke0 }, - { 2, char72_stroke1 }, - { 2, char72_stroke2 }, -}; - -/* char: 73 'I' */ - -static const CoordRec char73_stroke0[] = { - { 10.86, 100 }, - { 10.86, 0 }, -}; - -static const StrokeRec char73[] = { - { 2, char73_stroke0 }, -}; - -/* char: 74 'J' */ - -static const CoordRec char74_stroke0[] = { - { 50.119, 100 }, - { 50.119, 23.8095 }, - { 45.3571, 9.5238 }, - { 40.5952, 4.7619 }, - { 31.0714, 0 }, - { 21.5476, 0 }, - { 12.0238, 4.7619 }, - { 7.2619, 9.5238 }, - { 2.5, 23.8095 }, - { 2.5, 33.3333 }, -}; - -static const StrokeRec char74[] = { - { 10, char74_stroke0 }, -}; - -/* char: 75 'K' */ - -static const CoordRec char75_stroke0[] = { - { 11.28, 100 }, - { 11.28, 0 }, -}; - -static const CoordRec char75_stroke1[] = { - { 77.9467, 100 }, - { 11.28, 33.3333 }, -}; - -static const CoordRec char75_stroke2[] = { - { 35.0895, 57.1429 }, - { 77.9467, 0 }, -}; - -static const StrokeRec char75[] = { - { 2, char75_stroke0 }, - { 2, char75_stroke1 }, - { 2, char75_stroke2 }, -}; - -/* char: 76 'L' */ - -static const CoordRec char76_stroke0[] = { - { 11.68, 100 }, - { 11.68, 0 }, -}; - -static const CoordRec char76_stroke1[] = { - { 11.68, 0 }, - { 68.8229, 0 }, -}; - -static const StrokeRec char76[] = { - { 2, char76_stroke0 }, - { 2, char76_stroke1 }, -}; - -/* char: 77 'M' */ - -static const CoordRec char77_stroke0[] = { - { 10.86, 100 }, - { 10.86, 0 }, -}; - -static const CoordRec char77_stroke1[] = { - { 10.86, 100 }, - { 48.9552, 0 }, -}; - -static const CoordRec char77_stroke2[] = { - { 87.0505, 100 }, - { 48.9552, 0 }, -}; - -static const CoordRec char77_stroke3[] = { - { 87.0505, 100 }, - { 87.0505, 0 }, -}; - -static const StrokeRec char77[] = { - { 2, char77_stroke0 }, - { 2, char77_stroke1 }, - { 2, char77_stroke2 }, - { 2, char77_stroke3 }, -}; - -/* char: 78 'N' */ - -static const CoordRec char78_stroke0[] = { - { 11.14, 100 }, - { 11.14, 0 }, -}; - -static const CoordRec char78_stroke1[] = { - { 11.14, 100 }, - { 77.8067, 0 }, -}; - -static const CoordRec char78_stroke2[] = { - { 77.8067, 100 }, - { 77.8067, 0 }, -}; - -static const StrokeRec char78[] = { - { 2, char78_stroke0 }, - { 2, char78_stroke1 }, - { 2, char78_stroke2 }, -}; - -/* char: 79 'O' */ - -static const CoordRec char79_stroke0[] = { - { 34.8114, 100 }, - { 25.2876, 95.2381 }, - { 15.7638, 85.7143 }, - { 11.0019, 76.1905 }, - { 6.24, 61.9048 }, - { 6.24, 38.0952 }, - { 11.0019, 23.8095 }, - { 15.7638, 14.2857 }, - { 25.2876, 4.7619 }, - { 34.8114, 0 }, - { 53.859, 0 }, - { 63.3829, 4.7619 }, - { 72.9067, 14.2857 }, - { 77.6686, 23.8095 }, - { 82.4305, 38.0952 }, - { 82.4305, 61.9048 }, - { 77.6686, 76.1905 }, - { 72.9067, 85.7143 }, - { 63.3829, 95.2381 }, - { 53.859, 100 }, - { 34.8114, 100 }, -}; - -static const StrokeRec char79[] = { - { 21, char79_stroke0 }, -}; - -/* char: 80 'P' */ - -static const CoordRec char80_stroke0[] = { - { 12.1, 100 }, - { 12.1, 0 }, -}; - -static const CoordRec char80_stroke1[] = { - { 12.1, 100 }, - { 54.9571, 100 }, - { 69.2429, 95.2381 }, - { 74.0048, 90.4762 }, - { 78.7667, 80.9524 }, - { 78.7667, 66.6667 }, - { 74.0048, 57.1429 }, - { 69.2429, 52.381 }, - { 54.9571, 47.619 }, - { 12.1, 47.619 }, -}; - -static const StrokeRec char80[] = { - { 2, char80_stroke0 }, - { 10, char80_stroke1 }, -}; - -/* char: 81 'Q' */ - -static const CoordRec char81_stroke0[] = { - { 33.8714, 100 }, - { 24.3476, 95.2381 }, - { 14.8238, 85.7143 }, - { 10.0619, 76.1905 }, - { 5.3, 61.9048 }, - { 5.3, 38.0952 }, - { 10.0619, 23.8095 }, - { 14.8238, 14.2857 }, - { 24.3476, 4.7619 }, - { 33.8714, 0 }, - { 52.919, 0 }, - { 62.4429, 4.7619 }, - { 71.9667, 14.2857 }, - { 76.7286, 23.8095 }, - { 81.4905, 38.0952 }, - { 81.4905, 61.9048 }, - { 76.7286, 76.1905 }, - { 71.9667, 85.7143 }, - { 62.4429, 95.2381 }, - { 52.919, 100 }, - { 33.8714, 100 }, -}; - -static const CoordRec char81_stroke1[] = { - { 48.1571, 19.0476 }, - { 76.7286, -9.5238 }, -}; - -static const StrokeRec char81[] = { - { 21, char81_stroke0 }, - { 2, char81_stroke1 }, -}; - -/* char: 82 'R' */ - -static const CoordRec char82_stroke0[] = { - { 11.68, 100 }, - { 11.68, 0 }, -}; - -static const CoordRec char82_stroke1[] = { - { 11.68, 100 }, - { 54.5371, 100 }, - { 68.8229, 95.2381 }, - { 73.5848, 90.4762 }, - { 78.3467, 80.9524 }, - { 78.3467, 71.4286 }, - { 73.5848, 61.9048 }, - { 68.8229, 57.1429 }, - { 54.5371, 52.381 }, - { 11.68, 52.381 }, -}; - -static const CoordRec char82_stroke2[] = { - { 45.0133, 52.381 }, - { 78.3467, 0 }, -}; - -static const StrokeRec char82[] = { - { 2, char82_stroke0 }, - { 10, char82_stroke1 }, - { 2, char82_stroke2 }, -}; - -/* char: 83 'S' */ - -static const CoordRec char83_stroke0[] = { - { 74.6667, 85.7143 }, - { 65.1429, 95.2381 }, - { 50.8571, 100 }, - { 31.8095, 100 }, - { 17.5238, 95.2381 }, - { 8, 85.7143 }, - { 8, 76.1905 }, - { 12.7619, 66.6667 }, - { 17.5238, 61.9048 }, - { 27.0476, 57.1429 }, - { 55.619, 47.619 }, - { 65.1429, 42.8571 }, - { 69.9048, 38.0952 }, - { 74.6667, 28.5714 }, - { 74.6667, 14.2857 }, - { 65.1429, 4.7619 }, - { 50.8571, 0 }, - { 31.8095, 0 }, - { 17.5238, 4.7619 }, - { 8, 14.2857 }, -}; - -static const StrokeRec char83[] = { - { 20, char83_stroke0 }, -}; - -/* char: 84 'T' */ - -static const CoordRec char84_stroke0[] = { - { 35.6933, 100 }, - { 35.6933, 0 }, -}; - -static const CoordRec char84_stroke1[] = { - { 2.36, 100 }, - { 69.0267, 100 }, -}; - -static const StrokeRec char84[] = { - { 2, char84_stroke0 }, - { 2, char84_stroke1 }, -}; - -/* char: 85 'U' */ - -static const CoordRec char85_stroke0[] = { - { 11.54, 100 }, - { 11.54, 28.5714 }, - { 16.3019, 14.2857 }, - { 25.8257, 4.7619 }, - { 40.1114, 0 }, - { 49.6352, 0 }, - { 63.921, 4.7619 }, - { 73.4448, 14.2857 }, - { 78.2067, 28.5714 }, - { 78.2067, 100 }, -}; - -static const StrokeRec char85[] = { - { 10, char85_stroke0 }, -}; - -/* char: 86 'V' */ - -static const CoordRec char86_stroke0[] = { - { 2.36, 100 }, - { 40.4552, 0 }, -}; - -static const CoordRec char86_stroke1[] = { - { 78.5505, 100 }, - { 40.4552, 0 }, -}; - -static const StrokeRec char86[] = { - { 2, char86_stroke0 }, - { 2, char86_stroke1 }, -}; - -/* char: 87 'W' */ - -static const CoordRec char87_stroke0[] = { - { 2.22, 100 }, - { 26.0295, 0 }, -}; - -static const CoordRec char87_stroke1[] = { - { 49.839, 100 }, - { 26.0295, 0 }, -}; - -static const CoordRec char87_stroke2[] = { - { 49.839, 100 }, - { 73.6486, 0 }, -}; - -static const CoordRec char87_stroke3[] = { - { 97.4581, 100 }, - { 73.6486, 0 }, -}; - -static const StrokeRec char87[] = { - { 2, char87_stroke0 }, - { 2, char87_stroke1 }, - { 2, char87_stroke2 }, - { 2, char87_stroke3 }, -}; - -/* char: 88 'X' */ - -static const CoordRec char88_stroke0[] = { - { 2.5, 100 }, - { 69.1667, 0 }, -}; - -static const CoordRec char88_stroke1[] = { - { 69.1667, 100 }, - { 2.5, 0 }, -}; - -static const StrokeRec char88[] = { - { 2, char88_stroke0 }, - { 2, char88_stroke1 }, -}; - -/* char: 89 'Y' */ - -static const CoordRec char89_stroke0[] = { - { 1.52, 100 }, - { 39.6152, 52.381 }, - { 39.6152, 0 }, -}; - -static const CoordRec char89_stroke1[] = { - { 77.7105, 100 }, - { 39.6152, 52.381 }, -}; - -static const StrokeRec char89[] = { - { 3, char89_stroke0 }, - { 2, char89_stroke1 }, -}; - -/* char: 90 'Z' */ - -static const CoordRec char90_stroke0[] = { - { 69.1667, 100 }, - { 2.5, 0 }, -}; - -static const CoordRec char90_stroke1[] = { - { 2.5, 100 }, - { 69.1667, 100 }, -}; - -static const CoordRec char90_stroke2[] = { - { 2.5, 0 }, - { 69.1667, 0 }, -}; - -static const StrokeRec char90[] = { - { 2, char90_stroke0 }, - { 2, char90_stroke1 }, - { 2, char90_stroke2 }, -}; - -/* char: 91 '[' */ - -static const CoordRec char91_stroke0[] = { - { 7.78, 119.048 }, - { 7.78, -33.3333 }, -}; - -static const CoordRec char91_stroke1[] = { - { 12.5419, 119.048 }, - { 12.5419, -33.3333 }, -}; - -static const CoordRec char91_stroke2[] = { - { 7.78, 119.048 }, - { 41.1133, 119.048 }, -}; - -static const CoordRec char91_stroke3[] = { - { 7.78, -33.3333 }, - { 41.1133, -33.3333 }, -}; - -static const StrokeRec char91[] = { - { 2, char91_stroke0 }, - { 2, char91_stroke1 }, - { 2, char91_stroke2 }, - { 2, char91_stroke3 }, -}; - -/* char: 92 '\' */ - -static const CoordRec char92_stroke0[] = { - { 5.84, 100 }, - { 72.5067, -14.2857 }, -}; - -static const StrokeRec char92[] = { - { 2, char92_stroke0 }, -}; - -/* char: 93 ']' */ - -static const CoordRec char93_stroke0[] = { - { 33.0114, 119.048 }, - { 33.0114, -33.3333 }, -}; - -static const CoordRec char93_stroke1[] = { - { 37.7733, 119.048 }, - { 37.7733, -33.3333 }, -}; - -static const CoordRec char93_stroke2[] = { - { 4.44, 119.048 }, - { 37.7733, 119.048 }, -}; - -static const CoordRec char93_stroke3[] = { - { 4.44, -33.3333 }, - { 37.7733, -33.3333 }, -}; - -static const StrokeRec char93[] = { - { 2, char93_stroke0 }, - { 2, char93_stroke1 }, - { 2, char93_stroke2 }, - { 2, char93_stroke3 }, -}; - -/* char: 94 '^' */ - -static const CoordRec char94_stroke0[] = { - { 44.0752, 109.524 }, - { 5.98, 42.8571 }, -}; - -static const CoordRec char94_stroke1[] = { - { 44.0752, 109.524 }, - { 82.1705, 42.8571 }, -}; - -static const StrokeRec char94[] = { - { 2, char94_stroke0 }, - { 2, char94_stroke1 }, -}; - -/* char: 95 '_' */ - -static const CoordRec char95_stroke0[] = { - { -1.1, -33.3333 }, - { 103.662, -33.3333 }, - { 103.662, -28.5714 }, - { -1.1, -28.5714 }, - { -1.1, -33.3333 }, -}; - -static const StrokeRec char95[] = { - { 5, char95_stroke0 }, -}; - -/* char: 96 '`' */ - -static const CoordRec char96_stroke0[] = { - { 33.0219, 100 }, - { 56.8314, 71.4286 }, -}; - -static const CoordRec char96_stroke1[] = { - { 33.0219, 100 }, - { 28.26, 95.2381 }, - { 56.8314, 71.4286 }, -}; - -static const StrokeRec char96[] = { - { 2, char96_stroke0 }, - { 3, char96_stroke1 }, -}; - -/* char: 97 'a' */ - -static const CoordRec char97_stroke0[] = { - { 63.8229, 66.6667 }, - { 63.8229, 0 }, -}; - -static const CoordRec char97_stroke1[] = { - { 63.8229, 52.381 }, - { 54.299, 61.9048 }, - { 44.7752, 66.6667 }, - { 30.4895, 66.6667 }, - { 20.9657, 61.9048 }, - { 11.4419, 52.381 }, - { 6.68, 38.0952 }, - { 6.68, 28.5714 }, - { 11.4419, 14.2857 }, - { 20.9657, 4.7619 }, - { 30.4895, 0 }, - { 44.7752, 0 }, - { 54.299, 4.7619 }, - { 63.8229, 14.2857 }, -}; - -static const StrokeRec char97[] = { - { 2, char97_stroke0 }, - { 14, char97_stroke1 }, -}; - -/* char: 98 'b' */ - -static const CoordRec char98_stroke0[] = { - { 8.76, 100 }, - { 8.76, 0 }, -}; - -static const CoordRec char98_stroke1[] = { - { 8.76, 52.381 }, - { 18.2838, 61.9048 }, - { 27.8076, 66.6667 }, - { 42.0933, 66.6667 }, - { 51.6171, 61.9048 }, - { 61.141, 52.381 }, - { 65.9029, 38.0952 }, - { 65.9029, 28.5714 }, - { 61.141, 14.2857 }, - { 51.6171, 4.7619 }, - { 42.0933, 0 }, - { 27.8076, 0 }, - { 18.2838, 4.7619 }, - { 8.76, 14.2857 }, -}; - -static const StrokeRec char98[] = { - { 2, char98_stroke0 }, - { 14, char98_stroke1 }, -}; - -/* char: 99 'c' */ - -static const CoordRec char99_stroke0[] = { - { 62.6629, 52.381 }, - { 53.139, 61.9048 }, - { 43.6152, 66.6667 }, - { 29.3295, 66.6667 }, - { 19.8057, 61.9048 }, - { 10.2819, 52.381 }, - { 5.52, 38.0952 }, - { 5.52, 28.5714 }, - { 10.2819, 14.2857 }, - { 19.8057, 4.7619 }, - { 29.3295, 0 }, - { 43.6152, 0 }, - { 53.139, 4.7619 }, - { 62.6629, 14.2857 }, -}; - -static const StrokeRec char99[] = { - { 14, char99_stroke0 }, -}; - -/* char: 100 'd' */ - -static const CoordRec char100_stroke0[] = { - { 61.7829, 100 }, - { 61.7829, 0 }, -}; - -static const CoordRec char100_stroke1[] = { - { 61.7829, 52.381 }, - { 52.259, 61.9048 }, - { 42.7352, 66.6667 }, - { 28.4495, 66.6667 }, - { 18.9257, 61.9048 }, - { 9.4019, 52.381 }, - { 4.64, 38.0952 }, - { 4.64, 28.5714 }, - { 9.4019, 14.2857 }, - { 18.9257, 4.7619 }, - { 28.4495, 0 }, - { 42.7352, 0 }, - { 52.259, 4.7619 }, - { 61.7829, 14.2857 }, -}; - -static const StrokeRec char100[] = { - { 2, char100_stroke0 }, - { 14, char100_stroke1 }, -}; - -/* char: 101 'e' */ - -static const CoordRec char101_stroke0[] = { - { 5.72, 38.0952 }, - { 62.8629, 38.0952 }, - { 62.8629, 47.619 }, - { 58.101, 57.1429 }, - { 53.339, 61.9048 }, - { 43.8152, 66.6667 }, - { 29.5295, 66.6667 }, - { 20.0057, 61.9048 }, - { 10.4819, 52.381 }, - { 5.72, 38.0952 }, - { 5.72, 28.5714 }, - { 10.4819, 14.2857 }, - { 20.0057, 4.7619 }, - { 29.5295, 0 }, - { 43.8152, 0 }, - { 53.339, 4.7619 }, - { 62.8629, 14.2857 }, -}; - -static const StrokeRec char101[] = { - { 17, char101_stroke0 }, -}; - -/* char: 102 'f' */ - -static const CoordRec char102_stroke0[] = { - { 38.7752, 100 }, - { 29.2514, 100 }, - { 19.7276, 95.2381 }, - { 14.9657, 80.9524 }, - { 14.9657, 0 }, -}; - -static const CoordRec char102_stroke1[] = { - { 0.68, 66.6667 }, - { 34.0133, 66.6667 }, -}; - -static const StrokeRec char102[] = { - { 5, char102_stroke0 }, - { 2, char102_stroke1 }, -}; - -/* char: 103 'g' */ - -static const CoordRec char103_stroke0[] = { - { 62.5029, 66.6667 }, - { 62.5029, -9.5238 }, - { 57.741, -23.8095 }, - { 52.979, -28.5714 }, - { 43.4552, -33.3333 }, - { 29.1695, -33.3333 }, - { 19.6457, -28.5714 }, -}; - -static const CoordRec char103_stroke1[] = { - { 62.5029, 52.381 }, - { 52.979, 61.9048 }, - { 43.4552, 66.6667 }, - { 29.1695, 66.6667 }, - { 19.6457, 61.9048 }, - { 10.1219, 52.381 }, - { 5.36, 38.0952 }, - { 5.36, 28.5714 }, - { 10.1219, 14.2857 }, - { 19.6457, 4.7619 }, - { 29.1695, 0 }, - { 43.4552, 0 }, - { 52.979, 4.7619 }, - { 62.5029, 14.2857 }, -}; - -static const StrokeRec char103[] = { - { 7, char103_stroke0 }, - { 14, char103_stroke1 }, -}; - -/* char: 104 'h' */ - -static const CoordRec char104_stroke0[] = { - { 9.6, 100 }, - { 9.6, 0 }, -}; - -static const CoordRec char104_stroke1[] = { - { 9.6, 47.619 }, - { 23.8857, 61.9048 }, - { 33.4095, 66.6667 }, - { 47.6952, 66.6667 }, - { 57.219, 61.9048 }, - { 61.981, 47.619 }, - { 61.981, 0 }, -}; - -static const StrokeRec char104[] = { - { 2, char104_stroke0 }, - { 7, char104_stroke1 }, -}; - -/* char: 105 'i' */ - -static const CoordRec char105_stroke0[] = { - { 10.02, 100 }, - { 14.7819, 95.2381 }, - { 19.5438, 100 }, - { 14.7819, 104.762 }, - { 10.02, 100 }, -}; - -static const CoordRec char105_stroke1[] = { - { 14.7819, 66.6667 }, - { 14.7819, 0 }, -}; - -static const StrokeRec char105[] = { - { 5, char105_stroke0 }, - { 2, char105_stroke1 }, -}; - -/* char: 106 'j' */ - -static const CoordRec char106_stroke0[] = { - { 17.3876, 100 }, - { 22.1495, 95.2381 }, - { 26.9114, 100 }, - { 22.1495, 104.762 }, - { 17.3876, 100 }, -}; - -static const CoordRec char106_stroke1[] = { - { 22.1495, 66.6667 }, - { 22.1495, -14.2857 }, - { 17.3876, -28.5714 }, - { 7.8638, -33.3333 }, - { -1.66, -33.3333 }, -}; - -static const StrokeRec char106[] = { - { 5, char106_stroke0 }, - { 5, char106_stroke1 }, -}; - -/* char: 107 'k' */ - -static const CoordRec char107_stroke0[] = { - { 9.6, 100 }, - { 9.6, 0 }, -}; - -static const CoordRec char107_stroke1[] = { - { 57.219, 66.6667 }, - { 9.6, 19.0476 }, -}; - -static const CoordRec char107_stroke2[] = { - { 28.6476, 38.0952 }, - { 61.981, 0 }, -}; - -static const StrokeRec char107[] = { - { 2, char107_stroke0 }, - { 2, char107_stroke1 }, - { 2, char107_stroke2 }, -}; - -/* char: 108 'l' */ - -static const CoordRec char108_stroke0[] = { - { 10.02, 100 }, - { 10.02, 0 }, -}; - -static const StrokeRec char108[] = { - { 2, char108_stroke0 }, -}; - -/* char: 109 'm' */ - -static const CoordRec char109_stroke0[] = { - { 9.6, 66.6667 }, - { 9.6, 0 }, -}; - -static const CoordRec char109_stroke1[] = { - { 9.6, 47.619 }, - { 23.8857, 61.9048 }, - { 33.4095, 66.6667 }, - { 47.6952, 66.6667 }, - { 57.219, 61.9048 }, - { 61.981, 47.619 }, - { 61.981, 0 }, -}; - -static const CoordRec char109_stroke2[] = { - { 61.981, 47.619 }, - { 76.2667, 61.9048 }, - { 85.7905, 66.6667 }, - { 100.076, 66.6667 }, - { 109.6, 61.9048 }, - { 114.362, 47.619 }, - { 114.362, 0 }, -}; - -static const StrokeRec char109[] = { - { 2, char109_stroke0 }, - { 7, char109_stroke1 }, - { 7, char109_stroke2 }, -}; - -/* char: 110 'n' */ - -static const CoordRec char110_stroke0[] = { - { 9.18, 66.6667 }, - { 9.18, 0 }, -}; - -static const CoordRec char110_stroke1[] = { - { 9.18, 47.619 }, - { 23.4657, 61.9048 }, - { 32.9895, 66.6667 }, - { 47.2752, 66.6667 }, - { 56.799, 61.9048 }, - { 61.561, 47.619 }, - { 61.561, 0 }, -}; - -static const StrokeRec char110[] = { - { 2, char110_stroke0 }, - { 7, char110_stroke1 }, -}; - -/* char: 111 'o' */ - -static const CoordRec char111_stroke0[] = { - { 28.7895, 66.6667 }, - { 19.2657, 61.9048 }, - { 9.7419, 52.381 }, - { 4.98, 38.0952 }, - { 4.98, 28.5714 }, - { 9.7419, 14.2857 }, - { 19.2657, 4.7619 }, - { 28.7895, 0 }, - { 43.0752, 0 }, - { 52.599, 4.7619 }, - { 62.1229, 14.2857 }, - { 66.8848, 28.5714 }, - { 66.8848, 38.0952 }, - { 62.1229, 52.381 }, - { 52.599, 61.9048 }, - { 43.0752, 66.6667 }, - { 28.7895, 66.6667 }, -}; - -static const StrokeRec char111[] = { - { 17, char111_stroke0 }, -}; - -/* char: 112 'p' */ - -static const CoordRec char112_stroke0[] = { - { 9.46, 66.6667 }, - { 9.46, -33.3333 }, -}; - -static const CoordRec char112_stroke1[] = { - { 9.46, 52.381 }, - { 18.9838, 61.9048 }, - { 28.5076, 66.6667 }, - { 42.7933, 66.6667 }, - { 52.3171, 61.9048 }, - { 61.841, 52.381 }, - { 66.6029, 38.0952 }, - { 66.6029, 28.5714 }, - { 61.841, 14.2857 }, - { 52.3171, 4.7619 }, - { 42.7933, 0 }, - { 28.5076, 0 }, - { 18.9838, 4.7619 }, - { 9.46, 14.2857 }, -}; - -static const StrokeRec char112[] = { - { 2, char112_stroke0 }, - { 14, char112_stroke1 }, -}; - -/* char: 113 'q' */ - -static const CoordRec char113_stroke0[] = { - { 61.9829, 66.6667 }, - { 61.9829, -33.3333 }, -}; - -static const CoordRec char113_stroke1[] = { - { 61.9829, 52.381 }, - { 52.459, 61.9048 }, - { 42.9352, 66.6667 }, - { 28.6495, 66.6667 }, - { 19.1257, 61.9048 }, - { 9.6019, 52.381 }, - { 4.84, 38.0952 }, - { 4.84, 28.5714 }, - { 9.6019, 14.2857 }, - { 19.1257, 4.7619 }, - { 28.6495, 0 }, - { 42.9352, 0 }, - { 52.459, 4.7619 }, - { 61.9829, 14.2857 }, -}; - -static const StrokeRec char113[] = { - { 2, char113_stroke0 }, - { 14, char113_stroke1 }, -}; - -/* char: 114 'r' */ - -static const CoordRec char114_stroke0[] = { - { 9.46, 66.6667 }, - { 9.46, 0 }, -}; - -static const CoordRec char114_stroke1[] = { - { 9.46, 38.0952 }, - { 14.2219, 52.381 }, - { 23.7457, 61.9048 }, - { 33.2695, 66.6667 }, - { 47.5552, 66.6667 }, -}; - -static const StrokeRec char114[] = { - { 2, char114_stroke0 }, - { 5, char114_stroke1 }, -}; - -/* char: 115 's' */ - -static const CoordRec char115_stroke0[] = { - { 57.081, 52.381 }, - { 52.319, 61.9048 }, - { 38.0333, 66.6667 }, - { 23.7476, 66.6667 }, - { 9.4619, 61.9048 }, - { 4.7, 52.381 }, - { 9.4619, 42.8571 }, - { 18.9857, 38.0952 }, - { 42.7952, 33.3333 }, - { 52.319, 28.5714 }, - { 57.081, 19.0476 }, - { 57.081, 14.2857 }, - { 52.319, 4.7619 }, - { 38.0333, 0 }, - { 23.7476, 0 }, - { 9.4619, 4.7619 }, - { 4.7, 14.2857 }, -}; - -static const StrokeRec char115[] = { - { 17, char115_stroke0 }, -}; - -/* char: 116 't' */ - -static const CoordRec char116_stroke0[] = { - { 14.8257, 100 }, - { 14.8257, 19.0476 }, - { 19.5876, 4.7619 }, - { 29.1114, 0 }, - { 38.6352, 0 }, -}; - -static const CoordRec char116_stroke1[] = { - { 0.54, 66.6667 }, - { 33.8733, 66.6667 }, -}; - -static const StrokeRec char116[] = { - { 5, char116_stroke0 }, - { 2, char116_stroke1 }, -}; - -/* char: 117 'u' */ - -static const CoordRec char117_stroke0[] = { - { 9.46, 66.6667 }, - { 9.46, 19.0476 }, - { 14.2219, 4.7619 }, - { 23.7457, 0 }, - { 38.0314, 0 }, - { 47.5552, 4.7619 }, - { 61.841, 19.0476 }, -}; - -static const CoordRec char117_stroke1[] = { - { 61.841, 66.6667 }, - { 61.841, 0 }, -}; - -static const StrokeRec char117[] = { - { 7, char117_stroke0 }, - { 2, char117_stroke1 }, -}; - -/* char: 118 'v' */ - -static const CoordRec char118_stroke0[] = { - { 1.8, 66.6667 }, - { 30.3714, 0 }, -}; - -static const CoordRec char118_stroke1[] = { - { 58.9429, 66.6667 }, - { 30.3714, 0 }, -}; - -static const StrokeRec char118[] = { - { 2, char118_stroke0 }, - { 2, char118_stroke1 }, -}; - -/* char: 119 'w' */ - -static const CoordRec char119_stroke0[] = { - { 2.5, 66.6667 }, - { 21.5476, 0 }, -}; - -static const CoordRec char119_stroke1[] = { - { 40.5952, 66.6667 }, - { 21.5476, 0 }, -}; - -static const CoordRec char119_stroke2[] = { - { 40.5952, 66.6667 }, - { 59.6429, 0 }, -}; - -static const CoordRec char119_stroke3[] = { - { 78.6905, 66.6667 }, - { 59.6429, 0 }, -}; - -static const StrokeRec char119[] = { - { 2, char119_stroke0 }, - { 2, char119_stroke1 }, - { 2, char119_stroke2 }, - { 2, char119_stroke3 }, -}; - -/* char: 120 'x' */ - -static const CoordRec char120_stroke0[] = { - { 1.66, 66.6667 }, - { 54.041, 0 }, -}; - -static const CoordRec char120_stroke1[] = { - { 54.041, 66.6667 }, - { 1.66, 0 }, -}; - -static const StrokeRec char120[] = { - { 2, char120_stroke0 }, - { 2, char120_stroke1 }, -}; - -/* char: 121 'y' */ - -static const CoordRec char121_stroke0[] = { - { 6.5619, 66.6667 }, - { 35.1333, 0 }, -}; - -static const CoordRec char121_stroke1[] = { - { 63.7048, 66.6667 }, - { 35.1333, 0 }, - { 25.6095, -19.0476 }, - { 16.0857, -28.5714 }, - { 6.5619, -33.3333 }, - { 1.8, -33.3333 }, -}; - -static const StrokeRec char121[] = { - { 2, char121_stroke0 }, - { 6, char121_stroke1 }, -}; - -/* char: 122 'z' */ - -static const CoordRec char122_stroke0[] = { - { 56.821, 66.6667 }, - { 4.44, 0 }, -}; - -static const CoordRec char122_stroke1[] = { - { 4.44, 66.6667 }, - { 56.821, 66.6667 }, -}; - -static const CoordRec char122_stroke2[] = { - { 4.44, 0 }, - { 56.821, 0 }, -}; - -static const StrokeRec char122[] = { - { 2, char122_stroke0 }, - { 2, char122_stroke1 }, - { 2, char122_stroke2 }, -}; - -/* char: 123 '{' */ - -static const CoordRec char123_stroke0[] = { - { 31.1895, 119.048 }, - { 21.6657, 114.286 }, - { 16.9038, 109.524 }, - { 12.1419, 100 }, - { 12.1419, 90.4762 }, - { 16.9038, 80.9524 }, - { 21.6657, 76.1905 }, - { 26.4276, 66.6667 }, - { 26.4276, 57.1429 }, - { 16.9038, 47.619 }, -}; - -static const CoordRec char123_stroke1[] = { - { 21.6657, 114.286 }, - { 16.9038, 104.762 }, - { 16.9038, 95.2381 }, - { 21.6657, 85.7143 }, - { 26.4276, 80.9524 }, - { 31.1895, 71.4286 }, - { 31.1895, 61.9048 }, - { 26.4276, 52.381 }, - { 7.38, 42.8571 }, - { 26.4276, 33.3333 }, - { 31.1895, 23.8095 }, - { 31.1895, 14.2857 }, - { 26.4276, 4.7619 }, - { 21.6657, 0 }, - { 16.9038, -9.5238 }, - { 16.9038, -19.0476 }, - { 21.6657, -28.5714 }, -}; - -static const CoordRec char123_stroke2[] = { - { 16.9038, 38.0952 }, - { 26.4276, 28.5714 }, - { 26.4276, 19.0476 }, - { 21.6657, 9.5238 }, - { 16.9038, 4.7619 }, - { 12.1419, -4.7619 }, - { 12.1419, -14.2857 }, - { 16.9038, -23.8095 }, - { 21.6657, -28.5714 }, - { 31.1895, -33.3333 }, -}; - -static const StrokeRec char123[] = { - { 10, char123_stroke0 }, - { 17, char123_stroke1 }, - { 10, char123_stroke2 }, -}; - -/* char: 124 '|' */ - -static const CoordRec char124_stroke0[] = { - { 11.54, 119.048 }, - { 11.54, -33.3333 }, -}; - -static const StrokeRec char124[] = { - { 2, char124_stroke0 }, -}; - -/* char: 125 '}' */ - -static const CoordRec char125_stroke0[] = { - { 9.18, 119.048 }, - { 18.7038, 114.286 }, - { 23.4657, 109.524 }, - { 28.2276, 100 }, - { 28.2276, 90.4762 }, - { 23.4657, 80.9524 }, - { 18.7038, 76.1905 }, - { 13.9419, 66.6667 }, - { 13.9419, 57.1429 }, - { 23.4657, 47.619 }, -}; - -static const CoordRec char125_stroke1[] = { - { 18.7038, 114.286 }, - { 23.4657, 104.762 }, - { 23.4657, 95.2381 }, - { 18.7038, 85.7143 }, - { 13.9419, 80.9524 }, - { 9.18, 71.4286 }, - { 9.18, 61.9048 }, - { 13.9419, 52.381 }, - { 32.9895, 42.8571 }, - { 13.9419, 33.3333 }, - { 9.18, 23.8095 }, - { 9.18, 14.2857 }, - { 13.9419, 4.7619 }, - { 18.7038, 0 }, - { 23.4657, -9.5238 }, - { 23.4657, -19.0476 }, - { 18.7038, -28.5714 }, -}; - -static const CoordRec char125_stroke2[] = { - { 23.4657, 38.0952 }, - { 13.9419, 28.5714 }, - { 13.9419, 19.0476 }, - { 18.7038, 9.5238 }, - { 23.4657, 4.7619 }, - { 28.2276, -4.7619 }, - { 28.2276, -14.2857 }, - { 23.4657, -23.8095 }, - { 18.7038, -28.5714 }, - { 9.18, -33.3333 }, -}; - -static const StrokeRec char125[] = { - { 10, char125_stroke0 }, - { 17, char125_stroke1 }, - { 10, char125_stroke2 }, -}; - -/* char: 126 '~' */ - -static const CoordRec char126_stroke0[] = { - { 2.92, 28.5714 }, - { 2.92, 38.0952 }, - { 7.6819, 52.381 }, - { 17.2057, 57.1429 }, - { 26.7295, 57.1429 }, - { 36.2533, 52.381 }, - { 55.301, 38.0952 }, - { 64.8248, 33.3333 }, - { 74.3486, 33.3333 }, - { 83.8724, 38.0952 }, - { 88.6343, 47.619 }, -}; - -static const CoordRec char126_stroke1[] = { - { 2.92, 38.0952 }, - { 7.6819, 47.619 }, - { 17.2057, 52.381 }, - { 26.7295, 52.381 }, - { 36.2533, 47.619 }, - { 55.301, 33.3333 }, - { 64.8248, 28.5714 }, - { 74.3486, 28.5714 }, - { 83.8724, 33.3333 }, - { 88.6343, 47.619 }, - { 88.6343, 57.1429 }, -}; - -static const StrokeRec char126[] = { - { 11, char126_stroke0 }, - { 11, char126_stroke1 }, -}; - -/* char: 127 */ - -static const CoordRec char127_stroke0[] = { - { 52.381, 100 }, - { 14.2857, -33.3333 }, -}; - -static const CoordRec char127_stroke1[] = { - { 28.5714, 66.6667 }, - { 14.2857, 61.9048 }, - { 4.7619, 52.381 }, - { 0, 38.0952 }, - { 0, 23.8095 }, - { 4.7619, 14.2857 }, - { 14.2857, 4.7619 }, - { 28.5714, 0 }, - { 38.0952, 0 }, - { 52.381, 4.7619 }, - { 61.9048, 14.2857 }, - { 66.6667, 28.5714 }, - { 66.6667, 42.8571 }, - { 61.9048, 52.381 }, - { 52.381, 61.9048 }, - { 38.0952, 66.6667 }, - { 28.5714, 66.6667 }, -}; - -static const StrokeRec char127[] = { - { 2, char127_stroke0 }, - { 17, char127_stroke1 }, -}; - -static const StrokeCharRec chars[] = { - { 0, /* char0 */ 0, 0, 0 }, - { 0, /* char1 */ 0, 0, 0 }, - { 0, /* char2 */ 0, 0, 0 }, - { 0, /* char3 */ 0, 0, 0 }, - { 0, /* char4 */ 0, 0, 0 }, - { 0, /* char5 */ 0, 0, 0 }, - { 0, /* char6 */ 0, 0, 0 }, - { 0, /* char7 */ 0, 0, 0 }, - { 0, /* char8 */ 0, 0, 0 }, - { 0, /* char9 */ 0, 0, 0 }, - { 0, /* char10 */ 0, 0, 0 }, - { 0, /* char11 */ 0, 0, 0 }, - { 0, /* char12 */ 0, 0, 0 }, - { 0, /* char13 */ 0, 0, 0 }, - { 0, /* char14 */ 0, 0, 0 }, - { 0, /* char15 */ 0, 0, 0 }, - { 0, /* char16 */ 0, 0, 0 }, - { 0, /* char17 */ 0, 0, 0 }, - { 0, /* char18 */ 0, 0, 0 }, - { 0, /* char19 */ 0, 0, 0 }, - { 0, /* char20 */ 0, 0, 0 }, - { 0, /* char21 */ 0, 0, 0 }, - { 0, /* char22 */ 0, 0, 0 }, - { 0, /* char23 */ 0, 0, 0 }, - { 0, /* char24 */ 0, 0, 0 }, - { 0, /* char25 */ 0, 0, 0 }, - { 0, /* char26 */ 0, 0, 0 }, - { 0, /* char27 */ 0, 0, 0 }, - { 0, /* char28 */ 0, 0, 0 }, - { 0, /* char29 */ 0, 0, 0 }, - { 0, /* char30 */ 0, 0, 0 }, - { 0, /* char31 */ 0, 0, 0 }, - { 0, /* char32 */ 0, 52.381, 104.762 }, - { 2, char33, 13.3819, 26.6238 }, - { 2, char34, 23.0676, 51.4352 }, - { 4, char35, 36.5333, 79.4886 }, - { 3, char36, 38.1533, 76.2067 }, - { 3, char37, 49.2171, 96.5743 }, - { 1, char38, 53.599, 101.758 }, - { 1, char39, 4.44, 13.62 }, - { 1, char40, 21.8657, 47.1733 }, - { 1, char41, 24.3276, 47.5333 }, - { 3, char42, 30.7695, 59.439 }, - { 2, char43, 48.8371, 97.2543 }, - { 1, char44, 13.5219, 26.0638 }, - { 1, char45, 50.2371, 100.754 }, - { 1, char46, 13.1019, 26.4838 }, - { 1, char47, 40.5733, 82.1067 }, - { 1, char48, 38.3133, 77.0667 }, - { 1, char49, 30.8676, 66.5295 }, - { 1, char50, 38.7533, 77.6467 }, - { 1, char51, 38.3333, 77.0467 }, - { 2, char52, 37.2133, 80.1686 }, - { 1, char53, 38.1933, 77.6867 }, - { 1, char54, 34.1514, 73.8048 }, - { 2, char55, 38.8933, 77.2267 }, - { 1, char56, 38.9333, 77.6667 }, - { 1, char57, 39.9333, 74.0648 }, - { 2, char58, 14.0819, 26.2238 }, - { 2, char59, 12.9619, 26.3038 }, - { 1, char60, 41.1552, 81.6105 }, - { 2, char61, 48.5571, 97.2543 }, - { 1, char62, 40.8752, 81.6105 }, - { 2, char63, 36.9914, 73.9029 }, - { 2, char64, 34.9314, 74.3648 }, - { 3, char65, 40.5952, 80.4905 }, - { 3, char66, 44.7533, 83.6267 }, - { 1, char67, 39.9933, 84.4886 }, - { 2, char68, 45.2933, 85.2867 }, - { 4, char69, 39.9914, 78.1848 }, - { 3, char70, 39.9914, 78.7448 }, - { 2, char71, 40.3933, 89.7686 }, - { 3, char72, 44.7533, 89.0867 }, - { 1, char73, 10.86, 21.3 }, - { 1, char74, 31.0714, 59.999 }, - { 3, char75, 44.6133, 79.3267 }, - { 2, char76, 40.2514, 71.3229 }, - { 4, char77, 48.9552, 97.2105 }, - { 3, char78, 44.4733, 88.8067 }, - { 1, char79, 44.3352, 88.8305 }, - { 2, char80, 45.4333, 85.6667 }, - { 2, char81, 43.3952, 88.0905 }, - { 3, char82, 45.0133, 82.3667 }, - { 1, char83, 41.3333, 80.8267 }, - { 2, char84, 35.6933, 71.9467 }, - { 1, char85, 44.8733, 89.4867 }, - { 2, char86, 40.4552, 81.6105 }, - { 4, char87, 49.839, 100.518 }, - { 2, char88, 35.8333, 72.3667 }, - { 2, char89, 39.6152, 79.6505 }, - { 3, char90, 35.8333, 73.7467 }, - { 4, char91, 22.0657, 46.1133 }, - { 1, char92, 39.1733, 78.2067 }, - { 4, char93, 23.4876, 46.3933 }, - { 2, char94, 44.0752, 90.2305 }, - { 1, char95, 51.281, 104.062 }, - { 2, char96, 42.5457, 83.5714 }, - { 2, char97, 35.2514, 66.6029 }, - { 2, char98, 37.3314, 70.4629 }, - { 1, char99, 34.0914, 68.9229 }, - { 2, char100, 33.2114, 70.2629 }, - { 1, char101, 34.2914, 68.5229 }, - { 2, char102, 14.9657, 38.6552 }, - { 2, char103, 33.9314, 70.9829 }, - { 2, char104, 33.4095, 71.021 }, - { 2, char105, 14.7819, 28.8638 }, - { 2, char106, 17.3876, 36.2314 }, - { 3, char107, 33.4095, 62.521 }, - { 1, char108, 10.02, 19.34 }, - { 3, char109, 61.981, 123.962 }, - { 2, char110, 32.9895, 70.881 }, - { 1, char111, 33.5514, 71.7448 }, - { 2, char112, 38.0314, 70.8029 }, - { 2, char113, 33.4114, 70.7429 }, - { 2, char114, 23.7457, 49.4952 }, - { 1, char115, 28.5095, 62.321 }, - { 2, char116, 14.8257, 39.3152 }, - { 2, char117, 33.2695, 71.161 }, - { 2, char118, 30.3714, 60.6029 }, - { 4, char119, 40.5952, 80.4905 }, - { 2, char120, 25.4695, 56.401 }, - { 2, char121, 35.1333, 66.0648 }, - { 3, char122, 28.2495, 61.821 }, - { 3, char123, 21.6657, 41.6295 }, - { 1, char124, 11.54, 23.78 }, - { 3, char125, 18.7038, 41.4695 }, - { 2, char126, 45.7771, 91.2743 }, - { 2, char127, 33.3333, 66.6667 }, -}; - -StrokeFontRec glutStrokeRoman = { "Roman", 128, chars, 119.048, -33.3333 }; - diff --git a/src/glut/os2/glut_shapes.cpp b/src/glut/os2/glut_shapes.cpp deleted file mode 100644 index 111e2d48e9..0000000000 --- a/src/glut/os2/glut_shapes.cpp +++ /dev/null @@ -1,595 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/** -(c) Copyright 1993, Silicon Graphics, Inc. - -ALL RIGHTS RESERVED - -Permission to use, copy, modify, and distribute this software -for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that -both the copyright notice and this permission notice appear in -supporting documentation, and that the name of Silicon -Graphics, Inc. not be used in advertising or publicity -pertaining to distribution of the software without specific, -written prior permission. - -THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU -"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR -OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO -EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE -ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, -INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, -SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR -NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR -PERFORMANCE OF THIS SOFTWARE. - -US Government Users Restricted Rights - -Use, duplication, or disclosure by the Government is subject to -restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -(c)(1)(ii) of the Rights in Technical Data and Computer -Software clause at DFARS 252.227-7013 and/or in similar or -successor clauses in the FAR or the DOD or NASA FAR -Supplement. Unpublished-- rights reserved under the copyright -laws of the United States. Contractor/manufacturer is Silicon -Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA -94039-7311. - -OpenGL(TM) is a trademark of Silicon Graphics, Inc. -*/ - -#include -#include "glutint.h" - -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -static GLUquadricObj *quadObj; - -#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } - -static void -initQuadObj(void) -{ - quadObj = gluNewQuadric(); - if (!quadObj) - __glutFatalError("out of memory."); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireSphere(GLdouble radius, GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_LINE); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluSphere(quadObj, radius, slices, stacks); -} - -void GLUTAPIENTRY -glutSolidSphere(GLdouble radius, GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_FILL); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluSphere(quadObj, radius, slices, stacks); -} - -void GLUTAPIENTRY -glutWireCone(GLdouble base, GLdouble height, - GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_LINE); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluCylinder(quadObj, base, 0.0, height, slices, stacks); -} - -void GLUTAPIENTRY -glutSolidCone(GLdouble base, GLdouble height, - GLint slices, GLint stacks) -{ - QUAD_OBJ_INIT(); - gluQuadricDrawStyle(quadObj, GLU_FILL); - gluQuadricNormals(quadObj, GLU_SMOOTH); - /* If we ever changed/used the texture or orientation state - of quadObj, we'd need to change it to the defaults here - with gluQuadricTexture and/or gluQuadricOrientation. */ - gluCylinder(quadObj, base, 0.0, height, slices, stacks); -} - -/* ENDCENTRY */ - -static void -drawBox(GLfloat size, GLenum type) -{ - static GLfloat n[6][3] = - { - {-1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {1.0, 0.0, 0.0}, - {0.0, -1.0, 0.0}, - {0.0, 0.0, 1.0}, - {0.0, 0.0, -1.0} - }; - static GLint faces[6][4] = - { - {0, 1, 2, 3}, - {3, 2, 6, 7}, - {7, 6, 5, 4}, - {4, 5, 1, 0}, - {5, 6, 2, 1}, - {7, 4, 0, 3} - }; - GLfloat v[8][3]; - GLint i; - - v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2; - v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2; - v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2; - v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2; - v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2; - v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2; - - for (i = 5; i >= 0; i--) { - glBegin(type); - glNormal3fv(&n[i][0]); - glVertex3fv(&v[faces[i][0]][0]); - glVertex3fv(&v[faces[i][1]][0]); - glVertex3fv(&v[faces[i][2]][0]); - glVertex3fv(&v[faces[i][3]][0]); - glEnd(); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireCube(GLdouble size) -{ - drawBox(size, GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidCube(GLdouble size) -{ - drawBox(size, GL_QUADS); -} - -/* ENDCENTRY */ - -static void -doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings) -{ - int i, j; - GLfloat theta, phi, theta1; - GLfloat cosTheta, sinTheta; - GLfloat cosTheta1, sinTheta1; - GLfloat ringDelta, sideDelta; - - ringDelta = 2.0 * M_PI / rings; - sideDelta = 2.0 * M_PI / nsides; - - theta = 0.0; - cosTheta = 1.0; - sinTheta = 0.0; - for (i = rings - 1; i >= 0; i--) { - theta1 = theta + ringDelta; - cosTheta1 = cos(theta1); - sinTheta1 = sin(theta1); - glBegin(GL_QUAD_STRIP); - phi = 0.0; - for (j = nsides; j >= 0; j--) { - GLfloat cosPhi, sinPhi, dist; - - phi += sideDelta; - cosPhi = cos(phi); - sinPhi = sin(phi); - dist = R + r * cosPhi; - - glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi); - glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi); - glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi); - glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi); - } - glEnd(); - theta = theta1; - cosTheta = cosTheta1; - sinTheta = sinTheta1; - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, - GLint nsides, GLint rings) -{ - glPushAttrib(GL_POLYGON_BIT); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - doughnut(innerRadius, outerRadius, nsides, rings); - glPopAttrib(); -} - -void GLUTAPIENTRY -glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, - GLint nsides, GLint rings) -{ - doughnut(innerRadius, outerRadius, nsides, rings); -} - -/* ENDCENTRY */ - -static GLfloat dodec[20][3]; - -static void -initDodecahedron(void) -{ - GLfloat alpha, beta; - - alpha = sqrt(2.0 / (3.0 + sqrt(5.0))); - beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) - - 2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0)))); - /* *INDENT-OFF* */ - dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta; - dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta; - dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1; - dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1; - dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1; - dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1; - dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1; - dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1; - dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1; - dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1; - dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0; - dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0; - dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0; - dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0; - dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta; - dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta; - dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha; - dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha; - dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha; - dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha; - /* *INDENT-ON* */ - -} - -#define DIFF3(_a,_b,_c) { \ - (_c)[0] = (_a)[0] - (_b)[0]; \ - (_c)[1] = (_a)[1] - (_b)[1]; \ - (_c)[2] = (_a)[2] - (_b)[2]; \ -} - -static void -crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3]) -{ - GLfloat p[3]; /* in case prod == v1 or v2 */ - - p[0] = v1[1] * v2[2] - v2[1] * v1[2]; - p[1] = v1[2] * v2[0] - v2[2] * v1[0]; - p[2] = v1[0] * v2[1] - v2[0] * v1[1]; - prod[0] = p[0]; - prod[1] = p[1]; - prod[2] = p[2]; -} - -static void -normalize(GLfloat v[3]) -{ - GLfloat d; - - d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); - if (d == 0.0) { - __glutWarning("normalize: zero length vector"); - v[0] = d = 1.0; - } - d = 1 / d; - v[0] *= d; - v[1] *= d; - v[2] *= d; -} - -static void -pentagon(int a, int b, int c, int d, int e, GLenum shadeType) -{ - GLfloat n0[3], d1[3], d2[3]; - - DIFF3(dodec[a], dodec[b], d1); - DIFF3(dodec[b], dodec[c], d2); - crossprod(d1, d2, n0); - normalize(n0); - - glBegin(shadeType); - glNormal3fv(n0); - glVertex3fv(&dodec[a][0]); - glVertex3fv(&dodec[b][0]); - glVertex3fv(&dodec[c][0]); - glVertex3fv(&dodec[d][0]); - glVertex3fv(&dodec[e][0]); - glEnd(); -} - -static void -dodecahedron(GLenum type) -{ - static int inited = 0; - - if (inited == 0) { - inited = 1; - initDodecahedron(); - } - pentagon(0, 1, 9, 16, 5, type); - pentagon(1, 0, 3, 18, 7, type); - pentagon(1, 7, 11, 10, 9, type); - pentagon(11, 7, 18, 19, 6, type); - pentagon(8, 17, 16, 9, 10, type); - pentagon(2, 14, 15, 6, 19, type); - pentagon(2, 13, 12, 4, 14, type); - pentagon(2, 19, 18, 3, 13, type); - pentagon(3, 0, 5, 12, 13, type); - pentagon(6, 15, 8, 10, 11, type); - pentagon(4, 17, 8, 15, 14, type); - pentagon(4, 12, 5, 16, 17, type); -} - -/* CENTRY */ -void GLUTAPIENTRY glutWireDodecahedron(void) -{ - dodecahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidDodecahedron(void) -{ - dodecahedron(GL_TRIANGLE_FAN); -} - -/* ENDCENTRY */ - -static void -recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3, - GLenum shadeType) -{ - GLfloat q0[3], q1[3]; - - DIFF3(n1, n2, q0); - DIFF3(n2, n3, q1); - crossprod(q0, q1, q1); - normalize(q1); - - glBegin(shadeType); - glNormal3fv(q1); - glVertex3fv(n1); - glVertex3fv(n2); - glVertex3fv(n3); - glEnd(); -} - -static void -subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2, - GLenum shadeType) -{ - int depth; - GLfloat w0[3], w1[3], w2[3]; - GLfloat l; - int i, j, k, n; - - depth = 1; - for (i = 0; i < depth; i++) { - for (j = 0; i + j < depth; j++) { - k = depth - i - j; - for (n = 0; n < 3; n++) { - w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth; - w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n]) - / depth; - w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n]) - / depth; - } - l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]); - w0[0] /= l; - w0[1] /= l; - w0[2] /= l; - l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]); - w1[0] /= l; - w1[1] /= l; - w1[2] /= l; - l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]); - w2[0] /= l; - w2[1] /= l; - w2[2] /= l; - recorditem(w1, w0, w2, shadeType); - } - } -} - -static void -drawtriangle(int i, GLfloat data[][3], int ndx[][3], - GLenum shadeType) -{ - GLfloat *x0, *x1, *x2; - - x0 = data[ndx[i][0]]; - x1 = data[ndx[i][1]]; - x2 = data[ndx[i][2]]; - subdivide(x0, x1, x2, shadeType); -} - -/* octahedron data: The octahedron produced is centered at the - origin and has radius 1.0 */ -static GLfloat odata[6][3] = -{ - {1.0, 0.0, 0.0}, - {-1.0, 0.0, 0.0}, - {0.0, 1.0, 0.0}, - {0.0, -1.0, 0.0}, - {0.0, 0.0, 1.0}, - {0.0, 0.0, -1.0} -}; - -static int ondex[8][3] = -{ - {0, 4, 2}, - {1, 2, 4}, - {0, 3, 4}, - {1, 4, 3}, - {0, 2, 5}, - {1, 5, 2}, - {0, 5, 3}, - {1, 3, 5} -}; - -static void -octahedron(GLenum shadeType) -{ - int i; - - for (i = 7; i >= 0; i--) { - drawtriangle(i, odata, ondex, shadeType); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireOctahedron(void) -{ - octahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidOctahedron(void) -{ - octahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ - -/* icosahedron data: These numbers are rigged to make an - icosahedron of radius 1.0 */ - -#define X .525731112119133606 -#define Z .850650808352039932 - -static GLfloat idata[12][3] = -{ - {-X, 0, Z}, - {X, 0, Z}, - {-X, 0, -Z}, - {X, 0, -Z}, - {0, Z, X}, - {0, Z, -X}, - {0, -Z, X}, - {0, -Z, -X}, - {Z, X, 0}, - {-Z, X, 0}, - {Z, -X, 0}, - {-Z, -X, 0} -}; - -static int index[20][3] = -{ - {0, 4, 1}, - {0, 9, 4}, - {9, 5, 4}, - {4, 5, 8}, - {4, 8, 1}, - {8, 10, 1}, - {8, 3, 10}, - {5, 3, 8}, - {5, 2, 3}, - {2, 7, 3}, - {7, 10, 3}, - {7, 6, 10}, - {7, 11, 6}, - {11, 0, 6}, - {0, 1, 6}, - {6, 1, 10}, - {9, 0, 11}, - {9, 11, 2}, - {9, 2, 5}, - {7, 2, 11}, -}; - -static void -icosahedron(GLenum shadeType) -{ - int i; - - for (i = 19; i >= 0; i--) { - drawtriangle(i, idata, index, shadeType); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireIcosahedron(void) -{ - icosahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidIcosahedron(void) -{ - icosahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ - -/* tetrahedron data: */ - -#define T 1.73205080756887729 - -static GLfloat tdata[4][3] = -{ - {T, T, T}, - {T, -T, -T}, - {-T, T, -T}, - {-T, -T, T} -}; - -static int tndex[4][3] = -{ - {0, 1, 3}, - {2, 1, 0}, - {3, 2, 0}, - {1, 2, 3} -}; - -static void -tetrahedron(GLenum shadeType) -{ - int i; - - for (i = 3; i >= 0; i--) - drawtriangle(i, tdata, tndex, shadeType); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutWireTetrahedron(void) -{ - tetrahedron(GL_LINE_LOOP); -} - -void GLUTAPIENTRY -glutSolidTetrahedron(void) -{ - tetrahedron(GL_TRIANGLES); -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_stroke.cpp b/src/glut/os2/glut_stroke.cpp deleted file mode 100644 index ac231e4973..0000000000 --- a/src/glut/os2/glut_stroke.cpp +++ /dev/null @@ -1,42 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include "glutint.h" -#include "glutstroke.h" - -void GLUTAPIENTRY -glutStrokeCharacter(GLUTstrokeFont font, int c) -{ - const StrokeCharRec *ch; - const StrokeRec *stroke; - const CoordRec *coord; - StrokeFontPtr fontinfo; - int i, j; - - -#if defined(_WIN32) - fontinfo = (StrokeFontPtr) __glutFont(font); -#else - fontinfo = (StrokeFontPtr) font; -#endif - - if (c < 0 || c >= fontinfo->num_chars) - return; - ch = &(fontinfo->ch[c]); - if (ch) { - for (i = ch->num_strokes, stroke = ch->stroke; - i > 0; i--, stroke++) { - glBegin(GL_LINE_STRIP); - for (j = stroke->num_coords, coord = stroke->coord; - j > 0; j--, coord++) { - glVertex2f(coord->x, coord->y); - } - glEnd(); - } - glTranslatef(ch->right, 0.0, 0.0); - } -} diff --git a/src/glut/os2/glut_swap.cpp b/src/glut/os2/glut_swap.cpp deleted file mode 100644 index 4831b8eb35..0000000000 --- a/src/glut/os2/glut_swap.cpp +++ /dev/null @@ -1,67 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include "glutint.h" - -GLint __glutFPS = 0; -GLint __glutSwapCount = 0; -GLint __glutSwapTime = 0; - -/* CENTRY */ -void GLUTAPIENTRY -glutSwapBuffers(void) -{ - GLUTwindow *window = __glutCurrentWindow; - - if (window->renderWin == window->win) { - if (__glutCurrentWindow->treatAsSingle) { - /* Pretend the double buffered window is single buffered, - so treat glutSwapBuffers as a no-op. */ - return; - } - } else { - if (__glutCurrentWindow->overlay->treatAsSingle) { - /* Pretend the double buffered overlay is single - buffered, so treat glutSwapBuffers as a no-op. */ - return; - } - } - - /* For the MESA_SWAP_HACK. */ - window->usedSwapBuffers = 1; - - SWAP_BUFFERS_LAYER(__glutCurrentWindow); - - /* I considered putting the window being swapped on the - GLUT_FINISH_WORK work list because you could call - glutSwapBuffers from an idle callback which doesn't call - __glutSetWindow which normally adds indirect rendering - windows to the GLUT_FINISH_WORK work list. Not being put - on the list could lead to the buffering up of multiple - redisplays and buffer swaps and hamper interactivity. I - consider this an application bug due to not using - glutPostRedisplay to trigger redraws. If - glutPostRedisplay were used, __glutSetWindow would be - called and a glFinish to throttle buffering would occur. */ - - if (__glutFPS) { - GLint t = glutGet(GLUT_ELAPSED_TIME); - __glutSwapCount++; - if (__glutSwapTime == 0) - __glutSwapTime = t; - else if (t - __glutSwapTime > __glutFPS) { - float time = 0.001 * (t - __glutSwapTime); - float fps = (float) __glutSwapCount / time; - fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", - __glutSwapCount, time, fps); - __glutSwapTime = t; - __glutSwapCount = 0; - } - } -} -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_teapot.cpp b/src/glut/os2/glut_teapot.cpp deleted file mode 100644 index 31bbbbd6df..0000000000 --- a/src/glut/os2/glut_teapot.cpp +++ /dev/null @@ -1,210 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/** -(c) Copyright 1993, Silicon Graphics, Inc. - -ALL RIGHTS RESERVED - -Permission to use, copy, modify, and distribute this software -for any purpose and without fee is hereby granted, provided -that the above copyright notice appear in all copies and that -both the copyright notice and this permission notice appear in -supporting documentation, and that the name of Silicon -Graphics, Inc. not be used in advertising or publicity -pertaining to distribution of the software without specific, -written prior permission. - -THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU -"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR -OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF -MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO -EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE -ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, -INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, -SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR -NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY -OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR -PERFORMANCE OF THIS SOFTWARE. - -US Government Users Restricted Rights - -Use, duplication, or disclosure by the Government is subject to -restrictions set forth in FAR 52.227.19(c)(2) or subparagraph -(c)(1)(ii) of the Rights in Technical Data and Computer -Software clause at DFARS 252.227-7013 and/or in similar or -successor clauses in the FAR or the DOD or NASA FAR -Supplement. Unpublished-- rights reserved under the copyright -laws of the United States. Contractor/manufacturer is Silicon -Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA -94039-7311. - -OpenGL(TM) is a trademark of Silicon Graphics, Inc. -*/ - -#include "glutint.h" - -/* Rim, body, lid, and bottom data must be reflected in x and - y; handle and spout data across the y axis only. */ - -static int patchdata[][16] = -{ - /* rim */ - {102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15}, - /* body */ - {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27}, - {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40}, - /* lid */ - {96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, - 101, 0, 1, 2, 3,}, - {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117}, - /* bottom */ - {118, 118, 118, 118, 124, 122, 119, 121, 123, 126, - 125, 120, 40, 39, 38, 37}, - /* handle */ - {41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56}, - {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 28, 65, 66, 67}, - /* spout */ - {68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83}, - {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95} -}; -/* *INDENT-OFF* */ - -static float cpdata[][3] = -{ - {0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0, - -0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125}, - {0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375, - 0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, - 2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84, - 2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875}, - {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75, - 1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35}, - {0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2, - 0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12, - 0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225}, - {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225}, - {1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0, - -1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, - -0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3, - 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0, - 2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0, - 2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8}, - {-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3, - -0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3, - 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2, - -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0, - 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0, - 0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, - 0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1}, - {2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7, - -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0, - 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, - {3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475}, - {3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4}, - {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0, - 3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, - 3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4, - -0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0, - 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4, - 2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, - 2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4}, - {0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425, - -0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425, - 0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075}, - {0.84, -1.5, 0.075} -}; - -static float tex[2][2][2] = -{ - { {0, 0}, - {1, 0}}, - { {0, 1}, - {1, 1}} -}; - -/* *INDENT-ON* */ - -static void -teapot(GLint grid, GLdouble scale, GLenum type) -{ - float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3]; - long i, j, k, l; - - glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT); - glEnable(GL_AUTO_NORMAL); - glEnable(GL_NORMALIZE); - glEnable(GL_MAP2_VERTEX_3); - glEnable(GL_MAP2_TEXTURE_COORD_2); - glPushMatrix(); - glRotatef(270.0, 1.0, 0.0, 0.0); - glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale); - glTranslatef(0.0, 0.0, -1.5); - for (i = 0; i < 10; i++) { - for (j = 0; j < 4; j++) { - for (k = 0; k < 4; k++) { - for (l = 0; l < 3; l++) { - p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 1) - q[j][k][l] *= -1.0; - if (i < 6) { - r[j][k][l] = - cpdata[patchdata[i][j * 4 + (3 - k)]][l]; - if (l == 0) - r[j][k][l] *= -1.0; - s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l]; - if (l == 0) - s[j][k][l] *= -1.0; - if (l == 1) - s[j][k][l] *= -1.0; - } - } - } - } - glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2, - &tex[0][0][0]); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &p[0][0][0]); - glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &q[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - if (i < 6) { - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &r[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, - &s[0][0][0]); - glEvalMesh2(type, 0, grid, 0, grid); - } - } - glPopMatrix(); - glPopAttrib(); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutSolidTeapot(GLdouble scale) -{ - teapot(7, scale, GL_FILL); -} - -void GLUTAPIENTRY -glutWireTeapot(GLdouble scale) -{ - teapot(10, scale, GL_LINE); -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_tr24.cpp b/src/glut/os2/glut_tr24.cpp deleted file mode 100644 index a3cbf4b62b..0000000000 --- a/src/glut/os2/glut_tr24.cpp +++ /dev/null @@ -1,2063 +0,0 @@ - -/* GENERATED FILE -- DO NOT MODIFY */ - -#define glutBitmapTimesRoman24 XXX -#include "glutbitmap.h" -#undef glutBitmapTimesRoman24 - -/* char: 0xff */ - -static const GLubyte ch255data[] = { -0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, -0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, -0xf1,0xe0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, -}; - -static const BitmapCharRec ch255 = {11,21,0,5,11,ch255data}; - -/* char: 0xfe */ - -static const GLubyte ch254data[] = { -0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, -0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0xe0,0x0, -}; - -static const BitmapCharRec ch254 = {10,22,-1,5,12,ch254data}; - -/* char: 0xfd */ - -static const GLubyte ch253data[] = { -0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, -0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, -0xf1,0xe0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80,0x1,0x80, -}; - -static const BitmapCharRec ch253 = {11,22,0,5,11,ch253data}; - -/* char: 0xfc */ - -static const GLubyte ch252data[] = { -0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, -}; - -static const BitmapCharRec ch252 = {11,16,-1,0,13,ch252data}; - -/* char: 0xfb */ - -static const GLubyte ch251data[] = { -0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, -0xc,0x0, -}; - -static const BitmapCharRec ch251 = {11,17,-1,0,13,ch251data}; - -/* char: 0xfa */ - -static const GLubyte ch250data[] = { -0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, -0x1,0x80, -}; - -static const BitmapCharRec ch250 = {11,17,-1,0,13,ch250data}; - -/* char: 0xf9 */ - -static const GLubyte ch249data[] = { -0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, -0x30,0x0, -}; - -static const BitmapCharRec ch249 = {11,17,-1,0,13,ch249data}; - -/* char: 0xf8 */ - -static const GLubyte ch248data[] = { -0xc0,0x0,0xde,0x0,0x73,0x80,0x71,0x80,0xd0,0xc0,0xd8,0xc0,0xc8,0xc0,0xcc,0xc0, -0xc4,0xc0,0xc6,0xc0,0x63,0x80,0x73,0x80,0x1e,0xc0,0x0,0xc0, -}; - -static const BitmapCharRec ch248 = {10,14,-1,1,12,ch248data}; - -/* char: 0xf7 */ - -static const GLubyte ch247data[] = { -0x6,0x0,0x6,0x0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0, -0x6,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch247 = {12,10,-1,-2,14,ch247data}; - -/* char: 0xf6 */ - -static const GLubyte ch246data[] = { -0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, -}; - -static const BitmapCharRec ch246 = {10,16,-1,0,12,ch246data}; - -/* char: 0xf5 */ - -static const GLubyte ch245data[] = { -0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, -}; - -static const BitmapCharRec ch245 = {10,16,-1,0,12,ch245data}; - -/* char: 0xf4 */ - -static const GLubyte ch244data[] = { -0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, -0xc,0x0, -}; - -static const BitmapCharRec ch244 = {10,17,-1,0,12,ch244data}; - -/* char: 0xf3 */ - -static const GLubyte ch243data[] = { -0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x8,0x0,0x6,0x0,0x3,0x80, -0x1,0x80, -}; - -static const BitmapCharRec ch243 = {10,17,-1,0,12,ch243data}; - -/* char: 0xf2 */ - -static const GLubyte ch242data[] = { -0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0,0x0,0x0,0x2,0x0,0xc,0x0,0x38,0x0, -0x30,0x0, -}; - -static const BitmapCharRec ch242 = {10,17,-1,0,12,ch242data}; - -/* char: 0xf1 */ - -static const GLubyte ch241data[] = { -0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0,0x0,0x0,0x0,0x0,0x27,0x0,0x1c,0x80, -}; - -static const BitmapCharRec ch241 = {11,16,-1,0,13,ch241data}; - -/* char: 0xf0 */ - -static const GLubyte ch240data[] = { -0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0x61,0x80,0x73,0x80,0x1f,0x0,0xc6,0x0,0x3c,0x0,0x1e,0x0,0x71,0x80, -0xc0,0x0, -}; - -static const BitmapCharRec ch240 = {10,17,-1,0,12,ch240data}; - -/* char: 0xef */ - -static const GLubyte ch239data[] = { -0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x0,0xcc,0xcc, -}; - -static const BitmapCharRec ch239 = {6,16,0,0,6,ch239data}; - -/* char: 0xee */ - -static const GLubyte ch238data[] = { -0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x84,0x48,0x78, -0x30, -}; - -static const BitmapCharRec ch238 = {6,17,0,0,6,ch238data}; - -/* char: 0xed */ - -static const GLubyte ch237data[] = { -0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x80,0x60,0x38, -0x18, -}; - -static const BitmapCharRec ch237 = {5,17,-1,0,6,ch237data}; - -/* char: 0xec */ - -static const GLubyte ch236data[] = { -0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x70,0x0,0x8,0x30,0xe0, -0xc0, -}; - -static const BitmapCharRec ch236 = {5,17,0,0,6,ch236data}; - -/* char: 0xeb */ - -static const GLubyte ch235data[] = { -0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, -0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x0,0x0,0x33,0x0,0x33,0x0, -}; - -static const BitmapCharRec ch235 = {9,16,-1,0,11,ch235data}; - -/* char: 0xea */ - -static const GLubyte ch234data[] = { -0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, -0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x21,0x0,0x12,0x0,0x1e,0x0, -0xc,0x0, -}; - -static const BitmapCharRec ch234 = {9,17,-1,0,11,ch234data}; - -/* char: 0xe9 */ - -static const GLubyte ch233data[] = { -0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, -0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, -0x3,0x0, -}; - -static const BitmapCharRec ch233 = {9,17,-1,0,11,ch233data}; - -/* char: 0xe8 */ - -static const GLubyte ch232data[] = { -0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, -0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, -0x60,0x0, -}; - -static const BitmapCharRec ch232 = {9,17,-1,0,11,ch232data}; - -/* char: 0xe7 */ - -static const GLubyte ch231data[] = { -0x3c,0x0,0x66,0x0,0x6,0x0,0x1e,0x0,0x18,0x0,0x8,0x0,0x1e,0x0,0x7f,0x0, -0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x41,0x80, -0x63,0x80,0x1f,0x0, -}; - -static const BitmapCharRec ch231 = {9,18,-1,6,11,ch231data}; - -/* char: 0xe6 */ - -static const GLubyte ch230data[] = { -0x70,0xf0,0xfb,0xf8,0xc7,0x84,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0xfc, -0x3,0xc,0x63,0xc,0x67,0x98,0x3c,0xf0, -}; - -static const BitmapCharRec ch230 = {14,12,-1,0,16,ch230data}; - -/* char: 0xe5 */ - -static const GLubyte ch229data[] = { -0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, -0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x1c,0x0,0x22,0x0,0x22,0x0, -0x1c,0x0, -}; - -static const BitmapCharRec ch229 = {9,17,-1,0,11,ch229data}; - -/* char: 0xe4 */ - -static const GLubyte ch228data[] = { -0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, -0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x66,0x0,0x66,0x0, -}; - -static const BitmapCharRec ch228 = {9,16,-1,0,11,ch228data}; - -/* char: 0xe3 */ - -static const GLubyte ch227data[] = { -0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, -0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x0,0x0,0x5c,0x0,0x3a,0x0, -}; - -static const BitmapCharRec ch227 = {9,16,-1,0,11,ch227data}; - -/* char: 0xe2 */ - -static const GLubyte ch226data[] = { -0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, -0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x42,0x0,0x24,0x0,0x3c,0x0, -0x18,0x0, -}; - -static const BitmapCharRec ch226 = {9,17,-1,0,11,ch226data}; - -/* char: 0xe1 */ - -static const GLubyte ch225data[] = { -0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, -0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x10,0x0,0xc,0x0,0x7,0x0, -0x3,0x0, -}; - -static const BitmapCharRec ch225 = {9,17,-1,0,11,ch225data}; - -/* char: 0xe0 */ - -static const GLubyte ch224data[] = { -0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, -0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x70,0x0, -0x60,0x0, -}; - -static const BitmapCharRec ch224 = {9,17,-1,0,11,ch224data}; - -/* char: 0xdf */ - -static const GLubyte ch223data[] = { -0xe7,0x0,0x6c,0x80,0x6c,0xc0,0x60,0xc0,0x60,0xc0,0x61,0xc0,0x61,0x80,0x63,0x80, -0x67,0x0,0x6c,0x0,0x63,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, -0x1e,0x0, -}; - -static const BitmapCharRec ch223 = {10,17,-1,0,12,ch223data}; - -/* char: 0xde */ - -static const GLubyte ch222data[] = { -0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18, -0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70,0x3f,0xc0,0x30,0x0,0x30,0x0,0x30,0x0, -0xfc,0x0, -}; - -static const BitmapCharRec ch222 = {13,17,-1,0,15,ch222data}; - -/* char: 0xdd */ - -static const GLubyte ch221data[] = { -0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, -0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, -0xfc,0x3f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, -}; - -static const BitmapCharRec ch221 = {16,22,0,0,16,ch221data}; - -/* char: 0xdc */ - -static const GLubyte ch220data[] = { -0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0xfc,0x1f,0x0,0x0,0x0,0x0,0x6,0x30,0x6,0x30, -}; - -static const BitmapCharRec ch220 = {16,21,-1,0,18,ch220data}; - -/* char: 0xdb */ - -static const GLubyte ch219data[] = { -0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0xfc,0x1f,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, -}; - -static const BitmapCharRec ch219 = {16,22,-1,0,18,ch219data}; - -/* char: 0xda */ - -static const GLubyte ch218data[] = { -0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0xfc,0x1f,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, -}; - -static const BitmapCharRec ch218 = {16,22,-1,0,18,ch218data}; - -/* char: 0xd9 */ - -static const GLubyte ch217data[] = { -0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0xfc,0x1f,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch217 = {16,22,-1,0,18,ch217data}; - -/* char: 0xd8 */ - -static const GLubyte ch216data[] = { -0x20,0x0,0x27,0xe0,0x1c,0x38,0x38,0x1c,0x68,0x6,0x64,0x6,0xc2,0x3,0xc2,0x3, -0xc1,0x3,0xc1,0x3,0xc0,0x83,0xc0,0x83,0xc0,0x43,0x60,0x46,0x60,0x26,0x38,0x1c, -0x1c,0x38,0x7,0xe4,0x0,0x4, -}; - -static const BitmapCharRec ch216 = {16,19,-1,1,18,ch216data}; - -/* char: 0xd7 */ - -static const GLubyte ch215data[] = { -0x80,0x40,0xc0,0xc0,0x61,0x80,0x33,0x0,0x1e,0x0,0xc,0x0,0x1e,0x0,0x33,0x0, -0x61,0x80,0xc0,0xc0,0x80,0x40, -}; - -static const BitmapCharRec ch215 = {10,11,-2,-1,14,ch215data}; - -/* char: 0xd6 */ - -static const GLubyte ch214data[] = { -0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, -0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, -0x7,0xe0,0x0,0x0,0x0,0x0,0x6,0x60,0x6,0x60, -}; - -static const BitmapCharRec ch214 = {16,21,-1,0,18,ch214data}; - -/* char: 0xd5 */ - -static const GLubyte ch213data[] = { -0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, -0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, -0x7,0xe0,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, -}; - -static const BitmapCharRec ch213 = {16,21,-1,0,18,ch213data}; - -/* char: 0xd4 */ - -static const GLubyte ch212data[] = { -0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, -0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, -0x7,0xe0,0x0,0x0,0x8,0x10,0x6,0x60,0x3,0xc0,0x1,0x80, -}; - -static const BitmapCharRec ch212 = {16,22,-1,0,18,ch212data}; - -/* char: 0xd3 */ - -static const GLubyte ch211data[] = { -0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, -0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, -0x7,0xe0,0x0,0x0,0x1,0x0,0x0,0xc0,0x0,0x70,0x0,0x30, -}; - -static const BitmapCharRec ch211 = {16,22,-1,0,18,ch211data}; - -/* char: 0xd2 */ - -static const GLubyte ch210data[] = { -0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, -0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, -0x7,0xe0,0x0,0x0,0x0,0x40,0x1,0x80,0x7,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch210 = {16,22,-1,0,18,ch210data}; - -/* char: 0xd1 */ - -static const GLubyte ch209data[] = { -0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, -0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, -0xf0,0x1f,0x0,0x0,0x0,0x0,0x4,0xe0,0x3,0x90, -}; - -static const BitmapCharRec ch209 = {16,21,-1,0,18,ch209data}; - -/* char: 0xd0 */ - -static const GLubyte ch208data[] = { -0x7f,0xe0,0x18,0x38,0x18,0x1c,0x18,0x6,0x18,0x6,0x18,0x3,0x18,0x3,0x18,0x3, -0xff,0x3,0x18,0x3,0x18,0x3,0x18,0x3,0x18,0x6,0x18,0x6,0x18,0x1c,0x18,0x38, -0x7f,0xe0, -}; - -static const BitmapCharRec ch208 = {16,17,0,0,17,ch208data}; - -/* char: 0xcf */ - -static const GLubyte ch207data[] = { -0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0xfc,0x0,0x0,0xcc,0xcc, -}; - -static const BitmapCharRec ch207 = {6,21,-1,0,8,ch207data}; - -/* char: 0xce */ - -static const GLubyte ch206data[] = { -0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x7e,0x0,0x81,0x66,0x3c,0x18, -}; - -static const BitmapCharRec ch206 = {8,22,-1,0,8,ch206data}; - -/* char: 0xcd */ - -static const GLubyte ch205data[] = { -0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0xfc,0x0,0x40,0x30,0x1c,0xc, -}; - -static const BitmapCharRec ch205 = {6,22,-1,0,8,ch205data}; - -/* char: 0xcc */ - -static const GLubyte ch204data[] = { -0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0xfc,0x0,0x8,0x30,0xe0,0xc0, -}; - -static const BitmapCharRec ch204 = {6,22,-1,0,8,ch204data}; - -/* char: 0xcb */ - -static const GLubyte ch203data[] = { -0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, -0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, -0xff,0xf0,0x0,0x0,0x0,0x0,0x19,0x80,0x19,0x80, -}; - -static const BitmapCharRec ch203 = {13,21,-1,0,15,ch203data}; - -/* char: 0xca */ - -static const GLubyte ch202data[] = { -0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, -0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, -0xff,0xf0,0x0,0x0,0x10,0x20,0xc,0xc0,0x7,0x80,0x3,0x0, -}; - -static const BitmapCharRec ch202 = {13,22,-1,0,15,ch202data}; - -/* char: 0xc9 */ - -static const GLubyte ch201data[] = { -0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, -0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, -0xff,0xf0,0x0,0x0,0x4,0x0,0x3,0x0,0x1,0xc0,0x0,0xc0, -}; - -static const BitmapCharRec ch201 = {13,22,-1,0,15,ch201data}; - -/* char: 0xc8 */ - -static const GLubyte ch200data[] = { -0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, -0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, -0xff,0xf0,0x0,0x0,0x1,0x0,0x6,0x0,0x1c,0x0,0x18,0x0, -}; - -static const BitmapCharRec ch200 = {13,22,-1,0,15,ch200data}; - -/* char: 0xc7 */ - -static const GLubyte ch199data[] = { -0x7,0x80,0xc,0xc0,0x0,0xc0,0x3,0xc0,0x3,0x0,0x1,0x0,0x7,0xe0,0x1e,0x38, -0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, -0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c,0x7,0xe4, -}; - -static const BitmapCharRec ch199 = {14,23,-1,6,16,ch199data}; - -/* char: 0xc6 */ - -static const GLubyte ch198data[] = { -0xf9,0xff,0xf0,0x30,0x60,0x30,0x10,0x60,0x10,0x10,0x60,0x10,0x18,0x60,0x0,0x8, -0x60,0x0,0xf,0xe0,0x80,0xc,0x60,0x80,0x4,0x7f,0x80,0x4,0x60,0x80,0x6,0x60, -0x80,0x2,0x60,0x0,0x2,0x60,0x0,0x1,0x60,0x20,0x1,0x60,0x20,0x1,0xe0,0x60, -0x3,0xff,0xe0, -}; - -static const BitmapCharRec ch198 = {20,17,0,0,21,ch198data}; - -/* char: 0xc5 */ - -static const GLubyte ch197data[] = { -0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, -0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, -0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, -0x0,0x80,0x0,0x1,0xc0,0x0,0x2,0x20,0x0,0x2,0x20,0x0,0x1,0xc0,0x0, -}; - -static const BitmapCharRec ch197 = {17,21,0,0,17,ch197data}; - -/* char: 0xc4 */ - -static const GLubyte ch196data[] = { -0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, -0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, -0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, -0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x6,0x30,0x0,0x6,0x30,0x0, -}; - -static const BitmapCharRec ch196 = {17,21,0,0,17,ch196data}; - -/* char: 0xc3 */ - -static const GLubyte ch195data[] = { -0xfc,0x1f,0x80,0x30,0x7,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, -0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, -0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, -0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0xe0,0x0,0x3,0x90,0x0, -}; - -static const BitmapCharRec ch195 = {17,21,0,0,17,ch195data}; - -/* char: 0xc2 */ - -static const GLubyte ch194data[] = { -0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, -0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, -0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, -0x0,0x80,0x0,0x0,0x0,0x0,0x8,0x10,0x0,0x6,0x60,0x0,0x3,0xc0,0x0,0x1, -0x80,0x0, -}; - -static const BitmapCharRec ch194 = {17,22,0,0,17,ch194data}; - -/* char: 0xc1 */ - -static const GLubyte ch193data[] = { -0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, -0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, -0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, -0x0,0x80,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0xc0,0x0,0x0,0x70,0x0,0x0, -0x30,0x0, -}; - -static const BitmapCharRec ch193 = {17,22,0,0,17,ch193data}; - -/* char: 0xc0 */ - -static const GLubyte ch192data[] = { -0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, -0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, -0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, -0x0,0x80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0xc0,0x0,0x3,0x80,0x0,0x3, -0x0,0x0, -}; - -static const BitmapCharRec ch192 = {17,22,0,0,17,ch192data}; - -/* char: 0xbf */ - -static const GLubyte ch191data[] = { -0x3e,0x63,0xc1,0xc3,0xc3,0xe0,0x70,0x30,0x38,0x18,0x18,0x8,0x8,0x0,0x0,0xc, -0xc, -}; - -static const BitmapCharRec ch191 = {8,17,-1,5,11,ch191data}; - -/* char: 0xbe */ - -static const GLubyte ch190data[] = { -0x18,0x2,0x0,0x8,0x2,0x0,0xc,0x7f,0x80,0x4,0x22,0x0,0x6,0x32,0x0,0x3, -0x12,0x0,0x1,0xa,0x0,0x71,0x8e,0x0,0x88,0x86,0x0,0x8c,0xc2,0x0,0xc,0x60, -0x0,0x8,0x20,0x0,0x30,0x30,0x0,0x8,0x10,0x0,0x8c,0x18,0x0,0x4c,0xc,0x0, -0x38,0x4,0x0, -}; - -static const BitmapCharRec ch190 = {17,17,0,0,18,ch190data}; - -/* char: 0xbd */ - -static const GLubyte ch189data[] = { -0x30,0x7e,0x10,0x22,0x18,0x10,0x8,0x18,0xc,0x8,0x6,0x4,0x2,0x6,0xfb,0x46, -0x21,0x26,0x21,0x9c,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, -0x20,0x8, -}; - -static const BitmapCharRec ch189 = {15,17,-1,0,18,ch189data}; - -/* char: 0xbc */ - -static const GLubyte ch188data[] = { -0x30,0x4,0x10,0x4,0x18,0xff,0x8,0x44,0xc,0x64,0x6,0x24,0x2,0x14,0xfb,0x1c, -0x21,0xc,0x21,0x84,0x20,0xc0,0x20,0x40,0x20,0x60,0x20,0x20,0xa0,0x30,0x60,0x18, -0x20,0x8, -}; - -static const BitmapCharRec ch188 = {16,17,-1,0,18,ch188data}; - -/* char: 0xbb */ - -static const GLubyte ch187data[] = { -0x88,0x0,0xcc,0x0,0x66,0x0,0x33,0x0,0x19,0x80,0x19,0x80,0x33,0x0,0x66,0x0, -0xcc,0x0,0x88,0x0, -}; - -static const BitmapCharRec ch187 = {9,10,-2,-1,12,ch187data}; - -/* char: 0xba */ - -static const GLubyte ch186data[] = { -0xfc,0x0,0x78,0xcc,0xcc,0xcc,0xcc,0xcc,0x78, -}; - -static const BitmapCharRec ch186 = {6,9,-1,-8,8,ch186data}; - -/* char: 0xb9 */ - -static const GLubyte ch185data[] = { -0xf8,0x20,0x20,0x20,0x20,0x20,0x20,0xa0,0x60,0x20, -}; - -static const BitmapCharRec ch185 = {5,10,-1,-7,7,ch185data}; - -/* char: 0xb8 */ - -static const GLubyte ch184data[] = { -0x78,0xcc,0xc,0x3c,0x30,0x10, -}; - -static const BitmapCharRec ch184 = {6,6,-1,6,8,ch184data}; - -/* char: 0xb7 */ - -static const GLubyte ch183data[] = { -0xc0,0xc0, -}; - -static const BitmapCharRec ch183 = {2,2,-2,-6,6,ch183data}; - -/* char: 0xb6 */ - -static const GLubyte ch182data[] = { -0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0,0x9,0x0, -0x9,0x0,0x9,0x0,0x9,0x0,0x19,0x0,0x39,0x0,0x79,0x0,0x79,0x0,0xf9,0x0, -0xf9,0x0,0xf9,0x0,0x79,0x0,0x79,0x0,0x39,0x0,0x1f,0x80, -}; - -static const BitmapCharRec ch182 = {9,22,-1,5,11,ch182data}; - -/* char: 0xb5 */ - -static const GLubyte ch181data[] = { -0x40,0x0,0xe0,0x0,0xc0,0x0,0x40,0x0,0x40,0x0,0x5c,0xe0,0x7e,0xc0,0x71,0xc0, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0xe1,0xc0, -}; - -static const BitmapCharRec ch181 = {11,17,-1,5,13,ch181data}; - -/* char: 0xb4 */ - -static const GLubyte ch180data[] = { -0x80,0x60,0x38,0x18, -}; - -static const BitmapCharRec ch180 = {5,4,-2,-13,8,ch180data}; - -/* char: 0xb3 */ - -static const GLubyte ch179data[] = { -0x70,0x88,0x8c,0xc,0x8,0x30,0x8,0x8c,0x4c,0x38, -}; - -static const BitmapCharRec ch179 = {6,10,0,-7,7,ch179data}; - -/* char: 0xb2 */ - -static const GLubyte ch178data[] = { -0xfc,0x44,0x20,0x30,0x10,0x8,0xc,0x8c,0x4c,0x38, -}; - -static const BitmapCharRec ch178 = {6,10,0,-7,7,ch178data}; - -/* char: 0xb1 */ - -static const GLubyte ch177data[] = { -0xff,0xf0,0xff,0xf0,0x0,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, -0xff,0xf0,0xff,0xf0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch177 = {12,15,-1,0,14,ch177data}; - -/* char: 0xb0 */ - -static const GLubyte ch176data[] = { -0x38,0x44,0x82,0x82,0x82,0x44,0x38, -}; - -static const BitmapCharRec ch176 = {7,7,-1,-10,9,ch176data}; - -/* char: 0xaf */ - -static const GLubyte ch175data[] = { -0xfc,0xfc, -}; - -static const BitmapCharRec ch175 = {6,2,-1,-14,8,ch175data}; - -/* char: 0xae */ - -static const GLubyte ch174data[] = { -0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x60,0x3,0x0,0x47,0x19,0x0,0xc2, -0x31,0x80,0x82,0x20,0x80,0x82,0x40,0x80,0x83,0xe0,0x80,0x82,0x30,0x80,0x82,0x10, -0x80,0xc2,0x11,0x80,0x42,0x31,0x0,0x67,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, -0x7,0xf0,0x0, -}; - -static const BitmapCharRec ch174 = {17,17,-1,0,19,ch174data}; - -/* char: 0xad */ - -static const GLubyte ch173data[] = { -0xfe,0xfe, -}; - -static const BitmapCharRec ch173 = {7,2,-1,-5,9,ch173data}; - -/* char: 0xac */ - -static const GLubyte ch172data[] = { -0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0xff,0xf0,0xff,0xf0, -}; - -static const BitmapCharRec ch172 = {12,7,-1,-3,14,ch172data}; - -/* char: 0xab */ - -static const GLubyte ch171data[] = { -0x8,0x80,0x19,0x80,0x33,0x0,0x66,0x0,0xcc,0x0,0xcc,0x0,0x66,0x0,0x33,0x0, -0x19,0x80,0x8,0x80, -}; - -static const BitmapCharRec ch171 = {9,10,-2,-1,13,ch171data}; - -/* char: 0xaa */ - -static const GLubyte ch170data[] = { -0x7e,0x0,0x76,0xcc,0xcc,0x7c,0xc,0xcc,0x78, -}; - -static const BitmapCharRec ch170 = {7,9,0,-8,8,ch170data}; - -/* char: 0xa9 */ - -static const GLubyte ch169data[] = { -0x7,0xf0,0x0,0x1c,0x1c,0x0,0x30,0x6,0x0,0x61,0xc3,0x0,0x47,0x71,0x0,0xc4, -0x19,0x80,0x8c,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x88,0x0,0x80,0x8c,0x0, -0x80,0xc4,0x19,0x80,0x47,0x31,0x0,0x61,0xe3,0x0,0x30,0x6,0x0,0x1c,0x1c,0x0, -0x7,0xf0,0x0, -}; - -static const BitmapCharRec ch169 = {17,17,-1,0,19,ch169data}; - -/* char: 0xa8 */ - -static const GLubyte ch168data[] = { -0xcc,0xcc, -}; - -static const BitmapCharRec ch168 = {6,2,-1,-14,8,ch168data}; - -/* char: 0xa7 */ - -static const GLubyte ch167data[] = { -0x38,0x64,0x62,0x6,0xe,0x1c,0x38,0x74,0xe2,0xc3,0x83,0x87,0x4e,0x3c,0x38,0x70, -0x60,0x46,0x26,0x1c, -}; - -static const BitmapCharRec ch167 = {8,20,-2,2,12,ch167data}; - -/* char: 0xa6 */ - -static const GLubyte ch166data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0, -}; - -static const BitmapCharRec ch166 = {2,17,-2,0,6,ch166data}; - -/* char: 0xa5 */ - -static const GLubyte ch165data[] = { -0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x1f,0xe0,0x3,0x0,0x1f,0xe0, -0x3,0x0,0x7,0x80,0xc,0x80,0xc,0xc0,0x18,0x40,0x18,0x60,0x30,0x20,0x70,0x30, -0xf8,0x7c, -}; - -static const BitmapCharRec ch165 = {14,17,0,0,14,ch165data}; - -/* char: 0xa4 */ - -static const GLubyte ch164data[] = { -0xc0,0x60,0xee,0xe0,0x7f,0xc0,0x31,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x31,0x80,0x7f,0xc0,0xee,0xe0,0xc0,0x60, -}; - -static const BitmapCharRec ch164 = {11,12,-1,-3,13,ch164data}; - -/* char: 0xa3 */ - -static const GLubyte ch163data[] = { -0xe7,0x80,0xbe,0xc0,0x78,0x40,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, -0x30,0x0,0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x31,0x80,0x19,0x80, -0xf,0x0, -}; - -static const BitmapCharRec ch163 = {10,17,-1,0,12,ch163data}; - -/* char: 0xa2 */ - -static const GLubyte ch162data[] = { -0x40,0x0,0x40,0x0,0x3e,0x0,0x7f,0x0,0x70,0x80,0xd0,0x0,0xc8,0x0,0xc8,0x0, -0xc8,0x0,0xc4,0x0,0xc4,0x0,0x43,0x80,0x63,0x80,0x1f,0x0,0x1,0x0,0x1,0x0, -}; - -static const BitmapCharRec ch162 = {9,16,-1,2,12,ch162data}; - -/* char: 0xa1 */ - -static const GLubyte ch161data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x0,0x0,0x0,0xc0, -0xc0, -}; - -static const BitmapCharRec ch161 = {2,17,-4,5,8,ch161data}; - -/* char: 0xa0 */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch160data[] = { 0x0 }; -static const BitmapCharRec ch160 = {1,1,0,0,6,ch160data}; -#else -static const BitmapCharRec ch160 = {0,0,0,0,6,0}; -#endif - -/* char: 0x7e '~' */ - -static const GLubyte ch126data[] = { -0x83,0x80,0xc7,0xc0,0x7c,0x60,0x38,0x20, -}; - -static const BitmapCharRec ch126 = {11,4,-1,-5,13,ch126data}; - -/* char: 0x7d '}' */ - -static const GLubyte ch125data[] = { -0xe0,0x30,0x18,0x18,0x18,0x18,0x18,0x18,0x8,0xc,0x4,0x3,0x4,0xc,0x8,0x18, -0x18,0x18,0x18,0x18,0x30,0xe0, -}; - -static const BitmapCharRec ch125 = {8,22,-1,5,10,ch125data}; - -/* char: 0x7c '|' */ - -static const GLubyte ch124data[] = { -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0, -}; - -static const BitmapCharRec ch124 = {2,17,-2,0,6,ch124data}; - -/* char: 0x7b '{' */ - -static const GLubyte ch123data[] = { -0x7,0xc,0x18,0x18,0x18,0x18,0x18,0x18,0x10,0x30,0x20,0xc0,0x20,0x30,0x10,0x18, -0x18,0x18,0x18,0x18,0xc,0x7, -}; - -static const BitmapCharRec ch123 = {8,22,-1,5,10,ch123data}; - -/* char: 0x7a 'z' */ - -static const GLubyte ch122data[] = { -0xff,0xc3,0x61,0x70,0x30,0x38,0x18,0x1c,0xe,0x86,0xc3,0xff, -}; - -static const BitmapCharRec ch122 = {8,12,-1,0,10,ch122data}; - -/* char: 0x79 'y' */ - -static const GLubyte ch121data[] = { -0xe0,0x0,0xf0,0x0,0x18,0x0,0x8,0x0,0xc,0x0,0x4,0x0,0xe,0x0,0xe,0x0, -0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80,0x30,0x80,0x60,0x80,0x60,0xc0, -0xf1,0xe0, -}; - -static const BitmapCharRec ch121 = {11,17,0,5,11,ch121data}; - -/* char: 0x78 'x' */ - -static const GLubyte ch120data[] = { -0xf1,0xe0,0x60,0xc0,0x21,0x80,0x33,0x80,0x1b,0x0,0xe,0x0,0xc,0x0,0x1a,0x0, -0x39,0x0,0x31,0x80,0x60,0xc0,0xf1,0xe0, -}; - -static const BitmapCharRec ch120 = {11,12,-1,0,13,ch120data}; - -/* char: 0x77 'w' */ - -static const GLubyte ch119data[] = { -0x4,0x10,0x0,0xe,0x38,0x0,0xe,0x38,0x0,0x1a,0x28,0x0,0x1a,0x64,0x0,0x19, -0x64,0x0,0x31,0x64,0x0,0x30,0xc2,0x0,0x30,0xc2,0x0,0x60,0xc2,0x0,0x60,0xc3, -0x0,0xf1,0xe7,0x80, -}; - -static const BitmapCharRec ch119 = {17,12,0,0,17,ch119data}; - -/* char: 0x76 'v' */ - -static const GLubyte ch118data[] = { -0x4,0x0,0xe,0x0,0xe,0x0,0x1a,0x0,0x19,0x0,0x19,0x0,0x31,0x0,0x30,0x80, -0x30,0x80,0x60,0x80,0x60,0xc0,0xf1,0xe0, -}; - -static const BitmapCharRec ch118 = {11,12,0,0,11,ch118data}; - -/* char: 0x75 'u' */ - -static const GLubyte ch117data[] = { -0x1c,0xe0,0x3e,0xc0,0x71,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0xe1,0xc0, -}; - -static const BitmapCharRec ch117 = {11,12,-1,0,13,ch117data}; - -/* char: 0x74 't' */ - -static const GLubyte ch116data[] = { -0x1c,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x70,0x30,0x10, -}; - -static const BitmapCharRec ch116 = {7,15,0,0,7,ch116data}; - -/* char: 0x73 's' */ - -static const GLubyte ch115data[] = { -0xf8,0xc6,0x83,0x3,0x7,0x1e,0x7c,0x70,0xe0,0xc2,0x66,0x3e, -}; - -static const BitmapCharRec ch115 = {8,12,-1,0,10,ch115data}; - -/* char: 0x72 'r' */ - -static const GLubyte ch114data[] = { -0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x76,0x6e,0xe6, -}; - -static const BitmapCharRec ch114 = {7,12,-1,0,8,ch114data}; - -/* char: 0x71 'q' */ - -static const GLubyte ch113data[] = { -0x3,0xc0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1d,0x80,0x73,0x80,0x61,0x80, -0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0x61,0x80,0x73,0x80, -0x1d,0x80, -}; - -static const BitmapCharRec ch113 = {10,17,-1,5,12,ch113data}; - -/* char: 0x70 'p' */ - -static const GLubyte ch112data[] = { -0xf0,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x6e,0x0,0x73,0x80,0x61,0x80, -0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x61,0x80,0x73,0x80, -0xee,0x0, -}; - -static const BitmapCharRec ch112 = {10,17,-1,5,12,ch112data}; - -/* char: 0x6f 'o' */ - -static const GLubyte ch111data[] = { -0x1e,0x0,0x73,0x80,0x61,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0x61,0x80,0x73,0x80,0x1e,0x0, -}; - -static const BitmapCharRec ch111 = {10,12,-1,0,12,ch111data}; - -/* char: 0x6e 'n' */ - -static const GLubyte ch110data[] = { -0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x71,0xc0,0x6f,0x80,0xe7,0x0, -}; - -static const BitmapCharRec ch110 = {11,12,-1,0,13,ch110data}; - -/* char: 0x6d 'm' */ - -static const GLubyte ch109data[] = { -0xf1,0xe3,0xc0,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60, -0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x60,0xc1,0x80,0x71,0xe3,0x80,0x6f,0x9f, -0x0,0xe7,0xe,0x0, -}; - -static const BitmapCharRec ch109 = {18,12,-1,0,20,ch109data}; - -/* char: 0x6c 'l' */ - -static const GLubyte ch108data[] = { -0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60, -0xe0, -}; - -static const BitmapCharRec ch108 = {4,17,-1,0,6,ch108data}; - -/* char: 0x6b 'k' */ - -static const GLubyte ch107data[] = { -0xf3,0xe0,0x61,0xc0,0x63,0x80,0x67,0x0,0x6e,0x0,0x6c,0x0,0x78,0x0,0x68,0x0, -0x64,0x0,0x66,0x0,0x63,0x0,0x67,0xc0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, -0xe0,0x0, -}; - -static const BitmapCharRec ch107 = {11,17,-1,0,12,ch107data}; - -/* char: 0x6a 'j' */ - -static const GLubyte ch106data[] = { -0xc0,0xe0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0x70,0x0,0x0,0x0,0x30,0x30, -}; - -static const BitmapCharRec ch106 = {4,22,0,5,6,ch106data}; - -/* char: 0x69 'i' */ - -static const GLubyte ch105data[] = { -0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0x0,0x0,0x0,0x60, -0x60, -}; - -static const BitmapCharRec ch105 = {4,17,-1,0,6,ch105data}; - -/* char: 0x68 'h' */ - -static const GLubyte ch104data[] = { -0xf1,0xe0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x71,0xc0,0x6f,0x80,0x67,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, -0xe0,0x0, -}; - -static const BitmapCharRec ch104 = {11,17,-1,0,13,ch104data}; - -/* char: 0x67 'g' */ - -static const GLubyte ch103data[] = { -0x3f,0x0,0xf1,0xc0,0xc0,0x60,0xc0,0x20,0x60,0x60,0x3f,0xc0,0x7f,0x0,0x60,0x0, -0x30,0x0,0x3e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, -0x1f,0xc0, -}; - -static const BitmapCharRec ch103 = {11,17,-1,5,12,ch103data}; - -/* char: 0x66 'f' */ - -static const GLubyte ch102data[] = { -0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xfe,0x30,0x30,0x30,0x16, -0xe, -}; - -static const BitmapCharRec ch102 = {7,17,0,0,7,ch102data}; - -/* char: 0x65 'e' */ - -static const GLubyte ch101data[] = { -0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xff,0x80, -0xc1,0x80,0x41,0x80,0x63,0x0,0x1e,0x0, -}; - -static const BitmapCharRec ch101 = {9,12,-1,0,11,ch101data}; - -/* char: 0x64 'd' */ - -static const GLubyte ch100data[] = { -0x1e,0xc0,0x73,0x80,0x61,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80,0xc1,0x80, -0xc1,0x80,0x61,0x80,0x73,0x80,0x1d,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80, -0x3,0x80, -}; - -static const BitmapCharRec ch100 = {10,17,-1,0,12,ch100data}; - -/* char: 0x63 'c' */ - -static const GLubyte ch99data[] = { -0x1e,0x0,0x7f,0x0,0x70,0x80,0xe0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, -0xc0,0x0,0x41,0x80,0x63,0x80,0x1f,0x0, -}; - -static const BitmapCharRec ch99 = {9,12,-1,0,11,ch99data}; - -/* char: 0x62 'b' */ - -static const GLubyte ch98data[] = { -0x5e,0x0,0x73,0x80,0x61,0x80,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0,0x60,0xc0, -0x60,0xc0,0x61,0x80,0x73,0x80,0x6e,0x0,0x60,0x0,0x60,0x0,0x60,0x0,0x60,0x0, -0xe0,0x0, -}; - -static const BitmapCharRec ch98 = {10,17,-1,0,12,ch98data}; - -/* char: 0x61 'a' */ - -static const GLubyte ch97data[] = { -0x71,0x80,0xfb,0x0,0xc7,0x0,0xc3,0x0,0xc3,0x0,0x63,0x0,0x3b,0x0,0xf,0x0, -0x3,0x0,0x63,0x0,0x67,0x0,0x3e,0x0, -}; - -static const BitmapCharRec ch97 = {9,12,-1,0,11,ch97data}; - -/* char: 0x60 '`' */ - -static const GLubyte ch96data[] = { -0x60,0xe0,0x80,0xc0,0x60, -}; - -static const BitmapCharRec ch96 = {3,5,-2,-12,7,ch96data}; - -/* char: 0x5f '_' */ - -static const GLubyte ch95data[] = { -0xff,0xf8,0xff,0xf8, -}; - -static const BitmapCharRec ch95 = {13,2,0,5,13,ch95data}; - -/* char: 0x5e '^' */ - -static const GLubyte ch94data[] = { -0x80,0x80,0xc1,0x80,0x41,0x0,0x63,0x0,0x22,0x0,0x36,0x0,0x14,0x0,0x1c,0x0, -0x8,0x0, -}; - -static const BitmapCharRec ch94 = {9,9,-1,-8,11,ch94data}; - -/* char: 0x5d ']' */ - -static const GLubyte ch93data[] = { -0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, -0x18,0x18,0x18,0x18,0xf8, -}; - -static const BitmapCharRec ch93 = {5,21,-1,4,8,ch93data}; - -/* char: 0x5c '\' */ - -static const GLubyte ch92data[] = { -0x6,0x6,0x4,0xc,0xc,0x8,0x18,0x18,0x10,0x30,0x30,0x20,0x60,0x60,0x40,0xc0, -0xc0, -}; - -static const BitmapCharRec ch92 = {7,17,0,0,7,ch92data}; - -/* char: 0x5b '[' */ - -static const GLubyte ch91data[] = { -0xf8,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0xc0,0xc0,0xf8, -}; - -static const BitmapCharRec ch91 = {5,21,-2,4,8,ch91data}; - -/* char: 0x5a 'Z' */ - -static const GLubyte ch90data[] = { -0xff,0xf8,0xe0,0x18,0x70,0x8,0x30,0x8,0x38,0x0,0x18,0x0,0x1c,0x0,0xe,0x0, -0x6,0x0,0x7,0x0,0x3,0x0,0x3,0x80,0x1,0xc0,0x80,0xc0,0x80,0xe0,0xc0,0x70, -0xff,0xf0, -}; - -static const BitmapCharRec ch90 = {13,17,-1,0,15,ch90data}; - -/* char: 0x59 'Y' */ - -static const GLubyte ch89data[] = { -0x7,0xe0,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0xc0, -0x3,0x40,0x6,0x60,0x6,0x20,0xc,0x30,0x1c,0x10,0x18,0x18,0x38,0x8,0x30,0xc, -0xfc,0x3f, -}; - -static const BitmapCharRec ch89 = {16,17,0,0,16,ch89data}; - -/* char: 0x58 'X' */ - -static const GLubyte ch88data[] = { -0xfc,0xf,0xc0,0x30,0x3,0x80,0x18,0x7,0x0,0x8,0xe,0x0,0x4,0xc,0x0,0x6, -0x18,0x0,0x2,0x38,0x0,0x1,0x70,0x0,0x0,0xe0,0x0,0x0,0xc0,0x0,0x1,0xc0, -0x0,0x3,0xa0,0x0,0x3,0x10,0x0,0x6,0x8,0x0,0xe,0xc,0x0,0x1c,0x6,0x0, -0x7e,0xf,0x80, -}; - -static const BitmapCharRec ch88 = {18,17,0,0,18,ch88data}; - -/* char: 0x57 'W' */ - -static const GLubyte ch87data[] = { -0x1,0x83,0x0,0x1,0x83,0x0,0x1,0x83,0x80,0x3,0x87,0x80,0x3,0x46,0x80,0x3, -0x46,0xc0,0x6,0x46,0x40,0x6,0x4c,0x40,0x6,0x4c,0x60,0xc,0x2c,0x60,0xc,0x2c, -0x20,0x18,0x2c,0x20,0x18,0x18,0x30,0x18,0x18,0x10,0x30,0x18,0x10,0x30,0x18,0x18, -0xfc,0x7e,0x7e, -}; - -static const BitmapCharRec ch87 = {23,17,0,0,23,ch87data}; - -/* char: 0x56 'V' */ - -static const GLubyte ch86data[] = { -0x1,0x80,0x0,0x1,0x80,0x0,0x1,0x80,0x0,0x3,0xc0,0x0,0x3,0x40,0x0,0x3, -0x60,0x0,0x6,0x20,0x0,0x6,0x20,0x0,0x6,0x30,0x0,0xc,0x10,0x0,0xc,0x18, -0x0,0x18,0x8,0x0,0x18,0x8,0x0,0x18,0xc,0x0,0x30,0x4,0x0,0x30,0x6,0x0, -0xfc,0x1f,0x80, -}; - -static const BitmapCharRec ch86 = {17,17,0,0,17,ch86data}; - -/* char: 0x55 'U' */ - -static const GLubyte ch85data[] = { -0x7,0xe0,0x1c,0x30,0x18,0x8,0x30,0x8,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4,0x30,0x4, -0xfc,0x1f, -}; - -static const BitmapCharRec ch85 = {16,17,-1,0,18,ch85data}; - -/* char: 0x54 'T' */ - -static const GLubyte ch84data[] = { -0xf,0xc0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0, -0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0x83,0x4,0x83,0x4,0xc3,0xc, -0xff,0xfc, -}; - -static const BitmapCharRec ch84 = {14,17,-1,0,16,ch84data}; - -/* char: 0x53 'S' */ - -static const GLubyte ch83data[] = { -0x9e,0x0,0xf1,0x80,0xc0,0xc0,0x80,0x60,0x80,0x60,0x0,0x60,0x0,0xe0,0x3,0xc0, -0xf,0x80,0x1e,0x0,0x78,0x0,0xe0,0x0,0xc0,0x40,0xc0,0x40,0xc0,0xc0,0x63,0xc0, -0x1e,0x40, -}; - -static const BitmapCharRec ch83 = {11,17,-1,0,13,ch83data}; - -/* char: 0x52 'R' */ - -static const GLubyte ch82data[] = { -0xfc,0x1e,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0x60,0x30,0xc0,0x31,0xc0,0x33,0x80, -0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x38,0x30,0x18,0x30,0x38,0x30,0x30,0x30,0x70, -0xff,0xc0, -}; - -static const BitmapCharRec ch82 = {15,17,-1,0,16,ch82data}; - -/* char: 0x51 'Q' */ - -static const GLubyte ch81data[] = { -0x0,0xf,0x0,0x38,0x0,0x70,0x0,0xe0,0x1,0xc0,0x7,0xe0,0x1c,0x38,0x38,0x1c, -0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3, -0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38,0x7,0xe0, -}; - -static const BitmapCharRec ch81 = {16,22,-1,5,18,ch81data}; - -/* char: 0x50 'P' */ - -static const GLubyte ch80data[] = { -0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, -0x3f,0xc0,0x30,0x70,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, -0xff,0xc0, -}; - -static const BitmapCharRec ch80 = {13,17,-1,0,15,ch80data}; - -/* char: 0x4f 'O' */ - -static const GLubyte ch79data[] = { -0x7,0xe0,0x1c,0x38,0x38,0x1c,0x60,0x6,0x60,0x6,0xc0,0x3,0xc0,0x3,0xc0,0x3, -0xc0,0x3,0xc0,0x3,0xc0,0x3,0xc0,0x3,0x60,0x6,0x60,0x6,0x38,0x1c,0x1c,0x38, -0x7,0xe0, -}; - -static const BitmapCharRec ch79 = {16,17,-1,0,18,ch79data}; - -/* char: 0x4e 'N' */ - -static const GLubyte ch78data[] = { -0xf8,0xc,0x20,0x1c,0x20,0x1c,0x20,0x34,0x20,0x64,0x20,0x64,0x20,0xc4,0x21,0x84, -0x21,0x84,0x23,0x4,0x26,0x4,0x26,0x4,0x2c,0x4,0x38,0x4,0x38,0x4,0x30,0x4, -0xf0,0x1f, -}; - -static const BitmapCharRec ch78 = {16,17,-1,0,18,ch78data}; - -/* char: 0x4d 'M' */ - -static const GLubyte ch77data[] = { -0xf8,0x21,0xf8,0x20,0x60,0x60,0x20,0x60,0x60,0x20,0xd0,0x60,0x20,0xd0,0x60,0x21, -0x88,0x60,0x21,0x88,0x60,0x23,0x8,0x60,0x23,0x4,0x60,0x26,0x4,0x60,0x26,0x2, -0x60,0x2c,0x2,0x60,0x2c,0x2,0x60,0x38,0x1,0x60,0x38,0x1,0x60,0x30,0x0,0xe0, -0xf0,0x0,0xf8, -}; - -static const BitmapCharRec ch77 = {21,17,-1,0,22,ch77data}; - -/* char: 0x4c 'L' */ - -static const GLubyte ch76data[] = { -0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, -0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0, -0xfc,0x0, -}; - -static const BitmapCharRec ch76 = {13,17,-1,0,14,ch76data}; - -/* char: 0x4b 'K' */ - -static const GLubyte ch75data[] = { -0xfc,0x1f,0x30,0xe,0x30,0x1c,0x30,0x38,0x30,0x70,0x30,0xe0,0x31,0xc0,0x33,0x80, -0x3f,0x0,0x3e,0x0,0x33,0x0,0x31,0x80,0x30,0xc0,0x30,0x60,0x30,0x30,0x30,0x18, -0xfc,0x7e, -}; - -static const BitmapCharRec ch75 = {16,17,-1,0,17,ch75data}; - -/* char: 0x4a 'J' */ - -static const GLubyte ch74data[] = { -0x78,0x0,0xcc,0x0,0xc6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, -0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, -0x1f,0x80, -}; - -static const BitmapCharRec ch74 = {9,17,-1,0,11,ch74data}; - -/* char: 0x49 'I' */ - -static const GLubyte ch73data[] = { -0xfc,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30, -0xfc, -}; - -static const BitmapCharRec ch73 = {6,17,-1,0,8,ch73data}; - -/* char: 0x48 'H' */ - -static const GLubyte ch72data[] = { -0xfc,0x1f,0x80,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30, -0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x3f,0xfe,0x0,0x30,0x6,0x0,0x30,0x6, -0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0,0x30,0x6,0x0, -0xfc,0x1f,0x80, -}; - -static const BitmapCharRec ch72 = {17,17,-1,0,19,ch72data}; - -/* char: 0x47 'G' */ - -static const GLubyte ch71data[] = { -0x7,0xe0,0x1e,0x38,0x38,0x1c,0x60,0xc,0x60,0xc,0xc0,0xc,0xc0,0xc,0xc0,0x3f, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, -0x7,0xe4, -}; - -static const BitmapCharRec ch71 = {16,17,-1,0,18,ch71data}; - -/* char: 0x46 'F' */ - -static const GLubyte ch70data[] = { -0xfc,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x0,0x30,0x20,0x30,0x20, -0x3f,0xe0,0x30,0x20,0x30,0x20,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, -0xff,0xf0, -}; - -static const BitmapCharRec ch70 = {12,17,-1,0,14,ch70data}; - -/* char: 0x45 'E' */ - -static const GLubyte ch69data[] = { -0xff,0xf8,0x30,0x18,0x30,0x8,0x30,0x8,0x30,0x0,0x30,0x0,0x30,0x40,0x30,0x40, -0x3f,0xc0,0x30,0x40,0x30,0x40,0x30,0x0,0x30,0x0,0x30,0x10,0x30,0x10,0x30,0x30, -0xff,0xf0, -}; - -static const BitmapCharRec ch69 = {13,17,-1,0,15,ch69data}; - -/* char: 0x44 'D' */ - -static const GLubyte ch68data[] = { -0xff,0xc0,0x30,0x70,0x30,0x38,0x30,0xc,0x30,0xc,0x30,0x6,0x30,0x6,0x30,0x6, -0x30,0x6,0x30,0x6,0x30,0x6,0x30,0x6,0x30,0xc,0x30,0xc,0x30,0x38,0x30,0x70, -0xff,0xc0, -}; - -static const BitmapCharRec ch68 = {15,17,-1,0,17,ch68data}; - -/* char: 0x43 'C' */ - -static const GLubyte ch67data[] = { -0x7,0xe0,0x1e,0x38,0x38,0x8,0x60,0x4,0x60,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0, -0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0x60,0x4,0x60,0x4,0x38,0xc,0x1c,0x3c, -0x7,0xe4, -}; - -static const BitmapCharRec ch67 = {14,17,-1,0,16,ch67data}; - -/* char: 0x42 'B' */ - -static const GLubyte ch66data[] = { -0xff,0xe0,0x30,0x78,0x30,0x18,0x30,0xc,0x30,0xc,0x30,0xc,0x30,0x18,0x30,0x38, -0x3f,0xe0,0x30,0x40,0x30,0x30,0x30,0x18,0x30,0x18,0x30,0x18,0x30,0x30,0x30,0x70, -0xff,0xc0, -}; - -static const BitmapCharRec ch66 = {14,17,-1,0,16,ch66data}; - -/* char: 0x41 'A' */ - -static const GLubyte ch65data[] = { -0xfc,0x1f,0x80,0x30,0x6,0x0,0x10,0x6,0x0,0x10,0xc,0x0,0x18,0xc,0x0,0x8, -0xc,0x0,0xf,0xf8,0x0,0xc,0x18,0x0,0x4,0x18,0x0,0x4,0x30,0x0,0x6,0x30, -0x0,0x2,0x30,0x0,0x2,0x60,0x0,0x1,0x60,0x0,0x1,0xc0,0x0,0x1,0xc0,0x0, -0x0,0x80,0x0, -}; - -static const BitmapCharRec ch65 = {17,17,0,0,17,ch65data}; - -/* char: 0x40 '@' */ - -static const GLubyte ch64data[] = { -0x3,0xf0,0x0,0xe,0xc,0x0,0x18,0x0,0x0,0x30,0x0,0x0,0x61,0xde,0x0,0x63, -0x7b,0x0,0xc6,0x39,0x80,0xc6,0x18,0x80,0xc6,0x18,0xc0,0xc6,0x18,0x40,0xc6,0xc, -0x40,0xc3,0xc,0x40,0xc3,0x8c,0x40,0xe1,0xfc,0x40,0x60,0xec,0xc0,0x70,0x0,0x80, -0x38,0x1,0x80,0x1c,0x3,0x0,0xf,0xe,0x0,0x3,0xf8,0x0, -}; - -static const BitmapCharRec ch64 = {18,20,-2,3,22,ch64data}; - -/* char: 0x3f '?' */ - -static const GLubyte ch63data[] = { -0x30,0x30,0x0,0x0,0x10,0x10,0x10,0x18,0x18,0xc,0xe,0x7,0xc3,0xc3,0x83,0xc6, -0x7c, -}; - -static const BitmapCharRec ch63 = {8,17,-2,0,11,ch63data}; - -/* char: 0x3e '>' */ - -static const GLubyte ch62data[] = { -0xc0,0x0,0x70,0x0,0x1c,0x0,0x7,0x0,0x1,0xc0,0x0,0x60,0x1,0xc0,0x7,0x0, -0x1c,0x0,0x70,0x0,0xc0,0x0, -}; - -static const BitmapCharRec ch62 = {11,11,-1,-1,13,ch62data}; - -/* char: 0x3d '=' */ - -static const GLubyte ch61data[] = { -0xff,0xf0,0xff,0xf0,0x0,0x0,0x0,0x0,0xff,0xf0,0xff,0xf0, -}; - -static const BitmapCharRec ch61 = {12,6,-1,-4,14,ch61data}; - -/* char: 0x3c '<' */ - -static const GLubyte ch60data[] = { -0x0,0x60,0x1,0xc0,0x7,0x0,0x1c,0x0,0x70,0x0,0xc0,0x0,0x70,0x0,0x1c,0x0, -0x7,0x0,0x1,0xc0,0x0,0x60, -}; - -static const BitmapCharRec ch60 = {11,11,-1,-1,13,ch60data}; - -/* char: 0x3b ';' */ - -static const GLubyte ch59data[] = { -0xc0,0x60,0x20,0xe0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch59 = {3,14,-2,3,7,ch59data}; - -/* char: 0x3a ':' */ - -static const GLubyte ch58data[] = { -0xc0,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xc0,0xc0, -}; - -static const BitmapCharRec ch58 = {2,11,-2,0,6,ch58data}; - -/* char: 0x39 '9' */ - -static const GLubyte ch57data[] = { -0xf0,0x0,0x1c,0x0,0x6,0x0,0x3,0x0,0x3,0x80,0x1,0x80,0x1d,0x80,0x73,0xc0, -0x61,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc1,0xc0,0x61,0x80,0x77,0x80, -0x1e,0x0, -}; - -static const BitmapCharRec ch57 = {10,17,-1,0,12,ch57data}; - -/* char: 0x38 '8' */ - -static const GLubyte ch56data[] = { -0x1e,0x0,0x73,0x80,0xe1,0x80,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x41,0xc0,0x61,0x80, -0x37,0x0,0x1e,0x0,0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0x61,0x80,0x33,0x0, -0x1e,0x0, -}; - -static const BitmapCharRec ch56 = {10,17,-1,0,12,ch56data}; - -/* char: 0x37 '7' */ - -static const GLubyte ch55data[] = { -0x18,0x0,0x18,0x0,0xc,0x0,0xc,0x0,0xc,0x0,0x4,0x0,0x6,0x0,0x6,0x0, -0x2,0x0,0x3,0x0,0x3,0x0,0x1,0x0,0x1,0x80,0x81,0x80,0xc0,0xc0,0xff,0xc0, -0x7f,0xc0, -}; - -static const BitmapCharRec ch55 = {10,17,-1,0,12,ch55data}; - -/* char: 0x36 '6' */ - -static const GLubyte ch54data[] = { -0x1e,0x0,0x7b,0x80,0x61,0x80,0xe0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc1,0x80,0xf3,0x80,0xee,0x0,0x60,0x0,0x70,0x0,0x30,0x0,0x18,0x0,0xe,0x0, -0x3,0xc0, -}; - -static const BitmapCharRec ch54 = {10,17,-1,0,12,ch54data}; - -/* char: 0x35 '5' */ - -static const GLubyte ch53data[] = { -0x7e,0x0,0xe3,0x80,0xc1,0x80,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x0,0xc0,0x1,0xc0, -0x3,0x80,0xf,0x80,0x7e,0x0,0x78,0x0,0x60,0x0,0x20,0x0,0x20,0x0,0x1f,0x80, -0x1f,0xc0, -}; - -static const BitmapCharRec ch53 = {10,17,-1,0,12,ch53data}; - -/* char: 0x34 '4' */ - -static const GLubyte ch52data[] = { -0x3,0x0,0x3,0x0,0x3,0x0,0x3,0x0,0xff,0xc0,0xff,0xc0,0xc3,0x0,0x43,0x0, -0x63,0x0,0x23,0x0,0x33,0x0,0x13,0x0,0x1b,0x0,0xb,0x0,0x7,0x0,0x7,0x0, -0x3,0x0, -}; - -static const BitmapCharRec ch52 = {10,17,-1,0,12,ch52data}; - -/* char: 0x33 '3' */ - -static const GLubyte ch51data[] = { -0x78,0x0,0xe6,0x0,0xc3,0x0,0x1,0x0,0x1,0x80,0x1,0x80,0x1,0x80,0x3,0x80, -0x7,0x0,0x1e,0x0,0xc,0x0,0x6,0x0,0x83,0x0,0x83,0x0,0x47,0x0,0x7e,0x0, -0x1c,0x0, -}; - -static const BitmapCharRec ch51 = {9,17,-1,0,12,ch51data}; - -/* char: 0x32 '2' */ - -static const GLubyte ch50data[] = { -0xff,0x80,0xff,0xc0,0x60,0x40,0x30,0x0,0x18,0x0,0xc,0x0,0x4,0x0,0x6,0x0, -0x3,0x0,0x3,0x0,0x1,0x80,0x1,0x80,0x81,0x80,0x81,0x80,0x43,0x80,0x7f,0x0, -0x1c,0x0, -}; - -static const BitmapCharRec ch50 = {10,17,-1,0,12,ch50data}; - -/* char: 0x31 '1' */ - -static const GLubyte ch49data[] = { -0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x78,0x18, -0x8, -}; - -static const BitmapCharRec ch49 = {8,17,-2,0,12,ch49data}; - -/* char: 0x30 '0' */ - -static const GLubyte ch48data[] = { -0x1e,0x0,0x33,0x0,0x61,0x80,0x61,0x80,0xe1,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x61,0x80,0x61,0x80,0x33,0x0, -0x1e,0x0, -}; - -static const BitmapCharRec ch48 = {10,17,-1,0,12,ch48data}; - -/* char: 0x2f '/' */ - -static const GLubyte ch47data[] = { -0xc0,0xc0,0xc0,0x60,0x60,0x20,0x30,0x30,0x10,0x18,0x18,0x8,0xc,0xc,0x4,0x6, -0x6,0x3,0x3,0x3, -}; - -static const BitmapCharRec ch47 = {8,20,1,3,7,ch47data}; - -/* char: 0x2e '.' */ - -static const GLubyte ch46data[] = { -0xc0,0xc0, -}; - -static const BitmapCharRec ch46 = {2,2,-2,0,6,ch46data}; - -/* char: 0x2d '-' */ - -static const GLubyte ch45data[] = { -0xff,0xf0,0xff,0xf0, -}; - -static const BitmapCharRec ch45 = {12,2,-1,-6,14,ch45data}; - -/* char: 0x2c ',' */ - -static const GLubyte ch44data[] = { -0xc0,0x60,0x20,0xe0,0xc0, -}; - -static const BitmapCharRec ch44 = {3,5,-2,3,7,ch44data}; - -/* char: 0x2b '+' */ - -static const GLubyte ch43data[] = { -0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0,0xff,0xf0,0xff,0xf0,0x6,0x0, -0x6,0x0,0x6,0x0,0x6,0x0,0x6,0x0, -}; - -static const BitmapCharRec ch43 = {12,12,-1,-1,14,ch43data}; - -/* char: 0x2a '*' */ - -static const GLubyte ch42data[] = { -0x8,0x0,0x1c,0x0,0xc9,0x80,0xeb,0x80,0x1c,0x0,0xeb,0x80,0xc9,0x80,0x1c,0x0, -0x8,0x0, -}; - -static const BitmapCharRec ch42 = {9,9,-2,-8,12,ch42data}; - -/* char: 0x29 ')' */ - -static const GLubyte ch41data[] = { -0x80,0x40,0x20,0x30,0x10,0x18,0x18,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0xc,0x18, -0x18,0x10,0x30,0x20,0x40,0x80, -}; - -static const BitmapCharRec ch41 = {6,22,-1,5,8,ch41data}; - -/* char: 0x28 '(' */ - -static const GLubyte ch40data[] = { -0x4,0x8,0x10,0x30,0x20,0x60,0x60,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x60, -0x60,0x20,0x30,0x10,0x8,0x4, -}; - -static const BitmapCharRec ch40 = {6,22,-1,5,8,ch40data}; - -/* char: 0x27 ''' */ - -static const GLubyte ch39data[] = { -0xc0,0x60,0x20,0xe0,0xc0, -}; - -static const BitmapCharRec ch39 = {3,5,-3,-12,8,ch39data}; - -/* char: 0x26 '&' */ - -static const GLubyte ch38data[] = { -0x3c,0x3c,0x7f,0x7e,0xe1,0xe1,0xc0,0xc0,0xc1,0xc0,0xc1,0xa0,0x63,0x20,0x37,0x10, -0x1e,0x18,0xe,0x3e,0xf,0x0,0x1d,0x80,0x18,0xc0,0x18,0x40,0x18,0x40,0xc,0xc0, -0x7,0x80, -}; - -static const BitmapCharRec ch38 = {16,17,-1,0,18,ch38data}; - -/* char: 0x25 '%' */ - -static const GLubyte ch37data[] = { -0x30,0x3c,0x0,0x18,0x72,0x0,0xc,0x61,0x0,0x4,0x60,0x80,0x6,0x60,0x80,0x3, -0x30,0x80,0x1,0x19,0x80,0x1,0x8f,0x0,0x78,0xc0,0x0,0xe4,0x40,0x0,0xc2,0x60, -0x0,0xc1,0x30,0x0,0xc1,0x10,0x0,0x61,0x18,0x0,0x33,0xfc,0x0,0x1e,0xc,0x0, -}; - -static const BitmapCharRec ch37 = {17,16,-1,0,19,ch37data}; - -/* char: 0x24 '$' */ - -static const GLubyte ch36data[] = { -0x4,0x0,0x4,0x0,0x3f,0x0,0xe5,0xc0,0xc4,0xc0,0x84,0x60,0x84,0x60,0x4,0x60, -0x4,0xe0,0x7,0xc0,0x7,0x80,0x1e,0x0,0x3c,0x0,0x74,0x0,0x64,0x0,0x64,0x20, -0x64,0x60,0x34,0xe0,0x1f,0x80,0x4,0x0,0x4,0x0, -}; - -static const BitmapCharRec ch36 = {11,21,0,2,12,ch36data}; - -/* char: 0x23 '#' */ - -static const GLubyte ch35data[] = { -0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0x22,0x0,0xff,0xc0,0xff,0xc0,0x11,0x0, -0x11,0x0,0x11,0x0,0x7f,0xe0,0x7f,0xe0,0x8,0x80,0x8,0x80,0x8,0x80,0x8,0x80, -0x8,0x80, -}; - -static const BitmapCharRec ch35 = {11,17,-1,0,13,ch35data}; - -/* char: 0x22 '"' */ - -static const GLubyte ch34data[] = { -0x88,0xcc,0xcc,0xcc,0xcc, -}; - -static const BitmapCharRec ch34 = {6,5,-1,-12,10,ch34data}; - -/* char: 0x21 '!' */ - -static const GLubyte ch33data[] = { -0xc0,0xc0,0x0,0x0,0x0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0, -0xc0, -}; - -static const BitmapCharRec ch33 = {2,17,-3,0,8,ch33data}; - -/* char: 0x20 ' ' */ - -#ifdef _WIN32 -/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with - a height or width of zero does not advance the raster position - as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */ -static const GLubyte ch32data[] = { 0x0 }; -static const BitmapCharRec ch32 = {1,1,0,0,6,ch32data}; -#else -static const BitmapCharRec ch32 = {0,0,0,0,6,0}; -#endif - -static const BitmapCharRec * const chars[] = { -&ch32, -&ch33, -&ch34, -&ch35, -&ch36, -&ch37, -&ch38, -&ch39, -&ch40, -&ch41, -&ch42, -&ch43, -&ch44, -&ch45, -&ch46, -&ch47, -&ch48, -&ch49, -&ch50, -&ch51, -&ch52, -&ch53, -&ch54, -&ch55, -&ch56, -&ch57, -&ch58, -&ch59, -&ch60, -&ch61, -&ch62, -&ch63, -&ch64, -&ch65, -&ch66, -&ch67, -&ch68, -&ch69, -&ch70, -&ch71, -&ch72, -&ch73, -&ch74, -&ch75, -&ch76, -&ch77, -&ch78, -&ch79, -&ch80, -&ch81, -&ch82, -&ch83, -&ch84, -&ch85, -&ch86, -&ch87, -&ch88, -&ch89, -&ch90, -&ch91, -&ch92, -&ch93, -&ch94, -&ch95, -&ch96, -&ch97, -&ch98, -&ch99, -&ch100, -&ch101, -&ch102, -&ch103, -&ch104, -&ch105, -&ch106, -&ch107, -&ch108, -&ch109, -&ch110, -&ch111, -&ch112, -&ch113, -&ch114, -&ch115, -&ch116, -&ch117, -&ch118, -&ch119, -&ch120, -&ch121, -&ch122, -&ch123, -&ch124, -&ch125, -&ch126, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -&ch160, -&ch161, -&ch162, -&ch163, -&ch164, -&ch165, -&ch166, -&ch167, -&ch168, -&ch169, -&ch170, -&ch171, -&ch172, -&ch173, -&ch174, -&ch175, -&ch176, -&ch177, -&ch178, -&ch179, -&ch180, -&ch181, -&ch182, -&ch183, -&ch184, -&ch185, -&ch186, -&ch187, -&ch188, -&ch189, -&ch190, -&ch191, -&ch192, -&ch193, -&ch194, -&ch195, -&ch196, -&ch197, -&ch198, -&ch199, -&ch200, -&ch201, -&ch202, -&ch203, -&ch204, -&ch205, -&ch206, -&ch207, -&ch208, -&ch209, -&ch210, -&ch211, -&ch212, -&ch213, -&ch214, -&ch215, -&ch216, -&ch217, -&ch218, -&ch219, -&ch220, -&ch221, -&ch222, -&ch223, -&ch224, -&ch225, -&ch226, -&ch227, -&ch228, -&ch229, -&ch230, -&ch231, -&ch232, -&ch233, -&ch234, -&ch235, -&ch236, -&ch237, -&ch238, -&ch239, -&ch240, -&ch241, -&ch242, -&ch243, -&ch244, -&ch245, -&ch246, -&ch247, -&ch248, -&ch249, -&ch250, -&ch251, -&ch252, -&ch253, -&ch254, -&ch255, -}; - -#if !defined(__IBMCPP__) -const -#endif -BitmapFontRec glutBitmapTimesRoman24 = { -"-adobe-times-medium-r-normal--24-240-75-75-p-124-iso8859-1", -224, -32, -chars -}; - diff --git a/src/glut/os2/glut_util.cpp b/src/glut/os2/glut_util.cpp deleted file mode 100644 index 2a50a7400e..0000000000 --- a/src/glut/os2/glut_util.cpp +++ /dev/null @@ -1,90 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include -#include -#include - -#include "glutint.h" - -#if !defined(__OS2__) - -/* strdup is actually not a standard ANSI C or POSIX routine - so implement a private one for GLUT. OpenVMS does not have a - strdup; Linux's standard libc doesn't declare strdup by default - (unless BSD or SVID interfaces are requested). */ -char * -__glutStrdup(const char *string) -{ - char *copy; - - copy = (char*) malloc(strlen(string) + 1); - if (copy == NULL) - return NULL; - strcpy(copy, string); - return copy; -} -#endif - -void -__glutWarning(char *format,...) -{ - va_list args; - - va_start(args, format); - fprintf(stderr, "GLUT: Warning in %s: ", - __glutProgramName ? __glutProgramName : "(unamed)"); - vfprintf(stderr, format, args); - va_end(args); - putc('\n', stderr); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutReportErrors(void) -{ - GLenum error; - - while ((error = glGetError()) != GL_NO_ERROR) - __glutWarning("GL error: %s", gluErrorString(error)); -} -/* ENDCENTRY */ - -void -__glutFatalError(char *format,...) -{ - va_list args; - - va_start(args, format); - fprintf(stderr, "GLUT: Fatal Error in %s: ", - __glutProgramName ? __glutProgramName : "(unamed)"); - vfprintf(stderr, format, args); - va_end(args); - putc('\n', stderr); -/* || defined(__OS2__) */ -#if defined(_WIN32) - if (__glutExitFunc) { - __glutExitFunc(1); - } -#endif - exit(1); -} - -void -__glutFatalUsage(char *format,...) -{ - va_list args; - - va_start(args, format); - fprintf(stderr, "GLUT: Fatal API Usage in %s: ", - __glutProgramName ? __glutProgramName : "(unamed)"); - vfprintf(stderr, format, args); - va_end(args); - putc('\n', stderr); - abort(); -} diff --git a/src/glut/os2/glut_vidresize.cpp b/src/glut/os2/glut_vidresize.cpp deleted file mode 100644 index 9f9b6eef58..0000000000 --- a/src/glut/os2/glut_vidresize.cpp +++ /dev/null @@ -1,232 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1996. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include - -#ifdef __sgi -#include -#endif - -#include "glutint.h" - -/* Grumble. The IRIX 6.3 and early IRIX 6.4 OpenGL headers - support the video resize extension, but failed to define - GLX_SGIX_video_resize. */ -#if 0 -#ifdef GLX_SYNC_FRAME_SGIX -#define GLX_SGIX_video_resize 1 -#endif -#endif - -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) -static int canVideoResize = -1; -static int videoResizeChannel; -#else -static int canVideoResize = 0; -#endif -static int videoResizeInUse = 0; -static int dx = -1, dy = -1, dw = -1, dh = -1; - -/* XXX Note that IRIX 6.2, 6.3, and some 6.4 versions have a - bug where programs seg-fault when they attempt video - resizing from an indirect OpenGL context (either local or - over a network). */ - -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) - -static volatile int errorCaught; - -/* ARGSUSED */ -static int -catchXSGIvcErrors(Display * dpy, XErrorEvent * event) -{ - errorCaught = 1; - return 0; -} -#endif - -/* CENTRY */ - -int GLUTAPIENTRY -glutVideoResizeGet(GLenum param) -{ -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) - if (canVideoResize < 0) { - canVideoResize = __glutIsSupportedByGLX("GLX_SGIX_video_resize"); - if (canVideoResize) { -#if defined(__sgi) && __sgi - /* This is a hack because IRIX 6.2, 6.3, and some 6.4 - versions were released with GLX_SGIX_video_resize - being advertised by the X server though the video - resize extension is not actually supported. We try to - determine if the libGL.so we are using actually has a - video resize entrypoint before we try to use the - feature. */ - void (*func) (void); - void *glxDso = dlopen("libGL.so", RTLD_LAZY); - - func = (void (*)(void)) dlsym(glxDso, "glXQueryChannelDeltasSGIX"); - if (!func) { - canVideoResize = 0; - } else -#endif - { - char *channelString; - int (*handler) (Display *, XErrorEvent *); - - channelString = getenv("GLUT_VIDEO_RESIZE_CHANNEL"); - videoResizeChannel = channelString ? atoi(channelString) : 0; - - /* Work around another annoying problem with SGI's - GLX_SGIX_video_resize implementation. Early IRIX - 6.4 OpenGL's advertise the extension and have the - video resize API, but an XSGIvc X protocol errors - result trying to use the API. Set up an error - handler to intercept what would otherwise be a fatal - error. If an error was recieved, do not report that - video resize is possible. */ - handler = XSetErrorHandler(catchXSGIvcErrors); - - errorCaught = 0; - -#if defined(GLX_GLXEXT_PROTOTYPES) -#endif - - __glut_glXQueryChannelDeltasSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, &dx, &dy, &dw, &dh); - - /* glXQueryChannelDeltasSGIX is an inherent X server - round-trip so we know we will have gotten either the - correct reply or and error by this time. */ - XSetErrorHandler(handler); - - /* Still yet another work around. In IRIX 6.4 betas, - glXQueryChannelDeltasSGIX will return as if it - succeeded, but the values are filled with junk. - Watch to make sure the delta variables really make - sense. */ - if (errorCaught || - dx < 0 || dy < 0 || dw < 0 || dh < 0 || - dx > 2048 || dy > 2048 || dw > 2048 || dh > 2048) { - canVideoResize = 0; - } - } - } - } -#endif /* GLX_SGIX_video_resize */ - - switch (param) { - case GLUT_VIDEO_RESIZE_POSSIBLE: - return canVideoResize; - case GLUT_VIDEO_RESIZE_IN_USE: - return videoResizeInUse; - case GLUT_VIDEO_RESIZE_X_DELTA: - return dx; - case GLUT_VIDEO_RESIZE_Y_DELTA: - return dy; - case GLUT_VIDEO_RESIZE_WIDTH_DELTA: - return dw; - case GLUT_VIDEO_RESIZE_HEIGHT_DELTA: - return dh; - case GLUT_VIDEO_RESIZE_X: - case GLUT_VIDEO_RESIZE_Y: - case GLUT_VIDEO_RESIZE_WIDTH: - case GLUT_VIDEO_RESIZE_HEIGHT: -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) - if (videoResizeInUse) { - int x, y, width, height; - - __glut_glXQueryChannelRectSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, &x, &y, &width, &height); - switch (param) { - case GLUT_VIDEO_RESIZE_X: - return x; - case GLUT_VIDEO_RESIZE_Y: - return y; - case GLUT_VIDEO_RESIZE_WIDTH: - return width; - case GLUT_VIDEO_RESIZE_HEIGHT: - return height; - } - } -#endif - return -1; - default: - __glutWarning("invalid glutVideoResizeGet parameter: %d", param); - return -1; - } -} - -void GLUTAPIENTRY -glutSetupVideoResizing(void) -{ -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) - if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { - __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, __glutCurrentWindow->win); - videoResizeInUse = 1; - } else -#endif - __glutFatalError("glutEstablishVideoResizing: video resizing not possible.\n"); -} - -void GLUTAPIENTRY -glutStopVideoResizing(void) -{ -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) - if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) { - if (videoResizeInUse) { - __glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, None); - videoResizeInUse = 0; - } - } -#endif -} - -/* ARGSUSED */ -void GLUTAPIENTRY -glutVideoResize(int x, int y, int width, int height) -{ -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) - if (videoResizeInUse) { -#ifdef GLX_SYNC_SWAP_SGIX - /* glXChannelRectSyncSGIX introduced in a patch to IRIX - 6.2; the original unpatched IRIX 6.2 behavior is always - GLX_SYNC_SWAP_SGIX. */ - __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, GLX_SYNC_SWAP_SGIX); -#endif - __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, x, y, width, height); - } -#endif -} - -/* ARGSUSED */ -void GLUTAPIENTRY -glutVideoPan(int x, int y, int width, int height) -{ -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize) - if (videoResizeInUse) { -#ifdef GLX_SYNC_FRAME_SGIX - /* glXChannelRectSyncSGIX introduced in a patch to IRIX - 6.2; the original unpatched IRIX 6.2 behavior is always - GLX_SYNC_SWAP_SGIX. We just ignore that we cannot - accomplish GLX_SYNC_FRAME_SGIX on IRIX unpatched 6.2; - this means you'd need a glutSwapBuffers to actually - realize the video resize. */ - __glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, GLX_SYNC_FRAME_SGIX); -#endif - __glut_glXChannelRectSGIX(__glutDisplay, __glutScreen, - videoResizeChannel, x, y, width, height); - } -#endif -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_warp.cpp b/src/glut/os2/glut_warp.cpp deleted file mode 100644 index 4ef6f7bf39..0000000000 --- a/src/glut/os2/glut_warp.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1996, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#include -#include -#include - -#include "glutint.h" - -/* CENTRY */ -void GLUTAPIENTRY -glutWarpPointer(int x, int y) -{ -// XWarpPointer(__glutDisplay, None, __glutCurrentWindow->win, -// 0, 0, 0, 0, x, y); - POINTL point; - point.x = x; - point.y = y; - WinMapWindowPoints(__glutCurrentWindow->win,HWND_DESKTOP,&point,1); - WinSetPointerPos(HWND_DESKTOP, point.x, point.y); - - XFlush(__glutDisplay); -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glut_win.cpp b/src/glut/os2/glut_win.cpp deleted file mode 100644 index 63757d7152..0000000000 --- a/src/glut/os2/glut_win.cpp +++ /dev/null @@ -1,1220 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#ifdef __VMS -#include -#endif - -#include -#include -#include -#include -#if defined(__OS2__) -#define POKA 0 - #include "WarpGL.h" - #include "glutos2.h" - #include "glutint.h" - - #include "gl\os2mesa.h" - -// -//define for resource id for main GLUT window, in samples it is defined in GL_TEST.h - #define ID_WINDOW 256 - - int evglSetPixelFormat(int iPixelFormat); - HPS hpsCurrent; - -#elif !defined(_WIN32) - -#include -#include -#endif - -#include "glutint.h" - -GLUTwindow *__glutCurrentWindow = NULL; -GLUTwindow **__glutWindowList = NULL; -int __glutWindowListSize = 0; -#if !defined(_WIN32) && !defined(__OS2__) -GLUTstale *__glutStaleWindowList = NULL; -#endif -GLUTwindow *__glutMenuWindow = NULL; - -void (*__glutFreeOverlayFunc) (GLUToverlay *); -XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle, - Criterion * requiredCriteria, int nRequired, int requiredMask, void** fbc) = NULL; - -static Criterion requiredWindowCriteria[] = -{ - {LEVEL, EQ, 0}, - {TRANSPARENT, EQ, 0} -}; -static int numRequiredWindowCriteria = sizeof(requiredWindowCriteria) / sizeof(Criterion); -static int requiredWindowCriteriaMask = (1 << LEVEL) | (1 << TRANSPARENT); - -static void -cleanWindowWorkList(GLUTwindow * window) -{ - GLUTwindow **pEntry = &__glutWindowWorkList; - GLUTwindow *entry = __glutWindowWorkList; - - /* Tranverse singly-linked window work list look for the - window. */ - while (entry) { - if (entry == window) { - /* Found it; delete it. */ - *pEntry = entry->prevWorkWin; - return; - } else { - pEntry = &entry->prevWorkWin; - entry = *pEntry; - } - } -} - -#if !defined(_WIN32) && !defined(__OS2PM__) - -static void -cleanStaleWindowList(GLUTwindow * window) -{ - GLUTstale **pEntry = &__glutStaleWindowList; - GLUTstale *entry = __glutStaleWindowList; - - /* Tranverse singly-linked stale window list look for the - window ID. */ - while (entry) { - if (entry->window == window) { - /* Found it; delete it. */ - *pEntry = entry->next; - free(entry); - return; - } else { - pEntry = &entry->next; - entry = *pEntry; - } - } -} - -#endif - -static GLUTwindow *__glutWindowCache = NULL; - -GLUTwindow * -__glutGetWindow(Window win) -{ - int i; - - /* Does win belong to the last window ID looked up? */ - if (__glutWindowCache && (win == __glutWindowCache->win || - (__glutWindowCache->overlay && win == - __glutWindowCache->overlay->win))) { - return - __glutWindowCache; - } - /* Otherwise scan the window list looking for the window ID. */ - for (i = 0; i < __glutWindowListSize; i++) { - if (__glutWindowList[i]) { - if (win == __glutWindowList[i]->win) { - __glutWindowCache = __glutWindowList[i]; - return __glutWindowCache; - } - if (__glutWindowList[i]->overlay) { - if (win == __glutWindowList[i]->overlay->win) { - __glutWindowCache = __glutWindowList[i]; - return __glutWindowCache; - } - } - } - } -#if !defined(_WIN32) && !defined(__OS2PM__) - { - GLUTstale *entry; - - /* Scan through destroyed overlay window IDs for which no - DestroyNotify has yet been received. */ - for (entry = __glutStaleWindowList; entry; entry = entry->next) { - if (entry->win == win) - return entry->window; - } - } -#endif - return NULL; -} - -/* CENTRY */ -int GLUTAPIENTRY -glutGetWindow(void) -{ - if (__glutCurrentWindow) { - return __glutCurrentWindow->num + 1; - } else { - return 0; - } -} -/* ENDCENTRY */ - -void -__glutSetWindow(GLUTwindow * window) -{ - /* It is tempting to try to short-circuit the call to - glXMakeCurrent if we "know" we are going to make current - to a window we are already current to. In fact, this - assumption breaks when GLUT is expected to integrated with - other OpenGL windowing APIs that also make current to - OpenGL contexts. Since glXMakeCurrent short-circuits the - "already bound" case, GLUT avoids the temptation to do so - too. */ - __glutCurrentWindow = window; - - MAKE_CURRENT_LAYER(__glutCurrentWindow); - -#if !defined(_WIN32) && !defined(__OS2__) - /* We should be careful to force a finish between each - iteration through the GLUT main loop if indirect OpenGL - contexts are in use; indirect contexts tend to have much - longer latency because lots of OpenGL extension requests - can queue up in the X protocol stream. We accomplish this - by posting GLUT_FINISH_WORK to be done. */ - if (!__glutCurrentWindow->isDirect) - __glutPutOnWorkList(__glutCurrentWindow, GLUT_FINISH_WORK); -#endif - - /* If debugging is enabled, we'll want to check this window - for any OpenGL errors every iteration through the GLUT - main loop. To accomplish this, we post the - GLUT_DEBUG_WORK to be done on this window. */ - if (__glutDebug) { - __glutPutOnWorkList(__glutCurrentWindow, GLUT_DEBUG_WORK); - } -} - -/* CENTRY */ -void GLUTAPIENTRY -glutSetWindow(int win) -{ - GLUTwindow *window; - - if (win < 1 || win > __glutWindowListSize) { - __glutWarning("glutSetWindow attempted on bogus window."); - return; - } - window = __glutWindowList[win - 1]; - if (!window) { - __glutWarning("glutSetWindow attempted on bogus window."); - return; - } - __glutSetWindow(window); -} -/* ENDCENTRY */ - -static int -getUnusedWindowSlot(void) -{ - int i; - - /* Look for allocated, unused slot. */ - for (i = 0; i < __glutWindowListSize; i++) { - if (!__glutWindowList[i]) { - return i; - } - } - /* Allocate a new slot. */ - __glutWindowListSize++; - if (__glutWindowList) { - __glutWindowList = (GLUTwindow **) - realloc(__glutWindowList, - __glutWindowListSize * sizeof(GLUTwindow *)); - } else { - /* XXX Some realloc's do not correctly perform a malloc - when asked to perform a realloc on a NULL pointer, - though the ANSI C library spec requires this. */ - __glutWindowList = (GLUTwindow **) - malloc(sizeof(GLUTwindow *)); - } - if (!__glutWindowList) - __glutFatalError("out of memory."); - __glutWindowList[__glutWindowListSize - 1] = NULL; - return __glutWindowListSize - 1; -} - -static XVisualInfo * -getVisualInfoCI(unsigned int mode) -{ -#if POKA - static int bufSizeList[] = - {16, 12, 8, 4, 2, 1, 0}; - XVisualInfo *vi; - int list[32]; - int i, n = 0; - - /* Should not be looking at display mode mask if - __glutDisplayString is non-NULL. */ - assert(!__glutDisplayString); - - list[n++] = GLX_BUFFER_SIZE; - list[n++] = 1; - if (GLUT_WIND_IS_DOUBLE(mode)) { - list[n++] = GLX_DOUBLEBUFFER; - } - if (GLUT_WIND_IS_STEREO(mode)) { - list[n++] = GLX_STEREO; - } - if (GLUT_WIND_HAS_DEPTH(mode)) { - list[n++] = GLX_DEPTH_SIZE; - list[n++] = 1; - } - if (GLUT_WIND_HAS_STENCIL(mode)) { - list[n++] = GLX_STENCIL_SIZE; - list[n++] = 1; - } - list[n] = (int) None; /* terminate list */ - - /* glXChooseVisual specify GLX_BUFFER_SIZE prefers the - "smallest index buffer of at least the specified size". - This would be reasonable if GLUT allowed the user to - specify the required buffe size, but GLUT's display mode - is too simplistic (easy to use?). GLUT should try to find - the "largest". So start with a large buffer size and - shrink until we find a matching one that exists. */ - - for (i = 0; bufSizeList[i]; i++) { - /* XXX Assumes list[1] is where GLX_BUFFER_SIZE parameter - is. */ - list[1] = bufSizeList[i]; - vi = glXChooseVisual(__glutDisplay, - __glutScreen, list); - if (vi) - return vi; - } - return NULL; -#else - return - glXChooseVisual(mode); - -#endif -} - -static XVisualInfo * -getVisualInfoRGB(unsigned int mode) -{ -#if POKA - int list[32]; - int n = 0; - - /* Should not be looking at display mode mask if - __glutDisplayString is non-NULL. */ - assert(!__glutDisplayString); - - /* XXX Would a caching mechanism to minize the calls to - glXChooseVisual? You'd have to reference count - XVisualInfo* pointers. Would also have to properly - interact with glutInitDisplayString. */ - - list[n++] = GLX_RGBA; - list[n++] = GLX_RED_SIZE; - list[n++] = 1; - list[n++] = GLX_GREEN_SIZE; - list[n++] = 1; - list[n++] = GLX_BLUE_SIZE; - list[n++] = 1; - if (GLUT_WIND_HAS_ALPHA(mode)) { - list[n++] = GLX_ALPHA_SIZE; - list[n++] = 1; - } - if (GLUT_WIND_IS_DOUBLE(mode)) { - list[n++] = GLX_DOUBLEBUFFER; - } - if (GLUT_WIND_IS_STEREO(mode)) { - list[n++] = GLX_STEREO; - } - if (GLUT_WIND_HAS_DEPTH(mode)) { - list[n++] = GLX_DEPTH_SIZE; - list[n++] = 1; - } - if (GLUT_WIND_HAS_STENCIL(mode)) { - list[n++] = GLX_STENCIL_SIZE; - list[n++] = 1; - } - if (GLUT_WIND_HAS_ACCUM(mode)) { - list[n++] = GLX_ACCUM_RED_SIZE; - list[n++] = 1; - list[n++] = GLX_ACCUM_GREEN_SIZE; - list[n++] = 1; - list[n++] = GLX_ACCUM_BLUE_SIZE; - list[n++] = 1; - if (GLUT_WIND_HAS_ALPHA(mode)) { - list[n++] = GLX_ACCUM_ALPHA_SIZE; - list[n++] = 1; - } - } -#if defined(GLX_VERSION_1_1) && (defined(GLX_SGIS_multisample) || defined(GLX_ARB_multisample)) - if (GLUT_WIND_IS_MULTISAMPLE(mode)) { - if (!__glutIsSupportedByGLX("GLX_SGIS_multisample") && - !__glutIsSupportedByGLX("GLX_ARB_multisample")) - return NULL; -#if defined(GLX_ARB_multisample) - list[n++] = GLX_SAMPLES_ARB; -#elif defined(GLX_SGIS_multisample) - list[n++] = GLX_SAMPLES_SGIS; -#endif - /* XXX Is 4 a reasonable minimum acceptable number of - samples? */ - list[n++] = 4; - } -#endif - list[n] = (int) None; /* terminate list */ - - return glXChooseVisual(__glutDisplay, - __glutScreen, list); -#else /* POKA */ - - return - glXChooseVisual(mode); - -#endif -} - -XVisualInfo * -__glutGetVisualInfo(unsigned int mode) -{ - /* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */ - if (GLUT_WIND_IS_LUMINANCE(mode)) - return NULL; - - if (GLUT_WIND_IS_RGB(mode)) - return getVisualInfoRGB(mode); - else - return getVisualInfoCI(mode); -} - -XVisualInfo * -__glutDetermineVisual( - unsigned int displayMode, - Bool * treatAsSingle, - XVisualInfo * (getVisualInfo) (unsigned int)) -{ - XVisualInfo *vis; - - /* Should not be looking at display mode mask if - __glutDisplayString is non-NULL. */ - assert(!__glutDisplayString); - - *treatAsSingle = GLUT_WIND_IS_SINGLE(displayMode); - vis = getVisualInfo(displayMode); - if (!vis) { - /* Fallback cases when can't get exactly what was asked - for... */ - if (GLUT_WIND_IS_SINGLE(displayMode)) { - /* If we can't find a single buffered visual, try looking - for a double buffered visual. We can treat a double - buffered visual as a single buffer visual by changing - the draw buffer to GL_FRONT and treating any swap - buffers as no-ops. */ - displayMode |= GLUT_DOUBLE; - vis = getVisualInfo(displayMode); - *treatAsSingle = True; - } - if (!vis && GLUT_WIND_IS_MULTISAMPLE(displayMode)) { - /* If we can't seem to get multisampling (ie, not Reality - Engine class graphics!), go without multisampling. It - is up to the application to query how many multisamples - were allocated (0 equals no multisampling) if the - application is going to use multisampling for more than - just antialiasing. */ - displayMode &= ~GLUT_MULTISAMPLE; - vis = getVisualInfo(displayMode); - } - } - return vis; -} - -static void GLUTCALLBACK -__glutDefaultDisplay(void) -{ - /* XXX Remove the warning after GLUT 3.0. */ - __glutWarning("The following is a new check for GLUT 3.0; update your code."); - __glutFatalError( - "redisplay needed for window %d, but no display callback.", - __glutCurrentWindow->num + 1); -} - -void GLUTCALLBACK -__glutDefaultReshape(int width, int height) -{ - GLUToverlay *overlay; - - /* Adjust the viewport of the window (and overlay if one - exists). */ - MAKE_CURRENT_WINDOW(__glutCurrentWindow); - glViewport(0, 0, (GLsizei) width, (GLsizei) height); - overlay = __glutCurrentWindow->overlay; - if (overlay) { - MAKE_CURRENT_OVERLAY(overlay); - glViewport(0, 0, (GLsizei) width, (GLsizei) height); - } - /* Make sure we are current to the current layer (application - should be able to count on the current layer not changing - unless the application explicitly calls glutUseLayer). */ - MAKE_CURRENT_LAYER(__glutCurrentWindow); -} - -XVisualInfo * -__glutDetermineWindowVisual(Bool * treatAsSingle, Bool * visAlloced, void **fbc) -{ - if (__glutDisplayString) { - - /* __glutDisplayString should be NULL except if - glutInitDisplayString has been called to register a - different display string. Calling glutInitDisplayString - means using a string instead of an integer mask determine - the visual to use. Using the function pointer variable - __glutDetermineVisualFromString below avoids linking in - the code for implementing glutInitDisplayString (ie, - glut_dstr.o) unless glutInitDisplayString gets called by - the application. */ - - assert(__glutDetermineVisualFromString); - *visAlloced = False; - *fbc = NULL; - return __glutDetermineVisualFromString(__glutDisplayString, treatAsSingle, - requiredWindowCriteria, numRequiredWindowCriteria, requiredWindowCriteriaMask, fbc); - } else { - *visAlloced = True; - *fbc = NULL; - return __glutDetermineVisual(__glutDisplayMode, - treatAsSingle, __glutGetVisualInfo); - } -} - -/* ARGSUSED5 */ /* Only Win32 uses gameMode parameter. */ -GLUTwindow * -__glutCreateWindow(GLUTwindow * parent, - int x, int y, int width, int height, int gameMode) -{ - GLUTwindow *window; - XSetWindowAttributes wa; - unsigned long attribMask; - int winnum; - int i; -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) - GLXFBConfigSGIX fbc; -#else - void *fbc; -#endif - -#if defined(__OS2PM__) - { - extern HAB hab; /* PM anchor block handle */ - CLASSINFO classinfo; - - if(!WinQueryClassInfo(hab,"GLUT", &classinfo) ) - __glutOpenOS2Connection(NULL); - } -#elif defined(_WIN32) - WNDCLASS wc; - int style; - - if (!GetClassInfo(GetModuleHandle(NULL), "GLUT", &wc)) { - __glutOpenWin32Connection(NULL); - } -#else - if (!__glutDisplay) { - __glutOpenXConnection(NULL); - } -#endif - -#ifndef __OS2PM__ - if (__glutGameModeWindow) { - __glutFatalError("cannot create windows in game mode."); - } -#endif - - winnum = getUnusedWindowSlot(); - window = (GLUTwindow *) malloc(sizeof(GLUTwindow)); - if (!window) { - __glutFatalError("out of memory."); - } - window->num = winnum; - -#if defined(__OS2PM__) - /* Add this new window to the window list. */ - __glutWindowList[winnum] = window; - window->shownState = -1; -#endif - -#if !defined(_WIN32) && !defined(__OS2PM__) - window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, - &window->visAlloced, (void**) &fbc); - if (!window->vis) { - __glutFatalError( - "visual with necessary capabilities not found."); - } - __glutSetupColormap(window->vis, &window->colormap, &window->cmap); -#endif - window->eventMask = StructureNotifyMask | ExposureMask; - - attribMask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask; - wa.background_pixmap = None; - wa.border_pixel = 0; - wa.colormap = window->cmap; - wa.event_mask = window->eventMask; - if (parent) { - if (parent->eventMask & GLUT_HACK_STOP_PROPAGATE_MASK) - wa.event_mask |= GLUT_HACK_STOP_PROPAGATE_MASK; - attribMask |= CWDontPropagate; - wa.do_not_propagate_mask = parent->eventMask & GLUT_DONT_PROPAGATE_FILTER_MASK; - } else { - wa.do_not_propagate_mask = 0; - } - - /* Stash width and height before Win32's __glutAdjustCoords - possibly overwrites the values. */ - window->width = width; - window->height = height; - window->forceReshape = True; - window->ignoreKeyRepeat = False; - -#if defined(__OS2PM__) - - { ULONG flStyle=0; - int ii; - ERRORID erridErrorCode;/* last error id code */ - extern HAB hab; /* PM anchor block handle */ - - if (parent) { - flStyle = WS_CLIPCHILDREN|WS_VISIBLE; - } else { - if (gameMode) { - /* Game mode window should be a WS_POPUP window to - ensure that the taskbar is hidden by it. A standard - WS_OVERLAPPEDWINDOW does not hide the task bar. */ - flStyle = FCF_STANDARD | WS_MAXIMIZED; - } else { - /* A standard toplevel window with borders and such. */ - flStyle = FCF_STANDARD | WS_CLIPCHILDREN; -// flStyle = WS_OVERLAPPEDWINDOW; - } - } -{ - HWND hwnd; /* Window */ - ULONG ListBoxId; /* Window id */ - /* (supplied by application) */ - - - HWND hwndClient; /* handle to the client */ - HWND hwndFrame; /* handle to the frame */ - PFNWP GenericWndProc; - FRAMECDATA fcd; - RECTL rect; /* Boundary rectangle */ - - - -/************************************************/ -// flCreate = (FCF_STANDARD) & ~FCF_TASKLIST; -/**********************************/ - if (parent) - { window->frame = NULL; - - hwnd = WinCreateWindow(parent->win, /* Parent window */ - "GLUTCHILD", /* Class name */ - "", /* Window text */ - flStyle, /* Window style */ - x, y, /* Position (x,y) */ - width, height, /* Size (width,height) */ - parent->win, /* Owner window */ - HWND_TOP, /* Sibling window */ - 0, /* Window id */ - NULL, /* Control data */ - NULL); /* Pres parameters */ - - erridErrorCode = WinGetLastError(hab); - window->win = hwnd; - - window->hdc = WinOpenWindowDC(window->win); - window->hpsBuffer = hpsCurrent; - - - rect.xLeft = x; - rect.xRight = x+width; - rect.yBottom = y; - rect.yTop = y + height; - -/***** else parent *****************************/ - } else { - hwnd = WinCreateStdWindow(HWND_DESKTOP, - 0, /* WS_VISIBLE frame-window style */ - &flStyle, /* window style */ - "GLUT", /* class name */ - "GLUT",/* window title */ - 0L, /* default client style */ - NULLHANDLE, /* resource in executable file */ - ID_WINDOW, /* resource id */ - &hwndClient); /* receives client window handle */ - - erridErrorCode = WinGetLastError(hab); - window->win = hwndClient; - window->frame = hwnd; - window->hdc = WinOpenWindowDC(window->win); - - window->hpsBuffer = hpsCurrent; - - -/* converts a client window's boundaries into an equivalent frame rectangle */ - rect.xLeft = x; - rect.xRight = x+width; - rect.yBottom = y; - rect.yTop = y + height; - - /* calculate equivalent frame boundary from boundary data */ - WinCalcFrameRect(window->frame, &rect, FALSE); - } -/***** endof if(parent) *****************************/ - - /* Must set the XHDC for fake glXChooseVisual & fake - glXCreateContext & fake XAllocColorCells. */ - XHDC = window->hdc; - XHWND = window->win; - window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, - &window->visAlloced, &fbc); - if (!window->vis) - { __glutFatalError( - "pixel format with necessary capabilities not found."); - } - { int rc; - rc = wglChoosePixelFormat(window->hdc, window->vis), - -// evglSetPixelFormat(2); /* int iPixelFormat 1 - doublebuffer/2 - single buffer ??*/ - wglSetPixelFormat(window->hdc,rc,window->vis); - } - __glutSetupColormap(window->vis, &window->colormap, &window->cmap); - - window->ctx = glXCreateContext(window->hpsBuffer, window->vis, - None, __glutTryDirect); - - WinSetWindowPos(hwnd, - HWND_TOP,rect.xLeft,rect.yBottom, - rect.xRight-rect.xLeft, rect.yTop-rect.yBottom, - SWP_ACTIVATE | SWP_MOVE | SWP_SIZE | SWP_SHOW|SWP_ZORDER); /* flags*/ - - /* Make sure subwindows get a windowStatus callback. */ - if (parent) - WinPostMsg(parent->win, WM_ACTIVATE, 0, 0); - - } -} - -#elif defined(_WIN32) - - __glutAdjustCoords(parent ? parent->win : NULL, - &x, &y, &width, &height); - if (parent) { - style = WS_CHILD; - } else { - if (gameMode) { - /* Game mode window should be a WS_POPUP window to - ensure that the taskbar is hidden by it. A standard - WS_OVERLAPPEDWINDOW does not hide the task bar. */ - style = WS_POPUP | WS_MAXIMIZE; - } else { - /* A standard toplevel window with borders and such. */ - style = WS_OVERLAPPEDWINDOW; - } - } - window->win = CreateWindow("GLUT", "GLUT", - WS_CLIPSIBLINGS | WS_CLIPCHILDREN | style, - x, y, width, height, parent ? parent->win : __glutRoot, - NULL, GetModuleHandle(NULL), 0); - window->hdc = GetDC(window->win); - /* Must set the XHDC for fake glXChooseVisual & fake - glXCreateContext & fake XAllocColorCells. */ - XHDC = window->hdc; - window->vis = __glutDetermineWindowVisual(&window->treatAsSingle, - &window->visAlloced, &fbc); - if (!window->vis) { - __glutFatalError( - "pixel format with necessary capabilities not found."); - } - if (!SetPixelFormat(window->hdc, - ChoosePixelFormat(window->hdc, window->vis), - window->vis)) { - __glutFatalError("SetPixelFormat failed during window create."); - } - __glutSetupColormap(window->vis, &window->colormap, &window->cmap); - /* Make sure subwindows get a windowStatus callback. */ - if (parent) { - PostMessage(parent->win, WM_ACTIVATE, 0, 0); - } - window->renderDc = window->hdc; -#else - window->win = XCreateWindow(__glutDisplay, - parent == NULL ? __glutRoot : parent->win, - x, y, width, height, 0, - window->vis->depth, InputOutput, window->vis->visual, - attribMask, &wa); -#endif - window->renderWin = window->win; -#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig) - if (fbc) { - window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc, - GLX_RGBA_TYPE_SGIX, None, __glutTryDirect); - } else -#endif -#if defined(__OS2PM__) -// window->ctx = glXCreateContext(window->hpsBuffer, window->vis, -// None, __glutTryDirect); -#else - window->ctx = glXCreateContext(__glutDisplay, window->vis, - None, __glutTryDirect); -#endif - if (!window->ctx) { - __glutFatalError( - "failed to create OpenGL rendering context."); - } - window->renderCtx = window->ctx; -#if !defined(_WIN32) && !defined(__OS2PM__) - window->isDirect = glXIsDirect(__glutDisplay, window->ctx); - if (__glutForceDirect) { - if (!window->isDirect) - __glutFatalError("direct rendering not possible."); - } -#endif - - window->parent = parent; - if (parent) { - window->siblings = parent->children; - parent->children = window; - } else { - window->siblings = NULL; - } - window->overlay = NULL; - window->children = NULL; - window->display = __glutDefaultDisplay; - window->reshape = __glutDefaultReshape; - window->mouse = NULL; - window->motion = NULL; - window->passive = NULL; - window->entry = NULL; - window->keyboard = NULL; - window->keyboardUp = NULL; - window->windowStatus = NULL; - window->visibility = NULL; - window->special = NULL; - window->specialUp = NULL; - window->buttonBox = NULL; - window->dials = NULL; - window->spaceMotion = NULL; - window->spaceRotate = NULL; - window->spaceButton = NULL; - window->tabletMotion = NULL; - window->tabletButton = NULL; -#ifdef _WIN32 - window->joystick = NULL; - window->joyPollInterval = 0; -#endif - -#if defined(__OS2PM__) - window->wm_command = NULL; -#endif - - window->tabletPos[0] = -1; - window->tabletPos[1] = -1; -#if defined(__OS2PM__) - if(window->shownState == -1) - window->shownState = 0; - window->visState = window->shownState; -#else - window->shownState = 0; - window->visState = -1; /* not VisibilityUnobscured, - VisibilityPartiallyObscured, or - VisibilityFullyObscured */ -#endif - window->entryState = -1; /* not EnterNotify or LeaveNotify */ - - window->desiredConfMask = 0; - window->buttonUses = 0; - window->cursor = GLUT_CURSOR_INHERIT; - - /* Setup window to be mapped when glutMainLoop starts. */ - window->workMask = GLUT_MAP_WORK; -#ifdef _WIN32 - if (gameMode) { - /* When mapping a game mode window, just show - the window. We have already created the game - mode window with a maximize flag at creation - time. Doing a ShowWindow(window->win, SW_SHOWNORMAL) - would be wrong for a game mode window since it - would unmaximize the window. */ - window->desiredMapState = GameModeState; - } else { - window->desiredMapState = NormalState; - } -#else - window->desiredMapState = NormalState; -#endif - window->prevWorkWin = __glutWindowWorkList; - __glutWindowWorkList = window; - - /* Initially, no menus attached. */ - for (i = 0; i < GLUT_MAX_MENUS; i++) { - window->menu[i] = 0; - } - - /* Add this new window to the window list. */ - __glutWindowList[winnum] = window; - - /* Make the new window the current window. */ - __glutSetWindow(window); - - __glutDetermineMesaSwapHackSupport(); - - if (window->treatAsSingle) { - /* We do this because either the window really is single - buffered (in which case this is redundant, but harmless, - because this is the initial single-buffered context - state); or we are treating a double buffered window as a - single-buffered window because the system does not appear - to export any suitable single- buffered visuals (in which - the following are necessary). */ - glDrawBuffer(GL_FRONT); - glReadBuffer(GL_FRONT); - } - return window; -} - -/* CENTRY */ -int GLUTAPIENTRY -glutCreateWindow(const char *title) -{ - static int firstWindow = 1; - GLUTwindow *window; -#if !defined(_WIN32) && !defined(__OS2__) - XWMHints *wmHints; -#endif - Window win; - XTextProperty textprop; - - if (__glutGameModeWindow) { - __glutFatalError("cannot create windows in game mode."); - } - window = __glutCreateWindow(NULL, - __glutSizeHints.x, __glutSizeHints.y, - __glutInitWidth, __glutInitHeight, - /* not game mode */ 0); - win = window->win; - /* Setup ICCCM properties. */ - textprop.value = (unsigned char *) title; - textprop.encoding = XA_STRING; - textprop.format = 8; - textprop.nitems = strlen(title); -#if defined(__OS2__) - WinSetWindowText(window->frame, (PCSZ)title); - if (__glutIconic) { - window->desiredMapState = IconicState; - } -#elif defined(_WIN32) - SetWindowText(win, title); - if (__glutIconic) { - window->desiredMapState = IconicState; - } -#else - wmHints = XAllocWMHints(); - wmHints->initial_state = - __glutIconic ? IconicState : NormalState; - wmHints->flags = StateHint; - XSetWMProperties(__glutDisplay, win, &textprop, &textprop, - /* Only put WM_COMMAND property on first window. */ - firstWindow ? __glutArgv : NULL, - firstWindow ? __glutArgc : 0, - &__glutSizeHints, wmHints, NULL); - XFree(wmHints); - XSetWMProtocols(__glutDisplay, win, &__glutWMDeleteWindow, 1); -#endif - firstWindow = 0; - return window->num + 1; -} - -#ifdef _WIN32 -int GLUTAPIENTRY -__glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int)) -{ - __glutExitFunc = exitfunc; - return glutCreateWindow(title); -} -#endif - -int GLUTAPIENTRY -glutCreateSubWindow(int win, int x, int y, int width, int height) -{ - GLUTwindow *window; - - window = __glutCreateWindow(__glutWindowList[win - 1], - x, y, width, height, /* not game mode */ 0); -#if !defined(_WIN32) && !defined(__OS2__) - { - GLUTwindow *toplevel; - - toplevel = __glutToplevelOf(window); - if (toplevel->cmap != window->cmap) { - __glutPutOnWorkList(toplevel, GLUT_COLORMAP_WORK); - } - } -#endif - return window->num + 1; -} -/* ENDCENTRY */ - -void -__glutDestroyWindow(GLUTwindow * window, - GLUTwindow * initialWindow) -{ - GLUTwindow **prev, *cur, *parent, *siblings; - - /* Recursively destroy any children. */ - cur = window->children; - while (cur) { - siblings = cur->siblings; - __glutDestroyWindow(cur, initialWindow); - cur = siblings; - } - /* Remove from parent's children list (only necessary for - non-initial windows and subwindows!). */ - parent = window->parent; - if (parent && parent == initialWindow->parent) { - prev = &parent->children; - cur = parent->children; - while (cur) { - if (cur == window) { - *prev = cur->siblings; - break; - } - prev = &(cur->siblings); - cur = cur->siblings; - } - } - /* Unbind if bound to this window. */ - if (window == __glutCurrentWindow) { - UNMAKE_CURRENT(); - __glutCurrentWindow = NULL; - } - /* Begin tearing down window itself. */ - if (window->overlay) { - __glutFreeOverlayFunc(window->overlay); - } - XDestroyWindow(__glutDisplay, window->win); - glXDestroyContext(__glutDisplay, window->ctx); - if (window->colormap) { - /* Only color index windows have colormap data structure. */ - __glutFreeColormap(window->colormap); - } - /* NULLing the __glutWindowList helps detect is a window - instance has been destroyed, given a window number. */ - __glutWindowList[window->num] = NULL; - - /* Cleanup data structures that might contain window. */ - cleanWindowWorkList(window); -#if !defined(_WIN32) && !defined(__OS2__) - cleanStaleWindowList(window); -#endif - /* Remove window from the "get window cache" if it is there. */ - if (__glutWindowCache == window) - __glutWindowCache = NULL; - - if (window->visAlloced) { - /* Only free XVisualInfo* gotten from glXChooseVisual. */ - XFree(window->vis); - } - - if (window == __glutGameModeWindow) { - /* Destroying the game mode window should implicitly - have GLUT leave game mode. */ - __glutCloseDownGameMode(); - } - - free(window); -} - -/* CENTRY */ -void GLUTAPIENTRY -glutDestroyWindow(int win) -{ - GLUTwindow *window = __glutWindowList[win - 1]; - - if (__glutMappedMenu && __glutMenuWindow == window) { - __glutFatalUsage("destroying menu window not allowed while menus in use"); - } -#if !defined(_WIN32) && !defined(__OS2__) - /* If not a toplevel window... */ - if (window->parent) { - /* Destroying subwindows may change colormap requirements; - recalculate toplevel window's WM_COLORMAP_WINDOWS - property. */ - __glutPutOnWorkList(__glutToplevelOf(window->parent), - GLUT_COLORMAP_WORK); - } -#endif - __glutDestroyWindow(window, window); - XFlush(__glutDisplay); -} -/* ENDCENTRY */ - -void -__glutChangeWindowEventMask(long eventMask, Bool add) -{ - if (add) { - /* Add eventMask to window's event mask. */ - if ((__glutCurrentWindow->eventMask & eventMask) != - eventMask) { - __glutCurrentWindow->eventMask |= eventMask; - __glutPutOnWorkList(__glutCurrentWindow, - GLUT_EVENT_MASK_WORK); - } - } else { - /* Remove eventMask from window's event mask. */ - if (__glutCurrentWindow->eventMask & eventMask) { - __glutCurrentWindow->eventMask &= ~eventMask; - __glutPutOnWorkList(__glutCurrentWindow, - GLUT_EVENT_MASK_WORK); - } - } -} - -void GLUTAPIENTRY -glutDisplayFunc(GLUTdisplayCB displayFunc) -{ - /* XXX Remove the warning after GLUT 3.0. */ - if (!displayFunc) - __glutFatalError("NULL display callback not allowed in GLUT 3.0; update your code."); - __glutCurrentWindow->display = displayFunc; -} - -void GLUTAPIENTRY -glutMouseFunc(GLUTmouseCB mouseFunc) -{ - if (__glutCurrentWindow->mouse) { - if (!mouseFunc) { - /* Previous mouseFunc being disabled. */ - __glutCurrentWindow->buttonUses--; - __glutChangeWindowEventMask( - ButtonPressMask | ButtonReleaseMask, - __glutCurrentWindow->buttonUses > 0); - } - } else { - if (mouseFunc) { - /* Previously no mouseFunc, new one being installed. */ - __glutCurrentWindow->buttonUses++; - __glutChangeWindowEventMask( - ButtonPressMask | ButtonReleaseMask, True); - } - } - __glutCurrentWindow->mouse = mouseFunc; -} - -void GLUTAPIENTRY -glutMotionFunc(GLUTmotionCB motionFunc) -{ - /* Hack. Some window managers (4Dwm by default) will mask - motion events if the client is not selecting for button - press and release events. So we select for press and - release events too (being careful to use reference - counting). */ - if (__glutCurrentWindow->motion) { - if (!motionFunc) { - /* previous mouseFunc being disabled */ - __glutCurrentWindow->buttonUses--; - __glutChangeWindowEventMask( - ButtonPressMask | ButtonReleaseMask, - __glutCurrentWindow->buttonUses > 0); - } - } else { - if (motionFunc) { - /* Previously no mouseFunc, new one being installed. */ - __glutCurrentWindow->buttonUses++; - __glutChangeWindowEventMask( - ButtonPressMask | ButtonReleaseMask, True); - } - } - /* Real work of selecting for passive mouse motion. */ - __glutChangeWindowEventMask( - Button1MotionMask | Button2MotionMask | Button3MotionMask, - motionFunc != NULL); - __glutCurrentWindow->motion = motionFunc; -} - -void GLUTAPIENTRY -glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc) -{ - __glutChangeWindowEventMask(PointerMotionMask, - passiveMotionFunc != NULL); - - /* Passive motion also requires watching enters and leaves so - that a fake passive motion event can be generated on an - enter. */ - __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask, - __glutCurrentWindow->entry != NULL || passiveMotionFunc != NULL); - - __glutCurrentWindow->passive = passiveMotionFunc; -} - -void GLUTAPIENTRY -glutEntryFunc(GLUTentryCB entryFunc) -{ - __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask, - entryFunc != NULL || __glutCurrentWindow->passive); - __glutCurrentWindow->entry = entryFunc; - if (!entryFunc) { - __glutCurrentWindow->entryState = -1; - } -} - -void GLUTAPIENTRY -glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc) -{ - __glutChangeWindowEventMask(VisibilityChangeMask, - windowStatusFunc != NULL); - __glutCurrentWindow->windowStatus = windowStatusFunc; - if (!windowStatusFunc) { - /* Make state invalid. */ - __glutCurrentWindow->visState = -1; - } -} - -static void GLUTCALLBACK -visibilityHelper(int status) -{ - if (status == GLUT_HIDDEN || status == GLUT_FULLY_COVERED) - __glutCurrentWindow->visibility(GLUT_NOT_VISIBLE); - else - __glutCurrentWindow->visibility(GLUT_VISIBLE); -} - - -void GLUTAPIENTRY -glutVisibilityFunc(GLUTvisibilityCB visibilityFunc) -{ - __glutCurrentWindow->visibility = visibilityFunc; - - if (visibilityFunc) - { glutWindowStatusFunc(visibilityHelper); -#if defined(__OS2PM__) - if(__glutCurrentWindow->shownState >= 0) - { visibilityHelper(__glutCurrentWindow->shownState); - } -#endif - } - else - glutWindowStatusFunc(NULL); -} - -void GLUTAPIENTRY -glutReshapeFunc(GLUTreshapeCB reshapeFunc) -{ - if (reshapeFunc) { - __glutCurrentWindow->reshape = reshapeFunc; - } else { - __glutCurrentWindow->reshape = __glutDefaultReshape; - } -} diff --git a/src/glut/os2/glut_winmisc.cpp b/src/glut/os2/glut_winmisc.cpp deleted file mode 100644 index 7cd6699924..0000000000 --- a/src/glut/os2/glut_winmisc.cpp +++ /dev/null @@ -1,126 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - - -#include -#include -#include -#include - - -#include "glutint.h" - -/* CENTRY */ -void GLUTAPIENTRY -glutSetWindowTitle(const char *title) -{ -#if defined(__OS2PM__) - __glutSetWindowText(__glutCurrentWindow->win, (char *)title); - -#else - XTextProperty textprop; - - assert(!__glutCurrentWindow->parent); - IGNORE_IN_GAME_MODE(); - textprop.value = (unsigned char *) title; - textprop.encoding = XA_STRING; - textprop.format = 8; - textprop.nitems = strlen(title); - XSetWMName(__glutDisplay, - __glutCurrentWindow->win, &textprop); - XFlush(__glutDisplay); -#endif -} - -void GLUTAPIENTRY -glutSetIconTitle(const char *title) -{ -#if defined(__OS2PM__) -//todo ? -#else - - XTextProperty textprop; - - assert(!__glutCurrentWindow->parent); - IGNORE_IN_GAME_MODE(); - textprop.value = (unsigned char *) title; - textprop.encoding = XA_STRING; - textprop.format = 8; - textprop.nitems = strlen(title); - XSetWMIconName(__glutDisplay, - __glutCurrentWindow->win, &textprop); - XFlush(__glutDisplay); -#endif -} - -void GLUTAPIENTRY -glutPositionWindow(int x, int y) -{ - IGNORE_IN_GAME_MODE(); - __glutCurrentWindow->desiredX = x; - __glutCurrentWindow->desiredY = y; - __glutCurrentWindow->desiredConfMask |= CWX | CWY; - __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); -} - -void GLUTAPIENTRY -glutReshapeWindow(int w, int h) -{ - IGNORE_IN_GAME_MODE(); - if (w <= 0 || h <= 0) - __glutWarning("glutReshapeWindow: non-positive width or height not allowed"); - - __glutCurrentWindow->desiredWidth = w; - __glutCurrentWindow->desiredHeight = h; - __glutCurrentWindow->desiredConfMask |= CWWidth | CWHeight; - __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); -} - -void GLUTAPIENTRY -glutPopWindow(void) -{ - IGNORE_IN_GAME_MODE(); - __glutCurrentWindow->desiredStack = Above; - __glutCurrentWindow->desiredConfMask |= CWStackMode; - __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); -} - -void GLUTAPIENTRY -glutPushWindow(void) -{ - IGNORE_IN_GAME_MODE(); - __glutCurrentWindow->desiredStack = Below; - __glutCurrentWindow->desiredConfMask |= CWStackMode; - __glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK); -} - -void GLUTAPIENTRY -glutIconifyWindow(void) -{ - IGNORE_IN_GAME_MODE(); - assert(!__glutCurrentWindow->parent); - __glutCurrentWindow->desiredMapState = IconicState; - __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); -} - -void GLUTAPIENTRY -glutShowWindow(void) -{ - IGNORE_IN_GAME_MODE(); - __glutCurrentWindow->desiredMapState = NormalState; - __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); -} - -void GLUTAPIENTRY -glutHideWindow(void) -{ - IGNORE_IN_GAME_MODE(); - __glutCurrentWindow->desiredMapState = WithdrawnState; - __glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK); -} - -/* ENDCENTRY */ diff --git a/src/glut/os2/glutbitmap.h b/src/glut/os2/glutbitmap.h deleted file mode 100644 index 9584bb129d..0000000000 --- a/src/glut/os2/glutbitmap.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __glutbitmap_h__ -#define __glutbitmap_h__ - -/* Copyright (c) Mark J. Kilgard, 1994, 1998. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#define GLUT_NO_LIB_PRAGMA /* Avoid auto library linking when building - the GLUT library itself. */ -#include - -typedef struct { - const GLsizei width; - const GLsizei height; - const GLfloat xorig; - const GLfloat yorig; - const GLfloat advance; - const GLubyte *bitmap; -} BitmapCharRec, *BitmapCharPtr; - -typedef struct { - const char *name; - const int num_chars; - const int first; - const BitmapCharRec * const *ch; -} BitmapFontRec, *BitmapFontPtr; - -typedef void *GLUTbitmapFont; - -#endif /* __glutbitmap_h__ */ diff --git a/src/glut/os2/glutos2.h b/src/glut/os2/glutos2.h deleted file mode 100644 index 533a78011e..0000000000 --- a/src/glut/os2/glutos2.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __glutos2_h__ -#define __glutos2_h__ - - -/* Win32 "equivalent" cursors - eventually, the X glyphs should be - converted to Win32 cursors -- then they will look the same */ -#define XC_arrow IDC_ARROW -#define XC_top_left_arrow IDC_ARROW -#define XC_hand1 IDC_SIZEALL -#define XC_pirate IDC_NO -#define XC_question_arrow IDC_HELP -#define XC_exchange IDC_NO -#define XC_spraycan IDC_SIZEALL -#define XC_watch IDC_WAIT -#define XC_xterm IDC_IBEAM -#define XC_crosshair IDC_CROSS -#define XC_sb_v_double_arrow IDC_SIZENS -#define XC_sb_h_double_arrow IDC_SIZEWE -#define XC_top_side IDC_UPARROW -#define XC_bottom_side IDC_SIZENS -#define XC_left_side IDC_SIZEWE -#define XC_right_side IDC_SIZEWE -#define XC_top_left_corner IDC_SIZENWSE -#define XC_top_right_corner IDC_SIZENESW -#define XC_bottom_right_corner IDC_SIZENWSE -#define XC_bottom_left_corner IDC_SIZENESW - -#define XA_STRING 0 - -/* Private routines from win32_util.c */ -extern int gettimeofday(struct timeval* tp, void* tzp); -//extern void *__glutFont(void *font); -extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo); -extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height); - -#endif /* __glutos2_h__ */ diff --git a/src/glut/os2/glutstroke.h b/src/glut/os2/glutstroke.h deleted file mode 100644 index cbc9e156fe..0000000000 --- a/src/glut/os2/glutstroke.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef __glutstroke_h__ -#define __glutstroke_h__ - -/* Copyright (c) Mark J. Kilgard, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -#if defined(_WIN32) -#pragma warning (disable:4244) /* disable bogus conversion warnings */ -#pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ -#endif - -typedef struct { - float x; - float y; -} CoordRec, *CoordPtr; - -typedef struct { - int num_coords; - const CoordRec *coord; -} StrokeRec, *StrokePtr; - -typedef struct { - int num_strokes; - const StrokeRec *stroke; - float center; - float right; -} StrokeCharRec, *StrokeCharPtr; - -typedef struct { - const char *name; - int num_chars; - const StrokeCharRec *ch; - float top; - float bottom; -} StrokeFontRec, *StrokeFontPtr; - -typedef void *GLUTstrokeFont; - -#endif /* __glutstroke_h__ */ diff --git a/src/glut/os2/layerutil.h b/src/glut/os2/layerutil.h deleted file mode 100644 index 3f62031939..0000000000 --- a/src/glut/os2/layerutil.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __layerutil_h__ -#define __layerutil_h__ - -/* Copyright (c) Mark J. Kilgard, 1993, 1994. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -/* Based on XLayerUtil.h: Revision: 1.3 */ - -#ifdef __VMS -#include -#endif - -#if !defined(_WIN32) && !defined(__OS2__) -#include -#include -#include -#endif /* !_WIN32 */ - -/* Transparent type values */ -/* None 0 */ -#define TransparentPixel 1 -#define TransparentMask 2 - -/* layered visual info template flags */ -#define VisualLayerMask 0x200 -#define VisualTransparentType 0x400 -#define VisualTransparentValue 0x800 -#define VisualAllLayerMask 0xFFF - -/* layered visual info structure */ -typedef struct _XLayerVisualInfo { - XVisualInfo vinfo; - long layer; - long type; - unsigned long value; -} XLayerVisualInfo; - -/* SERVER_OVERLAY_VISUALS property element */ -typedef struct _OverlayInfo { - /* Avoid 64-bit portability problems by being careful to use - longs due to the way XGetWindowProperty is specified. Note - that these parameters are passed as CARD32s over X - protocol. */ - long overlay_visual; - long transparent_type; - long value; - long layer; -} OverlayInfo; - -extern int __glutGetTransparentPixel(Display *, XVisualInfo *); -extern XLayerVisualInfo *__glutXGetLayerVisualInfo(Display *, - long, XLayerVisualInfo *, int *); -extern Status __glutXMatchLayerVisualInfo(Display *, - int, int, int, int, XLayerVisualInfo *); - -#endif /* __layerutil_h__ */ diff --git a/src/glut/os2/libGlut.DEF b/src/glut/os2/libGlut.DEF deleted file mode 100644 index a0e184eef0..0000000000 --- a/src/glut/os2/libGlut.DEF +++ /dev/null @@ -1,94 +0,0 @@ - -;----------------------------------------------------- -; def Module definition file for the DLL -;----------------------------------------------------- - -LIBRARY libGlut INITINSTANCE TERMINSTANCE -PROTMODE -DATA MULTIPLE NONSHARED READWRITE LOADONCALL -CODE LOADONCALL -EXPORTS ; Names of exported functions and data - -;********************************* -;MesaGLUT - glutCommandFunc @3001 - glutCreateWindow @3002 - glutCreateSubWindow @3003 - glutDestroyWindow @3004 - glutDisplayFunc @3005 - glutEntryFunc @3006 - glutExtensionSupported @3007 - glutIdleFunc @3008 - glutInit @3009 - glutInitDisplayMode @3010 - glutInitWindowPosition @3011 - glutInitWindowSize @3012 - glutMainLoop @3013 - glutGet @3014 - glutGetColor @3015 - glutGetWindow @3016 - glutKeyboardFunc @3017 - glutMouseFunc @3018 - glutSpecialFunc @3019 - glutStrokeCharacter @3020 - glutSetColor @3021 - glutSetIconTitle @3022 - glutSetWindow @3023 - glutSetWindowTitle @3024 - - glutReshapeFunc @3025 - glutReshapeWindow @3026 - - - glutSwapBuffers @3027 - glutPostRedisplay @3028 - glutPositionWindow @3029 - glutVisibilityFunc @3030 - glutTimerFunc @3031 - glutMotionFunc @3032 - - glutCreateMenu @3033 - glutAttachMenu @3034 - glutDestroyMenu @3035 - glutAddMenuEntry @3036 - glutPassiveMotionFunc @3037 - - glutSolidCone @3038 - glutSolidCube @3039 - glutSolidDodecahedron @3040 - glutSolidOctahedron @3041 - glutSolidIcosahedron @3042 - glutSolidSphere @3043 - glutSolidTeapot @3044 - glutSolidTetrahedron @3045 - glutSolidTorus @3046 - - glutWireCone @3047 - glutWireCube @3048 - glutWireDodecahedron @3049 - glutWireIcosahedron @3050 - glutWireOctahedron @3051 - glutWireSphere @3052 - glutWireTetrahedron @3053 - glutWireTorus @3054 - glutWireTeapot @3055 - -;GL_GLEXT_PROTOTYPES - glutBitmapCharacter @3101 - glutBitmap9By15 @3102 - glutBitmapHelvetica10 @3103 - glutBitmapHelvetica12 @3104 - glutBitmapHelvetica18 @3105 - glutBitmapTimesRoman24 @3106 - glutStrokeRoman @3107 - glutBitmap8By13 @3108 - -;Global constants -; hab @12001 -; /* PM anchor block handle */ -; hpsCurrent @12002 - XHDC @12004 - XHWND @12005 - - - diff --git a/src/glut/os2/os2_glx.cpp b/src/glut/os2/os2_glx.cpp deleted file mode 100644 index bf116e49c9..0000000000 --- a/src/glut/os2/os2_glx.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* os2_glx.c */ - -#include -#include -#include -#include "gl/gl.h" -#include "WarpGL.h" -#include "GL/os2mesa.h" - -#define POKA 0 -/* global current HDC */ - -XVisualInfo *wglDescribePixelFormat(int iPixelFormat); - -extern HDC XHDC; -extern HWND XHWND; -//extern HPS hpsCurrent; -extern HAB hab; /* PM anchor block handle */ - -GLXContext -glXCreateContext(HPS hps, XVisualInfo * visinfo, - GLXContext share, Bool direct) -{ - /* KLUDGE: GLX really expects a display pointer to be passed - in as the first parameter, but Win32 needs an HDC instead, - so BE SURE that the global XHDC is set before calling this - routine. */ - HGLRC context; - - context = wglCreateContext(XHDC,hps,hab); - - - /* Since direct rendering is implicit, the direct flag is - ignored. */ - - return context; -} - - -int -glXGetConfig(XVisualInfo * visual, int attrib, int *value) -{ - if (!visual) - return GLX_BAD_VISUAL; - - switch (attrib) { - case GLX_USE_GL: - if (visual->dwFlags & (PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW)) { - /* XXX Brad's Matrix Millenium II has problems creating - color index windows in 24-bit mode (lead to GDI crash) - and 32-bit mode (lead to black window). The cColorBits - filed of the PIXELFORMATDESCRIPTOR returned claims to - have 24 and 32 bits respectively of color indices. 2^24 - and 2^32 are ridiculously huge writable colormaps. - Assume that if we get back a color index - PIXELFORMATDESCRIPTOR with 24 or more bits, the - PIXELFORMATDESCRIPTOR doesn't really work and skip it. - -mjk */ - if (visual->iPixelType == PFD_TYPE_COLORINDEX - && visual->cColorBits >= 24) { - *value = 0; - } else { - *value = 1; - } - } else { - *value = 0; - } - break; - case GLX_BUFFER_SIZE: - /* KLUDGE: if we're RGBA, return the number of bits/pixel, - otherwise, return 8 (we guessed at 256 colors in CI - mode). */ - if (visual->iPixelType == PFD_TYPE_RGBA) - *value = visual->cColorBits; - else - *value = 8; - break; - case GLX_LEVEL: - /* The bReserved flag of the pfd contains the - overlay/underlay info. */ - *value = visual->bReserved; - break; - case GLX_RGBA: - *value = visual->iPixelType == PFD_TYPE_RGBA; - break; - case GLX_DOUBLEBUFFER: - *value = visual->dwFlags & PFD_DOUBLEBUFFER; - break; - case GLX_STEREO: - *value = visual->dwFlags & PFD_STEREO; - break; - case GLX_AUX_BUFFERS: - *value = visual->cAuxBuffers; - break; - case GLX_RED_SIZE: - *value = visual->cRedBits; - break; - case GLX_GREEN_SIZE: - *value = visual->cGreenBits; - break; - case GLX_BLUE_SIZE: - *value = visual->cBlueBits; - break; - case GLX_ALPHA_SIZE: - *value = visual->cAlphaBits; - break; - case GLX_DEPTH_SIZE: - *value = visual->cDepthBits; - break; - case GLX_STENCIL_SIZE: - *value = visual->cStencilBits; - break; - case GLX_ACCUM_RED_SIZE: - *value = visual->cAccumRedBits; - break; - case GLX_ACCUM_GREEN_SIZE: - *value = visual->cAccumGreenBits; - break; - case GLX_ACCUM_BLUE_SIZE: - *value = visual->cAccumBlueBits; - break; - case GLX_ACCUM_ALPHA_SIZE: - *value = visual->cAccumAlphaBits; - break; -#if POKA == 100 -#endif /* POKA == 100 */ - default: - return GLX_BAD_ATTRIB; - } - return 0; -} - - -XVisualInfo * glXChooseVisual(int mode) -{ int imode = 2; - if(mode & GLUT_DOUBLE) - imode = 1; - return - wglDescribePixelFormat(imode); -} - - -#if POKA -#endif /* POKA */ - diff --git a/src/glut/os2/os2_menu.cpp b/src/glut/os2/os2_menu.cpp deleted file mode 100644 index f140e9c79b..0000000000 --- a/src/glut/os2/os2_menu.cpp +++ /dev/null @@ -1,532 +0,0 @@ - -/* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */ -/* Copyright (c) Nate Robins, 1997. */ - -/* This program is freely distributable without licensing fees - and is provided without guarantee or warrantee expressed or - implied. This program is -not- in the public domain. */ - -/* This file completely re-implements glut_menu.c and glut_menu2.c - for Win32. Note that neither glut_menu.c nor glut_menu2.c are - compiled into Win32 GLUT. */ - -#include -#include -#include -#include -#include - -#include "glutint.h" - -void (GLUTCALLBACK *__glutMenuStatusFunc) (int, int, int); -//GLUTmenu *__glutMappedMenu; -//GLUTwindow *__glutMenuWindow; -GLUTmenuItem *__glutItemSelected; -unsigned __glutMenuButton; - -static GLUTmenu **menuList = NULL; -static int menuListSize = 0; -static UINT uniqueMenuHandler = 1; - -/* DEPRICATED, use glutMenuStatusFunc instead. */ -void GLUTAPIENTRY -glutMenuStateFunc(GLUTmenuStateCB menuStateFunc) -{ - __glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc; -} - -void GLUTAPIENTRY -glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc) -{ - __glutMenuStatusFunc = menuStatusFunc; -} - -void -__glutSetMenu(GLUTmenu * menu) -{ - __glutCurrentMenu = menu; -} - -static void -unmapMenu(GLUTmenu * menu) -{ - if (menu->cascade) { - unmapMenu(menu->cascade); - menu->cascade = NULL; - } - menu->anchor = NULL; - menu->highlighted = NULL; -} - -void -__glutFinishMenu(Window win, int x, int y) -{ - - unmapMenu(__glutMappedMenu); - - /* XXX Put in a GdiFlush just in case. Probably unnecessary. -mjk */ -// GdiFlush(); - - if (__glutMenuStatusFunc) { - __glutSetWindow(__glutMenuWindow); - __glutSetMenu(__glutMappedMenu); - - /* Setting __glutMappedMenu to NULL permits operations that - change menus or destroy the menu window again. */ - __glutMappedMenu = NULL; - - __glutMenuStatusFunc(GLUT_MENU_NOT_IN_USE, x, y); - } - /* Setting __glutMappedMenu to NULL permits operations that - change menus or destroy the menu window again. */ - __glutMappedMenu = NULL; - - /* If an item is selected and it is not a submenu trigger, - generate menu callback. */ - if (__glutItemSelected && !__glutItemSelected->isTrigger) { - __glutSetWindow(__glutMenuWindow); - /* When menu callback is triggered, current menu should be - set to the callback menu. */ - __glutSetMenu(__glutItemSelected->menu); - __glutItemSelected->menu->select(__glutItemSelected->value); - } - __glutMenuWindow = NULL; -} - -static void -mapMenu(GLUTmenu * menu, int x, int y) -{ -//todo -// TrackPopupMenu((HMENU) menu->win, TPM_LEFTALIGN | -// (__glutMenuButton == TPM_RIGHTBUTTON) ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON, -// x, y, 0, __glutCurrentWindow->win, NULL); -} - -void -__glutStartMenu(GLUTmenu * menu, GLUTwindow * window, - int x, int y, int x_win, int y_win) -{ - assert(__glutMappedMenu == NULL); - __glutMappedMenu = menu; - __glutMenuWindow = window; - __glutItemSelected = NULL; - if (__glutMenuStatusFunc) { - __glutSetMenu(menu); - __glutSetWindow(window); - __glutMenuStatusFunc(GLUT_MENU_IN_USE, x_win, y_win); - } - mapMenu(menu, x, y); -} - -GLUTmenuItem * -__glutGetUniqueMenuItem(GLUTmenu * menu, UINT unique) -{ - GLUTmenuItem *item; - int i; - - i = menu->num; - item = menu->list; - while (item) { - if (item->unique == unique) { - return item; - } - if (item->isTrigger) { - GLUTmenuItem *subitem; - subitem = __glutGetUniqueMenuItem(menuList[item->value], unique); - if (subitem) { - return subitem; - } - } - i--; - item = item->next; - } - return NULL; -} - -GLUTmenuItem * -__glutGetMenuItem(GLUTmenu * menu, Window win, int *which) -{ - GLUTmenuItem *item; - int i; - - i = menu->num; - item = menu->list; - while (item) { - if (item->win == win) { - *which = i; - return item; - } - if (item->isTrigger) { - GLUTmenuItem *subitem; - - subitem = __glutGetMenuItem(menuList[item->value], - win, which); - if (subitem) { - return subitem; - } - } - i--; - item = item->next; - } - return NULL; -} - -GLUTmenu * -__glutGetMenu(Window win) -{ - GLUTmenu *menu; - - menu = __glutMappedMenu; - while (menu) { - if (win == menu->win) { - return menu; - } - menu = menu->cascade; - } - return NULL; -} - -GLUTmenu * -__glutGetMenuByNum(int menunum) -{ - if (menunum < 1 || menunum > menuListSize) { - return NULL; - } - return menuList[menunum - 1]; -} - -static int -getUnusedMenuSlot(void) -{ - int i; - - /* Look for allocated, unused slot. */ - for (i = 0; i < menuListSize; i++) { - if (!menuList[i]) { - return i; - } - } - /* Allocate a new slot. */ - menuListSize++; - if (menuList) { - menuList = (GLUTmenu **) - realloc(menuList, menuListSize * sizeof(GLUTmenu *)); - } else { - /* XXX Some realloc's do not correctly perform a malloc - when asked to perform a realloc on a NULL pointer, - though the ANSI C library spec requires this. */ - menuList = (GLUTmenu **) malloc(sizeof(GLUTmenu *)); - } - if (!menuList) { - __glutFatalError("out of memory."); - } - menuList[menuListSize - 1] = NULL; - return menuListSize - 1; -} - -static void -menuModificationError(void) -{ - /* XXX Remove the warning after GLUT 3.0. */ - __glutWarning("The following is a new check for GLUT 3.0; update your code."); - __glutFatalError("menu manipulation not allowed while menus in use."); -} - -int GLUTAPIENTRY -glutCreateMenu(GLUTselectCB selectFunc) -{ - GLUTmenu *menu; - int menuid; - - if (__glutMappedMenu) { - menuModificationError(); - } - menuid = getUnusedMenuSlot(); - menu = (GLUTmenu *) malloc(sizeof(GLUTmenu)); - if (!menu) { - __glutFatalError("out of memory."); - } - menu->id = menuid; - menu->num = 0; - menu->submenus = 0; - menu->select = selectFunc; - menu->list = NULL; - menu->cascade = NULL; - menu->highlighted = NULL; - menu->anchor = NULL; -//todo -// menu->win = (HWND) CreatePopupMenu(); - menuList[menuid] = menu; - __glutSetMenu(menu); - return menuid + 1; -} - - -void GLUTAPIENTRY -glutDestroyMenu(int menunum) -{ - GLUTmenu *menu = __glutGetMenuByNum(menunum); - GLUTmenuItem *item, *next; - - if (__glutMappedMenu) { - menuModificationError(); - } - assert(menu->id == menunum - 1); -//todo DestroyMenu( (HMENU) menu->win); - menuList[menunum - 1] = NULL; - /* free all menu entries */ - item = menu->list; - while (item) { - assert(item->menu == menu); - next = item->next; - free(item->label); - free(item); - item = next; - } - if (__glutCurrentMenu == menu) { - __glutCurrentMenu = NULL; - } - free(menu); -} - -int GLUTAPIENTRY -glutGetMenu(void) -{ - if (__glutCurrentMenu) { - return __glutCurrentMenu->id + 1; - } else { - return 0; - } -} - -void GLUTAPIENTRY -glutSetMenu(int menuid) -{ - GLUTmenu *menu; - - if (menuid < 1 || menuid > menuListSize) { - __glutWarning("glutSetMenu attempted on bogus menu."); - return; - } - menu = menuList[menuid - 1]; - if (!menu) { - __glutWarning("glutSetMenu attempted on bogus menu."); - return; - } - __glutSetMenu(menu); -} - -static void -setMenuItem(GLUTmenuItem * item, const char *label, - int value, Bool isTrigger) -{ - GLUTmenu *menu; - - menu = item->menu; - item->label = __glutStrdup(label); - if (!item->label) { - __glutFatalError("out of memory."); - } - item->isTrigger = isTrigger; - item->len = (int) strlen(label); - item->value = value; - item->unique = uniqueMenuHandler++; -//todo -// if (isTrigger) { -// AppendMenu((HMENU) menu->win, MF_POPUP, (UINT)item->win, label); -// } else { -// AppendMenu((HMENU) menu->win, MF_STRING, item->unique, label); -// } -} - -void GLUTAPIENTRY -glutAddMenuEntry(const char *label, int value) -{ - GLUTmenuItem *entry; - - if (__glutMappedMenu) { - menuModificationError(); - } - entry = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); - if (!entry) { - __glutFatalError("out of memory."); - } - entry->menu = __glutCurrentMenu; - setMenuItem(entry, label, value, FALSE); - __glutCurrentMenu->num++; - entry->next = __glutCurrentMenu->list; - __glutCurrentMenu->list = entry; -} - -void GLUTAPIENTRY -glutAddSubMenu(const char *label, int menu) -{ - GLUTmenuItem *submenu; - GLUTmenu *popupmenu; - - if (__glutMappedMenu) { - menuModificationError(); - } - submenu = (GLUTmenuItem *) malloc(sizeof(GLUTmenuItem)); - if (!submenu) { - __glutFatalError("out of memory."); - } - __glutCurrentMenu->submenus++; - submenu->menu = __glutCurrentMenu; - popupmenu = __glutGetMenuByNum(menu); - if (popupmenu) { - submenu->win = popupmenu->win; - } - setMenuItem(submenu, label, /* base 0 */ menu - 1, TRUE); - __glutCurrentMenu->num++; - submenu->next = __glutCurrentMenu->list; - __glutCurrentMenu->list = submenu; -} - -void GLUTAPIENTRY -glutChangeToMenuEntry(int num, const char *label, int value) -{ - GLUTmenuItem *item; - int i; - - if (__glutMappedMenu) { - menuModificationError(); - } - i = __glutCurrentMenu->num; - item = __glutCurrentMenu->list; - while (item) { - if (i == num) { - if (item->isTrigger) { - /* If changing a submenu trigger to a menu entry, we - need to account for submenus. */ - item->menu->submenus--; - /* Nuke the Win32 menu. */ -//todo -// DestroyMenu((HMENU) item->win); - } - free(item->label); - - item->label = strdup(label); - if (!item->label) - __glutFatalError("out of memory"); - item->isTrigger = FALSE; - item->len = (int) strlen(label); - item->value = value; - item->unique = uniqueMenuHandler++; -//todo -// ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, -// MF_BYPOSITION | MFT_STRING, item->unique, label); - - return; - } - i--; - item = item->next; - } - __glutWarning("Current menu has no %d item.", num); -} - -void GLUTAPIENTRY -glutChangeToSubMenu(int num, const char *label, int menu) -{ - GLUTmenu *popupmenu; - GLUTmenuItem *item; - int i; - - if (__glutMappedMenu) { - menuModificationError(); - } - i = __glutCurrentMenu->num; - item = __glutCurrentMenu->list; - while (item) { - if (i == num) { - if (!item->isTrigger) { - /* If changing a menu entry to as submenu trigger, we - need to account for submenus. */ - item->menu->submenus++; -//todo -// item->win = (HWND) CreatePopupMenu(); - } - free(item->label); - - item->label = strdup(label); - if (!item->label) - __glutFatalError("out of memory"); - item->isTrigger = TRUE; - item->len = (int) strlen(label); - item->value = menu - 1; - item->unique = uniqueMenuHandler++; - popupmenu = __glutGetMenuByNum(menu); - if (popupmenu) - item->win = popupmenu->win; -//todo -// ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, -// MF_BYPOSITION | MF_POPUP, (UINT) item->win, label); - return; - } - i--; - item = item->next; - } - __glutWarning("Current menu has no %d item.", num); -} - -void GLUTAPIENTRY -glutRemoveMenuItem(int num) -{ - GLUTmenuItem *item, **prev; - int i; - - if (__glutMappedMenu) { - menuModificationError(); - } - i = __glutCurrentMenu->num; - prev = &__glutCurrentMenu->list; - item = __glutCurrentMenu->list; - while (item) { - if (i == num) { - /* Found the menu item in list to remove. */ - __glutCurrentMenu->num--; - - /* Patch up menu's item list. */ - *prev = item->next; -//todo -// RemoveMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, MF_BYPOSITION); - - free(item->label); - free(item); - return; - } - i--; - prev = &item->next; - item = item->next; - } - __glutWarning("Current menu has no %d item.", num); -} - -void GLUTAPIENTRY -glutAttachMenu(int button) -{ - if (__glutCurrentWindow == __glutGameModeWindow) { - __glutWarning("cannot attach menus in game mode."); - return; - } - if (__glutMappedMenu) { - menuModificationError(); - } - if (__glutCurrentWindow->menu[button] < 1) { - __glutCurrentWindow->buttonUses++; - } - __glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1; -} - -void GLUTAPIENTRY -glutDetachMenu(int button) -{ - if (__glutMappedMenu) { - menuModificationError(); - } - if (__glutCurrentWindow->menu[button] > 0) { - __glutCurrentWindow->buttonUses--; - __glutCurrentWindow->menu[button] = 0; - } -} - diff --git a/src/glut/os2/os2_winproc.cpp b/src/glut/os2/os2_winproc.cpp deleted file mode 100644 index 9cbdec1cd2..0000000000 --- a/src/glut/os2/os2_winproc.cpp +++ /dev/null @@ -1,1296 +0,0 @@ -/* os2_winproc.c */ - - -#define INCL_DEV -#include "WarpGL.h" -#include "GL/os2mesa.h" - - -#define _MEERROR_H_ -#include /* It is from MMPM toolkit */ -#include -#include - - -#include "os2mesadef.h" -#include "glutint.h" - - -#define POKA 0 - -#if POKA - -extern unsigned __glutMenuButton; -extern GLUTidleCB __glutIdleFunc; -extern GLUTtimer *__glutTimerList; -extern void handleTimeouts(void); -extern GLUTmenuItem *__glutGetUniqueMenuItem(GLUTmenu * menu, int unique); -static HMENU __glutHMenu; - -#endif - -extern void _mesa_ResizeBuffersMESA( void ); - - -MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); -MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); -void updateWindowState(GLUTwindow *window, int visState); - -volatile extern HAB hab; /* PM anchor block handle */ -volatile extern HPS hpsCurrent; - -RECTL rCtls[52]; -ULONG ulNumRcls; - -MRESULT EXPENTRY GlutWindowChildProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) -{ MRESULT rc; - rc = GlutWindowProc(hwnd, msg, mp1, mp2 ); - return rc; -} - -MRESULT EXPENTRY GlutWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) -{ - HPS hps = NULLHANDLE; /* presentation space handle */ - GLUTwindow* window; /* GLUT window associated with message. */ - GLUTmenu* menu; /* GLUT menu associated with message. */ - RECTL rclClient; - POINTL point; - int button = -1,rc,key; - - -/* Process the message. */ - - switch( msg ) - { - case WM_CREATE: - { - SIZEL sizl = { 0L, 0L }; - LONG *alCaps; - HDC hdc; - - /*+-----------------------------------------------------------------+*/ - /*| The client window is being created. Create the semaphore to |*/ - /*| control access to the presentation space. Then create the |*/ - /*| thread that will draw the lines. |*/ - /*+-----------------------------------------------------------------+*/ - // DosCreateMutexSem( (PSZ)NULL, &hmtxPS, 0UL, FALSE ); - - hdc = WinOpenWindowDC(hwnd); - - /*+-----------------------------------------------------------------+*/ - /*| Create a non-cached presentation space. We will not release |*/ - /*| this PS, as we will be Selecting a Palette to this PS and then |*/ - /*| animating the palette. Upon releasing a PS the palette is no |*/ - /*| longer selected for obvious reasons. |*/ - /*+-----------------------------------------------------------------+*/ - hpsCurrent = GpiCreatePS( hab, - hdc, - &sizl, - PU_PELS | GPIF_DEFAULT | - GPIT_MICRO | GPIA_ASSOC ); -// DevQueryCaps( hdc, lStart, lCount, alCaps ); -// fPaletteCaps = alCaps[CAPS_ADDITIONAL_GRAPHICS] & CAPS_PALETTE_MANAGER; -// PaletteInit(3); - /* ¯¥p¥¢®¤ hpsBuffer ¢ p¥¦¨¬ RGB color table */ - - GpiCreateLogColorTable(hpsCurrent,0 ,LCOLF_RGB,0,0,NULL); - GpiSetPattern(hpsCurrent,PATSYM_SOLID); - GpiSetPatternSet(hpsCurrent,LCID_DEFAULT); - - } - break; - - return 0; - case WM_CLOSE: - WinPostMsg( hwnd, WM_QUIT, NULL, NULL ); - - return 0; - - case WM_PAINT: - window = __glutGetWindow(hwnd); - if (window) - { - PWMC ctx; -// hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient); - hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient); - // blit Dive buffer to screen. - - { - SWP swp; // Window position - POINTL pointl; // Point to offset from Desktop - - // Convert the point to offset from desktop lower left. - pointl.x = 0; - pointl.y = 0; - WinMapWindowPoints ( hwnd, HWND_DESKTOP, &pointl, 1 ); - - -// ctx = window->ctx; -// ctx->xDiveScr = pointl.x; -// ctx->yDiveScr = pointl.y; - } -// rc = DiveBlitImage (ctx->hDive, -// ctx->ulDiveBufferNumber, -// DIVE_BUFFER_SCREEN ); -// - - if (window->win == hwnd) { - __glutPostRedisplay(window, GLUT_REPAIR_WORK); - } else if (window->overlay && window->overlay->win == hwnd) { - __glutPostRedisplay(window, GLUT_OVERLAY_REPAIR_WORK); - } - WinEndPaint(hps); - } else { - - hps = WinBeginPaint(hwnd,NULLHANDLE,&rclClient); - WinFillRect(hps, &rclClient, CLR_WHITE); - WinEndPaint(hps); - } - break; - - case WM_VRNDISABLED: - -// pwinData->fDataInProcess = TRUE; -// DiveSetupBlitter ( pwinData->hDive, 0 ); -// pwinData->fVrnDisabled = TRUE; - break; - - case WM_VRNENABLED: - { HRGN hrgn; /* Region handle */ - RGNRECT rgnCtl; /* Processing control structure */ -// RECTL rCtls[52]; -// ULONG ulNumRcls; - -// pwinData->fDataInProcess = TRUE; - hps = WinGetPS ( hwnd ); - if ( !hps ) - break; - hrgn = GpiCreateRegion ( hps, 0L, NULL ); - if ( hrgn ) - { /* NOTE: If mp1 is zero, then this was just a move message. - ** Illustrate the visible region on a WM_VRNENABLE. - */ - WinQueryVisibleRegion ( hwnd, hrgn ); - rgnCtl.ircStart = 0; - rgnCtl.crc = 50; - rgnCtl.ulDirection = 1; - - /* Get the all ORed rectangles */ - if ( GpiQueryRegionRects ( hps, hrgn, NULL, - &rgnCtl, rCtls) ) - { - ulNumRcls = rgnCtl.crcReturned; - - /* Now find the window position and size, relative to parent. - */ -// WinQueryWindowPos ( pwinData->hwndClient, &pwinData->swp ); - -// rcl.xLeft = 0; -// rcl.yBottom = 0; - - /* Convert the point to offset from desktop lower left. - */ -// pointl.x = pwinData->swp.x; -// pointl.y = pwinData->swp.y; - -// WinMapWindowPoints ( pwinData->hwndFrame, -// HWND_DESKTOP, &pointl, 1 ); - -// pwinData->cxWindowPos = pointl.x; -// pwinData->cyWindowPos = pointl.y; - - } - GpiDestroyRegion( hps, hrgn ); - } - WinReleasePS( hps ); - - } - break; - - case WM_SIZE: - window = __glutGetWindow(hwnd); - if (window) - { int width,height; - width = SHORT1FROMMP(mp2); - height = SHORT2FROMMP(mp2); - if (width != window->width || height != window->height) { -#if 0 /* Win32 GLUT does not support overlays for now. */ - if (window->overlay) { - XResizeWindow(__glutDisplay, window->overlay->win, width, height); - } -#endif - window->width = width; - window->height = height; - __glutSetWindow(window); - if(width <= 0 || height <= 0) - break; - _mesa_ResizeBuffersMESA(); - - /* Do not execute OpenGL out of sequence with respect - to the SetWindowPos request! */ - window->reshape(width, height); - window->forceReshape = FALSE; - /* A reshape should be considered like posting a - repair request. */ - __glutPostRedisplay(window, GLUT_REPAIR_WORK); - } - } - return 0; - case WM_SHOW: - window = __glutGetWindow(hwnd); - if (window) { - int visState; - visState = SHORT1FROMMP( mp1 ); - updateWindowState(window, visState); - } - return 0; - - case WM_ACTIVATE: - window = __glutGetWindow(hwnd); -// /* Make sure we re-select the correct palette if needed. */ -// if (LOWORD(wParam)) { -// PostMessage(hwnd, WM_PALETTECHANGED, 0, 0); -// } - if (window) { - int visState; - visState = SHORT1FROMMP( mp1 ); - updateWindowState(window, visState); - } - return 0; - - case WM_CHAR: - { USHORT fsflags; - window = __glutGetWindow(hwnd); - if (!window) { - break; - } - fsflags = SHORT1FROMMP(mp1); -/* ?? */ - if((fsflags & KC_KEYUP) ) /* ¨£­®p¨p㥬 ®â¦ â¨¥ ª­®¯ª¨, p¥ £¨p㥬 ⮫쪮 ­  ­ ¦ â¨¥ */ - break; -/////////////////////////////////////////////////// - if(!(fsflags & KC_CHAR) ) - { - if (!(fsflags & KC_VIRTUALKEY)) - break; - key = 0; - /* Get the virtual key from mp2. */ - switch (SHORT2FROMMP(mp2)) - { -/* directional keys */ - case VK_LEFT: key = GLUT_KEY_LEFT; break; - case VK_UP: key = GLUT_KEY_UP; break; - case VK_RIGHT: key = GLUT_KEY_RIGHT; break; - case VK_DOWN: key = GLUT_KEY_DOWN; break; - - case VK_PAGEUP: key = GLUT_KEY_PAGE_UP; break; - case VK_PAGEDOWN:key = GLUT_KEY_PAGE_DOWN; break; - case VK_HOME: key = GLUT_KEY_HOME;break; - case VK_END: key = GLUT_KEY_END; break; - case VK_INSERT: key = GLUT_KEY_INSERT; break; - -/* function keys */ - case VK_F1 : key = GLUT_KEY_F1; break; - case VK_F2 : key = GLUT_KEY_F2; break; - case VK_F3 : key = GLUT_KEY_F3; break; - case VK_F4 : key = GLUT_KEY_F4; break; - case VK_F5 : key = GLUT_KEY_F5; break; - case VK_F6 : key = GLUT_KEY_F6; break; - case VK_F7 : key = GLUT_KEY_F7; break; - case VK_F8 : key = GLUT_KEY_F8; break; - case VK_F9 : key = GLUT_KEY_F9; break; - case VK_F10: key = GLUT_KEY_F10;break; - case VK_F11: key = GLUT_KEY_F11; break; - case VK_F12: key = GLUT_KEY_F12; break; - case VK_ESC: key = -1; break; /* Character codes */ - case VK_SPACE: key = -1; break; - case VK_TAB: key = -1; break; - } - if(!key) - { break; /* Key Not implemented */ - } - if(key > 0) - { if (!window->special) /* ­¥ ãáâ ­®¢«¥­® ®¡à ¡®â稪  */ - break; - - WinQueryPointerPos(HWND_DESKTOP,&point); - ScreenToClient(window->win, &point); - __glutSetWindow(window); - __glutModifierMask = 0; - if(WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* high order bit is on */ - __glutModifierMask |= ShiftMask; - if(WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) - __glutModifierMask |= ControlMask; - if(WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) - __glutModifierMask |= Mod1Mask; - window->special(key, point.x, point.y); - __glutModifierMask = (unsigned int) ~0; - return 0; - } - - } -///////////////////////////////////////////////////// - /* If we are ignoring auto repeated key strokes for the window, bail. */ - if (window->ignoreKeyRepeat && (CHAR3FROMMP(mp1)) ) - break; - if(!((unsigned char)SHORT1FROMMP(mp2)) ) /* ¨£­®p¨p㥬 ­¥á¨¬¢®«ì­ë¥ ª®¤ë */ - break; - if (window->keyboard) { - WinQueryPointerPos(HWND_DESKTOP,&point); - - ScreenToClient(window->win, &point); - __glutSetWindow(window); - __glutModifierMask = 0; - if(WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* high order bit is on */ - __glutModifierMask |= ShiftMask; - if(WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) - __glutModifierMask |= ControlMask; - if(WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) - __glutModifierMask |= Mod1Mask; - window->keyboard((unsigned char)SHORT1FROMMP(mp2), point.x, point.y); - __glutModifierMask = (unsigned int) ~0; - } - return 0; - } /* endof case WM_CHAR: */ -//////////////////////////////////////////////// - case WM_BUTTON1DOWN: - button = GLUT_LEFT_BUTTON; - case WM_BUTTON3DOWN: - if (button < 0) - button = GLUT_MIDDLE_BUTTON; - case WM_BUTTON2DOWN: - if (button < 0) - button = GLUT_RIGHT_BUTTON; - { POINTS psh; - psh = *((POINTS *)&mp1); - point.x = psh.x; - point.y = psh.y; - } - /* finish the menu if we get a button down message (user must have - cancelled the menu). */ - if (__glutMappedMenu) { - /* TODO: take this out once the menu on middle mouse stuff works - properly. */ - if (button == GLUT_MIDDLE_BUTTON) - return 0; - /* get current mouse pointer position */ -// WinQueryPointerPos(HWND_DESKTOP,&point); - /* map from desktop to client window */ -// WinMapWindowPoints(HWND_DESKTOP, hwnd, &point, 1); - __glutItemSelected = NULL; - __glutFinishMenu(hwnd, point.x, point.y); - return 0; - } - window = __glutGetWindow(hwnd); - if (window) { - window->buttonDownState = button+1; - menu = __glutGetMenuByNum(window->menu[button]); - if (menu) { -//todo -// __glutMenuButton = button == GLUT_RIGHT_BUTTON ? TPM_RIGHTBUTTON : -// button == GLUT_LEFT_BUTTON ? TPM_LEFTBUTTON : -// 0x0001; -// __glutStartMenu(menu, window, point.x, point.y, x, y); - } else if (window->mouse) { - - __glutSetWindow(window); - __glutModifierMask = 0; - if (WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* < 0 = high order bit is on. */ - __glutModifierMask |= ShiftMask; - if (WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) - __glutModifierMask |= ControlMask; - if (WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) - __glutModifierMask |= Mod1Mask; - window->mouse(button, GLUT_DOWN, point.x, point.y); - __glutModifierMask = (unsigned int)~0; - } else { - /* Stray mouse events. Ignore. */ - } - } - return 0; - - break; -/********************************************/ - case WM_BUTTON1UP: - button = GLUT_LEFT_BUTTON; - case WM_BUTTON3UP: - if (button < 0) - button = GLUT_MIDDLE_BUTTON; - case WM_BUTTON2UP: - if (button < 0) - button = GLUT_RIGHT_BUTTON; - { POINTS psh; - psh = *((POINTS *)&mp1); - point.x = psh.x; - point.y = psh.y; - } - /* Bail out if we're processing a menu. */ - /* Bail out = ¢ë¡à®á¨âìáï á ¯ à èã⮬ */ - if (__glutMappedMenu) { - WinQueryPointerPos(HWND_DESKTOP,&point); - WinMapWindowPoints(HWND_DESKTOP, hwnd, &point, 1); - /* if we're getting the middle button up signal, then something - on the menu was selected. */ - if (button == GLUT_MIDDLE_BUTTON) { - return 0; - /* For some reason, the code below always returns -1 even - though the point IS IN THE ITEM! Therefore, just bail out if - we get a middle mouse up. The user must select using the - left mouse button. Stupid Win32. */ -#if 0 - int item = MenuItemFromPoint(hwnd, __glutHMenu, point); - if (item != -1) - __glutItemSelected = (GLUTmenuItem*)GetMenuItemID(__glutHMenu, item); - else - __glutItemSelected = NULL; - __glutFinishMenu(hwnd, point.x, point.y); -#endif - } else { - __glutItemSelected = NULL; - __glutFinishMenu(hwnd, point.x, point.y); - } - return 0; - } - - window = __glutGetWindow(hwnd); - if(window) - window->buttonDownState = 0; - - if (window && window->mouse) { - __glutSetWindow(window); - __glutModifierMask = 0; - if (WinGetKeyState(HWND_DESKTOP,VK_SHIFT) & 0x8000) /* < 0 = high order bit is on */ - __glutModifierMask |= ShiftMask; - if (WinGetKeyState(HWND_DESKTOP,VK_CTRL) & 0x8000) - __glutModifierMask |= ControlMask; - if (WinGetKeyState(HWND_DESKTOP,VK_MENU) & 0x8000) - __glutModifierMask |= Mod1Mask; - window->mouse(button, GLUT_UP, point.x, point.y); - - __glutModifierMask = (unsigned int)~0; - } else { - /* Window might have been destroyed and all the - events for the window may not yet be received. */ - } - return 0; - - - break; -////////////////////////////////////////////////// - case WM_COMMAND: - window = __glutGetWindow(hwnd); - if (window) - { if (window->wm_command) - window->wm_command(hwnd,mp1,mp2); - } - break; - - case WM_MOUSEMOVE: - if (!__glutMappedMenu) { - window = __glutGetWindow(hwnd); - if (window) { - /* If motion function registered _and_ buttons held * - down, call motion function... */ - { POINTS psh; - psh = *((POINTS *)&mp1); - point.x = psh.x; - point.y = psh.y; - } - - if (window->motion && window->buttonDownState) { - __glutSetWindow(window); - window->motion(point.x, point.y); - } - /* If passive motion function registered _and_ - buttons not held down, call passive motion - function... */ - else if (window->passive && !window->buttonDownState) { - __glutSetWindow(window); - window->passive(point.x, point.y); - } - } - } else { - /* Motion events are thrown away when a pop up menu is - active. */ - } - return 0; - - - default: - /* For all other messages, let the default window procedure process them. */ - return ( WinDefWindowProc( hwnd, msg, mp1, mp2 ) ); - - } //endof switch( msg ) - return ( WinDefWindowProc( hwnd, msg, mp1, mp2 ) ); -// return NULL; -} - -void APIENTRY glutCommandFunc(GLUTcommandCB Func) -{ -extern GLUTwindow *__glutCurrentWindow; - __glutCurrentWindow->wm_command = Func; -} - - - - -void -updateWindowState(GLUTwindow *window, int visState) -{ - GLUTwindow* child; - - /* XXX shownState and visState are the same in Win32. */ - window->shownState = visState; - if (visState != window->visState) { - if (window->windowStatus) { - window->visState = visState; - __glutSetWindow(window); - window->windowStatus(visState); - } - } - /* Since Win32 only sends an activate for the toplevel window, - update the visibility for all the child windows. */ - child = window->children; - while (child) { - updateWindowState(child, visState); - child = child->siblings; - } -} - -#if POKA - -LONG WINAPI -__glutWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - POINT point; /* Point structure. */ - PAINTSTRUCT ps; /* Paint structure. */ - LPMINMAXINFO minmax; /* Minimum/maximum info structure. */ - GLUTwindow* window; /* GLUT window associated with message. */ - GLUTmenu* menu; /* GLUT menu associated with message. */ - int x, y, width, height, key; - int button = -1; - - switch(msg) { - case WM_CREATE: - return 0; - case WM_CLOSE: - PostQuitMessage(0); - return 0; -#if 0 - case WM_DESTROY: - /* XXX NVidia's NT OpenGL can have problems closing down - its OpenGL internal data structures if we just allow - the process to terminate without unbinding and deleting - the windows context. Apparently, DirectDraw unloads - before OPENGL32.DLL in the close down sequence, but - NVidia's NT OpenGL needs DirectDraw to close down its - data structures. */ - window = __glutGetWindow(hwnd); - if (window) { - if (window->ctx) { - wglMakeCurrent(NULL, NULL); - wglDeleteContext(window->ctx); - } - } - return 0; -#endif - - case WM_SYSKEYUP: - case WM_KEYUP: - window = __glutGetWindow(hwnd); - if (!window) { - break; - } - /* Win32 is dumb and sends these messages only to the parent - window. Therefore, find out if we're in a child window and - call the child windows keyboard callback if we are. */ - if (window->parent) { - GetCursorPos(&point); - ScreenToClient(hwnd, &point); - hwnd = ChildWindowFromPoint(hwnd, point); - window = __glutGetWindow(hwnd); - } - if (window->specialUp || window->keyboardUp) { - GetCursorPos(&point); - ScreenToClient(window->win, &point); - __glutSetWindow(window); - __glutModifierMask = 0; - if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ - __glutModifierMask |= ShiftMask; - if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ - __glutModifierMask |= ControlMask; - if (GetKeyState(VK_MENU) < 0) - __glutModifierMask |= Mod1Mask; - switch (wParam) { - /* *INDENT-OFF* */ - case VK_F1: key = GLUT_KEY_F1; break; - case VK_F2: key = GLUT_KEY_F2; break; - case VK_F3: key = GLUT_KEY_F3; break; - case VK_F4: key = GLUT_KEY_F4; break; - case VK_F5: key = GLUT_KEY_F5; break; - case VK_F6: key = GLUT_KEY_F6; break; - case VK_F7: key = GLUT_KEY_F7; break; - case VK_F8: key = GLUT_KEY_F8; break; - case VK_F9: key = GLUT_KEY_F9; break; - case VK_F10: key = GLUT_KEY_F10; break; - case VK_F11: key = GLUT_KEY_F11; break; - case VK_F12: key = GLUT_KEY_F12; break; - case VK_LEFT: key = GLUT_KEY_LEFT; break; - case VK_UP: key = GLUT_KEY_UP; break; - case VK_RIGHT: key = GLUT_KEY_RIGHT; break; - case VK_DOWN: key = GLUT_KEY_DOWN; break; - case VK_PRIOR: key = GLUT_KEY_PAGE_UP; break; - case VK_NEXT: key = GLUT_KEY_PAGE_DOWN; break; - case VK_HOME: key = GLUT_KEY_HOME; break; - case VK_END: key = GLUT_KEY_END; break; - case VK_INSERT: key = GLUT_KEY_INSERT; break; - case VK_DELETE: - /* Delete is an ASCII character. */ - if (window->keyboardUp) { - window->keyboardUp((unsigned char) 127, point.x, point.y); - } - return 0; - /* *INDENT-ON* */ - default: - if (window->keyboardUp) { - key = MapVirtualKey(wParam, 2); /* Map to ASCII. */ - if (isascii(key) && (key != 0)) { - - /* XXX Attempt to determine modified ASCII character - is quite incomplete. Digits, symbols, CapsLock, - Ctrl, and numeric keypad are all ignored. Fix this. */ - - if (!(__glutModifierMask & ShiftMask)) - key = tolower(key); - window->keyboardUp((unsigned char) key, point.x, point.y); - } - } - __glutModifierMask = (unsigned int) ~0; - return 0; - } - if (window->specialUp) { - window->specialUp(key, point.x, point.y); - } - __glutModifierMask = (unsigned int) ~0; - } - return 0; - - case WM_SYSCHAR: - case WM_CHAR: - window = __glutGetWindow(hwnd); - if (!window) { - break; - } - - /* Bit 30 of lParam is set if key already held down. If - we are ignoring auto repeated key strokes for the window, bail. */ - if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) { - break; - } - - /* Win32 is dumb and sends these messages only to the parent - window. Therefore, find out if we're in a child window and - call the child windows keyboard callback if we are. */ - if (window->parent) { - GetCursorPos(&point); - ScreenToClient(hwnd, &point); - hwnd = ChildWindowFromPoint(hwnd, point); - window = __glutGetWindow(hwnd); - } - if (window->keyboard) { - GetCursorPos(&point); - ScreenToClient(window->win, &point); - __glutSetWindow(window); - __glutModifierMask = 0; - if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ - __glutModifierMask |= ShiftMask; - if (GetKeyState(VK_CONTROL) < 0) - __glutModifierMask |= ControlMask; - if (GetKeyState(VK_MENU) < 0) - __glutModifierMask |= Mod1Mask; - window->keyboard((unsigned char)wParam, point.x, point.y); - __glutModifierMask = (unsigned int) ~0; - } - return 0; - - case WM_SYSKEYDOWN: - case WM_KEYDOWN: - window = __glutGetWindow(hwnd); - if (!window) { - break; - } - - /* Bit 30 of lParam is set if key already held down. If - we are ignoring auto repeated key strokes for the window, bail. */ - if (window->ignoreKeyRepeat && (lParam & (1 << 30)) ) { - break; - } - - /* Win32 is dumb and sends these messages only to the parent - window. Therefore, find out if we're in a child window and - call the child windows keyboard callback if we are. */ - if (window->parent) { - GetCursorPos(&point); - ScreenToClient(hwnd, &point); - hwnd = ChildWindowFromPoint(hwnd, point); - window = __glutGetWindow(hwnd); - } - if (window->special) { - switch (wParam) { - /* *INDENT-OFF* */ - /* function keys */ - case VK_F1: key = GLUT_KEY_F1; break; - case VK_F2: key = GLUT_KEY_F2; break; - case VK_F3: key = GLUT_KEY_F3; break; - case VK_F4: key = GLUT_KEY_F4; break; - case VK_F5: key = GLUT_KEY_F5; break; - case VK_F6: key = GLUT_KEY_F6; break; - case VK_F7: key = GLUT_KEY_F7; break; - case VK_F8: key = GLUT_KEY_F8; break; - case VK_F9: key = GLUT_KEY_F9; break; - case VK_F10: key = GLUT_KEY_F10; break; - case VK_F11: key = GLUT_KEY_F11; break; - case VK_F12: key = GLUT_KEY_F12; break; - /* directional keys */ - case VK_LEFT: key = GLUT_KEY_LEFT; break; - case VK_UP: key = GLUT_KEY_UP; break; - case VK_RIGHT: key = GLUT_KEY_RIGHT; break; - case VK_DOWN: key = GLUT_KEY_DOWN; break; - /* *INDENT-ON* */ - - case VK_PRIOR: - /* VK_PRIOR is Win32's Page Up */ - key = GLUT_KEY_PAGE_UP; - break; - case VK_NEXT: - /* VK_NEXT is Win32's Page Down */ - key = GLUT_KEY_PAGE_DOWN; - break; - case VK_HOME: - key = GLUT_KEY_HOME; - break; - case VK_END: - key = GLUT_KEY_END; - break; - case VK_INSERT: - key = GLUT_KEY_INSERT; - break; - case VK_DELETE: - goto handleDelete; - default: - goto defproc; - } - GetCursorPos(&point); - ScreenToClient(window->win, &point); - __glutSetWindow(window); - __glutModifierMask = 0; - if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ - __glutModifierMask |= ShiftMask; - if (GetKeyState(VK_CONTROL) < 0) - __glutModifierMask |= ControlMask; - if (GetKeyState(VK_MENU) < 0) - __glutModifierMask |= Mod1Mask; - window->special(key, point.x, point.y); - __glutModifierMask = (unsigned int) ~0; - } else if (window->keyboard) { - /* Specially handle any keys that match ASCII values but - do not generate Windows WM_SYSCHAR or WM_CHAR messages. */ - switch (wParam) { - case VK_DELETE: - handleDelete: - /* Delete is an ASCII character. */ - GetCursorPos(&point); - ScreenToClient(window->win, &point); - __glutSetWindow(window); - __glutModifierMask = 0; - if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ - __glutModifierMask |= ShiftMask; - if (GetKeyState(VK_CONTROL) < 0) - __glutModifierMask |= ControlMask; - if (GetKeyState(VK_MENU) < 0) - __glutModifierMask |= Mod1Mask; - window->keyboard((unsigned char) 127, point.x, point.y); - __glutModifierMask = (unsigned int) ~0; - return 0; - default: - /* Let the following WM_SYSCHAR or WM_CHAR message generate - the keyboard callback. */ - break; - } - } - return 0; - - case WM_LBUTTONDOWN: - button = GLUT_LEFT_BUTTON; - case WM_MBUTTONDOWN: - if (button < 0) - button = GLUT_MIDDLE_BUTTON; - case WM_RBUTTONDOWN: - if (button < 0) - button = GLUT_RIGHT_BUTTON; - - /* finish the menu if we get a button down message (user must have - cancelled the menu). */ - if (__glutMappedMenu) { - /* TODO: take this out once the menu on middle mouse stuff works - properly. */ - if (button == GLUT_MIDDLE_BUTTON) - return 0; - GetCursorPos(&point); - ScreenToClient(hwnd, &point); - __glutItemSelected = NULL; - __glutFinishMenu(hwnd, point.x, point.y); - return 0; - } - - /* set the capture so we can get mouse events outside the window */ - SetCapture(hwnd); - - /* Win32 doesn't return the same numbers as X does when the mouse - goes beyond the upper or left side of the window. roll the - Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */ - x = LOWORD(lParam); - y = HIWORD(lParam); - if(x & 1 << 15) x -= (1 << 16); - if(y & 1 << 15) y -= (1 << 16); - - window = __glutGetWindow(hwnd); - if (window) { - menu = __glutGetMenuByNum(window->menu[button]); - if (menu) { - point.x = LOWORD(lParam); point.y = HIWORD(lParam); - ClientToScreen(window->win, &point); - __glutMenuButton = button == GLUT_RIGHT_BUTTON ? TPM_RIGHTBUTTON : - button == GLUT_LEFT_BUTTON ? TPM_LEFTBUTTON : - 0x0001; - __glutStartMenu(menu, window, point.x, point.y, x, y); - } else if (window->mouse) { - - __glutSetWindow(window); - __glutModifierMask = 0; - if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on. */ - __glutModifierMask |= ShiftMask; - if (GetKeyState(VK_CONTROL) < 0) - __glutModifierMask |= ControlMask; - if (GetKeyState(VK_MENU) < 0) - __glutModifierMask |= Mod1Mask; - window->mouse(button, GLUT_DOWN, x, y); - __glutModifierMask = (unsigned int)~0; - } else { - /* Stray mouse events. Ignore. */ - } - } - return 0; - - case WM_LBUTTONUP: - button = GLUT_LEFT_BUTTON; - case WM_MBUTTONUP: - if (button < 0) - button = GLUT_MIDDLE_BUTTON; - case WM_RBUTTONUP: - if (button < 0) - button = GLUT_RIGHT_BUTTON; - - /* Bail out if we're processing a menu. */ - if (__glutMappedMenu) { - GetCursorPos(&point); - ScreenToClient(hwnd, &point); - /* if we're getting the middle button up signal, then something - on the menu was selected. */ - if (button == GLUT_MIDDLE_BUTTON) { - return 0; - /* For some reason, the code below always returns -1 even - though the point IS IN THE ITEM! Therefore, just bail out if - we get a middle mouse up. The user must select using the - left mouse button. Stupid Win32. */ -#if 0 - int item = MenuItemFromPoint(hwnd, __glutHMenu, point); - if (item != -1) - __glutItemSelected = (GLUTmenuItem*)GetMenuItemID(__glutHMenu, item); - else - __glutItemSelected = NULL; - __glutFinishMenu(hwnd, point.x, point.y); -#endif - } else { - __glutItemSelected = NULL; - __glutFinishMenu(hwnd, point.x, point.y); - } - return 0; - } - - /* Release the mouse capture. */ - ReleaseCapture(); - - window = __glutGetWindow(hwnd); - if (window && window->mouse) { - /* Win32 doesn't return the same numbers as X does when the - mouse goes beyond the upper or left side of the window. roll - the Win32's 0..2^16 pointer co-ord range to 0 +/- 2^15. */ - x = LOWORD(lParam); - y = HIWORD(lParam); - if(x & 1 << 15) x -= (1 << 16); - if(y & 1 << 15) y -= (1 << 16); - - __glutSetWindow(window); - __glutModifierMask = 0; - if (GetKeyState(VK_SHIFT) < 0) /* < 0 = high order bit is on */ - __glutModifierMask |= ShiftMask; - if (GetKeyState(VK_CONTROL) < 0) - __glutModifierMask |= ControlMask; - if (GetKeyState(VK_MENU) < 0) - __glutModifierMask |= Mod1Mask; - window->mouse(button, GLUT_UP, x, y); - __glutModifierMask = (unsigned int)~0; - } else { - /* Window might have been destroyed and all the - events for the window may not yet be received. */ - } - return 0; - - case WM_ENTERMENULOOP: - /* KLUDGE: create a timer that fires every 100 ms when we start a - menu so that we can still process the idle & timer events (that - way, the timers will fire during a menu pick and so will the - idle func. */ - SetTimer(hwnd, 1, 1, NULL); - return 0; - - case WM_TIMER: -#if 0 - /* If the timer id is 2, then this is the timer that is set up in - the main glut message processing loop, and we don't want to do - anything but acknowledge that we got it. It is used to prevent - CPU spiking when an idle function is installed. */ - if (wParam == 2) - return 0; -#endif - - /* only worry about the idle function and the timeouts, since - these are the only events we expect to process during - processing of a menu. */ - /* we no longer process the idle functions (as outlined in the - README), since drawing can't be done until the menu has - finished...it's pretty lame when the animation goes on, but - doesn't update, so you get this weird jerkiness. */ -#if 0 - if (__glutIdleFunc) - __glutIdleFunc(); -#endif - if (__glutTimerList) - handleTimeouts(); - return 0; - - case WM_EXITMENULOOP: - /* nuke the above created timer...we don't need it anymore, since - the menu is gone now. */ - KillTimer(hwnd, 1); - return 0; - - case WM_MENUSELECT: - if (lParam != 0) - __glutHMenu = (HMENU)lParam; - return 0; - - case WM_COMMAND: - if (__glutMappedMenu) { - if (GetSubMenu(__glutHMenu, LOWORD(wParam))) - __glutItemSelected = NULL; - else - __glutItemSelected = - __glutGetUniqueMenuItem(__glutMappedMenu, LOWORD(wParam)); - GetCursorPos(&point); - ScreenToClient(hwnd, &point); - __glutFinishMenu(hwnd, point.x, point.y); - } - return 0; - - case WM_MOUSEMOVE: - if (!__glutMappedMenu) { - window = __glutGetWindow(hwnd); - if (window) { - /* If motion function registered _and_ buttons held * - down, call motion function... */ - x = LOWORD(lParam); - y = HIWORD(lParam); - - /* Win32 doesn't return the same numbers as X does when the - mouse goes beyond the upper or left side of the window. - roll the Win32's 0..2^16 pointer co-ord range to 0..+/-2^15. */ - if(x & 1 << 15) x -= (1 << 16); - if(y & 1 << 15) y -= (1 << 16); - - if (window->motion && wParam & - (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) { - __glutSetWindow(window); - window->motion(x, y); - } - /* If passive motion function registered _and_ - buttons not held down, call passive motion - function... */ - else if (window->passive && - ((wParam & - (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) == - 0)) { - __glutSetWindow(window); - window->passive(x, y); - } - } - } else { - /* Motion events are thrown away when a pop up menu is - active. */ - } - return 0; - - case WM_GETMINMAXINFO: - /* this voodoo is brought to you by Win32 (again). It allows the - window to be bigger than the screen, and smaller than 100x100 - (although it doesn't seem to help the y minimum). */ - minmax = (LPMINMAXINFO)lParam; - minmax->ptMaxSize.x = __glutScreenWidth; - minmax->ptMaxSize.y = __glutScreenHeight; - minmax->ptMinTrackSize.x = 0; - minmax->ptMinTrackSize.y = 0; - minmax->ptMaxTrackSize.x = __glutScreenWidth + - GetSystemMetrics(SM_CXSIZE) * 2; - minmax->ptMaxTrackSize.y = __glutScreenHeight + - GetSystemMetrics(SM_CXSIZE) * 2 + GetSystemMetrics(SM_CYCAPTION); - return 0; - - case WM_SIZE: - window = __glutGetWindow(hwnd); - if (window) { - width = LOWORD(lParam); - height = HIWORD(lParam); - if (width != window->width || height != window->height) { -#if 0 /* Win32 GLUT does not support overlays for now. */ - if (window->overlay) { - XResizeWindow(__glutDisplay, window->overlay->win, width, height); - } -#endif - window->width = width; - window->height = height; - __glutSetWindow(window); - /* Do not execute OpenGL out of sequence with respect - to the SetWindowPos request! */ - GdiFlush(); - window->reshape(width, height); - window->forceReshape = FALSE; - /* A reshape should be considered like posting a - repair request. */ - __glutPostRedisplay(window, GLUT_REPAIR_WORK); - } - } - return 0; - - case WM_SETCURSOR: - /* If the cursor is not in the client area, then we want to send - this message to the default window procedure ('cause its - probably in the border or title, and we don't handle that - cursor. otherwise, set our cursor. Win32 makes us set the - cursor every time the mouse moves (DUMB!). */ - if(LOWORD(lParam) != HTCLIENT) { - goto defproc; - } - window = __glutGetWindow(hwnd); - if (window) { - __glutSetCursor(window); - } - /* TODO: check out the info in DevStudio on WM_SETCURSOR in the - DefaultAction section. */ - return 1; - - case WM_SETFOCUS: - window = __glutGetWindow(hwnd); - if (window) { - window->entryState = WM_SETFOCUS; - if (window->entry) { - __glutSetWindow(window); - window->entry(GLUT_ENTERED); - /* XXX Generation of fake passive notify? See how much - work the X11 code does to support fake passive notify - callbacks. */ - } - if (window->joystick && __glutCurrentWindow) { - if (__glutCurrentWindow->joyPollInterval > 0) { - MMRESULT result; - - /* Because Win32 will only let one window capture the - joystick at a time, we must capture it when we get the - focus and release it when we lose the focus. */ - result = joySetCapture(__glutCurrentWindow->win, - JOYSTICKID1, 0, TRUE); - if (result != JOYERR_NOERROR) { - return 0; - } - (void) joySetThreshold(JOYSTICKID1, - __glutCurrentWindow->joyPollInterval); - } - } - } - return 0; - - case WM_KILLFOCUS: - window = __glutGetWindow(hwnd); - if (window) { - window->entryState = WM_KILLFOCUS; - if (window->entry) { - __glutSetWindow(window); - window->entry(GLUT_LEFT); - } - if (window->joystick && __glutCurrentWindow) { - if (__glutCurrentWindow->joyPollInterval > 0) { - /* Because Win32 will only let one window capture the - joystick at a time, we must capture it when we get the - focus and release it when we lose the focus. */ - (void) joyReleaseCapture(JOYSTICKID1); - } - } - } - return 0; - case WM_ACTIVATE: - window = __glutGetWindow(hwnd); - /* Make sure we re-select the correct palette if needed. */ - if (LOWORD(wParam)) { - PostMessage(hwnd, WM_PALETTECHANGED, 0, 0); - } - if (window) { - int visState; - - /* HIWORD(wParam) is the minimized flag. */ - visState = !HIWORD(wParam); - updateWindowState(window, visState); - } - return 0; - - /* Colour Palette Management */ - case WM_PALETTECHANGED: - if (hwnd == (HWND)wParam) { - /* Don't respond to the message that we sent! */ - break; - } - /* fall through to WM_QUERYNEWPALETTE */ - - case WM_QUERYNEWPALETTE: - window = __glutGetWindow(hwnd); - if (window && window->colormap) { - UnrealizeObject(window->colormap->cmap); - SelectPalette(window->hdc, window->colormap->cmap, FALSE); - RealizePalette(window->hdc); - return TRUE; - } - return FALSE; - - case MM_JOY1MOVE: - case MM_JOY1ZMOVE: - window = __glutGetWindow(hwnd); - if (window->joystick) { - JOYINFOEX jix; - int x, y, z; - - /* Because WIN32 only supports messages for X, Y, and Z - translations, we must poll for the rest */ - jix.dwSize = sizeof(jix); - jix.dwFlags = JOY_RETURNALL; - joyGetPosEx(JOYSTICKID1,&jix); - -#define SCALE(v) ((int) ((v - 32767)/32.768)) - - /* Convert to integer for scaling. */ - x = jix.dwXpos; - y = jix.dwYpos; - z = jix.dwZpos; - window->joystick(jix.dwButtons, SCALE(x), SCALE(y), SCALE(z)); - - return TRUE; - } - return FALSE; - case MM_JOY1BUTTONDOWN: - case MM_JOY1BUTTONUP: - window = __glutGetWindow(hwnd); - if (window->joystick) { - JOYINFOEX jix; - - /* Because WIN32 only supports messages for X, Y, and Z - translations, we must poll for the rest */ - jix.dwSize = sizeof(jix); - jix.dwFlags = JOY_RETURNALL; - joyGetPosEx(JOYSTICKID1,&jix); - - return TRUE; - } - return FALSE; - -#if 0 - /* Miscellaneous messages (don't really need to enumerate them, - but it's good to know what you're not getting sometimes). */ - case WM_DISPLAYCHANGE: - break; - case WM_NCHITTEST: - /* This event is generated by every mouse move event. */ - goto defproc; - case WM_NCMOUSEMOVE: - goto defproc; - case WM_NCACTIVATE: - goto defproc; - case WM_NCPAINT: - goto defproc; - case WM_NCCALCSIZE: - goto defproc; - case WM_NCCREATE: - goto defproc; - case WM_NCDESTROY: - goto defproc; - case WM_NCLBUTTONDOWN: - goto defproc; - case WM_SETTEXT: - goto defproc; - case WM_GETTEXT: - goto defproc; - case WM_ACTIVATEAPP: - goto defproc; - case WM_GETICON: - goto defproc; - case WM_ERASEBKGND: - goto defproc; - case WM_WINDOWPOSCHANGING: - goto defproc; - case WM_WINDOWPOSCHANGED: - goto defproc; - case WM_MOUSEACTIVATE: - goto defproc; - case WM_SHOWWINDOW: - goto defproc; - case WM_MOVING: - goto defproc; - case WM_MOVE: - goto defproc; - case WM_KEYUP: - goto defproc; - case WM_CAPTURECHANGED: - goto defproc; - case WM_SYSCOMMAND: - goto defproc; - case WM_ENTERSIZEMOVE: - goto defproc; - case WM_ENTERIDLE: - goto defproc; -#endif - - default: - goto defproc; - } - -defproc: - return DefWindowProc(hwnd, msg, wParam, lParam); -} - -#endif - -#if defined(__OS2PM__) -Bool __glutSetWindowText(Window window, char *text) -{ - return WinSetWindowText(window, (PCSZ)text); - -} - -#endif diff --git a/src/glut/os2/src-glut_os2pm.zip b/src/glut/os2/src-glut_os2pm.zip deleted file mode 100644 index 8c8a8c7ac4..0000000000 Binary files a/src/glut/os2/src-glut_os2pm.zip and /dev/null differ -- cgit v1.2.3 From 44f78eb18e851892f72b41be4119cf8b14cddbbb Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 25 Feb 2010 16:20:03 -0500 Subject: Remove unused mini and mesa glu subdirectories --- src/glu/mesa/Makefile | 56 -- src/glu/mesa/Makefile.m32 | 63 --- src/glu/mesa/Makefile.ugl | 96 ---- src/glu/mesa/MesaGLU.def | 62 --- src/glu/mesa/README1 | 195 ------- src/glu/mesa/README2 | 43 -- src/glu/mesa/all.h | 54 -- src/glu/mesa/glu.c | 416 -------------- src/glu/mesa/gluP.h | 97 ---- src/glu/mesa/mipmap.c | 829 ---------------------------- src/glu/mesa/nurbs.c | 628 --------------------- src/glu/mesa/nurbs.h | 252 --------- src/glu/mesa/nurbscrv.c | 444 --------------- src/glu/mesa/nurbssrf.c | 1317 --------------------------------------------- src/glu/mesa/nurbsutl.c | 1309 -------------------------------------------- src/glu/mesa/polytest.c | 937 -------------------------------- src/glu/mesa/project.c | 403 -------------- src/glu/mesa/quadric.c | 819 ---------------------------- src/glu/mesa/tess.c | 327 ----------- src/glu/mesa/tess.h | 107 ---- src/glu/mesa/tesselat.c | 406 -------------- src/glu/mini/all.h | 54 -- src/glu/mini/glu.c | 416 -------------- src/glu/mini/gluP.h | 141 ----- src/glu/mini/mipmap.c | 767 -------------------------- src/glu/mini/nurbs.c | 157 ------ src/glu/mini/nurbs.h | 252 --------- src/glu/mini/nurbscrv.c | 132 ----- src/glu/mini/polytest.c | 937 -------------------------------- src/glu/mini/project.c | 403 -------------- src/glu/mini/quadric.c | 773 -------------------------- src/glu/mini/tess.c | 327 ----------- src/glu/mini/tess.h | 107 ---- src/glu/mini/tesselat.c | 406 -------------- 34 files changed, 13732 deletions(-) delete mode 100644 src/glu/mesa/Makefile delete mode 100644 src/glu/mesa/Makefile.m32 delete mode 100644 src/glu/mesa/Makefile.ugl delete mode 100644 src/glu/mesa/MesaGLU.def delete mode 100644 src/glu/mesa/README1 delete mode 100644 src/glu/mesa/README2 delete mode 100644 src/glu/mesa/all.h delete mode 100644 src/glu/mesa/glu.c delete mode 100644 src/glu/mesa/gluP.h delete mode 100644 src/glu/mesa/mipmap.c delete mode 100644 src/glu/mesa/nurbs.c delete mode 100644 src/glu/mesa/nurbs.h delete mode 100644 src/glu/mesa/nurbscrv.c delete mode 100644 src/glu/mesa/nurbssrf.c delete mode 100644 src/glu/mesa/nurbsutl.c delete mode 100644 src/glu/mesa/polytest.c delete mode 100644 src/glu/mesa/project.c delete mode 100644 src/glu/mesa/quadric.c delete mode 100644 src/glu/mesa/tess.c delete mode 100644 src/glu/mesa/tess.h delete mode 100644 src/glu/mesa/tesselat.c delete mode 100644 src/glu/mini/all.h delete mode 100644 src/glu/mini/glu.c delete mode 100644 src/glu/mini/gluP.h delete mode 100644 src/glu/mini/mipmap.c delete mode 100644 src/glu/mini/nurbs.c delete mode 100644 src/glu/mini/nurbs.h delete mode 100644 src/glu/mini/nurbscrv.c delete mode 100644 src/glu/mini/polytest.c delete mode 100644 src/glu/mini/project.c delete mode 100644 src/glu/mini/quadric.c delete mode 100644 src/glu/mini/tess.c delete mode 100644 src/glu/mini/tess.h delete mode 100644 src/glu/mini/tesselat.c (limited to 'src') diff --git a/src/glu/mesa/Makefile b/src/glu/mesa/Makefile deleted file mode 100644 index c468ce6210..0000000000 --- a/src/glu/mesa/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -# src/glu/mesa/Makefile - -TOP = ../../.. - -include $(TOP)/configs/current - -GLU_MAJOR = 1 -GLU_MINOR = 1 -GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) - -C_SOURCES = \ - glu.c \ - mipmap.c \ - nurbs.c \ - nurbscrv.c \ - nurbssrf.c \ - nurbsutl.c \ - polytest.c \ - project.c \ - quadric.c \ - tess.c \ - tesselat.c - -OBJECTS = $(C_SOURCES:.c=.o) - -INCLUDES = -I. -I$(TOP)/include - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ - -##### TARGETS ##### - -default: - @if [ "${CONFIG_NAME}" = "beos" ] ; then \ - echo "$(GLU_LIB_NAME) not build under BeOS, but integrated into ${GL_LIB_NAME}." ; \ - exit 0 ; \ - else \ - $(MAKE) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) || exit 1 ; \ - fi - -$(TOP)/$(LIB_DIR): - -mkdir $(TOP)/$(LIB_DIR) - -# Make the library: -$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) - @ $(MKLIB) -o $(GLU_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \ - $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ - $(GLU_LIB_DEPS) $(OBJECTS) - -clean: - -rm -f *.o */*.o */*/*.o - -rm -f *.lo */*.lo */*/*.lo - -rm -f *.la */*.la */*/*.la diff --git a/src/glu/mesa/Makefile.m32 b/src/glu/mesa/Makefile.m32 deleted file mode 100644 index e2cf9dd527..0000000000 --- a/src/glu/mesa/Makefile.m32 +++ /dev/null @@ -1,63 +0,0 @@ -# Makefile for GLU for GCC-2.95.2/Mingw32 contributed by -# Paul Garceau - -# Mesa 3-D graphics library -# Version: 3.3 -# Copyright (C) 1995-1999 Brian Paul -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Library General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - -MESA_MAJOR=3 -MESA_MINOR=3 -MESA_TINY=0 -VERSION=$(MESA_MAJOR).$(MESA_MINOR) - -CFLAGS = -I. -DWIN32 -D__WIN32__ -D_WINDOWS \ - -O2 -funroll-loops \ - -fexpensive-optimizations -fomit-frame-pointer -ffast-math \ - -malign-loops=2 -malign-jumps=2 -malign-functions=2 \ - -mwindows -CC = gcc -MAKELIB = ar ru -GLU_LIB = libGLU.a - - -##### MACROS ##### - -VPATH = RCS - -INCDIR = ../include -LIBDIR = ../lib - -SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \ - polytest.c project.c quadric.c tess.c tesselat.c - -OBJECTS = $(SOURCES:.c=.o) - - - -##### RULES ##### - -.c.o: - $(CC) -c -I$(INCDIR) $(CFLAGS) $< - - - -##### TARGETS ##### - -# Make the library: -$(LIBDIR)/$(GLU_LIB): $(OBJECTS) - $(MAKELIB) $(GLU_LIB) $(MAJOR) $(MINOR) $(TINY) $(OBJECTS) \ No newline at end of file diff --git a/src/glu/mesa/Makefile.ugl b/src/glu/mesa/Makefile.ugl deleted file mode 100644 index fc189bd804..0000000000 --- a/src/glu/mesa/Makefile.ugl +++ /dev/null @@ -1,96 +0,0 @@ -# Mesa 3-D graphics library -# Version: 3.5 -# -# Copyright (C) 2001 Wind River Systems, Inc - -# The MIT License -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -# Makefile for GLU library - -##### MACROS ##### -GLU_MAJOR = 1 -GLU_MINOR = 3 -GLU_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) - -##### RULES ##### - -include ../rules.windml - -GLU_SOURCES = \ - glu.c \ - mipmap.c \ - nurbs.c \ - nurbscrv.c \ - nurbssrf.c \ - nurbsutl.c \ - polytest.c \ - project.c \ - quadric.c \ - tess.c \ - tesselat.c \ - ../src/windml/tornado/torMesaGLUInit.c - -GLU_OBJECTS = $(GLU_SOURCES:.c=.o) -GLU_OBJNAME = $(MESA_LIBDIR)/objMesaGLU.o - -SOURCES = $(GLU_SOURCES) - -##### TARGETS ##### - -all: depend.$(CPU)$(TOOL) $(GLU_OBJNAME) - -# Make the GLU library -$(GLU_OBJNAME): $(GLU_OBJECTS) -# $(LD) -r $(GLU_OBJECTS) -o $(MESA_OBJNAME) - $(LD) -r $(GLU_OBJECTS) -o $(GLU_OBJNAME) -# $(AR) rus $(MESA_LIBNAME) $(GLU_OBJNAME) -# $(AR) rus $(VX_LIBNAME) $(GLU_OBJNAME) - -depend.$(CPU)$(TOOL): -ifeq ($(WIND_HOST_TYPE),x86-win32) - @ $(RM) $@ - @ $(ECHO) Creating depend.$(CPU)$(TOOL) -ifneq ($(SOURCES),) - @ for %f in ($(SOURCES)) do \ - $(CC) -MM $(CFLAGS) %f >>$@ -endif -else -Makefile - @ $(RM) $@ - @ $(ECHO) "Creating depend.$(CPU)$(TOOL)" -ifneq ($(SOURCES),) - @ for FILE in $(filter-out $(NODEPENDOBJS), $(SOURCES)); \ - do \ - $(CC) -MM $(CFLAGS) $$FILE \ - | $(TCL) $(BIN_DIR)/depend.tcl $(TGT_DIR) >>$@; \ - done -endif -endif - -.PHONY = clean - -clean: -# $(AR) d $(MESA_LIBNAME) $(GLU_OBJNAME) -# $(AR) d $(VX_LIBNAME) $(GLU_OBJNAME) - $(RM) $(GLU_OBJNAME) - $(RM) $(GLU_OBJECTS) - $(RM) depend.$(CPU)$(TOOL) - -include depend.$(CPU)$(TOOL) diff --git a/src/glu/mesa/MesaGLU.def b/src/glu/mesa/MesaGLU.def deleted file mode 100644 index 0cdd7bb787..0000000000 --- a/src/glu/mesa/MesaGLU.def +++ /dev/null @@ -1,62 +0,0 @@ -LIBRARY GLU32 -DESCRIPTION 'GLU for Windows Mesa' -EXETYPE WINDOWS -CODE MOVEABLE DISCARDABLE -DATA MOVEABLE SINGLE -HEAPSIZE 256000 - -STACKSIZE 4096 - -EXPORTS - gluLookAt - gluOrtho2D - gluPerspective - gluPickMatrix - gluProject - gluUnProject - gluErrorString - gluScaleImage - gluBuild1DMipmaps - gluBuild2DMipmaps - gluNewQuadric - gluDeleteQuadric - gluQuadricDrawStyle - gluQuadricOrientation - gluQuadricNormals - gluQuadricTexture - gluQuadricCallback - gluCylinder - gluSphere - gluDisk - gluPartialDisk - gluNewNurbsRenderer - gluDeleteNurbsRenderer - gluLoadSamplingMatrices - gluNurbsProperty - gluGetNurbsProperty - gluBeginCurve - gluEndCurve - gluNurbsCurve - gluBeginSurface - gluEndSurface - gluNurbsSurface - gluBeginTrim - gluEndTrim - gluPwlCurve - gluNurbsCallback - gluNewTess - gluDeleteTess -; gluTessBeginPolygon -; gluTessBeginContour - gluTessVertex -; gluTessEndContour -; gluTessEndPolygon -; gluTessProperty -; gluTessNormal - gluTessCallback -; gluGetTessProperty - gluBeginPolygon - gluNextContour - gluEndPolygon - gluGetString - diff --git a/src/glu/mesa/README1 b/src/glu/mesa/README1 deleted file mode 100644 index 75968572ff..0000000000 --- a/src/glu/mesa/README1 +++ /dev/null @@ -1,195 +0,0 @@ - -Notes on the GLU polygon tesselation facility implemented by Bogdan Sikorski... - - - -The tesselation module is provided under the same terms as the Mesa -package. - -This is the first release of polygon tesselation code for Mesa. -It was written during my very little free time, so lets name it: -"its not perfect". If someone hates pointers, don't look at the code. -I preffer dynamic allocation versus static. But _all_ ideas, suggestions, -bug reports and fixes are welcome (if You want, also flames). I am aware -that many things could have been written using better techniques, but time -that I could devote to this library was very limited. It is not well commented, -excuse me. Also I am thinking of continuing working on this code to improve, -fix and polish it. And make it as compliant as possible to the OpenGL, so -software ports from OpenGL to Mesa will work correctly. If You know of any -differences in behaviour, expected input/output between Mesa tesselation library -and OpenGL, please send me a note. I explain later on why I am not -confident with this code. - -I tried to be fully compliant with the OpenGL routines. By "tried" I mean that -up to my knowledge it behaves as OpenGL tesselation routines. Just recently -I began to experiment with OpenGL (actually only Mesa), and also have -no access to any machine providing official implementation of OpenGL, -nor access to books (particulary Addison-Wesley publications). Thus my -knowledge on how the original tesselation code works, what kind of data -it expects etc. is based _only_ on the publicly available documentation -provided by SGI. Namely: - -* "The OpenGL Graphics System Utility Library" by K.P.Smith - (Silicon Graphics, 1992) -* "The OpenGL Graphics Interface" by M.Segal and K.Akeley - (Silicon Graphics, 19??) -* "OpenGL and X, Part 1: Introduction" by M.J.Kilgard - (Silicon Graphics, 1994) -* "OpenGL and X, Part 2: Using OpenGL with Xlib" by M.J.Kilgard - (Silicon Graphics, 1994) -* "OpenGL Graphics with the X Window System" by P.Karlton - (Silicon Graphics, 1993) -* Online Docs - Appendix C of OpenGL Programming Guide, Polygon Tesselation - (partial text cut and sent by e-mail) - - -The tesselation routines use slightly different prototypes than the ones -specified in the mentioned above publications. The _only_ differences are -the enumeration types which are not GLenum, but are GLUenum. So the -implemented routines have following prototypes: - -GLUtringulatorObj *gluNewTess(void); - -void gluTessCallback(GLUtriangulatorObj *,GLUenum,void (*)()); - ^^^^^^^ -void gluBeginPolygon(GLUtriangulatorObj *); - -void gluTessVertex(GLUtriangulatorObj *,GLdouble [3],void *); - -void gluNextContour(GLUtriangulatorObj *,GLUenum); - ^^^^^^^ -void gluEndPolygon(GLUtriangulatorObj *); - -const GLubyte *gluErrorString(GLUenum); - ^^^^^^^ - prototypes for callback functions: - -void (GLUenum); - ^^^^^^^ -void (GLboolean); -void (void *); -void (void); -void (GLUenum); - ^^^^^^^ - -The begin callback will be called only with GLU_TRIANGLES. No support -for traingle fans or strips yet. - -In case of errors an internal error variable is set to the appropiate -error enum values (GLU_TESS_ERROR?). Initially it is set to GLU_NO_ERROR. -The OpenGL library provides 8 error conditions, the tesselation code -of Mesa provides 9. They are: - -GLU_TESS_ERROR1: missing gluEndPolygon /* same as OpenGL */ -GLU_TESS_ERROR2: missing gluBeginPolygon /* same as OpenGL */ -GLU_TESS_ERROR3: misoriented contour /* not used in Mesa - in OpenGL is bad orientation or intersecting edges */ -GLU_TESS_ERROR4: vertex/edge intersection /* same as OpenGL */ -GLU_TESS_ERROR5: misoriented or self-intersecting loops /* same as OpenGL */ -GLU_TESS_ERROR6: coincident vertices /* same as OpenGL */ -GLU_TESS_ERROR7: colinear vertices /* OpenGL's illegal data */ -GLU_TESS_ERROR8: intersecting edges /* same as OpenGL */ -GLU_TESS_ERROR9: not coplanar contours /* new for Mesa */ - -The Mesa tesselation code ignores all data and calls after detecting an error -codition. This means that a _new_ tesselation object must be used for further -triangulations. Maybe this is too restrictive, and will be lifted in -future versions. - -The tesselation code completely ignores the type parameter passed in -gluNextContour. It also doesn't check if the passed parameter is a legal -enum value - ignores silently (maybe at least this should be checked). -The reason I chose this behaviour is based on what I read in the -beforementioned documents. I cite: - -".... -void gluNextContour(GLUtriangulatorObj *tessobj, GLenum type); - -Marks the beginning of the next contour when multiple contours make up the -boundary of the polygon to be tessellated. type can be GLU_EXTERIOR, -GLU_INTERIOR, GLU_CCW, GLU_CW, or GLU_UNKNOWN. These serve only as -to the tessellation. If you get them right, the tessellation might -go faster. If you get them wrong, they're ignored, and the tesselation still -works. -....." - -I hope You agree with me that my decision was correct. Mesa tesselation -_always_ checks by itself the interrelations between contours. Just as if -all contours were specified with the type GLU_UNKNOWN. - -One of OpenGL's policy is not to check all error conditions - rely sometimes -that the user "got things right". This is justified, since exhausting -error checking is timeconsuming, and would significantly slow down -a correct application. The Mesa tesselation code assumes only _one_ condition -when triangulating - all vertices in a contour are planar. This is _not_ -checked for correctness. Trying to tesselate such objects will lead to -unpredictable output. - -And now we arrive to the moment where I would like to list the required -(but checked for) conditions for triangulation, as well as summarize the -library: - -* all contours in a single tesselation cycle _must_ be coplanar - if not - an error is raised (and if provided a call to the error callback - is made) -* the contours can be passed in _any_ order, exteriors and holes can be - intermixed within a tesselation cycle and the correct hierarchy - will be determined by the library; thus specifying first holes then - exteriors, then holes within holes form a valid input. -* a hole within a hole is consider to be a yet another exterior contour -* multiple exterior contours (polygons) can be tesselated in one cycle; - _but_ this significantly degrades performance since many tests will be - performed for every contour pair; if You want triangulation to be fast - tesselate a single polygon (with possible holes) one at a time. -* orientation of exterior contours is arbitray, but if it has holes, - all interior holes of this particular exterior contour _must_ have an - opposite orientation. -* the output triangles have the same orientation as the exterior contour - that forms them -* each triangle is "enclosed" within the begin and end callbacks; - this is not efficent, but was made on purpose; so if triangulation - results in 2 triangles the following callbacks will be made in such - order: - (GLU_TRAINGLES) - (...) /* 3 vertices of first triangle */ - (...) - (...) - () - (GLU_TRAINGLES) - (...) /* 3 vertices of second triangle */ - (...) - (...) - () - Of course only when begin, vertex, and end callback were provided, - otherwise no output is done (actually tesselation does not take place). -* You will notice that some output traingles are very "thin"; there - exist possible several ways to traingulate a polygon, but "smart" code - avoiding such cases would require time to write, and will impact on - execution speed. -* like OpenGL, no new vertices are introduced during triangulation -* if the edgeflag callback is provided it will be called whenever - the just-about-to be output vertex begins a different type of edge - than the previous vertices; always before the first output a call - is made with GL_TRUE, to allow synchronization. -* all intermediate computations are done using GLdouble type, and comparisons - are biased with a precision value (EPSILON defined in tess.h) -* the point_in_poly function is my adaptation of code from the - comp.graphics.alg newsgroup FAQ (originally written by Mr. Wm. Randolph - Franklin, modified by Scott Anguish). -* the edge_edge_intersect test is also an adopted code from comp.graphics.alg - newsgroup FAQ -* the general idea for traingulation used in this library is described in - the book "Computational Geometry in C" by Joseph O'Rourke. - - -Excuse my English, its not my mother tongue. I should be available for some -time uner the following e-mail address. But For how long I am not certain. -Once I am settled in my new place, I'll post on the Mesa mailing list -my new address. - -(PS: today is my last day of work here, I'm changing my job). - -Bogdan. ( bogdan@dia.unisa.it ) - -Apr 28, 1995. - diff --git a/src/glu/mesa/README2 b/src/glu/mesa/README2 deleted file mode 100644 index 3c9959179b..0000000000 --- a/src/glu/mesa/README2 +++ /dev/null @@ -1,43 +0,0 @@ -The current NURBS implementation has no trimming facilities yet. - -The code is not well commented. - -1) Normal calculus fails for special cases of NURBS (independent - of the NURBS modules) - Those cases arise when for u or v, some control points - for a fixed value of that parameter form the same point. - Imagine a Bezier patch degenerated into a "triangle". - - v ^ 0,1,2 order=3 - | * - | - | 3* 4* 5* - | - | 6* 7* 8* - | - | - +------------------------> u - - The calculus of du derivative at triple point (0,1 and 2) will fail. - As a result, the normal vector will be 0. - The eval2.c code has to be changed to handle the above situation. - -2) Adjacent NURBS surfaces ("sharing" the same control points along - the "joining" edge) will be sampled with the same factor. - This prevents the formation of "cracks". - When the control polygon of the "shared" edge is not the same, - cracks might appear. - -The sampling tolerance is sometimes not respected! -A NURBS object is broken into Bezier curves/surfaces. If one of such -Bezier objects has a local high curvature with other portions of it -relatively flat then the high curvature part will be sampled more dense that -its flatter regions. -The flat regions might be tesselated into quads having sides of length -greater than the current sampling tolernace setting. -I believe such behaviour is acceptable, though not along the concept of -sampling tolerance. - -February 20, 1996. - -Bogdan. diff --git a/src/glu/mesa/all.h b/src/glu/mesa/all.h deleted file mode 100644 index 874c935925..0000000000 --- a/src/glu/mesa/all.h +++ /dev/null @@ -1,54 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file includes all .h files needed for the GLU source code for - * the purpose of precompiled headers. - * - * If the preprocessor symbol PCH is defined at compile time then each - * of the .c files will #include "all.h" only, instead of a bunch of - * individual .h files. - */ - - -#ifndef GLU_ALL_H -#define GLU_ALL_H - - -#ifndef PC_HEADER -This is an error. all.h should be included only if PCH is defined. -#endif - - -#include -#include -#include -#include -#include -#include "GL/gl.h" -#include "GL/glu.h" -#include "gluP.h" -#include "nurbs.h" -#include "tess.h" - - -#endif /*GLU_ALL_H */ diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c deleted file mode 100644 index f9e33980a4..0000000000 --- a/src/glu/mesa/glu.c +++ /dev/null @@ -1,416 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * Copyright (C) 1995-2001 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include -#include -#include "gluP.h" -#endif - - -/* - * Miscellaneous utility functions - */ - - -#ifndef M_PI -#define M_PI 3.1415926536 -#endif -#define EPS 0.00001 - -#ifndef GLU_INCOMPATIBLE_GL_VERSION -#define GLU_INCOMPATIBLE_GL_VERSION 100903 -#endif - - -void GLAPIENTRY -gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, - GLdouble centerx, GLdouble centery, GLdouble centerz, - GLdouble upx, GLdouble upy, GLdouble upz) -{ - GLdouble m[16]; - GLdouble x[3], y[3], z[3]; - GLdouble mag; - - /* Make rotation matrix */ - - /* Z vector */ - z[0] = eyex - centerx; - z[1] = eyey - centery; - z[2] = eyez - centerz; - mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]); - if (mag) { /* mpichler, 19950515 */ - z[0] /= mag; - z[1] /= mag; - z[2] /= mag; - } - - /* Y vector */ - y[0] = upx; - y[1] = upy; - y[2] = upz; - - /* X vector = Y cross Z */ - x[0] = y[1] * z[2] - y[2] * z[1]; - x[1] = -y[0] * z[2] + y[2] * z[0]; - x[2] = y[0] * z[1] - y[1] * z[0]; - - /* Recompute Y = Z cross X */ - y[0] = z[1] * x[2] - z[2] * x[1]; - y[1] = -z[0] * x[2] + z[2] * x[0]; - y[2] = z[0] * x[1] - z[1] * x[0]; - - /* mpichler, 19950515 */ - /* cross product gives area of parallelogram, which is < 1.0 for - * non-perpendicular unit-length vectors; so normalize x, y here - */ - - mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); - if (mag) { - x[0] /= mag; - x[1] /= mag; - x[2] /= mag; - } - - mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]); - if (mag) { - y[0] /= mag; - y[1] /= mag; - y[2] /= mag; - } - -#define M(row,col) m[col*4+row] - M(0, 0) = x[0]; - M(0, 1) = x[1]; - M(0, 2) = x[2]; - M(0, 3) = 0.0; - M(1, 0) = y[0]; - M(1, 1) = y[1]; - M(1, 2) = y[2]; - M(1, 3) = 0.0; - M(2, 0) = z[0]; - M(2, 1) = z[1]; - M(2, 2) = z[2]; - M(2, 3) = 0.0; - M(3, 0) = 0.0; - M(3, 1) = 0.0; - M(3, 2) = 0.0; - M(3, 3) = 1.0; -#undef M - glMultMatrixd(m); - - /* Translate Eye to Origin */ - glTranslated(-eyex, -eyey, -eyez); - -} - - - -void GLAPIENTRY -gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) -{ - glOrtho(left, right, bottom, top, -1.0, 1.0); -} - - - -static void -frustum(GLdouble left, GLdouble right, - GLdouble bottom, GLdouble top, - GLdouble nearval, GLdouble farval) -{ - GLdouble x, y, a, b, c, d; - GLdouble m[16]; - - x = (2.0 * nearval) / (right - left); - y = (2.0 * nearval) / (top - bottom); - a = (right + left) / (right - left); - b = (top + bottom) / (top - bottom); - c = -(farval + nearval) / ( farval - nearval); - d = -(2.0 * farval * nearval) / (farval - nearval); - -#define M(row,col) m[col*4+row] - M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F; - M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F; - M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d; - M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F; -#undef M - - glMultMatrixd(m); -} - - -void GLAPIENTRY -gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) -{ - GLdouble xmin, xmax, ymin, ymax; - - ymax = zNear * tan(fovy * M_PI / 360.0); - ymin = -ymax; - xmin = ymin * aspect; - xmax = ymax * aspect; - - /* don't call glFrustum() because of error semantics (covglu) */ - frustum(xmin, xmax, ymin, ymax, zNear, zFar); -} - - - -void GLAPIENTRY -gluPickMatrix(GLdouble x, GLdouble y, - GLdouble width, GLdouble height, GLint viewport[4]) -{ - GLfloat m[16]; - GLfloat sx, sy; - GLfloat tx, ty; - - sx = viewport[2] / width; - sy = viewport[3] / height; - tx = (viewport[2] + 2.0 * (viewport[0] - x)) / width; - ty = (viewport[3] + 2.0 * (viewport[1] - y)) / height; - -#define M(row,col) m[col*4+row] - M(0, 0) = sx; - M(0, 1) = 0.0; - M(0, 2) = 0.0; - M(0, 3) = tx; - M(1, 0) = 0.0; - M(1, 1) = sy; - M(1, 2) = 0.0; - M(1, 3) = ty; - M(2, 0) = 0.0; - M(2, 1) = 0.0; - M(2, 2) = 1.0; - M(2, 3) = 0.0; - M(3, 0) = 0.0; - M(3, 1) = 0.0; - M(3, 2) = 0.0; - M(3, 3) = 1.0; -#undef M - - glMultMatrixf(m); -} - - - -const GLubyte *GLAPIENTRY -gluErrorString(GLenum errorCode) -{ - static char *tess_error[] = { - "missing gluBeginPolygon", - "missing gluBeginContour", - "missing gluEndPolygon", - "missing gluEndContour", - "misoriented or self-intersecting loops", - "coincident vertices", - "colinear vertices", - "FIST recovery process fatal error" - }; - static char *nurbs_error[] = { - "spline order un-supported", - "too few knots", - "valid knot range is empty", - "decreasing knot sequence knot", - "knot multiplicity greater than order of spline", - "endcurve() must follow bgncurve()", - "bgncurve() must precede endcurve()", - "missing or extra geometric data", - "can't draw pwlcurves", - "missing bgncurve()", - "missing bgnsurface()", - "endtrim() must precede endsurface()", - "bgnsurface() must precede endsurface()", - "curve of improper type passed as trim curve", - "bgnsurface() must precede bgntrim()", - "endtrim() must follow bgntrim()", - "bgntrim() must precede endtrim()", - "invalid or missing trim curve", - "bgntrim() must precede pwlcurve()", - "pwlcurve referenced twice", - "pwlcurve and nurbscurve mixed", - "improper usage of trim data type", - "nurbscurve referenced twice", - "nurbscurve and pwlcurve mixed", - "nurbssurface referenced twice", - "invalid property", - "endsurface() must follow bgnsurface()", - "misoriented trim curves", - "intersecting trim curves", - "UNUSED", - "unconnected trim curves", - "unknown knot error", - "negative vertex count encountered", - "negative byte-stride encountered", - "unknown type descriptor", - "null control array or knot vector", - "duplicate point on pwlcurve" - }; - - /* GL Errors */ - if (errorCode == GL_NO_ERROR) { - return (GLubyte *) "no error"; - } - else if (errorCode == GL_INVALID_VALUE) { - return (GLubyte *) "invalid value"; - } - else if (errorCode == GL_INVALID_ENUM) { - return (GLubyte *) "invalid enum"; - } - else if (errorCode == GL_INVALID_OPERATION) { - return (GLubyte *) "invalid operation"; - } - else if (errorCode == GL_STACK_OVERFLOW) { - return (GLubyte *) "stack overflow"; - } - else if (errorCode == GL_STACK_UNDERFLOW) { - return (GLubyte *) "stack underflow"; - } - else if (errorCode == GL_OUT_OF_MEMORY) { - return (GLubyte *) "out of memory"; - } - /* GLU Errors */ - else if (errorCode == GLU_NO_ERROR) { - return (GLubyte *) "no error"; - } - else if (errorCode == GLU_INVALID_ENUM) { - return (GLubyte *) "invalid enum"; - } - else if (errorCode == GLU_INVALID_VALUE) { - return (GLubyte *) "invalid value"; - } - else if (errorCode == GLU_OUT_OF_MEMORY) { - return (GLubyte *) "out of memory"; - } - else if (errorCode == GLU_INCOMPATIBLE_GL_VERSION) { - return (GLubyte *) "incompatible GL version"; - } - else if (errorCode >= GLU_TESS_ERROR1 && errorCode <= GLU_TESS_ERROR8) { - return (GLubyte *) tess_error[errorCode - GLU_TESS_ERROR1]; - } - else if (errorCode >= GLU_NURBS_ERROR1 && errorCode <= GLU_NURBS_ERROR37) { - return (GLubyte *) nurbs_error[errorCode - GLU_NURBS_ERROR1]; - } - else { - return NULL; - } -} - - - -/* - * New in GLU 1.1 - */ - -const GLubyte *GLAPIENTRY -gluGetString(GLenum name) -{ - static char *extensions = "GL_EXT_abgr"; - static char *version = "1.1 Mesa 3.5"; - - switch (name) { - case GLU_EXTENSIONS: - return (GLubyte *) extensions; - case GLU_VERSION: - return (GLubyte *) version; - default: - return NULL; - } -} - - - -#if 0 /* gluGetProcAddressEXT not finalized yet! */ - -#ifdef __cplusplus - /* for BeOS R4.5 */ -void GLAPIENTRY(*gluGetProcAddressEXT(const GLubyte * procName)) (...) -#else -void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) () -#endif -{ - struct proc - { - const char *name; - void *address; - }; - static struct proc procTable[] = { - {"gluGetProcAddressEXT", (void *) gluGetProcAddressEXT}, /* me! */ - - /* new 1.1 functions */ - {"gluGetString", (void *) gluGetString}, - - /* new 1.2 functions */ - {"gluTessBeginPolygon", (void *) gluTessBeginPolygon}, - {"gluTessBeginContour", (void *) gluTessBeginContour}, - {"gluTessEndContour", (void *) gluTessEndContour}, - {"gluTessEndPolygon", (void *) gluTessEndPolygon}, - {"gluGetTessProperty", (void *) gluGetTessProperty}, - - /* new 1.3 functions */ - - {NULL, NULL} - }; - GLuint i; - - for (i = 0; procTable[i].address; i++) { - if (strcmp((const char *) procName, procTable[i].name) == 0) - return (void (GLAPIENTRY *) ()) procTable[i].address; - } - - return NULL; -} - -#endif - - - -/* - * New in GLU 1.3 - */ -#ifdef GLU_VERSION_1_3 -GLboolean GLAPIENTRY -gluCheckExtension(const GLubyte *extName, const GLubyte * extString) -{ - assert(extName); - assert(extString); - { - const int len = strlen((const char *) extName); - const char *start = (const char *) extString; - - while (1) { - const char *c = strstr(start, (const char *) extName); - if (!c) - return GL_FALSE; - - if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0)) - return GL_TRUE; - - start = c + len; - } - } -} -#endif diff --git a/src/glu/mesa/gluP.h b/src/glu/mesa/gluP.h deleted file mode 100644 index dc1b05b6a1..0000000000 --- a/src/glu/mesa/gluP.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * Copyright (C) 1995-2004 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file allows the GLU code to be compiled either with the Mesa - * headers or with the real OpenGL headers. - */ - - -#ifndef GLUP_H -#define GLUP_H - - -#include -#include -#include - - -#if defined(_WIN32) && !defined(__WIN32__) -# define __WIN32__ -#endif - -#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) -# pragma warning( disable : 4068 ) /* unknown pragma */ -# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ -# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ -# pragma warning( disable : 4127 ) /* conditional expression is constant */ -# if defined(MESA_MINWARN) -# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ -# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ -# endif -# define GLCALLBACK __stdcall -# if defined(__CYGWIN__) -# define GLCALLBACKPCAST * -# else -# define GLCALLBACKPCAST __stdcall * -# endif -#else -/* non-Windows compilation */ -# define GLCALLBACK -# define GLCALLBACKPCAST * -#endif /* WIN32 / CYGWIN bracket */ - -/* compatability guard so we don't need to change client code */ - -#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) -# define CALLBACK GLCALLBACK -#endif - - - -#ifndef GLU_TESS_ERROR9 - /* If we're using the real OpenGL header files... */ -# define GLU_TESS_ERROR9 100159 -#endif - - -#define GLU_NO_ERROR GL_NO_ERROR - - -/* for Sun: */ -#ifdef SUNOS4 -#define MEMCPY( DST, SRC, BYTES) \ - memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) ) -#else -#define MEMCPY( DST, SRC, BYTES) \ - memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) ) -#endif - - -#ifndef NULL -# define NULL 0 -#endif - - -#endif diff --git a/src/glu/mesa/mipmap.c b/src/glu/mesa/mipmap.c deleted file mode 100644 index ad6b6e63a6..0000000000 --- a/src/glu/mesa/mipmap.c +++ /dev/null @@ -1,829 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include -#include "gluP.h" -#endif - - -/* - * Compute ceiling of integer quotient of A divided by B: - */ -#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) - - - -#ifdef EPSILON -#undef EPSILON -#endif -#define EPSILON 0.001 - - -/* To work around optimizer bug in MSVC4.1 */ -#if defined(__WIN32__) && !defined(OPENSTEP) -void -dummy(GLuint j, GLuint k) -{ -} -#else -#define dummy(J, K) -#endif - - -GLint GLAPIENTRY -gluScaleImage(GLenum format, - GLsizei widthin, GLsizei heightin, - GLenum typein, const void *datain, - GLsizei widthout, GLsizei heightout, - GLenum typeout, void *dataout) -{ - GLint components, i, j, k; - GLfloat *tempin, *tempout; - GLfloat sx, sy; - GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; - GLint packrowlength, packalignment, packskiprows, packskippixels; - GLint sizein, sizeout; - GLint rowstride, rowlen; - - - /* Determine number of components per pixel */ - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - components = 1; - break; - case GL_LUMINANCE_ALPHA: - components = 2; - break; - case GL_RGB: - case GL_BGR: - components = 3; - break; - case GL_RGBA: - case GL_BGRA: -#ifdef GL_EXT_abgr - case GL_ABGR_EXT: -#endif - components = 4; - break; - default: - return GLU_INVALID_ENUM; - } - - /* Determine bytes per input datum */ - switch (typein) { - case GL_UNSIGNED_BYTE: - sizein = sizeof(GLubyte); - break; - case GL_BYTE: - sizein = sizeof(GLbyte); - break; - case GL_UNSIGNED_SHORT: - sizein = sizeof(GLushort); - break; - case GL_SHORT: - sizein = sizeof(GLshort); - break; - case GL_UNSIGNED_INT: - sizein = sizeof(GLuint); - break; - case GL_INT: - sizein = sizeof(GLint); - break; - case GL_FLOAT: - sizein = sizeof(GLfloat); - break; - case GL_BITMAP: - /* not implemented yet */ - default: - return GL_INVALID_ENUM; - } - - /* Determine bytes per output datum */ - switch (typeout) { - case GL_UNSIGNED_BYTE: - sizeout = sizeof(GLubyte); - break; - case GL_BYTE: - sizeout = sizeof(GLbyte); - break; - case GL_UNSIGNED_SHORT: - sizeout = sizeof(GLushort); - break; - case GL_SHORT: - sizeout = sizeof(GLshort); - break; - case GL_UNSIGNED_INT: - sizeout = sizeof(GLuint); - break; - case GL_INT: - sizeout = sizeof(GLint); - break; - case GL_FLOAT: - sizeout = sizeof(GLfloat); - break; - case GL_BITMAP: - /* not implemented yet */ - default: - return GL_INVALID_ENUM; - } - - /* Get glPixelStore state */ - glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength); - glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment); - glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows); - glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels); - glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength); - glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment); - glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows); - glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels); - - /* Allocate storage for intermediate images */ - tempin = (GLfloat *) malloc(widthin * heightin - * components * sizeof(GLfloat)); - if (!tempin) { - return GLU_OUT_OF_MEMORY; - } - tempout = (GLfloat *) malloc(widthout * heightout - * components * sizeof(GLfloat)); - if (!tempout) { - free(tempin); - return GLU_OUT_OF_MEMORY; - } - - - /* - * Unpack the pixel data and convert to floating point - */ - - if (unpackrowlength > 0) { - rowlen = unpackrowlength; - } - else { - rowlen = widthin; - } - if (sizein >= unpackalignment) { - rowstride = components * rowlen; - } - else { - rowstride = unpackalignment / sizein - * CEILING(components * rowlen * sizein, unpackalignment); - } - - switch (typein) { - case GL_UNSIGNED_BYTE: - k = 0; - for (i = 0; i < heightin; i++) { - GLubyte *ubptr = (GLubyte *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * ubptr++; - } - } - break; - case GL_BYTE: - k = 0; - for (i = 0; i < heightin; i++) { - GLbyte *bptr = (GLbyte *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * bptr++; - } - } - break; - case GL_UNSIGNED_SHORT: - k = 0; - for (i = 0; i < heightin; i++) { - GLushort *usptr = (GLushort *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * usptr++; - } - } - break; - case GL_SHORT: - k = 0; - for (i = 0; i < heightin; i++) { - GLshort *sptr = (GLshort *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * sptr++; - } - } - break; - case GL_UNSIGNED_INT: - k = 0; - for (i = 0; i < heightin; i++) { - GLuint *uiptr = (GLuint *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * uiptr++; - } - } - break; - case GL_INT: - k = 0; - for (i = 0; i < heightin; i++) { - GLint *iptr = (GLint *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * iptr++; - } - } - break; - case GL_FLOAT: - k = 0; - for (i = 0; i < heightin; i++) { - GLfloat *fptr = (GLfloat *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = *fptr++; - } - } - break; - default: - { - free(tempin); - free(tempout); - return GLU_INVALID_ENUM; - } - } - - - /* - * Scale the image! - */ - - if (widthout > 1) - sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1); - else - sx = (GLfloat) (widthin - 1); - if (heightout > 1) - sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1); - else - sy = (GLfloat) (heightin - 1); - -/*#define POINT_SAMPLE*/ -#ifdef POINT_SAMPLE - for (i = 0; i < heightout; i++) { - GLint ii = i * sy; - for (j = 0; j < widthout; j++) { - GLint jj = j * sx; - - GLfloat *src = tempin + (ii * widthin + jj) * components; - GLfloat *dst = tempout + (i * widthout + j) * components; - - for (k = 0; k < components; k++) { - *dst++ = *src++; - } - } - } -#else - if (sx < 1.0 && sy < 1.0) { - /* magnify both width and height: use weighted sample of 4 pixels */ - GLint i0, i1, j0, j1; - GLfloat alpha, beta; - GLfloat *src00, *src01, *src10, *src11; - GLfloat s1, s2; - GLfloat *dst; - - for (i = 0; i < heightout; i++) { - i0 = i * sy; - i1 = i0 + 1; - if (i1 >= heightin) - i1 = heightin - 1; -/* i1 = (i+1) * sy - EPSILON;*/ - alpha = i * sy - i0; - for (j = 0; j < widthout; j++) { - j0 = j * sx; - j1 = j0 + 1; - if (j1 >= widthin) - j1 = widthin - 1; -/* j1 = (j+1) * sx - EPSILON; */ - beta = j * sx - j0; - - /* compute weighted average of pixels in rect (i0,j0)-(i1,j1) */ - src00 = tempin + (i0 * widthin + j0) * components; - src01 = tempin + (i0 * widthin + j1) * components; - src10 = tempin + (i1 * widthin + j0) * components; - src11 = tempin + (i1 * widthin + j1) * components; - - dst = tempout + (i * widthout + j) * components; - - for (k = 0; k < components; k++) { - s1 = *src00++ * (1.0 - beta) + *src01++ * beta; - s2 = *src10++ * (1.0 - beta) + *src11++ * beta; - *dst++ = s1 * (1.0 - alpha) + s2 * alpha; - } - } - } - } - else { - /* shrink width and/or height: use an unweighted box filter */ - GLint i0, i1; - GLint j0, j1; - GLint ii, jj; - GLfloat sum, *dst; - - for (i = 0; i < heightout; i++) { - i0 = i * sy; - i1 = i0 + 1; - if (i1 >= heightin) - i1 = heightin - 1; -/* i1 = (i+1) * sy - EPSILON; */ - for (j = 0; j < widthout; j++) { - j0 = j * sx; - j1 = j0 + 1; - if (j1 >= widthin) - j1 = widthin - 1; -/* j1 = (j+1) * sx - EPSILON; */ - - dst = tempout + (i * widthout + j) * components; - - /* compute average of pixels in the rectangle (i0,j0)-(i1,j1) */ - for (k = 0; k < components; k++) { - sum = 0.0; - for (ii = i0; ii <= i1; ii++) { - for (jj = j0; jj <= j1; jj++) { - sum += *(tempin + (ii * widthin + jj) * components + k); - } - } - sum /= (j1 - j0 + 1) * (i1 - i0 + 1); - *dst++ = sum; - } - } - } - } -#endif - - - /* - * Return output image - */ - - if (packrowlength > 0) { - rowlen = packrowlength; - } - else { - rowlen = widthout; - } - if (sizeout >= packalignment) { - rowstride = components * rowlen; - } - else { - rowstride = packalignment / sizeout - * CEILING(components * rowlen * sizeout, packalignment); - } - - switch (typeout) { - case GL_UNSIGNED_BYTE: - k = 0; - for (i = 0; i < heightout; i++) { - GLubyte *ubptr = (GLubyte *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *ubptr++ = (GLubyte) tempout[k++]; - } - } - break; - case GL_BYTE: - k = 0; - for (i = 0; i < heightout; i++) { - GLbyte *bptr = (GLbyte *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *bptr++ = (GLbyte) tempout[k++]; - } - } - break; - case GL_UNSIGNED_SHORT: - k = 0; - for (i = 0; i < heightout; i++) { - GLushort *usptr = (GLushort *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *usptr++ = (GLushort) tempout[k++]; - } - } - break; - case GL_SHORT: - k = 0; - for (i = 0; i < heightout; i++) { - GLshort *sptr = (GLshort *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *sptr++ = (GLshort) tempout[k++]; - } - } - break; - case GL_UNSIGNED_INT: - k = 0; - for (i = 0; i < heightout; i++) { - GLuint *uiptr = (GLuint *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *uiptr++ = (GLuint) tempout[k++]; - } - } - break; - case GL_INT: - k = 0; - for (i = 0; i < heightout; i++) { - GLint *iptr = (GLint *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *iptr++ = (GLint) tempout[k++]; - } - } - break; - case GL_FLOAT: - k = 0; - for (i = 0; i < heightout; i++) { - GLfloat *fptr = (GLfloat *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *fptr++ = tempout[k++]; - } - } - break; - default: - return GLU_INVALID_ENUM; - } - - - /* free temporary image storage */ - free(tempin); - free(tempout); - - return 0; -} - - - -/* - * Return the largest k such that 2^k <= n. - */ -static GLint -ilog2(GLint n) -{ - GLint k; - - if (n <= 0) - return 0; - for (k = 0; n >>= 1; k++); - return k; -} - - - -/* - * Find the value nearest to n which is also a power of two. - */ -static GLint -round2(GLint n) -{ - GLint m; - - for (m = 1; m < n; m *= 2); - - /* m>=n */ - if (m - n <= n - m / 2) { - return m; - } - else { - return m / 2; - } -} - - -/* - * Given an pixel format and datatype, return the number of bytes to - * store one pixel. - */ -static GLint -bytes_per_pixel(GLenum format, GLenum type) -{ - GLint n, m; - - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - n = 1; - break; - case GL_LUMINANCE_ALPHA: - n = 2; - break; - case GL_RGB: - case GL_BGR: - n = 3; - break; - case GL_RGBA: - case GL_BGRA: -#ifdef GL_EXT_abgr - case GL_ABGR_EXT: -#endif - n = 4; - break; - default: - n = 0; - } - - switch (type) { - case GL_UNSIGNED_BYTE: - m = sizeof(GLubyte); - break; - case GL_BYTE: - m = sizeof(GLbyte); - break; - case GL_BITMAP: - m = 1; - break; - case GL_UNSIGNED_SHORT: - m = sizeof(GLushort); - break; - case GL_SHORT: - m = sizeof(GLshort); - break; - case GL_UNSIGNED_INT: - m = sizeof(GLuint); - break; - case GL_INT: - m = sizeof(GLint); - break; - case GL_FLOAT: - m = sizeof(GLfloat); - break; - default: - m = 0; - } - - return n * m; -} - - - -/* - * WARNING: This function isn't finished and has never been tested!!!! - */ -GLint GLAPIENTRY -gluBuild1DMipmaps(GLenum target, GLint components, - GLsizei width, GLenum format, GLenum type, const void *data) -{ - GLubyte *texture; - GLint levels, max_levels; - GLint new_width, max_width; - GLint i, j, k, l; - - if (width < 1) - return GLU_INVALID_VALUE; - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_width); - max_levels = ilog2(max_width) + 1; - - /* Compute how many mipmap images to make */ - levels = ilog2(width) + 1; - if (levels > max_levels) { - levels = max_levels; - } - - new_width = 1 << (levels - 1); - - texture = (GLubyte *) malloc(new_width * components); - if (!texture) { - return GLU_OUT_OF_MEMORY; - } - - if (width != new_width) { - /* initial rescaling */ - switch (type) { - case GL_UNSIGNED_BYTE: - { - GLubyte *ub_data = (GLubyte *) data; - for (i = 0; i < new_width; i++) { - j = i * width / new_width; - for (k = 0; k < components; k++) { - texture[i * components + k] = ub_data[j * components + k]; - } - } - } - break; - default: - /* Not implemented */ - free(texture); - return GLU_ERROR; - } - } - - /* generate and load mipmap images */ - for (l = 0; l < levels; l++) { - glTexImage1D(GL_TEXTURE_1D, l, components, new_width, 0, - format, GL_UNSIGNED_BYTE, texture); - - /* Scale image down to 1/2 size */ - new_width = new_width / 2; - for (i = 0; i < new_width; i++) { - for (k = 0; k < components; k++) { - GLint sample1, sample2; - sample1 = (GLint) texture[i * 2 * components + k]; - sample2 = (GLint) texture[(i * 2 + 1) * components + k]; - texture[i * components + k] = (GLubyte) ((sample1 + sample2) / 2); - } - } - } - - free(texture); - - return 0; -} - - - -GLint GLAPIENTRY -gluBuild2DMipmaps(GLenum target, GLint components, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const void *data) -{ - GLint w, h, maxsize; - void *image, *newimage; - GLint neww, newh, level, bpp; - int error; - GLboolean done; - GLint retval = 0; - GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; - GLint packrowlength, packalignment, packskiprows, packskippixels; - - if (width < 1 || height < 1) - return GLU_INVALID_VALUE; - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxsize); - - w = round2(width); - if (w > maxsize) { - w = maxsize; - } - h = round2(height); - if (h > maxsize) { - h = maxsize; - } - - bpp = bytes_per_pixel(format, type); - if (bpp == 0) { - /* probably a bad format or type enum */ - return GLU_INVALID_ENUM; - } - - /* Get current glPixelStore values */ - glGetIntegerv(GL_UNPACK_ROW_LENGTH, &unpackrowlength); - glGetIntegerv(GL_UNPACK_ALIGNMENT, &unpackalignment); - glGetIntegerv(GL_UNPACK_SKIP_ROWS, &unpackskiprows); - glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &unpackskippixels); - glGetIntegerv(GL_PACK_ROW_LENGTH, &packrowlength); - glGetIntegerv(GL_PACK_ALIGNMENT, &packalignment); - glGetIntegerv(GL_PACK_SKIP_ROWS, &packskiprows); - glGetIntegerv(GL_PACK_SKIP_PIXELS, &packskippixels); - - /* set pixel packing */ - glPixelStorei(GL_PACK_ROW_LENGTH, 0); - glPixelStorei(GL_PACK_ALIGNMENT, 1); - glPixelStorei(GL_PACK_SKIP_ROWS, 0); - glPixelStorei(GL_PACK_SKIP_PIXELS, 0); - - done = GL_FALSE; - - if (w != width || h != height) { - /* must rescale image to get "top" mipmap texture image */ - image = malloc((w + 4) * h * bpp); - if (!image) { - return GLU_OUT_OF_MEMORY; - } - error = gluScaleImage(format, width, height, type, data, - w, h, type, image); - if (error) { - retval = error; - done = GL_TRUE; - } - } - else { - image = (void *) data; - } - - level = 0; - while (!done) { - if (image != data) { - /* set pixel unpacking */ - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - } - - glTexImage2D(target, level, components, w, h, 0, format, type, image); - - if (w == 1 && h == 1) - break; - - neww = (w < 2) ? 1 : w / 2; - newh = (h < 2) ? 1 : h / 2; - newimage = malloc((neww + 4) * newh * bpp); - if (!newimage) { - return GLU_OUT_OF_MEMORY; - } - - error = gluScaleImage(format, w, h, type, image, - neww, newh, type, newimage); - if (error) { - retval = error; - done = GL_TRUE; - } - - if (image != data) { - free(image); - } - image = newimage; - - w = neww; - h = newh; - level++; - } - - if (image != data) { - free(image); - } - - /* Restore original glPixelStore state */ - glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength); - glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels); - glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength); - glPixelStorei(GL_PACK_ALIGNMENT, packalignment); - glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows); - glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels); - - return retval; -} diff --git a/src/glu/mesa/nurbs.c b/src/glu/mesa/nurbs.c deleted file mode 100644 index 3f102b4e45..0000000000 --- a/src/glu/mesa/nurbs.c +++ /dev/null @@ -1,628 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "gluP.h" -#include "nurbs.h" -#endif - - -void -call_user_error(GLUnurbsObj * nobj, GLenum error) -{ - nobj->error = error; - if (nobj->error_callback != NULL) { - (*(nobj->error_callback)) (error); - } - else { - printf("NURBS error %d %s\n", error, (char *) gluErrorString(error)); - } -} - - - -GLUnurbsObj *GLAPIENTRY -gluNewNurbsRenderer(void) -{ - GLUnurbsObj *n; - GLfloat tmp_viewport[4]; - GLint i, j; - - n = (GLUnurbsObj *) malloc(sizeof(GLUnurbsObj)); - if (n) { - /* init */ - n->culling = GL_FALSE; - n->nurbs_type = GLU_NURBS_NONE; - n->error = GLU_NO_ERROR; - n->error_callback = NULL; - n->auto_load_matrix = GL_TRUE; - n->sampling_tolerance = 50.0; - n->parametric_tolerance = 0.5; - n->u_step = n->v_step = 100; - n->sampling_method = GLU_PATH_LENGTH; - n->display_mode = GLU_FILL; - /* in case the user doesn't supply the sampling matrices */ - /* set projection and modelview to identity */ - for (i = 0; i < 4; i++) - for (j = 0; j < 4; j++) - if (i == j) { - n->sampling_matrices.model[i * 4 + j] = 1.0; - n->sampling_matrices.proj[i * 4 + j] = 1.0; - } - else { - n->sampling_matrices.model[i * 4 + j] = 0.0; - n->sampling_matrices.proj[i * 4 + j] = 0.0; - } - /* and set the viewport sampling matrix to current ciewport */ - glGetFloatv(GL_VIEWPORT, tmp_viewport); - for (i = 0; i < 4; i++) - n->sampling_matrices.viewport[i] = tmp_viewport[i]; - n->trim = NULL; - } - return n; -} - - - -void GLAPIENTRY -gluDeleteNurbsRenderer(GLUnurbsObj * nobj) -{ - if (nobj) { - free(nobj); - } -} - - - -void GLAPIENTRY -gluLoadSamplingMatrices(GLUnurbsObj * nobj, - const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], const GLint viewport[4]) -{ - GLint i; - - for (i = 0; i < 16; i++) { - nobj->sampling_matrices.model[i] = modelMatrix[i]; - nobj->sampling_matrices.proj[i] = projMatrix[i]; - } - for (i = 0; i < 4; i++) - nobj->sampling_matrices.viewport[i] = viewport[i]; -} - - -void GLAPIENTRY -gluNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat value) -{ - GLenum val; - - switch (property) { - case GLU_SAMPLING_TOLERANCE: - if (value <= 0.0) { - call_user_error(nobj, GLU_INVALID_VALUE); - return; - } - nobj->sampling_tolerance = value; - break; - case GLU_PARAMETRIC_TOLERANCE: - if (value <= 0.0) { - call_user_error(nobj, GLU_INVALID_VALUE); - return; - } - nobj->parametric_tolerance = value; - break; - case GLU_U_STEP: - if (value <= 0.0) { - call_user_error(nobj, GLU_INVALID_VALUE); - return; - } - nobj->u_step = (GLint) value; - break; - case GLU_V_STEP: - if (value <= 0.0) { - call_user_error(nobj, GLU_INVALID_VALUE); - return; - } - nobj->v_step = (GLint) value; - break; - case GLU_SAMPLING_METHOD: - val = (GLenum) value; - if (val != GLU_PATH_LENGTH && val != GLU_PARAMETRIC_ERROR - && val != GLU_DOMAIN_DISTANCE) { - call_user_error(nobj, GLU_INVALID_ENUM); - return; - } - nobj->sampling_method = val; - break; - case GLU_DISPLAY_MODE: - val = (GLenum) value; - if (val != GLU_FILL && val != GLU_OUTLINE_POLYGON - && val != GLU_OUTLINE_PATCH) { - call_user_error(nobj, GLU_INVALID_ENUM); - return; - } - if (nobj->nurbs_type == GLU_NURBS_CURVE) { - call_user_error(nobj, GLU_NURBS_ERROR26); - return; - } - nobj->display_mode = val; - if (val == GLU_OUTLINE_PATCH) - fprintf(stderr, - "NURBS, for the moment, can display only in POLYGON mode\n"); - break; - case GLU_CULLING: - val = (GLenum) value; - if (val != GL_TRUE && val != GL_FALSE) { - call_user_error(nobj, GLU_INVALID_ENUM); - return; - } - nobj->culling = (GLboolean) value; - break; - case GLU_AUTO_LOAD_MATRIX: - val = (GLenum) value; - if (val != GL_TRUE && val != GL_FALSE) { - call_user_error(nobj, GLU_INVALID_ENUM); - return; - } - nobj->auto_load_matrix = (GLboolean) value; - break; - default: - call_user_error(nobj, GLU_NURBS_ERROR26); - } -} - - -void GLAPIENTRY -gluGetNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat * value) -{ - switch (property) { - case GLU_SAMPLING_TOLERANCE: - *value = nobj->sampling_tolerance; - break; - case GLU_DISPLAY_MODE: - *value = (GLfloat) (GLint) nobj->display_mode; - break; - case GLU_CULLING: - *value = nobj->culling ? 1.0 : 0.0; - break; - case GLU_AUTO_LOAD_MATRIX: - *value = nobj->auto_load_matrix ? 1.0 : 0.0; - break; - default: - call_user_error(nobj, GLU_INVALID_ENUM); - } -} - - - -void GLAPIENTRY -gluBeginCurve(GLUnurbsObj * nobj) -{ - if (nobj->nurbs_type == GLU_NURBS_CURVE) { - call_user_error(nobj, GLU_NURBS_ERROR6); - return; - } - nobj->nurbs_type = GLU_NURBS_CURVE; - nobj->curve.geom.type = GLU_INVALID_ENUM; - nobj->curve.color.type = GLU_INVALID_ENUM; - nobj->curve.texture.type = GLU_INVALID_ENUM; - nobj->curve.normal.type = GLU_INVALID_ENUM; -} - - -void GLAPIENTRY -gluEndCurve(GLUnurbsObj * nobj) -{ - if (nobj->nurbs_type == GLU_NURBS_NONE) { - call_user_error(nobj, GLU_NURBS_ERROR7); - return; - } - if (nobj->curve.geom.type == GLU_INVALID_ENUM) { - call_user_error(nobj, GLU_NURBS_ERROR8); - nobj->nurbs_type = GLU_NURBS_NONE; - return; - } - glPushAttrib((GLbitfield) (GL_EVAL_BIT | GL_ENABLE_BIT)); - glDisable(GL_MAP1_VERTEX_3); - glDisable(GL_MAP1_VERTEX_4); - glDisable(GL_MAP1_INDEX); - glDisable(GL_MAP1_COLOR_4); - glDisable(GL_MAP1_NORMAL); - glDisable(GL_MAP1_TEXTURE_COORD_1); - glDisable(GL_MAP1_TEXTURE_COORD_2); - glDisable(GL_MAP1_TEXTURE_COORD_3); - glDisable(GL_MAP1_TEXTURE_COORD_4); - glDisable(GL_MAP2_VERTEX_3); - glDisable(GL_MAP2_VERTEX_4); - glDisable(GL_MAP2_INDEX); - glDisable(GL_MAP2_COLOR_4); - glDisable(GL_MAP2_NORMAL); - glDisable(GL_MAP2_TEXTURE_COORD_1); - glDisable(GL_MAP2_TEXTURE_COORD_2); - glDisable(GL_MAP2_TEXTURE_COORD_3); - glDisable(GL_MAP2_TEXTURE_COORD_4); - do_nurbs_curve(nobj); - glPopAttrib(); - nobj->nurbs_type = GLU_NURBS_NONE; -} - - -void GLAPIENTRY -gluNurbsCurve(GLUnurbsObj * nobj, GLint nknots, GLfloat * knot, - GLint stride, GLfloat * ctlarray, GLint order, GLenum type) -{ - if (nobj->nurbs_type == GLU_NURBS_TRIM) { -#if 0 -/* TODO: NOT IMPLEMENTED YET */ - nurbs_trim *ptr1; - trim_list *ptr2; - - if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) { - call_user_error(nobj, GLU_NURBS_ERROR14); - return; - } - for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next); - if (ptr1->trim_loop) { - for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next); - if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) { - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return; - } - ptr2 = ptr2->next; - } - else { - if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) { - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return; - } - ptr1->trim_loop = ptr2; - } - ptr2->trim_type = GLU_TRIM_NURBS; - ptr2->curve.nurbs_curve.knot_count = nknots; - ptr2->curve.nurbs_curve.knot = knot; - ptr2->curve.nurbs_curve.stride = stride; - ptr2->curve.nurbs_curve.ctrlarray = ctlarray; - ptr2->curve.nurbs_curve.order = order; - ptr2->curve.nurbs_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3); - ptr2->curve.nurbs_curve.type = type; - ptr2->next = NULL; -#endif - } - else { - if (type == GLU_MAP1_TRIM_2 || type == GLU_MAP1_TRIM_3) { - call_user_error(nobj, GLU_NURBS_ERROR22); - return; - } - if (nobj->nurbs_type != GLU_NURBS_CURVE) { - call_user_error(nobj, GLU_NURBS_ERROR10); - return; - } - switch (type) { - case GL_MAP1_VERTEX_3: - case GL_MAP1_VERTEX_4: - if (nobj->curve.geom.type != GLU_INVALID_ENUM) { - call_user_error(nobj, GLU_NURBS_ERROR8); - return; - } - nobj->curve.geom.type = type; - nobj->curve.geom.knot_count = nknots; - nobj->curve.geom.knot = knot; - nobj->curve.geom.stride = stride; - nobj->curve.geom.ctrlarray = ctlarray; - nobj->curve.geom.order = order; - break; - case GL_MAP1_INDEX: - case GL_MAP1_COLOR_4: - nobj->curve.color.type = type; - nobj->curve.color.knot_count = nknots; - nobj->curve.color.knot = knot; - nobj->curve.color.stride = stride; - nobj->curve.color.ctrlarray = ctlarray; - nobj->curve.color.order = order; - break; - case GL_MAP1_NORMAL: - nobj->curve.normal.type = type; - nobj->curve.normal.knot_count = nknots; - nobj->curve.normal.knot = knot; - nobj->curve.normal.stride = stride; - nobj->curve.normal.ctrlarray = ctlarray; - nobj->curve.normal.order = order; - break; - case GL_MAP1_TEXTURE_COORD_1: - case GL_MAP1_TEXTURE_COORD_2: - case GL_MAP1_TEXTURE_COORD_3: - case GL_MAP1_TEXTURE_COORD_4: - nobj->curve.texture.type = type; - nobj->curve.texture.knot_count = nknots; - nobj->curve.texture.knot = knot; - nobj->curve.texture.stride = stride; - nobj->curve.texture.ctrlarray = ctlarray; - nobj->curve.texture.order = order; - break; - default: - call_user_error(nobj, GLU_INVALID_ENUM); - } - } -} - - -void GLAPIENTRY -gluBeginSurface(GLUnurbsObj * nobj) -{ - switch (nobj->nurbs_type) { - case GLU_NURBS_NONE: - nobj->nurbs_type = GLU_NURBS_SURFACE; - nobj->surface.geom.type = GLU_INVALID_ENUM; - nobj->surface.color.type = GLU_INVALID_ENUM; - nobj->surface.texture.type = GLU_INVALID_ENUM; - nobj->surface.normal.type = GLU_INVALID_ENUM; - break; - case GLU_NURBS_TRIM: - call_user_error(nobj, GLU_NURBS_ERROR16); - break; - case GLU_NURBS_SURFACE: - case GLU_NURBS_NO_TRIM: - case GLU_NURBS_TRIM_DONE: - call_user_error(nobj, GLU_NURBS_ERROR27); - break; - case GLU_NURBS_CURVE: - call_user_error(nobj, GLU_NURBS_ERROR6); - break; - } -} - - -void GLAPIENTRY -gluEndSurface(GLUnurbsObj * nobj) -{ - switch (nobj->nurbs_type) { - case GLU_NURBS_NONE: - call_user_error(nobj, GLU_NURBS_ERROR13); - break; - case GLU_NURBS_TRIM: - call_user_error(nobj, GLU_NURBS_ERROR12); - break; - case GLU_NURBS_TRIM_DONE: -/* if(nobj->trim->trim_loop==NULL) - { - call_user_error(nobj,GLU_NURBS_ERROR18); - return; - }*/ - /* no break - fallthrough */ - case GLU_NURBS_NO_TRIM: - glPushAttrib((GLbitfield) - (GL_EVAL_BIT | GL_ENABLE_BIT | GL_POLYGON_BIT)); - glDisable(GL_MAP2_VERTEX_3); - glDisable(GL_MAP2_VERTEX_4); - glDisable(GL_MAP2_INDEX); - glDisable(GL_MAP2_COLOR_4); - glDisable(GL_MAP2_NORMAL); - glDisable(GL_MAP2_TEXTURE_COORD_1); - glDisable(GL_MAP2_TEXTURE_COORD_2); - glDisable(GL_MAP2_TEXTURE_COORD_3); - glDisable(GL_MAP2_TEXTURE_COORD_4); -/* glDisable(GL_MAP1_VERTEX_3); - glDisable(GL_MAP1_VERTEX_4); - glDisable(GL_MAP1_INDEX); - glDisable(GL_MAP1_COLOR_4); - glDisable(GL_MAP1_NORMAL); - glDisable(GL_MAP1_TEXTURE_COORD_1); - glDisable(GL_MAP1_TEXTURE_COORD_2); - glDisable(GL_MAP1_TEXTURE_COORD_3); - glDisable(GL_MAP1_TEXTURE_COORD_4);*/ - do_nurbs_surface(nobj); - glPopAttrib(); - break; - default: - call_user_error(nobj, GLU_NURBS_ERROR8); - } - nobj->nurbs_type = GLU_NURBS_NONE; -} - - -void GLAPIENTRY -gluNurbsSurface(GLUnurbsObj * nobj, - GLint sknot_count, GLfloat * sknot, - GLint tknot_count, GLfloat * tknot, - GLint s_stride, GLint t_stride, - GLfloat * ctrlarray, GLint sorder, GLint torder, GLenum type) -{ - if (nobj->nurbs_type == GLU_NURBS_NO_TRIM - || nobj->nurbs_type == GLU_NURBS_TRIM - || nobj->nurbs_type == GLU_NURBS_TRIM_DONE) { - if (type == GL_MAP2_VERTEX_3 || type == GL_MAP2_VERTEX_4) { - call_user_error(nobj, GLU_NURBS_ERROR8); - return; - } - } - else if (nobj->nurbs_type != GLU_NURBS_SURFACE) { - call_user_error(nobj, GLU_NURBS_ERROR11); - return; - } - switch (type) { - case GL_MAP2_VERTEX_3: - case GL_MAP2_VERTEX_4: - nobj->surface.geom.sknot_count = sknot_count; - nobj->surface.geom.sknot = sknot; - nobj->surface.geom.tknot_count = tknot_count; - nobj->surface.geom.tknot = tknot; - nobj->surface.geom.s_stride = s_stride; - nobj->surface.geom.t_stride = t_stride; - nobj->surface.geom.ctrlarray = ctrlarray; - nobj->surface.geom.sorder = sorder; - nobj->surface.geom.torder = torder; - nobj->surface.geom.type = type; - nobj->nurbs_type = GLU_NURBS_NO_TRIM; - break; - case GL_MAP2_INDEX: - case GL_MAP2_COLOR_4: - nobj->surface.color.sknot_count = sknot_count; - nobj->surface.color.sknot = sknot; - nobj->surface.color.tknot_count = tknot_count; - nobj->surface.color.tknot = tknot; - nobj->surface.color.s_stride = s_stride; - nobj->surface.color.t_stride = t_stride; - nobj->surface.color.ctrlarray = ctrlarray; - nobj->surface.color.sorder = sorder; - nobj->surface.color.torder = torder; - nobj->surface.color.type = type; - break; - case GL_MAP2_NORMAL: - nobj->surface.normal.sknot_count = sknot_count; - nobj->surface.normal.sknot = sknot; - nobj->surface.normal.tknot_count = tknot_count; - nobj->surface.normal.tknot = tknot; - nobj->surface.normal.s_stride = s_stride; - nobj->surface.normal.t_stride = t_stride; - nobj->surface.normal.ctrlarray = ctrlarray; - nobj->surface.normal.sorder = sorder; - nobj->surface.normal.torder = torder; - nobj->surface.normal.type = type; - break; - case GL_MAP2_TEXTURE_COORD_1: - case GL_MAP2_TEXTURE_COORD_2: - case GL_MAP2_TEXTURE_COORD_3: - case GL_MAP2_TEXTURE_COORD_4: - nobj->surface.texture.sknot_count = sknot_count; - nobj->surface.texture.sknot = sknot; - nobj->surface.texture.tknot_count = tknot_count; - nobj->surface.texture.tknot = tknot; - nobj->surface.texture.s_stride = s_stride; - nobj->surface.texture.t_stride = t_stride; - nobj->surface.texture.ctrlarray = ctrlarray; - nobj->surface.texture.sorder = sorder; - nobj->surface.texture.torder = torder; - nobj->surface.texture.type = type; - break; - default: - call_user_error(nobj, GLU_INVALID_ENUM); - } -} - - -void GLAPIENTRY -gluNurbsCallback(GLUnurbsObj * nobj, GLenum which, void (GLCALLBACK * fn) ()) -{ - nobj->error_callback = (void (GLCALLBACKPCAST) (GLenum)) fn; - - if (which != GLU_ERROR) - call_user_error(nobj, GLU_INVALID_ENUM); -} - -void GLAPIENTRY -gluBeginTrim(GLUnurbsObj * nobj) -{ -#if 0 - nurbs_trim *ptr; -#endif - - if (nobj->nurbs_type != GLU_NURBS_TRIM_DONE) - if (nobj->nurbs_type != GLU_NURBS_NO_TRIM) { - call_user_error(nobj, GLU_NURBS_ERROR15); - return; - } - nobj->nurbs_type = GLU_NURBS_TRIM; - fprintf(stderr, "NURBS - trimming not supported yet\n"); -#if 0 - if ((ptr = (nurbs_trim *) malloc(sizeof(nurbs_trim))) == NULL) { - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return; - } - if (nobj->trim) { - nurbs_trim *tmp_ptr; - - for (tmp_ptr = nobj->trim; tmp_ptr->next; tmp_ptr = tmp_ptr->next); - tmp_ptr->next = ptr; - } - else - nobj->trim = ptr; - ptr->trim_loop = NULL; - ptr->segments = NULL; - ptr->next = NULL; -#endif -} - -void GLAPIENTRY -gluPwlCurve(GLUnurbsObj * nobj, GLint count, GLfloat * array, GLint stride, - GLenum type) -{ -#if 0 - nurbs_trim *ptr1; - trim_list *ptr2; -#endif - if (nobj->nurbs_type == GLU_NURBS_CURVE) { - call_user_error(nobj, GLU_NURBS_ERROR9); - return; - } - if (nobj->nurbs_type == GLU_NURBS_NONE) { - call_user_error(nobj, GLU_NURBS_ERROR19); - return; - } - if (type != GLU_MAP1_TRIM_2 && type != GLU_MAP1_TRIM_3) { - call_user_error(nobj, GLU_NURBS_ERROR14); - return; - } -#if 0 - for (ptr1 = nobj->trim; ptr1->next; ptr1 = ptr1->next); - if (ptr1->trim_loop) { - for (ptr2 = ptr1->trim_loop; ptr2->next; ptr2 = ptr2->next); - if ((ptr2->next = (trim_list *) malloc(sizeof(trim_list))) == NULL) { - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return; - } - ptr2 = ptr2->next; - } - else { - if ((ptr2 = (trim_list *) malloc(sizeof(trim_list))) == NULL) { - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return; - } - ptr1->trim_loop = ptr2; - } - ptr2->trim_type = GLU_TRIM_PWL; - ptr2->curve.pwl_curve.pt_count = count; - ptr2->curve.pwl_curve.ctrlarray = array; - ptr2->curve.pwl_curve.stride = stride; - ptr2->curve.pwl_curve.dim = (type == GLU_MAP1_TRIM_2 ? 2 : 3); - ptr2->curve.pwl_curve.type = type; - ptr2->next = NULL; -#endif -} - -void GLAPIENTRY -gluEndTrim(GLUnurbsObj * nobj) -{ - if (nobj->nurbs_type != GLU_NURBS_TRIM) { - call_user_error(nobj, GLU_NURBS_ERROR17); - return; - } - nobj->nurbs_type = GLU_NURBS_TRIM_DONE; -} diff --git a/src/glu/mesa/nurbs.h b/src/glu/mesa/nurbs.h deleted file mode 100644 index 3642e213a8..0000000000 --- a/src/glu/mesa/nurbs.h +++ /dev/null @@ -1,252 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifndef NURBS_H -#define NURBS_H - - -#define EPSILON 1e-06 /* epsilon for double precision compares */ - -typedef enum -{ - GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM, - GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE -} -GLU_nurbs_enum; - -typedef enum -{ - GLU_TRIM_NURBS, GLU_TRIM_PWL -} -GLU_trim_enum; - -typedef struct -{ - GLint sknot_count; - GLfloat *sknot; - GLint tknot_count; - GLfloat *tknot; - GLint s_stride; - GLint t_stride; - GLfloat *ctrlarray; - GLint sorder; - GLint torder; - GLint dim; - GLenum type; -} -surface_attribs; - -typedef struct -{ - surface_attribs geom; - surface_attribs color; - surface_attribs texture; - surface_attribs normal; -} -nurbs_surface; - -typedef struct -{ - GLint knot_count; - GLfloat *knot; - GLint stride; - GLfloat *ctrlarray; - GLint order; - GLint dim; - GLenum type; -} -curve_attribs; - -typedef struct -{ - GLint pt_count; - GLfloat *ctrlarray; - GLint stride; - GLint dim; - GLenum type; -} -pwl_curve_attribs; - -typedef struct -{ - curve_attribs geom; - curve_attribs color; - curve_attribs texture; - curve_attribs normal; -} -nurbs_curve; - -typedef struct trim_list_str -{ - GLU_trim_enum trim_type; - union - { - pwl_curve_attribs pwl_curve; - curve_attribs nurbs_curve; - } - curve; - struct trim_list_str *next; -} -trim_list; - -typedef struct seg_trim_str -{ - GLfloat *points; - GLint pt_cnt, seg_array_len; - struct seg_trim_str *next; -} -trim_segments; - -typedef struct nurbs_trim_str -{ - trim_list *trim_loop; - trim_segments *segments; - struct nurbs_trim_str *next; -} -nurbs_trim; - -typedef struct -{ - GLfloat model[16], proj[16], viewport[4]; -} -culling_and_sampling_str; - -struct GLUnurbs -{ - GLboolean culling; - GLenum error; - void (GLCALLBACK * error_callback) (GLenum err); - GLenum display_mode; - GLU_nurbs_enum nurbs_type; - GLboolean auto_load_matrix; - culling_and_sampling_str sampling_matrices; - GLenum sampling_method; - GLfloat sampling_tolerance; - GLfloat parametric_tolerance; - GLint u_step, v_step; - nurbs_surface surface; - nurbs_curve curve; - nurbs_trim *trim; -}; - -typedef struct -{ - GLfloat *knot; - GLint nknots; - GLfloat *unified_knot; - GLint unified_nknots; - GLint order; - GLint t_min, t_max; - GLint delta_nknots; - GLboolean open_at_begin, open_at_end; - GLfloat *new_knot; - GLfloat *alpha; -} -knot_str_type; - -typedef struct -{ - GLfloat *geom_ctrl; - GLint geom_s_stride, geom_t_stride; - GLfloat **geom_offsets; - GLint geom_s_pt_cnt, geom_t_pt_cnt; - GLfloat *color_ctrl; - GLint color_s_stride, color_t_stride; - GLfloat **color_offsets; - GLint color_s_pt_cnt, color_t_pt_cnt; - GLfloat *normal_ctrl; - GLint normal_s_stride, normal_t_stride; - GLfloat **normal_offsets; - GLint normal_s_pt_cnt, normal_t_pt_cnt; - GLfloat *texture_ctrl; - GLint texture_s_stride, texture_t_stride; - GLfloat **texture_offsets; - GLint texture_s_pt_cnt, texture_t_pt_cnt; - GLint s_bezier_cnt, t_bezier_cnt; -} -new_ctrl_type; - -extern void call_user_error(GLUnurbsObj * nobj, GLenum error); - -extern GLenum test_knot(GLint nknots, GLfloat * knot, GLint order); - -extern GLenum explode_knot(knot_str_type * the_knot); - -extern GLenum calc_alphas(knot_str_type * the_knot); - -extern GLenum calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, - knot_str_type * the_knot, GLint dim, - GLfloat ** new_ctrl, GLint * ncontrol); - -extern GLenum glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * new_ctrl, - GLint n_ctrl, GLint order, GLint dim, - GLint ** factors); - -extern GLenum glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - int **sfactors, GLint ** tfactors); - -extern GLenum glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - int **sfactors, GLint ** tfactors); - -extern GLenum glu_do_sampling_param_3D(GLUnurbsObj * nobj, - new_ctrl_type * new_ctrl, - int **sfactors, GLint ** tfactors); - -extern GLboolean fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * ctrl, - GLint n_ctrl, GLint stride, GLint dim); - -extern GLboolean fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * ctrl, - GLint s_n_ctrl, GLint t_n_ctrl, - GLint s_stride, GLint t_stride, - GLint dim); - -extern void do_nurbs_curve(GLUnurbsObj * nobj); - -extern void do_nurbs_surface(GLUnurbsObj * nobj); - -extern GLenum patch_trimming(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - GLint * sfactors, GLint * tfactors); - -extern void collect_unified_knot(knot_str_type * dest, knot_str_type * src, - GLfloat maximal_min_knot, - GLfloat minimal_max_knot); - -extern GLenum select_knot_working_range(GLUnurbsObj * nobj, - knot_str_type * geom_knot, - knot_str_type * color_knot, - knot_str_type * normal_knot, - knot_str_type * texture_knot); - -extern void free_unified_knots(knot_str_type * geom_knot, - knot_str_type * color_knot, - knot_str_type * normal_knot, - knot_str_type * texture_knot); - - - -#endif diff --git a/src/glu/mesa/nurbscrv.c b/src/glu/mesa/nurbscrv.c deleted file mode 100644 index 4483e1f776..0000000000 --- a/src/glu/mesa/nurbscrv.c +++ /dev/null @@ -1,444 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "gluP.h" -#include "nurbs.h" -#endif - - -static int -get_curve_dim(GLenum type) -{ - switch (type) { - case GL_MAP1_VERTEX_3: - return 3; - case GL_MAP1_VERTEX_4: - return 4; - case GL_MAP1_INDEX: - return 1; - case GL_MAP1_COLOR_4: - return 4; - case GL_MAP1_NORMAL: - return 3; - case GL_MAP1_TEXTURE_COORD_1: - return 1; - case GL_MAP1_TEXTURE_COORD_2: - return 2; - case GL_MAP1_TEXTURE_COORD_3: - return 3; - case GL_MAP1_TEXTURE_COORD_4: - return 4; - default: - abort(); /* TODO: is this OK? */ - } - return 0; /*never get here */ -} - -static GLenum -test_nurbs_curve(GLUnurbsObj * nobj, curve_attribs * attribs) -{ - GLenum err; - GLint tmp_int; - - if (attribs->order < 0) { - call_user_error(nobj, GLU_INVALID_VALUE); - return GLU_ERROR; - } - glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int); - if (attribs->order > tmp_int || attribs->order < 2) { - call_user_error(nobj, GLU_NURBS_ERROR1); - return GLU_ERROR; - } - if (attribs->knot_count < attribs->order + 2) { - call_user_error(nobj, GLU_NURBS_ERROR2); - return GLU_ERROR; - } - if (attribs->stride < 0) { - call_user_error(nobj, GLU_NURBS_ERROR34); - return GLU_ERROR; - } - if (attribs->knot == NULL || attribs->ctrlarray == NULL) { - call_user_error(nobj, GLU_NURBS_ERROR36); - return GLU_ERROR; - } - if ((err = test_knot(attribs->knot_count, attribs->knot, attribs->order)) - != GLU_NO_ERROR) { - call_user_error(nobj, err); - return GLU_ERROR; - } - return GLU_NO_ERROR; -} - -static GLenum -test_nurbs_curves(GLUnurbsObj * nobj) -{ - /* test the geometric data */ - if (test_nurbs_curve(nobj, &(nobj->curve.geom)) != GLU_NO_ERROR) - return GLU_ERROR; - /* now test the attributive data */ - /* color */ - if (nobj->curve.color.type != GLU_INVALID_ENUM) - if (test_nurbs_curve(nobj, &(nobj->curve.color)) != GLU_NO_ERROR) - return GLU_ERROR; - /* normal */ - if (nobj->curve.normal.type != GLU_INVALID_ENUM) - if (test_nurbs_curve(nobj, &(nobj->curve.normal)) != GLU_NO_ERROR) - return GLU_ERROR; - /* texture */ - if (nobj->curve.texture.type != GLU_INVALID_ENUM) - if (test_nurbs_curve(nobj, &(nobj->curve.texture)) != GLU_NO_ERROR) - return GLU_ERROR; - return GLU_NO_ERROR; -} - -/* prepare the knot information structures */ -static GLenum -fill_knot_structures(GLUnurbsObj * nobj, knot_str_type * geom_knot, - knot_str_type * color_knot, knot_str_type * normal_knot, - knot_str_type * texture_knot) -{ - GLint order; - GLfloat *knot; - GLint nknots; - GLint t_min, t_max; - - geom_knot->unified_knot = NULL; - knot = geom_knot->knot = nobj->curve.geom.knot; - nknots = geom_knot->nknots = nobj->curve.geom.knot_count; - order = geom_knot->order = nobj->curve.geom.order; - geom_knot->delta_nknots = 0; - t_min = geom_knot->t_min = order - 1; - t_max = geom_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - geom_knot->open_at_begin = GL_TRUE; - } - else - geom_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - geom_knot->open_at_end = GL_TRUE; - } - else - geom_knot->open_at_end = GL_FALSE; - if (nobj->curve.color.type != GLU_INVALID_ENUM) { - color_knot->unified_knot = (GLfloat *) 1; - knot = color_knot->knot = nobj->curve.color.knot; - nknots = color_knot->nknots = nobj->curve.color.knot_count; - order = color_knot->order = nobj->curve.color.order; - color_knot->delta_nknots = 0; - t_min = color_knot->t_min = order - 1; - t_max = color_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - color_knot->open_at_begin = GL_TRUE; - } - else - color_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - color_knot->open_at_end = GL_TRUE; - } - else - color_knot->open_at_end = GL_FALSE; - } - else - color_knot->unified_knot = NULL; - if (nobj->curve.normal.type != GLU_INVALID_ENUM) { - normal_knot->unified_knot = (GLfloat *) 1; - knot = normal_knot->knot = nobj->curve.normal.knot; - nknots = normal_knot->nknots = nobj->curve.normal.knot_count; - order = normal_knot->order = nobj->curve.normal.order; - normal_knot->delta_nknots = 0; - t_min = normal_knot->t_min = order - 1; - t_max = normal_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - normal_knot->open_at_begin = GL_TRUE; - } - else - normal_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - normal_knot->open_at_end = GL_TRUE; - } - else - normal_knot->open_at_end = GL_FALSE; - } - else - normal_knot->unified_knot = NULL; - if (nobj->curve.texture.type != GLU_INVALID_ENUM) { - texture_knot->unified_knot = (GLfloat *) 1; - knot = texture_knot->knot = nobj->curve.texture.knot; - nknots = texture_knot->nknots = nobj->curve.texture.knot_count; - order = texture_knot->order = nobj->curve.texture.order; - texture_knot->delta_nknots = 0; - t_min = texture_knot->t_min = order - 1; - t_max = texture_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - texture_knot->open_at_begin = GL_TRUE; - } - else - texture_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - texture_knot->open_at_end = GL_TRUE; - } - else - texture_knot->open_at_end = GL_FALSE; - } - else - texture_knot->unified_knot = NULL; - return GLU_NO_ERROR; -} - -/* covert the NURBS curve into a series of adjacent Bezier curves */ -static GLenum -convert_curve(knot_str_type * the_knot, curve_attribs * attrib, - GLfloat ** new_ctrl, GLint * ncontrol) -{ - GLenum err; - - if ((err = explode_knot(the_knot)) != GLU_NO_ERROR) { - if (the_knot->unified_knot) { - free(the_knot->unified_knot); - the_knot->unified_knot = NULL; - } - return err; - } - if (the_knot->unified_knot) { - free(the_knot->unified_knot); - the_knot->unified_knot = NULL; - } - if ((err = calc_alphas(the_knot)) != GLU_NO_ERROR) { - free(the_knot->new_knot); - return err; - } - free(the_knot->new_knot); - if ((err = calc_new_ctrl_pts(attrib->ctrlarray, attrib->stride, the_knot, - attrib->dim, new_ctrl, ncontrol)) - != GLU_NO_ERROR) { - free(the_knot->alpha); - return err; - } - free(the_knot->alpha); - return GLU_NO_ERROR; -} - -/* covert curves - geometry and possible attribute ones into equivalent */ -/* sequence of adjacent Bezier curves */ -static GLenum -convert_curves(GLUnurbsObj * nobj, GLfloat ** new_geom_ctrl, - GLint * ncontrol, GLfloat ** new_color_ctrl, - GLfloat ** new_normal_ctrl, GLfloat ** new_texture_ctrl) -{ - knot_str_type geom_knot, color_knot, normal_knot, texture_knot; - GLint junk; - GLenum err; - - *new_color_ctrl = *new_normal_ctrl = *new_texture_ctrl = NULL; - - if (fill_knot_structures(nobj, &geom_knot, &color_knot, &normal_knot, - &texture_knot) != GLU_NO_ERROR) - return GLU_ERROR; - - /* unify knots - all knots should have the same number of working */ - /* ranges */ - if ( - (err = - select_knot_working_range(nobj, &geom_knot, &color_knot, &normal_knot, - &texture_knot)) != GLU_NO_ERROR) { - return err; - } - /* convert the geometry curve */ - nobj->curve.geom.dim = get_curve_dim(nobj->curve.geom.type); - if ((err = convert_curve(&geom_knot, &(nobj->curve.geom), new_geom_ctrl, - ncontrol)) != GLU_NO_ERROR) { - free_unified_knots(&geom_knot, &color_knot, &normal_knot, - &texture_knot); - call_user_error(nobj, err); - return err; - } - /* if additional attributive curves are given convert them as well */ - if (color_knot.unified_knot) { - nobj->curve.color.dim = get_curve_dim(nobj->curve.color.type); - if ((err = convert_curve(&color_knot, &(nobj->curve.color), - new_color_ctrl, &junk)) != GLU_NO_ERROR) { - free_unified_knots(&geom_knot, &color_knot, &normal_knot, - &texture_knot); - free(*new_geom_ctrl); - call_user_error(nobj, err); - return err; - } - } - if (normal_knot.unified_knot) { - nobj->curve.normal.dim = get_curve_dim(nobj->curve.normal.type); - if ((err = convert_curve(&normal_knot, &(nobj->curve.normal), - new_normal_ctrl, &junk)) != GLU_NO_ERROR) { - free_unified_knots(&geom_knot, &color_knot, &normal_knot, - &texture_knot); - free(*new_geom_ctrl); - if (*new_color_ctrl) - free(*new_color_ctrl); - call_user_error(nobj, err); - return err; - } - } - if (texture_knot.unified_knot) { - nobj->curve.texture.dim = get_curve_dim(nobj->curve.texture.type); - if ((err = convert_curve(&texture_knot, &(nobj->curve.texture), - new_texture_ctrl, &junk)) != GLU_NO_ERROR) { - free_unified_knots(&geom_knot, &color_knot, &normal_knot, - &texture_knot); - free(*new_geom_ctrl); - if (*new_color_ctrl) - free(*new_color_ctrl); - if (*new_normal_ctrl) - free(*new_normal_ctrl); - call_user_error(nobj, err); - return err; - } - } - return GLU_NO_ERROR; -} - -/* main NURBS curve procedure */ -void -do_nurbs_curve(GLUnurbsObj * nobj) -{ - GLint geom_order, color_order = 0, normal_order = 0, texture_order = 0; - GLenum geom_type; - GLint n_ctrl; - GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl, - *new_texture_ctrl; - GLfloat *geom_ctrl = 0, *color_ctrl = 0, *normal_ctrl = 0, *texture_ctrl = 0; - GLint *factors; - GLint i, j; - GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0; - - /* test the user supplied data */ - if (test_nurbs_curves(nobj) != GLU_NO_ERROR) - return; - - if (convert_curves(nobj, &new_geom_ctrl, &n_ctrl, &new_color_ctrl, - &new_normal_ctrl, &new_texture_ctrl) != GLU_NO_ERROR) - return; - - geom_order = nobj->curve.geom.order; - geom_type = nobj->curve.geom.type; - geom_dim = nobj->curve.geom.dim; - - if (glu_do_sampling_crv(nobj, new_geom_ctrl, n_ctrl, geom_order, geom_dim, - &factors) != GLU_NO_ERROR) { - free(new_geom_ctrl); - if (new_color_ctrl) - free(new_color_ctrl); - if (new_normal_ctrl) - free(new_normal_ctrl); - if (new_texture_ctrl) - free(new_texture_ctrl); - return; - } - glEnable(geom_type); - if (new_color_ctrl) { - glEnable(nobj->curve.color.type); - color_dim = nobj->curve.color.dim; - color_ctrl = new_color_ctrl; - color_order = nobj->curve.color.order; - } - if (new_normal_ctrl) { - glEnable(nobj->curve.normal.type); - normal_dim = nobj->curve.normal.dim; - normal_ctrl = new_normal_ctrl; - normal_order = nobj->curve.normal.order; - } - if (new_texture_ctrl) { - glEnable(nobj->curve.texture.type); - texture_dim = nobj->curve.texture.dim; - texture_ctrl = new_texture_ctrl; - texture_order = nobj->curve.texture.order; - } - for (i = 0, j = 0, geom_ctrl = new_geom_ctrl; - i < n_ctrl; i += geom_order, j++, geom_ctrl += geom_order * geom_dim) { - if (fine_culling_test_2D - (nobj, geom_ctrl, geom_order, geom_dim, geom_dim)) { - color_ctrl += color_order * color_dim; - normal_ctrl += normal_order * normal_dim; - texture_ctrl += texture_order * texture_dim; - continue; - } - glMap1f(geom_type, 0.0, 1.0, geom_dim, geom_order, geom_ctrl); - if (new_color_ctrl) { - glMap1f(nobj->curve.color.type, 0.0, 1.0, color_dim, - color_order, color_ctrl); - color_ctrl += color_order * color_dim; - } - if (new_normal_ctrl) { - glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim, - normal_order, normal_ctrl); - normal_ctrl += normal_order * normal_dim; - } - if (new_texture_ctrl) { - glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim, - texture_order, texture_ctrl); - texture_ctrl += texture_order * texture_dim; - } - glMapGrid1f(factors[j], 0.0, 1.0); - glEvalMesh1(GL_LINE, 0, factors[j]); - } - free(new_geom_ctrl); - free(factors); - if (new_color_ctrl) - free(new_color_ctrl); - if (new_normal_ctrl) - free(new_normal_ctrl); - if (new_texture_ctrl) - free(new_texture_ctrl); -} diff --git a/src/glu/mesa/nurbssrf.c b/src/glu/mesa/nurbssrf.c deleted file mode 100644 index d39fa47d18..0000000000 --- a/src/glu/mesa/nurbssrf.c +++ /dev/null @@ -1,1317 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include "gluP.h" -#include "nurbs.h" -#endif - - -static int -get_surface_dim(GLenum type) -{ - switch (type) { - case GL_MAP2_VERTEX_3: - return 3; - case GL_MAP2_VERTEX_4: - return 4; - case GL_MAP2_INDEX: - return 1; - case GL_MAP2_COLOR_4: - return 4; - case GL_MAP2_NORMAL: - return 3; - case GL_MAP2_TEXTURE_COORD_1: - return 1; - case GL_MAP2_TEXTURE_COORD_2: - return 2; - case GL_MAP2_TEXTURE_COORD_3: - return 3; - case GL_MAP2_TEXTURE_COORD_4: - return 4; - default: - abort(); /* TODO: is this OK? */ - } - return 0; /*never get here */ -} - -static GLenum -test_nurbs_surface(GLUnurbsObj * nobj, surface_attribs * attrib) -{ - GLenum err; - GLint tmp_int; - - if (attrib->sorder < 0 || attrib->torder < 0) { - call_user_error(nobj, GLU_INVALID_VALUE); - return GLU_ERROR; - } - glGetIntegerv(GL_MAX_EVAL_ORDER, &tmp_int); - if (attrib->sorder > tmp_int || attrib->sorder < 2) { - call_user_error(nobj, GLU_NURBS_ERROR1); - return GLU_ERROR; - } - if (attrib->torder > tmp_int || attrib->torder < 2) { - call_user_error(nobj, GLU_NURBS_ERROR1); - return GLU_ERROR; - } - if (attrib->sknot_count < attrib->sorder + 2) { - call_user_error(nobj, GLU_NURBS_ERROR2); - return GLU_ERROR; - } - if (attrib->tknot_count < attrib->torder + 2) { - call_user_error(nobj, GLU_NURBS_ERROR2); - return GLU_ERROR; - } - if (attrib->s_stride < 0 || attrib->t_stride < 0) { - call_user_error(nobj, GLU_NURBS_ERROR34); - return GLU_ERROR; - } - if (attrib->sknot == NULL || attrib->tknot == NULL - || attrib->ctrlarray == NULL) { - call_user_error(nobj, GLU_NURBS_ERROR36); - return GLU_ERROR; - } - if ((err = test_knot(attrib->tknot_count, attrib->tknot, attrib->torder)) - != GLU_NO_ERROR) { - call_user_error(nobj, err); - return GLU_ERROR; - } - if ((err = test_knot(attrib->sknot_count, attrib->sknot, attrib->sorder)) - != GLU_NO_ERROR) { - call_user_error(nobj, err); - return GLU_ERROR; - } - return GLU_NO_ERROR; -} - -static GLenum -test_nurbs_surfaces(GLUnurbsObj * nobj) -{ - /* test the geometric data */ - if (test_nurbs_surface(nobj, &(nobj->surface.geom)) != GLU_NO_ERROR) - return GLU_ERROR; - /* now test the attributive data */ - /* color */ - if (nobj->surface.color.type != GLU_INVALID_ENUM) - if (test_nurbs_surface(nobj, &(nobj->surface.color)) != GLU_NO_ERROR) - return GLU_ERROR; - /* normal */ - if (nobj->surface.normal.type != GLU_INVALID_ENUM) - if (test_nurbs_surface(nobj, &(nobj->surface.normal)) != GLU_NO_ERROR) - return GLU_ERROR; - /* texture */ - if (nobj->surface.texture.type != GLU_INVALID_ENUM) - if (test_nurbs_surface(nobj, &(nobj->surface.texture)) != GLU_NO_ERROR) - return GLU_ERROR; - return GLU_NO_ERROR; -} - -static GLenum -convert_surf(knot_str_type * s_knot, knot_str_type * t_knot, - surface_attribs * attrib, GLfloat ** new_ctrl, - GLint * s_n_ctrl, GLint * t_n_ctrl) -{ - GLfloat **tmp_ctrl; - GLfloat *ctrl_offset; - GLint tmp_n_control; - GLint i, j, t_cnt, s_cnt; - GLint tmp_stride; - GLint dim; - GLenum err; - - /* valid range is empty? */ - if ((s_knot->unified_knot != NULL && s_knot->unified_nknots == 0) || - (t_knot->unified_knot != NULL && t_knot->unified_nknots == 0)) { - if (s_knot->unified_knot) { - free(s_knot->unified_knot); - s_knot->unified_knot = NULL; - } - if (t_knot->unified_knot) { - free(t_knot->unified_knot); - t_knot->unified_knot = NULL; - } - *s_n_ctrl = 0; - *t_n_ctrl = 0; - return GLU_NO_ERROR; - } - t_cnt = attrib->tknot_count - attrib->torder; - s_cnt = attrib->sknot_count - attrib->sorder; - if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * t_cnt)) == NULL) - return GLU_OUT_OF_MEMORY; - if ((err = explode_knot(s_knot)) != GLU_NO_ERROR) { - free(tmp_ctrl); - if (s_knot->unified_knot) { - free(s_knot->unified_knot); - s_knot->unified_knot = NULL; - } - return err; - } - if (s_knot->unified_knot) { - free(s_knot->unified_knot); - s_knot->unified_knot = NULL; - } - if ((err = calc_alphas(s_knot)) != GLU_NO_ERROR) { - free(tmp_ctrl); - free(s_knot->new_knot); - return err; - } - free(s_knot->new_knot); - ctrl_offset = attrib->ctrlarray; - dim = attrib->dim; - for (i = 0; i < t_cnt; i++) { - if ((err = calc_new_ctrl_pts(ctrl_offset, attrib->s_stride, s_knot, - dim, &(tmp_ctrl[i]), - &tmp_n_control)) != GLU_NO_ERROR) { - for (--i; i <= 0; i--) - free(tmp_ctrl[i]); - free(tmp_ctrl); - free(s_knot->alpha); - return err; - } - ctrl_offset += attrib->t_stride; - } - free(s_knot->alpha); - tmp_stride = dim * tmp_n_control; - if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * t_cnt)) - == NULL) { - for (i = 0; i < t_cnt; i++) - free(tmp_ctrl[i]); - free(tmp_ctrl); - return GLU_OUT_OF_MEMORY; - } - for (i = 0; i < tmp_n_control; i++) - for (j = 0; j < t_cnt; j++) - MEMCPY(*new_ctrl + j * dim + i * dim * t_cnt, tmp_ctrl[j] + dim * i, - sizeof(GLfloat) * dim); - for (i = 0; i < t_cnt; i++) - free(tmp_ctrl[i]); - free(tmp_ctrl); - *s_n_ctrl = tmp_n_control; - - if ((tmp_ctrl = (GLfloat **) malloc(sizeof(GLfloat *) * (*s_n_ctrl))) == - NULL) { - return GLU_OUT_OF_MEMORY; - } - if ((err = explode_knot(t_knot)) != GLU_NO_ERROR) { - free(tmp_ctrl); - if (t_knot->unified_knot) { - free(t_knot->unified_knot); - t_knot->unified_knot = NULL; - } - return err; - } - if (t_knot->unified_knot) { - free(t_knot->unified_knot); - t_knot->unified_knot = NULL; - } - if ((err = calc_alphas(t_knot)) != GLU_NO_ERROR) { - free(tmp_ctrl); - free(t_knot->new_knot); - return err; - } - free(t_knot->new_knot); - ctrl_offset = *new_ctrl; - for (i = 0; i < (*s_n_ctrl); i++) { - if ((err = calc_new_ctrl_pts(ctrl_offset, dim, t_knot, - dim, &(tmp_ctrl[i]), - &tmp_n_control)) != GLU_NO_ERROR) { - for (--i; i <= 0; i--) - free(tmp_ctrl[i]); - free(tmp_ctrl); - free(t_knot->alpha); - return err; - } - ctrl_offset += dim * t_cnt; - } - free(t_knot->alpha); - free(*new_ctrl); - tmp_stride = dim * tmp_n_control; - if ( - (*new_ctrl = - (GLfloat *) malloc(sizeof(GLfloat) * tmp_stride * (*s_n_ctrl))) == - NULL) { - for (i = 0; i < (*s_n_ctrl); i++) - free(tmp_ctrl[i]); - free(tmp_ctrl); - return GLU_OUT_OF_MEMORY; - } - for (i = 0; i < (*s_n_ctrl); i++) { - MEMCPY(*new_ctrl + i * tmp_stride, tmp_ctrl[i], - sizeof(GLfloat) * tmp_stride); - free(tmp_ctrl[i]); - } - free(tmp_ctrl); - *t_n_ctrl = tmp_n_control; - return GLU_NO_ERROR; -} - -/* prepare the knot information structures */ -static GLenum -fill_knot_structures(GLUnurbsObj * nobj, - knot_str_type * geom_s_knot, knot_str_type * geom_t_knot, - knot_str_type * color_s_knot, - knot_str_type * color_t_knot, - knot_str_type * normal_s_knot, - knot_str_type * normal_t_knot, - knot_str_type * texture_s_knot, - knot_str_type * texture_t_knot) -{ - GLint order; - GLfloat *knot; - GLint nknots; - GLint t_min, t_max; - - geom_s_knot->unified_knot = NULL; - knot = geom_s_knot->knot = nobj->surface.geom.sknot; - nknots = geom_s_knot->nknots = nobj->surface.geom.sknot_count; - order = geom_s_knot->order = nobj->surface.geom.sorder; - geom_s_knot->delta_nknots = 0; - t_min = geom_s_knot->t_min = order - 1; - t_max = geom_s_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - geom_s_knot->open_at_begin = GL_TRUE; - } - else - geom_s_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - geom_s_knot->open_at_end = GL_TRUE; - } - else - geom_s_knot->open_at_end = GL_FALSE; - geom_t_knot->unified_knot = NULL; - knot = geom_t_knot->knot = nobj->surface.geom.tknot; - nknots = geom_t_knot->nknots = nobj->surface.geom.tknot_count; - order = geom_t_knot->order = nobj->surface.geom.torder; - geom_t_knot->delta_nknots = 0; - t_min = geom_t_knot->t_min = order - 1; - t_max = geom_t_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - geom_t_knot->open_at_begin = GL_TRUE; - } - else - geom_t_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - geom_t_knot->open_at_end = GL_TRUE; - } - else - geom_t_knot->open_at_end = GL_FALSE; - - if (nobj->surface.color.type != GLU_INVALID_ENUM) { - color_s_knot->unified_knot = (GLfloat *) 1; - knot = color_s_knot->knot = nobj->surface.color.sknot; - nknots = color_s_knot->nknots = nobj->surface.color.sknot_count; - order = color_s_knot->order = nobj->surface.color.sorder; - color_s_knot->delta_nknots = 0; - t_min = color_s_knot->t_min = order - 1; - t_max = color_s_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - color_s_knot->open_at_begin = GL_TRUE; - } - else - color_s_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - color_s_knot->open_at_end = GL_TRUE; - } - else - color_s_knot->open_at_end = GL_FALSE; - color_t_knot->unified_knot = (GLfloat *) 1; - knot = color_t_knot->knot = nobj->surface.color.tknot; - nknots = color_t_knot->nknots = nobj->surface.color.tknot_count; - order = color_t_knot->order = nobj->surface.color.torder; - color_t_knot->delta_nknots = 0; - t_min = color_t_knot->t_min = order - 1; - t_max = color_t_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - color_t_knot->open_at_begin = GL_TRUE; - } - else - color_t_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - color_t_knot->open_at_end = GL_TRUE; - } - else - color_t_knot->open_at_end = GL_FALSE; - } - else { - color_s_knot->unified_knot = NULL; - color_t_knot->unified_knot = NULL; - } - - if (nobj->surface.normal.type != GLU_INVALID_ENUM) { - normal_s_knot->unified_knot = (GLfloat *) 1; - knot = normal_s_knot->knot = nobj->surface.normal.sknot; - nknots = normal_s_knot->nknots = nobj->surface.normal.sknot_count; - order = normal_s_knot->order = nobj->surface.normal.sorder; - normal_s_knot->delta_nknots = 0; - t_min = normal_s_knot->t_min = order - 1; - t_max = normal_s_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - normal_s_knot->open_at_begin = GL_TRUE; - } - else - normal_s_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - normal_s_knot->open_at_end = GL_TRUE; - } - else - normal_s_knot->open_at_end = GL_FALSE; - normal_t_knot->unified_knot = (GLfloat *) 1; - knot = normal_t_knot->knot = nobj->surface.normal.tknot; - nknots = normal_t_knot->nknots = nobj->surface.normal.tknot_count; - order = normal_t_knot->order = nobj->surface.normal.torder; - normal_t_knot->delta_nknots = 0; - t_min = normal_t_knot->t_min = order - 1; - t_max = normal_t_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - normal_t_knot->open_at_begin = GL_TRUE; - } - else - normal_t_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - normal_t_knot->open_at_end = GL_TRUE; - } - else - normal_t_knot->open_at_end = GL_FALSE; - } - else { - normal_s_knot->unified_knot = NULL; - normal_t_knot->unified_knot = NULL; - } - - if (nobj->surface.texture.type != GLU_INVALID_ENUM) { - texture_s_knot->unified_knot = (GLfloat *) 1; - knot = texture_s_knot->knot = nobj->surface.texture.sknot; - nknots = texture_s_knot->nknots = nobj->surface.texture.sknot_count; - order = texture_s_knot->order = nobj->surface.texture.sorder; - texture_s_knot->delta_nknots = 0; - t_min = texture_s_knot->t_min = order - 1; - t_max = texture_s_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - texture_s_knot->open_at_begin = GL_TRUE; - } - else - texture_s_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - texture_s_knot->open_at_end = GL_TRUE; - } - else - texture_s_knot->open_at_end = GL_FALSE; - texture_t_knot->unified_knot = (GLfloat *) 1; - knot = texture_t_knot->knot = nobj->surface.texture.tknot; - nknots = texture_t_knot->nknots = nobj->surface.texture.tknot_count; - order = texture_t_knot->order = nobj->surface.texture.torder; - texture_t_knot->delta_nknots = 0; - t_min = texture_t_knot->t_min = order - 1; - t_max = texture_t_knot->t_max = nknots - order; - if (fabs(knot[t_min] - knot[t_max]) < EPSILON) { - call_user_error(nobj, GLU_NURBS_ERROR3); - return GLU_ERROR; - } - if (fabs(knot[0] - knot[t_min]) < EPSILON) { - /* knot open at beggining */ - texture_t_knot->open_at_begin = GL_TRUE; - } - else - texture_t_knot->open_at_begin = GL_FALSE; - if (fabs(knot[t_max] - knot[nknots - 1]) < EPSILON) { - /* knot open at end */ - texture_t_knot->open_at_end = GL_TRUE; - } - else - texture_t_knot->open_at_end = GL_FALSE; - } - else { - texture_s_knot->unified_knot = NULL; - texture_t_knot->unified_knot = NULL; - } - return GLU_NO_ERROR; -} - - -static void -free_new_ctrl(new_ctrl_type * p) -{ - if (p->geom_ctrl) - free(p->geom_ctrl); - if (p->geom_offsets) - free(p->geom_offsets); - if (p->color_ctrl) { - free(p->color_ctrl); - if (p->color_offsets) - free(p->color_offsets); - } - if (p->normal_ctrl) { - free(p->normal_ctrl); - if (p->normal_offsets) - free(p->normal_offsets); - } - if (p->texture_ctrl) { - free(p->texture_ctrl); - if (p->texture_offsets) - free(p->texture_offsets); - } -} - -/* convert surfaces - geometry and possible attribute ones into equivalent */ -/* sequence of adjacent Bezier patches */ -static GLenum -convert_surfs(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl) -{ - knot_str_type geom_s_knot, color_s_knot, normal_s_knot, texture_s_knot; - knot_str_type geom_t_knot, color_t_knot, normal_t_knot, texture_t_knot; - GLenum err; - - if ((err = fill_knot_structures(nobj, &geom_s_knot, &geom_t_knot, - &color_s_knot, &color_t_knot, - &normal_s_knot, &normal_t_knot, - &texture_s_knot, - &texture_t_knot)) != GLU_NO_ERROR) { - return err; - } - /* unify knots - all knots should have the same working range */ - if ((err = select_knot_working_range(nobj, &geom_s_knot, &color_s_knot, - &normal_s_knot, - &texture_s_knot)) != GLU_NO_ERROR) { - call_user_error(nobj, err); - return err; - } - if ((err = select_knot_working_range(nobj, &geom_t_knot, &color_t_knot, - &normal_t_knot, - &texture_t_knot)) != GLU_NO_ERROR) { - free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot, - &texture_s_knot); - call_user_error(nobj, err); - return err; - } - - /* convert the geometry surface */ - nobj->surface.geom.dim = get_surface_dim(nobj->surface.geom.type); - if ((err = convert_surf(&geom_s_knot, &geom_t_knot, &(nobj->surface.geom), - &(new_ctrl->geom_ctrl), &(new_ctrl->geom_s_pt_cnt), - &(new_ctrl->geom_t_pt_cnt))) != GLU_NO_ERROR) { - free_unified_knots(&geom_s_knot, &color_s_knot, &normal_s_knot, - &texture_s_knot); - free_unified_knots(&geom_t_knot, &color_t_knot, &normal_t_knot, - &texture_t_knot); - call_user_error(nobj, err); - return err; - } - /* if additional attributive surfaces are given convert them as well */ - if (color_s_knot.unified_knot) { - nobj->surface.color.dim = get_surface_dim(nobj->surface.color.type); - if ( - (err = - convert_surf(&color_s_knot, &color_t_knot, &(nobj->surface.color), - &(new_ctrl->color_ctrl), &(new_ctrl->color_s_pt_cnt), - &(new_ctrl->color_t_pt_cnt))) != GLU_NO_ERROR) { - free_unified_knots(&color_s_knot, &color_s_knot, &normal_s_knot, - &texture_s_knot); - free_unified_knots(&color_t_knot, &color_t_knot, &normal_t_knot, - &texture_t_knot); - free_new_ctrl(new_ctrl); - call_user_error(nobj, err); - return err; - } - } - if (normal_s_knot.unified_knot) { - nobj->surface.normal.dim = get_surface_dim(nobj->surface.normal.type); - if ((err = convert_surf(&normal_s_knot, &normal_t_knot, - &(nobj->surface.normal), - &(new_ctrl->normal_ctrl), - &(new_ctrl->normal_s_pt_cnt), - &(new_ctrl->normal_t_pt_cnt))) != - GLU_NO_ERROR) { - free_unified_knots(&normal_s_knot, &normal_s_knot, &normal_s_knot, - &texture_s_knot); - free_unified_knots(&normal_t_knot, &normal_t_knot, &normal_t_knot, - &texture_t_knot); - free_new_ctrl(new_ctrl); - call_user_error(nobj, err); - return err; - } - } - if (texture_s_knot.unified_knot) { - nobj->surface.texture.dim = get_surface_dim(nobj->surface.texture.type); - if ((err = convert_surf(&texture_s_knot, &texture_t_knot, - &(nobj->surface.texture), - &(new_ctrl->texture_ctrl), - &(new_ctrl->texture_s_pt_cnt), - &(new_ctrl->texture_t_pt_cnt))) != - GLU_NO_ERROR) { - free_unified_knots(&texture_s_knot, &texture_s_knot, &texture_s_knot, - &texture_s_knot); - free_unified_knots(&texture_t_knot, &texture_t_knot, &texture_t_knot, - &texture_t_knot); - free_new_ctrl(new_ctrl); - call_user_error(nobj, err); - return err; - } - } - return GLU_NO_ERROR; -} - -/* tesselate the "boundary" Bezier edge strips */ -static void -tesselate_strip_t_line(GLint top_start, GLint top_end, GLint top_z, - GLint bottom_start, GLint bottom_end, GLint bottom_z, - GLint bottom_domain) -{ - GLint top_cnt, bottom_cnt, tri_cnt, k; - GLint direction; - - top_cnt = top_end - top_start; - direction = (top_cnt >= 0 ? 1 : -1); - bottom_cnt = bottom_end - bottom_start; - glBegin(GL_LINES); - while (top_cnt) { - if (bottom_cnt) - tri_cnt = top_cnt / bottom_cnt; - else - tri_cnt = abs(top_cnt); - for (k = 0; k <= tri_cnt; k++, top_start += direction) { - glEvalCoord2f((GLfloat) bottom_z / bottom_domain, - (GLfloat) bottom_start / bottom_domain); - glEvalPoint2(top_z, top_start); - } - if (bottom_cnt) { - glEvalCoord2f((GLfloat) bottom_z / bottom_domain, - (GLfloat) bottom_start / bottom_domain); - bottom_start += direction; - top_start -= direction; - glEvalCoord2f((GLfloat) bottom_z / bottom_domain, - (GLfloat) bottom_start / bottom_domain); - glEvalCoord2f((GLfloat) bottom_z / bottom_domain, - (GLfloat) bottom_start / bottom_domain); - glEvalPoint2(top_z, top_start); - } - top_cnt -= direction * tri_cnt; - bottom_cnt -= direction; - } - glEnd(); -} - - -static void -tesselate_strip_t_fill(GLint top_start, GLint top_end, GLint top_z, - GLint bottom_start, GLint bottom_end, GLint bottom_z, - GLint bottom_domain) -{ - GLint top_cnt, bottom_cnt, tri_cnt, k; - GLint direction; - - top_cnt = top_end - top_start; - direction = (top_cnt >= 0 ? 1 : -1); - bottom_cnt = bottom_end - bottom_start; - while (top_cnt) { - if (bottom_cnt) - tri_cnt = top_cnt / bottom_cnt; - else - tri_cnt = abs(top_cnt); - glBegin(GL_TRIANGLE_FAN); - glEvalCoord2f((GLfloat) bottom_z / bottom_domain, - (GLfloat) bottom_start / bottom_domain); - for (k = 0; k <= tri_cnt; k++, top_start += direction) - glEvalPoint2(top_z, top_start); - if (bottom_cnt) { - bottom_start += direction; - top_start -= direction; - glEvalCoord2f((GLfloat) bottom_z / bottom_domain, - (GLfloat) bottom_start / bottom_domain); - } - glEnd(); - top_cnt -= direction * tri_cnt; - bottom_cnt -= direction; - } -} - - -static void -tesselate_strip_t(GLenum display_mode, GLint top_start, GLint top_end, - GLint top_z, GLint bottom_start, GLint bottom_end, - GLint bottom_z, GLint bottom_domain) -{ - if (display_mode == GL_FILL) - tesselate_strip_t_fill(top_start, top_end, top_z, bottom_start, - bottom_end, bottom_z, bottom_domain); - else - tesselate_strip_t_line(top_start, top_end, top_z, bottom_start, - bottom_end, bottom_z, bottom_domain); -} - - -static void -tesselate_strip_s_fill(GLint top_start, GLint top_end, GLint top_z, - GLint bottom_start, GLint bottom_end, GLint bottom_z, - GLfloat bottom_domain) -{ - GLint top_cnt, bottom_cnt, tri_cnt, k; - GLint direction; - - top_cnt = top_end - top_start; - direction = (top_cnt >= 0 ? 1 : -1); - bottom_cnt = bottom_end - bottom_start; - while (top_cnt) { - if (bottom_cnt) - tri_cnt = top_cnt / bottom_cnt; - else - tri_cnt = abs(top_cnt); - glBegin(GL_TRIANGLE_FAN); - glEvalCoord2f((GLfloat) bottom_start / bottom_domain, - (GLfloat) bottom_z / bottom_domain); - for (k = 0; k <= tri_cnt; k++, top_start += direction) - glEvalPoint2(top_start, top_z); - if (bottom_cnt) { - bottom_start += direction; - top_start -= direction; - glEvalCoord2f((GLfloat) bottom_start / bottom_domain, - (GLfloat) bottom_z / bottom_domain); - } - glEnd(); - top_cnt -= direction * tri_cnt; - bottom_cnt -= direction; - } -} - - -static void -tesselate_strip_s_line(GLint top_start, GLint top_end, GLint top_z, - GLint bottom_start, GLint bottom_end, GLint bottom_z, - GLfloat bottom_domain) -{ - GLint top_cnt, bottom_cnt, tri_cnt, k; - GLint direction; - - top_cnt = top_end - top_start; - direction = (top_cnt >= 0 ? 1 : -1); - bottom_cnt = bottom_end - bottom_start; - glBegin(GL_LINES); - while (top_cnt) { - if (bottom_cnt) - tri_cnt = top_cnt / bottom_cnt; - else - tri_cnt = abs(top_cnt); - for (k = 0; k <= tri_cnt; k++, top_start += direction) { - glEvalCoord2f((GLfloat) bottom_start / bottom_domain, - (GLfloat) bottom_z / bottom_domain); - glEvalPoint2(top_start, top_z); - } - if (bottom_cnt) { - glEvalCoord2f((GLfloat) bottom_start / bottom_domain, - (GLfloat) bottom_z / bottom_domain); - bottom_start += direction; - top_start -= direction; - glEvalCoord2f((GLfloat) bottom_start / bottom_domain, - (GLfloat) bottom_z / bottom_domain); - glEvalPoint2(top_start, top_z); - glEvalCoord2f((GLfloat) bottom_start / bottom_domain, - (GLfloat) bottom_z / bottom_domain); - } - top_cnt -= direction * tri_cnt; - bottom_cnt -= direction; - } - glEnd(); -} - - -static void -tesselate_strip_s(GLenum display_mode, GLint top_start, GLint top_end, - GLint top_z, GLint bottom_start, GLint bottom_end, - GLint bottom_z, GLfloat bottom_domain) -{ - if (display_mode == GL_FILL) - tesselate_strip_s_fill(top_start, top_end, top_z, bottom_start, - bottom_end, bottom_z, bottom_domain); - else - tesselate_strip_s_line(top_start, top_end, top_z, bottom_start, - bottom_end, bottom_z, bottom_domain); -} - -static void -tesselate_bottom_left_corner(GLenum display_mode, GLfloat s_1, GLfloat t_1) -{ - if (display_mode == GL_FILL) { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(1, 1); - glEvalCoord2f(s_1, 0.0); - glEvalCoord2f(0.0, 0.0); - glEvalCoord2f(0.0, t_1); - } - else { - glBegin(GL_LINES); - glEvalCoord2f(0.0, 0.0); - glEvalCoord2f(0.0, t_1); - glEvalCoord2f(0.0, 0.0); - glEvalPoint2(1, 1); - glEvalCoord2f(0.0, 0.0); - glEvalCoord2f(s_1, 0.0); - } - glEnd(); -} - -static void -tesselate_bottom_right_corner(GLenum display_mode, GLint v_top, - GLint v_bottom, GLfloat s_1, GLfloat t_1) -{ - if (display_mode == GL_FILL) { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(1, v_top); - glEvalCoord2f(0.0, v_bottom * t_1); - glEvalCoord2f(0.0, (v_bottom + 1) * t_1); - glEvalCoord2f(s_1, (v_bottom + 1) * t_1); - } - else { - glBegin(GL_LINES); - glEvalCoord2f(0.0, (v_bottom + 1) * t_1); - glEvalPoint2(1, v_top); - glEvalCoord2f(0.0, (v_bottom + 1) * t_1); - glEvalCoord2f(0.0, v_bottom * t_1); - glEvalCoord2f(0.0, (v_bottom + 1) * t_1); - glEvalCoord2f(s_1, (v_bottom + 1) * t_1); - } - glEnd(); -} - -static void -tesselate_top_left_corner(GLenum display_mode, GLint u_right, GLint u_left, - GLfloat s_1, GLfloat t_1) -{ - if (display_mode == GL_FILL) { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(u_right, 1); - glEvalCoord2f((u_left + 1) * s_1, t_1); - glEvalCoord2f((u_left + 1) * s_1, 0.0); - glEvalCoord2f(u_left * s_1, 0.0); - } - else { - glBegin(GL_LINES); - glEvalCoord2f((u_left + 1) * s_1, 0.0); - glEvalPoint2(u_right, 1); - glEvalCoord2f((u_left + 1) * s_1, 0.0); - glEvalCoord2f(u_left * s_1, 0.0); - glEvalCoord2f((u_left + 1) * s_1, 0.0); - glEvalCoord2f((u_left + 1) * s_1, t_1); - } - glEnd(); -} - -static void -tesselate_top_right_corner(GLenum display_mode, GLint u_left, GLint v_bottom, - GLint u_right, GLint v_top, GLfloat s_1, - GLfloat t_1) -{ - if (display_mode == GL_FILL) { - glBegin(GL_TRIANGLE_FAN); - glEvalPoint2(u_left, v_bottom); - glEvalCoord2f((u_right - 1) * s_1, v_top * t_1); - glEvalCoord2f(u_right * s_1, v_top * t_1); - glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1); - } - else { - glBegin(GL_LINES); - glEvalCoord2f(u_right * s_1, v_top * t_1); - glEvalPoint2(u_left, v_bottom); - glEvalCoord2f(u_right * s_1, v_top * t_1); - glEvalCoord2f(u_right * s_1, (v_top - 1) * t_1); - glEvalCoord2f(u_right * s_1, v_top * t_1); - glEvalCoord2f((u_right - 1) * s_1, v_top * t_1); - } - glEnd(); -} - -/* do mesh mapping of Bezier */ -static void -nurbs_map_bezier(GLenum display_mode, GLint * sfactors, GLint * tfactors, - GLint s_bezier_cnt, GLint t_bezier_cnt, GLint s, GLint t) -{ - GLint top, bottom, right, left; - - - if (s == 0) { - top = *(tfactors + t * 3); - bottom = *(tfactors + t * 3 + 1); - } - else if (s == s_bezier_cnt - 1) { - top = *(tfactors + t * 3 + 2); - bottom = *(tfactors + t * 3); - } - else { - top = bottom = *(tfactors + t * 3); - } - if (t == 0) { - left = *(sfactors + s * 3 + 1); - right = *(sfactors + s * 3); - } - else if (t == t_bezier_cnt - 1) { - left = *(sfactors + s * 3); - right = *(sfactors + s * 3 + 2); - } - else { - left = right = *(sfactors + s * 3); - } - - if (top > bottom) { - if (left < right) { - glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode, 1, right, 1, top); - tesselate_strip_s(display_mode, 1, right, 1, 1, left, 0, - (GLfloat) left); - tesselate_bottom_left_corner(display_mode, (GLfloat) (1.0 / left), - (GLfloat) (1.0 / bottom)); -/* tesselate_strip_t(display_mode,1,top,1,1,bottom,0,(GLfloat)bottom);*/ - tesselate_strip_t(display_mode, top, 1, 1, bottom, 1, 0, - (GLfloat) bottom); - } - else if (left == right) { - glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode, 1, right, 0, top); -/* tesselate_strip_t(display_mode,0,top,1,0,bottom,0,(GLfloat)bottom);*/ - tesselate_strip_t(display_mode, top, 0, 1, bottom, 0, 0, - (GLfloat) bottom); - } - else { - glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode, 1, left, 0, top - 1); -/* tesselate_strip_t(display_mode,0,top-1,1,0,bottom-1,0, - (GLfloat)bottom);*/ - tesselate_strip_t(display_mode, top - 1, 0, 1, bottom - 1, 0, 0, - (GLfloat) bottom); - tesselate_bottom_right_corner(display_mode, top - 1, bottom - 1, - (GLfloat) (1.0 / right), - (GLfloat) (1.0 / bottom)); -/* tesselate_strip_s(display_mode,1,left,top-1,1,right,right, - (GLfloat)right);*/ - tesselate_strip_s(display_mode, left, 1, top - 1, right, 1, right, - (GLfloat) right); - } - } - else if (top == bottom) { - if (left < right) { - glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode, 0, right, 1, top); - tesselate_strip_s(display_mode, 0, right, 1, 0, left, 0, - (GLfloat) left); - } - else if (left == right) { - glMapGrid2f(right, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode, 0, right, 0, top); - } - else { - glMapGrid2f(left, 0.0, 1.0, top, 0.0, 1.0); - glEvalMesh2(display_mode, 0, left, 0, top - 1); -/* tesselate_strip_s(display_mode,0,left,top-1,0,right,right, - (GLfloat)right);*/ - tesselate_strip_s(display_mode, left, 0, top - 1, right, 0, right, - (GLfloat) right); - } - } - else { - if (left < right) { - glMapGrid2f(right, 0.0, 1.0, bottom, 0.0, 1.0); - glEvalMesh2(display_mode, 0, right - 1, 1, bottom); - tesselate_strip_s(display_mode, 0, right - 1, 1, 0, left - 1, 0, - (GLfloat) left); - tesselate_top_left_corner(display_mode, right - 1, left - 1, - (GLfloat) (1.0 / left), - (GLfloat) (1.0 / top)); - tesselate_strip_t(display_mode, 1, bottom, right - 1, 1, top, top, - (GLfloat) top); - } - else if (left == right) { - glMapGrid2f(right, 0.0, 1.0, bottom, 0.0, 1.0); - glEvalMesh2(display_mode, 0, right - 1, 0, bottom); - tesselate_strip_t(display_mode, 0, bottom, right - 1, 0, top, top, - (GLfloat) top); - } - else { - glMapGrid2f(left, 0.0, 1.0, bottom, 0.0, 1.0); - glEvalMesh2(display_mode, 0, left - 1, 0, bottom - 1); - tesselate_strip_t(display_mode, 0, bottom - 1, left - 1, 0, top - 1, - top, (GLfloat) top); - tesselate_top_right_corner(display_mode, left - 1, bottom - 1, right, - top, (GLfloat) (1.0 / right), - (GLfloat) (1.0 / top)); -/* tesselate_strip_s(display_mode,0,left-1,bottom-1,0,right-1,right, - (GLfloat)right);*/ - tesselate_strip_s(display_mode, left - 1, 0, bottom - 1, right - 1, - 0, right, (GLfloat) right); - } - } -} - -/* draw NURBS surface in OUTLINE POLYGON mode */ -static void -draw_polygon_mode(GLenum display_mode, GLUnurbsObj * nobj, - new_ctrl_type * new_ctrl, GLint * sfactors, - GLint * tfactors) -{ - GLsizei offset; - GLint t_bezier_cnt, s_bezier_cnt; - GLboolean do_color, do_normal, do_texture; - GLint i, j; - - t_bezier_cnt = new_ctrl->t_bezier_cnt; - s_bezier_cnt = new_ctrl->s_bezier_cnt; - glEnable(nobj->surface.geom.type); - if (new_ctrl->color_ctrl) { - glEnable(nobj->surface.color.type); - do_color = GL_TRUE; - } - else - do_color = GL_FALSE; - if (new_ctrl->normal_ctrl) { - glEnable(nobj->surface.normal.type); - do_normal = GL_TRUE; - } - else - do_normal = GL_FALSE; - if (new_ctrl->texture_ctrl) { - glEnable(nobj->surface.texture.type); - do_texture = GL_TRUE; - } - else - do_texture = GL_FALSE; - for (j = 0; j < s_bezier_cnt; j++) { - for (i = 0; i < t_bezier_cnt; i++) { - offset = j * t_bezier_cnt + i; - if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset), - nobj->surface.geom.sorder, - nobj->surface.geom.torder, - new_ctrl->geom_s_stride, - new_ctrl->geom_t_stride, - nobj->surface.geom.dim)) continue; - glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride, - nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride, - nobj->surface.geom.torder, - *(new_ctrl->geom_offsets + offset)); - if (do_color) { - glMap2f(nobj->surface.color.type, 0.0, 1.0, - new_ctrl->color_s_stride, nobj->surface.color.sorder, - 0.0, 1.0, new_ctrl->color_t_stride, - nobj->surface.color.torder, - *(new_ctrl->color_offsets + offset)); - } - if (do_normal) { - glMap2f(nobj->surface.normal.type, 0.0, 1.0, - new_ctrl->normal_s_stride, nobj->surface.normal.sorder, - 0.0, 1.0, new_ctrl->normal_t_stride, - nobj->surface.normal.torder, - *(new_ctrl->normal_offsets + offset)); - } - if (do_texture) { - glMap2f(nobj->surface.texture.type, 0.0, 1.0, - new_ctrl->texture_s_stride, nobj->surface.texture.sorder, - 0.0, 1.0, new_ctrl->texture_t_stride, - nobj->surface.texture.torder, - *(new_ctrl->texture_offsets + offset)); - } -/* glMapGrid2f(sfactors[j*3+0],0.0,1.0,tfactors[i*3+0],0.0,1.0); - glEvalMesh2(display_mode,0,sfactors[j*3+0],0,tfactors[i*3+0]);*/ - nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt, - t_bezier_cnt, j, i); - } - } -} - - - -/* draw NURBS surface in OUTLINE POLYGON mode */ -#if 0 -static void -draw_patch_mode(GLenum display_mode, GLUnurbsObj * nobj, - new_ctrl_type * new_ctrl, GLint * sfactors, GLint * tfactors) -{ - GLsizei offset; - GLint t_bezier_cnt, s_bezier_cnt; - GLboolean do_color, do_normal, do_texture; - GLint i, j; - - t_bezier_cnt = new_ctrl->t_bezier_cnt; - s_bezier_cnt = new_ctrl->s_bezier_cnt; - glEnable(nobj->surface.geom.type); - if (new_ctrl->color_ctrl) { - glEnable(nobj->surface.color.type); - do_color = GL_TRUE; - } - else - do_color = GL_FALSE; - if (new_ctrl->normal_ctrl) { - glEnable(nobj->surface.normal.type); - do_normal = GL_TRUE; - } - else - do_normal = GL_FALSE; - if (new_ctrl->texture_ctrl) { - glEnable(nobj->surface.texture.type); - do_texture = GL_TRUE; - } - else - do_texture = GL_FALSE; - for (j = 0; j < s_bezier_cnt; j++) { - for (i = 0; i < t_bezier_cnt; i++) { - offset = j * t_bezier_cnt + i; - if (fine_culling_test_3D(nobj, *(new_ctrl->geom_offsets + offset), - nobj->surface.geom.sorder, - nobj->surface.geom.torder, - new_ctrl->geom_s_stride, - new_ctrl->geom_t_stride, - nobj->surface.geom.dim)) continue; - glMap2f(nobj->surface.geom.type, 0.0, 1.0, new_ctrl->geom_s_stride, - nobj->surface.geom.sorder, 0.0, 1.0, new_ctrl->geom_t_stride, - nobj->surface.geom.torder, - *(new_ctrl->geom_offsets + offset)); - if (do_color) { - glMap2f(nobj->surface.color.type, 0.0, 1.0, - new_ctrl->color_s_stride, nobj->surface.color.sorder, - 0.0, 1.0, new_ctrl->color_t_stride, - nobj->surface.color.torder, - *(new_ctrl->color_offsets + offset)); - } - if (do_normal) { - glMap2f(nobj->surface.normal.type, 0.0, 1.0, - new_ctrl->normal_s_stride, nobj->surface.normal.sorder, - 0.0, 1.0, new_ctrl->normal_t_stride, - nobj->surface.normal.torder, - *(new_ctrl->normal_offsets + offset)); - } - if (do_texture) { - glMap2f(nobj->surface.texture.type, 0.0, 1.0, - new_ctrl->texture_s_stride, nobj->surface.texture.sorder, - 0.0, 1.0, new_ctrl->texture_t_stride, - nobj->surface.texture.torder, - *(new_ctrl->texture_offsets + offset)); - } - nurbs_map_bezier(display_mode, sfactors, tfactors, s_bezier_cnt, - t_bezier_cnt, i, j); -/* glMapGrid2f(sfactors[j],0.0,1.0,tfactors[i],0.0,1.0); - glEvalMesh2(display_mode,0,sfactors[j],0,tfactors[i]);*/ - } - } -} -#endif - - - -static void -init_new_ctrl(new_ctrl_type * p) -{ - p->geom_ctrl = p->color_ctrl = p->normal_ctrl = p->texture_ctrl = NULL; - p->geom_offsets = p->color_offsets = p->normal_offsets = - p->texture_offsets = NULL; - p->s_bezier_cnt = p->t_bezier_cnt = 0; -} - - -static GLenum -augment_new_ctrl(GLUnurbsObj * nobj, new_ctrl_type * p) -{ - GLsizei offset_size; - GLint i, j; - - p->s_bezier_cnt = (p->geom_s_pt_cnt) / (nobj->surface.geom.sorder); - p->t_bezier_cnt = (p->geom_t_pt_cnt) / (nobj->surface.geom.torder); - offset_size = (p->s_bezier_cnt) * (p->t_bezier_cnt); - p->geom_t_stride = nobj->surface.geom.dim; - p->geom_s_stride = (p->geom_t_pt_cnt) * (nobj->surface.geom.dim); - p->color_t_stride = nobj->surface.color.dim; - p->color_s_stride = (p->color_t_pt_cnt) * (nobj->surface.color.dim); - p->normal_t_stride = nobj->surface.normal.dim; - p->normal_s_stride = (p->normal_t_pt_cnt) * (nobj->surface.normal.dim); - p->texture_t_stride = nobj->surface.texture.dim; - p->texture_s_stride = (p->texture_t_pt_cnt) * (nobj->surface.texture.dim); - if ( - (p->geom_offsets = - (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if (p->color_ctrl) - if ( - (p->color_offsets = - (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { - free_new_ctrl(p); - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if (p->normal_ctrl) - if ( - (p->normal_offsets = - (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { - free_new_ctrl(p); - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if (p->texture_ctrl) - if ( - (p->texture_offsets = - (GLfloat **) malloc(sizeof(GLfloat *) * offset_size)) == NULL) { - free_new_ctrl(p); - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - for (i = 0; i < p->s_bezier_cnt; i++) - for (j = 0; j < p->t_bezier_cnt; j++) - *(p->geom_offsets + i * (p->t_bezier_cnt) + j) = - p->geom_ctrl + i * (nobj->surface.geom.sorder) * - (nobj->surface.geom.dim) * (p->geom_t_pt_cnt) + - j * (nobj->surface.geom.dim) * (nobj->surface.geom.torder); - if (p->color_ctrl) - for (i = 0; i < p->s_bezier_cnt; i++) - for (j = 0; j < p->t_bezier_cnt; j++) - *(p->color_offsets + i * (p->t_bezier_cnt) + j) = - p->color_ctrl + i * (nobj->surface.color.sorder) * - (nobj->surface.color.dim) * (p->color_t_pt_cnt) + - j * (nobj->surface.color.dim) * (nobj->surface.color.torder); - if (p->normal_ctrl) - for (i = 0; i < p->s_bezier_cnt; i++) - for (j = 0; j < p->t_bezier_cnt; j++) - *(p->normal_offsets + i * (p->t_bezier_cnt) + j) = - p->normal_ctrl + i * (nobj->surface.normal.sorder) * - (nobj->surface.normal.dim) * (p->normal_t_pt_cnt) + - j * (nobj->surface.normal.dim) * (nobj->surface.normal.torder); - if (p->texture_ctrl) - for (i = 0; i < p->s_bezier_cnt; i++) - for (j = 0; j < p->t_bezier_cnt; j++) - *(p->texture_offsets + i * (p->t_bezier_cnt) + j) = - p->texture_ctrl + i * (nobj->surface.texture.sorder) * - (nobj->surface.texture.dim) * (p->texture_t_pt_cnt) + - j * (nobj->surface.texture.dim) * - (nobj->surface.texture.torder); - return GLU_NO_ERROR; -} - -/* main NURBS surface procedure */ -void -do_nurbs_surface(GLUnurbsObj * nobj) -{ - GLint *sfactors, *tfactors; - new_ctrl_type new_ctrl; - - /* test user supplied data */ - if (test_nurbs_surfaces(nobj) != GLU_NO_ERROR) - return; - - init_new_ctrl(&new_ctrl); - - if (convert_surfs(nobj, &new_ctrl) != GLU_NO_ERROR) - return; - if (augment_new_ctrl(nobj, &new_ctrl) != GLU_NO_ERROR) - return; - switch (nobj->sampling_method) { - case GLU_PATH_LENGTH: - if (glu_do_sampling_3D(nobj, &new_ctrl, &sfactors, &tfactors) != - GLU_NO_ERROR) { - free_new_ctrl(&new_ctrl); - return; - } - break; - case GLU_DOMAIN_DISTANCE: - if (glu_do_sampling_uv(nobj, &new_ctrl, &sfactors, &tfactors) != - GLU_NO_ERROR) { - free_new_ctrl(&new_ctrl); - return; - } - break; - case GLU_PARAMETRIC_ERROR: - if (glu_do_sampling_param_3D(nobj, &new_ctrl, &sfactors, &tfactors) != - GLU_NO_ERROR) { - free_new_ctrl(&new_ctrl); - return; - } - break; - default: - abort(); - } - glFrontFace(GL_CW); - switch (nobj->display_mode) { - case GLU_FILL: -/* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/ - draw_polygon_mode(GL_FILL, nobj, &new_ctrl, sfactors, tfactors); - break; - case GLU_OUTLINE_POLYGON: - /* TODO - missing trimming handeling */ -/* just for now - no OUTLINE_PATCH mode - draw_patch_mode(GL_LINE,nobj,&new_ctrl,sfactors,tfactors); - break; */ - case GLU_OUTLINE_PATCH: -/* if(polygon_trimming(nobj,&new_ctrl,sfactors,tfactors)==GLU_NO_ERROR)*/ - draw_polygon_mode(GL_LINE, nobj, &new_ctrl, sfactors, tfactors); - break; - default: - abort(); /* TODO: is this OK? */ - } - free(sfactors); - free(tfactors); - free_new_ctrl(&new_ctrl); -} diff --git a/src/glu/mesa/nurbsutl.c b/src/glu/mesa/nurbsutl.c deleted file mode 100644 index b46348a50b..0000000000 --- a/src/glu/mesa/nurbsutl.c +++ /dev/null @@ -1,1309 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "gluP.h" -#include "nurbs.h" -#endif - - -GLenum test_knot(GLint nknots, GLfloat * knot, GLint order) -{ - GLsizei i; - GLint knot_mult; - GLfloat tmp_knot; - - tmp_knot = knot[0]; - knot_mult = 1; - for (i = 1; i < nknots; i++) { - if (knot[i] < tmp_knot) - return GLU_NURBS_ERROR4; - if (fabs(tmp_knot - knot[i]) > EPSILON) { - if (knot_mult > order) - return GLU_NURBS_ERROR5; - knot_mult = 1; - tmp_knot = knot[i]; - } - else - ++knot_mult; - } - return GLU_NO_ERROR; -} - -static int -/* qsort function */ -#if defined(WIN32) && !defined(OPENSTEP) - __cdecl -#endif -knot_sort(const void *a, const void *b) -{ - GLfloat x, y; - - x = *((GLfloat *) a); - y = *((GLfloat *) b); - if (fabs(x - y) < EPSILON) - return 0; - if (x > y) - return 1; - return -1; -} - -/* insert into dest knot all values within the valid range from src knot */ -/* that do not appear in dest */ -void -collect_unified_knot(knot_str_type * dest, knot_str_type * src, - GLfloat maximal_min_knot, GLfloat minimal_max_knot) -{ - GLfloat *src_knot, *dest_knot; - GLint src_t_min, src_t_max, dest_t_min, dest_t_max; - GLint src_nknots, dest_nknots; - GLint i, j, k, new_cnt; - GLboolean not_found_flag; - - src_knot = src->unified_knot; - dest_knot = dest->unified_knot; - src_t_min = src->t_min; - src_t_max = src->t_max; - dest_t_min = dest->t_min; - dest_t_max = dest->t_max; - src_nknots = src->unified_nknots; - dest_nknots = dest->unified_nknots; - - k = new_cnt = dest_nknots; - for (i = src_t_min; i <= src_t_max; i++) - if (src_knot[i] - maximal_min_knot > -EPSILON && - src_knot[i] - minimal_max_knot < EPSILON) { - not_found_flag = GL_TRUE; - for (j = dest_t_min; j <= dest_t_max; j++) - if (fabs(dest_knot[j] - src_knot[i]) < EPSILON) { - not_found_flag = GL_FALSE; - break; - } - if (not_found_flag) { - /* knot from src is not in dest - add this knot to dest */ - dest_knot[k++] = src_knot[i]; - ++new_cnt; - ++(dest->t_max); /* the valid range widens */ - ++(dest->delta_nknots); /* increment the extra knot value counter */ - } - } - dest->unified_nknots = new_cnt; - qsort((void *) dest_knot, (size_t) new_cnt, (size_t) sizeof(GLfloat), - &knot_sort); -} - -/* basing on the new common knot range for all attributes set */ -/* t_min and t_max values for each knot - they will be used later on */ -/* by explode_knot() and calc_new_ctrl_pts */ -static void -set_new_t_min_t_max(knot_str_type * geom_knot, knot_str_type * color_knot, - knot_str_type * normal_knot, knot_str_type * texture_knot, - GLfloat maximal_min_knot, GLfloat minimal_max_knot) -{ - GLuint t_min = 0, t_max = 0, cnt = 0; - - if (minimal_max_knot - maximal_min_knot < EPSILON) { - /* knot common range empty */ - geom_knot->t_min = geom_knot->t_max = 0; - color_knot->t_min = color_knot->t_max = 0; - normal_knot->t_min = normal_knot->t_max = 0; - texture_knot->t_min = texture_knot->t_max = 0; - } - else { - if (geom_knot->unified_knot != NULL) { - cnt = geom_knot->unified_nknots; - for (t_min = 0; t_min < cnt; t_min++) - if (fabs((geom_knot->unified_knot)[t_min] - maximal_min_knot) < - EPSILON) break; - for (t_max = cnt - 1; t_max; t_max--) - if (fabs((geom_knot->unified_knot)[t_max] - minimal_max_knot) < - EPSILON) break; - } - else if (geom_knot->nknots) { - cnt = geom_knot->nknots; - for (t_min = 0; t_min < cnt; t_min++) - if (fabs((geom_knot->knot)[t_min] - maximal_min_knot) < EPSILON) - break; - for (t_max = cnt - 1; t_max; t_max--) - if (fabs((geom_knot->knot)[t_max] - minimal_max_knot) < EPSILON) - break; - } - geom_knot->t_min = t_min; - geom_knot->t_max = t_max; - if (color_knot->unified_knot != NULL) { - cnt = color_knot->unified_nknots; - for (t_min = 0; t_min < cnt; t_min++) - if (fabs((color_knot->unified_knot)[t_min] - maximal_min_knot) < - EPSILON) break; - for (t_max = cnt - 1; t_max; t_max--) - if (fabs((color_knot->unified_knot)[t_max] - minimal_max_knot) < - EPSILON) break; - color_knot->t_min = t_min; - color_knot->t_max = t_max; - } - if (normal_knot->unified_knot != NULL) { - cnt = normal_knot->unified_nknots; - for (t_min = 0; t_min < cnt; t_min++) - if (fabs((normal_knot->unified_knot)[t_min] - maximal_min_knot) < - EPSILON) break; - for (t_max = cnt - 1; t_max; t_max--) - if (fabs((normal_knot->unified_knot)[t_max] - minimal_max_knot) < - EPSILON) break; - normal_knot->t_min = t_min; - normal_knot->t_max = t_max; - } - if (texture_knot->unified_knot != NULL) { - cnt = texture_knot->unified_nknots; - for (t_min = 0; t_min < cnt; t_min++) - if (fabs((texture_knot->unified_knot)[t_min] - maximal_min_knot) - < EPSILON) - break; - for (t_max = cnt - 1; t_max; t_max--) - if (fabs((texture_knot->unified_knot)[t_max] - minimal_max_knot) - < EPSILON) - break; - texture_knot->t_min = t_min; - texture_knot->t_max = t_max; - } - } -} - -/* modify all knot valid ranges in such a way that all have the same */ -/* range, common to all knots */ -/* do this by knot insertion */ -GLenum -select_knot_working_range(GLUnurbsObj * nobj, knot_str_type * geom_knot, - knot_str_type * color_knot, - knot_str_type * normal_knot, - knot_str_type * texture_knot) -{ - GLint max_nknots; - GLfloat maximal_min_knot, minimal_max_knot; - GLint i; - - /* find the maximum modified knot length */ - max_nknots = geom_knot->nknots; - if (color_knot->unified_knot) - max_nknots += color_knot->nknots; - if (normal_knot->unified_knot) - max_nknots += normal_knot->nknots; - if (texture_knot->unified_knot) - max_nknots += texture_knot->nknots; - maximal_min_knot = (geom_knot->knot)[geom_knot->t_min]; - minimal_max_knot = (geom_knot->knot)[geom_knot->t_max]; - /* any attirb data ? */ - if (max_nknots != geom_knot->nknots) { - /* allocate space for the unified knots */ - if ((geom_knot->unified_knot = - (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - geom_knot->unified_nknots = geom_knot->nknots; - for (i = 0; i < geom_knot->nknots; i++) - (geom_knot->unified_knot)[i] = (geom_knot->knot)[i]; - if (color_knot->unified_knot) { - if ((color_knot->knot)[color_knot->t_min] - maximal_min_knot > - EPSILON) - maximal_min_knot = (color_knot->knot)[color_knot->t_min]; - if (minimal_max_knot - (color_knot->knot)[color_knot->t_max] > - EPSILON) - minimal_max_knot = (color_knot->knot)[color_knot->t_max]; - if ((color_knot->unified_knot = - (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { - free(geom_knot->unified_knot); - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - color_knot->unified_nknots = color_knot->nknots; - for (i = 0; i < color_knot->nknots; i++) - (color_knot->unified_knot)[i] = (color_knot->knot)[i]; - } - if (normal_knot->unified_knot) { - if ((normal_knot->knot)[normal_knot->t_min] - maximal_min_knot > - EPSILON) - maximal_min_knot = (normal_knot->knot)[normal_knot->t_min]; - if (minimal_max_knot - (normal_knot->knot)[normal_knot->t_max] > - EPSILON) - minimal_max_knot = (normal_knot->knot)[normal_knot->t_max]; - if ((normal_knot->unified_knot = - (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { - free(geom_knot->unified_knot); - free(color_knot->unified_knot); - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - normal_knot->unified_nknots = normal_knot->nknots; - for (i = 0; i < normal_knot->nknots; i++) - (normal_knot->unified_knot)[i] = (normal_knot->knot)[i]; - } - if (texture_knot->unified_knot) { - if ((texture_knot->knot)[texture_knot->t_min] - maximal_min_knot > - EPSILON) - maximal_min_knot = (texture_knot->knot)[texture_knot->t_min]; - if (minimal_max_knot - (texture_knot->knot)[texture_knot->t_max] > - EPSILON) - minimal_max_knot = (texture_knot->knot)[texture_knot->t_max]; - if ((texture_knot->unified_knot = - (GLfloat *) malloc(sizeof(GLfloat) * max_nknots)) == NULL) { - free(geom_knot->unified_knot); - free(color_knot->unified_knot); - free(normal_knot->unified_knot); - call_user_error(nobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - /* copy the original knot to the unified one */ - texture_knot->unified_nknots = texture_knot->nknots; - for (i = 0; i < texture_knot->nknots; i++) - (texture_knot->unified_knot)[i] = (texture_knot->knot)[i]; - } - /* work on the geometry knot with all additional knot values */ - /* appearing in attirbutive knots */ - if (minimal_max_knot - maximal_min_knot < EPSILON) { - /* empty working range */ - geom_knot->unified_nknots = 0; - color_knot->unified_nknots = 0; - normal_knot->unified_nknots = 0; - texture_knot->unified_nknots = 0; - } - else { - if (color_knot->unified_knot) - collect_unified_knot(geom_knot, color_knot, maximal_min_knot, - minimal_max_knot); - if (normal_knot->unified_knot) - collect_unified_knot(geom_knot, normal_knot, maximal_min_knot, - minimal_max_knot); - if (texture_knot->unified_knot) - collect_unified_knot(geom_knot, texture_knot, maximal_min_knot, - minimal_max_knot); - /* since we have now built the "unified" geometry knot */ - /* add same knot values to all attributive knots */ - if (color_knot->unified_knot) - collect_unified_knot(color_knot, geom_knot, maximal_min_knot, - minimal_max_knot); - if (normal_knot->unified_knot) - collect_unified_knot(normal_knot, geom_knot, maximal_min_knot, - minimal_max_knot); - if (texture_knot->unified_knot) - collect_unified_knot(texture_knot, geom_knot, maximal_min_knot, - minimal_max_knot); - } - } - set_new_t_min_t_max(geom_knot, color_knot, normal_knot, texture_knot, - maximal_min_knot, minimal_max_knot); - return GLU_NO_ERROR; -} - -void -free_unified_knots(knot_str_type * geom_knot, knot_str_type * color_knot, - knot_str_type * normal_knot, knot_str_type * texture_knot) -{ - if (geom_knot->unified_knot) - free(geom_knot->unified_knot); - if (color_knot->unified_knot) - free(color_knot->unified_knot); - if (normal_knot->unified_knot) - free(normal_knot->unified_knot); - if (texture_knot->unified_knot) - free(texture_knot->unified_knot); -} - -GLenum explode_knot(knot_str_type * the_knot) -{ - GLfloat *knot, *new_knot; - GLint nknots, n_new_knots = 0; - GLint t_min, t_max; - GLint ord; - GLsizei i, j, k; - GLfloat tmp_float; - - if (the_knot->unified_knot) { - knot = the_knot->unified_knot; - nknots = the_knot->unified_nknots; - } - else { - knot = the_knot->knot; - nknots = the_knot->nknots; - } - ord = the_knot->order; - t_min = the_knot->t_min; - t_max = the_knot->t_max; - - for (i = t_min; i <= t_max;) { - tmp_float = knot[i]; - for (j = 0; j < ord && (i + j) <= t_max; j++) - if (fabs(tmp_float - knot[i + j]) > EPSILON) - break; - n_new_knots += ord - j; - i += j; - } - /* alloc space for new_knot */ - if ( - (new_knot = - (GLfloat *) malloc(sizeof(GLfloat) * (nknots + n_new_knots + 1))) == NULL) { - return GLU_OUT_OF_MEMORY; - } - /* fill in new knot */ - for (j = 0; j < t_min; j++) - new_knot[j] = knot[j]; - for (i = j; i <= t_max; i++) { - tmp_float = knot[i]; - for (k = 0; k < ord; k++) { - new_knot[j++] = knot[i]; - if (tmp_float == knot[i + 1]) - i++; - } - } - for (i = t_max + 1; i < (int) nknots; i++) - new_knot[j++] = knot[i]; - /* fill in the knot structure */ - the_knot->new_knot = new_knot; - the_knot->delta_nknots += n_new_knots; - the_knot->t_max += n_new_knots; - return GLU_NO_ERROR; -} - -GLenum calc_alphas(knot_str_type * the_knot) -{ - GLfloat tmp_float; - int i, j, k, m, n; - int order; - GLfloat *alpha, *alpha_new, *tmp_alpha; - GLfloat denom; - GLfloat *knot, *new_knot; - - - knot = the_knot->knot; - order = the_knot->order; - new_knot = the_knot->new_knot; - n = the_knot->nknots - the_knot->order; - m = n + the_knot->delta_nknots; - if ((alpha = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) { - return GLU_OUT_OF_MEMORY; - } - if ((alpha_new = (GLfloat *) malloc(sizeof(GLfloat) * n * m)) == NULL) { - free(alpha); - return GLU_OUT_OF_MEMORY; - } - for (j = 0; j < m; j++) { - for (i = 0; i < n; i++) { - if ((knot[i] <= new_knot[j]) && (new_knot[j] < knot[i + 1])) - tmp_float = 1.0; - else - tmp_float = 0.0; - alpha[i + j * n] = tmp_float; - } - } - for (k = 1; k < order; k++) { - for (j = 0; j < m; j++) - for (i = 0; i < n; i++) { - denom = knot[i + k] - knot[i]; - if (fabs(denom) < EPSILON) - tmp_float = 0.0; - else - tmp_float = (new_knot[j + k] - knot[i]) / denom * - alpha[i + j * n]; - denom = knot[i + k + 1] - knot[i + 1]; - if (fabs(denom) > EPSILON) - tmp_float += (knot[i + k + 1] - new_knot[j + k]) / denom * - alpha[(i + 1) + j * n]; - alpha_new[i + j * n] = tmp_float; - } - tmp_alpha = alpha_new; - alpha_new = alpha; - alpha = tmp_alpha; - } - the_knot->alpha = alpha; - free(alpha_new); - return GLU_NO_ERROR; -} - -GLenum -calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, knot_str_type * the_knot, - GLint dim, GLfloat ** new_ctrl, GLint * ncontrol) -{ - GLsizei i, j, k, l, m, n; - GLsizei index1, index2; - GLfloat *alpha; - GLfloat *new_knot; - - new_knot = the_knot->new_knot; - n = the_knot->nknots - the_knot->order; - alpha = the_knot->alpha; - - m = the_knot->t_max + 1 - the_knot->t_min - the_knot->order; - k = the_knot->t_min; - /* allocate space for new control points */ - if ((*new_ctrl = (GLfloat *) malloc(sizeof(GLfloat) * dim * m)) == NULL) { - return GLU_OUT_OF_MEMORY; - } - for (j = 0; j < m; j++) { - for (l = 0; l < dim; l++) - (*new_ctrl)[j * dim + l] = 0.0; - for (i = 0; i < n; i++) { - index1 = i + (j + k) * n; - index2 = i * stride; - for (l = 0; l < dim; l++) - (*new_ctrl)[j * dim + l] += alpha[index1] * ctrl[index2 + l]; - } - } - *ncontrol = (GLint) m; - return GLU_NO_ERROR; -} - -static GLint -calc_factor(GLfloat * pts, GLint order, GLint indx, GLint stride, - GLfloat tolerance, GLint dim) -{ - GLdouble model[16], proj[16]; - GLint viewport[4]; - GLdouble x, y, z, w, winx1, winy1, winz, winx2, winy2; - GLint i; - GLdouble len, dx, dy; - - glGetDoublev(GL_MODELVIEW_MATRIX, model); - glGetDoublev(GL_PROJECTION_MATRIX, proj); - glGetIntegerv(GL_VIEWPORT, viewport); - if (dim == 4) { - w = (GLdouble) pts[indx + 3]; - x = (GLdouble) pts[indx] / w; - y = (GLdouble) pts[indx + 1] / w; - z = (GLdouble) pts[indx + 2] / w; - gluProject(x, y, z, model, proj, viewport, &winx1, &winy1, &winz); - len = 0.0; - for (i = 1; i < order; i++) { - w = (GLdouble) pts[indx + i * stride + 3]; - x = (GLdouble) pts[indx + i * stride] / w; - y = (GLdouble) pts[indx + i * stride + 1] / w; - z = (GLdouble) pts[indx + i * stride + 2] / w; - if (gluProject - (x, y, z, model, proj, viewport, &winx2, &winy2, &winz)) { - dx = winx2 - winx1; - dy = winy2 - winy1; - len += sqrt(dx * dx + dy * dy); - } - winx1 = winx2; - winy1 = winy2; - } - } - else { - x = (GLdouble) pts[indx]; - y = (GLdouble) pts[indx + 1]; - if (dim == 2) - z = 0.0; - else - z = (GLdouble) pts[indx + 2]; - gluProject(x, y, z, model, proj, viewport, &winx1, &winy1, &winz); - len = 0.0; - for (i = 1; i < order; i++) { - x = (GLdouble) pts[indx + i * stride]; - y = (GLdouble) pts[indx + i * stride + 1]; - if (dim == 2) - z = 0.0; - else - z = (GLdouble) pts[indx + i * stride + 2]; - if (gluProject - (x, y, z, model, proj, viewport, &winx2, &winy2, &winz)) { - dx = winx2 - winx1; - dy = winy2 - winy1; - len += sqrt(dx * dx + dy * dy); - } - winx1 = winx2; - winy1 = winy2; - } - } - len /= tolerance; - return ((GLint) len + 1); -} - -/* we can't use the Mesa evaluators - no way to get the point coords */ -/* so we use our own Bezier point calculus routines */ -/* because I'm lazy, I reuse the ones from eval.c */ - -static void -bezier_curve(GLfloat * cp, GLfloat * out, GLfloat t, - GLuint dim, GLuint order, GLint offset) -{ - GLfloat s, powert; - GLuint i, k, bincoeff; - - if (order >= 2) { - bincoeff = order - 1; - s = 1.0 - t; - - for (k = 0; k < dim; k++) - out[k] = s * cp[k] + bincoeff * t * cp[offset + k]; - - for (i = 2, cp += 2 * offset, powert = t * t; i < order; - i++, powert *= t, cp += offset) { - bincoeff *= order - i; - bincoeff /= i; - - for (k = 0; k < dim; k++) - out[k] = s * out[k] + bincoeff * powert * cp[k]; - } - } - else { /* order=1 -> constant curve */ - - for (k = 0; k < dim; k++) - out[k] = cp[k]; - } -} - -static GLint -calc_parametric_factor(GLfloat * pts, GLint order, GLint indx, GLint stride, - GLfloat tolerance, GLint dim) -{ - GLdouble model[16], proj[16]; - GLint viewport[4]; - GLdouble x, y, z, w, x1, y1, z1, x2, y2, z2, x3, y3, z3; - GLint i; - GLint P; - GLfloat bez_pt[4]; - GLdouble len = 0.0, tmp, z_med; - - P = 2 * (order + 2); - glGetDoublev(GL_MODELVIEW_MATRIX, model); - glGetDoublev(GL_PROJECTION_MATRIX, proj); - glGetIntegerv(GL_VIEWPORT, viewport); - z_med = (viewport[2] + viewport[3]) * 0.5; - switch (dim) { - case 4: - for (i = 1; i < P; i++) { - bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 4, - order, stride); - w = (GLdouble) bez_pt[3]; - x = (GLdouble) bez_pt[0] / w; - y = (GLdouble) bez_pt[1] / w; - z = (GLdouble) bez_pt[2] / w; - gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); - z3 *= z_med; - bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 4, - order, stride); - w = (GLdouble) bez_pt[3]; - x = (GLdouble) bez_pt[0] / w; - y = (GLdouble) bez_pt[1] / w; - z = (GLdouble) bez_pt[2] / w; - gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); - z1 *= z_med; - bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 4, - order, stride); - w = (GLdouble) bez_pt[3]; - x = (GLdouble) bez_pt[0] / w; - y = (GLdouble) bez_pt[1] / w; - z = (GLdouble) bez_pt[2] / w; - gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); - z2 *= z_med; - /* calc distance between point (x3,y3,z3) and line segment */ - /* */ - x = x2 - x1; - y = y2 - y1; - z = z2 - z1; - tmp = sqrt(x * x + y * y + z * z); - x /= tmp; - y /= tmp; - z /= tmp; - tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; - x = x1 + x * tmp - x3; - y = y1 + y * tmp - y3; - z = z1 + z * tmp - z3; - tmp = sqrt(x * x + y * y + z * z); - if (tmp > len) - len = tmp; - } - break; - case 3: - for (i = 1; i < P; i++) { - bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 3, - order, stride); - x = (GLdouble) bez_pt[0]; - y = (GLdouble) bez_pt[1]; - z = (GLdouble) bez_pt[2]; - gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); - z3 *= z_med; - bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 3, - order, stride); - x = (GLdouble) bez_pt[0]; - y = (GLdouble) bez_pt[1]; - z = (GLdouble) bez_pt[2]; - gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); - z1 *= z_med; - bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 3, - order, stride); - x = (GLdouble) bez_pt[0]; - y = (GLdouble) bez_pt[1]; - z = (GLdouble) bez_pt[2]; - gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); - z2 *= z_med; - /* calc distance between point (x3,y3,z3) and line segment */ - /* */ - x = x2 - x1; - y = y2 - y1; - z = z2 - z1; - tmp = sqrt(x * x + y * y + z * z); - x /= tmp; - y /= tmp; - z /= tmp; - tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; - x = x1 + x * tmp - x3; - y = y1 + y * tmp - y3; - z = z1 + z * tmp - z3; - tmp = sqrt(x * x + y * y + z * z); - if (tmp > len) - len = tmp; - } - break; - case 2: - for (i = 1; i < P; i++) { - bezier_curve(pts + indx, bez_pt, (GLfloat) i / (GLfloat) P, 2, - order, stride); - x = (GLdouble) bez_pt[0]; - y = (GLdouble) bez_pt[1]; - z = 0.0; - gluProject(x, y, z, model, proj, viewport, &x3, &y3, &z3); - z3 *= z_med; - bezier_curve(pts + indx, bez_pt, (GLfloat) (i - 1) / (GLfloat) P, 2, - order, stride); - x = (GLdouble) bez_pt[0]; - y = (GLdouble) bez_pt[1]; - z = 0.0; - gluProject(x, y, z, model, proj, viewport, &x1, &y1, &z1); - z1 *= z_med; - bezier_curve(pts + indx, bez_pt, (GLfloat) (i + 1) / (GLfloat) P, 2, - order, stride); - x = (GLdouble) bez_pt[0]; - y = (GLdouble) bez_pt[1]; - z = 0.0; - gluProject(x, y, z, model, proj, viewport, &x2, &y2, &z2); - z2 *= z_med; - /* calc distance between point (x3,y3,z3) and line segment */ - /* */ - x = x2 - x1; - y = y2 - y1; - z = z2 - z1; - tmp = sqrt(x * x + y * y + z * z); - x /= tmp; - y /= tmp; - z /= tmp; - tmp = x3 * x + y3 * y + z3 * z - x1 * x - y1 * y - z1 * z; - x = x1 + x * tmp - x3; - y = y1 + y * tmp - y3; - z = z1 + z * tmp - z3; - tmp = sqrt(x * x + y * y + z * z); - if (tmp > len) - len = tmp; - } - break; - - } - if (len < tolerance) - return (order); - else - return (GLint) (sqrt(len / tolerance) * (order + 2) + 1); -} - -static GLenum -calc_sampling_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim, - GLint uorder, GLint vorder, GLint ** ufactors, - GLint ** vfactors) -{ - GLfloat *ctrl; - GLint tmp_factor1, tmp_factor2; - GLint ufactor_cnt, vfactor_cnt; - GLint offset1, offset2, offset3; - GLint i, j; - - ufactor_cnt = new_ctrl->s_bezier_cnt; - vfactor_cnt = new_ctrl->t_bezier_cnt; - if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3)) - == NULL) { - return GLU_OUT_OF_MEMORY; - } - if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3)) - == NULL) { - free(*ufactors); - return GLU_OUT_OF_MEMORY; - } - ctrl = new_ctrl->geom_ctrl; - offset1 = new_ctrl->geom_t_stride * vorder; - offset2 = new_ctrl->geom_s_stride * uorder; - for (j = 0; j < vfactor_cnt; j++) { - *(*vfactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, vorder, - j * offset1, dim, - tolerance, dim); - /* loop ufactor_cnt-1 times */ - for (i = 1; i < ufactor_cnt; i++) { - tmp_factor2 = calc_factor(ctrl, vorder, - j * offset1 + i * offset2, dim, tolerance, - dim); - if (tmp_factor2 > tmp_factor1) - tmp_factor1 = tmp_factor2; - } - /* last time for the opposite edge */ - *(*vfactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, vorder, - j * offset1 + - i * offset2 - - new_ctrl-> - geom_s_stride, dim, - tolerance, dim); - if (tmp_factor2 > tmp_factor1) - *(*vfactors + j * 3) = tmp_factor2; - else - *(*vfactors + j * 3) = tmp_factor1; - } - offset3 = new_ctrl->geom_s_stride; - offset2 = new_ctrl->geom_s_stride * uorder; - for (j = 0; j < ufactor_cnt; j++) { - *(*ufactors + j * 3 + 1) = tmp_factor1 = calc_factor(ctrl, uorder, - j * offset2, - offset3, tolerance, - dim); - /* loop vfactor_cnt-1 times */ - for (i = 1; i < vfactor_cnt; i++) { - tmp_factor2 = calc_factor(ctrl, uorder, - j * offset2 + i * offset1, offset3, - tolerance, dim); - if (tmp_factor2 > tmp_factor1) - tmp_factor1 = tmp_factor2; - } - /* last time for the opposite edge */ - *(*ufactors + j * 3 + 2) = tmp_factor2 = calc_factor(ctrl, uorder, - j * offset2 + - i * offset1 - - new_ctrl-> - geom_t_stride, - offset3, tolerance, - dim); - if (tmp_factor2 > tmp_factor1) - *(*ufactors + j * 3) = tmp_factor2; - else - *(*ufactors + j * 3) = tmp_factor1; - } - return GL_NO_ERROR; -} - -static GLenum -calc_sampling_param_3D(new_ctrl_type * new_ctrl, GLfloat tolerance, GLint dim, - GLint uorder, GLint vorder, GLint ** ufactors, - GLint ** vfactors) -{ - GLfloat *ctrl; - GLint tmp_factor1, tmp_factor2; - GLint ufactor_cnt, vfactor_cnt; - GLint offset1, offset2, offset3; - GLint i, j; - - ufactor_cnt = new_ctrl->s_bezier_cnt; - vfactor_cnt = new_ctrl->t_bezier_cnt; - if ((*ufactors = (GLint *) malloc(sizeof(GLint) * ufactor_cnt * 3)) - == NULL) { - return GLU_OUT_OF_MEMORY; - } - if ((*vfactors = (GLint *) malloc(sizeof(GLint) * vfactor_cnt * 3)) - == NULL) { - free(*ufactors); - return GLU_OUT_OF_MEMORY; - } - ctrl = new_ctrl->geom_ctrl; - offset1 = new_ctrl->geom_t_stride * vorder; - offset2 = new_ctrl->geom_s_stride * uorder; - for (j = 0; j < vfactor_cnt; j++) { - *(*vfactors + j * 3 + 1) = tmp_factor1 = - calc_parametric_factor(ctrl, vorder, j * offset1, dim, tolerance, - dim); - /* loop ufactor_cnt-1 times */ - for (i = 1; i < ufactor_cnt; i++) { - tmp_factor2 = calc_parametric_factor(ctrl, vorder, - j * offset1 + i * offset2, dim, - tolerance, dim); - if (tmp_factor2 > tmp_factor1) - tmp_factor1 = tmp_factor2; - } - /* last time for the opposite edge */ - *(*vfactors + j * 3 + 2) = tmp_factor2 = - calc_parametric_factor(ctrl, vorder, - j * offset1 + i * offset2 - - new_ctrl->geom_s_stride, dim, tolerance, dim); - if (tmp_factor2 > tmp_factor1) - *(*vfactors + j * 3) = tmp_factor2; - else - *(*vfactors + j * 3) = tmp_factor1; - } - offset3 = new_ctrl->geom_s_stride; - offset2 = new_ctrl->geom_s_stride * uorder; - for (j = 0; j < ufactor_cnt; j++) { - *(*ufactors + j * 3 + 1) = tmp_factor1 = - calc_parametric_factor(ctrl, uorder, j * offset2, offset3, tolerance, - dim); - /* loop vfactor_cnt-1 times */ - for (i = 1; i < vfactor_cnt; i++) { - tmp_factor2 = calc_parametric_factor(ctrl, uorder, - j * offset2 + i * offset1, - offset3, tolerance, dim); - if (tmp_factor2 > tmp_factor1) - tmp_factor1 = tmp_factor2; - } - /* last time for the opposite edge */ - *(*ufactors + j * 3 + 2) = tmp_factor2 = - calc_parametric_factor(ctrl, uorder, - j * offset2 + i * offset1 - - new_ctrl->geom_t_stride, offset3, tolerance, - dim); - if (tmp_factor2 > tmp_factor1) - *(*ufactors + j * 3) = tmp_factor2; - else - *(*ufactors + j * 3) = tmp_factor1; - } - return GL_NO_ERROR; -} - -static GLenum -calc_sampling_2D(GLfloat * ctrl, GLint cnt, GLint order, - GLfloat tolerance, GLint dim, GLint ** factors) -{ - GLint factor_cnt; - GLint tmp_factor; - GLint offset; - GLint i; - - factor_cnt = cnt / order; - if ((*factors = (GLint *) malloc(sizeof(GLint) * factor_cnt)) == NULL) { - return GLU_OUT_OF_MEMORY; - } - offset = order * dim; - for (i = 0; i < factor_cnt; i++) { - tmp_factor = calc_factor(ctrl, order, i * offset, dim, tolerance, dim); - if (tmp_factor == 0) - (*factors)[i] = 1; - else - (*factors)[i] = tmp_factor; - } - return GL_NO_ERROR; -} - -static void -set_sampling_and_culling(GLUnurbsObj * nobj) -{ - if (nobj->auto_load_matrix == GL_FALSE) { - GLint i; - GLfloat m[4]; - - glPushAttrib((GLbitfield) (GL_VIEWPORT_BIT | GL_TRANSFORM_BIT)); - for (i = 0; i < 4; i++) - m[i] = nobj->sampling_matrices.viewport[i]; - glViewport(m[0], m[1], m[2], m[3]); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadMatrixf(nobj->sampling_matrices.proj); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadMatrixf(nobj->sampling_matrices.model); - } -} - -static void -revert_sampling_and_culling(GLUnurbsObj * nobj) -{ - if (nobj->auto_load_matrix == GL_FALSE) { - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glPopAttrib(); - } -} - -GLenum -glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - GLint ** sfactors, GLint ** tfactors) -{ - GLint dim; - GLenum err; - - *sfactors = NULL; - *tfactors = NULL; - dim = nobj->surface.geom.dim; - set_sampling_and_culling(nobj); - if ((err = calc_sampling_3D(new_ctrl, nobj->sampling_tolerance, dim, - nobj->surface.geom.sorder, - nobj->surface.geom.torder, sfactors, - tfactors)) == GLU_ERROR) { - revert_sampling_and_culling(nobj); - call_user_error(nobj, err); - return GLU_ERROR; - } - revert_sampling_and_culling(nobj); - return GLU_NO_ERROR; -} - -GLenum -glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - GLint ** sfactors, GLint ** tfactors) -{ - GLint s_cnt, t_cnt, i; - GLint u_steps, v_steps; - - s_cnt = new_ctrl->s_bezier_cnt; - t_cnt = new_ctrl->t_bezier_cnt; - *sfactors = NULL; - *tfactors = NULL; - if ((*sfactors = (GLint *) malloc(sizeof(GLint) * s_cnt * 3)) - == NULL) { - return GLU_OUT_OF_MEMORY; - } - if ((*tfactors = (GLint *) malloc(sizeof(GLint) * t_cnt * 3)) - == NULL) { - free(*sfactors); - return GLU_OUT_OF_MEMORY; - } - u_steps = nobj->u_step; - v_steps = nobj->v_step; - for (i = 0; i < s_cnt; i++) { - *(*sfactors + i * 3) = u_steps; - *(*sfactors + i * 3 + 1) = u_steps; - *(*sfactors + i * 3 + 2) = u_steps; - } - for (i = 0; i < t_cnt; i++) { - *(*tfactors + i * 3) = v_steps; - *(*tfactors + i * 3 + 1) = v_steps; - *(*tfactors + i * 3 + 2) = v_steps; - } - return GLU_NO_ERROR; -} - - -GLenum -glu_do_sampling_param_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - GLint ** sfactors, GLint ** tfactors) -{ - GLint dim; - GLenum err; - - *sfactors = NULL; - *tfactors = NULL; - dim = nobj->surface.geom.dim; - set_sampling_and_culling(nobj); - if ( - (err = - calc_sampling_param_3D(new_ctrl, nobj->parametric_tolerance, dim, - nobj->surface.geom.sorder, - nobj->surface.geom.torder, sfactors, - tfactors)) == GLU_ERROR) { - revert_sampling_and_culling(nobj); - call_user_error(nobj, err); - return GLU_ERROR; - } - revert_sampling_and_culling(nobj); - return GLU_NO_ERROR; -} - - -static GLenum -glu_do_sampling_2D(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order, - GLint dim, GLint ** factors) -{ - GLenum err; - - set_sampling_and_culling(nobj); - err = calc_sampling_2D(ctrl, cnt, order, nobj->sampling_tolerance, dim, - factors); - revert_sampling_and_culling(nobj); - return err; -} - - -static GLenum -glu_do_sampling_u(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, GLint order, - GLint dim, GLint ** factors) -{ - GLint i; - GLint u_steps; - - cnt /= order; - if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt)) - == NULL) { - return GLU_OUT_OF_MEMORY; - } - u_steps = nobj->u_step; - for (i = 0; i < cnt; i++) - (*factors)[i] = u_steps; - return GLU_NO_ERROR; -} - - -static GLenum -glu_do_sampling_param_2D(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, - GLint order, GLint dim, GLint ** factors) -{ - GLint i; - GLint u_steps; - GLfloat tolerance; - - set_sampling_and_culling(nobj); - tolerance = nobj->parametric_tolerance; - cnt /= order; - if ((*factors = (GLint *) malloc(sizeof(GLint) * cnt)) - == NULL) { - revert_sampling_and_culling(nobj); - return GLU_OUT_OF_MEMORY; - } - u_steps = nobj->u_step; - for (i = 0; i < cnt; i++) { - (*factors)[i] = calc_parametric_factor(ctrl, order, 0, - dim, tolerance, dim); - - } - revert_sampling_and_culling(nobj); - return GLU_NO_ERROR; -} - -GLenum -glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * ctrl, GLint cnt, - GLint order, GLint dim, GLint ** factors) -{ - GLenum err; - - *factors = NULL; - switch (nobj->sampling_method) { - case GLU_PATH_LENGTH: - if ((err = glu_do_sampling_2D(nobj, ctrl, cnt, order, dim, factors)) != - GLU_NO_ERROR) { - call_user_error(nobj, err); - return GLU_ERROR; - } - break; - case GLU_DOMAIN_DISTANCE: - if ((err = glu_do_sampling_u(nobj, ctrl, cnt, order, dim, factors)) != - GLU_NO_ERROR) { - call_user_error(nobj, err); - return GLU_ERROR; - } - break; - case GLU_PARAMETRIC_ERROR: - if ( - (err = - glu_do_sampling_param_2D(nobj, ctrl, cnt, order, dim, - factors)) != GLU_NO_ERROR) { - call_user_error(nobj, err); - return GLU_ERROR; - } - break; - default: - abort(); - } - - return GLU_NO_ERROR; -} - -/* TODO - i don't like this culling - this one just tests if at least one */ -/* ctrl point lies within the viewport . Also the point_in_viewport() */ -/* should be included in the fnctions for efficiency reasons */ - -static GLboolean -point_in_viewport(GLfloat * pt, GLint dim) -{ - GLdouble model[16], proj[16]; - GLint viewport[4]; - GLdouble x, y, z, w, winx, winy, winz; - - glGetDoublev(GL_MODELVIEW_MATRIX, model); - glGetDoublev(GL_PROJECTION_MATRIX, proj); - glGetIntegerv(GL_VIEWPORT, viewport); - if (dim == 3) { - x = (GLdouble) pt[0]; - y = (GLdouble) pt[1]; - z = (GLdouble) pt[2]; - gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz); - } - else { - w = (GLdouble) pt[3]; - x = (GLdouble) pt[0] / w; - y = (GLdouble) pt[1] / w; - z = (GLdouble) pt[2] / w; - gluProject(x, y, z, model, proj, viewport, &winx, &winy, &winz); - } - if ((GLint) winx >= viewport[0] && (GLint) winx < viewport[2] && - (GLint) winy >= viewport[1] && (GLint) winy < viewport[3]) - return GL_TRUE; - return GL_FALSE; -} - -GLboolean -fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * pts, GLint s_cnt, - GLint t_cnt, GLint s_stride, GLint t_stride, GLint dim) -{ - GLint i, j; - - if (nobj->culling == GL_FALSE) - return GL_FALSE; - set_sampling_and_culling(nobj); - - if (dim == 3) { - for (i = 0; i < s_cnt; i++) - for (j = 0; j < t_cnt; j++) - if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) { - revert_sampling_and_culling(nobj); - return GL_FALSE; - } - } - else { - for (i = 0; i < s_cnt; i++) - for (j = 0; j < t_cnt; j++) - if (point_in_viewport(pts + i * s_stride + j * t_stride, dim)) { - revert_sampling_and_culling(nobj); - return GL_FALSE; - } - } - revert_sampling_and_culling(nobj); - return GL_TRUE; -} - -/*GLboolean -fine_culling_test_3D(GLUnurbsObj *nobj,GLfloat *pts,GLint s_cnt,GLint t_cnt, - GLint s_stride,GLint t_stride, GLint dim) -{ - GLint visible_cnt; - GLfloat feedback_buffer[5]; - GLsizei buffer_size; - GLint i,j; - - if(nobj->culling==GL_FALSE) - return GL_FALSE; - buffer_size=5; - set_sampling_and_culling(nobj); - - glFeedbackBuffer(buffer_size,GL_2D,feedback_buffer); - glRenderMode(GL_FEEDBACK); - if(dim==3) - { - for(i=0;iculling == GL_FALSE) - return GL_FALSE; - set_sampling_and_culling(nobj); - - if (dim == 3) { - for (i = 0; i < cnt; i++) - if (point_in_viewport(pts + i * stride, dim)) { - revert_sampling_and_culling(nobj); - return GL_FALSE; - } - } - else { - for (i = 0; i < cnt; i++) - if (point_in_viewport(pts + i * stride, dim)) { - revert_sampling_and_culling(nobj); - return GL_FALSE; - } - } - revert_sampling_and_culling(nobj); - return GL_TRUE; -} - -/*GLboolean -fine_culling_test_2D(GLUnurbsObj *nobj,GLfloat *pts,GLint cnt, - GLint stride, GLint dim) -{ - GLint visible_cnt; - GLfloat feedback_buffer[5]; - GLsizei buffer_size; - GLint i; - - if(nobj->culling==GL_FALSE) - return GL_FALSE; - buffer_size=5; - set_sampling_and_culling(nobj); - - glFeedbackBuffer(buffer_size,GL_2D,feedback_buffer); - glRenderMode(GL_FEEDBACK); - glBegin(GL_LINE_LOOP); - if(dim==3) - { - for(i=0;i -#include -#include "gluP.h" -#include "tess.h" -#endif - - - -static GLenum store_polygon_as_contour(GLUtriangulatorObj *); -static void free_current_polygon(tess_polygon *); -static void prepare_projection_info(GLUtriangulatorObj *); -static GLdouble twice_the_polygon_area(tess_vertex *, tess_vertex *); -static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *); -void tess_find_contour_hierarchies(GLUtriangulatorObj *); -static GLenum test_for_overlapping_contours(GLUtriangulatorObj *); -static GLenum contours_overlap(tess_contour *, tess_polygon *); -static GLenum is_contour_contained_in(tess_contour *, tess_contour *); -static void add_new_exterior(GLUtriangulatorObj *, tess_contour *); -static void add_new_interior(GLUtriangulatorObj *, tess_contour *, - tess_contour *); -static void add_interior_with_hierarchy_check(GLUtriangulatorObj *, - tess_contour *, tess_contour *); -static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *, - tess_contour *, - tess_contour *); -static GLboolean point_in_polygon(tess_contour *, GLdouble, GLdouble); -static void shift_interior_to_exterior(GLUtriangulatorObj *, tess_contour *); -static void add_exterior_with_check(GLUtriangulatorObj *, tess_contour *, - tess_contour *); -static GLenum cut_out_hole(GLUtriangulatorObj *, tess_contour *, - tess_contour *); -static GLenum merge_hole_with_contour(GLUtriangulatorObj *, - tess_contour *, tess_contour *, - tess_vertex *, tess_vertex *); - -static GLenum -find_normal(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *va, *vb, *vc; - GLdouble A, B, C; - GLdouble A0, A1, A2, B0, B1, B2; - - va = polygon->vertices; - vb = va->next; - A0 = vb->location[0] - va->location[0]; - A1 = vb->location[1] - va->location[1]; - A2 = vb->location[2] - va->location[2]; - for (vc = vb->next; vc != va; vc = vc->next) { - B0 = vc->location[0] - va->location[0]; - B1 = vc->location[1] - va->location[1]; - B2 = vc->location[2] - va->location[2]; - A = A1 * B2 - A2 * B1; - B = A2 * B0 - A0 * B2; - C = A0 * B1 - A1 * B0; - if (fabs(A) > EPSILON || fabs(B) > EPSILON || fabs(C) > EPSILON) { - polygon->A = A; - polygon->B = B; - polygon->C = C; - polygon->D = - -A * va->location[0] - B * va->location[1] - C * va->location[2]; - return GLU_NO_ERROR; - } - } - tess_call_user_error(tobj, GLU_TESS_ERROR7); - return GLU_ERROR; -} - -void -tess_test_polygon(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - - /* any vertices defined? */ - if (polygon->vertex_cnt < 3) { - free_current_polygon(polygon); - return; - } - /* wrap pointers */ - polygon->last_vertex->next = polygon->vertices; - polygon->vertices->previous = polygon->last_vertex; - /* determine the normal */ - if (find_normal(tobj) == GLU_ERROR) - return; - /* compare the normals of previously defined contours and this one */ - /* first contour define ? */ - if (tobj->contours == NULL) { - tobj->A = polygon->A; - tobj->B = polygon->B; - tobj->C = polygon->C; - tobj->D = polygon->D; - /* determine the best projection to use */ - if (fabs(polygon->A) > fabs(polygon->B)) - if (fabs(polygon->A) > fabs(polygon->C)) - tobj->projection = OYZ; - else - tobj->projection = OXY; - else if (fabs(polygon->B) > fabs(polygon->C)) - tobj->projection = OXZ; - else - tobj->projection = OXY; - } - else { - GLdouble a[3], b[3]; - tess_vertex *vertex = polygon->vertices; - - a[0] = tobj->A; - a[1] = tobj->B; - a[2] = tobj->C; - b[0] = polygon->A; - b[1] = polygon->B; - b[2] = polygon->C; - - /* compare the normals */ - if (fabs(a[1] * b[2] - a[2] * b[1]) > EPSILON || - fabs(a[2] * b[0] - a[0] * b[2]) > EPSILON || - fabs(a[0] * b[1] - a[1] * b[0]) > EPSILON) { - /* not coplanar */ - tess_call_user_error(tobj, GLU_TESS_ERROR9); - return; - } - /* the normals are parallel - test for plane equation */ - if (fabs(a[0] * vertex->location[0] + a[1] * vertex->location[1] + - a[2] * vertex->location[2] + tobj->D) > EPSILON) { - /* not the same plane */ - tess_call_user_error(tobj, GLU_TESS_ERROR9); - return; - } - } - prepare_projection_info(tobj); - if (verify_edge_vertex_intersections(tobj) == GLU_ERROR) - return; - if (test_for_overlapping_contours(tobj) == GLU_ERROR) - return; - if (store_polygon_as_contour(tobj) == GLU_ERROR) - return; -} - -static GLenum -test_for_overlapping_contours(GLUtriangulatorObj * tobj) -{ - tess_contour *contour; - tess_polygon *polygon; - - polygon = tobj->current_polygon; - for (contour = tobj->contours; contour != NULL; contour = contour->next) - if (contours_overlap(contour, polygon) != GLU_NO_ERROR) { - tess_call_user_error(tobj, GLU_TESS_ERROR5); - return GLU_ERROR; - } - return GLU_NO_ERROR; -} - -static GLenum -store_polygon_as_contour(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_contour *contour = tobj->contours; - - /* the first contour defined */ - if (contour == NULL) { - if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - free_current_polygon(polygon); - return GLU_ERROR; - } - tobj->contours = tobj->last_contour = contour; - contour->next = contour->previous = NULL; - } - else { - if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - free_current_polygon(polygon); - return GLU_ERROR; - } - contour->previous = tobj->last_contour; - tobj->last_contour->next = contour; - tobj->last_contour = contour; - contour->next = NULL; - } - /* mark all vertices in new contour as not special */ - /* and all are boundary edges */ - { - tess_vertex *vertex; - GLuint vertex_cnt, i; - - for (vertex = polygon->vertices, i = 0, vertex_cnt = - polygon->vertex_cnt; i < vertex_cnt; vertex = vertex->next, i++) { - vertex->shadow_vertex = NULL; - vertex->edge_flag = GL_TRUE; - } - } - contour->vertex_cnt = polygon->vertex_cnt; - contour->area = polygon->area; - contour->orientation = polygon->orientation; - contour->type = GLU_UNKNOWN; - contour->vertices = polygon->vertices; - contour->last_vertex = polygon->last_vertex; - polygon->vertices = polygon->last_vertex = NULL; - polygon->vertex_cnt = 0; - ++(tobj->contour_cnt); - return GLU_NO_ERROR; -} - -static void -free_current_polygon(tess_polygon * polygon) -{ - tess_vertex *vertex, *vertex_tmp; - GLuint i; - - /* free current_polygon structures */ - for (vertex = polygon->vertices, i = 0; i < polygon->vertex_cnt; i++) { - vertex_tmp = vertex->next; - free(vertex); - vertex = vertex_tmp; - } - polygon->vertices = polygon->last_vertex = NULL; - polygon->vertex_cnt = 0; -} - -static void -prepare_projection_info(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *vertex, *last_vertex_ptr; - GLdouble area; - - last_vertex_ptr = polygon->last_vertex; - switch (tobj->projection) { - case OXY: - for (vertex = polygon->vertices; vertex != last_vertex_ptr; - vertex = vertex->next) { - vertex->x = vertex->location[0]; - vertex->y = vertex->location[1]; - } - last_vertex_ptr->x = last_vertex_ptr->location[0]; - last_vertex_ptr->y = last_vertex_ptr->location[1]; - break; - case OXZ: - for (vertex = polygon->vertices; vertex != last_vertex_ptr; - vertex = vertex->next) { - vertex->x = vertex->location[0]; - vertex->y = vertex->location[2]; - } - last_vertex_ptr->x = last_vertex_ptr->location[0]; - last_vertex_ptr->y = last_vertex_ptr->location[2]; - break; - case OYZ: - for (vertex = polygon->vertices; vertex != last_vertex_ptr; - vertex = vertex->next) { - vertex->x = vertex->location[1]; - vertex->y = vertex->location[2]; - } - last_vertex_ptr->x = last_vertex_ptr->location[1]; - last_vertex_ptr->y = last_vertex_ptr->location[2]; - break; - } - area = twice_the_polygon_area(polygon->vertices, polygon->last_vertex); - if (area >= 0.0) { - polygon->orientation = GLU_CCW; - polygon->area = area; - } - else { - polygon->orientation = GLU_CW; - polygon->area = -area; - } -} - -static GLdouble -twice_the_polygon_area(tess_vertex * vertex, tess_vertex * last_vertex) -{ - tess_vertex *next; - GLdouble area, x, y; - - area = 0.0; - x = vertex->x; - y = vertex->y; - vertex = vertex->next; - for (; vertex != last_vertex; vertex = vertex->next) { - next = vertex->next; - area += - (vertex->x - x) * (next->y - y) - (vertex->y - y) * (next->x - x); - } - return area; -} - -/* test if edges ab and cd intersect */ -/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */ -/* else if adjacent return GLU_TESS_ERROR4 */ -static GLenum -edge_edge_intersect(tess_vertex * a, - tess_vertex * b, tess_vertex * c, tess_vertex * d) -{ - GLdouble denom, r, s; - GLdouble xba, ydc, yba, xdc, yac, xac; - - xba = b->x - a->x; - yba = b->y - a->y; - xdc = d->x - c->x; - ydc = d->y - c->y; - xac = a->x - c->x; - yac = a->y - c->y; - denom = xba * ydc - yba * xdc; - r = yac * xdc - xac * ydc; - /* parallel? */ - if (fabs(denom) < EPSILON) { - if (fabs(r) < EPSILON) { - /* colinear */ - if (fabs(xba) < EPSILON) { - /* compare the Y coordinate */ - if (yba > 0.0) { - if ( - (fabs(a->y - c->y) < EPSILON - && fabs(c->y - b->y) < EPSILON) - || (fabs(a->y - d->y) < EPSILON - && fabs(d->y - b->y) < - EPSILON)) return GLU_TESS_ERROR4; - - } - else { - if ( - (fabs(b->y - c->y) < EPSILON - && fabs(c->y - a->y) < EPSILON) - || (fabs(b->y - d->y) < EPSILON - && fabs(d->y - a->y) < - EPSILON)) return GLU_TESS_ERROR4; - } - } - else { - /* compare the X coordinate */ - if (xba > 0.0) { - if ( - (fabs(a->x - c->x) < EPSILON - && fabs(c->x - b->x) < EPSILON) - || (fabs(a->x - d->x) < EPSILON - && fabs(d->x - b->x) < - EPSILON)) return GLU_TESS_ERROR4; - } - else { - if ( - (fabs(b->x - c->x) < EPSILON - && fabs(c->x - a->x) < EPSILON) - || (fabs(b->x - d->x) < EPSILON - && fabs(d->x - a->x) < - EPSILON)) return GLU_TESS_ERROR4; - } - } - } - return GLU_NO_ERROR; - } - r /= denom; - s = (yac * xba - xac * yba) / denom; - /* test if one vertex lies on other edge */ - if (((fabs(r) < EPSILON || (r < 1.0 + EPSILON && r > 1.0 - EPSILON)) && - s > -EPSILON && s < 1.0 + EPSILON) || - ((fabs(s) < EPSILON || (s < 1.0 + EPSILON && s > 1.0 - EPSILON)) && - r > -EPSILON && r < 1.0 + EPSILON)) { - return GLU_TESS_ERROR4; - } - /* test for crossing */ - if (r > -EPSILON && r < 1.0 + EPSILON && s > -EPSILON && s < 1.0 + EPSILON) { - return GLU_TESS_ERROR8; - } - return GLU_NO_ERROR; -} - -static GLenum -verify_edge_vertex_intersections(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *vertex1, *last_vertex, *vertex2; - GLenum test; - - last_vertex = polygon->last_vertex; - vertex1 = last_vertex; - for (vertex2 = vertex1->next->next; - vertex2->next != last_vertex; vertex2 = vertex2->next) { - test = edge_edge_intersect(vertex1, vertex1->next, vertex2, - vertex2->next); - if (test != GLU_NO_ERROR) { - tess_call_user_error(tobj, test); - return GLU_ERROR; - } - } - for (vertex1 = polygon->vertices; - vertex1->next->next != last_vertex; vertex1 = vertex1->next) { - for (vertex2 = vertex1->next->next; - vertex2 != last_vertex; vertex2 = vertex2->next) { - test = edge_edge_intersect(vertex1, vertex1->next, vertex2, - vertex2->next); - if (test != GLU_NO_ERROR) { - tess_call_user_error(tobj, test); - return GLU_ERROR; - } - } - } - return GLU_NO_ERROR; -} - -static int -#ifdef WIN32 - __cdecl -#endif -area_compare(const void *a, const void *b) -{ - GLdouble area1, area2; - - area1 = (*((tess_contour **) a))->area; - area2 = (*((tess_contour **) b))->area; - if (area1 < area2) - return 1; - if (area1 > area2) - return -1; - return 0; -} - -void -tess_find_contour_hierarchies(GLUtriangulatorObj * tobj) -{ - tess_contour **contours; /* dinamic array of pointers */ - tess_contour *tmp_contour_ptr = tobj->contours; - GLuint cnt, i; - GLenum result; - GLboolean hierarchy_changed; - - /* any contours? */ - if (tobj->contour_cnt < 2) { - tobj->contours->type = GLU_EXTERIOR; - return; - } - if ((contours = (tess_contour **) - malloc(sizeof(tess_contour *) * (tobj->contour_cnt))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - for (tmp_contour_ptr = tobj->contours, cnt = 0; - tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) - contours[cnt++] = tmp_contour_ptr; - /* now sort the contours in decreasing area size order */ - qsort((void *) contours, (size_t) cnt, (size_t) sizeof(tess_contour *), - area_compare); - /* we leave just the first contour - remove others from list */ - tobj->contours = contours[0]; - tobj->contours->next = tobj->contours->previous = NULL; - tobj->last_contour = tobj->contours; - tobj->contour_cnt = 1; - /* first contour is the one with greatest area */ - /* must be EXTERIOR */ - tobj->contours->type = GLU_EXTERIOR; - tmp_contour_ptr = tobj->contours; - /* now we play! */ - for (i = 1; i < cnt; i++) { - hierarchy_changed = GL_FALSE; - for (tmp_contour_ptr = tobj->contours; - tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) { - if (tmp_contour_ptr->type == GLU_EXTERIOR) { - /* check if contour completely contained in EXTERIOR */ - result = is_contour_contained_in(tmp_contour_ptr, contours[i]); - switch (result) { - case GLU_INTERIOR: - /* now we have to check if contour is inside interiors */ - /* or not */ - /* any interiors? */ - if (tmp_contour_ptr->next != NULL && - tmp_contour_ptr->next->type == GLU_INTERIOR) { - /* for all interior, check if inside any of them */ - /* if not inside any of interiors, its another */ - /* interior */ - /* or it may contain some interiors, then change */ - /* the contained interiors to exterior ones */ - add_interior_with_hierarchy_check(tobj, - tmp_contour_ptr, - contours[i]); - } - else { - /* not in interior, add as new interior contour */ - add_new_interior(tobj, tmp_contour_ptr, contours[i]); - } - hierarchy_changed = GL_TRUE; - break; - case GLU_EXTERIOR: - /* ooops, the marked as EXTERIOR (contours[i]) is */ - /* actually an interior of tmp_contour_ptr */ - /* reverse the local hierarchy */ - reverse_hierarchy_and_add_exterior(tobj, tmp_contour_ptr, - contours[i]); - hierarchy_changed = GL_TRUE; - break; - case GLU_NO_ERROR: - break; - default: - abort(); - } - } - if (hierarchy_changed) - break; /* break from for loop */ - } - if (hierarchy_changed == GL_FALSE) { - /* disjoint with all contours, add to contour list */ - add_new_exterior(tobj, contours[i]); - } - } - free(contours); -} - -/* returns GLU_INTERIOR if inner is completey enclosed within outer */ -/* returns GLU_EXTERIOR if outer is completely enclosed within inner */ -/* returns GLU_NO_ERROR if contours are disjoint */ -static GLenum -is_contour_contained_in(tess_contour * outer, tess_contour * inner) -{ - GLenum relation_flag; - - /* set relation_flag to relation of containment of first inner vertex */ - /* regarding outer contour */ - if (point_in_polygon(outer, inner->vertices->x, inner->vertices->y)) - relation_flag = GLU_INTERIOR; - else - relation_flag = GLU_EXTERIOR; - if (relation_flag == GLU_INTERIOR) - return GLU_INTERIOR; - if (point_in_polygon(inner, outer->vertices->x, outer->vertices->y)) - return GLU_EXTERIOR; - return GLU_NO_ERROR; -} - -static GLboolean -point_in_polygon(tess_contour * contour, GLdouble x, GLdouble y) -{ - tess_vertex *v1, *v2; - GLuint i, vertex_cnt; - GLdouble xp1, yp1, xp2, yp2; - GLboolean tst; - - tst = GL_FALSE; - v1 = contour->vertices; - v2 = contour->vertices->previous; - for (i = 0, vertex_cnt = contour->vertex_cnt; i < vertex_cnt; i++) { - xp1 = v1->x; - yp1 = v1->y; - xp2 = v2->x; - yp2 = v2->y; - if ((((yp1 <= y) && (y < yp2)) || ((yp2 <= y) && (y < yp1))) && - (x < (xp2 - xp1) * (y - yp1) / (yp2 - yp1) + xp1)) - tst = (tst == GL_FALSE ? GL_TRUE : GL_FALSE); - v2 = v1; - v1 = v1->next; - } - return tst; -} - -static GLenum -contours_overlap(tess_contour * contour, tess_polygon * polygon) -{ - tess_vertex *vertex1, *vertex2; - GLuint vertex1_cnt, vertex2_cnt, i, j; - GLenum test; - - vertex1 = contour->vertices; - vertex2 = polygon->vertices; - vertex1_cnt = contour->vertex_cnt; - vertex2_cnt = polygon->vertex_cnt; - for (i = 0; i < vertex1_cnt; vertex1 = vertex1->next, i++) { - for (j = 0; j < vertex2_cnt; vertex2 = vertex2->next, j++) - if ((test = edge_edge_intersect(vertex1, vertex1->next, vertex2, - vertex2->next)) != GLU_NO_ERROR) - return test; - } - return GLU_NO_ERROR; -} - -static void -add_new_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - contour->type = GLU_EXTERIOR; - contour->next = NULL; - contour->previous = tobj->last_contour; - tobj->last_contour->next = contour; - tobj->last_contour = contour; -} - -static void -add_new_interior(GLUtriangulatorObj * tobj, - tess_contour * outer, tess_contour * contour) -{ - contour->type = GLU_INTERIOR; - contour->next = outer->next; - contour->previous = outer; - if (outer->next != NULL) - outer->next->previous = contour; - outer->next = contour; - if (tobj->last_contour == outer) - tobj->last_contour = contour; -} - -static void -add_interior_with_hierarchy_check(GLUtriangulatorObj * tobj, - tess_contour * outer, - tess_contour * contour) -{ - tess_contour *ptr; - - /* for all interiors of outer check if they are interior of contour */ - /* if so, change that interior to exterior and move it of of the */ - /* interior sequence */ - if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { - GLenum test; - - for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; - ptr = ptr->next) { - test = is_contour_contained_in(ptr, contour); - switch (test) { - case GLU_INTERIOR: - /* contour is contained in one of the interiors */ - /* check if possibly contained in other exteriors */ - /* move ptr to first EXTERIOR */ - for (; ptr != NULL && ptr->type == GLU_INTERIOR; ptr = ptr->next); - if (ptr == NULL) - /* another exterior */ - add_new_exterior(tobj, contour); - else - add_exterior_with_check(tobj, ptr, contour); - return; - case GLU_EXTERIOR: - /* one of the interiors is contained in the contour */ - /* change it to EXTERIOR, and shift it away from the */ - /* interior sequence */ - shift_interior_to_exterior(tobj, ptr); - break; - case GLU_NO_ERROR: - /* disjoint */ - break; - default: - abort(); - } - } - } - /* add contour to the interior sequence */ - add_new_interior(tobj, outer, contour); -} - -static void -reverse_hierarchy_and_add_exterior(GLUtriangulatorObj * tobj, - tess_contour * outer, - tess_contour * contour) -{ - tess_contour *ptr; - - /* reverse INTERIORS to EXTERIORS */ - /* any INTERIORS? */ - if (outer->next != NULL && outer->next->type == GLU_INTERIOR) - for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; - ptr = ptr->next) ptr->type = GLU_EXTERIOR; - /* the outer now becomes inner */ - outer->type = GLU_INTERIOR; - /* contour is the EXTERIOR */ - contour->next = outer; - if (tobj->contours == outer) { - /* first contour beeing reversed */ - contour->previous = NULL; - tobj->contours = contour; - } - else { - outer->previous->next = contour; - contour->previous = outer->previous; - } - outer->previous = contour; -} - -static void -shift_interior_to_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - contour->previous->next = contour->next; - if (contour->next != NULL) - contour->next->previous = contour->previous; - else - tobj->last_contour = contour->previous; -} - -static void -add_exterior_with_check(GLUtriangulatorObj * tobj, - tess_contour * outer, tess_contour * contour) -{ - GLenum test; - - /* this contour might be interior to further exteriors - check */ - /* if not, just add as a new exterior */ - for (; outer != NULL && outer->type == GLU_EXTERIOR; outer = outer->next) { - test = is_contour_contained_in(outer, contour); - switch (test) { - case GLU_INTERIOR: - /* now we have to check if contour is inside interiors */ - /* or not */ - /* any interiors? */ - if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { - /* for all interior, check if inside any of them */ - /* if not inside any of interiors, its another */ - /* interior */ - /* or it may contain some interiors, then change */ - /* the contained interiors to exterior ones */ - add_interior_with_hierarchy_check(tobj, outer, contour); - } - else { - /* not in interior, add as new interior contour */ - add_new_interior(tobj, outer, contour); - } - return; - case GLU_NO_ERROR: - /* disjoint */ - break; - default: - abort(); - } - } - /* add contour to the exterior sequence */ - add_new_exterior(tobj, contour); -} - -void -tess_handle_holes(GLUtriangulatorObj * tobj) -{ - tess_contour *contour, *hole; - GLenum exterior_orientation; - - /* verify hole orientation */ - for (contour = tobj->contours; contour != NULL;) { - exterior_orientation = contour->orientation; - for (contour = contour->next; - contour != NULL && contour->type == GLU_INTERIOR; - contour = contour->next) { - if (contour->orientation == exterior_orientation) { - tess_call_user_error(tobj, GLU_TESS_ERROR5); - return; - } - } - } - /* now cut-out holes */ - for (contour = tobj->contours; contour != NULL;) { - hole = contour->next; - while (hole != NULL && hole->type == GLU_INTERIOR) { - if (cut_out_hole(tobj, contour, hole) == GLU_ERROR) - return; - hole = contour->next; - } - contour = contour->next; - } -} - -static GLenum -cut_out_hole(GLUtriangulatorObj * tobj, - tess_contour * contour, tess_contour * hole) -{ - tess_contour *tmp_hole; - tess_vertex *v1, *v2, *tmp_vertex; - GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt; - GLuint i, j, k; - GLenum test = 0; - - /* find an edge connecting contour and hole not intersecting any other */ - /* edge belonging to either the contour or any of the other holes */ - for (v1 = contour->vertices, vertex1_cnt = contour->vertex_cnt, i = 0; - i < vertex1_cnt; i++, v1 = v1->next) { - for (v2 = hole->vertices, vertex2_cnt = hole->vertex_cnt, j = 0; - j < vertex2_cnt; j++, v2 = v2->next) { - /* does edge (v1,v2) intersect any edge of contour */ - for (tmp_vertex = contour->vertices, tmp_vertex_cnt = - contour->vertex_cnt, k = 0; k < tmp_vertex_cnt; - tmp_vertex = tmp_vertex->next, k++) { - /* skip edge tests for edges directly connected */ - if (v1 == tmp_vertex || v1 == tmp_vertex->next) - continue; - test = edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); - if (test != GLU_NO_ERROR) - break; - } - if (test == GLU_NO_ERROR) { - /* does edge (v1,v2) intersect any edge of hole */ - for (tmp_vertex = hole->vertices, - tmp_vertex_cnt = hole->vertex_cnt, k = 0; - k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { - /* skip edge tests for edges directly connected */ - if (v2 == tmp_vertex || v2 == tmp_vertex->next) - continue; - test = - edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); - if (test != GLU_NO_ERROR) - break; - } - if (test == GLU_NO_ERROR) { - /* does edge (v1,v2) intersect any other hole? */ - for (tmp_hole = hole->next; - tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; - tmp_hole = tmp_hole->next) { - /* does edge (v1,v2) intersect any edge of hole */ - for (tmp_vertex = tmp_hole->vertices, - tmp_vertex_cnt = tmp_hole->vertex_cnt, k = 0; - k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { - test = edge_edge_intersect(v1, v2, tmp_vertex, - tmp_vertex->next); - if (test != GLU_NO_ERROR) - break; - } - if (test != GLU_NO_ERROR) - break; - } - } - } - if (test == GLU_NO_ERROR) { - /* edge (v1,v2) is good for eliminating the hole */ - if (merge_hole_with_contour(tobj, contour, hole, v1, v2) - == GLU_NO_ERROR) - return GLU_NO_ERROR; - else - return GLU_ERROR; - } - } - } - /* other holes are blocking all possible connections of hole */ - /* with contour, we shift this hole as the last hole and retry */ - for (tmp_hole = hole; - tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; - tmp_hole = tmp_hole->next); - contour->next = hole->next; - hole->next->previous = contour; - if (tmp_hole == NULL) { - /* last EXTERIOR contour, shift hole as last contour */ - hole->next = NULL; - hole->previous = tobj->last_contour; - tobj->last_contour->next = hole; - tobj->last_contour = hole; - } - else { - tmp_hole->previous->next = hole; - hole->previous = tmp_hole->previous; - tmp_hole->previous = hole; - hole->next = tmp_hole; - } - hole = contour->next; - /* try once again - recurse */ - return cut_out_hole(tobj, contour, hole); -} - -static GLenum -merge_hole_with_contour(GLUtriangulatorObj * tobj, - tess_contour * contour, - tess_contour * hole, - tess_vertex * v1, tess_vertex * v2) -{ - tess_vertex *v1_new, *v2_new; - - /* make copies of v1 and v2, place them respectively after their originals */ - if ((v1_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if ((v2_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - v1_new->edge_flag = GL_TRUE; - v1_new->data = v1->data; - v1_new->location[0] = v1->location[0]; - v1_new->location[1] = v1->location[1]; - v1_new->location[2] = v1->location[2]; - v1_new->x = v1->x; - v1_new->y = v1->y; - v1_new->shadow_vertex = v1; - v1->shadow_vertex = v1_new; - v1_new->next = v1->next; - v1_new->previous = v1; - v1->next->previous = v1_new; - v1->next = v1_new; - v2_new->edge_flag = GL_TRUE; - v2_new->data = v2->data; - v2_new->location[0] = v2->location[0]; - v2_new->location[1] = v2->location[1]; - v2_new->location[2] = v2->location[2]; - v2_new->x = v2->x; - v2_new->y = v2->y; - v2_new->shadow_vertex = v2; - v2->shadow_vertex = v2_new; - v2_new->next = v2->next; - v2_new->previous = v2; - v2->next->previous = v2_new; - v2->next = v2_new; - /* link together the two lists */ - v1->next = v2_new; - v2_new->previous = v1; - v2->next = v1_new; - v1_new->previous = v2; - /* update the vertex count of the contour */ - contour->vertex_cnt += hole->vertex_cnt + 2; - /* remove the INTERIOR contour */ - contour->next = hole->next; - if (hole->next != NULL) - hole->next->previous = contour; - free(hole); - /* update tobj structure */ - --(tobj->contour_cnt); - if (contour->last_vertex == v1) - contour->last_vertex = v1_new; - /* mark two vertices with edge_flag */ - v2->edge_flag = GL_FALSE; - v1->edge_flag = GL_FALSE; - return GLU_NO_ERROR; -} diff --git a/src/glu/mesa/project.c b/src/glu/mesa/project.c deleted file mode 100644 index 2e79cdf084..0000000000 --- a/src/glu/mesa/project.c +++ /dev/null @@ -1,403 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include "gluP.h" -#endif - - -/* - * This code was contributed by Marc Buffat (buffat@mecaflu.ec-lyon.fr). - * Thanks Marc!!! - */ - - - -/* implementation de gluProject et gluUnproject */ -/* M. Buffat 17/2/95 */ - - - -/* - * Transform a point (column vector) by a 4x4 matrix. I.e. out = m * in - * Input: m - the 4x4 matrix - * in - the 4x1 vector - * Output: out - the resulting 4x1 vector. - */ -static void -transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]) -{ -#define M(row,col) m[col*4+row] - out[0] = - M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3]; - out[1] = - M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3]; - out[2] = - M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3]; - out[3] = - M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3]; -#undef M -} - - - - -/* - * Perform a 4x4 matrix multiplication (product = a x b). - * Input: a, b - matrices to multiply - * Output: product - product of a and b - */ -static void -matmul(GLdouble * product, const GLdouble * a, const GLdouble * b) -{ - /* This matmul was contributed by Thomas Malik */ - GLdouble temp[16]; - GLint i; - -#define A(row,col) a[(col<<2)+row] -#define B(row,col) b[(col<<2)+row] -#define T(row,col) temp[(col<<2)+row] - - /* i-te Zeile */ - for (i = 0; i < 4; i++) { - T(i, 0) = - A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, - 3) * - B(3, 0); - T(i, 1) = - A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, - 3) * - B(3, 1); - T(i, 2) = - A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, - 3) * - B(3, 2); - T(i, 3) = - A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, - 3) * - B(3, 3); - } - -#undef A -#undef B -#undef T - MEMCPY(product, temp, 16 * sizeof(GLdouble)); -} - - - -/* - * Compute inverse of 4x4 transformation matrix. - * Code contributed by Jacques Leroy jle@star.be - * Return GL_TRUE for success, GL_FALSE for failure (singular matrix) - */ -static GLboolean -invert_matrix(const GLdouble * m, GLdouble * out) -{ -/* NB. OpenGL Matrices are COLUMN major. */ -#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; } -#define MAT(m,r,c) (m)[(c)*4+(r)] - - GLdouble wtmp[4][8]; - GLdouble m0, m1, m2, m3, s; - GLdouble *r0, *r1, *r2, *r3; - - r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; - - r0[0] = MAT(m, 0, 0), r0[1] = MAT(m, 0, 1), - r0[2] = MAT(m, 0, 2), r0[3] = MAT(m, 0, 3), - r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, - r1[0] = MAT(m, 1, 0), r1[1] = MAT(m, 1, 1), - r1[2] = MAT(m, 1, 2), r1[3] = MAT(m, 1, 3), - r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, - r2[0] = MAT(m, 2, 0), r2[1] = MAT(m, 2, 1), - r2[2] = MAT(m, 2, 2), r2[3] = MAT(m, 2, 3), - r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, - r3[0] = MAT(m, 3, 0), r3[1] = MAT(m, 3, 1), - r3[2] = MAT(m, 3, 2), r3[3] = MAT(m, 3, 3), - r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; - - /* choose pivot - or die */ - if (fabs(r3[0]) > fabs(r2[0])) - SWAP_ROWS(r3, r2); - if (fabs(r2[0]) > fabs(r1[0])) - SWAP_ROWS(r2, r1); - if (fabs(r1[0]) > fabs(r0[0])) - SWAP_ROWS(r1, r0); - if (0.0 == r0[0]) - return GL_FALSE; - - /* eliminate first variable */ - m1 = r1[0] / r0[0]; - m2 = r2[0] / r0[0]; - m3 = r3[0] / r0[0]; - s = r0[1]; - r1[1] -= m1 * s; - r2[1] -= m2 * s; - r3[1] -= m3 * s; - s = r0[2]; - r1[2] -= m1 * s; - r2[2] -= m2 * s; - r3[2] -= m3 * s; - s = r0[3]; - r1[3] -= m1 * s; - r2[3] -= m2 * s; - r3[3] -= m3 * s; - s = r0[4]; - if (s != 0.0) { - r1[4] -= m1 * s; - r2[4] -= m2 * s; - r3[4] -= m3 * s; - } - s = r0[5]; - if (s != 0.0) { - r1[5] -= m1 * s; - r2[5] -= m2 * s; - r3[5] -= m3 * s; - } - s = r0[6]; - if (s != 0.0) { - r1[6] -= m1 * s; - r2[6] -= m2 * s; - r3[6] -= m3 * s; - } - s = r0[7]; - if (s != 0.0) { - r1[7] -= m1 * s; - r2[7] -= m2 * s; - r3[7] -= m3 * s; - } - - /* choose pivot - or die */ - if (fabs(r3[1]) > fabs(r2[1])) - SWAP_ROWS(r3, r2); - if (fabs(r2[1]) > fabs(r1[1])) - SWAP_ROWS(r2, r1); - if (0.0 == r1[1]) - return GL_FALSE; - - /* eliminate second variable */ - m2 = r2[1] / r1[1]; - m3 = r3[1] / r1[1]; - r2[2] -= m2 * r1[2]; - r3[2] -= m3 * r1[2]; - r2[3] -= m2 * r1[3]; - r3[3] -= m3 * r1[3]; - s = r1[4]; - if (0.0 != s) { - r2[4] -= m2 * s; - r3[4] -= m3 * s; - } - s = r1[5]; - if (0.0 != s) { - r2[5] -= m2 * s; - r3[5] -= m3 * s; - } - s = r1[6]; - if (0.0 != s) { - r2[6] -= m2 * s; - r3[6] -= m3 * s; - } - s = r1[7]; - if (0.0 != s) { - r2[7] -= m2 * s; - r3[7] -= m3 * s; - } - - /* choose pivot - or die */ - if (fabs(r3[2]) > fabs(r2[2])) - SWAP_ROWS(r3, r2); - if (0.0 == r2[2]) - return GL_FALSE; - - /* eliminate third variable */ - m3 = r3[2] / r2[2]; - r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], - r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7]; - - /* last check */ - if (0.0 == r3[3]) - return GL_FALSE; - - s = 1.0 / r3[3]; /* now back substitute row 3 */ - r3[4] *= s; - r3[5] *= s; - r3[6] *= s; - r3[7] *= s; - - m2 = r2[3]; /* now back substitute row 2 */ - s = 1.0 / r2[2]; - r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), - r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); - m1 = r1[3]; - r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, - r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; - m0 = r0[3]; - r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, - r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; - - m1 = r1[2]; /* now back substitute row 1 */ - s = 1.0 / r1[1]; - r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), - r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); - m0 = r0[2]; - r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, - r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; - - m0 = r0[1]; /* now back substitute row 0 */ - s = 1.0 / r0[0]; - r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), - r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); - - MAT(out, 0, 0) = r0[4]; - MAT(out, 0, 1) = r0[5], MAT(out, 0, 2) = r0[6]; - MAT(out, 0, 3) = r0[7], MAT(out, 1, 0) = r1[4]; - MAT(out, 1, 1) = r1[5], MAT(out, 1, 2) = r1[6]; - MAT(out, 1, 3) = r1[7], MAT(out, 2, 0) = r2[4]; - MAT(out, 2, 1) = r2[5], MAT(out, 2, 2) = r2[6]; - MAT(out, 2, 3) = r2[7], MAT(out, 3, 0) = r3[4]; - MAT(out, 3, 1) = r3[5], MAT(out, 3, 2) = r3[6]; - MAT(out, 3, 3) = r3[7]; - - return GL_TRUE; - -#undef MAT -#undef SWAP_ROWS -} - - - -/* projection du point (objx,objy,obz) sur l'ecran (winx,winy,winz) */ -GLint GLAPIENTRY -gluProject(GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble model[16], const GLdouble proj[16], - const GLint viewport[4], - GLdouble * winx, GLdouble * winy, GLdouble * winz) -{ - /* matrice de transformation */ - GLdouble in[4], out[4]; - - /* initilise la matrice et le vecteur a transformer */ - in[0] = objx; - in[1] = objy; - in[2] = objz; - in[3] = 1.0; - transform_point(out, model, in); - transform_point(in, proj, out); - - /* d'ou le resultat normalise entre -1 et 1 */ - if (in[3] == 0.0) - return GL_FALSE; - - in[0] /= in[3]; - in[1] /= in[3]; - in[2] /= in[3]; - - /* en coordonnees ecran */ - *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2; - *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2; - /* entre 0 et 1 suivant z */ - *winz = (1 + in[2]) / 2; - return GL_TRUE; -} - - - -/* transformation du point ecran (winx,winy,winz) en point objet */ -GLint GLAPIENTRY -gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, - const GLdouble model[16], const GLdouble proj[16], - const GLint viewport[4], - GLdouble * objx, GLdouble * objy, GLdouble * objz) -{ - /* matrice de transformation */ - GLdouble m[16], A[16]; - GLdouble in[4], out[4]; - - /* transformation coordonnees normalisees entre -1 et 1 */ - in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; - in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; - in[2] = 2 * winz - 1.0; - in[3] = 1.0; - - /* calcul transformation inverse */ - matmul(A, proj, model); - if (!invert_matrix(A, m)) - return GL_FALSE; - - /* d'ou les coordonnees objets */ - transform_point(out, m, in); - if (out[3] == 0.0) - return GL_FALSE; - *objx = out[0] / out[3]; - *objy = out[1] / out[3]; - *objz = out[2] / out[3]; - return GL_TRUE; -} - - -/* - * New in GLU 1.3 - * This is like gluUnProject but also takes near and far DepthRange values. - */ -#ifdef GLU_VERSION_1_3 -GLint GLAPIENTRY -gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLclampd nearZ, GLclampd farZ, - GLdouble * objx, GLdouble * objy, GLdouble * objz, - GLdouble * objw) -{ - /* matrice de transformation */ - GLdouble m[16], A[16]; - GLdouble in[4], out[4]; - GLdouble z = nearZ + winz * (farZ - nearZ); - - /* transformation coordonnees normalisees entre -1 et 1 */ - in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; - in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; - in[2] = 2.0 * z - 1.0; - in[3] = clipw; - - /* calcul transformation inverse */ - matmul(A, projMatrix, modelMatrix); - if (!invert_matrix(A, m)) - return GL_FALSE; - - /* d'ou les coordonnees objets */ - transform_point(out, m, in); - if (out[3] == 0.0) - return GL_FALSE; - *objx = out[0] / out[3]; - *objy = out[1] / out[3]; - *objz = out[2] / out[3]; - *objw = out[3]; - return GL_TRUE; -} -#endif diff --git a/src/glu/mesa/quadric.c b/src/glu/mesa/quadric.c deleted file mode 100644 index 0f6889b284..0000000000 --- a/src/glu/mesa/quadric.c +++ /dev/null @@ -1,819 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1999-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* TODO: - * texture coordinate support - * flip normals according to orientation - * there's still some inside/outside orientation bugs in possibly all - * but the sphere function - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include "gluP.h" -#endif - - - -#ifndef M_PI -# define M_PI (3.1415926) -#endif - - -/* - * Convert degrees to radians: - */ -#define DEG_TO_RAD(A) ((A)*(M_PI/180.0)) - - -/* - * Sin and Cos for degree angles: - */ -#define SIND( A ) sin( (A)*(M_PI/180.0) ) -#define COSD( A) cos( (A)*(M_PI/180.0) ) - - -/* - * Texture coordinates if texture flag is set - */ -#define TXTR_COORD(x,y) if (qobj->TextureFlag) glTexCoord2f(x,y); - - - -struct GLUquadric -{ - GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */ - GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */ - GLboolean TextureFlag; /* Generate texture coords? */ - GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */ - void (GLCALLBACK * ErrorFunc) (GLenum err); /* Error handler callback function */ -}; - - - -/* - * Process a GLU error. - */ -static void -quadric_error(GLUquadricObj * qobj, GLenum error, const char *msg) -{ - /* Call the error call back function if any */ - if (qobj->ErrorFunc) { - (*qobj->ErrorFunc) (error); - } - /* Print a message to stdout if MESA_DEBUG variable is defined */ - if (getenv("MESA_DEBUG")) { - fprintf(stderr, "GLUError: %s: %s\n", (char *) gluErrorString(error), - msg); - } -} - - - - -GLUquadricObj *GLAPIENTRY -gluNewQuadric(void) -{ - GLUquadricObj *q; - - q = (GLUquadricObj *) malloc(sizeof(struct GLUquadric)); - if (q) { - q->DrawStyle = GLU_FILL; - q->Orientation = GLU_OUTSIDE; - q->TextureFlag = GL_FALSE; - q->Normals = GLU_SMOOTH; - q->ErrorFunc = NULL; - } - return q; -} - - - -void GLAPIENTRY -gluDeleteQuadric(GLUquadricObj * state) -{ - if (state) { - free((void *) state); - } -} - - - -/* - * Set the drawing style to be GLU_FILL, GLU_LINE, GLU_SILHOUETTE, - * or GLU_POINT. - */ -void GLAPIENTRY -gluQuadricDrawStyle(GLUquadricObj * quadObject, GLenum drawStyle) -{ - if (quadObject && (drawStyle == GLU_FILL || drawStyle == GLU_LINE - || drawStyle == GLU_SILHOUETTE - || drawStyle == GLU_POINT)) { - quadObject->DrawStyle = drawStyle; - } - else { - quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle"); - } -} - - - -/* - * Set the orientation to GLU_INSIDE or GLU_OUTSIDE. - */ -void GLAPIENTRY -gluQuadricOrientation(GLUquadricObj * quadObject, GLenum orientation) -{ - if (quadObject - && (orientation == GLU_INSIDE || orientation == GLU_OUTSIDE)) { - quadObject->Orientation = orientation; - } - else { - quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation"); - } -} - - - -/* - * Set the error handler callback function. - */ -void GLAPIENTRY -gluQuadricCallback(GLUquadricObj * qobj, - GLenum which, void (GLCALLBACK * fn) ()) -{ - /* - * UGH, this is a mess! I thought ANSI was a standard. - */ - if (qobj && which == GLU_ERROR) { -#ifdef __CYGWIN32__ - qobj->ErrorFunc = (void (GLCALLBACKPCAST) (GLenum)) fn; -#elif defined(OPENSTEP) - qobj->ErrorFunc = (void (*)(GLenum)) fn; -#elif defined(_WIN32) - qobj->ErrorFunc = (void (GLCALLBACK *) (int)) fn; -#elif defined(__STORM__) - qobj->ErrorFunc = (void (GLCALLBACK *) (GLenum)) fn; -#elif defined(__BEOS__) - qobj->ErrorFunc = (void (*)(GLenum)) fn; -#else - qobj->ErrorFunc = (void (GLCALLBACK *) ()) fn; -#endif - } -} - - -void GLAPIENTRY -gluQuadricNormals(GLUquadricObj * quadObject, GLenum normals) -{ - if (quadObject - && (normals == GLU_NONE || normals == GLU_FLAT - || normals == GLU_SMOOTH)) { - quadObject->Normals = normals; - } -} - - -void GLAPIENTRY -gluQuadricTexture(GLUquadricObj * quadObject, GLboolean textureCoords) -{ - if (quadObject) { - quadObject->TextureFlag = textureCoords; - } -} - - - - -/* - * Call glNormal3f after scaling normal to unit length. - */ -static void -normal3f(GLfloat x, GLfloat y, GLfloat z) -{ - GLdouble mag; - - mag = sqrt(x * x + y * y + z * z); - if (mag > 0.00001F) { - x /= mag; - y /= mag; - z /= mag; - } - glNormal3f(x, y, z); -} - - - -void GLAPIENTRY -gluCylinder(GLUquadricObj * qobj, - GLdouble baseRadius, GLdouble topRadius, - GLdouble height, GLint slices, GLint stacks) -{ - GLdouble da, r, dr, dz; - GLfloat x, y, z, nz, nsign; - GLint i, j; - - if (qobj->Orientation == GLU_INSIDE) { - nsign = -1.0; - } - else { - nsign = 1.0; - } - - da = 2.0 * M_PI / slices; - dr = (topRadius - baseRadius) / stacks; - dz = height / stacks; - nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */ - - if (qobj->DrawStyle == GLU_POINT) { - glBegin(GL_POINTS); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - - z = 0.0; - r = baseRadius; - for (j = 0; j <= stacks; j++) { - glVertex3f(x * r, y * r, z); - z += dz; - r += dr; - } - } - glEnd(); - } - else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { - /* Draw rings */ - if (qobj->DrawStyle == GLU_LINE) { - z = 0.0; - r = baseRadius; - for (j = 0; j <= stacks; j++) { - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * r, y * r, z); - } - glEnd(); - z += dz; - r += dr; - } - } - else { - /* draw one ring at each end */ - if (baseRadius != 0.0) { - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * baseRadius, y * baseRadius, 0.0); - } - glEnd(); - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * topRadius, y * topRadius, height); - } - glEnd(); - } - } - /* draw length lines */ - glBegin(GL_LINES); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * baseRadius, y * baseRadius, 0.0); - glVertex3f(x * topRadius, y * topRadius, height); - } - glEnd(); - } - else if (qobj->DrawStyle == GLU_FILL) { - GLfloat ds = 1.0 / slices; - GLfloat dt = 1.0 / stacks; - GLfloat t = 0.0; - z = 0.0; - r = baseRadius; - for (j = 0; j < stacks; j++) { - GLfloat s = 0.0; - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= slices; i++) { - GLfloat x, y; - if (i == slices) { - x = sin(0.0); - y = cos(0.0); - } - else { - x = sin(i * da); - y = cos(i * da); - } - if (nsign == 1.0) { - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t); - glVertex3f(x * r, y * r, z); - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t + dt); - glVertex3f(x * (r + dr), y * (r + dr), z + dz); - } - else { - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t); - glVertex3f(x * r, y * r, z); - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t + dt); - glVertex3f(x * (r + dr), y * (r + dr), z + dz); - } - s += ds; - } /* for slices */ - glEnd(); - r += dr; - t += dt; - z += dz; - } /* for stacks */ - } -} - - - - - -void GLAPIENTRY -gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks) -{ - GLfloat rho, drho, theta, dtheta; - GLfloat x, y, z; - GLfloat s, t, ds, dt; - GLint i, j, imin, imax; - GLboolean normals; - GLfloat nsign; - - if (qobj->Normals == GLU_NONE) { - normals = GL_FALSE; - } - else { - normals = GL_TRUE; - } - if (qobj->Orientation == GLU_INSIDE) { - nsign = -1.0; - } - else { - nsign = 1.0; - } - - drho = M_PI / (GLfloat) stacks; - dtheta = 2.0 * M_PI / (GLfloat) slices; - - /* texturing: s goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y axis */ - /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */ - /* cannot use triangle fan on texturing (s coord. at top/bottom tip varies) */ - - if (qobj->DrawStyle == GLU_FILL) { - if (!qobj->TextureFlag) { - /* draw +Z end as a triangle fan */ - glBegin(GL_TRIANGLE_FAN); - glNormal3f(0.0, 0.0, 1.0); - glVertex3f(0.0, 0.0, nsign * radius); - for (j = 0; j <= slices; j++) { - theta = (j == slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(drho); - y = cos(theta) * sin(drho); - z = nsign * cos(drho); - if (normals) - glNormal3f(x * nsign, y * nsign, z * nsign); - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - - ds = 1.0 / slices; - dt = 1.0 / stacks; - t = 1.0; /* because loop now runs from 0 */ - if (qobj->TextureFlag) { - imin = 0; - imax = stacks; - } - else { - imin = 1; - imax = stacks - 1; - } - - /* draw intermediate stacks as quad strips */ - for (i = imin; i < imax; i++) { - rho = i * drho; - glBegin(GL_QUAD_STRIP); - s = 0.0; - for (j = 0; j <= slices; j++) { - theta = (j == slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(rho); - y = cos(theta) * sin(rho); - z = nsign * cos(rho); - if (normals) - glNormal3f(x * nsign, y * nsign, z * nsign); - TXTR_COORD(s, t); - glVertex3f(x * radius, y * radius, z * radius); - x = -sin(theta) * sin(rho + drho); - y = cos(theta) * sin(rho + drho); - z = nsign * cos(rho + drho); - if (normals) - glNormal3f(x * nsign, y * nsign, z * nsign); - TXTR_COORD(s, t - dt); - s += ds; - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - t -= dt; - } - - if (!qobj->TextureFlag) { - /* draw -Z end as a triangle fan */ - glBegin(GL_TRIANGLE_FAN); - glNormal3f(0.0, 0.0, -1.0); - glVertex3f(0.0, 0.0, -radius * nsign); - rho = M_PI - drho; - s = 1.0; - t = dt; - for (j = slices; j >= 0; j--) { - theta = (j == slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(rho); - y = cos(theta) * sin(rho); - z = nsign * cos(rho); - if (normals) - glNormal3f(x * nsign, y * nsign, z * nsign); - s -= ds; - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - } - else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { - /* draw stack lines */ - for (i = 1; i < stacks; i++) { /* stack line at i==stacks-1 was missing here */ - rho = i * drho; - glBegin(GL_LINE_LOOP); - for (j = 0; j < slices; j++) { - theta = j * dtheta; - x = cos(theta) * sin(rho); - y = sin(theta) * sin(rho); - z = cos(rho); - if (normals) - glNormal3f(x * nsign, y * nsign, z * nsign); - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - /* draw slice lines */ - for (j = 0; j < slices; j++) { - theta = j * dtheta; - glBegin(GL_LINE_STRIP); - for (i = 0; i <= stacks; i++) { - rho = i * drho; - x = cos(theta) * sin(rho); - y = sin(theta) * sin(rho); - z = cos(rho); - if (normals) - glNormal3f(x * nsign, y * nsign, z * nsign); - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - } - else if (qobj->DrawStyle == GLU_POINT) { - /* top and bottom-most points */ - glBegin(GL_POINTS); - if (normals) - glNormal3f(0.0, 0.0, nsign); - glVertex3d(0.0, 0.0, radius); - if (normals) - glNormal3f(0.0, 0.0, -nsign); - glVertex3d(0.0, 0.0, -radius); - - /* loop over stacks */ - for (i = 1; i < stacks - 1; i++) { - rho = i * drho; - for (j = 0; j < slices; j++) { - theta = j * dtheta; - x = cos(theta) * sin(rho); - y = sin(theta) * sin(rho); - z = cos(rho); - if (normals) - glNormal3f(x * nsign, y * nsign, z * nsign); - glVertex3f(x * radius, y * radius, z * radius); - } - } - glEnd(); - } - -} - - - -void GLAPIENTRY -gluDisk(GLUquadricObj * qobj, - GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops) -{ - GLfloat da, dr; -#if 0 - GLdouble a, da; - GLfloat r, dr; - GLfloat x, y; - GLfloat r1, r2, dtc; - GLint s, l; -#endif - - /* Normal vectors */ - if (qobj->Normals != GLU_NONE) { - if (qobj->Orientation == GLU_OUTSIDE) { - glNormal3f(0.0, 0.0, +1.0); - } - else { - glNormal3f(0.0, 0.0, -1.0); - } - } - - da = 2.0 * M_PI / slices; - dr = (outerRadius - innerRadius) / (GLfloat) loops; - - switch (qobj->DrawStyle) { - case GLU_FILL: - { - /* texture of a gluDisk is a cut out of the texture unit square - * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1] - * (linear mapping) - */ - GLfloat dtc = 2.0f * outerRadius; - GLfloat sa, ca; - GLfloat r1 = innerRadius; - GLint l; - for (l = 0; l < loops; l++) { - GLfloat r2 = r1 + dr; - if (qobj->Orientation == GLU_OUTSIDE) { - GLint s; - glBegin(GL_QUAD_STRIP); - for (s = 0; s <= slices; s++) { - GLfloat a; - if (s == slices) - a = 0.0; - else - a = s * da; - sa = sin(a); - ca = cos(a); - TXTR_COORD(0.5 + sa * r2 / dtc, 0.5 + ca * r2 / dtc); - glVertex2f(r2 * sa, r2 * ca); - TXTR_COORD(0.5 + sa * r1 / dtc, 0.5 + ca * r1 / dtc); - glVertex2f(r1 * sa, r1 * ca); - } - glEnd(); - } - else { - GLint s; - glBegin(GL_QUAD_STRIP); - for (s = slices; s >= 0; s--) { - GLfloat a; - if (s == slices) - a = 0.0; - else - a = s * da; - sa = sin(a); - ca = cos(a); - TXTR_COORD(0.5 - sa * r2 / dtc, 0.5 + ca * r2 / dtc); - glVertex2f(r2 * sa, r2 * ca); - TXTR_COORD(0.5 - sa * r1 / dtc, 0.5 + ca * r1 / dtc); - glVertex2f(r1 * sa, r1 * ca); - } - glEnd(); - } - r1 = r2; - } - break; - } - case GLU_LINE: - { - GLint l, s; - /* draw loops */ - for (l = 0; l <= loops; l++) { - GLfloat r = innerRadius + l * dr; - glBegin(GL_LINE_LOOP); - for (s = 0; s < slices; s++) { - GLfloat a = s * da; - glVertex2f(r * sin(a), r * cos(a)); - } - glEnd(); - } - /* draw spokes */ - for (s = 0; s < slices; s++) { - GLfloat a = s * da; - GLfloat x = sin(a); - GLfloat y = cos(a); - glBegin(GL_LINE_STRIP); - for (l = 0; l <= loops; l++) { - GLfloat r = innerRadius + l * dr; - glVertex2f(r * x, r * y); - } - glEnd(); - } - break; - } - case GLU_POINT: - { - GLint s; - glBegin(GL_POINTS); - for (s = 0; s < slices; s++) { - GLfloat a = s * da; - GLfloat x = sin(a); - GLfloat y = cos(a); - GLint l; - for (l = 0; l <= loops; l++) { - GLfloat r = innerRadius * l * dr; - glVertex2f(r * x, r * y); - } - } - glEnd(); - break; - } - case GLU_SILHOUETTE: - { - if (innerRadius != 0.0) { - GLfloat a; - glBegin(GL_LINE_LOOP); - for (a = 0.0; a < 2.0 * M_PI; a += da) { - GLfloat x = innerRadius * sin(a); - GLfloat y = innerRadius * cos(a); - glVertex2f(x, y); - } - glEnd(); - } - { - GLfloat a; - glBegin(GL_LINE_LOOP); - for (a = 0; a < 2.0 * M_PI; a += da) { - GLfloat x = outerRadius * sin(a); - GLfloat y = outerRadius * cos(a); - glVertex2f(x, y); - } - glEnd(); - } - break; - } - default: - abort(); - } -} - - - -void GLAPIENTRY -gluPartialDisk(GLUquadricObj * qobj, GLdouble innerRadius, - GLdouble outerRadius, GLint slices, GLint loops, - GLdouble startAngle, GLdouble sweepAngle) -{ - if (qobj->Normals != GLU_NONE) { - if (qobj->Orientation == GLU_OUTSIDE) { - glNormal3f(0.0, 0.0, +1.0); - } - else { - glNormal3f(0.0, 0.0, -1.0); - } - } - - if (qobj->DrawStyle == GLU_POINT) { - GLint loop, slice; - GLdouble radius, delta_radius; - GLdouble angle, delta_angle; - delta_radius = (outerRadius - innerRadius) / (loops - 1); - delta_angle = DEG_TO_RAD((sweepAngle) / (slices - 1)); - glBegin(GL_POINTS); - radius = innerRadius; - for (loop = 0; loop < loops; loop++) { - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice < slices; slice++) { - glVertex2d(radius * sin(angle), radius * cos(angle)); - angle += delta_angle; - } - radius += delta_radius; - } - glEnd(); - } - else if (qobj->DrawStyle == GLU_LINE) { - GLint loop, slice; - GLdouble radius, delta_radius; - GLdouble angle, delta_angle; - delta_radius = (outerRadius - innerRadius) / loops; - delta_angle = DEG_TO_RAD(sweepAngle / slices); - /* draw rings */ - radius = innerRadius; - for (loop = 0; loop < loops; loop++) { - angle = DEG_TO_RAD(startAngle); - glBegin(GL_LINE_STRIP); - for (slice = 0; slice <= slices; slice++) { - glVertex2d(radius * sin(angle), radius * cos(angle)); - angle += delta_angle; - } - glEnd(); - radius += delta_radius; - } - /* draw spokes */ - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice <= slices; slice++) { - radius = innerRadius; - glBegin(GL_LINE_STRIP); - for (loop = 0; loop < loops; loop++) { - glVertex2d(radius * sin(angle), radius * cos(angle)); - radius += delta_radius; - } - glEnd(); - angle += delta_angle; - } - } - else if (qobj->DrawStyle == GLU_SILHOUETTE) { - GLint slice; - GLdouble angle, delta_angle; - delta_angle = DEG_TO_RAD(sweepAngle / slices); - /* draw outer ring */ - glBegin(GL_LINE_STRIP); - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice <= slices; slice++) { - glVertex2d(outerRadius * sin(angle), outerRadius * cos(angle)); - angle += delta_angle; - } - glEnd(); - /* draw inner ring */ - if (innerRadius > 0.0) { - glBegin(GL_LINE_STRIP); - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice < slices; slice++) { - glVertex2d(innerRadius * sin(angle), innerRadius * cos(angle)); - angle += delta_angle; - } - glEnd(); - } - /* draw spokes */ - if (sweepAngle < 360.0) { - GLdouble stopAngle = startAngle + sweepAngle; - glBegin(GL_LINES); - glVertex2d(innerRadius * SIND(startAngle), - innerRadius * COSD(startAngle)); - glVertex2d(outerRadius * SIND(startAngle), - outerRadius * COSD(startAngle)); - glVertex2d(innerRadius * SIND(stopAngle), - innerRadius * COSD(stopAngle)); - glVertex2d(outerRadius * SIND(stopAngle), - outerRadius * COSD(stopAngle)); - glEnd(); - } - } - else if (qobj->DrawStyle == GLU_FILL) { - GLint loop, slice; - GLdouble radius, delta_radius; - GLdouble angle, delta_angle; - delta_radius = (outerRadius - innerRadius) / loops; - delta_angle = DEG_TO_RAD(sweepAngle / slices); - radius = innerRadius; - for (loop = 0; loop < loops; loop++) { - glBegin(GL_QUAD_STRIP); - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice <= slices; slice++) { - if (qobj->Orientation == GLU_OUTSIDE) { - glVertex2d((radius + delta_radius) * sin(angle), - (radius + delta_radius) * cos(angle)); - glVertex2d(radius * sin(angle), radius * cos(angle)); - } - else { - glVertex2d(radius * sin(angle), radius * cos(angle)); - glVertex2d((radius + delta_radius) * sin(angle), - (radius + delta_radius) * cos(angle)); - } - angle += delta_angle; - } - glEnd(); - radius += delta_radius; - } - } -} diff --git a/src/glu/mesa/tess.c b/src/glu/mesa/tess.c deleted file mode 100644 index 341d29bae3..0000000000 --- a/src/glu/mesa/tess.c +++ /dev/null @@ -1,327 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "tess.h" -#endif - - -/* - * This is ugly, but seems the easiest way to do things to make the - * code work under YellowBox for Windows - */ -#if defined(OPENSTEP) && defined(CALLBACK) -#undef CALLBACK -#define CALLBACK -#endif - - -static void delete_contours(GLUtriangulatorObj *); - -#ifdef __CYGWIN32__ -#define _CALLBACK -#else -#define _CALLBACK GLCALLBACK -#endif - - -static void -init_callbacks(tess_callbacks * callbacks) -{ - callbacks->begin = (void (_CALLBACK *) (GLenum)) 0; - callbacks->edgeFlag = (void (_CALLBACK *) (GLboolean)) 0; - callbacks->vertex = (void (_CALLBACK *) (void *)) 0; - callbacks->end = (void (_CALLBACK *) (void)) 0; - callbacks->error = (void (_CALLBACK *) (GLenum)) 0; -} - -void -tess_call_user_error(GLUtriangulatorObj * tobj, GLenum gluerr) -{ - if (tobj->error == GLU_NO_ERROR) - tobj->error = gluerr; - if (tobj->callbacks.error != NULL) - (tobj->callbacks.error) (gluerr); -} - -GLUtriangulatorObj *GLAPIENTRY -gluNewTess(void) -{ - GLUtriangulatorObj *tobj; - - if ((tobj = (GLUtriangulatorObj *) - malloc(sizeof(struct GLUtesselator))) == NULL) - return NULL; - tobj->contours = tobj->last_contour = NULL; - init_callbacks(&tobj->callbacks); - tobj->error = GLU_NO_ERROR; - tobj->current_polygon = NULL; - tobj->contour_cnt = 0; - return tobj; -} - - -void GLAPIENTRY -gluTessCallback(GLUtriangulatorObj * tobj, GLenum which, - void (GLCALLBACK * fn) ()) -{ - switch (which) { - case GLU_BEGIN: - tobj->callbacks.begin = (void (_CALLBACK *) (GLenum)) fn; - break; - case GLU_EDGE_FLAG: - tobj->callbacks.edgeFlag = (void (_CALLBACK *) (GLboolean)) fn; - break; - case GLU_VERTEX: - tobj->callbacks.vertex = (void (_CALLBACK *) (void *)) fn; - break; - case GLU_END: - tobj->callbacks.end = (void (_CALLBACK *) (void)) fn; - break; - case GLU_ERROR: - tobj->callbacks.error = (void (_CALLBACK *) (GLenum)) fn; - break; - default: - tobj->error = GLU_INVALID_ENUM; - break; - } -} - - - -void GLAPIENTRY -gluDeleteTess(GLUtriangulatorObj * tobj) -{ - if (tobj->error == GLU_NO_ERROR && tobj->contour_cnt) - /* was gluEndPolygon called? */ - tess_call_user_error(tobj, GLU_TESS_ERROR1); - /* delete all internal structures */ - delete_contours(tobj); - free(tobj); -} - - -void GLAPIENTRY -gluBeginPolygon(GLUtriangulatorObj * tobj) -{ -/* - if(tobj->error!=GLU_NO_ERROR) - return; -*/ - tobj->error = GLU_NO_ERROR; - if (tobj->current_polygon != NULL) { - /* gluEndPolygon was not called */ - tess_call_user_error(tobj, GLU_TESS_ERROR1); - /* delete all internal structures */ - delete_contours(tobj); - } - else { - if ((tobj->current_polygon = - (tess_polygon *) malloc(sizeof(tess_polygon))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - tobj->current_polygon->vertex_cnt = 0; - tobj->current_polygon->vertices = - tobj->current_polygon->last_vertex = NULL; - } -} - - -void GLAPIENTRY -gluEndPolygon(GLUtriangulatorObj * tobj) -{ - /*tess_contour *contour_ptr; */ - - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - /* check if gluBeginPolygon was called */ - if (tobj->current_polygon == NULL) { - tess_call_user_error(tobj, GLU_TESS_ERROR2); - return; - } - tess_test_polygon(tobj); - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - /* any real contours? */ - if (tobj->contour_cnt == 0) { - /* delete all internal structures */ - delete_contours(tobj); - return; - } - tess_find_contour_hierarchies(tobj); - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - tess_handle_holes(tobj); - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - /* if no callbacks, nothing to do */ - if (tobj->callbacks.begin != NULL && tobj->callbacks.vertex != NULL && - tobj->callbacks.end != NULL) { - if (tobj->callbacks.edgeFlag == NULL) - tess_tesselate(tobj); - else - tess_tesselate_with_edge_flag(tobj); - } - - end: - /* delete all internal structures */ - delete_contours(tobj); -} - - -void GLAPIENTRY -gluNextContour(GLUtriangulatorObj * tobj, GLenum type) -{ - if (tobj->error != GLU_NO_ERROR) - return; - if (tobj->current_polygon == NULL) { - tess_call_user_error(tobj, GLU_TESS_ERROR2); - return; - } - /* first contour? */ - if (tobj->current_polygon->vertex_cnt) - tess_test_polygon(tobj); -} - - -void GLAPIENTRY -gluTessVertex(GLUtriangulatorObj * tobj, GLdouble v[3], void *data) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *last_vertex_ptr; - - if (tobj->error != GLU_NO_ERROR) - return; - if (polygon == NULL) { - tess_call_user_error(tobj, GLU_TESS_ERROR2); - return; - } - last_vertex_ptr = polygon->last_vertex; - if (last_vertex_ptr == NULL) { - if ((last_vertex_ptr = (tess_vertex *) - malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - polygon->vertices = last_vertex_ptr; - polygon->last_vertex = last_vertex_ptr; - last_vertex_ptr->data = data; - last_vertex_ptr->location[0] = v[0]; - last_vertex_ptr->location[1] = v[1]; - last_vertex_ptr->location[2] = v[2]; - last_vertex_ptr->next = NULL; - last_vertex_ptr->previous = NULL; - ++(polygon->vertex_cnt); - } - else { - tess_vertex *vertex_ptr; - - /* same point twice? */ - if (fabs(last_vertex_ptr->location[0] - v[0]) < EPSILON && - fabs(last_vertex_ptr->location[1] - v[1]) < EPSILON && - fabs(last_vertex_ptr->location[2] - v[2]) < EPSILON) { - tess_call_user_error(tobj, GLU_TESS_ERROR6); - return; - } - if ((vertex_ptr = (tess_vertex *) - malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - vertex_ptr->data = data; - vertex_ptr->location[0] = v[0]; - vertex_ptr->location[1] = v[1]; - vertex_ptr->location[2] = v[2]; - vertex_ptr->next = NULL; - vertex_ptr->previous = last_vertex_ptr; - ++(polygon->vertex_cnt); - last_vertex_ptr->next = vertex_ptr; - polygon->last_vertex = vertex_ptr; - } -} - - -static void -delete_contours(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_contour *contour, *contour_tmp; - tess_vertex *vertex, *vertex_tmp; - - /* remove current_polygon list - if exists due to detected error */ - if (polygon != NULL) { - if (polygon->vertices) { - for (vertex = polygon->vertices; vertex != polygon->last_vertex;) { - vertex_tmp = vertex->next; - free(vertex); - vertex = vertex_tmp; - } - free(vertex); - } - free(polygon); - tobj->current_polygon = NULL; - } - /* remove all contour data */ - for (contour = tobj->contours; contour != NULL;) { - for (vertex = contour->vertices; vertex != contour->last_vertex;) { - vertex_tmp = vertex->next; - free(vertex); - vertex = vertex_tmp; - } - free(vertex); - contour_tmp = contour->next; - free(contour); - contour = contour_tmp; - } - tobj->contours = tobj->last_contour = NULL; - tobj->contour_cnt = 0; -} - - -void GLAPIENTRY -gluTessNormal(GLUtesselator *tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ) -{ - /* dummy function */ - (void) tess; - (void) valueX; - (void) valueY; - (void) valueZ; -} diff --git a/src/glu/mesa/tess.h b/src/glu/mesa/tess.h deleted file mode 100644 index 4e51dddd37..0000000000 --- a/src/glu/mesa/tess.h +++ /dev/null @@ -1,107 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifndef TESS_H -#define TESS_H - - -#include "gluP.h" - -#define EPSILON 1e-06 /* epsilon for double precision compares */ - -typedef enum -{ - OXY, - OYZ, - OXZ -} -projection_type; - -typedef struct callbacks_str -{ - void (GLCALLBACK * begin) (GLenum mode); - void (GLCALLBACK * edgeFlag) (GLboolean flag); - void (GLCALLBACK * vertex) (GLvoid * v); - void (GLCALLBACK * end) (void); - void (GLCALLBACK * error) (GLenum err); -} -tess_callbacks; - -typedef struct vertex_str -{ - void *data; - GLdouble location[3]; - GLdouble x, y; - GLboolean edge_flag; - struct vertex_str *shadow_vertex; - struct vertex_str *next, *previous; -} -tess_vertex; - -typedef struct contour_str -{ - GLenum type; - GLuint vertex_cnt; - GLdouble area; - GLenum orientation; - struct vertex_str *vertices, *last_vertex; - struct contour_str *next, *previous; -} -tess_contour; - -typedef struct polygon_str -{ - GLuint vertex_cnt; - GLdouble A, B, C, D; - GLdouble area; - GLenum orientation; - struct vertex_str *vertices, *last_vertex; -} -tess_polygon; - -struct GLUtesselator -{ - tess_contour *contours, *last_contour; - GLuint contour_cnt; - tess_callbacks callbacks; - tess_polygon *current_polygon; - GLenum error; - GLdouble A, B, C, D; - projection_type projection; -}; - - -extern void tess_call_user_error(GLUtriangulatorObj *, GLenum); -extern void tess_test_polygon(GLUtriangulatorObj *); -extern void tess_find_contour_hierarchies(GLUtriangulatorObj *); -extern void tess_handle_holes(GLUtriangulatorObj *); -extern void tess_tesselate(GLUtriangulatorObj *); -extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *); - - -#endif diff --git a/src/glu/mesa/tesselat.c b/src/glu/mesa/tesselat.c deleted file mode 100644 index 47d230073f..0000000000 --- a/src/glu/mesa/tesselat.c +++ /dev/null @@ -1,406 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "tess.h" -#endif - - - -static GLboolean edge_flag; - -static void emit_triangle(GLUtriangulatorObj *, tess_vertex *, - tess_vertex *, tess_vertex *); - -static void emit_triangle_with_edge_flag(GLUtriangulatorObj *, - tess_vertex *, GLboolean, - tess_vertex *, GLboolean, - tess_vertex *, GLboolean); - -static GLdouble -twice_the_triangle_area(tess_vertex * va, tess_vertex * vb, tess_vertex * vc) -{ - return (vb->x - va->x) * (vc->y - va->y) - (vb->y - va->y) * (vc->x - - va->x); -} - -static GLboolean -left(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) -{ - if (A * x + B * y + C > -EPSILON) - return GL_TRUE; - else - return GL_FALSE; -} - -static GLboolean -right(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) -{ - if (A * x + B * y + C < EPSILON) - return GL_TRUE; - else - return GL_FALSE; -} - -static GLint -convex_ccw(tess_vertex * va, - tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) -{ - GLdouble d; - - d = twice_the_triangle_area(va, vb, vc); - - if (d > EPSILON) { - return 1; - } - else if (d < -EPSILON) { - return 0; - } - else { - return -1; - } -} - -static GLint -convex_cw(tess_vertex * va, - tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) -{ - GLdouble d; - - d = twice_the_triangle_area(va, vb, vc); - - if (d < -EPSILON) { - return 1; - } - else if (d > EPSILON) { - return 0; - } - else { - return -1; - } -} - -static GLboolean -diagonal_ccw(tess_vertex * va, - tess_vertex * vb, - GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vc = va->next, *vertex, *shadow_vertex; - struct - { - GLdouble A, B, C; - } - ac, cb, ba; - GLdouble x, y; - - GLint res = convex_ccw(va, vc, vb, tobj); - if (res == 0) - return GL_FALSE; - if (res == -1) - return GL_TRUE; - - ba.A = vb->y - va->y; - ba.B = va->x - vb->x; - ba.C = -ba.A * va->x - ba.B * va->y; - ac.A = va->y - vc->y; - ac.B = vc->x - va->x; - ac.C = -ac.A * vc->x - ac.B * vc->y; - cb.A = vc->y - vb->y; - cb.B = vb->x - vc->x; - cb.C = -cb.A * vb->x - cb.B * vb->y; - for (vertex = vb->next; vertex != va; vertex = vertex->next) { - shadow_vertex = vertex->shadow_vertex; - if (shadow_vertex != NULL && - (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) - continue; - x = vertex->x; - y = vertex->y; - if (left(ba.A, ba.B, ba.C, x, y) && - left(ac.A, ac.B, ac.C, x, y) && left(cb.A, cb.B, cb.C, x, y)) - return GL_FALSE; - } - return GL_TRUE; -} - -static GLboolean -diagonal_cw(tess_vertex * va, - tess_vertex * vb, - GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vc = va->next, *vertex, *shadow_vertex; - struct - { - GLdouble A, B, C; - } - ac, cb, ba; - GLdouble x, y; - - GLint res = convex_cw(va, vc, vb, tobj); - if (res == 0) - return GL_FALSE; - if (res == -1) - return GL_TRUE; - - ba.A = vb->y - va->y; - ba.B = va->x - vb->x; - ba.C = -ba.A * va->x - ba.B * va->y; - ac.A = va->y - vc->y; - ac.B = vc->x - va->x; - ac.C = -ac.A * vc->x - ac.B * vc->y; - cb.A = vc->y - vb->y; - cb.B = vb->x - vc->x; - cb.C = -cb.A * vb->x - cb.B * vb->y; - for (vertex = vb->next; vertex != va; vertex = vertex->next) { - shadow_vertex = vertex->shadow_vertex; - if (shadow_vertex != NULL && - (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) - continue; - x = vertex->x; - y = vertex->y; - if (right(ba.A, ba.B, ba.C, x, y) && - right(ac.A, ac.B, ac.C, x, y) && right(cb.A, cb.B, cb.C, x, y)) - return GL_FALSE; - } - return GL_TRUE; -} - -static void -clip_ear(GLUtriangulatorObj * tobj, tess_vertex * v, tess_contour * contour) -{ - emit_triangle(tobj, v->previous, v, v->next); - /* the first in the list */ - if (contour->vertices == v) { - contour->vertices = v->next; - contour->last_vertex->next = v->next; - v->next->previous = contour->last_vertex; - } - else - /* the last ? */ - if (contour->last_vertex == v) { - contour->vertices->previous = v->previous; - v->previous->next = v->next; - contour->last_vertex = v->previous; - } - else { - v->next->previous = v->previous; - v->previous->next = v->next; - } - free(v); - --(contour->vertex_cnt); -} - -static void -clip_ear_with_edge_flag(GLUtriangulatorObj * tobj, - tess_vertex * v, tess_contour * contour) -{ - emit_triangle_with_edge_flag(tobj, v->previous, v->previous->edge_flag, - v, v->edge_flag, v->next, GL_FALSE); - v->previous->edge_flag = GL_FALSE; - /* the first in the list */ - if (contour->vertices == v) { - contour->vertices = v->next; - contour->last_vertex->next = v->next; - v->next->previous = contour->last_vertex; - } - else - /* the last ? */ - if (contour->last_vertex == v) { - contour->vertices->previous = v->previous; - v->previous->next = v->next; - contour->last_vertex = v->previous; - } - else { - v->next->previous = v->previous; - v->previous->next = v->next; - } - free(v); - --(contour->vertex_cnt); -} - -static void -triangulate_ccw(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -static void -triangulate_cw(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -static void -triangulate_ccw_with_edge_flag(GLUtriangulatorObj * tobj, - tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear_with_edge_flag(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -static void -triangulate_cw_with_edge_flag(GLUtriangulatorObj * tobj, - tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear_with_edge_flag(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -void -tess_tesselate(GLUtriangulatorObj * tobj) -{ - tess_contour *contour; - - for (contour = tobj->contours; contour != NULL; contour = contour->next) { - if (contour->orientation == GLU_CCW) { - triangulate_ccw(tobj, contour); - } - else { - triangulate_cw(tobj, contour); - } - if (tobj->error != GLU_NO_ERROR) - return; - - /* emit the last triangle */ - emit_triangle(tobj, contour->vertices, contour->vertices->next, - contour->vertices->next->next); - } -} - -void -tess_tesselate_with_edge_flag(GLUtriangulatorObj * tobj) -{ - tess_contour *contour; - - edge_flag = GL_TRUE; - /* first callback with edgeFlag set to GL_TRUE */ - (tobj->callbacks.edgeFlag) (GL_TRUE); - - for (contour = tobj->contours; contour != NULL; contour = contour->next) { - if (contour->orientation == GLU_CCW) - triangulate_ccw_with_edge_flag(tobj, contour); - else - triangulate_cw_with_edge_flag(tobj, contour); - if (tobj->error != GLU_NO_ERROR) - return; - /* emit the last triangle */ - emit_triangle_with_edge_flag(tobj, contour->vertices, - contour->vertices->edge_flag, - contour->vertices->next, - contour->vertices->next->edge_flag, - contour->vertices->next->next, - contour->vertices->next->next->edge_flag); - } -} - -static void -emit_triangle(GLUtriangulatorObj * tobj, - tess_vertex * v1, tess_vertex * v2, tess_vertex * v3) -{ - (tobj->callbacks.begin) (GL_TRIANGLES); - (tobj->callbacks.vertex) (v1->data); - (tobj->callbacks.vertex) (v2->data); - (tobj->callbacks.vertex) (v3->data); - (tobj->callbacks.end) (); -} - -static void -emit_triangle_with_edge_flag(GLUtriangulatorObj * tobj, - tess_vertex * v1, - GLboolean edge_flag1, - tess_vertex * v2, - GLboolean edge_flag2, - tess_vertex * v3, GLboolean edge_flag3) -{ - (tobj->callbacks.begin) (GL_TRIANGLES); - if (edge_flag1 != edge_flag) { - edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag) (edge_flag); - } - (tobj->callbacks.vertex) (v1->data); - if (edge_flag2 != edge_flag) { - edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag) (edge_flag); - } - (tobj->callbacks.vertex) (v2->data); - if (edge_flag3 != edge_flag) { - edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag) (edge_flag); - } - (tobj->callbacks.vertex) (v3->data); - (tobj->callbacks.end) (); -} diff --git a/src/glu/mini/all.h b/src/glu/mini/all.h deleted file mode 100644 index 874c935925..0000000000 --- a/src/glu/mini/all.h +++ /dev/null @@ -1,54 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file includes all .h files needed for the GLU source code for - * the purpose of precompiled headers. - * - * If the preprocessor symbol PCH is defined at compile time then each - * of the .c files will #include "all.h" only, instead of a bunch of - * individual .h files. - */ - - -#ifndef GLU_ALL_H -#define GLU_ALL_H - - -#ifndef PC_HEADER -This is an error. all.h should be included only if PCH is defined. -#endif - - -#include -#include -#include -#include -#include -#include "GL/gl.h" -#include "GL/glu.h" -#include "gluP.h" -#include "nurbs.h" -#include "tess.h" - - -#endif /*GLU_ALL_H */ diff --git a/src/glu/mini/glu.c b/src/glu/mini/glu.c deleted file mode 100644 index 31429e3343..0000000000 --- a/src/glu/mini/glu.c +++ /dev/null @@ -1,416 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * Copyright (C) 1995-2001 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include -#include -#include "gluP.h" -#endif - - -/* - * Miscellaneous utility functions - */ - - -#ifndef M_PI -#define M_PI 3.1415926536 -#endif -#define EPS 0.00001 - -#ifndef GLU_INCOMPATIBLE_GL_VERSION -#define GLU_INCOMPATIBLE_GL_VERSION 100903 -#endif - - -void GLAPIENTRY -gluLookAt(GLdouble eyex, GLdouble eyey, GLdouble eyez, - GLdouble centerx, GLdouble centery, GLdouble centerz, - GLdouble upx, GLdouble upy, GLdouble upz) -{ - GLfloat m[16]; - GLfloat x[3], y[3], z[3]; - GLfloat mag; - - /* Make rotation matrix */ - - /* Z vector */ - z[0] = eyex - centerx; - z[1] = eyey - centery; - z[2] = eyez - centerz; - mag = sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]); - if (mag) { /* mpichler, 19950515 */ - z[0] /= mag; - z[1] /= mag; - z[2] /= mag; - } - - /* Y vector */ - y[0] = upx; - y[1] = upy; - y[2] = upz; - - /* X vector = Y cross Z */ - x[0] = y[1] * z[2] - y[2] * z[1]; - x[1] = -y[0] * z[2] + y[2] * z[0]; - x[2] = y[0] * z[1] - y[1] * z[0]; - - /* Recompute Y = Z cross X */ - y[0] = z[1] * x[2] - z[2] * x[1]; - y[1] = -z[0] * x[2] + z[2] * x[0]; - y[2] = z[0] * x[1] - z[1] * x[0]; - - /* mpichler, 19950515 */ - /* cross product gives area of parallelogram, which is < 1.0 for - * non-perpendicular unit-length vectors; so normalize x, y here - */ - - mag = sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]); - if (mag) { - x[0] /= mag; - x[1] /= mag; - x[2] /= mag; - } - - mag = sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]); - if (mag) { - y[0] /= mag; - y[1] /= mag; - y[2] /= mag; - } - -#define M(row,col) m[col*4+row] - M(0, 0) = x[0]; - M(0, 1) = x[1]; - M(0, 2) = x[2]; - M(0, 3) = 0.0; - M(1, 0) = y[0]; - M(1, 1) = y[1]; - M(1, 2) = y[2]; - M(1, 3) = 0.0; - M(2, 0) = z[0]; - M(2, 1) = z[1]; - M(2, 2) = z[2]; - M(2, 3) = 0.0; - M(3, 0) = 0.0; - M(3, 1) = 0.0; - M(3, 2) = 0.0; - M(3, 3) = 1.0; -#undef M - glMultMatrixf(m); - - /* Translate Eye to Origin */ - glTranslatef(-eyex, -eyey, -eyez); - -} - - - -void GLAPIENTRY -gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) -{ - glOrtho(left, right, bottom, top, -1.0, 1.0); -} - - - -static void -frustum(GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, - GLfloat nearval, GLfloat farval) -{ - GLfloat x, y, a, b, c, d; - GLfloat m[16]; - - x = (2.0 * nearval) / (right - left); - y = (2.0 * nearval) / (top - bottom); - a = (right + left) / (right - left); - b = (top + bottom) / (top - bottom); - c = -(farval + nearval) / ( farval - nearval); - d = -(2.0 * farval * nearval) / (farval - nearval); - -#define M(row,col) m[col*4+row] - M(0,0) = x; M(0,1) = 0.0F; M(0,2) = a; M(0,3) = 0.0F; - M(1,0) = 0.0F; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0F; - M(2,0) = 0.0F; M(2,1) = 0.0F; M(2,2) = c; M(2,3) = d; - M(3,0) = 0.0F; M(3,1) = 0.0F; M(3,2) = -1.0F; M(3,3) = 0.0F; -#undef M - - glMultMatrixf(m); -} - - -void GLAPIENTRY -gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar) -{ - GLfloat xmin, xmax, ymin, ymax; - - ymax = zNear * tan(fovy * M_PI / 360.0); - ymin = -ymax; - xmin = ymin * aspect; - xmax = ymax * aspect; - - /* don't call glFrustum() because of error semantics (covglu) */ - frustum(xmin, xmax, ymin, ymax, zNear, zFar); -} - - - -void GLAPIENTRY -gluPickMatrix(GLdouble x, GLdouble y, - GLdouble width, GLdouble height, GLint viewport[4]) -{ - GLfloat m[16]; - GLfloat sx, sy; - GLfloat tx, ty; - - sx = viewport[2] / width; - sy = viewport[3] / height; - tx = (viewport[2] + 2.0 * (viewport[0] - x)) / width; - ty = (viewport[3] + 2.0 * (viewport[1] - y)) / height; - -#define M(row,col) m[col*4+row] - M(0, 0) = sx; - M(0, 1) = 0.0; - M(0, 2) = 0.0; - M(0, 3) = tx; - M(1, 0) = 0.0; - M(1, 1) = sy; - M(1, 2) = 0.0; - M(1, 3) = ty; - M(2, 0) = 0.0; - M(2, 1) = 0.0; - M(2, 2) = 1.0; - M(2, 3) = 0.0; - M(3, 0) = 0.0; - M(3, 1) = 0.0; - M(3, 2) = 0.0; - M(3, 3) = 1.0; -#undef M - - glMultMatrixf(m); -} - - - -const GLubyte *GLAPIENTRY -gluErrorString(GLenum errorCode) -{ - static char *tess_error[] = { - "missing gluBeginPolygon", - "missing gluBeginContour", - "missing gluEndPolygon", - "missing gluEndContour", - "misoriented or self-intersecting loops", - "coincident vertices", - "colinear vertices", - "FIST recovery process fatal error" - }; - static char *nurbs_error[] = { - "spline order un-supported", - "too few knots", - "valid knot range is empty", - "decreasing knot sequence knot", - "knot multiplicity greater than order of spline", - "endcurve() must follow bgncurve()", - "bgncurve() must precede endcurve()", - "missing or extra geometric data", - "can't draw pwlcurves", - "missing bgncurve()", - "missing bgnsurface()", - "endtrim() must precede endsurface()", - "bgnsurface() must precede endsurface()", - "curve of improper type passed as trim curve", - "bgnsurface() must precede bgntrim()", - "endtrim() must follow bgntrim()", - "bgntrim() must precede endtrim()", - "invalid or missing trim curve", - "bgntrim() must precede pwlcurve()", - "pwlcurve referenced twice", - "pwlcurve and nurbscurve mixed", - "improper usage of trim data type", - "nurbscurve referenced twice", - "nurbscurve and pwlcurve mixed", - "nurbssurface referenced twice", - "invalid property", - "endsurface() must follow bgnsurface()", - "misoriented trim curves", - "intersecting trim curves", - "UNUSED", - "unconnected trim curves", - "unknown knot error", - "negative vertex count encountered", - "negative byte-stride encountered", - "unknown type descriptor", - "null control array or knot vector", - "duplicate point on pwlcurve" - }; - - /* GL Errors */ - if (errorCode == GL_NO_ERROR) { - return (GLubyte *) "no error"; - } - else if (errorCode == GL_INVALID_VALUE) { - return (GLubyte *) "invalid value"; - } - else if (errorCode == GL_INVALID_ENUM) { - return (GLubyte *) "invalid enum"; - } - else if (errorCode == GL_INVALID_OPERATION) { - return (GLubyte *) "invalid operation"; - } - else if (errorCode == GL_STACK_OVERFLOW) { - return (GLubyte *) "stack overflow"; - } - else if (errorCode == GL_STACK_UNDERFLOW) { - return (GLubyte *) "stack underflow"; - } - else if (errorCode == GL_OUT_OF_MEMORY) { - return (GLubyte *) "out of memory"; - } - /* GLU Errors */ - else if (errorCode == GLU_NO_ERROR) { - return (GLubyte *) "no error"; - } - else if (errorCode == GLU_INVALID_ENUM) { - return (GLubyte *) "invalid enum"; - } - else if (errorCode == GLU_INVALID_VALUE) { - return (GLubyte *) "invalid value"; - } - else if (errorCode == GLU_OUT_OF_MEMORY) { - return (GLubyte *) "out of memory"; - } - else if (errorCode == GLU_INCOMPATIBLE_GL_VERSION) { - return (GLubyte *) "incompatible GL version"; - } - else if (errorCode >= GLU_TESS_ERROR1 && errorCode <= GLU_TESS_ERROR8) { - return (GLubyte *) tess_error[errorCode - GLU_TESS_ERROR1]; - } - else if (errorCode >= GLU_NURBS_ERROR1 && errorCode <= GLU_NURBS_ERROR37) { - return (GLubyte *) nurbs_error[errorCode - GLU_NURBS_ERROR1]; - } - else { - return NULL; - } -} - - - -/* - * New in GLU 1.1 - */ - -const GLubyte *GLAPIENTRY -gluGetString(GLenum name) -{ - static char *extensions = "GL_EXT_abgr"; - static char *version = "1.1 Mesa 3.5"; - - switch (name) { - case GLU_EXTENSIONS: - return (GLubyte *) extensions; - case GLU_VERSION: - return (GLubyte *) version; - default: - return NULL; - } -} - - - -#if 0 /* gluGetProcAddressEXT not finalized yet! */ - -#ifdef __cplusplus - /* for BeOS R4.5 */ -void GLAPIENTRY(*gluGetProcAddressEXT(const GLubyte * procName)) (...) -#else -void (GLAPIENTRY * gluGetProcAddressEXT(const GLubyte * procName)) () -#endif -{ - struct proc - { - const char *name; - void *address; - }; - static struct proc procTable[] = { - {"gluGetProcAddressEXT", (void *) gluGetProcAddressEXT}, /* me! */ - - /* new 1.1 functions */ - {"gluGetString", (void *) gluGetString}, - - /* new 1.2 functions */ - {"gluTessBeginPolygon", (void *) gluTessBeginPolygon}, - {"gluTessBeginContour", (void *) gluTessBeginContour}, - {"gluTessEndContour", (void *) gluTessEndContour}, - {"gluTessEndPolygon", (void *) gluTessEndPolygon}, - {"gluGetTessProperty", (void *) gluGetTessProperty}, - - /* new 1.3 functions */ - - {NULL, NULL} - }; - GLuint i; - - for (i = 0; procTable[i].address; i++) { - if (strcmp((const char *) procName, procTable[i].name) == 0) - return (void (GLAPIENTRY *) ()) procTable[i].address; - } - - return NULL; -} - -#endif - - - -/* - * New in GLU 1.3 - */ -#ifdef GLU_VERSION_1_3 -GLboolean GLAPIENTRY -gluCheckExtension(const GLubyte *extName, const GLubyte * extString) -{ - assert(extName); - assert(extString); - { - const int len = strlen((const char *) extName); - const char *start = (const char *) extString; - - while (1) { - const char *c = strstr(start, (const char *) extName); - if (!c) - return GL_FALSE; - - if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0)) - return GL_TRUE; - - start = c + len; - } - } -} -#endif diff --git a/src/glu/mini/gluP.h b/src/glu/mini/gluP.h deleted file mode 100644 index a39edce41f..0000000000 --- a/src/glu/mini/gluP.h +++ /dev/null @@ -1,141 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file allows the GLU code to be compiled either with the Mesa - * headers or with the real OpenGL headers. - */ - - -#ifndef GLUP_H -#define GLUP_H - - -#include -#include -#include - - -#if defined(_WIN32) && !defined(__WIN32__) -# define __WIN32__ -#endif - -#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__)) -# pragma warning( disable : 4068 ) /* unknown pragma */ -# pragma warning( disable : 4710 ) /* function 'foo' not inlined */ -# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */ -# pragma warning( disable : 4127 ) /* conditional expression is constant */ -# if defined(MESA_MINWARN) -# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */ -# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */ -# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */ -# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */ -# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */ -# endif -# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ -# define GLAPI __declspec(dllexport) -# define WGLAPI __declspec(dllexport) -# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ -# define GLAPI __declspec(dllimport) -# define WGLAPI __declspec(dllimport) -# else /* for use with static link lib build of Win32 edition only */ -# define GLAPI extern -# define WGLAPI __declspec(dllimport) -# endif /* _STATIC_MESA support */ -# define GLAPIENTRY __stdcall -# define GLAPIENTRYP __stdcall * -# define GLCALLBACK __stdcall -# define GLCALLBACKP __stdcall * -# if defined(__CYGWIN__) -# define GLCALLBACKPCAST * -# else -# define GLCALLBACKPCAST __stdcall * -# endif -# define GLWINAPI __stdcall -# define GLWINAPIV __cdecl -#else -/* non-Windows compilation */ -# define GLAPI extern -# define GLAPIENTRY -# define GLAPIENTRYP * -# define GLCALLBACK -# define GLCALLBACKP * -# define GLCALLBACKPCAST * -# define GLWINAPI -# define GLWINAPIV -#endif /* WIN32 / CYGWIN bracket */ - -/* compatibility guard so we don't need to change client code */ - -#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP) -# define CALLBACK GLCALLBACK -typedef int (GLAPIENTRY *PROC)(); -typedef void *HGLRC; -typedef void *HDC; -typedef unsigned long COLORREF; -#endif - -#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) -# define WGL_FONT_LINES 0 -# define WGL_FONT_POLYGONS 1 -#ifndef _GNU_H_WINDOWS32_FUNCTIONS -# ifdef UNICODE -# define wglUseFontBitmaps wglUseFontBitmapsW -# define wglUseFontOutlines wglUseFontOutlinesW -# else -# define wglUseFontBitmaps wglUseFontBitmapsA -# define wglUseFontOutlines wglUseFontOutlinesA -# endif /* !UNICODE */ -#endif /* _GNU_H_WINDOWS32_FUNCTIONS */ -typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR; -typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT; -typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR; -#include -#endif - - - -#ifndef GLU_TESS_ERROR9 - /* If we're using the real OpenGL header files... */ -# define GLU_TESS_ERROR9 100159 -#endif - - -#define GLU_NO_ERROR GL_NO_ERROR - - -/* for Sun: */ -#ifdef SUNOS4 -#define MEMCPY( DST, SRC, BYTES) \ - memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) ) -#else -#define MEMCPY( DST, SRC, BYTES) \ - memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) ) -#endif - - -#ifndef NULL -# define NULL 0 -#endif - - -#endif diff --git a/src/glu/mini/mipmap.c b/src/glu/mini/mipmap.c deleted file mode 100644 index 1cf739a13e..0000000000 --- a/src/glu/mini/mipmap.c +++ /dev/null @@ -1,767 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.4 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include -#include "gluP.h" -#endif - - -/* - * Compute ceiling of integer quotient of A divided by B: - */ -#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) - - - -#ifdef EPSILON -#undef EPSILON -#endif -#define EPSILON 0.001 - - -/* To work around optimizer bug in MSVC4.1 */ -#if defined(__WIN32__) && !defined(OPENSTEP) -void -dummy(GLuint j, GLuint k) -{ -} -#else -#define dummy(J, K) -#endif - - -GLint GLAPIENTRY -gluScaleImage(GLenum format, - GLsizei widthin, GLsizei heightin, - GLenum typein, const void *datain, - GLsizei widthout, GLsizei heightout, - GLenum typeout, void *dataout) -{ - GLint components, i, j, k; - GLfloat *tempin, *tempout, f; - GLfloat sx, sy; - GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; - GLint packrowlength, packalignment, packskiprows, packskippixels; - GLint sizein, sizeout; - GLint rowstride, rowlen; - - - /* Determine number of components per pixel */ - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - components = 1; - break; - case GL_LUMINANCE_ALPHA: - components = 2; - break; - case GL_RGB: - case GL_BGR: - components = 3; - break; - case GL_RGBA: - case GL_BGRA: -#ifdef GL_EXT_abgr - case GL_ABGR_EXT: -#endif - components = 4; - break; - default: - return GLU_INVALID_ENUM; - } - - /* Determine bytes per input datum */ - switch (typein) { - case GL_UNSIGNED_BYTE: - sizein = sizeof(GLubyte); - break; - case GL_BYTE: - sizein = sizeof(GLbyte); - break; - case GL_UNSIGNED_SHORT: - sizein = sizeof(GLushort); - break; - case GL_SHORT: - sizein = sizeof(GLshort); - break; - case GL_UNSIGNED_INT: - sizein = sizeof(GLuint); - break; - case GL_INT: - sizein = sizeof(GLint); - break; - case GL_FLOAT: - sizein = sizeof(GLfloat); - break; - case GL_BITMAP: - /* not implemented yet */ - default: - return GL_INVALID_ENUM; - } - - /* Determine bytes per output datum */ - switch (typeout) { - case GL_UNSIGNED_BYTE: - sizeout = sizeof(GLubyte); - break; - case GL_BYTE: - sizeout = sizeof(GLbyte); - break; - case GL_UNSIGNED_SHORT: - sizeout = sizeof(GLushort); - break; - case GL_SHORT: - sizeout = sizeof(GLshort); - break; - case GL_UNSIGNED_INT: - sizeout = sizeof(GLuint); - break; - case GL_INT: - sizeout = sizeof(GLint); - break; - case GL_FLOAT: - sizeout = sizeof(GLfloat); - break; - case GL_BITMAP: - /* not implemented yet */ - default: - return GL_INVALID_ENUM; - } - - /* Get glPixelStore state */ - glGetFloatv(GL_UNPACK_ROW_LENGTH, &f); unpackrowlength = (int)f; - glGetFloatv(GL_UNPACK_ALIGNMENT, &f); unpackalignment = (int)f; - glGetFloatv(GL_UNPACK_SKIP_ROWS, &f); unpackskiprows = (int)f; - glGetFloatv(GL_UNPACK_SKIP_PIXELS, &f); unpackskippixels = (int)f; - glGetFloatv(GL_PACK_ROW_LENGTH, &f); packrowlength = (int)f; - glGetFloatv(GL_PACK_ALIGNMENT, &f); packalignment = (int)f; - glGetFloatv(GL_PACK_SKIP_ROWS, &f); packskiprows = (int)f; - glGetFloatv(GL_PACK_SKIP_PIXELS, &f); packskippixels = (int)f; - - /* Allocate storage for intermediate images */ - tempin = (GLfloat *) malloc(widthin * heightin - * components * sizeof(GLfloat)); - if (!tempin) { - return GLU_OUT_OF_MEMORY; - } - tempout = (GLfloat *) malloc(widthout * heightout - * components * sizeof(GLfloat)); - if (!tempout) { - free(tempin); - return GLU_OUT_OF_MEMORY; - } - - - /* - * Unpack the pixel data and convert to floating point - */ - - if (unpackrowlength > 0) { - rowlen = unpackrowlength; - } - else { - rowlen = widthin; - } - if (sizein >= unpackalignment) { - rowstride = components * rowlen; - } - else { - rowstride = unpackalignment / sizein - * CEILING(components * rowlen * sizein, unpackalignment); - } - - switch (typein) { - case GL_UNSIGNED_BYTE: - k = 0; - for (i = 0; i < heightin; i++) { - GLubyte *ubptr = (GLubyte *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * ubptr++; - } - } - break; - case GL_BYTE: - k = 0; - for (i = 0; i < heightin; i++) { - GLbyte *bptr = (GLbyte *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * bptr++; - } - } - break; - case GL_UNSIGNED_SHORT: - k = 0; - for (i = 0; i < heightin; i++) { - GLushort *usptr = (GLushort *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * usptr++; - } - } - break; - case GL_SHORT: - k = 0; - for (i = 0; i < heightin; i++) { - GLshort *sptr = (GLshort *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * sptr++; - } - } - break; - case GL_UNSIGNED_INT: - k = 0; - for (i = 0; i < heightin; i++) { - GLuint *uiptr = (GLuint *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * uiptr++; - } - } - break; - case GL_INT: - k = 0; - for (i = 0; i < heightin; i++) { - GLint *iptr = (GLint *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = (GLfloat) * iptr++; - } - } - break; - case GL_FLOAT: - k = 0; - for (i = 0; i < heightin; i++) { - GLfloat *fptr = (GLfloat *) datain - + i * rowstride - + unpackskiprows * rowstride + unpackskippixels * components; - for (j = 0; j < widthin * components; j++) { - dummy(j, k); - tempin[k++] = *fptr++; - } - } - break; - default: - { - free(tempin); - free(tempout); - return GLU_INVALID_ENUM; - } - } - - - /* - * Scale the image! - */ - - if (widthout > 1) - sx = (GLfloat) (widthin - 1) / (GLfloat) (widthout - 1); - else - sx = (GLfloat) (widthin - 1); - if (heightout > 1) - sy = (GLfloat) (heightin - 1) / (GLfloat) (heightout - 1); - else - sy = (GLfloat) (heightin - 1); - -/*#define POINT_SAMPLE*/ -#ifdef POINT_SAMPLE - for (i = 0; i < heightout; i++) { - GLint ii = i * sy; - for (j = 0; j < widthout; j++) { - GLint jj = j * sx; - - GLfloat *src = tempin + (ii * widthin + jj) * components; - GLfloat *dst = tempout + (i * widthout + j) * components; - - for (k = 0; k < components; k++) { - *dst++ = *src++; - } - } - } -#else - if (sx < 1.0 && sy < 1.0) { - /* magnify both width and height: use weighted sample of 4 pixels */ - GLint i0, i1, j0, j1; - GLfloat alpha, beta; - GLfloat *src00, *src01, *src10, *src11; - GLfloat s1, s2; - GLfloat *dst; - - for (i = 0; i < heightout; i++) { - i0 = i * sy; - i1 = i0 + 1; - if (i1 >= heightin) - i1 = heightin - 1; -/* i1 = (i+1) * sy - EPSILON;*/ - alpha = i * sy - i0; - for (j = 0; j < widthout; j++) { - j0 = j * sx; - j1 = j0 + 1; - if (j1 >= widthin) - j1 = widthin - 1; -/* j1 = (j+1) * sx - EPSILON; */ - beta = j * sx - j0; - - /* compute weighted average of pixels in rect (i0,j0)-(i1,j1) */ - src00 = tempin + (i0 * widthin + j0) * components; - src01 = tempin + (i0 * widthin + j1) * components; - src10 = tempin + (i1 * widthin + j0) * components; - src11 = tempin + (i1 * widthin + j1) * components; - - dst = tempout + (i * widthout + j) * components; - - for (k = 0; k < components; k++) { - s1 = *src00++ * (1.0 - beta) + *src01++ * beta; - s2 = *src10++ * (1.0 - beta) + *src11++ * beta; - *dst++ = s1 * (1.0 - alpha) + s2 * alpha; - } - } - } - } - else { - /* shrink width and/or height: use an unweighted box filter */ - GLint i0, i1; - GLint j0, j1; - GLint ii, jj; - GLfloat sum, *dst; - - for (i = 0; i < heightout; i++) { - i0 = i * sy; - i1 = i0 + 1; - if (i1 >= heightin) - i1 = heightin - 1; -/* i1 = (i+1) * sy - EPSILON; */ - for (j = 0; j < widthout; j++) { - j0 = j * sx; - j1 = j0 + 1; - if (j1 >= widthin) - j1 = widthin - 1; -/* j1 = (j+1) * sx - EPSILON; */ - - dst = tempout + (i * widthout + j) * components; - - /* compute average of pixels in the rectangle (i0,j0)-(i1,j1) */ - for (k = 0; k < components; k++) { - sum = 0.0; - for (ii = i0; ii <= i1; ii++) { - for (jj = j0; jj <= j1; jj++) { - sum += *(tempin + (ii * widthin + jj) * components + k); - } - } - sum /= (j1 - j0 + 1) * (i1 - i0 + 1); - *dst++ = sum; - } - } - } - } -#endif - - - /* - * Return output image - */ - - if (packrowlength > 0) { - rowlen = packrowlength; - } - else { - rowlen = widthout; - } - if (sizeout >= packalignment) { - rowstride = components * rowlen; - } - else { - rowstride = packalignment / sizeout - * CEILING(components * rowlen * sizeout, packalignment); - } - - switch (typeout) { - case GL_UNSIGNED_BYTE: - k = 0; - for (i = 0; i < heightout; i++) { - GLubyte *ubptr = (GLubyte *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *ubptr++ = (GLubyte) tempout[k++]; - } - } - break; - case GL_BYTE: - k = 0; - for (i = 0; i < heightout; i++) { - GLbyte *bptr = (GLbyte *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *bptr++ = (GLbyte) tempout[k++]; - } - } - break; - case GL_UNSIGNED_SHORT: - k = 0; - for (i = 0; i < heightout; i++) { - GLushort *usptr = (GLushort *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *usptr++ = (GLushort) tempout[k++]; - } - } - break; - case GL_SHORT: - k = 0; - for (i = 0; i < heightout; i++) { - GLshort *sptr = (GLshort *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *sptr++ = (GLshort) tempout[k++]; - } - } - break; - case GL_UNSIGNED_INT: - k = 0; - for (i = 0; i < heightout; i++) { - GLuint *uiptr = (GLuint *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *uiptr++ = (GLuint) tempout[k++]; - } - } - break; - case GL_INT: - k = 0; - for (i = 0; i < heightout; i++) { - GLint *iptr = (GLint *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *iptr++ = (GLint) tempout[k++]; - } - } - break; - case GL_FLOAT: - k = 0; - for (i = 0; i < heightout; i++) { - GLfloat *fptr = (GLfloat *) dataout - + i * rowstride - + packskiprows * rowstride + packskippixels * components; - for (j = 0; j < widthout * components; j++) { - dummy(j, k + i); - *fptr++ = tempout[k++]; - } - } - break; - default: - return GLU_INVALID_ENUM; - } - - - /* free temporary image storage */ - free(tempin); - free(tempout); - - return 0; -} - - - -/* - * Return the largest k such that 2^k <= n. - */ -static GLint -ilog2(GLint n) -{ - GLint k; - - if (n <= 0) - return 0; - for (k = 0; n >>= 1; k++); - return k; -} - - - -/* - * Find the value nearest to n which is also a power of two. - */ -static GLint -round2(GLint n) -{ - GLint m; - - for (m = 1; m < n; m *= 2); - - /* m>=n */ - if (m - n <= n - m / 2) { - return m; - } - else { - return m / 2; - } -} - - -/* - * Given an pixel format and data type, return the number of bytes to - * store one pixel. - */ -static GLint -bytes_per_pixel(GLenum format, GLenum type) -{ - GLint n, m; - - switch (format) { - case GL_COLOR_INDEX: - case GL_STENCIL_INDEX: - case GL_DEPTH_COMPONENT: - case GL_RED: - case GL_GREEN: - case GL_BLUE: - case GL_ALPHA: - case GL_LUMINANCE: - n = 1; - break; - case GL_LUMINANCE_ALPHA: - n = 2; - break; - case GL_RGB: - case GL_BGR: - n = 3; - break; - case GL_RGBA: - case GL_BGRA: -#ifdef GL_EXT_abgr - case GL_ABGR_EXT: -#endif - n = 4; - break; - default: - n = 0; - } - - switch (type) { - case GL_UNSIGNED_BYTE: - m = sizeof(GLubyte); - break; - case GL_BYTE: - m = sizeof(GLbyte); - break; - case GL_BITMAP: - m = 1; - break; - case GL_UNSIGNED_SHORT: - m = sizeof(GLushort); - break; - case GL_SHORT: - m = sizeof(GLshort); - break; - case GL_UNSIGNED_INT: - m = sizeof(GLuint); - break; - case GL_INT: - m = sizeof(GLint); - break; - case GL_FLOAT: - m = sizeof(GLfloat); - break; - default: - m = 0; - } - - return n * m; -} - - - -/* - * WARNING: This function isn't finished and has never been tested!!!! - */ -GLint GLAPIENTRY -gluBuild1DMipmaps(GLenum target, GLint components, - GLsizei width, GLenum format, GLenum type, const void *data) -{ - return 0; -} - - - -GLint GLAPIENTRY -gluBuild2DMipmaps(GLenum target, GLint components, - GLsizei width, GLsizei height, GLenum format, - GLenum type, const void *data) -{ - GLint w, h; - GLint maxsize; - void *image, *newimage; - GLint neww, newh, level, bpp; - int error; - GLboolean done; - GLint retval = 0; - GLint unpackrowlength, unpackalignment, unpackskiprows, unpackskippixels; - GLint packrowlength, packalignment, packskiprows, packskippixels; - GLfloat f; - - if (width < 1 || height < 1) - return GLU_INVALID_VALUE; - - glGetFloatv(GL_MAX_TEXTURE_SIZE, &f); maxsize = (int)f; - - w = round2(width); - if (w > maxsize) { - w = maxsize; - } - h = round2(height); - if (h > maxsize) { - h = maxsize; - } - - bpp = bytes_per_pixel(format, type); - if (bpp == 0) { - /* probably a bad format or type enum */ - return GLU_INVALID_ENUM; - } - - /* Get current glPixelStore values */ - glGetFloatv(GL_UNPACK_ROW_LENGTH, &f); unpackrowlength = (int)f; - glGetFloatv(GL_UNPACK_ALIGNMENT, &f); unpackalignment = (int)f; - glGetFloatv(GL_UNPACK_SKIP_ROWS, &f); unpackskiprows = (int)f; - glGetFloatv(GL_UNPACK_SKIP_PIXELS, &f); unpackskippixels = (int)f; - glGetFloatv(GL_PACK_ROW_LENGTH, &f); packrowlength = (int)f; - glGetFloatv(GL_PACK_ALIGNMENT, &f); packalignment = (int)f; - glGetFloatv(GL_PACK_SKIP_ROWS, &f); packskiprows = (int)f; - glGetFloatv(GL_PACK_SKIP_PIXELS, &f); packskippixels = (int)f; - - /* set pixel packing */ - glPixelStorei(GL_PACK_ROW_LENGTH, 0); - glPixelStorei(GL_PACK_ALIGNMENT, 1); - glPixelStorei(GL_PACK_SKIP_ROWS, 0); - glPixelStorei(GL_PACK_SKIP_PIXELS, 0); - - done = GL_FALSE; - - if (w != width || h != height) { - /* must rescale image to get "top" mipmap texture image */ - image = malloc((w + 4) * h * bpp); - if (!image) { - return GLU_OUT_OF_MEMORY; - } - error = gluScaleImage(format, width, height, type, data, - w, h, type, image); - if (error) { - retval = error; - done = GL_TRUE; - } - } - else { - image = (void *) data; - } - - level = 0; - while (!done) { - if (image != data) { - /* set pixel unpacking */ - glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - } - - glTexImage2D(target, level, components, w, h, 0, format, type, image); - - if (w == 1 && h == 1) - break; - - neww = (w < 2) ? 1 : w / 2; - newh = (h < 2) ? 1 : h / 2; - newimage = malloc((neww + 4) * newh * bpp); - if (!newimage) { - return GLU_OUT_OF_MEMORY; - } - - error = gluScaleImage(format, w, h, type, image, - neww, newh, type, newimage); - if (error) { - retval = error; - done = GL_TRUE; - } - - if (image != data) { - free(image); - } - image = newimage; - - w = neww; - h = newh; - level++; - } - - if (image != data) { - free(image); - } - - /* Restore original glPixelStore state */ - glPixelStorei(GL_UNPACK_ROW_LENGTH, unpackrowlength); - glPixelStorei(GL_UNPACK_ALIGNMENT, unpackalignment); - glPixelStorei(GL_UNPACK_SKIP_ROWS, unpackskiprows); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, unpackskippixels); - glPixelStorei(GL_PACK_ROW_LENGTH, packrowlength); - glPixelStorei(GL_PACK_ALIGNMENT, packalignment); - glPixelStorei(GL_PACK_SKIP_ROWS, packskiprows); - glPixelStorei(GL_PACK_SKIP_PIXELS, packskippixels); - - return retval; -} diff --git a/src/glu/mini/nurbs.c b/src/glu/mini/nurbs.c deleted file mode 100644 index 9f39cacb41..0000000000 --- a/src/glu/mini/nurbs.c +++ /dev/null @@ -1,157 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "gluP.h" -#include "nurbs.h" -#endif - - -void -call_user_error(GLUnurbsObj * nobj, GLenum error) -{ - nobj->error = error; - if (nobj->error_callback != NULL) { - (*(nobj->error_callback)) (error); - } - else { - printf("NURBS error %d %s\n", error, (char *) gluErrorString(error)); - } -} - - - -GLUnurbsObj *GLAPIENTRY -gluNewNurbsRenderer(void) -{ - GLUnurbsObj *n; - GLfloat tmp_viewport[4]; - GLint i, j; - - n = (GLUnurbsObj *) malloc(sizeof(GLUnurbsObj)); - return n; -} - - - -void GLAPIENTRY -gluDeleteNurbsRenderer(GLUnurbsObj * nobj) -{ - if (nobj) { - free(nobj); - } -} - - - -void GLAPIENTRY -gluLoadSamplingMatrices(GLUnurbsObj * nobj, - const GLfloat modelMatrix[16], - const GLfloat projMatrix[16], const GLint viewport[4]) -{ -} - - -void GLAPIENTRY -gluNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat value) -{ -} - - -void GLAPIENTRY -gluGetNurbsProperty(GLUnurbsObj * nobj, GLenum property, GLfloat * value) -{ -} - - - -void GLAPIENTRY -gluBeginCurve(GLUnurbsObj * nobj) -{ -} - - -void GLAPIENTRY -gluEndCurve(GLUnurbsObj * nobj) -{ -} - - -void GLAPIENTRY -gluNurbsCurve(GLUnurbsObj * nobj, GLint nknots, GLfloat * knot, - GLint stride, GLfloat * ctlarray, GLint order, GLenum type) -{ -} - - -void GLAPIENTRY -gluBeginSurface(GLUnurbsObj * nobj) -{ -} - - -void GLAPIENTRY -gluEndSurface(GLUnurbsObj * nobj) -{ -} - - -void GLAPIENTRY -gluNurbsSurface(GLUnurbsObj * nobj, - GLint sknot_count, GLfloat * sknot, - GLint tknot_count, GLfloat * tknot, - GLint s_stride, GLint t_stride, - GLfloat * ctrlarray, GLint sorder, GLint torder, GLenum type) -{ -} - - -void GLAPIENTRY -gluNurbsCallback(GLUnurbsObj * nobj, GLenum which, void (GLCALLBACK * fn) ()) -{ -} - -void GLAPIENTRY -gluBeginTrim(GLUnurbsObj * nobj) -{ -} - -void GLAPIENTRY -gluPwlCurve(GLUnurbsObj * nobj, GLint count, GLfloat * array, GLint stride, - GLenum type) -{ -} - -void GLAPIENTRY -gluEndTrim(GLUnurbsObj * nobj) -{ -} diff --git a/src/glu/mini/nurbs.h b/src/glu/mini/nurbs.h deleted file mode 100644 index 3642e213a8..0000000000 --- a/src/glu/mini/nurbs.h +++ /dev/null @@ -1,252 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifndef NURBS_H -#define NURBS_H - - -#define EPSILON 1e-06 /* epsilon for double precision compares */ - -typedef enum -{ - GLU_NURBS_CURVE, GLU_NURBS_SURFACE, GLU_NURBS_TRIM, GLU_NURBS_NO_TRIM, - GLU_NURBS_TRIM_DONE, GLU_NURBS_NONE -} -GLU_nurbs_enum; - -typedef enum -{ - GLU_TRIM_NURBS, GLU_TRIM_PWL -} -GLU_trim_enum; - -typedef struct -{ - GLint sknot_count; - GLfloat *sknot; - GLint tknot_count; - GLfloat *tknot; - GLint s_stride; - GLint t_stride; - GLfloat *ctrlarray; - GLint sorder; - GLint torder; - GLint dim; - GLenum type; -} -surface_attribs; - -typedef struct -{ - surface_attribs geom; - surface_attribs color; - surface_attribs texture; - surface_attribs normal; -} -nurbs_surface; - -typedef struct -{ - GLint knot_count; - GLfloat *knot; - GLint stride; - GLfloat *ctrlarray; - GLint order; - GLint dim; - GLenum type; -} -curve_attribs; - -typedef struct -{ - GLint pt_count; - GLfloat *ctrlarray; - GLint stride; - GLint dim; - GLenum type; -} -pwl_curve_attribs; - -typedef struct -{ - curve_attribs geom; - curve_attribs color; - curve_attribs texture; - curve_attribs normal; -} -nurbs_curve; - -typedef struct trim_list_str -{ - GLU_trim_enum trim_type; - union - { - pwl_curve_attribs pwl_curve; - curve_attribs nurbs_curve; - } - curve; - struct trim_list_str *next; -} -trim_list; - -typedef struct seg_trim_str -{ - GLfloat *points; - GLint pt_cnt, seg_array_len; - struct seg_trim_str *next; -} -trim_segments; - -typedef struct nurbs_trim_str -{ - trim_list *trim_loop; - trim_segments *segments; - struct nurbs_trim_str *next; -} -nurbs_trim; - -typedef struct -{ - GLfloat model[16], proj[16], viewport[4]; -} -culling_and_sampling_str; - -struct GLUnurbs -{ - GLboolean culling; - GLenum error; - void (GLCALLBACK * error_callback) (GLenum err); - GLenum display_mode; - GLU_nurbs_enum nurbs_type; - GLboolean auto_load_matrix; - culling_and_sampling_str sampling_matrices; - GLenum sampling_method; - GLfloat sampling_tolerance; - GLfloat parametric_tolerance; - GLint u_step, v_step; - nurbs_surface surface; - nurbs_curve curve; - nurbs_trim *trim; -}; - -typedef struct -{ - GLfloat *knot; - GLint nknots; - GLfloat *unified_knot; - GLint unified_nknots; - GLint order; - GLint t_min, t_max; - GLint delta_nknots; - GLboolean open_at_begin, open_at_end; - GLfloat *new_knot; - GLfloat *alpha; -} -knot_str_type; - -typedef struct -{ - GLfloat *geom_ctrl; - GLint geom_s_stride, geom_t_stride; - GLfloat **geom_offsets; - GLint geom_s_pt_cnt, geom_t_pt_cnt; - GLfloat *color_ctrl; - GLint color_s_stride, color_t_stride; - GLfloat **color_offsets; - GLint color_s_pt_cnt, color_t_pt_cnt; - GLfloat *normal_ctrl; - GLint normal_s_stride, normal_t_stride; - GLfloat **normal_offsets; - GLint normal_s_pt_cnt, normal_t_pt_cnt; - GLfloat *texture_ctrl; - GLint texture_s_stride, texture_t_stride; - GLfloat **texture_offsets; - GLint texture_s_pt_cnt, texture_t_pt_cnt; - GLint s_bezier_cnt, t_bezier_cnt; -} -new_ctrl_type; - -extern void call_user_error(GLUnurbsObj * nobj, GLenum error); - -extern GLenum test_knot(GLint nknots, GLfloat * knot, GLint order); - -extern GLenum explode_knot(knot_str_type * the_knot); - -extern GLenum calc_alphas(knot_str_type * the_knot); - -extern GLenum calc_new_ctrl_pts(GLfloat * ctrl, GLint stride, - knot_str_type * the_knot, GLint dim, - GLfloat ** new_ctrl, GLint * ncontrol); - -extern GLenum glu_do_sampling_crv(GLUnurbsObj * nobj, GLfloat * new_ctrl, - GLint n_ctrl, GLint order, GLint dim, - GLint ** factors); - -extern GLenum glu_do_sampling_3D(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - int **sfactors, GLint ** tfactors); - -extern GLenum glu_do_sampling_uv(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - int **sfactors, GLint ** tfactors); - -extern GLenum glu_do_sampling_param_3D(GLUnurbsObj * nobj, - new_ctrl_type * new_ctrl, - int **sfactors, GLint ** tfactors); - -extern GLboolean fine_culling_test_2D(GLUnurbsObj * nobj, GLfloat * ctrl, - GLint n_ctrl, GLint stride, GLint dim); - -extern GLboolean fine_culling_test_3D(GLUnurbsObj * nobj, GLfloat * ctrl, - GLint s_n_ctrl, GLint t_n_ctrl, - GLint s_stride, GLint t_stride, - GLint dim); - -extern void do_nurbs_curve(GLUnurbsObj * nobj); - -extern void do_nurbs_surface(GLUnurbsObj * nobj); - -extern GLenum patch_trimming(GLUnurbsObj * nobj, new_ctrl_type * new_ctrl, - GLint * sfactors, GLint * tfactors); - -extern void collect_unified_knot(knot_str_type * dest, knot_str_type * src, - GLfloat maximal_min_knot, - GLfloat minimal_max_knot); - -extern GLenum select_knot_working_range(GLUnurbsObj * nobj, - knot_str_type * geom_knot, - knot_str_type * color_knot, - knot_str_type * normal_knot, - knot_str_type * texture_knot); - -extern void free_unified_knots(knot_str_type * geom_knot, - knot_str_type * color_knot, - knot_str_type * normal_knot, - knot_str_type * texture_knot); - - - -#endif diff --git a/src/glu/mini/nurbscrv.c b/src/glu/mini/nurbscrv.c deleted file mode 100644 index e80468fdb0..0000000000 --- a/src/glu/mini/nurbscrv.c +++ /dev/null @@ -1,132 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * NURBS implementation written by Bogdan Sikorski (bogdan@cira.it) - * See README2 for more info. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "gluP.h" -#include "nurbs.h" -#endif - - - -/* main NURBS curve procedure */ -void -do_nurbs_curve(GLUnurbsObj * nobj) -{ - GLint geom_order, color_order = 0, normal_order = 0, texture_order = 0; - GLenum geom_type; - GLint n_ctrl; - GLfloat *new_geom_ctrl, *new_color_ctrl, *new_normal_ctrl, - *new_texture_ctrl; - GLfloat *geom_ctrl = 0, *color_ctrl = 0, *normal_ctrl = 0, *texture_ctrl = 0; - GLint *factors; - GLint i, j; - GLint geom_dim, color_dim = 0, normal_dim = 0, texture_dim = 0; - - /* test the user supplied data */ - if (test_nurbs_curves(nobj) != GLU_NO_ERROR) - return; - - if (convert_curves(nobj, &new_geom_ctrl, &n_ctrl, &new_color_ctrl, - &new_normal_ctrl, &new_texture_ctrl) != GLU_NO_ERROR) - return; - - geom_order = nobj->curve.geom.order; - geom_type = nobj->curve.geom.type; - geom_dim = nobj->curve.geom.dim; - - if (glu_do_sampling_crv(nobj, new_geom_ctrl, n_ctrl, geom_order, geom_dim, - &factors) != GLU_NO_ERROR) { - free(new_geom_ctrl); - if (new_color_ctrl) - free(new_color_ctrl); - if (new_normal_ctrl) - free(new_normal_ctrl); - if (new_texture_ctrl) - free(new_texture_ctrl); - return; - } - glEnable(geom_type); - if (new_color_ctrl) { - glEnable(nobj->curve.color.type); - color_dim = nobj->curve.color.dim; - color_ctrl = new_color_ctrl; - color_order = nobj->curve.color.order; - } - if (new_normal_ctrl) { - glEnable(nobj->curve.normal.type); - normal_dim = nobj->curve.normal.dim; - normal_ctrl = new_normal_ctrl; - normal_order = nobj->curve.normal.order; - } - if (new_texture_ctrl) { - glEnable(nobj->curve.texture.type); - texture_dim = nobj->curve.texture.dim; - texture_ctrl = new_texture_ctrl; - texture_order = nobj->curve.texture.order; - } - for (i = 0, j = 0, geom_ctrl = new_geom_ctrl; - i < n_ctrl; i += geom_order, j++, geom_ctrl += geom_order * geom_dim) { - if (fine_culling_test_2D - (nobj, geom_ctrl, geom_order, geom_dim, geom_dim)) { - color_ctrl += color_order * color_dim; - normal_ctrl += normal_order * normal_dim; - texture_ctrl += texture_order * texture_dim; - continue; - } - glMap1f(geom_type, 0.0, 1.0, geom_dim, geom_order, geom_ctrl); - if (new_color_ctrl) { - glMap1f(nobj->curve.color.type, 0.0, 1.0, color_dim, - color_order, color_ctrl); - color_ctrl += color_order * color_dim; - } - if (new_normal_ctrl) { - glMap1f(nobj->curve.normal.type, 0.0, 1.0, normal_dim, - normal_order, normal_ctrl); - normal_ctrl += normal_order * normal_dim; - } - if (new_texture_ctrl) { - glMap1f(nobj->curve.texture.type, 0.0, 1.0, texture_dim, - texture_order, texture_ctrl); - texture_ctrl += texture_order * texture_dim; - } - glMapGrid1f(factors[j], 0.0, 1.0); - glEvalMesh1(GL_LINE, 0, factors[j]); - } - free(new_geom_ctrl); - free(factors); - if (new_color_ctrl) - free(new_color_ctrl); - if (new_normal_ctrl) - free(new_normal_ctrl); - if (new_texture_ctrl) - free(new_texture_ctrl); -} diff --git a/src/glu/mini/polytest.c b/src/glu/mini/polytest.c deleted file mode 100644 index 1ff966f61c..0000000000 --- a/src/glu/mini/polytest.c +++ /dev/null @@ -1,937 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "gluP.h" -#include "tess.h" -#endif - - - -static GLenum store_polygon_as_contour(GLUtriangulatorObj *); -static void free_current_polygon(tess_polygon *); -static void prepare_projection_info(GLUtriangulatorObj *); -static GLdouble twice_the_polygon_area(tess_vertex *, tess_vertex *); -static GLenum verify_edge_vertex_intersections(GLUtriangulatorObj *); -void tess_find_contour_hierarchies(GLUtriangulatorObj *); -static GLenum test_for_overlapping_contours(GLUtriangulatorObj *); -static GLenum contours_overlap(tess_contour *, tess_polygon *); -static GLenum is_contour_contained_in(tess_contour *, tess_contour *); -static void add_new_exterior(GLUtriangulatorObj *, tess_contour *); -static void add_new_interior(GLUtriangulatorObj *, tess_contour *, - tess_contour *); -static void add_interior_with_hierarchy_check(GLUtriangulatorObj *, - tess_contour *, tess_contour *); -static void reverse_hierarchy_and_add_exterior(GLUtriangulatorObj *, - tess_contour *, - tess_contour *); -static GLboolean point_in_polygon(tess_contour *, GLdouble, GLdouble); -static void shift_interior_to_exterior(GLUtriangulatorObj *, tess_contour *); -static void add_exterior_with_check(GLUtriangulatorObj *, tess_contour *, - tess_contour *); -static GLenum cut_out_hole(GLUtriangulatorObj *, tess_contour *, - tess_contour *); -static GLenum merge_hole_with_contour(GLUtriangulatorObj *, - tess_contour *, tess_contour *, - tess_vertex *, tess_vertex *); - -static GLenum -find_normal(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *va, *vb, *vc; - GLdouble A, B, C; - GLdouble A0, A1, A2, B0, B1, B2; - - va = polygon->vertices; - vb = va->next; - A0 = vb->location[0] - va->location[0]; - A1 = vb->location[1] - va->location[1]; - A2 = vb->location[2] - va->location[2]; - for (vc = vb->next; vc != va; vc = vc->next) { - B0 = vc->location[0] - va->location[0]; - B1 = vc->location[1] - va->location[1]; - B2 = vc->location[2] - va->location[2]; - A = A1 * B2 - A2 * B1; - B = A2 * B0 - A0 * B2; - C = A0 * B1 - A1 * B0; - if (fabs(A) > EPSILON || fabs(B) > EPSILON || fabs(C) > EPSILON) { - polygon->A = A; - polygon->B = B; - polygon->C = C; - polygon->D = - -A * va->location[0] - B * va->location[1] - C * va->location[2]; - return GLU_NO_ERROR; - } - } - tess_call_user_error(tobj, GLU_TESS_ERROR7); - return GLU_ERROR; -} - -void -tess_test_polygon(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - - /* any vertices defined? */ - if (polygon->vertex_cnt < 3) { - free_current_polygon(polygon); - return; - } - /* wrap pointers */ - polygon->last_vertex->next = polygon->vertices; - polygon->vertices->previous = polygon->last_vertex; - /* determine the normal */ - if (find_normal(tobj) == GLU_ERROR) - return; - /* compare the normals of previously defined contours and this one */ - /* first contour define ? */ - if (tobj->contours == NULL) { - tobj->A = polygon->A; - tobj->B = polygon->B; - tobj->C = polygon->C; - tobj->D = polygon->D; - /* determine the best projection to use */ - if (fabs(polygon->A) > fabs(polygon->B)) - if (fabs(polygon->A) > fabs(polygon->C)) - tobj->projection = OYZ; - else - tobj->projection = OXY; - else if (fabs(polygon->B) > fabs(polygon->C)) - tobj->projection = OXZ; - else - tobj->projection = OXY; - } - else { - GLdouble a[3], b[3]; - tess_vertex *vertex = polygon->vertices; - - a[0] = tobj->A; - a[1] = tobj->B; - a[2] = tobj->C; - b[0] = polygon->A; - b[1] = polygon->B; - b[2] = polygon->C; - - /* compare the normals */ - if (fabs(a[1] * b[2] - a[2] * b[1]) > EPSILON || - fabs(a[2] * b[0] - a[0] * b[2]) > EPSILON || - fabs(a[0] * b[1] - a[1] * b[0]) > EPSILON) { - /* not coplanar */ - tess_call_user_error(tobj, GLU_TESS_ERROR9); - return; - } - /* the normals are parallel - test for plane equation */ - if (fabs(a[0] * vertex->location[0] + a[1] * vertex->location[1] + - a[2] * vertex->location[2] + tobj->D) > EPSILON) { - /* not the same plane */ - tess_call_user_error(tobj, GLU_TESS_ERROR9); - return; - } - } - prepare_projection_info(tobj); - if (verify_edge_vertex_intersections(tobj) == GLU_ERROR) - return; - if (test_for_overlapping_contours(tobj) == GLU_ERROR) - return; - if (store_polygon_as_contour(tobj) == GLU_ERROR) - return; -} - -static GLenum -test_for_overlapping_contours(GLUtriangulatorObj * tobj) -{ - tess_contour *contour; - tess_polygon *polygon; - - polygon = tobj->current_polygon; - for (contour = tobj->contours; contour != NULL; contour = contour->next) - if (contours_overlap(contour, polygon) != GLU_NO_ERROR) { - tess_call_user_error(tobj, GLU_TESS_ERROR5); - return GLU_ERROR; - } - return GLU_NO_ERROR; -} - -static GLenum -store_polygon_as_contour(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_contour *contour = tobj->contours; - - /* the first contour defined */ - if (contour == NULL) { - if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - free_current_polygon(polygon); - return GLU_ERROR; - } - tobj->contours = tobj->last_contour = contour; - contour->next = contour->previous = NULL; - } - else { - if ((contour = (tess_contour *) malloc(sizeof(tess_contour))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - free_current_polygon(polygon); - return GLU_ERROR; - } - contour->previous = tobj->last_contour; - tobj->last_contour->next = contour; - tobj->last_contour = contour; - contour->next = NULL; - } - /* mark all vertices in new contour as not special */ - /* and all are boundary edges */ - { - tess_vertex *vertex; - GLuint vertex_cnt, i; - - for (vertex = polygon->vertices, i = 0, vertex_cnt = - polygon->vertex_cnt; i < vertex_cnt; vertex = vertex->next, i++) { - vertex->shadow_vertex = NULL; - vertex->edge_flag = GL_TRUE; - } - } - contour->vertex_cnt = polygon->vertex_cnt; - contour->area = polygon->area; - contour->orientation = polygon->orientation; - contour->type = GLU_UNKNOWN; - contour->vertices = polygon->vertices; - contour->last_vertex = polygon->last_vertex; - polygon->vertices = polygon->last_vertex = NULL; - polygon->vertex_cnt = 0; - ++(tobj->contour_cnt); - return GLU_NO_ERROR; -} - -static void -free_current_polygon(tess_polygon * polygon) -{ - tess_vertex *vertex, *vertex_tmp; - GLuint i; - - /* free current_polygon structures */ - for (vertex = polygon->vertices, i = 0; i < polygon->vertex_cnt; i++) { - vertex_tmp = vertex->next; - free(vertex); - vertex = vertex_tmp; - } - polygon->vertices = polygon->last_vertex = NULL; - polygon->vertex_cnt = 0; -} - -static void -prepare_projection_info(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *vertex, *last_vertex_ptr; - GLdouble area; - - last_vertex_ptr = polygon->last_vertex; - switch (tobj->projection) { - case OXY: - for (vertex = polygon->vertices; vertex != last_vertex_ptr; - vertex = vertex->next) { - vertex->x = vertex->location[0]; - vertex->y = vertex->location[1]; - } - last_vertex_ptr->x = last_vertex_ptr->location[0]; - last_vertex_ptr->y = last_vertex_ptr->location[1]; - break; - case OXZ: - for (vertex = polygon->vertices; vertex != last_vertex_ptr; - vertex = vertex->next) { - vertex->x = vertex->location[0]; - vertex->y = vertex->location[2]; - } - last_vertex_ptr->x = last_vertex_ptr->location[0]; - last_vertex_ptr->y = last_vertex_ptr->location[2]; - break; - case OYZ: - for (vertex = polygon->vertices; vertex != last_vertex_ptr; - vertex = vertex->next) { - vertex->x = vertex->location[1]; - vertex->y = vertex->location[2]; - } - last_vertex_ptr->x = last_vertex_ptr->location[1]; - last_vertex_ptr->y = last_vertex_ptr->location[2]; - break; - } - area = twice_the_polygon_area(polygon->vertices, polygon->last_vertex); - if (area >= 0.0) { - polygon->orientation = GLU_CCW; - polygon->area = area; - } - else { - polygon->orientation = GLU_CW; - polygon->area = -area; - } -} - -static GLdouble -twice_the_polygon_area(tess_vertex * vertex, tess_vertex * last_vertex) -{ - tess_vertex *next; - GLdouble area, x, y; - - area = 0.0; - x = vertex->x; - y = vertex->y; - vertex = vertex->next; - for (; vertex != last_vertex; vertex = vertex->next) { - next = vertex->next; - area += - (vertex->x - x) * (next->y - y) - (vertex->y - y) * (next->x - x); - } - return area; -} - -/* test if edges ab and cd intersect */ -/* if not return GLU_NO_ERROR, else if cross return GLU_TESS_ERROR8, */ -/* else if adjacent return GLU_TESS_ERROR4 */ -static GLenum -edge_edge_intersect(tess_vertex * a, - tess_vertex * b, tess_vertex * c, tess_vertex * d) -{ - GLdouble denom, r, s; - GLdouble xba, ydc, yba, xdc, yac, xac; - - xba = b->x - a->x; - yba = b->y - a->y; - xdc = d->x - c->x; - ydc = d->y - c->y; - xac = a->x - c->x; - yac = a->y - c->y; - denom = xba * ydc - yba * xdc; - r = yac * xdc - xac * ydc; - /* parallel? */ - if (fabs(denom) < EPSILON) { - if (fabs(r) < EPSILON) { - /* colinear */ - if (fabs(xba) < EPSILON) { - /* compare the Y coordinate */ - if (yba > 0.0) { - if ( - (fabs(a->y - c->y) < EPSILON - && fabs(c->y - b->y) < EPSILON) - || (fabs(a->y - d->y) < EPSILON - && fabs(d->y - b->y) < - EPSILON)) return GLU_TESS_ERROR4; - - } - else { - if ( - (fabs(b->y - c->y) < EPSILON - && fabs(c->y - a->y) < EPSILON) - || (fabs(b->y - d->y) < EPSILON - && fabs(d->y - a->y) < - EPSILON)) return GLU_TESS_ERROR4; - } - } - else { - /* compare the X coordinate */ - if (xba > 0.0) { - if ( - (fabs(a->x - c->x) < EPSILON - && fabs(c->x - b->x) < EPSILON) - || (fabs(a->x - d->x) < EPSILON - && fabs(d->x - b->x) < - EPSILON)) return GLU_TESS_ERROR4; - } - else { - if ( - (fabs(b->x - c->x) < EPSILON - && fabs(c->x - a->x) < EPSILON) - || (fabs(b->x - d->x) < EPSILON - && fabs(d->x - a->x) < - EPSILON)) return GLU_TESS_ERROR4; - } - } - } - return GLU_NO_ERROR; - } - r /= denom; - s = (yac * xba - xac * yba) / denom; - /* test if one vertex lies on other edge */ - if (((fabs(r) < EPSILON || (r < 1.0 + EPSILON && r > 1.0 - EPSILON)) && - s > -EPSILON && s < 1.0 + EPSILON) || - ((fabs(s) < EPSILON || (s < 1.0 + EPSILON && s > 1.0 - EPSILON)) && - r > -EPSILON && r < 1.0 + EPSILON)) { - return GLU_TESS_ERROR4; - } - /* test for crossing */ - if (r > -EPSILON && r < 1.0 + EPSILON && s > -EPSILON && s < 1.0 + EPSILON) { - return GLU_TESS_ERROR8; - } - return GLU_NO_ERROR; -} - -static GLenum -verify_edge_vertex_intersections(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *vertex1, *last_vertex, *vertex2; - GLenum test; - - last_vertex = polygon->last_vertex; - vertex1 = last_vertex; - for (vertex2 = vertex1->next->next; - vertex2->next != last_vertex; vertex2 = vertex2->next) { - test = edge_edge_intersect(vertex1, vertex1->next, vertex2, - vertex2->next); - if (test != GLU_NO_ERROR) { - tess_call_user_error(tobj, test); - return GLU_ERROR; - } - } - for (vertex1 = polygon->vertices; - vertex1->next->next != last_vertex; vertex1 = vertex1->next) { - for (vertex2 = vertex1->next->next; - vertex2 != last_vertex; vertex2 = vertex2->next) { - test = edge_edge_intersect(vertex1, vertex1->next, vertex2, - vertex2->next); - if (test != GLU_NO_ERROR) { - tess_call_user_error(tobj, test); - return GLU_ERROR; - } - } - } - return GLU_NO_ERROR; -} - -static int -#ifdef WIN32 - __cdecl -#endif -area_compare(const void *a, const void *b) -{ - GLdouble area1, area2; - - area1 = (*((tess_contour **) a))->area; - area2 = (*((tess_contour **) b))->area; - if (area1 < area2) - return 1; - if (area1 > area2) - return -1; - return 0; -} - -void -tess_find_contour_hierarchies(GLUtriangulatorObj * tobj) -{ - tess_contour **contours; /* dinamic array of pointers */ - tess_contour *tmp_contour_ptr = tobj->contours; - GLuint cnt, i; - GLenum result; - GLboolean hierarchy_changed; - - /* any contours? */ - if (tobj->contour_cnt < 2) { - tobj->contours->type = GLU_EXTERIOR; - return; - } - if ((contours = (tess_contour **) - malloc(sizeof(tess_contour *) * (tobj->contour_cnt))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - for (tmp_contour_ptr = tobj->contours, cnt = 0; - tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) - contours[cnt++] = tmp_contour_ptr; - /* now sort the contours in decreasing area size order */ - qsort((void *) contours, (size_t) cnt, (size_t) sizeof(tess_contour *), - area_compare); - /* we leave just the first contour - remove others from list */ - tobj->contours = contours[0]; - tobj->contours->next = tobj->contours->previous = NULL; - tobj->last_contour = tobj->contours; - tobj->contour_cnt = 1; - /* first contour is the one with greatest area */ - /* must be EXTERIOR */ - tobj->contours->type = GLU_EXTERIOR; - tmp_contour_ptr = tobj->contours; - /* now we play! */ - for (i = 1; i < cnt; i++) { - hierarchy_changed = GL_FALSE; - for (tmp_contour_ptr = tobj->contours; - tmp_contour_ptr != NULL; tmp_contour_ptr = tmp_contour_ptr->next) { - if (tmp_contour_ptr->type == GLU_EXTERIOR) { - /* check if contour completely contained in EXTERIOR */ - result = is_contour_contained_in(tmp_contour_ptr, contours[i]); - switch (result) { - case GLU_INTERIOR: - /* now we have to check if contour is inside interiors */ - /* or not */ - /* any interiors? */ - if (tmp_contour_ptr->next != NULL && - tmp_contour_ptr->next->type == GLU_INTERIOR) { - /* for all interior, check if inside any of them */ - /* if not inside any of interiors, its another */ - /* interior */ - /* or it may contain some interiors, then change */ - /* the contained interiors to exterior ones */ - add_interior_with_hierarchy_check(tobj, - tmp_contour_ptr, - contours[i]); - } - else { - /* not in interior, add as new interior contour */ - add_new_interior(tobj, tmp_contour_ptr, contours[i]); - } - hierarchy_changed = GL_TRUE; - break; - case GLU_EXTERIOR: - /* ooops, the marked as EXTERIOR (contours[i]) is */ - /* actually an interior of tmp_contour_ptr */ - /* reverse the local hierarchy */ - reverse_hierarchy_and_add_exterior(tobj, tmp_contour_ptr, - contours[i]); - hierarchy_changed = GL_TRUE; - break; - case GLU_NO_ERROR: - break; - default: - abort(); - } - } - if (hierarchy_changed) - break; /* break from for loop */ - } - if (hierarchy_changed == GL_FALSE) { - /* disjoint with all contours, add to contour list */ - add_new_exterior(tobj, contours[i]); - } - } - free(contours); -} - -/* returns GLU_INTERIOR if inner is completey enclosed within outer */ -/* returns GLU_EXTERIOR if outer is completely enclosed within inner */ -/* returns GLU_NO_ERROR if contours are disjoint */ -static GLenum -is_contour_contained_in(tess_contour * outer, tess_contour * inner) -{ - GLenum relation_flag; - - /* set relation_flag to relation of containment of first inner vertex */ - /* regarding outer contour */ - if (point_in_polygon(outer, inner->vertices->x, inner->vertices->y)) - relation_flag = GLU_INTERIOR; - else - relation_flag = GLU_EXTERIOR; - if (relation_flag == GLU_INTERIOR) - return GLU_INTERIOR; - if (point_in_polygon(inner, outer->vertices->x, outer->vertices->y)) - return GLU_EXTERIOR; - return GLU_NO_ERROR; -} - -static GLboolean -point_in_polygon(tess_contour * contour, GLdouble x, GLdouble y) -{ - tess_vertex *v1, *v2; - GLuint i, vertex_cnt; - GLdouble xp1, yp1, xp2, yp2; - GLboolean tst; - - tst = GL_FALSE; - v1 = contour->vertices; - v2 = contour->vertices->previous; - for (i = 0, vertex_cnt = contour->vertex_cnt; i < vertex_cnt; i++) { - xp1 = v1->x; - yp1 = v1->y; - xp2 = v2->x; - yp2 = v2->y; - if ((((yp1 <= y) && (y < yp2)) || ((yp2 <= y) && (y < yp1))) && - (x < (xp2 - xp1) * (y - yp1) / (yp2 - yp1) + xp1)) - tst = (tst == GL_FALSE ? GL_TRUE : GL_FALSE); - v2 = v1; - v1 = v1->next; - } - return tst; -} - -static GLenum -contours_overlap(tess_contour * contour, tess_polygon * polygon) -{ - tess_vertex *vertex1, *vertex2; - GLuint vertex1_cnt, vertex2_cnt, i, j; - GLenum test; - - vertex1 = contour->vertices; - vertex2 = polygon->vertices; - vertex1_cnt = contour->vertex_cnt; - vertex2_cnt = polygon->vertex_cnt; - for (i = 0; i < vertex1_cnt; vertex1 = vertex1->next, i++) { - for (j = 0; j < vertex2_cnt; vertex2 = vertex2->next, j++) - if ((test = edge_edge_intersect(vertex1, vertex1->next, vertex2, - vertex2->next)) != GLU_NO_ERROR) - return test; - } - return GLU_NO_ERROR; -} - -static void -add_new_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - contour->type = GLU_EXTERIOR; - contour->next = NULL; - contour->previous = tobj->last_contour; - tobj->last_contour->next = contour; - tobj->last_contour = contour; -} - -static void -add_new_interior(GLUtriangulatorObj * tobj, - tess_contour * outer, tess_contour * contour) -{ - contour->type = GLU_INTERIOR; - contour->next = outer->next; - contour->previous = outer; - if (outer->next != NULL) - outer->next->previous = contour; - outer->next = contour; - if (tobj->last_contour == outer) - tobj->last_contour = contour; -} - -static void -add_interior_with_hierarchy_check(GLUtriangulatorObj * tobj, - tess_contour * outer, - tess_contour * contour) -{ - tess_contour *ptr; - - /* for all interiors of outer check if they are interior of contour */ - /* if so, change that interior to exterior and move it of of the */ - /* interior sequence */ - if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { - GLenum test; - - for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; - ptr = ptr->next) { - test = is_contour_contained_in(ptr, contour); - switch (test) { - case GLU_INTERIOR: - /* contour is contained in one of the interiors */ - /* check if possibly contained in other exteriors */ - /* move ptr to first EXTERIOR */ - for (; ptr != NULL && ptr->type == GLU_INTERIOR; ptr = ptr->next); - if (ptr == NULL) - /* another exterior */ - add_new_exterior(tobj, contour); - else - add_exterior_with_check(tobj, ptr, contour); - return; - case GLU_EXTERIOR: - /* one of the interiors is contained in the contour */ - /* change it to EXTERIOR, and shift it away from the */ - /* interior sequence */ - shift_interior_to_exterior(tobj, ptr); - break; - case GLU_NO_ERROR: - /* disjoint */ - break; - default: - abort(); - } - } - } - /* add contour to the interior sequence */ - add_new_interior(tobj, outer, contour); -} - -static void -reverse_hierarchy_and_add_exterior(GLUtriangulatorObj * tobj, - tess_contour * outer, - tess_contour * contour) -{ - tess_contour *ptr; - - /* reverse INTERIORS to EXTERIORS */ - /* any INTERIORS? */ - if (outer->next != NULL && outer->next->type == GLU_INTERIOR) - for (ptr = outer->next; ptr != NULL && ptr->type == GLU_INTERIOR; - ptr = ptr->next) ptr->type = GLU_EXTERIOR; - /* the outer now becomes inner */ - outer->type = GLU_INTERIOR; - /* contour is the EXTERIOR */ - contour->next = outer; - if (tobj->contours == outer) { - /* first contour beeing reversed */ - contour->previous = NULL; - tobj->contours = contour; - } - else { - outer->previous->next = contour; - contour->previous = outer->previous; - } - outer->previous = contour; -} - -static void -shift_interior_to_exterior(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - contour->previous->next = contour->next; - if (contour->next != NULL) - contour->next->previous = contour->previous; - else - tobj->last_contour = contour->previous; -} - -static void -add_exterior_with_check(GLUtriangulatorObj * tobj, - tess_contour * outer, tess_contour * contour) -{ - GLenum test; - - /* this contour might be interior to further exteriors - check */ - /* if not, just add as a new exterior */ - for (; outer != NULL && outer->type == GLU_EXTERIOR; outer = outer->next) { - test = is_contour_contained_in(outer, contour); - switch (test) { - case GLU_INTERIOR: - /* now we have to check if contour is inside interiors */ - /* or not */ - /* any interiors? */ - if (outer->next != NULL && outer->next->type == GLU_INTERIOR) { - /* for all interior, check if inside any of them */ - /* if not inside any of interiors, its another */ - /* interior */ - /* or it may contain some interiors, then change */ - /* the contained interiors to exterior ones */ - add_interior_with_hierarchy_check(tobj, outer, contour); - } - else { - /* not in interior, add as new interior contour */ - add_new_interior(tobj, outer, contour); - } - return; - case GLU_NO_ERROR: - /* disjoint */ - break; - default: - abort(); - } - } - /* add contour to the exterior sequence */ - add_new_exterior(tobj, contour); -} - -void -tess_handle_holes(GLUtriangulatorObj * tobj) -{ - tess_contour *contour, *hole; - GLenum exterior_orientation; - - /* verify hole orientation */ - for (contour = tobj->contours; contour != NULL;) { - exterior_orientation = contour->orientation; - for (contour = contour->next; - contour != NULL && contour->type == GLU_INTERIOR; - contour = contour->next) { - if (contour->orientation == exterior_orientation) { - tess_call_user_error(tobj, GLU_TESS_ERROR5); - return; - } - } - } - /* now cut-out holes */ - for (contour = tobj->contours; contour != NULL;) { - hole = contour->next; - while (hole != NULL && hole->type == GLU_INTERIOR) { - if (cut_out_hole(tobj, contour, hole) == GLU_ERROR) - return; - hole = contour->next; - } - contour = contour->next; - } -} - -static GLenum -cut_out_hole(GLUtriangulatorObj * tobj, - tess_contour * contour, tess_contour * hole) -{ - tess_contour *tmp_hole; - tess_vertex *v1, *v2, *tmp_vertex; - GLuint vertex1_cnt, vertex2_cnt, tmp_vertex_cnt; - GLuint i, j, k; - GLenum test = 0; - - /* find an edge connecting contour and hole not intersecting any other */ - /* edge belonging to either the contour or any of the other holes */ - for (v1 = contour->vertices, vertex1_cnt = contour->vertex_cnt, i = 0; - i < vertex1_cnt; i++, v1 = v1->next) { - for (v2 = hole->vertices, vertex2_cnt = hole->vertex_cnt, j = 0; - j < vertex2_cnt; j++, v2 = v2->next) { - /* does edge (v1,v2) intersect any edge of contour */ - for (tmp_vertex = contour->vertices, tmp_vertex_cnt = - contour->vertex_cnt, k = 0; k < tmp_vertex_cnt; - tmp_vertex = tmp_vertex->next, k++) { - /* skip edge tests for edges directly connected */ - if (v1 == tmp_vertex || v1 == tmp_vertex->next) - continue; - test = edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); - if (test != GLU_NO_ERROR) - break; - } - if (test == GLU_NO_ERROR) { - /* does edge (v1,v2) intersect any edge of hole */ - for (tmp_vertex = hole->vertices, - tmp_vertex_cnt = hole->vertex_cnt, k = 0; - k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { - /* skip edge tests for edges directly connected */ - if (v2 == tmp_vertex || v2 == tmp_vertex->next) - continue; - test = - edge_edge_intersect(v1, v2, tmp_vertex, tmp_vertex->next); - if (test != GLU_NO_ERROR) - break; - } - if (test == GLU_NO_ERROR) { - /* does edge (v1,v2) intersect any other hole? */ - for (tmp_hole = hole->next; - tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; - tmp_hole = tmp_hole->next) { - /* does edge (v1,v2) intersect any edge of hole */ - for (tmp_vertex = tmp_hole->vertices, - tmp_vertex_cnt = tmp_hole->vertex_cnt, k = 0; - k < tmp_vertex_cnt; tmp_vertex = tmp_vertex->next, k++) { - test = edge_edge_intersect(v1, v2, tmp_vertex, - tmp_vertex->next); - if (test != GLU_NO_ERROR) - break; - } - if (test != GLU_NO_ERROR) - break; - } - } - } - if (test == GLU_NO_ERROR) { - /* edge (v1,v2) is good for eliminating the hole */ - if (merge_hole_with_contour(tobj, contour, hole, v1, v2) - == GLU_NO_ERROR) - return GLU_NO_ERROR; - else - return GLU_ERROR; - } - } - } - /* other holes are blocking all possible connections of hole */ - /* with contour, we shift this hole as the last hole and retry */ - for (tmp_hole = hole; - tmp_hole != NULL && tmp_hole->type == GLU_INTERIOR; - tmp_hole = tmp_hole->next); - contour->next = hole->next; - hole->next->previous = contour; - if (tmp_hole == NULL) { - /* last EXTERIOR contour, shift hole as last contour */ - hole->next = NULL; - hole->previous = tobj->last_contour; - tobj->last_contour->next = hole; - tobj->last_contour = hole; - } - else { - tmp_hole->previous->next = hole; - hole->previous = tmp_hole->previous; - tmp_hole->previous = hole; - hole->next = tmp_hole; - } - hole = contour->next; - /* try once again - recurse */ - return cut_out_hole(tobj, contour, hole); -} - -static GLenum -merge_hole_with_contour(GLUtriangulatorObj * tobj, - tess_contour * contour, - tess_contour * hole, - tess_vertex * v1, tess_vertex * v2) -{ - tess_vertex *v1_new, *v2_new; - - /* make copies of v1 and v2, place them respectively after their originals */ - if ((v1_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - if ((v2_new = (tess_vertex *) malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return GLU_ERROR; - } - v1_new->edge_flag = GL_TRUE; - v1_new->data = v1->data; - v1_new->location[0] = v1->location[0]; - v1_new->location[1] = v1->location[1]; - v1_new->location[2] = v1->location[2]; - v1_new->x = v1->x; - v1_new->y = v1->y; - v1_new->shadow_vertex = v1; - v1->shadow_vertex = v1_new; - v1_new->next = v1->next; - v1_new->previous = v1; - v1->next->previous = v1_new; - v1->next = v1_new; - v2_new->edge_flag = GL_TRUE; - v2_new->data = v2->data; - v2_new->location[0] = v2->location[0]; - v2_new->location[1] = v2->location[1]; - v2_new->location[2] = v2->location[2]; - v2_new->x = v2->x; - v2_new->y = v2->y; - v2_new->shadow_vertex = v2; - v2->shadow_vertex = v2_new; - v2_new->next = v2->next; - v2_new->previous = v2; - v2->next->previous = v2_new; - v2->next = v2_new; - /* link together the two lists */ - v1->next = v2_new; - v2_new->previous = v1; - v2->next = v1_new; - v1_new->previous = v2; - /* update the vertex count of the contour */ - contour->vertex_cnt += hole->vertex_cnt + 2; - /* remove the INTERIOR contour */ - contour->next = hole->next; - if (hole->next != NULL) - hole->next->previous = contour; - free(hole); - /* update tobj structure */ - --(tobj->contour_cnt); - if (contour->last_vertex == v1) - contour->last_vertex = v1_new; - /* mark two vertices with edge_flag */ - v2->edge_flag = GL_FALSE; - v1->edge_flag = GL_FALSE; - return GLU_NO_ERROR; -} diff --git a/src/glu/mini/project.c b/src/glu/mini/project.c deleted file mode 100644 index 2e79cdf084..0000000000 --- a/src/glu/mini/project.c +++ /dev/null @@ -1,403 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include "gluP.h" -#endif - - -/* - * This code was contributed by Marc Buffat (buffat@mecaflu.ec-lyon.fr). - * Thanks Marc!!! - */ - - - -/* implementation de gluProject et gluUnproject */ -/* M. Buffat 17/2/95 */ - - - -/* - * Transform a point (column vector) by a 4x4 matrix. I.e. out = m * in - * Input: m - the 4x4 matrix - * in - the 4x1 vector - * Output: out - the resulting 4x1 vector. - */ -static void -transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]) -{ -#define M(row,col) m[col*4+row] - out[0] = - M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3]; - out[1] = - M(1, 0) * in[0] + M(1, 1) * in[1] + M(1, 2) * in[2] + M(1, 3) * in[3]; - out[2] = - M(2, 0) * in[0] + M(2, 1) * in[1] + M(2, 2) * in[2] + M(2, 3) * in[3]; - out[3] = - M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3]; -#undef M -} - - - - -/* - * Perform a 4x4 matrix multiplication (product = a x b). - * Input: a, b - matrices to multiply - * Output: product - product of a and b - */ -static void -matmul(GLdouble * product, const GLdouble * a, const GLdouble * b) -{ - /* This matmul was contributed by Thomas Malik */ - GLdouble temp[16]; - GLint i; - -#define A(row,col) a[(col<<2)+row] -#define B(row,col) b[(col<<2)+row] -#define T(row,col) temp[(col<<2)+row] - - /* i-te Zeile */ - for (i = 0; i < 4; i++) { - T(i, 0) = - A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, - 3) * - B(3, 0); - T(i, 1) = - A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, - 3) * - B(3, 1); - T(i, 2) = - A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, - 3) * - B(3, 2); - T(i, 3) = - A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, - 3) * - B(3, 3); - } - -#undef A -#undef B -#undef T - MEMCPY(product, temp, 16 * sizeof(GLdouble)); -} - - - -/* - * Compute inverse of 4x4 transformation matrix. - * Code contributed by Jacques Leroy jle@star.be - * Return GL_TRUE for success, GL_FALSE for failure (singular matrix) - */ -static GLboolean -invert_matrix(const GLdouble * m, GLdouble * out) -{ -/* NB. OpenGL Matrices are COLUMN major. */ -#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; } -#define MAT(m,r,c) (m)[(c)*4+(r)] - - GLdouble wtmp[4][8]; - GLdouble m0, m1, m2, m3, s; - GLdouble *r0, *r1, *r2, *r3; - - r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; - - r0[0] = MAT(m, 0, 0), r0[1] = MAT(m, 0, 1), - r0[2] = MAT(m, 0, 2), r0[3] = MAT(m, 0, 3), - r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, - r1[0] = MAT(m, 1, 0), r1[1] = MAT(m, 1, 1), - r1[2] = MAT(m, 1, 2), r1[3] = MAT(m, 1, 3), - r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, - r2[0] = MAT(m, 2, 0), r2[1] = MAT(m, 2, 1), - r2[2] = MAT(m, 2, 2), r2[3] = MAT(m, 2, 3), - r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, - r3[0] = MAT(m, 3, 0), r3[1] = MAT(m, 3, 1), - r3[2] = MAT(m, 3, 2), r3[3] = MAT(m, 3, 3), - r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; - - /* choose pivot - or die */ - if (fabs(r3[0]) > fabs(r2[0])) - SWAP_ROWS(r3, r2); - if (fabs(r2[0]) > fabs(r1[0])) - SWAP_ROWS(r2, r1); - if (fabs(r1[0]) > fabs(r0[0])) - SWAP_ROWS(r1, r0); - if (0.0 == r0[0]) - return GL_FALSE; - - /* eliminate first variable */ - m1 = r1[0] / r0[0]; - m2 = r2[0] / r0[0]; - m3 = r3[0] / r0[0]; - s = r0[1]; - r1[1] -= m1 * s; - r2[1] -= m2 * s; - r3[1] -= m3 * s; - s = r0[2]; - r1[2] -= m1 * s; - r2[2] -= m2 * s; - r3[2] -= m3 * s; - s = r0[3]; - r1[3] -= m1 * s; - r2[3] -= m2 * s; - r3[3] -= m3 * s; - s = r0[4]; - if (s != 0.0) { - r1[4] -= m1 * s; - r2[4] -= m2 * s; - r3[4] -= m3 * s; - } - s = r0[5]; - if (s != 0.0) { - r1[5] -= m1 * s; - r2[5] -= m2 * s; - r3[5] -= m3 * s; - } - s = r0[6]; - if (s != 0.0) { - r1[6] -= m1 * s; - r2[6] -= m2 * s; - r3[6] -= m3 * s; - } - s = r0[7]; - if (s != 0.0) { - r1[7] -= m1 * s; - r2[7] -= m2 * s; - r3[7] -= m3 * s; - } - - /* choose pivot - or die */ - if (fabs(r3[1]) > fabs(r2[1])) - SWAP_ROWS(r3, r2); - if (fabs(r2[1]) > fabs(r1[1])) - SWAP_ROWS(r2, r1); - if (0.0 == r1[1]) - return GL_FALSE; - - /* eliminate second variable */ - m2 = r2[1] / r1[1]; - m3 = r3[1] / r1[1]; - r2[2] -= m2 * r1[2]; - r3[2] -= m3 * r1[2]; - r2[3] -= m2 * r1[3]; - r3[3] -= m3 * r1[3]; - s = r1[4]; - if (0.0 != s) { - r2[4] -= m2 * s; - r3[4] -= m3 * s; - } - s = r1[5]; - if (0.0 != s) { - r2[5] -= m2 * s; - r3[5] -= m3 * s; - } - s = r1[6]; - if (0.0 != s) { - r2[6] -= m2 * s; - r3[6] -= m3 * s; - } - s = r1[7]; - if (0.0 != s) { - r2[7] -= m2 * s; - r3[7] -= m3 * s; - } - - /* choose pivot - or die */ - if (fabs(r3[2]) > fabs(r2[2])) - SWAP_ROWS(r3, r2); - if (0.0 == r2[2]) - return GL_FALSE; - - /* eliminate third variable */ - m3 = r3[2] / r2[2]; - r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], - r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7]; - - /* last check */ - if (0.0 == r3[3]) - return GL_FALSE; - - s = 1.0 / r3[3]; /* now back substitute row 3 */ - r3[4] *= s; - r3[5] *= s; - r3[6] *= s; - r3[7] *= s; - - m2 = r2[3]; /* now back substitute row 2 */ - s = 1.0 / r2[2]; - r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), - r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2); - m1 = r1[3]; - r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1, - r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1; - m0 = r0[3]; - r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, - r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; - - m1 = r1[2]; /* now back substitute row 1 */ - s = 1.0 / r1[1]; - r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), - r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1); - m0 = r0[2]; - r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, - r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; - - m0 = r0[1]; /* now back substitute row 0 */ - s = 1.0 / r0[0]; - r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), - r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); - - MAT(out, 0, 0) = r0[4]; - MAT(out, 0, 1) = r0[5], MAT(out, 0, 2) = r0[6]; - MAT(out, 0, 3) = r0[7], MAT(out, 1, 0) = r1[4]; - MAT(out, 1, 1) = r1[5], MAT(out, 1, 2) = r1[6]; - MAT(out, 1, 3) = r1[7], MAT(out, 2, 0) = r2[4]; - MAT(out, 2, 1) = r2[5], MAT(out, 2, 2) = r2[6]; - MAT(out, 2, 3) = r2[7], MAT(out, 3, 0) = r3[4]; - MAT(out, 3, 1) = r3[5], MAT(out, 3, 2) = r3[6]; - MAT(out, 3, 3) = r3[7]; - - return GL_TRUE; - -#undef MAT -#undef SWAP_ROWS -} - - - -/* projection du point (objx,objy,obz) sur l'ecran (winx,winy,winz) */ -GLint GLAPIENTRY -gluProject(GLdouble objx, GLdouble objy, GLdouble objz, - const GLdouble model[16], const GLdouble proj[16], - const GLint viewport[4], - GLdouble * winx, GLdouble * winy, GLdouble * winz) -{ - /* matrice de transformation */ - GLdouble in[4], out[4]; - - /* initilise la matrice et le vecteur a transformer */ - in[0] = objx; - in[1] = objy; - in[2] = objz; - in[3] = 1.0; - transform_point(out, model, in); - transform_point(in, proj, out); - - /* d'ou le resultat normalise entre -1 et 1 */ - if (in[3] == 0.0) - return GL_FALSE; - - in[0] /= in[3]; - in[1] /= in[3]; - in[2] /= in[3]; - - /* en coordonnees ecran */ - *winx = viewport[0] + (1 + in[0]) * viewport[2] / 2; - *winy = viewport[1] + (1 + in[1]) * viewport[3] / 2; - /* entre 0 et 1 suivant z */ - *winz = (1 + in[2]) / 2; - return GL_TRUE; -} - - - -/* transformation du point ecran (winx,winy,winz) en point objet */ -GLint GLAPIENTRY -gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, - const GLdouble model[16], const GLdouble proj[16], - const GLint viewport[4], - GLdouble * objx, GLdouble * objy, GLdouble * objz) -{ - /* matrice de transformation */ - GLdouble m[16], A[16]; - GLdouble in[4], out[4]; - - /* transformation coordonnees normalisees entre -1 et 1 */ - in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; - in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; - in[2] = 2 * winz - 1.0; - in[3] = 1.0; - - /* calcul transformation inverse */ - matmul(A, proj, model); - if (!invert_matrix(A, m)) - return GL_FALSE; - - /* d'ou les coordonnees objets */ - transform_point(out, m, in); - if (out[3] == 0.0) - return GL_FALSE; - *objx = out[0] / out[3]; - *objy = out[1] / out[3]; - *objz = out[2] / out[3]; - return GL_TRUE; -} - - -/* - * New in GLU 1.3 - * This is like gluUnProject but also takes near and far DepthRange values. - */ -#ifdef GLU_VERSION_1_3 -GLint GLAPIENTRY -gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipw, - const GLdouble modelMatrix[16], - const GLdouble projMatrix[16], - const GLint viewport[4], - GLclampd nearZ, GLclampd farZ, - GLdouble * objx, GLdouble * objy, GLdouble * objz, - GLdouble * objw) -{ - /* matrice de transformation */ - GLdouble m[16], A[16]; - GLdouble in[4], out[4]; - GLdouble z = nearZ + winz * (farZ - nearZ); - - /* transformation coordonnees normalisees entre -1 et 1 */ - in[0] = (winx - viewport[0]) * 2 / viewport[2] - 1.0; - in[1] = (winy - viewport[1]) * 2 / viewport[3] - 1.0; - in[2] = 2.0 * z - 1.0; - in[3] = clipw; - - /* calcul transformation inverse */ - matmul(A, projMatrix, modelMatrix); - if (!invert_matrix(A, m)) - return GL_FALSE; - - /* d'ou les coordonnees objets */ - transform_point(out, m, in); - if (out[3] == 0.0) - return GL_FALSE; - *objx = out[0] / out[3]; - *objy = out[1] / out[3]; - *objz = out[2] / out[3]; - *objw = out[3]; - return GL_TRUE; -} -#endif diff --git a/src/glu/mini/quadric.c b/src/glu/mini/quadric.c deleted file mode 100644 index 0484890ef6..0000000000 --- a/src/glu/mini/quadric.c +++ /dev/null @@ -1,773 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1999-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* TODO: - * texture coordinate support - * flip normals according to orientation - * there's still some inside/outside orientation bugs in possibly all - * but the sphere function - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include -#include "gluP.h" -#endif - - - -#ifndef M_PI -# define M_PI (3.1415926) -#endif - - -/* - * Convert degrees to radians: - */ -#define DEG_TO_RAD(A) ((A)*(M_PI/180.0)) - - -/* - * Sin and Cos for degree angles: - */ -#define SIND( A ) sin( (A)*(M_PI/180.0) ) -#define COSD( A) cos( (A)*(M_PI/180.0) ) - - -/* - * Texture coordinates if texture flag is set - */ -#define TXTR_COORD(x,y) if (qobj->TextureFlag) glTexCoord2f(x,y); - - - -struct GLUquadric -{ - GLenum DrawStyle; /* GLU_FILL, LINE, SILHOUETTE, or POINT */ - GLenum Orientation; /* GLU_INSIDE or GLU_OUTSIDE */ - GLboolean TextureFlag; /* Generate texture coords? */ - GLenum Normals; /* GLU_NONE, GLU_FLAT, or GLU_SMOOTH */ - void (GLCALLBACK * ErrorFunc) (GLenum err); /* Error handler callback function */ -}; - - - -/* - * Process a GLU error. - */ -static void -quadric_error(GLUquadricObj * qobj, GLenum error, const char *msg) -{ - /* Call the error call back function if any */ - if (qobj->ErrorFunc) { - (*qobj->ErrorFunc) (error); - } - /* Print a message to stdout if MESA_DEBUG variable is defined */ - if (getenv("MESA_DEBUG")) { - fprintf(stderr, "GLUError: %s: %s\n", (char *) gluErrorString(error), - msg); - } -} - - - - -GLUquadricObj *GLAPIENTRY -gluNewQuadric(void) -{ - GLUquadricObj *q; - - q = (GLUquadricObj *) malloc(sizeof(struct GLUquadric)); - if (q) { - q->DrawStyle = GLU_FILL; - q->Orientation = GLU_OUTSIDE; - q->TextureFlag = GL_FALSE; - q->Normals = GLU_SMOOTH; - q->ErrorFunc = NULL; - } - return q; -} - - - -void GLAPIENTRY -gluDeleteQuadric(GLUquadricObj * state) -{ - if (state) { - free((void *) state); - } -} - - - -/* - * Set the drawing style to be GLU_FILL, GLU_LINE, GLU_SILHOUETTE, - * or GLU_POINT. - */ -void GLAPIENTRY -gluQuadricDrawStyle(GLUquadricObj * quadObject, GLenum drawStyle) -{ - if (quadObject && (drawStyle == GLU_FILL || drawStyle == GLU_LINE - || drawStyle == GLU_SILHOUETTE - || drawStyle == GLU_POINT)) { - quadObject->DrawStyle = drawStyle; - } - else { - quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricDrawStyle"); - } -} - - - -/* - * Set the orientation to GLU_INSIDE or GLU_OUTSIDE. - */ -void GLAPIENTRY -gluQuadricOrientation(GLUquadricObj * quadObject, GLenum orientation) -{ - if (quadObject - && (orientation == GLU_INSIDE || orientation == GLU_OUTSIDE)) { - quadObject->Orientation = orientation; - } - else { - quadric_error(quadObject, GLU_INVALID_ENUM, "qluQuadricOrientation"); - } -} - - - -/* - * Set the error handler callback function. - */ -void GLAPIENTRY -gluQuadricCallback(GLUquadricObj * qobj, - GLenum which, void (GLCALLBACK * fn) ()) -{ - /* - * UGH, this is a mess! I thought ANSI was a standard. - */ - if (qobj && which == GLU_ERROR) { -#ifdef __CYGWIN32__ - qobj->ErrorFunc = (void (GLCALLBACKPCAST) (GLenum)) fn; -#elif defined(OPENSTEP) - qobj->ErrorFunc = (void (*)(GLenum)) fn; -#elif defined(_WIN32) - qobj->ErrorFunc = (void (GLCALLBACK *) (int)) fn; -#elif defined(__STORM__) - qobj->ErrorFunc = (void (GLCALLBACK *) (GLenum)) fn; -#elif defined(__BEOS__) - qobj->ErrorFunc = (void (*)(GLenum)) fn; -#else - qobj->ErrorFunc = (void (GLCALLBACK *) ()) fn; -#endif - } -} - - -void GLAPIENTRY -gluQuadricNormals(GLUquadricObj * quadObject, GLenum normals) -{ - if (quadObject - && (normals == GLU_NONE || normals == GLU_FLAT - || normals == GLU_SMOOTH)) { - quadObject->Normals = normals; - } -} - - -void GLAPIENTRY -gluQuadricTexture(GLUquadricObj * quadObject, GLboolean textureCoords) -{ - if (quadObject) { - quadObject->TextureFlag = textureCoords; - } -} - - - - -/* - * Call glNormal3f after scaling normal to unit length. - */ -static void -normal3f(GLfloat x, GLfloat y, GLfloat z) -{ -} - - - -void GLAPIENTRY -gluCylinder(GLUquadricObj * qobj, - GLdouble baseRadius, GLdouble topRadius, - GLdouble height, GLint slices, GLint stacks) -{ - GLdouble da, r, dr, dz; - GLfloat x, y, z, nz, nsign; - GLint i, j; - - if (qobj->Orientation == GLU_INSIDE) { - nsign = -1.0; - } - else { - nsign = 1.0; - } - - da = 2.0 * M_PI / slices; - dr = (topRadius - baseRadius) / stacks; - dz = height / stacks; - nz = (baseRadius - topRadius) / height; /* Z component of normal vectors */ - - if (qobj->DrawStyle == GLU_POINT) { - glBegin(GL_POINTS); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - - z = 0.0; - r = baseRadius; - for (j = 0; j <= stacks; j++) { - glVertex3f(x * r, y * r, z); - z += dz; - r += dr; - } - } - glEnd(); - } - else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { - /* Draw rings */ - if (qobj->DrawStyle == GLU_LINE) { - z = 0.0; - r = baseRadius; - for (j = 0; j <= stacks; j++) { - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * r, y * r, z); - } - glEnd(); - z += dz; - r += dr; - } - } - else { - /* draw one ring at each end */ - if (baseRadius != 0.0) { - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * baseRadius, y * baseRadius, 0.0); - } - glEnd(); - glBegin(GL_LINE_LOOP); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * topRadius, y * topRadius, height); - } - glEnd(); - } - } - /* draw length lines */ - glBegin(GL_LINES); - for (i = 0; i < slices; i++) { - x = cos(i * da); - y = sin(i * da); - normal3f(x * nsign, y * nsign, nz * nsign); - glVertex3f(x * baseRadius, y * baseRadius, 0.0); - glVertex3f(x * topRadius, y * topRadius, height); - } - glEnd(); - } - else if (qobj->DrawStyle == GLU_FILL) { - GLfloat ds = 1.0 / slices; - GLfloat dt = 1.0 / stacks; - GLfloat t = 0.0; - z = 0.0; - r = baseRadius; - for (j = 0; j < stacks; j++) { - GLfloat s = 0.0; - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= slices; i++) { - GLfloat x, y; - if (i == slices) { - x = sin(0.0); - y = cos(0.0); - } - else { - x = sin(i * da); - y = cos(i * da); - } - if (nsign == 1.0) { - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t); - glVertex3f(x * r, y * r, z); - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t + dt); - glVertex3f(x * (r + dr), y * (r + dr), z + dz); - } - else { - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t); - glVertex3f(x * r, y * r, z); - normal3f(x * nsign, y * nsign, nz * nsign); - TXTR_COORD(s, t + dt); - glVertex3f(x * (r + dr), y * (r + dr), z + dz); - } - s += ds; - } /* for slices */ - glEnd(); - r += dr; - t += dt; - z += dz; - } /* for stacks */ - } -} - - - - - -void GLAPIENTRY -gluSphere(GLUquadricObj * qobj, GLdouble radius, GLint slices, GLint stacks) -{ - GLfloat rho, drho, theta, dtheta; - GLfloat x, y, z; - GLfloat s, t, ds, dt; - GLint i, j, imin, imax; - GLboolean normals; - GLfloat nsign; - - if (qobj->Normals == GLU_NONE) { - normals = GL_FALSE; - } - else { - normals = GL_TRUE; - } - if (qobj->Orientation == GLU_INSIDE) { - nsign = -1.0; - } - else { - nsign = 1.0; - } - - drho = M_PI / (GLfloat) stacks; - dtheta = 2.0 * M_PI / (GLfloat) slices; - - /* texturing: s goes from 0.0/0.25/0.5/0.75/1.0 at +y/+x/-y/-x/+y axis */ - /* t goes from -1.0/+1.0 at z = -radius/+radius (linear along longitudes) */ - /* cannot use triangle fan on texturing (s coord. at top/bottom tip varies) */ - - if (qobj->DrawStyle == GLU_FILL) { - if (!qobj->TextureFlag) { - /* draw +Z end as a triangle fan */ - glBegin(GL_TRIANGLE_FAN); -/* glNormal3f(0.0, 0.0, 1.0); */ - glVertex3f(0.0, 0.0, nsign * radius); - for (j = 0; j <= slices; j++) { - theta = (j == slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(drho); - y = cos(theta) * sin(drho); - z = nsign * cos(drho); - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - - ds = 1.0 / slices; - dt = 1.0 / stacks; - t = 1.0; /* because loop now runs from 0 */ - if (qobj->TextureFlag) { - imin = 0; - imax = stacks; - } - else { - imin = 1; - imax = stacks - 1; - } - - /* draw intermediate stacks as quad strips */ - for (i = imin; i < imax; i++) { - rho = i * drho; - glBegin(GL_QUAD_STRIP); - s = 0.0; - for (j = 0; j <= slices; j++) { - theta = (j == slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(rho); - y = cos(theta) * sin(rho); - z = nsign * cos(rho); - TXTR_COORD(s, t); - glVertex3f(x * radius, y * radius, z * radius); - x = -sin(theta) * sin(rho + drho); - y = cos(theta) * sin(rho + drho); - z = nsign * cos(rho + drho); - TXTR_COORD(s, t - dt); - s += ds; - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - t -= dt; - } - - if (!qobj->TextureFlag) { - /* draw -Z end as a triangle fan */ - glBegin(GL_TRIANGLE_FAN); - glVertex3f(0.0, 0.0, -radius * nsign); - rho = M_PI - drho; - s = 1.0; - t = dt; - for (j = slices; j >= 0; j--) { - theta = (j == slices) ? 0.0 : j * dtheta; - x = -sin(theta) * sin(rho); - y = cos(theta) * sin(rho); - z = nsign * cos(rho); - s -= ds; - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - } - else if (qobj->DrawStyle == GLU_LINE || qobj->DrawStyle == GLU_SILHOUETTE) { - /* draw stack lines */ - for (i = 1; i < stacks; i++) { /* stack line at i==stacks-1 was missing here */ - rho = i * drho; - glBegin(GL_LINE_LOOP); - for (j = 0; j < slices; j++) { - theta = j * dtheta; - x = cos(theta) * sin(rho); - y = sin(theta) * sin(rho); - z = cos(rho); - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - /* draw slice lines */ - for (j = 0; j < slices; j++) { - theta = j * dtheta; - glBegin(GL_LINE_STRIP); - for (i = 0; i <= stacks; i++) { - rho = i * drho; - x = cos(theta) * sin(rho); - y = sin(theta) * sin(rho); - z = cos(rho); - glVertex3f(x * radius, y * radius, z * radius); - } - glEnd(); - } - } - else if (qobj->DrawStyle == GLU_POINT) { - /* top and bottom-most points */ - glBegin(GL_POINTS); - glVertex3f(0.0, 0.0, radius); - glVertex3f(0.0, 0.0, -radius); - - /* loop over stacks */ - for (i = 1; i < stacks - 1; i++) { - rho = i * drho; - for (j = 0; j < slices; j++) { - theta = j * dtheta; - x = cos(theta) * sin(rho); - y = sin(theta) * sin(rho); - z = cos(rho); - glVertex3f(x * radius, y * radius, z * radius); - } - } - glEnd(); - } - -} - - - -void GLAPIENTRY -gluDisk(GLUquadricObj * qobj, - GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops) -{ - GLfloat da, dr; -#if 0 - GLdouble a, da; - GLfloat r, dr; - GLfloat x, y; - GLfloat r1, r2, dtc; - GLint s, l; -#endif - - - da = 2.0 * M_PI / slices; - dr = (outerRadius - innerRadius) / (GLfloat) loops; - - switch (qobj->DrawStyle) { - case GLU_FILL: - { - /* texture of a gluDisk is a cut out of the texture unit square - * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1] - * (linear mapping) - */ - GLfloat dtc = 2.0f * outerRadius; - GLfloat sa, ca; - GLfloat r1 = innerRadius; - GLint l; - for (l = 0; l < loops; l++) { - GLfloat r2 = r1 + dr; - if (qobj->Orientation == GLU_OUTSIDE) { - GLint s; - glBegin(GL_QUAD_STRIP); - for (s = 0; s <= slices; s++) { - GLfloat a; - if (s == slices) - a = 0.0; - else - a = s * da; - sa = sin(a); - ca = cos(a); - TXTR_COORD(0.5 + sa * r2 / dtc, 0.5 + ca * r2 / dtc); - glVertex2f(r2 * sa, r2 * ca); - TXTR_COORD(0.5 + sa * r1 / dtc, 0.5 + ca * r1 / dtc); - glVertex2f(r1 * sa, r1 * ca); - } - glEnd(); - } - else { - GLint s; - glBegin(GL_QUAD_STRIP); - for (s = slices; s >= 0; s--) { - GLfloat a; - if (s == slices) - a = 0.0; - else - a = s * da; - sa = sin(a); - ca = cos(a); - TXTR_COORD(0.5 - sa * r2 / dtc, 0.5 + ca * r2 / dtc); - glVertex2f(r2 * sa, r2 * ca); - TXTR_COORD(0.5 - sa * r1 / dtc, 0.5 + ca * r1 / dtc); - glVertex2f(r1 * sa, r1 * ca); - } - glEnd(); - } - r1 = r2; - } - break; - } - case GLU_LINE: - { - GLint l, s; - /* draw loops */ - for (l = 0; l <= loops; l++) { - GLfloat r = innerRadius + l * dr; - glBegin(GL_LINE_LOOP); - for (s = 0; s < slices; s++) { - GLfloat a = s * da; - glVertex2f(r * sin(a), r * cos(a)); - } - glEnd(); - } - /* draw spokes */ - for (s = 0; s < slices; s++) { - GLfloat a = s * da; - GLfloat x = sin(a); - GLfloat y = cos(a); - glBegin(GL_LINE_STRIP); - for (l = 0; l <= loops; l++) { - GLfloat r = innerRadius + l * dr; - glVertex2f(r * x, r * y); - } - glEnd(); - } - break; - } - case GLU_POINT: - { - GLint s; - glBegin(GL_POINTS); - for (s = 0; s < slices; s++) { - GLfloat a = s * da; - GLfloat x = sin(a); - GLfloat y = cos(a); - GLint l; - for (l = 0; l <= loops; l++) { - GLfloat r = innerRadius * l * dr; - glVertex2f(r * x, r * y); - } - } - glEnd(); - break; - } - case GLU_SILHOUETTE: - { - if (innerRadius != 0.0) { - GLfloat a; - glBegin(GL_LINE_LOOP); - for (a = 0.0; a < 2.0 * M_PI; a += da) { - GLfloat x = innerRadius * sin(a); - GLfloat y = innerRadius * cos(a); - glVertex2f(x, y); - } - glEnd(); - } - { - GLfloat a; - glBegin(GL_LINE_LOOP); - for (a = 0; a < 2.0 * M_PI; a += da) { - GLfloat x = outerRadius * sin(a); - GLfloat y = outerRadius * cos(a); - glVertex2f(x, y); - } - glEnd(); - } - break; - } - default: - abort(); - } -} - - - -void GLAPIENTRY -gluPartialDisk(GLUquadricObj * qobj, GLdouble innerRadius, - GLdouble outerRadius, GLint slices, GLint loops, - GLdouble startAngle, GLdouble sweepAngle) -{ - if (qobj->DrawStyle == GLU_POINT) { - GLint loop, slice; - GLdouble radius, delta_radius; - GLdouble angle, delta_angle; - delta_radius = (outerRadius - innerRadius) / (loops - 1); - delta_angle = DEG_TO_RAD((sweepAngle) / (slices - 1)); - glBegin(GL_POINTS); - radius = innerRadius; - for (loop = 0; loop < loops; loop++) { - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice < slices; slice++) { - glVertex2f(radius * sin(angle), radius * cos(angle)); - angle += delta_angle; - } - radius += delta_radius; - } - glEnd(); - } - else if (qobj->DrawStyle == GLU_LINE) { - GLint loop, slice; - GLdouble radius, delta_radius; - GLdouble angle, delta_angle; - delta_radius = (outerRadius - innerRadius) / loops; - delta_angle = DEG_TO_RAD(sweepAngle / slices); - /* draw rings */ - radius = innerRadius; - for (loop = 0; loop < loops; loop++) { - angle = DEG_TO_RAD(startAngle); - glBegin(GL_LINE_STRIP); - for (slice = 0; slice <= slices; slice++) { - glVertex2f(radius * sin(angle), radius * cos(angle)); - angle += delta_angle; - } - glEnd(); - radius += delta_radius; - } - /* draw spokes */ - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice <= slices; slice++) { - radius = innerRadius; - glBegin(GL_LINE_STRIP); - for (loop = 0; loop < loops; loop++) { - glVertex2f(radius * sin(angle), radius * cos(angle)); - radius += delta_radius; - } - glEnd(); - angle += delta_angle; - } - } - else if (qobj->DrawStyle == GLU_SILHOUETTE) { - GLint slice; - GLdouble angle, delta_angle; - delta_angle = DEG_TO_RAD(sweepAngle / slices); - /* draw outer ring */ - glBegin(GL_LINE_STRIP); - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice <= slices; slice++) { - glVertex2f(outerRadius * sin(angle), outerRadius * cos(angle)); - angle += delta_angle; - } - glEnd(); - /* draw inner ring */ - if (innerRadius > 0.0) { - glBegin(GL_LINE_STRIP); - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice < slices; slice++) { - glVertex2f(innerRadius * sin(angle), innerRadius * cos(angle)); - angle += delta_angle; - } - glEnd(); - } - /* draw spokes */ - if (sweepAngle < 360.0) { - GLdouble stopAngle = startAngle + sweepAngle; - glBegin(GL_LINES); - glVertex2f(innerRadius * SIND(startAngle), - innerRadius * COSD(startAngle)); - glVertex2f(outerRadius * SIND(startAngle), - outerRadius * COSD(startAngle)); - glVertex2f(innerRadius * SIND(stopAngle), - innerRadius * COSD(stopAngle)); - glVertex2f(outerRadius * SIND(stopAngle), - outerRadius * COSD(stopAngle)); - glEnd(); - } - } - else if (qobj->DrawStyle == GLU_FILL) { - GLint loop, slice; - GLdouble radius, delta_radius; - GLdouble angle, delta_angle; - delta_radius = (outerRadius - innerRadius) / loops; - delta_angle = DEG_TO_RAD(sweepAngle / slices); - radius = innerRadius; - for (loop = 0; loop < loops; loop++) { - glBegin(GL_QUAD_STRIP); - angle = DEG_TO_RAD(startAngle); - for (slice = 0; slice <= slices; slice++) { - if (qobj->Orientation == GLU_OUTSIDE) { - glVertex2f((radius + delta_radius) * sin(angle), - (radius + delta_radius) * cos(angle)); - glVertex2f(radius * sin(angle), radius * cos(angle)); - } - else { - glVertex2f(radius * sin(angle), radius * cos(angle)); - glVertex2f((radius + delta_radius) * sin(angle), - (radius + delta_radius) * cos(angle)); - } - angle += delta_angle; - } - glEnd(); - radius += delta_radius; - } - } -} diff --git a/src/glu/mini/tess.c b/src/glu/mini/tess.c deleted file mode 100644 index 341d29bae3..0000000000 --- a/src/glu/mini/tess.c +++ /dev/null @@ -1,327 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "tess.h" -#endif - - -/* - * This is ugly, but seems the easiest way to do things to make the - * code work under YellowBox for Windows - */ -#if defined(OPENSTEP) && defined(CALLBACK) -#undef CALLBACK -#define CALLBACK -#endif - - -static void delete_contours(GLUtriangulatorObj *); - -#ifdef __CYGWIN32__ -#define _CALLBACK -#else -#define _CALLBACK GLCALLBACK -#endif - - -static void -init_callbacks(tess_callbacks * callbacks) -{ - callbacks->begin = (void (_CALLBACK *) (GLenum)) 0; - callbacks->edgeFlag = (void (_CALLBACK *) (GLboolean)) 0; - callbacks->vertex = (void (_CALLBACK *) (void *)) 0; - callbacks->end = (void (_CALLBACK *) (void)) 0; - callbacks->error = (void (_CALLBACK *) (GLenum)) 0; -} - -void -tess_call_user_error(GLUtriangulatorObj * tobj, GLenum gluerr) -{ - if (tobj->error == GLU_NO_ERROR) - tobj->error = gluerr; - if (tobj->callbacks.error != NULL) - (tobj->callbacks.error) (gluerr); -} - -GLUtriangulatorObj *GLAPIENTRY -gluNewTess(void) -{ - GLUtriangulatorObj *tobj; - - if ((tobj = (GLUtriangulatorObj *) - malloc(sizeof(struct GLUtesselator))) == NULL) - return NULL; - tobj->contours = tobj->last_contour = NULL; - init_callbacks(&tobj->callbacks); - tobj->error = GLU_NO_ERROR; - tobj->current_polygon = NULL; - tobj->contour_cnt = 0; - return tobj; -} - - -void GLAPIENTRY -gluTessCallback(GLUtriangulatorObj * tobj, GLenum which, - void (GLCALLBACK * fn) ()) -{ - switch (which) { - case GLU_BEGIN: - tobj->callbacks.begin = (void (_CALLBACK *) (GLenum)) fn; - break; - case GLU_EDGE_FLAG: - tobj->callbacks.edgeFlag = (void (_CALLBACK *) (GLboolean)) fn; - break; - case GLU_VERTEX: - tobj->callbacks.vertex = (void (_CALLBACK *) (void *)) fn; - break; - case GLU_END: - tobj->callbacks.end = (void (_CALLBACK *) (void)) fn; - break; - case GLU_ERROR: - tobj->callbacks.error = (void (_CALLBACK *) (GLenum)) fn; - break; - default: - tobj->error = GLU_INVALID_ENUM; - break; - } -} - - - -void GLAPIENTRY -gluDeleteTess(GLUtriangulatorObj * tobj) -{ - if (tobj->error == GLU_NO_ERROR && tobj->contour_cnt) - /* was gluEndPolygon called? */ - tess_call_user_error(tobj, GLU_TESS_ERROR1); - /* delete all internal structures */ - delete_contours(tobj); - free(tobj); -} - - -void GLAPIENTRY -gluBeginPolygon(GLUtriangulatorObj * tobj) -{ -/* - if(tobj->error!=GLU_NO_ERROR) - return; -*/ - tobj->error = GLU_NO_ERROR; - if (tobj->current_polygon != NULL) { - /* gluEndPolygon was not called */ - tess_call_user_error(tobj, GLU_TESS_ERROR1); - /* delete all internal structures */ - delete_contours(tobj); - } - else { - if ((tobj->current_polygon = - (tess_polygon *) malloc(sizeof(tess_polygon))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - tobj->current_polygon->vertex_cnt = 0; - tobj->current_polygon->vertices = - tobj->current_polygon->last_vertex = NULL; - } -} - - -void GLAPIENTRY -gluEndPolygon(GLUtriangulatorObj * tobj) -{ - /*tess_contour *contour_ptr; */ - - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - /* check if gluBeginPolygon was called */ - if (tobj->current_polygon == NULL) { - tess_call_user_error(tobj, GLU_TESS_ERROR2); - return; - } - tess_test_polygon(tobj); - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - /* any real contours? */ - if (tobj->contour_cnt == 0) { - /* delete all internal structures */ - delete_contours(tobj); - return; - } - tess_find_contour_hierarchies(tobj); - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - tess_handle_holes(tobj); - /* there was an error */ - if (tobj->error != GLU_NO_ERROR) - goto end; - - /* if no callbacks, nothing to do */ - if (tobj->callbacks.begin != NULL && tobj->callbacks.vertex != NULL && - tobj->callbacks.end != NULL) { - if (tobj->callbacks.edgeFlag == NULL) - tess_tesselate(tobj); - else - tess_tesselate_with_edge_flag(tobj); - } - - end: - /* delete all internal structures */ - delete_contours(tobj); -} - - -void GLAPIENTRY -gluNextContour(GLUtriangulatorObj * tobj, GLenum type) -{ - if (tobj->error != GLU_NO_ERROR) - return; - if (tobj->current_polygon == NULL) { - tess_call_user_error(tobj, GLU_TESS_ERROR2); - return; - } - /* first contour? */ - if (tobj->current_polygon->vertex_cnt) - tess_test_polygon(tobj); -} - - -void GLAPIENTRY -gluTessVertex(GLUtriangulatorObj * tobj, GLdouble v[3], void *data) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_vertex *last_vertex_ptr; - - if (tobj->error != GLU_NO_ERROR) - return; - if (polygon == NULL) { - tess_call_user_error(tobj, GLU_TESS_ERROR2); - return; - } - last_vertex_ptr = polygon->last_vertex; - if (last_vertex_ptr == NULL) { - if ((last_vertex_ptr = (tess_vertex *) - malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - polygon->vertices = last_vertex_ptr; - polygon->last_vertex = last_vertex_ptr; - last_vertex_ptr->data = data; - last_vertex_ptr->location[0] = v[0]; - last_vertex_ptr->location[1] = v[1]; - last_vertex_ptr->location[2] = v[2]; - last_vertex_ptr->next = NULL; - last_vertex_ptr->previous = NULL; - ++(polygon->vertex_cnt); - } - else { - tess_vertex *vertex_ptr; - - /* same point twice? */ - if (fabs(last_vertex_ptr->location[0] - v[0]) < EPSILON && - fabs(last_vertex_ptr->location[1] - v[1]) < EPSILON && - fabs(last_vertex_ptr->location[2] - v[2]) < EPSILON) { - tess_call_user_error(tobj, GLU_TESS_ERROR6); - return; - } - if ((vertex_ptr = (tess_vertex *) - malloc(sizeof(tess_vertex))) == NULL) { - tess_call_user_error(tobj, GLU_OUT_OF_MEMORY); - return; - } - vertex_ptr->data = data; - vertex_ptr->location[0] = v[0]; - vertex_ptr->location[1] = v[1]; - vertex_ptr->location[2] = v[2]; - vertex_ptr->next = NULL; - vertex_ptr->previous = last_vertex_ptr; - ++(polygon->vertex_cnt); - last_vertex_ptr->next = vertex_ptr; - polygon->last_vertex = vertex_ptr; - } -} - - -static void -delete_contours(GLUtriangulatorObj * tobj) -{ - tess_polygon *polygon = tobj->current_polygon; - tess_contour *contour, *contour_tmp; - tess_vertex *vertex, *vertex_tmp; - - /* remove current_polygon list - if exists due to detected error */ - if (polygon != NULL) { - if (polygon->vertices) { - for (vertex = polygon->vertices; vertex != polygon->last_vertex;) { - vertex_tmp = vertex->next; - free(vertex); - vertex = vertex_tmp; - } - free(vertex); - } - free(polygon); - tobj->current_polygon = NULL; - } - /* remove all contour data */ - for (contour = tobj->contours; contour != NULL;) { - for (vertex = contour->vertices; vertex != contour->last_vertex;) { - vertex_tmp = vertex->next; - free(vertex); - vertex = vertex_tmp; - } - free(vertex); - contour_tmp = contour->next; - free(contour); - contour = contour_tmp; - } - tobj->contours = tobj->last_contour = NULL; - tobj->contour_cnt = 0; -} - - -void GLAPIENTRY -gluTessNormal(GLUtesselator *tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ) -{ - /* dummy function */ - (void) tess; - (void) valueX; - (void) valueY; - (void) valueZ; -} diff --git a/src/glu/mini/tess.h b/src/glu/mini/tess.h deleted file mode 100644 index 4e51dddd37..0000000000 --- a/src/glu/mini/tess.h +++ /dev/null @@ -1,107 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifndef TESS_H -#define TESS_H - - -#include "gluP.h" - -#define EPSILON 1e-06 /* epsilon for double precision compares */ - -typedef enum -{ - OXY, - OYZ, - OXZ -} -projection_type; - -typedef struct callbacks_str -{ - void (GLCALLBACK * begin) (GLenum mode); - void (GLCALLBACK * edgeFlag) (GLboolean flag); - void (GLCALLBACK * vertex) (GLvoid * v); - void (GLCALLBACK * end) (void); - void (GLCALLBACK * error) (GLenum err); -} -tess_callbacks; - -typedef struct vertex_str -{ - void *data; - GLdouble location[3]; - GLdouble x, y; - GLboolean edge_flag; - struct vertex_str *shadow_vertex; - struct vertex_str *next, *previous; -} -tess_vertex; - -typedef struct contour_str -{ - GLenum type; - GLuint vertex_cnt; - GLdouble area; - GLenum orientation; - struct vertex_str *vertices, *last_vertex; - struct contour_str *next, *previous; -} -tess_contour; - -typedef struct polygon_str -{ - GLuint vertex_cnt; - GLdouble A, B, C, D; - GLdouble area; - GLenum orientation; - struct vertex_str *vertices, *last_vertex; -} -tess_polygon; - -struct GLUtesselator -{ - tess_contour *contours, *last_contour; - GLuint contour_cnt; - tess_callbacks callbacks; - tess_polygon *current_polygon; - GLenum error; - GLdouble A, B, C, D; - projection_type projection; -}; - - -extern void tess_call_user_error(GLUtriangulatorObj *, GLenum); -extern void tess_test_polygon(GLUtriangulatorObj *); -extern void tess_find_contour_hierarchies(GLUtriangulatorObj *); -extern void tess_handle_holes(GLUtriangulatorObj *); -extern void tess_tesselate(GLUtriangulatorObj *); -extern void tess_tesselate_with_edge_flag(GLUtriangulatorObj *); - - -#endif diff --git a/src/glu/mini/tesselat.c b/src/glu/mini/tesselat.c deleted file mode 100644 index 47d230073f..0000000000 --- a/src/glu/mini/tesselat.c +++ /dev/null @@ -1,406 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.3 - * Copyright (C) 1995-2000 Brian Paul - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - - -/* - * This file is part of the polygon tesselation code contributed by - * Bogdan Sikorski - */ - - -#ifdef PC_HEADER -#include "all.h" -#else -#include -#include -#include "tess.h" -#endif - - - -static GLboolean edge_flag; - -static void emit_triangle(GLUtriangulatorObj *, tess_vertex *, - tess_vertex *, tess_vertex *); - -static void emit_triangle_with_edge_flag(GLUtriangulatorObj *, - tess_vertex *, GLboolean, - tess_vertex *, GLboolean, - tess_vertex *, GLboolean); - -static GLdouble -twice_the_triangle_area(tess_vertex * va, tess_vertex * vb, tess_vertex * vc) -{ - return (vb->x - va->x) * (vc->y - va->y) - (vb->y - va->y) * (vc->x - - va->x); -} - -static GLboolean -left(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) -{ - if (A * x + B * y + C > -EPSILON) - return GL_TRUE; - else - return GL_FALSE; -} - -static GLboolean -right(GLdouble A, GLdouble B, GLdouble C, GLdouble x, GLdouble y) -{ - if (A * x + B * y + C < EPSILON) - return GL_TRUE; - else - return GL_FALSE; -} - -static GLint -convex_ccw(tess_vertex * va, - tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) -{ - GLdouble d; - - d = twice_the_triangle_area(va, vb, vc); - - if (d > EPSILON) { - return 1; - } - else if (d < -EPSILON) { - return 0; - } - else { - return -1; - } -} - -static GLint -convex_cw(tess_vertex * va, - tess_vertex * vb, tess_vertex * vc, GLUtriangulatorObj * tobj) -{ - GLdouble d; - - d = twice_the_triangle_area(va, vb, vc); - - if (d < -EPSILON) { - return 1; - } - else if (d > EPSILON) { - return 0; - } - else { - return -1; - } -} - -static GLboolean -diagonal_ccw(tess_vertex * va, - tess_vertex * vb, - GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vc = va->next, *vertex, *shadow_vertex; - struct - { - GLdouble A, B, C; - } - ac, cb, ba; - GLdouble x, y; - - GLint res = convex_ccw(va, vc, vb, tobj); - if (res == 0) - return GL_FALSE; - if (res == -1) - return GL_TRUE; - - ba.A = vb->y - va->y; - ba.B = va->x - vb->x; - ba.C = -ba.A * va->x - ba.B * va->y; - ac.A = va->y - vc->y; - ac.B = vc->x - va->x; - ac.C = -ac.A * vc->x - ac.B * vc->y; - cb.A = vc->y - vb->y; - cb.B = vb->x - vc->x; - cb.C = -cb.A * vb->x - cb.B * vb->y; - for (vertex = vb->next; vertex != va; vertex = vertex->next) { - shadow_vertex = vertex->shadow_vertex; - if (shadow_vertex != NULL && - (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) - continue; - x = vertex->x; - y = vertex->y; - if (left(ba.A, ba.B, ba.C, x, y) && - left(ac.A, ac.B, ac.C, x, y) && left(cb.A, cb.B, cb.C, x, y)) - return GL_FALSE; - } - return GL_TRUE; -} - -static GLboolean -diagonal_cw(tess_vertex * va, - tess_vertex * vb, - GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vc = va->next, *vertex, *shadow_vertex; - struct - { - GLdouble A, B, C; - } - ac, cb, ba; - GLdouble x, y; - - GLint res = convex_cw(va, vc, vb, tobj); - if (res == 0) - return GL_FALSE; - if (res == -1) - return GL_TRUE; - - ba.A = vb->y - va->y; - ba.B = va->x - vb->x; - ba.C = -ba.A * va->x - ba.B * va->y; - ac.A = va->y - vc->y; - ac.B = vc->x - va->x; - ac.C = -ac.A * vc->x - ac.B * vc->y; - cb.A = vc->y - vb->y; - cb.B = vb->x - vc->x; - cb.C = -cb.A * vb->x - cb.B * vb->y; - for (vertex = vb->next; vertex != va; vertex = vertex->next) { - shadow_vertex = vertex->shadow_vertex; - if (shadow_vertex != NULL && - (shadow_vertex == va || shadow_vertex == vb || shadow_vertex == vc)) - continue; - x = vertex->x; - y = vertex->y; - if (right(ba.A, ba.B, ba.C, x, y) && - right(ac.A, ac.B, ac.C, x, y) && right(cb.A, cb.B, cb.C, x, y)) - return GL_FALSE; - } - return GL_TRUE; -} - -static void -clip_ear(GLUtriangulatorObj * tobj, tess_vertex * v, tess_contour * contour) -{ - emit_triangle(tobj, v->previous, v, v->next); - /* the first in the list */ - if (contour->vertices == v) { - contour->vertices = v->next; - contour->last_vertex->next = v->next; - v->next->previous = contour->last_vertex; - } - else - /* the last ? */ - if (contour->last_vertex == v) { - contour->vertices->previous = v->previous; - v->previous->next = v->next; - contour->last_vertex = v->previous; - } - else { - v->next->previous = v->previous; - v->previous->next = v->next; - } - free(v); - --(contour->vertex_cnt); -} - -static void -clip_ear_with_edge_flag(GLUtriangulatorObj * tobj, - tess_vertex * v, tess_contour * contour) -{ - emit_triangle_with_edge_flag(tobj, v->previous, v->previous->edge_flag, - v, v->edge_flag, v->next, GL_FALSE); - v->previous->edge_flag = GL_FALSE; - /* the first in the list */ - if (contour->vertices == v) { - contour->vertices = v->next; - contour->last_vertex->next = v->next; - v->next->previous = contour->last_vertex; - } - else - /* the last ? */ - if (contour->last_vertex == v) { - contour->vertices->previous = v->previous; - v->previous->next = v->next; - contour->last_vertex = v->previous; - } - else { - v->next->previous = v->previous; - v->previous->next = v->next; - } - free(v); - --(contour->vertex_cnt); -} - -static void -triangulate_ccw(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -static void -triangulate_cw(GLUtriangulatorObj * tobj, tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -static void -triangulate_ccw_with_edge_flag(GLUtriangulatorObj * tobj, - tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_ccw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear_with_edge_flag(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -static void -triangulate_cw_with_edge_flag(GLUtriangulatorObj * tobj, - tess_contour * contour) -{ - tess_vertex *vertex; - GLuint vertex_cnt = contour->vertex_cnt; - - while (vertex_cnt > 3) { - vertex = contour->vertices; - while (diagonal_cw(vertex, vertex->next->next, tobj, contour) == - GL_FALSE && tobj->error == GLU_NO_ERROR) - vertex = vertex->next; - if (tobj->error != GLU_NO_ERROR) - return; - clip_ear_with_edge_flag(tobj, vertex->next, contour); - --vertex_cnt; - } -} - -void -tess_tesselate(GLUtriangulatorObj * tobj) -{ - tess_contour *contour; - - for (contour = tobj->contours; contour != NULL; contour = contour->next) { - if (contour->orientation == GLU_CCW) { - triangulate_ccw(tobj, contour); - } - else { - triangulate_cw(tobj, contour); - } - if (tobj->error != GLU_NO_ERROR) - return; - - /* emit the last triangle */ - emit_triangle(tobj, contour->vertices, contour->vertices->next, - contour->vertices->next->next); - } -} - -void -tess_tesselate_with_edge_flag(GLUtriangulatorObj * tobj) -{ - tess_contour *contour; - - edge_flag = GL_TRUE; - /* first callback with edgeFlag set to GL_TRUE */ - (tobj->callbacks.edgeFlag) (GL_TRUE); - - for (contour = tobj->contours; contour != NULL; contour = contour->next) { - if (contour->orientation == GLU_CCW) - triangulate_ccw_with_edge_flag(tobj, contour); - else - triangulate_cw_with_edge_flag(tobj, contour); - if (tobj->error != GLU_NO_ERROR) - return; - /* emit the last triangle */ - emit_triangle_with_edge_flag(tobj, contour->vertices, - contour->vertices->edge_flag, - contour->vertices->next, - contour->vertices->next->edge_flag, - contour->vertices->next->next, - contour->vertices->next->next->edge_flag); - } -} - -static void -emit_triangle(GLUtriangulatorObj * tobj, - tess_vertex * v1, tess_vertex * v2, tess_vertex * v3) -{ - (tobj->callbacks.begin) (GL_TRIANGLES); - (tobj->callbacks.vertex) (v1->data); - (tobj->callbacks.vertex) (v2->data); - (tobj->callbacks.vertex) (v3->data); - (tobj->callbacks.end) (); -} - -static void -emit_triangle_with_edge_flag(GLUtriangulatorObj * tobj, - tess_vertex * v1, - GLboolean edge_flag1, - tess_vertex * v2, - GLboolean edge_flag2, - tess_vertex * v3, GLboolean edge_flag3) -{ - (tobj->callbacks.begin) (GL_TRIANGLES); - if (edge_flag1 != edge_flag) { - edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag) (edge_flag); - } - (tobj->callbacks.vertex) (v1->data); - if (edge_flag2 != edge_flag) { - edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag) (edge_flag); - } - (tobj->callbacks.vertex) (v2->data); - if (edge_flag3 != edge_flag) { - edge_flag = (edge_flag == GL_TRUE ? GL_FALSE : GL_TRUE); - (tobj->callbacks.edgeFlag) (edge_flag); - } - (tobj->callbacks.vertex) (v3->data); - (tobj->callbacks.end) (); -} -- cgit v1.2.3 From 3e882e943c487945d598cbc6fae8fd570f28081d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 25 Feb 2010 17:52:48 -0800 Subject: util: Remove import of unused sys module. --- src/gallium/auxiliary/util/u_format_parse.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 983c3a90fc..15c887af5e 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -30,9 +30,6 @@ ''' -import sys - - VOID, UNSIGNED, SIGNED, FIXED, FLOAT = range(5) SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_0, SWIZZLE_1, SWIZZLE_NONE, = range(7) -- cgit v1.2.3 From 31ff9b0a135bf913ae6b44868bde31534a87802c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 16:20:01 -0700 Subject: util: remove a trailing semicolon in format table code --- src/gallium/auxiliary/util/u_format_table.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index 3d0e3a0349..953b5aed87 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -152,7 +152,7 @@ def write_format_table(formats): print " assert(0);" print " return NULL;" print " }" - print "};" + print "}" print -- cgit v1.2.3 From c9e8ff1976cd14fdc84db440a554185be29a0ca2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 18:59:56 -0700 Subject: mesa: use simplified _BaseFormat value in render-to-texture code Fixes fd.o bug 26762. --- src/mesa/main/texrender.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index dbed51a77f..11d7c06914 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -496,21 +496,24 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) if (trb->TexImage->TexFormat == MESA_FORMAT_Z24_S8) { trb->Base.Format = MESA_FORMAT_Z24_S8; trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; + trb->Base._BaseFormat = GL_DEPTH_STENCIL; } else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) { trb->Base.Format = MESA_FORMAT_Z16; trb->Base.DataType = GL_UNSIGNED_SHORT; + trb->Base._BaseFormat = GL_DEPTH_STENCIL; } else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) { trb->Base.Format = MESA_FORMAT_Z32; trb->Base.DataType = GL_UNSIGNED_INT; + trb->Base._BaseFormat = GL_DEPTH_COMPONENT; } else { trb->Base.Format = trb->TexImage->TexFormat; trb->Base.DataType = CHAN_TYPE; + trb->Base._BaseFormat = GL_RGBA; } trb->Base.Data = trb->TexImage->Data; - trb->Base._BaseFormat = _mesa_base_fbo_format(ctx, trb->Base.InternalFormat); } -- cgit v1.2.3 From 593eb8a642e8853d50da7792d7c111500d5cbe34 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 04:02:40 +0200 Subject: drop stray src/mesa/main/sources --- src/mesa/main/sources | 158 -------------------------------------------------- 1 file changed, 158 deletions(-) delete mode 100644 src/mesa/main/sources (limited to 'src') diff --git a/src/mesa/main/sources b/src/mesa/main/sources deleted file mode 100644 index 5d9d99040e..0000000000 --- a/src/mesa/main/sources +++ /dev/null @@ -1,158 +0,0 @@ -# List of source files in this directory used for X.org xserver build -MESA_MAIN_SOURCES = \ -accum.c \ -api_arrayelt.c \ -api_exec.c \ -api_loopback.c \ -api_noop.c \ -api_validate.c \ -arrayobj.c \ -attrib.c \ -blend.c \ -bufferobj.c \ -buffers.c \ -clear.c \ -clip.c \ -colortab.c \ -context.c \ -convolve.c \ -debug.c \ -depth.c \ -depthstencil.c \ -dlist.c \ -dlopen.c \ -drawpix.c \ -enable.c \ -enums.c \ -eval.c \ -execmem.c \ -extensions.c \ -fbobject.c \ -feedback.c \ -fog.c \ -framebuffer.c \ -get.c \ -getstring.c \ -hash.c \ -hint.c \ -histogram.c \ -image.c \ -imports.c \ -light.c \ -lines.c \ -matrix.c \ -mipmap.c \ -mm.c \ -multisample.c \ -occlude.c \ -pixel.c \ -pixelstore.c \ -points.c \ -polygon.c \ -readpix.c \ -rastpos.c \ -rbadaptors.c \ -renderbuffer.c \ -scissor.c \ -state.c \ -stencil.c \ -texcompress.c \ -texcompress_fxt1.c \ -texcompress_s3tc.c \ -texenv.c \ -texenvprogram.c \ -texformat.c \ -texgen.c \ -texgetimage.c \ -teximage.c \ -texobj.c \ -texparam.c \ -texrender.c \ -texstate.c \ -texstore.c \ -varray.c \ -$(VSNPRINTF_SOURCES) \ -vtxfmt.c - -MESA_VSNPRINTF_SOURCES = \ -vsnprintf.c - -MESA_MAIN_HEADERS = \ -accum.h \ -api_arrayelt.h \ -api_exec.h \ -api_loopback.h \ -api_noop.h \ -api_validate.h \ -arrayobj.h \ -attrib.h \ -bitset.h \ -blend.h \ -bufferobj.h \ -buffers.h \ -clear.h \ -clip.h \ -colormac.h \ -colortab.h \ -config.h \ -context.h \ -convolve.h \ -dd.h \ -debug.h \ -depth.h \ -depthstencil.h \ -dlist.h \ -dlopen.h \ -drawpix.h \ -enable.h \ -enums.h \ -eval.h \ -extensions.h \ -fbobject.h \ -feedback.h \ -fog.h \ -framebuffer.h \ -get.h \ -glheader.h \ -hash.h \ -hint.h \ -histogram.h \ -image.h \ -imports.h \ -light.h \ -lines.h \ -macros.h \ -matrix.h \ -mipmap.h \ -mm.h \ -mtypes.h \ -multisample.h \ -occlude.h \ -pixel.h \ -pixelstore.h \ -points.h \ -polygon.h \ -rastpos.h \ -rbadaptors.h \ -readpix.h \ -renderbuffer.h \ -simple_list.h \ -scissor.h \ -state.h \ -stencil.h \ -texcompress.h \ -texenv.h \ -texenvprogram.h \ -texformat.h \ -texformat_tmp.h \ -texgen.h \ -teximage.h \ -texobj.h \ -texparam.h \ -texrender.h \ -texstate.h \ -texstore.h \ -varray.h \ -version.h \ -vtxfmt.h \ -vtxfmt_tmp.h -- cgit v1.2.3 From 900b163a86cc97f029c8bf8cf2779fa173f353de Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 04:02:41 +0200 Subject: minor cleanup of dri/Makefile.template's after miniglx drop also makes the WINDOW_SYSTEM configure var useless ... --- src/gallium/winsys/drm/Makefile.template | 25 ++++--------------------- src/gallium/winsys/drm/radeon/dri/Makefile | 2 -- src/mesa/drivers/dri/Makefile.template | 24 +++--------------------- 3 files changed, 7 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/Makefile.template b/src/gallium/winsys/drm/Makefile.template index 960353a73d..f4cc0def47 100644 --- a/src/gallium/winsys/drm/Makefile.template +++ b/src/gallium/winsys/drm/Makefile.template @@ -19,30 +19,12 @@ COMMON_BM_SOURCES = \ $(TOP)/src/mesa/drivers/dri/common/dri_bufmgr.c \ $(TOP)/src/mesa/drivers/dri/common/dri_drmpool.c - -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ= -WINLIB= INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) OBJECTS = \ $(C_SOURCES:.c=.o) \ $(ASM_SOURCES:.S=.o) -else -# miniglx -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini -INCLUDES = $(MINIGLX_INCLUDES) \ - $(SHARED_INCLUDES) \ - $(PCIACCESS_CFLAGS) - -OBJECTS = $(C_SOURCES:.c=.o) \ - $(MINIGLX_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) -endif - ### Include directories SHARED_INCLUDES = \ @@ -74,18 +56,19 @@ SHARED_INCLUDES = \ $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ .S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ + $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ ##### TARGETS ##### default: depend symlinks $(TOP)/$(LIB_DIR)/gallium/$(LIBNAME) -$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template +$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \ + $(TOP)/src/mesa/drivers/dri/Makefile.template $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ $(OBJECTS) $(PIPE_DRIVERS) \ -Wl,--start-group $(MESA_MODULES) -Wl,--end-group \ - $(WINOBJ) $(DRI_LIB_DEPS) $(DRIVER_EXTRAS) + $(DRI_LIB_DEPS) $(DRIVER_EXTRAS) $(TOP)/$(LIB_DIR)/gallium: mkdir -p $@ diff --git a/src/gallium/winsys/drm/radeon/dri/Makefile b/src/gallium/winsys/drm/radeon/dri/Makefile index eaa3418032..d75f7dd6da 100644 --- a/src/gallium/winsys/drm/radeon/dri/Makefile +++ b/src/gallium/winsys/drm/radeon/dri/Makefile @@ -4,8 +4,6 @@ include $(TOP)/configs/current LIBNAME = radeong_dri.so -MINIGLX_SOURCES = - PIPE_DRIVERS = \ $(TOP)/src/gallium/state_trackers/dri/libdridrm.a \ $(TOP)/src/gallium/winsys/drm/radeon/core/libradeonwinsys.a \ diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 39d25ce3f4..a0c25d26cd 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -14,28 +14,11 @@ COMMON_SOURCES = $(COMMON_GALLIUM_SOURCES) \ ../common/drirenderbuffer.c \ ../common/dri_metaops.c -ifeq ($(WINDOW_SYSTEM),dri) -WINOBJ= -WINLIB= INCLUDES = $(SHARED_INCLUDES) $(EXPAT_INCLUDES) OBJECTS = $(C_SOURCES:.c=.o) \ $(ASM_SOURCES:.S=.o) -else -# miniglx -WINOBJ= -WINLIB=-L$(MESA)/src/glx/mini -MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini -INCLUDES = $(MINIGLX_INCLUDES) \ - $(SHARED_INCLUDES) \ - $(PCIACCESS_CFLAGS) - -OBJECTS = $(C_SOURCES:.c=.o) \ - $(MINIGLX_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) -endif - ### Include directories SHARED_INCLUDES = \ @@ -55,7 +38,7 @@ SHARED_INCLUDES = \ $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ .S.o: - $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ + $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@ ##### TARGETS ##### @@ -67,11 +50,10 @@ default: subdirs lib lib: symlinks subdirs depend @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) -$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) Makefile \ +$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) Makefile \ $(TOP)/src/mesa/drivers/dri/Makefile.template $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) \ - $(DRI_LIB_DEPS) + $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(DRI_LIB_DEPS) $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) -- cgit v1.2.3 From 25da8e66f8f9b5a6a20ba95412e80b1f422f48d0 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 04:02:41 +0200 Subject: remove hack for miniglx from dri/utils.c --- src/mesa/drivers/dri/common/utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 8c15cbbf73..b6f291098d 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -275,10 +275,9 @@ driCheckDriDdxDrmVersions3(const char * driver_name, } /* Check that the DDX driver version is compatible */ - /* for miniglx we pass in -1 so we can ignore the DDX version */ - if ( (ddxActual->major != -1) && ((ddxActual->major < ddxExpected->major_min) + if ( (ddxActual->major < ddxExpected->major_min) || (ddxActual->major > ddxExpected->major_max) - || (ddxActual->minor < ddxExpected->minor)) ) { + || (ddxActual->minor < ddxExpected->minor) ) { fprintf(stderr, format2, driver_name, "DDX", ddxExpected->major_min, ddxExpected->major_max, ddxExpected->minor, ddxActual->major, ddxActual->minor, ddxActual->patch); -- cgit v1.2.3 From 17ddb7c7e897719fa28fb64ac3ecbc7b7e9f8d24 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 13:46:45 -0800 Subject: i965: Fix the SNB URB entry count setup. --- src/mesa/drivers/dri/i965/gen6_urb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_urb.c b/src/mesa/drivers/dri/i965/gen6_urb.c index 55f7ac7727..5445e4035a 100644 --- a/src/mesa/drivers/dri/i965/gen6_urb.c +++ b/src/mesa/drivers/dri/i965/gen6_urb.c @@ -64,9 +64,9 @@ upload_urb(struct brw_context *brw) BEGIN_BATCH(3); OUT_BATCH(CMD_URB << 16 | (3 - 2)); OUT_BATCH(((brw->urb.vs_size - 1) << GEN6_URB_VS_SIZE_SHIFT) | - ((brw->urb.nr_vs_entries) << GEN6_URB_VS_SIZE_SHIFT)); + ((brw->urb.nr_vs_entries) << GEN6_URB_VS_ENTRIES_SHIFT)); OUT_BATCH(((brw->urb.vs_size - 1) << GEN6_URB_GS_SIZE_SHIFT) | - ((brw->urb.nr_gs_entries) << GEN6_URB_GS_SIZE_SHIFT)); + ((brw->urb.nr_gs_entries) << GEN6_URB_GS_ENTRIES_SHIFT)); ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); -- cgit v1.2.3 From dedfc0e6e606594b9b1772c6b0689f7fa547c3aa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 14:05:27 -0800 Subject: i965: Fix the SNB clip near VP API bit. --- src/mesa/drivers/dri/i965/brw_defines.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 2bb3448da7..76ae17c96a 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -879,7 +879,8 @@ # define GEN6_CLIP_STATISTICS_ENABLE (1 << 10) /* DW2 */ # define GEN6_CLIP_ENABLE (1 << 31) -# define GEN6_CLIP_API_OGL (1 << 30) +# define GEN6_CLIP_API_OGL (0 << 30) +# define GEN6_CLIP_API_D3D (1 << 30) # define GEN6_CLIP_XY_TEST (1 << 28) # define GEN6_CLIP_Z_TEST (1 << 27) # define GEN6_CLIP_GB_TEST (1 << 26) -- cgit v1.2.3 From 89cce536cbc55460bc534acc06ea9f4d9ae71016 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 14:24:36 -0800 Subject: i965: Don't include SNB in has_negative_rhw_bug. --- src/mesa/drivers/dri/i965/brw_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 3614149966..a512896f31 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -170,7 +170,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, brw->urb.size = 384; brw->vs_max_threads = 32; brw->wm_max_threads = 10 * 5; - } else { + } else if (intel->gen < 6) { brw->urb.size = 256; brw->vs_max_threads = 16; brw->wm_max_threads = 8 * 4; -- cgit v1.2.3 From fc26f894babc47dd3a823bd4d63ee4d8ee0dad04 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 14:27:07 -0800 Subject: intel: Fix up INTEL_NO_HW support. This was accidentally (it seems) deleted in 5203b7227ccb6b618fa42f08434d4a3cf123dca2 --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 4c99dcde23..e38f10ebc6 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -104,7 +104,8 @@ do_flush_locked(struct intel_batchbuffer *batch, GLuint used) batch->map = NULL; batch->ptr = NULL; - dri_bo_exec(batch->buf, used, NULL, 0, (x_off & 0xffff) | (y_off << 16)); + if (!intel->no_hw) + dri_bo_exec(batch->buf, used, NULL, 0, (x_off & 0xffff) | (y_off << 16)); if (INTEL_DEBUG & DEBUG_BATCH) { dri_bo_map(batch->buf, GL_FALSE); -- cgit v1.2.3 From d790564f9452d6fa0378346a85c792aa346c1a57 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 15:22:20 -0800 Subject: i965: Fix the SNB VE valid bit. So, when the docs say that 0 means enabled now? That's a lie. --- src/mesa/drivers/dri/i965/brw_defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 76ae17c96a..bb1b5f5ef0 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -806,7 +806,7 @@ # define GEN6_VE0_INDEX_SHIFT 26 # define BRW_VE0_FORMAT_SHIFT 16 # define BRW_VE0_VALID (1 << 26) -# define GEN6_VE0_VALID (0 << 25) +# define GEN6_VE0_VALID (1 << 25) # define BRW_VE0_SRC_OFFSET_SHIFT 0 # define BRW_VE1_COMPONENT_NOSTORE 0 # define BRW_VE1_COMPONENT_STORE_SRC 1 -- cgit v1.2.3 From 1d7aec053b061caef928cfffc786660603d5f14c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 15:23:13 -0800 Subject: i965: Lump SNB in with Ironlake for bigger VUEs. This gets the VS to the point of accepting vertices. \o/ --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index b6e5f945eb..4e3338293b 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -279,7 +279,7 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) */ attributes_in_vue = MAX2(c->nr_outputs, c->nr_inputs); - if (intel->is_ironlake) + if (intel->is_ironlake || intel->gen >= 6) c->prog_data.urb_entry_size = (attributes_in_vue + 6 + 3) / 4; else c->prog_data.urb_entry_size = (attributes_in_vue + 2 + 3) / 4; @@ -1273,7 +1273,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) brw_set_access_mode(p, BRW_ALIGN_1); brw_MOV(p, offset(m0, 2), ndc); - if (intel->is_ironlake) { + if (intel->is_ironlake || intel->gen >= 6) { /* There are 20 DWs (D0-D19) in VUE vertex header on Ironlake */ brw_MOV(p, offset(m0, 3), pos); /* a portion of vertex header */ /* m4, m5 contain the distances from vertex to the user clip planeXXX. -- cgit v1.2.3 From 54ea39f768871eb10286b195e1cd77f757c99752 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 16:25:17 -0800 Subject: i965: Don't set a nonexistent enable bit in several SNB state pointers. The modify bit is now usually in the instruction header. The exception is CC state pointers. --- src/mesa/drivers/dri/i965/gen6_sampler_state.c | 2 +- src/mesa/drivers/dri/i965/gen6_scissor_state.c | 2 +- src/mesa/drivers/dri/i965/gen6_viewport_state.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_sampler_state.c b/src/mesa/drivers/dri/i965/gen6_sampler_state.c index 641d8859b3..f5d537b1cf 100644 --- a/src/mesa/drivers/dri/i965/gen6_sampler_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sampler_state.c @@ -47,7 +47,7 @@ upload_sampler_state_pointers(struct brw_context *brw) OUT_BATCH(0); /* VS */ OUT_BATCH(0); /* GS */ if (brw->wm.sampler_bo) - OUT_RELOC(brw->wm.sampler_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + OUT_RELOC(brw->wm.sampler_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); else OUT_BATCH(0); diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c index 2d36f0056d..81ebbf4ddf 100644 --- a/src/mesa/drivers/dri/i965/gen6_scissor_state.c +++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c @@ -85,7 +85,7 @@ static void upload_scissor_state_pointers(struct brw_context *brw) BEGIN_BATCH(2); OUT_BATCH(CMD_3D_SCISSOR_STATE_POINTERS << 16 | (2 - 2)); - OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + OUT_RELOC(brw->sf.state_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c index 13d2fc1b42..df3cbfb224 100644 --- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c @@ -154,9 +154,9 @@ static void upload_viewport_state_pointers(struct brw_context *brw) GEN6_CC_VIEWPORT_MODIFY | GEN6_SF_VIEWPORT_MODIFY | GEN6_CLIP_VIEWPORT_MODIFY); - OUT_RELOC(brw->clip.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); - OUT_RELOC(brw->sf.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); - OUT_RELOC(brw->cc.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 1); + OUT_RELOC(brw->clip.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_RELOC(brw->sf.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); + OUT_RELOC(brw->cc.vp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0); ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); -- cgit v1.2.3 From c8e5100a3910fd9b36d4424ef94c0581982f0b1a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 17:58:04 -0800 Subject: i965: Fix up the VUE handling for SNB, and hopefully clarify comments. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 74 ++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 4e3338293b..e0be3cc6e3 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -180,10 +180,12 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) c->first_output = reg; c->first_overflow_output = 0; - if (intel->is_ironlake) - mrf = 8; + if (intel->gen >= 6) + mrf = 6; + else if (intel->is_ironlake) + mrf = 8; else - mrf = 4; + mrf = 4; for (i = 0; i < VERT_RESULT_MAX; i++) { if (c->prog_data.outputs_written & BITFIELD64_BIT(i)) { @@ -1195,7 +1197,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) struct brw_reg pos = c->regs[PROGRAM_OUTPUT][VERT_RESULT_HPOS]; struct brw_reg ndc; int eot; - GLuint len_vertext_header = 2; + GLuint len_vertex_header = 2; if (c->key.copy_edgeflag) { brw_MOV(p, @@ -1203,12 +1205,14 @@ static void emit_vertex_write( struct brw_vs_compile *c) get_reg(c, PROGRAM_INPUT, VERT_ATTRIB_EDGEFLAG)); } - /* Build ndc coords */ - ndc = get_tmp(c); - /* ndc = 1.0 / pos.w */ - emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); - /* ndc.xyz = pos * ndc */ - brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); + if (intel->gen < 6) { + /* Build ndc coords */ + ndc = get_tmp(c); + /* ndc = 1.0 / pos.w */ + emit_math1(c, BRW_MATH_FUNCTION_INV, ndc, brw_swizzle1(pos, 3), BRW_MATH_PRECISION_FULL); + /* ndc.xyz = pos * ndc */ + brw_MUL(p, brw_writemask(ndc, WRITEMASK_XYZ), pos, ndc); + } /* Update the header for point size, user clipping flags, and -ve rhw * workaround. @@ -1271,21 +1275,41 @@ static void emit_vertex_write( struct brw_vs_compile *c) * of zeros followed by two sets of NDC coordinates: */ brw_set_access_mode(p, BRW_ALIGN_1); - brw_MOV(p, offset(m0, 2), ndc); - - if (intel->is_ironlake || intel->gen >= 6) { - /* There are 20 DWs (D0-D19) in VUE vertex header on Ironlake */ - brw_MOV(p, offset(m0, 3), pos); /* a portion of vertex header */ - /* m4, m5 contain the distances from vertex to the user clip planeXXX. - * Seems it is useless for us. - * m6 is used for aligning, so that the remainder of vertex element is - * reg-aligned. - */ - brw_MOV(p, offset(m0, 7), pos); /* the remainder of vertex element */ - len_vertext_header = 6; + + if (intel->gen >= 6) { + /* There are 16 DWs (D0-D15) in VUE header on Sandybridge: + * dword 0-3 (m1) of the header is indices, point width, clip flags. + * dword 4-7 (m2) is the 4D space position + * dword 8-15 (m3,m4) of the vertex header is the user clip distance. + * m5 is the first vertex data we fill, which is the vertex position. + */ + brw_MOV(p, offset(m0, 2), pos); + brw_MOV(p, offset(m0, 5), pos); + len_vertex_header = 4; + } else if (intel->is_ironlake) { + /* There are 20 DWs (D0-D19) in VUE header on Ironlake: + * dword 0-3 (m1) of the header is indices, point width, clip flags. + * dword 4-7 (m2) is the ndc position (set above) + * dword 8-11 (m3) of the vertex header is the 4D space position + * dword 12-19 (m4,m5) of the vertex header is the user clip distance. + * m6 is a pad so that the vertex element data is aligned + * m7 is the first vertex data we fill, which is the vertex position. + */ + brw_MOV(p, offset(m0, 2), ndc); + brw_MOV(p, offset(m0, 3), pos); + brw_MOV(p, offset(m0, 7), pos); + len_vertex_header = 6; } else { - brw_MOV(p, offset(m0, 3), pos); - len_vertext_header = 2; + /* There are 8 dwords in VUE header pre-Ironlake: + * dword 0-3 (m1) is indices, point width, clip flags. + * dword 4-7 (m2) is ndc position (set above) + * + * dword 8-11 (m3) is the first vertex data, which we always have be the + * vertex position. + */ + brw_MOV(p, offset(m0, 2), ndc); + brw_MOV(p, offset(m0, 3), pos); + len_vertex_header = 2; } eot = (c->first_overflow_output == 0); @@ -1296,7 +1320,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) c->r0, /* src */ 0, /* allocate */ 1, /* used */ - MIN2(c->nr_outputs + 1 + len_vertext_header, (BRW_MAX_MRF-1)), /* msg len */ + MIN2(c->nr_outputs + 1 + len_vertex_header, (BRW_MAX_MRF-1)), /* msg len */ 0, /* response len */ eot, /* eot */ eot, /* writes complete */ -- cgit v1.2.3 From 839e6bd8b90a124e88020d54ded46460b2a3bc2d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 18:35:08 -0800 Subject: i965: Try to hook up the Sandybridge URB_WRITE SEND message. My units still hang when doing this if the VS is enabled. --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 2d55299ddb..f69d529613 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -102,8 +102,6 @@ static void brw_set_dest( struct brw_instruction *insn, static void brw_set_src0( struct brw_instruction *insn, struct brw_reg reg ) { - assert(reg.file != BRW_MESSAGE_REGISTER_FILE); - if (reg.type != BRW_ARCHITECTURE_REGISTER_FILE) assert(reg.nr < 128); @@ -323,7 +321,7 @@ static void brw_set_urb_message( struct brw_context *brw, struct intel_context *intel = &brw->intel; brw_set_src1(insn, brw_imm_d(0)); - if (intel->is_ironlake) { + if (intel->is_ironlake || intel->gen >= 6) { insn->bits3.urb_igdng.opcode = 0; /* ? */ insn->bits3.urb_igdng.offset = offset; insn->bits3.urb_igdng.swizzle_control = swizzle_control; @@ -334,8 +332,16 @@ static void brw_set_urb_message( struct brw_context *brw, insn->bits3.urb_igdng.response_length = response_length; insn->bits3.urb_igdng.msg_length = msg_length; insn->bits3.urb_igdng.end_of_thread = end_of_thread; - insn->bits2.send_igdng.sfid = BRW_MESSAGE_TARGET_URB; - insn->bits2.send_igdng.end_of_thread = end_of_thread; + if (intel->gen >= 6) { + /* For SNB, the SFID bits moved to the condmod bits, and + * EOT stayed in bits3 above. Does the EOT bit setting + * below on Ironlake even do anything? + */ + insn->header.destreg__conditionalmod = BRW_MESSAGE_TARGET_URB; + } else { + insn->bits2.send_igdng.sfid = BRW_MESSAGE_TARGET_URB; + insn->bits2.send_igdng.end_of_thread = end_of_thread; + } } else { insn->bits3.urb.opcode = 0; /* ? */ insn->bits3.urb.offset = offset; @@ -1391,7 +1397,18 @@ void brw_urb_WRITE(struct brw_compile *p, GLuint offset, GLuint swizzle) { - struct brw_instruction *insn = next_insn(p, BRW_OPCODE_SEND); + struct intel_context *intel = &p->brw->intel; + struct brw_instruction *insn; + + /* Sandybridge doesn't have the implied move for SENDs, + * and the first message register index comes from src0. + */ + if (intel->gen >= 6) { + brw_MOV(p, brw_message_reg(msg_reg_nr), src0); + src0 = brw_message_reg(msg_reg_nr); + } + + insn = next_insn(p, BRW_OPCODE_SEND); assert(msg_length < BRW_MAX_MRF); @@ -1399,7 +1416,8 @@ void brw_urb_WRITE(struct brw_compile *p, brw_set_src0(insn, src0); brw_set_src1(insn, brw_imm_d(0)); - insn->header.destreg__conditionalmod = msg_reg_nr; + if (intel->gen < 6) + insn->header.destreg__conditionalmod = msg_reg_nr; brw_set_urb_message(p->brw, insn, -- cgit v1.2.3 From a858bc393ec431f836bea275edb4437fe41adc75 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:03:24 -0700 Subject: mesa: added renderbuffer->_BaseFormat assertion --- src/mesa/main/renderbuffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index c44db255d6..4276b23b69 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1143,6 +1143,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; rb->_BaseFormat = _mesa_base_fbo_format(ctx, rb->InternalFormat); + ASSERT(rb->_BaseFormat); return GL_TRUE; } -- cgit v1.2.3 From a8dafe713f4b45fd09c678e1ca9fbe4eab16f8be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:03:55 -0700 Subject: mesa: remove redundant call to _mesa_base_fbo_format() --- src/mesa/main/fbobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 4ce3998812..14c533e0d4 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -987,7 +987,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, assert(rb->Width == (GLuint) width); assert(rb->Height == (GLuint) height); rb->InternalFormat = internalFormat; - rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + rb->_BaseFormat = baseFormat; assert(rb->_BaseFormat != 0); } else { -- cgit v1.2.3 From 2c1619869a9af1420e0a23b65e31d40a694b7f46 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:04:21 -0700 Subject: mesa: added cases for texture array targets --- src/mesa/shader/prog_print.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 765aa003b7..f66c240ce7 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -649,6 +649,8 @@ _mesa_fprint_instruction_opt(FILE *f, case TEXTURE_3D_INDEX: fprintf(f, "3D"); break; case TEXTURE_CUBE_INDEX: fprintf(f, "CUBE"); break; case TEXTURE_RECT_INDEX: fprintf(f, "RECT"); break; + case TEXTURE_1D_ARRAY_INDEX: fprintf(f, "1D_ARRAY"); break; + case TEXTURE_2D_ARRAY_INDEX: fprintf(f, "2D_ARRAY"); break; default: ; } -- cgit v1.2.3 From ac498f2dce6a0d4e78ed2a78b567d61fe6569970 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:05:11 -0700 Subject: mesa: added texture array targets in sizeof_glsl_type() --- src/mesa/shader/shader_api.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index d0d0575b0b..940fe2d03c 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -769,6 +769,8 @@ sizeof_glsl_type(GLenum type) case GL_SAMPLER_2D_SHADOW: case GL_SAMPLER_2D_RECT_ARB: case GL_SAMPLER_2D_RECT_SHADOW_ARB: + case GL_SAMPLER_1D_ARRAY_EXT: + case GL_SAMPLER_2D_ARRAY_EXT: case GL_SAMPLER_1D_ARRAY_SHADOW_EXT: case GL_SAMPLER_2D_ARRAY_SHADOW_EXT: case GL_SAMPLER_CUBE_SHADOW_EXT: @@ -848,6 +850,8 @@ is_sampler_type(GLenum type) case GL_SAMPLER_2D_RECT_SHADOW_ARB: case GL_SAMPLER_1D_ARRAY_EXT: case GL_SAMPLER_2D_ARRAY_EXT: + case GL_SAMPLER_1D_ARRAY_SHADOW_EXT: + case GL_SAMPLER_2D_ARRAY_SHADOW_EXT: return GL_TRUE; default: return GL_FALSE; -- cgit v1.2.3 From 58ab56d32308e36f331294047e11c3e0b4b73cde Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:06:27 -0700 Subject: swrast: the only wrap mode for selecting texture array slices is clamp --- src/mesa/swrast/s_texfilter.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index ff7deecc39..478fb1557f 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -474,6 +474,18 @@ clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, } +/** + * Compute slice/image to use for 1D or 2D array texture. + */ +static INLINE GLint +tex_array_slice(GLfloat coord, GLsizei size) +{ + GLint slice = IFLOOR(coord); + slice = CLAMP(slice, 0, size - 1); + return slice; +} + + /** * Compute nearest integer texcoords for given texobj and coordinate. */ @@ -506,13 +518,13 @@ nearest_texcoord(const struct gl_texture_object *texObj, break; case GL_TEXTURE_1D_ARRAY_EXT: *i = nearest_texel_location(texObj->WrapS, img, width, texcoord[0]); - *j = clamp_rect_coord_nearest(texObj->WrapT, texcoord[1], height); + *j = tex_array_slice(texcoord[1], height); *k = 0; break; case GL_TEXTURE_2D_ARRAY_EXT: *i = nearest_texel_location(texObj->WrapS, img, width, texcoord[0]); *j = nearest_texel_location(texObj->WrapT, img, height, texcoord[1]); - *k = clamp_rect_coord_nearest(texObj->WrapR, texcoord[2], depth); + *k = tex_array_slice(texcoord[2], depth); break; default: *i = *j = *k = 0; @@ -556,7 +568,7 @@ linear_texcoord(const struct gl_texture_object *texObj, case GL_TEXTURE_1D_ARRAY_EXT: linear_texel_locations(texObj->WrapS, img, width, texcoord[0], i0, i1, wi); - *j0 = clamp_rect_coord_nearest(texObj->WrapT, texcoord[1], height); + *j0 = tex_array_slice(texcoord[1], height); *j1 = *j0; *slice = 0; break; @@ -566,7 +578,7 @@ linear_texcoord(const struct gl_texture_object *texObj, texcoord[0], i0, i1, wi); linear_texel_locations(texObj->WrapT, img, height, texcoord[1], j0, j1, wj); - *slice = clamp_rect_coord_nearest(texObj->WrapR, texcoord[2], depth); + *slice = tex_array_slice(texcoord[2], depth); break; default: @@ -2269,7 +2281,6 @@ sample_lambda_rect(GLcontext *ctx, } - /**********************************************************************/ /* 2D Texture Array Sampling Functions */ /**********************************************************************/ @@ -2293,7 +2304,7 @@ sample_2d_array_nearest(GLcontext *ctx, i = nearest_texel_location(tObj->WrapS, img, width, texcoord[0]); j = nearest_texel_location(tObj->WrapT, img, height, texcoord[1]); - array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); + array = tex_array_slice(texcoord[2], depth); if (i < 0 || i >= (GLint) img->Width || j < 0 || j >= (GLint) img->Height || @@ -2328,7 +2339,7 @@ sample_2d_array_linear(GLcontext *ctx, linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); linear_texel_locations(tObj->WrapT, img, height, texcoord[1], &j0, &j1, &b); - array = clamp_rect_coord_nearest(tObj->WrapR, texcoord[2], depth); + array = tex_array_slice(texcoord[2], depth); if (array < 0 || array >= depth) { COPY_4V(rgba, tObj->BorderColor.f); @@ -2601,7 +2612,7 @@ sample_1d_array_nearest(GLcontext *ctx, (void) ctx; i = nearest_texel_location(tObj->WrapS, img, width, texcoord[0]); - array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); + array = tex_array_slice(texcoord[1], height); if (i < 0 || i >= (GLint) img->Width || array < 0 || array >= (GLint) img->Height) { @@ -2633,7 +2644,7 @@ sample_1d_array_linear(GLcontext *ctx, GLfloat t0[4], t1[4]; linear_texel_locations(tObj->WrapS, img, width, texcoord[0], &i0, &i1, &a); - array = clamp_rect_coord_nearest(tObj->WrapT, texcoord[1], height); + array = tex_array_slice(texcoord[1], height); if (img->Border) { i0 += img->Border; -- cgit v1.2.3 From 1edd444c2e9afadb56df55682ae606b5cefd811c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:08:02 -0700 Subject: mesa: added new extension flag for GL_EXT_texture_array --- src/mesa/main/extensions.c | 1 + src/mesa/main/mtypes.h | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 2c1120e19f..44190c7732 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -131,6 +131,7 @@ static const struct { { ON, "GL_EXT_subtexture", F(EXT_subtexture) }, { ON, "GL_EXT_texture", F(EXT_texture) }, { ON, "GL_EXT_texture3D", F(EXT_texture3D) }, + { OFF, "GL_EXT_texture_array", F(EXT_texture_array) }, { OFF, "GL_EXT_texture_compression_s3tc", F(EXT_texture_compression_s3tc) }, { OFF, "GL_EXT_texture_cube_map", F(ARB_texture_cube_map) }, { ON, "GL_EXT_texture_edge_clamp", F(SGIS_texture_edge_clamp) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 20035417b9..e0ee3c9f5d 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2474,6 +2474,7 @@ struct gl_extensions GLboolean EXT_texture; GLboolean EXT_texture_object; GLboolean EXT_texture3D; + GLboolean EXT_texture_array; GLboolean EXT_texture_compression_s3tc; GLboolean EXT_texture_env_add; GLboolean EXT_texture_env_combine; -- cgit v1.2.3 From 1f2b495b5567897acbd236f302a1e2b9b5faec65 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:45:45 -0700 Subject: glsl: implement support for GL_EXT_texture_array GL_EXT_texture_array is different from the existing GL_MESA_texture_array support in that the former is only supported for GLSL, not fixed-function. The shadow compare versions of the sampler functions haven't been tested yet. The non-shadow versions have been tested with a new piglit test. --- src/glsl/cl/sl_cl_parse.c | 31 +++++++++ .../shader/slang/library/slang_common_builtin.gc | 12 ++++ .../shader/slang/library/slang_fragment_builtin.gc | 64 ++++++++++++++++++ .../shader/slang/library/slang_vertex_builtin.gc | 20 ++++++ src/mesa/shader/slang/slang_codegen.c | 76 ++++++++++++++-------- src/mesa/shader/slang/slang_compile.c | 44 +++++++++---- src/mesa/shader/slang/slang_print.c | 28 ++++---- src/mesa/shader/slang/slang_storage.c | 21 +++--- src/mesa/shader/slang/slang_typeinfo.c | 44 ++++++++----- src/mesa/shader/slang/slang_typeinfo.h | 20 +++--- 10 files changed, 277 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 9a20509fc6..771bdfd082 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -161,6 +161,12 @@ #define TYPE_SPECIFIER_MAT34 30 #define TYPE_SPECIFIER_MAT43 31 +/* GL_EXT_texture_array */ +#define TYPE_SPECIFIER_SAMPLER_1D_ARRAY 32 +#define TYPE_SPECIFIER_SAMPLER_2D_ARRAY 33 +#define TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW 34 +#define TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW 35 + /* type specifier array */ #define TYPE_SPECIFIER_NONARRAY 0 #define TYPE_SPECIFIER_ARRAY 1 @@ -281,6 +287,10 @@ struct parse_dict { int sampler2DShadow; int sampler2DRect; int sampler2DRectShadow; + int sampler1DArray; + int sampler2DArray; + int sampler1DArrayShadow; + int sampler2DArrayShadow; int invariant; @@ -1028,6 +1038,15 @@ _parse_type_specifier_nonarray(struct parse_context *ctx, _update(ctx, e, TYPE_SPECIFIER_SAMPLER2DRECT); } else if (id == ctx->dict.sampler2DRectShadow) { _update(ctx, e, TYPE_SPECIFIER_SAMPLER2DRECTSHADOW); + } else if (id == ctx->dict.sampler1DArray) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER_1D_ARRAY); + } else if (id == ctx->dict.sampler2DArray) { + /* XXX check for GL_EXT_texture_array */ + _update(ctx, e, TYPE_SPECIFIER_SAMPLER_2D_ARRAY); + } else if (id == ctx->dict.sampler1DArrayShadow) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW); + } else if (id == ctx->dict.sampler2DArrayShadow) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW); } else if (_parse_identifier(ctx, &p) == 0) { _update(ctx, e, TYPE_SPECIFIER_TYPENAME); *ps = p; @@ -1944,6 +1963,14 @@ _parse_prectype(struct parse_context *ctx, type = TYPE_SPECIFIER_SAMPLER2DRECT; } else if (id == ctx->dict.sampler2DRectShadow) { type = TYPE_SPECIFIER_SAMPLER2DRECTSHADOW; + } else if (id == ctx->dict.sampler1DArray) { + type = TYPE_SPECIFIER_SAMPLER_1D_ARRAY; + } else if (id == ctx->dict.sampler2DArray) { + type = TYPE_SPECIFIER_SAMPLER_2D_ARRAY; + } else if (id == ctx->dict.sampler1DArrayShadow) { + type = TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW; + } else if (id == ctx->dict.sampler2DArrayShadow) { + type = TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW; } else { return -1; } @@ -2886,6 +2913,10 @@ sl_cl_compile(struct sl_pp_context *context, ADD_NAME(ctx, sampler2DShadow); ADD_NAME(ctx, sampler2DRect); ADD_NAME(ctx, sampler2DRectShadow); + ADD_NAME(ctx, sampler1DArray); + ADD_NAME(ctx, sampler2DArray); + ADD_NAME(ctx, sampler1DArrayShadow); + ADD_NAME(ctx, sampler2DArrayShadow); ADD_NAME(ctx, invariant); diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 56de47ee8d..8b7771c284 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1769,6 +1769,18 @@ vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) +//// GL_EXT_texture_array +vec4 texture1DArray(const sampler1DArray sampler, const vec2 coord) +{ + __asm vec4_tex_1d_array __retVal, sampler, coord; +} + +vec4 texture2DArray(const sampler2DArray sampler, const vec3 coord) +{ + __asm vec4_tex_2d_array __retVal, sampler, coord; +} + + // // 8.9 Noise Functions // diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin.gc b/src/mesa/shader/slang/library/slang_fragment_builtin.gc index 2e063e6416..54a80ea0e0 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin.gc +++ b/src/mesa/shader/slang/library/slang_fragment_builtin.gc @@ -165,6 +165,70 @@ vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float b +//// GL_EXT_texture_array + +vec4 texture1DArray(const sampler1DArray sampler, const vec2 coord) +{ + vec4 coord4; + coord4.xy = coord; + __asm vec4_tex_1d_array __retVal, sampler, coord4; +} + +vec4 texture1DArray(const sampler1DArray sampler, const vec2 coord, const float bias) +{ + vec4 coord4; + coord4.xy = coord; + coord4.w = bias; + __asm vec4_tex_1d_array_bias __retVal, sampler, coord4; +} + +vec4 texure2DArray(const sampler2DArray sampler, const vec3 coord) +{ + vec4 coord4; + coord4.xyz = coord; + __asm vec4_tex_2d_array __retVal, sampler, coord4; +} + +vec4 texture2DArray(const sampler2DArray sampler, const vec3 coord, const float bias) +{ + vec4 coord4; + coord4.xyz = coord; + coord4.w = bias; + __asm vec4_tex_2d_array_bias __retVal, sampler, coord4; +} + +vec4 shadow1DArray(const sampler1DArrayShadow sampler, const vec2 coord) +{ + vec4 coord4; + coord4.xy = coord; + __asm vec4_tex_1d_array_shadow __retVal, sampler, coord4; +} + +vec4 shadow1DArray(const sampler1DArrayShadow sampler, const vec2 coord, const float bias) +{ + vec4 coord4; + coord4.xy = coord; + coord4.w = bias; + __asm vec4_tex_1d_array_bias_shadow __retVal, sampler, coord4; +} + +vec4 shadow2DArray(const sampler2DArrayShadow sampler, const vec3 coord) +{ + vec4 coord4; + coord4.xyz = coord; + __asm vec4_tex_2d_array_shadow __retVal, sampler, coord4; +} + +vec4 shadow2DArray(const sampler2DArrayShadow sampler, const vec3 coord, const float bias) +{ + vec4 coord4; + coord4.xyz = coord; + coord4.w = bias; + __asm vec4_tex_2d_array_bias_shadow __retVal, sampler, coord4; +} + + + // // 8.8 Fragment Processing Functions // diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin.gc b/src/mesa/shader/slang/library/slang_vertex_builtin.gc index 9ad5f35425..0c67c2ef20 100644 --- a/src/mesa/shader/slang/library/slang_vertex_builtin.gc +++ b/src/mesa/shader/slang/library/slang_vertex_builtin.gc @@ -188,3 +188,23 @@ vec4 shadow2DProjLod(const sampler2DShadow sampler, const vec4 coord, __asm vec4_tex_2d_bias_shadow __retVal, sampler, pcoord; } + +//// GL_EXT_texture_array + +vec4 texture1DArrayLod(const sampler1DArray sampler, const vec2 coord, const float lod) +{ + vec4 coord4; + coord4.xy = coord; + coord4.w = lod; + __asm vec4_tex_1d_array_bias __retVal, sampler, coord4; +} + + +vec4 texture2DArrayLod(const sampler2DArray sampler, const vec3 coord, const float lod) +{ + vec4 coord4; + coord4.xyz = coord; + coord4.w = lod; + __asm vec4_tex_2d_array_bias __retVal, sampler, coord4; +} + diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 6901b93d5d..adfea890b3 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -100,14 +100,18 @@ static GLboolean is_sampler_type(const slang_fully_specified_type *t) { switch (t->specifier.type) { - case SLANG_SPEC_SAMPLER1D: - case SLANG_SPEC_SAMPLER2D: - case SLANG_SPEC_SAMPLER3D: - case SLANG_SPEC_SAMPLERCUBE: - case SLANG_SPEC_SAMPLER1DSHADOW: - case SLANG_SPEC_SAMPLER2DSHADOW: - case SLANG_SPEC_SAMPLER2DRECT: - case SLANG_SPEC_SAMPLER2DRECTSHADOW: + case SLANG_SPEC_SAMPLER_1D: + case SLANG_SPEC_SAMPLER_2D: + case SLANG_SPEC_SAMPLER_3D: + case SLANG_SPEC_SAMPLER_CUBE: + case SLANG_SPEC_SAMPLER_1D_SHADOW: + case SLANG_SPEC_SAMPLER_2D_SHADOW: + case SLANG_SPEC_SAMPLER_RECT: + case SLANG_SPEC_SAMPLER_RECT_SHADOW: + case SLANG_SPEC_SAMPLER_1D_ARRAY: + case SLANG_SPEC_SAMPLER_2D_ARRAY: + case SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW: + case SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW: return GL_TRUE; default: return GL_FALSE; @@ -222,14 +226,18 @@ _slang_sizeof_type_specifier(const slang_type_specifier *spec) case SLANG_SPEC_MAT43: sz = 4 * 4; /* 4 columns (regs) */ break; - case SLANG_SPEC_SAMPLER1D: - case SLANG_SPEC_SAMPLER2D: - case SLANG_SPEC_SAMPLER3D: - case SLANG_SPEC_SAMPLERCUBE: - case SLANG_SPEC_SAMPLER1DSHADOW: - case SLANG_SPEC_SAMPLER2DSHADOW: - case SLANG_SPEC_SAMPLER2DRECT: - case SLANG_SPEC_SAMPLER2DRECTSHADOW: + case SLANG_SPEC_SAMPLER_1D: + case SLANG_SPEC_SAMPLER_2D: + case SLANG_SPEC_SAMPLER_3D: + case SLANG_SPEC_SAMPLER_CUBE: + case SLANG_SPEC_SAMPLER_1D_SHADOW: + case SLANG_SPEC_SAMPLER_2D_SHADOW: + case SLANG_SPEC_SAMPLER_RECT: + case SLANG_SPEC_SAMPLER_RECT_SHADOW: + case SLANG_SPEC_SAMPLER_1D_ARRAY: + case SLANG_SPEC_SAMPLER_2D_ARRAY: + case SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW: + case SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW: sz = 1; /* a sampler is basically just an integer index */ break; case SLANG_SPEC_STRUCT: @@ -310,22 +318,30 @@ static GLint sampler_to_texture_index(const slang_type_specifier_type type) { switch (type) { - case SLANG_SPEC_SAMPLER1D: + case SLANG_SPEC_SAMPLER_1D: return TEXTURE_1D_INDEX; - case SLANG_SPEC_SAMPLER2D: + case SLANG_SPEC_SAMPLER_2D: return TEXTURE_2D_INDEX; - case SLANG_SPEC_SAMPLER3D: + case SLANG_SPEC_SAMPLER_3D: return TEXTURE_3D_INDEX; - case SLANG_SPEC_SAMPLERCUBE: + case SLANG_SPEC_SAMPLER_CUBE: return TEXTURE_CUBE_INDEX; - case SLANG_SPEC_SAMPLER1DSHADOW: + case SLANG_SPEC_SAMPLER_1D_SHADOW: return TEXTURE_1D_INDEX; /* XXX fix */ - case SLANG_SPEC_SAMPLER2DSHADOW: + case SLANG_SPEC_SAMPLER_2D_SHADOW: return TEXTURE_2D_INDEX; /* XXX fix */ - case SLANG_SPEC_SAMPLER2DRECT: + case SLANG_SPEC_SAMPLER_RECT: return TEXTURE_RECT_INDEX; - case SLANG_SPEC_SAMPLER2DRECTSHADOW: + case SLANG_SPEC_SAMPLER_RECT_SHADOW: return TEXTURE_RECT_INDEX; /* XXX fix */ + case SLANG_SPEC_SAMPLER_1D_ARRAY: + return TEXTURE_1D_ARRAY_INDEX; + case SLANG_SPEC_SAMPLER_2D_ARRAY: + return TEXTURE_2D_ARRAY_INDEX; + case SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW: + return TEXTURE_1D_ARRAY_INDEX; + case SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW: + return TEXTURE_2D_ARRAY_INDEX; default: return -1; } @@ -453,6 +469,14 @@ static slang_asm_info AsmInfo[] = { { "vec4_tex_cube", IR_TEX, 1, 2 }, /* cubemap */ { "vec4_tex_rect", IR_TEX, 1, 2 }, /* rectangle */ { "vec4_tex_rect_bias", IR_TEX, 1, 2 }, /* rectangle w/ projection */ + { "vec4_tex_1d_array", IR_TEX, 1, 2 }, + { "vec4_tex_1d_array_bias", IR_TEXB, 1, 2 }, + { "vec4_tex_1d_array_shadow", IR_TEX, 1, 2 }, + { "vec4_tex_1d_array_bias_shadow", IR_TEXB, 1, 2 }, + { "vec4_tex_2d_array", IR_TEX, 1, 2 }, + { "vec4_tex_2d_array_bias", IR_TEXB, 1, 2 }, + { "vec4_tex_2d_array_shadow", IR_TEX, 1, 2 }, + { "vec4_tex_2d_array_bias_shadow", IR_TEXB, 1, 2 }, /* texture / sampler but with shadow comparison */ { "vec4_tex_1d_shadow", IR_TEX_SH, 1, 2 }, @@ -4923,8 +4947,8 @@ is_rect_sampler_spec(const slang_type_specifier *spec) while (spec->_array) { spec = spec->_array; } - return spec->type == SLANG_SPEC_SAMPLER2DRECT || - spec->type == SLANG_SPEC_SAMPLER2DRECTSHADOW; + return spec->type == SLANG_SPEC_SAMPLER_RECT || + spec->type == SLANG_SPEC_SAMPLER_RECT_SHADOW; } diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 4280698cc9..b95c15fea6 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -55,7 +55,7 @@ /** re-defined below, should be the same though */ -#define TYPE_SPECIFIER_COUNT 32 +#define TYPE_SPECIFIER_COUNT 36 /** @@ -742,13 +742,18 @@ parse_type_qualifier(slang_parse_ctx * C, slang_type_qualifier * qual) #define TYPE_SPECIFIER_MAT42 29 #define TYPE_SPECIFIER_MAT34 30 #define TYPE_SPECIFIER_MAT43 31 -#define TYPE_SPECIFIER_COUNT 32 +#define TYPE_SPECIFIER_SAMPLER_1D_ARRAY 32 +#define TYPE_SPECIFIER_SAMPLER_2D_ARRAY 33 +#define TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW 34 +#define TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW 35 +#define TYPE_SPECIFIER_COUNT 36 static int parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O, slang_type_specifier * spec) { - switch (*C->I++) { + int type = *C->I++; + switch (type) { case TYPE_SPECIFIER_VOID: spec->type = SLANG_SPEC_VOID; break; @@ -816,28 +821,40 @@ parse_type_specifier(slang_parse_ctx * C, slang_output_ctx * O, spec->type = SLANG_SPEC_MAT43; break; case TYPE_SPECIFIER_SAMPLER1D: - spec->type = SLANG_SPEC_SAMPLER1D; + spec->type = SLANG_SPEC_SAMPLER_1D; break; case TYPE_SPECIFIER_SAMPLER2D: - spec->type = SLANG_SPEC_SAMPLER2D; + spec->type = SLANG_SPEC_SAMPLER_2D; break; case TYPE_SPECIFIER_SAMPLER3D: - spec->type = SLANG_SPEC_SAMPLER3D; + spec->type = SLANG_SPEC_SAMPLER_3D; break; case TYPE_SPECIFIER_SAMPLERCUBE: - spec->type = SLANG_SPEC_SAMPLERCUBE; + spec->type = SLANG_SPEC_SAMPLER_CUBE; break; case TYPE_SPECIFIER_SAMPLER2DRECT: - spec->type = SLANG_SPEC_SAMPLER2DRECT; + spec->type = SLANG_SPEC_SAMPLER_RECT; break; case TYPE_SPECIFIER_SAMPLER1DSHADOW: - spec->type = SLANG_SPEC_SAMPLER1DSHADOW; + spec->type = SLANG_SPEC_SAMPLER_1D_SHADOW; break; case TYPE_SPECIFIER_SAMPLER2DSHADOW: - spec->type = SLANG_SPEC_SAMPLER2DSHADOW; + spec->type = SLANG_SPEC_SAMPLER_2D_SHADOW; break; case TYPE_SPECIFIER_SAMPLER2DRECTSHADOW: - spec->type = SLANG_SPEC_SAMPLER2DRECTSHADOW; + spec->type = SLANG_SPEC_SAMPLER_RECT_SHADOW; + break; + case TYPE_SPECIFIER_SAMPLER_1D_ARRAY: + spec->type = SLANG_SPEC_SAMPLER_1D_ARRAY; + break; + case TYPE_SPECIFIER_SAMPLER_2D_ARRAY: + spec->type = SLANG_SPEC_SAMPLER_2D_ARRAY; + break; + case TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW: + spec->type = SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW; + break; + case TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW: + spec->type = SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW; break; case TYPE_SPECIFIER_STRUCT: spec->type = SLANG_SPEC_STRUCT; @@ -2133,6 +2150,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, var->type.qualifier = type->qualifier; var->type.centroid = type->centroid; var->type.precision = type->precision; + var->type.specifier = type->specifier;/*new*/ var->type.variant = type->variant; var->type.layout = type->layout; var->type.array_len = type->array_len; @@ -2441,6 +2459,10 @@ parse_default_precision(slang_parse_ctx * C, slang_output_ctx * O) case TYPE_SPECIFIER_SAMPLER2DSHADOW: case TYPE_SPECIFIER_SAMPLER2DRECT: case TYPE_SPECIFIER_SAMPLER2DRECTSHADOW: + case TYPE_SPECIFIER_SAMPLER_1D_ARRAY: + case TYPE_SPECIFIER_SAMPLER_2D_ARRAY: + case TYPE_SPECIFIER_SAMPLER_1D_ARRAY_SHADOW: + case TYPE_SPECIFIER_SAMPLER_2D_ARRAY_SHADOW: /* OK */ break; default: diff --git a/src/mesa/shader/slang/slang_print.c b/src/mesa/shader/slang/slang_print.c index 6efc5b7826..3c75523c42 100644 --- a/src/mesa/shader/slang/slang_print.c +++ b/src/mesa/shader/slang/slang_print.c @@ -119,22 +119,22 @@ print_type(const slang_fully_specified_type *t) case SLANG_SPEC_MAT43: printf("mat4x3"); break; - case SLANG_SPEC_SAMPLER1D: + case SLANG_SPEC_SAMPLER_1D: printf("sampler1D"); break; - case SLANG_SPEC_SAMPLER2D: + case SLANG_SPEC_SAMPLER_2D: printf("sampler2D"); break; - case SLANG_SPEC_SAMPLER3D: + case SLANG_SPEC_SAMPLER_3D: printf("sampler3D"); break; - case SLANG_SPEC_SAMPLERCUBE: + case SLANG_SPEC_SAMPLER_CUBE: printf("samplerCube"); break; - case SLANG_SPEC_SAMPLER1DSHADOW: + case SLANG_SPEC_SAMPLER_1D_SHADOW: printf("sampler1DShadow"); break; - case SLANG_SPEC_SAMPLER2DSHADOW: + case SLANG_SPEC_SAMPLER_2D_SHADOW: printf("sampler2DShadow"); break; case SLANG_SPEC_STRUCT: @@ -783,21 +783,21 @@ slang_type_string(slang_type_specifier_type t) return "mat3"; case SLANG_SPEC_MAT4: return "mat4"; - case SLANG_SPEC_SAMPLER1D: + case SLANG_SPEC_SAMPLER_1D: return "sampler1D"; - case SLANG_SPEC_SAMPLER2D: + case SLANG_SPEC_SAMPLER_2D: return "sampler2D"; - case SLANG_SPEC_SAMPLER3D: + case SLANG_SPEC_SAMPLER_3D: return "sampler3D"; - case SLANG_SPEC_SAMPLERCUBE: + case SLANG_SPEC_SAMPLER_CUBE: return "samplerCube"; - case SLANG_SPEC_SAMPLER1DSHADOW: + case SLANG_SPEC_SAMPLER_1D_SHADOW: return "sampler1DShadow"; - case SLANG_SPEC_SAMPLER2DSHADOW: + case SLANG_SPEC_SAMPLER_2D_SHADOW: return "sampler2DShadow"; - case SLANG_SPEC_SAMPLER2DRECT: + case SLANG_SPEC_SAMPLER_RECT: return "sampler2DRect"; - case SLANG_SPEC_SAMPLER2DRECTSHADOW: + case SLANG_SPEC_SAMPLER_RECT_SHADOW: return "sampler2DRectShadow"; case SLANG_SPEC_STRUCT: return "struct"; diff --git a/src/mesa/shader/slang/slang_storage.c b/src/mesa/shader/slang/slang_storage.c index e8b0fb7747..656e15670d 100644 --- a/src/mesa/shader/slang/slang_storage.c +++ b/src/mesa/shader/slang/slang_storage.c @@ -199,14 +199,19 @@ _slang_aggregate_variable(slang_storage_aggregate * agg, case SLANG_SPEC_MAT43: return aggregate_matrix(agg, SLANG_STORE_FLOAT, 4, 3); - case SLANG_SPEC_SAMPLER1D: - case SLANG_SPEC_SAMPLER2D: - case SLANG_SPEC_SAMPLER3D: - case SLANG_SPEC_SAMPLERCUBE: - case SLANG_SPEC_SAMPLER1DSHADOW: - case SLANG_SPEC_SAMPLER2DSHADOW: - case SLANG_SPEC_SAMPLER2DRECT: - case SLANG_SPEC_SAMPLER2DRECTSHADOW: + case SLANG_SPEC_SAMPLER_1D: + case SLANG_SPEC_SAMPLER_2D: + case SLANG_SPEC_SAMPLER_3D: + case SLANG_SPEC_SAMPLER_CUBE: + case SLANG_SPEC_SAMPLER_1D_SHADOW: + case SLANG_SPEC_SAMPLER_2D_SHADOW: + case SLANG_SPEC_SAMPLER_RECT: + case SLANG_SPEC_SAMPLER_RECT_SHADOW: + case SLANG_SPEC_SAMPLER_1D_ARRAY: + case SLANG_SPEC_SAMPLER_2D_ARRAY: + case SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW: + case SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW: + return aggregate_vector(agg, SLANG_STORE_INT, 1); case SLANG_SPEC_STRUCT: return aggregate_variables(agg, spec->_struct->fields, funcs, structs, diff --git a/src/mesa/shader/slang/slang_typeinfo.c b/src/mesa/shader/slang/slang_typeinfo.c index 01e2bc4a22..0f96768b02 100644 --- a/src/mesa/shader/slang/slang_typeinfo.c +++ b/src/mesa/shader/slang/slang_typeinfo.c @@ -195,14 +195,18 @@ static const type_specifier_type_name type_specifier_type_names[] = { {"mat4x2", SLANG_SPEC_MAT42}, {"mat3x4", SLANG_SPEC_MAT34}, {"mat4x3", SLANG_SPEC_MAT43}, - {"sampler1D", SLANG_SPEC_SAMPLER1D}, - {"sampler2D", SLANG_SPEC_SAMPLER2D}, - {"sampler3D", SLANG_SPEC_SAMPLER3D}, - {"samplerCube", SLANG_SPEC_SAMPLERCUBE}, - {"sampler1DShadow", SLANG_SPEC_SAMPLER1DSHADOW}, - {"sampler2DShadow", SLANG_SPEC_SAMPLER2DSHADOW}, - {"sampler2DRect", SLANG_SPEC_SAMPLER2DRECT}, - {"sampler2DRectShadow", SLANG_SPEC_SAMPLER2DRECTSHADOW}, + {"sampler1D", SLANG_SPEC_SAMPLER_1D}, + {"sampler2D", SLANG_SPEC_SAMPLER_2D}, + {"sampler3D", SLANG_SPEC_SAMPLER_3D}, + {"samplerCube", SLANG_SPEC_SAMPLER_CUBE}, + {"sampler1DShadow", SLANG_SPEC_SAMPLER_1D_SHADOW}, + {"sampler2DShadow", SLANG_SPEC_SAMPLER_2D_SHADOW}, + {"sampler2DRect", SLANG_SPEC_SAMPLER_RECT}, + {"sampler2DRectShadow", SLANG_SPEC_SAMPLER_RECT_SHADOW}, + {"sampler1DArray", SLANG_SPEC_SAMPLER_1D_ARRAY}, + {"sampler2DArray", SLANG_SPEC_SAMPLER_2D_ARRAY}, + {"sampler1DArrayShadow", SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW}, + {"sampler2DArrayShadow", SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW}, {NULL, SLANG_SPEC_VOID} }; @@ -1138,22 +1142,30 @@ _slang_gltype_from_specifier(const slang_type_specifier *type) return GL_FLOAT_MAT3x4; case SLANG_SPEC_MAT43: return GL_FLOAT_MAT4x3; - case SLANG_SPEC_SAMPLER1D: + case SLANG_SPEC_SAMPLER_1D: return GL_SAMPLER_1D; - case SLANG_SPEC_SAMPLER2D: + case SLANG_SPEC_SAMPLER_2D: return GL_SAMPLER_2D; - case SLANG_SPEC_SAMPLER3D: + case SLANG_SPEC_SAMPLER_3D: return GL_SAMPLER_3D; - case SLANG_SPEC_SAMPLERCUBE: + case SLANG_SPEC_SAMPLER_CUBE: return GL_SAMPLER_CUBE; - case SLANG_SPEC_SAMPLER1DSHADOW: + case SLANG_SPEC_SAMPLER_1D_SHADOW: return GL_SAMPLER_1D_SHADOW; - case SLANG_SPEC_SAMPLER2DSHADOW: + case SLANG_SPEC_SAMPLER_2D_SHADOW: return GL_SAMPLER_2D_SHADOW; - case SLANG_SPEC_SAMPLER2DRECT: + case SLANG_SPEC_SAMPLER_RECT: return GL_SAMPLER_2D_RECT_ARB; - case SLANG_SPEC_SAMPLER2DRECTSHADOW: + case SLANG_SPEC_SAMPLER_RECT_SHADOW: return GL_SAMPLER_2D_RECT_SHADOW_ARB; + case SLANG_SPEC_SAMPLER_1D_ARRAY: + return GL_SAMPLER_1D_ARRAY_EXT; + case SLANG_SPEC_SAMPLER_2D_ARRAY: + return GL_SAMPLER_2D_ARRAY_EXT; + case SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW: + return GL_SAMPLER_1D_ARRAY_SHADOW_EXT; + case SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW: + return GL_SAMPLER_2D_ARRAY_SHADOW_EXT; case SLANG_SPEC_ARRAY: return _slang_gltype_from_specifier(type->_array); case SLANG_SPEC_STRUCT: diff --git a/src/mesa/shader/slang/slang_typeinfo.h b/src/mesa/shader/slang/slang_typeinfo.h index aa5f14ebc7..9a6407a31b 100644 --- a/src/mesa/shader/slang/slang_typeinfo.h +++ b/src/mesa/shader/slang/slang_typeinfo.h @@ -130,14 +130,18 @@ typedef enum slang_type_specifier_type_ SLANG_SPEC_MAT42, SLANG_SPEC_MAT34, SLANG_SPEC_MAT43, - SLANG_SPEC_SAMPLER1D, - SLANG_SPEC_SAMPLER2D, - SLANG_SPEC_SAMPLER3D, - SLANG_SPEC_SAMPLERCUBE, - SLANG_SPEC_SAMPLER2DRECT, - SLANG_SPEC_SAMPLER1DSHADOW, - SLANG_SPEC_SAMPLER2DSHADOW, - SLANG_SPEC_SAMPLER2DRECTSHADOW, + SLANG_SPEC_SAMPLER_1D, + SLANG_SPEC_SAMPLER_2D, + SLANG_SPEC_SAMPLER_3D, + SLANG_SPEC_SAMPLER_CUBE, + SLANG_SPEC_SAMPLER_RECT, + SLANG_SPEC_SAMPLER_1D_SHADOW, + SLANG_SPEC_SAMPLER_2D_SHADOW, + SLANG_SPEC_SAMPLER_RECT_SHADOW, + SLANG_SPEC_SAMPLER_1D_ARRAY, + SLANG_SPEC_SAMPLER_2D_ARRAY, + SLANG_SPEC_SAMPLER_1D_ARRAY_SHADOW, + SLANG_SPEC_SAMPLER_2D_ARRAY_SHADOW, SLANG_SPEC_STRUCT, SLANG_SPEC_ARRAY } slang_type_specifier_type; -- cgit v1.2.3 From 4db9f8361207e9377eb772df8d16413d63f55636 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 19:48:57 -0700 Subject: mesa: enable GL_EXT_texture_array for sw drivers --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 44190c7732..0e7e52a54a 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -305,6 +305,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.EXT_shared_texture_palette = GL_TRUE; ctx->Extensions.EXT_stencil_wrap = GL_TRUE; ctx->Extensions.EXT_stencil_two_side = GL_TRUE; + ctx->Extensions.EXT_texture_array = GL_TRUE; ctx->Extensions.EXT_texture_env_add = GL_TRUE; ctx->Extensions.EXT_texture_env_combine = GL_TRUE; ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; -- cgit v1.2.3 From bdbb5f8170f48713b741ad68c26464231a01ca7a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 25 Feb 2010 20:21:39 -0700 Subject: swrast: add 0.5 bias in tex_array_slice() per the spec --- src/mesa/swrast/s_texfilter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 478fb1557f..997c2f4bb7 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -480,7 +480,7 @@ clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, static INLINE GLint tex_array_slice(GLfloat coord, GLsizei size) { - GLint slice = IFLOOR(coord); + GLint slice = IFLOOR(coord + 0.5f); slice = CLAMP(slice, 0, size - 1); return slice; } -- cgit v1.2.3 From c76d4db25260dd68684bf784efacd7323c7cab8b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 25 Feb 2010 23:51:05 -0800 Subject: i965: Remove unnecessary headers. --- src/mesa/drivers/dri/i965/gen6_cc.c | 2 -- src/mesa/drivers/dri/i965/gen6_clip_state.c | 3 --- src/mesa/drivers/dri/i965/gen6_depthstencil.c | 4 ---- src/mesa/drivers/dri/i965/gen6_gs_state.c | 3 --- src/mesa/drivers/dri/i965/gen6_sampler_state.c | 3 --- src/mesa/drivers/dri/i965/gen6_scissor_state.c | 3 --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 1 - src/mesa/drivers/dri/i965/gen6_viewport_state.c | 2 -- src/mesa/drivers/dri/i965/gen6_vs_state.c | 2 -- src/mesa/drivers/dri/i965/gen6_wm_state.c | 2 -- 10 files changed, 25 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index ba1e3abe83..65e16e70c7 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -30,8 +30,6 @@ #include "brw_defines.h" #include "brw_util.h" #include "intel_batchbuffer.h" -#include "main/macros.h" -#include "main/enums.h" struct brw_blend_state_key { GLboolean color_blend, alpha_enabled; diff --git a/src/mesa/drivers/dri/i965/gen6_clip_state.c b/src/mesa/drivers/dri/i965/gen6_clip_state.c index 9fabd05341..06f8145e32 100644 --- a/src/mesa/drivers/dri/i965/gen6_clip_state.c +++ b/src/mesa/drivers/dri/i965/gen6_clip_state.c @@ -28,9 +28,6 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "brw_util.h" -#include "main/macros.h" -#include "main/enums.h" #include "intel_batchbuffer.h" static void diff --git a/src/mesa/drivers/dri/i965/gen6_depthstencil.c b/src/mesa/drivers/dri/i965/gen6_depthstencil.c index 960927164c..4924f0fd55 100644 --- a/src/mesa/drivers/dri/i965/gen6_depthstencil.c +++ b/src/mesa/drivers/dri/i965/gen6_depthstencil.c @@ -27,10 +27,6 @@ #include "brw_context.h" #include "brw_state.h" -#include "brw_defines.h" -#include "brw_util.h" -#include "main/macros.h" -#include "main/enums.h" struct brw_depth_stencil_state_key { GLenum depth_func; diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c index 4032605a85..161e7b85c2 100644 --- a/src/mesa/drivers/dri/i965/gen6_gs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c @@ -28,9 +28,6 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "brw_util.h" -#include "main/macros.h" -#include "main/enums.h" #include "intel_batchbuffer.h" static void diff --git a/src/mesa/drivers/dri/i965/gen6_sampler_state.c b/src/mesa/drivers/dri/i965/gen6_sampler_state.c index f5d537b1cf..ab8e7516d2 100644 --- a/src/mesa/drivers/dri/i965/gen6_sampler_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sampler_state.c @@ -28,10 +28,7 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "brw_util.h" #include "intel_batchbuffer.h" -#include "main/macros.h" -#include "main/enums.h" static void upload_sampler_state_pointers(struct brw_context *brw) diff --git a/src/mesa/drivers/dri/i965/gen6_scissor_state.c b/src/mesa/drivers/dri/i965/gen6_scissor_state.c index 81ebbf4ddf..2e21e5f733 100644 --- a/src/mesa/drivers/dri/i965/gen6_scissor_state.c +++ b/src/mesa/drivers/dri/i965/gen6_scissor_state.c @@ -28,10 +28,7 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "brw_util.h" #include "intel_batchbuffer.h" -#include "main/macros.h" -#include "main/enums.h" static void prepare_scissor_state(struct brw_context *brw) diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 548cdb9fca..08e6753a91 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -30,7 +30,6 @@ #include "brw_defines.h" #include "brw_util.h" #include "main/macros.h" -#include "main/enums.h" #include "intel_batchbuffer.h" static void diff --git a/src/mesa/drivers/dri/i965/gen6_viewport_state.c b/src/mesa/drivers/dri/i965/gen6_viewport_state.c index df3cbfb224..0c2aa4206c 100644 --- a/src/mesa/drivers/dri/i965/gen6_viewport_state.c +++ b/src/mesa/drivers/dri/i965/gen6_viewport_state.c @@ -28,10 +28,8 @@ #include "brw_context.h" #include "brw_state.h" #include "brw_defines.h" -#include "brw_util.h" #include "intel_batchbuffer.h" #include "main/macros.h" -#include "main/enums.h" /* The clip VP defines the guardband region where expensive clipping is skipped * and fragments are allowed to be generated and clipped out cheaply by the SF. diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 04fc16e679..211a6231c9 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -29,8 +29,6 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_util.h" -#include "main/macros.h" -#include "main/enums.h" #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" #include "intel_batchbuffer.h" diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index f4ae7ed750..e355261769 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -29,8 +29,6 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_util.h" -#include "main/macros.h" -#include "main/enums.h" #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" #include "intel_batchbuffer.h" -- cgit v1.2.3 From ead22e6a328e7d7b7c0b52af4705634e989e4d69 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 25 Feb 2010 23:58:45 -0800 Subject: glapi: Remove unnecessary headers. --- src/mesa/glapi/glapi_dispatch.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi_dispatch.c b/src/mesa/glapi/glapi_dispatch.c index 32b9535e3f..b7587a2109 100644 --- a/src/mesa/glapi/glapi_dispatch.c +++ b/src/mesa/glapi/glapi_dispatch.c @@ -46,8 +46,6 @@ #endif #include "glapi/glapi.h" -#include "glapi/glapitable.h" -#include "glapi/glapidispatch.h" #include "glapi/glthread.h" -- cgit v1.2.3 From e5c691f445e1c02e6e2f75b817b13d7024f7a3a6 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 26 Feb 2010 00:17:03 -0800 Subject: r300/compiler: Assert that array index is not negative. --- src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index 829f028950..710cae727a 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -469,6 +469,8 @@ void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi if (compiler->Base.Error) return; + assert(code->inst_end >= 0); + if ((code->inst[code->inst_end].inst0 & R500_INST_TYPE_MASK) != R500_INST_TYPE_OUT) { /* This may happen when dead-code elimination is disabled or * when most of the fragment program logic is leading to a KIL */ -- cgit v1.2.3 From 49f35a379dc52e9847fce803b9ef73d622d0e575 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 09:09:35 +0000 Subject: Revert "glapi: Remove unnecessary headers." This reverts commit ead22e6a328e7d7b7c0b52af4705634e989e4d69. This headers are not unnecessary on windows. --- src/mesa/glapi/glapi_dispatch.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/glapi/glapi_dispatch.c b/src/mesa/glapi/glapi_dispatch.c index b7587a2109..32b9535e3f 100644 --- a/src/mesa/glapi/glapi_dispatch.c +++ b/src/mesa/glapi/glapi_dispatch.c @@ -46,6 +46,8 @@ #endif #include "glapi/glapi.h" +#include "glapi/glapitable.h" +#include "glapi/glapidispatch.h" #include "glapi/glthread.h" -- cgit v1.2.3 From e2b02ea9db1a01fd2c4e431edff237d9909863ef Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 10:11:36 +0000 Subject: util: Add is_pot() method to formats. --- src/gallium/auxiliary/util/u_format_parse.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 15c887af5e..f26cb37237 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -37,6 +37,10 @@ SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_0, SWIZZLE_1, SWIZZLE_NONE, PLAIN = 'plain' +def is_pot(x): + return (x & (x - 1)) == 0; + + class Type: '''Describe the type of a color channel.''' @@ -113,6 +117,9 @@ class Format: return True return False + def is_pot(self): + return is_pot(self.block_size()) + def stride(self): return self.block_size()/8 -- cgit v1.2.3 From eee21b3812ce8e1d8c4ebbeb89d86c60867d1116 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 10:11:52 +0000 Subject: llvmpipe: Fix scons dependencies. --- src/gallium/drivers/llvmpipe/SConscript | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/SConscript b/src/gallium/drivers/llvmpipe/SConscript index 9084c97079..71f9337422 100644 --- a/src/gallium/drivers/llvmpipe/SConscript +++ b/src/gallium/drivers/llvmpipe/SConscript @@ -18,6 +18,12 @@ env.CodeGenerate( command = 'python $SCRIPT $SOURCE > $TARGET' ) +# XXX: Our dependency scanner only finds depended modules in relative dirs. +env.Depends('lp_tile_soa.c', [ + '#src/gallium/auxiliary/util/u_format_parse.py', + '#src/gallium/auxiliary/util/u_format_access.py', +]) + llvmpipe = env.ConvenienceLibrary( target = 'llvmpipe', source = [ -- cgit v1.2.3 From 8416d342792910bfffcc8806dba0ee35a395b31d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 10:12:32 +0000 Subject: llvmpipe: Fix lp_tile_r5g6b5_unorm_write_4ub. Was using 32bit integer pointers instead of 16bits. --- src/gallium/drivers/llvmpipe/lp_tile_soa.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py index a66a846f8e..4d04905958 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py @@ -170,7 +170,7 @@ def emit_unrolled_write_code(format, src_type): '''Emit code for writing a block based on unrolled loops. This is considerably faster than the TILE_PIXEL-based code below. ''' - dst_native_type = intermediate_native_type(format.block_size(), False) + dst_native_type = 'uint%u_t' % format.block_size() print ' const unsigned dstpix_stride = dst_stride / %d;' % format.stride() print ' %s *dstpix = (%s *) dst;' % (dst_native_type, dst_native_type) print ' unsigned int qx, qy, i;' @@ -249,6 +249,7 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): if format.layout == PLAIN \ and format.colorspace == 'rgb' \ and format.block_size() <= 32 \ + and format.is_pot() \ and not format.is_mixed() \ and format.in_types[0].kind == UNSIGNED: emit_unrolled_write_code(format, src_type) -- cgit v1.2.3 From f2656c3e3cc91edcbf572d175efe9346a30b1da2 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Fri, 26 Feb 2010 14:16:46 +0100 Subject: nv50: adapt to vertex elements cso --- src/gallium/drivers/nv50/nv50_context.h | 10 +++- src/gallium/drivers/nv50/nv50_state.c | 34 ++++++++++--- src/gallium/drivers/nv50/nv50_vbo.c | 84 +++++++++++++++++++-------------- 3 files changed, 85 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index b4de3e2ba5..811b3ef9fe 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -72,6 +72,12 @@ struct nv50_sampler_stateobj { unsigned tsc[8]; }; +struct nv50_vtxelt_stateobj { + struct pipe_vertex_element pipe[16]; + unsigned num_elements; + uint32_t hw[16]; +}; + static INLINE unsigned get_tile_height(uint32_t tile_mode) { @@ -168,8 +174,7 @@ struct nv50_context { struct pipe_buffer *constbuf[PIPE_SHADER_TYPES]; struct pipe_vertex_buffer vtxbuf[PIPE_MAX_ATTRIBS]; unsigned vtxbuf_nr; - struct pipe_vertex_element vtxelt[PIPE_MAX_ATTRIBS]; - unsigned vtxelt_nr; + struct nv50_vtxelt_stateobj *vtxelt; struct nv50_sampler_stateobj *sampler[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; unsigned sampler_nr[PIPE_SHADER_TYPES]; struct nv50_miptree *miptree[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; @@ -217,6 +222,7 @@ extern void nv50_draw_elements_instanced(struct pipe_context *pipe, unsigned count, unsigned startInstance, unsigned instanceCount); +extern void nv50_vtxelt_construct(struct nv50_vtxelt_stateobj *cso); extern void nv50_vbo_validate(struct nv50_context *nv50); /* nv50_clear.c */ diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 7d304907b6..ffbf3473a1 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -720,15 +720,34 @@ nv50_set_vertex_buffers(struct pipe_context *pipe, unsigned count, nv50->dirty |= NV50_NEW_ARRAYS; } +static void * +nv50_vtxelts_state_create(struct pipe_context *pipe, + unsigned num_elements, + const struct pipe_vertex_element *elements) +{ + struct nv50_vtxelt_stateobj *cso = CALLOC_STRUCT(nv50_vtxelt_stateobj); + + assert(num_elements < 16); /* not doing fallbacks yet */ + cso->num_elements = num_elements; + memcpy(cso->pipe, elements, num_elements * sizeof(*elements)); + + nv50_vtxelt_construct(cso); + + return (void *)cso; +} + static void -nv50_set_vertex_elements(struct pipe_context *pipe, unsigned count, - const struct pipe_vertex_element *ve) +nv50_vtxelts_state_delete(struct pipe_context *pipe, void *hwcso) { - struct nv50_context *nv50 = nv50_context(pipe); + FREE(hwcso); +} - memcpy(nv50->vtxelt, ve, sizeof(*ve) * count); - nv50->vtxelt_nr = count; +static void +nv50_vtxelts_state_bind(struct pipe_context *pipe, void *hwcso) +{ + struct nv50_context *nv50 = nv50_context(pipe); + nv50->vtxelt = hwcso; nv50->dirty |= NV50_NEW_ARRAYS; } @@ -778,7 +797,10 @@ nv50_init_state_functions(struct nv50_context *nv50) nv50->pipe.set_scissor_state = nv50_set_scissor_state; nv50->pipe.set_viewport_state = nv50_set_viewport_state; + nv50->pipe.create_vertex_elements_state = nv50_vtxelts_state_create; + nv50->pipe.delete_vertex_elements_state = nv50_vtxelts_state_delete; + nv50->pipe.bind_vertex_elements_state = nv50_vtxelts_state_bind; + nv50->pipe.set_vertex_buffers = nv50_set_vertex_buffers; - nv50->pipe.set_vertex_elements = nv50_set_vertex_elements; } diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 909d323e05..c1dcb93b48 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -223,11 +223,10 @@ nv50_set_static_vtxattr(struct nv50_context *nv50, unsigned i, void *data) struct nouveau_grobj *tesla = nv50->screen->tesla; struct nouveau_channel *chan = tesla->channel; float v[4]; - unsigned nr_components = util_format_get_nr_components(nv50->vtxelt[i].src_format); - + enum pipe_format pf = nv50->vtxelt->pipe[i].src_format; + unsigned nr_components = util_format_get_nr_components(pf); - util_format_read_4f(nv50->vtxelt[i].src_format, - v, 0, data, 0, 0, 0, 1, 1); + util_format_read_4f(pf, v, 0, data, 0, 0, 0, 1, 1); switch (nr_components) { case 4: @@ -266,16 +265,17 @@ init_per_instance_arrays_immd(struct nv50_context *nv50, struct nouveau_bo *bo; unsigned i, b, count = 0; - for (i = 0; i < nv50->vtxelt_nr; ++i) { - if (!nv50->vtxelt[i].instance_divisor) + for (i = 0; i < nv50->vtxelt->num_elements; ++i) { + if (!nv50->vtxelt->pipe[i].instance_divisor) continue; ++count; - b = nv50->vtxelt[i].vertex_buffer_index; + b = nv50->vtxelt->pipe[i].vertex_buffer_index; - pos[i] = nv50->vtxelt[i].src_offset + + pos[i] = nv50->vtxelt->pipe[i].src_offset + nv50->vtxbuf[b].buffer_offset + startInstance * nv50->vtxbuf[b].stride; - step[i] = startInstance % nv50->vtxelt[i].instance_divisor; + step[i] = startInstance % + nv50->vtxelt->pipe[i].instance_divisor; bo = nouveau_bo(nv50->vtxbuf[b].buffer); if (!bo->map) @@ -296,22 +296,22 @@ init_per_instance_arrays(struct nv50_context *nv50, struct nouveau_channel *chan = tesla->channel; struct nouveau_bo *bo; struct nouveau_stateobj *so; - unsigned i, b, count = 0; + unsigned i, b, count = 0, num_elements = nv50->vtxelt->num_elements; const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; if (nv50->vbo_fifo) return init_per_instance_arrays_immd(nv50, startInstance, pos, step); - so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 2, nv50->vtxelt_nr * 2); + so = so_new(num_elements, num_elements * 2, num_elements * 2); - for (i = 0; i < nv50->vtxelt_nr; ++i) { - if (!nv50->vtxelt[i].instance_divisor) + for (i = 0; i < nv50->vtxelt->num_elements; ++i) { + if (!nv50->vtxelt->pipe[i].instance_divisor) continue; ++count; - b = nv50->vtxelt[i].vertex_buffer_index; + b = nv50->vtxelt->pipe[i].vertex_buffer_index; - pos[i] = nv50->vtxelt[i].src_offset + + pos[i] = nv50->vtxelt->pipe[i].src_offset + nv50->vtxbuf[b].buffer_offset + startInstance * nv50->vtxbuf[b].stride; @@ -319,7 +319,8 @@ init_per_instance_arrays(struct nv50_context *nv50, step[i] = 0; continue; } - step[i] = startInstance % nv50->vtxelt[i].instance_divisor; + step[i] = startInstance % + nv50->vtxelt->pipe[i].instance_divisor; bo = nouveau_bo(nv50->vtxbuf[b].buffer); @@ -344,12 +345,12 @@ step_per_instance_arrays_immd(struct nv50_context *nv50, struct nouveau_bo *bo; unsigned i, b; - for (i = 0; i < nv50->vtxelt_nr; ++i) { - if (!nv50->vtxelt[i].instance_divisor) + for (i = 0; i < nv50->vtxelt->num_elements; ++i) { + if (!nv50->vtxelt->pipe[i].instance_divisor) continue; - if (++step[i] != nv50->vtxelt[i].instance_divisor) + if (++step[i] != nv50->vtxelt->pipe[i].instance_divisor) continue; - b = nv50->vtxelt[i].vertex_buffer_index; + b = nv50->vtxelt->pipe[i].vertex_buffer_index; bo = nouveau_bo(nv50->vtxbuf[b].buffer); step[i] = 0; @@ -367,7 +368,7 @@ step_per_instance_arrays(struct nv50_context *nv50, struct nouveau_channel *chan = tesla->channel; struct nouveau_bo *bo; struct nouveau_stateobj *so; - unsigned i, b; + unsigned i, b, num_elements = nv50->vtxelt->num_elements; const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; if (nv50->vbo_fifo) { @@ -375,14 +376,14 @@ step_per_instance_arrays(struct nv50_context *nv50, return; } - so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 2, nv50->vtxelt_nr * 2); + so = so_new(num_elements, num_elements * 2, num_elements * 2); - for (i = 0; i < nv50->vtxelt_nr; ++i) { - if (!nv50->vtxelt[i].instance_divisor) + for (i = 0; i < nv50->vtxelt->num_elements; ++i) { + if (!nv50->vtxelt->pipe[i].instance_divisor) continue; - b = nv50->vtxelt[i].vertex_buffer_index; + b = nv50->vtxelt->pipe[i].vertex_buffer_index; - if (++step[i] == nv50->vtxelt[i].instance_divisor) { + if (++step[i] == nv50->vtxelt->pipe[i].instance_divisor) { step[i] = 0; pos[i] += nv50->vtxbuf[b].stride; } @@ -740,7 +741,8 @@ nv50_vbo_static_attrib(struct nv50_context *nv50, unsigned attrib, 0, 0, 1, 1); so = *pso; if (!so) - *pso = so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 4, 0); + *pso = so = so_new(nv50->vtxelt->num_elements, + nv50->vtxelt->num_elements * 4, 0); switch (nr_components) { case 4: @@ -778,6 +780,18 @@ nv50_vbo_static_attrib(struct nv50_context *nv50, unsigned attrib, return TRUE; } +void +nv50_vtxelt_construct(struct nv50_vtxelt_stateobj *cso) +{ + unsigned i; + + for (i = 0; i < cso->num_elements; ++i) { + struct pipe_vertex_element *ve = &cso->pipe[i]; + + cso->hw[i] = nv50_vbo_vtxelt_to_hw(ve); + } +} + void nv50_vbo_validate(struct nv50_context *nv50) { @@ -798,19 +812,19 @@ nv50_vbo_validate(struct nv50_context *nv50) if (NV50_USING_LOATHED_EDGEFLAG(nv50)) nv50->vbo_fifo = 0xffff; /* vertprog can't set edgeflag */ - n_ve = MAX2(nv50->vtxelt_nr, nv50->state.vtxelt_nr); + n_ve = MAX2(nv50->vtxelt->num_elements, nv50->state.vtxelt_nr); vtxattr = NULL; - vtxbuf = so_new(n_ve * 2, n_ve * 5, nv50->vtxelt_nr * 4); + vtxbuf = so_new(n_ve * 2, n_ve * 5, nv50->vtxelt->num_elements * 4); vtxfmt = so_new(1, n_ve, 0); so_method(vtxfmt, tesla, NV50TCL_VERTEX_ARRAY_ATTRIB(0), n_ve); - for (i = 0; i < nv50->vtxelt_nr; i++) { - struct pipe_vertex_element *ve = &nv50->vtxelt[i]; + for (i = 0; i < nv50->vtxelt->num_elements; i++) { + struct pipe_vertex_element *ve = &nv50->vtxelt->pipe[i]; struct pipe_vertex_buffer *vb = &nv50->vtxbuf[ve->vertex_buffer_index]; struct nouveau_bo *bo = nouveau_bo(vb->buffer); - uint32_t hw = nv50_vbo_vtxelt_to_hw(ve); + uint32_t hw = nv50->vtxelt->hw[i]; if (!vb->stride && nv50_vbo_static_attrib(nv50, i, &vtxattr, ve, vb)) { @@ -859,7 +873,7 @@ nv50_vbo_validate(struct nv50_context *nv50) so_method(vtxbuf, tesla, NV50TCL_VERTEX_ARRAY_FORMAT(i), 1); so_data (vtxbuf, 0); } - nv50->state.vtxelt_nr = nv50->vtxelt_nr; + nv50->state.vtxelt_nr = nv50->vtxelt->num_elements; so_ref (vtxfmt, &nv50->state.vtxfmt); so_ref (vtxbuf, &nv50->state.vtxbuf); @@ -1020,13 +1034,13 @@ emit_prepare(struct nv50_context *nv50, struct nv50_vbo_emitctx *emit, emit->nr_ve = 0; emit->vtx_dwords = 0; - for (i = 0; i < nv50->vtxelt_nr; ++i) { + for (i = 0; i < nv50->vtxelt->num_elements; ++i) { struct pipe_vertex_element *ve; struct pipe_vertex_buffer *vb; unsigned n, size, nr_components; const struct util_format_description *desc; - ve = &nv50->vtxelt[i]; + ve = &nv50->vtxelt->pipe[i]; vb = &nv50->vtxbuf[ve->vertex_buffer_index]; if (!(nv50->vbo_fifo & (1 << i)) || ve->instance_divisor) continue; -- cgit v1.2.3 From fe25476c04b341d50777b8edd0533f7c838f6361 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 09:03:31 -0700 Subject: mesa: fix _BaseFormat assignment in _mesa_soft_renderbuffer_storage() The rb->InternalFormat field will be set by the caller if the allocation succeeds. Until then, this field's value can't be used. Fixes a failed assertion with FlightGear. --- src/mesa/main/renderbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 4276b23b69..2f42924046 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1142,7 +1142,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; - rb->_BaseFormat = _mesa_base_fbo_format(ctx, rb->InternalFormat); + rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); ASSERT(rb->_BaseFormat); return GL_TRUE; -- cgit v1.2.3 From 092010db3798f9a49ff9184bf238099af849e885 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 11:03:06 +0000 Subject: util: Use python names consistent with u_format.h --- src/gallium/auxiliary/util/u_format_access.py | 158 +++++++++++++------------- src/gallium/auxiliary/util/u_format_parse.py | 74 +++++++----- src/gallium/auxiliary/util/u_format_table.py | 8 +- src/gallium/drivers/llvmpipe/lp_tile_soa.py | 70 ++++++------ 4 files changed, 161 insertions(+), 149 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index f7a92f62a8..267fb3fbbd 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -56,12 +56,12 @@ def is_format_supported(format): return False for i in range(4): - type = format.in_types[i] - if type.kind not in (VOID, UNSIGNED, FLOAT): + channel = format.channels[i] + if channel.type not in (VOID, UNSIGNED, FLOAT): return False # We can only read a color from a depth/stencil format if the depth channel is present - if format.colorspace == 'zs' and format.out_swizzle[0] == SWIZZLE_NONE: + if format.colorspace == 'zs' and format.swizzles[0] == SWIZZLE_NONE: return False return True @@ -76,15 +76,15 @@ def native_type(format): return 'uint%u_t' % format.block_size() else: # For array pixel formats return the integer type that matches the color channel - type = format.in_types[0] - if type.kind == UNSIGNED: - return 'uint%u_t' % type.size - elif type.kind == SIGNED: - return 'int%u_t' % type.size - elif type.kind == FLOAT: - if type.size == 32: + channel = format.channels[0] + if channel.type == UNSIGNED: + return 'uint%u_t' % channel.size + elif channel.type == SIGNED: + return 'int%u_t' % channel.size + elif channel.type == FLOAT: + if channel.size == 32: return 'float' - elif type.size == 64: + elif channel.size == 64: return 'double' else: assert False @@ -108,27 +108,27 @@ def intermediate_native_type(bits, sign): return 'uint%u_t' % bits -def get_one_shift(type): - '''Get the number of the bit that matches unity for this type.''' - if type.kind == 'FLOAT': +def get_one_shift(channel): + '''Get the number of the bit that matches unity for this channel.''' + if channel.type == 'FLOAT': assert False - if not type.norm: + if not channel.norm: return 0 - if type.kind == UNSIGNED: - return type.size - if type.kind == SIGNED: - return type.size - 1 - if type.kind == FIXED: - return type.size / 2 + if channel.type == UNSIGNED: + return channel.size + if channel.type == SIGNED: + return channel.size - 1 + if channel.type == FIXED: + return channel.size / 2 assert False -def get_one(type): - '''Get the value of unity for this type.''' - if type.kind == 'FLOAT' or not type.norm: +def get_one(channel): + '''Get the value of unity for this channel.''' + if channel.type == 'FLOAT' or not channel.norm: return 1 else: - return (1 << get_one_shift(type)) - 1 + return (1 << get_one_shift(channel)) - 1 def generate_clamp(): @@ -156,32 +156,32 @@ def generate_clamp(): print -def clamp_expr(src_type, dst_type, dst_native_type, value): +def clamp_expr(src_channel, dst_channel, dst_native_type, value): '''Generate the expression to clamp the value in the source type to the destination type range.''' - if src_type == dst_type: + if src_channel == dst_channel: return value # Pick the approriate clamp function - if src_type.kind == FLOAT: - if src_type.size == 32: + if src_channel.type == FLOAT: + if src_channel.size == 32: func = 'clampf' - elif src_type.size == 64: + elif src_channel.size == 64: func = 'clamp' else: assert False - elif src_type.kind == UNSIGNED: + elif src_channel.type == UNSIGNED: func = 'clampui' - elif src_type.kind == SIGNED: + elif src_channel.type == SIGNED: func = 'clampsi' else: assert False # Clamp floats to [-1, 1] or [0, 1] range - if src_type.kind == FLOAT and dst_type.norm: + if src_channel.type == FLOAT and dst_channel.norm: max = 1 - if src_type.sign and dst_type.sign: + if src_channel.sign and dst_channel.sign: min = -1 else: min = 0 @@ -192,24 +192,24 @@ def clamp_expr(src_type, dst_type, dst_native_type, value): return value -def conversion_expr(src_type, dst_type, dst_native_type, value): +def conversion_expr(src_channel, dst_channel, dst_native_type, value): '''Generate the expression to convert a value between two types.''' - if src_type == dst_type: + if src_channel == dst_channel: return value - if src_type.kind == FLOAT and dst_type.kind == FLOAT: + if src_channel.type == FLOAT and dst_channel.type == FLOAT: return '(%s)%s' % (dst_native_type, value) - if not src_type.norm and not dst_type.norm: + if not src_channel.norm and not dst_channel.norm: return '(%s)%s' % (dst_native_type, value) - value = clamp_expr(src_type, dst_type, dst_native_type, value) + value = clamp_expr(src_channel, dst_channel, dst_native_type, value) - if dst_type.kind == FLOAT: - if src_type.norm: - one = get_one(src_type) - if src_type.size <= 23: + if dst_channel.type == FLOAT: + if src_channel.norm: + one = get_one(src_channel) + if src_channel.size <= 23: scale = '(1.0f/0x%x)' % one else: # bigger than single precision mantissa, use double @@ -217,10 +217,10 @@ def conversion_expr(src_type, dst_type, dst_native_type, value): value = '(%s * %s)' % (value, scale) return '(%s)%s' % (dst_native_type, value) - if src_type.kind == FLOAT: - if dst_type.norm: - dst_one = get_one(dst_type) - if dst_type.size <= 23: + if src_channel.type == FLOAT: + if dst_channel.norm: + dst_one = get_one(dst_channel) + if dst_channel.size <= 23: scale = '0x%x' % dst_one else: # bigger than single precision mantissa, use double @@ -228,18 +228,18 @@ def conversion_expr(src_type, dst_type, dst_native_type, value): value = '(%s * %s)' % (value, scale) return '(%s)%s' % (dst_native_type, value) - if src_type.kind == dst_type.kind: - src_one = get_one(src_type) - dst_one = get_one(dst_type) + if src_channel.type == dst_channel.type: + src_one = get_one(src_channel) + dst_one = get_one(dst_channel) - if src_one > dst_one and src_type.norm and dst_type.norm: + if src_one > dst_one and src_channel.norm and dst_channel.norm: # We can just bitshift - src_shift = get_one_shift(src_type) - dst_shift = get_one_shift(dst_type) + src_shift = get_one_shift(src_channel) + dst_shift = get_one_shift(dst_channel) value = '(%s >> %s)' % (value, src_shift - dst_shift) else: # We need to rescale using an intermediate type big enough to hold the multiplication of both - tmp_native_type = intermediate_native_type(src_type.size + dst_type.size, src_type.sign and dst_type.sign) + tmp_native_type = intermediate_native_type(src_channel.size + dst_channel.size, src_channel.sign and dst_channel.sign) value = '(%s)%s' % (tmp_native_type, value) value = '%s * 0x%x / 0x%x' % (value, dst_one, src_one) value = '(%s)%s' % (dst_native_type, value) @@ -253,11 +253,11 @@ def compute_inverse_swizzle(format): inv_swizzle = [None]*4 if format.colorspace == 'rgb': for i in range(4): - swizzle = format.out_swizzle[i] + swizzle = format.swizzles[i] if swizzle < 4: inv_swizzle[swizzle] = i elif format.colorspace == 'zs': - swizzle = format.out_swizzle[0] + swizzle = format.swizzles[0] if swizzle < 4: inv_swizzle[swizzle] = 0 else: @@ -266,7 +266,7 @@ def compute_inverse_swizzle(format): return inv_swizzle -def generate_format_read(format, dst_type, dst_native_type, dst_suffix): +def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' name = format.short_name() @@ -287,11 +287,11 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): names = ['']*4 if format.colorspace == 'rgb': for i in range(4): - swizzle = format.out_swizzle[i] + swizzle = format.swizzles[i] if swizzle < 4: names[swizzle] += 'rgba'[i] elif format.colorspace == 'zs': - swizzle = format.out_swizzle[0] + swizzle = format.swizzles[0] if swizzle < 4: names[swizzle] = 'z' else: @@ -304,8 +304,8 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): print ' %s pixel = *src_pixel++;' % src_native_type shift = 0; for i in range(4): - src_type = format.in_types[i] - width = src_type.size + src_channel = format.channels[i] + width = src_channel.size if names[i]: value = 'pixel' mask = (1 << width) - 1 @@ -313,35 +313,35 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): value = '(%s >> %u)' % (value, shift) if shift + width < format.block_size(): value = '(%s & 0x%x)' % (value, mask) - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) print ' %s %s = %s;' % (dst_native_type, names[i], value) shift += width else: for i in range(4): - src_type = format.in_types[i] + src_channel = format.channels[i] if names[i]: value = '(*src_pixel++)' - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) print ' %s %s = %s;' % (dst_native_type, names[i], value) else: assert False for i in range(4): if format.colorspace == 'rgb': - swizzle = format.out_swizzle[i] + swizzle = format.swizzles[i] if swizzle < 4: value = names[swizzle] elif swizzle == SWIZZLE_0: value = '0' elif swizzle == SWIZZLE_1: - value = get_one(dst_type) + value = get_one(dst_channel) else: assert False elif format.colorspace == 'zs': if i < 3: value = 'z' else: - value = get_one(dst_type) + value = get_one(dst_channel) else: assert False print ' *dst_pixel++ = %s; /* %s */' % (value, 'rgba'[i]) @@ -354,7 +354,7 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): print -def generate_format_write(format, src_type, src_native_type, src_suffix): +def generate_format_write(format, src_channel, src_native_type, src_suffix): '''Generate the function to write pixels to a particular format''' name = format.short_name() @@ -379,11 +379,11 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): print ' %s pixel = 0;' % dst_native_type shift = 0; for i in range(4): - dst_type = format.in_types[i] - width = dst_type.size + dst_channel = format.channels[i] + width = dst_channel.size if inv_swizzle[i] is not None: value = 'src_pixel[%u]' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) if shift: value = '(%s << %u)' % (value, shift) print ' pixel |= %s;' % value @@ -391,10 +391,10 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): print ' *dst_pixel++ = pixel;' else: for i in range(4): - dst_type = format.in_types[i] + dst_channel = format.channels[i] if inv_swizzle[i] is not None: value = 'src_pixel[%u]' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) print ' *dst_pixel++ = %s;' % value else: assert False @@ -408,12 +408,12 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): print -def generate_read(formats, dst_type, dst_native_type, dst_suffix): +def generate_read(formats, dst_channel, dst_native_type, dst_suffix): '''Generate the dispatch function to read pixels from any format''' for format in formats: if is_format_supported(format): - generate_format_read(format, dst_type, dst_native_type, dst_suffix) + generate_format_read(format, dst_channel, dst_native_type, dst_suffix) print 'void' print 'util_format_read_%s(enum pipe_format format, %s *dst, unsigned dst_stride, const void *src, unsigned src_stride, unsigned x, unsigned y, unsigned w, unsigned h)' % (dst_suffix, dst_native_type) @@ -434,12 +434,12 @@ def generate_read(formats, dst_type, dst_native_type, dst_suffix): print -def generate_write(formats, src_type, src_native_type, src_suffix): +def generate_write(formats, src_channel, src_native_type, src_suffix): '''Generate the dispatch function to write pixels to any format''' for format in formats: if is_format_supported(format): - generate_format_write(format, src_type, src_native_type, src_suffix) + generate_format_write(format, src_channel, src_native_type, src_suffix) print 'void' print 'util_format_write_%s(enum pipe_format format, const %s *src, unsigned src_stride, void *dst, unsigned dst_stride, unsigned x, unsigned y, unsigned w, unsigned h)' % (src_suffix, src_native_type) @@ -478,14 +478,14 @@ def main(): generate_clamp() - type = Type(FLOAT, False, 32) + type = Channel(FLOAT, False, 32) native_type = 'float' suffix = '4f' generate_read(formats, type, native_type, suffix) generate_write(formats, type, native_type, suffix) - type = Type(UNSIGNED, True, 8) + type = Channel(UNSIGNED, True, 8) native_type = 'uint8_t' suffix = '4ub' diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index f26cb37237..edc6bba795 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -41,36 +41,36 @@ def is_pot(x): return (x & (x - 1)) == 0; -class Type: - '''Describe the type of a color channel.''' +class Channel: + '''Describe the channel of a color channel.''' - def __init__(self, kind, norm, size): - self.kind = kind + def __init__(self, type, norm, size): + self.type = type self.norm = norm self.size = size - self.sign = kind in (SIGNED, FIXED, FLOAT) + self.sign = type in (SIGNED, FIXED, FLOAT) def __str__(self): - s = str(self.kind) + s = str(self.type) if self.norm: s += 'n' s += str(self.size) return s def __eq__(self, other): - return self.kind == other.kind and self.norm == other.norm and self.size == other.size + return self.type == other.type and self.norm == other.norm and self.size == other.size class Format: '''Describe a pixel format.''' - def __init__(self, name, layout, block_width, block_height, in_types, out_swizzle, colorspace): + def __init__(self, name, layout, block_width, block_height, channels, swizzles, colorspace): self.name = name self.layout = layout self.block_width = block_width self.block_height = block_height - self.in_types = in_types - self.out_swizzle = out_swizzle + self.channels = channels + self.swizzles = swizzles self.name = name self.colorspace = colorspace @@ -89,42 +89,54 @@ class Format: def block_size(self): size = 0 - for type in self.in_types: - size += type.size + for channel in self.channels: + size += channel.size return size def nr_channels(self): nr_channels = 0 - for type in self.in_types: - if type.size: + for channel in self.channels: + if channel.size: nr_channels += 1 return nr_channels def is_array(self): - ref_type = self.in_types[0] - for type in self.in_types[1:]: - if type.size and (type.size != ref_type.size or type.size % 8): + ref_channel = self.channels[0] + for channel in self.channels[1:]: + if channel.size and (channel.size != ref_channel.size or channel.size % 8): return False return True def is_mixed(self): - ref_type = self.in_types[0] - for type in self.in_types[1:]: - if type.kind != VOID: - if type.kind != ref_type.kind: + ref_channel = self.channels[0] + for channel in self.channels[1:]: + if channel.type != VOID: + if channel.type != ref_channel.type: return True - if type.norm != ref_type.norm: + if channel.norm != ref_channel.norm: return True return False def is_pot(self): return is_pot(self.block_size()) + def is_int(self): + for channel in self.channels: + if channel.type not in (VOID, UNSIGNED, SIGNED): + return False + return True + + def is_float(self): + for channel in self.channels: + if channel.type not in (VOID, FLOAT): + return False + return True + def stride(self): return self.block_size()/8 -_kind_parse_map = { +_type_parse_map = { '': VOID, 'x': VOID, 'u': UNSIGNED, @@ -145,7 +157,7 @@ _swizzle_parse_map = { def parse(filename): '''Parse the format descrition in CSV format in terms of the - Type and Format classes above.''' + Channel and Format classes above.''' stream = open(filename) formats = [] @@ -163,10 +175,10 @@ def parse(filename): name = fields[0] layout = fields[1] block_width, block_height = map(int, fields[2:4]) - in_types = [] + channels = [] for field in fields[4:8]: if field: - kind = _kind_parse_map[field[0]] + type = _type_parse_map[field[0]] if field[1] == 'n': norm = True size = int(field[2:]) @@ -174,13 +186,13 @@ def parse(filename): norm = False size = int(field[1:]) else: - kind = VOID + type = VOID norm = False size = 0 - in_type = Type(kind, norm, size) - in_types.append(in_type) - out_swizzle = [_swizzle_parse_map[swizzle] for swizzle in fields[8]] + channel = Channel(type, norm, size) + channels.append(channel) + swizzles = [_swizzle_parse_map[swizzle] for swizzle in fields[8]] colorspace = fields[9] - formats.append(Format(name, layout, block_width, block_height, in_types, out_swizzle, colorspace)) + formats.append(Format(name, layout, block_width, block_height, channels, swizzles, colorspace)) return formats diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index 953b5aed87..a7a4fd18a8 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -51,7 +51,7 @@ colorspace_channels_map = { } -kind_map = { +type_map = { VOID: "UTIL_FORMAT_TYPE_VOID", UNSIGNED: "UTIL_FORMAT_TYPE_UNSIGNED", SIGNED: "UTIL_FORMAT_TYPE_SIGNED", @@ -112,16 +112,16 @@ def write_format_table(formats): print " %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),) print " {" for i in range(4): - type = format.in_types[i] + channel = format.channels[i] if i < 3: sep = "," else: sep = "" - print " {%s, %s, %u}%s\t/* %s */" % (kind_map[type.kind], bool_map(type.norm), type.size, sep, "xyzw"[i]) + print " {%s, %s, %u}%s\t/* %s */" % (type_map[channel.type], bool_map(channel.norm), channel.size, sep, "xyzw"[i]) print " }," print " {" for i in range(4): - swizzle = format.out_swizzle[i] + swizzle = format.swizzles[i] if i < 3: sep = "," else: diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py index 4d04905958..52d7d3186a 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py @@ -45,7 +45,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), '../../auxiliary/u from u_format_access import * -def generate_format_read(format, dst_type, dst_native_type, dst_suffix): +def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' name = format.short_name() @@ -64,11 +64,11 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): names = ['']*4 if format.colorspace == 'rgb': for i in range(4): - swizzle = format.out_swizzle[i] + swizzle = format.swizzles[i] if swizzle < 4: names[swizzle] += 'rgba'[i] elif format.colorspace == 'zs': - swizzle = format.out_swizzle[0] + swizzle = format.swizzles[0] if swizzle < 4: names[swizzle] = 'z' else: @@ -81,8 +81,8 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): print ' %s pixel = *src_pixel++;' % src_native_type shift = 0; for i in range(4): - src_type = format.in_types[i] - width = src_type.size + src_channel = format.channels[i] + width = src_channel.size if names[i]: value = 'pixel' mask = (1 << width) - 1 @@ -90,35 +90,35 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): value = '(%s >> %u)' % (value, shift) if shift + width < format.block_size(): value = '(%s & 0x%x)' % (value, mask) - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) print ' %s %s = %s;' % (dst_native_type, names[i], value) shift += width else: for i in range(4): - src_type = format.in_types[i] + src_channel = format.channels[i] if names[i]: value = '(*src_pixel++)' - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) print ' %s %s = %s;' % (dst_native_type, names[i], value) else: assert False for i in range(4): if format.colorspace == 'rgb': - swizzle = format.out_swizzle[i] + swizzle = format.swizzles[i] if swizzle < 4: value = names[swizzle] elif swizzle == SWIZZLE_0: value = '0' elif swizzle == SWIZZLE_1: - value = get_one(dst_type) + value = get_one(dst_channel) else: assert False elif format.colorspace == 'zs': if i < 3: value = 'z' else: - value = get_one(dst_type) + value = get_one(dst_channel) else: assert False print ' TILE_PIXEL(dst, x, y, %u) = %s; /* %s */' % (i, value, 'rgba'[i]) @@ -130,7 +130,7 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): print -def pack_rgba(format, src_type, r, g, b, a): +def pack_rgba(format, src_channel, r, g, b, a): """Return an expression for packing r, g, b, a into a pixel of the given format. Ex: '(b << 24) | (g << 16) | (r << 8) | (a << 0)' """ @@ -152,21 +152,21 @@ def pack_rgba(format, src_type, r, g, b, a): value = None if value: - dst_type = format.in_types[i] + dst_channel = format.channels[i] dst_native_type = native_type(format) - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) term = "((%s) << %d)" % (value, shift) if expr: expr = expr + " | " + term else: expr = term - width = format.in_types[i].size + width = format.channels[i].size shift = shift + width return expr -def emit_unrolled_write_code(format, src_type): +def emit_unrolled_write_code(format, src_channel): '''Emit code for writing a block based on unrolled loops. This is considerably faster than the TILE_PIXEL-based code below. ''' @@ -185,8 +185,8 @@ def emit_unrolled_write_code(format, src_type): print ' const uint8_t *a = src + 3 * TILE_C_STRIDE;' print ' (void) r; (void) g; (void) b; (void) a; /* silence warnings */' print ' for (i = 0; i < TILE_C_STRIDE; i += 2) {' - print ' const uint32_t pixel0 = %s;' % pack_rgba(format, src_type, "r[i+0]", "g[i+0]", "b[i+0]", "a[i+0]") - print ' const uint32_t pixel1 = %s;' % pack_rgba(format, src_type, "r[i+1]", "g[i+1]", "b[i+1]", "a[i+1]") + print ' const uint32_t pixel0 = %s;' % pack_rgba(format, src_channel, "r[i+0]", "g[i+0]", "b[i+0]", "a[i+0]") + print ' const uint32_t pixel1 = %s;' % pack_rgba(format, src_channel, "r[i+1]", "g[i+1]", "b[i+1]", "a[i+1]") print ' const unsigned offset = (py + tile_y_offset[i]) * dstpix_stride + (px + tile_x_offset[i]);' print ' dstpix[offset + 0] = pixel0;' print ' dstpix[offset + 1] = pixel1;' @@ -196,7 +196,7 @@ def emit_unrolled_write_code(format, src_type): print ' }' -def emit_tile_pixel_write_code(format, src_type): +def emit_tile_pixel_write_code(format, src_channel): '''Emit code for writing a block based on the TILE_PIXEL macro.''' dst_native_type = native_type(format) @@ -213,11 +213,11 @@ def emit_tile_pixel_write_code(format, src_type): print ' %s pixel = 0;' % dst_native_type shift = 0; for i in range(4): - dst_type = format.in_types[i] - width = dst_type.size + dst_channel = format.channels[i] + width = dst_channel.size if inv_swizzle[i] is not None: value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) if shift: value = '(%s << %u)' % (value, shift) print ' pixel |= %s;' % value @@ -225,10 +225,10 @@ def emit_tile_pixel_write_code(format, src_type): print ' *dst_pixel++ = pixel;' else: for i in range(4): - dst_type = format.in_types[i] + dst_channel = format.channels[i] if inv_swizzle[i] is not None: value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] - value = conversion_expr(src_type, dst_type, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) print ' *dst_pixel++ = %s;' % value else: assert False @@ -238,7 +238,7 @@ def emit_tile_pixel_write_code(format, src_type): print ' }' -def generate_format_write(format, src_type, src_native_type, src_suffix): +def generate_format_write(format, src_channel, src_native_type, src_suffix): '''Generate the function to write pixels to a particular format''' name = format.short_name() @@ -251,20 +251,20 @@ def generate_format_write(format, src_type, src_native_type, src_suffix): and format.block_size() <= 32 \ and format.is_pot() \ and not format.is_mixed() \ - and format.in_types[0].kind == UNSIGNED: - emit_unrolled_write_code(format, src_type) + and format.channels[0].type == UNSIGNED: + emit_unrolled_write_code(format, src_channel) else: - emit_tile_pixel_write_code(format, src_type) + emit_tile_pixel_write_code(format, src_channel) print '}' print -def generate_read(formats, dst_type, dst_native_type, dst_suffix): +def generate_read(formats, dst_channel, dst_native_type, dst_suffix): '''Generate the dispatch function to read pixels from any format''' for format in formats: if is_format_supported(format): - generate_format_read(format, dst_type, dst_native_type, dst_suffix) + generate_format_read(format, dst_channel, dst_native_type, dst_suffix) print 'void' print 'lp_tile_read_%s(enum pipe_format format, %s *dst, const void *src, unsigned src_stride, unsigned x, unsigned y, unsigned w, unsigned h)' % (dst_suffix, dst_native_type) @@ -285,12 +285,12 @@ def generate_read(formats, dst_type, dst_native_type, dst_suffix): print -def generate_write(formats, src_type, src_native_type, src_suffix): +def generate_write(formats, src_channel, src_native_type, src_suffix): '''Generate the dispatch function to write pixels to any format''' for format in formats: if is_format_supported(format): - generate_format_write(format, src_type, src_native_type, src_suffix) + generate_format_write(format, src_channel, src_native_type, src_suffix) print 'void' print 'lp_tile_write_%s(enum pipe_format format, const %s *src, void *dst, unsigned dst_stride, unsigned x, unsigned y, unsigned w, unsigned h)' % (src_suffix, src_native_type) @@ -351,12 +351,12 @@ def main(): generate_clamp() - type = Type(UNSIGNED, True, 8) + channel = Channel(UNSIGNED, True, 8) native_type = 'uint8_t' suffix = '4ub' - generate_read(formats, type, native_type, suffix) - generate_write(formats, type, native_type, suffix) + generate_read(formats, channel, native_type, suffix) + generate_write(formats, channel, native_type, suffix) if __name__ == '__main__': -- cgit v1.2.3 From fda9a19b3465e3eb6ef74611a85021055eb78a64 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 15:37:18 +0000 Subject: util: Add util_bswap16. --- src/gallium/auxiliary/util/u_math.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index b2969a210a..d1ec13def3 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -531,6 +531,17 @@ util_bswap32(uint32_t n) } +/** + * Reverse byte order of a 16 bit word. + */ +static INLINE uint16_t +util_bswap16(uint16_t n) +{ + return (n >> 8) | + (n << 8); +} + + /** * Clamp X to [MIN, MAX]. * This is a macro to allow float, int, uint, etc. types. -- cgit v1.2.3 From 4757325951e35460975e77d70dacf8b6eb10ab11 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 15:45:48 +0000 Subject: util: Factor some code into u_format_parse.py --- src/gallium/auxiliary/util/u_format_access.py | 20 +----- src/gallium/auxiliary/util/u_format_parse.py | 95 +++++++++++++++++++++++++-- src/gallium/auxiliary/util/u_format_table.py | 5 +- src/gallium/drivers/llvmpipe/lp_tile_soa.py | 4 +- 4 files changed, 96 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index 267fb3fbbd..a7a91ea652 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -248,24 +248,6 @@ def conversion_expr(src_channel, dst_channel, dst_native_type, value): assert False -def compute_inverse_swizzle(format): - '''Return an array[4] of inverse swizzle terms''' - inv_swizzle = [None]*4 - if format.colorspace == 'rgb': - for i in range(4): - swizzle = format.swizzles[i] - if swizzle < 4: - inv_swizzle[swizzle] = i - elif format.colorspace == 'zs': - swizzle = format.swizzles[0] - if swizzle < 4: - inv_swizzle[swizzle] = 0 - else: - assert False - - return inv_swizzle - - def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' @@ -372,7 +354,7 @@ def generate_format_write(format, src_channel, src_native_type, src_suffix): print ' const %s *src_pixel = src_row;' %src_native_type print ' for (x = 0; x < w; ++x) {' - inv_swizzle = compute_inverse_swizzle(format) + inv_swizzle = format.inv_swizzles() if format.layout == PLAIN: if not format.is_array(): diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index edc6bba795..250926418e 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -36,19 +36,28 @@ SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W, SWIZZLE_0, SWIZZLE_1, SWIZZLE_NONE, PLAIN = 'plain' +RGB = 'rgb' +SRGB = 'srgb' +YUV = 'yuv' +ZS = 'zs' + def is_pot(x): return (x & (x - 1)) == 0; +VERY_LARGE = 99999999999999999999999 + + class Channel: '''Describe the channel of a color channel.''' - def __init__(self, type, norm, size): + def __init__(self, type, norm, size, name = ''): self.type = type self.norm = norm self.size = size self.sign = type in (SIGNED, FIXED, FLOAT) + self.name = name def __str__(self): s = str(self.type) @@ -60,6 +69,30 @@ class Channel: def __eq__(self, other): return self.type == other.type and self.norm == other.norm and self.size == other.size + def max(self): + '''Maximum representable number.''' + if self.type == FLOAT: + return VERY_LARGE + if self.norm: + return 1 + if self.type == UNSIGNED: + return (1 << self.size) - 1 + if self.type == SIGNED: + return self.size - 1 + assert False + + def min(self): + '''Minimum representable number.''' + if self.type == FLOAT: + return -VERY_LARGE + if self.type == UNSIGNED: + return 0 + if self.norm: + return -1 + if self.type == SIGNED: + return -(1 << (self.size - 1)) + assert False + class Format: '''Describe a pixel format.''' @@ -132,6 +165,29 @@ class Format: return False return True + def is_bitmask(self): + if self.block_size() > 32: + return False + if not self.is_pot(): + return False + for channel in self.channels: + if not is_pot(channel.size): + return True + if channel.type not in (VOID, UNSIGNED, SIGNED): + return False + if channel.size >= 32: + return False + return True + + def inv_swizzles(self): + '''Return an array[4] of inverse swizzle terms''' + inv_swizzle = [None]*4 + for i in range(4): + swizzle = self.swizzles[i] + if swizzle < 4: + inv_swizzle[swizzle] = i + return inv_swizzle + def stride(self): return self.block_size()/8 @@ -171,12 +227,39 @@ def parse(filename): line = line.strip() if not line: continue + fields = [field.strip() for field in line.split(',')] + name = fields[0] layout = fields[1] block_width, block_height = map(int, fields[2:4]) + + swizzles = [_swizzle_parse_map[swizzle] for swizzle in fields[8]] + colorspace = fields[9] + + if layout == PLAIN: + names = ['']*4 + if colorspace in (RGB, SRGB): + for i in range(4): + swizzle = swizzles[i] + if swizzle < 4: + names[swizzle] += 'rgba'[i] + elif colorspace == ZS: + for i in range(4): + swizzle = swizzles[i] + if swizzle < 4: + names[swizzle] += 'zs'[i] + else: + assert False + for i in range(4): + if names[i] == '': + names[i] = 'x' + else: + names = ['x', 'y', 'z', 'w'] + channels = [] - for field in fields[4:8]: + for i in range(0, 4): + field = fields[4 + i] if field: type = _type_parse_map[field[0]] if field[1] == 'n': @@ -189,10 +272,10 @@ def parse(filename): type = VOID norm = False size = 0 - channel = Channel(type, norm, size) + channel = Channel(type, norm, size, names[i]) channels.append(channel) - swizzles = [_swizzle_parse_map[swizzle] for swizzle in fields[8]] - colorspace = fields[9] - formats.append(Format(name, layout, block_width, block_height, channels, swizzles, colorspace)) + + format = Format(name, layout, block_width, block_height, channels, swizzles, colorspace) + formats.append(format) return formats diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index a7a4fd18a8..4e29d15f3b 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -117,7 +117,10 @@ def write_format_table(formats): sep = "," else: sep = "" - print " {%s, %s, %u}%s\t/* %s */" % (type_map[channel.type], bool_map(channel.norm), channel.size, sep, "xyzw"[i]) + if channel.size: + print " {%s, %s, %u}%s\t/* %s = %s */" % (type_map[channel.type], bool_map(channel.norm), channel.size, sep, "xyzw"[i], channel.name) + else: + print " {0, 0, 0}%s" % (sep,) print " }," print " {" for i in range(4): diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py index 52d7d3186a..dc44d67d63 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py @@ -135,7 +135,7 @@ def pack_rgba(format, src_channel, r, g, b, a): given format. Ex: '(b << 24) | (g << 16) | (r << 8) | (a << 0)' """ assert format.colorspace == 'rgb' - inv_swizzle = compute_inverse_swizzle(format) + inv_swizzle = format.inv_swizzles() shift = 0 expr = None for i in range(4): @@ -200,7 +200,7 @@ def emit_tile_pixel_write_code(format, src_channel): '''Emit code for writing a block based on the TILE_PIXEL macro.''' dst_native_type = native_type(format) - inv_swizzle = compute_inverse_swizzle(format) + inv_swizzle = format.inv_swizzles() print ' unsigned x, y;' print ' uint8_t *dst_row = dst + y0*dst_stride;' -- cgit v1.2.3 From 9beb302212a2afac408016cbd7b93c8b859e4910 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 16:45:22 +0000 Subject: util: Code generate functions to pack and unpack a single pixel. Should work correctly for all pixel formats except SRGB formats. Generated code made much simpler by defining the pixel format as a C structure. For example this is the generated structure for PIPE_FORMAT_B6UG5SR5S_NORM: union util_format_b6ug5sr5s_norm { uint16_t value; struct { int r:5; int g:5; unsigned b:6; } chan; }; Not used everywhere yet because it seems compiled code is slower than bitshift arithmetic by some misterious reason. So we should generate bitshift arithmetic at least for the simple UNORM pixel formats. --- src/gallium/auxiliary/Makefile | 5 + src/gallium/auxiliary/SConscript | 7 + src/gallium/auxiliary/util/.gitignore | 1 + src/gallium/auxiliary/util/u_format_access.py | 163 +-------- src/gallium/auxiliary/util/u_format_pack.py | 484 ++++++++++++++++++++++++++ src/gallium/drivers/llvmpipe/SConscript | 1 + src/gallium/drivers/llvmpipe/lp_tile_soa.py | 10 +- 7 files changed, 507 insertions(+), 164 deletions(-) create mode 100644 src/gallium/auxiliary/util/u_format_pack.py (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 2d41fb3dca..39e328f514 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -184,5 +184,10 @@ indices/u_unfilled_gen.c: indices/u_unfilled_gen.py util/u_format_table.c: util/u_format_table.py util/u_format_parse.py util/u_format.csv python util/u_format_table.py util/u_format.csv > $@ +util/u_format_pack.h: util/u_format_pack.py util/u_format_parse.py util/u_format.csv + python util/u_format_pack.py util/u_format.csv > $@ + util/u_format_access.c: util/u_format_access.py util/u_format_parse.py util/u_format.csv python util/u_format_access.py util/u_format.csv > $@ + +default: util/u_format_pack.h diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index 8d2859fa71..47de50bf3e 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -28,6 +28,13 @@ env.CodeGenerate( command = 'python $SCRIPT $SOURCE > $TARGET' ) +env.CodeGenerate( + target = File('util/u_format_pack.h').srcnode(), + script = 'util/u_format_pack.py', + source = ['util/u_format.csv'], + command = 'python $SCRIPT $SOURCE > $TARGET' +) + env.CodeGenerate( target = 'util/u_format_access.c', script = 'util/u_format_access.py', diff --git a/src/gallium/auxiliary/util/.gitignore b/src/gallium/auxiliary/util/.gitignore index 29c586c9b5..448d2f304f 100644 --- a/src/gallium/auxiliary/util/.gitignore +++ b/src/gallium/auxiliary/util/.gitignore @@ -1,2 +1,3 @@ u_format_access.c u_format_table.c +u_format_pack.h diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index a7a91ea652..1c9be1b538 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -39,7 +39,7 @@ import sys -from u_format_parse import * +from u_format_pack import * def is_format_supported(format): @@ -94,160 +94,6 @@ def native_type(format): assert False -def intermediate_native_type(bits, sign): - '''Find a native type adequate to hold intermediate results of the request bit size.''' - - bytes = 4 # don't use anything smaller than 32bits - while bytes * 8 < bits: - bytes *= 2 - bits = bytes*8 - - if sign: - return 'int%u_t' % bits - else: - return 'uint%u_t' % bits - - -def get_one_shift(channel): - '''Get the number of the bit that matches unity for this channel.''' - if channel.type == 'FLOAT': - assert False - if not channel.norm: - return 0 - if channel.type == UNSIGNED: - return channel.size - if channel.type == SIGNED: - return channel.size - 1 - if channel.type == FIXED: - return channel.size / 2 - assert False - - -def get_one(channel): - '''Get the value of unity for this channel.''' - if channel.type == 'FLOAT' or not channel.norm: - return 1 - else: - return (1 << get_one_shift(channel)) - 1 - - -def generate_clamp(): - '''Code generate the clamping functions for each type. - - We don't use a macro so that arguments with side effects, - like *src_pixel++ are correctly handled. - ''' - - for suffix, native_type in [ - ('', 'double'), - ('f', 'float'), - ('ui', 'unsigned int'), - ('si', 'int'), - ]: - print 'static INLINE %s' % native_type - print 'clamp%s(%s value, %s lbound, %s ubound)' % (suffix, native_type, native_type, native_type) - print '{' - print ' if(value < lbound)' - print ' return lbound;' - print ' if(value > ubound)' - print ' return ubound;' - print ' return value;' - print '}' - print - - -def clamp_expr(src_channel, dst_channel, dst_native_type, value): - '''Generate the expression to clamp the value in the source type to the - destination type range.''' - - if src_channel == dst_channel: - return value - - # Pick the approriate clamp function - if src_channel.type == FLOAT: - if src_channel.size == 32: - func = 'clampf' - elif src_channel.size == 64: - func = 'clamp' - else: - assert False - elif src_channel.type == UNSIGNED: - func = 'clampui' - elif src_channel.type == SIGNED: - func = 'clampsi' - else: - assert False - - # Clamp floats to [-1, 1] or [0, 1] range - if src_channel.type == FLOAT and dst_channel.norm: - max = 1 - if src_channel.sign and dst_channel.sign: - min = -1 - else: - min = 0 - return '%s(%s, %s, %s)' % (func, value, min, max) - - # FIXME: Also clamp scaled values - - return value - - -def conversion_expr(src_channel, dst_channel, dst_native_type, value): - '''Generate the expression to convert a value between two types.''' - - if src_channel == dst_channel: - return value - - if src_channel.type == FLOAT and dst_channel.type == FLOAT: - return '(%s)%s' % (dst_native_type, value) - - if not src_channel.norm and not dst_channel.norm: - return '(%s)%s' % (dst_native_type, value) - - value = clamp_expr(src_channel, dst_channel, dst_native_type, value) - - if dst_channel.type == FLOAT: - if src_channel.norm: - one = get_one(src_channel) - if src_channel.size <= 23: - scale = '(1.0f/0x%x)' % one - else: - # bigger than single precision mantissa, use double - scale = '(1.0/0x%x)' % one - value = '(%s * %s)' % (value, scale) - return '(%s)%s' % (dst_native_type, value) - - if src_channel.type == FLOAT: - if dst_channel.norm: - dst_one = get_one(dst_channel) - if dst_channel.size <= 23: - scale = '0x%x' % dst_one - else: - # bigger than single precision mantissa, use double - scale = '(double)0x%x' % dst_one - value = '(%s * %s)' % (value, scale) - return '(%s)%s' % (dst_native_type, value) - - if src_channel.type == dst_channel.type: - src_one = get_one(src_channel) - dst_one = get_one(dst_channel) - - if src_one > dst_one and src_channel.norm and dst_channel.norm: - # We can just bitshift - src_shift = get_one_shift(src_channel) - dst_shift = get_one_shift(dst_channel) - value = '(%s >> %s)' % (value, src_shift - dst_shift) - else: - # We need to rescale using an intermediate type big enough to hold the multiplication of both - tmp_native_type = intermediate_native_type(src_channel.size + dst_channel.size, src_channel.sign and dst_channel.sign) - value = '(%s)%s' % (tmp_native_type, value) - value = '%s * 0x%x / 0x%x' % (value, dst_one, src_one) - value = '(%s)%s' % (dst_native_type, value) - return value - - assert False - - def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' @@ -302,9 +148,10 @@ def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): for i in range(4): src_channel = format.channels[i] if names[i]: - value = '(*src_pixel++)' + value = 'src_pixel[%u]' % i value = conversion_expr(src_channel, dst_channel, dst_native_type, value) print ' %s %s = %s;' % (dst_native_type, names[i], value) + print ' src_pixel += %u;' % (format.nr_channels()) else: assert False @@ -454,12 +301,10 @@ def main(): print __doc__.strip() print print '#include "pipe/p_compiler.h"' - print '#include "u_format.h"' print '#include "u_math.h"' + print '#include "u_format_pack.h"' print - generate_clamp() - type = Channel(FLOAT, False, 32) native_type = 'float' suffix = '4f' diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py new file mode 100644 index 0000000000..3f33f7cc02 --- /dev/null +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -0,0 +1,484 @@ +#!/usr/bin/env python + +''' +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/** + * @file + * Pixel format packing and unpacking functions. + * + * @author Jose Fonseca + */ +''' + + +import sys + +from u_format_parse import * + + +def generate_format_type(format): + '''Generate a structure that describes the format.''' + + print 'union util_format_%s {' % format.short_name() + if format.is_bitmask(): + print ' uint%u_t value;' % (format.block_size(),) + print ' struct {' + for channel in format.channels: + if format.is_bitmask() and not format.is_array(): + if channel.type == VOID: + if channel.size: + print ' unsigned %s:%u;' % (channel.name, channel.size) + elif channel.type == UNSIGNED: + print ' unsigned %s:%u;' % (channel.name, channel.size) + elif channel.type == SIGNED: + print ' int %s:%u;' % (channel.name, channel.size) + else: + assert 0 + else: + assert channel.size % 8 == 0 and is_pot(channel.size) + if channel.type == VOID: + if channel.size: + print ' uint%u_t %s;' % (channel.size, channel.name) + elif channel.type == UNSIGNED: + print ' uint%u_t %s;' % (channel.size, channel.name) + elif channel.type in (SIGNED, FIXED): + print ' int%u_t %s;' % (channel.size, channel.name) + elif channel.type == FLOAT: + if channel.size == 64: + print ' double %s;' % (channel.name) + elif channel.size == 32: + print ' float %s;' % (channel.name) + elif channel.size == 16: + print ' uint16_t %s;' % (channel.name) + else: + assert 0 + else: + assert 0 + print ' } chan;' + print '};' + print + + +def bswap_format(format): + '''Generate a structure that describes the format.''' + + if format.is_bitmask() and not format.is_array(): + print '#ifdef PIPE_ARCH_BIG_ENDIAN' + print ' pixel.value = util_bswap%u(pixel.value);' % format.block_size() + print '#endif' + + +def is_format_supported(format): + '''Determines whether we actually have the plumbing necessary to generate the + to read/write to/from this format.''' + + # FIXME: Ideally we would support any format combination here. + + if format.layout != PLAIN: + return False + + for i in range(4): + channel = format.channels[i] + if channel.type not in (VOID, UNSIGNED, SIGNED, FLOAT): + return False + + # We can only read a color from a depth/stencil format if the depth channel is present + if format.colorspace == 'zs' and format.swizzles[0] == SWIZZLE_NONE: + return False + + return True + + +def native_type(format): + '''Get the native appropriate for a format.''' + + if format.layout == PLAIN: + if not format.is_array(): + # For arithmetic pixel formats return the integer type that matches the whole pixel + return 'uint%u_t' % format.block_size() + else: + # For array pixel formats return the integer type that matches the color channel + type = format.channels[0] + if type.type == UNSIGNED: + return 'uint%u_t' % type.size + elif type.type == SIGNED: + return 'int%u_t' % type.size + elif type.type == FLOAT: + if type.size == 32: + return 'float' + elif type.size == 64: + return 'double' + else: + assert False + else: + assert False + else: + assert False + + +def intermediate_native_type(bits, sign): + '''Find a native type adequate to hold intermediate results of the request bit size.''' + + bytes = 4 # don't use anything smaller than 32bits + while bytes * 8 < bits: + bytes *= 2 + bits = bytes*8 + + if sign: + return 'int%u_t' % bits + else: + return 'uint%u_t' % bits + + +def get_one_shift(type): + '''Get the number of the bit that matches unity for this type.''' + if type.type == 'FLOAT': + assert False + if not type.norm: + return 0 + if type.type == UNSIGNED: + return type.size + if type.type == SIGNED: + return type.size - 1 + if type.type == FIXED: + return type.size / 2 + assert False + + +def get_one(type): + '''Get the value of unity for this type.''' + if type.type == 'FLOAT' or not type.norm: + return 1 + else: + return (1 << get_one_shift(type)) - 1 + + +def generate_clamp(): + '''Code generate the clamping functions for each type. + + We don't use a macro so that arguments with side effects, + like *src_pixel++ are correctly handled. + ''' + + for suffix, native_type in [ + ('', 'double'), + ('f', 'float'), + ('ui', 'unsigned int'), + ('si', 'int'), + ]: + print 'static INLINE %s' % native_type + print 'clamp%s(%s value, %s lbound, %s ubound)' % (suffix, native_type, native_type, native_type) + print '{' + print ' if(value < lbound)' + print ' return lbound;' + print ' if(value > ubound)' + print ' return ubound;' + print ' return value;' + print '}' + print + + +def clamp_expr(src_channel, dst_channel, dst_native_type, value): + '''Generate the expression to clamp the value in the source type to the + destination type range.''' + + if src_channel == dst_channel: + return value + + # Pick the approriate clamp function + if src_channel.type == FLOAT: + if src_channel.size == 32: + func = 'clampf' + elif src_channel.size == 64: + func = 'clamp' + else: + assert False + elif src_channel.type == UNSIGNED: + func = 'clampui' + elif src_channel.type == SIGNED: + func = 'clampsi' + else: + assert False + + src_min = src_channel.min() + src_max = src_channel.max() + dst_min = dst_channel.min() + dst_max = dst_channel.max() + + if src_min < dst_min and src_max > dst_max: + return 'CLAMP(%s, %s, %s)' % (value, dst_min, dst_max) + + if src_max > dst_max: + return 'MIN2(%s, %s)' % (value, dst_max) + + if src_min < dst_min: + return 'MAX2(%s, %s)' % (value, dst_min) + + return value + + +def conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=True): + '''Generate the expression to convert a value between two types.''' + + if src_channel == dst_channel: + return value + + if src_channel.type == FLOAT and dst_channel.type == FLOAT: + return '(%s)%s' % (dst_native_type, value) + + if not src_channel.norm and not dst_channel.norm: + return '(%s)%s' % (dst_native_type, value) + + if clamp: + value = clamp_expr(src_channel, dst_channel, dst_native_type, value) + + if dst_channel.type == FLOAT: + if src_channel.norm: + one = get_one(src_channel) + if src_channel.size <= 23: + scale = '(1.0f/0x%x)' % one + else: + # bigger than single precision mantissa, use double + scale = '(1.0/0x%x)' % one + value = '(%s * %s)' % (value, scale) + return '(%s)%s' % (dst_native_type, value) + + if src_channel.type == FLOAT: + if dst_channel.norm: + dst_one = get_one(dst_channel) + if dst_channel.size <= 23: + scale = '0x%x' % dst_one + else: + # bigger than single precision mantissa, use double + scale = '(double)0x%x' % dst_one + value = '(%s * %s)' % (value, scale) + return '(%s)%s' % (dst_native_type, value) + + if not src_channel.norm and not dst_channel.norm: + # neither is normalized -- just cast + return '(%s)%s' % (dst_native_type, value) + + if src_channel.type in (SIGNED, UNSIGNED) and dst_channel.type in (SIGNED, UNSIGNED): + src_one = get_one(src_channel) + dst_one = get_one(dst_channel) + + if src_one > dst_one and src_channel.norm: + # We can just bitshift + src_shift = get_one_shift(src_channel) + dst_shift = get_one_shift(dst_channel) + value = '(%s >> %s)' % (value, src_shift - dst_shift) + else: + # We need to rescale using an intermediate type big enough to hold the multiplication of both + tmp_native_type = intermediate_native_type(src_channel.size + dst_channel.size, src_channel.sign and dst_channel.sign) + value = '(%s)%s' % (tmp_native_type, value) + value = '(%s * 0x%x / 0x%x)' % (value, dst_one, src_one) + value = '(%s)%s' % (dst_native_type, value) + return value + + assert False + + +def generate_format_unpack(format, dst_channel, dst_native_type, dst_suffix): + '''Generate the function to unpack pixels from a particular format''' + + name = format.short_name() + + src_native_type = native_type(format) + + print 'static INLINE void' + print 'util_format_%s_unpack_%s(%s *dst, const void *src)' % (name, dst_suffix, dst_native_type) + print '{' + print ' union util_format_%s pixel;' % format.short_name() + print ' memcpy(&pixel, src, sizeof pixel);' + bswap_format(format) + + assert format.layout == PLAIN + + for i in range(4): + swizzle = format.swizzles[i] + if swizzle < 4: + src_channel = format.channels[swizzle] + value = 'pixel.chan.%s' % src_channel.name + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + elif swizzle == SWIZZLE_0: + value = '0' + elif swizzle == SWIZZLE_1: + value = get_one(dst_channel) + elif swizzle == SWIZZLE_NONE: + value = '0' + else: + assert False + if format.colorspace == ZS: + if i == 3: + value = get_one(dst_channel) + elif i >= 1: + value = 'dst[0]' + print ' dst[%u] = %s; /* %s */' % (i, value, 'rgba'[i]) + + print '}' + print + + +def generate_format_pack(format, src_channel, src_native_type, src_suffix): + '''Generate the function to pack pixels to a particular format''' + + name = format.short_name() + + dst_native_type = native_type(format) + + print 'static INLINE void' + print 'util_format_%s_pack_%s(void *dst, %s r, %s g, %s b, %s a)' % (name, src_suffix, src_native_type, src_native_type, src_native_type, src_native_type) + print '{' + print ' union util_format_%s pixel;' % format.short_name() + + assert format.layout == PLAIN + + inv_swizzle = format.inv_swizzles() + + for i in range(4): + dst_channel = format.channels[i] + width = dst_channel.size + if inv_swizzle[i] is None: + continue + value = 'rgba'[inv_swizzle[i]] + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + if format.colorspace == ZS: + if i == 3: + value = get_one(dst_channel) + elif i >= 1: + value = '0' + print ' pixel.chan.%s = %s;' % (dst_channel.name, value) + + bswap_format(format) + print ' memcpy(dst, &pixel, sizeof pixel);' + print '}' + print + + +def generate_unpack(formats, dst_channel, dst_native_type, dst_suffix): + '''Generate the dispatch function to unpack pixels from any format''' + + for format in formats: + if is_format_supported(format): + generate_format_unpack(format, dst_channel, dst_native_type, dst_suffix) + + print 'static INLINE void' + print 'util_format_unpack_%s(enum pipe_format format, %s *dst, const void *src)' % (dst_suffix, dst_native_type) + print '{' + print ' void (*func)(%s *dst, const void *src);' % dst_native_type + print ' switch(format) {' + for format in formats: + if is_format_supported(format): + print ' case %s:' % format.name + print ' func = &util_format_%s_unpack_%s;' % (format.short_name(), dst_suffix) + print ' break;' + print ' default:' + print ' debug_printf("unsupported format\\n");' + print ' return;' + print ' }' + print ' func(dst, src);' + print '}' + print + + +def generate_pack(formats, src_channel, src_native_type, src_suffix): + '''Generate the dispatch function to pack pixels to any format''' + + for format in formats: + if is_format_supported(format): + generate_format_pack(format, src_channel, src_native_type, src_suffix) + + print 'static INLINE void' + print 'util_format_pack_%s(enum pipe_format format, void *dst, %s r, %s g, %s b, %s a)' % (src_suffix, src_native_type, src_native_type, src_native_type, src_native_type) + print '{' + print ' void (*func)(void *dst, %s r, %s g, %s b, %s a);' % (src_native_type, src_native_type, src_native_type, src_native_type) + print ' switch(format) {' + for format in formats: + if is_format_supported(format): + print ' case %s:' % format.name + print ' func = &util_format_%s_pack_%s;' % (format.short_name(), src_suffix) + print ' break;' + print ' default:' + print ' debug_printf("%s: unsupported format\\n", __FUNCTION__);' + print ' return;' + print ' }' + print ' func(dst, r, g, b, a);' + print '}' + print + + +def main(): + formats = [] + for arg in sys.argv[1:]: + formats.extend(parse(arg)) + + print '/* This file is autogenerated by u_format_pack.py from u_format.csv. Do not edit directly. */' + print + # This will print the copyright message on the top of this file + print __doc__.strip() + + print + print '#ifndef U_FORMAT_PACK_H' + print '#define U_FORMAT_PACK_H' + print + print '#include "pipe/p_compiler.h"' + print '#include "u_math.h"' + print '#include "u_format.h"' + print + + generate_clamp() + + for format in formats: + if format.layout == PLAIN: + generate_format_type(format) + + channel = Channel(FLOAT, False, 32) + native_type = 'float' + suffix = '4f' + + generate_unpack(formats, channel, native_type, suffix) + generate_pack(formats, channel, native_type, suffix) + + channel = Channel(UNSIGNED, True, 8) + native_type = 'uint8_t' + suffix = '4ub' + + generate_unpack(formats, channel, native_type, suffix) + generate_pack(formats, channel, native_type, suffix) + + print + print '#ifdef __cplusplus' + print '}' + print '#endif' + print + print '#endif /* ! U_FORMAT_PACK_H */' + + +if __name__ == '__main__': + main() diff --git a/src/gallium/drivers/llvmpipe/SConscript b/src/gallium/drivers/llvmpipe/SConscript index 71f9337422..13c1a13e87 100644 --- a/src/gallium/drivers/llvmpipe/SConscript +++ b/src/gallium/drivers/llvmpipe/SConscript @@ -21,6 +21,7 @@ env.CodeGenerate( # XXX: Our dependency scanner only finds depended modules in relative dirs. env.Depends('lp_tile_soa.c', [ '#src/gallium/auxiliary/util/u_format_parse.py', + '#src/gallium/auxiliary/util/u_format_pack.py', '#src/gallium/auxiliary/util/u_format_access.py', ]) diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.py b/src/gallium/drivers/llvmpipe/lp_tile_soa.py index dc44d67d63..00b8d4fc38 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.py +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.py @@ -90,7 +90,7 @@ def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): value = '(%s >> %u)' % (value, shift) if shift + width < format.block_size(): value = '(%s & 0x%x)' % (value, mask) - value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=False) print ' %s %s = %s;' % (dst_native_type, names[i], value) shift += width else: @@ -98,7 +98,7 @@ def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): src_channel = format.channels[i] if names[i]: value = '(*src_pixel++)' - value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=False) print ' %s %s = %s;' % (dst_native_type, names[i], value) else: assert False @@ -154,7 +154,7 @@ def pack_rgba(format, src_channel, r, g, b, a): if value: dst_channel = format.channels[i] dst_native_type = native_type(format) - value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=False) term = "((%s) << %d)" % (value, shift) if expr: expr = expr + " | " + term @@ -217,7 +217,7 @@ def emit_tile_pixel_write_code(format, src_channel): width = dst_channel.size if inv_swizzle[i] is not None: value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] - value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=False) if shift: value = '(%s << %u)' % (value, shift) print ' pixel |= %s;' % value @@ -228,7 +228,7 @@ def emit_tile_pixel_write_code(format, src_channel): dst_channel = format.channels[i] if inv_swizzle[i] is not None: value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i] - value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + value = conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=False) print ' *dst_pixel++ = %s;' % value else: assert False -- cgit v1.2.3 From c78f84eebb3943e7a2a1eed262d85d2f67f79beb Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 26 Feb 2010 16:46:09 +0000 Subject: util: Define SRGB's channels as normalized. A better approximation than uscaled... --- src/gallium/auxiliary/util/u_format.csv | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 50341e9752..b2ee247a6c 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -16,15 +16,15 @@ PIPE_FORMAT_A8L8_UNORM , plain, 1, 1, un8 , un8 , , , xxxy, r PIPE_FORMAT_L16_UNORM , plain, 1, 1, un16, , , , xxx1, rgb # SRGB formats -PIPE_FORMAT_L8_SRGB , plain, 1, 1, u8 , , , , xxx1, srgb -PIPE_FORMAT_A8L8_SRGB , plain, 1, 1, u8 , u8 , , , xxxy, srgb -PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, u8 , u8 , u8 , , zyx1, srgb -PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , wzyx, srgb -PIPE_FORMAT_R8G8B8X8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , wzy1, srgb -PIPE_FORMAT_A8R8G8B8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , zyxw, srgb -PIPE_FORMAT_X8R8G8B8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , zyx1, srgb -PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , yzwx, srgb -PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, u8 , u8 , u8 , u8 , yzw1, srgb +PIPE_FORMAT_L8_SRGB , plain, 1, 1, un8 , , , , xxx1, srgb +PIPE_FORMAT_A8L8_SRGB , plain, 1, 1, un8 , un8 , , , xxxy, srgb +PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , zyx1, srgb +PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, srgb +PIPE_FORMAT_R8G8B8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, srgb +PIPE_FORMAT_A8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, srgb +PIPE_FORMAT_X8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, srgb +PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, srgb +PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, srgb # Signed formats (typically used for bump map textures) PIPE_FORMAT_A8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb -- cgit v1.2.3 From 83f1183e769777df5ada4bf7add3390881f88d02 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 26 Feb 2010 10:34:19 -0700 Subject: glx: fix incorrect array stack memory allocation The array stack space wasn't allocated to the proper size. Fixes out of bounds memory writes when the client/array stack depth exceeds one. See fd.o bug 26768. --- src/glx/indirect_vertex_array.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/glx/indirect_vertex_array.c b/src/glx/indirect_vertex_array.c index ad9882528f..ec0e654cea 100644 --- a/src/glx/indirect_vertex_array.c +++ b/src/glx/indirect_vertex_array.c @@ -291,7 +291,8 @@ __glXInitVertexArrayState(__GLXcontext * gc) arrays->stack_index = 0; arrays->stack = malloc(sizeof(struct array_stack_state) - * arrays->num_arrays); + * arrays->num_arrays + * __GL_CLIENT_ATTRIB_STACK_DEPTH); } -- cgit v1.2.3 From 549ce307849f9d2d3d73a8e6c6a24a95416b06c1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 10:43:04 -0700 Subject: gallium/identity: remove unneeded path prefixes on #includes --- src/gallium/drivers/identity/id_drm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/identity/id_drm.c b/src/gallium/drivers/identity/id_drm.c index b89724e4f3..f258c38cd7 100644 --- a/src/gallium/drivers/identity/id_drm.c +++ b/src/gallium/drivers/identity/id_drm.c @@ -28,11 +28,11 @@ #include "state_tracker/drm_api.h" #include "util/u_memory.h" -#include "identity/id_drm.h" -#include "identity/id_screen.h" -#include "identity/id_public.h" -#include "identity/id_screen.h" -#include "identity/id_objects.h" +#include "id_drm.h" +#include "id_screen.h" +#include "id_public.h" +#include "id_screen.h" +#include "id_objects.h" struct identity_drm_api { -- cgit v1.2.3 From 3f9ec9aa96406356b1224c6926e263cb626b5c67 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 10:43:19 -0700 Subject: gallium/trace: remove unneeded path prefixes on #includes --- src/gallium/drivers/trace/tr_drm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/trace/tr_drm.c b/src/gallium/drivers/trace/tr_drm.c index b8adde77f1..2b4915003e 100644 --- a/src/gallium/drivers/trace/tr_drm.c +++ b/src/gallium/drivers/trace/tr_drm.c @@ -28,11 +28,11 @@ #include "state_tracker/drm_api.h" #include "util/u_memory.h" -#include "trace/tr_drm.h" -#include "trace/tr_screen.h" -#include "trace/tr_context.h" -#include "trace/tr_buffer.h" -#include "trace/tr_texture.h" +#include "tr_drm.h" +#include "tr_screen.h" +#include "tr_context.h" +#include "tr_buffer.h" +#include "tr_texture.h" struct trace_drm_api { -- cgit v1.2.3 From 298a0352862e748078c7c56acd2cfc96c67373d4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 10:43:56 -0700 Subject: softpipe: fix up #includes --- src/gallium/drivers/softpipe/sp_video_context.c | 8 +++++--- src/gallium/drivers/softpipe/sp_winsys.c | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index 7a3a636167..272ad40a90 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -25,10 +25,12 @@ * **************************************************************************/ +#include "util/u_inlines.h" +#include "util/u_memory.h" + #include "sp_video_context.h" -#include -#include -#include "softpipe/sp_texture.h" +#include "sp_texture.h" + static void sp_mpeg12_destroy(struct pipe_video_context *vpipe) diff --git a/src/gallium/drivers/softpipe/sp_winsys.c b/src/gallium/drivers/softpipe/sp_winsys.c index f6598927d3..0a6245ed2c 100644 --- a/src/gallium/drivers/softpipe/sp_winsys.c +++ b/src/gallium/drivers/softpipe/sp_winsys.c @@ -37,13 +37,13 @@ #include "util/u_simple_screen.h"/* port to just p_screen */ -#include "pipe/p_format.h" -#include "pipe/p_context.h" #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_inlines.h" -#include "softpipe/sp_winsys.h" +#include "pipe/p_format.h" +#include "pipe/p_context.h" +#include "sp_winsys.h" struct st_softpipe_buffer -- cgit v1.2.3 From d9c65ddd52199469c49fc0d3ad90fedb9a69274d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 10:44:41 -0700 Subject: gallium: remove unneeded -I path from Makefile.templast --- src/gallium/Makefile.template | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template index 713e192a4e..6b7c7c80a7 100644 --- a/src/gallium/Makefile.template +++ b/src/gallium/Makefile.template @@ -20,7 +20,6 @@ INCLUDES = \ -I. \ -I$(TOP)/src/gallium/include \ -I$(TOP)/src/gallium/auxiliary \ - -I$(TOP)/src/gallium/drivers \ $(LIBRARY_INCLUDES) -- cgit v1.2.3 From 5ed444a7a4e8f74100a3678c007ac120e8569229 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 10:54:05 -0700 Subject: gallium/nouveau: clean-up #includes --- src/gallium/drivers/nouveau/nouveau_context.c | 4 ++-- src/gallium/drivers/nouveau/nouveau_screen.c | 10 +++++----- src/gallium/drivers/nv30/nv30_transfer.c | 14 +++++++------- src/gallium/drivers/nv40/nv40_screen.h | 2 +- src/gallium/drivers/nv40/nv40_transfer.c | 14 +++++++------- 5 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_context.c b/src/gallium/drivers/nouveau/nouveau_context.c index 23443869e6..15174983e7 100644 --- a/src/gallium/drivers/nouveau/nouveau_context.c +++ b/src/gallium/drivers/nouveau/nouveau_context.c @@ -1,5 +1,5 @@ -#include -#include +#include "pipe/p_defines.h" +#include "pipe/p_context.h" #include "nouveau/nouveau_screen.h" #include "nouveau/nouveau_context.h" diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index 81bc296ab4..3c2f771b51 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -1,9 +1,9 @@ -#include -#include -#include +#include "pipe/p_defines.h" +#include "pipe/p_screen.h" +#include "pipe/p_state.h" -#include -#include +#include "util/u_memory.h" +#include "util/u_inlines.h" #include #include diff --git a/src/gallium/drivers/nv30/nv30_transfer.c b/src/gallium/drivers/nv30/nv30_transfer.c index 554bcbbdd0..3aeda51ea1 100644 --- a/src/gallium/drivers/nv30/nv30_transfer.c +++ b/src/gallium/drivers/nv30/nv30_transfer.c @@ -1,10 +1,10 @@ -#include -#include -#include -#include -#include -#include -#include +#include "pipe/p_state.h" +#include "pipe/p_defines.h" +#include "util/u_inlines.h" +#include "util/u_format.h" +#include "util/u_memory.h" +#include "util/u_math.h" +#include "nouveau/nouveau_winsys.h" #include "nv30_context.h" #include "nv30_screen.h" #include "nv30_state.h" diff --git a/src/gallium/drivers/nv40/nv40_screen.h b/src/gallium/drivers/nv40/nv40_screen.h index 9437aa050d..10a952c1fd 100644 --- a/src/gallium/drivers/nv40/nv40_screen.h +++ b/src/gallium/drivers/nv40/nv40_screen.h @@ -2,7 +2,7 @@ #define __NV40_SCREEN_H__ #include "nouveau/nouveau_screen.h" -#include "nouveau/nv04_surface_2d.h" +#include "nouveau/nv40_surface_2d.h" struct nv40_screen { struct nouveau_screen base; diff --git a/src/gallium/drivers/nv40/nv40_transfer.c b/src/gallium/drivers/nv40/nv40_transfer.c index ee266c6cfb..0462a042c3 100644 --- a/src/gallium/drivers/nv40/nv40_transfer.c +++ b/src/gallium/drivers/nv40/nv40_transfer.c @@ -1,10 +1,10 @@ -#include -#include -#include -#include -#include -#include -#include +#include "pipe/p_state.h" +#include "pipe/p_defines.h" +#include "util/u_inlines.h" +#include "util/u_format.h" +#include "util/u_memory.h" +#include "util/u_math.h" +#include "nouveau/nouveau_winsys.h" #include "nv40_context.h" #include "nv40_screen.h" #include "nv40_state.h" -- cgit v1.2.3 From ac56a44d5ee08ebfe2310113c6a04d2bc0f90e26 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 10:54:20 -0700 Subject: Revert "gallium: remove unneeded -I path from Makefile.templast" This reverts commit d9c65ddd52199469c49fc0d3ad90fedb9a69274d. Looks like the nouveau drivers need this. Perhaps the drivers could be fixed to add the extra -I path where needed. I'll leave that up to others. --- src/gallium/Makefile.template | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template index 6b7c7c80a7..713e192a4e 100644 --- a/src/gallium/Makefile.template +++ b/src/gallium/Makefile.template @@ -20,6 +20,7 @@ INCLUDES = \ -I. \ -I$(TOP)/src/gallium/include \ -I$(TOP)/src/gallium/auxiliary \ + -I$(TOP)/src/gallium/drivers \ $(LIBRARY_INCLUDES) -- cgit v1.2.3 From ea203de2d005b311d2f7f981523ae84494d6672a Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 26 Feb 2010 13:17:30 -0500 Subject: Set API dispatch pointers for OES_EGL_image functions This chunk fell through the cracks when I rebase the EGLImage patch series. --- src/mesa/main/api_exec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index f8e004af3f..70c154b62b 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -753,4 +753,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) /* GL_NV_conditional_render */ SET_BeginConditionalRenderNV(exec, _mesa_BeginConditionalRender); SET_EndConditionalRenderNV(exec, _mesa_EndConditionalRender); + +#if FEATURE_OES_EGL_image + SET_EGLImageTargetTexture2DOES(exec, _mesa_EGLImageTargetTexture2DOES); + SET_EGLImageTargetRenderbufferStorageOES(exec, _mesa_EGLImageTargetRenderbufferStorageOES); +#endif } -- cgit v1.2.3 From f89c237c2c35eb3ea554e8f9de036e9ead08173f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 11:58:05 -0700 Subject: gallium: added GENERATED_SOURCES var to Makefile.template For use in dependency checking and make clean. --- src/gallium/Makefile.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template index 713e192a4e..91a9b54b36 100644 --- a/src/gallium/Makefile.template +++ b/src/gallium/Makefile.template @@ -31,10 +31,10 @@ default: depend lib$(LIBNAME).a lib$(LIBNAME).a: $(OBJECTS) $(EXTRA_OBJECTS) Makefile $(TOP)/src/gallium/Makefile.template $(MKLIB) -o $(LIBNAME) -static $(OBJECTS) $(EXTRA_OBJECTS) -depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) +depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES) rm -f depend touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) 2> /dev/null + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null # Emacs tags tags: @@ -42,7 +42,7 @@ tags: # Remove .o and backup files clean: - rm -f $(OBJECTS) lib$(LIBNAME).a depend depend.bak + rm -f $(OBJECTS) $(GENERATED_SOURCES) lib$(LIBNAME).a depend depend.bak # Dummy target install: -- cgit v1.2.3 From f519d3d6b649780cc557159f783c330c2a70f93b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 11:58:54 -0700 Subject: gallium: define GENERATED auxiliary files Don't need special default dependency on u_format_pack.h anymore. --- src/gallium/auxiliary/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 39e328f514..60f9c2ae3c 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -160,6 +160,13 @@ GALLIVM_SOURCES = \ GALLIVM_CPP_SOURCES = \ gallivm/lp_bld_misc.cpp +GENERATED_SOURCES = \ + indices/u_indices_gen.c \ + indices/u_unfilled_gen.c \ + util/u_format_access.c \ + util/u_format_pack.h \ + util/u_format_table.c + ifeq ($(MESA_LLVM),1) C_SOURCES += \ @@ -190,4 +197,3 @@ util/u_format_pack.h: util/u_format_pack.py util/u_format_parse.py util/u_format util/u_format_access.c: util/u_format_access.py util/u_format_parse.py util/u_format.csv python util/u_format_access.py util/u_format.csv > $@ -default: util/u_format_pack.h -- cgit v1.2.3 From d7322c9d420e484bc3c7cecb873b04cf7da7f33a Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 26 Feb 2010 14:49:31 -0500 Subject: intel: Lookup requested renderbuffer in intel_create_image_from_renderbuffer Previously we'd use the current renderbuffer. --- src/mesa/drivers/dri/intel/intel_screen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index f19e2ee81d..bc394d048e 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -30,6 +30,7 @@ #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/hash.h" +#include "main/fbobject.h" #include "utils.h" #include "xmlpool.h" @@ -194,7 +195,7 @@ intel_create_image_from_renderbuffer(__DRIcontext *context, struct gl_renderbuffer *rb; struct intel_renderbuffer *irb; - rb = intel->ctx.CurrentRenderbuffer; + rb = _mesa_lookup_renderbuffer(&intel->ctx, renderbuffer); if (!rb) { _mesa_error(&intel->ctx, GL_INVALID_OPERATION, "glRenderbufferExternalMESA"); -- cgit v1.2.3 From 557c20b3091843fdec59069b2b85969a49943305 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Fri, 26 Feb 2010 14:51:11 -0500 Subject: egl_dri2: Implement EGL_KHR_gl_renderbuffer_image --- src/egl/drivers/dri2/egl_dri2.c | 166 +++++++++++++++++++++++++--------------- 1 file changed, 103 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 0c2dfe6dd4..d775b5e6a2 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -103,12 +103,6 @@ struct dri2_egl_image { _EGLImage base; __DRIimage *dri_image; - int width; - int height; - int name; - int pitch; - int cpp; - int format; }; /* standard typecasts */ @@ -694,6 +688,7 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, disp->ClientAPIsMask = EGL_OPENGL_BIT; disp->Extensions.KHR_image_base = EGL_TRUE; disp->Extensions.KHR_image_pixmap = EGL_TRUE; + disp->Extensions.KHR_gl_renderbuffer_image = EGL_TRUE; /* we're supporting EGL 1.4 */ *major = 1; @@ -1107,9 +1102,8 @@ dri2_release_tex_image(_EGLDriver *drv, } static _EGLImage * -dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp, - _EGLContext *ctx, EGLenum target, - EGLClientBuffer buffer, const EGLint *attr_list) +dri2_create_image_khr_pixmap(_EGLDisplay *disp, _EGLContext *ctx, + EGLClientBuffer buffer, const EGLint *attr_list) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx); @@ -1122,80 +1116,126 @@ dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp, xcb_get_geometry_cookie_t geometry_cookie; xcb_get_geometry_reply_t *geometry_reply; xcb_generic_error_t *error; + int stride, format; + + drawable = (xcb_drawable_t) buffer; + xcb_dri2_create_drawable (dri2_dpy->conn, drawable); + attachments[0] = XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT; + buffers_cookie = + xcb_dri2_get_buffers_unchecked (dri2_dpy->conn, + drawable, 1, 1, attachments); + geometry_cookie = xcb_get_geometry (dri2_dpy->conn, drawable); + buffers_reply = xcb_dri2_get_buffers_reply (dri2_dpy->conn, + buffers_cookie, NULL); + buffers = xcb_dri2_get_buffers_buffers (buffers_reply); + if (buffers == NULL) { + return NULL; + } + + geometry_reply = xcb_get_geometry_reply (dri2_dpy->conn, + geometry_cookie, &error); + if (geometry_reply == NULL || error != NULL) { + _eglError(EGL_BAD_ALLOC, "xcb_get_geometry"); + free(error); + free(buffers_reply); + } + + switch (geometry_reply->depth) { + case 16: + format = __DRI_IMAGE_FORMAT_RGB565; + break; + case 24: + format = __DRI_IMAGE_FORMAT_XRGB8888; + break; + case 32: + format = __DRI_IMAGE_FORMAT_ARGB8888; + break; + default: + _eglError(EGL_BAD_PARAMETER, + "dri2_create_image_khr: unsupported pixmap depth"); + free(buffers_reply); + free(geometry_reply); + return NULL; + } dri2_img = malloc(sizeof *dri2_img); if (!dri2_img) { + free(buffers_reply); + free(geometry_reply); _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr"); return EGL_NO_IMAGE_KHR; } - if (!_eglInitImage(&dri2_img->base, disp, attr_list)) + if (!_eglInitImage(&dri2_img->base, disp, attr_list)) { + free(buffers_reply); + free(geometry_reply); return EGL_NO_IMAGE_KHR; + } - switch (target) { - case EGL_NATIVE_PIXMAP_KHR: - drawable = (xcb_drawable_t) buffer; - xcb_dri2_create_drawable (dri2_dpy->conn, drawable); - attachments[0] = XCB_DRI2_ATTACHMENT_BUFFER_FRONT_LEFT; - buffers_cookie = - xcb_dri2_get_buffers_unchecked (dri2_dpy->conn, - drawable, 1, 1, attachments); - geometry_cookie = xcb_get_geometry (dri2_dpy->conn, drawable); - buffers_reply = xcb_dri2_get_buffers_reply (dri2_dpy->conn, - buffers_cookie, NULL); - buffers = xcb_dri2_get_buffers_buffers (buffers_reply); - if (buffers == NULL) { - free(dri2_img); - return NULL; - } + stride = buffers[0].pitch / buffers[0].cpp; + dri2_img->dri_image = + dri2_dpy->image->createImageFromName(dri2_ctx->dri_context, + buffers_reply->width, + buffers_reply->height, + format, + buffers[0].name, + stride, + dri2_img); - geometry_reply = xcb_get_geometry_reply (dri2_dpy->conn, - geometry_cookie, &error); - if (geometry_reply == NULL || error != NULL) { - _eglError(EGL_BAD_ALLOC, "xcb_get_geometry"); - free(error); - free(dri2_img); - free(buffers_reply); - } + free(buffers_reply); + free(geometry_reply); - dri2_img->width = buffers_reply->width; - dri2_img->height = buffers_reply->height; - dri2_img->name = buffers[0].name; - dri2_img->pitch = buffers[0].pitch / buffers[0].cpp; - dri2_img->cpp = buffers[0].cpp; - switch (geometry_reply->depth) { - case 16: - dri2_img->format = __DRI_IMAGE_FORMAT_RGB565; - break; - case 24: - dri2_img->format = __DRI_IMAGE_FORMAT_XRGB8888; - break; - case 32: - dri2_img->format = __DRI_IMAGE_FORMAT_ARGB8888; - break; - } - free(buffers_reply); - free(geometry_reply); - break; + return &dri2_img->base; +} - default: +static _EGLImage * +dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx, + EGLClientBuffer buffer, + const EGLint *attr_list) +{ + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx); + struct dri2_egl_image *dri2_img; + GLuint renderbuffer = (GLuint) buffer; + + if (renderbuffer == 0) { _eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr"); - free(dri2_img); return EGL_NO_IMAGE_KHR; } - dri2_img->dri_image = - dri2_dpy->image->createImageFromName(dri2_ctx->dri_context, - dri2_img->width, - dri2_img->height, - dri2_img->format, - dri2_img->name, - dri2_img->pitch, - dri2_img); + dri2_img = malloc(sizeof *dri2_img); + if (!dri2_img) { + _eglError(EGL_BAD_ALLOC, "dri2_create_image_khr"); + return EGL_NO_IMAGE_KHR; + } + + if (!_eglInitImage(&dri2_img->base, disp, attr_list)) + return EGL_NO_IMAGE_KHR; + + dri2_img->dri_image = + dri2_dpy->image->createImageFromRenderbuffer(dri2_ctx->dri_context, + renderbuffer, + dri2_img); return &dri2_img->base; } +static _EGLImage * +dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp, + _EGLContext *ctx, EGLenum target, + EGLClientBuffer buffer, const EGLint *attr_list) +{ + switch (target) { + case EGL_NATIVE_PIXMAP_KHR: + return dri2_create_image_khr_pixmap(disp, ctx, buffer, attr_list); + case EGL_GL_RENDERBUFFER_KHR: + return dri2_create_image_khr_renderbuffer(disp, ctx, buffer, attr_list); + default: + _eglError(EGL_BAD_PARAMETER, "dri2_create_image_khr"); + return EGL_NO_IMAGE_KHR; + } +} + static EGLBoolean dri2_destroy_image_khr(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *image) { -- cgit v1.2.3 From d1fe9bcc3f07a73b3122851731d5081580d8bb8f Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Fri, 26 Feb 2010 21:11:07 +0100 Subject: nv40: fix include of nv04_surface_2d.h --- src/gallium/drivers/nv40/nv40_screen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv40/nv40_screen.h b/src/gallium/drivers/nv40/nv40_screen.h index 10a952c1fd..9437aa050d 100644 --- a/src/gallium/drivers/nv40/nv40_screen.h +++ b/src/gallium/drivers/nv40/nv40_screen.h @@ -2,7 +2,7 @@ #define __NV40_SCREEN_H__ #include "nouveau/nouveau_screen.h" -#include "nouveau/nv40_surface_2d.h" +#include "nouveau/nv04_surface_2d.h" struct nv40_screen { struct nouveau_screen base; -- cgit v1.2.3 From 424a8385e4d07860c6deca12c43d6c31698a29ed Mon Sep 17 00:00:00 2001 From: Klaus Schnass Date: Fri, 26 Feb 2010 15:09:50 -0500 Subject: r600: fail to validate unsupported texture formats --- src/mesa/drivers/dri/r600/r600_texstate.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index dd33ef3c6a..1600033b9b 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -373,17 +373,11 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa break; */ case MESA_FORMAT_RGB_DXT1: /* not supported yet */ - - break; case MESA_FORMAT_RGBA_DXT1: /* not supported yet */ - - break; case MESA_FORMAT_RGBA_DXT3: /* not supported yet */ - - break; case MESA_FORMAT_RGBA_DXT5: /* not supported yet */ + return GL_FALSE; - break; case MESA_FORMAT_RGBA_FLOAT32: SETfield(t->SQ_TEX_RESOURCE1, FMT_32_32_32_32_FLOAT, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); @@ -701,8 +695,8 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj) t = radeon_tex_obj(tObj); - r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat); - + if(!r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat)) + t->validated = GL_FALSE; } /** @@ -711,7 +705,7 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj) * \param rmesa Context pointer * \param t the r300 texture object */ -static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texObj, int unit) +static GLboolean setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texObj, int unit) { context_t *rmesa = R700_CONTEXT(ctx); radeonTexObj *t = radeon_tex_obj(texObj); @@ -721,15 +715,15 @@ static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texO if (rmesa->radeon.radeonScreen->driScreen->dri2.enabled && t->image_override && t->bo) - return; + return GL_TRUE; firstImage = t->base.Image[0][t->minLod]; if (!t->image_override) { if (!r600GetTexFormat(texObj, firstImage->TexFormat)) { - radeon_error("unexpected texture format in %s\n", - __FUNCTION__); - return; + radeon_warning("unsupported texture format in %s\n", + __FUNCTION__); + return GL_FALSE; } } @@ -754,7 +748,7 @@ static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texO break; default: radeon_error("unexpected texture target type in %s\n", __FUNCTION__); - return; + return GL_FALSE; } row_align = rmesa->radeon.texture_row_align - 1; @@ -799,6 +793,7 @@ static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texO CLEARfield(t->SQ_TEX_SAMPLER0, DEPTH_COMPARE_FUNCTION_mask); } + return GL_TRUE; } /** @@ -815,7 +810,8 @@ static GLboolean r600_validate_texture(GLcontext * ctx, struct gl_texture_object /* Configure the hardware registers (more precisely, the cached version * of the hardware registers). */ - setup_hardware_state(ctx, texObj, unit); + if (!setup_hardware_state(ctx, texObj, unit)) + return GL_FALSE; t->validated = GL_TRUE; return GL_TRUE; -- cgit v1.2.3 From 52eb2ef6bf4e3327ed008c691efb821ecaa422b2 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 26 Feb 2010 15:24:12 -0500 Subject: r600: enable OQ on rv740 on drms with working pipe config --- src/mesa/drivers/dri/r600/r600_context.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index f575e74c3e..1a4b014d9f 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -340,9 +340,12 @@ static void r600InitGLExtensions(GLcontext *ctx) _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } - /* XXX: RV740 only seems to report results from half of its DBs */ - if (r600->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV740) - _mesa_disable_extension(ctx, "GL_ARB_occlusion_query"); + /* RV740 had a broken pipe config prior to drm 1.32 */ + if (!r600->radeon.radeonScreen->kernel_mm) { + if ((r600->radeon.dri.drmMinor < 32) && + (r600->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV740)) + _mesa_disable_extension(ctx, "GL_ARB_occlusion_query"); + } } /* Create the device specific rendering context. -- cgit v1.2.3 From 4fd43b09224c0e3b37de54e24508dcea5cd50dd8 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Tue, 9 Feb 2010 22:54:15 +0100 Subject: vmware: Update vmwgfx_drm.h to kernel version. Signed-off-by: Thomas Hellstrom --- src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h index 1457966db8..47914bdb71 100644 --- a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h +++ b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h @@ -260,15 +260,23 @@ union drm_vmw_surface_reference_arg { * to the nearest kernel tick. * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an * uint64_t. + * @version: Allows expanding the execbuf ioctl parameters without breaking + * backwards compatibility, since user-space will always tell the kernel + * which version it uses. + * @flags: Execbuf flags. None currently. * * Argument to the DRM_VMW_EXECBUF Ioctl. */ +#define DRM_VMW_EXECBUF_VERSION 0 + struct drm_vmw_execbuf_arg { uint64_t commands; uint32_t command_size; uint32_t throttle_us; uint64_t fence_rep; + uint32_t version; + uint32_t flags; }; /** -- cgit v1.2.3 From 0a1b760cd274aff96d68757dabf9caa077119f37 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Mon, 15 Feb 2010 14:24:51 +0100 Subject: st/xorg, vmware/xorg: Fix xnfcalloc arguments. Signed-off-by: Thomas Hellstrom --- src/gallium/state_trackers/xorg/xorg_driver.c | 2 +- src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index f53a879a14..90b8b8b465 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -155,7 +155,7 @@ drv_get_rec(ScrnInfoPtr pScrn) if (pScrn->driverPrivate) return TRUE; - pScrn->driverPrivate = xnfcalloc(sizeof(modesettingRec), 1); + pScrn->driverPrivate = xnfcalloc(1, sizeof(modesettingRec)); return TRUE; } diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c index 7c9757cce9..0d255d2726 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c @@ -87,7 +87,7 @@ vmw_screen_init(ScrnInfoPtr pScrn) modesettingPtr ms = modesettingPTR(pScrn); struct vmw_driver *vmw; - vmw = xnfcalloc(sizeof(*vmw), 1); + vmw = xnfcalloc(1, sizeof(*vmw)); if (!vmw) return FALSE; -- cgit v1.2.3 From d11f9a7bd83b7f0ea9ee959a764b77a4c3c55969 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 11 Feb 2010 14:41:40 +0100 Subject: drm/vmware: Latest interface changes are backwards incopatible Since the execbuffer change actually changed size off the ioctl struct and not just a reuse of padded bits, we can't support old kernels as easily as the scanout change was. --- src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c index 1dcbc419db..a7c6e88b9e 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c @@ -49,7 +49,7 @@ static struct dri1_api_version ddx_required = { 0, 1, 0 }; static struct dri1_api_version ddx_compat = { 0, 0, 0 }; static struct dri1_api_version dri_required = { 4, 0, 0 }; static struct dri1_api_version dri_compat = { 4, 0, 0 }; -static struct dri1_api_version drm_required = { 0, 1, 0 }; +static struct dri1_api_version drm_required = { 1, 0, 0 }; static struct dri1_api_version drm_compat = { 1, 0, 0 }; static struct dri1_api_version drm_scanout = { 0, 9, 0 }; -- cgit v1.2.3 From 1eb5b42097fe2cf6e9d87db72dc004379e424101 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 18 Feb 2010 15:51:59 +0100 Subject: st/xorg: Make default of debugging fallbacks smart Set it to the same as 2d acceleration --- src/gallium/state_trackers/xorg/xorg_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 90b8b8b465..ad4f38f450 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -673,7 +673,7 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); ms->accelerate_2d = xf86ReturnOptValBool(ms->Options, OPTION_2D_ACCEL, FALSE); - ms->debug_fallback = xf86ReturnOptValBool(ms->Options, OPTION_DEBUG_FALLBACK, TRUE); + ms->debug_fallback = xf86ReturnOptValBool(ms->Options, OPTION_DEBUG_FALLBACK, ms->accelerate_2d); if (ms->screen) { ms->exa = xorg_exa_init(pScrn, ms->accelerate_2d); -- cgit v1.2.3 From dfe0cc4b021572bd4646630cf9faec2492cbf416 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 18 Feb 2010 15:53:42 +0100 Subject: st/xorg: A bit more debugging info --- src/gallium/state_trackers/xorg/xorg_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index ad4f38f450..b92f643bff 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -684,6 +684,11 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #endif } + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "##################################\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "# Usefull debugging info follows #\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "##################################\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using %s backend\n", + ms->screen ? "Gallium3D" : "libkms"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "2D Acceleration is %s\n", ms->screen && ms->accelerate_2d ? "enabled" : "disabled"); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Fallback debugging is %s\n", @@ -694,6 +699,7 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #else xf86DrvMsg(pScrn->scrnIndex, X_INFO, "3D Acceleration is disabled\n"); #endif + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "##################################\n"); miInitializeBackingStore(pScreen); xf86SetBackingStore(pScreen); -- cgit v1.2.3 From ab8a232b2cad965501e3778219e957509a078757 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 18 Feb 2010 16:02:03 +0100 Subject: vmware/xorg: Export modinfo just as the other vmware X drivers does --- src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c | 45 +++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c index cd273d091f..bc5d39f749 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c @@ -33,12 +33,50 @@ #include "vmw_hook.h" + +/* + * Defines and modinfo + */ + +#define VMWGFX_DRIVER_NAME "vmwgfx" + +#define VMW_STRING_INNER(s) #s +#define VMW_STRING(str) VMW_STRING_INNER(str) + +#define VMWGFX_VERSION_MAJOR 10 +#define VMWGFX_VERSION_MINOR 16 +#define VMWGFX_VERSION_PATCH 9 +#define VMWGFX_VERSION_STRING_MAJOR VMW_STRING(VMWGFX_VERSION_MAJOR) +#define VMWGFX_VERSION_STRING_MINOR VMW_STRING(VMWGFX_VERSION_MINOR) +#define VMWGFX_VERSION_STRING_PATCH VMW_STRING(VMWGFX_VERSION_PATCH) + +#define VMWGFX_DRIVER_VERSION \ + (VMWGFX_VERSION_MAJOR * 65536 + VMWGFX_VERSION_MINOR * 256 + VMWGFX_VERSION_PATCH) +#define VMWGFX_DRIVER_VERSION_STRING \ + VMWGFX_VERSION_STRING_MAJOR "." VMWGFX_VERSION_STRING_MINOR \ + "." VMWGFX_VERSION_STRING_PATCH + +/* + * Standard four digit version string expected by VMware Tools installer. + * As the driver's version is only {major, minor, patchlevel}, simply append an + * extra zero for the fourth digit. + */ +#ifdef __GNUC__ +_X_EXPORT const char vmwgfx_drv_modinfo[] __attribute__((section(".modinfo"),unused)) = + "version=" VMWGFX_DRIVER_VERSION_STRING ".0"; +#endif + static void vmw_xorg_identify(int flags); _X_EXPORT Bool vmw_xorg_pci_probe(DriverPtr driver, int entity_num, struct pci_device *device, intptr_t match_data); + +/* + * Tables + */ + static const struct pci_id_match vmw_xorg_device_match[] = { {0x15ad, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0}, @@ -55,12 +93,12 @@ static PciChipsets vmw_xorg_pci_devices[] = { }; static XF86ModuleVersionInfo vmw_xorg_version = { - "vmwgfx", + VMWGFX_DRIVER_NAME, MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, - 0, 1, 0, /* major, minor, patch */ + VMWGFX_VERSION_MAJOR, VMWGFX_VERSION_MINOR, VMWGFX_VERSION_PATCH, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_VIDEODRV, @@ -73,7 +111,7 @@ static XF86ModuleVersionInfo vmw_xorg_version = { _X_EXPORT DriverRec vmwgfx = { 1, - "vmwgfx", + VMWGFX_DRIVER_NAME, vmw_xorg_identify, NULL, xorg_tracker_available_options, @@ -92,6 +130,7 @@ _X_EXPORT XF86ModuleData vmwgfxModuleData = { NULL }; + /* * Xorg driver functions */ -- cgit v1.2.3 From 55e5737bae6b88c2d1bc4c0d94e11548518659b8 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Mon, 15 Feb 2010 14:10:19 +0100 Subject: st/xorg: Encapsulate all customizable stuff in a separate class. This avoids exposing the ms driver structure to the winsys, and nicely encapsulates driver customizable stuff. In the future more things might be customizable by the winsys, like throttling, 3D readback etc. Signed-off-by: Thomas Hellstrom --- src/gallium/state_trackers/xorg/xorg_driver.c | 35 +++++++++--- src/gallium/state_trackers/xorg/xorg_tracker.h | 18 ++++--- src/gallium/winsys/drm/vmware/xorg/vmw_driver.h | 36 +++++++------ src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c | 20 +++---- src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 72 ++++++++++++------------- src/gallium/winsys/drm/vmware/xorg/vmw_video.c | 31 ++++++----- 6 files changed, 121 insertions(+), 91 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index b92f643bff..5397ee777a 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -333,6 +333,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags) EntityInfoPtr pEnt; EntPtr msEnt = NULL; int max_width, max_height; + CustomizerPtr cust; if (pScrn->numEntities != 1) return FALSE; @@ -344,6 +345,9 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags) return TRUE; } + cust = (CustomizerPtr) pScrn->driverPrivate; + pScrn->driverPrivate = NULL; + /* Allocate driverPrivate */ if (!drv_get_rec(pScrn)) return FALSE; @@ -351,6 +355,7 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags) ms = modesettingPTR(pScrn); ms->SaveGeneration = -1; ms->pEnt = pEnt; + ms->cust = cust; pScrn->displayWidth = 640; /* default it */ @@ -608,6 +613,7 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; modesettingPtr ms = modesettingPTR(pScrn); VisualPtr visual; + CustomizerPtr cust = ms->cust; if (!drv_init_drm(pScrn)) { FatalError("Could not init DRM"); @@ -731,8 +737,8 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); - if (ms->winsys_screen_init) - ms->winsys_screen_init(pScrn); + if (cust && cust->winsys_screen_init) + cust->winsys_screen_init(cust, ms->fd); return drv_enter_vt(scrnIndex, 1); } @@ -765,10 +771,11 @@ drv_leave_vt(int scrnIndex, int flags) ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; modesettingPtr ms = modesettingPTR(pScrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + CustomizerPtr cust = ms->cust; int o; - if (ms->winsys_leave_vt) - ms->winsys_leave_vt(pScrn); + if (cust && cust->winsys_leave_vt) + cust->winsys_leave_vt(cust); for (o = 0; o < config->num_crtc; o++) { xf86CrtcPtr crtc = config->crtc[o]; @@ -802,6 +809,7 @@ drv_enter_vt(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; modesettingPtr ms = modesettingPTR(pScrn); + CustomizerPtr cust = ms->cust; if (drmSetMaster(ms->fd)) { if (errno == EINVAL) { @@ -832,8 +840,8 @@ drv_enter_vt(int scrnIndex, int flags) if (!xf86SetDesiredModes(pScrn)) return FALSE; - if (ms->winsys_enter_vt) - ms->winsys_enter_vt(pScrn); + if (cust && cust->winsys_enter_vt) + cust->winsys_enter_vt(cust); return TRUE; } @@ -851,13 +859,14 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; modesettingPtr ms = modesettingPTR(pScrn); + CustomizerPtr cust = ms->cust; if (pScrn->vtSema) { drv_leave_vt(scrnIndex, 0); } - if (ms->winsys_screen_close) - ms->winsys_screen_close(pScrn); + if (cust && cust->winsys_screen_close) + cust->winsys_screen_close(cust); #ifdef DRI2 if (ms->screen) @@ -1119,4 +1128,14 @@ static Bool drv_init_front_buffer_functions(ScrnInfoPtr pScrn) return TRUE; } +CustomizerPtr xorg_customizer(ScrnInfoPtr pScrn) +{ + return modesettingPTR(pScrn)->cust; +} + +Bool xorg_has_gallium(ScrnInfoPtr pScrn) +{ + return modesettingPTR(pScrn)->screen != NULL; +} + /* vim: set sw=4 ts=8 sts=4: */ diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index 58bb60a721..2f5cc64d9c 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -67,6 +67,14 @@ typedef struct #define XORG_NR_FENCES 3 +typedef struct _CustomizerRec +{ + Bool (*winsys_screen_init)(struct _CustomizerRec *cust, int fd); + Bool (*winsys_screen_close)(struct _CustomizerRec *cust); + Bool (*winsys_enter_vt)(struct _CustomizerRec *cust); + Bool (*winsys_leave_vt)(struct _CustomizerRec *cust); +} CustomizerRec, *CustomizerPtr; + typedef struct _modesettingRec { /* drm */ @@ -117,12 +125,7 @@ typedef struct _modesettingRec Bool accelerate_2d; Bool debug_fallback; - /* winsys hocks */ - Bool (*winsys_screen_init)(ScrnInfoPtr pScr); - Bool (*winsys_screen_close)(ScrnInfoPtr pScr); - Bool (*winsys_enter_vt)(ScrnInfoPtr pScr); - Bool (*winsys_leave_vt)(ScrnInfoPtr pScr); - void *winsys_priv; + CustomizerPtr cust; #ifdef DRM_MODE_FEATURE_DIRTYFB DamagePtr damage; @@ -131,6 +134,9 @@ typedef struct _modesettingRec #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) +CustomizerPtr xorg_customizer(ScrnInfoPtr pScrn); + +Bool xorg_has_gallium(ScrnInfoPtr pScrn); /*********************************************************************** * xorg_exa.c diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h index 3efe851a4b..ba754b51e4 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h @@ -40,8 +40,11 @@ struct vmw_dma_buffer; -struct vmw_driver +struct vmw_customizer { + CustomizerRec base; + ScrnInfoPtr pScrn; + int fd; void *cursor_priv; @@ -50,11 +53,10 @@ struct vmw_driver void *video_priv; }; -static INLINE struct vmw_driver * -vmw_driver(ScrnInfoPtr pScrn) +static INLINE struct vmw_customizer * +vmw_customizer(CustomizerPtr cust) { - modesettingPtr ms = modesettingPTR(pScrn); - return ms ? (struct vmw_driver *)ms->winsys_priv : NULL; + return cust ? (struct vmw_customizer *) cust : NULL; } @@ -62,40 +64,40 @@ vmw_driver(ScrnInfoPtr pScrn) * vmw_video.c */ -Bool vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw); +Bool vmw_video_init(struct vmw_customizer *vmw); -Bool vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw); +Bool vmw_video_close(struct vmw_customizer *vmw); -void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw); +void vmw_video_stop_all(struct vmw_customizer *vmw); /*********************************************************************** * vmw_ioctl.c */ -int vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot); +int vmw_ioctl_cursor_bypass(struct vmw_customizer *vmw, int xhot, int yhot); -struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw, +struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *handle); -void * vmw_ioctl_buffer_map(struct vmw_driver *vmw, +void * vmw_ioctl_buffer_map(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf); -void vmw_ioctl_buffer_unmap(struct vmw_driver *vmw, +void vmw_ioctl_buffer_unmap(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf); -void vmw_ioctl_buffer_destroy(struct vmw_driver *vmw, +void vmw_ioctl_buffer_destroy(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf); -int vmw_ioctl_supports_streams(struct vmw_driver *vmw); +int vmw_ioctl_supports_streams(struct vmw_customizer *vmw); -int vmw_ioctl_num_streams(struct vmw_driver *vmw, +int vmw_ioctl_num_streams(struct vmw_customizer *vmw, uint32_t *ntot, uint32_t *nfree); -int vmw_ioctl_unref_stream(struct vmw_driver *vmw, uint32_t stream_id); +int vmw_ioctl_unref_stream(struct vmw_customizer *vmw, uint32_t stream_id); -int vmw_ioctl_claim_stream(struct vmw_driver *vmw, uint32_t *out); +int vmw_ioctl_claim_stream(struct vmw_customizer *vmw, uint32_t *out); #endif diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c index ab2b5fadc4..521578ab35 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c @@ -57,7 +57,7 @@ struct vmw_dma_buffer }; static int -vmw_ioctl_get_param(struct vmw_driver *vmw, uint32_t param, uint64_t *out) +vmw_ioctl_get_param(struct vmw_customizer *vmw, uint32_t param, uint64_t *out) { struct drm_vmw_getparam_arg gp_arg; int ret; @@ -75,7 +75,7 @@ vmw_ioctl_get_param(struct vmw_driver *vmw, uint32_t param, uint64_t *out) } int -vmw_ioctl_supports_streams(struct vmw_driver *vmw) +vmw_ioctl_supports_streams(struct vmw_customizer *vmw) { uint64_t value; int ret; @@ -88,7 +88,7 @@ vmw_ioctl_supports_streams(struct vmw_driver *vmw) } int -vmw_ioctl_num_streams(struct vmw_driver *vmw, +vmw_ioctl_num_streams(struct vmw_customizer *vmw, uint32_t *ntot, uint32_t *nfree) { uint64_t v1, v2; @@ -109,7 +109,7 @@ vmw_ioctl_num_streams(struct vmw_driver *vmw, } int -vmw_ioctl_claim_stream(struct vmw_driver *vmw, uint32_t *out) +vmw_ioctl_claim_stream(struct vmw_customizer *vmw, uint32_t *out) { struct drm_vmw_stream_arg s_arg; int ret; @@ -125,7 +125,7 @@ vmw_ioctl_claim_stream(struct vmw_driver *vmw, uint32_t *out) } int -vmw_ioctl_unref_stream(struct vmw_driver *vmw, uint32_t stream_id) +vmw_ioctl_unref_stream(struct vmw_customizer *vmw, uint32_t stream_id) { struct drm_vmw_stream_arg s_arg; int ret; @@ -140,7 +140,7 @@ vmw_ioctl_unref_stream(struct vmw_driver *vmw, uint32_t stream_id) } int -vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot) +vmw_ioctl_cursor_bypass(struct vmw_customizer *vmw, int xhot, int yhot) { struct drm_vmw_cursor_bypass_arg arg; int ret; @@ -157,7 +157,7 @@ vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot) } struct vmw_dma_buffer * -vmw_ioctl_buffer_create(struct vmw_driver *vmw, uint32_t size, unsigned *handle) +vmw_ioctl_buffer_create(struct vmw_customizer *vmw, uint32_t size, unsigned *handle) { struct vmw_dma_buffer *buf; union drm_vmw_alloc_dmabuf_arg arg; @@ -198,7 +198,7 @@ err: } void -vmw_ioctl_buffer_destroy(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) +vmw_ioctl_buffer_destroy(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf) { struct drm_vmw_unref_dmabuf_arg arg; @@ -215,7 +215,7 @@ vmw_ioctl_buffer_destroy(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) } void * -vmw_ioctl_buffer_map(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) +vmw_ioctl_buffer_map(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf) { void *map; @@ -236,7 +236,7 @@ vmw_ioctl_buffer_map(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) } void -vmw_ioctl_buffer_unmap(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) +vmw_ioctl_buffer_unmap(struct vmw_customizer *vmw, struct vmw_dma_buffer *buf) { --buf->map_count; } diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c index 0d255d2726..f43f91e5c0 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c @@ -41,7 +41,8 @@ xf86CrtcFuncsRec vmw_screen_crtc_funcs; static void vmw_screen_cursor_load_argb(xf86CrtcPtr crtc, CARD32 *image) { - struct vmw_driver *vmw = modesettingPTR(crtc->scrn)->winsys_priv; + struct vmw_customizer *vmw = + vmw_customizer(xorg_customizer(crtc->scrn)); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); xf86CrtcFuncsPtr funcs = vmw->cursor_priv; CursorPtr c = config->cursor; @@ -53,8 +54,9 @@ vmw_screen_cursor_load_argb(xf86CrtcPtr crtc, CARD32 *image) } static void -vmw_screen_cursor_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +vmw_screen_cursor_init(struct vmw_customizer *vmw) { + ScrnInfoPtr pScrn = vmw->pScrn; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int i; @@ -70,9 +72,9 @@ vmw_screen_cursor_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw) } static void -vmw_screen_cursor_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +vmw_screen_cursor_close(struct vmw_customizer *vmw) { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(vmw->pScrn); int i; vmw_ioctl_cursor_bypass(vmw, 0, 0); @@ -82,50 +84,39 @@ vmw_screen_cursor_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) } static Bool -vmw_screen_init(ScrnInfoPtr pScrn) +vmw_screen_init(CustomizerPtr cust, int fd) { - modesettingPtr ms = modesettingPTR(pScrn); - struct vmw_driver *vmw; - - vmw = xnfcalloc(1, sizeof(*vmw)); - if (!vmw) - return FALSE; - - vmw->fd = ms->fd; - ms->winsys_priv = vmw; + struct vmw_customizer *vmw = vmw_customizer(cust); - vmw_screen_cursor_init(pScrn, vmw); + vmw->fd = fd; + vmw_screen_cursor_init(vmw); /* if gallium is used then we don't need to do anything more. */ - if (ms->screen) + if (xorg_has_gallium(vmw->pScrn)) return TRUE; - vmw_video_init(pScrn, vmw); + vmw_video_init(vmw); return TRUE; } static Bool -vmw_screen_close(ScrnInfoPtr pScrn) +vmw_screen_close(CustomizerPtr cust) { - modesettingPtr ms = modesettingPTR(pScrn); - struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_customizer *vmw = vmw_customizer(cust); if (!vmw) return TRUE; - vmw_screen_cursor_close(pScrn, vmw); + vmw_screen_cursor_close(vmw); - vmw_video_close(pScrn, vmw); - - ms->winsys_priv = NULL; - xfree(vmw); + vmw_video_close(vmw); return TRUE; } static Bool -vmw_screen_enter_vt(ScrnInfoPtr pScrn) +vmw_screen_enter_vt(CustomizerPtr cust) { debug_printf("%s: enter\n", __func__); @@ -133,13 +124,13 @@ vmw_screen_enter_vt(ScrnInfoPtr pScrn) } static Bool -vmw_screen_leave_vt(ScrnInfoPtr pScrn) +vmw_screen_leave_vt(CustomizerPtr cust) { - struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_customizer *vmw = vmw_customizer(cust); debug_printf("%s: enter\n", __func__); - vmw_video_stop_all(pScrn, vmw); + vmw_video_stop_all(vmw); return TRUE; } @@ -153,18 +144,27 @@ static Bool (*vmw_screen_pre_init_saved)(ScrnInfoPtr pScrn, int flags) = NULL; static Bool vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags) { - modesettingPtr ms; + struct vmw_customizer *vmw; + CustomizerPtr cust; + + vmw = xnfcalloc(1, sizeof(*vmw)); + if (!vmw) + return FALSE; + + cust = &vmw->base; + + cust->winsys_screen_init = vmw_screen_init; + cust->winsys_screen_close = vmw_screen_close; + cust->winsys_enter_vt = vmw_screen_enter_vt; + cust->winsys_leave_vt = vmw_screen_leave_vt; + vmw->pScrn = pScrn; + + pScrn->driverPrivate = cust; pScrn->PreInit = vmw_screen_pre_init_saved; if (!pScrn->PreInit(pScrn, flags)) return FALSE; - ms = modesettingPTR(pScrn); - ms->winsys_screen_init = vmw_screen_init; - ms->winsys_screen_close = vmw_screen_close; - ms->winsys_enter_vt = vmw_screen_enter_vt; - ms->winsys_leave_vt = vmw_screen_leave_vt; - return TRUE; } diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c index ff3b992d07..de28f06a47 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c @@ -226,7 +226,7 @@ static void vmw_xv_query_best_size(ScrnInfoPtr pScrn, Bool motion, /* * Local functions. */ -static XF86VideoAdaptorPtr vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_driver *vmw); +static XF86VideoAdaptorPtr vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw); static int vmw_video_port_init(ScrnInfoPtr pScrn, struct vmw_video_port *port, @@ -243,9 +243,9 @@ static int vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port, short height, RegionPtr clipBoxes); static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmw_video_port *port); -static int vmw_video_buffer_alloc(struct vmw_driver *vmw, int size, +static int vmw_video_buffer_alloc(struct vmw_customizer *vmw, int size, struct vmw_video_buffer *out); -static int vmw_video_buffer_free(struct vmw_driver *vmw, +static int vmw_video_buffer_free(struct vmw_customizer *vmw, struct vmw_video_buffer *out); @@ -267,8 +267,9 @@ static int vmw_video_buffer_free(struct vmw_driver *vmw, */ Bool -vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +vmw_video_init(struct vmw_customizer *vmw) { + ScrnInfoPtr pScrn = vmw->pScrn; ScreenPtr pScreen = pScrn->pScreen; XF86VideoAdaptorPtr *overlayAdaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL; @@ -345,8 +346,9 @@ vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw) */ Bool -vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +vmw_video_close(struct vmw_customizer *vmw) { + ScrnInfoPtr pScrn = vmw->pScrn; struct vmw_video_private *video; int i; @@ -387,8 +389,9 @@ vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) *----------------------------------------------------------------------------- */ -void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +void vmw_video_stop_all(struct vmw_customizer *vmw) { + ScrnInfoPtr pScrn = vmw->pScrn; struct vmw_video_private *video = vmw->video_priv; int i; @@ -421,7 +424,7 @@ void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw) */ static XF86VideoAdaptorPtr -vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_customizer *vmw) { XF86VideoAdaptorPtr adaptor; struct vmw_video_private *video; @@ -515,7 +518,7 @@ vmw_video_port_init(ScrnInfoPtr pScrn, struct vmw_video_port *port, unsigned char *buf, short width, short height, RegionPtr clipBoxes) { - struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn)); unsigned short w, h; int i, ret; @@ -583,7 +586,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port, unsigned char *buf, short width, short height, RegionPtr clipBoxes) { - struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn)); struct drm_vmw_control_stream_arg arg; unsigned short w, h; int size; @@ -675,7 +678,7 @@ vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port, static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmw_video_port *port) { - struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn)); uint32 id, colorKey, flags; Bool isAutoPaintColorkey; int i; @@ -721,7 +724,7 @@ vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmw_video_port *port) */ static int -vmw_video_buffer_alloc(struct vmw_driver *vmw, int size, +vmw_video_buffer_alloc(struct vmw_customizer *vmw, int size, struct vmw_video_buffer *out) { out->buf = vmw_ioctl_buffer_create(vmw, size, &out->handle); @@ -764,7 +767,7 @@ vmw_video_buffer_alloc(struct vmw_driver *vmw, int size, */ static int -vmw_video_buffer_free(struct vmw_driver *vmw, +vmw_video_buffer_free(struct vmw_customizer *vmw, struct vmw_video_buffer *out) { if (out->size == 0) @@ -814,7 +817,7 @@ vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr dst) { - struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn)); struct vmw_video_port *port = data; debug_printf("%s: enter (%u, %u) (%ux%u) (%u, %u) (%ux%u) (%ux%u)\n", __func__, @@ -852,7 +855,7 @@ vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y, static void vmw_xv_stop_video(ScrnInfoPtr pScrn, pointer data, Bool cleanup) { - struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_customizer *vmw = vmw_customizer(xorg_customizer(pScrn)); struct vmw_video_port *port = data; struct drm_vmw_control_stream_arg arg; int ret; -- cgit v1.2.3 From bad4b29d77817b54ab9b19ff9c8a0e5bf2de00fa Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 22 Feb 2010 14:46:10 +0100 Subject: st/xorg: Obey max {width|height} from kernel and Gallium --- src/gallium/state_trackers/xorg/xorg_driver.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 5397ee777a..62cf2e0006 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -428,8 +428,8 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags) xf86CrtcConfigInit(pScrn, &crtc_config_funcs); xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - max_width = 8192; - max_height = 8192; + max_width = 2048; /* A very low default */ + max_height = 2048; /* see screen_init */ xf86CrtcSetSizeRange(pScrn, 320, 200, max_width, max_height); if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, FALSE)) { @@ -612,6 +612,7 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; modesettingPtr ms = modesettingPTR(pScrn); + unsigned max_width, max_height; VisualPtr visual; CustomizerPtr cust = ms->cust; @@ -630,6 +631,26 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) return FALSE; } + /* get max width and height */ + { + drmModeResPtr res; + res = drmModeGetResources(ms->fd); + max_width = res->max_width; + max_height = res->max_height; + drmModeFreeResources(res); + } + + if (ms->screen) { + float maxf; + int max; + maxf = ms->screen->get_paramf(ms->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS); + max = (1 << (int)(maxf - 1.0f)); + max_width = max < max_width ? max : max_width; + max_height = max < max_height ? max : max_height; + } + + xf86CrtcSetSizeRange(pScrn, 1, 1, max_width, max_height); + pScrn->pScreen = pScreen; /* HW dependent - FIXME */ -- cgit v1.2.3 From 956cd73c23269e4f76cbfee9076ec6eeb1f3262a Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 22 Feb 2010 14:47:15 +0100 Subject: st/xorg: Make resize fail gracefully --- src/gallium/state_trackers/xorg/xorg_driver.c | 69 +++++++++++++++++++++------ 1 file changed, 55 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 62cf2e0006..4f99e0001b 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -184,30 +184,47 @@ static Bool drv_crtc_resize(ScrnInfoPtr pScrn, int width, int height) { modesettingPtr ms = modesettingPTR(pScrn); - PixmapPtr rootPixmap; ScreenPtr pScreen = pScrn->pScreen; + int old_width, old_height; + PixmapPtr rootPixmap; if (width == pScrn->virtualX && height == pScrn->virtualY) return TRUE; + old_width = pScrn->virtualX; + old_height = pScrn->virtualY; pScrn->virtualX = width; pScrn->virtualY = height; - /* - * Remove the old framebuffer & texture. - */ - drmModeRmFB(ms->fd, ms->fb_id); - if (!ms->destroy_front_buffer(pScrn)) - FatalError("failed to destroy front buffer\n"); + /* ms->create_front_buffer will remove the old front buffer */ rootPixmap = pScreen->GetScreenPixmap(pScreen); if (!pScreen->ModifyPixmapHeader(rootPixmap, width, height, -1, -1, -1, NULL)) - return FALSE; + goto error_modify; pScrn->displayWidth = rootPixmap->devKind / (rootPixmap->drawable.bitsPerPixel / 8); - /* now create new frontbuffer */ - return ms->create_front_buffer(pScrn) && ms->bind_front_buffer(pScrn); + if (ms->create_front_buffer(pScrn) && ms->bind_front_buffer(pScrn)) + return TRUE; + + /* + * This is the error recovery path. + */ + + if (!pScreen->ModifyPixmapHeader(rootPixmap, old_width, old_height, -1, -1, -1, NULL)) + FatalError("failed to resize rootPixmap error path\n"); + + pScrn->displayWidth = rootPixmap->devKind / (rootPixmap->drawable.bitsPerPixel / 8); + +error_modify: + pScrn->virtualX = old_width; + pScrn->virtualY = old_height; + + if (ms->create_front_buffer(pScrn) && ms->bind_front_buffer(pScrn)) + return FALSE; + + FatalError("failed to setup old framebuffer\n"); + return FALSE; } static const xf86CrtcConfigFuncsRec crtc_config_funcs = { @@ -812,6 +829,7 @@ drv_leave_vt(int scrnIndex, int flags) } drmModeRmFB(ms->fd, ms->fb_id); + ms->fb_id = -1; drv_restore_hw_state(pScrn); @@ -936,6 +954,15 @@ static Bool drv_destroy_front_buffer_ga3d(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); + + if (!ms->root_bo) + return TRUE; + + if (ms->fb_id != -1) { + drmModeRmFB(ms->fd, ms->fb_id); + ms->fb_id = -1; + } + pipe_texture_reference(&ms->root_texture, NULL); return TRUE; } @@ -944,7 +971,7 @@ static Bool drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); - unsigned handle, stride; + unsigned handle, stride, fb_id; struct pipe_texture *tex; int ret; @@ -969,19 +996,23 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn) pScrn->bitsPerPixel, stride, handle, - &ms->fb_id); + &fb_id); if (ret) { - debug_printf("%s: failed to create framebuffer (%i, %s)", + debug_printf("%s: failed to create framebuffer (%i, %s)\n", __func__, ret, strerror(-ret)); goto err_destroy; } + if (!drv_destroy_front_buffer_ga3d(pScrn)) + FatalError("%s: failed to take down old framebuffer\n", __func__); + pScrn->frameX0 = 0; pScrn->frameY0 = 0; drv_adjust_frame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); pipe_texture_reference(&ms->root_texture, tex); pipe_texture_reference(&tex, NULL); + ms->fb_id = fb_id; return TRUE; @@ -1029,6 +1060,11 @@ drv_destroy_front_buffer_kms(ScrnInfoPtr pScrn) if (!ms->root_bo) return TRUE; + if (ms->fb_id != -1) { + drmModeRmFB(ms->fd, ms->fb_id); + ms->fb_id = -1; + } + kms_bo_unmap(ms->root_bo); kms_bo_destroy(&ms->root_bo); return TRUE; @@ -1041,6 +1077,7 @@ drv_create_front_buffer_kms(ScrnInfoPtr pScrn) unsigned handle, stride; struct kms_bo *bo; unsigned attr[8]; + unsigned fb_id; int ret; attr[0] = KMS_BO_TYPE; @@ -1071,17 +1108,21 @@ drv_create_front_buffer_kms(ScrnInfoPtr pScrn) pScrn->bitsPerPixel, stride, handle, - &ms->fb_id); + &fb_id); if (ret) { debug_printf("%s: failed to create framebuffer (%i, %s)", __func__, ret, strerror(-ret)); goto err_destroy; } + if (!drv_destroy_front_buffer_kms(pScrn)) + FatalError("%s: could not takedown old bo", __func__); + pScrn->frameX0 = 0; pScrn->frameY0 = 0; drv_adjust_frame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); ms->root_bo = bo; + ms->fb_id = fb_id; return TRUE; -- cgit v1.2.3 From cfbf75670dbb7e2a1fcb760d1792e4c9de634c7f Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 22 Feb 2010 20:06:23 +0100 Subject: vmware/xorg: Bump to match vmware driver --- src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c index bc5d39f749..87aad25b24 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c @@ -43,9 +43,9 @@ #define VMW_STRING_INNER(s) #s #define VMW_STRING(str) VMW_STRING_INNER(str) -#define VMWGFX_VERSION_MAJOR 10 -#define VMWGFX_VERSION_MINOR 16 -#define VMWGFX_VERSION_PATCH 9 +#define VMWGFX_VERSION_MAJOR 11 +#define VMWGFX_VERSION_MINOR 0 +#define VMWGFX_VERSION_PATCH 0 #define VMWGFX_VERSION_STRING_MAJOR VMW_STRING(VMWGFX_VERSION_MAJOR) #define VMWGFX_VERSION_STRING_MINOR VMW_STRING(VMWGFX_VERSION_MINOR) #define VMWGFX_VERSION_STRING_PATCH VMW_STRING(VMWGFX_VERSION_PATCH) -- cgit v1.2.3 From 122b472814d7694d997a55aac3d32340bf09218d Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 25 Feb 2010 16:51:15 +0100 Subject: st/xorg: Fix copy-topy --- src/gallium/state_trackers/xorg/xorg_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 4f99e0001b..aa8ab7901f 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -955,7 +955,7 @@ drv_destroy_front_buffer_ga3d(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); - if (!ms->root_bo) + if (!ms->root_texture) return TRUE; if (ms->fb_id != -1) { -- cgit v1.2.3 From bbefd86125f89451d75a96f31e1f4c871a1582c0 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 25 Feb 2010 16:51:30 +0100 Subject: st/xorg: Re-enable crtc on resize --- src/gallium/state_trackers/xorg/xorg_driver.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index aa8ab7901f..8fb6e5a96d 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -183,10 +183,12 @@ drv_probe_ddc(ScrnInfoPtr pScrn, int index) static Bool drv_crtc_resize(ScrnInfoPtr pScrn, int width, int height) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); modesettingPtr ms = modesettingPTR(pScrn); ScreenPtr pScreen = pScrn->pScreen; int old_width, old_height; PixmapPtr rootPixmap; + int i; if (width == pScrn->virtualX && height == pScrn->virtualY) return TRUE; @@ -204,13 +206,29 @@ drv_crtc_resize(ScrnInfoPtr pScrn, int width, int height) pScrn->displayWidth = rootPixmap->devKind / (rootPixmap->drawable.bitsPerPixel / 8); - if (ms->create_front_buffer(pScrn) && ms->bind_front_buffer(pScrn)) - return TRUE; + if (!ms->create_front_buffer(pScrn) || !ms->bind_front_buffer(pScrn)) + goto error_create; /* - * This is the error recovery path. + * create && bind will turn off all crtc(s) in the kernel so we need to + * re-enable all the crtcs again. For real HW we might want to do this + * before destroying the old framebuffer. */ + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + + if (!crtc->enabled) + continue; + + crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation, crtc->x, crtc->y); + } + + return TRUE; + /* + * This is the error recovery path. + */ +error_create: if (!pScreen->ModifyPixmapHeader(rootPixmap, old_width, old_height, -1, -1, -1, NULL)) FatalError("failed to resize rootPixmap error path\n"); -- cgit v1.2.3 From be97d2c0a6269e297f1db0e3639b0b03a45f21d9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 26 Feb 2010 23:58:59 -0800 Subject: mesa: Remove unnecessary header. --- src/mesa/main/texrender.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 11d7c06914..5a528535c0 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -1,7 +1,6 @@ #include "context.h" #include "colormac.h" -#include "fbobject.h" #include "texfetch.h" #include "texrender.h" #include "renderbuffer.h" -- cgit v1.2.3 From fd29be3831a583a1ad1d7055bd234724ce7ccfae Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 00:08:14 -0800 Subject: glsl: Assert pointer is not null before dereferencing. --- src/mesa/shader/slang/slang_codegen.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index adfea890b3..9ca5c1372d 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3184,6 +3184,7 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) varId = oper->children[0].children[0].a_id; var = _slang_variable_locate(oper->children[0].children[0].locals, varId, GL_TRUE); + assert(var); start = (GLint) var->initializer->literal[0]; } else { -- cgit v1.2.3 From 24a8b470ba592b4eb3560f7c5762e17ec0977a51 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 00:31:14 -0800 Subject: glsl: Assert input to strcmp is not null. --- src/mesa/shader/slang/slang_builtin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 0a9f0b97fb..5533cc5b65 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -121,6 +121,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field, } else if (strcmp(var, "gl_DepthRange") == 0) { tokens[0] = STATE_DEPTH_RANGE; + assert(field); if (strcmp(field, "near") == 0) { *swizzleOut = SWIZZLE_XXXX; } -- cgit v1.2.3 From 226d98173886e9e26337d6e9593b2b561c8cb758 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 01:52:46 -0800 Subject: r600: Assert pointer is not null before dereferencing. --- src/mesa/drivers/dri/r600/r700_assembler.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 8344dd9a51..834bcc63e3 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1746,18 +1746,21 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, switch (source_index) { case 0: + assert(alu_instruction_ptr); alu_instruction_ptr->m_Word0.f.src0_sel = src_sel; alu_instruction_ptr->m_Word0.f.src0_rel = src_rel; alu_instruction_ptr->m_Word0.f.src0_chan = src_chan; alu_instruction_ptr->m_Word0.f.src0_neg = src_neg; break; case 1: + assert(alu_instruction_ptr); alu_instruction_ptr->m_Word0.f.src1_sel = src_sel; alu_instruction_ptr->m_Word0.f.src1_rel = src_rel; alu_instruction_ptr->m_Word0.f.src1_chan = src_chan; alu_instruction_ptr->m_Word0.f.src1_neg = src_neg; break; case 2: + assert(alu_instruction_ptr); alu_instruction_ptr->m_Word1_OP3.f.src2_sel = src_sel; alu_instruction_ptr->m_Word1_OP3.f.src2_rel = src_rel; alu_instruction_ptr->m_Word1_OP3.f.src2_chan = src_chan; -- cgit v1.2.3 From 307071fe1e2bfacba9780e2397785495ae0b0ea1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 02:01:56 -0800 Subject: st/dri: Assert pointer is not null before dereferencing. --- src/gallium/state_trackers/dri/dri_drawable.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 8843e087a8..4809b9090d 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -134,12 +134,13 @@ dri_get_buffers(__DRIdrawable * dPriv) if ((dri_screen->dri2.loader && (dri_screen->dri2.loader->base.version > 2) - && (dri_screen->dri2.loader->getBuffersWithFormat != NULL))) + && (dri_screen->dri2.loader->getBuffersWithFormat != NULL))) { buffers = (*dri_screen->dri2.loader->getBuffersWithFormat) (dri_drawable, &dri_drawable->w, &dri_drawable->h, drawable->attachments, drawable->num_attachments, &count, dri_drawable->loaderPrivate); - else + } else { + assert(dri_screen->dri2.loader); buffers = (*dri_screen->dri2.loader->getBuffers) (dri_drawable, &dri_drawable->w, &dri_drawable->h, @@ -148,6 +149,7 @@ dri_get_buffers(__DRIdrawable * dPriv) num_attachments, &count, dri_drawable-> loaderPrivate); + } if (buffers == NULL) { return; -- cgit v1.2.3 From e63f532d26d82c06281840a84c73e2e36d7b3e1e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 02:18:06 -0800 Subject: dri: Assert pointer is not null before dereferencing. --- src/mesa/drivers/dri/common/dri_util.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index b80b608f4b..a4fd002664 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -189,6 +189,7 @@ static int driBindContext(__DRIcontext *pcp, ** initialize the drawable information if has not been done before. */ + assert(psp); if (!psp->dri2.enabled) { if (pdp && !pdp->pStamp) { DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID); -- cgit v1.2.3 From d3004d9156e261d81adcae31d55a4b782433cd6b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 02:28:00 -0800 Subject: radeon: Assert pointer is not null before dereferencing. Add back an assert that was removed in commit cd5f167353f16fb4f5b349002625b704f3e23778. --- src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c index d6aeb7049f..18cf182e54 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c @@ -58,6 +58,7 @@ do_copy_texsubimage(GLcontext *ctx, } assert(rrb && rrb->bo); + assert(timg->mt); assert(timg->mt->bo); assert(timg->base.Width >= dstx + width); assert(timg->base.Height >= dsty + height); -- cgit v1.2.3 From dba7ad895333b9b0988239266a217edeebe6a3b3 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 26 Feb 2010 22:34:09 +0100 Subject: r300g: remove pointless "while" --- src/gallium/drivers/r300/r300_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index ec72d6c3b5..d604bfb7d7 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -123,7 +123,7 @@ static uint32_t r300_provoking_vertex_fixes(struct r300_context *r300, static boolean r300_reserve_cs_space(struct r300_context *r300, unsigned dwords) { - while (!r300->winsys->check_cs(r300->winsys, dwords)) { + if (!r300->winsys->check_cs(r300->winsys, dwords)) { r300->context.flush(&r300->context, 0, NULL); return TRUE; } -- cgit v1.2.3 From 93da1522098145f0e7ff9d4188050728b075b4a1 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 00:37:01 +0100 Subject: r300g: always emit the correct max vertex index to avoid DRM errors Fixing bizarre reports that a vertex buffer is not large enough. --- src/gallium/drivers/r300/r300_context.h | 1 + src/gallium/drivers/r300/r300_render.c | 7 +++++-- src/gallium/drivers/r300/r300_state.c | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 3d4f6524e5..8704f18529 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -326,6 +326,7 @@ struct r300_context { /* Vertex buffers for Gallium. */ struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; int vertex_buffer_count; + int vertex_buffer_max_index; /* Vertex elements for Gallium. */ struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; int vertex_element_count; diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index d604bfb7d7..e4f7615368 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -452,8 +452,11 @@ void r300_draw_elements(struct pipe_context* pipe, unsigned indexSize, unsigned mode, unsigned start, unsigned count) { - pipe->draw_range_elements(pipe, indexBuffer, indexSize, 0, ~0, - mode, start, count); + struct r300_context *r300 = r300_context(pipe); + + pipe->draw_range_elements(pipe, indexBuffer, indexSize, 0, + r300->vertex_buffer_max_index, + mode, start, count); } void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 0f14ccc53e..ee4409c889 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1026,10 +1026,17 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, const struct pipe_vertex_buffer* buffers) { struct r300_context* r300 = r300_context(pipe); + unsigned i, max_index = ~0; memcpy(r300->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count); + + for (i = 0; i < count; i++) { + max_index = MIN2(buffers[i].max_index, max_index); + } + r300->vertex_buffer_count = count; + r300->vertex_buffer_max_index = max_index; if (r300->draw) { draw_flush(r300->draw); -- cgit v1.2.3 From c05f998f02b0799e46e6c306c03a09c35bd37cc0 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 02:46:20 +0100 Subject: radeong: clean up includes --- src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 6 ++++-- src/gallium/winsys/drm/radeon/core/radeon_buffer.h | 10 ---------- src/gallium/winsys/drm/radeon/core/radeon_drm.c | 10 ++++++++++ src/gallium/winsys/drm/radeon/core/radeon_drm.h | 15 --------------- src/gallium/winsys/drm/radeon/core/radeon_r300.c | 3 +++ src/gallium/winsys/drm/radeon/core/radeon_r300.h | 11 +---------- 6 files changed, 18 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index 5cbf0dd2c5..e5c6919933 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -31,11 +31,13 @@ */ #include "radeon_buffer.h" +#include "radeon_drm.h" -#include "radeon_bo_gem.h" -#include "r300_context.h" #include "util/u_format.h" #include "util/u_math.h" +#include "util/u_memory.h" + +#include "radeon_bo_gem.h" #include struct radeon_vl_context diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h index f1c8fc2a3b..f776e2d900 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h @@ -30,21 +30,11 @@ #ifndef RADEON_BUFFER_H #define RADEON_BUFFER_H -#include - -#include "util/u_simple_screen.h" -#include "pipe/p_defines.h" -#include "util/u_inlines.h" - #include "pipebuffer/pb_buffer.h" -#include "util/u_memory.h" - #include "radeon_bo.h" #include "radeon_cs.h" -#include "radeon_drm.h" - #include "radeon_winsys.h" struct radeon_pipe_buffer { diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index 0c0e118ba3..e817a26da6 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -30,6 +30,16 @@ */ #include "radeon_drm.h" +#include "radeon_r300.h" +#include "radeon_buffer.h" + +#include "r300_winsys.h" +#include "trace/tr_drm.h" + +#include "util/u_memory.h" + +#include "xf86drm.h" +#include /* Helper function to do the ioctls needed for setup and init. */ static void do_ioctls(int fd, struct radeon_winsys* winsys) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.h b/src/gallium/winsys/drm/radeon/core/radeon_drm.h index 8d74cbafc2..f62a9b8048 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.h @@ -30,23 +30,8 @@ #ifndef RADEON_DRM_H #define RADEON_DRM_H -#include - -#include "xf86drm.h" - -#include "pipe/p_screen.h" - -#include "trace/tr_drm.h" -#include "util/u_debug.h" -#include "util/u_memory.h" - #include "state_tracker/drm_api.h" -#include "radeon_buffer.h" -#include "radeon_r300.h" - -/* XXX */ -#include "r300_screen.h" struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB, diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index d759beaba1..122bd21354 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -21,6 +21,9 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "radeon_r300.h" +#include "radeon_buffer.h" + +#include "radeon_cs_gem.h" static void radeon_set_flush_cb(struct radeon_winsys *winsys, void (*flush_cb)(void *), diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.h b/src/gallium/winsys/drm/radeon/core/radeon_r300.h index cfbdb30266..e655dc32c8 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.h @@ -23,16 +23,7 @@ #ifndef RADEON_R300_H #define RADEON_R300_H -/* XXX WTF is this! I shouldn't have to include those first three! FUCK! */ -#include -#include -#include "drm.h" -#include "radeon_drm.h" -#include "radeon_cs_gem.h" - -#include "r300_winsys.h" - -#include "radeon_buffer.h" +#include "radeon_winsys.h" void radeon_setup_winsys(int fd, struct radeon_winsys* winsys); -- cgit v1.2.3 From f129a7dd686cb3d824253bffab8c8b32b8ef8b69 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 20:00:38 +0100 Subject: r300g: mark rasterizer_state as dirty only when it's not NULL --- src/gallium/drivers/r300/r300_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index ee4409c889..0fbb9e7716 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -824,13 +824,13 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) if (rs) { r300->tcl_bypass = rs->rs.bypass_vs_clip_and_viewport; r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; + r300->rs_state.dirty = TRUE; } else { r300->tcl_bypass = FALSE; r300->polygon_offset_enabled = FALSE; } r300->rs_state.state = rs; - r300->rs_state.dirty = TRUE; /* XXX Why is this still needed, dammit!? */ r300->scissor_state.dirty = TRUE; r300->viewport_state.dirty = TRUE; -- cgit v1.2.3 From a3d4d0dec2882e352dc9ddcc1572e36620a4d13e Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 20:03:34 +0100 Subject: r300g: put the emission of R300_US_OUT_FMT_UNUSED back It wasn't such a good idea to remove it. :/ --- src/gallium/drivers/r300/r300_emit.c | 6 +++++- src/gallium/drivers/r300/r300_state.c | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 3037a38989..1ea622f850 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -387,7 +387,8 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) int i; CS_LOCALS(r300); - BEGIN_CS((10 * fb->nr_cbufs) + (fb->zsbuf ? 10 : 0) + 6); + BEGIN_CS((10 * fb->nr_cbufs) + (2 * (4 - fb->nr_cbufs)) + + (fb->zsbuf ? 10 : 0) + 6); /* Flush and free renderbuffer caches. */ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, @@ -426,6 +427,9 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), tex->fb_state.us_out_fmt); } + for (; i < 4; i++) { + OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), R300_US_OUT_FMT_UNUSED); + } /* Set up a zbuffer. */ if (fb->zsbuf) { diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 0fbb9e7716..2c4beee5ad 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -598,7 +598,8 @@ static void memcpy(r300->fb_state.state, state, sizeof(struct pipe_framebuffer_state)); - r300->fb_state.size = (10 * state->nr_cbufs) + (state->zsbuf ? 10 : 0) + 6; + r300->fb_state.size = (10 * state->nr_cbufs) + (2 * (4 - state->nr_cbufs)) + + (state->zsbuf ? 10 : 0) + 6; r300_fb_update_tiling_flags(r300, r300->fb_state.state, state); -- cgit v1.2.3 From 74f94e8fdfe035fa68acdc19e6b0afc2957a4264 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 20:05:00 +0100 Subject: r300g: move the emission of GA_POINT_MINMAX into emit_fb_state The only practical limits are the ones derived from the currently-set framebuffer state. --- src/gallium/drivers/r300/r300_context.h | 1 - src/gallium/drivers/r300/r300_emit.c | 10 +++++----- src/gallium/drivers/r300/r300_state.c | 19 ++----------------- 3 files changed, 7 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 8704f18529..ac14e3f0df 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -86,7 +86,6 @@ struct r300_rs_state { uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */ uint32_t antialiasing_config; /* R300_GB_AA_CONFIG: 0x4020 */ uint32_t point_size; /* R300_GA_POINT_SIZE: 0x421c */ - uint32_t point_minmax; /* R300_GA_POINT_MINMAX: 0x4230 */ uint32_t line_control; /* R300_GA_LINE_CNTL: 0x4234 */ float depth_scale; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */ /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 1ea622f850..7fc66dd265 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -388,7 +388,7 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) CS_LOCALS(r300); BEGIN_CS((10 * fb->nr_cbufs) + (2 * (4 - fb->nr_cbufs)) + - (fb->zsbuf ? 10 : 0) + 6); + (fb->zsbuf ? 10 : 0) + 8); /* Flush and free renderbuffer caches. */ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, @@ -447,6 +447,8 @@ void r300_emit_fb_state(struct r300_context* r300, void* state) 0, RADEON_GEM_DOMAIN_VRAM, 0); } + OUT_CS_REG(R300_GA_POINT_MINMAX, + (MAX2(fb->width, fb->height) * 6) << R300_GA_POINT_MINMAX_MAX_SHIFT); END_CS; } @@ -582,15 +584,13 @@ void r300_emit_rs_state(struct r300_context* r300, void* state) float scale, offset; CS_LOCALS(r300); - BEGIN_CS(18 + (rs->polygon_offset_enable ? 5 : 0)); + BEGIN_CS(17 + (rs->polygon_offset_enable ? 5 : 0)); OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status); OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config); OUT_CS_REG(R300_GA_POINT_SIZE, rs->point_size); - OUT_CS_REG_SEQ(R300_GA_POINT_MINMAX, 2); - OUT_CS(rs->point_minmax); - OUT_CS(rs->line_control); + OUT_CS_REG(R300_GA_LINE_CNTL, rs->line_control); if (rs->polygon_offset_enable) { scale = rs->depth_scale * 12; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 2c4beee5ad..f1f0de1a46 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -599,7 +599,7 @@ static void memcpy(r300->fb_state.state, state, sizeof(struct pipe_framebuffer_state)); r300->fb_state.size = (10 * state->nr_cbufs) + (2 * (4 - state->nr_cbufs)) + - (state->zsbuf ? 10 : 0) + 6; + (state->zsbuf ? 10 : 0) + 8; r300_fb_update_tiling_flags(r300, r300->fb_state.state, state); @@ -718,22 +718,6 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->point_size = pack_float_16_6x(state->point_size) | (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT); - /* Point minimum and maximum sizes. This register has to be emitted, - * and it'd be a step backwards to put it in invariant state. */ - if (r300screen->caps->is_r500) { - rs->point_minmax = - ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) | - ((int)(4096.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT); - } else if (r300screen->caps->is_r400) { - rs->point_minmax = - ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) | - ((int)(4021.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT); - } else { - rs->point_minmax = - ((int)(0.0 * 6.0) << R300_GA_POINT_MINMAX_MIN_SHIFT) | - ((int)(2560.0 * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT); - } - rs->line_control = pack_float_16_6x(state->line_width) | R300_GA_LINE_CNTL_END_TYPE_COMP; @@ -832,6 +816,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) } r300->rs_state.state = rs; + r300->rs_state.size = 17 + (r300->polygon_offset_enabled ? 5 : 0); /* XXX Why is this still needed, dammit!? */ r300->scissor_state.dirty = TRUE; r300->viewport_state.dirty = TRUE; -- cgit v1.2.3 From 1eba490202b09ee87f1c8af5a3bb77b5c3f23599 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 27 Feb 2010 20:28:53 +0000 Subject: util: Fix X8/A8B8G8R8_SNORM's swizzle. --- src/gallium/auxiliary/util/u_format.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index b2ee247a6c..7595576953 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -27,8 +27,8 @@ PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, s PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, srgb # Signed formats (typically used for bump map textures) -PIPE_FORMAT_A8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzyx, rgb -PIPE_FORMAT_X8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb +PIPE_FORMAT_A8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyzw, rgb +PIPE_FORMAT_X8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb PIPE_FORMAT_X8UB8UG8SR8S_NORM , plain, 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb PIPE_FORMAT_B6UG5SR5S_NORM , plain, 1, 1, sn5 , sn5 , un6 , , xyz1, rgb -- cgit v1.2.3 From e31a37966154cc8171a8663cf5aa4ef1dd070f97 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 14:56:27 -0800 Subject: unichrome: Assert that pointer is not null before dereferencing. --- src/mesa/drivers/dri/unichrome/via_ioctl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index c9a31f3383..25aad1b204 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -757,6 +757,8 @@ static void via_emit_cliprect(struct via_context *vmesa, vb[0] = HC_HEADER2; vb[1] = (HC_ParaType_NotTex << 16); + assert(vmesa->driDrawable); + if (vmesa->driDrawable->w == 0 || vmesa->driDrawable->h == 0) { vb[2] = (HC_SubA_HClipTB << 24) | 0x0; vb[3] = (HC_SubA_HClipLR << 24) | 0x0; -- cgit v1.2.3 From b22437937fece754d9644a9d4ccb8db981d5e16c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 15:07:30 -0800 Subject: tdfx: Add asserts to check for null pointer dereferences. --- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 2 ++ src/mesa/drivers/dri/tdfx/tdfx_texstate.c | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index d554bcdc92..26de09503a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -295,6 +295,8 @@ tdfxSwapBuffers( __DRIdrawable *driDrawPriv ) } #endif + assert(fxMesa); + if (fxMesa->scissoredClipRects) { /* restore clip rects without scissor box */ fxMesa->Glide.grDRIPosition( driDrawPriv->x, driDrawPriv->y, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c index 6658b4d0c3..b04f48c7a7 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_texstate.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_texstate.c @@ -2142,11 +2142,13 @@ tdfxUpdateTextureBinding( GLcontext *ctx ) ctx->Texture.Unit[0]._ReallyEnabled == 0) { /* Only unit 0 2D enabled */ if (shared->umaTexMemory) { + assert(ti0); fxMesa->TexSource[0].StartAddress = ti0->tm[0]->startAddr; fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH; fxMesa->TexSource[0].Info = &(ti0->info); } else { + assert(ti0); if (ti0->LODblend && ti0->whichTMU == TDFX_TMU_SPLIT) { fxMesa->TexSource[0].StartAddress = ti0->tm[TDFX_TMU0]->startAddr; fxMesa->TexSource[0].EvenOdd = GR_MIPMAPLEVELMASK_ODD; @@ -2185,20 +2187,26 @@ tdfxUpdateTextureBinding( GLcontext *ctx ) /* Both 2D enabled */ if (shared->umaTexMemory) { const FxU32 tmu0 = 0, tmu1 = 1; + + assert(ti0); fxMesa->TexSource[tmu0].StartAddress = ti0->tm[0]->startAddr; fxMesa->TexSource[tmu0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH; fxMesa->TexSource[tmu0].Info = &(ti0->info); + assert(ti1); fxMesa->TexSource[tmu1].StartAddress = ti1->tm[0]->startAddr; fxMesa->TexSource[tmu1].EvenOdd = GR_MIPMAPLEVELMASK_BOTH; fxMesa->TexSource[tmu1].Info = &(ti1->info); } else { const FxU32 tmu0 = 0, tmu1 = 1; + + assert(ti0); fxMesa->TexSource[tmu0].StartAddress = ti0->tm[tmu0]->startAddr; fxMesa->TexSource[tmu0].EvenOdd = GR_MIPMAPLEVELMASK_BOTH; fxMesa->TexSource[tmu0].Info = &(ti0->info); + assert(ti1); fxMesa->TexSource[tmu1].StartAddress = ti1->tm[tmu1]->startAddr; fxMesa->TexSource[tmu1].EvenOdd = GR_MIPMAPLEVELMASK_BOTH; fxMesa->TexSource[tmu1].Info = &(ti1->info); -- cgit v1.2.3 From 9db6a70af583242ba5012f3451cd30a07d16b95f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 15:13:38 -0800 Subject: sis: Add assert to check function pointer is not null. --- src/mesa/drivers/dri/sis/sis_tris.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index 4b41d78d82..e7471f9789 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -994,6 +994,7 @@ sisFlushPrimsLocked(sisContextPtr smesa) MMIO(REG_3D_PrimitiveSet, smesa->dwPrimitiveSet); } while (smesa->vb_last < smesa->vb_cur) { + assert(sis_emit_func); sis_emit_func(smesa, (char *)smesa->vb_last); smesa->vb_last += incr; } -- cgit v1.2.3 From 5c007f42a128ad11c8e126443e0f040774901430 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 15:29:44 -0800 Subject: savage: Add assert to check for null pointer dereference. --- src/mesa/drivers/dri/savage/savagetex.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 1a748ee126..1523af4065 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -1021,6 +1021,7 @@ static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t ) return; } + assert(t->base.memBlock); ofs = t->base.memBlock->ofs; t->setup.physAddr = imesa->savageScreen->textureOffset[heap] + ofs; t->bufAddr = (GLubyte *)imesa->savageScreen->texVirtual[heap] + ofs; -- cgit v1.2.3 From 3d3e3a56f2ded522267df60fdfc2c5933303d15b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 15:36:11 -0800 Subject: r300: Add asserts to check for null pointer dereferences. --- src/mesa/drivers/dri/r300/r300_vertprog.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 6a366b438b..cbe4cb8304 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -79,6 +79,7 @@ static int r300VertexProgUpdateParams(GLcontext * ctx, struct r300_vertex_progra break; } + assert(src); dst[4*i] = src[0]; dst[4*i + 1] = src[1]; dst[4*i + 2] = src[2]; @@ -311,6 +312,7 @@ struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx) r300SelectAndTranslateFragmentShader(ctx); } + assert(r300->selected_fp); wanted_key.FpReads = r300->selected_fp->InputsRead; wanted_key.FogAttr = r300->selected_fp->fog_attr; wanted_key.WPosAttr = r300->selected_fp->wpos_attr; -- cgit v1.2.3 From 14771ba7e492aef115a2827ac403499d074f9d0d Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Sat, 27 Feb 2010 13:55:35 -0800 Subject: mesa: remove libmesagallium.a on make clean MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Fonseca --- src/mesa/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 0cb49e803f..8c0ebf84c4 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -154,7 +154,7 @@ tags: clean: -rm -f */*.o -rm -f */*/*.o - -rm -f depend depend.bak libmesa.a libglapi.a + -rm -f depend depend.bak libmesa.a libglapi.a libmesagallium.a -rm -f drivers/*/*.o -rm -f *.pc -rm -f shader/slang/library/*_gc.h -- cgit v1.2.3 From 841122d0e8025290ff2691e13ade1099d2c3351c Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 21:54:16 +0100 Subject: r300g: add size parameter to the atom emit functions Maintaining a closer relationship between the atom size and what's passed in BEGIN_CS. --- src/gallium/drivers/r300/r300_context.h | 2 +- src/gallium/drivers/r300/r300_emit.c | 34 +++++++++++++++---------- src/gallium/drivers/r300/r300_emit.h | 33 +++++++++++++++--------- src/gallium/drivers/r300/r300_state_invariant.c | 3 ++- src/gallium/drivers/r300/r300_state_invariant.h | 3 ++- 5 files changed, 47 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index ac14e3f0df..e3ad586921 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -45,7 +45,7 @@ struct r300_atom { /* Opaque state. */ void* state; /* Emit the state to the context. */ - void (*emit)(struct r300_context*, void*); + void (*emit)(struct r300_context*, unsigned, void*); /* Upper bound on number of dwords to emit. */ unsigned size; /* Whether this atom should be emitted. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 7fc66dd265..a17ebb3ea8 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -34,7 +34,8 @@ #include "r300_screen.h" #include "r300_vs.h" -void r300_emit_blend_state(struct r300_context* r300, void* state) +void r300_emit_blend_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_blend_state* blend = (struct r300_blend_state*)state; struct pipe_framebuffer_state* fb = @@ -58,7 +59,8 @@ void r300_emit_blend_state(struct r300_context* r300, void* state) END_CS; } -void r300_emit_blend_color_state(struct r300_context* r300, void* state) +void r300_emit_blend_color_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_blend_color_state* bc = (struct r300_blend_color_state*)state; struct r300_screen* r300screen = r300_screen(r300->context.screen); @@ -77,7 +79,8 @@ void r300_emit_blend_color_state(struct r300_context* r300, void* state) } } -void r300_emit_clip_state(struct r300_context* r300, void* state) +void r300_emit_clip_state(struct r300_context* r300, + unsigned size, void* state) { struct pipe_clip_state* clip = (struct pipe_clip_state*)state; int i; @@ -107,7 +110,7 @@ void r300_emit_clip_state(struct r300_context* r300, void* state) } -void r300_emit_dsa_state(struct r300_context* r300, void* state) +void r300_emit_dsa_state(struct r300_context* r300, unsigned size, void* state) { struct r300_dsa_state* dsa = (struct r300_dsa_state*)state; struct r300_screen* r300screen = r300_screen(r300->context.screen); @@ -378,7 +381,7 @@ void r500_emit_fs_constant_buffer(struct r300_context* r300, END_CS; } -void r300_emit_fb_state(struct r300_context* r300, void* state) +void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state) { struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)state; struct r300_screen* r300screen = r300_screen(r300->context.screen); @@ -578,7 +581,7 @@ void r300_emit_query_end(struct r300_context* r300) r300_emit_query_finish(r300, query); } -void r300_emit_rs_state(struct r300_context* r300, void* state) +void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state) { struct r300_rs_state* rs = (struct r300_rs_state*)state; float scale, offset; @@ -621,7 +624,8 @@ void r300_emit_rs_state(struct r300_context* r300, void* state) END_CS; } -void r300_emit_rs_block_state(struct r300_context* r300, void* state) +void r300_emit_rs_block_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_rs_block* rs = (struct r300_rs_block*)state; unsigned i; @@ -663,7 +667,8 @@ void r300_emit_rs_block_state(struct r300_context* r300, void* state) END_CS; } -void r300_emit_scissor_state(struct r300_context* r300, void* state) +void r300_emit_scissor_state(struct r300_context* r300, + unsigned size, void* state) { unsigned minx, miny, maxx, maxy; uint32_t top_left, bottom_right; @@ -810,7 +815,8 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) END_CS; } -void r300_emit_vertex_format_state(struct r300_context* r300, void* state) +void r300_emit_vertex_format_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_vertex_info* vertex_info = (struct r300_vertex_info*)state; unsigned i; @@ -856,7 +862,7 @@ static void r300_flush_pvs(struct r300_context* r300) END_CS; } -void r300_emit_vs_state(struct r300_context* r300, void* state) +void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state) { struct r300_vertex_shader* vs = (struct r300_vertex_shader*)state; struct r300_vertex_program_code* code = &vs->code; @@ -942,7 +948,8 @@ void r300_emit_vs_constant_buffer(struct r300_context* r300, END_CS; } -void r300_emit_viewport_state(struct r300_context* r300, void* state) +void r300_emit_viewport_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_viewport_state* viewport = (struct r300_viewport_state*)state; CS_LOCALS(r300); @@ -986,7 +993,8 @@ void r300_emit_texture_count(struct r300_context* r300) } -void r300_emit_ztop_state(struct r300_context* r300, void* state) +void r300_emit_ztop_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_ztop_state* ztop = (struct r300_ztop_state*)state; CS_LOCALS(r300); @@ -1110,7 +1118,7 @@ void r300_emit_dirty_state(struct r300_context* r300) foreach(atom, &r300->atom_list) { if (atom->dirty || atom->always_dirty) { - atom->emit(r300, atom->state); + atom->emit(r300, atom->size, atom->state); atom->dirty = FALSE; } } diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index f27cf5f32d..a9b75d5b37 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -31,13 +31,17 @@ struct r300_vertex_program_code; void r300_emit_aos(struct r300_context* r300, unsigned offset); -void r300_emit_blend_state(struct r300_context* r300, void* state); +void r300_emit_blend_state(struct r300_context* r300, + unsigned size, void* state); -void r300_emit_blend_color_state(struct r300_context* r300, void* state); +void r300_emit_blend_color_state(struct r300_context* r300, + unsigned size, void* state); -void r300_emit_clip_state(struct r300_context* r300, void* state); +void r300_emit_clip_state(struct r300_context* r300, + unsigned size, void* state); -void r300_emit_dsa_state(struct r300_context* r300, void* state); +void r300_emit_dsa_state(struct r300_context* r300, + unsigned size, void* state); void r300_emit_fragment_program_code(struct r300_context* r300, struct rX00_fragment_program_code* generic_code); @@ -51,18 +55,20 @@ void r500_emit_fragment_program_code(struct r300_context* r300, void r500_emit_fs_constant_buffer(struct r300_context* r300, struct rc_constant_list* constants); -void r300_emit_fb_state(struct r300_context* r300, void* state); +void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state); void r300_emit_query_begin(struct r300_context* r300, struct r300_query* query); void r300_emit_query_end(struct r300_context* r300); -void r300_emit_rs_state(struct r300_context* r300, void* state); +void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state); -void r300_emit_rs_block_state(struct r300_context* r300, void* state); +void r300_emit_rs_block_state(struct r300_context* r300, + unsigned size, void* state); -void r300_emit_scissor_state(struct r300_context* r300, void* state); +void r300_emit_scissor_state(struct r300_context* r300, + unsigned size, void* state); void r300_emit_texture(struct r300_context* r300, struct r300_sampler_state* sampler, @@ -71,7 +77,8 @@ void r300_emit_texture(struct r300_context* r300, void r300_emit_vertex_buffer(struct r300_context* r300); -void r300_emit_vertex_format_state(struct r300_context* r300, void* state); +void r300_emit_vertex_format_state(struct r300_context* r300, + unsigned size, void* state); void r300_emit_vertex_program_code(struct r300_context* r300, struct r300_vertex_program_code* code); @@ -79,13 +86,15 @@ void r300_emit_vertex_program_code(struct r300_context* r300, void r300_emit_vs_constant_buffer(struct r300_context* r300, struct rc_constant_list* constants); -void r300_emit_vs_state(struct r300_context* r300, void* state); +void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state); -void r300_emit_viewport_state(struct r300_context* r300, void* state); +void r300_emit_viewport_state(struct r300_context* r300, + unsigned size, void* state); void r300_emit_texture_count(struct r300_context* r300); -void r300_emit_ztop_state(struct r300_context* r300, void* state); +void r300_emit_ztop_state(struct r300_context* r300, + unsigned size, void* state); void r300_flush_textures(struct r300_context* r300); diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c index 97927acf1b..4a2c68269b 100644 --- a/src/gallium/drivers/r300/r300_state_invariant.c +++ b/src/gallium/drivers/r300/r300_state_invariant.c @@ -38,7 +38,8 @@ struct pipe_viewport_state r300_viewport_identity = { * * Note that eventually this should be empty, but it's useful for development * and general unduplication of code. */ -void r300_emit_invariant_state(struct r300_context* r300, void* state) +void r300_emit_invariant_state(struct r300_context* r300, + unsigned size, void* state) { struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps; CS_LOCALS(r300); diff --git a/src/gallium/drivers/r300/r300_state_invariant.h b/src/gallium/drivers/r300/r300_state_invariant.h index 5d1a963654..83d031c7fe 100644 --- a/src/gallium/drivers/r300/r300_state_invariant.h +++ b/src/gallium/drivers/r300/r300_state_invariant.h @@ -25,6 +25,7 @@ struct r300_context; -void r300_emit_invariant_state(struct r300_context* r300, void* state); +void r300_emit_invariant_state(struct r300_context* r300, + unsigned size, void* state); #endif /* R300_STATE_INVARIANT_H */ -- cgit v1.2.3 From fe6d3b9222ce184daab61ebb390a6af0b9889abf Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 23:26:19 +0100 Subject: r300g: atomize PVS flush The first non-state atom. It's better and cleaner to have it. --- src/gallium/drivers/r300/r300_context.c | 39 +++++++++++++++++---------------- src/gallium/drivers/r300/r300_context.h | 2 ++ src/gallium/drivers/r300/r300_emit.c | 8 +------ src/gallium/drivers/r300/r300_emit.h | 2 ++ src/gallium/drivers/r300/r300_state.c | 5 ++++- 5 files changed, 29 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 47883589a7..5fc3a30804 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -96,12 +96,12 @@ static void r300_flush_cb(void *data) } #define R300_INIT_ATOM(atomname, atomsize) \ - r300->atomname##_state.name = #atomname; \ - r300->atomname##_state.state = NULL; \ - r300->atomname##_state.size = atomsize; \ - r300->atomname##_state.emit = r300_emit_##atomname##_state; \ - r300->atomname##_state.dirty = FALSE; \ - insert_at_tail(&r300->atom_list, &r300->atomname##_state); + r300->atomname.name = #atomname; \ + r300->atomname.state = NULL; \ + r300->atomname.size = atomsize; \ + r300->atomname.emit = r300_emit_##atomname; \ + r300->atomname.dirty = FALSE; \ + insert_at_tail(&r300->atom_list, &r300->atomname); static void r300_setup_atoms(struct r300_context* r300) { @@ -114,19 +114,20 @@ static void r300_setup_atoms(struct r300_context* r300) * an upper bound on each atom, to keep the emission machinery from * underallocating space. */ make_empty_list(&r300->atom_list); - R300_INIT_ATOM(invariant, 71); - R300_INIT_ATOM(ztop, 2); - R300_INIT_ATOM(blend, 8); - R300_INIT_ATOM(blend_color, 3); - R300_INIT_ATOM(clip, 29); - R300_INIT_ATOM(dsa, 8); - R300_INIT_ATOM(fb, 56); - R300_INIT_ATOM(rs, 25); - R300_INIT_ATOM(scissor, 3); - R300_INIT_ATOM(viewport, 9); - R300_INIT_ATOM(rs_block, 21); - R300_INIT_ATOM(vertex_format, 26); - R300_INIT_ATOM(vs, 1031); + R300_INIT_ATOM(invariant_state, 71); + R300_INIT_ATOM(ztop_state, 2); + R300_INIT_ATOM(blend_state, 8); + R300_INIT_ATOM(blend_color_state, 3); + R300_INIT_ATOM(clip_state, 29); + R300_INIT_ATOM(dsa_state, 8); + R300_INIT_ATOM(fb_state, 56); + R300_INIT_ATOM(rs_state, 25); + R300_INIT_ATOM(scissor_state, 3); + R300_INIT_ATOM(viewport_state, 9); + R300_INIT_ATOM(rs_block_state, 21); + R300_INIT_ATOM(vertex_format_state, 26); + R300_INIT_ATOM(pvs_flush, 2); + R300_INIT_ATOM(vs_state, 1031); /* Some non-CSO atoms need explicit space to store the state locally. */ r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index e3ad586921..32b64b6b28 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -318,6 +318,8 @@ struct r300_context { struct r300_atom viewport_state; /* ZTOP state. */ struct r300_atom ztop_state; + /* PVS flush. */ + struct r300_atom pvs_flush; /* Invariant state. This must be emitted to get the engine started. */ struct r300_atom invariant_state; diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index a17ebb3ea8..6a0ede359b 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -853,7 +853,7 @@ void r300_emit_vertex_format_state(struct r300_context* r300, END_CS; } -static void r300_flush_pvs(struct r300_context* r300) +void r300_emit_pvs_flush(struct r300_context* r300, unsigned size, void* state) { CS_LOCALS(r300); @@ -887,8 +887,6 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state) return; } - r300_flush_pvs(r300); - BEGIN_CS(9 + code->length); /* R300_VAP_PVS_CODE_CNTL_0 * R300_VAP_PVS_CONST_CNTL @@ -1170,10 +1168,6 @@ void r300_emit_dirty_state(struct r300_context* r300) r300_flush_textures(r300); } - if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS || r300->vs_state.dirty) { - r300_flush_pvs(r300); - } - if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS) { struct r300_vertex_shader* vs = r300->vs_state.state; r300_emit_vs_constant_buffer(r300, &vs->code.constants); diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index a9b75d5b37..5809bf4340 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -96,6 +96,8 @@ void r300_emit_texture_count(struct r300_context* r300); void r300_emit_ztop_state(struct r300_context* r300, unsigned size, void* state); +void r300_emit_pvs_flush(struct r300_context* r300, unsigned size, void* state); + void r300_flush_textures(struct r300_context* r300); unsigned r300_get_num_dirty_dwords(struct r300_context *r300); diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index f1f0de1a46..79cd715af1 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1109,6 +1109,7 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) r300->vs_state.dirty = TRUE; r300->vertex_format_state.dirty = TRUE; + r300->pvs_flush.dirty = TRUE; if (r300->fs) { r300_vertex_shader_setup_wpos(r300); @@ -1186,8 +1187,10 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, r300->shader_constants[shader].count = buf->size / (4 * sizeof(float)); pipe_buffer_unmap(pipe->screen, buf); - if (shader == PIPE_SHADER_VERTEX) + if (shader == PIPE_SHADER_VERTEX) { r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS; + r300->pvs_flush.dirty = TRUE; + } else if (shader == PIPE_SHADER_FRAGMENT) r300->dirty_state |= R300_NEW_FRAGMENT_SHADER_CONSTANTS; } -- cgit v1.2.3 From 279715e76e5385afaad2834191e8578cf3a5d233 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 23:37:01 +0100 Subject: r300g: atomize invalidation of texture caches --- src/gallium/drivers/r300/r300_context.c | 1 + src/gallium/drivers/r300/r300_context.h | 2 ++ src/gallium/drivers/r300/r300_emit.c | 8 +------- src/gallium/drivers/r300/r300_emit.h | 2 +- src/gallium/drivers/r300/r300_state.c | 6 ++++++ 5 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 5fc3a30804..5f50b60eab 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -128,6 +128,7 @@ static void r300_setup_atoms(struct r300_context* r300) R300_INIT_ATOM(vertex_format_state, 26); R300_INIT_ATOM(pvs_flush, 2); R300_INIT_ATOM(vs_state, 1031); + R300_INIT_ATOM(texture_cache_inval, 2); /* Some non-CSO atoms need explicit space to store the state locally. */ r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 32b64b6b28..47f2aa5154 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -320,6 +320,8 @@ struct r300_context { struct r300_atom ztop_state; /* PVS flush. */ struct r300_atom pvs_flush; + /* Texture cache invalidate. */ + struct r300_atom texture_cache_inval; /* Invariant state. This must be emitted to get the engine started. */ struct r300_atom invariant_state; diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 6a0ede359b..ad19725e60 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -1002,7 +1002,7 @@ void r300_emit_ztop_state(struct r300_context* r300, END_CS; } -void r300_flush_textures(struct r300_context* r300) +void r300_emit_texture_cache_inval(struct r300_context* r300, unsigned size, void* state) { CS_LOCALS(r300); @@ -1107,7 +1107,6 @@ void r300_emit_dirty_state(struct r300_context* r300) struct r300_screen* r300screen = r300_screen(r300->context.screen); struct r300_atom* atom; unsigned i; - int dirty_tex = 0; if (r300->dirty_state & R300_NEW_QUERY) { r300_emit_query_start(r300); @@ -1155,7 +1154,6 @@ void r300_emit_dirty_state(struct r300_context* r300) r300->sampler_states[i], r300->textures[i], i); - dirty_tex |= r300->dirty_state & (R300_NEW_TEXTURE << i); } r300->dirty_state &= ~((R300_NEW_SAMPLER << i) | (R300_NEW_TEXTURE << i)); @@ -1164,10 +1162,6 @@ void r300_emit_dirty_state(struct r300_context* r300) r300->dirty_state &= ~(R300_ANY_NEW_SAMPLERS | R300_ANY_NEW_TEXTURES); } - if (dirty_tex) { - r300_flush_textures(r300); - } - if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS) { struct r300_vertex_shader* vs = r300->vs_state.state; r300_emit_vs_constant_buffer(r300, &vs->code.constants); diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 5809bf4340..c73b016b76 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -98,7 +98,7 @@ void r300_emit_ztop_state(struct r300_context* r300, void r300_emit_pvs_flush(struct r300_context* r300, unsigned size, void* state); -void r300_flush_textures(struct r300_context* r300); +void r300_emit_texture_cache_inval(struct r300_context* r300, unsigned size, void* state); unsigned r300_get_num_dirty_dwords(struct r300_context *r300); diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 79cd715af1..15e0a0ad35 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -922,6 +922,7 @@ static void r300_set_sampler_textures(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); boolean is_r500 = r300_screen(r300->context.screen)->caps->is_r500; + boolean dirty_tex = FALSE; int i; /* XXX magic num */ @@ -934,6 +935,7 @@ static void r300_set_sampler_textures(struct pipe_context* pipe, pipe_texture_reference((struct pipe_texture**)&r300->textures[i], texture[i]); r300->dirty_state |= (R300_NEW_TEXTURE << i); + dirty_tex = TRUE; /* R300-specific - set the texrect factor in a fragment shader */ if (!is_r500 && r300->textures[i]->is_npot) { @@ -953,6 +955,10 @@ static void r300_set_sampler_textures(struct pipe_context* pipe, } r300->texture_count = count; + + if (dirty_tex) { + r300->texture_cache_inval.dirty = TRUE; + } } static void r300_set_scissor_state(struct pipe_context* pipe, -- cgit v1.2.3 From 4ed97f0a73db37f6105b6282d92646c3f66c2645 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 23:12:46 +0100 Subject: r300g: use the atom size directly during emission --- src/gallium/drivers/r300/r300_context.c | 22 +++++++++-------- src/gallium/drivers/r300/r300_emit.c | 35 +++++++++++++-------------- src/gallium/drivers/r300/r300_state.c | 2 +- src/gallium/drivers/r300/r300_state_derived.c | 2 +- 4 files changed, 31 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 5f50b60eab..3a84fc564d 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -105,29 +105,31 @@ static void r300_flush_cb(void *data) static void r300_setup_atoms(struct r300_context* r300) { + boolean is_r500 = r300_screen(r300->context.screen)->caps->is_r500; + boolean has_tcl = r300_screen(r300->context.screen)->caps->has_tcl; + /* Create the actual atom list. * * Each atom is examined and emitted in the order it appears here, which * can affect performance and conformance if not handled with care. * - * Some atoms never change size, others change every emit. This is just - * an upper bound on each atom, to keep the emission machinery from - * underallocating space. */ + * Some atoms never change size, others change every emit - those have + * the size of 0 here. */ make_empty_list(&r300->atom_list); R300_INIT_ATOM(invariant_state, 71); R300_INIT_ATOM(ztop_state, 2); R300_INIT_ATOM(blend_state, 8); - R300_INIT_ATOM(blend_color_state, 3); - R300_INIT_ATOM(clip_state, 29); - R300_INIT_ATOM(dsa_state, 8); - R300_INIT_ATOM(fb_state, 56); - R300_INIT_ATOM(rs_state, 25); + R300_INIT_ATOM(blend_color_state, is_r500 ? 3 : 2); + R300_INIT_ATOM(clip_state, has_tcl ? 5 + (6 * 4) : 2); + R300_INIT_ATOM(dsa_state, is_r500 ? 8 : 6); + R300_INIT_ATOM(fb_state, 0); + R300_INIT_ATOM(rs_state, 0); R300_INIT_ATOM(scissor_state, 3); R300_INIT_ATOM(viewport_state, 9); - R300_INIT_ATOM(rs_block_state, 21); + R300_INIT_ATOM(rs_block_state, 0); R300_INIT_ATOM(vertex_format_state, 26); R300_INIT_ATOM(pvs_flush, 2); - R300_INIT_ATOM(vs_state, 1031); + R300_INIT_ATOM(vs_state, 0); R300_INIT_ATOM(texture_cache_inval, 2); /* Some non-CSO atoms need explicit space to store the state locally. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index ad19725e60..013611018b 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -42,7 +42,7 @@ void r300_emit_blend_state(struct r300_context* r300, (struct pipe_framebuffer_state*)r300->fb_state.state; CS_LOCALS(r300); - BEGIN_CS(8); + BEGIN_CS(size); OUT_CS_REG(R300_RB3D_ROPCNTL, blend->rop); OUT_CS_REG_SEQ(R300_RB3D_CBLEND, 3); if (fb->nr_cbufs) { @@ -67,13 +67,13 @@ void r300_emit_blend_color_state(struct r300_context* r300, CS_LOCALS(r300); if (r300screen->caps->is_r500) { - BEGIN_CS(3); + BEGIN_CS(size); OUT_CS_REG_SEQ(R500_RB3D_CONSTANT_COLOR_AR, 2); OUT_CS(bc->blend_color_red_alpha); OUT_CS(bc->blend_color_green_blue); END_CS; } else { - BEGIN_CS(2); + BEGIN_CS(size); OUT_CS_REG(R300_RB3D_BLEND_COLOR, bc->blend_color); END_CS; } @@ -88,7 +88,7 @@ void r300_emit_clip_state(struct r300_context* r300, CS_LOCALS(r300); if (r300screen->caps->has_tcl) { - BEGIN_CS(5 + (6 * 4)); + BEGIN_CS(size); OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG, (r300screen->caps->is_r500 ? R500_PVS_UCP_START : R300_PVS_UCP_START)); @@ -103,7 +103,7 @@ void r300_emit_clip_state(struct r300_context* r300, R300_PS_UCP_MODE_CLIP_AS_TRIFAN); END_CS; } else { - BEGIN_CS(2); + BEGIN_CS(size); OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE); END_CS; } @@ -119,7 +119,7 @@ void r300_emit_dsa_state(struct r300_context* r300, unsigned size, void* state) struct pipe_stencil_ref stencil_ref = r300->stencil_ref; CS_LOCALS(r300); - BEGIN_CS(r300screen->caps->is_r500 ? 8 : 6); + BEGIN_CS(size); OUT_CS_REG(R300_FG_ALPHA_FUNC, dsa->alpha_function); OUT_CS_REG_SEQ(R300_ZB_CNTL, 3); @@ -390,8 +390,7 @@ void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state) int i; CS_LOCALS(r300); - BEGIN_CS((10 * fb->nr_cbufs) + (2 * (4 - fb->nr_cbufs)) + - (fb->zsbuf ? 10 : 0) + 8); + BEGIN_CS(size); /* Flush and free renderbuffer caches. */ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, @@ -587,7 +586,7 @@ void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state) float scale, offset; CS_LOCALS(r300); - BEGIN_CS(17 + (rs->polygon_offset_enable ? 5 : 0)); + BEGIN_CS(size); OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status); OUT_CS_REG(R300_GB_AA_CONFIG, rs->antialiasing_config); @@ -636,7 +635,7 @@ void r300_emit_rs_block_state(struct r300_context* r300, DBG(r300, DBG_DRAW, "r300: RS emit:\n"); - BEGIN_CS(5 + count*2); + BEGIN_CS(size); if (r300screen->caps->is_r500) { OUT_CS_REG_SEQ(R500_RS_IP_0, count); } else { @@ -722,7 +721,7 @@ void r300_emit_scissor_state(struct r300_context* r300, (((maxy - 1) + 1440) << R300_SCISSORS_Y_SHIFT); } - BEGIN_CS(3); + BEGIN_CS(size); OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); OUT_CS(top_left); OUT_CS(bottom_right); @@ -824,7 +823,7 @@ void r300_emit_vertex_format_state(struct r300_context* r300, DBG(r300, DBG_DRAW, "r300: VAP/PSC emit:\n"); - BEGIN_CS(26); + BEGIN_CS(size); OUT_CS_REG(R300_VAP_VTX_SIZE, vertex_info->vinfo.size); OUT_CS_REG_SEQ(R300_VAP_VTX_STATE_CNTL, 2); @@ -857,7 +856,7 @@ void r300_emit_pvs_flush(struct r300_context* r300, unsigned size, void* state) { CS_LOCALS(r300); - BEGIN_CS(2); + BEGIN_CS(size); OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); END_CS; } @@ -887,7 +886,7 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state) return; } - BEGIN_CS(9 + code->length); + BEGIN_CS(size); /* R300_VAP_PVS_CODE_CNTL_0 * R300_VAP_PVS_CONST_CNTL * R300_VAP_PVS_CODE_CNTL_1 @@ -953,11 +952,11 @@ void r300_emit_viewport_state(struct r300_context* r300, CS_LOCALS(r300); if (r300->tcl_bypass) { - BEGIN_CS(2); + BEGIN_CS(2); /* XXX tcl_bypass will be removed in gallium anyway */ OUT_CS_REG(R300_VAP_VTE_CNTL, 0); END_CS; } else { - BEGIN_CS(9); + BEGIN_CS(size); OUT_CS_REG_SEQ(R300_SE_VPORT_XSCALE, 6); OUT_CS_32F(viewport->xscale); OUT_CS_32F(viewport->xoffset); @@ -997,7 +996,7 @@ void r300_emit_ztop_state(struct r300_context* r300, struct r300_ztop_state* ztop = (struct r300_ztop_state*)state; CS_LOCALS(r300); - BEGIN_CS(2); + BEGIN_CS(size); OUT_CS_REG(R300_ZB_ZTOP, ztop->z_buffer_top); END_CS; } @@ -1006,7 +1005,7 @@ void r300_emit_texture_cache_inval(struct r300_context* r300, unsigned size, voi { CS_LOCALS(r300); - BEGIN_CS(2); + BEGIN_CS(size); OUT_CS_REG(R300_TX_INVALTAGS, 0); END_CS; } diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 15e0a0ad35..97a0897a5e 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1111,7 +1111,7 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) } r300->vs_state.state = vs; - r300->vs_state.size = vs->code.length + 11; + r300->vs_state.size = vs->code.length + 9; r300->vs_state.dirty = TRUE; r300->vertex_format_state.dirty = TRUE; diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index b33d44990a..86301e23d7 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -420,7 +420,7 @@ static void r300_update_rs_block(struct r300_context* r300, /* Now, after all that, see if we actually need to update the state. */ if (memcmp(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block))) { memcpy(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block)); - r300->rs_block_state.size = 5 + count; + r300->rs_block_state.size = 5 + count*2; r300->rs_block_state.dirty = TRUE; } } -- cgit v1.2.3 From d36e3952c21240cde19dac7f16cc37aac7174673 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 17:00:03 +0100 Subject: r300g: put validating buffers after flushing Also cleaning up the nasty validation process. --- src/gallium/drivers/r300/r300_emit.c | 32 +++++++++++++++++--- src/gallium/drivers/r300/r300_emit.h | 4 ++- src/gallium/drivers/r300/r300_render.c | 54 ++++------------------------------ 3 files changed, 37 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 013611018b..d66fa0dbdb 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -1010,11 +1010,16 @@ void r300_emit_texture_cache_inval(struct r300_context* r300, unsigned size, voi END_CS; } -void r300_emit_buffer_validate(struct r300_context *r300) +void r300_emit_buffer_validate(struct r300_context *r300, + boolean do_validate_vertex_buffers, + struct pipe_buffer *index_buffer) { struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)r300->fb_state.state; struct r300_texture* tex; + struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; + struct pipe_vertex_element *velem = r300->vertex_element; + struct pipe_buffer *pbuf; unsigned i; boolean invalid = FALSE; @@ -1061,16 +1066,35 @@ validate: goto validate; } } - /* ...and vertex buffer. */ + /* ...vertex buffer for SWTCL path... */ if (r300->vbo) { if (!r300->winsys->add_buffer(r300->winsys, r300->vbo, RADEON_GEM_DOMAIN_GTT, 0)) { r300->context.flush(&r300->context, 0, NULL); goto validate; } - } else { - /* debug_printf("No VBO while emitting dirty state!\n"); */ } + /* ...vertex buffers for HWTCL path... */ + if (do_validate_vertex_buffers) { + for (i = 0; i < r300->vertex_element_count; i++) { + pbuf = vbuf[velem[i].vertex_buffer_index].buffer; + + if (!r300->winsys->add_buffer(r300->winsys, pbuf, + RADEON_GEM_DOMAIN_GTT, 0)) { + r300->context.flush(&r300->context, 0, NULL); + goto validate; + } + } + } + /* ...and index buffer for HWTCL path. */ + if (index_buffer) { + if (!r300->winsys->add_buffer(r300->winsys, index_buffer, + RADEON_GEM_DOMAIN_GTT, 0)) { + r300->context.flush(&r300->context, 0, NULL); + goto validate; + } + } + if (!r300->winsys->validate(r300->winsys)) { r300->context.flush(&r300->context, 0, NULL); if (invalid) { diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index c73b016b76..4a3f94087b 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -105,6 +105,8 @@ unsigned r300_get_num_dirty_dwords(struct r300_context *r300); /* Emit all dirty state. */ void r300_emit_dirty_state(struct r300_context* r300); -void r300_emit_buffer_validate(struct r300_context *r300); +void r300_emit_buffer_validate(struct r300_context *r300, + boolean do_validate_vertex_buffers, + struct pipe_buffer *index_buffer); #endif /* R300_EMIT_H */ diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index e4f7615368..c5baf5508e 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -186,6 +186,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, dwords = 10 + count * vertex_size; r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + dwords); + r300_emit_buffer_validate(r300, FALSE, 0); r300_emit_dirty_state(r300); BEGIN_CS(dwords); @@ -313,31 +314,6 @@ static void r300_emit_draw_elements(struct r300_context *r300, END_CS; } -static boolean r300_setup_vertex_buffers(struct r300_context *r300) -{ - struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; - struct pipe_vertex_element *velem = r300->vertex_element; - struct pipe_buffer *pbuf; - -validate: - for (int i = 0; i < r300->vertex_element_count; i++) { - pbuf = vbuf[velem[i].vertex_buffer_index].buffer; - - if (!r300->winsys->add_buffer(r300->winsys, pbuf, - RADEON_GEM_DOMAIN_GTT, 0)) { - r300->context.flush(&r300->context, 0, NULL); - goto validate; - } - } - - if (!r300->winsys->validate(r300->winsys)) { - r300->context.flush(&r300->context, 0, NULL); - return r300->winsys->validate(r300->winsys); - } - - return TRUE; -} - static void r300_shorten_ubyte_elts(struct r300_context* r300, struct pipe_buffer** elts, unsigned count) @@ -393,30 +369,16 @@ void r300_draw_range_elements(struct pipe_context* pipe, return; } - r300_update_derived_state(r300); - - r300_emit_buffer_validate(r300); - - if (!r300_setup_vertex_buffers(r300)) { - return; - } - if (indexSize == 1) { r300_shorten_ubyte_elts(r300, &indexBuffer, count); indexSize = 2; } - if (!r300->winsys->add_buffer(r300->winsys, indexBuffer, - RADEON_GEM_DOMAIN_GTT, 0)) { - goto cleanup; - } - - if (!r300->winsys->validate(r300->winsys)) { - goto cleanup; - } + r300_update_derived_state(r300); /* 128 dwords for emit_aos and emit_draw_elements */ r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 128); + r300_emit_buffer_validate(r300, TRUE, indexBuffer); r300_emit_dirty_state(r300); r300_emit_aos(r300, 0); @@ -434,13 +396,13 @@ void r300_draw_range_elements(struct pipe_context* pipe, /* 16 spare dwords are enough for emit_draw_elements. */ if (count && r300_reserve_cs_space(r300, 16)) { + r300_emit_buffer_validate(r300, TRUE, indexBuffer); r300_emit_dirty_state(r300); r300_emit_aos(r300, 0); } } while (count); } -cleanup: if (indexBuffer != orgIndexBuffer) { pipe->screen->buffer_destroy(indexBuffer); } @@ -477,18 +439,13 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, r300_update_derived_state(r300); - r300_emit_buffer_validate(r300); - if (immd_is_good_idea(r300, count)) { r300_emit_draw_arrays_immediate(r300, mode, start, count); } else { - if (!r300_setup_vertex_buffers(r300)) { - return; - } - /* Make sure there are at least 128 spare dwords in the command buffer. * (most of it being consumed by emit_aos) */ r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 128); + r300_emit_buffer_validate(r300, TRUE, 0); r300_emit_dirty_state(r300); if (alt_num_verts || count <= 65535) { @@ -506,6 +463,7 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, /* Again, we emit both AOS and draw_arrays so there should be * at least 128 spare dwords. */ if (count && r300_reserve_cs_space(r300, 128)) { + r300_emit_buffer_validate(r300, TRUE, 0); r300_emit_dirty_state(r300); } } while (count); -- cgit v1.2.3 From aa4d47f68f992f8bbe843822c9f75dce9e8706f8 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 27 Feb 2010 03:20:58 +0100 Subject: st/mesa: do not advertise S3TC if the external lib is not available --- src/mesa/state_tracker/st_extensions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index d5f5854661..e9ee65576d 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -299,8 +299,12 @@ void st_init_extensions(struct st_context *st) /* s3tc support */ if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, - PIPE_TEXTURE_2D, - PIPE_TEXTURE_USAGE_SAMPLER, 0)) { + PIPE_TEXTURE_2D, + PIPE_TEXTURE_USAGE_SAMPLER, 0) && + (ctx->Mesa_DXTn || + screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, + PIPE_TEXTURE_2D, + PIPE_TEXTURE_USAGE_RENDER_TARGET, 0))) { ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE; ctx->Extensions.S3_s3tc = GL_TRUE; } -- cgit v1.2.3 From a5406444aeeef40c899a4159a1fae6d1501bc1cb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 16:28:30 -0800 Subject: r128: Add assert to check for null pointer dereference. --- src/mesa/drivers/dri/r128/r128_texmem.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index 5eec8c08cd..412f6d4255 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -260,6 +260,7 @@ void r128UploadTexImages( r128ContextPtr rmesa, r128TexObjPtr t ) } /* Set the base offset of the texture image */ + assert(t->base.memBlock); t->bufAddr = rmesa->r128Screen->texOffset[heap] + t->base.memBlock->ofs; -- cgit v1.2.3 From 689249bcbe96e2655aac29569ba36554bee1c503 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 16:30:49 -0800 Subject: mga: Add assert to check for null pointer dereference. --- src/mesa/drivers/dri/mga/mgatexmem.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/mga/mgatexmem.c b/src/mesa/drivers/dri/mga/mgatexmem.c index 47be6f3c18..58afbbb279 100644 --- a/src/mesa/drivers/dri/mga/mgatexmem.c +++ b/src/mesa/drivers/dri/mga/mgatexmem.c @@ -222,6 +222,7 @@ int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t ) return -1; } + assert(t->base.memBlock); ofs = mmesa->mgaScreen->textureOffset[ heap ] + t->base.memBlock->ofs; -- cgit v1.2.3 From b45af1ec61473ad3a576fc0cb564a4f71fbab7f5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 16:38:09 -0800 Subject: mach64: Add asserts to check for null pointer dereferences. --- src/mesa/drivers/dri/mach64/mach64_texmem.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index 46cee4320d..b09954ce23 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -305,6 +305,7 @@ void mach64UploadTexImages( mach64ContextPtr mmesa, mach64TexObjPtr t ) t->heap = heap; /* Set the base offset of the texture image */ + assert(t->base.memBlock); t->bufAddr = mmesa->mach64Screen->texOffset[heap] + t->base.memBlock->ofs; /* Force loading the new state into the hardware */ @@ -457,7 +458,9 @@ void mach64UploadMultiTexImages( mach64ContextPtr mmesa, } /* Set the base offset of the texture image */ + assert(t0->base.memBlock); t0->bufAddr = mmesa->mach64Screen->texOffset[heap] + t0->base.memBlock->ofs; + assert(t1->base.memBlock); t1->bufAddr = mmesa->mach64Screen->texOffset[heap] + t1->base.memBlock->ofs; /* Force loading the new state into the hardware */ -- cgit v1.2.3 From 975f105bb88fe6c146c091556f142e733885c91a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 16:41:49 -0800 Subject: i810: Add assert to check for null pointer dereference. --- src/mesa/drivers/dri/i810/i810texmem.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index bb426a4112..6e6b21cf2b 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -155,6 +155,7 @@ int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t ) return -1; } + assert(t->base.memBlock); ofs = t->base.memBlock->ofs; t->BufAddr = imesa->i810Screen->tex.map + ofs; t->Setup[I810_TEXREG_MI3] = imesa->i810Screen->textureOffset + ofs; -- cgit v1.2.3 From cab77711b3e8d398393677bcefcd413f50503a64 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 16:51:17 -0800 Subject: dri: Add assert to check for null pointer dereference. --- src/mesa/drivers/dri/common/dri_util.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index a4fd002664..890ae51339 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -127,6 +127,7 @@ static int driUnbindContext(__DRIcontext *pcp) /* Let driver unbind drawable from context */ (*psp->DriverAPI.UnbindContext)(pcp); + assert(pdp); if (pdp->refcount == 0) { /* ERROR!!! */ return GL_FALSE; -- cgit v1.2.3 From 65974f67e16187e1827fa4e46bde3b5df7a5bf02 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 17:01:25 -0800 Subject: glsl: Move assert from outside to inside of _slang_gen_swizzle function. --- src/mesa/shader/slang/slang_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 9ca5c1372d..6d1cea28a7 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -4223,6 +4223,7 @@ _slang_gen_swizzle(slang_ir_node *child, GLuint swizzle) n->Store = _slang_new_ir_storage_relative(0, swizzle_size(swizzle), child->Store); + assert(n->Store); n->Store->Swizzle = swizzle; } return n; @@ -4524,7 +4525,6 @@ _slang_gen_array_element(slang_assemble_ctx * A, slang_operation *oper) SWIZZLE_NIL); n = _slang_gen_swizzle(n, swizzle); } - assert(n->Store); return n; } else { -- cgit v1.2.3 From bfdee9cc70f21ef34ca8497d30ab72106ce43bd1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 17:19:31 -0800 Subject: mesa: Add assert to check input to memcpy is not null. --- src/mesa/main/mipmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 355af56b41..89b8c5a356 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -979,6 +979,7 @@ make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ + assert(srcPtr); memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ memcpy(dstPtr + (dstWidth - 1) * bpt, -- cgit v1.2.3 From 75dba756b2e3d6850b56376d7c183dc3277a563b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 20:11:31 -0800 Subject: mesa: Add asserts to check inputs to memcpy. --- src/mesa/main/mipmap.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 89b8c5a356..21ee317a31 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -979,6 +979,7 @@ make_1d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ + assert(dstPtr); assert(srcPtr); memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ @@ -1026,6 +1027,8 @@ make_2d_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ + assert(dstPtr); + assert(srcPtr); memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ memcpy(dstPtr + (dstWidth - 1) * bpt, -- cgit v1.2.3 From 706fffbff59be0dc884e1938f1bdf731af1efa3e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 20:23:17 -0800 Subject: glx: Add assert to check input to memcpy. --- src/glx/glx_pbuffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index 4c122ba6dd..f635138d62 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -379,6 +379,7 @@ CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig, req->glxwindow = (GLXWindow) XAllocID(dpy); req->numAttribs = (CARD32) i; + assert(attrib_list); memcpy(data, attrib_list, 8 * i); UnlockDisplay(dpy); -- cgit v1.2.3 From edd6c338cfa69b6bf9cac0922ebb9518fbca7eed Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 21:19:07 -0800 Subject: glut: Add asserts to check for null pointer dereferences. --- src/glut/glx/glut_event.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c index d6d963896a..4cdb814d76 100644 --- a/src/glut/glx/glut_event.c +++ b/src/glut/glx/glut_event.c @@ -664,6 +664,7 @@ processEventsAndTimeouts(void) case XK_KP_Delete: /* Introduced in X11R6. */ /* The Delete character is really an ASCII key. */ __glutSetWindow(window); + assert(keyboard); keyboard(127, /* ASCII Delete character. */ event.xkey.x, event.xkey.y); goto skip; @@ -1311,6 +1312,7 @@ processWindowWorkList(GLUTwindow * window) } /* Combine workMask with window->workMask to determine what finish and debug work there is. */ + assert(window); workMask |= window->workMask; if (workMask & GLUT_FINISH_WORK) { -- cgit v1.2.3 From 909c08d177638a6318382a70eee6e05ed67efd81 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 27 Feb 2010 21:57:38 -0800 Subject: dri: Remove dead code. --- src/mesa/drivers/dri/common/spantmp.h | 23 +++++------------------ src/mesa/drivers/dri/common/spantmp2.h | 23 +++++------------------ 2 files changed, 10 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/spantmp.h b/src/mesa/drivers/dri/common/spantmp.h index d5608b8806..cdc4f422ce 100644 --- a/src/mesa/drivers/dri/common/spantmp.h +++ b/src/mesa/drivers/dri/common/spantmp.h @@ -288,7 +288,6 @@ static void TAG(ReadRGBAPixels)( GLcontext *ctx, HW_READ_LOCK() { GLubyte (*rgba)[4] = (GLubyte (*)[4]) values; - const GLubyte *mask = NULL; /* remove someday */ GLuint i; LOCAL_VARS; @@ -296,23 +295,11 @@ static void TAG(ReadRGBAPixels)( GLcontext *ctx, HW_READ_CLIPLOOP() { - if (mask) - { - for (i=0;i Date: Sun, 28 Feb 2010 16:28:44 +0000 Subject: i965g: Fix texture creation --- src/gallium/drivers/i965/brw_screen_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index 8bdd43cf14..38e9961398 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -250,7 +250,7 @@ static struct pipe_texture *brw_texture_create( struct pipe_screen *screen, tex->ss.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; tex->ss.ss0.surface_type = translate_tex_target(tex->base.target); - format = translate_tex_target(tex->base.format); + format = translate_tex_format(tex->base.format); assert(format != BRW_SURFACEFORMAT_INVALID); tex->ss.ss0.surface_format = format; -- cgit v1.2.3 From 942762cd973af0df75040de21d3321cd19829e70 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 28 Feb 2010 07:45:56 +0100 Subject: r300g: decouple vertex stream setup (PSC) and VS output mapping (VAP_OUT) Formerly known as vertex_format_state. These two are completely unrelated when using HWTCL and decoupling them makes the design less SWTCL-centric. When bypass_vs_clip_and_viewport gets removed, the PSC setup will no longer be a derived state. This change shouldn't make unbreaking SWTCL harder. --- src/gallium/drivers/r300/r300_context.c | 9 +++-- src/gallium/drivers/r300/r300_context.h | 35 ++++++++++------- src/gallium/drivers/r300/r300_emit.c | 55 +++++++++++++++------------ src/gallium/drivers/r300/r300_emit.h | 5 ++- src/gallium/drivers/r300/r300_render.c | 2 +- src/gallium/drivers/r300/r300_state.c | 14 +++++-- src/gallium/drivers/r300/r300_state_derived.c | 47 +++++++++++++---------- 7 files changed, 101 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 3a84fc564d..1d7d598b24 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -59,7 +59,8 @@ static void r300_destroy_context(struct pipe_context* context) FREE(r300->fb_state.state); FREE(r300->rs_block_state.state); FREE(r300->scissor_state.state); - FREE(r300->vertex_format_state.state); + FREE(r300->vertex_stream_state.state); + FREE(r300->vap_output_state.state); FREE(r300->viewport_state.state); FREE(r300->ztop_state.state); FREE(r300); @@ -127,7 +128,8 @@ static void r300_setup_atoms(struct r300_context* r300) R300_INIT_ATOM(scissor_state, 3); R300_INIT_ATOM(viewport_state, 9); R300_INIT_ATOM(rs_block_state, 0); - R300_INIT_ATOM(vertex_format_state, 26); + R300_INIT_ATOM(vertex_stream_state, 0); + R300_INIT_ATOM(vap_output_state, 6); R300_INIT_ATOM(pvs_flush, 2); R300_INIT_ATOM(vs_state, 0); R300_INIT_ATOM(texture_cache_inval, 2); @@ -138,7 +140,8 @@ static void r300_setup_atoms(struct r300_context* r300) r300->fb_state.state = CALLOC_STRUCT(pipe_framebuffer_state); r300->rs_block_state.state = CALLOC_STRUCT(r300_rs_block); r300->scissor_state.state = CALLOC_STRUCT(pipe_scissor_state); - r300->vertex_format_state.state = CALLOC_STRUCT(r300_vertex_info); + r300->vertex_stream_state.state = CALLOC_STRUCT(r300_vertex_stream_state); + r300->vap_output_state.state = CALLOC_STRUCT(r300_vap_output_state); r300->viewport_state.state = CALLOC_STRUCT(r300_viewport_state); r300->ztop_state.state = CALLOC_STRUCT(r300_ztop_state); } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 47f2aa5154..3eb884a0cf 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -134,6 +134,21 @@ struct r300_texture_fb_state { uint32_t zb_format; /* R300_ZB_FORMAT */ }; +struct r300_vertex_stream_state { + /* R300_VAP_PROG_STREAK_CNTL_[0-7] */ + uint32_t vap_prog_stream_cntl[8]; + /* R300_VAP_PROG_STREAK_CNTL_EXT_[0-7] */ + uint32_t vap_prog_stream_cntl_ext[8]; + + unsigned count; +}; + +struct r300_vap_output_state { + uint32_t vap_vtx_state_cntl; /* R300_VAP_VTX_STATE_CNTL: 0x2180 */ + uint32_t vap_vsm_vtx_assm; /* R300_VAP_VSM_VTX_ASSM: 0x2184 */ + uint32_t vap_out_vtx_fmt[2]; /* R300_VAP_OUTPUT_VTX_FMT_[0-1]: 0x2090 */ +}; + struct r300_viewport_state { float xscale; /* R300_VAP_VPORT_XSCALE: 0x2098 */ float xoffset; /* R300_VAP_VPORT_XOFFSET: 0x209c */ @@ -246,16 +261,6 @@ struct r300_texture { enum r300_buffer_tiling microtile, macrotile; }; -struct r300_vertex_info { - /* Parent class */ - struct vertex_info vinfo; - - /* R300_VAP_PROG_STREAK_CNTL_[0-7] */ - uint32_t vap_prog_stream_cntl[8]; - /* R300_VAP_PROG_STREAK_CNTL_EXT_[0-7] */ - uint32_t vap_prog_stream_cntl_ext[8]; -}; - extern struct pipe_viewport_state r300_viewport_identity; struct r300_context { @@ -280,9 +285,6 @@ struct r300_context { struct r300_query *query_current; struct r300_query query_list; - /* Vertex formatting information. */ - struct r300_atom vertex_format_state; - /* Various CSO state objects. */ /* Beginning of atom list. */ struct r300_atom atom_list; @@ -312,6 +314,10 @@ struct r300_context { /* Texture states. */ struct r300_texture* textures[8]; int texture_count; + /* Vertex stream formatting state. */ + struct r300_atom vertex_stream_state; + /* VAP (vertex shader) output mapping state. */ + struct r300_atom vap_output_state; /* Vertex shader. */ struct r300_atom vs_state; /* Viewport state. */ @@ -334,6 +340,9 @@ struct r300_context { struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; int vertex_element_count; + /* Vertex info for Draw. */ + struct vertex_info vertex_info; + struct pipe_stencil_ref stencil_ref; /* Bitmask of dirty state objects. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index d66fa0dbdb..6a6771399a 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -814,44 +814,51 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) END_CS; } -void r300_emit_vertex_format_state(struct r300_context* r300, +void r300_emit_vertex_stream_state(struct r300_context* r300, unsigned size, void* state) { - struct r300_vertex_info* vertex_info = (struct r300_vertex_info*)state; + struct r300_vertex_stream_state *streams = + (struct r300_vertex_stream_state*)state; unsigned i; CS_LOCALS(r300); - DBG(r300, DBG_DRAW, "r300: VAP/PSC emit:\n"); + DBG(r300, DBG_DRAW, "r300: PSC emit:\n"); BEGIN_CS(size); - OUT_CS_REG(R300_VAP_VTX_SIZE, vertex_info->vinfo.size); - - OUT_CS_REG_SEQ(R300_VAP_VTX_STATE_CNTL, 2); - OUT_CS(vertex_info->vinfo.hwfmt[0]); - OUT_CS(vertex_info->vinfo.hwfmt[1]); - OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); - OUT_CS(vertex_info->vinfo.hwfmt[2]); - OUT_CS(vertex_info->vinfo.hwfmt[3]); - for (i = 0; i < 4; i++) { - DBG(r300, DBG_DRAW, " : hwfmt%d: 0x%08x\n", i, - vertex_info->vinfo.hwfmt[i]); - } - - OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, 8); - for (i = 0; i < 8; i++) { - OUT_CS(vertex_info->vap_prog_stream_cntl[i]); + OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_0, streams->count); + for (i = 0; i < streams->count; i++) { + OUT_CS(streams->vap_prog_stream_cntl[i]); DBG(r300, DBG_DRAW, " : prog_stream_cntl%d: 0x%08x\n", i, - vertex_info->vap_prog_stream_cntl[i]); + streams->vap_prog_stream_cntl[i]); } - OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_EXT_0, 8); - for (i = 0; i < 8; i++) { - OUT_CS(vertex_info->vap_prog_stream_cntl_ext[i]); + OUT_CS_REG_SEQ(R300_VAP_PROG_STREAM_CNTL_EXT_0, streams->count); + for (i = 0; i < streams->count; i++) { + OUT_CS(streams->vap_prog_stream_cntl_ext[i]); DBG(r300, DBG_DRAW, " : prog_stream_cntl_ext%d: 0x%08x\n", i, - vertex_info->vap_prog_stream_cntl_ext[i]); + streams->vap_prog_stream_cntl_ext[i]); } END_CS; } +void r300_emit_vap_output_state(struct r300_context* r300, + unsigned size, void* state) +{ + struct r300_vap_output_state *vap_out_state = + (struct r300_vap_output_state*)state; + CS_LOCALS(r300); + + DBG(r300, DBG_DRAW, "r300: VAP emit:\n"); + + BEGIN_CS(size); + OUT_CS_REG_SEQ(R300_VAP_VTX_STATE_CNTL, 2); + OUT_CS(vap_out_state->vap_vtx_state_cntl); + OUT_CS(vap_out_state->vap_vsm_vtx_assm); + OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); + OUT_CS(vap_out_state->vap_out_vtx_fmt[0]); + OUT_CS(vap_out_state->vap_out_vtx_fmt[1]); + END_CS; +} + void r300_emit_pvs_flush(struct r300_context* r300, unsigned size, void* state) { CS_LOCALS(r300); diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index 4a3f94087b..a2c2a91b88 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -77,9 +77,12 @@ void r300_emit_texture(struct r300_context* r300, void r300_emit_vertex_buffer(struct r300_context* r300); -void r300_emit_vertex_format_state(struct r300_context* r300, +void r300_emit_vertex_stream_state(struct r300_context* r300, unsigned size, void* state); +void r300_emit_vap_output_state(struct r300_context* r300, + unsigned size, void* state); + void r300_emit_vertex_program_code(struct r300_context* r300, struct r300_vertex_program_code* code); diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index c5baf5508e..770a92be74 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -597,7 +597,7 @@ r300_render_get_vertex_info(struct vbuf_render* render) r300_update_derived_state(r300); - return (struct vertex_info*)r300->vertex_format_state.state; + return &r300->vertex_info; } static boolean r300_render_allocate_vertices(struct vbuf_render* render, diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 97a0897a5e..5a47158400 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -659,7 +659,11 @@ static void r300_bind_fs_state(struct pipe_context* pipe, void* shader) r300->fs = fs; r300_pick_fragment_shader(r300); - r300->vertex_format_state.dirty = TRUE; + r300->rs_block_state.dirty = TRUE; /* Will be updated before the emission. */ + + if (r300->vs_state.state && r300_vertex_shader_setup_wpos(r300)) { + r300->vap_output_state.dirty = TRUE; + } r300->dirty_state |= R300_NEW_FRAGMENT_SHADER | R300_NEW_FRAGMENT_SHADER_CONSTANTS; } @@ -1033,9 +1037,9 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, if (r300->draw) { draw_flush(r300->draw); draw_set_vertex_buffers(r300->draw, count, buffers); + } else { + r300->vertex_stream_state.dirty = TRUE; } - - r300->vertex_format_state.dirty = TRUE; } static boolean r300_validate_aos(struct r300_context *r300) @@ -1114,7 +1118,9 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) r300->vs_state.size = vs->code.length + 9; r300->vs_state.dirty = TRUE; - r300->vertex_format_state.dirty = TRUE; + r300->rs_block_state.dirty = TRUE; /* Will be updated before the emission. */ + r300->vap_output_state.dirty = TRUE; + r300->vertex_stream_state.dirty = TRUE; /* XXX needed for TCL bypass */ r300->pvs_flush.dirty = TRUE; if (r300->fs) { diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 86301e23d7..0574d98e07 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -49,9 +49,7 @@ static void r300_draw_emit_attrib(struct r300_context* r300, output = draw_find_shader_output(r300->draw, info->output_semantic_name[index], info->output_semantic_index[index]); - draw_emit_vertex_attr( - (struct vertex_info*)r300->vertex_format_state.state, - emit, interp, output); + draw_emit_vertex_attr(&r300->vertex_info, emit, interp, output); } static void r300_draw_emit_all_attribs(struct r300_context* r300) @@ -106,17 +104,21 @@ static void r300_draw_emit_all_attribs(struct r300_context* r300) } /* Update the PSC tables. */ +/* XXX move this function into r300_state.c after TCL-bypass gets removed + * XXX because this one is dependent only on vertex elements. */ static void r300_vertex_psc(struct r300_context* r300) { struct r300_vertex_shader* vs = r300->vs_state.state; - struct r300_vertex_info *vformat = - (struct r300_vertex_info*)r300->vertex_format_state.state; + struct r300_vertex_stream_state *vformat = + (struct r300_vertex_stream_state*)r300->vertex_stream_state.state; uint16_t type, swizzle; enum pipe_format format; unsigned i; int identity[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; int* stream_tab; + memset(vformat, 0, sizeof(struct r300_vertex_stream_state)); + /* If TCL is bypassed, map vertex streams to equivalent VS output * locations. */ if (r300->tcl_bypass) { @@ -157,20 +159,25 @@ static void r300_vertex_psc(struct r300_context* r300) } vformat->vap_prog_stream_cntl[i >> 1] |= (R300_LAST_VEC << (i & 1 ? 16 : 0)); + + vformat->count = (i >> 1) + 1; + r300->vertex_stream_state.size = (1 + vformat->count) * 2; } /* Update the PSC tables for SW TCL, using Draw. */ static void r300_swtcl_vertex_psc(struct r300_context* r300) { struct r300_vertex_shader* vs = r300->vs_state.state; - struct r300_vertex_info *vformat = - (struct r300_vertex_info*)r300->vertex_format_state.state; - struct vertex_info* vinfo = &vformat->vinfo; + struct r300_vertex_stream_state *vformat = + (struct r300_vertex_stream_state*)r300->vertex_stream_state.state; + struct vertex_info* vinfo = &r300->vertex_info; uint16_t type, swizzle; enum pipe_format format; unsigned i, attrib_count; int* vs_output_tab = vs->stream_loc_notcl; + memset(vformat, 0, sizeof(struct r300_vertex_stream_state)); + /* For each Draw attribute, route it to the fragment shader according * to the vs_output_tab. */ attrib_count = vinfo->num_attribs; @@ -212,6 +219,9 @@ static void r300_swtcl_vertex_psc(struct r300_context* r300) } vformat->vap_prog_stream_cntl[i >> 1] |= (R300_LAST_VEC << (i & 1 ? 16 : 0)); + + vformat->count = (i >> 1) + 1; + r300->vertex_stream_state.size = (1 + vformat->count) * 2; } static void r300_rs_col(struct r300_rs_block* rs, int id, int ptr, @@ -430,13 +440,12 @@ static void r300_update_derived_shader_state(struct r300_context* r300) { struct r300_vertex_shader* vs = r300->vs_state.state; struct r300_screen* r300screen = r300_screen(r300->context.screen); - struct r300_vertex_info *vformat = - (struct r300_vertex_info*)r300->vertex_format_state.state; - struct vertex_info* vinfo = &vformat->vinfo; + struct r300_vap_output_state *vap_out = + (struct r300_vap_output_state*)r300->vap_output_state.state; - /* Mmm, delicious hax */ - memset(r300->vertex_format_state.state, 0, sizeof(struct r300_vertex_info)); - memcpy(vinfo->hwfmt, vs->hwfmt, sizeof(uint)*4); + /* XXX Mmm, delicious hax */ + memset(&r300->vertex_info, 0, sizeof(struct vertex_info)); + memcpy(vap_out, vs->hwfmt, sizeof(uint)*4); r300_update_rs_block(r300, &vs->outputs, &r300->fs->inputs); @@ -444,8 +453,7 @@ static void r300_update_derived_shader_state(struct r300_context* r300) r300_vertex_psc(r300); } else { r300_draw_emit_all_attribs(r300); - draw_compute_vertex_size( - (struct vertex_info*)r300->vertex_format_state.state); + draw_compute_vertex_size(&r300->vertex_info); r300_swtcl_vertex_psc(r300); } } @@ -523,10 +531,9 @@ static void r300_update_ztop(struct r300_context* r300) void r300_update_derived_state(struct r300_context* r300) { - /* XXX */ - if (r300->dirty_state & R300_NEW_FRAGMENT_SHADER || - r300->vs_state.dirty || r300->vertex_format_state.dirty || - r300->rs_state.dirty) { + if (r300->rs_block_state.dirty || + r300->vertex_stream_state.dirty || /* XXX put updating this state out of this file */ + r300->rs_state.dirty) { /* XXX and remove this one (tcl_bypass dependency) */ r300_update_derived_shader_state(r300); } -- cgit v1.2.3 From d2ac3d5e79bdf5a32a2dca135403d963ac6c83e4 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 28 Feb 2010 19:28:31 +0100 Subject: r300g: atomize texture and sampler states --- src/gallium/drivers/r300/r300_blit.c | 8 +- src/gallium/drivers/r300/r300_context.c | 3 + src/gallium/drivers/r300/r300_context.h | 35 +++++--- src/gallium/drivers/r300/r300_emit.c | 117 +++++++------------------- src/gallium/drivers/r300/r300_emit.h | 11 +-- src/gallium/drivers/r300/r300_fs.c | 7 +- src/gallium/drivers/r300/r300_state.c | 43 +++++----- src/gallium/drivers/r300/r300_state_derived.c | 62 +++++++++++++- src/gallium/drivers/r300/r300_texture.c | 2 +- 9 files changed, 153 insertions(+), 135 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 187b4bf384..32d05749bd 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -98,6 +98,8 @@ static void r300_hw_copy(struct pipe_context* pipe, unsigned width, unsigned height) { struct r300_context* r300 = r300_context(pipe); + struct r300_textures_state* state = + (struct r300_textures_state*)r300->textures_state.state; /* Yeah we have to save all those states to ensure this blitter operation * is really transparent. The states will be restored by the blitter once @@ -106,11 +108,11 @@ static void r300_hw_copy(struct pipe_context* pipe, util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state); util_blitter_save_fragment_sampler_states( - r300->blitter, r300->sampler_count, (void**)r300->sampler_states); + r300->blitter, state->sampler_count, (void**)state->sampler_states); util_blitter_save_fragment_sampler_textures( - r300->blitter, r300->texture_count, - (struct pipe_texture**)r300->textures); + r300->blitter, state->texture_count, + (struct pipe_texture**)state->textures); /* Do a copy */ util_blitter_copy(r300->blitter, diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 1d7d598b24..86b98a4ba5 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -59,6 +59,7 @@ static void r300_destroy_context(struct pipe_context* context) FREE(r300->fb_state.state); FREE(r300->rs_block_state.state); FREE(r300->scissor_state.state); + FREE(r300->textures_state.state); FREE(r300->vertex_stream_state.state); FREE(r300->vap_output_state.state); FREE(r300->viewport_state.state); @@ -133,6 +134,7 @@ static void r300_setup_atoms(struct r300_context* r300) R300_INIT_ATOM(pvs_flush, 2); R300_INIT_ATOM(vs_state, 0); R300_INIT_ATOM(texture_cache_inval, 2); + R300_INIT_ATOM(textures_state, 0); /* Some non-CSO atoms need explicit space to store the state locally. */ r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state); @@ -140,6 +142,7 @@ static void r300_setup_atoms(struct r300_context* r300) r300->fb_state.state = CALLOC_STRUCT(pipe_framebuffer_state); r300->rs_block_state.state = CALLOC_STRUCT(r300_rs_block); r300->scissor_state.state = CALLOC_STRUCT(pipe_scissor_state); + r300->textures_state.state = CALLOC_STRUCT(r300_textures_state); r300->vertex_stream_state.state = CALLOC_STRUCT(r300_vertex_stream_state); r300->vap_output_state.state = CALLOC_STRUCT(r300_vap_output_state); r300->viewport_state.state = CALLOC_STRUCT(r300_viewport_state); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 3eb884a0cf..b98fe347b8 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -118,7 +118,7 @@ struct r300_sampler_state { unsigned min_lod, max_lod; }; -struct r300_texture_state { +struct r300_texture_format_state { uint32_t format0; /* R300_TX_FORMAT0: 0x4480 */ uint32_t format1; /* R300_TX_FORMAT1: 0x44c0 */ uint32_t format2; /* R300_TX_FORMAT2: 0x4500 */ @@ -134,6 +134,25 @@ struct r300_texture_fb_state { uint32_t zb_format; /* R300_ZB_FORMAT */ }; +struct r300_textures_state { + /* Textures. */ + struct r300_texture *textures[8]; + int texture_count; + /* Sampler states. */ + struct r300_sampler_state *sampler_states[8]; + int sampler_count; + + /* These is the merge of the texture and sampler states. */ + unsigned count; + uint32_t tx_enable; /* R300_TX_ENABLE: 0x4101 */ + struct r300_texture_sampler_state { + uint32_t format[3]; /* R300_TX_FORMAT[0-2] */ + uint32_t filter[2]; /* R300_TX_FILTER[0-1] */ + uint32_t border_color; /* R300_TX_BORDER_COLOR: 0x45c0 */ + uint32_t tile_config; /* R300_TX_OFFSET (subset thereof) */ + } regs[8]; +}; + struct r300_vertex_stream_state { /* R300_VAP_PROG_STREAK_CNTL_[0-7] */ uint32_t vap_prog_stream_cntl[8]; @@ -165,10 +184,6 @@ struct r300_ztop_state { #define R300_NEW_FRAGMENT_SHADER 0x00000020 #define R300_NEW_FRAGMENT_SHADER_CONSTANTS 0x00000040 -#define R300_NEW_SAMPLER 0x00000200 -#define R300_ANY_NEW_SAMPLERS 0x0001fe00 -#define R300_NEW_TEXTURE 0x00040000 -#define R300_ANY_NEW_TEXTURES 0x03fc0000 #define R300_NEW_VERTEX_SHADER_CONSTANTS 0x10000000 #define R300_NEW_QUERY 0x40000000 #define R300_NEW_KITCHEN_SINK 0x7fffffff @@ -254,7 +269,7 @@ struct r300_texture { struct pipe_buffer* buffer; /* Registers carrying texture format data. */ - struct r300_texture_state state; + struct r300_texture_format_state state; struct r300_texture_fb_state fb_state; /* Buffer tiling */ @@ -306,14 +321,10 @@ struct r300_context { struct r300_atom rs_state; /* RS block state. */ struct r300_atom rs_block_state; - /* Sampler states. */ - struct r300_sampler_state* sampler_states[8]; - int sampler_count; /* Scissor state. */ struct r300_atom scissor_state; - /* Texture states. */ - struct r300_texture* textures[8]; - int texture_count; + /* Textures state. */ + struct r300_atom textures_state; /* Vertex stream formatting state. */ struct r300_atom vertex_stream_state; /* VAP (vertex shader) output mapping state. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 6a6771399a..17d55ba3b4 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -146,6 +146,8 @@ static const float * get_shader_constant( { struct r300_viewport_state* viewport = (struct r300_viewport_state*)r300->viewport_state.state; + struct r300_textures_state* texstate = + (struct r300_textures_state*)r300->textures_state.state; static float vec[4] = { 0.0, 0.0, 0.0, 1.0 }; struct pipe_texture *tex; @@ -161,7 +163,7 @@ static const float * get_shader_constant( /* Factor for converting rectangle coords to * normalized coords. Should only show up on non-r500. */ case RC_STATE_R300_TEXRECT_FACTOR: - tex = &r300->textures[constant->u.State[1]]->tex; + tex = &texstate->textures[constant->u.State[1]]->tex; vec[0] = 1.0 / tex->width0; vec[1] = 1.0 / tex->height0; break; @@ -728,49 +730,35 @@ void r300_emit_scissor_state(struct r300_context* r300, END_CS; } -void r300_emit_texture(struct r300_context* r300, - struct r300_sampler_state* sampler, - struct r300_texture* tex, - unsigned offset) +void r300_emit_textures_state(struct r300_context *r300, + unsigned size, void *state) { - uint32_t filter0 = sampler->filter0; - uint32_t format0 = tex->state.format0; - unsigned min_level, max_level; + struct r300_textures_state *allstate = (struct r300_textures_state*)state; + struct r300_texture_sampler_state *texstate; + unsigned i; CS_LOCALS(r300); - /* to emulate 1D textures through 2D ones correctly */ - if (tex->tex.target == PIPE_TEXTURE_1D) { - filter0 &= ~R300_TX_WRAP_T_MASK; - filter0 |= R300_TX_WRAP_T(R300_TX_CLAMP_TO_EDGE); - } + BEGIN_CS(size); + OUT_CS_REG(R300_TX_ENABLE, allstate->tx_enable); - if (tex->is_npot) { - /* NPOT textures don't support mip filter, unfortunately. - * This prevents incorrect rendering. */ - filter0 &= ~R300_TX_MIN_FILTER_MIP_MASK; - } else { - /* determine min/max levels */ - /* the MAX_MIP level is the largest (finest) one */ - max_level = MIN2(sampler->max_lod, tex->tex.last_level); - min_level = MIN2(sampler->min_lod, max_level); - format0 |= R300_TX_NUM_LEVELS(max_level); - filter0 |= R300_TX_MAX_MIP_LEVEL(min_level); - } + for (i = 0; i < allstate->count; i++) { + if ((1 << i) & allstate->tx_enable) { + texstate = &allstate->regs[i]; + + OUT_CS_REG(R300_TX_FILTER0_0 + (i * 4), texstate->filter[0]); + OUT_CS_REG(R300_TX_FILTER1_0 + (i * 4), texstate->filter[1]); + OUT_CS_REG(R300_TX_BORDER_COLOR_0 + (i * 4), + texstate->border_color); + + OUT_CS_REG(R300_TX_FORMAT0_0 + (i * 4), texstate->format[0]); + OUT_CS_REG(R300_TX_FORMAT1_0 + (i * 4), texstate->format[1]); + OUT_CS_REG(R300_TX_FORMAT2_0 + (i * 4), texstate->format[2]); - BEGIN_CS(16); - OUT_CS_REG(R300_TX_FILTER0_0 + (offset * 4), filter0 | - (offset << 28)); - OUT_CS_REG(R300_TX_FILTER1_0 + (offset * 4), sampler->filter1); - OUT_CS_REG(R300_TX_BORDER_COLOR_0 + (offset * 4), sampler->border_color); - - OUT_CS_REG(R300_TX_FORMAT0_0 + (offset * 4), format0); - OUT_CS_REG(R300_TX_FORMAT1_0 + (offset * 4), tex->state.format1); - OUT_CS_REG(R300_TX_FORMAT2_0 + (offset * 4), tex->state.format2); - OUT_CS_REG_SEQ(R300_TX_OFFSET_0 + (offset * 4), 1); - OUT_CS_RELOC(tex->buffer, - R300_TXO_MACRO_TILE(tex->macrotile) | - R300_TXO_MICRO_TILE(tex->microtile), - RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0, 0); + OUT_CS_REG_SEQ(R300_TX_OFFSET_0 + (i * 4), 1); + OUT_CS_RELOC(allstate->textures[i]->buffer, texstate->tile_config, + RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0, 0); + } + } END_CS; } @@ -976,27 +964,6 @@ void r300_emit_viewport_state(struct r300_context* r300, } } -void r300_emit_texture_count(struct r300_context* r300) -{ - uint32_t tx_enable = 0; - int i; - CS_LOCALS(r300); - - /* Notice that texture_count and sampler_count are just sizes - * of the respective arrays. We still have to check for the individual - * elements. */ - for (i = 0; i < MIN2(r300->sampler_count, r300->texture_count); i++) { - if (r300->textures[i]) { - tx_enable |= 1 << i; - } - } - - BEGIN_CS(2); - OUT_CS_REG(R300_TX_ENABLE, tx_enable); - END_CS; - -} - void r300_emit_ztop_state(struct r300_context* r300, unsigned size, void* state) { @@ -1023,6 +990,8 @@ void r300_emit_buffer_validate(struct r300_context *r300, { struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)r300->fb_state.state; + struct r300_textures_state *texstate = + (struct r300_textures_state*)r300->textures_state.state; struct r300_texture* tex; struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; struct pipe_vertex_element *velem = r300->vertex_element; @@ -1055,9 +1024,9 @@ validate: } } /* ...textures... */ - for (i = 0; i < r300->texture_count; i++) { - tex = r300->textures[i]; - if (!tex) + for (i = 0; i < texstate->count; i++) { + tex = texstate->textures[i]; + if (!tex || !texstate->sampler_states[i]) continue; if (!r300->winsys->add_buffer(r300->winsys, tex->buffer, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0)) { @@ -1136,7 +1105,6 @@ void r300_emit_dirty_state(struct r300_context* r300) { struct r300_screen* r300screen = r300_screen(r300->context.screen); struct r300_atom* atom; - unsigned i; if (r300->dirty_state & R300_NEW_QUERY) { r300_emit_query_start(r300); @@ -1171,27 +1139,6 @@ void r300_emit_dirty_state(struct r300_context* r300) r300->dirty_state &= ~R300_NEW_FRAGMENT_SHADER_CONSTANTS; } - /* Samplers and textures are tracked separately but emitted together. */ - if (r300->dirty_state & - (R300_ANY_NEW_SAMPLERS | R300_ANY_NEW_TEXTURES)) { - r300_emit_texture_count(r300); - - for (i = 0; i < MIN2(r300->sampler_count, r300->texture_count); i++) { - if (r300->dirty_state & - ((R300_NEW_SAMPLER << i) | (R300_NEW_TEXTURE << i))) { - if (r300->textures[i]) { - r300_emit_texture(r300, - r300->sampler_states[i], - r300->textures[i], - i); - } - r300->dirty_state &= - ~((R300_NEW_SAMPLER << i) | (R300_NEW_TEXTURE << i)); - } - } - r300->dirty_state &= ~(R300_ANY_NEW_SAMPLERS | R300_ANY_NEW_TEXTURES); - } - if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS) { struct r300_vertex_shader* vs = r300->vs_state.state; r300_emit_vs_constant_buffer(r300, &vs->code.constants); diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h index a2c2a91b88..449e640a88 100644 --- a/src/gallium/drivers/r300/r300_emit.h +++ b/src/gallium/drivers/r300/r300_emit.h @@ -70,10 +70,8 @@ void r300_emit_rs_block_state(struct r300_context* r300, void r300_emit_scissor_state(struct r300_context* r300, unsigned size, void* state); -void r300_emit_texture(struct r300_context* r300, - struct r300_sampler_state* sampler, - struct r300_texture* tex, - unsigned offset); +void r300_emit_textures_state(struct r300_context *r300, + unsigned size, void *state); void r300_emit_vertex_buffer(struct r300_context* r300); @@ -83,9 +81,6 @@ void r300_emit_vertex_stream_state(struct r300_context* r300, void r300_emit_vap_output_state(struct r300_context* r300, unsigned size, void* state); -void r300_emit_vertex_program_code(struct r300_context* r300, - struct r300_vertex_program_code* code); - void r300_emit_vs_constant_buffer(struct r300_context* r300, struct rc_constant_list* constants); @@ -94,8 +89,6 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state); void r300_emit_viewport_state(struct r300_context* r300, unsigned size, void* state); -void r300_emit_texture_count(struct r300_context* r300); - void r300_emit_ztop_state(struct r300_context* r300, unsigned size, void* state); diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index ae4c62b2f1..3c2625269b 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -133,10 +133,13 @@ static void get_compare_state( struct r300_fragment_program_external_state* state, unsigned shadow_samplers) { + struct r300_textures_state *texstate = + (struct r300_textures_state*)r300->textures_state.state; + memset(state, 0, sizeof(*state)); - for (int i = 0; i < r300->sampler_count; i++) { - struct r300_sampler_state* s = r300->sampler_states[i]; + for (int i = 0; i < texstate->sampler_count; i++) { + struct r300_sampler_state* s = texstate->sampler_states[i]; if (s && s->state.compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) { /* XXX Gallium doesn't provide us with any information regarding diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 5a47158400..12bf083871 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -859,7 +859,7 @@ static void* state->max_anisotropy > 0); /* Unfortunately, r300-r500 don't support floating-point mipmap lods. */ - /* We must pass these to the emit function to clamp them properly. */ + /* We must pass these to the merge function to clamp them properly. */ sampler->min_lod = MAX2((unsigned)state->min_lod, 0); sampler->max_lod = MAX2((unsigned)ceilf(state->max_lod), 0); @@ -885,23 +885,20 @@ static void r300_bind_sampler_states(struct pipe_context* pipe, void** states) { struct r300_context* r300 = r300_context(pipe); - int i; + struct r300_textures_state* state = + (struct r300_textures_state*)r300->textures_state.state; if (count > 8) { return; } - for (i = 0; i < count; i++) { - if (r300->sampler_states[i] != states[i]) { - r300->sampler_states[i] = (struct r300_sampler_state*)states[i]; - r300->dirty_state |= (R300_NEW_SAMPLER << i); - } - } + memcpy(state->sampler_states, states, sizeof(void*) * count); + state->sampler_count = count; - r300->sampler_count = count; + r300->textures_state.dirty = TRUE; /* Pick a fragment shader based on the texture compare state. */ - if (r300->fs && (r300->dirty_state & R300_ANY_NEW_SAMPLERS)) { + if (r300->fs && count) { if (r300_pick_fragment_shader(r300)) { r300->dirty_state |= R300_NEW_FRAGMENT_SHADER | R300_NEW_FRAGMENT_SHADER_CONSTANTS; @@ -925,24 +922,25 @@ static void r300_set_sampler_textures(struct pipe_context* pipe, struct pipe_texture** texture) { struct r300_context* r300 = r300_context(pipe); + struct r300_textures_state* state = + (struct r300_textures_state*)r300->textures_state.state; + unsigned i; boolean is_r500 = r300_screen(r300->context.screen)->caps->is_r500; boolean dirty_tex = FALSE; - int i; /* XXX magic num */ if (count > 8) { return; } - + for (i = 0; i < count; i++) { - if (r300->textures[i] != (struct r300_texture*)texture[i]) { - pipe_texture_reference((struct pipe_texture**)&r300->textures[i], - texture[i]); - r300->dirty_state |= (R300_NEW_TEXTURE << i); + if (state->textures[i] != (struct r300_texture*)texture[i]) { + pipe_texture_reference((struct pipe_texture**)&state->textures[i], + texture[i]); dirty_tex = TRUE; - /* R300-specific - set the texrect factor in a fragment shader */ - if (!is_r500 && r300->textures[i]->is_npot) { + /* R300-specific - set the texrect factor in the fragment shader */ + if (!is_r500 && state->textures[i]->is_npot) { /* XXX It would be nice to re-emit just 1 constant, * XXX not all of them */ r300->dirty_state |= R300_NEW_FRAGMENT_SHADER_CONSTANTS; @@ -951,14 +949,15 @@ static void r300_set_sampler_textures(struct pipe_context* pipe, } for (i = count; i < 8; i++) { - if (r300->textures[i]) { - pipe_texture_reference((struct pipe_texture**)&r300->textures[i], + if (state->textures[i]) { + pipe_texture_reference((struct pipe_texture**)&state->textures[i], NULL); - r300->dirty_state |= (R300_NEW_TEXTURE << i); } } - r300->texture_count = count; + state->texture_count = count; + + r300->textures_state.dirty = TRUE; if (dirty_tex) { r300->texture_cache_inval.dirty = TRUE; diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 0574d98e07..6eb7f2bfd1 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -431,7 +431,6 @@ static void r300_update_rs_block(struct r300_context* r300, if (memcmp(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block))) { memcpy(r300->rs_block_state.state, &rs, sizeof(struct r300_rs_block)); r300->rs_block_state.size = 5 + count*2; - r300->rs_block_state.dirty = TRUE; } } @@ -529,6 +528,63 @@ static void r300_update_ztop(struct r300_context* r300) r300->ztop_state.dirty = TRUE; } +static void r300_merge_textures_and_samplers(struct r300_context* r300) +{ + struct r300_textures_state *state = + (struct r300_textures_state*)r300->textures_state.state; + struct r300_texture_sampler_state *texstate; + struct r300_sampler_state *sampler; + struct r300_texture *tex; + unsigned min_level, max_level, i, size; + unsigned count = MIN2(state->texture_count, state->sampler_count); + + state->tx_enable = 0; + size = 2; + + for (i = 0; i < count; i++) { + if (state->textures[i] && state->sampler_states[i]) { + state->tx_enable |= 1 << i; + + tex = state->textures[i]; + sampler = state->sampler_states[i]; + + texstate = &state->regs[i]; + memcpy(texstate->format, &tex->state, sizeof(uint32_t)*3); + texstate->filter[0] = sampler->filter0; + texstate->filter[1] = sampler->filter1; + texstate->border_color = sampler->border_color; + texstate->tile_config = R300_TXO_MACRO_TILE(tex->macrotile) | + R300_TXO_MICRO_TILE(tex->microtile); + + /* to emulate 1D textures through 2D ones correctly */ + if (tex->tex.target == PIPE_TEXTURE_1D) { + texstate->filter[0] &= ~R300_TX_WRAP_T_MASK; + texstate->filter[0] |= R300_TX_WRAP_T(R300_TX_CLAMP_TO_EDGE); + } + + if (tex->is_npot) { + /* NPOT textures don't support mip filter, unfortunately. + * This prevents incorrect rendering. */ + texstate->filter[0] &= ~R300_TX_MIN_FILTER_MIP_MASK; + } else { + /* determine min/max levels */ + /* the MAX_MIP level is the largest (finest) one */ + max_level = MIN2(sampler->max_lod, tex->tex.last_level); + min_level = MIN2(sampler->min_lod, max_level); + texstate->format[0] |= R300_TX_NUM_LEVELS(max_level); + texstate->filter[0] |= R300_TX_MAX_MIP_LEVEL(min_level); + } + + texstate->filter[0] |= i << 28; + + size += 16; + state->count = i+1; + } + } + + r300->textures_state.size = size; +} + void r300_update_derived_state(struct r300_context* r300) { if (r300->rs_block_state.dirty || @@ -537,5 +593,9 @@ void r300_update_derived_state(struct r300_context* r300) r300_update_derived_shader_state(r300); } + if (r300->textures_state.dirty) { + r300_merge_textures_and_samplers(r300); + } + r300_update_ztop(r300); } diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 7c3b781c0b..2246c75056 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -505,7 +505,7 @@ boolean r300_is_sampler_format_supported(enum pipe_format format) static void r300_setup_texture_state(struct r300_screen* screen, struct r300_texture* tex) { - struct r300_texture_state* state = &tex->state; + struct r300_texture_format_state* state = &tex->state; struct pipe_texture *pt = &tex->tex; unsigned i; boolean is_r500 = screen->caps->is_r500; -- cgit v1.2.3 From 949587d1692f4e528f54b598ffc22a1906e4baf3 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Mon, 1 Mar 2010 01:46:32 +0100 Subject: dri/nouveau: Allow to render to XRGB8888 textures. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index 1db8c5dd8d..846478650e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -215,6 +215,8 @@ get_tex_format(struct gl_texture_image *ti) switch (ti->TexFormat) { case MESA_FORMAT_ARGB8888: return GL_RGBA8; + case MESA_FORMAT_XRGB8888: + return GL_RGB8; case MESA_FORMAT_RGB565: return GL_RGB5; default: -- cgit v1.2.3 From 394672659ddc1175747bae29fbf9957365d61e4c Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Mon, 1 Mar 2010 01:48:29 +0100 Subject: dri/nouveau: Add two stencil operation cases in nv04_state_raster.c. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 5e3788d185..6d0b262a4d 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -61,6 +61,10 @@ get_stencil_op(unsigned op) switch (op) { case GL_KEEP: return 0x1; + case GL_ZERO: + return 0x2; + case GL_REPLACE: + return 0x3; case GL_INCR: return 0x4; case GL_DECR: -- cgit v1.2.3 From c7955f1341fd01be68c73b8a79c4b720b0645064 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 1 Mar 2010 01:53:22 +0100 Subject: dri/nouveau: Fix up the ADD texture environment on nv0x. --- src/mesa/drivers/dri/nouveau/nv04_context.c | 1 + src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c index 1056171342..1acd41de54 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_context.c +++ b/src/mesa/drivers/dri/nouveau/nv04_context.c @@ -40,6 +40,7 @@ nv04_context_engine(GLcontext *ctx) if (ctx->Texture.Unit[0].EnvMode == GL_COMBINE || ctx->Texture.Unit[0].EnvMode == GL_BLEND || + ctx->Texture.Unit[0].EnvMode == GL_ADD || ctx->Texture.Unit[1]._ReallyEnabled || ctx->Stencil.Enabled) fahrenheit = hw->eng3dm; diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 6d0b262a4d..b52922ea11 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -82,8 +82,6 @@ get_texenv_mode(unsigned mode) switch (mode) { case GL_REPLACE: return 0x1; - case GL_ADD: - return 0x2; case GL_DECAL: return 0x3; case GL_MODULATE: -- cgit v1.2.3 From e7ca0e126e1b838d7650eb480adfd548723bcea9 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Mon, 1 Mar 2010 01:56:38 +0100 Subject: dri/nouveau: Combine the dummy texture more deterministically on nv0x. --- src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index b52922ea11..89c6753694 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -300,7 +300,10 @@ nv04_emit_blend(GLcontext *ctx, int emit) blend |= NV04_TEXTURED_TRIANGLE_BLEND_SHADE_MODE_FLAT; /* Texture environment. */ - blend |= get_texenv_mode(ctx->Texture.Unit[0].EnvMode); + if (ctx->Texture._EnabledUnits) + blend |= get_texenv_mode(ctx->Texture.Unit[0].EnvMode); + else + blend |= get_texenv_mode(GL_MODULATE); /* Fog. */ if (ctx->Fog.Enabled) -- cgit v1.2.3 From e243e87b522487f3c5e2c705884a97bafe091d32 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 27 Feb 2010 23:49:58 +0000 Subject: llvmpipe: Don't mention deprecated drivers=trace option. Now trace always built. --- src/gallium/drivers/llvmpipe/README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/README b/src/gallium/drivers/llvmpipe/README index 72d9f39658..ae2c1ba943 100644 --- a/src/gallium/drivers/llvmpipe/README +++ b/src/gallium/drivers/llvmpipe/README @@ -86,7 +86,7 @@ Building To build everything on Linux invoke scons as: - scons debug=yes statetrackers=mesa drivers=trace,llvmpipe winsys=xlib dri=false + scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=xlib dri=false Alternatively, you can build it with GNU make, if you prefer, by invoking it as @@ -96,7 +96,7 @@ but the rest of these instructions assume that scons is used. For windows is everything the except except the winsys: - scons debug=yes statetrackers=mesa drivers=trace,llvmpipe winsys=gdi dri=false + scons debug=yes statetrackers=mesa drivers=llvmpipe winsys=gdi dri=false Using ===== -- cgit v1.2.3 From f54aecc4f2e83babd1883c2bbd0bba6906cdab07 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 27 Feb 2010 23:50:09 +0000 Subject: python: Don't mention deprecated drivers=trace option. Now trace always built. --- src/gallium/state_trackers/python/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/README b/src/gallium/state_trackers/python/README index 4a06073024..e24a262aba 100644 --- a/src/gallium/state_trackers/python/README +++ b/src/gallium/state_trackers/python/README @@ -18,7 +18,7 @@ On a Windows machine ensure the swig command is in your PATH. Invoke scons on the top dir as - scons debug=yes statetrackers=python drivers=softpipe,trace winsys=none + scons debug=yes statetrackers=python drivers=softpipe winsys=none To use it set PYTHONPATH appropriately, e.g, in Linux do: -- cgit v1.2.3 From bd3c063da8ad8044a4d0361b279805bc4a73d011 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 14:22:30 +0000 Subject: python: Don't mention deprecated drivers=trace option. Now trace always built. --- src/gallium/auxiliary/util/u_format.csv | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 7595576953..b73bae2809 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -43,7 +43,11 @@ PIPE_FORMAT_X8Z24_UNORM , plain, 1, 1, un24, un8 , , , x___, z PIPE_FORMAT_Z24X8_UNORM , plain, 1, 1, un8 , un24, , , y___, zs # YUV formats +# http://www.fourcc.org/yuv.php#UYVY PIPE_FORMAT_YCBCR , subsampled, 2, 1, x32 , , , , xyz1, yuv +# http://www.fourcc.org/yuv.php#YUYV (a.k.a http://www.fourcc.org/yuv.php#YUY2) +# XXX: u_tile.c's ycbcr_get_tile_rgba actually interprets it as VYUY but the +# intent should be to match D3DFMT_YUY2 PIPE_FORMAT_YCBCR_REV , subsampled, 2, 1, x32 , , , , xyz1, yuv # Compressed formats -- cgit v1.2.3 From ffe90af2e8c834ab790462fce532cfca0a423ebd Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 14:24:41 +0000 Subject: util: Tweak comments regarding R8G8B8A8/X8_UNORM. --- src/gallium/auxiliary/util/u_format.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index b73bae2809..bb117f1066 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -3,6 +3,8 @@ PIPE_FORMAT_A8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, r PIPE_FORMAT_X8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, rgb PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb +PIPE_FORMAT_R8G8B8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb +# XXX: insert PIPE_FORMAT_R8G8B8A8_UNORM here later PIPE_FORMAT_A1R5G5B5_UNORM , plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb PIPE_FORMAT_A4R4G4B4_UNORM , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb PIPE_FORMAT_R5G6B5_UNORM , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb @@ -135,5 +137,3 @@ PIPE_FORMAT_B6G5R5_SNORM , plain, 1, 1, sn5 , sn5 , sn6 , , xyz1, r PIPE_FORMAT_R8G8B8X8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb PIPE_FORMAT_R8G8B8X8_USCALED , plain, 1, 1, u8 , u8 , u8 , u8 , wzy1, rgb PIPE_FORMAT_R8G8B8X8_SSCALED , plain, 1, 1, s8 , s8 , s8 , s8 , wzy1, rgb -# XXX: This one is mentioned in mesa and r300, but not anywhere else. Not sure it is actually needed -PIPE_FORMAT_R8G8B8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb -- cgit v1.2.3 From 4a991b5783e213e31cacf530c02318f911bec2f6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 14:49:18 +0000 Subject: util: More documentation for u_format.csv --- src/gallium/auxiliary/util/u_format.csv | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index bb117f1066..25b94e4e52 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -1,3 +1,60 @@ +########################################################################### +# +# Copyright 2009-2010 VMware, Inc. +# All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sub license, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice (including the +# next paragraph) shall be included in all copies or substantial portions +# of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR +# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +########################################################################### + +# This CSV file has the input data for u_format.h's struct +# util_format_description. +# +# Each format entry contains: +# - name, per enum pipe_format +# - layout, per enum util_format_layout, in shortened lower caps +# - pixel block's width +# - pixel block's height +# - channel encoding (only meaningful for plain layout), containing for each +# channel the following information: +# - type, one of +# - 'x': void +# - 'u': unsigned +# - 's': signed +# - 'h': fixed +# - 'f': FLOAT +# - optionally followed by 'n' if it is normalized +# - number of bits +# - channel swizzle +# - color space: rgb, yub, sz +# +# See also: +# - http://msdn.microsoft.com/en-us/library/ee416489.aspx +# - http://msdn.microsoft.com/en-us/library/ee415668.aspx +# +# Note that GL doesn't really specify the layout of internal formats. See +# OpenGL 2.1 specification, Table 3.16, on the "Correspondence of sized +# internal formats to base in- ternal formats, and desired component +# resolutions for each sized internal format." + # Typical rendertarget formats PIPE_FORMAT_A8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, rgb PIPE_FORMAT_X8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb -- cgit v1.2.3 From b66b4cf64655b7994c1cefda622cca6951077795 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 14:56:05 +0000 Subject: util: A few more todo marks. --- src/gallium/auxiliary/util/u_format.csv | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 25b94e4e52..a7bd6abf81 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -62,6 +62,7 @@ PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, r PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb PIPE_FORMAT_R8G8B8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb # XXX: insert PIPE_FORMAT_R8G8B8A8_UNORM here later +# XXX: insert PIPE_FORMAT_R8G8B8_UNORM here later PIPE_FORMAT_A1R5G5B5_UNORM , plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb PIPE_FORMAT_A4R4G4B4_UNORM , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb PIPE_FORMAT_R5G6B5_UNORM , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb @@ -170,6 +171,8 @@ PIPE_FORMAT_R16G16B16_SSCALED , plain, 1, 1, s16 , s16 , s16 , , xyz1, r PIPE_FORMAT_R16G16B16A16_SSCALED , plain, 1, 1, s16 , s16 , s16 , s16 , xyzw, rgb PIPE_FORMAT_R8_UNORM , plain, 1, 1, un8 , , , , x001, rgb PIPE_FORMAT_R8G8_UNORM , plain, 1, 1, un8 , un8 , , , xy01, rgb +# XXX: insert PIPE_FORMAT_R8G8B8_UNORM here later +# XXX: insert PIPE_FORMAT_R8G8B8A8_UNORM here later PIPE_FORMAT_R8_USCALED , plain, 1, 1, u8 , , , , x001, rgb PIPE_FORMAT_R8G8_USCALED , plain, 1, 1, u8 , u8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_USCALED , plain, 1, 1, u8 , u8 , u8 , , xyz1, rgb -- cgit v1.2.3 From 3a26193fd58e3cde277f63dcb9ea049a82860398 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 15:14:00 +0000 Subject: r300: Don't implement PIPE_FORMAT_R8G8B8X8_SNORM. This format is not actually used by any state tracker. Probably the reverse notation was mean, which would make it identical to PIPE_FORMAT_X8B8G8R8_SNORM. --- src/gallium/drivers/r300/r300_texture.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 2246c75056..181711b3d2 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -329,7 +329,6 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_R8G8B8A8_SRGB: case PIPE_FORMAT_R8G8B8X8_UNORM: case PIPE_FORMAT_R8G8B8X8_SRGB: - case PIPE_FORMAT_R8G8B8X8_SNORM: case PIPE_FORMAT_A8B8G8R8_SNORM: case PIPE_FORMAT_X8B8G8R8_SNORM: case PIPE_FORMAT_X8UB8UG8SR8S_NORM: @@ -463,7 +462,6 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) case PIPE_FORMAT_R8G8B8A8_SRGB: case PIPE_FORMAT_R8G8B8X8_UNORM: case PIPE_FORMAT_R8G8B8X8_SRGB: - case PIPE_FORMAT_R8G8B8X8_SNORM: return modifier | R300_C0_SEL_A | R300_C1_SEL_B | R300_C2_SEL_G | R300_C3_SEL_R; -- cgit v1.2.3 From 28f28885652cbf80118a0c27d4ca3a83ec999370 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 15:14:30 +0000 Subject: util: A few more links for D3D formats. --- src/gallium/auxiliary/util/u_format.csv | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index a7bd6abf81..aff59ff554 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -47,8 +47,9 @@ # - color space: rgb, yub, sz # # See also: -# - http://msdn.microsoft.com/en-us/library/ee416489.aspx -# - http://msdn.microsoft.com/en-us/library/ee415668.aspx +# - http://msdn.microsoft.com/en-us/library/ee416489.aspx (D3D9) +# - http://msdn.microsoft.com/en-us/library/ee415668.aspx (D3D9 -> D3D10) +# - http://msdn.microsoft.com/en-us/library/ee418116.aspx (D3D10) # # Note that GL doesn't really specify the layout of internal formats. See # OpenGL 2.1 specification, Table 3.16, on the "Correspondence of sized -- cgit v1.2.3 From cfdc14624747ac9f43b26915ddf14af3d50c6fe7 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 15:16:54 +0000 Subject: util: Remove inexisting formats. Can't find these formats used in any state tracker or any API. For some of these probably the reverse notation was meant, for which formats already exist. --- src/gallium/auxiliary/util/u_format.csv | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index aff59ff554..3c5f75c365 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -191,10 +191,3 @@ PIPE_FORMAT_R8G8B8A8_SSCALED , plain, 1, 1, s8 , s8 , s8 , s8 , xyzw, r # FIXME: They are used with different meanings in different places!!! PIPE_FORMAT_R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , , zyx1, rgb PIPE_FORMAT_R8G8B8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb - -# Unused formats -# XXX: Couldn't find any state tracker using them!! -PIPE_FORMAT_B6G5R5_SNORM , plain, 1, 1, sn5 , sn5 , sn6 , , xyz1, rgb -PIPE_FORMAT_R8G8B8X8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , wzy1, rgb -PIPE_FORMAT_R8G8B8X8_USCALED , plain, 1, 1, u8 , u8 , u8 , u8 , wzy1, rgb -PIPE_FORMAT_R8G8B8X8_SSCALED , plain, 1, 1, s8 , s8 , s8 , s8 , wzy1, rgb -- cgit v1.2.3 From 4c3bfc9778d9a0a75bf93b15303a4839f971f695 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 15:17:41 +0000 Subject: gallium: Remove inexisting formats. Can't find these formats used in any state tracker or any API. For some of these probably the reverse notation was meant, for which formats already exist. --- src/gallium/include/pipe/p_format.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index f33b0639ef..998d1a639f 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -117,20 +117,16 @@ enum pipe_format { PIPE_FORMAT_R8G8_USCALED = 70, PIPE_FORMAT_R8G8B8_USCALED = 71, PIPE_FORMAT_R8G8B8A8_USCALED = 72, - PIPE_FORMAT_R8G8B8X8_USCALED = 73, PIPE_FORMAT_R8_SNORM = 74, PIPE_FORMAT_R8G8_SNORM = 75, PIPE_FORMAT_R8G8B8_SNORM = 76, PIPE_FORMAT_R8G8B8A8_SNORM = 77, - PIPE_FORMAT_R8G8B8X8_SNORM = 78, - PIPE_FORMAT_B6G5R5_SNORM = 79, PIPE_FORMAT_A8B8G8R8_SNORM = 80, PIPE_FORMAT_X8B8G8R8_SNORM = 81, PIPE_FORMAT_R8_SSCALED = 82, PIPE_FORMAT_R8G8_SSCALED = 83, PIPE_FORMAT_R8G8B8_SSCALED = 84, PIPE_FORMAT_R8G8B8A8_SSCALED = 85, - PIPE_FORMAT_R8G8B8X8_SSCALED = 86, PIPE_FORMAT_R32_FIXED = 87, PIPE_FORMAT_R32G32_FIXED = 88, PIPE_FORMAT_R32G32B32_FIXED = 89, -- cgit v1.2.3 From b2e94d05c9602e2814a513a51eed67d014b338f3 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 15 Feb 2010 17:17:30 +0000 Subject: gallium: Expose a opaque winsys handle and functions on pipe_screen Instead of having these functions on a side interface like on drm_api create a opaque winsys_handle that is to be passed down into the winsys. Currently the only thing ported to this new interface is drm_api, and of that only the components that builds by default is ported. All the drivers and any extra state trackers needs to be ported before this can go into master. --- src/gallium/drivers/identity/id_drm.c | 59 --------------------- src/gallium/drivers/identity/id_screen.c | 35 +++++++++++++ src/gallium/drivers/trace/tr_drm.c | 66 +----------------------- src/gallium/drivers/trace/tr_screen.c | 34 ++++++++++++ src/gallium/include/pipe/p_screen.h | 20 +++++++ src/gallium/include/state_tracker/drm_api.h | 56 ++++++++++---------- src/gallium/state_trackers/dri/dri_drawable.c | 8 ++- src/gallium/state_trackers/egl/x11/native_dri2.c | 9 ++-- src/gallium/state_trackers/xorg/xorg_crtc.c | 13 ++--- src/gallium/state_trackers/xorg/xorg_dri2.c | 12 +++-- src/gallium/state_trackers/xorg/xorg_driver.c | 15 +++--- 11 files changed, 153 insertions(+), 174 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/identity/id_drm.c b/src/gallium/drivers/identity/id_drm.c index f258c38cd7..936ccc444a 100644 --- a/src/gallium/drivers/identity/id_drm.c +++ b/src/gallium/drivers/identity/id_drm.c @@ -63,62 +63,6 @@ identity_drm_create_screen(struct drm_api *_api, int fd, return identity_screen_create(screen); } - -static struct pipe_texture * -identity_drm_texture_from_shared_handle(struct drm_api *_api, - struct pipe_screen *_screen, - struct pipe_texture *templ, - const char *name, - unsigned stride, - unsigned handle) -{ - struct identity_screen *id_screen = identity_screen(_screen); - struct identity_drm_api *id_api = identity_drm_api(_api); - struct pipe_screen *screen = id_screen->screen; - struct drm_api *api = id_api->api; - struct pipe_texture *result; - - result = api->texture_from_shared_handle(api, screen, templ, name, stride, handle); - - result = identity_texture_create(identity_screen(_screen), result); - - return result; -} - -static boolean -identity_drm_shared_handle_from_texture(struct drm_api *_api, - struct pipe_screen *_screen, - struct pipe_texture *_texture, - unsigned *stride, - unsigned *handle) -{ - struct identity_screen *id_screen = identity_screen(_screen); - struct identity_texture *id_texture = identity_texture(_texture); - struct identity_drm_api *id_api = identity_drm_api(_api); - struct pipe_screen *screen = id_screen->screen; - struct pipe_texture *texture = id_texture->texture; - struct drm_api *api = id_api->api; - - return api->shared_handle_from_texture(api, screen, texture, stride, handle); -} - -static boolean -identity_drm_local_handle_from_texture(struct drm_api *_api, - struct pipe_screen *_screen, - struct pipe_texture *_texture, - unsigned *stride, - unsigned *handle) -{ - struct identity_screen *id_screen = identity_screen(_screen); - struct identity_texture *id_texture = identity_texture(_texture); - struct identity_drm_api *id_api = identity_drm_api(_api); - struct pipe_screen *screen = id_screen->screen; - struct pipe_texture *texture = id_texture->texture; - struct drm_api *api = id_api->api; - - return api->local_handle_from_texture(api, screen, texture, stride, handle); -} - static void identity_drm_destroy(struct drm_api *_api) { @@ -145,9 +89,6 @@ identity_drm_create(struct drm_api *api) id_api->base.name = api->name; id_api->base.driver_name = api->driver_name; id_api->base.create_screen = identity_drm_create_screen; - id_api->base.texture_from_shared_handle = identity_drm_texture_from_shared_handle; - id_api->base.shared_handle_from_texture = identity_drm_shared_handle_from_texture; - id_api->base.local_handle_from_texture = identity_drm_local_handle_from_texture; id_api->base.destroy = identity_drm_destroy; id_api->api = api; diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c index b85492114a..77e15b92f7 100644 --- a/src/gallium/drivers/identity/id_screen.c +++ b/src/gallium/drivers/identity/id_screen.c @@ -134,6 +134,39 @@ identity_screen_texture_create(struct pipe_screen *_screen, return NULL; } +static struct pipe_texture * +identity_screen_texture_from_handle(struct pipe_screen *_screen, + const struct pipe_texture *templ, + struct winsys_handle *handle) +{ + struct identity_screen *id_screen = identity_screen(_screen); + struct pipe_screen *screen = id_screen->screen; + struct pipe_texture *result; + + /* TODO trace call */ + + result = screen->texture_from_handle(screen, templ, handle); + + result = identity_texture_create(identity_screen(_screen), result); + + return result; +} + +static boolean +identity_screen_texture_get_handle(struct pipe_screen *_screen, + struct pipe_texture *_texture, + struct winsys_handle *handle) +{ + struct identity_screen *id_screen = identity_screen(_screen); + struct identity_texture *id_texture = identity_texture(_texture); + struct pipe_screen *screen = id_screen->screen; + struct pipe_texture *texture = id_texture->texture; + + /* TODO trace call */ + + return screen->texture_get_handle(screen, texture, handle); +} + static struct pipe_texture * identity_screen_texture_blanket(struct pipe_screen *_screen, const struct pipe_texture *templat, @@ -495,6 +528,8 @@ identity_screen_create(struct pipe_screen *screen) id_screen->base.is_format_supported = identity_screen_is_format_supported; id_screen->base.context_create = identity_screen_context_create; id_screen->base.texture_create = identity_screen_texture_create; + id_screen->base.texture_from_handle = identity_screen_texture_from_handle; + id_screen->base.texture_get_handle = identity_screen_texture_get_handle; id_screen->base.texture_blanket = identity_screen_texture_blanket; id_screen->base.texture_destroy = identity_screen_texture_destroy; id_screen->base.get_tex_surface = identity_screen_get_tex_surface; diff --git a/src/gallium/drivers/trace/tr_drm.c b/src/gallium/drivers/trace/tr_drm.c index 2b4915003e..c16989fa52 100644 --- a/src/gallium/drivers/trace/tr_drm.c +++ b/src/gallium/drivers/trace/tr_drm.c @@ -62,69 +62,8 @@ trace_drm_create_screen(struct drm_api *_api, int fd, screen = api->create_screen(api, fd, arg); - return trace_screen_create(screen); -} - - -static struct pipe_texture * -trace_drm_texture_from_shared_handle(struct drm_api *_api, - struct pipe_screen *_screen, - struct pipe_texture *templ, - const char *name, - unsigned stride, - unsigned handle) -{ - struct trace_screen *tr_screen = trace_screen(_screen); - struct trace_drm_api *tr_api = trace_drm_api(_api); - struct pipe_screen *screen = tr_screen->screen; - struct drm_api *api = tr_api->api; - struct pipe_texture *result; - - /* TODO trace call */ - - result = api->texture_from_shared_handle(api, screen, templ, name, stride, handle); - - result = trace_texture_create(trace_screen(_screen), result); - - return result; -} - -static boolean -trace_drm_shared_handle_from_texture(struct drm_api *_api, - struct pipe_screen *_screen, - struct pipe_texture *_texture, - unsigned *stride, - unsigned *handle) -{ - struct trace_screen *tr_screen = trace_screen(_screen); - struct trace_texture *tr_texture = trace_texture(_texture); - struct trace_drm_api *tr_api = trace_drm_api(_api); - struct pipe_screen *screen = tr_screen->screen; - struct pipe_texture *texture = tr_texture->texture; - struct drm_api *api = tr_api->api; - - /* TODO trace call */ - - return api->shared_handle_from_texture(api, screen, texture, stride, handle); -} -static boolean -trace_drm_local_handle_from_texture(struct drm_api *_api, - struct pipe_screen *_screen, - struct pipe_texture *_texture, - unsigned *stride, - unsigned *handle) -{ - struct trace_screen *tr_screen = trace_screen(_screen); - struct trace_texture *tr_texture = trace_texture(_texture); - struct trace_drm_api *tr_api = trace_drm_api(_api); - struct pipe_screen *screen = tr_screen->screen; - struct pipe_texture *texture = tr_texture->texture; - struct drm_api *api = tr_api->api; - - /* TODO trace call */ - - return api->local_handle_from_texture(api, screen, texture, stride, handle); + return trace_screen_create(screen); } static void @@ -158,9 +97,6 @@ trace_drm_create(struct drm_api *api) tr_api->base.name = api->name; tr_api->base.driver_name = api->driver_name; tr_api->base.create_screen = trace_drm_create_screen; - tr_api->base.texture_from_shared_handle = trace_drm_texture_from_shared_handle; - tr_api->base.shared_handle_from_texture = trace_drm_shared_handle_from_texture; - tr_api->base.local_handle_from_texture = trace_drm_local_handle_from_texture; tr_api->base.destroy = trace_drm_destroy; tr_api->api = api; diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 388d83eb5c..ac0876c3a8 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -236,6 +236,38 @@ trace_screen_texture_create(struct pipe_screen *_screen, return result; } +static struct pipe_texture * +trace_screen_texture_from_handle(struct pipe_screen *_screen, + const struct pipe_texture *templ, + struct winsys_handle *handle) +{ + struct trace_screen *tr_screen = trace_screen(_screen); + struct pipe_screen *screen = tr_screen->screen; + struct pipe_texture *result; + + /* TODO trace call */ + + result = screen->texture_from_handle(screen, templ, handle); + + result = trace_texture_create(trace_screen(_screen), result); + + return result; +} + +static boolean +trace_screen_texture_get_handle(struct pipe_screen *_screen, + struct pipe_texture *_texture, + struct winsys_handle *handle) +{ + struct trace_screen *tr_screen = trace_screen(_screen); + struct trace_texture *tr_texture = trace_texture(_texture); + struct pipe_screen *screen = tr_screen->screen; + struct pipe_texture *texture = tr_texture->texture; + + /* TODO trace call */ + + return screen->texture_get_handle(screen, texture, handle); +} static struct pipe_texture * trace_screen_texture_blanket(struct pipe_screen *_screen, @@ -931,6 +963,8 @@ trace_screen_create(struct pipe_screen *screen) assert(screen->context_create); tr_scr->base.context_create = trace_screen_context_create; tr_scr->base.texture_create = trace_screen_texture_create; + tr_scr->base.texture_from_handle = trace_screen_texture_from_handle; + tr_scr->base.texture_get_handle = trace_screen_texture_get_handle; tr_scr->base.texture_blanket = trace_screen_texture_blanket; tr_scr->base.texture_destroy = trace_screen_texture_destroy; tr_scr->base.get_tex_surface = trace_screen_get_tex_surface; diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index e4a9222809..617c47e4dc 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -49,6 +49,8 @@ extern "C" { #endif +/** Opaque type */ +struct winsys_handle; /** Opaque type */ struct pipe_fence_handle; struct pipe_winsys; @@ -107,6 +109,24 @@ struct pipe_screen { struct pipe_texture * (*texture_create)(struct pipe_screen *, const struct pipe_texture *templat); + /** + * Create a texture from a winsys_handle. The handle is often created in + * another process by first creating a pipe texture and then calling + * texture_get_handle. + */ + struct pipe_texture * (*texture_from_handle)(struct pipe_screen *, + const struct pipe_texture *templat, + struct winsys_handle *handle); + + /** + * Get a winsys_handle from a texture. Some platforms/winsys requires + * that the texture is created with a special usage flag like + * DISPLAYTARGET or PRIMARY. + */ + boolean (*texture_get_handle)(struct pipe_screen *, + struct pipe_texture *tex, + struct winsys_handle *handle); + /** * Create a new texture object, using the given template info, but on top of * existing memory. diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h index e9fa9b4d2a..d3edddd5d4 100644 --- a/src/gallium/include/state_tracker/drm_api.h +++ b/src/gallium/include/state_tracker/drm_api.h @@ -17,6 +17,31 @@ enum drm_create_screen_mode { DRM_CREATE_MAX }; +#define DRM_API_HANDLE_TYPE_SHARED 0 +#define DRM_API_HANDLE_TYPE_KMS 1 + +/** + * For use with pipe_screen::{texture_from_handle|texture_get_handle}. + */ +struct winsys_handle +{ + /** + * Unused for texture_from_handle, always DRM_API_HANDLE_TYPE_SHARED. + * Input to texture_get_handle, use TEXTURE_USAGE to select handle for kms or ipc. + */ + unsigned type; + /** + * Input to texture_from_handle. + * Output for texture_get_handle. + */ + unsigned handle; + /** + * Input to texture_from_handle. + * Output for texture_get_handle. + */ + unsigned stride; +}; + /** * Modes other than DRM_CREATE_NORMAL derive from this struct. */ @@ -28,6 +53,8 @@ struct drm_create_screen_arg { struct drm_api { + void (*destroy)(struct drm_api *api); + const char *name; /** @@ -36,37 +63,10 @@ struct drm_api const char *driver_name; /** - * Special buffer functions + * Create a pipe srcreen. */ - /*@{*/ struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd, struct drm_create_screen_arg *arg); - /*@}*/ - - /** - * Special buffer functions - */ - /*@{*/ - struct pipe_texture* - (*texture_from_shared_handle)(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *templ, - const char *name, - unsigned stride, - unsigned handle); - boolean (*shared_handle_from_texture)(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *stride, - unsigned *handle); - boolean (*local_handle_from_texture)(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *stride, - unsigned *handle); - /*@}*/ - - void (*destroy)(struct drm_api *api); }; extern struct drm_api * drm_api_create(void); diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 4809b9090d..fe91cf59b4 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -58,6 +58,7 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_surface *surface = NULL; struct pipe_texture *texture = NULL; struct pipe_texture templat; + struct winsys_handle whandle; memset(&templat, 0, sizeof(templat)); templat.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET; @@ -68,8 +69,11 @@ dri_surface_from_handle(struct drm_api *api, templat.width0 = width; templat.height0 = height; - texture = api->texture_from_shared_handle(api, screen, &templat, - "dri2 buffer", pitch, handle); + memset(&whandle, 0, sizeof(whandle)); + whandle.handle = handle; + whandle.stride = pitch; + + texture = screen->texture_from_handle(screen, &templat, &whandle); if (!texture) { debug_printf("%s: Failed to blanket the buffer with a texture\n", __func__); diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index 8df58891a0..b80b376e12 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -112,6 +112,7 @@ dri2_surface_process_drawable_buffers(struct native_surface *nsurf, struct dri2_surface *dri2surf = dri2_surface(nsurf); struct dri2_display *dri2dpy = dri2surf->dri2dpy; struct pipe_texture templ; + struct winsys_handle whandle; uint valid_mask; int i; @@ -169,9 +170,11 @@ dri2_surface_process_drawable_buffers(struct native_surface *nsurf, continue; } - dri2surf->textures[natt] = - dri2dpy->api->texture_from_shared_handle(dri2dpy->api, - dri2dpy->base.screen, &templ, desc, xbuf->pitch, xbuf->name); + memset(&whandle, 0, sizeof(whandle)); + whandle.stride = xbuf->pitch; + whandle.handle = xbuf->name; + dri2surf->textures[natt] = dri2dpy->base.screen->texture_from_handle( + dri2dpy->base.screen, &templ, &whandle); if (dri2surf->textures[natt]) valid_mask |= 1 << natt; } diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index 221ce772af..4a77f54080 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -197,7 +197,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image) if (!crtcp->cursor_tex) { struct pipe_texture templat; - unsigned pitch; + struct winsys_handle whandle; memset(&templat, 0, sizeof(templat)); templat.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET; @@ -209,13 +209,14 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image) templat.width0 = 64; templat.height0 = 64; + memset(&whandle, 0, sizeof(whandle)); + whandle.type = DRM_API_HANDLE_TYPE_KMS; + crtcp->cursor_tex = ms->screen->texture_create(ms->screen, &templat); - ms->api->local_handle_from_texture(ms->api, - ms->screen, - crtcp->cursor_tex, - &pitch, - &crtcp->cursor_handle); + ms->screen->texture_get_handle(ms->screen, crtcp->cursor_tex, &whandle); + + crtcp->cursor_handle = whandle.handle; } transfer = ms->screen->get_tex_transfer(ms->screen, crtcp->cursor_tex, diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 5b67392435..5472285ec1 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -67,7 +67,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form struct exa_pixmap_priv *exa_priv; BufferPrivatePtr private = buffer->driverPrivate; PixmapPtr pPixmap; - unsigned stride, handle; + struct winsys_handle whandle; if (pDraw->type == DRAWABLE_PIXMAP) pPixmap = (PixmapPtr) pDraw; @@ -75,6 +75,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form pPixmap = (*pScreen->GetWindowPixmap)((WindowPtr) pDraw); exa_priv = exaGetPixmapDriverPrivate(pPixmap); + switch (buffer->attachment) { default: if (buffer->attachment != DRI2BufferFakeFrontLeft || @@ -153,10 +154,13 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form if (!tex) FatalError("NO TEXTURE IN DRI2\n"); - ms->api->shared_handle_from_texture(ms->api, ms->screen, tex, &stride, &handle); + memset(&whandle, 0, sizeof(whandle)); + whandle.type = DRM_API_HANDLE_TYPE_SHARED; + + ms->screen->texture_get_handle(ms->screen, tex, &whandle); - buffer->name = handle; - buffer->pitch = stride; + buffer->name = whandle.handle; + buffer->pitch = whandle.stride; buffer->cpp = 4; buffer->driverPrivate = private; buffer->flags = 0; /* not tiled */ diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 8fb6e5a96d..004a28f00e 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -989,8 +989,9 @@ static Bool drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); - unsigned handle, stride, fb_id; struct pipe_texture *tex; + struct winsys_handle whandle; + unsigned fb_id; int ret; ms->noEvict = TRUE; @@ -1001,10 +1002,10 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn) if (!tex) return FALSE; - if (!ms->api->local_handle_from_texture(ms->api, ms->screen, - tex, - &stride, - &handle)) + memset(&whandle, 0, sizeof(whandle)); + whandle.type = DRM_API_HANDLE_TYPE_KMS; + + if (!ms->screen->texture_get_handle(ms->screen, tex, &whandle)) goto err_destroy; ret = drmModeAddFB(ms->fd, @@ -1012,8 +1013,8 @@ drv_create_front_buffer_ga3d(ScrnInfoPtr pScrn) pScrn->virtualY, pScrn->depth, pScrn->bitsPerPixel, - stride, - handle, + whandle.stride, + whandle.handle, &fb_id); if (ret) { debug_printf("%s: failed to create framebuffer (%i, %s)\n", -- cgit v1.2.3 From 3f37f23d17734e8a49809859df58354ed9c00a2d Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 17 Feb 2010 21:08:49 +0000 Subject: gallium: Reorg texture usage flags Introduce a new shared usage and rename primary to scanout. The display target usage is more of a windows concept and doesn't mean the same thing as shared. Display target means that the surface should be presentable, for softpipe this means that it should be backed by a hardware buffer. --- src/gallium/drivers/i915/i915_texture.c | 14 +++++++------- src/gallium/drivers/i965/brw_screen_texture.c | 4 ++-- src/gallium/drivers/llvmpipe/lp_texture.c | 3 ++- src/gallium/drivers/r300/r300_screen.c | 6 ++++-- src/gallium/drivers/softpipe/sp_texture.c | 3 ++- src/gallium/drivers/svga/svga_screen_texture.c | 6 +++++- src/gallium/include/pipe/p_defines.h | 5 +++-- src/gallium/state_trackers/egl/kms/native_kms.c | 2 +- src/gallium/state_trackers/xorg/xorg_crtc.c | 2 +- src/gallium/state_trackers/xorg/xorg_dri2.c | 2 +- src/gallium/state_trackers/xorg/xorg_exa.c | 10 +++++----- src/gallium/state_trackers/xorg/xvmc/surface.c | 2 +- src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c | 2 +- 13 files changed, 35 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index 7ba222c78b..5ad65a2e9c 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -219,12 +219,12 @@ i915_miptree_layout_2d(struct i915_texture *tex) unsigned nblocksy = util_format_get_nblocksy(pt->format, pt->width0); /* used for scanouts that need special layouts */ - if (pt->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) + if (pt->tex_usage & PIPE_TEXTURE_USAGE_SCANOUT) if (i915_scanout_layout(tex)) return; - /* for shared buffers we use something very like scanout */ - if (pt->tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) + /* shared buffers needs to be compatible with X servers */ + if (pt->tex_usage & PIPE_TEXTURE_USAGE_SHARED) if (i915_display_target_layout(tex)) return; @@ -369,12 +369,12 @@ i945_miptree_layout_2d(struct i915_texture *tex) unsigned nblocksy = util_format_get_nblocksy(pt->format, pt->height0); /* used for scanouts that need special layouts */ - if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) + if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_SCANOUT) if (i915_scanout_layout(tex)) return; - /* for shared buffers we use some very like scanout */ - if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) + /* shared buffers needs to be compatible with X servers */ + if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_SHARED) if (i915_display_target_layout(tex)) return; @@ -642,7 +642,7 @@ i915_texture_create(struct pipe_screen *screen, /* for scanouts and cursors, cursors arn't scanouts */ - if (templat->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY && templat->width0 != 64) + if (templat->tex_usage & PIPE_TEXTURE_USAGE_SCANOUT && templat->width0 != 64) buf_usage = INTEL_NEW_SCANOUT; else buf_usage = INTEL_NEW_TEXTURE; diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index 38e9961398..2d7b6ec222 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -231,8 +231,8 @@ static struct pipe_texture *brw_texture_create( struct pipe_screen *screen, goto fail; - if (templ->tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY)) { + if (templ->tex_usage & (PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) { buffer_type = BRW_BUFFER_TYPE_SCANOUT; } else { diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 7f45635542..7d15e85600 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -125,7 +125,8 @@ llvmpipe_texture_create(struct pipe_screen *_screen, lpt->base.screen = &screen->base; if (lpt->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY)) { + PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) { if (!llvmpipe_displaytarget_layout(screen, lpt)) goto fail; } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 6a55570571..2d8b313e5d 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -231,14 +231,16 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, /* Check colorbuffer format support. */ if ((usage & (PIPE_TEXTURE_USAGE_RENDER_TARGET | PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY)) && + PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) && /* 2101010 cannot be rendered to on non-r5xx. */ (is_r500 || !is_color2101010) && r300_is_colorbuffer_format_supported(format)) { retval |= usage & (PIPE_TEXTURE_USAGE_RENDER_TARGET | PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY); + PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED); } /* Check depth-stencil format support. */ diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index 371c4e2025..d3997854b2 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -123,7 +123,8 @@ softpipe_texture_create(struct pipe_screen *screen, util_is_power_of_two(template->depth0)); if (spt->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY)) { + PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) { if (!softpipe_displaytarget_layout(screen, spt)) goto fail; } diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index 12f3531a1d..b34f906ceb 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -315,7 +315,11 @@ svga_texture_create(struct pipe_screen *screen, tex->key.cachable = 0; } - if(templat->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) { + if(templat->tex_usage & PIPE_TEXTURE_USAGE_SHARED) { + tex->key.cachable = 0; + } + + if(templat->tex_usage & PIPE_TEXTURE_USAGE_SCANOUT) { tex->key.flags |= SVGA3D_SURFACE_HINT_SCANOUT; tex->key.cachable = 0; } diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 5cebd43ace..5c97dc87e8 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -176,11 +176,12 @@ enum pipe_texture_target { #define PIPE_TEX_COMPARE_R_TO_TEXTURE 1 #define PIPE_TEXTURE_USAGE_RENDER_TARGET 0x1 -#define PIPE_TEXTURE_USAGE_DISPLAY_TARGET 0x2 /* ie a backbuffer */ -#define PIPE_TEXTURE_USAGE_PRIMARY 0x4 /* ie a frontbuffer */ +#define PIPE_TEXTURE_USAGE_DISPLAY_TARGET 0x2 /* windows presentable buffer, ie a backbuffer */ +#define PIPE_TEXTURE_USAGE_SCANOUT 0x4 /* ie a frontbuffer */ #define PIPE_TEXTURE_USAGE_DEPTH_STENCIL 0x8 #define PIPE_TEXTURE_USAGE_SAMPLER 0x10 #define PIPE_TEXTURE_USAGE_DYNAMIC 0x20 +#define PIPE_TEXTURE_USAGE_SHARED 0x40 /** Pipe driver custom usage flags should be greater or equal to this value */ #define PIPE_TEXTURE_USAGE_CUSTOM (1 << 16) diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index ee6ab2e60b..dbdb1e635a 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -55,7 +55,7 @@ kms_surface_validate(struct native_surface *nsurf, uint attachment_mask, templ.format = ksurf->color_format; templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; if (ksurf->type == KMS_SURFACE_TYPE_SCANOUT) - templ.tex_usage |= PIPE_TEXTURE_USAGE_PRIMARY; + templ.tex_usage |= PIPE_TEXTURE_SCANOUT; } /* create textures */ diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index 4a77f54080..8f6426bcc8 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -201,7 +201,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image) memset(&templat, 0, sizeof(templat)); templat.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET; - templat.tex_usage |= PIPE_TEXTURE_USAGE_PRIMARY; + templat.tex_usage |= PIPE_TEXTURE_USAGE_SCANOUT; templat.target = PIPE_TEXTURE_2D; templat.last_level = 0; templat.depth0 = 1; diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 5472285ec1..e7f1b2d411 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -129,7 +129,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form template.depth0 = 1; template.last_level = 0; template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL | - PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + PIPE_TEXTURE_USAGE_SHARED; tex = ms->screen->texture_create(ms->screen, &template); pipe_texture_reference(&exa_priv->depth_stencil_tex, tex); } diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 665efdc0f0..5c3e92efdf 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -789,7 +789,7 @@ xorg_exa_set_displayed_usage(PixmapPtr pPixmap) return 0; } - priv->flags |= PIPE_TEXTURE_USAGE_PRIMARY; + priv->flags |= PIPE_TEXTURE_USAGE_SCANOUT; return 0; } @@ -805,7 +805,7 @@ xorg_exa_set_shared_usage(PixmapPtr pPixmap) return 0; } - priv->flags |= PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + priv->flags |= PIPE_TEXTURE_USAGE_SHARED; return 0; } @@ -943,7 +943,7 @@ xorg_exa_set_texture(PixmapPtr pPixmap, struct pipe_texture *tex) { struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap); - int mask = PIPE_TEXTURE_USAGE_PRIMARY | PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + int mask = PIPE_TEXTURE_USAGE_SHARED | PIPE_TEXTURE_USAGE_SCANOUT; if (!priv) return FALSE; @@ -976,8 +976,8 @@ xorg_exa_create_root_texture(ScrnInfoPtr pScrn, template.depth0 = 1; template.last_level = 0; template.tex_usage |= PIPE_TEXTURE_USAGE_RENDER_TARGET; - template.tex_usage |= PIPE_TEXTURE_USAGE_PRIMARY; - template.tex_usage |= PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + template.tex_usage |= PIPE_TEXTURE_USAGE_SCANOUT; + template.tex_usage |= PIPE_TEXTURE_USAGE_SHARED; return exa->scrn->texture_create(exa->scrn, &template); } diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index 0e39a390c6..c113f49e55 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -106,7 +106,7 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u template.width0 = width; template.height0 = height; template.depth0 = 1; - template.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + template.tex_usage = PIPE_TEXTURE_USAGE_SHARED; tex = vpipe->screen->texture_create(vpipe->screen, &template); if (!tex) diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c index c814d986b1..80b5a4c091 100644 --- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c +++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c @@ -23,7 +23,7 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen, struct pipe_texture tmpl; memset(&tmpl, 0, sizeof(tmpl)); - tmpl.tex_usage = PIPE_TEXTURE_USAGE_PRIMARY; + tmpl.tex_usage = PIPE_TEXTURE_USAGE_SCANOUT; tmpl.target = PIPE_TEXTURE_2D; tmpl.last_level = 0; tmpl.depth0 = 1; -- cgit v1.2.3 From 0e1eb1b8765149873f9fd27d455d8b7ed3387709 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 17 Feb 2010 21:28:01 +0000 Subject: i915g: Conversion to winsys handle --- src/gallium/drivers/i915/i915_texture.c | 104 +++++++++++---------- src/gallium/drivers/i915/intel_winsys.h | 39 ++++---- src/gallium/winsys/drm/intel/gem/intel_drm_api.c | 96 ------------------- .../winsys/drm/intel/gem/intel_drm_buffer.c | 63 +++++++++++++ 4 files changed, 137 insertions(+), 165 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index 5ad65a2e9c..334959c46d 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -672,6 +672,58 @@ fail: return NULL; } +static struct pipe_texture * +i915_texture_from_handle(struct pipe_screen * screen, + const struct pipe_texture *templat, + struct winsys_handle *whandle) +{ + struct i915_screen *is = i915_screen(screen); + struct i915_texture *tex; + struct intel_winsys *iws = is->iws; + struct intel_buffer *buffer; + unsigned stride; + + assert(screen); + + buffer = iws->buffer_from_handle(iws, whandle, &stride); + + /* Only supports one type */ + if (templat->target != PIPE_TEXTURE_2D || + templat->last_level != 0 || + templat->depth0 != 1) { + return NULL; + } + + tex = CALLOC_STRUCT(i915_texture); + if (!tex) + return NULL; + + tex->base = *templat; + pipe_reference_init(&tex->base.reference, 1); + tex->base.screen = screen; + + tex->stride = stride; + + i915_miptree_set_level_info(tex, 0, 1, templat->width0, templat->height0, 1); + i915_miptree_set_image_offset(tex, 0, 0, 0, 0); + + tex->buffer = buffer; + + return &tex->base; +} + +static boolean +i915_texture_get_handle(struct pipe_screen * screen, + struct pipe_texture *texture, + struct winsys_handle *whandle) +{ + struct i915_screen *is = i915_screen(screen); + struct i915_texture *tex = (struct i915_texture *)texture; + struct intel_winsys *iws = is->iws; + + return iws->buffer_get_handle(iws, tex->buffer, whandle, tex->stride); +} + static struct pipe_texture * i915_texture_blanket(struct pipe_screen * screen, const struct pipe_texture *base, @@ -869,6 +921,8 @@ void i915_init_screen_texture_functions(struct i915_screen *is) { is->base.texture_create = i915_texture_create; + is->base.texture_from_handle = i915_texture_from_handle; + is->base.texture_get_handle = i915_texture_get_handle; is->base.texture_blanket = i915_texture_blanket; is->base.texture_destroy = i915_texture_destroy; is->base.get_tex_surface = i915_get_tex_surface; @@ -878,53 +932,3 @@ i915_init_screen_texture_functions(struct i915_screen *is) is->base.transfer_unmap = i915_transfer_unmap; is->base.tex_transfer_destroy = i915_tex_transfer_destroy; } - -struct pipe_texture * -i915_texture_blanket_intel(struct pipe_screen *screen, - struct pipe_texture *base, - unsigned stride, - struct intel_buffer *buffer) -{ - struct i915_texture *tex; - assert(screen); - - /* Only supports one type */ - if (base->target != PIPE_TEXTURE_2D || - base->last_level != 0 || - base->depth0 != 1) { - return NULL; - } - - tex = CALLOC_STRUCT(i915_texture); - if (!tex) - return NULL; - - tex->base = *base; - pipe_reference_init(&tex->base.reference, 1); - tex->base.screen = screen; - - tex->stride = stride; - - i915_miptree_set_level_info(tex, 0, 1, base->width0, base->height0, 1); - i915_miptree_set_image_offset(tex, 0, 0, 0, 0); - - tex->buffer = buffer; - - return &tex->base; -} - -boolean -i915_get_texture_buffer_intel(struct pipe_texture *texture, - struct intel_buffer **buffer, - unsigned *stride) -{ - struct i915_texture *tex = (struct i915_texture *)texture; - - if (!texture) - return FALSE; - - *stride = tex->stride; - *buffer = tex->buffer; - - return TRUE; -} diff --git a/src/gallium/drivers/i915/intel_winsys.h b/src/gallium/drivers/i915/intel_winsys.h index b3a802b0e2..00fd0c1efe 100644 --- a/src/gallium/drivers/i915/intel_winsys.h +++ b/src/gallium/drivers/i915/intel_winsys.h @@ -33,6 +33,7 @@ struct intel_buffer; struct intel_batchbuffer; struct pipe_texture; struct pipe_fence_handle; +struct winsys_handle; enum intel_buffer_usage { @@ -128,6 +129,25 @@ struct intel_winsys { unsigned size, unsigned alignment, enum intel_buffer_type type); + /** + * Creates a buffer from a handle. + * Used to implement pipe_screen::texture_from_handle. + * Also provides the stride information needed for the + * texture via the stride argument. + */ + struct intel_buffer *(*buffer_from_handle)(struct intel_winsys *iws, + struct winsys_handle *whandle, + unsigned *stride); + + /** + * Used to implement pipe_screen::texture_get_handle. + * The winsys might need the stride information. + */ + boolean (*buffer_get_handle)(struct intel_winsys *iws, + struct intel_buffer *buffer, + struct winsys_handle *whandle, + unsigned stride); + /** * Fence a buffer with a fence reg. * Not to be confused with pipe_fence_handle. @@ -204,23 +224,4 @@ struct intel_winsys { struct pipe_screen *i915_create_screen(struct intel_winsys *iws, unsigned pci_id); -/** - * Get the intel_winsys buffer backing the texture. - * - * TODO UGLY - */ -boolean i915_get_texture_buffer_intel(struct pipe_texture *texture, - struct intel_buffer **buffer, - unsigned *stride); - -/** - * Wrap a intel_winsys buffer with a texture blanket. - * - * TODO UGLY - */ -struct pipe_texture * i915_texture_blanket_intel(struct pipe_screen *screen, - struct pipe_texture *tmplt, - unsigned pitch, - struct intel_buffer *buffer); - #endif diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_api.c b/src/gallium/winsys/drm/intel/gem/intel_drm_api.c index 377ed25513..e3b980a832 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_api.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_api.c @@ -38,99 +38,6 @@ intel_drm_get_device_id(unsigned int *device_id) fclose(file); } -static struct intel_buffer * -intel_drm_buffer_from_handle(struct intel_drm_winsys *idws, - const char* name, unsigned handle) -{ - struct intel_drm_buffer *buf = CALLOC_STRUCT(intel_drm_buffer); - uint32_t tile = 0, swizzle = 0; - - if (!buf) - return NULL; - - buf->magic = 0xDEAD1337; - buf->bo = drm_intel_bo_gem_create_from_name(idws->pools.gem, name, handle); - buf->flinked = TRUE; - buf->flink = handle; - - if (!buf->bo) - goto err; - - drm_intel_bo_get_tiling(buf->bo, &tile, &swizzle); - if (tile != INTEL_TILE_NONE) - buf->map_gtt = TRUE; - - return (struct intel_buffer *)buf; - -err: - FREE(buf); - return NULL; -} - - -/* - * Exported functions - */ - - -static struct pipe_texture * -intel_drm_texture_from_shared_handle(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *templ, - const char* name, - unsigned pitch, - unsigned handle) -{ - struct intel_drm_winsys *idws = intel_drm_winsys(i915_screen(screen)->iws); - struct intel_buffer *buffer; - - buffer = intel_drm_buffer_from_handle(idws, name, handle); - if (!buffer) - return NULL; - - return i915_texture_blanket_intel(screen, templ, pitch, buffer); -} - -static boolean -intel_drm_shared_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *pitch, - unsigned *handle) -{ - struct intel_drm_buffer *buf = NULL; - struct intel_buffer *buffer = NULL; - if (!i915_get_texture_buffer_intel(texture, &buffer, pitch)) - return FALSE; - - buf = intel_drm_buffer(buffer); - if (!buf->flinked) { - if (drm_intel_bo_flink(buf->bo, &buf->flink)) - return FALSE; - buf->flinked = TRUE; - } - - *handle = buf->flink; - - return TRUE; -} - -static boolean -intel_drm_local_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *pitch, - unsigned *handle) -{ - struct intel_buffer *buffer = NULL; - if (!i915_get_texture_buffer_intel(texture, &buffer, pitch)) - return FALSE; - - *handle = intel_drm_buffer(buffer)->bo->handle; - - return TRUE; -} - static void intel_drm_winsys_destroy(struct intel_winsys *iws) { @@ -192,9 +99,6 @@ struct drm_api intel_drm_api = .name = "i915", .driver_name = "i915", .create_screen = intel_drm_create_screen, - .texture_from_shared_handle = intel_drm_texture_from_shared_handle, - .shared_handle_from_texture = intel_drm_shared_handle_from_texture, - .local_handle_from_texture = intel_drm_local_handle_from_texture, .destroy = destroy, }; diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c b/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c index ac4dd6e00e..cb4f92a3b1 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_buffer.c @@ -1,4 +1,5 @@ +#include "state_tracker/drm_api.h" #include "intel_drm_winsys.h" #include "util/u_memory.h" @@ -52,6 +53,66 @@ err: return NULL; } +static struct intel_buffer * +intel_drm_buffer_from_handle(struct intel_winsys *iws, + struct winsys_handle *whandle, + unsigned *stride) +{ + struct intel_drm_winsys *idws = intel_drm_winsys(iws); + struct intel_drm_buffer *buf = CALLOC_STRUCT(intel_drm_buffer); + uint32_t tile = 0, swizzle = 0; + + if (!buf) + return NULL; + + buf->magic = 0xDEAD1337; + buf->bo = drm_intel_bo_gem_create_from_name(idws->pools.gem, "gallium3d_from_handle", whandle->handle); + buf->flinked = TRUE; + buf->flink = whandle->handle; + + if (!buf->bo) + goto err; + + drm_intel_bo_get_tiling(buf->bo, &tile, &swizzle); + if (tile != INTEL_TILE_NONE) + buf->map_gtt = TRUE; + + *stride = whandle->stride; + + return (struct intel_buffer *)buf; + +err: + FREE(buf); + return NULL; +} + +static boolean +intel_drm_buffer_get_handle(struct intel_winsys *iws, + struct intel_buffer *buffer, + struct winsys_handle *whandle, + unsigned stride) +{ + struct intel_drm_buffer *buf = intel_drm_buffer(buffer); + + if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { + if (!buf->flinked) { + if (drm_intel_bo_flink(buf->bo, &buf->flink)) + return FALSE; + buf->flinked = TRUE; + } + + whandle->handle = buf->flink; + } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { + whandle->handle = buf->bo->handle; + } else { + assert(!"unknown usage"); + return FALSE; + } + + whandle->stride = stride; + return TRUE; +} + static int intel_drm_buffer_set_fence_reg(struct intel_winsys *iws, struct intel_buffer *buffer, @@ -146,6 +207,8 @@ void intel_drm_winsys_init_buffer_functions(struct intel_drm_winsys *idws) { idws->base.buffer_create = intel_drm_buffer_create; + idws->base.buffer_from_handle = intel_drm_buffer_from_handle; + idws->base.buffer_get_handle = intel_drm_buffer_get_handle; idws->base.buffer_set_fence_reg = intel_drm_buffer_set_fence_reg; idws->base.buffer_map = intel_drm_buffer_map; idws->base.buffer_unmap = intel_drm_buffer_unmap; -- cgit v1.2.3 From 45089784e3d5f8c9b87c2c6b943391f2e5125096 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 17 Feb 2010 21:45:41 +0000 Subject: i965g: Conversion to winsys handle --- src/gallium/drivers/i965/brw_screen_texture.c | 230 +++++++++++----------- src/gallium/drivers/i965/brw_winsys.h | 10 + src/gallium/winsys/drm/i965/gem/i965_drm_api.c | 126 ------------ src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c | 75 +++++++ 4 files changed, 200 insertions(+), 241 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index 2d7b6ec222..995a6f1d7f 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -303,6 +303,119 @@ fail: return NULL; } +static struct pipe_texture * +brw_texture_from_handle(struct pipe_screen *screen, + const struct pipe_texture *templ, + struct winsys_handle *whandle) +{ + struct brw_screen *bscreen = brw_screen(screen); + struct brw_texture *tex; + struct brw_winsys_buffer *buffer; + unsigned tiling; + unsigned pitch; + + if (templ->target != PIPE_TEXTURE_2D || + templ->last_level != 0 || + templ->depth0 != 1) + return NULL; + + if (util_format_is_compressed(templ->format)) + return NULL; + + tex = CALLOC_STRUCT(brw_texture); + if (!tex) + return NULL; + + if (bscreen->sws->bo_from_handle(bscreen->sws, whandle, &pitch, &tiling, &buffer) != PIPE_OK) + goto fail; + + memcpy(&tex->base, templ, sizeof *templ); + pipe_reference_init(&tex->base.reference, 1); + tex->base.screen = screen; + + /* XXX: cpp vs. blocksize + */ + tex->cpp = util_format_get_blocksize(tex->base.format); + tex->tiling = tiling; + + make_empty_list(&tex->views[0]); + make_empty_list(&tex->views[1]); + + if (!brw_texture_layout(bscreen, tex)) + goto fail; + + /* XXX Maybe some more checks? */ + if ((pitch / tex->cpp) < tex->pitch) + goto fail; + + tex->pitch = pitch / tex->cpp; + + tex->bo = buffer; + + /* fix this warning */ +#if 0 + if (tex->size > buffer->size) + goto fail; +#endif + + tex->ss.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; + tex->ss.ss0.surface_type = translate_tex_target(tex->base.target); + tex->ss.ss0.surface_format = translate_tex_format(tex->base.format); + assert(tex->ss.ss0.surface_format != BRW_SURFACEFORMAT_INVALID); + + /* This is ok for all textures with channel width 8bit or less: + */ +/* tex->ss.ss0.data_return_format = BRW_SURFACERETURNFORMAT_S1; */ + + + /* XXX: what happens when tex->bo->offset changes??? + */ + tex->ss.ss1.base_addr = 0; /* reloc */ + tex->ss.ss2.mip_count = tex->base.last_level; + tex->ss.ss2.width = tex->base.width0 - 1; + tex->ss.ss2.height = tex->base.height0 - 1; + + switch (tex->tiling) { + case BRW_TILING_NONE: + tex->ss.ss3.tiled_surface = 0; + tex->ss.ss3.tile_walk = 0; + break; + case BRW_TILING_X: + tex->ss.ss3.tiled_surface = 1; + tex->ss.ss3.tile_walk = BRW_TILEWALK_XMAJOR; + break; + case BRW_TILING_Y: + tex->ss.ss3.tiled_surface = 1; + tex->ss.ss3.tile_walk = BRW_TILEWALK_YMAJOR; + break; + } + + tex->ss.ss3.pitch = (tex->pitch * tex->cpp) - 1; + tex->ss.ss3.depth = tex->base.depth0 - 1; + + tex->ss.ss4.min_lod = 0; + + return &tex->base; + +fail: + FREE(tex); + return NULL; +} + +static boolean +brw_texture_get_handle(struct pipe_screen *screen, + struct pipe_texture *texture, + struct winsys_handle *whandle) +{ + struct brw_screen *bscreen = brw_screen(screen); + struct brw_texture *tex = brw_texture(texture); + unsigned stride; + + stride = tex->pitch * tex->cpp; + + return bscreen->sws->bo_get_handle(tex->bo, whandle, stride); +} + static struct pipe_texture *brw_texture_blanket(struct pipe_screen *screen, const struct pipe_texture *templ, const unsigned *stride, @@ -451,125 +564,12 @@ brw_tex_transfer_destroy(struct pipe_transfer *trans) } -/* - * Functions exported to the winsys - */ - -boolean brw_texture_get_winsys_buffer(struct pipe_texture *texture, - struct brw_winsys_buffer **buffer, - unsigned *stride) -{ - struct brw_texture *tex = brw_texture(texture); - - *buffer = tex->bo; - if (stride) - *stride = tex->pitch * tex->cpp; - - return TRUE; -} - -struct pipe_texture * -brw_texture_blanket_winsys_buffer(struct pipe_screen *screen, - const struct pipe_texture *templ, - unsigned pitch, - unsigned tiling, - struct brw_winsys_buffer *buffer) -{ - struct brw_screen *bscreen = brw_screen(screen); - struct brw_texture *tex; - GLuint format; - - if (templ->target != PIPE_TEXTURE_2D || - templ->last_level != 0 || - templ->depth0 != 1) - return NULL; - - if (util_format_is_compressed(templ->format)) - return NULL; - - tex = CALLOC_STRUCT(brw_texture); - if (!tex) - return NULL; - - memcpy(&tex->base, templ, sizeof *templ); - pipe_reference_init(&tex->base.reference, 1); - tex->base.screen = screen; - - /* XXX: cpp vs. blocksize - */ - tex->cpp = util_format_get_blocksize(tex->base.format); - tex->tiling = tiling; - - make_empty_list(&tex->views[0]); - make_empty_list(&tex->views[1]); - - if (!brw_texture_layout(bscreen, tex)) - goto fail; - - /* XXX Maybe some more checks? */ - if ((pitch / tex->cpp) < tex->pitch) - goto fail; - - tex->pitch = pitch / tex->cpp; - - tex->bo = buffer; - - /* fix this warning */ -#if 0 - if (tex->size > buffer->size) - goto fail; -#endif - - tex->ss.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; - tex->ss.ss0.surface_type = translate_tex_target(tex->base.target); - - format = translate_tex_format(tex->base.format); - assert(format != BRW_SURFACEFORMAT_INVALID); - tex->ss.ss0.surface_format = format; - - /* This is ok for all textures with channel width 8bit or less: - */ -/* tex->ss.ss0.data_return_format = BRW_SURFACERETURNFORMAT_S1; */ - - - /* XXX: what happens when tex->bo->offset changes??? - */ - tex->ss.ss1.base_addr = 0; /* reloc */ - tex->ss.ss2.mip_count = tex->base.last_level; - tex->ss.ss2.width = tex->base.width0 - 1; - tex->ss.ss2.height = tex->base.height0 - 1; - - switch (tex->tiling) { - case BRW_TILING_NONE: - tex->ss.ss3.tiled_surface = 0; - tex->ss.ss3.tile_walk = 0; - break; - case BRW_TILING_X: - tex->ss.ss3.tiled_surface = 1; - tex->ss.ss3.tile_walk = BRW_TILEWALK_XMAJOR; - break; - case BRW_TILING_Y: - tex->ss.ss3.tiled_surface = 1; - tex->ss.ss3.tile_walk = BRW_TILEWALK_YMAJOR; - break; - } - - tex->ss.ss3.pitch = (tex->pitch * tex->cpp) - 1; - tex->ss.ss3.depth = tex->base.depth0 - 1; - - tex->ss.ss4.min_lod = 0; - - return &tex->base; - -fail: - FREE(tex); - return NULL; -} - void brw_screen_tex_init( struct brw_screen *brw_screen ) { brw_screen->base.is_format_supported = brw_is_format_supported; brw_screen->base.texture_create = brw_texture_create; + brw_screen->base.texture_from_handle = brw_texture_from_handle; + brw_screen->base.texture_get_handle = brw_texture_get_handle; brw_screen->base.texture_destroy = brw_texture_destroy; brw_screen->base.texture_blanket = brw_texture_blanket; brw_screen->base.get_tex_transfer = brw_get_tex_transfer; diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h index c82d00f4a4..139e26e31f 100644 --- a/src/gallium/drivers/i965/brw_winsys.h +++ b/src/gallium/drivers/i965/brw_winsys.h @@ -162,6 +162,16 @@ struct brw_winsys_screen { unsigned alignment, struct brw_winsys_buffer **bo_out); + enum pipe_error (*bo_from_handle)(struct brw_winsys_screen *sws, + struct winsys_handle *whandle, + unsigned *stride, + unsigned *tiling, + struct brw_winsys_buffer **bo_out); + + enum pipe_error (*bo_get_handle)(struct brw_winsys_buffer *buffer, + struct winsys_handle *whandle, + unsigned stride); + /* Destroy a buffer when our refcount goes to zero: */ void (*bo_destroy)(struct brw_winsys_buffer *buffer); diff --git a/src/gallium/winsys/drm/i965/gem/i965_drm_api.c b/src/gallium/winsys/drm/i965/gem/i965_drm_api.c index a061eef0be..21e82303f7 100644 --- a/src/gallium/winsys/drm/i965/gem/i965_drm_api.c +++ b/src/gallium/winsys/drm/i965/gem/i965_drm_api.c @@ -37,129 +37,6 @@ i965_libdrm_get_device_id(unsigned int *device_id) fclose(file); } -static struct i965_libdrm_buffer * -i965_libdrm_buffer_from_handle(struct i965_libdrm_winsys *idws, - const char* name, unsigned handle) -{ - struct i965_libdrm_buffer *buf = CALLOC_STRUCT(i965_libdrm_buffer); - uint32_t swizzle = 0; - - if (BRW_DUMP) - debug_printf("%s\n", __FUNCTION__); - - if (!buf) - return NULL; - pipe_reference_init(&buf->base.reference, 1); - buf->bo = drm_intel_bo_gem_create_from_name(idws->gem, name, handle); - buf->base.size = buf->bo->size; - buf->base.sws = &idws->base; - buf->flinked = TRUE; - buf->flink = handle; - - - if (!buf->bo) - goto err; - - drm_intel_bo_get_tiling(buf->bo, &buf->tiling, &swizzle); - if (buf->tiling != 0) - buf->map_gtt = TRUE; - - return buf; - -err: - FREE(buf); - return NULL; -} - - -/* - * Exported functions - */ - - -static struct pipe_texture * -i965_libdrm_texture_from_shared_handle(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *template, - const char* name, - unsigned pitch, - unsigned handle) -{ - /* XXX: this is silly -- there should be a way to get directly from - * the "drm_api" struct to ourselves, without peering into - * unrelated code: - */ - struct i965_libdrm_winsys *idws = i965_libdrm_winsys(brw_screen(screen)->sws); - struct i965_libdrm_buffer *buffer; - - if (BRW_DUMP) - debug_printf("%s %s pitch %d handle 0x%x\n", __FUNCTION__, - name, pitch, handle); - - buffer = i965_libdrm_buffer_from_handle(idws, name, handle); - if (!buffer) - return NULL; - - return brw_texture_blanket_winsys_buffer(screen, template, pitch, - buffer->tiling, - &buffer->base); -} - - -static boolean -i965_libdrm_shared_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *pitch, - unsigned *handle) -{ - struct i965_libdrm_buffer *buf = NULL; - struct brw_winsys_buffer *buffer = NULL; - - if (BRW_DUMP) - debug_printf("%s\n", __FUNCTION__); - - if (!brw_texture_get_winsys_buffer(texture, &buffer, pitch)) - return FALSE; - - buf = i965_libdrm_buffer(buffer); - if (!buf->flinked) { - if (drm_intel_bo_flink(buf->bo, &buf->flink)) - return FALSE; - buf->flinked = TRUE; - } - - *handle = buf->flink; - - if (BRW_DUMP) - debug_printf(" -> pitch %d handle 0x%x\n", *pitch, *handle); - - return TRUE; -} - -static boolean -i965_libdrm_local_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *pitch, - unsigned *handle) -{ - struct brw_winsys_buffer *buffer = NULL; - - if (BRW_DUMP) - debug_printf("%s\n", __FUNCTION__); - - if (!brw_texture_get_winsys_buffer(texture, &buffer, pitch)) - return FALSE; - - *handle = i965_libdrm_buffer(buffer)->bo->handle; - - if (BRW_DUMP) - debug_printf(" -> pitch %d handle 0x%x\n", *pitch, *handle); - - return TRUE; -} - static void i965_libdrm_winsys_destroy(struct brw_winsys_screen *iws) { @@ -225,9 +102,6 @@ struct drm_api i965_libdrm_api = { .name = "i965", .create_screen = i965_libdrm_create_screen, - .texture_from_shared_handle = i965_libdrm_texture_from_shared_handle, - .shared_handle_from_texture = i965_libdrm_shared_handle_from_texture, - .local_handle_from_texture = i965_libdrm_local_handle_from_texture, .destroy = destroy, }; diff --git a/src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c b/src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c index 07be1df87f..33a17496b2 100644 --- a/src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c +++ b/src/gallium/winsys/drm/i965/gem/i965_drm_buffer.c @@ -1,4 +1,5 @@ +#include "state_tracker/drm_api.h" #include "i965_drm_winsys.h" #include "util/u_memory.h" #include "util/u_inlines.h" @@ -122,6 +123,78 @@ err: return PIPE_ERROR_OUT_OF_MEMORY; } +static enum pipe_error +i965_libdrm_bo_from_handle(struct brw_winsys_screen *sws, + struct winsys_handle *whandle, + unsigned *stride, + unsigned *tile, + struct brw_winsys_buffer **bo_out) +{ + struct i965_libdrm_winsys *idws = i965_libdrm_winsys(sws); + struct i965_libdrm_buffer *buf = CALLOC_STRUCT(i965_libdrm_buffer); + uint32_t swizzle = 0; + + if (BRW_DUMP) + debug_printf("%s\n", __FUNCTION__); + + if (!buf) + return PIPE_ERROR_OUT_OF_MEMORY; + + pipe_reference_init(&buf->base.reference, 1); + buf->bo = drm_intel_bo_gem_create_from_name(idws->gem, "FROM_HANDLE", whandle->handle); + buf->base.size = buf->bo->size; + buf->base.sws = &idws->base; + buf->flinked = TRUE; + buf->flink = whandle->handle; + + + if (!buf->bo) + goto err; + + drm_intel_bo_get_tiling(buf->bo, &buf->tiling, &swizzle); + if (buf->tiling != 0) + buf->map_gtt = TRUE; + + *tile = buf->tiling; + *stride = whandle->stride; + + *bo_out = &buf->base; + return PIPE_OK; + +err: + FREE(buf); + return PIPE_ERROR_OUT_OF_MEMORY; +} + +static enum pipe_error +i965_libdrm_bo_get_handle(struct brw_winsys_buffer *buffer, + struct winsys_handle *whandle, + unsigned stride) +{ + struct i965_libdrm_buffer *buf = i965_libdrm_buffer(buffer); + + if (BRW_DUMP) + debug_printf("%s\n", __FUNCTION__); + + if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { + if (!buf->flinked) { + if (drm_intel_bo_flink(buf->bo, &buf->flink)) + return PIPE_ERROR_BAD_INPUT; + buf->flinked = TRUE; + } + + whandle->handle = buf->flink; + } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { + whandle->handle = buf->bo->handle; + } else { + assert(!"unknown usage"); + return PIPE_ERROR_BAD_INPUT; + } + + whandle->stride = stride; + return PIPE_OK; +} + static void i965_libdrm_bo_destroy(struct brw_winsys_buffer *buffer) { @@ -415,6 +488,8 @@ void i965_libdrm_winsys_init_buffer_functions(struct i965_libdrm_winsys *idws) { idws->base.bo_alloc = i965_libdrm_bo_alloc; + idws->base.bo_from_handle = i965_libdrm_bo_from_handle; + idws->base.bo_get_handle = i965_libdrm_bo_get_handle; idws->base.bo_destroy = i965_libdrm_bo_destroy; idws->base.bo_emit_reloc = i965_libdrm_bo_emit_reloc; idws->base.bo_exec = i965_libdrm_bo_exec; -- cgit v1.2.3 From 3a2358b6c64e028e170fef3254d54170fb2d14f1 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 26 Feb 2010 04:27:48 +0000 Subject: svga: Conversion to winsys handle --- src/gallium/drivers/svga/svga_screen_texture.c | 62 ++++++++---------- src/gallium/drivers/svga/svga_winsys.h | 33 ++++++---- .../winsys/drm/vmware/core/vmw_screen_dri.c | 76 +++++++++++++--------- 3 files changed, 91 insertions(+), 80 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index b34f906ceb..994a6e0fd1 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -426,13 +426,15 @@ svga_texture_blanket(struct pipe_screen * screen, } -struct pipe_texture * -svga_screen_texture_wrap_surface(struct pipe_screen *screen, - struct pipe_texture *base, - enum SVGA3dSurfaceFormat format, - struct svga_winsys_surface *srf) +static struct pipe_texture * +svga_screen_texture_from_handle(struct pipe_screen *screen, + const struct pipe_texture *base, + struct winsys_handle *whandle) { + struct svga_winsys_screen *sws = svga_winsys_screen(screen); + struct svga_winsys_surface *srf; struct svga_texture *tex; + enum SVGA3dSurfaceFormat format = 0; assert(screen); /* Only supports one type */ @@ -442,6 +444,8 @@ svga_screen_texture_wrap_surface(struct pipe_screen *screen, return NULL; } + srf = sws->surface_from_handle(sws, whandle, &format); + if (!srf) return NULL; @@ -482,6 +486,22 @@ svga_screen_texture_wrap_surface(struct pipe_screen *screen, } +static boolean +svga_screen_texture_get_handle(struct pipe_screen *screen, + struct pipe_texture *texture, + struct winsys_handle *whandle) +{ + struct svga_winsys_screen *sws = svga_winsys_screen(texture->screen); + unsigned stride; + + assert(svga_texture(texture)->key.cachable == 0); + svga_texture(texture)->key.cachable = 0; + stride = util_format_get_nblocksx(texture->format, texture->width0) * + util_format_get_blocksize(texture->format); + return sws->surface_get_handle(sws, svga_texture(texture)->handle, stride, whandle); +} + + static void svga_texture_destroy(struct pipe_texture *pt) { @@ -959,6 +979,8 @@ void svga_screen_init_texture_functions(struct pipe_screen *screen) { screen->texture_create = svga_texture_create; + screen->texture_from_handle = svga_screen_texture_from_handle; + screen->texture_get_handle = svga_screen_texture_get_handle; screen->texture_destroy = svga_texture_destroy; screen->get_tex_surface = svga_get_tex_surface; screen->tex_surface_destroy = svga_tex_surface_destroy; @@ -1124,33 +1146,3 @@ svga_destroy_sampler_view_priv(struct svga_sampler_view *v) pipe_texture_reference(&v->texture, NULL); FREE(v); } - -boolean -svga_screen_buffer_from_texture(struct pipe_texture *texture, - struct pipe_buffer **buffer, - unsigned *stride) -{ - struct svga_texture *stex = svga_texture(texture); - - *buffer = svga_screen_buffer_wrap_surface - (texture->screen, - svga_translate_format(texture->format), - stex->handle); - - *stride = util_format_get_stride(texture->format, texture->width0); - - return *buffer != NULL; -} - - -struct svga_winsys_surface * -svga_screen_texture_get_winsys_surface(struct pipe_texture *texture) -{ - struct svga_winsys_screen *sws = svga_winsys_screen(texture->screen); - struct svga_winsys_surface *vsurf = NULL; - - assert(svga_texture(texture)->key.cachable == 0); - svga_texture(texture)->key.cachable = 0; - sws->surface_reference(sws, &vsurf, svga_texture(texture)->handle); - return vsurf; -} diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h index b4e3af0eaf..d4bb176f9a 100644 --- a/src/gallium/drivers/svga/svga_winsys.h +++ b/src/gallium/drivers/svga/svga_winsys.h @@ -51,6 +51,7 @@ struct pipe_context; struct pipe_fence_handle; struct pipe_texture; struct svga_region; +struct winsys_handle; #define SVGA_BUFFER_USAGE_PINNED (PIPE_BUFFER_USAGE_CUSTOM << 0) @@ -186,6 +187,25 @@ struct svga_winsys_screen uint32 numFaces, uint32 numMipLevels); + /** + * Creates a surface from a winsys handle. + * Used to implement pipe_screen::texture_from_handle. + */ + struct svga_winsys_surface * + (*surface_from_handle)(struct svga_winsys_screen *sws, + struct winsys_handle *whandle, + SVGA3dSurfaceFormat *format); + + /** + * Get a winsys_handle from a surface. + * Used to implement pipe_screen::texture_get_handle. + */ + boolean + (*surface_get_handle)(struct svga_winsys_screen *sws, + struct svga_winsys_surface *surface, + unsigned stride, + struct winsys_handle *whandle); + /** * Whether this surface is sitting in a validate list */ @@ -283,20 +303,7 @@ svga_screen_buffer_wrap_surface(struct pipe_screen *screen, enum SVGA3dSurfaceFormat format, struct svga_winsys_surface *srf); -struct svga_winsys_surface * -svga_screen_texture_get_winsys_surface(struct pipe_texture *texture); struct svga_winsys_surface * svga_screen_buffer_get_winsys_surface(struct pipe_buffer *buffer); -boolean -svga_screen_buffer_from_texture(struct pipe_texture *texture, - struct pipe_buffer **buffer, - unsigned *stride); - -struct pipe_texture * -svga_screen_texture_wrap_surface(struct pipe_screen *screen, - struct pipe_texture *base, - enum SVGA3dSurfaceFormat format, - struct svga_winsys_surface *srf); - #endif /* SVGA_WINSYS_H_ */ diff --git a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c index a7c6e88b9e..0e3dad84a5 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c @@ -44,6 +44,16 @@ #include +static struct svga_winsys_surface * +vmw_drm_surface_from_handle(struct svga_winsys_screen *sws, + struct winsys_handle *whandle, + SVGA3dSurfaceFormat *format); +static boolean +vmw_drm_surface_get_handle(struct svga_winsys_screen *sws, + struct svga_winsys_surface *surface, + unsigned stride, + struct winsys_handle *whandle); + static struct dri1_api dri1_api_hooks; static struct dri1_api_version ddx_required = { 0, 1, 0 }; static struct dri1_api_version ddx_compat = { 0, 0, 0 }; @@ -129,7 +139,12 @@ vmw_drm_create_screen(struct drm_api *drm_api, &drm_compat, "use old scanout field (not a error)")) use_old_scanout_flag = TRUE; dri1->api = &dri1_api_hooks; +#if 0 break; +#else + assert(!"No dri 1 support for now\n"); + return NULL; +#endif default: return NULL; } @@ -139,6 +154,10 @@ vmw_drm_create_screen(struct drm_api *drm_api, if (!vws) goto out_no_vws; + /* XXX do this properly */ + vws->base.surface_from_handle = vmw_drm_surface_from_handle; + vws->base.surface_get_handle = vmw_drm_surface_get_handle; + screen = svga_screen_create( &vws->base ); if (!screen) goto out_no_screen; @@ -200,6 +219,7 @@ vmw_dri1_present_locked(struct pipe_context *locked_pipe, const struct drm_clip_rect *bbox, struct pipe_fence_handle **p_fence) { +#if 0 struct svga_winsys_surface *srf = svga_screen_texture_get_winsys_surface(surf->texture); struct vmw_svga_winsys_surface *vsrf = vmw_svga_winsys_surface(srf); @@ -246,21 +266,19 @@ vmw_dri1_present_locked(struct pipe_context *locked_pipe, *p_fence = (visible) ? vmw_pipe_fence(fence_seq) : NULL; vmw_svga_winsys_surface_reference(&vsrf, NULL); +#else + assert(!"No dri 1 support for now\n"); +#endif } -static struct pipe_texture * -vmw_drm_texture_from_handle(struct drm_api *drm_api, - struct pipe_screen *screen, - struct pipe_texture *templat, - const char *name, - unsigned stride, - unsigned handle) +static struct svga_winsys_surface * +vmw_drm_surface_from_handle(struct svga_winsys_screen *sws, + struct winsys_handle *whandle, + SVGA3dSurfaceFormat *format) { struct vmw_svga_winsys_surface *vsrf; struct svga_winsys_surface *ssrf; - struct vmw_winsys_screen *vws = - vmw_winsys_screen(svga_winsys_screen(screen)); - struct pipe_texture *tex; + struct vmw_winsys_screen *vws = vmw_winsys_screen(sws); union drm_vmw_surface_reference_arg arg; struct drm_vmw_surface_arg *req = &arg.req; struct drm_vmw_surface_create_req *rep = &arg.rep; @@ -273,7 +291,7 @@ vmw_drm_texture_from_handle(struct drm_api *drm_api, */ memset(&arg, 0, sizeof(arg)); - req->sid = handle; + req->sid = whandle->handle; ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_REF_SURFACE, &arg, sizeof(arg)); @@ -281,14 +299,14 @@ vmw_drm_texture_from_handle(struct drm_api *drm_api, if (ret) { fprintf(stderr, "Failed referencing shared surface. SID %d.\n" "Error %d (%s).\n", - handle, ret, strerror(-ret)); + whandle->handle, ret, strerror(-ret)); return NULL; } if (rep->mip_levels[0] != 1) { fprintf(stderr, "Incorrect number of mipmap levels on shared surface." " SID %d, levels %d\n", - handle, rep->mip_levels[0]); + whandle->handle, rep->mip_levels[0]); goto out_mip; } @@ -296,7 +314,7 @@ vmw_drm_texture_from_handle(struct drm_api *drm_api, if (rep->mip_levels[i] != 0) { fprintf(stderr, "Incorrect number of faces levels on shared surface." " SID %d, face %d present.\n", - handle, i); + whandle->handle, i); goto out_mip; } } @@ -308,38 +326,32 @@ vmw_drm_texture_from_handle(struct drm_api *drm_api, pipe_reference_init(&vsrf->refcnt, 1); p_atomic_set(&vsrf->validated, 0); vsrf->screen = vws; - vsrf->sid = handle; + vsrf->sid = whandle->handle; ssrf = svga_winsys_surface(vsrf); - tex = svga_screen_texture_wrap_surface(screen, templat, rep->format, ssrf); - if (!tex) - vmw_svga_winsys_surface_reference(&vsrf, NULL); + *format = rep->format; + + return ssrf; - return tex; - out_mip: - vmw_ioctl_surface_destroy(vws, handle); +out_mip: + vmw_ioctl_surface_destroy(vws, whandle->handle); return NULL; } static boolean -vmw_drm_handle_from_texture(struct drm_api *drm_api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *stride, - unsigned *handle) +vmw_drm_surface_get_handle(struct svga_winsys_screen *sws, + struct svga_winsys_surface *surface, + unsigned stride, + struct winsys_handle *whandle) { - struct svga_winsys_surface *surface = - svga_screen_texture_get_winsys_surface(texture); struct vmw_svga_winsys_surface *vsrf; if (!surface) return FALSE; vsrf = vmw_svga_winsys_surface(surface); - *handle = vsrf->sid; - *stride = util_format_get_nblocksx(texture->format, texture->width0) * - util_format_get_blocksize(texture->format); + whandle->handle = vsrf->sid; + whandle->stride = stride; - vmw_svga_winsys_surface_reference(&vsrf, NULL); return TRUE; } -- cgit v1.2.3 From d160eed005e75d8933562f4880dfc84033011ac5 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 1 Mar 2010 15:11:39 +0000 Subject: r300g: Conversion to to winsys handle --- src/gallium/drivers/r300/r300_texture.c | 66 +++++++++++ src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 71 ++++++++++++ src/gallium/winsys/drm/radeon/core/radeon_drm.c | 121 --------------------- src/gallium/winsys/drm/radeon/core/radeon_drm.h | 22 ---- src/gallium/winsys/drm/radeon/core/radeon_winsys.h | 12 ++ 5 files changed, 149 insertions(+), 143 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 2246c75056..3b39207a45 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -848,6 +848,70 @@ static struct pipe_texture* return (struct pipe_texture*)tex; } +static struct pipe_texture* + r300_texture_from_handle(struct pipe_screen* screen, + const struct pipe_texture* base, + struct winsys_handle *whandle) +{ + struct radeon_winsys* winsys = (struct radeon_winsys*)screen->winsys; + struct r300_screen* rscreen = r300_screen(screen); + struct pipe_buffer *buffer; + struct r300_texture* tex; + unsigned stride; + + /* Support only 2D textures without mipmaps */ + if (base->target != PIPE_TEXTURE_2D || + base->depth0 != 1 || + base->last_level != 0) { + return NULL; + } + + buffer = winsys->buffer_from_handle(winsys, screen, whandle, &stride); + if (!buffer) { + return NULL; + } + + tex = CALLOC_STRUCT(r300_texture); + if (!tex) { + return NULL; + } + + tex->tex = *base; + pipe_reference_init(&tex->tex.reference, 1); + tex->tex.screen = screen; + + tex->stride_override = stride; + tex->pitch[0] = stride / util_format_get_blocksize(base->format); + + r300_setup_flags(tex); + r300_setup_texture_state(rscreen, tex); + + /* one ref already taken */ + tex->buffer = buffer; + + return (struct pipe_texture*)tex; +} + +static boolean + r300_texture_get_handle(struct pipe_screen* screen, + struct pipe_texture *texture, + struct winsys_handle *whandle) +{ + struct radeon_winsys* winsys = (struct radeon_winsys*)screen->winsys; + struct r300_texture* tex = (struct r300_texture*)texture; + unsigned stride; + + if (!tex) { + return FALSE; + } + + stride = r300_texture_get_stride(r300_screen(screen), tex, 0); + + winsys->buffer_get_handle(winsys, tex->buffer, stride, whandle); + + return TRUE; +} + static struct pipe_video_surface * r300_video_surface_create(struct pipe_screen *screen, enum pipe_video_chroma_format chroma_format, @@ -899,6 +963,8 @@ static void r300_video_surface_destroy(struct pipe_video_surface *vsfc) void r300_init_screen_texture_functions(struct pipe_screen* screen) { screen->texture_create = r300_texture_create; + screen->texture_from_handle = r300_texture_from_handle; + screen->texture_get_handle = r300_texture_get_handle; screen->texture_destroy = r300_texture_destroy; screen->get_tex_surface = r300_get_tex_surface; screen->tex_surface_destroy = r300_tex_surface_destroy; diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index e5c6919933..daa032af6f 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -264,6 +264,75 @@ static int radeon_fence_finish(struct pipe_winsys *ws, return 0; } +/* Create a buffer from a handle. */ +static struct pipe_buffer* radeon_buffer_from_handle(struct radeon_winsys *radeon_ws, + struct pipe_screen *screen, + struct winsys_handle *whandle, + unsigned *stride) +{ + struct radeon_bo_manager* bom = radeon_ws->priv->bom; + struct radeon_pipe_buffer* radeon_buffer; + struct radeon_bo* bo = NULL; + + bo = radeon_bo_open(bom, whandle->handle, 0, 0, 0, 0); + if (bo == NULL) { + return NULL; + } + + radeon_buffer = CALLOC_STRUCT(radeon_pipe_buffer); + if (radeon_buffer == NULL) { + radeon_bo_unref(bo); + return NULL; + } + + pipe_reference_init(&radeon_buffer->base.reference, 1); + radeon_buffer->base.screen = screen; + radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; + radeon_buffer->bo = bo; + + *stride = whandle->stride; + + return &radeon_buffer->base; +} + +static boolean radeon_buffer_get_handle(struct radeon_winsys *radeon_ws, + struct pipe_buffer *buffer, + unsigned stride, + struct winsys_handle *whandle) +{ + int retval, fd; + struct drm_gem_flink flink; + struct radeon_pipe_buffer* radeon_buffer; + + radeon_buffer = (struct radeon_pipe_buffer*)buffer; + + + if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { + if (!radeon_buffer->flinked) { + fd = radeon_ws->priv->fd; + + flink.handle = radeon_buffer->bo->handle; + + retval = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); + if (retval) { + debug_printf("radeon: DRM_IOCTL_GEM_FLINK failed, error %d\n", + retval); + return FALSE; + } + + radeon_buffer->flink = flink.name; + radeon_buffer->flinked = TRUE; + } + + whandle->handle = radeon_buffer->flink; + } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { + whandle->handle = ((struct radeon_pipe_buffer*)buffer)->bo->handle; + } + whandle->stride = stride; + + return TRUE; +} + struct radeon_winsys* radeon_pipe_winsys(int fd) { struct radeon_winsys* radeon_ws; @@ -298,6 +367,8 @@ struct radeon_winsys* radeon_pipe_winsys(int fd) radeon_ws->base.get_name = radeon_get_name; radeon_ws->buffer_set_tiling = radeon_buffer_set_tiling; + radeon_ws->buffer_from_handle = radeon_buffer_from_handle; + radeon_ws->buffer_get_handle = radeon_buffer_get_handle; return radeon_ws; } diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index e817a26da6..97edb6a47e 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -148,124 +148,6 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, } } - -boolean radeon_buffer_from_texture(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride) -{ - /* XXX fix this */ - return r300_get_texture_buffer(screen, texture, buffer, stride); -} - -/* Create a buffer from a handle. */ -/* XXX what's up with name? */ -struct pipe_buffer* radeon_buffer_from_handle(struct drm_api* api, - struct pipe_screen* screen, - const char* name, - unsigned handle) -{ - struct radeon_bo_manager* bom = - ((struct radeon_winsys*)screen->winsys)->priv->bom; - struct radeon_pipe_buffer* radeon_buffer; - struct radeon_bo* bo = NULL; - - bo = radeon_bo_open(bom, handle, 0, 0, 0, 0); - if (bo == NULL) { - return NULL; - } - - radeon_buffer = CALLOC_STRUCT(radeon_pipe_buffer); - if (radeon_buffer == NULL) { - radeon_bo_unref(bo); - return NULL; - } - - pipe_reference_init(&radeon_buffer->base.reference, 1); - radeon_buffer->base.screen = screen; - radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; - radeon_buffer->bo = bo; - return &radeon_buffer->base; -} - -static struct pipe_texture* -radeon_texture_from_shared_handle(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *templ, - const char *name, - unsigned stride, - unsigned handle) -{ - struct pipe_buffer *buffer; - struct pipe_texture *blanket; - - buffer = radeon_buffer_from_handle(api, screen, name, handle); - if (!buffer) { - return NULL; - } - - blanket = screen->texture_blanket(screen, templ, &stride, buffer); - - pipe_buffer_reference(&buffer, NULL); - - return blanket; -} - -static boolean radeon_shared_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *stride, - unsigned *handle) -{ - int retval, fd; - struct drm_gem_flink flink; - struct radeon_pipe_buffer* radeon_buffer; - struct pipe_buffer *buffer = NULL; - - if (!radeon_buffer_from_texture(api, screen, texture, &buffer, stride)) { - return FALSE; - } - - radeon_buffer = (struct radeon_pipe_buffer*)buffer; - if (!radeon_buffer->flinked) { - fd = ((struct radeon_winsys*)screen->winsys)->priv->fd; - - flink.handle = radeon_buffer->bo->handle; - - retval = ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink); - if (retval) { - debug_printf("radeon: DRM_IOCTL_GEM_FLINK failed, error %d\n", - retval); - return FALSE; - } - - radeon_buffer->flink = flink.name; - radeon_buffer->flinked = TRUE; - } - - *handle = radeon_buffer->flink; - return TRUE; -} - -static boolean radeon_local_handle_from_texture(struct drm_api *api, - struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned *stride, - unsigned *handle) -{ - struct pipe_buffer *buffer = NULL; - if (!radeon_buffer_from_texture(api, screen, texture, &buffer, stride)) { - return FALSE; - } - - *handle = ((struct radeon_pipe_buffer*)buffer)->bo->handle; - - pipe_buffer_reference(&buffer, NULL); - - return TRUE; -} - static void radeon_drm_api_destroy(struct drm_api *api) { return; @@ -275,9 +157,6 @@ struct drm_api drm_api_hooks = { .name = "radeon", .driver_name = "radeon", .create_screen = radeon_create_screen, - .texture_from_shared_handle = radeon_texture_from_shared_handle, - .shared_handle_from_texture = radeon_shared_handle_from_texture, - .local_handle_from_texture = radeon_local_handle_from_texture, .destroy = radeon_drm_api_destroy, }; diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.h b/src/gallium/winsys/drm/radeon/core/radeon_drm.h index f62a9b8048..78451b6f01 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.h @@ -37,28 +37,6 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB, struct drm_create_screen_arg *arg); - -boolean radeon_buffer_from_texture(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride); - -struct pipe_buffer* radeon_buffer_from_handle(struct drm_api* api, - struct pipe_screen* screen, - const char* name, - unsigned handle); - -boolean radeon_handle_from_buffer(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_buffer* buffer, - unsigned* handle); - -boolean radeon_global_handle_from_buffer(struct drm_api* api, - struct pipe_screen* screen, - struct pipe_buffer* buffer, - unsigned* handle); - void radeon_destroy_drm_api(struct drm_api* api); /* Guess at whether this chipset should use r300g. diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h index 4901080ca7..37eeb45979 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_winsys.h @@ -56,6 +56,18 @@ struct radeon_winsys { /* VRAM size. */ uint32_t vram_size; + /* Create a buffer from a winsys handle. */ + struct pipe_buffer *(*buffer_from_handle)(struct radeon_winsys *winsys, + struct pipe_screen *screen, + struct winsys_handle *whandle, + unsigned *stride); + + /* Get the handle from a buffer. */ + boolean (*buffer_get_handle)(struct radeon_winsys *winsys, + struct pipe_buffer *buffer, + unsigned stride, + struct winsys_handle *whandle); + /* Add a pipe_buffer to the list of buffer objects to validate. */ boolean (*add_buffer)(struct radeon_winsys* winsys, struct pipe_buffer* pbuffer, -- cgit v1.2.3 From 932e6f8d527d2147ecc4e75ce9ae2f71e23e61af Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 1 Mar 2010 17:06:20 +0100 Subject: util: Fix u_blitter setup code after bypass_vs_clip_and_viewport removal. Not tested. --- src/gallium/auxiliary/util/u_blitter.c | 46 ++++++++++++++++++++++++++-------- src/gallium/auxiliary/util/u_blitter.h | 16 ++++++++++++ 2 files changed, 51 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 50877f6b01..f93c69d193 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -93,6 +93,12 @@ struct blitter_context_priv /* Rasterizer state. */ void *rs_state; + + /* Viewport state. */ + struct pipe_viewport_state viewport; + + /* Clip state. */ + struct pipe_clip_state clip; }; struct blitter_context *util_blitter_create(struct pipe_context *pipe) @@ -262,6 +268,9 @@ static void blitter_restore_CSOs(struct blitter_context_priv *ctx) pipe->set_stencil_ref(pipe, &ctx->blitter.saved_stencil_ref); + pipe->set_viewport_state(pipe, &ctx->blitter.saved_viewport); + pipe->set_clip_state(pipe, &ctx->blitter.saved_clip); + /* restore the state objects which are required to be saved before copy/fill */ if (ctx->blitter.saved_fb_state.nr_cbufs != ~0) { @@ -287,25 +296,40 @@ static void blitter_restore_CSOs(struct blitter_context_priv *ctx) static void blitter_set_rectangle(struct blitter_context_priv *ctx, unsigned x1, unsigned y1, unsigned x2, unsigned y2, + unsigned width, unsigned height, float depth) { int i; /* set vertex positions */ - ctx->vertices[0][0][0] = x1; /*v0.x*/ - ctx->vertices[0][0][1] = y1; /*v0.y*/ + ctx->vertices[0][0][0] = (float)x1 / width * 2.0f - 1.0f; /*v0.x*/ + ctx->vertices[0][0][1] = (float)y1 / height * 2.0f - 1.0f; /*v0.y*/ - ctx->vertices[1][0][0] = x2; /*v1.x*/ - ctx->vertices[1][0][1] = y1; /*v1.y*/ + ctx->vertices[1][0][0] = (float)x2 / width * 2.0f - 1.0f; /*v1.x*/ + ctx->vertices[1][0][1] = (float)y1 / height * 2.0f - 1.0f; /*v1.y*/ - ctx->vertices[2][0][0] = x2; /*v2.x*/ - ctx->vertices[2][0][1] = y2; /*v2.y*/ + ctx->vertices[2][0][0] = (float)x2 / width * 2.0f - 1.0f; /*v2.x*/ + ctx->vertices[2][0][1] = (float)y2 / height * 2.0f - 1.0f; /*v2.y*/ - ctx->vertices[3][0][0] = x1; /*v3.x*/ - ctx->vertices[3][0][1] = y2; /*v3.y*/ + ctx->vertices[3][0][0] = (float)x1 / width * 2.0f - 1.0f; /*v3.x*/ + ctx->vertices[3][0][1] = (float)y2 / height * 2.0f - 1.0f; /*v3.y*/ for (i = 0; i < 4; i++) ctx->vertices[i][0][2] = depth; /*z*/ + + /* viewport */ + ctx->viewport.scale[0] = 0.5f * width; + ctx->viewport.scale[1] = 0.5f * height; + ctx->viewport.scale[2] = 0.5f; + ctx->viewport.scale[3] = 1.0f; + ctx->viewport.translate[0] = 0.5f * width; + ctx->viewport.translate[1] = 0.5f * height; + ctx->viewport.translate[2] = 0.5f; + ctx->viewport.translate[3] = 0.0f; + ctx->pipe->set_viewport_state(ctx->pipe, &ctx->viewport); + + /* clip */ + ctx->pipe->set_clip_state(ctx->pipe, &ctx->clip); } static void blitter_set_clear_color(struct blitter_context_priv *ctx, @@ -549,7 +573,7 @@ void util_blitter_clear(struct blitter_context *blitter, pipe->bind_vs_state(pipe, ctx->vs_col); blitter_set_clear_color(ctx, rgba); - blitter_set_rectangle(ctx, 0, 0, width, height, depth); + blitter_set_rectangle(ctx, 0, 0, width, height, width, height, depth); blitter_draw_quad(ctx); blitter_restore_CSOs(ctx); } @@ -632,7 +656,7 @@ static void util_blitter_do_copy(struct blitter_context *blitter, assert(0); } - blitter_set_rectangle(ctx, dstx, dsty, dstx+width, dsty+height, 0); + blitter_set_rectangle(ctx, dstx, dsty, dstx+width, dsty+height, dst->width, dst->height, 0); blitter_draw_quad(ctx); } @@ -793,7 +817,7 @@ void util_blitter_fill(struct blitter_context *blitter, pipe->set_framebuffer_state(pipe, &fb_state); blitter_set_clear_color(ctx, rgba); - blitter_set_rectangle(ctx, 0, 0, width, height, 0); + blitter_set_rectangle(ctx, 0, 0, width, height, dst->width, dst->height, 0); blitter_draw_quad(ctx); blitter_restore_CSOs(ctx); } diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h index a2f17073ac..92008fce99 100644 --- a/src/gallium/auxiliary/util/u_blitter.h +++ b/src/gallium/auxiliary/util/u_blitter.h @@ -48,6 +48,8 @@ struct blitter_context struct pipe_framebuffer_state saved_fb_state; /**< framebuffer state */ struct pipe_stencil_ref saved_stencil_ref; /**< stencil ref */ + struct pipe_viewport_state saved_viewport; + struct pipe_clip_state saved_clip; int saved_num_sampler_states; void *saved_sampler_states[32]; @@ -205,6 +207,20 @@ void util_blitter_save_framebuffer(struct blitter_context *blitter, blitter->saved_fb_state = *state; } +static INLINE +void util_blitter_save_viewport(struct blitter_context *blitter, + struct pipe_viewport_state *state) +{ + blitter->saved_viewport = *state; +} + +static INLINE +void util_blitter_save_clip(struct blitter_context *blitter, + struct pipe_clip_state *state) +{ + blitter->saved_clip = *state; +} + static INLINE void util_blitter_save_fragment_sampler_states( struct blitter_context *blitter, -- cgit v1.2.3 From b42455c4f48076eec34e383d5b9cc4670f2d048f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 1 Mar 2010 17:07:03 +0100 Subject: r300: Save viewport and clip states before invoking blitter. --- src/gallium/drivers/r300/r300_blit.c | 2 ++ src/gallium/drivers/r300/r300_context.h | 4 ++++ src/gallium/drivers/r300/r300_state.c | 4 ++++ 3 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index eb9b0beeb5..ec7414dc36 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -34,6 +34,8 @@ static void r300_blitter_save_states(struct r300_context* r300) util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state); util_blitter_save_fragment_shader(r300->blitter, r300->fs); util_blitter_save_vertex_shader(r300->blitter, r300->vs); + util_blitter_save_viewport(r300->blitter, &r300->viewport); + util_blitter_save_clip(r300->blitter, &r300->clip); } /* Clear currently bound buffers. */ diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 2f056aafcb..97100c08cc 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -333,6 +333,10 @@ struct r300_context { struct pipe_stencil_ref stencil_ref; + struct pipe_clip_state clip; + + struct pipe_viewport_state viewport; + /* Bitmask of dirty state objects. */ uint32_t dirty_state; /* Flag indicating whether or not the HW is dirty. */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 3550c69c46..ebb859138f 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -376,6 +376,8 @@ static void r300_set_clip_state(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); + r300->clip = *state; + if (r300_screen(pipe->screen)->caps->has_tcl) { memcpy(r300->clip_state.state, state, sizeof(struct pipe_clip_state)); r300->clip_state.size = 29; @@ -986,6 +988,8 @@ static void r300_set_viewport_state(struct pipe_context* pipe, struct r300_viewport_state* viewport = (struct r300_viewport_state*)r300->viewport_state.state; + r300->viewport = *state; + /* Do the transform in HW. */ viewport->vte_control = R300_VTX_W0_FMT; -- cgit v1.2.3 From 018f4aca794d41cbf215992f8f0dec584aa6bc91 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:07:53 +0000 Subject: util: Fix PIPE_FORMAT_R8G8B8_UNORM description and notes. There is actually no ambiguity in use -- it is always used as R8 G8 B8 --- src/gallium/auxiliary/util/u_format.csv | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 3c5f75c365..1d54fd518a 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -63,7 +63,6 @@ PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, r PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb PIPE_FORMAT_R8G8B8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb # XXX: insert PIPE_FORMAT_R8G8B8A8_UNORM here later -# XXX: insert PIPE_FORMAT_R8G8B8_UNORM here later PIPE_FORMAT_A1R5G5B5_UNORM , plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb PIPE_FORMAT_A4R4G4B4_UNORM , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb PIPE_FORMAT_R5G6B5_UNORM , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb @@ -172,7 +171,7 @@ PIPE_FORMAT_R16G16B16_SSCALED , plain, 1, 1, s16 , s16 , s16 , , xyz1, r PIPE_FORMAT_R16G16B16A16_SSCALED , plain, 1, 1, s16 , s16 , s16 , s16 , xyzw, rgb PIPE_FORMAT_R8_UNORM , plain, 1, 1, un8 , , , , x001, rgb PIPE_FORMAT_R8G8_UNORM , plain, 1, 1, un8 , un8 , , , xy01, rgb -# XXX: insert PIPE_FORMAT_R8G8B8_UNORM here later +PIPE_FORMAT_R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , , xyz1, rgb # XXX: insert PIPE_FORMAT_R8G8B8A8_UNORM here later PIPE_FORMAT_R8_USCALED , plain, 1, 1, u8 , , , , x001, rgb PIPE_FORMAT_R8G8_USCALED , plain, 1, 1, u8 , u8 , , , xy01, rgb @@ -189,5 +188,4 @@ PIPE_FORMAT_R8G8B8A8_SSCALED , plain, 1, 1, s8 , s8 , s8 , s8 , xyzw, r # Ambiguous formats # FIXME: They are used with different meanings in different places!!! -PIPE_FORMAT_R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , , zyx1, rgb PIPE_FORMAT_R8G8B8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb -- cgit v1.2.3 From cd8b6523039d68459756db487566a97fac1d4d75 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:24:09 +0000 Subject: gallium: Introduce a new format to disambiguate PIPE_FORMAT_R8G8B8A8_UNORM. PIPE_FORMAT_R8G8B8A8_UNORM now means just R8 G8 B8 A8 PIPE_FORMAT_R8G8B8A8_UNORM_REV means A8 B8 G8 R8 And the thumb rule is vertex buffers refer to PIPE_FORMAT_R8G8B8A8_UNORM, while textures refer to PIPE_FORMAT_R8G8B8A8_UNORM_REV. PIPE_FORMAT_R8G8B8A8_UNORM_REV is just a temporary name. --- src/gallium/include/pipe/p_format.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 998d1a639f..79e4df7b4d 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -158,6 +158,8 @@ enum pipe_format { PIPE_FORMAT_DXT3_SRGBA = 108, PIPE_FORMAT_DXT5_SRGBA = 109, + PIPE_FORMAT_R8G8B8A8_UNORM_REV = 110, + PIPE_FORMAT_COUNT }; -- cgit v1.2.3 From daf7caf4cfb1c3732a31be56157e9c7d0399ef58 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:24:48 +0000 Subject: util: Use PIPE_FORMAT_R8G8B8A8_UNORM_REV where appropriate. --- src/gallium/auxiliary/util/u_format.csv | 8 ++------ src/gallium/auxiliary/util/u_pack_color.h | 6 +++--- src/gallium/auxiliary/util/u_surface.c | 2 +- src/gallium/auxiliary/util/u_tile.c | 6 +++--- 4 files changed, 9 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 1d54fd518a..9cb67a261e 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -61,8 +61,8 @@ PIPE_FORMAT_A8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, r PIPE_FORMAT_X8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, rgb PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb +PIPE_FORMAT_R8G8B8A8_UNORM_REV , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb PIPE_FORMAT_R8G8B8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb -# XXX: insert PIPE_FORMAT_R8G8B8A8_UNORM here later PIPE_FORMAT_A1R5G5B5_UNORM , plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb PIPE_FORMAT_A4R4G4B4_UNORM , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb PIPE_FORMAT_R5G6B5_UNORM , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb @@ -172,7 +172,7 @@ PIPE_FORMAT_R16G16B16A16_SSCALED , plain, 1, 1, s16 , s16 , s16 , s16 , xyzw, r PIPE_FORMAT_R8_UNORM , plain, 1, 1, un8 , , , , x001, rgb PIPE_FORMAT_R8G8_UNORM , plain, 1, 1, un8 , un8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , , xyz1, rgb -# XXX: insert PIPE_FORMAT_R8G8B8A8_UNORM here later +PIPE_FORMAT_R8G8B8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , xyzw, rgb PIPE_FORMAT_R8_USCALED , plain, 1, 1, u8 , , , , x001, rgb PIPE_FORMAT_R8G8_USCALED , plain, 1, 1, u8 , u8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_USCALED , plain, 1, 1, u8 , u8 , u8 , , xyz1, rgb @@ -185,7 +185,3 @@ PIPE_FORMAT_R8_SSCALED , plain, 1, 1, s8 , , , , x001, r PIPE_FORMAT_R8G8_SSCALED , plain, 1, 1, s8 , s8 , , , xy01, rgb PIPE_FORMAT_R8G8B8_SSCALED , plain, 1, 1, s8 , s8 , s8 , , xyz1, rgb PIPE_FORMAT_R8G8B8A8_SSCALED , plain, 1, 1, s8 , s8 , s8 , s8 , xyzw, rgb - -# Ambiguous formats -# FIXME: They are used with different meanings in different places!!! -PIPE_FORMAT_R8G8B8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index 0ab53c75dd..4e4ac7f3da 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -57,7 +57,7 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, enum pipe_format format, union util_color *uc) { switch (format) { - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: { uc->ui = (r << 24) | (g << 16) | (b << 8) | a; } @@ -153,7 +153,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, ubyte *r, ubyte *g, ubyte *b, ubyte *a) { switch (format) { - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: { uint p = uc->ui; *r = (ubyte) ((p >> 24) & 0xff); @@ -326,7 +326,7 @@ util_pack_color(const float rgba[4], enum pipe_format format, union util_color * } switch (format) { - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: { uc->ui = (r << 24) | (g << 16) | (b << 8) | a; } diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index c9f1c9c210..948c1e76d0 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -56,7 +56,7 @@ util_create_rgba_surface(struct pipe_screen *screen, static const enum pipe_format rgbaFormats[] = { PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM, + PIPE_FORMAT_R8G8B8A8_UNORM_REV, PIPE_FORMAT_NONE }; const uint target = PIPE_TEXTURE_2D; diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 0051258e22..6000e93a0b 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -248,7 +248,7 @@ b8g8r8a8_put_tile_rgba(unsigned *dst, } -/*** PIPE_FORMAT_R8G8B8A8_UNORM ***/ +/*** PIPE_FORMAT_R8G8B8A8_UNORM_REV ***/ static void r8g8b8a8_get_tile_rgba(const unsigned *src, @@ -1171,7 +1171,7 @@ pipe_tile_raw_to_rgba(enum pipe_format format, case PIPE_FORMAT_B8G8R8A8_UNORM: b8g8r8a8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: r8g8b8a8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_A1R5G5B5_UNORM: @@ -1300,7 +1300,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, case PIPE_FORMAT_B8G8R8A8_UNORM: b8g8r8a8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: r8g8b8a8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; case PIPE_FORMAT_A1R5G5B5_UNORM: -- cgit v1.2.3 From 382d1d370bcf58303ffd9bc0606619e57ea3f302 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:25:04 +0000 Subject: mesa: Use PIPE_FORMAT_R8G8B8A8_UNORM_REV where appropriate. --- src/mesa/state_tracker/st_format.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index c8f9ac3038..f24d6c8686 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -300,7 +300,7 @@ default_rgba_format(struct pipe_screen *screen, static const enum pipe_format colorFormats[] = { PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM, + PIPE_FORMAT_R8G8B8A8_UNORM_REV, PIPE_FORMAT_R5G6B5_UNORM }; uint i; @@ -327,7 +327,7 @@ default_rgb_format(struct pipe_screen *screen, PIPE_FORMAT_R8G8B8X8_UNORM, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM, + PIPE_FORMAT_R8G8B8A8_UNORM_REV, PIPE_FORMAT_R5G6B5_UNORM }; uint i; @@ -680,7 +680,7 @@ GLboolean st_equal_formats(enum pipe_format pFormat, GLenum format, GLenum type) { switch (pFormat) { - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: return format == GL_RGBA && type == GL_UNSIGNED_BYTE; case PIPE_FORMAT_B8G8R8A8_UNORM: return format == GL_BGRA && type == GL_UNSIGNED_BYTE; -- cgit v1.2.3 From 2c1249e2265cbe96bb00e94f2d9a19c5d8a9d5c4 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:25:25 +0000 Subject: i915g: Use PIPE_FORMAT_R8G8B8A8_UNORM_REV where appropriate. --- src/gallium/drivers/i915/i915_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index b1d754dc4e..eec2b2895f 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -165,7 +165,7 @@ i915_is_format_supported(struct pipe_screen *screen, unsigned geom_flags) { static const enum pipe_format tex_supported[] = { - PIPE_FORMAT_R8G8B8A8_UNORM, + PIPE_FORMAT_R8G8B8A8_UNORM_REV, PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_R5G6B5_UNORM, PIPE_FORMAT_L8_UNORM, -- cgit v1.2.3 From a2bcdb7e509fde231846f3af09bef38ed1df4068 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:26:36 +0000 Subject: r300: Use PIPE_FORMAT_R8G8B8A8_UNORM_REV where appropriate. --- src/gallium/drivers/r300/r300_texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 181711b3d2..5b674f6e57 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -324,7 +324,7 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_B8G8R8A8_SRGB: case PIPE_FORMAT_B8G8R8X8_UNORM: case PIPE_FORMAT_B8G8R8X8_SRGB: - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: case PIPE_FORMAT_R8G8B8A8_SNORM: case PIPE_FORMAT_R8G8B8A8_SRGB: case PIPE_FORMAT_R8G8B8X8_UNORM: @@ -457,7 +457,7 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) R300_C2_SEL_G | R300_C3_SEL_B; /* RGBA 32-bit outputs. */ - case PIPE_FORMAT_R8G8B8A8_UNORM: + case PIPE_FORMAT_R8G8B8A8_UNORM_REV: case PIPE_FORMAT_R8G8B8A8_SNORM: case PIPE_FORMAT_R8G8B8A8_SRGB: case PIPE_FORMAT_R8G8B8X8_UNORM: -- cgit v1.2.3 From 88e640fc14c3146966b6ba886d7f79874e745b35 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:28:38 +0000 Subject: xlib: Use PIPE_FORMAT_R8G8B8A8_UNORM(_REV) as appropriate. --- src/gallium/state_trackers/glx/xlib/xm_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 188b885f68..228e6d0a50 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -274,10 +274,10 @@ choose_pixel_format(XMesaVisual v) && v->BitsPerPixel == 32) { if (native_byte_order) { /* no byteswapping needed */ - return 0 /* PIXEL_FORMAT_U_A8_B8_G8_R8 */; + return PIPE_FORMAT_R8G8B8A8_UNORM; } else { - return PIPE_FORMAT_R8G8B8A8_UNORM; + return PIPE_FORMAT_R8G8B8A8_UNORM_REV; } } else if ( GET_REDMASK(v) == 0xff0000 -- cgit v1.2.3 From ac8e1c18f2b75ff8a49efbc1aad3a5864f3cfcf0 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 16:42:54 +0000 Subject: util: Fix PIPE_FORMAT_R8G8B8_SRGB swizzles. The only user of PIPE_FORMAT_R8G8B8_SRGB is mesa, which per src/mesa/main/texstore.c interprets it as R8 G8 B8 and not the other way around. --- src/gallium/auxiliary/util/u_format.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 9cb67a261e..e9ec377fb1 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -78,7 +78,7 @@ PIPE_FORMAT_L16_UNORM , plain, 1, 1, un16, , , , xxx1, r # SRGB formats PIPE_FORMAT_L8_SRGB , plain, 1, 1, un8 , , , , xxx1, srgb PIPE_FORMAT_A8L8_SRGB , plain, 1, 1, un8 , un8 , , , xxxy, srgb -PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , zyx1, srgb +PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , xyz1, srgb PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, srgb PIPE_FORMAT_R8G8B8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, srgb PIPE_FORMAT_A8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, srgb -- cgit v1.2.3 From 9a2c4f907b87e81173f50222c4bc325064609392 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 1 Mar 2010 17:57:18 +0100 Subject: tgsi: Cleanup exec code for CLAMP, CMP and CND. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 67 ++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 68566d3093..f853ea2820 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -109,6 +109,42 @@ micro_ceil(union tgsi_exec_channel *dst, dst->f[3] = ceilf(src->f[3]); } +static void +micro_clamp(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2) +{ + dst->f[0] = src0->f[0] < src1->f[0] ? src1->f[0] : src0->f[0] > src2->f[0] ? src2->f[0] : src0->f[0]; + dst->f[1] = src0->f[1] < src1->f[1] ? src1->f[1] : src0->f[1] > src2->f[1] ? src2->f[1] : src0->f[1]; + dst->f[2] = src0->f[2] < src1->f[2] ? src1->f[2] : src0->f[2] > src2->f[2] ? src2->f[2] : src0->f[2]; + dst->f[3] = src0->f[3] < src1->f[3] ? src1->f[3] : src0->f[3] > src2->f[3] ? src2->f[3] : src0->f[3]; +} + +static void +micro_cmp(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2) +{ + dst->f[0] = src0->f[0] < 0.0f ? src1->f[0] : src2->f[0]; + dst->f[1] = src0->f[1] < 0.0f ? src1->f[1] : src2->f[1]; + dst->f[2] = src0->f[2] < 0.0f ? src1->f[2] : src2->f[2]; + dst->f[3] = src0->f[3] < 0.0f ? src1->f[3] : src2->f[3]; +} + +static void +micro_cnd(union tgsi_exec_channel *dst, + const union tgsi_exec_channel *src0, + const union tgsi_exec_channel *src1, + const union tgsi_exec_channel *src2) +{ + dst->f[0] = src2->f[0] > 0.5f ? src0->f[0] : src1->f[0]; + dst->f[1] = src2->f[1] > 0.5f ? src0->f[1] : src1->f[1]; + dst->f[2] = src2->f[2] > 0.5f ? src0->f[2] : src1->f[2]; + dst->f[3] = src2->f[3] > 0.5f ? src0->f[3] : src1->f[3]; +} + static void micro_cos(union tgsi_exec_channel *dst, const union tgsi_exec_channel *src) @@ -2653,15 +2689,7 @@ exec_instruction( break; case TGSI_OPCODE_CND: - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - FETCH(&r[2], 2, chan_index); - micro_lt(&d[chan_index], &mach->Temps[TEMP_HALF_I].xyzw[TEMP_HALF_C], &r[2], &r[0], &r[1]); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_trinary(mach, inst, micro_cnd, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_DP2A: @@ -2673,16 +2701,7 @@ exec_instruction( break; case TGSI_OPCODE_CLAMP: - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - micro_max(&r[0], &r[0], &r[1]); - FETCH(&r[1], 2, chan_index); - micro_min(&d[chan_index], &r[0], &r[1]); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_trinary(mach, inst, micro_clamp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_FLR: @@ -3076,15 +3095,7 @@ exec_instruction( break; case TGSI_OPCODE_CMP: - FOR_EACH_ENABLED_CHANNEL( *inst, chan_index ) { - FETCH(&r[0], 0, chan_index); - FETCH(&r[1], 1, chan_index); - FETCH(&r[2], 2, chan_index); - micro_lt(&d[chan_index], &r[0], &mach->Temps[TEMP_0_I].xyzw[TEMP_0_C], &r[1], &r[2]); - } - FOR_EACH_ENABLED_CHANNEL(*inst, chan_index) { - STORE(&d[chan_index], 0, chan_index); - } + exec_vector_trinary(mach, inst, micro_cmp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); break; case TGSI_OPCODE_SCS: -- cgit v1.2.3 From 18603a2f07b99bfdbaab35b38b292233fc3e7689 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:36:19 +0100 Subject: st/mesa: fix mesa statetracker adaption to new vertex elements interface --- src/mesa/state_tracker/st_draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 397dddbb47..15d1299a9e 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -57,6 +57,7 @@ #include "pipe/p_defines.h" #include "util/u_inlines.h" #include "util/u_format.h" +#include "cso_cache/cso_context.h" static GLuint double_types[4] = { @@ -600,7 +601,7 @@ st_draw_vbo(GLcontext *ctx, #endif pipe->set_vertex_buffers(pipe, num_vbuffers, vbuffer); - pipe->set_vertex_elements(pipe, num_velements, velements); + cso_set_vertex_elements(ctx->st->cso_context, num_velements, velements); if (num_vbuffers == 0 || num_velements == 0) return; -- cgit v1.2.3 From ac4abaecd5f52e416c89bfe19b34ed7f4e014b21 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:40:22 +0100 Subject: util: adapt blitter code to new vertex element cso The interface of util_draw_vertex_buffer looks a bit odd (calling code has to set vertex elements but not vertex buffers) but due to the way cso state handling generally works (can't re-bind original vertex element state easily there) I guess that's ok for now. --- src/gallium/auxiliary/util/u_blit.c | 16 ++++++++++++++++ src/gallium/auxiliary/util/u_blitter.c | 23 ++++++++++++++++++++++- src/gallium/auxiliary/util/u_blitter.h | 8 ++++++++ src/gallium/auxiliary/util/u_draw_quad.c | 11 +---------- src/gallium/auxiliary/util/u_gen_mipmap.c | 13 +++++++++++++ 5 files changed, 60 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index f0bc58a558..0d93e23df8 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -62,6 +62,7 @@ struct blit_state struct pipe_rasterizer_state rasterizer; struct pipe_sampler_state sampler; struct pipe_viewport_state viewport; + struct pipe_vertex_element velem[2]; void *vs; void *fs[TGSI_WRITEMASK_XYZW + 1]; @@ -115,6 +116,15 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso) ctx->sampler.normalized_coords = 1; + /* vertex elements state */ + memset(&ctx->velem[0], 0, sizeof(ctx->velem[0]) * 2); + for (i = 0; i < 2; i++) { + ctx->velem[i].src_offset = i * 4 * sizeof(float); + ctx->velem[i].instance_divisor = 0; + ctx->velem[i].vertex_buffer_index = 0; + ctx->velem[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + /* vertex shader - still required to provide the linkage between * fragment shader input semantics and vertex_element/buffers. */ @@ -410,11 +420,13 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); + cso_save_vertex_elements(ctx->cso); /* set misc state we care about */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); + cso_set_vertex_elements(ctx->cso, 2, ctx->velem); /* sampler */ ctx->sampler.min_img_filter = filter; @@ -464,6 +476,7 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); + cso_restore_vertex_elements(ctx->cso); pipe_texture_reference(&tex, NULL); } @@ -547,11 +560,13 @@ util_blit_pixels_tex(struct blit_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); + cso_save_vertex_elements(ctx->cso); /* set misc state we care about */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); + cso_set_vertex_elements(ctx->cso, 2, ctx->velem); /* sampler */ ctx->sampler.min_img_filter = filter; @@ -596,4 +611,5 @@ util_blit_pixels_tex(struct blit_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); + cso_restore_vertex_elements(ctx->cso); } diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 18f8606818..3542a2e444 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -88,6 +88,8 @@ struct blitter_context_priv void *dsa_write_depth_keep_stencil; void *dsa_keep_depth_stencil; + void *velem_state; + /* Sampler state for clamping to a miplevel. */ void *sampler_state[PIPE_MAX_TEXTURE_LEVELS]; @@ -102,6 +104,7 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) struct pipe_depth_stencil_alpha_state dsa = { { 0 } }; struct pipe_rasterizer_state rs_state = { 0 }; struct pipe_sampler_state *sampler_state; + struct pipe_vertex_element velem[2]; unsigned i; ctx = CALLOC_STRUCT(blitter_context_priv); @@ -116,6 +119,7 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) ctx->blitter.saved_rs_state = INVALID_PTR; ctx->blitter.saved_fs = INVALID_PTR; ctx->blitter.saved_vs = INVALID_PTR; + ctx->blitter.saved_velem_state = INVALID_PTR; ctx->blitter.saved_fb_state.nr_cbufs = ~0; ctx->blitter.saved_num_textures = ~0; ctx->blitter.saved_num_sampler_states = ~0; @@ -165,6 +169,16 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) rs_state.flatshade = 1; ctx->rs_state = pipe->create_rasterizer_state(pipe, &rs_state); + /* vertex elements state */ + memset(&velem[0], 0, sizeof(velem[0]) * 2); + for (i = 0; i < 2; i++) { + velem[i].src_offset = i * 4 * sizeof(float); + velem[i].instance_divisor = 0; + velem[i].vertex_buffer_index = 0; + velem[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + ctx->velem_state = pipe->create_vertex_elements_state(pipe, 2, &velem[0]); + /* fragment shaders are created on-demand */ /* vertex shaders */ @@ -214,6 +228,7 @@ void util_blitter_destroy(struct blitter_context *blitter) pipe->delete_rasterizer_state(pipe, ctx->rs_state); pipe->delete_vs_state(pipe, ctx->vs_col); pipe->delete_vs_state(pipe, ctx->vs_tex); + pipe->delete_vertex_elements_state(pipe, ctx->velem_state); for (i = 0; i < PIPE_MAX_TEXTURE_TYPES; i++) { if (ctx->fs_texfetch_col[i]) @@ -241,7 +256,8 @@ static void blitter_check_saved_CSOs(struct blitter_context_priv *ctx) ctx->blitter.saved_dsa_state != INVALID_PTR && ctx->blitter.saved_rs_state != INVALID_PTR && ctx->blitter.saved_fs != INVALID_PTR && - ctx->blitter.saved_vs != INVALID_PTR); + ctx->blitter.saved_vs != INVALID_PTR && + ctx->blitter.saved_velem_state != INVALID_PTR); } static void blitter_restore_CSOs(struct blitter_context_priv *ctx) @@ -254,12 +270,14 @@ static void blitter_restore_CSOs(struct blitter_context_priv *ctx) pipe->bind_rasterizer_state(pipe, ctx->blitter.saved_rs_state); pipe->bind_fs_state(pipe, ctx->blitter.saved_fs); pipe->bind_vs_state(pipe, ctx->blitter.saved_vs); + pipe->bind_vertex_elements_state(pipe, ctx->blitter.saved_velem_state); ctx->blitter.saved_blend_state = INVALID_PTR; ctx->blitter.saved_dsa_state = INVALID_PTR; ctx->blitter.saved_rs_state = INVALID_PTR; ctx->blitter.saved_fs = INVALID_PTR; ctx->blitter.saved_vs = INVALID_PTR; + ctx->blitter.saved_velem_state = INVALID_PTR; pipe->set_stencil_ref(pipe, &ctx->blitter.saved_stencil_ref); @@ -546,6 +564,7 @@ void util_blitter_clear(struct blitter_context *blitter, pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); pipe->bind_rasterizer_state(pipe, ctx->rs_state); + pipe->bind_vertex_elements_state(pipe, ctx->velem_state); pipe->bind_fs_state(pipe, blitter_get_fs_col(ctx, num_cbufs)); pipe->bind_vs_state(pipe, ctx->vs_col); @@ -611,6 +630,7 @@ static void util_blitter_do_copy(struct blitter_context *blitter, pipe->bind_vs_state(pipe, ctx->vs_tex); pipe->bind_fragment_sampler_states(pipe, 1, blitter_get_sampler_state(ctx, src->level)); + pipe->bind_vertex_elements_state(pipe, ctx->velem_state); pipe->set_fragment_sampler_textures(pipe, 1, &src->texture); pipe->set_framebuffer_state(pipe, &fb_state); @@ -784,6 +804,7 @@ void util_blitter_fill(struct blitter_context *blitter, pipe->bind_rasterizer_state(pipe, ctx->rs_state); pipe->bind_fs_state(pipe, blitter_get_fs_col(ctx, 1)); pipe->bind_vs_state(pipe, ctx->vs_col); + pipe->bind_vertex_elements_state(pipe, ctx->velem_state); /* set a framebuffer state */ fb_state.width = dst->width; diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h index a2f17073ac..7d8a09edb5 100644 --- a/src/gallium/auxiliary/util/u_blitter.h +++ b/src/gallium/auxiliary/util/u_blitter.h @@ -43,6 +43,7 @@ struct blitter_context /* Private members, really. */ void *saved_blend_state; /**< blend state */ void *saved_dsa_state; /**< depth stencil alpha state */ + void *saved_velem_state; /**< vertex elements state */ void *saved_rs_state; /**< rasterizer state */ void *saved_fs, *saved_vs; /**< fragment shader, vertex shader */ @@ -170,6 +171,13 @@ void util_blitter_save_depth_stencil_alpha(struct blitter_context *blitter, blitter->saved_dsa_state = state; } +static INLINE +void util_blitter_save_vertex_elements(struct blitter_context *blitter, + void *state) +{ + blitter->saved_velem_state = state; +} + static INLINE void util_blitter_save_stencil_ref(struct blitter_context *blitter, const struct pipe_stencil_ref *state) diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c index 36e9a4941f..8c194102bf 100644 --- a/src/gallium/auxiliary/util/u_draw_quad.c +++ b/src/gallium/auxiliary/util/u_draw_quad.c @@ -45,8 +45,6 @@ util_draw_vertex_buffer(struct pipe_context *pipe, uint num_attribs) { struct pipe_vertex_buffer vbuffer; - struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS]; - uint i; assert(num_attribs <= PIPE_MAX_ATTRIBS); @@ -58,14 +56,7 @@ util_draw_vertex_buffer(struct pipe_context *pipe, vbuffer.max_index = num_verts - 1; pipe->set_vertex_buffers(pipe, 1, &vbuffer); - /* tell pipe about the vertex attributes */ - for (i = 0; i < num_attribs; i++) { - velements[i].src_offset = i * 4 * sizeof(float); - velements[i].instance_divisor = 0; - velements[i].vertex_buffer_index = 0; - velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; - } - pipe->set_vertex_elements(pipe, num_attribs, velements); + /* note: vertex elements already set by caller */ /* draw */ pipe->draw_arrays(pipe, prim_type, 0, num_verts); diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 4e358d3938..db726df9c3 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -61,6 +61,7 @@ struct gen_mipmap_state struct pipe_depth_stencil_alpha_state depthstencil; struct pipe_rasterizer_state rasterizer; struct pipe_sampler_state sampler; + struct pipe_vertex_element velem[2]; void *vs; void *fs2d, *fsCube; @@ -1307,6 +1308,15 @@ util_create_gen_mipmap(struct pipe_context *pipe, ctx->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NEAREST; ctx->sampler.normalized_coords = 1; + /* vertex elements state */ + memset(&ctx->velem[0], 0, sizeof(ctx->velem[0]) * 2); + for (i = 0; i < 2; i++) { + ctx->velem[i].src_offset = i * 4 * sizeof(float); + ctx->velem[i].instance_divisor = 0; + ctx->velem[i].vertex_buffer_index = 0; + ctx->velem[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + /* vertex shader - still needed to specify mapping from fragment * shader input semantics to vertex elements */ @@ -1499,11 +1509,13 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_save_framebuffer(ctx->cso); cso_save_fragment_shader(ctx->cso); cso_save_vertex_shader(ctx->cso); + cso_save_vertex_elements(ctx->cso); /* bind our state */ cso_set_blend(ctx->cso, &ctx->blend); cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil); cso_set_rasterizer(ctx->cso, &ctx->rasterizer); + cso_set_vertex_elements(ctx->cso, 2, ctx->velem); cso_set_fragment_shader_handle(ctx->cso, fs); cso_set_vertex_shader_handle(ctx->cso, ctx->vs); @@ -1578,4 +1590,5 @@ util_gen_mipmap(struct gen_mipmap_state *ctx, cso_restore_framebuffer(ctx->cso); cso_restore_fragment_shader(ctx->cso); cso_restore_vertex_shader(ctx->cso); + cso_restore_vertex_elements(ctx->cso); } -- cgit v1.2.3 From 49d3f662b60be08328e7c1dc381d07f50c384601 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:41:03 +0100 Subject: vl: adapt to new vertex element cso interface --- src/gallium/auxiliary/vl/vl_compositor.c | 29 +++--- src/gallium/auxiliary/vl/vl_compositor.h | 2 +- src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 118 ++++++++++++----------- src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h | 4 +- 4 files changed, 82 insertions(+), 71 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index 5d61423f9d..6d461cb880 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -230,6 +230,7 @@ static bool init_pipe_state(struct vl_compositor *c) { struct pipe_sampler_state sampler; + struct pipe_vertex_element vertex_elems[2]; assert(c); @@ -251,15 +252,27 @@ init_pipe_state(struct vl_compositor *c) /*sampler.border_color[i] = ;*/ /*sampler.max_anisotropy = ;*/ c->sampler = c->pipe->create_sampler_state(c->pipe, &sampler); - + + vertex_elems[0].src_offset = 0; + vertex_elems[0].instance_divisor = 0; + vertex_elems[0].vertex_buffer_index = 0; + vertex_elems[0].src_format = PIPE_FORMAT_R32G32_FLOAT; + vertex_elems[1].src_offset = 0; + vertex_elems[1].instance_divisor = 0; + vertex_elems[1].vertex_buffer_index = 1; + vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT; + c->vertex_elems = c->pipe->create_vertex_elements_state(c->pipe, 2, vertex_elems); + + return true; } static void cleanup_pipe_state(struct vl_compositor *c) { assert(c); - + c->pipe->delete_sampler_state(c->pipe, c->sampler); + c->pipe->delete_vertex_elements_state(c->pipe, c->vertex_elems); } static bool @@ -314,11 +327,6 @@ init_buffers(struct vl_compositor *c) pipe_buffer_unmap(c->pipe->screen, c->vertex_bufs[0].buffer); - c->vertex_elems[0].src_offset = 0; - c->vertex_elems[0].instance_divisor = 0; - c->vertex_elems[0].vertex_buffer_index = 0; - c->vertex_elems[0].src_format = PIPE_FORMAT_R32G32_FLOAT; - /* * Create our texcoord buffer and texcoord buffer element * Texcoord buffer contains the TCs for mapping the rendered surface to the 4 vertices @@ -343,11 +351,6 @@ init_buffers(struct vl_compositor *c) pipe_buffer_unmap(c->pipe->screen, c->vertex_bufs[1].buffer); - c->vertex_elems[1].src_offset = 0; - c->vertex_elems[1].instance_divisor = 0; - c->vertex_elems[1].vertex_buffer_index = 1; - c->vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT; - /* * Create our vertex shader's constant buffer * Const buffer contains scaling and translation vectors @@ -481,7 +484,7 @@ void vl_compositor_render(struct vl_compositor *compositor, compositor->pipe->bind_vs_state(compositor->pipe, compositor->vertex_shader); compositor->pipe->bind_fs_state(compositor->pipe, compositor->fragment_shader); compositor->pipe->set_vertex_buffers(compositor->pipe, 2, compositor->vertex_bufs); - compositor->pipe->set_vertex_elements(compositor->pipe, 2, compositor->vertex_elems); + compositor->pipe->bind_vertex_elements_state(compositor->pipe, compositor->vertex_elems); compositor->pipe->set_constant_buffer(compositor->pipe, PIPE_SHADER_VERTEX, 0, compositor->vs_const_buf); compositor->pipe->set_constant_buffer(compositor->pipe, PIPE_SHADER_FRAGMENT, 0, compositor->fs_const_buf); diff --git a/src/gallium/auxiliary/vl/vl_compositor.h b/src/gallium/auxiliary/vl/vl_compositor.h index 6a9a3fd7af..51755554da 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.h +++ b/src/gallium/auxiliary/vl/vl_compositor.h @@ -43,10 +43,10 @@ struct vl_compositor void *sampler; void *vertex_shader; void *fragment_shader; + void *vertex_elems; struct pipe_viewport_state viewport; struct pipe_scissor_state scissor; struct pipe_vertex_buffer vertex_bufs[2]; - struct pipe_vertex_element vertex_elems[2]; struct pipe_buffer *vs_const_buf, *fs_const_buf; }; diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index 6b9ecd4268..0763b5bb0e 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -708,6 +708,7 @@ static bool init_pipe_state(struct vl_mpeg12_mc_renderer *r) { struct pipe_sampler_state sampler; + struct pipe_vertex_element vertex_elems[8]; unsigned filters[5]; unsigned i; @@ -771,6 +772,59 @@ init_pipe_state(struct vl_mpeg12_mc_renderer *r) r->samplers.all[i] = r->pipe->create_sampler_state(r->pipe, &sampler); } + /* Position element */ + vertex_elems[0].src_offset = 0; + vertex_elems[0].instance_divisor = 0; + vertex_elems[0].vertex_buffer_index = 0; + vertex_elems[0].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* Luma, texcoord element */ + vertex_elems[1].src_offset = sizeof(struct vertex2f); + vertex_elems[1].instance_divisor = 0; + vertex_elems[1].vertex_buffer_index = 0; + vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* Chroma Cr texcoord element */ + vertex_elems[2].src_offset = sizeof(struct vertex2f) * 2; + vertex_elems[2].instance_divisor = 0; + vertex_elems[2].vertex_buffer_index = 0; + vertex_elems[2].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* Chroma Cb texcoord element */ + vertex_elems[3].src_offset = sizeof(struct vertex2f) * 3; + vertex_elems[3].instance_divisor = 0; + vertex_elems[3].vertex_buffer_index = 0; + vertex_elems[3].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* First ref surface top field texcoord element */ + vertex_elems[4].src_offset = 0; + vertex_elems[4].instance_divisor = 0; + vertex_elems[4].vertex_buffer_index = 1; + vertex_elems[4].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* First ref surface bottom field texcoord element */ + vertex_elems[5].src_offset = sizeof(struct vertex2f); + vertex_elems[5].instance_divisor = 0; + vertex_elems[5].vertex_buffer_index = 1; + vertex_elems[5].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* Second ref surface top field texcoord element */ + vertex_elems[6].src_offset = 0; + vertex_elems[6].instance_divisor = 0; + vertex_elems[6].vertex_buffer_index = 2; + vertex_elems[6].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* Second ref surface bottom field texcoord element */ + vertex_elems[7].src_offset = sizeof(struct vertex2f); + vertex_elems[7].instance_divisor = 0; + vertex_elems[7].vertex_buffer_index = 2; + vertex_elems[7].src_format = PIPE_FORMAT_R32G32_FLOAT; + + /* need versions with 4,6 and 8 vertex elems */ + r->vertex_elems[0] = r->pipe->create_vertex_elements_state(r->pipe, 4, vertex_elems); + r->vertex_elems[1] = r->pipe->create_vertex_elements_state(r->pipe, 6, vertex_elems); + r->vertex_elems[2] = r->pipe->create_vertex_elements_state(r->pipe, 8, vertex_elems); + return true; } @@ -783,6 +837,8 @@ cleanup_pipe_state(struct vl_mpeg12_mc_renderer *r) for (i = 0; i < 5; ++i) r->pipe->delete_sampler_state(r->pipe, r->samplers.all[i]); + for (i = 0; i < 3; i++) + r->pipe->delete_vertex_elements_state(r->pipe, r->vertex_elems[i]); } static bool @@ -888,54 +944,6 @@ init_buffers(struct vl_mpeg12_mc_renderer *r) ); } - /* Position element */ - r->vertex_elems[0].src_offset = 0; - r->vertex_elems[0].instance_divisor = 0; - r->vertex_elems[0].vertex_buffer_index = 0; - r->vertex_elems[0].src_format = PIPE_FORMAT_R32G32_FLOAT; - - /* Luma, texcoord element */ - r->vertex_elems[1].src_offset = sizeof(struct vertex2f); - r->vertex_elems[1].instance_divisor = 0; - r->vertex_elems[1].vertex_buffer_index = 0; - r->vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT; - - /* Chroma Cr texcoord element */ - r->vertex_elems[2].src_offset = sizeof(struct vertex2f) * 2; - r->vertex_elems[2].instance_divisor = 0; - r->vertex_elems[2].vertex_buffer_index = 0; - r->vertex_elems[2].src_format = PIPE_FORMAT_R32G32_FLOAT; - - /* Chroma Cb texcoord element */ - r->vertex_elems[3].src_offset = sizeof(struct vertex2f) * 3; - r->vertex_elems[3].instance_divisor = 0; - r->vertex_elems[3].vertex_buffer_index = 0; - r->vertex_elems[3].src_format = PIPE_FORMAT_R32G32_FLOAT; - - /* First ref surface top field texcoord element */ - r->vertex_elems[4].src_offset = 0; - r->vertex_elems[4].instance_divisor = 0; - r->vertex_elems[4].vertex_buffer_index = 1; - r->vertex_elems[4].src_format = PIPE_FORMAT_R32G32_FLOAT; - - /* First ref surface bottom field texcoord element */ - r->vertex_elems[5].src_offset = sizeof(struct vertex2f); - r->vertex_elems[5].instance_divisor = 0; - r->vertex_elems[5].vertex_buffer_index = 1; - r->vertex_elems[5].src_format = PIPE_FORMAT_R32G32_FLOAT; - - /* Second ref surface top field texcoord element */ - r->vertex_elems[6].src_offset = 0; - r->vertex_elems[6].instance_divisor = 0; - r->vertex_elems[6].vertex_buffer_index = 2; - r->vertex_elems[6].src_format = PIPE_FORMAT_R32G32_FLOAT; - - /* Second ref surface bottom field texcoord element */ - r->vertex_elems[7].src_offset = sizeof(struct vertex2f); - r->vertex_elems[7].instance_divisor = 0; - r->vertex_elems[7].vertex_buffer_index = 2; - r->vertex_elems[7].src_format = PIPE_FORMAT_R32G32_FLOAT; - r->vs_const_buf = pipe_buffer_create ( r->pipe->screen, @@ -1299,7 +1307,7 @@ flush(struct vl_mpeg12_mc_renderer *r) if (num_macroblocks[MACROBLOCK_TYPE_INTRA] > 0) { r->pipe->set_vertex_buffers(r->pipe, 1, r->vertex_bufs.all); - r->pipe->set_vertex_elements(r->pipe, 4, r->vertex_elems); + r->pipe->bind_vertex_elements_state(r->pipe, r->vertex_elems[0]); r->pipe->set_fragment_sampler_textures(r->pipe, 3, r->textures.all); r->pipe->bind_fragment_sampler_states(r->pipe, 3, r->samplers.all); r->pipe->bind_vs_state(r->pipe, r->i_vs); @@ -1312,7 +1320,7 @@ flush(struct vl_mpeg12_mc_renderer *r) if (num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] > 0) { r->pipe->set_vertex_buffers(r->pipe, 2, r->vertex_bufs.all); - r->pipe->set_vertex_elements(r->pipe, 6, r->vertex_elems); + r->pipe->bind_vertex_elements_state(r->pipe, r->vertex_elems[1]); r->textures.individual.ref[0] = r->past; r->pipe->set_fragment_sampler_textures(r->pipe, 4, r->textures.all); r->pipe->bind_fragment_sampler_states(r->pipe, 4, r->samplers.all); @@ -1326,7 +1334,7 @@ flush(struct vl_mpeg12_mc_renderer *r) if (false /*num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] > 0 */ ) { r->pipe->set_vertex_buffers(r->pipe, 2, r->vertex_bufs.all); - r->pipe->set_vertex_elements(r->pipe, 6, r->vertex_elems); + r->pipe->bind_vertex_elements_state(r->pipe, r->vertex_elems[1]); r->textures.individual.ref[0] = r->past; r->pipe->set_fragment_sampler_textures(r->pipe, 4, r->textures.all); r->pipe->bind_fragment_sampler_states(r->pipe, 4, r->samplers.all); @@ -1340,7 +1348,7 @@ flush(struct vl_mpeg12_mc_renderer *r) if (num_macroblocks[MACROBLOCK_TYPE_BKWD_FRAME_PRED] > 0) { r->pipe->set_vertex_buffers(r->pipe, 2, r->vertex_bufs.all); - r->pipe->set_vertex_elements(r->pipe, 6, r->vertex_elems); + r->pipe->bind_vertex_elements_state(r->pipe, r->vertex_elems[1]); r->textures.individual.ref[0] = r->future; r->pipe->set_fragment_sampler_textures(r->pipe, 4, r->textures.all); r->pipe->bind_fragment_sampler_states(r->pipe, 4, r->samplers.all); @@ -1354,7 +1362,7 @@ flush(struct vl_mpeg12_mc_renderer *r) if (false /*num_macroblocks[MACROBLOCK_TYPE_BKWD_FIELD_PRED] > 0 */ ) { r->pipe->set_vertex_buffers(r->pipe, 2, r->vertex_bufs.all); - r->pipe->set_vertex_elements(r->pipe, 6, r->vertex_elems); + r->pipe->bind_vertex_elements_state(r->pipe, r->vertex_elems[1]); r->textures.individual.ref[0] = r->future; r->pipe->set_fragment_sampler_textures(r->pipe, 4, r->textures.all); r->pipe->bind_fragment_sampler_states(r->pipe, 4, r->samplers.all); @@ -1368,7 +1376,7 @@ flush(struct vl_mpeg12_mc_renderer *r) if (num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] > 0) { r->pipe->set_vertex_buffers(r->pipe, 3, r->vertex_bufs.all); - r->pipe->set_vertex_elements(r->pipe, 8, r->vertex_elems); + r->pipe->bind_vertex_elements_state(r->pipe, r->vertex_elems[2]); r->textures.individual.ref[0] = r->past; r->textures.individual.ref[1] = r->future; r->pipe->set_fragment_sampler_textures(r->pipe, 5, r->textures.all); @@ -1383,7 +1391,7 @@ flush(struct vl_mpeg12_mc_renderer *r) if (false /*num_macroblocks[MACROBLOCK_TYPE_BI_FIELD_PRED] > 0 */ ) { r->pipe->set_vertex_buffers(r->pipe, 3, r->vertex_bufs.all); - r->pipe->set_vertex_elements(r->pipe, 8, r->vertex_elems); + r->pipe->bind_vertex_elements_state(r->pipe, r->vertex_elems[2]); r->textures.individual.ref[0] = r->past; r->textures.individual.ref[1] = r->future; r->pipe->set_fragment_sampler_textures(r->pipe, 5, r->textures.all); diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h index f00b8c7b8b..a11a3e7307 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h @@ -66,8 +66,8 @@ struct vl_mpeg12_mc_renderer struct pipe_buffer *vs_const_buf; struct pipe_buffer *fs_const_buf; struct pipe_framebuffer_state fb_state; - struct pipe_vertex_element vertex_elems[8]; - + void *vertex_elems[3]; + union { void *all[5]; -- cgit v1.2.3 From 8397c80646364eb20d7e83304b55e6f3ee353b49 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:42:47 +0100 Subject: gallium/docs: document new vertex element cso interface --- src/gallium/docs/source/context.rst | 2 +- src/gallium/docs/source/cso/velems.rst | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/gallium/docs/source/cso/velems.rst (limited to 'src') diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst index 9080addba4..4608e97adb 100644 --- a/src/gallium/docs/source/context.rst +++ b/src/gallium/docs/source/context.rst @@ -24,6 +24,7 @@ CSO objects handled by the context object: * :ref:`Depth, Stencil, & Alpha`: ``*_depth_stencil_alpha_state`` * :ref:`Shader`: These have two sets of methods. ``*_fs_state`` is for fragment shaders, and ``*_vs_state`` is for vertex shaders. +* :ref:`Vertex Elements`: ``*_vertex_elements_state`` Resource Binding State @@ -60,7 +61,6 @@ objects. They all follow simple, one-method binding calls, e.g. not have the scissor test enabled, then the scissor bounds never need to be set since they will not be used. * ``set_viewport_state`` -* ``set_vertex_elements`` Clearing diff --git a/src/gallium/docs/source/cso/velems.rst b/src/gallium/docs/source/cso/velems.rst new file mode 100644 index 0000000000..8e758fae10 --- /dev/null +++ b/src/gallium/docs/source/cso/velems.rst @@ -0,0 +1,24 @@ +.. _vertex,elements + +Vertex Elements +=============== + +This state controls format etc. of the input attributes contained +in the pipe_vertex_buffer(s). There's one pipe_vertex_element array member +for each input attribute. + +Members +------- + +src_offset + The byte offset of the attribute in the buffer given by + vertex_buffer_index for the first vertex. +instance_divisor + The instance data rate divisor, used for instancing. + 0 means this is per-vertex data, n means per-instance data used for + n consecutive instances (n > 0). +vertex_buffer_index + The vertex buffer this attribute lives in. Several attributes may + live in the same vertex buffer. +src_format + The format of the attribute data. One of the PIPE_FORMAT tokens. -- cgit v1.2.3 From 711476be2904bd16d45b424236d6aefa9a9e6bc9 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:43:58 +0100 Subject: xorg: adapt to new vertex element cso --- src/gallium/state_trackers/xorg/xorg_renderer.c | 13 +++++++++++++ src/gallium/state_trackers/xorg/xorg_renderer.h | 1 + 2 files changed, 14 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index 83b0d31e38..1eb926360b 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -68,6 +68,8 @@ renderer_draw(struct xorg_renderer *r) if (buf) { + cso_set_vertex_elements(r->cso, r->attrs_per_vertex, r->velems); + util_draw_vertex_buffer(pipe, buf, 0, PIPE_PRIM_QUADS, num_verts, /* verts */ @@ -92,6 +94,7 @@ renderer_init_state(struct xorg_renderer *r) { struct pipe_depth_stencil_alpha_state dsa; struct pipe_rasterizer_state raster; + unsigned i; /* set common initial clip state */ memset(&dsa, 0, sizeof(struct pipe_depth_stencil_alpha_state)); @@ -103,6 +106,14 @@ renderer_init_state(struct xorg_renderer *r) raster.gl_rasterization_rules = 1; cso_set_rasterizer(r->cso, &raster); + /* vertex elements state */ + memset(&r->velems[0], 0, sizeof(r->velems[0]) * 3); + for (i = 0; i < 3; i++) { + r->velems[i].src_offset = i * 4 * sizeof(float); + r->velems[i].instance_divisor = 0; + r->velems[i].vertex_buffer_index = 0; + r->velems[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } } @@ -600,6 +611,8 @@ void renderer_draw_yuv(struct xorg_renderer *r, if (buf) { const int num_attribs = 2; /*pos + tex coord*/ + cso_set_vertex_elements(r->cso, num_attribs, r->velems); + util_draw_vertex_buffer(pipe, buf, 0, PIPE_PRIM_QUADS, 4, /* verts */ diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.h b/src/gallium/state_trackers/xorg/xorg_renderer.h index af6aa0567d..3d00628719 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.h +++ b/src/gallium/state_trackers/xorg/xorg_renderer.h @@ -28,6 +28,7 @@ struct xorg_renderer { float buffer[BUF_SIZE]; int buffer_size; + struct pipe_vertex_element velems[3]; /* number of attributes per vertex for the current * draw operation */ -- cgit v1.2.3 From 1f57069c68f7bf812d4d2e054c5ced3ed72cfa10 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:45:25 +0100 Subject: vega: adapt to new vertex element cso --- src/gallium/state_trackers/vega/api_masks.c | 2 ++ src/gallium/state_trackers/vega/polygon.c | 3 ++- src/gallium/state_trackers/vega/renderer.c | 5 +++++ src/gallium/state_trackers/vega/vg_context.c | 8 ++++++++ src/gallium/state_trackers/vega/vg_context.h | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/vega/api_masks.c b/src/gallium/state_trackers/vega/api_masks.c index 9c123a4cf9..7eb5ea1f07 100644 --- a/src/gallium/state_trackers/vega/api_masks.c +++ b/src/gallium/state_trackers/vega/api_masks.c @@ -86,6 +86,8 @@ draw_clear_quad(struct vg_context *st, /* draw */ if (buf) { + cso_set_vertex_elements(st->cso_context, 2, st->velems); + util_draw_vertex_buffer(pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ diff --git a/src/gallium/state_trackers/vega/polygon.c b/src/gallium/state_trackers/vega/polygon.c index 96fbbfc85a..eef2c1eb87 100644 --- a/src/gallium/state_trackers/vega/polygon.c +++ b/src/gallium/state_trackers/vega/polygon.c @@ -292,11 +292,12 @@ static void draw_polygon(struct vg_context *ctx, pipe->set_vertex_buffers(pipe, 1, &vbuffer); /* tell pipe about the vertex attributes */ + memset(&velement, 0, sizeof(velement)); velement.src_offset = 0; velement.instance_divisor = 0; velement.vertex_buffer_index = 0; velement.src_format = PIPE_FORMAT_R32G32_FLOAT; - pipe->set_vertex_elements(pipe, 1, &velement); + cso_set_vertex_elements(ctx->cso_context, 1, &velement); /* draw */ pipe->draw_arrays(pipe, PIPE_PRIM_TRIANGLE_FAN, diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c index 05620efa9c..47e8b470a1 100644 --- a/src/gallium/state_trackers/vega/renderer.c +++ b/src/gallium/state_trackers/vega/renderer.c @@ -210,6 +210,7 @@ void renderer_draw_quad(struct renderer *r, buf = setup_vertex_data(r, x1, y1, x2, y2, depth); if (buf) { + cso_set_vertex_elements(r->cso, 2, r->owner->velems); util_draw_vertex_buffer(r->pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ @@ -248,6 +249,7 @@ void renderer_draw_texture(struct renderer *r, s0, t0, s1, t1, 0.0f); if (buf) { + cso_set_vertex_elements(r->cso, 2, r->owner->velems); util_draw_vertex_buffer(pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ @@ -370,6 +372,7 @@ void renderer_copy_texture(struct renderer *ctx, 0.0f); if (buf) { + cso_set_vertex_elements(ctx->cso, 2, ctx->owner->velems); util_draw_vertex_buffer(ctx->pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ @@ -535,6 +538,7 @@ void renderer_copy_surface(struct renderer *ctx, (float) dstX1, (float) dstY1, z); if (buf) { + cso_set_vertex_elements(ctx->cso, 2, ctx->owner->velems); util_draw_vertex_buffer(ctx->pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ @@ -587,6 +591,7 @@ void renderer_texture_quad(struct renderer *r, s0, t0, s1, t1, 0.0f); if (buf) { + cso_set_vertex_elements(r->cso, 2, r->owner->velems); util_draw_vertex_buffer(pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c index 426bf9bc62..170391ec03 100644 --- a/src/gallium/state_trackers/vega/vg_context.c +++ b/src/gallium/state_trackers/vega/vg_context.c @@ -72,6 +72,7 @@ struct vg_context * vg_create_context(struct pipe_context *pipe, struct vg_context *share) { struct vg_context *ctx; + unsigned i; ctx = CALLOC_STRUCT(vg_context); @@ -103,6 +104,13 @@ struct vg_context * vg_create_context(struct pipe_context *pipe, ctx->blend_sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST; ctx->blend_sampler.normalized_coords = 0; + for (i = 0; i < 2; i++) { + ctx->velems[i].src_offset = i * 4 * sizeof(float); + ctx->velems[i].instance_divisor = 0; + ctx->velems[i].vertex_buffer_index = 0; + ctx->velems[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + vg_set_error(ctx, VG_NO_ERROR); ctx->owned_objects[VG_OBJECT_PAINT] = cso_hash_create(); diff --git a/src/gallium/state_trackers/vega/vg_context.h b/src/gallium/state_trackers/vega/vg_context.h index bc88c8d139..804e9e76d7 100644 --- a/src/gallium/state_trackers/vega/vg_context.h +++ b/src/gallium/state_trackers/vega/vg_context.h @@ -146,6 +146,7 @@ struct vg_context struct vg_shader *clear_vs; struct vg_shader *texture_vs; struct pipe_buffer *vs_const_buffer; + struct pipe_vertex_element velems[2]; }; struct vg_object { -- cgit v1.2.3 From 9abef5ebfa6be3f8d39fbc8b92293c2c0c81ce46 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:45:46 +0100 Subject: vega: adapt to new vertex element cso --- src/gallium/state_trackers/python/p_context.i | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/p_context.i b/src/gallium/state_trackers/python/p_context.i index 3f36ccb621..5c44462e80 100644 --- a/src/gallium/state_trackers/python/p_context.i +++ b/src/gallium/state_trackers/python/p_context.i @@ -51,7 +51,7 @@ struct st_context { void set_blend( const struct pipe_blend_state *state ) { cso_set_blend($self->cso, state); } - + void set_fragment_sampler( unsigned index, const struct pipe_sampler_state *state ) { cso_single_sampler($self->cso, index, state); cso_single_sampler_done($self->cso); @@ -222,9 +222,9 @@ struct st_context { void set_vertex_elements(unsigned num) { $self->num_vertex_elements = num; - $self->pipe->set_vertex_elements($self->pipe, - $self->num_vertex_elements, - $self->vertex_elements); + cso_set_vertex_elements($self->cso, + $self->num_vertex_elements, + $self->vertex_elements); } /* -- cgit v1.2.3 From 618e7e0c88400dc853b0ff4792a0c70800587073 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:45:57 +0100 Subject: trace: adapt to new vertex element cso --- src/gallium/drivers/trace/tr_context.c | 91 +++++++++++++++++++++++++--------- 1 file changed, 67 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index df40fbade6..133521f45e 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -773,6 +773,70 @@ trace_context_delete_vs_state(struct pipe_context *_pipe, } +static INLINE void * +trace_context_create_vertex_elements_state(struct pipe_context *_pipe, + unsigned num_elements, + const struct pipe_vertex_element *elements) +{ + struct trace_context *tr_ctx = trace_context(_pipe); + struct pipe_context *pipe = tr_ctx->pipe; + void * result; + + trace_dump_call_begin("pipe_context", "create_vertex_elements_state"); + + trace_dump_arg(ptr, pipe); + trace_dump_arg(uint, num_elements); + + trace_dump_arg_begin("elements"); + trace_dump_struct_array(vertex_element, elements, num_elements); + trace_dump_arg_end(); + + result = pipe->create_vertex_elements_state(pipe, num_elements, elements); + + trace_dump_ret(ptr, result); + + trace_dump_call_end(); + + return result; +} + + +static INLINE void +trace_context_bind_vertex_elements_state(struct pipe_context *_pipe, + void *state) +{ + struct trace_context *tr_ctx = trace_context(_pipe); + struct pipe_context *pipe = tr_ctx->pipe; + + trace_dump_call_begin("pipe_context", "bind_vertex_elements_state"); + + trace_dump_arg(ptr, pipe); + trace_dump_arg(ptr, state); + + pipe->bind_vertex_elements_state(pipe, state); + + trace_dump_call_end(); +} + + +static INLINE void +trace_context_delete_vertex_elements_state(struct pipe_context *_pipe, + void *state) +{ + struct trace_context *tr_ctx = trace_context(_pipe); + struct pipe_context *pipe = tr_ctx->pipe; + + trace_dump_call_begin("pipe_context", "delete_verte_elements_state"); + + trace_dump_arg(ptr, pipe); + trace_dump_arg(ptr, state); + + pipe->delete_vertex_elements_state(pipe, state); + + trace_dump_call_end(); +} + + static INLINE void trace_context_set_blend_color(struct pipe_context *_pipe, const struct pipe_blend_color *state) @@ -1047,29 +1111,6 @@ trace_context_set_vertex_buffers(struct pipe_context *_pipe, } -static INLINE void -trace_context_set_vertex_elements(struct pipe_context *_pipe, - unsigned num_elements, - const struct pipe_vertex_element *elements) -{ - struct trace_context *tr_ctx = trace_context(_pipe); - struct pipe_context *pipe = tr_ctx->pipe; - - trace_dump_call_begin("pipe_context", "set_vertex_elements"); - - trace_dump_arg(ptr, pipe); - trace_dump_arg(uint, num_elements); - - trace_dump_arg_begin("elements"); - trace_dump_struct_array(vertex_element, elements, num_elements); - trace_dump_arg_end(); - - pipe->set_vertex_elements(pipe, num_elements, elements); - - trace_dump_call_end(); -} - - static INLINE void trace_context_surface_copy(struct pipe_context *_pipe, struct pipe_surface *dest, @@ -1303,6 +1344,9 @@ trace_context_create(struct trace_screen *tr_scr, tr_ctx->base.create_vs_state = trace_context_create_vs_state; tr_ctx->base.bind_vs_state = trace_context_bind_vs_state; tr_ctx->base.delete_vs_state = trace_context_delete_vs_state; + tr_ctx->base.create_vertex_elements_state = trace_context_create_vertex_elements_state; + tr_ctx->base.bind_vertex_elements_state = trace_context_bind_vertex_elements_state; + tr_ctx->base.delete_vertex_elements_state = trace_context_delete_vertex_elements_state; tr_ctx->base.set_blend_color = trace_context_set_blend_color; tr_ctx->base.set_stencil_ref = trace_context_set_stencil_ref; tr_ctx->base.set_clip_state = trace_context_set_clip_state; @@ -1314,7 +1358,6 @@ trace_context_create(struct trace_screen *tr_scr, tr_ctx->base.set_fragment_sampler_textures = trace_context_set_fragment_sampler_textures; tr_ctx->base.set_vertex_sampler_textures = trace_context_set_vertex_sampler_textures; tr_ctx->base.set_vertex_buffers = trace_context_set_vertex_buffers; - tr_ctx->base.set_vertex_elements = trace_context_set_vertex_elements; if (pipe->surface_copy) tr_ctx->base.surface_copy = trace_context_surface_copy; if (pipe->surface_fill) -- cgit v1.2.3 From b1676a953eb61838e9ef03532792bc723f4d4ada Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:46:12 +0100 Subject: svga: adapt to new vertex element cso --- src/gallium/drivers/svga/svga_context.h | 8 +++-- src/gallium/drivers/svga/svga_pipe_vertex.c | 38 ++++++++++++++++++------ src/gallium/drivers/svga/svga_state_need_swtnl.c | 4 +-- src/gallium/drivers/svga/svga_state_vdecl.c | 8 ++--- src/gallium/drivers/svga/svga_state_vs.c | 4 +-- src/gallium/drivers/svga/svga_swtnl_state.c | 4 +-- 6 files changed, 45 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h index 03302e2a6e..4d9f00991a 100644 --- a/src/gallium/drivers/svga/svga_context.h +++ b/src/gallium/drivers/svga/svga_context.h @@ -169,6 +169,11 @@ struct svga_sampler_state { unsigned view_max_lod; }; +struct svga_velems_state { + unsigned count; + struct pipe_vertex_element velem[]; +}; + /* Use to calculate differences between state emitted to hardware and * current driver-calculated state. */ @@ -178,13 +183,13 @@ struct svga_state const struct svga_depth_stencil_state *depth; const struct svga_rasterizer_state *rast; const struct svga_sampler_state *sampler[PIPE_MAX_SAMPLERS]; + const struct svga_velems_state *velems; struct pipe_texture *texture[PIPE_MAX_SAMPLERS]; /* or texture ID's? */ struct svga_fragment_shader *fs; struct svga_vertex_shader *vs; struct pipe_vertex_buffer vb[PIPE_MAX_ATTRIBS]; - struct pipe_vertex_element ve[PIPE_MAX_ATTRIBS]; struct pipe_buffer *cb[PIPE_SHADER_TYPES]; struct pipe_framebuffer_state framebuffer; @@ -204,7 +209,6 @@ struct svga_state unsigned num_samplers; unsigned num_textures; - unsigned num_vertex_elements; unsigned num_vertex_buffers; unsigned reduced_prim; diff --git a/src/gallium/drivers/svga/svga_pipe_vertex.c b/src/gallium/drivers/svga/svga_pipe_vertex.c index ffc0f99565..979deb12af 100644 --- a/src/gallium/drivers/svga/svga_pipe_vertex.c +++ b/src/gallium/drivers/svga/svga_pipe_vertex.c @@ -26,6 +26,7 @@ #include "util/u_inlines.h" #include "pipe/p_defines.h" #include "util/u_math.h" +#include "util/u_memory.h" #include "tgsi/tgsi_parse.h" #include "svga_screen.h" @@ -64,20 +65,37 @@ static void svga_set_vertex_buffers(struct pipe_context *pipe, svga->dirty |= SVGA_NEW_VBUFFER; } -static void svga_set_vertex_elements(struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_element *elements) + +static void * +svga_create_vertex_elements_state(struct pipe_context *pipe, + unsigned count, + const struct pipe_vertex_element *attribs) { - struct svga_context *svga = svga_context(pipe); - unsigned i; + struct svga_velems_state *velems; + assert(count <= PIPE_MAX_ATTRIBS); + velems = (struct svga_velems_state *) MALLOC(sizeof(struct svga_velems_state) + count * sizeof(*attribs)); + if (velems) { + velems->count = count; + memcpy(velems->velem, attribs, sizeof(*attribs) * count); + } + return velems; +} - for (i = 0; i < count; i++) - svga->curr.ve[i] = elements[i]; +static void svga_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems) +{ + struct svga_context *svga = svga_context(pipe); + struct svga_velems_state *svga_velems = (struct svga_velems_state *) velems; - svga->curr.num_vertex_elements = count; + svga->curr.velems = svga_velems; svga->dirty |= SVGA_NEW_VELEMENT; } +static void svga_delete_vertex_elements_state(struct pipe_context *pipe, + void *velems) +{ + FREE(velems); +} void svga_cleanup_vertex_state( struct svga_context *svga ) { @@ -91,7 +109,9 @@ void svga_cleanup_vertex_state( struct svga_context *svga ) void svga_init_vertex_functions( struct svga_context *svga ) { svga->pipe.set_vertex_buffers = svga_set_vertex_buffers; - svga->pipe.set_vertex_elements = svga_set_vertex_elements; + svga->pipe.create_vertex_elements_state = svga_create_vertex_elements_state; + svga->pipe.bind_vertex_elements_state = svga_bind_vertex_elements_state; + svga->pipe.delete_vertex_elements_state = svga_delete_vertex_elements_state; } diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index dd13a89d24..94fe0bc968 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -76,8 +76,8 @@ static int update_need_swvfetch( struct svga_context *svga, unsigned i; boolean need_swvfetch = FALSE; - for (i = 0; i < svga->curr.num_vertex_elements; i++) { - svga->state.sw.ve_format[i] = svga_translate_vertex_format(svga->curr.ve[i].src_format); + for (i = 0; i < svga->curr.velems->count; i++) { + svga->state.sw.ve_format[i] = svga_translate_vertex_format(svga->curr.velems->velem[i].src_format); if (svga->state.sw.ve_format[i] == SVGA3D_DECLTYPE_MAX) { need_swvfetch = TRUE; break; diff --git a/src/gallium/drivers/svga/svga_state_vdecl.c b/src/gallium/drivers/svga/svga_state_vdecl.c index d1066ce13b..91854f6530 100644 --- a/src/gallium/drivers/svga/svga_state_vdecl.c +++ b/src/gallium/drivers/svga/svga_state_vdecl.c @@ -98,17 +98,17 @@ upload_user_buffers( struct svga_context *svga ) static int emit_hw_vs_vdecl( struct svga_context *svga, unsigned dirty ) { - const struct pipe_vertex_element *ve = svga->curr.ve; + const struct pipe_vertex_element *ve = svga->curr.velems->velem; SVGA3dVertexDecl decl; unsigned i; - assert(svga->curr.num_vertex_elements >= + assert(svga->curr.velems->count >= svga->curr.vs->base.info.file_count[TGSI_FILE_INPUT]); svga_hwtnl_reset_vdecl( svga->hwtnl, - svga->curr.num_vertex_elements ); + svga->curr.velems->count ); - for (i = 0; i < svga->curr.num_vertex_elements; i++) { + for (i = 0; i < svga->curr.velems->count; i++) { const struct pipe_vertex_buffer *vb = &svga->curr.vb[ve[i].vertex_buffer_index]; unsigned usage, index; diff --git a/src/gallium/drivers/svga/svga_state_vs.c b/src/gallium/drivers/svga/svga_state_vs.c index d7999fe53d..781f7bf533 100644 --- a/src/gallium/drivers/svga/svga_state_vs.c +++ b/src/gallium/drivers/svga/svga_state_vs.c @@ -186,8 +186,8 @@ static int update_zero_stride( struct svga_context *svga, svga->curr.zero_stride_vertex_elements = 0; svga->curr.num_zero_stride_vertex_elements = 0; - for (i = 0; i < svga->curr.num_vertex_elements; i++) { - const struct pipe_vertex_element *vel = &svga->curr.ve[i]; + for (i = 0; i < svga->curr.velems->count; i++) { + const struct pipe_vertex_element *vel = &svga->curr.velems->velem[i]; const struct pipe_vertex_buffer *vbuffer = &svga->curr.vb[ vel->vertex_buffer_index]; if (vbuffer->stride == 0) { diff --git a/src/gallium/drivers/svga/svga_swtnl_state.c b/src/gallium/drivers/svga/svga_swtnl_state.c index 35f36a828f..246d34e649 100644 --- a/src/gallium/drivers/svga/svga_swtnl_state.c +++ b/src/gallium/drivers/svga/svga_swtnl_state.c @@ -99,8 +99,8 @@ static int update_swtnl_draw( struct svga_context *svga, if (dirty & SVGA_NEW_VELEMENT) draw_set_vertex_elements(svga->swtnl.draw, - svga->curr.num_vertex_elements, - svga->curr.ve ); + svga->curr.velems->count, + svga->curr.velems->velem ); if (dirty & SVGA_NEW_CLIP) draw_set_clip_state(svga->swtnl.draw, -- cgit v1.2.3 From 057427dd3ea9da6f907b39391f6bd1b093fb128e Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:46:29 +0100 Subject: softpipe: adapt to new vertex element cso --- src/gallium/drivers/softpipe/sp_context.c | 5 +++- src/gallium/drivers/softpipe/sp_context.h | 4 +-- src/gallium/drivers/softpipe/sp_state.h | 17 +++++++++---- src/gallium/drivers/softpipe/sp_state_vertex.c | 35 +++++++++++++++++++------- 4 files changed, 44 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index ddc35bcd62..e8f2318e48 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -245,6 +245,10 @@ softpipe_create_context( struct pipe_screen *screen, softpipe->pipe.bind_gs_state = softpipe_bind_gs_state; softpipe->pipe.delete_gs_state = softpipe_delete_gs_state; + softpipe->pipe.create_vertex_elements_state = softpipe_create_vertex_elements_state; + softpipe->pipe.bind_vertex_elements_state = softpipe_bind_vertex_elements_state; + softpipe->pipe.delete_vertex_elements_state = softpipe_delete_vertex_elements_state; + softpipe->pipe.set_blend_color = softpipe_set_blend_color; softpipe->pipe.set_stencil_ref = softpipe_set_stencil_ref; softpipe->pipe.set_clip_state = softpipe_set_clip_state; @@ -257,7 +261,6 @@ softpipe_create_context( struct pipe_screen *screen, softpipe->pipe.set_viewport_state = softpipe_set_viewport_state; softpipe->pipe.set_vertex_buffers = softpipe_set_vertex_buffers; - softpipe->pipe.set_vertex_elements = softpipe_set_vertex_elements; softpipe->pipe.draw_arrays = softpipe_draw_arrays; softpipe->pipe.draw_elements = softpipe_draw_elements; diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index 95def72c54..396d46d4ba 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -45,6 +45,7 @@ struct softpipe_tile_cache; struct softpipe_tex_tile_cache; struct sp_fragment_shader; struct sp_vertex_shader; +struct sp_velems_state; struct softpipe_context { @@ -59,6 +60,7 @@ struct softpipe_context { struct sp_fragment_shader *fs; struct sp_vertex_shader *vs; struct sp_geometry_shader *gs; + struct sp_velems_state *velems; /** Other rendering state */ struct pipe_blend_color blend_color; @@ -72,13 +74,11 @@ struct softpipe_context { struct pipe_texture *vertex_textures[PIPE_MAX_VERTEX_SAMPLERS]; struct pipe_viewport_state viewport; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; - struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; unsigned num_samplers; unsigned num_textures; unsigned num_vertex_samplers; unsigned num_vertex_textures; - unsigned num_vertex_elements; unsigned num_vertex_buffers; unsigned dirty; /**< Mask of SP_NEW_x flags */ diff --git a/src/gallium/drivers/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h index 4370bbeaee..a6b9a841fe 100644 --- a/src/gallium/drivers/softpipe/sp_state.h +++ b/src/gallium/drivers/softpipe/sp_state.h @@ -100,6 +100,11 @@ struct sp_geometry_shader { struct draw_geometry_shader *draw_data; }; +struct sp_velems_state { + unsigned count; + struct pipe_vertex_element velem[]; +}; + void * softpipe_create_blend_state(struct pipe_context *, @@ -160,8 +165,14 @@ void *softpipe_create_gs_state(struct pipe_context *, void softpipe_bind_gs_state(struct pipe_context *, void *); void softpipe_delete_gs_state(struct pipe_context *, void *); +void *softpipe_create_vertex_elements_state(struct pipe_context *, + unsigned count, + const struct pipe_vertex_element *); +void softpipe_bind_vertex_elements_state(struct pipe_context *, void *); +void softpipe_delete_vertex_elements_state(struct pipe_context *, void *); + void softpipe_set_polygon_stipple( struct pipe_context *, - const struct pipe_poly_stipple * ); + const struct pipe_poly_stipple * ); void softpipe_set_scissor_state( struct pipe_context *, const struct pipe_scissor_state * ); @@ -178,10 +189,6 @@ softpipe_set_vertex_sampler_textures(struct pipe_context *, void softpipe_set_viewport_state( struct pipe_context *, const struct pipe_viewport_state * ); -void softpipe_set_vertex_elements(struct pipe_context *, - unsigned count, - const struct pipe_vertex_element *); - void softpipe_set_vertex_buffers(struct pipe_context *, unsigned count, const struct pipe_vertex_buffer *); diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c index b491d92ed1..e7dc3d002b 100644 --- a/src/gallium/drivers/softpipe/sp_state_vertex.c +++ b/src/gallium/drivers/softpipe/sp_state_vertex.c @@ -32,27 +32,44 @@ #include "sp_context.h" #include "sp_state.h" +#include "util/u_memory.h" #include "draw/draw_context.h" +void * +softpipe_create_vertex_elements_state(struct pipe_context *pipe, + unsigned count, + const struct pipe_vertex_element *attribs) +{ + struct sp_velems_state *velems; + assert(count <= PIPE_MAX_ATTRIBS); + velems = (struct sp_velems_state *) MALLOC(sizeof(struct sp_velems_state) + count * sizeof(*attribs)); + if (velems) { + velems->count = count; + memcpy(velems->velem, attribs, sizeof(*attribs) * count); + } + return velems; +} + void -softpipe_set_vertex_elements(struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_element *attribs) +softpipe_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems) { struct softpipe_context *softpipe = softpipe_context(pipe); + struct sp_velems_state *sp_velems = (struct sp_velems_state *) velems; - assert(count <= PIPE_MAX_ATTRIBS); - - memcpy(softpipe->vertex_element, attribs, - count * sizeof(struct pipe_vertex_element)); - softpipe->num_vertex_elements = count; + softpipe->velems = sp_velems; softpipe->dirty |= SP_NEW_VERTEX; - draw_set_vertex_elements(softpipe->draw, count, attribs); + draw_set_vertex_elements(softpipe->draw, sp_velems->count, sp_velems->velem); } +void +softpipe_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) +{ + FREE( velems ); +} void softpipe_set_vertex_buffers(struct pipe_context *pipe, -- cgit v1.2.3 From f89730385532056e89e3b9053c244a67f84e323e Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:46:39 +0100 Subject: llvmpipe: adapt to new vertex element cso --- src/gallium/drivers/llvmpipe/lp_context.c | 5 +++- src/gallium/drivers/llvmpipe/lp_context.h | 4 +-- src/gallium/drivers/llvmpipe/lp_state.h | 16 ++++++++---- src/gallium/drivers/llvmpipe/lp_state_vertex.c | 34 +++++++++++++++++++------- 4 files changed, 42 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index 9120226de0..ccd1cf8eec 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -145,6 +145,10 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv ) llvmpipe->pipe.bind_vs_state = llvmpipe_bind_vs_state; llvmpipe->pipe.delete_vs_state = llvmpipe_delete_vs_state; + llvmpipe->pipe.create_vertex_elements_state = llvmpipe_create_vertex_elements_state; + llvmpipe->pipe.bind_vertex_elements_state = llvmpipe_bind_vertex_elements_state; + llvmpipe->pipe.delete_vertex_elements_state = llvmpipe_delete_vertex_elements_state; + llvmpipe->pipe.set_blend_color = llvmpipe_set_blend_color; llvmpipe->pipe.set_stencil_ref = llvmpipe_set_stencil_ref; llvmpipe->pipe.set_clip_state = llvmpipe_set_clip_state; @@ -157,7 +161,6 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv ) llvmpipe->pipe.set_viewport_state = llvmpipe_set_viewport_state; llvmpipe->pipe.set_vertex_buffers = llvmpipe_set_vertex_buffers; - llvmpipe->pipe.set_vertex_elements = llvmpipe_set_vertex_elements; llvmpipe->pipe.draw_arrays = llvmpipe_draw_arrays; llvmpipe->pipe.draw_elements = llvmpipe_draw_elements; diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 955c7eb8e0..217ec59b68 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -46,6 +46,7 @@ struct lp_fragment_shader; struct lp_vertex_shader; struct lp_blend_state; struct setup_context; +struct lp_velems_state; struct llvmpipe_context { struct pipe_context pipe; /**< base class */ @@ -58,6 +59,7 @@ struct llvmpipe_context { const struct pipe_rasterizer_state *rasterizer; struct lp_fragment_shader *fs; const struct lp_vertex_shader *vs; + const struct lp_velems_state *velems; /** Other rendering state */ struct pipe_blend_color blend_color; @@ -71,13 +73,11 @@ struct llvmpipe_context { struct pipe_texture *vertex_textures[PIPE_MAX_VERTEX_SAMPLERS]; struct pipe_viewport_state viewport; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; - struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; unsigned num_samplers; unsigned num_textures; unsigned num_vertex_samplers; unsigned num_vertex_textures; - unsigned num_vertex_elements; unsigned num_vertex_buffers; unsigned dirty; /**< Mask of LP_NEW_x flags */ diff --git a/src/gallium/drivers/llvmpipe/lp_state.h b/src/gallium/drivers/llvmpipe/lp_state.h index 9beba32271..57f5bd0042 100644 --- a/src/gallium/drivers/llvmpipe/lp_state.h +++ b/src/gallium/drivers/llvmpipe/lp_state.h @@ -119,6 +119,10 @@ struct lp_vertex_shader { struct draw_vertex_shader *draw_data; }; +struct lp_velems_state { + unsigned count; + struct pipe_vertex_element velem[]; +}; void * @@ -176,8 +180,14 @@ void *llvmpipe_create_vs_state(struct pipe_context *, void llvmpipe_bind_vs_state(struct pipe_context *, void *); void llvmpipe_delete_vs_state(struct pipe_context *, void *); +void *llvmpipe_create_vertex_elements_state(struct pipe_context *, + unsigned count, + const struct pipe_vertex_element *); +void llvmpipe_bind_vertex_elements_state(struct pipe_context *, void *); +void llvmpipe_delete_vertex_elements_state(struct pipe_context *, void *); + void llvmpipe_set_polygon_stipple( struct pipe_context *, - const struct pipe_poly_stipple * ); + const struct pipe_poly_stipple * ); void llvmpipe_set_scissor_state( struct pipe_context *, const struct pipe_scissor_state * ); @@ -194,10 +204,6 @@ llvmpipe_set_vertex_sampler_textures(struct pipe_context *, void llvmpipe_set_viewport_state( struct pipe_context *, const struct pipe_viewport_state * ); -void llvmpipe_set_vertex_elements(struct pipe_context *, - unsigned count, - const struct pipe_vertex_element *); - void llvmpipe_set_vertex_buffers(struct pipe_context *, unsigned count, const struct pipe_vertex_buffer *); diff --git a/src/gallium/drivers/llvmpipe/lp_state_vertex.c b/src/gallium/drivers/llvmpipe/lp_state_vertex.c index 57ac25ea0c..5a9b6d5e18 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vertex.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vertex.c @@ -35,24 +35,40 @@ #include "draw/draw_context.h" +void * +llvmpipe_create_vertex_elements_state(struct pipe_context *pipe, + unsigned count, + const struct pipe_vertex_element *attribs) +{ + struct lp_velems_state *velems; + assert(count <= PIPE_MAX_ATTRIBS); + velems = (struct lp_velems_state *) MALLOC(sizeof(struct lp_velems_state) + count * sizeof(*attribs)); + if (velems) { + velems->count = count; + memcpy(velems->velem, attribs, sizeof(*attribs) * count); + } + return velems; +} + void -llvmpipe_set_vertex_elements(struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_element *attribs) +llvmpipe_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems) { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); + struct lp_velems_state *lp_velems = (struct lp_velems_state *) velems; - assert(count <= PIPE_MAX_ATTRIBS); - - memcpy(llvmpipe->vertex_element, attribs, - count * sizeof(struct pipe_vertex_element)); - llvmpipe->num_vertex_elements = count; + llvmpipe->velems = lp_velems; llvmpipe->dirty |= LP_NEW_VERTEX; - draw_set_vertex_elements(llvmpipe->draw, count, attribs); + draw_set_vertex_elements(llvmpipe->draw, lp_velems->count, lp_velems->velem); } +void +llvmpipe_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) +{ + FREE( velems ); +} void llvmpipe_set_vertex_buffers(struct pipe_context *pipe, -- cgit v1.2.3 From e9441e1f88cc07365f4d7d9149ccefe128809645 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:46:49 +0100 Subject: r300g: adapt to new vertex element cso --- src/gallium/drivers/r300/r300_blit.c | 1 + src/gallium/drivers/r300/r300_context.h | 8 +++-- src/gallium/drivers/r300/r300_emit.c | 4 +-- src/gallium/drivers/r300/r300_render.c | 12 ++++---- src/gallium/drivers/r300/r300_state.c | 44 +++++++++++++++++++-------- src/gallium/drivers/r300/r300_state_derived.c | 6 ++-- 6 files changed, 50 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index eb9b0beeb5..2f9650df1b 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -34,6 +34,7 @@ static void r300_blitter_save_states(struct r300_context* r300) util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state); util_blitter_save_fragment_shader(r300->blitter, r300->fs); util_blitter_save_vertex_shader(r300->blitter, r300->vs); + util_blitter_save_vertex_elements(r300->blitter, r300->vs); } /* Clear currently bound buffers. */ diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 1eba8a8ed1..0ee0ab47a6 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -247,6 +247,11 @@ struct r300_vertex_info { uint32_t vap_prog_stream_cntl_ext[8]; }; +struct r300_velems_state { + unsigned count; + struct pipe_vertex_element velem[]; +}; + extern struct pipe_viewport_state r300_viewport_identity; struct r300_context { @@ -317,8 +322,7 @@ struct r300_context { struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; int vertex_buffer_count; /* Vertex elements for Gallium. */ - struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; - int vertex_element_count; + struct r300_velems_state *velems; struct pipe_stencil_ref stencil_ref; diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 88fe166359..fa3df9a23b 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -776,9 +776,9 @@ void r300_emit_texture(struct r300_context* r300, void r300_emit_aos(struct r300_context* r300, unsigned offset) { struct pipe_vertex_buffer *vb1, *vb2, *vbuf = r300->vertex_buffer; - struct pipe_vertex_element *velem = r300->vertex_element; + struct pipe_vertex_element *velem = r300->velems->velem; int i; - unsigned size1, size2, aos_count = r300->vertex_element_count; + unsigned size1, size2, aos_count = r300->velems->count; unsigned packet_size = (aos_count * 3 + 1) / 2; CS_LOCALS(r300); diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index cd4971ae13..1850a6f247 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -128,7 +128,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, { struct pipe_vertex_element* velem; struct pipe_vertex_buffer* vbuf; - unsigned vertex_element_count = r300->vertex_element_count; + unsigned vertex_element_count = r300->velems->count; unsigned i, v, vbi, dw, elem_offset; /* Size of the vertex, in dwords. */ @@ -151,7 +151,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, /* Calculate the vertex size, offsets, strides etc. and map the buffers. */ for (i = 0; i < vertex_element_count; i++) { - velem = &r300->vertex_element[i]; + velem = &r300->velems->velem[i]; offset[i] = velem->src_offset / 4; size[i] = util_format_get_blocksize(velem->src_format) / 4; vertex_size += size[i]; @@ -183,7 +183,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, /* Emit vertices. */ for (v = 0; v < count; v++) { for (i = 0; i < vertex_element_count; i++) { - velem = &r300->vertex_element[i]; + velem = &r300->velems->velem[i]; vbi = velem->vertex_buffer_index; elem_offset = offset[i] + stride[vbi] * (v + start); @@ -196,7 +196,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, /* Unmap buffers. */ for (i = 0; i < vertex_element_count; i++) { - vbi = r300->vertex_element[i].vertex_buffer_index; + vbi = r300->velems->velem[i].vertex_buffer_index; if (map[vbi]) { vbuf = &r300->vertex_buffer[vbi]; @@ -278,11 +278,11 @@ static void r300_emit_draw_elements(struct r300_context *r300, static boolean r300_setup_vertex_buffers(struct r300_context *r300) { struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; - struct pipe_vertex_element *velem = r300->vertex_element; + struct pipe_vertex_element *velem = r300->velems->velem; struct pipe_buffer *pbuf; validate: - for (int i = 0; i < r300->vertex_element_count; i++) { + for (int i = 0; i < r300->velems->count; i++) { pbuf = vbuf[velem[i].vertex_buffer_index].buffer; if (!r300->winsys->add_buffer(r300->winsys, pbuf, diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 34bf81c193..ceac690fc4 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1044,11 +1044,11 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, static boolean r300_validate_aos(struct r300_context *r300) { struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; - struct pipe_vertex_element *velem = r300->vertex_element; + struct pipe_vertex_element *velem = r300->velems->velem; int i; /* Check if formats and strides are aligned to the size of DWORD. */ - for (i = 0; i < r300->vertex_element_count; i++) { + for (i = 0; i < r300->velems->count; i++) { if (vbuf[velem[i].vertex_buffer_index].stride % 4 != 0 || util_format_get_blocksize(velem[i].src_format) % 4 != 0) { return FALSE; @@ -1057,20 +1057,32 @@ static boolean r300_validate_aos(struct r300_context *r300) return TRUE; } -static void r300_set_vertex_elements(struct pipe_context* pipe, - unsigned count, - const struct pipe_vertex_element* elements) +static void* r300_create_vertex_elements_state(struct pipe_context* pipe, + unsigned count, + const struct pipe_vertex_element* attribs) { - struct r300_context* r300 = r300_context(pipe); + /*XXX could precalculate state here instead of later */ + struct r300_velems_state *velems; + assert(count <= PIPE_MAX_ATTRIBS); + velems = (struct r300_velems_state *) MALLOC(sizeof(struct r300_velems_state) + count * sizeof(*attribs)); + if (velems) { + velems->count = count; + memcpy(velems->velem, attribs, sizeof(*attribs) * count); + } + return velems; +} + +static void r300_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems) +{ + struct r300_context *r300 = r300_context(pipe); + struct r300_velems_state *r300_velems = (struct r300_velems_state *) velems; - memcpy(r300->vertex_element, - elements, - sizeof(struct pipe_vertex_element) * count); - r300->vertex_element_count = count; + r300->velems = r300_velems; if (r300->draw) { draw_flush(r300->draw); - draw_set_vertex_elements(r300->draw, count, elements); + draw_set_vertex_elements(r300->draw, r300_velems->count, r300_velems->velem); } if (!r300_validate_aos(r300)) { @@ -1080,6 +1092,11 @@ static void r300_set_vertex_elements(struct pipe_context* pipe, } } +static void r300_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) +{ + FREE( velems ); +} + static void* r300_create_vs_state(struct pipe_context* pipe, const struct pipe_shader_state* shader) { @@ -1241,7 +1258,10 @@ void r300_init_state_functions(struct r300_context* r300) r300->context.set_viewport_state = r300_set_viewport_state; r300->context.set_vertex_buffers = r300_set_vertex_buffers; - r300->context.set_vertex_elements = r300_set_vertex_elements; + + r300->context.create_vertex_elements_state = r300_create_vertex_elements_state; + r300->context.bind_vertex_elements_state = r300_bind_vertex_elements_state; + r300->context.delete_vertex_elements_state = r300_delete_vertex_elements_state; r300->context.create_vs_state = r300_create_vs_state; r300->context.bind_vs_state = r300_bind_vs_state; diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 2cbce9210a..c43a93601c 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -128,10 +128,10 @@ static void r300_vertex_psc(struct r300_context* r300) DBG(r300, DBG_DRAW, "r300: vs expects %d attribs, routing %d elements" " in psc\n", r300->vs->info.num_inputs, - r300->vertex_element_count); + r300->velems->count); - for (i = 0; i < r300->vertex_element_count; i++) { - format = r300->vertex_element[i].src_format; + for (i = 0; i < r300->velems->count; i++) { + format = r300->velems->velem[i].src_format; type = r300_translate_vertex_data_type(format) | (stream_tab[i] << R300_DST_VEC_LOC_SHIFT); -- cgit v1.2.3 From 4dfe2df6296745e054db6c83cdd122417a3e3764 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:47:04 +0100 Subject: cell: adapt to new vertex element cso --- src/gallium/drivers/cell/ppu/cell_context.h | 8 +++-- src/gallium/drivers/cell/ppu/cell_state_vertex.c | 41 ++++++++++++++++++------ 2 files changed, 37 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_context.h b/src/gallium/drivers/cell/ppu/cell_context.h index a77cc5b906..84ad0f3422 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.h +++ b/src/gallium/drivers/cell/ppu/cell_context.h @@ -93,6 +93,11 @@ struct cell_buffer_list struct cell_buffer_node *head; }; +struct cell_velems_state +{ + unsigned count; + struct pipe_vertex_element velem[]; +} /** * Per-context state, subclass of pipe_context. @@ -110,6 +115,7 @@ struct cell_context const struct pipe_rasterizer_state *rasterizer; const struct cell_vertex_shader_state *vs; const struct cell_fragment_shader_state *fs; + const struct cell_velems_state *velems; struct spe_function logic_op; @@ -125,8 +131,6 @@ struct cell_context struct pipe_viewport_state viewport; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; uint num_vertex_buffers; - struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; - uint num_vertex_elements; ubyte *cbuf_map[PIPE_MAX_COLOR_BUFS]; ubyte *zsbuf_map; diff --git a/src/gallium/drivers/cell/ppu/cell_state_vertex.c b/src/gallium/drivers/cell/ppu/cell_state_vertex.c index fbe55c8472..35c919fb6b 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_vertex.c +++ b/src/gallium/drivers/cell/ppu/cell_state_vertex.c @@ -32,24 +32,43 @@ #include "cell_context.h" #include "cell_state.h" +#include "util/u_memory.h" #include "draw/draw_context.h" -static void -cell_set_vertex_elements(struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_element *elements) +void * +cell_create_vertex_elements_state(struct pipe_context *pipe, + unsigned count, + const struct pipe_vertex_element *attribs) { - struct cell_context *cell = cell_context(pipe); - + struct cell_velems_state *velems; assert(count <= PIPE_MAX_ATTRIBS); + velems = (struct cell_velems_state *) MALLOC(sizeof(struct cell_velems_state) + count * sizeof(*attribs)); + if (velems) { + velems->count = count; + memcpy(velems->velem, attribs, sizeof(*attribs) * count); + } + return velems; +} + +void +cell_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems) +{ + struct cell_context *cell = cell_context(pipe); + struct cell_velems_state *cell_velems = (struct cell_velems_state *) velems; - memcpy(cell->vertex_element, elements, count * sizeof(elements[0])); - cell->num_vertex_elements = count; + cell->velems = cell_velems; cell->dirty |= CELL_NEW_VERTEX; - draw_set_vertex_elements(cell->draw, count, elements); + draw_set_vertex_elements(cell->draw, cell_velems->count, cell_velems->velem); +} + +void +cell_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) +{ + FREE( velems ); } @@ -75,5 +94,7 @@ void cell_init_vertex_functions(struct cell_context *cell) { cell->pipe.set_vertex_buffers = cell_set_vertex_buffers; - cell->pipe.set_vertex_elements = cell_set_vertex_elements; + cell->pipe.create_vertex_elements_state = cell_create_vertex_elements_state; + cell->pipe.bind_vertex_elements_state = cell_bind_vertex_elements_state; + cell->pipe.delete_vertex_elements_state = cell_delete_vertex_elements_state; } -- cgit v1.2.3 From 8e2df0dcb92b7b092b35df3d35591c31d5f2ca5f Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:47:17 +0100 Subject: i915g: adapt to new vertex element cso --- src/gallium/drivers/i915/i915_context.h | 8 ++++++-- src/gallium/drivers/i915/i915_state.c | 35 +++++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index da769e7b29..369c63eece 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -148,7 +148,7 @@ struct i915_state /** Describes the current hardware vertex layout */ struct vertex_info vertex_info; - + unsigned id; /* track lost context events */ }; @@ -187,6 +187,11 @@ struct i915_sampler_state { unsigned maxlod; }; +struct i915_velems_state { + unsigned count; + struct pipe_vertex_element velem[]; +}; + struct i915_texture { struct pipe_texture base; @@ -247,7 +252,6 @@ struct i915_context unsigned num_samplers; unsigned num_textures; - unsigned num_vertex_elements; unsigned num_vertex_buffers; struct intel_batchbuffer *batch; diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 62169918e2..46406065c3 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -742,21 +742,42 @@ static void i915_set_vertex_buffers(struct pipe_context *pipe, draw_set_vertex_buffers(i915->draw, count, buffers); } -static void i915_set_vertex_elements(struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_element *elements) +static void * +i915_create_vertex_elements_state(struct pipe_context *pipe, + unsigned count, + const struct pipe_vertex_element *attribs) +{ + struct i915_velems_state *velems; + assert(count <= PIPE_MAX_ATTRIBS); + velems = (struct i915_velems_state *) MALLOC(sizeof(struct i915_velems_state) + count * sizeof(*attribs)); + if (velems) { + velems->count = count; + memcpy(velems->velem, attribs, sizeof(*attribs) * count); + } + return velems; +} + +static void +i915_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems) { struct i915_context *i915 = i915_context(pipe); + struct i915_velems_state *i915_velems = (struct i915_velems_state *) velems; + /* Because we change state before the draw_set_vertex_buffers call * we need a flush here, just to be sure. */ draw_flush(i915->draw); - i915->num_vertex_elements = count; /* pass-through to draw module */ - draw_set_vertex_elements(i915->draw, count, elements); + draw_set_vertex_elements(i915->draw, i915_velems->count, i915_velems->velem); } +static void +i915_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) +{ + FREE( velems ); +} void i915_init_state_functions( struct i915_context *i915 ) @@ -782,6 +803,9 @@ i915_init_state_functions( struct i915_context *i915 ) i915->base.create_vs_state = i915_create_vs_state; i915->base.bind_vs_state = i915_bind_vs_state; i915->base.delete_vs_state = i915_delete_vs_state; + i915->base.create_vertex_elements_state = i915_create_vertex_elements_state; + i915->base.bind_vertex_elements_state = i915_bind_vertex_elements_state; + i915->base.delete_vertex_elements_state = i915_delete_vertex_elements_state; i915->base.set_blend_color = i915_set_blend_color; i915->base.set_stencil_ref = i915_set_stencil_ref; @@ -794,5 +818,4 @@ i915_init_state_functions( struct i915_context *i915 ) i915->base.set_fragment_sampler_textures = i915_set_sampler_textures; i915->base.set_viewport_state = i915_set_viewport_state; i915->base.set_vertex_buffers = i915_set_vertex_buffers; - i915->base.set_vertex_elements = i915_set_vertex_elements; } -- cgit v1.2.3 From 470dbb84b8e892bf6d5a9136b40dd68f5b146a05 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:47:28 +0100 Subject: i965g: adapt to new vertex element cso --- src/gallium/drivers/i965/brw_context.h | 5 +- src/gallium/drivers/i965/brw_draw_upload.c | 211 +----------------------- src/gallium/drivers/i965/brw_pipe_vertex.c | 247 ++++++++++++++++++++++++++++- src/gallium/drivers/i965/brw_structs.h | 4 +- 4 files changed, 251 insertions(+), 216 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_context.h b/src/gallium/drivers/i965/brw_context.h index 12cfa7b049..f5b1a06576 100644 --- a/src/gallium/drivers/i965/brw_context.h +++ b/src/gallium/drivers/i965/brw_context.h @@ -351,7 +351,7 @@ struct brw_vs_prog_data { /* Size == 0 if output either not written, or always [0,0,0,1] */ -struct brw_vs_ouput_sizes { +struct brw_vs_output_sizes { GLubyte output_size[PIPE_MAX_SHADER_OUTPUTS]; }; @@ -546,14 +546,13 @@ struct brw_context const struct brw_blend_state *blend; const struct brw_rasterizer_state *rast; const struct brw_depth_stencil_state *zstencil; + const struct brw_vertex_element_packet *velems; const struct brw_sampler *sampler[PIPE_MAX_SAMPLERS]; unsigned num_samplers; struct pipe_texture *texture[PIPE_MAX_SAMPLERS]; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; - struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; - unsigned num_vertex_elements; unsigned num_textures; unsigned num_vertex_buffers; diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c index 9eafdd4085..0820ba20a0 100644 --- a/src/gallium/drivers/i965/brw_draw_upload.c +++ b/src/gallium/drivers/i965/brw_draw_upload.c @@ -30,7 +30,6 @@ #include "util/u_upload_mgr.h" #include "util/u_math.h" -#include "util/u_format.h" #include "brw_draw.h" #include "brw_defines.h" @@ -43,141 +42,6 @@ -static unsigned brw_translate_surface_format( unsigned id ) -{ - switch (id) { - case PIPE_FORMAT_R64_FLOAT: - return BRW_SURFACEFORMAT_R64_FLOAT; - case PIPE_FORMAT_R64G64_FLOAT: - return BRW_SURFACEFORMAT_R64G64_FLOAT; - case PIPE_FORMAT_R64G64B64_FLOAT: - return BRW_SURFACEFORMAT_R64G64B64_FLOAT; - case PIPE_FORMAT_R64G64B64A64_FLOAT: - return BRW_SURFACEFORMAT_R64G64B64A64_FLOAT; - - case PIPE_FORMAT_R32_FLOAT: - return BRW_SURFACEFORMAT_R32_FLOAT; - case PIPE_FORMAT_R32G32_FLOAT: - return BRW_SURFACEFORMAT_R32G32_FLOAT; - case PIPE_FORMAT_R32G32B32_FLOAT: - return BRW_SURFACEFORMAT_R32G32B32_FLOAT; - case PIPE_FORMAT_R32G32B32A32_FLOAT: - return BRW_SURFACEFORMAT_R32G32B32A32_FLOAT; - - case PIPE_FORMAT_R32_UNORM: - return BRW_SURFACEFORMAT_R32_UNORM; - case PIPE_FORMAT_R32G32_UNORM: - return BRW_SURFACEFORMAT_R32G32_UNORM; - case PIPE_FORMAT_R32G32B32_UNORM: - return BRW_SURFACEFORMAT_R32G32B32_UNORM; - case PIPE_FORMAT_R32G32B32A32_UNORM: - return BRW_SURFACEFORMAT_R32G32B32A32_UNORM; - - case PIPE_FORMAT_R32_USCALED: - return BRW_SURFACEFORMAT_R32_USCALED; - case PIPE_FORMAT_R32G32_USCALED: - return BRW_SURFACEFORMAT_R32G32_USCALED; - case PIPE_FORMAT_R32G32B32_USCALED: - return BRW_SURFACEFORMAT_R32G32B32_USCALED; - case PIPE_FORMAT_R32G32B32A32_USCALED: - return BRW_SURFACEFORMAT_R32G32B32A32_USCALED; - - case PIPE_FORMAT_R32_SNORM: - return BRW_SURFACEFORMAT_R32_SNORM; - case PIPE_FORMAT_R32G32_SNORM: - return BRW_SURFACEFORMAT_R32G32_SNORM; - case PIPE_FORMAT_R32G32B32_SNORM: - return BRW_SURFACEFORMAT_R32G32B32_SNORM; - case PIPE_FORMAT_R32G32B32A32_SNORM: - return BRW_SURFACEFORMAT_R32G32B32A32_SNORM; - - case PIPE_FORMAT_R32_SSCALED: - return BRW_SURFACEFORMAT_R32_SSCALED; - case PIPE_FORMAT_R32G32_SSCALED: - return BRW_SURFACEFORMAT_R32G32_SSCALED; - case PIPE_FORMAT_R32G32B32_SSCALED: - return BRW_SURFACEFORMAT_R32G32B32_SSCALED; - case PIPE_FORMAT_R32G32B32A32_SSCALED: - return BRW_SURFACEFORMAT_R32G32B32A32_SSCALED; - - case PIPE_FORMAT_R16_UNORM: - return BRW_SURFACEFORMAT_R16_UNORM; - case PIPE_FORMAT_R16G16_UNORM: - return BRW_SURFACEFORMAT_R16G16_UNORM; - case PIPE_FORMAT_R16G16B16_UNORM: - return BRW_SURFACEFORMAT_R16G16B16_UNORM; - case PIPE_FORMAT_R16G16B16A16_UNORM: - return BRW_SURFACEFORMAT_R16G16B16A16_UNORM; - - case PIPE_FORMAT_R16_USCALED: - return BRW_SURFACEFORMAT_R16_USCALED; - case PIPE_FORMAT_R16G16_USCALED: - return BRW_SURFACEFORMAT_R16G16_USCALED; - case PIPE_FORMAT_R16G16B16_USCALED: - return BRW_SURFACEFORMAT_R16G16B16_USCALED; - case PIPE_FORMAT_R16G16B16A16_USCALED: - return BRW_SURFACEFORMAT_R16G16B16A16_USCALED; - - case PIPE_FORMAT_R16_SNORM: - return BRW_SURFACEFORMAT_R16_SNORM; - case PIPE_FORMAT_R16G16_SNORM: - return BRW_SURFACEFORMAT_R16G16_SNORM; - case PIPE_FORMAT_R16G16B16_SNORM: - return BRW_SURFACEFORMAT_R16G16B16_SNORM; - case PIPE_FORMAT_R16G16B16A16_SNORM: - return BRW_SURFACEFORMAT_R16G16B16A16_SNORM; - - case PIPE_FORMAT_R16_SSCALED: - return BRW_SURFACEFORMAT_R16_SSCALED; - case PIPE_FORMAT_R16G16_SSCALED: - return BRW_SURFACEFORMAT_R16G16_SSCALED; - case PIPE_FORMAT_R16G16B16_SSCALED: - return BRW_SURFACEFORMAT_R16G16B16_SSCALED; - case PIPE_FORMAT_R16G16B16A16_SSCALED: - return BRW_SURFACEFORMAT_R16G16B16A16_SSCALED; - - case PIPE_FORMAT_R8_UNORM: - return BRW_SURFACEFORMAT_R8_UNORM; - case PIPE_FORMAT_R8G8_UNORM: - return BRW_SURFACEFORMAT_R8G8_UNORM; - case PIPE_FORMAT_R8G8B8_UNORM: - return BRW_SURFACEFORMAT_R8G8B8_UNORM; - case PIPE_FORMAT_R8G8B8A8_UNORM: - return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; - - case PIPE_FORMAT_R8_USCALED: - return BRW_SURFACEFORMAT_R8_USCALED; - case PIPE_FORMAT_R8G8_USCALED: - return BRW_SURFACEFORMAT_R8G8_USCALED; - case PIPE_FORMAT_R8G8B8_USCALED: - return BRW_SURFACEFORMAT_R8G8B8_USCALED; - case PIPE_FORMAT_R8G8B8A8_USCALED: - return BRW_SURFACEFORMAT_R8G8B8A8_USCALED; - - case PIPE_FORMAT_R8_SNORM: - return BRW_SURFACEFORMAT_R8_SNORM; - case PIPE_FORMAT_R8G8_SNORM: - return BRW_SURFACEFORMAT_R8G8_SNORM; - case PIPE_FORMAT_R8G8B8_SNORM: - return BRW_SURFACEFORMAT_R8G8B8_SNORM; - case PIPE_FORMAT_R8G8B8A8_SNORM: - return BRW_SURFACEFORMAT_R8G8B8A8_SNORM; - - case PIPE_FORMAT_R8_SSCALED: - return BRW_SURFACEFORMAT_R8_SSCALED; - case PIPE_FORMAT_R8G8_SSCALED: - return BRW_SURFACEFORMAT_R8G8_SSCALED; - case PIPE_FORMAT_R8G8B8_SSCALED: - return BRW_SURFACEFORMAT_R8G8B8_SSCALED; - case PIPE_FORMAT_R8G8B8A8_SSCALED: - return BRW_SURFACEFORMAT_R8G8B8A8_SSCALED; - - default: - assert(0); - return 0; - } -} - static unsigned get_index_type(int type) { switch (type) { @@ -316,77 +180,16 @@ static int brw_emit_vertex_buffers( struct brw_context *brw ) - static int brw_emit_vertex_elements(struct brw_context *brw) { - GLuint nr = brw->curr.num_vertex_elements; - GLuint i; + const struct brw_vertex_element_packet *brw_velems = brw->curr.velems; + unsigned size = brw_velems->header.length + 2; + /* why is this here */ brw_emit_query_begin(brw); - /* If the VS doesn't read any inputs (calculating vertex position from - * a state variable for some reason, for example), emit a single pad - * VERTEX_ELEMENT struct and bail. - * - * The stale VB state stays in place, but they don't do anything unless - * a VE loads from them. - */ - if (nr == 0) { - BEGIN_BATCH(3, IGNORE_CLIPRECTS); - OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | 1); - OUT_BATCH((0 << BRW_VE0_INDEX_SHIFT) | - BRW_VE0_VALID | - (BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) | - (0 << BRW_VE0_SRC_OFFSET_SHIFT)); - OUT_BATCH((BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_0_SHIFT) | - (BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_1_SHIFT) | - (BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_2_SHIFT) | - (BRW_VE1_COMPONENT_STORE_1_FLT << BRW_VE1_COMPONENT_3_SHIFT)); - ADVANCE_BATCH(); - return 0; - } - - /* Now emit vertex element (VEP) state packets. - * - */ - BEGIN_BATCH(1 + nr * 2, IGNORE_CLIPRECTS); - OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + nr * 2) - 2)); - for (i = 0; i < nr; i++) { - const struct pipe_vertex_element *input = &brw->curr.vertex_element[i]; - unsigned nr_components = util_format_get_nr_components(input->src_format); - - uint32_t format = brw_translate_surface_format( input->src_format ); - uint32_t comp0 = BRW_VE1_COMPONENT_STORE_SRC; - uint32_t comp1 = BRW_VE1_COMPONENT_STORE_SRC; - uint32_t comp2 = BRW_VE1_COMPONENT_STORE_SRC; - uint32_t comp3 = BRW_VE1_COMPONENT_STORE_SRC; - - switch (nr_components) { - case 0: comp0 = BRW_VE1_COMPONENT_STORE_0; - case 1: comp1 = BRW_VE1_COMPONENT_STORE_0; - case 2: comp2 = BRW_VE1_COMPONENT_STORE_0; - case 3: comp3 = BRW_VE1_COMPONENT_STORE_1_FLT; - break; - } - - OUT_BATCH((input->vertex_buffer_index << BRW_VE0_INDEX_SHIFT) | - BRW_VE0_VALID | - (format << BRW_VE0_FORMAT_SHIFT) | - (input->src_offset << BRW_VE0_SRC_OFFSET_SHIFT)); + brw_batchbuffer_data(brw->batch, brw_velems, size * 4, IGNORE_CLIPRECTS); - if (BRW_IS_IGDNG(brw)) - OUT_BATCH((comp0 << BRW_VE1_COMPONENT_0_SHIFT) | - (comp1 << BRW_VE1_COMPONENT_1_SHIFT) | - (comp2 << BRW_VE1_COMPONENT_2_SHIFT) | - (comp3 << BRW_VE1_COMPONENT_3_SHIFT)); - else - OUT_BATCH((comp0 << BRW_VE1_COMPONENT_0_SHIFT) | - (comp1 << BRW_VE1_COMPONENT_1_SHIFT) | - (comp2 << BRW_VE1_COMPONENT_2_SHIFT) | - (comp3 << BRW_VE1_COMPONENT_3_SHIFT) | - ((i * 4) << BRW_VE1_DST_OFFSET_SHIFT)); - } - ADVANCE_BATCH(); return 0; } @@ -399,10 +202,11 @@ static int brw_emit_vertices( struct brw_context *brw ) if (ret) return ret; + /* XXX should separate this? */ ret = brw_emit_vertex_elements( brw ); if (ret) return ret; - + return 0; } @@ -410,7 +214,8 @@ static int brw_emit_vertices( struct brw_context *brw ) const struct brw_tracked_state brw_vertices = { .dirty = { .mesa = (PIPE_NEW_INDEX_RANGE | - PIPE_NEW_VERTEX_BUFFER), + PIPE_NEW_VERTEX_BUFFER | + PIPE_NEW_VERTEX_ELEMENT), .brw = BRW_NEW_BATCH, .cache = 0, }, diff --git a/src/gallium/drivers/i965/brw_pipe_vertex.c b/src/gallium/drivers/i965/brw_pipe_vertex.c index e3c48e3149..3d84fb86fb 100644 --- a/src/gallium/drivers/i965/brw_pipe_vertex.c +++ b/src/gallium/drivers/i965/brw_pipe_vertex.c @@ -1,22 +1,251 @@ #include "brw_context.h" +#include "brw_defines.h" +#include "brw_structs.h" +#include "util/u_memory.h" +#include "util/u_format.h" -static void brw_set_vertex_elements( struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_element *elements ) + +static unsigned brw_translate_surface_format( unsigned id ) +{ + switch (id) { + case PIPE_FORMAT_R64_FLOAT: + return BRW_SURFACEFORMAT_R64_FLOAT; + case PIPE_FORMAT_R64G64_FLOAT: + return BRW_SURFACEFORMAT_R64G64_FLOAT; + case PIPE_FORMAT_R64G64B64_FLOAT: + return BRW_SURFACEFORMAT_R64G64B64_FLOAT; + case PIPE_FORMAT_R64G64B64A64_FLOAT: + return BRW_SURFACEFORMAT_R64G64B64A64_FLOAT; + + case PIPE_FORMAT_R32_FLOAT: + return BRW_SURFACEFORMAT_R32_FLOAT; + case PIPE_FORMAT_R32G32_FLOAT: + return BRW_SURFACEFORMAT_R32G32_FLOAT; + case PIPE_FORMAT_R32G32B32_FLOAT: + return BRW_SURFACEFORMAT_R32G32B32_FLOAT; + case PIPE_FORMAT_R32G32B32A32_FLOAT: + return BRW_SURFACEFORMAT_R32G32B32A32_FLOAT; + + case PIPE_FORMAT_R32_UNORM: + return BRW_SURFACEFORMAT_R32_UNORM; + case PIPE_FORMAT_R32G32_UNORM: + return BRW_SURFACEFORMAT_R32G32_UNORM; + case PIPE_FORMAT_R32G32B32_UNORM: + return BRW_SURFACEFORMAT_R32G32B32_UNORM; + case PIPE_FORMAT_R32G32B32A32_UNORM: + return BRW_SURFACEFORMAT_R32G32B32A32_UNORM; + + case PIPE_FORMAT_R32_USCALED: + return BRW_SURFACEFORMAT_R32_USCALED; + case PIPE_FORMAT_R32G32_USCALED: + return BRW_SURFACEFORMAT_R32G32_USCALED; + case PIPE_FORMAT_R32G32B32_USCALED: + return BRW_SURFACEFORMAT_R32G32B32_USCALED; + case PIPE_FORMAT_R32G32B32A32_USCALED: + return BRW_SURFACEFORMAT_R32G32B32A32_USCALED; + + case PIPE_FORMAT_R32_SNORM: + return BRW_SURFACEFORMAT_R32_SNORM; + case PIPE_FORMAT_R32G32_SNORM: + return BRW_SURFACEFORMAT_R32G32_SNORM; + case PIPE_FORMAT_R32G32B32_SNORM: + return BRW_SURFACEFORMAT_R32G32B32_SNORM; + case PIPE_FORMAT_R32G32B32A32_SNORM: + return BRW_SURFACEFORMAT_R32G32B32A32_SNORM; + + case PIPE_FORMAT_R32_SSCALED: + return BRW_SURFACEFORMAT_R32_SSCALED; + case PIPE_FORMAT_R32G32_SSCALED: + return BRW_SURFACEFORMAT_R32G32_SSCALED; + case PIPE_FORMAT_R32G32B32_SSCALED: + return BRW_SURFACEFORMAT_R32G32B32_SSCALED; + case PIPE_FORMAT_R32G32B32A32_SSCALED: + return BRW_SURFACEFORMAT_R32G32B32A32_SSCALED; + + case PIPE_FORMAT_R16_UNORM: + return BRW_SURFACEFORMAT_R16_UNORM; + case PIPE_FORMAT_R16G16_UNORM: + return BRW_SURFACEFORMAT_R16G16_UNORM; + case PIPE_FORMAT_R16G16B16_UNORM: + return BRW_SURFACEFORMAT_R16G16B16_UNORM; + case PIPE_FORMAT_R16G16B16A16_UNORM: + return BRW_SURFACEFORMAT_R16G16B16A16_UNORM; + + case PIPE_FORMAT_R16_USCALED: + return BRW_SURFACEFORMAT_R16_USCALED; + case PIPE_FORMAT_R16G16_USCALED: + return BRW_SURFACEFORMAT_R16G16_USCALED; + case PIPE_FORMAT_R16G16B16_USCALED: + return BRW_SURFACEFORMAT_R16G16B16_USCALED; + case PIPE_FORMAT_R16G16B16A16_USCALED: + return BRW_SURFACEFORMAT_R16G16B16A16_USCALED; + + case PIPE_FORMAT_R16_SNORM: + return BRW_SURFACEFORMAT_R16_SNORM; + case PIPE_FORMAT_R16G16_SNORM: + return BRW_SURFACEFORMAT_R16G16_SNORM; + case PIPE_FORMAT_R16G16B16_SNORM: + return BRW_SURFACEFORMAT_R16G16B16_SNORM; + case PIPE_FORMAT_R16G16B16A16_SNORM: + return BRW_SURFACEFORMAT_R16G16B16A16_SNORM; + + case PIPE_FORMAT_R16_SSCALED: + return BRW_SURFACEFORMAT_R16_SSCALED; + case PIPE_FORMAT_R16G16_SSCALED: + return BRW_SURFACEFORMAT_R16G16_SSCALED; + case PIPE_FORMAT_R16G16B16_SSCALED: + return BRW_SURFACEFORMAT_R16G16B16_SSCALED; + case PIPE_FORMAT_R16G16B16A16_SSCALED: + return BRW_SURFACEFORMAT_R16G16B16A16_SSCALED; + + case PIPE_FORMAT_R8_UNORM: + return BRW_SURFACEFORMAT_R8_UNORM; + case PIPE_FORMAT_R8G8_UNORM: + return BRW_SURFACEFORMAT_R8G8_UNORM; + case PIPE_FORMAT_R8G8B8_UNORM: + return BRW_SURFACEFORMAT_R8G8B8_UNORM; + case PIPE_FORMAT_R8G8B8A8_UNORM: + return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; + + case PIPE_FORMAT_R8_USCALED: + return BRW_SURFACEFORMAT_R8_USCALED; + case PIPE_FORMAT_R8G8_USCALED: + return BRW_SURFACEFORMAT_R8G8_USCALED; + case PIPE_FORMAT_R8G8B8_USCALED: + return BRW_SURFACEFORMAT_R8G8B8_USCALED; + case PIPE_FORMAT_R8G8B8A8_USCALED: + return BRW_SURFACEFORMAT_R8G8B8A8_USCALED; + + case PIPE_FORMAT_R8_SNORM: + return BRW_SURFACEFORMAT_R8_SNORM; + case PIPE_FORMAT_R8G8_SNORM: + return BRW_SURFACEFORMAT_R8G8_SNORM; + case PIPE_FORMAT_R8G8B8_SNORM: + return BRW_SURFACEFORMAT_R8G8B8_SNORM; + case PIPE_FORMAT_R8G8B8A8_SNORM: + return BRW_SURFACEFORMAT_R8G8B8A8_SNORM; + + case PIPE_FORMAT_R8_SSCALED: + return BRW_SURFACEFORMAT_R8_SSCALED; + case PIPE_FORMAT_R8G8_SSCALED: + return BRW_SURFACEFORMAT_R8G8_SSCALED; + case PIPE_FORMAT_R8G8B8_SSCALED: + return BRW_SURFACEFORMAT_R8G8B8_SSCALED; + case PIPE_FORMAT_R8G8B8A8_SSCALED: + return BRW_SURFACEFORMAT_R8G8B8A8_SSCALED; + + default: + assert(0); + return 0; + } +} + +static void brw_translate_vertex_elements(struct brw_context *brw, + struct brw_vertex_element_packet *brw_velems, + const struct pipe_vertex_element *attribs, + unsigned count) +{ + unsigned i; + + /* If the VS doesn't read any inputs (calculating vertex position from + * a state variable for some reason, for example), emit a single pad + * VERTEX_ELEMENT struct and bail. + * + * The stale VB state stays in place, but they don't do anything unless + * a VE loads from them. + */ + brw_velems->header.opcode = CMD_VERTEX_ELEMENT; + + if (count == 0) { + brw_velems->header.length = 1; + brw_velems->ve[0].ve0.src_offset = 0; + brw_velems->ve[0].ve0.src_format = BRW_SURFACEFORMAT_R32G32B32A32_FLOAT; + brw_velems->ve[0].ve0.valid = 1; + brw_velems->ve[0].ve0.vertex_buffer_index = 0; + brw_velems->ve[0].ve1.dst_offset = 0; + brw_velems->ve[0].ve1.vfcomponent0 = BRW_VE1_COMPONENT_STORE_0; + brw_velems->ve[0].ve1.vfcomponent1 = BRW_VE1_COMPONENT_STORE_0; + brw_velems->ve[0].ve1.vfcomponent2 = BRW_VE1_COMPONENT_STORE_0; + brw_velems->ve[0].ve1.vfcomponent3 = BRW_VE1_COMPONENT_STORE_1_FLT; + return; + } + + + /* Now emit vertex element (VEP) state packets. + * + */ + brw_velems->header.length = (1 + count * 2) - 2; + for (i = 0; i < count; i++) { + const struct pipe_vertex_element *input = &attribs[i]; + unsigned nr_components = util_format_get_nr_components(input->src_format); + + uint32_t format = brw_translate_surface_format( input->src_format ); + uint32_t comp0 = BRW_VE1_COMPONENT_STORE_SRC; + uint32_t comp1 = BRW_VE1_COMPONENT_STORE_SRC; + uint32_t comp2 = BRW_VE1_COMPONENT_STORE_SRC; + uint32_t comp3 = BRW_VE1_COMPONENT_STORE_SRC; + + switch (nr_components) { + case 0: comp0 = BRW_VE1_COMPONENT_STORE_0; /* fallthrough */ + case 1: comp1 = BRW_VE1_COMPONENT_STORE_0; /* fallthrough */ + case 2: comp2 = BRW_VE1_COMPONENT_STORE_0; /* fallthrough */ + case 3: comp3 = BRW_VE1_COMPONENT_STORE_1_FLT; + break; + } + + brw_velems->ve[i].ve0.src_offset = input->src_offset; + brw_velems->ve[i].ve0.src_format = format; + brw_velems->ve[i].ve0.valid = 1; + brw_velems->ve[i].ve0.vertex_buffer_index = input->vertex_buffer_index; + brw_velems->ve[i].ve1.vfcomponent0 = comp0; + brw_velems->ve[i].ve1.vfcomponent1 = comp1; + brw_velems->ve[i].ve1.vfcomponent2 = comp2; + brw_velems->ve[i].ve1.vfcomponent3 = comp3; + + if (BRW_IS_IGDNG(brw)) + brw_velems->ve[i].ve1.dst_offset = 0; + else + brw_velems->ve[i].ve1.dst_offset = i * 4; + } +} + +static void* brw_create_vertex_elements_state( struct pipe_context *pipe, + unsigned count, + const struct pipe_vertex_element *attribs ) { + /* note: for the brw_swtnl.c code (if ever we need draw fallback) we'd also need + store the original data */ struct brw_context *brw = brw_context(pipe); + struct brw_vertex_element_packet *velems; + assert(count <= BRW_VEP_MAX); + velems = (struct brw_vertex_element_packet *) MALLOC(sizeof(struct brw_vertex_element_packet)); + if (velems) { + brw_translate_vertex_elements(brw, velems, attribs, count); + } + return velems; +} - memcpy(brw->curr.vertex_element, elements, count * sizeof(elements[0])); - brw->curr.num_vertex_elements = count; +static void brw_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems) +{ + struct brw_context *brw = brw_context(pipe); + struct brw_vertex_element_packet *brw_velems = (struct brw_vertex_element_packet *) velems; + + brw->curr.velems = brw_velems; brw->state.dirty.mesa |= PIPE_NEW_VERTEX_ELEMENT; } +static void brw_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) +{ + FREE( velems ); +} + static void brw_set_vertex_buffers(struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_buffer *buffers) + unsigned count, + const struct pipe_vertex_buffer *buffers) { struct brw_context *brw = brw_context(pipe); unsigned i; @@ -49,7 +278,9 @@ void brw_pipe_vertex_init( struct brw_context *brw ) { brw->base.set_vertex_buffers = brw_set_vertex_buffers; - brw->base.set_vertex_elements = brw_set_vertex_elements; + brw->base.create_vertex_elements_state = brw_create_vertex_elements_state; + brw->base.bind_vertex_elements_state = brw_bind_vertex_elements_state; + brw->base.delete_vertex_elements_state = brw_delete_vertex_elements_state; } diff --git a/src/gallium/drivers/i965/brw_structs.h b/src/gallium/drivers/i965/brw_structs.h index bf10bc04de..e97ddeb5e1 100644 --- a/src/gallium/drivers/i965/brw_structs.h +++ b/src/gallium/drivers/i965/brw_structs.h @@ -28,7 +28,7 @@ * Authors: * Keith Whitwell */ - + #ifndef BRW_STRUCTS_H #define BRW_STRUCTS_H @@ -1149,7 +1149,7 @@ struct brw_vertex_element_state GLuint valid:1; GLuint vertex_buffer_index:5; } ve0; - + struct { GLuint dst_offset:8; -- cgit v1.2.3 From 2918edb46acf58b467e4351d627912f4c8cdb32c Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:47:54 +0100 Subject: failover: adapt to new vertex element cso --- src/gallium/drivers/failover/fo_context.h | 3 +- src/gallium/drivers/failover/fo_state.c | 65 ++++++++++++++++++++-------- src/gallium/drivers/failover/fo_state_emit.c | 10 ++--- 3 files changed, 52 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/failover/fo_context.h b/src/gallium/drivers/failover/fo_context.h index bb1a168ea7..4a754465bb 100644 --- a/src/gallium/drivers/failover/fo_context.h +++ b/src/gallium/drivers/failover/fo_context.h @@ -78,6 +78,7 @@ struct failover_context { const struct fo_state *rasterizer; const struct fo_state *fragment_shader; const struct fo_state *vertex_shader; + const struct fo_state *vertex_elements; struct pipe_blend_color blend_color; struct pipe_stencil_ref stencil_ref; @@ -89,10 +90,8 @@ struct failover_context { struct pipe_texture *vertex_textures[PIPE_MAX_VERTEX_SAMPLERS]; struct pipe_viewport_state viewport; struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS]; - struct pipe_vertex_element vertex_elements[PIPE_MAX_ATTRIBS]; uint num_vertex_buffers; - uint num_vertex_elements; void *sw_sampler_state[PIPE_MAX_SAMPLERS]; void *hw_sampler_state[PIPE_MAX_SAMPLERS]; diff --git a/src/gallium/drivers/failover/fo_state.c b/src/gallium/drivers/failover/fo_state.c index 970606a3f5..0247fb803b 100644 --- a/src/gallium/drivers/failover/fo_state.c +++ b/src/gallium/drivers/failover/fo_state.c @@ -255,9 +255,52 @@ failover_delete_vs_state(struct pipe_context *pipe, free(state); } + + +static void * +failover_create_vertex_elements_state( struct pipe_context *pipe, + unsigned count, + const struct pipe_vertex_element *velems ) +{ + struct fo_state *state = malloc(sizeof(struct fo_state)); + struct failover_context *failover = failover_context(pipe); + + state->sw_state = failover->sw->create_vertex_elements_state(failover->sw, count, velems); + state->hw_state = failover->hw->create_vertex_elements_state(failover->hw, count, velems); + + return state; +} + +static void +failover_bind_vertex_elements_state(struct pipe_context *pipe, + void *velems ) +{ + struct failover_context *failover = failover_context(pipe); + struct fo_state *state = (struct fo_state*)velems; + + failover->vertex_elements = state; + failover->dirty |= FO_NEW_VERTEX_ELEMENT; + failover->sw->bind_vertex_elements_state( failover->sw, velems ); + failover->hw->bind_vertex_elements_state( failover->hw, velems ); +} + +static void +failover_delete_vertex_elements_state( struct pipe_context *pipe, + void *velems ) +{ + struct fo_state *state = (struct fo_state*)velems; + struct failover_context *failover = failover_context(pipe); + + failover->sw->delete_vertex_elements_state(failover->sw, state->sw_state); + failover->hw->delete_vertex_elements_state(failover->hw, state->hw_state); + state->sw_state = 0; + state->hw_state = 0; + free(state); +} + static void failover_set_polygon_stipple( struct pipe_context *pipe, - const struct pipe_poly_stipple *stipple ) + const struct pipe_poly_stipple *stipple ) { struct failover_context *failover = failover_context(pipe); @@ -490,22 +533,6 @@ failover_set_vertex_buffers(struct pipe_context *pipe, } -static void -failover_set_vertex_elements(struct pipe_context *pipe, - unsigned count, - const struct pipe_vertex_element *vertex_elements) -{ - struct failover_context *failover = failover_context(pipe); - - memcpy(failover->vertex_elements, vertex_elements, - count * sizeof(vertex_elements[0])); - - failover->dirty |= FO_NEW_VERTEX_ELEMENT; - failover->num_vertex_elements = count; - failover->sw->set_vertex_elements( failover->sw, count, vertex_elements ); - failover->hw->set_vertex_elements( failover->hw, count, vertex_elements ); -} - void failover_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, @@ -543,6 +570,9 @@ failover_init_state_functions( struct failover_context *failover ) failover->pipe.create_vs_state = failover_create_vs_state; failover->pipe.bind_vs_state = failover_bind_vs_state; failover->pipe.delete_vs_state = failover_delete_vs_state; + failover->pipe.create_vertex_elements_state = failover_create_vertex_elements_state; + failover->pipe.bind_vertex_elements_state = failover_bind_vertex_elements_state; + failover->pipe.delete_vertex_elements_state = failover_delete_vertex_elements_state; failover->pipe.set_blend_color = failover_set_blend_color; failover->pipe.set_stencil_ref = failover_set_stencil_ref; @@ -554,6 +584,5 @@ failover_init_state_functions( struct failover_context *failover ) failover->pipe.set_vertex_sampler_textures = failover_set_vertex_sampler_textures; failover->pipe.set_viewport_state = failover_set_viewport_state; failover->pipe.set_vertex_buffers = failover_set_vertex_buffers; - failover->pipe.set_vertex_elements = failover_set_vertex_elements; failover->pipe.set_constant_buffer = failover_set_constant_buffer; } diff --git a/src/gallium/drivers/failover/fo_state_emit.c b/src/gallium/drivers/failover/fo_state_emit.c index 5c00080842..09ca194497 100644 --- a/src/gallium/drivers/failover/fo_state_emit.c +++ b/src/gallium/drivers/failover/fo_state_emit.c @@ -81,6 +81,10 @@ failover_state_emit( struct failover_context *failover ) failover->sw->bind_vs_state( failover->sw, failover->vertex_shader->sw_state ); + if (failover->dirty & FO_NEW_VERTEX_ELEMENT) + failover->sw->bind_vertex_elements_state( failover->sw, + failover->vertex_elements->sw_state ); + if (failover->dirty & FO_NEW_STIPPLE) failover->sw->set_polygon_stipple( failover->sw, &failover->poly_stipple ); @@ -116,11 +120,5 @@ failover_state_emit( struct failover_context *failover ) failover->vertex_buffers ); } - if (failover->dirty & FO_NEW_VERTEX_ELEMENT) { - failover->sw->set_vertex_elements( failover->sw, - failover->num_vertex_elements, - failover->vertex_elements ); - } - failover->dirty = 0; } -- cgit v1.2.3 From 881be308360ec8019f17bc970bece23e9395134f Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 18:48:05 +0100 Subject: identity: adapt to new vertex element cso --- src/gallium/drivers/identity/id_context.c | 54 ++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 8248b2a413..05a9dfab77 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -377,6 +377,42 @@ identity_delete_vs_state(struct pipe_context *_pipe, vs); } + +static void +identity_create_vertex_elements_state(struct pipe_context *_pipe, + unsigned num_elements, + const struct pipe_vertex_element *vertex_elements) +{ + struct identity_context *id_pipe = identity_context(_pipe); + struct pipe_context *pipe = id_pipe->pipe; + + pipe->create_vertex_elements_state(pipe, + num_elements, + vertex_elements); +} + +static void +identity_bind_vertex_elements_state(struct pipe_context *_pipe, + void *velems) +{ + struct identity_context *id_pipe = identity_context(_pipe); + struct pipe_context *pipe = id_pipe->pipe; + + pipe->bind_vertex_elements_state(pipe, + velems); +} + +static void +identity_delete_vertex_elements_state(struct pipe_context *_pipe, + void *velems) +{ + struct identity_context *id_pipe = identity_context(_pipe); + struct pipe_context *pipe = id_pipe->pipe; + + pipe->delete_vertex_elements_state(pipe, + velems); +} + static void identity_set_blend_color(struct pipe_context *_pipe, const struct pipe_blend_color *blend_color) @@ -563,20 +599,6 @@ identity_set_vertex_buffers(struct pipe_context *_pipe, num_buffers, buffers); } - -static void -identity_set_vertex_elements(struct pipe_context *_pipe, - unsigned num_elements, - const struct pipe_vertex_element *vertex_elements) -{ - struct identity_context *id_pipe = identity_context(_pipe); - struct pipe_context *pipe = id_pipe->pipe; - - pipe->set_vertex_elements(pipe, - num_elements, - vertex_elements); -} - static void identity_surface_copy(struct pipe_context *_pipe, struct pipe_surface *_dst, @@ -733,6 +755,9 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) id_pipe->base.create_vs_state = identity_create_vs_state; id_pipe->base.bind_vs_state = identity_bind_vs_state; id_pipe->base.delete_vs_state = identity_delete_vs_state; + id_pipe->base.create_vertex_elements_state = identity_create_vertex_elements_state; + id_pipe->base.bind_vertex_elements_state = identity_bind_vertex_elements_state; + id_pipe->base.delete_vertex_elements_state = identity_delete_vertex_elements_state; id_pipe->base.set_blend_color = identity_set_blend_color; id_pipe->base.set_stencil_ref = identity_set_stencil_ref; id_pipe->base.set_clip_state = identity_set_clip_state; @@ -744,7 +769,6 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) id_pipe->base.set_fragment_sampler_textures = identity_set_fragment_sampler_textures; id_pipe->base.set_vertex_sampler_textures = identity_set_vertex_sampler_textures; id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers; - id_pipe->base.set_vertex_elements = identity_set_vertex_elements; id_pipe->base.surface_copy = identity_surface_copy; id_pipe->base.surface_fill = identity_surface_fill; id_pipe->base.clear = identity_clear; -- cgit v1.2.3 From c863f30155f26d47dc45736ffbbc0e9d96009756 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 1 Mar 2010 19:00:40 +0100 Subject: util: Generate linear<->sRGB conversion tables. --- src/gallium/auxiliary/util/u_format_access.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index 1c9be1b538..00424779d2 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -37,6 +37,7 @@ ''' +import math import sys from u_format_pack import * @@ -94,6 +95,20 @@ def native_type(format): assert False +def generate_srgb_tables(): + print 'static ubyte srgb_to_linear[256] = {' + for i in range(256): + print ' %s,' % (int(math.pow((i / 255.0 + 0.055) / 1.055, 2.4) * 255)) + print '};' + print + print 'static ubyte linear_to_srgb[256] = {' + print ' 0,' + for i in range(1, 256): + print ' %s,' % (int((1.055 * math.pow(i / 255.0, 0.41666) - 0.055) * 255)) + print '};' + print + + def generate_format_read(format, dst_channel, dst_native_type, dst_suffix): '''Generate the function to read pixels from a particular format''' @@ -305,6 +320,8 @@ def main(): print '#include "u_format_pack.h"' print + generate_srgb_tables() + type = Channel(FLOAT, False, 32) native_type = 'float' suffix = '4f' -- cgit v1.2.3 From 835a725684dc294f579bbb8e11ad767de7503eef Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:39:47 +0000 Subject: gallium: Remove PIPE_FORMAT_A8B8G8R8_SNORM. Its actually an alias for PIPE_FORMAT_R8G8B8A8_SNORM. --- src/gallium/include/pipe/p_format.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 79e4df7b4d..55f3a08c1a 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -121,7 +121,6 @@ enum pipe_format { PIPE_FORMAT_R8G8_SNORM = 75, PIPE_FORMAT_R8G8B8_SNORM = 76, PIPE_FORMAT_R8G8B8A8_SNORM = 77, - PIPE_FORMAT_A8B8G8R8_SNORM = 80, PIPE_FORMAT_X8B8G8R8_SNORM = 81, PIPE_FORMAT_R8_SSCALED = 82, PIPE_FORMAT_R8G8_SSCALED = 83, -- cgit v1.2.3 From a6c4c4486d66c857125fb7d6f1a21c002f5cb8cd Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:40:02 +0000 Subject: util: Remove PIPE_FORMAT_A8B8G8R8_SNORM. --- src/gallium/auxiliary/util/u_format.csv | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index e9ec377fb1..45a2776c6c 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -87,7 +87,6 @@ PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, s PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, srgb # Signed formats (typically used for bump map textures) -PIPE_FORMAT_A8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyzw, rgb PIPE_FORMAT_X8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb PIPE_FORMAT_X8UB8UG8SR8S_NORM , plain, 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb PIPE_FORMAT_B6UG5SR5S_NORM , plain, 1, 1, sn5 , sn5 , un6 , , xyz1, rgb -- cgit v1.2.3 From 971ab386c0c8b7fd261a41e9a38fc4f83f9ba3f6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:40:33 +0000 Subject: softpipe: Advertise PIPE_FORMAT_R8G8B8A8_SNORM instead. --- src/gallium/drivers/softpipe/sp_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 87415f4340..937b6a8439 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -162,7 +162,7 @@ softpipe_is_format_supported( struct pipe_screen *screen, case PIPE_FORMAT_R8G8_SNORM: case PIPE_FORMAT_B6UG5SR5S_NORM: case PIPE_FORMAT_X8UB8UG8SR8S_NORM: - case PIPE_FORMAT_A8B8G8R8_SNORM: + case PIPE_FORMAT_R8G8B8A8_SNORM: case PIPE_FORMAT_NONE: return FALSE; default: -- cgit v1.2.3 From 568a3c73652f02e8b0fee7693578c8fd2013d97f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:41:05 +0000 Subject: r300: Remove PIPE_FORMAT_A8B8G8R8_SNORM. PIPE_FORMAT_R8G8B8A8_SNORM already listed. --- src/gallium/drivers/r300/r300_texture.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 5b674f6e57..ea474737b1 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -329,7 +329,6 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_R8G8B8A8_SRGB: case PIPE_FORMAT_R8G8B8X8_UNORM: case PIPE_FORMAT_R8G8B8X8_SRGB: - case PIPE_FORMAT_A8B8G8R8_SNORM: case PIPE_FORMAT_X8B8G8R8_SNORM: case PIPE_FORMAT_X8UB8UG8SR8S_NORM: return R300_COLOR_FORMAT_ARGB8888; @@ -467,7 +466,6 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) R300_C2_SEL_G | R300_C3_SEL_R; /* ABGR 32-bit outputs. */ - case PIPE_FORMAT_A8B8G8R8_SNORM: case PIPE_FORMAT_X8B8G8R8_SNORM: case PIPE_FORMAT_X8UB8UG8SR8S_NORM: case PIPE_FORMAT_A2B10G10R10_UNORM: -- cgit v1.2.3 From 3843548a67da4ad484eadfd9e65d56d581a49a82 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:09:03 +0000 Subject: gallium: Standardize on the LSB->MSB notation. Less confusing, and seems to gather more consensus. Below are the sed commands used. This and following commits are the result of applying this too to the whole tree, plus manual whitespaces fixes. s/\/ASDGFSJKDGSDFGSJDFGREKT/g s/\/PIPE_FORMAT_A8R8G8B8_UNORM/g s/\/PIPE_FORMAT_B8G8R8A8_UNORM/g s/\/ASDGFSJKDGSDFGSJDFGREKT/g s/\/PIPE_FORMAT_X8R8G8B8_UNORM/g s/\/PIPE_FORMAT_B8G8R8X8_UNORM/g s/\/PIPE_FORMAT_A8B8G8R8_UNORM/g s/\/PIPE_FORMAT_X8B8G8R8_UNORM/g s/\/PIPE_FORMAT_B5G5R5A1_UNORM/g s/\/PIPE_FORMAT_B4G4R4A4_UNORM/g s/\/PIPE_FORMAT_B5G6R5_UNORM/g s/\/PIPE_FORMAT_R10G10B10A2_UNORM/g s/\/PIPE_FORMAT_L8A8_UNORM/g s/\/PIPE_FORMAT_L8A8_SRGB/g s/\/PIPE_FORMAT_A8B8G8R8_SRGB/g s/\/PIPE_FORMAT_X8B8G8R8_SRGB/g s/\/ASDGFSJKDGSDFGSJDFGREKT/g s/\/PIPE_FORMAT_A8R8G8B8_SRGB/g s/\/PIPE_FORMAT_B8G8R8A8_SRGB/g s/\/ASDGFSJKDGSDFGSJDFGREKT/g s/\/PIPE_FORMAT_X8R8G8B8_SRGB/g s/\/PIPE_FORMAT_B8G8R8X8_SRGB/g s/\/PIPE_FORMAT_R8G8B8A8_SNORM/g s/\/PIPE_FORMAT_R8G8B8X8_SNORM/g s/\/PIPE_FORMAT_R8SG8SB8UX8U_NORM/g s/\/PIPE_FORMAT_R5SG5SB6U_NORM/g s/\/ASDGFSJKDGSDFGSJDFGREKT/g s/\/PIPE_FORMAT_S8Z24_UNORM/g s/\/PIPE_FORMAT_Z24S8_UNORM/g s/\/ASDGFSJKDGSDFGSJDFGREKT/g s/\/PIPE_FORMAT_X8Z24_UNORM/g s/\/PIPE_FORMAT_Z24X8_UNORM/g s/\/PIPE_FORMAT_UYVY/g s/\/PIPE_FORMAT_YUYV/g --- src/gallium/include/pipe/p_format.h | 54 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 55f3a08c1a..0314172de7 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -45,28 +45,28 @@ extern "C" { enum pipe_format { PIPE_FORMAT_NONE = 0, - PIPE_FORMAT_A8R8G8B8_UNORM = 1, - PIPE_FORMAT_X8R8G8B8_UNORM = 2, - PIPE_FORMAT_B8G8R8A8_UNORM = 3, - PIPE_FORMAT_B8G8R8X8_UNORM = 4, - PIPE_FORMAT_A1R5G5B5_UNORM = 5, - PIPE_FORMAT_A4R4G4B4_UNORM = 6, - PIPE_FORMAT_R5G6B5_UNORM = 7, - PIPE_FORMAT_A2B10G10R10_UNORM = 8, + PIPE_FORMAT_B8G8R8A8_UNORM = 1, + PIPE_FORMAT_B8G8R8X8_UNORM = 2, + PIPE_FORMAT_A8R8G8B8_UNORM = 3, + PIPE_FORMAT_X8R8G8B8_UNORM = 4, + PIPE_FORMAT_B5G5R5A1_UNORM = 5, + PIPE_FORMAT_B4G4R4A4_UNORM = 6, + PIPE_FORMAT_B5G6R5_UNORM = 7, + PIPE_FORMAT_R10G10B10A2_UNORM = 8, PIPE_FORMAT_L8_UNORM = 9, /**< ubyte luminance */ PIPE_FORMAT_A8_UNORM = 10, /**< ubyte alpha */ PIPE_FORMAT_I8_UNORM = 11, /**< ubyte intensity */ - PIPE_FORMAT_A8L8_UNORM = 12, /**< ubyte alpha, luminance */ + PIPE_FORMAT_L8A8_UNORM = 12, /**< ubyte alpha, luminance */ PIPE_FORMAT_L16_UNORM = 13, /**< ushort luminance */ - PIPE_FORMAT_YCBCR = 14, - PIPE_FORMAT_YCBCR_REV = 15, + PIPE_FORMAT_UYVY = 14, + PIPE_FORMAT_YUYV = 15, PIPE_FORMAT_Z16_UNORM = 16, PIPE_FORMAT_Z32_UNORM = 17, PIPE_FORMAT_Z32_FLOAT = 18, - PIPE_FORMAT_S8Z24_UNORM = 19, - PIPE_FORMAT_Z24S8_UNORM = 20, - PIPE_FORMAT_X8Z24_UNORM = 21, - PIPE_FORMAT_Z24X8_UNORM = 22, + PIPE_FORMAT_Z24S8_UNORM = 19, + PIPE_FORMAT_S8Z24_UNORM = 20, + PIPE_FORMAT_Z24X8_UNORM = 21, + PIPE_FORMAT_X8Z24_UNORM = 22, PIPE_FORMAT_S8_UNORM = 23, /**< ubyte stencil */ PIPE_FORMAT_R64_FLOAT = 24, PIPE_FORMAT_R64G64_FLOAT = 25, @@ -112,7 +112,7 @@ enum pipe_format { PIPE_FORMAT_R8G8_UNORM = 65, PIPE_FORMAT_R8G8B8_UNORM = 66, PIPE_FORMAT_R8G8B8A8_UNORM = 67, - PIPE_FORMAT_R8G8B8X8_UNORM = 68, + PIPE_FORMAT_X8B8G8R8_UNORM = 68, PIPE_FORMAT_R8_USCALED = 69, PIPE_FORMAT_R8G8_USCALED = 70, PIPE_FORMAT_R8G8B8_USCALED = 71, @@ -121,7 +121,7 @@ enum pipe_format { PIPE_FORMAT_R8G8_SNORM = 75, PIPE_FORMAT_R8G8B8_SNORM = 76, PIPE_FORMAT_R8G8B8A8_SNORM = 77, - PIPE_FORMAT_X8B8G8R8_SNORM = 81, + PIPE_FORMAT_R8G8B8X8_SNORM = 81, PIPE_FORMAT_R8_SSCALED = 82, PIPE_FORMAT_R8G8_SSCALED = 83, PIPE_FORMAT_R8G8B8_SSCALED = 84, @@ -132,18 +132,18 @@ enum pipe_format { PIPE_FORMAT_R32G32B32A32_FIXED = 90, /* sRGB formats */ PIPE_FORMAT_L8_SRGB = 91, - PIPE_FORMAT_A8L8_SRGB = 92, + PIPE_FORMAT_L8A8_SRGB = 92, PIPE_FORMAT_R8G8B8_SRGB = 93, - PIPE_FORMAT_R8G8B8A8_SRGB = 94, - PIPE_FORMAT_R8G8B8X8_SRGB = 95, - PIPE_FORMAT_A8R8G8B8_SRGB = 96, - PIPE_FORMAT_X8R8G8B8_SRGB = 97, - PIPE_FORMAT_B8G8R8A8_SRGB = 98, - PIPE_FORMAT_B8G8R8X8_SRGB = 99, + PIPE_FORMAT_A8B8G8R8_SRGB = 94, + PIPE_FORMAT_X8B8G8R8_SRGB = 95, + PIPE_FORMAT_B8G8R8A8_SRGB = 96, + PIPE_FORMAT_B8G8R8X8_SRGB = 97, + PIPE_FORMAT_A8R8G8B8_SRGB = 98, + PIPE_FORMAT_X8R8G8B8_SRGB = 99, /* mixed formats */ - PIPE_FORMAT_X8UB8UG8SR8S_NORM = 100, - PIPE_FORMAT_B6UG5SR5S_NORM = 101, + PIPE_FORMAT_R8SG8SB8UX8U_NORM = 100, + PIPE_FORMAT_R5SG5SB6U_NORM = 101, /* compressed formats */ PIPE_FORMAT_DXT1_RGB = 102, @@ -157,7 +157,7 @@ enum pipe_format { PIPE_FORMAT_DXT3_SRGBA = 108, PIPE_FORMAT_DXT5_SRGBA = 109, - PIPE_FORMAT_R8G8B8A8_UNORM_REV = 110, + PIPE_FORMAT_A8B8G8R8_UNORM = 110, PIPE_FORMAT_COUNT }; -- cgit v1.2.3 From 712ba6e6b049c050af3ac1992aba009ebbe56ca5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:09:40 +0000 Subject: util: Rename pipe formats. --- src/gallium/auxiliary/util/u_debug.c | 2 +- src/gallium/auxiliary/util/u_format.csv | 55 ++++++++-------- src/gallium/auxiliary/util/u_gen_mipmap.c | 22 +++---- src/gallium/auxiliary/util/u_pack_color.h | 66 +++++++++---------- src/gallium/auxiliary/util/u_surface.c | 4 +- src/gallium/auxiliary/util/u_tile.c | 104 +++++++++++++++--------------- 6 files changed, 126 insertions(+), 127 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 858d52c6ef..94be682c4b 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -387,7 +387,7 @@ void debug_dump_image(const char *prefix, /* XXX this is a hack */ switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: r = 2; g = 1; b = 0; diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 45a2776c6c..43d69f1cd8 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -57,57 +57,57 @@ # resolutions for each sized internal format." # Typical rendertarget formats -PIPE_FORMAT_A8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, rgb -PIPE_FORMAT_X8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb -PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, rgb -PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb -PIPE_FORMAT_R8G8B8A8_UNORM_REV , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb -PIPE_FORMAT_R8G8B8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb -PIPE_FORMAT_A1R5G5B5_UNORM , plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb -PIPE_FORMAT_A4R4G4B4_UNORM , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb -PIPE_FORMAT_R5G6B5_UNORM , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb -PIPE_FORMAT_A2B10G10R10_UNORM , plain, 1, 1, un10, un10, un10, un2 , xyzw, rgb +PIPE_FORMAT_B8G8R8A8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, rgb +PIPE_FORMAT_B8G8R8X8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, rgb +PIPE_FORMAT_A8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, rgb +PIPE_FORMAT_X8R8G8B8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, rgb +PIPE_FORMAT_A8B8G8R8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, rgb +PIPE_FORMAT_X8B8G8R8_UNORM , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, rgb +PIPE_FORMAT_B5G5R5A1_UNORM , plain, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb +PIPE_FORMAT_B4G4R4A4_UNORM , plain, 1, 1, un4 , un4 , un4 , un4 , zyxw, rgb +PIPE_FORMAT_B5G6R5_UNORM , plain, 1, 1, un5 , un6 , un5 , , zyx1, rgb +PIPE_FORMAT_R10G10B10A2_UNORM , plain, 1, 1, un10, un10, un10, un2 , xyzw, rgb # Luminance/Intensity/Alpha formats PIPE_FORMAT_L8_UNORM , plain, 1, 1, un8 , , , , xxx1, rgb PIPE_FORMAT_A8_UNORM , plain, 1, 1, un8 , , , , 000x, rgb PIPE_FORMAT_I8_UNORM , plain, 1, 1, un8 , , , , xxxx, rgb -PIPE_FORMAT_A8L8_UNORM , plain, 1, 1, un8 , un8 , , , xxxy, rgb +PIPE_FORMAT_L8A8_UNORM , plain, 1, 1, un8 , un8 , , , xxxy, rgb PIPE_FORMAT_L16_UNORM , plain, 1, 1, un16, , , , xxx1, rgb # SRGB formats PIPE_FORMAT_L8_SRGB , plain, 1, 1, un8 , , , , xxx1, srgb -PIPE_FORMAT_A8L8_SRGB , plain, 1, 1, un8 , un8 , , , xxxy, srgb +PIPE_FORMAT_L8A8_SRGB , plain, 1, 1, un8 , un8 , , , xxxy, srgb PIPE_FORMAT_R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , , xyz1, srgb -PIPE_FORMAT_R8G8B8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, srgb -PIPE_FORMAT_R8G8B8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, srgb -PIPE_FORMAT_A8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, srgb -PIPE_FORMAT_X8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, srgb -PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, srgb -PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, srgb +PIPE_FORMAT_A8B8G8R8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzyx, srgb +PIPE_FORMAT_X8B8G8R8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , wzy1, srgb +PIPE_FORMAT_B8G8R8A8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyxw, srgb +PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, srgb +PIPE_FORMAT_A8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, srgb +PIPE_FORMAT_X8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, srgb # Signed formats (typically used for bump map textures) -PIPE_FORMAT_X8B8G8R8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb -PIPE_FORMAT_X8UB8UG8SR8S_NORM , plain, 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb -PIPE_FORMAT_B6UG5SR5S_NORM , plain, 1, 1, sn5 , sn5 , un6 , , xyz1, rgb +PIPE_FORMAT_R8G8B8X8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb +PIPE_FORMAT_R8SG8SB8UX8U_NORM , plain, 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb +PIPE_FORMAT_R5SG5SB6U_NORM , plain, 1, 1, sn5 , sn5 , un6 , , xyz1, rgb # Depth-stencil formats PIPE_FORMAT_S8_UNORM , plain, 1, 1, un8 , , , , _x__, zs PIPE_FORMAT_Z16_UNORM , plain, 1, 1, un16, , , , x___, zs PIPE_FORMAT_Z32_UNORM , plain, 1, 1, un32, , , , x___, zs PIPE_FORMAT_Z32_FLOAT , plain, 1, 1, f32 , , , , x___, zs -PIPE_FORMAT_S8Z24_UNORM , plain, 1, 1, un24, un8 , , , xy__, zs -PIPE_FORMAT_Z24S8_UNORM , plain, 1, 1, un8 , un24, , , yx__, zs -PIPE_FORMAT_X8Z24_UNORM , plain, 1, 1, un24, un8 , , , x___, zs -PIPE_FORMAT_Z24X8_UNORM , plain, 1, 1, un8 , un24, , , y___, zs +PIPE_FORMAT_Z24S8_UNORM , plain, 1, 1, un24, un8 , , , xy__, zs +PIPE_FORMAT_S8Z24_UNORM , plain, 1, 1, un8 , un24, , , yx__, zs +PIPE_FORMAT_Z24X8_UNORM , plain, 1, 1, un24, un8 , , , x___, zs +PIPE_FORMAT_X8Z24_UNORM , plain, 1, 1, un8 , un24, , , y___, zs # YUV formats # http://www.fourcc.org/yuv.php#UYVY -PIPE_FORMAT_YCBCR , subsampled, 2, 1, x32 , , , , xyz1, yuv +PIPE_FORMAT_UYVY , subsampled, 2, 1, x32 , , , , xyz1, yuv # http://www.fourcc.org/yuv.php#YUYV (a.k.a http://www.fourcc.org/yuv.php#YUY2) # XXX: u_tile.c's ycbcr_get_tile_rgba actually interprets it as VYUY but the # intent should be to match D3DFMT_YUY2 -PIPE_FORMAT_YCBCR_REV , subsampled, 2, 1, x32 , , , , xyz1, yuv +PIPE_FORMAT_YUYV , subsampled, 2, 1, x32 , , , , xyz1, yuv # Compressed formats PIPE_FORMAT_DXT1_RGB , compressed, 4, 4, x64 , , , , xyz1, rgb @@ -120,7 +120,6 @@ PIPE_FORMAT_DXT3_SRGBA , compressed, 4, 4, x128, , , , xy PIPE_FORMAT_DXT5_SRGBA , compressed, 4, 4, x128, , , , xyzw, srgb # Old vector formats -# XXX: Swizzle notation is reversed for these! # See also: # - src/gallium/auxiliary/translate/translate_generic.c # - src/mesa/state_tracker/st_draw.c diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 1d7329d422..9390e8636f 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -922,29 +922,29 @@ format_to_type_comps(enum pipe_format pformat, { /* XXX I think this could be implemented in terms of the pf_*() functions */ switch (pformat) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: case PIPE_FORMAT_B8G8R8A8_UNORM: case PIPE_FORMAT_B8G8R8X8_UNORM: - case PIPE_FORMAT_R8G8B8A8_SRGB: - case PIPE_FORMAT_R8G8B8X8_SRGB: - case PIPE_FORMAT_A8R8G8B8_SRGB: - case PIPE_FORMAT_X8R8G8B8_SRGB: + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_A8B8G8R8_SRGB: + case PIPE_FORMAT_X8B8G8R8_SRGB: case PIPE_FORMAT_B8G8R8A8_SRGB: case PIPE_FORMAT_B8G8R8X8_SRGB: + case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_X8R8G8B8_SRGB: case PIPE_FORMAT_R8G8B8_SRGB: *datatype = DTYPE_UBYTE; *comps = 4; return; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: *datatype = DTYPE_USHORT_1_5_5_5_REV; *comps = 4; return; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: *datatype = DTYPE_USHORT_4_4_4_4; *comps = 4; return; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: *datatype = DTYPE_USHORT_5_6_5; *comps = 3; return; @@ -955,8 +955,8 @@ format_to_type_comps(enum pipe_format pformat, *datatype = DTYPE_UBYTE; *comps = 1; return; - case PIPE_FORMAT_A8L8_UNORM: - case PIPE_FORMAT_A8L8_SRGB: + case PIPE_FORMAT_L8A8_UNORM: + case PIPE_FORMAT_L8A8_SRGB: *datatype = DTYPE_UBYTE; *comps = 2; return; diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index 4e4ac7f3da..50f1b1670b 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -57,47 +57,47 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, enum pipe_format format, union util_color *uc) { switch (format) { - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8B8G8R8_UNORM: { uc->ui = (r << 24) | (g << 16) | (b << 8) | a; } return; - case PIPE_FORMAT_R8G8B8X8_UNORM: + case PIPE_FORMAT_X8B8G8R8_UNORM: { uc->ui = (r << 24) | (g << 16) | (b << 8) | 0xff; } return; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: { uc->ui = (a << 24) | (r << 16) | (g << 8) | b; } return; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: { uc->ui = (0xff << 24) | (r << 16) | (g << 8) | b; } return; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: { uc->ui = (b << 24) | (g << 16) | (r << 8) | a; } return; - case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_X8R8G8B8_UNORM: { uc->ui = (b << 24) | (g << 16) | (r << 8) | 0xff; } return; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: { uc->us = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } return; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: { uc->us = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3); } return; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: { uc->us = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4); } @@ -153,7 +153,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, ubyte *r, ubyte *g, ubyte *b, ubyte *a) { switch (format) { - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8B8G8R8_UNORM: { uint p = uc->ui; *r = (ubyte) ((p >> 24) & 0xff); @@ -162,7 +162,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) ((p >> 0) & 0xff); } return; - case PIPE_FORMAT_R8G8B8X8_UNORM: + case PIPE_FORMAT_X8B8G8R8_UNORM: { uint p = uc->ui; *r = (ubyte) ((p >> 24) & 0xff); @@ -171,7 +171,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) 0xff; } return; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: { uint p = uc->ui; *r = (ubyte) ((p >> 16) & 0xff); @@ -180,7 +180,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) ((p >> 24) & 0xff); } return; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: { uint p = uc->ui; *r = (ubyte) ((p >> 16) & 0xff); @@ -189,7 +189,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) 0xff; } return; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: { uint p = uc->ui; *r = (ubyte) ((p >> 8) & 0xff); @@ -198,7 +198,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) ((p >> 0) & 0xff); } return; - case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_X8R8G8B8_UNORM: { uint p = uc->ui; *r = (ubyte) ((p >> 8) & 0xff); @@ -207,7 +207,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) 0xff; } return; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: { ushort p = uc->us; *r = (ubyte) (((p >> 8) & 0xf8) | ((p >> 13) & 0x7)); @@ -216,7 +216,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) 0xff; } return; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: { ushort p = uc->us; *r = (ubyte) (((p >> 7) & 0xf8) | ((p >> 12) & 0x7)); @@ -225,7 +225,7 @@ util_unpack_color_ub(enum pipe_format format, union util_color *uc, *a = (ubyte) (0xff * (p >> 15)); } return; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: { ushort p = uc->us; *r = (ubyte) (((p >> 4) & 0xf0) | ((p >> 8) & 0xf)); @@ -326,47 +326,47 @@ util_pack_color(const float rgba[4], enum pipe_format format, union util_color * } switch (format) { - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8B8G8R8_UNORM: { uc->ui = (r << 24) | (g << 16) | (b << 8) | a; } return; - case PIPE_FORMAT_R8G8B8X8_UNORM: + case PIPE_FORMAT_X8B8G8R8_UNORM: { uc->ui = (r << 24) | (g << 16) | (b << 8) | 0xff; } return; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: { uc->ui = (a << 24) | (r << 16) | (g << 8) | b; } return; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: { uc->ui = (0xff << 24) | (r << 16) | (g << 8) | b; } return; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: { uc->ui = (b << 24) | (g << 16) | (r << 8) | a; } return; - case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_X8R8G8B8_UNORM: { uc->ui = (b << 24) | (g << 16) | (r << 8) | 0xff; } return; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: { uc->us = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } return; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: { uc->us = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3); } return; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: { uc->ub = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4); } @@ -427,13 +427,13 @@ util_pack_z(enum pipe_format format, double z) return (uint) (z * 0xffffffff); case PIPE_FORMAT_Z32_FLOAT: return (uint)z; - case PIPE_FORMAT_S8Z24_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: if (z == 1.0) return 0xffffff; return (uint) (z * 0xffffff); - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: if (z == 1.0) return 0xffffff00; return ((uint) (z * 0xffffff)) << 8; @@ -458,10 +458,10 @@ util_pack_z_stencil(enum pipe_format format, double z, uint s) unsigned packed = util_pack_z(format, z); switch (format) { - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: packed |= s << 24; break; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: packed |= s; break; case PIPE_FORMAT_S8_UNORM: diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index 948c1e76d0..33306bbc2a 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -54,9 +54,9 @@ util_create_rgba_surface(struct pipe_screen *screen, struct pipe_surface **surfaceOut) { static const enum pipe_format rgbaFormats[] = { - PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM_REV, + PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_A8B8G8R8_UNORM, PIPE_FORMAT_NONE }; const uint target = PIPE_TEXTURE_2D; diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 6000e93a0b..79481b710b 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -108,7 +108,7 @@ pipe_put_tile_raw(struct pipe_transfer *pt, -/*** PIPE_FORMAT_A8R8G8B8_UNORM ***/ +/*** PIPE_FORMAT_B8G8R8A8_UNORM ***/ static void a8r8g8b8_get_tile_rgba(const unsigned *src, @@ -155,7 +155,7 @@ a8r8g8b8_put_tile_rgba(unsigned *dst, } -/*** PIPE_FORMAT_X8R8G8B8_UNORM ***/ +/*** PIPE_FORMAT_B8G8R8X8_UNORM ***/ static void x8r8g8b8_get_tile_rgba(const unsigned *src, @@ -201,7 +201,7 @@ x8r8g8b8_put_tile_rgba(unsigned *dst, } -/*** PIPE_FORMAT_B8G8R8A8_UNORM ***/ +/*** PIPE_FORMAT_A8R8G8B8_UNORM ***/ static void b8g8r8a8_get_tile_rgba(const unsigned *src, @@ -248,7 +248,7 @@ b8g8r8a8_put_tile_rgba(unsigned *dst, } -/*** PIPE_FORMAT_R8G8B8A8_UNORM_REV ***/ +/*** PIPE_FORMAT_A8B8G8R8_UNORM ***/ static void r8g8b8a8_get_tile_rgba(const unsigned *src, @@ -295,7 +295,7 @@ r8g8b8a8_put_tile_rgba(unsigned *dst, } -/*** PIPE_FORMAT_A1R5G5B5_UNORM ***/ +/*** PIPE_FORMAT_B5G5R5A1_UNORM ***/ static void a1r5g5b5_get_tile_rgba(const ushort *src, @@ -346,7 +346,7 @@ a1r5g5b5_put_tile_rgba(ushort *dst, } -/*** PIPE_FORMAT_A4R4G4B4_UNORM ***/ +/*** PIPE_FORMAT_B4G4R4A4_UNORM ***/ static void a4r4g4b4_get_tile_rgba(const ushort *src, @@ -397,7 +397,7 @@ a4r4g4b4_put_tile_rgba(ushort *dst, } -/*** PIPE_FORMAT_R5G6B5_UNORM ***/ +/*** PIPE_FORMAT_B5G6R5_UNORM ***/ static void r5g6b5_get_tile_rgba(const ushort *src, @@ -691,7 +691,7 @@ r16g16b16a16_put_tile_rgba(short *dst, } -/*** PIPE_FORMAT_R8G8B8A8_SRGB ***/ +/*** PIPE_FORMAT_A8B8G8R8_SRGB ***/ /** * Convert an 8-bit sRGB value from non-linear space to a @@ -784,7 +784,7 @@ a8r8g8b8_srgb_put_tile_rgba(unsigned *dst, } -/*** PIPE_FORMAT_A8L8_SRGB ***/ +/*** PIPE_FORMAT_L8A8_SRGB ***/ static void a8l8_srgb_get_tile_rgba(const ushort *src, @@ -913,7 +913,7 @@ i8_put_tile_rgba(ubyte *dst, } -/*** PIPE_FORMAT_A8L8_UNORM ***/ +/*** PIPE_FORMAT_L8A8_UNORM ***/ static void a8l8_get_tile_rgba(const ushort *src, @@ -987,7 +987,7 @@ z32_get_tile_rgba(const unsigned *src, } -/*** PIPE_FORMAT_S8Z24_UNORM ***/ +/*** PIPE_FORMAT_Z24S8_UNORM ***/ /** * Return Z component as four float in [0,1]. Stencil part ignored. @@ -1014,7 +1014,7 @@ s8z24_get_tile_rgba(const unsigned *src, } -/*** PIPE_FORMAT_Z24S8_UNORM ***/ +/*** PIPE_FORMAT_S8Z24_UNORM ***/ /** * Return Z component as four float in [0,1]. Stencil part ignored. @@ -1067,7 +1067,7 @@ z32f_get_tile_rgba(const float *src, } -/*** PIPE_FORMAT_YCBCR / PIPE_FORMAT_YCBCR_REV ***/ +/*** PIPE_FORMAT_UYVY / PIPE_FORMAT_YUYV ***/ /** * Convert YCbCr (or YCrCb) to RGBA. @@ -1162,25 +1162,25 @@ pipe_tile_raw_to_rgba(enum pipe_format format, float *dst, unsigned dst_stride) { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: a8r8g8b8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: x8r8g8b8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: b8g8r8a8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8B8G8R8_UNORM: r8g8b8a8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: a1r5g5b5_get_tile_rgba((ushort *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: a4r4g4b4_get_tile_rgba((ushort *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: r5g6b5_get_tile_rgba((ushort *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_R8G8B8_UNORM: @@ -1195,7 +1195,7 @@ pipe_tile_raw_to_rgba(enum pipe_format format, case PIPE_FORMAT_I8_UNORM: i8_get_tile_rgba((ubyte *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: a8l8_get_tile_rgba((ushort *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_R16_SNORM: @@ -1204,10 +1204,10 @@ pipe_tile_raw_to_rgba(enum pipe_format format, case PIPE_FORMAT_R16G16B16A16_SNORM: r16g16b16a16_get_tile_rgba((short *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_B8G8R8A8_SRGB: a8r8g8b8_srgb_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_A8L8_SRGB: + case PIPE_FORMAT_L8A8_SRGB: a8l8_srgb_get_tile_rgba((ushort *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_L8_SRGB: @@ -1219,21 +1219,21 @@ pipe_tile_raw_to_rgba(enum pipe_format format, case PIPE_FORMAT_Z32_UNORM: z32_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_S8Z24_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: - s8z24_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); - break; case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z24X8_UNORM: + s8z24_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); + break; + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: z24s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_Z32_FLOAT: z32f_get_tile_rgba((float *) src, w, h, dst, dst_stride); break; - case PIPE_FORMAT_YCBCR: + case PIPE_FORMAT_UYVY: ycbcr_get_tile_rgba((ushort *) src, w, h, dst, dst_stride, FALSE); break; - case PIPE_FORMAT_YCBCR_REV: + case PIPE_FORMAT_YUYV: ycbcr_get_tile_rgba((ushort *) src, w, h, dst, dst_stride, TRUE); break; default: @@ -1262,7 +1262,7 @@ pipe_get_tile_rgba(struct pipe_transfer *pt, if (!packed) return; - if(format == PIPE_FORMAT_YCBCR || format == PIPE_FORMAT_YCBCR_REV) + if(format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV) assert((x & 1) == 0); pipe_get_tile_raw(pt, x, y, w, h, packed, 0); @@ -1291,28 +1291,28 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, return; switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: a8r8g8b8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: x8r8g8b8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: b8g8r8a8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8B8G8R8_UNORM: r8g8b8a8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: a1r5g5b5_put_tile_rgba((ushort *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: r5g6b5_put_tile_rgba((ushort *) packed, w, h, p, src_stride); break; case PIPE_FORMAT_R8G8B8_UNORM: r8g8b8_put_tile_rgba((ubyte *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: a4r4g4b4_put_tile_rgba((ushort *) packed, w, h, p, src_stride); break; case PIPE_FORMAT_L8_UNORM: @@ -1324,7 +1324,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, case PIPE_FORMAT_I8_UNORM: i8_put_tile_rgba((ubyte *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: a8l8_put_tile_rgba((ushort *) packed, w, h, p, src_stride); break; case PIPE_FORMAT_R16_SNORM: @@ -1333,10 +1333,10 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, case PIPE_FORMAT_R16G16B16A16_SNORM: r16g16b16a16_put_tile_rgba((short *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_B8G8R8A8_SRGB: a8r8g8b8_srgb_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_A8L8_SRGB: + case PIPE_FORMAT_L8A8_SRGB: a8l8_srgb_put_tile_rgba((ushort *) packed, w, h, p, src_stride); break; case PIPE_FORMAT_L8_SRGB: @@ -1348,12 +1348,12 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, case PIPE_FORMAT_Z32_UNORM: /*z32_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ break; - case PIPE_FORMAT_S8Z24_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: - /*s8z24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ - break; case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z24X8_UNORM: + /*s8z24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ + break; + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ break; default: @@ -1405,8 +1405,8 @@ pipe_get_tile_z(struct pipe_transfer *pt, } } break; - case PIPE_FORMAT_S8Z24_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: { const uint *ptrc = (const uint *)(map + y * pt->stride + x*4); @@ -1420,8 +1420,8 @@ pipe_get_tile_z(struct pipe_transfer *pt, } } break; - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: { const uint *ptrc = (const uint *)(map + y * pt->stride + x*4); @@ -1489,7 +1489,7 @@ pipe_put_tile_z(struct pipe_transfer *pt, } } break; - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: { uint *pDest = (uint *) (map + y * pt->stride + x*4); assert((pt->usage & PIPE_TRANSFER_READ_WRITE) == PIPE_TRANSFER_READ_WRITE); @@ -1503,7 +1503,7 @@ pipe_put_tile_z(struct pipe_transfer *pt, } } break; - case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: { uint *pDest = (uint *) (map + y * pt->stride + x*4); for (i = 0; i < h; i++) { @@ -1516,7 +1516,7 @@ pipe_put_tile_z(struct pipe_transfer *pt, } } break; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: { uint *pDest = (uint *) (map + y * pt->stride + x*4); assert((pt->usage & PIPE_TRANSFER_READ_WRITE) == PIPE_TRANSFER_READ_WRITE); @@ -1530,7 +1530,7 @@ pipe_put_tile_z(struct pipe_transfer *pt, } } break; - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: { uint *pDest = (uint *) (map + y * pt->stride + x*4); for (i = 0; i < h; i++) { -- cgit v1.2.3 From 7a61722f693a39cdeb4f5ab2e905f563f742d2e3 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:09:55 +0000 Subject: draw: Rename pipe formats. --- src/gallium/auxiliary/draw/draw_pipe_vbuf.c | 2 +- src/gallium/auxiliary/draw/draw_pt_emit.c | 2 +- src/gallium/auxiliary/draw/draw_vs_aos_io.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c index d40c035240..2709957961 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c +++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c @@ -262,7 +262,7 @@ vbuf_start_prim( struct vbuf_stage *vbuf, uint prim ) src_offset = 0; break; case EMIT_4UB: - output_format = PIPE_FORMAT_B8G8R8A8_UNORM; + output_format = PIPE_FORMAT_A8R8G8B8_UNORM; emit_sz = 4 * sizeof(ubyte); break; default: diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c index 4fb53276bb..ae357b5122 100644 --- a/src/gallium/auxiliary/draw/draw_pt_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_emit.c @@ -112,7 +112,7 @@ void draw_pt_emit_prepare( struct pt_emit *emit, src_offset = 0; break; case EMIT_4UB: - output_format = PIPE_FORMAT_B8G8R8A8_UNORM; + output_format = PIPE_FORMAT_A8R8G8B8_UNORM; emit_sz = 4 * sizeof(ubyte); break; default: diff --git a/src/gallium/auxiliary/draw/draw_vs_aos_io.c b/src/gallium/auxiliary/draw/draw_vs_aos_io.c index a6eb37d128..ece1ddde0c 100644 --- a/src/gallium/auxiliary/draw/draw_vs_aos_io.c +++ b/src/gallium/auxiliary/draw/draw_vs_aos_io.c @@ -191,7 +191,7 @@ static boolean load_input( struct aos_compilation *cp, case PIPE_FORMAT_R32G32B32A32_FLOAT: emit_load_R32G32B32A32(cp, dataXMM, src); break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: emit_load_R8G8B8A8_UNORM(cp, dataXMM, src); emit_swizzle(cp, dataXMM, dataXMM, SHUF(Z,Y,X,W)); break; -- cgit v1.2.3 From a48975347126aacf3a82a5b3e3c69bffd491020a Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:10:07 +0000 Subject: translate: Rename pipe formats. --- src/gallium/auxiliary/translate/translate_generic.c | 8 ++++---- src/gallium/auxiliary/translate/translate_sse.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c index 24727d4988..c9ec2b32bf 100644 --- a/src/gallium/auxiliary/translate/translate_generic.c +++ b/src/gallium/auxiliary/translate/translate_generic.c @@ -392,10 +392,10 @@ static fetch_func get_fetch_func( enum pipe_format format ) case PIPE_FORMAT_R8G8B8A8_SSCALED: return &fetch_R8G8B8A8_SSCALED; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return &fetch_A8R8G8B8_UNORM; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: return &fetch_B8G8R8A8_UNORM; case PIPE_FORMAT_R32_FIXED: @@ -551,10 +551,10 @@ static emit_func get_emit_func( enum pipe_format format ) case PIPE_FORMAT_R8G8B8A8_SSCALED: return &emit_R8G8B8A8_SSCALED; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return &emit_A8R8G8B8_UNORM; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: return &emit_B8G8R8A8_UNORM; default: diff --git a/src/gallium/auxiliary/translate/translate_sse.c b/src/gallium/auxiliary/translate/translate_sse.c index c13e742738..03e093c11e 100644 --- a/src/gallium/auxiliary/translate/translate_sse.c +++ b/src/gallium/auxiliary/translate/translate_sse.c @@ -336,7 +336,7 @@ static boolean translate_attr( struct translate_sse *p, case PIPE_FORMAT_R32G32B32A32_FLOAT: emit_load_R32G32B32A32(p, dataXMM, srcECX); break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: emit_load_R8G8B8A8_UNORM(p, dataXMM, srcECX); emit_swizzle(p, dataXMM, dataXMM, SHUF(Z,Y,X,W)); break; @@ -360,7 +360,7 @@ static boolean translate_attr( struct translate_sse *p, case PIPE_FORMAT_R32G32B32A32_FLOAT: emit_store_R32G32B32A32(p, dstEAX, dataXMM); break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: emit_swizzle(p, dataXMM, dataXMM, SHUF(Z,Y,X,W)); emit_store_R8G8B8A8_UNORM(p, dstEAX, dataXMM); break; -- cgit v1.2.3 From 7d1a79a04eb1266649956f6924f25071d85e20fe Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:10:23 +0000 Subject: mesa: Rename pipe formats. --- src/mesa/state_tracker/st_cb_drawpixels.c | 8 +- src/mesa/state_tracker/st_cb_fbo.c | 14 +-- src/mesa/state_tracker/st_cb_readpixels.c | 18 ++-- src/mesa/state_tracker/st_draw.c | 2 +- src/mesa/state_tracker/st_extensions.c | 16 ++-- src/mesa/state_tracker/st_format.c | 144 +++++++++++++++--------------- 6 files changed, 101 insertions(+), 101 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index ba28a224e8..98453321f8 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -713,7 +713,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, memcpy(dest, sValues, spanWidth); } break; - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: if (format == GL_DEPTH_STENCIL) { uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); GLint k; @@ -731,7 +731,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, } } break; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: if (format == GL_DEPTH_STENCIL) { uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); GLint k; @@ -879,7 +879,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, src = buffer + i * width; switch (ptDraw->texture->format) { - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: { uint *dst4 = (uint *) dst; int j; @@ -890,7 +890,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } } break; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: { uint *dst4 = (uint *) dst; int j; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index ea040bdc4f..8fded0c69f 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -238,13 +238,13 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) strb->software = sw; switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_B8G8R8A8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: case PIPE_FORMAT_B8G8R8X8_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: strb->Base.InternalFormat = GL_RGBA; break; case PIPE_FORMAT_Z16_UNORM: @@ -253,10 +253,10 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) case PIPE_FORMAT_Z32_UNORM: strb->Base.InternalFormat = GL_DEPTH_COMPONENT32; break; - case PIPE_FORMAT_S8Z24_UNORM: case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: strb->Base.InternalFormat = GL_DEPTH24_STENCIL8_EXT; break; case PIPE_FORMAT_S8_UNORM: diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 6b1fdf3ecd..952d9ce915 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -108,7 +108,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, memcpy(sValues, src, width); } break; - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: if (format == GL_DEPTH_STENCIL) { const uint *src = (uint *) (stmap + srcY * pt->stride); const GLfloat scale = 1.0f / (0xffffff); @@ -126,7 +126,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, } } break; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: if (format == GL_DEPTH_STENCIL) { const uint *src = (uint *) (stmap + srcY * pt->stride); const GLfloat scale = 1.0f / (0xffffff); @@ -214,15 +214,15 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb, if (ctx->_ImageTransferState) return GL_FALSE; - if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM && + if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM && format == GL_RGBA && type == GL_UNSIGNED_BYTE) { combo = A8R8G8B8_UNORM_TO_RGBA_UBYTE; } - else if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM && + else if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM && format == GL_RGB && type == GL_UNSIGNED_BYTE) { combo = A8R8G8B8_UNORM_TO_RGB_UBYTE; } - else if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM && + else if (strb->format == PIPE_FORMAT_B8G8R8A8_UNORM && format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV) { combo = A8R8G8B8_UNORM_TO_BGRA_UINT; } @@ -429,8 +429,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width, format, type); - if (trans->texture->format == PIPE_FORMAT_S8Z24_UNORM || - trans->texture->format == PIPE_FORMAT_X8Z24_UNORM) { + if (trans->texture->format == PIPE_FORMAT_Z24S8_UNORM || + trans->texture->format == PIPE_FORMAT_Z24X8_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; @@ -461,8 +461,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } } } - else if (trans->texture->format == PIPE_FORMAT_Z24S8_UNORM || - trans->texture->format == PIPE_FORMAT_Z24X8_UNORM) { + else if (trans->texture->format == PIPE_FORMAT_S8Z24_UNORM || + trans->texture->format == PIPE_FORMAT_X8Z24_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 4b48c168e9..32b9a473cf 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -183,7 +183,7 @@ st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, /* this is an odd-ball case */ assert(type == GL_UNSIGNED_BYTE); assert(normalized); - return PIPE_FORMAT_B8G8R8A8_UNORM; + return PIPE_FORMAT_A8R8G8B8_UNORM; } if (normalized) { diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index e9ee65576d..79be833768 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -270,28 +270,28 @@ void st_init_extensions(struct st_context *st) /* GL_EXT_packed_depth_stencil requires both the ability to render to * a depth/stencil buffer and texture from depth/stencil source. */ - if (screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM, + if (screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) && - screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM, + screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0)) { ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; } - else if (screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM, + else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) && - screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM, + screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0)) { ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; } /* sRGB support */ - if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SRGB, + if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0) || - screen->is_format_supported(screen, PIPE_FORMAT_A8R8G8B8_SRGB, + screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0)) { ctx->Extensions.EXT_texture_sRGB = GL_TRUE; @@ -310,10 +310,10 @@ void st_init_extensions(struct st_context *st) } /* ycbcr support */ - if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR, + if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0) || - screen->is_format_supported(screen, PIPE_FORMAT_YCBCR_REV, + screen->is_format_supported(screen, PIPE_FORMAT_YUYV, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0)) { ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index f24d6c8686..9ae0c9f9ba 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -72,12 +72,12 @@ st_format_datatype(enum pipe_format format) assert(desc); if (desc->layout == UTIL_FORMAT_LAYOUT_PLAIN) { - if (format == PIPE_FORMAT_A1R5G5B5_UNORM || - format == PIPE_FORMAT_R5G6B5_UNORM) { + if (format == PIPE_FORMAT_B5G5R5A1_UNORM || + format == PIPE_FORMAT_B5G6R5_UNORM) { return GL_UNSIGNED_SHORT; } - else if (format == PIPE_FORMAT_S8Z24_UNORM || - format == PIPE_FORMAT_Z24S8_UNORM) { + else if (format == PIPE_FORMAT_Z24S8_UNORM || + format == PIPE_FORMAT_S8Z24_UNORM) { return GL_UNSIGNED_INT_24_8; } else { @@ -103,10 +103,10 @@ st_format_datatype(enum pipe_format format) } } } - else if (format == PIPE_FORMAT_YCBCR) { + else if (format == PIPE_FORMAT_UYVY) { return GL_UNSIGNED_SHORT; } - else if (format == PIPE_FORMAT_YCBCR_REV) { + else if (format == PIPE_FORMAT_YUYV) { return GL_UNSIGNED_SHORT; } else { @@ -129,17 +129,17 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) /* fix this */ case MESA_FORMAT_ARGB8888_REV: case MESA_FORMAT_ARGB8888: - return PIPE_FORMAT_A8R8G8B8_UNORM; + return PIPE_FORMAT_B8G8R8A8_UNORM; case MESA_FORMAT_XRGB8888: - return PIPE_FORMAT_X8R8G8B8_UNORM; + return PIPE_FORMAT_B8G8R8X8_UNORM; case MESA_FORMAT_ARGB1555: - return PIPE_FORMAT_A1R5G5B5_UNORM; + return PIPE_FORMAT_B5G5R5A1_UNORM; case MESA_FORMAT_ARGB4444: - return PIPE_FORMAT_A4R4G4B4_UNORM; + return PIPE_FORMAT_B4G4R4A4_UNORM; case MESA_FORMAT_RGB565: - return PIPE_FORMAT_R5G6B5_UNORM; + return PIPE_FORMAT_B5G6R5_UNORM; case MESA_FORMAT_AL88: - return PIPE_FORMAT_A8L8_UNORM; + return PIPE_FORMAT_L8A8_UNORM; case MESA_FORMAT_A8: return PIPE_FORMAT_A8_UNORM; case MESA_FORMAT_L8: @@ -151,11 +151,11 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) case MESA_FORMAT_Z32: return PIPE_FORMAT_Z32_UNORM; case MESA_FORMAT_Z24_S8: - return PIPE_FORMAT_Z24S8_UNORM; - case MESA_FORMAT_S8_Z24: return PIPE_FORMAT_S8Z24_UNORM; + case MESA_FORMAT_S8_Z24: + return PIPE_FORMAT_Z24S8_UNORM; case MESA_FORMAT_YCBCR: - return PIPE_FORMAT_YCBCR; + return PIPE_FORMAT_UYVY; #if FEATURE_texture_s3tc case MESA_FORMAT_RGB_DXT1: return PIPE_FORMAT_DXT1_RGB; @@ -178,15 +178,15 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) #endif #if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SLA8: - return PIPE_FORMAT_A8L8_SRGB; + return PIPE_FORMAT_L8A8_SRGB; case MESA_FORMAT_SL8: return PIPE_FORMAT_L8_SRGB; case MESA_FORMAT_SRGB8: return PIPE_FORMAT_R8G8B8_SRGB; case MESA_FORMAT_SRGBA8: - return PIPE_FORMAT_R8G8B8A8_SRGB; + return PIPE_FORMAT_A8B8G8R8_SRGB; case MESA_FORMAT_SARGB8: - return PIPE_FORMAT_A8R8G8B8_SRGB; + return PIPE_FORMAT_B8G8R8A8_SRGB; #endif default: assert(0); @@ -202,21 +202,21 @@ gl_format st_pipe_format_to_mesa_format(enum pipe_format format) { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return MESA_FORMAT_ARGB8888; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: return MESA_FORMAT_XRGB8888; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: return MESA_FORMAT_ARGB8888_REV; - case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_X8R8G8B8_UNORM: return MESA_FORMAT_XRGB8888_REV; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return MESA_FORMAT_ARGB1555; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: return MESA_FORMAT_ARGB4444; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return MESA_FORMAT_RGB565; - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: return MESA_FORMAT_AL88; case PIPE_FORMAT_A8_UNORM: return MESA_FORMAT_A8; @@ -234,18 +234,18 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_Z16; case PIPE_FORMAT_Z32_UNORM: return MESA_FORMAT_Z32; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return MESA_FORMAT_Z24_S8; - case PIPE_FORMAT_Z24X8_UNORM: - return MESA_FORMAT_Z24_X8; case PIPE_FORMAT_X8Z24_UNORM: + return MESA_FORMAT_Z24_X8; + case PIPE_FORMAT_Z24X8_UNORM: return MESA_FORMAT_X8_Z24; - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: return MESA_FORMAT_S8_Z24; - case PIPE_FORMAT_YCBCR: + case PIPE_FORMAT_UYVY: return MESA_FORMAT_YCBCR; - case PIPE_FORMAT_YCBCR_REV: + case PIPE_FORMAT_YUYV: return MESA_FORMAT_YCBCR_REV; #if FEATURE_texture_s3tc @@ -270,15 +270,15 @@ st_pipe_format_to_mesa_format(enum pipe_format format) #endif #if FEATURE_EXT_texture_sRGB - case PIPE_FORMAT_A8L8_SRGB: + case PIPE_FORMAT_L8A8_SRGB: return MESA_FORMAT_SLA8; case PIPE_FORMAT_L8_SRGB: return MESA_FORMAT_SL8; case PIPE_FORMAT_R8G8B8_SRGB: return MESA_FORMAT_SRGB8; - case PIPE_FORMAT_R8G8B8A8_SRGB: + case PIPE_FORMAT_A8B8G8R8_SRGB: return MESA_FORMAT_SRGBA8; - case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_B8G8R8A8_SRGB: return MESA_FORMAT_SARGB8; #endif default: @@ -298,10 +298,10 @@ default_rgba_format(struct pipe_screen *screen, unsigned geom_flags) { static const enum pipe_format colorFormats[] = { - PIPE_FORMAT_A8R8G8B8_UNORM, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM_REV, - PIPE_FORMAT_R5G6B5_UNORM + PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_A8B8G8R8_UNORM, + PIPE_FORMAT_B5G6R5_UNORM }; uint i; for (i = 0; i < Elements(colorFormats); i++) { @@ -322,13 +322,13 @@ default_rgb_format(struct pipe_screen *screen, unsigned geom_flags) { static const enum pipe_format colorFormats[] = { - PIPE_FORMAT_X8R8G8B8_UNORM, PIPE_FORMAT_B8G8R8X8_UNORM, - PIPE_FORMAT_R8G8B8X8_UNORM, - PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_X8R8G8B8_UNORM, + PIPE_FORMAT_X8B8G8R8_UNORM, PIPE_FORMAT_B8G8R8A8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM_REV, - PIPE_FORMAT_R5G6B5_UNORM + PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_A8B8G8R8_UNORM, + PIPE_FORMAT_B5G6R5_UNORM }; uint i; for (i = 0; i < Elements(colorFormats); i++) { @@ -349,9 +349,9 @@ default_srgba_format(struct pipe_screen *screen, unsigned geom_flags) { static const enum pipe_format colorFormats[] = { - PIPE_FORMAT_A8R8G8B8_SRGB, PIPE_FORMAT_B8G8R8A8_SRGB, - PIPE_FORMAT_R8G8B8A8_SRGB, + PIPE_FORMAT_A8R8G8B8_SRGB, + PIPE_FORMAT_A8B8G8R8_SRGB, }; uint i; for (i = 0; i < Elements(colorFormats); i++) { @@ -393,8 +393,8 @@ default_depth_format(struct pipe_screen *screen, static const enum pipe_format zFormats[] = { PIPE_FORMAT_Z16_UNORM, PIPE_FORMAT_Z32_UNORM, - PIPE_FORMAT_S8Z24_UNORM, - PIPE_FORMAT_Z24S8_UNORM + PIPE_FORMAT_Z24S8_UNORM, + PIPE_FORMAT_S8Z24_UNORM }; uint i; for (i = 0; i < Elements(zFormats); i++) { @@ -439,13 +439,13 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_RGBA4: case GL_RGBA2: - if (screen->is_format_supported( screen, PIPE_FORMAT_A4R4G4B4_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_A4R4G4B4_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_B4G4R4A4_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_B4G4R4A4_UNORM; return default_rgba_format( screen, target, tex_usage, geom_flags ); case GL_RGB5_A1: - if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_A1R5G5B5_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_B5G5R5A1_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_B5G5R5A1_UNORM; return default_rgba_format( screen, target, tex_usage, geom_flags ); case GL_RGB8: @@ -457,10 +457,10 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_RGB5: case GL_RGB4: case GL_R3_G3_B2: - if (screen->is_format_supported( screen, PIPE_FORMAT_R5G6B5_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_R5G6B5_UNORM; - if (screen->is_format_supported( screen, PIPE_FORMAT_A1R5G5B5_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_A1R5G5B5_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_B5G6R5_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_B5G6R5_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_B5G5R5A1_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_B5G5R5A1_UNORM; return default_rgba_format( screen, target, tex_usage, geom_flags ); case GL_ALPHA: @@ -493,8 +493,8 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: - if (screen->is_format_supported( screen, PIPE_FORMAT_A8L8_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_A8L8_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_L8A8_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_L8A8_UNORM; return default_rgba_format( screen, target, tex_usage, geom_flags ); case GL_INTENSITY: @@ -508,13 +508,13 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return default_rgba_format( screen, target, tex_usage, geom_flags ); case GL_YCBCR_MESA: - if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR, + if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY, target, tex_usage, geom_flags)) { - return PIPE_FORMAT_YCBCR; + return PIPE_FORMAT_UYVY; } - if (screen->is_format_supported(screen, PIPE_FORMAT_YCBCR_REV, + if (screen->is_format_supported(screen, PIPE_FORMAT_YUYV, target, tex_usage, geom_flags)) { - return PIPE_FORMAT_YCBCR_REV; + return PIPE_FORMAT_YUYV; } return PIPE_FORMAT_NONE; @@ -546,10 +546,10 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, return PIPE_FORMAT_Z16_UNORM; /* fall-through */ case GL_DEPTH_COMPONENT24: - if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_S8Z24_UNORM; if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, target, tex_usage, geom_flags )) return PIPE_FORMAT_Z24S8_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_S8Z24_UNORM; /* fall-through */ case GL_DEPTH_COMPONENT32: if (screen->is_format_supported( screen, PIPE_FORMAT_Z32_UNORM, target, tex_usage, geom_flags )) @@ -565,18 +565,18 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_STENCIL_INDEX16_EXT: if (screen->is_format_supported( screen, PIPE_FORMAT_S8_UNORM, target, tex_usage, geom_flags )) return PIPE_FORMAT_S8_UNORM; - if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_S8Z24_UNORM; if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, target, tex_usage, geom_flags )) return PIPE_FORMAT_Z24S8_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_S8Z24_UNORM; return PIPE_FORMAT_NONE; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags )) - return PIPE_FORMAT_S8Z24_UNORM; if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, target, tex_usage, geom_flags )) return PIPE_FORMAT_Z24S8_UNORM; + if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, target, tex_usage, geom_flags )) + return PIPE_FORMAT_S8Z24_UNORM; return PIPE_FORMAT_NONE; case GL_SRGB_EXT: @@ -599,8 +599,8 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_SLUMINANCE8_ALPHA8_EXT: case GL_COMPRESSED_SLUMINANCE_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - if (screen->is_format_supported( screen, PIPE_FORMAT_A8L8_SRGB, target, tex_usage, geom_flags )) - return PIPE_FORMAT_A8L8_SRGB; + if (screen->is_format_supported( screen, PIPE_FORMAT_L8A8_SRGB, target, tex_usage, geom_flags )) + return PIPE_FORMAT_L8A8_SRGB; return default_srgba_format( screen, target, tex_usage, geom_flags ); case GL_SLUMINANCE_EXT: @@ -680,11 +680,11 @@ GLboolean st_equal_formats(enum pipe_format pFormat, GLenum format, GLenum type) { switch (pFormat) { - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8B8G8R8_UNORM: return format == GL_RGBA && type == GL_UNSIGNED_BYTE; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: return format == GL_BGRA && type == GL_UNSIGNED_BYTE; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5; /* XXX more combos... */ default: -- cgit v1.2.3 From c456dd5b4be15b1fe842e03dd40da4505e79e3fa Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:10:41 +0000 Subject: dri: Rename pipe formats. --- src/gallium/state_trackers/dri/dri_drawable.c | 14 +++++++------- src/gallium/state_trackers/dri/dri_screen.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 4809b9090d..173f4041c8 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -349,11 +349,11 @@ dri_create_buffer(__DRIscreen * sPriv, if (visual->redBits == 8) { if (visual->alphaBits == 8) - drawable->color_format = PIPE_FORMAT_A8R8G8B8_UNORM; + drawable->color_format = PIPE_FORMAT_B8G8R8A8_UNORM; else - drawable->color_format = PIPE_FORMAT_X8R8G8B8_UNORM; + drawable->color_format = PIPE_FORMAT_B8G8R8X8_UNORM; } else { - drawable->color_format = PIPE_FORMAT_R5G6B5_UNORM; + drawable->color_format = PIPE_FORMAT_B5G6R5_UNORM; } switch(visual->depthBits) { @@ -367,12 +367,12 @@ dri_create_buffer(__DRIscreen * sPriv, case 24: if (visual->stencilBits == 0) { drawable->depth_stencil_format = (screen->d_depth_bits_last) ? - PIPE_FORMAT_X8Z24_UNORM: - PIPE_FORMAT_Z24X8_UNORM; + PIPE_FORMAT_Z24X8_UNORM: + PIPE_FORMAT_X8Z24_UNORM; } else { drawable->depth_stencil_format = (screen->sd_depth_bits_last) ? - PIPE_FORMAT_S8Z24_UNORM: - PIPE_FORMAT_Z24S8_UNORM; + PIPE_FORMAT_Z24S8_UNORM: + PIPE_FORMAT_S8Z24_UNORM; } break; case 32: diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c index 77d640227f..60bc560049 100644 --- a/src/gallium/state_trackers/dri/dri_screen.c +++ b/src/gallium/state_trackers/dri/dri_screen.c @@ -109,22 +109,22 @@ dri_fill_in_modes(struct dri_screen *screen, stencil_bits_array[0] = 0; depth_buffer_factor = 1; - pf_x8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_X8Z24_UNORM, + pf_x8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24X8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); - pf_z24x8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24X8_UNORM, + pf_z24x8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_X8Z24_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); - pf_s8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_S8Z24_UNORM, + pf_s8z24 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24S8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); - pf_z24s8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z24S8_UNORM, + pf_z24s8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_S8Z24_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); - pf_a8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_A8R8G8B8_UNORM, + pf_a8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8A8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0); - pf_x8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_X8R8G8B8_UNORM, + pf_x8r8g8b8 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B8G8R8X8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0); @@ -139,7 +139,7 @@ dri_fill_in_modes(struct dri_screen *screen, pf_z32 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_Z32_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); - pf_r5g6b5 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_R5G6B5_UNORM, + pf_r5g6b5 = p_screen->is_format_supported(p_screen, PIPE_FORMAT_B5G6R5_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0); } else { -- cgit v1.2.3 From ae3926011e6bd08ac921209cb4b189df4c255007 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:10:52 +0000 Subject: egl: Rename pipe formats. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 2 +- src/gallium/state_trackers/egl/kms/native_kms.c | 8 ++++---- src/gallium/state_trackers/egl/x11/native_dri2.c | 12 ++++++------ src/gallium/state_trackers/egl/x11/native_ximage.c | 16 ++++++++-------- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 086e644e21..04268c71c5 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -1097,7 +1097,7 @@ egl_g3d_bind_tex_image(_EGLDriver *drv, _EGLDisplay *dpy, target_format = PIPE_FORMAT_R8G8B8_UNORM; break; case EGL_TEXTURE_RGBA: - target_format = PIPE_FORMAT_A8R8G8B8_UNORM; + target_format = PIPE_FORMAT_B8G8R8A8_UNORM; break; default: return _eglError(EGL_BAD_MATCH, "eglBindTexImage"); diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index ee6ab2e60b..aedf3d430c 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -609,9 +609,9 @@ kms_display_get_configs(struct native_display *ndpy, int *num_configs) /* always double-buffered */ nconf->mode.doubleBufferMode = TRUE; - format = PIPE_FORMAT_A8R8G8B8_UNORM; + format = PIPE_FORMAT_B8G8R8A8_UNORM; if (!kms_display_is_format_supported(&kdpy->base, format, TRUE)) { - format = PIPE_FORMAT_B8G8R8A8_UNORM; + format = PIPE_FORMAT_A8R8G8B8_UNORM; if (!kms_display_is_format_supported(&kdpy->base, format, TRUE)) format = PIPE_FORMAT_NONE; } @@ -625,9 +625,9 @@ kms_display_get_configs(struct native_display *ndpy, int *num_configs) nconf->mode.alphaBits = 8; nconf->mode.rgbBits = 32; - format = PIPE_FORMAT_S8Z24_UNORM; + format = PIPE_FORMAT_Z24S8_UNORM; if (!kms_display_is_format_supported(&kdpy->base, format, FALSE)) { - format = PIPE_FORMAT_Z24S8_UNORM; + format = PIPE_FORMAT_S8Z24_UNORM; if (!kms_display_is_format_supported(&kdpy->base, format, FALSE)) format = PIPE_FORMAT_NONE; } diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index 8df58891a0..74d3d104b9 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -516,17 +516,17 @@ choose_color_format(const __GLcontextModes *mode, enum pipe_format formats[32]) switch (mode->rgbBits) { case 32: - formats[count++] = PIPE_FORMAT_A8R8G8B8_UNORM; formats[count++] = PIPE_FORMAT_B8G8R8A8_UNORM; + formats[count++] = PIPE_FORMAT_A8R8G8B8_UNORM; break; case 24: - formats[count++] = PIPE_FORMAT_X8R8G8B8_UNORM; formats[count++] = PIPE_FORMAT_B8G8R8X8_UNORM; - formats[count++] = PIPE_FORMAT_A8R8G8B8_UNORM; + formats[count++] = PIPE_FORMAT_X8R8G8B8_UNORM; formats[count++] = PIPE_FORMAT_B8G8R8A8_UNORM; + formats[count++] = PIPE_FORMAT_A8R8G8B8_UNORM; break; case 16: - formats[count++] = PIPE_FORMAT_R5G6B5_UNORM; + formats[count++] = PIPE_FORMAT_B5G6R5_UNORM; break; default: break; @@ -547,12 +547,12 @@ choose_depth_stencil_format(const __GLcontextModes *mode, break; case 24: if (mode->stencilBits) { - formats[count++] = PIPE_FORMAT_S8Z24_UNORM; formats[count++] = PIPE_FORMAT_Z24S8_UNORM; + formats[count++] = PIPE_FORMAT_S8Z24_UNORM; } else { - formats[count++] = PIPE_FORMAT_X8Z24_UNORM; formats[count++] = PIPE_FORMAT_Z24X8_UNORM; + formats[count++] = PIPE_FORMAT_X8Z24_UNORM; } break; case 16: diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 8ba73f289d..a8633b1501 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -561,13 +561,13 @@ choose_format(const XVisualInfo *vinfo) /* TODO elaborate the formats */ switch (vinfo->depth) { case 32: - fmt = PIPE_FORMAT_A8R8G8B8_UNORM; + fmt = PIPE_FORMAT_B8G8R8A8_UNORM; break; case 24: - fmt = PIPE_FORMAT_X8R8G8B8_UNORM; + fmt = PIPE_FORMAT_B8G8R8X8_UNORM; break; case 16: - fmt = PIPE_FORMAT_R5G6B5_UNORM; + fmt = PIPE_FORMAT_B5G6R5_UNORM; break; default: fmt = PIPE_FORMAT_NONE; @@ -620,8 +620,8 @@ ximage_display_get_configs(struct native_display *ndpy, int *num_configs) xconf->base.stencil_format = PIPE_FORMAT_NONE; /* create the second config with depth/stencil buffer */ if (j == 1) { - xconf->base.depth_format = PIPE_FORMAT_S8Z24_UNORM; - xconf->base.stencil_format = PIPE_FORMAT_S8Z24_UNORM; + xconf->base.depth_format = PIPE_FORMAT_Z24S8_UNORM; + xconf->base.stencil_format = PIPE_FORMAT_Z24S8_UNORM; mode->depthBits = 24; mode->stencilBits = 8; mode->haveDepthBuffer = TRUE; @@ -669,13 +669,13 @@ ximage_display_is_pixmap_supported(struct native_display *ndpy, depth = x11_drawable_get_depth(xdpy->xscr, (Drawable) pix); switch (depth) { case 32: - fmt = PIPE_FORMAT_A8R8G8B8_UNORM; + fmt = PIPE_FORMAT_B8G8R8A8_UNORM; break; case 24: - fmt = PIPE_FORMAT_X8R8G8B8_UNORM; + fmt = PIPE_FORMAT_B8G8R8X8_UNORM; break; case 16: - fmt = PIPE_FORMAT_R5G6B5_UNORM; + fmt = PIPE_FORMAT_B5G6R5_UNORM; break; default: fmt = PIPE_FORMAT_NONE; -- cgit v1.2.3 From 41b80461b77abbd595d7597bea2a2585875e8a74 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:11:04 +0000 Subject: glx: Rename pipe formats. --- src/gallium/state_trackers/glx/xlib/xm_api.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 228e6d0a50..68518b19b9 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -277,7 +277,7 @@ choose_pixel_format(XMesaVisual v) return PIPE_FORMAT_R8G8B8A8_UNORM; } else { - return PIPE_FORMAT_R8G8B8A8_UNORM_REV; + return PIPE_FORMAT_A8B8G8R8_UNORM; } } else if ( GET_REDMASK(v) == 0xff0000 @@ -286,10 +286,10 @@ choose_pixel_format(XMesaVisual v) && v->BitsPerPixel == 32) { if (native_byte_order) { /* no byteswapping needed */ - return PIPE_FORMAT_A8R8G8B8_UNORM; + return PIPE_FORMAT_B8G8R8A8_UNORM; } else { - return PIPE_FORMAT_B8G8R8A8_UNORM; + return PIPE_FORMAT_A8R8G8B8_UNORM; } } else if ( GET_REDMASK(v) == 0x0000ff00 @@ -298,10 +298,10 @@ choose_pixel_format(XMesaVisual v) && v->BitsPerPixel == 32) { if (native_byte_order) { /* no byteswapping needed */ - return PIPE_FORMAT_B8G8R8A8_UNORM; + return PIPE_FORMAT_A8R8G8B8_UNORM; } else { - return PIPE_FORMAT_A8R8G8B8_UNORM; + return PIPE_FORMAT_B8G8R8A8_UNORM; } } else if ( GET_REDMASK(v) == 0xf800 @@ -310,7 +310,7 @@ choose_pixel_format(XMesaVisual v) && native_byte_order && v->BitsPerPixel == 16) { /* 5-6-5 RGB */ - return PIPE_FORMAT_R5G6B5_UNORM; + return PIPE_FORMAT_B5G6R5_UNORM; } assert(0); @@ -333,8 +333,8 @@ xmesa_choose_z_stencil_format(int depthBits, int stencilBits, const unsigned geom_flags = (PIPE_TEXTURE_GEOM_NON_SQUARE | PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO); static enum pipe_format formats[] = { - PIPE_FORMAT_Z24S8_UNORM, PIPE_FORMAT_S8Z24_UNORM, + PIPE_FORMAT_Z24S8_UNORM, PIPE_FORMAT_Z16_UNORM, PIPE_FORMAT_Z32_UNORM }; -- cgit v1.2.3 From d34a1a7028d76d783bbe0337c1b5613e37b31179 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:11:24 +0000 Subject: xorg: Rename pipe formats. --- src/gallium/state_trackers/xorg/xorg_crtc.c | 2 +- src/gallium/state_trackers/xorg/xorg_dri2.c | 8 ++++---- src/gallium/state_trackers/xorg/xorg_exa.c | 10 +++++----- src/gallium/state_trackers/xorg/xvmc/surface.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index 221ce772af..000ec9048f 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -205,7 +205,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image) templat.target = PIPE_TEXTURE_2D; templat.last_level = 0; templat.depth0 = 1; - templat.format = PIPE_FORMAT_A8R8G8B8_UNORM; + templat.format = PIPE_FORMAT_B8G8R8A8_UNORM; templat.width0 = 64; templat.height0 = 64; diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 5b67392435..5fc85c0e98 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -116,12 +116,12 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form break; default: template.format = ms->ds_depth_bits_last ? - PIPE_FORMAT_X8Z24_UNORM : PIPE_FORMAT_Z24X8_UNORM; + PIPE_FORMAT_Z24X8_UNORM : PIPE_FORMAT_X8Z24_UNORM; break; } } else { template.format = ms->ds_depth_bits_last ? - PIPE_FORMAT_S8Z24_UNORM : PIPE_FORMAT_Z24S8_UNORM; + PIPE_FORMAT_Z24S8_UNORM : PIPE_FORMAT_S8Z24_UNORM; } template.width0 = pDraw->width; template.height0 = pDraw->height; @@ -431,11 +431,11 @@ xorg_dri2_init(ScreenPtr pScreen) dri2info.Wait = NULL; ms->d_depth_bits_last = - ms->screen->is_format_supported(ms->screen, PIPE_FORMAT_X8Z24_UNORM, + ms->screen->is_format_supported(ms->screen, PIPE_FORMAT_Z24X8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); ms->ds_depth_bits_last = - ms->screen->is_format_supported(ms->screen, PIPE_FORMAT_S8Z24_UNORM, + ms->screen->is_format_supported(ms->screen, PIPE_FORMAT_Z24S8_UNORM, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0); diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 665efdc0f0..a242e02ee7 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -118,22 +118,22 @@ exa_get_pipe_format(int depth, enum pipe_format *format, int *bbp, int *picture_ { switch (depth) { case 32: - *format = PIPE_FORMAT_A8R8G8B8_UNORM; + *format = PIPE_FORMAT_B8G8R8A8_UNORM; *picture_format = PICT_a8r8g8b8; assert(*bbp == 32); break; case 24: - *format = PIPE_FORMAT_X8R8G8B8_UNORM; + *format = PIPE_FORMAT_B8G8R8X8_UNORM; *picture_format = PICT_x8r8g8b8; assert(*bbp == 32); break; case 16: - *format = PIPE_FORMAT_R5G6B5_UNORM; + *format = PIPE_FORMAT_B5G6R5_UNORM; *picture_format = PICT_r5g6b5; assert(*bbp == 16); break; case 15: - *format = PIPE_FORMAT_A1R5G5B5_UNORM; + *format = PIPE_FORMAT_B5G5R5A1_UNORM; *picture_format = PICT_x1r5g5b5; assert(*bbp == 16); break; @@ -144,7 +144,7 @@ exa_get_pipe_format(int depth, enum pipe_format *format, int *bbp, int *picture_ break; case 4: case 1: - *format = PIPE_FORMAT_A8R8G8B8_UNORM; /* bad bad bad */ + *format = PIPE_FORMAT_B8G8R8A8_UNORM; /* bad bad bad */ break; default: assert(0); diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index 0e39a390c6..87d1dfaace 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -101,7 +101,7 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u memset(&template, 0, sizeof(struct pipe_texture)); template.target = PIPE_TEXTURE_2D; /* XXX: Needs to match the drawable's format? */ - template.format = PIPE_FORMAT_X8R8G8B8_UNORM; + template.format = PIPE_FORMAT_B8G8R8X8_UNORM; template.last_level = 0; template.width0 = width; template.height0 = height; -- cgit v1.2.3 From 5706d7fcaf3c3238c652593d5669b9f793c6cdce Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:11:30 +0000 Subject: wgl: Rename pipe formats. --- src/gallium/state_trackers/wgl/stw_pixelformat.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/stw_pixelformat.c b/src/gallium/state_trackers/wgl/stw_pixelformat.c index b750b03695..f8edc560c5 100644 --- a/src/gallium/state_trackers/wgl/stw_pixelformat.c +++ b/src/gallium/state_trackers/wgl/stw_pixelformat.c @@ -74,17 +74,17 @@ struct stw_pf_depth_info static const struct stw_pf_color_info stw_pf_color[] = { /* no-alpha */ - { PIPE_FORMAT_X8R8G8B8_UNORM, { 8, 8, 8, 0}, {16, 8, 0, 0} }, - { PIPE_FORMAT_B8G8R8X8_UNORM, { 8, 8, 8, 0}, { 8, 16, 24, 0} }, - { PIPE_FORMAT_R5G6B5_UNORM, { 5, 6, 5, 0}, {11, 5, 0, 0} }, + { PIPE_FORMAT_B8G8R8X8_UNORM, { 8, 8, 8, 0}, {16, 8, 0, 0} }, + { PIPE_FORMAT_X8R8G8B8_UNORM, { 8, 8, 8, 0}, { 8, 16, 24, 0} }, + { PIPE_FORMAT_B5G6R5_UNORM, { 5, 6, 5, 0}, {11, 5, 0, 0} }, /* alpha */ - { PIPE_FORMAT_A8R8G8B8_UNORM, { 8, 8, 8, 8}, {16, 8, 0, 24} }, - { PIPE_FORMAT_B8G8R8A8_UNORM, { 8, 8, 8, 8}, { 8, 16, 24, 0} }, + { PIPE_FORMAT_B8G8R8A8_UNORM, { 8, 8, 8, 8}, {16, 8, 0, 24} }, + { PIPE_FORMAT_A8R8G8B8_UNORM, { 8, 8, 8, 8}, { 8, 16, 24, 0} }, #if 0 - { PIPE_FORMAT_A2B10G10R10_UNORM, {10, 10, 10, 2}, { 0, 10, 20, 30} }, + { PIPE_FORMAT_R10G10B10A2_UNORM, {10, 10, 10, 2}, { 0, 10, 20, 30} }, #endif - { PIPE_FORMAT_A1R5G5B5_UNORM, { 5, 5, 5, 1}, {10, 5, 0, 15} }, - { PIPE_FORMAT_A4R4G4B4_UNORM, { 4, 4, 4, 4}, {16, 4, 0, 12} } + { PIPE_FORMAT_B5G5R5A1_UNORM, { 5, 5, 5, 1}, {10, 5, 0, 15} }, + { PIPE_FORMAT_B4G4R4A4_UNORM, { 4, 4, 4, 4}, {16, 4, 0, 12} } }; @@ -92,12 +92,12 @@ static const struct stw_pf_depth_info stw_pf_depth_stencil[] = { /* pure depth */ { PIPE_FORMAT_Z32_UNORM, {32, 0} }, - { PIPE_FORMAT_Z24X8_UNORM, {24, 0} }, { PIPE_FORMAT_X8Z24_UNORM, {24, 0} }, + { PIPE_FORMAT_Z24X8_UNORM, {24, 0} }, { PIPE_FORMAT_Z16_UNORM, {16, 0} }, /* combined depth-stencil */ - { PIPE_FORMAT_S8Z24_UNORM, {24, 8} }, - { PIPE_FORMAT_Z24S8_UNORM, {24, 8} } + { PIPE_FORMAT_Z24S8_UNORM, {24, 8} }, + { PIPE_FORMAT_S8Z24_UNORM, {24, 8} } }; -- cgit v1.2.3 From b306308757c0ce3cf47a50bac12bb39f212ca6b2 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:11:46 +0000 Subject: vega: Rename pipe formats. --- src/gallium/state_trackers/vega/api_filters.c | 2 +- src/gallium/state_trackers/vega/image.c | 10 +++++----- src/gallium/state_trackers/vega/mask.c | 2 +- src/gallium/state_trackers/vega/paint.c | 2 +- src/gallium/state_trackers/vega/vg_tracker.c | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c index 20c72c1ff5..02248ad433 100644 --- a/src/gallium/state_trackers/vega/api_filters.c +++ b/src/gallium/state_trackers/vega/api_filters.c @@ -67,7 +67,7 @@ static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx, memset(&templ, 0, sizeof(templ)); templ.target = PIPE_TEXTURE_1D; - templ.format = PIPE_FORMAT_A8R8G8B8_UNORM; + templ.format = PIPE_FORMAT_B8G8R8A8_UNORM; templ.last_level = 0; templ.width0 = color_data_len; templ.height0 = 1; diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c index 2e10965be4..41c979bfec 100644 --- a/src/gallium/state_trackers/vega/image.c +++ b/src/gallium/state_trackers/vega/image.c @@ -48,16 +48,16 @@ static enum pipe_format vg_format_to_pipe(VGImageFormat format) { switch(format) { case VG_sRGB_565: - return PIPE_FORMAT_R5G6B5_UNORM; + return PIPE_FORMAT_B5G6R5_UNORM; case VG_sRGBA_5551: - return PIPE_FORMAT_A1R5G5B5_UNORM; + return PIPE_FORMAT_B5G5R5A1_UNORM; case VG_sRGBA_4444: - return PIPE_FORMAT_A4R4G4B4_UNORM; + return PIPE_FORMAT_B4G4R4A4_UNORM; case VG_sL_8: case VG_lL_8: return PIPE_FORMAT_L8_UNORM; case VG_BW_1: - return PIPE_FORMAT_A8R8G8B8_UNORM; + return PIPE_FORMAT_B8G8R8A8_UNORM; case VG_A_8: return PIPE_FORMAT_A8_UNORM; #ifdef OPENVG_VERSION_1_1 @@ -66,7 +66,7 @@ static enum pipe_format vg_format_to_pipe(VGImageFormat format) return PIPE_FORMAT_A8_UNORM; #endif default: - return PIPE_FORMAT_A8R8G8B8_UNORM; + return PIPE_FORMAT_B8G8R8A8_UNORM; } } diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c index 467b95b751..839dc19a3b 100644 --- a/src/gallium/state_trackers/vega/mask.c +++ b/src/gallium/state_trackers/vega/mask.c @@ -488,7 +488,7 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height) memset(&pt, 0, sizeof(pt)); pt.target = PIPE_TEXTURE_2D; - pt.format = PIPE_FORMAT_A8R8G8B8_UNORM; + pt.format = PIPE_FORMAT_B8G8R8A8_UNORM; pt.last_level = 0; pt.width0 = width; pt.height0 = height; diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c index 3405d635f0..caf0c14b74 100644 --- a/src/gallium/state_trackers/vega/paint.c +++ b/src/gallium/state_trackers/vega/paint.c @@ -151,7 +151,7 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p) memset(&templ, 0, sizeof(templ)); templ.target = PIPE_TEXTURE_1D; - templ.format = PIPE_FORMAT_A8R8G8B8_UNORM; + templ.format = PIPE_FORMAT_B8G8R8A8_UNORM; templ.last_level = 0; templ.width0 = 1024; templ.height0 = 1; diff --git a/src/gallium/state_trackers/vega/vg_tracker.c b/src/gallium/state_trackers/vega/vg_tracker.c index a94dfb160c..57d3baad7f 100644 --- a/src/gallium/state_trackers/vega/vg_tracker.c +++ b/src/gallium/state_trackers/vega/vg_tracker.c @@ -51,7 +51,7 @@ create_texture(struct pipe_context *pipe, enum pipe_format format, templ.format = format; } else { - templ.format = PIPE_FORMAT_A8R8G8B8_UNORM; + templ.format = PIPE_FORMAT_B8G8R8A8_UNORM; } templ.target = PIPE_TEXTURE_2D; @@ -186,7 +186,7 @@ struct st_framebuffer * st_create_framebuffer(const void *visual, if (stencilFormat == depthFormat) stfb->dsrb = st_new_renderbuffer_fb(stencilFormat); else - stfb->dsrb = st_new_renderbuffer_fb(PIPE_FORMAT_S8Z24_UNORM); + stfb->dsrb = st_new_renderbuffer_fb(PIPE_FORMAT_Z24S8_UNORM); /*### currently we always allocate it but it's possible it's not necessary if EGL_ALPHA_MASK_SIZE was 0 @@ -209,12 +209,12 @@ static void setup_new_alpha_mask(struct vg_context *ctx, struct pipe_texture *old_texture = stfb->alpha_mask; /* - we use PIPE_FORMAT_A8R8G8B8_UNORM because we want to render to + we use PIPE_FORMAT_B8G8R8A8_UNORM because we want to render to this texture and use it as a sampler, so while this wastes some space it makes both of those a lot simpler */ stfb->alpha_mask = - create_texture(pipe, PIPE_FORMAT_A8R8G8B8_UNORM, width, height); + create_texture(pipe, PIPE_FORMAT_B8G8R8A8_UNORM, width, height); if (!stfb->alpha_mask) { if (old_texture) @@ -327,7 +327,7 @@ void st_resize_framebuffer(struct st_framebuffer *stfb, setup_new_alpha_mask(ctx, stfb, width, height); pipe_texture_reference( &stfb->blend_texture, NULL ); - stfb->blend_texture = create_texture(ctx->pipe, PIPE_FORMAT_A8R8G8B8_UNORM, + stfb->blend_texture = create_texture(ctx->pipe, PIPE_FORMAT_B8G8R8A8_UNORM, width, height); } -- cgit v1.2.3 From 0b6e45e1ee55a63db5cb43fe863e054e13e87869 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:11:55 +0000 Subject: python: Rename pipe formats. --- src/gallium/state_trackers/python/st_device.c | 2 +- src/gallium/state_trackers/python/st_sample.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index a3798a5521..45e7841750 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -244,7 +244,7 @@ st_context_create(struct st_device *st_dev) memset( &templat, 0, sizeof( templat ) ); templat.target = PIPE_TEXTURE_2D; - templat.format = PIPE_FORMAT_A8R8G8B8_UNORM; + templat.format = PIPE_FORMAT_B8G8R8A8_UNORM; templat.width0 = 1; templat.height0 = 1; templat.depth0 = 1; diff --git a/src/gallium/state_trackers/python/st_sample.c b/src/gallium/state_trackers/python/st_sample.c index 32a6551a87..e180815346 100644 --- a/src/gallium/state_trackers/python/st_sample.c +++ b/src/gallium/state_trackers/python/st_sample.c @@ -485,7 +485,7 @@ st_sample_generic_pixel_block(enum pipe_format format, w, h, rgba, rgba_stride); - if(format == PIPE_FORMAT_YCBCR || format == PIPE_FORMAT_YCBCR_REV) { + if(format == PIPE_FORMAT_UYVY || format == PIPE_FORMAT_YUYV) { for(y = 0; y < h; ++y) { for(x = 0; x < w; ++x) { for(ch = 0; ch < 4; ++ch) { -- cgit v1.2.3 From c828f784e54fa3bec3c4295dfdffce0ae9fb5e9c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:12:09 +0000 Subject: cell: Rename pipe formats. --- src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 30 +++++++++++----------- src/gallium/drivers/cell/ppu/cell_screen.c | 2 +- .../drivers/cell/ppu/cell_state_per_fragment.c | 4 +-- src/gallium/drivers/cell/spu/spu_command.c | 4 +-- src/gallium/drivers/cell/spu/spu_per_fragment_op.c | 18 ++++++------- 5 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c index 70683bb367..576d514741 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c +++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c @@ -304,7 +304,7 @@ unpack_colors(struct spe_function *f, spe_comment(f, 0, "Unpack framebuffer colors, convert to floats"); switch (color_format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: /* fbB = fbRGBA & mask */ spe_and(f, fbB_reg, fbRGBA_reg, mask0_reg); @@ -327,7 +327,7 @@ unpack_colors(struct spe_function *f, spe_roti(f, fbA_reg, fbA_reg, -24); break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: /* fbA = fbRGBA & mask */ spe_and(f, fbA_reg, fbRGBA_reg, mask0_reg); @@ -1043,12 +1043,12 @@ gen_pack_colors(struct spe_function *f, spe_rotmi(f, a_reg, a_reg, -24); /* Shift the color bytes according to the surface format */ - if (color_format == PIPE_FORMAT_A8R8G8B8_UNORM) { + if (color_format == PIPE_FORMAT_B8G8R8A8_UNORM) { spe_roti(f, g_reg, g_reg, 8); /* green <<= 8 */ spe_roti(f, r_reg, r_reg, 16); /* red <<= 16 */ spe_roti(f, a_reg, a_reg, 24); /* alpha <<= 24 */ } - else if (color_format == PIPE_FORMAT_B8G8R8A8_UNORM) { + else if (color_format == PIPE_FORMAT_A8R8G8B8_UNORM) { spe_roti(f, r_reg, r_reg, 8); /* red <<= 8 */ spe_roti(f, g_reg, g_reg, 16); /* green <<= 16 */ spe_roti(f, b_reg, b_reg, 24); /* blue <<= 24 */ @@ -1096,14 +1096,14 @@ gen_colormask(struct spe_function *f, * end up, so we can mask them correctly. */ switch(color_format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: /* ARGB */ a_mask = 0xff000000; r_mask = 0x00ff0000; g_mask = 0x0000ff00; b_mask = 0x000000ff; break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: /* BGRA */ b_mask = 0xff000000; g_mask = 0x00ff0000; @@ -1859,8 +1859,8 @@ gen_depth_stencil(struct cell_context *cell, spe_comment(f, 0, "Fetch Z/stencil quad from tile"); switch(zs_format) { - case PIPE_FORMAT_S8Z24_UNORM: /* fall through */ - case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: /* fall through */ + case PIPE_FORMAT_Z24X8_UNORM: /* prepare mask to extract Z vals from ZS vals */ spe_load_uint(f, zmask_reg, 0x00ffffff); @@ -1880,8 +1880,8 @@ gen_depth_stencil(struct cell_context *cell, spe_rotmi(f, fbS_reg, fbZS_reg, -24); break; - case PIPE_FORMAT_Z24S8_UNORM: /* fall through */ - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: /* fall through */ + case PIPE_FORMAT_X8Z24_UNORM: /* convert fragment Z from [0,1] to 32-bit ints */ spe_cfltu(f, fragZ_reg, fragZ_reg, 32); @@ -1969,13 +1969,13 @@ gen_depth_stencil(struct cell_context *cell, * fbS_reg has four 8-bit Z values in bits [7..0]. */ spe_comment(f, 0, "Store quad's depth/stencil values in tile"); - if (zs_format == PIPE_FORMAT_S8Z24_UNORM || - zs_format == PIPE_FORMAT_X8Z24_UNORM) { + if (zs_format == PIPE_FORMAT_Z24S8_UNORM || + zs_format == PIPE_FORMAT_Z24X8_UNORM) { spe_shli(f, fbS_reg, fbS_reg, 24); /* fbS = fbS << 24 */ spe_or(f, fbZS_reg, fbS_reg, fbZ_reg); /* fbZS = fbS | fbZ */ } - else if (zs_format == PIPE_FORMAT_Z24S8_UNORM || - zs_format == PIPE_FORMAT_Z24X8_UNORM) { + else if (zs_format == PIPE_FORMAT_S8Z24_UNORM || + zs_format == PIPE_FORMAT_X8Z24_UNORM) { spe_shli(f, fbZ_reg, fbZ_reg, 8); /* fbZ = fbZ << 8 */ spe_or(f, fbZS_reg, fbS_reg, fbZ_reg); /* fbZS = fbS | fbZ */ } @@ -2015,7 +2015,7 @@ gen_depth_stencil(struct cell_context *cell, * code before the fragment shader to cull fragments/quads that are * totally occluded/discarded. * - * XXX we only support PIPE_FORMAT_Z24S8_UNORM z/stencil buffer right now. + * XXX we only support PIPE_FORMAT_S8Z24_UNORM z/stencil buffer right now. * * See the spu_default_fragment_ops() function to see how the per-fragment * operations would be done with ordinary C code. diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 449855f539..a43f8638dc 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -136,7 +136,7 @@ cell_is_format_supported( struct pipe_screen *screen, { /* cell supports most formats, XXX for now anyway */ if (format == PIPE_FORMAT_DXT5_RGBA || - format == PIPE_FORMAT_R8G8B8A8_SRGB) + format == PIPE_FORMAT_A8B8G8R8_SRGB) return FALSE; else return TRUE; diff --git a/src/gallium/drivers/cell/ppu/cell_state_per_fragment.c b/src/gallium/drivers/cell/ppu/cell_state_per_fragment.c index 07be5e92ea..dc33e7ccc2 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_per_fragment.c +++ b/src/gallium/drivers/cell/ppu/cell_state_per_fragment.c @@ -1251,7 +1251,7 @@ cell_generate_logic_op(struct spe_function *f, /* Convert fragment colors to framebuffer format in AoS layout. */ switch (surf->format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: data[0] = 0x00010203; data[1] = 0x10111213; data[2] = 0x04050607; @@ -1261,7 +1261,7 @@ cell_generate_logic_op(struct spe_function *f, data[6] = 0x80808080; data[7] = 0x80808080; break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: data[0] = 0x03020100; data[1] = 0x13121110; data[2] = 0x07060504; diff --git a/src/gallium/drivers/cell/spu/spu_command.c b/src/gallium/drivers/cell/spu/spu_command.c index 55bd85bde2..79f1fb7fb2 100644 --- a/src/gallium/drivers/cell/spu/spu_command.c +++ b/src/gallium/drivers/cell/spu/spu_command.c @@ -337,10 +337,10 @@ cmd_state_framebuffer(const struct cell_command_framebuffer *cmd) spu.fb.zsize = 4; spu.fb.zscale = (float) 0xffffffffu; break; - case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_S8Z24_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: spu.fb.zsize = 4; spu.fb.zscale = (float) 0x00ffffffu; break; diff --git a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c index 5328374080..2c9e7458af 100644 --- a/src/gallium/drivers/cell/spu/spu_per_fragment_op.c +++ b/src/gallium/drivers/cell/spu/spu_per_fragment_op.c @@ -138,14 +138,14 @@ spu_fallback_fragment_ops(uint x, uint y, if (spu.depth_stencil_alpha.stencil[0].enabled) { /* do stencil test */ - ASSERT(spu.fb.depth_format == PIPE_FORMAT_S8Z24_UNORM); + ASSERT(spu.fb.depth_format == PIPE_FORMAT_Z24S8_UNORM); } else if (spu.depth_stencil_alpha.depth.enabled) { /* do depth test */ - ASSERT(spu.fb.depth_format == PIPE_FORMAT_S8Z24_UNORM || - spu.fb.depth_format == PIPE_FORMAT_X8Z24_UNORM); + ASSERT(spu.fb.depth_format == PIPE_FORMAT_Z24S8_UNORM || + spu.fb.depth_format == PIPE_FORMAT_Z24X8_UNORM); vector unsigned int ifragZ; vector unsigned int zmask; @@ -240,13 +240,13 @@ spu_fallback_fragment_ops(uint x, uint y, { vector float temp[4]; /* float colors in AOS form */ switch (spu.fb.color_format) { - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: temp[0] = spu_unpack_B8G8R8A8(fbc0); temp[1] = spu_unpack_B8G8R8A8(fbc1); temp[2] = spu_unpack_B8G8R8A8(fbc2); temp[3] = spu_unpack_B8G8R8A8(fbc3); break; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: temp[0] = spu_unpack_A8R8G8B8(fbc0); temp[1] = spu_unpack_A8R8G8B8(fbc1); temp[2] = spu_unpack_A8R8G8B8(fbc2); @@ -506,13 +506,13 @@ spu_fallback_fragment_ops(uint x, uint y, * Pack fragment float colors into 32-bit RGBA words. */ switch (spu.fb.color_format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: fragc0 = spu_pack_A8R8G8B8(frag_aos[0]); fragc1 = spu_pack_A8R8G8B8(frag_aos[1]); fragc2 = spu_pack_A8R8G8B8(frag_aos[2]); fragc3 = spu_pack_A8R8G8B8(frag_aos[3]); break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: fragc0 = spu_pack_B8G8R8A8(frag_aos[0]); fragc1 = spu_pack_B8G8R8A8(frag_aos[1]); fragc2 = spu_pack_B8G8R8A8(frag_aos[2]); @@ -532,7 +532,7 @@ spu_fallback_fragment_ops(uint x, uint y, /* Form bitmask depending on color buffer format and colormask bits */ switch (spu.fb.color_format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: if (spu.blend.rt[0].colormask & PIPE_MASK_R) cmask |= 0x00ff0000; /* red */ if (spu.blend.rt[0].colormask & PIPE_MASK_G) @@ -542,7 +542,7 @@ spu_fallback_fragment_ops(uint x, uint y, if (spu.blend.rt[0].colormask & PIPE_MASK_A) cmask |= 0xff000000; /* alpha */ break; - case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_A8R8G8B8_UNORM: if (spu.blend.rt[0].colormask & PIPE_MASK_R) cmask |= 0x0000ff00; /* red */ if (spu.blend.rt[0].colormask & PIPE_MASK_G) -- cgit v1.2.3 From b2b1e899f64ed8a96ea2df6ed45accd430d44363 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:12:19 +0000 Subject: i915g: Rename pipe formats. --- src/gallium/drivers/i915/i915_screen.c | 20 ++++++++++---------- src/gallium/drivers/i915/i915_state_emit.c | 8 ++++---- src/gallium/drivers/i915/i915_state_sampler.c | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index eec2b2895f..72bd263550 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -165,22 +165,22 @@ i915_is_format_supported(struct pipe_screen *screen, unsigned geom_flags) { static const enum pipe_format tex_supported[] = { - PIPE_FORMAT_R8G8B8A8_UNORM_REV, - PIPE_FORMAT_A8R8G8B8_UNORM, - PIPE_FORMAT_R5G6B5_UNORM, + PIPE_FORMAT_A8B8G8R8_UNORM, + PIPE_FORMAT_B8G8R8A8_UNORM, + PIPE_FORMAT_B5G6R5_UNORM, PIPE_FORMAT_L8_UNORM, PIPE_FORMAT_A8_UNORM, PIPE_FORMAT_I8_UNORM, - PIPE_FORMAT_A8L8_UNORM, - PIPE_FORMAT_YCBCR, - PIPE_FORMAT_YCBCR_REV, - PIPE_FORMAT_S8Z24_UNORM, + PIPE_FORMAT_L8A8_UNORM, + PIPE_FORMAT_UYVY, + PIPE_FORMAT_YUYV, + PIPE_FORMAT_Z24S8_UNORM, PIPE_FORMAT_NONE /* list terminator */ }; static const enum pipe_format surface_supported[] = { - PIPE_FORMAT_A8R8G8B8_UNORM, - PIPE_FORMAT_R5G6B5_UNORM, - PIPE_FORMAT_S8Z24_UNORM, + PIPE_FORMAT_B8G8R8A8_UNORM, + PIPE_FORMAT_B5G6R5_UNORM, + PIPE_FORMAT_Z24S8_UNORM, PIPE_FORMAT_NONE /* list terminator */ }; const enum pipe_format *list; diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index a3d4e3b04e..d2ab530d98 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -37,9 +37,9 @@ static unsigned translate_format( enum pipe_format format ) { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return COLOR_BUF_ARGB8888; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return COLOR_BUF_RGB565; default: assert(0); @@ -50,7 +50,7 @@ static unsigned translate_format( enum pipe_format format ) static unsigned translate_depth_format( enum pipe_format zformat ) { switch (zformat) { - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: return DEPTH_FRMT_24_FIXED_8_OTHER; case PIPE_FORMAT_Z16_UNORM: return DEPTH_FRMT_16_FIXED; @@ -259,7 +259,7 @@ i915_emit_hardware_state(struct i915_context *i915 ) if (cbuf_surface) cformat = cbuf_surface->format; else - cformat = PIPE_FORMAT_A8R8G8B8_UNORM; /* arbitrary */ + cformat = PIPE_FORMAT_B8G8R8A8_UNORM; /* arbitrary */ cformat = translate_format(cformat); if (depth_surface) diff --git a/src/gallium/drivers/i915/i915_state_sampler.c b/src/gallium/drivers/i915/i915_state_sampler.c index e5c6d87215..9813290b51 100644 --- a/src/gallium/drivers/i915/i915_state_sampler.c +++ b/src/gallium/drivers/i915/i915_state_sampler.c @@ -87,8 +87,8 @@ static void update_sampler(struct i915_context *i915, state[1] = sampler->state[1]; state[2] = sampler->state[2]; - if (pt->format == PIPE_FORMAT_YCBCR || - pt->format == PIPE_FORMAT_YCBCR_REV) + if (pt->format == PIPE_FORMAT_UYVY || + pt->format == PIPE_FORMAT_YUYV) state[0] |= SS2_COLORSPACE_CONVERSION; /* 3D textures don't seem to respect the border color. @@ -180,19 +180,19 @@ translate_texture_format(enum pipe_format pipeFormat) return MAPSURF_8BIT | MT_8BIT_I8; case PIPE_FORMAT_A8_UNORM: return MAPSURF_8BIT | MT_8BIT_A8; - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: return MAPSURF_16BIT | MT_16BIT_AY88; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return MAPSURF_16BIT | MT_16BIT_RGB565; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB1555; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB4444; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return MAPSURF_32BIT | MT_32BIT_ARGB8888; - case PIPE_FORMAT_YCBCR_REV: + case PIPE_FORMAT_YUYV: return (MAPSURF_422 | MT_422_YCRCB_NORMAL); - case PIPE_FORMAT_YCBCR: + case PIPE_FORMAT_UYVY: return (MAPSURF_422 | MT_422_YCRCB_SWAPY); #if 0 case PIPE_FORMAT_RGB_FXT1: @@ -210,7 +210,7 @@ translate_texture_format(enum pipe_format pipeFormat) case PIPE_FORMAT_RGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); #endif - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: return (MAPSURF_32BIT | MT_32BIT_xI824); default: debug_printf("i915: translate_texture_format() bad image format %x\n", -- cgit v1.2.3 From 4710040617d0d7233da2c9c8fbdc41e79b39937a Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:12:25 +0000 Subject: i965: Rename pipe formats. --- src/gallium/drivers/i965/brw_misc_state.c | 4 ++-- src/gallium/drivers/i965/brw_pipe_clear.c | 8 +++---- src/gallium/drivers/i965/brw_screen.c | 34 +++++++++++++-------------- src/gallium/drivers/i965/brw_screen_texture.c | 24 +++++++++---------- src/gallium/drivers/i965/brw_wm.c | 4 ++-- 5 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_misc_state.c b/src/gallium/drivers/i965/brw_misc_state.c index e4b24229db..e3f25bdf62 100644 --- a/src/gallium/drivers/i965/brw_misc_state.c +++ b/src/gallium/drivers/i965/brw_misc_state.c @@ -265,8 +265,8 @@ static int emit_depthbuffer(struct brw_context *brw) format = BRW_DEPTHFORMAT_D16_UNORM; cpp = 2; break; - case PIPE_FORMAT_X8Z24_UNORM: - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: format = BRW_DEPTHFORMAT_D24_UNORM_S8_UINT; cpp = 4; break; diff --git a/src/gallium/drivers/i965/brw_pipe_clear.c b/src/gallium/drivers/i965/brw_pipe_clear.c index 452e1e89f9..d7048f769b 100644 --- a/src/gallium/drivers/i965/brw_pipe_clear.c +++ b/src/gallium/drivers/i965/brw_pipe_clear.c @@ -139,8 +139,8 @@ static void zstencil_clear(struct brw_context *brw, unsigned value; switch (bsurface->base.format) { - case PIPE_FORMAT_X8Z24_UNORM: - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: value = ((unsigned)(depth * MASK24) & MASK24); break; case PIPE_FORMAT_Z16_UNORM: @@ -152,8 +152,8 @@ static void zstencil_clear(struct brw_context *brw, } switch (bsurface->base.format) { - case PIPE_FORMAT_X8Z24_UNORM: - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: value = value | (stencil << 24); break; diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index b03a782a2f..66f3aad8b2 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -229,15 +229,15 @@ brw_is_format_supported(struct pipe_screen *screen, PIPE_FORMAT_L16_UNORM, /*PIPE_FORMAT_I16_UNORM,*/ /*PIPE_FORMAT_A16_UNORM,*/ - PIPE_FORMAT_A8L8_UNORM, - PIPE_FORMAT_R5G6B5_UNORM, - PIPE_FORMAT_A1R5G5B5_UNORM, - PIPE_FORMAT_A4R4G4B4_UNORM, - PIPE_FORMAT_X8R8G8B8_UNORM, - PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_L8A8_UNORM, + PIPE_FORMAT_B5G6R5_UNORM, + PIPE_FORMAT_B5G5R5A1_UNORM, + PIPE_FORMAT_B4G4R4A4_UNORM, + PIPE_FORMAT_B8G8R8X8_UNORM, + PIPE_FORMAT_B8G8R8A8_UNORM, /* video */ - PIPE_FORMAT_YCBCR, - PIPE_FORMAT_YCBCR_REV, + PIPE_FORMAT_UYVY, + PIPE_FORMAT_YUYV, /* compressed */ /*PIPE_FORMAT_FXT1_RGBA,*/ PIPE_FORMAT_DXT1_RGB, @@ -245,14 +245,14 @@ brw_is_format_supported(struct pipe_screen *screen, PIPE_FORMAT_DXT3_RGBA, PIPE_FORMAT_DXT5_RGBA, /* sRGB */ - PIPE_FORMAT_R8G8B8A8_SRGB, - PIPE_FORMAT_A8L8_SRGB, + PIPE_FORMAT_A8B8G8R8_SRGB, + PIPE_FORMAT_L8A8_SRGB, PIPE_FORMAT_L8_SRGB, PIPE_FORMAT_DXT1_SRGB, /* depth */ PIPE_FORMAT_Z32_FLOAT, - PIPE_FORMAT_X8Z24_UNORM, - PIPE_FORMAT_S8Z24_UNORM, + PIPE_FORMAT_Z24X8_UNORM, + PIPE_FORMAT_Z24S8_UNORM, PIPE_FORMAT_Z16_UNORM, /* signed */ PIPE_FORMAT_R8G8_SNORM, @@ -260,15 +260,15 @@ brw_is_format_supported(struct pipe_screen *screen, PIPE_FORMAT_NONE /* list terminator */ }; static const enum pipe_format render_supported[] = { - PIPE_FORMAT_X8R8G8B8_UNORM, - PIPE_FORMAT_A8R8G8B8_UNORM, - PIPE_FORMAT_R5G6B5_UNORM, + PIPE_FORMAT_B8G8R8X8_UNORM, + PIPE_FORMAT_B8G8R8A8_UNORM, + PIPE_FORMAT_B5G6R5_UNORM, PIPE_FORMAT_NONE /* list terminator */ }; static const enum pipe_format depth_supported[] = { PIPE_FORMAT_Z32_FLOAT, - PIPE_FORMAT_X8Z24_UNORM, - PIPE_FORMAT_S8Z24_UNORM, + PIPE_FORMAT_Z24X8_UNORM, + PIPE_FORMAT_Z24S8_UNORM, PIPE_FORMAT_Z16_UNORM, PIPE_FORMAT_NONE /* list terminator */ }; diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index 38e9961398..e38fdf1869 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -85,32 +85,32 @@ static GLuint translate_tex_format( enum pipe_format pf ) return BRW_SURFACEFORMAT_A16_UNORM; */ - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: return BRW_SURFACEFORMAT_L8A8_UNORM; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return BRW_SURFACEFORMAT_B5G6R5_UNORM; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return BRW_SURFACEFORMAT_B5G5R5A1_UNORM; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: return BRW_SURFACEFORMAT_B4G4R4A4_UNORM; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: return BRW_SURFACEFORMAT_R8G8B8X8_UNORM; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; /* * Video formats */ - case PIPE_FORMAT_YCBCR_REV: + case PIPE_FORMAT_YUYV: return BRW_SURFACEFORMAT_YCRCB_NORMAL; - case PIPE_FORMAT_YCBCR: + case PIPE_FORMAT_UYVY: return BRW_SURFACEFORMAT_YCRCB_SWAPUVY; /* @@ -137,10 +137,10 @@ static GLuint translate_tex_format( enum pipe_format pf ) * sRGB formats */ - case PIPE_FORMAT_R8G8B8A8_SRGB: + case PIPE_FORMAT_A8B8G8R8_SRGB: return BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB; - case PIPE_FORMAT_A8L8_SRGB: + case PIPE_FORMAT_L8A8_SRGB: return BRW_SURFACEFORMAT_L8A8_UNORM_SRGB; case PIPE_FORMAT_L8_SRGB: @@ -156,8 +156,8 @@ static GLuint translate_tex_format( enum pipe_format pf ) case PIPE_FORMAT_Z16_UNORM: return BRW_SURFACEFORMAT_I16_UNORM; - case PIPE_FORMAT_S8Z24_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: return BRW_SURFACEFORMAT_I24X8_UNORM; case PIPE_FORMAT_Z32_FLOAT: diff --git a/src/gallium/drivers/i965/brw_wm.c b/src/gallium/drivers/i965/brw_wm.c index 5164c90ed6..dfb718e64f 100644 --- a/src/gallium/drivers/i965/brw_wm.c +++ b/src/gallium/drivers/i965/brw_wm.c @@ -254,10 +254,10 @@ static void brw_wm_populate_key( struct brw_context *brw, for (i = 0; i < brw->curr.num_textures; i++) { const struct brw_texture *tex = brw_texture(brw->curr.texture[i]); - if (tex->base.format == PIPE_FORMAT_YCBCR) + if (tex->base.format == PIPE_FORMAT_UYVY) key->yuvtex_mask |= 1 << i; - if (tex->base.format == PIPE_FORMAT_YCBCR_REV) + if (tex->base.format == PIPE_FORMAT_YUYV) key->yuvtex_swap_mask |= 1 << i; /* XXX: shadow texture -- cgit v1.2.3 From 33080a8454ef5d6443c9b7211ab1e71888679f9f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:12:38 +0000 Subject: llvmpipe: Rename pipe formats. --- src/gallium/drivers/llvmpipe/lp_test_format.c | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c index 48828bd0a0..d05157991b 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_format.c +++ b/src/gallium/drivers/llvmpipe/lp_test_format.c @@ -52,25 +52,25 @@ struct pixel_test_case struct pixel_test_case test_cases[] = { - {PIPE_FORMAT_R5G6B5_UNORM, 0x0000, {0.0, 0.0, 0.0, 1.0}}, - {PIPE_FORMAT_R5G6B5_UNORM, 0x001f, {0.0, 0.0, 1.0, 1.0}}, - {PIPE_FORMAT_R5G6B5_UNORM, 0x07e0, {0.0, 1.0, 0.0, 1.0}}, - {PIPE_FORMAT_R5G6B5_UNORM, 0xf800, {1.0, 0.0, 0.0, 1.0}}, - {PIPE_FORMAT_R5G6B5_UNORM, 0xffff, {1.0, 1.0, 1.0, 1.0}}, - - {PIPE_FORMAT_A1R5G5B5_UNORM, 0x0000, {0.0, 0.0, 0.0, 0.0}}, - {PIPE_FORMAT_A1R5G5B5_UNORM, 0x001f, {0.0, 0.0, 1.0, 0.0}}, - {PIPE_FORMAT_A1R5G5B5_UNORM, 0x03e0, {0.0, 1.0, 0.0, 0.0}}, - {PIPE_FORMAT_A1R5G5B5_UNORM, 0x7c00, {1.0, 0.0, 0.0, 0.0}}, - {PIPE_FORMAT_A1R5G5B5_UNORM, 0x8000, {0.0, 0.0, 0.0, 1.0}}, - {PIPE_FORMAT_A1R5G5B5_UNORM, 0xffff, {1.0, 1.0, 1.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, 0x0000, {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, 0x001f, {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, 0x07e0, {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, 0xf800, {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, 0xffff, {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_B5G5R5A1_UNORM, 0x0000, {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, 0x001f, {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, 0x03e0, {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, 0x7c00, {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, 0x8000, {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, 0xffff, {1.0, 1.0, 1.0, 1.0}}, - {PIPE_FORMAT_A8R8G8B8_UNORM, 0x00000000, {0.0, 0.0, 0.0, 0.0}}, - {PIPE_FORMAT_A8R8G8B8_UNORM, 0x000000ff, {0.0, 0.0, 1.0, 0.0}}, - {PIPE_FORMAT_A8R8G8B8_UNORM, 0x0000ff00, {0.0, 1.0, 0.0, 0.0}}, - {PIPE_FORMAT_A8R8G8B8_UNORM, 0x00ff0000, {1.0, 0.0, 0.0, 0.0}}, - {PIPE_FORMAT_A8R8G8B8_UNORM, 0xff000000, {0.0, 0.0, 0.0, 1.0}}, - {PIPE_FORMAT_A8R8G8B8_UNORM, 0xffffffff, {1.0, 1.0, 1.0, 1.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, 0x00000000, {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, 0x000000ff, {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, 0x0000ff00, {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, 0x00ff0000, {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, 0xff000000, {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, 0xffffffff, {1.0, 1.0, 1.0, 1.0}}, #if 0 {PIPE_FORMAT_R8G8B8A8_UNORM, 0x00000000, {0.0, 0.0, 0.0, 0.0}}, @@ -81,12 +81,12 @@ struct pixel_test_case test_cases[] = {PIPE_FORMAT_R8G8B8A8_UNORM, 0xffffffff, {1.0, 1.0, 1.0, 1.0}}, #endif - {PIPE_FORMAT_B8G8R8A8_UNORM, 0x00000000, {0.0, 0.0, 0.0, 0.0}}, - {PIPE_FORMAT_B8G8R8A8_UNORM, 0x000000ff, {0.0, 0.0, 0.0, 1.0}}, - {PIPE_FORMAT_B8G8R8A8_UNORM, 0x0000ff00, {1.0, 0.0, 0.0, 0.0}}, - {PIPE_FORMAT_B8G8R8A8_UNORM, 0x00ff0000, {0.0, 1.0, 0.0, 0.0}}, - {PIPE_FORMAT_B8G8R8A8_UNORM, 0xff000000, {0.0, 0.0, 1.0, 0.0}}, - {PIPE_FORMAT_B8G8R8A8_UNORM, 0xffffffff, {1.0, 1.0, 1.0, 1.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, 0x00000000, {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, 0x000000ff, {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, 0x0000ff00, {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, 0x00ff0000, {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, 0xff000000, {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, 0xffffffff, {1.0, 1.0, 1.0, 1.0}}, }; -- cgit v1.2.3 From c9f1db0a03b6d89f8b1113785aa961e6c9a398ef Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:13:32 +0000 Subject: nouveau: Rename pipe formats. --- src/gallium/drivers/nouveau/nv04_surface_2d.c | 34 +++++++++++++-------------- src/gallium/drivers/nv30/nv30_miptree.c | 8 +++---- src/gallium/drivers/nv30/nv30_screen.c | 22 ++++++++--------- src/gallium/drivers/nv30/nv30_state_fb.c | 10 ++++---- src/gallium/drivers/nv40/nv40_miptree.c | 4 ++-- src/gallium/drivers/nv40/nv40_screen.c | 20 ++++++++-------- src/gallium/drivers/nv40/nv40_state_fb.c | 10 ++++---- src/gallium/drivers/nv50/nv50_miptree.c | 6 ++--- src/gallium/drivers/nv50/nv50_screen.c | 28 +++++++++++----------- src/gallium/drivers/nv50/nv50_surface.c | 6 ++--- 10 files changed, 74 insertions(+), 74 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nv04_surface_2d.c b/src/gallium/drivers/nouveau/nv04_surface_2d.c index 42c2ca932d..b074547c4d 100644 --- a/src/gallium/drivers/nouveau/nv04_surface_2d.c +++ b/src/gallium/drivers/nouveau/nv04_surface_2d.c @@ -18,15 +18,15 @@ nv04_surface_format(enum pipe_format format) case PIPE_FORMAT_I8_UNORM: return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8; case PIPE_FORMAT_R16_SNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: case PIPE_FORMAT_Z16_UNORM: - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5; - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8; - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32; default: return -1; @@ -39,14 +39,14 @@ nv04_rect_format(enum pipe_format format) switch (format) { case PIPE_FORMAT_A8_UNORM: return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: + case PIPE_FORMAT_L8A8_UNORM: case PIPE_FORMAT_Z16_UNORM: return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5; - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; default: return -1; @@ -61,15 +61,15 @@ nv04_scaled_image_format(enum pipe_format format) case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_I8_UNORM: return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_Y8; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A1R5G5B5; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_X8R8G8B8; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: case PIPE_FORMAT_R16_SNORM: - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5; default: return -1; diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index c29c36e20a..697b1b92ff 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -88,11 +88,11 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) else { switch (pt->format) { /* TODO: Figure out which formats can be swizzled */ - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: case PIPE_FORMAT_R16_SNORM: - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: + case PIPE_FORMAT_L8A8_UNORM: case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_I8_UNORM: diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index aef37d303d..85433d2095 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -112,8 +112,8 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen, if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return TRUE; default: break; @@ -121,12 +121,12 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen, } else if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { switch (format) { - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: return TRUE; case PIPE_FORMAT_Z16_UNORM: if (front) { - return (front->format == PIPE_FORMAT_R5G6B5_UNORM); + return (front->format == PIPE_FORMAT_B5G6R5_UNORM); } return TRUE; default: @@ -134,16 +134,16 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen, } } else { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_I8_UNORM: - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: case PIPE_FORMAT_Z16_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return TRUE; default: break; diff --git a/src/gallium/drivers/nv30/nv30_state_fb.c b/src/gallium/drivers/nv30/nv30_state_fb.c index 2ed2ea55e8..f7fe9833c7 100644 --- a/src/gallium/drivers/nv30/nv30_state_fb.c +++ b/src/gallium/drivers/nv30/nv30_state_fb.c @@ -66,14 +66,14 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30) } switch (colour_format) { - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: rt_format |= NV34TCL_RT_FORMAT_COLOR_X8R8G8B8; break; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: case 0: rt_format |= NV34TCL_RT_FORMAT_COLOR_A8R8G8B8; break; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: rt_format |= NV34TCL_RT_FORMAT_COLOR_R5G6B5; colour_bits = 16; break; @@ -86,8 +86,8 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30) rt_format |= NV34TCL_RT_FORMAT_ZETA_Z16; zeta_bits = 16; break; - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: case 0: rt_format |= NV34TCL_RT_FORMAT_ZETA_Z24S8; break; diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index ad1a9a5195..85d7e1f197 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -90,8 +90,8 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) else { switch (pt->format) { /* TODO: Figure out which formats can be swizzled */ - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: case PIPE_FORMAT_R16_SNORM: { if (debug_get_bool_option("NOUVEAU_NO_SWIZZLE", FALSE)) diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c index edee4b9a3a..b216c5e38c 100644 --- a/src/gallium/drivers/nv40/nv40_screen.c +++ b/src/gallium/drivers/nv40/nv40_screen.c @@ -98,8 +98,8 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen, { if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return TRUE; default: break; @@ -107,8 +107,8 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen, } else if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { switch (format) { - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: case PIPE_FORMAT_Z16_UNORM: return TRUE; default: @@ -116,17 +116,17 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen, } } else { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: case PIPE_FORMAT_R16_SNORM: case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_I8_UNORM: - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: case PIPE_FORMAT_Z16_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: case PIPE_FORMAT_DXT1_RGB: case PIPE_FORMAT_DXT1_RGBA: case PIPE_FORMAT_DXT3_RGBA: diff --git a/src/gallium/drivers/nv40/nv40_state_fb.c b/src/gallium/drivers/nv40/nv40_state_fb.c index a58fe9ddb1..fd3fdfddc0 100644 --- a/src/gallium/drivers/nv40/nv40_state_fb.c +++ b/src/gallium/drivers/nv40/nv40_state_fb.c @@ -57,14 +57,14 @@ nv40_state_framebuffer_validate(struct nv40_context *nv40) rt_format = NV40TCL_RT_FORMAT_TYPE_LINEAR; switch (colour_format) { - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: rt_format |= NV40TCL_RT_FORMAT_COLOR_X8R8G8B8; break; - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: case 0: rt_format |= NV40TCL_RT_FORMAT_COLOR_A8R8G8B8; break; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: rt_format |= NV40TCL_RT_FORMAT_COLOR_R5G6B5; break; default: @@ -75,8 +75,8 @@ nv40_state_framebuffer_validate(struct nv40_context *nv40) case PIPE_FORMAT_Z16_UNORM: rt_format |= NV40TCL_RT_FORMAT_ZETA_Z16; break; - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: case 0: rt_format |= NV40TCL_RT_FORMAT_ZETA_Z24S8; break; diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 7297c74a83..3f9d869d7a 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -89,14 +89,14 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp) case PIPE_FORMAT_Z32_FLOAT: tile_flags = 0x4800; break; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: tile_flags = 0x1800; break; case PIPE_FORMAT_Z16_UNORM: tile_flags = 0x6c00; break; - case PIPE_FORMAT_X8Z24_UNORM: - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: tile_flags = 0x2800; break; case PIPE_FORMAT_R32G32B32A32_FLOAT: diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 2232461b9b..eed6031eaf 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -35,9 +35,9 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, { if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) { switch (format) { - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: case PIPE_FORMAT_R16G16B16A16_SNORM: case PIPE_FORMAT_R16G16B16A16_UNORM: case PIPE_FORMAT_R32G32B32A32_FLOAT: @@ -51,32 +51,32 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) { switch (format) { case PIPE_FORMAT_Z32_FLOAT: - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: return TRUE; default: break; } } else { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_SRGB: - case PIPE_FORMAT_X8R8G8B8_SRGB: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_SRGB: + case PIPE_FORMAT_B8G8R8X8_SRGB: + case PIPE_FORMAT_B5G5R5A1_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_A8_UNORM: case PIPE_FORMAT_I8_UNORM: - case PIPE_FORMAT_A8L8_UNORM: + case PIPE_FORMAT_L8A8_UNORM: case PIPE_FORMAT_DXT1_RGB: case PIPE_FORMAT_DXT1_RGBA: case PIPE_FORMAT_DXT3_RGBA: case PIPE_FORMAT_DXT5_RGBA: - case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z32_FLOAT: case PIPE_FORMAT_R16G16B16A16_SNORM: case PIPE_FORMAT_R16G16B16A16_UNORM: diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 7405b67414..cabd148bc5 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -33,11 +33,11 @@ static INLINE int nv50_format(enum pipe_format format) { switch (format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return NV50_2D_DST_FORMAT_A8R8G8B8_UNORM; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: return NV50_2D_DST_FORMAT_X8R8G8B8_UNORM; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return NV50_2D_DST_FORMAT_R5G6B5_UNORM; case PIPE_FORMAT_A8_UNORM: return NV50_2D_DST_FORMAT_R8_UNORM; -- cgit v1.2.3 From a4ec52f245746b477b673e7cfb9b73d711bfa0d6 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 20:58:24 +0200 Subject: glapi.h: consolidate GET_DISPATCH() and GET_CURRENT_CONTEXT() macros Use likely() macro, as this is what most projects use. Drops GL_CALL define, cannot find it in mesa tree. Also, whitespace cleaunps in glthread.h --- src/mesa/glapi/glapi.h | 29 ++++++++++++++-- src/mesa/glapi/glthread.h | 85 ++++++++++++++++++++++------------------------- 2 files changed, 66 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index f802a61d3b..6bfe741b7e 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -64,6 +64,15 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ #endif +#if defined(__GNUC__) && (__GNUC__ >= 3) +# define likely(x) __builtin_expect(!!(x), 1) +# define unlikely(x) __builtin_expect(!!(x), 0) +#else +# define likely(x) (x) +# define unlikely(x) (x) +#endif + + /* * Number of extension functions which we can dynamically add at runtime. */ @@ -71,7 +80,8 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ /** - ** Define the GET_CURRENT_CONTEXT() macro. + ** Define the GET_DISPATCH() and GET_CURRENT_CONTEXT() macros. + ** ** \param C local variable which will hold the current context. **/ #if defined (GLX_USE_TLS) @@ -79,9 +89,14 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ extern const void *_glapi_Context; extern const struct _glapi_table *_glapi_Dispatch; +extern __thread struct _glapi_table * _glapi_tls_Dispatch + __attribute__((tls_model("initial-exec"))); + extern __thread void * _glapi_tls_Context __attribute__((tls_model("initial-exec"))); +# define GET_DISPATCH() _glapi_tls_Dispatch + # define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context #else @@ -90,9 +105,19 @@ extern void *_glapi_Context; extern struct _glapi_table *_glapi_Dispatch; # ifdef THREADS -# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()) + +# define GET_DISPATCH() \ + (likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch()) + +# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) \ + (likely(_glapi_Context) ? _glapi_Context : _glapi_get_context()) + # else + +# define GET_DISPATCH() _glapi_Dispatch + # define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context + # endif #endif /* defined (GLX_USE_TLS) */ diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index 8ec933a851..be39501395 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -64,21 +64,12 @@ #define GLTHREAD_H -#if defined(USE_MGL_NAMESPACE) -#define _glapi_Dispatch _mglapi_Dispatch +#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) +#ifndef THREADS +#define THREADS #endif - - - -#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\ - defined(WIN32_THREADS) || defined(BEOS_THREADS)) \ - && !defined(THREADS) -# define THREADS #endif -#ifdef VMS -#include -#endif /* * POSIX threads. This should be your choice in the Unix world @@ -121,7 +112,7 @@ typedef pthread_cond_t _glthread_Cond; #define _glthread_DECLARE_STATIC_COND(name) \ static _glthread_Cond name = PTHREAD_COND_INITIALIZER -#define _glthread_INIT_COND(cond) \ +#define _glthread_INIT_COND(cond) \ pthread_cond_init(&(cond), NULL) #define _glthread_DESTROY_COND(name) \ @@ -143,7 +134,7 @@ typedef unsigned int _glthread_Cond; #define _glthread_DECLARE_STATIC_COND(name) \ // #warning Condition variables not implemented. -#define _glthread_INIT_COND(cond) \ +#define _glthread_INIT_COND(cond) \ ASSERT(0); #define _glthread_DESTROY_COND(name) \ @@ -209,11 +200,20 @@ typedef HANDLE _glthread_Thread; typedef CRITICAL_SECTION _glthread_Mutex; -#define _glthread_DECLARE_STATIC_MUTEX(name) /*static*/ _glthread_Mutex name = {0,0,0,0,0,0} -#define _glthread_INIT_MUTEX(name) InitializeCriticalSection(&name) -#define _glthread_DESTROY_MUTEX(name) DeleteCriticalSection(&name) -#define _glthread_LOCK_MUTEX(name) EnterCriticalSection(&name) -#define _glthread_UNLOCK_MUTEX(name) LeaveCriticalSection(&name) +#define _glthread_DECLARE_STATIC_MUTEX(name) \ + /* static */ _glthread_Mutex name = { 0, 0, 0, 0, 0, 0 } + +#define _glthread_INIT_MUTEX(name) \ + InitializeCriticalSection(&name) + +#define _glthread_DESTROY_MUTEX(name) \ + DeleteCriticalSection(&name) + +#define _glthread_LOCK_MUTEX(name) \ + EnterCriticalSection(&name) + +#define _glthread_UNLOCK_MUTEX(name) \ + LeaveCriticalSection(&name) #endif /* WIN32_THREADS */ @@ -252,12 +252,26 @@ typedef struct { } benaphore; typedef benaphore _glthread_Mutex; -#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = { 0, 0 } -#define _glthread_INIT_MUTEX(name) name.sem = create_sem(0, #name"_benaphore"), name.lock = 0 -#define _glthread_DESTROY_MUTEX(name) delete_sem(name.sem), name.lock = 0 -#define _glthread_LOCK_MUTEX(name) if (name.sem == 0) _glthread_INIT_MUTEX(name); \ - if (atomic_add(&(name.lock), 1) >= 1) acquire_sem(name.sem) -#define _glthread_UNLOCK_MUTEX(name) if (atomic_add(&(name.lock), -1) > 1) release_sem(name.sem) +#define _glthread_DECLARE_STATIC_MUTEX(name) \ + static _glthread_Mutex name = { 0, 0 } + +#define _glthread_INIT_MUTEX(name) \ + name.sem = create_sem(0, #name"_benaphore"), \ + name.lock = 0 + +#define _glthread_DESTROY_MUTEX(name) \ + delete_sem(name.sem), \ + name.lock = 0 + +#define _glthread_LOCK_MUTEX(name) \ + if (name.sem == 0) \ + _glthread_INIT_MUTEX(name); \ + if (atomic_add(&(name.lock), 1) >= 1) \ + acquire_sem(name.sem) + +#define _glthread_UNLOCK_MUTEX(name) \ + if (atomic_add(&(name.lock), -1) > 1) \ + release_sem(name.sem) #endif /* BEOS_THREADS */ @@ -308,26 +322,5 @@ _glthread_GetTSD(_glthread_TSD *); extern void _glthread_SetTSD(_glthread_TSD *, void *); -#if !defined __GNUC__ || __GNUC__ < 3 -# define __builtin_expect(x, y) x -#endif - -#if defined(GLX_USE_TLS) - -extern __thread struct _glapi_table * _glapi_tls_Dispatch - __attribute__((tls_model("initial-exec"))); - -#define GET_DISPATCH() _glapi_tls_Dispatch - -#elif !defined(GL_CALL) -# if defined(THREADS) -# define GET_DISPATCH() \ - ((__builtin_expect( _glapi_Dispatch != NULL, 1 )) \ - ? _glapi_Dispatch : _glapi_get_dispatch()) -# else -# define GET_DISPATCH() _glapi_Dispatch -# endif /* defined(THREADS) */ -#endif /* ndef GL_CALL */ - #endif /* THREADS_H */ -- cgit v1.2.3 From 57d31591d10d656dbc8bea1d162dec90518e7b8c Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 27 Feb 2010 02:48:27 +0200 Subject: glapi.h: misc cosmetic - revert context/dispatch order, similar to glapi.c - stray GL_GLEXT_PROTOTYPES --- src/mesa/glapi/glapi.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 6bfe741b7e..6e28e66352 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -44,8 +44,6 @@ #ifndef _GLAPI_H #define _GLAPI_H -#define GL_GLEXT_PROTOTYPES - #include "glthread.h" @@ -59,8 +57,8 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ #define _glapi_get_dispatch _mglapi_get_dispatch #define _glapi_set_context _mglapi_set_context #define _glapi_get_context _mglapi_get_context -#define _glapi_Context _mglapi_Context #define _glapi_Dispatch _mglapi_Dispatch +#define _glapi_Context _mglapi_Context #endif @@ -73,12 +71,6 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ #endif -/* - * Number of extension functions which we can dynamically add at runtime. - */ -#define MAX_EXTENSION_FUNCS 300 - - /** ** Define the GET_DISPATCH() and GET_CURRENT_CONTEXT() macros. ** @@ -86,9 +78,10 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ **/ #if defined (GLX_USE_TLS) -extern const void *_glapi_Context; extern const struct _glapi_table *_glapi_Dispatch; +extern const void *_glapi_Context; + extern __thread struct _glapi_table * _glapi_tls_Dispatch __attribute__((tls_model("initial-exec"))); @@ -101,9 +94,10 @@ extern __thread void * _glapi_tls_Context #else -extern void *_glapi_Context; extern struct _glapi_table *_glapi_Dispatch; +extern void *_glapi_Context; + # ifdef THREADS # define GET_DISPATCH() \ @@ -183,4 +177,10 @@ extern const char * _glapi_get_proc_name(unsigned int offset); +/* + * Number of extension functions which we can dynamically add at runtime. + */ +#define MAX_EXTENSION_FUNCS 300 + + #endif -- cgit v1.2.3 From 750a7f1f1d6438c3fb460883aa2a626970e4c534 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 19:09:38 +0200 Subject: glapi.h: drop dispatch_override prototypes cannot find them in mesa tree --- src/mesa/glapi/glapi.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 6e28e66352..27571bdfbb 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -141,18 +141,6 @@ extern struct _glapi_table * _glapi_get_dispatch(void); -extern int -_glapi_begin_dispatch_override(struct _glapi_table *override); - - -extern void -_glapi_end_dispatch_override(int layer); - - -struct _glapi_table * -_glapi_get_override_dispatch(int layer); - - extern unsigned int _glapi_get_dispatch_table_size(void); -- cgit v1.2.3 From 42f3241e04b6cd74829dfb64b4a154ac8a4e6a48 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 27 Feb 2010 00:24:58 +0200 Subject: glapi.c: split check_table to not_null and get_proc --- src/mesa/glapi/glapi.c | 20 +++++++++++--------- src/mesa/glapi/glapi.h | 16 ++++++++++++---- 2 files changed, 23 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 2fa673d307..764f1dba28 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -423,8 +423,9 @@ _glapi_set_dispatch(struct _glapi_table *dispatch) /* use the no-op functions */ dispatch = (struct _glapi_table *) __glapi_noop_table; } -#ifdef DEBUG +#if 0 /* enable this for extra DEBUG */ else { + _glapi_check_table_not_null(dispatch); _glapi_check_table(dispatch); } #endif @@ -488,19 +489,23 @@ _glapi_get_dispatch_table_size(void) * Intended for debugging purposes. */ void -_glapi_check_table(const struct _glapi_table *table) +_glapi_check_table_not_null(const struct _glapi_table *table) { -#if 0 /* Enable this for extra DEBUG */ const GLuint entries = _glapi_get_dispatch_table_size(); const void **tab = (const void **) table; GLuint i; for (i = 1; i < entries; i++) { assert(tab[i]); } +} - /* Do some spot checks to be sure that the dispatch table - * slots are assigned correctly. - */ +/** + * Do some spot checks to be sure that the dispatch table + * slots are assigned correctly. + */ +void +_glapi_check_table(const struct _glapi_table *table) +{ { GLuint BeginOffset = _glapi_get_proc_offset("glBegin"); char *BeginFunc = (char*) &table->Begin; @@ -557,7 +562,4 @@ _glapi_check_table(const struct _glapi_table *table) assert(setFenceOffset == _gloffset_SetFenceNV); assert(setFenceOffset == offset); } -#else - (void) table; -#endif } diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 27571bdfbb..d84e38ae42 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -145,10 +145,6 @@ extern unsigned int _glapi_get_dispatch_table_size(void); -extern void -_glapi_check_table(const struct _glapi_table *table); - - extern int _glapi_add_dispatch( const char * const * function_names, const char * parameter_signature ); @@ -161,6 +157,18 @@ extern _glapi_proc _glapi_get_proc_address(const char *funcName); +/** + * GL API local functions and defines + */ + +extern void +_glapi_check_table_not_null(const struct _glapi_table *table); + + +extern void +_glapi_check_table(const struct _glapi_table *table); + + extern const char * _glapi_get_proc_name(unsigned int offset); -- cgit v1.2.3 From fae5758fac963ce014e3d43f1bca7fb489e02bf9 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 20:01:20 +0200 Subject: glapi.c: mv check_table to glapi_getproc.c --- src/mesa/glapi/glapi.c | 66 ----------------------------------------- src/mesa/glapi/glapi_getproc.c | 67 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 764f1dba28..2fe85a930e 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -59,7 +59,6 @@ #endif #include "glapi/glapi.h" -#include "glapi/glapioffsets.h" #include "glapi/glapitable.h" extern _glapi_proc __glapi_noop_table[]; @@ -498,68 +497,3 @@ _glapi_check_table_not_null(const struct _glapi_table *table) assert(tab[i]); } } - -/** - * Do some spot checks to be sure that the dispatch table - * slots are assigned correctly. - */ -void -_glapi_check_table(const struct _glapi_table *table) -{ - { - GLuint BeginOffset = _glapi_get_proc_offset("glBegin"); - char *BeginFunc = (char*) &table->Begin; - GLuint offset = (BeginFunc - (char *) table) / sizeof(void *); - assert(BeginOffset == _gloffset_Begin); - assert(BeginOffset == offset); - } - { - GLuint viewportOffset = _glapi_get_proc_offset("glViewport"); - char *viewportFunc = (char*) &table->Viewport; - GLuint offset = (viewportFunc - (char *) table) / sizeof(void *); - assert(viewportOffset == _gloffset_Viewport); - assert(viewportOffset == offset); - } - { - GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer"); - char *VertexPointerFunc = (char*) &table->VertexPointer; - GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *); - assert(VertexPointerOffset == _gloffset_VertexPointer); - assert(VertexPointerOffset == offset); - } - { - GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax"); - char *ResetMinMaxFunc = (char*) &table->ResetMinmax; - GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *); - assert(ResetMinMaxOffset == _gloffset_ResetMinmax); - assert(ResetMinMaxOffset == offset); - } - { - GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor"); - char *blendColorFunc = (char*) &table->BlendColor; - GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *); - assert(blendColorOffset == _gloffset_BlendColor); - assert(blendColorOffset == offset); - } - { - GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT"); - char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT; - GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *); - assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT); - assert(secondaryColor3fOffset == offset); - } - { - GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV"); - char *pointParameterivFunc = (char*) &table->PointParameterivNV; - GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *); - assert(pointParameterivOffset == _gloffset_PointParameterivNV); - assert(pointParameterivOffset == offset); - } - { - GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV"); - char *setFenceFunc = (char*) &table->SetFenceNV; - GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *); - assert(setFenceOffset == _gloffset_SetFenceNV); - assert(setFenceOffset == offset); - } -} diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index 69eb42c79e..a0a6ccca09 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -594,3 +594,70 @@ _glapi_get_proc_name(GLuint offset) } return NULL; } + + + +/** + * Do some spot checks to be sure that the dispatch table + * slots are assigned correctly. For debugging only. + */ +void +_glapi_check_table(const struct _glapi_table *table) +{ + { + GLuint BeginOffset = _glapi_get_proc_offset("glBegin"); + char *BeginFunc = (char*) &table->Begin; + GLuint offset = (BeginFunc - (char *) table) / sizeof(void *); + assert(BeginOffset == _gloffset_Begin); + assert(BeginOffset == offset); + } + { + GLuint viewportOffset = _glapi_get_proc_offset("glViewport"); + char *viewportFunc = (char*) &table->Viewport; + GLuint offset = (viewportFunc - (char *) table) / sizeof(void *); + assert(viewportOffset == _gloffset_Viewport); + assert(viewportOffset == offset); + } + { + GLuint VertexPointerOffset = _glapi_get_proc_offset("glVertexPointer"); + char *VertexPointerFunc = (char*) &table->VertexPointer; + GLuint offset = (VertexPointerFunc - (char *) table) / sizeof(void *); + assert(VertexPointerOffset == _gloffset_VertexPointer); + assert(VertexPointerOffset == offset); + } + { + GLuint ResetMinMaxOffset = _glapi_get_proc_offset("glResetMinmax"); + char *ResetMinMaxFunc = (char*) &table->ResetMinmax; + GLuint offset = (ResetMinMaxFunc - (char *) table) / sizeof(void *); + assert(ResetMinMaxOffset == _gloffset_ResetMinmax); + assert(ResetMinMaxOffset == offset); + } + { + GLuint blendColorOffset = _glapi_get_proc_offset("glBlendColor"); + char *blendColorFunc = (char*) &table->BlendColor; + GLuint offset = (blendColorFunc - (char *) table) / sizeof(void *); + assert(blendColorOffset == _gloffset_BlendColor); + assert(blendColorOffset == offset); + } + { + GLuint secondaryColor3fOffset = _glapi_get_proc_offset("glSecondaryColor3fEXT"); + char *secondaryColor3fFunc = (char*) &table->SecondaryColor3fEXT; + GLuint offset = (secondaryColor3fFunc - (char *) table) / sizeof(void *); + assert(secondaryColor3fOffset == _gloffset_SecondaryColor3fEXT); + assert(secondaryColor3fOffset == offset); + } + { + GLuint pointParameterivOffset = _glapi_get_proc_offset("glPointParameterivNV"); + char *pointParameterivFunc = (char*) &table->PointParameterivNV; + GLuint offset = (pointParameterivFunc - (char *) table) / sizeof(void *); + assert(pointParameterivOffset == _gloffset_PointParameterivNV); + assert(pointParameterivOffset == offset); + } + { + GLuint setFenceOffset = _glapi_get_proc_offset("glSetFenceNV"); + char *setFenceFunc = (char*) &table->SetFenceNV; + GLuint offset = (setFenceFunc - (char *) table) / sizeof(void *); + assert(setFenceOffset == _gloffset_SetFenceNV); + assert(setFenceOffset == offset); + } +} -- cgit v1.2.3 From cccdc1783fda33da6fc12befdf288b74866e5dfa Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Fri, 26 Feb 2010 23:43:46 +0200 Subject: glapi.c: mv init_glapi_relocs to glapi_getproc.c --- src/mesa/glapi/glapi.c | 186 +---------------------------------- src/mesa/glapi/glapi.h | 3 + src/mesa/glapi/glapi_getproc.c | 215 ++++++++++++++++++++++++++++++++++++----- 3 files changed, 196 insertions(+), 208 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 2fe85a930e..5c4a394527 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -222,187 +222,6 @@ _glapi_get_context(void) #endif } -#ifdef USE_X86_ASM - -#if defined( GLX_USE_TLS ) -extern GLubyte gl_dispatch_functions_start[]; -extern GLubyte gl_dispatch_functions_end[]; -#else -extern const GLubyte gl_dispatch_functions_start[]; -#endif - -#endif /* USE_X86_ASM */ - - -#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 16 -#elif defined(USE_X86_ASM) -# if defined(THREADS) && !defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 32 -# else -# define DISPATCH_FUNCTION_SIZE 16 -# endif -#endif - -#ifdef USE_SPARC_ASM -#ifdef GLX_USE_TLS -extern unsigned int __glapi_sparc_tls_stub; -#else -extern unsigned int __glapi_sparc_pthread_stub; -#endif -#endif - -#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) -# define NEED_FUNCTION_POINTER -#endif - -#if defined(PTHREADS) || defined(GLX_USE_TLS) -/** - * Perform platform-specific GL API entry-point fixups. - */ -static void -init_glapi_relocs( void ) -{ -#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) - extern unsigned long _x86_get_dispatch(void); - char run_time_patch[] = { - 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ - }; - GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ - const GLubyte * const get_disp = (const GLubyte *) run_time_patch; - GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; - - *offset = _x86_get_dispatch(); - while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { - (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); - curr_func += DISPATCH_FUNCTION_SIZE; - } -#endif -#ifdef USE_SPARC_ASM - extern void __glapi_sparc_icache_flush(unsigned int *); - static const unsigned int template[] = { -#ifdef GLX_USE_TLS - 0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */ - 0x8730e00a, /* srl %g3, 10, %g3 */ - 0x8410a000, /* or %g2, %lo(_glapi_tls_Dispatch), %g2 */ -#ifdef __arch64__ - 0xc259c002, /* ldx [%g7 + %g2], %g1 */ - 0xc2584003, /* ldx [%g1 + %g3], %g1 */ -#else - 0xc201c002, /* ld [%g7 + %g2], %g1 */ - 0xc2004003, /* ld [%g1 + %g3], %g1 */ -#endif - 0x81c04000, /* jmp %g1 */ - 0x01000000, /* nop */ -#else -#ifdef __arch64__ - 0x03000000, /* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */ - 0x05000000, /* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */ - 0x82106000, /* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */ - 0x8730e00a, /* 64-bit 0x0c --> srl %g3, 10, %g3 */ - 0x83287020, /* 64-bit 0x10 --> sllx %g1, 32, %g1 */ - 0x82004002, /* 64-bit 0x14 --> add %g1, %g2, %g1 */ - 0xc2586000, /* 64-bit 0x18 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */ -#else - 0x03000000, /* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */ - 0x8730e00a, /* 32-bit 0x04 --> srl %g3, 10, %g3 */ - 0xc2006000, /* 32-bit 0x08 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ -#endif - 0x80a06000, /* --> cmp %g1, 0 */ - 0x02800005, /* --> be +4*5 */ - 0x01000000, /* --> nop */ -#ifdef __arch64__ - 0xc2584003, /* 64-bit --> ldx [%g1 + %g3], %g1 */ -#else - 0xc2004003, /* 32-bit --> ld [%g1 + %g3], %g1 */ -#endif - 0x81c04000, /* --> jmp %g1 */ - 0x01000000, /* --> nop */ -#ifdef __arch64__ - 0x9de3bf80, /* 64-bit --> save %sp, -128, %sp */ -#else - 0x9de3bfc0, /* 32-bit --> save %sp, -64, %sp */ -#endif - 0xa0100003, /* --> mov %g3, %l0 */ - 0x40000000, /* --> call _glapi_get_dispatch */ - 0x01000000, /* --> nop */ - 0x82100008, /* --> mov %o0, %g1 */ - 0x86100010, /* --> mov %l0, %g3 */ - 0x10bffff7, /* --> ba -4*9 */ - 0x81e80000, /* --> restore */ -#endif - }; -#ifdef GLX_USE_TLS - extern unsigned long __glapi_sparc_get_dispatch(void); - unsigned int *code = &__glapi_sparc_tls_stub; - unsigned long dispatch = __glapi_sparc_get_dispatch(); -#else - unsigned int *code = &__glapi_sparc_pthread_stub; - unsigned long dispatch = (unsigned long) &_glapi_Dispatch; - unsigned long call_dest = (unsigned long ) &_glapi_get_dispatch; - int idx; -#endif - -#if defined(GLX_USE_TLS) - code[0] = template[0] | (dispatch >> 10); - code[1] = template[1]; - __glapi_sparc_icache_flush(&code[0]); - code[2] = template[2] | (dispatch & 0x3ff); - code[3] = template[3]; - __glapi_sparc_icache_flush(&code[2]); - code[4] = template[4]; - code[5] = template[5]; - __glapi_sparc_icache_flush(&code[4]); - code[6] = template[6]; - __glapi_sparc_icache_flush(&code[6]); -#else -#if defined(__arch64__) - code[0] = template[0] | (dispatch >> (32 + 10)); - code[1] = template[1] | ((dispatch & 0xffffffff) >> 10); - __glapi_sparc_icache_flush(&code[0]); - code[2] = template[2] | ((dispatch >> 32) & 0x3ff); - code[3] = template[3]; - __glapi_sparc_icache_flush(&code[2]); - code[4] = template[4]; - code[5] = template[5]; - __glapi_sparc_icache_flush(&code[4]); - code[6] = template[6] | (dispatch & 0x3ff); - idx = 7; -#else - code[0] = template[0] | (dispatch >> 10); - code[1] = template[1]; - __glapi_sparc_icache_flush(&code[0]); - code[2] = template[2] | (dispatch & 0x3ff); - idx = 3; -#endif - code[idx + 0] = template[idx + 0]; - __glapi_sparc_icache_flush(&code[idx - 1]); - code[idx + 1] = template[idx + 1]; - code[idx + 2] = template[idx + 2]; - __glapi_sparc_icache_flush(&code[idx + 1]); - code[idx + 3] = template[idx + 3]; - code[idx + 4] = template[idx + 4]; - __glapi_sparc_icache_flush(&code[idx + 3]); - code[idx + 5] = template[idx + 5]; - code[idx + 6] = template[idx + 6]; - __glapi_sparc_icache_flush(&code[idx + 5]); - code[idx + 7] = template[idx + 7]; - code[idx + 8] = template[idx + 8] | - (((call_dest - ((unsigned long) &code[idx + 8])) - >> 2) & 0x3fffffff); - __glapi_sparc_icache_flush(&code[idx + 7]); - code[idx + 9] = template[idx + 9]; - code[idx + 10] = template[idx + 10]; - __glapi_sparc_icache_flush(&code[idx + 9]); - code[idx + 11] = template[idx + 11]; - code[idx + 12] = template[idx + 12]; - __glapi_sparc_icache_flush(&code[idx + 11]); - code[idx + 13] = template[idx + 13]; - __glapi_sparc_icache_flush(&code[idx + 13]); -#endif -#endif -} -#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ /** @@ -413,10 +232,7 @@ init_glapi_relocs( void ) PUBLIC void _glapi_set_dispatch(struct _glapi_table *dispatch) { -#if defined(PTHREADS) || defined(GLX_USE_TLS) - static pthread_once_t once_control = PTHREAD_ONCE_INIT; - pthread_once( & once_control, init_glapi_relocs ); -#endif + init_glapi_relocs_once(); if (!dispatch) { /* use the no-op functions */ diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index d84e38ae42..0abec5df76 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -161,6 +161,9 @@ _glapi_get_proc_address(const char *funcName); * GL API local functions and defines */ +extern void +init_glapi_relocs_once(void); + extern void _glapi_check_table_not_null(const struct _glapi_table *table); diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index a0a6ccca09..5be6d65b56 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -43,27 +43,6 @@ #include "glapi/glapitable.h" -static void -fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); - - -/** - * strdup() is actually not a standard ANSI C or POSIX routine. - * Irix will not define it if ANSI mode is in effect. - */ -static char * -str_dup(const char *str) -{ - char *copy; - copy = (char*) malloc(strlen(str) + 1); - if (!copy) - return NULL; - strcpy(copy, str); - return copy; -} - - - #if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) # define DISPATCH_FUNCTION_SIZE 16 #elif defined(USE_X86_ASM) @@ -121,7 +100,6 @@ get_static_proc_offset(const char *funcName) } -#if !defined(XFree86Server) && !defined(XGLServer) #ifdef USE_X86_ASM #if defined( GLX_USE_TLS ) @@ -134,6 +112,8 @@ extern const GLubyte gl_dispatch_functions_start[]; #endif /* USE_X86_ASM */ +#if !defined(XFree86Server) && !defined(XGLServer) + /** * Return dispatch function address for the named static (built-in) function. * Return NULL if function not found. @@ -182,6 +162,172 @@ get_static_proc_name( GLuint offset ) +#if defined(PTHREADS) || defined(GLX_USE_TLS) + +/** + * Perform platform-specific GL API entry-point fixups. + */ +static void +init_glapi_relocs( void ) +{ +#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) + extern unsigned long _x86_get_dispatch(void); + char run_time_patch[] = { + 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ + }; + GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ + const GLubyte * const get_disp = (const GLubyte *) run_time_patch; + GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; + + *offset = _x86_get_dispatch(); + while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { + (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); + curr_func += DISPATCH_FUNCTION_SIZE; + } +#endif +#ifdef USE_SPARC_ASM + extern void __glapi_sparc_icache_flush(unsigned int *); + static const unsigned int template[] = { +#ifdef GLX_USE_TLS + 0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */ + 0x8730e00a, /* srl %g3, 10, %g3 */ + 0x8410a000, /* or %g2, %lo(_glapi_tls_Dispatch), %g2 */ +#ifdef __arch64__ + 0xc259c002, /* ldx [%g7 + %g2], %g1 */ + 0xc2584003, /* ldx [%g1 + %g3], %g1 */ +#else + 0xc201c002, /* ld [%g7 + %g2], %g1 */ + 0xc2004003, /* ld [%g1 + %g3], %g1 */ +#endif + 0x81c04000, /* jmp %g1 */ + 0x01000000, /* nop */ +#else +#ifdef __arch64__ + 0x03000000, /* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */ + 0x05000000, /* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */ + 0x82106000, /* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */ + 0x8730e00a, /* 64-bit 0x0c --> srl %g3, 10, %g3 */ + 0x83287020, /* 64-bit 0x10 --> sllx %g1, 32, %g1 */ + 0x82004002, /* 64-bit 0x14 --> add %g1, %g2, %g1 */ + 0xc2586000, /* 64-bit 0x18 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */ +#else + 0x03000000, /* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */ + 0x8730e00a, /* 32-bit 0x04 --> srl %g3, 10, %g3 */ + 0xc2006000, /* 32-bit 0x08 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ +#endif + 0x80a06000, /* --> cmp %g1, 0 */ + 0x02800005, /* --> be +4*5 */ + 0x01000000, /* --> nop */ +#ifdef __arch64__ + 0xc2584003, /* 64-bit --> ldx [%g1 + %g3], %g1 */ +#else + 0xc2004003, /* 32-bit --> ld [%g1 + %g3], %g1 */ +#endif + 0x81c04000, /* --> jmp %g1 */ + 0x01000000, /* --> nop */ +#ifdef __arch64__ + 0x9de3bf80, /* 64-bit --> save %sp, -128, %sp */ +#else + 0x9de3bfc0, /* 32-bit --> save %sp, -64, %sp */ +#endif + 0xa0100003, /* --> mov %g3, %l0 */ + 0x40000000, /* --> call _glapi_get_dispatch */ + 0x01000000, /* --> nop */ + 0x82100008, /* --> mov %o0, %g1 */ + 0x86100010, /* --> mov %l0, %g3 */ + 0x10bffff7, /* --> ba -4*9 */ + 0x81e80000, /* --> restore */ +#endif + }; +#ifdef GLX_USE_TLS + extern unsigned int __glapi_sparc_tls_stub; + extern unsigned long __glapi_sparc_get_dispatch(void); + unsigned int *code = &__glapi_sparc_tls_stub; + unsigned long dispatch = __glapi_sparc_get_dispatch(); +#else + extern unsigned int __glapi_sparc_pthread_stub; + unsigned int *code = &__glapi_sparc_pthread_stub; + unsigned long dispatch = (unsigned long) &_glapi_Dispatch; + unsigned long call_dest = (unsigned long ) &_glapi_get_dispatch; + int idx; +#endif + +#if defined(GLX_USE_TLS) + code[0] = template[0] | (dispatch >> 10); + code[1] = template[1]; + __glapi_sparc_icache_flush(&code[0]); + code[2] = template[2] | (dispatch & 0x3ff); + code[3] = template[3]; + __glapi_sparc_icache_flush(&code[2]); + code[4] = template[4]; + code[5] = template[5]; + __glapi_sparc_icache_flush(&code[4]); + code[6] = template[6]; + __glapi_sparc_icache_flush(&code[6]); +#else +#if defined(__arch64__) + code[0] = template[0] | (dispatch >> (32 + 10)); + code[1] = template[1] | ((dispatch & 0xffffffff) >> 10); + __glapi_sparc_icache_flush(&code[0]); + code[2] = template[2] | ((dispatch >> 32) & 0x3ff); + code[3] = template[3]; + __glapi_sparc_icache_flush(&code[2]); + code[4] = template[4]; + code[5] = template[5]; + __glapi_sparc_icache_flush(&code[4]); + code[6] = template[6] | (dispatch & 0x3ff); + idx = 7; +#else + code[0] = template[0] | (dispatch >> 10); + code[1] = template[1]; + __glapi_sparc_icache_flush(&code[0]); + code[2] = template[2] | (dispatch & 0x3ff); + idx = 3; +#endif + code[idx + 0] = template[idx + 0]; + __glapi_sparc_icache_flush(&code[idx - 1]); + code[idx + 1] = template[idx + 1]; + code[idx + 2] = template[idx + 2]; + __glapi_sparc_icache_flush(&code[idx + 1]); + code[idx + 3] = template[idx + 3]; + code[idx + 4] = template[idx + 4]; + __glapi_sparc_icache_flush(&code[idx + 3]); + code[idx + 5] = template[idx + 5]; + code[idx + 6] = template[idx + 6]; + __glapi_sparc_icache_flush(&code[idx + 5]); + code[idx + 7] = template[idx + 7]; + code[idx + 8] = template[idx + 8] | + (((call_dest - ((unsigned long) &code[idx + 8])) + >> 2) & 0x3fffffff); + __glapi_sparc_icache_flush(&code[idx + 7]); + code[idx + 9] = template[idx + 9]; + code[idx + 10] = template[idx + 10]; + __glapi_sparc_icache_flush(&code[idx + 9]); + code[idx + 11] = template[idx + 11]; + code[idx + 12] = template[idx + 12]; + __glapi_sparc_icache_flush(&code[idx + 11]); + code[idx + 13] = template[idx + 13]; + __glapi_sparc_icache_flush(&code[idx + 13]); +#endif +#endif +} + +void +init_glapi_relocs_once( void ) +{ + static pthread_once_t once_control = PTHREAD_ONCE_INIT; + pthread_once( & once_control, init_glapi_relocs ); +} + +#else + +void +init_glapi_relocs_once( void ) { } + +#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ + + + /********************************************************************** * Extension function management. */ @@ -239,6 +385,9 @@ static GLuint NumExtEntryPoints = 0; extern void __glapi_sparc_icache_flush(unsigned int *); #endif +static void +fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); + /** * Generate a dispatch function (entrypoint) which jumps through * the given slot number (offset) in the current dispatch table. @@ -263,7 +412,9 @@ generate_entrypoint(GLuint functionOffset) } return (_glapi_proc) code; -#elif defined(USE_SPARC_ASM) && (defined(PTHREADS) || defined(GLX_USE_TLS)) +#elif defined(USE_SPARC_ASM) + +#if defined(PTHREADS) || defined(GLX_USE_TLS) static const unsigned int template[] = { 0x07000000, /* sethi %hi(0), %g3 */ 0x8210000f, /* mov %o7, %g1 */ @@ -289,6 +440,8 @@ generate_entrypoint(GLuint functionOffset) __glapi_sparc_icache_flush(&code[2]); } return (_glapi_proc) code; +#endif + #else (void) functionOffset; return NULL; @@ -332,6 +485,22 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) } +/** + * strdup() is actually not a standard ANSI C or POSIX routine. + * Irix will not define it if ANSI mode is in effect. + */ +static char * +str_dup(const char *str) +{ + char *copy; + copy = (char*) malloc(strlen(str) + 1); + if (!copy) + return NULL; + strcpy(copy, str); + return copy; +} + + /** * Generate new entrypoint * -- cgit v1.2.3 From 7b454b00a4423937bd83ecff2d61ff08e6504707 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 27 Feb 2010 15:19:44 +0200 Subject: glapi.c: misc cosmetic mainly, move the multithread check mutex out of the dispatch/context block, closer to where it is used. --- src/mesa/glapi/glapi.c | 61 +++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 5c4a394527..fe523073ca 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -105,24 +105,17 @@ PUBLIC __thread void * _glapi_tls_Context __attribute__((tls_model("initial-exec"))); PUBLIC const struct _glapi_table *_glapi_Dispatch = NULL; + PUBLIC const void *_glapi_Context = NULL; #else #if defined(THREADS) -#ifdef WIN32_THREADS -/* _glthread_DECLARE_STATIC_MUTEX is broken on windows. There will be race! */ -#define CHECK_MULTITHREAD_LOCK() -#define CHECK_MULTITHREAD_UNLOCK() -#else -_glthread_DECLARE_STATIC_MUTEX(ThreadCheckMutex); -#define CHECK_MULTITHREAD_LOCK() _glthread_LOCK_MUTEX(ThreadCheckMutex) -#define CHECK_MULTITHREAD_UNLOCK() _glthread_UNLOCK_MUTEX(ThreadCheckMutex) -#endif - static GLboolean ThreadSafe = GL_FALSE; /**< In thread-safe mode? */ + _glthread_TSD _gl_DispatchTSD; /**< Per-thread dispatch pointer */ + static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ #if defined(WIN32_THREADS) @@ -136,8 +129,8 @@ void FreeAllTSD(void) #endif /* defined(THREADS) */ -PUBLIC struct _glapi_table *_glapi_Dispatch = - (struct _glapi_table *) __glapi_noop_table; +PUBLIC struct _glapi_table *_glapi_Dispatch = (struct _glapi_table *) __glapi_noop_table; + PUBLIC void *_glapi_Context = NULL; #endif /* defined(GLX_USE_TLS) */ @@ -145,6 +138,20 @@ PUBLIC void *_glapi_Context = NULL; +#if defined(THREADS) && !defined(GLX_USE_TLS) + +/** + * Mutex for multithread check. + */ +#ifdef WIN32_THREADS +/* _glthread_DECLARE_STATIC_MUTEX is broken on windows. There will be race! */ +#define CHECK_MULTITHREAD_LOCK() +#define CHECK_MULTITHREAD_UNLOCK() +#else +_glthread_DECLARE_STATIC_MUTEX(ThreadCheckMutex); +#define CHECK_MULTITHREAD_LOCK() _glthread_LOCK_MUTEX(ThreadCheckMutex) +#define CHECK_MULTITHREAD_UNLOCK() _glthread_UNLOCK_MUTEX(ThreadCheckMutex) +#endif /** * We should call this periodically from a function such as glXMakeCurrent @@ -153,7 +160,6 @@ PUBLIC void *_glapi_Context = NULL; PUBLIC void _glapi_check_multithread(void) { -#if defined(THREADS) && !defined(GLX_USE_TLS) static unsigned long knownID; static GLboolean firstCall = GL_TRUE; @@ -175,9 +181,15 @@ _glapi_check_multithread(void) _glapi_set_context(NULL); } CHECK_MULTITHREAD_UNLOCK(); -#endif } +#else + +PUBLIC void +_glapi_check_multithread(void) { } + +#endif + /** @@ -211,12 +223,7 @@ _glapi_get_context(void) #if defined(GLX_USE_TLS) return _glapi_tls_Context; #elif defined(THREADS) - if (ThreadSafe) { - return _glthread_GetTSD(&ContextTSD); - } - else { - return _glapi_Context; - } + return (ThreadSafe) ? _glthread_GetTSD(&ContextTSD) : _glapi_Context; #else return _glapi_Context; #endif @@ -234,7 +241,7 @@ _glapi_set_dispatch(struct _glapi_table *dispatch) { init_glapi_relocs_once(); - if (!dispatch) { + if (dispatch == NULL) { /* use the no-op functions */ dispatch = (struct _glapi_table *) __glapi_noop_table; } @@ -250,9 +257,9 @@ _glapi_set_dispatch(struct _glapi_table *dispatch) #elif defined(THREADS) _glthread_SetTSD(&_gl_DispatchTSD, (void *) dispatch); _glapi_Dispatch = (ThreadSafe) ? NULL : dispatch; -#else /*THREADS*/ +#else _glapi_Dispatch = dispatch; -#endif /*THREADS*/ +#endif } @@ -263,17 +270,15 @@ _glapi_set_dispatch(struct _glapi_table *dispatch) PUBLIC struct _glapi_table * _glapi_get_dispatch(void) { - struct _glapi_table * api; #if defined(GLX_USE_TLS) - api = _glapi_tls_Dispatch; + return _glapi_tls_Dispatch; #elif defined(THREADS) - api = (ThreadSafe) + return (ThreadSafe) ? (struct _glapi_table *) _glthread_GetTSD(&_gl_DispatchTSD) : _glapi_Dispatch; #else - api = _glapi_Dispatch; + return _glapi_Dispatch; #endif - return api; } -- cgit v1.2.3 From d41ab94d35cb47effbd2582289298be4f13c50e4 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Mon, 1 Mar 2010 04:44:02 +0200 Subject: glapi.c: misc coscmetic for FreeTSD - move out of of the dispatch/context block to after corresponding init functions - use more consistent naming with corresponding init functions - XXX use _glthread_InitTSD() vs (void)_glthread_GetTSD() in _glapi_check_multithread() XXX --- src/gallium/state_trackers/wgl/stw_device.c | 4 ++-- src/mesa/glapi/glapi.c | 35 +++++++++++++++++++---------- src/mesa/glapi/glapi.h | 8 +++++++ src/mesa/glapi/glthread.c | 23 ++++++++++--------- src/mesa/glapi/glthread.h | 4 ++++ 5 files changed, 50 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/stw_device.c b/src/gallium/state_trackers/wgl/stw_device.c index e5fa6ac8eb..472a2a5379 100644 --- a/src/gallium/state_trackers/wgl/stw_device.c +++ b/src/gallium/state_trackers/wgl/stw_device.c @@ -47,7 +47,6 @@ #ifdef WIN32_THREADS extern _glthread_Mutex OneTimeLock; -extern void FreeAllTSD(void); #endif @@ -183,7 +182,8 @@ stw_cleanup(void) #ifdef WIN32_THREADS _glthread_DESTROY_MUTEX(OneTimeLock); - FreeAllTSD(); + + _glapi_destroy_multithread(); #endif #ifdef DEBUG diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index fe523073ca..056abd7233 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -118,15 +118,6 @@ _glthread_TSD _gl_DispatchTSD; /**< Per-thread dispatch pointer */ static _glthread_TSD ContextTSD; /**< Per-thread context pointer */ -#if defined(WIN32_THREADS) -void FreeTSD(_glthread_TSD *p); -void FreeAllTSD(void) -{ - FreeTSD(&_gl_DispatchTSD); - FreeTSD(&ContextTSD); -} -#endif /* defined(WIN32_THREADS) */ - #endif /* defined(THREADS) */ PUBLIC struct _glapi_table *_glapi_Dispatch = (struct _glapi_table *) __glapi_noop_table; @@ -140,6 +131,22 @@ PUBLIC void *_glapi_Context = NULL; #if defined(THREADS) && !defined(GLX_USE_TLS) +void +_glapi_init_multithread(void) +{ + _glthread_InitTSD(&_gl_DispatchTSD); + _glthread_InitTSD(&ContextTSD); +} + +void +_glapi_destroy_multithread(void) +{ +#ifdef WIN32_THREADS + _glthread_DestroyTSD(&_gl_DispatchTSD); + _glthread_DestroyTSD(&ContextTSD); +#endif +} + /** * Mutex for multithread check. */ @@ -168,9 +175,7 @@ _glapi_check_multithread(void) CHECK_MULTITHREAD_LOCK(); if (firstCall) { - /* initialize TSDs */ - (void) _glthread_GetTSD(&ContextTSD); - (void) _glthread_GetTSD(&_gl_DispatchTSD); + _glapi_init_multithread(void) knownID = _glthread_GetID(); firstCall = GL_FALSE; @@ -185,6 +190,12 @@ _glapi_check_multithread(void) #else +void +_glapi_init_multithread(void) { } + +void +_glapi_destroy_multithread(void) { } + PUBLIC void _glapi_check_multithread(void) { } diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 0abec5df76..2eae6d5c43 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -121,6 +121,14 @@ extern void *_glapi_Context; ** GL API public functions **/ +extern void +_glapi_init_multithread(void); + + +extern void +_glapi_destroy_multithread(void); + + extern void _glapi_check_multithread(void); diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index be4e2f754d..15401d730e 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -190,17 +190,9 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) */ #ifdef WIN32_THREADS -void FreeTSD(_glthread_TSD *p) +static void InsteadOf_exit(int nCode) { - if (p->initMagic==INIT_MAGIC) { - TlsFree(p->key); - p->initMagic=0; - } -} - -void InsteadOf_exit(int nCode) -{ - DWORD dwErr=GetLastError(); + DWORD dwErr = GetLastError(); } PUBLIC unsigned long @@ -222,6 +214,17 @@ _glthread_InitTSD(_glthread_TSD *tsd) } +void +_glthread_DestroyTSD(_glthread_TSD *tsd) +{ + if (tsd->initMagic != INIT_MAGIC) { + return; + } + TlsFree(tsd->key); + tsd->initMagic = 0x0; +} + + void * _glthread_GetTSD(_glthread_TSD *tsd) { diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index be39501395..389c24204b 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -315,6 +315,10 @@ extern void _glthread_InitTSD(_glthread_TSD *); +extern void +_glthread_DestroyTSD(_glthread_TSD *); /* WIN32 only */ + + extern void * _glthread_GetTSD(_glthread_TSD *); -- cgit v1.2.3 From d7e6e879fdfb1a4e3125237d117f68025dfa0d72 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Mon, 1 Mar 2010 17:28:55 +0200 Subject: glapi: drop SOLARIS_THREADS It seems that SOLARIS_THREADS is not used and does not work. --- docs/dispatch.html | 2 +- src/mesa/glapi/gen/gl_x86-64_asm.py | 2 +- src/mesa/glapi/gen/gl_x86_asm.py | 2 +- src/mesa/glapi/glthread.c | 68 ------------------------------------- src/mesa/glapi/glthread.h | 35 ++----------------- src/mesa/x86-64/glapi_x86-64.S | 2 +- src/mesa/x86/glapi_x86.S | 2 +- 7 files changed, 7 insertions(+), 106 deletions(-) (limited to 'src') diff --git a/docs/dispatch.html b/docs/dispatch.html index 0c54a84675..e5587c1a29 100644 --- a/docs/dispatch.html +++ b/docs/dispatch.html @@ -199,7 +199,7 @@ few preprocessor defines.

  • If GLX_USE_TLS is defined, method #4 is used.
  • If PTHREADS is defined, method #3 is used.
  • If any of PTHREADS, -SOLARIS_THREADS, WIN32_THREADS, or BEOS_THREADS +WIN32_THREADS, or BEOS_THREADS is defined, method #2 is used.
  • If none of the preceeding are defined, method #1 is used.
  • diff --git a/src/mesa/glapi/gen/gl_x86-64_asm.py b/src/mesa/glapi/gen/gl_x86-64_asm.py index 31c1a2b93a..8ac57ab7eb 100644 --- a/src/mesa/glapi/gen/gl_x86-64_asm.py +++ b/src/mesa/glapi/gen/gl_x86-64_asm.py @@ -138,7 +138,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '# define GL_PREFIX(n) GLNAME(CONCAT(gl,n))' print '# endif' print '' - print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' + print '#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' print '# define THREADS' print '#endif' print '' diff --git a/src/mesa/glapi/gen/gl_x86_asm.py b/src/mesa/glapi/gen/gl_x86_asm.py index d210f3a248..a48724ee61 100644 --- a/src/mesa/glapi/gen/gl_x86_asm.py +++ b/src/mesa/glapi/gen/gl_x86_asm.py @@ -79,7 +79,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '#define GLOBL_FN(x) GLOBL x' print '#endif' print '' - print '#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' + print '#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)' print '# define THREADS' print '#endif' print '' diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index 15401d730e..17b6bb2b6a 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -115,74 +115,6 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -/* - * Solaris/Unix International Threads -- Use only if POSIX threads - * aren't available on your Unix platform. Solaris 2.[34] are examples - * of platforms where this is the case. Be sure to use -mt and/or - * -D_REENTRANT when compiling. - */ -#ifdef SOLARIS_THREADS -#define USE_LOCK_FOR_KEY /* undef this to try a version without - lock for the global key... */ - -PUBLIC unsigned long -_glthread_GetID(void) -{ - abort(); /* XXX not implemented yet */ - return (unsigned long) 0; -} - - -void -_glthread_InitTSD(_glthread_TSD *tsd) -{ - if ((errno = mutex_init(&tsd->keylock, 0, NULL)) != 0 || - (errno = thr_keycreate(&(tsd->key), free)) != 0) { - perror(INIT_TSD_ERROR); - exit(-1); - } - tsd->initMagic = INIT_MAGIC; -} - - -void * -_glthread_GetTSD(_glthread_TSD *tsd) -{ - void* ret; - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } -#ifdef USE_LOCK_FOR_KEY - mutex_lock(&tsd->keylock); - thr_getspecific(tsd->key, &ret); - mutex_unlock(&tsd->keylock); -#else - if ((errno = thr_getspecific(tsd->key, &ret)) != 0) { - perror(GET_TSD_ERROR); - exit(-1); - } -#endif - return ret; -} - - -void -_glthread_SetTSD(_glthread_TSD *tsd, void *ptr) -{ - if (tsd->initMagic != INIT_MAGIC) { - _glthread_InitTSD(tsd); - } - if ((errno = thr_setspecific(tsd->key, ptr)) != 0) { - perror(SET_TSD_ERROR); - exit(-1); - } -} - -#undef USE_LOCK_FOR_KEY -#endif /* SOLARIS_THREADS */ - - - /* * Win32 Threads. The only available option for Windows 95/NT. * Be sure that you compile using the Multithreaded runtime, otherwise diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index 389c24204b..e5193aaf98 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -64,7 +64,7 @@ #define GLTHREAD_H -#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) +#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) #ifndef THREADS #define THREADS #endif @@ -149,38 +149,7 @@ typedef unsigned int _glthread_Cond; #define _glthread_COND_BROADCAST(cond) \ ASSERT(0); -#endif - - -/* - * Solaris threads. Use only up to Solaris 2.4. - * Solaris 2.5 and higher provide POSIX threads. - * Be sure to compile with -mt on the Solaris compilers, or - * use -D_REENTRANT if using gcc. - */ -#ifdef SOLARIS_THREADS -#include - -typedef struct { - thread_key_t key; - mutex_t keylock; - int initMagic; -} _glthread_TSD; - -typedef thread_t _glthread_Thread; - -typedef mutex_t _glthread_Mutex; - -/* XXX need to really implement mutex-related macros */ -#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0 -#define _glthread_INIT_MUTEX(name) (void) name -#define _glthread_DESTROY_MUTEX(name) (void) name -#define _glthread_LOCK_MUTEX(name) (void) name -#define _glthread_UNLOCK_MUTEX(name) (void) name - -#endif /* SOLARIS_THREADS */ - - +#endif /* PTHREADS */ /* diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index 4c9eab882b..bd5a657e19 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -45,7 +45,7 @@ # define GL_PREFIX(n) GLNAME(CONCAT(gl,n)) # endif -#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) +#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) # define THREADS #endif diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 13270ef35d..ae5dd2b0d1 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -52,7 +52,7 @@ #define GLOBL_FN(x) GLOBL x #endif -#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) +#if defined(PTHREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS) # define THREADS #endif -- cgit v1.2.3 From 5bf4ff7dabfffd0018382d440682bd5f7d418606 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 20:11:36 +0100 Subject: nv30: adapt to vertex element cso --- src/gallium/drivers/nv30/nv30_context.h | 8 ++++++-- src/gallium/drivers/nv30/nv30_state.c | 34 +++++++++++++++++++++++++++------ src/gallium/drivers/nv30/nv30_vbo.c | 8 ++++---- 3 files changed, 38 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_context.h b/src/gallium/drivers/nv30/nv30_context.h index ca3d6aca7f..e48f531b94 100644 --- a/src/gallium/drivers/nv30/nv30_context.h +++ b/src/gallium/drivers/nv30/nv30_context.h @@ -108,6 +108,11 @@ struct nv30_state { struct nouveau_stateobj *hw[NV30_STATE_MAX]; }; +struct nv30_vtxelt_state { + struct pipe_vertex_element pipe[16]; + unsigned num_elements; +}; + struct nv30_context { struct pipe_context pipe; @@ -143,8 +148,7 @@ struct nv30_context { unsigned dirty_samplers; struct pipe_vertex_buffer vtxbuf[PIPE_MAX_ATTRIBS]; unsigned vtxbuf_nr; - struct pipe_vertex_element vtxelt[PIPE_MAX_ATTRIBS]; - unsigned vtxelt_nr; + struct nv30_vtxelt_state *vtxelt; }; static INLINE struct nv30_context * diff --git a/src/gallium/drivers/nv30/nv30_state.c b/src/gallium/drivers/nv30/nv30_state.c index d911c80707..24b15a63ac 100644 --- a/src/gallium/drivers/nv30/nv30_state.c +++ b/src/gallium/drivers/nv30/nv30_state.c @@ -669,15 +669,34 @@ nv30_set_vertex_buffers(struct pipe_context *pipe, unsigned count, /*nv30->draw_dirty |= NV30_NEW_ARRAYS;*/ } +static void * +nv30_vtxelts_state_create(struct pipe_context *pipe, + unsigned num_elements, + const struct pipe_vertex_element *elements) +{ + struct nv30_vtxelt_state *cso = CALLOC_STRUCT(nv30_vtxelt_state); + + assert(num_elements < 16); /* not doing fallbacks yet */ + cso->num_elements = num_elements; + memcpy(cso->pipe, elements, num_elements * sizeof(*elements)); + +/* nv30_vtxelt_construct(cso);*/ + + return (void *)cso; +} + static void -nv30_set_vertex_elements(struct pipe_context *pipe, unsigned count, - const struct pipe_vertex_element *ve) +nv30_vtxelts_state_delete(struct pipe_context *pipe, void *hwcso) { - struct nv30_context *nv30 = nv30_context(pipe); + FREE(hwcso); +} - memcpy(nv30->vtxelt, ve, sizeof(*ve) * count); - nv30->vtxelt_nr = count; +static void +nv30_vtxelts_state_bind(struct pipe_context *pipe, void *hwcso) +{ + struct nv30_context *nv30 = nv30_context(pipe); + nv30->vtxelt = hwcso; nv30->dirty |= NV30_NEW_ARRAYS; /*nv30->draw_dirty |= NV30_NEW_ARRAYS;*/ } @@ -722,7 +741,10 @@ nv30_init_state_functions(struct nv30_context *nv30) nv30->pipe.set_scissor_state = nv30_set_scissor_state; nv30->pipe.set_viewport_state = nv30_set_viewport_state; + nv30->pipe.create_vertex_elements_state = nv30_vtxelts_state_create; + nv30->pipe.delete_vertex_elements_state = nv30_vtxelts_state_delete; + nv30->pipe.bind_vertex_elements_state = nv30_vtxelts_state_bind; + nv30->pipe.set_vertex_buffers = nv30_set_vertex_buffers; - nv30->pipe.set_vertex_elements = nv30_set_vertex_elements; } diff --git a/src/gallium/drivers/nv30/nv30_vbo.c b/src/gallium/drivers/nv30/nv30_vbo.c index e48823a913..f3856bb5a5 100644 --- a/src/gallium/drivers/nv30/nv30_vbo.c +++ b/src/gallium/drivers/nv30/nv30_vbo.c @@ -492,16 +492,16 @@ nv30_vbo_validate(struct nv30_context *nv30) int hw; vtxbuf = so_new(3, 17, 18); - so_method(vtxbuf, rankine, NV34TCL_VTXBUF_ADDRESS(0), nv30->vtxelt_nr); + so_method(vtxbuf, rankine, NV34TCL_VTXBUF_ADDRESS(0), nv30->vtxelt->num_elements); vtxfmt = so_new(1, 16, 0); - so_method(vtxfmt, rankine, NV34TCL_VTXFMT(0), nv30->vtxelt_nr); + so_method(vtxfmt, rankine, NV34TCL_VTXFMT(0), nv30->vtxelt->num_elements); - for (hw = 0; hw < nv30->vtxelt_nr; hw++) { + for (hw = 0; hw < nv30->vtxelt->num_elements; hw++) { struct pipe_vertex_element *ve; struct pipe_vertex_buffer *vb; unsigned type, ncomp; - ve = &nv30->vtxelt[hw]; + ve = &nv30->vtxelt->pipe[hw]; vb = &nv30->vtxbuf[ve->vertex_buffer_index]; if (!vb->stride) { -- cgit v1.2.3 From ddccf7797425097ee6562290d3476075c38220b0 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 1 Mar 2010 20:11:47 +0100 Subject: nv40: adapt to vertex element cso --- src/gallium/drivers/nv40/nv40_context.h | 9 ++++++-- src/gallium/drivers/nv40/nv40_state.c | 34 ++++++++++++++++++++++++------ src/gallium/drivers/nv40/nv40_state_emit.c | 2 +- src/gallium/drivers/nv40/nv40_vbo.c | 8 +++---- 4 files changed, 40 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv40/nv40_context.h b/src/gallium/drivers/nv40/nv40_context.h index 4861924dac..f96f2b89bf 100644 --- a/src/gallium/drivers/nv40/nv40_context.h +++ b/src/gallium/drivers/nv40/nv40_context.h @@ -108,6 +108,12 @@ struct nv40_state { struct nouveau_stateobj *hw[NV40_STATE_MAX]; }; + +struct nv40_vtxelt_state { + struct pipe_vertex_element pipe[16]; + unsigned num_elements; +}; + struct nv40_context { struct pipe_context pipe; @@ -158,8 +164,7 @@ struct nv40_context { unsigned dirty_samplers; struct pipe_vertex_buffer vtxbuf[PIPE_MAX_ATTRIBS]; unsigned vtxbuf_nr; - struct pipe_vertex_element vtxelt[PIPE_MAX_ATTRIBS]; - unsigned vtxelt_nr; + struct nv40_vtxelt_state *vtxelt; }; static INLINE struct nv40_context * diff --git a/src/gallium/drivers/nv40/nv40_state.c b/src/gallium/drivers/nv40/nv40_state.c index 2073bf0735..449e246b8c 100644 --- a/src/gallium/drivers/nv40/nv40_state.c +++ b/src/gallium/drivers/nv40/nv40_state.c @@ -684,15 +684,34 @@ nv40_set_vertex_buffers(struct pipe_context *pipe, unsigned count, nv40->draw_dirty |= NV40_NEW_ARRAYS; } +static void * +nv40_vtxelts_state_create(struct pipe_context *pipe, + unsigned num_elements, + const struct pipe_vertex_element *elements) +{ + struct nv40_vtxelt_state *cso = CALLOC_STRUCT(nv40_vtxelt_state); + + assert(num_elements < 16); /* not doing fallbacks yet */ + cso->num_elements = num_elements; + memcpy(cso->pipe, elements, num_elements * sizeof(*elements)); + +/* nv40_vtxelt_construct(cso);*/ + + return (void *)cso; +} + static void -nv40_set_vertex_elements(struct pipe_context *pipe, unsigned count, - const struct pipe_vertex_element *ve) +nv40_vtxelts_state_delete(struct pipe_context *pipe, void *hwcso) { - struct nv40_context *nv40 = nv40_context(pipe); + FREE(hwcso); +} - memcpy(nv40->vtxelt, ve, sizeof(*ve) * count); - nv40->vtxelt_nr = count; +static void +nv40_vtxelts_state_bind(struct pipe_context *pipe, void *hwcso) +{ + struct nv40_context *nv40 = nv40_context(pipe); + nv40->vtxelt = hwcso; nv40->dirty |= NV40_NEW_ARRAYS; nv40->draw_dirty |= NV40_NEW_ARRAYS; } @@ -737,7 +756,10 @@ nv40_init_state_functions(struct nv40_context *nv40) nv40->pipe.set_scissor_state = nv40_set_scissor_state; nv40->pipe.set_viewport_state = nv40_set_viewport_state; + nv40->pipe.create_vertex_elements_state = nv40_vtxelts_state_create; + nv40->pipe.delete_vertex_elements_state = nv40_vtxelts_state_delete; + nv40->pipe.bind_vertex_elements_state = nv40_vtxelts_state_bind; + nv40->pipe.set_vertex_buffers = nv40_set_vertex_buffers; - nv40->pipe.set_vertex_elements = nv40_set_vertex_elements; } diff --git a/src/gallium/drivers/nv40/nv40_state_emit.c b/src/gallium/drivers/nv40/nv40_state_emit.c index 8990f303ce..297d71f4fa 100644 --- a/src/gallium/drivers/nv40/nv40_state_emit.c +++ b/src/gallium/drivers/nv40/nv40_state_emit.c @@ -174,7 +174,7 @@ nv40_state_validate_swtnl(struct nv40_context *nv40) if (nv40->draw_dirty & NV40_NEW_ARRAYS) { draw_set_vertex_buffers(draw, nv40->vtxbuf_nr, nv40->vtxbuf); - draw_set_vertex_elements(draw, nv40->vtxelt_nr, nv40->vtxelt); + draw_set_vertex_elements(draw, nv40->vtxelt->num_elements, nv40->vtxelt->pipe); } nv40_state_do_validate(nv40, swtnl_states); diff --git a/src/gallium/drivers/nv40/nv40_vbo.c b/src/gallium/drivers/nv40/nv40_vbo.c index 7812460d2e..fabdf4bf23 100644 --- a/src/gallium/drivers/nv40/nv40_vbo.c +++ b/src/gallium/drivers/nv40/nv40_vbo.c @@ -493,16 +493,16 @@ nv40_vbo_validate(struct nv40_context *nv40) int hw; vtxbuf = so_new(3, 17, 18); - so_method(vtxbuf, curie, NV40TCL_VTXBUF_ADDRESS(0), nv40->vtxelt_nr); + so_method(vtxbuf, curie, NV40TCL_VTXBUF_ADDRESS(0), nv40->vtxelt->num_elements); vtxfmt = so_new(1, 16, 0); - so_method(vtxfmt, curie, NV40TCL_VTXFMT(0), nv40->vtxelt_nr); + so_method(vtxfmt, curie, NV40TCL_VTXFMT(0), nv40->vtxelt->num_elements); - for (hw = 0; hw < nv40->vtxelt_nr; hw++) { + for (hw = 0; hw < nv40->vtxelt->num_elements; hw++) { struct pipe_vertex_element *ve; struct pipe_vertex_buffer *vb; unsigned type, ncomp; - ve = &nv40->vtxelt[hw]; + ve = &nv40->vtxelt->pipe[hw]; vb = &nv40->vtxbuf[ve->vertex_buffer_index]; if (!vb->stride) { -- cgit v1.2.3 From a379fa8b3059d0a083dc2641a4afb3a33380e275 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Mon, 1 Mar 2010 12:21:13 -0700 Subject: Remove now obsolete mesa_bzero symbol. --- src/mesa/drivers/windows/gdi/mesa.def | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index baa592f136..b537b3460c 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -867,7 +867,6 @@ EXPORTS _glapi_get_proc_address _mesa_add_soft_renderbuffers _mesa_add_renderbuffer - _mesa_bzero _mesa_check_conditional_render _mesa_choose_tex_format _mesa_create_framebuffer -- cgit v1.2.3 From 9a7776696b786180f1d384eb22b928707e74dfca Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Mon, 1 Mar 2010 23:47:35 +0200 Subject: radeon: Reduce number of radeon_bo_map calls that require kernel entry. DMA buffers are often remapped many times for singel cs. To reduce number of mapping calls ending to kernel dma buffers are mapped when allocated and unmapped when full or in cs flush. This makes indifual mapping calls in other parts of code simple increment/decrement reference count which is faster than entering kernel. This improves Anholt's openarena benchmark from 36 fps to 44 fps. --- src/mesa/drivers/dri/radeon/radeon_dma.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index d31e4e47dd..22499bc38d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -184,6 +184,8 @@ void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size) radeon_print(RADEON_DMA, RADEON_NORMAL, "%s size %d minimum_size %d\n", __FUNCTION__, size, rmesa->dma.minimum_size); + if (!is_empty_list(&rmesa->dma.reserved)) + radeon_bo_unmap(first_elem(&rmesa->dma.reserved)->bo); if (is_empty_list(&rmesa->dma.free) || last_elem(&rmesa->dma.free)->bo->size < size) { @@ -211,7 +213,7 @@ again_alloc: rmesa->dma.current_used = 0; rmesa->dma.current_vertexptr = 0; - + if (radeon_cs_space_check_with_bo(rmesa->cmdbuf.cs, first_elem(&rmesa->dma.reserved)->bo, RADEON_GEM_DOMAIN_GTT, 0)) @@ -221,6 +223,7 @@ again_alloc: /* Cmd buff have been flushed in radeon_revalidate_bos */ goto again_alloc; } + radeon_bo_map(first_elem(&rmesa->dma.reserved)->bo, 1); } /* Allocates a region from rmesa->dma.current. If there isn't enough @@ -332,6 +335,10 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa) /* request updated cs processing information from kernel */ legacy_track_pending(rmesa->radeonScreen->bom, 0); } + + if (!is_empty_list(&rmesa->dma.reserved)) + radeon_bo_unmap(first_elem(&rmesa->dma.reserved)->bo); + /* move waiting bos to free list. wait list provides gpu time to handle data before reuse */ foreach_s(dma_bo, temp, &rmesa->dma.wait) { @@ -349,8 +356,11 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa) FREE(dma_bo); continue; } - if (!radeon_bo_is_idle(dma_bo->bo)) + if (!radeon_bo_is_idle(dma_bo->bo)) { + if (rmesa->radeonScreen->driScreen->dri2.enabled) + break; continue; + } remove_from_list(dma_bo); dma_bo->expire_counter = expire_at; insert_at_tail(&rmesa->dma.free, dma_bo); @@ -388,7 +398,7 @@ void rcommon_flush_last_swtcl_prim( GLcontext *ctx ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); struct radeon_dma *dma = &rmesa->dma; - + if (RADEON_DEBUG & RADEON_IOCTL) fprintf(stderr, "%s\n", __FUNCTION__); dma->flush = NULL; -- cgit v1.2.3 From 6e48f17a1620dda83e0fedd68a8f004ed1fbfea9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 23:18:29 +0000 Subject: glapi: Fix syntax. --- src/mesa/glapi/glapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 056abd7233..fcb30895aa 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -175,7 +175,7 @@ _glapi_check_multithread(void) CHECK_MULTITHREAD_LOCK(); if (firstCall) { - _glapi_init_multithread(void) + _glapi_init_multithread(); knownID = _glthread_GetID(); firstCall = GL_FALSE; -- cgit v1.2.3 From d3f24ab33c284325abaf4b250f8928d4d53836e1 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Tue, 2 Mar 2010 03:31:16 +0200 Subject: glapi: fix compile with ES --- src/mesa/glapi/glapi.c | 6 +++++- src/mesa/glapi/glapi_getproc.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index fcb30895aa..13de594aaf 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -256,7 +256,7 @@ _glapi_set_dispatch(struct _glapi_table *dispatch) /* use the no-op functions */ dispatch = (struct _glapi_table *) __glapi_noop_table; } -#if 0 /* enable this for extra DEBUG */ +#ifdef DEBUG else { _glapi_check_table_not_null(dispatch); _glapi_check_table(dispatch); @@ -322,10 +322,14 @@ _glapi_get_dispatch_table_size(void) void _glapi_check_table_not_null(const struct _glapi_table *table) { +#if 0 /* enable this for extra DEBUG */ const GLuint entries = _glapi_get_dispatch_table_size(); const void **tab = (const void **) table; GLuint i; for (i = 1; i < entries; i++) { assert(tab[i]); } +#else + (void) table; +#endif } diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index 5be6d65b56..a6dbf173e8 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -773,6 +773,7 @@ _glapi_get_proc_name(GLuint offset) void _glapi_check_table(const struct _glapi_table *table) { +#if 0 /* enable this for extra DEBUG */ { GLuint BeginOffset = _glapi_get_proc_offset("glBegin"); char *BeginFunc = (char*) &table->Begin; @@ -829,4 +830,7 @@ _glapi_check_table(const struct _glapi_table *table) assert(setFenceOffset == _gloffset_SetFenceNV); assert(setFenceOffset == offset); } +#else + (void) table; +#endif } -- cgit v1.2.3 From 80f3cc36c511f62666162bca1d88c7746b98a27d Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 1 Mar 2010 22:11:08 -0500 Subject: llvmpipe: implement some control-flow implements if/else/endif constructs and lays down the code for looping and others. we create a conditional execution mask which decides which of the four inputs are enabled for any store. it's used only if an execution mask is present, otherwise we go through a direct store. --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 104 +++++++++++++++++++++--- 1 file changed, 93 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 4cf28a9f93..81b0ab760e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -52,6 +52,7 @@ #include "lp_bld_swizzle.h" #include "lp_bld_flow.h" #include "lp_bld_tgsi.h" +#include "lp_bld_debug.h" #define LP_MAX_TEMPS 256 @@ -81,6 +82,23 @@ #define QUAD_BOTTOM_LEFT 2 #define QUAD_BOTTOM_RIGHT 3 +#define LP_TGSI_MAX_NESTING 16 + +struct lp_exec_mask { + struct lp_build_context *bld; + + boolean has_mask; + + LLVMTypeRef int_vec_type; + + LLVMValueRef cond_stack[LP_TGSI_MAX_NESTING]; + int cond_stack_size; + LLVMValueRef cond_mask; + + LLVMValueRef exec_mask; + + LLVMValueRef inv_mask; +}; struct lp_build_tgsi_soa_context { @@ -97,9 +115,9 @@ struct lp_build_tgsi_soa_context LLVMValueRef temps[LP_MAX_TEMPS][NUM_CHANNELS]; struct lp_build_mask_context *mask; + struct lp_exec_mask exec_mask; }; - static const unsigned char swizzle_left[4] = { QUAD_TOP_LEFT, QUAD_TOP_LEFT, @@ -124,6 +142,70 @@ swizzle_bottom[4] = { QUAD_BOTTOM_LEFT, QUAD_BOTTOM_RIGHT }; +static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context *bld) +{ + mask->bld = bld; + mask->has_mask = FALSE; + mask->cond_stack_size = 0; + + mask->int_vec_type = lp_build_int_vec_type(mask->bld->type); + mask->inv_mask = + LLVMConstSub(LLVMConstNull(mask->int_vec_type), + LLVMConstAllOnes(mask->int_vec_type)); +} + +static void lp_exec_mask_update(struct lp_exec_mask *mask) +{ + mask->exec_mask = mask->cond_mask; + if (mask->cond_stack_size > 0) + mask->has_mask = TRUE; +} + +static void lp_exec_mask_cond_push(struct lp_exec_mask *mask, + LLVMValueRef val) +{ + mask->cond_stack[mask->cond_stack_size++] = mask->cond_mask; + mask->cond_mask = LLVMBuildBitCast(mask->bld->builder, val, + mask->int_vec_type, ""); + + lp_exec_mask_update(mask); +} + +static void lp_exec_mask_cond_invert(struct lp_exec_mask *mask) +{ + LLVMValueRef prev_mask = mask->cond_stack[mask->cond_stack_size - 1]; + LLVMValueRef inv_mask = LLVMBuildXor(mask->bld->builder, + mask->cond_mask, + mask->inv_mask, ""); + mask->cond_mask = LLVMBuildAnd(mask->bld->builder, + inv_mask, + prev_mask, ""); + lp_exec_mask_update(mask); +} + +static void lp_exec_mask_cond_pop(struct lp_exec_mask *mask) +{ + mask->cond_mask = mask->cond_stack[--mask->cond_stack_size]; + lp_exec_mask_update(mask); +} + +static void lp_exec_mask_store(struct lp_exec_mask *mask, + LLVMValueRef val, + LLVMValueRef dst) +{ + if (mask->has_mask) { + LLVMValueRef real_val, dst_val; + + dst_val = LLVMBuildLoad(mask->bld->builder, dst, ""); + real_val = lp_build_select(mask->bld, + mask->exec_mask, + val, dst_val); + + LLVMBuildStore(mask->bld->builder, real_val, dst); + } else + LLVMBuildStore(mask->bld->builder, val, dst); +} + static LLVMValueRef emit_ddx(struct lp_build_tgsi_soa_context *bld, @@ -287,13 +369,13 @@ emit_store( switch( reg->Register.File ) { case TGSI_FILE_OUTPUT: - LLVMBuildStore(bld->base.builder, value, - bld->outputs[reg->Register.Index][chan_index]); + lp_exec_mask_store(&bld->exec_mask, value, + bld->outputs[reg->Register.Index][chan_index]); break; case TGSI_FILE_TEMPORARY: - LLVMBuildStore(bld->base.builder, value, - bld->temps[reg->Register.Index][chan_index]); + lp_exec_mask_store(&bld->exec_mask, value, + bld->temps[reg->Register.Index][chan_index]); break; case TGSI_FILE_ADDRESS: @@ -1272,8 +1354,8 @@ emit_instruction( break; case TGSI_OPCODE_IF: - /* FIXME */ - return 0; + tmp0 = emit_fetch(bld, inst, 0, CHAN_X); + lp_exec_mask_cond_push(&bld->exec_mask, tmp0); break; case TGSI_OPCODE_BGNFOR: @@ -1289,13 +1371,11 @@ emit_instruction( break; case TGSI_OPCODE_ELSE: - /* FIXME */ - return 0; + lp_exec_mask_cond_invert(&bld->exec_mask); break; case TGSI_OPCODE_ENDIF: - /* FIXME */ - return 0; + lp_exec_mask_cond_pop(&bld->exec_mask); break; case TGSI_OPCODE_ENDFOR: @@ -1458,6 +1538,8 @@ lp_build_tgsi_soa(LLVMBuilderRef builder, bld.consts_ptr = consts_ptr; bld.sampler = sampler; + lp_exec_mask_init(&bld.exec_mask, &bld.base); + tgsi_parse_init( &parse, tokens ); while( !tgsi_parse_end_of_tokens( &parse ) ) { -- cgit v1.2.3 From 8bf5c229f3fdf2f3a6ae44afe03d3e1bd7194d6a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 2 Mar 2010 14:05:21 +1000 Subject: r600: fix blender picking. This fixes the sw fallback for GL_SELECT picking modes. Fixes object picking blender + depthpick test http://bugs.freedesktop.org/show_bug.cgi?id=26419 Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r600/r700_render.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 1d7a94cbb2..1929b7cc12 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -829,11 +829,10 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer #if MESA_BIG_ENDIAN if (mesa_ind_buf->type == GL_UNSIGNED_INT) - { #else if (mesa_ind_buf->type != GL_UNSIGNED_BYTE) - { #endif + { const GLvoid *src_ptr; GLvoid *dst_ptr; GLboolean mapped_named_bo = GL_FALSE; @@ -872,6 +871,14 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer } } +static GLboolean check_fallbacks(GLcontext *ctx) +{ + if (ctx->RenderMode != GL_RENDER) + return GL_TRUE; + + return GL_FALSE; +} + static GLboolean r700TryDrawPrims(GLcontext *ctx, const struct gl_client_array *arrays[], const struct _mesa_prim *prim, @@ -888,6 +895,9 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, if (ctx->NewState) _mesa_update_state( ctx ); + if (check_fallbacks(ctx)) + return GL_FALSE; + _tnl_UpdateFixedFunctionProgram(ctx); r700SetVertexFormat(ctx, arrays, max_index + 1); /* shaders need to be updated before buffers are validated */ @@ -983,8 +993,10 @@ static void r700DrawPrims(GLcontext *ctx, retval = r700TryDrawPrims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); /* If failed run tnl pipeline - it should take care of fallbacks */ - if (!retval) + if (!retval) { + _swsetup_Wakeup(ctx); _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); + } } void r700InitDraw(GLcontext *ctx) -- cgit v1.2.3 From 247008f6c2014c8f84de3a27ac954afe2c418a93 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 2 Mar 2010 01:01:23 -0800 Subject: mesa: Add asserts to check inputs to memcpy. --- src/mesa/main/mipmap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 21ee317a31..e2efe81a8f 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1269,6 +1269,8 @@ make_1d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border) { /* copy left-most pixel from source */ + assert(dstPtr); + assert(srcPtr); memcpy(dstPtr, srcPtr, bpt); /* copy right-most pixel from source */ memcpy(dstPtr + (dstWidth - 1) * bpt, -- cgit v1.2.3 From 8462fe2bbf2aac87e6eabddc805b3d3ec63c6376 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 2 Mar 2010 01:10:29 -0800 Subject: glsl: Add assert to check input to strcmp. --- src/mesa/shader/slang/slang_builtin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 5533cc5b65..f0659a8d8b 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -142,6 +142,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field, tokens[1] = index1; } else if (strcmp(var, "gl_Point") == 0) { + assert(field); if (strcmp(field, "size") == 0) { tokens[0] = STATE_POINT_SIZE; *swizzleOut = SWIZZLE_XXXX; -- cgit v1.2.3 From c1c7fa5192c4fb3f51fb67c81e58713d61ff0c93 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 2 Mar 2010 01:15:02 -0800 Subject: i915g: Add assert to check for null pointer dereference. --- src/gallium/drivers/i915/i915_state_emit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_state_emit.c b/src/gallium/drivers/i915/i915_state_emit.c index a3d4e3b04e..ecbcabb440 100644 --- a/src/gallium/drivers/i915/i915_state_emit.c +++ b/src/gallium/drivers/i915/i915_state_emit.c @@ -244,6 +244,7 @@ i915_emit_hardware_state(struct i915_context *i915 ) OUT_BATCH(_3DSTATE_BUF_INFO_CMD); + assert(tex); OUT_BATCH(BUF_3D_ID_DEPTH | BUF_3D_PITCH(tex->stride) | /* pitch in bytes */ ztile); -- cgit v1.2.3 From ff9ddf4d39be9e36d3e1dd9e10e889efa40dfb1e Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 2 Mar 2010 02:37:45 +0100 Subject: util/blitter: Fix the viewport transformation for Z coordinates When clearing buffers, the depth is specified in the range [0, 1] and should be passed through blitter "as is". --- src/gallium/auxiliary/util/u_blitter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index f93c69d193..0ba09d33bf 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -320,11 +320,11 @@ static void blitter_set_rectangle(struct blitter_context_priv *ctx, /* viewport */ ctx->viewport.scale[0] = 0.5f * width; ctx->viewport.scale[1] = 0.5f * height; - ctx->viewport.scale[2] = 0.5f; + ctx->viewport.scale[2] = 1.0f; ctx->viewport.scale[3] = 1.0f; ctx->viewport.translate[0] = 0.5f * width; ctx->viewport.translate[1] = 0.5f * height; - ctx->viewport.translate[2] = 0.5f; + ctx->viewport.translate[2] = 0.0f; ctx->viewport.translate[3] = 0.0f; ctx->pipe->set_viewport_state(ctx->pipe, &ctx->viewport); -- cgit v1.2.3 From b5cfa6f1966557106a7033b2c80769d64c72ce4c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:13:41 +0000 Subject: r300: Rename pipe formats. --- src/gallium/drivers/r300/r300_blit.c | 4 +- src/gallium/drivers/r300/r300_screen.c | 6 +-- src/gallium/drivers/r300/r300_state.c | 4 +- src/gallium/drivers/r300/r300_texture.c | 82 ++++++++++++++++----------------- 4 files changed, 48 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 32d05749bd..0e2d6c5b42 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -141,10 +141,10 @@ void r300_surface_copy(struct pipe_context* pipe, new_format = PIPE_FORMAT_I8_UNORM; break; case 2: - new_format = PIPE_FORMAT_A4R4G4B4_UNORM; + new_format = PIPE_FORMAT_B4G4R4A4_UNORM; break; case 4: - new_format = PIPE_FORMAT_A8R8G8B8_UNORM; + new_format = PIPE_FORMAT_B8G8R8A8_UNORM; break; default: debug_printf("r300: surface_copy: Unhandled format: %s. Falling back to software.\n" diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 6a55570571..d397a8eb2b 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -210,9 +210,9 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, { uint32_t retval = 0; boolean is_r500 = r300_screen(screen)->caps->is_r500; - boolean is_z24 = format == PIPE_FORMAT_Z24X8_UNORM || - format == PIPE_FORMAT_Z24S8_UNORM; - boolean is_color2101010 = format == PIPE_FORMAT_A2B10G10R10_UNORM; + boolean is_z24 = format == PIPE_FORMAT_X8Z24_UNORM || + format == PIPE_FORMAT_S8Z24_UNORM; + boolean is_color2101010 = format == PIPE_FORMAT_R10G10B10A2_UNORM; if (target >= PIPE_MAX_TEXTURE_TYPES) { debug_printf("r300: Implementation error: Received bogus texture " diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 12bf083871..6c23045561 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -356,7 +356,7 @@ static void r300_set_blend_color(struct pipe_context* pipe, (struct r300_blend_color_state*)r300->blend_color_state.state; union util_color uc; - util_pack_color(color->color, PIPE_FORMAT_A8R8G8B8_UNORM, &uc); + util_pack_color(color->color, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); state->blend_color = uc.ui; /* XXX if FP16 blending is enabled, we should use the FP16 format */ @@ -869,7 +869,7 @@ static void* sampler->filter1 |= r300_anisotropy(state->max_anisotropy); - util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM, &uc); + util_pack_color(state->border_color, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); sampler->border_color = uc.ui; /* R500-specific fixups and optimizations */ diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index ea474737b1..44cfe82a57 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -92,8 +92,8 @@ static uint32_t r300_translate_texformat(enum pipe_format format) switch (format) { case PIPE_FORMAT_Z16_UNORM: return R300_EASY_TX_FORMAT(X, X, X, X, X16); - case PIPE_FORMAT_Z24X8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return R300_EASY_TX_FORMAT(X, X, X, X, W24_FP); default: return ~0; /* Unsupported. */ @@ -104,9 +104,9 @@ static uint32_t r300_translate_texformat(enum pipe_format format) result |= R300_TX_FORMAT_YUV_TO_RGB; switch (format) { - case PIPE_FORMAT_YCBCR: + case PIPE_FORMAT_UYVY: return R300_EASY_TX_FORMAT(X, Y, Z, ONE, YVYU422) | result; - case PIPE_FORMAT_YCBCR_REV: + case PIPE_FORMAT_YUYV: return R300_EASY_TX_FORMAT(X, Y, Z, ONE, VYUY422) | result; default: return ~0; /* Unsupported/unknown. */ @@ -308,31 +308,31 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) return R300_COLOR_FORMAT_I8; /* 16-bit buffers. */ - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return R300_COLOR_FORMAT_RGB565; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return R300_COLOR_FORMAT_ARGB1555; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: return R300_COLOR_FORMAT_ARGB4444; /* 32-bit buffers. */ - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_SRGB: - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_SRGB: case PIPE_FORMAT_B8G8R8A8_UNORM: case PIPE_FORMAT_B8G8R8A8_SRGB: case PIPE_FORMAT_B8G8R8X8_UNORM: case PIPE_FORMAT_B8G8R8X8_SRGB: - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_X8R8G8B8_SRGB: + case PIPE_FORMAT_A8B8G8R8_UNORM: case PIPE_FORMAT_R8G8B8A8_SNORM: - case PIPE_FORMAT_R8G8B8A8_SRGB: - case PIPE_FORMAT_R8G8B8X8_UNORM: - case PIPE_FORMAT_R8G8B8X8_SRGB: - case PIPE_FORMAT_X8B8G8R8_SNORM: - case PIPE_FORMAT_X8UB8UG8SR8S_NORM: + case PIPE_FORMAT_A8B8G8R8_SRGB: + case PIPE_FORMAT_X8B8G8R8_UNORM: + case PIPE_FORMAT_X8B8G8R8_SRGB: + case PIPE_FORMAT_R8G8B8X8_SNORM: + case PIPE_FORMAT_R8SG8SB8UX8U_NORM: return R300_COLOR_FORMAT_ARGB8888; - case PIPE_FORMAT_A2B10G10R10_UNORM: + case PIPE_FORMAT_R10G10B10A2_UNORM: return R500_COLOR_FORMAT_ARGB2101010; /* R5xx-only? */ /* 64-bit buffers. */ @@ -349,9 +349,9 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) #endif /* YUV buffers. */ - case PIPE_FORMAT_YCBCR: + case PIPE_FORMAT_UYVY: return R300_COLOR_FORMAT_YVYU; - case PIPE_FORMAT_YCBCR_REV: + case PIPE_FORMAT_YUYV: return R300_COLOR_FORMAT_VYUY; default: return ~0; /* Unsupported. */ @@ -366,9 +366,9 @@ static uint32_t r300_translate_zsformat(enum pipe_format format) case PIPE_FORMAT_Z16_UNORM: return R300_DEPTHFORMAT_16BIT_INT_Z; /* 24-bit depth, ignored stencil */ - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: /* 24-bit depth, 8-bit stencil */ - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return R300_DEPTHFORMAT_24BIT_INT_Z_8BIT_STENCIL; default: return ~0; /* Unsupported. */ @@ -435,40 +435,40 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) return modifier | R300_C2_SEL_R; /* ARGB 32-bit outputs. */ - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_SRGB: - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_SRGB: + case PIPE_FORMAT_B5G6R5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8A8_SRGB: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8X8_SRGB: return modifier | R300_C0_SEL_B | R300_C1_SEL_G | R300_C2_SEL_R | R300_C3_SEL_A; /* BGRA 32-bit outputs. */ - case PIPE_FORMAT_B8G8R8A8_UNORM: - case PIPE_FORMAT_B8G8R8A8_SRGB: - case PIPE_FORMAT_B8G8R8X8_UNORM: - case PIPE_FORMAT_B8G8R8X8_SRGB: + case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_X8R8G8B8_SRGB: return modifier | R300_C0_SEL_A | R300_C1_SEL_R | R300_C2_SEL_G | R300_C3_SEL_B; /* RGBA 32-bit outputs. */ - case PIPE_FORMAT_R8G8B8A8_UNORM_REV: + case PIPE_FORMAT_A8B8G8R8_UNORM: case PIPE_FORMAT_R8G8B8A8_SNORM: - case PIPE_FORMAT_R8G8B8A8_SRGB: - case PIPE_FORMAT_R8G8B8X8_UNORM: - case PIPE_FORMAT_R8G8B8X8_SRGB: + case PIPE_FORMAT_A8B8G8R8_SRGB: + case PIPE_FORMAT_X8B8G8R8_UNORM: + case PIPE_FORMAT_X8B8G8R8_SRGB: return modifier | R300_C0_SEL_A | R300_C1_SEL_B | R300_C2_SEL_G | R300_C3_SEL_R; /* ABGR 32-bit outputs. */ - case PIPE_FORMAT_X8B8G8R8_SNORM: - case PIPE_FORMAT_X8UB8UG8SR8S_NORM: - case PIPE_FORMAT_A2B10G10R10_UNORM: + case PIPE_FORMAT_R8G8B8X8_SNORM: + case PIPE_FORMAT_R8SG8SB8UX8U_NORM: + case PIPE_FORMAT_R10G10B10A2_UNORM: /* RGBA high precision outputs (same swizzles as ABGR low precision) */ case PIPE_FORMAT_R16G16B16A16_UNORM: case PIPE_FORMAT_R16G16B16A16_SNORM: @@ -867,7 +867,7 @@ r300_video_surface_create(struct pipe_screen *screen, memset(&template, 0, sizeof(struct pipe_texture)); template.target = PIPE_TEXTURE_2D; - template.format = PIPE_FORMAT_X8R8G8B8_UNORM; + template.format = PIPE_FORMAT_B8G8R8X8_UNORM; template.last_level = 0; template.width0 = util_next_power_of_two(width); template.height0 = util_next_power_of_two(height); -- cgit v1.2.3 From b7b07b0029c4c17603c97467dda0a487417c2477 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:13:57 +0000 Subject: softpipe: Rename pipe formats. --- src/gallium/drivers/softpipe/sp_quad_depth_test.c | 24 +++++++++++------------ src/gallium/drivers/softpipe/sp_screen.c | 8 ++++---- src/gallium/drivers/softpipe/sp_texture.c | 2 +- src/gallium/drivers/softpipe/sp_tile_cache.c | 6 +++--- 4 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_quad_depth_test.c b/src/gallium/drivers/softpipe/sp_quad_depth_test.c index dab9565443..4815a0d49f 100644 --- a/src/gallium/drivers/softpipe/sp_quad_depth_test.c +++ b/src/gallium/drivers/softpipe/sp_quad_depth_test.c @@ -73,8 +73,8 @@ get_depth_stencil_values( struct depth_data *data, data->bzzzz[j] = tile->data.depth32[y][x]; } break; - case PIPE_FORMAT_X8Z24_UNORM: - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: for (j = 0; j < QUAD_SIZE; j++) { int x = quad->input.x0 % TILE_SIZE + (j & 1); int y = quad->input.y0 % TILE_SIZE + (j >> 1); @@ -82,8 +82,8 @@ get_depth_stencil_values( struct depth_data *data, data->stencilVals[j] = tile->data.depth32[y][x] >> 24; } break; - case PIPE_FORMAT_Z24X8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: for (j = 0; j < QUAD_SIZE; j++) { int x = quad->input.x0 % TILE_SIZE + (j & 1); int y = quad->input.y0 % TILE_SIZE + (j >> 1); @@ -146,8 +146,8 @@ convert_quad_depth( struct depth_data *data, } } break; - case PIPE_FORMAT_X8Z24_UNORM: - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: { float scale = (float) ((1 << 24) - 1); @@ -156,8 +156,8 @@ convert_quad_depth( struct depth_data *data, } } break; - case PIPE_FORMAT_Z24X8_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: { float scale = (float) ((1 << 24) - 1); @@ -189,7 +189,7 @@ write_depth_stencil_values( struct depth_data *data, tile->data.depth16[y][x] = (ushort) data->bzzzz[j]; } break; - case PIPE_FORMAT_X8Z24_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: case PIPE_FORMAT_Z32_UNORM: for (j = 0; j < QUAD_SIZE; j++) { int x = quad->input.x0 % TILE_SIZE + (j & 1); @@ -197,21 +197,21 @@ write_depth_stencil_values( struct depth_data *data, tile->data.depth32[y][x] = data->bzzzz[j]; } break; - case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_Z24S8_UNORM: for (j = 0; j < QUAD_SIZE; j++) { int x = quad->input.x0 % TILE_SIZE + (j & 1); int y = quad->input.y0 % TILE_SIZE + (j >> 1); tile->data.depth32[y][x] = (data->stencilVals[j] << 24) | data->bzzzz[j]; } break; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: for (j = 0; j < QUAD_SIZE; j++) { int x = quad->input.x0 % TILE_SIZE + (j & 1); int y = quad->input.y0 % TILE_SIZE + (j >> 1); tile->data.depth32[y][x] = (data->bzzzz[j] << 8) | data->stencilVals[j]; } break; - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: for (j = 0; j < QUAD_SIZE; j++) { int x = quad->input.x0 % TILE_SIZE + (j & 1); int y = quad->input.y0 % TILE_SIZE + (j >> 1); diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 937b6a8439..6ec63fe698 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -152,16 +152,16 @@ softpipe_is_format_supported( struct pipe_screen *screen, switch(format) { case PIPE_FORMAT_L16_UNORM: - case PIPE_FORMAT_YCBCR_REV: - case PIPE_FORMAT_YCBCR: + case PIPE_FORMAT_YUYV: + case PIPE_FORMAT_UYVY: case PIPE_FORMAT_DXT1_RGB: case PIPE_FORMAT_DXT1_RGBA: case PIPE_FORMAT_DXT3_RGBA: case PIPE_FORMAT_DXT5_RGBA: case PIPE_FORMAT_Z32_FLOAT: case PIPE_FORMAT_R8G8_SNORM: - case PIPE_FORMAT_B6UG5SR5S_NORM: - case PIPE_FORMAT_X8UB8UG8SR8S_NORM: + case PIPE_FORMAT_R5SG5SB6U_NORM: + case PIPE_FORMAT_R8SG8SB8UX8U_NORM: case PIPE_FORMAT_R8G8B8A8_SNORM: case PIPE_FORMAT_NONE: return FALSE; diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index 371c4e2025..32d261b5ff 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -426,7 +426,7 @@ softpipe_video_surface_create(struct pipe_screen *screen, memset(&template, 0, sizeof(struct pipe_texture)); template.target = PIPE_TEXTURE_2D; - template.format = PIPE_FORMAT_X8R8G8B8_UNORM; + template.format = PIPE_FORMAT_B8G8R8X8_UNORM; template.last_level = 0; /* vl_mpeg12_mc_renderer expects this when it's initialized with pot_buffers=true */ template.width0 = util_next_power_of_two(width); diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index 1b50bd7ffe..3b30954ac8 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -162,10 +162,10 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc, PIPE_TRANSFER_READ_WRITE, 0, 0, ps->width, ps->height); - tc->depth_stencil = (ps->format == PIPE_FORMAT_S8Z24_UNORM || - ps->format == PIPE_FORMAT_X8Z24_UNORM || - ps->format == PIPE_FORMAT_Z24S8_UNORM || + tc->depth_stencil = (ps->format == PIPE_FORMAT_Z24S8_UNORM || ps->format == PIPE_FORMAT_Z24X8_UNORM || + ps->format == PIPE_FORMAT_S8Z24_UNORM || + ps->format == PIPE_FORMAT_X8Z24_UNORM || ps->format == PIPE_FORMAT_Z16_UNORM || ps->format == PIPE_FORMAT_Z32_UNORM || ps->format == PIPE_FORMAT_S8_UNORM); -- cgit v1.2.3 From b34d138d8453d45f29632d4dcbe040be11265d26 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:14:12 +0000 Subject: svga: Rename pipe formats. --- src/gallium/drivers/svga/svga_pipe_clear.c | 4 +-- src/gallium/drivers/svga/svga_pipe_misc.c | 4 +-- src/gallium/drivers/svga/svga_pipe_sampler.c | 2 +- src/gallium/drivers/svga/svga_screen.c | 18 +++++------ src/gallium/drivers/svga/svga_screen_texture.c | 38 +++++++++++------------ src/gallium/drivers/svga/svga_state_framebuffer.c | 2 +- src/gallium/drivers/svga/svga_state_need_swtnl.c | 2 +- 7 files changed, 35 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 409b3b41cb..8483a3fad7 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -54,7 +54,7 @@ try_clear(struct svga_context *svga, if ((buffers & PIPE_CLEAR_COLOR) && fb->cbufs[0]) { flags |= SVGA3D_CLEAR_COLOR; - util_pack_color(rgba, PIPE_FORMAT_A8R8G8B8_UNORM, &uc); + util_pack_color(rgba, PIPE_FORMAT_B8G8R8A8_UNORM, &uc); rect.w = fb->cbufs[0]->width; rect.h = fb->cbufs[0]->height; @@ -63,7 +63,7 @@ try_clear(struct svga_context *svga, if ((buffers & PIPE_CLEAR_DEPTHSTENCIL) && fb->zsbuf) { flags |= SVGA3D_CLEAR_DEPTH; - if (svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_Z24S8_UNORM) + if (svga->curr.framebuffer.zsbuf->format == PIPE_FORMAT_S8Z24_UNORM) flags |= SVGA3D_CLEAR_STENCIL; rect.w = MAX2(rect.w, fb->zsbuf->width); diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c index 49b43bebc2..95bf0e6f91 100644 --- a/src/gallium/drivers/svga/svga_pipe_misc.c +++ b/src/gallium/drivers/svga/svga_pipe_misc.c @@ -118,10 +118,10 @@ static void svga_set_framebuffer_state(struct pipe_context *pipe, case PIPE_FORMAT_Z16_UNORM: svga->curr.depthscale = 1.0f / DEPTH_BIAS_SCALE_FACTOR_D16; break; - case PIPE_FORMAT_S8Z24_UNORM: - case PIPE_FORMAT_X8Z24_UNORM: case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: svga->curr.depthscale = 1.0f / DEPTH_BIAS_SCALE_FACTOR_D24S8; break; case PIPE_FORMAT_Z32_UNORM: diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index 224c4f4c18..acba2b8f9d 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -201,7 +201,7 @@ static void svga_set_sampler_textures(struct pipe_context *pipe, if (!texture[i]) continue; - if (texture[i]->format == PIPE_FORMAT_A8R8G8B8_SRGB) + if (texture[i]->format == PIPE_FORMAT_B8G8R8A8_SRGB) flag_srgb |= 1 << i; if (texture[i]->target == PIPE_TEXTURE_1D) diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 414ac52e1f..6022c38cfc 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -196,23 +196,23 @@ svga_translate_format_cap(enum pipe_format format) { switch(format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_A8R8G8B8; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_R5G6B5; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_A1R5G5B5; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_A4R4G4B4; case PIPE_FORMAT_Z16_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_Z_D16; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_Z_D24S8; - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: return SVGA3D_DEVCAP_SURFACEFMT_Z_D24X8; case PIPE_FORMAT_A8_UNORM: @@ -254,8 +254,8 @@ svga_is_format_supported( struct pipe_screen *screen, /* Often unsupported/problematic. This means we end up with the same * visuals for all virtual hardware implementations. */ - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return FALSE; /* Simulate ability to render into compressed textures */ diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index 12f3531a1d..e9792e063e 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -59,21 +59,21 @@ svga_translate_format(enum pipe_format format) { switch(format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return SVGA3D_A8R8G8B8; - case PIPE_FORMAT_X8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: return SVGA3D_X8R8G8B8; /* Required for GL2.1: */ - case PIPE_FORMAT_A8R8G8B8_SRGB: + case PIPE_FORMAT_B8G8R8A8_SRGB: return SVGA3D_A8R8G8B8; - case PIPE_FORMAT_R5G6B5_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: return SVGA3D_R5G6B5; - case PIPE_FORMAT_A1R5G5B5_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: return SVGA3D_A1R5G5B5; - case PIPE_FORMAT_A4R4G4B4_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: return SVGA3D_A4R4G4B4; @@ -83,9 +83,9 @@ svga_translate_format(enum pipe_format format) */ case PIPE_FORMAT_Z16_UNORM: return SVGA3D_Z_D16; - case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: return SVGA3D_Z_D24S8; - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: return SVGA3D_Z_D24X8; case PIPE_FORMAT_A8_UNORM: @@ -111,13 +111,13 @@ SVGA3dSurfaceFormat svga_translate_format_render(enum pipe_format format) { switch(format) { - case PIPE_FORMAT_A8R8G8B8_UNORM: - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_A1R5G5B5_UNORM: - case PIPE_FORMAT_A4R4G4B4_UNORM: - case PIPE_FORMAT_R5G6B5_UNORM: - case PIPE_FORMAT_Z24S8_UNORM: - case PIPE_FORMAT_Z24X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B5G5R5A1_UNORM: + case PIPE_FORMAT_B4G4R4A4_UNORM: + case PIPE_FORMAT_B5G6R5_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: + case PIPE_FORMAT_X8Z24_UNORM: case PIPE_FORMAT_Z32_UNORM: case PIPE_FORMAT_Z16_UNORM: case PIPE_FORMAT_L8_UNORM: @@ -403,9 +403,9 @@ svga_texture_blanket(struct pipe_screen * screen, if (sbuf->key.format == 1) - tex->base.format = PIPE_FORMAT_X8R8G8B8_UNORM; + tex->base.format = PIPE_FORMAT_B8G8R8X8_UNORM; else if (sbuf->key.format == 2) - tex->base.format = PIPE_FORMAT_A8R8G8B8_UNORM; + tex->base.format = PIPE_FORMAT_B8G8R8A8_UNORM; pipe_reference_init(&tex->base.reference, 1); tex->base.screen = screen; @@ -462,9 +462,9 @@ svga_screen_texture_wrap_surface(struct pipe_screen *screen, if (format == 1) - tex->base.format = PIPE_FORMAT_X8R8G8B8_UNORM; + tex->base.format = PIPE_FORMAT_B8G8R8X8_UNORM; else if (format == 2) - tex->base.format = PIPE_FORMAT_A8R8G8B8_UNORM; + tex->base.format = PIPE_FORMAT_B8G8R8A8_UNORM; pipe_reference_init(&tex->base.reference, 1); tex->base.screen = screen; diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c index b4cafb8f21..7b12c66f94 100644 --- a/src/gallium/drivers/svga/svga_state_framebuffer.c +++ b/src/gallium/drivers/svga/svga_state_framebuffer.c @@ -70,7 +70,7 @@ static int emit_framebuffer( struct svga_context *svga, return ret; if (curr->zsbuf && - curr->zsbuf->format == PIPE_FORMAT_Z24S8_UNORM) { + curr->zsbuf->format == PIPE_FORMAT_S8Z24_UNORM) { ret = SVGA3D_SetRenderTarget(svga->swc, SVGA3D_RT_STENCIL, curr->zsbuf); if (ret != PIPE_OK) return ret; diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index dd13a89d24..d3644fecad 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -43,7 +43,7 @@ svga_translate_vertex_format(enum pipe_format format) case PIPE_FORMAT_R32G32_FLOAT: return SVGA3D_DECLTYPE_FLOAT2; case PIPE_FORMAT_R32G32B32_FLOAT: return SVGA3D_DECLTYPE_FLOAT3; case PIPE_FORMAT_R32G32B32A32_FLOAT: return SVGA3D_DECLTYPE_FLOAT4; - case PIPE_FORMAT_B8G8R8A8_UNORM: return SVGA3D_DECLTYPE_D3DCOLOR; + case PIPE_FORMAT_A8R8G8B8_UNORM: return SVGA3D_DECLTYPE_D3DCOLOR; case PIPE_FORMAT_R8G8B8A8_USCALED: return SVGA3D_DECLTYPE_UBYTE4; case PIPE_FORMAT_R16G16_SSCALED: return SVGA3D_DECLTYPE_SHORT2; case PIPE_FORMAT_R16G16B16A16_SSCALED: return SVGA3D_DECLTYPE_SHORT4; -- cgit v1.2.3 From 907d5611b2d17efaf7e243ff766b04de957267d0 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:14:26 +0000 Subject: drm/nouveau: Rename pipe formats. --- src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c index c814d986b1..0d05f316c4 100644 --- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c +++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c @@ -119,9 +119,9 @@ nouveau_drm_create_screen(struct drm_api *api, int fd, enum pipe_format format; if (nvdri->bpp == 16) - format = PIPE_FORMAT_R5G6B5_UNORM; + format = PIPE_FORMAT_B5G6R5_UNORM; else - format = PIPE_FORMAT_A8R8G8B8_UNORM; + format = PIPE_FORMAT_B8G8R8A8_UNORM; nvws->front = dri_surface_from_handle(api, nvws->pscreen, nvdri->front_offset, -- cgit v1.2.3 From 4028fab89296346b1ae267e589d41c5ff4a5bab6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 1 Mar 2010 18:14:31 +0000 Subject: gdi: Rename pipe formats. --- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index e9e5990cf5..a9fa03b8e5 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -75,8 +75,8 @@ gdi_llvmpipe_is_displaytarget_format_supported( struct llvmpipe_winsys *ws, enum pipe_format format ) { switch(format) { - case PIPE_FORMAT_X8R8G8B8_UNORM: - case PIPE_FORMAT_A8R8G8B8_UNORM: + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: return TRUE; /* TODO: Support other formats possible with BMPs, as described in -- cgit v1.2.3 From 7a31bed4b1d2aa099a8af02d9ab8dee33e0c1858 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Mar 2010 11:30:23 +0000 Subject: util: Tweak comment for D3D10-like formats. --- src/gallium/auxiliary/util/u_format.csv | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 43d69f1cd8..c9766e6207 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -119,7 +119,9 @@ PIPE_FORMAT_DXT1_SRGBA , compressed, 4, 4, x64 , , , , xy PIPE_FORMAT_DXT3_SRGBA , compressed, 4, 4, x128, , , , xyzw, srgb PIPE_FORMAT_DXT5_SRGBA , compressed, 4, 4, x128, , , , xyzw, srgb -# Old vector formats +# Straightforward D3D10-like formats (also used for +# vertex buffer element description) +# # See also: # - src/gallium/auxiliary/translate/translate_generic.c # - src/mesa/state_tracker/st_draw.c -- cgit v1.2.3 From 5f40a7aed12500fd6792e2453f495555c3b5c54d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Mar 2010 07:34:29 -0700 Subject: glx: replace assertion with conditional See fd.o bug 26832. --- src/glx/glx_pbuffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index f635138d62..52e067165c 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -379,8 +379,8 @@ CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig, req->glxwindow = (GLXWindow) XAllocID(dpy); req->numAttribs = (CARD32) i; - assert(attrib_list); - memcpy(data, attrib_list, 8 * i); + if (attrib_list) + memcpy(data, attrib_list, 8 * i); UnlockDisplay(dpy); SyncHandle(); -- cgit v1.2.3 From cb099c2ecfe3cf8d8ff21c3031e3c2d43efd0e69 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Mar 2010 07:47:56 -0700 Subject: i965: include macros.h to get CLAMP macro --- src/mesa/drivers/dri/i965/gen6_cc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index 65e16e70c7..42b41f3210 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -30,6 +30,7 @@ #include "brw_defines.h" #include "brw_util.h" #include "intel_batchbuffer.h" +#include "main/macros.h" struct brw_blend_state_key { GLboolean color_blend, alpha_enabled; -- cgit v1.2.3 From 8417528e3a5b9f2aed783222091ca96b56e8c37a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 2 Mar 2010 07:50:15 -0700 Subject: intel: passs correct context type to intel_prepare_render() call --- src/mesa/drivers/dri/intel/intel_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 767ad8c9d2..ec379a77ac 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -891,7 +891,7 @@ intelMakeCurrent(__DRIcontext * driContextPriv, intel->driDrawable = driDrawPriv; driContextPriv->dri2.draw_stamp = driDrawPriv->dri2.stamp - 1; driContextPriv->dri2.read_stamp = driReadPriv->dri2.stamp - 1; - intel_prepare_render(&intel->ctx); + intel_prepare_render(intel); } else { _mesa_make_current(NULL, NULL, NULL); -- cgit v1.2.3 From 5fe2ce28b6e9fba181c13c6f49b57b3dd68fe88e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Mar 2010 14:41:35 +0000 Subject: llvmpipe: reorganize transfer usage Move transfer creation and mapping to the "scene" object, and out of the rasterizer. The rasterizer operates on already-mapped framebuffers only, and no longer needs a screen or context pointer. The scene object has access to a pipe_context, and this reorg prepares for moving transfer functionality from the screen to the context. --- src/gallium/drivers/llvmpipe/lp_context.c | 2 +- src/gallium/drivers/llvmpipe/lp_rast.c | 310 +++++++++------------------- src/gallium/drivers/llvmpipe/lp_rast.h | 21 +- src/gallium/drivers/llvmpipe/lp_rast_priv.h | 50 +++-- src/gallium/drivers/llvmpipe/lp_scene.c | 248 +++++++++++++++++----- src/gallium/drivers/llvmpipe/lp_scene.h | 34 ++- src/gallium/drivers/llvmpipe/lp_setup.c | 36 ++-- src/gallium/drivers/llvmpipe/lp_setup.h | 2 +- 8 files changed, 379 insertions(+), 324 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index 9120226de0..e31ae6a3fc 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -183,7 +183,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv ) if (debug_get_bool_option( "LP_NO_RAST", FALSE )) llvmpipe->no_rast = TRUE; - llvmpipe->setup = lp_setup_create( screen, + llvmpipe->setup = lp_setup_create( &llvmpipe->pipe, llvmpipe->draw ); if (!llvmpipe->setup) goto fail; diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 82c006d78b..dd77bb30d1 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -42,114 +42,60 @@ #include "lp_scene.h" -/** - * Begin the rasterization phase. - * Map the framebuffer surfaces. Initialize the 'rast' state. +/* Begin rasterizing a scene: */ static boolean lp_rast_begin( struct lp_rasterizer *rast, - const struct pipe_framebuffer_state *fb, - boolean write_color, - boolean write_zstencil ) + struct lp_scene *scene ) { - struct pipe_screen *screen = rast->screen; - struct pipe_surface *cbuf, *zsbuf; + const struct pipe_framebuffer_state *fb = &scene->fb; + boolean write_color = fb->nr_cbufs != 0; + boolean write_zstencil = fb->zsbuf != NULL; int i; - LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); + rast->curr_scene = scene; - util_copy_framebuffer_state(&rast->state.fb, fb); + LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); + rast->state.nr_cbufs = scene->fb.nr_cbufs; rast->state.write_zstencil = write_zstencil; rast->state.write_color = write_color; - - rast->check_for_clipped_tiles = (fb->width % TILE_SIZE != 0 || - fb->height % TILE_SIZE != 0); - - for (i = 0; i < rast->state.fb.nr_cbufs; i++) { - cbuf = rast->state.fb.cbufs[i]; - if (cbuf) { - rast->cbuf_transfer[i] = screen->get_tex_transfer(rast->screen, - cbuf->texture, - cbuf->face, - cbuf->level, - cbuf->zslice, - PIPE_TRANSFER_READ_WRITE, - 0, 0, - cbuf->width, - cbuf->height); - if (!rast->cbuf_transfer[i]) - goto fail; - - rast->cbuf_map[i] = screen->transfer_map(rast->screen, - rast->cbuf_transfer[i]); - if (!rast->cbuf_map[i]) - goto fail; - } + for (i = 0; i < rast->state.nr_cbufs; i++) { + rast->cbuf[i].map = scene->cbuf_map[i]; + rast->cbuf[i].format = scene->cbuf_transfer[i]->texture->format; + rast->cbuf[i].width = scene->cbuf_transfer[i]->width; + rast->cbuf[i].height = scene->cbuf_transfer[i]->height; + rast->cbuf[i].stride = scene->cbuf_transfer[i]->stride; } - zsbuf = rast->state.fb.zsbuf; - if (zsbuf) { - rast->zsbuf_transfer = screen->get_tex_transfer(rast->screen, - zsbuf->texture, - zsbuf->face, - zsbuf->level, - zsbuf->zslice, - PIPE_TRANSFER_READ_WRITE, - 0, 0, - zsbuf->width, - zsbuf->height); - if (!rast->zsbuf_transfer) - goto fail; - - rast->zsbuf_map = screen->transfer_map(rast->screen, - rast->zsbuf_transfer); - if (!rast->zsbuf_map) - goto fail; + if (write_zstencil) { + rast->zsbuf.map = scene->zsbuf_map; + rast->zsbuf.stride = scene->zsbuf_transfer->stride; + rast->zsbuf.blocksize = + util_format_get_blocksize(scene->zsbuf_transfer->texture->format); } + lp_scene_bin_iter_begin( scene ); + return TRUE; - -fail: - /* Unmap and release transfers? - */ - return FALSE; } -/** - * Finish the rasterization phase. - * Unmap framebuffer surfaces. - */ static void lp_rast_end( struct lp_rasterizer *rast ) { - struct pipe_screen *screen = rast->screen; - unsigned i; - - for (i = 0; i < rast->state.fb.nr_cbufs; i++) { - if (rast->cbuf_map[i]) - screen->transfer_unmap(screen, rast->cbuf_transfer[i]); - - if (rast->cbuf_transfer[i]) - screen->tex_transfer_destroy(rast->cbuf_transfer[i]); - - rast->cbuf_transfer[i] = NULL; - rast->cbuf_map[i] = NULL; - } + int i; - if (rast->zsbuf_map) - screen->transfer_unmap(screen, rast->zsbuf_transfer); + lp_scene_reset( rast->curr_scene ); - if (rast->zsbuf_transfer) - screen->tex_transfer_destroy(rast->zsbuf_transfer); + for (i = 0; i < rast->state.nr_cbufs; i++) + rast->cbuf[i].map = NULL; - rast->zsbuf_transfer = NULL; - rast->zsbuf_map = NULL; + rast->zsbuf.map = NULL; + rast->curr_scene = NULL; } - /** * Begining rasterization of a tile. * \param x window X position of the tile, in pixels @@ -189,7 +135,7 @@ lp_rast_clear_color(struct lp_rasterizer_task *task, clear_color[1] == clear_color[2] && clear_color[2] == clear_color[3]) { /* clear to grayscale value {x, x, x, x} */ - for (i = 0; i < rast->state.fb.nr_cbufs; i++) { + for (i = 0; i < rast->state.nr_cbufs; i++) { memset(color_tile[i], clear_color[0], TILE_SIZE * TILE_SIZE * 4); } } @@ -200,7 +146,7 @@ lp_rast_clear_color(struct lp_rasterizer_task *task, * works. */ const unsigned chunk = TILE_SIZE / 4; - for (i = 0; i < rast->state.fb.nr_cbufs; i++) { + for (i = 0; i < rast->state.nr_cbufs; i++) { uint8_t *c = color_tile[i]; unsigned j; for (j = 0; j < 4 * TILE_SIZE; j++) { @@ -232,17 +178,17 @@ lp_rast_clear_zstencil(struct lp_rasterizer_task *task, struct lp_rasterizer *rast = task->rast; const unsigned tile_x = task->x; const unsigned tile_y = task->y; - const unsigned height = TILE_SIZE/TILE_VECTOR_HEIGHT; - const unsigned width = TILE_SIZE*TILE_VECTOR_HEIGHT; - unsigned block_size = util_format_get_blocksize(rast->zsbuf_transfer->texture->format); + const unsigned height = TILE_SIZE / TILE_VECTOR_HEIGHT; + const unsigned width = TILE_SIZE * TILE_VECTOR_HEIGHT; + unsigned block_size = rast->zsbuf.blocksize; uint8_t *dst; - unsigned dst_stride = rast->zsbuf_transfer->stride*TILE_VECTOR_HEIGHT; + unsigned dst_stride = rast->zsbuf.stride * TILE_VECTOR_HEIGHT; unsigned i, j; LP_DBG(DEBUG_RAST, "%s 0x%x\n", __FUNCTION__, arg.clear_zstencil); - assert(rast->zsbuf_map); - if (!rast->zsbuf_map) + assert(rast->zsbuf.map); + if (!rast->zsbuf.map) return; LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); @@ -278,8 +224,8 @@ lp_rast_clear_zstencil(struct lp_rasterizer_task *task, } break; default: - assert(0); - break; + assert(0); + break; } } @@ -298,25 +244,16 @@ lp_rast_load_color(struct lp_rasterizer_task *task, LP_DBG(DEBUG_RAST, "%s at %u, %u\n", __FUNCTION__, x, y); - for (i = 0; i < rast->state.fb.nr_cbufs; i++) { - struct pipe_transfer *transfer = rast->cbuf_transfer[i]; - int w = TILE_SIZE; - int h = TILE_SIZE; - - if (x >= transfer->width || y >= transfer->height) + for (i = 0; i < rast->state.nr_cbufs; i++) { + if (x >= rast->cbuf[i].width || y >= rast->cbuf[i].height) continue; - assert(w >= 0); - assert(h >= 0); - assert(w <= TILE_SIZE); - assert(h <= TILE_SIZE); - - lp_tile_read_4ub(transfer->texture->format, + lp_tile_read_4ub(rast->cbuf[i].format, task->tile.color[i], - rast->cbuf_map[i], - transfer->stride, + rast->cbuf[i].map, + rast->cbuf[i].stride, x, y, - w, h); + TILE_SIZE, TILE_SIZE); LP_COUNT(nr_color_tile_load); } @@ -366,7 +303,7 @@ lp_rast_shade_tile(struct lp_rasterizer_task *task, block_offset = ((y / 4) * (16 * 16) + (x / 4) * 16); /* color buffer */ - for (i = 0; i < rast->state.fb.nr_cbufs; i++) + for (i = 0; i < rast->state.nr_cbufs; i++) color[i] = tile->color[i] + 4 * block_offset; /* depth buffer */ @@ -423,7 +360,7 @@ void lp_rast_shade_quads( struct lp_rasterizer_task *task, block_offset = ((iy / 4) * (16 * 16) + (ix / 4) * 16); /* color buffer */ - for (i = 0; i < rast->state.fb.nr_cbufs; i++) + for (i = 0; i < rast->state.nr_cbufs; i++) color[i] = tile->color[i] + 4 * block_offset; /* depth buffer */ @@ -516,51 +453,33 @@ lp_rast_store_color(struct lp_rasterizer_task *task) const unsigned x = task->x, y = task->y; unsigned i; - for (i = 0; i < rast->state.fb.nr_cbufs; i++) { - struct pipe_transfer *transfer = rast->cbuf_transfer[i]; - int w = TILE_SIZE; - int h = TILE_SIZE; - - if (x >= transfer->width) + for (i = 0; i < rast->state.nr_cbufs; i++) { + if (x >= rast->cbuf[i].width) continue; - if (y >= transfer->height) + if (y >= rast->cbuf[i].height) continue; - LP_DBG(DEBUG_RAST, "%s [%u] %d,%d %dx%d\n", __FUNCTION__, - task->thread_index, x, y, w, h); + LP_DBG(DEBUG_RAST, "%s [%u] %d,%d\n", __FUNCTION__, + task->thread_index, x, y); if (LP_DEBUG & DEBUG_SHOW_SUBTILES) outline_subtiles(task->tile.color[i]); else if (LP_DEBUG & DEBUG_SHOW_TILES) outline_tile(task->tile.color[i]); - lp_tile_write_4ub(transfer->texture->format, + lp_tile_write_4ub(rast->cbuf[i].format, task->tile.color[i], - rast->cbuf_map[i], - transfer->stride, + rast->cbuf[i].map, + rast->cbuf[i].stride, x, y, - w, h); + TILE_SIZE, TILE_SIZE); LP_COUNT(nr_color_tile_store); } } -/** - * Write the rasterizer's tiles to the framebuffer. - */ -static void -lp_rast_end_tile(struct lp_rasterizer_task *task) -{ - struct lp_rasterizer *rast = task->rast; - - LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); - - if (rast->state.write_color) - lp_rast_store_color(task); -} - /** * Signal on a fence. This is called during bin execution/rasterization. @@ -586,23 +505,6 @@ lp_rast_fence(struct lp_rasterizer_task *task, } -/** - * When all the threads are done rasterizing a scene, one thread will - * call this function to reset the scene and put it onto the empty queue. - */ -static void -release_scene( struct lp_rasterizer *rast, - struct lp_scene *scene ) -{ - util_unreference_framebuffer_state( &scene->fb ); - - lp_scene_reset( scene ); - - assert(lp_scene_is_empty(scene)); - - lp_scene_enqueue( rast->empty_scenes, scene ); - rast->curr_scene = NULL; -} /** @@ -620,7 +522,7 @@ rasterize_bin(struct lp_rasterizer_task *task, struct cmd_block *block; unsigned k; - lp_rast_start_tile( task, x, y ); + lp_rast_start_tile( task, x * TILE_SIZE, y * TILE_SIZE ); /* simply execute each of the commands in the block list */ for (block = commands->head; block; block = block->next) { @@ -629,7 +531,14 @@ rasterize_bin(struct lp_rasterizer_task *task, } } - lp_rast_end_tile( task ); + /* Write the rasterizer's tiles to the framebuffer. + */ + if (task->rast->state.write_color) + lp_rast_store_color(task); + + /* Free data for this bin. + */ + lp_scene_bin_reset( task->rast->curr_scene, x, y); } @@ -714,8 +623,7 @@ is_empty_bin( const struct cmd_bin *bin ) */ static void rasterize_scene(struct lp_rasterizer_task *task, - struct lp_scene *scene, - bool write_depth) + struct lp_scene *scene) { /* loop over scene bins, rasterize each */ #if 0 @@ -724,7 +632,7 @@ rasterize_scene(struct lp_rasterizer_task *task, for (i = 0; i < scene->tiles_x; i++) { for (j = 0; j < scene->tiles_y; j++) { struct cmd_bin *bin = lp_scene_get_bin(scene, i, j); - rasterize_bin(task, bin, i * TILE_SIZE, j * TILE_SIZE); + rasterize_bin(task, bin, i, j); } } } @@ -736,7 +644,7 @@ rasterize_scene(struct lp_rasterizer_task *task, assert(scene); while ((bin = lp_scene_bin_iter_next(scene, &x, &y))) { if (!is_empty_bin( bin )) - rasterize_bin(task, bin, x * TILE_SIZE, y * TILE_SIZE); + rasterize_bin(task, bin, x, y); } } #endif @@ -747,44 +655,20 @@ rasterize_scene(struct lp_rasterizer_task *task, * Called by setup module when it has something for us to render. */ void -lp_rasterize_scene( struct lp_rasterizer *rast, - struct lp_scene *scene, - const struct pipe_framebuffer_state *fb, - bool write_depth ) +lp_rast_queue_scene( struct lp_rasterizer *rast, + struct lp_scene *scene) { - boolean debug = false; - LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); - if (debug) { - unsigned x, y; - debug_printf("rasterize scene:\n"); - debug_printf(" data size: %u\n", lp_scene_data_size(scene)); - for (y = 0; y < scene->tiles_y; y++) { - for (x = 0; x < scene->tiles_x; x++) { - debug_printf(" bin %u, %u size: %u\n", x, y, - lp_scene_bin_size(scene, x, y)); - } - } - } - - /* save framebuffer state in the bin */ - util_copy_framebuffer_state(&scene->fb, fb); - scene->write_depth = write_depth; - if (rast->num_threads == 0) { /* no threading */ - lp_rast_begin( rast, fb, - fb->nr_cbufs != 0, /* always write color if cbufs present */ - fb->zsbuf != NULL && write_depth ); + lp_rast_begin( rast, scene ); - lp_scene_bin_iter_begin( scene ); - rasterize_scene( &rast->tasks[0], scene, write_depth ); + rasterize_scene( &rast->tasks[0], scene ); - release_scene( rast, scene ); - - lp_rast_end( rast ); + lp_scene_reset( scene ); + rast->curr_scene = NULL; } else { /* threaded rendering! */ @@ -796,14 +680,26 @@ lp_rasterize_scene( struct lp_rasterizer *rast, for (i = 0; i < rast->num_threads; i++) { pipe_semaphore_signal(&rast->tasks[i].work_ready); } + } + + LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__); +} + + +void +lp_rast_finish( struct lp_rasterizer *rast ) +{ + if (rast->num_threads == 0) { + /* nothing to do */ + } + else { + int i; /* wait for work to complete */ for (i = 0; i < rast->num_threads; i++) { pipe_semaphore_wait(&rast->tasks[i].work_done); } } - - LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__); } @@ -834,19 +730,8 @@ static PIPE_THREAD_ROUTINE( thread_func, init_data ) * - get next scene to rasterize * - map the framebuffer surfaces */ - const struct pipe_framebuffer_state *fb; - boolean write_depth; - - rast->curr_scene = lp_scene_dequeue( rast->full_scenes, TRUE ); - - lp_scene_bin_iter_begin( rast->curr_scene ); - - fb = &rast->curr_scene->fb; - write_depth = rast->curr_scene->write_depth; - - lp_rast_begin( rast, fb, - fb->nr_cbufs != 0, - fb->zsbuf != NULL && write_depth ); + lp_rast_begin( rast, + lp_scene_dequeue( rast->full_scenes, TRUE ) ); } /* Wait for all threads to get here so that threads[1+] don't @@ -857,25 +742,23 @@ static PIPE_THREAD_ROUTINE( thread_func, init_data ) /* do work */ if (debug) debug_printf("thread %d doing work\n", task->thread_index); + rasterize_scene(task, - rast->curr_scene, - rast->curr_scene->write_depth); + rast->curr_scene); /* wait for all threads to finish with this scene */ pipe_barrier_wait( &rast->barrier ); + /* XXX: shouldn't be necessary: + */ if (task->thread_index == 0) { - /* thread[0]: - * - release the scene object - * - unmap the framebuffer surfaces - */ - release_scene( rast, rast->curr_scene ); lp_rast_end( rast ); } /* signal done with work */ if (debug) debug_printf("thread %d done working\n", task->thread_index); + pipe_semaphore_signal(&task->work_done); } @@ -918,7 +801,7 @@ create_rast_threads(struct lp_rasterizer *rast) * processing them. */ struct lp_rasterizer * -lp_rast_create( struct pipe_screen *screen, struct lp_scene_queue *empty ) +lp_rast_create( void ) { struct lp_rasterizer *rast; unsigned i, cbuf; @@ -927,9 +810,6 @@ lp_rast_create( struct pipe_screen *screen, struct lp_scene_queue *empty ) if(!rast) return NULL; - rast->screen = screen; - - rast->empty_scenes = empty; rast->full_scenes = lp_scene_queue_create(); for (i = 0; i < Elements(rast->tasks); i++) { @@ -957,8 +837,6 @@ void lp_rast_destroy( struct lp_rasterizer *rast ) { unsigned i, cbuf; - util_unreference_framebuffer_state(&rast->state.fb); - for (i = 0; i < Elements(rast->tasks); i++) { for (cbuf = 0; cbuf < PIPE_MAX_COLOR_BUFS; cbuf++ ) align_free(rast->tasks[i].tile.color[cbuf]); diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h index 1ed2700191..d91c45eb2b 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.h +++ b/src/gallium/drivers/llvmpipe/lp_rast.h @@ -43,10 +43,8 @@ struct lp_rasterizer; struct lp_scene; -struct lp_scene_queue; struct lp_fence; struct cmd_bin; -struct pipe_screen; /** For sub-pixel positioning */ #define FIXED_ORDER 4 @@ -129,18 +127,21 @@ struct lp_rast_triangle { -struct lp_rasterizer *lp_rast_create( struct pipe_screen *screen, - struct lp_scene_queue *empty ); +struct lp_rasterizer * +lp_rast_create( void ); -void lp_rast_destroy( struct lp_rasterizer * ); +void +lp_rast_destroy( struct lp_rasterizer * ); -unsigned lp_rast_get_num_threads( struct lp_rasterizer * ); +unsigned +lp_rast_get_num_threads( struct lp_rasterizer * ); -void lp_rasterize_scene( struct lp_rasterizer *rast, - struct lp_scene *scene, - const struct pipe_framebuffer_state *fb, - bool write_depth ); +void +lp_rast_queue_scene( struct lp_rasterizer *rast, + struct lp_scene *scene ); +void +lp_rast_finish( struct lp_rasterizer *rast ); union lp_rast_cmd_arg { diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h index abc5a9ad89..39bf2c2587 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h @@ -38,8 +38,6 @@ #define MAX_THREADS 8 /* XXX probably temporary here */ -struct pipe_transfer; -struct pipe_screen; struct lp_rasterizer; @@ -82,20 +80,26 @@ struct lp_rasterizer_task */ struct lp_rasterizer { - boolean clipped_tile; - boolean check_for_clipped_tiles; boolean exit_flag; /* Framebuffer stuff */ - struct pipe_screen *screen; - struct pipe_transfer *cbuf_transfer[PIPE_MAX_COLOR_BUFS]; - struct pipe_transfer *zsbuf_transfer; - void *cbuf_map[PIPE_MAX_COLOR_BUFS]; - uint8_t *zsbuf_map; + struct { + void *map; + unsigned stride; + unsigned width; + unsigned height; + enum pipe_format format; + } cbuf[PIPE_MAX_COLOR_BUFS]; + + struct { + uint8_t *map; + unsigned stride; + unsigned blocksize; + } zsbuf; struct { - struct pipe_framebuffer_state fb; + unsigned nr_cbufs; boolean write_color; boolean write_zstencil; unsigned clear_color; @@ -105,7 +109,14 @@ struct lp_rasterizer /** The incoming queue of scenes ready to rasterize */ struct lp_scene_queue *full_scenes; - /** The outgoing queue of processed scenes to return to setup modulee */ + + /** + * The outgoing queue of processed scenes to return to setup module + * + * XXX: while scenes are per-context but the rasterizer is + * (potentially) shared, these empty scenes should be returned to + * the context which created them rather than retained here. + */ struct lp_scene_queue *empty_scenes; /** The scene currently being rasterized by the threads */ @@ -137,17 +148,18 @@ lp_rast_depth_pointer( struct lp_rasterizer *rast, unsigned x, unsigned y ) { void * depth; + assert((x % TILE_VECTOR_WIDTH) == 0); assert((y % TILE_VECTOR_HEIGHT) == 0); - if(!rast->zsbuf_map) + + if (!rast->zsbuf.map) return NULL; - assert(rast->zsbuf_transfer); - depth = rast->zsbuf_map + - y*rast->zsbuf_transfer->stride + - TILE_VECTOR_HEIGHT*x*util_format_get_blocksize(rast->zsbuf_transfer->texture->format); -#ifdef DEBUG + + depth = (rast->zsbuf.map + + rast->zsbuf.stride * y + + rast->zsbuf.blocksize * x * TILE_VECTOR_HEIGHT); + assert(lp_check_alignment(depth, 16)); -#endif return depth; } @@ -175,7 +187,7 @@ lp_rast_shade_quads_all( struct lp_rasterizer_task *task, block_offset = (iy / 4) * (16 * 16) + (ix / 4) * 16; /* color buffer */ - for (i = 0; i < rast->state.fb.nr_cbufs; i++) + for (i = 0; i < rast->state.nr_cbufs; i++) color[i] = tile->color[i] + 4 * block_offset; depth = lp_rast_depth_pointer(rast, x, y); diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c index cba0e21298..72492c0f0c 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.c +++ b/src/gallium/drivers/llvmpipe/lp_scene.c @@ -29,44 +29,67 @@ #include "util/u_memory.h" #include "util/u_inlines.h" #include "util/u_simple_list.h" +#include "util/u_surface.h" #include "lp_scene.h" +#include "lp_scene_queue.h" +#include "lp_debug.h" struct lp_scene * -lp_scene_create(void) +lp_scene_create( struct pipe_context *pipe, + struct lp_scene_queue *queue ) { + unsigned i, j; struct lp_scene *scene = CALLOC_STRUCT(lp_scene); - if (scene) - lp_scene_init(scene); + if (!scene) + return NULL; + + scene->pipe = pipe; + scene->empty_queue = queue; + + for (i = 0; i < TILES_X; i++) { + for (j = 0; j < TILES_Y; j++) { + struct cmd_bin *bin = lp_scene_get_bin(scene, i, j); + bin->commands.head = bin->commands.tail = CALLOC_STRUCT(cmd_block); + } + } + + scene->data.head = + scene->data.tail = CALLOC_STRUCT(data_block); + + make_empty_list(&scene->textures); + + pipe_mutex_init(scene->mutex); + return scene; } +/** + * Free all data associated with the given scene, and free(scene). + */ void lp_scene_destroy(struct lp_scene *scene) { - lp_scene_reset(scene); - lp_scene_free_bin_data(scene); - FREE(scene); -} + unsigned i, j; + lp_scene_reset(scene); -void -lp_scene_init(struct lp_scene *scene) -{ - unsigned i, j; for (i = 0; i < TILES_X; i++) for (j = 0; j < TILES_Y; j++) { struct cmd_bin *bin = lp_scene_get_bin(scene, i, j); - bin->commands.head = bin->commands.tail = CALLOC_STRUCT(cmd_block); + assert(bin->commands.head == bin->commands.tail); + FREE(bin->commands.head); + bin->commands.head = NULL; + bin->commands.tail = NULL; } - scene->data.head = - scene->data.tail = CALLOC_STRUCT(data_block); + FREE(scene->data.head); + scene->data.head = NULL; - make_empty_list(&scene->textures); + pipe_mutex_destroy(scene->mutex); - pipe_mutex_init(scene->mutex); + FREE(scene); } @@ -92,6 +115,9 @@ lp_scene_is_empty(struct lp_scene *scene ) } +/* Free data for one particular bin. May be called from the + * rasterizer thread(s). + */ void lp_scene_bin_reset(struct lp_scene *scene, unsigned x, unsigned y) { @@ -115,7 +141,8 @@ lp_scene_bin_reset(struct lp_scene *scene, unsigned x, unsigned y) /** - * Set scene to empty state. + * Free all the temporary data in a scene. May be called from the + * rasterizer thread(s). */ void lp_scene_reset(struct lp_scene *scene ) @@ -162,40 +189,8 @@ lp_scene_reset(struct lp_scene *scene ) } -/** - * Free all data associated with the given bin, but don't free(scene). - */ -void -lp_scene_free_bin_data(struct lp_scene *scene) -{ - unsigned i, j; - - for (i = 0; i < TILES_X; i++) - for (j = 0; j < TILES_Y; j++) { - struct cmd_bin *bin = lp_scene_get_bin(scene, i, j); - /* lp_reset_scene() should have been already called */ - assert(bin->commands.head == bin->commands.tail); - FREE(bin->commands.head); - bin->commands.head = NULL; - bin->commands.tail = NULL; - } - - FREE(scene->data.head); - scene->data.head = NULL; - - pipe_mutex_destroy(scene->mutex); -} - -void -lp_scene_set_framebuffer_size( struct lp_scene *scene, - unsigned width, unsigned height ) -{ - assert(lp_scene_is_empty(scene)); - scene->tiles_x = align(width, TILE_SIZE) / TILE_SIZE; - scene->tiles_y = align(height, TILE_SIZE) / TILE_SIZE; -} void @@ -393,3 +388,158 @@ end: pipe_mutex_unlock(scene->mutex); return bin; } + + +/** + * Prepare this scene for the rasterizer. + * Map the framebuffer surfaces. Initialize the 'rast' state. + */ +static boolean +lp_scene_map_buffers( struct lp_scene *scene ) +{ + struct pipe_screen *screen = scene->pipe->screen; + struct pipe_surface *cbuf, *zsbuf; + int i; + + LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); + + + /* Map all color buffers + */ + for (i = 0; i < scene->fb.nr_cbufs; i++) { + cbuf = scene->fb.cbufs[i]; + if (cbuf) { + scene->cbuf_transfer[i] = screen->get_tex_transfer(screen, + cbuf->texture, + cbuf->face, + cbuf->level, + cbuf->zslice, + PIPE_TRANSFER_READ_WRITE, + 0, 0, + cbuf->width, + cbuf->height); + if (!scene->cbuf_transfer[i]) + goto fail; + + scene->cbuf_map[i] = screen->transfer_map(screen, + scene->cbuf_transfer[i]); + if (!scene->cbuf_map[i]) + goto fail; + } + } + + /* Map the zsbuffer + */ + zsbuf = scene->fb.zsbuf; + if (zsbuf) { + scene->zsbuf_transfer = screen->get_tex_transfer(screen, + zsbuf->texture, + zsbuf->face, + zsbuf->level, + zsbuf->zslice, + PIPE_TRANSFER_READ_WRITE, + 0, 0, + zsbuf->width, + zsbuf->height); + if (!scene->zsbuf_transfer) + goto fail; + + scene->zsbuf_map = screen->transfer_map(screen, + scene->zsbuf_transfer); + if (!scene->zsbuf_map) + goto fail; + } + + return TRUE; + +fail: + /* Unmap and release transfers? + */ + return FALSE; +} + + + +/** + * Called after rasterizer as finished rasterizing a scene. + * + * We want to call this from the pipe_context's current thread to + * avoid having to have mutexes on the transfer functions. + */ +static void +lp_scene_unmap_buffers( struct lp_scene *scene ) +{ + struct pipe_screen *screen = scene->pipe->screen; + unsigned i; + + for (i = 0; i < scene->fb.nr_cbufs; i++) { + if (scene->cbuf_map[i]) + screen->transfer_unmap(screen, scene->cbuf_transfer[i]); + + if (scene->cbuf_transfer[i]) + screen->tex_transfer_destroy(scene->cbuf_transfer[i]); + + scene->cbuf_transfer[i] = NULL; + scene->cbuf_map[i] = NULL; + } + + if (scene->zsbuf_map) + screen->transfer_unmap(screen, scene->zsbuf_transfer); + + if (scene->zsbuf_transfer) + screen->tex_transfer_destroy(scene->zsbuf_transfer); + + scene->zsbuf_transfer = NULL; + scene->zsbuf_map = NULL; + + util_unreference_framebuffer_state( &scene->fb ); +} + + +void lp_scene_begin_binning( struct lp_scene *scene, + struct pipe_framebuffer_state *fb ) +{ + assert(lp_scene_is_empty(scene)); + + util_copy_framebuffer_state(&scene->fb, fb); + + scene->tiles_x = align(fb->width, TILE_SIZE) / TILE_SIZE; + scene->tiles_y = align(fb->height, TILE_SIZE) / TILE_SIZE; +} + + +void lp_scene_rasterize( struct lp_scene *scene, + struct lp_rasterizer *rast, + boolean write_depth ) +{ + if (0) { + unsigned x, y; + debug_printf("rasterize scene:\n"); + debug_printf(" data size: %u\n", lp_scene_data_size(scene)); + for (y = 0; y < scene->tiles_y; y++) { + for (x = 0; x < scene->tiles_x; x++) { + debug_printf(" bin %u, %u size: %u\n", x, y, + lp_scene_bin_size(scene, x, y)); + } + } + } + + + scene->write_depth = (scene->fb.zsbuf != NULL && + write_depth); + + lp_scene_map_buffers( scene ); + + /* Enqueue the scene for rasterization, then immediately wait for + * it to finish. + */ + lp_rast_queue_scene( rast, scene ); + + /* Currently just wait for the rasterizer to finish. Some + * threading interactions need to be worked out, particularly once + * transfers become per-context: + */ + lp_rast_finish( rast ); + lp_scene_unmap_buffers( scene ); + lp_scene_enqueue( scene->empty_queue, scene ); +} diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h index 8d725cd437..739ac22908 100644 --- a/src/gallium/drivers/llvmpipe/lp_scene.h +++ b/src/gallium/drivers/llvmpipe/lp_scene.h @@ -39,6 +39,7 @@ #include "lp_tile_soa.h" #include "lp_rast.h" +struct lp_scene_queue; /* We're limited to 2K by 2K for 32bit fixed point rasterization. * Will need a 64-bit version for larger framebuffers. @@ -112,8 +113,14 @@ struct texture_ref { * scenes: */ struct lp_scene { - struct cmd_bin tile[TILES_X][TILES_Y]; - struct data_block_list data; + struct pipe_context *pipe; + struct pipe_transfer *cbuf_transfer[PIPE_MAX_COLOR_BUFS]; + struct pipe_transfer *zsbuf_transfer; + + /* Scene's buffers are mapped at the time the scene is enqueued: + */ + void *cbuf_map[PIPE_MAX_COLOR_BUFS]; + uint8_t *zsbuf_map; /** the framebuffer to render the scene into */ struct pipe_framebuffer_state fb; @@ -131,25 +138,28 @@ struct lp_scene { int curr_x, curr_y; /**< for iterating over bins */ pipe_mutex mutex; + + /* Where to place this scene once it has been rasterized: + */ + struct lp_scene_queue *empty_queue; + + struct cmd_bin tile[TILES_X][TILES_Y]; + struct data_block_list data; }; -struct lp_scene *lp_scene_create(void); +struct lp_scene *lp_scene_create(struct pipe_context *pipe, + struct lp_scene_queue *empty_queue); void lp_scene_destroy(struct lp_scene *scene); -void lp_scene_init(struct lp_scene *scene); boolean lp_scene_is_empty(struct lp_scene *scene ); void lp_scene_reset(struct lp_scene *scene ); -void lp_scene_free_bin_data(struct lp_scene *scene); - -void lp_scene_set_framebuffer_size( struct lp_scene *scene, - unsigned width, unsigned height ); void lp_bin_new_data_block( struct data_block_list *list ); @@ -296,5 +306,13 @@ lp_scene_bin_iter_begin( struct lp_scene *scene ); struct cmd_bin * lp_scene_bin_iter_next( struct lp_scene *scene, int *bin_x, int *bin_y ); +void +lp_scene_rasterize( struct lp_scene *scene, + struct lp_rasterizer *rast, + boolean write_depth ); + +void +lp_scene_begin_binning( struct lp_scene *scene, + struct pipe_framebuffer_state *fb ); #endif /* LP_BIN_H */ diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 3aec9de373..aebed85fbb 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -66,11 +66,8 @@ lp_setup_get_current_scene(struct setup_context *setup) assert(lp_scene_is_empty(setup->scene)); - if(0)lp_scene_reset( setup->scene ); /* XXX temporary? */ - - lp_scene_set_framebuffer_size(setup->scene, - setup->fb.width, - setup->fb.height); + lp_scene_begin_binning(setup->scene, + &setup->fb ); } return setup->scene; } @@ -135,13 +132,12 @@ static void reset_context( struct setup_context *setup ) /** Rasterize all scene's bins */ static void lp_setup_rasterize_scene( struct setup_context *setup, - boolean write_depth ) + boolean write_depth ) { struct lp_scene *scene = lp_setup_get_current_scene(setup); - lp_rasterize_scene(setup->rast, - scene, - &setup->fb, + lp_scene_rasterize(scene, + setup->rast, write_depth); reset_context( setup ); @@ -246,19 +242,16 @@ void lp_setup_bind_framebuffer( struct setup_context *setup, const struct pipe_framebuffer_state *fb ) { - struct lp_scene *scene = lp_setup_get_current_scene(setup); - LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); + /* Flush any old scene. + */ set_scene_state( setup, SETUP_FLUSHED ); - /* re-get scene pointer, may have a new scene after flushing */ - (void) scene; - scene = lp_setup_get_current_scene(setup); - + /* Set new state. This will be picked up later when we next need a + * scene. + */ util_copy_framebuffer_state(&setup->fb, fb); - - lp_scene_set_framebuffer_size(scene, setup->fb.width, setup->fb.height); } @@ -683,7 +676,7 @@ lp_setup_destroy( struct setup_context *setup ) * it. */ struct setup_context * -lp_setup_create( struct pipe_screen *screen, +lp_setup_create( struct pipe_context *pipe, struct draw_context *draw ) { unsigned i; @@ -698,7 +691,9 @@ lp_setup_create( struct pipe_screen *screen, if (!setup->empty_scenes) goto fail; - setup->rast = lp_rast_create( screen, setup->empty_scenes ); + /* XXX: move this to the screen and share between contexts: + */ + setup->rast = lp_rast_create(); if (!setup->rast) goto fail; @@ -711,7 +706,8 @@ lp_setup_create( struct pipe_screen *screen, /* create some empty scenes */ for (i = 0; i < MAX_SCENES; i++) { - setup->scenes[i] = lp_scene_create(); + setup->scenes[i] = lp_scene_create( pipe, setup->empty_scenes ); + lp_scene_enqueue(setup->empty_scenes, setup->scenes[i]); } diff --git a/src/gallium/drivers/llvmpipe/lp_setup.h b/src/gallium/drivers/llvmpipe/lp_setup.h index 0e155a7dc3..17c112b528 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.h +++ b/src/gallium/drivers/llvmpipe/lp_setup.h @@ -62,7 +62,7 @@ struct lp_fragment_shader; struct lp_jit_context; struct setup_context * -lp_setup_create( struct pipe_screen *screen, +lp_setup_create( struct pipe_context *pipe, struct draw_context *draw ); void -- cgit v1.2.3 From 0c616da24114a22e7a6ad6e333cf4e836a91e95f Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Mar 2010 15:02:29 +0000 Subject: llvmpipe: remove some ifdefs No longer any need to protect expensive asserts with #ifdef DEBUG. --- src/gallium/drivers/llvmpipe/lp_rast.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index dd77bb30d1..0f83eea685 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -342,7 +342,6 @@ void lp_rast_shade_quads( struct lp_rasterizer_task *task, unsigned ix, iy; int block_offset; -#ifdef DEBUG assert(state); /* Sanity checks */ @@ -351,7 +350,6 @@ void lp_rast_shade_quads( struct lp_rasterizer_task *task, assert((x % 4) == 0); assert((y % 4) == 0); -#endif ix = x % TILE_SIZE; iy = y % TILE_SIZE; @@ -367,15 +365,12 @@ void lp_rast_shade_quads( struct lp_rasterizer_task *task, depth = lp_rast_depth_pointer(rast, x, y); - -#ifdef DEBUG assert(lp_check_alignment(tile->color[0], 16)); assert(lp_check_alignment(state->jit_context.blend_color, 16)); assert(lp_check_alignment(inputs->step[0], 16)); assert(lp_check_alignment(inputs->step[1], 16)); assert(lp_check_alignment(inputs->step[2], 16)); -#endif /* run shader */ state->jit_function[1]( &state->jit_context, -- cgit v1.2.3 From faf8215bae70f020420242dc812ef141fdcf5417 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 2 Mar 2010 10:18:29 -0500 Subject: llvmpipe: improve based on review from Jose and fix else clauses else was broken in the outter most else statemants, plus the code didn't need an inverted mask to compute the inverse of the current condition. --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 81b0ab760e..ae866243a9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -96,8 +96,6 @@ struct lp_exec_mask { LLVMValueRef cond_mask; LLVMValueRef exec_mask; - - LLVMValueRef inv_mask; }; struct lp_build_tgsi_soa_context @@ -149,9 +147,6 @@ static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context mask->cond_stack_size = 0; mask->int_vec_type = lp_build_int_vec_type(mask->bld->type); - mask->inv_mask = - LLVMConstSub(LLVMConstNull(mask->int_vec_type), - LLVMConstAllOnes(mask->int_vec_type)); } static void lp_exec_mask_update(struct lp_exec_mask *mask) @@ -174,9 +169,15 @@ static void lp_exec_mask_cond_push(struct lp_exec_mask *mask, static void lp_exec_mask_cond_invert(struct lp_exec_mask *mask) { LLVMValueRef prev_mask = mask->cond_stack[mask->cond_stack_size - 1]; - LLVMValueRef inv_mask = LLVMBuildXor(mask->bld->builder, - mask->cond_mask, - mask->inv_mask, ""); + LLVMValueRef inv_mask = LLVMBuildNot(mask->bld->builder, + mask->cond_mask, ""); + + /* means that we didn't have any mask before and that + * we were fully enabled */ + if (mask->cond_stack_size <= 1) { + prev_mask = LLVMConstAllOnes(mask->int_vec_type); + } + mask->cond_mask = LLVMBuildAnd(mask->bld->builder, inv_mask, prev_mask, ""); -- cgit v1.2.3 From aaa2d548ed46636f6558494dc035f40bff445deb Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 2 Mar 2010 17:26:40 +0000 Subject: nouveau: Rename pipe formats. These format uses were being hiden by pre-processor magic and were missed in the previous search'n'replace. --- src/gallium/drivers/nv30/nv30_fragtex.c | 14 +++++++------- src/gallium/drivers/nv40/nv40_fragtex.c | 14 +++++++------- src/gallium/drivers/nv50/nv50_state_validate.c | 10 +++++----- src/gallium/drivers/nv50/nv50_tex.c | 20 ++++++++++---------- 4 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_fragtex.c b/src/gallium/drivers/nv30/nv30_fragtex.c index 9f4a104f67..f7d98f3f20 100644 --- a/src/gallium/drivers/nv30/nv30_fragtex.c +++ b/src/gallium/drivers/nv30/nv30_fragtex.c @@ -23,17 +23,17 @@ struct nv30_texture_format { static struct nv30_texture_format nv30_texture_formats[] = { - _(X8R8G8B8_UNORM, A8R8G8B8, S1, S1, S1, ONE, X, Y, Z, W), - _(A8R8G8B8_UNORM, A8R8G8B8, S1, S1, S1, S1, X, Y, Z, W), - _(A1R5G5B5_UNORM, A1R5G5B5, S1, S1, S1, S1, X, Y, Z, W), - _(A4R4G4B4_UNORM, A4R4G4B4, S1, S1, S1, S1, X, Y, Z, W), - _(R5G6B5_UNORM , R5G6B5 , S1, S1, S1, ONE, X, Y, Z, W), + _(B8G8R8X8_UNORM, A8R8G8B8, S1, S1, S1, ONE, X, Y, Z, W), + _(B8G8R8A8_UNORM, A8R8G8B8, S1, S1, S1, S1, X, Y, Z, W), + _(B5G5R5A1_UNORM, A1R5G5B5, S1, S1, S1, S1, X, Y, Z, W), + _(B4G4R4A4_UNORM, A4R4G4B4, S1, S1, S1, S1, X, Y, Z, W), + _(B5G6R5_UNORM , R5G6B5 , S1, S1, S1, ONE, X, Y, Z, W), _(L8_UNORM , L8 , S1, S1, S1, ONE, X, X, X, X), _(A8_UNORM , L8 , ZERO, ZERO, ZERO, S1, X, X, X, X), _(I8_UNORM , L8 , S1, S1, S1, S1, X, X, X, X), - _(A8L8_UNORM , A8L8 , S1, S1, S1, S1, X, X, X, Y), + _(L8A8_UNORM , A8L8 , S1, S1, S1, S1, X, X, X, Y), _(Z16_UNORM , R5G6B5 , S1, S1, S1, ONE, X, X, X, X), - _(Z24S8_UNORM , A8R8G8B8, S1, S1, S1, ONE, X, X, X, X), + _(S8Z24_UNORM , A8R8G8B8, S1, S1, S1, ONE, X, X, X, X), _(DXT1_RGB , DXT1 , S1, S1, S1, ONE, X, Y, Z, W), _(DXT1_RGBA , DXT1 , S1, S1, S1, S1, X, Y, Z, W), _(DXT3_RGBA , DXT3 , S1, S1, S1, S1, X, Y, Z, W), diff --git a/src/gallium/drivers/nv40/nv40_fragtex.c b/src/gallium/drivers/nv40/nv40_fragtex.c index 7a28d577b1..b60118922a 100644 --- a/src/gallium/drivers/nv40/nv40_fragtex.c +++ b/src/gallium/drivers/nv40/nv40_fragtex.c @@ -25,18 +25,18 @@ struct nv40_texture_format { static struct nv40_texture_format nv40_texture_formats[] = { - _(X8R8G8B8_UNORM, A8R8G8B8, S1, S1, S1, ONE, X, Y, Z, W, 0, 0, 0, 0), - _(A8R8G8B8_UNORM, A8R8G8B8, S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), - _(A1R5G5B5_UNORM, A1R5G5B5, S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), - _(A4R4G4B4_UNORM, A4R4G4B4, S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), - _(R5G6B5_UNORM , R5G6B5 , S1, S1, S1, ONE, X, Y, Z, W, 0, 0, 0, 0), + _(B8G8R8X8_UNORM, A8R8G8B8, S1, S1, S1, ONE, X, Y, Z, W, 0, 0, 0, 0), + _(B8G8R8A8_UNORM, A8R8G8B8, S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), + _(B5G5R5A1_UNORM, A1R5G5B5, S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), + _(B4G4R4A4_UNORM, A4R4G4B4, S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), + _(B5G6R5_UNORM , R5G6B5 , S1, S1, S1, ONE, X, Y, Z, W, 0, 0, 0, 0), _(L8_UNORM , L8 , S1, S1, S1, ONE, X, X, X, X, 0, 0, 0, 0), _(A8_UNORM , L8 , ZERO, ZERO, ZERO, S1, X, X, X, X, 0, 0, 0, 0), _(R16_SNORM , A16 , ZERO, ZERO, S1, ONE, X, X, X, Y, 1, 1, 1, 1), _(I8_UNORM , L8 , S1, S1, S1, S1, X, X, X, X, 0, 0, 0, 0), - _(A8L8_UNORM , A8L8 , S1, S1, S1, S1, X, X, X, Y, 0, 0, 0, 0), + _(L8A8_UNORM , A8L8 , S1, S1, S1, S1, X, X, X, Y, 0, 0, 0, 0), _(Z16_UNORM , Z16 , S1, S1, S1, ONE, X, X, X, X, 0, 0, 0, 0), - _(Z24S8_UNORM , Z24 , S1, S1, S1, ONE, X, X, X, X, 0, 0, 0, 0), + _(S8Z24_UNORM , Z24 , S1, S1, S1, ONE, X, X, X, X, 0, 0, 0, 0), _(DXT1_RGB , DXT1 , S1, S1, S1, ONE, X, Y, Z, W, 0, 0, 0, 0), _(DXT1_RGBA , DXT1 , S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), _(DXT3_RGBA , DXT3 , S1, S1, S1, S1, X, Y, Z, W, 0, 0, 0, 0), diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index a91b31015e..63dfd8cb29 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -71,9 +71,9 @@ nv50_state_validate_fb(struct nv50_context *nv50) so_reloc (so, bo, fb->cbufs[i]->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | NOUVEAU_BO_RDWR, 0, 0); switch (fb->cbufs[i]->format) { - NV50_CBUF_FORMAT_CASE(A8R8G8B8_UNORM); - NV50_CBUF_FORMAT_CASE(X8R8G8B8_UNORM); - NV50_CBUF_FORMAT_CASE(R5G6B5_UNORM); + NV50_CBUF_FORMAT_CASE(B8G8R8A8_UNORM); + NV50_CBUF_FORMAT_CASE(B8G8R8X8_UNORM); + NV50_CBUF_FORMAT_CASE(B5G6R5_UNORM); NV50_CBUF_FORMAT_CASE(R16G16B16A16_SNORM); NV50_CBUF_FORMAT_CASE(R16G16B16A16_UNORM); NV50_CBUF_FORMAT_CASE(R32G32B32A32_FLOAT); @@ -112,9 +112,9 @@ nv50_state_validate_fb(struct nv50_context *nv50) so_reloc (so, bo, fb->zsbuf->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | NOUVEAU_BO_RDWR, 0, 0); switch (fb->zsbuf->format) { - NV50_ZETA_FORMAT_CASE(S8Z24_UNORM); - NV50_ZETA_FORMAT_CASE(X8Z24_UNORM); NV50_ZETA_FORMAT_CASE(Z24S8_UNORM); + NV50_ZETA_FORMAT_CASE(Z24X8_UNORM); + NV50_ZETA_FORMAT_CASE(S8Z24_UNORM); NV50_ZETA_FORMAT_CASE(Z32_FLOAT); default: NOUVEAU_ERR("AIIII unknown format %s\n", diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index 9f1a171303..de0560e20c 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -49,28 +49,28 @@ struct nv50_texture_format { static const struct nv50_texture_format nv50_tex_format_list[] = { - _(A8R8G8B8_UNORM, UNORM, C2, C1, C0, C3, 8_8_8_8), - _(A8R8G8B8_SRGB, UNORM, C2, C1, C0, C3, 8_8_8_8), - _(X8R8G8B8_UNORM, UNORM, C2, C1, C0, ONE, 8_8_8_8), - _(X8R8G8B8_SRGB, UNORM, C2, C1, C0, ONE, 8_8_8_8), - _(A1R5G5B5_UNORM, UNORM, C2, C1, C0, C3, 1_5_5_5), - _(A4R4G4B4_UNORM, UNORM, C2, C1, C0, C3, 4_4_4_4), + _(B8G8R8A8_UNORM, UNORM, C2, C1, C0, C3, 8_8_8_8), + _(B8G8R8A8_SRGB, UNORM, C2, C1, C0, C3, 8_8_8_8), + _(B8G8R8X8_UNORM, UNORM, C2, C1, C0, ONE, 8_8_8_8), + _(B8G8R8X8_SRGB, UNORM, C2, C1, C0, ONE, 8_8_8_8), + _(B5G5R5A1_UNORM, UNORM, C2, C1, C0, C3, 1_5_5_5), + _(B4G4R4A4_UNORM, UNORM, C2, C1, C0, C3, 4_4_4_4), - _(R5G6B5_UNORM, UNORM, C2, C1, C0, ONE, 5_6_5), + _(B5G6R5_UNORM, UNORM, C2, C1, C0, ONE, 5_6_5), _(L8_UNORM, UNORM, C0, C0, C0, ONE, 8), _(A8_UNORM, UNORM, ZERO, ZERO, ZERO, C0, 8), _(I8_UNORM, UNORM, C0, C0, C0, C0, 8), - _(A8L8_UNORM, UNORM, C0, C0, C0, C1, 8_8), + _(L8A8_UNORM, UNORM, C0, C0, C0, C1, 8_8), _(DXT1_RGB, UNORM, C0, C1, C2, ONE, DXT1), _(DXT1_RGBA, UNORM, C0, C1, C2, C3, DXT1), _(DXT3_RGBA, UNORM, C0, C1, C2, C3, DXT3), _(DXT5_RGBA, UNORM, C0, C1, C2, C3, DXT5), - _MIXED(Z24S8_UNORM, UINT, UNORM, UINT, UINT, C1, C1, C1, ONE, 24_8), - _MIXED(S8Z24_UNORM, UNORM, UINT, UINT, UINT, C0, C0, C0, ONE, 8_24), + _MIXED(S8Z24_UNORM, UINT, UNORM, UINT, UINT, C1, C1, C1, ONE, 24_8), + _MIXED(Z24S8_UNORM, UNORM, UINT, UINT, UINT, C0, C0, C0, ONE, 8_24), _(R16G16B16A16_SNORM, UNORM, C0, C1, C2, C3, 16_16_16_16), _(R16G16B16A16_UNORM, SNORM, C0, C1, C2, C3, 16_16_16_16), -- cgit v1.2.3 From 20443f969d78efb8437083b39b9ddcf4c08aa6cf Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Tue, 2 Mar 2010 19:16:39 +0100 Subject: nv50: fix RT formats after format rename fixes Getting rid of the evil pre-processor magic, but not changing our internal format naming convention (at least for now). --- src/gallium/drivers/nv50/nv50_state_validate.c | 54 +++++++++++++++++--------- 1 file changed, 36 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 63dfd8cb29..c974cc92dc 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -25,12 +25,6 @@ #include "nv50_context.h" #include "nouveau/nouveau_stateobj.h" -#define NV50_CBUF_FORMAT_CASE(n) \ - case PIPE_FORMAT_##n: so_data(so, NV50TCL_RT_FORMAT_##n); break - -#define NV50_ZETA_FORMAT_CASE(n) \ - case PIPE_FORMAT_##n: so_data(so, NV50TCL_ZETA_FORMAT_##n); break - static void nv50_state_validate_fb(struct nv50_context *nv50) { @@ -71,14 +65,30 @@ nv50_state_validate_fb(struct nv50_context *nv50) so_reloc (so, bo, fb->cbufs[i]->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | NOUVEAU_BO_RDWR, 0, 0); switch (fb->cbufs[i]->format) { - NV50_CBUF_FORMAT_CASE(B8G8R8A8_UNORM); - NV50_CBUF_FORMAT_CASE(B8G8R8X8_UNORM); - NV50_CBUF_FORMAT_CASE(B5G6R5_UNORM); - NV50_CBUF_FORMAT_CASE(R16G16B16A16_SNORM); - NV50_CBUF_FORMAT_CASE(R16G16B16A16_UNORM); - NV50_CBUF_FORMAT_CASE(R32G32B32A32_FLOAT); - NV50_CBUF_FORMAT_CASE(R16G16_SNORM); - NV50_CBUF_FORMAT_CASE(R16G16_UNORM); + case PIPE_FORMAT_B8G8R8A8_UNORM: + so_data(so, NV50TCL_RT_FORMAT_A8R8G8B8_UNORM); + break; + case PIPE_FORMAT_B8G8R8X8_UNORM: + so_data(so, NV50TCL_RT_FORMAT_X8R8G8B8_UNORM); + break; + case PIPE_FORMAT_B5G6R5_UNORM: + so_data(so, NV50TCL_RT_FORMAT_R5G6B5_UNORM); + break; + case PIPE_FORMAT_R16G16B16A16_SNORM: + so_data(so, NV50TCL_RT_FORMAT_R16G16B16A16_SNORM); + break; + case PIPE_FORMAT_R16G16B16A16_UNORM: + so_data(so, NV50TCL_RT_FORMAT_R16G16B16A16_UNORM); + break; + case PIPE_FORMAT_R32G32B32A32_FLOAT: + so_data(so, NV50TCL_RT_FORMAT_R32G32B32A32_FLOAT); + break; + case PIPE_FORMAT_R16G16_SNORM: + so_data(so, NV50TCL_RT_FORMAT_R16G16_SNORM); + break; + case PIPE_FORMAT_R16G16_UNORM: + so_data(so, NV50TCL_RT_FORMAT_R16G16_UNORM); + break; default: NOUVEAU_ERR("AIIII unknown format %s\n", util_format_name(fb->cbufs[i]->format)); @@ -112,10 +122,18 @@ nv50_state_validate_fb(struct nv50_context *nv50) so_reloc (so, bo, fb->zsbuf->offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | NOUVEAU_BO_RDWR, 0, 0); switch (fb->zsbuf->format) { - NV50_ZETA_FORMAT_CASE(Z24S8_UNORM); - NV50_ZETA_FORMAT_CASE(Z24X8_UNORM); - NV50_ZETA_FORMAT_CASE(S8Z24_UNORM); - NV50_ZETA_FORMAT_CASE(Z32_FLOAT); + case PIPE_FORMAT_Z24S8_UNORM: + so_data(so, NV50TCL_ZETA_FORMAT_S8Z24_UNORM); + break; + case PIPE_FORMAT_Z24X8_UNORM: + so_data(so, NV50TCL_ZETA_FORMAT_X8Z24_UNORM); + break; + case PIPE_FORMAT_S8Z24_UNORM: + so_data(so, NV50TCL_ZETA_FORMAT_Z24S8_UNORM); + break; + case PIPE_FORMAT_Z32_FLOAT: + so_data(so, NV50TCL_ZETA_FORMAT_Z32_FLOAT); + break; default: NOUVEAU_ERR("AIIII unknown format %s\n", util_format_name(fb->zsbuf->format)); -- cgit v1.2.3 From 4240987cecdaaaeb2d6188f7c83ff4cb8e670c59 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 2 Mar 2010 18:40:03 -0800 Subject: r300g: Make velem CSO actually work. glxgears runs again. --- src/gallium/drivers/r300/r300_blit.c | 2 +- src/gallium/drivers/r300/r300_context.h | 2 +- src/gallium/drivers/r300/r300_state.c | 15 ++++++++++----- 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c index 2f9650df1b..297768e5cf 100644 --- a/src/gallium/drivers/r300/r300_blit.c +++ b/src/gallium/drivers/r300/r300_blit.c @@ -34,7 +34,7 @@ static void r300_blitter_save_states(struct r300_context* r300) util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state); util_blitter_save_fragment_shader(r300->blitter, r300->fs); util_blitter_save_vertex_shader(r300->blitter, r300->vs); - util_blitter_save_vertex_elements(r300->blitter, r300->vs); + util_blitter_save_vertex_elements(r300->blitter, r300->velems); } /* Clear currently bound buffers. */ diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 0ee0ab47a6..f372743c5b 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -249,7 +249,7 @@ struct r300_vertex_info { struct r300_velems_state { unsigned count; - struct pipe_vertex_element velem[]; + struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; }; extern struct pipe_viewport_state r300_viewport_identity; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index ceac690fc4..995664d900 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1061,13 +1061,14 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe, unsigned count, const struct pipe_vertex_element* attribs) { - /*XXX could precalculate state here instead of later */ struct r300_velems_state *velems; + + /*XXX should precalculate state here instead of later */ assert(count <= PIPE_MAX_ATTRIBS); - velems = (struct r300_velems_state *) MALLOC(sizeof(struct r300_velems_state) + count * sizeof(*attribs)); + velems = CALLOC_STRUCT(r300_velems_state); if (velems) { - velems->count = count; - memcpy(velems->velem, attribs, sizeof(*attribs) * count); + velems->count = count; + memcpy(velems->velem, attribs, sizeof(struct pipe_vertex_element) * count); } return velems; } @@ -1078,6 +1079,10 @@ static void r300_bind_vertex_elements_state(struct pipe_context *pipe, struct r300_context *r300 = r300_context(pipe); struct r300_velems_state *r300_velems = (struct r300_velems_state *) velems; + if (velems == NULL) { + return; + } + r300->velems = r300_velems; if (r300->draw) { @@ -1094,7 +1099,7 @@ static void r300_bind_vertex_elements_state(struct pipe_context *pipe, static void r300_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) { - FREE( velems ); + FREE(velems); } static void* r300_create_vs_state(struct pipe_context* pipe, -- cgit v1.2.3 From 4cb7642ff3ba390e2918d71220625a837bf8a7b9 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 2 Mar 2010 19:14:09 -0800 Subject: r300g: Use a macro to consolidate general state handling. My God, I've reinvented R300_STATECHANGE. Forgive me. :C --- src/gallium/drivers/r300/r300_state.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index a983ec7b5b..1f6f99d3e5 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -43,6 +43,12 @@ /* r300_state: Functions used to intialize state context by translating * Gallium state objects into semi-native r300 state objects. */ +#define UPDATE_STATE(cso, atom) \ + if (cso != atom.state) { \ + atom.state = cso; \ + atom.dirty = TRUE; \ + } + static boolean blend_discard_if_src_alpha_0(unsigned srcRGB, unsigned srcA, unsigned dstRGB, unsigned dstA) { @@ -328,8 +334,7 @@ static void r300_bind_blend_state(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); - r300->blend_state.state = state; - r300->blend_state.dirty = TRUE; + UPDATE_STATE(state, r300->blend_state); } /* Free blend state. */ @@ -478,11 +483,8 @@ static void r300_bind_dsa_state(struct pipe_context* pipe, void* state) { struct r300_context* r300 = r300_context(pipe); - struct r300_screen* r300screen = r300_screen(pipe->screen); - r300->dsa_state.state = state; - r300->dsa_state.size = r300screen->caps->is_r500 ? 8 : 6; - r300->dsa_state.dirty = TRUE; + UPDATE_STATE(state, r300->dsa_state); } /* Free DSA state. */ @@ -813,13 +815,13 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) if (rs) { r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; - r300->rs_state.dirty = TRUE; } else { r300->polygon_offset_enabled = FALSE; } - r300->rs_state.state = rs; + UPDATE_STATE(state, r300->rs_state); r300->rs_state.size = 17 + (r300->polygon_offset_enabled ? 5 : 0); + /* XXX Why is this still needed, dammit!? */ r300->scissor_state.dirty = TRUE; r300->viewport_state.dirty = TRUE; @@ -1114,9 +1116,8 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) r300_translate_vertex_shader(r300, vs); } - r300->vs_state.state = vs; + UPDATE_STATE(shader, r300->vs_state); r300->vs_state.size = vs->code.length + 9; - r300->vs_state.dirty = TRUE; r300->rs_block_state.dirty = TRUE; /* Will be updated before the emission. */ r300->vap_output_state.dirty = TRUE; -- cgit v1.2.3 From daf85c460875c944d6918fdf4041467d97cba41e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 3 Mar 2010 16:27:21 +1000 Subject: radeon/r200/r300/r600: fix blit BO buffer validation there is no need for these to be persistent since we flush the CS at the end of the blit, and we don't reuse these buffers at all. on my r600 the Wine DX9 test suite doesn't crash at least anymore. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r200/r200_blit.c | 12 ++++++++---- src/mesa/drivers/dri/r300/r300_blit.c | 12 ++++++++---- src/mesa/drivers/dri/r600/r600_blit.c | 14 ++++++++------ src/mesa/drivers/dri/radeon/radeon_blit.c | 12 ++++++++---- 4 files changed, 32 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c index e446d532cf..56b08a21bd 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.c +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -211,11 +211,15 @@ static GLboolean validate_buffers(struct r200_context *r200, struct radeon_bo *dst_bo) { int ret; - radeon_cs_space_add_persistent_bo(r200->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + if (ret) + return GL_FALSE; - radeon_cs_space_add_persistent_bo(r200->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + if (ret) + return GL_FALSE; ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, first_elem(&r200->radeon.dma.reserved)->bo, diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 54ac2510e7..35fd06734f 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -373,11 +373,15 @@ static GLboolean validate_buffers(struct r300_context *r300, struct radeon_bo *dst_bo) { int ret; - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + if (ret) + return GL_FALSE; - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + if (ret) + return GL_FALSE; ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, first_elem(&r300->radeon.dma.reserved)->bo, diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index 4bb77a398f..8eafd42e8f 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -1532,14 +1532,16 @@ static GLboolean validate_buffers(context_t *rmesa, struct radeon_bo *dst_bo) { int ret; - radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); - radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + if (ret) + return GL_FALSE; - radeon_cs_space_add_persistent_bo(rmesa->radeon.cmdbuf.cs, - rmesa->blit_bo, RADEON_GEM_DOMAIN_GTT, 0); + ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + if (ret) + return GL_FALSE; ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, rmesa->blit_bo, diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index 0df4fbb33c..34b9af4063 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -204,11 +204,15 @@ static GLboolean validate_buffers(struct r100_context *r100, struct radeon_bo *dst_bo) { int ret; - radeon_cs_space_add_persistent_bo(r100->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + if (ret) + return GL_FALSE; - radeon_cs_space_add_persistent_bo(r100->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + if (ret) + return GL_FALSE; ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, first_elem(&r100->radeon.dma.reserved)->bo, -- cgit v1.2.3 From af36b050eb2c801faecbd2b239d96df71fec5287 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 10:54:35 +0000 Subject: gallivm: Rename lp_bld_misc -> lp_bld_init. --- src/gallium/auxiliary/Makefile | 2 +- src/gallium/auxiliary/SConscript | 2 +- src/gallium/auxiliary/gallivm/lp_bld_init.cpp | 75 +++++++++++++++++++++++++++ src/gallium/auxiliary/gallivm/lp_bld_init.h | 56 ++++++++++++++++++++ src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 75 --------------------------- src/gallium/auxiliary/gallivm/lp_bld_misc.h | 56 -------------------- 6 files changed, 133 insertions(+), 133 deletions(-) create mode 100644 src/gallium/auxiliary/gallivm/lp_bld_init.cpp create mode 100644 src/gallium/auxiliary/gallivm/lp_bld_init.h delete mode 100644 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp delete mode 100644 src/gallium/auxiliary/gallivm/lp_bld_misc.h (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 60f9c2ae3c..1d0930e024 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -158,7 +158,7 @@ GALLIVM_SOURCES = \ gallivm/lp_bld_type.c GALLIVM_CPP_SOURCES = \ - gallivm/lp_bld_misc.cpp + gallivm/lp_bld_init.cpp GENERATED_SOURCES = \ indices/u_indices_gen.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index 47de50bf3e..f365c4bbdd 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -192,7 +192,7 @@ if drawllvm: 'gallivm/lp_bld_interp.c', 'gallivm/lp_bld_intr.c', 'gallivm/lp_bld_logic.c', - 'gallivm/lp_bld_misc.cpp', + 'gallivm/lp_bld_init.cpp', 'gallivm/lp_bld_pack.c', 'gallivm/lp_bld_sample.c', 'gallivm/lp_bld_sample_soa.c', diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.cpp b/src/gallium/auxiliary/gallivm/lp_bld_init.cpp new file mode 100644 index 0000000000..6b559db159 --- /dev/null +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.cpp @@ -0,0 +1,75 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#include "pipe/p_config.h" + +#include "lp_bld_init.h" + + +#ifndef LLVM_NATIVE_ARCH + +namespace llvm { + extern void LinkInJIT(); +} + + +void +LLVMLinkInJIT(void) +{ + llvm::LinkInJIT(); +} + + +extern "C" int X86TargetMachineModule; + + +int +LLVMInitializeNativeTarget(void) +{ +#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) + X86TargetMachineModule = 1; +#endif + return 0; +} + + +#endif + + +/* + * Hack to allow the linking of release LLVM static libraries on a debug build. + * + * See also: + * - http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/7234ea2b-0042-42ed-b4e2-5d8644dfb57d + */ +#if defined(_MSC_VER) && defined(_DEBUG) +#include +extern "C" { + _CRTIMP void __cdecl _invalid_parameter_noinfo(void) {} +} +#endif diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.h b/src/gallium/auxiliary/gallivm/lp_bld_init.h new file mode 100644 index 0000000000..6a8ab8e5db --- /dev/null +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.h @@ -0,0 +1,56 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#ifndef LP_BLD_INIT_H +#define LP_BLD_INIT_H + + +#include "llvm/Config/config.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifndef LLVM_NATIVE_ARCH + +void +LLVMLinkInJIT(void); + +int +LLVMInitializeNativeTarget(void); + +#endif /* !LLVM_NATIVE_ARCH */ + + +#ifdef __cplusplus +} +#endif + + +#endif /* !LP_BLD_INIT_H */ diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp deleted file mode 100644 index 6e79438ead..0000000000 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#include "pipe/p_config.h" - -#include "lp_bld_misc.h" - - -#ifndef LLVM_NATIVE_ARCH - -namespace llvm { - extern void LinkInJIT(); -} - - -void -LLVMLinkInJIT(void) -{ - llvm::LinkInJIT(); -} - - -extern "C" int X86TargetMachineModule; - - -int -LLVMInitializeNativeTarget(void) -{ -#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) - X86TargetMachineModule = 1; -#endif - return 0; -} - - -#endif - - -/* - * Hack to allow the linking of release LLVM static libraries on a debug build. - * - * See also: - * - http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/7234ea2b-0042-42ed-b4e2-5d8644dfb57d - */ -#if defined(_MSC_VER) && defined(_DEBUG) -#include -extern "C" { - _CRTIMP void __cdecl _invalid_parameter_noinfo(void) {} -} -#endif diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h deleted file mode 100644 index 0e787e0b9c..0000000000 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h +++ /dev/null @@ -1,56 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#ifndef LP_BLD_MISC_H -#define LP_BLD_MISC_H - - -#include "llvm/Config/config.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifndef LLVM_NATIVE_ARCH - -void -LLVMLinkInJIT(void); - -int -LLVMInitializeNativeTarget(void); - -#endif /* !LLVM_NATIVE_ARCH */ - - -#ifdef __cplusplus -} -#endif - - -#endif /* !LP_BLD_MISC_H */ -- cgit v1.2.3 From f58ca9b02bb4b19d57dfe38016626a89c3757de6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 11:17:16 +0000 Subject: llvmpipe: Update for lp_bld_init.h rename. --- src/gallium/drivers/llvmpipe/lp_test_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_test_main.c b/src/gallium/drivers/llvmpipe/lp_test_main.c index 14ff00469b..b08872b2b5 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_main.c +++ b/src/gallium/drivers/llvmpipe/lp_test_main.c @@ -37,7 +37,7 @@ #include "util/u_cpu_detect.h" #include "gallivm/lp_bld_const.h" -#include "gallivm/lp_bld_misc.h" +#include "gallivm/lp_bld_init.h" #include "lp_test.h" -- cgit v1.2.3 From a9e6da7b4cd2019e5ac501bfa1d1aeff49e1982c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 12:00:08 +0000 Subject: gallivm: Centralize initialization. Fix stack alignment issues on Windows. --- src/gallium/auxiliary/gallivm/lp_bld_init.cpp | 44 ++++++++++++--------------- src/gallium/auxiliary/gallivm/lp_bld_init.h | 11 +------ 2 files changed, 20 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.cpp b/src/gallium/auxiliary/gallivm/lp_bld_init.cpp index 6b559db159..067397a520 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.cpp @@ -26,39 +26,34 @@ **************************************************************************/ +#include +#include +#include + #include "pipe/p_config.h" #include "lp_bld_init.h" -#ifndef LLVM_NATIVE_ARCH - -namespace llvm { - extern void LinkInJIT(); -} +extern "C" void LLVMLinkInJIT(); -void -LLVMLinkInJIT(void) +extern "C" void +lp_build_init(void) { - llvm::LinkInJIT(); -} - - -extern "C" int X86TargetMachineModule; - - -int -LLVMInitializeNativeTarget(void) -{ -#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64) - X86TargetMachineModule = 1; +#if defined(PIPE_OS_WINDOWS) && defined(PIPE_ARCH_X86) + /* + * This is mis-detected on some hardware / software combinations. + */ + llvm::StackAlignment = 4; + llvm::RealignStack = true; #endif - return 0; -} + /* Same as LLVMInitializeNativeTarget(); */ + llvm::InitializeNativeTarget(); -#endif + LLVMLinkInJIT(); +} /* @@ -69,7 +64,6 @@ LLVMInitializeNativeTarget(void) */ #if defined(_MSC_VER) && defined(_DEBUG) #include -extern "C" { - _CRTIMP void __cdecl _invalid_parameter_noinfo(void) {} -} +extern "C" _CRTIMP void __cdecl +_invalid_parameter_noinfo(void) {} #endif diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.h b/src/gallium/auxiliary/gallivm/lp_bld_init.h index 6a8ab8e5db..07f50d1c43 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.h @@ -30,22 +30,13 @@ #define LP_BLD_INIT_H -#include "llvm/Config/config.h" - #ifdef __cplusplus extern "C" { #endif -#ifndef LLVM_NATIVE_ARCH - void -LLVMLinkInJIT(void); - -int -LLVMInitializeNativeTarget(void); - -#endif /* !LLVM_NATIVE_ARCH */ +lp_build_init(void); #ifdef __cplusplus -- cgit v1.2.3 From 9f9b44222f45a4548070c1019674abe173e2f253 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 12:00:25 +0000 Subject: llvmpipe: Centralize LLVM initialization. --- src/gallium/drivers/llvmpipe/lp_jit.c | 4 ++-- src/gallium/drivers/llvmpipe/lp_test_main.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index d3d7e26882..b666ffc804 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -37,6 +37,7 @@ #include "util/u_memory.h" #include "util/u_cpu_detect.h" +#include "gallivm/lp_bld_init.h" #include "lp_debug.h" #include "lp_screen.h" #include "gallivm/lp_bld_intr.h" @@ -148,8 +149,7 @@ lp_jit_screen_init(struct llvmpipe_screen *screen) util_cpu_caps.has_sse4_1 = 0; #endif - LLVMLinkInJIT(); - LLVMInitializeNativeTarget(); + lp_build_init(); screen->module = LLVMModuleCreateWithName("llvmpipe"); diff --git a/src/gallium/drivers/llvmpipe/lp_test_main.c b/src/gallium/drivers/llvmpipe/lp_test_main.c index b08872b2b5..f9dce8b9c2 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_main.c +++ b/src/gallium/drivers/llvmpipe/lp_test_main.c @@ -380,8 +380,7 @@ int main(int argc, char **argv) n = atoi(argv[i]); } - LLVMLinkInJIT(); - LLVMInitializeNativeTarget(); + lp_build_init(); util_cpu_detect(); -- cgit v1.2.3 From 7b7b66781b373c8930706b321934477e3325be2c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 12:07:39 +0000 Subject: llvmpipe: Linux is no longer a dependency. Llvmpipe builds and runs fine on windows too. --- src/gallium/drivers/llvmpipe/README | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/README b/src/gallium/drivers/llvmpipe/README index ae2c1ba943..bf4c9a5727 100644 --- a/src/gallium/drivers/llvmpipe/README +++ b/src/gallium/drivers/llvmpipe/README @@ -49,8 +49,6 @@ To do (probably by this order): Requirements ============ - - Linux - - A x86 or amd64 processor. 64bit mode is preferred. Support for sse2 is strongly encouraged. Support for ssse3, and sse4.1 will -- cgit v1.2.3 From c51f7a48cde970c06a42a9ca195a2d1cf808fd2c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 13:07:56 +0000 Subject: r300: Remove PIPE_FORMAT_R8G8B8X8_SNORM support. --- src/gallium/drivers/r300/r300_texture.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 44cfe82a57..c0144f64b4 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -329,7 +329,6 @@ static uint32_t r300_translate_colorformat(enum pipe_format format) case PIPE_FORMAT_A8B8G8R8_SRGB: case PIPE_FORMAT_X8B8G8R8_UNORM: case PIPE_FORMAT_X8B8G8R8_SRGB: - case PIPE_FORMAT_R8G8B8X8_SNORM: case PIPE_FORMAT_R8SG8SB8UX8U_NORM: return R300_COLOR_FORMAT_ARGB8888; case PIPE_FORMAT_R10G10B10A2_UNORM: @@ -466,7 +465,6 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format) R300_C2_SEL_G | R300_C3_SEL_R; /* ABGR 32-bit outputs. */ - case PIPE_FORMAT_R8G8B8X8_SNORM: case PIPE_FORMAT_R8SG8SB8UX8U_NORM: case PIPE_FORMAT_R10G10B10A2_UNORM: /* RGBA high precision outputs (same swizzles as ABGR low precision) */ -- cgit v1.2.3 From a5b56c815328c0227926323c40896426bb66d227 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 13:08:08 +0000 Subject: util: Remove PIPE_FORMAT_R8G8B8X8_SNORM information. --- src/gallium/auxiliary/util/u_format.csv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index c9766e6207..96a0fa6550 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -86,8 +86,7 @@ PIPE_FORMAT_B8G8R8X8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , zyx1, s PIPE_FORMAT_A8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzwx, srgb PIPE_FORMAT_X8R8G8B8_SRGB , plain, 1, 1, un8 , un8 , un8 , un8 , yzw1, srgb -# Signed formats (typically used for bump map textures) -PIPE_FORMAT_R8G8B8X8_SNORM , plain, 1, 1, sn8 , sn8 , sn8 , sn8 , xyz1, rgb +# Mixed-sign formats (typically used for bump map textures) PIPE_FORMAT_R8SG8SB8UX8U_NORM , plain, 1, 1, sn8 , sn8 , un8 , x8 , xyz1, rgb PIPE_FORMAT_R5SG5SB6U_NORM , plain, 1, 1, sn5 , sn5 , un6 , , xyz1, rgb -- cgit v1.2.3 From f7e403b129456df3bbb445eea42bae7376ecc59d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 13:08:23 +0000 Subject: gallium: Remove PIPE_FORMAT_R8G8B8X8_SNORM. --- src/gallium/include/pipe/p_format.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index 0314172de7..cbf3273ec8 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -121,7 +121,6 @@ enum pipe_format { PIPE_FORMAT_R8G8_SNORM = 75, PIPE_FORMAT_R8G8B8_SNORM = 76, PIPE_FORMAT_R8G8B8A8_SNORM = 77, - PIPE_FORMAT_R8G8B8X8_SNORM = 81, PIPE_FORMAT_R8_SSCALED = 82, PIPE_FORMAT_R8G8_SSCALED = 83, PIPE_FORMAT_R8G8B8_SSCALED = 84, -- cgit v1.2.3 From af3f1bb26980537522a1586fef3fc3c208b44ebc Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 2 Mar 2010 15:41:12 -0500 Subject: intel: Set InternalFormat for renderbuffers created from an EGLImage --- src/mesa/drivers/dri/intel/intel_fbo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 82c7b19eef..b388a3de2e 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -222,6 +222,7 @@ intel_image_target_renderbuffer_storage(GLcontext *ctx, intel_region_release(&irb->region); intel_region_reference(&irb->region, image->region); + rb->InternalFormat = image->internal_format; rb->Width = image->region->width; rb->Height = image->region->height; rb->Format = image->format; -- cgit v1.2.3 From 400734258453fb8cb22a467d18779ad3acf4e53f Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 2 Mar 2010 15:34:18 -0500 Subject: egl_dri2: Factor out DRI2 protocol bits from initialize. --- src/egl/drivers/dri2/egl_dri2.c | 241 ++++++++++++++++++++++++++-------------- 1 file changed, 155 insertions(+), 86 deletions(-) (limited to 'src') diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index d775b5e6a2..15b3529cd2 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -62,6 +62,7 @@ struct dri2_egl_display int dri2_major; int dri2_minor; __DRIscreen *dri_screen; + const __DRIconfig **driver_configs; void *driver; __DRIcoreExtension *core; __DRIdri2Extension *dri2; @@ -70,6 +71,9 @@ struct dri2_egl_display __DRIimageExtension *image; int fd; + char *device_name; + char *driver_name; + __DRIdri2LoaderExtension loader_extension; __DRIimageLookupExtension image_lookup_extension; const __DRIextension *extensions[3]; @@ -411,9 +415,9 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable, } #ifdef GLX_USE_TLS -static const char dri_driver_format[] = "%.*s/tls/%.*s_dri.so"; +static const char dri_driver_format[] = "%.*s/tls/%s_dri.so"; #else -static const char dri_driver_format[] = "%.*s/%.*s_dri.so"; +static const char dri_driver_format[] = "%.*s/%s_dri.so"; #endif static const char dri_driver_path[] = DEFAULT_DRIVER_DIR; @@ -470,45 +474,32 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy, return ret; } -/** - * Called via eglInitialize(), GLX_drv->API.Initialize(). - */ +static char * +dri2_strndup(const char *s, int length) +{ + char *d; + + d = malloc(length + 1); + if (d == NULL) + return NULL; + + memcpy(d, s, length); + d[length] = '\0'; + + return d; +} + static EGLBoolean -dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, - EGLint *major, EGLint *minor) +dri2_connect(struct dri2_egl_display *dri2_dpy) { - const __DRIextension **extensions; - const __DRIconfig **driver_configs; - struct dri2_egl_display *dri2_dpy; - char path[PATH_MAX], *search_paths, *p, *next, *end; xcb_xfixes_query_version_reply_t *xfixes_query; xcb_xfixes_query_version_cookie_t xfixes_query_cookie; xcb_dri2_query_version_reply_t *dri2_query; xcb_dri2_query_version_cookie_t dri2_query_cookie; xcb_dri2_connect_reply_t *connect; xcb_dri2_connect_cookie_t connect_cookie; - xcb_dri2_authenticate_reply_t *authenticate; - xcb_dri2_authenticate_cookie_t authenticate_cookie; xcb_generic_error_t *error; - drm_magic_t magic; xcb_screen_iterator_t s; - xcb_depth_iterator_t d; - xcb_visualtype_t *visuals; - int i, j, id; - - dri2_dpy = malloc(sizeof *dri2_dpy); - if (!dri2_dpy) - return _eglError(EGL_BAD_ALLOC, "eglInitialize"); - - disp->DriverData = (void *) dri2_dpy; - if (disp->NativeDisplay != NULL) - dri2_dpy->conn = XGetXCBConnection(disp->NativeDisplay); - else - dri2_dpy->conn = xcb_connect(0, 0); - if (!dri2_dpy->conn) { - _eglLog(_EGL_WARNING, "DRI2: xcb_connect failed"); - goto cleanup_dpy; - } xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_xfixes_id); xcb_prefetch_extension_data (dri2_dpy->conn, &xcb_dri2_id); @@ -533,7 +524,7 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, error != NULL || xfixes_query->major_version < 2) { _eglLog(_EGL_FATAL, "DRI2: failed to query xfixes version"); free(error); - goto cleanup_conn; + return EGL_FALSE; } free(xfixes_query); @@ -542,7 +533,7 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, if (dri2_query == NULL || error != NULL) { _eglLog(_EGL_FATAL, "DRI2: failed to query version"); free(error); - goto cleanup_conn; + return EGL_FALSE; } dri2_dpy->dri2_major = dri2_query->major_version; dri2_dpy->dri2_minor = dri2_query->minor_version; @@ -552,7 +543,126 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, if (connect == NULL || connect->driver_name_length + connect->device_name_length == 0) { _eglLog(_EGL_FATAL, "DRI2: failed to authenticate"); - goto cleanup_connect; + return EGL_FALSE; + } + + dri2_dpy->device_name = + dri2_strndup(xcb_dri2_connect_device_name (connect), + xcb_dri2_connect_device_name_length (connect)); + + dri2_dpy->driver_name = + dri2_strndup(xcb_dri2_connect_driver_name (connect), + xcb_dri2_connect_driver_name_length (connect)); + + if (dri2_dpy->device_name == NULL || dri2_dpy->driver_name == NULL) { + free(dri2_dpy->device_name); + free(dri2_dpy->driver_name); + free(connect); + return EGL_FALSE; + } + free(connect); + + return EGL_TRUE; +} + +static EGLBoolean +dri2_authenticate(struct dri2_egl_display *dri2_dpy) +{ + xcb_dri2_authenticate_reply_t *authenticate; + xcb_dri2_authenticate_cookie_t authenticate_cookie; + xcb_screen_iterator_t s; + drm_magic_t magic; + + if (drmGetMagic(dri2_dpy->fd, &magic)) { + _eglLog(_EGL_FATAL, "DRI2: failed to get drm magic"); + return EGL_FALSE; + } + + s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn)); + authenticate_cookie = + xcb_dri2_authenticate_unchecked(dri2_dpy->conn, s.data->root, magic); + authenticate = + xcb_dri2_authenticate_reply(dri2_dpy->conn, authenticate_cookie, NULL); + if (authenticate == NULL || !authenticate->authenticated) { + _eglLog(_EGL_FATAL, "DRI2: failed to authenticate"); + free(authenticate); + return EGL_FALSE; + } + + free(authenticate); + + return EGL_TRUE; +} + +static EGLBoolean +dri2_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy, + _EGLDisplay *disp) +{ + xcb_screen_iterator_t s; + xcb_depth_iterator_t d; + xcb_visualtype_t *visuals; + int i, j, id; + + s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn)); + d = xcb_screen_allowed_depths_iterator(s.data); + id = 1; + while (d.rem > 0) { + EGLBoolean class_added[6] = { 0, }; + + visuals = xcb_depth_visuals(d.data); + for (i = 0; i < xcb_depth_visuals_length(d.data); i++) { + if (class_added[visuals[i]._class]) + continue; + + class_added[visuals[i]._class] = EGL_TRUE; + for (j = 0; dri2_dpy->driver_configs[j]; j++) + dri2_add_config(disp, dri2_dpy->driver_configs[j], + id++, d.data->depth, &visuals[i]); + } + + xcb_depth_next(&d); + } + + if (!disp->NumConfigs) { + _eglLog(_EGL_WARNING, "DRI2: failed to create any config"); + return EGL_FALSE; + } + + return EGL_TRUE; +} + +/** + * Called via eglInitialize(), GLX_drv->API.Initialize(). + */ +static EGLBoolean +dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, + EGLint *major, EGLint *minor) +{ + const __DRIextension **extensions; + struct dri2_egl_display *dri2_dpy; + char path[PATH_MAX], *search_paths, *p, *next, *end; + + dri2_dpy = malloc(sizeof *dri2_dpy); + if (!dri2_dpy) + return _eglError(EGL_BAD_ALLOC, "eglInitialize"); + + disp->DriverData = (void *) dri2_dpy; + if (disp->NativeDisplay == NULL) { + dri2_dpy->conn = xcb_connect(0, 0); + if (!dri2_dpy->conn) { + _eglLog(_EGL_WARNING, "DRI2: xcb_connect failed"); + goto cleanup_dpy; + } + } else { + dri2_dpy->conn = XGetXCBConnection(disp->NativeDisplay); + } + + if (dri2_dpy->conn == NULL) + goto cleanup_conn; + + if (dri2_dpy->conn) { + if (!dri2_connect(dri2_dpy)) + goto cleanup_conn; } search_paths = NULL; @@ -571,11 +681,7 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, next = end; snprintf(path, sizeof path, - dri_driver_format, - (int) (next - p), p, - xcb_dri2_connect_driver_name_length (connect), - xcb_dri2_connect_driver_name (connect)); - + dri_driver_format, (int) (next - p), p, dri2_dpy->driver_name); dri2_dpy->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL); } @@ -583,7 +689,7 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, _eglLog(_EGL_FATAL, "DRI2: failed to open any driver (search paths %s)", search_paths); - goto cleanup_connect; + goto cleanup_conn; } _eglLog(_EGL_DEBUG, "DRI2: dlopen(%s)", path); @@ -597,32 +703,18 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, if (!dri2_bind_extensions(dri2_dpy, dri2_driver_extensions, extensions)) goto cleanup_driver; - snprintf(path, sizeof path, "%.*s", - xcb_dri2_connect_device_name_length (connect), - xcb_dri2_connect_device_name (connect)); - dri2_dpy->fd = open (path, O_RDWR); + dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR); if (dri2_dpy->fd == -1) { _eglLog(_EGL_FATAL, "DRI2: could not open %s (%s)", path, strerror(errno)); goto cleanup_driver; } - if (drmGetMagic(dri2_dpy->fd, &magic)) { - _eglLog(_EGL_FATAL, "DRI2: failed to get drm magic"); - goto cleanup_fd; - } - - authenticate_cookie = xcb_dri2_authenticate_unchecked (dri2_dpy->conn, - s.data->root, magic); - authenticate = xcb_dri2_authenticate_reply (dri2_dpy->conn, - authenticate_cookie, NULL); - if (authenticate == NULL || !authenticate->authenticated) { - _eglLog(_EGL_FATAL, "DRI2: failed to authenticate"); - free(authenticate); - goto cleanup_fd; + if (dri2_dpy->conn) { + if (!dri2_authenticate(dri2_dpy)) + goto cleanup_fd; } - free(authenticate); if (dri2_dpy->dri2_minor >= 1) { dri2_dpy->loader_extension.base.name = __DRI_DRI2_LOADER; dri2_dpy->loader_extension.base.version = 3; @@ -648,7 +740,7 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, dri2_dpy->dri_screen = dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions, - &driver_configs, dri2_dpy); + &dri2_dpy->driver_configs, dri2_dpy); if (dri2_dpy->dri_screen == NULL) { _eglLog(_EGL_FATAL, "DRI2: failed to create dri screen"); @@ -659,30 +751,9 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions)) goto cleanup_dri_screen; - s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn)); - d = xcb_screen_allowed_depths_iterator(s.data); - id = 1; - while (d.rem > 0) { - EGLBoolean class_added[6] = { 0, }; - - visuals = xcb_depth_visuals(d.data); - for (i = 0; i < xcb_depth_visuals_length(d.data); i++) { - if (class_added[visuals[i]._class]) - continue; - - class_added[visuals[i]._class] = EGL_TRUE; - for (j = 0; driver_configs[j]; j++) - dri2_add_config(disp, driver_configs[j], - id++, d.data->depth, &visuals[i]); - - } - - xcb_depth_next(&d); - } - - if (!disp->NumConfigs) { - _eglLog(_EGL_WARNING, "DRI2: failed to create any config"); - goto cleanup_configs; + if (dri2_dpy->conn) { + if (!dri2_add_configs_for_visuals(dri2_dpy, disp)) + goto cleanup_configs; } disp->ClientAPIsMask = EGL_OPENGL_BIT; @@ -693,7 +764,7 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, /* we're supporting EGL 1.4 */ *major = 1; *minor = 4; - free (connect); + return EGL_TRUE; cleanup_configs: @@ -704,8 +775,6 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, close(dri2_dpy->fd); cleanup_driver: dlclose(dri2_dpy->driver); - cleanup_connect: - free(connect); cleanup_conn: if (disp->NativeDisplay == NULL) xcb_disconnect(dri2_dpy->conn); -- cgit v1.2.3 From bdbf199a8c5bef12186e022babbb03f5cd763db6 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 3 Mar 2010 14:09:53 -0500 Subject: r600: add new rs880 pci id --- src/mesa/drivers/dri/radeon/radeon_chipset.h | 1 + src/mesa/drivers/dri/radeon/radeon_screen.c | 1 + 2 files changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_chipset.h b/src/mesa/drivers/dri/radeon/radeon_chipset.h index 46a9cd5ff8..f17a305bce 100644 --- a/src/mesa/drivers/dri/radeon/radeon_chipset.h +++ b/src/mesa/drivers/dri/radeon/radeon_chipset.h @@ -340,6 +340,7 @@ #define PCI_CHIP_RS880_9712 0x9712 #define PCI_CHIP_RS880_9713 0x9713 #define PCI_CHIP_RS880_9714 0x9714 +#define PCI_CHIP_RS880_9715 0x9715 #define PCI_CHIP_RV770_9440 0x9440 #define PCI_CHIP_RV770_9441 0x9441 diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 631f729048..6415ec1239 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -826,6 +826,7 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id) case PCI_CHIP_RS880_9712: case PCI_CHIP_RS880_9713: case PCI_CHIP_RS880_9714: + case PCI_CHIP_RS880_9715: screen->chip_family = CHIP_FAMILY_RS880; screen->chip_flags = RADEON_CHIPSET_TCL; break; -- cgit v1.2.3 From 8bd8aec81d0310a3b790d425c41968003b454380 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Wed, 3 Mar 2010 21:22:38 +0200 Subject: glapi: drop condvar Seems unused and replaced by functionality in os module. --- src/mesa/glapi/glthread.h | 46 +--------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index e5193aaf98..4fe99284a8 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -107,48 +107,6 @@ typedef pthread_mutex_t _glthread_Mutex; #define _glthread_UNLOCK_MUTEX(name) \ (void) pthread_mutex_unlock(&(name)) -typedef pthread_cond_t _glthread_Cond; - -#define _glthread_DECLARE_STATIC_COND(name) \ - static _glthread_Cond name = PTHREAD_COND_INITIALIZER - -#define _glthread_INIT_COND(cond) \ - pthread_cond_init(&(cond), NULL) - -#define _glthread_DESTROY_COND(name) \ - pthread_cond_destroy(&(name)) - -#define _glthread_COND_WAIT(cond, mutex) \ - pthread_cond_wait(&(cond), &(mutex)) - -#define _glthread_COND_SIGNAL(cond) \ - pthread_cond_signal(&(cond)) - -#define _glthread_COND_BROADCAST(cond) \ - pthread_cond_broadcast(&(cond)) - - -#else /* PTHREADS */ - -typedef unsigned int _glthread_Cond; -#define _glthread_DECLARE_STATIC_COND(name) \ -// #warning Condition variables not implemented. - -#define _glthread_INIT_COND(cond) \ - ASSERT(0); - -#define _glthread_DESTROY_COND(name) \ - ASSERT(0); - -#define _glthread_COND_WAIT(cond, mutex) \ - ASSERT(0); - -#define _glthread_COND_SIGNAL(cond) \ - ASSERT(0); - -#define _glthread_COND_BROADCAST(cond) \ - ASSERT(0); - #endif /* PTHREADS */ @@ -245,12 +203,10 @@ typedef benaphore _glthread_Mutex; #endif /* BEOS_THREADS */ - -#ifndef THREADS - /* * THREADS not defined */ +#ifndef THREADS typedef unsigned _glthread_TSD; -- cgit v1.2.3 From 3b8ff24554253cf60bbbc8564c11008ff3866953 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Wed, 3 Mar 2010 21:22:38 +0200 Subject: glapi: minor cosmetic --- src/mesa/glapi/glthread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c index 17b6bb2b6a..f365d17bdd 100644 --- a/src/mesa/glapi/glthread.c +++ b/src/mesa/glapi/glthread.c @@ -139,7 +139,7 @@ _glthread_InitTSD(_glthread_TSD *tsd) { tsd->key = TlsAlloc(); if (tsd->key == TLS_OUT_OF_INDEXES) { - perror("Mesa:_glthread_InitTSD"); + perror(INIT_TSD_ERROR); InsteadOf_exit(-1); } tsd->initMagic = INIT_MAGIC; @@ -176,8 +176,8 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr) _glthread_InitTSD(tsd); } if (TlsSetValue(tsd->key, ptr) == 0) { - perror("Mesa:_glthread_SetTSD"); - InsteadOf_exit(-1); + perror(SET_TSD_ERROR); + InsteadOf_exit(-1); } } -- cgit v1.2.3 From a3593833dc2c14948c41654ed015c91634a78af3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 2 Mar 2010 10:27:51 -0800 Subject: i965: Fix up Sandybridge VS sizing. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index e0be3cc6e3..a7c4b58972 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -281,10 +281,12 @@ static void brw_vs_alloc_regs( struct brw_vs_compile *c ) */ attributes_in_vue = MAX2(c->nr_outputs, c->nr_inputs); - if (intel->is_ironlake || intel->gen >= 6) - c->prog_data.urb_entry_size = (attributes_in_vue + 6 + 3) / 4; + if (intel->gen >= 6) + c->prog_data.urb_entry_size = (attributes_in_vue + 4 + 7) / 8; + else if (intel->is_ironlake) + c->prog_data.urb_entry_size = (attributes_in_vue + 6 + 3) / 4; else - c->prog_data.urb_entry_size = (attributes_in_vue + 2 + 3) / 4; + c->prog_data.urb_entry_size = (attributes_in_vue + 2 + 3) / 4; c->prog_data.total_grf = reg; -- cgit v1.2.3 From 55e90e46e0f4f3f8b5da334d84fefb65b9b3d45b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 2 Mar 2010 10:41:08 -0800 Subject: intel: Use GTT mapping in the blit fallback path in case there's tiling. --- src/mesa/drivers/dri/intel/intel_blit.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 196a64a47a..1d099e7c47 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -122,21 +122,20 @@ intelEmitCopyBlit(struct intel_context *intel, intel_prepare_render(intel); if (pass >= 2) { - dri_bo_map(dst_buffer, GL_TRUE); - dri_bo_map(src_buffer, GL_FALSE); - _mesa_copy_rect((GLubyte *)dst_buffer->virtual + dst_offset, - cpp, - dst_pitch, - dst_x, dst_y, - w, h, - (GLubyte *)src_buffer->virtual + src_offset, - src_pitch, - src_x, src_y); - - dri_bo_unmap(src_buffer); - dri_bo_unmap(dst_buffer); - - return GL_TRUE; + intel_bo_map_gtt_preferred(intel, dst_buffer, GL_TRUE); + intel_bo_map_gtt_preferred(intel, src_buffer, GL_FALSE); + _mesa_copy_rect((GLubyte *)dst_buffer->virtual + dst_offset, + cpp, + dst_pitch, + dst_x, dst_y, + w, h, + (GLubyte *)src_buffer->virtual + src_offset, + src_pitch, + src_x, src_y); + intel_bo_unmap_gtt_preferred(intel, src_buffer); + intel_bo_unmap_gtt_preferred(intel, dst_buffer); + + return GL_TRUE; } intel_batchbuffer_require_space(intel->batch, 8 * 4); -- cgit v1.2.3 From 07439cf61717a3bde82745aa2acc878d7fd0133f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 2 Mar 2010 15:28:36 -0800 Subject: i915: Don't do the pitch expansion for tiled buffers. The weirdness that led to the bumping of pitch for those 512/1024 pixels is that in taking a 2x2 subspan or bilinear filtering we'd end up hitting the same channel in 2 different pages, leading to lower performance. With tiling, that doesn't occur, so we don't need to waste the memory. --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index cb5a341050..a20ea5afdb 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -238,11 +238,11 @@ int intel_miptree_pitch_align (struct intel_context *intel, pitch = ALIGN(pitch * mt->cpp, pitch_align); #ifdef I915 - /* XXX: At least the i915 seems very upset when the pitch is a multiple - * of 1024 and sometimes 512 bytes - performance can drop by several - * times. Go to the next multiple of the required alignment for now. + /* Do a little adjustment to linear allocations so that we avoid + * hitting the same channel of memory for 2 different pages when + * reading a 2x2 subspan or doing bilinear filtering. */ - if (!(pitch & 511) && + if (tiling == I915_TILING_NONE && !(pitch & 511) && (pitch + pitch_align) < (1 << ctx->Const.MaxTextureLevels)) pitch += pitch_align; #endif -- cgit v1.2.3 From 179d2c0e0bcf96fc40107882ccab909af8c89853 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 2 Mar 2010 15:34:17 -0800 Subject: intel: Use drm_intel_bo_alloc_tiled for region allocs. This moves the logic for how to align pitches, heights, and sizes of objects to one central location. Fixes rendering with texture tiling on i915. Note that current libdrm is required for the change for I915_TILING_NONE pitch alignment. --- configure.ac | 2 +- src/mesa/drivers/dri/intel/intel_regions.c | 39 +++++++++--------------------- 2 files changed, 12 insertions(+), 29 deletions(-) (limited to 'src') diff --git a/configure.ac b/configure.ac index d108ecdad2..e807d4acaf 100644 --- a/configure.ac +++ b/configure.ac @@ -804,7 +804,7 @@ AC_SUBST([DRI_LIB_DEPS]) case $DRI_DIRS in *i915*|*i965*) - PKG_CHECK_MODULES([INTEL], [libdrm_intel]) + PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.19]) ;; esac diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index f63d3a4082..e3c0635e5b 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -180,36 +180,19 @@ intel_region_alloc(struct intel_context *intel, { dri_bo *buffer; struct intel_region *region; + unsigned long flags = 0; + unsigned long aligned_pitch; - /* If we're tiled, our allocations are in 8 or 32-row blocks, so - * failure to align our height means that we won't allocate enough pages. - * - * If we're untiled, we still have to align to 2 rows high because the - * data port accesses 2x2 blocks even if the bottom row isn't to be - * rendered, so failure to align means we could walk off the end of the - * GTT and fault. - */ - if (tiling == I915_TILING_X) - height = ALIGN(height, 8); - else if (tiling == I915_TILING_Y) - height = ALIGN(height, 32); - else - height = ALIGN(height, 2); - - /* If we're untiled, we have to align to 2 rows high because the - * data port accesses 2x2 blocks even if the bottom row isn't to be - * rendered, so failure to align means we could walk off the end of the - * GTT and fault. + if (expect_accelerated_upload) + flags |= BO_ALLOC_FOR_RENDER; + + buffer = drm_intel_bo_alloc_tiled(intel->bufmgr, "region", + width, height, cpp, + &tiling, &aligned_pitch, flags); + /* We've already chosen a pitch as part of miptree layout. It had + * better be the same. */ - height = ALIGN(height, 2); - - if (expect_accelerated_upload) { - buffer = drm_intel_bo_alloc_for_render(intel->bufmgr, "region", - pitch * cpp * height, 64); - } else { - buffer = drm_intel_bo_alloc(intel->bufmgr, "region", - pitch * cpp * height, 64); - } + assert(aligned_pitch == pitch * cpp); region = intel_region_alloc_internal(intel, cpp, width, height, pitch, buffer); -- cgit v1.2.3 From 06d1472ffa0648efa9374fa227894fbf0b0be054 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 2 Mar 2010 18:04:40 -0800 Subject: i915: Tell the kernel when we actually need fence registers on our BOs. This improves tiled texture performance of OA on my 945 from 25.3fps to 29.0fps, whereas untiled is 28.2fps, by avoiding stalls for fence register changes. --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 25 +++++++++++++++++++++++++ src/mesa/drivers/dri/intel/intel_batchbuffer.h | 10 ++++++++++ src/mesa/drivers/dri/intel/intel_blit.c | 24 ++++++++++++------------ src/mesa/drivers/dri/intel/intel_screen.c | 2 ++ 4 files changed, 49 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index e38f10ebc6..a7bfd62b28 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -226,6 +226,31 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, return GL_TRUE; } +GLboolean +intel_batchbuffer_emit_reloc_fenced(struct intel_batchbuffer *batch, + drm_intel_bo *buffer, + uint32_t read_domains, uint32_t write_domain, + uint32_t delta) +{ + int ret; + + if (batch->ptr - batch->map > batch->buf->size) + printf ("bad relocation ptr %p map %p offset %d size %lu\n", + batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); + ret = drm_intel_bo_emit_reloc_fence(batch->buf, batch->ptr - batch->map, + buffer, delta, + read_domains, write_domain); + + /* + * Using the old buffer offset, write in what the right data would + * be, in case the buffer doesn't move and we can short-circuit the + * relocation processing in the kernel + */ + intel_batchbuffer_emit_dword (batch, buffer->offset + delta); + + return GL_TRUE; +} + void intel_batchbuffer_data(struct intel_batchbuffer *batch, const void *data, GLuint bytes) diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 4daada205a..79bdbc17ae 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -64,6 +64,11 @@ GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, uint32_t read_domains, uint32_t write_domain, uint32_t offset); +GLboolean intel_batchbuffer_emit_reloc_fenced(struct intel_batchbuffer *batch, + drm_intel_bo *buffer, + uint32_t read_domains, + uint32_t write_domain, + uint32_t offset); void intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch); /* Inline functions - might actually be better off with these @@ -127,6 +132,11 @@ static INLINE uint32_t float_as_int(float f) intel_batchbuffer_emit_reloc(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0) +#define OUT_RELOC_FENCED(buf, read_domains, write_domain, delta) do { \ + assert((unsigned) (delta) < buf->size); \ + intel_batchbuffer_emit_reloc_fenced(intel->batch, buf, \ + read_domains, write_domain, delta); \ +} while (0) #define ADVANCE_BATCH() do { \ unsigned int _n = intel->batch->ptr - intel->batch->emit.start_ptr; \ diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 1d099e7c47..6d6af86347 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -188,14 +188,14 @@ intelEmitCopyBlit(struct intel_context *intel, OUT_BATCH(BR13 | (uint16_t)dst_pitch); OUT_BATCH((dst_y << 16) | dst_x); OUT_BATCH((dst_y2 << 16) | dst_x2); - OUT_RELOC(dst_buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - dst_offset); + OUT_RELOC_FENCED(dst_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + dst_offset); OUT_BATCH((src_y << 16) | src_x); OUT_BATCH((uint16_t)src_pitch); - OUT_RELOC(src_buffer, - I915_GEM_DOMAIN_RENDER, 0, - src_offset); + OUT_RELOC_FENCED(src_buffer, + I915_GEM_DOMAIN_RENDER, 0, + src_offset); ADVANCE_BATCH(); intel_batchbuffer_emit_mi_flush(intel->batch); @@ -365,9 +365,9 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) OUT_BATCH(BR13); OUT_BATCH((y1 << 16) | x1); OUT_BATCH((y2 << 16) | x2); - OUT_RELOC(write_buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - 0); + OUT_RELOC_FENCED(write_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + 0); OUT_BATCH(clear_val); ADVANCE_BATCH(); @@ -448,9 +448,9 @@ intelEmitImmediateColorExpandBlit(struct intel_context *intel, OUT_BATCH(br13); OUT_BATCH((0 << 16) | 0); /* clip x1, y1 */ OUT_BATCH((100 << 16) | 100); /* clip x2, y2 */ - OUT_RELOC(dst_buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - dst_offset); + OUT_RELOC_FENCED(dst_buffer, + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, + dst_offset); OUT_BATCH(0); /* bg */ OUT_BATCH(fg_color); /* fg */ OUT_BATCH(0); /* pattern base addr */ diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index bc394d048e..a42af71104 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -426,6 +426,8 @@ intel_init_bufmgr(struct intel_screen *intelScreen) else intelScreen->kernel_exec_fencing = GL_FALSE; + drm_intel_bufmgr_gem_enable_fenced_relocs(intelScreen->bufmgr); + intelScreen->named_regions = _mesa_NewHashTable(); return GL_TRUE; -- cgit v1.2.3 From b87406e55f029d29594ae76a4b39a4fe1007fe4f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 2 Mar 2010 18:06:24 -0800 Subject: i915: Use x,y drawing offsets instead of changing buffer offsets. This should fix rendering into mipmaps of tiled textures. --- src/mesa/drivers/dri/i915/i915_context.h | 1 + src/mesa/drivers/dri/i915/i915_vtbl.c | 50 ++++++++++++++++++++++++-------- src/mesa/drivers/dri/i915/intel_tris.c | 2 ++ 3 files changed, 41 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index 60b357ec28..b5169280f6 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -40,6 +40,7 @@ #define I915_FALLBACK_POLYGON_SMOOTH 0x40000 #define I915_FALLBACK_POINT_SMOOTH 0x80000 #define I915_FALLBACK_POINT_SPRITE_COORD_ORIGIN 0x100000 +#define I915_FALLBACK_DRAW_OFFSET 0x200000 #define I915_UPLOAD_CTX 0x1 #define I915_UPLOAD_BUFFERS 0x2 diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 30aaab78c8..0a93e64b1f 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -378,15 +378,13 @@ i915_emit_state(struct intel_context *intel) OUT_BATCH(state->Buffer[I915_DESTREG_CBUFADDR0]); OUT_BATCH(state->Buffer[I915_DESTREG_CBUFADDR1]); OUT_RELOC(state->draw_region->buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - state->draw_region->draw_offset); + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); if (state->depth_region) { OUT_BATCH(state->Buffer[I915_DESTREG_DBUFADDR0]); OUT_BATCH(state->Buffer[I915_DESTREG_DBUFADDR1]); OUT_RELOC(state->depth_region->buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - state->depth_region->draw_offset); + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); } OUT_BATCH(state->Buffer[I915_DESTREG_DV0]); @@ -534,6 +532,7 @@ i915_set_draw_region(struct intel_context *intel, struct intel_renderbuffer *irb = intel_renderbuffer(rb); GLuint value; struct i915_hw_state *state = &i915->state; + uint32_t draw_x, draw_y; if (state->draw_region != color_regions[0]) { intel_region_release(&state->draw_region); @@ -596,14 +595,41 @@ i915_set_draw_region(struct intel_context *intel, } state->Buffer[I915_DESTREG_DV1] = value; - state->Buffer[I915_DESTREG_DRAWRECT0] = _3DSTATE_DRAWRECT_INFO; - state->Buffer[I915_DESTREG_DRAWRECT1] = 0; - state->Buffer[I915_DESTREG_DRAWRECT2] = 0; /* xmin, ymin */ - state->Buffer[I915_DESTREG_DRAWRECT3] = - (ctx->DrawBuffer->Width & 0xffff) | - (ctx->DrawBuffer->Height << 16); - state->Buffer[I915_DESTREG_DRAWRECT4] = 0; /* xoff, yoff */ - state->Buffer[I915_DESTREG_DRAWRECT5] = 0; + /* We set up the drawing rectangle to be offset into the color + * region's location in the miptree. If it doesn't match with + * depth's offsets, we can't render to it. + * + * (Well, not actually true -- the hw grew a bit to let depth's + * offset get forced to 0,0. We may want to use that if people are + * hitting that case. Also, some configurations may be supportable + * by tweaking the start offset of the buffers around, which we + * can't do in general due to tiling) + */ + FALLBACK(intel, I915_FALLBACK_DRAW_OFFSET, + (depth_region && color_regions[0]) && + (depth_region->draw_x != color_regions[0]->draw_x || + depth_region->draw_y != color_regions[0]->draw_y)); + + if (color_regions[0]) { + draw_x = color_regions[0]->draw_x; + draw_y = color_regions[0]->draw_y; + } else if (depth_region) { + draw_x = depth_region->draw_x; + draw_y = depth_region->draw_y; + } else { + draw_x = 0; + draw_y = 0; + } + + /* When changing drawing rectangle offset, an MI_FLUSH is first required. */ + state->Buffer[I915_DESTREG_DRAWRECT0] = MI_FLUSH; + state->Buffer[I915_DESTREG_DRAWRECT1] = _3DSTATE_DRAWRECT_INFO; + state->Buffer[I915_DESTREG_DRAWRECT2] = 0; + state->Buffer[I915_DESTREG_DRAWRECT3] = (draw_y << 16) | draw_x; + state->Buffer[I915_DESTREG_DRAWRECT4] = + ((ctx->DrawBuffer->Width + draw_x) & 0xffff) | + ((ctx->DrawBuffer->Height + draw_y) << 16); + state->Buffer[I915_DESTREG_DRAWRECT5] = (draw_y << 16) | draw_x; I915_STATECHANGE(i915, I915_UPLOAD_BUFFERS); } diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index 0afbda2436..e63cd97db6 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1177,6 +1177,8 @@ static char *fallbackStrings[] = { [17] = "Logic op", [18] = "Smooth polygon", [19] = "Smooth point", + [20] = "point sprite coord origin", + [21] = "depth/color drawing offset", }; -- cgit v1.2.3 From 4d5dd82558fcf1f6fcfdb95b225a4e3f842a9133 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 18:47:29 +0000 Subject: llvmpipe: Ensure context is flushed when destroying shaders. --- src/gallium/drivers/llvmpipe/lp_state_fs.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 90dae3f910..c4b79dd415 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -974,6 +974,13 @@ llvmpipe_delete_fs_state(struct pipe_context *pipe, void *fs) assert(fs != llvmpipe->fs); (void) llvmpipe; + /* + * XXX: we need to flush the context until we have some sort of reference + * counting in fragment shaders as they may still be binned + */ + draw_flush(llvmpipe->draw); + lp_setup_flush(llvmpipe->setup, 0); + variant = shader->variants; while(variant) { struct lp_fragment_shader_variant *next = variant->next; -- cgit v1.2.3 From 4053d337035a17c3bded6458093acf56d1878cba Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 3 Mar 2010 19:55:31 +0000 Subject: llvmpipe: Store the original triangle coordinates in the debug build. For debugging purposes only. --- src/gallium/drivers/llvmpipe/lp_rast.h | 4 ++++ src/gallium/drivers/llvmpipe/lp_setup_tri.c | 9 +++++++++ 2 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.h b/src/gallium/drivers/llvmpipe/lp_rast.h index d91c45eb2b..dc5fc5fc7d 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.h +++ b/src/gallium/drivers/llvmpipe/lp_rast.h @@ -98,6 +98,10 @@ struct lp_rast_shader_inputs { * Objects of this type are put into the setup_context::data buffer. */ struct lp_rast_triangle { +#ifdef DEBUG + float v[3][2]; +#endif + /* one-pixel sized trivial accept offsets for each plane */ int ei1; int ei2; diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c index a8bf540803..e75412ac9a 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c @@ -297,6 +297,15 @@ do_triangle_ccw(struct setup_context *setup, tri = alloc_triangle(scene, setup->fs.nr_inputs, &tri_bytes); +#ifdef DEBUG + tri->v[0][0] = v1[0][0]; + tri->v[1][0] = v2[0][0]; + tri->v[2][0] = v3[0][0]; + tri->v[0][1] = v1[0][1]; + tri->v[1][1] = v2[0][1]; + tri->v[2][1] = v3[0][1]; +#endif + tri->dx12 = x1 - x2; tri->dx23 = x2 - x3; tri->dx31 = x3 - x1; -- cgit v1.2.3 From d82e1d7f95bf1fe2be9bc2ac5a2880401a8dc01c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 14:55:25 -0800 Subject: swrast: Remove support for DrawPixels into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_drawpix.c | 81 ++------------------------------------------- 1 file changed, 2 insertions(+), 79 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 7571d5b8c0..3cec3a7a2b 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -267,7 +267,7 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, if (format == GL_COLOR_INDEX && type == GL_UNSIGNED_BYTE) { const GLubyte *src = (const GLubyte *) pixels + unpack.SkipRows * unpack.RowLength + unpack.SkipPixels; - if (ctx->Visual.rgbMode && rbType == GL_UNSIGNED_BYTE) { + if (rbType == GL_UNSIGNED_BYTE) { /* convert ubyte/CI data to ubyte/RGBA */ if (simpleZoom) { GLint row; @@ -299,22 +299,6 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, } return GL_TRUE; } - else if (!ctx->Visual.rgbMode && rbType == GL_UNSIGNED_INT) { - /* write CI data to CI frame buffer */ - GLint row; - if (simpleZoom) { - for (row = 0; row < drawHeight; row++) { - GLuint index32[MAX_WIDTH]; - GLint col; - for (col = 0; col < drawWidth; col++) - index32[col] = src[col]; - rb->PutRow(ctx, rb, drawWidth, destX, destY, index32, NULL); - src += unpack.RowLength; - destY += yStep; - } - return GL_TRUE; - } - } } /* can't handle this pixel format and/or data type */ @@ -323,57 +307,6 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, -/* - * Draw color index image. - */ -static void -draw_index_pixels( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels ) -{ - const GLint imgX = x, imgY = y; - const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; - GLint row, skipPixels; - SWspan span; - - INIT_SPAN(span, GL_BITMAP); - span.arrayMask = SPAN_INDEX; - _swrast_span_default_attribs(ctx, &span); - - /* - * General solution - */ - skipPixels = 0; - while (skipPixels < width) { - const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); - ASSERT(spanWidth <= MAX_WIDTH); - for (row = 0; row < height; row++) { - const GLvoid *source = _mesa_image_address2d(unpack, pixels, - width, height, - GL_COLOR_INDEX, type, - row, skipPixels); - _mesa_unpack_index_span(ctx, spanWidth, GL_UNSIGNED_INT, - span.array->index, type, source, unpack, - ctx->_ImageTransferState); - - /* These may get changed during writing/clipping */ - span.x = x + skipPixels; - span.y = y + row; - span.end = spanWidth; - - if (zoom) - _swrast_write_zoomed_index_span(ctx, imgX, imgY, &span); - else - _swrast_write_index_span(ctx, &span); - } - skipPixels += spanWidth; - } -} - - - /* * Draw stencil image. */ @@ -441,7 +374,6 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, && ctx->DrawBuffer->Visual.depthBits == 16 && !scaleOrBias && !zoom - && ctx->Visual.rgbMode && width <= MAX_WIDTH && !unpack->SwapBytes) { /* Special case: directly write 16-bit depth values */ @@ -462,7 +394,6 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, else if (type == GL_UNSIGNED_INT && !scaleOrBias && !zoom - && ctx->Visual.rgbMode && width <= MAX_WIDTH && !unpack->SwapBytes) { /* Special case: shift 32-bit values down to Visual.depthBits */ @@ -515,11 +446,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, if (zoom) { _swrast_write_zoomed_depth_span(ctx, x, y, &span); } - else if (ctx->Visual.rgbMode) { - _swrast_write_rgba_span(ctx, &span); - } else { - _swrast_write_index_span(ctx, &span); + _swrast_write_rgba_span(ctx, &span); } } skipPixels += spanWidth; @@ -867,11 +795,6 @@ _swrast_DrawPixels( GLcontext *ctx, draw_depth_pixels( ctx, x, y, width, height, type, unpack, pixels ); break; case GL_COLOR_INDEX: - if (ctx->Visual.rgbMode) - draw_rgba_pixels(ctx, x,y, width, height, format, type, unpack, pixels); - else - draw_index_pixels(ctx, x, y, width, height, type, unpack, pixels); - break; case GL_RED: case GL_GREEN: case GL_BLUE: -- cgit v1.2.3 From e7e748cd04f5f014a1e4d8837ee7590d68115768 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:02:59 -0800 Subject: swrast: Remove support for CopyPixels to / from a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_copypix.c | 117 ++------------------------------------------ 1 file changed, 5 insertions(+), 112 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c index 3f37c027e4..f4f0c8a330 100644 --- a/src/mesa/swrast/s_copypix.c +++ b/src/mesa/swrast/s_copypix.c @@ -307,100 +307,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy, } -static void -copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy, - GLint width, GLint height, - GLint destx, GLint desty ) -{ - GLuint *tmpImage,*p; - GLint sy, dy, stepy; - GLint j; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F; - GLint overlapping; - SWspan span; - - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - - INIT_SPAN(span, GL_BITMAP); - _swrast_span_default_attribs(ctx, &span); - span.arrayMask = SPAN_INDEX; - - if (ctx->DrawBuffer == ctx->ReadBuffer) { - overlapping = regions_overlap(srcx, srcy, destx, desty, width, height, - ctx->Pixel.ZoomX, ctx->Pixel.ZoomY); - } - else { - overlapping = GL_FALSE; - } - - /* Determine if copy should be bottom-to-top or top-to-bottom */ - if (!overlapping && srcy < desty) { - /* top-down max-to-min */ - sy = srcy + height - 1; - dy = desty + height - 1; - stepy = -1; - } - else { - /* bottom-up min-to-max */ - sy = srcy; - dy = desty; - stepy = 1; - } - - if (overlapping) { - GLint ssy = sy; - tmpImage = (GLuint *) malloc(width * height * sizeof(GLuint)); - if (!tmpImage) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyPixels" ); - return; - } - /* read the image */ - p = tmpImage; - for (j = 0; j < height; j++, ssy += stepy) { - _swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, ssy, p ); - p += width; - } - p = tmpImage; - } - else { - tmpImage = NULL; /* silence compiler warning */ - p = NULL; - } - - for (j = 0; j < height; j++, sy += stepy, dy += stepy) { - /* Get color indexes */ - if (overlapping) { - memcpy(span.array->index, p, width * sizeof(GLuint)); - p += width; - } - else { - _swrast_read_index_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, srcx, sy, span.array->index ); - } - - if (ctx->_ImageTransferState) - _mesa_apply_ci_transfer_ops(ctx, ctx->_ImageTransferState, - width, span.array->index); - - /* write color indexes */ - span.x = destx; - span.y = dy; - span.end = width; - if (zoom) - _swrast_write_zoomed_index_span(ctx, destx, desty, &span); - else - _swrast_write_index_span(ctx, &span); - } - - if (overlapping) - free(tmpImage); -} - - /** * Convert floating point Z values to integer Z values with pixel transfer's * Z scale and bias. @@ -522,18 +428,10 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy, span.x = destx; span.y = dy; span.end = width; - if (fb->Visual.rgbMode) { - if (zoom) - _swrast_write_zoomed_depth_span(ctx, destx, desty, &span); - else - _swrast_write_rgba_span(ctx, &span); - } - else { - if (zoom) - _swrast_write_zoomed_depth_span(ctx, destx, desty, &span); - else - _swrast_write_index_span(ctx, &span); - } + if (zoom) + _swrast_write_zoomed_depth_span(ctx, destx, desty, &span); + else + _swrast_write_rgba_span(ctx, &span); } if (overlapping) @@ -909,12 +807,7 @@ _swrast_CopyPixels( GLcontext *ctx, if (!fast_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, type)) { switch (type) { case GL_COLOR: - if (ctx->Visual.rgbMode) { - copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty ); - } - else { - copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty ); - } + copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty ); break; case GL_DEPTH: copy_depth_pixels( ctx, srcx, srcy, width, height, destx, desty ); -- cgit v1.2.3 From ef0e02f93d5969e6659f5e41dd572c2db8e20044 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:11:04 -0800 Subject: swrast: Remove _swrast_write_zoomed_index_span and associated code After removing support for CopyPixels and DrawPixels involving color-index buffers, _swrast_write_zoomed_index_span is no longer used. Removed it and all the support for COLOR_INDEX formats in zoom_span. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_zoom.c | 48 ++---------------------------------------------- src/mesa/swrast/s_zoom.h | 4 ---- 2 files changed, 2 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c index bec16208e3..f224627d50 100644 --- a/src/mesa/swrast/s_zoom.c +++ b/src/mesa/swrast/s_zoom.c @@ -185,15 +185,6 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */ ASSERT(span->arrayMask & SPAN_RGBA); } - else if (format == GL_COLOR_INDEX) { - /* copy Z info */ - zoomed.z = span->z; - zoomed.zStep = span->zStep; - /* we'll generate an array of color indexes */ - zoomed.interpMask = span->interpMask & ~SPAN_INDEX; - zoomed.arrayMask |= SPAN_INDEX; - ASSERT(span->arrayMask & SPAN_INDEX); - } else if (format == GL_DEPTH_COMPONENT) { /* Copy color info */ zoomed.red = span->red; @@ -288,16 +279,6 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, } } } - else if (format == GL_COLOR_INDEX) { - const GLuint *indexes = (const GLuint *) src; - GLint i; - for (i = 0; i < zoomedWidth; i++) { - GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; - ASSERT(j >= 0); - ASSERT(j < (GLint) span->end); - zoomed.array->index[i] = indexes[j]; - } - } else if (format == GL_DEPTH_COMPONENT) { const GLuint *zValues = (const GLuint *) src; GLint i; @@ -307,8 +288,8 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, ASSERT(j < (GLint) span->end); zoomed.array->z[i] = zValues[j]; } - /* Now, fall into either the RGB or COLOR_INDEX path below */ - format = ctx->Visual.rgbMode ? GL_RGBA : GL_COLOR_INDEX; + /* Now, fall into the RGB path below */ + format = GL_RGBA; } /* write the span in rows [r0, r1) */ @@ -335,22 +316,6 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, } } } - else if (format == GL_COLOR_INDEX) { - /* use specular color array for temp storage */ - GLuint *indexSave = (GLuint *) zoomed.array->attribs[FRAG_ATTRIB_FOGC]; - const GLint end = zoomed.end; /* save */ - if (y1 - y0 > 1) { - memcpy(indexSave, zoomed.array->index, zoomed.end * sizeof(GLuint)); - } - for (zoomed.y = y0; zoomed.y < y1; zoomed.y++) { - _swrast_write_index_span(ctx, &zoomed); - zoomed.end = end; /* restore */ - if (y1 - y0 > 1) { - /* restore the colors */ - memcpy(zoomed.array->index, indexSave, zoomed.end * sizeof(GLuint)); - } - } - } } @@ -370,15 +335,6 @@ _swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, } -void -_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span) -{ - zoom_span(ctx, imgX, imgY, span, - (const GLvoid *) span->array->index, GL_COLOR_INDEX); -} - - void _swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span) diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h index d2815b41a0..43917be65f 100644 --- a/src/mesa/swrast/s_zoom.h +++ b/src/mesa/swrast/s_zoom.h @@ -36,10 +36,6 @@ extern void _swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span, const GLvoid *rgb); -extern void -_swrast_write_zoomed_index_span(GLcontext *ctx, GLint imgX, GLint imgY, - const SWspan *span); - extern void _swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span); -- cgit v1.2.3 From d05badba291ce4444b6aaabfd577bdbcf7929193 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:15:01 -0800 Subject: swrast: Remove support for Bitmap into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_bitmap.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c index 59e26e9ea3..da730213ac 100644 --- a/src/mesa/swrast/s_bitmap.c +++ b/src/mesa/swrast/s_bitmap.c @@ -125,10 +125,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, if (count + width >= MAX_WIDTH || row + 1 == height) { /* flush the span */ span.end = count; - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, &span); - else - _swrast_write_index_span(ctx, &span); + _swrast_write_rgba_span(ctx, &span); span.end = 0; count = 0; } @@ -192,10 +189,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, } } - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, &span); - else - _swrast_write_index_span(ctx, &span); + _swrast_write_rgba_span(ctx, &span); /* get ready for next row */ if (mask != 1) @@ -215,10 +209,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py, } } - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, &span); - else - _swrast_write_index_span(ctx, &span); + _swrast_write_rgba_span(ctx, &span); /* get ready for next row */ if (mask != 128) -- cgit v1.2.3 From 0ed9c4bc7affb7a6b9be5ff129815fccf8c3885d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:17:30 -0800 Subject: swrast: Remove support for rendering triangles into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_triangle.c | 29 ++++--------------------- src/mesa/swrast/s_tritemp.h | 50 -------------------------------------------- 2 files changed, 4 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 11184b72ce..812dddf15c 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -69,18 +69,6 @@ _swrast_culltriangle( GLcontext *ctx, -/* - * Render a smooth or flat-shaded color index triangle. - */ -#define NAME ci_triangle -#define INTERP_Z 1 -#define INTERP_ATTRIBS 1 /* just for fog */ -#define INTERP_INDEX 1 -#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span); -#include "s_tritemp.h" - - - /* * Render a flat-shaded RGBA triangle. */ @@ -1007,7 +995,6 @@ void _swrast_choose_triangle( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean rgbmode = ctx->Visual.rgbMode; if (ctx->Polygon.CullFlag && ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) { @@ -1029,23 +1016,15 @@ _swrast_choose_triangle( GLcontext *ctx ) ctx->Depth.Mask == GL_FALSE && ctx->Depth.Func == GL_LESS && !ctx->Stencil._Enabled) { - if ((rgbmode && - ctx->Color.ColorMask[0][0] == 0 && - ctx->Color.ColorMask[0][1] == 0 && - ctx->Color.ColorMask[0][2] == 0 && - ctx->Color.ColorMask[0][3] == 0) - || - (!rgbmode && ctx->Color.IndexMask == 0)) { + if (ctx->Color.ColorMask[0][0] == 0 && + ctx->Color.ColorMask[0][1] == 0 && + ctx->Color.ColorMask[0][2] == 0 && + ctx->Color.ColorMask[0][3] == 0) { USE(occlusion_zless_triangle); return; } } - if (!rgbmode) { - USE(ci_triangle); - return; - } - /* * XXX should examine swrast->_ActiveAttribMask to determine what * needs to be interpolated. diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h index 8e3c5b5eeb..0aa8739f4f 100644 --- a/src/mesa/swrast/s_tritemp.h +++ b/src/mesa/swrast/s_tritemp.h @@ -32,7 +32,6 @@ * INTERP_Z - if defined, interpolate integer Z values * INTERP_RGB - if defined, interpolate integer RGB values * INTERP_ALPHA - if defined, interpolate integer Alpha values - * INTERP_INDEX - if defined, interpolate color index values * INTERP_INT_TEX - if defined, interpolate integer ST texcoords * (fast, simple 2-D texture mapping, without * perspective correction) @@ -319,9 +318,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, { GLint scan_from_left_to_right; /* true if scanning left-to-right */ -#ifdef INTERP_INDEX - GLfloat didx, didy; -#endif /* * Execute user-supplied setup code @@ -398,21 +394,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, # endif } #endif /* INTERP_RGB */ -#ifdef INTERP_INDEX - span.interpMask |= SPAN_INDEX; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - GLfloat eMaj_di = vMax->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0]; - GLfloat eBot_di = vMid->attrib[FRAG_ATTRIB_CI][0] - vMin->attrib[FRAG_ATTRIB_CI][0]; - didx = oneOverArea * (eMaj_di * eBot.dy - eMaj.dy * eBot_di); - didy = oneOverArea * (eMaj.dx * eBot_di - eMaj_di * eBot.dx); - span.indexStep = SignedFloatToFixed(didx); - } - else { - span.interpMask |= SPAN_FLAT; - didx = didy = 0.0F; - span.indexStep = 0; - } -#endif #ifdef INTERP_INT_TEX { GLfloat eMaj_ds = (vMax->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE; @@ -531,9 +512,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA GLint aLeft = 0, fdaOuter = 0, fdaInner; #endif -#ifdef INTERP_INDEX - GLfixed iLeft=0, diOuter=0, diInner; -#endif #ifdef INTERP_INT_TEX GLfixed sLeft=0, dsOuter=0, dsInner; GLfixed tLeft=0, dtOuter=0, dtInner; @@ -697,18 +675,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #endif /* INTERP_RGB */ -#ifdef INTERP_INDEX - if (ctx->Light.ShadeModel == GL_SMOOTH) { - iLeft = (GLfixed)(vLower->attrib[FRAG_ATTRIB_CI][0] * FIXED_SCALE - + didx * adjx + didy * adjy) + FIXED_HALF; - diOuter = SignedFloatToFixed(didy + dxOuter * didx); - } - else { - ASSERT(ctx->Light.ShadeModel == GL_FLAT); - iLeft = FloatToFixed(v2->attrib[FRAG_ATTRIB_CI][0]); - diOuter = 0; - } -#endif #ifdef INTERP_INT_TEX { GLfloat s0, t0; @@ -784,9 +750,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA fdaInner = fdaOuter + span.alphaStep; #endif -#ifdef INTERP_INDEX - diInner = diOuter + span.indexStep; -#endif #ifdef INTERP_INT_TEX dsInner = dsOuter + span.intTexStep[0]; dtInner = dtOuter + span.intTexStep[1]; @@ -822,9 +785,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA span.alpha = aLeft; #endif -#ifdef INTERP_INDEX - span.index = iLeft; -#endif #ifdef INTERP_INT_TEX span.intTex[0] = sLeft; span.intTex[1] = tLeft; @@ -854,9 +814,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #endif #ifdef INTERP_ALPHA CLAMP_INTERPOLANT(alpha, alphaStep, len); -#endif -#ifdef INTERP_INDEX - CLAMP_INTERPOLANT(index, indexStep, len); #endif { RENDER_SPAN( span ); @@ -896,9 +853,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA aLeft += fdaOuter; #endif -#ifdef INTERP_INDEX - iLeft += diOuter; -#endif #ifdef INTERP_INT_TEX sLeft += dsOuter; tLeft += dtOuter; @@ -931,9 +885,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #ifdef INTERP_ALPHA aLeft += fdaInner; #endif -#ifdef INTERP_INDEX - iLeft += diInner; -#endif #ifdef INTERP_INT_TEX sLeft += dsInner; tLeft += dtInner; @@ -967,7 +918,6 @@ static void NAME(GLcontext *ctx, const SWvertex *v0, #undef INTERP_Z #undef INTERP_RGB #undef INTERP_ALPHA -#undef INTERP_INDEX #undef INTERP_INT_TEX #undef INTERP_ATTRIBS -- cgit v1.2.3 From dbe901ceb01e48ba7d79fd9245b9d339ef17c692 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:20:11 -0800 Subject: swrast: Remove support for rendering points into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_points.c | 56 +++++++++++++--------------------------------- 1 file changed, 16 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index a9a704a16e..1663ece829 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -244,7 +244,6 @@ static void smooth_point(GLcontext *ctx, const SWvertex *vert) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean ciMode = !ctx->Visual.rgbMode; SWspan span; GLfloat size, alphaAtten; @@ -335,10 +334,6 @@ smooth_point(GLcontext *ctx, const SWvertex *vert) if (dist2 >= rmin2) { /* compute partial coverage */ coverage = 1.0F - (dist2 - rmin2) * cscale; - if (ciMode) { - /* coverage in [0,15] */ - coverage *= 15.0; - } } else { /* full coverage */ @@ -369,7 +364,6 @@ static void large_point(GLcontext *ctx, const SWvertex *vert) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean ciMode = !ctx->Visual.rgbMode; SWspan span; GLfloat size; @@ -389,22 +383,15 @@ large_point(GLcontext *ctx, const SWvertex *vert) span.arrayMask = SPAN_XY; span.facing = swrast->PointLineFacing; - if (ciMode) { - span.interpMask = SPAN_Z | SPAN_INDEX; - span.index = FloatToFixed(vert->attrib[FRAG_ATTRIB_CI][0]); - span.indexStep = 0; - } - else { - span.interpMask = SPAN_Z | SPAN_RGBA; - span.red = ChanToFixed(vert->color[0]); - span.green = ChanToFixed(vert->color[1]); - span.blue = ChanToFixed(vert->color[2]); - span.alpha = ChanToFixed(vert->color[3]); - span.redStep = 0; - span.greenStep = 0; - span.blueStep = 0; - span.alphaStep = 0; - } + span.interpMask = SPAN_Z | SPAN_RGBA; + span.red = ChanToFixed(vert->color[0]); + span.green = ChanToFixed(vert->color[1]); + span.blue = ChanToFixed(vert->color[2]); + span.alpha = ChanToFixed(vert->color[3]); + span.redStep = 0; + span.greenStep = 0; + span.blueStep = 0; + span.alphaStep = 0; /* need these for fragment programs */ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; @@ -466,7 +453,6 @@ static void pixel_point(GLcontext *ctx, const SWvertex *vert) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean ciMode = !ctx->Visual.rgbMode; /* * Note that unlike the other functions, we put single-pixel points * into a special span array in order to render as many points as @@ -480,10 +466,7 @@ pixel_point(GLcontext *ctx, const SWvertex *vert) /* Span init */ span->interpMask = 0; span->arrayMask = SPAN_XY | SPAN_Z; - if (ciMode) - span->arrayMask |= SPAN_INDEX; - else - span->arrayMask |= SPAN_RGBA; + span->arrayMask |= SPAN_RGBA; /*span->arrayMask |= SPAN_LAMBDA;*/ span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */ @@ -497,10 +480,7 @@ pixel_point(GLcontext *ctx, const SWvertex *vert) (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT)) || span->facing != swrast->PointLineFacing) { if (span->end > 0) { - if (ciMode) - _swrast_write_index_span(ctx, span); - else - _swrast_write_rgba_span(ctx, span); + _swrast_write_rgba_span(ctx, span); span->end = 0; } } @@ -510,15 +490,11 @@ pixel_point(GLcontext *ctx, const SWvertex *vert) span->facing = swrast->PointLineFacing; /* fragment attributes */ - if (ciMode) { - span->array->index[count] = (GLuint) vert->attrib[FRAG_ATTRIB_CI][0]; - } - else { - span->array->rgba[count][RCOMP] = vert->color[0]; - span->array->rgba[count][GCOMP] = vert->color[1]; - span->array->rgba[count][BCOMP] = vert->color[2]; - span->array->rgba[count][ACOMP] = vert->color[3]; - } + span->array->rgba[count][RCOMP] = vert->color[0]; + span->array->rgba[count][GCOMP] = vert->color[1]; + span->array->rgba[count][BCOMP] = vert->color[2]; + span->array->rgba[count][ACOMP] = vert->color[3]; + ATTRIB_LOOP_BEGIN COPY_4V(span->array->attribs[attr][count], vert->attrib[attr]); ATTRIB_LOOP_END -- cgit v1.2.3 From e6df80184b0c7e83eba382b3161ba11db497c55d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:22:56 -0800 Subject: swrast: Remove support for rendering lines into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_lines.c | 48 +++++--------------------------------------- src/mesa/swrast/s_linetemp.h | 18 ----------------- 2 files changed, 5 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index cff36042cb..7db5af4ae1 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -87,10 +87,7 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) for (i = 0; i < span->end; i++) y[i]++; } - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, span); - else - _swrast_write_index_span(ctx, span); + _swrast_write_rgba_span(ctx, span); } } else { @@ -106,10 +103,7 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) for (i = 0; i < span->end; i++) x[i]++; } - if (ctx->Visual.rgbMode) - _swrast_write_rgba_span(ctx, span); - else - _swrast_write_index_span(ctx, span); + _swrast_write_rgba_span(ctx, span); } } } @@ -120,12 +114,6 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) /***** Rasterization *****/ /**********************************************************************/ -/* Simple color index line (no stipple, width=1, no Z, no fog, no tex)*/ -#define NAME simple_no_z_ci_line -#define INTERP_INDEX -#define RENDER_SPAN(span) _swrast_write_index_span(ctx, &span) -#include "s_linetemp.h" - /* Simple RGBA index line (no stipple, width=1, no Z, no fog, no tex)*/ #define NAME simple_no_z_rgba_line #define INTERP_RGBA @@ -133,25 +121,6 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor ) #include "s_linetemp.h" -/* Z, fog, wide, stipple color index line */ -#define NAME ci_line -#define INTERP_INDEX -#define INTERP_Z -#define INTERP_ATTRIBS /* for fog */ -#define RENDER_SPAN(span) \ - if (ctx->Line.StippleFlag) { \ - span.arrayMask |= SPAN_MASK; \ - compute_stipple_mask(ctx, span.end, span.array->mask); \ - } \ - if (ctx->Line.Width > 1.0) { \ - draw_wide_line(ctx, &span, (GLboolean)(dx > dy)); \ - } \ - else { \ - _swrast_write_index_span(ctx, &span); \ - } -#include "s_linetemp.h" - - /* Z, fog, wide, stipple RGBA line */ #define NAME rgba_line #define INTERP_RGBA @@ -256,7 +225,6 @@ void _swrast_choose_line( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLboolean rgbmode = ctx->Visual.rgbMode; GLboolean specular = (ctx->Fog.ColorSumEnabled || (ctx->Light.Enabled && ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)); @@ -277,23 +245,17 @@ _swrast_choose_line( GLcontext *ctx ) || ctx->Line.Width != 1.0 || ctx->Line.StippleFlag) { /* no texture, but Z, fog, width>1, stipple, etc. */ - if (rgbmode) #if CHAN_BITS == 32 - USE(general_line); + USE(general_line); #else - USE(rgba_line); + USE(rgba_line); #endif - else - USE(ci_line); } else { ASSERT(!ctx->Depth.Test); ASSERT(ctx->Line.Width == 1.0); /* simple lines */ - if (rgbmode) - USE(simple_no_z_rgba_line); - else - USE(simple_no_z_ci_line); + USE(simple_no_z_rgba_line); } } else if (ctx->RenderMode == GL_FEEDBACK) { diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 1abf8d6c7f..182f962e1e 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -31,8 +31,6 @@ * The following macros may be defined to indicate what auxillary information * must be interplated along the line: * INTERP_Z - if defined, interpolate Z values - * INTERP_RGBA - if defined, interpolate RGBA values - * INTERP_INDEX - if defined, interpolate color index values * INTERP_ATTRIBS - if defined, interpolate attribs (texcoords, varying, etc) * * When one can directly address pixels in the color buffer the following @@ -223,7 +221,6 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) /* * Span setup: compute start and step values for all interpolated values. */ -#ifdef INTERP_RGBA interpFlags |= SPAN_RGBA; if (ctx->Light.ShadeModel == GL_SMOOTH) { span.red = ChanToFixed(vert0->color[0]); @@ -245,19 +242,6 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) span.blueStep = 0; span.alphaStep = 0; } -#endif -#ifdef INTERP_INDEX - interpFlags |= SPAN_INDEX; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - span.index = FloatToFixed(vert0->attrib[FRAG_ATTRIB_CI][0]); - span.indexStep = FloatToFixed( vert1->attrib[FRAG_ATTRIB_CI][0] - - vert0->attrib[FRAG_ATTRIB_CI][0]) / numPixels; - } - else { - span.index = FloatToFixed(vert1->attrib[FRAG_ATTRIB_CI][0]); - span.indexStep = 0; - } -#endif #if defined(INTERP_Z) || defined(DEPTH_TYPE) interpFlags |= SPAN_Z; { @@ -407,9 +391,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) #undef NAME #undef INTERP_Z -#undef INTERP_RGBA #undef INTERP_ATTRIBS -#undef INTERP_INDEX #undef PIXEL_ADDRESS #undef PIXEL_TYPE #undef DEPTH_TYPE -- cgit v1.2.3 From 87b9f5a7251b96bd315a72ae6fd972aa94e226e0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:26:48 -0800 Subject: swrast: Remove support for rendering antialiased triangles into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_aatriangle.c | 20 +--------------- src/mesa/swrast/s_aatritemp.h | 52 ------------------------------------------ 2 files changed, 1 insertion(+), 71 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 078f16aea0..fe3338ecef 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -357,20 +357,6 @@ rgba_aa_tri(GLcontext *ctx, const SWvertex *v2) { #define DO_Z -#define DO_RGBA -#include "s_aatritemp.h" -} - - -static void -index_aa_tri(GLcontext *ctx, - const SWvertex *v0, - const SWvertex *v1, - const SWvertex *v2) -{ -#define DO_Z -#define DO_ATTRIBS -#define DO_INDEX #include "s_aatritemp.h" } @@ -382,7 +368,6 @@ general_aa_tri(GLcontext *ctx, const SWvertex *v2) { #define DO_Z -#define DO_RGBA #define DO_ATTRIBS #include "s_aatritemp.h" } @@ -406,11 +391,8 @@ _swrast_set_aa_triangle_function(GLcontext *ctx) || NEED_SECONDARY_COLOR(ctx)) { SWRAST_CONTEXT(ctx)->Triangle = general_aa_tri; } - else if (ctx->Visual.rgbMode) { - SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri; - } else { - SWRAST_CONTEXT(ctx)->Triangle = index_aa_tri; + SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri; } ASSERT(SWRAST_CONTEXT(ctx)->Triangle); diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h index 76d4005b8c..5c1c6d9044 100644 --- a/src/mesa/swrast/s_aatritemp.h +++ b/src/mesa/swrast/s_aatritemp.h @@ -33,8 +33,6 @@ * The following macros may be defined to indicate what auxillary information * must be copmuted across the triangle: * DO_Z - if defined, compute Z values - * DO_RGBA - if defined, compute RGBA values - * DO_INDEX - if defined, compute color index values * DO_ATTRIBS - if defined, compute texcoords, varying, etc. */ @@ -55,12 +53,7 @@ #ifdef DO_Z GLfloat zPlane[4]; #endif -#ifdef DO_RGBA GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; -#endif -#ifdef DO_INDEX - GLfloat iPlane[4]; -#endif #if defined(DO_ATTRIBS) GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; GLfloat wPlane[4]; /* win[3] */ @@ -126,7 +119,6 @@ compute_plane(p0, p1, p2, p0[2], p1[2], p2[2], zPlane); span.arrayMask |= SPAN_Z; #endif -#ifdef DO_RGBA if (ctx->Light.ShadeModel == GL_SMOOTH) { compute_plane(p0, p1, p2, v0->color[RCOMP], v1->color[RCOMP], v2->color[RCOMP], rPlane); compute_plane(p0, p1, p2, v0->color[GCOMP], v1->color[GCOMP], v2->color[GCOMP], gPlane); @@ -140,17 +132,6 @@ constant_plane(v2->color[ACOMP], aPlane); } span.arrayMask |= SPAN_RGBA; -#endif -#ifdef DO_INDEX - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(p0, p1, p2, (GLfloat) v0->attrib[FRAG_ATTRIB_CI][0], - v1->attrib[FRAG_ATTRIB_CI][0], v2->attrib[FRAG_ATTRIB_CI][0], iPlane); - } - else { - constant_plane(v2->attrib[FRAG_ATTRIB_CI][0], iPlane); - } - span.arrayMask |= SPAN_INDEX; -#endif #if defined(DO_ATTRIBS) { const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; @@ -234,23 +215,14 @@ /* (cx,cy) = center of fragment */ const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; SWspanarrays *array = span.array; -#ifdef DO_INDEX - array->coverage[count] = (GLfloat) compute_coveragei(pMin, pMid, pMax, ix, iy); -#else array->coverage[count] = coverage; -#endif #ifdef DO_Z array->z[count] = (GLuint) solve_plane(cx, cy, zPlane); #endif -#ifdef DO_RGBA array->rgba[count][RCOMP] = solve_plane_chan(cx, cy, rPlane); array->rgba[count][GCOMP] = solve_plane_chan(cx, cy, gPlane); array->rgba[count][BCOMP] = solve_plane_chan(cx, cy, bPlane); array->rgba[count][ACOMP] = solve_plane_chan(cx, cy, aPlane); -#endif -#ifdef DO_INDEX - array->index[count] = (GLint) solve_plane(cx, cy, iPlane); -#endif ix++; count++; coverage = compute_coveragef(pMin, pMid, pMax, ix, iy); @@ -262,11 +234,7 @@ span.x = startX; span.y = iy; span.end = (GLuint) ix - (GLuint) startX; -#if defined(DO_RGBA) _swrast_write_rgba_span(ctx, &span); -#else - _swrast_write_index_span(ctx, &span); -#endif } } else { @@ -304,23 +272,14 @@ const GLfloat cx = ix + 0.5F, cy = iy + 0.5F; SWspanarrays *array = span.array; ASSERT(ix >= 0); -#ifdef DO_INDEX - array->coverage[ix] = (GLfloat) compute_coveragei(pMin, pMax, pMid, ix, iy); -#else array->coverage[ix] = coverage; -#endif #ifdef DO_Z array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane); #endif -#ifdef DO_RGBA array->rgba[ix][RCOMP] = solve_plane_chan(cx, cy, rPlane); array->rgba[ix][GCOMP] = solve_plane_chan(cx, cy, gPlane); array->rgba[ix][BCOMP] = solve_plane_chan(cx, cy, bPlane); array->rgba[ix][ACOMP] = solve_plane_chan(cx, cy, aPlane); -#endif -#ifdef DO_INDEX - array->index[ix] = (GLint) solve_plane(cx, cy, iPlane); -#endif ix--; count++; coverage = compute_coveragef(pMin, pMax, pMid, ix, iy); @@ -351,12 +310,7 @@ GLint j; for (j = 0; j < (GLint) n; j++) { array->coverage[j] = array->coverage[j + left]; -#ifdef DO_RGBA COPY_CHAN4(array->rgba[j], array->rgba[j + left]); -#endif -#ifdef DO_INDEX - array->index[j] = array->index[j + left]; -#endif #ifdef DO_Z array->z[j] = array->z[j + left]; #endif @@ -366,18 +320,12 @@ span.x = left; span.y = iy; span.end = n; -#if defined(DO_RGBA) _swrast_write_rgba_span(ctx, &span); -#else - _swrast_write_index_span(ctx, &span); -#endif } } } #undef DO_Z -#undef DO_RGBA -#undef DO_INDEX #undef DO_ATTRIBS #undef DO_OCCLUSION_TEST -- cgit v1.2.3 From e5ed4c45c675ebdd595ad0d31f2835f8b2b8dc57 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:39:08 -0800 Subject: swrast: Remove support for rendering antialiased lines into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_aaline.c | 50 ++++++++---------------------------------- src/mesa/swrast/s_aalinetemp.h | 32 --------------------------- 2 files changed, 9 insertions(+), 73 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 9bfa8f2e61..6ba4604e69 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -59,10 +59,8 @@ struct LineInfo /* DO_Z */ GLfloat zPlane[4]; - /* DO_RGBA */ + /* DO_RGBA - always enabled */ GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; - /* DO_INDEX */ - GLfloat iPlane[4]; /* DO_ATTRIBS */ GLfloat wPlane[4]; GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; @@ -325,20 +323,6 @@ compute_coveragef(const struct LineInfo *info, } -/** - * Compute coverage value for color index mode. - * XXX this may not be quite correct. - * \return coverage in [0,15]. - */ -static GLfloat -compute_coveragei(const struct LineInfo *info, - GLint winx, GLint winy) -{ - return compute_coveragef(info, winx, winy) * 15.0F; -} - - - typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line, int ix, int iy); @@ -475,22 +459,13 @@ segment(GLcontext *ctx, } -#define NAME(x) aa_ci_##x -#define DO_Z -#define DO_ATTRIBS /* for fog */ -#define DO_INDEX -#include "s_aalinetemp.h" - - #define NAME(x) aa_rgba_##x #define DO_Z -#define DO_RGBA #include "s_aalinetemp.h" #define NAME(x) aa_general_rgba_##x #define DO_Z -#define DO_RGBA #define DO_ATTRIBS #include "s_aalinetemp.h" @@ -503,22 +478,15 @@ _swrast_choose_aa_line_function(GLcontext *ctx) ASSERT(ctx->Line.SmoothFlag); - if (ctx->Visual.rgbMode) { - /* RGBA */ - if (ctx->Texture._EnabledCoordUnits != 0 - || ctx->FragmentProgram._Current - || (ctx->Light.Enabled && - ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - || ctx->Fog.ColorSumEnabled - || swrast->_FogEnabled) { - swrast->Line = aa_general_rgba_line; - } - else { - swrast->Line = aa_rgba_line; - } + if (ctx->Texture._EnabledCoordUnits != 0 + || ctx->FragmentProgram._Current + || (ctx->Light.Enabled && + ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) + || ctx->Fog.ColorSumEnabled + || swrast->_FogEnabled) { + swrast->Line = aa_general_rgba_line; } else { - /* Color Index */ - swrast->Line = aa_ci_line; + swrast->Line = aa_rgba_line; } } diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 42ffe9f20c..c28d47a671 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -39,11 +39,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) const SWcontext *swrast = SWRAST_CONTEXT(ctx); const GLfloat fx = (GLfloat) ix; const GLfloat fy = (GLfloat) iy; -#ifdef DO_INDEX - const GLfloat coverage = compute_coveragei(line, ix, iy); -#else const GLfloat coverage = compute_coveragef(line, ix, iy); -#endif const GLuint i = line->span.end; (void) swrast; @@ -63,15 +59,10 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) #ifdef DO_Z line->span.array->z[i] = (GLuint) solve_plane(fx, fy, line->zPlane); #endif -#ifdef DO_RGBA line->span.array->rgba[i][RCOMP] = solve_plane_chan(fx, fy, line->rPlane); line->span.array->rgba[i][GCOMP] = solve_plane_chan(fx, fy, line->gPlane); line->span.array->rgba[i][BCOMP] = solve_plane_chan(fx, fy, line->bPlane); line->span.array->rgba[i][ACOMP] = solve_plane_chan(fx, fy, line->aPlane); -#endif -#ifdef DO_INDEX - line->span.array->index[i] = (GLint) solve_plane(fx, fy, line->iPlane); -#endif #if defined(DO_ATTRIBS) ATTRIB_LOOP_BEGIN GLfloat (*attribArray)[4] = line->span.array->attribs[attr]; @@ -101,11 +92,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy) #endif if (line->span.end == MAX_WIDTH) { -#if defined(DO_RGBA) _swrast_write_rgba_span(ctx, &(line->span)); -#else - _swrast_write_index_span(ctx, &(line->span)); -#endif line->span.end = 0; /* reset counter */ } } @@ -150,7 +137,6 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) compute_plane(line.x0, line.y0, line.x1, line.y1, v0->attrib[FRAG_ATTRIB_WPOS][2], v1->attrib[FRAG_ATTRIB_WPOS][2], line.zPlane); #endif -#ifdef DO_RGBA line.span.arrayMask |= SPAN_RGBA; if (ctx->Light.ShadeModel == GL_SMOOTH) { compute_plane(line.x0, line.y0, line.x1, line.y1, @@ -168,18 +154,6 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) constant_plane(v1->color[BCOMP], line.bPlane); constant_plane(v1->color[ACOMP], line.aPlane); } -#endif -#ifdef DO_INDEX - line.span.arrayMask |= SPAN_INDEX; - if (ctx->Light.ShadeModel == GL_SMOOTH) { - compute_plane(line.x0, line.y0, line.x1, line.y1, - v0->attrib[FRAG_ATTRIB_CI][0], - v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane); - } - else { - constant_plane(v1->attrib[FRAG_ATTRIB_CI][0], line.iPlane); - } -#endif #if defined(DO_ATTRIBS) { const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; @@ -257,18 +231,12 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) segment(ctx, &line, NAME(plot), 0.0, 1.0); } -#if defined(DO_RGBA) _swrast_write_rgba_span(ctx, &(line.span)); -#else - _swrast_write_index_span(ctx, &(line.span)); -#endif } #undef DO_Z -#undef DO_RGBA -#undef DO_INDEX #undef DO_ATTRIBS #undef NAME -- cgit v1.2.3 From 9e2d30e0b8242d1e4afcf05513bd3d7e0de504a2 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:45:36 -0800 Subject: swrast: Remove support for Clear into a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_clear.c | 109 +++------------------------------------------- 1 file changed, 6 insertions(+), 103 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c index 820297f3ee..7b0a63391f 100644 --- a/src/mesa/swrast/s_clear.c +++ b/src/mesa/swrast/s_clear.c @@ -51,7 +51,6 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan span; GLint i; - ASSERT(ctx->Visual.rgbMode); ASSERT(rb->PutRow); /* Initialize color span with clear color */ @@ -104,45 +103,6 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb, } -/** - * Clear color index buffer with masking. - */ -static void -clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - SWspan span; - GLint i; - - ASSERT(!ctx->Visual.rgbMode); - ASSERT(rb->PutRow); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - - /* Initialize index span with clear index */ - INIT_SPAN(span, GL_BITMAP); - span.end = width; - span.arrayMask = SPAN_INDEX; - for (i = 0; i < width;i++) { - span.array->index[i] = ctx->Color.ClearIndex; - } - - /* Note that masking will change the color indexes, but only the - * bits for which the write mask is GL_FALSE. The bits - * which are write-enabled won't get modified. - */ - for (i = 0; i < height;i++) { - span.x = x; - span.y = y + i; - _swrast_mask_ci_span(ctx, rb, &span); - /* write masked row */ - rb->PutRow(ctx, rb, width, x, y + i, span.array->index, NULL); - } -} - - /** * Clear an rgba color buffer without channel masking. */ @@ -158,8 +118,6 @@ clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint buf) GLvoid *clearVal; GLint i; - ASSERT(ctx->Visual.rgbMode); - ASSERT(ctx->Color.ColorMask[buf][0] && ctx->Color.ColorMask[buf][1] && ctx->Color.ColorMask[buf][2] && @@ -196,50 +154,6 @@ clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint buf) } -/** - * Clear color index buffer without masking. - */ -static void -clear_ci_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) -{ - const GLint x = ctx->DrawBuffer->_Xmin; - const GLint y = ctx->DrawBuffer->_Ymin; - const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; - const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin; - GLubyte clear8; - GLushort clear16; - GLuint clear32; - GLvoid *clearVal; - GLint i; - - ASSERT(!ctx->Visual.rgbMode); - - ASSERT(rb->PutMonoRow); - - /* setup clear value */ - switch (rb->DataType) { - case GL_UNSIGNED_BYTE: - clear8 = (GLubyte) ctx->Color.ClearIndex; - clearVal = &clear8; - break; - case GL_UNSIGNED_SHORT: - clear16 = (GLushort) ctx->Color.ClearIndex; - clearVal = &clear16; - break; - case GL_UNSIGNED_INT: - clear32 = ctx->Color.ClearIndex; - clearVal = &clear32; - break; - default: - _mesa_problem(ctx, "Bad rb DataType in clear_color_buffer"); - return; - } - - for (i = 0; i < height; i++) - rb->PutMonoRow(ctx, rb, width, x, y + i, clearVal, NULL); -} - - /** * Clear the front/back/left/right/aux color buffers. * This function is usually only called if the device driver can't @@ -252,25 +166,14 @@ clear_color_buffers(GLcontext *ctx) for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) { struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[buf]; - if (ctx->Visual.rgbMode) { - if (ctx->Color.ColorMask[buf][0] == 0 || - ctx->Color.ColorMask[buf][1] == 0 || - ctx->Color.ColorMask[buf][2] == 0 || - ctx->Color.ColorMask[buf][3] == 0) { - clear_rgba_buffer_with_masking(ctx, rb, buf); - } - else { - clear_rgba_buffer(ctx, rb, buf); - } + if (ctx->Color.ColorMask[buf][0] == 0 || + ctx->Color.ColorMask[buf][1] == 0 || + ctx->Color.ColorMask[buf][2] == 0 || + ctx->Color.ColorMask[buf][3] == 0) { + clear_rgba_buffer_with_masking(ctx, rb, buf); } else { - const GLuint indexMask = (1 << _mesa_get_format_bits(rb->Format, GL_INDEX_BITS)) - 1; - if ((ctx->Color.IndexMask & indexMask) != indexMask) { - clear_ci_buffer_with_masking(ctx, rb); - } - else { - clear_ci_buffer(ctx, rb); - } + clear_rgba_buffer(ctx, rb, buf); } } } -- cgit v1.2.3 From 3fd8487ac65aeee8e3ed4dc6dc6468daf880da1a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 15:54:33 -0800 Subject: swrast: Remove support for ReadPixels from a color-index buffer Signed-off-by: Ian Romanick --- src/mesa/swrast/s_readpix.c | 67 ++------------------------------------------- 1 file changed, 2 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 41911337b8..ecabac6921 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -41,42 +41,6 @@ #include "s_stencil.h" -/* - * Read a block of color index pixels. - */ -static void -read_index_pixels( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum type, GLvoid *pixels, - const struct gl_pixelstore_attrib *packing ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - GLint i; - - if (!rb) - return; - - /* width should never be > MAX_WIDTH since we did clipping earlier */ - ASSERT(width <= MAX_WIDTH); - - /* process image row by row */ - for (i = 0; i < height; i++) { - GLuint index[MAX_WIDTH]; - GLvoid *dest; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - rb->GetRow(ctx, rb, width, x, y + i, index); - - dest = _mesa_image_address2d(packing, pixels, width, height, - GL_COLOR_INDEX, type, i, 0); - - _mesa_pack_index_span(ctx, width, type, dest, index, - &ctx->Pack, ctx->_ImageTransferState); - } -} - - - /** * Read pixels for format=GL_DEPTH_COMPONENT. */ @@ -373,18 +337,7 @@ read_rgba_pixels( GLcontext *ctx, /* read full RGBA, FLOAT image */ dest = tmpImage; for (row = 0; row < height; row++, y++) { - if (fb->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest); - } - else { - GLuint index[MAX_WIDTH]; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - rb->GetRow(ctx, rb, width, x, y, index); - _mesa_apply_ci_transfer_ops(ctx, - transferOps & IMAGE_SHIFT_OFFSET_BIT, - width, index); - _mesa_map_ci_to_rgba(ctx, width, index, (GLfloat (*)[4]) dest); - } + _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest); _mesa_apply_rgba_transfer_ops(ctx, transferOps & IMAGE_PRE_CONVOLUTION_BITS, width, (GLfloat (*)[4]) dest); @@ -431,19 +384,7 @@ read_rgba_pixels( GLcontext *ctx, for (row = 0; row < height; row++, y++) { /* Get float rgba pixels */ - if (fb->Visual.rgbMode) { - _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba); - } - else { - /* read CI and convert to RGBA */ - GLuint index[MAX_WIDTH]; - ASSERT(rb->DataType == GL_UNSIGNED_INT); - rb->GetRow(ctx, rb, width, x, y, index); - _mesa_apply_ci_transfer_ops(ctx, - transferOps & IMAGE_SHIFT_OFFSET_BIT, - width, index); - _mesa_map_ci_to_rgba(ctx, width, index, rgba); - } + _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, rgba); /* apply fudge factor for shallow color buffers */ if (fb->Visual.redBits < 8 || @@ -592,10 +533,6 @@ _swrast_ReadPixels( GLcontext *ctx, return; switch (format) { - case GL_COLOR_INDEX: - read_index_pixels(ctx, x, y, width, height, type, pixels, - &clippedPacking); - break; case GL_STENCIL_INDEX: read_stencil_pixels(ctx, x, y, width, height, type, pixels, &clippedPacking); -- cgit v1.2.3 From 2b7911d37dc1518b9047b02acdc6f8476abad70f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:02:38 -0800 Subject: swrast: Remove remaining color-index state tracking infrastructure Signed-off-by: Ian Romanick --- src/mesa/swrast/s_context.c | 51 +++++++++++++++------------------------------ src/mesa/swrast/s_span.c | 51 +++++++++++++++++++-------------------------- 2 files changed, 39 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 0d4680db9f..751966348b 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -63,24 +63,17 @@ _swrast_update_rasterflags( GLcontext *ctx ) if (swrast->_FogEnabled) rasterMask |= FOG_BIT; if (ctx->Scissor.Enabled) rasterMask |= CLIP_BIT; if (ctx->Stencil._Enabled) rasterMask |= STENCIL_BIT; - if (ctx->Visual.rgbMode) { - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - if (!ctx->Color.ColorMask[i][0] || - !ctx->Color.ColorMask[i][1] || - !ctx->Color.ColorMask[i][2] || - !ctx->Color.ColorMask[i][3]) { - rasterMask |= MASKING_BIT; - break; - } + for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { + if (!ctx->Color.ColorMask[i][0] || + !ctx->Color.ColorMask[i][1] || + !ctx->Color.ColorMask[i][2] || + !ctx->Color.ColorMask[i][3]) { + rasterMask |= MASKING_BIT; + break; } - if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT; - if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT; - } - else { - if (ctx->Color.IndexMask != 0xffffffff) rasterMask |= MASKING_BIT; - if (ctx->Color.IndexLogicOpEnabled) rasterMask |= LOGIC_OP_BIT; } - + if (ctx->Color._LogicOpEnabled) rasterMask |= LOGIC_OP_BIT; + if (ctx->Texture._EnabledUnits) rasterMask |= TEXTURE_BIT; if ( ctx->Viewport.X < 0 || ctx->Viewport.X + ctx->Viewport.Width > (GLint) ctx->DrawBuffer->Width || ctx->Viewport.Y < 0 @@ -100,19 +93,14 @@ _swrast_update_rasterflags( GLcontext *ctx ) /* more than one color buffer designated for writing (or zero buffers) */ rasterMask |= MULTI_DRAW_BIT; } - else if (!ctx->Visual.rgbMode && ctx->Color.IndexMask==0) { - rasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */ - } - if (ctx->Visual.rgbMode) { - for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { - if (ctx->Color.ColorMask[i][0] + - ctx->Color.ColorMask[i][1] + - ctx->Color.ColorMask[i][2] + - ctx->Color.ColorMask[i][3] == 0) { - rasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */ - break; - } + for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { + if (ctx->Color.ColorMask[i][0] + + ctx->Color.ColorMask[i][1] + + ctx->Color.ColorMask[i][2] + + ctx->Color.ColorMask[i][3] == 0) { + rasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */ + break; } } @@ -892,12 +880,7 @@ _swrast_flush( GLcontext *ctx ) SWcontext *swrast = SWRAST_CONTEXT(ctx); /* flush any pending fragments from rendering points */ if (swrast->PointSpan.end > 0) { - if (ctx->Visual.rgbMode) { - _swrast_write_rgba_span(ctx, &(swrast->PointSpan)); - } - else { - _swrast_write_index_span(ctx, &(swrast->PointSpan)); - } + _swrast_write_rgba_span(ctx, &(swrast->PointSpan)); swrast->PointSpan.end = 0; } } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index dada364360..dd67f63321 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -80,41 +80,34 @@ _swrast_span_default_attribs(GLcontext *ctx, SWspan *span) span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; /* primary color, or color index */ - if (ctx->Visual.rgbMode) { - GLchan r, g, b, a; - UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); - UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]); - UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]); - UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]); + GLchan r, g, b, a; + UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterColor[3]); #if CHAN_TYPE == GL_FLOAT - span->red = r; - span->green = g; - span->blue = b; - span->alpha = a; + span->red = r; + span->green = g; + span->blue = b; + span->alpha = a; #else - span->red = IntToFixed(r); - span->green = IntToFixed(g); - span->blue = IntToFixed(b); - span->alpha = IntToFixed(a); + span->red = IntToFixed(r); + span->green = IntToFixed(g); + span->blue = IntToFixed(b); + span->alpha = IntToFixed(a); #endif - span->redStep = 0; - span->greenStep = 0; - span->blueStep = 0; - span->alphaStep = 0; - span->interpMask |= SPAN_RGBA; + span->redStep = 0; + span->greenStep = 0; + span->blueStep = 0; + span->alphaStep = 0; + span->interpMask |= SPAN_RGBA; - COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); - ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); - } - else { - span->index = FloatToFixed(ctx->Current.RasterIndex); - span->indexStep = 0; - span->interpMask |= SPAN_INDEX; - } + COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); + ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); + ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); /* Secondary color */ - if (ctx->Visual.rgbMode && (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled)) + if (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled) { COPY_4V(span->attrStart[FRAG_ATTRIB_COL1], ctx->Current.RasterSecondaryColor); ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); -- cgit v1.2.3 From c00282102aea387e8c0fb29811d0ea8f010f145a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:05:20 -0800 Subject: swrast: Remove _swrast_write_index_span and associated code After all the recent color-index rendering removal, _swrast_write_index_span is no longer used anywhere. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_span.c | 275 ----------------------------------------------- src/mesa/swrast/s_span.h | 3 - 2 files changed, 278 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index dd67f63321..f1f37dfe83 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -367,38 +367,6 @@ interpolate_float_colors(SWspan *span) -/* Fill in the span.color.index array from the interpolation values */ -static INLINE void -interpolate_indexes(GLcontext *ctx, SWspan *span) -{ - GLfixed index = span->index; - const GLint indexStep = span->indexStep; - const GLuint n = span->end; - GLuint *indexes = span->array->index; - GLuint i; - (void) ctx; - - ASSERT(!(span->arrayMask & SPAN_INDEX)); - - if ((span->interpMask & SPAN_FLAT) || (indexStep == 0)) { - /* constant color */ - index = FixedToInt(index); - for (i = 0; i < n; i++) { - indexes[i] = index; - } - } - else { - /* interpolate */ - for (i = 0; i < n; i++) { - indexes[i] = FixedToInt(index); - index += indexStep; - } - } - span->arrayMask |= SPAN_INDEX; - span->interpMask &= ~SPAN_INDEX; -} - - /** * Fill in the span.zArray array from the span->z, zStep values. */ @@ -834,249 +802,6 @@ clip_span( GLcontext *ctx, SWspan *span ) } -/** - * Apply all the per-fragment opertions to a span of color index fragments - * and write them to the enabled color drawbuffers. - * The 'span' parameter can be considered to be const. Note that - * span->interpMask and span->arrayMask may be changed but will be restored - * to their original values before returning. - */ -void -_swrast_write_index_span( GLcontext *ctx, SWspan *span) -{ - const SWcontext *swrast = SWRAST_CONTEXT(ctx); - const GLbitfield origInterpMask = span->interpMask; - const GLbitfield origArrayMask = span->arrayMask; - struct gl_framebuffer *fb = ctx->DrawBuffer; - - ASSERT(span->end <= MAX_WIDTH); - ASSERT(span->primitive == GL_POINT || span->primitive == GL_LINE || - span->primitive == GL_POLYGON || span->primitive == GL_BITMAP); - ASSERT((span->interpMask | span->arrayMask) & SPAN_INDEX); - /* - ASSERT((span->interpMask & span->arrayMask) == 0); - */ - - if (span->arrayMask & SPAN_MASK) { - /* mask was initialized by caller, probably glBitmap */ - span->writeAll = GL_FALSE; - } - else { - memset(span->array->mask, 1, span->end); - span->writeAll = GL_TRUE; - } - - /* Clipping */ - if ((swrast->_RasterMask & CLIP_BIT) || (span->primitive != GL_POLYGON)) { - if (!clip_span(ctx, span)) { - return; - } - } - - if (!(span->arrayMask & SPAN_MASK)) { - /* post-clip sanity check */ - assert(span->x >= 0); - assert(span->y >= 0); - } - - /* Depth bounds test */ - if (ctx->Depth.BoundsTest && fb->Visual.depthBits > 0) { - if (!_swrast_depth_bounds_test(ctx, span)) { - return; - } - } - -#ifdef DEBUG - /* Make sure all fragments are within window bounds */ - if (span->arrayMask & SPAN_XY) { - GLuint i; - for (i = 0; i < span->end; i++) { - if (span->array->mask[i]) { - assert(span->array->x[i] >= fb->_Xmin); - assert(span->array->x[i] < fb->_Xmax); - assert(span->array->y[i] >= fb->_Ymin); - assert(span->array->y[i] < fb->_Ymax); - } - } - } -#endif - - /* Polygon Stippling */ - if (ctx->Polygon.StippleFlag && span->primitive == GL_POLYGON) { - stipple_polygon_span(ctx, span); - } - - /* Stencil and Z testing */ - if (ctx->Stencil._Enabled || ctx->Depth.Test) { - if (!(span->arrayMask & SPAN_Z)) - _swrast_span_interpolate_z(ctx, span); - - if (ctx->Transform.DepthClamp) - _swrast_depth_clamp_span(ctx, span); - - if (ctx->Stencil._Enabled) { - if (!_swrast_stencil_and_ztest_span(ctx, span)) { - span->arrayMask = origArrayMask; - return; - } - } - else { - ASSERT(ctx->Depth.Test); - if (!_swrast_depth_test_span(ctx, span)) { - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; - return; - } - } - } - - if (ctx->Query.CurrentOcclusionObject) { - /* update count of 'passed' fragments */ - struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; - GLuint i; - for (i = 0; i < span->end; i++) - q->Result += span->array->mask[i]; - } - - /* we have to wait until after occlusion to do this test */ - if (ctx->Color.IndexMask == 0) { - /* write no pixels */ - span->arrayMask = origArrayMask; - return; - } - - /* Interpolate the color indexes if needed */ - if (swrast->_FogEnabled || - ctx->Color.IndexLogicOpEnabled || - ctx->Color.IndexMask != 0xffffffff || - (span->arrayMask & SPAN_COVERAGE)) { - if (!(span->arrayMask & SPAN_INDEX) /*span->interpMask & SPAN_INDEX*/) { - interpolate_indexes(ctx, span); - } - } - - /* Fog */ - if (swrast->_FogEnabled) { - _swrast_fog_ci_span(ctx, span); - } - - /* Antialias coverage application */ - if (span->arrayMask & SPAN_COVERAGE) { - const GLfloat *coverage = span->array->coverage; - GLuint *index = span->array->index; - GLuint i; - for (i = 0; i < span->end; i++) { - ASSERT(coverage[i] < 16); - index[i] = (index[i] & ~0xf) | ((GLuint) coverage[i]); - } - } - - /* - * Write to renderbuffers - */ - { - const GLuint numBuffers = fb->_NumColorDrawBuffers; - GLuint buf; - - for (buf = 0; buf < numBuffers; buf++) { - struct gl_renderbuffer *rb = fb->_ColorDrawBuffers[buf]; - GLuint indexSave[MAX_WIDTH]; - - ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); - - if (numBuffers > 1) { - /* save indexes for second, third renderbuffer writes */ - memcpy(indexSave, span->array->index, - span->end * sizeof(indexSave[0])); - } - - if (ctx->Color.IndexLogicOpEnabled) { - _swrast_logicop_ci_span(ctx, rb, span); - } - - if (ctx->Color.IndexMask != 0xffffffff) { - _swrast_mask_ci_span(ctx, rb, span); - } - - if (!(span->arrayMask & SPAN_INDEX) && span->indexStep == 0) { - /* all fragments have same color index */ - GLubyte index8; - GLushort index16; - GLuint index32; - void *value; - - if (rb->DataType == GL_UNSIGNED_BYTE) { - index8 = FixedToInt(span->index); - value = &index8; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - index16 = FixedToInt(span->index); - value = &index16; - } - else { - ASSERT(rb->DataType == GL_UNSIGNED_INT); - index32 = FixedToInt(span->index); - value = &index32; - } - - if (span->arrayMask & SPAN_XY) { - rb->PutMonoValues(ctx, rb, span->end, span->array->x, - span->array->y, value, span->array->mask); - } - else { - rb->PutMonoRow(ctx, rb, span->end, span->x, span->y, - value, span->array->mask); - } - } - else { - /* each fragment is a different color */ - GLubyte index8[MAX_WIDTH]; - GLushort index16[MAX_WIDTH]; - void *values; - - if (rb->DataType == GL_UNSIGNED_BYTE) { - GLuint k; - for (k = 0; k < span->end; k++) { - index8[k] = (GLubyte) span->array->index[k]; - } - values = index8; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLuint k; - for (k = 0; k < span->end; k++) { - index16[k] = (GLushort) span->array->index[k]; - } - values = index16; - } - else { - ASSERT(rb->DataType == GL_UNSIGNED_INT); - values = span->array->index; - } - - if (span->arrayMask & SPAN_XY) { - rb->PutValues(ctx, rb, span->end, - span->array->x, span->array->y, - values, span->array->mask); - } - else { - rb->PutRow(ctx, rb, span->end, span->x, span->y, - values, span->array->mask); - } - } - - if (buf + 1 < numBuffers) { - /* restore original span values */ - memcpy(span->array->index, indexSave, - span->end * sizeof(indexSave[0])); - } - } /* for buf */ - } - - span->interpMask = origInterpMask; - span->arrayMask = origArrayMask; -} - - /** * Add specular colors to primary colors. * Only called during fixed-function operation. diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 0eabae20e0..9f6be5a335 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -187,9 +187,6 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH, GLfloat s, GLfloat t, GLfloat q, GLfloat invQ); -extern void -_swrast_write_index_span( GLcontext *ctx, SWspan *span); - extern void _swrast_write_rgba_span( GLcontext *ctx, SWspan *span); -- cgit v1.2.3 From b00362e51b28b4ea43c5f42353182146bd5e802b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:07:11 -0800 Subject: swrast: Remove _swrast_fog_ci_span and associated code After all the recent color-index rendering removal, _swrast_fog_ci_span is no longer used anywhere. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_fog.c | 85 ------------------------------------------------- src/mesa/swrast/s_fog.h | 4 --- 2 files changed, 89 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c index 0472bbf553..3fc8439213 100644 --- a/src/mesa/swrast/s_fog.c +++ b/src/mesa/swrast/s_fog.c @@ -122,38 +122,6 @@ else { \ } \ } -/* As above, but CI mode (XXX try to merge someday) */ -#define FOG_LOOP_CI(FOG_FUNC) \ -if (span->arrayAttribs & FRAG_BIT_FOGC) { \ - GLuint i; \ - for (i = 0; i < span->end; i++) { \ - const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \ - const GLfloat c = FABSF(fogCoord); \ - GLfloat f; \ - FOG_FUNC(f, c); \ - f = CLAMP(f, 0.0F, 1.0F); \ - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); \ - } \ -} \ -else { \ - const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \ - GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \ - const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \ - GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \ - GLuint i; \ - for (i = 0; i < span->end; i++) { \ - const GLfloat c = FABSF(fogCoord) / w; \ - GLfloat f; \ - FOG_FUNC(f, c); \ - f = CLAMP(f, 0.0F, 1.0F); \ - index[i] = (GLuint) ((GLfloat) index[i] + (1.0F - f) * fogIndex); \ - fogCoord += fogStep; \ - w += wStep; \ - } \ -} - - - /** * Apply fog to a span of RGBA pixels. * The fog value are either in the span->array->fog array or interpolated from @@ -275,56 +243,3 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ) } } } - - -/** - * As above, but color index mode. - */ -void -_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ) -{ - const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx); - const GLuint fogIndex = (GLuint) ctx->Fog.Index; - GLuint *index = span->array->index; - - ASSERT(swrast->_FogEnabled); - ASSERT(span->arrayMask & SPAN_INDEX); - - /* we need to compute fog blend factors */ - if (swrast->_PreferPixelFog) { - /* The span's fog values are fog coordinates, now compute blend factors - * and blend the fragment colors with the fog color. - */ - switch (ctx->Fog.Mode) { - case GL_LINEAR: - { - const GLfloat fogEnd = ctx->Fog.End; - const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End) - ? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start); - FOG_LOOP_CI(LINEAR_FOG); - } - break; - case GL_EXP: - { - const GLfloat density = -ctx->Fog.Density; - FOG_LOOP_CI(EXP_FOG); - } - break; - case GL_EXP2: - { - const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density; - FOG_LOOP_CI(EXP2_FOG); - } - break; - default: - _mesa_problem(ctx, "Bad fog mode in _swrast_fog_ci_span"); - return; - } - } - else { - /* The span's fog start/step/array values are blend factors in [0,1]. - * They were previously computed per-vertex. - */ - FOG_LOOP_CI(BLEND_FOG); - } -} diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h index 50760d88af..06107de3f9 100644 --- a/src/mesa/swrast/s_fog.h +++ b/src/mesa/swrast/s_fog.h @@ -37,8 +37,4 @@ _swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z); extern void _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span ); -extern void -_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span ); - - #endif -- cgit v1.2.3 From 0ca57295785f3ab040890037e6a2645a70d2b2f2 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:10:02 -0800 Subject: swrast: Remove _swrast_mask_ci_span After all the recent color-index rendering removal, _swrast_mask_ci_span is no longer used anywhere. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_masking.c | 31 ------------------------------- src/mesa/swrast/s_masking.h | 5 ----- 2 files changed, 36 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c index 69c2feb6da..e38d90f199 100644 --- a/src/mesa/swrast/s_masking.c +++ b/src/mesa/swrast/s_masking.c @@ -101,34 +101,3 @@ _swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, } } } - - -/** - * Apply the index mask to a span of color index values. - */ -void -_swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - const GLuint srcMask = ctx->Color.IndexMask; - const GLuint dstMask = ~srcMask; - GLuint *index = span->array->index; - GLuint dest[MAX_WIDTH]; - GLuint i; - - ASSERT(span->arrayMask & SPAN_INDEX); - ASSERT(span->end <= MAX_WIDTH); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - dest, sizeof(GLuint)); - } - else { - _swrast_read_index_span(ctx, rb, span->end, span->x, span->y, dest); - } - - for (i = 0; i < span->end; i++) { - index[i] = (index[i] & srcMask) | (dest[i] & dstMask); - } -} diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h index fed47f8cfb..3ba4f8356c 100644 --- a/src/mesa/swrast/s_masking.h +++ b/src/mesa/swrast/s_masking.h @@ -34,9 +34,4 @@ extern void _swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span, GLuint buf); - -extern void -_swrast_mask_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span); - #endif -- cgit v1.2.3 From 7ce12c9024f74bb26e45496a46b57708d8159d37 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:11:43 -0800 Subject: swrast: Remove _swrast_read_index_span After all the recent color-index rendering removal, _swrast_read_index_span is no longer used anywhere. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_span.c | 68 ------------------------------------------------ src/mesa/swrast/s_span.h | 4 --- 2 files changed, 72 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index f1f37dfe83..29f070686f 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1347,74 +1347,6 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb, } -/** - * Read CI pixels from a renderbuffer. Clipping will be done to prevent - * reading ouside the buffer's boundaries. - */ -void -_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint index[] ) -{ - const GLint bufWidth = (GLint) rb->Width; - const GLint bufHeight = (GLint) rb->Height; - - if (y < 0 || y >= bufHeight || x + (GLint) n < 0 || x >= bufWidth) { - /* completely above, below, or right */ - memset(index, 0, n * sizeof(GLuint)); - } - else { - GLint skip, length; - if (x < 0) { - /* left edge clipping */ - skip = -x; - length = (GLint) n - skip; - if (length < 0) { - /* completely left of window */ - return; - } - if (length > bufWidth) { - length = bufWidth; - } - } - else if ((GLint) (x + n) > bufWidth) { - /* right edge clipping */ - skip = 0; - length = bufWidth - x; - if (length < 0) { - /* completely to right of window */ - return; - } - } - else { - /* no clipping */ - skip = 0; - length = (GLint) n; - } - - ASSERT(rb->GetRow); - ASSERT(rb->_BaseFormat == GL_COLOR_INDEX); - - if (rb->DataType == GL_UNSIGNED_BYTE) { - GLubyte index8[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, length, x + skip, y, index8); - for (i = 0; i < length; i++) - index[skip + i] = index8[i]; - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - GLushort index16[MAX_WIDTH]; - GLint i; - rb->GetRow(ctx, rb, length, x + skip, y, index16); - for (i = 0; i < length; i++) - index[skip + i] = index16[i]; - } - else if (rb->DataType == GL_UNSIGNED_INT) { - rb->GetRow(ctx, rb, length, x + skip, y, index + skip); - } - } -} - - /** * Wrapper for gl_renderbuffer::GetValues() which does clipping to avoid * reading values outside the buffer bounds. diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 9f6be5a335..1ce3f5f5e5 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -196,10 +196,6 @@ extern void _swrast_read_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba); -extern void -_swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint n, GLint x, GLint y, GLuint indx[] ); - extern void _swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], -- cgit v1.2.3 From dc14ce9e367984cece79748b177e142ca02fa06d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:34:21 -0800 Subject: swrast: Remove SPAN_INDEX Also adjust the bits that appear after it to fill in the gap. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_span.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h index 1ce3f5f5e5..aaf1fec2a8 100644 --- a/src/mesa/swrast/s_span.h +++ b/src/mesa/swrast/s_span.h @@ -41,13 +41,12 @@ */ /*@{*/ #define SPAN_RGBA 0x01 /**< interpMask and arrayMask */ -#define SPAN_INDEX 0x02 /**< interpMask and arrayMask */ -#define SPAN_Z 0x04 /**< interpMask and arrayMask */ -#define SPAN_FLAT 0x08 /**< interpMask: flat shading? */ -#define SPAN_XY 0x10 /**< array.x[], y[] valid? */ -#define SPAN_MASK 0x20 /**< was array.mask[] filled in by caller? */ -#define SPAN_LAMBDA 0x40 /**< array.lambda[] valid? */ -#define SPAN_COVERAGE 0x80 /**< array.coverage[] valid? */ +#define SPAN_Z 0x02 /**< interpMask and arrayMask */ +#define SPAN_FLAT 0x04 /**< interpMask: flat shading? */ +#define SPAN_XY 0x08 /**< array.x[], y[] valid? */ +#define SPAN_MASK 0x10 /**< was array.mask[] filled in by caller? */ +#define SPAN_LAMBDA 0x20 /**< array.lambda[] valid? */ +#define SPAN_COVERAGE 0x40 /**< array.coverage[] valid? */ /*@}*/ -- cgit v1.2.3 From 718ff7e87bf9b86517e88270cc984e364ace9506 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:44:39 -0800 Subject: DRI/swrast: Remove color-index support from DRI swrast driver It appears that color-index rendering wasn't actually supported anyway. swrastFillInModes did not previously create an color-index configs, so it doesn't seem like there would be any way to get a color-index visual. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/swrast/swrast.c | 57 +++++++++++---------------- src/mesa/drivers/dri/swrast/swrast_priv.h | 9 ++--- src/mesa/drivers/dri/swrast/swrast_span.c | 50 ----------------------- src/mesa/drivers/dri/swrast/swrast_spantemp.h | 16 +------- 4 files changed, 27 insertions(+), 105 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index b2e7df34e8..03c672ecf1 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -203,34 +203,28 @@ static const __DRIextension **driGetExtensions(__DRIscreen *psp) static GLuint choose_pixel_format(const GLvisual *v) { - if (v->rgbMode) { - int depth = v->rgbBits; - - if (depth == 32 - && v->redMask == 0xff0000 - && v->greenMask == 0x00ff00 - && v->blueMask == 0x0000ff) - return PF_A8R8G8B8; - else if (depth == 24 - && v->redMask == 0xff0000 - && v->greenMask == 0x00ff00 - && v->blueMask == 0x0000ff) - return PF_X8R8G8B8; - else if (depth == 16 - && v->redMask == 0xf800 - && v->greenMask == 0x07e0 - && v->blueMask == 0x001f) - return PF_R5G6B5; - else if (depth == 8 - && v->redMask == 0x07 - && v->greenMask == 0x38 - && v->blueMask == 0xc0) - return PF_R3G3B2; - } - else { - if (v->indexBits == 8) - return PF_CI8; - } + int depth = v->rgbBits; + + if (depth == 32 + && v->redMask == 0xff0000 + && v->greenMask == 0x00ff00 + && v->blueMask == 0x0000ff) + return PF_A8R8G8B8; + else if (depth == 24 + && v->redMask == 0xff0000 + && v->greenMask == 0x00ff00 + && v->blueMask == 0x0000ff) + return PF_X8R8G8B8; + else if (depth == 16 + && v->redMask == 0xf800 + && v->greenMask == 0x07e0 + && v->blueMask == 0x001f) + return PF_R5G6B5; + else if (depth == 8 + && v->redMask == 0x07 + && v->greenMask == 0x38 + && v->blueMask == 0xc0) + return PF_R3G3B2; _mesa_problem( NULL, "unexpected format in %s", __FUNCTION__ ); return 0; @@ -335,13 +329,6 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) xrb->Base.DataType = GL_UNSIGNED_BYTE; xrb->bpp = 8; break; - case PF_CI8: - xrb->Base.Format = MESA_FORMAT_CI8; - xrb->Base.InternalFormat = GL_COLOR_INDEX8_EXT; - xrb->Base._BaseFormat = GL_COLOR_INDEX; - xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->bpp = 8; - break; default: return NULL; } diff --git a/src/mesa/drivers/dri/swrast/swrast_priv.h b/src/mesa/drivers/dri/swrast/swrast_priv.h index 59b4a6d228..4722007f95 100644 --- a/src/mesa/drivers/dri/swrast/swrast_priv.h +++ b/src/mesa/drivers/dri/swrast/swrast_priv.h @@ -116,11 +116,10 @@ swrast_renderbuffer(struct gl_renderbuffer *rb) /** * Pixel formats we support */ -#define PF_CI8 1 /**< Color Index mode */ -#define PF_A8R8G8B8 2 /**< 32bpp TrueColor: 8-A, 8-R, 8-G, 8-B bits */ -#define PF_R5G6B5 3 /**< 16bpp TrueColor: 5-R, 6-G, 5-B bits */ -#define PF_R3G3B2 4 /**< 8bpp TrueColor: 3-R, 3-G, 2-B bits */ -#define PF_X8R8G8B8 5 /**< 32bpp TrueColor: 8-R, 8-G, 8-B bits */ +#define PF_A8R8G8B8 1 /**< 32bpp TrueColor: 8-A, 8-R, 8-G, 8-B bits */ +#define PF_R5G6B5 2 /**< 16bpp TrueColor: 5-R, 6-G, 5-B bits */ +#define PF_R3G3B2 3 /**< 8bpp TrueColor: 3-R, 3-G, 2-B bits */ +#define PF_X8R8G8B8 4 /**< 32bpp TrueColor: 8-R, 8-G, 8-B bits */ /** * Renderbuffer pitch alignment (in bits). diff --git a/src/mesa/drivers/dri/swrast/swrast_span.c b/src/mesa/drivers/dri/swrast/swrast_span.c index f8e503463f..5290dc82b9 100644 --- a/src/mesa/drivers/dri/swrast/swrast_span.c +++ b/src/mesa/drivers/dri/swrast/swrast_span.c @@ -193,23 +193,6 @@ static const GLubyte kernel[16] = { #include "swrast/s_spantemp.h" -/* 8-bit color index */ -#define NAME(FUNC) FUNC##_CI8 -#define CI_MODE -#define RB_TYPE GLubyte -#define SPAN_VARS \ - struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X); -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - *DST = VALUE[0] -#define FETCH_PIXEL(DST, SRC) \ - DST = SRC[0] - -#include "swrast/s_spantemp.h" - - /* * Generate code for front-buffer span functions. */ @@ -282,23 +265,6 @@ static const GLubyte kernel[16] = { #include "swrast_spantemp.h" -/* 8-bit color index */ -#define NAME(FUNC) FUNC##_CI8_front -#define CI_MODE -#define RB_TYPE GLubyte -#define SPAN_VARS \ - struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - *DST = VALUE[0] -#define FETCH_PIXEL(DST, SRC) \ - DST = SRC[0] - -#include "swrast_spantemp.h" - - /* * Back-buffers are malloced memory and always private. * @@ -346,14 +312,6 @@ swrast_set_span_funcs_back(struct swrast_renderbuffer *xrb, xrb->Base.PutValues = put_values_R3G3B2; xrb->Base.PutMonoValues = put_mono_values_R3G3B2; break; - case PF_CI8: - xrb->Base.GetRow = get_row_CI8; - xrb->Base.GetValues = get_values_CI8; - xrb->Base.PutRow = put_row_CI8; - xrb->Base.PutMonoRow = put_mono_row_CI8; - xrb->Base.PutValues = put_values_CI8; - xrb->Base.PutMonoValues = put_mono_values_CI8; - break; default: assert(0); return; @@ -410,14 +368,6 @@ swrast_set_span_funcs_front(struct swrast_renderbuffer *xrb, xrb->Base.PutValues = put_values_R3G3B2_front; xrb->Base.PutMonoValues = put_mono_values_R3G3B2_front; break; - case PF_CI8: - xrb->Base.GetRow = get_row_CI8_front; - xrb->Base.GetValues = get_values_CI8_front; - xrb->Base.PutRow = put_row_CI8_front; - xrb->Base.PutMonoRow = put_mono_row_CI8_front; - xrb->Base.PutValues = put_values_CI8_front; - xrb->Base.PutMonoValues = put_mono_values_CI8_front; - break; default: assert(0); return; diff --git a/src/mesa/drivers/dri/swrast/swrast_spantemp.h b/src/mesa/drivers/dri/swrast/swrast_spantemp.h index e0cb241429..879a0c12e7 100644 --- a/src/mesa/drivers/dri/swrast/swrast_spantemp.h +++ b/src/mesa/drivers/dri/swrast/swrast_spantemp.h @@ -98,7 +98,6 @@ GET_ROW( GLcontext *glCtx, GLint x, GLint y, GLuint n, char *row ) * Define the following macros before including this file: * NAME(BASE) to generate the function name (i.e. add prefix or suffix) * RB_TYPE the renderbuffer DataType - * CI_MODE if set, color index mode, else RGBA * SPAN_VARS to declare any local variables * INIT_PIXEL_PTR(P, X, Y) to initialize a pointer to a pixel * INC_PIXEL_PTR(P) to increment a pixel pointer by one pixel @@ -113,9 +112,7 @@ GET_ROW( GLcontext *glCtx, GLint x, GLint y, GLuint n, char *row ) #include "main/macros.h" -#ifdef CI_MODE -#define RB_COMPONENTS 1 -#elif !defined(RB_COMPONENTS) +#if !defined(RB_COMPONENTS) #define RB_COMPONENTS 4 #endif @@ -127,11 +124,7 @@ NAME(get_row)( GLcontext *ctx, struct gl_renderbuffer *rb, #ifdef SPAN_VARS SPAN_VARS #endif -#ifdef CI_MODE - RB_TYPE *dest = (RB_TYPE *) values; -#else RB_TYPE (*dest)[RB_COMPONENTS] = (RB_TYPE (*)[RB_COMPONENTS]) values; -#endif GLuint i; char *row = swrast_drawable(ctx->ReadBuffer)->row; INIT_PIXEL_PTR(pixel, x, y); @@ -151,11 +144,7 @@ NAME(get_values)( GLcontext *ctx, struct gl_renderbuffer *rb, #ifdef SPAN_VARS SPAN_VARS #endif -#ifdef CI_MODE - RB_TYPE *dest = (RB_TYPE *) values; -#else RB_TYPE (*dest)[RB_COMPONENTS] = (RB_TYPE (*)[RB_COMPONENTS]) values; -#endif GLuint i; for (i = 0; i < count; i++) { RB_TYPE pixel[4]; @@ -198,7 +187,6 @@ NAME(put_row)( GLcontext *ctx, struct gl_renderbuffer *rb, } -#if !defined(CI_MODE) static void NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLint x, GLint y, @@ -237,7 +225,6 @@ NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb, } (void) rb; } -#endif static void @@ -319,7 +306,6 @@ NAME(put_mono_values)( GLcontext *ctx, struct gl_renderbuffer *rb, #undef NAME #undef RB_TYPE #undef RB_COMPONENTS -#undef CI_MODE #undef SPAN_VARS #undef INIT_PIXEL_PTR #undef INC_PIXEL_PTR -- cgit v1.2.3 From 6f317253bf987f6e9788eb913a587d1373192f1c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:51:40 -0800 Subject: fbdev: Remove support for color-index rendering Signed-off-by: Ian Romanick --- src/mesa/drivers/fbdev/glfbdev.c | 122 ++++++++++++--------------------------- 1 file changed, 36 insertions(+), 86 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index 4e369ceac4..e6ece69a64 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -70,7 +70,6 @@ #define PF_B8G8R8A8 2 #define PF_B5G6R5 3 #define PF_B5G5R5 4 -#define PF_CI8 5 /** @@ -264,25 +263,6 @@ viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) #include "swrast/s_spantemp.h" -/* 8-bit color index */ -#define NAME(PREFIX) PREFIX##_CI8 -#define CI_MODE -#define RB_TYPE GLubyte -#define SPAN_VARS \ - struct GLFBDevRenderbufferRec *frb = (struct GLFBDevRenderbufferRec *) rb; -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = frb->bottom - (Y) * frb->rowStride + (X) -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - *DST = VALUE[0] -#define FETCH_PIXEL(DST, SRC) \ - DST = SRC[0] - -#include "swrast/s_spantemp.h" - - - - /**********************************************************************/ /* Public API functions */ /**********************************************************************/ @@ -345,7 +325,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, { GLFBDevVisualPtr vis; const int *attrib; - GLboolean rgbFlag = GL_TRUE, dbFlag = GL_FALSE, stereoFlag = GL_FALSE; + GLboolean dbFlag = GL_FALSE, stereoFlag = GL_FALSE; GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0; GLint indexBits = 0, depthBits = 0, stencilBits = 0; GLint accumRedBits = 0, accumGreenBits = 0; @@ -367,9 +347,6 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, case GLFBDEV_DOUBLE_BUFFER: dbFlag = GL_TRUE; break; - case GLFBDEV_COLOR_INDEX: - rgbFlag = GL_FALSE; - break; case GLFBDEV_DEPTH_SIZE: depthBits = attrib[1]; attrib++; @@ -390,6 +367,8 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, numSamples = attrib[1]; attrib++; break; + case GLFBDEV_COLOR_INDEX: + /* Mesa no longer supports color-index rendering. */ default: /* unexpected token */ free(vis); @@ -397,60 +376,45 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, } } - if (rgbFlag) { - redBits = varInfo->red.length; - greenBits = varInfo->green.length; - blueBits = varInfo->blue.length; - alphaBits = varInfo->transp.length; - - if (fixInfo->visual == FB_VISUAL_TRUECOLOR || - fixInfo->visual == FB_VISUAL_DIRECTCOLOR) { - if (varInfo->bits_per_pixel == 24 - && varInfo->red.offset == 16 - && varInfo->green.offset == 8 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B8G8R8; - } - else if (varInfo->bits_per_pixel == 32 - && varInfo->red.offset == 16 - && varInfo->green.offset == 8 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B8G8R8A8; - } - else if (varInfo->bits_per_pixel == 16 - && varInfo->red.offset == 11 - && varInfo->green.offset == 5 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B5G6R5; - } - else if (varInfo->bits_per_pixel == 16 - && varInfo->red.offset == 10 - && varInfo->green.offset == 5 - && varInfo->blue.offset == 0) { - vis->pixelFormat = PF_B5G5R5; - } - else { - _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); - free(vis); - return NULL; - } + redBits = varInfo->red.length; + greenBits = varInfo->green.length; + blueBits = varInfo->blue.length; + alphaBits = varInfo->transp.length; + + if (fixInfo->visual == FB_VISUAL_TRUECOLOR || + fixInfo->visual == FB_VISUAL_DIRECTCOLOR) { + if (varInfo->bits_per_pixel == 24 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B8G8R8; } - } - else { - indexBits = varInfo->bits_per_pixel; - if ((fixInfo->visual == FB_VISUAL_PSEUDOCOLOR || - fixInfo->visual == FB_VISUAL_STATIC_PSEUDOCOLOR) - && varInfo->bits_per_pixel == 8) { - vis->pixelFormat = PF_CI8; + else if (varInfo->bits_per_pixel == 32 + && varInfo->red.offset == 16 + && varInfo->green.offset == 8 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B8G8R8A8; + } + else if (varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 11 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G6R5; + } + else if (varInfo->bits_per_pixel == 16 + && varInfo->red.offset == 10 + && varInfo->green.offset == 5 + && varInfo->blue.offset == 0) { + vis->pixelFormat = PF_B5G5R5; } else { - _mesa_problem(NULL, "Unsupported fbdev CI visual/bitdepth!\n"); + _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n"); free(vis); return NULL; } } - if (!_mesa_initialize_visual(&vis->glvisual, rgbFlag, dbFlag, stereoFlag, + if (!_mesa_initialize_visual(&vis->glvisual, GL_TRUE, dbFlag, stereoFlag, redBits, greenBits, blueBits, alphaBits, indexBits, depthBits, stencilBits, accumRedBits, accumGreenBits, @@ -554,23 +518,9 @@ new_glfbdev_renderbuffer(void *bufferStart, const GLFBDevVisualPtr visual) rb->Base.PutValues = put_values_B5G5R5; rb->Base.PutMonoValues = put_mono_values_B5G5R5; } - else if (pixelFormat == PF_CI8) { - rb->Base.GetRow = get_row_CI8; - rb->Base.GetValues = get_values_CI8; - rb->Base.PutRow = put_row_CI8; - rb->Base.PutMonoRow = put_mono_row_CI8; - rb->Base.PutValues = put_values_CI8; - rb->Base.PutMonoValues = put_mono_values_CI8; - } - if (pixelFormat == PF_CI8) { - rb->Base.InternalFormat = GL_COLOR_INDEX8_EXT; - rb->Base._BaseFormat = GL_COLOR_INDEX; - } - else { - rb->Base.InternalFormat = GL_RGBA; - rb->Base._BaseFormat = GL_RGBA; - } + rb->Base.InternalFormat = GL_RGBA; + rb->Base._BaseFormat = GL_RGBA; rb->Base.DataType = GL_UNSIGNED_BYTE; rb->Base.Data = bufferStart; -- cgit v1.2.3 From 641705f0329c038079650089a664d76abfc5a937 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 16:59:27 -0800 Subject: osmesa: Remove support for color-index rendering Signed-off-by: Ian Romanick --- src/mesa/drivers/osmesa/osmesa.c | 78 ++++++---------------------------------- 1 file changed, 11 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index f9672d888e..bb6dbdf1c0 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -484,24 +484,6 @@ osmesa_update_state( GLcontext *ctx, GLuint new_state ) #include "swrast/s_spantemp.h" -/* color index */ -#define NAME(PREFIX) PREFIX##_CI -#define CI_MODE -#define RB_TYPE GLubyte -#define SPAN_VARS \ - const OSMesaContext osmesa = OSMESA_CONTEXT(ctx); -#define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *) osmesa->rowaddr[Y] + (X) -#define INC_PIXEL_PTR(P) P += 1 -#define STORE_PIXEL(DST, X, Y, VALUE) \ - *DST = VALUE[0] -#define FETCH_PIXEL(DST, SRC) \ - DST = SRC[0] -#include "swrast/s_spantemp.h" - - - - /** * Macros for optimized line/triangle rendering. * Only for 8-bit channel, RGBA, BGRA, ARGB formats. @@ -776,11 +758,7 @@ compute_row_addresses( OSMesaContext osmesa ) return; } - if (osmesa->format == OSMESA_COLOR_INDEX) { - /* CI mode */ - bytesPerPixel = 1 * sizeof(GLubyte); - } - else if ((osmesa->format == OSMESA_RGB) || (osmesa->format == OSMESA_BGR)) { + if ((osmesa->format == OSMESA_RGB) || (osmesa->format == OSMESA_BGR)) { /* RGB mode */ bytesPerPixel = 3 * bpc; } @@ -999,14 +977,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutValues = put_values_RGB_565; rb->PutMonoValues = put_mono_values_RGB_565; } - else if (osmesa->format == OSMESA_COLOR_INDEX) { - rb->GetRow = get_row_CI; - rb->GetValues = get_values_CI; - rb->PutRow = put_row_CI; - rb->PutMonoRow = put_mono_row_CI; - rb->PutValues = put_values_CI; - rb->PutMonoValues = put_mono_values_CI; - } else { _mesa_problem(ctx, "bad pixel format in osmesa renderbuffer_storage"); } @@ -1033,18 +1003,10 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type) rb->Delete = osmesa_delete_renderbuffer; rb->AllocStorage = osmesa_renderbuffer_storage; - if (format == OSMESA_COLOR_INDEX) { - rb->InternalFormat = GL_COLOR_INDEX; - rb->Format = MESA_FORMAT_CI8; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_BYTE; - } - else { - rb->InternalFormat = GL_RGBA; - rb->Format = MESA_FORMAT_RGBA8888; - rb->_BaseFormat = GL_RGBA; - rb->DataType = type; - } + rb->InternalFormat = GL_RGBA; + rb->Format = MESA_FORMAT_RGBA8888; + rb->_BaseFormat = GL_RGBA; + rb->DataType = type; } return rb; } @@ -1059,7 +1021,7 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type) * Create an Off-Screen Mesa rendering context. The only attribute needed is * an RGBA vs Color-Index mode flag. * - * Input: format - either GL_RGBA or GL_COLOR_INDEX + * Input: format - Must be GL_RGBA * sharelist - specifies another OSMesaContext with which to share * display lists. NULL indicates no sharing. * Return: an OSMesaContext or 0 if error @@ -1067,9 +1029,8 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type) GLAPI OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, OSMesaContext sharelist ) { - const GLint accumBits = (format == OSMESA_COLOR_INDEX) ? 0 : 16; return OSMesaCreateContextExt(format, DEFAULT_SOFTWARE_DEPTH_BITS, - 8, accumBits, sharelist); + 8, 0, sharelist); } @@ -1086,17 +1047,11 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, OSMesaContext osmesa; struct dd_function_table functions; GLint rind, gind, bind, aind; - GLint indexBits = 0, redBits = 0, greenBits = 0, blueBits = 0, alphaBits =0; - GLboolean rgbmode; + GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits =0; GLenum type = CHAN_TYPE; rind = gind = bind = aind = 0; - if (format==OSMESA_COLOR_INDEX) { - indexBits = 8; - rgbmode = GL_FALSE; - } - else if (format==OSMESA_RGBA) { - indexBits = 0; + if (format==OSMESA_RGBA) { redBits = CHAN_BITS; greenBits = CHAN_BITS; blueBits = CHAN_BITS; @@ -1105,10 +1060,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, gind = 1; bind = 2; aind = 3; - rgbmode = GL_TRUE; } else if (format==OSMESA_BGRA) { - indexBits = 0; redBits = CHAN_BITS; greenBits = CHAN_BITS; blueBits = CHAN_BITS; @@ -1117,10 +1070,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, gind = 1; rind = 2; aind = 3; - rgbmode = GL_TRUE; } else if (format==OSMESA_ARGB) { - indexBits = 0; redBits = CHAN_BITS; greenBits = CHAN_BITS; blueBits = CHAN_BITS; @@ -1129,10 +1080,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, rind = 1; gind = 2; bind = 3; - rgbmode = GL_TRUE; } else if (format==OSMESA_RGB) { - indexBits = 0; redBits = CHAN_BITS; greenBits = CHAN_BITS; blueBits = CHAN_BITS; @@ -1140,10 +1089,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, rind = 0; gind = 1; bind = 2; - rgbmode = GL_TRUE; } else if (format==OSMESA_BGR) { - indexBits = 0; redBits = CHAN_BITS; greenBits = CHAN_BITS; blueBits = CHAN_BITS; @@ -1151,11 +1098,9 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, rind = 2; gind = 1; bind = 0; - rgbmode = GL_TRUE; } #if CHAN_TYPE == GL_UNSIGNED_BYTE else if (format==OSMESA_RGB_565) { - indexBits = 0; redBits = 5; greenBits = 6; blueBits = 5; @@ -1163,7 +1108,6 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, rind = 0; /* not used */ gind = 0; bind = 0; - rgbmode = GL_TRUE; } #endif else { @@ -1172,14 +1116,14 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context); if (osmesa) { - osmesa->gl_visual = _mesa_create_visual( rgbmode, + osmesa->gl_visual = _mesa_create_visual( GL_TRUE, /* rgbMode */ GL_FALSE, /* double buffer */ GL_FALSE, /* stereo */ redBits, greenBits, blueBits, alphaBits, - indexBits, + 0, depthBits, stencilBits, accumBits, -- cgit v1.2.3 From 81fe9949ef0293f7a6e076bd6e56f6a5340a1dc3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 17:44:28 -0800 Subject: mesa/xlib: Remove support for color-index rendering Signed-off-by: Ian Romanick --- src/mesa/drivers/x11/fakeglx.c | 343 ++++++++++++--------------------------- src/mesa/drivers/x11/xm_api.c | 112 ++++++------- src/mesa/drivers/x11/xm_buffer.c | 16 +- 3 files changed, 153 insertions(+), 318 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 33a3ff6d5f..f1e62b6bd4 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -152,13 +152,8 @@ is_usable_visual( XVisualInfo *vinfo ) return GL_TRUE; case StaticColor: case PseudoColor: - /* Any StaticColor/PseudoColor visual of at least 4 bits */ - if (vinfo->depth>=4) { - return GL_TRUE; - } - else { - return GL_FALSE; - } + /* Color-index rendering is not supported. */ + return GL_FALSE; case TrueColor: case DirectColor: /* Any depth of TrueColor or DirectColor works in RGB mode */ @@ -268,7 +263,7 @@ level_of_visual( Display *dpy, XVisualInfo *vinfo ) */ static XMesaVisual save_glx_visual( Display *dpy, XVisualInfo *vinfo, - GLboolean rgbFlag, GLboolean alphaFlag, GLboolean dbFlag, + GLboolean alphaFlag, GLboolean dbFlag, GLboolean stereoFlag, GLint depth_size, GLint stencil_size, GLint accumRedSize, GLint accumGreenSize, @@ -309,7 +304,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, comparePointers = GL_FALSE; /* Force the visual to have an alpha channel */ - if (rgbFlag && _mesa_getenv("MESA_GLX_FORCE_ALPHA")) + if (_mesa_getenv("MESA_GLX_FORCE_ALPHA")) alphaFlag = GL_TRUE; /* First check if a matching visual is already in the list */ @@ -319,7 +314,6 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, && v->mesa_visual.level == level && v->mesa_visual.numAuxBuffers == numAuxBuffers && v->ximage_flag == ximageFlag - && v->mesa_visual.rgbMode == rgbFlag && v->mesa_visual.doubleBufferMode == dbFlag && v->mesa_visual.stereoMode == stereoFlag && (v->mesa_visual.alphaBits > 0) == alphaFlag @@ -339,7 +333,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, /* Create a new visual and add it to the list. */ - xmvis = XMesaCreateVisual( dpy, vinfo, rgbFlag, alphaFlag, dbFlag, + xmvis = XMesaCreateVisual( dpy, vinfo, GL_TRUE, alphaFlag, dbFlag, stereoFlag, ximageFlag, depth_size, stencil_size, accumRedSize, accumBlueSize, @@ -422,53 +416,26 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo ) vislevel = level_of_visual( dpy, visinfo ); if (vislevel) { - /* Configure this visual as a CI, single-buffered overlay */ - return save_glx_visual( dpy, visinfo, - GL_FALSE, /* rgb */ - GL_FALSE, /* alpha */ - GL_FALSE, /* double */ - GL_FALSE, /* stereo */ - 0, /* depth bits */ - 0, /* stencil bits */ - 0,0,0,0, /* accum bits */ - vislevel, /* level */ - 0 /* numAux */ - ); + /* Color-index rendering to overlays is not supported. */ + return NULL; } else if (is_usable_visual( visinfo )) { - if (_mesa_getenv("MESA_GLX_FORCE_CI")) { - /* Configure this visual as a COLOR INDEX visual. */ - return save_glx_visual( dpy, visinfo, - GL_FALSE, /* rgb */ - GL_FALSE, /* alpha */ - GL_TRUE, /* double */ - GL_FALSE, /* stereo */ - zBits, - STENCIL_BITS, - 0, 0, 0, 0, /* accum bits */ - 0, /* level */ - 0 /* numAux */ - ); - } - else { - /* Configure this visual as RGB, double-buffered, depth-buffered. */ - /* This is surely wrong for some people's needs but what else */ - /* can be done? They should use glXChooseVisual(). */ - return save_glx_visual( dpy, visinfo, - GL_TRUE, /* rgb */ - alphaFlag, /* alpha */ - GL_TRUE, /* double */ - GL_FALSE, /* stereo */ - zBits, - STENCIL_BITS, - accBits, /* r */ - accBits, /* g */ - accBits, /* b */ - accBits, /* a */ - 0, /* level */ - 0 /* numAux */ - ); - } + /* Configure this visual as RGB, double-buffered, depth-buffered. */ + /* This is surely wrong for some people's needs but what else */ + /* can be done? They should use glXChooseVisual(). */ + return save_glx_visual( dpy, visinfo, + alphaFlag, /* alpha */ + GL_TRUE, /* double */ + GL_FALSE, /* stereo */ + zBits, + STENCIL_BITS, + accBits, /* r */ + accBits, /* g */ + accBits, /* b */ + accBits, /* a */ + 0, /* level */ + 0 /* numAux */ + ); } else { _mesa_warning(NULL, "Mesa: error in glXCreateContext: bad visual\n"); @@ -623,8 +590,6 @@ get_env_visual(Display *dpy, int scr, const char *varname) if (strcmp(type,"TrueColor")==0) xclass = TrueColor; else if (strcmp(type,"DirectColor")==0) xclass = DirectColor; - else if (strcmp(type,"PseudoColor")==0) xclass = PseudoColor; - else if (strcmp(type,"StaticColor")==0) xclass = StaticColor; else if (strcmp(type,"GrayScale")==0) xclass = GrayScale; else if (strcmp(type,"StaticGray")==0) xclass = StaticGray; @@ -646,160 +611,79 @@ get_env_visual(Display *dpy, int scr, const char *varname) /* * Select an X visual which satisfies the RGBA/CI flag and minimum depth. * Input: dpy, screen - X display and screen number - * rgba - GL_TRUE = RGBA mode, GL_FALSE = CI mode * min_depth - minimum visual depth * preferred_class - preferred GLX visual class or DONT_CARE * Return: pointer to an XVisualInfo or NULL. */ static XVisualInfo * -choose_x_visual( Display *dpy, int screen, GLboolean rgba, int min_depth, - int preferred_class ) +choose_x_visual(Display *dpy, int screen, int min_depth, int preferred_class) { XVisualInfo *vis; int xclass, visclass = 0; int depth; - if (rgba) { - Atom hp_cr_maps = XInternAtom(dpy, "_HP_RGB_SMOOTH_MAP_LIST", True); - /* First see if the MESA_RGB_VISUAL env var is defined */ - vis = get_env_visual( dpy, screen, "MESA_RGB_VISUAL" ); - if (vis) { - return vis; - } - /* Otherwise, search for a suitable visual */ - if (preferred_class==DONT_CARE) { - for (xclass=0;xclass<6;xclass++) { - switch (xclass) { - case 0: visclass = TrueColor; break; - case 1: visclass = DirectColor; break; - case 2: visclass = PseudoColor; break; - case 3: visclass = StaticColor; break; - case 4: visclass = GrayScale; break; - case 5: visclass = StaticGray; break; - } - if (min_depth==0) { - /* start with shallowest */ - for (depth=0;depth<=32;depth++) { - if (visclass==TrueColor && depth==8 && !hp_cr_maps) { - /* Special case: try to get 8-bit PseudoColor before */ - /* 8-bit TrueColor */ - vis = get_visual( dpy, screen, 8, PseudoColor ); - if (vis) { - return vis; - } - } - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } - } - else { - /* start with deepest */ - for (depth=32;depth>=min_depth;depth--) { - if (visclass==TrueColor && depth==8 && !hp_cr_maps) { - /* Special case: try to get 8-bit PseudoColor before */ - /* 8-bit TrueColor */ - vis = get_visual( dpy, screen, 8, PseudoColor ); - if (vis) { - return vis; - } - } - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } - } - } - } - else { - /* search for a specific visual class */ - switch (preferred_class) { - case GLX_TRUE_COLOR_EXT: visclass = TrueColor; break; - case GLX_DIRECT_COLOR_EXT: visclass = DirectColor; break; - case GLX_PSEUDO_COLOR_EXT: visclass = PseudoColor; break; - case GLX_STATIC_COLOR_EXT: visclass = StaticColor; break; - case GLX_GRAY_SCALE_EXT: visclass = GrayScale; break; - case GLX_STATIC_GRAY_EXT: visclass = StaticGray; break; - default: return NULL; - } - if (min_depth==0) { - /* start with shallowest */ - for (depth=0;depth<=32;depth++) { - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } - } - else { - /* start with deepest */ - for (depth=32;depth>=min_depth;depth--) { - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } - } + /* First see if the MESA_RGB_VISUAL env var is defined */ + vis = get_env_visual( dpy, screen, "MESA_RGB_VISUAL" ); + if (vis) { + return vis; + } + /* Otherwise, search for a suitable visual */ + if (preferred_class==DONT_CARE) { + for (xclass=0;xclass<4;xclass++) { + switch (xclass) { + case 0: visclass = TrueColor; break; + case 1: visclass = DirectColor; break; + case 2: visclass = GrayScale; break; + case 3: visclass = StaticGray; break; + } + if (min_depth==0) { + /* start with shallowest */ + for (depth=0;depth<=32;depth++) { + vis = get_visual( dpy, screen, depth, visclass ); + if (vis) { + return vis; + } + } + } + else { + /* start with deepest */ + for (depth=32;depth>=min_depth;depth--) { + vis = get_visual( dpy, screen, depth, visclass ); + if (vis) { + return vis; + } + } + } } } else { - /* First see if the MESA_CI_VISUAL env var is defined */ - vis = get_env_visual( dpy, screen, "MESA_CI_VISUAL" ); - if (vis) { - return vis; + /* search for a specific visual class */ + switch (preferred_class) { + case GLX_TRUE_COLOR_EXT: visclass = TrueColor; break; + case GLX_DIRECT_COLOR_EXT: visclass = DirectColor; break; + case GLX_GRAY_SCALE_EXT: visclass = GrayScale; break; + case GLX_STATIC_GRAY_EXT: visclass = StaticGray; break; + case GLX_PSEUDO_COLOR_EXT: + case GLX_STATIC_COLOR_EXT: + default: return NULL; } - /* Otherwise, search for a suitable visual, starting with shallowest */ - if (preferred_class==DONT_CARE) { - for (xclass=0;xclass<4;xclass++) { - switch (xclass) { - case 0: visclass = PseudoColor; break; - case 1: visclass = StaticColor; break; - case 2: visclass = GrayScale; break; - case 3: visclass = StaticGray; break; - } - /* try 8-bit up through 16-bit */ - for (depth=8;depth<=16;depth++) { - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } - /* try min_depth up to 8-bit */ - for (depth=min_depth;depth<8;depth++) { - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } - } + if (min_depth==0) { + /* start with shallowest */ + for (depth=0;depth<=32;depth++) { + vis = get_visual( dpy, screen, depth, visclass ); + if (vis) { + return vis; + } + } } else { - /* search for a specific visual class */ - switch (preferred_class) { - case GLX_TRUE_COLOR_EXT: visclass = TrueColor; break; - case GLX_DIRECT_COLOR_EXT: visclass = DirectColor; break; - case GLX_PSEUDO_COLOR_EXT: visclass = PseudoColor; break; - case GLX_STATIC_COLOR_EXT: visclass = StaticColor; break; - case GLX_GRAY_SCALE_EXT: visclass = GrayScale; break; - case GLX_STATIC_GRAY_EXT: visclass = StaticGray; break; - default: return NULL; - } - /* try 8-bit up through 16-bit */ - for (depth=8;depth<=16;depth++) { - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } - /* try min_depth up to 8-bit */ - for (depth=min_depth;depth<8;depth++) { - vis = get_visual( dpy, screen, depth, visclass ); - if (vis) { - return vis; - } - } + /* start with deepest */ + for (depth=32;depth>=min_depth;depth--) { + vis = get_visual( dpy, screen, depth, visclass ); + if (vis) { + return vis; + } + } } } @@ -822,7 +706,7 @@ choose_x_visual( Display *dpy, int screen, GLboolean rgba, int min_depth, * Return: pointer to an XVisualInfo or NULL. */ static XVisualInfo * -choose_x_overlay_visual( Display *dpy, int scr, GLboolean rgbFlag, +choose_x_overlay_visual( Display *dpy, int scr, int level, int trans_type, int trans_value, int min_depth, int preferred_class ) { @@ -889,14 +773,8 @@ choose_x_overlay_visual( Display *dpy, int scr, GLboolean rgbFlag, continue; } - /* if RGB was requested, make sure we have True/DirectColor */ - if (rgbFlag && vislist->CLASS != TrueColor - && vislist->CLASS != DirectColor) - continue; - - /* if CI was requested, make sure we have a color indexed visual */ - if (!rgbFlag - && (vislist->CLASS == TrueColor || vislist->CLASS == DirectColor)) + /* Color-index rendering is not supported. Make sure we have True/DirectColor */ + if (vislist->CLASS != TrueColor && vislist->CLASS != DirectColor) continue; if (deepvis==NULL || vislist->depth > deepest) { @@ -1266,6 +1144,9 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) } } + if (!rgb_flag) + return NULL; + (void) caveat; /* @@ -1285,46 +1166,27 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) if (vis) { /* give the visual some useful GLX attributes */ double_flag = GL_TRUE; - if (vis->depth > 8) - rgb_flag = GL_TRUE; + if (vis->depth <= 8) + return NULL; depth_size = default_depth_bits(); stencil_size = STENCIL_BITS; /* XXX accum??? */ } } - else if (level==0) { - /* normal color planes */ - if (rgb_flag) { - /* Get an RGB visual */ - int min_rgb = min_red + min_green + min_blue; - if (min_rgb>1 && min_rgb<8) { - /* a special case to be sure we can get a monochrome visual */ - min_rgb = 1; - } - vis = choose_x_visual( dpy, screen, rgb_flag, min_rgb, visual_type ); - } - else { - /* Get a color index visual */ - vis = choose_x_visual( dpy, screen, rgb_flag, min_ci, visual_type ); - accumRedSize = accumGreenSize = accumBlueSize = accumAlphaSize = 0; - } - } else { - /* over/underlay planes */ - if (rgb_flag) { - /* rgba overlay */ - int min_rgb = min_red + min_green + min_blue; - if (min_rgb>1 && min_rgb<8) { - /* a special case to be sure we can get a monochrome visual */ - min_rgb = 1; - } - vis = choose_x_overlay_visual( dpy, screen, rgb_flag, level, - trans_type, trans_value, min_rgb, visual_type ); + /* RGB visual */ + int min_rgb = min_red + min_green + min_blue; + if (min_rgb>1 && min_rgb<8) { + /* a special case to be sure we can get a monochrome visual */ + min_rgb = 1; + } + + if (level==0) { + vis = choose_x_visual(dpy, screen, min_rgb, visual_type); } else { - /* color index overlay */ - vis = choose_x_overlay_visual( dpy, screen, rgb_flag, level, - trans_type, trans_value, min_ci, visual_type ); + vis = choose_x_overlay_visual(dpy, screen, level, + trans_type, trans_value, min_rgb, visual_type); } } @@ -1357,7 +1219,7 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) accumAlphaSize = alpha_flag ? accumRedSize : 0; } - xmvis = save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag, + xmvis = save_glx_visual( dpy, vis, alpha_flag, double_flag, stereo_flag, depth_size, stencil_size, accumRedSize, accumGreenSize, accumBlueSize, accumAlphaSize, level, numAux ); @@ -2493,10 +2355,7 @@ Fake_glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value ) *value = xmctx->xm_visual->visinfo->visualid; break; case GLX_RENDER_TYPE: - if (xmctx->xm_visual->mesa_visual.rgbMode) - *value = GLX_RGBA_TYPE; - else - *value = GLX_COLOR_INDEX_TYPE; + *value = GLX_RGBA_TYPE; break; case GLX_SCREEN: *value = 0; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 3711c88148..c59df55166 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -684,9 +684,7 @@ setup_grayscale(int client, XMesaVisual v, } prevBuffer = xmesa_find_buffer(v->display, cmap, buffer); - if (prevBuffer && - (buffer->xm_visual->mesa_visual.rgbMode == - prevBuffer->xm_visual->mesa_visual.rgbMode)) { + if (prevBuffer) { /* Copy colormap stuff from previous XMesaBuffer which uses same * X colormap. Do this to avoid time spent in noFaultXAllocColor. */ @@ -773,9 +771,7 @@ setup_dithered_color(int client, XMesaVisual v, } prevBuffer = xmesa_find_buffer(v->display, cmap, buffer); - if (prevBuffer && - (buffer->xm_visual->mesa_visual.rgbMode == - prevBuffer->xm_visual->mesa_visual.rgbMode)) { + if (prevBuffer) { /* Copy colormap stuff from previous, matching XMesaBuffer. * Do this to avoid time spent in noFaultXAllocColor. */ @@ -1047,10 +1043,11 @@ setup_monochrome( XMesaVisual v, XMesaBuffer b ) */ static GLboolean initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, - GLboolean rgb_flag, XMesaDrawable window, + XMesaDrawable window, XMesaColormap cmap) { int client = 0; + const int xclass = v->mesa_visual.visualType; #ifdef XFree86Server client = (window) ? CLIENT_ID(window->id) : 0; @@ -1062,45 +1059,34 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, v->BitsPerPixel = bits_per_pixel(v); assert(v->BitsPerPixel > 0); - if (rgb_flag == GL_FALSE) { - /* COLOR-INDEXED WINDOW: - * Even if the visual is TrueColor or DirectColor we treat it as - * being color indexed. This is weird but might be useful to someone. - */ - v->dithered_pf = v->undithered_pf = PF_Index; - v->mesa_visual.indexBits = GET_VISUAL_DEPTH(v); + /* RGB WINDOW: + * We support RGB rendering into almost any kind of visual. + */ + if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) { + setup_truecolor( v, b, cmap ); } - else { - /* RGB WINDOW: - * We support RGB rendering into almost any kind of visual. - */ - const int xclass = v->mesa_visual.visualType; - if (xclass == GLX_TRUE_COLOR || xclass == GLX_DIRECT_COLOR) { - setup_truecolor( v, b, cmap ); - } - else if (xclass == GLX_STATIC_GRAY && GET_VISUAL_DEPTH(v) == 1) { - setup_monochrome( v, b ); - } - else if (xclass == GLX_GRAY_SCALE || xclass == GLX_STATIC_GRAY) { - if (!setup_grayscale( client, v, b, cmap )) { - return GL_FALSE; - } - } - else if ((xclass == GLX_PSEUDO_COLOR || xclass == GLX_STATIC_COLOR) - && GET_VISUAL_DEPTH(v)>=4 && GET_VISUAL_DEPTH(v)<=16) { - if (!setup_dithered_color( client, v, b, cmap )) { - return GL_FALSE; - } + else if (xclass == GLX_STATIC_GRAY && GET_VISUAL_DEPTH(v) == 1) { + setup_monochrome( v, b ); + } + else if (xclass == GLX_GRAY_SCALE || xclass == GLX_STATIC_GRAY) { + if (!setup_grayscale( client, v, b, cmap )) { + return GL_FALSE; } - else { - _mesa_warning(NULL, "XMesa: RGB mode rendering not supported in given visual.\n"); + } + else if ((xclass == GLX_PSEUDO_COLOR || xclass == GLX_STATIC_COLOR) + && GET_VISUAL_DEPTH(v)>=4 && GET_VISUAL_DEPTH(v)<=16) { + if (!setup_dithered_color( client, v, b, cmap )) { return GL_FALSE; } - v->mesa_visual.indexBits = 0; + } + else { + _mesa_warning(NULL, "XMesa: RGB mode rendering not supported in given visual.\n"); + return GL_FALSE; + } + v->mesa_visual.indexBits = 0; - if (_mesa_getenv("MESA_NO_DITHER")) { - v->dithered_pf = v->undithered_pf; - } + if (_mesa_getenv("MESA_NO_DITHER")) { + v->dithered_pf = v->undithered_pf; } @@ -1359,6 +1345,10 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, } #endif + /* Color-index rendering not supported. */ + if (!rgb_flag) + return NULL; + v = (XMesaVisual) CALLOC_STRUCT(xmesa_visual); if (!v) { return NULL; @@ -1428,7 +1418,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, if (alpha_flag) v->mesa_visual.alphaBits = 8; - (void) initialize_visual_and_buffer( v, NULL, rgb_flag, 0, 0 ); + (void) initialize_visual_and_buffer( v, NULL, 0, 0 ); { const int xclass = v->mesa_visual.visualType; @@ -1453,7 +1443,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, } _mesa_initialize_visual( &v->mesa_visual, - rgb_flag, db_flag, stereo_flag, + GL_TRUE, db_flag, stereo_flag, red_bits, green_bits, blue_bits, alpha_bits, v->mesa_visual.indexBits, @@ -1655,8 +1645,7 @@ XMesaCreateWindowBuffer(XMesaVisual v, XMesaWindow w) if (!b) return NULL; - if (!initialize_visual_and_buffer( v, b, v->mesa_visual.rgbMode, - (XMesaDrawable) w, cmap )) { + if (!initialize_visual_and_buffer( v, b, (XMesaDrawable) w, cmap )) { xmesa_free_buffer(b); return NULL; } @@ -1686,8 +1675,7 @@ XMesaCreatePixmapBuffer(XMesaVisual v, XMesaPixmap p, XMesaColormap cmap) if (!b) return NULL; - if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode, - (XMesaDrawable) p, cmap)) { + if (!initialize_visual_and_buffer(v, b, (XMesaDrawable) p, cmap)) { xmesa_free_buffer(b); return NULL; } @@ -1747,8 +1735,7 @@ XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p, b->TextureFormat = format; b->TextureMipmap = mipmap; - if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode, - (XMesaDrawable) p, cmap)) { + if (!initialize_visual_and_buffer(v, b, (XMesaDrawable) p, cmap)) { xmesa_free_buffer(b); return NULL; } @@ -1778,8 +1765,7 @@ XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, if (!b) return NULL; - if (!initialize_visual_and_buffer(v, b, v->mesa_visual.rgbMode, - drawable, cmap)) { + if (!initialize_visual_and_buffer(v, b, drawable, cmap)) { xmesa_free_buffer(b); return NULL; } @@ -1874,19 +1860,17 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, &drawBuffer->mesa_buffer, &readBuffer->mesa_buffer); - if (c->xm_visual->mesa_visual.rgbMode) { - /* - * Must recompute and set these pixel values because colormap - * can be different for different windows. - */ - c->clearpixel = xmesa_color_to_pixel( &c->mesa, - c->clearcolor[0], - c->clearcolor[1], - c->clearcolor[2], - c->clearcolor[3], - c->xm_visual->undithered_pf); - XMesaSetForeground(c->display, drawBuffer->cleargc, c->clearpixel); - } + /* + * Must recompute and set these pixel values because colormap + * can be different for different windows. + */ + c->clearpixel = xmesa_color_to_pixel( &c->mesa, + c->clearcolor[0], + c->clearcolor[1], + c->clearcolor[2], + c->clearcolor[3], + c->xm_visual->undithered_pf); + XMesaSetForeground(c->display, drawBuffer->cleargc, c->clearpixel); /* Solution to Stephane Rehel's problem with glXReleaseBuffersMESA(): */ drawBuffer->wasCurrent = GL_TRUE; diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 5ffe110484..e47949750a 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -337,18 +337,10 @@ xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual, else xrb->Base.AllocStorage = xmesa_alloc_front_storage; - if (visual->rgbMode) { - xrb->Base.InternalFormat = GL_RGBA; - xrb->Base.Format = MESA_FORMAT_RGBA8888; - xrb->Base._BaseFormat = GL_RGBA; - xrb->Base.DataType = GL_UNSIGNED_BYTE; - } - else { - xrb->Base.InternalFormat = GL_COLOR_INDEX; - xrb->Base.Format = MESA_FORMAT_CI8; - xrb->Base._BaseFormat = GL_COLOR_INDEX; - xrb->Base.DataType = GL_UNSIGNED_INT; - } + xrb->Base.InternalFormat = GL_RGBA; + xrb->Base.Format = MESA_FORMAT_RGBA8888; + xrb->Base._BaseFormat = GL_RGBA; + xrb->Base.DataType = GL_UNSIGNED_BYTE; /* only need to set Red/Green/EtcBits fields for user-created RBs */ } return xrb; -- cgit v1.2.3 From 859c98c392c1fa71911edf983dc94a201f2bf0e6 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 17:48:27 -0800 Subject: swrast: Remove color-index rendering support from s_spantemp.h Signed-off-by: Ian Romanick --- src/mesa/swrast/s_spantemp.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h index bab2ca7378..2948a90f6b 100644 --- a/src/mesa/swrast/s_spantemp.h +++ b/src/mesa/swrast/s_spantemp.h @@ -31,7 +31,6 @@ * Define the following macros before including this file: * NAME(BASE) to generate the function name (i.e. add prefix or suffix) * RB_TYPE the renderbuffer DataType - * CI_MODE if set, color index mode, else RGBA * SPAN_VARS to declare any local variables * INIT_PIXEL_PTR(P, X, Y) to initialize a pointer to a pixel * INC_PIXEL_PTR(P) to increment a pixel pointer by one pixel @@ -46,9 +45,7 @@ #include "main/macros.h" -#ifdef CI_MODE -#define RB_COMPONENTS 1 -#elif !defined(RB_COMPONENTS) +#if !defined(RB_COMPONENTS) #define RB_COMPONENTS 4 #endif @@ -60,11 +57,7 @@ NAME(get_row)( GLcontext *ctx, struct gl_renderbuffer *rb, #ifdef SPAN_VARS SPAN_VARS #endif -#ifdef CI_MODE - RB_TYPE *dest = (RB_TYPE *) values; -#else RB_TYPE (*dest)[RB_COMPONENTS] = (RB_TYPE (*)[RB_COMPONENTS]) values; -#endif GLuint i; INIT_PIXEL_PTR(pixel, x, y); for (i = 0; i < count; i++) { @@ -82,11 +75,7 @@ NAME(get_values)( GLcontext *ctx, struct gl_renderbuffer *rb, #ifdef SPAN_VARS SPAN_VARS #endif -#ifdef CI_MODE - RB_TYPE *dest = (RB_TYPE *) values; -#else RB_TYPE (*dest)[RB_COMPONENTS] = (RB_TYPE (*)[RB_COMPONENTS]) values; -#endif GLuint i; for (i = 0; i < count; i++) { INIT_PIXEL_PTR(pixel, x[i], y[i]); @@ -125,7 +114,6 @@ NAME(put_row)( GLcontext *ctx, struct gl_renderbuffer *rb, } -#if !defined(CI_MODE) static void NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLint x, GLint y, @@ -149,7 +137,6 @@ NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb, } (void) rb; } -#endif static void @@ -226,7 +213,6 @@ NAME(put_mono_values)( GLcontext *ctx, struct gl_renderbuffer *rb, #undef NAME #undef RB_TYPE #undef RB_COMPONENTS -#undef CI_MODE #undef SPAN_VARS #undef INIT_PIXEL_PTR #undef INC_PIXEL_PTR -- cgit v1.2.3 From e650c07f47ac6f49a4dfcb58290fd049092fb768 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 18:15:40 -0800 Subject: swrast_setup: Remove more color-index rendering support Signed-off-by: Ian Romanick --- src/mesa/swrast_setup/ss_context.c | 16 ++-- src/mesa/swrast_setup/ss_triangle.c | 74 +++--------------- src/mesa/swrast_setup/ss_tritmp.h | 144 ++++++++++++++++-------------------- 3 files changed, 79 insertions(+), 155 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index 23d3cb3807..bc1ec58992 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -294,18 +294,12 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_GENERIC0 + i, dest->attrib[FRAG_ATTRIB_VAR0 + i] ); - if (ctx->Visual.rgbMode) { - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, - dest->attrib[FRAG_ATTRIB_COL0] ); - UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); + _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, + dest->attrib[FRAG_ATTRIB_COL0] ); + UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, - dest->attrib[FRAG_ATTRIB_COL1]); - } - else { - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR_INDEX, tmp ); - dest->attrib[FRAG_ATTRIB_CI][0] = tmp[0]; - } + _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, + dest->attrib[FRAG_ATTRIB_COL1]); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp ); dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0]; diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index e15b1348d8..bad0d81946 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -35,11 +35,10 @@ #include "ss_triangle.h" #include "ss_context.h" -#define SS_RGBA_BIT 0x1 -#define SS_OFFSET_BIT 0x2 -#define SS_TWOSIDE_BIT 0x4 -#define SS_UNFILLED_BIT 0x8 -#define SS_MAX_TRIFUNC 0x10 +#define SS_OFFSET_BIT 0x1 +#define SS_TWOSIDE_BIT 0x2 +#define SS_UNFILLED_BIT 0x4 +#define SS_MAX_TRIFUNC 0x8 static tnl_triangle_func tri_tab[SS_MAX_TRIFUNC]; static tnl_quad_func quad_tab[SS_MAX_TRIFUNC]; @@ -134,23 +133,18 @@ static void _swsetup_render_tri(GLcontext *ctx, if (ctx->Light.ShadeModel == GL_FLAT) { GLchan c[2][4]; GLfloat s[2][4]; - GLfloat i[2]; /* save colors/indexes for v0, v1 vertices */ COPY_CHAN4(c[0], v0->color); COPY_CHAN4(c[1], v1->color); COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]); COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]); - i[0] = v0->attrib[FRAG_ATTRIB_CI][0]; - i[1] = v1->attrib[FRAG_ATTRIB_CI][0]; /* copy v2 color/indexes to v0, v1 indexes */ COPY_CHAN4(v0->color, v2->color); COPY_CHAN4(v1->color, v2->color); COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); - v0->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; - v1->attrib[FRAG_ATTRIB_CI][0] = v2->attrib[FRAG_ATTRIB_CI][0]; render(ctx, ef, e0, e1, e2, v0, v1, v2); @@ -158,8 +152,6 @@ static void _swsetup_render_tri(GLcontext *ctx, COPY_CHAN4(v1->color, c[1]); COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]); COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]); - v0->attrib[FRAG_ATTRIB_CI][0] = i[0]; - v1->attrib[FRAG_ATTRIB_CI][0] = i[1]; } else { render(ctx, ef, e0, e1, e2, v0, v1, v2); @@ -171,66 +163,34 @@ static void _swsetup_render_tri(GLcontext *ctx, #define SS_IND(a,b) (a = b) #define IND (0) -#define TAG(x) x -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT) -#define TAG(x) x##_offset -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT) -#define TAG(x) x##_offset_twoside -#include "ss_tritmp.h" - -#define IND (SS_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_offset_twoside_unfilled -#include "ss_tritmp.h" - -#define IND (0|SS_RGBA_BIT) #define TAG(x) x##_rgba #include "ss_tritmp.h" -#define IND (SS_OFFSET_BIT|SS_RGBA_BIT) +#define IND (SS_OFFSET_BIT) #define TAG(x) x##_offset_rgba #include "ss_tritmp.h" -#define IND (SS_TWOSIDE_BIT|SS_RGBA_BIT) +#define IND (SS_TWOSIDE_BIT) #define TAG(x) x##_twoside_rgba #include "ss_tritmp.h" -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_RGBA_BIT) +#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT) #define TAG(x) x##_offset_twoside_rgba #include "ss_tritmp.h" -#define IND (SS_UNFILLED_BIT|SS_RGBA_BIT) +#define IND (SS_UNFILLED_BIT) #define TAG(x) x##_unfilled_rgba #include "ss_tritmp.h" -#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) +#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT) #define TAG(x) x##_offset_unfilled_rgba #include "ss_tritmp.h" -#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) +#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT) #define TAG(x) x##_twoside_unfilled_rgba #include "ss_tritmp.h" -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) +#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT) #define TAG(x) x##_offset_twoside_unfilled_rgba #include "ss_tritmp.h" @@ -239,15 +199,6 @@ void _swsetup_trifuncs_init( GLcontext *ctx ) { (void) ctx; - init(); - init_offset(); - init_twoside(); - init_offset_twoside(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_offset_twoside_unfilled(); - init_rgba(); init_offset_rgba(); init_twoside_rgba(); @@ -307,9 +258,6 @@ void _swsetup_choose_trifuncs( GLcontext *ctx ) (ctx->Stencil.Enabled && ctx->Stencil._TestTwoSide)) ind |= SS_UNFILLED_BIT; - if (ctx->Visual.rgbMode) - ind |= SS_RGBA_BIT; - tnl->Driver.Render.Triangle = tri_tab[ind]; tnl->Driver.Render.Quad = quad_tab[ind]; tnl->Driver.Render.Line = swsetup_line; diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index b9b78e16b0..8e9fa1bd55 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -43,7 +43,6 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) GLchan saved_color[3][4] = { { 0 } }; GLfloat saved_col0[3][4] = { { 0 } }; GLfloat saved_spec[3][4] = { { 0 } }; - GLfloat saved_index[3] = { 0 }; v[0] = &verts[e0]; v[1] = &verts[e1]; @@ -66,75 +65,64 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (facing == 1) { if (IND & SS_TWOSIDE_BIT) { - if (IND & SS_RGBA_BIT) { - if (VB->BackfaceColorPtr) { - GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; + if (VB->BackfaceColorPtr) { + GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; + if (swsetup->intColors) { + COPY_CHAN4(saved_color[0], v[0]->color); + COPY_CHAN4(saved_color[1], v[1]->color); + COPY_CHAN4(saved_color[2], v[2]->color); + } + else { + COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]); + COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]); + COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]); + } + + if (VB->BackfaceColorPtr->stride) { if (swsetup->intColors) { - COPY_CHAN4(saved_color[0], v[0]->color); - COPY_CHAN4(saved_color[1], v[1]->color); - COPY_CHAN4(saved_color[2], v[2]->color); + SS_COLOR(v[0]->color, vbcolor[e0]); + SS_COLOR(v[1]->color, vbcolor[e1]); + SS_COLOR(v[2]->color, vbcolor[e2]); } else { - COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]); - COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]); - COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]); + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]); } - - if (VB->BackfaceColorPtr->stride) { - if (swsetup->intColors) { - SS_COLOR(v[0]->color, vbcolor[e0]); - SS_COLOR(v[1]->color, vbcolor[e1]); - SS_COLOR(v[2]->color, vbcolor[e2]); - } - else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]); - } + } + else { + /* flat shade */ + if (swsetup->intColors) { + SS_COLOR(v[0]->color, vbcolor[0]); + SS_COLOR(v[1]->color, vbcolor[0]); + SS_COLOR(v[2]->color, vbcolor[0]); } else { - /* flat shade */ - if (swsetup->intColors) { - SS_COLOR(v[0]->color, vbcolor[0]); - SS_COLOR(v[1]->color, vbcolor[0]); - SS_COLOR(v[2]->color, vbcolor[0]); - } - else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); - } + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); } } + } - if (VB->BackfaceSecondaryColorPtr) { - GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; + if (VB->BackfaceSecondaryColorPtr) { + GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; - COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]); - COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]); + COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]); - if (VB->BackfaceSecondaryColorPtr->stride) { - SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]); - SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); - SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); - } - else { - SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); - } + if (VB->BackfaceSecondaryColorPtr->stride) { + SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]); + SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); + SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); + } + else { + SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); + SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); + SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); } - } else { - GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data; - saved_index[0] = v[0]->attrib[FRAG_ATTRIB_CI][0]; - saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0]; - saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0]; - - SS_IND(v[0]->attrib[FRAG_ATTRIB_CI][0], vbindex[e0]); - SS_IND(v[1]->attrib[FRAG_ATTRIB_CI][0], vbindex[e1]); - SS_IND(v[2]->attrib[FRAG_ATTRIB_CI][0], vbindex[e2]); } } } @@ -199,30 +187,24 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & SS_TWOSIDE_BIT) { if (facing == 1) { - if (IND & SS_RGBA_BIT) { - if (VB->BackfaceColorPtr) { - if (swsetup->intColors) { - COPY_CHAN4(v[0]->color, saved_color[0]); - COPY_CHAN4(v[1]->color, saved_color[1]); - COPY_CHAN4(v[2]->color, saved_color[2]); - } - else { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]); - } - } - - if (VB->BackfaceSecondaryColorPtr) { - COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]); - COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); - COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); - } - } else { - v[0]->attrib[FRAG_ATTRIB_CI][0] = saved_index[0]; - v[1]->attrib[FRAG_ATTRIB_CI][0] = saved_index[1]; - v[2]->attrib[FRAG_ATTRIB_CI][0] = saved_index[2]; - } + if (VB->BackfaceColorPtr) { + if (swsetup->intColors) { + COPY_CHAN4(v[0]->color, saved_color[0]); + COPY_CHAN4(v[1]->color, saved_color[1]); + COPY_CHAN4(v[2]->color, saved_color[2]); + } + else { + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]); + } + } + + if (VB->BackfaceSecondaryColorPtr) { + COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]); + COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); + COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); + } } } } -- cgit v1.2.3 From 5cf2c5851bcd29c2d53bb04ab692b4b156f5a74d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 18:23:19 -0800 Subject: DRI: Remove support for color-index visuals Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/common/utils.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index b6f291098d..9a21f2c9f2 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -625,11 +625,10 @@ driCreateConfigs(GLenum fb_format, GLenum fb_type, modes->bindToTextureRgb = GL_TRUE; modes->bindToTextureRgba = GL_TRUE; modes->bindToMipmapTexture = GL_FALSE; - modes->bindToTextureTargets = modes->rgbMode ? - __DRI_ATTRIB_TEXTURE_1D_BIT | - __DRI_ATTRIB_TEXTURE_2D_BIT | - __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT : - 0; + modes->bindToTextureTargets = + __DRI_ATTRIB_TEXTURE_1D_BIT | + __DRI_ATTRIB_TEXTURE_2D_BIT | + __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT; } } } @@ -726,11 +725,7 @@ driGetConfigAttribIndex(const __DRIconfig *config, { switch (attribMap[index].attrib) { case __DRI_ATTRIB_RENDER_TYPE: - if (config->modes.rgbMode) - *value = __DRI_ATTRIB_RGBA_BIT; - else - *value = __DRI_ATTRIB_COLOR_INDEX_BIT; - break; + *value = __DRI_ATTRIB_RGBA_BIT; case __DRI_ATTRIB_CONFIG_CAVEAT: if (config->modes.visualRating == GLX_NON_CONFORMANT_CONFIG) *value = __DRI_ATTRIB_NON_CONFORMANT_CONFIG; -- cgit v1.2.3 From a9c1b3caf67f035df83c6a4e38709cfa395f4cc6 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 18:24:07 -0800 Subject: tnl: Remove color-index TNL support Signed-off-by: Ian Romanick --- src/mesa/swrast_setup/ss_context.c | 5 -- src/mesa/tnl/t_context.c | 33 +++---- src/mesa/tnl/t_rasterpos.c | 52 ++++------- src/mesa/tnl/t_vb_light.c | 37 +++----- src/mesa/tnl/t_vb_lighttmp.h | 173 ------------------------------------- 5 files changed, 39 insertions(+), 261 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c index bc1ec58992..ebd1574c43 100644 --- a/src/mesa/swrast_setup/ss_context.c +++ b/src/mesa/swrast_setup/ss_context.c @@ -141,11 +141,6 @@ setup_vertex_format(GLcontext *ctx) EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]); } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR_INDEX )) { - EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, - attrib[FRAG_ATTRIB_CI][0] ); - } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F; EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]); diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 5a14e595a0..f27c8ad9d6 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -107,6 +107,7 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) TNLcontext *tnl = TNL_CONTEXT(ctx); const struct gl_vertex_program *vp = ctx->VertexProgram._Current; const struct gl_fragment_program *fp = ctx->FragmentProgram._Current; + GLuint i; if (new_state & (_NEW_HINT | _NEW_PROGRAM)) { ASSERT(tnl->AllowVertexFog || tnl->AllowPixelFog); @@ -119,29 +120,21 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) /* Calculate tnl->render_inputs. This bitmask indicates which vertex * attributes need to be emitted to the rasterizer. */ - if (ctx->Visual.rgbMode) { - GLuint i; - - RENDERINPUTS_ZERO( tnl->render_inputs_bitset ); - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS ); + RENDERINPUTS_ZERO( tnl->render_inputs_bitset ); + RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS ); - if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) { - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 ); - } + if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) { + RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR0 ); + } - if (NEED_SECONDARY_COLOR(ctx)) - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 ); + if (NEED_SECONDARY_COLOR(ctx)) + RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR1 ); - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - if (ctx->Texture._EnabledCoordUnits & (1 << i) || - (fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) { - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) ); - } - } - } - else { - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_POS ); - RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_COLOR_INDEX ); + for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { + if (ctx->Texture._EnabledCoordUnits & (1 << i) || + (fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) { + RENDERINPUTS_SET( tnl->render_inputs_bitset, _TNL_ATTRIB_TEX(i) ); + } } if (ctx->Fog.Enabled) { diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c index 13b84a7d77..3596d162b2 100644 --- a/src/mesa/tnl/t_rasterpos.c +++ b/src/mesa/tnl/t_rasterpos.c @@ -119,8 +119,7 @@ shade_rastpos(GLcontext *ctx, const GLfloat vertex[4], const GLfloat normal[3], GLfloat Rcolor[4], - GLfloat Rspec[4], - GLfloat *Rindex) + GLfloat Rspec[4]) { /*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor; const struct gl_light *light; @@ -244,28 +243,14 @@ shade_rastpos(GLcontext *ctx, ACC_SCALE_SCALAR_3V( specularColor, attenuation, specularContrib ); } - if (ctx->Visual.rgbMode) { - Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); - Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); - Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); - Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); - Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); - Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); - Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); - Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); - } - else { - GLfloat *ind = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_INDEXES]; - GLfloat d_a = ind[MAT_INDEX_DIFFUSE] - ind[MAT_INDEX_AMBIENT]; - GLfloat s_a = ind[MAT_INDEX_SPECULAR] - ind[MAT_INDEX_AMBIENT]; - GLfloat i = (ind[MAT_INDEX_AMBIENT] - + diffuseCI * (1.0F-specularCI) * d_a - + specularCI * s_a); - if (i > ind[MAT_INDEX_SPECULAR]) { - i = ind[MAT_INDEX_SPECULAR]; - } - *Rindex = i; - } + Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F); + Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F); + Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F); + Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F); + Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F); + Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F); + Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F); + Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F); } @@ -469,21 +454,14 @@ _tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4]) /* lighting */ shade_rastpos( ctx, vObj, norm, ctx->Current.RasterColor, - ctx->Current.RasterSecondaryColor, - &ctx->Current.RasterIndex ); + ctx->Current.RasterSecondaryColor ); } else { - /* use current color or index */ - if (ctx->Visual.rgbMode) { - COPY_4FV(ctx->Current.RasterColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); - COPY_4FV(ctx->Current.RasterSecondaryColor, - ctx->Current.Attrib[VERT_ATTRIB_COLOR1]); - } - else { - ctx->Current.RasterIndex - = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; - } + /* use current color */ + COPY_4FV(ctx->Current.RasterColor, + ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); + COPY_4FV(ctx->Current.RasterSecondaryColor, + ctx->Current.Attrib[VERT_ATTRIB_COLOR1]); } /* texture coords */ diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 8a0fe63fd8..e7309aaac6 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -64,7 +64,6 @@ struct light_stage_data { GLvector4f Input; GLvector4f LitColor[2]; GLvector4f LitSecondary[2]; - GLvector4f LitIndex[2]; light_func *light_func_tab; struct material_cursor mat[MAT_ATTRIB_MAX]; @@ -161,7 +160,6 @@ static light_func _tnl_light_tab[MAX_LIGHT_FUNC]; static light_func _tnl_light_fast_tab[MAX_LIGHT_FUNC]; static light_func _tnl_light_fast_single_tab[MAX_LIGHT_FUNC]; static light_func _tnl_light_spec_tab[MAX_LIGHT_FUNC]; -static light_func _tnl_light_ci_tab[MAX_LIGHT_FUNC]; #define TAG(x) x #define IDX (0) @@ -260,22 +258,18 @@ static void validate_lighting( GLcontext *ctx, if (!ctx->Light.Enabled || ctx->VertexProgram._Current) return; - if (ctx->Visual.rgbMode) { - if (ctx->Light._NeedVertices) { - if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) - tab = _tnl_light_spec_tab; - else - tab = _tnl_light_tab; - } - else { - if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) - tab = _tnl_light_fast_single_tab; - else - tab = _tnl_light_fast_tab; - } + if (ctx->Light._NeedVertices) { + if (ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) + tab = _tnl_light_spec_tab; + else + tab = _tnl_light_tab; + } + else { + if (ctx->Light.EnabledList.next == ctx->Light.EnabledList.prev) + tab = _tnl_light_fast_single_tab; + else + tab = _tnl_light_fast_tab; } - else - tab = _tnl_light_ci_tab; LIGHT_STAGE_DATA(stage)->light_func_tab = tab; @@ -311,19 +305,12 @@ static GLboolean init_lighting( GLcontext *ctx, _mesa_vector4f_alloc( &store->LitColor[1], 0, size, 32 ); _mesa_vector4f_alloc( &store->LitSecondary[0], 0, size, 32 ); _mesa_vector4f_alloc( &store->LitSecondary[1], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitIndex[0], 0, size, 32 ); - _mesa_vector4f_alloc( &store->LitIndex[1], 0, size, 32 ); store->LitColor[0].size = 4; store->LitColor[1].size = 4; store->LitSecondary[0].size = 3; store->LitSecondary[1].size = 3; - store->LitIndex[0].size = 1; - store->LitIndex[0].stride = sizeof(GLfloat); - store->LitIndex[1].size = 1; - store->LitIndex[1].stride = sizeof(GLfloat); - return GL_TRUE; } @@ -340,8 +327,6 @@ static void dtr( struct tnl_pipeline_stage *stage ) _mesa_vector4f_free( &store->LitColor[1] ); _mesa_vector4f_free( &store->LitSecondary[0] ); _mesa_vector4f_free( &store->LitSecondary[1] ); - _mesa_vector4f_free( &store->LitIndex[0] ); - _mesa_vector4f_free( &store->LitIndex[1] ); FREE( store ); stage->privatePtr = NULL; } diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index 4ebef2356f..0a98c6b02a 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -637,185 +637,12 @@ static void TAG(light_fast_rgba)( GLcontext *ctx, - -/* - * Use current lighting/material settings to compute the color indexes - * for an array of vertices. - * Input: n - number of vertices to light - * side - 0=use front material, 1=use back material - * vertex - array of [n] vertex position in eye coordinates - * normal - array of [n] surface normal vector - * Output: indexResult - resulting array of [n] color indexes - */ -static void TAG(light_ci)( GLcontext *ctx, - struct vertex_buffer *VB, - struct tnl_pipeline_stage *stage, - GLvector4f *input ) -{ - struct light_stage_data *store = LIGHT_STAGE_DATA(stage); - GLuint j; - const GLuint vstride = input->stride; - const GLfloat *vertex = (GLfloat *) input->data; - const GLuint nstride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; - const GLfloat *normal = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; - GLfloat *indexResult[2]; - const GLuint nr = VB->Count; - -#ifdef TRACE - fprintf(stderr, "%s\n", __FUNCTION__ ); -#endif - - VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = &store->LitIndex[0]; -#if IDX & LIGHT_TWOSIDE - VB->BackfaceIndexPtr = &store->LitIndex[1]; -#endif - - indexResult[0] = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]->data; -#if IDX & LIGHT_TWOSIDE - indexResult[1] = (GLfloat *)VB->BackfaceIndexPtr->data; -#endif - - /* loop over vertices */ - for (j=0; jLight.EnabledList) { - - GLfloat attenuation = 1.0F; - GLfloat VP[3]; /* unit vector from vertex to light */ - GLfloat n_dot_VP; /* dot product of l and n */ - GLfloat *h, n_dot_h, correction = 1.0; - - /* compute l and attenuation */ - if (!(light->_Flags & LIGHT_POSITIONAL)) { - /* directional light */ - COPY_3V(VP, light->_VP_inf_norm); - } - else { - GLfloat d; /* distance from vertex to light */ - - SUB_3V(VP, light->_Position, vertex); - - d = (GLfloat) LEN_3FV( VP ); - if ( d > 1e-6) { - GLfloat invd = 1.0F / d; - SELF_SCALE_SCALAR_3V(VP, invd); - } - - attenuation = 1.0F / (light->ConstantAttenuation + d * - (light->LinearAttenuation + d * - light->QuadraticAttenuation)); - - /* spotlight attenuation */ - if (light->_Flags & LIGHT_SPOT) { - GLfloat PV_dot_dir = - DOT3(VP, light->_NormSpotDirection); - if (PV_dot_dir < light->_CosCutoff) { - continue; /* this light makes no contribution */ - } - else { - GLdouble x = PV_dot_dir * (EXP_TABLE_SIZE-1); - GLint k = (GLint) x; - GLfloat spot = (GLfloat) (light->_SpotExpTable[k][0] - + (x-k)*light->_SpotExpTable[k][1]); - attenuation *= spot; - } - } - } - - if (attenuation < 1e-3) - continue; /* this light makes no contribution */ - - n_dot_VP = DOT3( normal, VP ); - - /* which side are we lighting? */ - if (n_dot_VP < 0.0F) { -#if IDX & LIGHT_TWOSIDE - side = 1; - correction = -1; - n_dot_VP = -n_dot_VP; -#else - continue; -#endif - } - - /* accumulate diffuse term */ - diffuse[side] += n_dot_VP * light->_dli * attenuation; - - /* specular term */ - if (ctx->Light.Model.LocalViewer) { - GLfloat v[3]; - COPY_3V(v, vertex); - NORMALIZE_3FV(v); - SUB_3V(VP, VP, v); /* h = VP + VPe */ - h = VP; - NORMALIZE_3FV(h); - } - else if (light->_Flags & LIGHT_POSITIONAL) { - h = VP; - /* Strangely, disabling this addition fixes a conformance - * problem. If this code is enabled, l_sed.c fails. - */ - /*ACC_3V(h, ctx->_EyeZDir);*/ - NORMALIZE_3FV(h); - } - else { - h = light->_h_inf_norm; - } - - n_dot_h = correction * DOT3(normal, h); - if (n_dot_h > 0.0F) { - GLfloat spec_coef; - struct gl_shine_tab *tab = ctx->_ShineTable[side]; - GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef); - specular[side] += spec_coef * light->_sli * attenuation; - } - } /*loop over lights*/ - - /* Now compute final color index */ - for (side = 0 ; side < NR_SIDES ; side++) { - const GLfloat *ind = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_INDEXES + side]; - GLfloat index; - - if (specular[side] > 1.0F) { - index = ind[MAT_INDEX_SPECULAR]; - } - else { - GLfloat d_a = ind[MAT_INDEX_DIFFUSE] - ind[MAT_INDEX_AMBIENT]; - GLfloat s_a = ind[MAT_INDEX_SPECULAR] - ind[MAT_INDEX_AMBIENT]; - index = (ind[MAT_INDEX_AMBIENT] - + diffuse[side] * (1.0F-specular[side]) * d_a - + specular[side] * s_a); - if (index > ind[MAT_INDEX_SPECULAR]) { - index = ind[MAT_INDEX_SPECULAR]; - } - } - indexResult[side][j] = index; - } - } /*for vertex*/ -} - - - static void TAG(init_light_tab)( void ) { _tnl_light_tab[IDX] = TAG(light_rgba); _tnl_light_fast_tab[IDX] = TAG(light_fast_rgba); _tnl_light_fast_single_tab[IDX] = TAG(light_fast_rgba_single); _tnl_light_spec_tab[IDX] = TAG(light_rgba_spec); - _tnl_light_ci_tab[IDX] = TAG(light_ci); } -- cgit v1.2.3 From fcf438e9e03f6e75bca4a49ad372fe7c4b1abbf8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 18:49:33 -0800 Subject: mesa: Remove support for creating color-index visuals Remove the rgbMode and indexBits parameters from _mesa_create_visual and _mesa_initialize_visual. These values are now hardcoded to GL_TRUE and 0. Signed-off-by: Ian Romanick --- src/gallium/state_trackers/glx/xlib/xm_api.c | 3 +-- src/mesa/drivers/beos/GLView.cpp | 4 +--- src/mesa/drivers/fbdev/glfbdev.c | 6 +++--- src/mesa/drivers/glslcompiler/glslcompiler.c | 4 ++-- src/mesa/drivers/osmesa/osmesa.c | 4 +--- src/mesa/drivers/windows/gdi/wmesa.c | 4 +--- src/mesa/drivers/windows/gldirect/dglcontext.c | 2 -- src/mesa/drivers/x11/xm_api.c | 3 +-- src/mesa/main/context.c | 15 +++++---------- src/mesa/main/context.h | 6 +----- 10 files changed, 16 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 68518b19b9..217bdeff75 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -746,10 +746,9 @@ XMesaVisual XMesaCreateVisual( Display *display, } _mesa_initialize_visual( &v->mesa_visual, - rgb_flag, db_flag, stereo_flag, + db_flag, stereo_flag, red_bits, green_bits, blue_bits, alpha_bits, - v->mesa_visual.indexBits, depth_size, stencil_size, accum_red_size, accum_green_size, diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp index 9e4a7ebe56..a029f6b200 100644 --- a/src/mesa/drivers/beos/GLView.cpp +++ b/src/mesa/drivers/beos/GLView.cpp @@ -297,11 +297,9 @@ BGLView::BGLView(BRect rect, char *name, MesaDriver * md = new MesaDriver(); // examine option flags and create gl_context struct - GLvisual * visual = _mesa_create_visual( rgbFlag, - dblFlag, + GLvisual * visual = _mesa_create_visual( dblFlag, stereoFlag, red, green, blue, alpha, - index, depth, stencil, accum, accum, accum, accum, diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c index e6ece69a64..0ea2796eaa 100644 --- a/src/mesa/drivers/fbdev/glfbdev.c +++ b/src/mesa/drivers/fbdev/glfbdev.c @@ -327,7 +327,7 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, const int *attrib; GLboolean dbFlag = GL_FALSE, stereoFlag = GL_FALSE; GLint redBits = 0, greenBits = 0, blueBits = 0, alphaBits = 0; - GLint indexBits = 0, depthBits = 0, stencilBits = 0; + GLint depthBits = 0, stencilBits = 0; GLint accumRedBits = 0, accumGreenBits = 0; GLint accumBlueBits = 0, accumAlphaBits = 0; GLint numSamples = 0; @@ -414,9 +414,9 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo, } } - if (!_mesa_initialize_visual(&vis->glvisual, GL_TRUE, dbFlag, stereoFlag, + if (!_mesa_initialize_visual(&vis->glvisual, dbFlag, stereoFlag, redBits, greenBits, blueBits, alphaBits, - indexBits, depthBits, stencilBits, + depthBits, stencilBits, accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits, numSamples)) { diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index 448029dace..66035a4a43 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -113,9 +113,9 @@ CreateContext(void) GLcontext *ctx; CompilerContext *cc; - vis = _mesa_create_visual(GL_TRUE, GL_FALSE, GL_FALSE, /* RGB */ + vis = _mesa_create_visual(GL_FALSE, GL_FALSE, /* RGB */ 8, 8, 8, 8, /* color */ - 0, 0, 0, /* z, stencil */ + 0, 0, /* z, stencil */ 0, 0, 0, 0, 1); /* accum */ buf = _mesa_create_framebuffer(vis); diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index bb6dbdf1c0..e20507ae92 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1116,14 +1116,12 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context); if (osmesa) { - osmesa->gl_visual = _mesa_create_visual( GL_TRUE, /* rgbMode */ - GL_FALSE, /* double buffer */ + osmesa->gl_visual = _mesa_create_visual( GL_FALSE, /* double buffer */ GL_FALSE, /* stereo */ redBits, greenBits, blueBits, alphaBits, - 0, depthBits, stencilBits, accumBits, diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index 2fdcb387be..91ddc3615a 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -1461,12 +1461,10 @@ WMesaContext WMesaCreateContext(HDC hDC, break; } /* Create visual based on flags */ - visual = _mesa_create_visual(rgb_flag, - db_flag, /* db_flag */ + visual = _mesa_create_visual(db_flag, /* db_flag */ GL_FALSE, /* stereo */ red_bits, green_bits, blue_bits, /* color RGB */ alpha_flag ? alpha_bits : 0, /* color A */ - 0, /* index bits */ DEFAULT_SOFTWARE_DEPTH_BITS, /* depth_bits */ 8, /* stencil_bits */ 16,16,16, /* accum RGB */ diff --git a/src/mesa/drivers/windows/gldirect/dglcontext.c b/src/mesa/drivers/windows/gldirect/dglcontext.c index e9c23d1ccb..a420b36ffb 100644 --- a/src/mesa/drivers/windows/gldirect/dglcontext.c +++ b/src/mesa/drivers/windows/gldirect/dglcontext.c @@ -1377,14 +1377,12 @@ SkipPrimaryCreate: #ifdef _USE_GLD3_WGL lpCtx->glVis = _mesa_create_visual( - GL_TRUE, // RGB mode bDouble, /* double buffer */ GL_FALSE, // stereo lpPFD->cRedBits, lpPFD->cGreenBits, lpPFD->cBlueBits, dwAlphaBits, - 0, // index bits dwDepthBits, dwStencilBits, lpPFD->cAccumRedBits, // accum bits diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index c59df55166..a1723fa37b 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1443,10 +1443,9 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, } _mesa_initialize_visual( &v->mesa_visual, - GL_TRUE, db_flag, stereo_flag, + db_flag, stereo_flag, red_bits, green_bits, blue_bits, alpha_bits, - v->mesa_visual.indexBits, depth_size, stencil_size, accum_red_size, accum_green_size, diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 4ecbb5ecf6..b827d54176 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -184,7 +184,6 @@ _mesa_notifySwapBuffers(__GLcontext *ctx) * Allocates a GLvisual structure and initializes it via * _mesa_initialize_visual(). * - * \param rgbFlag GL_TRUE for RGB(A) mode, GL_FALSE for Color Index mode. * \param dbFlag double buffering * \param stereoFlag stereo buffer * \param depthBits requested bits per depth buffer value. Any value in [0, 32] @@ -206,14 +205,12 @@ _mesa_notifySwapBuffers(__GLcontext *ctx) * \note Need to add params for level and numAuxBuffers (at least) */ GLvisual * -_mesa_create_visual( GLboolean rgbFlag, - GLboolean dbFlag, +_mesa_create_visual( GLboolean dbFlag, GLboolean stereoFlag, GLint redBits, GLint greenBits, GLint blueBits, GLint alphaBits, - GLint indexBits, GLint depthBits, GLint stencilBits, GLint accumRedBits, @@ -224,9 +221,9 @@ _mesa_create_visual( GLboolean rgbFlag, { GLvisual *vis = (GLvisual *) calloc(1, sizeof(GLvisual)); if (vis) { - if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag, + if (!_mesa_initialize_visual(vis, dbFlag, stereoFlag, redBits, greenBits, blueBits, alphaBits, - indexBits, depthBits, stencilBits, + depthBits, stencilBits, accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits, numSamples)) { @@ -248,14 +245,12 @@ _mesa_create_visual( GLboolean rgbFlag, */ GLboolean _mesa_initialize_visual( GLvisual *vis, - GLboolean rgbFlag, GLboolean dbFlag, GLboolean stereoFlag, GLint redBits, GLint greenBits, GLint blueBits, GLint alphaBits, - GLint indexBits, GLint depthBits, GLint stencilBits, GLint accumRedBits, @@ -277,7 +272,7 @@ _mesa_initialize_visual( GLvisual *vis, assert(accumBlueBits >= 0); assert(accumAlphaBits >= 0); - vis->rgbMode = rgbFlag; + vis->rgbMode = GL_TRUE; vis->doubleBufferMode = dbFlag; vis->stereoMode = stereoFlag; @@ -287,7 +282,7 @@ _mesa_initialize_visual( GLvisual *vis, vis->alphaBits = alphaBits; vis->rgbBits = redBits + greenBits + blueBits; - vis->indexBits = indexBits; + vis->indexBits = 0; vis->depthBits = depthBits; vis->stencilBits = stencilBits; diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index c3be1063f8..09bf1777da 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -60,14 +60,12 @@ struct _glapi_table; /*@{*/ extern GLvisual * -_mesa_create_visual( GLboolean rgbFlag, - GLboolean dbFlag, +_mesa_create_visual( GLboolean dbFlag, GLboolean stereoFlag, GLint redBits, GLint greenBits, GLint blueBits, GLint alphaBits, - GLint indexBits, GLint depthBits, GLint stencilBits, GLint accumRedBits, @@ -78,14 +76,12 @@ _mesa_create_visual( GLboolean rgbFlag, extern GLboolean _mesa_initialize_visual( GLvisual *v, - GLboolean rgbFlag, GLboolean dbFlag, GLboolean stereoFlag, GLint redBits, GLint greenBits, GLint blueBits, GLint alphaBits, - GLint indexBits, GLint depthBits, GLint stencilBits, GLint accumRedBits, -- cgit v1.2.3 From 22a96f305898b5d1aa26809c7156a01686eb9bf0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 18:58:38 -0800 Subject: mesa: Remove checks of Visual.rgbMode This must always be true now, so there is no reason to check it. Ever. Signed-off-by: Ian Romanick --- src/mesa/main/clear.c | 27 +-------------------------- src/mesa/main/context.c | 2 -- src/mesa/main/feedback.c | 11 +++-------- src/mesa/main/framebuffer.c | 7 +------ src/mesa/main/light.c | 41 ++++++++++++++++------------------------- src/mesa/main/rastpos.c | 38 ++++++++++++++++---------------------- src/mesa/main/readpix.c | 16 ++++------------ src/mesa/main/renderbuffer.c | 25 +++++++------------------ 8 files changed, 48 insertions(+), 119 deletions(-) (limited to 'src') diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c index 8085bedf1c..e76ab5527b 100644 --- a/src/mesa/main/clear.c +++ b/src/mesa/main/clear.c @@ -51,11 +51,6 @@ _mesa_ClearIndex( GLfloat c ) FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.ClearIndex = (GLuint) c; - - if (!ctx->Visual.rgbMode && ctx->Driver.ClearIndex) { - /* it's OK to call glClearIndex in RGBA mode but it should be a NOP */ - (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex ); - } } #endif @@ -92,7 +87,7 @@ _mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4V(ctx->Color.ClearColor, tmp); - if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) { + if (ctx->Driver.ClearColor) { /* it's OK to call glClearColor in CI mode but it should be a NOP */ (*ctx->Driver.ClearColor)(ctx, ctx->Color.ClearColor); } @@ -261,11 +256,6 @@ _mesa_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) FLUSH_CURRENT(ctx, 0); - if (!ctx->DrawBuffer->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glClearBufferiv()"); - return; - } - if (ctx->NewState) { _mesa_update_state( ctx ); } @@ -342,11 +332,6 @@ _mesa_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value) FLUSH_CURRENT(ctx, 0); - if (!ctx->DrawBuffer->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glClearBufferuiv()"); - return; - } - if (ctx->NewState) { _mesa_update_state( ctx ); } @@ -401,11 +386,6 @@ _mesa_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value) FLUSH_CURRENT(ctx, 0); - if (!ctx->DrawBuffer->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glClearBufferfv()"); - return; - } - if (ctx->NewState) { _mesa_update_state( ctx ); } @@ -480,11 +460,6 @@ _mesa_ClearBufferfi(GLenum buffer, GLint drawbuffer, FLUSH_CURRENT(ctx, 0); - if (!ctx->DrawBuffer->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glClearBufferfi()"); - return; - } - if (buffer != GL_DEPTH_STENCIL) { _mesa_error(ctx, GL_INVALID_ENUM, "glClearBufferfi(buffer=%s)", _mesa_lookup_enum_by_nr(buffer)); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b827d54176..73126b9575 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1164,8 +1164,6 @@ check_compatible(const GLcontext *ctx, const GLframebuffer *buffer) if (ctxvis == bufvis) return GL_TRUE; - if (ctxvis->rgbMode != bufvis->rgbMode) - return GL_FALSE; #if 0 /* disabling this fixes the fgl_glxgears pbuffer demo */ if (ctxvis->doubleBufferMode && !bufvis->doubleBufferMode) diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index e20456fa75..323cc53036 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -78,18 +78,13 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) ctx->Feedback._Mask = FB_3D; break; case GL_3D_COLOR: - ctx->Feedback._Mask = (FB_3D | - (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX)); + ctx->Feedback._Mask = (FB_3D | FB_COLOR); break; case GL_3D_COLOR_TEXTURE: - ctx->Feedback._Mask = (FB_3D | - (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) | - FB_TEXTURE); + ctx->Feedback._Mask = (FB_3D | FB_COLOR | FB_TEXTURE); break; case GL_4D_COLOR_TEXTURE: - ctx->Feedback._Mask = (FB_3D | FB_4D | - (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) | - FB_TEXTURE); + ctx->Feedback._Mask = (FB_3D | FB_4D | FB_COLOR | FB_TEXTURE); break; default: _mesa_error( ctx, GL_INVALID_ENUM, "glFeedbackBuffer" ); diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 269bc9ac6c..6a85162d5d 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -536,7 +536,7 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) } #endif - /* find first RGB or CI renderbuffer */ + /* find first RGB renderbuffer */ for (i = 0; i < BUFFER_COUNT; i++) { if (fb->Attachment[i].Renderbuffer) { const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; @@ -554,11 +554,6 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) fb->Visual.samples = rb->NumSamples; break; } - else if (baseFormat == GL_COLOR_INDEX) { - fb->Visual.indexBits = _mesa_get_format_bits(fmt, GL_INDEX_BITS); - fb->Visual.rgbMode = GL_FALSE; - break; - } } } diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 6899ed0ddf..19dc96892d 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1093,31 +1093,22 @@ _mesa_update_lighting( GLcontext *ctx ) * FLUSH_UPDATE_CURRENT, as when any outstanding material changes * are flushed, they will update the derived state at that time. */ - if (ctx->Visual.rgbMode) { - if (ctx->Light.Model.TwoSide) - _mesa_update_material( ctx, - MAT_BIT_FRONT_EMISSION | - MAT_BIT_FRONT_AMBIENT | - MAT_BIT_FRONT_DIFFUSE | - MAT_BIT_FRONT_SPECULAR | - MAT_BIT_BACK_EMISSION | - MAT_BIT_BACK_AMBIENT | - MAT_BIT_BACK_DIFFUSE | - MAT_BIT_BACK_SPECULAR); - else - _mesa_update_material( ctx, - MAT_BIT_FRONT_EMISSION | - MAT_BIT_FRONT_AMBIENT | - MAT_BIT_FRONT_DIFFUSE | - MAT_BIT_FRONT_SPECULAR); - } - else { - static const GLfloat ci[3] = { .30F, .59F, .11F }; - foreach(light, &ctx->Light.EnabledList) { - light->_dli = DOT3(ci, light->Diffuse); - light->_sli = DOT3(ci, light->Specular); - } - } + if (ctx->Light.Model.TwoSide) + _mesa_update_material(ctx, + MAT_BIT_FRONT_EMISSION | + MAT_BIT_FRONT_AMBIENT | + MAT_BIT_FRONT_DIFFUSE | + MAT_BIT_FRONT_SPECULAR | + MAT_BIT_BACK_EMISSION | + MAT_BIT_BACK_AMBIENT | + MAT_BIT_BACK_DIFFUSE | + MAT_BIT_BACK_SPECULAR); + else + _mesa_update_material(ctx, + MAT_BIT_FRONT_EMISSION | + MAT_BIT_FRONT_AMBIENT | + MAT_BIT_FRONT_DIFFUSE | + MAT_BIT_FRONT_SPECULAR); } diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index d72b846c36..03ff3b6bbc 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -246,28 +246,22 @@ window_pos3f(GLfloat x, GLfloat y, GLfloat z) ctx->Current.RasterDistance = 0.0; /* raster color = current color or index */ - if (ctx->Visual.rgbMode) { - ctx->Current.RasterColor[0] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F); - ctx->Current.RasterColor[1] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F); - ctx->Current.RasterColor[2] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F); - ctx->Current.RasterColor[3] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[0] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[1] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[2] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F); - ctx->Current.RasterSecondaryColor[3] - = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F); - } - else { - ctx->Current.RasterIndex - = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0]; - } + ctx->Current.RasterColor[0] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][0], 0.0F, 1.0F); + ctx->Current.RasterColor[1] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][1], 0.0F, 1.0F); + ctx->Current.RasterColor[2] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][2], 0.0F, 1.0F); + ctx->Current.RasterColor[3] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3], 0.0F, 1.0F); + ctx->Current.RasterSecondaryColor[0] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][0], 0.0F, 1.0F); + ctx->Current.RasterSecondaryColor[1] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][1], 0.0F, 1.0F); + ctx->Current.RasterSecondaryColor[2] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][2], 0.0F, 1.0F); + ctx->Current.RasterSecondaryColor[3] + = CLAMP(ctx->Current.Attrib[VERT_ATTRIB_COLOR1][3], 0.0F, 1.0F); /* raster texcoord = current texcoord */ { diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index feea1d375f..f4d74e8be6 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -77,14 +77,7 @@ _mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, case GL_RGBA: case GL_BGRA: case GL_ABGR_EXT: - if (drawing) { - if (!ctx->DrawBuffer->Visual.rgbMode) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(drawing RGB pixels into color index buffer)"); - return GL_TRUE; - } - } - else { + if (!drawing) { /* reading */ if (!_mesa_source_buffer_exists(ctx, GL_COLOR)) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -95,10 +88,9 @@ _mesa_error_check_format_type(GLcontext *ctx, GLenum format, GLenum type, break; case GL_COLOR_INDEX: if (drawing) { - if (ctx->DrawBuffer->Visual.rgbMode && - (ctx->PixelMaps.ItoR.Size == 0 || - ctx->PixelMaps.ItoG.Size == 0 || - ctx->PixelMaps.ItoB.Size == 0)) { + if (ctx->PixelMaps.ItoR.Size == 0 || + ctx->PixelMaps.ItoG.Size == 0 || + ctx->PixelMaps.ItoB.Size == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glDrawPixels(drawing color index pixels into RGB buffer)"); return GL_TRUE; diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 2f42924046..7557b791e5 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1907,21 +1907,13 @@ _mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, GLboolean backRight = fb->Visual.stereoMode && fb->Visual.doubleBufferMode; if (color) { - if (fb->Visual.rgbMode) { - assert(fb->Visual.redBits == fb->Visual.greenBits); - assert(fb->Visual.redBits == fb->Visual.blueBits); - _mesa_add_color_renderbuffers(NULL, fb, - fb->Visual.redBits, - fb->Visual.alphaBits, - frontLeft, backLeft, - frontRight, backRight); - } - else { - _mesa_add_color_index_renderbuffers(NULL, fb, - fb->Visual.indexBits, - frontLeft, backLeft, - frontRight, backRight); - } + assert(fb->Visual.redBits == fb->Visual.greenBits); + assert(fb->Visual.redBits == fb->Visual.blueBits); + _mesa_add_color_renderbuffers(NULL, fb, + fb->Visual.redBits, + fb->Visual.alphaBits, + frontLeft, backLeft, + frontRight, backRight); } if (depth) { @@ -1935,7 +1927,6 @@ _mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, } if (accum) { - assert(fb->Visual.rgbMode); assert(fb->Visual.accumRedBits > 0); assert(fb->Visual.accumGreenBits > 0); assert(fb->Visual.accumBlueBits > 0); @@ -1947,14 +1938,12 @@ _mesa_add_soft_renderbuffers(struct gl_framebuffer *fb, } if (aux) { - assert(fb->Visual.rgbMode); assert(fb->Visual.numAuxBuffers > 0); _mesa_add_aux_renderbuffers(NULL, fb, fb->Visual.redBits, fb->Visual.numAuxBuffers); } if (alpha) { - assert(fb->Visual.rgbMode); assert(fb->Visual.alphaBits > 0); _mesa_add_alpha_renderbuffers(NULL, fb, fb->Visual.alphaBits, frontLeft, backLeft, -- cgit v1.2.3 From b9f63c277ac84f7b6598cb4e908033514d379171 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 19:00:50 -0800 Subject: mesa: Remove checks of Visual.rgbMode in Get paths Signed-off-by: Ian Romanick --- src/mesa/main/get.c | 16 ++++++++-------- src/mesa/main/get_gen.py | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 60fef552c4..e390d29757 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -391,7 +391,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN(ctx->Color.ClearIndex); break; case GL_INDEX_MODE: - params[0] = !ctx->DrawBuffer->Visual.rgbMode; + params[0] = GL_FALSE; break; case GL_INDEX_OFFSET: params[0] = INT_TO_BOOLEAN(ctx->Pixel.IndexOffset); @@ -827,7 +827,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = ctx->Transform.RescaleNormals; break; case GL_RGBA_MODE: - params[0] = ctx->DrawBuffer->Visual.rgbMode; + params[0] = GL_TRUE; break; case GL_SCISSOR_BOX: params[0] = INT_TO_BOOLEAN(ctx->Scissor.X); @@ -2260,7 +2260,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)(ctx->Color.ClearIndex); break; case GL_INDEX_MODE: - params[0] = BOOLEAN_TO_FLOAT(!ctx->DrawBuffer->Visual.rgbMode); + params[0] = BOOLEAN_TO_FLOAT(GL_FALSE); break; case GL_INDEX_OFFSET: params[0] = (GLfloat)(ctx->Pixel.IndexOffset); @@ -2696,7 +2696,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = BOOLEAN_TO_FLOAT(ctx->Transform.RescaleNormals); break; case GL_RGBA_MODE: - params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.rgbMode); + params[0] = BOOLEAN_TO_FLOAT(GL_TRUE); break; case GL_SCISSOR_BOX: params[0] = (GLfloat)(ctx->Scissor.X); @@ -4129,7 +4129,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->Color.ClearIndex; break; case GL_INDEX_MODE: - params[0] = BOOLEAN_TO_INT(!ctx->DrawBuffer->Visual.rgbMode); + params[0] = BOOLEAN_TO_INT(GL_FALSE); break; case GL_INDEX_OFFSET: params[0] = ctx->Pixel.IndexOffset; @@ -4565,7 +4565,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = BOOLEAN_TO_INT(ctx->Transform.RescaleNormals); break; case GL_RGBA_MODE: - params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.rgbMode); + params[0] = BOOLEAN_TO_INT(GL_TRUE); break; case GL_SCISSOR_BOX: params[0] = ctx->Scissor.X; @@ -5999,7 +5999,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = (GLint64)(ctx->Color.ClearIndex); break; case GL_INDEX_MODE: - params[0] = BOOLEAN_TO_INT64(!ctx->DrawBuffer->Visual.rgbMode); + params[0] = BOOLEAN_TO_INT64(GL_FALSE); break; case GL_INDEX_OFFSET: params[0] = (GLint64)(ctx->Pixel.IndexOffset); @@ -6435,7 +6435,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = BOOLEAN_TO_INT64(ctx->Transform.RescaleNormals); break; case GL_RGBA_MODE: - params[0] = BOOLEAN_TO_INT64(ctx->DrawBuffer->Visual.rgbMode); + params[0] = BOOLEAN_TO_INT64(GL_TRUE); break; case GL_SCISSOR_BOX: params[0] = (GLint64)(ctx->Scissor.X); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 64aa2aca26..17ea1e4ae6 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -231,7 +231,7 @@ StateVars = [ ( "GL_INDEX_BITS", GLint, ["ctx->DrawBuffer->Visual.indexBits"], "", None ), ( "GL_INDEX_CLEAR_VALUE", GLint, ["ctx->Color.ClearIndex"], "", None ), - ( "GL_INDEX_MODE", GLboolean, ["!ctx->DrawBuffer->Visual.rgbMode"], + ( "GL_INDEX_MODE", GLboolean, ["GL_FALSE"], "", None ), ( "GL_INDEX_OFFSET", GLint, ["ctx->Pixel.IndexOffset"], "", None ), ( "GL_INDEX_SHIFT", GLint, ["ctx->Pixel.IndexShift"], "", None ), @@ -410,7 +410,7 @@ StateVars = [ ( "GL_RENDER_MODE", GLenum, ["ctx->RenderMode"], "", None ), ( "GL_RESCALE_NORMAL", GLboolean, ["ctx->Transform.RescaleNormals"], "", None ), - ( "GL_RGBA_MODE", GLboolean, ["ctx->DrawBuffer->Visual.rgbMode"], + ( "GL_RGBA_MODE", GLboolean, ["GL_TRUE"], "", None ), ( "GL_SCISSOR_BOX", GLint, ["ctx->Scissor.X", -- cgit v1.2.3 From 3d0f608e139336174121617f760398abca25eb31 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 19:03:23 -0800 Subject: mesa: Remove _mesa_add_color_index_renderbuffers After all the recent color-index visual support removal, _mesa_add_color_index_renderbuffers is no longer used anywhere. Signed-off-by: Ian Romanick --- src/mesa/main/renderbuffer.c | 56 -------------------------------------------- src/mesa/main/renderbuffer.h | 6 ----- 2 files changed, 62 deletions(-) (limited to 'src') diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 7557b791e5..4d7b0aff04 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1552,62 +1552,6 @@ _mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, } -/** - * Add software-based color index renderbuffers to the given framebuffer. - * This is a helper routine for device drivers when creating a - * window system framebuffer (not a user-created render/framebuffer). - * Once this function is called, you can basically forget about this - * renderbuffer; core Mesa will handle all the buffer management and - * rendering! - */ -GLboolean -_mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint indexBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight) -{ - GLuint b; - - if (indexBits > 8) { - _mesa_problem(ctx, - "Unsupported bit depth in _mesa_add_color_index_renderbuffers"); - return GL_FALSE; - } - - assert(MAX_COLOR_ATTACHMENTS >= 4); - - for (b = BUFFER_FRONT_LEFT; b <= BUFFER_BACK_RIGHT; b++) { - struct gl_renderbuffer *rb; - - if (b == BUFFER_FRONT_LEFT && !frontLeft) - continue; - else if (b == BUFFER_BACK_LEFT && !backLeft) - continue; - else if (b == BUFFER_FRONT_RIGHT && !frontRight) - continue; - else if (b == BUFFER_BACK_RIGHT && !backRight) - continue; - - assert(fb->Attachment[b].Renderbuffer == NULL); - - rb = _mesa_new_renderbuffer(ctx, 0); - if (!rb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "Allocating color buffer"); - return GL_FALSE; - } - - assert(indexBits <= 8); - rb->Format = MESA_FORMAT_CI8; - rb->InternalFormat = GL_COLOR_INDEX; - - rb->AllocStorage = _mesa_soft_renderbuffer_storage; - _mesa_add_renderbuffer(fb, b, rb); - } - - return GL_TRUE; -} - - /** * Add software-based alpha renderbuffers to the given framebuffer. * This is a helper routine for device drivers when creating a diff --git a/src/mesa/main/renderbuffer.h b/src/mesa/main/renderbuffer.h index c9bf888548..7c205e141c 100644 --- a/src/mesa/main/renderbuffer.h +++ b/src/mesa/main/renderbuffer.h @@ -52,12 +52,6 @@ _mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, GLboolean frontLeft, GLboolean backLeft, GLboolean frontRight, GLboolean backRight); -extern GLboolean -_mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, - GLuint indexBits, - GLboolean frontLeft, GLboolean backLeft, - GLboolean frontRight, GLboolean backRight); - extern GLboolean _mesa_add_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, GLuint alphaBits, -- cgit v1.2.3 From 5034e8ad42df60a7f61319ccd6c1a3dbf28e6699 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 19:06:29 -0800 Subject: swrast: Remove _swrast_logicop_ci_span After all the recent color-index rendering removal, _swrast_logicop_ci_span is no longer used anywhere. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_logic.c | 27 --------------------------- src/mesa/swrast/s_logic.h | 6 ------ 2 files changed, 33 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index f0274b4c0b..c36a16e665 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -182,33 +182,6 @@ logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], -/* - * Apply the current logic operator to a span of CI pixels. This is only - * used if the device driver can't do logic ops. - */ -void -_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - GLuint dest[MAX_WIDTH]; - GLuint *index = span->array->index; - - ASSERT(span->end < MAX_WIDTH); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - - /* Read dest values from frame buffer */ - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - dest, sizeof(GLuint)); - } - else { - rb->GetRow(ctx, rb, span->end, span->x, span->y, dest); - } - - logicop_uint1(ctx, span->end, index, dest, span->array->mask); -} - - /** * Apply the current logic operator to a span of RGBA pixels. * We can handle horizontal runs of pixels (spans) or arrays of x/y diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h index ba20cd7b32..e8cfae33f2 100644 --- a/src/mesa/swrast/s_logic.h +++ b/src/mesa/swrast/s_logic.h @@ -29,12 +29,6 @@ #include "swrast.h" - -extern void -_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span); - - extern void _swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span); -- cgit v1.2.3 From bb8c3b1bcc81fd5addc5e214f3efcfdca50c6806 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 19:12:30 -0800 Subject: mesa: Remove ClearIndex and IndexMask from device-driver interface These are used to inform the driver of the clear value for color-index buffers and to control write-masking of bits in color-index buffers. No driver use or need (not even Nouveau) these interfaces. Signed-off-by: Ian Romanick --- src/mesa/drivers/common/driverfuncs.c | 2 -- src/mesa/drivers/dri/mach64/mach64_state.c | 2 -- src/mesa/drivers/dri/mga/mgastate.c | 3 -- src/mesa/drivers/dri/nouveau/nouveau_state.c | 7 ----- src/mesa/drivers/dri/r128/r128_state.c | 2 -- src/mesa/drivers/dri/r200/r200_state.c | 2 -- src/mesa/drivers/dri/radeon/radeon_state.c | 2 -- .../windows/gldirect/mesasw/gld_wgl_mesasw.c | 16 ---------- src/mesa/drivers/x11/xm_dd.c | 34 ---------------------- src/mesa/main/blend.c | 3 -- src/mesa/main/dd.h | 4 --- 11 files changed, 77 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 87163e6505..ebfaa2f07b 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -142,7 +142,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->BlendFuncSeparate = NULL; driver->ClearColor = NULL; driver->ClearDepth = NULL; - driver->ClearIndex = NULL; driver->ClearStencil = NULL; driver->ClipPlane = NULL; driver->ColorMask = NULL; @@ -157,7 +156,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->Enable = NULL; driver->Fogfv = NULL; driver->Hint = NULL; - driver->IndexMask = NULL; driver->Lightfv = NULL; driver->LightModelfv = NULL; driver->LineStipple = NULL; diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c index b9093b5a13..69a5aea02c 100644 --- a/src/mesa/drivers/dri/mach64/mach64_state.c +++ b/src/mesa/drivers/dri/mach64/mach64_state.c @@ -1156,12 +1156,10 @@ void mach64DDInitStateFuncs( GLcontext *ctx ) { ctx->Driver.UpdateState = mach64DDInvalidateState; - ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearColor = mach64DDClearColor; ctx->Driver.DrawBuffer = mach64DDDrawBuffer; ctx->Driver.ReadBuffer = mach64DDReadBuffer; - ctx->Driver.IndexMask = NULL; ctx->Driver.ColorMask = mach64DDColorMask; ctx->Driver.AlphaFunc = mach64DDAlphaFunc; ctx->Driver.BlendEquationSeparate = mach64DDBlendEquationSeparate; diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c index 0253044761..745d5e9852 100644 --- a/src/mesa/drivers/dri/mga/mgastate.c +++ b/src/mesa/drivers/dri/mga/mgastate.c @@ -1193,8 +1193,5 @@ void mgaDDInitStateFuncs( GLcontext *ctx ) ctx->Driver.Viewport = mgaViewport; ctx->Driver.RenderMode = mgaRenderMode; - ctx->Driver.ClearIndex = 0; - ctx->Driver.IndexMask = 0; - TNL_CONTEXT(ctx)->Driver.RunPipeline = mgaRunPipeline; } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index 5d593ed4dd..e1871db0eb 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c @@ -242,12 +242,6 @@ nouveau_fog(GLcontext *ctx, GLenum pname, const GLfloat *params) context_dirty(ctx, FOG); } -static void -nouveau_index_mask(GLcontext *ctx, GLuint mask) -{ - context_dirty(ctx, INDEX_MASK); -} - static void nouveau_light(GLcontext *ctx, GLenum light, GLenum pname, const GLfloat *params) { @@ -504,7 +498,6 @@ nouveau_state_init(GLcontext *ctx) ctx->Driver.DrawBuffers = nouveau_draw_buffers; ctx->Driver.Enable = nouveau_enable; ctx->Driver.Fogfv = nouveau_fog; - ctx->Driver.IndexMask = nouveau_index_mask; ctx->Driver.Lightfv = nouveau_light; ctx->Driver.LightModelfv = nouveau_light_model; ctx->Driver.LineStipple = nouveau_line_stipple; diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c index 42f6dd7388..4d773feaaa 100644 --- a/src/mesa/drivers/dri/r128/r128_state.c +++ b/src/mesa/drivers/dri/r128/r128_state.c @@ -1407,13 +1407,11 @@ void r128DDInitStateFuncs( GLcontext *ctx ) { ctx->Driver.UpdateState = r128DDInvalidateState; - ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearColor = r128DDClearColor; ctx->Driver.ClearStencil = r128DDClearStencil; ctx->Driver.DrawBuffer = r128DDDrawBuffer; ctx->Driver.ReadBuffer = r128DDReadBuffer; - ctx->Driver.IndexMask = NULL; ctx->Driver.ColorMask = r128DDColorMask; ctx->Driver.AlphaFunc = r128DDAlphaFunc; ctx->Driver.BlendEquationSeparate = r128DDBlendEquationSeparate; diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index b9ec6f428f..050e5aa877 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -2501,7 +2501,6 @@ void r200InitStateFuncs( struct dd_function_table *functions ) functions->BlendFuncSeparate = r200BlendFuncSeparate; functions->ClearColor = r200ClearColor; functions->ClearDepth = r200ClearDepth; - functions->ClearIndex = NULL; functions->ClearStencil = r200ClearStencil; functions->ClipPlane = r200ClipPlane; functions->ColorMask = r200ColorMask; @@ -2513,7 +2512,6 @@ void r200InitStateFuncs( struct dd_function_table *functions ) functions->Fogfv = r200Fogfv; functions->FrontFace = r200FrontFace; functions->Hint = NULL; - functions->IndexMask = NULL; functions->LightModelfv = r200LightModelfv; functions->Lightfv = r200Lightfv; functions->LineStipple = r200LineStipple; diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 7db745a180..0ce97e8697 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -2254,7 +2254,6 @@ void radeonInitStateFuncs( GLcontext *ctx , GLboolean dri2 ) ctx->Driver.BlendFuncSeparate = radeonBlendFuncSeparate; ctx->Driver.ClearColor = radeonClearColor; ctx->Driver.ClearDepth = radeonClearDepth; - ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearStencil = radeonClearStencil; ctx->Driver.ClipPlane = radeonClipPlane; ctx->Driver.ColorMask = radeonColorMask; @@ -2266,7 +2265,6 @@ void radeonInitStateFuncs( GLcontext *ctx , GLboolean dri2 ) ctx->Driver.Fogfv = radeonFogfv; ctx->Driver.FrontFace = radeonFrontFace; ctx->Driver.Hint = NULL; - ctx->Driver.IndexMask = NULL; ctx->Driver.LightModelfv = radeonLightModelfv; ctx->Driver.Lightfv = radeonLightfv; ctx->Driver.LineStipple = radeonLineStipple; diff --git a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c index 7ac425a109..f927abfa11 100644 --- a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c +++ b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c @@ -629,21 +629,6 @@ static void flush(GLcontext* ctx) } -//--------------------------------------------------------------------------- - - -/* - * Set the color index used to clear the color buffer. - */ -static void clear_index(GLcontext* ctx, GLuint index) -{ - GLD_context *gldCtx = GLD_GET_CONTEXT(ctx); - WMesaContext *Current = GLD_GET_WMESA_DRIVER(gldCtx); - Current->clearpixel = index; -} - - - //--------------------------------------------------------------------------- /* @@ -1367,7 +1352,6 @@ static void wmesa_update_state_first_time( ctx->Driver.Clear = clear; ctx->Driver.Flush = flush; - ctx->Driver.ClearIndex = clear_index; ctx->Driver.ClearColor = clear_color; ctx->Driver.Enable = enable; diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index d304192f4c..5edafb890b 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -106,18 +106,6 @@ finish_or_flush( GLcontext *ctx ) } -static void -clear_index( GLcontext *ctx, GLuint index ) -{ - if (ctx->DrawBuffer->Name == 0) { - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); - xmesa->clearpixel = (unsigned long) index; - XMesaSetForeground( xmesa->display, xmbuf->cleargc, (unsigned long) index ); - } -} - - static void clear_color( GLcontext *ctx, const GLfloat color[4] ) { @@ -144,26 +132,6 @@ clear_color( GLcontext *ctx, const GLfloat color[4] ) -/* Set index mask ala glIndexMask */ -static void -index_mask( GLcontext *ctx, GLuint mask ) -{ - const XMesaContext xmesa = XMESA_CONTEXT(ctx); - XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer); - /* not sure this conditional is really needed */ - if (xmbuf->backxrb && xmbuf->backxrb->pixmap) { - unsigned long m; - if (mask==0xffffffff) { - m = ((unsigned long)~0L); - } - else { - m = (unsigned long) mask; - } - XMesaSetPlaneMask( xmesa->display, xmbuf->cleargc, m ); - } -} - - /* Implements glColorMask() */ static void color_mask(GLcontext *ctx, @@ -1143,9 +1111,7 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, driver->GetBufferSize = NULL; /* OBSOLETE */ driver->Flush = finish_or_flush; driver->Finish = finish_or_flush; - driver->ClearIndex = clear_index; driver->ClearColor = clear_color; - driver->IndexMask = index_mask; driver->ColorMask = color_mask; driver->Enable = enable; driver->Viewport = xmesa_viewport; diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index de60031cc8..d022770f24 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -456,9 +456,6 @@ _mesa_IndexMask( GLuint mask ) FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.IndexMask = mask; - - if (ctx->Driver.IndexMask) - ctx->Driver.IndexMask( ctx, mask ); } #endif diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 079e44bb95..84b83fe273 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -620,8 +620,6 @@ struct dd_function_table { void (*ClearColor)(GLcontext *ctx, const GLfloat color[4]); /** Specify the clear value for the depth buffer */ void (*ClearDepth)(GLcontext *ctx, GLclampd d); - /** Specify the clear value for the color index buffers */ - void (*ClearIndex)(GLcontext *ctx, GLuint index); /** Specify the clear value for the stencil buffer */ void (*ClearStencil)(GLcontext *ctx, GLint s); /** Specify a plane against which all geometry is clipped */ @@ -653,8 +651,6 @@ struct dd_function_table { void (*Fogfv)(GLcontext *ctx, GLenum pname, const GLfloat *params); /** Specify implementation-specific hints */ void (*Hint)(GLcontext *ctx, GLenum target, GLenum mode); - /** Control the writing of individual bits in the color index buffers */ - void (*IndexMask)(GLcontext *ctx, GLuint mask); /** Set light source parameters. * Note: for GL_POSITION and GL_SPOT_DIRECTION, params will have already * been transformed to eye-space. -- cgit v1.2.3 From 24d311c13339978a37885e88a49a990903652339 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 19:25:19 -0800 Subject: mesa: Eliminate index parameter to _mesa_feedback_vertex Signed-off-by: Ian Romanick --- src/mesa/main/drawpix.c | 3 --- src/mesa/main/feedback.c | 9 ++------- src/mesa/main/feedback.h | 2 -- src/mesa/state_tracker/st_cb_feedback.c | 3 +-- src/mesa/swrast/s_feedback.c | 2 +- 5 files changed, 4 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index 84cb78612b..bf36a7e7a4 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -127,7 +127,6 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, _mesa_feedback_vertex( ctx, ctx->Current.RasterPos, ctx->Current.RasterColor, - ctx->Current.RasterIndex, ctx->Current.RasterTexCoords[0] ); } else { @@ -213,7 +212,6 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, _mesa_feedback_vertex( ctx, ctx->Current.RasterPos, ctx->Current.RasterColor, - ctx->Current.RasterIndex, ctx->Current.RasterTexCoords[0] ); } else { @@ -293,7 +291,6 @@ _mesa_Bitmap( GLsizei width, GLsizei height, _mesa_feedback_vertex( ctx, ctx->Current.RasterPos, ctx->Current.RasterColor, - ctx->Current.RasterIndex, ctx->Current.RasterTexCoords[0] ); } else { diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 323cc53036..c72b91280e 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -44,9 +44,8 @@ #define FB_3D 0x01 #define FB_4D 0x02 -#define FB_INDEX 0x04 -#define FB_COLOR 0x08 -#define FB_TEXTURE 0X10 +#define FB_COLOR 0x04 +#define FB_TEXTURE 0X08 @@ -120,7 +119,6 @@ void _mesa_feedback_vertex(GLcontext *ctx, const GLfloat win[4], const GLfloat color[4], - GLfloat index, const GLfloat texcoord[4]) { _mesa_feedback_token( ctx, win[0] ); @@ -131,9 +129,6 @@ _mesa_feedback_vertex(GLcontext *ctx, if (ctx->Feedback._Mask & FB_4D) { _mesa_feedback_token( ctx, win[3] ); } - if (ctx->Feedback._Mask & FB_INDEX) { - _mesa_feedback_token( ctx, (GLfloat) index ); - } if (ctx->Feedback._Mask & FB_COLOR) { _mesa_feedback_token( ctx, color[0] ); _mesa_feedback_token( ctx, color[1] ); diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h index 7a648f444f..3e8283ed23 100644 --- a/src/mesa/main/feedback.h +++ b/src/mesa/main/feedback.h @@ -41,7 +41,6 @@ extern void _mesa_feedback_vertex( GLcontext *ctx, const GLfloat win[4], const GLfloat color[4], - GLfloat index, const GLfloat texcoord[4] ); @@ -70,7 +69,6 @@ static INLINE void _mesa_feedback_vertex( GLcontext *ctx, const GLfloat win[4], const GLfloat color[4], - GLfloat index, const GLfloat texcoord[4] ) { /* render mode is always GL_RENDER */ diff --git a/src/mesa/state_tracker/st_cb_feedback.c b/src/mesa/state_tracker/st_cb_feedback.c index edf26473d4..37b1fb55f4 100644 --- a/src/mesa/state_tracker/st_cb_feedback.c +++ b/src/mesa/state_tracker/st_cb_feedback.c @@ -83,7 +83,6 @@ feedback_vertex(GLcontext *ctx, const struct draw_context *draw, const struct st_context *st = ctx->st; GLfloat win[4]; const GLfloat *color, *texcoord; - const GLfloat ci = 0; GLuint slot; /* Recall that Y=0=Top of window for Gallium wincoords */ @@ -109,7 +108,7 @@ feedback_vertex(GLcontext *ctx, const struct draw_context *draw, else texcoord = ctx->Current.Attrib[VERT_ATTRIB_TEX0]; - _mesa_feedback_vertex(ctx, win, color, ci, texcoord); + _mesa_feedback_vertex(ctx, win, color, texcoord); } diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c index 2e6066983d..373b1416e2 100644 --- a/src/mesa/swrast/s_feedback.c +++ b/src/mesa/swrast/s_feedback.c @@ -46,7 +46,7 @@ feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv) win[2] = v->attrib[FRAG_ATTRIB_WPOS][2] / ctx->DrawBuffer->_DepthMaxF; win[3] = 1.0F / v->attrib[FRAG_ATTRIB_WPOS][3]; - _mesa_feedback_vertex(ctx, win, color, v->attrib[FRAG_ATTRIB_CI][0], vtc); + _mesa_feedback_vertex(ctx, win, color, vtc); } -- cgit v1.2.3 From 5c52b4292ff1aa37f38b20f33ff1642e1c20f894 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 19:28:04 -0800 Subject: mesa: Always return default value for CURRENT_RASTER_INDEX Since there is no color-index rendering, it is impossible to update this value. Just return the initial setting and be happy. Signed-off-by: Ian Romanick --- src/mesa/main/get.c | 8 ++++---- src/mesa/main/get_gen.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index e390d29757..edc4400912 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -253,7 +253,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterDistance); break; case GL_CURRENT_RASTER_INDEX: - params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterIndex); + params[0] = FLOAT_TO_BOOLEAN(1.0); break; case GL_CURRENT_RASTER_POSITION: params[0] = FLOAT_TO_BOOLEAN(ctx->Current.RasterPos[0]); @@ -2122,7 +2122,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = ctx->Current.RasterDistance; break; case GL_CURRENT_RASTER_INDEX: - params[0] = ctx->Current.RasterIndex; + params[0] = 1.0; break; case GL_CURRENT_RASTER_POSITION: params[0] = ctx->Current.RasterPos[0]; @@ -3991,7 +3991,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = IROUND(ctx->Current.RasterDistance); break; case GL_CURRENT_RASTER_INDEX: - params[0] = IROUND(ctx->Current.RasterIndex); + params[0] = IROUND(1.0); break; case GL_CURRENT_RASTER_POSITION: params[0] = IROUND(ctx->Current.RasterPos[0]); @@ -5861,7 +5861,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Current.RasterDistance); break; case GL_CURRENT_RASTER_INDEX: - params[0] = IROUND64(ctx->Current.RasterIndex); + params[0] = IROUND64(1.0); break; case GL_CURRENT_RASTER_POSITION: params[0] = IROUND64(ctx->Current.RasterPos[0]); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 17ea1e4ae6..9d5a51d58c 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -155,7 +155,7 @@ StateVars = [ ( "GL_CURRENT_RASTER_DISTANCE", GLfloat, ["ctx->Current.RasterDistance"], "", None ), ( "GL_CURRENT_RASTER_INDEX", GLfloat, - ["ctx->Current.RasterIndex"], "", None ), + ["1.0"], "", None ), ( "GL_CURRENT_RASTER_POSITION", GLfloat, ["ctx->Current.RasterPos[0]", "ctx->Current.RasterPos[1]", -- cgit v1.2.3 From 06ceba0a7cab39e770a68b3ae8b8b4f17c0347d2 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 24 Feb 2010 19:29:53 -0800 Subject: mesa: Remove unused RasterIndex field With the preceeding changes, gl_current_attrib::RasterIndex is not used. Remove it. Signed-off-by: Ian Romanick --- src/mesa/main/mtypes.h | 1 - src/mesa/main/rastpos.c | 1 - 2 files changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index e0ee3c9f5d..4d55ebb972 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -630,7 +630,6 @@ struct gl_current_attrib GLfloat RasterDistance; GLfloat RasterColor[4]; GLfloat RasterSecondaryColor[4]; - GLfloat RasterIndex; GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4]; GLboolean RasterPosValid; /*@}*/ diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 03ff3b6bbc..75c67f2693 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -556,7 +556,6 @@ void _mesa_init_rastpos( GLcontext * ctx ) ctx->Current.RasterDistance = 0.0; ASSIGN_4V( ctx->Current.RasterColor, 1.0, 1.0, 1.0, 1.0 ); ASSIGN_4V( ctx->Current.RasterSecondaryColor, 0.0, 0.0, 0.0, 1.0 ); - ctx->Current.RasterIndex = 1.0; for (i = 0; i < Elements(ctx->Current.RasterTexCoords); i++) ASSIGN_4V( ctx->Current.RasterTexCoords[i], 0.0, 0.0, 0.0, 1.0 ); ctx->Current.RasterPosValid = GL_TRUE; -- cgit v1.2.3 From 78742f8e867d8819fca49cc6559ac5ef44fdd83f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 26 Feb 2010 17:41:15 -0800 Subject: mesa/tnl_dd: Remove color-index support from t_dd_tritmp.h Signed-off-by: Ian Romanick --- src/mesa/tnl_dd/t_dd_tritmp.h | 122 +----------------------------------------- 1 file changed, 1 insertion(+), 121 deletions(-) (limited to 'src') diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h index 6acd837317..708f7560ed 100644 --- a/src/mesa/tnl_dd/t_dd_tritmp.h +++ b/src/mesa/tnl_dd/t_dd_tritmp.h @@ -42,7 +42,6 @@ * DO_UNFILLED: Decompose triangles to lines and points where appropriate. * DO_TWOSTENCIL:Gross hack for two-sided stencil. * - * HAVE_RGBA: Vertices have rgba values (otherwise index values). * HAVE_SPEC: Vertices have secondary rgba values. * * VERT_X(v): Alias for vertex x value. @@ -59,29 +58,15 @@ * VERT_COPY_RGBA: Copy vertex rgba another vertex. * VERT_SAVE_RGBA: Save vertex rgba to a local variable. * VERT_RESTORE_RGBA: Restore vertex rgba from a local variable. - * --> Similar for IND and SPEC. + * --> Similar for SPEC. * * LOCAL_VARS(n): (At least) define local vars for save/restore rgba. * */ -#if HAVE_RGBA -#define VERT_SET_IND( v, c ) (void) c -#define VERT_COPY_IND( v0, v1 ) -#define VERT_SAVE_IND( idx ) -#define VERT_RESTORE_IND( idx ) #if HAVE_BACK_COLORS #define VERT_SET_RGBA( v, c ) #endif -#else -#define VERT_SET_RGBA( v, c ) (void) c -#define VERT_COPY_RGBA( v0, v1 ) -#define VERT_SAVE_RGBA( idx ) -#define VERT_RESTORE_RGBA( idx ) -#if HAVE_BACK_COLORS -#define VERT_SET_IND( v, c ) -#endif -#endif #if !HAVE_SPEC #define VERT_SET_SPEC( v, c ) (void) c @@ -99,7 +84,6 @@ #if !HAVE_BACK_COLORS #define VERT_COPY_SPEC1( v ) -#define VERT_COPY_IND1( v ) #define VERT_COPY_RGBA1( v ) #endif @@ -173,7 +157,6 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (DO_TWOSIDE && facing == 1) { - if (HAVE_RGBA) { if (HAVE_BACK_COLORS) { if (!DO_FLAT) { VERT_SAVE_RGBA( 0 ); @@ -235,18 +218,6 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) VERT_SET_SPEC( v[2], vbspec[e2] ); } } - } - else { - GLfloat (*vbindex) = (GLfloat *)VB->BackfaceIndexPtr->data; - if (!DO_FLAT) { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_SET_IND( v[0], vbindex[e0] ); - VERT_SET_IND( v[1], vbindex[e1] ); - } - VERT_SAVE_IND( 2 ); - VERT_SET_IND( v[2], vbindex[e2] ); - } } } @@ -274,7 +245,6 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } if (DO_FLAT) { - if (HAVE_RGBA) { VERT_SAVE_RGBA( 0 ); VERT_SAVE_RGBA( 1 ); VERT_COPY_RGBA( v[0], v[2] ); @@ -285,13 +255,6 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) VERT_COPY_SPEC( v[0], v[2] ); VERT_COPY_SPEC( v[1], v[2] ); } - } - else { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_COPY_IND( v[0], v[2] ); - VERT_COPY_IND( v[1], v[2] ); - } } if (mode == GL_POINT) { @@ -346,7 +309,6 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (DO_TWOSIDE && facing == 1) { - if (HAVE_RGBA) { if (!DO_FLAT) { VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 1 ); @@ -359,30 +321,16 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } VERT_RESTORE_SPEC( 2 ); } - } - else { - if (!DO_FLAT) { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - } - VERT_RESTORE_IND( 2 ); - } } if (DO_FLAT) { - if (HAVE_RGBA) { VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 1 ); if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_RESTORE_SPEC( 0 ); VERT_RESTORE_SPEC( 1 ); } - } - else { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - } } } #endif @@ -435,7 +383,6 @@ static void TAG(quadr)( GLcontext *ctx, if (DO_TWOSIDE && facing == 1) { - if (HAVE_RGBA) { GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; (void)vbcolor; @@ -504,20 +451,6 @@ static void TAG(quadr)( GLcontext *ctx, VERT_SET_SPEC( v[3], vbspec[e3] ); } } - } - else { - GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data; - if (!DO_FLAT) { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_SAVE_IND( 2 ); - VERT_SET_IND( v[0], vbindex[e0] ); - VERT_SET_IND( v[1], vbindex[e1] ); - VERT_SET_IND( v[2], vbindex[e2] ); - } - VERT_SAVE_IND( 3 ); - VERT_SET_IND( v[3], vbindex[e3] ); - } } } @@ -546,7 +479,6 @@ static void TAG(quadr)( GLcontext *ctx, } if (DO_FLAT) { - if (HAVE_RGBA) { VERT_SAVE_RGBA( 0 ); VERT_SAVE_RGBA( 1 ); VERT_SAVE_RGBA( 2 ); @@ -561,15 +493,6 @@ static void TAG(quadr)( GLcontext *ctx, VERT_COPY_SPEC( v[1], v[3] ); VERT_COPY_SPEC( v[2], v[3] ); } - } - else { - VERT_SAVE_IND( 0 ); - VERT_SAVE_IND( 1 ); - VERT_SAVE_IND( 2 ); - VERT_COPY_IND( v[0], v[3] ); - VERT_COPY_IND( v[1], v[3] ); - VERT_COPY_IND( v[2], v[3] ); - } } if (mode == GL_POINT) { @@ -627,7 +550,6 @@ static void TAG(quadr)( GLcontext *ctx, if (DO_TWOSIDE && facing == 1) { - if (HAVE_RGBA) { if (!DO_FLAT) { VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 1 ); @@ -642,20 +564,10 @@ static void TAG(quadr)( GLcontext *ctx, } VERT_RESTORE_SPEC( 3 ); } - } - else { - if (!DO_FLAT) { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - VERT_RESTORE_IND( 2 ); - } - VERT_RESTORE_IND( 3 ); - } } if (DO_FLAT) { - if (HAVE_RGBA) { VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 1 ); VERT_RESTORE_RGBA( 2 ); @@ -664,12 +576,6 @@ static void TAG(quadr)( GLcontext *ctx, VERT_RESTORE_SPEC( 1 ); VERT_RESTORE_SPEC( 2 ); } - } - else { - VERT_RESTORE_IND( 0 ); - VERT_RESTORE_IND( 1 ); - VERT_RESTORE_IND( 2 ); - } } } #else @@ -705,33 +611,22 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 ) v[1] = (VERTEX *)GET_VERTEX(e1); if (DO_FLAT) { - if (HAVE_RGBA) { VERT_SAVE_RGBA( 0 ); VERT_COPY_RGBA( v[0], v[1] ); if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_SAVE_SPEC( 0 ); VERT_COPY_SPEC( v[0], v[1] ); } - } - else { - VERT_SAVE_IND( 0 ); - VERT_COPY_IND( v[0], v[1] ); - } } LINE( v[0], v[1] ); if (DO_FLAT) { - if (HAVE_RGBA) { VERT_RESTORE_RGBA( 0 ); if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_RESTORE_SPEC( 0 ); } - } - else { - VERT_RESTORE_IND( 0 ); - } } } #endif @@ -781,23 +676,9 @@ static void TAG(init)( void ) #undef IND #undef TAG -#if HAVE_RGBA -#undef VERT_SET_IND -#undef VERT_COPY_IND -#undef VERT_SAVE_IND -#undef VERT_RESTORE_IND #if HAVE_BACK_COLORS #undef VERT_SET_RGBA #endif -#else -#undef VERT_SET_RGBA -#undef VERT_COPY_RGBA -#undef VERT_SAVE_RGBA -#undef VERT_RESTORE_RGBA -#if HAVE_BACK_COLORS -#undef VERT_SET_IND -#endif -#endif #if !HAVE_SPEC #undef VERT_SET_SPEC @@ -815,7 +696,6 @@ static void TAG(init)( void ) #if !HAVE_BACK_COLORS #undef VERT_COPY_SPEC1 -#undef VERT_COPY_IND1 #undef VERT_COPY_RGBA1 #endif -- cgit v1.2.3 From e00b50c39ad13090c74877a421d10483c3c5bab1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 26 Feb 2010 17:45:27 -0800 Subject: mesa/tnl_dd: White-space / indentation fixes after previous commit Signed-off-by: Ian Romanick --- src/mesa/tnl_dd/t_dd_tritmp.h | 296 +++++++++++++++++++++--------------------- 1 file changed, 146 insertions(+), 150 deletions(-) (limited to 'src') diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h index 708f7560ed..2c36d845ab 100644 --- a/src/mesa/tnl_dd/t_dd_tritmp.h +++ b/src/mesa/tnl_dd/t_dd_tritmp.h @@ -155,69 +155,68 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } - if (DO_TWOSIDE && facing == 1) - { - if (HAVE_BACK_COLORS) { + if (DO_TWOSIDE && facing == 1) { + if (HAVE_BACK_COLORS) { + if (!DO_FLAT) { + VERT_SAVE_RGBA( 0 ); + VERT_SAVE_RGBA( 1 ); + VERT_COPY_RGBA1( v[0] ); + VERT_COPY_RGBA1( v[1] ); + } + VERT_SAVE_RGBA( 2 ); + VERT_COPY_RGBA1( v[2] ); + if (HAVE_SPEC) { if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_COPY_RGBA1( v[0] ); - VERT_COPY_RGBA1( v[1] ); - } - VERT_SAVE_RGBA( 2 ); - VERT_COPY_RGBA1( v[2] ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_COPY_SPEC1( v[0] ); - VERT_COPY_SPEC1( v[1] ); - } - VERT_SAVE_SPEC( 2 ); - VERT_COPY_SPEC1( v[2] ); + VERT_SAVE_SPEC( 0 ); + VERT_SAVE_SPEC( 1 ); + VERT_COPY_SPEC1( v[0] ); + VERT_COPY_SPEC1( v[1] ); } + VERT_SAVE_SPEC( 2 ); + VERT_COPY_SPEC1( v[2] ); } - else { - GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; - (void) vbcolor; + } + else { + GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; + (void) vbcolor; - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - } - VERT_SAVE_RGBA( 2 ); + if (!DO_FLAT) { + VERT_SAVE_RGBA( 0 ); + VERT_SAVE_RGBA( 1 ); + } + VERT_SAVE_RGBA( 2 ); - if (VB->BackfaceColorPtr->stride) { - ASSERT(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat)); + if (VB->BackfaceColorPtr->stride) { + ASSERT(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat)); - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[e0] ); - VERT_SET_RGBA( v[1], vbcolor[e1] ); - } - VERT_SET_RGBA( v[2], vbcolor[e2] ); + if (!DO_FLAT) { + VERT_SET_RGBA( v[0], vbcolor[e0] ); + VERT_SET_RGBA( v[1], vbcolor[e1] ); } - else { - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[0] ); - VERT_SET_RGBA( v[1], vbcolor[0] ); - } - VERT_SET_RGBA( v[2], vbcolor[0] ); + VERT_SET_RGBA( v[2], vbcolor[e2] ); + } + else { + if (!DO_FLAT) { + VERT_SET_RGBA( v[0], vbcolor[0] ); + VERT_SET_RGBA( v[1], vbcolor[0] ); } + VERT_SET_RGBA( v[2], vbcolor[0] ); + } - if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { - GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; - ASSERT(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat)); + if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { + GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; + ASSERT(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat)); - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SET_SPEC( v[0], vbspec[e0] ); - VERT_SET_SPEC( v[1], vbspec[e1] ); - } - VERT_SAVE_SPEC( 2 ); - VERT_SET_SPEC( v[2], vbspec[e2] ); + if (!DO_FLAT) { + VERT_SAVE_SPEC( 0 ); + VERT_SAVE_SPEC( 1 ); + VERT_SET_SPEC( v[0], vbspec[e0] ); + VERT_SET_SPEC( v[1], vbspec[e1] ); } + VERT_SAVE_SPEC( 2 ); + VERT_SET_SPEC( v[2], vbspec[e2] ); } + } } } @@ -245,16 +244,16 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } if (DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_COPY_RGBA( v[0], v[2] ); - VERT_COPY_RGBA( v[1], v[2] ); - if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_COPY_SPEC( v[0], v[2] ); - VERT_COPY_SPEC( v[1], v[2] ); - } + VERT_SAVE_RGBA( 0 ); + VERT_SAVE_RGBA( 1 ); + VERT_COPY_RGBA( v[0], v[2] ); + VERT_COPY_RGBA( v[1], v[2] ); + if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { + VERT_SAVE_SPEC( 0 ); + VERT_SAVE_SPEC( 1 ); + VERT_COPY_SPEC( v[0], v[2] ); + VERT_COPY_SPEC( v[1], v[2] ); + } } if (mode == GL_POINT) { @@ -307,20 +306,19 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) VERT_SET_Z(v[2], z[2]); } - if (DO_TWOSIDE && facing == 1) - { + if (DO_TWOSIDE && facing == 1) { + if (!DO_FLAT) { + VERT_RESTORE_RGBA( 0 ); + VERT_RESTORE_RGBA( 1 ); + } + VERT_RESTORE_RGBA( 2 ); + if (HAVE_SPEC) { if (!DO_FLAT) { - VERT_RESTORE_RGBA( 0 ); - VERT_RESTORE_RGBA( 1 ); - } - VERT_RESTORE_RGBA( 2 ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_RESTORE_SPEC( 0 ); - VERT_RESTORE_SPEC( 1 ); - } - VERT_RESTORE_SPEC( 2 ); + VERT_RESTORE_SPEC( 0 ); + VERT_RESTORE_SPEC( 1 ); } + VERT_RESTORE_SPEC( 2 ); + } } @@ -381,76 +379,75 @@ static void TAG(quadr)( GLcontext *ctx, } } - if (DO_TWOSIDE && facing == 1) - { - GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; - (void)vbcolor; - - if (HAVE_BACK_COLORS) { - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_SAVE_RGBA( 2 ); - VERT_COPY_RGBA1( v[0] ); - VERT_COPY_RGBA1( v[1] ); - VERT_COPY_RGBA1( v[2] ); + if (DO_TWOSIDE && facing == 1) { + GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; + (void)vbcolor; + + if (HAVE_BACK_COLORS) { + if (!DO_FLAT) { + VERT_SAVE_RGBA( 0 ); + VERT_SAVE_RGBA( 1 ); + VERT_SAVE_RGBA( 2 ); + VERT_COPY_RGBA1( v[0] ); + VERT_COPY_RGBA1( v[1] ); + VERT_COPY_RGBA1( v[2] ); + } + VERT_SAVE_RGBA( 3 ); + VERT_COPY_RGBA1( v[3] ); + if (HAVE_SPEC) { + if (!DO_FLAT) { + VERT_SAVE_SPEC( 0 ); + VERT_SAVE_SPEC( 1 ); + VERT_SAVE_SPEC( 2 ); + VERT_COPY_SPEC1( v[0] ); + VERT_COPY_SPEC1( v[1] ); + VERT_COPY_SPEC1( v[2] ); } - VERT_SAVE_RGBA( 3 ); - VERT_COPY_RGBA1( v[3] ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SAVE_SPEC( 2 ); - VERT_COPY_SPEC1( v[0] ); - VERT_COPY_SPEC1( v[1] ); - VERT_COPY_SPEC1( v[2] ); - } - VERT_SAVE_SPEC( 3 ); - VERT_COPY_SPEC1( v[3] ); + VERT_SAVE_SPEC( 3 ); + VERT_COPY_SPEC1( v[3] ); + } + } + else { + if (!DO_FLAT) { + VERT_SAVE_RGBA( 0 ); + VERT_SAVE_RGBA( 1 ); + VERT_SAVE_RGBA( 2 ); + } + VERT_SAVE_RGBA( 3 ); + + if (VB->BackfaceColorPtr->stride) { + if (!DO_FLAT) { + VERT_SET_RGBA( v[0], vbcolor[e0] ); + VERT_SET_RGBA( v[1], vbcolor[e1] ); + VERT_SET_RGBA( v[2], vbcolor[e2] ); } + VERT_SET_RGBA( v[3], vbcolor[e3] ); } else { - if (!DO_FLAT) { - VERT_SAVE_RGBA( 0 ); - VERT_SAVE_RGBA( 1 ); - VERT_SAVE_RGBA( 2 ); - } - VERT_SAVE_RGBA( 3 ); - - if (VB->BackfaceColorPtr->stride) { - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[e0] ); - VERT_SET_RGBA( v[1], vbcolor[e1] ); - VERT_SET_RGBA( v[2], vbcolor[e2] ); - } - VERT_SET_RGBA( v[3], vbcolor[e3] ); - } - else { - if (!DO_FLAT) { - VERT_SET_RGBA( v[0], vbcolor[0] ); - VERT_SET_RGBA( v[1], vbcolor[0] ); - VERT_SET_RGBA( v[2], vbcolor[0] ); - } - VERT_SET_RGBA( v[3], vbcolor[0] ); + if (!DO_FLAT) { + VERT_SET_RGBA( v[0], vbcolor[0] ); + VERT_SET_RGBA( v[1], vbcolor[0] ); + VERT_SET_RGBA( v[2], vbcolor[0] ); } + VERT_SET_RGBA( v[3], vbcolor[0] ); + } + + if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { + GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; + ASSERT(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat)); - if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { - GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; - ASSERT(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat)); - - if (!DO_FLAT) { - VERT_SAVE_SPEC( 0 ); - VERT_SAVE_SPEC( 1 ); - VERT_SAVE_SPEC( 2 ); - VERT_SET_SPEC( v[0], vbspec[e0] ); - VERT_SET_SPEC( v[1], vbspec[e1] ); - VERT_SET_SPEC( v[2], vbspec[e2] ); - } - VERT_SAVE_SPEC( 3 ); - VERT_SET_SPEC( v[3], vbspec[e3] ); - } + if (!DO_FLAT) { + VERT_SAVE_SPEC( 0 ); + VERT_SAVE_SPEC( 1 ); + VERT_SAVE_SPEC( 2 ); + VERT_SET_SPEC( v[0], vbspec[e0] ); + VERT_SET_SPEC( v[1], vbspec[e1] ); + VERT_SET_SPEC( v[2], vbspec[e2] ); + } + VERT_SAVE_SPEC( 3 ); + VERT_SET_SPEC( v[3], vbspec[e3] ); } + } } } @@ -548,22 +545,21 @@ static void TAG(quadr)( GLcontext *ctx, VERT_SET_Z(v[3], z[3]); } - if (DO_TWOSIDE && facing == 1) - { + if (DO_TWOSIDE && facing == 1) { + if (!DO_FLAT) { + VERT_RESTORE_RGBA( 0 ); + VERT_RESTORE_RGBA( 1 ); + VERT_RESTORE_RGBA( 2 ); + } + VERT_RESTORE_RGBA( 3 ); + if (HAVE_SPEC) { if (!DO_FLAT) { - VERT_RESTORE_RGBA( 0 ); - VERT_RESTORE_RGBA( 1 ); - VERT_RESTORE_RGBA( 2 ); - } - VERT_RESTORE_RGBA( 3 ); - if (HAVE_SPEC) { - if (!DO_FLAT) { - VERT_RESTORE_SPEC( 0 ); - VERT_RESTORE_SPEC( 1 ); - VERT_RESTORE_SPEC( 2 ); - } - VERT_RESTORE_SPEC( 3 ); + VERT_RESTORE_SPEC( 0 ); + VERT_RESTORE_SPEC( 1 ); + VERT_RESTORE_SPEC( 2 ); } + VERT_RESTORE_SPEC( 3 ); + } } -- cgit v1.2.3 From 889a0f34717e84778de33ab4e6c43d5627d5b4c9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 26 Feb 2010 17:54:59 -0800 Subject: mesa/tnl_dd: Remove color-index support from t_dd_unfilled.h The code removal and the re-indent were done together for this one because the cause of the affected code blocks is much, much smaller than in t_dd_tritmp.h. Signed-off-by: Ian Romanick --- src/mesa/tnl_dd/t_dd_unfilled.h | 117 +++++++++++++--------------------------- 1 file changed, 38 insertions(+), 79 deletions(-) (limited to 'src') diff --git a/src/mesa/tnl_dd/t_dd_unfilled.h b/src/mesa/tnl_dd/t_dd_unfilled.h index e4d82aa080..9c467291a1 100644 --- a/src/mesa/tnl_dd/t_dd_unfilled.h +++ b/src/mesa/tnl_dd/t_dd_unfilled.h @@ -25,13 +25,6 @@ * Keith Whitwell */ -#if HAVE_RGBA -#define VERT_SET_IND( v, c ) -#define VERT_COPY_IND( v0, v1 ) -#define VERT_SAVE_IND( idx ) -#define VERT_RESTORE_IND( idx ) -#endif - #if !HAVE_SPEC #define VERT_SET_SPEC( v, c ) #define VERT_COPY_SPEC( v0, v1 ) @@ -53,23 +46,16 @@ static void TAG(unfilled_tri)( GLcontext *ctx, v[2] = (VERTEX *)GET_VERTEX(e2); if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_SAVE_RGBA(0); - VERT_SAVE_RGBA(1); - VERT_COPY_RGBA(v[0], v[2]); - VERT_COPY_RGBA(v[1], v[2]); - - if (HAVE_SPEC) { - VERT_SAVE_SPEC(0); - VERT_SAVE_SPEC(1); - VERT_COPY_SPEC(v[0], v[2]); - VERT_COPY_SPEC(v[1], v[2]); - } - } else { - VERT_SAVE_IND(0); - VERT_SAVE_IND(1); - VERT_COPY_IND(v[0], v[2]); - VERT_COPY_IND(v[1], v[2]); + VERT_SAVE_RGBA(0); + VERT_SAVE_RGBA(1); + VERT_COPY_RGBA(v[0], v[2]); + VERT_COPY_RGBA(v[1], v[2]); + + if (HAVE_SPEC) { + VERT_SAVE_SPEC(0); + VERT_SAVE_SPEC(1); + VERT_COPY_SPEC(v[0], v[2]); + VERT_COPY_SPEC(v[1], v[2]); } } @@ -98,17 +84,12 @@ static void TAG(unfilled_tri)( GLcontext *ctx, } if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_RESTORE_RGBA(0); - VERT_RESTORE_RGBA(1); - - if (HAVE_SPEC) { - VERT_RESTORE_SPEC(0); - VERT_RESTORE_SPEC(1); - } - } else { - VERT_RESTORE_IND(0); - VERT_RESTORE_IND(1); + VERT_RESTORE_RGBA(0); + VERT_RESTORE_RGBA(1); + + if (HAVE_SPEC) { + VERT_RESTORE_SPEC(0); + VERT_RESTORE_SPEC(1); } } } @@ -133,29 +114,20 @@ static void TAG(unfilled_quad)( GLcontext *ctx, * support flatshading, this will already have been done: */ if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_SAVE_RGBA(0); - VERT_SAVE_RGBA(1); - VERT_SAVE_RGBA(2); - VERT_COPY_RGBA(v[0], v[3]); - VERT_COPY_RGBA(v[1], v[3]); - VERT_COPY_RGBA(v[2], v[3]); - - if (HAVE_SPEC) { - VERT_SAVE_SPEC(0); - VERT_SAVE_SPEC(1); - VERT_SAVE_SPEC(2); - VERT_COPY_SPEC(v[0], v[3]); - VERT_COPY_SPEC(v[1], v[3]); - VERT_COPY_SPEC(v[2], v[3]); - } - } else { - VERT_SAVE_IND(0); - VERT_SAVE_IND(1); - VERT_SAVE_IND(2); - VERT_COPY_IND(v[0], v[3]); - VERT_COPY_IND(v[1], v[3]); - VERT_COPY_IND(v[2], v[3]); + VERT_SAVE_RGBA(0); + VERT_SAVE_RGBA(1); + VERT_SAVE_RGBA(2); + VERT_COPY_RGBA(v[0], v[3]); + VERT_COPY_RGBA(v[1], v[3]); + VERT_COPY_RGBA(v[2], v[3]); + + if (HAVE_SPEC) { + VERT_SAVE_SPEC(0); + VERT_SAVE_SPEC(1); + VERT_SAVE_SPEC(2); + VERT_COPY_SPEC(v[0], v[3]); + VERT_COPY_SPEC(v[1], v[3]); + VERT_COPY_SPEC(v[2], v[3]); } } @@ -175,32 +147,19 @@ static void TAG(unfilled_quad)( GLcontext *ctx, } if (ctx->Light.ShadeModel == GL_FLAT && HAVE_HW_FLATSHADE) { - if (HAVE_RGBA) { - VERT_RESTORE_RGBA(0); - VERT_RESTORE_RGBA(1); - VERT_RESTORE_RGBA(2); - - if (HAVE_SPEC) { - VERT_RESTORE_SPEC(0); - VERT_RESTORE_SPEC(1); - VERT_RESTORE_SPEC(2); - } - } else { - VERT_RESTORE_IND(0); - VERT_RESTORE_IND(1); - VERT_RESTORE_IND(2); + VERT_RESTORE_RGBA(0); + VERT_RESTORE_RGBA(1); + VERT_RESTORE_RGBA(2); + + if (HAVE_SPEC) { + VERT_RESTORE_SPEC(0); + VERT_RESTORE_SPEC(1); + VERT_RESTORE_SPEC(2); } } } -#if HAVE_RGBA -#undef VERT_SET_IND -#undef VERT_COPY_IND -#undef VERT_SAVE_IND -#undef VERT_RESTORE_IND -#endif - #if !HAVE_SPEC #undef VERT_SET_SPEC #undef VERT_COPY_SPEC -- cgit v1.2.3 From 0384214923216b4bb7340070d08fcda2cbb79a93 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 26 Feb 2010 17:58:53 -0800 Subject: Remove stray defines of HAVE_RGBA Now that color-index support is removed from t_dd_tritmp.h and t_dd_unfilled.h, drivers no longer need define HAVE_RGBA. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/i810/i810tris.c | 1 - src/mesa/drivers/dri/i915/intel_tris.c | 1 - src/mesa/drivers/dri/mach64/mach64_tris.c | 1 - src/mesa/drivers/dri/mga/mgatris.c | 1 - src/mesa/drivers/dri/r128/r128_tris.c | 1 - src/mesa/drivers/dri/r200/r200_swtcl.c | 1 - src/mesa/drivers/dri/r300/r300_swtcl.c | 1 - src/mesa/drivers/dri/radeon/radeon_swtcl.c | 1 - src/mesa/drivers/dri/savage/savagetris.c | 1 - src/mesa/drivers/dri/sis/sis_tris.c | 1 - src/mesa/drivers/dri/tdfx/tdfx_tris.c | 1 - src/mesa/drivers/dri/unichrome/via_tris.c | 1 - 12 files changed, 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i810/i810tris.c b/src/mesa/drivers/dri/i810/i810tris.c index 213ba541ce..1492f711c9 100644 --- a/src/mesa/drivers/dri/i810/i810tris.c +++ b/src/mesa/drivers/dri/i810/i810tris.c @@ -218,7 +218,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index e63cd97db6..fb191fe346 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -603,7 +603,6 @@ static struct #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.c b/src/mesa/drivers/dri/mach64/mach64_tris.c index c2a0adfef0..a81d21afff 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tris.c +++ b/src/mesa/drivers/dri/mach64/mach64_tris.c @@ -1248,7 +1248,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/mga/mgatris.c b/src/mesa/drivers/dri/mga/mgatris.c index 4c58c3bdb0..07cf682f6e 100644 --- a/src/mesa/drivers/dri/mga/mgatris.c +++ b/src/mesa/drivers/dri/mga/mgatris.c @@ -347,7 +347,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_BACK_COLORS 0 #define HAVE_SPEC 1 #define HAVE_HW_FLATSHADE 0 diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index 86d4717b05..9ea2a9d162 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -158,7 +158,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index e220e40b01..262fe3cdde 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -420,7 +420,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 93983cee20..4dcc7cb022 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -364,7 +364,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index 5a71b510fa..f2fcb46688 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -524,7 +524,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c index a177a7d2b6..0050485e31 100644 --- a/src/mesa/drivers/dri/savage/savagetris.c +++ b/src/mesa/drivers/dri/savage/savagetris.c @@ -387,7 +387,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index e7471f9789..d109a8c41e 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -375,7 +375,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tris.c b/src/mesa/drivers/dri/tdfx/tdfx_tris.c index 8824988895..d65833c20b 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tris.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tris.c @@ -320,7 +320,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 0 #define HAVE_HW_FLATSHADE 0 #define HAVE_BACK_COLORS 0 diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c index 01359d51ea..be3c9a770f 100644 --- a/src/mesa/drivers/dri/unichrome/via_tris.c +++ b/src/mesa/drivers/dri/unichrome/via_tris.c @@ -257,7 +257,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 -- cgit v1.2.3 From 3594bf233d16ceb21e97fcdfb57ea45cb0c5e41b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 3 Mar 2010 16:12:22 -0500 Subject: radeon/r200/r300/r600: add check_blit vtbl function Check if the native blit formats are supported, if not, attempt to use an alternate format. Skip 3, >4 bpp as per comments from mcencora on irc. Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r200/r200_blit.c | 4 +- src/mesa/drivers/dri/r200/r200_blit.h | 2 + src/mesa/drivers/dri/r200/r200_context.c | 1 + src/mesa/drivers/dri/r300/r300_blit.c | 4 +- src/mesa/drivers/dri/r300/r300_blit.h | 4 +- src/mesa/drivers/dri/r300/r300_context.c | 3 +- src/mesa/drivers/dri/r600/r600_blit.c | 4 +- src/mesa/drivers/dri/r600/r600_blit.h | 33 ++++++++++++++++ src/mesa/drivers/dri/r600/r600_context.c | 1 + src/mesa/drivers/dri/radeon/radeon_blit.c | 4 +- src/mesa/drivers/dri/radeon/radeon_blit.h | 2 + .../drivers/dri/radeon/radeon_common_context.h | 1 + src/mesa/drivers/dri/radeon/radeon_context.c | 1 + src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 44 +++++++++++++++++++--- 14 files changed, 93 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c index 56b08a21bd..b56327dad5 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.c +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -38,7 +38,7 @@ static inline uint32_t cmdpacket0(struct radeon_screen *rscrn, } /* common formats supported as both textures and render targets */ -static unsigned is_blit_supported(gl_format mesa_format) +unsigned r200_check_blit(gl_format mesa_format) { /* XXX others? BE/LE? */ switch (mesa_format) { @@ -337,7 +337,7 @@ unsigned r200_blit(GLcontext *ctx, { struct r200_context *r200 = R200_CONTEXT(ctx); - if (!is_blit_supported(dst_mesaformat)) + if (!r200_check_blit(dst_mesaformat)) return GL_FALSE; /* Make sure that colorbuffer has even width - hw limitation */ diff --git a/src/mesa/drivers/dri/r200/r200_blit.h b/src/mesa/drivers/dri/r200/r200_blit.h index 38487266ae..53206f0b47 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.h +++ b/src/mesa/drivers/dri/r200/r200_blit.h @@ -30,6 +30,8 @@ void r200_blit_init(struct r200_context *r200); +unsigned r200_check_blit(gl_format mesa_format); + unsigned r200_blit(GLcontext *ctx, struct radeon_bo *src_bo, intptr_t src_offset, diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 6ecd46ecd9..dad2580e08 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -264,6 +264,7 @@ static void r200_init_vtbl(radeonContextPtr radeon) radeon->vtbl.fallback = r200Fallback; radeon->vtbl.update_scissor = r200_vtbl_update_scissor; radeon->vtbl.emit_query_finish = r200_emit_query_finish; + radeon->vtbl.check_blit = r200_check_blit; radeon->vtbl.blit = r200_blit; } diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 35fd06734f..9637a9b7ad 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -498,7 +498,7 @@ static void emit_cb_setup(struct r300_context *r300, END_BATCH(); } -static unsigned is_blit_supported(gl_format dst_format) +unsigned r300_check_blit(gl_format dst_format) { switch (dst_format) { case MESA_FORMAT_RGB565: @@ -566,7 +566,7 @@ unsigned r300_blit(GLcontext *ctx, { r300ContextPtr r300 = R300_CONTEXT(ctx); - if (!is_blit_supported(dst_mesaformat)) + if (!r300_check_blit(dst_mesaformat)) return 0; /* Make sure that colorbuffer has even width - hw limitation */ diff --git a/src/mesa/drivers/dri/r300/r300_blit.h b/src/mesa/drivers/dri/r300/r300_blit.h index 735acaddd7..39b157a57b 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.h +++ b/src/mesa/drivers/dri/r300/r300_blit.h @@ -30,6 +30,8 @@ void r300_blit_init(struct r300_context *r300); +unsigned r300_check_blit(gl_format mesa_format); + unsigned r300_blit(GLcontext *ctx, struct radeon_bo *src_bo, intptr_t src_offset, @@ -51,4 +53,4 @@ unsigned r300_blit(GLcontext *ctx, unsigned reg_height, unsigned flip_y); -#endif // R300_BLIT_H \ No newline at end of file +#endif // R300_BLIT_H diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index fe2ed22dc2..df4cc11da4 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -320,7 +320,8 @@ static void r300_init_vtbl(radeonContextPtr radeon) } else radeon->vtbl.emit_query_finish = r300_emit_query_finish; - radeon->vtbl.blit = r300_blit; + radeon->vtbl.check_blit = r300_check_blit; + radeon->vtbl.blit = r300_blit; } static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen) diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index 8eafd42e8f..9d17463cae 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -33,7 +33,7 @@ #include "r600_cmdbuf.h" /* common formats supported as both textures and render targets */ -static unsigned is_blit_supported(gl_format mesa_format) +unsigned r600_check_blit(gl_format mesa_format) { switch (mesa_format) { case MESA_FORMAT_RGBA8888: @@ -1582,7 +1582,7 @@ unsigned r600_blit(GLcontext *ctx, context_t *context = R700_CONTEXT(ctx); int id = 0; - if (!is_blit_supported(dst_mesaformat)) + if (!r600_check_blit(dst_mesaformat)) return GL_FALSE; if (src_bo == dst_bo) { diff --git a/src/mesa/drivers/dri/r600/r600_blit.h b/src/mesa/drivers/dri/r600/r600_blit.h index f280e23489..d56b21ba9b 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.h +++ b/src/mesa/drivers/dri/r600/r600_blit.h @@ -1,3 +1,35 @@ +/* + * Copyright (C) 2009 Advanced Micro Devices, Inc. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef R600_BLIT_H +#define R600_BLIT_H + +unsigned r600_check_blit(gl_format mesa_format); + unsigned r600_blit(GLcontext *ctx, struct radeon_bo *src_bo, intptr_t src_offset, @@ -19,3 +51,4 @@ unsigned r600_blit(GLcontext *ctx, unsigned h, unsigned flip_y); +#endif // R600_BLIT_H diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 1a4b014d9f..3d6802e735 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -236,6 +236,7 @@ static void r600_init_vtbl(radeonContextPtr radeon) radeon->vtbl.pre_emit_atoms = r600_vtbl_pre_emit_atoms; radeon->vtbl.fallback = r600_fallback; radeon->vtbl.emit_query_finish = r600_emit_query_finish; + radeon->vtbl.check_blit = r600_check_blit; radeon->vtbl.blit = r600_blit; } diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index 34b9af4063..e188a122d5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -38,7 +38,7 @@ static inline uint32_t cmdpacket0(struct radeon_screen *rscrn, } /* common formats supported as both textures and render targets */ -static unsigned is_blit_supported(gl_format mesa_format) +unsigned r100_check_blit(gl_format mesa_format) { /* XXX others? BE/LE? */ switch (mesa_format) { @@ -333,7 +333,7 @@ unsigned r100_blit(GLcontext *ctx, { struct r100_context *r100 = R100_CONTEXT(ctx); - if (!is_blit_supported(dst_mesaformat)) + if (!r100_check_blit(dst_mesaformat)) return GL_FALSE; /* Make sure that colorbuffer has even width - hw limitation */ diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.h b/src/mesa/drivers/dri/radeon/radeon_blit.h index d36366ff79..d7d0b5554a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.h +++ b/src/mesa/drivers/dri/radeon/radeon_blit.h @@ -30,6 +30,8 @@ void r100_blit_init(struct r100_context *r100); +unsigned r100_check_blit(gl_format mesa_format); + unsigned r100_blit(GLcontext *ctx, struct radeon_bo *src_bo, intptr_t src_offset, diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index e397ee8c22..d1a24e265f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -518,6 +518,7 @@ struct radeon_context { void (*free_context)(GLcontext *ctx); void (*emit_query_finish)(radeonContextPtr radeon); void (*update_scissor)(GLcontext *ctx); + unsigned (*check_blit)(gl_format mesa_format); unsigned (*blit)(GLcontext *ctx, struct radeon_bo *src_bo, intptr_t src_offset, diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 4625af14ad..878a453bd5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -198,6 +198,7 @@ static void r100_init_vtbl(radeonContextPtr radeon) radeon->vtbl.fallback = radeonFallback; radeon->vtbl.free_context = r100_vtbl_free_context; radeon->vtbl.emit_query_finish = r100_emit_query_finish; + radeon->vtbl.check_blit = r100_check_blit; radeon->vtbl.blit = r100_blit; } diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c index 18cf182e54..89fe9915a7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c @@ -46,6 +46,12 @@ do_copy_texsubimage(GLcontext *ctx, { radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_renderbuffer *rrb; + unsigned src_bpp; + unsigned dst_bpp; + gl_format src_mesaformat; + gl_format dst_mesaformat; + unsigned src_width; + unsigned dst_width; if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { rrb = radeon_get_depthbuffer(radeon); @@ -76,12 +82,40 @@ do_copy_texsubimage(GLcontext *ctx, } + src_mesaformat = rrb->base.Format; + dst_mesaformat = timg->base.TexFormat; + src_width = rrb->base.Width; + dst_width = timg->base.Width; + src_bpp = _mesa_get_format_bytes(src_mesaformat); + dst_bpp = _mesa_get_format_bytes(dst_mesaformat); + if (!radeon->vtbl.check_blit(dst_mesaformat)) { + if (src_bpp != dst_bpp) + return GL_FALSE; + + switch (dst_bpp) { + case 2: + src_mesaformat = MESA_FORMAT_RGB565; + dst_mesaformat = MESA_FORMAT_RGB565; + break; + case 4: + src_mesaformat = MESA_FORMAT_ARGB8888; + dst_mesaformat = MESA_FORMAT_ARGB8888; + break; + case 1: + src_mesaformat = MESA_FORMAT_A8; + dst_mesaformat = MESA_FORMAT_A8; + break; + default: + return GL_FALSE; + } + } + /* blit from src buffer to texture */ - return radeon->vtbl.blit(ctx, rrb->bo, src_offset, rrb->base.Format, rrb->pitch/rrb->cpp, - rrb->base.Width, rrb->base.Height, x, y, - timg->mt->bo, dst_offset, timg->base.TexFormat, - timg->mt->levels[level].rowstride / _mesa_get_format_bytes(timg->base.TexFormat), - timg->base.Width, timg->base.Height, + return radeon->vtbl.blit(ctx, rrb->bo, src_offset, src_mesaformat, rrb->pitch/rrb->cpp, + src_width, rrb->base.Height, x, y, + timg->mt->bo, dst_offset, dst_mesaformat, + timg->mt->levels[level].rowstride / dst_bpp, + dst_width, timg->base.Height, dstx, dsty, width, height, 1); } -- cgit v1.2.3 From 016fc30839f0fb67bb37d4a7353a7e38749deab5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 16:02:45 -0800 Subject: Remove support for GCC older than 3.3.0 Signed-off-by: Ian Romanick --- include/GL/gl.h | 3 +-- include/GL/glut.h | 2 +- src/egl/main/eglcompiler.h | 5 ++--- src/gallium/include/pipe/p_compiler.h | 7 +++---- src/glx/XF86dri.c | 2 +- src/glx/glxclient.h | 2 +- src/glx/indirect_vertex_program.c | 2 +- src/glx/pixelstore.c | 2 +- src/mesa/glapi/glapi.h | 2 +- src/mesa/main/compiler.h | 10 ++++------ src/mesa/main/imports.h | 4 +--- src/mesa/x86/assyntax.h | 2 +- 12 files changed, 18 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/include/GL/gl.h b/include/GL/gl.h index 3fce3dfc0a..8e5f1383ff 100644 --- a/include/GL/gl.h +++ b/include/GL/gl.h @@ -67,8 +67,7 @@ #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ # define GLAPI extern # define GLAPIENTRY __stdcall -#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +#elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define GLAPI __attribute__((visibility("default"))) # define GLAPIENTRY #endif /* WIN32 && !CYGWIN */ diff --git a/include/GL/glut.h b/include/GL/glut.h index d9fc938dc7..a282635205 100644 --- a/include/GL/glut.h +++ b/include/GL/glut.h @@ -103,7 +103,7 @@ extern "C" { # define GLUTAPI extern #endif -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#elif defined(__GNUC__) # define GLUTAPIENTRY # define GLUTAPIENTRYV diff --git a/src/egl/main/eglcompiler.h b/src/egl/main/eglcompiler.h index d844fbb0ef..401a9cf56a 100644 --- a/src/egl/main/eglcompiler.h +++ b/src/egl/main/eglcompiler.h @@ -64,8 +64,7 @@ /** * Function visibility */ -#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PUBLIC __attribute__((visibility("default"))) #else # define PUBLIC @@ -79,7 +78,7 @@ #ifndef __FUNCTION__ # if defined(__VMS) # define __FUNCTION__ "VMS$NL:" -# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ +# elif (!defined __GNUC__) && (!defined __xlC__) && \ (!defined(_MSC_VER) || _MSC_VER < 1300) # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ (defined(__SUNPRO_C) && defined(__C99FEATURES__)) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index c7d3507494..b93b38310a 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -106,8 +106,7 @@ typedef unsigned char boolean; /* Function visibility */ #ifndef PUBLIC -# if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PUBLIC __attribute__((visibility("default"))) # else # define PUBLIC @@ -119,7 +118,7 @@ typedef unsigned char boolean; * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. */ #ifndef __FUNCTION__ -# if (!defined(__GNUC__) || (__GNUC__ < 2)) +# if !defined(__GNUC__) # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ (defined(__SUNPRO_C) && defined(__C99FEATURES__)) # define __FUNCTION__ __func__ @@ -145,7 +144,7 @@ typedef unsigned char boolean; -#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#if defined(__GNUC__) #define PIPE_DEPRECATED __attribute__((__deprecated__)) #else #define PIPE_DEPRECATED diff --git a/src/glx/XF86dri.c b/src/glx/XF86dri.c index 248d96ac5d..fdbdd43000 100644 --- a/src/glx/XF86dri.c +++ b/src/glx/XF86dri.c @@ -45,7 +45,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86dristr.h" -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#if defined(__GNUC__) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 04ce781c43..8e5dc785dd 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -69,7 +69,7 @@ * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#if defined(__GNUC__) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else diff --git a/src/glx/indirect_vertex_program.c b/src/glx/indirect_vertex_program.c index 3313ac008a..d822a7ee56 100644 --- a/src/glx/indirect_vertex_program.c +++ b/src/glx/indirect_vertex_program.c @@ -30,7 +30,7 @@ #include "indirect_vertex_array.h" #include -#if !defined __GNUC__ || __GNUC__ < 3 +#if !defined(__GNUC__) # define __builtin_expect(x, y) x #endif diff --git a/src/glx/pixelstore.c b/src/glx/pixelstore.c index 8b51b5d8b7..dc193b9f74 100644 --- a/src/glx/pixelstore.c +++ b/src/glx/pixelstore.c @@ -31,7 +31,7 @@ #include "glxclient.h" #include "indirect.h" -#if !defined __GNUC__ || __GNUC__ < 3 +#if !defined(__GNUC__) # define __builtin_expect(x, y) x #endif diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 2eae6d5c43..1ca2e4beff 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -62,7 +62,7 @@ typedef void (*_glapi_proc)(void); /* generic function pointer */ #endif -#if defined(__GNUC__) && (__GNUC__ >= 3) +#if defined(__GNUC__) # define likely(x) __builtin_expect(!!(x), 1) # define unlikely(x) __builtin_expect(!!(x), 0) #else diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9cef99f67a..05e69e56a6 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -173,8 +173,7 @@ extern "C" { * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ -#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \ - || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else @@ -197,7 +196,7 @@ extern "C" { /** * __builtin_expect macros */ -#if (!defined(__GNUC__) || __GNUC__ < 3) && (!defined(__IBMC__) || __IBMC__ < 900) +#if !defined(__GNUC__) # define __builtin_expect(x, y) x #endif @@ -210,7 +209,7 @@ extern "C" { #ifndef __FUNCTION__ # if defined(__VMS) # define __FUNCTION__ "VMS$NL:" -# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \ +# elif !defined(__GNUC__) && !defined(__xlC__) && \ (!defined(_MSC_VER) || _MSC_VER < 1300) # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ (defined(__SUNPRO_C) && defined(__C99FEATURES__)) @@ -322,8 +321,7 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) * LONGSTRING macro * gcc -pedantic warns about long string literals, LONGSTRING silences that. */ -#if !defined(__GNUC__) || (__GNUC__ < 2) || \ - ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)) +#if !defined(__GNUC__) # define LONGSTRING #else # define LONGSTRING __extension__ diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index ac3a7b5d61..fb4a00eca7 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -240,9 +240,7 @@ static INLINE int GET_FLOAT_BITS( float x ) /*** *** IROUND: return (as an integer) float rounded to nearest integer ***/ -#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) && \ - (!(defined(__BEOS__) || defined(__HAIKU__)) || \ - (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))) +#if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) static INLINE int iround(float f) { int r; diff --git a/src/mesa/x86/assyntax.h b/src/mesa/x86/assyntax.h index de1f6a48de..4a41812f6b 100644 --- a/src/mesa/x86/assyntax.h +++ b/src/mesa/x86/assyntax.h @@ -1737,7 +1737,7 @@ SECTION _DATA public align=16 class=DATA use32 flat */ #if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) # define HIDDEN(x) .hidden x -#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) +#elif defined(__GNUC__) && !defined(__DJGPP__) && !defined(__MINGW32__) && !defined(__APPLE__) # pragma GCC visibility push(default) # define HIDDEN(x) .hidden x #else -- cgit v1.2.3 From 6e8e4b918d1dac8a0c20e7a5d6f4665a1eaf174f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 16:03:24 -0800 Subject: Remove support for GCC older than 3.3.0 from generator scripts Signed-off-by: Ian Romanick --- src/mesa/glapi/gen/glX_proto_send.py | 2 +- src/mesa/glapi/gen/gl_XML.py | 4 ++-- src/mesa/glapi/gen/gl_x86-64_asm.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/gen/glX_proto_send.py b/src/mesa/glapi/gen/glX_proto_send.py index 4d484c833a..c52b85bfb4 100644 --- a/src/mesa/glapi/gen/glX_proto_send.py +++ b/src/mesa/glapi/gen/glX_proto_send.py @@ -182,7 +182,7 @@ class PrintGlxProtoStubs(glX_proto_common.glx_print_proto): self.printFastcall() self.printNoinline() print '' - print '#if !defined __GNUC__ || __GNUC__ < 3' + print '#ifndef __GNUC__' print '# define __builtin_expect(x, y) x' print '#endif' print '' diff --git a/src/mesa/glapi/gen/gl_XML.py b/src/mesa/glapi/gen/gl_XML.py index a10a35e513..b769ee2bb5 100644 --- a/src/mesa/glapi/gen/gl_XML.py +++ b/src/mesa/glapi/gen/gl_XML.py @@ -184,7 +184,7 @@ class gl_print_base: The name is also added to the file's undef_list. """ self.undef_list.append("PURE") - print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) + print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE @@ -224,7 +224,7 @@ class gl_print_base: """ self.undef_list.append(S) - print """# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) + print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define %s __attribute__((visibility("%s"))) # else # define %s diff --git a/src/mesa/glapi/gen/gl_x86-64_asm.py b/src/mesa/glapi/gen/gl_x86-64_asm.py index 8ac57ab7eb..e6e78c42f3 100644 --- a/src/mesa/glapi/gen/gl_x86-64_asm.py +++ b/src/mesa/glapi/gen/gl_x86-64_asm.py @@ -124,7 +124,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '' print '#include "x86/assyntax.h"' print '' - print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303' + print '#ifdef __GNUC__' print '# pragma GCC visibility push(default)' print '# define HIDDEN(x) .hidden x' print '#else' -- cgit v1.2.3 From f7dde2c131d8ec04c00f0dd3d7747019ff72a237 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 16:15:42 -0800 Subject: Remove support for GCC older than 3.3.0 from generated sources Signed-off-by: Ian Romanick --- src/glx/indirect.c | 2 +- src/glx/indirect.h | 2 +- src/glx/indirect_size.c | 4 ++-- src/glx/indirect_size.h | 4 ++-- src/mesa/glapi/glapitemp.h | 2 +- src/mesa/x86-64/glapi_x86-64.S | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/glx/indirect.c b/src/glx/indirect.c index 4a571a230b..42a225f671 100644 --- a/src/glx/indirect.c +++ b/src/glx/indirect.c @@ -53,7 +53,7 @@ # define NOINLINE # endif -#if !defined __GNUC__ || __GNUC__ < 3 +#ifndef __GNUC__ # define __builtin_expect(x, y) x #endif diff --git a/src/glx/indirect.h b/src/glx/indirect.h index 9e73b33818..7064bfe279 100644 --- a/src/glx/indirect.h +++ b/src/glx/indirect.h @@ -37,7 +37,7 @@ * \author Ian Romanick */ -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN diff --git a/src/glx/indirect_size.c b/src/glx/indirect_size.c index 6356ddd49b..5a8f27ba92 100644 --- a/src/glx/indirect_size.c +++ b/src/glx/indirect_size.c @@ -29,7 +29,7 @@ #include #include "indirect_size.h" -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE @@ -41,7 +41,7 @@ # define FASTCALL # endif -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL diff --git a/src/glx/indirect_size.h b/src/glx/indirect_size.h index af0919f964..43f504a319 100644 --- a/src/glx/indirect_size.h +++ b/src/glx/indirect_size.h @@ -36,7 +36,7 @@ * \author Ian Romanick */ -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE @@ -48,7 +48,7 @@ # define FASTCALL # endif -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 2ef4728e09..f9b803e2ab 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -27,7 +27,7 @@ */ -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index bd5a657e19..03a2c999ff 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -31,7 +31,7 @@ #include "x86/assyntax.h" -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 +#ifdef __GNUC__ # pragma GCC visibility push(default) # define HIDDEN(x) .hidden x #else -- cgit v1.2.3 From 6d9a9e57dc312a2f9f09a6b826a2de93fab5ae26 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 17:50:11 -0800 Subject: Fix unmatched parenthesis introduce by previous commits I wasn't careful enough when removing support for GCC versions earlier than 3.3.0. I could have sworn that I compile tested before pushing, but apparently not. FAIL. Signed-off-by: Ian Romanick --- src/glx/indirect.h | 2 +- src/glx/indirect_size.c | 2 +- src/glx/indirect_size.h | 2 +- src/mesa/glapi/gen/gl_XML.py | 2 +- src/mesa/glapi/glapitemp.h | 2 +- src/mesa/main/compiler.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/glx/indirect.h b/src/glx/indirect.h index 7064bfe279..b09b61aae7 100644 --- a/src/glx/indirect.h +++ b/src/glx/indirect.h @@ -37,7 +37,7 @@ * \author Ian Romanick */ -# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN diff --git a/src/glx/indirect_size.c b/src/glx/indirect_size.c index 5a8f27ba92..0c136d26cd 100644 --- a/src/glx/indirect_size.c +++ b/src/glx/indirect_size.c @@ -41,7 +41,7 @@ # define FASTCALL # endif -# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL diff --git a/src/glx/indirect_size.h b/src/glx/indirect_size.h index 43f504a319..79b849b683 100644 --- a/src/glx/indirect_size.h +++ b/src/glx/indirect_size.h @@ -48,7 +48,7 @@ # define FASTCALL # endif -# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL diff --git a/src/mesa/glapi/gen/gl_XML.py b/src/mesa/glapi/gen/gl_XML.py index b769ee2bb5..660c8cfb71 100644 --- a/src/mesa/glapi/gen/gl_XML.py +++ b/src/mesa/glapi/gen/gl_XML.py @@ -224,7 +224,7 @@ class gl_print_base: """ self.undef_list.append(S) - print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) + print """# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__) # define %s __attribute__((visibility("%s"))) # else # define %s diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index f9b803e2ab..67c691c3fb 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -27,7 +27,7 @@ */ -# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) +# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 05e69e56a6..81704ae2c1 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -173,7 +173,7 @@ extern "C" { * We also need to define a USED attribute, so the optimizer doesn't * inline a static function that we later use in an alias. - ajax */ -#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) +#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PUBLIC __attribute__((visibility("default"))) # define USED __attribute__((used)) #else -- cgit v1.2.3 From f4113012e0b0defa0ddb8ff3b7f6a518df9ac1e0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 3 Mar 2010 18:20:01 -0800 Subject: wgl: Fix mingw32 build. This was missed in commit fcf438e9e03f6e75bca4a49ad372fe7c4b1abbf8. --- src/gallium/state_trackers/wgl/stw_pixelformat.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/stw_pixelformat.c b/src/gallium/state_trackers/wgl/stw_pixelformat.c index f8edc560c5..bc28f31ed1 100644 --- a/src/gallium/state_trackers/wgl/stw_pixelformat.c +++ b/src/gallium/state_trackers/wgl/stw_pixelformat.c @@ -271,14 +271,12 @@ stw_pixelformat_visual(GLvisual *visual, memset(visual, 0, sizeof *visual); _mesa_initialize_visual( visual, - (pfi->pfd.iPixelType == PFD_TYPE_RGBA) ? GL_TRUE : GL_FALSE, (pfi->pfd.dwFlags & PFD_DOUBLEBUFFER) ? GL_TRUE : GL_FALSE, (pfi->pfd.dwFlags & PFD_STEREO) ? GL_TRUE : GL_FALSE, pfi->pfd.cRedBits, pfi->pfd.cGreenBits, pfi->pfd.cBlueBits, pfi->pfd.cAlphaBits, - (pfi->pfd.iPixelType == PFD_TYPE_COLORINDEX) ? pfi->pfd.cColorBits : 0, pfi->pfd.cDepthBits, pfi->pfd.cStencilBits, pfi->pfd.cAccumRedBits, -- cgit v1.2.3 From c27fed58e4979ec950fa4af56eb8b94b21705ac8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 4 Mar 2010 15:08:26 +1000 Subject: r300_blit: initialise whole fp structure to 0 at least on the r500 we get a lockup unless I do this, the compiler seems to fail to compile and we just get a null fp. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r300/r300_blit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 9637a9b7ad..f3e4346e02 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -97,6 +97,7 @@ static void create_fragment_program(struct r300_context *r300) struct r300_fragment_program_compiler compiler; struct rc_instruction *inst; + memset(&compiler, 0, sizeof(struct r300_fragment_program_compiler)); rc_init(&compiler.Base); inst = rc_insert_new_instruction(&compiler.Base, compiler.Base.Program.Instructions.Prev); -- cgit v1.2.3 From 25e439e69f3f5e77062321f6e496391c090e889f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 4 Mar 2010 15:49:57 +1000 Subject: r300: make blit code work on swtcl machines. Only tested this on my rv530 with R300_NO_TCL=1, but it works there at least. It would be nice to fix the tex_offset by chaning the vertex program on tcl to read from offset 6 but this isn't really necessary. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r300/r300_blit.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index f3e4346e02..2bc761bc20 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -126,7 +126,8 @@ static void create_fragment_program(struct r300_context *r300) void r300_blit_init(struct r300_context *r300) { - create_vertex_program(r300); + if (r300->options.hw_tcl_enabled) + create_vertex_program(r300); create_fragment_program(r300); } @@ -341,8 +342,14 @@ static void emit_pvs_setup(struct r300_context *r300, static void emit_vap_setup(struct r300_context *r300) { + int tex_offset; BATCH_LOCALS(&r300->radeon); + if (r300->options.hw_tcl_enabled) + tex_offset = 1; + else + tex_offset = 6; + BEGIN_BATCH(12); OUT_BATCH_REGSEQ(R300_SE_VTE_CNTL, 2); OUT_BATCH(R300_VTX_XY_FMT | R300_VTX_Z_FMT); @@ -351,7 +358,7 @@ static void emit_vap_setup(struct r300_context *r300) OUT_BATCH_REGVAL(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_0, ((R300_DATA_TYPE_FLOAT_2 | (0 << R300_DST_VEC_LOC_SHIFT)) << 0) | - (((1 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_2 | R300_LAST_VEC) << 16)); + (((tex_offset << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_2 | R300_LAST_VEC) << 16)); OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_EXT_0, ((((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | @@ -450,7 +457,7 @@ static void other_stuff(struct r300_context *r300) { BATCH_LOCALS(&r300->radeon); - BEGIN_BATCH(15); + BEGIN_BATCH(13); OUT_BATCH_REGVAL(R300_GA_POLY_MODE, R300_GA_POLY_MODE_FRONT_PTYPE_TRI | R300_GA_POLY_MODE_BACK_PTYPE_TRI); OUT_BATCH_REGVAL(R300_SU_CULL_MODE, R300_FRONT_FACE_CCW); @@ -459,9 +466,13 @@ static void other_stuff(struct r300_context *r300) OUT_BATCH_REGSEQ(R300_RB3D_CBLEND, 2); OUT_BATCH(0x0); OUT_BATCH(0x0); - OUT_BATCH_REGVAL(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE); OUT_BATCH_REGVAL(R300_ZB_CNTL, 0); END_BATCH(); + if (r300->options.hw_tcl_enabled) { + BEGIN_BATCH(2); + OUT_BATCH_REGVAL(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE); + END_BATCH(); + } } static void emit_cb_setup(struct r300_context *r300, @@ -634,7 +645,9 @@ unsigned r300_blit(GLcontext *ctx, r300_emit_rs_setup(r300); } - emit_pvs_setup(r300, r300->blit.vp_code.body.d, 2); + if (r300->options.hw_tcl_enabled) + emit_pvs_setup(r300, r300->blit.vp_code.body.d, 2); + emit_vap_setup(r300); emit_cb_setup(r300, dst_bo, dst_offset, dst_mesaformat, dst_pitch, dst_width, dst_height); -- cgit v1.2.3 From df62b0da92f50b309d79d6552ecdf5a59910c80a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 00:41:21 -0800 Subject: mesa: Add asserts to check inputs to memcpy. --- src/mesa/main/mipmap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index e2efe81a8f..51f7edfab1 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1325,6 +1325,8 @@ make_2d_stack_mipmap(GLenum datatype, GLuint comps, GLint border, if (border > 0) { /* fill in dest border */ /* lower-left border pixel */ + assert(dstPtr); + assert(srcPtr); memcpy(dstPtr, srcPtr, bpt); /* lower-right border pixel */ memcpy(dstPtr + (dstWidth - 1) * bpt, -- cgit v1.2.3 From df20c3943ab4e20055f8e731f112aa9fd8d66068 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 00:53:52 -0800 Subject: glsl: Add assert to check input to strcmp. --- src/mesa/shader/slang/slang_builtin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index f0659a8d8b..791e751526 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -182,6 +182,7 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field, tokens[1] = 0; else tokens[1] = 1; + assert(field); if (strcmp(field, "emission") == 0) { tokens[2] = STATE_EMISSION; } -- cgit v1.2.3 From 3c90777fd7cce57486dc7d98e676ffe9dede55ae Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 00:58:36 -0800 Subject: glsl: Return NULL on _slan_gen_asm error path on non-debug builds. Exit the function early on the error path, instead of continuing, to prevent a null pointer dereference later on. --- src/mesa/shader/slang/slang_codegen.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 6d1cea28a7..809355c56c 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1894,6 +1894,7 @@ _slang_gen_asm(slang_assemble_ctx *A, slang_operation *oper, _mesa_problem(NULL, "undefined __asm function %s\n", (char *) oper->a_id); assert(info); + return NULL; } assert(info->NumParams <= 3); -- cgit v1.2.3 From 0dd40cc20af78146c1d1d3ad1df0652b7cedc078 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 01:10:44 -0800 Subject: glsl: Remove unsigned greater than or equal zero comparison. --- src/mesa/shader/slang/slang_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 809355c56c..96acad1f73 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1754,7 +1754,7 @@ swizzle_to_writemask(slang_assemble_ctx *A, GLuint swizzle, /* end */ break; } - assert(swz >= 0 && swz <= 3); + assert(swz <= 3); if (swizzle != SWIZZLE_XXXX && swizzle != SWIZZLE_YYYY && -- cgit v1.2.3 From f9504e75f02586a8561733e0e2711c65efa2979d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 01:24:44 -0800 Subject: mesa: Fix unsigned comparison. --- src/mesa/main/api_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 326ad6f909..80bc826d21 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -147,7 +147,7 @@ check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); - if (min + basevertex < 0 || + if (min < basevertex || max + basevertex > ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDrawElements() index=%u is " -- cgit v1.2.3 From ac610ab830287029b2636522625f56ed09c3870b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 01:35:28 -0800 Subject: glsl: Remove unsigned greater than or equal zero comparison. --- src/mesa/shader/slang/slang_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 96acad1f73..ecb2f6d5c1 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -4208,7 +4208,7 @@ swizzle_size(GLuint swizzle) GLuint size = 0, i; for (i = 0; i < 4; i++) { GLuint swz = GET_SWZ(swizzle, i); - size += (swz >= 0 && swz <= 3); + size += (swz <= 3); } return size; } -- cgit v1.2.3 From 34b2cec95c9e7781f4d32deed9980f05ee553d1d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 01:51:50 -0800 Subject: Revert "mesa: Fix unsigned comparison." This reverts commit f9504e75f02586a8561733e0e2711c65efa2979d. This patch is incorrect. --- src/mesa/main/api_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 80bc826d21..326ad6f909 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -147,7 +147,7 @@ check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); - if (min < basevertex || + if (min + basevertex < 0 || max + basevertex > ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDrawElements() index=%u is " -- cgit v1.2.3 From c7f7a309af54c76eccb451aa0c4f007656ebe7e1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 4 Mar 2010 01:56:20 -0800 Subject: DRI: Put back missing break-statement The break in the __DRI_ATTRIB_RENDER_TYPE case was accidentally removed in commit 5cf2c5851bcd29c2d53bb04ab692b4b156f5a74d. This puts it back. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/common/utils.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 9a21f2c9f2..b85b364c57 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -726,6 +726,7 @@ driGetConfigAttribIndex(const __DRIconfig *config, switch (attribMap[index].attrib) { case __DRI_ATTRIB_RENDER_TYPE: *value = __DRI_ATTRIB_RGBA_BIT; + break; case __DRI_ATTRIB_CONFIG_CAVEAT: if (config->modes.visualRating == GLX_NON_CONFORMANT_CONFIG) *value = __DRI_ATTRIB_NON_CONFORMANT_CONFIG; -- cgit v1.2.3 From 4b61fd22a87342bafc3da2264b68537c6eb80375 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 4 Mar 2010 13:22:21 +0000 Subject: r300g: remove dead r300_get_texture_buffer function --- src/gallium/drivers/r300/r300_context.c | 16 ++++++++++------ src/gallium/drivers/r300/r300_texture.c | 18 ------------------ src/gallium/drivers/r300/r300_texture.h | 6 ++---- src/gallium/drivers/r300/r300_winsys.h | 5 ----- 4 files changed, 12 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 86b98a4ba5..6308d3a087 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -72,11 +72,8 @@ r300_is_texture_referenced(struct pipe_context *pipe, struct pipe_texture *texture, unsigned face, unsigned level) { - struct pipe_buffer* buf = 0; - - r300_get_texture_buffer(pipe->screen, texture, &buf, NULL); - - return pipe->is_buffer_referenced(pipe, buf); + return pipe->is_buffer_referenced(pipe, + ((struct r300_texture *)texture)->buffer); } static unsigned int @@ -86,7 +83,14 @@ r300_is_buffer_referenced(struct pipe_context *pipe, /* This only checks to see whether actual hardware buffers are * referenced. Since we use managed BOs and transfers, it's actually not * possible for pipe_buffers to ever reference the actual hardware, so - * buffers are never referenced. */ + * buffers are never referenced. + */ + + /* XXX: that doesn't make sense given that + * r300_is_texture_referenced is implemented on top of this + * function and hardware can certainly refer to textures + * directly... + */ return 0; } diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 3b39207a45..93224e8d20 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -974,21 +974,3 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen) screen->video_surface_destroy= r300_video_surface_destroy; } -boolean r300_get_texture_buffer(struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride) -{ - struct r300_texture* tex = (struct r300_texture*)texture; - if (!tex) { - return FALSE; - } - - pipe_buffer_reference(buffer, tex->buffer); - - if (stride) { - *stride = r300_texture_get_stride(r300_screen(screen), tex, 0); - } - - return TRUE; -} diff --git a/src/gallium/drivers/r300/r300_texture.h b/src/gallium/drivers/r300/r300_texture.h index 46a5fb6188..138b62784e 100644 --- a/src/gallium/drivers/r300/r300_texture.h +++ b/src/gallium/drivers/r300/r300_texture.h @@ -60,13 +60,11 @@ r300_video_surface(struct pipe_video_surface *pvs) return (struct r300_video_surface *)pvs; } -#ifndef R300_WINSYS_H - +/* Used internally for texture_is_referenced() + */ boolean r300_get_texture_buffer(struct pipe_screen* screen, struct pipe_texture* texture, struct pipe_buffer** buffer, unsigned* stride); -#endif /* R300_WINSYS_H */ - #endif /* R300_TEXTURE_H */ diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index 40fb8a95ca..ddf2b79003 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -40,11 +40,6 @@ struct radeon_winsys; struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys); -boolean r300_get_texture_buffer(struct pipe_screen* screen, - struct pipe_texture* texture, - struct pipe_buffer** buffer, - unsigned* stride); - #ifdef __cplusplus } #endif -- cgit v1.2.3 From 86e146df977d8df97026291c46aa4adfc13309e1 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 4 Mar 2010 13:22:37 +0000 Subject: softpipe: remove dead get_texture_buffer function --- src/gallium/drivers/softpipe/sp_texture.c | 20 -------------------- src/gallium/drivers/softpipe/sp_winsys.h | 6 ------ 2 files changed, 26 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index d3997854b2..44710d9992 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -475,24 +475,4 @@ softpipe_init_screen_texture_funcs(struct pipe_screen *screen) } -/** - * Return pipe_buffer handle and stride for given texture object. - * XXX used for??? - */ -boolean -softpipe_get_texture_buffer( struct pipe_texture *texture, - struct pipe_buffer **buf, - unsigned *stride ) -{ - struct softpipe_texture *tex = (struct softpipe_texture *) texture; - - if (!tex) - return FALSE; - pipe_buffer_reference(buf, tex->buffer); - - if (stride) - *stride = tex->stride[0]; - - return TRUE; -} diff --git a/src/gallium/drivers/softpipe/sp_winsys.h b/src/gallium/drivers/softpipe/sp_winsys.h index 6e3920c49b..edc49f256d 100644 --- a/src/gallium/drivers/softpipe/sp_winsys.h +++ b/src/gallium/drivers/softpipe/sp_winsys.h @@ -60,12 +60,6 @@ struct pipe_screen *softpipe_create_screen( struct pipe_winsys * ); */ struct pipe_screen *softpipe_create_screen_malloc(void); -boolean -softpipe_get_texture_buffer( struct pipe_texture *texture, - struct pipe_buffer **buf, - unsigned *stride ); - - #ifdef __cplusplus } #endif -- cgit v1.2.3 From 3bd622d64ec3826d3563a5cd9790cd7accc123b4 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 4 Mar 2010 14:36:51 +0000 Subject: nouveau: Conversion to winsys handle Not the best conversion that could be done. --- src/gallium/drivers/nouveau/nouveau_screen.c | 72 ++++++++++++++++++++++ .../winsys/drm/nouveau/drm/nouveau_drm_api.c | 72 ++-------------------- 2 files changed, 78 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index 3c2f771b51..2013eef0c5 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -4,6 +4,7 @@ #include "util/u_memory.h" #include "util/u_inlines.h" +#include "util/u_format.h" #include #include @@ -12,6 +13,9 @@ #include "nouveau_winsys.h" #include "nouveau_screen.h" +/* XXX this should go away */ +#include "state_tracker/drm_api.h" + static const char * nouveau_screen_get_name(struct pipe_screen *pscreen) { @@ -231,6 +235,71 @@ nouveau_screen_fence_finish(struct pipe_screen *screen, return 0; } + +/* + * Both texture_{from|get}_handle use drm api defines directly which they + * shouldn't do. The problem is that from|get are pipe functions and as + * such they should be defined in the pipe level. If nouveau had a propper + * winsys interface we would have added from|get to that interface using + * the winsys_handle struct as done with other drivers. However this code + * calls directly into the libdrm_nouveau.so functions (nouveau_bo_*). So + * we need to translate the handle into something they understand. + */ +static struct pipe_texture * +nouveau_screen_texture_from_handle(struct pipe_screen *pscreen, + const struct pipe_texture *templ, + struct winsys_handle *whandle) +{ + struct nouveau_device *dev = nouveau_screen(pscreen)->device; + struct pipe_texture *pt; + struct pipe_buffer *pb; + int ret; + + pb = CALLOC(1, sizeof(struct pipe_buffer) + sizeof(struct nouveau_bo*)); + if (!pb) + return NULL; + + ret = nouveau_bo_handle_ref(dev, whandle->handle, (struct nouveau_bo**)(pb+1)); + if (ret) { + debug_printf("%s: ref name 0x%08x failed with %d\n", + __func__, whandle->handle, ret); + FREE(pb); + return NULL; + } + + pipe_reference_init(&pb->reference, 1); + pb->screen = pscreen; + pb->alignment = 0; + pb->usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE | + PIPE_BUFFER_USAGE_CPU_READ_WRITE; + pb->size = nouveau_bo(pb)->size; + pt = pscreen->texture_blanket(pscreen, templ, &whandle->stride, pb); + pipe_buffer_reference(&pb, NULL); + return pt; +} + +static boolean +nouveau_screen_texture_get_handle(struct pipe_screen *pscreen, + struct pipe_texture *pt, + struct winsys_handle *whandle) +{ + struct nouveau_miptree *mt = nouveau_miptree(pt); + + if (!mt || !mt->bo) + return false; + + whandle->stride = util_format_get_stride(mt->base.format, mt->base.width0); + + if (whandle->type == DRM_API_HANDLE_TYPE_SHARED) { + return nouveau_bo_handle_get(mt->bo, &whandle->handle) == 0; + } else if (whandle->type == DRM_API_HANDLE_TYPE_KMS) { + whandle->handle = mt->bo->handle; + return TRUE; + } else { + return FALSE; + } +} + int nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev) { @@ -258,6 +327,9 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev) pscreen->fence_signalled = nouveau_screen_fence_signalled; pscreen->fence_finish = nouveau_screen_fence_finish; + pscreen->texture_from_handle = nouveau_screen_texture_from_handle; + pscreen->texture_get_handle = nouveau_screen_texture_get_handle; + return 0; } diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c index 80b5a4c091..af9e92edd9 100644 --- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c +++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c @@ -21,6 +21,7 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen, struct pipe_surface *ps = NULL; struct pipe_texture *pt = NULL; struct pipe_texture tmpl; + struct winsys_handle whandle; memset(&tmpl, 0, sizeof(tmpl)); tmpl.tex_usage = PIPE_TEXTURE_USAGE_SCANOUT; @@ -31,8 +32,11 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen, tmpl.width0 = width; tmpl.height0 = height; - pt = api->texture_from_shared_handle(api, pscreen, &tmpl, - "front buffer", pitch, handle); + memset(&whandle, 0, sizeof(whandle)); + whandle.stride = pitch; + whandle.handle = handle; + + pt = pscreen->texture_from_handle(pscreen, &tmpl, &whandle); if (!pt) return NULL; @@ -142,74 +146,10 @@ nouveau_drm_create_screen(struct drm_api *api, int fd, return nvws->pscreen; } -static struct pipe_texture * -nouveau_drm_pt_from_name(struct drm_api *api, struct pipe_screen *pscreen, - struct pipe_texture *templ, const char *name, - unsigned stride, unsigned handle) -{ - struct nouveau_device *dev = nouveau_screen(pscreen)->device; - struct pipe_texture *pt; - struct pipe_buffer *pb; - int ret; - - pb = CALLOC(1, sizeof(struct pipe_buffer) + sizeof(struct nouveau_bo*)); - if (!pb) - return NULL; - - ret = nouveau_bo_handle_ref(dev, handle, (struct nouveau_bo**)(pb+1)); - if (ret) { - debug_printf("%s: ref name 0x%08x failed with %d\n", - __func__, handle, ret); - FREE(pb); - return NULL; - } - - pipe_reference_init(&pb->reference, 1); - pb->screen = pscreen; - pb->alignment = 0; - pb->usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE | - PIPE_BUFFER_USAGE_CPU_READ_WRITE; - pb->size = nouveau_bo(pb)->size; - pt = pscreen->texture_blanket(pscreen, templ, &stride, pb); - pipe_buffer_reference(&pb, NULL); - return pt; -} - -static boolean -nouveau_drm_name_from_pt(struct drm_api *api, struct pipe_screen *pscreen, - struct pipe_texture *pt, unsigned *stride, - unsigned *handle) -{ - struct nouveau_miptree *mt = nouveau_miptree(pt); - - if (!mt || !mt->bo) - return false; - - return nouveau_bo_handle_get(mt->bo, handle) == 0; -} - -static boolean -nouveau_drm_handle_from_pt(struct drm_api *api, struct pipe_screen *pscreen, - struct pipe_texture *pt, unsigned *stride, - unsigned *handle) -{ - struct nouveau_miptree *mt = nouveau_miptree(pt); - - if (!mt || !mt->bo) - return false; - - *handle = mt->bo->handle; - *stride = util_format_get_stride(mt->base.format, mt->base.width0); - return true; -} - struct drm_api drm_api_hooks = { .name = "nouveau", .driver_name = "nouveau", .create_screen = nouveau_drm_create_screen, - .texture_from_shared_handle = nouveau_drm_pt_from_name, - .shared_handle_from_texture = nouveau_drm_name_from_pt, - .local_handle_from_texture = nouveau_drm_handle_from_pt, }; struct drm_api * -- cgit v1.2.3 From caa8a365c512d477b9698e79f55da9c041eb1bef Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 4 Mar 2010 14:57:44 +0000 Subject: svga: Forgot one bit in rebase --- src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c index 0e3dad84a5..657544dcb2 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_screen_dri.c @@ -365,9 +365,6 @@ static struct drm_api vmw_drm_api_hooks = { .name = "vmwgfx", .driver_name = "vmwgfx", .create_screen = vmw_drm_create_screen, - .texture_from_shared_handle = vmw_drm_texture_from_handle, - .shared_handle_from_texture = vmw_drm_handle_from_texture, - .local_handle_from_texture = vmw_drm_handle_from_texture, }; struct drm_api* drm_api_create() -- cgit v1.2.3 From 94ce4eb3c27706d992226d847d123c46b14b1c4f Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 4 Mar 2010 16:09:33 +0000 Subject: softpipe: rework to use the llvmpipe winsys Promote the llvmpipe winsys more or less unchanged to state_trackers/sw_winsys.h. Some minor breakages: - softpipe::texture_blanket is broken, but scheduled for removal anyway. - haven't fixed up g3vdl yet. --- src/gallium/drivers/llvmpipe/lp_screen.c | 8 +- src/gallium/drivers/llvmpipe/lp_screen.h | 4 +- src/gallium/drivers/llvmpipe/lp_setup.c | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 8 +- src/gallium/drivers/llvmpipe/lp_texture.h | 5 +- src/gallium/drivers/llvmpipe/lp_winsys.h | 125 ------- src/gallium/drivers/softpipe/Makefile | 4 +- src/gallium/drivers/softpipe/SConscript | 4 +- src/gallium/drivers/softpipe/sp_buffer.c | 118 +++++++ src/gallium/drivers/softpipe/sp_buffer.h | 55 +++ src/gallium/drivers/softpipe/sp_context.c | 2 +- src/gallium/drivers/softpipe/sp_draw_arrays.c | 96 +----- src/gallium/drivers/softpipe/sp_screen.c | 43 ++- src/gallium/drivers/softpipe/sp_screen.h | 12 + src/gallium/drivers/softpipe/sp_state_fs.c | 20 +- src/gallium/drivers/softpipe/sp_texture.c | 115 +++---- src/gallium/drivers/softpipe/sp_texture.h | 11 +- src/gallium/drivers/softpipe/sp_winsys.c | 245 -------------- src/gallium/drivers/softpipe/sp_winsys.h | 73 ---- src/gallium/include/state_tracker/sw_winsys.h | 121 +++++++ src/gallium/winsys/gdi/SConscript | 2 +- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 157 +-------- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 239 ++----------- src/gallium/winsys/xlib/Makefile | 1 + src/gallium/winsys/xlib/SConscript | 4 +- src/gallium/winsys/xlib/xlib.c | 4 +- src/gallium/winsys/xlib/xlib.h | 7 + src/gallium/winsys/xlib/xlib_llvmpipe.c | 363 +------------------- src/gallium/winsys/xlib/xlib_softpipe.c | 464 +------------------------- src/gallium/winsys/xlib/xlib_sw_winsys.c | 394 ++++++++++++++++++++++ 30 files changed, 897 insertions(+), 1809 deletions(-) delete mode 100644 src/gallium/drivers/llvmpipe/lp_winsys.h create mode 100644 src/gallium/drivers/softpipe/sp_buffer.c create mode 100644 src/gallium/drivers/softpipe/sp_buffer.h delete mode 100644 src/gallium/drivers/softpipe/sp_winsys.c delete mode 100644 src/gallium/drivers/softpipe/sp_winsys.h create mode 100644 src/gallium/include/state_tracker/sw_winsys.h create mode 100644 src/gallium/winsys/xlib/xlib_sw_winsys.c (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index f84ede675b..8816440a50 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -167,7 +167,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, unsigned geom_flags ) { struct llvmpipe_screen *screen = llvmpipe_screen(_screen); - struct llvmpipe_winsys *winsys = screen->winsys; + struct sw_winsys *winsys = screen->winsys; const struct util_format_description *format_desc; format_desc = util_format_description(format); @@ -258,7 +258,7 @@ llvmpipe_flush_frontbuffer(struct pipe_screen *_screen, void *context_private) { struct llvmpipe_screen *screen = llvmpipe_screen(_screen); - struct llvmpipe_winsys *winsys = screen->winsys; + struct sw_winsys *winsys = screen->winsys; struct llvmpipe_texture *texture = llvmpipe_texture(surface->texture); assert(texture->dt); @@ -271,7 +271,7 @@ static void llvmpipe_destroy_screen( struct pipe_screen *_screen ) { struct llvmpipe_screen *screen = llvmpipe_screen(_screen); - struct llvmpipe_winsys *winsys = screen->winsys; + struct sw_winsys *winsys = screen->winsys; lp_jit_screen_cleanup(screen); @@ -288,7 +288,7 @@ llvmpipe_destroy_screen( struct pipe_screen *_screen ) * Note: we're not presently subclassing pipe_screen (no llvmpipe_screen). */ struct pipe_screen * -llvmpipe_create_screen(struct llvmpipe_winsys *winsys) +llvmpipe_create_screen(struct sw_winsys *winsys) { struct llvmpipe_screen *screen = CALLOC_STRUCT(llvmpipe_screen); diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h index 4a1b4d6f3e..3211822b53 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.h +++ b/src/gallium/drivers/llvmpipe/lp_screen.h @@ -43,14 +43,14 @@ #include "pipe/p_defines.h" -struct llvmpipe_winsys; +struct sw_winsys; struct llvmpipe_screen { struct pipe_screen base; - struct llvmpipe_winsys *winsys; + struct sw_winsys *winsys; LLVMModuleRef module; LLVMExecutionEngineRef engine; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index aebed85fbb..72b19d0b05 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -479,7 +479,7 @@ lp_setup_set_sampler_textures( struct setup_context *setup, */ struct llvmpipe_screen *screen = llvmpipe_screen(tex->screen); - struct llvmpipe_winsys *winsys = screen->winsys; + struct sw_winsys *winsys = screen->winsys; jit_tex->data = winsys->displaytarget_map(winsys, lp_tex->dt, PIPE_BUFFER_USAGE_CPU_READ); assert(jit_tex->data); diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 7f45635542..aed9ed6175 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -93,7 +93,7 @@ static boolean llvmpipe_displaytarget_layout(struct llvmpipe_screen *screen, struct llvmpipe_texture *lpt) { - struct llvmpipe_winsys *winsys = screen->winsys; + struct sw_winsys *winsys = screen->winsys; /* Round up the surface size to a multiple of the tile size to * avoid tile clipping. @@ -187,7 +187,7 @@ llvmpipe_texture_destroy(struct pipe_texture *pt) if (lpt->dt) { /* display target */ - struct llvmpipe_winsys *winsys = screen->winsys; + struct sw_winsys *winsys = screen->winsys; winsys->displaytarget_destroy(winsys, lpt->dt); } else { @@ -357,7 +357,7 @@ llvmpipe_transfer_map( struct pipe_screen *_screen, if (lpt->dt) { /* display target */ - struct llvmpipe_winsys *winsys = screen->winsys; + struct sw_winsys *winsys = screen->winsys; map = winsys->displaytarget_map(winsys, lpt->dt, pipe_transfer_buffer_flags(transfer)); @@ -398,7 +398,7 @@ llvmpipe_transfer_unmap(struct pipe_screen *screen, if (lpt->dt) { /* display target */ - struct llvmpipe_winsys *winsys = lp_screen->winsys; + struct sw_winsys *winsys = lp_screen->winsys; winsys->displaytarget_unmap(winsys, lpt->dt); } } diff --git a/src/gallium/drivers/llvmpipe/lp_texture.h b/src/gallium/drivers/llvmpipe/lp_texture.h index 87c905bc02..6a6d9f9222 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.h +++ b/src/gallium/drivers/llvmpipe/lp_texture.h @@ -35,7 +35,8 @@ struct pipe_context; struct pipe_screen; struct llvmpipe_context; -struct llvmpipe_displaytarget; + +struct sw_displaytarget; struct llvmpipe_texture @@ -49,7 +50,7 @@ struct llvmpipe_texture * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET * usage. */ - struct llvmpipe_displaytarget *dt; + struct sw_displaytarget *dt; /** * Malloc'ed data for regular textures, or a mapping to dt above. diff --git a/src/gallium/drivers/llvmpipe/lp_winsys.h b/src/gallium/drivers/llvmpipe/lp_winsys.h deleted file mode 100644 index ce11fa9304..0000000000 --- a/src/gallium/drivers/llvmpipe/lp_winsys.h +++ /dev/null @@ -1,125 +0,0 @@ -/************************************************************************** - * - * Copyright 2007-2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -/** - * @file - * llvmpipe public interface. - */ - - -#ifndef LP_WINSYS_H -#define LP_WINSYS_H - - -#include "pipe/p_compiler.h" /* for boolean */ -#include "pipe/p_format.h" - - -#ifdef __cplusplus -extern "C" { -#endif - - -struct pipe_screen; -struct pipe_context; - - -/** - * Opaque pointer. - */ -struct llvmpipe_displaytarget; - - -/** - * This is the interface that llvmpipe expects any window system - * hosting it to implement. - * - * llvmpipe is for the most part a self sufficient driver. The only thing it - * does not know is how to display a surface. - */ -struct llvmpipe_winsys -{ - void - (*destroy)( struct llvmpipe_winsys *ws ); - - boolean - (*is_displaytarget_format_supported)( struct llvmpipe_winsys *ws, - enum pipe_format format ); - - /** - * Allocate storage for a render target. - * - * Often surfaces which are meant to be blitted to the front screen (i.e., - * display targets) must be allocated with special characteristics, memory - * pools, or obtained directly from the windowing system. - * - * This callback is invoked by the pipe_screen when creating a texture marked - * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying - * storage. - */ - struct llvmpipe_displaytarget * - (*displaytarget_create)( struct llvmpipe_winsys *ws, - enum pipe_format format, - unsigned width, unsigned height, - unsigned alignment, - unsigned *stride ); - - void * - (*displaytarget_map)( struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt, - unsigned flags ); - - void - (*displaytarget_unmap)( struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt ); - - /** - * @sa pipe_screen:flush_frontbuffer. - * - * This call will likely become asynchronous eventually. - */ - void - (*displaytarget_display)( struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt, - void *context_private ); - - void - (*displaytarget_destroy)( struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt ); -}; - - - -struct pipe_screen * -llvmpipe_create_screen( struct llvmpipe_winsys * ); - - -#ifdef __cplusplus -} -#endif - -#endif /* LP_WINSYS_H */ diff --git a/src/gallium/drivers/softpipe/Makefile b/src/gallium/drivers/softpipe/Makefile index e4ac49fa85..1c6e4ae076 100644 --- a/src/gallium/drivers/softpipe/Makefile +++ b/src/gallium/drivers/softpipe/Makefile @@ -6,6 +6,7 @@ LIBNAME = softpipe C_SOURCES = \ sp_fs_exec.c \ sp_fs_sse.c \ + sp_buffer.c \ sp_clear.c \ sp_flush.c \ sp_query.c \ @@ -32,7 +33,6 @@ C_SOURCES = \ sp_tex_tile_cache.c \ sp_tile_cache.c \ sp_surface.c \ - sp_video_context.c \ - sp_winsys.c + sp_video_context.c include ../../Makefile.template diff --git a/src/gallium/drivers/softpipe/SConscript b/src/gallium/drivers/softpipe/SConscript index 3042e556c6..27ab00b036 100644 --- a/src/gallium/drivers/softpipe/SConscript +++ b/src/gallium/drivers/softpipe/SConscript @@ -7,6 +7,7 @@ softpipe = env.ConvenienceLibrary( source = [ 'sp_fs_exec.c', 'sp_fs_sse.c', + 'sp_buffer.c', 'sp_clear.c', 'sp_context.c', 'sp_draw_arrays.c', @@ -33,8 +34,7 @@ softpipe = env.ConvenienceLibrary( 'sp_tex_tile_cache.c', 'sp_texture.c', 'sp_tile_cache.c', - 'sp_video_context.c', - 'sp_winsys.c' + 'sp_video_context.c' ]) Export('softpipe') diff --git a/src/gallium/drivers/softpipe/sp_buffer.c b/src/gallium/drivers/softpipe/sp_buffer.c new file mode 100644 index 0000000000..8f39025086 --- /dev/null +++ b/src/gallium/drivers/softpipe/sp_buffer.c @@ -0,0 +1,118 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#include "util/u_inlines.h" +#include "util/u_memory.h" +#include "util/u_math.h" + +#include "sp_screen.h" +#include "sp_buffer.h" + + +static void * +softpipe_buffer_map(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned flags) +{ + struct softpipe_buffer *softpipe_buf = softpipe_buffer(buf); + return softpipe_buf->data; +} + + +static void +softpipe_buffer_unmap(struct pipe_screen *screen, + struct pipe_buffer *buf) +{ +} + + +static void +softpipe_buffer_destroy(struct pipe_buffer *buf) +{ + struct softpipe_buffer *sbuf = softpipe_buffer(buf); + + if (!sbuf->userBuffer) + align_free(sbuf->data); + + FREE(sbuf); +} + + +static struct pipe_buffer * +softpipe_buffer_create(struct pipe_screen *screen, + unsigned alignment, + unsigned usage, + unsigned size) +{ + struct softpipe_buffer *buffer = CALLOC_STRUCT(softpipe_buffer); + + pipe_reference_init(&buffer->base.reference, 1); + buffer->base.screen = screen; + buffer->base.alignment = MAX2(alignment, 16); + buffer->base.usage = usage; + buffer->base.size = size; + + buffer->data = align_malloc(size, alignment); + + return &buffer->base; +} + + +/** + * Create buffer which wraps user-space data. + */ +static struct pipe_buffer * +softpipe_user_buffer_create(struct pipe_screen *screen, + void *ptr, + unsigned bytes) +{ + struct softpipe_buffer *buffer; + + buffer = CALLOC_STRUCT(softpipe_buffer); + if(!buffer) + return NULL; + + pipe_reference_init(&buffer->base.reference, 1); + buffer->base.screen = screen; + buffer->base.size = bytes; + buffer->userBuffer = TRUE; + buffer->data = ptr; + + return &buffer->base; +} + + +void +softpipe_init_screen_buffer_funcs(struct pipe_screen *screen) +{ + screen->buffer_create = softpipe_buffer_create; + screen->user_buffer_create = softpipe_user_buffer_create; + screen->buffer_map = softpipe_buffer_map; + screen->buffer_unmap = softpipe_buffer_unmap; + screen->buffer_destroy = softpipe_buffer_destroy; +} diff --git a/src/gallium/drivers/softpipe/sp_buffer.h b/src/gallium/drivers/softpipe/sp_buffer.h new file mode 100644 index 0000000000..9d8e56a176 --- /dev/null +++ b/src/gallium/drivers/softpipe/sp_buffer.h @@ -0,0 +1,55 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SP_BUFFER_H +#define SP_BUFFER_H + +#include "pipe/p_compiler.h" +#include "pipe/p_state.h" + + +struct softpipe_buffer +{ + struct pipe_buffer base; + boolean userBuffer; /** Is this a user-space buffer? */ + void *data; +}; + + +/** Cast wrapper */ +static INLINE struct softpipe_buffer * +softpipe_buffer( struct pipe_buffer *buf ) +{ + return (struct softpipe_buffer *)buf; +} + + +void +softpipe_init_screen_buffer_funcs(struct pipe_screen *screen); + + +#endif /* SP_BUFFER_H */ diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index ddc35bcd62..53eecd1cbf 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -210,7 +210,7 @@ softpipe_create_context( struct pipe_screen *screen, softpipe->dump_fs = debug_get_bool_option( "GALLIUM_DUMP_FS", FALSE ); softpipe->dump_gs = debug_get_bool_option( "SOFTPIPE_DUMP_GS", FALSE ); - softpipe->pipe.winsys = screen->winsys; + softpipe->pipe.winsys = NULL; softpipe->pipe.screen = screen; softpipe->pipe.destroy = softpipe_destroy; softpipe->pipe.priv = priv; diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index b2acc36bf7..0899e1145a 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -40,83 +40,13 @@ #include "sp_context.h" #include "sp_query.h" #include "sp_state.h" +#include "sp_buffer.h" #include "draw/draw_context.h" -static void -softpipe_map_constant_buffers(struct softpipe_context *sp) -{ - struct pipe_winsys *ws = sp->pipe.winsys; - uint i; - - for (i = 0; i < PIPE_SHADER_TYPES; i++) { - uint j; - - for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) { - if (sp->constants[i][j] && sp->constants[i][j]->size) { - sp->mapped_constants[i][j] = ws->buffer_map(ws, - sp->constants[i][j], - PIPE_BUFFER_USAGE_CPU_READ); - } - } - } - - for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) { - if (sp->constants[PIPE_SHADER_VERTEX][i]) { - draw_set_mapped_constant_buffer(sp->draw, - PIPE_SHADER_VERTEX, - i, - sp->mapped_constants[PIPE_SHADER_VERTEX][i], - sp->constants[PIPE_SHADER_VERTEX][i]->size); - } - if (sp->constants[PIPE_SHADER_GEOMETRY][i]) { - draw_set_mapped_constant_buffer(sp->draw, - PIPE_SHADER_GEOMETRY, - i, - sp->mapped_constants[PIPE_SHADER_GEOMETRY][i], - sp->constants[PIPE_SHADER_GEOMETRY][i]->size); - } - } -} - - -static void -softpipe_unmap_constant_buffers(struct softpipe_context *sp) -{ - struct pipe_winsys *ws = sp->pipe.winsys; - uint i; - /* really need to flush all prims since the vert/frag shaders const buffers - * are going away now. - */ - draw_flush(sp->draw); - - for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) { - draw_set_mapped_constant_buffer(sp->draw, - PIPE_SHADER_VERTEX, - i, - NULL, - 0); - draw_set_mapped_constant_buffer(sp->draw, - PIPE_SHADER_GEOMETRY, - i, - NULL, - 0); - } - - for (i = 0; i < PIPE_SHADER_TYPES; i++) { - uint j; - - for (j = 0; j < PIPE_MAX_CONSTANT_BUFFERS; j++) { - if (sp->constants[i][j] && sp->constants[i][j]->size) { - ws->buffer_unmap(ws, sp->constants[i][j]); - } - sp->mapped_constants[i][j] = NULL; - } - } -} /** @@ -261,25 +191,16 @@ softpipe_draw_range_elements_instanced(struct pipe_context *pipe, } softpipe_map_transfers(sp); - softpipe_map_constant_buffers(sp); /* Map vertex buffers */ for (i = 0; i < sp->num_vertex_buffers; i++) { - void *buf; - - buf = pipe_buffer_map(pipe->screen, - sp->vertex_buffer[i].buffer, - PIPE_BUFFER_USAGE_CPU_READ); + void *buf = softpipe_buffer(sp->vertex_buffer[i].buffer)->data; draw_set_mapped_vertex_buffer(draw, i, buf); } /* Map index buffer, if present */ if (indexBuffer) { - void *mapped_indexes; - - mapped_indexes = pipe_buffer_map(pipe->screen, - indexBuffer, - PIPE_BUFFER_USAGE_CPU_READ); + void *mapped_indexes = softpipe_buffer(indexBuffer)->data; draw_set_mapped_element_buffer_range(draw, indexSize, minIndex, @@ -300,15 +221,18 @@ softpipe_draw_range_elements_instanced(struct pipe_context *pipe, /* unmap vertex/index buffers - will cause draw module to flush */ for (i = 0; i < sp->num_vertex_buffers; i++) { draw_set_mapped_vertex_buffer(draw, i, NULL); - pipe_buffer_unmap(pipe->screen, sp->vertex_buffer[i].buffer); } if (indexBuffer) { draw_set_mapped_element_buffer(draw, 0, NULL); - pipe_buffer_unmap(pipe->screen, indexBuffer); } - /* Note: leave drawing surfaces mapped */ - softpipe_unmap_constant_buffers(sp); + /* + * TODO: Flush only when a user vertex/index buffer is present + * (or even better, modify draw module to do this + * internally when this condition is seen?) + */ + draw_flush(draw); + /* Note: leave drawing surfaces mapped */ sp->dirty_render_cache = TRUE; } diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 6ec63fe698..107631f6b5 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -32,10 +32,12 @@ #include "pipe/p_defines.h" #include "pipe/p_screen.h" +#include "state_tracker/sw_winsys.h" + #include "sp_texture.h" -#include "sp_winsys.h" #include "sp_screen.h" #include "sp_context.h" +#include "sp_buffer.h" static const char * @@ -145,6 +147,8 @@ softpipe_is_format_supported( struct pipe_screen *screen, unsigned tex_usage, unsigned geom_flags ) { + struct sw_winsys *winsys = softpipe_screen(screen)->winsys; + assert(target == PIPE_TEXTURE_1D || target == PIPE_TEXTURE_2D || target == PIPE_TEXTURE_3D || @@ -166,15 +170,25 @@ softpipe_is_format_supported( struct pipe_screen *screen, case PIPE_FORMAT_NONE: return FALSE; default: - return TRUE; + break; } + + if(tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) { + if(!winsys->is_displaytarget_format_supported(winsys, format)) + return FALSE; + } + + /* XXX: this is often a lie. Pull in logic from llvmpipe to fix. + */ + return TRUE; } static void softpipe_destroy_screen( struct pipe_screen *screen ) { - struct pipe_winsys *winsys = screen->winsys; + struct softpipe_screen *sp_screen = softpipe_screen(screen); + struct sw_winsys *winsys = sp_screen->winsys; if(winsys->destroy) winsys->destroy(winsys); @@ -183,21 +197,37 @@ softpipe_destroy_screen( struct pipe_screen *screen ) } +/* This is often overriden by the co-state tracker. + */ +static void +softpipe_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_surface *surface, + void *context_private) +{ + struct softpipe_screen *screen = softpipe_screen(_screen); + struct sw_winsys *winsys = screen->winsys; + struct softpipe_texture *texture = softpipe_texture(surface->texture); + + assert(texture->dt); + if (texture->dt) + winsys->displaytarget_display(winsys, texture->dt, context_private); +} /** * Create a new pipe_screen object * Note: we're not presently subclassing pipe_screen (no softpipe_screen). */ struct pipe_screen * -softpipe_create_screen(struct pipe_winsys *winsys) +softpipe_create_screen(struct sw_winsys *winsys) { struct softpipe_screen *screen = CALLOC_STRUCT(softpipe_screen); if (!screen) return NULL; - screen->base.winsys = winsys; + screen->winsys = winsys; + screen->base.winsys = NULL; screen->base.destroy = softpipe_destroy_screen; screen->base.get_name = softpipe_get_name; @@ -206,9 +236,10 @@ softpipe_create_screen(struct pipe_winsys *winsys) screen->base.get_paramf = softpipe_get_paramf; screen->base.is_format_supported = softpipe_is_format_supported; screen->base.context_create = softpipe_create_context; + screen->base.flush_frontbuffer = softpipe_flush_frontbuffer; softpipe_init_screen_texture_funcs(&screen->base); - u_simple_screen_init(&screen->base); + softpipe_init_screen_buffer_funcs(&screen->base); return &screen->base; } diff --git a/src/gallium/drivers/softpipe/sp_screen.h b/src/gallium/drivers/softpipe/sp_screen.h index 3d4bfd3e84..4d7d8bada2 100644 --- a/src/gallium/drivers/softpipe/sp_screen.h +++ b/src/gallium/drivers/softpipe/sp_screen.h @@ -35,10 +35,13 @@ #include "pipe/p_defines.h" +struct sw_winsys; struct softpipe_screen { struct pipe_screen base; + struct sw_winsys *winsys; + /* Increments whenever textures are modified. Contexts can track * this. */ @@ -55,4 +58,13 @@ softpipe_screen( struct pipe_screen *pipe ) } + +/** + * Create a softpipe screen that uses the + * given winsys for allocating buffers. + */ +struct pipe_screen *softpipe_create_screen( struct sw_winsys * ); + + + #endif /* SP_SCREEN_H */ diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c index c88e213751..cd0e905bc9 100644 --- a/src/gallium/drivers/softpipe/sp_state_fs.c +++ b/src/gallium/drivers/softpipe/sp_state_fs.c @@ -28,6 +28,7 @@ #include "sp_context.h" #include "sp_state.h" #include "sp_fs.h" +#include "sp_buffer.h" #include "pipe/p_defines.h" #include "util/u_memory.h" @@ -163,26 +164,35 @@ softpipe_delete_vs_state(struct pipe_context *pipe, void *vs) FREE( state ); } - - void softpipe_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, - struct pipe_buffer *buf) + struct pipe_buffer *constants) { struct softpipe_context *softpipe = softpipe_context(pipe); + unsigned size = constants ? constants->size : 0; + const void *data = constants ? softpipe_buffer(constants)->data : NULL; assert(shader < PIPE_SHADER_TYPES); - assert(index < PIPE_MAX_CONSTANT_BUFFERS); + assert(index == 0); + + if(softpipe->constants[shader][index] == constants) + return; draw_flush(softpipe->draw); /* note: reference counting */ - pipe_buffer_reference(&softpipe->constants[shader][index], buf); + pipe_buffer_reference(&softpipe->constants[shader][index], constants); + + if(shader == PIPE_SHADER_VERTEX) { + draw_set_mapped_constant_buffer(softpipe->draw, PIPE_SHADER_VERTEX, 0, + data, size); + } softpipe->dirty |= SP_NEW_CONSTANTS; } + void * softpipe_create_gs_state(struct pipe_context *pipe, const struct pipe_shader_state *templ) diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index 32d261b5ff..9641652da8 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -40,7 +40,8 @@ #include "sp_context.h" #include "sp_texture.h" #include "sp_screen.h" -#include "sp_winsys.h" + +#include "state_tracker/sw_winsys.h" /** @@ -72,11 +73,9 @@ softpipe_texture_layout(struct pipe_screen *screen, depth = u_minify(depth, 1); } - spt->buffer = screen->buffer_create(screen, 32, - PIPE_BUFFER_USAGE_PIXEL, - buffer_size); + spt->data = align_malloc(buffer_size, 16); - return spt->buffer != NULL; + return spt->data != NULL; } @@ -87,19 +86,18 @@ static boolean softpipe_displaytarget_layout(struct pipe_screen *screen, struct softpipe_texture * spt) { - unsigned usage = (PIPE_BUFFER_USAGE_CPU_READ_WRITE | - PIPE_BUFFER_USAGE_GPU_READ_WRITE); - unsigned tex_usage = spt->base.tex_usage; - - spt->buffer = screen->surface_buffer_create( screen, - spt->base.width0, - spt->base.height0, - spt->base.format, - usage, - tex_usage, - &spt->stride[0]); - - return spt->buffer != NULL; + struct sw_winsys *winsys = softpipe_screen(screen)->winsys; + + /* Round up the surface size to a multiple of the tile size? + */ + spt->dt = winsys->displaytarget_create(winsys, + spt->base.format, + spt->base.width0, + spt->base.height0, + 16, + &spt->stride[0] ); + + return spt->dt != NULL; } @@ -149,37 +147,29 @@ softpipe_texture_blanket(struct pipe_screen * screen, const unsigned *stride, struct pipe_buffer *buffer) { - struct softpipe_texture *spt; - assert(screen); - - /* Only supports one type */ - if (base->target != PIPE_TEXTURE_2D || - base->last_level != 0 || - base->depth0 != 1) { - return NULL; - } - - spt = CALLOC_STRUCT(softpipe_texture); - if (!spt) - return NULL; - - spt->base = *base; - pipe_reference_init(&spt->base.reference, 1); - spt->base.screen = screen; - spt->stride[0] = stride[0]; - - pipe_buffer_reference(&spt->buffer, buffer); - - return &spt->base; + /* Texture blanket is going away. + */ + debug_printf("softpipe_texture_blanket() not implemented!"); + return NULL; } static void softpipe_texture_destroy(struct pipe_texture *pt) { + struct softpipe_screen *screen = softpipe_screen(pt->screen); struct softpipe_texture *spt = softpipe_texture(pt); - pipe_buffer_reference(&spt->buffer, NULL); + if (spt->dt) { + /* display target */ + struct sw_winsys *winsys = screen->winsys; + winsys->displaytarget_destroy(winsys, spt->dt); + } + else { + /* regular texture */ + align_free(spt->data); + } + FREE(spt); } @@ -359,9 +349,20 @@ softpipe_transfer_map( struct pipe_screen *screen, spt = softpipe_texture(transfer->texture); format = transfer->texture->format; - map = pipe_buffer_map(screen, spt->buffer, pipe_transfer_buffer_flags(transfer)); - if (map == NULL) - return NULL; + if (spt->dt) { + /* display target */ + struct sw_winsys *winsys = softpipe_screen(screen)->winsys; + + map = winsys->displaytarget_map(winsys, spt->dt, + pipe_transfer_buffer_flags(transfer)); + if (map == NULL) + return NULL; + } + else { + map = spt->data; + if (map == NULL) + return NULL; + } /* May want to different things here depending on read/write nature * of the map: @@ -393,7 +394,11 @@ softpipe_transfer_unmap(struct pipe_screen *screen, assert(transfer->texture); spt = softpipe_texture(transfer->texture); - pipe_buffer_unmap( screen, spt->buffer ); + if (spt->dt) { + /* display target */ + struct sw_winsys *winsys = softpipe_screen(screen)->winsys; + winsys->displaytarget_unmap(winsys, spt->dt); + } if (transfer->usage & PIPE_TRANSFER_WRITE) { /* Mark the texture as dirty to expire the tile caches. */ @@ -474,24 +479,4 @@ softpipe_init_screen_texture_funcs(struct pipe_screen *screen) } -/** - * Return pipe_buffer handle and stride for given texture object. - * XXX used for??? - */ -boolean -softpipe_get_texture_buffer( struct pipe_texture *texture, - struct pipe_buffer **buf, - unsigned *stride ) -{ - struct softpipe_texture *tex = (struct softpipe_texture *) texture; - if (!tex) - return FALSE; - - pipe_buffer_reference(buf, tex->buffer); - - if (stride) - *stride = tex->stride[0]; - - return TRUE; -} diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h index 2ef64e1e7c..e8d17ce7da 100644 --- a/src/gallium/drivers/softpipe/sp_texture.h +++ b/src/gallium/drivers/softpipe/sp_texture.h @@ -45,9 +45,16 @@ struct softpipe_texture unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS]; unsigned stride[PIPE_MAX_TEXTURE_LEVELS]; - /* The data is held here: + /** + * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET + * usage. + */ + struct sw_displaytarget *dt; + + /** + * Malloc'ed data for regular textures, or a mapping to dt above. */ - struct pipe_buffer *buffer; + void *data; /* True if texture images are power-of-two in all dimensions: */ diff --git a/src/gallium/drivers/softpipe/sp_winsys.c b/src/gallium/drivers/softpipe/sp_winsys.c deleted file mode 100644 index 0a6245ed2c..0000000000 --- a/src/gallium/drivers/softpipe/sp_winsys.c +++ /dev/null @@ -1,245 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/** - * @file - * Malloc softpipe winsys. Uses malloc for all memory allocations. - * - * @author Keith Whitwell - * @author Brian Paul - * @author Jose Fonseca - */ - - -#include "util/u_simple_screen.h"/* port to just p_screen */ -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "util/u_inlines.h" -#include "pipe/p_format.h" -#include "pipe/p_context.h" -#include "sp_winsys.h" - - -struct st_softpipe_buffer -{ - struct pipe_buffer base; - boolean userBuffer; /** Is this a user-space buffer? */ - void *data; - void *mapped; -}; - - -/** Cast wrapper */ -static INLINE struct st_softpipe_buffer * -st_softpipe_buffer( struct pipe_buffer *buf ) -{ - return (struct st_softpipe_buffer *)buf; -} - - -static void * -st_softpipe_buffer_map(struct pipe_winsys *winsys, - struct pipe_buffer *buf, - unsigned flags) -{ - struct st_softpipe_buffer *st_softpipe_buf = st_softpipe_buffer(buf); - st_softpipe_buf->mapped = st_softpipe_buf->data; - return st_softpipe_buf->mapped; -} - - -static void -st_softpipe_buffer_unmap(struct pipe_winsys *winsys, - struct pipe_buffer *buf) -{ - struct st_softpipe_buffer *st_softpipe_buf = st_softpipe_buffer(buf); - st_softpipe_buf->mapped = NULL; -} - - -static void -st_softpipe_buffer_destroy(struct pipe_buffer *buf) -{ - struct st_softpipe_buffer *oldBuf = st_softpipe_buffer(buf); - - if (oldBuf->data) { - if (!oldBuf->userBuffer) - align_free(oldBuf->data); - - oldBuf->data = NULL; - } - - FREE(oldBuf); -} - - -static void -st_softpipe_flush_frontbuffer(struct pipe_winsys *winsys, - struct pipe_surface *surf, - void *context_private) -{ -} - - - -static const char * -st_softpipe_get_name(struct pipe_winsys *winsys) -{ - return "softpipe"; -} - - -static struct pipe_buffer * -st_softpipe_buffer_create(struct pipe_winsys *winsys, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct st_softpipe_buffer *buffer = CALLOC_STRUCT(st_softpipe_buffer); - - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.alignment = alignment; - buffer->base.usage = usage; - buffer->base.size = size; - - buffer->data = align_malloc(size, alignment); - - return &buffer->base; -} - - -/** - * Create buffer which wraps user-space data. - */ -static struct pipe_buffer * -st_softpipe_user_buffer_create(struct pipe_winsys *winsys, - void *ptr, - unsigned bytes) -{ - struct st_softpipe_buffer *buffer; - - buffer = CALLOC_STRUCT(st_softpipe_buffer); - if(!buffer) - return NULL; - - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.size = bytes; - buffer->userBuffer = TRUE; - buffer->data = ptr; - - return &buffer->base; -} - - -static struct pipe_buffer * -st_softpipe_surface_buffer_create(struct pipe_winsys *winsys, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride) -{ - const unsigned alignment = 64; - unsigned nblocksy; - - nblocksy = util_format_get_nblocksy(format, height); - *stride = align(util_format_get_stride(format, width), alignment); - - return winsys->buffer_create(winsys, alignment, - usage, - *stride * nblocksy); -} - - -static void -st_softpipe_fence_reference(struct pipe_winsys *winsys, - struct pipe_fence_handle **ptr, - struct pipe_fence_handle *fence) -{ -} - - -static int -st_softpipe_fence_signalled(struct pipe_winsys *winsys, - struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - -static int -st_softpipe_fence_finish(struct pipe_winsys *winsys, - struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - -static void -st_softpipe_destroy(struct pipe_winsys *winsys) -{ - FREE(winsys); -} - - -struct pipe_screen * -softpipe_create_screen_malloc(void) -{ - static struct pipe_winsys *winsys; - struct pipe_screen *screen; - - winsys = CALLOC_STRUCT(pipe_winsys); - if(!winsys) - return NULL; - - winsys->destroy = st_softpipe_destroy; - - winsys->buffer_create = st_softpipe_buffer_create; - winsys->user_buffer_create = st_softpipe_user_buffer_create; - winsys->buffer_map = st_softpipe_buffer_map; - winsys->buffer_unmap = st_softpipe_buffer_unmap; - winsys->buffer_destroy = st_softpipe_buffer_destroy; - - winsys->surface_buffer_create = st_softpipe_surface_buffer_create; - - winsys->fence_reference = st_softpipe_fence_reference; - winsys->fence_signalled = st_softpipe_fence_signalled; - winsys->fence_finish = st_softpipe_fence_finish; - - winsys->flush_frontbuffer = st_softpipe_flush_frontbuffer; - winsys->get_name = st_softpipe_get_name; - - screen = softpipe_create_screen(winsys); - if(!screen) - st_softpipe_destroy(winsys); - - return screen; -} diff --git a/src/gallium/drivers/softpipe/sp_winsys.h b/src/gallium/drivers/softpipe/sp_winsys.h deleted file mode 100644 index 6e3920c49b..0000000000 --- a/src/gallium/drivers/softpipe/sp_winsys.h +++ /dev/null @@ -1,73 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -/* This is the interface that softpipe requires any window system - * hosting it to implement. This is the only include file in softpipe - * which is public. - */ - - -#ifndef SP_WINSYS_H -#define SP_WINSYS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "pipe/p_defines.h" - -struct pipe_screen; -struct pipe_winsys; -struct pipe_context; -struct pipe_texture; -struct pipe_buffer; - - - -/** - * Create a softpipe screen that uses the - * given winsys for allocating buffers. - */ -struct pipe_screen *softpipe_create_screen( struct pipe_winsys * ); - -/** - * Create a softpipe screen that uses - * regular malloc to create all its buffers. - */ -struct pipe_screen *softpipe_create_screen_malloc(void); - -boolean -softpipe_get_texture_buffer( struct pipe_texture *texture, - struct pipe_buffer **buf, - unsigned *stride ); - - -#ifdef __cplusplus -} -#endif - -#endif /* SP_WINSYS_H */ diff --git a/src/gallium/include/state_tracker/sw_winsys.h b/src/gallium/include/state_tracker/sw_winsys.h new file mode 100644 index 0000000000..719c3f3eee --- /dev/null +++ b/src/gallium/include/state_tracker/sw_winsys.h @@ -0,0 +1,121 @@ +/************************************************************************** + * + * Copyright 2007-2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/** + * @file + * Software rasterizer winsys. + */ + + +#ifndef SW_WINSYS_H +#define SW_WINSYS_H + + +#include "pipe/p_compiler.h" /* for boolean */ +#include "pipe/p_format.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +struct pipe_screen; +struct pipe_context; + + +/** + * Opaque pointer. + */ +struct sw_displaytarget; + + +/** + * This is the interface that sw expects any window system + * hosting it to implement. + * + * sw is for the most part a self sufficient driver. The only thing it + * does not know is how to display a surface. + */ +struct sw_winsys +{ + void + (*destroy)( struct sw_winsys *ws ); + + boolean + (*is_displaytarget_format_supported)( struct sw_winsys *ws, + enum pipe_format format ); + + /** + * Allocate storage for a render target. + * + * Often surfaces which are meant to be blitted to the front screen (i.e., + * display targets) must be allocated with special characteristics, memory + * pools, or obtained directly from the windowing system. + * + * This callback is invoked by the pipe_screen when creating a texture marked + * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying + * storage. + */ + struct sw_displaytarget * + (*displaytarget_create)( struct sw_winsys *ws, + enum pipe_format format, + unsigned width, unsigned height, + unsigned alignment, + unsigned *stride ); + + void * + (*displaytarget_map)( struct sw_winsys *ws, + struct sw_displaytarget *dt, + unsigned flags ); + + void + (*displaytarget_unmap)( struct sw_winsys *ws, + struct sw_displaytarget *dt ); + + /** + * @sa pipe_screen:flush_frontbuffer. + * + * This call will likely become asynchronous eventually. + */ + void + (*displaytarget_display)( struct sw_winsys *ws, + struct sw_displaytarget *dt, + void *context_private ); + + void + (*displaytarget_destroy)( struct sw_winsys *ws, + struct sw_displaytarget *dt ); +}; + + + +#ifdef __cplusplus +} +#endif + +#endif /* SW_WINSYS_H */ diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript index 4cbc86f331..4b32aa27e1 100644 --- a/src/gallium/winsys/gdi/SConscript +++ b/src/gallium/winsys/gdi/SConscript @@ -18,7 +18,7 @@ if env['platform'] == 'windows': 'ws2_32', ]) - sources = [] + sources = ['gdi_sw_winsys.c'] drivers = [] if 'softpipe' in env['drivers']: diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index a9fa03b8e5..3d317c70dd 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -36,153 +36,8 @@ #include -#include "pipe/p_format.h" -#include "pipe/p_context.h" -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "llvmpipe/lp_winsys.h" +#include "gdi_winsys.h" #include "llvmpipe/lp_texture.h" -#include "stw_winsys.h" - - -struct gdi_llvmpipe_displaytarget -{ - enum pipe_format format; - unsigned width; - unsigned height; - unsigned stride; - - unsigned size; - - void *data; - - BITMAPINFO bmi; -}; - - -/** Cast wrapper */ -static INLINE struct gdi_llvmpipe_displaytarget * -gdi_llvmpipe_displaytarget( struct llvmpipe_displaytarget *buf ) -{ - return (struct gdi_llvmpipe_displaytarget *)buf; -} - - -static boolean -gdi_llvmpipe_is_displaytarget_format_supported( struct llvmpipe_winsys *ws, - enum pipe_format format ) -{ - switch(format) { - case PIPE_FORMAT_B8G8R8X8_UNORM: - case PIPE_FORMAT_B8G8R8A8_UNORM: - return TRUE; - - /* TODO: Support other formats possible with BMPs, as described in - * http://msdn.microsoft.com/en-us/library/dd183376(VS.85).aspx */ - - default: - return FALSE; - } -} - - -static void * -gdi_llvmpipe_displaytarget_map(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt, - unsigned flags ) -{ - struct gdi_llvmpipe_displaytarget *gdt = gdi_llvmpipe_displaytarget(dt); - - return gdt->data; -} - - -static void -gdi_llvmpipe_displaytarget_unmap(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt ) -{ - -} - - -static void -gdi_llvmpipe_displaytarget_destroy(struct llvmpipe_winsys *winsys, - struct llvmpipe_displaytarget *dt) -{ - struct gdi_llvmpipe_displaytarget *gdt = gdi_llvmpipe_displaytarget(dt); - - align_free(gdt->data); - FREE(gdt); -} - - -static struct llvmpipe_displaytarget * -gdi_llvmpipe_displaytarget_create(struct llvmpipe_winsys *winsys, - enum pipe_format format, - unsigned width, unsigned height, - unsigned alignment, - unsigned *stride) -{ - struct gdi_llvmpipe_displaytarget *gdt; - unsigned cpp; - unsigned bpp; - - gdt = CALLOC_STRUCT(gdi_llvmpipe_displaytarget); - if(!gdt) - goto no_gdt; - - gdt->format = format; - gdt->width = width; - gdt->height = height; - - bpp = util_format_get_blocksizebits(format); - cpp = util_format_get_blocksize(format); - - gdt->stride = align(width * cpp, alignment); - gdt->size = gdt->stride * height; - - gdt->data = align_malloc(gdt->size, alignment); - if(!gdt->data) - goto no_data; - - gdt->bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - gdt->bmi.bmiHeader.biWidth = gdt->stride / cpp; - gdt->bmi.bmiHeader.biHeight= -(long)height; - gdt->bmi.bmiHeader.biPlanes = 1; - gdt->bmi.bmiHeader.biBitCount = bpp; - gdt->bmi.bmiHeader.biCompression = BI_RGB; - gdt->bmi.bmiHeader.biSizeImage = 0; - gdt->bmi.bmiHeader.biXPelsPerMeter = 0; - gdt->bmi.bmiHeader.biYPelsPerMeter = 0; - gdt->bmi.bmiHeader.biClrUsed = 0; - gdt->bmi.bmiHeader.biClrImportant = 0; - - *stride = gdt->stride; - return (struct llvmpipe_displaytarget *)gdt; - -no_data: - FREE(gdt); -no_gdt: - return NULL; -} - - -static void -gdi_llvmpipe_displaytarget_display(struct llvmpipe_winsys *winsys, - struct llvmpipe_displaytarget *dt, - void *context_private) -{ - assert(0); -} - - -static void -gdi_llvmpipe_destroy(struct llvmpipe_winsys *winsys) -{ - FREE(winsys); -} static struct pipe_screen * @@ -191,18 +46,10 @@ gdi_llvmpipe_screen_create(void) static struct llvmpipe_winsys *winsys; struct pipe_screen *screen; - winsys = CALLOC_STRUCT(llvmpipe_winsys); + winsys = gdi_create_sw_winsys(); if(!winsys) goto no_winsys; - winsys->destroy = gdi_llvmpipe_destroy; - winsys->is_displaytarget_format_supported = gdi_llvmpipe_is_displaytarget_format_supported; - winsys->displaytarget_create = gdi_llvmpipe_displaytarget_create; - winsys->displaytarget_map = gdi_llvmpipe_displaytarget_map; - winsys->displaytarget_unmap = gdi_llvmpipe_displaytarget_unmap; - winsys->displaytarget_display = gdi_llvmpipe_displaytarget_display; - winsys->displaytarget_destroy = gdi_llvmpipe_displaytarget_destroy; - screen = llvmpipe_create_screen(winsys); if(!screen) goto no_screen; diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index 71360e55aa..56e84fd066 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2008 Tungsten Graphics, Inc., Bismarck, ND., USA + * Copyright 2009 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -28,257 +28,58 @@ /** * @file - * Softpipe support. + * LLVMpipe support. * - * @author Keith Whitwell - * @author Brian Paul - * @author Jose Fonseca + * @author Jose Fonseca */ #include -#include "util/u_simple_screen.h" -#include "pipe/p_format.h" -#include "pipe/p_context.h" -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "softpipe/sp_winsys.h" +#include "gdi_winsys.h" #include "softpipe/sp_texture.h" -#include "stw_winsys.h" - - -struct gdi_softpipe_buffer -{ - struct pipe_buffer base; - boolean userBuffer; /** Is this a user-space buffer? */ - void *data; - void *mapped; -}; - - -/** Cast wrapper */ -static INLINE struct gdi_softpipe_buffer * -gdi_softpipe_buffer( struct pipe_buffer *buf ) -{ - return (struct gdi_softpipe_buffer *)buf; -} - - -static void * -gdi_softpipe_buffer_map(struct pipe_winsys *winsys, - struct pipe_buffer *buf, - unsigned flags) -{ - struct gdi_softpipe_buffer *gdi_softpipe_buf = gdi_softpipe_buffer(buf); - gdi_softpipe_buf->mapped = gdi_softpipe_buf->data; - return gdi_softpipe_buf->mapped; -} - - -static void -gdi_softpipe_buffer_unmap(struct pipe_winsys *winsys, - struct pipe_buffer *buf) -{ - struct gdi_softpipe_buffer *gdi_softpipe_buf = gdi_softpipe_buffer(buf); - gdi_softpipe_buf->mapped = NULL; -} - - -static void -gdi_softpipe_buffer_destroy(struct pipe_buffer *buf) -{ - struct gdi_softpipe_buffer *oldBuf = gdi_softpipe_buffer(buf); - - if (oldBuf->data) { - if (!oldBuf->userBuffer) - align_free(oldBuf->data); - - oldBuf->data = NULL; - } - - FREE(oldBuf); -} - - -static const char * -gdi_softpipe_get_name(struct pipe_winsys *winsys) -{ - return "softpipe"; -} - - -static struct pipe_buffer * -gdi_softpipe_buffer_create(struct pipe_winsys *winsys, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct gdi_softpipe_buffer *buffer = CALLOC_STRUCT(gdi_softpipe_buffer); - - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.alignment = alignment; - buffer->base.usage = usage; - buffer->base.size = size; - - buffer->data = align_malloc(size, alignment); - - return &buffer->base; -} - - -/** - * Create buffer which wraps user-space data. - */ -static struct pipe_buffer * -gdi_softpipe_user_buffer_create(struct pipe_winsys *winsys, - void *ptr, - unsigned bytes) -{ - struct gdi_softpipe_buffer *buffer; - - buffer = CALLOC_STRUCT(gdi_softpipe_buffer); - if(!buffer) - return NULL; - - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.size = bytes; - buffer->userBuffer = TRUE; - buffer->data = ptr; - - return &buffer->base; -} - - -static struct pipe_buffer * -gdi_softpipe_surface_buffer_create(struct pipe_winsys *winsys, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride) -{ - const unsigned alignment = 64; - unsigned nblocksy; - - nblocksy = util_format_get_nblocksy(format, height); - *stride = align(util_format_get_stride(format, width), alignment); - - return winsys->buffer_create(winsys, alignment, - usage, - *stride * nblocksy); -} - - -static void -gdi_softpipe_dummy_flush_frontbuffer(struct pipe_winsys *winsys, - struct pipe_surface *surface, - void *context_private) -{ - assert(0); -} - - -static void -gdi_softpipe_fence_reference(struct pipe_winsys *winsys, - struct pipe_fence_handle **ptr, - struct pipe_fence_handle *fence) -{ -} - - -static int -gdi_softpipe_fence_signalled(struct pipe_winsys *winsys, - struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - -static int -gdi_softpipe_fence_finish(struct pipe_winsys *winsys, - struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - -static void -gdi_softpipe_destroy(struct pipe_winsys *winsys) -{ - FREE(winsys); -} static struct pipe_screen * gdi_softpipe_screen_create(void) { - static struct pipe_winsys *winsys; + static struct softpipe_winsys *winsys; struct pipe_screen *screen; - winsys = CALLOC_STRUCT(pipe_winsys); + winsys = gdi_create_sw_winsys(); if(!winsys) - return NULL; - - winsys->destroy = gdi_softpipe_destroy; - - winsys->buffer_create = gdi_softpipe_buffer_create; - winsys->user_buffer_create = gdi_softpipe_user_buffer_create; - winsys->buffer_map = gdi_softpipe_buffer_map; - winsys->buffer_unmap = gdi_softpipe_buffer_unmap; - winsys->buffer_destroy = gdi_softpipe_buffer_destroy; - - winsys->surface_buffer_create = gdi_softpipe_surface_buffer_create; - - winsys->fence_reference = gdi_softpipe_fence_reference; - winsys->fence_signalled = gdi_softpipe_fence_signalled; - winsys->fence_finish = gdi_softpipe_fence_finish; - - winsys->flush_frontbuffer = gdi_softpipe_dummy_flush_frontbuffer; - winsys->get_name = gdi_softpipe_get_name; + goto no_winsys; screen = softpipe_create_screen(winsys); if(!screen) - gdi_softpipe_destroy(winsys); + goto no_screen; return screen; + +no_screen: + FREE(winsys); +no_winsys: + return NULL; } + + static void gdi_softpipe_present(struct pipe_screen *screen, struct pipe_surface *surface, HDC hDC) { struct softpipe_texture *texture; - struct gdi_softpipe_buffer *buffer; - BITMAPINFO bmi; + struct gdi_softpipe_displaytarget *gdt; texture = softpipe_texture(surface->texture); - - buffer = gdi_softpipe_buffer(texture->buffer); - - memset(&bmi, 0, sizeof(BITMAPINFO)); - bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmi.bmiHeader.biWidth = texture->stride[surface->level] / util_format_get_blocksize(surface->format); - bmi.bmiHeader.biHeight= -(long)surface->height; - bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = util_format_get_blocksizebits(surface->format); - bmi.bmiHeader.biCompression = BI_RGB; - bmi.bmiHeader.biSizeImage = 0; - bmi.bmiHeader.biXPelsPerMeter = 0; - bmi.bmiHeader.biYPelsPerMeter = 0; - bmi.bmiHeader.biClrUsed = 0; - bmi.bmiHeader.biClrImportant = 0; + gdt = gdi_softpipe_displaytarget(texture->dt); StretchDIBits(hDC, - 0, 0, surface->width, surface->height, - 0, 0, surface->width, surface->height, - buffer->data, &bmi, 0, SRCCOPY); + 0, 0, gdt->width, gdt->height, + 0, 0, gdt->width, gdt->height, + gdt->data, &gdt->bmi, 0, SRCCOPY); } diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 824c666ae3..129300423a 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -29,6 +29,7 @@ DEFINES += \ XLIB_WINSYS_SOURCES = \ xlib.c \ xlib_cell.c \ + xlib_sw_winsys.c \ xlib_llvmpipe.c \ xlib_softpipe.c diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index 8c9d318af2..92e508ee50 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -36,7 +36,7 @@ drivers = [trace] if 'softpipe' in env['drivers']: env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') - sources += ['xlib_softpipe.c'] + sources += ['xlib_softpipe.c', 'xlib_sw_winsys.c'] drivers += [softpipe] if 'llvmpipe' in env['drivers']: @@ -44,7 +44,7 @@ if 'llvmpipe' in env['drivers']: if 'LLVM_VERSION' in env: env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') env.Tool('udis86') - sources += ['xlib_llvmpipe.c'] + sources += ['xlib_llvmpipe.c', 'xlib_sw_winsys.c'] drivers += [llvmpipe] if 'cell' in env['drivers']: diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c index 67617a470d..9b91c980d1 100644 --- a/src/gallium/winsys/xlib/xlib.c +++ b/src/gallium/winsys/xlib/xlib.c @@ -33,9 +33,7 @@ #include "xlib.h" #include "xm_winsys.h" - -#include -#include +#include "util/u_debug.h" /* Todo, replace all this with callback-structs provided by the * individual implementations. diff --git a/src/gallium/winsys/xlib/xlib.h b/src/gallium/winsys/xlib/xlib.h index 8e091d0c08..7f9f910b88 100644 --- a/src/gallium/winsys/xlib/xlib.h +++ b/src/gallium/winsys/xlib/xlib.h @@ -9,5 +9,12 @@ extern struct xm_driver xlib_softpipe_driver; extern struct xm_driver xlib_llvmpipe_driver; extern struct xm_driver xlib_cell_driver; +/* Internal: + */ +struct sw_winsys; +struct sw_displaytarget; +struct sw_winsys *xlib_create_sw_winsys( void ); +void xlib_sw_display(struct xmesa_buffer *xm_buffer, + struct sw_displaytarget *dt); #endif diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c index 6cebd4c201..9929ba52e7 100644 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c @@ -33,367 +33,16 @@ */ -#if defined(GALLIUM_LLVMPIPE) - -#include "xm_api.h" -#undef ASSERT -#undef Elements - -#include "util/u_simple_screen.h" -#include "pipe/p_format.h" -#include "pipe/p_context.h" -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "llvmpipe/lp_winsys.h" -#include "llvmpipe/lp_texture.h" #include "xlib.h" -/** - * Subclass of pipe_buffer for Xlib winsys. - * Low-level OS/window system memory buffer - */ -struct xm_displaytarget -{ - enum pipe_format format; - unsigned width; - unsigned height; - unsigned stride; - - void *data; - void *mapped; - - XImage *tempImage; -#ifdef USE_XSHM - int shm; - XShmSegmentInfo shminfo; -#endif -}; - - -/** - * Subclass of llvmpipe_winsys for Xlib winsys - */ -struct xmesa_llvmpipe_winsys -{ - struct llvmpipe_winsys base; -/* struct xmesa_visual *xm_visual; */ -}; - - - -/** Cast wrapper */ -static INLINE struct xm_displaytarget * -xm_displaytarget( struct llvmpipe_displaytarget *dt ) -{ - return (struct xm_displaytarget *)dt; -} - - -/** - * X Shared Memory Image extension code - */ - -#ifdef USE_XSHM - -static volatile int mesaXErrorFlag = 0; - -/** - * Catches potential Xlib errors. - */ -static int -mesaHandleXError(Display *dpy, XErrorEvent *event) -{ - (void) dpy; - (void) event; - mesaXErrorFlag = 1; - return 0; -} - - -static char *alloc_shm(struct xm_displaytarget *buf, unsigned size) -{ - XShmSegmentInfo *const shminfo = & buf->shminfo; - - shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777); - if (shminfo->shmid < 0) { - return NULL; - } - - shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0); - if (shminfo->shmaddr == (char *) -1) { - shmctl(shminfo->shmid, IPC_RMID, 0); - return NULL; - } - - shminfo->readOnly = False; - return shminfo->shmaddr; -} - - -/** - * Allocate a shared memory XImage back buffer for the given XMesaBuffer. - */ -static void -alloc_shm_ximage(struct xm_displaytarget *xm_buffer, - struct xmesa_buffer *xmb, - unsigned width, unsigned height) -{ - /* - * We have to do a _lot_ of error checking here to be sure we can - * really use the XSHM extension. It seems different servers trigger - * errors at different points if the extension won't work. Therefore - * we have to be very careful... - */ - int (*old_handler)(Display *, XErrorEvent *); - - xm_buffer->tempImage = XShmCreateImage(xmb->xm_visual->display, - xmb->xm_visual->visinfo->visual, - xmb->xm_visual->visinfo->depth, - ZPixmap, - NULL, - &xm_buffer->shminfo, - width, height); - if (xm_buffer->tempImage == NULL) { - xm_buffer->shm = 0; - return; - } - - - mesaXErrorFlag = 0; - old_handler = XSetErrorHandler(mesaHandleXError); - /* This may trigger the X protocol error we're ready to catch: */ - XShmAttach(xmb->xm_visual->display, &xm_buffer->shminfo); - XSync(xmb->xm_visual->display, False); - - if (mesaXErrorFlag) { - /* we are on a remote display, this error is normal, don't print it */ - XFlush(xmb->xm_visual->display); - mesaXErrorFlag = 0; - XDestroyImage(xm_buffer->tempImage); - xm_buffer->tempImage = NULL; - xm_buffer->shm = 0; - (void) XSetErrorHandler(old_handler); - return; - } - - xm_buffer->shm = 1; -} - -#endif /* USE_XSHM */ - -static boolean -xm_is_displaytarget_format_supported( struct llvmpipe_winsys *ws, - enum pipe_format format ) -{ - /* TODO: check visuals or other sensible thing here */ - return TRUE; -} - - -static void * -xm_displaytarget_map(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt, - unsigned flags) -{ - struct xm_displaytarget *xm_dt = xm_displaytarget(dt); - xm_dt->mapped = xm_dt->data; - return xm_dt->mapped; -} - -static void -xm_displaytarget_unmap(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt) -{ - struct xm_displaytarget *xm_dt = xm_displaytarget(dt); - xm_dt->mapped = NULL; -} - -static void -xm_displaytarget_destroy(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt) -{ - struct xm_displaytarget *xm_dt = xm_displaytarget(dt); - - if (xm_dt->data) { -#ifdef USE_XSHM - if (xm_dt->shminfo.shmid >= 0) { - shmdt(xm_dt->shminfo.shmaddr); - shmctl(xm_dt->shminfo.shmid, IPC_RMID, 0); - - xm_dt->shminfo.shmid = -1; - xm_dt->shminfo.shmaddr = (char *) -1; - } - else -#endif - FREE(xm_dt->data); - } - - FREE(xm_dt); -} - - -/** - * Display/copy the image in the surface into the X window specified - * by the XMesaBuffer. - */ -static void -xm_llvmpipe_display(struct xmesa_buffer *xm_buffer, - struct llvmpipe_displaytarget *dt) -{ - XImage *ximage; - struct xm_displaytarget *xm_dt = xm_displaytarget(dt); - static boolean no_swap = 0; - static boolean firsttime = 1; - - if (firsttime) { - no_swap = getenv("SP_NO_RAST") != NULL; - firsttime = 0; - } - - if (no_swap) - return; - -#ifdef USE_XSHM - if (xm_dt->shm) - { - if (xm_dt->tempImage == NULL) - { - assert(util_format_get_blockwidth(xm_dt->format) == 1); - assert(util_format_get_blockheight(xm_dt->format) == 1); - alloc_shm_ximage(xm_dt, xm_buffer, - xm_dt->stride / util_format_get_blocksize(xm_dt->format), - xm_dt->height); - } - - ximage = xm_dt->tempImage; - ximage->data = xm_dt->data; - - /* _debug_printf("XSHM\n"); */ - XShmPutImage(xm_buffer->xm_visual->display, xm_buffer->drawable, xm_buffer->gc, - ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height, False); - } - else -#endif - { - /* display image in Window */ - ximage = xm_dt->tempImage; - ximage->data = xm_dt->data; - - /* check that the XImage has been previously initialized */ - assert(ximage->format); - assert(ximage->bitmap_unit); - - /* update XImage's fields */ - ximage->width = xm_dt->width; - ximage->height = xm_dt->height; - ximage->bytes_per_line = xm_dt->stride; - - /* _debug_printf("XPUT\n"); */ - XPutImage(xm_buffer->xm_visual->display, xm_buffer->drawable, xm_buffer->gc, - ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height); - } -} - -/** - * Display/copy the image in the surface into the X window specified - * by the XMesaBuffer. - */ -static void -xm_displaytarget_display(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt, - void *context_private) -{ - XMesaContext xmctx = (XMesaContext) context_private; - struct xmesa_buffer *xm_buffer = xmctx->xm_buffer; - xm_llvmpipe_display(xm_buffer, dt); -} - -static struct llvmpipe_displaytarget * -xm_displaytarget_create(struct llvmpipe_winsys *winsys, - enum pipe_format format, - unsigned width, unsigned height, - unsigned alignment, - unsigned *stride) -{ - struct xm_displaytarget *xm_dt = CALLOC_STRUCT(xm_displaytarget); - unsigned nblocksy, size; - - xm_dt = CALLOC_STRUCT(xm_displaytarget); - if(!xm_dt) - goto no_xm_dt; - - xm_dt->format = format; - xm_dt->width = width; - xm_dt->height = height; - - nblocksy = util_format_get_nblocksy(format, height); - xm_dt->stride = align(util_format_get_stride(format, width), alignment); - size = xm_dt->stride * nblocksy; - -#ifdef USE_XSHM - if (!debug_get_bool_option("XLIB_NO_SHM", FALSE)) - { - xm_dt->shminfo.shmid = -1; - xm_dt->shminfo.shmaddr = (char *) -1; - xm_dt->shm = TRUE; - - xm_dt->data = alloc_shm(xm_dt, size); - if(!xm_dt->data) - goto no_data; - } -#endif - - if(!xm_dt->data) { - xm_dt->data = align_malloc(size, alignment); - if(!xm_dt->data) - goto no_data; - } - - *stride = xm_dt->stride; - return (struct llvmpipe_displaytarget *)xm_dt; - -no_data: - FREE(xm_dt); -no_xm_dt: - return NULL; -} - - -static void -xm_destroy( struct llvmpipe_winsys *ws ) -{ - FREE(ws); -} - - -static struct llvmpipe_winsys * -xlib_create_llvmpipe_winsys( void ) -{ - struct xmesa_llvmpipe_winsys *ws; - - ws = CALLOC_STRUCT(xmesa_llvmpipe_winsys); - if (!ws) - return NULL; - - ws->base.destroy = xm_destroy; - - ws->base.is_displaytarget_format_supported = xm_is_displaytarget_format_supported; - - ws->base.displaytarget_create = xm_displaytarget_create; - ws->base.displaytarget_map = xm_displaytarget_map; - ws->base.displaytarget_unmap = xm_displaytarget_unmap; - ws->base.displaytarget_destroy = xm_displaytarget_destroy; - - ws->base.displaytarget_display = xm_displaytarget_display; - - return &ws->base; -} +#if defined(GALLIUM_LLVMPIPE) +#include "llvmpipe/lp_texture.h" +#include "llvmpipe/lp_winsys.h" +#include "state_tracker/sw_winsys.h" static struct pipe_screen * xlib_create_llvmpipe_screen( void ) @@ -401,7 +50,7 @@ xlib_create_llvmpipe_screen( void ) struct llvmpipe_winsys *winsys; struct pipe_screen *screen; - winsys = xlib_create_llvmpipe_winsys(); + winsys = xlib_create_sw_winsys(); if (winsys == NULL) return NULL; @@ -427,7 +76,7 @@ xlib_llvmpipe_display_surface(struct xmesa_buffer *xm_buffer, assert(texture->dt); if (texture->dt) - xm_llvmpipe_display(xm_buffer, texture->dt); + xlib_sw_display(xm_buffer, texture->dt); } diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index 716338aef4..df93de551c 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -26,461 +26,19 @@ * **************************************************************************/ -/* - * Authors: - * Keith Whitwell - * Brian Paul - */ - - -#include "xm_api.h" - -#undef ASSERT -#undef Elements - -#include "util/u_simple_screen.h" -#include "pipe/p_format.h" -#include "pipe/p_context.h" -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "softpipe/sp_winsys.h" -#include "softpipe/sp_texture.h" #include "xlib.h" - -/** - * Subclass of pipe_buffer for Xlib winsys. - * Low-level OS/window system memory buffer - */ -struct xm_buffer -{ - struct pipe_buffer base; - boolean userBuffer; /** Is this a user-space buffer? */ - void *data; - void *mapped; - - XImage *tempImage; -#ifdef USE_XSHM - boolean shm; /** Is this a shared memory buffer? */ - XShmSegmentInfo shminfo; -#endif -}; - - -/** - * Subclass of pipe_winsys for Xlib winsys - */ -struct xmesa_pipe_winsys -{ - struct pipe_winsys base; -/* struct xmesa_visual *xm_visual; */ -}; - - - -/** Cast wrapper */ -static INLINE struct xm_buffer * -xm_buffer( struct pipe_buffer *buf ) -{ - return (struct xm_buffer *)buf; -} - - -/** - * X Shared Memory Image extension code - */ - -#ifdef USE_XSHM - -static volatile int mesaXErrorFlag = 0; - -/** - * Catches potential Xlib errors. - */ -static int -mesaHandleXError(Display *dpy, XErrorEvent *event) -{ - (void) dpy; - (void) event; - mesaXErrorFlag = 1; - return 0; -} - - -static char *alloc_shm(struct xm_buffer *buf, unsigned size) -{ - XShmSegmentInfo *const shminfo = & buf->shminfo; - - shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777); - if (shminfo->shmid < 0) { - return NULL; - } - - shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0); - if (shminfo->shmaddr == (char *) -1) { - shmctl(shminfo->shmid, IPC_RMID, 0); - return NULL; - } - - shminfo->readOnly = False; - return shminfo->shmaddr; -} - - -/** - * Allocate a shared memory XImage back buffer for the given XMesaBuffer. - */ -static void -alloc_shm_ximage(struct xm_buffer *b, struct xmesa_buffer *xmb, - unsigned width, unsigned height) -{ - /* - * We have to do a _lot_ of error checking here to be sure we can - * really use the XSHM extension. It seems different servers trigger - * errors at different points if the extension won't work. Therefore - * we have to be very careful... - */ - int (*old_handler)(Display *, XErrorEvent *); - - b->tempImage = XShmCreateImage(xmb->xm_visual->display, - xmb->xm_visual->visinfo->visual, - xmb->xm_visual->visinfo->depth, - ZPixmap, - NULL, - &b->shminfo, - width, height); - if (b->tempImage == NULL) { - b->shm = FALSE; - return; - } - - - mesaXErrorFlag = 0; - old_handler = XSetErrorHandler(mesaHandleXError); - /* This may trigger the X protocol error we're ready to catch: */ - XShmAttach(xmb->xm_visual->display, &b->shminfo); - XSync(xmb->xm_visual->display, False); - - if (mesaXErrorFlag) { - /* we are on a remote display, this error is normal, don't print it */ - XFlush(xmb->xm_visual->display); - mesaXErrorFlag = 0; - XDestroyImage(b->tempImage); - b->tempImage = NULL; - b->shm = FALSE; - (void) XSetErrorHandler(old_handler); - return; - } - - b->shm = TRUE; -} - -#endif /* USE_XSHM */ - - - -/* Most callbacks map direcly onto dri_bufmgr operations: - */ -static void * -xm_buffer_map(struct pipe_winsys *pws, struct pipe_buffer *buf, - unsigned flags) -{ - struct xm_buffer *xm_buf = xm_buffer(buf); - xm_buf->mapped = xm_buf->data; - return xm_buf->mapped; -} - -static void -xm_buffer_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf) -{ - struct xm_buffer *xm_buf = xm_buffer(buf); - xm_buf->mapped = NULL; -} - -static void -xm_buffer_destroy(struct pipe_buffer *buf) -{ - struct xm_buffer *oldBuf = xm_buffer(buf); - - /* - * Note oldBuf->data may point to one of three things: - * 1. XShm shared memory image data - * 2. User-provided (wrapped) memory, see xm_user_buffer_create() - * 3. Regular, malloc'd memory - * We need to be careful with freeing that data now. - */ - - if (oldBuf->data) { -#ifdef USE_XSHM - if (oldBuf->shminfo.shmid >= 0) { - shmdt(oldBuf->shminfo.shmaddr); - shmctl(oldBuf->shminfo.shmid, IPC_RMID, 0); - - oldBuf->shminfo.shmid = -1; - oldBuf->shminfo.shmaddr = (char *) -1; - } - - if (oldBuf->shm) { - oldBuf->data = NULL; - } - - if (oldBuf->tempImage) { - XDestroyImage(oldBuf->tempImage); - oldBuf->tempImage = NULL; - } -#endif - - if (oldBuf->data && !oldBuf->userBuffer) { - /* this was regular malloc'd memory */ - align_free(oldBuf->data); - } - - oldBuf->data = NULL; - } - - free(oldBuf); -} - - -/** - * Display/copy the image in the surface into the X window specified - * by the XMesaBuffer. - */ -static void -xlib_softpipe_display_surface(struct xmesa_buffer *b, - struct pipe_surface *surf) -{ - XImage *ximage; - struct softpipe_texture *spt = softpipe_texture(surf->texture); - struct xm_buffer *xm_buf = xm_buffer(spt->buffer); - static boolean no_swap = 0; - static boolean firsttime = 1; - - if (firsttime) { - no_swap = getenv("SP_NO_RAST") != NULL; - firsttime = 0; - } - - if (no_swap) - return; - -#ifdef USE_XSHM - if (xm_buf->shm) - { - if (xm_buf->tempImage == NULL) - { - assert(util_format_get_blockwidth(surf->texture->format) == 1); - assert(util_format_get_blockheight(surf->texture->format) == 1); - alloc_shm_ximage(xm_buf, b, spt->stride[surf->level] / - util_format_get_blocksize(surf->texture->format), surf->height); - } - - ximage = xm_buf->tempImage; - ximage->data = xm_buf->data; - - /* _debug_printf("XSHM\n"); */ - XShmPutImage(b->xm_visual->display, b->drawable, b->gc, - ximage, 0, 0, 0, 0, surf->width, surf->height, False); - } - else -#endif - { - /* display image in Window */ - ximage = b->tempImage; - ximage->data = xm_buf->data; - - /* check that the XImage has been previously initialized */ - assert(ximage->format); - assert(ximage->bitmap_unit); - - /* update XImage's fields */ - ximage->width = surf->width; - ximage->height = surf->height; - ximage->bytes_per_line = spt->stride[surf->level]; - - /* _debug_printf("XPUT\n"); */ - XPutImage(b->xm_visual->display, b->drawable, b->gc, - ximage, 0, 0, 0, 0, surf->width, surf->height); - } -} - - -static void -xm_flush_frontbuffer(struct pipe_winsys *pws, - struct pipe_surface *surf, - void *context_private) -{ - /* - * The front color buffer is actually just another XImage buffer. - * This function copies that XImage to the actual X Window. - */ - XMesaContext xmctx = (XMesaContext) context_private; - xlib_softpipe_display_surface(xmctx->xm_buffer, surf); - xmesa_check_and_update_buffer_size(xmctx, xmctx->xm_buffer); -} - - - -static const char * -xm_get_name(struct pipe_winsys *pws) -{ - return "Xlib"; -} - - -static struct pipe_buffer * -xm_buffer_create(struct pipe_winsys *pws, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer); - - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.alignment = alignment; - buffer->base.usage = usage; - buffer->base.size = size; - - /* align to 16-byte multiple for Cell */ - buffer->data = align_malloc(size, max(alignment, 16)); - - return &buffer->base; -} - - -/** - * Create buffer which wraps user-space data. - */ -static struct pipe_buffer * -xm_user_buffer_create(struct pipe_winsys *pws, void *ptr, unsigned bytes) -{ - struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer); - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.size = bytes; - buffer->userBuffer = TRUE; - buffer->data = ptr; - - return &buffer->base; -} - - -static struct pipe_buffer * -xm_surface_buffer_create(struct pipe_winsys *winsys, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride) -{ - const unsigned alignment = 64; - unsigned nblocksy, size; - - nblocksy = util_format_get_nblocksy(format, height); - *stride = align(util_format_get_stride(format, width), alignment); - size = *stride * nblocksy; - -#ifdef USE_XSHM - if (!debug_get_bool_option("XLIB_NO_SHM", FALSE)) - { - struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer); - - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.alignment = alignment; - buffer->base.usage = usage; - buffer->base.size = size; - buffer->userBuffer = FALSE; - buffer->shminfo.shmid = -1; - buffer->shminfo.shmaddr = (char *) -1; - buffer->shm = TRUE; - - buffer->data = alloc_shm(buffer, size); - if (!buffer->data) - goto out; - - return &buffer->base; - - out: - if (buffer) - FREE(buffer); - } -#endif - - - return winsys->buffer_create(winsys, alignment, - usage, - size); -} - - -/* - * Fence functions - basically nothing to do, as we don't create any actual - * fence objects. - */ - -static void -xm_fence_reference(struct pipe_winsys *sws, struct pipe_fence_handle **ptr, - struct pipe_fence_handle *fence) -{ -} - - -static int -xm_fence_signalled(struct pipe_winsys *sws, struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - -static int -xm_fence_finish(struct pipe_winsys *sws, struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - - -static struct pipe_winsys * -xlib_create_softpipe_winsys( void ) -{ - static struct xmesa_pipe_winsys *ws = NULL; - - if (!ws) { - ws = CALLOC_STRUCT(xmesa_pipe_winsys); - - /* Fill in this struct with callbacks that pipe will need to - * communicate with the window system, buffer manager, etc. - */ - ws->base.buffer_create = xm_buffer_create; - ws->base.user_buffer_create = xm_user_buffer_create; - ws->base.buffer_map = xm_buffer_map; - ws->base.buffer_unmap = xm_buffer_unmap; - ws->base.buffer_destroy = xm_buffer_destroy; - - ws->base.surface_buffer_create = xm_surface_buffer_create; - - ws->base.fence_reference = xm_fence_reference; - ws->base.fence_signalled = xm_fence_signalled; - ws->base.fence_finish = xm_fence_finish; - - ws->base.flush_frontbuffer = xm_flush_frontbuffer; - ws->base.get_name = xm_get_name; - } - - return &ws->base; -} - +#include "softpipe/sp_texture.h" +#include "softpipe/sp_screen.h" +#include "state_tracker/sw_winsys.h" static struct pipe_screen * xlib_create_softpipe_screen( void ) { - struct pipe_winsys *winsys; + struct sw_winsys *winsys; struct pipe_screen *screen; - winsys = xlib_create_softpipe_winsys(); + winsys = xlib_create_sw_winsys(); if (winsys == NULL) return NULL; @@ -498,6 +56,18 @@ fail: } +static void +xlib_softpipe_display_surface(struct xmesa_buffer *xm_buffer, + struct pipe_surface *surf) +{ + struct softpipe_texture *texture = softpipe_texture(surf->texture); + + assert(texture->dt); + if (texture->dt) + xlib_sw_display(xm_buffer, texture->dt); +} + + struct xm_driver xlib_softpipe_driver = { .create_pipe_screen = xlib_create_softpipe_screen, diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c new file mode 100644 index 0000000000..e4b02ba093 --- /dev/null +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -0,0 +1,394 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/* + * Authors: + * Keith Whitwell + * Brian Paul + */ + + + +#include "xm_api.h" + +#undef ASSERT +#undef Elements + +#include "pipe/p_format.h" +#include "pipe/p_context.h" +#include "util/u_inlines.h" +#include "util/u_format.h" +#include "util/u_math.h" +#include "util/u_memory.h" + +#include "state_tracker/sw_winsys.h" + +#include "xlib.h" + +/** + * Subclass of pipe_buffer for Xlib winsys. + * Low-level OS/window system memory buffer + */ +struct xm_displaytarget +{ + enum pipe_format format; + unsigned width; + unsigned height; + unsigned stride; + + void *data; + void *mapped; + + XImage *tempImage; +#ifdef USE_XSHM + int shm; + XShmSegmentInfo shminfo; +#endif +}; + + +/** + * Subclass of sw_winsys for Xlib winsys + */ +struct xmesa_sw_winsys +{ + struct sw_winsys base; +/* struct xmesa_visual *xm_visual; */ +}; + + + +/** Cast wrapper */ +static INLINE struct xm_displaytarget * +xm_displaytarget( struct sw_displaytarget *dt ) +{ + return (struct xm_displaytarget *)dt; +} + + +/** + * X Shared Memory Image extension code + */ + +#ifdef USE_XSHM + +static volatile int mesaXErrorFlag = 0; + +/** + * Catches potential Xlib errors. + */ +static int +mesaHandleXError(Display *dpy, XErrorEvent *event) +{ + (void) dpy; + (void) event; + mesaXErrorFlag = 1; + return 0; +} + + +static char *alloc_shm(struct xm_displaytarget *buf, unsigned size) +{ + XShmSegmentInfo *const shminfo = & buf->shminfo; + + shminfo->shmid = shmget(IPC_PRIVATE, size, IPC_CREAT|0777); + if (shminfo->shmid < 0) { + return NULL; + } + + shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0); + if (shminfo->shmaddr == (char *) -1) { + shmctl(shminfo->shmid, IPC_RMID, 0); + return NULL; + } + + shminfo->readOnly = False; + return shminfo->shmaddr; +} + + +/** + * Allocate a shared memory XImage back buffer for the given XMesaBuffer. + */ +static void +alloc_shm_ximage(struct xm_displaytarget *xm_buffer, + struct xmesa_buffer *xmb, + unsigned width, unsigned height) +{ + /* + * We have to do a _lot_ of error checking here to be sure we can + * really use the XSHM extension. It seems different servers trigger + * errors at different points if the extension won't work. Therefore + * we have to be very careful... + */ + int (*old_handler)(Display *, XErrorEvent *); + + xm_buffer->tempImage = XShmCreateImage(xmb->xm_visual->display, + xmb->xm_visual->visinfo->visual, + xmb->xm_visual->visinfo->depth, + ZPixmap, + NULL, + &xm_buffer->shminfo, + width, height); + if (xm_buffer->tempImage == NULL) { + xm_buffer->shm = 0; + return; + } + + + mesaXErrorFlag = 0; + old_handler = XSetErrorHandler(mesaHandleXError); + /* This may trigger the X protocol error we're ready to catch: */ + XShmAttach(xmb->xm_visual->display, &xm_buffer->shminfo); + XSync(xmb->xm_visual->display, False); + + if (mesaXErrorFlag) { + /* we are on a remote display, this error is normal, don't print it */ + XFlush(xmb->xm_visual->display); + mesaXErrorFlag = 0; + XDestroyImage(xm_buffer->tempImage); + xm_buffer->tempImage = NULL; + xm_buffer->shm = 0; + (void) XSetErrorHandler(old_handler); + return; + } + + xm_buffer->shm = 1; +} + +#endif /* USE_XSHM */ + +static boolean +xm_is_displaytarget_format_supported( struct sw_winsys *ws, + enum pipe_format format ) +{ + /* TODO: check visuals or other sensible thing here */ + return TRUE; +} + + +static void * +xm_displaytarget_map(struct sw_winsys *ws, + struct sw_displaytarget *dt, + unsigned flags) +{ + struct xm_displaytarget *xm_dt = xm_displaytarget(dt); + xm_dt->mapped = xm_dt->data; + return xm_dt->mapped; +} + +static void +xm_displaytarget_unmap(struct sw_winsys *ws, + struct sw_displaytarget *dt) +{ + struct xm_displaytarget *xm_dt = xm_displaytarget(dt); + xm_dt->mapped = NULL; +} + +static void +xm_displaytarget_destroy(struct sw_winsys *ws, + struct sw_displaytarget *dt) +{ + struct xm_displaytarget *xm_dt = xm_displaytarget(dt); + + if (xm_dt->data) { +#ifdef USE_XSHM + if (xm_dt->shminfo.shmid >= 0) { + shmdt(xm_dt->shminfo.shmaddr); + shmctl(xm_dt->shminfo.shmid, IPC_RMID, 0); + + xm_dt->shminfo.shmid = -1; + xm_dt->shminfo.shmaddr = (char *) -1; + } + else +#endif + FREE(xm_dt->data); + } + + FREE(xm_dt); +} + + +/** + * Display/copy the image in the surface into the X window specified + * by the XMesaBuffer. + */ +void +xlib_sw_display(struct xmesa_buffer *xm_buffer, + struct sw_displaytarget *dt) +{ + XImage *ximage; + struct xm_displaytarget *xm_dt = xm_displaytarget(dt); + static boolean no_swap = 0; + static boolean firsttime = 1; + + if (firsttime) { + no_swap = getenv("SP_NO_RAST") != NULL; + firsttime = 0; + } + + if (no_swap) + return; + +#ifdef USE_XSHM + if (xm_dt->shm) + { + if (xm_dt->tempImage == NULL) + { + assert(util_format_get_blockwidth(xm_dt->format) == 1); + assert(util_format_get_blockheight(xm_dt->format) == 1); + alloc_shm_ximage(xm_dt, xm_buffer, + xm_dt->stride / util_format_get_blocksize(xm_dt->format), + xm_dt->height); + } + + ximage = xm_dt->tempImage; + ximage->data = xm_dt->data; + + /* _debug_printf("XSHM\n"); */ + XShmPutImage(xm_buffer->xm_visual->display, xm_buffer->drawable, xm_buffer->gc, + ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height, False); + } + else +#endif + { + /* display image in Window */ + ximage = xm_dt->tempImage; + ximage->data = xm_dt->data; + + /* check that the XImage has been previously initialized */ + assert(ximage->format); + assert(ximage->bitmap_unit); + + /* update XImage's fields */ + ximage->width = xm_dt->width; + ximage->height = xm_dt->height; + ximage->bytes_per_line = xm_dt->stride; + + /* _debug_printf("XPUT\n"); */ + XPutImage(xm_buffer->xm_visual->display, xm_buffer->drawable, xm_buffer->gc, + ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height); + } +} + +/** + * Display/copy the image in the surface into the X window specified + * by the XMesaBuffer. + */ +static void +xm_displaytarget_display(struct sw_winsys *ws, + struct sw_displaytarget *dt, + void *context_private) +{ + XMesaContext xmctx = (XMesaContext) context_private; + struct xmesa_buffer *xm_buffer = xmctx->xm_buffer; + xm_sw_display(xm_buffer, dt); +} + + +static struct sw_displaytarget * +xm_displaytarget_create(struct sw_winsys *winsys, + enum pipe_format format, + unsigned width, unsigned height, + unsigned alignment, + unsigned *stride) +{ + struct xm_displaytarget *xm_dt = CALLOC_STRUCT(xm_displaytarget); + unsigned nblocksy, size; + + xm_dt = CALLOC_STRUCT(xm_displaytarget); + if(!xm_dt) + goto no_xm_dt; + + xm_dt->format = format; + xm_dt->width = width; + xm_dt->height = height; + + nblocksy = util_format_get_nblocksy(format, height); + xm_dt->stride = align(util_format_get_stride(format, width), alignment); + size = xm_dt->stride * nblocksy; + +#ifdef USE_XSHM + if (!debug_get_bool_option("XLIB_NO_SHM", FALSE)) + { + xm_dt->shminfo.shmid = -1; + xm_dt->shminfo.shmaddr = (char *) -1; + xm_dt->shm = TRUE; + + xm_dt->data = alloc_shm(xm_dt, size); + if(!xm_dt->data) + goto no_data; + } +#endif + + if(!xm_dt->data) { + xm_dt->data = align_malloc(size, alignment); + if(!xm_dt->data) + goto no_data; + } + + *stride = xm_dt->stride; + return (struct sw_displaytarget *)xm_dt; + +no_data: + FREE(xm_dt); +no_xm_dt: + return NULL; +} + + +static void +xm_destroy( struct sw_winsys *ws ) +{ + FREE(ws); +} + + +struct sw_winsys * +xlib_create_sw_winsys( void ) +{ + struct xmesa_sw_winsys *ws; + + ws = CALLOC_STRUCT(xmesa_sw_winsys); + if (!ws) + return NULL; + + ws->base.destroy = xm_destroy; + + ws->base.is_displaytarget_format_supported = xm_is_displaytarget_format_supported; + + ws->base.displaytarget_create = xm_displaytarget_create; + ws->base.displaytarget_map = xm_displaytarget_map; + ws->base.displaytarget_unmap = xm_displaytarget_unmap; + ws->base.displaytarget_destroy = xm_displaytarget_destroy; + + ws->base.displaytarget_display = xm_displaytarget_display; + + return &ws->base; +} + -- cgit v1.2.3 From 41d3fdc380655b701fab2537bdc7e254b6155286 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 3 Mar 2010 11:49:39 -0800 Subject: i915: Fix up i830 for tiled drawing offsets. Corresponds to b87406e55f029d29594ae76a4b39a4fe1007fe4f. --- src/mesa/drivers/dri/i915/i830_context.h | 3 ++- src/mesa/drivers/dri/i915/i830_vtbl.c | 43 +++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i830_context.h b/src/mesa/drivers/dri/i915/i830_context.h index b755d48678..d7eb9c2d44 100644 --- a/src/mesa/drivers/dri/i915/i830_context.h +++ b/src/mesa/drivers/dri/i915/i830_context.h @@ -34,7 +34,8 @@ #define I830_FALLBACK_COLORMASK 0x2000 #define I830_FALLBACK_STENCIL 0x4000 #define I830_FALLBACK_STIPPLE 0x8000 -#define I830_FALLBACK_LOGICOP 0x10000 +#define I830_FALLBACK_LOGICOP 0x20000 +#define I830_FALLBACK_DRAW_OFFSET 0x200000 #define I830_UPLOAD_CTX 0x1 #define I830_UPLOAD_BUFFERS 0x2 diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index a8df77c600..be96419ff1 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -496,15 +496,13 @@ i830_emit_state(struct intel_context *intel) OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR0]); OUT_BATCH(state->Buffer[I830_DESTREG_CBUFADDR1]); OUT_RELOC(state->draw_region->buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - state->draw_region->draw_offset); + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); if (state->depth_region) { OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR0]); OUT_BATCH(state->Buffer[I830_DESTREG_DBUFADDR1]); OUT_RELOC(state->depth_region->buffer, - I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - state->depth_region->draw_offset); + I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); } OUT_BATCH(state->Buffer[I830_DESTREG_DV0]); @@ -598,6 +596,7 @@ i830_set_draw_region(struct intel_context *intel, struct intel_renderbuffer *irb = intel_renderbuffer(rb); GLuint value; struct i830_hw_state *state = &i830->state; + uint32_t draw_x, draw_y; if (state->draw_region != color_regions[0]) { intel_region_release(&state->draw_region); @@ -652,14 +651,40 @@ i830_set_draw_region(struct intel_context *intel, } state->Buffer[I830_DESTREG_DV1] = value; + /* We set up the drawing rectangle to be offset into the color + * region's location in the miptree. If it doesn't match with + * depth's offsets, we can't render to it. + * + * (Well, not actually true -- the hw grew a bit to let depth's + * offset get forced to 0,0. We may want to use that if people are + * hitting that case. Also, some configurations may be supportable + * by tweaking the start offset of the buffers around, which we + * can't do in general due to tiling) + */ + FALLBACK(intel, I830_FALLBACK_DRAW_OFFSET, + (depth_region && color_regions[0]) && + (depth_region->draw_x != color_regions[0]->draw_x || + depth_region->draw_y != color_regions[0]->draw_y)); + + if (color_regions[0]) { + draw_x = color_regions[0]->draw_x; + draw_y = color_regions[0]->draw_y; + } else if (depth_region) { + draw_x = depth_region->draw_x; + draw_y = depth_region->draw_y; + } else { + draw_x = 0; + draw_y = 0; + } + state->Buffer[I830_DESTREG_DRAWRECT0] = _3DSTATE_DRAWRECT_INFO; state->Buffer[I830_DESTREG_DRAWRECT1] = 0; - state->Buffer[I830_DESTREG_DRAWRECT2] = 0; /* xmin, ymin */ + state->Buffer[I830_DESTREG_DRAWRECT2] = (draw_y << 16) | draw_x; state->Buffer[I830_DESTREG_DRAWRECT3] = - (ctx->DrawBuffer->Width & 0xffff) | - (ctx->DrawBuffer->Height << 16); - state->Buffer[I830_DESTREG_DRAWRECT4] = 0; /* xoff, yoff */ - state->Buffer[I830_DESTREG_DRAWRECT5] = 0; + ((ctx->DrawBuffer->Width + draw_x) & 0xffff) | + ((ctx->DrawBuffer->Height + draw_y) << 16); + state->Buffer[I830_DESTREG_DRAWRECT4] = (draw_y << 16) | draw_x; + state->Buffer[I830_DESTREG_DRAWRECT5] = MI_NOOP; I830_STATECHANGE(i830, I830_UPLOAD_BUFFERS); } -- cgit v1.2.3 From 8e7a8d65931a650534e0f5c4e0d8118cd6f7636e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 3 Mar 2010 11:51:51 -0800 Subject: i915: Enable texture tiling by default. This now passes piglit testcases, and shows performance improvements on openarena. Blit-heavy apps may see degradation, but the expectation is that the common case of 3D rendering will see significant wins. This regresses gen-teximage on my 855, and no piglit tests on my 945. --- src/mesa/drivers/dri/intel/intel_screen.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index a42af71104..959ccfb8b1 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -47,9 +47,6 @@ #include "i915_drm.h" #define DRI_CONF_TEXTURE_TILING(def) \ - DRI_CONF_OPT_BEGIN(texture_tiling, bool, def) \ - DRI_CONF_DESC(en, "Enable texture tiling") \ - DRI_CONF_OPT_END \ PUBLIC const char __driConfigOptions[] = DRI_CONF_BEGIN @@ -65,11 +62,9 @@ PUBLIC const char __driConfigOptions[] = DRI_CONF_DESC_END DRI_CONF_OPT_END -#ifdef I915 - DRI_CONF_TEXTURE_TILING(false) -#else - DRI_CONF_TEXTURE_TILING(true) -#endif + DRI_CONF_OPT_BEGIN(texture_tiling, bool, true) + DRI_CONF_DESC(en, "Enable texture tiling") + DRI_CONF_OPT_END DRI_CONF_OPT_BEGIN(early_z, bool, false) DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).") -- cgit v1.2.3 From 23e951d0da5802fec70996e46ad6f0abc411594c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 4 Mar 2010 16:23:05 +0000 Subject: gallium: fix llvmpipe after winsys move --- src/gallium/drivers/llvmpipe/lp_buffer.c | 2 +- src/gallium/drivers/llvmpipe/lp_screen.c | 3 ++- src/gallium/drivers/llvmpipe/lp_screen.h | 3 +++ src/gallium/drivers/llvmpipe/lp_setup.c | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 2 +- src/gallium/winsys/xlib/xlib_llvmpipe.c | 5 +++-- src/gallium/winsys/xlib/xlib_softpipe.c | 1 + 7 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_buffer.c b/src/gallium/drivers/llvmpipe/lp_buffer.c index 9eda972081..dab20cb639 100644 --- a/src/gallium/drivers/llvmpipe/lp_buffer.c +++ b/src/gallium/drivers/llvmpipe/lp_buffer.c @@ -30,10 +30,10 @@ #include "util/u_memory.h" #include "util/u_math.h" -#include "lp_winsys.h" #include "lp_screen.h" #include "lp_buffer.h" +#include "state_tracker/sw_winsys.h" static void * llvmpipe_buffer_map(struct pipe_screen *screen, diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 8816440a50..6759e39e01 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -34,12 +34,13 @@ #include "lp_texture.h" #include "lp_buffer.h" #include "lp_fence.h" -#include "lp_winsys.h" #include "lp_jit.h" #include "lp_screen.h" #include "lp_context.h" #include "lp_debug.h" +#include "state_tracker/sw_winsys.h" + #ifdef DEBUG int LP_DEBUG = 0; diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h index 3211822b53..0c86283605 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.h +++ b/src/gallium/drivers/llvmpipe/lp_screen.h @@ -76,4 +76,7 @@ llvmpipe_screen( struct pipe_screen *pipe ) } +struct pipe_screen * +llvmpipe_create_screen(struct sw_winsys *winsys); + #endif /* LP_SCREEN_H */ diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 72b19d0b05..fe60eb0437 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -46,7 +46,7 @@ #include "lp_rast.h" #include "lp_setup_context.h" #include "lp_screen.h" -#include "lp_winsys.h" +#include "state_tracker/sw_winsys.h" #include "draw/draw_context.h" #include "draw/draw_vbuf.h" diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index aed9ed6175..ac3d62dc96 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -42,7 +42,7 @@ #include "lp_screen.h" #include "lp_texture.h" #include "lp_tile_size.h" -#include "lp_winsys.h" +#include "state_tracker/sw_winsys.h" /** diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c index 9929ba52e7..cb559f9080 100644 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c @@ -41,13 +41,14 @@ #if defined(GALLIUM_LLVMPIPE) #include "llvmpipe/lp_texture.h" -#include "llvmpipe/lp_winsys.h" +#include "llvmpipe/lp_screen.h" #include "state_tracker/sw_winsys.h" +#include "util/u_debug.h" static struct pipe_screen * xlib_create_llvmpipe_screen( void ) { - struct llvmpipe_winsys *winsys; + struct sw_winsys *winsys; struct pipe_screen *screen; winsys = xlib_create_sw_winsys(); diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index df93de551c..47fec4313b 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -31,6 +31,7 @@ #include "softpipe/sp_texture.h" #include "softpipe/sp_screen.h" #include "state_tracker/sw_winsys.h" +#include "util/u_debug.h" static struct pipe_screen * xlib_create_softpipe_screen( void ) -- cgit v1.2.3 From c549593931ef08bb48e601189fa97c86b5e780b2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 4 Mar 2010 16:33:45 +0000 Subject: gallium: remove redundant includes --- src/gallium/drivers/cell/ppu/cell_context.c | 1 - src/gallium/drivers/cell/ppu/cell_draw_arrays.c | 1 - src/gallium/drivers/cell/ppu/cell_screen.c | 1 - src/gallium/drivers/cell/ppu/cell_state_shader.c | 1 - src/gallium/drivers/cell/ppu/cell_texture.c | 1 - src/gallium/drivers/cell/ppu/cell_vertex_shader.c | 1 - src/gallium/drivers/failover/fo_context.c | 1 - src/gallium/drivers/i915/i915_debug_fp.c | 1 - src/gallium/drivers/softpipe/sp_draw_arrays.c | 1 - src/gallium/drivers/softpipe/sp_screen.c | 2 -- 10 files changed, 11 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c index 5bff9869fd..4751ca8957 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.c +++ b/src/gallium/drivers/cell/ppu/cell_context.c @@ -36,7 +36,6 @@ #include "pipe/p_defines.h" #include "pipe/p_format.h" #include "util/u_memory.h" -#include "util/u_simple_screen.h" #include "pipe/p_screen.h" #include "draw/draw_context.h" diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index bffd0fac6f..db28c26ca8 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -33,7 +33,6 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" -#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "cell_context.h" diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index a43f8638dc..77bd849a15 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -28,7 +28,6 @@ #include "util/u_memory.h" #include "util/u_simple_screen.h" -#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "pipe/p_screen.h" diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index 9b2f86fdfb..bc6127d7e7 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -28,7 +28,6 @@ #include "pipe/p_defines.h" #include "util/u_memory.h" #include "util/u_inlines.h" -#include "util/u_simple_screen.h" #include "draw/draw_context.h" #include "tgsi/tgsi_parse.h" diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index fad290dfa0..a5f426795d 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -34,7 +34,6 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "util/u_inlines.h" -#include "util/u_simple_screen.h" #include "util/u_format.h" #include "util/u_math.h" diff --git a/src/gallium/drivers/cell/ppu/cell_vertex_shader.c b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c index cf8cd41159..3d389d6ea3 100644 --- a/src/gallium/drivers/cell/ppu/cell_vertex_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_vertex_shader.c @@ -31,7 +31,6 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" -#include "util/u_simple_screen.h" #include "util/u_math.h" #include "cell_context.h" diff --git a/src/gallium/drivers/failover/fo_context.c b/src/gallium/drivers/failover/fo_context.c index 2ccc5d3e60..659e40cbf0 100644 --- a/src/gallium/drivers/failover/fo_context.c +++ b/src/gallium/drivers/failover/fo_context.c @@ -27,7 +27,6 @@ #include "pipe/p_defines.h" -#include "util/u_simple_screen.h" #include "util/u_memory.h" #include "pipe/p_context.h" diff --git a/src/gallium/drivers/i915/i915_debug_fp.c b/src/gallium/drivers/i915/i915_debug_fp.c index 066e7392d1..f41c51f299 100644 --- a/src/gallium/drivers/i915/i915_debug_fp.c +++ b/src/gallium/drivers/i915/i915_debug_fp.c @@ -28,7 +28,6 @@ #include "i915_reg.h" #include "i915_debug.h" -#include "util/u_simple_screen.h" #include "util/u_debug.h" diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 0899e1145a..7b77eb239f 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -33,7 +33,6 @@ #include "pipe/p_defines.h" #include "pipe/p_context.h" -#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "util/u_prim.h" diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 107631f6b5..9eb3ff6875 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -27,8 +27,6 @@ #include "util/u_memory.h" -#include "util/u_simple_screen.h" -#include "util/u_simple_screen.h" #include "pipe/p_defines.h" #include "pipe/p_screen.h" -- cgit v1.2.3 From 3b6a991728ccb174f19de8b9752241cd4f21398e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 4 Mar 2010 16:50:22 +0000 Subject: softpipe: fix constant buffer tracking after rework --- src/gallium/drivers/softpipe/sp_state_fs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c index cd0e905bc9..2b089c2831 100644 --- a/src/gallium/drivers/softpipe/sp_state_fs.c +++ b/src/gallium/drivers/softpipe/sp_state_fs.c @@ -176,19 +176,17 @@ softpipe_set_constant_buffer(struct pipe_context *pipe, assert(shader < PIPE_SHADER_TYPES); assert(index == 0); - if(softpipe->constants[shader][index] == constants) - return; - draw_flush(softpipe->draw); /* note: reference counting */ pipe_buffer_reference(&softpipe->constants[shader][index], constants); if(shader == PIPE_SHADER_VERTEX) { - draw_set_mapped_constant_buffer(softpipe->draw, PIPE_SHADER_VERTEX, 0, + draw_set_mapped_constant_buffer(softpipe->draw, PIPE_SHADER_VERTEX, index, data, size); } + softpipe->mapped_constants[shader][index] = data; softpipe->dirty |= SP_NEW_CONSTANTS; } -- cgit v1.2.3 From 38110fd1c3a6c57d1ff089d546a3456ca1a78da8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Feb 2010 17:44:10 -0700 Subject: gallivm: clarify unsigned vs. signed integer type construction The lp_int_type() function was creating an unsigned type. So rename that function to lp_uint_type() and create new lp_int_type() that creates a signed type. --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 38 +++++++++++------------ src/gallium/auxiliary/gallivm/lp_bld_type.c | 20 ++++++++++++ src/gallium/auxiliary/gallivm/lp_bld_type.h | 4 +++ 3 files changed, 43 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index e268862282..64698c660e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -70,8 +70,8 @@ struct lp_build_sample_context struct lp_build_context coord_bld; /** Integer coordinates */ - struct lp_type int_coord_type; - struct lp_build_context int_coord_bld; + struct lp_type uint_coord_type; + struct lp_build_context uint_coord_bld; /** Output texels type and build context */ struct lp_type texel_type; @@ -90,7 +90,7 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, LLVMValueRef offset; LLVMValueRef packed; - offset = lp_build_sample_offset(&bld->int_coord_bld, + offset = lp_build_sample_offset(&bld->uint_coord_bld, bld->format_desc, x, y, y_stride, data_ptr); @@ -121,7 +121,7 @@ lp_build_sample_packed(struct lp_build_sample_context *bld, { LLVMValueRef offset; - offset = lp_build_sample_offset(&bld->int_coord_bld, + offset = lp_build_sample_offset(&bld->uint_coord_bld, bld->format_desc, x, y, y_stride, data_ptr); @@ -145,10 +145,10 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld, boolean is_pot, unsigned wrap_mode) { - struct lp_build_context *int_coord_bld = &bld->int_coord_bld; + struct lp_build_context *uint_coord_bld = &bld->uint_coord_bld; LLVMValueRef length_minus_one; - length_minus_one = lp_build_sub(int_coord_bld, length, int_coord_bld->one); + length_minus_one = lp_build_sub(uint_coord_bld, length, uint_coord_bld->one); switch(wrap_mode) { case PIPE_TEX_WRAP_REPEAT: @@ -161,8 +161,8 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld, break; case PIPE_TEX_WRAP_CLAMP: - coord = lp_build_max(int_coord_bld, coord, int_coord_bld->zero); - coord = lp_build_min(int_coord_bld, coord, length_minus_one); + coord = lp_build_max(uint_coord_bld, coord, uint_coord_bld->zero); + coord = lp_build_min(uint_coord_bld, coord, length_minus_one); break; case PIPE_TEX_WRAP_CLAMP_TO_EDGE: @@ -174,8 +174,8 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld, /* FIXME */ _debug_printf("llvmpipe: failed to translate texture wrap mode %s\n", util_dump_tex_wrap(wrap_mode, TRUE)); - coord = lp_build_max(int_coord_bld, coord, int_coord_bld->zero); - coord = lp_build_min(int_coord_bld, coord, length_minus_one); + coord = lp_build_max(uint_coord_bld, coord, uint_coord_bld->zero); + coord = lp_build_min(uint_coord_bld, coord, length_minus_one); break; default: @@ -249,8 +249,8 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, x0 = lp_build_sample_wrap(bld, x0, width, bld->static_state->pot_width, bld->static_state->wrap_s); y0 = lp_build_sample_wrap(bld, y0, height, bld->static_state->pot_height, bld->static_state->wrap_t); - x1 = lp_build_add(&bld->int_coord_bld, x0, bld->int_coord_bld.one); - y1 = lp_build_add(&bld->int_coord_bld, y0, bld->int_coord_bld.one); + x1 = lp_build_add(&bld->uint_coord_bld, x0, bld->uint_coord_bld.one); + y1 = lp_build_add(&bld->uint_coord_bld, y0, bld->uint_coord_bld.one); x1 = lp_build_sample_wrap(bld, x1, width, bld->static_state->pot_width, bld->static_state->wrap_s); y1 = lp_build_sample_wrap(bld, y1, height, bld->static_state->pot_height, bld->static_state->wrap_t); @@ -358,8 +358,8 @@ lp_build_sample_2d_linear_aos(struct lp_build_sample_context *bld, x0 = lp_build_sample_wrap(bld, x0, width, bld->static_state->pot_width, bld->static_state->wrap_s); y0 = lp_build_sample_wrap(bld, y0, height, bld->static_state->pot_height, bld->static_state->wrap_t); - x1 = lp_build_add(&bld->int_coord_bld, x0, bld->int_coord_bld.one); - y1 = lp_build_add(&bld->int_coord_bld, y0, bld->int_coord_bld.one); + x1 = lp_build_add(&bld->uint_coord_bld, x0, bld->uint_coord_bld.one); + y1 = lp_build_add(&bld->uint_coord_bld, y0, bld->uint_coord_bld.one); x1 = lp_build_sample_wrap(bld, x1, width, bld->static_state->pot_width, bld->static_state->wrap_s); y1 = lp_build_sample_wrap(bld, y1, height, bld->static_state->pot_height, bld->static_state->wrap_t); @@ -545,10 +545,10 @@ lp_build_sample_soa(LLVMBuilderRef builder, bld.dynamic_state = dynamic_state; bld.format_desc = util_format_description(static_state->format); bld.coord_type = type; - bld.int_coord_type = lp_int_type(type); + bld.uint_coord_type = lp_uint_type(type); bld.texel_type = type; lp_build_context_init(&bld.coord_bld, builder, bld.coord_type); - lp_build_context_init(&bld.int_coord_bld, builder, bld.int_coord_type); + lp_build_context_init(&bld.uint_coord_bld, builder, bld.uint_coord_type); lp_build_context_init(&bld.texel_bld, builder, bld.texel_type); /* Get the dynamic state */ @@ -561,9 +561,9 @@ lp_build_sample_soa(LLVMBuilderRef builder, t = coords[1]; p = coords[2]; - width = lp_build_broadcast_scalar(&bld.int_coord_bld, width); - height = lp_build_broadcast_scalar(&bld.int_coord_bld, height); - stride = lp_build_broadcast_scalar(&bld.int_coord_bld, stride); + width = lp_build_broadcast_scalar(&bld.uint_coord_bld, width); + height = lp_build_broadcast_scalar(&bld.uint_coord_bld, height); + stride = lp_build_broadcast_scalar(&bld.uint_coord_bld, stride); if(static_state->target == PIPE_TEXTURE_1D) t = bld.coord_bld.zero; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.c b/src/gallium/auxiliary/gallivm/lp_bld_type.c index 8270cd057f..c327ba045a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_type.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_type.c @@ -178,6 +178,25 @@ lp_build_int32_vec4_type(void) } +/** + * Create unsigned integer type variation of given type. + */ +struct lp_type +lp_uint_type(struct lp_type type) +{ + struct lp_type res_type; + + memset(&res_type, 0, sizeof res_type); + res_type.width = type.width; + res_type.length = type.length; + + return res_type; +} + + +/** + * Create signed integer type variation of given type. + */ struct lp_type lp_int_type(struct lp_type type) { @@ -186,6 +205,7 @@ lp_int_type(struct lp_type type) memset(&res_type, 0, sizeof res_type); res_type.width = type.width; res_type.length = type.length; + res_type.sign = 1; return res_type; } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.h b/src/gallium/auxiliary/gallivm/lp_bld_type.h index 62ee05be4d..16946cc28a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_type.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_type.h @@ -256,6 +256,10 @@ LLVMTypeRef lp_build_int32_vec4_type(void); +struct lp_type +lp_uint_type(struct lp_type type); + + struct lp_type lp_int_type(struct lp_type type); -- cgit v1.2.3 From 7d230dae70e8caa67cc6bd7501f892d44c40a5d4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 08:36:26 -0700 Subject: gallivm: added lp_build_negate() --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 8 ++++++++ src/gallium/auxiliary/gallivm/lp_bld_arit.h | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index bbce31f9eb..f60a7a213a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -668,6 +668,14 @@ lp_build_abs(struct lp_build_context *bld, } +LLVMValueRef +lp_build_negate(struct lp_build_context *bld, + LLVMValueRef a) +{ + return LLVMBuildNeg(bld->builder, a, ""); +} + + LLVMValueRef lp_build_sgn(struct lp_build_context *bld, LLVMValueRef a) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.h b/src/gallium/auxiliary/gallivm/lp_bld_arit.h index da84b7ca02..2d19ec06b4 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.h @@ -116,6 +116,10 @@ LLVMValueRef lp_build_abs(struct lp_build_context *bld, LLVMValueRef a); +LLVMValueRef +lp_build_negate(struct lp_build_context *bld, + LLVMValueRef a); + LLVMValueRef lp_build_sgn(struct lp_build_context *bld, LLVMValueRef a); -- cgit v1.2.3 From 6464d81e779e8c05ef96c9e5dab4422ff1f25464 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 09:45:34 -0700 Subject: gallivm: added lp_build_set_sign() --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 35 +++++++++++++++++++++++++++++ src/gallium/auxiliary/gallivm/lp_bld_arit.h | 4 ++++ 2 files changed, 39 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index f60a7a213a..42ae9f6a22 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -717,6 +717,41 @@ lp_build_sgn(struct lp_build_context *bld, } +/** + * Set the sign of float vector 'a' according to 'sign'. + * If sign==0, return abs(a). + * If sign==1, return -abs(a); + * Other values for sign produce undefined results. + */ +LLVMValueRef +lp_build_set_sign(struct lp_build_context *bld, + LLVMValueRef a, LLVMValueRef sign) +{ + const struct lp_type type = bld->type; + LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); + LLVMTypeRef vec_type = lp_build_vec_type(type); + LLVMValueRef shift = lp_build_int_const_scalar(type, type.width - 1); + LLVMValueRef mask = lp_build_int_const_scalar(type, + ~((unsigned long long) 1 << (type.width - 1))); + LLVMValueRef val, res; + + assert(type.floating); + + /* val = reinterpret_cast(a) */ + val = LLVMBuildBitCast(bld->builder, a, int_vec_type, ""); + /* val = val & mask */ + val = LLVMBuildAnd(bld->builder, val, mask, ""); + /* sign = sign << shift */ + sign = LLVMBuildShl(bld->builder, sign, shift, ""); + /* res = val | sign */ + res = LLVMBuildOr(bld->builder, val, sign, ""); + /* res = reinterpret_cast(res) */ + res = LLVMBuildBitCast(bld->builder, res, vec_type, ""); + + return res; +} + + /** * Convert vector of int to vector of float. */ diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.h b/src/gallium/auxiliary/gallivm/lp_bld_arit.h index 2d19ec06b4..866349d8cb 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.h @@ -124,6 +124,10 @@ LLVMValueRef lp_build_sgn(struct lp_build_context *bld, LLVMValueRef a); +LLVMValueRef +lp_build_set_sign(struct lp_build_context *bld, + LLVMValueRef a, LLVMValueRef sign); + LLVMValueRef lp_build_int_to_float(struct lp_build_context *bld, LLVMValueRef a); -- cgit v1.2.3 From 516bad2272aa9bb3c85516e0023ddd2ed236dcef Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 10:50:26 -0700 Subject: gallivm: added lp_build_fract() --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 13 +++++++++++++ src/gallium/auxiliary/gallivm/lp_bld_arit.h | 4 ++++ 2 files changed, 17 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index 42ae9f6a22..32f9e5201c 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -899,6 +899,19 @@ lp_build_ceil(struct lp_build_context *bld, } +/** + * Return fractional part of 'a' computed as a - floor(f) + * Typically used in texture coord arithmetic. + */ +LLVMValueRef +lp_build_fract(struct lp_build_context *bld, + LLVMValueRef a) +{ + assert(bld->type.floating); + return lp_build_sub(bld, a, lp_build_floor(bld, a)); +} + + /** * Convert to integer, through whichever rounding method that's fastest, * typically truncating toward zero. diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.h b/src/gallium/auxiliary/gallivm/lp_bld_arit.h index 866349d8cb..55385e3a66 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.h @@ -148,6 +148,10 @@ LLVMValueRef lp_build_trunc(struct lp_build_context *bld, LLVMValueRef a); +LLVMValueRef +lp_build_fract(struct lp_build_context *bld, + LLVMValueRef a); + LLVMValueRef lp_build_ifloor(struct lp_build_context *bld, LLVMValueRef a); -- cgit v1.2.3 From 4c0c728b2a3c8ebee09ddacd1390be31b1a73e23 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 10:51:31 -0700 Subject: gallivm: rework and implement more texture wrap modes All the texture wrap modes are now implemented for linear and nearest sampling. However, texture border color is not yet supported so some wrap modes will produce int coords outside the texture bounds. We'll get garbage values insted of the texture border color for now. --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 508 +++++++++++++++++++--- 1 file changed, 448 insertions(+), 60 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 64698c660e..1ba139c6cd 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -69,10 +69,14 @@ struct lp_build_sample_context struct lp_type coord_type; struct lp_build_context coord_bld; - /** Integer coordinates */ + /** Unsigned integer coordinates */ struct lp_type uint_coord_type; struct lp_build_context uint_coord_bld; + /** Signed integer coordinates */ + struct lp_type int_coord_type; + struct lp_build_context int_coord_bld; + /** Output texels type and build context */ struct lp_type texel_type; struct lp_build_context texel_bld; @@ -138,14 +142,74 @@ lp_build_sample_packed(struct lp_build_sample_context *bld, } +/** + * Helper to compute the mirror function for the PIPE_WRAP_MIRROR modes. + */ +static LLVMValueRef +lp_build_coord_mirror(struct lp_build_sample_context *bld, + LLVMValueRef coord) +{ + struct lp_build_context *coord_bld = &bld->coord_bld; + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; + LLVMValueRef fract, flr, isOdd; + + /* fract = coord - floor(coord) */ + fract = lp_build_sub(coord_bld, coord, lp_build_floor(coord_bld, coord)); + + /* flr = ifloor(coord); */ + flr = lp_build_ifloor(coord_bld, coord); + + /* isOdd = flr & 1 */ + isOdd = LLVMBuildAnd(bld->builder, flr, int_coord_bld->one, ""); + + /* make coord positive or negative depending on isOdd */ + coord = lp_build_set_sign(coord_bld, fract, isOdd); + + /* convert isOdd to float */ + isOdd = lp_build_int_to_float(coord_bld, isOdd); + + /* add isOdd to coord */ + coord = lp_build_add(coord_bld, coord, isOdd); + + return coord; +} + + +/** + * We only support a few wrap modes in lp_build_sample_wrap_int() at this time. + * Return whether the given mode is supported by that function. + */ +static boolean +is_simple_wrap_mode(int mode) +{ + switch (mode) { + case PIPE_TEX_WRAP_REPEAT: + case PIPE_TEX_WRAP_CLAMP: + case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + return TRUE; + default: + return FALSE; + } +} + + +/** + * Build LLVM code for texture wrap mode, for scaled integer texcoords. + * \param coord the incoming texcoord (s,t,r or q) scaled to the texture size + * \param length the texture size along one dimension + * \param is_pot if TRUE, length is a power of two + * \param wrap_mode one of PIPE_TEX_WRAP_x + */ static LLVMValueRef -lp_build_sample_wrap(struct lp_build_sample_context *bld, - LLVMValueRef coord, - LLVMValueRef length, - boolean is_pot, - unsigned wrap_mode) +lp_build_sample_wrap_int(struct lp_build_sample_context *bld, + LLVMValueRef coord, + LLVMValueRef length, + boolean is_pot, + unsigned wrap_mode) { struct lp_build_context *uint_coord_bld = &bld->uint_coord_bld; + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; LLVMValueRef length_minus_one; length_minus_one = lp_build_sub(uint_coord_bld, length, uint_coord_bld->one); @@ -161,12 +225,12 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld, break; case PIPE_TEX_WRAP_CLAMP: - coord = lp_build_max(uint_coord_bld, coord, uint_coord_bld->zero); - coord = lp_build_min(uint_coord_bld, coord, length_minus_one); - break; - case PIPE_TEX_WRAP_CLAMP_TO_EDGE: case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + coord = lp_build_max(int_coord_bld, coord, int_coord_bld->zero); + coord = lp_build_min(int_coord_bld, coord, length_minus_one); + break; + case PIPE_TEX_WRAP_MIRROR_REPEAT: case PIPE_TEX_WRAP_MIRROR_CLAMP: case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: @@ -186,6 +250,332 @@ lp_build_sample_wrap(struct lp_build_sample_context *bld, } +/** + * Build LLVM code for texture wrap mode for linear filtering. + * \param x0_out returns first integer texcoord + * \param x1_out returns second integer texcoord + * \param weight_out returns linear interpolation weight + */ +static void +lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, + LLVMValueRef coord, + LLVMValueRef length, + boolean is_pot, + unsigned wrap_mode, + LLVMValueRef *x0_out, + LLVMValueRef *x1_out, + LLVMValueRef *weight_out) +{ + struct lp_build_context *coord_bld = &bld->coord_bld; + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; + struct lp_build_context *uint_coord_bld = &bld->uint_coord_bld; + LLVMValueRef two = lp_build_const_scalar(coord_bld->type, 2.0); + LLVMValueRef half = lp_build_const_scalar(coord_bld->type, 0.5); + LLVMValueRef length_f = lp_build_int_to_float(coord_bld, length); + LLVMValueRef length_minus_one; + LLVMValueRef length_f_minus_one; + LLVMValueRef coord0, coord1, weight; + + /* XXX check for normalized vs. unnormalized coords */ + + length_minus_one = lp_build_sub(uint_coord_bld, length, uint_coord_bld->one); + length_f_minus_one = lp_build_sub(coord_bld, length_f, coord_bld->one); + + switch(wrap_mode) { + case PIPE_TEX_WRAP_REPEAT: + /* mul by size and subtract 0.5 */ + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); + /* convert to int */ + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(uint_coord_bld, coord0, uint_coord_bld->one); + /* compute lerp weight */ + weight = lp_build_fract(coord_bld, coord); + /* repeat wrap */ + if (is_pot) { + coord0 = LLVMBuildAnd(bld->builder, coord0, length_minus_one, ""); + coord1 = LLVMBuildAnd(bld->builder, coord1, length_minus_one, ""); + } + else { + /* Signed remainder won't give the right results for negative + * dividends but unsigned remainder does.*/ + coord0 = LLVMBuildURem(bld->builder, coord0, length, ""); + coord1 = LLVMBuildURem(bld->builder, coord1, length, ""); + } + break; + + case PIPE_TEX_WRAP_CLAMP: + coord = lp_build_mul(coord_bld, coord, length_f); + weight = lp_build_fract(coord_bld, coord); + coord0 = lp_build_clamp(coord_bld, coord, coord_bld->zero, + length_f_minus_one); + coord1 = lp_build_add(coord_bld, coord, coord_bld->one); + coord1 = lp_build_clamp(coord_bld, coord1, coord_bld->zero, + length_f_minus_one); + coord0 = lp_build_ifloor(coord_bld, coord0); + coord1 = lp_build_ifloor(coord_bld, coord1); + break; + + case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + /* clamp to [0,1] */ + coord = lp_build_clamp(coord_bld, coord, coord_bld->zero, coord_bld->one); + /* mul by tex size and subtract 0.5 */ + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); + /* compute lerp weight */ + weight = lp_build_fract(coord_bld, coord); + /* coord0 = floor(coord); */ + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + /* coord0 = max(coord0, 0) */ + coord0 = lp_build_max(int_coord_bld, coord0, int_coord_bld->zero); + /* coord1 = min(coord1, length-1) */ + coord1 = lp_build_min(int_coord_bld, coord1, length_minus_one); + break; + + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + { + LLVMValueRef min, max; + /* min = -1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + min = lp_build_negate(coord_bld, min); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + /* scale coord to length (and sub 0.5?) */ + coord = lp_build_mul(coord_bld, coord, length_f); + /* compute lerp weight */ + weight = lp_build_fract(coord_bld, coord); + /* coord = clamp(coord, min, max) */ + coord = lp_build_clamp(coord_bld, coord, min, max); + /* convert to int */ + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + } + break; + + case PIPE_TEX_WRAP_MIRROR_REPEAT: + /* compute mirror function */ + coord = lp_build_coord_mirror(bld, coord); + + /* scale coord to length */ + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); + + /* compute lerp weight */ + weight = lp_build_fract(coord_bld, coord); + + /* convert to int coords */ + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + + /* coord0 = max(coord0, 0) */ + coord0 = lp_build_max(int_coord_bld, coord0, int_coord_bld->zero); + /* coord1 = min(coord1, length-1) */ + coord1 = lp_build_min(int_coord_bld, coord1, length_minus_one); + break; + + case PIPE_TEX_WRAP_MIRROR_CLAMP: + coord = lp_build_abs(coord_bld, coord); + coord = lp_build_mul(coord_bld, coord, length_f); + weight = lp_build_fract(coord_bld, coord); + coord = lp_build_clamp(coord_bld, coord, coord_bld->zero, length_f_minus_one); + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + break; + + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + { + LLVMValueRef min, max; + /* min = 1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + + coord = lp_build_abs(coord_bld, coord); + coord = lp_build_mul(coord_bld, coord, length_f); + weight = lp_build_fract(coord_bld, coord); + coord = lp_build_clamp(coord_bld, coord, min, max); + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + } + break; + + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + { + LLVMValueRef min, max; + /* min = -1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + min = lp_build_negate(coord_bld, min); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + + coord = lp_build_abs(coord_bld, coord); + coord = lp_build_mul(coord_bld, coord, length_f); + weight = lp_build_fract(coord_bld, coord); + coord = lp_build_clamp(coord_bld, coord, min, max); + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + } + break; + + default: + assert(0); + } + + *x0_out = coord0; + *x1_out = coord1; + *weight_out = weight; +} + + +/** + * Build LLVM code for texture wrap mode for nearest filtering. + * \param coord the incoming texcoord (nominally in [0,1]) + * \param length the texture size along one dimension, as int + * \param is_pot if TRUE, length is a power of two + * \param wrap_mode one of PIPE_TEX_WRAP_x + */ +static LLVMValueRef +lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, + LLVMValueRef coord, + LLVMValueRef length, + boolean is_pot, + unsigned wrap_mode) +{ + struct lp_build_context *coord_bld = &bld->coord_bld; + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; + struct lp_build_context *uint_coord_bld = &bld->uint_coord_bld; + LLVMValueRef two = lp_build_const_scalar(coord_bld->type, 2.0); + LLVMValueRef length_f = lp_build_int_to_float(coord_bld, length); + LLVMValueRef length_minus_one = lp_build_sub(uint_coord_bld, length, uint_coord_bld->one); + LLVMValueRef length_f_minus_one = lp_build_sub(coord_bld, length_f, coord_bld->one); + LLVMValueRef icoord; + + /* XXX check for normalized vs. unnormalized coords */ + + switch(wrap_mode) { + case PIPE_TEX_WRAP_REPEAT: + coord = lp_build_mul(coord_bld, coord, length_f); + icoord = lp_build_ifloor(coord_bld, coord); + if (is_pot) + icoord = LLVMBuildAnd(bld->builder, icoord, length_minus_one, ""); + else + /* Signed remainder won't give the right results for negative + * dividends but unsigned remainder does.*/ + icoord = LLVMBuildURem(bld->builder, icoord, length, ""); + break; + + case PIPE_TEX_WRAP_CLAMP: + /* mul by size */ + coord = lp_build_mul(coord_bld, coord, length_f); + /* floor */ + icoord = lp_build_ifloor(coord_bld, coord); + /* clamp to [0, size-1]. Note: int coord builder type */ + icoord = lp_build_clamp(int_coord_bld, icoord, int_coord_bld->zero, + length_minus_one); + break; + + case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + { + LLVMValueRef min, max; + /* min = 1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + /* scale coord to length */ + coord = lp_build_mul(coord_bld, coord, length_f); + /* coord = clamp(coord, min, max) */ + coord = lp_build_clamp(coord_bld, coord, min, max); + icoord = lp_build_ifloor(coord_bld, coord); + } + break; + + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + /* Note: this is the same as CLAMP_TO_EDGE, except min = -min */ + { + LLVMValueRef min, max; + /* min = -1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + min = lp_build_negate(coord_bld, min); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + /* scale coord to length */ + coord = lp_build_mul(coord_bld, coord, length_f); + /* coord = clamp(coord, min, max) */ + coord = lp_build_clamp(coord_bld, coord, min, max); + icoord = lp_build_ifloor(coord_bld, coord); + } + break; + + case PIPE_TEX_WRAP_MIRROR_REPEAT: + { + LLVMValueRef min, max; + /* min = 1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + + /* compute mirror function */ + coord = lp_build_coord_mirror(bld, coord); + + /* scale coord to length */ + coord = lp_build_mul(coord_bld, coord, length_f); + + /* coord = clamp(coord, min, max) */ + coord = lp_build_clamp(coord_bld, coord, min, max); + icoord = lp_build_ifloor(coord_bld, coord); + } + break; + + case PIPE_TEX_WRAP_MIRROR_CLAMP: + coord = lp_build_abs(coord_bld, coord); + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_clamp(coord_bld, coord, coord_bld->zero, length_f_minus_one); + icoord = lp_build_ifloor(coord_bld, coord); + break; + + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + { + LLVMValueRef min, max; + /* min = 1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + + coord = lp_build_abs(coord_bld, coord); + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_clamp(coord_bld, coord, min, max); + icoord = lp_build_ifloor(coord_bld, coord); + } + break; + + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + { + LLVMValueRef min, max; + /* min = 1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + min = lp_build_negate(coord_bld, min); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + + coord = lp_build_abs(coord_bld, coord); + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_clamp(coord_bld, coord, min, max); + icoord = lp_build_ifloor(coord_bld, coord); + } + break; + + default: + assert(0); + } + + return icoord; +} + + +/** + * Sample 2D texture with nearest filtering. + */ static void lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, LLVMValueRef s, @@ -196,16 +586,15 @@ lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, LLVMValueRef data_ptr, LLVMValueRef *texel) { - LLVMValueRef x; - LLVMValueRef y; + LLVMValueRef x, y; - x = lp_build_ifloor(&bld->coord_bld, s); - y = lp_build_ifloor(&bld->coord_bld, t); - lp_build_name(x, "tex.x.floor"); - lp_build_name(y, "tex.y.floor"); + x = lp_build_sample_wrap_nearest(bld, s, width, + bld->static_state->pot_width, + bld->static_state->wrap_s); + y = lp_build_sample_wrap_nearest(bld, t, height, + bld->static_state->pot_height, + bld->static_state->wrap_t); - x = lp_build_sample_wrap(bld, x, width, bld->static_state->pot_width, bld->static_state->wrap_s); - y = lp_build_sample_wrap(bld, y, height, bld->static_state->pot_height, bld->static_state->wrap_t); lp_build_name(x, "tex.x.wrapped"); lp_build_name(y, "tex.y.wrapped"); @@ -213,6 +602,9 @@ lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, } +/** + * Sample 2D texture with bilinear filtering. + */ static void lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, LLVMValueRef s, @@ -223,9 +615,6 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, LLVMValueRef data_ptr, LLVMValueRef *texel) { - LLVMValueRef half; - LLVMValueRef s_ipart; - LLVMValueRef t_ipart; LLVMValueRef s_fpart; LLVMValueRef t_fpart; LLVMValueRef x0, x1; @@ -233,27 +622,10 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, LLVMValueRef neighbors[2][2][4]; unsigned chan; - half = lp_build_const_scalar(bld->coord_type, 0.5); - s = lp_build_sub(&bld->coord_bld, s, half); - t = lp_build_sub(&bld->coord_bld, t, half); - - s_ipart = lp_build_floor(&bld->coord_bld, s); - t_ipart = lp_build_floor(&bld->coord_bld, t); - - s_fpart = lp_build_sub(&bld->coord_bld, s, s_ipart); - t_fpart = lp_build_sub(&bld->coord_bld, t, t_ipart); - - x0 = lp_build_itrunc(&bld->coord_bld, s_ipart); - y0 = lp_build_itrunc(&bld->coord_bld, t_ipart); - - x0 = lp_build_sample_wrap(bld, x0, width, bld->static_state->pot_width, bld->static_state->wrap_s); - y0 = lp_build_sample_wrap(bld, y0, height, bld->static_state->pot_height, bld->static_state->wrap_t); - - x1 = lp_build_add(&bld->uint_coord_bld, x0, bld->uint_coord_bld.one); - y1 = lp_build_add(&bld->uint_coord_bld, y0, bld->uint_coord_bld.one); - - x1 = lp_build_sample_wrap(bld, x1, width, bld->static_state->pot_width, bld->static_state->wrap_s); - y1 = lp_build_sample_wrap(bld, y1, height, bld->static_state->pot_height, bld->static_state->wrap_t); + lp_build_sample_wrap_linear(bld, s, width, bld->static_state->pot_width, + bld->static_state->wrap_s, &x0, &x1, &s_fpart); + lp_build_sample_wrap_linear(bld, t, height, bld->static_state->pot_height, + bld->static_state->wrap_t, &y0, &y1, &t_fpart); lp_build_sample_texel_soa(bld, x0, y0, stride, data_ptr, neighbors[0][0]); lp_build_sample_texel_soa(bld, x1, y0, stride, data_ptr, neighbors[0][1]); @@ -334,20 +706,33 @@ lp_build_sample_2d_linear_aos(struct lp_build_sample_context *bld, h16_vec_type = lp_build_vec_type(h16.type); u8n_vec_type = lp_build_vec_type(u8n.type); + if (bld->static_state->normalized_coords) { + LLVMTypeRef coord_vec_type = lp_build_vec_type(bld->coord_type); + LLVMValueRef fp_width = LLVMBuildSIToFP(bld->builder, width, coord_vec_type, ""); + LLVMValueRef fp_height = LLVMBuildSIToFP(bld->builder, height, coord_vec_type, ""); + s = lp_build_mul(&bld->coord_bld, s, fp_width); + t = lp_build_mul(&bld->coord_bld, t, fp_height); + } + + /* scale coords by 256 (8 fractional bits) */ s = lp_build_mul_imm(&bld->coord_bld, s, 256); t = lp_build_mul_imm(&bld->coord_bld, t, 256); + /* convert float to int */ s = LLVMBuildFPToSI(builder, s, i32_vec_type, ""); t = LLVMBuildFPToSI(builder, t, i32_vec_type, ""); + /* subtract 0.5 (add -128) */ i32_c128 = lp_build_int_const_scalar(i32.type, -128); s = LLVMBuildAdd(builder, s, i32_c128, ""); t = LLVMBuildAdd(builder, t, i32_c128, ""); + /* compute floor (shift right 8) */ i32_c8 = lp_build_int_const_scalar(i32.type, 8); s_ipart = LLVMBuildAShr(builder, s, i32_c8, ""); t_ipart = LLVMBuildAShr(builder, t, i32_c8, ""); + /* compute fractional part (AND with 0xff) */ i32_c255 = lp_build_int_const_scalar(i32.type, 255); s_fpart = LLVMBuildAnd(builder, s, i32_c255, ""); t_fpart = LLVMBuildAnd(builder, t, i32_c255, ""); @@ -355,14 +740,18 @@ lp_build_sample_2d_linear_aos(struct lp_build_sample_context *bld, x0 = s_ipart; y0 = t_ipart; - x0 = lp_build_sample_wrap(bld, x0, width, bld->static_state->pot_width, bld->static_state->wrap_s); - y0 = lp_build_sample_wrap(bld, y0, height, bld->static_state->pot_height, bld->static_state->wrap_t); + x1 = lp_build_add(&bld->int_coord_bld, x0, bld->int_coord_bld.one); + y1 = lp_build_add(&bld->int_coord_bld, y0, bld->int_coord_bld.one); - x1 = lp_build_add(&bld->uint_coord_bld, x0, bld->uint_coord_bld.one); - y1 = lp_build_add(&bld->uint_coord_bld, y0, bld->uint_coord_bld.one); + x0 = lp_build_sample_wrap_int(bld, x0, width, bld->static_state->pot_width, + bld->static_state->wrap_s); + y0 = lp_build_sample_wrap_int(bld, y0, height, bld->static_state->pot_height, + bld->static_state->wrap_t); - x1 = lp_build_sample_wrap(bld, x1, width, bld->static_state->pot_width, bld->static_state->wrap_s); - y1 = lp_build_sample_wrap(bld, y1, height, bld->static_state->pot_height, bld->static_state->wrap_t); + x1 = lp_build_sample_wrap_int(bld, x1, width, bld->static_state->pot_width, + bld->static_state->wrap_s); + y1 = lp_build_sample_wrap_int(bld, y1, height, bld->static_state->pot_height, + bld->static_state->wrap_t); /* * Transform 4 x i32 in @@ -546,9 +935,11 @@ lp_build_sample_soa(LLVMBuilderRef builder, bld.format_desc = util_format_description(static_state->format); bld.coord_type = type; bld.uint_coord_type = lp_uint_type(type); + bld.int_coord_type = lp_int_type(type); bld.texel_type = type; lp_build_context_init(&bld.coord_bld, builder, bld.coord_type); lp_build_context_init(&bld.uint_coord_bld, builder, bld.uint_coord_type); + lp_build_context_init(&bld.int_coord_bld, builder, bld.int_coord_type); lp_build_context_init(&bld.texel_bld, builder, bld.texel_type); /* Get the dynamic state */ @@ -568,23 +959,20 @@ lp_build_sample_soa(LLVMBuilderRef builder, if(static_state->target == PIPE_TEXTURE_1D) t = bld.coord_bld.zero; - if(static_state->normalized_coords) { - LLVMTypeRef coord_vec_type = lp_build_vec_type(bld.coord_type); - LLVMValueRef fp_width = LLVMBuildSIToFP(builder, width, coord_vec_type, ""); - LLVMValueRef fp_height = LLVMBuildSIToFP(builder, height, coord_vec_type, ""); - s = lp_build_mul(&bld.coord_bld, s, fp_width); - t = lp_build_mul(&bld.coord_bld, t, fp_height); - } - switch (static_state->min_img_filter) { case PIPE_TEX_FILTER_NEAREST: - lp_build_sample_2d_nearest_soa(&bld, s, t, width, height, stride, data_ptr, texel); + lp_build_sample_2d_nearest_soa(&bld, s, t, width, height, + stride, data_ptr, texel); break; case PIPE_TEX_FILTER_LINEAR: - if(lp_format_is_rgba8(bld.format_desc)) - lp_build_sample_2d_linear_aos(&bld, s, t, width, height, stride, data_ptr, texel); + if(lp_format_is_rgba8(bld.format_desc) && + is_simple_wrap_mode(static_state->wrap_s) && + is_simple_wrap_mode(static_state->wrap_t)) + lp_build_sample_2d_linear_aos(&bld, s, t, width, height, + stride, data_ptr, texel); else - lp_build_sample_2d_linear_soa(&bld, s, t, width, height, stride, data_ptr, texel); + lp_build_sample_2d_linear_soa(&bld, s, t, width, height, + stride, data_ptr, texel); break; default: assert(0); -- cgit v1.2.3 From e5c49e49cce6c14bc9e973dea4d69e0b7d36086d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 12 Nov 2009 10:12:56 +0000 Subject: APPLE_object_purgeable: xml Signed-off-by: Chris Wilson --- src/mesa/glapi/gen/APPLE_object_purgeable.xml | 37 +++++++++++++++++++++++++++ src/mesa/glapi/gen/Makefile | 1 + src/mesa/glapi/gen/gl_API.xml | 1 + 3 files changed, 39 insertions(+) create mode 100644 src/mesa/glapi/gen/APPLE_object_purgeable.xml (limited to 'src') diff --git a/src/mesa/glapi/gen/APPLE_object_purgeable.xml b/src/mesa/glapi/gen/APPLE_object_purgeable.xml new file mode 100644 index 0000000000..62fa64ad21 --- /dev/null +++ b/src/mesa/glapi/gen/APPLE_object_purgeable.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gen/Makefile b/src/mesa/glapi/gen/Makefile index 8e9c909f31..8aa74ce434 100644 --- a/src/mesa/glapi/gen/Makefile +++ b/src/mesa/glapi/gen/Makefile @@ -79,6 +79,7 @@ API_XML = \ ARB_seamless_cube_map.xml \ ARB_sync.xml \ ARB_vertex_array_object.xml \ + APPLE_object_purgeable.xml \ APPLE_vertex_array_object.xml \ EXT_draw_buffers2.xml \ EXT_framebuffer_object.xml \ diff --git a/src/mesa/glapi/gen/gl_API.xml b/src/mesa/glapi/gen/gl_API.xml index 0b3d57baa6..4a4d0d5382 100644 --- a/src/mesa/glapi/gen/gl_API.xml +++ b/src/mesa/glapi/gen/gl_API.xml @@ -11978,6 +11978,7 @@ + -- cgit v1.2.3 From 894d0ab9388543642b6940f09358844736a8bd3a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 12 Nov 2009 10:15:49 +0000 Subject: APPLE_object_purgeable: autogenerated files --- src/mesa/glapi/glapidispatch.h | 37 +- src/mesa/glapi/glapioffsets.h | 22 +- src/mesa/glapi/glapitable.h | 17 +- src/mesa/glapi/glapitemp.h | 44 +- src/mesa/glapi/glprocs.h | 640 ++--- src/mesa/main/enums.c | 6108 ++++++++++++++++++++-------------------- src/mesa/main/remap_helper.h | 3040 ++++++++++---------- src/mesa/sparc/glapi_sparc.S | 19 +- src/mesa/x86-64/glapi_x86-64.S | 195 +- src/mesa/x86/glapi_x86.S | 23 +- 10 files changed, 5182 insertions(+), 4963 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapidispatch.h b/src/mesa/glapi/glapidispatch.h index b7f661c535..7e0f21390f 100644 --- a/src/mesa/glapi/glapidispatch.h +++ b/src/mesa/glapi/glapidispatch.h @@ -2455,6 +2455,15 @@ #define CALL_TextureRangeAPPLE(disp, parameters) (*((disp)->TextureRangeAPPLE)) parameters #define GET_TextureRangeAPPLE(disp) ((disp)->TextureRangeAPPLE) #define SET_TextureRangeAPPLE(disp, fn) ((disp)->TextureRangeAPPLE = fn) +#define CALL_GetObjectParameterivAPPLE(disp, parameters) (*((disp)->GetObjectParameterivAPPLE)) parameters +#define GET_GetObjectParameterivAPPLE(disp) ((disp)->GetObjectParameterivAPPLE) +#define SET_GetObjectParameterivAPPLE(disp, fn) ((disp)->GetObjectParameterivAPPLE = fn) +#define CALL_ObjectPurgeableAPPLE(disp, parameters) (*((disp)->ObjectPurgeableAPPLE)) parameters +#define GET_ObjectPurgeableAPPLE(disp) ((disp)->ObjectPurgeableAPPLE) +#define SET_ObjectPurgeableAPPLE(disp, fn) ((disp)->ObjectPurgeableAPPLE = fn) +#define CALL_ObjectUnpurgeableAPPLE(disp, parameters) (*((disp)->ObjectUnpurgeableAPPLE)) parameters +#define GET_ObjectUnpurgeableAPPLE(disp) ((disp)->ObjectUnpurgeableAPPLE) +#define SET_ObjectUnpurgeableAPPLE(disp, fn) ((disp)->ObjectUnpurgeableAPPLE = fn) #define CALL_StencilFuncSeparateATI(disp, parameters) (*((disp)->StencilFuncSeparateATI)) parameters #define GET_StencilFuncSeparateATI(disp) ((disp)->StencilFuncSeparateATI) #define SET_StencilFuncSeparateATI(disp, fn) ((disp)->StencilFuncSeparateATI = fn) @@ -2479,7 +2488,7 @@ #else -#define driDispatchRemapTable_size 397 +#define driDispatchRemapTable_size 400 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define AttachShader_remap_index 0 @@ -2872,13 +2881,16 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define ProvokingVertexEXT_remap_index 387 #define GetTexParameterPointervAPPLE_remap_index 388 #define TextureRangeAPPLE_remap_index 389 -#define StencilFuncSeparateATI_remap_index 390 -#define ProgramEnvParameters4fvEXT_remap_index 391 -#define ProgramLocalParameters4fvEXT_remap_index 392 -#define GetQueryObjecti64vEXT_remap_index 393 -#define GetQueryObjectui64vEXT_remap_index 394 -#define EGLImageTargetRenderbufferStorageOES_remap_index 395 -#define EGLImageTargetTexture2DOES_remap_index 396 +#define GetObjectParameterivAPPLE_remap_index 390 +#define ObjectPurgeableAPPLE_remap_index 391 +#define ObjectUnpurgeableAPPLE_remap_index 392 +#define StencilFuncSeparateATI_remap_index 393 +#define ProgramEnvParameters4fvEXT_remap_index 394 +#define ProgramLocalParameters4fvEXT_remap_index 395 +#define GetQueryObjecti64vEXT_remap_index 396 +#define GetQueryObjectui64vEXT_remap_index 397 +#define EGLImageTargetRenderbufferStorageOES_remap_index 398 +#define EGLImageTargetTexture2DOES_remap_index 399 #define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) #define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) @@ -4050,6 +4062,15 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define CALL_TextureRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLvoid *)), driDispatchRemapTable[TextureRangeAPPLE_remap_index], parameters) #define GET_TextureRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index]) #define SET_TextureRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index], fn) +#define CALL_GetObjectParameterivAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLint *)), driDispatchRemapTable[GetObjectParameterivAPPLE_remap_index], parameters) +#define GET_GetObjectParameterivAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivAPPLE_remap_index]) +#define SET_GetObjectParameterivAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivAPPLE_remap_index], fn) +#define CALL_ObjectPurgeableAPPLE(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum, GLuint, GLenum)), driDispatchRemapTable[ObjectPurgeableAPPLE_remap_index], parameters) +#define GET_ObjectPurgeableAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[ObjectPurgeableAPPLE_remap_index]) +#define SET_ObjectPurgeableAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ObjectPurgeableAPPLE_remap_index], fn) +#define CALL_ObjectUnpurgeableAPPLE(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum, GLuint, GLenum)), driDispatchRemapTable[ObjectUnpurgeableAPPLE_remap_index], parameters) +#define GET_ObjectUnpurgeableAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[ObjectUnpurgeableAPPLE_remap_index]) +#define SET_ObjectUnpurgeableAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ObjectUnpurgeableAPPLE_remap_index], fn) #define CALL_StencilFuncSeparateATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparateATI_remap_index], parameters) #define GET_StencilFuncSeparateATI(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index]) #define SET_StencilFuncSeparateATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index], fn) diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index 8e16e22983..6d7bc2a0fa 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -832,14 +832,17 @@ #define _gloffset_ProvokingVertexEXT 795 #define _gloffset_GetTexParameterPointervAPPLE 796 #define _gloffset_TextureRangeAPPLE 797 -#define _gloffset_StencilFuncSeparateATI 798 -#define _gloffset_ProgramEnvParameters4fvEXT 799 -#define _gloffset_ProgramLocalParameters4fvEXT 800 -#define _gloffset_GetQueryObjecti64vEXT 801 -#define _gloffset_GetQueryObjectui64vEXT 802 -#define _gloffset_EGLImageTargetRenderbufferStorageOES 803 -#define _gloffset_EGLImageTargetTexture2DOES 804 -#define _gloffset_FIRST_DYNAMIC 805 +#define _gloffset_GetObjectParameterivAPPLE 798 +#define _gloffset_ObjectPurgeableAPPLE 799 +#define _gloffset_ObjectUnpurgeableAPPLE 800 +#define _gloffset_StencilFuncSeparateATI 801 +#define _gloffset_ProgramEnvParameters4fvEXT 802 +#define _gloffset_ProgramLocalParameters4fvEXT 803 +#define _gloffset_GetQueryObjecti64vEXT 804 +#define _gloffset_GetQueryObjectui64vEXT 805 +#define _gloffset_EGLImageTargetRenderbufferStorageOES 806 +#define _gloffset_EGLImageTargetTexture2DOES 807 +#define _gloffset_FIRST_DYNAMIC 808 #else @@ -1233,6 +1236,9 @@ #define _gloffset_ProvokingVertexEXT driDispatchRemapTable[ProvokingVertexEXT_remap_index] #define _gloffset_GetTexParameterPointervAPPLE driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index] #define _gloffset_TextureRangeAPPLE driDispatchRemapTable[TextureRangeAPPLE_remap_index] +#define _gloffset_GetObjectParameterivAPPLE driDispatchRemapTable[GetObjectParameterivAPPLE_remap_index] +#define _gloffset_ObjectPurgeableAPPLE driDispatchRemapTable[ObjectPurgeableAPPLE_remap_index] +#define _gloffset_ObjectUnpurgeableAPPLE driDispatchRemapTable[ObjectUnpurgeableAPPLE_remap_index] #define _gloffset_StencilFuncSeparateATI driDispatchRemapTable[StencilFuncSeparateATI_remap_index] #define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index] #define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index] diff --git a/src/mesa/glapi/glapitable.h b/src/mesa/glapi/glapitable.h index 8aeb450b99..149ff3f3c4 100644 --- a/src/mesa/glapi/glapitable.h +++ b/src/mesa/glapi/glapitable.h @@ -838,13 +838,16 @@ struct _glapi_table void (GLAPIENTRYP ProvokingVertexEXT)(GLenum mode); /* 795 */ void (GLAPIENTRYP GetTexParameterPointervAPPLE)(GLenum target, GLenum pname, GLvoid ** params); /* 796 */ void (GLAPIENTRYP TextureRangeAPPLE)(GLenum target, GLsizei length, GLvoid * pointer); /* 797 */ - void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 798 */ - void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 799 */ - void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 800 */ - void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 801 */ - void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 802 */ - void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 803 */ - void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 804 */ + void (GLAPIENTRYP GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint * value); /* 798 */ + GLenum (GLAPIENTRYP ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 799 */ + GLenum (GLAPIENTRYP ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option); /* 800 */ + void (GLAPIENTRYP StencilFuncSeparateATI)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); /* 801 */ + void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 802 */ + void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 803 */ + void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 804 */ + void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 805 */ + void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 806 */ + void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 807 */ }; #endif /* !defined( _GLAPI_TABLE_H_ ) */ diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 67c691c3fb..ea6b61159d 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -5577,37 +5577,52 @@ KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_797)(GLenum target, GLsizei lengt DISPATCH(TextureRangeAPPLE, (target, length, pointer), (F, "glTextureRangeAPPLE(0x%x, %d, %p);\n", target, length, (const void *) pointer)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_798)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +KEYWORD1 void KEYWORD2 NAME(GetObjectParameterivAPPLE)(GLenum objectType, GLuint name, GLenum pname, GLint * value) +{ + DISPATCH(GetObjectParameterivAPPLE, (objectType, name, pname, value), (F, "glGetObjectParameterivAPPLE(0x%x, %d, 0x%x, %p);\n", objectType, name, pname, (const void *) value)); +} + +KEYWORD1 GLenum KEYWORD2 NAME(ObjectPurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option) +{ + RETURN_DISPATCH(ObjectPurgeableAPPLE, (objectType, name, option), (F, "glObjectPurgeableAPPLE(0x%x, %d, 0x%x);\n", objectType, name, option)); +} + +KEYWORD1 GLenum KEYWORD2 NAME(ObjectUnpurgeableAPPLE)(GLenum objectType, GLuint name, GLenum option) +{ + RETURN_DISPATCH(ObjectUnpurgeableAPPLE, (objectType, name, option), (F, "glObjectUnpurgeableAPPLE(0x%x, %d, 0x%x);\n", objectType, name, option)); +} + +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_801)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_798)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_801)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) { DISPATCH(StencilFuncSeparateATI, (frontfunc, backfunc, ref, mask), (F, "glStencilFuncSeparateATI(0x%x, 0x%x, %d, %d);\n", frontfunc, backfunc, ref, mask)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_799)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_799)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramEnvParameters4fvEXT, (target, index, count, params), (F, "glProgramEnvParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_800)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_803)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_800)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_803)(GLenum target, GLuint index, GLsizei count, const GLfloat * params) { DISPATCH(ProgramLocalParameters4fvEXT, (target, index, count, params), (F, "glProgramLocalParameters4fvEXT(0x%x, %d, %d, %p);\n", target, index, count, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_801)(GLuint id, GLenum pname, GLint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_804)(GLuint id, GLenum pname, GLint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_801)(GLuint id, GLenum pname, GLint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_804)(GLuint id, GLenum pname, GLint64EXT * params) { DISPATCH(GetQueryObjecti64vEXT, (id, pname, params), (F, "glGetQueryObjecti64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLuint id, GLenum pname, GLuint64EXT * params); +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_805)(GLuint id, GLenum pname, GLuint64EXT * params); -KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_802)(GLuint id, GLenum pname, GLuint64EXT * params) +KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_805)(GLuint id, GLenum pname, GLuint64EXT * params) { DISPATCH(GetQueryObjectui64vEXT, (id, pname, params), (F, "glGetQueryObjectui64vEXT(%d, 0x%x, %p);\n", id, pname, (const void *) params)); } @@ -6573,11 +6588,14 @@ _glapi_proc DISPATCH_TABLE_NAME[] = { TABLE_ENTRY(ProvokingVertexEXT), TABLE_ENTRY(_dispatch_stub_796), TABLE_ENTRY(_dispatch_stub_797), - TABLE_ENTRY(_dispatch_stub_798), - TABLE_ENTRY(_dispatch_stub_799), - TABLE_ENTRY(_dispatch_stub_800), + TABLE_ENTRY(GetObjectParameterivAPPLE), + TABLE_ENTRY(ObjectPurgeableAPPLE), + TABLE_ENTRY(ObjectUnpurgeableAPPLE), TABLE_ENTRY(_dispatch_stub_801), TABLE_ENTRY(_dispatch_stub_802), + TABLE_ENTRY(_dispatch_stub_803), + TABLE_ENTRY(_dispatch_stub_804), + TABLE_ENTRY(_dispatch_stub_805), TABLE_ENTRY(EGLImageTargetRenderbufferStorageOES), TABLE_ENTRY(EGLImageTargetTexture2DOES), /* A whole bunch of no-op functions. These might be called diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index 513fa89726..44861863e6 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -850,6 +850,9 @@ static const char gl_string_table[] = "glProvokingVertexEXT\0" "glGetTexParameterPointervAPPLE\0" "glTextureRangeAPPLE\0" + "glGetObjectParameterivAPPLE\0" + "glObjectPurgeableAPPLE\0" + "glObjectUnpurgeableAPPLE\0" "glStencilFuncSeparateATI\0" "glProgramEnvParameters4fvEXT\0" "glProgramLocalParameters4fvEXT\0" @@ -1208,11 +1211,11 @@ static const char gl_string_table[] = #define gl_dispatch_stub_785 mgl_dispatch_stub_785 #define gl_dispatch_stub_796 mgl_dispatch_stub_796 #define gl_dispatch_stub_797 mgl_dispatch_stub_797 -#define gl_dispatch_stub_798 mgl_dispatch_stub_798 -#define gl_dispatch_stub_799 mgl_dispatch_stub_799 -#define gl_dispatch_stub_800 mgl_dispatch_stub_800 #define gl_dispatch_stub_801 mgl_dispatch_stub_801 #define gl_dispatch_stub_802 mgl_dispatch_stub_802 +#define gl_dispatch_stub_803 mgl_dispatch_stub_803 +#define gl_dispatch_stub_804 mgl_dispatch_stub_804 +#define gl_dispatch_stub_805 mgl_dispatch_stub_805 #endif /* USE_MGL_NAMESPACE */ @@ -1262,11 +1265,11 @@ void GLAPIENTRY gl_dispatch_stub_784(GLenum target, GLenum pname, GLint param); void GLAPIENTRY gl_dispatch_stub_785(GLenum target, GLintptr offset, GLsizeiptr size); void GLAPIENTRY gl_dispatch_stub_796(GLenum target, GLenum pname, GLvoid ** params); void GLAPIENTRY gl_dispatch_stub_797(GLenum target, GLsizei length, GLvoid * pointer); -void GLAPIENTRY gl_dispatch_stub_798(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -void GLAPIENTRY gl_dispatch_stub_799(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_800(GLenum target, GLuint index, GLsizei count, const GLfloat * params); -void GLAPIENTRY gl_dispatch_stub_801(GLuint id, GLenum pname, GLint64EXT * params); -void GLAPIENTRY gl_dispatch_stub_802(GLuint id, GLenum pname, GLuint64EXT * params); +void GLAPIENTRY gl_dispatch_stub_801(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +void GLAPIENTRY gl_dispatch_stub_802(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_803(GLenum target, GLuint index, GLsizei count, const GLfloat * params); +void GLAPIENTRY gl_dispatch_stub_804(GLuint id, GLenum pname, GLint64EXT * params); +void GLAPIENTRY gl_dispatch_stub_805(GLuint id, GLenum pname, GLuint64EXT * params); #endif /* defined(NEED_FUNCTION_POINTER) || defined(GLX_INDIRECT_RENDERING) */ static const glprocs_table_t static_functions[] = { @@ -2068,315 +2071,318 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET(14050, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), NAME_FUNC_OFFSET(14071, gl_dispatch_stub_796, gl_dispatch_stub_796, NULL, _gloffset_GetTexParameterPointervAPPLE), NAME_FUNC_OFFSET(14102, gl_dispatch_stub_797, gl_dispatch_stub_797, NULL, _gloffset_TextureRangeAPPLE), - NAME_FUNC_OFFSET(14122, gl_dispatch_stub_798, gl_dispatch_stub_798, NULL, _gloffset_StencilFuncSeparateATI), - NAME_FUNC_OFFSET(14147, gl_dispatch_stub_799, gl_dispatch_stub_799, NULL, _gloffset_ProgramEnvParameters4fvEXT), - NAME_FUNC_OFFSET(14176, gl_dispatch_stub_800, gl_dispatch_stub_800, NULL, _gloffset_ProgramLocalParameters4fvEXT), - NAME_FUNC_OFFSET(14207, gl_dispatch_stub_801, gl_dispatch_stub_801, NULL, _gloffset_GetQueryObjecti64vEXT), - NAME_FUNC_OFFSET(14231, gl_dispatch_stub_802, gl_dispatch_stub_802, NULL, _gloffset_GetQueryObjectui64vEXT), - NAME_FUNC_OFFSET(14256, glEGLImageTargetRenderbufferStorageOES, glEGLImageTargetRenderbufferStorageOES, NULL, _gloffset_EGLImageTargetRenderbufferStorageOES), - NAME_FUNC_OFFSET(14295, glEGLImageTargetTexture2DOES, glEGLImageTargetTexture2DOES, NULL, _gloffset_EGLImageTargetTexture2DOES), - NAME_FUNC_OFFSET(14324, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), - NAME_FUNC_OFFSET(14342, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), - NAME_FUNC_OFFSET(14359, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), - NAME_FUNC_OFFSET(14375, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), - NAME_FUNC_OFFSET(14400, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), - NAME_FUNC_OFFSET(14420, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), - NAME_FUNC_OFFSET(14440, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), - NAME_FUNC_OFFSET(14463, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), - NAME_FUNC_OFFSET(14486, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), - NAME_FUNC_OFFSET(14506, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), - NAME_FUNC_OFFSET(14523, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), - NAME_FUNC_OFFSET(14540, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), - NAME_FUNC_OFFSET(14555, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), - NAME_FUNC_OFFSET(14579, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), - NAME_FUNC_OFFSET(14598, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), - NAME_FUNC_OFFSET(14617, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), - NAME_FUNC_OFFSET(14633, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), - NAME_FUNC_OFFSET(14652, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), - NAME_FUNC_OFFSET(14675, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14691, glColorTable, glColorTable, NULL, _gloffset_ColorTable), - NAME_FUNC_OFFSET(14707, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), - NAME_FUNC_OFFSET(14734, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), - NAME_FUNC_OFFSET(14761, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), - NAME_FUNC_OFFSET(14781, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14800, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), - NAME_FUNC_OFFSET(14819, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14849, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), - NAME_FUNC_OFFSET(14879, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14909, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), - NAME_FUNC_OFFSET(14939, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), - NAME_FUNC_OFFSET(14958, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), - NAME_FUNC_OFFSET(14981, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), - NAME_FUNC_OFFSET(15006, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), - NAME_FUNC_OFFSET(15031, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), - NAME_FUNC_OFFSET(15058, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), - NAME_FUNC_OFFSET(15086, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), - NAME_FUNC_OFFSET(15113, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), - NAME_FUNC_OFFSET(15141, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), - NAME_FUNC_OFFSET(15170, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), - NAME_FUNC_OFFSET(15199, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), - NAME_FUNC_OFFSET(15225, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), - NAME_FUNC_OFFSET(15256, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), - NAME_FUNC_OFFSET(15287, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), - NAME_FUNC_OFFSET(15311, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), - NAME_FUNC_OFFSET(15334, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), - NAME_FUNC_OFFSET(15352, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), - NAME_FUNC_OFFSET(15381, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), - NAME_FUNC_OFFSET(15410, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), - NAME_FUNC_OFFSET(15425, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), - NAME_FUNC_OFFSET(15451, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), - NAME_FUNC_OFFSET(15477, glHistogram, glHistogram, NULL, _gloffset_Histogram), - NAME_FUNC_OFFSET(15492, glMinmax, glMinmax, NULL, _gloffset_Minmax), - NAME_FUNC_OFFSET(15504, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), - NAME_FUNC_OFFSET(15524, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), - NAME_FUNC_OFFSET(15541, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), - NAME_FUNC_OFFSET(15557, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), - NAME_FUNC_OFFSET(15576, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), - NAME_FUNC_OFFSET(15599, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), - NAME_FUNC_OFFSET(15615, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), - NAME_FUNC_OFFSET(15637, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), - NAME_FUNC_OFFSET(15655, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), - NAME_FUNC_OFFSET(15674, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), - NAME_FUNC_OFFSET(15692, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), - NAME_FUNC_OFFSET(15711, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), - NAME_FUNC_OFFSET(15729, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), - NAME_FUNC_OFFSET(15748, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), - NAME_FUNC_OFFSET(15766, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), - NAME_FUNC_OFFSET(15785, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), - NAME_FUNC_OFFSET(15803, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), - NAME_FUNC_OFFSET(15822, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), - NAME_FUNC_OFFSET(15840, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), - NAME_FUNC_OFFSET(15859, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), - NAME_FUNC_OFFSET(15877, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), - NAME_FUNC_OFFSET(15896, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), - NAME_FUNC_OFFSET(15914, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), - NAME_FUNC_OFFSET(15933, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), - NAME_FUNC_OFFSET(15951, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), - NAME_FUNC_OFFSET(15970, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), - NAME_FUNC_OFFSET(15988, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), - NAME_FUNC_OFFSET(16007, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), - NAME_FUNC_OFFSET(16025, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), - NAME_FUNC_OFFSET(16044, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), - NAME_FUNC_OFFSET(16062, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), - NAME_FUNC_OFFSET(16081, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), - NAME_FUNC_OFFSET(16099, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), - NAME_FUNC_OFFSET(16118, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), - NAME_FUNC_OFFSET(16136, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), - NAME_FUNC_OFFSET(16155, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), - NAME_FUNC_OFFSET(16173, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), - NAME_FUNC_OFFSET(16192, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), - NAME_FUNC_OFFSET(16210, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), - NAME_FUNC_OFFSET(16229, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), - NAME_FUNC_OFFSET(16252, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), - NAME_FUNC_OFFSET(16275, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), - NAME_FUNC_OFFSET(16298, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), - NAME_FUNC_OFFSET(16321, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), - NAME_FUNC_OFFSET(16344, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), - NAME_FUNC_OFFSET(16361, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), - NAME_FUNC_OFFSET(16384, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), - NAME_FUNC_OFFSET(16407, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), - NAME_FUNC_OFFSET(16430, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), - NAME_FUNC_OFFSET(16456, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), - NAME_FUNC_OFFSET(16482, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), - NAME_FUNC_OFFSET(16508, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), - NAME_FUNC_OFFSET(16532, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16559, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), - NAME_FUNC_OFFSET(16585, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), - NAME_FUNC_OFFSET(16605, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), - NAME_FUNC_OFFSET(16625, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), - NAME_FUNC_OFFSET(16645, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), - NAME_FUNC_OFFSET(16668, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), - NAME_FUNC_OFFSET(16692, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), - NAME_FUNC_OFFSET(16715, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), - NAME_FUNC_OFFSET(16739, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), - NAME_FUNC_OFFSET(16756, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), - NAME_FUNC_OFFSET(16774, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), - NAME_FUNC_OFFSET(16791, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), - NAME_FUNC_OFFSET(16809, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), - NAME_FUNC_OFFSET(16826, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), - NAME_FUNC_OFFSET(16844, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), - NAME_FUNC_OFFSET(16861, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), - NAME_FUNC_OFFSET(16879, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), - NAME_FUNC_OFFSET(16896, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), - NAME_FUNC_OFFSET(16914, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), - NAME_FUNC_OFFSET(16931, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), - NAME_FUNC_OFFSET(16949, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), - NAME_FUNC_OFFSET(16966, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), - NAME_FUNC_OFFSET(16984, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), - NAME_FUNC_OFFSET(17001, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), - NAME_FUNC_OFFSET(17019, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), - NAME_FUNC_OFFSET(17036, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), - NAME_FUNC_OFFSET(17054, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), - NAME_FUNC_OFFSET(17073, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), - NAME_FUNC_OFFSET(17092, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), - NAME_FUNC_OFFSET(17111, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), - NAME_FUNC_OFFSET(17130, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), - NAME_FUNC_OFFSET(17150, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), - NAME_FUNC_OFFSET(17170, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), - NAME_FUNC_OFFSET(17190, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), - NAME_FUNC_OFFSET(17208, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), - NAME_FUNC_OFFSET(17225, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), - NAME_FUNC_OFFSET(17243, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), - NAME_FUNC_OFFSET(17260, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), - NAME_FUNC_OFFSET(17278, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), - NAME_FUNC_OFFSET(17296, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), - NAME_FUNC_OFFSET(17313, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), - NAME_FUNC_OFFSET(17331, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), - NAME_FUNC_OFFSET(17350, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), - NAME_FUNC_OFFSET(17369, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), - NAME_FUNC_OFFSET(17388, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), - NAME_FUNC_OFFSET(17410, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), - NAME_FUNC_OFFSET(17423, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), - NAME_FUNC_OFFSET(17436, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), - NAME_FUNC_OFFSET(17452, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), - NAME_FUNC_OFFSET(17468, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), - NAME_FUNC_OFFSET(17481, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), - NAME_FUNC_OFFSET(17504, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), - NAME_FUNC_OFFSET(17524, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), - NAME_FUNC_OFFSET(17543, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), - NAME_FUNC_OFFSET(17554, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), - NAME_FUNC_OFFSET(17566, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), - NAME_FUNC_OFFSET(17580, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), - NAME_FUNC_OFFSET(17593, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), - NAME_FUNC_OFFSET(17609, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), - NAME_FUNC_OFFSET(17620, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), - NAME_FUNC_OFFSET(17633, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), - NAME_FUNC_OFFSET(17652, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), - NAME_FUNC_OFFSET(17672, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), - NAME_FUNC_OFFSET(17685, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), - NAME_FUNC_OFFSET(17695, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), - NAME_FUNC_OFFSET(17711, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), - NAME_FUNC_OFFSET(17730, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), - NAME_FUNC_OFFSET(17748, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), - NAME_FUNC_OFFSET(17769, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), - NAME_FUNC_OFFSET(17784, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), - NAME_FUNC_OFFSET(17799, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), - NAME_FUNC_OFFSET(17813, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), - NAME_FUNC_OFFSET(17828, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), - NAME_FUNC_OFFSET(17840, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), - NAME_FUNC_OFFSET(17853, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), - NAME_FUNC_OFFSET(17865, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), - NAME_FUNC_OFFSET(17878, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), - NAME_FUNC_OFFSET(17890, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), - NAME_FUNC_OFFSET(17903, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), - NAME_FUNC_OFFSET(17915, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), - NAME_FUNC_OFFSET(17928, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), - NAME_FUNC_OFFSET(17940, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), - NAME_FUNC_OFFSET(17953, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), - NAME_FUNC_OFFSET(17965, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), - NAME_FUNC_OFFSET(17978, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), - NAME_FUNC_OFFSET(17990, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), - NAME_FUNC_OFFSET(18003, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), - NAME_FUNC_OFFSET(18015, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), - NAME_FUNC_OFFSET(18028, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), - NAME_FUNC_OFFSET(18047, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), - NAME_FUNC_OFFSET(18066, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), - NAME_FUNC_OFFSET(18085, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), - NAME_FUNC_OFFSET(18098, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), - NAME_FUNC_OFFSET(18116, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), - NAME_FUNC_OFFSET(18137, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), - NAME_FUNC_OFFSET(18155, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), - NAME_FUNC_OFFSET(18175, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(18189, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(18206, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample), - NAME_FUNC_OFFSET(18242, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(18258, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(18277, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18295, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18316, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18338, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18357, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18379, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18402, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(18421, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(18441, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(18460, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(18480, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(18499, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(18519, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(18538, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(18558, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(18577, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(18597, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(18617, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(18638, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(18658, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(18679, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(18699, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(18720, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(18744, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(18762, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(18782, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(18800, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(18812, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(18825, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(18837, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(18850, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18870, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18894, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18908, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18925, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18940, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18958, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18972, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18989, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(19004, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(19022, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(19036, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(19053, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(19068, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(19086, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(19100, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(19117, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(19132, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(19150, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(19164, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(19181, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(19196, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(19214, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(19228, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(19245, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(19260, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(19278, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(19292, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(19309, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(19324, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(19342, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19356, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19373, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19388, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19406, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(19423, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(19443, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(19460, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19486, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19515, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(19530, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(19548, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(19567, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(19588, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(19604, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19628, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19655, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(19673, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(19692, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(19717, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(19738, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(19760, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(19786, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(19809, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(19832, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(19855, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(19873, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(19892, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(19909, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(19947, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(19976, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(19992, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(20009, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(20031, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(20049, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), - NAME_FUNC_OFFSET(20075, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), + NAME_FUNC_OFFSET(14122, glGetObjectParameterivAPPLE, glGetObjectParameterivAPPLE, NULL, _gloffset_GetObjectParameterivAPPLE), + NAME_FUNC_OFFSET(14150, glObjectPurgeableAPPLE, glObjectPurgeableAPPLE, NULL, _gloffset_ObjectPurgeableAPPLE), + NAME_FUNC_OFFSET(14173, glObjectUnpurgeableAPPLE, glObjectUnpurgeableAPPLE, NULL, _gloffset_ObjectUnpurgeableAPPLE), + NAME_FUNC_OFFSET(14198, gl_dispatch_stub_801, gl_dispatch_stub_801, NULL, _gloffset_StencilFuncSeparateATI), + NAME_FUNC_OFFSET(14223, gl_dispatch_stub_802, gl_dispatch_stub_802, NULL, _gloffset_ProgramEnvParameters4fvEXT), + NAME_FUNC_OFFSET(14252, gl_dispatch_stub_803, gl_dispatch_stub_803, NULL, _gloffset_ProgramLocalParameters4fvEXT), + NAME_FUNC_OFFSET(14283, gl_dispatch_stub_804, gl_dispatch_stub_804, NULL, _gloffset_GetQueryObjecti64vEXT), + NAME_FUNC_OFFSET(14307, gl_dispatch_stub_805, gl_dispatch_stub_805, NULL, _gloffset_GetQueryObjectui64vEXT), + NAME_FUNC_OFFSET(14332, glEGLImageTargetRenderbufferStorageOES, glEGLImageTargetRenderbufferStorageOES, NULL, _gloffset_EGLImageTargetRenderbufferStorageOES), + NAME_FUNC_OFFSET(14371, glEGLImageTargetTexture2DOES, glEGLImageTargetTexture2DOES, NULL, _gloffset_EGLImageTargetTexture2DOES), + NAME_FUNC_OFFSET(14400, glArrayElement, glArrayElement, NULL, _gloffset_ArrayElement), + NAME_FUNC_OFFSET(14418, glBindTexture, glBindTexture, NULL, _gloffset_BindTexture), + NAME_FUNC_OFFSET(14435, glDrawArrays, glDrawArrays, NULL, _gloffset_DrawArrays), + NAME_FUNC_OFFSET(14451, glAreTexturesResident, glAreTexturesResidentEXT, glAreTexturesResidentEXT, _gloffset_AreTexturesResident), + NAME_FUNC_OFFSET(14476, glCopyTexImage1D, glCopyTexImage1D, NULL, _gloffset_CopyTexImage1D), + NAME_FUNC_OFFSET(14496, glCopyTexImage2D, glCopyTexImage2D, NULL, _gloffset_CopyTexImage2D), + NAME_FUNC_OFFSET(14516, glCopyTexSubImage1D, glCopyTexSubImage1D, NULL, _gloffset_CopyTexSubImage1D), + NAME_FUNC_OFFSET(14539, glCopyTexSubImage2D, glCopyTexSubImage2D, NULL, _gloffset_CopyTexSubImage2D), + NAME_FUNC_OFFSET(14562, glDeleteTextures, glDeleteTexturesEXT, glDeleteTexturesEXT, _gloffset_DeleteTextures), + NAME_FUNC_OFFSET(14582, glGenTextures, glGenTexturesEXT, glGenTexturesEXT, _gloffset_GenTextures), + NAME_FUNC_OFFSET(14599, glGetPointerv, glGetPointerv, NULL, _gloffset_GetPointerv), + NAME_FUNC_OFFSET(14616, glIsTexture, glIsTextureEXT, glIsTextureEXT, _gloffset_IsTexture), + NAME_FUNC_OFFSET(14631, glPrioritizeTextures, glPrioritizeTextures, NULL, _gloffset_PrioritizeTextures), + NAME_FUNC_OFFSET(14655, glTexSubImage1D, glTexSubImage1D, NULL, _gloffset_TexSubImage1D), + NAME_FUNC_OFFSET(14674, glTexSubImage2D, glTexSubImage2D, NULL, _gloffset_TexSubImage2D), + NAME_FUNC_OFFSET(14693, glBlendColor, glBlendColor, NULL, _gloffset_BlendColor), + NAME_FUNC_OFFSET(14709, glBlendEquation, glBlendEquation, NULL, _gloffset_BlendEquation), + NAME_FUNC_OFFSET(14728, glDrawRangeElements, glDrawRangeElements, NULL, _gloffset_DrawRangeElements), + NAME_FUNC_OFFSET(14751, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14767, glColorTable, glColorTable, NULL, _gloffset_ColorTable), + NAME_FUNC_OFFSET(14783, glColorTableParameterfv, glColorTableParameterfv, NULL, _gloffset_ColorTableParameterfv), + NAME_FUNC_OFFSET(14810, glColorTableParameteriv, glColorTableParameteriv, NULL, _gloffset_ColorTableParameteriv), + NAME_FUNC_OFFSET(14837, glCopyColorTable, glCopyColorTable, NULL, _gloffset_CopyColorTable), + NAME_FUNC_OFFSET(14857, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14876, glGetColorTable, glGetColorTableEXT, glGetColorTableEXT, _gloffset_GetColorTable), + NAME_FUNC_OFFSET(14895, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14925, glGetColorTableParameterfv, glGetColorTableParameterfvEXT, glGetColorTableParameterfvEXT, _gloffset_GetColorTableParameterfv), + NAME_FUNC_OFFSET(14955, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(14985, glGetColorTableParameteriv, glGetColorTableParameterivEXT, glGetColorTableParameterivEXT, _gloffset_GetColorTableParameteriv), + NAME_FUNC_OFFSET(15015, glColorSubTable, glColorSubTable, NULL, _gloffset_ColorSubTable), + NAME_FUNC_OFFSET(15034, glCopyColorSubTable, glCopyColorSubTable, NULL, _gloffset_CopyColorSubTable), + NAME_FUNC_OFFSET(15057, glConvolutionFilter1D, glConvolutionFilter1D, NULL, _gloffset_ConvolutionFilter1D), + NAME_FUNC_OFFSET(15082, glConvolutionFilter2D, glConvolutionFilter2D, NULL, _gloffset_ConvolutionFilter2D), + NAME_FUNC_OFFSET(15107, glConvolutionParameterf, glConvolutionParameterf, NULL, _gloffset_ConvolutionParameterf), + NAME_FUNC_OFFSET(15134, glConvolutionParameterfv, glConvolutionParameterfv, NULL, _gloffset_ConvolutionParameterfv), + NAME_FUNC_OFFSET(15162, glConvolutionParameteri, glConvolutionParameteri, NULL, _gloffset_ConvolutionParameteri), + NAME_FUNC_OFFSET(15189, glConvolutionParameteriv, glConvolutionParameteriv, NULL, _gloffset_ConvolutionParameteriv), + NAME_FUNC_OFFSET(15217, glCopyConvolutionFilter1D, glCopyConvolutionFilter1D, NULL, _gloffset_CopyConvolutionFilter1D), + NAME_FUNC_OFFSET(15246, glCopyConvolutionFilter2D, glCopyConvolutionFilter2D, NULL, _gloffset_CopyConvolutionFilter2D), + NAME_FUNC_OFFSET(15275, glGetConvolutionFilter, gl_dispatch_stub_356, gl_dispatch_stub_356, _gloffset_GetConvolutionFilter), + NAME_FUNC_OFFSET(15301, glGetConvolutionParameterfv, gl_dispatch_stub_357, gl_dispatch_stub_357, _gloffset_GetConvolutionParameterfv), + NAME_FUNC_OFFSET(15332, glGetConvolutionParameteriv, gl_dispatch_stub_358, gl_dispatch_stub_358, _gloffset_GetConvolutionParameteriv), + NAME_FUNC_OFFSET(15363, glGetSeparableFilter, gl_dispatch_stub_359, gl_dispatch_stub_359, _gloffset_GetSeparableFilter), + NAME_FUNC_OFFSET(15387, glSeparableFilter2D, glSeparableFilter2D, NULL, _gloffset_SeparableFilter2D), + NAME_FUNC_OFFSET(15410, glGetHistogram, gl_dispatch_stub_361, gl_dispatch_stub_361, _gloffset_GetHistogram), + NAME_FUNC_OFFSET(15428, glGetHistogramParameterfv, gl_dispatch_stub_362, gl_dispatch_stub_362, _gloffset_GetHistogramParameterfv), + NAME_FUNC_OFFSET(15457, glGetHistogramParameteriv, gl_dispatch_stub_363, gl_dispatch_stub_363, _gloffset_GetHistogramParameteriv), + NAME_FUNC_OFFSET(15486, glGetMinmax, gl_dispatch_stub_364, gl_dispatch_stub_364, _gloffset_GetMinmax), + NAME_FUNC_OFFSET(15501, glGetMinmaxParameterfv, gl_dispatch_stub_365, gl_dispatch_stub_365, _gloffset_GetMinmaxParameterfv), + NAME_FUNC_OFFSET(15527, glGetMinmaxParameteriv, gl_dispatch_stub_366, gl_dispatch_stub_366, _gloffset_GetMinmaxParameteriv), + NAME_FUNC_OFFSET(15553, glHistogram, glHistogram, NULL, _gloffset_Histogram), + NAME_FUNC_OFFSET(15568, glMinmax, glMinmax, NULL, _gloffset_Minmax), + NAME_FUNC_OFFSET(15580, glResetHistogram, glResetHistogram, NULL, _gloffset_ResetHistogram), + NAME_FUNC_OFFSET(15600, glResetMinmax, glResetMinmax, NULL, _gloffset_ResetMinmax), + NAME_FUNC_OFFSET(15617, glTexImage3D, glTexImage3D, NULL, _gloffset_TexImage3D), + NAME_FUNC_OFFSET(15633, glTexSubImage3D, glTexSubImage3D, NULL, _gloffset_TexSubImage3D), + NAME_FUNC_OFFSET(15652, glCopyTexSubImage3D, glCopyTexSubImage3D, NULL, _gloffset_CopyTexSubImage3D), + NAME_FUNC_OFFSET(15675, glActiveTextureARB, glActiveTextureARB, NULL, _gloffset_ActiveTextureARB), + NAME_FUNC_OFFSET(15691, glClientActiveTextureARB, glClientActiveTextureARB, NULL, _gloffset_ClientActiveTextureARB), + NAME_FUNC_OFFSET(15713, glMultiTexCoord1dARB, glMultiTexCoord1dARB, NULL, _gloffset_MultiTexCoord1dARB), + NAME_FUNC_OFFSET(15731, glMultiTexCoord1dvARB, glMultiTexCoord1dvARB, NULL, _gloffset_MultiTexCoord1dvARB), + NAME_FUNC_OFFSET(15750, glMultiTexCoord1fARB, glMultiTexCoord1fARB, NULL, _gloffset_MultiTexCoord1fARB), + NAME_FUNC_OFFSET(15768, glMultiTexCoord1fvARB, glMultiTexCoord1fvARB, NULL, _gloffset_MultiTexCoord1fvARB), + NAME_FUNC_OFFSET(15787, glMultiTexCoord1iARB, glMultiTexCoord1iARB, NULL, _gloffset_MultiTexCoord1iARB), + NAME_FUNC_OFFSET(15805, glMultiTexCoord1ivARB, glMultiTexCoord1ivARB, NULL, _gloffset_MultiTexCoord1ivARB), + NAME_FUNC_OFFSET(15824, glMultiTexCoord1sARB, glMultiTexCoord1sARB, NULL, _gloffset_MultiTexCoord1sARB), + NAME_FUNC_OFFSET(15842, glMultiTexCoord1svARB, glMultiTexCoord1svARB, NULL, _gloffset_MultiTexCoord1svARB), + NAME_FUNC_OFFSET(15861, glMultiTexCoord2dARB, glMultiTexCoord2dARB, NULL, _gloffset_MultiTexCoord2dARB), + NAME_FUNC_OFFSET(15879, glMultiTexCoord2dvARB, glMultiTexCoord2dvARB, NULL, _gloffset_MultiTexCoord2dvARB), + NAME_FUNC_OFFSET(15898, glMultiTexCoord2fARB, glMultiTexCoord2fARB, NULL, _gloffset_MultiTexCoord2fARB), + NAME_FUNC_OFFSET(15916, glMultiTexCoord2fvARB, glMultiTexCoord2fvARB, NULL, _gloffset_MultiTexCoord2fvARB), + NAME_FUNC_OFFSET(15935, glMultiTexCoord2iARB, glMultiTexCoord2iARB, NULL, _gloffset_MultiTexCoord2iARB), + NAME_FUNC_OFFSET(15953, glMultiTexCoord2ivARB, glMultiTexCoord2ivARB, NULL, _gloffset_MultiTexCoord2ivARB), + NAME_FUNC_OFFSET(15972, glMultiTexCoord2sARB, glMultiTexCoord2sARB, NULL, _gloffset_MultiTexCoord2sARB), + NAME_FUNC_OFFSET(15990, glMultiTexCoord2svARB, glMultiTexCoord2svARB, NULL, _gloffset_MultiTexCoord2svARB), + NAME_FUNC_OFFSET(16009, glMultiTexCoord3dARB, glMultiTexCoord3dARB, NULL, _gloffset_MultiTexCoord3dARB), + NAME_FUNC_OFFSET(16027, glMultiTexCoord3dvARB, glMultiTexCoord3dvARB, NULL, _gloffset_MultiTexCoord3dvARB), + NAME_FUNC_OFFSET(16046, glMultiTexCoord3fARB, glMultiTexCoord3fARB, NULL, _gloffset_MultiTexCoord3fARB), + NAME_FUNC_OFFSET(16064, glMultiTexCoord3fvARB, glMultiTexCoord3fvARB, NULL, _gloffset_MultiTexCoord3fvARB), + NAME_FUNC_OFFSET(16083, glMultiTexCoord3iARB, glMultiTexCoord3iARB, NULL, _gloffset_MultiTexCoord3iARB), + NAME_FUNC_OFFSET(16101, glMultiTexCoord3ivARB, glMultiTexCoord3ivARB, NULL, _gloffset_MultiTexCoord3ivARB), + NAME_FUNC_OFFSET(16120, glMultiTexCoord3sARB, glMultiTexCoord3sARB, NULL, _gloffset_MultiTexCoord3sARB), + NAME_FUNC_OFFSET(16138, glMultiTexCoord3svARB, glMultiTexCoord3svARB, NULL, _gloffset_MultiTexCoord3svARB), + NAME_FUNC_OFFSET(16157, glMultiTexCoord4dARB, glMultiTexCoord4dARB, NULL, _gloffset_MultiTexCoord4dARB), + NAME_FUNC_OFFSET(16175, glMultiTexCoord4dvARB, glMultiTexCoord4dvARB, NULL, _gloffset_MultiTexCoord4dvARB), + NAME_FUNC_OFFSET(16194, glMultiTexCoord4fARB, glMultiTexCoord4fARB, NULL, _gloffset_MultiTexCoord4fARB), + NAME_FUNC_OFFSET(16212, glMultiTexCoord4fvARB, glMultiTexCoord4fvARB, NULL, _gloffset_MultiTexCoord4fvARB), + NAME_FUNC_OFFSET(16231, glMultiTexCoord4iARB, glMultiTexCoord4iARB, NULL, _gloffset_MultiTexCoord4iARB), + NAME_FUNC_OFFSET(16249, glMultiTexCoord4ivARB, glMultiTexCoord4ivARB, NULL, _gloffset_MultiTexCoord4ivARB), + NAME_FUNC_OFFSET(16268, glMultiTexCoord4sARB, glMultiTexCoord4sARB, NULL, _gloffset_MultiTexCoord4sARB), + NAME_FUNC_OFFSET(16286, glMultiTexCoord4svARB, glMultiTexCoord4svARB, NULL, _gloffset_MultiTexCoord4svARB), + NAME_FUNC_OFFSET(16305, glStencilOpSeparate, glStencilOpSeparate, NULL, _gloffset_StencilOpSeparate), + NAME_FUNC_OFFSET(16328, glLoadTransposeMatrixdARB, glLoadTransposeMatrixdARB, NULL, _gloffset_LoadTransposeMatrixdARB), + NAME_FUNC_OFFSET(16351, glLoadTransposeMatrixfARB, glLoadTransposeMatrixfARB, NULL, _gloffset_LoadTransposeMatrixfARB), + NAME_FUNC_OFFSET(16374, glMultTransposeMatrixdARB, glMultTransposeMatrixdARB, NULL, _gloffset_MultTransposeMatrixdARB), + NAME_FUNC_OFFSET(16397, glMultTransposeMatrixfARB, glMultTransposeMatrixfARB, NULL, _gloffset_MultTransposeMatrixfARB), + NAME_FUNC_OFFSET(16420, glSampleCoverageARB, glSampleCoverageARB, NULL, _gloffset_SampleCoverageARB), + NAME_FUNC_OFFSET(16437, glCompressedTexImage1DARB, glCompressedTexImage1DARB, NULL, _gloffset_CompressedTexImage1DARB), + NAME_FUNC_OFFSET(16460, glCompressedTexImage2DARB, glCompressedTexImage2DARB, NULL, _gloffset_CompressedTexImage2DARB), + NAME_FUNC_OFFSET(16483, glCompressedTexImage3DARB, glCompressedTexImage3DARB, NULL, _gloffset_CompressedTexImage3DARB), + NAME_FUNC_OFFSET(16506, glCompressedTexSubImage1DARB, glCompressedTexSubImage1DARB, NULL, _gloffset_CompressedTexSubImage1DARB), + NAME_FUNC_OFFSET(16532, glCompressedTexSubImage2DARB, glCompressedTexSubImage2DARB, NULL, _gloffset_CompressedTexSubImage2DARB), + NAME_FUNC_OFFSET(16558, glCompressedTexSubImage3DARB, glCompressedTexSubImage3DARB, NULL, _gloffset_CompressedTexSubImage3DARB), + NAME_FUNC_OFFSET(16584, glGetCompressedTexImageARB, glGetCompressedTexImageARB, NULL, _gloffset_GetCompressedTexImageARB), + NAME_FUNC_OFFSET(16608, glDisableVertexAttribArrayARB, glDisableVertexAttribArrayARB, NULL, _gloffset_DisableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16635, glEnableVertexAttribArrayARB, glEnableVertexAttribArrayARB, NULL, _gloffset_EnableVertexAttribArrayARB), + NAME_FUNC_OFFSET(16661, glGetVertexAttribdvARB, glGetVertexAttribdvARB, NULL, _gloffset_GetVertexAttribdvARB), + NAME_FUNC_OFFSET(16681, glGetVertexAttribfvARB, glGetVertexAttribfvARB, NULL, _gloffset_GetVertexAttribfvARB), + NAME_FUNC_OFFSET(16701, glGetVertexAttribivARB, glGetVertexAttribivARB, NULL, _gloffset_GetVertexAttribivARB), + NAME_FUNC_OFFSET(16721, glProgramEnvParameter4dARB, glProgramEnvParameter4dARB, NULL, _gloffset_ProgramEnvParameter4dARB), + NAME_FUNC_OFFSET(16744, glProgramEnvParameter4dvARB, glProgramEnvParameter4dvARB, NULL, _gloffset_ProgramEnvParameter4dvARB), + NAME_FUNC_OFFSET(16768, glProgramEnvParameter4fARB, glProgramEnvParameter4fARB, NULL, _gloffset_ProgramEnvParameter4fARB), + NAME_FUNC_OFFSET(16791, glProgramEnvParameter4fvARB, glProgramEnvParameter4fvARB, NULL, _gloffset_ProgramEnvParameter4fvARB), + NAME_FUNC_OFFSET(16815, glVertexAttrib1dARB, glVertexAttrib1dARB, NULL, _gloffset_VertexAttrib1dARB), + NAME_FUNC_OFFSET(16832, glVertexAttrib1dvARB, glVertexAttrib1dvARB, NULL, _gloffset_VertexAttrib1dvARB), + NAME_FUNC_OFFSET(16850, glVertexAttrib1fARB, glVertexAttrib1fARB, NULL, _gloffset_VertexAttrib1fARB), + NAME_FUNC_OFFSET(16867, glVertexAttrib1fvARB, glVertexAttrib1fvARB, NULL, _gloffset_VertexAttrib1fvARB), + NAME_FUNC_OFFSET(16885, glVertexAttrib1sARB, glVertexAttrib1sARB, NULL, _gloffset_VertexAttrib1sARB), + NAME_FUNC_OFFSET(16902, glVertexAttrib1svARB, glVertexAttrib1svARB, NULL, _gloffset_VertexAttrib1svARB), + NAME_FUNC_OFFSET(16920, glVertexAttrib2dARB, glVertexAttrib2dARB, NULL, _gloffset_VertexAttrib2dARB), + NAME_FUNC_OFFSET(16937, glVertexAttrib2dvARB, glVertexAttrib2dvARB, NULL, _gloffset_VertexAttrib2dvARB), + NAME_FUNC_OFFSET(16955, glVertexAttrib2fARB, glVertexAttrib2fARB, NULL, _gloffset_VertexAttrib2fARB), + NAME_FUNC_OFFSET(16972, glVertexAttrib2fvARB, glVertexAttrib2fvARB, NULL, _gloffset_VertexAttrib2fvARB), + NAME_FUNC_OFFSET(16990, glVertexAttrib2sARB, glVertexAttrib2sARB, NULL, _gloffset_VertexAttrib2sARB), + NAME_FUNC_OFFSET(17007, glVertexAttrib2svARB, glVertexAttrib2svARB, NULL, _gloffset_VertexAttrib2svARB), + NAME_FUNC_OFFSET(17025, glVertexAttrib3dARB, glVertexAttrib3dARB, NULL, _gloffset_VertexAttrib3dARB), + NAME_FUNC_OFFSET(17042, glVertexAttrib3dvARB, glVertexAttrib3dvARB, NULL, _gloffset_VertexAttrib3dvARB), + NAME_FUNC_OFFSET(17060, glVertexAttrib3fARB, glVertexAttrib3fARB, NULL, _gloffset_VertexAttrib3fARB), + NAME_FUNC_OFFSET(17077, glVertexAttrib3fvARB, glVertexAttrib3fvARB, NULL, _gloffset_VertexAttrib3fvARB), + NAME_FUNC_OFFSET(17095, glVertexAttrib3sARB, glVertexAttrib3sARB, NULL, _gloffset_VertexAttrib3sARB), + NAME_FUNC_OFFSET(17112, glVertexAttrib3svARB, glVertexAttrib3svARB, NULL, _gloffset_VertexAttrib3svARB), + NAME_FUNC_OFFSET(17130, glVertexAttrib4NbvARB, glVertexAttrib4NbvARB, NULL, _gloffset_VertexAttrib4NbvARB), + NAME_FUNC_OFFSET(17149, glVertexAttrib4NivARB, glVertexAttrib4NivARB, NULL, _gloffset_VertexAttrib4NivARB), + NAME_FUNC_OFFSET(17168, glVertexAttrib4NsvARB, glVertexAttrib4NsvARB, NULL, _gloffset_VertexAttrib4NsvARB), + NAME_FUNC_OFFSET(17187, glVertexAttrib4NubARB, glVertexAttrib4NubARB, NULL, _gloffset_VertexAttrib4NubARB), + NAME_FUNC_OFFSET(17206, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB), + NAME_FUNC_OFFSET(17226, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB), + NAME_FUNC_OFFSET(17246, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB), + NAME_FUNC_OFFSET(17266, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB), + NAME_FUNC_OFFSET(17284, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB), + NAME_FUNC_OFFSET(17301, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB), + NAME_FUNC_OFFSET(17319, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB), + NAME_FUNC_OFFSET(17336, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB), + NAME_FUNC_OFFSET(17354, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB), + NAME_FUNC_OFFSET(17372, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB), + NAME_FUNC_OFFSET(17389, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB), + NAME_FUNC_OFFSET(17407, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB), + NAME_FUNC_OFFSET(17426, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB), + NAME_FUNC_OFFSET(17445, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB), + NAME_FUNC_OFFSET(17464, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB), + NAME_FUNC_OFFSET(17486, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB), + NAME_FUNC_OFFSET(17499, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB), + NAME_FUNC_OFFSET(17512, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB), + NAME_FUNC_OFFSET(17528, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB), + NAME_FUNC_OFFSET(17544, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB), + NAME_FUNC_OFFSET(17557, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB), + NAME_FUNC_OFFSET(17580, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB), + NAME_FUNC_OFFSET(17600, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB), + NAME_FUNC_OFFSET(17619, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB), + NAME_FUNC_OFFSET(17630, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB), + NAME_FUNC_OFFSET(17642, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB), + NAME_FUNC_OFFSET(17656, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB), + NAME_FUNC_OFFSET(17669, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB), + NAME_FUNC_OFFSET(17685, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB), + NAME_FUNC_OFFSET(17696, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB), + NAME_FUNC_OFFSET(17709, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB), + NAME_FUNC_OFFSET(17728, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB), + NAME_FUNC_OFFSET(17748, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB), + NAME_FUNC_OFFSET(17761, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB), + NAME_FUNC_OFFSET(17771, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB), + NAME_FUNC_OFFSET(17787, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB), + NAME_FUNC_OFFSET(17806, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB), + NAME_FUNC_OFFSET(17824, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB), + NAME_FUNC_OFFSET(17845, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB), + NAME_FUNC_OFFSET(17860, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB), + NAME_FUNC_OFFSET(17875, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB), + NAME_FUNC_OFFSET(17889, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB), + NAME_FUNC_OFFSET(17904, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB), + NAME_FUNC_OFFSET(17916, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB), + NAME_FUNC_OFFSET(17929, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB), + NAME_FUNC_OFFSET(17941, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB), + NAME_FUNC_OFFSET(17954, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB), + NAME_FUNC_OFFSET(17966, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB), + NAME_FUNC_OFFSET(17979, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB), + NAME_FUNC_OFFSET(17991, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB), + NAME_FUNC_OFFSET(18004, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB), + NAME_FUNC_OFFSET(18016, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB), + NAME_FUNC_OFFSET(18029, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB), + NAME_FUNC_OFFSET(18041, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB), + NAME_FUNC_OFFSET(18054, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB), + NAME_FUNC_OFFSET(18066, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB), + NAME_FUNC_OFFSET(18079, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB), + NAME_FUNC_OFFSET(18091, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB), + NAME_FUNC_OFFSET(18104, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB), + NAME_FUNC_OFFSET(18123, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB), + NAME_FUNC_OFFSET(18142, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB), + NAME_FUNC_OFFSET(18161, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB), + NAME_FUNC_OFFSET(18174, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB), + NAME_FUNC_OFFSET(18192, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB), + NAME_FUNC_OFFSET(18213, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB), + NAME_FUNC_OFFSET(18231, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), + NAME_FUNC_OFFSET(18251, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(18265, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), + NAME_FUNC_OFFSET(18282, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample), + NAME_FUNC_OFFSET(18318, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(18334, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(18353, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18371, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18392, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18414, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18433, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18455, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18478, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(18497, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(18517, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(18536, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(18556, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(18575, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(18595, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(18614, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(18634, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(18653, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(18673, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(18693, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(18714, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(18734, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(18755, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(18775, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(18796, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(18820, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(18838, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(18858, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(18876, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(18888, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(18901, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(18913, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(18926, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18946, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18970, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18984, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(19001, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(19016, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(19034, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(19048, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(19065, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(19080, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(19098, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(19112, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(19129, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(19144, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(19162, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(19176, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(19193, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(19208, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(19226, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(19240, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(19257, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(19272, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(19290, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(19304, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(19321, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19336, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19354, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19368, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19385, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19400, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19418, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19432, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19449, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19464, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19482, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(19499, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(19519, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(19536, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19562, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19591, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(19606, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(19624, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(19643, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(19664, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(19680, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19704, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19731, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(19749, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(19768, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(19793, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(19814, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(19836, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(19862, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(19885, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(19908, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(19931, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(19949, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(19968, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(19985, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(20023, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(20052, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(20068, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(20085, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(20107, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(20125, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(20151, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 140902f677..06d51d4e5c 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -145,6 +145,7 @@ LONGSTRING static const char enum_string_table[] = "GL_BUFFER_MAPPED_ARB\0" "GL_BUFFER_MAP_POINTER\0" "GL_BUFFER_MAP_POINTER_ARB\0" + "GL_BUFFER_OBJECT_APPLE\0" "GL_BUFFER_SERIALIZED_MODIFY_APPLE\0" "GL_BUFFER_SIZE\0" "GL_BUFFER_SIZE_ARB\0" @@ -1320,6 +1321,7 @@ LONGSTRING static const char enum_string_table[] = "GL_PROXY_TEXTURE_CUBE_MAP_ARB\0" "GL_PROXY_TEXTURE_RECTANGLE_ARB\0" "GL_PROXY_TEXTURE_RECTANGLE_NV\0" + "GL_PURGEABLE_APPLE\0" "GL_Q\0" "GL_QUADRATIC_ATTENUATION\0" "GL_QUADS\0" @@ -1358,6 +1360,7 @@ LONGSTRING static const char enum_string_table[] = "GL_REFLECTION_MAP\0" "GL_REFLECTION_MAP_ARB\0" "GL_REFLECTION_MAP_NV\0" + "GL_RELEASED_APPLE\0" "GL_RENDER\0" "GL_RENDERBUFFER\0" "GL_RENDERBUFFER_ALPHA_SIZE\0" @@ -1385,6 +1388,7 @@ LONGSTRING static const char enum_string_table[] = "GL_REPLICATE_BORDER_HP\0" "GL_RESCALE_NORMAL\0" "GL_RESCALE_NORMAL_EXT\0" + "GL_RETAINED_APPLE\0" "GL_RETURN\0" "GL_RGB\0" "GL_RGB10\0" @@ -1811,6 +1815,7 @@ LONGSTRING static const char enum_string_table[] = "GL_TRIANGLE_MESH_SUN\0" "GL_TRIANGLE_STRIP\0" "GL_TRUE\0" + "GL_UNDEFINED_APPLE\0" "GL_UNPACK_ALIGNMENT\0" "GL_UNPACK_IMAGE_HEIGHT\0" "GL_UNPACK_LSB_FIRST\0" @@ -1903,6 +1908,7 @@ LONGSTRING static const char enum_string_table[] = "GL_VERTEX_STATE_PROGRAM_NV\0" "GL_VIEWPORT\0" "GL_VIEWPORT_BIT\0" + "GL_VOLATILE_APPLE\0" "GL_WAIT_FAILED\0" "GL_WEIGHT_ARRAY_ARB\0" "GL_WEIGHT_ARRAY_BUFFER_BINDING\0" @@ -1923,7 +1929,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1885] = +static const enum_elt all_enums[1891] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -2034,3136 +2040,3148 @@ static const enum_elt all_enums[1885] = { 1755, 0x000088BC }, /* GL_BUFFER_MAPPED_ARB */ { 1776, 0x000088BD }, /* GL_BUFFER_MAP_POINTER */ { 1798, 0x000088BD }, /* GL_BUFFER_MAP_POINTER_ARB */ - { 1824, 0x00008A12 }, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ - { 1858, 0x00008764 }, /* GL_BUFFER_SIZE */ - { 1873, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ - { 1892, 0x00008765 }, /* GL_BUFFER_USAGE */ - { 1908, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ - { 1928, 0x0000877B }, /* GL_BUMP_ENVMAP_ATI */ - { 1947, 0x00008777 }, /* GL_BUMP_NUM_TEX_UNITS_ATI */ - { 1973, 0x00008775 }, /* GL_BUMP_ROT_MATRIX_ATI */ - { 1996, 0x00008776 }, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ - { 2024, 0x0000877C }, /* GL_BUMP_TARGET_ATI */ - { 2043, 0x00008778 }, /* GL_BUMP_TEX_UNITS_ATI */ - { 2065, 0x00001400 }, /* GL_BYTE */ - { 2073, 0x00002A24 }, /* GL_C3F_V3F */ - { 2084, 0x00002A26 }, /* GL_C4F_N3F_V3F */ - { 2099, 0x00002A22 }, /* GL_C4UB_V2F */ - { 2111, 0x00002A23 }, /* GL_C4UB_V3F */ - { 2123, 0x00000901 }, /* GL_CCW */ - { 2130, 0x00002900 }, /* GL_CLAMP */ - { 2139, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ - { 2158, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ - { 2181, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ - { 2205, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ - { 2222, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ - { 2244, 0x00001500 }, /* GL_CLEAR */ - { 2253, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ - { 2278, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ - { 2307, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ - { 2333, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ - { 2362, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ - { 2388, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ - { 2415, 0x00003000 }, /* GL_CLIP_PLANE0 */ - { 2430, 0x00003001 }, /* GL_CLIP_PLANE1 */ - { 2445, 0x00003002 }, /* GL_CLIP_PLANE2 */ - { 2460, 0x00003003 }, /* GL_CLIP_PLANE3 */ - { 2475, 0x00003004 }, /* GL_CLIP_PLANE4 */ - { 2490, 0x00003005 }, /* GL_CLIP_PLANE5 */ - { 2505, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - { 2538, 0x00000A00 }, /* GL_COEFF */ - { 2547, 0x00001800 }, /* GL_COLOR */ - { 2556, 0x00008076 }, /* GL_COLOR_ARRAY */ - { 2571, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - { 2601, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 2635, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ - { 2658, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ - { 2678, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ - { 2700, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ - { 2720, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */ - { 2741, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ - { 2766, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */ - { 2787, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */ - { 2809, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ - { 2835, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */ - { 2857, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ - { 2883, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */ - { 2905, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ - { 2931, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */ - { 2953, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ - { 2979, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */ - { 3001, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ - { 3027, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */ - { 3049, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ - { 3075, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ - { 3100, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */ - { 3121, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ - { 3146, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */ - { 3167, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ - { 3192, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */ - { 3213, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ - { 3238, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */ - { 3259, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ - { 3284, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */ - { 3305, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ - { 3330, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */ - { 3351, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ - { 3376, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */ - { 3397, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ - { 3422, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */ - { 3443, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ - { 3468, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ - { 3488, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ - { 3509, 0x00001900 }, /* GL_COLOR_INDEX */ - { 3524, 0x00001603 }, /* GL_COLOR_INDEXES */ - { 3541, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ - { 3559, 0x00000B57 }, /* GL_COLOR_MATERIAL */ - { 3577, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ - { 3600, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ - { 3628, 0x000080B1 }, /* GL_COLOR_MATRIX */ - { 3644, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ - { 3664, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ - { 3692, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 3724, 0x00008458 }, /* GL_COLOR_SUM */ - { 3737, 0x00008458 }, /* GL_COLOR_SUM_ARB */ - { 3754, 0x000080D0 }, /* GL_COLOR_TABLE */ - { 3769, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ - { 3795, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ - { 3825, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ - { 3855, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ - { 3875, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ - { 3899, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ - { 3924, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ - { 3953, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ - { 3982, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ - { 4004, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ - { 4030, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ - { 4056, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ - { 4082, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ - { 4112, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ - { 4142, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ - { 4172, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ - { 4206, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ - { 4240, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - { 4270, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ - { 4304, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ - { 4338, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ - { 4362, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ - { 4390, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ - { 4418, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ - { 4439, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ - { 4464, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ - { 4485, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ - { 4510, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ - { 4535, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ - { 4554, 0x00008570 }, /* GL_COMBINE */ - { 4565, 0x00008503 }, /* GL_COMBINE4 */ - { 4577, 0x00008572 }, /* GL_COMBINE_ALPHA */ - { 4594, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ - { 4615, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ - { 4636, 0x00008570 }, /* GL_COMBINE_ARB */ - { 4651, 0x00008570 }, /* GL_COMBINE_EXT */ - { 4666, 0x00008571 }, /* GL_COMBINE_RGB */ - { 4681, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ - { 4700, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ - { 4719, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ - { 4755, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ - { 4779, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ - { 4807, 0x00001300 }, /* GL_COMPILE */ - { 4818, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ - { 4841, 0x00008B81 }, /* GL_COMPILE_STATUS */ - { 4859, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ - { 4879, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ - { 4903, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ - { 4927, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ - { 4955, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ - { 4979, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - { 5009, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ - { 5043, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ - { 5071, 0x000084ED }, /* GL_COMPRESSED_RGB */ - { 5089, 0x000084EE }, /* GL_COMPRESSED_RGBA */ - { 5108, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ - { 5131, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - { 5160, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - { 5193, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - { 5226, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - { 5259, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ - { 5281, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - { 5309, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - { 5341, 0x00008C4A }, /* GL_COMPRESSED_SLUMINANCE */ - { 5366, 0x00008C4B }, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ - { 5397, 0x00008C48 }, /* GL_COMPRESSED_SRGB */ - { 5416, 0x00008C49 }, /* GL_COMPRESSED_SRGB_ALPHA */ - { 5441, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ - { 5471, 0x0000911C }, /* GL_CONDITION_SATISFIED */ - { 5494, 0x00008576 }, /* GL_CONSTANT */ - { 5506, 0x00008003 }, /* GL_CONSTANT_ALPHA */ - { 5524, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ - { 5546, 0x00008576 }, /* GL_CONSTANT_ARB */ - { 5562, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ - { 5586, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ - { 5608, 0x00008001 }, /* GL_CONSTANT_COLOR */ - { 5626, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ - { 5648, 0x00008576 }, /* GL_CONSTANT_EXT */ - { 5664, 0x00008010 }, /* GL_CONVOLUTION_1D */ - { 5682, 0x00008011 }, /* GL_CONVOLUTION_2D */ - { 5700, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ - { 5728, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ - { 5759, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ - { 5786, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ - { 5817, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ - { 5844, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ - { 5875, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ - { 5903, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ - { 5935, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ - { 5957, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ - { 5983, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ - { 6005, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ - { 6031, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ - { 6052, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ - { 6077, 0x00008862 }, /* GL_COORD_REPLACE */ - { 6094, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ - { 6115, 0x00008862 }, /* GL_COORD_REPLACE_NV */ - { 6135, 0x00001503 }, /* GL_COPY */ - { 6143, 0x0000150C }, /* GL_COPY_INVERTED */ - { 6160, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ - { 6180, 0x00008F36 }, /* GL_COPY_READ_BUFFER */ - { 6200, 0x00008F37 }, /* GL_COPY_WRITE_BUFFER */ - { 6221, 0x00000B44 }, /* GL_CULL_FACE */ - { 6234, 0x00000B45 }, /* GL_CULL_FACE_MODE */ - { 6252, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ - { 6271, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - { 6303, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - { 6338, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ - { 6359, 0x00000001 }, /* GL_CURRENT_BIT */ - { 6374, 0x00000B00 }, /* GL_CURRENT_COLOR */ - { 6391, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ - { 6412, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ - { 6438, 0x00000B01 }, /* GL_CURRENT_INDEX */ - { 6455, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ - { 6477, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ - { 6505, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ - { 6526, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - { 6560, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ - { 6593, 0x00000B02 }, /* GL_CURRENT_NORMAL */ - { 6611, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - { 6641, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ - { 6660, 0x00008865 }, /* GL_CURRENT_QUERY */ - { 6677, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ - { 6698, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ - { 6722, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ - { 6749, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ - { 6773, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ - { 6800, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ - { 6833, 0x0000845F }, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ - { 6867, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - { 6900, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ - { 6927, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ - { 6953, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ - { 6978, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ - { 7007, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ - { 7029, 0x00000900 }, /* GL_CW */ - { 7035, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ - { 7056, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ - { 7077, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ - { 7097, 0x00002101 }, /* GL_DECAL */ - { 7106, 0x00001E03 }, /* GL_DECR */ - { 7114, 0x00008508 }, /* GL_DECR_WRAP */ - { 7127, 0x00008508 }, /* GL_DECR_WRAP_EXT */ - { 7144, 0x00008B80 }, /* GL_DELETE_STATUS */ - { 7161, 0x00001801 }, /* GL_DEPTH */ - { 7170, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ - { 7190, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_EXT */ - { 7214, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ - { 7234, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 7258, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 7272, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 7286, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 7306, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 7331, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 7351, 0x0000864F }, /* GL_DEPTH_CLAMP */ - { 7366, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 7384, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 7405, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 7424, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 7445, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 7470, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 7496, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 7517, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 7542, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 7568, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 7589, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 7614, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 7640, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 7654, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 7669, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 7684, 0x000084F9 }, /* GL_DEPTH_STENCIL */ - { 7701, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ - { 7729, 0x000084F9 }, /* GL_DEPTH_STENCIL_EXT */ - { 7750, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 7770, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 7798, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 7826, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 7840, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 7862, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 7888, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 7907, 0x00001201 }, /* GL_DIFFUSE */ - { 7918, 0x00000BD0 }, /* GL_DITHER */ - { 7928, 0x00000A02 }, /* GL_DOMAIN */ - { 7938, 0x00001100 }, /* GL_DONT_CARE */ - { 7951, 0x000086AE }, /* GL_DOT3_RGB */ - { 7963, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7976, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7993, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 8010, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 8026, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 8042, 0x0000140A }, /* GL_DOUBLE */ - { 8052, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 8068, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 8083, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 8099, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 8119, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 8139, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 8155, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 8172, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 8193, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 8214, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 8231, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 8252, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 8273, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 8290, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 8311, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 8332, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 8349, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 8370, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 8391, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 8408, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 8429, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 8450, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 8467, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 8488, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 8509, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 8529, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 8549, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 8565, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 8585, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 8605, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 8621, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 8641, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 8661, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 8677, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 8697, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 8717, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 8733, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 8753, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 8773, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 8789, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 8809, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 8829, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 8845, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 8865, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 8885, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 8901, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 8921, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8941, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8957, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8977, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8997, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ - { 9017, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */ - { 9045, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 9077, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 9101, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 9121, 0x00000304 }, /* GL_DST_ALPHA */ - { 9134, 0x00000306 }, /* GL_DST_COLOR */ - { 9147, 0x0000877A }, /* GL_DU8DV8_ATI */ - { 9161, 0x00008779 }, /* GL_DUDV_ATI */ - { 9173, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 9189, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 9209, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 9225, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 9245, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 9261, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 9281, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 9294, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 9313, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 9347, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 9385, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 9412, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 9438, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 9462, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 9494, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 9530, 0x00001600 }, /* GL_EMISSION */ - { 9542, 0x00002000 }, /* GL_ENABLE_BIT */ - { 9556, 0x00000202 }, /* GL_EQUAL */ - { 9565, 0x00001509 }, /* GL_EQUIV */ - { 9574, 0x00010000 }, /* GL_EVAL_BIT */ - { 9586, 0x00000800 }, /* GL_EXP */ - { 9593, 0x00000801 }, /* GL_EXP2 */ - { 9601, 0x00001F03 }, /* GL_EXTENSIONS */ - { 9615, 0x00002400 }, /* GL_EYE_LINEAR */ - { 9629, 0x00002502 }, /* GL_EYE_PLANE */ - { 9642, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 9667, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 9684, 0x00000000 }, /* GL_FALSE */ - { 9693, 0x00001101 }, /* GL_FASTEST */ - { 9704, 0x00001C01 }, /* GL_FEEDBACK */ - { 9716, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 9743, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 9767, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 9791, 0x00001B02 }, /* GL_FILL */ - { 9799, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */ - { 9826, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - { 9857, 0x00001D00 }, /* GL_FLAT */ - { 9865, 0x00001406 }, /* GL_FLOAT */ - { 9874, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 9888, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 9906, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ - { 9922, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ - { 9938, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 9952, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 9970, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ - { 9986, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ - { 10002, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 10016, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 10034, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ - { 10050, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ - { 10066, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 10080, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 10098, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 10112, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 10130, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 10144, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 10162, 0x00000B60 }, /* GL_FOG */ - { 10169, 0x00000080 }, /* GL_FOG_BIT */ - { 10180, 0x00000B66 }, /* GL_FOG_COLOR */ - { 10193, 0x00008451 }, /* GL_FOG_COORD */ - { 10206, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 10224, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 10248, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 10287, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 10330, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 10362, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 10393, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 10422, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 10447, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 10466, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 10500, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 10527, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 10553, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 10577, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 10594, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 10609, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 10633, 0x00000B64 }, /* GL_FOG_END */ - { 10644, 0x00000C54 }, /* GL_FOG_HINT */ - { 10656, 0x00000B61 }, /* GL_FOG_INDEX */ - { 10669, 0x00000B65 }, /* GL_FOG_MODE */ - { 10681, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 10700, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 10725, 0x00000B63 }, /* GL_FOG_START */ - { 10738, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 10756, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 10780, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 10799, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 10822, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 10857, 0x00008D40 }, /* GL_FRAMEBUFFER */ - { 10872, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - { 10909, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - { 10945, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - { 10986, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - { 11027, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - { 11064, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - { 11101, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - { 11139, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 11181, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - { 11219, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 11261, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - { 11296, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - { 11335, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 11384, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - { 11432, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 11484, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - { 11524, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 11568, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - { 11608, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 11652, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */ - { 11675, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 11702, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ - { 11726, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 11754, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ - { 11777, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 11796, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - { 11833, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 11874, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 11915, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ - { 11953, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 11995, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 12046, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 12084, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - { 12129, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 12178, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - { 12216, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */ - { 12258, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ - { 12296, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 12338, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 12370, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ - { 12395, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ - { 12422, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 12453, 0x00000404 }, /* GL_FRONT */ - { 12462, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 12480, 0x00000B46 }, /* GL_FRONT_FACE */ - { 12494, 0x00000400 }, /* GL_FRONT_LEFT */ - { 12508, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 12523, 0x00008006 }, /* GL_FUNC_ADD */ - { 12535, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 12551, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 12576, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 12605, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 12622, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 12643, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 12662, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 12686, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 12715, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 12739, 0x00000206 }, /* GL_GEQUAL */ - { 12749, 0x00000204 }, /* GL_GREATER */ - { 12760, 0x00001904 }, /* GL_GREEN */ - { 12769, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 12783, 0x00000D53 }, /* GL_GREEN_BITS */ - { 12797, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 12812, 0x0000140B }, /* GL_HALF_FLOAT */ - { 12826, 0x00008000 }, /* GL_HINT_BIT */ - { 12838, 0x00008024 }, /* GL_HISTOGRAM */ - { 12851, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 12875, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 12903, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 12926, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 12953, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 12970, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 12990, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 13014, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 13038, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 13066, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 13094, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 13126, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 13148, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 13174, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 13192, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 13214, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 13233, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 13256, 0x0000862A }, /* GL_IDENTITY_NV */ - { 13271, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 13291, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 13331, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 13369, 0x00001E02 }, /* GL_INCR */ - { 13377, 0x00008507 }, /* GL_INCR_WRAP */ - { 13390, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 13407, 0x00008222 }, /* GL_INDEX */ - { 13416, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 13431, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 13461, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 13495, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 13518, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 13540, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 13560, 0x00000D51 }, /* GL_INDEX_BITS */ - { 13574, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 13595, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 13613, 0x00000C30 }, /* GL_INDEX_MODE */ - { 13627, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 13643, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 13658, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 13677, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 13696, 0x00001404 }, /* GL_INT */ - { 13703, 0x00008049 }, /* GL_INTENSITY */ - { 13716, 0x0000804C }, /* GL_INTENSITY12 */ - { 13731, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 13750, 0x0000804D }, /* GL_INTENSITY16 */ - { 13765, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 13784, 0x0000804A }, /* GL_INTENSITY4 */ - { 13798, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 13816, 0x0000804B }, /* GL_INTENSITY8 */ - { 13830, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 13848, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 13865, 0x00008575 }, /* GL_INTERPOLATE */ - { 13880, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 13899, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 13918, 0x00008B53 }, /* GL_INT_VEC2 */ - { 13930, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 13946, 0x00008B54 }, /* GL_INT_VEC3 */ - { 13958, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 13974, 0x00008B55 }, /* GL_INT_VEC4 */ - { 13986, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 14002, 0x00000500 }, /* GL_INVALID_ENUM */ - { 14018, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ - { 14051, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 14088, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 14109, 0x00000501 }, /* GL_INVALID_VALUE */ - { 14126, 0x0000862B }, /* GL_INVERSE_NV */ - { 14140, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 14164, 0x0000150A }, /* GL_INVERT */ - { 14174, 0x00001E00 }, /* GL_KEEP */ - { 14182, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ - { 14208, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ - { 14238, 0x00000406 }, /* GL_LEFT */ - { 14246, 0x00000203 }, /* GL_LEQUAL */ - { 14256, 0x00000201 }, /* GL_LESS */ - { 14264, 0x00004000 }, /* GL_LIGHT0 */ - { 14274, 0x00004001 }, /* GL_LIGHT1 */ - { 14284, 0x00004002 }, /* GL_LIGHT2 */ - { 14294, 0x00004003 }, /* GL_LIGHT3 */ - { 14304, 0x00004004 }, /* GL_LIGHT4 */ - { 14314, 0x00004005 }, /* GL_LIGHT5 */ - { 14324, 0x00004006 }, /* GL_LIGHT6 */ - { 14334, 0x00004007 }, /* GL_LIGHT7 */ - { 14344, 0x00000B50 }, /* GL_LIGHTING */ - { 14356, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 14372, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 14395, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 14424, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 14457, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 14485, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 14509, 0x00001B01 }, /* GL_LINE */ - { 14517, 0x00002601 }, /* GL_LINEAR */ - { 14527, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 14549, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 14579, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 14610, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 14634, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 14659, 0x00000001 }, /* GL_LINES */ - { 14668, 0x00000004 }, /* GL_LINE_BIT */ - { 14680, 0x00000002 }, /* GL_LINE_LOOP */ - { 14693, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 14713, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 14728, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 14748, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 14764, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 14788, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 14811, 0x00000003 }, /* GL_LINE_STRIP */ - { 14825, 0x00000702 }, /* GL_LINE_TOKEN */ - { 14839, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 14853, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 14879, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 14899, 0x00008B82 }, /* GL_LINK_STATUS */ - { 14914, 0x00000B32 }, /* GL_LIST_BASE */ - { 14927, 0x00020000 }, /* GL_LIST_BIT */ - { 14939, 0x00000B33 }, /* GL_LIST_INDEX */ - { 14953, 0x00000B30 }, /* GL_LIST_MODE */ - { 14966, 0x00000101 }, /* GL_LOAD */ - { 14974, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 14986, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 15003, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 15017, 0x00001909 }, /* GL_LUMINANCE */ - { 15030, 0x00008041 }, /* GL_LUMINANCE12 */ - { 15045, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 15068, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 15095, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 15117, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 15143, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 15162, 0x00008042 }, /* GL_LUMINANCE16 */ - { 15177, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 15200, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 15227, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 15246, 0x0000803F }, /* GL_LUMINANCE4 */ - { 15260, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 15281, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 15306, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 15324, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 15345, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 15370, 0x00008040 }, /* GL_LUMINANCE8 */ - { 15384, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 15405, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 15430, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 15448, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 15467, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 15483, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 15503, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 15525, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 15539, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 15554, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 15578, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 15602, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 15626, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 15650, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 15667, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 15684, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 15712, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 15741, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 15770, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 15799, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 15828, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 15857, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 15886, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 15914, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 15942, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 15970, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 15998, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 16026, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 16054, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 16082, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 16110, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 16138, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 16154, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 16174, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 16196, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 16210, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 16225, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 16249, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 16273, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 16297, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 16321, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 16338, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 16355, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 16383, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 16412, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 16441, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 16470, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 16499, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 16528, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 16557, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 16585, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 16613, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 16641, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 16669, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 16697, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 16725, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 16753, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 16781, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 16809, 0x00000D10 }, /* GL_MAP_COLOR */ - { 16822, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ - { 16848, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ - { 16877, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ - { 16905, 0x00000001 }, /* GL_MAP_READ_BIT */ - { 16921, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 16936, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ - { 16962, 0x00000002 }, /* GL_MAP_WRITE_BIT */ - { 16979, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 16994, 0x00008630 }, /* GL_MATRIX0_NV */ - { 17008, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 17024, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 17040, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 17056, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 17072, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 17088, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 17104, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 17120, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 17136, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 17152, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 17168, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 17183, 0x00008631 }, /* GL_MATRIX1_NV */ - { 17197, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 17213, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 17229, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 17245, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 17261, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 17277, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 17293, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 17309, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 17325, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 17341, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 17357, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 17372, 0x00008632 }, /* GL_MATRIX2_NV */ - { 17386, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 17402, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 17418, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 17433, 0x00008633 }, /* GL_MATRIX3_NV */ - { 17447, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 17462, 0x00008634 }, /* GL_MATRIX4_NV */ - { 17476, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 17491, 0x00008635 }, /* GL_MATRIX5_NV */ - { 17505, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 17520, 0x00008636 }, /* GL_MATRIX6_NV */ - { 17534, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 17549, 0x00008637 }, /* GL_MATRIX7_NV */ - { 17563, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 17578, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 17593, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 17619, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 17653, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 17684, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 17717, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 17748, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 17763, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 17785, 0x00008008 }, /* GL_MAX */ - { 17792, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 17815, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 17847, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 17873, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 17906, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 17932, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 17966, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 17985, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */ - { 18010, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 18039, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 18071, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 18107, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 18143, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 18183, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 18209, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 18239, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 18264, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 18293, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 18322, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 18355, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 18375, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 18399, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 18423, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 18447, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 18472, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 18490, 0x00008008 }, /* GL_MAX_EXT */ - { 18501, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 18536, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 18575, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 18589, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 18609, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 18647, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 18676, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 18700, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 18728, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 18751, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 18788, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 18824, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 18851, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 18880, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 18914, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 18950, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 18977, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 19009, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 19045, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 19074, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 19103, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 19131, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 19169, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 19213, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 19256, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 19290, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 19329, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 19366, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 19404, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 19447, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 19490, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 19520, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 19551, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 19587, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 19623, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 19653, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 19687, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 19720, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */ - { 19745, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 19774, 0x00008D57 }, /* GL_MAX_SAMPLES */ - { 19789, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */ - { 19808, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - { 19835, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 19855, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 19879, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 19901, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 19927, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 19954, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 19985, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 20009, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 20043, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 20063, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 20090, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 20111, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 20136, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 20161, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 20196, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 20218, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 20244, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 20266, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 20292, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 20326, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 20364, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 20397, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 20434, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 20458, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 20479, 0x00008007 }, /* GL_MIN */ - { 20486, 0x0000802E }, /* GL_MINMAX */ - { 20496, 0x0000802E }, /* GL_MINMAX_EXT */ - { 20510, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 20527, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 20548, 0x00008030 }, /* GL_MINMAX_SINK */ - { 20563, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 20582, 0x00008007 }, /* GL_MIN_EXT */ - { 20593, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 20612, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 20635, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 20658, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 20678, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 20698, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 20728, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 20756, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 20784, 0x00001700 }, /* GL_MODELVIEW */ - { 20797, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 20815, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 20834, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 20853, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 20872, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 20891, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 20910, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 20929, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 20948, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 20967, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 20986, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 21005, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 21023, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 21042, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 21061, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 21080, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 21099, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 21118, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 21137, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 21156, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 21175, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 21194, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 21213, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 21231, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 21250, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 21269, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 21287, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 21305, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 21323, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 21341, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 21359, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 21377, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 21395, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 21415, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 21442, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 21467, 0x00002100 }, /* GL_MODULATE */ - { 21479, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 21499, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 21526, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 21551, 0x00000103 }, /* GL_MULT */ - { 21559, 0x0000809D }, /* GL_MULTISAMPLE */ - { 21574, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 21594, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 21613, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 21632, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 21656, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 21679, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 21709, 0x00002A25 }, /* GL_N3F_V3F */ - { 21720, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 21740, 0x0000150E }, /* GL_NAND */ - { 21748, 0x00002600 }, /* GL_NEAREST */ - { 21759, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 21790, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 21822, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 21847, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 21873, 0x00000200 }, /* GL_NEVER */ - { 21882, 0x00001102 }, /* GL_NICEST */ - { 21892, 0x00000000 }, /* GL_NONE */ - { 21900, 0x00001505 }, /* GL_NOOP */ - { 21908, 0x00001508 }, /* GL_NOR */ - { 21915, 0x00000BA1 }, /* GL_NORMALIZE */ - { 21928, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 21944, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 21975, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 22010, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 22034, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 22057, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 22078, 0x00008511 }, /* GL_NORMAL_MAP */ - { 22092, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 22110, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 22127, 0x00000205 }, /* GL_NOTEQUAL */ - { 22139, 0x00000000 }, /* GL_NO_ERROR */ - { 22151, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 22185, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 22223, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 22255, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 22297, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 22327, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 22367, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 22398, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 22427, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 22455, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 22485, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 22502, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 22528, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 22544, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 22579, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 22601, 0x00009112 }, /* GL_OBJECT_TYPE */ - { 22616, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 22635, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 22665, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 22686, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 22714, 0x00000001 }, /* GL_ONE */ - { 22721, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 22749, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 22781, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 22809, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 22841, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 22864, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 22887, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 22910, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 22933, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 22951, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 22973, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 22995, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 23011, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 23031, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 23051, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 23069, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 23091, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 23113, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 23129, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 23149, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 23169, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 23187, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 23209, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 23231, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 23247, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 23267, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 23287, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 23308, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 23327, 0x00001507 }, /* GL_OR */ - { 23333, 0x00000A01 }, /* GL_ORDER */ - { 23342, 0x0000150D }, /* GL_OR_INVERTED */ - { 23357, 0x0000150B }, /* GL_OR_REVERSE */ - { 23371, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 23388, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 23406, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 23427, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 23447, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 23465, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 23484, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 23504, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 23524, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 23542, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 23561, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 23586, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 23610, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 23631, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 23653, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 23675, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 23700, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 23724, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 23745, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 23767, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 23789, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 23811, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 23842, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 23862, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 23887, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 23907, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 23932, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 23952, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 23977, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 23997, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 24022, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 24042, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 24067, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 24087, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 24112, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 24132, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 24157, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 24177, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 24202, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 24222, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 24247, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 24267, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 24292, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 24310, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ - { 24331, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ - { 24360, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 24393, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 24418, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ - { 24441, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 24472, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 24507, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 24534, 0x00001B00 }, /* GL_POINT */ - { 24543, 0x00000000 }, /* GL_POINTS */ - { 24553, 0x00000002 }, /* GL_POINT_BIT */ - { 24566, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 24596, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 24630, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 24664, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 24699, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 24728, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 24761, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 24794, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 24828, 0x00000B11 }, /* GL_POINT_SIZE */ - { 24842, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 24868, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 24886, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 24908, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 24930, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 24953, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 24971, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 24993, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 25015, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 25038, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 25058, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 25074, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 25095, 0x00008861 }, /* GL_POINT_SPRITE */ - { 25111, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 25131, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 25160, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 25179, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 25205, 0x00000701 }, /* GL_POINT_TOKEN */ - { 25220, 0x00000009 }, /* GL_POLYGON */ - { 25231, 0x00000008 }, /* GL_POLYGON_BIT */ - { 25246, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 25262, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 25285, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 25310, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 25333, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 25356, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 25380, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 25404, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 25422, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 25445, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 25464, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 25487, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 25504, 0x00001203 }, /* GL_POSITION */ - { 25516, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 25548, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 25584, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 25617, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 25654, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 25685, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 25720, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 25752, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 25788, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25821, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 25853, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 25889, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 25922, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 25959, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 25989, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 26023, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 26054, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 26089, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 26120, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 26155, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 26187, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 26223, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 26253, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 26287, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 26318, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 26353, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 26385, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 26416, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 26451, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 26483, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 26519, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 26548, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 26581, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 26611, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 26645, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 26684, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 26717, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 26757, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 26791, 0x00008578 }, /* GL_PREVIOUS */ - { 26803, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 26819, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 26835, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 26852, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 26873, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 26894, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 26927, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 26959, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 26982, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 27005, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 27035, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 27064, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 27092, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 27114, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 27142, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 27170, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 27192, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 27213, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 27253, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 27292, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 27322, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 27357, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 27390, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 27424, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 27463, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 27502, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 27524, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 27550, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 27574, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 27597, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 27619, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 27640, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 27661, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 27688, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 27720, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 27752, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 27787, 0x00001701 }, /* GL_PROJECTION */ - { 27801, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 27822, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 27848, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ - { 27868, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ - { 27892, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 27913, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 27932, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 27955, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 27994, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 28032, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 28052, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 28082, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 28106, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 28126, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 28156, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 28180, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 28200, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 28233, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 28259, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 28289, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 28320, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 28350, 0x00002003 }, /* GL_Q */ - { 28355, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 28380, 0x00000007 }, /* GL_QUADS */ - { 28389, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ - { 28433, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - { 28481, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 28498, 0x00000008 }, /* GL_QUAD_STRIP */ - { 28512, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ - { 28542, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */ - { 28569, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 28591, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 28617, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */ - { 28637, 0x00008866 }, /* GL_QUERY_RESULT */ - { 28653, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 28673, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 28699, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 28729, 0x00008E13 }, /* GL_QUERY_WAIT_NV */ - { 28746, 0x00002002 }, /* GL_R */ - { 28751, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 28763, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 28796, 0x00000C02 }, /* GL_READ_BUFFER */ - { 28811, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ - { 28831, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */ - { 28859, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 28891, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 28915, 0x000088B8 }, /* GL_READ_ONLY */ - { 28928, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 28945, 0x000088BA }, /* GL_READ_WRITE */ - { 28959, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 28977, 0x00001903 }, /* GL_RED */ - { 28984, 0x00008016 }, /* GL_REDUCE */ - { 28994, 0x00008016 }, /* GL_REDUCE_EXT */ - { 29008, 0x00000D15 }, /* GL_RED_BIAS */ - { 29020, 0x00000D52 }, /* GL_RED_BITS */ - { 29032, 0x00000D14 }, /* GL_RED_SCALE */ - { 29045, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 29063, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 29085, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 29106, 0x00001C00 }, /* GL_RENDER */ - { 29116, 0x00008D41 }, /* GL_RENDERBUFFER */ - { 29132, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ - { 29159, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */ - { 29183, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 29211, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ - { 29237, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ - { 29264, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 29284, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ - { 29311, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ - { 29334, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 29361, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - { 29393, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 29429, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ - { 29454, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ - { 29478, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */ - { 29506, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ - { 29535, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ - { 29557, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 29583, 0x00001F01 }, /* GL_RENDERER */ - { 29595, 0x00000C40 }, /* GL_RENDER_MODE */ - { 29610, 0x00002901 }, /* GL_REPEAT */ - { 29620, 0x00001E01 }, /* GL_REPLACE */ - { 29631, 0x00008062 }, /* GL_REPLACE_EXT */ - { 29646, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 29669, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 29687, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 29709, 0x00000102 }, /* GL_RETURN */ - { 29719, 0x00001907 }, /* GL_RGB */ - { 29726, 0x00008052 }, /* GL_RGB10 */ - { 29735, 0x00008059 }, /* GL_RGB10_A2 */ - { 29747, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 29763, 0x00008052 }, /* GL_RGB10_EXT */ - { 29776, 0x00008053 }, /* GL_RGB12 */ - { 29785, 0x00008053 }, /* GL_RGB12_EXT */ - { 29798, 0x00008054 }, /* GL_RGB16 */ - { 29807, 0x00008054 }, /* GL_RGB16_EXT */ - { 29820, 0x0000804E }, /* GL_RGB2_EXT */ - { 29832, 0x0000804F }, /* GL_RGB4 */ - { 29840, 0x0000804F }, /* GL_RGB4_EXT */ - { 29852, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 29865, 0x00008050 }, /* GL_RGB5 */ - { 29873, 0x00008057 }, /* GL_RGB5_A1 */ - { 29884, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 29899, 0x00008050 }, /* GL_RGB5_EXT */ - { 29911, 0x00008051 }, /* GL_RGB8 */ - { 29919, 0x00008051 }, /* GL_RGB8_EXT */ - { 29931, 0x00001908 }, /* GL_RGBA */ - { 29939, 0x0000805A }, /* GL_RGBA12 */ - { 29949, 0x0000805A }, /* GL_RGBA12_EXT */ - { 29963, 0x0000805B }, /* GL_RGBA16 */ - { 29973, 0x0000805B }, /* GL_RGBA16_EXT */ - { 29987, 0x00008055 }, /* GL_RGBA2 */ - { 29996, 0x00008055 }, /* GL_RGBA2_EXT */ - { 30009, 0x00008056 }, /* GL_RGBA4 */ - { 30018, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 30037, 0x00008056 }, /* GL_RGBA4_EXT */ - { 30050, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 30064, 0x00008058 }, /* GL_RGBA8 */ - { 30073, 0x00008058 }, /* GL_RGBA8_EXT */ - { 30086, 0x00008F97 }, /* GL_RGBA8_SNORM */ - { 30101, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 30119, 0x00000C31 }, /* GL_RGBA_MODE */ - { 30132, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 30145, 0x00008F93 }, /* GL_RGBA_SNORM */ - { 30159, 0x000083A0 }, /* GL_RGB_S3TC */ - { 30171, 0x00008573 }, /* GL_RGB_SCALE */ - { 30184, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 30201, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 30218, 0x00000407 }, /* GL_RIGHT */ - { 30227, 0x00002000 }, /* GL_S */ - { 30232, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 30246, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 30267, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 30281, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 30302, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 30316, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 30332, 0x000080A9 }, /* GL_SAMPLES */ - { 30343, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 30359, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 30374, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 30392, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 30414, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 30442, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 30474, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 30497, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 30524, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 30542, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 30565, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 30587, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 30606, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 30629, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 30655, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 30685, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 30710, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 30739, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 30754, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 30769, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 30785, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 30810, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 30850, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 30894, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 30927, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 30957, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 30989, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 31019, 0x00001C02 }, /* GL_SELECT */ - { 31029, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 31057, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 31082, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 31098, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 31125, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 31156, 0x0000150F }, /* GL_SET */ - { 31163, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 31184, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 31208, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 31223, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 31238, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 31266, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 31289, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 31319, 0x00001601 }, /* GL_SHININESS */ - { 31332, 0x00001402 }, /* GL_SHORT */ - { 31341, 0x00009119 }, /* GL_SIGNALED */ - { 31353, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ - { 31374, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 31390, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 31410, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 31429, 0x00008C46 }, /* GL_SLUMINANCE */ - { 31443, 0x00008C47 }, /* GL_SLUMINANCE8 */ - { 31458, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ - { 31480, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ - { 31500, 0x00001D01 }, /* GL_SMOOTH */ - { 31510, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 31543, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 31570, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 31603, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 31630, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 31647, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 31668, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 31689, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 31704, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 31723, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 31742, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 31759, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 31780, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 31801, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 31816, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 31835, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 31854, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 31871, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 31892, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 31913, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 31928, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 31947, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 31966, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 31986, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 32004, 0x00001202 }, /* GL_SPECULAR */ - { 32016, 0x00002402 }, /* GL_SPHERE_MAP */ - { 32030, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 32045, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 32063, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 32080, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 32094, 0x00008580 }, /* GL_SRC0_RGB */ - { 32106, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 32120, 0x00008581 }, /* GL_SRC1_RGB */ - { 32132, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 32146, 0x00008582 }, /* GL_SRC2_RGB */ - { 32158, 0x00000302 }, /* GL_SRC_ALPHA */ - { 32171, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 32193, 0x00000300 }, /* GL_SRC_COLOR */ - { 32206, 0x00008C40 }, /* GL_SRGB */ - { 32214, 0x00008C41 }, /* GL_SRGB8 */ - { 32223, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ - { 32239, 0x00008C42 }, /* GL_SRGB_ALPHA */ - { 32253, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 32271, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 32290, 0x000088E6 }, /* GL_STATIC_COPY */ - { 32305, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 32324, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 32339, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 32358, 0x000088E5 }, /* GL_STATIC_READ */ - { 32373, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 32392, 0x00001802 }, /* GL_STENCIL */ - { 32403, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ - { 32425, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 32451, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 32472, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 32497, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 32518, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 32543, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 32575, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 32611, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 32643, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 32679, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 32699, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 32726, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 32752, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 32768, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 32790, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 32813, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 32829, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 32845, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 32862, 0x00008D46 }, /* GL_STENCIL_INDEX1 */ - { 32880, 0x00008D49 }, /* GL_STENCIL_INDEX16 */ - { 32899, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 32922, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 32944, 0x00008D47 }, /* GL_STENCIL_INDEX4 */ - { 32962, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 32984, 0x00008D48 }, /* GL_STENCIL_INDEX8 */ - { 33002, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 33024, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 33045, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 33072, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 33099, 0x00000B97 }, /* GL_STENCIL_REF */ - { 33114, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 33130, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 33159, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 33181, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 33202, 0x00000C33 }, /* GL_STEREO */ - { 33212, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ - { 33236, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ - { 33261, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ - { 33285, 0x000088E2 }, /* GL_STREAM_COPY */ - { 33300, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 33319, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 33334, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 33353, 0x000088E1 }, /* GL_STREAM_READ */ - { 33368, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 33387, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 33404, 0x000084E7 }, /* GL_SUBTRACT */ - { 33416, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 33432, 0x00009113 }, /* GL_SYNC_CONDITION */ - { 33450, 0x00009116 }, /* GL_SYNC_FENCE */ - { 33464, 0x00009115 }, /* GL_SYNC_FLAGS */ - { 33478, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ - { 33505, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - { 33535, 0x00009114 }, /* GL_SYNC_STATUS */ - { 33550, 0x00002001 }, /* GL_T */ - { 33555, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 33570, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 33589, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 33605, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 33620, 0x00002A27 }, /* GL_T2F_V3F */ - { 33631, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 33650, 0x00002A28 }, /* GL_T4F_V4F */ - { 33661, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 33684, 0x00001702 }, /* GL_TEXTURE */ - { 33695, 0x000084C0 }, /* GL_TEXTURE0 */ - { 33707, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 33723, 0x000084C1 }, /* GL_TEXTURE1 */ - { 33735, 0x000084CA }, /* GL_TEXTURE10 */ - { 33748, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 33765, 0x000084CB }, /* GL_TEXTURE11 */ - { 33778, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 33795, 0x000084CC }, /* GL_TEXTURE12 */ - { 33808, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 33825, 0x000084CD }, /* GL_TEXTURE13 */ - { 33838, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 33855, 0x000084CE }, /* GL_TEXTURE14 */ - { 33868, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 33885, 0x000084CF }, /* GL_TEXTURE15 */ - { 33898, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 33915, 0x000084D0 }, /* GL_TEXTURE16 */ - { 33928, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 33945, 0x000084D1 }, /* GL_TEXTURE17 */ - { 33958, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 33975, 0x000084D2 }, /* GL_TEXTURE18 */ - { 33988, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 34005, 0x000084D3 }, /* GL_TEXTURE19 */ - { 34018, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 34035, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 34051, 0x000084C2 }, /* GL_TEXTURE2 */ - { 34063, 0x000084D4 }, /* GL_TEXTURE20 */ - { 34076, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 34093, 0x000084D5 }, /* GL_TEXTURE21 */ - { 34106, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 34123, 0x000084D6 }, /* GL_TEXTURE22 */ - { 34136, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 34153, 0x000084D7 }, /* GL_TEXTURE23 */ - { 34166, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 34183, 0x000084D8 }, /* GL_TEXTURE24 */ - { 34196, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 34213, 0x000084D9 }, /* GL_TEXTURE25 */ - { 34226, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 34243, 0x000084DA }, /* GL_TEXTURE26 */ - { 34256, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 34273, 0x000084DB }, /* GL_TEXTURE27 */ - { 34286, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 34303, 0x000084DC }, /* GL_TEXTURE28 */ - { 34316, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 34333, 0x000084DD }, /* GL_TEXTURE29 */ - { 34346, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 34363, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 34379, 0x000084C3 }, /* GL_TEXTURE3 */ - { 34391, 0x000084DE }, /* GL_TEXTURE30 */ - { 34404, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 34421, 0x000084DF }, /* GL_TEXTURE31 */ - { 34434, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 34451, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 34467, 0x000084C4 }, /* GL_TEXTURE4 */ - { 34479, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 34495, 0x000084C5 }, /* GL_TEXTURE5 */ - { 34507, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 34523, 0x000084C6 }, /* GL_TEXTURE6 */ - { 34535, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 34551, 0x000084C7 }, /* GL_TEXTURE7 */ - { 34563, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 34579, 0x000084C8 }, /* GL_TEXTURE8 */ - { 34591, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 34607, 0x000084C9 }, /* GL_TEXTURE9 */ - { 34619, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 34635, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 34649, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 34673, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 34687, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 34711, 0x0000806F }, /* GL_TEXTURE_3D */ - { 34725, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 34747, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 34773, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 34795, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 34817, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 34849, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 34871, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 34903, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 34925, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 34953, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 34985, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 35018, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 35050, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 35065, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 35086, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 35111, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 35129, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 35153, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 35184, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 35214, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 35244, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 35279, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 35310, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 35348, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 35375, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 35407, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 35441, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 35465, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 35493, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 35517, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 35545, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 35578, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 35602, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 35624, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 35646, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 35672, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 35706, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 35739, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 35776, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 35804, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 35836, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 35859, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 35897, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 35939, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 35970, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 35998, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 36028, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 36056, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 36076, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 36100, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 36131, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 36166, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 36197, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 36232, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 36263, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 36298, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 36329, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 36364, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 36395, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 36430, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 36461, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 36496, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - { 36525, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 36542, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 36564, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 36590, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 36605, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 36626, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 36646, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 36672, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 36692, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 36709, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 36726, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 36743, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 36760, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 36785, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 36807, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 36833, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 36851, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 36877, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 36903, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 36933, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 36960, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 36985, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 37005, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 37029, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 37056, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 37083, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 37110, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 37136, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 37166, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 37188, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 37206, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 37236, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 37264, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 37292, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 37320, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 37341, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 37360, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 37382, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 37401, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 37421, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - { 37451, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - { 37482, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 37507, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 37531, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 37551, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 37575, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 37595, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 37618, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ - { 37642, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */ - { 37670, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - { 37700, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 37725, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 37759, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 37776, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 37794, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 37812, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 37830, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ - { 37849, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 37869, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 37888, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 37917, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 37934, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 37960, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 37990, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 38022, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 38052, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 38086, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 38102, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 38133, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 38168, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 38196, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 38228, 0x00000004 }, /* GL_TRIANGLES */ - { 38241, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 38257, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 38278, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 38296, 0x00000001 }, /* GL_TRUE */ - { 38304, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 38324, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 38347, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 38367, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 38388, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 38410, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 38432, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 38452, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 38473, 0x00009118 }, /* GL_UNSIGNALED */ - { 38487, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 38504, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 38531, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 38554, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 38570, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 38597, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ - { 38618, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */ - { 38643, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 38667, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 38698, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 38722, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 38750, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ - { 38773, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 38791, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 38821, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 38847, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 38877, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 38903, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 38927, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 38955, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 38983, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 39010, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 39042, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 39073, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 39087, 0x00002A20 }, /* GL_V2F */ - { 39094, 0x00002A21 }, /* GL_V3F */ - { 39101, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 39120, 0x00001F00 }, /* GL_VENDOR */ - { 39130, 0x00001F02 }, /* GL_VERSION */ - { 39141, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 39157, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ - { 39181, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 39211, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 39242, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 39277, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 39301, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 39322, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 39345, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 39366, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 39393, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 39421, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 39449, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 39477, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 39505, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 39533, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 39561, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 39588, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 39615, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 39642, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 39669, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 39696, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 39723, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 39750, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 39777, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 39804, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 39842, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 39884, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 39915, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 39950, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 39984, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 40022, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 40053, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 40088, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 40116, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 40148, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 40178, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 40212, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 40240, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 40272, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 40292, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 40314, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 40343, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 40364, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 40393, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 40426, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 40458, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 40485, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 40516, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 40546, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 40563, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 40584, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 40611, 0x00000BA2 }, /* GL_VIEWPORT */ - { 40623, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 40639, 0x0000911D }, /* GL_WAIT_FAILED */ - { 40654, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 40674, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 40705, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 40740, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 40768, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 40793, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 40820, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 40845, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 40869, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 40888, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 40902, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 40920, 0x00001506 }, /* GL_XOR */ - { 40927, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 40946, 0x00008757 }, /* GL_YCBCR_MESA */ - { 40960, 0x00000000 }, /* GL_ZERO */ - { 40968, 0x00000D16 }, /* GL_ZOOM_X */ - { 40978, 0x00000D17 }, /* GL_ZOOM_Y */ + { 1824, 0x000085B3 }, /* GL_BUFFER_OBJECT_APPLE */ + { 1847, 0x00008A12 }, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ + { 1881, 0x00008764 }, /* GL_BUFFER_SIZE */ + { 1896, 0x00008764 }, /* GL_BUFFER_SIZE_ARB */ + { 1915, 0x00008765 }, /* GL_BUFFER_USAGE */ + { 1931, 0x00008765 }, /* GL_BUFFER_USAGE_ARB */ + { 1951, 0x0000877B }, /* GL_BUMP_ENVMAP_ATI */ + { 1970, 0x00008777 }, /* GL_BUMP_NUM_TEX_UNITS_ATI */ + { 1996, 0x00008775 }, /* GL_BUMP_ROT_MATRIX_ATI */ + { 2019, 0x00008776 }, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ + { 2047, 0x0000877C }, /* GL_BUMP_TARGET_ATI */ + { 2066, 0x00008778 }, /* GL_BUMP_TEX_UNITS_ATI */ + { 2088, 0x00001400 }, /* GL_BYTE */ + { 2096, 0x00002A24 }, /* GL_C3F_V3F */ + { 2107, 0x00002A26 }, /* GL_C4F_N3F_V3F */ + { 2122, 0x00002A22 }, /* GL_C4UB_V2F */ + { 2134, 0x00002A23 }, /* GL_C4UB_V3F */ + { 2146, 0x00000901 }, /* GL_CCW */ + { 2153, 0x00002900 }, /* GL_CLAMP */ + { 2162, 0x0000812D }, /* GL_CLAMP_TO_BORDER */ + { 2181, 0x0000812D }, /* GL_CLAMP_TO_BORDER_ARB */ + { 2204, 0x0000812D }, /* GL_CLAMP_TO_BORDER_SGIS */ + { 2228, 0x0000812F }, /* GL_CLAMP_TO_EDGE */ + { 2245, 0x0000812F }, /* GL_CLAMP_TO_EDGE_SGIS */ + { 2267, 0x00001500 }, /* GL_CLEAR */ + { 2276, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE */ + { 2301, 0x000084E1 }, /* GL_CLIENT_ACTIVE_TEXTURE_ARB */ + { 2330, 0xFFFFFFFF }, /* GL_CLIENT_ALL_ATTRIB_BITS */ + { 2356, 0x00000BB1 }, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + { 2385, 0x00000001 }, /* GL_CLIENT_PIXEL_STORE_BIT */ + { 2411, 0x00000002 }, /* GL_CLIENT_VERTEX_ARRAY_BIT */ + { 2438, 0x00003000 }, /* GL_CLIP_PLANE0 */ + { 2453, 0x00003001 }, /* GL_CLIP_PLANE1 */ + { 2468, 0x00003002 }, /* GL_CLIP_PLANE2 */ + { 2483, 0x00003003 }, /* GL_CLIP_PLANE3 */ + { 2498, 0x00003004 }, /* GL_CLIP_PLANE4 */ + { 2513, 0x00003005 }, /* GL_CLIP_PLANE5 */ + { 2528, 0x000080F0 }, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + { 2561, 0x00000A00 }, /* GL_COEFF */ + { 2570, 0x00001800 }, /* GL_COLOR */ + { 2579, 0x00008076 }, /* GL_COLOR_ARRAY */ + { 2594, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + { 2624, 0x00008898 }, /* GL_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 2658, 0x00008090 }, /* GL_COLOR_ARRAY_POINTER */ + { 2681, 0x00008081 }, /* GL_COLOR_ARRAY_SIZE */ + { 2701, 0x00008083 }, /* GL_COLOR_ARRAY_STRIDE */ + { 2723, 0x00008082 }, /* GL_COLOR_ARRAY_TYPE */ + { 2743, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0 */ + { 2764, 0x00008CE0 }, /* GL_COLOR_ATTACHMENT0_EXT */ + { 2789, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1 */ + { 2810, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10 */ + { 2832, 0x00008CEA }, /* GL_COLOR_ATTACHMENT10_EXT */ + { 2858, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11 */ + { 2880, 0x00008CEB }, /* GL_COLOR_ATTACHMENT11_EXT */ + { 2906, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12 */ + { 2928, 0x00008CEC }, /* GL_COLOR_ATTACHMENT12_EXT */ + { 2954, 0x00008CED }, /* GL_COLOR_ATTACHMENT13 */ + { 2976, 0x00008CED }, /* GL_COLOR_ATTACHMENT13_EXT */ + { 3002, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14 */ + { 3024, 0x00008CEE }, /* GL_COLOR_ATTACHMENT14_EXT */ + { 3050, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15 */ + { 3072, 0x00008CEF }, /* GL_COLOR_ATTACHMENT15_EXT */ + { 3098, 0x00008CE1 }, /* GL_COLOR_ATTACHMENT1_EXT */ + { 3123, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2 */ + { 3144, 0x00008CE2 }, /* GL_COLOR_ATTACHMENT2_EXT */ + { 3169, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3 */ + { 3190, 0x00008CE3 }, /* GL_COLOR_ATTACHMENT3_EXT */ + { 3215, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4 */ + { 3236, 0x00008CE4 }, /* GL_COLOR_ATTACHMENT4_EXT */ + { 3261, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5 */ + { 3282, 0x00008CE5 }, /* GL_COLOR_ATTACHMENT5_EXT */ + { 3307, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6 */ + { 3328, 0x00008CE6 }, /* GL_COLOR_ATTACHMENT6_EXT */ + { 3353, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7 */ + { 3374, 0x00008CE7 }, /* GL_COLOR_ATTACHMENT7_EXT */ + { 3399, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8 */ + { 3420, 0x00008CE8 }, /* GL_COLOR_ATTACHMENT8_EXT */ + { 3445, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9 */ + { 3466, 0x00008CE9 }, /* GL_COLOR_ATTACHMENT9_EXT */ + { 3491, 0x00004000 }, /* GL_COLOR_BUFFER_BIT */ + { 3511, 0x00000C22 }, /* GL_COLOR_CLEAR_VALUE */ + { 3532, 0x00001900 }, /* GL_COLOR_INDEX */ + { 3547, 0x00001603 }, /* GL_COLOR_INDEXES */ + { 3564, 0x00000BF2 }, /* GL_COLOR_LOGIC_OP */ + { 3582, 0x00000B57 }, /* GL_COLOR_MATERIAL */ + { 3600, 0x00000B55 }, /* GL_COLOR_MATERIAL_FACE */ + { 3623, 0x00000B56 }, /* GL_COLOR_MATERIAL_PARAMETER */ + { 3651, 0x000080B1 }, /* GL_COLOR_MATRIX */ + { 3667, 0x000080B1 }, /* GL_COLOR_MATRIX_SGI */ + { 3687, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH */ + { 3715, 0x000080B2 }, /* GL_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 3747, 0x00008458 }, /* GL_COLOR_SUM */ + { 3760, 0x00008458 }, /* GL_COLOR_SUM_ARB */ + { 3777, 0x000080D0 }, /* GL_COLOR_TABLE */ + { 3792, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE */ + { 3818, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_EXT */ + { 3848, 0x000080DD }, /* GL_COLOR_TABLE_ALPHA_SIZE_SGI */ + { 3878, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS */ + { 3898, 0x000080D7 }, /* GL_COLOR_TABLE_BIAS_SGI */ + { 3922, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE */ + { 3947, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_EXT */ + { 3976, 0x000080DC }, /* GL_COLOR_TABLE_BLUE_SIZE_SGI */ + { 4005, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT */ + { 4027, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_EXT */ + { 4053, 0x000080D8 }, /* GL_COLOR_TABLE_FORMAT_SGI */ + { 4079, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE */ + { 4105, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_EXT */ + { 4135, 0x000080DB }, /* GL_COLOR_TABLE_GREEN_SIZE_SGI */ + { 4165, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + { 4195, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_EXT */ + { 4229, 0x000080DF }, /* GL_COLOR_TABLE_INTENSITY_SIZE_SGI */ + { 4263, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + { 4293, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_EXT */ + { 4327, 0x000080DE }, /* GL_COLOR_TABLE_LUMINANCE_SIZE_SGI */ + { 4361, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE */ + { 4385, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_EXT */ + { 4413, 0x000080DA }, /* GL_COLOR_TABLE_RED_SIZE_SGI */ + { 4441, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE */ + { 4462, 0x000080D6 }, /* GL_COLOR_TABLE_SCALE_SGI */ + { 4487, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH */ + { 4508, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_EXT */ + { 4533, 0x000080D9 }, /* GL_COLOR_TABLE_WIDTH_SGI */ + { 4558, 0x00000C23 }, /* GL_COLOR_WRITEMASK */ + { 4577, 0x00008570 }, /* GL_COMBINE */ + { 4588, 0x00008503 }, /* GL_COMBINE4 */ + { 4600, 0x00008572 }, /* GL_COMBINE_ALPHA */ + { 4617, 0x00008572 }, /* GL_COMBINE_ALPHA_ARB */ + { 4638, 0x00008572 }, /* GL_COMBINE_ALPHA_EXT */ + { 4659, 0x00008570 }, /* GL_COMBINE_ARB */ + { 4674, 0x00008570 }, /* GL_COMBINE_EXT */ + { 4689, 0x00008571 }, /* GL_COMBINE_RGB */ + { 4704, 0x00008571 }, /* GL_COMBINE_RGB_ARB */ + { 4723, 0x00008571 }, /* GL_COMBINE_RGB_EXT */ + { 4742, 0x0000884E }, /* GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT */ + { 4778, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE */ + { 4802, 0x0000884E }, /* GL_COMPARE_R_TO_TEXTURE_ARB */ + { 4830, 0x00001300 }, /* GL_COMPILE */ + { 4841, 0x00001301 }, /* GL_COMPILE_AND_EXECUTE */ + { 4864, 0x00008B81 }, /* GL_COMPILE_STATUS */ + { 4882, 0x000084E9 }, /* GL_COMPRESSED_ALPHA */ + { 4902, 0x000084E9 }, /* GL_COMPRESSED_ALPHA_ARB */ + { 4926, 0x000084EC }, /* GL_COMPRESSED_INTENSITY */ + { 4950, 0x000084EC }, /* GL_COMPRESSED_INTENSITY_ARB */ + { 4978, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE */ + { 5002, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + { 5032, 0x000084EB }, /* GL_COMPRESSED_LUMINANCE_ALPHA_ARB */ + { 5066, 0x000084EA }, /* GL_COMPRESSED_LUMINANCE_ARB */ + { 5094, 0x000084ED }, /* GL_COMPRESSED_RGB */ + { 5112, 0x000084EE }, /* GL_COMPRESSED_RGBA */ + { 5131, 0x000084EE }, /* GL_COMPRESSED_RGBA_ARB */ + { 5154, 0x000086B1 }, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + { 5183, 0x000083F1 }, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + { 5216, 0x000083F2 }, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + { 5249, 0x000083F3 }, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + { 5282, 0x000084ED }, /* GL_COMPRESSED_RGB_ARB */ + { 5304, 0x000086B0 }, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + { 5332, 0x000083F0 }, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + { 5364, 0x00008C4A }, /* GL_COMPRESSED_SLUMINANCE */ + { 5389, 0x00008C4B }, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ + { 5420, 0x00008C48 }, /* GL_COMPRESSED_SRGB */ + { 5439, 0x00008C49 }, /* GL_COMPRESSED_SRGB_ALPHA */ + { 5464, 0x000086A3 }, /* GL_COMPRESSED_TEXTURE_FORMATS */ + { 5494, 0x0000911C }, /* GL_CONDITION_SATISFIED */ + { 5517, 0x00008576 }, /* GL_CONSTANT */ + { 5529, 0x00008003 }, /* GL_CONSTANT_ALPHA */ + { 5547, 0x00008003 }, /* GL_CONSTANT_ALPHA_EXT */ + { 5569, 0x00008576 }, /* GL_CONSTANT_ARB */ + { 5585, 0x00001207 }, /* GL_CONSTANT_ATTENUATION */ + { 5609, 0x00008151 }, /* GL_CONSTANT_BORDER_HP */ + { 5631, 0x00008001 }, /* GL_CONSTANT_COLOR */ + { 5649, 0x00008001 }, /* GL_CONSTANT_COLOR_EXT */ + { 5671, 0x00008576 }, /* GL_CONSTANT_EXT */ + { 5687, 0x00008010 }, /* GL_CONVOLUTION_1D */ + { 5705, 0x00008011 }, /* GL_CONVOLUTION_2D */ + { 5723, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR */ + { 5751, 0x00008154 }, /* GL_CONVOLUTION_BORDER_COLOR_HP */ + { 5782, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE */ + { 5809, 0x00008013 }, /* GL_CONVOLUTION_BORDER_MODE_EXT */ + { 5840, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS */ + { 5867, 0x00008015 }, /* GL_CONVOLUTION_FILTER_BIAS_EXT */ + { 5898, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE */ + { 5926, 0x00008014 }, /* GL_CONVOLUTION_FILTER_SCALE_EXT */ + { 5958, 0x00008017 }, /* GL_CONVOLUTION_FORMAT */ + { 5980, 0x00008017 }, /* GL_CONVOLUTION_FORMAT_EXT */ + { 6006, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT */ + { 6028, 0x00008019 }, /* GL_CONVOLUTION_HEIGHT_EXT */ + { 6054, 0x00008018 }, /* GL_CONVOLUTION_WIDTH */ + { 6075, 0x00008018 }, /* GL_CONVOLUTION_WIDTH_EXT */ + { 6100, 0x00008862 }, /* GL_COORD_REPLACE */ + { 6117, 0x00008862 }, /* GL_COORD_REPLACE_ARB */ + { 6138, 0x00008862 }, /* GL_COORD_REPLACE_NV */ + { 6158, 0x00001503 }, /* GL_COPY */ + { 6166, 0x0000150C }, /* GL_COPY_INVERTED */ + { 6183, 0x00000706 }, /* GL_COPY_PIXEL_TOKEN */ + { 6203, 0x00008F36 }, /* GL_COPY_READ_BUFFER */ + { 6223, 0x00008F37 }, /* GL_COPY_WRITE_BUFFER */ + { 6244, 0x00000B44 }, /* GL_CULL_FACE */ + { 6257, 0x00000B45 }, /* GL_CULL_FACE_MODE */ + { 6275, 0x000081AA }, /* GL_CULL_VERTEX_EXT */ + { 6294, 0x000081AC }, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + { 6326, 0x000081AB }, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + { 6361, 0x00008626 }, /* GL_CURRENT_ATTRIB_NV */ + { 6382, 0x00000001 }, /* GL_CURRENT_BIT */ + { 6397, 0x00000B00 }, /* GL_CURRENT_COLOR */ + { 6414, 0x00008453 }, /* GL_CURRENT_FOG_COORD */ + { 6435, 0x00008453 }, /* GL_CURRENT_FOG_COORDINATE */ + { 6461, 0x00000B01 }, /* GL_CURRENT_INDEX */ + { 6478, 0x00008641 }, /* GL_CURRENT_MATRIX_ARB */ + { 6500, 0x00008845 }, /* GL_CURRENT_MATRIX_INDEX_ARB */ + { 6528, 0x00008641 }, /* GL_CURRENT_MATRIX_NV */ + { 6549, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + { 6583, 0x00008640 }, /* GL_CURRENT_MATRIX_STACK_DEPTH_NV */ + { 6616, 0x00000B02 }, /* GL_CURRENT_NORMAL */ + { 6634, 0x00008843 }, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + { 6664, 0x00008B8D }, /* GL_CURRENT_PROGRAM */ + { 6683, 0x00008865 }, /* GL_CURRENT_QUERY */ + { 6700, 0x00008865 }, /* GL_CURRENT_QUERY_ARB */ + { 6721, 0x00000B04 }, /* GL_CURRENT_RASTER_COLOR */ + { 6745, 0x00000B09 }, /* GL_CURRENT_RASTER_DISTANCE */ + { 6772, 0x00000B05 }, /* GL_CURRENT_RASTER_INDEX */ + { 6796, 0x00000B07 }, /* GL_CURRENT_RASTER_POSITION */ + { 6823, 0x00000B08 }, /* GL_CURRENT_RASTER_POSITION_VALID */ + { 6856, 0x0000845F }, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ + { 6890, 0x00000B06 }, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + { 6923, 0x00008459 }, /* GL_CURRENT_SECONDARY_COLOR */ + { 6950, 0x00000B03 }, /* GL_CURRENT_TEXTURE_COORDS */ + { 6976, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB */ + { 7001, 0x00008626 }, /* GL_CURRENT_VERTEX_ATTRIB_ARB */ + { 7030, 0x000086A8 }, /* GL_CURRENT_WEIGHT_ARB */ + { 7052, 0x00000900 }, /* GL_CW */ + { 7058, 0x0000875B }, /* GL_DEBUG_ASSERT_MESA */ + { 7079, 0x00008759 }, /* GL_DEBUG_OBJECT_MESA */ + { 7100, 0x0000875A }, /* GL_DEBUG_PRINT_MESA */ + { 7120, 0x00002101 }, /* GL_DECAL */ + { 7129, 0x00001E03 }, /* GL_DECR */ + { 7137, 0x00008508 }, /* GL_DECR_WRAP */ + { 7150, 0x00008508 }, /* GL_DECR_WRAP_EXT */ + { 7167, 0x00008B80 }, /* GL_DELETE_STATUS */ + { 7184, 0x00001801 }, /* GL_DEPTH */ + { 7193, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ + { 7213, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_EXT */ + { 7237, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ + { 7257, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 7281, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 7295, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 7309, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 7329, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 7354, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 7374, 0x0000864F }, /* GL_DEPTH_CLAMP */ + { 7389, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 7407, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 7428, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 7447, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 7468, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 7493, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 7519, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 7540, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 7565, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 7591, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 7612, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 7637, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 7663, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 7677, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 7692, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 7707, 0x000084F9 }, /* GL_DEPTH_STENCIL */ + { 7724, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ + { 7752, 0x000084F9 }, /* GL_DEPTH_STENCIL_EXT */ + { 7773, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 7793, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 7821, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 7849, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 7863, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 7885, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 7911, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 7930, 0x00001201 }, /* GL_DIFFUSE */ + { 7941, 0x00000BD0 }, /* GL_DITHER */ + { 7951, 0x00000A02 }, /* GL_DOMAIN */ + { 7961, 0x00001100 }, /* GL_DONT_CARE */ + { 7974, 0x000086AE }, /* GL_DOT3_RGB */ + { 7986, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7999, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 8016, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 8033, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 8049, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 8065, 0x0000140A }, /* GL_DOUBLE */ + { 8075, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 8091, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 8106, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 8122, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 8142, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 8162, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 8178, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 8195, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 8216, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 8237, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 8254, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 8275, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 8296, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 8313, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 8334, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 8355, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 8372, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 8393, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 8414, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 8431, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 8452, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 8473, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 8490, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 8511, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 8532, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 8552, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 8572, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 8588, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 8608, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 8628, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 8644, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 8664, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 8684, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 8700, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 8720, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 8740, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 8756, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 8776, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 8796, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 8812, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 8832, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 8852, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 8868, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 8888, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 8908, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 8924, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8944, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8964, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8980, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 9000, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 9020, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ + { 9040, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */ + { 9068, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 9100, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 9124, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 9144, 0x00000304 }, /* GL_DST_ALPHA */ + { 9157, 0x00000306 }, /* GL_DST_COLOR */ + { 9170, 0x0000877A }, /* GL_DU8DV8_ATI */ + { 9184, 0x00008779 }, /* GL_DUDV_ATI */ + { 9196, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 9212, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 9232, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 9248, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 9268, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 9284, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 9304, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 9317, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 9336, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 9370, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 9408, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 9435, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 9461, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 9485, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 9517, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 9553, 0x00001600 }, /* GL_EMISSION */ + { 9565, 0x00002000 }, /* GL_ENABLE_BIT */ + { 9579, 0x00000202 }, /* GL_EQUAL */ + { 9588, 0x00001509 }, /* GL_EQUIV */ + { 9597, 0x00010000 }, /* GL_EVAL_BIT */ + { 9609, 0x00000800 }, /* GL_EXP */ + { 9616, 0x00000801 }, /* GL_EXP2 */ + { 9624, 0x00001F03 }, /* GL_EXTENSIONS */ + { 9638, 0x00002400 }, /* GL_EYE_LINEAR */ + { 9652, 0x00002502 }, /* GL_EYE_PLANE */ + { 9665, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 9690, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 9707, 0x00000000 }, /* GL_FALSE */ + { 9716, 0x00001101 }, /* GL_FASTEST */ + { 9727, 0x00001C01 }, /* GL_FEEDBACK */ + { 9739, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 9766, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 9790, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 9814, 0x00001B02 }, /* GL_FILL */ + { 9822, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */ + { 9849, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ + { 9880, 0x00001D00 }, /* GL_FLAT */ + { 9888, 0x00001406 }, /* GL_FLOAT */ + { 9897, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9911, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9929, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ + { 9945, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ + { 9961, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9975, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9993, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ + { 10009, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ + { 10025, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 10039, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 10057, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ + { 10073, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ + { 10089, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 10103, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 10121, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 10135, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 10153, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 10167, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 10185, 0x00000B60 }, /* GL_FOG */ + { 10192, 0x00000080 }, /* GL_FOG_BIT */ + { 10203, 0x00000B66 }, /* GL_FOG_COLOR */ + { 10216, 0x00008451 }, /* GL_FOG_COORD */ + { 10229, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 10247, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 10271, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 10310, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 10353, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 10385, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 10416, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 10445, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 10470, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 10489, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 10523, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 10550, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 10576, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 10600, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 10617, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 10632, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 10656, 0x00000B64 }, /* GL_FOG_END */ + { 10667, 0x00000C54 }, /* GL_FOG_HINT */ + { 10679, 0x00000B61 }, /* GL_FOG_INDEX */ + { 10692, 0x00000B65 }, /* GL_FOG_MODE */ + { 10704, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 10723, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10748, 0x00000B63 }, /* GL_FOG_START */ + { 10761, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10779, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10803, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10822, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10845, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10880, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10895, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10932, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10968, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 11009, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 11050, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 11087, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 11124, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 11162, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 11204, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 11242, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 11284, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 11319, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 11358, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 11407, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 11455, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 11507, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 11547, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 11591, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 11631, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 11675, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */ + { 11698, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 11725, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 11749, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11777, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11800, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11819, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11856, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11897, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11938, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ + { 11976, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 12018, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 12069, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 12107, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 12152, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 12201, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 12239, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */ + { 12281, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ + { 12319, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 12361, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 12393, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 12418, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 12445, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 12476, 0x00000404 }, /* GL_FRONT */ + { 12485, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 12503, 0x00000B46 }, /* GL_FRONT_FACE */ + { 12517, 0x00000400 }, /* GL_FRONT_LEFT */ + { 12531, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 12546, 0x00008006 }, /* GL_FUNC_ADD */ + { 12558, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 12574, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 12599, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 12628, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 12645, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 12666, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 12685, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 12709, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 12738, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 12762, 0x00000206 }, /* GL_GEQUAL */ + { 12772, 0x00000204 }, /* GL_GREATER */ + { 12783, 0x00001904 }, /* GL_GREEN */ + { 12792, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12806, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12820, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12835, 0x0000140B }, /* GL_HALF_FLOAT */ + { 12849, 0x00008000 }, /* GL_HINT_BIT */ + { 12861, 0x00008024 }, /* GL_HISTOGRAM */ + { 12874, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12898, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12926, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12949, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12976, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12993, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 13013, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 13037, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 13061, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 13089, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 13117, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 13149, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 13171, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 13197, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 13215, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 13237, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 13256, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 13279, 0x0000862A }, /* GL_IDENTITY_NV */ + { 13294, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 13314, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13354, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13392, 0x00001E02 }, /* GL_INCR */ + { 13400, 0x00008507 }, /* GL_INCR_WRAP */ + { 13413, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13430, 0x00008222 }, /* GL_INDEX */ + { 13439, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13454, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13484, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13518, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13541, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13563, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13583, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13597, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13618, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13636, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13650, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13666, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13681, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13700, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13719, 0x00001404 }, /* GL_INT */ + { 13726, 0x00008049 }, /* GL_INTENSITY */ + { 13739, 0x0000804C }, /* GL_INTENSITY12 */ + { 13754, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13773, 0x0000804D }, /* GL_INTENSITY16 */ + { 13788, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13807, 0x0000804A }, /* GL_INTENSITY4 */ + { 13821, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13839, 0x0000804B }, /* GL_INTENSITY8 */ + { 13853, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13871, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13888, 0x00008575 }, /* GL_INTERPOLATE */ + { 13903, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13922, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13941, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13953, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13969, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13981, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13997, 0x00008B55 }, /* GL_INT_VEC4 */ + { 14009, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 14025, 0x00000500 }, /* GL_INVALID_ENUM */ + { 14041, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 14074, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 14111, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 14132, 0x00000501 }, /* GL_INVALID_VALUE */ + { 14149, 0x0000862B }, /* GL_INVERSE_NV */ + { 14163, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 14187, 0x0000150A }, /* GL_INVERT */ + { 14197, 0x00001E00 }, /* GL_KEEP */ + { 14205, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ + { 14231, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ + { 14261, 0x00000406 }, /* GL_LEFT */ + { 14269, 0x00000203 }, /* GL_LEQUAL */ + { 14279, 0x00000201 }, /* GL_LESS */ + { 14287, 0x00004000 }, /* GL_LIGHT0 */ + { 14297, 0x00004001 }, /* GL_LIGHT1 */ + { 14307, 0x00004002 }, /* GL_LIGHT2 */ + { 14317, 0x00004003 }, /* GL_LIGHT3 */ + { 14327, 0x00004004 }, /* GL_LIGHT4 */ + { 14337, 0x00004005 }, /* GL_LIGHT5 */ + { 14347, 0x00004006 }, /* GL_LIGHT6 */ + { 14357, 0x00004007 }, /* GL_LIGHT7 */ + { 14367, 0x00000B50 }, /* GL_LIGHTING */ + { 14379, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 14395, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14418, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14447, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14480, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14508, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14532, 0x00001B01 }, /* GL_LINE */ + { 14540, 0x00002601 }, /* GL_LINEAR */ + { 14550, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14572, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14602, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14633, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14657, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14682, 0x00000001 }, /* GL_LINES */ + { 14691, 0x00000004 }, /* GL_LINE_BIT */ + { 14703, 0x00000002 }, /* GL_LINE_LOOP */ + { 14716, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14736, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14751, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14771, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14787, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14811, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14834, 0x00000003 }, /* GL_LINE_STRIP */ + { 14848, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14862, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14876, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14902, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14922, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14937, 0x00000B32 }, /* GL_LIST_BASE */ + { 14950, 0x00020000 }, /* GL_LIST_BIT */ + { 14962, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14976, 0x00000B30 }, /* GL_LIST_MODE */ + { 14989, 0x00000101 }, /* GL_LOAD */ + { 14997, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 15009, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 15026, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 15040, 0x00001909 }, /* GL_LUMINANCE */ + { 15053, 0x00008041 }, /* GL_LUMINANCE12 */ + { 15068, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 15091, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 15118, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 15140, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 15166, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 15185, 0x00008042 }, /* GL_LUMINANCE16 */ + { 15200, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 15223, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 15250, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 15269, 0x0000803F }, /* GL_LUMINANCE4 */ + { 15283, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 15304, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 15329, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 15347, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 15368, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 15393, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15407, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15428, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15453, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15471, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15490, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15506, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15526, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15548, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15562, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15577, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15601, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15625, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15649, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15673, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15690, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15707, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15735, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15764, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15793, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15822, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15851, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15880, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15909, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15937, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15965, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15993, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 16021, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 16049, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 16077, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 16105, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 16133, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 16161, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 16177, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 16197, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 16219, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 16233, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 16248, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 16272, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 16296, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 16320, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 16344, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 16361, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 16378, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16406, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16435, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16464, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16493, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16522, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16551, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16580, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16608, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16636, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16664, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16692, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16720, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16748, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16776, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16804, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16832, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16845, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ + { 16871, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ + { 16900, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ + { 16928, 0x00000001 }, /* GL_MAP_READ_BIT */ + { 16944, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16959, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ + { 16985, 0x00000002 }, /* GL_MAP_WRITE_BIT */ + { 17002, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 17017, 0x00008630 }, /* GL_MATRIX0_NV */ + { 17031, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 17047, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 17063, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 17079, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 17095, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 17111, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 17127, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 17143, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 17159, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 17175, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 17191, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 17206, 0x00008631 }, /* GL_MATRIX1_NV */ + { 17220, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 17236, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 17252, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 17268, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 17284, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 17300, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 17316, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 17332, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 17348, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 17364, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 17380, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 17395, 0x00008632 }, /* GL_MATRIX2_NV */ + { 17409, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 17425, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 17441, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 17456, 0x00008633 }, /* GL_MATRIX3_NV */ + { 17470, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 17485, 0x00008634 }, /* GL_MATRIX4_NV */ + { 17499, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 17514, 0x00008635 }, /* GL_MATRIX5_NV */ + { 17528, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17543, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17557, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17572, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17586, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17601, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17616, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17642, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17676, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17707, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17740, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17771, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17786, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17808, 0x00008008 }, /* GL_MAX */ + { 17815, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17838, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17870, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17896, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17929, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17955, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17989, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 18008, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */ + { 18033, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 18062, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 18094, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 18130, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 18166, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 18206, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 18232, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 18262, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 18287, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 18316, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 18345, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 18378, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 18398, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 18422, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 18446, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 18470, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 18495, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 18513, 0x00008008 }, /* GL_MAX_EXT */ + { 18524, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 18559, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18598, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18612, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18632, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18670, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18699, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18723, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18751, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18774, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18811, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18847, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18874, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18903, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18937, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18973, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 19000, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 19032, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 19068, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 19097, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 19126, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 19154, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 19192, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 19236, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 19279, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 19313, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 19352, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 19389, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 19427, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 19470, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 19513, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 19543, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19574, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19610, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19646, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19676, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19710, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19743, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */ + { 19768, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19797, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19812, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */ + { 19831, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + { 19858, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19878, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19902, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19924, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19950, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19977, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 20008, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 20032, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 20066, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 20086, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 20113, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 20134, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 20159, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 20184, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 20219, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 20241, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 20267, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 20289, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 20315, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 20349, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 20387, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 20420, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 20457, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 20481, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 20502, 0x00008007 }, /* GL_MIN */ + { 20509, 0x0000802E }, /* GL_MINMAX */ + { 20519, 0x0000802E }, /* GL_MINMAX_EXT */ + { 20533, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 20550, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 20571, 0x00008030 }, /* GL_MINMAX_SINK */ + { 20586, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 20605, 0x00008007 }, /* GL_MIN_EXT */ + { 20616, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 20635, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20658, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20681, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20701, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20721, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20751, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20779, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20807, 0x00001700 }, /* GL_MODELVIEW */ + { 20820, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20838, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20857, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20876, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20895, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20914, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20933, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20952, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20971, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20990, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 21009, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 21028, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 21046, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 21065, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 21084, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 21103, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 21122, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 21141, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 21160, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 21179, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 21198, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 21217, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 21236, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 21254, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 21273, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 21292, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 21310, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 21328, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 21346, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 21364, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 21382, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 21400, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 21418, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 21438, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 21465, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 21490, 0x00002100 }, /* GL_MODULATE */ + { 21502, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 21522, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 21549, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 21574, 0x00000103 }, /* GL_MULT */ + { 21582, 0x0000809D }, /* GL_MULTISAMPLE */ + { 21597, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 21617, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21636, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21655, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21679, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21702, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21732, 0x00002A25 }, /* GL_N3F_V3F */ + { 21743, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21763, 0x0000150E }, /* GL_NAND */ + { 21771, 0x00002600 }, /* GL_NEAREST */ + { 21782, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21813, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21845, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21870, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21896, 0x00000200 }, /* GL_NEVER */ + { 21905, 0x00001102 }, /* GL_NICEST */ + { 21915, 0x00000000 }, /* GL_NONE */ + { 21923, 0x00001505 }, /* GL_NOOP */ + { 21931, 0x00001508 }, /* GL_NOR */ + { 21938, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21951, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21967, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21998, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 22033, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 22057, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 22080, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 22101, 0x00008511 }, /* GL_NORMAL_MAP */ + { 22115, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 22133, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 22150, 0x00000205 }, /* GL_NOTEQUAL */ + { 22162, 0x00000000 }, /* GL_NO_ERROR */ + { 22174, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 22208, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 22246, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 22278, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 22320, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 22350, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 22390, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 22421, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 22450, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 22478, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 22508, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 22525, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 22551, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 22567, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 22602, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 22624, 0x00009112 }, /* GL_OBJECT_TYPE */ + { 22639, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22658, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22688, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22709, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22737, 0x00000001 }, /* GL_ONE */ + { 22744, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22772, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22804, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22832, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22864, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22887, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22910, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22933, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22956, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22974, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22996, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 23018, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 23034, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 23054, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 23074, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 23092, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 23114, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 23136, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 23152, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 23172, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 23192, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 23210, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 23232, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 23254, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 23270, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 23290, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 23310, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 23331, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 23350, 0x00001507 }, /* GL_OR */ + { 23356, 0x00000A01 }, /* GL_ORDER */ + { 23365, 0x0000150D }, /* GL_OR_INVERTED */ + { 23380, 0x0000150B }, /* GL_OR_REVERSE */ + { 23394, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 23411, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 23429, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 23450, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 23470, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 23488, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 23507, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 23527, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 23547, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 23565, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 23584, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 23609, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 23633, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23654, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23676, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23698, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23723, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23747, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23768, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23790, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23812, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23834, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23865, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23885, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23910, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23930, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23955, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23975, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 24000, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 24020, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 24045, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 24065, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 24090, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 24110, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 24135, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 24155, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 24180, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 24200, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 24225, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 24245, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 24270, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 24290, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 24315, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 24333, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ + { 24354, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ + { 24383, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 24416, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 24441, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ + { 24464, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 24495, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 24530, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 24557, 0x00001B00 }, /* GL_POINT */ + { 24566, 0x00000000 }, /* GL_POINTS */ + { 24576, 0x00000002 }, /* GL_POINT_BIT */ + { 24589, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 24619, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 24653, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 24687, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 24722, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 24751, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24784, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24817, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24851, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24865, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24891, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24909, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24931, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24953, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24976, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24994, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 25016, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 25038, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 25061, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 25081, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 25097, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 25118, 0x00008861 }, /* GL_POINT_SPRITE */ + { 25134, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 25154, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 25183, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 25202, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 25228, 0x00000701 }, /* GL_POINT_TOKEN */ + { 25243, 0x00000009 }, /* GL_POLYGON */ + { 25254, 0x00000008 }, /* GL_POLYGON_BIT */ + { 25269, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 25285, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 25308, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 25333, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 25356, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 25379, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 25403, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 25427, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 25445, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 25468, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 25487, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 25510, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 25527, 0x00001203 }, /* GL_POSITION */ + { 25539, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 25571, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 25607, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 25640, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 25677, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 25708, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 25743, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25775, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25811, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25844, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25876, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25912, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25945, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25982, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 26012, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 26046, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 26077, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 26112, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 26143, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 26178, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 26210, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 26246, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 26276, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 26310, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 26341, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 26376, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 26408, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 26439, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 26474, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 26506, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 26542, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 26571, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 26604, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 26634, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 26668, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 26707, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 26740, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26780, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26814, 0x00008578 }, /* GL_PREVIOUS */ + { 26826, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26842, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26858, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26875, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26896, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26917, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26950, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26982, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 27005, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 27028, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 27058, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 27087, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 27115, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 27137, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 27165, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 27193, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 27215, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 27236, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 27276, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 27315, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 27345, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 27380, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 27413, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 27447, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 27486, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 27525, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 27547, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 27573, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 27597, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 27620, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 27642, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 27663, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 27684, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 27711, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 27743, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27775, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27810, 0x00001701 }, /* GL_PROJECTION */ + { 27824, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27845, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27871, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ + { 27891, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ + { 27915, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27936, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27955, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27978, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 28017, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 28055, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 28075, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 28105, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 28129, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 28149, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 28179, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 28203, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 28223, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 28256, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 28282, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 28312, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 28343, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 28373, 0x00008A1D }, /* GL_PURGEABLE_APPLE */ + { 28392, 0x00002003 }, /* GL_Q */ + { 28397, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 28422, 0x00000007 }, /* GL_QUADS */ + { 28431, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + { 28475, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ + { 28523, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 28540, 0x00000008 }, /* GL_QUAD_STRIP */ + { 28554, 0x00008E16 }, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ + { 28584, 0x00008E15 }, /* GL_QUERY_BY_REGION_WAIT_NV */ + { 28611, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 28633, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 28659, 0x00008E14 }, /* GL_QUERY_NO_WAIT_NV */ + { 28679, 0x00008866 }, /* GL_QUERY_RESULT */ + { 28695, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 28715, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 28741, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 28771, 0x00008E13 }, /* GL_QUERY_WAIT_NV */ + { 28788, 0x00002002 }, /* GL_R */ + { 28793, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 28805, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 28838, 0x00000C02 }, /* GL_READ_BUFFER */ + { 28853, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 28873, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */ + { 28901, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 28933, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 28957, 0x000088B8 }, /* GL_READ_ONLY */ + { 28970, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 28987, 0x000088BA }, /* GL_READ_WRITE */ + { 29001, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 29019, 0x00001903 }, /* GL_RED */ + { 29026, 0x00008016 }, /* GL_REDUCE */ + { 29036, 0x00008016 }, /* GL_REDUCE_EXT */ + { 29050, 0x00000D15 }, /* GL_RED_BIAS */ + { 29062, 0x00000D52 }, /* GL_RED_BITS */ + { 29074, 0x00000D14 }, /* GL_RED_SCALE */ + { 29087, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 29105, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 29127, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 29148, 0x00008A19 }, /* GL_RELEASED_APPLE */ + { 29166, 0x00001C00 }, /* GL_RENDER */ + { 29176, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 29192, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 29219, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */ + { 29243, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 29271, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 29297, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 29324, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 29344, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 29371, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 29394, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 29421, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 29453, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 29489, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 29514, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 29538, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */ + { 29566, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 29595, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 29617, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 29643, 0x00001F01 }, /* GL_RENDERER */ + { 29655, 0x00000C40 }, /* GL_RENDER_MODE */ + { 29670, 0x00002901 }, /* GL_REPEAT */ + { 29680, 0x00001E01 }, /* GL_REPLACE */ + { 29691, 0x00008062 }, /* GL_REPLACE_EXT */ + { 29706, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 29729, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 29747, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 29769, 0x00008A1B }, /* GL_RETAINED_APPLE */ + { 29787, 0x00000102 }, /* GL_RETURN */ + { 29797, 0x00001907 }, /* GL_RGB */ + { 29804, 0x00008052 }, /* GL_RGB10 */ + { 29813, 0x00008059 }, /* GL_RGB10_A2 */ + { 29825, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 29841, 0x00008052 }, /* GL_RGB10_EXT */ + { 29854, 0x00008053 }, /* GL_RGB12 */ + { 29863, 0x00008053 }, /* GL_RGB12_EXT */ + { 29876, 0x00008054 }, /* GL_RGB16 */ + { 29885, 0x00008054 }, /* GL_RGB16_EXT */ + { 29898, 0x0000804E }, /* GL_RGB2_EXT */ + { 29910, 0x0000804F }, /* GL_RGB4 */ + { 29918, 0x0000804F }, /* GL_RGB4_EXT */ + { 29930, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 29943, 0x00008050 }, /* GL_RGB5 */ + { 29951, 0x00008057 }, /* GL_RGB5_A1 */ + { 29962, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 29977, 0x00008050 }, /* GL_RGB5_EXT */ + { 29989, 0x00008051 }, /* GL_RGB8 */ + { 29997, 0x00008051 }, /* GL_RGB8_EXT */ + { 30009, 0x00001908 }, /* GL_RGBA */ + { 30017, 0x0000805A }, /* GL_RGBA12 */ + { 30027, 0x0000805A }, /* GL_RGBA12_EXT */ + { 30041, 0x0000805B }, /* GL_RGBA16 */ + { 30051, 0x0000805B }, /* GL_RGBA16_EXT */ + { 30065, 0x00008055 }, /* GL_RGBA2 */ + { 30074, 0x00008055 }, /* GL_RGBA2_EXT */ + { 30087, 0x00008056 }, /* GL_RGBA4 */ + { 30096, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 30115, 0x00008056 }, /* GL_RGBA4_EXT */ + { 30128, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 30142, 0x00008058 }, /* GL_RGBA8 */ + { 30151, 0x00008058 }, /* GL_RGBA8_EXT */ + { 30164, 0x00008F97 }, /* GL_RGBA8_SNORM */ + { 30179, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 30197, 0x00000C31 }, /* GL_RGBA_MODE */ + { 30210, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 30223, 0x00008F93 }, /* GL_RGBA_SNORM */ + { 30237, 0x000083A0 }, /* GL_RGB_S3TC */ + { 30249, 0x00008573 }, /* GL_RGB_SCALE */ + { 30262, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 30279, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 30296, 0x00000407 }, /* GL_RIGHT */ + { 30305, 0x00002000 }, /* GL_S */ + { 30310, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 30324, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 30345, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 30359, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 30380, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 30394, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 30410, 0x000080A9 }, /* GL_SAMPLES */ + { 30421, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 30437, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 30452, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 30470, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 30492, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 30520, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 30552, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 30575, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 30602, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 30620, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 30643, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 30665, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 30684, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 30707, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 30733, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 30763, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 30788, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 30817, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 30832, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 30847, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 30863, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 30888, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 30928, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 30972, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 31005, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 31035, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 31067, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 31097, 0x00001C02 }, /* GL_SELECT */ + { 31107, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 31135, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 31160, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 31176, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 31203, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 31234, 0x0000150F }, /* GL_SET */ + { 31241, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 31262, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 31286, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 31301, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 31316, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 31344, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 31367, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 31397, 0x00001601 }, /* GL_SHININESS */ + { 31410, 0x00001402 }, /* GL_SHORT */ + { 31419, 0x00009119 }, /* GL_SIGNALED */ + { 31431, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ + { 31452, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 31468, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 31488, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 31507, 0x00008C46 }, /* GL_SLUMINANCE */ + { 31521, 0x00008C47 }, /* GL_SLUMINANCE8 */ + { 31536, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ + { 31558, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ + { 31578, 0x00001D01 }, /* GL_SMOOTH */ + { 31588, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 31621, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 31648, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 31681, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 31708, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 31725, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 31746, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 31767, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 31782, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 31801, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 31820, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 31837, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 31858, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 31879, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 31894, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 31913, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 31932, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 31949, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 31970, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 31991, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 32006, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 32025, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 32044, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 32064, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 32082, 0x00001202 }, /* GL_SPECULAR */ + { 32094, 0x00002402 }, /* GL_SPHERE_MAP */ + { 32108, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 32123, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 32141, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 32158, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 32172, 0x00008580 }, /* GL_SRC0_RGB */ + { 32184, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 32198, 0x00008581 }, /* GL_SRC1_RGB */ + { 32210, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 32224, 0x00008582 }, /* GL_SRC2_RGB */ + { 32236, 0x00000302 }, /* GL_SRC_ALPHA */ + { 32249, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 32271, 0x00000300 }, /* GL_SRC_COLOR */ + { 32284, 0x00008C40 }, /* GL_SRGB */ + { 32292, 0x00008C41 }, /* GL_SRGB8 */ + { 32301, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ + { 32317, 0x00008C42 }, /* GL_SRGB_ALPHA */ + { 32331, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 32349, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 32368, 0x000088E6 }, /* GL_STATIC_COPY */ + { 32383, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 32402, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 32417, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 32436, 0x000088E5 }, /* GL_STATIC_READ */ + { 32451, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 32470, 0x00001802 }, /* GL_STENCIL */ + { 32481, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 32503, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 32529, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 32550, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 32575, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 32596, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 32621, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 32653, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 32689, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 32721, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 32757, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 32777, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 32804, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 32830, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 32846, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 32868, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 32891, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 32907, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 32923, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 32940, 0x00008D46 }, /* GL_STENCIL_INDEX1 */ + { 32958, 0x00008D49 }, /* GL_STENCIL_INDEX16 */ + { 32977, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 33000, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 33022, 0x00008D47 }, /* GL_STENCIL_INDEX4 */ + { 33040, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 33062, 0x00008D48 }, /* GL_STENCIL_INDEX8 */ + { 33080, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 33102, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 33123, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 33150, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 33177, 0x00000B97 }, /* GL_STENCIL_REF */ + { 33192, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 33208, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 33237, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 33259, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 33280, 0x00000C33 }, /* GL_STEREO */ + { 33290, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ + { 33314, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ + { 33339, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ + { 33363, 0x000088E2 }, /* GL_STREAM_COPY */ + { 33378, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 33397, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 33412, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 33431, 0x000088E1 }, /* GL_STREAM_READ */ + { 33446, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 33465, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 33482, 0x000084E7 }, /* GL_SUBTRACT */ + { 33494, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 33510, 0x00009113 }, /* GL_SYNC_CONDITION */ + { 33528, 0x00009116 }, /* GL_SYNC_FENCE */ + { 33542, 0x00009115 }, /* GL_SYNC_FLAGS */ + { 33556, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ + { 33583, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + { 33613, 0x00009114 }, /* GL_SYNC_STATUS */ + { 33628, 0x00002001 }, /* GL_T */ + { 33633, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 33648, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 33667, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 33683, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 33698, 0x00002A27 }, /* GL_T2F_V3F */ + { 33709, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 33728, 0x00002A28 }, /* GL_T4F_V4F */ + { 33739, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 33762, 0x00001702 }, /* GL_TEXTURE */ + { 33773, 0x000084C0 }, /* GL_TEXTURE0 */ + { 33785, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 33801, 0x000084C1 }, /* GL_TEXTURE1 */ + { 33813, 0x000084CA }, /* GL_TEXTURE10 */ + { 33826, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 33843, 0x000084CB }, /* GL_TEXTURE11 */ + { 33856, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 33873, 0x000084CC }, /* GL_TEXTURE12 */ + { 33886, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 33903, 0x000084CD }, /* GL_TEXTURE13 */ + { 33916, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 33933, 0x000084CE }, /* GL_TEXTURE14 */ + { 33946, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 33963, 0x000084CF }, /* GL_TEXTURE15 */ + { 33976, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 33993, 0x000084D0 }, /* GL_TEXTURE16 */ + { 34006, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 34023, 0x000084D1 }, /* GL_TEXTURE17 */ + { 34036, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 34053, 0x000084D2 }, /* GL_TEXTURE18 */ + { 34066, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 34083, 0x000084D3 }, /* GL_TEXTURE19 */ + { 34096, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 34113, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 34129, 0x000084C2 }, /* GL_TEXTURE2 */ + { 34141, 0x000084D4 }, /* GL_TEXTURE20 */ + { 34154, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 34171, 0x000084D5 }, /* GL_TEXTURE21 */ + { 34184, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 34201, 0x000084D6 }, /* GL_TEXTURE22 */ + { 34214, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 34231, 0x000084D7 }, /* GL_TEXTURE23 */ + { 34244, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 34261, 0x000084D8 }, /* GL_TEXTURE24 */ + { 34274, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 34291, 0x000084D9 }, /* GL_TEXTURE25 */ + { 34304, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 34321, 0x000084DA }, /* GL_TEXTURE26 */ + { 34334, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 34351, 0x000084DB }, /* GL_TEXTURE27 */ + { 34364, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 34381, 0x000084DC }, /* GL_TEXTURE28 */ + { 34394, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 34411, 0x000084DD }, /* GL_TEXTURE29 */ + { 34424, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 34441, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 34457, 0x000084C3 }, /* GL_TEXTURE3 */ + { 34469, 0x000084DE }, /* GL_TEXTURE30 */ + { 34482, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 34499, 0x000084DF }, /* GL_TEXTURE31 */ + { 34512, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 34529, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 34545, 0x000084C4 }, /* GL_TEXTURE4 */ + { 34557, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 34573, 0x000084C5 }, /* GL_TEXTURE5 */ + { 34585, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 34601, 0x000084C6 }, /* GL_TEXTURE6 */ + { 34613, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 34629, 0x000084C7 }, /* GL_TEXTURE7 */ + { 34641, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 34657, 0x000084C8 }, /* GL_TEXTURE8 */ + { 34669, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 34685, 0x000084C9 }, /* GL_TEXTURE9 */ + { 34697, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 34713, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 34727, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 34751, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 34765, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 34789, 0x0000806F }, /* GL_TEXTURE_3D */ + { 34803, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 34825, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 34851, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 34873, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 34895, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 34927, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 34949, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 34981, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 35003, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 35031, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 35063, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 35096, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 35128, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 35143, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 35164, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 35189, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 35207, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 35231, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 35262, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 35292, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 35322, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 35357, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 35388, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 35426, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 35453, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 35485, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 35519, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 35543, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 35571, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 35595, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 35623, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 35656, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 35680, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 35702, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 35724, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 35750, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 35784, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 35817, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 35854, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 35882, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 35914, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 35937, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 35975, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 36017, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 36048, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 36076, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 36106, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 36134, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 36154, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 36178, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 36209, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 36244, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 36275, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 36310, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 36341, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 36376, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 36407, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 36442, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 36473, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 36508, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 36539, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 36574, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + { 36603, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 36620, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 36642, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 36668, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 36683, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 36704, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 36724, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 36750, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 36770, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 36787, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 36804, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 36821, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 36838, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 36863, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 36885, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 36911, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 36929, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 36955, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 36981, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 37011, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 37038, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 37063, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 37083, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 37107, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 37134, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 37161, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 37188, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 37214, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 37244, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 37266, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 37284, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 37314, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 37342, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 37370, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 37398, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 37419, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 37438, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 37460, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 37479, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 37499, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + { 37529, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + { 37560, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 37585, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 37609, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 37629, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 37653, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 37673, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 37696, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 37720, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */ + { 37748, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + { 37778, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 37803, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 37837, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 37854, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 37872, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 37890, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 37908, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ + { 37927, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 37947, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 37966, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 37995, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 38012, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 38038, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 38068, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 38100, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 38130, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 38164, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 38180, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 38211, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 38246, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 38274, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 38306, 0x00000004 }, /* GL_TRIANGLES */ + { 38319, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 38335, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 38356, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 38374, 0x00000001 }, /* GL_TRUE */ + { 38382, 0x00008A1C }, /* GL_UNDEFINED_APPLE */ + { 38401, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 38421, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 38444, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 38464, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 38485, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 38507, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 38529, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 38549, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 38570, 0x00009118 }, /* GL_UNSIGNALED */ + { 38584, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 38601, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 38628, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 38651, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 38667, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 38694, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 38715, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */ + { 38740, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 38764, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 38795, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 38819, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 38847, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 38870, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 38888, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 38918, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 38944, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 38974, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 39000, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 39024, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 39052, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 39080, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 39107, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 39139, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 39170, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 39184, 0x00002A20 }, /* GL_V2F */ + { 39191, 0x00002A21 }, /* GL_V3F */ + { 39198, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 39217, 0x00001F00 }, /* GL_VENDOR */ + { 39227, 0x00001F02 }, /* GL_VERSION */ + { 39238, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 39254, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ + { 39278, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 39308, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 39339, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 39374, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 39398, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 39419, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 39442, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 39463, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 39490, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 39518, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 39546, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 39574, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 39602, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 39630, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 39658, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 39685, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 39712, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 39739, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 39766, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 39793, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 39820, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 39847, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 39874, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 39901, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 39939, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 39981, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 40012, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 40047, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 40081, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 40119, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 40150, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 40185, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 40213, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 40245, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 40275, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 40309, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 40337, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 40369, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 40389, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 40411, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 40440, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 40461, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 40490, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 40523, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 40555, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 40582, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 40613, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 40643, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 40660, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 40681, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 40708, 0x00000BA2 }, /* GL_VIEWPORT */ + { 40720, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 40736, 0x00008A1A }, /* GL_VOLATILE_APPLE */ + { 40754, 0x0000911D }, /* GL_WAIT_FAILED */ + { 40769, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 40789, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 40820, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 40855, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 40883, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 40908, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 40935, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 40960, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 40984, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 41003, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 41017, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 41035, 0x00001506 }, /* GL_XOR */ + { 41042, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 41061, 0x00008757 }, /* GL_YCBCR_MESA */ + { 41075, 0x00000000 }, /* GL_ZERO */ + { 41083, 0x00000D16 }, /* GL_ZOOM_X */ + { 41093, 0x00000D17 }, /* GL_ZOOM_Y */ }; -static const unsigned reduced_enums[1351] = +static const unsigned reduced_enums[1357] = { - 479, /* GL_FALSE */ - 702, /* GL_LINES */ - 704, /* GL_LINE_LOOP */ - 711, /* GL_LINE_STRIP */ - 1770, /* GL_TRIANGLES */ - 1773, /* GL_TRIANGLE_STRIP */ - 1771, /* GL_TRIANGLE_FAN */ - 1286, /* GL_QUADS */ - 1290, /* GL_QUAD_STRIP */ - 1172, /* GL_POLYGON */ - 1184, /* GL_POLYGON_STIPPLE_BIT */ - 1133, /* GL_PIXEL_MODE_BIT */ - 689, /* GL_LIGHTING_BIT */ - 509, /* GL_FOG_BIT */ + 480, /* GL_FALSE */ + 703, /* GL_LINES */ + 705, /* GL_LINE_LOOP */ + 712, /* GL_LINE_STRIP */ + 1774, /* GL_TRIANGLES */ + 1777, /* GL_TRIANGLE_STRIP */ + 1775, /* GL_TRIANGLE_FAN */ + 1288, /* GL_QUADS */ + 1292, /* GL_QUAD_STRIP */ + 1173, /* GL_POLYGON */ + 1185, /* GL_POLYGON_STIPPLE_BIT */ + 1134, /* GL_PIXEL_MODE_BIT */ + 690, /* GL_LIGHTING_BIT */ + 510, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 721, /* GL_LOAD */ - 1349, /* GL_RETURN */ - 1005, /* GL_MULT */ + 722, /* GL_LOAD */ + 1353, /* GL_RETURN */ + 1006, /* GL_MULT */ 23, /* GL_ADD */ - 1021, /* GL_NEVER */ - 679, /* GL_LESS */ - 469, /* GL_EQUAL */ - 678, /* GL_LEQUAL */ - 599, /* GL_GREATER */ - 1036, /* GL_NOTEQUAL */ - 598, /* GL_GEQUAL */ + 1022, /* GL_NEVER */ + 680, /* GL_LESS */ + 470, /* GL_EQUAL */ + 679, /* GL_LEQUAL */ + 600, /* GL_GREATER */ + 1037, /* GL_NOTEQUAL */ + 599, /* GL_GEQUAL */ 47, /* GL_ALWAYS */ - 1490, /* GL_SRC_COLOR */ - 1066, /* GL_ONE_MINUS_SRC_COLOR */ - 1488, /* GL_SRC_ALPHA */ - 1065, /* GL_ONE_MINUS_SRC_ALPHA */ - 448, /* GL_DST_ALPHA */ - 1063, /* GL_ONE_MINUS_DST_ALPHA */ - 449, /* GL_DST_COLOR */ - 1064, /* GL_ONE_MINUS_DST_COLOR */ - 1489, /* GL_SRC_ALPHA_SATURATE */ - 586, /* GL_FRONT_LEFT */ - 587, /* GL_FRONT_RIGHT */ + 1494, /* GL_SRC_COLOR */ + 1067, /* GL_ONE_MINUS_SRC_COLOR */ + 1492, /* GL_SRC_ALPHA */ + 1066, /* GL_ONE_MINUS_SRC_ALPHA */ + 449, /* GL_DST_ALPHA */ + 1064, /* GL_ONE_MINUS_DST_ALPHA */ + 450, /* GL_DST_COLOR */ + 1065, /* GL_ONE_MINUS_DST_COLOR */ + 1493, /* GL_SRC_ALPHA_SATURATE */ + 587, /* GL_FRONT_LEFT */ + 588, /* GL_FRONT_RIGHT */ 69, /* GL_BACK_LEFT */ 70, /* GL_BACK_RIGHT */ - 583, /* GL_FRONT */ + 584, /* GL_FRONT */ 68, /* GL_BACK */ - 677, /* GL_LEFT */ - 1391, /* GL_RIGHT */ - 584, /* GL_FRONT_AND_BACK */ + 678, /* GL_LEFT */ + 1395, /* GL_RIGHT */ + 585, /* GL_FRONT_AND_BACK */ 63, /* GL_AUX0 */ 64, /* GL_AUX1 */ 65, /* GL_AUX2 */ 66, /* GL_AUX3 */ - 666, /* GL_INVALID_ENUM */ - 670, /* GL_INVALID_VALUE */ - 669, /* GL_INVALID_OPERATION */ - 1495, /* GL_STACK_OVERFLOW */ - 1496, /* GL_STACK_UNDERFLOW */ - 1091, /* GL_OUT_OF_MEMORY */ - 667, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + 667, /* GL_INVALID_ENUM */ + 671, /* GL_INVALID_VALUE */ + 670, /* GL_INVALID_OPERATION */ + 1499, /* GL_STACK_OVERFLOW */ + 1500, /* GL_STACK_UNDERFLOW */ + 1092, /* GL_OUT_OF_MEMORY */ + 668, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1111, /* GL_PASS_THROUGH_TOKEN */ - 1171, /* GL_POINT_TOKEN */ - 712, /* GL_LINE_TOKEN */ - 1185, /* GL_POLYGON_TOKEN */ + 1112, /* GL_PASS_THROUGH_TOKEN */ + 1172, /* GL_POINT_TOKEN */ + 713, /* GL_LINE_TOKEN */ + 1186, /* GL_POLYGON_TOKEN */ 74, /* GL_BITMAP_TOKEN */ - 447, /* GL_DRAW_PIXEL_TOKEN */ - 301, /* GL_COPY_PIXEL_TOKEN */ - 705, /* GL_LINE_RESET_TOKEN */ - 472, /* GL_EXP */ - 473, /* GL_EXP2 */ - 337, /* GL_CW */ - 125, /* GL_CCW */ - 146, /* GL_COEFF */ - 1088, /* GL_ORDER */ - 384, /* GL_DOMAIN */ - 311, /* GL_CURRENT_COLOR */ - 314, /* GL_CURRENT_INDEX */ - 320, /* GL_CURRENT_NORMAL */ - 333, /* GL_CURRENT_TEXTURE_COORDS */ - 325, /* GL_CURRENT_RASTER_COLOR */ - 327, /* GL_CURRENT_RASTER_INDEX */ - 331, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ - 328, /* GL_CURRENT_RASTER_POSITION */ - 329, /* GL_CURRENT_RASTER_POSITION_VALID */ - 326, /* GL_CURRENT_RASTER_DISTANCE */ - 1164, /* GL_POINT_SMOOTH */ - 1153, /* GL_POINT_SIZE */ - 1163, /* GL_POINT_SIZE_RANGE */ - 1154, /* GL_POINT_SIZE_GRANULARITY */ - 706, /* GL_LINE_SMOOTH */ - 713, /* GL_LINE_WIDTH */ - 715, /* GL_LINE_WIDTH_RANGE */ - 714, /* GL_LINE_WIDTH_GRANULARITY */ - 708, /* GL_LINE_STIPPLE */ - 709, /* GL_LINE_STIPPLE_PATTERN */ - 710, /* GL_LINE_STIPPLE_REPEAT */ - 720, /* GL_LIST_MODE */ - 886, /* GL_MAX_LIST_NESTING */ - 717, /* GL_LIST_BASE */ - 719, /* GL_LIST_INDEX */ - 1174, /* GL_POLYGON_MODE */ - 1181, /* GL_POLYGON_SMOOTH */ - 1183, /* GL_POLYGON_STIPPLE */ - 458, /* GL_EDGE_FLAG */ - 304, /* GL_CULL_FACE */ - 305, /* GL_CULL_FACE_MODE */ - 585, /* GL_FRONT_FACE */ - 688, /* GL_LIGHTING */ - 693, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 694, /* GL_LIGHT_MODEL_TWO_SIDE */ - 690, /* GL_LIGHT_MODEL_AMBIENT */ - 1437, /* GL_SHADE_MODEL */ - 193, /* GL_COLOR_MATERIAL_FACE */ - 194, /* GL_COLOR_MATERIAL_PARAMETER */ - 192, /* GL_COLOR_MATERIAL */ - 508, /* GL_FOG */ - 530, /* GL_FOG_INDEX */ - 526, /* GL_FOG_DENSITY */ - 534, /* GL_FOG_START */ - 528, /* GL_FOG_END */ - 531, /* GL_FOG_MODE */ - 510, /* GL_FOG_COLOR */ - 370, /* GL_DEPTH_RANGE */ - 378, /* GL_DEPTH_TEST */ - 381, /* GL_DEPTH_WRITEMASK */ - 358, /* GL_DEPTH_CLEAR_VALUE */ - 369, /* GL_DEPTH_FUNC */ + 448, /* GL_DRAW_PIXEL_TOKEN */ + 302, /* GL_COPY_PIXEL_TOKEN */ + 706, /* GL_LINE_RESET_TOKEN */ + 473, /* GL_EXP */ + 474, /* GL_EXP2 */ + 338, /* GL_CW */ + 126, /* GL_CCW */ + 147, /* GL_COEFF */ + 1089, /* GL_ORDER */ + 385, /* GL_DOMAIN */ + 312, /* GL_CURRENT_COLOR */ + 315, /* GL_CURRENT_INDEX */ + 321, /* GL_CURRENT_NORMAL */ + 334, /* GL_CURRENT_TEXTURE_COORDS */ + 326, /* GL_CURRENT_RASTER_COLOR */ + 328, /* GL_CURRENT_RASTER_INDEX */ + 332, /* GL_CURRENT_RASTER_TEXTURE_COORDS */ + 329, /* GL_CURRENT_RASTER_POSITION */ + 330, /* GL_CURRENT_RASTER_POSITION_VALID */ + 327, /* GL_CURRENT_RASTER_DISTANCE */ + 1165, /* GL_POINT_SMOOTH */ + 1154, /* GL_POINT_SIZE */ + 1164, /* GL_POINT_SIZE_RANGE */ + 1155, /* GL_POINT_SIZE_GRANULARITY */ + 707, /* GL_LINE_SMOOTH */ + 714, /* GL_LINE_WIDTH */ + 716, /* GL_LINE_WIDTH_RANGE */ + 715, /* GL_LINE_WIDTH_GRANULARITY */ + 709, /* GL_LINE_STIPPLE */ + 710, /* GL_LINE_STIPPLE_PATTERN */ + 711, /* GL_LINE_STIPPLE_REPEAT */ + 721, /* GL_LIST_MODE */ + 887, /* GL_MAX_LIST_NESTING */ + 718, /* GL_LIST_BASE */ + 720, /* GL_LIST_INDEX */ + 1175, /* GL_POLYGON_MODE */ + 1182, /* GL_POLYGON_SMOOTH */ + 1184, /* GL_POLYGON_STIPPLE */ + 459, /* GL_EDGE_FLAG */ + 305, /* GL_CULL_FACE */ + 306, /* GL_CULL_FACE_MODE */ + 586, /* GL_FRONT_FACE */ + 689, /* GL_LIGHTING */ + 694, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 695, /* GL_LIGHT_MODEL_TWO_SIDE */ + 691, /* GL_LIGHT_MODEL_AMBIENT */ + 1441, /* GL_SHADE_MODEL */ + 194, /* GL_COLOR_MATERIAL_FACE */ + 195, /* GL_COLOR_MATERIAL_PARAMETER */ + 193, /* GL_COLOR_MATERIAL */ + 509, /* GL_FOG */ + 531, /* GL_FOG_INDEX */ + 527, /* GL_FOG_DENSITY */ + 535, /* GL_FOG_START */ + 529, /* GL_FOG_END */ + 532, /* GL_FOG_MODE */ + 511, /* GL_FOG_COLOR */ + 371, /* GL_DEPTH_RANGE */ + 379, /* GL_DEPTH_TEST */ + 382, /* GL_DEPTH_WRITEMASK */ + 359, /* GL_DEPTH_CLEAR_VALUE */ + 370, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1535, /* GL_STENCIL_TEST */ - 1519, /* GL_STENCIL_CLEAR_VALUE */ - 1521, /* GL_STENCIL_FUNC */ - 1537, /* GL_STENCIL_VALUE_MASK */ - 1520, /* GL_STENCIL_FAIL */ - 1532, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1533, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1534, /* GL_STENCIL_REF */ - 1538, /* GL_STENCIL_WRITEMASK */ - 854, /* GL_MATRIX_MODE */ - 1026, /* GL_NORMALIZE */ - 1865, /* GL_VIEWPORT */ - 1000, /* GL_MODELVIEW_STACK_DEPTH */ - 1264, /* GL_PROJECTION_STACK_DEPTH */ - 1745, /* GL_TEXTURE_STACK_DEPTH */ - 998, /* GL_MODELVIEW_MATRIX */ - 1263, /* GL_PROJECTION_MATRIX */ - 1728, /* GL_TEXTURE_MATRIX */ + 1539, /* GL_STENCIL_TEST */ + 1523, /* GL_STENCIL_CLEAR_VALUE */ + 1525, /* GL_STENCIL_FUNC */ + 1541, /* GL_STENCIL_VALUE_MASK */ + 1524, /* GL_STENCIL_FAIL */ + 1536, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1537, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1538, /* GL_STENCIL_REF */ + 1542, /* GL_STENCIL_WRITEMASK */ + 855, /* GL_MATRIX_MODE */ + 1027, /* GL_NORMALIZE */ + 1870, /* GL_VIEWPORT */ + 1001, /* GL_MODELVIEW_STACK_DEPTH */ + 1265, /* GL_PROJECTION_STACK_DEPTH */ + 1749, /* GL_TEXTURE_STACK_DEPTH */ + 999, /* GL_MODELVIEW_MATRIX */ + 1264, /* GL_PROJECTION_MATRIX */ + 1732, /* GL_TEXTURE_MATRIX */ 61, /* GL_ATTRIB_STACK_DEPTH */ - 136, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ + 137, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 383, /* GL_DITHER */ + 384, /* GL_DITHER */ 78, /* GL_BLEND_DST */ 87, /* GL_BLEND_SRC */ 75, /* GL_BLEND */ - 723, /* GL_LOGIC_OP_MODE */ - 640, /* GL_INDEX_LOGIC_OP */ - 191, /* GL_COLOR_LOGIC_OP */ + 724, /* GL_LOGIC_OP_MODE */ + 641, /* GL_INDEX_LOGIC_OP */ + 192, /* GL_COLOR_LOGIC_OP */ 67, /* GL_AUX_BUFFERS */ - 394, /* GL_DRAW_BUFFER */ - 1304, /* GL_READ_BUFFER */ - 1418, /* GL_SCISSOR_BOX */ - 1419, /* GL_SCISSOR_TEST */ - 639, /* GL_INDEX_CLEAR_VALUE */ - 644, /* GL_INDEX_WRITEMASK */ - 188, /* GL_COLOR_CLEAR_VALUE */ - 230, /* GL_COLOR_WRITEMASK */ - 641, /* GL_INDEX_MODE */ - 1384, /* GL_RGBA_MODE */ - 393, /* GL_DOUBLEBUFFER */ - 1539, /* GL_STEREO */ - 1342, /* GL_RENDER_MODE */ - 1112, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1165, /* GL_POINT_SMOOTH_HINT */ - 707, /* GL_LINE_SMOOTH_HINT */ - 1182, /* GL_POLYGON_SMOOTH_HINT */ - 529, /* GL_FOG_HINT */ - 1709, /* GL_TEXTURE_GEN_S */ - 1710, /* GL_TEXTURE_GEN_T */ - 1708, /* GL_TEXTURE_GEN_R */ - 1707, /* GL_TEXTURE_GEN_Q */ - 1125, /* GL_PIXEL_MAP_I_TO_I */ - 1131, /* GL_PIXEL_MAP_S_TO_S */ - 1127, /* GL_PIXEL_MAP_I_TO_R */ - 1123, /* GL_PIXEL_MAP_I_TO_G */ - 1121, /* GL_PIXEL_MAP_I_TO_B */ - 1119, /* GL_PIXEL_MAP_I_TO_A */ - 1129, /* GL_PIXEL_MAP_R_TO_R */ - 1117, /* GL_PIXEL_MAP_G_TO_G */ - 1115, /* GL_PIXEL_MAP_B_TO_B */ - 1113, /* GL_PIXEL_MAP_A_TO_A */ - 1126, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1132, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1128, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1124, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1122, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1120, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1130, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1118, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1116, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1114, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1782, /* GL_UNPACK_SWAP_BYTES */ - 1777, /* GL_UNPACK_LSB_FIRST */ - 1778, /* GL_UNPACK_ROW_LENGTH */ - 1781, /* GL_UNPACK_SKIP_ROWS */ - 1780, /* GL_UNPACK_SKIP_PIXELS */ - 1775, /* GL_UNPACK_ALIGNMENT */ - 1100, /* GL_PACK_SWAP_BYTES */ - 1095, /* GL_PACK_LSB_FIRST */ - 1096, /* GL_PACK_ROW_LENGTH */ - 1099, /* GL_PACK_SKIP_ROWS */ - 1098, /* GL_PACK_SKIP_PIXELS */ - 1092, /* GL_PACK_ALIGNMENT */ - 801, /* GL_MAP_COLOR */ - 806, /* GL_MAP_STENCIL */ - 643, /* GL_INDEX_SHIFT */ - 642, /* GL_INDEX_OFFSET */ - 1318, /* GL_RED_SCALE */ - 1316, /* GL_RED_BIAS */ - 1883, /* GL_ZOOM_X */ - 1884, /* GL_ZOOM_Y */ - 603, /* GL_GREEN_SCALE */ - 601, /* GL_GREEN_BIAS */ + 395, /* GL_DRAW_BUFFER */ + 1306, /* GL_READ_BUFFER */ + 1422, /* GL_SCISSOR_BOX */ + 1423, /* GL_SCISSOR_TEST */ + 640, /* GL_INDEX_CLEAR_VALUE */ + 645, /* GL_INDEX_WRITEMASK */ + 189, /* GL_COLOR_CLEAR_VALUE */ + 231, /* GL_COLOR_WRITEMASK */ + 642, /* GL_INDEX_MODE */ + 1388, /* GL_RGBA_MODE */ + 394, /* GL_DOUBLEBUFFER */ + 1543, /* GL_STEREO */ + 1345, /* GL_RENDER_MODE */ + 1113, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1166, /* GL_POINT_SMOOTH_HINT */ + 708, /* GL_LINE_SMOOTH_HINT */ + 1183, /* GL_POLYGON_SMOOTH_HINT */ + 530, /* GL_FOG_HINT */ + 1713, /* GL_TEXTURE_GEN_S */ + 1714, /* GL_TEXTURE_GEN_T */ + 1712, /* GL_TEXTURE_GEN_R */ + 1711, /* GL_TEXTURE_GEN_Q */ + 1126, /* GL_PIXEL_MAP_I_TO_I */ + 1132, /* GL_PIXEL_MAP_S_TO_S */ + 1128, /* GL_PIXEL_MAP_I_TO_R */ + 1124, /* GL_PIXEL_MAP_I_TO_G */ + 1122, /* GL_PIXEL_MAP_I_TO_B */ + 1120, /* GL_PIXEL_MAP_I_TO_A */ + 1130, /* GL_PIXEL_MAP_R_TO_R */ + 1118, /* GL_PIXEL_MAP_G_TO_G */ + 1116, /* GL_PIXEL_MAP_B_TO_B */ + 1114, /* GL_PIXEL_MAP_A_TO_A */ + 1127, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1133, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1129, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1125, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1123, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1121, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1131, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1119, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1117, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1115, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1787, /* GL_UNPACK_SWAP_BYTES */ + 1782, /* GL_UNPACK_LSB_FIRST */ + 1783, /* GL_UNPACK_ROW_LENGTH */ + 1786, /* GL_UNPACK_SKIP_ROWS */ + 1785, /* GL_UNPACK_SKIP_PIXELS */ + 1780, /* GL_UNPACK_ALIGNMENT */ + 1101, /* GL_PACK_SWAP_BYTES */ + 1096, /* GL_PACK_LSB_FIRST */ + 1097, /* GL_PACK_ROW_LENGTH */ + 1100, /* GL_PACK_SKIP_ROWS */ + 1099, /* GL_PACK_SKIP_PIXELS */ + 1093, /* GL_PACK_ALIGNMENT */ + 802, /* GL_MAP_COLOR */ + 807, /* GL_MAP_STENCIL */ + 644, /* GL_INDEX_SHIFT */ + 643, /* GL_INDEX_OFFSET */ + 1320, /* GL_RED_SCALE */ + 1318, /* GL_RED_BIAS */ + 1889, /* GL_ZOOM_X */ + 1890, /* GL_ZOOM_Y */ + 604, /* GL_GREEN_SCALE */ + 602, /* GL_GREEN_BIAS */ 93, /* GL_BLUE_SCALE */ 91, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 371, /* GL_DEPTH_SCALE */ - 351, /* GL_DEPTH_BIAS */ - 881, /* GL_MAX_EVAL_ORDER */ - 885, /* GL_MAX_LIGHTS */ - 863, /* GL_MAX_CLIP_PLANES */ - 933, /* GL_MAX_TEXTURE_SIZE */ - 891, /* GL_MAX_PIXEL_MAP_TABLE */ - 859, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 888, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 889, /* GL_MAX_NAME_STACK_DEPTH */ - 917, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 934, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 948, /* GL_MAX_VIEWPORT_DIMS */ - 860, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1549, /* GL_SUBPIXEL_BITS */ - 638, /* GL_INDEX_BITS */ - 1317, /* GL_RED_BITS */ - 602, /* GL_GREEN_BITS */ + 372, /* GL_DEPTH_SCALE */ + 352, /* GL_DEPTH_BIAS */ + 882, /* GL_MAX_EVAL_ORDER */ + 886, /* GL_MAX_LIGHTS */ + 864, /* GL_MAX_CLIP_PLANES */ + 934, /* GL_MAX_TEXTURE_SIZE */ + 892, /* GL_MAX_PIXEL_MAP_TABLE */ + 860, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 889, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 890, /* GL_MAX_NAME_STACK_DEPTH */ + 918, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 935, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 949, /* GL_MAX_VIEWPORT_DIMS */ + 861, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1553, /* GL_SUBPIXEL_BITS */ + 639, /* GL_INDEX_BITS */ + 1319, /* GL_RED_BITS */ + 603, /* GL_GREEN_BITS */ 92, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ - 352, /* GL_DEPTH_BITS */ - 1517, /* GL_STENCIL_BITS */ + 353, /* GL_DEPTH_BITS */ + 1521, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 1014, /* GL_NAME_STACK_DEPTH */ + 1015, /* GL_NAME_STACK_DEPTH */ 62, /* GL_AUTO_NORMAL */ - 747, /* GL_MAP1_COLOR_4 */ - 750, /* GL_MAP1_INDEX */ - 751, /* GL_MAP1_NORMAL */ - 752, /* GL_MAP1_TEXTURE_COORD_1 */ - 753, /* GL_MAP1_TEXTURE_COORD_2 */ - 754, /* GL_MAP1_TEXTURE_COORD_3 */ - 755, /* GL_MAP1_TEXTURE_COORD_4 */ - 756, /* GL_MAP1_VERTEX_3 */ - 757, /* GL_MAP1_VERTEX_4 */ - 774, /* GL_MAP2_COLOR_4 */ - 777, /* GL_MAP2_INDEX */ - 778, /* GL_MAP2_NORMAL */ - 779, /* GL_MAP2_TEXTURE_COORD_1 */ - 780, /* GL_MAP2_TEXTURE_COORD_2 */ - 781, /* GL_MAP2_TEXTURE_COORD_3 */ - 782, /* GL_MAP2_TEXTURE_COORD_4 */ - 783, /* GL_MAP2_VERTEX_3 */ - 784, /* GL_MAP2_VERTEX_4 */ - 748, /* GL_MAP1_GRID_DOMAIN */ - 749, /* GL_MAP1_GRID_SEGMENTS */ - 775, /* GL_MAP2_GRID_DOMAIN */ - 776, /* GL_MAP2_GRID_SEGMENTS */ - 1632, /* GL_TEXTURE_1D */ - 1634, /* GL_TEXTURE_2D */ - 482, /* GL_FEEDBACK_BUFFER_POINTER */ - 483, /* GL_FEEDBACK_BUFFER_SIZE */ - 484, /* GL_FEEDBACK_BUFFER_TYPE */ - 1428, /* GL_SELECTION_BUFFER_POINTER */ - 1429, /* GL_SELECTION_BUFFER_SIZE */ - 1751, /* GL_TEXTURE_WIDTH */ - 1714, /* GL_TEXTURE_HEIGHT */ - 1669, /* GL_TEXTURE_COMPONENTS */ - 1653, /* GL_TEXTURE_BORDER_COLOR */ - 1652, /* GL_TEXTURE_BORDER */ - 385, /* GL_DONT_CARE */ - 480, /* GL_FASTEST */ - 1022, /* GL_NICEST */ + 748, /* GL_MAP1_COLOR_4 */ + 751, /* GL_MAP1_INDEX */ + 752, /* GL_MAP1_NORMAL */ + 753, /* GL_MAP1_TEXTURE_COORD_1 */ + 754, /* GL_MAP1_TEXTURE_COORD_2 */ + 755, /* GL_MAP1_TEXTURE_COORD_3 */ + 756, /* GL_MAP1_TEXTURE_COORD_4 */ + 757, /* GL_MAP1_VERTEX_3 */ + 758, /* GL_MAP1_VERTEX_4 */ + 775, /* GL_MAP2_COLOR_4 */ + 778, /* GL_MAP2_INDEX */ + 779, /* GL_MAP2_NORMAL */ + 780, /* GL_MAP2_TEXTURE_COORD_1 */ + 781, /* GL_MAP2_TEXTURE_COORD_2 */ + 782, /* GL_MAP2_TEXTURE_COORD_3 */ + 783, /* GL_MAP2_TEXTURE_COORD_4 */ + 784, /* GL_MAP2_VERTEX_3 */ + 785, /* GL_MAP2_VERTEX_4 */ + 749, /* GL_MAP1_GRID_DOMAIN */ + 750, /* GL_MAP1_GRID_SEGMENTS */ + 776, /* GL_MAP2_GRID_DOMAIN */ + 777, /* GL_MAP2_GRID_SEGMENTS */ + 1636, /* GL_TEXTURE_1D */ + 1638, /* GL_TEXTURE_2D */ + 483, /* GL_FEEDBACK_BUFFER_POINTER */ + 484, /* GL_FEEDBACK_BUFFER_SIZE */ + 485, /* GL_FEEDBACK_BUFFER_TYPE */ + 1432, /* GL_SELECTION_BUFFER_POINTER */ + 1433, /* GL_SELECTION_BUFFER_SIZE */ + 1755, /* GL_TEXTURE_WIDTH */ + 1718, /* GL_TEXTURE_HEIGHT */ + 1673, /* GL_TEXTURE_COMPONENTS */ + 1657, /* GL_TEXTURE_BORDER_COLOR */ + 1656, /* GL_TEXTURE_BORDER */ + 386, /* GL_DONT_CARE */ + 481, /* GL_FASTEST */ + 1023, /* GL_NICEST */ 48, /* GL_AMBIENT */ - 382, /* GL_DIFFUSE */ - 1477, /* GL_SPECULAR */ - 1186, /* GL_POSITION */ - 1480, /* GL_SPOT_DIRECTION */ - 1481, /* GL_SPOT_EXPONENT */ - 1479, /* GL_SPOT_CUTOFF */ - 275, /* GL_CONSTANT_ATTENUATION */ - 697, /* GL_LINEAR_ATTENUATION */ - 1285, /* GL_QUADRATIC_ATTENUATION */ - 244, /* GL_COMPILE */ - 245, /* GL_COMPILE_AND_EXECUTE */ - 120, /* GL_BYTE */ - 1784, /* GL_UNSIGNED_BYTE */ - 1442, /* GL_SHORT */ - 1796, /* GL_UNSIGNED_SHORT */ - 646, /* GL_INT */ - 1787, /* GL_UNSIGNED_INT */ - 489, /* GL_FLOAT */ + 383, /* GL_DIFFUSE */ + 1481, /* GL_SPECULAR */ + 1187, /* GL_POSITION */ + 1484, /* GL_SPOT_DIRECTION */ + 1485, /* GL_SPOT_EXPONENT */ + 1483, /* GL_SPOT_CUTOFF */ + 276, /* GL_CONSTANT_ATTENUATION */ + 698, /* GL_LINEAR_ATTENUATION */ + 1287, /* GL_QUADRATIC_ATTENUATION */ + 245, /* GL_COMPILE */ + 246, /* GL_COMPILE_AND_EXECUTE */ + 121, /* GL_BYTE */ + 1789, /* GL_UNSIGNED_BYTE */ + 1446, /* GL_SHORT */ + 1801, /* GL_UNSIGNED_SHORT */ + 647, /* GL_INT */ + 1792, /* GL_UNSIGNED_INT */ + 490, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 392, /* GL_DOUBLE */ - 604, /* GL_HALF_FLOAT */ - 132, /* GL_CLEAR */ + 393, /* GL_DOUBLE */ + 605, /* GL_HALF_FLOAT */ + 133, /* GL_CLEAR */ 50, /* GL_AND */ 52, /* GL_AND_REVERSE */ - 299, /* GL_COPY */ + 300, /* GL_COPY */ 51, /* GL_AND_INVERTED */ - 1024, /* GL_NOOP */ - 1879, /* GL_XOR */ - 1087, /* GL_OR */ - 1025, /* GL_NOR */ - 470, /* GL_EQUIV */ - 673, /* GL_INVERT */ - 1090, /* GL_OR_REVERSE */ - 300, /* GL_COPY_INVERTED */ - 1089, /* GL_OR_INVERTED */ - 1015, /* GL_NAND */ - 1433, /* GL_SET */ - 467, /* GL_EMISSION */ - 1441, /* GL_SHININESS */ + 1025, /* GL_NOOP */ + 1885, /* GL_XOR */ + 1088, /* GL_OR */ + 1026, /* GL_NOR */ + 471, /* GL_EQUIV */ + 674, /* GL_INVERT */ + 1091, /* GL_OR_REVERSE */ + 301, /* GL_COPY_INVERTED */ + 1090, /* GL_OR_INVERTED */ + 1016, /* GL_NAND */ + 1437, /* GL_SET */ + 468, /* GL_EMISSION */ + 1445, /* GL_SHININESS */ 49, /* GL_AMBIENT_AND_DIFFUSE */ - 190, /* GL_COLOR_INDEXES */ - 965, /* GL_MODELVIEW */ - 1262, /* GL_PROJECTION */ - 1567, /* GL_TEXTURE */ - 147, /* GL_COLOR */ - 346, /* GL_DEPTH */ - 1503, /* GL_STENCIL */ - 189, /* GL_COLOR_INDEX */ - 1522, /* GL_STENCIL_INDEX */ - 359, /* GL_DEPTH_COMPONENT */ - 1313, /* GL_RED */ - 600, /* GL_GREEN */ + 191, /* GL_COLOR_INDEXES */ + 966, /* GL_MODELVIEW */ + 1263, /* GL_PROJECTION */ + 1571, /* GL_TEXTURE */ + 148, /* GL_COLOR */ + 347, /* GL_DEPTH */ + 1507, /* GL_STENCIL */ + 190, /* GL_COLOR_INDEX */ + 1526, /* GL_STENCIL_INDEX */ + 360, /* GL_DEPTH_COMPONENT */ + 1315, /* GL_RED */ + 601, /* GL_GREEN */ 90, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1350, /* GL_RGB */ - 1369, /* GL_RGBA */ - 725, /* GL_LUMINANCE */ - 746, /* GL_LUMINANCE_ALPHA */ + 1354, /* GL_RGB */ + 1373, /* GL_RGBA */ + 726, /* GL_LUMINANCE */ + 747, /* GL_LUMINANCE_ALPHA */ 73, /* GL_BITMAP */ - 1142, /* GL_POINT */ - 695, /* GL_LINE */ - 485, /* GL_FILL */ - 1322, /* GL_RENDER */ - 481, /* GL_FEEDBACK */ - 1427, /* GL_SELECT */ - 488, /* GL_FLAT */ - 1452, /* GL_SMOOTH */ - 674, /* GL_KEEP */ - 1344, /* GL_REPLACE */ - 628, /* GL_INCR */ - 342, /* GL_DECR */ - 1811, /* GL_VENDOR */ - 1341, /* GL_RENDERER */ - 1812, /* GL_VERSION */ - 474, /* GL_EXTENSIONS */ - 1392, /* GL_S */ - 1558, /* GL_T */ - 1301, /* GL_R */ - 1284, /* GL_Q */ - 1001, /* GL_MODULATE */ - 341, /* GL_DECAL */ - 1704, /* GL_TEXTURE_ENV_MODE */ - 1703, /* GL_TEXTURE_ENV_COLOR */ - 1702, /* GL_TEXTURE_ENV */ - 475, /* GL_EYE_LINEAR */ - 1048, /* GL_OBJECT_LINEAR */ - 1478, /* GL_SPHERE_MAP */ - 1706, /* GL_TEXTURE_GEN_MODE */ - 1050, /* GL_OBJECT_PLANE */ - 476, /* GL_EYE_PLANE */ - 1016, /* GL_NEAREST */ - 696, /* GL_LINEAR */ - 1020, /* GL_NEAREST_MIPMAP_NEAREST */ - 701, /* GL_LINEAR_MIPMAP_NEAREST */ - 1019, /* GL_NEAREST_MIPMAP_LINEAR */ - 700, /* GL_LINEAR_MIPMAP_LINEAR */ - 1727, /* GL_TEXTURE_MAG_FILTER */ - 1735, /* GL_TEXTURE_MIN_FILTER */ - 1753, /* GL_TEXTURE_WRAP_S */ - 1754, /* GL_TEXTURE_WRAP_T */ - 126, /* GL_CLAMP */ - 1343, /* GL_REPEAT */ - 1180, /* GL_POLYGON_OFFSET_UNITS */ - 1179, /* GL_POLYGON_OFFSET_POINT */ - 1178, /* GL_POLYGON_OFFSET_LINE */ - 1302, /* GL_R3_G3_B2 */ - 1808, /* GL_V2F */ - 1809, /* GL_V3F */ - 123, /* GL_C4UB_V2F */ - 124, /* GL_C4UB_V3F */ - 121, /* GL_C3F_V3F */ - 1013, /* GL_N3F_V3F */ - 122, /* GL_C4F_N3F_V3F */ - 1563, /* GL_T2F_V3F */ - 1565, /* GL_T4F_V4F */ - 1561, /* GL_T2F_C4UB_V3F */ - 1559, /* GL_T2F_C3F_V3F */ - 1562, /* GL_T2F_N3F_V3F */ - 1560, /* GL_T2F_C4F_N3F_V3F */ - 1564, /* GL_T4F_C4F_N3F_V4F */ - 139, /* GL_CLIP_PLANE0 */ - 140, /* GL_CLIP_PLANE1 */ - 141, /* GL_CLIP_PLANE2 */ - 142, /* GL_CLIP_PLANE3 */ - 143, /* GL_CLIP_PLANE4 */ - 144, /* GL_CLIP_PLANE5 */ - 680, /* GL_LIGHT0 */ - 681, /* GL_LIGHT1 */ - 682, /* GL_LIGHT2 */ - 683, /* GL_LIGHT3 */ - 684, /* GL_LIGHT4 */ - 685, /* GL_LIGHT5 */ - 686, /* GL_LIGHT6 */ - 687, /* GL_LIGHT7 */ - 605, /* GL_HINT_BIT */ - 277, /* GL_CONSTANT_COLOR */ - 1061, /* GL_ONE_MINUS_CONSTANT_COLOR */ - 272, /* GL_CONSTANT_ALPHA */ - 1059, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 1143, /* GL_POINT */ + 696, /* GL_LINE */ + 486, /* GL_FILL */ + 1325, /* GL_RENDER */ + 482, /* GL_FEEDBACK */ + 1431, /* GL_SELECT */ + 489, /* GL_FLAT */ + 1456, /* GL_SMOOTH */ + 675, /* GL_KEEP */ + 1347, /* GL_REPLACE */ + 629, /* GL_INCR */ + 343, /* GL_DECR */ + 1816, /* GL_VENDOR */ + 1344, /* GL_RENDERER */ + 1817, /* GL_VERSION */ + 475, /* GL_EXTENSIONS */ + 1396, /* GL_S */ + 1562, /* GL_T */ + 1303, /* GL_R */ + 1286, /* GL_Q */ + 1002, /* GL_MODULATE */ + 342, /* GL_DECAL */ + 1708, /* GL_TEXTURE_ENV_MODE */ + 1707, /* GL_TEXTURE_ENV_COLOR */ + 1706, /* GL_TEXTURE_ENV */ + 476, /* GL_EYE_LINEAR */ + 1049, /* GL_OBJECT_LINEAR */ + 1482, /* GL_SPHERE_MAP */ + 1710, /* GL_TEXTURE_GEN_MODE */ + 1051, /* GL_OBJECT_PLANE */ + 477, /* GL_EYE_PLANE */ + 1017, /* GL_NEAREST */ + 697, /* GL_LINEAR */ + 1021, /* GL_NEAREST_MIPMAP_NEAREST */ + 702, /* GL_LINEAR_MIPMAP_NEAREST */ + 1020, /* GL_NEAREST_MIPMAP_LINEAR */ + 701, /* GL_LINEAR_MIPMAP_LINEAR */ + 1731, /* GL_TEXTURE_MAG_FILTER */ + 1739, /* GL_TEXTURE_MIN_FILTER */ + 1757, /* GL_TEXTURE_WRAP_S */ + 1758, /* GL_TEXTURE_WRAP_T */ + 127, /* GL_CLAMP */ + 1346, /* GL_REPEAT */ + 1181, /* GL_POLYGON_OFFSET_UNITS */ + 1180, /* GL_POLYGON_OFFSET_POINT */ + 1179, /* GL_POLYGON_OFFSET_LINE */ + 1304, /* GL_R3_G3_B2 */ + 1813, /* GL_V2F */ + 1814, /* GL_V3F */ + 124, /* GL_C4UB_V2F */ + 125, /* GL_C4UB_V3F */ + 122, /* GL_C3F_V3F */ + 1014, /* GL_N3F_V3F */ + 123, /* GL_C4F_N3F_V3F */ + 1567, /* GL_T2F_V3F */ + 1569, /* GL_T4F_V4F */ + 1565, /* GL_T2F_C4UB_V3F */ + 1563, /* GL_T2F_C3F_V3F */ + 1566, /* GL_T2F_N3F_V3F */ + 1564, /* GL_T2F_C4F_N3F_V3F */ + 1568, /* GL_T4F_C4F_N3F_V4F */ + 140, /* GL_CLIP_PLANE0 */ + 141, /* GL_CLIP_PLANE1 */ + 142, /* GL_CLIP_PLANE2 */ + 143, /* GL_CLIP_PLANE3 */ + 144, /* GL_CLIP_PLANE4 */ + 145, /* GL_CLIP_PLANE5 */ + 681, /* GL_LIGHT0 */ + 682, /* GL_LIGHT1 */ + 683, /* GL_LIGHT2 */ + 684, /* GL_LIGHT3 */ + 685, /* GL_LIGHT4 */ + 686, /* GL_LIGHT5 */ + 687, /* GL_LIGHT6 */ + 688, /* GL_LIGHT7 */ + 606, /* GL_HINT_BIT */ + 278, /* GL_CONSTANT_COLOR */ + 1062, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 273, /* GL_CONSTANT_ALPHA */ + 1060, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 76, /* GL_BLEND_COLOR */ - 588, /* GL_FUNC_ADD */ - 949, /* GL_MIN */ - 856, /* GL_MAX */ + 589, /* GL_FUNC_ADD */ + 950, /* GL_MIN */ + 857, /* GL_MAX */ 81, /* GL_BLEND_EQUATION */ - 592, /* GL_FUNC_SUBTRACT */ - 590, /* GL_FUNC_REVERSE_SUBTRACT */ - 280, /* GL_CONVOLUTION_1D */ - 281, /* GL_CONVOLUTION_2D */ - 1430, /* GL_SEPARABLE_2D */ - 284, /* GL_CONVOLUTION_BORDER_MODE */ - 288, /* GL_CONVOLUTION_FILTER_SCALE */ - 286, /* GL_CONVOLUTION_FILTER_BIAS */ - 1314, /* GL_REDUCE */ - 290, /* GL_CONVOLUTION_FORMAT */ - 294, /* GL_CONVOLUTION_WIDTH */ - 292, /* GL_CONVOLUTION_HEIGHT */ - 872, /* GL_MAX_CONVOLUTION_WIDTH */ - 870, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1219, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1215, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1210, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1206, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1217, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1213, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1208, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1204, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 606, /* GL_HISTOGRAM */ - 1268, /* GL_PROXY_HISTOGRAM */ - 622, /* GL_HISTOGRAM_WIDTH */ - 612, /* GL_HISTOGRAM_FORMAT */ - 618, /* GL_HISTOGRAM_RED_SIZE */ - 614, /* GL_HISTOGRAM_GREEN_SIZE */ - 609, /* GL_HISTOGRAM_BLUE_SIZE */ - 607, /* GL_HISTOGRAM_ALPHA_SIZE */ - 616, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 620, /* GL_HISTOGRAM_SINK */ - 950, /* GL_MINMAX */ - 952, /* GL_MINMAX_FORMAT */ - 954, /* GL_MINMAX_SINK */ - 1566, /* GL_TABLE_TOO_LARGE_EXT */ - 1786, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1798, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1800, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1793, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1788, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1177, /* GL_POLYGON_OFFSET_FILL */ - 1176, /* GL_POLYGON_OFFSET_FACTOR */ - 1175, /* GL_POLYGON_OFFSET_BIAS */ - 1347, /* GL_RESCALE_NORMAL */ + 593, /* GL_FUNC_SUBTRACT */ + 591, /* GL_FUNC_REVERSE_SUBTRACT */ + 281, /* GL_CONVOLUTION_1D */ + 282, /* GL_CONVOLUTION_2D */ + 1434, /* GL_SEPARABLE_2D */ + 285, /* GL_CONVOLUTION_BORDER_MODE */ + 289, /* GL_CONVOLUTION_FILTER_SCALE */ + 287, /* GL_CONVOLUTION_FILTER_BIAS */ + 1316, /* GL_REDUCE */ + 291, /* GL_CONVOLUTION_FORMAT */ + 295, /* GL_CONVOLUTION_WIDTH */ + 293, /* GL_CONVOLUTION_HEIGHT */ + 873, /* GL_MAX_CONVOLUTION_WIDTH */ + 871, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1220, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1216, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1211, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1207, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1218, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1214, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1209, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1205, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 607, /* GL_HISTOGRAM */ + 1269, /* GL_PROXY_HISTOGRAM */ + 623, /* GL_HISTOGRAM_WIDTH */ + 613, /* GL_HISTOGRAM_FORMAT */ + 619, /* GL_HISTOGRAM_RED_SIZE */ + 615, /* GL_HISTOGRAM_GREEN_SIZE */ + 610, /* GL_HISTOGRAM_BLUE_SIZE */ + 608, /* GL_HISTOGRAM_ALPHA_SIZE */ + 617, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 621, /* GL_HISTOGRAM_SINK */ + 951, /* GL_MINMAX */ + 953, /* GL_MINMAX_FORMAT */ + 955, /* GL_MINMAX_SINK */ + 1570, /* GL_TABLE_TOO_LARGE_EXT */ + 1791, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1803, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1805, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1798, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1793, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1178, /* GL_POLYGON_OFFSET_FILL */ + 1177, /* GL_POLYGON_OFFSET_FACTOR */ + 1176, /* GL_POLYGON_OFFSET_BIAS */ + 1350, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 736, /* GL_LUMINANCE4 */ - 742, /* GL_LUMINANCE8 */ - 726, /* GL_LUMINANCE12 */ - 732, /* GL_LUMINANCE16 */ - 737, /* GL_LUMINANCE4_ALPHA4 */ - 740, /* GL_LUMINANCE6_ALPHA2 */ - 743, /* GL_LUMINANCE8_ALPHA8 */ - 729, /* GL_LUMINANCE12_ALPHA4 */ - 727, /* GL_LUMINANCE12_ALPHA12 */ - 733, /* GL_LUMINANCE16_ALPHA16 */ - 647, /* GL_INTENSITY */ - 652, /* GL_INTENSITY4 */ - 654, /* GL_INTENSITY8 */ - 648, /* GL_INTENSITY12 */ - 650, /* GL_INTENSITY16 */ - 1359, /* GL_RGB2_EXT */ - 1360, /* GL_RGB4 */ - 1363, /* GL_RGB5 */ - 1367, /* GL_RGB8 */ - 1351, /* GL_RGB10 */ - 1355, /* GL_RGB12 */ - 1357, /* GL_RGB16 */ - 1374, /* GL_RGBA2 */ - 1376, /* GL_RGBA4 */ - 1364, /* GL_RGB5_A1 */ - 1380, /* GL_RGBA8 */ - 1352, /* GL_RGB10_A2 */ - 1370, /* GL_RGBA12 */ - 1372, /* GL_RGBA16 */ - 1742, /* GL_TEXTURE_RED_SIZE */ - 1712, /* GL_TEXTURE_GREEN_SIZE */ - 1650, /* GL_TEXTURE_BLUE_SIZE */ - 1637, /* GL_TEXTURE_ALPHA_SIZE */ - 1725, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1716, /* GL_TEXTURE_INTENSITY_SIZE */ - 1345, /* GL_REPLACE_EXT */ - 1272, /* GL_PROXY_TEXTURE_1D */ - 1275, /* GL_PROXY_TEXTURE_2D */ - 1749, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1737, /* GL_TEXTURE_PRIORITY */ - 1744, /* GL_TEXTURE_RESIDENT */ - 1640, /* GL_TEXTURE_BINDING_1D */ - 1642, /* GL_TEXTURE_BINDING_2D */ - 1644, /* GL_TEXTURE_BINDING_3D */ - 1097, /* GL_PACK_SKIP_IMAGES */ - 1093, /* GL_PACK_IMAGE_HEIGHT */ - 1779, /* GL_UNPACK_SKIP_IMAGES */ - 1776, /* GL_UNPACK_IMAGE_HEIGHT */ - 1636, /* GL_TEXTURE_3D */ - 1278, /* GL_PROXY_TEXTURE_3D */ - 1699, /* GL_TEXTURE_DEPTH */ - 1752, /* GL_TEXTURE_WRAP_R */ - 857, /* GL_MAX_3D_TEXTURE_SIZE */ - 1813, /* GL_VERTEX_ARRAY */ - 1027, /* GL_NORMAL_ARRAY */ - 148, /* GL_COLOR_ARRAY */ - 632, /* GL_INDEX_ARRAY */ - 1677, /* GL_TEXTURE_COORD_ARRAY */ - 459, /* GL_EDGE_FLAG_ARRAY */ - 1819, /* GL_VERTEX_ARRAY_SIZE */ - 1821, /* GL_VERTEX_ARRAY_TYPE */ - 1820, /* GL_VERTEX_ARRAY_STRIDE */ - 1032, /* GL_NORMAL_ARRAY_TYPE */ - 1031, /* GL_NORMAL_ARRAY_STRIDE */ - 152, /* GL_COLOR_ARRAY_SIZE */ - 154, /* GL_COLOR_ARRAY_TYPE */ - 153, /* GL_COLOR_ARRAY_STRIDE */ - 637, /* GL_INDEX_ARRAY_TYPE */ - 636, /* GL_INDEX_ARRAY_STRIDE */ - 1681, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1683, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1682, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 463, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1818, /* GL_VERTEX_ARRAY_POINTER */ - 1030, /* GL_NORMAL_ARRAY_POINTER */ - 151, /* GL_COLOR_ARRAY_POINTER */ - 635, /* GL_INDEX_ARRAY_POINTER */ - 1680, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 462, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 1006, /* GL_MULTISAMPLE */ - 1404, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1406, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1411, /* GL_SAMPLE_COVERAGE */ - 1408, /* GL_SAMPLE_BUFFERS */ - 1399, /* GL_SAMPLES */ - 1415, /* GL_SAMPLE_COVERAGE_VALUE */ - 1413, /* GL_SAMPLE_COVERAGE_INVERT */ - 195, /* GL_COLOR_MATRIX */ - 197, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 866, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1202, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1198, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1193, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1189, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1200, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1196, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1191, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1187, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1660, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1279, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1662, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 737, /* GL_LUMINANCE4 */ + 743, /* GL_LUMINANCE8 */ + 727, /* GL_LUMINANCE12 */ + 733, /* GL_LUMINANCE16 */ + 738, /* GL_LUMINANCE4_ALPHA4 */ + 741, /* GL_LUMINANCE6_ALPHA2 */ + 744, /* GL_LUMINANCE8_ALPHA8 */ + 730, /* GL_LUMINANCE12_ALPHA4 */ + 728, /* GL_LUMINANCE12_ALPHA12 */ + 734, /* GL_LUMINANCE16_ALPHA16 */ + 648, /* GL_INTENSITY */ + 653, /* GL_INTENSITY4 */ + 655, /* GL_INTENSITY8 */ + 649, /* GL_INTENSITY12 */ + 651, /* GL_INTENSITY16 */ + 1363, /* GL_RGB2_EXT */ + 1364, /* GL_RGB4 */ + 1367, /* GL_RGB5 */ + 1371, /* GL_RGB8 */ + 1355, /* GL_RGB10 */ + 1359, /* GL_RGB12 */ + 1361, /* GL_RGB16 */ + 1378, /* GL_RGBA2 */ + 1380, /* GL_RGBA4 */ + 1368, /* GL_RGB5_A1 */ + 1384, /* GL_RGBA8 */ + 1356, /* GL_RGB10_A2 */ + 1374, /* GL_RGBA12 */ + 1376, /* GL_RGBA16 */ + 1746, /* GL_TEXTURE_RED_SIZE */ + 1716, /* GL_TEXTURE_GREEN_SIZE */ + 1654, /* GL_TEXTURE_BLUE_SIZE */ + 1641, /* GL_TEXTURE_ALPHA_SIZE */ + 1729, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1720, /* GL_TEXTURE_INTENSITY_SIZE */ + 1348, /* GL_REPLACE_EXT */ + 1273, /* GL_PROXY_TEXTURE_1D */ + 1276, /* GL_PROXY_TEXTURE_2D */ + 1753, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1741, /* GL_TEXTURE_PRIORITY */ + 1748, /* GL_TEXTURE_RESIDENT */ + 1644, /* GL_TEXTURE_BINDING_1D */ + 1646, /* GL_TEXTURE_BINDING_2D */ + 1648, /* GL_TEXTURE_BINDING_3D */ + 1098, /* GL_PACK_SKIP_IMAGES */ + 1094, /* GL_PACK_IMAGE_HEIGHT */ + 1784, /* GL_UNPACK_SKIP_IMAGES */ + 1781, /* GL_UNPACK_IMAGE_HEIGHT */ + 1640, /* GL_TEXTURE_3D */ + 1279, /* GL_PROXY_TEXTURE_3D */ + 1703, /* GL_TEXTURE_DEPTH */ + 1756, /* GL_TEXTURE_WRAP_R */ + 858, /* GL_MAX_3D_TEXTURE_SIZE */ + 1818, /* GL_VERTEX_ARRAY */ + 1028, /* GL_NORMAL_ARRAY */ + 149, /* GL_COLOR_ARRAY */ + 633, /* GL_INDEX_ARRAY */ + 1681, /* GL_TEXTURE_COORD_ARRAY */ + 460, /* GL_EDGE_FLAG_ARRAY */ + 1824, /* GL_VERTEX_ARRAY_SIZE */ + 1826, /* GL_VERTEX_ARRAY_TYPE */ + 1825, /* GL_VERTEX_ARRAY_STRIDE */ + 1033, /* GL_NORMAL_ARRAY_TYPE */ + 1032, /* GL_NORMAL_ARRAY_STRIDE */ + 153, /* GL_COLOR_ARRAY_SIZE */ + 155, /* GL_COLOR_ARRAY_TYPE */ + 154, /* GL_COLOR_ARRAY_STRIDE */ + 638, /* GL_INDEX_ARRAY_TYPE */ + 637, /* GL_INDEX_ARRAY_STRIDE */ + 1685, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1687, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1686, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 464, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1823, /* GL_VERTEX_ARRAY_POINTER */ + 1031, /* GL_NORMAL_ARRAY_POINTER */ + 152, /* GL_COLOR_ARRAY_POINTER */ + 636, /* GL_INDEX_ARRAY_POINTER */ + 1684, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 463, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 1007, /* GL_MULTISAMPLE */ + 1408, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1410, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1415, /* GL_SAMPLE_COVERAGE */ + 1412, /* GL_SAMPLE_BUFFERS */ + 1403, /* GL_SAMPLES */ + 1419, /* GL_SAMPLE_COVERAGE_VALUE */ + 1417, /* GL_SAMPLE_COVERAGE_INVERT */ + 196, /* GL_COLOR_MATRIX */ + 198, /* GL_COLOR_MATRIX_STACK_DEPTH */ + 867, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1203, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1199, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1194, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1190, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1201, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1197, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1192, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1188, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1664, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1280, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1666, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 80, /* GL_BLEND_DST_RGB */ 89, /* GL_BLEND_SRC_RGB */ 79, /* GL_BLEND_DST_ALPHA */ 88, /* GL_BLEND_SRC_ALPHA */ - 201, /* GL_COLOR_TABLE */ - 1212, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1195, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1267, /* GL_PROXY_COLOR_TABLE */ - 1271, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1270, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - 225, /* GL_COLOR_TABLE_SCALE */ - 205, /* GL_COLOR_TABLE_BIAS */ - 210, /* GL_COLOR_TABLE_FORMAT */ - 227, /* GL_COLOR_TABLE_WIDTH */ - 222, /* GL_COLOR_TABLE_RED_SIZE */ - 213, /* GL_COLOR_TABLE_GREEN_SIZE */ - 207, /* GL_COLOR_TABLE_BLUE_SIZE */ - 202, /* GL_COLOR_TABLE_ALPHA_SIZE */ - 219, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ - 216, /* GL_COLOR_TABLE_INTENSITY_SIZE */ + 202, /* GL_COLOR_TABLE */ + 1213, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1196, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1268, /* GL_PROXY_COLOR_TABLE */ + 1272, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1271, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 226, /* GL_COLOR_TABLE_SCALE */ + 206, /* GL_COLOR_TABLE_BIAS */ + 211, /* GL_COLOR_TABLE_FORMAT */ + 228, /* GL_COLOR_TABLE_WIDTH */ + 223, /* GL_COLOR_TABLE_RED_SIZE */ + 214, /* GL_COLOR_TABLE_GREEN_SIZE */ + 208, /* GL_COLOR_TABLE_BLUE_SIZE */ + 203, /* GL_COLOR_TABLE_ALPHA_SIZE */ + 220, /* GL_COLOR_TABLE_LUMINANCE_SIZE */ + 217, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 71, /* GL_BGR */ 72, /* GL_BGRA */ - 880, /* GL_MAX_ELEMENTS_VERTICES */ - 879, /* GL_MAX_ELEMENTS_INDICES */ - 1715, /* GL_TEXTURE_INDEX_SIZE_EXT */ - 145, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1159, /* GL_POINT_SIZE_MIN */ - 1155, /* GL_POINT_SIZE_MAX */ - 1149, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1145, /* GL_POINT_DISTANCE_ATTENUATION */ - 127, /* GL_CLAMP_TO_BORDER */ - 130, /* GL_CLAMP_TO_EDGE */ - 1736, /* GL_TEXTURE_MIN_LOD */ - 1734, /* GL_TEXTURE_MAX_LOD */ - 1639, /* GL_TEXTURE_BASE_LEVEL */ - 1733, /* GL_TEXTURE_MAX_LEVEL */ - 625, /* GL_IGNORE_BORDER_HP */ - 276, /* GL_CONSTANT_BORDER_HP */ - 1346, /* GL_REPLICATE_BORDER_HP */ - 282, /* GL_CONVOLUTION_BORDER_COLOR */ - 1056, /* GL_OCCLUSION_TEST_HP */ - 1057, /* GL_OCCLUSION_TEST_RESULT_HP */ - 698, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1654, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1656, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1658, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1659, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1657, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1655, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 861, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 862, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1222, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1224, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1221, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1223, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1723, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1724, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1722, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 594, /* GL_GENERATE_MIPMAP */ - 595, /* GL_GENERATE_MIPMAP_HINT */ - 532, /* GL_FOG_OFFSET_SGIX */ - 533, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1668, /* GL_TEXTURE_COMPARE_SGIX */ - 1667, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1719, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1711, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 360, /* GL_DEPTH_COMPONENT16 */ - 363, /* GL_DEPTH_COMPONENT24 */ - 366, /* GL_DEPTH_COMPONENT32 */ - 306, /* GL_CULL_VERTEX_EXT */ - 308, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ - 307, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1876, /* GL_WRAP_BORDER_SUN */ - 1661, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 691, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1445, /* GL_SINGLE_COLOR */ - 1431, /* GL_SEPARATE_SPECULAR_COLOR */ - 1440, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 543, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - 544, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - 551, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - 546, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - 542, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - 541, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - 545, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - 552, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - 564, /* GL_FRAMEBUFFER_DEFAULT */ - 580, /* GL_FRAMEBUFFER_UNDEFINED */ - 373, /* GL_DEPTH_STENCIL_ATTACHMENT */ - 631, /* GL_INDEX */ - 1785, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1801, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1802, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1799, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1797, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1794, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1792, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1731, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1732, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1730, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 957, /* GL_MIRRORED_REPEAT */ - 1387, /* GL_RGB_S3TC */ - 1362, /* GL_RGB4_S3TC */ - 1385, /* GL_RGBA_S3TC */ - 1379, /* GL_RGBA4_S3TC */ - 1383, /* GL_RGBA_DXT5_S3TC */ - 1377, /* GL_RGBA4_DXT5_S3TC */ - 264, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ - 259, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ - 260, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ - 261, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 1018, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 1017, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 699, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 519, /* GL_FOG_COORDINATE_SOURCE */ - 511, /* GL_FOG_COORD */ - 535, /* GL_FRAGMENT_DEPTH */ - 312, /* GL_CURRENT_FOG_COORD */ - 518, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 517, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 516, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 513, /* GL_FOG_COORDINATE_ARRAY */ - 199, /* GL_COLOR_SUM */ - 332, /* GL_CURRENT_SECONDARY_COLOR */ - 1424, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1426, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1425, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1423, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1420, /* GL_SECONDARY_COLOR_ARRAY */ - 330, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ + 881, /* GL_MAX_ELEMENTS_VERTICES */ + 880, /* GL_MAX_ELEMENTS_INDICES */ + 1719, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 146, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ + 1160, /* GL_POINT_SIZE_MIN */ + 1156, /* GL_POINT_SIZE_MAX */ + 1150, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1146, /* GL_POINT_DISTANCE_ATTENUATION */ + 128, /* GL_CLAMP_TO_BORDER */ + 131, /* GL_CLAMP_TO_EDGE */ + 1740, /* GL_TEXTURE_MIN_LOD */ + 1738, /* GL_TEXTURE_MAX_LOD */ + 1643, /* GL_TEXTURE_BASE_LEVEL */ + 1737, /* GL_TEXTURE_MAX_LEVEL */ + 626, /* GL_IGNORE_BORDER_HP */ + 277, /* GL_CONSTANT_BORDER_HP */ + 1349, /* GL_REPLICATE_BORDER_HP */ + 283, /* GL_CONVOLUTION_BORDER_COLOR */ + 1057, /* GL_OCCLUSION_TEST_HP */ + 1058, /* GL_OCCLUSION_TEST_RESULT_HP */ + 699, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1658, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1660, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1662, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1663, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1661, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1659, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 862, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 863, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1223, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1225, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1222, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1224, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1727, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1728, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1726, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 595, /* GL_GENERATE_MIPMAP */ + 596, /* GL_GENERATE_MIPMAP_HINT */ + 533, /* GL_FOG_OFFSET_SGIX */ + 534, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1672, /* GL_TEXTURE_COMPARE_SGIX */ + 1671, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1723, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1715, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 361, /* GL_DEPTH_COMPONENT16 */ + 364, /* GL_DEPTH_COMPONENT24 */ + 367, /* GL_DEPTH_COMPONENT32 */ + 307, /* GL_CULL_VERTEX_EXT */ + 309, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ + 308, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ + 1882, /* GL_WRAP_BORDER_SUN */ + 1665, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 692, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1449, /* GL_SINGLE_COLOR */ + 1435, /* GL_SEPARATE_SPECULAR_COLOR */ + 1444, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 544, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 545, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 552, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 547, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 543, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 542, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 546, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 553, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 565, /* GL_FRAMEBUFFER_DEFAULT */ + 581, /* GL_FRAMEBUFFER_UNDEFINED */ + 374, /* GL_DEPTH_STENCIL_ATTACHMENT */ + 632, /* GL_INDEX */ + 1790, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1806, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1807, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1804, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1802, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1799, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1797, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1735, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1736, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1734, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 958, /* GL_MIRRORED_REPEAT */ + 1391, /* GL_RGB_S3TC */ + 1366, /* GL_RGB4_S3TC */ + 1389, /* GL_RGBA_S3TC */ + 1383, /* GL_RGBA4_S3TC */ + 1387, /* GL_RGBA_DXT5_S3TC */ + 1381, /* GL_RGBA4_DXT5_S3TC */ + 265, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ + 260, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ + 261, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ + 262, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ + 1019, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 1018, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 700, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 520, /* GL_FOG_COORDINATE_SOURCE */ + 512, /* GL_FOG_COORD */ + 536, /* GL_FRAGMENT_DEPTH */ + 313, /* GL_CURRENT_FOG_COORD */ + 519, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 518, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 517, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 514, /* GL_FOG_COORDINATE_ARRAY */ + 200, /* GL_COLOR_SUM */ + 333, /* GL_CURRENT_SECONDARY_COLOR */ + 1428, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1430, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1429, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1427, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1424, /* GL_SECONDARY_COLOR_ARRAY */ + 331, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1568, /* GL_TEXTURE0 */ - 1570, /* GL_TEXTURE1 */ - 1592, /* GL_TEXTURE2 */ - 1614, /* GL_TEXTURE3 */ - 1620, /* GL_TEXTURE4 */ - 1622, /* GL_TEXTURE5 */ - 1624, /* GL_TEXTURE6 */ - 1626, /* GL_TEXTURE7 */ - 1628, /* GL_TEXTURE8 */ - 1630, /* GL_TEXTURE9 */ - 1571, /* GL_TEXTURE10 */ - 1573, /* GL_TEXTURE11 */ - 1575, /* GL_TEXTURE12 */ - 1577, /* GL_TEXTURE13 */ - 1579, /* GL_TEXTURE14 */ - 1581, /* GL_TEXTURE15 */ - 1583, /* GL_TEXTURE16 */ - 1585, /* GL_TEXTURE17 */ - 1587, /* GL_TEXTURE18 */ - 1589, /* GL_TEXTURE19 */ - 1593, /* GL_TEXTURE20 */ - 1595, /* GL_TEXTURE21 */ - 1597, /* GL_TEXTURE22 */ - 1599, /* GL_TEXTURE23 */ - 1601, /* GL_TEXTURE24 */ - 1603, /* GL_TEXTURE25 */ - 1605, /* GL_TEXTURE26 */ - 1607, /* GL_TEXTURE27 */ - 1609, /* GL_TEXTURE28 */ - 1611, /* GL_TEXTURE29 */ - 1615, /* GL_TEXTURE30 */ - 1617, /* GL_TEXTURE31 */ + 1572, /* GL_TEXTURE0 */ + 1574, /* GL_TEXTURE1 */ + 1596, /* GL_TEXTURE2 */ + 1618, /* GL_TEXTURE3 */ + 1624, /* GL_TEXTURE4 */ + 1626, /* GL_TEXTURE5 */ + 1628, /* GL_TEXTURE6 */ + 1630, /* GL_TEXTURE7 */ + 1632, /* GL_TEXTURE8 */ + 1634, /* GL_TEXTURE9 */ + 1575, /* GL_TEXTURE10 */ + 1577, /* GL_TEXTURE11 */ + 1579, /* GL_TEXTURE12 */ + 1581, /* GL_TEXTURE13 */ + 1583, /* GL_TEXTURE14 */ + 1585, /* GL_TEXTURE15 */ + 1587, /* GL_TEXTURE16 */ + 1589, /* GL_TEXTURE17 */ + 1591, /* GL_TEXTURE18 */ + 1593, /* GL_TEXTURE19 */ + 1597, /* GL_TEXTURE20 */ + 1599, /* GL_TEXTURE21 */ + 1601, /* GL_TEXTURE22 */ + 1603, /* GL_TEXTURE23 */ + 1605, /* GL_TEXTURE24 */ + 1607, /* GL_TEXTURE25 */ + 1609, /* GL_TEXTURE26 */ + 1611, /* GL_TEXTURE27 */ + 1613, /* GL_TEXTURE28 */ + 1615, /* GL_TEXTURE29 */ + 1619, /* GL_TEXTURE30 */ + 1621, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ - 133, /* GL_CLIENT_ACTIVE_TEXTURE */ - 935, /* GL_MAX_TEXTURE_UNITS */ - 1763, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1766, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1768, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1760, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1550, /* GL_SUBTRACT */ - 920, /* GL_MAX_RENDERBUFFER_SIZE */ - 247, /* GL_COMPRESSED_ALPHA */ - 251, /* GL_COMPRESSED_LUMINANCE */ - 252, /* GL_COMPRESSED_LUMINANCE_ALPHA */ - 249, /* GL_COMPRESSED_INTENSITY */ - 255, /* GL_COMPRESSED_RGB */ - 256, /* GL_COMPRESSED_RGBA */ - 1675, /* GL_TEXTURE_COMPRESSION_HINT */ - 1740, /* GL_TEXTURE_RECTANGLE_ARB */ - 1647, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1282, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 918, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 372, /* GL_DEPTH_STENCIL */ - 1789, /* GL_UNSIGNED_INT_24_8 */ - 931, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1729, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 932, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1705, /* GL_TEXTURE_FILTER_CONTROL */ - 1720, /* GL_TEXTURE_LOD_BIAS */ - 232, /* GL_COMBINE4 */ - 925, /* GL_MAX_SHININESS_NV */ - 926, /* GL_MAX_SPOT_EXPONENT_NV */ - 629, /* GL_INCR_WRAP */ - 343, /* GL_DECR_WRAP */ - 977, /* GL_MODELVIEW1_ARB */ - 1033, /* GL_NORMAL_MAP */ - 1319, /* GL_REFLECTION_MAP */ - 1684, /* GL_TEXTURE_CUBE_MAP */ - 1645, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1692, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1686, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1694, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1688, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1696, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1690, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1280, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 874, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 1012, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 527, /* GL_FOG_DISTANCE_MODE_NV */ - 478, /* GL_EYE_RADIAL_NV */ - 477, /* GL_EYE_PLANE_ABSOLUTE_NV */ - 231, /* GL_COMBINE */ - 238, /* GL_COMBINE_RGB */ - 233, /* GL_COMBINE_ALPHA */ - 1388, /* GL_RGB_SCALE */ + 134, /* GL_CLIENT_ACTIVE_TEXTURE */ + 936, /* GL_MAX_TEXTURE_UNITS */ + 1767, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1770, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1772, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1764, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1554, /* GL_SUBTRACT */ + 921, /* GL_MAX_RENDERBUFFER_SIZE */ + 248, /* GL_COMPRESSED_ALPHA */ + 252, /* GL_COMPRESSED_LUMINANCE */ + 253, /* GL_COMPRESSED_LUMINANCE_ALPHA */ + 250, /* GL_COMPRESSED_INTENSITY */ + 256, /* GL_COMPRESSED_RGB */ + 257, /* GL_COMPRESSED_RGBA */ + 1679, /* GL_TEXTURE_COMPRESSION_HINT */ + 1744, /* GL_TEXTURE_RECTANGLE_ARB */ + 1651, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1283, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 919, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 373, /* GL_DEPTH_STENCIL */ + 1794, /* GL_UNSIGNED_INT_24_8 */ + 932, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1733, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 933, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1709, /* GL_TEXTURE_FILTER_CONTROL */ + 1724, /* GL_TEXTURE_LOD_BIAS */ + 233, /* GL_COMBINE4 */ + 926, /* GL_MAX_SHININESS_NV */ + 927, /* GL_MAX_SPOT_EXPONENT_NV */ + 630, /* GL_INCR_WRAP */ + 344, /* GL_DECR_WRAP */ + 978, /* GL_MODELVIEW1_ARB */ + 1034, /* GL_NORMAL_MAP */ + 1321, /* GL_REFLECTION_MAP */ + 1688, /* GL_TEXTURE_CUBE_MAP */ + 1649, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1696, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1690, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1698, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1692, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1700, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1694, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1281, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 875, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 1013, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 528, /* GL_FOG_DISTANCE_MODE_NV */ + 479, /* GL_EYE_RADIAL_NV */ + 478, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 232, /* GL_COMBINE */ + 239, /* GL_COMBINE_RGB */ + 234, /* GL_COMBINE_ALPHA */ + 1392, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 657, /* GL_INTERPOLATE */ - 271, /* GL_CONSTANT */ - 1228, /* GL_PRIMARY_COLOR */ - 1225, /* GL_PREVIOUS */ - 1460, /* GL_SOURCE0_RGB */ - 1466, /* GL_SOURCE1_RGB */ - 1472, /* GL_SOURCE2_RGB */ - 1476, /* GL_SOURCE3_RGB_NV */ - 1457, /* GL_SOURCE0_ALPHA */ - 1463, /* GL_SOURCE1_ALPHA */ - 1469, /* GL_SOURCE2_ALPHA */ - 1475, /* GL_SOURCE3_ALPHA_NV */ - 1070, /* GL_OPERAND0_RGB */ - 1076, /* GL_OPERAND1_RGB */ - 1082, /* GL_OPERAND2_RGB */ - 1086, /* GL_OPERAND3_RGB_NV */ - 1067, /* GL_OPERAND0_ALPHA */ - 1073, /* GL_OPERAND1_ALPHA */ - 1079, /* GL_OPERAND2_ALPHA */ - 1085, /* GL_OPERAND3_ALPHA_NV */ - 1814, /* GL_VERTEX_ARRAY_BINDING */ - 1738, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - 1739, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - 1880, /* GL_YCBCR_422_APPLE */ - 1803, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1805, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1748, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - 1541, /* GL_STORAGE_PRIVATE_APPLE */ - 1540, /* GL_STORAGE_CACHED_APPLE */ - 1542, /* GL_STORAGE_SHARED_APPLE */ - 1447, /* GL_SLICE_ACCUM_SUN */ - 1289, /* GL_QUAD_MESH_SUN */ - 1772, /* GL_TRIANGLE_MESH_SUN */ - 1853, /* GL_VERTEX_PROGRAM_ARB */ - 1864, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1840, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1846, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1848, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1850, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - 334, /* GL_CURRENT_VERTEX_ATTRIB */ - 1241, /* GL_PROGRAM_LENGTH_ARB */ - 1255, /* GL_PROGRAM_STRING_ARB */ - 999, /* GL_MODELVIEW_PROJECTION_NV */ - 624, /* GL_IDENTITY_NV */ - 671, /* GL_INVERSE_NV */ - 1765, /* GL_TRANSPOSE_NV */ - 672, /* GL_INVERSE_TRANSPOSE_NV */ - 904, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 903, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 810, /* GL_MATRIX0_NV */ - 822, /* GL_MATRIX1_NV */ - 834, /* GL_MATRIX2_NV */ - 838, /* GL_MATRIX3_NV */ - 840, /* GL_MATRIX4_NV */ - 842, /* GL_MATRIX5_NV */ - 844, /* GL_MATRIX6_NV */ - 846, /* GL_MATRIX7_NV */ - 318, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ - 315, /* GL_CURRENT_MATRIX_ARB */ - 1856, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1859, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1253, /* GL_PROGRAM_PARAMETER_NV */ - 1844, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1257, /* GL_PROGRAM_TARGET_NV */ - 1254, /* GL_PROGRAM_RESIDENT_NV */ - 1757, /* GL_TRACK_MATRIX_NV */ - 1758, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1854, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1235, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 356, /* GL_DEPTH_CLAMP */ - 1822, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1829, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1830, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1831, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1832, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1833, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1834, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1835, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1836, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1837, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1823, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1824, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1825, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1826, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1827, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1828, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 758, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 765, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 766, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 767, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 768, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 769, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 770, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 771, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 772, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 773, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 759, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 760, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 761, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 762, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 763, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 764, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 785, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 792, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 793, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 794, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 795, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 796, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 797, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1234, /* GL_PROGRAM_BINDING_ARB */ - 799, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 800, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 786, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 787, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 788, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 789, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 790, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 791, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1673, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1670, /* GL_TEXTURE_COMPRESSED */ - 1038, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - 269, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 947, /* GL_MAX_VERTEX_UNITS_ARB */ + 658, /* GL_INTERPOLATE */ + 272, /* GL_CONSTANT */ + 1229, /* GL_PRIMARY_COLOR */ + 1226, /* GL_PREVIOUS */ + 1464, /* GL_SOURCE0_RGB */ + 1470, /* GL_SOURCE1_RGB */ + 1476, /* GL_SOURCE2_RGB */ + 1480, /* GL_SOURCE3_RGB_NV */ + 1461, /* GL_SOURCE0_ALPHA */ + 1467, /* GL_SOURCE1_ALPHA */ + 1473, /* GL_SOURCE2_ALPHA */ + 1479, /* GL_SOURCE3_ALPHA_NV */ + 1071, /* GL_OPERAND0_RGB */ + 1077, /* GL_OPERAND1_RGB */ + 1083, /* GL_OPERAND2_RGB */ + 1087, /* GL_OPERAND3_RGB_NV */ + 1068, /* GL_OPERAND0_ALPHA */ + 1074, /* GL_OPERAND1_ALPHA */ + 1080, /* GL_OPERAND2_ALPHA */ + 1086, /* GL_OPERAND3_ALPHA_NV */ + 109, /* GL_BUFFER_OBJECT_APPLE */ + 1819, /* GL_VERTEX_ARRAY_BINDING */ + 1742, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + 1743, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + 1886, /* GL_YCBCR_422_APPLE */ + 1808, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1810, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1752, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + 1545, /* GL_STORAGE_PRIVATE_APPLE */ + 1544, /* GL_STORAGE_CACHED_APPLE */ + 1546, /* GL_STORAGE_SHARED_APPLE */ + 1451, /* GL_SLICE_ACCUM_SUN */ + 1291, /* GL_QUAD_MESH_SUN */ + 1776, /* GL_TRIANGLE_MESH_SUN */ + 1858, /* GL_VERTEX_PROGRAM_ARB */ + 1869, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1845, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1851, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1853, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1855, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 335, /* GL_CURRENT_VERTEX_ATTRIB */ + 1242, /* GL_PROGRAM_LENGTH_ARB */ + 1256, /* GL_PROGRAM_STRING_ARB */ + 1000, /* GL_MODELVIEW_PROJECTION_NV */ + 625, /* GL_IDENTITY_NV */ + 672, /* GL_INVERSE_NV */ + 1769, /* GL_TRANSPOSE_NV */ + 673, /* GL_INVERSE_TRANSPOSE_NV */ + 905, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 904, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 811, /* GL_MATRIX0_NV */ + 823, /* GL_MATRIX1_NV */ + 835, /* GL_MATRIX2_NV */ + 839, /* GL_MATRIX3_NV */ + 841, /* GL_MATRIX4_NV */ + 843, /* GL_MATRIX5_NV */ + 845, /* GL_MATRIX6_NV */ + 847, /* GL_MATRIX7_NV */ + 319, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ + 316, /* GL_CURRENT_MATRIX_ARB */ + 1861, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1864, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1254, /* GL_PROGRAM_PARAMETER_NV */ + 1849, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1258, /* GL_PROGRAM_TARGET_NV */ + 1255, /* GL_PROGRAM_RESIDENT_NV */ + 1761, /* GL_TRACK_MATRIX_NV */ + 1762, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1859, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1236, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 357, /* GL_DEPTH_CLAMP */ + 1827, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1834, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1835, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1836, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1837, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1838, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1839, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1840, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1841, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1842, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1828, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1829, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1830, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1831, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1832, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1833, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 759, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 766, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 767, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 768, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 769, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 770, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 771, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 772, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 773, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 774, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 760, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 761, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 762, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 763, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 764, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 765, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 786, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 793, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 794, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 795, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 796, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 797, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 798, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1235, /* GL_PROGRAM_BINDING_ARB */ + 800, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 801, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 787, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 788, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 789, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 790, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 791, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 792, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1677, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1674, /* GL_TEXTURE_COMPRESSED */ + 1039, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 270, /* GL_COMPRESSED_TEXTURE_FORMATS */ + 948, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1875, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1852, /* GL_VERTEX_BLEND_ARB */ - 336, /* GL_CURRENT_WEIGHT_ARB */ - 1874, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1873, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1872, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1871, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1868, /* GL_WEIGHT_ARRAY_ARB */ - 386, /* GL_DOT3_RGB */ - 387, /* GL_DOT3_RGBA */ - 263, /* GL_COMPRESSED_RGB_FXT1_3DFX */ - 258, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 1007, /* GL_MULTISAMPLE_3DFX */ - 1409, /* GL_SAMPLE_BUFFERS_3DFX */ - 1400, /* GL_SAMPLES_3DFX */ - 988, /* GL_MODELVIEW2_ARB */ - 991, /* GL_MODELVIEW3_ARB */ - 992, /* GL_MODELVIEW4_ARB */ - 993, /* GL_MODELVIEW5_ARB */ - 994, /* GL_MODELVIEW6_ARB */ - 995, /* GL_MODELVIEW7_ARB */ - 996, /* GL_MODELVIEW8_ARB */ - 997, /* GL_MODELVIEW9_ARB */ - 967, /* GL_MODELVIEW10_ARB */ - 968, /* GL_MODELVIEW11_ARB */ - 969, /* GL_MODELVIEW12_ARB */ - 970, /* GL_MODELVIEW13_ARB */ - 971, /* GL_MODELVIEW14_ARB */ - 972, /* GL_MODELVIEW15_ARB */ - 973, /* GL_MODELVIEW16_ARB */ - 974, /* GL_MODELVIEW17_ARB */ - 975, /* GL_MODELVIEW18_ARB */ - 976, /* GL_MODELVIEW19_ARB */ - 978, /* GL_MODELVIEW20_ARB */ - 979, /* GL_MODELVIEW21_ARB */ - 980, /* GL_MODELVIEW22_ARB */ - 981, /* GL_MODELVIEW23_ARB */ - 982, /* GL_MODELVIEW24_ARB */ - 983, /* GL_MODELVIEW25_ARB */ - 984, /* GL_MODELVIEW26_ARB */ - 985, /* GL_MODELVIEW27_ARB */ - 986, /* GL_MODELVIEW28_ARB */ - 987, /* GL_MODELVIEW29_ARB */ - 989, /* GL_MODELVIEW30_ARB */ - 990, /* GL_MODELVIEW31_ARB */ - 391, /* GL_DOT3_RGB_EXT */ - 389, /* GL_DOT3_RGBA_EXT */ - 961, /* GL_MIRROR_CLAMP_EXT */ - 964, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 1002, /* GL_MODULATE_ADD_ATI */ - 1003, /* GL_MODULATE_SIGNED_ADD_ATI */ - 1004, /* GL_MODULATE_SUBTRACT_ATI */ - 1881, /* GL_YCBCR_MESA */ - 1094, /* GL_PACK_INVERT_MESA */ - 339, /* GL_DEBUG_OBJECT_MESA */ - 340, /* GL_DEBUG_PRINT_MESA */ - 338, /* GL_DEBUG_ASSERT_MESA */ - 110, /* GL_BUFFER_SIZE */ - 112, /* GL_BUFFER_USAGE */ - 116, /* GL_BUMP_ROT_MATRIX_ATI */ - 117, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ - 115, /* GL_BUMP_NUM_TEX_UNITS_ATI */ - 119, /* GL_BUMP_TEX_UNITS_ATI */ - 451, /* GL_DUDV_ATI */ - 450, /* GL_DU8DV8_ATI */ - 114, /* GL_BUMP_ENVMAP_ATI */ - 118, /* GL_BUMP_TARGET_ATI */ - 1508, /* GL_STENCIL_BACK_FUNC */ - 1506, /* GL_STENCIL_BACK_FAIL */ - 1510, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1512, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 536, /* GL_FRAGMENT_PROGRAM_ARB */ - 1232, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1260, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1259, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1244, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1250, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1249, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 893, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 916, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 915, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 906, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 912, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 911, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 876, /* GL_MAX_DRAW_BUFFERS */ - 395, /* GL_DRAW_BUFFER0 */ - 398, /* GL_DRAW_BUFFER1 */ - 419, /* GL_DRAW_BUFFER2 */ - 422, /* GL_DRAW_BUFFER3 */ - 425, /* GL_DRAW_BUFFER4 */ - 428, /* GL_DRAW_BUFFER5 */ - 431, /* GL_DRAW_BUFFER6 */ - 434, /* GL_DRAW_BUFFER7 */ - 437, /* GL_DRAW_BUFFER8 */ - 440, /* GL_DRAW_BUFFER9 */ - 399, /* GL_DRAW_BUFFER10 */ - 402, /* GL_DRAW_BUFFER11 */ - 405, /* GL_DRAW_BUFFER12 */ - 408, /* GL_DRAW_BUFFER13 */ - 411, /* GL_DRAW_BUFFER14 */ - 414, /* GL_DRAW_BUFFER15 */ + 1881, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1857, /* GL_VERTEX_BLEND_ARB */ + 337, /* GL_CURRENT_WEIGHT_ARB */ + 1880, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1879, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1878, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1877, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1874, /* GL_WEIGHT_ARRAY_ARB */ + 387, /* GL_DOT3_RGB */ + 388, /* GL_DOT3_RGBA */ + 264, /* GL_COMPRESSED_RGB_FXT1_3DFX */ + 259, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ + 1008, /* GL_MULTISAMPLE_3DFX */ + 1413, /* GL_SAMPLE_BUFFERS_3DFX */ + 1404, /* GL_SAMPLES_3DFX */ + 989, /* GL_MODELVIEW2_ARB */ + 992, /* GL_MODELVIEW3_ARB */ + 993, /* GL_MODELVIEW4_ARB */ + 994, /* GL_MODELVIEW5_ARB */ + 995, /* GL_MODELVIEW6_ARB */ + 996, /* GL_MODELVIEW7_ARB */ + 997, /* GL_MODELVIEW8_ARB */ + 998, /* GL_MODELVIEW9_ARB */ + 968, /* GL_MODELVIEW10_ARB */ + 969, /* GL_MODELVIEW11_ARB */ + 970, /* GL_MODELVIEW12_ARB */ + 971, /* GL_MODELVIEW13_ARB */ + 972, /* GL_MODELVIEW14_ARB */ + 973, /* GL_MODELVIEW15_ARB */ + 974, /* GL_MODELVIEW16_ARB */ + 975, /* GL_MODELVIEW17_ARB */ + 976, /* GL_MODELVIEW18_ARB */ + 977, /* GL_MODELVIEW19_ARB */ + 979, /* GL_MODELVIEW20_ARB */ + 980, /* GL_MODELVIEW21_ARB */ + 981, /* GL_MODELVIEW22_ARB */ + 982, /* GL_MODELVIEW23_ARB */ + 983, /* GL_MODELVIEW24_ARB */ + 984, /* GL_MODELVIEW25_ARB */ + 985, /* GL_MODELVIEW26_ARB */ + 986, /* GL_MODELVIEW27_ARB */ + 987, /* GL_MODELVIEW28_ARB */ + 988, /* GL_MODELVIEW29_ARB */ + 990, /* GL_MODELVIEW30_ARB */ + 991, /* GL_MODELVIEW31_ARB */ + 392, /* GL_DOT3_RGB_EXT */ + 390, /* GL_DOT3_RGBA_EXT */ + 962, /* GL_MIRROR_CLAMP_EXT */ + 965, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 1003, /* GL_MODULATE_ADD_ATI */ + 1004, /* GL_MODULATE_SIGNED_ADD_ATI */ + 1005, /* GL_MODULATE_SUBTRACT_ATI */ + 1887, /* GL_YCBCR_MESA */ + 1095, /* GL_PACK_INVERT_MESA */ + 340, /* GL_DEBUG_OBJECT_MESA */ + 341, /* GL_DEBUG_PRINT_MESA */ + 339, /* GL_DEBUG_ASSERT_MESA */ + 111, /* GL_BUFFER_SIZE */ + 113, /* GL_BUFFER_USAGE */ + 117, /* GL_BUMP_ROT_MATRIX_ATI */ + 118, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ + 116, /* GL_BUMP_NUM_TEX_UNITS_ATI */ + 120, /* GL_BUMP_TEX_UNITS_ATI */ + 452, /* GL_DUDV_ATI */ + 451, /* GL_DU8DV8_ATI */ + 115, /* GL_BUMP_ENVMAP_ATI */ + 119, /* GL_BUMP_TARGET_ATI */ + 1512, /* GL_STENCIL_BACK_FUNC */ + 1510, /* GL_STENCIL_BACK_FAIL */ + 1514, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1516, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 537, /* GL_FRAGMENT_PROGRAM_ARB */ + 1233, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1261, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1260, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1245, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1251, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1250, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 894, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 917, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 916, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 907, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 913, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 912, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 877, /* GL_MAX_DRAW_BUFFERS */ + 396, /* GL_DRAW_BUFFER0 */ + 399, /* GL_DRAW_BUFFER1 */ + 420, /* GL_DRAW_BUFFER2 */ + 423, /* GL_DRAW_BUFFER3 */ + 426, /* GL_DRAW_BUFFER4 */ + 429, /* GL_DRAW_BUFFER5 */ + 432, /* GL_DRAW_BUFFER6 */ + 435, /* GL_DRAW_BUFFER7 */ + 438, /* GL_DRAW_BUFFER8 */ + 441, /* GL_DRAW_BUFFER9 */ + 400, /* GL_DRAW_BUFFER10 */ + 403, /* GL_DRAW_BUFFER11 */ + 406, /* GL_DRAW_BUFFER12 */ + 409, /* GL_DRAW_BUFFER13 */ + 412, /* GL_DRAW_BUFFER14 */ + 415, /* GL_DRAW_BUFFER15 */ 82, /* GL_BLEND_EQUATION_ALPHA */ - 855, /* GL_MATRIX_PALETTE_ARB */ - 887, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 890, /* GL_MAX_PALETTE_MATRICES_ARB */ - 321, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 849, /* GL_MATRIX_INDEX_ARRAY_ARB */ - 316, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 851, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 853, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 852, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 850, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1700, /* GL_TEXTURE_DEPTH_SIZE */ - 379, /* GL_DEPTH_TEXTURE_MODE */ - 1665, /* GL_TEXTURE_COMPARE_MODE */ - 1663, /* GL_TEXTURE_COMPARE_FUNC */ - 242, /* GL_COMPARE_R_TO_TEXTURE */ - 1166, /* GL_POINT_SPRITE */ - 296, /* GL_COORD_REPLACE */ - 1170, /* GL_POINT_SPRITE_R_MODE_NV */ - 1293, /* GL_QUERY_COUNTER_BITS */ - 323, /* GL_CURRENT_QUERY */ - 1296, /* GL_QUERY_RESULT */ - 1298, /* GL_QUERY_RESULT_AVAILABLE */ - 941, /* GL_MAX_VERTEX_ATTRIBS */ - 1842, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 377, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 376, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 927, /* GL_MAX_TEXTURE_COORDS */ - 929, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1237, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1239, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1238, /* GL_PROGRAM_FORMAT_ARB */ - 1750, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 354, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 353, /* GL_DEPTH_BOUNDS_EXT */ + 856, /* GL_MATRIX_PALETTE_ARB */ + 888, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 891, /* GL_MAX_PALETTE_MATRICES_ARB */ + 322, /* GL_CURRENT_PALETTE_MATRIX_ARB */ + 850, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 317, /* GL_CURRENT_MATRIX_INDEX_ARB */ + 852, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 854, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 853, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 851, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1704, /* GL_TEXTURE_DEPTH_SIZE */ + 380, /* GL_DEPTH_TEXTURE_MODE */ + 1669, /* GL_TEXTURE_COMPARE_MODE */ + 1667, /* GL_TEXTURE_COMPARE_FUNC */ + 243, /* GL_COMPARE_R_TO_TEXTURE */ + 1167, /* GL_POINT_SPRITE */ + 297, /* GL_COORD_REPLACE */ + 1171, /* GL_POINT_SPRITE_R_MODE_NV */ + 1295, /* GL_QUERY_COUNTER_BITS */ + 324, /* GL_CURRENT_QUERY */ + 1298, /* GL_QUERY_RESULT */ + 1300, /* GL_QUERY_RESULT_AVAILABLE */ + 942, /* GL_MAX_VERTEX_ATTRIBS */ + 1847, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 378, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 377, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 928, /* GL_MAX_TEXTURE_COORDS */ + 930, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1238, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1240, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1239, /* GL_PROGRAM_FORMAT_ARB */ + 1754, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 355, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 354, /* GL_DEPTH_BOUNDS_EXT */ 53, /* GL_ARRAY_BUFFER */ - 464, /* GL_ELEMENT_ARRAY_BUFFER */ + 465, /* GL_ELEMENT_ARRAY_BUFFER */ 54, /* GL_ARRAY_BUFFER_BINDING */ - 465, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1816, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 1028, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - 149, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 633, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1678, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 460, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1421, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 514, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1869, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1838, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1240, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 899, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1246, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 908, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1258, /* GL_PROGRAM_TEMPORARIES_ARB */ - 914, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1248, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 910, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1252, /* GL_PROGRAM_PARAMETERS_ARB */ - 913, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1247, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 909, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1233, /* GL_PROGRAM_ATTRIBS_ARB */ - 894, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1245, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 907, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1231, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 892, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1243, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 905, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 900, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 896, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1261, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1762, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1309, /* GL_READ_ONLY */ - 1877, /* GL_WRITE_ONLY */ - 1311, /* GL_READ_WRITE */ + 466, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1821, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1029, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 150, /* GL_COLOR_ARRAY_BUFFER_BINDING */ + 634, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1682, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 461, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1425, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 515, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1875, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1843, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1241, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 900, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1247, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 909, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1259, /* GL_PROGRAM_TEMPORARIES_ARB */ + 915, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1249, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 911, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1253, /* GL_PROGRAM_PARAMETERS_ARB */ + 914, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1248, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 910, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1234, /* GL_PROGRAM_ATTRIBS_ARB */ + 895, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1246, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 908, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1232, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 893, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1244, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 906, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 901, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 897, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1262, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1766, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1311, /* GL_READ_ONLY */ + 1883, /* GL_WRITE_ONLY */ + 1313, /* GL_READ_WRITE */ 102, /* GL_BUFFER_ACCESS */ 105, /* GL_BUFFER_MAPPED */ 107, /* GL_BUFFER_MAP_POINTER */ - 1756, /* GL_TIME_ELAPSED_EXT */ - 809, /* GL_MATRIX0_ARB */ - 821, /* GL_MATRIX1_ARB */ - 833, /* GL_MATRIX2_ARB */ - 837, /* GL_MATRIX3_ARB */ - 839, /* GL_MATRIX4_ARB */ - 841, /* GL_MATRIX5_ARB */ - 843, /* GL_MATRIX6_ARB */ - 845, /* GL_MATRIX7_ARB */ - 847, /* GL_MATRIX8_ARB */ - 848, /* GL_MATRIX9_ARB */ - 811, /* GL_MATRIX10_ARB */ - 812, /* GL_MATRIX11_ARB */ - 813, /* GL_MATRIX12_ARB */ - 814, /* GL_MATRIX13_ARB */ - 815, /* GL_MATRIX14_ARB */ - 816, /* GL_MATRIX15_ARB */ - 817, /* GL_MATRIX16_ARB */ - 818, /* GL_MATRIX17_ARB */ - 819, /* GL_MATRIX18_ARB */ - 820, /* GL_MATRIX19_ARB */ - 823, /* GL_MATRIX20_ARB */ - 824, /* GL_MATRIX21_ARB */ - 825, /* GL_MATRIX22_ARB */ - 826, /* GL_MATRIX23_ARB */ - 827, /* GL_MATRIX24_ARB */ - 828, /* GL_MATRIX25_ARB */ - 829, /* GL_MATRIX26_ARB */ - 830, /* GL_MATRIX27_ARB */ - 831, /* GL_MATRIX28_ARB */ - 832, /* GL_MATRIX29_ARB */ - 835, /* GL_MATRIX30_ARB */ - 836, /* GL_MATRIX31_ARB */ - 1545, /* GL_STREAM_DRAW */ - 1547, /* GL_STREAM_READ */ - 1543, /* GL_STREAM_COPY */ - 1499, /* GL_STATIC_DRAW */ - 1501, /* GL_STATIC_READ */ - 1497, /* GL_STATIC_COPY */ - 454, /* GL_DYNAMIC_DRAW */ - 456, /* GL_DYNAMIC_READ */ - 452, /* GL_DYNAMIC_COPY */ - 1134, /* GL_PIXEL_PACK_BUFFER */ - 1138, /* GL_PIXEL_UNPACK_BUFFER */ - 1135, /* GL_PIXEL_PACK_BUFFER_BINDING */ - 1139, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ - 347, /* GL_DEPTH24_STENCIL8 */ - 1746, /* GL_TEXTURE_STENCIL_SIZE */ - 1698, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - 895, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 898, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 902, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 901, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 858, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1536, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1760, /* GL_TIME_ELAPSED_EXT */ + 810, /* GL_MATRIX0_ARB */ + 822, /* GL_MATRIX1_ARB */ + 834, /* GL_MATRIX2_ARB */ + 838, /* GL_MATRIX3_ARB */ + 840, /* GL_MATRIX4_ARB */ + 842, /* GL_MATRIX5_ARB */ + 844, /* GL_MATRIX6_ARB */ + 846, /* GL_MATRIX7_ARB */ + 848, /* GL_MATRIX8_ARB */ + 849, /* GL_MATRIX9_ARB */ + 812, /* GL_MATRIX10_ARB */ + 813, /* GL_MATRIX11_ARB */ + 814, /* GL_MATRIX12_ARB */ + 815, /* GL_MATRIX13_ARB */ + 816, /* GL_MATRIX14_ARB */ + 817, /* GL_MATRIX15_ARB */ + 818, /* GL_MATRIX16_ARB */ + 819, /* GL_MATRIX17_ARB */ + 820, /* GL_MATRIX18_ARB */ + 821, /* GL_MATRIX19_ARB */ + 824, /* GL_MATRIX20_ARB */ + 825, /* GL_MATRIX21_ARB */ + 826, /* GL_MATRIX22_ARB */ + 827, /* GL_MATRIX23_ARB */ + 828, /* GL_MATRIX24_ARB */ + 829, /* GL_MATRIX25_ARB */ + 830, /* GL_MATRIX26_ARB */ + 831, /* GL_MATRIX27_ARB */ + 832, /* GL_MATRIX28_ARB */ + 833, /* GL_MATRIX29_ARB */ + 836, /* GL_MATRIX30_ARB */ + 837, /* GL_MATRIX31_ARB */ + 1549, /* GL_STREAM_DRAW */ + 1551, /* GL_STREAM_READ */ + 1547, /* GL_STREAM_COPY */ + 1503, /* GL_STATIC_DRAW */ + 1505, /* GL_STATIC_READ */ + 1501, /* GL_STATIC_COPY */ + 455, /* GL_DYNAMIC_DRAW */ + 457, /* GL_DYNAMIC_READ */ + 453, /* GL_DYNAMIC_COPY */ + 1135, /* GL_PIXEL_PACK_BUFFER */ + 1139, /* GL_PIXEL_UNPACK_BUFFER */ + 1136, /* GL_PIXEL_PACK_BUFFER_BINDING */ + 1140, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + 348, /* GL_DEPTH24_STENCIL8 */ + 1750, /* GL_TEXTURE_STENCIL_SIZE */ + 1702, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + 896, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 899, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 903, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 902, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 859, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1540, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 962, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1402, /* GL_SAMPLES_PASSED */ - 109, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ + 963, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1406, /* GL_SAMPLES_PASSED */ + 110, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ 104, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */ - 537, /* GL_FRAGMENT_SHADER */ - 1862, /* GL_VERTEX_SHADER */ - 1251, /* GL_PROGRAM_OBJECT_ARB */ - 1434, /* GL_SHADER_OBJECT_ARB */ - 883, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 945, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 939, /* GL_MAX_VARYING_FLOATS */ - 943, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 868, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 1054, /* GL_OBJECT_TYPE_ARB */ - 1436, /* GL_SHADER_TYPE */ - 502, /* GL_FLOAT_VEC2 */ - 504, /* GL_FLOAT_VEC3 */ - 506, /* GL_FLOAT_VEC4 */ - 660, /* GL_INT_VEC2 */ - 662, /* GL_INT_VEC3 */ - 664, /* GL_INT_VEC4 */ + 1324, /* GL_RELEASED_APPLE */ + 1872, /* GL_VOLATILE_APPLE */ + 1352, /* GL_RETAINED_APPLE */ + 1779, /* GL_UNDEFINED_APPLE */ + 1285, /* GL_PURGEABLE_APPLE */ + 538, /* GL_FRAGMENT_SHADER */ + 1867, /* GL_VERTEX_SHADER */ + 1252, /* GL_PROGRAM_OBJECT_ARB */ + 1438, /* GL_SHADER_OBJECT_ARB */ + 884, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 946, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 940, /* GL_MAX_VARYING_FLOATS */ + 944, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 869, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1055, /* GL_OBJECT_TYPE_ARB */ + 1440, /* GL_SHADER_TYPE */ + 503, /* GL_FLOAT_VEC2 */ + 505, /* GL_FLOAT_VEC3 */ + 507, /* GL_FLOAT_VEC4 */ + 661, /* GL_INT_VEC2 */ + 663, /* GL_INT_VEC3 */ + 665, /* GL_INT_VEC4 */ 94, /* GL_BOOL */ 96, /* GL_BOOL_VEC2 */ 98, /* GL_BOOL_VEC3 */ 100, /* GL_BOOL_VEC4 */ - 490, /* GL_FLOAT_MAT2 */ - 494, /* GL_FLOAT_MAT3 */ - 498, /* GL_FLOAT_MAT4 */ - 1393, /* GL_SAMPLER_1D */ - 1395, /* GL_SAMPLER_2D */ - 1397, /* GL_SAMPLER_3D */ - 1398, /* GL_SAMPLER_CUBE */ - 1394, /* GL_SAMPLER_1D_SHADOW */ - 1396, /* GL_SAMPLER_2D_SHADOW */ - 492, /* GL_FLOAT_MAT2x3 */ - 493, /* GL_FLOAT_MAT2x4 */ - 496, /* GL_FLOAT_MAT3x2 */ - 497, /* GL_FLOAT_MAT3x4 */ - 500, /* GL_FLOAT_MAT4x2 */ - 501, /* GL_FLOAT_MAT4x3 */ - 345, /* GL_DELETE_STATUS */ - 246, /* GL_COMPILE_STATUS */ - 716, /* GL_LINK_STATUS */ - 1810, /* GL_VALIDATE_STATUS */ - 645, /* GL_INFO_LOG_LENGTH */ + 491, /* GL_FLOAT_MAT2 */ + 495, /* GL_FLOAT_MAT3 */ + 499, /* GL_FLOAT_MAT4 */ + 1397, /* GL_SAMPLER_1D */ + 1399, /* GL_SAMPLER_2D */ + 1401, /* GL_SAMPLER_3D */ + 1402, /* GL_SAMPLER_CUBE */ + 1398, /* GL_SAMPLER_1D_SHADOW */ + 1400, /* GL_SAMPLER_2D_SHADOW */ + 493, /* GL_FLOAT_MAT2x3 */ + 494, /* GL_FLOAT_MAT2x4 */ + 497, /* GL_FLOAT_MAT3x2 */ + 498, /* GL_FLOAT_MAT3x4 */ + 501, /* GL_FLOAT_MAT4x2 */ + 502, /* GL_FLOAT_MAT4x3 */ + 346, /* GL_DELETE_STATUS */ + 247, /* GL_COMPILE_STATUS */ + 717, /* GL_LINK_STATUS */ + 1815, /* GL_VALIDATE_STATUS */ + 646, /* GL_INFO_LOG_LENGTH */ 56, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1435, /* GL_SHADER_SOURCE_LENGTH */ + 1439, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 539, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1438, /* GL_SHADING_LANGUAGE_VERSION */ - 322, /* GL_CURRENT_PROGRAM */ - 1103, /* GL_PALETTE4_RGB8_OES */ - 1105, /* GL_PALETTE4_RGBA8_OES */ - 1101, /* GL_PALETTE4_R5_G6_B5_OES */ - 1104, /* GL_PALETTE4_RGBA4_OES */ - 1102, /* GL_PALETTE4_RGB5_A1_OES */ - 1108, /* GL_PALETTE8_RGB8_OES */ - 1110, /* GL_PALETTE8_RGBA8_OES */ - 1106, /* GL_PALETTE8_R5_G6_B5_OES */ - 1109, /* GL_PALETTE8_RGBA4_OES */ - 1107, /* GL_PALETTE8_RGB5_A1_OES */ - 627, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 626, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1795, /* GL_UNSIGNED_NORMALIZED */ - 1633, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1273, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1635, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1276, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1641, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1643, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 1491, /* GL_SRGB */ - 1492, /* GL_SRGB8 */ - 1494, /* GL_SRGB_ALPHA */ - 1493, /* GL_SRGB8_ALPHA8 */ - 1451, /* GL_SLUMINANCE_ALPHA */ - 1450, /* GL_SLUMINANCE8_ALPHA8 */ - 1448, /* GL_SLUMINANCE */ - 1449, /* GL_SLUMINANCE8 */ - 267, /* GL_COMPRESSED_SRGB */ - 268, /* GL_COMPRESSED_SRGB_ALPHA */ - 265, /* GL_COMPRESSED_SLUMINANCE */ - 266, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1168, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 724, /* GL_LOWER_LEFT */ - 1807, /* GL_UPPER_LEFT */ - 1514, /* GL_STENCIL_BACK_REF */ - 1515, /* GL_STENCIL_BACK_VALUE_MASK */ - 1516, /* GL_STENCIL_BACK_WRITEMASK */ - 444, /* GL_DRAW_FRAMEBUFFER_BINDING */ - 1325, /* GL_RENDERBUFFER_BINDING */ - 1305, /* GL_READ_FRAMEBUFFER */ - 443, /* GL_DRAW_FRAMEBUFFER */ - 1306, /* GL_READ_FRAMEBUFFER_BINDING */ - 1336, /* GL_RENDERBUFFER_SAMPLES */ - 549, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - 547, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - 558, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - 554, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - 556, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - 562, /* GL_FRAMEBUFFER_COMPLETE */ - 566, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - 573, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - 571, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 568, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 572, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 569, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ - 577, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ - 581, /* GL_FRAMEBUFFER_UNSUPPORTED */ - 579, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 864, /* GL_MAX_COLOR_ATTACHMENTS */ - 155, /* GL_COLOR_ATTACHMENT0 */ - 157, /* GL_COLOR_ATTACHMENT1 */ - 171, /* GL_COLOR_ATTACHMENT2 */ - 173, /* GL_COLOR_ATTACHMENT3 */ - 175, /* GL_COLOR_ATTACHMENT4 */ - 177, /* GL_COLOR_ATTACHMENT5 */ - 179, /* GL_COLOR_ATTACHMENT6 */ - 181, /* GL_COLOR_ATTACHMENT7 */ - 183, /* GL_COLOR_ATTACHMENT8 */ - 185, /* GL_COLOR_ATTACHMENT9 */ - 158, /* GL_COLOR_ATTACHMENT10 */ - 160, /* GL_COLOR_ATTACHMENT11 */ - 162, /* GL_COLOR_ATTACHMENT12 */ - 164, /* GL_COLOR_ATTACHMENT13 */ - 166, /* GL_COLOR_ATTACHMENT14 */ - 168, /* GL_COLOR_ATTACHMENT15 */ - 349, /* GL_DEPTH_ATTACHMENT */ - 1504, /* GL_STENCIL_ATTACHMENT */ - 540, /* GL_FRAMEBUFFER */ - 1323, /* GL_RENDERBUFFER */ - 1339, /* GL_RENDERBUFFER_WIDTH */ - 1331, /* GL_RENDERBUFFER_HEIGHT */ - 1333, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - 1531, /* GL_STENCIL_INDEX_EXT */ - 1523, /* GL_STENCIL_INDEX1 */ - 1527, /* GL_STENCIL_INDEX4 */ - 1529, /* GL_STENCIL_INDEX8 */ - 1524, /* GL_STENCIL_INDEX16 */ - 1335, /* GL_RENDERBUFFER_RED_SIZE */ - 1330, /* GL_RENDERBUFFER_GREEN_SIZE */ - 1327, /* GL_RENDERBUFFER_BLUE_SIZE */ - 1324, /* GL_RENDERBUFFER_ALPHA_SIZE */ - 1328, /* GL_RENDERBUFFER_DEPTH_SIZE */ - 1338, /* GL_RENDERBUFFER_STENCIL_SIZE */ - 575, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - 922, /* GL_MAX_SAMPLES */ - 1300, /* GL_QUERY_WAIT_NV */ - 1295, /* GL_QUERY_NO_WAIT_NV */ - 1292, /* GL_QUERY_BY_REGION_WAIT_NV */ - 1291, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ - 1287, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ - 486, /* GL_FIRST_VERTEX_CONVENTION */ - 675, /* GL_LAST_VERTEX_CONVENTION */ - 1265, /* GL_PROVOKING_VERTEX */ - 302, /* GL_COPY_READ_BUFFER */ - 303, /* GL_COPY_WRITE_BUFFER */ - 1386, /* GL_RGBA_SNORM */ - 1382, /* GL_RGBA8_SNORM */ - 1444, /* GL_SIGNED_NORMALIZED */ - 924, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - 1053, /* GL_OBJECT_TYPE */ - 1552, /* GL_SYNC_CONDITION */ - 1557, /* GL_SYNC_STATUS */ - 1554, /* GL_SYNC_FLAGS */ - 1553, /* GL_SYNC_FENCE */ - 1556, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - 1783, /* GL_UNSIGNALED */ - 1443, /* GL_SIGNALED */ + 540, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1442, /* GL_SHADING_LANGUAGE_VERSION */ + 323, /* GL_CURRENT_PROGRAM */ + 1104, /* GL_PALETTE4_RGB8_OES */ + 1106, /* GL_PALETTE4_RGBA8_OES */ + 1102, /* GL_PALETTE4_R5_G6_B5_OES */ + 1105, /* GL_PALETTE4_RGBA4_OES */ + 1103, /* GL_PALETTE4_RGB5_A1_OES */ + 1109, /* GL_PALETTE8_RGB8_OES */ + 1111, /* GL_PALETTE8_RGBA8_OES */ + 1107, /* GL_PALETTE8_R5_G6_B5_OES */ + 1110, /* GL_PALETTE8_RGBA4_OES */ + 1108, /* GL_PALETTE8_RGB5_A1_OES */ + 628, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 627, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1800, /* GL_UNSIGNED_NORMALIZED */ + 1637, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1274, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1639, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1277, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1645, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1647, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 1495, /* GL_SRGB */ + 1496, /* GL_SRGB8 */ + 1498, /* GL_SRGB_ALPHA */ + 1497, /* GL_SRGB8_ALPHA8 */ + 1455, /* GL_SLUMINANCE_ALPHA */ + 1454, /* GL_SLUMINANCE8_ALPHA8 */ + 1452, /* GL_SLUMINANCE */ + 1453, /* GL_SLUMINANCE8 */ + 268, /* GL_COMPRESSED_SRGB */ + 269, /* GL_COMPRESSED_SRGB_ALPHA */ + 266, /* GL_COMPRESSED_SLUMINANCE */ + 267, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ + 1169, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 725, /* GL_LOWER_LEFT */ + 1812, /* GL_UPPER_LEFT */ + 1518, /* GL_STENCIL_BACK_REF */ + 1519, /* GL_STENCIL_BACK_VALUE_MASK */ + 1520, /* GL_STENCIL_BACK_WRITEMASK */ + 445, /* GL_DRAW_FRAMEBUFFER_BINDING */ + 1328, /* GL_RENDERBUFFER_BINDING */ + 1307, /* GL_READ_FRAMEBUFFER */ + 444, /* GL_DRAW_FRAMEBUFFER */ + 1308, /* GL_READ_FRAMEBUFFER_BINDING */ + 1339, /* GL_RENDERBUFFER_SAMPLES */ + 550, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 548, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 559, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 555, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 557, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 563, /* GL_FRAMEBUFFER_COMPLETE */ + 567, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 574, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 572, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 569, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 573, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 570, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ + 578, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ + 582, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 580, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 865, /* GL_MAX_COLOR_ATTACHMENTS */ + 156, /* GL_COLOR_ATTACHMENT0 */ + 158, /* GL_COLOR_ATTACHMENT1 */ + 172, /* GL_COLOR_ATTACHMENT2 */ + 174, /* GL_COLOR_ATTACHMENT3 */ + 176, /* GL_COLOR_ATTACHMENT4 */ + 178, /* GL_COLOR_ATTACHMENT5 */ + 180, /* GL_COLOR_ATTACHMENT6 */ + 182, /* GL_COLOR_ATTACHMENT7 */ + 184, /* GL_COLOR_ATTACHMENT8 */ + 186, /* GL_COLOR_ATTACHMENT9 */ + 159, /* GL_COLOR_ATTACHMENT10 */ + 161, /* GL_COLOR_ATTACHMENT11 */ + 163, /* GL_COLOR_ATTACHMENT12 */ + 165, /* GL_COLOR_ATTACHMENT13 */ + 167, /* GL_COLOR_ATTACHMENT14 */ + 169, /* GL_COLOR_ATTACHMENT15 */ + 350, /* GL_DEPTH_ATTACHMENT */ + 1508, /* GL_STENCIL_ATTACHMENT */ + 541, /* GL_FRAMEBUFFER */ + 1326, /* GL_RENDERBUFFER */ + 1342, /* GL_RENDERBUFFER_WIDTH */ + 1334, /* GL_RENDERBUFFER_HEIGHT */ + 1336, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1535, /* GL_STENCIL_INDEX_EXT */ + 1527, /* GL_STENCIL_INDEX1 */ + 1531, /* GL_STENCIL_INDEX4 */ + 1533, /* GL_STENCIL_INDEX8 */ + 1528, /* GL_STENCIL_INDEX16 */ + 1338, /* GL_RENDERBUFFER_RED_SIZE */ + 1333, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1330, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1327, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1331, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1341, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 576, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 923, /* GL_MAX_SAMPLES */ + 1302, /* GL_QUERY_WAIT_NV */ + 1297, /* GL_QUERY_NO_WAIT_NV */ + 1294, /* GL_QUERY_BY_REGION_WAIT_NV */ + 1293, /* GL_QUERY_BY_REGION_NO_WAIT_NV */ + 1289, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + 487, /* GL_FIRST_VERTEX_CONVENTION */ + 676, /* GL_LAST_VERTEX_CONVENTION */ + 1266, /* GL_PROVOKING_VERTEX */ + 303, /* GL_COPY_READ_BUFFER */ + 304, /* GL_COPY_WRITE_BUFFER */ + 1390, /* GL_RGBA_SNORM */ + 1386, /* GL_RGBA8_SNORM */ + 1448, /* GL_SIGNED_NORMALIZED */ + 925, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + 1054, /* GL_OBJECT_TYPE */ + 1556, /* GL_SYNC_CONDITION */ + 1561, /* GL_SYNC_STATUS */ + 1558, /* GL_SYNC_FLAGS */ + 1557, /* GL_SYNC_FENCE */ + 1560, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + 1788, /* GL_UNSIGNALED */ + 1447, /* GL_SIGNALED */ 46, /* GL_ALREADY_SIGNALED */ - 1755, /* GL_TIMEOUT_EXPIRED */ - 270, /* GL_CONDITION_SATISFIED */ - 1867, /* GL_WAIT_FAILED */ - 471, /* GL_EVAL_BIT */ - 1303, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 718, /* GL_LIST_BIT */ - 1649, /* GL_TEXTURE_BIT */ - 1417, /* GL_SCISSOR_BIT */ + 1759, /* GL_TIMEOUT_EXPIRED */ + 271, /* GL_CONDITION_SATISFIED */ + 1873, /* GL_WAIT_FAILED */ + 472, /* GL_EVAL_BIT */ + 1305, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 719, /* GL_LIST_BIT */ + 1653, /* GL_TEXTURE_BIT */ + 1421, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 1009, /* GL_MULTISAMPLE_BIT */ + 1010, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ }; diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index 0a5b629688..ee898efa5f 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -733,3634 +733,3646 @@ static const char _mesa_function_pool[] = "glMultTransposeMatrixd\0" "glMultTransposeMatrixdARB\0" "\0" - /* _mesa_function_pool[4900]: AlphaFunc (offset 240) */ + /* _mesa_function_pool[4900]: ObjectUnpurgeableAPPLE (will be remapped) */ + "iii\0" + "glObjectUnpurgeableAPPLE\0" + "\0" + /* _mesa_function_pool[4930]: AlphaFunc (offset 240) */ "if\0" "glAlphaFunc\0" "\0" - /* _mesa_function_pool[4916]: WindowPos2svMESA (will be remapped) */ + /* _mesa_function_pool[4946]: WindowPos2svMESA (will be remapped) */ "p\0" "glWindowPos2sv\0" "glWindowPos2svARB\0" "glWindowPos2svMESA\0" "\0" - /* _mesa_function_pool[4971]: EdgeFlag (offset 41) */ + /* _mesa_function_pool[5001]: EdgeFlag (offset 41) */ "i\0" "glEdgeFlag\0" "\0" - /* _mesa_function_pool[4985]: TexCoord2iv (offset 107) */ + /* _mesa_function_pool[5015]: TexCoord2iv (offset 107) */ "p\0" "glTexCoord2iv\0" "\0" - /* _mesa_function_pool[5002]: CompressedTexImage1DARB (will be remapped) */ + /* _mesa_function_pool[5032]: CompressedTexImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexImage1D\0" "glCompressedTexImage1DARB\0" "\0" - /* _mesa_function_pool[5060]: Rotated (offset 299) */ + /* _mesa_function_pool[5090]: Rotated (offset 299) */ "dddd\0" "glRotated\0" "\0" - /* _mesa_function_pool[5076]: VertexAttrib2sNV (will be remapped) */ + /* _mesa_function_pool[5106]: VertexAttrib2sNV (will be remapped) */ "iii\0" "glVertexAttrib2sNV\0" "\0" - /* _mesa_function_pool[5100]: ReadPixels (offset 256) */ + /* _mesa_function_pool[5130]: ReadPixels (offset 256) */ "iiiiiip\0" "glReadPixels\0" "\0" - /* _mesa_function_pool[5122]: EdgeFlagv (offset 42) */ + /* _mesa_function_pool[5152]: EdgeFlagv (offset 42) */ "p\0" "glEdgeFlagv\0" "\0" - /* _mesa_function_pool[5137]: NormalPointerListIBM (dynamic) */ + /* _mesa_function_pool[5167]: NormalPointerListIBM (dynamic) */ "iipi\0" "glNormalPointerListIBM\0" "\0" - /* _mesa_function_pool[5166]: IndexPointerEXT (will be remapped) */ + /* _mesa_function_pool[5196]: IndexPointerEXT (will be remapped) */ "iiip\0" "glIndexPointerEXT\0" "\0" - /* _mesa_function_pool[5190]: Color4iv (offset 32) */ + /* _mesa_function_pool[5220]: Color4iv (offset 32) */ "p\0" "glColor4iv\0" "\0" - /* _mesa_function_pool[5204]: TexParameterf (offset 178) */ + /* _mesa_function_pool[5234]: TexParameterf (offset 178) */ "iif\0" "glTexParameterf\0" "\0" - /* _mesa_function_pool[5225]: TexParameteri (offset 180) */ + /* _mesa_function_pool[5255]: TexParameteri (offset 180) */ "iii\0" "glTexParameteri\0" "\0" - /* _mesa_function_pool[5246]: NormalPointerEXT (will be remapped) */ + /* _mesa_function_pool[5276]: NormalPointerEXT (will be remapped) */ "iiip\0" "glNormalPointerEXT\0" "\0" - /* _mesa_function_pool[5271]: MultiTexCoord3dARB (offset 392) */ + /* _mesa_function_pool[5301]: MultiTexCoord3dARB (offset 392) */ "iddd\0" "glMultiTexCoord3d\0" "glMultiTexCoord3dARB\0" "\0" - /* _mesa_function_pool[5316]: MultiTexCoord2iARB (offset 388) */ + /* _mesa_function_pool[5346]: MultiTexCoord2iARB (offset 388) */ "iii\0" "glMultiTexCoord2i\0" "glMultiTexCoord2iARB\0" "\0" - /* _mesa_function_pool[5360]: DrawPixels (offset 257) */ + /* _mesa_function_pool[5390]: DrawPixels (offset 257) */ "iiiip\0" "glDrawPixels\0" "\0" - /* _mesa_function_pool[5380]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[5410]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ "iffffffff\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[5440]: MultiTexCoord2svARB (offset 391) */ + /* _mesa_function_pool[5470]: MultiTexCoord2svARB (offset 391) */ "ip\0" "glMultiTexCoord2sv\0" "glMultiTexCoord2svARB\0" "\0" - /* _mesa_function_pool[5485]: ReplacementCodeubvSUN (dynamic) */ + /* _mesa_function_pool[5515]: ReplacementCodeubvSUN (dynamic) */ "p\0" "glReplacementCodeubvSUN\0" "\0" - /* _mesa_function_pool[5512]: Uniform3iARB (will be remapped) */ + /* _mesa_function_pool[5542]: Uniform3iARB (will be remapped) */ "iiii\0" "glUniform3i\0" "glUniform3iARB\0" "\0" - /* _mesa_function_pool[5545]: GetFragmentMaterialfvSGIX (dynamic) */ + /* _mesa_function_pool[5575]: GetFragmentMaterialfvSGIX (dynamic) */ "iip\0" "glGetFragmentMaterialfvSGIX\0" "\0" - /* _mesa_function_pool[5578]: GetShaderInfoLog (will be remapped) */ + /* _mesa_function_pool[5608]: GetShaderInfoLog (will be remapped) */ "iipp\0" "glGetShaderInfoLog\0" "\0" - /* _mesa_function_pool[5603]: WeightivARB (dynamic) */ + /* _mesa_function_pool[5633]: WeightivARB (dynamic) */ "ip\0" "glWeightivARB\0" "\0" - /* _mesa_function_pool[5621]: PollInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[5651]: PollInstrumentsSGIX (dynamic) */ "p\0" "glPollInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[5646]: GlobalAlphaFactordSUN (dynamic) */ + /* _mesa_function_pool[5676]: GlobalAlphaFactordSUN (dynamic) */ "d\0" "glGlobalAlphaFactordSUN\0" "\0" - /* _mesa_function_pool[5673]: GetFinalCombinerInputParameterfvNV (will be remapped) */ + /* _mesa_function_pool[5703]: GetFinalCombinerInputParameterfvNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterfvNV\0" "\0" - /* _mesa_function_pool[5715]: GenerateMipmapEXT (will be remapped) */ + /* _mesa_function_pool[5745]: GenerateMipmapEXT (will be remapped) */ "i\0" "glGenerateMipmap\0" "glGenerateMipmapEXT\0" "\0" - /* _mesa_function_pool[5755]: GenLists (offset 5) */ + /* _mesa_function_pool[5785]: GenLists (offset 5) */ "i\0" "glGenLists\0" "\0" - /* _mesa_function_pool[5769]: SetFragmentShaderConstantATI (will be remapped) */ + /* _mesa_function_pool[5799]: SetFragmentShaderConstantATI (will be remapped) */ "ip\0" "glSetFragmentShaderConstantATI\0" "\0" - /* _mesa_function_pool[5804]: GetMapAttribParameterivNV (dynamic) */ + /* _mesa_function_pool[5834]: GetMapAttribParameterivNV (dynamic) */ "iiip\0" "glGetMapAttribParameterivNV\0" "\0" - /* _mesa_function_pool[5838]: CreateShaderObjectARB (will be remapped) */ + /* _mesa_function_pool[5868]: CreateShaderObjectARB (will be remapped) */ "i\0" "glCreateShaderObjectARB\0" "\0" - /* _mesa_function_pool[5865]: GetSharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[5895]: GetSharpenTexFuncSGIS (dynamic) */ "ip\0" "glGetSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[5893]: BufferDataARB (will be remapped) */ + /* _mesa_function_pool[5923]: BufferDataARB (will be remapped) */ "iipi\0" "glBufferData\0" "glBufferDataARB\0" "\0" - /* _mesa_function_pool[5928]: FlushVertexArrayRangeNV (will be remapped) */ + /* _mesa_function_pool[5958]: FlushVertexArrayRangeNV (will be remapped) */ "\0" "glFlushVertexArrayRangeNV\0" "\0" - /* _mesa_function_pool[5956]: MapGrid2d (offset 226) */ + /* _mesa_function_pool[5986]: MapGrid2d (offset 226) */ "iddidd\0" "glMapGrid2d\0" "\0" - /* _mesa_function_pool[5976]: MapGrid2f (offset 227) */ + /* _mesa_function_pool[6006]: MapGrid2f (offset 227) */ "iffiff\0" "glMapGrid2f\0" "\0" - /* _mesa_function_pool[5996]: SampleMapATI (will be remapped) */ + /* _mesa_function_pool[6026]: SampleMapATI (will be remapped) */ "iii\0" "glSampleMapATI\0" "\0" - /* _mesa_function_pool[6016]: VertexPointerEXT (will be remapped) */ + /* _mesa_function_pool[6046]: VertexPointerEXT (will be remapped) */ "iiiip\0" "glVertexPointerEXT\0" "\0" - /* _mesa_function_pool[6042]: GetTexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[6072]: GetTexFilterFuncSGIS (dynamic) */ "iip\0" "glGetTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[6070]: Scissor (offset 176) */ + /* _mesa_function_pool[6100]: Scissor (offset 176) */ "iiii\0" "glScissor\0" "\0" - /* _mesa_function_pool[6086]: Fogf (offset 153) */ + /* _mesa_function_pool[6116]: Fogf (offset 153) */ "if\0" "glFogf\0" "\0" - /* _mesa_function_pool[6097]: GetCombinerOutputParameterfvNV (will be remapped) */ + /* _mesa_function_pool[6127]: GetCombinerOutputParameterfvNV (will be remapped) */ "iiip\0" "glGetCombinerOutputParameterfvNV\0" "\0" - /* _mesa_function_pool[6136]: TexSubImage1D (offset 332) */ + /* _mesa_function_pool[6166]: TexSubImage1D (offset 332) */ "iiiiiip\0" "glTexSubImage1D\0" "glTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[6180]: VertexAttrib1sARB (will be remapped) */ + /* _mesa_function_pool[6210]: VertexAttrib1sARB (will be remapped) */ "ii\0" "glVertexAttrib1s\0" "glVertexAttrib1sARB\0" "\0" - /* _mesa_function_pool[6221]: FenceSync (will be remapped) */ + /* _mesa_function_pool[6251]: FenceSync (will be remapped) */ "ii\0" "glFenceSync\0" "\0" - /* _mesa_function_pool[6237]: Color4usv (offset 40) */ + /* _mesa_function_pool[6267]: Color4usv (offset 40) */ "p\0" "glColor4usv\0" "\0" - /* _mesa_function_pool[6252]: Fogi (offset 155) */ + /* _mesa_function_pool[6282]: Fogi (offset 155) */ "ii\0" "glFogi\0" "\0" - /* _mesa_function_pool[6263]: DepthRange (offset 288) */ + /* _mesa_function_pool[6293]: DepthRange (offset 288) */ "dd\0" "glDepthRange\0" "\0" - /* _mesa_function_pool[6280]: RasterPos3iv (offset 75) */ + /* _mesa_function_pool[6310]: RasterPos3iv (offset 75) */ "p\0" "glRasterPos3iv\0" "\0" - /* _mesa_function_pool[6298]: FinalCombinerInputNV (will be remapped) */ + /* _mesa_function_pool[6328]: FinalCombinerInputNV (will be remapped) */ "iiii\0" "glFinalCombinerInputNV\0" "\0" - /* _mesa_function_pool[6327]: TexCoord2i (offset 106) */ + /* _mesa_function_pool[6357]: TexCoord2i (offset 106) */ "ii\0" "glTexCoord2i\0" "\0" - /* _mesa_function_pool[6344]: PixelMapfv (offset 251) */ + /* _mesa_function_pool[6374]: PixelMapfv (offset 251) */ "iip\0" "glPixelMapfv\0" "\0" - /* _mesa_function_pool[6362]: Color4ui (offset 37) */ + /* _mesa_function_pool[6392]: Color4ui (offset 37) */ "iiii\0" "glColor4ui\0" "\0" - /* _mesa_function_pool[6379]: RasterPos3s (offset 76) */ + /* _mesa_function_pool[6409]: RasterPos3s (offset 76) */ "iii\0" "glRasterPos3s\0" "\0" - /* _mesa_function_pool[6398]: Color3usv (offset 24) */ + /* _mesa_function_pool[6428]: Color3usv (offset 24) */ "p\0" "glColor3usv\0" "\0" - /* _mesa_function_pool[6413]: FlushRasterSGIX (dynamic) */ + /* _mesa_function_pool[6443]: FlushRasterSGIX (dynamic) */ "\0" "glFlushRasterSGIX\0" "\0" - /* _mesa_function_pool[6433]: TexCoord2f (offset 104) */ + /* _mesa_function_pool[6463]: TexCoord2f (offset 104) */ "ff\0" "glTexCoord2f\0" "\0" - /* _mesa_function_pool[6450]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[6480]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ "ifffff\0" "glReplacementCodeuiTexCoord2fVertex3fSUN\0" "\0" - /* _mesa_function_pool[6499]: TexCoord2d (offset 102) */ + /* _mesa_function_pool[6529]: TexCoord2d (offset 102) */ "dd\0" "glTexCoord2d\0" "\0" - /* _mesa_function_pool[6516]: RasterPos3d (offset 70) */ + /* _mesa_function_pool[6546]: RasterPos3d (offset 70) */ "ddd\0" "glRasterPos3d\0" "\0" - /* _mesa_function_pool[6535]: RasterPos3f (offset 72) */ + /* _mesa_function_pool[6565]: RasterPos3f (offset 72) */ "fff\0" "glRasterPos3f\0" "\0" - /* _mesa_function_pool[6554]: Uniform1fARB (will be remapped) */ + /* _mesa_function_pool[6584]: Uniform1fARB (will be remapped) */ "if\0" "glUniform1f\0" "glUniform1fARB\0" "\0" - /* _mesa_function_pool[6585]: AreTexturesResident (offset 322) */ + /* _mesa_function_pool[6615]: AreTexturesResident (offset 322) */ "ipp\0" "glAreTexturesResident\0" "glAreTexturesResidentEXT\0" "\0" - /* _mesa_function_pool[6637]: TexCoord2s (offset 108) */ + /* _mesa_function_pool[6667]: TexCoord2s (offset 108) */ "ii\0" "glTexCoord2s\0" "\0" - /* _mesa_function_pool[6654]: StencilOpSeparate (will be remapped) */ + /* _mesa_function_pool[6684]: StencilOpSeparate (will be remapped) */ "iiii\0" "glStencilOpSeparate\0" "glStencilOpSeparateATI\0" "\0" - /* _mesa_function_pool[6703]: ColorTableParameteriv (offset 341) */ + /* _mesa_function_pool[6733]: ColorTableParameteriv (offset 341) */ "iip\0" "glColorTableParameteriv\0" "glColorTableParameterivSGI\0" "\0" - /* _mesa_function_pool[6759]: FogCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[6789]: FogCoordPointerListIBM (dynamic) */ "iipi\0" "glFogCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[6790]: WindowPos3dMESA (will be remapped) */ + /* _mesa_function_pool[6820]: WindowPos3dMESA (will be remapped) */ "ddd\0" "glWindowPos3d\0" "glWindowPos3dARB\0" "glWindowPos3dMESA\0" "\0" - /* _mesa_function_pool[6844]: Color4us (offset 39) */ + /* _mesa_function_pool[6874]: Color4us (offset 39) */ "iiii\0" "glColor4us\0" "\0" - /* _mesa_function_pool[6861]: PointParameterfvEXT (will be remapped) */ + /* _mesa_function_pool[6891]: PointParameterfvEXT (will be remapped) */ "ip\0" "glPointParameterfv\0" "glPointParameterfvARB\0" "glPointParameterfvEXT\0" "glPointParameterfvSGIS\0" "\0" - /* _mesa_function_pool[6951]: Color3bv (offset 10) */ + /* _mesa_function_pool[6981]: Color3bv (offset 10) */ "p\0" "glColor3bv\0" "\0" - /* _mesa_function_pool[6965]: WindowPos2fvMESA (will be remapped) */ + /* _mesa_function_pool[6995]: WindowPos2fvMESA (will be remapped) */ "p\0" "glWindowPos2fv\0" "glWindowPos2fvARB\0" "glWindowPos2fvMESA\0" "\0" - /* _mesa_function_pool[7020]: SecondaryColor3bvEXT (will be remapped) */ + /* _mesa_function_pool[7050]: SecondaryColor3bvEXT (will be remapped) */ "p\0" "glSecondaryColor3bv\0" "glSecondaryColor3bvEXT\0" "\0" - /* _mesa_function_pool[7066]: VertexPointerListIBM (dynamic) */ + /* _mesa_function_pool[7096]: VertexPointerListIBM (dynamic) */ "iiipi\0" "glVertexPointerListIBM\0" "\0" - /* _mesa_function_pool[7096]: GetProgramLocalParameterfvARB (will be remapped) */ + /* _mesa_function_pool[7126]: GetProgramLocalParameterfvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterfvARB\0" "\0" - /* _mesa_function_pool[7133]: FragmentMaterialfSGIX (dynamic) */ + /* _mesa_function_pool[7163]: FragmentMaterialfSGIX (dynamic) */ "iif\0" "glFragmentMaterialfSGIX\0" "\0" - /* _mesa_function_pool[7162]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[7192]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[7204]: RenderbufferStorageEXT (will be remapped) */ + /* _mesa_function_pool[7234]: RenderbufferStorageEXT (will be remapped) */ "iiii\0" "glRenderbufferStorage\0" "glRenderbufferStorageEXT\0" "\0" - /* _mesa_function_pool[7257]: IsFenceNV (will be remapped) */ + /* _mesa_function_pool[7287]: IsFenceNV (will be remapped) */ "i\0" "glIsFenceNV\0" "\0" - /* _mesa_function_pool[7272]: AttachObjectARB (will be remapped) */ + /* _mesa_function_pool[7302]: AttachObjectARB (will be remapped) */ "ii\0" "glAttachObjectARB\0" "\0" - /* _mesa_function_pool[7294]: GetFragmentLightivSGIX (dynamic) */ + /* _mesa_function_pool[7324]: GetFragmentLightivSGIX (dynamic) */ "iip\0" "glGetFragmentLightivSGIX\0" "\0" - /* _mesa_function_pool[7324]: UniformMatrix2fvARB (will be remapped) */ + /* _mesa_function_pool[7354]: UniformMatrix2fvARB (will be remapped) */ "iiip\0" "glUniformMatrix2fv\0" "glUniformMatrix2fvARB\0" "\0" - /* _mesa_function_pool[7371]: MultiTexCoord2fARB (offset 386) */ + /* _mesa_function_pool[7401]: MultiTexCoord2fARB (offset 386) */ "iff\0" "glMultiTexCoord2f\0" "glMultiTexCoord2fARB\0" "\0" - /* _mesa_function_pool[7415]: ColorTable (offset 339) */ + /* _mesa_function_pool[7445]: ColorTable (offset 339) */ "iiiiip\0" "glColorTable\0" "glColorTableSGI\0" "glColorTableEXT\0" "\0" - /* _mesa_function_pool[7468]: IndexPointer (offset 314) */ + /* _mesa_function_pool[7498]: IndexPointer (offset 314) */ "iip\0" "glIndexPointer\0" "\0" - /* _mesa_function_pool[7488]: Accum (offset 213) */ + /* _mesa_function_pool[7518]: Accum (offset 213) */ "if\0" "glAccum\0" "\0" - /* _mesa_function_pool[7500]: GetTexImage (offset 281) */ + /* _mesa_function_pool[7530]: GetTexImage (offset 281) */ "iiiip\0" "glGetTexImage\0" "\0" - /* _mesa_function_pool[7521]: MapControlPointsNV (dynamic) */ + /* _mesa_function_pool[7551]: MapControlPointsNV (dynamic) */ "iiiiiiiip\0" "glMapControlPointsNV\0" "\0" - /* _mesa_function_pool[7553]: ConvolutionFilter2D (offset 349) */ + /* _mesa_function_pool[7583]: ConvolutionFilter2D (offset 349) */ "iiiiiip\0" "glConvolutionFilter2D\0" "glConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[7609]: Finish (offset 216) */ + /* _mesa_function_pool[7639]: Finish (offset 216) */ "\0" "glFinish\0" "\0" - /* _mesa_function_pool[7620]: MapParameterfvNV (dynamic) */ + /* _mesa_function_pool[7650]: MapParameterfvNV (dynamic) */ "iip\0" "glMapParameterfvNV\0" "\0" - /* _mesa_function_pool[7644]: ClearStencil (offset 207) */ + /* _mesa_function_pool[7674]: ClearStencil (offset 207) */ "i\0" "glClearStencil\0" "\0" - /* _mesa_function_pool[7662]: VertexAttrib3dvARB (will be remapped) */ + /* _mesa_function_pool[7692]: VertexAttrib3dvARB (will be remapped) */ "ip\0" "glVertexAttrib3dv\0" "glVertexAttrib3dvARB\0" "\0" - /* _mesa_function_pool[7705]: HintPGI (dynamic) */ + /* _mesa_function_pool[7735]: HintPGI (dynamic) */ "ii\0" "glHintPGI\0" "\0" - /* _mesa_function_pool[7719]: ConvolutionParameteriv (offset 353) */ + /* _mesa_function_pool[7749]: ConvolutionParameteriv (offset 353) */ "iip\0" "glConvolutionParameteriv\0" "glConvolutionParameterivEXT\0" "\0" - /* _mesa_function_pool[7777]: Color4s (offset 33) */ + /* _mesa_function_pool[7807]: Color4s (offset 33) */ "iiii\0" "glColor4s\0" "\0" - /* _mesa_function_pool[7793]: InterleavedArrays (offset 317) */ + /* _mesa_function_pool[7823]: InterleavedArrays (offset 317) */ "iip\0" "glInterleavedArrays\0" "\0" - /* _mesa_function_pool[7818]: RasterPos2fv (offset 65) */ + /* _mesa_function_pool[7848]: RasterPos2fv (offset 65) */ "p\0" "glRasterPos2fv\0" "\0" - /* _mesa_function_pool[7836]: TexCoord1fv (offset 97) */ + /* _mesa_function_pool[7866]: TexCoord1fv (offset 97) */ "p\0" "glTexCoord1fv\0" "\0" - /* _mesa_function_pool[7853]: Vertex2d (offset 126) */ + /* _mesa_function_pool[7883]: Vertex2d (offset 126) */ "dd\0" "glVertex2d\0" "\0" - /* _mesa_function_pool[7868]: CullParameterdvEXT (will be remapped) */ + /* _mesa_function_pool[7898]: CullParameterdvEXT (will be remapped) */ "ip\0" "glCullParameterdvEXT\0" "\0" - /* _mesa_function_pool[7893]: ProgramNamedParameter4fNV (will be remapped) */ + /* _mesa_function_pool[7923]: ProgramNamedParameter4fNV (will be remapped) */ "iipffff\0" "glProgramNamedParameter4fNV\0" "\0" - /* _mesa_function_pool[7930]: Color3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[7960]: Color3fVertex3fSUN (dynamic) */ "ffffff\0" "glColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[7959]: ProgramEnvParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[7989]: ProgramEnvParameter4fvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4fvARB\0" "glProgramParameter4fvNV\0" "\0" - /* _mesa_function_pool[8016]: Color4i (offset 31) */ + /* _mesa_function_pool[8046]: Color4i (offset 31) */ "iiii\0" "glColor4i\0" "\0" - /* _mesa_function_pool[8032]: Color4f (offset 29) */ + /* _mesa_function_pool[8062]: Color4f (offset 29) */ "ffff\0" "glColor4f\0" "\0" - /* _mesa_function_pool[8048]: RasterPos4fv (offset 81) */ + /* _mesa_function_pool[8078]: RasterPos4fv (offset 81) */ "p\0" "glRasterPos4fv\0" "\0" - /* _mesa_function_pool[8066]: Color4d (offset 27) */ + /* _mesa_function_pool[8096]: Color4d (offset 27) */ "dddd\0" "glColor4d\0" "\0" - /* _mesa_function_pool[8082]: ClearIndex (offset 205) */ + /* _mesa_function_pool[8112]: ClearIndex (offset 205) */ "f\0" "glClearIndex\0" "\0" - /* _mesa_function_pool[8098]: Color4b (offset 25) */ + /* _mesa_function_pool[8128]: Color4b (offset 25) */ "iiii\0" "glColor4b\0" "\0" - /* _mesa_function_pool[8114]: LoadMatrixd (offset 292) */ + /* _mesa_function_pool[8144]: LoadMatrixd (offset 292) */ "p\0" "glLoadMatrixd\0" "\0" - /* _mesa_function_pool[8131]: FragmentLightModeliSGIX (dynamic) */ + /* _mesa_function_pool[8161]: FragmentLightModeliSGIX (dynamic) */ "ii\0" "glFragmentLightModeliSGIX\0" "\0" - /* _mesa_function_pool[8161]: RasterPos2dv (offset 63) */ + /* _mesa_function_pool[8191]: RasterPos2dv (offset 63) */ "p\0" "glRasterPos2dv\0" "\0" - /* _mesa_function_pool[8179]: ConvolutionParameterfv (offset 351) */ + /* _mesa_function_pool[8209]: ConvolutionParameterfv (offset 351) */ "iip\0" "glConvolutionParameterfv\0" "glConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[8237]: TbufferMask3DFX (dynamic) */ + /* _mesa_function_pool[8267]: TbufferMask3DFX (dynamic) */ "i\0" "glTbufferMask3DFX\0" "\0" - /* _mesa_function_pool[8258]: GetTexGendv (offset 278) */ + /* _mesa_function_pool[8288]: GetTexGendv (offset 278) */ "iip\0" "glGetTexGendv\0" "\0" - /* _mesa_function_pool[8277]: ColorMaskIndexedEXT (will be remapped) */ + /* _mesa_function_pool[8307]: ColorMaskIndexedEXT (will be remapped) */ "iiiii\0" "glColorMaskIndexedEXT\0" "\0" - /* _mesa_function_pool[8306]: LoadProgramNV (will be remapped) */ + /* _mesa_function_pool[8336]: LoadProgramNV (will be remapped) */ "iiip\0" "glLoadProgramNV\0" "\0" - /* _mesa_function_pool[8328]: WaitSync (will be remapped) */ + /* _mesa_function_pool[8358]: WaitSync (will be remapped) */ "iii\0" "glWaitSync\0" "\0" - /* _mesa_function_pool[8344]: EndList (offset 1) */ + /* _mesa_function_pool[8374]: EndList (offset 1) */ "\0" "glEndList\0" "\0" - /* _mesa_function_pool[8356]: VertexAttrib4fvNV (will be remapped) */ + /* _mesa_function_pool[8386]: VertexAttrib4fvNV (will be remapped) */ "ip\0" "glVertexAttrib4fvNV\0" "\0" - /* _mesa_function_pool[8380]: GetAttachedObjectsARB (will be remapped) */ + /* _mesa_function_pool[8410]: GetAttachedObjectsARB (will be remapped) */ "iipp\0" "glGetAttachedObjectsARB\0" "\0" - /* _mesa_function_pool[8410]: Uniform3fvARB (will be remapped) */ + /* _mesa_function_pool[8440]: Uniform3fvARB (will be remapped) */ "iip\0" "glUniform3fv\0" "glUniform3fvARB\0" "\0" - /* _mesa_function_pool[8444]: EvalCoord1fv (offset 231) */ + /* _mesa_function_pool[8474]: EvalCoord1fv (offset 231) */ "p\0" "glEvalCoord1fv\0" "\0" - /* _mesa_function_pool[8462]: DrawRangeElements (offset 338) */ + /* _mesa_function_pool[8492]: DrawRangeElements (offset 338) */ "iiiiip\0" "glDrawRangeElements\0" "glDrawRangeElementsEXT\0" "\0" - /* _mesa_function_pool[8513]: EvalMesh2 (offset 238) */ + /* _mesa_function_pool[8543]: EvalMesh2 (offset 238) */ "iiiii\0" "glEvalMesh2\0" "\0" - /* _mesa_function_pool[8532]: Vertex4fv (offset 145) */ + /* _mesa_function_pool[8562]: Vertex4fv (offset 145) */ "p\0" "glVertex4fv\0" "\0" - /* _mesa_function_pool[8547]: SpriteParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[8577]: SpriteParameterfvSGIX (dynamic) */ "ip\0" "glSpriteParameterfvSGIX\0" "\0" - /* _mesa_function_pool[8575]: CheckFramebufferStatusEXT (will be remapped) */ + /* _mesa_function_pool[8605]: CheckFramebufferStatusEXT (will be remapped) */ "i\0" "glCheckFramebufferStatus\0" "glCheckFramebufferStatusEXT\0" "\0" - /* _mesa_function_pool[8631]: GlobalAlphaFactoruiSUN (dynamic) */ + /* _mesa_function_pool[8661]: GlobalAlphaFactoruiSUN (dynamic) */ "i\0" "glGlobalAlphaFactoruiSUN\0" "\0" - /* _mesa_function_pool[8659]: GetHandleARB (will be remapped) */ + /* _mesa_function_pool[8689]: GetHandleARB (will be remapped) */ "i\0" "glGetHandleARB\0" "\0" - /* _mesa_function_pool[8677]: GetVertexAttribivARB (will be remapped) */ + /* _mesa_function_pool[8707]: GetVertexAttribivARB (will be remapped) */ "iip\0" "glGetVertexAttribiv\0" "glGetVertexAttribivARB\0" "\0" - /* _mesa_function_pool[8725]: GetCombinerInputParameterfvNV (will be remapped) */ + /* _mesa_function_pool[8755]: GetCombinerInputParameterfvNV (will be remapped) */ "iiiip\0" "glGetCombinerInputParameterfvNV\0" "\0" - /* _mesa_function_pool[8764]: CreateProgram (will be remapped) */ + /* _mesa_function_pool[8794]: CreateProgram (will be remapped) */ "\0" "glCreateProgram\0" "\0" - /* _mesa_function_pool[8782]: LoadTransposeMatrixdARB (will be remapped) */ + /* _mesa_function_pool[8812]: LoadTransposeMatrixdARB (will be remapped) */ "p\0" "glLoadTransposeMatrixd\0" "glLoadTransposeMatrixdARB\0" "\0" - /* _mesa_function_pool[8834]: GetMinmax (offset 364) */ + /* _mesa_function_pool[8864]: GetMinmax (offset 364) */ "iiiip\0" "glGetMinmax\0" "glGetMinmaxEXT\0" "\0" - /* _mesa_function_pool[8868]: StencilFuncSeparate (will be remapped) */ + /* _mesa_function_pool[8898]: StencilFuncSeparate (will be remapped) */ "iiii\0" "glStencilFuncSeparate\0" "\0" - /* _mesa_function_pool[8896]: SecondaryColor3sEXT (will be remapped) */ + /* _mesa_function_pool[8926]: SecondaryColor3sEXT (will be remapped) */ "iii\0" "glSecondaryColor3s\0" "glSecondaryColor3sEXT\0" "\0" - /* _mesa_function_pool[8942]: Color3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[8972]: Color3fVertex3fvSUN (dynamic) */ "pp\0" "glColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[8968]: Normal3fv (offset 57) */ + /* _mesa_function_pool[8998]: Normal3fv (offset 57) */ "p\0" "glNormal3fv\0" "\0" - /* _mesa_function_pool[8983]: GlobalAlphaFactorbSUN (dynamic) */ + /* _mesa_function_pool[9013]: GlobalAlphaFactorbSUN (dynamic) */ "i\0" "glGlobalAlphaFactorbSUN\0" "\0" - /* _mesa_function_pool[9010]: Color3us (offset 23) */ + /* _mesa_function_pool[9040]: Color3us (offset 23) */ "iii\0" "glColor3us\0" "\0" - /* _mesa_function_pool[9026]: ImageTransformParameterfvHP (dynamic) */ + /* _mesa_function_pool[9056]: ImageTransformParameterfvHP (dynamic) */ "iip\0" "glImageTransformParameterfvHP\0" "\0" - /* _mesa_function_pool[9061]: VertexAttrib4ivARB (will be remapped) */ + /* _mesa_function_pool[9091]: VertexAttrib4ivARB (will be remapped) */ "ip\0" "glVertexAttrib4iv\0" "glVertexAttrib4ivARB\0" "\0" - /* _mesa_function_pool[9104]: End (offset 43) */ + /* _mesa_function_pool[9134]: End (offset 43) */ "\0" "glEnd\0" "\0" - /* _mesa_function_pool[9112]: VertexAttrib3fNV (will be remapped) */ + /* _mesa_function_pool[9142]: VertexAttrib3fNV (will be remapped) */ "ifff\0" "glVertexAttrib3fNV\0" "\0" - /* _mesa_function_pool[9137]: VertexAttribs2dvNV (will be remapped) */ + /* _mesa_function_pool[9167]: VertexAttribs2dvNV (will be remapped) */ "iip\0" "glVertexAttribs2dvNV\0" "\0" - /* _mesa_function_pool[9163]: GetQueryObjectui64vEXT (will be remapped) */ + /* _mesa_function_pool[9193]: GetQueryObjectui64vEXT (will be remapped) */ "iip\0" "glGetQueryObjectui64vEXT\0" "\0" - /* _mesa_function_pool[9193]: MultiTexCoord3fvARB (offset 395) */ + /* _mesa_function_pool[9223]: MultiTexCoord3fvARB (offset 395) */ "ip\0" "glMultiTexCoord3fv\0" "glMultiTexCoord3fvARB\0" "\0" - /* _mesa_function_pool[9238]: SecondaryColor3dEXT (will be remapped) */ + /* _mesa_function_pool[9268]: SecondaryColor3dEXT (will be remapped) */ "ddd\0" "glSecondaryColor3d\0" "glSecondaryColor3dEXT\0" "\0" - /* _mesa_function_pool[9284]: Color3ub (offset 19) */ + /* _mesa_function_pool[9314]: Color3ub (offset 19) */ "iii\0" "glColor3ub\0" "\0" - /* _mesa_function_pool[9300]: GetProgramParameterfvNV (will be remapped) */ + /* _mesa_function_pool[9330]: GetProgramParameterfvNV (will be remapped) */ "iiip\0" "glGetProgramParameterfvNV\0" "\0" - /* _mesa_function_pool[9332]: TangentPointerEXT (dynamic) */ + /* _mesa_function_pool[9362]: TangentPointerEXT (dynamic) */ "iip\0" "glTangentPointerEXT\0" "\0" - /* _mesa_function_pool[9357]: Color4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[9387]: Color4fNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[9392]: GetInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[9422]: GetInstrumentsSGIX (dynamic) */ "\0" "glGetInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[9415]: Color3ui (offset 21) */ + /* _mesa_function_pool[9445]: Color3ui (offset 21) */ "iii\0" "glColor3ui\0" "\0" - /* _mesa_function_pool[9431]: EvalMapsNV (dynamic) */ + /* _mesa_function_pool[9461]: EvalMapsNV (dynamic) */ "ii\0" "glEvalMapsNV\0" "\0" - /* _mesa_function_pool[9448]: TexSubImage2D (offset 333) */ + /* _mesa_function_pool[9478]: TexSubImage2D (offset 333) */ "iiiiiiiip\0" "glTexSubImage2D\0" "glTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[9494]: FragmentLightivSGIX (dynamic) */ + /* _mesa_function_pool[9524]: FragmentLightivSGIX (dynamic) */ "iip\0" "glFragmentLightivSGIX\0" "\0" - /* _mesa_function_pool[9521]: GetTexParameterPointervAPPLE (will be remapped) */ + /* _mesa_function_pool[9551]: GetTexParameterPointervAPPLE (will be remapped) */ "iip\0" "glGetTexParameterPointervAPPLE\0" "\0" - /* _mesa_function_pool[9557]: TexGenfv (offset 191) */ + /* _mesa_function_pool[9587]: TexGenfv (offset 191) */ "iip\0" "glTexGenfv\0" "\0" - /* _mesa_function_pool[9573]: PixelTransformParameterfvEXT (dynamic) */ + /* _mesa_function_pool[9603]: PixelTransformParameterfvEXT (dynamic) */ "iip\0" "glPixelTransformParameterfvEXT\0" "\0" - /* _mesa_function_pool[9609]: VertexAttrib4bvARB (will be remapped) */ + /* _mesa_function_pool[9639]: VertexAttrib4bvARB (will be remapped) */ "ip\0" "glVertexAttrib4bv\0" "glVertexAttrib4bvARB\0" "\0" - /* _mesa_function_pool[9652]: AlphaFragmentOp2ATI (will be remapped) */ + /* _mesa_function_pool[9682]: AlphaFragmentOp2ATI (will be remapped) */ "iiiiiiiii\0" "glAlphaFragmentOp2ATI\0" "\0" - /* _mesa_function_pool[9685]: GetIntegerIndexedvEXT (will be remapped) */ + /* _mesa_function_pool[9715]: GetIntegerIndexedvEXT (will be remapped) */ "iip\0" "glGetIntegerIndexedvEXT\0" "\0" - /* _mesa_function_pool[9714]: MultiTexCoord4sARB (offset 406) */ + /* _mesa_function_pool[9744]: MultiTexCoord4sARB (offset 406) */ "iiiii\0" "glMultiTexCoord4s\0" "glMultiTexCoord4sARB\0" "\0" - /* _mesa_function_pool[9760]: GetFragmentMaterialivSGIX (dynamic) */ + /* _mesa_function_pool[9790]: GetFragmentMaterialivSGIX (dynamic) */ "iip\0" "glGetFragmentMaterialivSGIX\0" "\0" - /* _mesa_function_pool[9793]: WindowPos4dMESA (will be remapped) */ + /* _mesa_function_pool[9823]: WindowPos4dMESA (will be remapped) */ "dddd\0" "glWindowPos4dMESA\0" "\0" - /* _mesa_function_pool[9817]: WeightPointerARB (dynamic) */ + /* _mesa_function_pool[9847]: WeightPointerARB (dynamic) */ "iiip\0" "glWeightPointerARB\0" "\0" - /* _mesa_function_pool[9842]: WindowPos2dMESA (will be remapped) */ + /* _mesa_function_pool[9872]: WindowPos2dMESA (will be remapped) */ "dd\0" "glWindowPos2d\0" "glWindowPos2dARB\0" "glWindowPos2dMESA\0" "\0" - /* _mesa_function_pool[9895]: FramebufferTexture3DEXT (will be remapped) */ + /* _mesa_function_pool[9925]: FramebufferTexture3DEXT (will be remapped) */ "iiiiii\0" "glFramebufferTexture3D\0" "glFramebufferTexture3DEXT\0" "\0" - /* _mesa_function_pool[9952]: BlendEquation (offset 337) */ + /* _mesa_function_pool[9982]: BlendEquation (offset 337) */ "i\0" "glBlendEquation\0" "glBlendEquationEXT\0" "\0" - /* _mesa_function_pool[9990]: VertexAttrib3dNV (will be remapped) */ + /* _mesa_function_pool[10020]: VertexAttrib3dNV (will be remapped) */ "iddd\0" "glVertexAttrib3dNV\0" "\0" - /* _mesa_function_pool[10015]: VertexAttrib3dARB (will be remapped) */ + /* _mesa_function_pool[10045]: VertexAttrib3dARB (will be remapped) */ "iddd\0" "glVertexAttrib3d\0" "glVertexAttrib3dARB\0" "\0" - /* _mesa_function_pool[10058]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[10088]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "ppppp\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[10122]: VertexAttrib4fARB (will be remapped) */ + /* _mesa_function_pool[10152]: VertexAttrib4fARB (will be remapped) */ "iffff\0" "glVertexAttrib4f\0" "glVertexAttrib4fARB\0" "\0" - /* _mesa_function_pool[10166]: GetError (offset 261) */ + /* _mesa_function_pool[10196]: GetError (offset 261) */ "\0" "glGetError\0" "\0" - /* _mesa_function_pool[10179]: IndexFuncEXT (dynamic) */ + /* _mesa_function_pool[10209]: IndexFuncEXT (dynamic) */ "if\0" "glIndexFuncEXT\0" "\0" - /* _mesa_function_pool[10198]: TexCoord3dv (offset 111) */ + /* _mesa_function_pool[10228]: TexCoord3dv (offset 111) */ "p\0" "glTexCoord3dv\0" "\0" - /* _mesa_function_pool[10215]: Indexdv (offset 45) */ + /* _mesa_function_pool[10245]: Indexdv (offset 45) */ "p\0" "glIndexdv\0" "\0" - /* _mesa_function_pool[10228]: FramebufferTexture2DEXT (will be remapped) */ + /* _mesa_function_pool[10258]: FramebufferTexture2DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture2D\0" "glFramebufferTexture2DEXT\0" "\0" - /* _mesa_function_pool[10284]: Normal3s (offset 60) */ + /* _mesa_function_pool[10314]: Normal3s (offset 60) */ "iii\0" "glNormal3s\0" "\0" - /* _mesa_function_pool[10300]: PushName (offset 201) */ + /* _mesa_function_pool[10330]: GetObjectParameterivAPPLE (will be remapped) */ + "iiip\0" + "glGetObjectParameterivAPPLE\0" + "\0" + /* _mesa_function_pool[10364]: PushName (offset 201) */ "i\0" "glPushName\0" "\0" - /* _mesa_function_pool[10314]: MultiTexCoord2dvARB (offset 385) */ + /* _mesa_function_pool[10378]: MultiTexCoord2dvARB (offset 385) */ "ip\0" "glMultiTexCoord2dv\0" "glMultiTexCoord2dvARB\0" "\0" - /* _mesa_function_pool[10359]: CullParameterfvEXT (will be remapped) */ + /* _mesa_function_pool[10423]: CullParameterfvEXT (will be remapped) */ "ip\0" "glCullParameterfvEXT\0" "\0" - /* _mesa_function_pool[10384]: Normal3i (offset 58) */ + /* _mesa_function_pool[10448]: Normal3i (offset 58) */ "iii\0" "glNormal3i\0" "\0" - /* _mesa_function_pool[10400]: ProgramNamedParameter4fvNV (will be remapped) */ + /* _mesa_function_pool[10464]: ProgramNamedParameter4fvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4fvNV\0" "\0" - /* _mesa_function_pool[10435]: SecondaryColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[10499]: SecondaryColorPointerEXT (will be remapped) */ "iiip\0" "glSecondaryColorPointer\0" "glSecondaryColorPointerEXT\0" "\0" - /* _mesa_function_pool[10492]: VertexAttrib4fvARB (will be remapped) */ + /* _mesa_function_pool[10556]: VertexAttrib4fvARB (will be remapped) */ "ip\0" "glVertexAttrib4fv\0" "glVertexAttrib4fvARB\0" "\0" - /* _mesa_function_pool[10535]: ColorPointerListIBM (dynamic) */ + /* _mesa_function_pool[10599]: ColorPointerListIBM (dynamic) */ "iiipi\0" "glColorPointerListIBM\0" "\0" - /* _mesa_function_pool[10564]: GetActiveUniformARB (will be remapped) */ + /* _mesa_function_pool[10628]: GetActiveUniformARB (will be remapped) */ "iiipppp\0" "glGetActiveUniform\0" "glGetActiveUniformARB\0" "\0" - /* _mesa_function_pool[10614]: ImageTransformParameteriHP (dynamic) */ + /* _mesa_function_pool[10678]: ImageTransformParameteriHP (dynamic) */ "iii\0" "glImageTransformParameteriHP\0" "\0" - /* _mesa_function_pool[10648]: Normal3b (offset 52) */ + /* _mesa_function_pool[10712]: Normal3b (offset 52) */ "iii\0" "glNormal3b\0" "\0" - /* _mesa_function_pool[10664]: Normal3d (offset 54) */ + /* _mesa_function_pool[10728]: Normal3d (offset 54) */ "ddd\0" "glNormal3d\0" "\0" - /* _mesa_function_pool[10680]: Normal3f (offset 56) */ + /* _mesa_function_pool[10744]: Normal3f (offset 56) */ "fff\0" "glNormal3f\0" "\0" - /* _mesa_function_pool[10696]: MultiTexCoord1svARB (offset 383) */ + /* _mesa_function_pool[10760]: MultiTexCoord1svARB (offset 383) */ "ip\0" "glMultiTexCoord1sv\0" "glMultiTexCoord1svARB\0" "\0" - /* _mesa_function_pool[10741]: Indexi (offset 48) */ + /* _mesa_function_pool[10805]: Indexi (offset 48) */ "i\0" "glIndexi\0" "\0" - /* _mesa_function_pool[10753]: EGLImageTargetTexture2DOES (will be remapped) */ + /* _mesa_function_pool[10817]: EGLImageTargetTexture2DOES (will be remapped) */ "ip\0" "glEGLImageTargetTexture2DOES\0" "\0" - /* _mesa_function_pool[10786]: EndQueryARB (will be remapped) */ + /* _mesa_function_pool[10850]: EndQueryARB (will be remapped) */ "i\0" "glEndQuery\0" "glEndQueryARB\0" "\0" - /* _mesa_function_pool[10814]: DeleteFencesNV (will be remapped) */ + /* _mesa_function_pool[10878]: DeleteFencesNV (will be remapped) */ "ip\0" "glDeleteFencesNV\0" "\0" - /* _mesa_function_pool[10835]: DeformationMap3dSGIX (dynamic) */ - "iddiiddiiddiip\0" - "glDeformationMap3dSGIX\0" - "\0" - /* _mesa_function_pool[10874]: DepthMask (offset 211) */ + /* _mesa_function_pool[10899]: DepthMask (offset 211) */ "i\0" "glDepthMask\0" "\0" - /* _mesa_function_pool[10889]: IsShader (will be remapped) */ + /* _mesa_function_pool[10914]: IsShader (will be remapped) */ "i\0" "glIsShader\0" "\0" - /* _mesa_function_pool[10903]: Indexf (offset 46) */ + /* _mesa_function_pool[10928]: Indexf (offset 46) */ "f\0" "glIndexf\0" "\0" - /* _mesa_function_pool[10915]: GetImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[10940]: GetImageTransformParameterivHP (dynamic) */ "iip\0" "glGetImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[10953]: Indexd (offset 44) */ + /* _mesa_function_pool[10978]: Indexd (offset 44) */ "d\0" "glIndexd\0" "\0" - /* _mesa_function_pool[10965]: GetMaterialiv (offset 270) */ + /* _mesa_function_pool[10990]: GetMaterialiv (offset 270) */ "iip\0" "glGetMaterialiv\0" "\0" - /* _mesa_function_pool[10986]: StencilOp (offset 244) */ + /* _mesa_function_pool[11011]: StencilOp (offset 244) */ "iii\0" "glStencilOp\0" "\0" - /* _mesa_function_pool[11003]: WindowPos4ivMESA (will be remapped) */ + /* _mesa_function_pool[11028]: WindowPos4ivMESA (will be remapped) */ "p\0" "glWindowPos4ivMESA\0" "\0" - /* _mesa_function_pool[11025]: MultiTexCoord3svARB (offset 399) */ + /* _mesa_function_pool[11050]: MultiTexCoord3svARB (offset 399) */ "ip\0" "glMultiTexCoord3sv\0" "glMultiTexCoord3svARB\0" "\0" - /* _mesa_function_pool[11070]: TexEnvfv (offset 185) */ + /* _mesa_function_pool[11095]: TexEnvfv (offset 185) */ "iip\0" "glTexEnvfv\0" "\0" - /* _mesa_function_pool[11086]: MultiTexCoord4iARB (offset 404) */ + /* _mesa_function_pool[11111]: MultiTexCoord4iARB (offset 404) */ "iiiii\0" "glMultiTexCoord4i\0" "glMultiTexCoord4iARB\0" "\0" - /* _mesa_function_pool[11132]: Indexs (offset 50) */ + /* _mesa_function_pool[11157]: Indexs (offset 50) */ "i\0" "glIndexs\0" "\0" - /* _mesa_function_pool[11144]: Binormal3ivEXT (dynamic) */ + /* _mesa_function_pool[11169]: Binormal3ivEXT (dynamic) */ "p\0" "glBinormal3ivEXT\0" "\0" - /* _mesa_function_pool[11164]: ResizeBuffersMESA (will be remapped) */ + /* _mesa_function_pool[11189]: ResizeBuffersMESA (will be remapped) */ "\0" "glResizeBuffersMESA\0" "\0" - /* _mesa_function_pool[11186]: GetUniformivARB (will be remapped) */ + /* _mesa_function_pool[11211]: GetUniformivARB (will be remapped) */ "iip\0" "glGetUniformiv\0" "glGetUniformivARB\0" "\0" - /* _mesa_function_pool[11224]: PixelTexGenParameteriSGIS (will be remapped) */ + /* _mesa_function_pool[11249]: PixelTexGenParameteriSGIS (will be remapped) */ "ii\0" "glPixelTexGenParameteriSGIS\0" "\0" - /* _mesa_function_pool[11256]: VertexPointervINTEL (dynamic) */ + /* _mesa_function_pool[11281]: VertexPointervINTEL (dynamic) */ "iip\0" "glVertexPointervINTEL\0" "\0" - /* _mesa_function_pool[11283]: Vertex2i (offset 130) */ + /* _mesa_function_pool[11308]: Vertex2i (offset 130) */ "ii\0" "glVertex2i\0" "\0" - /* _mesa_function_pool[11298]: LoadMatrixf (offset 291) */ + /* _mesa_function_pool[11323]: LoadMatrixf (offset 291) */ "p\0" "glLoadMatrixf\0" "\0" - /* _mesa_function_pool[11315]: Vertex2f (offset 128) */ + /* _mesa_function_pool[11340]: Vertex2f (offset 128) */ "ff\0" "glVertex2f\0" "\0" - /* _mesa_function_pool[11330]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[11355]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[11383]: Color4bv (offset 26) */ + /* _mesa_function_pool[11408]: Color4bv (offset 26) */ "p\0" "glColor4bv\0" "\0" - /* _mesa_function_pool[11397]: VertexPointer (offset 321) */ + /* _mesa_function_pool[11422]: VertexPointer (offset 321) */ "iiip\0" "glVertexPointer\0" "\0" - /* _mesa_function_pool[11419]: SecondaryColor3uiEXT (will be remapped) */ + /* _mesa_function_pool[11444]: SecondaryColor3uiEXT (will be remapped) */ "iii\0" "glSecondaryColor3ui\0" "glSecondaryColor3uiEXT\0" "\0" - /* _mesa_function_pool[11467]: StartInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[11492]: StartInstrumentsSGIX (dynamic) */ "\0" "glStartInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[11492]: SecondaryColor3usvEXT (will be remapped) */ + /* _mesa_function_pool[11517]: SecondaryColor3usvEXT (will be remapped) */ "p\0" "glSecondaryColor3usv\0" "glSecondaryColor3usvEXT\0" "\0" - /* _mesa_function_pool[11540]: VertexAttrib2fvNV (will be remapped) */ + /* _mesa_function_pool[11565]: VertexAttrib2fvNV (will be remapped) */ "ip\0" "glVertexAttrib2fvNV\0" "\0" - /* _mesa_function_pool[11564]: ProgramLocalParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[11589]: ProgramLocalParameter4dvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4dvARB\0" "\0" - /* _mesa_function_pool[11599]: DeleteLists (offset 4) */ + /* _mesa_function_pool[11624]: DeleteLists (offset 4) */ "ii\0" "glDeleteLists\0" "\0" - /* _mesa_function_pool[11617]: LogicOp (offset 242) */ + /* _mesa_function_pool[11642]: LogicOp (offset 242) */ "i\0" "glLogicOp\0" "\0" - /* _mesa_function_pool[11630]: MatrixIndexuivARB (dynamic) */ + /* _mesa_function_pool[11655]: MatrixIndexuivARB (dynamic) */ "ip\0" "glMatrixIndexuivARB\0" "\0" - /* _mesa_function_pool[11654]: Vertex2s (offset 132) */ + /* _mesa_function_pool[11679]: Vertex2s (offset 132) */ "ii\0" "glVertex2s\0" "\0" - /* _mesa_function_pool[11669]: RenderbufferStorageMultisample (will be remapped) */ + /* _mesa_function_pool[11694]: RenderbufferStorageMultisample (will be remapped) */ "iiiii\0" "glRenderbufferStorageMultisample\0" "glRenderbufferStorageMultisampleEXT\0" "\0" - /* _mesa_function_pool[11745]: TexCoord4fv (offset 121) */ + /* _mesa_function_pool[11770]: TexCoord4fv (offset 121) */ "p\0" "glTexCoord4fv\0" "\0" - /* _mesa_function_pool[11762]: Tangent3sEXT (dynamic) */ + /* _mesa_function_pool[11787]: Tangent3sEXT (dynamic) */ "iii\0" "glTangent3sEXT\0" "\0" - /* _mesa_function_pool[11782]: GlobalAlphaFactorfSUN (dynamic) */ + /* _mesa_function_pool[11807]: GlobalAlphaFactorfSUN (dynamic) */ "f\0" "glGlobalAlphaFactorfSUN\0" "\0" - /* _mesa_function_pool[11809]: MultiTexCoord3iARB (offset 396) */ + /* _mesa_function_pool[11834]: MultiTexCoord3iARB (offset 396) */ "iiii\0" "glMultiTexCoord3i\0" "glMultiTexCoord3iARB\0" "\0" - /* _mesa_function_pool[11854]: IsProgram (will be remapped) */ + /* _mesa_function_pool[11879]: IsProgram (will be remapped) */ "i\0" "glIsProgram\0" "\0" - /* _mesa_function_pool[11869]: TexCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[11894]: TexCoordPointerListIBM (dynamic) */ "iiipi\0" "glTexCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[11901]: GlobalAlphaFactorusSUN (dynamic) */ + /* _mesa_function_pool[11926]: GlobalAlphaFactorusSUN (dynamic) */ "i\0" "glGlobalAlphaFactorusSUN\0" "\0" - /* _mesa_function_pool[11929]: VertexAttrib2dvNV (will be remapped) */ + /* _mesa_function_pool[11954]: VertexAttrib2dvNV (will be remapped) */ "ip\0" "glVertexAttrib2dvNV\0" "\0" - /* _mesa_function_pool[11953]: FramebufferRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[11978]: FramebufferRenderbufferEXT (will be remapped) */ "iiii\0" "glFramebufferRenderbuffer\0" "glFramebufferRenderbufferEXT\0" "\0" - /* _mesa_function_pool[12014]: VertexAttrib1dvNV (will be remapped) */ + /* _mesa_function_pool[12039]: VertexAttrib1dvNV (will be remapped) */ "ip\0" "glVertexAttrib1dvNV\0" "\0" - /* _mesa_function_pool[12038]: GenTextures (offset 328) */ + /* _mesa_function_pool[12063]: GenTextures (offset 328) */ "ip\0" "glGenTextures\0" "glGenTexturesEXT\0" "\0" - /* _mesa_function_pool[12073]: SetFenceNV (will be remapped) */ + /* _mesa_function_pool[12098]: SetFenceNV (will be remapped) */ "ii\0" "glSetFenceNV\0" "\0" - /* _mesa_function_pool[12090]: FramebufferTexture1DEXT (will be remapped) */ + /* _mesa_function_pool[12115]: FramebufferTexture1DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture1D\0" "glFramebufferTexture1DEXT\0" "\0" - /* _mesa_function_pool[12146]: GetCombinerOutputParameterivNV (will be remapped) */ + /* _mesa_function_pool[12171]: GetCombinerOutputParameterivNV (will be remapped) */ "iiip\0" "glGetCombinerOutputParameterivNV\0" "\0" - /* _mesa_function_pool[12185]: PixelTexGenParameterivSGIS (will be remapped) */ + /* _mesa_function_pool[12210]: MultiModeDrawArraysIBM (will be remapped) */ + "pppii\0" + "glMultiModeDrawArraysIBM\0" + "\0" + /* _mesa_function_pool[12242]: PixelTexGenParameterivSGIS (will be remapped) */ "ip\0" "glPixelTexGenParameterivSGIS\0" "\0" - /* _mesa_function_pool[12218]: TextureNormalEXT (dynamic) */ + /* _mesa_function_pool[12275]: TextureNormalEXT (dynamic) */ "i\0" "glTextureNormalEXT\0" "\0" - /* _mesa_function_pool[12240]: IndexPointerListIBM (dynamic) */ + /* _mesa_function_pool[12297]: IndexPointerListIBM (dynamic) */ "iipi\0" "glIndexPointerListIBM\0" "\0" - /* _mesa_function_pool[12268]: WeightfvARB (dynamic) */ + /* _mesa_function_pool[12325]: WeightfvARB (dynamic) */ "ip\0" "glWeightfvARB\0" "\0" - /* _mesa_function_pool[12286]: RasterPos2sv (offset 69) */ + /* _mesa_function_pool[12343]: RasterPos2sv (offset 69) */ "p\0" "glRasterPos2sv\0" "\0" - /* _mesa_function_pool[12304]: Color4ubv (offset 36) */ + /* _mesa_function_pool[12361]: Color4ubv (offset 36) */ "p\0" "glColor4ubv\0" "\0" - /* _mesa_function_pool[12319]: DrawBuffer (offset 202) */ + /* _mesa_function_pool[12376]: DrawBuffer (offset 202) */ "i\0" "glDrawBuffer\0" "\0" - /* _mesa_function_pool[12335]: TexCoord2fv (offset 105) */ + /* _mesa_function_pool[12392]: TexCoord2fv (offset 105) */ "p\0" "glTexCoord2fv\0" "\0" - /* _mesa_function_pool[12352]: WindowPos4fMESA (will be remapped) */ + /* _mesa_function_pool[12409]: WindowPos4fMESA (will be remapped) */ "ffff\0" "glWindowPos4fMESA\0" "\0" - /* _mesa_function_pool[12376]: TexCoord1sv (offset 101) */ + /* _mesa_function_pool[12433]: TexCoord1sv (offset 101) */ "p\0" "glTexCoord1sv\0" "\0" - /* _mesa_function_pool[12393]: WindowPos3dvMESA (will be remapped) */ + /* _mesa_function_pool[12450]: WindowPos3dvMESA (will be remapped) */ "p\0" "glWindowPos3dv\0" "glWindowPos3dvARB\0" "glWindowPos3dvMESA\0" "\0" - /* _mesa_function_pool[12448]: DepthFunc (offset 245) */ + /* _mesa_function_pool[12505]: DepthFunc (offset 245) */ "i\0" "glDepthFunc\0" "\0" - /* _mesa_function_pool[12463]: PixelMapusv (offset 253) */ + /* _mesa_function_pool[12520]: PixelMapusv (offset 253) */ "iip\0" "glPixelMapusv\0" "\0" - /* _mesa_function_pool[12482]: GetQueryObjecti64vEXT (will be remapped) */ + /* _mesa_function_pool[12539]: GetQueryObjecti64vEXT (will be remapped) */ "iip\0" "glGetQueryObjecti64vEXT\0" "\0" - /* _mesa_function_pool[12511]: MultiTexCoord1dARB (offset 376) */ + /* _mesa_function_pool[12568]: MultiTexCoord1dARB (offset 376) */ "id\0" "glMultiTexCoord1d\0" "glMultiTexCoord1dARB\0" "\0" - /* _mesa_function_pool[12554]: PointParameterivNV (will be remapped) */ + /* _mesa_function_pool[12611]: PointParameterivNV (will be remapped) */ "ip\0" "glPointParameteriv\0" "glPointParameterivNV\0" "\0" - /* _mesa_function_pool[12598]: BlendFunc (offset 241) */ + /* _mesa_function_pool[12655]: BlendFunc (offset 241) */ "ii\0" "glBlendFunc\0" "\0" - /* _mesa_function_pool[12614]: Uniform2fvARB (will be remapped) */ + /* _mesa_function_pool[12671]: Uniform2fvARB (will be remapped) */ "iip\0" "glUniform2fv\0" "glUniform2fvARB\0" "\0" - /* _mesa_function_pool[12648]: BufferParameteriAPPLE (will be remapped) */ + /* _mesa_function_pool[12705]: BufferParameteriAPPLE (will be remapped) */ "iii\0" "glBufferParameteriAPPLE\0" "\0" - /* _mesa_function_pool[12677]: MultiTexCoord3dvARB (offset 393) */ + /* _mesa_function_pool[12734]: MultiTexCoord3dvARB (offset 393) */ "ip\0" "glMultiTexCoord3dv\0" "glMultiTexCoord3dvARB\0" "\0" - /* _mesa_function_pool[12722]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[12779]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[12778]: DeleteObjectARB (will be remapped) */ + /* _mesa_function_pool[12835]: DeleteObjectARB (will be remapped) */ "i\0" "glDeleteObjectARB\0" "\0" - /* _mesa_function_pool[12799]: MatrixIndexPointerARB (dynamic) */ + /* _mesa_function_pool[12856]: MatrixIndexPointerARB (dynamic) */ "iiip\0" "glMatrixIndexPointerARB\0" "\0" - /* _mesa_function_pool[12829]: ProgramNamedParameter4dvNV (will be remapped) */ + /* _mesa_function_pool[12886]: ProgramNamedParameter4dvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4dvNV\0" "\0" - /* _mesa_function_pool[12864]: Tangent3fvEXT (dynamic) */ + /* _mesa_function_pool[12921]: Tangent3fvEXT (dynamic) */ "p\0" "glTangent3fvEXT\0" "\0" - /* _mesa_function_pool[12883]: Flush (offset 217) */ + /* _mesa_function_pool[12940]: Flush (offset 217) */ "\0" "glFlush\0" "\0" - /* _mesa_function_pool[12893]: Color4uiv (offset 38) */ + /* _mesa_function_pool[12950]: Color4uiv (offset 38) */ "p\0" "glColor4uiv\0" "\0" - /* _mesa_function_pool[12908]: GenVertexArrays (will be remapped) */ + /* _mesa_function_pool[12965]: GenVertexArrays (will be remapped) */ "ip\0" "glGenVertexArrays\0" "\0" - /* _mesa_function_pool[12930]: RasterPos3sv (offset 77) */ + /* _mesa_function_pool[12987]: RasterPos3sv (offset 77) */ "p\0" "glRasterPos3sv\0" "\0" - /* _mesa_function_pool[12948]: BindFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[13005]: BindFramebufferEXT (will be remapped) */ "ii\0" "glBindFramebuffer\0" "glBindFramebufferEXT\0" "\0" - /* _mesa_function_pool[12991]: ReferencePlaneSGIX (dynamic) */ + /* _mesa_function_pool[13048]: ReferencePlaneSGIX (dynamic) */ "p\0" "glReferencePlaneSGIX\0" "\0" - /* _mesa_function_pool[13015]: PushAttrib (offset 219) */ + /* _mesa_function_pool[13072]: PushAttrib (offset 219) */ "i\0" "glPushAttrib\0" "\0" - /* _mesa_function_pool[13031]: RasterPos2i (offset 66) */ + /* _mesa_function_pool[13088]: RasterPos2i (offset 66) */ "ii\0" "glRasterPos2i\0" "\0" - /* _mesa_function_pool[13049]: ValidateProgramARB (will be remapped) */ + /* _mesa_function_pool[13106]: ValidateProgramARB (will be remapped) */ "i\0" "glValidateProgram\0" "glValidateProgramARB\0" "\0" - /* _mesa_function_pool[13091]: TexParameteriv (offset 181) */ + /* _mesa_function_pool[13148]: TexParameteriv (offset 181) */ "iip\0" "glTexParameteriv\0" "\0" - /* _mesa_function_pool[13113]: UnlockArraysEXT (will be remapped) */ + /* _mesa_function_pool[13170]: UnlockArraysEXT (will be remapped) */ "\0" "glUnlockArraysEXT\0" "\0" - /* _mesa_function_pool[13133]: TexCoord2fColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[13190]: TexCoord2fColor3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[13174]: WindowPos3fvMESA (will be remapped) */ + /* _mesa_function_pool[13231]: WindowPos3fvMESA (will be remapped) */ "p\0" "glWindowPos3fv\0" "glWindowPos3fvARB\0" "glWindowPos3fvMESA\0" "\0" - /* _mesa_function_pool[13229]: RasterPos2f (offset 64) */ + /* _mesa_function_pool[13286]: RasterPos2f (offset 64) */ "ff\0" "glRasterPos2f\0" "\0" - /* _mesa_function_pool[13247]: VertexAttrib1svNV (will be remapped) */ + /* _mesa_function_pool[13304]: VertexAttrib1svNV (will be remapped) */ "ip\0" "glVertexAttrib1svNV\0" "\0" - /* _mesa_function_pool[13271]: RasterPos2d (offset 62) */ + /* _mesa_function_pool[13328]: RasterPos2d (offset 62) */ "dd\0" "glRasterPos2d\0" "\0" - /* _mesa_function_pool[13289]: RasterPos3fv (offset 73) */ + /* _mesa_function_pool[13346]: RasterPos3fv (offset 73) */ "p\0" "glRasterPos3fv\0" "\0" - /* _mesa_function_pool[13307]: CopyTexSubImage3D (offset 373) */ + /* _mesa_function_pool[13364]: CopyTexSubImage3D (offset 373) */ "iiiiiiiii\0" "glCopyTexSubImage3D\0" "glCopyTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[13361]: VertexAttrib2dARB (will be remapped) */ + /* _mesa_function_pool[13418]: VertexAttrib2dARB (will be remapped) */ "idd\0" "glVertexAttrib2d\0" "glVertexAttrib2dARB\0" "\0" - /* _mesa_function_pool[13403]: Color4ub (offset 35) */ + /* _mesa_function_pool[13460]: Color4ub (offset 35) */ "iiii\0" "glColor4ub\0" "\0" - /* _mesa_function_pool[13420]: GetInteger64v (will be remapped) */ + /* _mesa_function_pool[13477]: GetInteger64v (will be remapped) */ "ip\0" "glGetInteger64v\0" "\0" - /* _mesa_function_pool[13440]: TextureColorMaskSGIS (dynamic) */ + /* _mesa_function_pool[13497]: TextureColorMaskSGIS (dynamic) */ "iiii\0" "glTextureColorMaskSGIS\0" "\0" - /* _mesa_function_pool[13469]: RasterPos2s (offset 68) */ + /* _mesa_function_pool[13526]: RasterPos2s (offset 68) */ "ii\0" "glRasterPos2s\0" "\0" - /* _mesa_function_pool[13487]: GetColorTable (offset 343) */ + /* _mesa_function_pool[13544]: GetColorTable (offset 343) */ "iiip\0" "glGetColorTable\0" "glGetColorTableSGI\0" "glGetColorTableEXT\0" "\0" - /* _mesa_function_pool[13547]: SelectBuffer (offset 195) */ + /* _mesa_function_pool[13604]: SelectBuffer (offset 195) */ "ip\0" "glSelectBuffer\0" "\0" - /* _mesa_function_pool[13566]: Indexiv (offset 49) */ + /* _mesa_function_pool[13623]: Indexiv (offset 49) */ "p\0" "glIndexiv\0" "\0" - /* _mesa_function_pool[13579]: TexCoord3i (offset 114) */ + /* _mesa_function_pool[13636]: TexCoord3i (offset 114) */ "iii\0" "glTexCoord3i\0" "\0" - /* _mesa_function_pool[13597]: CopyColorTable (offset 342) */ + /* _mesa_function_pool[13654]: CopyColorTable (offset 342) */ "iiiii\0" "glCopyColorTable\0" "glCopyColorTableSGI\0" "\0" - /* _mesa_function_pool[13641]: GetHistogramParameterfv (offset 362) */ + /* _mesa_function_pool[13698]: GetHistogramParameterfv (offset 362) */ "iip\0" "glGetHistogramParameterfv\0" "glGetHistogramParameterfvEXT\0" "\0" - /* _mesa_function_pool[13701]: Frustum (offset 289) */ + /* _mesa_function_pool[13758]: Frustum (offset 289) */ "dddddd\0" "glFrustum\0" "\0" - /* _mesa_function_pool[13719]: GetString (offset 275) */ + /* _mesa_function_pool[13776]: GetString (offset 275) */ "i\0" "glGetString\0" "\0" - /* _mesa_function_pool[13734]: ColorPointervINTEL (dynamic) */ + /* _mesa_function_pool[13791]: ColorPointervINTEL (dynamic) */ "iip\0" "glColorPointervINTEL\0" "\0" - /* _mesa_function_pool[13760]: TexEnvf (offset 184) */ + /* _mesa_function_pool[13817]: TexEnvf (offset 184) */ "iif\0" "glTexEnvf\0" "\0" - /* _mesa_function_pool[13775]: TexCoord3d (offset 110) */ + /* _mesa_function_pool[13832]: TexCoord3d (offset 110) */ "ddd\0" "glTexCoord3d\0" "\0" - /* _mesa_function_pool[13793]: AlphaFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[13850]: AlphaFragmentOp1ATI (will be remapped) */ "iiiiii\0" "glAlphaFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[13823]: TexCoord3f (offset 112) */ + /* _mesa_function_pool[13880]: TexCoord3f (offset 112) */ "fff\0" "glTexCoord3f\0" "\0" - /* _mesa_function_pool[13841]: MultiTexCoord3ivARB (offset 397) */ + /* _mesa_function_pool[13898]: MultiTexCoord3ivARB (offset 397) */ "ip\0" "glMultiTexCoord3iv\0" "glMultiTexCoord3ivARB\0" "\0" - /* _mesa_function_pool[13886]: MultiTexCoord2sARB (offset 390) */ + /* _mesa_function_pool[13943]: MultiTexCoord2sARB (offset 390) */ "iii\0" "glMultiTexCoord2s\0" "glMultiTexCoord2sARB\0" "\0" - /* _mesa_function_pool[13930]: VertexAttrib1dvARB (will be remapped) */ + /* _mesa_function_pool[13987]: VertexAttrib1dvARB (will be remapped) */ "ip\0" "glVertexAttrib1dv\0" "glVertexAttrib1dvARB\0" "\0" - /* _mesa_function_pool[13973]: DeleteTextures (offset 327) */ + /* _mesa_function_pool[14030]: DeleteTextures (offset 327) */ "ip\0" "glDeleteTextures\0" "glDeleteTexturesEXT\0" "\0" - /* _mesa_function_pool[14014]: TexCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[14071]: TexCoordPointerEXT (will be remapped) */ "iiiip\0" "glTexCoordPointerEXT\0" "\0" - /* _mesa_function_pool[14042]: TexSubImage4DSGIS (dynamic) */ + /* _mesa_function_pool[14099]: TexSubImage4DSGIS (dynamic) */ "iiiiiiiiiiiip\0" "glTexSubImage4DSGIS\0" "\0" - /* _mesa_function_pool[14077]: TexCoord3s (offset 116) */ + /* _mesa_function_pool[14134]: TexCoord3s (offset 116) */ "iii\0" "glTexCoord3s\0" "\0" - /* _mesa_function_pool[14095]: GetTexLevelParameteriv (offset 285) */ + /* _mesa_function_pool[14152]: GetTexLevelParameteriv (offset 285) */ "iiip\0" "glGetTexLevelParameteriv\0" "\0" - /* _mesa_function_pool[14126]: CombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[14183]: CombinerStageParameterfvNV (dynamic) */ "iip\0" "glCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[14160]: StopInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[14217]: StopInstrumentsSGIX (dynamic) */ "i\0" "glStopInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[14185]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[14242]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ "fffffffffffffff\0" "glTexCoord4fColor4fNormal3fVertex4fSUN\0" "\0" - /* _mesa_function_pool[14241]: ClearAccum (offset 204) */ + /* _mesa_function_pool[14298]: ClearAccum (offset 204) */ "ffff\0" "glClearAccum\0" "\0" - /* _mesa_function_pool[14260]: DeformSGIX (dynamic) */ + /* _mesa_function_pool[14317]: DeformSGIX (dynamic) */ "i\0" "glDeformSGIX\0" "\0" - /* _mesa_function_pool[14276]: GetVertexAttribfvARB (will be remapped) */ + /* _mesa_function_pool[14333]: GetVertexAttribfvARB (will be remapped) */ "iip\0" "glGetVertexAttribfv\0" "glGetVertexAttribfvARB\0" "\0" - /* _mesa_function_pool[14324]: SecondaryColor3ivEXT (will be remapped) */ + /* _mesa_function_pool[14381]: SecondaryColor3ivEXT (will be remapped) */ "p\0" "glSecondaryColor3iv\0" "glSecondaryColor3ivEXT\0" "\0" - /* _mesa_function_pool[14370]: TexCoord4iv (offset 123) */ + /* _mesa_function_pool[14427]: TexCoord4iv (offset 123) */ "p\0" "glTexCoord4iv\0" "\0" - /* _mesa_function_pool[14387]: UniformMatrix4x2fv (will be remapped) */ + /* _mesa_function_pool[14444]: UniformMatrix4x2fv (will be remapped) */ "iiip\0" "glUniformMatrix4x2fv\0" "\0" - /* _mesa_function_pool[14414]: GetDetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[14471]: GetDetailTexFuncSGIS (dynamic) */ "ip\0" "glGetDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[14441]: GetCombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[14498]: GetCombinerStageParameterfvNV (dynamic) */ "iip\0" "glGetCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[14478]: PolygonOffset (offset 319) */ + /* _mesa_function_pool[14535]: PolygonOffset (offset 319) */ "ff\0" "glPolygonOffset\0" "\0" - /* _mesa_function_pool[14498]: BindVertexArray (will be remapped) */ + /* _mesa_function_pool[14555]: BindVertexArray (will be remapped) */ "i\0" "glBindVertexArray\0" "\0" - /* _mesa_function_pool[14519]: Color4ubVertex2fvSUN (dynamic) */ + /* _mesa_function_pool[14576]: Color4ubVertex2fvSUN (dynamic) */ "pp\0" "glColor4ubVertex2fvSUN\0" "\0" - /* _mesa_function_pool[14546]: Rectd (offset 86) */ + /* _mesa_function_pool[14603]: Rectd (offset 86) */ "dddd\0" "glRectd\0" "\0" - /* _mesa_function_pool[14560]: TexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[14617]: TexFilterFuncSGIS (dynamic) */ "iiip\0" "glTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[14586]: SampleMaskSGIS (will be remapped) */ + /* _mesa_function_pool[14643]: SampleMaskSGIS (will be remapped) */ "fi\0" "glSampleMaskSGIS\0" "glSampleMaskEXT\0" "\0" - /* _mesa_function_pool[14623]: GetAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[14680]: GetAttribLocationARB (will be remapped) */ "ip\0" "glGetAttribLocation\0" "glGetAttribLocationARB\0" "\0" - /* _mesa_function_pool[14670]: RasterPos3i (offset 74) */ + /* _mesa_function_pool[14727]: RasterPos3i (offset 74) */ "iii\0" "glRasterPos3i\0" "\0" - /* _mesa_function_pool[14689]: VertexAttrib4ubvARB (will be remapped) */ + /* _mesa_function_pool[14746]: VertexAttrib4ubvARB (will be remapped) */ "ip\0" "glVertexAttrib4ubv\0" "glVertexAttrib4ubvARB\0" "\0" - /* _mesa_function_pool[14734]: DetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[14791]: DetailTexFuncSGIS (dynamic) */ "iip\0" "glDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[14759]: Normal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[14816]: Normal3fVertex3fSUN (dynamic) */ "ffffff\0" "glNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[14789]: CopyTexImage2D (offset 324) */ + /* _mesa_function_pool[14846]: CopyTexImage2D (offset 324) */ "iiiiiiii\0" "glCopyTexImage2D\0" "glCopyTexImage2DEXT\0" "\0" - /* _mesa_function_pool[14836]: GetBufferPointervARB (will be remapped) */ + /* _mesa_function_pool[14893]: GetBufferPointervARB (will be remapped) */ "iip\0" "glGetBufferPointerv\0" "glGetBufferPointervARB\0" "\0" - /* _mesa_function_pool[14884]: ProgramEnvParameter4fARB (will be remapped) */ + /* _mesa_function_pool[14941]: ProgramEnvParameter4fARB (will be remapped) */ "iiffff\0" "glProgramEnvParameter4fARB\0" "glProgramParameter4fNV\0" "\0" - /* _mesa_function_pool[14942]: Uniform3ivARB (will be remapped) */ + /* _mesa_function_pool[14999]: Uniform3ivARB (will be remapped) */ "iip\0" "glUniform3iv\0" "glUniform3ivARB\0" "\0" - /* _mesa_function_pool[14976]: Lightfv (offset 160) */ + /* _mesa_function_pool[15033]: Lightfv (offset 160) */ "iip\0" "glLightfv\0" "\0" - /* _mesa_function_pool[14991]: ClearDepth (offset 208) */ + /* _mesa_function_pool[15048]: ClearDepth (offset 208) */ "d\0" "glClearDepth\0" "\0" - /* _mesa_function_pool[15007]: GetFenceivNV (will be remapped) */ + /* _mesa_function_pool[15064]: GetFenceivNV (will be remapped) */ "iip\0" "glGetFenceivNV\0" "\0" - /* _mesa_function_pool[15027]: WindowPos4dvMESA (will be remapped) */ + /* _mesa_function_pool[15084]: WindowPos4dvMESA (will be remapped) */ "p\0" "glWindowPos4dvMESA\0" "\0" - /* _mesa_function_pool[15049]: ColorSubTable (offset 346) */ + /* _mesa_function_pool[15106]: ColorSubTable (offset 346) */ "iiiiip\0" "glColorSubTable\0" "glColorSubTableEXT\0" "\0" - /* _mesa_function_pool[15092]: Color4fv (offset 30) */ + /* _mesa_function_pool[15149]: Color4fv (offset 30) */ "p\0" "glColor4fv\0" "\0" - /* _mesa_function_pool[15106]: MultiTexCoord4ivARB (offset 405) */ + /* _mesa_function_pool[15163]: MultiTexCoord4ivARB (offset 405) */ "ip\0" "glMultiTexCoord4iv\0" "glMultiTexCoord4ivARB\0" "\0" - /* _mesa_function_pool[15151]: ProgramLocalParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[15208]: ProgramLocalParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramLocalParameters4fvEXT\0" "\0" - /* _mesa_function_pool[15188]: ColorPointer (offset 308) */ + /* _mesa_function_pool[15245]: ColorPointer (offset 308) */ "iiip\0" "glColorPointer\0" "\0" - /* _mesa_function_pool[15209]: Rects (offset 92) */ + /* _mesa_function_pool[15266]: Rects (offset 92) */ "iiii\0" "glRects\0" "\0" - /* _mesa_function_pool[15223]: GetMapAttribParameterfvNV (dynamic) */ + /* _mesa_function_pool[15280]: GetMapAttribParameterfvNV (dynamic) */ "iiip\0" "glGetMapAttribParameterfvNV\0" "\0" - /* _mesa_function_pool[15257]: Lightiv (offset 162) */ + /* _mesa_function_pool[15314]: Lightiv (offset 162) */ "iip\0" "glLightiv\0" "\0" - /* _mesa_function_pool[15272]: VertexAttrib4sARB (will be remapped) */ + /* _mesa_function_pool[15329]: VertexAttrib4sARB (will be remapped) */ "iiiii\0" "glVertexAttrib4s\0" "glVertexAttrib4sARB\0" "\0" - /* _mesa_function_pool[15316]: GetQueryObjectuivARB (will be remapped) */ + /* _mesa_function_pool[15373]: GetQueryObjectuivARB (will be remapped) */ "iip\0" "glGetQueryObjectuiv\0" "glGetQueryObjectuivARB\0" "\0" - /* _mesa_function_pool[15364]: GetTexParameteriv (offset 283) */ + /* _mesa_function_pool[15421]: GetTexParameteriv (offset 283) */ "iip\0" "glGetTexParameteriv\0" "\0" - /* _mesa_function_pool[15389]: MapParameterivNV (dynamic) */ + /* _mesa_function_pool[15446]: MapParameterivNV (dynamic) */ "iip\0" "glMapParameterivNV\0" "\0" - /* _mesa_function_pool[15413]: GenRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[15470]: GenRenderbuffersEXT (will be remapped) */ "ip\0" "glGenRenderbuffers\0" "glGenRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[15458]: VertexAttrib2dvARB (will be remapped) */ + /* _mesa_function_pool[15515]: VertexAttrib2dvARB (will be remapped) */ "ip\0" "glVertexAttrib2dv\0" "glVertexAttrib2dvARB\0" "\0" - /* _mesa_function_pool[15501]: EdgeFlagPointerEXT (will be remapped) */ + /* _mesa_function_pool[15558]: EdgeFlagPointerEXT (will be remapped) */ "iip\0" "glEdgeFlagPointerEXT\0" "\0" - /* _mesa_function_pool[15527]: VertexAttribs2svNV (will be remapped) */ + /* _mesa_function_pool[15584]: VertexAttribs2svNV (will be remapped) */ "iip\0" "glVertexAttribs2svNV\0" "\0" - /* _mesa_function_pool[15553]: WeightbvARB (dynamic) */ + /* _mesa_function_pool[15610]: WeightbvARB (dynamic) */ "ip\0" "glWeightbvARB\0" "\0" - /* _mesa_function_pool[15571]: VertexAttrib2fvARB (will be remapped) */ + /* _mesa_function_pool[15628]: VertexAttrib2fvARB (will be remapped) */ "ip\0" "glVertexAttrib2fv\0" "glVertexAttrib2fvARB\0" "\0" - /* _mesa_function_pool[15614]: GetBufferParameterivARB (will be remapped) */ + /* _mesa_function_pool[15671]: GetBufferParameterivARB (will be remapped) */ "iip\0" "glGetBufferParameteriv\0" "glGetBufferParameterivARB\0" "\0" - /* _mesa_function_pool[15668]: Rectdv (offset 87) */ + /* _mesa_function_pool[15725]: Rectdv (offset 87) */ "pp\0" "glRectdv\0" "\0" - /* _mesa_function_pool[15681]: ListParameteriSGIX (dynamic) */ + /* _mesa_function_pool[15738]: ListParameteriSGIX (dynamic) */ "iii\0" "glListParameteriSGIX\0" "\0" - /* _mesa_function_pool[15707]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[15764]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffff\0" "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[15766]: InstrumentsBufferSGIX (dynamic) */ + /* _mesa_function_pool[15823]: InstrumentsBufferSGIX (dynamic) */ "ip\0" "glInstrumentsBufferSGIX\0" "\0" - /* _mesa_function_pool[15794]: VertexAttrib4NivARB (will be remapped) */ + /* _mesa_function_pool[15851]: VertexAttrib4NivARB (will be remapped) */ "ip\0" "glVertexAttrib4Niv\0" "glVertexAttrib4NivARB\0" "\0" - /* _mesa_function_pool[15839]: GetAttachedShaders (will be remapped) */ + /* _mesa_function_pool[15896]: GetAttachedShaders (will be remapped) */ "iipp\0" "glGetAttachedShaders\0" "\0" - /* _mesa_function_pool[15866]: GenVertexArraysAPPLE (will be remapped) */ + /* _mesa_function_pool[15923]: GenVertexArraysAPPLE (will be remapped) */ "ip\0" "glGenVertexArraysAPPLE\0" "\0" - /* _mesa_function_pool[15893]: Materialiv (offset 172) */ + /* _mesa_function_pool[15950]: Materialiv (offset 172) */ "iip\0" "glMaterialiv\0" "\0" - /* _mesa_function_pool[15911]: PushClientAttrib (offset 335) */ + /* _mesa_function_pool[15968]: PushClientAttrib (offset 335) */ "i\0" "glPushClientAttrib\0" "\0" - /* _mesa_function_pool[15933]: ProgramEnvParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[15990]: ProgramEnvParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramEnvParameters4fvEXT\0" "\0" - /* _mesa_function_pool[15968]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[16025]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[16014]: WindowPos2iMESA (will be remapped) */ + /* _mesa_function_pool[16071]: WindowPos2iMESA (will be remapped) */ "ii\0" "glWindowPos2i\0" "glWindowPos2iARB\0" "glWindowPos2iMESA\0" "\0" - /* _mesa_function_pool[16067]: SecondaryColor3fvEXT (will be remapped) */ + /* _mesa_function_pool[16124]: SecondaryColor3fvEXT (will be remapped) */ "p\0" "glSecondaryColor3fv\0" "glSecondaryColor3fvEXT\0" "\0" - /* _mesa_function_pool[16113]: PolygonMode (offset 174) */ + /* _mesa_function_pool[16170]: PolygonMode (offset 174) */ "ii\0" "glPolygonMode\0" "\0" - /* _mesa_function_pool[16131]: CompressedTexSubImage1DARB (will be remapped) */ + /* _mesa_function_pool[16188]: CompressedTexSubImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexSubImage1D\0" "glCompressedTexSubImage1DARB\0" "\0" - /* _mesa_function_pool[16195]: GetVertexAttribivNV (will be remapped) */ + /* _mesa_function_pool[16252]: GetVertexAttribivNV (will be remapped) */ "iip\0" "glGetVertexAttribivNV\0" "\0" - /* _mesa_function_pool[16222]: GetProgramStringARB (will be remapped) */ + /* _mesa_function_pool[16279]: GetProgramStringARB (will be remapped) */ "iip\0" "glGetProgramStringARB\0" "\0" - /* _mesa_function_pool[16249]: TexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[16306]: TexBumpParameterfvATI (will be remapped) */ "ip\0" "glTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[16277]: CompileShaderARB (will be remapped) */ + /* _mesa_function_pool[16334]: CompileShaderARB (will be remapped) */ "i\0" "glCompileShader\0" "glCompileShaderARB\0" "\0" - /* _mesa_function_pool[16315]: DeleteShader (will be remapped) */ + /* _mesa_function_pool[16372]: DeleteShader (will be remapped) */ "i\0" "glDeleteShader\0" "\0" - /* _mesa_function_pool[16333]: DisableClientState (offset 309) */ + /* _mesa_function_pool[16390]: DisableClientState (offset 309) */ "i\0" "glDisableClientState\0" "\0" - /* _mesa_function_pool[16357]: TexGeni (offset 192) */ + /* _mesa_function_pool[16414]: TexGeni (offset 192) */ "iii\0" "glTexGeni\0" "\0" - /* _mesa_function_pool[16372]: TexGenf (offset 190) */ + /* _mesa_function_pool[16429]: TexGenf (offset 190) */ "iif\0" "glTexGenf\0" "\0" - /* _mesa_function_pool[16387]: Uniform3fARB (will be remapped) */ + /* _mesa_function_pool[16444]: Uniform3fARB (will be remapped) */ "ifff\0" "glUniform3f\0" "glUniform3fARB\0" "\0" - /* _mesa_function_pool[16420]: TexGend (offset 188) */ + /* _mesa_function_pool[16477]: TexGend (offset 188) */ "iid\0" "glTexGend\0" "\0" - /* _mesa_function_pool[16435]: ListParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[16492]: ListParameterfvSGIX (dynamic) */ "iip\0" "glListParameterfvSGIX\0" "\0" - /* _mesa_function_pool[16462]: GetPolygonStipple (offset 274) */ + /* _mesa_function_pool[16519]: GetPolygonStipple (offset 274) */ "p\0" "glGetPolygonStipple\0" "\0" - /* _mesa_function_pool[16485]: Tangent3dvEXT (dynamic) */ + /* _mesa_function_pool[16542]: Tangent3dvEXT (dynamic) */ "p\0" "glTangent3dvEXT\0" "\0" - /* _mesa_function_pool[16504]: GetVertexAttribfvNV (will be remapped) */ + /* _mesa_function_pool[16561]: GetVertexAttribfvNV (will be remapped) */ "iip\0" "glGetVertexAttribfvNV\0" "\0" - /* _mesa_function_pool[16531]: WindowPos3sMESA (will be remapped) */ + /* _mesa_function_pool[16588]: WindowPos3sMESA (will be remapped) */ "iii\0" "glWindowPos3s\0" "glWindowPos3sARB\0" "glWindowPos3sMESA\0" "\0" - /* _mesa_function_pool[16585]: VertexAttrib2svNV (will be remapped) */ + /* _mesa_function_pool[16642]: VertexAttrib2svNV (will be remapped) */ "ip\0" "glVertexAttrib2svNV\0" "\0" - /* _mesa_function_pool[16609]: VertexAttribs1fvNV (will be remapped) */ + /* _mesa_function_pool[16666]: VertexAttribs1fvNV (will be remapped) */ "iip\0" "glVertexAttribs1fvNV\0" "\0" - /* _mesa_function_pool[16635]: TexCoord2fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[16692]: TexCoord2fVertex3fvSUN (dynamic) */ "pp\0" "glTexCoord2fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[16664]: WindowPos4sMESA (will be remapped) */ + /* _mesa_function_pool[16721]: WindowPos4sMESA (will be remapped) */ "iiii\0" "glWindowPos4sMESA\0" "\0" - /* _mesa_function_pool[16688]: VertexAttrib4NuivARB (will be remapped) */ + /* _mesa_function_pool[16745]: VertexAttrib4NuivARB (will be remapped) */ "ip\0" "glVertexAttrib4Nuiv\0" "glVertexAttrib4NuivARB\0" "\0" - /* _mesa_function_pool[16735]: ClientActiveTextureARB (offset 375) */ + /* _mesa_function_pool[16792]: ClientActiveTextureARB (offset 375) */ "i\0" "glClientActiveTexture\0" "glClientActiveTextureARB\0" "\0" - /* _mesa_function_pool[16785]: PixelTexGenSGIX (will be remapped) */ + /* _mesa_function_pool[16842]: PixelTexGenSGIX (will be remapped) */ "i\0" "glPixelTexGenSGIX\0" "\0" - /* _mesa_function_pool[16806]: ReplacementCodeusvSUN (dynamic) */ + /* _mesa_function_pool[16863]: ReplacementCodeusvSUN (dynamic) */ "p\0" "glReplacementCodeusvSUN\0" "\0" - /* _mesa_function_pool[16833]: Uniform4fARB (will be remapped) */ + /* _mesa_function_pool[16890]: Uniform4fARB (will be remapped) */ "iffff\0" "glUniform4f\0" "glUniform4fARB\0" "\0" - /* _mesa_function_pool[16867]: Color4sv (offset 34) */ + /* _mesa_function_pool[16924]: Color4sv (offset 34) */ "p\0" "glColor4sv\0" "\0" - /* _mesa_function_pool[16881]: FlushMappedBufferRange (will be remapped) */ + /* _mesa_function_pool[16938]: FlushMappedBufferRange (will be remapped) */ "iii\0" "glFlushMappedBufferRange\0" "\0" - /* _mesa_function_pool[16911]: IsProgramNV (will be remapped) */ + /* _mesa_function_pool[16968]: IsProgramNV (will be remapped) */ "i\0" "glIsProgramARB\0" "glIsProgramNV\0" "\0" - /* _mesa_function_pool[16943]: FlushMappedBufferRangeAPPLE (will be remapped) */ + /* _mesa_function_pool[17000]: FlushMappedBufferRangeAPPLE (will be remapped) */ "iii\0" "glFlushMappedBufferRangeAPPLE\0" "\0" - /* _mesa_function_pool[16978]: PixelZoom (offset 246) */ + /* _mesa_function_pool[17035]: PixelZoom (offset 246) */ "ff\0" "glPixelZoom\0" "\0" - /* _mesa_function_pool[16994]: ReplacementCodePointerSUN (dynamic) */ + /* _mesa_function_pool[17051]: ReplacementCodePointerSUN (dynamic) */ "iip\0" "glReplacementCodePointerSUN\0" "\0" - /* _mesa_function_pool[17027]: ProgramEnvParameter4dARB (will be remapped) */ + /* _mesa_function_pool[17084]: ProgramEnvParameter4dARB (will be remapped) */ "iidddd\0" "glProgramEnvParameter4dARB\0" "glProgramParameter4dNV\0" "\0" - /* _mesa_function_pool[17085]: ColorTableParameterfv (offset 340) */ + /* _mesa_function_pool[17142]: ColorTableParameterfv (offset 340) */ "iip\0" "glColorTableParameterfv\0" "glColorTableParameterfvSGI\0" "\0" - /* _mesa_function_pool[17141]: FragmentLightModelfSGIX (dynamic) */ + /* _mesa_function_pool[17198]: FragmentLightModelfSGIX (dynamic) */ "if\0" "glFragmentLightModelfSGIX\0" "\0" - /* _mesa_function_pool[17171]: Binormal3bvEXT (dynamic) */ + /* _mesa_function_pool[17228]: Binormal3bvEXT (dynamic) */ "p\0" "glBinormal3bvEXT\0" "\0" - /* _mesa_function_pool[17191]: PixelMapuiv (offset 252) */ + /* _mesa_function_pool[17248]: PixelMapuiv (offset 252) */ "iip\0" "glPixelMapuiv\0" "\0" - /* _mesa_function_pool[17210]: Color3dv (offset 12) */ + /* _mesa_function_pool[17267]: Color3dv (offset 12) */ "p\0" "glColor3dv\0" "\0" - /* _mesa_function_pool[17224]: IsTexture (offset 330) */ + /* _mesa_function_pool[17281]: IsTexture (offset 330) */ "i\0" "glIsTexture\0" "glIsTextureEXT\0" "\0" - /* _mesa_function_pool[17254]: VertexWeightfvEXT (dynamic) */ + /* _mesa_function_pool[17311]: VertexWeightfvEXT (dynamic) */ "p\0" "glVertexWeightfvEXT\0" "\0" - /* _mesa_function_pool[17277]: VertexAttrib1dARB (will be remapped) */ + /* _mesa_function_pool[17334]: VertexAttrib1dARB (will be remapped) */ "id\0" "glVertexAttrib1d\0" "glVertexAttrib1dARB\0" "\0" - /* _mesa_function_pool[17318]: ImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[17375]: ImageTransformParameterivHP (dynamic) */ "iip\0" "glImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[17353]: TexCoord4i (offset 122) */ + /* _mesa_function_pool[17410]: TexCoord4i (offset 122) */ "iiii\0" "glTexCoord4i\0" "\0" - /* _mesa_function_pool[17372]: DeleteQueriesARB (will be remapped) */ + /* _mesa_function_pool[17429]: DeleteQueriesARB (will be remapped) */ "ip\0" "glDeleteQueries\0" "glDeleteQueriesARB\0" "\0" - /* _mesa_function_pool[17411]: Color4ubVertex2fSUN (dynamic) */ + /* _mesa_function_pool[17468]: Color4ubVertex2fSUN (dynamic) */ "iiiiff\0" "glColor4ubVertex2fSUN\0" "\0" - /* _mesa_function_pool[17441]: FragmentColorMaterialSGIX (dynamic) */ + /* _mesa_function_pool[17498]: FragmentColorMaterialSGIX (dynamic) */ "ii\0" "glFragmentColorMaterialSGIX\0" "\0" - /* _mesa_function_pool[17473]: CurrentPaletteMatrixARB (dynamic) */ + /* _mesa_function_pool[17530]: CurrentPaletteMatrixARB (dynamic) */ "i\0" "glCurrentPaletteMatrixARB\0" "\0" - /* _mesa_function_pool[17502]: GetMapdv (offset 266) */ + /* _mesa_function_pool[17559]: GetMapdv (offset 266) */ "iip\0" "glGetMapdv\0" "\0" - /* _mesa_function_pool[17518]: SamplePatternSGIS (will be remapped) */ + /* _mesa_function_pool[17575]: ObjectPurgeableAPPLE (will be remapped) */ + "iii\0" + "glObjectPurgeableAPPLE\0" + "\0" + /* _mesa_function_pool[17603]: SamplePatternSGIS (will be remapped) */ "i\0" "glSamplePatternSGIS\0" "glSamplePatternEXT\0" "\0" - /* _mesa_function_pool[17560]: PixelStoref (offset 249) */ + /* _mesa_function_pool[17645]: PixelStoref (offset 249) */ "if\0" "glPixelStoref\0" "\0" - /* _mesa_function_pool[17578]: IsQueryARB (will be remapped) */ + /* _mesa_function_pool[17663]: IsQueryARB (will be remapped) */ "i\0" "glIsQuery\0" "glIsQueryARB\0" "\0" - /* _mesa_function_pool[17604]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[17689]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ "iiiiifff\0" "glReplacementCodeuiColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[17653]: PixelStorei (offset 250) */ + /* _mesa_function_pool[17738]: PixelStorei (offset 250) */ "ii\0" "glPixelStorei\0" "\0" - /* _mesa_function_pool[17671]: VertexAttrib4usvARB (will be remapped) */ + /* _mesa_function_pool[17756]: VertexAttrib4usvARB (will be remapped) */ "ip\0" "glVertexAttrib4usv\0" "glVertexAttrib4usvARB\0" "\0" - /* _mesa_function_pool[17716]: LinkProgramARB (will be remapped) */ + /* _mesa_function_pool[17801]: LinkProgramARB (will be remapped) */ "i\0" "glLinkProgram\0" "glLinkProgramARB\0" "\0" - /* _mesa_function_pool[17750]: VertexAttrib2fNV (will be remapped) */ + /* _mesa_function_pool[17835]: VertexAttrib2fNV (will be remapped) */ "iff\0" "glVertexAttrib2fNV\0" "\0" - /* _mesa_function_pool[17774]: ShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[17859]: ShaderSourceARB (will be remapped) */ "iipp\0" "glShaderSource\0" "glShaderSourceARB\0" "\0" - /* _mesa_function_pool[17813]: FragmentMaterialiSGIX (dynamic) */ + /* _mesa_function_pool[17898]: FragmentMaterialiSGIX (dynamic) */ "iii\0" "glFragmentMaterialiSGIX\0" "\0" - /* _mesa_function_pool[17842]: EvalCoord2dv (offset 233) */ + /* _mesa_function_pool[17927]: EvalCoord2dv (offset 233) */ "p\0" "glEvalCoord2dv\0" "\0" - /* _mesa_function_pool[17860]: VertexAttrib3svARB (will be remapped) */ + /* _mesa_function_pool[17945]: VertexAttrib3svARB (will be remapped) */ "ip\0" "glVertexAttrib3sv\0" "glVertexAttrib3svARB\0" "\0" - /* _mesa_function_pool[17903]: ColorMaterial (offset 151) */ + /* _mesa_function_pool[17988]: ColorMaterial (offset 151) */ "ii\0" "glColorMaterial\0" "\0" - /* _mesa_function_pool[17923]: CompressedTexSubImage3DARB (will be remapped) */ + /* _mesa_function_pool[18008]: CompressedTexSubImage3DARB (will be remapped) */ "iiiiiiiiiip\0" "glCompressedTexSubImage3D\0" "glCompressedTexSubImage3DARB\0" "\0" - /* _mesa_function_pool[17991]: WindowPos2ivMESA (will be remapped) */ + /* _mesa_function_pool[18076]: WindowPos2ivMESA (will be remapped) */ "p\0" "glWindowPos2iv\0" "glWindowPos2ivARB\0" "glWindowPos2ivMESA\0" "\0" - /* _mesa_function_pool[18046]: IsFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[18131]: IsFramebufferEXT (will be remapped) */ "i\0" "glIsFramebuffer\0" "glIsFramebufferEXT\0" "\0" - /* _mesa_function_pool[18084]: Uniform4ivARB (will be remapped) */ + /* _mesa_function_pool[18169]: Uniform4ivARB (will be remapped) */ "iip\0" "glUniform4iv\0" "glUniform4ivARB\0" "\0" - /* _mesa_function_pool[18118]: GetVertexAttribdvARB (will be remapped) */ + /* _mesa_function_pool[18203]: GetVertexAttribdvARB (will be remapped) */ "iip\0" "glGetVertexAttribdv\0" "glGetVertexAttribdvARB\0" "\0" - /* _mesa_function_pool[18166]: TexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[18251]: TexBumpParameterivATI (will be remapped) */ "ip\0" "glTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[18194]: GetSeparableFilter (offset 359) */ + /* _mesa_function_pool[18279]: GetSeparableFilter (offset 359) */ "iiippp\0" "glGetSeparableFilter\0" "glGetSeparableFilterEXT\0" "\0" - /* _mesa_function_pool[18247]: Binormal3dEXT (dynamic) */ + /* _mesa_function_pool[18332]: Binormal3dEXT (dynamic) */ "ddd\0" "glBinormal3dEXT\0" "\0" - /* _mesa_function_pool[18268]: SpriteParameteriSGIX (dynamic) */ + /* _mesa_function_pool[18353]: SpriteParameteriSGIX (dynamic) */ "ii\0" "glSpriteParameteriSGIX\0" "\0" - /* _mesa_function_pool[18295]: RequestResidentProgramsNV (will be remapped) */ + /* _mesa_function_pool[18380]: RequestResidentProgramsNV (will be remapped) */ "ip\0" "glRequestResidentProgramsNV\0" "\0" - /* _mesa_function_pool[18327]: TagSampleBufferSGIX (dynamic) */ + /* _mesa_function_pool[18412]: TagSampleBufferSGIX (dynamic) */ "\0" "glTagSampleBufferSGIX\0" "\0" - /* _mesa_function_pool[18351]: ReplacementCodeusSUN (dynamic) */ + /* _mesa_function_pool[18436]: ReplacementCodeusSUN (dynamic) */ "i\0" "glReplacementCodeusSUN\0" "\0" - /* _mesa_function_pool[18377]: FeedbackBuffer (offset 194) */ + /* _mesa_function_pool[18462]: FeedbackBuffer (offset 194) */ "iip\0" "glFeedbackBuffer\0" "\0" - /* _mesa_function_pool[18399]: RasterPos2iv (offset 67) */ + /* _mesa_function_pool[18484]: RasterPos2iv (offset 67) */ "p\0" "glRasterPos2iv\0" "\0" - /* _mesa_function_pool[18417]: TexImage1D (offset 182) */ + /* _mesa_function_pool[18502]: TexImage1D (offset 182) */ "iiiiiiip\0" "glTexImage1D\0" "\0" - /* _mesa_function_pool[18440]: ListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[18525]: ListParameterivSGIX (dynamic) */ "iip\0" "glListParameterivSGIX\0" "\0" - /* _mesa_function_pool[18467]: MultiDrawElementsEXT (will be remapped) */ + /* _mesa_function_pool[18552]: MultiDrawElementsEXT (will be remapped) */ "ipipi\0" "glMultiDrawElements\0" "glMultiDrawElementsEXT\0" "\0" - /* _mesa_function_pool[18517]: Color3s (offset 17) */ + /* _mesa_function_pool[18602]: Color3s (offset 17) */ "iii\0" "glColor3s\0" "\0" - /* _mesa_function_pool[18532]: Uniform1ivARB (will be remapped) */ + /* _mesa_function_pool[18617]: Uniform1ivARB (will be remapped) */ "iip\0" "glUniform1iv\0" "glUniform1ivARB\0" "\0" - /* _mesa_function_pool[18566]: WindowPos2sMESA (will be remapped) */ + /* _mesa_function_pool[18651]: WindowPos2sMESA (will be remapped) */ "ii\0" "glWindowPos2s\0" "glWindowPos2sARB\0" "glWindowPos2sMESA\0" "\0" - /* _mesa_function_pool[18619]: WeightusvARB (dynamic) */ + /* _mesa_function_pool[18704]: WeightusvARB (dynamic) */ "ip\0" "glWeightusvARB\0" "\0" - /* _mesa_function_pool[18638]: TexCoordPointer (offset 320) */ + /* _mesa_function_pool[18723]: TexCoordPointer (offset 320) */ "iiip\0" "glTexCoordPointer\0" "\0" - /* _mesa_function_pool[18662]: FogCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[18747]: FogCoordPointerEXT (will be remapped) */ "iip\0" "glFogCoordPointer\0" "glFogCoordPointerEXT\0" "\0" - /* _mesa_function_pool[18706]: IndexMaterialEXT (dynamic) */ + /* _mesa_function_pool[18791]: IndexMaterialEXT (dynamic) */ "ii\0" "glIndexMaterialEXT\0" "\0" - /* _mesa_function_pool[18729]: Color3i (offset 15) */ + /* _mesa_function_pool[18814]: Color3i (offset 15) */ "iii\0" "glColor3i\0" "\0" - /* _mesa_function_pool[18744]: FrontFace (offset 157) */ + /* _mesa_function_pool[18829]: FrontFace (offset 157) */ "i\0" "glFrontFace\0" "\0" - /* _mesa_function_pool[18759]: EvalCoord2d (offset 232) */ + /* _mesa_function_pool[18844]: EvalCoord2d (offset 232) */ "dd\0" "glEvalCoord2d\0" "\0" - /* _mesa_function_pool[18777]: SecondaryColor3ubvEXT (will be remapped) */ + /* _mesa_function_pool[18862]: SecondaryColor3ubvEXT (will be remapped) */ "p\0" "glSecondaryColor3ubv\0" "glSecondaryColor3ubvEXT\0" "\0" - /* _mesa_function_pool[18825]: EvalCoord2f (offset 234) */ + /* _mesa_function_pool[18910]: EvalCoord2f (offset 234) */ "ff\0" "glEvalCoord2f\0" "\0" - /* _mesa_function_pool[18843]: VertexAttrib4dvARB (will be remapped) */ + /* _mesa_function_pool[18928]: VertexAttrib4dvARB (will be remapped) */ "ip\0" "glVertexAttrib4dv\0" "glVertexAttrib4dvARB\0" "\0" - /* _mesa_function_pool[18886]: BindAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[18971]: BindAttribLocationARB (will be remapped) */ "iip\0" "glBindAttribLocation\0" "glBindAttribLocationARB\0" "\0" - /* _mesa_function_pool[18936]: Color3b (offset 9) */ + /* _mesa_function_pool[19021]: Color3b (offset 9) */ "iii\0" "glColor3b\0" "\0" - /* _mesa_function_pool[18951]: MultiTexCoord2dARB (offset 384) */ + /* _mesa_function_pool[19036]: MultiTexCoord2dARB (offset 384) */ "idd\0" "glMultiTexCoord2d\0" "glMultiTexCoord2dARB\0" "\0" - /* _mesa_function_pool[18995]: ExecuteProgramNV (will be remapped) */ + /* _mesa_function_pool[19080]: ExecuteProgramNV (will be remapped) */ "iip\0" "glExecuteProgramNV\0" "\0" - /* _mesa_function_pool[19019]: Color3f (offset 13) */ + /* _mesa_function_pool[19104]: Color3f (offset 13) */ "fff\0" "glColor3f\0" "\0" - /* _mesa_function_pool[19034]: LightEnviSGIX (dynamic) */ + /* _mesa_function_pool[19119]: LightEnviSGIX (dynamic) */ "ii\0" "glLightEnviSGIX\0" "\0" - /* _mesa_function_pool[19054]: Color3d (offset 11) */ + /* _mesa_function_pool[19139]: Color3d (offset 11) */ "ddd\0" "glColor3d\0" "\0" - /* _mesa_function_pool[19069]: Normal3dv (offset 55) */ + /* _mesa_function_pool[19154]: Normal3dv (offset 55) */ "p\0" "glNormal3dv\0" "\0" - /* _mesa_function_pool[19084]: Lightf (offset 159) */ + /* _mesa_function_pool[19169]: Lightf (offset 159) */ "iif\0" "glLightf\0" "\0" - /* _mesa_function_pool[19098]: ReplacementCodeuiSUN (dynamic) */ + /* _mesa_function_pool[19183]: ReplacementCodeuiSUN (dynamic) */ "i\0" "glReplacementCodeuiSUN\0" "\0" - /* _mesa_function_pool[19124]: MatrixMode (offset 293) */ + /* _mesa_function_pool[19209]: MatrixMode (offset 293) */ "i\0" "glMatrixMode\0" "\0" - /* _mesa_function_pool[19140]: GetPixelMapusv (offset 273) */ + /* _mesa_function_pool[19225]: GetPixelMapusv (offset 273) */ "ip\0" "glGetPixelMapusv\0" "\0" - /* _mesa_function_pool[19161]: Lighti (offset 161) */ + /* _mesa_function_pool[19246]: Lighti (offset 161) */ "iii\0" "glLighti\0" "\0" - /* _mesa_function_pool[19175]: VertexAttribPointerNV (will be remapped) */ + /* _mesa_function_pool[19260]: VertexAttribPointerNV (will be remapped) */ "iiiip\0" "glVertexAttribPointerNV\0" "\0" - /* _mesa_function_pool[19206]: GetBooleanIndexedvEXT (will be remapped) */ + /* _mesa_function_pool[19291]: GetBooleanIndexedvEXT (will be remapped) */ "iip\0" "glGetBooleanIndexedvEXT\0" "\0" - /* _mesa_function_pool[19235]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ + /* _mesa_function_pool[19320]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ "iiip\0" "glGetFramebufferAttachmentParameteriv\0" "glGetFramebufferAttachmentParameterivEXT\0" "\0" - /* _mesa_function_pool[19320]: PixelTransformParameterfEXT (dynamic) */ + /* _mesa_function_pool[19405]: PixelTransformParameterfEXT (dynamic) */ "iif\0" "glPixelTransformParameterfEXT\0" "\0" - /* _mesa_function_pool[19355]: MultiTexCoord4dvARB (offset 401) */ + /* _mesa_function_pool[19440]: MultiTexCoord4dvARB (offset 401) */ "ip\0" "glMultiTexCoord4dv\0" "glMultiTexCoord4dvARB\0" "\0" - /* _mesa_function_pool[19400]: PixelTransformParameteriEXT (dynamic) */ + /* _mesa_function_pool[19485]: PixelTransformParameteriEXT (dynamic) */ "iii\0" "glPixelTransformParameteriEXT\0" "\0" - /* _mesa_function_pool[19435]: GetDoublev (offset 260) */ + /* _mesa_function_pool[19520]: GetDoublev (offset 260) */ "ip\0" "glGetDoublev\0" "\0" - /* _mesa_function_pool[19452]: MultMatrixd (offset 295) */ + /* _mesa_function_pool[19537]: MultMatrixd (offset 295) */ "p\0" "glMultMatrixd\0" "\0" - /* _mesa_function_pool[19469]: MultMatrixf (offset 294) */ + /* _mesa_function_pool[19554]: MultMatrixf (offset 294) */ "p\0" "glMultMatrixf\0" "\0" - /* _mesa_function_pool[19486]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[19571]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ "ffiiiifff\0" "glTexCoord2fColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[19529]: Uniform1iARB (will be remapped) */ + /* _mesa_function_pool[19614]: Uniform1iARB (will be remapped) */ "ii\0" "glUniform1i\0" "glUniform1iARB\0" "\0" - /* _mesa_function_pool[19560]: VertexAttribPointerARB (will be remapped) */ + /* _mesa_function_pool[19645]: VertexAttribPointerARB (will be remapped) */ "iiiiip\0" "glVertexAttribPointer\0" "glVertexAttribPointerARB\0" "\0" - /* _mesa_function_pool[19615]: SharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[19700]: SharpenTexFuncSGIS (dynamic) */ "iip\0" "glSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[19641]: MultiTexCoord4fvARB (offset 403) */ + /* _mesa_function_pool[19726]: MultiTexCoord4fvARB (offset 403) */ "ip\0" "glMultiTexCoord4fv\0" "glMultiTexCoord4fvARB\0" "\0" - /* _mesa_function_pool[19686]: UniformMatrix2x3fv (will be remapped) */ + /* _mesa_function_pool[19771]: UniformMatrix2x3fv (will be remapped) */ "iiip\0" "glUniformMatrix2x3fv\0" "\0" - /* _mesa_function_pool[19713]: TrackMatrixNV (will be remapped) */ + /* _mesa_function_pool[19798]: TrackMatrixNV (will be remapped) */ "iiii\0" "glTrackMatrixNV\0" "\0" - /* _mesa_function_pool[19735]: CombinerParameteriNV (will be remapped) */ + /* _mesa_function_pool[19820]: CombinerParameteriNV (will be remapped) */ "ii\0" "glCombinerParameteriNV\0" "\0" - /* _mesa_function_pool[19762]: DeleteAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[19847]: DeleteAsyncMarkersSGIX (dynamic) */ "ii\0" "glDeleteAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[19791]: IsAsyncMarkerSGIX (dynamic) */ + /* _mesa_function_pool[19876]: IsAsyncMarkerSGIX (dynamic) */ "i\0" "glIsAsyncMarkerSGIX\0" "\0" - /* _mesa_function_pool[19814]: FrameZoomSGIX (dynamic) */ + /* _mesa_function_pool[19899]: FrameZoomSGIX (dynamic) */ "i\0" "glFrameZoomSGIX\0" "\0" - /* _mesa_function_pool[19833]: Normal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[19918]: Normal3fVertex3fvSUN (dynamic) */ "pp\0" "glNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[19860]: RasterPos4sv (offset 85) */ + /* _mesa_function_pool[19945]: RasterPos4sv (offset 85) */ "p\0" "glRasterPos4sv\0" "\0" - /* _mesa_function_pool[19878]: VertexAttrib4NsvARB (will be remapped) */ + /* _mesa_function_pool[19963]: VertexAttrib4NsvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nsv\0" "glVertexAttrib4NsvARB\0" "\0" - /* _mesa_function_pool[19923]: VertexAttrib3fvARB (will be remapped) */ + /* _mesa_function_pool[20008]: VertexAttrib3fvARB (will be remapped) */ "ip\0" "glVertexAttrib3fv\0" "glVertexAttrib3fvARB\0" "\0" - /* _mesa_function_pool[19966]: ClearColor (offset 206) */ + /* _mesa_function_pool[20051]: ClearColor (offset 206) */ "ffff\0" "glClearColor\0" "\0" - /* _mesa_function_pool[19985]: GetSynciv (will be remapped) */ + /* _mesa_function_pool[20070]: GetSynciv (will be remapped) */ "iiipp\0" "glGetSynciv\0" "\0" - /* _mesa_function_pool[20004]: DeleteFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[20089]: DeleteFramebuffersEXT (will be remapped) */ "ip\0" "glDeleteFramebuffers\0" "glDeleteFramebuffersEXT\0" "\0" - /* _mesa_function_pool[20053]: GlobalAlphaFactorsSUN (dynamic) */ + /* _mesa_function_pool[20138]: GlobalAlphaFactorsSUN (dynamic) */ "i\0" "glGlobalAlphaFactorsSUN\0" "\0" - /* _mesa_function_pool[20080]: IsEnabledIndexedEXT (will be remapped) */ + /* _mesa_function_pool[20165]: IsEnabledIndexedEXT (will be remapped) */ "ii\0" "glIsEnabledIndexedEXT\0" "\0" - /* _mesa_function_pool[20106]: TexEnviv (offset 187) */ + /* _mesa_function_pool[20191]: TexEnviv (offset 187) */ "iip\0" "glTexEnviv\0" "\0" - /* _mesa_function_pool[20122]: TexSubImage3D (offset 372) */ + /* _mesa_function_pool[20207]: TexSubImage3D (offset 372) */ "iiiiiiiiiip\0" "glTexSubImage3D\0" "glTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[20170]: Tangent3fEXT (dynamic) */ + /* _mesa_function_pool[20255]: Tangent3fEXT (dynamic) */ "fff\0" "glTangent3fEXT\0" "\0" - /* _mesa_function_pool[20190]: SecondaryColor3uivEXT (will be remapped) */ + /* _mesa_function_pool[20275]: SecondaryColor3uivEXT (will be remapped) */ "p\0" "glSecondaryColor3uiv\0" "glSecondaryColor3uivEXT\0" "\0" - /* _mesa_function_pool[20238]: MatrixIndexubvARB (dynamic) */ + /* _mesa_function_pool[20323]: MatrixIndexubvARB (dynamic) */ "ip\0" "glMatrixIndexubvARB\0" "\0" - /* _mesa_function_pool[20262]: Color4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[20347]: Color4fNormal3fVertex3fSUN (dynamic) */ "ffffffffff\0" "glColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[20303]: PixelTexGenParameterfSGIS (will be remapped) */ + /* _mesa_function_pool[20388]: PixelTexGenParameterfSGIS (will be remapped) */ "if\0" "glPixelTexGenParameterfSGIS\0" "\0" - /* _mesa_function_pool[20335]: CreateShader (will be remapped) */ + /* _mesa_function_pool[20420]: CreateShader (will be remapped) */ "i\0" "glCreateShader\0" "\0" - /* _mesa_function_pool[20353]: GetColorTableParameterfv (offset 344) */ + /* _mesa_function_pool[20438]: GetColorTableParameterfv (offset 344) */ "iip\0" "glGetColorTableParameterfv\0" "glGetColorTableParameterfvSGI\0" "glGetColorTableParameterfvEXT\0" "\0" - /* _mesa_function_pool[20445]: FragmentLightModelfvSGIX (dynamic) */ + /* _mesa_function_pool[20530]: FragmentLightModelfvSGIX (dynamic) */ "ip\0" "glFragmentLightModelfvSGIX\0" "\0" - /* _mesa_function_pool[20476]: Bitmap (offset 8) */ + /* _mesa_function_pool[20561]: Bitmap (offset 8) */ "iiffffp\0" "glBitmap\0" "\0" - /* _mesa_function_pool[20494]: MultiTexCoord3fARB (offset 394) */ + /* _mesa_function_pool[20579]: MultiTexCoord3fARB (offset 394) */ "ifff\0" "glMultiTexCoord3f\0" "glMultiTexCoord3fARB\0" "\0" - /* _mesa_function_pool[20539]: GetTexLevelParameterfv (offset 284) */ + /* _mesa_function_pool[20624]: GetTexLevelParameterfv (offset 284) */ "iiip\0" "glGetTexLevelParameterfv\0" "\0" - /* _mesa_function_pool[20570]: GetPixelTexGenParameterfvSGIS (will be remapped) */ + /* _mesa_function_pool[20655]: GetPixelTexGenParameterfvSGIS (will be remapped) */ "ip\0" "glGetPixelTexGenParameterfvSGIS\0" "\0" - /* _mesa_function_pool[20606]: GenFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[20691]: GenFramebuffersEXT (will be remapped) */ "ip\0" "glGenFramebuffers\0" "glGenFramebuffersEXT\0" "\0" - /* _mesa_function_pool[20649]: GetProgramParameterdvNV (will be remapped) */ + /* _mesa_function_pool[20734]: GetProgramParameterdvNV (will be remapped) */ "iiip\0" "glGetProgramParameterdvNV\0" "\0" - /* _mesa_function_pool[20681]: Vertex2sv (offset 133) */ + /* _mesa_function_pool[20766]: Vertex2sv (offset 133) */ "p\0" "glVertex2sv\0" "\0" - /* _mesa_function_pool[20696]: GetIntegerv (offset 263) */ + /* _mesa_function_pool[20781]: GetIntegerv (offset 263) */ "ip\0" "glGetIntegerv\0" "\0" - /* _mesa_function_pool[20714]: IsVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[20799]: IsVertexArrayAPPLE (will be remapped) */ "i\0" "glIsVertexArray\0" "glIsVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[20754]: FragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[20839]: FragmentLightfvSGIX (dynamic) */ "iip\0" "glFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[20781]: DetachShader (will be remapped) */ + /* _mesa_function_pool[20866]: DetachShader (will be remapped) */ "ii\0" "glDetachShader\0" "\0" - /* _mesa_function_pool[20800]: VertexAttrib4NubARB (will be remapped) */ + /* _mesa_function_pool[20885]: VertexAttrib4NubARB (will be remapped) */ "iiiii\0" "glVertexAttrib4Nub\0" "glVertexAttrib4NubARB\0" "\0" - /* _mesa_function_pool[20848]: GetProgramEnvParameterfvARB (will be remapped) */ + /* _mesa_function_pool[20933]: GetProgramEnvParameterfvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterfvARB\0" "\0" - /* _mesa_function_pool[20883]: GetTrackMatrixivNV (will be remapped) */ + /* _mesa_function_pool[20968]: GetTrackMatrixivNV (will be remapped) */ "iiip\0" "glGetTrackMatrixivNV\0" "\0" - /* _mesa_function_pool[20910]: VertexAttrib3svNV (will be remapped) */ + /* _mesa_function_pool[20995]: VertexAttrib3svNV (will be remapped) */ "ip\0" "glVertexAttrib3svNV\0" "\0" - /* _mesa_function_pool[20934]: Uniform4fvARB (will be remapped) */ + /* _mesa_function_pool[21019]: Uniform4fvARB (will be remapped) */ "iip\0" "glUniform4fv\0" "glUniform4fvARB\0" "\0" - /* _mesa_function_pool[20968]: MultTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[21053]: MultTransposeMatrixfARB (will be remapped) */ "p\0" "glMultTransposeMatrixf\0" "glMultTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[21020]: GetTexEnviv (offset 277) */ + /* _mesa_function_pool[21105]: GetTexEnviv (offset 277) */ "iip\0" "glGetTexEnviv\0" "\0" - /* _mesa_function_pool[21039]: ColorFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[21124]: ColorFragmentOp1ATI (will be remapped) */ "iiiiiii\0" "glColorFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[21070]: GetUniformfvARB (will be remapped) */ + /* _mesa_function_pool[21155]: GetUniformfvARB (will be remapped) */ "iip\0" "glGetUniformfv\0" "glGetUniformfvARB\0" "\0" - /* _mesa_function_pool[21108]: EGLImageTargetRenderbufferStorageOES (will be remapped) */ + /* _mesa_function_pool[21193]: EGLImageTargetRenderbufferStorageOES (will be remapped) */ "ip\0" "glEGLImageTargetRenderbufferStorageOES\0" "\0" - /* _mesa_function_pool[21151]: PopClientAttrib (offset 334) */ + /* _mesa_function_pool[21236]: PopClientAttrib (offset 334) */ "\0" "glPopClientAttrib\0" "\0" - /* _mesa_function_pool[21171]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[21256]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffffff\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[21242]: DetachObjectARB (will be remapped) */ + /* _mesa_function_pool[21327]: DetachObjectARB (will be remapped) */ "ii\0" "glDetachObjectARB\0" "\0" - /* _mesa_function_pool[21264]: VertexBlendARB (dynamic) */ + /* _mesa_function_pool[21349]: VertexBlendARB (dynamic) */ "i\0" "glVertexBlendARB\0" "\0" - /* _mesa_function_pool[21284]: WindowPos3iMESA (will be remapped) */ + /* _mesa_function_pool[21369]: WindowPos3iMESA (will be remapped) */ "iii\0" "glWindowPos3i\0" "glWindowPos3iARB\0" "glWindowPos3iMESA\0" "\0" - /* _mesa_function_pool[21338]: SeparableFilter2D (offset 360) */ + /* _mesa_function_pool[21423]: SeparableFilter2D (offset 360) */ "iiiiiipp\0" "glSeparableFilter2D\0" "glSeparableFilter2DEXT\0" "\0" - /* _mesa_function_pool[21391]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[21476]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[21436]: Map1d (offset 220) */ + /* _mesa_function_pool[21521]: Map1d (offset 220) */ "iddiip\0" "glMap1d\0" "\0" - /* _mesa_function_pool[21452]: Map1f (offset 221) */ + /* _mesa_function_pool[21537]: Map1f (offset 221) */ "iffiip\0" "glMap1f\0" "\0" - /* _mesa_function_pool[21468]: CompressedTexImage2DARB (will be remapped) */ + /* _mesa_function_pool[21553]: CompressedTexImage2DARB (will be remapped) */ "iiiiiiip\0" "glCompressedTexImage2D\0" "glCompressedTexImage2DARB\0" "\0" - /* _mesa_function_pool[21527]: ArrayElement (offset 306) */ + /* _mesa_function_pool[21612]: ArrayElement (offset 306) */ "i\0" "glArrayElement\0" "glArrayElementEXT\0" "\0" - /* _mesa_function_pool[21563]: TexImage2D (offset 183) */ + /* _mesa_function_pool[21648]: TexImage2D (offset 183) */ "iiiiiiiip\0" "glTexImage2D\0" "\0" - /* _mesa_function_pool[21587]: DepthBoundsEXT (will be remapped) */ + /* _mesa_function_pool[21672]: DepthBoundsEXT (will be remapped) */ "dd\0" "glDepthBoundsEXT\0" "\0" - /* _mesa_function_pool[21608]: ProgramParameters4fvNV (will be remapped) */ + /* _mesa_function_pool[21693]: ProgramParameters4fvNV (will be remapped) */ "iiip\0" "glProgramParameters4fvNV\0" "\0" - /* _mesa_function_pool[21639]: DeformationMap3fSGIX (dynamic) */ + /* _mesa_function_pool[21724]: DeformationMap3fSGIX (dynamic) */ "iffiiffiiffiip\0" "glDeformationMap3fSGIX\0" "\0" - /* _mesa_function_pool[21678]: GetProgramivNV (will be remapped) */ + /* _mesa_function_pool[21763]: GetProgramivNV (will be remapped) */ "iip\0" "glGetProgramivNV\0" "\0" - /* _mesa_function_pool[21700]: GetMinmaxParameteriv (offset 366) */ + /* _mesa_function_pool[21785]: GetMinmaxParameteriv (offset 366) */ "iip\0" "glGetMinmaxParameteriv\0" "glGetMinmaxParameterivEXT\0" "\0" - /* _mesa_function_pool[21754]: PixelTransferf (offset 247) */ + /* _mesa_function_pool[21839]: PixelTransferf (offset 247) */ "if\0" "glPixelTransferf\0" "\0" - /* _mesa_function_pool[21775]: CopyTexImage1D (offset 323) */ + /* _mesa_function_pool[21860]: CopyTexImage1D (offset 323) */ "iiiiiii\0" "glCopyTexImage1D\0" "glCopyTexImage1DEXT\0" "\0" - /* _mesa_function_pool[21821]: PushMatrix (offset 298) */ + /* _mesa_function_pool[21906]: PushMatrix (offset 298) */ "\0" "glPushMatrix\0" "\0" - /* _mesa_function_pool[21836]: Fogiv (offset 156) */ + /* _mesa_function_pool[21921]: Fogiv (offset 156) */ "ip\0" "glFogiv\0" "\0" - /* _mesa_function_pool[21848]: TexCoord1dv (offset 95) */ + /* _mesa_function_pool[21933]: TexCoord1dv (offset 95) */ "p\0" "glTexCoord1dv\0" "\0" - /* _mesa_function_pool[21865]: AlphaFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[21950]: AlphaFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiii\0" "glAlphaFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[21901]: PixelTransferi (offset 248) */ + /* _mesa_function_pool[21986]: PixelTransferi (offset 248) */ "ii\0" "glPixelTransferi\0" "\0" - /* _mesa_function_pool[21922]: GetVertexAttribdvNV (will be remapped) */ + /* _mesa_function_pool[22007]: GetVertexAttribdvNV (will be remapped) */ "iip\0" "glGetVertexAttribdvNV\0" "\0" - /* _mesa_function_pool[21949]: VertexAttrib3fvNV (will be remapped) */ + /* _mesa_function_pool[22034]: VertexAttrib3fvNV (will be remapped) */ "ip\0" "glVertexAttrib3fvNV\0" "\0" - /* _mesa_function_pool[21973]: Rotatef (offset 300) */ + /* _mesa_function_pool[22058]: Rotatef (offset 300) */ "ffff\0" "glRotatef\0" "\0" - /* _mesa_function_pool[21989]: GetFinalCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[22074]: GetFinalCombinerInputParameterivNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[22031]: Vertex3i (offset 138) */ + /* _mesa_function_pool[22116]: Vertex3i (offset 138) */ "iii\0" "glVertex3i\0" "\0" - /* _mesa_function_pool[22047]: Vertex3f (offset 136) */ + /* _mesa_function_pool[22132]: Vertex3f (offset 136) */ "fff\0" "glVertex3f\0" "\0" - /* _mesa_function_pool[22063]: Clear (offset 203) */ + /* _mesa_function_pool[22148]: Clear (offset 203) */ "i\0" "glClear\0" "\0" - /* _mesa_function_pool[22074]: Vertex3d (offset 134) */ + /* _mesa_function_pool[22159]: Vertex3d (offset 134) */ "ddd\0" "glVertex3d\0" "\0" - /* _mesa_function_pool[22090]: GetMapParameterivNV (dynamic) */ + /* _mesa_function_pool[22175]: GetMapParameterivNV (dynamic) */ "iip\0" "glGetMapParameterivNV\0" "\0" - /* _mesa_function_pool[22117]: Uniform4iARB (will be remapped) */ + /* _mesa_function_pool[22202]: Uniform4iARB (will be remapped) */ "iiiii\0" "glUniform4i\0" "glUniform4iARB\0" "\0" - /* _mesa_function_pool[22151]: ReadBuffer (offset 254) */ + /* _mesa_function_pool[22236]: ReadBuffer (offset 254) */ "i\0" "glReadBuffer\0" "\0" - /* _mesa_function_pool[22167]: ConvolutionParameteri (offset 352) */ + /* _mesa_function_pool[22252]: ConvolutionParameteri (offset 352) */ "iii\0" "glConvolutionParameteri\0" "glConvolutionParameteriEXT\0" "\0" - /* _mesa_function_pool[22223]: Ortho (offset 296) */ + /* _mesa_function_pool[22308]: Ortho (offset 296) */ "dddddd\0" "glOrtho\0" "\0" - /* _mesa_function_pool[22239]: Binormal3sEXT (dynamic) */ + /* _mesa_function_pool[22324]: Binormal3sEXT (dynamic) */ "iii\0" "glBinormal3sEXT\0" "\0" - /* _mesa_function_pool[22260]: ListBase (offset 6) */ + /* _mesa_function_pool[22345]: ListBase (offset 6) */ "i\0" "glListBase\0" "\0" - /* _mesa_function_pool[22274]: Vertex3s (offset 140) */ + /* _mesa_function_pool[22359]: Vertex3s (offset 140) */ "iii\0" "glVertex3s\0" "\0" - /* _mesa_function_pool[22290]: ConvolutionParameterf (offset 350) */ + /* _mesa_function_pool[22375]: ConvolutionParameterf (offset 350) */ "iif\0" "glConvolutionParameterf\0" "glConvolutionParameterfEXT\0" "\0" - /* _mesa_function_pool[22346]: GetColorTableParameteriv (offset 345) */ + /* _mesa_function_pool[22431]: GetColorTableParameteriv (offset 345) */ "iip\0" "glGetColorTableParameteriv\0" "glGetColorTableParameterivSGI\0" "glGetColorTableParameterivEXT\0" "\0" - /* _mesa_function_pool[22438]: ProgramEnvParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[22523]: ProgramEnvParameter4dvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4dvARB\0" "glProgramParameter4dvNV\0" "\0" - /* _mesa_function_pool[22495]: ShadeModel (offset 177) */ + /* _mesa_function_pool[22580]: ShadeModel (offset 177) */ "i\0" "glShadeModel\0" "\0" - /* _mesa_function_pool[22511]: VertexAttribs2fvNV (will be remapped) */ + /* _mesa_function_pool[22596]: VertexAttribs2fvNV (will be remapped) */ "iip\0" "glVertexAttribs2fvNV\0" "\0" - /* _mesa_function_pool[22537]: Rectiv (offset 91) */ + /* _mesa_function_pool[22622]: Rectiv (offset 91) */ "pp\0" "glRectiv\0" "\0" - /* _mesa_function_pool[22550]: UseProgramObjectARB (will be remapped) */ + /* _mesa_function_pool[22635]: UseProgramObjectARB (will be remapped) */ "i\0" "glUseProgram\0" "glUseProgramObjectARB\0" "\0" - /* _mesa_function_pool[22588]: GetMapParameterfvNV (dynamic) */ + /* _mesa_function_pool[22673]: GetMapParameterfvNV (dynamic) */ "iip\0" "glGetMapParameterfvNV\0" "\0" - /* _mesa_function_pool[22615]: EndConditionalRenderNV (will be remapped) */ + /* _mesa_function_pool[22700]: EndConditionalRenderNV (will be remapped) */ "\0" "glEndConditionalRenderNV\0" "\0" - /* _mesa_function_pool[22642]: PassTexCoordATI (will be remapped) */ + /* _mesa_function_pool[22727]: PassTexCoordATI (will be remapped) */ "iii\0" "glPassTexCoordATI\0" "\0" - /* _mesa_function_pool[22665]: DeleteProgram (will be remapped) */ + /* _mesa_function_pool[22750]: DeleteProgram (will be remapped) */ "i\0" "glDeleteProgram\0" "\0" - /* _mesa_function_pool[22684]: Tangent3ivEXT (dynamic) */ + /* _mesa_function_pool[22769]: Tangent3ivEXT (dynamic) */ "p\0" "glTangent3ivEXT\0" "\0" - /* _mesa_function_pool[22703]: Tangent3dEXT (dynamic) */ + /* _mesa_function_pool[22788]: Tangent3dEXT (dynamic) */ "ddd\0" "glTangent3dEXT\0" "\0" - /* _mesa_function_pool[22723]: SecondaryColor3dvEXT (will be remapped) */ + /* _mesa_function_pool[22808]: SecondaryColor3dvEXT (will be remapped) */ "p\0" "glSecondaryColor3dv\0" "glSecondaryColor3dvEXT\0" "\0" - /* _mesa_function_pool[22769]: Vertex2fv (offset 129) */ + /* _mesa_function_pool[22854]: Vertex2fv (offset 129) */ "p\0" "glVertex2fv\0" "\0" - /* _mesa_function_pool[22784]: MultiDrawArraysEXT (will be remapped) */ + /* _mesa_function_pool[22869]: MultiDrawArraysEXT (will be remapped) */ "ippi\0" "glMultiDrawArrays\0" "glMultiDrawArraysEXT\0" "\0" - /* _mesa_function_pool[22829]: BindRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[22914]: BindRenderbufferEXT (will be remapped) */ "ii\0" "glBindRenderbuffer\0" "glBindRenderbufferEXT\0" "\0" - /* _mesa_function_pool[22874]: MultiTexCoord4dARB (offset 400) */ + /* _mesa_function_pool[22959]: MultiTexCoord4dARB (offset 400) */ "idddd\0" "glMultiTexCoord4d\0" "glMultiTexCoord4dARB\0" "\0" - /* _mesa_function_pool[22920]: Vertex3sv (offset 141) */ + /* _mesa_function_pool[23005]: Vertex3sv (offset 141) */ "p\0" "glVertex3sv\0" "\0" - /* _mesa_function_pool[22935]: SecondaryColor3usEXT (will be remapped) */ + /* _mesa_function_pool[23020]: SecondaryColor3usEXT (will be remapped) */ "iii\0" "glSecondaryColor3us\0" "glSecondaryColor3usEXT\0" "\0" - /* _mesa_function_pool[22983]: ProgramLocalParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[23068]: ProgramLocalParameter4fvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4fvARB\0" "\0" - /* _mesa_function_pool[23018]: DeleteProgramsNV (will be remapped) */ + /* _mesa_function_pool[23103]: DeleteProgramsNV (will be remapped) */ "ip\0" "glDeleteProgramsARB\0" "glDeleteProgramsNV\0" "\0" - /* _mesa_function_pool[23061]: EvalMesh1 (offset 236) */ + /* _mesa_function_pool[23146]: EvalMesh1 (offset 236) */ "iii\0" "glEvalMesh1\0" "\0" - /* _mesa_function_pool[23078]: MultiTexCoord1sARB (offset 382) */ + /* _mesa_function_pool[23163]: MultiTexCoord1sARB (offset 382) */ "ii\0" "glMultiTexCoord1s\0" "glMultiTexCoord1sARB\0" "\0" - /* _mesa_function_pool[23121]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[23206]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ "iffffff\0" "glReplacementCodeuiColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[23168]: GetVertexAttribPointervNV (will be remapped) */ + /* _mesa_function_pool[23253]: GetVertexAttribPointervNV (will be remapped) */ "iip\0" "glGetVertexAttribPointerv\0" "glGetVertexAttribPointervARB\0" "glGetVertexAttribPointervNV\0" "\0" - /* _mesa_function_pool[23256]: DisableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[23341]: DisableIndexedEXT (will be remapped) */ "ii\0" "glDisableIndexedEXT\0" "\0" - /* _mesa_function_pool[23280]: MultiTexCoord1dvARB (offset 377) */ + /* _mesa_function_pool[23365]: MultiTexCoord1dvARB (offset 377) */ "ip\0" "glMultiTexCoord1dv\0" "glMultiTexCoord1dvARB\0" "\0" - /* _mesa_function_pool[23325]: Uniform2iARB (will be remapped) */ + /* _mesa_function_pool[23410]: Uniform2iARB (will be remapped) */ "iii\0" "glUniform2i\0" "glUniform2iARB\0" "\0" - /* _mesa_function_pool[23357]: Vertex2iv (offset 131) */ + /* _mesa_function_pool[23442]: Vertex2iv (offset 131) */ "p\0" "glVertex2iv\0" "\0" - /* _mesa_function_pool[23372]: GetProgramStringNV (will be remapped) */ + /* _mesa_function_pool[23457]: GetProgramStringNV (will be remapped) */ "iip\0" "glGetProgramStringNV\0" "\0" - /* _mesa_function_pool[23398]: ColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[23483]: ColorPointerEXT (will be remapped) */ "iiiip\0" "glColorPointerEXT\0" "\0" - /* _mesa_function_pool[23423]: LineWidth (offset 168) */ + /* _mesa_function_pool[23508]: LineWidth (offset 168) */ "f\0" "glLineWidth\0" "\0" - /* _mesa_function_pool[23438]: MapBufferARB (will be remapped) */ + /* _mesa_function_pool[23523]: MapBufferARB (will be remapped) */ "ii\0" "glMapBuffer\0" "glMapBufferARB\0" "\0" - /* _mesa_function_pool[23469]: MultiDrawElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[23554]: MultiDrawElementsBaseVertex (will be remapped) */ "ipipip\0" "glMultiDrawElementsBaseVertex\0" "\0" - /* _mesa_function_pool[23507]: Binormal3svEXT (dynamic) */ + /* _mesa_function_pool[23592]: Binormal3svEXT (dynamic) */ "p\0" "glBinormal3svEXT\0" "\0" - /* _mesa_function_pool[23527]: ApplyTextureEXT (dynamic) */ + /* _mesa_function_pool[23612]: ApplyTextureEXT (dynamic) */ "i\0" "glApplyTextureEXT\0" "\0" - /* _mesa_function_pool[23548]: TexGendv (offset 189) */ + /* _mesa_function_pool[23633]: TexGendv (offset 189) */ "iip\0" "glTexGendv\0" "\0" - /* _mesa_function_pool[23564]: EnableIndexedEXT (will be remapped) */ + /* _mesa_function_pool[23649]: EnableIndexedEXT (will be remapped) */ "ii\0" "glEnableIndexedEXT\0" "\0" - /* _mesa_function_pool[23587]: TextureMaterialEXT (dynamic) */ + /* _mesa_function_pool[23672]: TextureMaterialEXT (dynamic) */ "ii\0" "glTextureMaterialEXT\0" "\0" - /* _mesa_function_pool[23612]: TextureLightEXT (dynamic) */ + /* _mesa_function_pool[23697]: TextureLightEXT (dynamic) */ "i\0" "glTextureLightEXT\0" "\0" - /* _mesa_function_pool[23633]: ResetMinmax (offset 370) */ + /* _mesa_function_pool[23718]: ResetMinmax (offset 370) */ "i\0" "glResetMinmax\0" "glResetMinmaxEXT\0" "\0" - /* _mesa_function_pool[23667]: SpriteParameterfSGIX (dynamic) */ + /* _mesa_function_pool[23752]: SpriteParameterfSGIX (dynamic) */ "if\0" "glSpriteParameterfSGIX\0" "\0" - /* _mesa_function_pool[23694]: EnableClientState (offset 313) */ + /* _mesa_function_pool[23779]: EnableClientState (offset 313) */ "i\0" "glEnableClientState\0" "\0" - /* _mesa_function_pool[23717]: VertexAttrib4sNV (will be remapped) */ + /* _mesa_function_pool[23802]: VertexAttrib4sNV (will be remapped) */ "iiiii\0" "glVertexAttrib4sNV\0" "\0" - /* _mesa_function_pool[23743]: GetConvolutionParameterfv (offset 357) */ + /* _mesa_function_pool[23828]: GetConvolutionParameterfv (offset 357) */ "iip\0" "glGetConvolutionParameterfv\0" "glGetConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[23807]: VertexAttribs4dvNV (will be remapped) */ + /* _mesa_function_pool[23892]: VertexAttribs4dvNV (will be remapped) */ "iip\0" "glVertexAttribs4dvNV\0" "\0" - /* _mesa_function_pool[23833]: MultiModeDrawArraysIBM (will be remapped) */ - "pppii\0" - "glMultiModeDrawArraysIBM\0" - "\0" - /* _mesa_function_pool[23865]: VertexAttrib4dARB (will be remapped) */ + /* _mesa_function_pool[23918]: VertexAttrib4dARB (will be remapped) */ "idddd\0" "glVertexAttrib4d\0" "glVertexAttrib4dARB\0" "\0" - /* _mesa_function_pool[23909]: GetTexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[23962]: GetTexBumpParameterfvATI (will be remapped) */ "ip\0" "glGetTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[23940]: ProgramNamedParameter4dNV (will be remapped) */ + /* _mesa_function_pool[23993]: ProgramNamedParameter4dNV (will be remapped) */ "iipdddd\0" "glProgramNamedParameter4dNV\0" "\0" - /* _mesa_function_pool[23977]: GetMaterialfv (offset 269) */ + /* _mesa_function_pool[24030]: GetMaterialfv (offset 269) */ "iip\0" "glGetMaterialfv\0" "\0" - /* _mesa_function_pool[23998]: VertexWeightfEXT (dynamic) */ + /* _mesa_function_pool[24051]: VertexWeightfEXT (dynamic) */ "f\0" "glVertexWeightfEXT\0" "\0" - /* _mesa_function_pool[24020]: Binormal3fEXT (dynamic) */ + /* _mesa_function_pool[24073]: Binormal3fEXT (dynamic) */ "fff\0" "glBinormal3fEXT\0" "\0" - /* _mesa_function_pool[24041]: CallList (offset 2) */ + /* _mesa_function_pool[24094]: CallList (offset 2) */ "i\0" "glCallList\0" "\0" - /* _mesa_function_pool[24055]: Materialfv (offset 170) */ + /* _mesa_function_pool[24108]: Materialfv (offset 170) */ "iip\0" "glMaterialfv\0" "\0" - /* _mesa_function_pool[24073]: TexCoord3fv (offset 113) */ + /* _mesa_function_pool[24126]: TexCoord3fv (offset 113) */ "p\0" "glTexCoord3fv\0" "\0" - /* _mesa_function_pool[24090]: FogCoordfvEXT (will be remapped) */ + /* _mesa_function_pool[24143]: FogCoordfvEXT (will be remapped) */ "p\0" "glFogCoordfv\0" "glFogCoordfvEXT\0" "\0" - /* _mesa_function_pool[24122]: MultiTexCoord1ivARB (offset 381) */ + /* _mesa_function_pool[24175]: MultiTexCoord1ivARB (offset 381) */ "ip\0" "glMultiTexCoord1iv\0" "glMultiTexCoord1ivARB\0" "\0" - /* _mesa_function_pool[24167]: SecondaryColor3ubEXT (will be remapped) */ + /* _mesa_function_pool[24220]: SecondaryColor3ubEXT (will be remapped) */ "iii\0" "glSecondaryColor3ub\0" "glSecondaryColor3ubEXT\0" "\0" - /* _mesa_function_pool[24215]: MultiTexCoord2ivARB (offset 389) */ + /* _mesa_function_pool[24268]: MultiTexCoord2ivARB (offset 389) */ "ip\0" "glMultiTexCoord2iv\0" "glMultiTexCoord2ivARB\0" "\0" - /* _mesa_function_pool[24260]: FogFuncSGIS (dynamic) */ + /* _mesa_function_pool[24313]: FogFuncSGIS (dynamic) */ "ip\0" "glFogFuncSGIS\0" "\0" - /* _mesa_function_pool[24278]: CopyTexSubImage2D (offset 326) */ + /* _mesa_function_pool[24331]: CopyTexSubImage2D (offset 326) */ "iiiiiiii\0" "glCopyTexSubImage2D\0" "glCopyTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[24331]: GetObjectParameterivARB (will be remapped) */ + /* _mesa_function_pool[24384]: GetObjectParameterivARB (will be remapped) */ "iip\0" "glGetObjectParameterivARB\0" "\0" - /* _mesa_function_pool[24362]: Color3iv (offset 16) */ + /* _mesa_function_pool[24415]: Color3iv (offset 16) */ "p\0" "glColor3iv\0" "\0" - /* _mesa_function_pool[24376]: TexCoord4fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[24429]: TexCoord4fVertex4fSUN (dynamic) */ "ffffffff\0" "glTexCoord4fVertex4fSUN\0" "\0" - /* _mesa_function_pool[24410]: DrawElements (offset 311) */ + /* _mesa_function_pool[24463]: DrawElements (offset 311) */ "iiip\0" "glDrawElements\0" "\0" - /* _mesa_function_pool[24431]: BindVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[24484]: BindVertexArrayAPPLE (will be remapped) */ "i\0" "glBindVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[24457]: GetProgramLocalParameterdvARB (will be remapped) */ + /* _mesa_function_pool[24510]: GetProgramLocalParameterdvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterdvARB\0" "\0" - /* _mesa_function_pool[24494]: GetHistogramParameteriv (offset 363) */ + /* _mesa_function_pool[24547]: GetHistogramParameteriv (offset 363) */ "iip\0" "glGetHistogramParameteriv\0" "glGetHistogramParameterivEXT\0" "\0" - /* _mesa_function_pool[24554]: MultiTexCoord1iARB (offset 380) */ + /* _mesa_function_pool[24607]: MultiTexCoord1iARB (offset 380) */ "ii\0" "glMultiTexCoord1i\0" "glMultiTexCoord1iARB\0" "\0" - /* _mesa_function_pool[24597]: GetConvolutionFilter (offset 356) */ + /* _mesa_function_pool[24650]: GetConvolutionFilter (offset 356) */ "iiip\0" "glGetConvolutionFilter\0" "glGetConvolutionFilterEXT\0" "\0" - /* _mesa_function_pool[24652]: GetProgramivARB (will be remapped) */ + /* _mesa_function_pool[24705]: GetProgramivARB (will be remapped) */ "iip\0" "glGetProgramivARB\0" "\0" - /* _mesa_function_pool[24675]: BlendFuncSeparateEXT (will be remapped) */ + /* _mesa_function_pool[24728]: BlendFuncSeparateEXT (will be remapped) */ "iiii\0" "glBlendFuncSeparate\0" "glBlendFuncSeparateEXT\0" "glBlendFuncSeparateINGR\0" "\0" - /* _mesa_function_pool[24748]: MapBufferRange (will be remapped) */ + /* _mesa_function_pool[24801]: MapBufferRange (will be remapped) */ "iiii\0" "glMapBufferRange\0" "\0" - /* _mesa_function_pool[24771]: ProgramParameters4dvNV (will be remapped) */ + /* _mesa_function_pool[24824]: ProgramParameters4dvNV (will be remapped) */ "iiip\0" "glProgramParameters4dvNV\0" "\0" - /* _mesa_function_pool[24802]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[24855]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[24839]: EvalPoint2 (offset 239) */ + /* _mesa_function_pool[24892]: EvalPoint2 (offset 239) */ "ii\0" "glEvalPoint2\0" "\0" - /* _mesa_function_pool[24856]: EvalPoint1 (offset 237) */ + /* _mesa_function_pool[24909]: EvalPoint1 (offset 237) */ "i\0" "glEvalPoint1\0" "\0" - /* _mesa_function_pool[24872]: Binormal3dvEXT (dynamic) */ + /* _mesa_function_pool[24925]: Binormal3dvEXT (dynamic) */ "p\0" "glBinormal3dvEXT\0" "\0" - /* _mesa_function_pool[24892]: PopMatrix (offset 297) */ + /* _mesa_function_pool[24945]: PopMatrix (offset 297) */ "\0" "glPopMatrix\0" "\0" - /* _mesa_function_pool[24906]: FinishFenceNV (will be remapped) */ + /* _mesa_function_pool[24959]: FinishFenceNV (will be remapped) */ "i\0" "glFinishFenceNV\0" "\0" - /* _mesa_function_pool[24925]: GetFogFuncSGIS (dynamic) */ + /* _mesa_function_pool[24978]: GetFogFuncSGIS (dynamic) */ "p\0" "glGetFogFuncSGIS\0" "\0" - /* _mesa_function_pool[24945]: GetUniformLocationARB (will be remapped) */ + /* _mesa_function_pool[24998]: GetUniformLocationARB (will be remapped) */ "ip\0" "glGetUniformLocation\0" "glGetUniformLocationARB\0" "\0" - /* _mesa_function_pool[24994]: SecondaryColor3fEXT (will be remapped) */ + /* _mesa_function_pool[25047]: SecondaryColor3fEXT (will be remapped) */ "fff\0" "glSecondaryColor3f\0" "glSecondaryColor3fEXT\0" "\0" - /* _mesa_function_pool[25040]: GetTexGeniv (offset 280) */ + /* _mesa_function_pool[25093]: GetTexGeniv (offset 280) */ "iip\0" "glGetTexGeniv\0" "\0" - /* _mesa_function_pool[25059]: CombinerInputNV (will be remapped) */ + /* _mesa_function_pool[25112]: CombinerInputNV (will be remapped) */ "iiiiii\0" "glCombinerInputNV\0" "\0" - /* _mesa_function_pool[25085]: VertexAttrib3sARB (will be remapped) */ + /* _mesa_function_pool[25138]: VertexAttrib3sARB (will be remapped) */ "iiii\0" "glVertexAttrib3s\0" "glVertexAttrib3sARB\0" "\0" - /* _mesa_function_pool[25128]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[25181]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[25173]: Map2d (offset 222) */ + /* _mesa_function_pool[25226]: Map2d (offset 222) */ "iddiiddiip\0" "glMap2d\0" "\0" - /* _mesa_function_pool[25193]: Map2f (offset 223) */ + /* _mesa_function_pool[25246]: Map2f (offset 223) */ "iffiiffiip\0" "glMap2f\0" "\0" - /* _mesa_function_pool[25213]: ProgramStringARB (will be remapped) */ + /* _mesa_function_pool[25266]: ProgramStringARB (will be remapped) */ "iiip\0" "glProgramStringARB\0" "\0" - /* _mesa_function_pool[25238]: Vertex4s (offset 148) */ + /* _mesa_function_pool[25291]: Vertex4s (offset 148) */ "iiii\0" "glVertex4s\0" "\0" - /* _mesa_function_pool[25255]: TexCoord4fVertex4fvSUN (dynamic) */ + /* _mesa_function_pool[25308]: TexCoord4fVertex4fvSUN (dynamic) */ "pp\0" "glTexCoord4fVertex4fvSUN\0" "\0" - /* _mesa_function_pool[25284]: VertexAttrib3sNV (will be remapped) */ + /* _mesa_function_pool[25337]: VertexAttrib3sNV (will be remapped) */ "iiii\0" "glVertexAttrib3sNV\0" "\0" - /* _mesa_function_pool[25309]: VertexAttrib1fNV (will be remapped) */ + /* _mesa_function_pool[25362]: VertexAttrib1fNV (will be remapped) */ "if\0" "glVertexAttrib1fNV\0" "\0" - /* _mesa_function_pool[25332]: Vertex4f (offset 144) */ + /* _mesa_function_pool[25385]: Vertex4f (offset 144) */ "ffff\0" "glVertex4f\0" "\0" - /* _mesa_function_pool[25349]: EvalCoord1d (offset 228) */ + /* _mesa_function_pool[25402]: EvalCoord1d (offset 228) */ "d\0" "glEvalCoord1d\0" "\0" - /* _mesa_function_pool[25366]: Vertex4d (offset 142) */ + /* _mesa_function_pool[25419]: Vertex4d (offset 142) */ "dddd\0" "glVertex4d\0" "\0" - /* _mesa_function_pool[25383]: RasterPos4dv (offset 79) */ + /* _mesa_function_pool[25436]: RasterPos4dv (offset 79) */ "p\0" "glRasterPos4dv\0" "\0" - /* _mesa_function_pool[25401]: FragmentLightfSGIX (dynamic) */ + /* _mesa_function_pool[25454]: FragmentLightfSGIX (dynamic) */ "iif\0" "glFragmentLightfSGIX\0" "\0" - /* _mesa_function_pool[25427]: GetCompressedTexImageARB (will be remapped) */ + /* _mesa_function_pool[25480]: GetCompressedTexImageARB (will be remapped) */ "iip\0" "glGetCompressedTexImage\0" "glGetCompressedTexImageARB\0" "\0" - /* _mesa_function_pool[25483]: GetTexGenfv (offset 279) */ + /* _mesa_function_pool[25536]: GetTexGenfv (offset 279) */ "iip\0" "glGetTexGenfv\0" "\0" - /* _mesa_function_pool[25502]: Vertex4i (offset 146) */ + /* _mesa_function_pool[25555]: Vertex4i (offset 146) */ "iiii\0" "glVertex4i\0" "\0" - /* _mesa_function_pool[25519]: VertexWeightPointerEXT (dynamic) */ + /* _mesa_function_pool[25572]: VertexWeightPointerEXT (dynamic) */ "iiip\0" "glVertexWeightPointerEXT\0" "\0" - /* _mesa_function_pool[25550]: GetHistogram (offset 361) */ + /* _mesa_function_pool[25603]: GetHistogram (offset 361) */ "iiiip\0" "glGetHistogram\0" "glGetHistogramEXT\0" "\0" - /* _mesa_function_pool[25590]: ActiveStencilFaceEXT (will be remapped) */ + /* _mesa_function_pool[25643]: ActiveStencilFaceEXT (will be remapped) */ "i\0" "glActiveStencilFaceEXT\0" "\0" - /* _mesa_function_pool[25616]: StencilFuncSeparateATI (will be remapped) */ + /* _mesa_function_pool[25669]: StencilFuncSeparateATI (will be remapped) */ "iiii\0" "glStencilFuncSeparateATI\0" "\0" - /* _mesa_function_pool[25647]: Materialf (offset 169) */ + /* _mesa_function_pool[25700]: Materialf (offset 169) */ "iif\0" "glMaterialf\0" "\0" - /* _mesa_function_pool[25664]: GetShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[25717]: GetShaderSourceARB (will be remapped) */ "iipp\0" "glGetShaderSource\0" "glGetShaderSourceARB\0" "\0" - /* _mesa_function_pool[25709]: IglooInterfaceSGIX (dynamic) */ + /* _mesa_function_pool[25762]: IglooInterfaceSGIX (dynamic) */ "ip\0" "glIglooInterfaceSGIX\0" "\0" - /* _mesa_function_pool[25734]: Materiali (offset 171) */ + /* _mesa_function_pool[25787]: Materiali (offset 171) */ "iii\0" "glMateriali\0" "\0" - /* _mesa_function_pool[25751]: VertexAttrib4dNV (will be remapped) */ + /* _mesa_function_pool[25804]: VertexAttrib4dNV (will be remapped) */ "idddd\0" "glVertexAttrib4dNV\0" "\0" - /* _mesa_function_pool[25777]: MultiModeDrawElementsIBM (will be remapped) */ + /* _mesa_function_pool[25830]: MultiModeDrawElementsIBM (will be remapped) */ "ppipii\0" "glMultiModeDrawElementsIBM\0" "\0" - /* _mesa_function_pool[25812]: Indexsv (offset 51) */ + /* _mesa_function_pool[25865]: Indexsv (offset 51) */ "p\0" "glIndexsv\0" "\0" - /* _mesa_function_pool[25825]: MultiTexCoord4svARB (offset 407) */ + /* _mesa_function_pool[25878]: MultiTexCoord4svARB (offset 407) */ "ip\0" "glMultiTexCoord4sv\0" "glMultiTexCoord4svARB\0" "\0" - /* _mesa_function_pool[25870]: LightModelfv (offset 164) */ + /* _mesa_function_pool[25923]: LightModelfv (offset 164) */ "ip\0" "glLightModelfv\0" "\0" - /* _mesa_function_pool[25889]: TexCoord2dv (offset 103) */ + /* _mesa_function_pool[25942]: TexCoord2dv (offset 103) */ "p\0" "glTexCoord2dv\0" "\0" - /* _mesa_function_pool[25906]: GenQueriesARB (will be remapped) */ + /* _mesa_function_pool[25959]: GenQueriesARB (will be remapped) */ "ip\0" "glGenQueries\0" "glGenQueriesARB\0" "\0" - /* _mesa_function_pool[25939]: EvalCoord1dv (offset 229) */ + /* _mesa_function_pool[25992]: EvalCoord1dv (offset 229) */ "p\0" "glEvalCoord1dv\0" "\0" - /* _mesa_function_pool[25957]: ReplacementCodeuiVertex3fSUN (dynamic) */ + /* _mesa_function_pool[26010]: ReplacementCodeuiVertex3fSUN (dynamic) */ "ifff\0" "glReplacementCodeuiVertex3fSUN\0" "\0" - /* _mesa_function_pool[25994]: Translated (offset 303) */ + /* _mesa_function_pool[26047]: Translated (offset 303) */ "ddd\0" "glTranslated\0" "\0" - /* _mesa_function_pool[26012]: Translatef (offset 304) */ + /* _mesa_function_pool[26065]: Translatef (offset 304) */ "fff\0" "glTranslatef\0" "\0" - /* _mesa_function_pool[26030]: StencilMask (offset 209) */ + /* _mesa_function_pool[26083]: StencilMask (offset 209) */ "i\0" "glStencilMask\0" "\0" - /* _mesa_function_pool[26047]: Tangent3iEXT (dynamic) */ + /* _mesa_function_pool[26100]: Tangent3iEXT (dynamic) */ "iii\0" "glTangent3iEXT\0" "\0" - /* _mesa_function_pool[26067]: GetLightiv (offset 265) */ + /* _mesa_function_pool[26120]: GetLightiv (offset 265) */ "iip\0" "glGetLightiv\0" "\0" - /* _mesa_function_pool[26085]: DrawMeshArraysSUN (dynamic) */ + /* _mesa_function_pool[26138]: DrawMeshArraysSUN (dynamic) */ "iiii\0" "glDrawMeshArraysSUN\0" "\0" - /* _mesa_function_pool[26111]: IsList (offset 287) */ + /* _mesa_function_pool[26164]: IsList (offset 287) */ "i\0" "glIsList\0" "\0" - /* _mesa_function_pool[26123]: IsSync (will be remapped) */ + /* _mesa_function_pool[26176]: IsSync (will be remapped) */ "i\0" "glIsSync\0" "\0" - /* _mesa_function_pool[26135]: RenderMode (offset 196) */ + /* _mesa_function_pool[26188]: RenderMode (offset 196) */ "i\0" "glRenderMode\0" "\0" - /* _mesa_function_pool[26151]: GetMapControlPointsNV (dynamic) */ + /* _mesa_function_pool[26204]: GetMapControlPointsNV (dynamic) */ "iiiiiip\0" "glGetMapControlPointsNV\0" "\0" - /* _mesa_function_pool[26184]: DrawBuffersARB (will be remapped) */ + /* _mesa_function_pool[26237]: DrawBuffersARB (will be remapped) */ "ip\0" "glDrawBuffers\0" "glDrawBuffersARB\0" "glDrawBuffersATI\0" "\0" - /* _mesa_function_pool[26236]: ProgramLocalParameter4fARB (will be remapped) */ + /* _mesa_function_pool[26289]: ProgramLocalParameter4fARB (will be remapped) */ "iiffff\0" "glProgramLocalParameter4fARB\0" "\0" - /* _mesa_function_pool[26273]: SpriteParameterivSGIX (dynamic) */ + /* _mesa_function_pool[26326]: SpriteParameterivSGIX (dynamic) */ "ip\0" "glSpriteParameterivSGIX\0" "\0" - /* _mesa_function_pool[26301]: ProvokingVertexEXT (will be remapped) */ + /* _mesa_function_pool[26354]: ProvokingVertexEXT (will be remapped) */ "i\0" "glProvokingVertexEXT\0" "glProvokingVertex\0" "\0" - /* _mesa_function_pool[26343]: MultiTexCoord1fARB (offset 378) */ + /* _mesa_function_pool[26396]: MultiTexCoord1fARB (offset 378) */ "if\0" "glMultiTexCoord1f\0" "glMultiTexCoord1fARB\0" "\0" - /* _mesa_function_pool[26386]: LoadName (offset 198) */ + /* _mesa_function_pool[26439]: LoadName (offset 198) */ "i\0" "glLoadName\0" "\0" - /* _mesa_function_pool[26400]: VertexAttribs4ubvNV (will be remapped) */ + /* _mesa_function_pool[26453]: VertexAttribs4ubvNV (will be remapped) */ "iip\0" "glVertexAttribs4ubvNV\0" "\0" - /* _mesa_function_pool[26427]: WeightsvARB (dynamic) */ + /* _mesa_function_pool[26480]: WeightsvARB (dynamic) */ "ip\0" "glWeightsvARB\0" "\0" - /* _mesa_function_pool[26445]: Uniform1fvARB (will be remapped) */ + /* _mesa_function_pool[26498]: Uniform1fvARB (will be remapped) */ "iip\0" "glUniform1fv\0" "glUniform1fvARB\0" "\0" - /* _mesa_function_pool[26479]: CopyTexSubImage1D (offset 325) */ + /* _mesa_function_pool[26532]: CopyTexSubImage1D (offset 325) */ "iiiiii\0" "glCopyTexSubImage1D\0" "glCopyTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[26530]: CullFace (offset 152) */ + /* _mesa_function_pool[26583]: CullFace (offset 152) */ "i\0" "glCullFace\0" "\0" - /* _mesa_function_pool[26544]: BindTexture (offset 307) */ + /* _mesa_function_pool[26597]: BindTexture (offset 307) */ "ii\0" "glBindTexture\0" "glBindTextureEXT\0" "\0" - /* _mesa_function_pool[26579]: BeginFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[26632]: BeginFragmentShaderATI (will be remapped) */ "\0" "glBeginFragmentShaderATI\0" "\0" - /* _mesa_function_pool[26606]: MultiTexCoord4fARB (offset 402) */ + /* _mesa_function_pool[26659]: MultiTexCoord4fARB (offset 402) */ "iffff\0" "glMultiTexCoord4f\0" "glMultiTexCoord4fARB\0" "\0" - /* _mesa_function_pool[26652]: VertexAttribs3svNV (will be remapped) */ + /* _mesa_function_pool[26705]: VertexAttribs3svNV (will be remapped) */ "iip\0" "glVertexAttribs3svNV\0" "\0" - /* _mesa_function_pool[26678]: StencilFunc (offset 243) */ + /* _mesa_function_pool[26731]: StencilFunc (offset 243) */ "iii\0" "glStencilFunc\0" "\0" - /* _mesa_function_pool[26697]: CopyPixels (offset 255) */ + /* _mesa_function_pool[26750]: CopyPixels (offset 255) */ "iiiii\0" "glCopyPixels\0" "\0" - /* _mesa_function_pool[26717]: Rectsv (offset 93) */ + /* _mesa_function_pool[26770]: Rectsv (offset 93) */ "pp\0" "glRectsv\0" "\0" - /* _mesa_function_pool[26730]: ReplacementCodeuivSUN (dynamic) */ + /* _mesa_function_pool[26783]: ReplacementCodeuivSUN (dynamic) */ "p\0" "glReplacementCodeuivSUN\0" "\0" - /* _mesa_function_pool[26757]: EnableVertexAttribArrayARB (will be remapped) */ + /* _mesa_function_pool[26810]: EnableVertexAttribArrayARB (will be remapped) */ "i\0" "glEnableVertexAttribArray\0" "glEnableVertexAttribArrayARB\0" "\0" - /* _mesa_function_pool[26815]: NormalPointervINTEL (dynamic) */ + /* _mesa_function_pool[26868]: NormalPointervINTEL (dynamic) */ "ip\0" "glNormalPointervINTEL\0" "\0" - /* _mesa_function_pool[26841]: CopyConvolutionFilter2D (offset 355) */ + /* _mesa_function_pool[26894]: CopyConvolutionFilter2D (offset 355) */ "iiiiii\0" "glCopyConvolutionFilter2D\0" "glCopyConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[26904]: WindowPos3ivMESA (will be remapped) */ + /* _mesa_function_pool[26957]: WindowPos3ivMESA (will be remapped) */ "p\0" "glWindowPos3iv\0" "glWindowPos3ivARB\0" "glWindowPos3ivMESA\0" "\0" - /* _mesa_function_pool[26959]: CopyBufferSubData (will be remapped) */ + /* _mesa_function_pool[27012]: CopyBufferSubData (will be remapped) */ "iiiii\0" "glCopyBufferSubData\0" "\0" - /* _mesa_function_pool[26986]: NormalPointer (offset 318) */ + /* _mesa_function_pool[27039]: NormalPointer (offset 318) */ "iip\0" "glNormalPointer\0" "\0" - /* _mesa_function_pool[27007]: TexParameterfv (offset 179) */ + /* _mesa_function_pool[27060]: TexParameterfv (offset 179) */ "iip\0" "glTexParameterfv\0" "\0" - /* _mesa_function_pool[27029]: IsBufferARB (will be remapped) */ + /* _mesa_function_pool[27082]: IsBufferARB (will be remapped) */ "i\0" "glIsBuffer\0" "glIsBufferARB\0" "\0" - /* _mesa_function_pool[27057]: WindowPos4iMESA (will be remapped) */ + /* _mesa_function_pool[27110]: WindowPos4iMESA (will be remapped) */ "iiii\0" "glWindowPos4iMESA\0" "\0" - /* _mesa_function_pool[27081]: VertexAttrib4uivARB (will be remapped) */ + /* _mesa_function_pool[27134]: VertexAttrib4uivARB (will be remapped) */ "ip\0" "glVertexAttrib4uiv\0" "glVertexAttrib4uivARB\0" "\0" - /* _mesa_function_pool[27126]: Tangent3bvEXT (dynamic) */ + /* _mesa_function_pool[27179]: Tangent3bvEXT (dynamic) */ "p\0" "glTangent3bvEXT\0" "\0" - /* _mesa_function_pool[27145]: UniformMatrix3x4fv (will be remapped) */ + /* _mesa_function_pool[27198]: UniformMatrix3x4fv (will be remapped) */ "iiip\0" "glUniformMatrix3x4fv\0" "\0" - /* _mesa_function_pool[27172]: ClipPlane (offset 150) */ + /* _mesa_function_pool[27225]: ClipPlane (offset 150) */ "ip\0" "glClipPlane\0" "\0" - /* _mesa_function_pool[27188]: Recti (offset 90) */ + /* _mesa_function_pool[27241]: Recti (offset 90) */ "iiii\0" "glRecti\0" "\0" - /* _mesa_function_pool[27202]: DrawRangeElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[27255]: DrawRangeElementsBaseVertex (will be remapped) */ "iiiiipi\0" "glDrawRangeElementsBaseVertex\0" "\0" - /* _mesa_function_pool[27241]: TexCoordPointervINTEL (dynamic) */ + /* _mesa_function_pool[27294]: TexCoordPointervINTEL (dynamic) */ "iip\0" "glTexCoordPointervINTEL\0" "\0" - /* _mesa_function_pool[27270]: DeleteBuffersARB (will be remapped) */ + /* _mesa_function_pool[27323]: DeleteBuffersARB (will be remapped) */ "ip\0" "glDeleteBuffers\0" "glDeleteBuffersARB\0" "\0" - /* _mesa_function_pool[27309]: WindowPos4fvMESA (will be remapped) */ + /* _mesa_function_pool[27362]: WindowPos4fvMESA (will be remapped) */ "p\0" "glWindowPos4fvMESA\0" "\0" - /* _mesa_function_pool[27331]: GetPixelMapuiv (offset 272) */ + /* _mesa_function_pool[27384]: GetPixelMapuiv (offset 272) */ "ip\0" "glGetPixelMapuiv\0" "\0" - /* _mesa_function_pool[27352]: Rectf (offset 88) */ + /* _mesa_function_pool[27405]: Rectf (offset 88) */ "ffff\0" "glRectf\0" "\0" - /* _mesa_function_pool[27366]: VertexAttrib1sNV (will be remapped) */ + /* _mesa_function_pool[27419]: VertexAttrib1sNV (will be remapped) */ "ii\0" "glVertexAttrib1sNV\0" "\0" - /* _mesa_function_pool[27389]: Indexfv (offset 47) */ + /* _mesa_function_pool[27442]: Indexfv (offset 47) */ "p\0" "glIndexfv\0" "\0" - /* _mesa_function_pool[27402]: SecondaryColor3svEXT (will be remapped) */ + /* _mesa_function_pool[27455]: SecondaryColor3svEXT (will be remapped) */ "p\0" "glSecondaryColor3sv\0" "glSecondaryColor3svEXT\0" "\0" - /* _mesa_function_pool[27448]: LoadTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[27501]: LoadTransposeMatrixfARB (will be remapped) */ "p\0" "glLoadTransposeMatrixf\0" "glLoadTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[27500]: GetPointerv (offset 329) */ + /* _mesa_function_pool[27553]: GetPointerv (offset 329) */ "ip\0" "glGetPointerv\0" "glGetPointervEXT\0" "\0" - /* _mesa_function_pool[27535]: Tangent3bEXT (dynamic) */ + /* _mesa_function_pool[27588]: Tangent3bEXT (dynamic) */ "iii\0" "glTangent3bEXT\0" "\0" - /* _mesa_function_pool[27555]: CombinerParameterfNV (will be remapped) */ + /* _mesa_function_pool[27608]: CombinerParameterfNV (will be remapped) */ "if\0" "glCombinerParameterfNV\0" "\0" - /* _mesa_function_pool[27582]: IndexMask (offset 212) */ + /* _mesa_function_pool[27635]: IndexMask (offset 212) */ "i\0" "glIndexMask\0" "\0" - /* _mesa_function_pool[27597]: BindProgramNV (will be remapped) */ + /* _mesa_function_pool[27650]: BindProgramNV (will be remapped) */ "ii\0" "glBindProgramARB\0" "glBindProgramNV\0" "\0" - /* _mesa_function_pool[27634]: VertexAttrib4svARB (will be remapped) */ + /* _mesa_function_pool[27687]: VertexAttrib4svARB (will be remapped) */ "ip\0" "glVertexAttrib4sv\0" "glVertexAttrib4svARB\0" "\0" - /* _mesa_function_pool[27677]: GetFloatv (offset 262) */ + /* _mesa_function_pool[27730]: GetFloatv (offset 262) */ "ip\0" "glGetFloatv\0" "\0" - /* _mesa_function_pool[27693]: CreateDebugObjectMESA (dynamic) */ + /* _mesa_function_pool[27746]: CreateDebugObjectMESA (dynamic) */ "\0" "glCreateDebugObjectMESA\0" "\0" - /* _mesa_function_pool[27719]: GetShaderiv (will be remapped) */ + /* _mesa_function_pool[27772]: GetShaderiv (will be remapped) */ "iip\0" "glGetShaderiv\0" "\0" - /* _mesa_function_pool[27738]: ClientWaitSync (will be remapped) */ + /* _mesa_function_pool[27791]: ClientWaitSync (will be remapped) */ "iii\0" "glClientWaitSync\0" "\0" - /* _mesa_function_pool[27760]: TexCoord4s (offset 124) */ + /* _mesa_function_pool[27813]: TexCoord4s (offset 124) */ "iiii\0" "glTexCoord4s\0" "\0" - /* _mesa_function_pool[27779]: TexCoord3sv (offset 117) */ + /* _mesa_function_pool[27832]: TexCoord3sv (offset 117) */ "p\0" "glTexCoord3sv\0" "\0" - /* _mesa_function_pool[27796]: BindFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[27849]: BindFragmentShaderATI (will be remapped) */ "i\0" "glBindFragmentShaderATI\0" "\0" - /* _mesa_function_pool[27823]: PopAttrib (offset 218) */ + /* _mesa_function_pool[27876]: PopAttrib (offset 218) */ "\0" "glPopAttrib\0" "\0" - /* _mesa_function_pool[27837]: Fogfv (offset 154) */ + /* _mesa_function_pool[27890]: Fogfv (offset 154) */ "ip\0" "glFogfv\0" "\0" - /* _mesa_function_pool[27849]: UnmapBufferARB (will be remapped) */ + /* _mesa_function_pool[27902]: UnmapBufferARB (will be remapped) */ "i\0" "glUnmapBuffer\0" "glUnmapBufferARB\0" "\0" - /* _mesa_function_pool[27883]: InitNames (offset 197) */ + /* _mesa_function_pool[27936]: InitNames (offset 197) */ "\0" "glInitNames\0" "\0" - /* _mesa_function_pool[27897]: Normal3sv (offset 61) */ + /* _mesa_function_pool[27950]: Normal3sv (offset 61) */ "p\0" "glNormal3sv\0" "\0" - /* _mesa_function_pool[27912]: Minmax (offset 368) */ + /* _mesa_function_pool[27965]: Minmax (offset 368) */ "iii\0" "glMinmax\0" "glMinmaxEXT\0" "\0" - /* _mesa_function_pool[27938]: TexCoord4d (offset 118) */ + /* _mesa_function_pool[27991]: TexCoord4d (offset 118) */ "dddd\0" "glTexCoord4d\0" "\0" - /* _mesa_function_pool[27957]: TexCoord4f (offset 120) */ + /* _mesa_function_pool[28010]: DeformationMap3dSGIX (dynamic) */ + "iddiiddiiddiip\0" + "glDeformationMap3dSGIX\0" + "\0" + /* _mesa_function_pool[28049]: TexCoord4f (offset 120) */ "ffff\0" "glTexCoord4f\0" "\0" - /* _mesa_function_pool[27976]: FogCoorddvEXT (will be remapped) */ + /* _mesa_function_pool[28068]: FogCoorddvEXT (will be remapped) */ "p\0" "glFogCoorddv\0" "glFogCoorddvEXT\0" "\0" - /* _mesa_function_pool[28008]: FinishTextureSUNX (dynamic) */ + /* _mesa_function_pool[28100]: FinishTextureSUNX (dynamic) */ "\0" "glFinishTextureSUNX\0" "\0" - /* _mesa_function_pool[28030]: GetFragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[28122]: GetFragmentLightfvSGIX (dynamic) */ "iip\0" "glGetFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[28060]: Binormal3fvEXT (dynamic) */ + /* _mesa_function_pool[28152]: Binormal3fvEXT (dynamic) */ "p\0" "glBinormal3fvEXT\0" "\0" - /* _mesa_function_pool[28080]: GetBooleanv (offset 258) */ + /* _mesa_function_pool[28172]: GetBooleanv (offset 258) */ "ip\0" "glGetBooleanv\0" "\0" - /* _mesa_function_pool[28098]: ColorFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[28190]: ColorFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiiii\0" "glColorFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[28135]: Hint (offset 158) */ + /* _mesa_function_pool[28227]: Hint (offset 158) */ "ii\0" "glHint\0" "\0" - /* _mesa_function_pool[28146]: Color4dv (offset 28) */ + /* _mesa_function_pool[28238]: Color4dv (offset 28) */ "p\0" "glColor4dv\0" "\0" - /* _mesa_function_pool[28160]: VertexAttrib2svARB (will be remapped) */ + /* _mesa_function_pool[28252]: VertexAttrib2svARB (will be remapped) */ "ip\0" "glVertexAttrib2sv\0" "glVertexAttrib2svARB\0" "\0" - /* _mesa_function_pool[28203]: AreProgramsResidentNV (will be remapped) */ + /* _mesa_function_pool[28295]: AreProgramsResidentNV (will be remapped) */ "ipp\0" "glAreProgramsResidentNV\0" "\0" - /* _mesa_function_pool[28232]: WindowPos3svMESA (will be remapped) */ + /* _mesa_function_pool[28324]: WindowPos3svMESA (will be remapped) */ "p\0" "glWindowPos3sv\0" "glWindowPos3svARB\0" "glWindowPos3svMESA\0" "\0" - /* _mesa_function_pool[28287]: CopyColorSubTable (offset 347) */ + /* _mesa_function_pool[28379]: CopyColorSubTable (offset 347) */ "iiiii\0" "glCopyColorSubTable\0" "glCopyColorSubTableEXT\0" "\0" - /* _mesa_function_pool[28337]: WeightdvARB (dynamic) */ + /* _mesa_function_pool[28429]: WeightdvARB (dynamic) */ "ip\0" "glWeightdvARB\0" "\0" - /* _mesa_function_pool[28355]: DeleteRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[28447]: DeleteRenderbuffersEXT (will be remapped) */ "ip\0" "glDeleteRenderbuffers\0" "glDeleteRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[28406]: VertexAttrib4NubvARB (will be remapped) */ + /* _mesa_function_pool[28498]: VertexAttrib4NubvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nubv\0" "glVertexAttrib4NubvARB\0" "\0" - /* _mesa_function_pool[28453]: VertexAttrib3dvNV (will be remapped) */ + /* _mesa_function_pool[28545]: VertexAttrib3dvNV (will be remapped) */ "ip\0" "glVertexAttrib3dvNV\0" "\0" - /* _mesa_function_pool[28477]: GetObjectParameterfvARB (will be remapped) */ + /* _mesa_function_pool[28569]: GetObjectParameterfvARB (will be remapped) */ "iip\0" "glGetObjectParameterfvARB\0" "\0" - /* _mesa_function_pool[28508]: Vertex4iv (offset 147) */ + /* _mesa_function_pool[28600]: Vertex4iv (offset 147) */ "p\0" "glVertex4iv\0" "\0" - /* _mesa_function_pool[28523]: GetProgramEnvParameterdvARB (will be remapped) */ + /* _mesa_function_pool[28615]: GetProgramEnvParameterdvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterdvARB\0" "\0" - /* _mesa_function_pool[28558]: TexCoord4dv (offset 119) */ + /* _mesa_function_pool[28650]: TexCoord4dv (offset 119) */ "p\0" "glTexCoord4dv\0" "\0" - /* _mesa_function_pool[28575]: LockArraysEXT (will be remapped) */ + /* _mesa_function_pool[28667]: LockArraysEXT (will be remapped) */ "ii\0" "glLockArraysEXT\0" "\0" - /* _mesa_function_pool[28595]: Begin (offset 7) */ + /* _mesa_function_pool[28687]: Begin (offset 7) */ "i\0" "glBegin\0" "\0" - /* _mesa_function_pool[28606]: LightModeli (offset 165) */ + /* _mesa_function_pool[28698]: LightModeli (offset 165) */ "ii\0" "glLightModeli\0" "\0" - /* _mesa_function_pool[28624]: Rectfv (offset 89) */ + /* _mesa_function_pool[28716]: Rectfv (offset 89) */ "pp\0" "glRectfv\0" "\0" - /* _mesa_function_pool[28637]: LightModelf (offset 163) */ + /* _mesa_function_pool[28729]: LightModelf (offset 163) */ "if\0" "glLightModelf\0" "\0" - /* _mesa_function_pool[28655]: GetTexParameterfv (offset 282) */ + /* _mesa_function_pool[28747]: GetTexParameterfv (offset 282) */ "iip\0" "glGetTexParameterfv\0" "\0" - /* _mesa_function_pool[28680]: GetLightfv (offset 264) */ + /* _mesa_function_pool[28772]: GetLightfv (offset 264) */ "iip\0" "glGetLightfv\0" "\0" - /* _mesa_function_pool[28698]: PixelTransformParameterivEXT (dynamic) */ + /* _mesa_function_pool[28790]: PixelTransformParameterivEXT (dynamic) */ "iip\0" "glPixelTransformParameterivEXT\0" "\0" - /* _mesa_function_pool[28734]: BinormalPointerEXT (dynamic) */ + /* _mesa_function_pool[28826]: BinormalPointerEXT (dynamic) */ "iip\0" "glBinormalPointerEXT\0" "\0" - /* _mesa_function_pool[28760]: VertexAttrib1dNV (will be remapped) */ + /* _mesa_function_pool[28852]: VertexAttrib1dNV (will be remapped) */ "id\0" "glVertexAttrib1dNV\0" "\0" - /* _mesa_function_pool[28783]: GetCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[28875]: GetCombinerInputParameterivNV (will be remapped) */ "iiiip\0" "glGetCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[28822]: Disable (offset 214) */ + /* _mesa_function_pool[28914]: Disable (offset 214) */ "i\0" "glDisable\0" "\0" - /* _mesa_function_pool[28835]: MultiTexCoord2fvARB (offset 387) */ + /* _mesa_function_pool[28927]: MultiTexCoord2fvARB (offset 387) */ "ip\0" "glMultiTexCoord2fv\0" "glMultiTexCoord2fvARB\0" "\0" - /* _mesa_function_pool[28880]: GetRenderbufferParameterivEXT (will be remapped) */ + /* _mesa_function_pool[28972]: GetRenderbufferParameterivEXT (will be remapped) */ "iip\0" "glGetRenderbufferParameteriv\0" "glGetRenderbufferParameterivEXT\0" "\0" - /* _mesa_function_pool[28946]: CombinerParameterivNV (will be remapped) */ + /* _mesa_function_pool[29038]: CombinerParameterivNV (will be remapped) */ "ip\0" "glCombinerParameterivNV\0" "\0" - /* _mesa_function_pool[28974]: GenFragmentShadersATI (will be remapped) */ + /* _mesa_function_pool[29066]: GenFragmentShadersATI (will be remapped) */ "i\0" "glGenFragmentShadersATI\0" "\0" - /* _mesa_function_pool[29001]: DrawArrays (offset 310) */ + /* _mesa_function_pool[29093]: DrawArrays (offset 310) */ "iii\0" "glDrawArrays\0" "glDrawArraysEXT\0" "\0" - /* _mesa_function_pool[29035]: WeightuivARB (dynamic) */ + /* _mesa_function_pool[29127]: WeightuivARB (dynamic) */ "ip\0" "glWeightuivARB\0" "\0" - /* _mesa_function_pool[29054]: VertexAttrib2sARB (will be remapped) */ + /* _mesa_function_pool[29146]: VertexAttrib2sARB (will be remapped) */ "iii\0" "glVertexAttrib2s\0" "glVertexAttrib2sARB\0" "\0" - /* _mesa_function_pool[29096]: ColorMask (offset 210) */ + /* _mesa_function_pool[29188]: ColorMask (offset 210) */ "iiii\0" "glColorMask\0" "\0" - /* _mesa_function_pool[29114]: GenAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[29206]: GenAsyncMarkersSGIX (dynamic) */ "i\0" "glGenAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[29139]: Tangent3svEXT (dynamic) */ + /* _mesa_function_pool[29231]: Tangent3svEXT (dynamic) */ "p\0" "glTangent3svEXT\0" "\0" - /* _mesa_function_pool[29158]: GetListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[29250]: GetListParameterivSGIX (dynamic) */ "iip\0" "glGetListParameterivSGIX\0" "\0" - /* _mesa_function_pool[29188]: BindBufferARB (will be remapped) */ + /* _mesa_function_pool[29280]: BindBufferARB (will be remapped) */ "ii\0" "glBindBuffer\0" "glBindBufferARB\0" "\0" - /* _mesa_function_pool[29221]: GetInfoLogARB (will be remapped) */ + /* _mesa_function_pool[29313]: GetInfoLogARB (will be remapped) */ "iipp\0" "glGetInfoLogARB\0" "\0" - /* _mesa_function_pool[29243]: RasterPos4iv (offset 83) */ + /* _mesa_function_pool[29335]: RasterPos4iv (offset 83) */ "p\0" "glRasterPos4iv\0" "\0" - /* _mesa_function_pool[29261]: Enable (offset 215) */ + /* _mesa_function_pool[29353]: Enable (offset 215) */ "i\0" "glEnable\0" "\0" - /* _mesa_function_pool[29273]: LineStipple (offset 167) */ + /* _mesa_function_pool[29365]: LineStipple (offset 167) */ "ii\0" "glLineStipple\0" "\0" - /* _mesa_function_pool[29291]: VertexAttribs4svNV (will be remapped) */ + /* _mesa_function_pool[29383]: VertexAttribs4svNV (will be remapped) */ "iip\0" "glVertexAttribs4svNV\0" "\0" - /* _mesa_function_pool[29317]: EdgeFlagPointerListIBM (dynamic) */ + /* _mesa_function_pool[29409]: EdgeFlagPointerListIBM (dynamic) */ "ipi\0" "glEdgeFlagPointerListIBM\0" "\0" - /* _mesa_function_pool[29347]: UniformMatrix3x2fv (will be remapped) */ + /* _mesa_function_pool[29439]: UniformMatrix3x2fv (will be remapped) */ "iiip\0" "glUniformMatrix3x2fv\0" "\0" - /* _mesa_function_pool[29374]: GetMinmaxParameterfv (offset 365) */ + /* _mesa_function_pool[29466]: GetMinmaxParameterfv (offset 365) */ "iip\0" "glGetMinmaxParameterfv\0" "glGetMinmaxParameterfvEXT\0" "\0" - /* _mesa_function_pool[29428]: VertexAttrib1fvARB (will be remapped) */ + /* _mesa_function_pool[29520]: VertexAttrib1fvARB (will be remapped) */ "ip\0" "glVertexAttrib1fv\0" "glVertexAttrib1fvARB\0" "\0" - /* _mesa_function_pool[29471]: GenBuffersARB (will be remapped) */ + /* _mesa_function_pool[29563]: GenBuffersARB (will be remapped) */ "ip\0" "glGenBuffers\0" "glGenBuffersARB\0" "\0" - /* _mesa_function_pool[29504]: VertexAttribs1svNV (will be remapped) */ + /* _mesa_function_pool[29596]: VertexAttribs1svNV (will be remapped) */ "iip\0" "glVertexAttribs1svNV\0" "\0" - /* _mesa_function_pool[29530]: Vertex3fv (offset 137) */ + /* _mesa_function_pool[29622]: Vertex3fv (offset 137) */ "p\0" "glVertex3fv\0" "\0" - /* _mesa_function_pool[29545]: GetTexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[29637]: GetTexBumpParameterivATI (will be remapped) */ "ip\0" "glGetTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[29576]: Binormal3bEXT (dynamic) */ + /* _mesa_function_pool[29668]: Binormal3bEXT (dynamic) */ "iii\0" "glBinormal3bEXT\0" "\0" - /* _mesa_function_pool[29597]: FragmentMaterialivSGIX (dynamic) */ + /* _mesa_function_pool[29689]: FragmentMaterialivSGIX (dynamic) */ "iip\0" "glFragmentMaterialivSGIX\0" "\0" - /* _mesa_function_pool[29627]: IsRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[29719]: IsRenderbufferEXT (will be remapped) */ "i\0" "glIsRenderbuffer\0" "glIsRenderbufferEXT\0" "\0" - /* _mesa_function_pool[29667]: GenProgramsNV (will be remapped) */ + /* _mesa_function_pool[29759]: GenProgramsNV (will be remapped) */ "ip\0" "glGenProgramsARB\0" "glGenProgramsNV\0" "\0" - /* _mesa_function_pool[29704]: VertexAttrib4dvNV (will be remapped) */ + /* _mesa_function_pool[29796]: VertexAttrib4dvNV (will be remapped) */ "ip\0" "glVertexAttrib4dvNV\0" "\0" - /* _mesa_function_pool[29728]: EndFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[29820]: EndFragmentShaderATI (will be remapped) */ "\0" "glEndFragmentShaderATI\0" "\0" - /* _mesa_function_pool[29753]: Binormal3iEXT (dynamic) */ + /* _mesa_function_pool[29845]: Binormal3iEXT (dynamic) */ "iii\0" "glBinormal3iEXT\0" "\0" - /* _mesa_function_pool[29774]: WindowPos2fMESA (will be remapped) */ + /* _mesa_function_pool[29866]: WindowPos2fMESA (will be remapped) */ "ff\0" "glWindowPos2f\0" "glWindowPos2fARB\0" @@ -4374,402 +4386,405 @@ static const struct { GLint remap_index; } MESA_remap_table_functions[] = { { 1461, AttachShader_remap_index }, - { 8764, CreateProgram_remap_index }, - { 20335, CreateShader_remap_index }, - { 22665, DeleteProgram_remap_index }, - { 16315, DeleteShader_remap_index }, - { 20781, DetachShader_remap_index }, - { 15839, GetAttachedShaders_remap_index }, + { 8794, CreateProgram_remap_index }, + { 20420, CreateShader_remap_index }, + { 22750, DeleteProgram_remap_index }, + { 16372, DeleteShader_remap_index }, + { 20866, DetachShader_remap_index }, + { 15896, GetAttachedShaders_remap_index }, { 4275, GetProgramInfoLog_remap_index }, { 361, GetProgramiv_remap_index }, - { 5578, GetShaderInfoLog_remap_index }, - { 27719, GetShaderiv_remap_index }, - { 11854, IsProgram_remap_index }, - { 10889, IsShader_remap_index }, - { 8868, StencilFuncSeparate_remap_index }, + { 5608, GetShaderInfoLog_remap_index }, + { 27772, GetShaderiv_remap_index }, + { 11879, IsProgram_remap_index }, + { 10914, IsShader_remap_index }, + { 8898, StencilFuncSeparate_remap_index }, { 3487, StencilMaskSeparate_remap_index }, - { 6654, StencilOpSeparate_remap_index }, - { 19686, UniformMatrix2x3fv_remap_index }, + { 6684, StencilOpSeparate_remap_index }, + { 19771, UniformMatrix2x3fv_remap_index }, { 2615, UniformMatrix2x4fv_remap_index }, - { 29347, UniformMatrix3x2fv_remap_index }, - { 27145, UniformMatrix3x4fv_remap_index }, - { 14387, UniformMatrix4x2fv_remap_index }, + { 29439, UniformMatrix3x2fv_remap_index }, + { 27198, UniformMatrix3x4fv_remap_index }, + { 14444, UniformMatrix4x2fv_remap_index }, { 2937, UniformMatrix4x3fv_remap_index }, - { 8782, LoadTransposeMatrixdARB_remap_index }, - { 27448, LoadTransposeMatrixfARB_remap_index }, + { 8812, LoadTransposeMatrixdARB_remap_index }, + { 27501, LoadTransposeMatrixfARB_remap_index }, { 4848, MultTransposeMatrixdARB_remap_index }, - { 20968, MultTransposeMatrixfARB_remap_index }, + { 21053, MultTransposeMatrixfARB_remap_index }, { 172, SampleCoverageARB_remap_index }, - { 5002, CompressedTexImage1DARB_remap_index }, - { 21468, CompressedTexImage2DARB_remap_index }, + { 5032, CompressedTexImage1DARB_remap_index }, + { 21553, CompressedTexImage2DARB_remap_index }, { 3550, CompressedTexImage3DARB_remap_index }, - { 16131, CompressedTexSubImage1DARB_remap_index }, + { 16188, CompressedTexSubImage1DARB_remap_index }, { 1880, CompressedTexSubImage2DARB_remap_index }, - { 17923, CompressedTexSubImage3DARB_remap_index }, - { 25427, GetCompressedTexImageARB_remap_index }, + { 18008, CompressedTexSubImage3DARB_remap_index }, + { 25480, GetCompressedTexImageARB_remap_index }, { 3395, DisableVertexAttribArrayARB_remap_index }, - { 26757, EnableVertexAttribArrayARB_remap_index }, - { 28523, GetProgramEnvParameterdvARB_remap_index }, - { 20848, GetProgramEnvParameterfvARB_remap_index }, - { 24457, GetProgramLocalParameterdvARB_remap_index }, - { 7096, GetProgramLocalParameterfvARB_remap_index }, - { 16222, GetProgramStringARB_remap_index }, - { 24652, GetProgramivARB_remap_index }, - { 18118, GetVertexAttribdvARB_remap_index }, - { 14276, GetVertexAttribfvARB_remap_index }, - { 8677, GetVertexAttribivARB_remap_index }, - { 17027, ProgramEnvParameter4dARB_remap_index }, - { 22438, ProgramEnvParameter4dvARB_remap_index }, - { 14884, ProgramEnvParameter4fARB_remap_index }, - { 7959, ProgramEnvParameter4fvARB_remap_index }, + { 26810, EnableVertexAttribArrayARB_remap_index }, + { 28615, GetProgramEnvParameterdvARB_remap_index }, + { 20933, GetProgramEnvParameterfvARB_remap_index }, + { 24510, GetProgramLocalParameterdvARB_remap_index }, + { 7126, GetProgramLocalParameterfvARB_remap_index }, + { 16279, GetProgramStringARB_remap_index }, + { 24705, GetProgramivARB_remap_index }, + { 18203, GetVertexAttribdvARB_remap_index }, + { 14333, GetVertexAttribfvARB_remap_index }, + { 8707, GetVertexAttribivARB_remap_index }, + { 17084, ProgramEnvParameter4dARB_remap_index }, + { 22523, ProgramEnvParameter4dvARB_remap_index }, + { 14941, ProgramEnvParameter4fARB_remap_index }, + { 7989, ProgramEnvParameter4fvARB_remap_index }, { 3513, ProgramLocalParameter4dARB_remap_index }, - { 11564, ProgramLocalParameter4dvARB_remap_index }, - { 26236, ProgramLocalParameter4fARB_remap_index }, - { 22983, ProgramLocalParameter4fvARB_remap_index }, - { 25213, ProgramStringARB_remap_index }, - { 17277, VertexAttrib1dARB_remap_index }, - { 13930, VertexAttrib1dvARB_remap_index }, + { 11589, ProgramLocalParameter4dvARB_remap_index }, + { 26289, ProgramLocalParameter4fARB_remap_index }, + { 23068, ProgramLocalParameter4fvARB_remap_index }, + { 25266, ProgramStringARB_remap_index }, + { 17334, VertexAttrib1dARB_remap_index }, + { 13987, VertexAttrib1dvARB_remap_index }, { 3688, VertexAttrib1fARB_remap_index }, - { 29428, VertexAttrib1fvARB_remap_index }, - { 6180, VertexAttrib1sARB_remap_index }, + { 29520, VertexAttrib1fvARB_remap_index }, + { 6210, VertexAttrib1sARB_remap_index }, { 2054, VertexAttrib1svARB_remap_index }, - { 13361, VertexAttrib2dARB_remap_index }, - { 15458, VertexAttrib2dvARB_remap_index }, + { 13418, VertexAttrib2dARB_remap_index }, + { 15515, VertexAttrib2dvARB_remap_index }, { 1480, VertexAttrib2fARB_remap_index }, - { 15571, VertexAttrib2fvARB_remap_index }, - { 29054, VertexAttrib2sARB_remap_index }, - { 28160, VertexAttrib2svARB_remap_index }, - { 10015, VertexAttrib3dARB_remap_index }, - { 7662, VertexAttrib3dvARB_remap_index }, + { 15628, VertexAttrib2fvARB_remap_index }, + { 29146, VertexAttrib2sARB_remap_index }, + { 28252, VertexAttrib2svARB_remap_index }, + { 10045, VertexAttrib3dARB_remap_index }, + { 7692, VertexAttrib3dvARB_remap_index }, { 1567, VertexAttrib3fARB_remap_index }, - { 19923, VertexAttrib3fvARB_remap_index }, - { 25085, VertexAttrib3sARB_remap_index }, - { 17860, VertexAttrib3svARB_remap_index }, + { 20008, VertexAttrib3fvARB_remap_index }, + { 25138, VertexAttrib3sARB_remap_index }, + { 17945, VertexAttrib3svARB_remap_index }, { 4301, VertexAttrib4NbvARB_remap_index }, - { 15794, VertexAttrib4NivARB_remap_index }, - { 19878, VertexAttrib4NsvARB_remap_index }, - { 20800, VertexAttrib4NubARB_remap_index }, - { 28406, VertexAttrib4NubvARB_remap_index }, - { 16688, VertexAttrib4NuivARB_remap_index }, + { 15851, VertexAttrib4NivARB_remap_index }, + { 19963, VertexAttrib4NsvARB_remap_index }, + { 20885, VertexAttrib4NubARB_remap_index }, + { 28498, VertexAttrib4NubvARB_remap_index }, + { 16745, VertexAttrib4NuivARB_remap_index }, { 2810, VertexAttrib4NusvARB_remap_index }, - { 9609, VertexAttrib4bvARB_remap_index }, - { 23865, VertexAttrib4dARB_remap_index }, - { 18843, VertexAttrib4dvARB_remap_index }, - { 10122, VertexAttrib4fARB_remap_index }, - { 10492, VertexAttrib4fvARB_remap_index }, - { 9061, VertexAttrib4ivARB_remap_index }, - { 15272, VertexAttrib4sARB_remap_index }, - { 27634, VertexAttrib4svARB_remap_index }, - { 14689, VertexAttrib4ubvARB_remap_index }, - { 27081, VertexAttrib4uivARB_remap_index }, - { 17671, VertexAttrib4usvARB_remap_index }, - { 19560, VertexAttribPointerARB_remap_index }, - { 29188, BindBufferARB_remap_index }, - { 5893, BufferDataARB_remap_index }, + { 9639, VertexAttrib4bvARB_remap_index }, + { 23918, VertexAttrib4dARB_remap_index }, + { 18928, VertexAttrib4dvARB_remap_index }, + { 10152, VertexAttrib4fARB_remap_index }, + { 10556, VertexAttrib4fvARB_remap_index }, + { 9091, VertexAttrib4ivARB_remap_index }, + { 15329, VertexAttrib4sARB_remap_index }, + { 27687, VertexAttrib4svARB_remap_index }, + { 14746, VertexAttrib4ubvARB_remap_index }, + { 27134, VertexAttrib4uivARB_remap_index }, + { 17756, VertexAttrib4usvARB_remap_index }, + { 19645, VertexAttribPointerARB_remap_index }, + { 29280, BindBufferARB_remap_index }, + { 5923, BufferDataARB_remap_index }, { 1382, BufferSubDataARB_remap_index }, - { 27270, DeleteBuffersARB_remap_index }, - { 29471, GenBuffersARB_remap_index }, - { 15614, GetBufferParameterivARB_remap_index }, - { 14836, GetBufferPointervARB_remap_index }, + { 27323, DeleteBuffersARB_remap_index }, + { 29563, GenBuffersARB_remap_index }, + { 15671, GetBufferParameterivARB_remap_index }, + { 14893, GetBufferPointervARB_remap_index }, { 1335, GetBufferSubDataARB_remap_index }, - { 27029, IsBufferARB_remap_index }, - { 23438, MapBufferARB_remap_index }, - { 27849, UnmapBufferARB_remap_index }, + { 27082, IsBufferARB_remap_index }, + { 23523, MapBufferARB_remap_index }, + { 27902, UnmapBufferARB_remap_index }, { 268, BeginQueryARB_remap_index }, - { 17372, DeleteQueriesARB_remap_index }, - { 10786, EndQueryARB_remap_index }, - { 25906, GenQueriesARB_remap_index }, + { 17429, DeleteQueriesARB_remap_index }, + { 10850, EndQueryARB_remap_index }, + { 25959, GenQueriesARB_remap_index }, { 1772, GetQueryObjectivARB_remap_index }, - { 15316, GetQueryObjectuivARB_remap_index }, + { 15373, GetQueryObjectuivARB_remap_index }, { 1624, GetQueryivARB_remap_index }, - { 17578, IsQueryARB_remap_index }, - { 7272, AttachObjectARB_remap_index }, - { 16277, CompileShaderARB_remap_index }, + { 17663, IsQueryARB_remap_index }, + { 7302, AttachObjectARB_remap_index }, + { 16334, CompileShaderARB_remap_index }, { 2879, CreateProgramObjectARB_remap_index }, - { 5838, CreateShaderObjectARB_remap_index }, - { 12778, DeleteObjectARB_remap_index }, - { 21242, DetachObjectARB_remap_index }, - { 10564, GetActiveUniformARB_remap_index }, - { 8380, GetAttachedObjectsARB_remap_index }, - { 8659, GetHandleARB_remap_index }, - { 29221, GetInfoLogARB_remap_index }, - { 28477, GetObjectParameterfvARB_remap_index }, - { 24331, GetObjectParameterivARB_remap_index }, - { 25664, GetShaderSourceARB_remap_index }, - { 24945, GetUniformLocationARB_remap_index }, - { 21070, GetUniformfvARB_remap_index }, - { 11186, GetUniformivARB_remap_index }, - { 17716, LinkProgramARB_remap_index }, - { 17774, ShaderSourceARB_remap_index }, - { 6554, Uniform1fARB_remap_index }, - { 26445, Uniform1fvARB_remap_index }, - { 19529, Uniform1iARB_remap_index }, - { 18532, Uniform1ivARB_remap_index }, + { 5868, CreateShaderObjectARB_remap_index }, + { 12835, DeleteObjectARB_remap_index }, + { 21327, DetachObjectARB_remap_index }, + { 10628, GetActiveUniformARB_remap_index }, + { 8410, GetAttachedObjectsARB_remap_index }, + { 8689, GetHandleARB_remap_index }, + { 29313, GetInfoLogARB_remap_index }, + { 28569, GetObjectParameterfvARB_remap_index }, + { 24384, GetObjectParameterivARB_remap_index }, + { 25717, GetShaderSourceARB_remap_index }, + { 24998, GetUniformLocationARB_remap_index }, + { 21155, GetUniformfvARB_remap_index }, + { 11211, GetUniformivARB_remap_index }, + { 17801, LinkProgramARB_remap_index }, + { 17859, ShaderSourceARB_remap_index }, + { 6584, Uniform1fARB_remap_index }, + { 26498, Uniform1fvARB_remap_index }, + { 19614, Uniform1iARB_remap_index }, + { 18617, Uniform1ivARB_remap_index }, { 2003, Uniform2fARB_remap_index }, - { 12614, Uniform2fvARB_remap_index }, - { 23325, Uniform2iARB_remap_index }, + { 12671, Uniform2fvARB_remap_index }, + { 23410, Uniform2iARB_remap_index }, { 2123, Uniform2ivARB_remap_index }, - { 16387, Uniform3fARB_remap_index }, - { 8410, Uniform3fvARB_remap_index }, - { 5512, Uniform3iARB_remap_index }, - { 14942, Uniform3ivARB_remap_index }, - { 16833, Uniform4fARB_remap_index }, - { 20934, Uniform4fvARB_remap_index }, - { 22117, Uniform4iARB_remap_index }, - { 18084, Uniform4ivARB_remap_index }, - { 7324, UniformMatrix2fvARB_remap_index }, + { 16444, Uniform3fARB_remap_index }, + { 8440, Uniform3fvARB_remap_index }, + { 5542, Uniform3iARB_remap_index }, + { 14999, Uniform3ivARB_remap_index }, + { 16890, Uniform4fARB_remap_index }, + { 21019, Uniform4fvARB_remap_index }, + { 22202, Uniform4iARB_remap_index }, + { 18169, Uniform4ivARB_remap_index }, + { 7354, UniformMatrix2fvARB_remap_index }, { 17, UniformMatrix3fvARB_remap_index }, { 2475, UniformMatrix4fvARB_remap_index }, - { 22550, UseProgramObjectARB_remap_index }, - { 13049, ValidateProgramARB_remap_index }, - { 18886, BindAttribLocationARB_remap_index }, + { 22635, UseProgramObjectARB_remap_index }, + { 13106, ValidateProgramARB_remap_index }, + { 18971, BindAttribLocationARB_remap_index }, { 4346, GetActiveAttribARB_remap_index }, - { 14623, GetAttribLocationARB_remap_index }, - { 26184, DrawBuffersARB_remap_index }, - { 11669, RenderbufferStorageMultisample_remap_index }, - { 16881, FlushMappedBufferRange_remap_index }, - { 24748, MapBufferRange_remap_index }, - { 14498, BindVertexArray_remap_index }, - { 12908, GenVertexArrays_remap_index }, - { 26959, CopyBufferSubData_remap_index }, - { 27738, ClientWaitSync_remap_index }, + { 14680, GetAttribLocationARB_remap_index }, + { 26237, DrawBuffersARB_remap_index }, + { 11694, RenderbufferStorageMultisample_remap_index }, + { 16938, FlushMappedBufferRange_remap_index }, + { 24801, MapBufferRange_remap_index }, + { 14555, BindVertexArray_remap_index }, + { 12965, GenVertexArrays_remap_index }, + { 27012, CopyBufferSubData_remap_index }, + { 27791, ClientWaitSync_remap_index }, { 2394, DeleteSync_remap_index }, - { 6221, FenceSync_remap_index }, - { 13420, GetInteger64v_remap_index }, - { 19985, GetSynciv_remap_index }, - { 26123, IsSync_remap_index }, - { 8328, WaitSync_remap_index }, + { 6251, FenceSync_remap_index }, + { 13477, GetInteger64v_remap_index }, + { 20070, GetSynciv_remap_index }, + { 26176, IsSync_remap_index }, + { 8358, WaitSync_remap_index }, { 3363, DrawElementsBaseVertex_remap_index }, - { 27202, DrawRangeElementsBaseVertex_remap_index }, - { 23469, MultiDrawElementsBaseVertex_remap_index }, + { 27255, DrawRangeElementsBaseVertex_remap_index }, + { 23554, MultiDrawElementsBaseVertex_remap_index }, { 4711, PolygonOffsetEXT_remap_index }, - { 20570, GetPixelTexGenParameterfvSGIS_remap_index }, + { 20655, GetPixelTexGenParameterfvSGIS_remap_index }, { 3895, GetPixelTexGenParameterivSGIS_remap_index }, - { 20303, PixelTexGenParameterfSGIS_remap_index }, + { 20388, PixelTexGenParameterfSGIS_remap_index }, { 580, PixelTexGenParameterfvSGIS_remap_index }, - { 11224, PixelTexGenParameteriSGIS_remap_index }, - { 12185, PixelTexGenParameterivSGIS_remap_index }, - { 14586, SampleMaskSGIS_remap_index }, - { 17518, SamplePatternSGIS_remap_index }, - { 23398, ColorPointerEXT_remap_index }, - { 15501, EdgeFlagPointerEXT_remap_index }, - { 5166, IndexPointerEXT_remap_index }, - { 5246, NormalPointerEXT_remap_index }, - { 14014, TexCoordPointerEXT_remap_index }, - { 6016, VertexPointerEXT_remap_index }, + { 11249, PixelTexGenParameteriSGIS_remap_index }, + { 12242, PixelTexGenParameterivSGIS_remap_index }, + { 14643, SampleMaskSGIS_remap_index }, + { 17603, SamplePatternSGIS_remap_index }, + { 23483, ColorPointerEXT_remap_index }, + { 15558, EdgeFlagPointerEXT_remap_index }, + { 5196, IndexPointerEXT_remap_index }, + { 5276, NormalPointerEXT_remap_index }, + { 14071, TexCoordPointerEXT_remap_index }, + { 6046, VertexPointerEXT_remap_index }, { 3165, PointParameterfEXT_remap_index }, - { 6861, PointParameterfvEXT_remap_index }, - { 28575, LockArraysEXT_remap_index }, - { 13113, UnlockArraysEXT_remap_index }, - { 7868, CullParameterdvEXT_remap_index }, - { 10359, CullParameterfvEXT_remap_index }, + { 6891, PointParameterfvEXT_remap_index }, + { 28667, LockArraysEXT_remap_index }, + { 13170, UnlockArraysEXT_remap_index }, + { 7898, CullParameterdvEXT_remap_index }, + { 10423, CullParameterfvEXT_remap_index }, { 1151, SecondaryColor3bEXT_remap_index }, - { 7020, SecondaryColor3bvEXT_remap_index }, - { 9238, SecondaryColor3dEXT_remap_index }, - { 22723, SecondaryColor3dvEXT_remap_index }, - { 24994, SecondaryColor3fEXT_remap_index }, - { 16067, SecondaryColor3fvEXT_remap_index }, + { 7050, SecondaryColor3bvEXT_remap_index }, + { 9268, SecondaryColor3dEXT_remap_index }, + { 22808, SecondaryColor3dvEXT_remap_index }, + { 25047, SecondaryColor3fEXT_remap_index }, + { 16124, SecondaryColor3fvEXT_remap_index }, { 426, SecondaryColor3iEXT_remap_index }, - { 14324, SecondaryColor3ivEXT_remap_index }, - { 8896, SecondaryColor3sEXT_remap_index }, - { 27402, SecondaryColor3svEXT_remap_index }, - { 24167, SecondaryColor3ubEXT_remap_index }, - { 18777, SecondaryColor3ubvEXT_remap_index }, - { 11419, SecondaryColor3uiEXT_remap_index }, - { 20190, SecondaryColor3uivEXT_remap_index }, - { 22935, SecondaryColor3usEXT_remap_index }, - { 11492, SecondaryColor3usvEXT_remap_index }, - { 10435, SecondaryColorPointerEXT_remap_index }, - { 22784, MultiDrawArraysEXT_remap_index }, - { 18467, MultiDrawElementsEXT_remap_index }, - { 18662, FogCoordPointerEXT_remap_index }, + { 14381, SecondaryColor3ivEXT_remap_index }, + { 8926, SecondaryColor3sEXT_remap_index }, + { 27455, SecondaryColor3svEXT_remap_index }, + { 24220, SecondaryColor3ubEXT_remap_index }, + { 18862, SecondaryColor3ubvEXT_remap_index }, + { 11444, SecondaryColor3uiEXT_remap_index }, + { 20275, SecondaryColor3uivEXT_remap_index }, + { 23020, SecondaryColor3usEXT_remap_index }, + { 11517, SecondaryColor3usvEXT_remap_index }, + { 10499, SecondaryColorPointerEXT_remap_index }, + { 22869, MultiDrawArraysEXT_remap_index }, + { 18552, MultiDrawElementsEXT_remap_index }, + { 18747, FogCoordPointerEXT_remap_index }, { 4044, FogCoorddEXT_remap_index }, - { 27976, FogCoorddvEXT_remap_index }, + { 28068, FogCoorddvEXT_remap_index }, { 4136, FogCoordfEXT_remap_index }, - { 24090, FogCoordfvEXT_remap_index }, - { 16785, PixelTexGenSGIX_remap_index }, - { 24675, BlendFuncSeparateEXT_remap_index }, - { 5928, FlushVertexArrayRangeNV_remap_index }, + { 24143, FogCoordfvEXT_remap_index }, + { 16842, PixelTexGenSGIX_remap_index }, + { 24728, BlendFuncSeparateEXT_remap_index }, + { 5958, FlushVertexArrayRangeNV_remap_index }, { 4660, VertexArrayRangeNV_remap_index }, - { 25059, CombinerInputNV_remap_index }, + { 25112, CombinerInputNV_remap_index }, { 1946, CombinerOutputNV_remap_index }, - { 27555, CombinerParameterfNV_remap_index }, + { 27608, CombinerParameterfNV_remap_index }, { 4580, CombinerParameterfvNV_remap_index }, - { 19735, CombinerParameteriNV_remap_index }, - { 28946, CombinerParameterivNV_remap_index }, - { 6298, FinalCombinerInputNV_remap_index }, - { 8725, GetCombinerInputParameterfvNV_remap_index }, - { 28783, GetCombinerInputParameterivNV_remap_index }, - { 6097, GetCombinerOutputParameterfvNV_remap_index }, - { 12146, GetCombinerOutputParameterivNV_remap_index }, - { 5673, GetFinalCombinerInputParameterfvNV_remap_index }, - { 21989, GetFinalCombinerInputParameterivNV_remap_index }, - { 11164, ResizeBuffersMESA_remap_index }, - { 9842, WindowPos2dMESA_remap_index }, + { 19820, CombinerParameteriNV_remap_index }, + { 29038, CombinerParameterivNV_remap_index }, + { 6328, FinalCombinerInputNV_remap_index }, + { 8755, GetCombinerInputParameterfvNV_remap_index }, + { 28875, GetCombinerInputParameterivNV_remap_index }, + { 6127, GetCombinerOutputParameterfvNV_remap_index }, + { 12171, GetCombinerOutputParameterivNV_remap_index }, + { 5703, GetFinalCombinerInputParameterfvNV_remap_index }, + { 22074, GetFinalCombinerInputParameterivNV_remap_index }, + { 11189, ResizeBuffersMESA_remap_index }, + { 9872, WindowPos2dMESA_remap_index }, { 944, WindowPos2dvMESA_remap_index }, - { 29774, WindowPos2fMESA_remap_index }, - { 6965, WindowPos2fvMESA_remap_index }, - { 16014, WindowPos2iMESA_remap_index }, - { 17991, WindowPos2ivMESA_remap_index }, - { 18566, WindowPos2sMESA_remap_index }, - { 4916, WindowPos2svMESA_remap_index }, - { 6790, WindowPos3dMESA_remap_index }, - { 12393, WindowPos3dvMESA_remap_index }, + { 29866, WindowPos2fMESA_remap_index }, + { 6995, WindowPos2fvMESA_remap_index }, + { 16071, WindowPos2iMESA_remap_index }, + { 18076, WindowPos2ivMESA_remap_index }, + { 18651, WindowPos2sMESA_remap_index }, + { 4946, WindowPos2svMESA_remap_index }, + { 6820, WindowPos3dMESA_remap_index }, + { 12450, WindowPos3dvMESA_remap_index }, { 472, WindowPos3fMESA_remap_index }, - { 13174, WindowPos3fvMESA_remap_index }, - { 21284, WindowPos3iMESA_remap_index }, - { 26904, WindowPos3ivMESA_remap_index }, - { 16531, WindowPos3sMESA_remap_index }, - { 28232, WindowPos3svMESA_remap_index }, - { 9793, WindowPos4dMESA_remap_index }, - { 15027, WindowPos4dvMESA_remap_index }, - { 12352, WindowPos4fMESA_remap_index }, - { 27309, WindowPos4fvMESA_remap_index }, - { 27057, WindowPos4iMESA_remap_index }, - { 11003, WindowPos4ivMESA_remap_index }, - { 16664, WindowPos4sMESA_remap_index }, + { 13231, WindowPos3fvMESA_remap_index }, + { 21369, WindowPos3iMESA_remap_index }, + { 26957, WindowPos3ivMESA_remap_index }, + { 16588, WindowPos3sMESA_remap_index }, + { 28324, WindowPos3svMESA_remap_index }, + { 9823, WindowPos4dMESA_remap_index }, + { 15084, WindowPos4dvMESA_remap_index }, + { 12409, WindowPos4fMESA_remap_index }, + { 27362, WindowPos4fvMESA_remap_index }, + { 27110, WindowPos4iMESA_remap_index }, + { 11028, WindowPos4ivMESA_remap_index }, + { 16721, WindowPos4sMESA_remap_index }, { 2857, WindowPos4svMESA_remap_index }, - { 23833, MultiModeDrawArraysIBM_remap_index }, - { 25777, MultiModeDrawElementsIBM_remap_index }, - { 10814, DeleteFencesNV_remap_index }, - { 24906, FinishFenceNV_remap_index }, + { 12210, MultiModeDrawArraysIBM_remap_index }, + { 25830, MultiModeDrawElementsIBM_remap_index }, + { 10878, DeleteFencesNV_remap_index }, + { 24959, FinishFenceNV_remap_index }, { 3287, GenFencesNV_remap_index }, - { 15007, GetFenceivNV_remap_index }, - { 7257, IsFenceNV_remap_index }, - { 12073, SetFenceNV_remap_index }, + { 15064, GetFenceivNV_remap_index }, + { 7287, IsFenceNV_remap_index }, + { 12098, SetFenceNV_remap_index }, { 3744, TestFenceNV_remap_index }, - { 28203, AreProgramsResidentNV_remap_index }, - { 27597, BindProgramNV_remap_index }, - { 23018, DeleteProgramsNV_remap_index }, - { 18995, ExecuteProgramNV_remap_index }, - { 29667, GenProgramsNV_remap_index }, - { 20649, GetProgramParameterdvNV_remap_index }, - { 9300, GetProgramParameterfvNV_remap_index }, - { 23372, GetProgramStringNV_remap_index }, - { 21678, GetProgramivNV_remap_index }, - { 20883, GetTrackMatrixivNV_remap_index }, - { 23168, GetVertexAttribPointervNV_remap_index }, - { 21922, GetVertexAttribdvNV_remap_index }, - { 16504, GetVertexAttribfvNV_remap_index }, - { 16195, GetVertexAttribivNV_remap_index }, - { 16911, IsProgramNV_remap_index }, - { 8306, LoadProgramNV_remap_index }, - { 24771, ProgramParameters4dvNV_remap_index }, - { 21608, ProgramParameters4fvNV_remap_index }, - { 18295, RequestResidentProgramsNV_remap_index }, - { 19713, TrackMatrixNV_remap_index }, - { 28760, VertexAttrib1dNV_remap_index }, - { 12014, VertexAttrib1dvNV_remap_index }, - { 25309, VertexAttrib1fNV_remap_index }, + { 28295, AreProgramsResidentNV_remap_index }, + { 27650, BindProgramNV_remap_index }, + { 23103, DeleteProgramsNV_remap_index }, + { 19080, ExecuteProgramNV_remap_index }, + { 29759, GenProgramsNV_remap_index }, + { 20734, GetProgramParameterdvNV_remap_index }, + { 9330, GetProgramParameterfvNV_remap_index }, + { 23457, GetProgramStringNV_remap_index }, + { 21763, GetProgramivNV_remap_index }, + { 20968, GetTrackMatrixivNV_remap_index }, + { 23253, GetVertexAttribPointervNV_remap_index }, + { 22007, GetVertexAttribdvNV_remap_index }, + { 16561, GetVertexAttribfvNV_remap_index }, + { 16252, GetVertexAttribivNV_remap_index }, + { 16968, IsProgramNV_remap_index }, + { 8336, LoadProgramNV_remap_index }, + { 24824, ProgramParameters4dvNV_remap_index }, + { 21693, ProgramParameters4fvNV_remap_index }, + { 18380, RequestResidentProgramsNV_remap_index }, + { 19798, TrackMatrixNV_remap_index }, + { 28852, VertexAttrib1dNV_remap_index }, + { 12039, VertexAttrib1dvNV_remap_index }, + { 25362, VertexAttrib1fNV_remap_index }, { 2245, VertexAttrib1fvNV_remap_index }, - { 27366, VertexAttrib1sNV_remap_index }, - { 13247, VertexAttrib1svNV_remap_index }, + { 27419, VertexAttrib1sNV_remap_index }, + { 13304, VertexAttrib1svNV_remap_index }, { 4251, VertexAttrib2dNV_remap_index }, - { 11929, VertexAttrib2dvNV_remap_index }, - { 17750, VertexAttrib2fNV_remap_index }, - { 11540, VertexAttrib2fvNV_remap_index }, - { 5076, VertexAttrib2sNV_remap_index }, - { 16585, VertexAttrib2svNV_remap_index }, - { 9990, VertexAttrib3dNV_remap_index }, - { 28453, VertexAttrib3dvNV_remap_index }, - { 9112, VertexAttrib3fNV_remap_index }, - { 21949, VertexAttrib3fvNV_remap_index }, - { 25284, VertexAttrib3sNV_remap_index }, - { 20910, VertexAttrib3svNV_remap_index }, - { 25751, VertexAttrib4dNV_remap_index }, - { 29704, VertexAttrib4dvNV_remap_index }, + { 11954, VertexAttrib2dvNV_remap_index }, + { 17835, VertexAttrib2fNV_remap_index }, + { 11565, VertexAttrib2fvNV_remap_index }, + { 5106, VertexAttrib2sNV_remap_index }, + { 16642, VertexAttrib2svNV_remap_index }, + { 10020, VertexAttrib3dNV_remap_index }, + { 28545, VertexAttrib3dvNV_remap_index }, + { 9142, VertexAttrib3fNV_remap_index }, + { 22034, VertexAttrib3fvNV_remap_index }, + { 25337, VertexAttrib3sNV_remap_index }, + { 20995, VertexAttrib3svNV_remap_index }, + { 25804, VertexAttrib4dNV_remap_index }, + { 29796, VertexAttrib4dvNV_remap_index }, { 3945, VertexAttrib4fNV_remap_index }, - { 8356, VertexAttrib4fvNV_remap_index }, - { 23717, VertexAttrib4sNV_remap_index }, + { 8386, VertexAttrib4fvNV_remap_index }, + { 23802, VertexAttrib4sNV_remap_index }, { 1293, VertexAttrib4svNV_remap_index }, { 4409, VertexAttrib4ubNV_remap_index }, { 734, VertexAttrib4ubvNV_remap_index }, - { 19175, VertexAttribPointerNV_remap_index }, + { 19260, VertexAttribPointerNV_remap_index }, { 2097, VertexAttribs1dvNV_remap_index }, - { 16609, VertexAttribs1fvNV_remap_index }, - { 29504, VertexAttribs1svNV_remap_index }, - { 9137, VertexAttribs2dvNV_remap_index }, - { 22511, VertexAttribs2fvNV_remap_index }, - { 15527, VertexAttribs2svNV_remap_index }, + { 16666, VertexAttribs1fvNV_remap_index }, + { 29596, VertexAttribs1svNV_remap_index }, + { 9167, VertexAttribs2dvNV_remap_index }, + { 22596, VertexAttribs2fvNV_remap_index }, + { 15584, VertexAttribs2svNV_remap_index }, { 4608, VertexAttribs3dvNV_remap_index }, { 1977, VertexAttribs3fvNV_remap_index }, - { 26652, VertexAttribs3svNV_remap_index }, - { 23807, VertexAttribs4dvNV_remap_index }, + { 26705, VertexAttribs3svNV_remap_index }, + { 23892, VertexAttribs4dvNV_remap_index }, { 4634, VertexAttribs4fvNV_remap_index }, - { 29291, VertexAttribs4svNV_remap_index }, - { 26400, VertexAttribs4ubvNV_remap_index }, - { 23909, GetTexBumpParameterfvATI_remap_index }, - { 29545, GetTexBumpParameterivATI_remap_index }, - { 16249, TexBumpParameterfvATI_remap_index }, - { 18166, TexBumpParameterivATI_remap_index }, - { 13793, AlphaFragmentOp1ATI_remap_index }, - { 9652, AlphaFragmentOp2ATI_remap_index }, - { 21865, AlphaFragmentOp3ATI_remap_index }, - { 26579, BeginFragmentShaderATI_remap_index }, - { 27796, BindFragmentShaderATI_remap_index }, - { 21039, ColorFragmentOp1ATI_remap_index }, + { 29383, VertexAttribs4svNV_remap_index }, + { 26453, VertexAttribs4ubvNV_remap_index }, + { 23962, GetTexBumpParameterfvATI_remap_index }, + { 29637, GetTexBumpParameterivATI_remap_index }, + { 16306, TexBumpParameterfvATI_remap_index }, + { 18251, TexBumpParameterivATI_remap_index }, + { 13850, AlphaFragmentOp1ATI_remap_index }, + { 9682, AlphaFragmentOp2ATI_remap_index }, + { 21950, AlphaFragmentOp3ATI_remap_index }, + { 26632, BeginFragmentShaderATI_remap_index }, + { 27849, BindFragmentShaderATI_remap_index }, + { 21124, ColorFragmentOp1ATI_remap_index }, { 3823, ColorFragmentOp2ATI_remap_index }, - { 28098, ColorFragmentOp3ATI_remap_index }, + { 28190, ColorFragmentOp3ATI_remap_index }, { 4753, DeleteFragmentShaderATI_remap_index }, - { 29728, EndFragmentShaderATI_remap_index }, - { 28974, GenFragmentShadersATI_remap_index }, - { 22642, PassTexCoordATI_remap_index }, - { 5996, SampleMapATI_remap_index }, - { 5769, SetFragmentShaderConstantATI_remap_index }, + { 29820, EndFragmentShaderATI_remap_index }, + { 29066, GenFragmentShadersATI_remap_index }, + { 22727, PassTexCoordATI_remap_index }, + { 6026, SampleMapATI_remap_index }, + { 5799, SetFragmentShaderConstantATI_remap_index }, { 319, PointParameteriNV_remap_index }, - { 12554, PointParameterivNV_remap_index }, - { 25590, ActiveStencilFaceEXT_remap_index }, - { 24431, BindVertexArrayAPPLE_remap_index }, + { 12611, PointParameterivNV_remap_index }, + { 25643, ActiveStencilFaceEXT_remap_index }, + { 24484, BindVertexArrayAPPLE_remap_index }, { 2522, DeleteVertexArraysAPPLE_remap_index }, - { 15866, GenVertexArraysAPPLE_remap_index }, - { 20714, IsVertexArrayAPPLE_remap_index }, + { 15923, GenVertexArraysAPPLE_remap_index }, + { 20799, IsVertexArrayAPPLE_remap_index }, { 775, GetProgramNamedParameterdvNV_remap_index }, { 3128, GetProgramNamedParameterfvNV_remap_index }, - { 23940, ProgramNamedParameter4dNV_remap_index }, - { 12829, ProgramNamedParameter4dvNV_remap_index }, - { 7893, ProgramNamedParameter4fNV_remap_index }, - { 10400, ProgramNamedParameter4fvNV_remap_index }, - { 21587, DepthBoundsEXT_remap_index }, + { 23993, ProgramNamedParameter4dNV_remap_index }, + { 12886, ProgramNamedParameter4dvNV_remap_index }, + { 7923, ProgramNamedParameter4fNV_remap_index }, + { 10464, ProgramNamedParameter4fvNV_remap_index }, + { 21672, DepthBoundsEXT_remap_index }, { 1043, BlendEquationSeparateEXT_remap_index }, - { 12948, BindFramebufferEXT_remap_index }, - { 22829, BindRenderbufferEXT_remap_index }, - { 8575, CheckFramebufferStatusEXT_remap_index }, - { 20004, DeleteFramebuffersEXT_remap_index }, - { 28355, DeleteRenderbuffersEXT_remap_index }, - { 11953, FramebufferRenderbufferEXT_remap_index }, - { 12090, FramebufferTexture1DEXT_remap_index }, - { 10228, FramebufferTexture2DEXT_remap_index }, - { 9895, FramebufferTexture3DEXT_remap_index }, - { 20606, GenFramebuffersEXT_remap_index }, - { 15413, GenRenderbuffersEXT_remap_index }, - { 5715, GenerateMipmapEXT_remap_index }, - { 19235, GetFramebufferAttachmentParameterivEXT_remap_index }, - { 28880, GetRenderbufferParameterivEXT_remap_index }, - { 18046, IsFramebufferEXT_remap_index }, - { 29627, IsRenderbufferEXT_remap_index }, - { 7204, RenderbufferStorageEXT_remap_index }, + { 13005, BindFramebufferEXT_remap_index }, + { 22914, BindRenderbufferEXT_remap_index }, + { 8605, CheckFramebufferStatusEXT_remap_index }, + { 20089, DeleteFramebuffersEXT_remap_index }, + { 28447, DeleteRenderbuffersEXT_remap_index }, + { 11978, FramebufferRenderbufferEXT_remap_index }, + { 12115, FramebufferTexture1DEXT_remap_index }, + { 10258, FramebufferTexture2DEXT_remap_index }, + { 9925, FramebufferTexture3DEXT_remap_index }, + { 20691, GenFramebuffersEXT_remap_index }, + { 15470, GenRenderbuffersEXT_remap_index }, + { 5745, GenerateMipmapEXT_remap_index }, + { 19320, GetFramebufferAttachmentParameterivEXT_remap_index }, + { 28972, GetRenderbufferParameterivEXT_remap_index }, + { 18131, IsFramebufferEXT_remap_index }, + { 29719, IsRenderbufferEXT_remap_index }, + { 7234, RenderbufferStorageEXT_remap_index }, { 651, BlitFramebufferEXT_remap_index }, - { 12648, BufferParameteriAPPLE_remap_index }, - { 16943, FlushMappedBufferRangeAPPLE_remap_index }, + { 12705, BufferParameteriAPPLE_remap_index }, + { 17000, FlushMappedBufferRangeAPPLE_remap_index }, { 2701, FramebufferTextureLayerEXT_remap_index }, - { 8277, ColorMaskIndexedEXT_remap_index }, - { 23256, DisableIndexedEXT_remap_index }, - { 23564, EnableIndexedEXT_remap_index }, - { 19206, GetBooleanIndexedvEXT_remap_index }, - { 9685, GetIntegerIndexedvEXT_remap_index }, - { 20080, IsEnabledIndexedEXT_remap_index }, + { 8307, ColorMaskIndexedEXT_remap_index }, + { 23341, DisableIndexedEXT_remap_index }, + { 23649, EnableIndexedEXT_remap_index }, + { 19291, GetBooleanIndexedvEXT_remap_index }, + { 9715, GetIntegerIndexedvEXT_remap_index }, + { 20165, IsEnabledIndexedEXT_remap_index }, { 4074, BeginConditionalRenderNV_remap_index }, - { 22615, EndConditionalRenderNV_remap_index }, - { 26301, ProvokingVertexEXT_remap_index }, - { 9521, GetTexParameterPointervAPPLE_remap_index }, + { 22700, EndConditionalRenderNV_remap_index }, + { 26354, ProvokingVertexEXT_remap_index }, + { 9551, GetTexParameterPointervAPPLE_remap_index }, { 4436, TextureRangeAPPLE_remap_index }, - { 25616, StencilFuncSeparateATI_remap_index }, - { 15933, ProgramEnvParameters4fvEXT_remap_index }, - { 15151, ProgramLocalParameters4fvEXT_remap_index }, - { 12482, GetQueryObjecti64vEXT_remap_index }, - { 9163, GetQueryObjectui64vEXT_remap_index }, - { 21108, EGLImageTargetRenderbufferStorageOES_remap_index }, - { 10753, EGLImageTargetTexture2DOES_remap_index }, + { 10330, GetObjectParameterivAPPLE_remap_index }, + { 17575, ObjectPurgeableAPPLE_remap_index }, + { 4900, ObjectUnpurgeableAPPLE_remap_index }, + { 25669, StencilFuncSeparateATI_remap_index }, + { 15990, ProgramEnvParameters4fvEXT_remap_index }, + { 15208, ProgramLocalParameters4fvEXT_remap_index }, + { 12539, GetQueryObjecti64vEXT_remap_index }, + { 9193, GetQueryObjectui64vEXT_remap_index }, + { 21193, EGLImageTargetRenderbufferStorageOES_remap_index }, + { 10817, EGLImageTargetTexture2DOES_remap_index }, { -1, -1 } }; @@ -4778,108 +4793,108 @@ static const struct gl_function_remap MESA_alt_functions[] = { /* from GL_EXT_blend_color */ { 2440, _gloffset_BlendColor }, /* from GL_EXT_blend_minmax */ - { 9952, _gloffset_BlendEquation }, + { 9982, _gloffset_BlendEquation }, /* from GL_EXT_color_subtable */ - { 15049, _gloffset_ColorSubTable }, - { 28287, _gloffset_CopyColorSubTable }, + { 15106, _gloffset_ColorSubTable }, + { 28379, _gloffset_CopyColorSubTable }, /* from GL_EXT_convolution */ { 213, _gloffset_ConvolutionFilter1D }, { 2284, _gloffset_CopyConvolutionFilter1D }, { 3624, _gloffset_GetConvolutionParameteriv }, - { 7553, _gloffset_ConvolutionFilter2D }, - { 7719, _gloffset_ConvolutionParameteriv }, - { 8179, _gloffset_ConvolutionParameterfv }, - { 18194, _gloffset_GetSeparableFilter }, - { 21338, _gloffset_SeparableFilter2D }, - { 22167, _gloffset_ConvolutionParameteri }, - { 22290, _gloffset_ConvolutionParameterf }, - { 23743, _gloffset_GetConvolutionParameterfv }, - { 24597, _gloffset_GetConvolutionFilter }, - { 26841, _gloffset_CopyConvolutionFilter2D }, + { 7583, _gloffset_ConvolutionFilter2D }, + { 7749, _gloffset_ConvolutionParameteriv }, + { 8209, _gloffset_ConvolutionParameterfv }, + { 18279, _gloffset_GetSeparableFilter }, + { 21423, _gloffset_SeparableFilter2D }, + { 22252, _gloffset_ConvolutionParameteri }, + { 22375, _gloffset_ConvolutionParameterf }, + { 23828, _gloffset_GetConvolutionParameterfv }, + { 24650, _gloffset_GetConvolutionFilter }, + { 26894, _gloffset_CopyConvolutionFilter2D }, /* from GL_EXT_copy_texture */ - { 13307, _gloffset_CopyTexSubImage3D }, - { 14789, _gloffset_CopyTexImage2D }, - { 21775, _gloffset_CopyTexImage1D }, - { 24278, _gloffset_CopyTexSubImage2D }, - { 26479, _gloffset_CopyTexSubImage1D }, + { 13364, _gloffset_CopyTexSubImage3D }, + { 14846, _gloffset_CopyTexImage2D }, + { 21860, _gloffset_CopyTexImage1D }, + { 24331, _gloffset_CopyTexSubImage2D }, + { 26532, _gloffset_CopyTexSubImage1D }, /* from GL_EXT_draw_range_elements */ - { 8462, _gloffset_DrawRangeElements }, + { 8492, _gloffset_DrawRangeElements }, /* from GL_EXT_histogram */ { 812, _gloffset_Histogram }, { 3088, _gloffset_ResetHistogram }, - { 8834, _gloffset_GetMinmax }, - { 13641, _gloffset_GetHistogramParameterfv }, - { 21700, _gloffset_GetMinmaxParameteriv }, - { 23633, _gloffset_ResetMinmax }, - { 24494, _gloffset_GetHistogramParameteriv }, - { 25550, _gloffset_GetHistogram }, - { 27912, _gloffset_Minmax }, - { 29374, _gloffset_GetMinmaxParameterfv }, + { 8864, _gloffset_GetMinmax }, + { 13698, _gloffset_GetHistogramParameterfv }, + { 21785, _gloffset_GetMinmaxParameteriv }, + { 23718, _gloffset_ResetMinmax }, + { 24547, _gloffset_GetHistogramParameteriv }, + { 25603, _gloffset_GetHistogram }, + { 27965, _gloffset_Minmax }, + { 29466, _gloffset_GetMinmaxParameterfv }, /* from GL_EXT_paletted_texture */ - { 7415, _gloffset_ColorTable }, - { 13487, _gloffset_GetColorTable }, - { 20353, _gloffset_GetColorTableParameterfv }, - { 22346, _gloffset_GetColorTableParameteriv }, + { 7445, _gloffset_ColorTable }, + { 13544, _gloffset_GetColorTable }, + { 20438, _gloffset_GetColorTableParameterfv }, + { 22431, _gloffset_GetColorTableParameteriv }, /* from GL_EXT_subtexture */ - { 6136, _gloffset_TexSubImage1D }, - { 9448, _gloffset_TexSubImage2D }, + { 6166, _gloffset_TexSubImage1D }, + { 9478, _gloffset_TexSubImage2D }, /* from GL_EXT_texture3D */ { 1658, _gloffset_TexImage3D }, - { 20122, _gloffset_TexSubImage3D }, + { 20207, _gloffset_TexSubImage3D }, /* from GL_EXT_texture_object */ { 2964, _gloffset_PrioritizeTextures }, - { 6585, _gloffset_AreTexturesResident }, - { 12038, _gloffset_GenTextures }, - { 13973, _gloffset_DeleteTextures }, - { 17224, _gloffset_IsTexture }, - { 26544, _gloffset_BindTexture }, + { 6615, _gloffset_AreTexturesResident }, + { 12063, _gloffset_GenTextures }, + { 14030, _gloffset_DeleteTextures }, + { 17281, _gloffset_IsTexture }, + { 26597, _gloffset_BindTexture }, /* from GL_EXT_vertex_array */ - { 21527, _gloffset_ArrayElement }, - { 27500, _gloffset_GetPointerv }, - { 29001, _gloffset_DrawArrays }, + { 21612, _gloffset_ArrayElement }, + { 27553, _gloffset_GetPointerv }, + { 29093, _gloffset_DrawArrays }, /* from GL_SGI_color_table */ - { 6703, _gloffset_ColorTableParameteriv }, - { 7415, _gloffset_ColorTable }, - { 13487, _gloffset_GetColorTable }, - { 13597, _gloffset_CopyColorTable }, - { 17085, _gloffset_ColorTableParameterfv }, - { 20353, _gloffset_GetColorTableParameterfv }, - { 22346, _gloffset_GetColorTableParameteriv }, + { 6733, _gloffset_ColorTableParameteriv }, + { 7445, _gloffset_ColorTable }, + { 13544, _gloffset_GetColorTable }, + { 13654, _gloffset_CopyColorTable }, + { 17142, _gloffset_ColorTableParameterfv }, + { 20438, _gloffset_GetColorTableParameterfv }, + { 22431, _gloffset_GetColorTableParameteriv }, /* from GL_VERSION_1_3 */ { 381, _gloffset_MultiTexCoord3sARB }, { 613, _gloffset_ActiveTextureARB }, { 3761, _gloffset_MultiTexCoord1fvARB }, - { 5271, _gloffset_MultiTexCoord3dARB }, - { 5316, _gloffset_MultiTexCoord2iARB }, - { 5440, _gloffset_MultiTexCoord2svARB }, - { 7371, _gloffset_MultiTexCoord2fARB }, - { 9193, _gloffset_MultiTexCoord3fvARB }, - { 9714, _gloffset_MultiTexCoord4sARB }, - { 10314, _gloffset_MultiTexCoord2dvARB }, - { 10696, _gloffset_MultiTexCoord1svARB }, - { 11025, _gloffset_MultiTexCoord3svARB }, - { 11086, _gloffset_MultiTexCoord4iARB }, - { 11809, _gloffset_MultiTexCoord3iARB }, - { 12511, _gloffset_MultiTexCoord1dARB }, - { 12677, _gloffset_MultiTexCoord3dvARB }, - { 13841, _gloffset_MultiTexCoord3ivARB }, - { 13886, _gloffset_MultiTexCoord2sARB }, - { 15106, _gloffset_MultiTexCoord4ivARB }, - { 16735, _gloffset_ClientActiveTextureARB }, - { 18951, _gloffset_MultiTexCoord2dARB }, - { 19355, _gloffset_MultiTexCoord4dvARB }, - { 19641, _gloffset_MultiTexCoord4fvARB }, - { 20494, _gloffset_MultiTexCoord3fARB }, - { 22874, _gloffset_MultiTexCoord4dARB }, - { 23078, _gloffset_MultiTexCoord1sARB }, - { 23280, _gloffset_MultiTexCoord1dvARB }, - { 24122, _gloffset_MultiTexCoord1ivARB }, - { 24215, _gloffset_MultiTexCoord2ivARB }, - { 24554, _gloffset_MultiTexCoord1iARB }, - { 25825, _gloffset_MultiTexCoord4svARB }, - { 26343, _gloffset_MultiTexCoord1fARB }, - { 26606, _gloffset_MultiTexCoord4fARB }, - { 28835, _gloffset_MultiTexCoord2fvARB }, + { 5301, _gloffset_MultiTexCoord3dARB }, + { 5346, _gloffset_MultiTexCoord2iARB }, + { 5470, _gloffset_MultiTexCoord2svARB }, + { 7401, _gloffset_MultiTexCoord2fARB }, + { 9223, _gloffset_MultiTexCoord3fvARB }, + { 9744, _gloffset_MultiTexCoord4sARB }, + { 10378, _gloffset_MultiTexCoord2dvARB }, + { 10760, _gloffset_MultiTexCoord1svARB }, + { 11050, _gloffset_MultiTexCoord3svARB }, + { 11111, _gloffset_MultiTexCoord4iARB }, + { 11834, _gloffset_MultiTexCoord3iARB }, + { 12568, _gloffset_MultiTexCoord1dARB }, + { 12734, _gloffset_MultiTexCoord3dvARB }, + { 13898, _gloffset_MultiTexCoord3ivARB }, + { 13943, _gloffset_MultiTexCoord2sARB }, + { 15163, _gloffset_MultiTexCoord4ivARB }, + { 16792, _gloffset_ClientActiveTextureARB }, + { 19036, _gloffset_MultiTexCoord2dARB }, + { 19440, _gloffset_MultiTexCoord4dvARB }, + { 19726, _gloffset_MultiTexCoord4fvARB }, + { 20579, _gloffset_MultiTexCoord3fARB }, + { 22959, _gloffset_MultiTexCoord4dARB }, + { 23163, _gloffset_MultiTexCoord1sARB }, + { 23365, _gloffset_MultiTexCoord1dvARB }, + { 24175, _gloffset_MultiTexCoord1ivARB }, + { 24268, _gloffset_MultiTexCoord2ivARB }, + { 24607, _gloffset_MultiTexCoord1iARB }, + { 25878, _gloffset_MultiTexCoord4svARB }, + { 26396, _gloffset_MultiTexCoord1fARB }, + { 26659, _gloffset_MultiTexCoord4fARB }, + { 28927, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; @@ -4887,7 +4902,7 @@ static const struct gl_function_remap MESA_alt_functions[] = { #if defined(need_GL_3DFX_tbuffer) static const struct gl_function_remap GL_3DFX_tbuffer_functions[] = { - { 8237, -1 }, /* TbufferMask3DFX */ + { 8267, -1 }, /* TbufferMask3DFX */ { -1, -1 } }; #endif @@ -4899,6 +4914,13 @@ static const struct gl_function_remap GL_APPLE_flush_buffer_range_functions[] = }; #endif +#if defined(need_GL_APPLE_object_purgeable) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_APPLE_object_purgeable_functions[] = { + { -1, -1 } +}; +#endif + #if defined(need_GL_APPLE_texture_range) /* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_APPLE_texture_range_functions[] = { @@ -4951,10 +4973,10 @@ static const struct gl_function_remap GL_ARB_map_buffer_range_functions[] = { #if defined(need_GL_ARB_matrix_palette) static const struct gl_function_remap GL_ARB_matrix_palette_functions[] = { { 3339, -1 }, /* MatrixIndexusvARB */ - { 11630, -1 }, /* MatrixIndexuivARB */ - { 12799, -1 }, /* MatrixIndexPointerARB */ - { 17473, -1 }, /* CurrentPaletteMatrixARB */ - { 20238, -1 }, /* MatrixIndexubvARB */ + { 11655, -1 }, /* MatrixIndexuivARB */ + { 12856, -1 }, /* MatrixIndexPointerARB */ + { 17530, -1 }, /* CurrentPaletteMatrixARB */ + { 20323, -1 }, /* MatrixIndexubvARB */ { -1, -1 } }; #endif @@ -5025,15 +5047,15 @@ static const struct gl_function_remap GL_ARB_vertex_array_object_functions[] = { #if defined(need_GL_ARB_vertex_blend) static const struct gl_function_remap GL_ARB_vertex_blend_functions[] = { { 2226, -1 }, /* WeightubvARB */ - { 5603, -1 }, /* WeightivARB */ - { 9817, -1 }, /* WeightPointerARB */ - { 12268, -1 }, /* WeightfvARB */ - { 15553, -1 }, /* WeightbvARB */ - { 18619, -1 }, /* WeightusvARB */ - { 21264, -1 }, /* VertexBlendARB */ - { 26427, -1 }, /* WeightsvARB */ - { 28337, -1 }, /* WeightdvARB */ - { 29035, -1 }, /* WeightuivARB */ + { 5633, -1 }, /* WeightivARB */ + { 9847, -1 }, /* WeightPointerARB */ + { 12325, -1 }, /* WeightfvARB */ + { 15610, -1 }, /* WeightbvARB */ + { 18704, -1 }, /* WeightusvARB */ + { 21349, -1 }, /* VertexBlendARB */ + { 26480, -1 }, /* WeightsvARB */ + { 28429, -1 }, /* WeightdvARB */ + { 29127, -1 }, /* WeightuivARB */ { -1, -1 } }; #endif @@ -5124,15 +5146,15 @@ static const struct gl_function_remap GL_EXT_blend_func_separate_functions[] = { #if defined(need_GL_EXT_blend_minmax) static const struct gl_function_remap GL_EXT_blend_minmax_functions[] = { - { 9952, _gloffset_BlendEquation }, + { 9982, _gloffset_BlendEquation }, { -1, -1 } }; #endif #if defined(need_GL_EXT_color_subtable) static const struct gl_function_remap GL_EXT_color_subtable_functions[] = { - { 15049, _gloffset_ColorSubTable }, - { 28287, _gloffset_CopyColorSubTable }, + { 15106, _gloffset_ColorSubTable }, + { 28379, _gloffset_CopyColorSubTable }, { -1, -1 } }; #endif @@ -5149,55 +5171,55 @@ static const struct gl_function_remap GL_EXT_convolution_functions[] = { { 213, _gloffset_ConvolutionFilter1D }, { 2284, _gloffset_CopyConvolutionFilter1D }, { 3624, _gloffset_GetConvolutionParameteriv }, - { 7553, _gloffset_ConvolutionFilter2D }, - { 7719, _gloffset_ConvolutionParameteriv }, - { 8179, _gloffset_ConvolutionParameterfv }, - { 18194, _gloffset_GetSeparableFilter }, - { 21338, _gloffset_SeparableFilter2D }, - { 22167, _gloffset_ConvolutionParameteri }, - { 22290, _gloffset_ConvolutionParameterf }, - { 23743, _gloffset_GetConvolutionParameterfv }, - { 24597, _gloffset_GetConvolutionFilter }, - { 26841, _gloffset_CopyConvolutionFilter2D }, + { 7583, _gloffset_ConvolutionFilter2D }, + { 7749, _gloffset_ConvolutionParameteriv }, + { 8209, _gloffset_ConvolutionParameterfv }, + { 18279, _gloffset_GetSeparableFilter }, + { 21423, _gloffset_SeparableFilter2D }, + { 22252, _gloffset_ConvolutionParameteri }, + { 22375, _gloffset_ConvolutionParameterf }, + { 23828, _gloffset_GetConvolutionParameterfv }, + { 24650, _gloffset_GetConvolutionFilter }, + { 26894, _gloffset_CopyConvolutionFilter2D }, { -1, -1 } }; #endif #if defined(need_GL_EXT_coordinate_frame) static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { - { 9332, -1 }, /* TangentPointerEXT */ - { 11144, -1 }, /* Binormal3ivEXT */ - { 11762, -1 }, /* Tangent3sEXT */ - { 12864, -1 }, /* Tangent3fvEXT */ - { 16485, -1 }, /* Tangent3dvEXT */ - { 17171, -1 }, /* Binormal3bvEXT */ - { 18247, -1 }, /* Binormal3dEXT */ - { 20170, -1 }, /* Tangent3fEXT */ - { 22239, -1 }, /* Binormal3sEXT */ - { 22684, -1 }, /* Tangent3ivEXT */ - { 22703, -1 }, /* Tangent3dEXT */ - { 23507, -1 }, /* Binormal3svEXT */ - { 24020, -1 }, /* Binormal3fEXT */ - { 24872, -1 }, /* Binormal3dvEXT */ - { 26047, -1 }, /* Tangent3iEXT */ - { 27126, -1 }, /* Tangent3bvEXT */ - { 27535, -1 }, /* Tangent3bEXT */ - { 28060, -1 }, /* Binormal3fvEXT */ - { 28734, -1 }, /* BinormalPointerEXT */ - { 29139, -1 }, /* Tangent3svEXT */ - { 29576, -1 }, /* Binormal3bEXT */ - { 29753, -1 }, /* Binormal3iEXT */ + { 9362, -1 }, /* TangentPointerEXT */ + { 11169, -1 }, /* Binormal3ivEXT */ + { 11787, -1 }, /* Tangent3sEXT */ + { 12921, -1 }, /* Tangent3fvEXT */ + { 16542, -1 }, /* Tangent3dvEXT */ + { 17228, -1 }, /* Binormal3bvEXT */ + { 18332, -1 }, /* Binormal3dEXT */ + { 20255, -1 }, /* Tangent3fEXT */ + { 22324, -1 }, /* Binormal3sEXT */ + { 22769, -1 }, /* Tangent3ivEXT */ + { 22788, -1 }, /* Tangent3dEXT */ + { 23592, -1 }, /* Binormal3svEXT */ + { 24073, -1 }, /* Binormal3fEXT */ + { 24925, -1 }, /* Binormal3dvEXT */ + { 26100, -1 }, /* Tangent3iEXT */ + { 27179, -1 }, /* Tangent3bvEXT */ + { 27588, -1 }, /* Tangent3bEXT */ + { 28152, -1 }, /* Binormal3fvEXT */ + { 28826, -1 }, /* BinormalPointerEXT */ + { 29231, -1 }, /* Tangent3svEXT */ + { 29668, -1 }, /* Binormal3bEXT */ + { 29845, -1 }, /* Binormal3iEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_copy_texture) static const struct gl_function_remap GL_EXT_copy_texture_functions[] = { - { 13307, _gloffset_CopyTexSubImage3D }, - { 14789, _gloffset_CopyTexImage2D }, - { 21775, _gloffset_CopyTexImage1D }, - { 24278, _gloffset_CopyTexSubImage2D }, - { 26479, _gloffset_CopyTexSubImage1D }, + { 13364, _gloffset_CopyTexSubImage3D }, + { 14846, _gloffset_CopyTexImage2D }, + { 21860, _gloffset_CopyTexImage1D }, + { 24331, _gloffset_CopyTexSubImage2D }, + { 26532, _gloffset_CopyTexSubImage1D }, { -1, -1 } }; #endif @@ -5225,7 +5247,7 @@ static const struct gl_function_remap GL_EXT_draw_buffers2_functions[] = { #if defined(need_GL_EXT_draw_range_elements) static const struct gl_function_remap GL_EXT_draw_range_elements_functions[] = { - { 8462, _gloffset_DrawRangeElements }, + { 8492, _gloffset_DrawRangeElements }, { -1, -1 } }; #endif @@ -5269,37 +5291,37 @@ static const struct gl_function_remap GL_EXT_gpu_program_parameters_functions[] static const struct gl_function_remap GL_EXT_histogram_functions[] = { { 812, _gloffset_Histogram }, { 3088, _gloffset_ResetHistogram }, - { 8834, _gloffset_GetMinmax }, - { 13641, _gloffset_GetHistogramParameterfv }, - { 21700, _gloffset_GetMinmaxParameteriv }, - { 23633, _gloffset_ResetMinmax }, - { 24494, _gloffset_GetHistogramParameteriv }, - { 25550, _gloffset_GetHistogram }, - { 27912, _gloffset_Minmax }, - { 29374, _gloffset_GetMinmaxParameterfv }, + { 8864, _gloffset_GetMinmax }, + { 13698, _gloffset_GetHistogramParameterfv }, + { 21785, _gloffset_GetMinmaxParameteriv }, + { 23718, _gloffset_ResetMinmax }, + { 24547, _gloffset_GetHistogramParameteriv }, + { 25603, _gloffset_GetHistogram }, + { 27965, _gloffset_Minmax }, + { 29466, _gloffset_GetMinmaxParameterfv }, { -1, -1 } }; #endif #if defined(need_GL_EXT_index_func) static const struct gl_function_remap GL_EXT_index_func_functions[] = { - { 10179, -1 }, /* IndexFuncEXT */ + { 10209, -1 }, /* IndexFuncEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_index_material) static const struct gl_function_remap GL_EXT_index_material_functions[] = { - { 18706, -1 }, /* IndexMaterialEXT */ + { 18791, -1 }, /* IndexMaterialEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_light_texture) static const struct gl_function_remap GL_EXT_light_texture_functions[] = { - { 23527, -1 }, /* ApplyTextureEXT */ - { 23587, -1 }, /* TextureMaterialEXT */ - { 23612, -1 }, /* TextureLightEXT */ + { 23612, -1 }, /* ApplyTextureEXT */ + { 23672, -1 }, /* TextureMaterialEXT */ + { 23697, -1 }, /* TextureLightEXT */ { -1, -1 } }; #endif @@ -5320,20 +5342,20 @@ static const struct gl_function_remap GL_EXT_multisample_functions[] = { #if defined(need_GL_EXT_paletted_texture) static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = { - { 7415, _gloffset_ColorTable }, - { 13487, _gloffset_GetColorTable }, - { 20353, _gloffset_GetColorTableParameterfv }, - { 22346, _gloffset_GetColorTableParameteriv }, + { 7445, _gloffset_ColorTable }, + { 13544, _gloffset_GetColorTable }, + { 20438, _gloffset_GetColorTableParameterfv }, + { 22431, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif #if defined(need_GL_EXT_pixel_transform) static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = { - { 9573, -1 }, /* PixelTransformParameterfvEXT */ - { 19320, -1 }, /* PixelTransformParameterfEXT */ - { 19400, -1 }, /* PixelTransformParameteriEXT */ - { 28698, -1 }, /* PixelTransformParameterivEXT */ + { 9603, -1 }, /* PixelTransformParameterfvEXT */ + { 19405, -1 }, /* PixelTransformParameterfEXT */ + { 19485, -1 }, /* PixelTransformParameteriEXT */ + { 28790, -1 }, /* PixelTransformParameterivEXT */ { -1, -1 } }; #endif @@ -5375,8 +5397,8 @@ static const struct gl_function_remap GL_EXT_stencil_two_side_functions[] = { #if defined(need_GL_EXT_subtexture) static const struct gl_function_remap GL_EXT_subtexture_functions[] = { - { 6136, _gloffset_TexSubImage1D }, - { 9448, _gloffset_TexSubImage2D }, + { 6166, _gloffset_TexSubImage1D }, + { 9478, _gloffset_TexSubImage2D }, { -1, -1 } }; #endif @@ -5384,7 +5406,7 @@ static const struct gl_function_remap GL_EXT_subtexture_functions[] = { #if defined(need_GL_EXT_texture3D) static const struct gl_function_remap GL_EXT_texture3D_functions[] = { { 1658, _gloffset_TexImage3D }, - { 20122, _gloffset_TexSubImage3D }, + { 20207, _gloffset_TexSubImage3D }, { -1, -1 } }; #endif @@ -5399,18 +5421,18 @@ static const struct gl_function_remap GL_EXT_texture_array_functions[] = { #if defined(need_GL_EXT_texture_object) static const struct gl_function_remap GL_EXT_texture_object_functions[] = { { 2964, _gloffset_PrioritizeTextures }, - { 6585, _gloffset_AreTexturesResident }, - { 12038, _gloffset_GenTextures }, - { 13973, _gloffset_DeleteTextures }, - { 17224, _gloffset_IsTexture }, - { 26544, _gloffset_BindTexture }, + { 6615, _gloffset_AreTexturesResident }, + { 12063, _gloffset_GenTextures }, + { 14030, _gloffset_DeleteTextures }, + { 17281, _gloffset_IsTexture }, + { 26597, _gloffset_BindTexture }, { -1, -1 } }; #endif #if defined(need_GL_EXT_texture_perturb_normal) static const struct gl_function_remap GL_EXT_texture_perturb_normal_functions[] = { - { 12218, -1 }, /* TextureNormalEXT */ + { 12275, -1 }, /* TextureNormalEXT */ { -1, -1 } }; #endif @@ -5425,18 +5447,18 @@ static const struct gl_function_remap GL_EXT_timer_query_functions[] = { #if defined(need_GL_EXT_vertex_array) /* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_EXT_vertex_array_functions[] = { - { 21527, _gloffset_ArrayElement }, - { 27500, _gloffset_GetPointerv }, - { 29001, _gloffset_DrawArrays }, + { 21612, _gloffset_ArrayElement }, + { 27553, _gloffset_GetPointerv }, + { 29093, _gloffset_DrawArrays }, { -1, -1 } }; #endif #if defined(need_GL_EXT_vertex_weighting) static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { - { 17254, -1 }, /* VertexWeightfvEXT */ - { 23998, -1 }, /* VertexWeightfEXT */ - { 25519, -1 }, /* VertexWeightPointerEXT */ + { 17311, -1 }, /* VertexWeightfvEXT */ + { 24051, -1 }, /* VertexWeightfEXT */ + { 25572, -1 }, /* VertexWeightPointerEXT */ { -1, -1 } }; #endif @@ -5445,10 +5467,10 @@ static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { static const struct gl_function_remap GL_HP_image_transform_functions[] = { { 2157, -1 }, /* GetImageTransformParameterfvHP */ { 3305, -1 }, /* ImageTransformParameterfHP */ - { 9026, -1 }, /* ImageTransformParameterfvHP */ - { 10614, -1 }, /* ImageTransformParameteriHP */ - { 10915, -1 }, /* GetImageTransformParameterivHP */ - { 17318, -1 }, /* ImageTransformParameterivHP */ + { 9056, -1 }, /* ImageTransformParameterfvHP */ + { 10678, -1 }, /* ImageTransformParameteriHP */ + { 10940, -1 }, /* GetImageTransformParameterivHP */ + { 17375, -1 }, /* ImageTransformParameterivHP */ { -1, -1 } }; #endif @@ -5463,13 +5485,13 @@ static const struct gl_function_remap GL_IBM_multimode_draw_arrays_functions[] = #if defined(need_GL_IBM_vertex_array_lists) static const struct gl_function_remap GL_IBM_vertex_array_lists_functions[] = { { 3857, -1 }, /* SecondaryColorPointerListIBM */ - { 5137, -1 }, /* NormalPointerListIBM */ - { 6759, -1 }, /* FogCoordPointerListIBM */ - { 7066, -1 }, /* VertexPointerListIBM */ - { 10535, -1 }, /* ColorPointerListIBM */ - { 11869, -1 }, /* TexCoordPointerListIBM */ - { 12240, -1 }, /* IndexPointerListIBM */ - { 29317, -1 }, /* EdgeFlagPointerListIBM */ + { 5167, -1 }, /* NormalPointerListIBM */ + { 6789, -1 }, /* FogCoordPointerListIBM */ + { 7096, -1 }, /* VertexPointerListIBM */ + { 10599, -1 }, /* ColorPointerListIBM */ + { 11894, -1 }, /* TexCoordPointerListIBM */ + { 12297, -1 }, /* IndexPointerListIBM */ + { 29409, -1 }, /* EdgeFlagPointerListIBM */ { -1, -1 } }; #endif @@ -5483,10 +5505,10 @@ static const struct gl_function_remap GL_INGR_blend_func_separate_functions[] = #if defined(need_GL_INTEL_parallel_arrays) static const struct gl_function_remap GL_INTEL_parallel_arrays_functions[] = { - { 11256, -1 }, /* VertexPointervINTEL */ - { 13734, -1 }, /* ColorPointervINTEL */ - { 26815, -1 }, /* NormalPointervINTEL */ - { 27241, -1 }, /* TexCoordPointervINTEL */ + { 11281, -1 }, /* VertexPointervINTEL */ + { 13791, -1 }, /* ColorPointervINTEL */ + { 26868, -1 }, /* NormalPointervINTEL */ + { 27294, -1 }, /* TexCoordPointervINTEL */ { -1, -1 } }; #endif @@ -5503,7 +5525,7 @@ static const struct gl_function_remap GL_MESA_shader_debug_functions[] = { { 1522, -1 }, /* GetDebugLogLengthMESA */ { 3063, -1 }, /* ClearDebugLogMESA */ { 4018, -1 }, /* GetDebugLogMESA */ - { 27693, -1 }, /* CreateDebugObjectMESA */ + { 27746, -1 }, /* CreateDebugObjectMESA */ { -1, -1 } }; #endif @@ -5524,15 +5546,15 @@ static const struct gl_function_remap GL_NV_condtitional_render_functions[] = { #if defined(need_GL_NV_evaluators) static const struct gl_function_remap GL_NV_evaluators_functions[] = { - { 5804, -1 }, /* GetMapAttribParameterivNV */ - { 7521, -1 }, /* MapControlPointsNV */ - { 7620, -1 }, /* MapParameterfvNV */ - { 9431, -1 }, /* EvalMapsNV */ - { 15223, -1 }, /* GetMapAttribParameterfvNV */ - { 15389, -1 }, /* MapParameterivNV */ - { 22090, -1 }, /* GetMapParameterivNV */ - { 22588, -1 }, /* GetMapParameterfvNV */ - { 26151, -1 }, /* GetMapControlPointsNV */ + { 5834, -1 }, /* GetMapAttribParameterivNV */ + { 7551, -1 }, /* MapControlPointsNV */ + { 7650, -1 }, /* MapParameterfvNV */ + { 9461, -1 }, /* EvalMapsNV */ + { 15280, -1 }, /* GetMapAttribParameterfvNV */ + { 15446, -1 }, /* MapParameterivNV */ + { 22175, -1 }, /* GetMapParameterivNV */ + { 22673, -1 }, /* GetMapParameterfvNV */ + { 26204, -1 }, /* GetMapControlPointsNV */ { -1, -1 } }; #endif @@ -5567,8 +5589,8 @@ static const struct gl_function_remap GL_NV_register_combiners_functions[] = { #if defined(need_GL_NV_register_combiners2) static const struct gl_function_remap GL_NV_register_combiners2_functions[] = { - { 14126, -1 }, /* CombinerStageParameterfvNV */ - { 14441, -1 }, /* GetCombinerStageParameterfvNV */ + { 14183, -1 }, /* CombinerStageParameterfvNV */ + { 14498, -1 }, /* GetCombinerStageParameterfvNV */ { -1, -1 } }; #endif @@ -5596,23 +5618,23 @@ static const struct gl_function_remap GL_OES_EGL_image_functions[] = { #if defined(need_GL_PGI_misc_hints) static const struct gl_function_remap GL_PGI_misc_hints_functions[] = { - { 7705, -1 }, /* HintPGI */ + { 7735, -1 }, /* HintPGI */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_detail_texture) static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = { - { 14414, -1 }, /* GetDetailTexFuncSGIS */ - { 14734, -1 }, /* DetailTexFuncSGIS */ + { 14471, -1 }, /* GetDetailTexFuncSGIS */ + { 14791, -1 }, /* DetailTexFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_fog_function) static const struct gl_function_remap GL_SGIS_fog_function_functions[] = { - { 24260, -1 }, /* FogFuncSGIS */ - { 24925, -1 }, /* GetFogFuncSGIS */ + { 24313, -1 }, /* FogFuncSGIS */ + { 24978, -1 }, /* GetFogFuncSGIS */ { -1, -1 } }; #endif @@ -5640,8 +5662,8 @@ static const struct gl_function_remap GL_SGIS_point_parameters_functions[] = { #if defined(need_GL_SGIS_sharpen_texture) static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = { - { 5865, -1 }, /* GetSharpenTexFuncSGIS */ - { 19615, -1 }, /* SharpenTexFuncSGIS */ + { 5895, -1 }, /* GetSharpenTexFuncSGIS */ + { 19700, -1 }, /* SharpenTexFuncSGIS */ { -1, -1 } }; #endif @@ -5649,22 +5671,22 @@ static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = { #if defined(need_GL_SGIS_texture4D) static const struct gl_function_remap GL_SGIS_texture4D_functions[] = { { 894, -1 }, /* TexImage4DSGIS */ - { 14042, -1 }, /* TexSubImage4DSGIS */ + { 14099, -1 }, /* TexSubImage4DSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture_color_mask) static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = { - { 13440, -1 }, /* TextureColorMaskSGIS */ + { 13497, -1 }, /* TextureColorMaskSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture_filter4) static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = { - { 6042, -1 }, /* GetTexFilterFuncSGIS */ - { 14560, -1 }, /* TexFilterFuncSGIS */ + { 6072, -1 }, /* GetTexFilterFuncSGIS */ + { 14617, -1 }, /* TexFilterFuncSGIS */ { -1, -1 } }; #endif @@ -5674,16 +5696,16 @@ static const struct gl_function_remap GL_SGIX_async_functions[] = { { 3014, -1 }, /* AsyncMarkerSGIX */ { 3997, -1 }, /* FinishAsyncSGIX */ { 4734, -1 }, /* PollAsyncSGIX */ - { 19762, -1 }, /* DeleteAsyncMarkersSGIX */ - { 19791, -1 }, /* IsAsyncMarkerSGIX */ - { 29114, -1 }, /* GenAsyncMarkersSGIX */ + { 19847, -1 }, /* DeleteAsyncMarkersSGIX */ + { 19876, -1 }, /* IsAsyncMarkerSGIX */ + { 29206, -1 }, /* GenAsyncMarkersSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_flush_raster) static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = { - { 6413, -1 }, /* FlushRasterSGIX */ + { 6443, -1 }, /* FlushRasterSGIX */ { -1, -1 } }; #endif @@ -5693,35 +5715,35 @@ static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { { 2410, -1 }, /* FragmentMaterialfvSGIX */ { 2906, -1 }, /* FragmentLightModelivSGIX */ { 4685, -1 }, /* FragmentLightiSGIX */ - { 5545, -1 }, /* GetFragmentMaterialfvSGIX */ - { 7133, -1 }, /* FragmentMaterialfSGIX */ - { 7294, -1 }, /* GetFragmentLightivSGIX */ - { 8131, -1 }, /* FragmentLightModeliSGIX */ - { 9494, -1 }, /* FragmentLightivSGIX */ - { 9760, -1 }, /* GetFragmentMaterialivSGIX */ - { 17141, -1 }, /* FragmentLightModelfSGIX */ - { 17441, -1 }, /* FragmentColorMaterialSGIX */ - { 17813, -1 }, /* FragmentMaterialiSGIX */ - { 19034, -1 }, /* LightEnviSGIX */ - { 20445, -1 }, /* FragmentLightModelfvSGIX */ - { 20754, -1 }, /* FragmentLightfvSGIX */ - { 25401, -1 }, /* FragmentLightfSGIX */ - { 28030, -1 }, /* GetFragmentLightfvSGIX */ - { 29597, -1 }, /* FragmentMaterialivSGIX */ + { 5575, -1 }, /* GetFragmentMaterialfvSGIX */ + { 7163, -1 }, /* FragmentMaterialfSGIX */ + { 7324, -1 }, /* GetFragmentLightivSGIX */ + { 8161, -1 }, /* FragmentLightModeliSGIX */ + { 9524, -1 }, /* FragmentLightivSGIX */ + { 9790, -1 }, /* GetFragmentMaterialivSGIX */ + { 17198, -1 }, /* FragmentLightModelfSGIX */ + { 17498, -1 }, /* FragmentColorMaterialSGIX */ + { 17898, -1 }, /* FragmentMaterialiSGIX */ + { 19119, -1 }, /* LightEnviSGIX */ + { 20530, -1 }, /* FragmentLightModelfvSGIX */ + { 20839, -1 }, /* FragmentLightfvSGIX */ + { 25454, -1 }, /* FragmentLightfSGIX */ + { 28122, -1 }, /* GetFragmentLightfvSGIX */ + { 29689, -1 }, /* FragmentMaterialivSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_framezoom) static const struct gl_function_remap GL_SGIX_framezoom_functions[] = { - { 19814, -1 }, /* FrameZoomSGIX */ + { 19899, -1 }, /* FrameZoomSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_igloo_interface) static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { - { 25709, -1 }, /* IglooInterfaceSGIX */ + { 25762, -1 }, /* IglooInterfaceSGIX */ { -1, -1 } }; #endif @@ -5729,11 +5751,11 @@ static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { #if defined(need_GL_SGIX_instruments) static const struct gl_function_remap GL_SGIX_instruments_functions[] = { { 2573, -1 }, /* ReadInstrumentsSGIX */ - { 5621, -1 }, /* PollInstrumentsSGIX */ - { 9392, -1 }, /* GetInstrumentsSGIX */ - { 11467, -1 }, /* StartInstrumentsSGIX */ - { 14160, -1 }, /* StopInstrumentsSGIX */ - { 15766, -1 }, /* InstrumentsBufferSGIX */ + { 5651, -1 }, /* PollInstrumentsSGIX */ + { 9422, -1 }, /* GetInstrumentsSGIX */ + { 11492, -1 }, /* StartInstrumentsSGIX */ + { 14217, -1 }, /* StopInstrumentsSGIX */ + { 15823, -1 }, /* InstrumentsBufferSGIX */ { -1, -1 } }; #endif @@ -5742,10 +5764,10 @@ static const struct gl_function_remap GL_SGIX_instruments_functions[] = { static const struct gl_function_remap GL_SGIX_list_priority_functions[] = { { 1125, -1 }, /* ListParameterfSGIX */ { 2763, -1 }, /* GetListParameterfvSGIX */ - { 15681, -1 }, /* ListParameteriSGIX */ - { 16435, -1 }, /* ListParameterfvSGIX */ - { 18440, -1 }, /* ListParameterivSGIX */ - { 29158, -1 }, /* GetListParameterivSGIX */ + { 15738, -1 }, /* ListParameteriSGIX */ + { 16492, -1 }, /* ListParameterfvSGIX */ + { 18525, -1 }, /* ListParameterivSGIX */ + { 29250, -1 }, /* GetListParameterivSGIX */ { -1, -1 } }; #endif @@ -5760,53 +5782,53 @@ static const struct gl_function_remap GL_SGIX_pixel_texture_functions[] = { #if defined(need_GL_SGIX_polynomial_ffd) static const struct gl_function_remap GL_SGIX_polynomial_ffd_functions[] = { { 3251, -1 }, /* LoadIdentityDeformationMapSGIX */ - { 10835, -1 }, /* DeformationMap3dSGIX */ - { 14260, -1 }, /* DeformSGIX */ - { 21639, -1 }, /* DeformationMap3fSGIX */ + { 14317, -1 }, /* DeformSGIX */ + { 21724, -1 }, /* DeformationMap3fSGIX */ + { 28010, -1 }, /* DeformationMap3dSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_reference_plane) static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { - { 12991, -1 }, /* ReferencePlaneSGIX */ + { 13048, -1 }, /* ReferencePlaneSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_sprite) static const struct gl_function_remap GL_SGIX_sprite_functions[] = { - { 8547, -1 }, /* SpriteParameterfvSGIX */ - { 18268, -1 }, /* SpriteParameteriSGIX */ - { 23667, -1 }, /* SpriteParameterfSGIX */ - { 26273, -1 }, /* SpriteParameterivSGIX */ + { 8577, -1 }, /* SpriteParameterfvSGIX */ + { 18353, -1 }, /* SpriteParameteriSGIX */ + { 23752, -1 }, /* SpriteParameterfSGIX */ + { 26326, -1 }, /* SpriteParameterivSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_tag_sample_buffer) static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = { - { 18327, -1 }, /* TagSampleBufferSGIX */ + { 18412, -1 }, /* TagSampleBufferSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGI_color_table) static const struct gl_function_remap GL_SGI_color_table_functions[] = { - { 6703, _gloffset_ColorTableParameteriv }, - { 7415, _gloffset_ColorTable }, - { 13487, _gloffset_GetColorTable }, - { 13597, _gloffset_CopyColorTable }, - { 17085, _gloffset_ColorTableParameterfv }, - { 20353, _gloffset_GetColorTableParameterfv }, - { 22346, _gloffset_GetColorTableParameteriv }, + { 6733, _gloffset_ColorTableParameteriv }, + { 7445, _gloffset_ColorTable }, + { 13544, _gloffset_GetColorTable }, + { 13654, _gloffset_CopyColorTable }, + { 17142, _gloffset_ColorTableParameterfv }, + { 20438, _gloffset_GetColorTableParameterfv }, + { 22431, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif #if defined(need_GL_SUNX_constant_data) static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { - { 28008, -1 }, /* FinishTextureSUNX */ + { 28100, -1 }, /* FinishTextureSUNX */ { -1, -1 } }; #endif @@ -5815,19 +5837,19 @@ static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { static const struct gl_function_remap GL_SUN_global_alpha_functions[] = { { 3035, -1 }, /* GlobalAlphaFactorubSUN */ { 4224, -1 }, /* GlobalAlphaFactoriSUN */ - { 5646, -1 }, /* GlobalAlphaFactordSUN */ - { 8631, -1 }, /* GlobalAlphaFactoruiSUN */ - { 8983, -1 }, /* GlobalAlphaFactorbSUN */ - { 11782, -1 }, /* GlobalAlphaFactorfSUN */ - { 11901, -1 }, /* GlobalAlphaFactorusSUN */ - { 20053, -1 }, /* GlobalAlphaFactorsSUN */ + { 5676, -1 }, /* GlobalAlphaFactordSUN */ + { 8661, -1 }, /* GlobalAlphaFactoruiSUN */ + { 9013, -1 }, /* GlobalAlphaFactorbSUN */ + { 11807, -1 }, /* GlobalAlphaFactorfSUN */ + { 11926, -1 }, /* GlobalAlphaFactorusSUN */ + { 20138, -1 }, /* GlobalAlphaFactorsSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_mesh_array) static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { - { 26085, -1 }, /* DrawMeshArraysSUN */ + { 26138, -1 }, /* DrawMeshArraysSUN */ { -1, -1 } }; #endif @@ -5835,12 +5857,12 @@ static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { #if defined(need_GL_SUN_triangle_list) static const struct gl_function_remap GL_SUN_triangle_list_functions[] = { { 3971, -1 }, /* ReplacementCodeubSUN */ - { 5485, -1 }, /* ReplacementCodeubvSUN */ - { 16806, -1 }, /* ReplacementCodeusvSUN */ - { 16994, -1 }, /* ReplacementCodePointerSUN */ - { 18351, -1 }, /* ReplacementCodeusSUN */ - { 19098, -1 }, /* ReplacementCodeuiSUN */ - { 26730, -1 }, /* ReplacementCodeuivSUN */ + { 5515, -1 }, /* ReplacementCodeubvSUN */ + { 16863, -1 }, /* ReplacementCodeusvSUN */ + { 17051, -1 }, /* ReplacementCodePointerSUN */ + { 18436, -1 }, /* ReplacementCodeusSUN */ + { 19183, -1 }, /* ReplacementCodeuiSUN */ + { 26783, -1 }, /* ReplacementCodeuivSUN */ { -1, -1 } }; #endif @@ -5858,35 +5880,35 @@ static const struct gl_function_remap GL_SUN_vertex_functions[] = { { 4181, -1 }, /* TexCoord2fVertex3fSUN */ { 4480, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */ { 4810, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */ - { 5380, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ - { 6450, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ - { 7162, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ - { 7930, -1 }, /* Color3fVertex3fSUN */ - { 8942, -1 }, /* Color3fVertex3fvSUN */ - { 9357, -1 }, /* Color4fNormal3fVertex3fvSUN */ - { 10058, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ - { 11330, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ - { 12722, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ - { 13133, -1 }, /* TexCoord2fColor3fVertex3fSUN */ - { 14185, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ - { 14519, -1 }, /* Color4ubVertex2fvSUN */ - { 14759, -1 }, /* Normal3fVertex3fSUN */ - { 15707, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ - { 15968, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ - { 16635, -1 }, /* TexCoord2fVertex3fvSUN */ - { 17411, -1 }, /* Color4ubVertex2fSUN */ - { 17604, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ - { 19486, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ - { 19833, -1 }, /* Normal3fVertex3fvSUN */ - { 20262, -1 }, /* Color4fNormal3fVertex3fSUN */ - { 21171, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ - { 21391, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ - { 23121, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ - { 24376, -1 }, /* TexCoord4fVertex4fSUN */ - { 24802, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ - { 25128, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ - { 25255, -1 }, /* TexCoord4fVertex4fvSUN */ - { 25957, -1 }, /* ReplacementCodeuiVertex3fSUN */ + { 5410, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ + { 6480, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ + { 7192, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ + { 7960, -1 }, /* Color3fVertex3fSUN */ + { 8972, -1 }, /* Color3fVertex3fvSUN */ + { 9387, -1 }, /* Color4fNormal3fVertex3fvSUN */ + { 10088, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ + { 11355, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ + { 12779, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ + { 13190, -1 }, /* TexCoord2fColor3fVertex3fSUN */ + { 14242, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ + { 14576, -1 }, /* Color4ubVertex2fvSUN */ + { 14816, -1 }, /* Normal3fVertex3fSUN */ + { 15764, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ + { 16025, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ + { 16692, -1 }, /* TexCoord2fVertex3fvSUN */ + { 17468, -1 }, /* Color4ubVertex2fSUN */ + { 17689, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ + { 19571, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ + { 19918, -1 }, /* Normal3fVertex3fvSUN */ + { 20347, -1 }, /* Color4fNormal3fVertex3fSUN */ + { 21256, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ + { 21476, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ + { 23206, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ + { 24429, -1 }, /* TexCoord4fVertex4fSUN */ + { 24855, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ + { 25181, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ + { 25308, -1 }, /* TexCoord4fVertex4fvSUN */ + { 26010, -1 }, /* ReplacementCodeuiVertex3fSUN */ { -1, -1 } }; #endif @@ -5897,37 +5919,37 @@ static const struct gl_function_remap GL_VERSION_1_3_functions[] = { { 381, _gloffset_MultiTexCoord3sARB }, { 613, _gloffset_ActiveTextureARB }, { 3761, _gloffset_MultiTexCoord1fvARB }, - { 5271, _gloffset_MultiTexCoord3dARB }, - { 5316, _gloffset_MultiTexCoord2iARB }, - { 5440, _gloffset_MultiTexCoord2svARB }, - { 7371, _gloffset_MultiTexCoord2fARB }, - { 9193, _gloffset_MultiTexCoord3fvARB }, - { 9714, _gloffset_MultiTexCoord4sARB }, - { 10314, _gloffset_MultiTexCoord2dvARB }, - { 10696, _gloffset_MultiTexCoord1svARB }, - { 11025, _gloffset_MultiTexCoord3svARB }, - { 11086, _gloffset_MultiTexCoord4iARB }, - { 11809, _gloffset_MultiTexCoord3iARB }, - { 12511, _gloffset_MultiTexCoord1dARB }, - { 12677, _gloffset_MultiTexCoord3dvARB }, - { 13841, _gloffset_MultiTexCoord3ivARB }, - { 13886, _gloffset_MultiTexCoord2sARB }, - { 15106, _gloffset_MultiTexCoord4ivARB }, - { 16735, _gloffset_ClientActiveTextureARB }, - { 18951, _gloffset_MultiTexCoord2dARB }, - { 19355, _gloffset_MultiTexCoord4dvARB }, - { 19641, _gloffset_MultiTexCoord4fvARB }, - { 20494, _gloffset_MultiTexCoord3fARB }, - { 22874, _gloffset_MultiTexCoord4dARB }, - { 23078, _gloffset_MultiTexCoord1sARB }, - { 23280, _gloffset_MultiTexCoord1dvARB }, - { 24122, _gloffset_MultiTexCoord1ivARB }, - { 24215, _gloffset_MultiTexCoord2ivARB }, - { 24554, _gloffset_MultiTexCoord1iARB }, - { 25825, _gloffset_MultiTexCoord4svARB }, - { 26343, _gloffset_MultiTexCoord1fARB }, - { 26606, _gloffset_MultiTexCoord4fARB }, - { 28835, _gloffset_MultiTexCoord2fvARB }, + { 5301, _gloffset_MultiTexCoord3dARB }, + { 5346, _gloffset_MultiTexCoord2iARB }, + { 5470, _gloffset_MultiTexCoord2svARB }, + { 7401, _gloffset_MultiTexCoord2fARB }, + { 9223, _gloffset_MultiTexCoord3fvARB }, + { 9744, _gloffset_MultiTexCoord4sARB }, + { 10378, _gloffset_MultiTexCoord2dvARB }, + { 10760, _gloffset_MultiTexCoord1svARB }, + { 11050, _gloffset_MultiTexCoord3svARB }, + { 11111, _gloffset_MultiTexCoord4iARB }, + { 11834, _gloffset_MultiTexCoord3iARB }, + { 12568, _gloffset_MultiTexCoord1dARB }, + { 12734, _gloffset_MultiTexCoord3dvARB }, + { 13898, _gloffset_MultiTexCoord3ivARB }, + { 13943, _gloffset_MultiTexCoord2sARB }, + { 15163, _gloffset_MultiTexCoord4ivARB }, + { 16792, _gloffset_ClientActiveTextureARB }, + { 19036, _gloffset_MultiTexCoord2dARB }, + { 19440, _gloffset_MultiTexCoord4dvARB }, + { 19726, _gloffset_MultiTexCoord4fvARB }, + { 20579, _gloffset_MultiTexCoord3fARB }, + { 22959, _gloffset_MultiTexCoord4dARB }, + { 23163, _gloffset_MultiTexCoord1sARB }, + { 23365, _gloffset_MultiTexCoord1dvARB }, + { 24175, _gloffset_MultiTexCoord1ivARB }, + { 24268, _gloffset_MultiTexCoord2ivARB }, + { 24607, _gloffset_MultiTexCoord1iARB }, + { 25878, _gloffset_MultiTexCoord4svARB }, + { 26396, _gloffset_MultiTexCoord1fARB }, + { 26659, _gloffset_MultiTexCoord4fARB }, + { 28927, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; #endif diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 3fbdb4abb3..478adc6520 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -1027,16 +1027,19 @@ gl_dispatch_functions_start: HIDDEN(gl_dispatch_stub_796) GL_STUB(gl_dispatch_stub_797, _gloffset_TextureRangeAPPLE) HIDDEN(gl_dispatch_stub_797) - GL_STUB(gl_dispatch_stub_798, _gloffset_StencilFuncSeparateATI) - HIDDEN(gl_dispatch_stub_798) - GL_STUB(gl_dispatch_stub_799, _gloffset_ProgramEnvParameters4fvEXT) - HIDDEN(gl_dispatch_stub_799) - GL_STUB(gl_dispatch_stub_800, _gloffset_ProgramLocalParameters4fvEXT) - HIDDEN(gl_dispatch_stub_800) - GL_STUB(gl_dispatch_stub_801, _gloffset_GetQueryObjecti64vEXT) + GL_STUB(glGetObjectParameterivAPPLE, _gloffset_GetObjectParameterivAPPLE) + GL_STUB(glObjectPurgeableAPPLE, _gloffset_ObjectPurgeableAPPLE) + GL_STUB(glObjectUnpurgeableAPPLE, _gloffset_ObjectUnpurgeableAPPLE) + GL_STUB(gl_dispatch_stub_801, _gloffset_StencilFuncSeparateATI) HIDDEN(gl_dispatch_stub_801) - GL_STUB(gl_dispatch_stub_802, _gloffset_GetQueryObjectui64vEXT) + GL_STUB(gl_dispatch_stub_802, _gloffset_ProgramEnvParameters4fvEXT) HIDDEN(gl_dispatch_stub_802) + GL_STUB(gl_dispatch_stub_803, _gloffset_ProgramLocalParameters4fvEXT) + HIDDEN(gl_dispatch_stub_803) + GL_STUB(gl_dispatch_stub_804, _gloffset_GetQueryObjecti64vEXT) + HIDDEN(gl_dispatch_stub_804) + GL_STUB(gl_dispatch_stub_805, _gloffset_GetQueryObjectui64vEXT) + HIDDEN(gl_dispatch_stub_805) GL_STUB(glEGLImageTargetRenderbufferStorageOES, _gloffset_EGLImageTargetRenderbufferStorageOES) GL_STUB(glEGLImageTargetTexture2DOES, _gloffset_EGLImageTargetTexture2DOES) GL_STUB_ALIAS(glArrayElementEXT, glArrayElement) diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index 03a2c999ff..a76cbb07d5 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -30201,10 +30201,9 @@ GL_PREFIX(_dispatch_stub_797): .size GL_PREFIX(_dispatch_stub_797), .-GL_PREFIX(_dispatch_stub_797) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_798) - .type GL_PREFIX(_dispatch_stub_798), @function - HIDDEN(GL_PREFIX(_dispatch_stub_798)) -GL_PREFIX(_dispatch_stub_798): + .globl GL_PREFIX(GetObjectParameterivAPPLE) + .type GL_PREFIX(GetObjectParameterivAPPLE), @function +GL_PREFIX(GetObjectParameterivAPPLE): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 6384(%rax), %r11 @@ -30244,13 +30243,12 @@ GL_PREFIX(_dispatch_stub_798): movq 6384(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_798), .-GL_PREFIX(_dispatch_stub_798) + .size GL_PREFIX(GetObjectParameterivAPPLE), .-GL_PREFIX(GetObjectParameterivAPPLE) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_799) - .type GL_PREFIX(_dispatch_stub_799), @function - HIDDEN(GL_PREFIX(_dispatch_stub_799)) -GL_PREFIX(_dispatch_stub_799): + .globl GL_PREFIX(ObjectPurgeableAPPLE) + .type GL_PREFIX(ObjectPurgeableAPPLE), @function +GL_PREFIX(ObjectPurgeableAPPLE): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 6392(%rax), %r11 @@ -30259,11 +30257,7 @@ GL_PREFIX(_dispatch_stub_799): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi @@ -30279,24 +30273,19 @@ GL_PREFIX(_dispatch_stub_799): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi movq 6392(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_799), .-GL_PREFIX(_dispatch_stub_799) + .size GL_PREFIX(ObjectPurgeableAPPLE), .-GL_PREFIX(ObjectPurgeableAPPLE) .p2align 4,,15 - .globl GL_PREFIX(_dispatch_stub_800) - .type GL_PREFIX(_dispatch_stub_800), @function - HIDDEN(GL_PREFIX(_dispatch_stub_800)) -GL_PREFIX(_dispatch_stub_800): + .globl GL_PREFIX(ObjectUnpurgeableAPPLE) + .type GL_PREFIX(ObjectUnpurgeableAPPLE), @function +GL_PREFIX(ObjectUnpurgeableAPPLE): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 6400(%rax), %r11 @@ -30305,11 +30294,7 @@ GL_PREFIX(_dispatch_stub_800): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _x86_64_get_dispatch@PLT - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi @@ -30325,18 +30310,14 @@ GL_PREFIX(_dispatch_stub_800): pushq %rdi pushq %rsi pushq %rdx - pushq %rcx - pushq %rbp call _glapi_get_dispatch - popq %rbp - popq %rcx popq %rdx popq %rsi popq %rdi movq 6400(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ - .size GL_PREFIX(_dispatch_stub_800), .-GL_PREFIX(_dispatch_stub_800) + .size GL_PREFIX(ObjectUnpurgeableAPPLE), .-GL_PREFIX(ObjectUnpurgeableAPPLE) .p2align 4,,15 .globl GL_PREFIX(_dispatch_stub_801) @@ -30351,7 +30332,11 @@ GL_PREFIX(_dispatch_stub_801): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -30367,7 +30352,11 @@ GL_PREFIX(_dispatch_stub_801): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -30389,7 +30378,11 @@ GL_PREFIX(_dispatch_stub_802): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _x86_64_get_dispatch@PLT + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -30405,7 +30398,11 @@ GL_PREFIX(_dispatch_stub_802): pushq %rdi pushq %rsi pushq %rdx + pushq %rcx + pushq %rbp call _glapi_get_dispatch + popq %rbp + popq %rcx popq %rdx popq %rsi popq %rdi @@ -30415,9 +30412,10 @@ GL_PREFIX(_dispatch_stub_802): .size GL_PREFIX(_dispatch_stub_802), .-GL_PREFIX(_dispatch_stub_802) .p2align 4,,15 - .globl GL_PREFIX(EGLImageTargetRenderbufferStorageOES) - .type GL_PREFIX(EGLImageTargetRenderbufferStorageOES), @function -GL_PREFIX(EGLImageTargetRenderbufferStorageOES): + .globl GL_PREFIX(_dispatch_stub_803) + .type GL_PREFIX(_dispatch_stub_803), @function + HIDDEN(GL_PREFIX(_dispatch_stub_803)) +GL_PREFIX(_dispatch_stub_803): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT movq 6424(%rax), %r11 @@ -30425,9 +30423,13 @@ GL_PREFIX(EGLImageTargetRenderbufferStorageOES): #elif defined(PTHREADS) pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _x86_64_get_dispatch@PLT popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 6424(%rax), %r11 @@ -30441,13 +30443,130 @@ GL_PREFIX(EGLImageTargetRenderbufferStorageOES): 1: pushq %rdi pushq %rsi + pushq %rdx + pushq %rcx pushq %rbp call _glapi_get_dispatch popq %rbp + popq %rcx + popq %rdx popq %rsi popq %rdi movq 6424(%rax), %r11 jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_803), .-GL_PREFIX(_dispatch_stub_803) + + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_804) + .type GL_PREFIX(_dispatch_stub_804), @function + HIDDEN(GL_PREFIX(_dispatch_stub_804)) +GL_PREFIX(_dispatch_stub_804): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 6432(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rdx + call _x86_64_get_dispatch@PLT + popq %rdx + popq %rsi + popq %rdi + movq 6432(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 6432(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rdx + call _glapi_get_dispatch + popq %rdx + popq %rsi + popq %rdi + movq 6432(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_804), .-GL_PREFIX(_dispatch_stub_804) + + .p2align 4,,15 + .globl GL_PREFIX(_dispatch_stub_805) + .type GL_PREFIX(_dispatch_stub_805), @function + HIDDEN(GL_PREFIX(_dispatch_stub_805)) +GL_PREFIX(_dispatch_stub_805): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 6440(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rdx + call _x86_64_get_dispatch@PLT + popq %rdx + popq %rsi + popq %rdi + movq 6440(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 6440(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rdx + call _glapi_get_dispatch + popq %rdx + popq %rsi + popq %rdi + movq 6440(%rax), %r11 + jmp *%r11 +#endif /* defined(GLX_USE_TLS) */ + .size GL_PREFIX(_dispatch_stub_805), .-GL_PREFIX(_dispatch_stub_805) + + .p2align 4,,15 + .globl GL_PREFIX(EGLImageTargetRenderbufferStorageOES) + .type GL_PREFIX(EGLImageTargetRenderbufferStorageOES), @function +GL_PREFIX(EGLImageTargetRenderbufferStorageOES): +#if defined(GLX_USE_TLS) + call _x86_64_get_dispatch@PLT + movq 6448(%rax), %r11 + jmp *%r11 +#elif defined(PTHREADS) + pushq %rdi + pushq %rsi + pushq %rbp + call _x86_64_get_dispatch@PLT + popq %rbp + popq %rsi + popq %rdi + movq 6448(%rax), %r11 + jmp *%r11 +#else + movq _glapi_Dispatch(%rip), %rax + testq %rax, %rax + je 1f + movq 6448(%rax), %r11 + jmp *%r11 +1: + pushq %rdi + pushq %rsi + pushq %rbp + call _glapi_get_dispatch + popq %rbp + popq %rsi + popq %rdi + movq 6448(%rax), %r11 + jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EGLImageTargetRenderbufferStorageOES), .-GL_PREFIX(EGLImageTargetRenderbufferStorageOES) @@ -30457,7 +30576,7 @@ GL_PREFIX(EGLImageTargetRenderbufferStorageOES): GL_PREFIX(EGLImageTargetTexture2DOES): #if defined(GLX_USE_TLS) call _x86_64_get_dispatch@PLT - movq 6432(%rax), %r11 + movq 6456(%rax), %r11 jmp *%r11 #elif defined(PTHREADS) pushq %rdi @@ -30467,13 +30586,13 @@ GL_PREFIX(EGLImageTargetTexture2DOES): popq %rbp popq %rsi popq %rdi - movq 6432(%rax), %r11 + movq 6456(%rax), %r11 jmp *%r11 #else movq _glapi_Dispatch(%rip), %rax testq %rax, %rax je 1f - movq 6432(%rax), %r11 + movq 6456(%rax), %r11 jmp *%r11 1: pushq %rdi @@ -30483,7 +30602,7 @@ GL_PREFIX(EGLImageTargetTexture2DOES): popq %rbp popq %rsi popq %rdi - movq 6432(%rax), %r11 + movq 6456(%rax), %r11 jmp *%r11 #endif /* defined(GLX_USE_TLS) */ .size GL_PREFIX(EGLImageTargetTexture2DOES), .-GL_PREFIX(EGLImageTargetTexture2DOES) diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index ae5dd2b0d1..a7dd8d7218 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -981,16 +981,19 @@ GLNAME(gl_dispatch_functions_start): HIDDEN(GL_PREFIX(_dispatch_stub_796, _dispatch_stub_796@12)) GL_STUB(_dispatch_stub_797, _gloffset_TextureRangeAPPLE, _dispatch_stub_797@12) HIDDEN(GL_PREFIX(_dispatch_stub_797, _dispatch_stub_797@12)) - GL_STUB(_dispatch_stub_798, _gloffset_StencilFuncSeparateATI, _dispatch_stub_798@16) - HIDDEN(GL_PREFIX(_dispatch_stub_798, _dispatch_stub_798@16)) - GL_STUB(_dispatch_stub_799, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_799@16) - HIDDEN(GL_PREFIX(_dispatch_stub_799, _dispatch_stub_799@16)) - GL_STUB(_dispatch_stub_800, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_800@16) - HIDDEN(GL_PREFIX(_dispatch_stub_800, _dispatch_stub_800@16)) - GL_STUB(_dispatch_stub_801, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_801@12) - HIDDEN(GL_PREFIX(_dispatch_stub_801, _dispatch_stub_801@12)) - GL_STUB(_dispatch_stub_802, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_802@12) - HIDDEN(GL_PREFIX(_dispatch_stub_802, _dispatch_stub_802@12)) + GL_STUB(GetObjectParameterivAPPLE, _gloffset_GetObjectParameterivAPPLE, GetObjectParameterivAPPLE@16) + GL_STUB(ObjectPurgeableAPPLE, _gloffset_ObjectPurgeableAPPLE, ObjectPurgeableAPPLE@12) + GL_STUB(ObjectUnpurgeableAPPLE, _gloffset_ObjectUnpurgeableAPPLE, ObjectUnpurgeableAPPLE@12) + GL_STUB(_dispatch_stub_801, _gloffset_StencilFuncSeparateATI, _dispatch_stub_801@16) + HIDDEN(GL_PREFIX(_dispatch_stub_801, _dispatch_stub_801@16)) + GL_STUB(_dispatch_stub_802, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_802@16) + HIDDEN(GL_PREFIX(_dispatch_stub_802, _dispatch_stub_802@16)) + GL_STUB(_dispatch_stub_803, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_803@16) + HIDDEN(GL_PREFIX(_dispatch_stub_803, _dispatch_stub_803@16)) + GL_STUB(_dispatch_stub_804, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_804@12) + HIDDEN(GL_PREFIX(_dispatch_stub_804, _dispatch_stub_804@12)) + GL_STUB(_dispatch_stub_805, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_805@12) + HIDDEN(GL_PREFIX(_dispatch_stub_805, _dispatch_stub_805@12)) GL_STUB(EGLImageTargetRenderbufferStorageOES, _gloffset_EGLImageTargetRenderbufferStorageOES, EGLImageTargetRenderbufferStorageOES@8) GL_STUB(EGLImageTargetTexture2DOES, _gloffset_EGLImageTargetTexture2DOES, EGLImageTargetTexture2DOES@8) GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4) -- cgit v1.2.3 From 566390bedf4e5f24b5234e9dc08ecb1a6fd4d13b Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 4 Mar 2010 12:46:20 -0800 Subject: r300g: Fix indexbuf upper limits. Wine tends to pessimistically use ~0 for its max index, but r300s only can go up to 2^24-1, causing the kernel checker to freak out. Civ4 is marginally improved now. Still crashes, but not as bad. --- src/gallium/drivers/r300/r300_render.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 770a92be74..6c891029a5 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -273,9 +273,14 @@ static void r300_emit_draw_elements(struct r300_context *r300, CS_LOCALS(r300); assert((start * indexSize) % 4 == 0); + assert(count < (1 << 24)); + + DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n", + count, minIndex, maxIndex); + + maxIndex = MIN2(maxIndex, ((1 << 24) - 1)); if (alt_num_verts) { - assert(count < (1 << 24)); BEGIN_CS(16); OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count); } else { -- cgit v1.2.3 From 43c347c63ee10db95bd912fc39b1127fa35305a4 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 21:27:11 +0100 Subject: dri/nouveau: Pack client arrays as they're copied to the real BO. --- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 44 ++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 02c8580760..8a2caff63e 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -24,8 +24,11 @@ * */ -#include "main/bufferobj.h" #include "nouveau_bufferobj.h" +#include "nouveau_util.h" + +#include "main/bufferobj.h" +#include "main/image.h" /* Arbitrary pushbuf length we can assume we can get with a single * WAIT_RING. */ @@ -58,7 +61,11 @@ vbo_init_array(struct nouveau_array_state *a, int attr, int stride, } else { nouveau_bo_ref(NULL, &a->bo); a->offset = 0; - a->buf = ptr; + + if (map) + a->buf = ptr; + else + a->buf = NULL; } if (a->buf) @@ -94,11 +101,20 @@ vbo_init_arrays(GLcontext *ctx, const struct _mesa_index_buffer *ib, if (attr >= 0) { const struct gl_client_array *array = arrays[attr]; + int stride; + + if (render->mode == VBO && + !_mesa_is_bufferobj(array->BufferObj)) + /* Pack client buffers. */ + stride = align(_mesa_sizeof_type(array->Type) + * array->Size, 4); + else + stride = array->StrideB; vbo_init_array(&render->attrs[attr], attr, - array->StrideB, array->Size, - array->Type, array->BufferObj, - array->Ptr, render->mode == IMM); + stride, array->Size, array->Type, + array->BufferObj, array->Ptr, + render->mode == IMM); } } } @@ -276,17 +292,21 @@ vbo_bind_vertices(GLcontext *ctx, const struct gl_client_array **arrays, if (attr >= 0) { const struct gl_client_array *array = arrays[attr]; struct nouveau_array_state *a = &render->attrs[attr]; - unsigned delta = (basevertex + min_index) * a->stride, - size = (max_index - min_index + 1) * a->stride; + unsigned delta = (basevertex + min_index) + * array->StrideB; if (a->bo) { a->offset = (intptr_t)array->Ptr + delta; } else { - void *scratch = get_scratch_vbo(ctx, size, - &a->bo, - &a->offset); - - memcpy(scratch, a->buf + delta, size); + int j, n = max_index - min_index + 1; + char *sp = (char *)array->Ptr + delta; + char *dp = get_scratch_vbo(ctx, n * a->stride, + &a->bo, &a->offset); + + for (j = 0; j < n; j++) + memcpy(dp + j * a->stride, + sp + j * array->StrideB, + a->stride); } } } -- cgit v1.2.3 From 80316cbefaa28454ab9d6da44ac93805608c3685 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 21:32:07 +0100 Subject: dri/nouveau: Try to keep client buffers smaller than the scratch VBO length. --- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 8a2caff63e..69a9b96f0c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -243,6 +243,23 @@ vbo_choose_attrs(GLcontext *ctx, const struct gl_client_array **arrays) vbo_emit_attr(ctx, arrays, VERT_ATTRIB_POS); } +static unsigned +get_max_client_stride(GLcontext *ctx) +{ + struct nouveau_render_state *render = to_render_state(ctx); + int i, s = 0; + + for (i = 0; i < render->attr_count; i++) { + int attr = render->map[i]; + struct nouveau_array_state *a = &render->attrs[attr]; + + if (attr >= 0 && !a->bo) + s = MAX2(a->stride, s); + } + + return s; +} + static void TAG(vbo_render_prims)(GLcontext *ctx, const struct gl_client_array **arrays, const struct _mesa_prim *prims, GLuint nr_prims, @@ -257,9 +274,18 @@ vbo_maybe_split(GLcontext *ctx, const struct gl_client_array **arrays, GLuint min_index, GLuint max_index) { struct nouveau_context *nctx = to_nouveau_context(ctx); + struct nouveau_render_state *render = to_render_state(ctx); unsigned pushbuf_avail = PUSHBUF_DWORDS - 2 * nctx->bo.count, vert_avail = get_max_vertices(ctx, NULL, pushbuf_avail), idx_avail = get_max_vertices(ctx, ib, pushbuf_avail); + int stride; + + /* Try to keep client buffers smaller than the scratch BOs. */ + if (!ib && render->mode == VBO && + (stride = get_max_client_stride(ctx))) + vert_avail = MIN2(vert_avail, + RENDER_SCRATCH_SIZE / stride); + if ((ib && ib->count > idx_avail) || (!ib && max_index - min_index > vert_avail)) { -- cgit v1.2.3 From 9c21c1e865ad3008eb6f4d6d4e4a48c2ed94472d Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 21:40:47 +0100 Subject: dri/nouveau: Fix rb->DataType for z24s8 renderbuffers. --- src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index 846478650e..2ec3dc9242 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -72,7 +72,7 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat) case GL_DEPTH24_STENCIL8_EXT: rb->_BaseFormat = GL_DEPTH_STENCIL; rb->Format = MESA_FORMAT_Z24_S8; - rb->DataType = GL_UNSIGNED_INT; + rb->DataType = GL_UNSIGNED_INT_24_8_EXT; s->cpp = 4; break; default: -- cgit v1.2.3 From 210bcf6d156aba5994f25f1bd9c50586ebc3bada Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Mon, 1 Mar 2010 23:58:17 +0000 Subject: dri/nouveau: Add GL_EXT_stencil_wrap for nv04. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 89c6753694..4314fc33cf 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -71,6 +71,10 @@ get_stencil_op(unsigned op) return 0x5; case GL_INVERT: return 0x6; + case GL_INCR_WRAP: + return 0x7; + case GL_DECR_WRAP: + return 0x8; default: assert(0); } -- cgit v1.2.3 From 44df3577a77818d6e87f1b728f0aa19698133981 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Mon, 1 Mar 2010 23:45:50 +0000 Subject: dri/nouveau: Enable GL_EXT_stencil_wrap. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 2629733273..ef26a19219 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -47,14 +47,15 @@ #include "main/remap_helper.h" static const struct dri_extension nouveau_extensions[] = { - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { "GL_ARB_multitexture", NULL }, - { "GL_EXT_texture_lod_bias", NULL }, - { "GL_SGIS_generate_mipmap", NULL }, { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_dot3", NULL }, { "GL_ARB_texture_env_add", NULL }, + { "GL_EXT_texture_lod_bias", NULL }, + { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, + { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, + { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; -- cgit v1.2.3 From 9c4937524e15dc685eb0c83cbdab8b637803fd78 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Thu, 4 Mar 2010 23:15:47 +0100 Subject: dri/nouveau: Trivially add GL_ARB_texture_mirrored_repeat. Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index ef26a19219..52185a2fb9 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -53,6 +53,7 @@ static const struct dri_extension nouveau_extensions[] = { { "GL_ARB_texture_env_add", NULL }, { "GL_EXT_texture_lod_bias", NULL }, { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, + { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, { "GL_SGIS_generate_mipmap", NULL }, -- cgit v1.2.3 From a42fd95f43929c1e2c7acf2a6e49c473e1a2a178 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 4 Mar 2010 23:19:49 +0100 Subject: dri/nouveau: Remove some CI remnants. --- src/mesa/drivers/dri/nouveau/nouveau_state.h | 1 - src/mesa/drivers/dri/nouveau/nv04_context.c | 1 - src/mesa/drivers/dri/nouveau/nv10_context.c | 1 - src/mesa/drivers/dri/nouveau/nv10_driver.h | 3 --- src/mesa/drivers/dri/nouveau/nv10_state_raster.c | 5 ----- src/mesa/drivers/dri/nouveau/nv20_context.c | 1 - 6 files changed, 12 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.h b/src/mesa/drivers/dri/nouveau/nouveau_state.h index d001fa259a..d01d962c9f 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.h @@ -47,7 +47,6 @@ enum { NOUVEAU_STATE_FRAG, NOUVEAU_STATE_FRAMEBUFFER, NOUVEAU_STATE_FOG, - NOUVEAU_STATE_INDEX_MASK, NOUVEAU_STATE_LIGHT_ENABLE, NOUVEAU_STATE_LIGHT_MODEL, NOUVEAU_STATE_LIGHT_SOURCE0, diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c index 1acd41de54..a442425e44 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_context.c +++ b/src/mesa/drivers/dri/nouveau/nv04_context.c @@ -265,7 +265,6 @@ const struct nouveau_driver nv04_driver = { nouveau_emit_nothing, nouveau_emit_nothing, nouveau_emit_nothing, - nouveau_emit_nothing, nv04_emit_scissor, nv04_defer_blend, nv04_defer_control, diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c index 8e70c419ed..860d0aeb8f 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_context.c +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c @@ -370,7 +370,6 @@ const struct nouveau_driver nv10_driver = { nv10_emit_frag, nv10_emit_framebuffer, nv10_emit_fog, - nv10_emit_index_mask, nv10_emit_light_enable, nv10_emit_light_model, nv10_emit_light_source, diff --git a/src/mesa/drivers/dri/nouveau/nv10_driver.h b/src/mesa/drivers/dri/nouveau/nv10_driver.h index b5ab19b3bc..d662712533 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_driver.h +++ b/src/mesa/drivers/dri/nouveau/nv10_driver.h @@ -99,9 +99,6 @@ nv10_emit_depth(GLcontext *ctx, int emit); void nv10_emit_dither(GLcontext *ctx, int emit); -void -nv10_emit_index_mask(GLcontext *ctx, int emit); - void nv10_emit_logic_opcode(GLcontext *ctx, int emit); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c index 68882ef05f..a62cd807a9 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c @@ -118,11 +118,6 @@ nv10_emit_dither(GLcontext *ctx, int emit) OUT_RING(chan, ctx->Color.DitherFlag ? 1 : 0); } -void -nv10_emit_index_mask(GLcontext *ctx, int emit) -{ -} - void nv10_emit_logic_opcode(GLcontext *ctx, int emit) { diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c index 635b5c0996..db39ef7075 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_context.c +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c @@ -459,7 +459,6 @@ const struct nouveau_driver nv20_driver = { nv20_emit_frag, nv20_emit_framebuffer, nv20_emit_fog, - nv10_emit_index_mask, nv10_emit_light_enable, nv20_emit_light_model, nv20_emit_light_source, -- cgit v1.2.3 From 877f2356b2ab7caa16beed496f36eca64ee201e1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 15:49:39 -0700 Subject: gallivm: comments --- src/gallium/auxiliary/gallivm/lp_bld_logic.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c b/src/gallium/auxiliary/gallivm/lp_bld_logic.c index 41ac81b744..2726747eae 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c @@ -45,6 +45,7 @@ /** * Build code to compare two values 'a' and 'b' of 'type' using the given func. * \param func one of PIPE_FUNC_x + * The result values will be 0 for false or ~0 for true. */ LLVMValueRef lp_build_compare(LLVMBuilderRef builder, @@ -311,6 +312,7 @@ lp_build_compare(LLVMBuilderRef builder, /** * Build code to compare two values 'a' and 'b' using the given func. * \param func one of PIPE_FUNC_x + * The result values will be 0 for false or ~0 for true. */ LLVMValueRef lp_build_cmp(struct lp_build_context *bld, @@ -322,6 +324,9 @@ lp_build_cmp(struct lp_build_context *bld, } +/** + * Return mask ? a : b; + */ LLVMValueRef lp_build_select(struct lp_build_context *bld, LLVMValueRef mask, -- cgit v1.2.3 From ad1456a4447bff8a1dac69723663c698d6abbe81 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 15:52:37 -0700 Subject: llvmpipe: new comment --- src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c index 2533275dc1..515c9089dd 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c @@ -145,6 +145,10 @@ lp_llvm_sampler_soa_destroy(struct lp_build_sampler_soa *sampler) } +/** + * Fetch filtered values from texture. + * The 'texel' parameter returns four vectors corresponding to R, G, B, A. + */ static void lp_llvm_sampler_soa_emit_fetch_texel(struct lp_build_sampler_soa *base, LLVMBuilderRef builder, -- cgit v1.2.3 From 71c05689528d7987bfb99c3afe04e456887bc7b7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 15:52:19 -0700 Subject: gallivm: added question/comment --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index ae866243a9..5f2c2a54ee 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -1126,6 +1126,7 @@ emit_instruction( break; case TGSI_OPCODE_TEX: + /* XXX what about dst0 writemask? */ emit_tex( bld, inst, FALSE, FALSE, dst0 ); break; -- cgit v1.2.3 From 946edea794646443abde05363294fed430d8d6f1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 15:52:01 -0700 Subject: gallivm: added texture border_color field --- src/gallium/auxiliary/gallivm/lp_bld_sample.c | 9 +++++++++ src/gallium/auxiliary/gallivm/lp_bld_sample.h | 1 + 2 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index a133b56ac5..55ac2e9436 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -44,6 +44,11 @@ #include "lp_bld_sample.h" +/** + * Initialize lp_sampler_static_state object with the gallium sampler + * and texture state. + * The former is considered to be static and the later dynamic. + */ void lp_sampler_static_state(struct lp_sampler_static_state *state, const struct pipe_texture *texture, @@ -70,6 +75,10 @@ lp_sampler_static_state(struct lp_sampler_static_state *state, state->min_mip_filter = sampler->min_mip_filter; state->mag_img_filter = sampler->mag_img_filter; state->compare_mode = sampler->compare_mode; + state->border_color[0] = sampler->border_color[0]; + state->border_color[1] = sampler->border_color[1]; + state->border_color[2] = sampler->border_color[2]; + state->border_color[3] = sampler->border_color[3]; if(sampler->compare_mode != PIPE_TEX_COMPARE_NONE) { state->compare_func = sampler->compare_func; } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index 39edcf13d1..a791d88612 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -70,6 +70,7 @@ struct lp_sampler_static_state unsigned compare_mode:1; unsigned compare_func:3; unsigned normalized_coords:1; + float border_color[4]; }; -- cgit v1.2.3 From 2b5c5c0dcf16062676ecfdf5efb7de650a4c5938 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 15:50:19 -0700 Subject: gallivm: implement texture border color, plus tweaks to some wrap modes The progs/test/texwrap demo looks pretty good, but there are still some tiny differences from softpipe. There may be a sub-pixel texcoord interpolation error somewhere. There's some room for optimization. Many of the wrap modes compute intermediate values that are constant for the texture size (see the min/max values). These could be computed earlier and stored somewhere for later use. --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 152 ++++++++++++++++++---- 1 file changed, 129 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 1ba139c6cd..fe41d5ee49 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -83,17 +83,92 @@ struct lp_build_sample_context }; +/** + * Does the given texture wrap mode allow sampling the texture border color? + * XXX maybe move this into gallium util code. + */ +static boolean +wrap_mode_uses_border_color(unsigned mode) +{ + switch (mode) { + case PIPE_TEX_WRAP_REPEAT: + case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + case PIPE_TEX_WRAP_MIRROR_REPEAT: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: + return FALSE; + case PIPE_TEX_WRAP_CLAMP: + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: + case PIPE_TEX_WRAP_MIRROR_CLAMP: + case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: + return TRUE; + default: + assert(0 && "unexpected wrap mode"); + return FALSE; + } +} + + + +/** + * Gen code to fetch a texel from a texture at int coords (x, y). + * The result, texel, will be: + * texel[0] = red values + * texel[1] = green values + * texel[2] = blue values + * texel[3] = alpha values + */ static void lp_build_sample_texel_soa(struct lp_build_sample_context *bld, + LLVMValueRef width, + LLVMValueRef height, LLVMValueRef x, LLVMValueRef y, LLVMValueRef y_stride, LLVMValueRef data_ptr, LLVMValueRef *texel) { + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; LLVMValueRef offset; LLVMValueRef packed; + LLVMValueRef use_border = NULL; + + /* use_border = x < 0 || x >= width || y < 0 || y >= height */ + if (wrap_mode_uses_border_color(bld->static_state->wrap_s)) { + LLVMValueRef b1, b2; + b1 = lp_build_cmp(int_coord_bld, PIPE_FUNC_LESS, x, int_coord_bld->zero); + b2 = lp_build_cmp(int_coord_bld, PIPE_FUNC_GEQUAL, x, width); + use_border = LLVMBuildOr(bld->builder, b1, b2, "b1_or_b2"); + } + + if (wrap_mode_uses_border_color(bld->static_state->wrap_t)) { + LLVMValueRef b1, b2; + b1 = lp_build_cmp(int_coord_bld, PIPE_FUNC_LESS, y, int_coord_bld->zero); + b2 = lp_build_cmp(int_coord_bld, PIPE_FUNC_GEQUAL, y, height); + if (use_border) { + use_border = LLVMBuildOr(bld->builder, use_border, b1, "ub_or_b1"); + use_border = LLVMBuildOr(bld->builder, use_border, b2, "ub_or_b2"); + } + else { + use_border = LLVMBuildOr(bld->builder, b1, b2, "b1_or_b2"); + } + } + /* + * Note: if we find an app which frequently samples the texture border + * we might want to implement a true conditional here to avoid sampling + * the texture whenever possible (since that's quite a bit of code). + * Ex: + * if (use_border) { + * texel = border_color; + * } + * else { + * texel = sample_texture(coord); + * } + * As it is now, we always sample the texture, then selectively replace + * the texel color results with the border color. + */ + + /* convert x,y coords to linear offset from start of texture, in bytes */ offset = lp_build_sample_offset(&bld->uint_coord_bld, bld->format_desc, x, y, y_stride, @@ -103,16 +178,30 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, assert(bld->format_desc->block.height == 1); assert(bld->format_desc->block.bits <= bld->texel_type.width); + /* gather the texels from the texture */ packed = lp_build_gather(bld->builder, bld->texel_type.length, bld->format_desc->block.bits, bld->texel_type.width, data_ptr, offset); + /* convert texels to float rgba */ lp_build_unpack_rgba_soa(bld->builder, bld->format_desc, bld->texel_type, packed, texel); + + if (use_border) { + /* select texel color or border color depending on use_border */ + int chan; + for (chan = 0; chan < 4; chan++) { + LLVMValueRef border_chan = + lp_build_const_scalar(bld->texel_type, + bld->static_state->border_color[chan]); + texel[chan] = lp_build_select(&bld->texel_bld, use_border, + border_chan, texel[chan]); + } + } } @@ -180,14 +269,14 @@ lp_build_coord_mirror(struct lp_build_sample_context *bld, * Return whether the given mode is supported by that function. */ static boolean -is_simple_wrap_mode(int mode) +is_simple_wrap_mode(unsigned mode) { switch (mode) { case PIPE_TEX_WRAP_REPEAT: case PIPE_TEX_WRAP_CLAMP: case PIPE_TEX_WRAP_CLAMP_TO_EDGE: - case PIPE_TEX_WRAP_CLAMP_TO_BORDER: return TRUE; + case PIPE_TEX_WRAP_CLAMP_TO_BORDER: default: return FALSE; } @@ -339,14 +428,15 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, /* min = -1.0 / (2 * length) */ min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); min = lp_build_negate(coord_bld, min); - /* max = length - min */ - max = lp_build_sub(coord_bld, length_f, min); + /* max = 1.0 - min */ + max = lp_build_sub(coord_bld, coord_bld->one, min); + /* coord = clamp(coord, min, max) */ + coord = lp_build_clamp(coord_bld, coord, min, max); /* scale coord to length (and sub 0.5?) */ coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); /* compute lerp weight */ weight = lp_build_fract(coord_bld, coord); - /* coord = clamp(coord, min, max) */ - coord = lp_build_clamp(coord_bld, coord, min, max); /* convert to int */ coord0 = lp_build_ifloor(coord_bld, coord); coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); @@ -375,12 +465,21 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, break; case PIPE_TEX_WRAP_MIRROR_CLAMP: - coord = lp_build_abs(coord_bld, coord); - coord = lp_build_mul(coord_bld, coord, length_f); - weight = lp_build_fract(coord_bld, coord); - coord = lp_build_clamp(coord_bld, coord, coord_bld->zero, length_f_minus_one); - coord0 = lp_build_ifloor(coord_bld, coord); - coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + { + LLVMValueRef min, max; + /* min = 1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + /* max = 1.0 - min */ + max = lp_build_sub(coord_bld, coord_bld->one, min); + + coord = lp_build_abs(coord_bld, coord); + coord = lp_build_clamp(coord_bld, coord, min, max); + coord = lp_build_mul(coord_bld, coord, length_f); + if(0)coord = lp_build_sub(coord_bld, coord, half); + weight = lp_build_fract(coord_bld, coord); + coord0 = lp_build_ifloor(coord_bld, coord); + coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); + } break; case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE: @@ -388,13 +487,14 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, LLVMValueRef min, max; /* min = 1.0 / (2 * length) */ min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); - /* max = length - min */ - max = lp_build_sub(coord_bld, length_f, min); + /* max = 1.0 - min */ + max = lp_build_sub(coord_bld, coord_bld->one, min); coord = lp_build_abs(coord_bld, coord); + coord = lp_build_clamp(coord_bld, coord, min, max); coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); weight = lp_build_fract(coord_bld, coord); - coord = lp_build_clamp(coord_bld, coord, min, max); coord0 = lp_build_ifloor(coord_bld, coord); coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); } @@ -406,13 +506,14 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, /* min = -1.0 / (2 * length) */ min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); min = lp_build_negate(coord_bld, min); - /* max = length - min */ - max = lp_build_sub(coord_bld, length_f, min); + /* max = 1.0 - min */ + max = lp_build_sub(coord_bld, coord_bld->one, min); coord = lp_build_abs(coord_bld, coord); + coord = lp_build_clamp(coord_bld, coord, min, max); coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); weight = lp_build_fract(coord_bld, coord); - coord = lp_build_clamp(coord_bld, coord, min, max); coord0 = lp_build_ifloor(coord_bld, coord); coord1 = lp_build_add(int_coord_bld, coord0, int_coord_bld->one); } @@ -598,7 +699,7 @@ lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, lp_build_name(x, "tex.x.wrapped"); lp_build_name(y, "tex.y.wrapped"); - lp_build_sample_texel_soa(bld, x, y, stride, data_ptr, texel); + lp_build_sample_texel_soa(bld, width, height, x, y, stride, data_ptr, texel); } @@ -627,10 +728,10 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, lp_build_sample_wrap_linear(bld, t, height, bld->static_state->pot_height, bld->static_state->wrap_t, &y0, &y1, &t_fpart); - lp_build_sample_texel_soa(bld, x0, y0, stride, data_ptr, neighbors[0][0]); - lp_build_sample_texel_soa(bld, x1, y0, stride, data_ptr, neighbors[0][1]); - lp_build_sample_texel_soa(bld, x0, y1, stride, data_ptr, neighbors[1][0]); - lp_build_sample_texel_soa(bld, x1, y1, stride, data_ptr, neighbors[1][1]); + lp_build_sample_texel_soa(bld, width, height, x0, y0, stride, data_ptr, neighbors[0][0]); + lp_build_sample_texel_soa(bld, width, height, x1, y0, stride, data_ptr, neighbors[0][1]); + lp_build_sample_texel_soa(bld, width, height, x0, y1, stride, data_ptr, neighbors[1][0]); + lp_build_sample_texel_soa(bld, width, height, x1, y1, stride, data_ptr, neighbors[1][1]); /* TODO: Don't interpolate missing channels */ for(chan = 0; chan < 4; ++chan) { @@ -907,6 +1008,11 @@ lp_build_sample_compare(struct lp_build_sample_context *bld, } +/** + * Build texture sampling code. + * 'texel' will return a vector of four LLVMValueRefs corresponding to + * R, G, B, A. + */ void lp_build_sample_soa(LLVMBuilderRef builder, const struct lp_sampler_static_state *static_state, -- cgit v1.2.3 From b37c54150058c07ab2d3db2d7e5891a457b51e76 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Mar 2010 15:53:41 -0700 Subject: softpipe: minor tweaks to texture filtering code --- src/gallium/drivers/softpipe/sp_tex_sample.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index ecd6b39863..b3a79732b4 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -55,7 +55,7 @@ static INLINE float frac(float f) { - return f - util_ifloor(f); + return f - floorf(f); } @@ -201,11 +201,9 @@ wrap_nearest_mirror_repeat(const float s[4], unsigned size, int icoord[4]) const float max = 1.0F - min; for (ch = 0; ch < 4; ch++) { const int flr = util_ifloor(s[ch]); - float u; + float u = frac(s[ch]); if (flr & 1) - u = 1.0F - (s[ch] - (float) flr); - else - u = s[ch] - (float) flr; + u = 1.0F - u; if (u < min) icoord[ch] = 0; else if (u > max) @@ -358,11 +356,9 @@ wrap_linear_mirror_repeat(const float s[4], unsigned size, uint ch; for (ch = 0; ch < 4; ch++) { const int flr = util_ifloor(s[ch]); - float u; + float u = frac(s[ch]); if (flr & 1) - u = 1.0F - (s[ch] - (float) flr); - else - u = s[ch] - (float) flr; + u = 1.0F - u; u = u * size - 0.5F; icoord0[ch] = util_ifloor(u); icoord1[ch] = icoord0[ch] + 1; -- cgit v1.2.3 From 391b396f3fb300a912e6d9bfbf26f49cc30e52df Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Fri, 5 Mar 2010 00:15:40 +0100 Subject: Fix comparison of unsigned value against < 0. --- src/mesa/main/api_validate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 326ad6f909..e9359dbe5f 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -147,7 +147,7 @@ check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); - if (min + basevertex < 0 || + if ((int)(min + basevertex) < 0 || max + basevertex > ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDrawElements() index=%u is " -- cgit v1.2.3 From 7cbc4c07ee85782d5da3e2db3c4e072ca498ff07 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Mar 2010 15:33:21 -0800 Subject: intel: Remove the unused s8 spans code. Not hit during no_rast piglit. Shaves 5.5k off of the driver. --- src/mesa/drivers/dri/intel/intel_span.c | 60 +-------------------------------- 1 file changed, 1 insertion(+), 59 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 0072bb15fc..2fcb2d843c 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -352,40 +352,6 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define INTEL_TAG(name) name##_z24_x8 #include "intel_depthtmp.h" - -/** - ** 8-bit stencil function (XXX FBO: This is obsolete) - **/ -/* XXX */ -#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, NO_TILE(_x, _y) + 3, d) -#define READ_STENCIL(d, _x, _y) d = pread_8(irb, NO_TILE(_x, _y) + 3); -#define TAG(x) intel_gttmap_##x##_z24_s8 -#include "stenciltmp.h" - -/** - ** 8-bit stencil function (XXX FBO: This is obsolete) - **/ -#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, NO_TILE(_x, _y) + 3, d) -#define READ_STENCIL(d, _x, _y) d = pread_8(irb, NO_TILE(_x, _y) + 3); -#define TAG(x) intel##x##_z24_s8 -#include "stenciltmp.h" - -/** - ** 8-bit x-tile stencil function (XXX FBO: This is obsolete) - **/ -#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, X_TILE(_x, _y) + 3, d) -#define READ_STENCIL(d, _x, _y) d = pread_8(irb, X_TILE(_x, _y) + 3); -#define TAG(x) intel_XTile_##x##_z24_s8 -#include "stenciltmp.h" - -/** - ** 8-bit y-tile stencil function (XXX FBO: This is obsolete) - **/ -#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, Y_TILE(_x, _y) + 3, d) -#define READ_STENCIL(d, _x, _y) d = pread_8(irb, Y_TILE(_x, _y) + 3) -#define TAG(x) intel_YTile_##x##_z24_s8 -#include "stenciltmp.h" - void intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) { @@ -615,19 +581,8 @@ intel_set_span_functions(struct intel_context *intel, intel_gttmap_InitDepthPointers_z16(rb); break; case MESA_FORMAT_X8_Z24: - intel_gttmap_InitDepthPointers_z24_x8(rb); - break; case MESA_FORMAT_S8_Z24: - /* There are a few different ways SW asks us to access the S8Z24 data: - * Z24 depth-only depth reads - * S8Z24 depth reads - * S8Z24 stencil reads. - */ - if (rb->Format == MESA_FORMAT_S8_Z24) { - intel_gttmap_InitDepthPointers_z24_x8(rb); - } else if (rb->Format == MESA_FORMAT_S8) { - intel_gttmap_InitStencilPointers_z24_s8(rb); - } + intel_gttmap_InitDepthPointers_z24_x8(rb); break; default: _mesa_problem(NULL, @@ -747,19 +702,6 @@ intel_set_span_functions(struct intel_context *intel, intel_YTile_InitDepthPointers_z24_x8(rb); break; } - } else if (rb->Format == MESA_FORMAT_S8) { - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitStencilPointers_z24_s8(rb); - break; - case I915_TILING_X: - intel_XTile_InitStencilPointers_z24_s8(rb); - break; - case I915_TILING_Y: - intel_YTile_InitStencilPointers_z24_s8(rb); - break; - } } else { _mesa_problem(NULL, "Unexpected ActualFormat in intelSetSpanFunctions"); -- cgit v1.2.3 From bb35000b4b6dfe60048b2f5d60bc102c4a7fd791 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Mar 2010 15:47:19 -0800 Subject: intel: Remove non-kernel-exec-fencing support. Shaves 60k off the driver from removing the broken spans code. This means we now require 2.6.29, which seems fair given that it's a year old and we've removed support for non-KMS already in the last release of 2D. --- src/mesa/drivers/dri/i965/brw_curbe.c | 5 +- src/mesa/drivers/dri/i965/brw_draw_upload.c | 63 +-- src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 4 +- src/mesa/drivers/dri/i965/brw_vtbl.c | 2 +- src/mesa/drivers/dri/i965/gen6_vs_state.c | 4 +- src/mesa/drivers/dri/i965/gen6_wm_state.c | 4 +- src/mesa/drivers/dri/intel/intel_blit.c | 8 +- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 8 +- src/mesa/drivers/dri/intel/intel_context.c | 6 - src/mesa/drivers/dri/intel/intel_context.h | 21 - src/mesa/drivers/dri/intel/intel_depthtmp.h | 64 --- src/mesa/drivers/dri/intel/intel_fbo.c | 3 - src/mesa/drivers/dri/intel/intel_fbo.h | 3 - src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 3 +- src/mesa/drivers/dri/intel/intel_regions.c | 6 +- src/mesa/drivers/dri/intel/intel_screen.c | 9 +- src/mesa/drivers/dri/intel/intel_screen.h | 1 - src/mesa/drivers/dri/intel/intel_span.c | 451 +++------------------- src/mesa/drivers/dri/intel/intel_spantmp.h | 67 ---- 19 files changed, 94 insertions(+), 638 deletions(-) delete mode 100644 src/mesa/drivers/dri/intel/intel_depthtmp.h delete mode 100644 src/mesa/drivers/dri/intel/intel_spantmp.h (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 6f2ead793d..4e78b08cfe 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -179,7 +179,6 @@ static GLfloat fixed_plane[6][4] = { */ static void prepare_constant_buffer(struct brw_context *brw) { - struct intel_context *intel = &brw->intel; GLcontext *ctx = &brw->intel.ctx; const struct brw_vertex_program *vp = brw_vertex_program_const(brw->vertex_program); @@ -307,7 +306,7 @@ static void prepare_constant_buffer(struct brw_context *brw) if (brw->curbe.curbe_bo != NULL && brw->curbe.curbe_next_offset + bufsz > brw->curbe.curbe_bo->size) { - intel_bo_unmap_gtt_preferred(intel, brw->curbe.curbe_bo); + drm_intel_gem_bo_unmap_gtt(brw->curbe.curbe_bo); dri_bo_unreference(brw->curbe.curbe_bo); brw->curbe.curbe_bo = NULL; } @@ -319,7 +318,7 @@ static void prepare_constant_buffer(struct brw_context *brw) brw->curbe.curbe_bo = dri_bo_alloc(brw->intel.bufmgr, "CURBE", 4096, 1 << 6); brw->curbe.curbe_next_offset = 0; - intel_bo_map_gtt_preferred(intel, brw->curbe.curbe_bo, GL_TRUE); + drm_intel_gem_bo_map_gtt(brw->curbe.curbe_bo); } brw->curbe.curbe_offset = brw->curbe.curbe_next_offset; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index f0a4e8ad65..71a43577bf 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -276,7 +276,6 @@ copy_array_to_vbo_array( struct brw_context *brw, struct brw_vertex_element *element, GLuint dst_stride) { - struct intel_context *intel = &brw->intel; GLuint size = element->count * dst_stride; get_space(brw, size, &element->bo, &element->offset); @@ -289,52 +288,26 @@ copy_array_to_vbo_array( struct brw_context *brw, } if (dst_stride == element->glarray->StrideB) { - if (intel->intelScreen->kernel_exec_fencing) { - drm_intel_gem_bo_map_gtt(element->bo); - memcpy((char *)element->bo->virtual + element->offset, - element->glarray->Ptr, size); - drm_intel_gem_bo_unmap_gtt(element->bo); - } else { - dri_bo_subdata(element->bo, - element->offset, - size, - element->glarray->Ptr); - } + drm_intel_gem_bo_map_gtt(element->bo); + memcpy((char *)element->bo->virtual + element->offset, + element->glarray->Ptr, size); + drm_intel_gem_bo_unmap_gtt(element->bo); } else { char *dest; const unsigned char *src = element->glarray->Ptr; int i; - if (intel->intelScreen->kernel_exec_fencing) { - drm_intel_gem_bo_map_gtt(element->bo); - dest = element->bo->virtual; - dest += element->offset; - - for (i = 0; i < element->count; i++) { - memcpy(dest, src, dst_stride); - src += element->glarray->StrideB; - dest += dst_stride; - } - - drm_intel_gem_bo_unmap_gtt(element->bo); - } else { - void *data; - - data = malloc(dst_stride * element->count); - dest = data; - for (i = 0; i < element->count; i++) { - memcpy(dest, src, dst_stride); - src += element->glarray->StrideB; - dest += dst_stride; - } - - dri_bo_subdata(element->bo, - element->offset, - size, - data); + drm_intel_gem_bo_map_gtt(element->bo); + dest = element->bo->virtual; + dest += element->offset; - free(data); + for (i = 0; i < element->count; i++) { + memcpy(dest, src, dst_stride); + src += element->glarray->StrideB; + dest += dst_stride; } + + drm_intel_gem_bo_unmap_gtt(element->bo); } } @@ -646,13 +619,9 @@ static void brw_prepare_indices(struct brw_context *brw) /* Straight upload */ - if (intel->intelScreen->kernel_exec_fencing) { - drm_intel_gem_bo_map_gtt(bo); - memcpy((char *)bo->virtual + offset, index_buffer->ptr, ib_size); - drm_intel_gem_bo_unmap_gtt(bo); - } else { - dri_bo_subdata(bo, offset, ib_size, index_buffer->ptr); - } + drm_intel_gem_bo_map_gtt(bo); + memcpy((char *)bo->virtual + offset, index_buffer->ptr, ib_size); + drm_intel_gem_bo_unmap_gtt(bo); } else { offset = (GLuint) (unsigned long) index_buffer->ptr; brw->ib.start_vertex_offset = 0; diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index ead623fc0e..950d075aa1 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -67,13 +67,13 @@ brw_vs_update_constant_buffer(struct brw_context *brw) */ _mesa_load_state_parameters(&brw->intel.ctx, vp->program.Base.Parameters); - intel_bo_map_gtt_preferred(intel, const_buffer, GL_TRUE); + drm_intel_gem_bo_map_gtt(const_buffer); for (i = 0; i < params->NumParameters; i++) { memcpy(const_buffer->virtual + i * 4 * sizeof(float), params->ParameterValues[i], 4 * sizeof(float)); } - intel_bo_unmap_gtt_preferred(intel, const_buffer); + drm_intel_gem_bo_unmap_gtt(const_buffer); return const_buffer; } diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 27a2a3e8a7..96a44bfbec 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -144,7 +144,7 @@ static void brw_finish_batch(struct intel_context *intel) brw_emit_query_end(brw); if (brw->curbe.curbe_bo) { - intel_bo_unmap_gtt_preferred(intel, brw->curbe.curbe_bo); + drm_intel_gem_bo_unmap_gtt(brw->curbe.curbe_bo); drm_intel_bo_unreference(brw->curbe.curbe_bo); brw->curbe.curbe_bo = NULL; } diff --git a/src/mesa/drivers/dri/i965/gen6_vs_state.c b/src/mesa/drivers/dri/i965/gen6_vs_state.c index 211a6231c9..fe597dfb94 100644 --- a/src/mesa/drivers/dri/i965/gen6_vs_state.c +++ b/src/mesa/drivers/dri/i965/gen6_vs_state.c @@ -65,13 +65,13 @@ upload_vs_state(struct brw_context *brw) constant_bo = drm_intel_bo_alloc(intel->bufmgr, "VS constant_bo", nr_params * 4 * sizeof(float), 4096); - intel_bo_map_gtt_preferred(intel, constant_bo, GL_TRUE); + drm_intel_gem_bo_map_gtt(constant_bo); for (i = 0; i < nr_params; i++) { memcpy((char *)constant_bo->virtual + i * 4 * sizeof(float), vp->program.Base.Parameters->ParameterValues[i], 4 * sizeof(float)); } - intel_bo_unmap_gtt_preferred(intel, constant_bo); + drm_intel_gem_bo_unmap_gtt(constant_bo); BEGIN_BATCH(5); OUT_BATCH(CMD_3D_CONSTANT_VS_STATE << 16 | diff --git a/src/mesa/drivers/dri/i965/gen6_wm_state.c b/src/mesa/drivers/dri/i965/gen6_wm_state.c index e355261769..1eb17ca627 100644 --- a/src/mesa/drivers/dri/i965/gen6_wm_state.c +++ b/src/mesa/drivers/dri/i965/gen6_wm_state.c @@ -63,13 +63,13 @@ upload_wm_state(struct brw_context *brw) constant_bo = drm_intel_bo_alloc(intel->bufmgr, "WM constant_bo", nr_params * 4 * sizeof(float), 4096); - intel_bo_map_gtt_preferred(intel, constant_bo, GL_TRUE); + drm_intel_gem_bo_map_gtt(constant_bo); for (i = 0; i < nr_params; i++) { memcpy((char *)constant_bo->virtual + i * 4 * sizeof(float), fp->program.Base.Parameters->ParameterValues[i], 4 * sizeof(float)); } - intel_bo_unmap_gtt_preferred(intel, constant_bo); + drm_intel_gem_bo_unmap_gtt(constant_bo); BEGIN_BATCH(5); OUT_BATCH(CMD_3D_CONSTANT_PS_STATE << 16 | diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 6d6af86347..f2769aa3e8 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -122,8 +122,8 @@ intelEmitCopyBlit(struct intel_context *intel, intel_prepare_render(intel); if (pass >= 2) { - intel_bo_map_gtt_preferred(intel, dst_buffer, GL_TRUE); - intel_bo_map_gtt_preferred(intel, src_buffer, GL_FALSE); + drm_intel_gem_bo_map_gtt(dst_buffer); + drm_intel_gem_bo_map_gtt(src_buffer); _mesa_copy_rect((GLubyte *)dst_buffer->virtual + dst_offset, cpp, dst_pitch, @@ -132,8 +132,8 @@ intelEmitCopyBlit(struct intel_context *intel, (GLubyte *)src_buffer->virtual + src_offset, src_pitch, src_x, src_y); - intel_bo_unmap_gtt_preferred(intel, src_buffer); - intel_bo_unmap_gtt_preferred(intel, dst_buffer); + drm_intel_gem_bo_unmap_gtt(src_buffer); + drm_intel_gem_bo_unmap_gtt(dst_buffer); return GL_TRUE; } diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 312866d865..8fe3a0e6f3 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -285,7 +285,7 @@ intel_bufferobj_map(GLcontext * ctx, return NULL; } - if (write_only && intel->intelScreen->kernel_exec_fencing) { + if (write_only) { drm_intel_gem_bo_map_gtt(intel_obj->buffer); intel_obj->mapped_gtt = GL_TRUE; } else { @@ -379,8 +379,7 @@ intel_bufferobj_map_range(GLcontext * ctx, intel_obj->range_map_bo = drm_intel_bo_alloc(intel->bufmgr, "range map", length, 64); - if (!(access & GL_MAP_READ_BIT) && - intel->intelScreen->kernel_exec_fencing) { + if (!(access & GL_MAP_READ_BIT)) { drm_intel_gem_bo_map_gtt(intel_obj->range_map_bo); intel_obj->mapped_gtt = GL_TRUE; } else { @@ -393,8 +392,7 @@ intel_bufferobj_map_range(GLcontext * ctx, return obj->Pointer; } - if (!(access & GL_MAP_READ_BIT) && - intel->intelScreen->kernel_exec_fencing) { + if (!(access & GL_MAP_READ_BIT)) { drm_intel_gem_bo_map_gtt(intel_obj->buffer); intel_obj->mapped_gtt = GL_TRUE; } else { diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index ec379a77ac..d6a1ba6952 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -755,12 +755,6 @@ intelInitContext(struct intel_context *intel, } intel->use_texture_tiling = driQueryOptionb(&intel->optionCache, "texture_tiling"); - if (intel->use_texture_tiling && - !intel->intelScreen->kernel_exec_fencing) { - fprintf(stderr, "No kernel support for execution fencing, " - "disabling texture tiling\n"); - intel->use_texture_tiling = GL_FALSE; - } intel->use_early_z = driQueryOptionb(&intel->optionCache, "early_z"); intel->prim.primitive = ~0; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index d20d44497e..22736a9327 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -475,25 +475,4 @@ is_power_of_two(uint32_t value) return (value & (value - 1)) == 0; } -static INLINE void -intel_bo_map_gtt_preferred(struct intel_context *intel, - drm_intel_bo *bo, - GLboolean write) -{ - if (intel->intelScreen->kernel_exec_fencing) - drm_intel_gem_bo_map_gtt(bo); - else - drm_intel_bo_map(bo, write); -} - -static INLINE void -intel_bo_unmap_gtt_preferred(struct intel_context *intel, - drm_intel_bo *bo) -{ - if (intel->intelScreen->kernel_exec_fencing) - drm_intel_gem_bo_unmap_gtt(bo); - else - drm_intel_bo_unmap(bo); -} - #endif diff --git a/src/mesa/drivers/dri/intel/intel_depthtmp.h b/src/mesa/drivers/dri/intel/intel_depthtmp.h deleted file mode 100644 index a9c75d44cf..0000000000 --- a/src/mesa/drivers/dri/intel/intel_depthtmp.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Eric Anholt - * - */ - -/** - * Wrapper around the depthtmp.h macrofest to generate spans code for - * all the tiling styles. - */ - -#define VALUE_TYPE INTEL_VALUE_TYPE -#define WRITE_DEPTH(_x, _y, d) \ - (*(INTEL_VALUE_TYPE *)(irb->region->buffer->virtual + \ - NO_TILE(_x, _y)) = d) -#define READ_DEPTH(d, _x, _y) \ - d = *(INTEL_VALUE_TYPE *)(irb->region->buffer->virtual + \ - NO_TILE(_x, _y)) -#define TAG(x) INTEL_TAG(intel_gttmap_##x) -#include "depthtmp.h" - -#define VALUE_TYPE INTEL_VALUE_TYPE -#define WRITE_DEPTH(_x, _y, d) INTEL_WRITE_DEPTH(NO_TILE(_x, _y), d) -#define READ_DEPTH(d, _x, _y) d = INTEL_READ_DEPTH(NO_TILE(_x, _y)) -#define TAG(x) INTEL_TAG(intel##x) -#include "depthtmp.h" - -#define VALUE_TYPE INTEL_VALUE_TYPE -#define WRITE_DEPTH(_x, _y, d) INTEL_WRITE_DEPTH(X_TILE(_x, _y), d) -#define READ_DEPTH(d, _x, _y) d = INTEL_READ_DEPTH(X_TILE(_x, _y)) -#define TAG(x) INTEL_TAG(intel_XTile_##x) -#include "depthtmp.h" - -#define VALUE_TYPE INTEL_VALUE_TYPE -#define WRITE_DEPTH(_x, _y, d) INTEL_WRITE_DEPTH(Y_TILE(_x, _y), d) -#define READ_DEPTH(d, _x, _y) d = INTEL_READ_DEPTH(Y_TILE(_x, _y)) -#define TAG(x) INTEL_TAG(intel_YTile_##x) -#include "depthtmp.h" - -#undef INTEL_VALUE_TYPE -#undef INTEL_WRITE_DEPTH -#undef INTEL_READ_DEPTH -#undef INTEL_TAG diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index b388a3de2e..a429f8d003 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -70,9 +70,6 @@ intel_delete_renderbuffer(struct gl_renderbuffer *rb) ASSERT(irb); - if (irb->span_cache != NULL) - free(irb->span_cache); - if (intel && irb->region) { intel_region_release(&irb->region); } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 586dbbbb25..72413f7369 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -40,9 +40,6 @@ struct intel_renderbuffer { struct gl_renderbuffer Base; struct intel_region *region; - - uint8_t *span_cache; - unsigned long span_cache_offset; }; diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index a20ea5afdb..4f14946ec7 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -119,8 +119,7 @@ intel_miptree_create(struct intel_context *intel, struct intel_mipmap_tree *mt; uint32_t tiling; - if (intel->use_texture_tiling && compress_byte == 0 && - intel->intelScreen->kernel_exec_fencing) { + if (intel->use_texture_tiling && compress_byte == 0) { if (intel->gen >= 4 && (base_format == GL_DEPTH_COMPONENT || base_format == GL_DEPTH_STENCIL_EXT)) diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index e3c0635e5b..f042bcbc28 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -118,8 +118,7 @@ intel_region_map(struct intel_context *intel, struct intel_region *region) if (region->pbo) intel_region_cow(intel, region); - if (region->tiling != I915_TILING_NONE && - intel->intelScreen->kernel_exec_fencing) + if (region->tiling != I915_TILING_NONE) drm_intel_gem_bo_map_gtt(region->buffer); else dri_bo_map(region->buffer, GL_TRUE); @@ -134,8 +133,7 @@ intel_region_unmap(struct intel_context *intel, struct intel_region *region) { _DBG("%s %p\n", __FUNCTION__, region); if (!--region->map_refcount) { - if (region->tiling != I915_TILING_NONE && - intel->intelScreen->kernel_exec_fencing) + if (region->tiling != I915_TILING_NONE) drm_intel_gem_bo_unmap_gtt(region->buffer); else dri_bo_unmap(region->buffer); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 959ccfb8b1..9ff76c4803 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -416,10 +416,11 @@ intel_init_bufmgr(struct intel_screen *intelScreen) return GL_FALSE; } - if (intel_get_param(spriv, I915_PARAM_NUM_FENCES_AVAIL, &num_fences)) - intelScreen->kernel_exec_fencing = !!num_fences; - else - intelScreen->kernel_exec_fencing = GL_FALSE; + if (!intel_get_param(spriv, I915_PARAM_NUM_FENCES_AVAIL, &num_fences) || + num_fences == 0) { + fprintf(stderr, "[%s: %u] Kernel 2.6.29 required.\n", __func__, __LINE__); + return GL_FALSE; + } drm_intel_bufmgr_gem_enable_fenced_relocs(intelScreen->bufmgr); diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h index 1ce476daca..5863093f00 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.h +++ b/src/mesa/drivers/dri/intel/intel_screen.h @@ -46,7 +46,6 @@ struct intel_screen GLboolean no_vbo; dri_bufmgr *bufmgr; - GLboolean kernel_exec_fencing; struct _mesa_HashTable *named_regions; /** diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 2fcb2d843c..fb5c01bc4d 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -43,218 +43,6 @@ static void intel_set_span_functions(struct intel_context *intel, struct gl_renderbuffer *rb); -#define SPAN_CACHE_SIZE 4096 - -static void -get_span_cache(struct intel_renderbuffer *irb, uint32_t offset) -{ - if (irb->span_cache == NULL) { - irb->span_cache = malloc(SPAN_CACHE_SIZE); - irb->span_cache_offset = -1; - } - - if ((offset & ~(SPAN_CACHE_SIZE - 1)) != irb->span_cache_offset) { - irb->span_cache_offset = offset & ~(SPAN_CACHE_SIZE - 1); - dri_bo_get_subdata(irb->region->buffer, irb->span_cache_offset, - SPAN_CACHE_SIZE, irb->span_cache); - } -} - -static void -clear_span_cache(struct intel_renderbuffer *irb) -{ - irb->span_cache_offset = -1; -} - -static uint32_t -pread_32(struct intel_renderbuffer *irb, uint32_t offset) -{ - get_span_cache(irb, offset); - - return *(uint32_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))); -} - -static uint32_t -pread_xrgb8888(struct intel_renderbuffer *irb, uint32_t offset) -{ - get_span_cache(irb, offset); - - return *(uint32_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))) | - 0xff000000; -} - -static uint16_t -pread_16(struct intel_renderbuffer *irb, uint32_t offset) -{ - get_span_cache(irb, offset); - - return *(uint16_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))); -} - -static uint8_t -pread_8(struct intel_renderbuffer *irb, uint32_t offset) -{ - get_span_cache(irb, offset); - - return *(uint8_t *)(irb->span_cache + (offset & (SPAN_CACHE_SIZE - 1))); -} - -static void -pwrite_32(struct intel_renderbuffer *irb, uint32_t offset, uint32_t val) -{ - clear_span_cache(irb); - - dri_bo_subdata(irb->region->buffer, offset, 4, &val); -} - -static void -pwrite_xrgb8888(struct intel_renderbuffer *irb, uint32_t offset, uint32_t val) -{ - clear_span_cache(irb); - - dri_bo_subdata(irb->region->buffer, offset, 3, &val); -} - -static void -pwrite_16(struct intel_renderbuffer *irb, uint32_t offset, uint16_t val) -{ - clear_span_cache(irb); - - dri_bo_subdata(irb->region->buffer, offset, 2, &val); -} - -static void -pwrite_8(struct intel_renderbuffer *irb, uint32_t offset, uint8_t val) -{ - clear_span_cache(irb); - - dri_bo_subdata(irb->region->buffer, offset, 1, &val); -} - -static uint32_t no_tile_swizzle(struct intel_renderbuffer *irb, - int x, int y) -{ - return (y * irb->region->pitch + x) * irb->region->cpp; -} - -/* - * Deal with tiled surfaces - */ - -static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb, - int x, int y) -{ - int tile_stride; - int xbyte; - int x_tile_off, y_tile_off; - int x_tile_number, y_tile_number; - int tile_off, tile_base; - - x += irb->region->draw_x; - y += irb->region->draw_y; - - tile_stride = (irb->region->pitch * irb->region->cpp) << 3; - - xbyte = x * irb->region->cpp; - - x_tile_off = xbyte & 0x1ff; - y_tile_off = y & 7; - - x_tile_number = xbyte >> 9; - y_tile_number = y >> 3; - - tile_off = (y_tile_off << 9) + x_tile_off; - - switch (irb->region->bit_6_swizzle) { - case I915_BIT_6_SWIZZLE_NONE: - break; - case I915_BIT_6_SWIZZLE_9: - tile_off ^= ((tile_off >> 3) & 64); - break; - case I915_BIT_6_SWIZZLE_9_10: - tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64); - break; - case I915_BIT_6_SWIZZLE_9_11: - tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 5) & 64); - break; - case I915_BIT_6_SWIZZLE_9_10_11: - tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64) ^ - ((tile_off >> 5) & 64); - break; - default: - fprintf(stderr, "Unknown tile swizzling mode %d\n", - irb->region->bit_6_swizzle); - exit(1); - } - - tile_base = (x_tile_number << 12) + y_tile_number * tile_stride; - -#if 0 - printf("(%d,%d) -> %d + %d = %d (pitch = %d, tstride = %d)\n", - x, y, tile_off, tile_base, - tile_off + tile_base, - irb->region->pitch, tile_stride); -#endif - - return tile_base + tile_off; -} - -static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, - int x, int y) -{ - int tile_stride; - int xbyte; - int x_tile_off, y_tile_off; - int x_tile_number, y_tile_number; - int tile_off, tile_base; - - x += irb->region->draw_x; - y += irb->region->draw_y; - - tile_stride = (irb->region->pitch * irb->region->cpp) << 5; - - xbyte = x * irb->region->cpp; - - x_tile_off = xbyte & 0x7f; - y_tile_off = y & 0x1f; - - x_tile_number = xbyte >> 7; - y_tile_number = y >> 5; - - tile_off = ((x_tile_off & ~0xf) << 5) + (y_tile_off << 4) + - (x_tile_off & 0xf); - - switch (irb->region->bit_6_swizzle) { - case I915_BIT_6_SWIZZLE_NONE: - break; - case I915_BIT_6_SWIZZLE_9: - tile_off ^= ((tile_off >> 3) & 64); - break; - case I915_BIT_6_SWIZZLE_9_10: - tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64); - break; - case I915_BIT_6_SWIZZLE_9_11: - tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 5) & 64); - break; - case I915_BIT_6_SWIZZLE_9_10_11: - tile_off ^= ((tile_off >> 3) & 64) ^ ((tile_off >> 4) & 64) ^ - ((tile_off >> 5) & 64); - break; - default: - fprintf(stderr, "Unknown tile swizzling mode %d\n", - irb->region->bit_6_swizzle); - exit(1); - } - - tile_base = (x_tile_number << 12) + y_tile_number * tile_stride; - - return tile_base + tile_off; -} - -/* - break intelWriteRGBASpan_ARGB8888 -*/ - #undef DBG #define DBG 0 @@ -280,50 +68,43 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define HW_UNLOCK() -/* Convenience macros to avoid typing the swizzle argument over and over */ -#define NO_TILE(_X, _Y) no_tile_swizzle(irb, (_X), (_Y)) -#define X_TILE(_X, _Y) x_tile_swizzle(irb, (_X), (_Y)) -#define Y_TILE(_X, _Y) y_tile_swizzle(irb, (_X), (_Y)) +/* Convenience macros to avoid typing the address argument over and over */ +#define NO_TILE(_X, _Y) (((_Y) * irb->region->pitch + (_X)) * irb->region->cpp) /* r5g6b5 color span and pixel functions */ -#define INTEL_PIXEL_FMT GL_RGB -#define INTEL_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 -#define INTEL_READ_VALUE(offset) pread_16(irb, offset) -#define INTEL_WRITE_VALUE(offset, v) pwrite_16(irb, offset, v) -#define INTEL_TAG(x) x##_RGB565 -#include "intel_spantmp.h" +#define SPANTMP_PIXEL_FMT GL_RGB +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5 +#define TAG(x) intel_##x##_RGB565 +#define TAG2(x,y) intel_##x##y_RGB565 +#include "spantmp2.h" /* a4r4g4b4 color span and pixel functions */ -#define INTEL_PIXEL_FMT GL_BGRA -#define INTEL_PIXEL_TYPE GL_UNSIGNED_SHORT_4_4_4_4_REV -#define INTEL_READ_VALUE(offset) pread_16(irb, offset) -#define INTEL_WRITE_VALUE(offset, v) pwrite_16(irb, offset, v) -#define INTEL_TAG(x) x##_ARGB4444 -#include "intel_spantmp.h" +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_4_4_4_4_REV +#define TAG(x) intel_##x##_ARGB4444 +#define TAG2(x,y) intel_##x##y_ARGB4444 +#include "spantmp2.h" /* a1r5g5b5 color span and pixel functions */ -#define INTEL_PIXEL_FMT GL_BGRA -#define INTEL_PIXEL_TYPE GL_UNSIGNED_SHORT_1_5_5_5_REV -#define INTEL_READ_VALUE(offset) pread_16(irb, offset) -#define INTEL_WRITE_VALUE(offset, v) pwrite_16(irb, offset, v) -#define INTEL_TAG(x) x##_ARGB1555 -#include "intel_spantmp.h" +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_1_5_5_5_REV +#define TAG(x) intel_##x##_ARGB1555 +#define TAG2(x,y) intel_##x##y##_ARGB1555 +#include "spantmp2.h" /* a8r8g8b8 color span and pixel functions */ -#define INTEL_PIXEL_FMT GL_BGRA -#define INTEL_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV -#define INTEL_READ_VALUE(offset) pread_32(irb, offset) -#define INTEL_WRITE_VALUE(offset, v) pwrite_32(irb, offset, v) -#define INTEL_TAG(x) x##_ARGB8888 -#include "intel_spantmp.h" +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV +#define TAG(x) intel_##x##_ARGB8888 +#define TAG2(x,y) intel_##x##y##_ARGB8888 +#include "spantmp2.h" /* x8r8g8b8 color span and pixel functions */ -#define INTEL_PIXEL_FMT GL_BGR -#define INTEL_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV -#define INTEL_READ_VALUE(offset) pread_xrgb8888(irb, offset) -#define INTEL_WRITE_VALUE(offset, v) pwrite_xrgb8888(irb, offset, v) -#define INTEL_TAG(x) x##_xRGB8888 -#include "intel_spantmp.h" +#define SPANTMP_PIXEL_FMT GL_BGR +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV +#define TAG(x) intel_##x##_xRGB8888 +#define TAG2(x,y) intel_##x##y##_xRGB8888 +#include "spantmp2.h" #define LOCAL_DEPTH_VARS \ struct intel_renderbuffer *irb = intel_renderbuffer(rb); \ @@ -339,18 +120,22 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS /* z16 depthbuffer functions. */ -#define INTEL_VALUE_TYPE GLushort -#define INTEL_WRITE_DEPTH(offset, d) pwrite_16(irb, offset, d) -#define INTEL_READ_DEPTH(offset) pread_16(irb, offset) -#define INTEL_TAG(name) name##_z16 -#include "intel_depthtmp.h" - -/* z24x8 depthbuffer functions. */ -#define INTEL_VALUE_TYPE GLuint -#define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, d) -#define INTEL_READ_DEPTH(offset) pread_32(irb, offset) -#define INTEL_TAG(name) name##_z24_x8 -#include "intel_depthtmp.h" +#define VALUE_TYPE GLushort +#define WRITE_DEPTH(_x, _y, d) \ + (*(uint16_t *)(irb->region->buffer->virtual + NO_TILE(_x, _y)) = d) +#define READ_DEPTH(d, _x, _y) \ + d = *(uint16_t *)(irb->region->buffer->virtual + NO_TILE(_x, _y)) +#define TAG(x) intel_##x##_z16 +#include "depthtmp.h" + +/* z24_s8 and z24_x8 depthbuffer functions. */ +#define VALUE_TYPE GLuint +#define WRITE_DEPTH(_x, _y, d) \ + (*(uint32_t *)(irb->region->buffer->virtual + NO_TILE(_x, _y)) = d) +#define READ_DEPTH(d, _x, _y) \ + d = *(uint32_t *)(irb->region->buffer->virtual + NO_TILE(_x, _y)) +#define TAG(x) intel_##x##_z24_x8 +#include "depthtmp.h" void intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) @@ -360,8 +145,7 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) if (irb == NULL || irb->region == NULL) return; - if (intel->intelScreen->kernel_exec_fencing) - drm_intel_gem_bo_map_gtt(irb->region->buffer); + drm_intel_gem_bo_map_gtt(irb->region->buffer); intel_set_span_functions(intel, rb); } @@ -375,10 +159,7 @@ intel_renderbuffer_unmap(struct intel_context *intel, if (irb == NULL || irb->region == NULL) return; - if (intel->intelScreen->kernel_exec_fencing) - drm_intel_gem_bo_unmap_gtt(irb->region->buffer); - else - clear_span_cache(irb); + drm_intel_gem_bo_unmap_gtt(irb->region->buffer); rb->GetRow = NULL; rb->PutRow = NULL; @@ -558,158 +339,34 @@ intel_set_span_functions(struct intel_context *intel, struct gl_renderbuffer *rb) { struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb; - uint32_t tiling = irb->region->tiling; - - if (intel->intelScreen->kernel_exec_fencing) { - switch (irb->Base.Format) { - case MESA_FORMAT_RGB565: - intel_gttmap_InitPointers_RGB565(rb); - break; - case MESA_FORMAT_ARGB4444: - intel_gttmap_InitPointers_ARGB4444(rb); - break; - case MESA_FORMAT_ARGB1555: - intel_gttmap_InitPointers_ARGB1555(rb); - break; - case MESA_FORMAT_XRGB8888: - intel_gttmap_InitPointers_xRGB8888(rb); - break; - case MESA_FORMAT_ARGB8888: - intel_gttmap_InitPointers_ARGB8888(rb); - break; - case MESA_FORMAT_Z16: - intel_gttmap_InitDepthPointers_z16(rb); - break; - case MESA_FORMAT_X8_Z24: - case MESA_FORMAT_S8_Z24: - intel_gttmap_InitDepthPointers_z24_x8(rb); - break; - default: - _mesa_problem(NULL, - "Unexpected MesaFormat %d in intelSetSpanFunctions", - irb->Base.Format); - break; - } - return; - } - /* If in GEM mode, we need to do the tile address swizzling ourselves, - * instead of the fence registers handling it. - */ switch (irb->Base.Format) { case MESA_FORMAT_RGB565: - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_RGB565(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_RGB565(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_RGB565(rb); - break; - } + intel_InitPointers_RGB565(rb); break; case MESA_FORMAT_ARGB4444: - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_ARGB4444(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_ARGB4444(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_ARGB4444(rb); - break; - } + intel_InitPointers_ARGB4444(rb); break; case MESA_FORMAT_ARGB1555: - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_ARGB1555(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_ARGB1555(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_ARGB1555(rb); - break; - } + intel_InitPointers_ARGB1555(rb); break; case MESA_FORMAT_XRGB8888: - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_xRGB8888(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_xRGB8888(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_xRGB8888(rb); - break; - } + intel_InitPointers_xRGB8888(rb); break; case MESA_FORMAT_ARGB8888: - /* 8888 RGBA */ - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_ARGB8888(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_ARGB8888(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_ARGB8888(rb); - break; - } + intel_InitPointers_ARGB8888(rb); break; case MESA_FORMAT_Z16: - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitDepthPointers_z16(rb); - break; - case I915_TILING_X: - intel_XTile_InitDepthPointers_z16(rb); - break; - case I915_TILING_Y: - intel_YTile_InitDepthPointers_z16(rb); - break; - } + intel_InitDepthPointers_z16(rb); break; case MESA_FORMAT_X8_Z24: case MESA_FORMAT_S8_Z24: - /* There are a few different ways SW asks us to access the S8Z24 data: - * Z24 depth-only depth reads - * S8Z24 depth reads - * S8Z24 stencil reads. - */ - if (rb->Format == MESA_FORMAT_S8_Z24) { - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitDepthPointers_z24_x8(rb); - break; - case I915_TILING_X: - intel_XTile_InitDepthPointers_z24_x8(rb); - break; - case I915_TILING_Y: - intel_YTile_InitDepthPointers_z24_x8(rb); - break; - } - } else { - _mesa_problem(NULL, - "Unexpected ActualFormat in intelSetSpanFunctions"); - } + intel_InitDepthPointers_z24_x8(rb); break; default: _mesa_problem(NULL, - "Unexpected MesaFormat in intelSetSpanFunctions"); + "Unexpected MesaFormat %d in intelSetSpanFunctions", + irb->Base.Format); break; } } diff --git a/src/mesa/drivers/dri/intel/intel_spantmp.h b/src/mesa/drivers/dri/intel/intel_spantmp.h deleted file mode 100644 index bad03398f6..0000000000 --- a/src/mesa/drivers/dri/intel/intel_spantmp.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright © 2009 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * Authors: - * Eric Anholt - * - */ - -/** - * Wrapper around the spantmp.h macrofest to generate spans code for - * all the tiling styles. - */ - -#define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT -#define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE -#define TAG(x) INTEL_TAG(intel_gttmap_##x) -#define TAG2(x, y) INTEL_TAG(intel_gttmap_##x##y) -#include "spantmp2.h" - -#define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT -#define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE -#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(NO_TILE(_x, _y), v) -#define GET_VALUE(_x, _y) INTEL_READ_VALUE(NO_TILE(_x, _y)) -#define TAG(x) INTEL_TAG(intel##x) -#define TAG2(x, y) INTEL_TAG(intel##x)##y -#include "spantmp2.h" - -#define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT -#define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE -#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(X_TILE(_x, _y), v) -#define GET_VALUE(_x, _y) INTEL_READ_VALUE(X_TILE(_x, _y)) -#define TAG(x) INTEL_TAG(intel_XTile_##x) -#define TAG2(x, y) INTEL_TAG(intel_XTile_##x)##y -#include "spantmp2.h" - -#define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT -#define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE -#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(Y_TILE(_x, _y), v) -#define GET_VALUE(_x, _y) INTEL_READ_VALUE(Y_TILE(_x, _y)) -#define TAG(x) INTEL_TAG(intel_YTile_##x) -#define TAG2(x, y) INTEL_TAG(intel_YTile_##x)##y -#include "spantmp2.h" - -#undef INTEL_PIXEL_FMT -#undef INTEL_PIXEL_TYPE -#undef INTEL_WRITE_VALUE -#undef INTEL_READ_VALUE -#undef INTEL_TAG -- cgit v1.2.3 From 45df4bad9fc0379f05197bee10c03fd351f24094 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 4 Mar 2010 17:40:36 -0800 Subject: Revert "mesa: Remove pointless comparison of unsigned integer with a negative constant." This reverts commit a05fdbcb719ac64e6be842372813f0f4ca2f4f93. Removing the comparison is wrong. The comparison with -1 should be changed to another value (probably PROGRAM_UNDEFINED) along with another change in the shader assembler. Conflicts: src/mesa/shader/prog_execute.c --- src/mesa/shader/prog_execute.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index a1c20a325e..37750cc330 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -1767,10 +1767,15 @@ _mesa_execute_program(GLcontext * ctx, break; case OPCODE_PRINT: { - GLfloat a[4]; - fetch_vector4(&inst->SrcReg[0], machine, a); - printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, - a[0], a[1], a[2], a[3]); + if (inst->SrcReg[0].File != -1) { + GLfloat a[4]; + fetch_vector4(&inst->SrcReg[0], machine, a); + printf("%s%g, %g, %g, %g\n", (const char *) inst->Data, + a[0], a[1], a[2], a[3]); + } + else { + printf("%s\n", (const char *) inst->Data); + } } break; case OPCODE_END: -- cgit v1.2.3 From e38f28ddedd6d4902ae18b1bf243e67d4b16decb Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 21 Feb 2010 10:58:22 +0800 Subject: st/egl: Add event support to the native display interface. There is only invalid_surface event right now. When EGL receives the event, it sets the force_validate flag of the context binding to the surface. This helps skip an unnecessary check. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 23 +++++++++++++++++- src/gallium/state_trackers/egl/common/native.h | 27 +++++++++++++++++++++- src/gallium/state_trackers/egl/kms/native_kms.c | 13 ++++++++--- src/gallium/state_trackers/egl/kms/native_kms.h | 2 ++ src/gallium/state_trackers/egl/x11/native_dri2.c | 20 +++++++++++++--- src/gallium/state_trackers/egl/x11/native_x11.c | 7 +++--- src/gallium/state_trackers/egl/x11/native_x11.h | 8 +++++-- src/gallium/state_trackers/egl/x11/native_ximage.c | 20 +++++++++++++++- 8 files changed, 106 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 04268c71c5..ddb1ef1bf1 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -531,6 +531,24 @@ egl_g3d_update_buffer(struct pipe_screen *screen, void *context_private) egl_g3d_validate_context(gctx->base.Resource.Display, &gctx->base); } +static void +egl_g3d_invalid_surface(struct native_display *ndpy, + struct native_surface *nsurf, + unsigned int seq_num) +{ + /* XXX not thread safe? */ + struct egl_g3d_surface *gsurf = egl_g3d_surface(nsurf->user_data); + struct egl_g3d_context *gctx = egl_g3d_context(gsurf->base.CurrentContext); + + /* set force_validate to skip an unnecessary check */ + if (gctx) + gctx->force_validate = TRUE; +} + +static struct native_event_handler egl_g3d_native_event_handler = { + .invalid_surface = egl_g3d_invalid_surface +}; + static EGLBoolean egl_g3d_terminate(_EGLDriver *drv, _EGLDisplay *dpy) { @@ -575,12 +593,14 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy, } dpy->DriverData = gdpy; - gdpy->native = native_create_display(dpy->NativeDisplay); + gdpy->native = native_create_display(dpy->NativeDisplay, + &egl_g3d_native_event_handler); if (!gdpy->native) { _eglError(EGL_NOT_INITIALIZED, "eglInitialize(no usable display)"); goto fail; } + gdpy->native->user_data = (void *) dpy; gdpy->native->screen->flush_frontbuffer = egl_g3d_flush_frontbuffer; gdpy->native->screen->update_buffer = egl_g3d_update_buffer; @@ -776,6 +796,7 @@ egl_g3d_create_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, return NULL; } + nsurf->user_data = &gsurf->base; gsurf->native = nsurf; gsurf->render_att = (gsurf->base.RenderBuffer == EGL_SINGLE_BUFFER) ? diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 4f9758545a..1bf2804db5 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -69,6 +69,11 @@ struct native_probe { }; struct native_surface { + /** + * Available for caller's use. + */ + void *user_data; + void (*destroy)(struct native_surface *nsurf); /** @@ -143,6 +148,11 @@ struct native_display { */ struct pipe_screen *screen; + /** + * Available for caller's use. + */ + void *user_data; + void (*destroy)(struct native_display *ndpy); /** @@ -238,6 +248,20 @@ struct native_display_modeset { const struct native_mode *nmode); }; +/** + * The handler for events that a native display may generate. The events are + * generated asynchronously and the handler may be called by any thread at any + * time. + */ +struct native_event_handler { + /** + * This function is called when a surface needs to be validated. + */ + void (*invalid_surface)(struct native_display *ndpy, + struct native_surface *nsurf, + unsigned int seq_num); +}; + /** * Test whether an attachment is set in the mask. */ @@ -267,6 +291,7 @@ const char * native_get_name(void); struct native_display * -native_create_display(EGLNativeDisplayType dpy); +native_create_display(EGLNativeDisplayType dpy, + struct native_event_handler *handler); #endif /* _NATIVE_H_ */ diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index aedf3d430c..90c82eaf6c 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -201,6 +201,8 @@ kms_surface_swap_buffers(struct native_surface *nsurf) /* the front/back textures are swapped */ ksurf->sequence_number++; + kdpy->event_handler->invalid_surface(&kdpy->base, + &ksurf->base, ksurf->sequence_number); return TRUE; } @@ -762,7 +764,9 @@ static struct native_display_modeset kms_display_modeset = { }; static struct native_display * -kms_create_display(EGLNativeDisplayType dpy, struct drm_api *api) +kms_create_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler, + struct drm_api *api) { struct kms_display *kdpy; @@ -770,6 +774,8 @@ kms_create_display(EGLNativeDisplayType dpy, struct drm_api *api) if (!kdpy) return NULL; + kdpy->event_handler = event_handler; + kdpy->api = api; if (!kdpy->api) { _eglLog(_EGL_WARNING, "failed to create DRM API"); @@ -845,7 +851,8 @@ native_get_name(void) } struct native_display * -native_create_display(EGLNativeDisplayType dpy) +native_create_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler) { struct native_display *ndpy = NULL; @@ -853,7 +860,7 @@ native_create_display(EGLNativeDisplayType dpy) drm_api = drm_api_create(); if (drm_api) - ndpy = kms_create_display(dpy, drm_api); + ndpy = kms_create_display(dpy, event_handler, drm_api); return ndpy; } diff --git a/src/gallium/state_trackers/egl/kms/native_kms.h b/src/gallium/state_trackers/egl/kms/native_kms.h index 095186e3cf..f9cbcb158b 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.h +++ b/src/gallium/state_trackers/egl/kms/native_kms.h @@ -53,6 +53,8 @@ struct kms_crtc { struct kms_display { struct native_display base; + struct native_event_handler *event_handler; + int fd; struct drm_api *api; drmModeResPtr resources; diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index 74d3d104b9..858033e1c1 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -48,6 +48,8 @@ struct dri2_display { Display *dpy; boolean own_dpy; + struct native_event_handler *event_handler; + struct drm_api *api; struct x11_screen *xscr; int xscr_number; @@ -324,8 +326,11 @@ dri2_surface_flush_frontbuffer(struct native_surface *nsurf) DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); /* force buffers to be updated in next validation call */ - if (!dri2_surface_receive_events(&dri2surf->base)) + if (!dri2_surface_receive_events(&dri2surf->base)) { dri2surf->server_stamp++; + dri2dpy->event_handler->invalid_surface(&dri2dpy->base, + &dri2surf->base, dri2surf->server_stamp); + } return TRUE; } @@ -353,8 +358,11 @@ dri2_surface_swap_buffers(struct native_surface *nsurf) DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); /* force buffers to be updated in next validation call */ - if (!dri2_surface_receive_events(&dri2surf->base)) + if (!dri2_surface_receive_events(&dri2surf->base)) { dri2surf->server_stamp++; + dri2dpy->event_handler->invalid_surface(&dri2dpy->base, + &dri2surf->base, dri2surf->server_stamp); + } return TRUE; } @@ -737,7 +745,10 @@ dri2_display_invalidate_buffers(struct x11_screen *xscr, Drawable drawable, return; dri2surf = dri2_surface(nsurf); + dri2surf->server_stamp++; + dri2dpy->event_handler->invalid_surface(&dri2dpy->base, + &dri2surf->base, dri2surf->server_stamp); } /** @@ -796,7 +807,9 @@ dri2_display_hash_table_compare(void *key1, void *key2) } struct native_display * -x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api) +x11_create_dri2_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler, + struct drm_api *api) { struct dri2_display *dri2dpy; @@ -804,6 +817,7 @@ x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api) if (!dri2dpy) return NULL; + dri2dpy->event_handler = event_handler; dri2dpy->api = api; dri2dpy->dpy = dpy; diff --git a/src/gallium/state_trackers/egl/x11/native_x11.c b/src/gallium/state_trackers/egl/x11/native_x11.c index 3add95d0ac..7b4fe63fa0 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.c +++ b/src/gallium/state_trackers/egl/x11/native_x11.c @@ -126,7 +126,8 @@ native_get_name(void) } struct native_display * -native_create_display(EGLNativeDisplayType dpy) +native_create_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler) { struct native_display *ndpy = NULL; boolean force_sw; @@ -136,7 +137,7 @@ native_create_display(EGLNativeDisplayType dpy) force_sw = debug_get_bool_option("EGL_SOFTWARE", FALSE); if (api && !force_sw) { - ndpy = x11_create_dri2_display(dpy, api); + ndpy = x11_create_dri2_display(dpy, event_handler, api); } if (!ndpy) { @@ -150,7 +151,7 @@ native_create_display(EGLNativeDisplayType dpy) */ use_shm = FALSE; _eglLog(level, "use software%s fallback", (use_shm) ? " (SHM)" : ""); - ndpy = x11_create_ximage_display(dpy, use_shm); + ndpy = x11_create_ximage_display(dpy, event_handler, use_shm); } return ndpy; diff --git a/src/gallium/state_trackers/egl/x11/native_x11.h b/src/gallium/state_trackers/egl/x11/native_x11.h index 622ddac5df..8c6a7d9349 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.h +++ b/src/gallium/state_trackers/egl/x11/native_x11.h @@ -29,9 +29,13 @@ #include "common/native.h" struct native_display * -x11_create_ximage_display(EGLNativeDisplayType dpy, boolean use_xshm); +x11_create_ximage_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler, + boolean use_xshm); struct native_display * -x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api); +x11_create_dri2_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler, + struct drm_api *api); #endif /* _NATIVE_X11_H_ */ diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index a8633b1501..5e0270c296 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -56,6 +56,8 @@ struct ximage_display { struct x11_screen *xscr; int xscr_number; + struct native_event_handler *event_handler; + boolean use_xshm; struct pipe_winsys *winsys; @@ -228,6 +230,16 @@ ximage_surface_update_geometry(struct native_surface *nsurf) return updated; } +static void +ximage_surface_notify_invalid(struct native_surface *nsurf) +{ + struct ximage_surface *xsurf = ximage_surface(nsurf); + struct ximage_display *xdpy = xsurf->xdpy; + + xdpy->event_handler->invalid_surface(&xdpy->base, + &xsurf->base, xsurf->server_stamp); +} + /** * Update the buffers of the surface. It is a slow function due to the * round-trip to the server. @@ -339,6 +351,7 @@ ximage_surface_flush_frontbuffer(struct native_surface *nsurf) NATIVE_ATTACHMENT_FRONT_LEFT); /* force buffers to be updated in next validation call */ xsurf->server_stamp++; + ximage_surface_notify_invalid(&xsurf->base); return ret; } @@ -354,6 +367,7 @@ ximage_surface_swap_buffers(struct native_surface *nsurf) ret = ximage_surface_draw_buffer(nsurf, NATIVE_ATTACHMENT_BACK_LEFT); /* force buffers to be updated in next validation call */ xsurf->server_stamp++; + ximage_surface_notify_invalid(&xsurf->base); xfront = &xsurf->buffers[NATIVE_ATTACHMENT_FRONT_LEFT]; xback = &xsurf->buffers[NATIVE_ATTACHMENT_BACK_LEFT]; @@ -703,7 +717,9 @@ ximage_display_destroy(struct native_display *ndpy) } struct native_display * -x11_create_ximage_display(EGLNativeDisplayType dpy, boolean use_xshm) +x11_create_ximage_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler, + boolean use_xshm) { struct ximage_display *xdpy; @@ -728,6 +744,8 @@ x11_create_ximage_display(EGLNativeDisplayType dpy, boolean use_xshm) return NULL; } + xdpy->event_handler = event_handler; + xdpy->use_xshm = (use_xshm && x11_screen_support(xdpy->xscr, X11_SCREEN_EXTENSION_XSHM)); -- cgit v1.2.3 From 89a75b763467d83d4d402c91db55548682be14f0 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 5 Mar 2010 10:40:15 +0800 Subject: st/egl: Move modeset interface to native_modeset.h. native.h is getting more and more complex. Move the independent modeset interface to native_modeset.h to simplify native.h a little. --- src/gallium/state_trackers/egl/common/native.h | 57 +------------- .../state_trackers/egl/common/native_modeset.h | 87 ++++++++++++++++++++++ 2 files changed, 89 insertions(+), 55 deletions(-) create mode 100644 src/gallium/state_trackers/egl/common/native_modeset.h (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 1bf2804db5..4533b3abf9 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -34,6 +34,8 @@ #include "pipe/p_context.h" #include "pipe/p_state.h" +#include "native_modeset.h" + /** * Only color buffers are listed. The others are allocated privately through, * for example, st_renderbuffer_alloc_storage(). @@ -122,18 +124,6 @@ struct native_config { boolean scanout_bit; }; -struct native_connector { - int dummy; -}; - -struct native_mode { - const char *desc; - int width, height; - int refresh_rate; -}; - -struct native_display_modeset; - /** * A pipe winsys abstracts the OS. A pipe screen abstracts the graphcis * hardware. A native display consists of a pipe winsys, a pipe screen, and @@ -205,49 +195,6 @@ struct native_display { const struct native_display_modeset *modeset; }; -/** - * Mode setting interface of the native display. It exposes the mode setting - * capabilities of the underlying graphics hardware. - */ -struct native_display_modeset { - /** - * Get the available physical connectors and the number of CRTCs. - */ - const struct native_connector **(*get_connectors)(struct native_display *ndpy, - int *num_connectors, - int *num_crtcs); - - /** - * Get the current supported modes of a connector. The returned modes may - * change every time this function is called and those from previous calls - * might become invalid. - */ - const struct native_mode **(*get_modes)(struct native_display *ndpy, - const struct native_connector *nconn, - int *num_modes); - - /** - * Create a scan-out surface. Required unless no config has - * GLX_SCREEN_BIT_MESA set. - */ - struct native_surface *(*create_scanout_surface)(struct native_display *ndpy, - const struct native_config *nconf, - uint width, uint height); - - /** - * Program the CRTC to output the surface to the given connectors with the - * given mode. When surface is not given, the CRTC is disabled. - * - * This interface does not export a way to query capabilities of the CRTCs. - * The native display usually needs to dynamically map the index to a CRTC - * that supports the given connectors. - */ - boolean (*program)(struct native_display *ndpy, int crtc_idx, - struct native_surface *nsurf, uint x, uint y, - const struct native_connector **nconns, int num_nconns, - const struct native_mode *nmode); -}; - /** * The handler for events that a native display may generate. The events are * generated asynchronously and the handler may be called by any thread at any diff --git a/src/gallium/state_trackers/egl/common/native_modeset.h b/src/gallium/state_trackers/egl/common/native_modeset.h new file mode 100644 index 0000000000..71dc3ec860 --- /dev/null +++ b/src/gallium/state_trackers/egl/common/native_modeset.h @@ -0,0 +1,87 @@ +/* + * Mesa 3-D graphics library + * Version: 7.8 + * + * Copyright (C) 2009-2010 Chia-I Wu + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _NATIVE_MODESET_H_ +#define _NATIVE_MODESET_H_ + +#include "pipe/p_compiler.h" + +struct native_display; +struct native_surface; +struct native_config; + +struct native_connector { + int dummy; +}; + +struct native_mode { + const char *desc; + int width, height; + int refresh_rate; +}; + +/** + * Mode setting interface of the native display. It exposes the mode setting + * capabilities of the underlying graphics hardware. + */ +struct native_display_modeset { + /** + * Get the available physical connectors and the number of CRTCs. + */ + const struct native_connector **(*get_connectors)(struct native_display *ndpy, + int *num_connectors, + int *num_crtcs); + + /** + * Get the current supported modes of a connector. The returned modes may + * change every time this function is called and those from previous calls + * might become invalid. + */ + const struct native_mode **(*get_modes)(struct native_display *ndpy, + const struct native_connector *nconn, + int *num_modes); + + /** + * Create a scan-out surface. Required unless no config has + * GLX_SCREEN_BIT_MESA set. + */ + struct native_surface *(*create_scanout_surface)(struct native_display *ndpy, + const struct native_config *nconf, + uint width, uint height); + + /** + * Program the CRTC to output the surface to the given connectors with the + * given mode. When surface is not given, the CRTC is disabled. + * + * This interface does not export a way to query capabilities of the CRTCs. + * The native display usually needs to dynamically map the index to a CRTC + * that supports the given connectors. + */ + boolean (*program)(struct native_display *ndpy, int crtc_idx, + struct native_surface *nsurf, uint x, uint y, + const struct native_connector **nconns, int num_nconns, + const struct native_mode *nmode); +}; + +#endif /* _NATIVE_MODESET_H_ */ -- cgit v1.2.3 From fade8a6eb639d633cfdbba4a3ba3aa3cc5c04fa6 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 5 Mar 2010 11:00:15 +0800 Subject: st/egl: Add get_param to native display interface. get_param can be used to query the parameters of a native display. There is only NATIVE_PARAM_USE_NATIVE_BUFFER right now. It queries whether the window/pixmap surfaces use the native buffers instead of private buffers. --- src/gallium/state_trackers/egl/common/native.h | 16 ++++++++++++++++ src/gallium/state_trackers/egl/kms/native_kms.c | 16 ++++++++++++++++ src/gallium/state_trackers/egl/x11/native_dri2.c | 20 ++++++++++++++++++++ src/gallium/state_trackers/egl/x11/native_ximage.c | 20 ++++++++++++++++++++ 4 files changed, 72 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 4533b3abf9..9c22ff3e43 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -49,6 +49,14 @@ enum native_attachment { NUM_NATIVE_ATTACHMENTS }; +enum native_param_type { + /* + * Return TRUE if window/pixmap surfaces use the buffers of the native + * types. + */ + NATIVE_PARAM_USE_NATIVE_BUFFER +}; + /** * Enumerations for probe results. */ @@ -145,6 +153,14 @@ struct native_display { void (*destroy)(struct native_display *ndpy); + /** + * Query the parameters of the native display. + * + * The return value is defined by the parameter. + */ + int (*get_param)(struct native_display *ndpy, + enum native_param_type param); + /** * Get the supported configs. The configs are owned by the display, but * the returned array should be free()ed. diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index 90c82eaf6c..94588bfa74 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -665,6 +665,21 @@ kms_display_get_configs(struct native_display *ndpy, int *num_configs) return configs; } +static int +kms_display_get_param(struct native_display *ndpy, + enum native_param_type param) +{ + int val; + + switch (param) { + default: + val = 0; + break; + } + + return val; +} + static void kms_display_destroy(struct native_display *ndpy) { @@ -811,6 +826,7 @@ kms_create_display(EGLNativeDisplayType dpy, } kdpy->base.destroy = kms_display_destroy; + kdpy->base.get_param = kms_display_get_param; kdpy->base.get_configs = kms_display_get_configs; kdpy->base.create_pbuffer_surface = kms_display_create_pbuffer_surface; diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index 858033e1c1..8d2a8b1dff 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -707,6 +707,25 @@ dri2_display_is_pixmap_supported(struct native_display *ndpy, return (depth == nconf_depth || (depth == 24 && depth + 8 == nconf_depth)); } +static int +dri2_display_get_param(struct native_display *ndpy, + enum native_param_type param) +{ + int val; + + switch (param) { + case NATIVE_PARAM_USE_NATIVE_BUFFER: + /* DRI2GetBuffers use the native buffers */ + val = TRUE; + break; + default: + val = 0; + break; + } + + return val; +} + static void dri2_display_destroy(struct native_display *ndpy) { @@ -850,6 +869,7 @@ x11_create_dri2_display(EGLNativeDisplayType dpy, } dri2dpy->base.destroy = dri2_display_destroy; + dri2dpy->base.get_param = dri2_display_get_param; dri2dpy->base.get_configs = dri2_display_get_configs; dri2dpy->base.is_pixmap_supported = dri2_display_is_pixmap_supported; dri2dpy->base.create_window_surface = dri2_display_create_window_surface; diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 5e0270c296..3421c1951a 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -699,6 +699,25 @@ ximage_display_is_pixmap_supported(struct native_display *ndpy, return (fmt == nconf->color_format); } +static int +ximage_display_get_param(struct native_display *ndpy, + enum native_param_type param) +{ + int val; + + switch (param) { + case NATIVE_PARAM_USE_NATIVE_BUFFER: + /* private buffers are allocated */ + val = FALSE; + break; + default: + val = 0; + break; + } + + return val; +} + static void ximage_display_destroy(struct native_display *ndpy) { @@ -753,6 +772,7 @@ x11_create_ximage_display(EGLNativeDisplayType dpy, xdpy->base.screen = softpipe_create_screen(xdpy->winsys); xdpy->base.destroy = ximage_display_destroy; + xdpy->base.get_param = ximage_display_get_param; xdpy->base.get_configs = ximage_display_get_configs; xdpy->base.is_pixmap_supported = ximage_display_is_pixmap_supported; -- cgit v1.2.3 From 9373447a614e7b401919328b589b5f2607e456fd Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 5 Mar 2010 11:18:16 +0800 Subject: st/egl: Add support for EGL_KHR_image_base and EGL_KHR_image_pixmap. These extensions are not quite useful until the client APIs gain support for the respective EGLImage extensions. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 14 ++- src/gallium/state_trackers/egl/common/egl_g3d.h | 14 +++ .../state_trackers/egl/common/egl_g3d_image.c | 136 +++++++++++++++++++++ .../state_trackers/egl/common/egl_g3d_image.h | 41 +++++++ 4 files changed, 202 insertions(+), 3 deletions(-) create mode 100644 src/gallium/state_trackers/egl/common/egl_g3d_image.c create mode 100644 src/gallium/state_trackers/egl/common/egl_g3d_image.h (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index ddb1ef1bf1..50774b03f3 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -36,6 +36,7 @@ #include "native.h" #include "egl_g3d.h" +#include "egl_g3d_image.h" #include "egl_st.h" /** @@ -615,6 +616,10 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy, } #endif + dpy->Extensions.KHR_image_base = EGL_TRUE; + if (gdpy->native->get_param(gdpy->native, NATIVE_PARAM_USE_NATIVE_BUFFER)) + dpy->Extensions.KHR_image_pixmap = EGL_TRUE; + if (egl_g3d_add_configs(drv, dpy, 1) == 1) { _eglError(EGL_NOT_INITIALIZED, "eglInitialize(unable to add configs)"); goto fail; @@ -958,8 +963,8 @@ egl_g3d_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf) /** * Find a config that supports the pixmap. */ -static _EGLConfig * -find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix) +_EGLConfig * +egl_g3d_find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix) { struct egl_g3d_display *gdpy = egl_g3d_display(dpy); struct egl_g3d_config *gconf; @@ -1011,7 +1016,7 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, if (!gsurf->render_surface) return EGL_TRUE; - gconf = egl_g3d_config(find_pixmap_config(dpy, target)); + gconf = egl_g3d_config(egl_g3d_find_pixmap_config(dpy, target)); if (!gconf) return _eglError(EGL_BAD_NATIVE_PIXMAP, "eglCopyBuffers"); @@ -1322,6 +1327,9 @@ _eglMain(const char *args) gdrv->base.API.BindTexImage = egl_g3d_bind_tex_image; gdrv->base.API.ReleaseTexImage = egl_g3d_release_tex_image; + gdrv->base.API.CreateImageKHR = egl_g3d_create_image; + gdrv->base.API.DestroyImageKHR = egl_g3d_destroy_image; + #ifdef EGL_MESA_screen_surface gdrv->base.API.CreateScreenSurfaceMESA = egl_g3d_create_screen_surface; gdrv->base.API.ShowScreenSurfaceMESA = egl_g3d_show_screen_surface; diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.h b/src/gallium/state_trackers/egl/common/egl_g3d.h index 5d2d9c481a..e3e55e46d3 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.h +++ b/src/gallium/state_trackers/egl/common/egl_g3d.h @@ -34,6 +34,7 @@ #include "eglcontext.h" #include "eglsurface.h" #include "eglconfig.h" +#include "eglimage.h" #include "eglscreen.h" #include "eglmode.h" @@ -81,6 +82,14 @@ struct egl_g3d_config { const struct native_config *native; }; +struct egl_g3d_image { + _EGLImage base; + struct pipe_texture *texture; + unsigned face; + unsigned level; + unsigned zslice; +}; + struct egl_g3d_screen { _EGLScreen base; const struct native_connector *native; @@ -90,5 +99,10 @@ struct egl_g3d_screen { /* standard typecasts */ _EGL_DRIVER_STANDARD_TYPECASTS(egl_g3d) _EGL_DRIVER_TYPECAST(egl_g3d_screen, _EGLScreen, obj) +_EGL_DRIVER_TYPECAST(egl_g3d_image, _EGLImage, obj) + + +_EGLConfig * +egl_g3d_find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix); #endif /* _EGL_G3D_H_ */ diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_image.c b/src/gallium/state_trackers/egl/common/egl_g3d_image.c new file mode 100644 index 0000000000..d701f9c9a8 --- /dev/null +++ b/src/gallium/state_trackers/egl/common/egl_g3d_image.c @@ -0,0 +1,136 @@ +/* + * Mesa 3-D graphics library + * Version: 7.8 + * + * Copyright (C) 2010 LunarG Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Chia-I Wu + */ + +#include +#include "pipe/p_screen.h" +#include "util/u_memory.h" +#include "util/u_rect.h" +#include "util/u_inlines.h" +#include "eglcurrent.h" +#include "egllog.h" + +#include "native.h" +#include "egl_g3d.h" +#include "egl_g3d_image.h" + +/** + * Reference and return the front left buffer of the native pixmap. + */ +static struct pipe_texture * +egl_g3d_reference_native_pixmap(_EGLDisplay *dpy, EGLNativePixmapType pix) +{ + struct egl_g3d_display *gdpy = egl_g3d_display(dpy); + struct egl_g3d_config *gconf; + struct native_surface *nsurf; + struct pipe_texture *textures[NUM_NATIVE_ATTACHMENTS]; + enum native_attachment natt; + + gconf = egl_g3d_config(egl_g3d_find_pixmap_config(dpy, pix)); + if (!gconf) + return NULL; + + nsurf = gdpy->native->create_pixmap_surface(gdpy->native, + pix, gconf->native); + if (!nsurf) + return NULL; + + natt = NATIVE_ATTACHMENT_FRONT_LEFT; + if (!nsurf->validate(nsurf, 1 << natt, NULL, textures, NULL, NULL)) + textures[natt] = NULL; + + nsurf->destroy(nsurf); + + return textures[natt]; +} + +_EGLImage * +egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, + EGLenum target, EGLClientBuffer buffer, + const EGLint *attribs) +{ + struct pipe_texture *ptex; + struct egl_g3d_image *gimg; + unsigned face = 0, level = 0, zslice = 0; + + gimg = CALLOC_STRUCT(egl_g3d_image); + if (!gimg) { + _eglError(EGL_BAD_ALLOC, "eglCreatePbufferSurface"); + return NULL; + } + + if (!_eglInitImage(&gimg->base, dpy, attribs)) { + free(gimg); + return NULL; + } + + switch (target) { + case EGL_NATIVE_PIXMAP_KHR: + ptex = egl_g3d_reference_native_pixmap(dpy, + (EGLNativePixmapType) buffer); + break; + default: + ptex = NULL; + break; + } + + if (!ptex) { + free(gimg); + return NULL; + } + + if (level > ptex->last_level) { + _eglError(EGL_BAD_MATCH, "eglCreateEGLImageKHR"); + pipe_texture_reference(&gimg->texture, NULL); + free(gimg); + return NULL; + } + if (zslice > ptex->depth0) { + _eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR"); + pipe_texture_reference(&gimg->texture, NULL); + free(gimg); + return NULL; + } + + /* transfer the ownership to the image */ + gimg->texture = ptex; + gimg->face = face; + gimg->level = level; + gimg->zslice = zslice; + + return &gimg->base; +} + +EGLBoolean +egl_g3d_destroy_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img) +{ + struct egl_g3d_image *gimg = egl_g3d_image(img); + + pipe_texture_reference(&gimg->texture, NULL); + free(gimg); + + return EGL_TRUE; +} diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_image.h b/src/gallium/state_trackers/egl/common/egl_g3d_image.h new file mode 100644 index 0000000000..c199c46645 --- /dev/null +++ b/src/gallium/state_trackers/egl/common/egl_g3d_image.h @@ -0,0 +1,41 @@ +/* + * Mesa 3-D graphics library + * Version: 7.8 + * + * Copyright (C) 2010 LunarG Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Authors: + * Chia-I Wu + */ + +#ifndef _EGL_G3D_IMAGE_H_ +#define _EGL_G3D_IMAGE_H_ + +#include "egl_g3d.h" + +_EGLImage * +egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, + EGLenum target, EGLClientBuffer buffer, + const EGLint *attribs); + +EGLBoolean +egl_g3d_destroy_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *image); + +#endif /* _EGL_G3D_IMAGE_H_ */ -- cgit v1.2.3 From 3490923c817cd81d46a405de117e9ba8a8aeef3c Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 25 Feb 2010 16:37:04 +0800 Subject: mesa/es: Update GLAPI and APISpec for GL_OES_EGL_image. This generates the entrypoints and dispatches for GL_OES_EGL_image. There is no real support yet. --- src/mesa/es/glapi/es_EXT.xml | 3 +++ src/mesa/es/main/APIspec.xml | 39 +++++++++++++++++++++++++++++++++++++++ src/mesa/es/main/mfeatures_es1.h | 2 ++ src/mesa/es/main/mfeatures_es2.h | 2 ++ 4 files changed, 46 insertions(+) (limited to 'src') diff --git a/src/mesa/es/glapi/es_EXT.xml b/src/mesa/es/glapi/es_EXT.xml index 629ba90528..291a53b4b2 100644 --- a/src/mesa/es/glapi/es_EXT.xml +++ b/src/mesa/es/glapi/es_EXT.xml @@ -18,6 +18,9 @@ + + + diff --git a/src/mesa/es/main/APIspec.xml b/src/mesa/es/main/APIspec.xml index f6f33130b1..17665d8df5 100644 --- a/src/mesa/es/main/APIspec.xml +++ b/src/mesa/es/main/APIspec.xml @@ -3502,6 +3502,31 @@ + + + + @@ -3770,6 +3795,10 @@ + + + + @@ -3811,6 +3840,7 @@ --> + @@ -4068,6 +4098,10 @@ + + + + @@ -4095,6 +4129,7 @@ --> + @@ -4292,6 +4327,10 @@ + + + + diff --git a/src/mesa/es/main/mfeatures_es1.h b/src/mesa/es/main/mfeatures_es1.h index 6c2ece2608..1793550268 100644 --- a/src/mesa/es/main/mfeatures_es1.h +++ b/src/mesa/es/main/mfeatures_es1.h @@ -106,6 +106,8 @@ #define FEATURE_OES_draw_texture 1 #define FEATURE_OES_mapbuffer 1 +#define FEATURE_OES_EGL_image 1 + #define FEATURE_extra_context_init 1 /*@}*/ diff --git a/src/mesa/es/main/mfeatures_es2.h b/src/mesa/es/main/mfeatures_es2.h index f34782fedb..a463bed11c 100644 --- a/src/mesa/es/main/mfeatures_es2.h +++ b/src/mesa/es/main/mfeatures_es2.h @@ -106,6 +106,8 @@ #define FEATURE_OES_draw_texture 0 #define FEATURE_OES_mapbuffer 1 +#define FEATURE_OES_EGL_image 1 + #define FEATURE_extra_context_init 1 /*@}*/ -- cgit v1.2.3 From 99864d595f7d4c13e9548f83d5972db9af64e67b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 13 Nov 2009 12:19:35 +0000 Subject: APPLE_object_purgeable: core Signed-off-by: Chris Wilson --- src/mesa/main/api_exec.c | 6 + src/mesa/main/bufferobj.c | 356 +++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/bufferobj.h | 11 ++ src/mesa/main/dd.h | 17 +++ src/mesa/main/dlist.c | 6 + src/mesa/main/extensions.c | 4 + src/mesa/main/mfeatures.h | 1 + src/mesa/main/mtypes.h | 4 + 8 files changed, 405 insertions(+) (limited to 'src') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 70c154b62b..fa8d409caa 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -758,4 +758,10 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_EGLImageTargetTexture2DOES(exec, _mesa_EGLImageTargetTexture2DOES); SET_EGLImageTargetRenderbufferStorageOES(exec, _mesa_EGLImageTargetRenderbufferStorageOES); #endif + +#if FEATURE_APPLE_object_purgeable + SET_ObjectPurgeableAPPLE(exec, _mesa_ObjectPurgeableAPPLE); + SET_ObjectUnpurgeableAPPLE(exec, _mesa_ObjectUnpurgeableAPPLE); + SET_GetObjectParameterivAPPLE(exec, _mesa_GetObjectParameterivAPPLE); +#endif } diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 971b280f3b..3c48f6cce5 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -37,6 +37,8 @@ #include "image.h" #include "context.h" #include "bufferobj.h" +#include "fbobject.h" +#include "texobj.h" /* Debug flags */ @@ -1710,3 +1712,357 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) if (ctx->Driver.FlushMappedBufferRange) ctx->Driver.FlushMappedBufferRange(ctx, target, offset, length, bufObj); } + +#if FEATURE_APPLE_object_purgeable +static GLenum +_mesa_BufferObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) +{ + struct gl_buffer_object *bufObj; + GLenum retval; + + bufObj = _mesa_lookup_bufferobj(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectPurgeable(name = 0x%x)", name); + return 0; + } + if (!_mesa_is_bufferobj(bufObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glObjectPurgeable(buffer 0)" ); + return 0; + } + + if (bufObj->Purgeable) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glObjectPurgeable(name = 0x%x) is already purgeable", name); + return GL_VOLATILE_APPLE; + } + + bufObj->Purgeable = GL_TRUE; + + retval = GL_VOLATILE_APPLE; + if (ctx->Driver.BufferObjectPurgeable) + retval = ctx->Driver.BufferObjectPurgeable(ctx, bufObj, option); + + return retval; +} + +static GLenum +_mesa_RenderObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) +{ + struct gl_renderbuffer *bufObj; + GLenum retval; + + bufObj = _mesa_lookup_renderbuffer(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectUnpurgeable(name = 0x%x)", name); + return 0; + } + + if (bufObj->Purgeable) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glObjectPurgeable(name = 0x%x) is already purgeable", name); + return GL_VOLATILE_APPLE; + } + + bufObj->Purgeable = GL_TRUE; + + retval = GL_VOLATILE_APPLE; + if (ctx->Driver.RenderObjectPurgeable) + retval = ctx->Driver.RenderObjectPurgeable(ctx, bufObj, option); + + return retval; +} + +static GLenum +_mesa_TextureObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) +{ + struct gl_texture_object *bufObj; + GLenum retval; + + bufObj = _mesa_lookup_texture(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectPurgeable(name = 0x%x)", name); + return 0; + } + + if (bufObj->Purgeable) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glObjectPurgeable(name = 0x%x) is already purgeable", name); + return GL_VOLATILE_APPLE; + } + + bufObj->Purgeable = GL_TRUE; + + retval = GL_VOLATILE_APPLE; + if (ctx->Driver.TextureObjectPurgeable) + retval = ctx->Driver.TextureObjectPurgeable(ctx, bufObj, option); + + return retval; +} + +GLenum GLAPIENTRY +_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); + + if (name == 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectPurgeable(name = 0x%x)", name); + return 0; + } + + switch (option) { + case GL_VOLATILE_APPLE: + case GL_RELEASED_APPLE: + break; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glObjectPurgeable(name = 0x%x) invalid option: %d", name, option); + return 0; + } + + switch (objectType) { + case GL_TEXTURE: + return _mesa_TextureObjectPurgeable (ctx, name, option); + case GL_RENDERBUFFER_EXT: + return _mesa_RenderObjectPurgeable (ctx, name, option); + case GL_BUFFER_OBJECT_APPLE: + return _mesa_BufferObjectPurgeable (ctx, name, option); + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glObjectPurgeable(name = 0x%x) invalid type: %d", name, objectType); + return 0; + } +} + +static GLenum +_mesa_BufferObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) +{ + struct gl_buffer_object *bufObj; + GLenum retval; + + bufObj = _mesa_lookup_bufferobj(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectUnpurgeable(name = 0x%x)", name); + return 0; + } + + if (! bufObj->Purgeable) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glObjectUnpurgeable(name = 0x%x) object is already \"unpurged\"", name); + return 0; + } + + bufObj->Purgeable = GL_FALSE; + + retval = GL_RETAINED_APPLE; + if (ctx->Driver.BufferObjectUnpurgeable) + retval = ctx->Driver.BufferObjectUnpurgeable(ctx, bufObj, option); + + return retval; +} + +static GLenum +_mesa_RenderObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) +{ + struct gl_renderbuffer *bufObj; + GLenum retval; + + bufObj = _mesa_lookup_renderbuffer(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectUnpurgeable(name = 0x%x)", name); + return 0; + } + + if (! bufObj->Purgeable) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glObjectUnpurgeable(name = 0x%x) object is already \"unpurged\"", name); + return 0; + } + + bufObj->Purgeable = GL_FALSE; + + retval = GL_RETAINED_APPLE; + if (ctx->Driver.RenderObjectUnpurgeable) + retval = ctx->Driver.RenderObjectUnpurgeable(ctx, bufObj, option); + + return retval; +} + +static GLenum +_mesa_TextureObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) +{ + struct gl_texture_object *bufObj; + GLenum retval; + + bufObj = _mesa_lookup_texture(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectUnpurgeable(name = 0x%x)", name); + return 0; + } + + if (! bufObj->Purgeable) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glObjectUnpurgeable(name = 0x%x) object is already \"unpurged\"", name); + return 0; + } + + bufObj->Purgeable = GL_FALSE; + + retval = GL_RETAINED_APPLE; + if (ctx->Driver.TextureObjectUnpurgeable) + retval = ctx->Driver.TextureObjectUnpurgeable(ctx, bufObj, option); + + return retval; +} + +GLenum GLAPIENTRY +_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); + + if (name == 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectUnpurgeable(name = 0x%x)", name); + return 0; + } + + switch (option) { + case GL_RETAINED_APPLE: + case GL_UNDEFINED_APPLE: + break; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glObjectUnpurgeable(name = 0x%x) invalid option: %d", name, option); + return 0; + } + + switch (objectType) { + case GL_BUFFER_OBJECT_APPLE: + return _mesa_BufferObjectUnpurgeable(ctx, name, option); + + case GL_TEXTURE: + return _mesa_TextureObjectUnpurgeable(ctx, name, option); + + case GL_RENDERBUFFER_EXT: + return _mesa_RenderObjectUnpurgeable(ctx, name, option); + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glObjectUnpurgeable(name = 0x%x) invalid type: %d", name, objectType); + return 0; + } +} + +static void +_mesa_GetBufferObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, GLint* params) +{ + struct gl_buffer_object *bufObj; + + bufObj = _mesa_lookup_bufferobj(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetObjectParameteriv(name = 0x%x) invalid object", name); + return; + } + + switch (pname) { + case GL_PURGEABLE_APPLE: + *params = bufObj->Purgeable; + break; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", name, pname); + break; + } +} + +static void +_mesa_GetRenderObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, GLint* params) +{ + struct gl_renderbuffer *bufObj; + + bufObj = _mesa_lookup_renderbuffer(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectUnpurgeable(name = 0x%x)", name); + return; + } + + switch (pname) { + case GL_PURGEABLE_APPLE: + *params = bufObj->Purgeable; + break; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", name, pname); + break; + } +} + +static void +_mesa_GetTextureObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, GLint* params) +{ + struct gl_texture_object *bufObj; + + bufObj = _mesa_lookup_texture(ctx, name); + if (!bufObj) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glObjectUnpurgeable(name = 0x%x)", name); + return; + } + + switch (pname) { + case GL_PURGEABLE_APPLE: + *params = bufObj->Purgeable; + break; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", name, pname); + break; + } +} + +void GLAPIENTRY +_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params) +{ + GET_CURRENT_CONTEXT(ctx); + + if (name == 0) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetObjectParameteriv(name = 0x%x)", name); + return; + } + + switch (objectType) { + case GL_TEXTURE: + _mesa_GetTextureObjectParameterivAPPLE (ctx, name, pname, params); + break; + + case GL_BUFFER_OBJECT_APPLE: + _mesa_GetBufferObjectParameterivAPPLE (ctx, name, pname, params); + break; + + case GL_RENDERBUFFER_EXT: + _mesa_GetRenderObjectParameterivAPPLE (ctx, name, pname, params); + break; + + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetObjectParameteriv(name = 0x%x) invalid type: %d", name, objectType); + } +} +#endif diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index f8bca5ff71..912529cfdf 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -175,4 +175,15 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, extern void GLAPIENTRY _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length); +#if FEATURE_APPLE_object_purgeable +extern GLenum GLAPIENTRY +_mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option); + +extern GLenum GLAPIENTRY +_mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option); + +extern void GLAPIENTRY +_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params); +#endif + #endif diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 84b83fe273..197de09b22 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -776,6 +776,23 @@ struct dd_function_table { /*@}*/ #endif + /** + * \name Functions for GL_APPLE_object_purgeable + */ +#if FEATURE_APPLE_object_purgeable + /*@{*/ + /* variations on ObjectPurgeable */ + GLenum (*BufferObjectPurgeable)( GLcontext *ctx, struct gl_buffer_object *obj, GLenum option ); + GLenum (*RenderObjectPurgeable)( GLcontext *ctx, struct gl_renderbuffer *obj, GLenum option ); + GLenum (*TextureObjectPurgeable)( GLcontext *ctx, struct gl_texture_object *obj, GLenum option ); + + /* variations on ObjectUnpurgeable */ + GLenum (*BufferObjectUnpurgeable)( GLcontext *ctx, struct gl_buffer_object *obj, GLenum option ); + GLenum (*RenderObjectUnpurgeable)( GLcontext *ctx, struct gl_renderbuffer *obj, GLenum option ); + GLenum (*TextureObjectUnpurgeable)( GLcontext *ctx, struct gl_texture_object *obj, GLenum option ); + /*@}*/ +#endif + /** * \name Functions for GL_EXT_framebuffer_object */ diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 673db30f25..43aadb1de5 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -9285,6 +9285,12 @@ _mesa_init_save_table(struct _glapi_table *table) /* 364. GL_EXT_provoking_vertex */ SET_ProvokingVertexEXT(table, save_ProvokingVertexEXT); + /* 371. GL_APPLE_object_purgeable */ +#if FEATURE_APPLE_object_purgeable + SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE); + SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE); +#endif + /* GL 3.0 */ #if 0 SET_ClearBufferiv(table, save_ClearBufferiv); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 0e7e52a54a..30245d6aaf 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -153,6 +153,7 @@ static const struct { { OFF, "GL_APPLE_client_storage", F(APPLE_client_storage) }, { ON, "GL_APPLE_packed_pixels", F(APPLE_packed_pixels) }, { OFF, "GL_APPLE_vertex_array_object", F(APPLE_vertex_array_object) }, + { OFF, "GL_APPLE_object_purgeable", F(APPLE_object_purgeable) }, { OFF, "GL_ATI_blend_equation_separate", F(EXT_blend_equation_separate) }, { OFF, "GL_ATI_envmap_bumpmap", F(ATI_envmap_bumpmap) }, { OFF, "GL_ATI_texture_env_combine3", F(ATI_texture_env_combine3)}, @@ -265,6 +266,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_sync = GL_TRUE; #endif ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; +#if FEATURE_APPLE_object_purgeable + ctx->Extensions.APPLE_object_purgeable = GL_TRUE; +#endif ctx->Extensions.ATI_envmap_bumpmap = GL_TRUE; #if FEATURE_ATI_fragment_shader ctx->Extensions.ATI_fragment_shader = GL_TRUE; diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index f0896ee626..cb96c4d1d0 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -116,6 +116,7 @@ #define FEATURE_EXT_framebuffer_blit _HAVE_FULL_GL #define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL #define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL +#define FEATURE_APPLE_object_purgeable _HAVE_FULL_GL #define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL #define FEATURE_ATI_fragment_shader _HAVE_FULL_GL #define FEATURE_NV_fence _HAVE_FULL_GL diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 4d55ebb972..9d9b475dd1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1244,6 +1244,7 @@ struct gl_texture_object GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ GLboolean _Complete; /**< Is texture object complete? */ GLboolean _RenderToTexture; /**< Any rendering to this texture? */ + GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ /** Actual texture images, indexed by [cube face] and [mipmap level] */ struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; @@ -1439,6 +1440,7 @@ struct gl_buffer_object GLsizeiptr Length; /**< Mapped length */ /*@}*/ GLboolean Written; /**< Ever written to? (for debugging) */ + GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ }; @@ -2104,6 +2106,7 @@ struct gl_renderbuffer GLuint Name; GLint RefCount; GLuint Width, Height; + GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ GLenum InternalFormat; /**< The user-specified format */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or @@ -2491,6 +2494,7 @@ struct gl_extensions GLboolean APPLE_client_storage; GLboolean APPLE_packed_pixels; GLboolean APPLE_vertex_array_object; + GLboolean APPLE_object_purgeable; GLboolean ATI_envmap_bumpmap; GLboolean ATI_texture_mirror_once; GLboolean ATI_texture_env_combine3; -- cgit v1.2.3 From 755915fa5d9ea782d142b3f8755b62d6de28fe29 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 13 Jan 2010 18:35:25 +0000 Subject: APPLE_object_purgeable: intel Implement support for purgeable objects by using the GEM madvise ioctl. Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 134 +++++++++++++++++++++- src/mesa/drivers/dri/intel/intel_extensions.c | 3 + 2 files changed, 136 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 312866d865..7599beab52 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -31,10 +31,12 @@ #include "main/macros.h" #include "main/bufferobj.h" -#include "intel_context.h" #include "intel_blit.h" #include "intel_buffer_objects.h" #include "intel_batchbuffer.h" +#include "intel_context.h" +#include "intel_fbo.h" +#include "intel_mipmap_tree.h" #include "intel_regions.h" static GLboolean @@ -588,6 +590,126 @@ intel_bufferobj_copy_subdata(GLcontext *ctx, intel_batchbuffer_emit_mi_flush(intel->batch); } +#if FEATURE_APPLE_object_purgeable +static GLenum +intel_buffer_purgeable(GLcontext * ctx, + drm_intel_bo *buffer, + GLenum option) +{ + int retained = 0; + + if (buffer != NULL) + retained = drm_intel_bo_madvise (buffer, I915_MADV_DONTNEED); + + return retained ? GL_VOLATILE_APPLE : GL_RELEASED_APPLE; +} + +static GLenum +intel_buffer_object_purgeable(GLcontext * ctx, + struct gl_buffer_object *obj, + GLenum option) +{ + struct intel_buffer_object *intel; + + intel = intel_buffer_object (obj); + if (intel->buffer != NULL) + return intel_buffer_purgeable (ctx, intel->buffer, option); + + if (option == GL_RELEASED_APPLE) { + if (intel->sys_buffer != NULL) { + free(intel->sys_buffer); + intel->sys_buffer = NULL; + } + + return GL_RELEASED_APPLE; + } else { + /* XXX Create the buffer and madvise(MADV_DONTNEED)? */ + return intel_buffer_purgeable (ctx, + intel_bufferobj_buffer(intel_context(ctx), + intel, INTEL_READ), + option); + } +} + +static GLenum +intel_texture_object_purgeable(GLcontext * ctx, + struct gl_texture_object *obj, + GLenum option) +{ + struct intel_texture_object *intel; + + intel = intel_texture_object(obj); + if (intel->mt == NULL || intel->mt->region == NULL) + return GL_RELEASED_APPLE; + + return intel_buffer_purgeable (ctx, intel->mt->region->buffer, option); +} + +static GLenum +intel_render_object_purgeable(GLcontext * ctx, + struct gl_renderbuffer *obj, + GLenum option) +{ + struct intel_renderbuffer *intel; + + intel = intel_renderbuffer(obj); + if (intel->region == NULL) + return GL_RELEASED_APPLE; + + return intel_buffer_purgeable (ctx, intel->region->buffer, option); +} + +static GLenum +intel_buffer_unpurgeable(GLcontext * ctx, + drm_intel_bo *buffer, + GLenum option) +{ + int retained; + + retained = 0; + if (buffer != NULL) + retained = drm_intel_bo_madvise (buffer, I915_MADV_WILLNEED); + + return retained ? GL_RETAINED_APPLE : GL_UNDEFINED_APPLE; +} + +static GLenum +intel_buffer_object_unpurgeable(GLcontext * ctx, + struct gl_buffer_object *obj, + GLenum option) +{ + return intel_buffer_unpurgeable (ctx, intel_buffer_object (obj)->buffer, option); +} + +static GLenum +intel_texture_object_unpurgeable(GLcontext * ctx, + struct gl_texture_object *obj, + GLenum option) +{ + struct intel_texture_object *intel; + + intel = intel_texture_object(obj); + if (intel->mt == NULL || intel->mt->region == NULL) + return GL_UNDEFINED_APPLE; + + return intel_buffer_unpurgeable (ctx, intel->mt->region->buffer, option); +} + +static GLenum +intel_render_object_unpurgeable(GLcontext * ctx, + struct gl_renderbuffer *obj, + GLenum option) +{ + struct intel_renderbuffer *intel; + + intel = intel_renderbuffer(obj); + if (intel->region == NULL) + return GL_UNDEFINED_APPLE; + + return intel_buffer_unpurgeable (ctx, intel->region->buffer, option); +} +#endif + void intelInitBufferObjectFuncs(struct dd_function_table *functions) { @@ -601,4 +723,14 @@ intelInitBufferObjectFuncs(struct dd_function_table *functions) functions->FlushMappedBufferRange = intel_bufferobj_flush_mapped_range; functions->UnmapBuffer = intel_bufferobj_unmap; functions->CopyBufferSubData = intel_bufferobj_copy_subdata; + +#if FEATURE_APPLE_object_purgeable + functions->BufferObjectPurgeable = intel_buffer_object_purgeable; + functions->TextureObjectPurgeable = intel_texture_object_purgeable; + functions->RenderObjectPurgeable = intel_render_object_purgeable; + + functions->BufferObjectUnpurgeable = intel_buffer_object_unpurgeable; + functions->TextureObjectUnpurgeable = intel_texture_object_unpurgeable; + functions->RenderObjectUnpurgeable = intel_render_object_unpurgeable; +#endif } diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index e16c33b33d..a1aac699c9 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -58,6 +58,7 @@ #define need_GL_EXT_secondary_color #define need_GL_EXT_stencil_two_side #define need_GL_APPLE_vertex_array_object +#define need_GL_APPLE_object_purgeable #define need_GL_ATI_separate_stencil #define need_GL_ATI_envmap_bumpmap #define need_GL_NV_point_sprite @@ -121,6 +122,7 @@ static const struct dri_extension card_extensions[] = { { "GL_EXT_texture_lod_bias", NULL }, { "GL_3DFX_texture_compression_FXT1", NULL }, { "GL_APPLE_client_storage", NULL }, + { "GL_APPLE_object_purgeable", GL_APPLE_object_purgeable_functions }, { "GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions}, { "GL_MESA_pack_invert", NULL }, { "GL_MESA_ycbcr_texture", NULL }, @@ -182,6 +184,7 @@ static const struct dri_extension arb_oq_extensions[] = { { NULL, NULL } }; + static const struct dri_extension fragment_shader_extensions[] = { { "GL_ARB_fragment_shader", NULL }, { NULL, NULL } -- cgit v1.2.3 From e176ae5f2a90632c778c3ae7dcab587f119035b1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 09:23:43 -0700 Subject: mesa: whitespace fixes, 80-column wrapping, etc. --- src/mesa/main/bufferobj.c | 186 +++++++++++++++++++++++++--------------------- 1 file changed, 102 insertions(+), 84 deletions(-) (limited to 'src') diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 3c48f6cce5..c532cbef11 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1119,20 +1119,20 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, } switch (usage) { - case GL_STREAM_DRAW_ARB: - case GL_STREAM_READ_ARB: - case GL_STREAM_COPY_ARB: - case GL_STATIC_DRAW_ARB: - case GL_STATIC_READ_ARB: - case GL_STATIC_COPY_ARB: - case GL_DYNAMIC_DRAW_ARB: - case GL_DYNAMIC_READ_ARB: - case GL_DYNAMIC_COPY_ARB: - /* OK */ - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBufferDataARB(usage)"); - return; + case GL_STREAM_DRAW_ARB: + case GL_STREAM_READ_ARB: + case GL_STREAM_COPY_ARB: + case GL_STATIC_DRAW_ARB: + case GL_STATIC_READ_ARB: + case GL_STATIC_COPY_ARB: + case GL_DYNAMIC_DRAW_ARB: + case GL_DYNAMIC_READ_ARB: + case GL_DYNAMIC_COPY_ARB: + /* OK */ + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBufferDataARB(usage)"); + return; } bufObj = get_buffer(ctx, target); @@ -1225,18 +1225,18 @@ _mesa_MapBufferARB(GLenum target, GLenum access) ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL); switch (access) { - case GL_READ_ONLY_ARB: - accessFlags = GL_MAP_READ_BIT; - break; - case GL_WRITE_ONLY_ARB: - accessFlags = GL_MAP_WRITE_BIT; - break; - case GL_READ_WRITE_ARB: - accessFlags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glMapBufferARB(access)"); - return NULL; + case GL_READ_ONLY_ARB: + accessFlags = GL_MAP_READ_BIT; + break; + case GL_WRITE_ONLY_ARB: + accessFlags = GL_MAP_WRITE_BIT; + break; + case GL_READ_WRITE_ARB: + accessFlags = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glMapBufferARB(access)"); + return NULL; } bufObj = get_buffer(ctx, target); @@ -1385,21 +1385,21 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params) } switch (pname) { - case GL_BUFFER_SIZE_ARB: - *params = (GLint) bufObj->Size; - break; - case GL_BUFFER_USAGE_ARB: - *params = bufObj->Usage; - break; - case GL_BUFFER_ACCESS_ARB: - *params = simplified_access_mode(bufObj->AccessFlags); - break; - case GL_BUFFER_MAPPED_ARB: - *params = _mesa_bufferobj_mapped(bufObj); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferParameterivARB(pname)"); - return; + case GL_BUFFER_SIZE_ARB: + *params = (GLint) bufObj->Size; + break; + case GL_BUFFER_USAGE_ARB: + *params = bufObj->Usage; + break; + case GL_BUFFER_ACCESS_ARB: + *params = simplified_access_mode(bufObj->AccessFlags); + break; + case GL_BUFFER_MAPPED_ARB: + *params = _mesa_bufferobj_mapped(bufObj); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferParameterivARB(pname)"); + return; } } @@ -1427,21 +1427,21 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params) } switch (pname) { - case GL_BUFFER_SIZE_ARB: - *params = bufObj->Size; - break; - case GL_BUFFER_USAGE_ARB: - *params = bufObj->Usage; - break; - case GL_BUFFER_ACCESS_ARB: - *params = simplified_access_mode(bufObj->AccessFlags); - break; - case GL_BUFFER_MAPPED_ARB: - *params = _mesa_bufferobj_mapped(bufObj); - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferParameteri64v(pname)"); - return; + case GL_BUFFER_SIZE_ARB: + *params = bufObj->Size; + break; + case GL_BUFFER_USAGE_ARB: + *params = bufObj->Usage; + break; + case GL_BUFFER_ACCESS_ARB: + *params = simplified_access_mode(bufObj->AccessFlags); + break; + case GL_BUFFER_MAPPED_ARB: + *params = _mesa_bufferobj_mapped(bufObj); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferParameteri64v(pname)"); + return; } } @@ -1713,6 +1713,7 @@ _mesa_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) ctx->Driver.FlushMappedBufferRange(ctx, target, offset, length, bufObj); } + #if FEATURE_APPLE_object_purgeable static GLenum _mesa_BufferObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) @@ -1746,6 +1747,7 @@ _mesa_BufferObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) return retval; } + static GLenum _mesa_RenderObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) { @@ -1774,6 +1776,7 @@ _mesa_RenderObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) return retval; } + static GLenum _mesa_TextureObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) { @@ -1802,6 +1805,7 @@ _mesa_TextureObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) return retval; } + GLenum GLAPIENTRY _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) { @@ -1817,11 +1821,12 @@ _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) switch (option) { case GL_VOLATILE_APPLE: case GL_RELEASED_APPLE: + /* legal */ break; - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectPurgeable(name = 0x%x) invalid option: %d", name, option); + "glObjectPurgeable(name = 0x%x) invalid option: %d", + name, option); return 0; } @@ -1832,14 +1837,15 @@ _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) return _mesa_RenderObjectPurgeable (ctx, name, option); case GL_BUFFER_OBJECT_APPLE: return _mesa_BufferObjectPurgeable (ctx, name, option); - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectPurgeable(name = 0x%x) invalid type: %d", name, objectType); + "glObjectPurgeable(name = 0x%x) invalid type: %d", + name, objectType); return 0; } } + static GLenum _mesa_BufferObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) { @@ -1855,7 +1861,8 @@ _mesa_BufferObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) if (! bufObj->Purgeable) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glObjectUnpurgeable(name = 0x%x) object is already \"unpurged\"", name); + "glObjectUnpurgeable(name = 0x%x) object is " + " already \"unpurged\"", name); return 0; } @@ -1868,6 +1875,7 @@ _mesa_BufferObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) return retval; } + static GLenum _mesa_RenderObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) { @@ -1883,7 +1891,8 @@ _mesa_RenderObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) if (! bufObj->Purgeable) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glObjectUnpurgeable(name = 0x%x) object is already \"unpurged\"", name); + "glObjectUnpurgeable(name = 0x%x) object is " + " already \"unpurged\"", name); return 0; } @@ -1896,6 +1905,7 @@ _mesa_RenderObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) return retval; } + static GLenum _mesa_TextureObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) { @@ -1911,7 +1921,8 @@ _mesa_TextureObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) if (! bufObj->Purgeable) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glObjectUnpurgeable(name = 0x%x) object is already \"unpurged\"", name); + "glObjectUnpurgeable(name = 0x%x) object is" + " already \"unpurged\"", name); return 0; } @@ -1924,6 +1935,7 @@ _mesa_TextureObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) return retval; } + GLenum GLAPIENTRY _mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) { @@ -1939,33 +1951,34 @@ _mesa_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) switch (option) { case GL_RETAINED_APPLE: case GL_UNDEFINED_APPLE: + /* legal */ break; - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectUnpurgeable(name = 0x%x) invalid option: %d", name, option); + "glObjectUnpurgeable(name = 0x%x) invalid option: %d", + name, option); return 0; } switch (objectType) { case GL_BUFFER_OBJECT_APPLE: return _mesa_BufferObjectUnpurgeable(ctx, name, option); - case GL_TEXTURE: return _mesa_TextureObjectUnpurgeable(ctx, name, option); - case GL_RENDERBUFFER_EXT: return _mesa_RenderObjectUnpurgeable(ctx, name, option); - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glObjectUnpurgeable(name = 0x%x) invalid type: %d", name, objectType); + "glObjectUnpurgeable(name = 0x%x) invalid type: %d", + name, objectType); return 0; } } + static void -_mesa_GetBufferObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, GLint* params) +_mesa_GetBufferObjectParameterivAPPLE(GLcontext *ctx, GLuint name, + GLenum pname, GLint* params) { struct gl_buffer_object *bufObj; @@ -1980,16 +1993,18 @@ _mesa_GetBufferObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, case GL_PURGEABLE_APPLE: *params = bufObj->Purgeable; break; - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", name, pname); + "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", + name, pname); break; } } + static void -_mesa_GetRenderObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, GLint* params) +_mesa_GetRenderObjectParameterivAPPLE(GLcontext *ctx, GLuint name, + GLenum pname, GLint* params) { struct gl_renderbuffer *bufObj; @@ -2004,16 +2019,18 @@ _mesa_GetRenderObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, case GL_PURGEABLE_APPLE: *params = bufObj->Purgeable; break; - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", name, pname); + "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", + name, pname); break; } } + static void -_mesa_GetTextureObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname, GLint* params) +_mesa_GetTextureObjectParameterivAPPLE(GLcontext *ctx, GLuint name, + GLenum pname, GLint* params) { struct gl_texture_object *bufObj; @@ -2028,16 +2045,18 @@ _mesa_GetTextureObjectParameterivAPPLE(GLcontext *ctx, GLuint name, GLenum pname case GL_PURGEABLE_APPLE: *params = bufObj->Purgeable; break; - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", name, pname); + "glGetObjectParameteriv(name = 0x%x) invalid enum: %d", + name, pname); break; } } + void GLAPIENTRY -_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint* params) +_mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, + GLint* params) { GET_CURRENT_CONTEXT(ctx); @@ -2051,18 +2070,17 @@ _mesa_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GL case GL_TEXTURE: _mesa_GetTextureObjectParameterivAPPLE (ctx, name, pname, params); break; - case GL_BUFFER_OBJECT_APPLE: _mesa_GetBufferObjectParameterivAPPLE (ctx, name, pname, params); break; - case GL_RENDERBUFFER_EXT: _mesa_GetRenderObjectParameterivAPPLE (ctx, name, pname, params); break; - default: _mesa_error(ctx, GL_INVALID_ENUM, - "glGetObjectParameteriv(name = 0x%x) invalid type: %d", name, objectType); + "glGetObjectParameteriv(name = 0x%x) invalid type: %d", + name, objectType); } } -#endif + +#endif /* FEATURE_APPLE_object_purgeable */ -- cgit v1.2.3 From c3b6adccc91b295772a934ba4115c7f3cced4dfe Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 09:53:37 -0700 Subject: gallium/docs: updated/improve sampler state documentation --- src/gallium/docs/source/cso/sampler.rst | 98 ++++++++++++++++++++++++++------- 1 file changed, 77 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/gallium/docs/source/cso/sampler.rst b/src/gallium/docs/source/cso/sampler.rst index 77979fc44d..44698d1250 100644 --- a/src/gallium/docs/source/cso/sampler.rst +++ b/src/gallium/docs/source/cso/sampler.rst @@ -13,38 +13,94 @@ Members ------- wrap_s - How to wrap the S coordinate. One of PIPE_TEX_WRAP. + How to wrap the S coordinate. One of PIPE_TEX_WRAP_*. wrap_t - How to wrap the T coordinate. One of PIPE_TEX_WRAP. + How to wrap the T coordinate. One of PIPE_TEX_WRAP_*. wrap_r - How to wrap the R coordinate. One of PIPE_TEX_WRAP. + How to wrap the R coordinate. One of PIPE_TEX_WRAP_*. + +The wrap modes are: + +* ``PIPE_TEX_WRAP_REPEAT``: Standard coord repeat/wrap-around mode. +* ``PIPE_TEX_WRAP_CLAMP_TO_EDGE``: Clamp coord to edge of texture, the border + color is never sampled. +* ``PIPE_TEX_WRAP_CLAMP_TO_BORDER``: Clamp coord to border of texture, the + border color is sampled when coords go outside the range [0,1]. +* ``PIPE_TEX_WRAP_CLAMP``: The coord is clamped to the range [0,1] before + scaling to the texture size. This corresponds to the legacy OpenGL GL_CLAMP + texture wrap mode. Historically, this mode hasn't acted consistantly across + all graphics hardware. It sometimes acts like CLAMP_TO_EDGE or + CLAMP_TO_BORDER. The behaviour may also vary depending on linear vs. + nearest sampling mode. +* ``PIPE_TEX_WRAP_MIRROR_REPEAT``: If the integer part of the coordinate + is odd, the coord becomes (1 - coord). Then, normal texture REPEAT is + applied to the coord. +* ``PIPE_TEX_WRAP_MIRROR_CLAMP_TO_EDGE``: First, the absolute value of the + coordinate is computed. Then, regular CLAMP_TO_EDGE is applied to the coord. +* ``PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER``: First, the absolute value of the + coordinate is computed. Then, regular CLAMP_TO_BORDER is applied to the + coord. +* ``PIPE_TEX_WRAP_MIRROR_CLAMP``: First, the absolute value of the coord is + computed. Then, regular CLAMP is applied to the coord. + + min_img_filter - The filter to use when minifying texels. One of PIPE_TEX_FILTER. + The image filter to use when minifying texels. One of PIPE_TEX_FILTER_*. +mag_img_filter + The image filter to use when magnifying texels. One of PIPE_TEX_FILTER_*. + +The texture image filter modes are: + +* ``PIPE_TEX_FILTER_NEAREST``: One texel is fetched from the texture image + at the texture coordinate. +* ``PIPE_TEX_FILTER_LINEAR``: Two, four or eight texels (depending on the + texture dimensions; 1D/2D/3D) are fetched from the texture image and + linearly weighted and blended together. + min_mip_filter The filter to use when minifying mipmapped textures. One of - PIPE_TEX_FILTER. -mag_img_filter - The filter to use when magnifying texels. One of PIPE_TEX_FILTER. + PIPE_TEX_MIPFILTER_*. + +The texture mip filter modes are: + +* ``PIPE_TEX_MIPFILTER_NEAREST``: A single mipmap level/image is selected + according to the texture LOD (lambda) value. +* ``PIPE_TEX_MIPFILTER_LINEAR``: The two mipmap levels/images above/below + the texture LOD value are sampled from. The results of sampling from + those two images are blended together with linear interpolation. +* ``PIPE_TEX_MIPFILTER_NONE``: Mipmap filtering is disabled. All texels + are taken from the level 0 image. + + compare_mode - If set to PIPE_TEX_COMPARE_R_TO_TEXTURE, texture output is computed - according to compare_func, using r coord and the texture value as operands. + If set to PIPE_TEX_COMPARE_R_TO_TEXTURE, the result of texture sampling + is not a color but a true/false value which is the result of comparing the + sampled texture value (typically a Z value from a depth texture) to the + texture coordinate's R component. If set to PIPE_TEX_COMPARE_NONE, no comparison calculation is performed. compare_func - How the comparison is computed. One of PIPE_FUNC. + The inequality operator used when compare_mode=1. One of PIPE_FUNC_x. normalized_coords - Whether the texture coordinates are normalized. If normalized, they will - always be in [0, 1]. If not, they will be in the range of each dimension - of the loaded texture. + If set, the incoming texture coordinates (nominally in the range [0,1]) + will be scaled by the texture width, height, depth to compute texel + addresses. Otherwise, the texture coords are used as-is (they are not + scaled by the texture dimensions). lod_bias - The bias to apply to the level of detail. + Bias factor which is added to the computed level of detail. + The normal level of detail is computed from the partial derivatives of + the texture coordinates and/or the fragment shader TEX/TXB/TXL + instruction. min_lod - Minimum level of detail, used to clamp LoD after bias. + Minimum level of detail, used to clamp LOD after bias. The LOD values + correspond to mipmap levels where LOD=0 is the level 0 mipmap image. max_lod - Maximum level of detail, used to clamp LoD after bias. + Maximum level of detail, used to clamp LOD after bias. border_color - RGBA color used for out-of-bounds coordinates. + RGBA color used for texel coordinates that are outside the [0,width-1], + [0, height-1] or [0, depth-1] ranges. max_anisotropy - Maximum filtering to apply anisotropically to textures. Setting this to - 0 disables anisotropic filtering. Any other setting enables anisotropic - filtering, however it's not unexpected some drivers only will change their - filtering with a setting of 2 and higher. + Maximum anistropy ratio to use when sampling from textures. For example, + if max_anistropy=4, a region of up to 1 by 4 texels will be sampled. + Set to zero to disable anisotropic filtering. Any other setting enables + anisotropic filtering, however it's not unexpected some drivers only will + change their filtering with a setting of 2 and higher. -- cgit v1.2.3 From 5024a39d111e2cef176a18e17f18917c2242ec72 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Tue, 2 Mar 2010 11:08:05 +0100 Subject: nouveau: s/TEXTURE_USAGE_PRIMARY/TEXTURE_USAGE_SCANOUT --- src/gallium/drivers/nv30/nv30_miptree.c | 4 ++-- src/gallium/drivers/nv40/nv40_miptree.c | 4 ++-- src/gallium/drivers/nv50/nv50_miptree.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index c29c36e20a..d8a9d3f093 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -18,7 +18,7 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt) PIPE_TEXTURE_USAGE_DEPTH_STENCIL | PIPE_TEXTURE_USAGE_RENDER_TARGET | PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY); + PIPE_TEXTURE_USAGE_SCANOUT); if (pt->target == PIPE_TEXTURE_CUBE) { nr_faces = 6; @@ -78,7 +78,7 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) pt->height0 & (pt->height0 - 1)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else - if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY | + if (pt->tex_usage & (PIPE_TEXTURE_USAGE_SCANOUT | PIPE_TEXTURE_USAGE_DISPLAY_TARGET | PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index ad1a9a5195..9acbef4d7d 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -20,7 +20,7 @@ nv40_miptree_layout(struct nv40_miptree *mt) PIPE_TEXTURE_USAGE_DEPTH_STENCIL | PIPE_TEXTURE_USAGE_RENDER_TARGET | PIPE_TEXTURE_USAGE_DISPLAY_TARGET | - PIPE_TEXTURE_USAGE_PRIMARY); + PIPE_TEXTURE_USAGE_SCANOUT); if (pt->target == PIPE_TEXTURE_CUBE) { nr_faces = 6; @@ -80,7 +80,7 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) pt->height0 & (pt->height0 - 1)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; else - if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY | + if (pt->tex_usage & (PIPE_TEXTURE_USAGE_SCANOUT | PIPE_TEXTURE_USAGE_DISPLAY_TARGET | PIPE_TEXTURE_USAGE_DEPTH_STENCIL)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 7297c74a83..133f2204e0 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -104,7 +104,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp) tile_flags = 0x7400; break; default: - if ((pt->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) && + if ((pt->tex_usage & PIPE_TEXTURE_USAGE_SCANOUT) && util_format_get_blocksizebits(pt->format) == 32) tile_flags = 0x7a00; else -- cgit v1.2.3 From 6b3145d6ee07a0fa9bb867e96ebe6cf716961bb9 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 5 Mar 2010 10:31:39 -0800 Subject: GLX: remove debug prints from glXWaitForMscOML dispatch Leftover from earlier commit. --- src/glx/glxcmds.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 4fbc6b6ab2..49cbce72f8 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -2534,8 +2534,6 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable, __GLXscreenConfigs * const psc = GetGLXScreenConfigs( dpy, screen ); int ret; - fprintf(stderr, "waitmsc: %lld, %lld, %lld\n", target_msc, divisor, - remainder); /* The OML_sync_control spec says these should "generate a GLX_BAD_VALUE * error", but the return type in the spec is Bool. @@ -2547,7 +2545,6 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable, #ifdef __DRI_MEDIA_STREAM_COUNTER if (pdraw != NULL && psc->msc != NULL) { - fprintf(stderr, "dri1 msc\n"); ret = (*psc->msc->waitForMSC) (pdraw->driDrawable, target_msc, divisor, remainder, msc, sbc); @@ -2563,7 +2560,6 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable, return ret; } - fprintf(stderr, "no drawable??\n"); return False; } -- cgit v1.2.3 From 1ca968363dd55e919bd91c8fc31c34d207af3958 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Fri, 5 Mar 2010 11:17:19 -0800 Subject: DRI2: expose OML_sync_control if possible If the server supports the OML related protocol, enable support for the extension. --- src/glx/dri2_glx.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 29d589cdb9..d573e46296 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -613,6 +613,9 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen, #ifdef X_DRI2SwapInterval psp->setSwapInterval = dri2SetSwapInterval; psp->getSwapInterval = dri2GetSwapInterval; +#endif +#if defined(X_DRI2GetMSC) && defined(X_DRI2WaitMSC) && defined(X_DRI2SwapInterval) + __glXEnableDirectExtension(psc, "GLX_OML_sync_control"); #endif } -- cgit v1.2.3 From e9968ebfa40b4740601c1596950ebd3f168664b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 12:32:32 -0700 Subject: mesa: minor reformatting, new comments --- src/mesa/main/api_validate.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index e9359dbe5f..4fb7b5ad61 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -123,6 +123,12 @@ check_valid_to_render(GLcontext *ctx, const char *function) return GL_TRUE; } + +/** + * Do bounds checking on array element indexes. Check that the vertices + * pointed to by the indices don't lie outside buffer object bounds. + * \return GL_TRUE if OK, GL_FALSE if any indexed vertex goes is out of bounds + */ static GLboolean check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex) @@ -150,14 +156,15 @@ check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, if ((int)(min + basevertex) < 0 || max + basevertex > ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ - _mesa_warning(ctx, "glDrawElements() index=%u is " - "out of bounds (max=%u)", max, ctx->Array.ArrayObj->_MaxElement); + _mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)", + max, ctx->Array.ArrayObj->_MaxElement); return GL_FALSE; } return GL_TRUE; } + /** * Error checking for glDrawElements(). Includes parameter checking * and VBO bounds checking. -- cgit v1.2.3 From b5b128b26841e7f947edd8f0cbcc91a530d6bb8f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 12:38:05 -0700 Subject: softpipe: implement PIPE_TEX_WRAP_CLAMP_TO_EDGE for unorm texture sampling CLAMP_TO_BORDER and CLAMP_TO_EDGE were doing the same thing. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 49 ++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c b/src/gallium/drivers/softpipe/sp_tex_sample.c index b3a79732b4..ef7ccf4189 100644 --- a/src/gallium/drivers/softpipe/sp_tex_sample.c +++ b/src/gallium/drivers/softpipe/sp_tex_sample.c @@ -437,8 +437,7 @@ wrap_linear_mirror_clamp_to_border(const float s[4], unsigned size, /** - * For RECT textures / unnormalized texcoords - * Only a subset of wrap modes supported. + * PIPE_TEX_WRAP_CLAMP for nearest sampling, unnormalized coords. */ static void wrap_nearest_unorm_clamp(const float s[4], unsigned size, int icoord[4]) @@ -452,11 +451,25 @@ wrap_nearest_unorm_clamp(const float s[4], unsigned size, int icoord[4]) /** - * Handles clamp_to_edge and clamp_to_border: + * PIPE_TEX_WRAP_CLAMP_TO_BORDER for nearest sampling, unnormalized coords. */ static void wrap_nearest_unorm_clamp_to_border(const float s[4], unsigned size, int icoord[4]) +{ + uint ch; + for (ch = 0; ch < 4; ch++) { + icoord[ch]= util_ifloor( CLAMP(s[ch], -0.5F, (float) size + 0.5F) ); + } +} + + +/** + * PIPE_TEX_WRAP_CLAMP_TO_EDGE for nearest sampling, unnormalized coords. + */ +static void +wrap_nearest_unorm_clamp_to_edge(const float s[4], unsigned size, + int icoord[4]) { uint ch; for (ch = 0; ch < 4; ch++) { @@ -466,8 +479,7 @@ wrap_nearest_unorm_clamp_to_border(const float s[4], unsigned size, /** - * For RECT textures / unnormalized texcoords. - * Only a subset of wrap modes supported. + * PIPE_TEX_WRAP_CLAMP for linear sampling, unnormalized coords. */ static void wrap_linear_unorm_clamp(const float s[4], unsigned size, @@ -484,13 +496,36 @@ wrap_linear_unorm_clamp(const float s[4], unsigned size, } +/** + * PIPE_TEX_WRAP_CLAMP_TO_BORDER for linear sampling, unnormalized coords. + */ static void wrap_linear_unorm_clamp_to_border(const float s[4], unsigned size, int icoord0[4], int icoord1[4], float w[4]) { uint ch; for (ch = 0; ch < 4; ch++) { - float u = CLAMP(s[ch], 0.5F, (float) size - 0.5F); + float u = CLAMP(s[ch], -0.5F, (float) size + 0.5F); + u -= 0.5F; + icoord0[ch] = util_ifloor(u); + icoord1[ch] = icoord0[ch] + 1; + if (icoord1[ch] > (int) size - 1) + icoord1[ch] = size - 1; + w[ch] = frac(u); + } +} + + +/** + * PIPE_TEX_WRAP_CLAMP_TO_EDGE for linear sampling, unnormalized coords. + */ +static void +wrap_linear_unorm_clamp_to_edge(const float s[4], unsigned size, + int icoord0[4], int icoord1[4], float w[4]) +{ + uint ch; + for (ch = 0; ch < 4; ch++) { + float u = CLAMP(s[ch], +0.5F, (float) size - 0.5F); u -= 0.5F; icoord0[ch] = util_ifloor(u); icoord1[ch] = icoord0[ch] + 1; @@ -1707,6 +1742,7 @@ get_nearest_unorm_wrap(unsigned mode) case PIPE_TEX_WRAP_CLAMP: return wrap_nearest_unorm_clamp; case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + return wrap_nearest_unorm_clamp_to_edge; case PIPE_TEX_WRAP_CLAMP_TO_BORDER: return wrap_nearest_unorm_clamp_to_border; default: @@ -1750,6 +1786,7 @@ get_linear_unorm_wrap(unsigned mode) case PIPE_TEX_WRAP_CLAMP: return wrap_linear_unorm_clamp; case PIPE_TEX_WRAP_CLAMP_TO_EDGE: + return wrap_linear_unorm_clamp_to_edge; case PIPE_TEX_WRAP_CLAMP_TO_BORDER: return wrap_linear_unorm_clamp_to_border; default: -- cgit v1.2.3 From d660e28c9cc52e55963532939ef383eac983a44b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 13:21:56 -0700 Subject: gallivm: implement non-normalized texture wrap modes Note that only the PIPE_TEX_WRAP_CLAMP,CLAMP_TO_EDGE,CLAMP_TO_BORDER modes work with non-normalized texcoords. --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 107 ++++++++++++++-------- 1 file changed, 68 insertions(+), 39 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index fe41d5ee49..50dd1a57c9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -361,15 +361,10 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, LLVMValueRef two = lp_build_const_scalar(coord_bld->type, 2.0); LLVMValueRef half = lp_build_const_scalar(coord_bld->type, 0.5); LLVMValueRef length_f = lp_build_int_to_float(coord_bld, length); - LLVMValueRef length_minus_one; - LLVMValueRef length_f_minus_one; + LLVMValueRef length_minus_one = lp_build_sub(uint_coord_bld, length, uint_coord_bld->one); + LLVMValueRef length_f_minus_one = lp_build_sub(coord_bld, length_f, coord_bld->one); LLVMValueRef coord0, coord1, weight; - /* XXX check for normalized vs. unnormalized coords */ - - length_minus_one = lp_build_sub(uint_coord_bld, length, uint_coord_bld->one); - length_f_minus_one = lp_build_sub(coord_bld, length_f, coord_bld->one); - switch(wrap_mode) { case PIPE_TEX_WRAP_REPEAT: /* mul by size and subtract 0.5 */ @@ -394,7 +389,9 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, break; case PIPE_TEX_WRAP_CLAMP: - coord = lp_build_mul(coord_bld, coord, length_f); + if (bld->static_state->normalized_coords) { + coord = lp_build_mul(coord_bld, coord, length_f); + } weight = lp_build_fract(coord_bld, coord); coord0 = lp_build_clamp(coord_bld, coord, coord_bld->zero, length_f_minus_one); @@ -406,11 +403,20 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, break; case PIPE_TEX_WRAP_CLAMP_TO_EDGE: - /* clamp to [0,1] */ - coord = lp_build_clamp(coord_bld, coord, coord_bld->zero, coord_bld->one); - /* mul by tex size and subtract 0.5 */ - coord = lp_build_mul(coord_bld, coord, length_f); - coord = lp_build_sub(coord_bld, coord, half); + if (bld->static_state->normalized_coords) { + /* clamp to [0,1] */ + coord = lp_build_clamp(coord_bld, coord, coord_bld->zero, coord_bld->one); + /* mul by tex size and subtract 0.5 */ + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); + } + else { + LLVMValueRef min, max; + /* clamp to [0.5, length - 0.5] */ + min = lp_build_const_scalar(coord_bld->type, 0.5F); + max = lp_build_sub(coord_bld, length_f, min); + coord = lp_build_clamp(coord_bld, coord, min, max); + } /* compute lerp weight */ weight = lp_build_fract(coord_bld, coord); /* coord0 = floor(coord); */ @@ -425,16 +431,25 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, case PIPE_TEX_WRAP_CLAMP_TO_BORDER: { LLVMValueRef min, max; - /* min = -1.0 / (2 * length) */ - min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); - min = lp_build_negate(coord_bld, min); - /* max = 1.0 - min */ - max = lp_build_sub(coord_bld, coord_bld->one, min); - /* coord = clamp(coord, min, max) */ - coord = lp_build_clamp(coord_bld, coord, min, max); - /* scale coord to length (and sub 0.5?) */ - coord = lp_build_mul(coord_bld, coord, length_f); - coord = lp_build_sub(coord_bld, coord, half); + if (bld->static_state->normalized_coords) { + /* min = -1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + min = lp_build_negate(coord_bld, min); + /* max = 1.0 - min */ + max = lp_build_sub(coord_bld, coord_bld->one, min); + /* coord = clamp(coord, min, max) */ + coord = lp_build_clamp(coord_bld, coord, min, max); + /* scale coord to length (and sub 0.5?) */ + coord = lp_build_mul(coord_bld, coord, length_f); + coord = lp_build_sub(coord_bld, coord, half); + } + else { + /* clamp to [-0.5, length + 0.5] */ + min = lp_build_const_scalar(coord_bld->type, -0.5F); + max = lp_build_sub(coord_bld, length_f, min); + coord = lp_build_clamp(coord_bld, coord, min, max); + coord = lp_build_sub(coord_bld, coord, half); + } /* compute lerp weight */ weight = lp_build_fract(coord_bld, coord); /* convert to int */ @@ -552,8 +567,6 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, LLVMValueRef length_f_minus_one = lp_build_sub(coord_bld, length_f, coord_bld->one); LLVMValueRef icoord; - /* XXX check for normalized vs. unnormalized coords */ - switch(wrap_mode) { case PIPE_TEX_WRAP_REPEAT: coord = lp_build_mul(coord_bld, coord, length_f); @@ -568,7 +581,9 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, case PIPE_TEX_WRAP_CLAMP: /* mul by size */ - coord = lp_build_mul(coord_bld, coord, length_f); + if (bld->static_state->normalized_coords) { + coord = lp_build_mul(coord_bld, coord, length_f); + } /* floor */ icoord = lp_build_ifloor(coord_bld, coord); /* clamp to [0, size-1]. Note: int coord builder type */ @@ -579,12 +594,19 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, case PIPE_TEX_WRAP_CLAMP_TO_EDGE: { LLVMValueRef min, max; - /* min = 1.0 / (2 * length) */ - min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); - /* max = length - min */ - max = lp_build_sub(coord_bld, length_f, min); - /* scale coord to length */ - coord = lp_build_mul(coord_bld, coord, length_f); + if (bld->static_state->normalized_coords) { + /* min = 1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + /* scale coord to length */ + coord = lp_build_mul(coord_bld, coord, length_f); + } + else { + /* clamp to [0.5, length - 0.5] */ + min = lp_build_const_scalar(coord_bld->type, 0.5F); + max = lp_build_sub(coord_bld, length_f, min); + } /* coord = clamp(coord, min, max) */ coord = lp_build_clamp(coord_bld, coord, min, max); icoord = lp_build_ifloor(coord_bld, coord); @@ -595,13 +617,20 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, /* Note: this is the same as CLAMP_TO_EDGE, except min = -min */ { LLVMValueRef min, max; - /* min = -1.0 / (2 * length) */ - min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); - min = lp_build_negate(coord_bld, min); - /* max = length - min */ - max = lp_build_sub(coord_bld, length_f, min); - /* scale coord to length */ - coord = lp_build_mul(coord_bld, coord, length_f); + if (bld->static_state->normalized_coords) { + /* min = -1.0 / (2 * length) */ + min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); + min = lp_build_negate(coord_bld, min); + /* max = length - min */ + max = lp_build_sub(coord_bld, length_f, min); + /* scale coord to length */ + coord = lp_build_mul(coord_bld, coord, length_f); + } + else { + /* clamp to [-0.5, length + 0.5] */ + min = lp_build_const_scalar(coord_bld->type, -0.5F); + max = lp_build_sub(coord_bld, length_f, min); + } /* coord = clamp(coord, min, max) */ coord = lp_build_clamp(coord_bld, coord, min, max); icoord = lp_build_ifloor(coord_bld, coord); -- cgit v1.2.3 From 88e2eae271fc76f82f3c732e32d3faa3184353ff Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 13:27:51 -0700 Subject: gallivm: minor arithmetic improvements --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 50dd1a57c9..2b04becc8c 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -432,9 +432,10 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, { LLVMValueRef min, max; if (bld->static_state->normalized_coords) { - /* min = -1.0 / (2 * length) */ - min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); - min = lp_build_negate(coord_bld, min); + /* min = -1.0 / (2 * length) = -0.5 / length */ + min = lp_build_mul(coord_bld, + lp_build_const_scalar(coord_bld->type, -0.5F), + lp_build_rcp(coord_bld, length_f)); /* max = 1.0 - min */ max = lp_build_sub(coord_bld, coord_bld->one, min); /* coord = clamp(coord, min, max) */ @@ -518,9 +519,10 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, case PIPE_TEX_WRAP_MIRROR_CLAMP_TO_BORDER: { LLVMValueRef min, max; - /* min = -1.0 / (2 * length) */ - min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); - min = lp_build_negate(coord_bld, min); + /* min = -1.0 / (2 * length) = -0.5 / length */ + min = lp_build_mul(coord_bld, + lp_build_const_scalar(coord_bld->type, -0.5F), + lp_build_rcp(coord_bld, length_f)); /* max = 1.0 - min */ max = lp_build_sub(coord_bld, coord_bld->one, min); @@ -618,9 +620,10 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, { LLVMValueRef min, max; if (bld->static_state->normalized_coords) { - /* min = -1.0 / (2 * length) */ - min = lp_build_rcp(coord_bld, lp_build_mul(coord_bld, two, length_f)); - min = lp_build_negate(coord_bld, min); + /* min = -1.0 / (2 * length) = -0.5 / length */ + min = lp_build_mul(coord_bld, + lp_build_const_scalar(coord_bld->type, -0.5F), + lp_build_rcp(coord_bld, length_f)); /* max = length - min */ max = lp_build_sub(coord_bld, length_f, min); /* scale coord to length */ -- cgit v1.2.3 From 76e87786ab946b54adf7565555b0c671aa78d6bd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 13:30:24 -0700 Subject: gallium/docs: document additional wrap mode restrictions --- src/gallium/docs/source/cso/sampler.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gallium/docs/source/cso/sampler.rst b/src/gallium/docs/source/cso/sampler.rst index 44698d1250..9bbb784de8 100644 --- a/src/gallium/docs/source/cso/sampler.rst +++ b/src/gallium/docs/source/cso/sampler.rst @@ -85,6 +85,9 @@ normalized_coords will be scaled by the texture width, height, depth to compute texel addresses. Otherwise, the texture coords are used as-is (they are not scaled by the texture dimensions). + When normalized_coords=0, only a subset of the texture wrap modes are + allowed: PIPE_TEX_WRAP_CLAMP, PIPE_TEX_WRAP_CLAMP_TO_EDGE and + PIPE_TEX_WRAP_CLAMP_TO_BORDER. lod_bias Bias factor which is added to the computed level of detail. The normal level of detail is computed from the partial derivatives of -- cgit v1.2.3 From b704a4e8f332e7f9a38c21ce074cd244cf2fe89e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 14:24:02 -0700 Subject: llvmpipe: add pipe_thread_wait() calls Wait for threads to exit before cleaning up per-thread data. Fixes hang on context destruction with glean makeCurrent test. See fd.o bug 26536. --- src/gallium/drivers/llvmpipe/lp_rast.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 0f83eea685..dd9a8e8856 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -846,6 +846,12 @@ void lp_rast_destroy( struct lp_rasterizer *rast ) pipe_semaphore_signal(&rast->tasks[i].work_ready); } + /* Wait for threads to terminate before cleaning up per-thread data */ + for (i = 0; i < rast->num_threads; i++) { + pipe_thread_wait(rast->threads[i]); + } + + /* Clean up per-thread data */ for (i = 0; i < rast->num_threads; i++) { pipe_semaphore_destroy(&rast->tasks[i].work_ready); pipe_semaphore_destroy(&rast->tasks[i].work_done); -- cgit v1.2.3 From 24f90112761d108a4a131fad11bd7b426d8edfa0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 5 Mar 2010 23:10:45 +0000 Subject: Always return VOLATILE for ObjectPurgeable(VOLATILE) Fixes fdo bug 26128. The spec mandates that VOLATILE is returned from ObjectPurgeable(VOLATILE) irrespective of the actual status of the object upon completion of marking it purgeable. Conform to the spec, even though it seems wrong. Signed-off-by: Chris Wilson --- src/mesa/main/bufferobj.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index c532cbef11..71d1514fe4 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1809,6 +1809,8 @@ _mesa_TextureObjectPurgeable(GLcontext *ctx, GLuint name, GLenum option) GLenum GLAPIENTRY _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) { + GLenum retval; + GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); @@ -1832,17 +1834,27 @@ _mesa_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option) switch (objectType) { case GL_TEXTURE: - return _mesa_TextureObjectPurgeable (ctx, name, option); + retval = _mesa_TextureObjectPurgeable (ctx, name, option); + break; case GL_RENDERBUFFER_EXT: - return _mesa_RenderObjectPurgeable (ctx, name, option); + retval = _mesa_RenderObjectPurgeable (ctx, name, option); + break; case GL_BUFFER_OBJECT_APPLE: - return _mesa_BufferObjectPurgeable (ctx, name, option); + retval = _mesa_BufferObjectPurgeable (ctx, name, option); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glObjectPurgeable(name = 0x%x) invalid type: %d", name, objectType); return 0; } + + /* In strict conformance to the spec, we must only return VOLATILE when + * when passed the VOLATILE option. Madness. + * + * XXX First fix the spec, then fix me. + */ + return option == GL_VOLATILE_APPLE ? GL_VOLATILE_APPLE : retval; } @@ -1902,7 +1914,7 @@ _mesa_RenderObjectUnpurgeable(GLcontext *ctx, GLuint name, GLenum option) if (ctx->Driver.RenderObjectUnpurgeable) retval = ctx->Driver.RenderObjectUnpurgeable(ctx, bufObj, option); - return retval; + return option; } -- cgit v1.2.3 From 3b9612645e537c3d293b09f27ef199a3eb52d840 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 4 Mar 2010 18:26:33 -0800 Subject: i965: Fix the SNB SF input size. --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 08e6753a91..18fab61556 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -48,7 +48,7 @@ upload_sf_state(struct brw_context *brw) dw1 = num_outputs << GEN6_SF_NUM_OUTPUTS_SHIFT | - num_inputs << GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT | + (num_inputs + 1) / 2 << GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT | 3 << GEN6_SF_URB_ENTRY_READ_OFFSET_SHIFT; dw2 = GEN6_SF_VIEWPORT_TRANSFORM_ENABLE | GEN6_SF_STATISTICS_ENABLE; -- cgit v1.2.3 From f6f5e8767926932dc276015ce84b74a0d01ade65 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 12:27:25 -0800 Subject: i965: Try to assign SNB SF inputs to outputs. --- src/mesa/drivers/dri/i965/gen6_sf_state.c | 43 +++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_sf_state.c b/src/mesa/drivers/dri/i965/gen6_sf_state.c index 18fab61556..8d96b44f1d 100644 --- a/src/mesa/drivers/dri/i965/gen6_sf_state.c +++ b/src/mesa/drivers/dri/i965/gen6_sf_state.c @@ -32,6 +32,25 @@ #include "main/macros.h" #include "intel_batchbuffer.h" +static uint32_t +get_attr_override(struct brw_context *brw, int attr) +{ + uint32_t attr_override; + int attr_index = 0, i; + + /* Find the source index (0 = first attribute after the 4D position) + * for this output attribute. attr is currently a VERT_RESULT_* but should + * be FRAG_ATTRIB_*. + */ + for (i = 0; i < attr; i++) { + if (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(i)) + attr_index++; + } + attr_override = attr_index; + + return attr_index; +} + static void upload_sf_state(struct brw_context *brw) { @@ -45,6 +64,7 @@ upload_sf_state(struct brw_context *brw) int i; /* _NEW_BUFFER */ GLboolean render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; + int attr = 0; dw1 = num_outputs << GEN6_SF_NUM_OUTPUTS_SHIFT | @@ -122,8 +142,27 @@ upload_sf_state(struct brw_context *brw) OUT_BATCH_F(ctx->Polygon.OffsetFactor); /* scale */ OUT_BATCH_F(0.0); /* XXX: global depth offset clamp */ for (i = 0; i < 8; i++) { - /* attribute overrides */ - OUT_BATCH(0); + uint32_t attr_overrides = 0; + + /* These should be generating FS inputs read instead of VS + * outputs written + */ + for (; attr < 64; attr++) { + if (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(attr)) { + attr_overrides |= get_attr_override(brw, attr); + attr++; + break; + } + } + + for (; attr < 64; attr++) { + if (brw->vs.prog_data->outputs_written & BITFIELD64_BIT(attr)) { + attr_overrides |= get_attr_override(brw, attr) << 16; + attr++; + break; + } + } + OUT_BATCH(attr_overrides); } OUT_BATCH(0); /* point sprite texcoord bitmask */ OUT_BATCH(0); /* constant interp bitmask */ -- cgit v1.2.3 From 8a9d8bd52af4414e59320c68238b8929edf3ff80 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 12:27:46 -0800 Subject: intel: Check that the batch is mapped per BEGIN, not each OUT. Shaves 800 bytes off the driver. --- src/mesa/drivers/dri/intel/intel_batchbuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 79bdbc17ae..860aa1327a 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -86,7 +86,6 @@ intel_batchbuffer_space(struct intel_batchbuffer *batch) static INLINE void intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword) { - assert(batch->map); assert(intel_batchbuffer_space(batch) >= 4); *(GLuint *) (batch->ptr) = dword; batch->ptr += 4; @@ -118,6 +117,7 @@ static INLINE uint32_t float_as_int(float f) #define BEGIN_BATCH(n) do { \ intel_batchbuffer_require_space(intel->batch, (n)*4); \ + assert(intel->batch->map); \ assert(intel->batch->emit.start_ptr == NULL); \ intel->batch->emit.total = (n) * 4; \ intel->batch->emit.start_ptr = intel->batch->ptr; \ -- cgit v1.2.3 From 342a7f23bf76e21b049cba9ab97bf4aa640a5bfd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 12:40:45 -0800 Subject: intel: Move the assertions about reloc delta from the macros to the function. Cuts another 1800 bytes from the driver. --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 4 ++++ src/mesa/drivers/dri/intel/intel_batchbuffer.h | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index a7bfd62b28..9768b0deee 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -210,6 +210,8 @@ intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, { int ret; + assert(delta < buffer->size); + if (batch->ptr - batch->map > batch->buf->size) printf ("bad relocation ptr %p map %p offset %d size %lu\n", batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); @@ -234,6 +236,8 @@ intel_batchbuffer_emit_reloc_fenced(struct intel_batchbuffer *batch, { int ret; + assert(delta < buffer->size); + if (batch->ptr - batch->map > batch->buf->size) printf ("bad relocation ptr %p map %p offset %d size %lu\n", batch->ptr, batch->map, batch->ptr - batch->map, batch->buf->size); diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 860aa1327a..b7625b5b0d 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -128,12 +128,10 @@ static INLINE uint32_t float_as_int(float f) float_as_int(f)) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ - assert((unsigned) (delta) < buf->size); \ intel_batchbuffer_emit_reloc(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0) #define OUT_RELOC_FENCED(buf, read_domains, write_domain, delta) do { \ - assert((unsigned) (delta) < buf->size); \ intel_batchbuffer_emit_reloc_fenced(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0) -- cgit v1.2.3 From 7392002041f6c7ac6eb788d7b154f2b44eb6f403 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 12:47:21 -0800 Subject: intel: Replace batch macro contents with function calls. This manages to cut down another 3800 bytes. --- src/mesa/drivers/dri/intel/intel_batchbuffer.h | 67 +++++++++++++++----------- 1 file changed, 39 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index b7625b5b0d..5e0ea916b4 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -71,6 +71,17 @@ GLboolean intel_batchbuffer_emit_reloc_fenced(struct intel_batchbuffer *batch, uint32_t offset); void intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch); +static INLINE uint32_t float_as_int(float f) +{ + union { + float f; + uint32_t d; + } fi; + + fi.f = f; + return fi.d; +} + /* Inline functions - might actually be better off with these * non-inlined. Certainly better off switching all command packets to * be passed as structs rather than dwords, but that's a little bit of @@ -91,6 +102,12 @@ intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword) batch->ptr += 4; } +static INLINE void +intel_batchbuffer_emit_float(struct intel_batchbuffer *batch, float f) +{ + intel_batchbuffer_emit_dword(batch, float_as_int(f)); +} + static INLINE void intel_batchbuffer_require_space(struct intel_batchbuffer *batch, GLuint sz) @@ -100,33 +117,36 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, intel_batchbuffer_flush(batch); } -static INLINE uint32_t float_as_int(float f) +static INLINE void +intel_batchbuffer_begin(struct intel_batchbuffer *batch, int n) { - union { - float f; - uint32_t d; - } fi; + intel_batchbuffer_require_space(batch, n * 4); + assert(batch->map); + assert(batch->emit.start_ptr == NULL); + batch->emit.total = n * 4; + batch->emit.start_ptr = batch->ptr; +} - fi.f = f; - return fi.d; +static INLINE void +intel_batchbuffer_advance(struct intel_batchbuffer *batch) +{ + unsigned int _n = batch->ptr - batch->emit.start_ptr; + assert(batch->emit.start_ptr != NULL); + if (_n != batch->emit.total) { + fprintf(stderr, "ADVANCE_BATCH: %d of %d dwords emitted\n", + _n, batch->emit.total); + abort(); + } + batch->emit.start_ptr = NULL; } /* Here are the crusty old macros, to be removed: */ #define BATCH_LOCALS -#define BEGIN_BATCH(n) do { \ - intel_batchbuffer_require_space(intel->batch, (n)*4); \ - assert(intel->batch->map); \ - assert(intel->batch->emit.start_ptr == NULL); \ - intel->batch->emit.total = (n) * 4; \ - intel->batch->emit.start_ptr = intel->batch->ptr; \ -} while (0) - +#define BEGIN_BATCH(n) intel_batchbuffer_begin(intel->batch, n) #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) -#define OUT_BATCH_F(f) intel_batchbuffer_emit_dword(intel->batch, \ - float_as_int(f)) - +#define OUT_BATCH_F(f) intel_batchbuffer_emit_float(intel->batch,f) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ intel_batchbuffer_emit_reloc(intel->batch, buf, \ read_domains, write_domain, delta); \ @@ -136,15 +156,6 @@ static INLINE uint32_t float_as_int(float f) read_domains, write_domain, delta); \ } while (0) -#define ADVANCE_BATCH() do { \ - unsigned int _n = intel->batch->ptr - intel->batch->emit.start_ptr; \ - assert(intel->batch->emit.start_ptr != NULL); \ - if (_n != intel->batch->emit.total) { \ - fprintf(stderr, "ADVANCE_BATCH: %d of %d dwords emitted\n", \ - _n, intel->batch->emit.total); \ - abort(); \ - } \ - intel->batch->emit.start_ptr = NULL; \ -} while(0) +#define ADVANCE_BATCH() intel_batchbuffer_advance(intel->batch); #endif -- cgit v1.2.3 From 855515859ec1d94737ea91167220ba7b568c144d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 12:56:40 -0800 Subject: intel: Only do batchbuffer debug if --enable-debug is used. This saves 6.6KB on the 965 driver, and appears to speed firefox-talos-gfx up by 1-2%. Unlike many other asserts in the driver, when we make a mistake that would trigger one of these it generally shows up all the time for developers, so turning it off for release seems fine. --- src/mesa/drivers/dri/intel/intel_batchbuffer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 5e0ea916b4..e5ad2617ab 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -24,11 +24,13 @@ struct intel_batchbuffer GLuint size; +#ifdef DEBUG /** Tracking of BEGIN_BATCH()/OUT_BATCH()/ADVANCE_BATCH() debugging */ struct { GLuint total; GLubyte *start_ptr; } emit; +#endif GLuint dirty_state; GLuint reserved_space; @@ -97,7 +99,9 @@ intel_batchbuffer_space(struct intel_batchbuffer *batch) static INLINE void intel_batchbuffer_emit_dword(struct intel_batchbuffer *batch, GLuint dword) { +#ifdef DEBUG assert(intel_batchbuffer_space(batch) >= 4); +#endif *(GLuint *) (batch->ptr) = dword; batch->ptr += 4; } @@ -112,7 +116,9 @@ static INLINE void intel_batchbuffer_require_space(struct intel_batchbuffer *batch, GLuint sz) { +#ifdef DEBUG assert(sz < batch->size - 8); +#endif if (intel_batchbuffer_space(batch) < sz) intel_batchbuffer_flush(batch); } @@ -121,15 +127,18 @@ static INLINE void intel_batchbuffer_begin(struct intel_batchbuffer *batch, int n) { intel_batchbuffer_require_space(batch, n * 4); +#ifdef DEBUG assert(batch->map); assert(batch->emit.start_ptr == NULL); batch->emit.total = n * 4; batch->emit.start_ptr = batch->ptr; +#endif } static INLINE void intel_batchbuffer_advance(struct intel_batchbuffer *batch) { +#ifdef DEBUG unsigned int _n = batch->ptr - batch->emit.start_ptr; assert(batch->emit.start_ptr != NULL); if (_n != batch->emit.total) { @@ -138,6 +147,7 @@ intel_batchbuffer_advance(struct intel_batchbuffer *batch) abort(); } batch->emit.start_ptr = NULL; +#endif } /* Here are the crusty old macros, to be removed: -- cgit v1.2.3 From 5d18e86971bdcf0a4dff3cb62581d7ae54c5e67a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 13:18:13 -0800 Subject: i965: Pack gen6 blend_state_key structure. --- src/mesa/drivers/dri/i965/gen6_cc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index 42b41f3210..6418fc6d81 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -34,6 +34,7 @@ struct brw_blend_state_key { GLboolean color_blend, alpha_enabled; + GLboolean dither; GLenum logic_op; @@ -42,8 +43,6 @@ struct brw_blend_state_key { GLenum blend_dst_rgb, blend_dst_a; GLenum alpha_func; - - GLboolean dither; }; static void -- cgit v1.2.3 From 879ea6f27972766c792fe78971a36c5c7b9f1884 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 13:19:09 -0800 Subject: i965: Rename SNB brw_*_key structs to gen6_*_key structs. --- src/mesa/drivers/dri/i965/gen6_cc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c index 6418fc6d81..f7acad6912 100644 --- a/src/mesa/drivers/dri/i965/gen6_cc.c +++ b/src/mesa/drivers/dri/i965/gen6_cc.c @@ -32,7 +32,7 @@ #include "intel_batchbuffer.h" #include "main/macros.h" -struct brw_blend_state_key { +struct gen6_blend_state_key { GLboolean color_blend, alpha_enabled; GLboolean dither; @@ -47,7 +47,7 @@ struct brw_blend_state_key { static void blend_state_populate_key(struct brw_context *brw, - struct brw_blend_state_key *key) + struct gen6_blend_state_key *key) { GLcontext *ctx = &brw->intel.ctx; @@ -85,7 +85,7 @@ blend_state_populate_key(struct brw_context *brw, */ static drm_intel_bo * blend_state_create_from_key(struct brw_context *brw, - struct brw_blend_state_key *key) + struct gen6_blend_state_key *key) { struct gen6_blend_state blend; drm_intel_bo *bo; @@ -148,7 +148,7 @@ blend_state_create_from_key(struct brw_context *brw, static void prepare_blend_state(struct brw_context *brw) { - struct brw_blend_state_key key; + struct gen6_blend_state_key key; blend_state_populate_key(brw, &key); @@ -171,7 +171,7 @@ const struct brw_tracked_state gen6_blend_state = { .prepare = prepare_blend_state, }; -struct brw_color_calc_state_key { +struct gen6_color_calc_state_key { GLubyte blend_constant_color[4]; GLclampf alpha_ref; GLubyte stencil_ref[2]; @@ -179,7 +179,7 @@ struct brw_color_calc_state_key { static void color_calc_state_populate_key(struct brw_context *brw, - struct brw_color_calc_state_key *key) + struct gen6_color_calc_state_key *key) { GLcontext *ctx = &brw->intel.ctx; @@ -209,7 +209,7 @@ color_calc_state_populate_key(struct brw_context *brw, */ static drm_intel_bo * color_calc_state_create_from_key(struct brw_context *brw, - struct brw_color_calc_state_key *key) + struct gen6_color_calc_state_key *key) { struct gen6_color_calc_state cc; drm_intel_bo *bo; @@ -238,7 +238,7 @@ color_calc_state_create_from_key(struct brw_context *brw, static void prepare_color_calc_state(struct brw_context *brw) { - struct brw_color_calc_state_key key; + struct gen6_color_calc_state_key key; color_calc_state_populate_key(brw, &key); -- cgit v1.2.3 From 9a38f76044761f9555bf84ebbc520c015ec88d78 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 13:24:24 -0800 Subject: i965: Remove the unused SDC BO pointer from the sampler state key. Since it's a BO pointer, it already lives outside the key in brw->wm.sdc_bo[] which is used for sampler state lookup and setup. --- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index c232cd2791..3a33996452 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -89,7 +89,6 @@ struct wm_sampler_key { float max_aniso; GLenum minfilter, magfilter; GLenum comparemode, comparefunc; - dri_bo *sdc_bo; /** If target is cubemap, take context setting. */ -- cgit v1.2.3 From 20952f0378247f69849b6e37a7374bc9c94437a0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 13:38:02 -0800 Subject: i965: Remove the paths for making a const surface object for a NULL BO. --- src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 4 ++-- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 29 +++++++++--------------- 2 files changed, 13 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 950d075aa1..4007b5a15c 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -104,7 +104,7 @@ brw_update_vs_constant_surface( GLcontext *ctx, /* If there's no constant buffer, then no surface BO is needed to point at * it. */ - if (vp->const_buffer == 0) { + if (vp->const_buffer == NULL) { drm_intel_bo_unreference(brw->vs.surf_bo[surf]); brw->vs.surf_bo[surf] = NULL; return; @@ -132,7 +132,7 @@ brw_update_vs_constant_surface( GLcontext *ctx, brw->vs.surf_bo[surf] = brw_search_cache(&brw->surface_cache, BRW_SS_SURFACE, &key, sizeof(key), - &key.bo, key.bo ? 1 : 0, + &key.bo, 1, NULL); if (brw->vs.surf_bo[surf] == NULL) { brw->vs.surf_bo[surf] = brw_create_constant_surface(brw, &key); diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index a42067611c..b1ab79b783 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -336,10 +336,7 @@ brw_create_constant_surface( struct brw_context *brw, surf.ss0.surface_format = BRW_SURFACEFORMAT_R32G32B32A32_FLOAT; assert(key->bo); - if (key->bo) - surf.ss1.base_addr = key->bo->offset; /* reloc */ - else - surf.ss1.base_addr = key->offset; + surf.ss1.base_addr = key->bo->offset; /* reloc */ surf.ss2.width = w & 0x7f; /* bits 6:0 of size or width */ surf.ss2.height = (w >> 7) & 0x1fff; /* bits 19:7 of size or width */ @@ -349,20 +346,16 @@ brw_create_constant_surface( struct brw_context *brw, bo = brw_upload_cache(&brw->surface_cache, BRW_SS_SURFACE, key, sizeof(*key), - &key->bo, key->bo ? 1 : 0, + &key->bo, 1, &surf, sizeof(surf)); - if (key->bo) { - /* Emit relocation to surface contents. Section 5.1.1 of the gen4 - * bspec ("Data Cache") says that the data cache does not exist as - * a separate cache and is just the sampler cache. - */ - dri_bo_emit_reloc(bo, - I915_GEM_DOMAIN_SAMPLER, 0, - 0, - offsetof(struct brw_surface_state, ss1), - key->bo); - } + /* Emit relocation to surface contents. Section 5.1.1 of the gen4 + * bspec ("Data Cache") says that the data cache does not exist as + * a separate cache and is just the sampler cache. + */ + drm_intel_bo_emit_reloc(bo, offsetof(struct brw_surface_state, ss1), + key->bo, 0, + I915_GEM_DOMAIN_SAMPLER, 0); return bo; } @@ -420,7 +413,7 @@ brw_update_wm_constant_surface( GLcontext *ctx, /* If there's no constant buffer, then no surface BO is needed to point at * it. */ - if (fp->const_buffer == 0) { + if (fp->const_buffer == NULL) { drm_intel_bo_unreference(brw->wm.surf_bo[surf]); brw->wm.surf_bo[surf] = NULL; return; @@ -448,7 +441,7 @@ brw_update_wm_constant_surface( GLcontext *ctx, brw->wm.surf_bo[surf] = brw_search_cache(&brw->surface_cache, BRW_SS_SURFACE, &key, sizeof(key), - &key.bo, key.bo ? 1 : 0, + &key.bo, 1, NULL); if (brw->wm.surf_bo[surf] == NULL) { brw->wm.surf_bo[surf] = brw_create_constant_surface(brw, &key); -- cgit v1.2.3 From a232cc59e3f8ac8462c23b1a83e0ba60b451e681 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 13:48:41 -0800 Subject: intel: Remove support for the DRI1 TFP extension. --- src/mesa/drivers/dri/i915/i830_texstate.c | 49 ++++++------------ src/mesa/drivers/dri/i915/i915_texstate.c | 36 +++----------- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 63 +++++++----------------- src/mesa/drivers/dri/intel/intel_screen.c | 6 --- src/mesa/drivers/dri/intel/intel_tex.h | 2 - src/mesa/drivers/dri/intel/intel_tex_image.c | 23 --------- src/mesa/drivers/dri/intel/intel_tex_obj.h | 4 -- 7 files changed, 39 insertions(+), 144 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 7525f9f2e0..e8f7e378ec 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -122,6 +122,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) GLuint *state = i830->state.Tex[unit], format, pitch; GLint lodbias; GLubyte border[4]; + GLuint dst_x, dst_y; memset(state, 0, sizeof(state)); @@ -132,7 +133,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) i830->state.tex_buffer[unit] = NULL; } - if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit)) + if (!intel_finalize_mipmap_tree(intel, unit)) return GL_FALSE; /* Get first image here, since intelObj->firstLevel will get set in @@ -140,42 +141,20 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) */ firstImage = tObj->Image[0][intelObj->firstLevel]; - if (intelObj->imageOverride) { - i830->state.tex_buffer[unit] = NULL; - i830->state.tex_offset[unit] = intelObj->textureOffset; + intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0, + &dst_x, &dst_y); - switch (intelObj->depthOverride) { - case 32: - format = MAPSURF_32BIT | MT_32BIT_ARGB8888; - break; - case 24: - default: - format = MAPSURF_32BIT | MT_32BIT_XRGB8888; - break; - case 16: - format = MAPSURF_16BIT | MT_16BIT_RGB565; - break; - } - - pitch = intelObj->pitchOverride; - } else { - GLuint dst_x, dst_y; - - intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0, - &dst_x, &dst_y); - - dri_bo_reference(intelObj->mt->region->buffer); - i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; - /* XXX: This calculation is probably broken for tiled images with - * a non-page-aligned offset. - */ - i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) * - intelObj->mt->cpp; + dri_bo_reference(intelObj->mt->region->buffer); + i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; + /* XXX: This calculation is probably broken for tiled images with + * a non-page-aligned offset. + */ + i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) * + intelObj->mt->cpp; - format = translate_texture_format(firstImage->TexFormat, - firstImage->InternalFormat); - pitch = intelObj->mt->pitch * intelObj->mt->cpp; - } + format = translate_texture_format(firstImage->TexFormat, + firstImage->InternalFormat); + pitch = intelObj->mt->pitch * intelObj->mt->cpp; state[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 | (LOAD_TEXTURE_MAP0 << unit) | 4); diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 3ee4c8653a..a1ab8f8b6d 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -150,7 +150,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) i915->state.tex_buffer[unit] = NULL; } - if (!intelObj->imageOverride && !intel_finalize_mipmap_tree(intel, unit)) + if (!intel_finalize_mipmap_tree(intel, unit)) return GL_FALSE; /* Get first image here, since intelObj->firstLevel will get set in @@ -158,34 +158,14 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) */ firstImage = tObj->Image[0][intelObj->firstLevel]; - if (intelObj->imageOverride) { - i915->state.tex_buffer[unit] = NULL; - i915->state.tex_offset[unit] = intelObj->textureOffset; + dri_bo_reference(intelObj->mt->region->buffer); + i915->state.tex_buffer[unit] = intelObj->mt->region->buffer; + i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */ - switch (intelObj->depthOverride) { - case 32: - format = MAPSURF_32BIT | MT_32BIT_ARGB8888; - break; - case 24: - default: - format = MAPSURF_32BIT | MT_32BIT_XRGB8888; - break; - case 16: - format = MAPSURF_16BIT | MT_16BIT_RGB565; - break; - } - - pitch = intelObj->pitchOverride; - } else { - dri_bo_reference(intelObj->mt->region->buffer); - i915->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i915->state.tex_offset[unit] = 0; /* Always the origin of the miptree */ - - format = translate_texture_format(firstImage->TexFormat, - firstImage->InternalFormat, - tObj->DepthMode); - pitch = intelObj->mt->pitch * intelObj->mt->cpp; - } + format = translate_texture_format(firstImage->TexFormat, + firstImage->InternalFormat, + tObj->DepthMode); + pitch = intelObj->mt->pitch * intelObj->mt->cpp; state[I915_TEXREG_MS3] = (((firstImage->Height - 1) << MS3_HEIGHT_SHIFT) | diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index b1ab79b783..ce0bf0b97d 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -207,33 +207,14 @@ brw_create_texture_surface( struct brw_context *brw, surf.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; surf.ss0.surface_type = translate_tex_target(key->target); - if (key->bo) { - surf.ss0.surface_format = translate_tex_format(key->format, - key->internal_format, - key->depthmode); - } - else { - switch (key->depth) { - case 32: - surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - break; - default: - case 24: - surf.ss0.surface_format = BRW_SURFACEFORMAT_B8G8R8X8_UNORM; - break; - case 16: - surf.ss0.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM; - break; - } - } + surf.ss0.surface_format = translate_tex_format(key->format, + key->internal_format, + key->depthmode); /* This is ok for all textures with channel width 8bit or less: */ /* surf.ss0.data_return_format = BRW_SURFACERETURNFORMAT_S1; */ - if (key->bo) - surf.ss1.base_addr = key->bo->offset; /* reloc */ - else - surf.ss1.base_addr = key->offset; + surf.ss1.base_addr = key->bo->offset; /* reloc */ surf.ss2.mip_count = key->last_level - key->first_level; surf.ss2.width = key->width - 1; @@ -255,17 +236,14 @@ brw_create_texture_surface( struct brw_context *brw, bo = brw_upload_cache(&brw->surface_cache, BRW_SS_SURFACE, key, sizeof(*key), - &key->bo, key->bo ? 1 : 0, + &key->bo, 1, &surf, sizeof(surf)); - if (key->bo) { - /* Emit relocation to surface contents */ - dri_bo_emit_reloc(bo, - I915_GEM_DOMAIN_SAMPLER, 0, - 0, - offsetof(struct brw_surface_state, ss1), - key->bo); - } + /* Emit relocation to surface contents */ + drm_intel_bo_emit_reloc(bo, offsetof(struct brw_surface_state, ss1), + key->bo, 0, + I915_GEM_DOMAIN_SAMPLER, 0); + return bo; } @@ -281,19 +259,12 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) memset(&key, 0, sizeof(key)); - if (intelObj->imageOverride) { - key.pitch = intelObj->pitchOverride / intelObj->mt->cpp; - key.depth = intelObj->depthOverride; - key.bo = NULL; - key.offset = intelObj->textureOffset; - } else { - key.format = firstImage->TexFormat; - key.internal_format = firstImage->InternalFormat; - key.pitch = intelObj->mt->pitch; - key.depth = firstImage->Depth; - key.bo = intelObj->mt->region->buffer; - key.offset = 0; - } + key.format = firstImage->TexFormat; + key.internal_format = firstImage->InternalFormat; + key.pitch = intelObj->mt->pitch; + key.depth = firstImage->Depth; + key.bo = intelObj->mt->region->buffer; + key.offset = 0; key.target = tObj->Target; key.depthmode = tObj->DepthMode; @@ -308,7 +279,7 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) brw->wm.surf_bo[surf] = brw_search_cache(&brw->surface_cache, BRW_SS_SURFACE, &key, sizeof(key), - &key.bo, key.bo ? 1 : 0, + &key.bo, 1, NULL); if (brw->wm.surf_bo[surf] == NULL) { brw->wm.surf_bo[surf] = brw_create_texture_surface(brw, &key); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 9ff76c4803..6e4bb64365 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -96,11 +96,6 @@ const GLuint __driNConfigOptions = 11; static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; #endif /*USE_NEW_INTERFACE */ -static const __DRItexOffsetExtension intelTexOffsetExtension = { - { __DRI_TEX_OFFSET }, - intelSetTexOffset, -}; - static const __DRItexBufferExtension intelTexBufferExtension = { { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION }, intelSetTexBuffer, @@ -227,7 +222,6 @@ static struct __DRIimageExtensionRec intelImageExtension = { static const __DRIextension *intelScreenExtensions[] = { &driReadDrawableExtension, - &intelTexOffsetExtension.base, &intelTexBufferExtension.base, &intelFlushExtension.base, &intelImageExtension.base, diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h index f3cc0fff5c..4bb012dc65 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.h +++ b/src/mesa/drivers/dri/intel/intel_tex.h @@ -45,8 +45,6 @@ void intelInitTextureCopyImageFuncs(struct dd_function_table *functions); gl_format intelChooseTextureFormat(GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type); -void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, - unsigned long long offset, GLint depth, GLuint pitch); void intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *pDraw); void intelSetTexBuffer2(__DRIcontext *pDRICtx, diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index f586aee992..bac36eeb56 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -706,29 +706,6 @@ intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, texObj, texImage, GL_TRUE); } - -void -intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, - unsigned long long offset, GLint depth, GLuint pitch) -{ - struct intel_context *intel = pDRICtx->driverPrivate; - struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname); - struct intel_texture_object *intelObj = intel_texture_object(tObj); - - if (!intelObj) - return; - - if (intelObj->mt) - intel_miptree_release(intel, &intelObj->mt); - - intelObj->imageOverride = GL_TRUE; - intelObj->depthOverride = depth; - intelObj->pitchOverride = pitch; - - if (offset) - intelObj->textureOffset = offset; -} - void intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format, diff --git a/src/mesa/drivers/dri/intel/intel_tex_obj.h b/src/mesa/drivers/dri/intel/intel_tex_obj.h index 3ad10d3d23..5f60e0ea4f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_obj.h +++ b/src/mesa/drivers/dri/intel/intel_tex_obj.h @@ -46,10 +46,6 @@ struct intel_texture_object * regions will be copied to this region and the old storage freed. */ struct intel_mipmap_tree *mt; - - GLboolean imageOverride; - GLint depthOverride; - GLuint pitchOverride; }; struct intel_texture_image -- cgit v1.2.3 From 8c8e664f1086e702e1102ee7f5043c8c12c037bd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 5 Mar 2010 14:13:24 -0800 Subject: i965: Only use the effective subset of the WM sampler key. The whole structure is 836 bytes, but if only the first one or two samplers are used (as is common), the part that matters is only 56 or 108 bytes. By using just that subset as the key (since the key size is also part of the key), we improve firefox-talos-gfx performance by 1%. --- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 3a33996452..d7650af3d9 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -229,7 +229,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw, GLcontext *ctx = &brw->intel.ctx; int unit; - memset(key, 0, sizeof(*key)); + key->sampler_count = 0; for (unit = 0; unit < BRW_MAX_TEX_UNIT; unit++) { if (ctx->Texture.Unit[unit]._ReallyEnabled) { @@ -240,6 +240,8 @@ brw_wm_sampler_populate_key(struct brw_context *brw, struct gl_texture_image *firstImage = texObj->Image[0][intelObj->firstLevel]; + memset(entry, 0, sizeof(*entry)); + entry->tex_target = texObj->Target; entry->seamless_cube_map = (texObj->Target == GL_TEXTURE_CUBE_MAP) @@ -288,7 +290,7 @@ static void upload_wm_samplers( struct brw_context *brw ) { GLcontext *ctx = &brw->intel.ctx; struct wm_sampler_key key; - int i; + int i, sampler_key_size; brw_wm_sampler_populate_key(brw, &key); @@ -302,8 +304,11 @@ static void upload_wm_samplers( struct brw_context *brw ) if (brw->wm.sampler_count == 0) return; + /* Only include the populated portion of the key in the search. */ + sampler_key_size = offsetof(struct wm_sampler_key, + sampler[key.sampler_count]); brw->wm.sampler_bo = brw_search_cache(&brw->cache, BRW_SAMPLER, - &key, sizeof(key), + &key, sampler_key_size, brw->wm.sdc_bo, key.sampler_count, NULL); @@ -323,7 +328,7 @@ static void upload_wm_samplers( struct brw_context *brw ) } brw->wm.sampler_bo = brw_upload_cache(&brw->cache, BRW_SAMPLER, - &key, sizeof(key), + &key, sampler_key_size, brw->wm.sdc_bo, key.sampler_count, &sampler, sizeof(sampler)); -- cgit v1.2.3 From 36a0c4219deaa1509ae9746abb845f9502ca9f1b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 16:07:26 -0700 Subject: gallivm: added field for sampler lod --- src/gallium/auxiliary/gallivm/lp_bld_sample.c | 9 +++++---- src/gallium/auxiliary/gallivm/lp_bld_sample.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 55ac2e9436..6a026e468e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -75,14 +75,15 @@ lp_sampler_static_state(struct lp_sampler_static_state *state, state->min_mip_filter = sampler->min_mip_filter; state->mag_img_filter = sampler->mag_img_filter; state->compare_mode = sampler->compare_mode; + state->compare_func = sampler->compare_func; + state->normalized_coords = sampler->normalized_coords; + state->lod_bias = sampler->lod_bias; + state->min_lod = sampler->min_lod; + state->max_lod = sampler->max_lod; state->border_color[0] = sampler->border_color[0]; state->border_color[1] = sampler->border_color[1]; state->border_color[2] = sampler->border_color[2]; state->border_color[3] = sampler->border_color[3]; - if(sampler->compare_mode != PIPE_TEX_COMPARE_NONE) { - state->compare_func = sampler->compare_func; - } - state->normalized_coords = sampler->normalized_coords; } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index a791d88612..2120775d10 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -70,6 +70,7 @@ struct lp_sampler_static_state unsigned compare_mode:1; unsigned compare_func:3; unsigned normalized_coords:1; + float lod_bias, min_lod, max_lod; float border_color[4]; }; -- cgit v1.2.3 From 6bc644fe62adad6656be3f29c118045fc5630510 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 16:07:54 -0700 Subject: gallivm: checkpoint: texture LOD computation code gen --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 129 +++++++++++++++++++++- 1 file changed, 126 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 2b04becc8c..6b643fa85f 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -1040,6 +1040,127 @@ lp_build_sample_compare(struct lp_build_sample_context *bld, } +static int +texture_dims(enum pipe_texture_target tex) +{ + switch (tex) { + case PIPE_TEXTURE_1D: + return 1; + case PIPE_TEXTURE_2D: + case PIPE_TEXTURE_CUBE: + return 2; + case PIPE_TEXTURE_3D: + return 3; + default: + assert(0 && "bad texture target in texture_dims()"); + return 2; + } +} + + +/** + * Generate code to compute texture level of detail (lambda). + * \param s vector of texcoord s values + * \param t vector of texcoord t values + * \param r vector of texcoord r values + * \param width scalar int texture width + * \param height scalar int texture height + * \param depth scalar int texture depth + */ +static LLVMValueRef +lp_build_lod_selector(struct lp_build_sample_context *bld, + LLVMValueRef s, + LLVMValueRef t, + LLVMValueRef r, + LLVMValueRef width, + LLVMValueRef height, + LLVMValueRef depth) + +{ + const int dims = texture_dims(bld->static_state->target); + struct lp_build_context *coord_bld = &bld->coord_bld; + + LLVMValueRef lod_bias = lp_build_const_scalar(bld->coord_bld.type, + bld->static_state->lod_bias); + LLVMValueRef min_lod = lp_build_const_scalar(bld->coord_bld.type, + bld->static_state->min_lod); + LLVMValueRef max_lod = lp_build_const_scalar(bld->coord_bld.type, + bld->static_state->max_lod); + + LLVMValueRef index0 = LLVMConstInt(LLVMInt32Type(), 0, 0); + LLVMValueRef index1 = LLVMConstInt(LLVMInt32Type(), 1, 0); + LLVMValueRef index2 = LLVMConstInt(LLVMInt32Type(), 2, 0); + + LLVMValueRef s0, s1, s2; + LLVMValueRef t0, t1, t2; + LLVMValueRef r0, r1, r2; + LLVMValueRef dsdx, dsdy, dtdx, dtdy, drdx, drdy; + LLVMValueRef rho, lod; + + /* + * dsdx = abs(s[1] - s[0]); + * dsdy = abs(s[2] - s[0]); + * dtdx = abs(t[1] - t[0]); + * dtdy = abs(t[2] - t[0]); + * drdx = abs(r[1] - r[0]); + * drdy = abs(r[2] - r[0]); + * XXX we're assuming a four-element quad in 2x2 layout here. + */ + s0 = LLVMBuildExtractElement(bld->builder, s, index0, "s0"); + s1 = LLVMBuildExtractElement(bld->builder, s, index1, "s1"); + s2 = LLVMBuildExtractElement(bld->builder, s, index2, "s2"); + dsdx = lp_build_abs(coord_bld, lp_build_sub(coord_bld, s1, s0)); + dsdy = lp_build_abs(coord_bld, lp_build_sub(coord_bld, s2, s0)); + if (dims > 1) { + t0 = LLVMBuildExtractElement(bld->builder, t, index0, "t0"); + t1 = LLVMBuildExtractElement(bld->builder, t, index1, "t1"); + t2 = LLVMBuildExtractElement(bld->builder, t, index2, "t2"); + dtdx = lp_build_abs(coord_bld, lp_build_sub(coord_bld, t1, t0)); + dtdy = lp_build_abs(coord_bld, lp_build_sub(coord_bld, t2, t0)); + if (dims > 2) { + r0 = LLVMBuildExtractElement(bld->builder, r, index0, "r0"); + r1 = LLVMBuildExtractElement(bld->builder, r, index1, "r1"); + r2 = LLVMBuildExtractElement(bld->builder, r, index2, "r2"); + drdx = lp_build_abs(coord_bld, lp_build_sub(coord_bld, r1, r0)); + drdy = lp_build_abs(coord_bld, lp_build_sub(coord_bld, r2, r0)); + } + } + + /* Compute rho = max of all partial derivatives scaled by texture size. + * XXX this can be vectorized somewhat + */ + rho = lp_build_mul(coord_bld, + lp_build_max(coord_bld, dsdx, dsdy), + lp_build_int_to_float(coord_bld, width)); + if (dims > 1) { + LLVMValueRef max; + max = lp_build_mul(coord_bld, + lp_build_max(coord_bld, dtdx, dtdy), + lp_build_int_to_float(coord_bld, height)); + rho = lp_build_max(coord_bld, rho, max); + if (dims > 2) { + max = lp_build_mul(coord_bld, + lp_build_max(coord_bld, drdx, drdy), + lp_build_int_to_float(coord_bld, depth)); + rho = lp_build_max(coord_bld, rho, max); + } + } + + /* compute lod = log2(rho) */ + lod = lp_build_log2(coord_bld, rho); + + /* add lod bias */ + lod = lp_build_add(coord_bld, lod, lod_bias); + + /* clamp lod */ + lod = lp_build_clamp(coord_bld, lod, min_lod, max_lod); + + return lod; +} + + + + /** * Build texture sampling code. * 'texel' will return a vector of four LLVMValueRefs corresponding to @@ -1063,7 +1184,9 @@ lp_build_sample_soa(LLVMBuilderRef builder, LLVMValueRef data_ptr; LLVMValueRef s; LLVMValueRef t; - LLVMValueRef p; + LLVMValueRef r; + + (void) lp_build_lod_selector; /* temporary to silence warning */ /* Setup our build context */ memset(&bld, 0, sizeof bld); @@ -1088,7 +1211,7 @@ lp_build_sample_soa(LLVMBuilderRef builder, s = coords[0]; t = coords[1]; - p = coords[2]; + r = coords[2]; width = lp_build_broadcast_scalar(&bld.uint_coord_bld, width); height = lp_build_broadcast_scalar(&bld.uint_coord_bld, height); @@ -1119,5 +1242,5 @@ lp_build_sample_soa(LLVMBuilderRef builder, /* FIXME: respect static_state->min_mip_filter */; /* FIXME: respect static_state->mag_img_filter */; - lp_build_sample_compare(&bld, p, texel); + lp_build_sample_compare(&bld, r, texel); } -- cgit v1.2.3 From 7f4b5c5387a3a8e3c5f31f0badc943c43857683a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 16:50:48 -0700 Subject: gallivm: added methods for getting texture depth, num mipmap levels --- src/gallium/auxiliary/gallivm/lp_bld_sample.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index 2120775d10..5ba0925bb6 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -100,6 +100,18 @@ struct lp_sampler_dynamic_state LLVMBuilderRef builder, unsigned unit); + /** Obtain the base texture depth. */ + LLVMValueRef + (*depth)( struct lp_sampler_dynamic_state *state, + LLVMBuilderRef builder, + unsigned unit); + + /** Obtain the number of mipmap levels (minus one). */ + LLVMValueRef + (*last_level)( struct lp_sampler_dynamic_state *state, + LLVMBuilderRef builder, + unsigned unit); + LLVMValueRef (*stride)( struct lp_sampler_dynamic_state *state, LLVMBuilderRef builder, -- cgit v1.2.3 From b5038fdd65535012086535c6a87bc56c91a65c87 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 16:51:35 -0700 Subject: llvmpipe: added code to set texture depth, max mipmap levels info --- src/gallium/drivers/llvmpipe/lp_jit.c | 10 +++++++++- src/gallium/drivers/llvmpipe/lp_jit.h | 4 ++++ src/gallium/drivers/llvmpipe/lp_setup.c | 2 ++ src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c | 12 ++++++++---- 4 files changed, 23 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index b666ffc804..bacff500d6 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -51,10 +51,12 @@ lp_jit_init_globals(struct llvmpipe_screen *screen) /* struct lp_jit_texture */ { - LLVMTypeRef elem_types[4]; + LLVMTypeRef elem_types[6]; elem_types[LP_JIT_TEXTURE_WIDTH] = LLVMInt32Type(); elem_types[LP_JIT_TEXTURE_HEIGHT] = LLVMInt32Type(); + elem_types[LP_JIT_TEXTURE_DEPTH] = LLVMInt32Type(); + elem_types[LP_JIT_TEXTURE_LAST_LEVEL] = LLVMInt32Type(); elem_types[LP_JIT_TEXTURE_STRIDE] = LLVMInt32Type(); elem_types[LP_JIT_TEXTURE_DATA] = LLVMPointerType(LLVMInt8Type(), 0); @@ -66,6 +68,12 @@ lp_jit_init_globals(struct llvmpipe_screen *screen) LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, height, screen->target, texture_type, LP_JIT_TEXTURE_HEIGHT); + LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, depth, + screen->target, texture_type, + LP_JIT_TEXTURE_DEPTH); + LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, last_level, + screen->target, texture_type, + LP_JIT_TEXTURE_LAST_LEVEL); LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, stride, screen->target, texture_type, LP_JIT_TEXTURE_STRIDE); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index 8df3015d4b..0ebb2826fa 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -48,6 +48,8 @@ struct lp_jit_texture { uint32_t width; uint32_t height; + uint32_t depth; + uint32_t last_level; uint32_t stride; const void *data; }; @@ -56,6 +58,8 @@ struct lp_jit_texture enum { LP_JIT_TEXTURE_WIDTH = 0, LP_JIT_TEXTURE_HEIGHT, + LP_JIT_TEXTURE_DEPTH, + LP_JIT_TEXTURE_LAST_LEVEL, LP_JIT_TEXTURE_STRIDE, LP_JIT_TEXTURE_DATA }; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index aebed85fbb..b0713c3b71 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -469,6 +469,8 @@ lp_setup_set_sampler_textures( struct setup_context *setup, jit_tex = &setup->fs.current.jit_context.textures[i]; jit_tex->width = tex->width0; jit_tex->height = tex->height0; + jit_tex->depth = tex->depth0; + jit_tex->last_level = tex->last_level; jit_tex->stride = lp_tex->stride[0]; if(!lp_tex->dt) { jit_tex->data = lp_tex->data; diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c index 515c9089dd..632462460a 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c @@ -132,10 +132,12 @@ lp_llvm_texture_member(struct lp_sampler_dynamic_state *base, } -LP_LLVM_TEXTURE_MEMBER(width, LP_JIT_TEXTURE_WIDTH) -LP_LLVM_TEXTURE_MEMBER(height, LP_JIT_TEXTURE_HEIGHT) -LP_LLVM_TEXTURE_MEMBER(stride, LP_JIT_TEXTURE_STRIDE) -LP_LLVM_TEXTURE_MEMBER(data_ptr, LP_JIT_TEXTURE_DATA) +LP_LLVM_TEXTURE_MEMBER(width, LP_JIT_TEXTURE_WIDTH) +LP_LLVM_TEXTURE_MEMBER(height, LP_JIT_TEXTURE_HEIGHT) +LP_LLVM_TEXTURE_MEMBER(depth, LP_JIT_TEXTURE_DEPTH) +LP_LLVM_TEXTURE_MEMBER(last_level, LP_JIT_TEXTURE_LAST_LEVEL) +LP_LLVM_TEXTURE_MEMBER(stride, LP_JIT_TEXTURE_STRIDE) +LP_LLVM_TEXTURE_MEMBER(data_ptr, LP_JIT_TEXTURE_DATA) static void @@ -189,6 +191,8 @@ lp_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state, sampler->base.emit_fetch_texel = lp_llvm_sampler_soa_emit_fetch_texel; sampler->dynamic_state.base.width = lp_llvm_texture_width; sampler->dynamic_state.base.height = lp_llvm_texture_height; + sampler->dynamic_state.base.depth = lp_llvm_texture_depth; + sampler->dynamic_state.base.last_level = lp_llvm_texture_last_level; sampler->dynamic_state.base.stride = lp_llvm_texture_stride; sampler->dynamic_state.base.data_ptr = lp_llvm_texture_data_ptr; sampler->dynamic_state.static_state = static_state; -- cgit v1.2.3 From 1a0a2b64ca150a97c96da2d4d97189c233dce407 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 16:52:11 -0700 Subject: gallivm: checkpoint: code gen for mipmap selection --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 65 +++++++++++++++++++++++ 1 file changed, 65 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 6b643fa85f..bc2f307c33 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -1159,6 +1159,69 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, } +/** + * For PIPE_TEX_MIPFILTER_NEAREST, convert float LOD to integer + * mipmap level index. + * \param lod scalar float texture level of detail + * \param level_out returns integer + */ +static void +lp_build_nearest_mip_level(struct lp_build_sample_context *bld, + unsigned unit, + LLVMValueRef lod, + LLVMValueRef *level_out) +{ + struct lp_build_context *coord_bld = &bld->coord_bld; + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; + LLVMValueRef last_level, level; + + last_level = bld->dynamic_state->last_level(bld->dynamic_state, + bld->builder, unit); + + /* convert float lod to integer */ + level = lp_build_iround(coord_bld, lod); + + /* clamp level to legal range of levels */ + *level_out = lp_build_clamp(int_coord_bld, level, + int_coord_bld->zero, + last_level); +} + + +/** + * For PIPE_TEX_MIPFILTER_LINEAR, convert float LOD to integer to + * two (adjacent) mipmap level indexes. Later, we'll sample from those + * two mipmap levels and interpolate between them. + */ +static void +lp_build_linear_mip_levels(struct lp_build_sample_context *bld, + unsigned unit, + LLVMValueRef lod, + LLVMValueRef *level0_out, + LLVMValueRef *level1_out, + LLVMValueRef *weight_out) +{ + struct lp_build_context *coord_bld = &bld->coord_bld; + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; + LLVMValueRef last_level, level; + + last_level = bld->dynamic_state->last_level(bld->dynamic_state, + bld->builder, unit); + + /* convert float lod to integer */ + level = lp_build_ifloor(coord_bld, lod); + + /* compute level 0 and clamp to legal range of levels */ + *level0_out = lp_build_clamp(int_coord_bld, level, + int_coord_bld->zero, + last_level); + /* compute level 1 and clamp to legal range of levels */ + *level1_out = lp_build_add(int_coord_bld, *level0_out, int_coord_bld->one); + *level1_out = lp_build_min(int_coord_bld, *level1_out, int_coord_bld->zero); + + *weight_out = lp_build_fract(coord_bld, lod); +} + /** @@ -1187,6 +1250,8 @@ lp_build_sample_soa(LLVMBuilderRef builder, LLVMValueRef r; (void) lp_build_lod_selector; /* temporary to silence warning */ + (void) lp_build_nearest_mip_level; + (void) lp_build_linear_mip_levels; /* Setup our build context */ memset(&bld, 0, sizeof bld); -- cgit v1.2.3 From c67af0628b1b020b36df7dc81e9ab125da06b3a9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 17:14:55 -0800 Subject: swrast: Remove stray comment that mentions ctx->Visual Signed-off-by: Ian Romanick --- src/mesa/swrast/s_linetemp.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index 182f962e1e..033431df23 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -84,7 +84,6 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 ) DEPTH_TYPE *zPtr; #elif defined(INTERP_Z) const GLint depthBits = ctx->DrawBuffer->Visual.depthBits; -/*ctx->Visual.depthBits;*/ #endif #ifdef PIXEL_ADDRESS PIXEL_TYPE *pixelPtr; -- cgit v1.2.3 From ebbec7e4e44fccf496a9a663bdcc643efead6e95 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 17:16:11 -0800 Subject: swrast: Adjust colors based on ReadBuffer visual, not context visual In the presence of FBOs, the visual of the context may not match the, possibly fake, visual of the current ReadBuffer. Note that the caller of adjust_colors correctly uses the visual of the ReadBuffer. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_readpix.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index ecabac6921..368311e14d 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -253,21 +253,21 @@ fast_read_rgba_pixels( GLcontext *ctx, /** * When we're using a low-precision color buffer (like 16-bit 5/6/5) * we have to adjust our color values a bit to pass conformance. - * The problem is when a 5 or 6-bit color value is convert to an 8-bit + * The problem is when a 5 or 6-bit color value is converted to an 8-bit * value and then a floating point value, the floating point values don't * increment uniformly as the 5 or 6-bit value is incremented. * * This function adjusts floating point values to compensate. */ static void -adjust_colors(GLcontext *ctx, GLuint n, GLfloat rgba[][4]) +adjust_colors(const struct gl_framebuffer *fb, GLuint n, GLfloat rgba[][4]) { - const GLuint rShift = 8 - ctx->Visual.redBits; - const GLuint gShift = 8 - ctx->Visual.greenBits; - const GLuint bShift = 8 - ctx->Visual.blueBits; - const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); - const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); - const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); + const GLuint rShift = 8 - fb->Visual.redBits; + const GLuint gShift = 8 - fb->Visual.greenBits; + const GLuint bShift = 8 - fb->Visual.blueBits; + const GLfloat rScale = 1.0F / (GLfloat) ((1 << fb->Visual.redBits ) - 1); + const GLfloat gScale = 1.0F / (GLfloat) ((1 << fb->Visual.greenBits) - 1); + const GLfloat bScale = 1.0F / (GLfloat) ((1 << fb->Visual.blueBits ) - 1); GLuint i; for (i = 0; i < n; i++) { GLint r, g, b; @@ -390,7 +390,7 @@ read_rgba_pixels( GLcontext *ctx, if (fb->Visual.redBits < 8 || fb->Visual.greenBits < 8 || fb->Visual.blueBits < 8) { - adjust_colors(ctx, width, rgba); + adjust_colors(fb, width, rgba); } /* pack the row of RGBA pixels into user's buffer */ -- cgit v1.2.3 From 66c0abba6ba89d326555389d9539894402303286 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 17:17:56 -0800 Subject: swrast: Remove redundant test of the visual's accumulation buffer size If the visual doesn't have an accumulation buffer, the renderbuffer passed into _swrast_clear_accum_buffer will be NULL anyway. There is no reason the check the visual. Moreover, the test erroneously checks the context's visual instead of the visual of the current DrawBuffer. With FBOs these may be different. Signed-off-by: Ian Romanick --- src/mesa/swrast/s_accum.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c index 2dd9ca6348..854e106b7f 100644 --- a/src/mesa/swrast/s_accum.c +++ b/src/mesa/swrast/s_accum.c @@ -130,11 +130,7 @@ _swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb ) SWcontext *swrast = SWRAST_CONTEXT(ctx); GLuint x, y, width, height; - if (ctx->Visual.accumRedBits == 0) { - /* No accumulation buffer! Not an error. */ - return; - } - + /* No accumulation buffer! Not an error. */ if (!rb || !rb->Data) return; -- cgit v1.2.3 From 77fc3ef9116fae6b8b53cda78d97c4ff1ec5c171 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 3 Mar 2010 17:20:27 -0800 Subject: meta: Use the DrawBuffer's stencil size Previously the code was erroneously using the stencil size of the context instead of the stencil size of the DrawBuffer. With FBOs these may be different. As a result, clearing the stencil buffer of an FBO bound to a context that doesn't have stencil would fail. Signed-off-by: Ian Romanick --- src/mesa/drivers/common/meta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 8e229bbe38..b97b760f18 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1895,7 +1895,7 @@ _mesa_meta_DrawPixels(GLcontext *ctx, _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, drawpix->StencilFP); _mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB, GL_TRUE); - for (bit = 0; bit < ctx->Visual.stencilBits; bit++) { + for (bit = 0; bit < ctx->DrawBuffer->Visual.stencilBits; bit++) { const GLuint mask = 1 << bit; if (mask & origStencilMask) { _mesa_StencilFunc(GL_ALWAYS, mask, mask); -- cgit v1.2.3 From 96ab4d2b84178209ee59017458d9964b32b7e183 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 1 Jul 2009 21:18:13 +0100 Subject: glx: Move initialization of ext_list_first_time to where it's storage is allocated Move the initialization of ext_list_first_time from all of the DRI loader's CreateScreen routines, to where the storage for the screen config is allocated. It needs to get set in the screen-config even if DRI is forced off using LIBGL_ALWAYS_INDIRECT, so that psc->direct_support is initialized correctly, otherwise __glXExtensionBitIsEnabled() always returns FALSE Specifically, this causes a problem with an X server which advertises GLX<=1.2, and the GLX_SGIX_fbconfig extension. glXGetFBConfigFromVisualSGIX() uses __glXExtensionBitIsEnabled() to check if the GLX_SGIX_fbconfig extension is available, but that function won't return correct information because that data has never been initialized, because ext_list_first_time was never set... Signed-off-by: Jon TURNEY Signed-off-by: Brian Paul --- src/glx/dri2_glx.c | 3 --- src/glx/dri_glx.c | 3 --- src/glx/drisw_glx.c | 3 --- src/glx/glxext.c | 3 +++ 4 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index d573e46296..5b0f335db6 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -519,9 +519,6 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen, if (psp == NULL) return NULL; - /* Initialize per screen dynamic client GLX extensions */ - psc->ext_list_first_time = GL_TRUE; - if (!DRI2Connect(psc->dpy, RootWindow(psc->dpy, screen), &driverName, &deviceName)) { XFree(psp); diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index f9fe9a25db..e47db82b70 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -648,9 +648,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen, if (psp == NULL) return NULL; - /* Initialize per screen dynamic client GLX extensions */ - psc->ext_list_first_time = GL_TRUE; - if (!driGetDriverName(priv->dpy, screen, &driverName)) { Xfree(psp); return NULL; diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index eed9a8c472..1b94a56fd1 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -364,9 +364,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen, if (psp == NULL) return NULL; - /* Initialize per screen dynamic client GLX extensions */ - psc->ext_list_first_time = GL_TRUE; - psc->driver = driOpenDriver(driverName); if (psc->driver == NULL) goto handle_error; diff --git a/src/glx/glxext.c b/src/glx/glxext.c index c2de1a3fff..b5657baf2e 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -717,6 +717,9 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) if (psc->drawHash == NULL) continue; + /* Initialize per screen dynamic client GLX extensions */ + psc->ext_list_first_time = GL_TRUE; + if (priv->dri2Display) psc->driScreen = (*priv->dri2Display->createScreen) (psc, i, priv); -- cgit v1.2.3 From ae7b3a632dd3f3b005459d77b66a77948260f716 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 17:32:36 -0700 Subject: glx: Move initialization of ext_list_first_time to where it's storage is allocated Move the initialization of ext_list_first_time from all of the DRI loader's CreateScreen routines, to where the storage for the screen config is allocated. It needs to get set in the screen-config even if DRI is forced off using LIBGL_ALWAYS_INDIRECT, so that psc->direct_support is initialized correctly, otherwise __glXExtensionBitIsEnabled() always returns FALSE Specifically, this causes a problem with an X server which advertises GLX<=1.2, and the GLX_SGIX_fbconfig extension. glXGetFBConfigFromVisualSGIX() uses __glXExtensionBitIsEnabled() to check if the GLX_SGIX_fbconfig extension is available, but that function won't return correct information because that data has never been initialized, because ext_list_first_time was never set... Signed-off-by: Jon TURNEY Signed-off-by: Brian Paul (cherry picked from commit 96ab4d2b84178209ee59017458d9964b32b7e183) --- src/glx/dri2_glx.c | 3 --- src/glx/dri_glx.c | 3 --- src/glx/drisw_glx.c | 3 --- src/glx/glxext.c | 3 +++ 4 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index d573e46296..5b0f335db6 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -519,9 +519,6 @@ dri2CreateScreen(__GLXscreenConfigs * psc, int screen, if (psp == NULL) return NULL; - /* Initialize per screen dynamic client GLX extensions */ - psc->ext_list_first_time = GL_TRUE; - if (!DRI2Connect(psc->dpy, RootWindow(psc->dpy, screen), &driverName, &deviceName)) { XFree(psp); diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index f9fe9a25db..e47db82b70 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -648,9 +648,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen, if (psp == NULL) return NULL; - /* Initialize per screen dynamic client GLX extensions */ - psc->ext_list_first_time = GL_TRUE; - if (!driGetDriverName(priv->dpy, screen, &driverName)) { Xfree(psp); return NULL; diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index eed9a8c472..1b94a56fd1 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -364,9 +364,6 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen, if (psp == NULL) return NULL; - /* Initialize per screen dynamic client GLX extensions */ - psc->ext_list_first_time = GL_TRUE; - psc->driver = driOpenDriver(driverName); if (psc->driver == NULL) goto handle_error; diff --git a/src/glx/glxext.c b/src/glx/glxext.c index c2de1a3fff..b5657baf2e 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -717,6 +717,9 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) if (psc->drawHash == NULL) continue; + /* Initialize per screen dynamic client GLX extensions */ + psc->ext_list_first_time = GL_TRUE; + if (priv->dri2Display) psc->driScreen = (*priv->dri2Display->createScreen) (psc, i, priv); -- cgit v1.2.3 From 6ce4a85e0b1d6581d73c1b1cbc37525d7a9ed1ba Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 5 Mar 2010 17:35:01 -0700 Subject: mesa: bump version to 7.9 Now that the 7.8 branch has been created Mesa/master will be version 7.9 --- Makefile | 2 +- configs/default | 2 +- src/mesa/main/version.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/Makefile b/Makefile index c4ee9e583c..92b227ca48 100644 --- a/Makefile +++ b/Makefile @@ -180,7 +180,7 @@ ultrix-gcc: # Rules for making release tarballs -VERSION=7.8-devel +VERSION=7.9-devel DIRECTORY = Mesa-$(VERSION) LIB_NAME = MesaLib-$(VERSION) DEMO_NAME = MesaDemos-$(VERSION) diff --git a/configs/default b/configs/default index ad6d93c92f..4fe64cc6c9 100644 --- a/configs/default +++ b/configs/default @@ -9,7 +9,7 @@ CONFIG_NAME = default # Version info MESA_MAJOR=7 -MESA_MINOR=8 +MESA_MINOR=9 MESA_TINY=0 MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY) diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index d521569f8d..59f62ebd6c 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.8 + * Version: 7.9 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -33,9 +33,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 8 +#define MESA_MINOR 9 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.8-devel" +#define MESA_VERSION_STRING "7.9-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 8953bfce0eb7e56f13d4527ef86cdf4cf2db037f Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 6 Mar 2010 06:33:20 +0200 Subject: dri: drop MINIGLX_SOURCES --- src/mesa/drivers/dri/i810/Makefile | 3 --- src/mesa/drivers/dri/i915/Makefile | 2 -- src/mesa/drivers/dri/i965/Makefile | 1 - src/mesa/drivers/dri/mach64/Makefile | 3 --- src/mesa/drivers/dri/mga/Makefile | 2 -- src/mesa/drivers/dri/nouveau/Makefile | 2 -- src/mesa/drivers/dri/r128/Makefile | 2 -- src/mesa/drivers/dri/r200/Makefile | 2 -- src/mesa/drivers/dri/r300/Makefile | 2 -- src/mesa/drivers/dri/r600/Makefile | 2 -- src/mesa/drivers/dri/radeon/Makefile | 2 -- src/mesa/drivers/dri/savage/Makefile | 3 --- src/mesa/drivers/dri/sis/Makefile | 4 ---- src/mesa/drivers/dri/tdfx/Makefile | 3 --- src/mesa/drivers/dri/unichrome/Makefile | 2 -- 15 files changed, 35 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i810/Makefile b/src/mesa/drivers/dri/i810/Makefile index 3874faee51..54a837d5ea 100644 --- a/src/mesa/drivers/dri/i810/Makefile +++ b/src/mesa/drivers/dri/i810/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = i810_dri.so -# Not yet -# MINIGLX_SOURCES = server/i810_dri.c - DRIVER_SOURCES = \ i810context.c \ i810ioctl.c \ diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index dc15ae425c..5b49d0c77c 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -4,8 +4,6 @@ include $(TOP)/configs/current LIBNAME = i915_dri.so -MINIGLX_SOURCES = server/intel_dri.c - DRIVER_SOURCES = \ i830_context.c \ i830_state.c \ diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index f98a1a27db..a242580273 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -99,7 +99,6 @@ DRIVER_SOURCES = \ C_SOURCES = \ $(COMMON_SOURCES) \ - $(MINIGLX_SOURCES) \ $(DRIVER_SOURCES) ASM_SOURCES = diff --git a/src/mesa/drivers/dri/mach64/Makefile b/src/mesa/drivers/dri/mach64/Makefile index a8f463e9fd..c20fdece29 100644 --- a/src/mesa/drivers/dri/mach64/Makefile +++ b/src/mesa/drivers/dri/mach64/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = mach64_dri.so -# Not yet -# MINIGLX_SOURCES = server/mach64_dri.c - DRIVER_SOURCES = \ mach64_context.c \ mach64_ioctl.c \ diff --git a/src/mesa/drivers/dri/mga/Makefile b/src/mesa/drivers/dri/mga/Makefile index 0cc329fb22..92533bccc2 100644 --- a/src/mesa/drivers/dri/mga/Makefile +++ b/src/mesa/drivers/dri/mga/Makefile @@ -5,8 +5,6 @@ include $(TOP)/configs/current LIBNAME = mga_dri.so -MINIGLX_SOURCES = server/mga_dri.c - DRIVER_SOURCES = \ mgadd.c \ mgaioctl.c \ diff --git a/src/mesa/drivers/dri/nouveau/Makefile b/src/mesa/drivers/dri/nouveau/Makefile index 49e8933561..7be19b26fd 100644 --- a/src/mesa/drivers/dri/nouveau/Makefile +++ b/src/mesa/drivers/dri/nouveau/Makefile @@ -8,8 +8,6 @@ DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs) LIBNAME = nouveau_vieux_dri.so -MINIGLX_SOURCES = - DRIVER_SOURCES = \ nouveau_screen.c \ nouveau_context.c \ diff --git a/src/mesa/drivers/dri/r128/Makefile b/src/mesa/drivers/dri/r128/Makefile index 52c5a38a70..8144c9b43f 100644 --- a/src/mesa/drivers/dri/r128/Makefile +++ b/src/mesa/drivers/dri/r128/Makefile @@ -5,8 +5,6 @@ include $(TOP)/configs/current LIBNAME = r128_dri.so -MINIGLX_SOURCES = server/r128_dri.c - DRIVER_SOURCES = \ r128_context.c \ r128_lock.c \ diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 14eb96c1ba..2e86e8b941 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -7,8 +7,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = r200_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 04459c2ddf..08934fc996 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -7,8 +7,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = r300_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index 5d50941539..2478b12658 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -7,8 +7,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = r600_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index a54ea16ec6..fc6d1c8e89 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -8,8 +8,6 @@ CFLAGS += $(RADEON_CFLAGS) LIBNAME = radeon_dri.so -MINIGLX_SOURCES = server/radeon_dri.c - ifeq ($(RADEON_LDFLAGS),) CS_SOURCES = radeon_cs_space_drm.c radeon_bo.c radeon_cs.c endif diff --git a/src/mesa/drivers/dri/savage/Makefile b/src/mesa/drivers/dri/savage/Makefile index 2e5c40802c..53511552c6 100644 --- a/src/mesa/drivers/dri/savage/Makefile +++ b/src/mesa/drivers/dri/savage/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = savage_dri.so -# Doesn't exist yet. -#MINIGLX_SOURCES = server/savage_dri.c - DRIVER_SOURCES = \ savage_xmesa.c \ savagedd.c \ diff --git a/src/mesa/drivers/dri/sis/Makefile b/src/mesa/drivers/dri/sis/Makefile index ad009fc239..6b4f938bab 100644 --- a/src/mesa/drivers/dri/sis/Makefile +++ b/src/mesa/drivers/dri/sis/Makefile @@ -5,10 +5,6 @@ include $(TOP)/configs/current LIBNAME = sis_dri.so - -# Not yet -# MINIGLX_SOURCES = server/sis_dri.c - DRIVER_SOURCES = \ sis6326_state.c \ sis6326_clear.c \ diff --git a/src/mesa/drivers/dri/tdfx/Makefile b/src/mesa/drivers/dri/tdfx/Makefile index b9f25db4fe..96bd8f8202 100644 --- a/src/mesa/drivers/dri/tdfx/Makefile +++ b/src/mesa/drivers/dri/tdfx/Makefile @@ -5,9 +5,6 @@ include $(TOP)/configs/current LIBNAME = tdfx_dri.so -# not yet -# MINIGLX_SOURCES = server/tdfx_dri.c - DRIVER_SOURCES = \ tdfx_context.c \ tdfx_dd.c \ diff --git a/src/mesa/drivers/dri/unichrome/Makefile b/src/mesa/drivers/dri/unichrome/Makefile index 344d34fce3..14cf9f3038 100644 --- a/src/mesa/drivers/dri/unichrome/Makefile +++ b/src/mesa/drivers/dri/unichrome/Makefile @@ -5,8 +5,6 @@ include $(TOP)/configs/current LIBNAME = unichrome_dri.so -MINIGLX_SOURCES = server/via_dri.c - DRIVER_SOURCES = \ via_context.c \ via_fb.c \ -- cgit v1.2.3 From 419f0f9d0426bc1eb40ceb60e7764af4013947a0 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sat, 6 Mar 2010 06:33:21 +0200 Subject: dri: drop MINIGLX_SOURCES (2) --- src/mesa/drivers/dri/i810/server/i810_dri.c | 975 ----------------- src/mesa/drivers/dri/i915/server/intel_dri.c | 1 - src/mesa/drivers/dri/i965/server/intel_dri.c | 1 - src/mesa/drivers/dri/intel/server/intel_dri.c | 1306 ---------------------- src/mesa/drivers/dri/mga/server/mga_dri.c | 1088 ------------------ src/mesa/drivers/dri/r128/server/r128_dri.c | 1112 ------------------- src/mesa/drivers/dri/r200/server/radeon_dri.c | 1 - src/mesa/drivers/dri/r300/server/radeon_dri.c | 1 - src/mesa/drivers/dri/r600/server/radeon_dri.c | 1 - src/mesa/drivers/dri/radeon/server/radeon_dri.c | 1337 ----------------------- src/mesa/drivers/dri/tdfx/server/tdfx_dri.c | 471 -------- src/mesa/drivers/dri/unichrome/server/via_dri.c | 1251 --------------------- 12 files changed, 7545 deletions(-) delete mode 100644 src/mesa/drivers/dri/i810/server/i810_dri.c delete mode 120000 src/mesa/drivers/dri/i915/server/intel_dri.c delete mode 120000 src/mesa/drivers/dri/i965/server/intel_dri.c delete mode 100644 src/mesa/drivers/dri/intel/server/intel_dri.c delete mode 100644 src/mesa/drivers/dri/mga/server/mga_dri.c delete mode 100644 src/mesa/drivers/dri/r128/server/r128_dri.c delete mode 120000 src/mesa/drivers/dri/r200/server/radeon_dri.c delete mode 120000 src/mesa/drivers/dri/r300/server/radeon_dri.c delete mode 120000 src/mesa/drivers/dri/r600/server/radeon_dri.c delete mode 100644 src/mesa/drivers/dri/radeon/server/radeon_dri.c delete mode 100644 src/mesa/drivers/dri/tdfx/server/tdfx_dri.c delete mode 100644 src/mesa/drivers/dri/unichrome/server/via_dri.c (limited to 'src') diff --git a/src/mesa/drivers/dri/i810/server/i810_dri.c b/src/mesa/drivers/dri/i810/server/i810_dri.c deleted file mode 100644 index f52797c5ed..0000000000 --- a/src/mesa/drivers/dri/i810/server/i810_dri.c +++ /dev/null @@ -1,975 +0,0 @@ -/** - * \file server/i810_dri.c - * \brief File to perform the device-specific initialization tasks typically - * done in the X server. - * - * Here they are converted to run in the client (or perhaps a standalone - * process), and to work with the frame buffer device rather than the X - * server infrastructure. - * - * Copyright (C) 2004 Dave Airlie (airlied@linux.ie) - */ - -#include -#include -#include -#include -#include - -#include "driver.h" -#include "drm.h" - -#include "i810.h" -#include "i810_dri.h" -#include "i810_reg.h" - - -static int i810_pitches[] = { - 512, - 1024, - 2048, - 4096, - 0 -}; - -static int i810_pitch_flags[] = { - 0x0, - 0x1, - 0x2, - 0x3, - 0 -}; - -static unsigned int i810_drm_version = 0; - -static int -I810AllocLow(I810MemRange * result, I810MemRange * pool, int size) -{ - if (size > pool->Size) - return 0; - - pool->Size -= size; - result->Size = size; - result->Start = pool->Start; - result->End = pool->Start += size; - - return 1; -} - -static int -I810AllocHigh(I810MemRange * result, I810MemRange * pool, int size) -{ - if (size > pool->Size) - return 0; - - pool->Size -= size; - result->Size = size; - result->End = pool->End; - result->Start = pool->End -= size; - - return 1; -} - - -/** - * \brief Wait for free FIFO entries. - * - * \param ctx display handle. - * \param entries number of free entries to wait. - * - * It polls the free entries from the chip until it reaches the requested value - * or a timeout (3000 tries) occurs. Aborts the program if the FIFO times out. - */ -static void I810WaitForFifo( const DRIDriverContext *ctx, - int entries ) -{ -} - -/** - * \brief Reset graphics card to known state. - * - * \param ctx display handle. - * - * Resets the values of several I810 registers. - */ -static void I810EngineReset( const DRIDriverContext *ctx ) -{ - unsigned char *I810MMIO = ctx->MMIOAddress; -} - -/** - * \brief Restore the drawing engine. - * - * \param ctx display handle - * - * Resets the graphics card and sets initial values for several registers of - * the card's drawing engine. - * - * Turns on the i810 command processor engine (i.e., the ringbuffer). - */ -static int I810EngineRestore( const DRIDriverContext *ctx ) -{ - I810Ptr info = ctx->driverPrivate; - unsigned char *I810MMIO = ctx->MMIOAddress; - - fprintf(stderr, "%s\n", __FUNCTION__); - - return 1; -} - - -/** - * \brief Shutdown the drawing engine. - * - * \param ctx display handle - * - * Turns off the command processor engine & restores the graphics card - * to a state that fbdev understands. - */ -static int I810EngineShutdown( const DRIDriverContext *ctx ) -{ - drmI810Init info; - int ret; - - memset(&info, 0, sizeof(drmI810Init)); - info.func = I810_CLEANUP_DMA; - - ret = drmCommandWrite(ctx->drmFD, DRM_I810_INIT, &info, sizeof(drmI810Init)); - if (ret>0) - { - fprintf(stderr,"[dri] I810 DMA Cleanup failed\n"); - return -errno; - } - return 0; -} - -/** - * \brief Compute base 2 logarithm. - * - * \param val value. - * - * \return base 2 logarithm of \p val. - */ -static int I810MinBits(int val) -{ - int bits; - - if (!val) return 1; - for (bits = 0; val; val >>= 1, ++bits); - return bits; -} - -static int I810DRIAgpPreInit( const DRIDriverContext *ctx, I810Ptr info) -{ - - if (drmAgpAcquire(ctx->drmFD) < 0) { - fprintf(stderr, "[gart] AGP not available\n"); - return 0; - } - - - if (drmAgpEnable(ctx->drmFD, 0) < 0) { - fprintf(stderr, "[gart] AGP not enabled\n"); - drmAgpRelease(ctx->drmFD); - return 0; - } -} - -/** - * \brief Initialize the AGP state - * - * \param ctx display handle. - * \param info driver private data. - * - * \return one on success, or zero on failure. - * - * Acquires and enables the AGP device. Reserves memory in the AGP space for - * the ring buffer, vertex buffers and textures. Initialize the I810 - * registers to point to that memory and add client mappings. - */ -static int I810DRIAgpInit( const DRIDriverContext *ctx, I810Ptr info) -{ - unsigned char *I810MMIO = ctx->MMIOAddress; - int ret; - int s, l; - unsigned long dcacheHandle; - unsigned long agpHandle; - int pitch_idx = 0; - int back_size = 0; - int sysmem_size = 0; - int width = ctx->shared.virtualWidth * ctx->cpp; - - - info->backHandle = DRM_AGP_NO_HANDLE; - info->zHandle = DRM_AGP_NO_HANDLE; - info->sysmemHandle = DRM_AGP_NO_HANDLE; - info->dcacheHandle = DRM_AGP_NO_HANDLE; - - memset(&info->DcacheMem, 0, sizeof(I810MemRange)); - memset(&info->BackBuffer, 0, sizeof(I810MemRange)); - memset(&info->DepthBuffer, 0, sizeof(I810MemRange)); - - drmAgpAlloc(ctx->drmFD, 4096 * 1024, 1, NULL, &dcacheHandle); - info->dcacheHandle = dcacheHandle; - - fprintf(stderr, "[agp] dcacheHandle : 0x%x\n", dcacheHandle); - -#define Elements(x) sizeof(x)/sizeof(*x) - for (pitch_idx = 0; pitch_idx < Elements(i810_pitches); pitch_idx++) - if (width <= i810_pitches[pitch_idx]) - break; - - if (pitch_idx == Elements(i810_pitches)) { - fprintf(stderr,"[dri] Couldn't find depth/back buffer pitch\n"); - exit(-1); - } - else - { - int lines = (ctx->shared.virtualWidth + 15) / 16 * 16; - back_size = i810_pitches[pitch_idx] * lines; - back_size = ((back_size + 4096 - 1) / 4096) * 4096; - } - - sysmem_size = ctx->shared.fbSize; - fprintf(stderr,"sysmem_size is %lu back_size is %lu\n", sysmem_size, back_size); - if (dcacheHandle != DRM_AGP_NO_HANDLE) { - if (back_size > 4 * 1024 * 1024) { - fprintf(stderr,"[dri] Backsize is larger then 4 meg\n"); - sysmem_size = sysmem_size - 2 * back_size; - drmAgpFree(ctx->drmFD, dcacheHandle); - info->dcacheHandle = dcacheHandle = DRM_AGP_NO_HANDLE; - } else { - sysmem_size = sysmem_size - back_size; - } - } else { - sysmem_size = sysmem_size - 2 * back_size; - } - - info->SysMem.Start=0; - info->SysMem.Size = sysmem_size; - info->SysMem.End = sysmem_size; - - if (dcacheHandle != DRM_AGP_NO_HANDLE) { - if (drmAgpBind(ctx->drmFD, dcacheHandle, info->DepthOffset) == 0) { - memset(&info->DcacheMem, 0, sizeof(I810MemRange)); - fprintf(stderr,"[agp] GART: Found 4096K Z buffer memory\n"); - info->DcacheMem.Start = info->DepthOffset; - info->DcacheMem.Size = 1024 * 4096; - info->DcacheMem.End = info->DcacheMem.Start + info->DcacheMem.Size; - } else { - fprintf(stderr, "[agp] GART: dcache bind failed\n"); - drmAgpFree(ctx->drmFD, dcacheHandle); - info->dcacheHandle = dcacheHandle = DRM_AGP_NO_HANDLE; - } - } else { - fprintf(stderr, "[agp] GART: no dcache memory found\n"); - } - - drmAgpAlloc(ctx->drmFD, back_size, 0, NULL, &agpHandle); - info->backHandle = agpHandle; - - if (agpHandle != DRM_AGP_NO_HANDLE) { - if (drmAgpBind(ctx->drmFD, agpHandle, info->BackOffset) == 0) { - fprintf(stderr, "[agp] Bound backbuffer memory\n"); - - info->BackBuffer.Start = info->BackOffset; - info->BackBuffer.Size = back_size; - info->BackBuffer.End = (info->BackBuffer.Start + - info->BackBuffer.Size); - } else { - fprintf(stderr,"[agp] Unable to bind backbuffer. Disabling DRI.\n"); - return 0; - } - } else { - fprintf(stderr, "[dri] Unable to allocate backbuffer memory. Disabling DRI.\n"); - return 0; - } - - if (dcacheHandle == DRM_AGP_NO_HANDLE) { - drmAgpAlloc(ctx->drmFD, back_size, 0, NULL, &agpHandle); - - info->zHandle = agpHandle; - - if (agpHandle != DRM_AGP_NO_HANDLE) { - if (drmAgpBind(ctx->drmFD, agpHandle, info->DepthOffset) == 0) { - fprintf(stderr,"[agp] Bound depthbuffer memory\n"); - info->DepthBuffer.Start = info->DepthOffset; - info->DepthBuffer.Size = back_size; - info->DepthBuffer.End = (info->DepthBuffer.Start + - info->DepthBuffer.Size); - } else { - fprintf(stderr,"[agp] Unable to bind depthbuffer. Disabling DRI.\n"); - return 0; - } - } else { - fprintf(stderr,"[agp] Unable to allocate depthbuffer memory. Disabling DRI.\n"); - return 0; - } - } - - /* Now allocate and bind the agp space. This memory will include the - * regular framebuffer as well as texture memory. - */ - drmAgpAlloc(ctx->drmFD, sysmem_size, 0, NULL, &agpHandle); - info->sysmemHandle = agpHandle; - - if (agpHandle != DRM_AGP_NO_HANDLE) { - if (drmAgpBind(ctx->drmFD, agpHandle, 0) == 0) { - fprintf(stderr, "[agp] Bound System Texture Memory\n"); - } else { - fprintf(stderr, "[agp] Unable to bind system texture memory. Disabling DRI.\n"); - return 0; - } - } else { - fprintf(stderr, "[agp] Unable to allocate system texture memory. Disabling DRI.\n"); - return 0; - } - - info->auxPitch = i810_pitches[pitch_idx]; - info->auxPitchBits = i810_pitch_flags[pitch_idx]; - - return 1; -} - - -/** - * \brief Initialize the kernel data structures and enable the CP engine. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * This function is a wrapper around the DRM_I810_CP_INIT command, passing - * all the parameters in a drmI810Init structure. - */ -static int I810DRIKernelInit( const DRIDriverContext *ctx, - I810Ptr info) -{ - int cpp = ctx->bpp / 8; - drmI810Init drmInfo; - int ret; - I810RingBuffer *ring = &(info->LpRing); - - /* This is the struct passed to the kernel module for its initialization */ - memset(&drmInfo, 0, sizeof(drmI810Init)); - - /* make sure we have at least 1.4 */ - drmInfo.func = I810_INIT_DMA_1_4; - - drmInfo.ring_start = ring->mem.Start; - drmInfo.ring_end = ring->mem.End; - drmInfo.ring_size = ring->mem.Size; - - drmInfo.mmio_offset = (unsigned int)info->regs; - drmInfo.buffers_offset = (unsigned int)info->buffer_map; - drmInfo.sarea_priv_offset = sizeof(drm_sarea_t); - - drmInfo.front_offset = 0; - drmInfo.back_offset = info->BackBuffer.Start; - drmInfo.depth_offset = info->DepthBuffer.Start; - - drmInfo.w = ctx->shared.virtualWidth; - drmInfo.h = ctx->shared.virtualHeight; - drmInfo.pitch = info->auxPitch; - drmInfo.pitch_bits = info->auxPitchBits; - - - ret = drmCommandWrite(ctx->drmFD, DRM_I810_INIT, &drmInfo, - sizeof(drmI810Init)); - - return ret >= 0; -} - - -/** - * \brief Add a map for the vertex buffers that will be accessed by any - * DRI-based clients. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return one on success, or zero on failure. - * - * Calls drmAddBufs() with the previously allocated vertex buffers. - */ -static int I810DRIBufInit( const DRIDriverContext *ctx, I810Ptr info ) -{ - /* Initialize vertex buffers */ - info->bufNumBufs = drmAddBufs(ctx->drmFD, - I810_DMA_BUF_NR, - I810_DMA_BUF_SZ, - DRM_AGP_BUFFER, - info->BufferMem.Start); - - if (info->bufNumBufs <= 0) { - fprintf(stderr, - "[drm] Could not create vertex/indirect buffers list\n"); - return 0; - } - fprintf(stderr, - "[drm] Added %d %d byte vertex/indirect buffers\n", - info->bufNumBufs, I810_DMA_BUF_SZ); - - return 1; -} - -/** - * \brief Install an IRQ handler. - * - * \param ctx display handle. - * \param info driver private data. - * - * Attempts to install an IRQ handler via drmCtlInstHandler(), falling back to - * IRQ-free operation on failure. - */ -static void I810DRIIrqInit(const DRIDriverContext *ctx, - I810Ptr info) -{ - if (!info->irq) { - info->irq = drmGetInterruptFromBusID(ctx->drmFD, - ctx->pciBus, - ctx->pciDevice, - ctx->pciFunc); - - if ((drmCtlInstHandler(ctx->drmFD, info->irq)) != 0) { - fprintf(stderr, - "[drm] failure adding irq handler, " - "there is a device already using that irq\n" - "[drm] falling back to irq-free operation\n"); - info->irq = 0; - } - } - - if (info->irq) - fprintf(stderr, - "[drm] dma control initialized, using IRQ %d\n", - info->irq); -} - -static int I810CheckDRMVersion( const DRIDriverContext *ctx, - I810Ptr info ) -{ - drmVersionPtr version; - - version = drmGetVersion(ctx->drmFD); - if (version) { - int req_minor, req_patch; - - req_minor = 4; - req_patch = 0; - - i810_drm_version = (version->version_major<<16) | version->version_minor; - if (version->version_major != 1 || - version->version_minor < req_minor || - (version->version_minor == req_minor && - version->version_patchlevel < req_patch)) { - /* Incompatible drm version */ - fprintf(stderr, - "[dri] I810DRIScreenInit failed because of a version " - "mismatch.\n" - "[dri] i810.o kernel module version is %d.%d.%d " - "but version 1.%d.%d or newer is needed.\n" - "[dri] Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel, - req_minor, - req_patch); - drmFreeVersion(version); - return 0; - } - - info->drmMinor = version->version_minor; - drmFreeVersion(version); - } - - return 1; -} - -static int I810MemoryInit( const DRIDriverContext *ctx, I810Ptr info ) -{ - int width_bytes = ctx->shared.virtualWidth * ctx->cpp; - int cpp = ctx->cpp; - int bufferSize = (ctx->shared.virtualHeight * width_bytes); - int depthSize = (((ctx->shared.virtualHeight+15) & ~15) * width_bytes); - int l; - - if (drmAddMap(ctx->drmFD, (drm_handle_t) info->BackBuffer.Start, - info->BackBuffer.Size, DRM_AGP, 0, - &info->backbuffer) < 0) { - fprintf(stderr, "[drm] drmAddMap(backbuffer) failed. Disabling DRI\n"); - return 0; - } - - if (drmAddMap(ctx->drmFD, (drm_handle_t) info->DepthBuffer.Start, - info->DepthBuffer.Size, DRM_AGP, 0, - &info->depthbuffer) < 0) { - fprintf(stderr, "[drm] drmAddMap(depthbuffer) failed. Disabling DRI.\n"); - return 0; - } - - if (!I810AllocLow(&(info->FrontBuffer), &(info->SysMem), (((ctx->shared.virtualHeight * width_bytes) + 4095) & ~4095))) - { - fprintf(stderr,"Framebuffer allocation failed\n"); - return 0; - } - else - fprintf(stderr,"Frame buffer at 0x%.8x (%luk, %lu bytes)\n", - info->FrontBuffer.Start, - info->FrontBuffer.Size / 1024, info->FrontBuffer.Size); - - memset(&(info->LpRing), 0, sizeof(I810RingBuffer)); - if (I810AllocLow(&(info->LpRing.mem), &(info->SysMem), 16 * 4096)) { - fprintf(stderr, - "Ring buffer at 0x%.8x (%luk, %lu bytes)\n", - info->LpRing.mem.Start, - info->LpRing.mem.Size / 1024, info->LpRing.mem.Size); - - info->LpRing.tail_mask = info->LpRing.mem.Size - 1; - info->LpRing.virtual_start = info->LpRing.mem.Start; - info->LpRing.head = 0; - info->LpRing.tail = 0; - info->LpRing.space = 0; - } else { - fprintf(stderr, "Ring buffer allocation failed\n"); - return (0); - } - - /* Allocate buffer memory */ - I810AllocHigh(&(info->BufferMem), &(info->SysMem), - I810_DMA_BUF_NR * I810_DMA_BUF_SZ); - - - fprintf(stderr, "[dri] Buffer map : %lx\n", - info->BufferMem.Start); - - if (info->BufferMem.Start == 0 || - info->BufferMem.End - info->BufferMem.Start > - I810_DMA_BUF_NR * I810_DMA_BUF_SZ) { - fprintf(stderr,"[dri] Not enough memory for dma buffers. Disabling DRI.\n"); - return 0; - } - - if (drmAddMap(ctx->drmFD, (drm_handle_t) info->BufferMem.Start, - info->BufferMem.Size, DRM_AGP, 0, &info->buffer_map) < 0) { - fprintf(stderr, "[drm] drmAddMap(buffer_map) failed. Disabling DRI.\n"); - return 0; - } - - if (drmAddMap(ctx->drmFD, (drm_handle_t) info->LpRing.mem.Start, - info->LpRing.mem.Size, DRM_AGP, 0, &info->ring_map) < 0) { - fprintf(stderr, "[drm] drmAddMap(ring_map) failed. Disabling DRI. \n"); - return 0; - } - - /* Front, back and depth buffers - everything else texture?? - */ - info->textureSize = info->SysMem.Size; - - if (info->textureSize < 0) - return 0; - - - l = I810MinBits((info->textureSize-1) / I810_NR_TEX_REGIONS); - if (l < I810_LOG_MIN_TEX_REGION_SIZE) l = I810_LOG_MIN_TEX_REGION_SIZE; - - /* Round the texture size up to the nearest whole number of - * texture regions. Again, be greedy about this, don't - * round down. - */ - info->logTextureGranularity = l; - info->textureSize = (info->textureSize >> l) << l; - - /* Set a minimum usable local texture heap size. This will fit - * two 256x256x32bpp textures. - */ - if (info->textureSize < 512 * 1024) { - info->textureOffset = 0; - info->textureSize = 0; - } - - I810AllocLow(&(info->TexMem), &(info->SysMem), info->textureSize); - - if (drmAddMap(ctx->drmFD, (drm_handle_t) info->TexMem.Start, - info->TexMem.Size, DRM_AGP, 0, &info->textures) < 0) { - fprintf(stderr, - "[drm] drmAddMap(textures) failed. Disabling DRI.\n"); - return 0; - } - - /* Reserve space for textures */ - fprintf(stderr, - "Will use back buffer at offset 0x%x\n", - info->BackOffset); - fprintf(stderr, - "Will use depth buffer at offset 0x%x\n", - info->DepthOffset); - fprintf(stderr, - "Will use %d kb for textures at offset 0x%x\n", - info->TexMem.Size/1024, info->TexMem.Start); - - return 1; -} - - - -/** - * Called at the start of each server generation. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * Performs static frame buffer allocation. Opens the DRM device and add maps - * to the SAREA, framebuffer and MMIO regions. Fills in \p info with more - * information. Creates a \e server context to grab the lock for the - * initialization ioctls and calls the other initilization functions in this - * file. Starts the CP engine via the DRM_I810_CP_START command. - * - * Setups a I810DRIRec structure to be passed to i810_dri.so for its - * initialization. - */ -static int I810ScreenInit( DRIDriverContext *ctx, I810Ptr info ) -{ - I810DRIPtr pI810DRI; - int err; - - usleep(100); - /*assert(!ctx->IsClient);*/ - - /* from XFree86 driver */ - info->DepthOffset = 0x3000000; - info->BackOffset = 0x3800000; - { - int width_bytes = (ctx->shared.virtualWidth * ctx->cpp); - int maxy = ctx->shared.fbSize / width_bytes; - - - if (maxy <= ctx->shared.virtualHeight * 3) { - fprintf(stderr, - "Static buffer allocation failed -- " - "need at least %d kB video memory (have %d kB)\n", - (ctx->shared.virtualWidth * ctx->shared.virtualHeight * - ctx->cpp * 3 + 1023) / 1024, - ctx->shared.fbSize / 1024); - return 0; - } - } - - - info->regsSize = ctx->MMIOSize; - ctx->shared.SAREASize = 0x2000; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - ctx->drmFD = drmOpen("i810", NULL ); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) { - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - ctx->drmFD, ctx->pciBusID, strerror(-err)); - return 0; - } - - if (drmAddMap( ctx->drmFD, - 0, - ctx->shared.SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &ctx->shared.hSAREA) < 0) - { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - ctx->shared.SAREASize, ctx->shared.hSAREA); - - if (drmMap( ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); - - if (drmAddMap(ctx->drmFD, - ctx->MMIOStart, - ctx->MMIOSize, - DRM_REGISTERS, - DRM_READ_ONLY, - &info->regs) < 0) { - fprintf(stderr, "[drm] drmAddMap mmio failed\n"); - return 0; - } - fprintf(stderr, - "[drm] register handle = 0x%08x\n", info->regs); - - I810DRIAgpPreInit(ctx, info); - /* Need to AddMap the framebuffer and mmio regions here: - */ - if (drmAddMap( ctx->drmFD, - (drm_handle_t)ctx->FBStart, - ctx->FBSize, - DRM_FRAME_BUFFER, -#ifndef _EMBEDDED - 0, -#else - DRM_READ_ONLY, -#endif - &ctx->shared.hFrameBuffer) < 0) - { - fprintf(stderr, "[drm] drmAddMap framebuffer failed\n"); - return 0; - } - - fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n", - ctx->shared.hFrameBuffer); - - /* Check the i810 DRM version */ - if (!I810CheckDRMVersion(ctx, info)) { - return 0; - } - - /* Initialize AGP */ - if (!I810DRIAgpInit(ctx, info)) { - return 0; - } - - - /* Memory manager setup */ - if (!I810MemoryInit(ctx, info)) { - return 0; - } - - /* Initialize the SAREA private data structure */ - { - I810SAREAPtr pSAREAPriv; - pSAREAPriv = (I810SAREAPtr)(((char*)ctx->pSAREA) + - sizeof(drm_sarea_t)); - memset(pSAREAPriv, 0, sizeof(*pSAREAPriv)); - // pSAREAPriv->pf_enabled=1; - } - - - /* Create a 'server' context so we can grab the lock for - * initialization ioctls. - */ - if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); - - /* Initialize the vertex buffers list */ - if (!I810DRIBufInit(ctx, info)) { - fprintf(stderr, "I810DRIBufInit failed\n"); - DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext); - return 0; - } - - /* Initialize the kernel data structures */ - if (!I810DRIKernelInit(ctx, info)) { - fprintf(stderr, "I810DRIKernelInit failed\n"); - DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext); - return 0; - } - - /* Initialize IRQ */ - I810DRIIrqInit(ctx, info); - - /* Quick hack to clear the front & back buffers. Could also use - * the clear ioctl to do this, but would need to setup hw state - * first. - */ -#if 0 - memset((char *)ctx->FBAddress, - 0, - info->auxPitch * ctx->cpp * ctx->shared.virtualHeight ); - - memset((char *)info->backbuffer, - 0, - info->auxPitch * ctx->cpp * ctx->shared.virtualHeight ); -#endif - - /* This is the struct passed to i810_dri.so for its initialization */ - ctx->driverClientMsg = malloc(sizeof(I810DRIRec)); - ctx->driverClientMsgSize = sizeof(I810DRIRec); - pI810DRI = (I810DRIPtr)ctx->driverClientMsg; - - pI810DRI->regs = info->regs; - pI810DRI->regsSize = info->regsSize; - // regsMap is unused - - pI810DRI->backbufferSize = info->BackBuffer.Size; - pI810DRI->backbuffer = info->backbuffer; - - pI810DRI->depthbufferSize = info->DepthBuffer.Size; - pI810DRI->depthbuffer = info->depthbuffer; - - pI810DRI->textures = info->textures; - pI810DRI->textureSize = info->textureSize; - - pI810DRI->agp_buffers = info->buffer_map; - pI810DRI->agp_buf_size = info->BufferMem.Size; - - pI810DRI->deviceID = info->Chipset; - pI810DRI->width = ctx->shared.virtualWidth; - pI810DRI->height = ctx->shared.virtualHeight; - pI810DRI->mem = ctx->shared.fbSize; - pI810DRI->cpp = ctx->bpp / 8; - pI810DRI->bitsPerPixel = ctx->bpp; - pI810DRI->fbOffset = info->FrontBuffer.Start; - pI810DRI->fbStride = info->auxPitch; - - pI810DRI->backOffset = info->BackBuffer.Start; - pI810DRI->depthOffset = info->DepthBuffer.Start; - - pI810DRI->auxPitch = info->auxPitch; - pI810DRI->auxPitchBits = info->auxPitchBits; - - pI810DRI->logTextureGranularity = info->logTextureGranularity; - pI810DRI->textureOffset = info->TexMem.Start; - - pI810DRI->ringOffset = info->LpRing.mem.Start; - pI810DRI->ringSize = info->LpRing.mem.Size; - - // drmBufs looks unused - pI810DRI->irq = info->irq; - pI810DRI->sarea_priv_offset = sizeof(drm_sarea_t); - - /* Don't release the lock now - let the VT switch handler do it. */ - return 1; -} - - -/** - * \brief Validate the fbdev mode. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Saves some registers and returns 1. - * - * \sa i810ValidateMode(). - */ -static int i810ValidateMode( const DRIDriverContext *ctx ) -{ - unsigned char *I810MMIO = ctx->MMIOAddress; - I810Ptr info = ctx->driverPrivate; - - return 1; -} - - -/** - * \brief Examine mode returned by fbdev. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Restores registers that fbdev has clobbered and returns 1. - * - * \sa i810ValidateMode(). - */ -static int i810PostValidateMode( const DRIDriverContext *ctx ) -{ - unsigned char *I810MMIO = ctx->MMIOAddress; - I810Ptr info = ctx->driverPrivate; - - return 1; -} - - -/** - * \brief Initialize the framebuffer device mode - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Fills in \p info with some default values and some information from \p ctx - * and then calls I810ScreenInit() for the screen initialization. - * - * Before exiting clears the framebuffer memory accessing it directly. - */ -static int i810InitFBDev( DRIDriverContext *ctx ) -{ - I810Ptr info = calloc(1, sizeof(*info)); - - { - int dummy = ctx->shared.virtualWidth; - - switch (ctx->bpp / 8) { - case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; - case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break; - case 3: - case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break; - } - - ctx->shared.virtualWidth = dummy; - } - - ctx->driverPrivate = (void *)info; - - info->Chipset = ctx->chipset; - - if (!I810ScreenInit( ctx, info )) - return 0; - - - return 1; -} - - -/** - * \brief The screen is being closed, so clean up any state and free any - * resources used by the DRI. - * - * \param ctx display handle. - * - * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver - * private data. - */ -static void i810HaltFBDev( DRIDriverContext *ctx ) -{ - drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); - drmClose(ctx->drmFD); - - if (ctx->driverPrivate) { - free(ctx->driverPrivate); - ctx->driverPrivate = 0; - } -} - - -extern void i810NotifyFocus( int ); - -/** - * \brief Exported driver interface for Mini GLX. - * - * \sa DRIDriverRec. - */ -const struct DRIDriverRec __driDriver = { - i810ValidateMode, - i810PostValidateMode, - i810InitFBDev, - i810HaltFBDev, - I810EngineShutdown, - I810EngineRestore, -#ifndef _EMBEDDED - 0, -#else - i810NotifyFocus, -#endif -}; diff --git a/src/mesa/drivers/dri/i915/server/intel_dri.c b/src/mesa/drivers/dri/i915/server/intel_dri.c deleted file mode 120000 index effdd26448..0000000000 --- a/src/mesa/drivers/dri/i915/server/intel_dri.c +++ /dev/null @@ -1 +0,0 @@ -../../intel/server/intel_dri.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/server/intel_dri.c b/src/mesa/drivers/dri/i965/server/intel_dri.c deleted file mode 120000 index effdd26448..0000000000 --- a/src/mesa/drivers/dri/i965/server/intel_dri.c +++ /dev/null @@ -1 +0,0 @@ -../../intel/server/intel_dri.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/server/intel_dri.c b/src/mesa/drivers/dri/intel/server/intel_dri.c deleted file mode 100644 index e49c4214ad..0000000000 --- a/src/mesa/drivers/dri/intel/server/intel_dri.c +++ /dev/null @@ -1,1306 +0,0 @@ -/** - * \file server/intel_dri.c - * \brief File to perform the device-specific initialization tasks typically - * done in the X server. - * - * Here they are converted to run in the client (or perhaps a standalone - * process), and to work with the frame buffer device rather than the X - * server infrastructure. - * - * Copyright (C) 2006 Dave Airlie (airlied@linux.ie) - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sub license, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice (including the - next paragraph) shall be included in all copies or substantial portions - of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR - ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include -#include -#include - -#include "driver.h" -#include "drm.h" - -#include "intel.h" -#include "i830_dri.h" - -#include "memops.h" -#include "pciaccess.h" - -static size_t drm_page_size; -static int nextTile = 0; -#define xf86DrvMsg(...) do {} while(0) - -static const int pitches[] = { - 128 * 8, - 128 * 16, - 128 * 32, - 128 * 64, - 0 -}; - -static Bool I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea); - -static unsigned long -GetBestTileAlignment(unsigned long size) -{ - unsigned long i; - - for (i = KB(512); i < size; i <<= 1) - ; - - if (i > MB(64)) - i = MB(64); - - return i; -} - -static void SetFenceRegs(const DRIDriverContext *ctx, I830Rec *pI830) -{ - int i; - unsigned char *MMIO = ctx->MMIOAddress; - - for (i = 0; i < 8; i++) { - OUTREG(FENCE + i * 4, pI830->Fence[i]); - // if (I810_DEBUG & DEBUG_VERBOSE_VGA) - fprintf(stderr,"Fence Register : %x\n", pI830->Fence[i]); - } -} - -/* Tiled memory is good... really, really good... - * - * Need to make it less likely that we miss out on this - probably - * need to move the frontbuffer away from the 'guarenteed' alignment - * of the first memory segment, or perhaps allocate a discontigous - * framebuffer to get more alignment 'sweet spots'. - */ -static void -SetFence(const DRIDriverContext *ctx, I830Rec *pI830, - int nr, unsigned int start, unsigned int pitch, - unsigned int size) -{ - unsigned int val; - unsigned int fence_mask = 0; - unsigned int fence_pitch; - - if (nr < 0 || nr > 7) { - fprintf(stderr, - "SetFence: fence %d out of range\n",nr); - return; - } - - pI830->Fence[nr] = 0; - - if (IS_I9XX(pI830)) - fence_mask = ~I915G_FENCE_START_MASK; - else - fence_mask = ~I830_FENCE_START_MASK; - - if (start & fence_mask) { - fprintf(stderr, - "SetFence: %d: start (0x%08x) is not %s aligned\n", - nr, start, (IS_I9XX(pI830)) ? "1MB" : "512k"); - return; - } - - if (start % size) { - fprintf(stderr, - "SetFence: %d: start (0x%08x) is not size (%dk) aligned\n", - nr, start, size / 1024); - return; - } - - if (pitch & 127) { - fprintf(stderr, - "SetFence: %d: pitch (%d) not a multiple of 128 bytes\n", - nr, pitch); - return; - } - - val = (start | FENCE_X_MAJOR | FENCE_VALID); - - if (IS_I9XX(pI830)) { - switch (size) { - case MB(1): - val |= I915G_FENCE_SIZE_1M; - break; - case MB(2): - val |= I915G_FENCE_SIZE_2M; - break; - case MB(4): - val |= I915G_FENCE_SIZE_4M; - break; - case MB(8): - val |= I915G_FENCE_SIZE_8M; - break; - case MB(16): - val |= I915G_FENCE_SIZE_16M; - break; - case MB(32): - val |= I915G_FENCE_SIZE_32M; - break; - case MB(64): - val |= I915G_FENCE_SIZE_64M; - break; - default: - fprintf(stderr, - "SetFence: %d: illegal size (%d kByte)\n", nr, size / 1024); - return; - } - } else { - switch (size) { - case KB(512): - val |= FENCE_SIZE_512K; - break; - case MB(1): - val |= FENCE_SIZE_1M; - break; - case MB(2): - val |= FENCE_SIZE_2M; - break; - case MB(4): - val |= FENCE_SIZE_4M; - break; - case MB(8): - val |= FENCE_SIZE_8M; - break; - case MB(16): - val |= FENCE_SIZE_16M; - break; - case MB(32): - val |= FENCE_SIZE_32M; - break; - case MB(64): - val |= FENCE_SIZE_64M; - break; - default: - fprintf(stderr, - "SetFence: %d: illegal size (%d kByte)\n", nr, size / 1024); - return; - } - } - - if (IS_I9XX(pI830)) - fence_pitch = pitch / 512; - else - fence_pitch = pitch / 128; - - switch (fence_pitch) { - case 1: - val |= FENCE_PITCH_1; - break; - case 2: - val |= FENCE_PITCH_2; - break; - case 4: - val |= FENCE_PITCH_4; - break; - case 8: - val |= FENCE_PITCH_8; - break; - case 16: - val |= FENCE_PITCH_16; - break; - case 32: - val |= FENCE_PITCH_32; - break; - case 64: - val |= FENCE_PITCH_64; - break; - default: - fprintf(stderr, - "SetFence: %d: illegal pitch (%d)\n", nr, pitch); - return; - } - - pI830->Fence[nr] = val; -} - -static Bool -MakeTiles(const DRIDriverContext *ctx, I830Rec *pI830, I830MemRange *pMem) -{ - int pitch, ntiles, i; - - pitch = pMem->Pitch * ctx->cpp; - /* - * Simply try to break the region up into at most four pieces of size - * equal to the alignment. - */ - ntiles = ROUND_TO(pMem->Size, pMem->Alignment) / pMem->Alignment; - if (ntiles >= 4) { - return FALSE; - } - - for (i = 0; i < ntiles; i++, nextTile++) { - SetFence(ctx, pI830, nextTile, pMem->Start + i * pMem->Alignment, - pitch, pMem->Alignment); - } - return TRUE; -} - -static void I830SetupMemoryTiling(const DRIDriverContext *ctx, I830Rec *pI830) -{ - int i; - - /* Clear out */ - for (i = 0; i < 8; i++) - pI830->Fence[i] = 0; - - nextTile = 0; - - if (pI830->BackBuffer.Alignment >= KB(512)) { - if (MakeTiles(ctx, pI830, &(pI830->BackBuffer))) { - fprintf(stderr, - "Activating tiled memory for the back buffer.\n"); - } else { - fprintf(stderr, - "MakeTiles failed for the back buffer.\n"); - pI830->allowPageFlip = FALSE; - } - } - - if (pI830->DepthBuffer.Alignment >= KB(512)) { - if (MakeTiles(ctx, pI830, &(pI830->DepthBuffer))) { - fprintf(stderr, - "Activating tiled memory for the depth buffer.\n"); - } else { - fprintf(stderr, - "MakeTiles failed for the depth buffer.\n"); - } - } - - return; -} - -static int I830DetectMemory(const DRIDriverContext *ctx, I830Rec *pI830) -{ - struct pci_device host_bridge, ig_dev; - uint32_t gmch_ctrl; - int memsize = 0; - int range; - uint32_t aper_size; - uint32_t membase2 = 0; - - memset(&host_bridge, 0, sizeof(host_bridge)); - memset(&ig_dev, 0, sizeof(ig_dev)); - - ig_dev.dev = 2; - - pci_device_cfg_read_u32(&host_bridge, &gmch_ctrl, I830_GMCH_CTRL); - - if (IS_I830(pI830) || IS_845G(pI830)) { - if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) { - aper_size = 0x80000000; - } else { - aper_size = 0x40000000; - } - } else { - if (IS_I9XX(pI830)) { - int ret; - ret = pci_device_cfg_read_u32(&ig_dev, &membase2, 0x18); - if (membase2 & 0x08000000) - aper_size = 0x8000000; - else - aper_size = 0x10000000; - - fprintf(stderr,"aper size is %08X %08x %d\n", aper_size, membase2, ret); - } else - aper_size = 0x8000000; - } - - pI830->aper_size = aper_size; - - - /* We need to reduce the stolen size, by the GTT and the popup. - * The GTT varying according the the FbMapSize and the popup is 4KB */ - range = (ctx->shared.fbSize / (1024*1024)) + 4; - - if (IS_I85X(pI830) || IS_I865G(pI830) || IS_I9XX(pI830)) { - switch (gmch_ctrl & I830_GMCH_GMS_MASK) { - case I855_GMCH_GMS_STOLEN_1M: - memsize = MB(1) - KB(range); - break; - case I855_GMCH_GMS_STOLEN_4M: - memsize = MB(4) - KB(range); - break; - case I855_GMCH_GMS_STOLEN_8M: - memsize = MB(8) - KB(range); - break; - case I855_GMCH_GMS_STOLEN_16M: - memsize = MB(16) - KB(range); - break; - case I855_GMCH_GMS_STOLEN_32M: - memsize = MB(32) - KB(range); - break; - case I915G_GMCH_GMS_STOLEN_48M: - if (IS_I9XX(pI830)) - memsize = MB(48) - KB(range); - break; - case I915G_GMCH_GMS_STOLEN_64M: - if (IS_I9XX(pI830)) - memsize = MB(64) - KB(range); - break; - } - } else { - switch (gmch_ctrl & I830_GMCH_GMS_MASK) { - case I830_GMCH_GMS_STOLEN_512: - memsize = KB(512) - KB(range); - break; - case I830_GMCH_GMS_STOLEN_1024: - memsize = MB(1) - KB(range); - break; - case I830_GMCH_GMS_STOLEN_8192: - memsize = MB(8) - KB(range); - break; - case I830_GMCH_GMS_LOCAL: - memsize = 0; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Local memory found, but won't be used.\n"); - break; - } - } - if (memsize > 0) { - fprintf(stderr, - "detected %d kB stolen memory.\n", memsize / 1024); - } else { - fprintf(stderr, - "no video memory detected.\n"); - } - return memsize; -} - -static int AgpInit(const DRIDriverContext *ctx, I830Rec *info) -{ - unsigned long mode = 0x4; - - if (drmAgpAcquire(ctx->drmFD) < 0) { - fprintf(stderr, "[gart] AGP not available\n"); - return 0; - } - - if (drmAgpEnable(ctx->drmFD, mode) < 0) { - fprintf(stderr, "[gart] AGP not enabled\n"); - drmAgpRelease(ctx->drmFD); - return 0; - } - else - fprintf(stderr, "[gart] AGP enabled at %dx\n", ctx->agpmode); - - return 1; -} - -/* - * Allocate memory from the given pool. Grow the pool if needed and if - * possible. - */ -static unsigned long -AllocFromPool(const DRIDriverContext *ctx, I830Rec *pI830, - I830MemRange *result, I830MemPool *pool, - long size, unsigned long alignment, int flags) -{ - long needed, start, end; - - if (!result || !pool || !size) - return 0; - - /* Calculate how much space is needed. */ - if (alignment <= GTT_PAGE_SIZE) - needed = size; - else { - start = ROUND_TO(pool->Free.Start, alignment); - end = ROUND_TO(start + size, alignment); - needed = end - pool->Free.Start; - } - if (needed > pool->Free.Size) { - return 0; - } - - result->Start = ROUND_TO(pool->Free.Start, alignment); - pool->Free.Start += needed; - result->End = pool->Free.Start; - - pool->Free.Size = pool->Free.End - pool->Free.Start; - result->Size = result->End - result->Start; - result->Pool = pool; - result->Alignment = alignment; - return needed; -} - -static unsigned long AllocFromAGP(const DRIDriverContext *ctx, I830Rec *pI830, long size, unsigned long alignment, I830MemRange *result) -{ - unsigned long start, end; - unsigned long newApStart, newApEnd; - int ret; - if (!result || !size) - return 0; - - if (!alignment) - alignment = 4; - - start = ROUND_TO(pI830->MemoryAperture.Start, alignment); - end = ROUND_TO(start + size, alignment); - newApStart = end; - newApEnd = pI830->MemoryAperture.End; - - ret=drmAgpAlloc(ctx->drmFD, size, 0, &(result->Physical), (drm_handle_t *)&(result->Key)); - - if (ret) - { - fprintf(stderr,"drmAgpAlloc failed %d\n", ret); - return 0; - } - pI830->allocatedMemory += size; - pI830->MemoryAperture.Start = newApStart; - pI830->MemoryAperture.End = newApEnd; - pI830->MemoryAperture.Size = newApEnd - newApStart; - // pI830->FreeMemory -= size; - result->Start = start; - result->End = start + size; - result->Size = size; - result->Offset = start; - result->Alignment = alignment; - result->Pool = NULL; - - return size; -} - -unsigned long -I830AllocVidMem(const DRIDriverContext *ctx, I830Rec *pI830, - I830MemRange *result, I830MemPool *pool, long size, - unsigned long alignment, int flags) -{ - unsigned long ret; - - if (!result) - return 0; - - /* Make sure these are initialised. */ - result->Size = 0; - result->Key = -1; - - if (!size) { - return 0; - } - - if (pool->Free.Size < size) { - ret = AllocFromAGP(ctx, pI830, size, alignment, result); - } - else { - ret = AllocFromPool(ctx, pI830, result, pool, size, alignment, flags); - if (ret == 0) - ret = AllocFromAGP(ctx, pI830, size, alignment, result); - } - return ret; -} - -static Bool BindAgpRange(const DRIDriverContext *ctx, I830MemRange *mem) -{ - if (!mem) - return FALSE; - - if (mem->Key == -1) - return TRUE; - - return !drmAgpBind(ctx->drmFD, mem->Key, mem->Offset); -} - -/* simple memory allocation routines needed */ -/* put ring buffer in low memory */ -/* need to allocate front, back, depth buffers aligned correctly, - allocate ring buffer, -*/ - -/* */ -static Bool -I830AllocateMemory(const DRIDriverContext *ctx, I830Rec *pI830) -{ - unsigned long size, ret; - unsigned long lines, lineSize, align; - - /* allocate ring buffer */ - memset(pI830->LpRing, 0, sizeof(I830RingBuffer)); - pI830->LpRing->mem.Key = -1; - - size = PRIMARY_RINGBUFFER_SIZE; - - ret = I830AllocVidMem(ctx, pI830, &pI830->LpRing->mem, &pI830->StolenPool, size, 0x1000, 0); - - if (ret != size) - { - fprintf(stderr,"unable to allocate ring buffer %ld\n", ret); - return FALSE; - } - - pI830->LpRing->tail_mask = pI830->LpRing->mem.Size - 1; - - - /* allocate front buffer */ - memset(&(pI830->FrontBuffer), 0, sizeof(pI830->FrontBuffer)); - pI830->FrontBuffer.Key = -1; - pI830->FrontBuffer.Pitch = ctx->shared.virtualWidth; - - align = KB(512); - - lineSize = ctx->shared.virtualWidth * ctx->cpp; - lines = (ctx->shared.virtualHeight + 15) / 16 * 16; - size = lineSize * lines; - size = ROUND_TO_PAGE(size); - - align = GetBestTileAlignment(size); - - ret = I830AllocVidMem(ctx, pI830, &pI830->FrontBuffer, &pI830->StolenPool, size, align, 0); - if (ret < size) - { - fprintf(stderr,"unable to allocate front buffer %ld\n", ret); - return FALSE; - } - - memset(&(pI830->BackBuffer), 0, sizeof(pI830->BackBuffer)); - pI830->BackBuffer.Key = -1; - pI830->BackBuffer.Pitch = ctx->shared.virtualWidth; - - ret = I830AllocVidMem(ctx, pI830, &pI830->BackBuffer, &pI830->StolenPool, size, align, 0); - if (ret < size) - { - fprintf(stderr,"unable to allocate back buffer %ld\n", ret); - return FALSE; - } - - memset(&(pI830->DepthBuffer), 0, sizeof(pI830->DepthBuffer)); - pI830->DepthBuffer.Key = -1; - pI830->DepthBuffer.Pitch = ctx->shared.virtualWidth; - - ret = I830AllocVidMem(ctx, pI830, &pI830->DepthBuffer, &pI830->StolenPool, size, align, 0); - if (ret < size) - { - fprintf(stderr,"unable to allocate depth buffer %ld\n", ret); - return FALSE; - } - - memset(&(pI830->ContextMem), 0, sizeof(pI830->ContextMem)); - pI830->ContextMem.Key = -1; - size = KB(32); - - ret = I830AllocVidMem(ctx, pI830, &pI830->ContextMem, &pI830->StolenPool, size, align, 0); - if (ret < size) - { - fprintf(stderr,"unable to allocate context buffer %ld\n", ret); - return FALSE; - } - -#if 0 - memset(&(pI830->TexMem), 0, sizeof(pI830->TexMem)); - pI830->TexMem.Key = -1; - - size = 32768 * 1024; - ret = AllocFromAGP(ctx, pI830, size, align, &pI830->TexMem); - if (ret < size) - { - fprintf(stderr,"unable to allocate texture memory %ld\n", ret); - return FALSE; - } -#endif - - return TRUE; -} - -static Bool -I830BindMemory(const DRIDriverContext *ctx, I830Rec *pI830) -{ - if (!BindAgpRange(ctx, &pI830->LpRing->mem)) - return FALSE; - if (!BindAgpRange(ctx, &pI830->FrontBuffer)) - return FALSE; - if (!BindAgpRange(ctx, &pI830->BackBuffer)) - return FALSE; - if (!BindAgpRange(ctx, &pI830->DepthBuffer)) - return FALSE; - if (!BindAgpRange(ctx, &pI830->ContextMem)) - return FALSE; -#if 0 - if (!BindAgpRange(ctx, &pI830->TexMem)) - return FALSE; -#endif - return TRUE; -} - -static void SetupDRIMM(const DRIDriverContext *ctx, I830Rec *pI830) -{ - unsigned long aperEnd = ROUND_DOWN_TO(pI830->aper_size, GTT_PAGE_SIZE) / GTT_PAGE_SIZE; - unsigned long aperStart = ROUND_TO(pI830->aper_size - KB(32768), GTT_PAGE_SIZE) / GTT_PAGE_SIZE; - - fprintf(stderr, "aper size is %08X\n", ctx->shared.fbSize); - if (drmMMInit(ctx->drmFD, aperStart, aperEnd - aperStart, DRM_BO_MEM_TT)) { - fprintf(stderr, - "DRM MM Initialization Failed\n"); - } else { - fprintf(stderr, - "DRM MM Initialized at offset 0x%lx length %d page\n", aperStart, aperEnd-aperStart); - } - -} - -static Bool -I830CleanupDma(const DRIDriverContext *ctx) -{ - drmI830Init info; - - memset(&info, 0, sizeof(drmI830Init)); - info.func = I830_CLEANUP_DMA; - - if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT, - &info, sizeof(drmI830Init))) { - fprintf(stderr, "I830 Dma Cleanup Failed\n"); - return FALSE; - } - - return TRUE; -} - -static Bool -I830InitDma(const DRIDriverContext *ctx, I830Rec *pI830) -{ - I830RingBuffer *ring = pI830->LpRing; - drmI830Init info; - - memset(&info, 0, sizeof(drmI830Init)); - info.func = I830_INIT_DMA; - - info.ring_start = ring->mem.Start + pI830->LinearAddr; - info.ring_end = ring->mem.End + pI830->LinearAddr; - info.ring_size = ring->mem.Size; - - info.mmio_offset = (unsigned int)ctx->MMIOStart; - - info.sarea_priv_offset = sizeof(drm_sarea_t); - - info.front_offset = pI830->FrontBuffer.Start; - info.back_offset = pI830->BackBuffer.Start; - info.depth_offset = pI830->DepthBuffer.Start; - info.w = ctx->shared.virtualWidth; - info.h = ctx->shared.virtualHeight; - info.pitch = ctx->shared.virtualWidth; - info.back_pitch = pI830->BackBuffer.Pitch; - info.depth_pitch = pI830->DepthBuffer.Pitch; - info.cpp = ctx->cpp; - - if (drmCommandWrite(ctx->drmFD, DRM_I830_INIT, - &info, sizeof(drmI830Init))) { - fprintf(stderr, - "I830 Dma Initialization Failed\n"); - return FALSE; - } - - return TRUE; -} - -static int I830CheckDRMVersion( const DRIDriverContext *ctx, - I830Rec *pI830 ) -{ - drmVersionPtr version; - - version = drmGetVersion(ctx->drmFD); - - if (version) { - int req_minor, req_patch; - - req_minor = 4; - req_patch = 0; - - if (version->version_major != 1 || - version->version_minor < req_minor || - (version->version_minor == req_minor && - version->version_patchlevel < req_patch)) { - /* Incompatible drm version */ - fprintf(stderr, - "[dri] I830DRIScreenInit failed because of a version " - "mismatch.\n" - "[dri] i915.o kernel module version is %d.%d.%d " - "but version 1.%d.%d or newer is needed.\n" - "[dri] Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel, - req_minor, - req_patch); - drmFreeVersion(version); - return 0; - } - - pI830->drmMinor = version->version_minor; - drmFreeVersion(version); - } - return 1; -} - -static void -I830SetRingRegs(const DRIDriverContext *ctx, I830Rec *pI830) -{ - unsigned int itemp; - unsigned char *MMIO = ctx->MMIOAddress; - - OUTREG(LP_RING + RING_LEN, 0); - OUTREG(LP_RING + RING_TAIL, 0); - OUTREG(LP_RING + RING_HEAD, 0); - - if ((long)(pI830->LpRing->mem.Start & I830_RING_START_MASK) != - pI830->LpRing->mem.Start) { - fprintf(stderr, - "I830SetRingRegs: Ring buffer start (%lx) violates its " - "mask (%x)\n", pI830->LpRing->mem.Start, I830_RING_START_MASK); - } - /* Don't care about the old value. Reserved bits must be zero anyway. */ - itemp = pI830->LpRing->mem.Start & I830_RING_START_MASK; - OUTREG(LP_RING + RING_START, itemp); - - if (((pI830->LpRing->mem.Size - 4096) & I830_RING_NR_PAGES) != - pI830->LpRing->mem.Size - 4096) { - fprintf(stderr, - "I830SetRingRegs: Ring buffer size - 4096 (%lx) violates its " - "mask (%x)\n", pI830->LpRing->mem.Size - 4096, - I830_RING_NR_PAGES); - } - /* Don't care about the old value. Reserved bits must be zero anyway. */ - itemp = (pI830->LpRing->mem.Size - 4096) & I830_RING_NR_PAGES; - itemp |= (RING_NO_REPORT | RING_VALID); - OUTREG(LP_RING + RING_LEN, itemp); - - pI830->LpRing->head = INREG(LP_RING + RING_HEAD) & I830_HEAD_MASK; - pI830->LpRing->tail = INREG(LP_RING + RING_TAIL); - pI830->LpRing->space = pI830->LpRing->head - (pI830->LpRing->tail + 8); - if (pI830->LpRing->space < 0) - pI830->LpRing->space += pI830->LpRing->mem.Size; - - SetFenceRegs(ctx, pI830); - - /* RESET THE DISPLAY PIPE TO POINT TO THE FRONTBUFFER - hacky - hacky hacky */ - OUTREG(DSPABASE, pI830->FrontBuffer.Start + pI830->LinearAddr); - -} - -static Bool -I830SetParam(const DRIDriverContext *ctx, int param, int value) -{ - drmI830SetParam sp; - - memset(&sp, 0, sizeof(sp)); - sp.param = param; - sp.value = value; - - if (drmCommandWrite(ctx->drmFD, DRM_I830_SETPARAM, &sp, sizeof(sp))) { - fprintf(stderr, "I830 SetParam Failed\n"); - return FALSE; - } - - return TRUE; -} - -static Bool -I830DRIMapScreenRegions(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) -{ - fprintf(stderr, - "[drm] Mapping front buffer\n"); - - if (drmAddMap(ctx->drmFD, - (drm_handle_t)(sarea->front_offset + pI830->LinearAddr), - sarea->front_size, - DRM_FRAME_BUFFER, /*DRM_AGP,*/ - 0, - &sarea->front_handle) < 0) { - fprintf(stderr, - "[drm] drmAddMap(front_handle) failed. Disabling DRI\n"); - return FALSE; - } - ctx->shared.hFrameBuffer = sarea->front_handle; - ctx->shared.fbSize = sarea->front_size; - fprintf(stderr, "[drm] Front Buffer = 0x%08x\n", - sarea->front_handle); - - if (drmAddMap(ctx->drmFD, - (drm_handle_t)(sarea->back_offset), - sarea->back_size, DRM_AGP, 0, - &sarea->back_handle) < 0) { - fprintf(stderr, - "[drm] drmAddMap(back_handle) failed. Disabling DRI\n"); - return FALSE; - } - fprintf(stderr, "[drm] Back Buffer = 0x%08x\n", - sarea->back_handle); - - if (drmAddMap(ctx->drmFD, - (drm_handle_t)sarea->depth_offset, - sarea->depth_size, DRM_AGP, 0, - &sarea->depth_handle) < 0) { - fprintf(stderr, - "[drm] drmAddMap(depth_handle) failed. Disabling DRI\n"); - return FALSE; - } - fprintf(stderr, "[drm] Depth Buffer = 0x%08x\n", - sarea->depth_handle); - -#if 0 - if (drmAddMap(ctx->drmFD, - (drm_handle_t)sarea->tex_offset, - sarea->tex_size, DRM_AGP, 0, - &sarea->tex_handle) < 0) { - fprintf(stderr, - "[drm] drmAddMap(tex_handle) failed. Disabling DRI\n"); - return FALSE; - } - fprintf(stderr, "[drm] textures = 0x%08x\n", - sarea->tex_handle); -#endif - return TRUE; -} - - -static void -I830DRIUnmapScreenRegions(const DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) -{ -#if 1 - if (sarea->front_handle) { - drmRmMap(ctx->drmFD, sarea->front_handle); - sarea->front_handle = 0; - } -#endif - if (sarea->back_handle) { - drmRmMap(ctx->drmFD, sarea->back_handle); - sarea->back_handle = 0; - } - if (sarea->depth_handle) { - drmRmMap(ctx->drmFD, sarea->depth_handle); - sarea->depth_handle = 0; - } - if (sarea->tex_handle) { - drmRmMap(ctx->drmFD, sarea->tex_handle); - sarea->tex_handle = 0; - } -} - -static Bool -I830DRIDoMappings(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) -{ - if (drmAddMap(ctx->drmFD, - (drm_handle_t)pI830->LpRing->mem.Start, - pI830->LpRing->mem.Size, DRM_AGP, 0, - &pI830->ring_map) < 0) { - fprintf(stderr, - "[drm] drmAddMap(ring_map) failed. Disabling DRI\n"); - return FALSE; - } - fprintf(stderr, "[drm] ring buffer = 0x%08x\n", - pI830->ring_map); - - if (I830InitDma(ctx, pI830) == FALSE) { - return FALSE; - } - - /* init to zero to be safe */ - - I830DRIMapScreenRegions(ctx, pI830, sarea); - SetupDRIMM(ctx, pI830); - - if (ctx->pciDevice != PCI_CHIP_845_G && - ctx->pciDevice != PCI_CHIP_I830_M) { - I830SetParam(ctx, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 ); - } - - /* Okay now initialize the dma engine */ - { - pI830->irq = drmGetInterruptFromBusID(ctx->drmFD, - ctx->pciBus, - ctx->pciDevice, - ctx->pciFunc); - - if (drmCtlInstHandler(ctx->drmFD, pI830->irq)) { - fprintf(stderr, - "[drm] failure adding irq handler\n"); - pI830->irq = 0; - return FALSE; - } - else - fprintf(stderr, - "[drm] dma control initialized, using IRQ %d\n", - pI830->irq); - } - - fprintf(stderr, "[dri] visual configs initialized\n"); - - return TRUE; -} - -static Bool -I830ClearScreen(DRIDriverContext *ctx, I830Rec *pI830, drmI830Sarea *sarea) -{ - /* need to drmMap front and back buffers and zero them */ - drmAddress map_addr; - int ret; - - ret = drmMap(ctx->drmFD, - sarea->front_handle, - sarea->front_size, - &map_addr); - - if (ret) - { - fprintf(stderr, "Unable to map front buffer\n"); - return FALSE; - } - - drimemsetio((char *)map_addr, - 0, - sarea->front_size); - drmUnmap(map_addr, sarea->front_size); - - - ret = drmMap(ctx->drmFD, - sarea->back_handle, - sarea->back_size, - &map_addr); - - if (ret) - { - fprintf(stderr, "Unable to map back buffer\n"); - return FALSE; - } - - drimemsetio((char *)map_addr, - 0, - sarea->back_size); - drmUnmap(map_addr, sarea->back_size); - - return TRUE; -} - -static Bool -I830ScreenInit(DRIDriverContext *ctx, I830Rec *pI830) - -{ - I830DRIPtr pI830DRI; - drmI830Sarea *pSAREAPriv; - int err; - - drm_page_size = getpagesize(); - - pI830->registerSize = ctx->MMIOSize; - /* This is a hack for now. We have to have more than a 4k page here - * because of the size of the state. However, the state should be - * in a per-context mapping. This will be added in the Mesa 3.5 port - * of the I830 driver. - */ - ctx->shared.SAREASize = SAREA_MAX; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - ctx->drmFD = drmOpen("i915", NULL ); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) { - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - ctx->drmFD, ctx->pciBusID, strerror(-err)); - return 0; - } - - if (drmAddMap( ctx->drmFD, - 0, - ctx->shared.SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &ctx->shared.hSAREA) < 0) - { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08x\n", - ctx->shared.SAREASize, ctx->shared.hSAREA); - - if (drmMap( ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - - } - - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08x to %p, size %d\n", - ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); - - - if (drmAddMap(ctx->drmFD, - ctx->MMIOStart, - ctx->MMIOSize, - DRM_REGISTERS, - DRM_READ_ONLY, - &pI830->registerHandle) < 0) { - fprintf(stderr, "[drm] drmAddMap mmio failed\n"); - return 0; - } - fprintf(stderr, - "[drm] register handle = 0x%08x\n", pI830->registerHandle); - - - if (!I830CheckDRMVersion(ctx, pI830)) { - return FALSE; - } - - /* Create a 'server' context so we can grab the lock for - * initialization ioctls. - */ - if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); - - /* Initialize the SAREA private data structure */ - pSAREAPriv = (drmI830Sarea *)(((char*)ctx->pSAREA) + - sizeof(drm_sarea_t)); - memset(pSAREAPriv, 0, sizeof(*pSAREAPriv)); - - pI830->StolenMemory.Size = I830DetectMemory(ctx, pI830); - pI830->StolenMemory.Start = 0; - pI830->StolenMemory.End = pI830->StolenMemory.Size; - - pI830->MemoryAperture.Start = pI830->StolenMemory.End; - pI830->MemoryAperture.End = KB(40000); - pI830->MemoryAperture.Size = pI830->MemoryAperture.End - pI830->MemoryAperture.Start; - - pI830->StolenPool.Fixed = pI830->StolenMemory; - pI830->StolenPool.Total = pI830->StolenMemory; - pI830->StolenPool.Free = pI830->StolenPool.Total; - pI830->FreeMemory = pI830->StolenPool.Total.Size; - - if (!AgpInit(ctx, pI830)) - return FALSE; - - if (I830AllocateMemory(ctx, pI830) == FALSE) - { - return FALSE; - } - - if (I830BindMemory(ctx, pI830) == FALSE) - { - return FALSE; - } - - pSAREAPriv->rotated_offset = -1; - pSAREAPriv->rotated_size = 0; - pSAREAPriv->rotated_pitch = ctx->shared.virtualWidth; - - pSAREAPriv->front_offset = pI830->FrontBuffer.Start; - pSAREAPriv->front_size = pI830->FrontBuffer.Size; - pSAREAPriv->width = ctx->shared.virtualWidth; - pSAREAPriv->height = ctx->shared.virtualHeight; - pSAREAPriv->pitch = ctx->shared.virtualWidth; - pSAREAPriv->virtualX = ctx->shared.virtualWidth; - pSAREAPriv->virtualY = ctx->shared.virtualHeight; - pSAREAPriv->back_offset = pI830->BackBuffer.Start; - pSAREAPriv->back_size = pI830->BackBuffer.Size; - pSAREAPriv->depth_offset = pI830->DepthBuffer.Start; - pSAREAPriv->depth_size = pI830->DepthBuffer.Size; -#if 0 - pSAREAPriv->tex_offset = pI830->TexMem.Start; - pSAREAPriv->tex_size = pI830->TexMem.Size; -#endif - pSAREAPriv->log_tex_granularity = pI830->TexGranularity; - - ctx->driverClientMsg = malloc(sizeof(I830DRIRec)); - ctx->driverClientMsgSize = sizeof(I830DRIRec); - pI830DRI = (I830DRIPtr)ctx->driverClientMsg; - pI830DRI->deviceID = pI830->Chipset; - pI830DRI->regsSize = I830_REG_SIZE; - pI830DRI->width = ctx->shared.virtualWidth; - pI830DRI->height = ctx->shared.virtualHeight; - pI830DRI->mem = ctx->shared.fbSize; - pI830DRI->cpp = ctx->cpp; - - pI830DRI->bitsPerPixel = ctx->bpp; - pI830DRI->sarea_priv_offset = sizeof(drm_sarea_t); - - err = I830DRIDoMappings(ctx, pI830, pSAREAPriv); - if (err == FALSE) - return FALSE; - - I830SetupMemoryTiling(ctx, pI830); - - /* Quick hack to clear the front & back buffers. Could also use - * the clear ioctl to do this, but would need to setup hw state - * first. - */ - I830ClearScreen(ctx, pI830, pSAREAPriv); - - I830SetRingRegs(ctx, pI830); - - return TRUE; -} - - -/** - * \brief Validate the fbdev mode. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Saves some registers and returns 1. - * - * \sa radeonValidateMode(). - */ -static int i830ValidateMode( const DRIDriverContext *ctx ) -{ - return 1; -} - -/** - * \brief Examine mode returned by fbdev. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Restores registers that fbdev has clobbered and returns 1. - * - * \sa i810ValidateMode(). - */ -static int i830PostValidateMode( const DRIDriverContext *ctx ) -{ - I830Rec *pI830 = ctx->driverPrivate; - - I830SetRingRegs(ctx, pI830); - return 1; -} - - -/** - * \brief Initialize the framebuffer device mode - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Fills in \p info with some default values and some information from \p ctx - * and then calls I810ScreenInit() for the screen initialization. - * - * Before exiting clears the framebuffer memory accessing it directly. - */ -static int i830InitFBDev( DRIDriverContext *ctx ) -{ - I830Rec *pI830 = calloc(1, sizeof(I830Rec)); - int i; - - { - int dummy = ctx->shared.virtualWidth; - - switch (ctx->bpp / 8) { - case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; - case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break; - case 3: - case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break; - } - - ctx->shared.virtualWidth = dummy; - ctx->shared.Width = ctx->shared.virtualWidth; - } - - - for (i = 0; pitches[i] != 0; i++) { - if (pitches[i] >= ctx->shared.virtualWidth) { - ctx->shared.virtualWidth = pitches[i]; - break; - } - } - - ctx->driverPrivate = (void *)pI830; - - pI830->LpRing = calloc(1, sizeof(I830RingBuffer)); - pI830->Chipset = ctx->chipset; - pI830->LinearAddr = ctx->FBStart; - - if (!I830ScreenInit( ctx, pI830 )) - return 0; - - - return 1; -} - - -/** - * \brief The screen is being closed, so clean up any state and free any - * resources used by the DRI. - * - * \param ctx display handle. - * - * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver - * private data. - */ -static void i830HaltFBDev( DRIDriverContext *ctx ) -{ - drmI830Sarea *pSAREAPriv; - I830Rec *pI830 = ctx->driverPrivate; - - if (pI830->irq) { - drmCtlUninstHandler(ctx->drmFD); - pI830->irq = 0; } - - I830CleanupDma(ctx); - - pSAREAPriv = (drmI830Sarea *)(((char*)ctx->pSAREA) + - sizeof(drm_sarea_t)); - - I830DRIUnmapScreenRegions(ctx, pI830, pSAREAPriv); - drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); - drmClose(ctx->drmFD); - - if (ctx->driverPrivate) { - free(ctx->driverPrivate); - ctx->driverPrivate = 0; - } -} - - -extern void i810NotifyFocus( int ); - -/** - * \brief Exported driver interface for Mini GLX. - * - * \sa DRIDriverRec. - */ -const struct DRIDriverRec __driDriver = { - i830ValidateMode, - i830PostValidateMode, - i830InitFBDev, - i830HaltFBDev, - NULL,//I830EngineShutdown, - NULL, //I830EngineRestore, -#ifndef _EMBEDDED - 0, -#else - i810NotifyFocus, -#endif -}; diff --git a/src/mesa/drivers/dri/mga/server/mga_dri.c b/src/mesa/drivers/dri/mga/server/mga_dri.c deleted file mode 100644 index bc575e62ee..0000000000 --- a/src/mesa/drivers/dri/mga/server/mga_dri.c +++ /dev/null @@ -1,1088 +0,0 @@ - -/* - * Copyright 2000 VA Linux Systems Inc., Fremont, California. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES - * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Authors: - * Keith Whitwell - * Gareth Hughes - */ - -#include -#include -#include -#include -#include -#include - -#include "driver.h" -#include "drm.h" -#include "memops.h" - -#include "mga_reg.h" -#include "mga.h" -#include "mga_macros.h" -#include "mga_dri.h" - - -/* Quiescence, locking - */ -#define MGA_TIMEOUT 2048 - -static void MGAWaitForIdleDMA( struct DRIDriverContextRec *ctx, MGAPtr pMga ) -{ - drm_lock_t lock; - int ret; - int i = 0; - - memset( &lock, 0, sizeof(lock) ); - - for (;;) { - do { - /* first ask for quiescent and flush */ - lock.flags = DRM_LOCK_QUIESCENT | DRM_LOCK_FLUSH; - do { - ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH, - &lock, sizeof( lock ) ); - } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY ); - - /* if it's still busy just try quiescent */ - if ( ret == -EBUSY ) { - lock.flags = DRM_LOCK_QUIESCENT; - do { - ret = drmCommandWrite( ctx->drmFD, DRM_MGA_FLUSH, - &lock, sizeof( lock ) ); - } while ( ret == -EBUSY && i++ < DRM_MGA_IDLE_RETRY ); - } - } while ( ( ret == -EBUSY ) && ( i++ < MGA_TIMEOUT ) ); - - if ( ret == 0 ) - return; - - fprintf( stderr, - "[dri] Idle timed out, resetting engine...\n" ); - - drmCommandNone( ctx->drmFD, DRM_MGA_RESET ); - } -} - -static unsigned int mylog2( unsigned int n ) -{ - unsigned int log2 = 1; - while ( n > 1 ) n >>= 1, log2++; - return log2; -} - -static int MGADRIAgpInit(struct DRIDriverContextRec *ctx, MGAPtr pMga) -{ - unsigned long mode; - unsigned int vendor, device; - int ret, count, i; - - if(pMga->agpSize < 12)pMga->agpSize = 12; - if(pMga->agpSize > 64)pMga->agpSize = 64; /* cap */ - - /* FIXME: Make these configurable... - */ - pMga->agp.size = pMga->agpSize * 1024 * 1024; - - pMga->warp.offset = 0; - pMga->warp.size = MGA_WARP_UCODE_SIZE; - - pMga->primary.offset = (pMga->warp.offset + - pMga->warp.size); - pMga->primary.size = 1024 * 1024; - - pMga->buffers.offset = (pMga->primary.offset + - pMga->primary.size); - pMga->buffers.size = MGA_NUM_BUFFERS * MGA_BUFFER_SIZE; - - - pMga->agpTextures.offset = (pMga->buffers.offset + - pMga->buffers.size); - - pMga->agpTextures.size = pMga->agp.size - - pMga->agpTextures.offset; - - if ( drmAgpAcquire( ctx->drmFD ) < 0 ) { - fprintf( stderr, "[agp] AGP not available\n" ); - return 0; - } - - mode = drmAgpGetMode( ctx->drmFD ); /* Default mode */ - vendor = drmAgpVendorId( ctx->drmFD ); - device = drmAgpDeviceId( ctx->drmFD ); - - mode &= ~MGA_AGP_MODE_MASK; - switch ( pMga->agpMode ) { - case 4: - mode |= MGA_AGP_4X_MODE; - case 2: - mode |= MGA_AGP_2X_MODE; - case 1: - default: - mode |= MGA_AGP_1X_MODE; - } - -#if 0 - fprintf( stderr, - "[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n", - mode, vendor, device, - ctx->pciVendor, - ctx->pciChipType ); -#endif - - if ( drmAgpEnable( ctx->drmFD, mode ) < 0 ) { - fprintf( stderr, "[agp] AGP not enabled\n" ); - drmAgpRelease( ctx->drmFD ); - return 0; - } - - if ( pMga->Chipset == PCI_CHIP_MGAG200 ) { - switch ( pMga->agpMode ) { - case 2: - fprintf( stderr, - "[drm] Enabling AGP 2x PLL encoding\n" ); - OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_ENABLE ); - break; - - case 1: - default: - fprintf( stderr, - "[drm] Disabling AGP 2x PLL encoding\n" ); - OUTREG( MGAREG_AGP_PLL, MGA_AGP2XPLL_DISABLE ); - pMga->agpMode = 1; - break; - } - } - - ret = drmAgpAlloc( ctx->drmFD, pMga->agp.size, - 0, NULL, &pMga->agp.handle ); - if ( ret < 0 ) { - fprintf( stderr, "[agp] Out of memory (%d)\n", ret ); - drmAgpRelease( ctx->drmFD ); - return 0; - } - fprintf( stderr, - "[agp] %d kB allocated with handle 0x%08x\n", - pMga->agp.size/1024, (unsigned int)pMga->agp.handle ); - - if ( drmAgpBind( ctx->drmFD, pMga->agp.handle, 0 ) < 0 ) { - fprintf( stderr, "[agp] Could not bind memory\n" ); - drmAgpFree( ctx->drmFD, pMga->agp.handle ); - drmAgpRelease( ctx->drmFD ); - return 0; - } - - /* WARP microcode space - */ - if ( drmAddMap( ctx->drmFD, - pMga->warp.offset, - pMga->warp.size, - DRM_AGP, DRM_READ_ONLY, - &pMga->warp.handle ) < 0 ) { - fprintf( stderr, - "[agp] Could not add WARP microcode mapping\n" ); - return 0; - } - fprintf( stderr, - "[agp] WARP microcode handle = 0x%08x\n", - pMga->warp.handle ); - - if ( drmMap( ctx->drmFD, - pMga->warp.handle, - pMga->warp.size, - &pMga->warp.map ) < 0 ) { - fprintf( stderr, - "[agp] Could not map WARP microcode\n" ); - return 0; - } - fprintf( stderr, - "[agp] WARP microcode mapped at 0x%08lx\n", - (unsigned long)pMga->warp.map ); - - /* Primary DMA space - */ - if ( drmAddMap( ctx->drmFD, - pMga->primary.offset, - pMga->primary.size, - DRM_AGP, DRM_READ_ONLY, - &pMga->primary.handle ) < 0 ) { - fprintf( stderr, - "[agp] Could not add primary DMA mapping\n" ); - return 0; - } - fprintf( stderr, - "[agp] Primary DMA handle = 0x%08x\n", - pMga->primary.handle ); - - if ( drmMap( ctx->drmFD, - pMga->primary.handle, - pMga->primary.size, - &pMga->primary.map ) < 0 ) { - fprintf( stderr, - "[agp] Could not map primary DMA\n" ); - return 0; - } - fprintf( stderr, - "[agp] Primary DMA mapped at 0x%08lx\n", - (unsigned long)pMga->primary.map ); - - /* DMA buffers - */ - if ( drmAddMap( ctx->drmFD, - pMga->buffers.offset, - pMga->buffers.size, - DRM_AGP, 0, - &pMga->buffers.handle ) < 0 ) { - fprintf( stderr, - "[agp] Could not add DMA buffers mapping\n" ); - return 0; - } - fprintf( stderr, - "[agp] DMA buffers handle = 0x%08x\n", - pMga->buffers.handle ); - - if ( drmMap( ctx->drmFD, - pMga->buffers.handle, - pMga->buffers.size, - &pMga->buffers.map ) < 0 ) { - fprintf( stderr, - "[agp] Could not map DMA buffers\n" ); - return 0; - } - fprintf( stderr, - "[agp] DMA buffers mapped at 0x%08lx\n", - (unsigned long)pMga->buffers.map ); - - count = drmAddBufs( ctx->drmFD, - MGA_NUM_BUFFERS, MGA_BUFFER_SIZE, - DRM_AGP_BUFFER, pMga->buffers.offset ); - if ( count <= 0 ) { - fprintf( stderr, - "[drm] failure adding %d %d byte DMA buffers\n", - MGA_NUM_BUFFERS, MGA_BUFFER_SIZE ); - return 0; - } - fprintf( stderr, - "[drm] Added %d %d byte DMA buffers\n", - count, MGA_BUFFER_SIZE ); - - i = mylog2(pMga->agpTextures.size / MGA_NR_TEX_REGIONS); - if(i < MGA_LOG_MIN_TEX_REGION_SIZE) - i = MGA_LOG_MIN_TEX_REGION_SIZE; - pMga->agpTextures.size = (pMga->agpTextures.size >> i) << i; - - if ( drmAddMap( ctx->drmFD, - pMga->agpTextures.offset, - pMga->agpTextures.size, - DRM_AGP, 0, - &pMga->agpTextures.handle ) < 0 ) { - fprintf( stderr, - "[agp] Could not add agpTexture mapping\n" ); - return 0; - } -/* should i map it ? */ - fprintf( stderr, - "[agp] agpTexture handle = 0x%08x\n", - pMga->agpTextures.handle ); - fprintf( stderr, - "[agp] agpTexture size: %d kb\n", pMga->agpTextures.size/1024 ); - - return 1; -} - -static int MGADRIMapInit( struct DRIDriverContextRec *ctx, MGAPtr pMga ) -{ - pMga->registers.size = MGAIOMAPSIZE; - - if ( drmAddMap( ctx->drmFD, - (drm_handle_t)pMga->IOAddress, - pMga->registers.size, - DRM_REGISTERS, DRM_READ_ONLY, - &pMga->registers.handle ) < 0 ) { - fprintf( stderr, - "[drm] Could not add MMIO registers mapping\n" ); - return 0; - } - fprintf( stderr, - "[drm] Registers handle = 0x%08lx\n", - pMga->registers.handle ); - - pMga->status.size = SAREA_MAX; - - if ( drmAddMap( ctx->drmFD, 0, pMga->status.size, - DRM_SHM, DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL, - &pMga->status.handle ) < 0 ) { - fprintf( stderr, - "[drm] Could not add status page mapping\n" ); - return 0; - } - fprintf( stderr, - "[drm] Status handle = 0x%08x\n", - pMga->status.handle ); - - if ( drmMap( ctx->drmFD, - pMga->status.handle, - pMga->status.size, - &pMga->status.map ) < 0 ) { - fprintf( stderr, - "[agp] Could not map status page\n" ); - return 0; - } - fprintf( stderr, - "[agp] Status page mapped at 0x%08lx\n", - (unsigned long)pMga->status.map ); - - return 1; -} - -static int MGADRIKernelInit( struct DRIDriverContextRec *ctx, MGAPtr pMga ) -{ - drm_mga_init_t init; - int ret; - - memset( &init, 0, sizeof(init) ); - - init.func = MGA_INIT_DMA; - init.sarea_priv_offset = sizeof(drm_sarea_t); - - switch ( pMga->Chipset ) { - case PCI_CHIP_MGAG550: - case PCI_CHIP_MGAG400: - init.chipset = MGA_CARD_TYPE_G400; - break; - case PCI_CHIP_MGAG200: - case PCI_CHIP_MGAG200_PCI: - init.chipset = MGA_CARD_TYPE_G200; - break; - default: - return 0; - } - - init.sgram = 0; /* FIXME !pMga->HasSDRAM; */ - - - switch (ctx->bpp) - { - case 16: - init.maccess = MGA_MACCESS_PW16; - break; - case 32: - init.maccess = MGA_MACCESS_PW32; - break; - default: - fprintf( stderr, "[mga] invalid bpp (%d)\n", ctx->bpp ); - return 0; - } - - - init.fb_cpp = ctx->bpp / 8; - init.front_offset = pMga->frontOffset; - init.front_pitch = pMga->frontPitch / init.fb_cpp; - init.back_offset = pMga->backOffset; - init.back_pitch = pMga->backPitch / init.fb_cpp; - - init.depth_cpp = ctx->bpp / 8; - init.depth_offset = pMga->depthOffset; - init.depth_pitch = pMga->depthPitch / init.depth_cpp; - - init.texture_offset[0] = pMga->textureOffset; - init.texture_size[0] = pMga->textureSize; - - init.fb_offset = ctx->shared.hFrameBuffer; - init.mmio_offset = pMga->registers.handle; - init.status_offset = pMga->status.handle; - - init.warp_offset = pMga->warp.handle; - init.primary_offset = pMga->primary.handle; - init.buffers_offset = pMga->buffers.handle; - - init.texture_offset[1] = pMga->agpTextures.handle; - init.texture_size[1] = pMga->agpTextures.size; - - ret = drmCommandWrite( ctx->drmFD, DRM_MGA_INIT, &init, sizeof(init)); - if ( ret < 0 ) { - fprintf( stderr, - "[drm] Failed to initialize DMA! (%d)\n", ret ); - return 0; - } - - return 1; -} - -static void MGADRIIrqInit(struct DRIDriverContextRec *ctx, MGAPtr pMga) -{ - if (!pMga->irq) - { - pMga->irq = drmGetInterruptFromBusID(ctx->drmFD, - ctx->pciBus, - ctx->pciDevice, - ctx->pciFunc); - - fprintf(stderr, "[drm] got IRQ %d\n", pMga->irq); - - if((drmCtlInstHandler(ctx->drmFD, pMga->irq)) != 0) - { - fprintf(stderr, - "[drm] failure adding irq handler, " - "there is a device already using that irq\n" - "[drm] falling back to irq-free operation\n"); - pMga->irq = 0; - } - else - { - pMga->reg_ien = INREG( MGAREG_IEN ); - } - } - - if (pMga->irq) - fprintf(stderr, - "[drm] dma control initialized, using IRQ %d\n", - pMga->irq); -} - -static int MGADRIBuffersInit( struct DRIDriverContextRec *ctx, MGAPtr pMga ) -{ - pMga->drmBuffers = drmMapBufs( ctx->drmFD ); - if ( !pMga->drmBuffers ) - { - fprintf( stderr, - "[drm] Failed to map DMA buffers list\n" ); - return 0; - } - - fprintf( stderr, - "[drm] Mapped %d DMA buffers\n", - pMga->drmBuffers->count ); - - return 1; -} - -static int MGAMemoryInit( struct DRIDriverContextRec *ctx, MGAPtr pMga ) -{ - int width_bytes = ctx->shared.virtualWidth * ctx->cpp; - int bufferSize = ((ctx->shared.virtualHeight * width_bytes - + MGA_BUFFER_ALIGN) - & ~MGA_BUFFER_ALIGN); - int depthSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes - + MGA_BUFFER_ALIGN) - & ~MGA_BUFFER_ALIGN); - int l; - - pMga->frontOffset = 0; - pMga->frontPitch = ctx->shared.virtualWidth * ctx->cpp; - - fprintf(stderr, - "Using %d MB AGP aperture\n", pMga->agpSize); - fprintf(stderr, - "Using %d MB for vertex/indirect buffers\n", pMga->buffers.size>>20); - fprintf(stderr, - "Using %d MB for AGP textures\n", pMga->agpTextures.size>>20); - - /* Front, back and depth buffers - everything else texture?? - */ - pMga->textureSize = ctx->shared.fbSize - 2 * bufferSize - depthSize; - - if (pMga->textureSize < 0) - return 0; - - l = mylog2( pMga->textureSize / MGA_NR_TEX_REGIONS ); - if ( l < MGA_LOG_MIN_TEX_REGION_SIZE ) - l = MGA_LOG_MIN_TEX_REGION_SIZE; - - /* Round the texture size up to the nearest whole number of - * texture regions. Again, be greedy about this, don't - * round down. - */ - pMga->logTextureGranularity = l; - pMga->textureSize = (pMga->textureSize >> l) << l; - - /* Set a minimum usable local texture heap size. This will fit - * two 256x256x32bpp textures. - */ - if (pMga->textureSize < 512 * 1024) { - pMga->textureOffset = 0; - pMga->textureSize = 0; - } - - /* Reserve space for textures */ - pMga->textureOffset = ((ctx->shared.fbSize - pMga->textureSize + - MGA_BUFFER_ALIGN) & - ~MGA_BUFFER_ALIGN); - - /* Reserve space for the shared depth - * buffer. - */ - pMga->depthOffset = ((pMga->textureOffset - depthSize + - MGA_BUFFER_ALIGN) & - ~MGA_BUFFER_ALIGN); - pMga->depthPitch = ctx->shared.virtualWidth * ctx->cpp; - - pMga->backOffset = ((pMga->depthOffset - bufferSize + - MGA_BUFFER_ALIGN) & - ~MGA_BUFFER_ALIGN); - pMga->backPitch = ctx->shared.virtualWidth * ctx->cpp; - - - fprintf(stderr, - "Will use back buffer at offset 0x%x\n", - pMga->backOffset); - fprintf(stderr, - "Will use depth buffer at offset 0x%x\n", - pMga->depthOffset); - fprintf(stderr, - "Will use %d kb for textures at offset 0x%x\n", - pMga->textureSize/1024, pMga->textureOffset); - - return 1; -} - -static int MGACheckDRMVersion( struct DRIDriverContextRec *ctx, MGAPtr pMga ) -{ - drmVersionPtr version; - - /* Check the MGA DRM version */ - version = drmGetVersion(ctx->drmFD); - if ( version ) { - if ( version->version_major != 3 || - version->version_minor < 0 ) { - /* incompatible drm version */ - fprintf( stderr, - "[dri] MGADRIScreenInit failed because of a version mismatch.\n" - "[dri] mga.o kernel module version is %d.%d.%d but version 3.0.x is needed.\n" - "[dri] Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel ); - drmFreeVersion( version ); - return 0; - } - drmFreeVersion( version ); - } - - return 1; -} - -static void print_client_msg( MGADRIPtr pMGADRI ) -{ - fprintf( stderr, "chipset: %d\n", pMGADRI->chipset ); - - fprintf( stderr, "width: %d\n", pMGADRI->width ); - fprintf( stderr, "height: %d\n", pMGADRI->height ); - fprintf( stderr, "mem: %d\n", pMGADRI->mem ); - fprintf( stderr, "cpp: %d\n", pMGADRI->cpp ); - - fprintf( stderr, "agpMode: %d\n", pMGADRI->agpMode ); - - fprintf( stderr, "frontOffset: %d\n", pMGADRI->frontOffset ); - fprintf( stderr, "frontPitch: %d\n", pMGADRI->frontPitch ); - - fprintf( stderr, "backOffset: %d\n", pMGADRI->backOffset ); - fprintf( stderr, "backPitch: %d\n", pMGADRI->backPitch ); - - fprintf( stderr, "depthOffset: %d\n", pMGADRI->depthOffset ); - fprintf( stderr, "depthPitch: %d\n", pMGADRI->depthPitch ); - - fprintf( stderr, "textureOffset: %d\n", pMGADRI->textureOffset ); - fprintf( stderr, "textureSize: %d\n", pMGADRI->textureSize ); - - fprintf( stderr, "logTextureGranularity: %d\n", pMGADRI->logTextureGranularity ); - fprintf( stderr, "logAgpTextureGranularity: %d\n", pMGADRI->logAgpTextureGranularity ); - - fprintf( stderr, "agpTextureHandle: %u\n", (unsigned int)pMGADRI->agpTextureOffset ); - fprintf( stderr, "agpTextureSize: %u\n", (unsigned int)pMGADRI->agpTextureSize ); - -#if 0 - pMGADRI->registers.handle = pMga->registers.handle; - pMGADRI->registers.size = pMga->registers.size; - pMGADRI->status.handle = pMga->status.handle; - pMGADRI->status.size = pMga->status.size; - pMGADRI->primary.handle = pMga->primary.handle; - pMGADRI->primary.size = pMga->primary.size; - pMGADRI->buffers.handle = pMga->buffers.handle; - pMGADRI->buffers.size = pMga->buffers.size; - pMGADRI->sarea_priv_offset = sizeof(drm_sarea_t); -#endif -} - -static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga ) -{ - int i; - int err; - MGADRIPtr pMGADRI; - - usleep(100); - /*assert(!ctx->IsClient);*/ - - { - int width_bytes = (ctx->shared.virtualWidth * ctx->cpp); - int maxy = ctx->shared.fbSize / width_bytes; - - - if (maxy <= ctx->shared.virtualHeight * 3) { - fprintf(stderr, - "Static buffer allocation failed -- " - "need at least %d kB video memory (have %d kB)\n", - (ctx->shared.virtualWidth * ctx->shared.virtualHeight * - ctx->cpp * 3 + 1023) / 1024, - ctx->shared.fbSize / 1024); - return 0; - } - } - - switch(pMga->Chipset) { - case PCI_CHIP_MGAG550: - case PCI_CHIP_MGAG400: - case PCI_CHIP_MGAG200: -#if 0 - case PCI_CHIP_MGAG200_PCI: -#endif - break; - default: - fprintf(stderr, "[drm] Direct rendering only supported with G200/G400/G550 AGP\n"); - return 0; - } - - fprintf( stderr, - "[drm] bpp: %d depth: %d\n", - ctx->bpp, ctx->bpp /* FIXME: depth */ ); - - if ( (ctx->bpp / 8) != 2 && - (ctx->bpp / 8) != 4 ) { - fprintf( stderr, - "[dri] Direct rendering only supported in 16 and 32 bpp modes\n" ); - return 0; - } - - ctx->shared.SAREASize = SAREA_MAX; - - - /* Note that drmOpen will try to load the kernel module, if needed. */ - ctx->drmFD = drmOpen("mga", NULL ); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) { - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - ctx->drmFD, ctx->pciBusID, strerror(-err)); - return 0; - } - - - if (drmAddMap( ctx->drmFD, - 0, - ctx->shared.SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &ctx->shared.hSAREA) < 0) - { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - ctx->shared.SAREASize, ctx->shared.hSAREA); - - if (drmMap( ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); - - /* Need to AddMap the framebuffer and mmio regions here: - */ - if (drmAddMap( ctx->drmFD, - (drm_handle_t)ctx->FBStart, - ctx->FBSize, - DRM_FRAME_BUFFER, - 0, - &ctx->shared.hFrameBuffer) < 0) - { - fprintf(stderr, "[drm] drmAddMap framebuffer failed\n"); - return 0; - } - fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n", - ctx->shared.hFrameBuffer); - - -#if 0 /* will be done in MGADRIMapInit */ - if (drmAddMap(ctx->drmFD, - ctx->FixedInfo.mmio_start, - ctx->FixedInfo.mmio_len, - DRM_REGISTERS, - DRM_READ_ONLY, - &pMga->registers.handle) < 0) { - fprintf(stderr, "[drm] drmAddMap mmio failed\n"); - return 0; - } - fprintf(stderr, - "[drm] register handle = 0x%08lx\n", pMga->registers.handle); -#endif - - - /* Check the mga DRM version */ - if (!MGACheckDRMVersion(ctx, pMga)) { - return 0; - } - - if ( !MGADRIAgpInit( ctx, pMga ) ) { - return 0; - } - - if ( !MGADRIMapInit( ctx, pMga ) ) { - return 0; - } - - /* Memory manager setup */ - if (!MGAMemoryInit(ctx, pMga)) { - return 0; - } - - - /* Create a 'server' context so we can grab the lock for - * initialization ioctls. - */ - if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); - - /* Initialize the kernel data structures */ - if (!MGADRIKernelInit(ctx, pMga)) { - fprintf(stderr, "MGADRIKernelInit failed\n"); - DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext); - return 0; - } - - /* Initialize the vertex buffers list */ - if (!MGADRIBuffersInit(ctx, pMga)) { - fprintf(stderr, "MGADRIBuffersInit failed\n"); - DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext); - return 0; - } - - /* Initialize IRQ */ - MGADRIIrqInit(ctx, pMga); - - - /* Initialize the SAREA private data structure */ - { - drm_mga_sarea_t *pSAREAPriv; - pSAREAPriv = (drm_mga_sarea_t *)(((char*)ctx->pSAREA) + - sizeof(drm_sarea_t)); - memset(pSAREAPriv, 0, sizeof(*pSAREAPriv)); - } - - /* Quick hack to clear the front & back buffers. Could also use - * the clear ioctl to do this, but would need to setup hw state - * first. - */ - drimemsetio((char *)ctx->FBAddress + pMga->frontOffset, - 0, - pMga->frontPitch * ctx->shared.virtualHeight ); - - drimemsetio((char *)ctx->FBAddress + pMga->backOffset, - 0, - pMga->backPitch * ctx->shared.virtualHeight ); - - /* Can release the lock now */ -/* DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext);*/ - - /* This is the struct passed to radeon_dri.so for its initialization */ - ctx->driverClientMsg = malloc(sizeof(MGADRIRec)); - ctx->driverClientMsgSize = sizeof(MGADRIRec); - - pMGADRI = (MGADRIPtr)ctx->driverClientMsg; - - - switch(pMga->Chipset) { - case PCI_CHIP_MGAG550: - case PCI_CHIP_MGAG400: - pMGADRI->chipset = MGA_CARD_TYPE_G400; - break; - case PCI_CHIP_MGAG200: - case PCI_CHIP_MGAG200_PCI: - pMGADRI->chipset = MGA_CARD_TYPE_G200; - break; - default: - return 0; - } - pMGADRI->width = ctx->shared.virtualWidth; - pMGADRI->height = ctx->shared.virtualHeight; - pMGADRI->mem = ctx->shared.fbSize; - pMGADRI->cpp = ctx->bpp / 8; - - pMGADRI->agpMode = pMga->agpMode; - - pMGADRI->frontOffset = pMga->frontOffset; - pMGADRI->frontPitch = pMga->frontPitch; - pMGADRI->backOffset = pMga->backOffset; - pMGADRI->backPitch = pMga->backPitch; - pMGADRI->depthOffset = pMga->depthOffset; - pMGADRI->depthPitch = pMga->depthPitch; - pMGADRI->textureOffset = pMga->textureOffset; - pMGADRI->textureSize = pMga->textureSize; - pMGADRI->logTextureGranularity = pMga->logTextureGranularity; - - i = mylog2( pMga->agpTextures.size / MGA_NR_TEX_REGIONS ); - if ( i < MGA_LOG_MIN_TEX_REGION_SIZE ) - i = MGA_LOG_MIN_TEX_REGION_SIZE; - - pMGADRI->logAgpTextureGranularity = i; - pMGADRI->agpTextureOffset = (unsigned int)pMga->agpTextures.handle; - pMGADRI->agpTextureSize = (unsigned int)pMga->agpTextures.size; - - pMGADRI->registers.handle = pMga->registers.handle; - pMGADRI->registers.size = pMga->registers.size; - pMGADRI->status.handle = pMga->status.handle; - pMGADRI->status.size = pMga->status.size; - pMGADRI->primary.handle = pMga->primary.handle; - pMGADRI->primary.size = pMga->primary.size; - pMGADRI->buffers.handle = pMga->buffers.handle; - pMGADRI->buffers.size = pMga->buffers.size; - pMGADRI->sarea_priv_offset = sizeof(drm_sarea_t); - - print_client_msg( pMGADRI ); - - return 1; -} - - -/** - * \brief Validate the fbdev mode. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Saves some registers and returns 1. - * - * \sa mgaValidateMode(). - */ -static int mgaValidateMode( const DRIDriverContext *ctx ) -{ - return 1; -} - - -/** - * \brief Examine mode returned by fbdev. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Restores registers that fbdev has clobbered and returns 1. - * - * \sa mgaValidateMode(). - */ -static int mgaPostValidateMode( const DRIDriverContext *ctx ) -{ - return 1; -} - - -/** - * \brief Initialize the framebuffer device mode - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Fills in \p info with some default values and some information from \p ctx - * and then calls MGAScreenInit() for the screen initialization. - * - * Before exiting clears the framebuffer memomry accessing it directly. - */ -static int mgaInitFBDev( struct DRIDriverContextRec *ctx ) -{ - MGAPtr pMga = calloc(1, sizeof(*pMga)); - - { - int dummy = ctx->shared.virtualWidth; - - switch (ctx->bpp / 8) { - case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; - case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break; - case 3: - case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break; - } - - ctx->shared.virtualWidth = dummy; - } - - ctx->driverPrivate = (void *)pMga; - - pMga->agpMode = MGA_DEFAULT_AGP_MODE; - pMga->agpSize = MGA_DEFAULT_AGP_SIZE; - - pMga->Chipset = ctx->chipset; - - pMga->IOAddress = ctx->MMIOStart; - pMga->IOBase = ctx->MMIOAddress; - - pMga->frontPitch = ctx->shared.virtualWidth * ctx->cpp; - - if (!MGAScreenInit( ctx, pMga )) - return 0; - - return 1; -} - - -/** - * \brief The screen is being closed, so clean up any state and free any - * resources used by the DRI. - * - * \param ctx display handle. - * - * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver - * private data. - */ -static void mgaHaltFBDev( struct DRIDriverContextRec *ctx ) -{ - drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); - drmClose(ctx->drmFD); - - if (ctx->driverPrivate) { - free(ctx->driverPrivate); - ctx->driverPrivate = NULL; - } -} - - -static int mgaEngineShutdown( const DRIDriverContext *ctx ) -{ - fprintf(stderr, "%s() is not yet implemented!\n", __FUNCTION__); - - return 1; -} - -static int mgaEngineRestore( const DRIDriverContext *ctx ) -{ - fprintf(stderr, "%s() is not yet implemented!\n", __FUNCTION__); - - return 1; -} - -/** - * \brief Exported driver interface for Mini GLX. - * - * \sa DRIDriverRec. - */ -struct DRIDriverRec __driDriver = { - mgaValidateMode, - mgaPostValidateMode, - mgaInitFBDev, - mgaHaltFBDev, - mgaEngineShutdown, - mgaEngineRestore, - 0 -}; - - - - -#if 0 -void MGADRICloseScreen( ScreenPtr pScreen ) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - MGAPtr pMga = MGAPTR(pScrn); - MGADRIServerPrivatePtr pMga = pMga->DRIServerInfo; - drmMGAInit init; - - if ( pMga->drmBuffers ) { - drmUnmapBufs( pMga->drmBuffers ); - pMga->drmBuffers = NULL; - } - - if (pMga->irq) { - drmCtlUninstHandler(ctx->drmFD); - pMga->irq = 0; - } - - /* Cleanup DMA */ - memset( &init, 0, sizeof(drmMGAInit) ); - init.func = MGA_CLEANUP_DMA; - drmCommandWrite( ctx->drmFD, DRM_MGA_INIT, &init, sizeof(drmMGAInit) ); - - if ( pMga->status.map ) { - drmUnmap( pMga->status.map, pMga->status.size ); - pMga->status.map = NULL; - } - if ( pMga->buffers.map ) { - drmUnmap( pMga->buffers.map, pMga->buffers.size ); - pMga->buffers.map = NULL; - } - if ( pMga->primary.map ) { - drmUnmap( pMga->primary.map, pMga->primary.size ); - pMga->primary.map = NULL; - } - if ( pMga->warp.map ) { - drmUnmap( pMga->warp.map, pMga->warp.size ); - pMga->warp.map = NULL; - } - - if ( pMga->agpTextures.map ) { - drmUnmap( pMga->agpTextures.map, pMga->agpTextures.size ); - pMga->agpTextures.map = NULL; - } - - if ( pMga->agp.handle ) { - drmAgpUnbind( ctx->drmFD, pMga->agp.handle ); - drmAgpFree( ctx->drmFD, pMga->agp.handle ); - pMga->agp.handle = 0; - drmAgpRelease( ctx->drmFD ); - } - - DRICloseScreen( pScreen ); - - if ( pMga->pDRIInfo ) { - if ( pMga->pDRIpMga->devPrivate ) { - xfree( pMga->pDRIpMga->devPrivate ); - pMga->pDRIpMga->devPrivate = 0; - } - DRIDestroyInfoRec( pMga->pDRIInfo ); - pMga->pDRIInfo = 0; - } - if ( pMga->DRIServerInfo ) { - xfree( pMga->DRIServerInfo ); - pMga->DRIServerInfo = 0; - } - if ( pMga->pVisualConfigs ) { - xfree( pMga->pVisualConfigs ); - } - if ( pMga->pVisualConfigsPriv ) { - xfree( pMga->pVisualConfigsPriv ); - } -} -#endif diff --git a/src/mesa/drivers/dri/r128/server/r128_dri.c b/src/mesa/drivers/dri/r128/server/r128_dri.c deleted file mode 100644 index 6e3db948af..0000000000 --- a/src/mesa/drivers/dri/r128/server/r128_dri.c +++ /dev/null @@ -1,1112 +0,0 @@ -/* - * Copyright 1999, 2000 ATI Technologies Inc., Markham, Ontario, - * Precision Insight, Inc., Cedar Park, Texas, and - * VA Linux Systems Inc., Fremont, California. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation on the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL ATI, PRECISION INSIGHT, VA LINUX - * SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * Authors: - * Kevin E. Martin - * Rickard E. Faith - * Daryll Strauss - * Gareth Hughes - * - */ - -#include -#include -#include -#include -#include -// Fix this to use kernel pci_ids.h when all of these IDs make it into the kernel -#include "pci_ids.h" - -#include "driver.h" -#include "drm.h" -#include "memops.h" - -#include "r128.h" -#include "r128_dri.h" -#include "r128_macros.h" -#include "r128_reg.h" -#include "r128_version.h" -#include "r128_drm.h" - -static size_t r128_drm_page_size; - -/* Compute log base 2 of val. */ -static int R128MinBits(int val) -{ - int bits; - - if (!val) return 1; - for (bits = 0; val; val >>= 1, ++bits); - return bits; -} - -/* Initialize the AGP state. Request memory for use in AGP space, and - initialize the Rage 128 registers to point to that memory. */ -static GLboolean R128DRIAgpInit(const DRIDriverContext *ctx) -{ - unsigned char *R128MMIO = ctx->MMIOAddress; - R128InfoPtr info = ctx->driverPrivate; - unsigned long mode; - unsigned int vendor, device; - int ret; - unsigned long cntl, chunk; - int s, l; - int flags; - unsigned long agpBase; - - if (drmAgpAcquire(ctx->drmFD) < 0) { - fprintf(stderr, "[agp] AGP not available\n"); - return GL_FALSE; - } - - /* Modify the mode if the default mode is - not appropriate for this particular - combination of graphics card and AGP - chipset. */ - - mode = drmAgpGetMode(ctx->drmFD); /* Default mode */ - vendor = drmAgpVendorId(ctx->drmFD); - device = drmAgpDeviceId(ctx->drmFD); - - mode &= ~R128_AGP_MODE_MASK; - switch (info->agpMode) { - case 4: mode |= R128_AGP_4X_MODE; - case 2: mode |= R128_AGP_2X_MODE; - case 1: default: mode |= R128_AGP_1X_MODE; - } - - fprintf(stderr, - "[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n", - mode, vendor, device, - 0x1002, - info->Chipset); - - if (drmAgpEnable(ctx->drmFD, mode) < 0) { - fprintf(stderr, "[agp] AGP not enabled\n"); - drmAgpRelease(ctx->drmFD); - return GL_FALSE; - } - - info->agpOffset = 0; - - if ((ret = drmAgpAlloc(ctx->drmFD, info->agpSize*1024*1024, 0, NULL, - &info->agpMemHandle)) < 0) { - fprintf(stderr, "[agp] Out of memory (%d)\n", ret); - drmAgpRelease(ctx->drmFD); - return GL_FALSE; - } - fprintf(stderr, - "[agp] %d kB allocated with handle 0x%08x\n", - info->agpSize*1024, info->agpMemHandle); - - if (drmAgpBind(ctx->drmFD, info->agpMemHandle, info->agpOffset) < 0) { - fprintf(stderr, "[agp] Could not bind\n"); - drmAgpFree(ctx->drmFD, info->agpMemHandle); - drmAgpRelease(ctx->drmFD); - return GL_FALSE; - } - - /* Initialize the CCE ring buffer data */ - info->ringStart = info->agpOffset; - info->ringMapSize = info->ringSize*1024*1024 + r128_drm_page_size; - info->ringSizeLog2QW = R128MinBits(info->ringSize*1024*1024/8) - 1; - - info->ringReadOffset = info->ringStart + info->ringMapSize; - info->ringReadMapSize = r128_drm_page_size; - - /* Reserve space for vertex/indirect buffers */ - info->bufStart = info->ringReadOffset + info->ringReadMapSize; - info->bufMapSize = info->bufSize*1024*1024; - - /* Reserve the rest for AGP textures */ - info->agpTexStart = info->bufStart + info->bufMapSize; - s = (info->agpSize*1024*1024 - info->agpTexStart); - l = R128MinBits((s-1) / R128_NR_TEX_REGIONS); - if (l < R128_LOG_TEX_GRANULARITY) l = R128_LOG_TEX_GRANULARITY; - info->agpTexMapSize = (s >> l) << l; - info->log2AGPTexGran = l; - - if (info->CCESecure) flags = DRM_READ_ONLY; - else flags = 0; - - if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize, - DRM_AGP, flags, &info->ringHandle) < 0) { - fprintf(stderr, - "[agp] Could not add ring mapping\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] ring handle = 0x%08x\n", info->ringHandle); - - if (drmMap(ctx->drmFD, info->ringHandle, info->ringMapSize, - (drmAddressPtr)&info->ring) < 0) { - fprintf(stderr, "[agp] Could not map ring\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] Ring mapped at 0x%08lx\n", - (unsigned long)info->ring); - - if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize, - DRM_AGP, flags, &info->ringReadPtrHandle) < 0) { - fprintf(stderr, - "[agp] Could not add ring read ptr mapping\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] ring read ptr handle = 0x%08x\n", - info->ringReadPtrHandle); - - if (drmMap(ctx->drmFD, info->ringReadPtrHandle, info->ringReadMapSize, - (drmAddressPtr)&info->ringReadPtr) < 0) { - fprintf(stderr, - "[agp] Could not map ring read ptr\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] Ring read ptr mapped at 0x%08lx\n", - (unsigned long)info->ringReadPtr); - - if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize, - DRM_AGP, 0, &info->bufHandle) < 0) { - fprintf(stderr, - "[agp] Could not add vertex/indirect buffers mapping\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] vertex/indirect buffers handle = 0x%08lx\n", - info->bufHandle); - - if (drmMap(ctx->drmFD, info->bufHandle, info->bufMapSize, - (drmAddressPtr)&info->buf) < 0) { - fprintf(stderr, - "[agp] Could not map vertex/indirect buffers\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] Vertex/indirect buffers mapped at 0x%08lx\n", - (unsigned long)info->buf); - - if (drmAddMap(ctx->drmFD, info->agpTexStart, info->agpTexMapSize, - DRM_AGP, 0, &info->agpTexHandle) < 0) { - fprintf(stderr, - "[agp] Could not add AGP texture map mapping\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] AGP texture map handle = 0x%08lx\n", - info->agpTexHandle); - - if (drmMap(ctx->drmFD, info->agpTexHandle, info->agpTexMapSize, - (drmAddressPtr)&info->agpTex) < 0) { - fprintf(stderr, - "[agp] Could not map AGP texture map\n"); - return GL_FALSE; - } - fprintf(stderr, - "[agp] AGP Texture map mapped at 0x%08lx\n", - (unsigned long)info->agpTex); - - /* Initialize Rage 128's AGP registers */ - cntl = INREG(R128_AGP_CNTL); - cntl &= ~R128_AGP_APER_SIZE_MASK; - switch (info->agpSize) { - case 256: cntl |= R128_AGP_APER_SIZE_256MB; break; - case 128: cntl |= R128_AGP_APER_SIZE_128MB; break; - case 64: cntl |= R128_AGP_APER_SIZE_64MB; break; - case 32: cntl |= R128_AGP_APER_SIZE_32MB; break; - case 16: cntl |= R128_AGP_APER_SIZE_16MB; break; - case 8: cntl |= R128_AGP_APER_SIZE_8MB; break; - case 4: cntl |= R128_AGP_APER_SIZE_4MB; break; - default: - fprintf(stderr, - "[agp] Illegal aperture size %d kB\n", - info->agpSize*1024); - return GL_FALSE; - } - agpBase = drmAgpBase(ctx->drmFD); - OUTREG(R128_AGP_BASE, agpBase); - OUTREG(R128_AGP_CNTL, cntl); - - /* Disable Rage 128's PCIGART registers */ - chunk = INREG(R128_BM_CHUNK_0_VAL); - chunk &= ~(R128_BM_PTR_FORCE_TO_PCI | - R128_BM_PM4_RD_FORCE_TO_PCI | - R128_BM_GLOBAL_FORCE_TO_PCI); - OUTREG(R128_BM_CHUNK_0_VAL, chunk); - - OUTREG(R128_PCI_GART_PAGE, 1); /* Ensure AGP GART is used (for now) */ - - return GL_TRUE; -} - -static GLboolean R128DRIPciInit(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - unsigned char *R128MMIO = ctx->MMIOAddress; - uint32_t chunk; - int ret; - int flags; - - info->agpOffset = 0; - - ret = drmScatterGatherAlloc(ctx->drmFD, info->agpSize*1024*1024, - &info->pciMemHandle); - if (ret < 0) { - fprintf(stderr, "[pci] Out of memory (%d)\n", ret); - return GL_FALSE; - } - fprintf(stderr, - "[pci] %d kB allocated with handle 0x%08x\n", - info->agpSize*1024, info->pciMemHandle); - - /* Initialize the CCE ring buffer data */ - info->ringStart = info->agpOffset; - info->ringMapSize = info->ringSize*1024*1024 + r128_drm_page_size; - info->ringSizeLog2QW = R128MinBits(info->ringSize*1024*1024/8) - 1; - - info->ringReadOffset = info->ringStart + info->ringMapSize; - info->ringReadMapSize = r128_drm_page_size; - - /* Reserve space for vertex/indirect buffers */ - info->bufStart = info->ringReadOffset + info->ringReadMapSize; - info->bufMapSize = info->bufSize*1024*1024; - - flags = DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL; - - if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize, - DRM_SCATTER_GATHER, flags, &info->ringHandle) < 0) { - fprintf(stderr, - "[pci] Could not add ring mapping\n"); - return GL_FALSE; - } - fprintf(stderr, - "[pci] ring handle = 0x%08lx\n", info->ringHandle); - - if (drmMap(ctx->drmFD, info->ringHandle, info->ringMapSize, - (drmAddressPtr)&info->ring) < 0) { - fprintf(stderr, "[pci] Could not map ring\n"); - return GL_FALSE; - } - fprintf(stderr, - "[pci] Ring mapped at 0x%08lx\n", - (unsigned long)info->ring); - fprintf(stderr, - "[pci] Ring contents 0x%08lx\n", - *(unsigned long *)info->ring); - - if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize, - DRM_SCATTER_GATHER, flags, &info->ringReadPtrHandle) < 0) { - fprintf(stderr, - "[pci] Could not add ring read ptr mapping\n"); - return GL_FALSE; - } - fprintf(stderr, - "[pci] ring read ptr handle = 0x%08lx\n", - info->ringReadPtrHandle); - - if (drmMap(ctx->drmFD, info->ringReadPtrHandle, info->ringReadMapSize, - (drmAddressPtr)&info->ringReadPtr) < 0) { - fprintf(stderr, - "[pci] Could not map ring read ptr\n"); - return GL_FALSE; - } - fprintf(stderr, - "[pci] Ring read ptr mapped at 0x%08lx\n", - (unsigned long)info->ringReadPtr); - fprintf(stderr, - "[pci] Ring read ptr contents 0x%08lx\n", - *(unsigned long *)info->ringReadPtr); - - if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize, - DRM_SCATTER_GATHER, 0, &info->bufHandle) < 0) { - fprintf(stderr, - "[pci] Could not add vertex/indirect buffers mapping\n"); - return GL_FALSE; - } - fprintf(stderr, - "[pci] vertex/indirect buffers handle = 0x%08lx\n", - info->bufHandle); - - if (drmMap(ctx->drmFD, info->bufHandle, info->bufMapSize, - (drmAddressPtr)&info->buf) < 0) { - fprintf(stderr, - "[pci] Could not map vertex/indirect buffers\n"); - return GL_FALSE; - } - fprintf(stderr, - "[pci] Vertex/indirect buffers mapped at 0x%08lx\n", - (unsigned long)info->buf); - fprintf(stderr, - "[pci] Vertex/indirect buffers contents 0x%08lx\n", - *(unsigned long *)info->buf); - - if (!info->IsPCI) { - /* This is really an AGP card, force PCI GART mode */ - chunk = INREG(R128_BM_CHUNK_0_VAL); - chunk |= (R128_BM_PTR_FORCE_TO_PCI | - R128_BM_PM4_RD_FORCE_TO_PCI | - R128_BM_GLOBAL_FORCE_TO_PCI); - OUTREG(R128_BM_CHUNK_0_VAL, chunk); - OUTREG(R128_PCI_GART_PAGE, 0); /* Ensure PCI GART is used */ - } - - return GL_TRUE; -} - -/* Add a map for the MMIO registers that will be accessed by any - DRI-based clients. */ -static GLboolean R128DRIMapInit(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - int flags; - - if (info->CCESecure) flags = DRM_READ_ONLY; - else flags = 0; - - /* Map registers */ - if (drmAddMap(ctx->drmFD, ctx->MMIOStart, ctx->MMIOSize, - DRM_REGISTERS, flags, &info->registerHandle) < 0) { - return GL_FALSE; - } - fprintf(stderr, - "[drm] register handle = 0x%08x\n", info->registerHandle); - - return GL_TRUE; -} - -/* Initialize the kernel data structures. */ -static int R128DRIKernelInit(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - drm_r128_init_t drmInfo; - - memset( &drmInfo, 0, sizeof(&drmInfo) ); - - drmInfo.func = R128_INIT_CCE; - drmInfo.sarea_priv_offset = sizeof(drm_sarea_t); - drmInfo.is_pci = info->IsPCI; - drmInfo.cce_mode = info->CCEMode; - drmInfo.cce_secure = info->CCESecure; - drmInfo.ring_size = info->ringSize*1024*1024; - drmInfo.usec_timeout = info->CCEusecTimeout; - - drmInfo.fb_bpp = ctx->bpp; - drmInfo.depth_bpp = ctx->bpp; - - drmInfo.front_offset = info->frontOffset; - drmInfo.front_pitch = info->frontPitch; - - drmInfo.back_offset = info->backOffset; - drmInfo.back_pitch = info->backPitch; - - drmInfo.depth_offset = info->depthOffset; - drmInfo.depth_pitch = info->depthPitch; - drmInfo.span_offset = info->spanOffset; - - drmInfo.fb_offset = info->LinearAddr; - drmInfo.mmio_offset = info->registerHandle; - drmInfo.ring_offset = info->ringHandle; - drmInfo.ring_rptr_offset = info->ringReadPtrHandle; - drmInfo.buffers_offset = info->bufHandle; - drmInfo.agp_textures_offset = info->agpTexHandle; - - if (drmCommandWrite(ctx->drmFD, DRM_R128_INIT, - &drmInfo, sizeof(drmInfo)) < 0) - return GL_FALSE; - - return GL_TRUE; -} - -/* Add a map for the vertex buffers that will be accessed by any - DRI-based clients. */ -static GLboolean R128DRIBufInit(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - /* Initialize vertex buffers */ - if (info->IsPCI) { - info->bufNumBufs = drmAddBufs(ctx->drmFD, - info->bufMapSize / R128_BUFFER_SIZE, - R128_BUFFER_SIZE, - DRM_SG_BUFFER, - info->bufStart); - } else { - info->bufNumBufs = drmAddBufs(ctx->drmFD, - info->bufMapSize / R128_BUFFER_SIZE, - R128_BUFFER_SIZE, - DRM_AGP_BUFFER, - info->bufStart); - } - if (info->bufNumBufs <= 0) { - fprintf(stderr, - "[drm] Could not create vertex/indirect buffers list\n"); - return GL_FALSE; - } - fprintf(stderr, - "[drm] Added %d %d byte vertex/indirect buffers\n", - info->bufNumBufs, R128_BUFFER_SIZE); - - if (!(info->buffers = drmMapBufs(ctx->drmFD))) { - fprintf(stderr, - "[drm] Failed to map vertex/indirect buffers list\n"); - return GL_FALSE; - } - fprintf(stderr, - "[drm] Mapped %d vertex/indirect buffers\n", - info->buffers->count); - - return GL_TRUE; -} - -static void R128DRIIrqInit(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - unsigned char *R128MMIO = ctx->MMIOAddress; - - if (!info->irq) { - info->irq = drmGetInterruptFromBusID( - ctx->drmFD, - ctx->pciBus, - ctx->pciDevice, - ctx->pciFunc); - - if((drmCtlInstHandler(ctx->drmFD, info->irq)) != 0) { - fprintf(stderr, - "[drm] failure adding irq handler, " - "there is a device already using that irq\n" - "[drm] falling back to irq-free operation\n"); - info->irq = 0; - } else { - info->gen_int_cntl = INREG( R128_GEN_INT_CNTL ); - } - } - - if (info->irq) - fprintf(stderr, - "[drm] dma control initialized, using IRQ %d\n", - info->irq); -} - -static int R128CCEStop(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - drm_r128_cce_stop_t stop; - int ret, i; - - stop.flush = 1; - stop.idle = 1; - - ret = drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP, - &stop, sizeof(stop) ); - - if ( ret == 0 ) { - return 0; - } else if ( errno != EBUSY ) { - return -errno; - } - - stop.flush = 0; - - i = 0; - do { - ret = drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP, - &stop, sizeof(stop) ); - } while ( ret && errno == EBUSY && i++ < R128_IDLE_RETRY ); - - if ( ret == 0 ) { - return 0; - } else if ( errno != EBUSY ) { - return -errno; - } - - stop.idle = 0; - - if ( drmCommandWrite( ctx->drmFD, DRM_R128_CCE_STOP, - &stop, sizeof(stop) )) { - return -errno; - } else { - return 0; - } -} - -/* Initialize the CCE state, and start the CCE (if used by the X server) */ -static void R128DRICCEInit(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - - /* Turn on bus mastering */ - info->BusCntl &= ~R128_BUS_MASTER_DIS; - - /* CCEMode is initialized in r128_driver.c */ - switch (info->CCEMode) { - case R128_PM4_NONPM4: info->CCEFifoSize = 0; break; - case R128_PM4_192PIO: info->CCEFifoSize = 192; break; - case R128_PM4_192BM: info->CCEFifoSize = 192; break; - case R128_PM4_128PIO_64INDBM: info->CCEFifoSize = 128; break; - case R128_PM4_128BM_64INDBM: info->CCEFifoSize = 128; break; - case R128_PM4_64PIO_128INDBM: info->CCEFifoSize = 64; break; - case R128_PM4_64BM_128INDBM: info->CCEFifoSize = 64; break; - case R128_PM4_64PIO_64VCBM_64INDBM: info->CCEFifoSize = 64; break; - case R128_PM4_64BM_64VCBM_64INDBM: info->CCEFifoSize = 64; break; - case R128_PM4_64PIO_64VCPIO_64INDPIO: info->CCEFifoSize = 64; break; - } - - /* Make sure the CCE is on for the X server */ - R128CCE_START(ctx, info); -} - - -static int R128MemoryInit(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - int width_bytes = ctx->shared.virtualWidth * ctx->cpp; - int cpp = ctx->cpp; - int bufferSize = ((ctx->shared.virtualHeight * width_bytes - + R128_BUFFER_ALIGN) - & ~R128_BUFFER_ALIGN); - int depthSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes - + R128_BUFFER_ALIGN) - & ~R128_BUFFER_ALIGN); - int l; - - info->frontOffset = 0; - info->frontPitch = ctx->shared.virtualWidth; - - fprintf(stderr, - "Using %d MB AGP aperture\n", info->agpSize); - fprintf(stderr, - "Using %d MB for the ring buffer\n", info->ringSize); - fprintf(stderr, - "Using %d MB for vertex/indirect buffers\n", info->bufSize); - fprintf(stderr, - "Using %d MB for AGP textures\n", info->agpTexSize); - - /* Front, back and depth buffers - everything else texture?? - */ - info->textureSize = ctx->shared.fbSize - 2 * bufferSize - depthSize; - - if (info->textureSize < 0) - return 0; - - l = R128MinBits((info->textureSize-1) / R128_NR_TEX_REGIONS); - if (l < R128_LOG_TEX_GRANULARITY) l = R128_LOG_TEX_GRANULARITY; - - /* Round the texture size up to the nearest whole number of - * texture regions. Again, be greedy about this, don't - * round down. - */ - info->log2TexGran = l; - info->textureSize = (info->textureSize >> l) << l; - - /* Set a minimum usable local texture heap size. This will fit - * two 256x256x32bpp textures. - */ - if (info->textureSize < 512 * 1024) { - info->textureOffset = 0; - info->textureSize = 0; - } - - /* Reserve space for textures */ - info->textureOffset = ((ctx->shared.fbSize - info->textureSize + - R128_BUFFER_ALIGN) & - ~R128_BUFFER_ALIGN); - - /* Reserve space for the shared depth - * buffer. - */ - info->depthOffset = ((info->textureOffset - depthSize + - R128_BUFFER_ALIGN) & - ~R128_BUFFER_ALIGN); - info->depthPitch = ctx->shared.virtualWidth; - - info->backOffset = ((info->depthOffset - bufferSize + - R128_BUFFER_ALIGN) & - ~R128_BUFFER_ALIGN); - info->backPitch = ctx->shared.virtualWidth; - - - fprintf(stderr, - "Will use back buffer at offset 0x%x\n", - info->backOffset); - fprintf(stderr, - "Will use depth buffer at offset 0x%x\n", - info->depthOffset); - fprintf(stderr, - "Will use %d kb for textures at offset 0x%x\n", - info->textureSize/1024, info->textureOffset); - - return 1; -} - - -/* Initialize the screen-specific data structures for the DRI and the - Rage 128. This is the main entry point to the device-specific - initialization code. It calls device-independent DRI functions to - create the DRI data structures and initialize the DRI state. */ -static GLboolean R128DRIScreenInit(DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - R128DRIPtr pR128DRI; - int err, major, minor, patch; - drmVersionPtr version; - drm_r128_sarea_t *pSAREAPriv; - - switch (ctx->bpp) { - case 8: - /* These modes are not supported (yet). */ - case 15: - case 24: - fprintf(stderr, - "[dri] R128DRIScreenInit failed (depth %d not supported). " - "[dri] Disabling DRI.\n", ctx->bpp); - return GL_FALSE; - - /* Only 16 and 32 color depths are supports currently. */ - case 16: - case 32: - break; - } - r128_drm_page_size = getpagesize(); - - info->registerSize = ctx->MMIOSize; - ctx->shared.SAREASize = SAREA_MAX; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - ctx->drmFD = drmOpen("r128", NULL ); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - /* Check the r128 DRM version */ - version = drmGetVersion(ctx->drmFD); - if (version) { - if (version->version_major != 2 || - version->version_minor < 2) { - /* incompatible drm version */ - fprintf(stderr, - "[dri] R128DRIScreenInit failed because of a version mismatch.\n" - "[dri] r128.o kernel module version is %d.%d.%d but version 2.2 or greater is needed.\n" - "[dri] Disabling the DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel); - drmFreeVersion(version); - return GL_FALSE; - } - info->drmMinor = version->version_minor; - drmFreeVersion(version); - } - - if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) { - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - ctx->drmFD, ctx->pciBusID, strerror(-err)); - return 0; - } - - if (drmAddMap( ctx->drmFD, - 0, - ctx->shared.SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &ctx->shared.hSAREA) < 0) - { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - ctx->shared.SAREASize, ctx->shared.hSAREA); - - if (drmMap( ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); - - /* Need to AddMap the framebuffer and mmio regions here: - */ - if (drmAddMap( ctx->drmFD, - (drm_handle_t)ctx->FBStart, - ctx->FBSize, - DRM_FRAME_BUFFER, - 0, - &ctx->shared.hFrameBuffer) < 0) - { - fprintf(stderr, "[drm] drmAddMap framebuffer failed\n"); - return 0; - } - - fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n", - ctx->shared.hFrameBuffer); - - if (!R128MemoryInit(ctx)) - return GL_FALSE; - - /* Initialize AGP */ - if (!info->IsPCI && !R128DRIAgpInit(ctx)) { - info->IsPCI = GL_TRUE; - fprintf(stderr, - "[agp] AGP failed to initialize -- falling back to PCI mode.\n"); - fprintf(stderr, - "[agp] Make sure you have the agpgart kernel module loaded.\n"); - } - - /* Initialize PCIGART */ - if (info->IsPCI && !R128DRIPciInit(ctx)) { - return GL_FALSE; - } - - /* DRIScreenInit doesn't add all the - common mappings. Add additional - mappings here. */ - if (!R128DRIMapInit(ctx)) { - return GL_FALSE; - } - - /* Create a 'server' context so we can grab the lock for - * initialization ioctls. - */ - if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); - - /* Initialize the kernel data structures */ - if (!R128DRIKernelInit(ctx)) { - return GL_FALSE; - } - - /* Initialize the vertex buffers list */ - if (!R128DRIBufInit(ctx)) { - return GL_FALSE; - } - - /* Initialize IRQ */ - R128DRIIrqInit(ctx); - - /* Initialize and start the CCE if required */ - R128DRICCEInit(ctx); - - /* Quick hack to clear the front & back buffers. Could also use - * the clear ioctl to do this, but would need to setup hw state - * first. - */ - drimemsetio((char *)ctx->FBAddress + info->frontOffset, - 0, - info->frontPitch * ctx->cpp * ctx->shared.virtualHeight ); - - drimemsetio((char *)ctx->FBAddress + info->backOffset, - 0, - info->backPitch * ctx->cpp * ctx->shared.virtualHeight ); - - pSAREAPriv = (drm_r128_sarea_t *)(((char*)ctx->pSAREA) + - sizeof(drm_sarea_t)); - memset(pSAREAPriv, 0, sizeof(*pSAREAPriv)); - - /* This is the struct passed to radeon_dri.so for its initialization */ - ctx->driverClientMsg = malloc(sizeof(R128DRIRec)); - ctx->driverClientMsgSize = sizeof(R128DRIRec); - - pR128DRI = (R128DRIPtr)ctx->driverClientMsg; - pR128DRI->deviceID = info->Chipset; - pR128DRI->width = ctx->shared.virtualWidth; - pR128DRI->height = ctx->shared.virtualHeight; - pR128DRI->depth = ctx->bpp; - pR128DRI->bpp = ctx->bpp; - - pR128DRI->IsPCI = info->IsPCI; - pR128DRI->AGPMode = info->agpMode; - - pR128DRI->frontOffset = info->frontOffset; - pR128DRI->frontPitch = info->frontPitch; - pR128DRI->backOffset = info->backOffset; - pR128DRI->backPitch = info->backPitch; - pR128DRI->depthOffset = info->depthOffset; - pR128DRI->depthPitch = info->depthPitch; - pR128DRI->spanOffset = info->spanOffset; - pR128DRI->textureOffset = info->textureOffset; - pR128DRI->textureSize = info->textureSize; - pR128DRI->log2TexGran = info->log2TexGran; - - pR128DRI->registerHandle = info->registerHandle; - pR128DRI->registerSize = info->registerSize; - - pR128DRI->agpTexHandle = info->agpTexHandle; - pR128DRI->agpTexMapSize = info->agpTexMapSize; - pR128DRI->log2AGPTexGran = info->log2AGPTexGran; - pR128DRI->agpTexOffset = info->agpTexStart; - pR128DRI->sarea_priv_offset = sizeof(drm_sarea_t); - - return GL_TRUE; -} - -/* The screen is being closed, so clean up any state and free any - resources used by the DRI. */ -void R128DRICloseScreen(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - drm_r128_init_t drmInfo; - - /* Stop the CCE if it is still in use */ - R128CCE_STOP(ctx, info); - - if (info->irq) { - drmCtlUninstHandler(ctx->drmFD); - info->irq = 0; - } - - /* De-allocate vertex buffers */ - if (info->buffers) { - drmUnmapBufs(info->buffers); - info->buffers = NULL; - } - - /* De-allocate all kernel resources */ - memset(&drmInfo, 0, sizeof(drmInfo)); - drmInfo.func = R128_CLEANUP_CCE; - drmCommandWrite(ctx->drmFD, DRM_R128_INIT, - &drmInfo, sizeof(drmInfo)); - - /* De-allocate all AGP resources */ - if (info->agpTex) { - drmUnmap(info->agpTex, info->agpTexMapSize); - info->agpTex = NULL; - } - if (info->buf) { - drmUnmap(info->buf, info->bufMapSize); - info->buf = NULL; - } - if (info->ringReadPtr) { - drmUnmap(info->ringReadPtr, info->ringReadMapSize); - info->ringReadPtr = NULL; - } - if (info->ring) { - drmUnmap(info->ring, info->ringMapSize); - info->ring = NULL; - } - if (info->agpMemHandle != DRM_AGP_NO_HANDLE) { - drmAgpUnbind(ctx->drmFD, info->agpMemHandle); - drmAgpFree(ctx->drmFD, info->agpMemHandle); - info->agpMemHandle = 0; - drmAgpRelease(ctx->drmFD); - } - if (info->pciMemHandle) { - drmScatterGatherFree(ctx->drmFD, info->pciMemHandle); - info->pciMemHandle = 0; - } -} - -static GLboolean R128PreInitDRI(const DRIDriverContext *ctx) -{ - R128InfoPtr info = ctx->driverPrivate; - - /*info->CCEMode = R128_DEFAULT_CCE_PIO_MODE;*/ - info->CCEMode = R128_DEFAULT_CCE_BM_MODE; - info->CCESecure = GL_TRUE; - - info->agpMode = R128_DEFAULT_AGP_MODE; - info->agpSize = R128_DEFAULT_AGP_SIZE; - info->ringSize = R128_DEFAULT_RING_SIZE; - info->bufSize = R128_DEFAULT_BUFFER_SIZE; - info->agpTexSize = R128_DEFAULT_AGP_TEX_SIZE; - - info->CCEusecTimeout = R128_DEFAULT_CCE_TIMEOUT; - - return GL_TRUE; -} - -/** - * \brief Initialize the framebuffer device mode - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Fills in \p info with some default values and some information from \p ctx - * and then calls R128ScreenInit() for the screen initialization. - * - * Before exiting clears the framebuffer memory accessing it directly. - */ -static int R128InitFBDev( DRIDriverContext *ctx ) -{ - R128InfoPtr info = calloc(1, sizeof(*info)); - - { - int dummy = ctx->shared.virtualWidth; - - switch (ctx->bpp / 8) { - case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; - case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break; - case 3: - case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break; - } - - ctx->shared.virtualWidth = dummy; - } - - ctx->driverPrivate = (void *)info; - - info->Chipset = ctx->chipset; - - switch (info->Chipset) { - case PCI_DEVICE_ID_ATI_RAGE128_LE: - case PCI_DEVICE_ID_ATI_RAGE128_RE: - case PCI_DEVICE_ID_ATI_RAGE128_RK: - case PCI_DEVICE_ID_ATI_RAGE128_PD: - case PCI_DEVICE_ID_ATI_RAGE128_PP: - case PCI_DEVICE_ID_ATI_RAGE128_PR: - /* This is a PCI card */ - info->IsPCI = GL_TRUE; - break; - default: - /* This is an AGP card */ - info->IsPCI = GL_FALSE; - break; - } - - info->frontPitch = ctx->shared.virtualWidth; - info->LinearAddr = ctx->FBStart & 0xfc000000; - - if (!R128PreInitDRI(ctx)) - return 0; - - if (!R128DRIScreenInit(ctx)) - return 0; - - return 1; -} - - -/** - * \brief The screen is being closed, so clean up any state and free any - * resources used by the DRI. - * - * \param ctx display handle. - * - * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver - * private data. - */ -static void R128HaltFBDev( DRIDriverContext *ctx ) -{ - drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); - drmClose(ctx->drmFD); - - if (ctx->driverPrivate) { - free(ctx->driverPrivate); - ctx->driverPrivate = 0; - } -} - - -/** - * \brief Validate the fbdev mode. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Saves some registers and returns 1. - * - * \sa R128PostValidateMode(). - */ -static int R128ValidateMode( const DRIDriverContext *ctx ) -{ - return 1; -} - - -/** - * \brief Examine mode returned by fbdev. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Restores registers that fbdev has clobbered and returns 1. - * - * \sa R128ValidateMode(). - */ -static int R128PostValidateMode( const DRIDriverContext *ctx ) -{ - return 1; -} - - -/** - * \brief Shutdown the drawing engine. - * - * \param ctx display handle - * - * Turns off the command processor engine & restores the graphics card - * to a state that fbdev understands. - */ -static int R128EngineShutdown( const DRIDriverContext *ctx ) -{ - return 1; -} - -/** - * \brief Restore the drawing engine. - * - * \param ctx display handle - * - * Resets the graphics card and sets initial values for several registers of - * the card's drawing engine. - * - * Turns on the R128 command processor engine (i.e., the ringbuffer). - */ -static int R128EngineRestore( const DRIDriverContext *ctx ) -{ - return 1; -} - - -/** - * \brief Exported driver interface for Mini GLX. - * - * \sa DRIDriverRec. - */ -const struct DRIDriverRec __driDriver = { - R128ValidateMode, - R128PostValidateMode, - R128InitFBDev, - R128HaltFBDev, - R128EngineShutdown, - R128EngineRestore, - 0, -}; diff --git a/src/mesa/drivers/dri/r200/server/radeon_dri.c b/src/mesa/drivers/dri/r200/server/radeon_dri.c deleted file mode 120000 index d05847d650..0000000000 --- a/src/mesa/drivers/dri/r200/server/radeon_dri.c +++ /dev/null @@ -1 +0,0 @@ -../../radeon/server/radeon_dri.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/server/radeon_dri.c b/src/mesa/drivers/dri/r300/server/radeon_dri.c deleted file mode 120000 index d05847d650..0000000000 --- a/src/mesa/drivers/dri/r300/server/radeon_dri.c +++ /dev/null @@ -1 +0,0 @@ -../../radeon/server/radeon_dri.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/server/radeon_dri.c b/src/mesa/drivers/dri/r600/server/radeon_dri.c deleted file mode 120000 index d05847d650..0000000000 --- a/src/mesa/drivers/dri/r600/server/radeon_dri.c +++ /dev/null @@ -1 +0,0 @@ -../../radeon/server/radeon_dri.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/server/radeon_dri.c b/src/mesa/drivers/dri/radeon/server/radeon_dri.c deleted file mode 100644 index 7ead588dac..0000000000 --- a/src/mesa/drivers/dri/radeon/server/radeon_dri.c +++ /dev/null @@ -1,1337 +0,0 @@ -/** - * \file server/radeon_dri.c - * \brief File to perform the device-specific initialization tasks typically - * done in the X server. - * - * Here they are converted to run in the client (or perhaps a standalone - * process), and to work with the frame buffer device rather than the X - * server infrastructure. - */ - -#include -#include -#include -#include -#include - -#include "driver.h" -#include "drm.h" -#include "memops.h" - -#include "radeon.h" -#include "radeon_dri.h" -#include "radeon_macros.h" -#include "radeon_reg.h" -#include "drm_sarea.h" - -static size_t radeon_drm_page_size; - -static int RadeonSetParam(const DRIDriverContext *ctx, int param, int value) -{ - drm_radeon_setparam_t sp; - - memset(&sp, 0, sizeof(sp)); - sp.param = param; - sp.value = value; - - if (drmCommandWrite(ctx->drmFD, DRM_RADEON_SETPARAM, &sp, sizeof(sp))) { - return -1; - } - - return 0; -} - -/** - * \brief Wait for free FIFO entries. - * - * \param ctx display handle. - * \param entries number of free entries to wait. - * - * It polls the free entries from the chip until it reaches the requested value - * or a timeout (3000 tries) occurs. Aborts the program if the FIFO times out. - */ -static void RADEONWaitForFifo( const DRIDriverContext *ctx, - int entries ) -{ - unsigned char *RADEONMMIO = ctx->MMIOAddress; - int i; - - for (i = 0; i < 3000; i++) { - int fifo_slots = - INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK; - if (fifo_slots >= entries) return; - } - - /* There are recoveries possible, but I haven't seen them work - * in practice: - */ - fprintf(stderr, "FIFO timed out: %d entries, stat=0x%08x\n", - INREG(RADEON_RBBM_STATUS) & RADEON_RBBM_FIFOCNT_MASK, - INREG(RADEON_RBBM_STATUS)); - exit(1); -} - -/** - * \brief Read a PLL register. - * - * \param ctx display handle. - * \param addr PLL register index. - * - * \return value of the PLL register. - */ -static unsigned int RADEONINPLL( const DRIDriverContext *ctx, int addr) -{ - unsigned char *RADEONMMIO = ctx->MMIOAddress; - unsigned int data; - - OUTREG8(RADEON_CLOCK_CNTL_INDEX, addr & 0x3f); - data = INREG(RADEON_CLOCK_CNTL_DATA); - - return data; -} - -/** - * \brief Reset graphics card to known state. - * - * \param ctx display handle. - * - * Resets the values of several Radeon registers. - */ -static void RADEONEngineReset( const DRIDriverContext *ctx ) -{ - unsigned char *RADEONMMIO = ctx->MMIOAddress; - unsigned int clock_cntl_index; - unsigned int mclk_cntl; - unsigned int rbbm_soft_reset; - unsigned int host_path_cntl; - int i; - - OUTREGP(RADEON_RB2D_DSTCACHE_CTLSTAT, - RADEON_RB2D_DC_FLUSH_ALL, - ~RADEON_RB2D_DC_FLUSH_ALL); - for (i = 0; i < 512; i++) { - if (!(INREG(RADEON_RB2D_DSTCACHE_CTLSTAT) & RADEON_RB2D_DC_BUSY)) - break; - } - - clock_cntl_index = INREG(RADEON_CLOCK_CNTL_INDEX); - - mclk_cntl = INPLL(ctx, RADEON_MCLK_CNTL); - OUTPLL(RADEON_MCLK_CNTL, (mclk_cntl | - RADEON_FORCEON_MCLKA | - RADEON_FORCEON_MCLKB | - RADEON_FORCEON_YCLKA | - RADEON_FORCEON_YCLKB | - RADEON_FORCEON_MC | - RADEON_FORCEON_AIC)); - - /* Soft resetting HDP thru RBBM_SOFT_RESET register can cause some - * unexpected behaviour on some machines. Here we use - * RADEON_HOST_PATH_CNTL to reset it. - */ - host_path_cntl = INREG(RADEON_HOST_PATH_CNTL); - rbbm_soft_reset = INREG(RADEON_RBBM_SOFT_RESET); - - OUTREG(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset | - RADEON_SOFT_RESET_CP | - RADEON_SOFT_RESET_HI | - RADEON_SOFT_RESET_SE | - RADEON_SOFT_RESET_RE | - RADEON_SOFT_RESET_PP | - RADEON_SOFT_RESET_E2 | - RADEON_SOFT_RESET_RB)); - INREG(RADEON_RBBM_SOFT_RESET); - OUTREG(RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset & - (unsigned int) ~(RADEON_SOFT_RESET_CP | - RADEON_SOFT_RESET_HI | - RADEON_SOFT_RESET_SE | - RADEON_SOFT_RESET_RE | - RADEON_SOFT_RESET_PP | - RADEON_SOFT_RESET_E2 | - RADEON_SOFT_RESET_RB))); - INREG(RADEON_RBBM_SOFT_RESET); - - OUTREG(RADEON_HOST_PATH_CNTL, host_path_cntl | RADEON_HDP_SOFT_RESET); - INREG(RADEON_HOST_PATH_CNTL); - OUTREG(RADEON_HOST_PATH_CNTL, host_path_cntl); - - OUTREG(RADEON_RBBM_SOFT_RESET, rbbm_soft_reset); - - OUTREG(RADEON_CLOCK_CNTL_INDEX, clock_cntl_index); - OUTPLL(RADEON_MCLK_CNTL, mclk_cntl); -} - -/** - * \brief Restore the drawing engine. - * - * \param ctx display handle - * - * Resets the graphics card and sets initial values for several registers of - * the card's drawing engine. - * - * Turns on the radeon command processor engine (i.e., the ringbuffer). - */ -static int RADEONEngineRestore( const DRIDriverContext *ctx ) -{ - RADEONInfoPtr info = ctx->driverPrivate; - unsigned char *RADEONMMIO = ctx->MMIOAddress; - int pitch64, datatype, dp_gui_master_cntl, err; - - fprintf(stderr, "%s\n", __FUNCTION__); - - OUTREG(RADEON_RB3D_CNTL, 0); - RADEONEngineReset( ctx ); - - switch (ctx->bpp) { - case 16: datatype = 4; break; - case 32: datatype = 6; break; - default: return 0; - } - - dp_gui_master_cntl = - ((datatype << RADEON_GMC_DST_DATATYPE_SHIFT) - | RADEON_GMC_CLR_CMP_CNTL_DIS); - - pitch64 = ((ctx->shared.virtualWidth * (ctx->bpp / 8) + 0x3f)) >> 6; - - RADEONWaitForFifo(ctx, 1); - OUTREG(RADEON_DEFAULT_OFFSET, ((INREG(RADEON_DEFAULT_OFFSET) & 0xC0000000) - | (pitch64 << 22))); - - RADEONWaitForFifo(ctx, 1); - OUTREG(RADEON_SURFACE_CNTL, RADEON_SURF_TRANSLATION_DIS); - - RADEONWaitForFifo(ctx, 1); - OUTREG(RADEON_DEFAULT_SC_BOTTOM_RIGHT, (RADEON_DEFAULT_SC_RIGHT_MAX - | RADEON_DEFAULT_SC_BOTTOM_MAX)); - - RADEONWaitForFifo(ctx, 1); - OUTREG(RADEON_DP_GUI_MASTER_CNTL, (dp_gui_master_cntl - | RADEON_GMC_BRUSH_SOLID_COLOR - | RADEON_GMC_SRC_DATATYPE_COLOR)); - - RADEONWaitForFifo(ctx, 7); - OUTREG(RADEON_DST_LINE_START, 0); - OUTREG(RADEON_DST_LINE_END, 0); - OUTREG(RADEON_DP_BRUSH_FRGD_CLR, 0xffffffff); - OUTREG(RADEON_DP_BRUSH_BKGD_CLR, 0); - OUTREG(RADEON_DP_SRC_FRGD_CLR, 0xffffffff); - OUTREG(RADEON_DP_SRC_BKGD_CLR, 0); - OUTREG(RADEON_DP_WRITE_MASK, 0xffffffff); - OUTREG(RADEON_AUX_SC_CNTL, 0); - -/* RADEONWaitForIdleMMIO(ctx); */ - usleep(100); - - - OUTREG(RADEON_GEN_INT_CNTL, info->gen_int_cntl); - if (info->colorTiling) - info->crtc_offset_cntl |= RADEON_CRTC_TILE_EN; - OUTREG(RADEON_CRTC_OFFSET_CNTL, info->crtc_offset_cntl); - - /* Initialize and start the CP if required */ - if ((err = drmCommandNone(ctx->drmFD, DRM_RADEON_CP_START)) != 0) { - fprintf(stderr, "%s: CP start %d\n", __FUNCTION__, err); - return 0; - } - - return 1; -} - - -/** - * \brief Shutdown the drawing engine. - * - * \param ctx display handle - * - * Turns off the command processor engine & restores the graphics card - * to a state that fbdev understands. - */ -static int RADEONEngineShutdown( const DRIDriverContext *ctx ) -{ - drm_radeon_cp_stop_t stop; - int ret, i; - - stop.flush = 1; - stop.idle = 1; - - ret = drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_STOP, &stop, - sizeof(drm_radeon_cp_stop_t)); - - if (ret == 0) { - return 0; - } else if (errno != EBUSY) { - return -errno; - } - - stop.flush = 0; - - i = 0; - do { - ret = drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_STOP, &stop, - sizeof(drm_radeon_cp_stop_t)); - } while (ret && errno == EBUSY && i++ < 10); - - if (ret == 0) { - return 0; - } else if (errno != EBUSY) { - return -errno; - } - - stop.idle = 0; - - if (drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_STOP, - &stop, sizeof(drm_radeon_cp_stop_t))) { - return -errno; - } else { - return 0; - } -} - -/** - * \brief Compute base 2 logarithm. - * - * \param val value. - * - * \return base 2 logarithm of \p val. - */ -static int RADEONMinBits(int val) -{ - int bits; - - if (!val) return 1; - for (bits = 0; val; val >>= 1, ++bits); - return bits; -} - -/** - * \brief Initialize the AGP state - * - * \param ctx display handle. - * \param info driver private data. - * - * \return one on success, or zero on failure. - * - * Acquires and enables the AGP device. Reserves memory in the AGP space for - * the ring buffer, vertex buffers and textures. Initialize the Radeon - * registers to point to that memory and add client mappings. - */ -static int RADEONDRIAgpInit( const DRIDriverContext *ctx, RADEONInfoPtr info) -{ - unsigned char *RADEONMMIO = ctx->MMIOAddress; - unsigned long mode; - int ret; - int s, l; - - if (drmAgpAcquire(ctx->drmFD) < 0) { - fprintf(stderr, "[gart] AGP not available\n"); - return 0; - } - - /* Modify the mode if the default mode is not appropriate for this - * particular combination of graphics card and AGP chipset. - */ - mode = drmAgpGetMode(ctx->drmFD); /* Default mode */ - - /* Disable fast write entirely - too many lockups. - */ - mode &= ~RADEON_AGP_MODE_MASK; - switch (ctx->agpmode) { - case 4: mode |= RADEON_AGP_4X_MODE; - case 2: mode |= RADEON_AGP_2X_MODE; - case 1: default: mode |= RADEON_AGP_1X_MODE; - } - - if (drmAgpEnable(ctx->drmFD, mode) < 0) { - fprintf(stderr, "[gart] AGP not enabled\n"); - drmAgpRelease(ctx->drmFD); - return 0; - } - else - fprintf(stderr, "[gart] AGP enabled at %dx\n", ctx->agpmode); - - /* Workaround for some hardware bugs */ - if (info->ChipFamily < CHIP_FAMILY_R200) - OUTREG(RADEON_AGP_CNTL, INREG(RADEON_AGP_CNTL) | 0x000e0000); - - info->gartOffset = 0; - - if ((ret = drmAgpAlloc(ctx->drmFD, info->gartSize*1024*1024, 0, NULL, - &info->gartMemHandle)) < 0) { - fprintf(stderr, "[gart] Out of memory (%d)\n", ret); - drmAgpRelease(ctx->drmFD); - return 0; - } - fprintf(stderr, - "[gart] %d kB allocated with handle 0x%08x\n", - info->gartSize*1024, (unsigned)info->gartMemHandle); - - if (drmAgpBind(ctx->drmFD, - info->gartMemHandle, info->gartOffset) < 0) { - fprintf(stderr, "[gart] Could not bind\n"); - drmAgpFree(ctx->drmFD, info->gartMemHandle); - drmAgpRelease(ctx->drmFD); - return 0; - } - - /* Initialize the CP ring buffer data */ - info->ringStart = info->gartOffset; - info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size; - - info->ringReadOffset = info->ringStart + info->ringMapSize; - info->ringReadMapSize = radeon_drm_page_size; - - /* Reserve space for vertex/indirect buffers */ - info->bufStart = info->ringReadOffset + info->ringReadMapSize; - info->bufMapSize = info->bufSize*1024*1024; - - /* Reserve the rest for AGP textures */ - info->gartTexStart = info->bufStart + info->bufMapSize; - s = (info->gartSize*1024*1024 - info->gartTexStart); - l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS); - if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY; - info->gartTexMapSize = (s >> l) << l; - info->log2GARTTexGran = l; - - if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize, - DRM_AGP, DRM_READ_ONLY, &info->ringHandle) < 0) { - fprintf(stderr, "[gart] Could not add ring mapping\n"); - return 0; - } - fprintf(stderr, "[gart] ring handle = 0x%08x\n", info->ringHandle); - - - if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize, - DRM_AGP, DRM_READ_ONLY, &info->ringReadPtrHandle) < 0) { - fprintf(stderr, - "[gart] Could not add ring read ptr mapping\n"); - return 0; - } - - fprintf(stderr, - "[gart] ring read ptr handle = 0x%08lx\n", - info->ringReadPtrHandle); - - if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize, - DRM_AGP, 0, &info->bufHandle) < 0) { - fprintf(stderr, - "[gart] Could not add vertex/indirect buffers mapping\n"); - return 0; - } - fprintf(stderr, - "[gart] vertex/indirect buffers handle = 0x%08x\n", - info->bufHandle); - - if (drmAddMap(ctx->drmFD, info->gartTexStart, info->gartTexMapSize, - DRM_AGP, 0, &info->gartTexHandle) < 0) { - fprintf(stderr, - "[gart] Could not add AGP texture map mapping\n"); - return 0; - } - fprintf(stderr, - "[gart] AGP texture map handle = 0x%08lx\n", - info->gartTexHandle); - - /* Initialize Radeon's AGP registers */ - /* Ring buffer is at AGP offset 0 */ - OUTREG(RADEON_AGP_BASE, info->ringHandle); - - return 1; -} - -/* Initialize the PCI GART state. Request memory for use in PCI space, - * and initialize the Radeon registers to point to that memory. - */ -static int RADEONDRIPciInit(const DRIDriverContext *ctx, RADEONInfoPtr info) -{ - int ret; - int flags = DRM_READ_ONLY | DRM_LOCKED | DRM_KERNEL; - int s, l; - - ret = drmScatterGatherAlloc(ctx->drmFD, info->gartSize*1024*1024, - &info->gartMemHandle); - if (ret < 0) { - fprintf(stderr, "[pci] Out of memory (%d)\n", ret); - return 0; - } - fprintf(stderr, - "[pci] %d kB allocated with handle 0x%08lx\n", - info->gartSize*1024, info->gartMemHandle); - - info->gartOffset = 0; - - /* Initialize the CP ring buffer data */ - info->ringStart = info->gartOffset; - info->ringMapSize = info->ringSize*1024*1024 + radeon_drm_page_size; - - info->ringReadOffset = info->ringStart + info->ringMapSize; - info->ringReadMapSize = radeon_drm_page_size; - - /* Reserve space for vertex/indirect buffers */ - info->bufStart = info->ringReadOffset + info->ringReadMapSize; - info->bufMapSize = info->bufSize*1024*1024; - - /* Reserve the rest for AGP textures */ - info->gartTexStart = info->bufStart + info->bufMapSize; - s = (info->gartSize*1024*1024 - info->gartTexStart); - l = RADEONMinBits((s-1) / RADEON_NR_TEX_REGIONS); - if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY; - info->gartTexMapSize = (s >> l) << l; - info->log2GARTTexGran = l; - - if (drmAddMap(ctx->drmFD, info->ringStart, info->ringMapSize, - DRM_SCATTER_GATHER, flags, &info->ringHandle) < 0) { - fprintf(stderr, - "[pci] Could not add ring mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] ring handle = 0x%08x\n", info->ringHandle); - - if (drmAddMap(ctx->drmFD, info->ringReadOffset, info->ringReadMapSize, - DRM_SCATTER_GATHER, flags, &info->ringReadPtrHandle) < 0) { - fprintf(stderr, - "[pci] Could not add ring read ptr mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] ring read ptr handle = 0x%08lx\n", - info->ringReadPtrHandle); - - if (drmAddMap(ctx->drmFD, info->bufStart, info->bufMapSize, - DRM_SCATTER_GATHER, 0, &info->bufHandle) < 0) { - fprintf(stderr, - "[pci] Could not add vertex/indirect buffers mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] vertex/indirect buffers handle = 0x%08lx\n", - info->bufHandle); - - if (drmAddMap(ctx->drmFD, info->gartTexStart, info->gartTexMapSize, - DRM_SCATTER_GATHER, 0, &info->gartTexHandle) < 0) { - fprintf(stderr, - "[pci] Could not add GART texture map mapping\n"); - return 0; - } - fprintf(stderr, - "[pci] GART texture map handle = 0x%08x\n", - info->gartTexHandle); - - return 1; -} - - -/** - * \brief Initialize the kernel data structures and enable the CP engine. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * This function is a wrapper around the DRM_RADEON_CP_INIT command, passing - * all the parameters in a drm_radeon_init_t structure. - */ -static int RADEONDRIKernelInit( const DRIDriverContext *ctx, - RADEONInfoPtr info) -{ - int cpp = ctx->bpp / 8; - drm_radeon_init_t drmInfo; - int ret; - - memset(&drmInfo, 0, sizeof(drm_radeon_init_t)); - - if ( (info->ChipFamily == CHIP_FAMILY_R200) || - (info->ChipFamily == CHIP_FAMILY_RV250) || - (info->ChipFamily == CHIP_FAMILY_M9) || - (info->ChipFamily == CHIP_FAMILY_RV280) ) - drmInfo.func = RADEON_INIT_R200_CP; - else - drmInfo.func = RADEON_INIT_CP; - - /* This is the struct passed to the kernel module for its initialization */ - drmInfo.sarea_priv_offset = sizeof(drm_sarea_t); - drmInfo.is_pci = ctx->isPCI; - drmInfo.cp_mode = RADEON_DEFAULT_CP_BM_MODE; - drmInfo.gart_size = info->gartSize*1024*1024; - drmInfo.ring_size = info->ringSize*1024*1024; - drmInfo.usec_timeout = 1000; - drmInfo.fb_bpp = ctx->bpp; - drmInfo.depth_bpp = ctx->bpp; - drmInfo.front_offset = info->frontOffset; - drmInfo.front_pitch = info->frontPitch * cpp; - drmInfo.back_offset = info->backOffset; - drmInfo.back_pitch = info->backPitch * cpp; - drmInfo.depth_offset = info->depthOffset; - drmInfo.depth_pitch = info->depthPitch * cpp; - drmInfo.fb_offset = info->LinearAddr; - drmInfo.mmio_offset = info->registerHandle; - drmInfo.ring_offset = info->ringHandle; - drmInfo.ring_rptr_offset = info->ringReadPtrHandle; - drmInfo.buffers_offset = info->bufHandle; - drmInfo.gart_textures_offset = info->gartTexHandle; - - ret = drmCommandWrite(ctx->drmFD, DRM_RADEON_CP_INIT, &drmInfo, - sizeof(drm_radeon_init_t)); - - return ret >= 0; -} - - -/** - * \brief Initialize the AGP heap. - * - * \param ctx display handle. - * \param info driver private data. - * - * This function is a wrapper around the DRM_RADEON_INIT_HEAP command, passing - * all the parameters in a drm_radeon_mem_init_heap structure. - */ -static void RADEONDRIAgpHeapInit(const DRIDriverContext *ctx, - RADEONInfoPtr info) -{ - drm_radeon_mem_init_heap_t drmHeap; - - /* Start up the simple memory manager for gart space */ - drmHeap.region = RADEON_MEM_REGION_GART; - drmHeap.start = 0; - drmHeap.size = info->gartTexMapSize; - - if (drmCommandWrite(ctx->drmFD, DRM_RADEON_INIT_HEAP, - &drmHeap, sizeof(drmHeap))) { - fprintf(stderr, - "[drm] Failed to initialized gart heap manager\n"); - } else { - fprintf(stderr, - "[drm] Initialized kernel gart heap manager, %d\n", - info->gartTexMapSize); - } -} - -/** - * \brief Add a map for the vertex buffers that will be accessed by any - * DRI-based clients. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return one on success, or zero on failure. - * - * Calls drmAddBufs() with the previously allocated vertex buffers. - */ -static int RADEONDRIBufInit( const DRIDriverContext *ctx, RADEONInfoPtr info ) -{ - /* Initialize vertex buffers */ - info->bufNumBufs = drmAddBufs(ctx->drmFD, - info->bufMapSize / RADEON_BUFFER_SIZE, - RADEON_BUFFER_SIZE, - ctx->isPCI ? DRM_SG_BUFFER : DRM_AGP_BUFFER, - info->bufStart); - - if (info->bufNumBufs <= 0) { - fprintf(stderr, - "[drm] Could not create vertex/indirect buffers list\n"); - return 0; - } - fprintf(stderr, - "[drm] Added %d %d byte vertex/indirect buffers\n", - info->bufNumBufs, RADEON_BUFFER_SIZE); - - return 1; -} - -/** - * \brief Install an IRQ handler. - * - * \param ctx display handle. - * \param info driver private data. - * - * Attempts to install an IRQ handler via drmCtlInstHandler(), falling back to - * IRQ-free operation on failure. - */ -static void RADEONDRIIrqInit(const DRIDriverContext *ctx, - RADEONInfoPtr info) -{ - if (!info->irq) { - info->irq = drmGetInterruptFromBusID(ctx->drmFD, - ctx->pciBus, - ctx->pciDevice, - ctx->pciFunc); - - if ((drmCtlInstHandler(ctx->drmFD, info->irq)) != 0) { - fprintf(stderr, - "[drm] failure adding irq handler, " - "there is a device already using that irq\n" - "[drm] falling back to irq-free operation\n"); - info->irq = 0; - } - } - - if (info->irq) - fprintf(stderr, - "[drm] dma control initialized, using IRQ %d\n", - info->irq); -} - -static int RADEONCheckDRMVersion( const DRIDriverContext *ctx, - RADEONInfoPtr info ) -{ - drmVersionPtr version; - - version = drmGetVersion(ctx->drmFD); - if (version) { - int req_minor, req_patch; - - /* Need 1.8.x for proper cleanup-on-client-exit behaviour. - */ - req_minor = 8; - req_patch = 0; - - if (version->version_major != 1 || - version->version_minor < req_minor || - (version->version_minor == req_minor && - version->version_patchlevel < req_patch)) { - /* Incompatible drm version */ - fprintf(stderr, - "[dri] RADEONDRIScreenInit failed because of a version " - "mismatch.\n" - "[dri] radeon.o kernel module version is %d.%d.%d " - "but version 1.%d.%d or newer is needed.\n" - "[dri] Disabling DRI.\n", - version->version_major, - version->version_minor, - version->version_patchlevel, - req_minor, - req_patch); - drmFreeVersion(version); - return 0; - } - - info->drmMinor = version->version_minor; - drmFreeVersion(version); - } - - return 1; -} - -static int RADEONMemoryInit( const DRIDriverContext *ctx, RADEONInfoPtr info ) -{ - int width_bytes = ctx->shared.virtualWidth * ctx->cpp; - int cpp = ctx->cpp; - int bufferSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN); - int depthSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes - + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN); - int l; - - info->frontOffset = 0; - info->frontPitch = ctx->shared.virtualWidth; - - fprintf(stderr, - "Using %d MB AGP aperture\n", info->gartSize); - fprintf(stderr, - "Using %d MB for the ring buffer\n", info->ringSize); - fprintf(stderr, - "Using %d MB for vertex/indirect buffers\n", info->bufSize); - fprintf(stderr, - "Using %d MB for AGP textures\n", info->gartTexSize); - - /* Front, back and depth buffers - everything else texture?? - */ - info->textureSize = ctx->shared.fbSize - 2 * bufferSize - depthSize; - - if (ctx->colorTiling==1) - { - info->textureSize = ctx->shared.fbSize - ((ctx->shared.fbSize - info->textureSize + width_bytes * 16 - 1) / (width_bytes * 16)) * (width_bytes*16); - } - - if (info->textureSize < 0) - return 0; - - l = RADEONMinBits((info->textureSize-1) / RADEON_NR_TEX_REGIONS); - if (l < RADEON_LOG_TEX_GRANULARITY) l = RADEON_LOG_TEX_GRANULARITY; - - /* Round the texture size up to the nearest whole number of - * texture regions. Again, be greedy about this, don't - * round down. - */ - info->log2TexGran = l; - info->textureSize = (info->textureSize >> l) << l; - - /* Set a minimum usable local texture heap size. This will fit - * two 256x256x32bpp textures. - */ - if (info->textureSize < 512 * 1024) { - info->textureOffset = 0; - info->textureSize = 0; - } - - /* Reserve space for textures */ - if (ctx->colorTiling==1) - { - info->textureOffset = ((ctx->shared.fbSize - info->textureSize) / - (width_bytes * 16)) * (width_bytes*16); - } - else - { - info->textureOffset = ((ctx->shared.fbSize - info->textureSize + - RADEON_BUFFER_ALIGN) & - ~RADEON_BUFFER_ALIGN); - } - /* Reserve space for the shared depth - * buffer. - */ - info->depthOffset = ((info->textureOffset - depthSize + - RADEON_BUFFER_ALIGN) & - ~RADEON_BUFFER_ALIGN); - info->depthPitch = ctx->shared.virtualWidth; - - info->backOffset = ((info->depthOffset - bufferSize + - RADEON_BUFFER_ALIGN) & - ~RADEON_BUFFER_ALIGN); - info->backPitch = ctx->shared.virtualWidth; - - - fprintf(stderr, - "Will use back buffer at offset 0x%x\n", - info->backOffset); - fprintf(stderr, - "Will use depth buffer at offset 0x%x\n", - info->depthOffset); - fprintf(stderr, - "Will use %d kb for textures at offset 0x%x\n", - info->textureSize/1024, info->textureOffset); - - info->frontPitchOffset = (((info->frontPitch * cpp / 64) << 22) | - (info->frontOffset >> 10)); - - info->backPitchOffset = (((info->backPitch * cpp / 64) << 22) | - (info->backOffset >> 10)); - - info->depthPitchOffset = (((info->depthPitch * cpp / 64) << 22) | - (info->depthOffset >> 10)); - - return 1; -} - -static int RADEONColorTilingInit( const DRIDriverContext *ctx, RADEONInfoPtr info ) -{ - int width_bytes = ctx->shared.virtualWidth * ctx->cpp; - int bufferSize = ((((ctx->shared.virtualHeight+15) & ~15) * width_bytes + RADEON_BUFFER_ALIGN) - & ~RADEON_BUFFER_ALIGN); - /* Setup color tiling */ - if (info->drmMinor<14) - info->colorTiling=0; - - if (info->colorTiling) - { - - int colorTilingFlag; - drm_radeon_surface_alloc_t front,back; - - RadeonSetParam(ctx, RADEON_SETPARAM_SWITCH_TILING, info->colorTiling ? 1 : 0); - - /* Setup the surfaces */ - if (info->ChipFamily < CHIP_FAMILY_R200) - colorTilingFlag=RADEON_SURF_TILE_COLOR_MACRO; - else - colorTilingFlag=R200_SURF_TILE_COLOR_MACRO; - - front.address = info->frontOffset; - front.size = bufferSize; - front.flags = (width_bytes) | colorTilingFlag; - drmCommandWrite(ctx->drmFD, DRM_RADEON_SURF_ALLOC, &front,sizeof(front)); - - back.address = info->backOffset; - back.size = bufferSize; - back.flags = (width_bytes) | colorTilingFlag; - drmCommandWrite(ctx->drmFD, DRM_RADEON_SURF_ALLOC, &back,sizeof(back)); - - } - return 1; -} - - - -/** - * Called at the start of each server generation. - * - * \param ctx display handle. - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * Performs static frame buffer allocation. Opens the DRM device and add maps - * to the SAREA, framebuffer and MMIO regions. Fills in \p info with more - * information. Creates a \e server context to grab the lock for the - * initialization ioctls and calls the other initilization functions in this - * file. Starts the CP engine via the DRM_RADEON_CP_START command. - * - * Setups a RADEONDRIRec structure to be passed to radeon_dri.so for its - * initialization. - */ -static int RADEONScreenInit( DRIDriverContext *ctx, RADEONInfoPtr info ) -{ - RADEONDRIPtr pRADEONDRI; - int err; - - usleep(100); - /*assert(!ctx->IsClient);*/ - - { - int width_bytes = (ctx->shared.virtualWidth * ctx->cpp); - int maxy = ctx->shared.fbSize / width_bytes; - - - if (maxy <= ctx->shared.virtualHeight * 3) { - fprintf(stderr, - "Static buffer allocation failed -- " - "need at least %d kB video memory (have %d kB)\n", - (ctx->shared.virtualWidth * ctx->shared.virtualHeight * - ctx->cpp * 3 + 1023) / 1024, - ctx->shared.fbSize / 1024); - return 0; - } - } - - - if (info->ChipFamily >= CHIP_FAMILY_R300) { - fprintf(stderr, - "Direct rendering not yet supported on " - "Radeon 9700 and newer cards\n"); - return 0; - } - - radeon_drm_page_size = getpagesize(); - - info->registerSize = ctx->MMIOSize; - ctx->shared.SAREASize = SAREA_MAX; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - ctx->drmFD = drmOpen("radeon", NULL ); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) { - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - ctx->drmFD, ctx->pciBusID, strerror(-err)); - return 0; - } - - if (drmAddMap( ctx->drmFD, - 0, - ctx->shared.SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &ctx->shared.hSAREA) < 0) - { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - ctx->shared.SAREASize, ctx->shared.hSAREA); - - if (drmMap( ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); - - /* Need to AddMap the framebuffer and mmio regions here: - */ - if (drmAddMap( ctx->drmFD, - (drm_handle_t)ctx->FBStart, - ctx->FBSize, - DRM_FRAME_BUFFER, -#ifndef _EMBEDDED - 0, -#else - DRM_READ_ONLY, -#endif - &ctx->shared.hFrameBuffer) < 0) - { - fprintf(stderr, "[drm] drmAddMap framebuffer failed\n"); - return 0; - } - - fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n", - ctx->shared.hFrameBuffer); - - - - if (drmAddMap(ctx->drmFD, - ctx->MMIOStart, - ctx->MMIOSize, - DRM_REGISTERS, - DRM_READ_ONLY, - &info->registerHandle) < 0) { - fprintf(stderr, "[drm] drmAddMap mmio failed\n"); - return 0; - } - fprintf(stderr, - "[drm] register handle = 0x%08lx\n", info->registerHandle); - - /* Check the radeon DRM version */ - if (!RADEONCheckDRMVersion(ctx, info)) { - return 0; - } - - if (ctx->isPCI) { - /* Initialize PCI */ - if (!RADEONDRIPciInit(ctx, info)) - return 0; - } - else { - /* Initialize AGP */ - if (!RADEONDRIAgpInit(ctx, info)) - return 0; - } - - /* Memory manager setup */ - if (!RADEONMemoryInit(ctx, info)) { - return 0; - } - - /* Create a 'server' context so we can grab the lock for - * initialization ioctls. - */ - if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); - - /* Initialize the kernel data structures */ - if (!RADEONDRIKernelInit(ctx, info)) { - fprintf(stderr, "RADEONDRIKernelInit failed\n"); - DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext); - return 0; - } - - /* Initialize the vertex buffers list */ - if (!RADEONDRIBufInit(ctx, info)) { - fprintf(stderr, "RADEONDRIBufInit failed\n"); - DRM_UNLOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext); - return 0; - } - - RADEONColorTilingInit(ctx, info); - - /* Initialize IRQ */ - RADEONDRIIrqInit(ctx, info); - - /* Initialize kernel gart memory manager */ - RADEONDRIAgpHeapInit(ctx, info); - - fprintf(stderr,"color tiling %sabled\n", info->colorTiling?"en":"dis"); - fprintf(stderr,"page flipping %sabled\n", info->page_flip_enable?"en":"dis"); - /* Initialize the SAREA private data structure */ - { - drm_radeon_sarea_t *pSAREAPriv; - pSAREAPriv = (drm_radeon_sarea_t *)(((char*)ctx->pSAREA) + - sizeof(drm_sarea_t)); - memset(pSAREAPriv, 0, sizeof(*pSAREAPriv)); - pSAREAPriv->pfState = info->page_flip_enable; - } - - - /* Quick hack to clear the front & back buffers. Could also use - * the clear ioctl to do this, but would need to setup hw state - * first. - */ - drimemsetio((char *)ctx->FBAddress + info->frontOffset, - 0, - info->frontPitch * ctx->cpp * ctx->shared.virtualHeight ); - - drimemsetio((char *)ctx->FBAddress + info->backOffset, - 0, - info->backPitch * ctx->cpp * ctx->shared.virtualHeight ); - - /* This is the struct passed to radeon_dri.so for its initialization */ - ctx->driverClientMsg = malloc(sizeof(RADEONDRIRec)); - ctx->driverClientMsgSize = sizeof(RADEONDRIRec); - pRADEONDRI = (RADEONDRIPtr)ctx->driverClientMsg; - pRADEONDRI->deviceID = info->Chipset; - pRADEONDRI->width = ctx->shared.virtualWidth; - pRADEONDRI->height = ctx->shared.virtualHeight; - pRADEONDRI->depth = ctx->bpp; /* XXX: depth */ - pRADEONDRI->bpp = ctx->bpp; - pRADEONDRI->IsPCI = ctx->isPCI; - pRADEONDRI->AGPMode = ctx->agpmode; - pRADEONDRI->frontOffset = info->frontOffset; - pRADEONDRI->frontPitch = info->frontPitch; - pRADEONDRI->backOffset = info->backOffset; - pRADEONDRI->backPitch = info->backPitch; - pRADEONDRI->depthOffset = info->depthOffset; - pRADEONDRI->depthPitch = info->depthPitch; - pRADEONDRI->textureOffset = info->textureOffset; - pRADEONDRI->textureSize = info->textureSize; - pRADEONDRI->log2TexGran = info->log2TexGran; - pRADEONDRI->registerHandle = info->registerHandle; - pRADEONDRI->registerSize = info->registerSize; - pRADEONDRI->statusHandle = info->ringReadPtrHandle; - pRADEONDRI->statusSize = info->ringReadMapSize; - pRADEONDRI->gartTexHandle = info->gartTexHandle; - pRADEONDRI->gartTexMapSize = info->gartTexMapSize; - pRADEONDRI->log2GARTTexGran = info->log2GARTTexGran; - pRADEONDRI->gartTexOffset = info->gartTexStart; - pRADEONDRI->sarea_priv_offset = sizeof(drm_sarea_t); - - /* Don't release the lock now - let the VT switch handler do it. */ - - return 1; -} - - -/** - * \brief Get Radeon chip family from chipset number. - * - * \param info driver private data. - * - * \return non-zero on success, or zero on failure. - * - * Called by radeonInitFBDev() to set RADEONInfoRec::ChipFamily - * according to the value of RADEONInfoRec::Chipset. Fails if the - * chipset is unrecognized or not appropriate for this driver (i.e., not - * an r100 style radeon) - */ -static int get_chipfamily_from_chipset( RADEONInfoPtr info ) -{ - switch (info->Chipset) { - case PCI_CHIP_RADEON_LY: - case PCI_CHIP_RADEON_LZ: - info->ChipFamily = CHIP_FAMILY_M6; - break; - - case PCI_CHIP_RADEON_QY: - case PCI_CHIP_RADEON_QZ: - info->ChipFamily = CHIP_FAMILY_VE; - break; - - case PCI_CHIP_R200_QL: - case PCI_CHIP_R200_QN: - case PCI_CHIP_R200_QO: - case PCI_CHIP_R200_Ql: - case PCI_CHIP_R200_BB: - info->ChipFamily = CHIP_FAMILY_R200; - break; - - case PCI_CHIP_RV200_QW: /* RV200 desktop */ - case PCI_CHIP_RV200_QX: - info->ChipFamily = CHIP_FAMILY_RV200; - break; - - case PCI_CHIP_RADEON_LW: - case PCI_CHIP_RADEON_LX: - info->ChipFamily = CHIP_FAMILY_M7; - break; - - case PCI_CHIP_RV250_Id: - case PCI_CHIP_RV250_Ie: - case PCI_CHIP_RV250_If: - case PCI_CHIP_RV250_Ig: - info->ChipFamily = CHIP_FAMILY_RV250; - break; - - case PCI_CHIP_RV250_Ld: - case PCI_CHIP_RV250_Le: - case PCI_CHIP_RV250_Lf: - case PCI_CHIP_RV250_Lg: - info->ChipFamily = CHIP_FAMILY_M9; - break; - - case PCI_CHIP_RV280_Y_: - case PCI_CHIP_RV280_Ya: - case PCI_CHIP_RV280_Yb: - case PCI_CHIP_RV280_Yc: - info->ChipFamily = CHIP_FAMILY_RV280; - break; - - case PCI_CHIP_R300_ND: - case PCI_CHIP_R300_NE: - case PCI_CHIP_R300_NF: - case PCI_CHIP_R300_NG: - info->ChipFamily = CHIP_FAMILY_R300; - break; - - default: - /* Original Radeon/7200 */ - info->ChipFamily = CHIP_FAMILY_RADEON; - } - - return 1; -} - - -/** - * \brief Validate the fbdev mode. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Saves some registers and returns 1. - * - * \sa radeonValidateMode(). - */ -static int radeonValidateMode( const DRIDriverContext *ctx ) -{ - unsigned char *RADEONMMIO = ctx->MMIOAddress; - RADEONInfoPtr info = ctx->driverPrivate; - - info->gen_int_cntl = INREG(RADEON_GEN_INT_CNTL); - info->crtc_offset_cntl = INREG(RADEON_CRTC_OFFSET_CNTL); - - if (info->colorTiling) - info->crtc_offset_cntl |= RADEON_CRTC_TILE_EN; - return 1; -} - - -/** - * \brief Examine mode returned by fbdev. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Restores registers that fbdev has clobbered and returns 1. - * - * \sa radeonValidateMode(). - */ -static int radeonPostValidateMode( const DRIDriverContext *ctx ) -{ - unsigned char *RADEONMMIO = ctx->MMIOAddress; - RADEONInfoPtr info = ctx->driverPrivate; - - RADEONColorTilingInit( ctx, info); - OUTREG(RADEON_GEN_INT_CNTL, info->gen_int_cntl); - if (info->colorTiling) - info->crtc_offset_cntl |= RADEON_CRTC_TILE_EN; - OUTREG(RADEON_CRTC_OFFSET_CNTL, info->crtc_offset_cntl); - - return 1; -} - - -/** - * \brief Initialize the framebuffer device mode - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Fills in \p info with some default values and some information from \p ctx - * and then calls RADEONScreenInit() for the screen initialization. - * - * Before exiting clears the framebuffer memory accessing it directly. - */ -static int radeonInitFBDev( DRIDriverContext *ctx ) -{ - RADEONInfoPtr info = calloc(1, sizeof(*info)); - - { - int dummy = ctx->shared.virtualWidth; - - if (ctx->colorTiling==1) - { - switch (ctx->bpp / 8) { - case 1: dummy = (ctx->shared.virtualWidth + 255) & ~255; break; - case 2: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; - case 3: - case 4: dummy = (ctx->shared.virtualWidth + 63) & ~63; break; - } - } else { - switch (ctx->bpp / 8) { - case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; - case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break; - case 3: - case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break; - } - } - - ctx->shared.virtualWidth = dummy; - ctx->shared.Width = dummy; - } - - fprintf(stderr,"shared virtual width is %d\n", ctx->shared.virtualWidth); - ctx->driverPrivate = (void *)info; - - info->gartFastWrite = RADEON_DEFAULT_AGP_FAST_WRITE; - info->gartSize = RADEON_DEFAULT_AGP_SIZE; - info->gartTexSize = RADEON_DEFAULT_AGP_TEX_SIZE; - info->bufSize = RADEON_DEFAULT_BUFFER_SIZE; - info->ringSize = RADEON_DEFAULT_RING_SIZE; - info->page_flip_enable = RADEON_DEFAULT_PAGE_FLIP; - info->colorTiling = ctx->colorTiling; - - info->Chipset = ctx->chipset; - - if (!get_chipfamily_from_chipset( info )) { - fprintf(stderr, "Unknown or non-radeon chipset -- cannot continue\n"); - fprintf(stderr, "==> Verify PCI BusID is correct in miniglx.conf\n"); - return 0; - } - - info->frontPitch = ctx->shared.virtualWidth; - info->LinearAddr = ctx->FBStart & 0xfc000000; - - - if (!RADEONScreenInit( ctx, info )) - return 0; - - - return 1; -} - - -/** - * \brief The screen is being closed, so clean up any state and free any - * resources used by the DRI. - * - * \param ctx display handle. - * - * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver - * private data. - */ -static void radeonHaltFBDev( DRIDriverContext *ctx ) -{ - drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); - drmClose(ctx->drmFD); - - if (ctx->driverPrivate) { - free(ctx->driverPrivate); - ctx->driverPrivate = 0; - } -} - - -extern void radeonNotifyFocus( int ); - -/** - * \brief Exported driver interface for Mini GLX. - * - * \sa DRIDriverRec. - */ -const struct DRIDriverRec __driDriver = { - radeonValidateMode, - radeonPostValidateMode, - radeonInitFBDev, - radeonHaltFBDev, - RADEONEngineShutdown, - RADEONEngineRestore, -#ifndef _EMBEDDED - 0, -#else - radeonNotifyFocus, -#endif -}; diff --git a/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c b/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c deleted file mode 100644 index 63fe875f59..0000000000 --- a/src/mesa/drivers/dri/tdfx/server/tdfx_dri.c +++ /dev/null @@ -1,471 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 5.1 - * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* Authors: - * Keith Whitwell - * Daniel Borca - */ - - -#include -#include -#include -#include -#include - -#include "driver.h" -#include "drm.h" -#include "imports.h" - -#include "dri_util.h" - -#include "tdfx_context.h" -#include "tdfx_dri.h" -#include "xf86drm.h" - - -#define TILE_WIDTH 128 -#define TILE_HEIGHT 32 - -#define CMDFIFO_PAGES 64 - - -static int -calcBufferStride (int xres, int tiled, int cpp) -{ - int strideInTiles; - - if (tiled) { - /* Calculate tile width stuff */ - strideInTiles = (xres+TILE_WIDTH-1)/TILE_WIDTH; - - return strideInTiles*cpp*TILE_WIDTH; - } else { - return xres*cpp; - } -} /* calcBufferStride */ - - -static int -calcBufferHeightInTiles (int yres) -{ - int heightInTiles; /* Height of buffer in tiles */ - - /* Calculate tile height stuff */ - heightInTiles = yres >> 5; - - if (yres & (TILE_HEIGHT - 1)) - heightInTiles++; - - return heightInTiles; - -} /* calcBufferHeightInTiles */ - - -static int -calcBufferSize (int xres, int yres, int tiled, int cpp) -{ - int stride, height, bufSize; - - if (tiled) { - stride = calcBufferStride(xres, tiled, cpp); - height = TILE_HEIGHT * calcBufferHeightInTiles(yres); - } else { - stride = xres*cpp; - height = yres; - } - - bufSize = stride * height; - - return bufSize; -} /* calcBufferSize */ - - -static void allocateMemory (const DRIDriverContext *ctx, TDFXDRIPtr pTDFX) -{ - int memRemaining, fifoSize, screenSizeInTiles; - int fbSize; - char *str; - int pixmapCacheLinesMin; - int cursorOffset, cursorSize; - - pTDFX->stride = calcBufferStride(pTDFX->width, !0, pTDFX->cpp); - - /* enough to do DVD */ - pixmapCacheLinesMin = ((720*480*pTDFX->cpp) + - pTDFX->stride - 1)/pTDFX->stride; - - if (pTDFX->deviceID > PCI_CHIP_VOODOO3) { - if ((pixmapCacheLinesMin + pTDFX->height) > 4095) - pixmapCacheLinesMin = 4095 - pTDFX->height; - } else { - if ((pixmapCacheLinesMin + pTDFX->height) > 2047) - pixmapCacheLinesMin = 2047 - pTDFX->height; - } - - if (pTDFX->cpp!=3) { - screenSizeInTiles=calcBufferSize(pTDFX->width, pTDFX->height, - !0, pTDFX->cpp); - } - else { - /* cpp==3 needs to bump up to 4 */ - screenSizeInTiles=calcBufferSize(pTDFX->width, pTDFX->height, - !0, 4); - } - - /* - * Layout is: - * cursor, fifo, fb, tex, bb, db - */ - - fbSize = (pTDFX->height + pixmapCacheLinesMin) * pTDFX->stride; - - memRemaining=(pTDFX->mem - 1) &~ 0xFFF; - /* Note that a page is 4096 bytes, and a */ - /* tile is 32 x 128 = 4096 bytes. So, */ - /* page and tile boundaries are the same */ - /* Place the depth offset first, forcing */ - /* it to be on an *odd* page boundary. */ - pTDFX->depthOffset = (memRemaining - screenSizeInTiles) &~ 0xFFF; - if ((pTDFX->depthOffset & (0x1 << 12)) == 0) { - pTDFX->depthOffset -= (0x1 << 12); - } - /* Now, place the back buffer, forcing it */ - /* to be on an *even* page boundary. */ - pTDFX->backOffset = (pTDFX->depthOffset - screenSizeInTiles) &~ 0xFFF; - if (pTDFX->backOffset & (0x1 << 12)) { - pTDFX->backOffset -= (0x1 << 12); - } - /* Give the cmd fifo at least */ - /* CMDFIFO_PAGES pages, but no more than */ - /* 64. NOTE: Don't go higher than 64, as */ - /* there is suspect code in Glide3 ! */ - fifoSize = ((64 <= CMDFIFO_PAGES) ? 64 : CMDFIFO_PAGES) << 12; - - /* We give 4096 bytes to the cursor */ - cursorSize = 0/*4096*/; - cursorOffset = 0; - - pTDFX->fifoOffset = cursorOffset + cursorSize; - pTDFX->fifoSize = fifoSize; - /* Now, place the front buffer, forcing */ - /* it to be on a page boundary too, just */ - /* for giggles. */ - pTDFX->fbOffset = pTDFX->fifoOffset + pTDFX->fifoSize; - pTDFX->textureOffset = pTDFX->fbOffset + fbSize; - if (pTDFX->depthOffset <= pTDFX->textureOffset || - pTDFX->backOffset <= pTDFX->textureOffset) { - /* - * pTDFX->textureSize < 0 means that the DRI is disabled. pTDFX->backOffset - * is used to calculate the maximum amount of memory available for - * 2D offscreen use. With DRI disabled, set this to the top of memory. - */ - - pTDFX->textureSize = -1; - pTDFX->backOffset = pTDFX->mem; - pTDFX->depthOffset = -1; - fprintf(stderr, - "Not enough video memory available for textures and depth buffer\n" - "\tand/or back buffer. Disabling DRI. To use DRI try lower\n" - "\tresolution modes and/or a smaller virtual screen size\n"); - } else { - pTDFX->textureSize = pTDFX->backOffset - pTDFX->textureOffset; - } -} - - -static int createScreen (DRIDriverContext *ctx, TDFXDRIPtr pTDFX) -{ - int err; - - { - int width_bytes = (ctx->shared.virtualWidth * ctx->cpp); - int maxy = ctx->shared.fbSize / width_bytes; - - - if (maxy <= ctx->shared.virtualHeight * 3) { - fprintf(stderr, - "Static buffer allocation failed -- " - "need at least %d kB video memory (have %d kB)\n", - (ctx->shared.virtualWidth * ctx->shared.virtualHeight * - ctx->cpp * 3 + 1023) / 1024, - ctx->shared.fbSize / 1024); - return 0; - } - } - - ctx->shared.SAREASize = SAREA_MAX; - pTDFX->regsSize = ctx->MMIOSize; - - /* Note that drmOpen will try to load the kernel module, if needed. */ - ctx->drmFD = drmOpen("tdfx", NULL ); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - - if ((err = drmSetBusid(ctx->drmFD, ctx->pciBusID)) < 0) { - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - ctx->drmFD, ctx->pciBusID, strerror(-err)); - return 0; - } - - if (drmAddMap( ctx->drmFD, - 0, - ctx->shared.SAREASize, - DRM_SHM, - DRM_CONTAINS_LOCK, - &ctx->shared.hSAREA) < 0) - { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - ctx->shared.SAREASize, ctx->shared.hSAREA); - - if (drmMap( ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); - - /* Need to AddMap the framebuffer and mmio regions here: - */ - if (drmAddMap( ctx->drmFD, - (drm_handle_t)ctx->FBStart, - ctx->FBSize, - DRM_FRAME_BUFFER, -#ifndef _EMBEDDED - 0, -#else - DRM_READ_ONLY, -#endif - &ctx->shared.hFrameBuffer) < 0) - { - fprintf(stderr, "[drm] drmAddMap framebuffer failed\n"); - return 0; - } - - fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n", - ctx->shared.hFrameBuffer); - - - if (drmAddMap(ctx->drmFD, - ctx->MMIOStart, - ctx->MMIOSize, - DRM_REGISTERS, - DRM_READ_ONLY, - &pTDFX->regs) < 0) { - fprintf(stderr, "[drm] drmAddMap mmio failed\n"); - return 0; - } - fprintf(stderr, - "[drm] register handle = 0x%08lx\n", pTDFX->regs); - - - /* Create a 'server' context so we can grab the lock for - * initialization ioctls. - */ - if ((err = drmCreateContext(ctx->drmFD, &ctx->serverContext)) != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return 0; - } - - DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); - - /* Initialize the kernel data structures */ - - /* Initialize kernel gart memory manager */ - allocateMemory(ctx, pTDFX); - - /* Initialize the SAREA private data structure */ - - - /* Quick hack to clear the front & back buffers. Could also use - * the clear ioctl to do this, but would need to setup hw state - * first. - */ - - - /* This is the struct passed to tdfx_dri.so for its initialization */ - ctx->driverClientMsg = malloc(sizeof(TDFXDRIRec)); - ctx->driverClientMsgSize = sizeof(TDFXDRIRec); - memcpy(ctx->driverClientMsg, pTDFX, ctx->driverClientMsgSize); - pTDFX = (TDFXDRIPtr)ctx->driverClientMsg; - - /* Don't release the lock now - let the VT switch handler do it. */ - - return 1; -} - - -/** - * \brief Validate the fbdev mode. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Saves some registers and returns 1. - * - * \sa tdfxValidateMode(). - */ -static int tdfxValidateMode( const DRIDriverContext *ctx ) -{ - return 1; -} - - -/** - * \brief Examine mode returned by fbdev. - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Restores registers that fbdev has clobbered and returns 1. - * - * \sa tdfxValidateMode(). - */ -static int tdfxPostValidateMode( const DRIDriverContext *ctx ) -{ - return 1; -} - - -/** - * \brief Initialize the framebuffer device mode - * - * \param ctx display handle. - * - * \return one on success, or zero on failure. - * - * Before exiting clears the framebuffer memory accessing it directly. - */ -static int tdfxInitFBDev( DRIDriverContext *ctx ) -{ - TDFXDRIPtr pTDFX = calloc(1, sizeof(TDFXDRIRec)); - - { - int dummy = ctx->shared.virtualWidth; - - switch (ctx->bpp / 8) { - case 1: dummy = (ctx->shared.virtualWidth + 127) & ~127; break; - case 2: dummy = (ctx->shared.virtualWidth + 31) & ~31; break; - case 3: - case 4: dummy = (ctx->shared.virtualWidth + 15) & ~15; break; - } - - ctx->shared.virtualWidth = dummy; - } - - ctx->driverPrivate = (void *)pTDFX; - - pTDFX->deviceID = ctx->chipset; - pTDFX->width = ctx->shared.virtualWidth; - pTDFX->height = ctx->shared.virtualHeight; - pTDFX->cpp = ctx->cpp; - pTDFX->mem = ctx->FBSize; /* ->shared.fbSize? mem probe? */ - pTDFX->sarea_priv_offset = sizeof(drm_sarea_t); - - if (!createScreen(ctx, pTDFX)) - return 0; - - return 1; -} - - -/** - * \brief The screen is being closed, so clean up any state and free any - * resources used by the DRI. - * - * \param ctx display handle. - * - * Unmaps the SAREA, closes the DRM device file descriptor and frees the driver - * private data. - */ -static void tdfxHaltFBDev( DRIDriverContext *ctx ) -{ - drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); - drmClose(ctx->drmFD); - - if (ctx->driverPrivate) { - free(ctx->driverPrivate); - ctx->driverPrivate = 0; - } -} - - -/** - * \brief Shutdown the drawing engine. - * - * \param ctx display handle - * - * Turns off the 3D engine & restores the graphics card - * to a state that fbdev understands. - */ -static int tdfxEngineShutdown( const DRIDriverContext *ctx ) -{ - fprintf(stderr, "%s: not implemented\n", __FUNCTION__); - return 1; -} - - -/** - * \brief Restore the drawing engine. - * - * \param ctx display handle - * - * Resets the graphics card and sets initial values for several registers of - * the card's drawing engine. - * - * Turns on 3dfx - */ -static int tdfxEngineRestore( const DRIDriverContext *ctx ) -{ - fprintf(stderr, "%s: not implemented\n", __FUNCTION__); - return 1; -} - - -/** - * \brief Exported driver interface for Mini GLX. - * - * \sa DRIDriverRec. - */ -struct DRIDriverRec __driDriver = { - tdfxValidateMode, - tdfxPostValidateMode, - tdfxInitFBDev, - tdfxHaltFBDev, - tdfxEngineShutdown, - tdfxEngineRestore, - 0 -}; diff --git a/src/mesa/drivers/dri/unichrome/server/via_dri.c b/src/mesa/drivers/dri/unichrome/server/via_dri.c deleted file mode 100644 index 74034485e2..0000000000 --- a/src/mesa/drivers/dri/unichrome/server/via_dri.c +++ /dev/null @@ -1,1251 +0,0 @@ -/* - * Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. - * Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#include -#include -#include -#include -#include - -#include "driver.h" -#include "drm.h" -#include "imports.h" - -#include "dri_util.h" - -#include "via_context.h" -#include "via_dri.h" -#include "via_driver.h" -#include "xf86drm.h" - -static void VIAEnableMMIO(DRIDriverContext * ctx); -static void VIADisableMMIO(DRIDriverContext * ctx); -static void VIADisableExtendedFIFO(DRIDriverContext *ctx); -static void VIAEnableExtendedFIFO(DRIDriverContext *ctx); -static void VIAInitialize2DEngine(DRIDriverContext *ctx); -static void VIAInitialize3DEngine(DRIDriverContext *ctx); - -static int VIADRIScreenInit(DRIDriverContext * ctx); -static void VIADRICloseScreen(DRIDriverContext * ctx); -static int VIADRIFinishScreenInit(DRIDriverContext * ctx); - -/* _SOLO : missing macros normally defined by X code */ -#define xf86DrvMsg(a, b, ...) fprintf(stderr, __VA_ARGS__) -#define MMIO_IN8(base, addr) ((*(((volatile uint8_t*)base)+(addr)))+0) -#define MMIO_OUT8(base, addr, val) ((*(((volatile uint8_t*)base)+(addr)))=((uint8_t)val)) -#define MMIO_OUT16(base, addr, val) ((*(volatile uint16_t*)(((uint8_t*)base)+(addr)))=((uint16_t)val)) - -#define VIDEO 0 -#define AGP 1 -#define AGP_PAGE_SIZE 4096 -#define AGP_PAGES 8192 -#define AGP_SIZE (AGP_PAGE_SIZE * AGP_PAGES) -#define AGP_CMDBUF_PAGES 512 -#define AGP_CMDBUF_SIZE (AGP_PAGE_SIZE * AGP_CMDBUF_PAGES) - -static char VIAKernelDriverName[] = "via"; -static char VIAClientDriverName[] = "unichrome"; - -static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia); -static int VIADRIPciInit(DRIDriverContext * ctx, VIAPtr pVia); -static int VIADRIFBInit(DRIDriverContext * ctx, VIAPtr pVia); -static int VIADRIKernelInit(DRIDriverContext * ctx, VIAPtr pVia); -static int VIADRIMapInit(DRIDriverContext * ctx, VIAPtr pVia); - -static void VIADRIIrqInit( DRIDriverContext *ctx ) -{ - VIAPtr pVia = VIAPTR(ctx); - VIADRIPtr pVIADRI = pVia->devPrivate; - - pVIADRI->irqEnabled = drmGetInterruptFromBusID(pVia->drmFD, - ctx->pciBus, - ctx->pciDevice, - ctx->pciFunc); - - if ((drmCtlInstHandler(pVia->drmFD, pVIADRI->irqEnabled))) { - xf86DrvMsg(pScreen->myNum, X_WARNING, - "[drm] Failure adding irq handler. " - "Falling back to irq-free operation.\n"); - pVIADRI->irqEnabled = 0; - } - - if (pVIADRI->irqEnabled) - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] Irq handler installed, using IRQ %d.\n", - pVIADRI->irqEnabled); -} - -static void VIADRIIrqExit( DRIDriverContext *ctx ) { - VIAPtr pVia = VIAPTR(ctx); - VIADRIPtr pVIADRI = pVia->devPrivate; - - if (pVIADRI->irqEnabled) { - if (drmCtlUninstHandler(pVia->drmFD)) { - xf86DrvMsg(pScreen-myNum, X_INFO,"[drm] Irq handler uninstalled.\n"); - } else { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] Could not uninstall irq handler.\n"); - } - } -} - -static void VIADRIRingBufferCleanup(DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - VIADRIPtr pVIADRI = pVia->devPrivate; - drm_via_dma_init_t ringBufInit; - - if (pVIADRI->ringBufActive) { - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] Cleaning up DMA ring-buffer.\n"); - ringBufInit.func = VIA_CLEANUP_DMA; - if (drmCommandWrite(pVia->drmFD, DRM_VIA_DMA_INIT, &ringBufInit, - sizeof(ringBufInit))) { - xf86DrvMsg(pScreen->myNum, X_WARNING, - "[drm] Failed to clean up DMA ring-buffer: %d\n", errno); - } - pVIADRI->ringBufActive = 0; - } -} - -static int VIADRIRingBufferInit(DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - VIADRIPtr pVIADRI = pVia->devPrivate; - drm_via_dma_init_t ringBufInit; - drmVersionPtr drmVer; - - pVIADRI->ringBufActive = 0; - - if (NULL == (drmVer = drmGetVersion(pVia->drmFD))) { - return GL_FALSE; - } - - if (((drmVer->version_major <= 1) && (drmVer->version_minor <= 3))) { - return GL_FALSE; - } - - /* - * Info frome code-snippet on DRI-DEVEL list; Erdi Chen. - */ - - switch (pVia->ChipId) { - case PCI_CHIP_VT3259: - ringBufInit.reg_pause_addr = 0x40c; - break; - default: - ringBufInit.reg_pause_addr = 0x418; - break; - } - - ringBufInit.offset = pVia->agpSize; - ringBufInit.size = AGP_CMDBUF_SIZE; - ringBufInit.func = VIA_INIT_DMA; - if (drmCommandWrite(pVia->drmFD, DRM_VIA_DMA_INIT, &ringBufInit, - sizeof(ringBufInit))) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] Failed to initialize DMA ring-buffer: %d\n", errno); - return GL_FALSE; - } - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] Initialized AGP ring-buffer, size 0x%lx at AGP offset 0x%lx.\n", - ringBufInit.size, ringBufInit.offset); - - pVIADRI->ringBufActive = 1; - return GL_TRUE; -} - -static int VIADRIAgpInit(const DRIDriverContext *ctx, VIAPtr pVia) -{ - unsigned long agp_phys; - drmAddress agpaddr; - VIADRIPtr pVIADRI; - pVIADRI = pVia->devPrivate; - pVia->agpSize = 0; - - if (drmAgpAcquire(pVia->drmFD) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpAcquire failed %d\n", errno); - return GL_FALSE; - } - - if (drmAgpEnable(pVia->drmFD, drmAgpGetMode(pVia->drmFD)&~0x0) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAgpEnable failed\n"); - return GL_FALSE; - } - - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] drmAgpEnabled succeeded\n"); - - if (drmAgpAlloc(pVia->drmFD, AGP_SIZE, 0, &agp_phys, &pVia->agpHandle) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] drmAgpAlloc failed\n"); - drmAgpRelease(pVia->drmFD); - return GL_FALSE; - } - - if (drmAgpBind(pVia->drmFD, pVia->agpHandle, 0) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] drmAgpBind failed\n"); - drmAgpFree(pVia->drmFD, pVia->agpHandle); - drmAgpRelease(pVia->drmFD); - - return GL_FALSE; - } - - /* - * Place the ring-buffer last in the AGP region, and restrict the - * public map not to include the buffer for security reasons. - */ - - pVia->agpSize = AGP_SIZE - AGP_CMDBUF_SIZE; - pVia->agpAddr = drmAgpBase(pVia->drmFD); - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] agpAddr = 0x%08lx\n",pVia->agpAddr); - - pVIADRI->agp.size = pVia->agpSize; - if (drmAddMap(pVia->drmFD, (drm_handle_t)0, - pVIADRI->agp.size, DRM_AGP, 0, - &pVIADRI->agp.handle) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] Failed to map public agp area\n"); - pVIADRI->agp.size = 0; - return GL_FALSE; - } - /* Map AGP from kernel to Xserver - Not really needed */ - drmMap(pVia->drmFD, pVIADRI->agp.handle,pVIADRI->agp.size, &agpaddr); - - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] agpAddr = 0x%08lx\n", pVia->agpAddr); - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] agpSize = 0x%08lx\n", pVia->agpSize); - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] agp physical addr = 0x%08lx\n", agp_phys); - - { - drm_via_agp_t agp; - agp.offset = 0; - agp.size = AGP_SIZE-AGP_CMDBUF_SIZE; - if (drmCommandWrite(pVia->drmFD, DRM_VIA_AGP_INIT, &agp, - sizeof(drm_via_agp_t)) < 0) { - drmUnmap(&agpaddr,pVia->agpSize); - drmRmMap(pVia->drmFD,pVIADRI->agp.handle); - drmAgpUnbind(pVia->drmFD, pVia->agpHandle); - drmAgpFree(pVia->drmFD, pVia->agpHandle); - drmAgpRelease(pVia->drmFD); - return GL_FALSE; - } - } - - return GL_TRUE; -} - -static int VIADRIFBInit(DRIDriverContext * ctx, VIAPtr pVia) -{ - int FBSize = pVia->FBFreeEnd-pVia->FBFreeStart; - int FBOffset = pVia->FBFreeStart; - VIADRIPtr pVIADRI = pVia->devPrivate; - pVIADRI->fbOffset = FBOffset; - pVIADRI->fbSize = pVia->videoRambytes; - - { - drm_via_fb_t fb; - fb.offset = FBOffset; - fb.size = FBSize; - - if (drmCommandWrite(pVia->drmFD, DRM_VIA_FB_INIT, &fb, - sizeof(drm_via_fb_t)) < 0) { - xf86DrvMsg(pScreen->myNum, X_ERROR, - "[drm] failed to init frame buffer area\n"); - return GL_FALSE; - } else { - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] FBFreeStart= 0x%08x FBFreeEnd= 0x%08x " - "FBSize= 0x%08x\n", - pVia->FBFreeStart, pVia->FBFreeEnd, FBSize); - return GL_TRUE; - } - } -} - -static int VIADRIPciInit(DRIDriverContext * ctx, VIAPtr pVia) -{ - return GL_TRUE; -} - -static int VIADRIScreenInit(DRIDriverContext * ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - VIADRIPtr pVIADRI; - int err; - -#if 0 - ctx->shared.SAREASize = ((sizeof(drm_sarea_t) + 0xfff) & 0x1000); -#else - if (sizeof(drm_sarea_t)+sizeof(drm_via_sarea_t) > SAREA_MAX) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Data does not fit in SAREA\n"); - return GL_FALSE; - } - ctx->shared.SAREASize = SAREA_MAX; -#endif - - ctx->drmFD = drmOpen(VIAKernelDriverName, NULL); - if (ctx->drmFD < 0) { - fprintf(stderr, "[drm] drmOpen failed\n"); - return 0; - } - pVia->drmFD = ctx->drmFD; - - err = drmSetBusid(ctx->drmFD, ctx->pciBusID); - if (err < 0) { - fprintf(stderr, "[drm] drmSetBusid failed (%d, %s), %s\n", - ctx->drmFD, ctx->pciBusID, strerror(-err)); - return 0; - } - - err = drmAddMap(ctx->drmFD, 0, ctx->shared.SAREASize, DRM_SHM, - DRM_CONTAINS_LOCK, &ctx->shared.hSAREA); - if (err < 0) { - fprintf(stderr, "[drm] drmAddMap failed\n"); - return 0; - } - fprintf(stderr, "[drm] added %d byte SAREA at 0x%08lx\n", - ctx->shared.SAREASize, ctx->shared.hSAREA); - - if (drmMap(ctx->drmFD, - ctx->shared.hSAREA, - ctx->shared.SAREASize, - (drmAddressPtr)(&ctx->pSAREA)) < 0) - { - fprintf(stderr, "[drm] drmMap failed\n"); - return 0; - } - memset(ctx->pSAREA, 0, ctx->shared.SAREASize); - fprintf(stderr, "[drm] mapped SAREA 0x%08lx to %p, size %d\n", - ctx->shared.hSAREA, ctx->pSAREA, ctx->shared.SAREASize); - - /* Need to AddMap the framebuffer and mmio regions here: - */ - if (drmAddMap(ctx->drmFD, - (drm_handle_t)ctx->FBStart, - ctx->FBSize, - DRM_FRAME_BUFFER, -#ifndef _EMBEDDED - 0, -#else - DRM_READ_ONLY, -#endif - &ctx->shared.hFrameBuffer) < 0) - { - fprintf(stderr, "[drm] drmAddMap framebuffer failed\n"); - return 0; - } - - fprintf(stderr, "[drm] framebuffer handle = 0x%08lx\n", - ctx->shared.hFrameBuffer); - - pVIADRI = (VIADRIPtr) CALLOC(sizeof(VIADRIRec)); - if (!pVIADRI) { - drmClose(ctx->drmFD); - return GL_FALSE; - } - pVia->devPrivate = pVIADRI; - ctx->driverClientMsg = pVIADRI; - ctx->driverClientMsgSize = sizeof(*pVIADRI); - - /* DRIScreenInit doesn't add all the common mappings. Add additional mappings here. */ - if (!VIADRIMapInit(ctx, pVia)) { - VIADRICloseScreen(ctx); - return GL_FALSE; - } - - pVIADRI->regs.size = VIA_MMIO_REGSIZE; - pVIADRI->regs.handle = pVia->registerHandle; - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] mmio Registers = 0x%08lx\n", - pVIADRI->regs.handle); - - if (drmMap(pVia->drmFD, - pVIADRI->regs.handle, - pVIADRI->regs.size, - (drmAddress *)&pVia->MapBase) != 0) - { - VIADRICloseScreen(ctx); - return GL_FALSE; - } - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] mmio mapped.\n" ); - - VIAEnableMMIO(ctx); - - /* Get video memory clock. */ - VGAOUT8(0x3D4, 0x3D); - pVia->MemClk = (VGAIN8(0x3D5) & 0xF0) >> 4; - xf86DrvMsg(0, X_INFO, "[dri] MemClk (0x%x)\n", pVia->MemClk); - - /* 3D rendering has noise if not enabled. */ - VIAEnableExtendedFIFO(ctx); - - VIAInitialize2DEngine(ctx); - - /* Must disable MMIO or 3D won't work. */ - VIADisableMMIO(ctx); - - VIAInitialize3DEngine(ctx); - - pVia->IsPCI = !VIADRIAgpInit(ctx, pVia); - - if (pVia->IsPCI) { - VIADRIPciInit(ctx, pVia); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] use pci.\n" ); - } - else - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] use agp.\n" ); - - if (!(VIADRIFBInit(ctx, pVia))) { - VIADRICloseScreen(ctx); - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] frame buffer initialize fail .\n" ); - return GL_FALSE; - } - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] frame buffer initialized.\n" ); - - return VIADRIFinishScreenInit(ctx); -} - -static void -VIADRICloseScreen(DRIDriverContext * ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - VIADRIPtr pVIADRI=(VIADRIPtr)pVia->devPrivate; - - VIADRIRingBufferCleanup(ctx); - - if (pVia->MapBase) { - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Unmapping MMIO registers\n"); - drmUnmap(pVia->MapBase, pVIADRI->regs.size); - } - - if (pVia->agpSize) { - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Freeing agp memory\n"); - drmAgpFree(pVia->drmFD, pVia->agpHandle); - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Releasing agp module\n"); - drmAgpRelease(pVia->drmFD); - } - -#if 0 - if (pVia->DRIIrqEnable) -#endif - VIADRIIrqExit(ctx); -} - -static int -VIADRIFinishScreenInit(DRIDriverContext * ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - VIADRIPtr pVIADRI; - int err; - - err = drmCreateContext(ctx->drmFD, &ctx->serverContext); - if (err != 0) { - fprintf(stderr, "%s: drmCreateContext failed %d\n", __FUNCTION__, err); - return GL_FALSE; - } - - DRM_LOCK(ctx->drmFD, ctx->pSAREA, ctx->serverContext, 0); - - - if (!VIADRIKernelInit(ctx, pVia)) { - VIADRICloseScreen(ctx); - return GL_FALSE; - } - xf86DrvMsg(pScreen->myNum, X_INFO, "[dri] kernel data initialized.\n"); - - /* set SAREA value */ - { - drm_via_sarea_t *saPriv; - - saPriv=(drm_via_sarea_t*)(((char*)ctx->pSAREA) + - sizeof(drm_sarea_t)); - assert(saPriv); - memset(saPriv, 0, sizeof(*saPriv)); - saPriv->ctxOwner = -1; - } - pVIADRI=(VIADRIPtr)pVia->devPrivate; - pVIADRI->deviceID=pVia->Chipset; - pVIADRI->width=ctx->shared.virtualWidth; - pVIADRI->height=ctx->shared.virtualHeight; - pVIADRI->mem=ctx->shared.fbSize; - pVIADRI->bytesPerPixel= (ctx->bpp+7) / 8; - pVIADRI->sarea_priv_offset = sizeof(drm_sarea_t); - /* TODO */ - pVIADRI->scrnX=pVIADRI->width; - pVIADRI->scrnY=pVIADRI->height; - - /* Initialize IRQ */ -#if 0 - if (pVia->DRIIrqEnable) -#endif - VIADRIIrqInit(ctx); - - pVIADRI->ringBufActive = 0; - VIADRIRingBufferInit(ctx); - - return GL_TRUE; -} - -/* Initialize the kernel data structures. */ -static int VIADRIKernelInit(DRIDriverContext * ctx, VIAPtr pVia) -{ - drm_via_init_t drmInfo; - memset(&drmInfo, 0, sizeof(drm_via_init_t)); - drmInfo.sarea_priv_offset = sizeof(drm_sarea_t); - drmInfo.func = VIA_INIT_MAP; - drmInfo.fb_offset = pVia->FrameBufferBase; - drmInfo.mmio_offset = pVia->registerHandle; - if (pVia->IsPCI) - drmInfo.agpAddr = (uint32_t)NULL; - else - drmInfo.agpAddr = (uint32_t)pVia->agpAddr; - - if ((drmCommandWrite(pVia->drmFD, DRM_VIA_MAP_INIT,&drmInfo, - sizeof(drm_via_init_t))) < 0) - return GL_FALSE; - - return GL_TRUE; -} -/* Add a map for the MMIO registers */ -static int VIADRIMapInit(DRIDriverContext * ctx, VIAPtr pVia) -{ - int flags = 0; - - if (drmAddMap(pVia->drmFD, pVia->MmioBase, VIA_MMIO_REGSIZE, - DRM_REGISTERS, flags, &pVia->registerHandle) < 0) { - return GL_FALSE; - } - - xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] register handle = 0x%08lx\n", pVia->registerHandle); - - return GL_TRUE; -} - -static int viaValidateMode(const DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - - return 1; -} - -static int viaPostValidateMode(const DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - - return 1; -} - -static void VIAEnableMMIO(DRIDriverContext * ctx) -{ - /*vgaHWPtr hwp = VGAHWPTR(ctx);*/ - VIAPtr pVia = VIAPTR(ctx); - unsigned char val; - -#if 0 - if (xf86IsPrimaryPci(pVia->PciInfo)) { - /* If we are primary card, we still use std vga port. If we use - * MMIO, system will hang in vgaHWSave when our card used in - * PLE and KLE (integrated Trident MVP4) - */ - vgaHWSetStdFuncs(hwp); - } - else { - vgaHWSetMmioFuncs(hwp, pVia->MapBase, 0x8000); - } -#endif - - val = VGAIN8(0x3c3); - VGAOUT8(0x3c3, val | 0x01); - val = VGAIN8(0x3cc); - VGAOUT8(0x3c2, val | 0x01); - - /* Unlock Extended IO Space */ - VGAOUT8(0x3c4, 0x10); - VGAOUT8(0x3c5, 0x01); - - /* Enable MMIO */ - if(!pVia->IsSecondary) { - VGAOUT8(0x3c4, 0x1a); - val = VGAIN8(0x3c5); -#ifdef DEBUG - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "primary val = %x\n", val); -#endif - VGAOUT8(0x3c5, val | 0x68); - } - else { - VGAOUT8(0x3c4, 0x1a); - val = VGAIN8(0x3c5); -#ifdef DEBUG - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "secondary val = %x\n", val); -#endif - VGAOUT8(0x3c5, val | 0x38); - } - - /* Unlock CRTC registers */ - VGAOUT8(0x3d4, 0x47); - VGAOUT8(0x3d5, 0x00); - - return; -} - -static void VIADisableMMIO(DRIDriverContext * ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - unsigned char val; - - VGAOUT8(0x3c4, 0x1a); - val = VGAIN8(0x3c5); - VGAOUT8(0x3c5, val & 0x97); - - return; -} - -static void VIADisableExtendedFIFO(DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - uint32_t dwGE230, dwGE298; - - /* Cause of exit XWindow will dump back register value, others chipset no - * need to set extended fifo value */ - if (pVia->Chipset == VIA_CLE266 && pVia->ChipRev < 15 && - (ctx->shared.virtualWidth > 1024 || pVia->HasSecondary)) { - /* Turn off Extend FIFO */ - /* 0x298[29] */ - dwGE298 = VIAGETREG(0x298); - VIASETREG(0x298, dwGE298 | 0x20000000); - /* 0x230[21] */ - dwGE230 = VIAGETREG(0x230); - VIASETREG(0x230, dwGE230 & ~0x00200000); - /* 0x298[29] */ - dwGE298 = VIAGETREG(0x298); - VIASETREG(0x298, dwGE298 & ~0x20000000); - } -} - -static void VIAEnableExtendedFIFO(DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - uint8_t bRegTemp; - uint32_t dwGE230, dwGE298; - - switch (pVia->Chipset) { - case VIA_CLE266: - if (pVia->ChipRev > 14) { /* For 3123Cx */ - if (pVia->HasSecondary) { /* SAMM or DuoView case */ - if (ctx->shared.virtualWidth >= 1024) - { - /* 3c5.16[0:5] */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp |= 0x1C; - VGAOUT8(0x3C5, bRegTemp); - /* 3c5.17[0:6] */ - VGAOUT8(0x3C4, 0x17); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x7F; - bRegTemp |= 0x3F; - VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = GL_TRUE; - } - } - else /* Single view or Simultaneoue case */ - { - if (ctx->shared.virtualWidth > 1024) - { - /* 3c5.16[0:5] */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp |= 0x17; - VGAOUT8(0x3C5, bRegTemp); - /* 3c5.17[0:6] */ - VGAOUT8(0x3C4, 0x17); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x7F; - bRegTemp |= 0x2F; - VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = GL_TRUE; - } - } - /* 3c5.18[0:5] */ - VGAOUT8(0x3C4, 0x18); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp |= 0x17; - bRegTemp |= 0x40; /* force the preq always higher than treq */ - VGAOUT8(0x3C5, bRegTemp); - } - else { /* for 3123Ax */ - if (ctx->shared.virtualWidth > 1024 || pVia->HasSecondary) { - /* Turn on Extend FIFO */ - /* 0x298[29] */ - dwGE298 = VIAGETREG(0x298); - VIASETREG(0x298, dwGE298 | 0x20000000); - /* 0x230[21] */ - dwGE230 = VIAGETREG(0x230); - VIASETREG(0x230, dwGE230 | 0x00200000); - /* 0x298[29] */ - dwGE298 = VIAGETREG(0x298); - VIASETREG(0x298, dwGE298 & ~0x20000000); - - /* 3c5.16[0:5] */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp |= 0x17; - /* bRegTemp |= 0x10; */ - VGAOUT8(0x3C5, bRegTemp); - /* 3c5.17[0:6] */ - VGAOUT8(0x3C4, 0x17); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x7F; - bRegTemp |= 0x2F; - /*bRegTemp |= 0x1F;*/ - VGAOUT8(0x3C5, bRegTemp); - /* 3c5.18[0:5] */ - VGAOUT8(0x3C4, 0x18); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp |= 0x17; - bRegTemp |= 0x40; /* force the preq always higher than treq */ - VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = GL_TRUE; - } - } - break; - case VIA_KM400: - if (pVia->HasSecondary) { /* SAMM or DuoView case */ - if ((ctx->shared.virtualWidth >= 1600) && - (pVia->MemClk <= VIA_MEM_DDR200)) { - /* enable CRT extendded FIFO */ - VGAOUT8(0x3C4, 0x17); - VGAOUT8(0x3C5, 0x1C); - /* revise second display queue depth and read threshold */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp = (bRegTemp) | (0x09); - VGAOUT8(0x3C5, bRegTemp); - } - else { - /* enable CRT extendded FIFO */ - VGAOUT8(0x3C4, 0x17); - VGAOUT8(0x3C5,0x3F); - /* revise second display queue depth and read threshold */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp = (bRegTemp) | (0x1C); - VGAOUT8(0x3C5, bRegTemp); - } - /* 3c5.18[0:5] */ - VGAOUT8(0x3C4, 0x18); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp |= 0x17; - bRegTemp |= 0x40; /* force the preq always higher than treq */ - VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = GL_TRUE; - } - else { - if ( (ctx->shared.virtualWidth > 1024) && (ctx->shared.virtualWidth <= 1280) ) - { - /* enable CRT extendded FIFO */ - VGAOUT8(0x3C4, 0x17); - VGAOUT8(0x3C5, 0x3F); - /* revise second display queue depth and read threshold */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp = (bRegTemp) | (0x17); - VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = GL_TRUE; - } - else if ((ctx->shared.virtualWidth > 1280)) - { - /* enable CRT extendded FIFO */ - VGAOUT8(0x3C4, 0x17); - VGAOUT8(0x3C5, 0x3F); - /* revise second display queue depth and read threshold */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp = (bRegTemp) | (0x1C); - VGAOUT8(0x3C5, bRegTemp); - pVia->EnableExtendedFIFO = GL_TRUE; - } - else - { - /* enable CRT extendded FIFO */ - VGAOUT8(0x3C4, 0x17); - VGAOUT8(0x3C5, 0x3F); - /* revise second display queue depth and read threshold */ - VGAOUT8(0x3C4, 0x16); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp = (bRegTemp) | (0x10); - VGAOUT8(0x3C5, bRegTemp); - } - /* 3c5.18[0:5] */ - VGAOUT8(0x3C4, 0x18); - bRegTemp = VGAIN8(0x3C5); - bRegTemp &= ~0x3F; - bRegTemp |= 0x17; - bRegTemp |= 0x40; /* force the preq always higher than treq */ - VGAOUT8(0x3C5, bRegTemp); - } - break; - case VIA_K8M800: - /*=* R1 Display FIFO depth (384 /8 -1 -> 0xbf) SR17[7:0] (8bits) *=*/ - VGAOUT8(0x3c4, 0x17); - VGAOUT8(0x3c5, 0xbf); - - /*=* R2 Display fetch datum threshold value (328/4 -> 0x52) - SR16[5:0], SR16[7] (7bits) *=*/ - VGAOUT8(0x3c4, 0x16); - bRegTemp = VGAIN8(0x3c5) & ~0xBF; - bRegTemp |= (0x52 & 0x3F); - bRegTemp |= ((0x52 & 0x40) << 1); - VGAOUT8(0x3c5, bRegTemp); - - /*=* R3 Switch to the highest agent threshold value (74 -> 0x4a) - SR18[5:0], SR18[7] (7bits) *=*/ - VGAOUT8(0x3c4, 0x18); - bRegTemp = VGAIN8(0x3c5) & ~0xBF; - bRegTemp |= (0x4a & 0x3F); - bRegTemp |= ((0x4a & 0x40) << 1); - VGAOUT8(0x3c5, bRegTemp); -#if 0 - /*=* R4 Fetch Number for a scan line (unit: 8 bytes) - SR1C[7:0], SR1D[1:0] (10bits) *=*/ - wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; - VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); - VGAOUT8(0x3c4, 0x1d); - bRegTemp = VGAIN8(0x3c5) & ~0x03; - VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); -#endif - if (ctx->shared.virtualWidth >= 1400 && ctx->bpp == 32) - { - /*=* Max. length for a request SR22[4:0] (64/4 -> 0x10) *=*/ - VGAOUT8(0x3c4, 0x22); - bRegTemp = VGAIN8(0x3c5) & ~0x1F; - VGAOUT8(0x3c5, bRegTemp | 0x10); - } - else - { - /*=* Max. length for a request SR22[4:0] - (128/4 -> over flow 0x0) *=*/ - VGAOUT8(0x3c4, 0x22); - bRegTemp = VGAIN8(0x3c5) & ~0x1F; - VGAOUT8(0x3c5, bRegTemp); - } - break; - case VIA_PM800: - /*=* R1 Display FIFO depth (96-1 -> 0x5f) SR17[7:0] (8bits) *=*/ - VGAOUT8(0x3c4, 0x17); - VGAOUT8(0x3c5, 0x5f); - - /*=* R2 Display fetch datum threshold value (32 -> 0x20) - SR16[5:0], SR16[7] (7bits) *=*/ - VGAOUT8(0x3c4, 0x16); - bRegTemp = VGAIN8(0x3c5) & ~0xBF; - bRegTemp |= (0x20 & 0x3F); - bRegTemp |= ((0x20 & 0x40) << 1); - VGAOUT8(0x3c5, bRegTemp); - - /*=* R3 Switch to the highest agent threshold value (16 -> 0x10) - SR18[5:0], SR18[7] (7bits) *=*/ - VGAOUT8(0x3c4, 0x18); - bRegTemp = VGAIN8(0x3c5) & ~0xBF; - bRegTemp |= (0x10 & 0x3F); - bRegTemp |= ((0x10 & 0x40) << 1); - VGAOUT8(0x3c5, bRegTemp); -#if 0 - /*=* R4 Fetch Number for a scan line (unit: 8 bytes) - SR1C[7:0], SR1D[1:0] (10bits) *=*/ - wRegTemp = (pBIOSInfo->offsetWidthByQWord >> 1) + 4; - VGAOUT8(0x3c4, 0x1c); - VGAOUT8(0x3c5, (uint8_t)(wRegTemp & 0xFF)); - VGAOUT8(0x3c4, 0x1d); - bRegTemp = VGAIN8(0x3c5) & ~0x03; - VGAOUT8(0x3c5, bRegTemp | ((wRegTemp & 0x300) >> 8)); -#endif - if (ctx->shared.virtualWidth >= 1400 && ctx->bpp == 32) - { - /*=* Max. length for a request SR22[4:0] (64/4 -> 0x10) *=*/ - VGAOUT8(0x3c4, 0x22); - bRegTemp = VGAIN8(0x3c5) & ~0x1F; - VGAOUT8(0x3c5, bRegTemp | 0x10); - } - else - { - /*=* Max. length for a request SR22[4:0] (0x1F) *=*/ - VGAOUT8(0x3c4, 0x22); - bRegTemp = VGAIN8(0x3c5) & ~0x1F; - VGAOUT8(0x3c5, bRegTemp | 0x1F); - } - break; - default: - break; - } -} - -static void VIAInitialize2DEngine(DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - uint32_t dwVQStartAddr, dwVQEndAddr; - uint32_t dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; - uint32_t dwGEMode; - - /* init 2D engine regs to reset 2D engine */ - VIASETREG(0x04, 0x0); - VIASETREG(0x08, 0x0); - VIASETREG(0x0c, 0x0); - VIASETREG(0x10, 0x0); - VIASETREG(0x14, 0x0); - VIASETREG(0x18, 0x0); - VIASETREG(0x1c, 0x0); - VIASETREG(0x20, 0x0); - VIASETREG(0x24, 0x0); - VIASETREG(0x28, 0x0); - VIASETREG(0x2c, 0x0); - VIASETREG(0x30, 0x0); - VIASETREG(0x34, 0x0); - VIASETREG(0x38, 0x0); - VIASETREG(0x3c, 0x0); - VIASETREG(0x40, 0x0); - - VIADisableMMIO(ctx); - - /* Init AGP and VQ regs */ - VIASETREG(0x43c, 0x00100000); - VIASETREG(0x440, 0x00000000); - VIASETREG(0x440, 0x00333004); - VIASETREG(0x440, 0x60000000); - VIASETREG(0x440, 0x61000000); - VIASETREG(0x440, 0x62000000); - VIASETREG(0x440, 0x63000000); - VIASETREG(0x440, 0x64000000); - VIASETREG(0x440, 0x7D000000); - - VIASETREG(0x43c, 0xfe020000); - VIASETREG(0x440, 0x00000000); - - if (pVia->VQStart != 0) { - /* Enable VQ */ - dwVQStartAddr = pVia->VQStart; - dwVQEndAddr = pVia->VQEnd; - dwVQStartL = 0x50000000 | (dwVQStartAddr & 0xFFFFFF); - dwVQEndL = 0x51000000 | (dwVQEndAddr & 0xFFFFFF); - dwVQStartEndH = 0x52000000 | ((dwVQStartAddr & 0xFF000000) >> 24) | - ((dwVQEndAddr & 0xFF000000) >> 16); - dwVQLen = 0x53000000 | (VIA_VQ_SIZE >> 3); - - VIASETREG(0x43c, 0x00fe0000); - VIASETREG(0x440, 0x080003fe); - VIASETREG(0x440, 0x0a00027c); - VIASETREG(0x440, 0x0b000260); - VIASETREG(0x440, 0x0c000274); - VIASETREG(0x440, 0x0d000264); - VIASETREG(0x440, 0x0e000000); - VIASETREG(0x440, 0x0f000020); - VIASETREG(0x440, 0x1000027e); - VIASETREG(0x440, 0x110002fe); - VIASETREG(0x440, 0x200f0060); - - VIASETREG(0x440, 0x00000006); - VIASETREG(0x440, 0x40008c0f); - VIASETREG(0x440, 0x44000000); - VIASETREG(0x440, 0x45080c04); - VIASETREG(0x440, 0x46800408); - - VIASETREG(0x440, dwVQStartEndH); - VIASETREG(0x440, dwVQStartL); - VIASETREG(0x440, dwVQEndL); - VIASETREG(0x440, dwVQLen); - } - else { - /* Diable VQ */ - VIASETREG(0x43c, 0x00fe0000); - VIASETREG(0x440, 0x00000004); - VIASETREG(0x440, 0x40008c0f); - VIASETREG(0x440, 0x44000000); - VIASETREG(0x440, 0x45080c04); - VIASETREG(0x440, 0x46800408); - } - - dwGEMode = 0; - - switch (ctx->bpp) { - case 16: - dwGEMode |= VIA_GEM_16bpp; - break; - case 32: - dwGEMode |= VIA_GEM_32bpp; - break; - default: - dwGEMode |= VIA_GEM_8bpp; - break; - } - -#if 0 - switch (ctx->shared.virtualWidth) { - case 800: - dwGEMode |= VIA_GEM_800; - break; - case 1024: - dwGEMode |= VIA_GEM_1024; - break; - case 1280: - dwGEMode |= VIA_GEM_1280; - break; - case 1600: - dwGEMode |= VIA_GEM_1600; - break; - case 2048: - dwGEMode |= VIA_GEM_2048; - break; - default: - dwGEMode |= VIA_GEM_640; - break; - } -#endif - - VIAEnableMMIO(ctx); - - /* Set BPP and Pitch */ - VIASETREG(VIA_REG_GEMODE, dwGEMode); - - /* Set Src and Dst base address and pitch, pitch is qword */ - VIASETREG(VIA_REG_SRCBASE, 0x0); - VIASETREG(VIA_REG_DSTBASE, 0x0); - VIASETREG(VIA_REG_PITCH, VIA_PITCH_ENABLE | - ((ctx->shared.virtualWidth * ctx->bpp >> 3) >> 3) | - (((ctx->shared.virtualWidth * ctx->bpp >> 3) >> 3) << 16)); -} - -static int b3DRegsInitialized = 0; - -static void VIAInitialize3DEngine(DRIDriverContext *ctx) -{ - VIAPtr pVia = VIAPTR(ctx); - int i; - - if (!b3DRegsInitialized) - { - - VIASETREG(0x43C, 0x00010000); - - for (i = 0; i <= 0x7D; i++) - { - VIASETREG(0x440, (uint32_t) i << 24); - } - - VIASETREG(0x43C, 0x00020000); - - for (i = 0; i <= 0x94; i++) - { - VIASETREG(0x440, (uint32_t) i << 24); - } - - VIASETREG(0x440, 0x82400000); - - VIASETREG(0x43C, 0x01020000); - - - for (i = 0; i <= 0x94; i++) - { - VIASETREG(0x440, (uint32_t) i << 24); - } - - VIASETREG(0x440, 0x82400000); - VIASETREG(0x43C, 0xfe020000); - - for (i = 0; i <= 0x03; i++) - { - VIASETREG(0x440, (uint32_t) i << 24); - } - - VIASETREG(0x43C, 0x00030000); - - for (i = 0; i <= 0xff; i++) - { - VIASETREG(0x440, 0); - } - VIASETREG(0x43C, 0x00100000); - VIASETREG(0x440, 0x00333004); - VIASETREG(0x440, 0x10000002); - VIASETREG(0x440, 0x60000000); - VIASETREG(0x440, 0x61000000); - VIASETREG(0x440, 0x62000000); - VIASETREG(0x440, 0x63000000); - VIASETREG(0x440, 0x64000000); - - VIASETREG(0x43C, 0x00fe0000); - - if (pVia->ChipRev >= 3 ) - VIASETREG(0x440,0x40008c0f); - else - VIASETREG(0x440,0x4000800f); - - VIASETREG(0x440,0x44000000); - VIASETREG(0x440,0x45080C04); - VIASETREG(0x440,0x46800408); - VIASETREG(0x440,0x50000000); - VIASETREG(0x440,0x51000000); - VIASETREG(0x440,0x52000000); - VIASETREG(0x440,0x53000000); - - b3DRegsInitialized = 1; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "3D Engine has been initialized.\n"); - } - - VIASETREG(0x43C,0x00fe0000); - VIASETREG(0x440,0x08000001); - VIASETREG(0x440,0x0A000183); - VIASETREG(0x440,0x0B00019F); - VIASETREG(0x440,0x0C00018B); - VIASETREG(0x440,0x0D00019B); - VIASETREG(0x440,0x0E000000); - VIASETREG(0x440,0x0F000000); - VIASETREG(0x440,0x10000000); - VIASETREG(0x440,0x11000000); - VIASETREG(0x440,0x20000000); -} - -static int -WaitIdleCLE266(VIAPtr pVia) -{ - int loop = 0; - - /*mem_barrier();*/ - - while (!(VIAGETREG(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && (loop++ < MAXLOOP)) - ; - - while ((VIAGETREG(VIA_REG_STATUS) & - (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) && - (loop++ < MAXLOOP)) - ; - - return loop >= MAXLOOP; -} - -static int viaInitFBDev(DRIDriverContext *ctx) -{ - VIAPtr pVia = CALLOC(sizeof(*pVia)); - - ctx->driverPrivate = (void *)pVia; - - switch (ctx->chipset) { - case PCI_CHIP_CLE3122: - case PCI_CHIP_CLE3022: - pVia->Chipset = VIA_CLE266; - break; - case PCI_CHIP_VT7205: - case PCI_CHIP_VT3205: - pVia->Chipset = VIA_KM400; - break; - case PCI_CHIP_VT3204: - case PCI_CHIP_VT3344: - pVia->Chipset = VIA_K8M800; - break; - case PCI_CHIP_VT3259: - pVia->Chipset = VIA_PM800; - break; - default: - xf86DrvMsg(0, X_ERROR, "VIA: Unknown device ID (0x%x)\n", ctx->chipset); - } - - /* _SOLO TODO XXX need to read ChipRev too */ - pVia->ChipRev = 0; - - pVia->videoRambytes = ctx->shared.fbSize; - pVia->MmioBase = ctx->MMIOStart; - pVia->FrameBufferBase = ctx->FBStart & 0xfc000000; - - pVia->FBFreeStart = ctx->shared.virtualWidth * ctx->cpp * - ctx->shared.virtualHeight; - -#if 1 - /* Alloc a second framebuffer for the second head */ - pVia->FBFreeStart += ctx->shared.virtualWidth * ctx->cpp * - ctx->shared.virtualHeight; -#endif - - pVia->VQStart = pVia->FBFreeStart; - pVia->VQEnd = pVia->FBFreeStart + VIA_VQ_SIZE - 1; - - pVia->FBFreeStart += VIA_VQ_SIZE; - - pVia->FBFreeEnd = pVia->videoRambytes; - - if (!VIADRIScreenInit(ctx)) - return 0; - - return 1; -} - -static void viaHaltFBDev(DRIDriverContext *ctx) -{ - drmUnmap( ctx->pSAREA, ctx->shared.SAREASize ); - drmClose(ctx->drmFD); - - if (ctx->driverPrivate) { - free(ctx->driverPrivate); - ctx->driverPrivate = 0; - } -} - -static int viaEngineShutdown(const DRIDriverContext *ctx) -{ - return 1; -} - -static int viaEngineRestore(const DRIDriverContext *ctx) -{ - return 1; -} - -const struct DRIDriverRec __driDriver = -{ - viaValidateMode, - viaPostValidateMode, - viaInitFBDev, - viaHaltFBDev, - viaEngineShutdown, - viaEngineRestore, - 0, -}; - -- cgit v1.2.3 From 9af74a38c7e85069aac9bd4a266b488b68b133f5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 5 Mar 2010 15:09:08 +0000 Subject: gallivm: Generate valid IR for LLVM 2.7. The signatures for pack intrinsics were made more consistent in this version. --- src/gallium/auxiliary/gallivm/lp_bld_pack.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_pack.c b/src/gallium/auxiliary/gallivm/lp_bld_pack.c index bc360ad77a..4c61d10749 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_pack.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_pack.c @@ -256,7 +256,9 @@ lp_build_pack2(LLVMBuilderRef builder, LLVMValueRef lo, LLVMValueRef hi) { +#if !(HAVE_LLVM >= 0x0207) LLVMTypeRef src_vec_type = lp_build_vec_type(src_type); +#endif LLVMTypeRef dst_vec_type = lp_build_vec_type(dst_type); LLVMValueRef shuffle; LLVMValueRef res; @@ -272,11 +274,14 @@ lp_build_pack2(LLVMBuilderRef builder, switch(src_type.width) { case 32: if(dst_type.sign) { +#if HAVE_LLVM >= 0x0207 + res = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packssdw.128", dst_vec_type, lo, hi); +#else res = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packssdw.128", src_vec_type, lo, hi); +#endif } else { if (util_cpu_caps.has_sse4_1) { - /* PACKUSDW is the only instrinsic with a consistent signature */ return lp_build_intrinsic_binary(builder, "llvm.x86.sse41.packusdw", dst_vec_type, lo, hi); } else { @@ -288,9 +293,17 @@ lp_build_pack2(LLVMBuilderRef builder, case 16: if(dst_type.sign) +#if HAVE_LLVM >= 0x0207 + res = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packsswb.128", dst_vec_type, lo, hi); +#else res = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packsswb.128", src_vec_type, lo, hi); +#endif else +#if HAVE_LLVM >= 0x0207 + res = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packuswb.128", dst_vec_type, lo, hi); +#else res = lp_build_intrinsic_binary(builder, "llvm.x86.sse2.packuswb.128", src_vec_type, lo, hi); +#endif break; default: -- cgit v1.2.3 From 32631b69f503c26b010fb1bef5de5dcd012a2bcb Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 5 Mar 2010 15:22:12 +0000 Subject: gallivm: Integrate udis86 on scons builds. --- src/gallium/auxiliary/SConscript | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index f365c4bbdd..c989d13359 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -7,6 +7,8 @@ env.Append(CPPPATH = [ 'util', ]) +env.Tool('udis86') + env.CodeGenerate( target = 'indices/u_indices_gen.c', script = 'indices/u_indices_gen.py', -- cgit v1.2.3 From ccf57af93f7118a044fa21e874847fa3ed555bca Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 5 Mar 2010 15:22:43 +0000 Subject: gallivm: Add a placeholder for TGSI_FILE_PREDICATE registers. --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 5f2c2a54ee..84d03a145f 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -384,6 +384,11 @@ emit_store( assert(0); break; + case TGSI_FILE_PREDICATE: + /* FIXME */ + assert(0); + break; + default: assert( 0 ); } -- cgit v1.2.3 From 89258652b6a1d282bed14549907892bdfda752f0 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 09:45:05 +0000 Subject: gallivm: Answer question/comment. This reverts commit 71c05689528d7987bfb99c3afe04e456887bc7b7. --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 84d03a145f..28ff362cac 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -586,6 +586,17 @@ emit_instruction( if (indirect_temp_reference(inst)) return FALSE; + /* + * Stores and write masks are handled in a general fashion after the long + * instruction opcode switch statement. + * + * Although not stricitly necessary, we avoid generating instructions for + * channels which won't be stored, in cases where's that easy. For some + * complex instructions, like texture sampling, it is more convenient to + * assume a full writemask and then let LLVM optimization passes eliminate + * redundant code. + */ + assert(info->num_dst <= 1); if(info->num_dst) { FOR_EACH_DST0_ENABLED_CHANNEL( inst, chan_index ) { @@ -1131,7 +1142,6 @@ emit_instruction( break; case TGSI_OPCODE_TEX: - /* XXX what about dst0 writemask? */ emit_tex( bld, inst, FALSE, FALSE, dst0 ); break; -- cgit v1.2.3 From 69602b4dd3adc54a76f8214cb6856c004bef23a2 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 10:23:07 +0000 Subject: gallivm: Add some notes about sampler static state construction. Recover some logic to make state canonical, although it is admittedly very shy compared with what could be done. We really need an helper module to make state canonical. --- src/gallium/auxiliary/gallivm/lp_bld_sample.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 6a026e468e..29cadcc15a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -62,6 +62,18 @@ lp_sampler_static_state(struct lp_sampler_static_state *state, if(!sampler) return; + /* + * We don't copy sampler state over unless it is actually enabled, to avoid + * spurious recompiles, as the sampler static state is part of the shader + * key. + * + * Ideally the state tracker or cso_cache module would make all state + * canonical, but until that happens it's better to be safe than sorry here. + * + * XXX: Actually there's much more than can be done here, especially + * regarding 1D/2D/3D/CUBE textures, wrap modes, etc. + */ + state->format = texture->format; state->target = texture->target; state->pot_width = util_is_pot(texture->width0); @@ -74,8 +86,12 @@ lp_sampler_static_state(struct lp_sampler_static_state *state, state->min_img_filter = sampler->min_img_filter; state->min_mip_filter = sampler->min_mip_filter; state->mag_img_filter = sampler->mag_img_filter; + state->compare_mode = sampler->compare_mode; - state->compare_func = sampler->compare_func; + if (sampler->compare_mode != PIPE_TEX_COMPARE_NONE) { + state->compare_func = sampler->compare_func; + } + state->normalized_coords = sampler->normalized_coords; state->lod_bias = sampler->lod_bias; state->min_lod = sampler->min_lod; -- cgit v1.2.3 From 4afae877e6914e311340e0b1d3490ec2fed9422f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 12:46:29 +0000 Subject: util: Add the shortened format name to the description. --- src/gallium/auxiliary/util/u_format.h | 6 ++++++ src/gallium/auxiliary/util/u_format_table.py | 2 ++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index e8fa0022b5..ec6b077734 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -120,8 +120,14 @@ struct util_format_channel_description struct util_format_description { enum pipe_format format; + const char *name; + /** + * Short name, striped of the prefix, lower case. + */ + const char *short_name; + /** * Pixel block dimensions. */ diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index 4e29d15f3b..f9d21ed8aa 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -90,6 +90,7 @@ def write_format_table(formats): print 'util_format_none_description = {' print " PIPE_FORMAT_NONE," print " \"PIPE_FORMAT_NONE\"," + print " \"none\"," print " {0, 0, 0}," print " 0," print " 0," @@ -105,6 +106,7 @@ def write_format_table(formats): print 'util_format_%s_description = {' % (format.short_name(),) print " %s," % (format.name,) print " \"%s\"," % (format.name,) + print " \"%s\"," % (format.short_name(),) print " {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size()) print " %s," % (layout_map(format.layout),) print " %u,\t/* nr_channels */" % (format.nr_channels(),) -- cgit v1.2.3 From cfde6c50ae6c3ce7912a3d1231c459d020d77f13 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 12:48:39 +0000 Subject: util: Add a new flag, for formats that can be described as a bitmask. --- src/gallium/auxiliary/util/u_format.h | 9 +++++++++ src/gallium/auxiliary/util/u_format_parse.py | 8 +------- src/gallium/auxiliary/util/u_format_table.py | 2 ++ 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index ec6b077734..b2aa5bfb18 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -145,6 +145,15 @@ struct util_format_description */ unsigned is_array:1; + /** + * Whether the pixel format can be described as a bitfield structure. + * + * In particular: + * - pixel depth must be 8, 16, or 32 bits; + * - all channels must be unsigned, signed, or void + */ + unsigned is_bitmask:1; + /** * Whether channels have mixed types (ignoring UTIL_FORMAT_TYPE_VOID). */ diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 250926418e..80bae6fc95 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -166,17 +166,11 @@ class Format: return True def is_bitmask(self): - if self.block_size() > 32: - return False - if not self.is_pot(): + if self.block_size() not in (8, 16, 32): return False for channel in self.channels: - if not is_pot(channel.size): - return True if channel.type not in (VOID, UNSIGNED, SIGNED): return False - if channel.size >= 32: - return False return True def inv_swizzles(self): diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index f9d21ed8aa..fb68852a53 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -96,6 +96,7 @@ def write_format_table(formats): print " 0," print " 0," print " 0," + print " 0," print " {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}," print " {0, 0, 0, 0}," print " 0" @@ -111,6 +112,7 @@ def write_format_table(formats): print " %s," % (layout_map(format.layout),) print " %u,\t/* nr_channels */" % (format.nr_channels(),) print " %s,\t/* is_array */" % (bool_map(format.is_array()),) + print " %s,\t/* is_bitmask */" % (bool_map(format.is_bitmask()),) print " %s,\t/* is_mixed */" % (bool_map(format.is_mixed()),) print " {" for i in range(4): -- cgit v1.2.3 From f342ceca3852d5b9607d1f375be26de9304a11f6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 12:49:14 +0000 Subject: util: Fix the maximum value computation for SSCALED channels. --- src/gallium/auxiliary/util/u_format_parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_parse.py b/src/gallium/auxiliary/util/u_format_parse.py index 80bae6fc95..f74dc5e88a 100755 --- a/src/gallium/auxiliary/util/u_format_parse.py +++ b/src/gallium/auxiliary/util/u_format_parse.py @@ -78,7 +78,7 @@ class Channel: if self.type == UNSIGNED: return (1 << self.size) - 1 if self.type == SIGNED: - return self.size - 1 + return (1 << (self.size - 1)) - 1 assert False def min(self): -- cgit v1.2.3 From 0869f0edf14594744f691a51cb220c13026359db Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 12:50:47 +0000 Subject: util: Several fixes to clamping and test. All tests pass here except util_format_b5g5r5a1_unorm_unpack_4ub, due to apparently a gcc 4.4.3 bug. --- src/gallium/auxiliary/util/u_format_pack.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py index 3f33f7cc02..1fc58cd3de 100644 --- a/src/gallium/auxiliary/util/u_format_pack.py +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -252,9 +252,6 @@ def conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=True if src_channel.type == FLOAT and dst_channel.type == FLOAT: return '(%s)%s' % (dst_native_type, value) - if not src_channel.norm and not dst_channel.norm: - return '(%s)%s' % (dst_native_type, value) - if clamp: value = clamp_expr(src_channel, dst_channel, dst_native_type, value) @@ -280,15 +277,15 @@ def conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=True value = '(%s * %s)' % (value, scale) return '(%s)%s' % (dst_native_type, value) - if not src_channel.norm and not dst_channel.norm: - # neither is normalized -- just cast - return '(%s)%s' % (dst_native_type, value) - if src_channel.type in (SIGNED, UNSIGNED) and dst_channel.type in (SIGNED, UNSIGNED): + if not src_channel.norm and not dst_channel.norm: + # neither is normalized -- just cast + return '(%s)%s' % (dst_native_type, value) + src_one = get_one(src_channel) dst_one = get_one(dst_channel) - if src_one > dst_one and src_channel.norm: + if src_one > dst_one and src_channel.norm and dst_channel.norm: # We can just bitshift src_shift = get_one_shift(src_channel) dst_shift = get_one_shift(dst_channel) @@ -296,7 +293,7 @@ def conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=True else: # We need to rescale using an intermediate type big enough to hold the multiplication of both tmp_native_type = intermediate_native_type(src_channel.size + dst_channel.size, src_channel.sign and dst_channel.sign) - value = '(%s)%s' % (tmp_native_type, value) + value = '((%s)%s)' % (tmp_native_type, value) value = '(%s * 0x%x / 0x%x)' % (value, dst_one, src_one) value = '(%s)%s' % (dst_native_type, value) return value -- cgit v1.2.3 From 212e7433db8e306a678666e9a3e82b0c9e1560ec Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 13:42:11 +0000 Subject: util: Move the format tests cases here so that they can be easily shared. --- src/gallium/auxiliary/Makefile | 1 + src/gallium/auxiliary/SConscript | 1 + src/gallium/auxiliary/util/u_format_tests.c | 544 ++++++++++++++++++++++++++++ src/gallium/auxiliary/util/u_format_tests.h | 69 ++++ 4 files changed, 615 insertions(+) create mode 100644 src/gallium/auxiliary/util/u_format_tests.c create mode 100644 src/gallium/auxiliary/util/u_format_tests.h (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 1d0930e024..68b1a3e854 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -107,6 +107,7 @@ C_SOURCES = \ util/u_draw_quad.c \ util/u_format_access.c \ util/u_format_table.c \ + util/u_format_tests.c \ util/u_gen_mipmap.c \ util/u_handle_table.c \ util/u_hash_table.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index c989d13359..d6185bcb5e 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -151,6 +151,7 @@ source = [ 'util/u_draw_quad.c', 'util/u_format_access.c', 'util/u_format_table.c', + 'util/u_format_tests.c', 'util/u_gen_mipmap.c', 'util/u_handle_table.c', 'util/u_hash.c', diff --git a/src/gallium/auxiliary/util/u_format_tests.c b/src/gallium/auxiliary/util/u_format_tests.c new file mode 100644 index 0000000000..182a474044 --- /dev/null +++ b/src/gallium/auxiliary/util/u_format_tests.c @@ -0,0 +1,544 @@ +/************************************************************************** + * + * Copyright 2009-2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#include "u_memory.h" +#include "u_format_tests.h" + + +/* + * Helper macros to create the packed bytes for longer words. + */ + +#define PACKED_1x8(x) {x, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_2x8(x, y) {x, y, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_3x8(x, y, z) {x, y, z, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_4x8(x, y, z, w) {x, y, z, w, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + +#define PACKED_1x16(x) {(x) & 0xff, (x) >> 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_2x16(x, y) {(x) & 0xff, (x) >> 8, (y) & 0xff, (y) >> 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_3x16(x, y, z) {(x) & 0xff, (x) >> 8, (y) & 0xff, (y) >> 8, (z) & 0xff, (z) >> 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_4x16(x, y, z, w) {(x) & 0xff, (x) >> 8, (y) & 0xff, (y) >> 8, (z) & 0xff, (z) >> 8, (w) & 0xff, (w) >> 8, 0, 0, 0, 0, 0, 0, 0, 0} + +#define PACKED_1x32(x) {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_2x32(x, y) {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24, (y) & 0xff, ((y) >> 8) & 0xff, ((y) >> 16) & 0xff, (y) >> 24, 0, 0, 0, 0, 0, 0, 0, 0} +#define PACKED_3x32(x, y, z) {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24, (y) & 0xff, ((y) >> 8) & 0xff, ((y) >> 16) & 0xff, (y) >> 24, (z) & 0xff, ((z) >> 8) & 0xff, ((z) >> 16) & 0xff, (z) >> 24, 0, 0, 0, 0} +#define PACKED_4x32(x, y, z, w) {(x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, (x) >> 24, (y) & 0xff, ((y) >> 8) & 0xff, ((y) >> 16) & 0xff, (y) >> 24, (z) & 0xff, ((z) >> 8) & 0xff, ((z) >> 16) & 0xff, (z) >> 24, (w) & 0xff, ((w) >> 8) & 0xff, ((w) >> 16) & 0xff, (w) >> 24} + + +/** + * Test cases. + * + * These were manually entered. We could generate these + * + * To keep this to a we cover only the corner cases, which should produce + * good enough coverage since that pixel format transformations are afine for + * non SRGB formats. + */ +const struct util_format_test_case +util_format_test_cases[] = +{ + + /* + * 32-bit rendertarget formats + */ + + {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x0000ff00), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00ff0000), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B8G8R8A8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x0000ff00), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0x00ff0000), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0xff000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B8G8R8X8_UNORM, PACKED_1x32(0x00ffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x0000ff00), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_A8R8G8B8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x0000ff00), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xff000000), {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_X8R8G8B8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x0000ff00), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8B8G8R8_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x000000ff), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x0000ff00), {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0x00ff0000), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xff000000), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_X8B8G8R8_UNORM, PACKED_1x32(0xffffff00), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000003ff), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x000ffc00), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x3ff00000), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xc0000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R10G10B10A2_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + /* + * 16-bit rendertarget formats + */ + + {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x001f), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x03e0), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x7c00), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x8000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G5R5A1_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x000f), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x00f0), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0f00), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xf000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B4G4R4A4_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x001f), {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x07e0), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xf800), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_B5G6R5_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}}, + + /* + * Luminance/intensity/alpha formats + */ + + {PIPE_FORMAT_L8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_L8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_A8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_A8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {0.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_I8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_I8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x00ff), {1.0, 1.0, 1.0, 0.0}}, + {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xff00), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_L8A8_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_L16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_L16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 1.0, 1.0, 1.0}}, + + /* + * TODO: SRGB formats + */ + + /* + * Mixed-signed formats + */ + + {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_4x8(0xff, 0xff, 0xff, 0x00), PACKED_4x8(0x00, 0x00, 0x00, 0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_4x8(0xff, 0xff, 0xff, 0x00), PACKED_4x8(0x7f, 0x00, 0x00, 0x00), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_4x8(0xff, 0xff, 0xff, 0x00), PACKED_4x8(0x81, 0x00, 0x00, 0x00), {-1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_4x8(0xff, 0xff, 0xff, 0x00), PACKED_4x8(0x00, 0x7f, 0x00, 0x00), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_4x8(0xff, 0xff, 0xff, 0x00), PACKED_4x8(0x00, 0x81, 0x00, 0x00), { 0.0, -1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8SG8SB8UX8U_NORM, PACKED_4x8(0xff, 0xff, 0xff, 0x00), PACKED_4x8(0x00, 0x00, 0xff, 0x00), { 0.0, 0.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x000f), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x0011), {-1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x01e0), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0x0220), { 0.0, -1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R5SG5SB6U_NORM, PACKED_1x16(0xffff), PACKED_1x16(0xfc00), { 0.0, 0.0, 1.0, 1.0}}, + + /* + * TODO: Depth-stencil formats + */ + + /* + * TODO: YUV formats + */ + + /* + * TODO: Compressed formats + */ + + /* + * Standard 8-bit integer formats + */ + + {PIPE_FORMAT_R8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8_UNORM, PACKED_1x8(0xff), PACKED_1x8(0xff), {1.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0x00), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0xff), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_UNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0xff), {1.0, 1.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0x00, 0x00), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0xff, 0x00), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0xff), {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_UNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0xff, 0xff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0x00, 0x00, 0x00), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0xff, 0x00, 0x00), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0xff, 0x00), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0xff), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8A8_UNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0xff, 0xff, 0xff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R8_USCALED, PACKED_1x8(0xff), PACKED_1x8(0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8_USCALED, PACKED_1x8(0xff), PACKED_1x8(0xff), {255.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0x00), {255.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0xff), { 0.0, 255.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_USCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0xff, 0xff), {255.0, 255.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0x00, 0x00), {255.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0xff, 0x00), { 0.0, 255.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0xff), { 0.0, 0.0, 255.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_USCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0xff, 0xff, 0xff), {255.0, 255.0, 255.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0x00, 0x00, 0x00), {255.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0xff, 0x00, 0x00), { 0.0, 255.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0xff, 0x00), { 0.0, 0.0, 255.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0xff), { 0.0, 0.0, 0.0, 255.0}}, + {PIPE_FORMAT_R8G8B8A8_USCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0xff, 0xff, 0xff, 0xff), {255.0, 255.0, 255.0, 255.0}}, + + {PIPE_FORMAT_R8_SNORM, PACKED_1x8(0xff), PACKED_1x8(0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8_SNORM, PACKED_1x8(0xff), PACKED_1x8(0x7f), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8_SNORM, PACKED_1x8(0xff), PACKED_1x8(0x81), {-1.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x7f, 0x00), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x81, 0x00), {-1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x7f), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SNORM, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x81), { 0.0, -1.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x7f, 0x00, 0x00), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x81, 0x00, 0x00), {-1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x7f, 0x00), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x81, 0x00), { 0.0, -1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x7f), { 0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SNORM, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x81), { 0.0, 0.0, -1.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x7f, 0x00, 0x00, 0x00), { 1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x81, 0x00, 0x00, 0x00), {-1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x7f, 0x00, 0x00), { 0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x81, 0x00, 0x00), { 0.0, -1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x7f, 0x00), { 0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x81, 0x00), { 0.0, 0.0, -1.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x7f), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8A8_SNORM, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x81), { 0.0, 0.0, 0.0, -1.0}}, + + {PIPE_FORMAT_R8_SSCALED, PACKED_1x8(0xff), PACKED_1x8(0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8_SSCALED, PACKED_1x8(0xff), PACKED_1x8(0x7f), { 127.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8_SSCALED, PACKED_1x8(0xff), PACKED_1x8(0x80), {-128.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x7f, 0x00), { 127.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x80, 0x00), {-128.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x7f), { 0.0, 127.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8_SSCALED, PACKED_2x8(0xff, 0xff), PACKED_2x8(0x00, 0x80), { 0.0, -128.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x00), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x7f, 0x00, 0x00), { 127.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x80, 0x00, 0x00), {-128.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x7f, 0x00), { 0.0, 127.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x80, 0x00), { 0.0, -128.0, 0.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x7f), { 0.0, 0.0, 127.0, 1.0}}, + {PIPE_FORMAT_R8G8B8_SSCALED, PACKED_3x8(0xff, 0xff, 0xff), PACKED_3x8(0x00, 0x00, 0x80), { 0.0, 0.0, -128.0, 1.0}}, + + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x00), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x7f, 0x00, 0x00, 0x00), { 127.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x80, 0x00, 0x00, 0x00), {-128.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x7f, 0x00, 0x00), { 0.0, 127.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x80, 0x00, 0x00), { 0.0, -128.0, 0.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x7f, 0x00), { 0.0, 0.0, 127.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x80, 0x00), { 0.0, 0.0, -128.0, 0.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x7f), { 0.0, 0.0, 0.0, 127.0}}, + {PIPE_FORMAT_R8G8B8A8_SSCALED, PACKED_4x8(0xff, 0xff, 0xff, 0xff), PACKED_4x8(0x00, 0x00, 0x00, 0x80), { 0.0, 0.0, 0.0, -128.0}}, + + /* + * Standard 16-bit integer formats + */ + + {PIPE_FORMAT_R16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16_UNORM, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {1.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0x0000), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0xffff), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_UNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0xffff), {1.0, 1.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0x0000, 0x0000), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0xffff, 0x0000), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0xffff), {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_UNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0xffff, 0xffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0x0000, 0x0000, 0x0000), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0xffff, 0x0000, 0x0000), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0xffff, 0x0000), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0xffff), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16A16_UNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R16_USCALED, PACKED_1x16(0xffff), PACKED_1x16(0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16_USCALED, PACKED_1x16(0xffff), PACKED_1x16(0xffff), {65535.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0x0000), {65535.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0xffff), { 0.0, 65535.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_USCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0xffff, 0xffff), {65535.0, 65535.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0x0000, 0x0000), {65535.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0xffff, 0x0000), { 0.0, 65535.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0xffff), { 0.0, 0.0, 65535.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_USCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0xffff, 0xffff, 0xffff), {65535.0, 65535.0, 65535.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0x0000, 0x0000, 0x0000), {65535.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0xffff, 0x0000, 0x0000), { 0.0, 65535.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0xffff, 0x0000), { 0.0, 0.0, 65535.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0xffff), { 0.0, 0.0, 0.0, 65535.0}}, + {PIPE_FORMAT_R16G16B16A16_USCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), {65535.0, 65535.0, 65535.0, 65535.0}}, + + {PIPE_FORMAT_R16_SNORM, PACKED_1x16(0xffff), PACKED_1x16(0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16_SNORM, PACKED_1x16(0xffff), PACKED_1x16(0x7fff), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16_SNORM, PACKED_1x16(0xffff), PACKED_1x16(0x8001), { -1.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x7fff, 0x0000), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x8001, 0x0000), { -1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x7fff), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SNORM, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x8001), { 0.0, -1.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x7fff, 0x0000, 0x0000), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x8001, 0x0000, 0x0000), { -1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x7fff, 0x0000), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x8001, 0x0000), { 0.0, -1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x7fff), { 0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SNORM, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x8001), { 0.0, 0.0, -1.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x7fff, 0x0000, 0x0000, 0x0000), { 1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x8001, 0x0000, 0x0000, 0x0000), { -1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x7fff, 0x0000, 0x0000), { 0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x8001, 0x0000, 0x0000), { 0.0, -1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x7fff, 0x0000), { 0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x8001, 0x0000), { 0.0, 0.0, -1.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x7fff), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16A16_SNORM, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x8001), { 0.0, 0.0, 0.0, -1.0}}, + + {PIPE_FORMAT_R16_SSCALED, PACKED_1x16(0xffff), PACKED_1x16(0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16_SSCALED, PACKED_1x16(0xffff), PACKED_1x16(0x7fff), { 32767.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16_SSCALED, PACKED_1x16(0xffff), PACKED_1x16(0x8000), {-32768.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x7fff, 0x0000), { 32767.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x8000, 0x0000), {-32768.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x7fff), { 0.0, 32767.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16_SSCALED, PACKED_2x16(0xffff, 0xffff), PACKED_2x16(0x0000, 0x8000), { 0.0, -32768.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x0000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x7fff, 0x0000, 0x0000), { 32767.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x8000, 0x0000, 0x0000), {-32768.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x7fff, 0x0000), { 0.0, 32767.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x8000, 0x0000), { 0.0, -32768.0, 0.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x7fff), { 0.0, 0.0, 32767.0, 1.0}}, + {PIPE_FORMAT_R16G16B16_SSCALED, PACKED_3x16(0xffff, 0xffff, 0xffff), PACKED_3x16(0x0000, 0x0000, 0x8000), { 0.0, 0.0, -32768.0, 1.0}}, + + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x0000), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x7fff, 0x0000, 0x0000, 0x0000), { 32767.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x8000, 0x0000, 0x0000, 0x0000), {-32768.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x7fff, 0x0000, 0x0000), { 0.0, 32767.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x8000, 0x0000, 0x0000), { 0.0, -32768.0, 0.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x7fff, 0x0000), { 0.0, 0.0, 32767.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x8000, 0x0000), { 0.0, 0.0, -32768.0, 0.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x7fff), { 0.0, 0.0, 0.0, 32767.0}}, + {PIPE_FORMAT_R16G16B16A16_SSCALED, PACKED_4x16(0xffff, 0xffff, 0xffff, 0xffff), PACKED_4x16(0x0000, 0x0000, 0x0000, 0x8000), { 0.0, 0.0, 0.0, -32768.0}}, + + /* + * Standard 32-bit integer formats + * + * NOTE: We can't accurately represent integers larger than +/-0x1000000 + * with single precision floats, so that's as far as we test. + */ + + {PIPE_FORMAT_R32_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_UNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0xffffffff), {1.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xffffffff, 0x00000000), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0xffffffff), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_UNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xffffffff, 0xffffffff), {1.0, 1.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xffffffff, 0x00000000, 0x00000000), {1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0xffffffff, 0x00000000), {0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0xffffffff), {0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_UNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), {0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xffffffff, 0x00000000, 0x00000000, 0x00000000), {1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0xffffffff, 0x00000000, 0x00000000), {0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0xffffffff, 0x00000000), {0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0xffffffff), {0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32A32_UNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), {1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R32_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_USCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x01000000), {16777216.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x01000000, 0x00000000), {16777216.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x01000000), { 0.0, 16777216.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_USCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x01000000, 0x01000000), {16777216.0, 16777216.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x01000000, 0x00000000, 0x00000000), {16777216.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x01000000, 0x00000000), { 0.0, 16777216.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x01000000), { 0.0, 0.0, 16777216.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_USCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x01000000, 0x01000000, 0x01000000), {16777216.0, 16777216.0, 16777216.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x01000000, 0x00000000, 0x00000000, 0x00000000), {16777216.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x01000000, 0x00000000, 0x00000000), { 0.0, 16777216.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x01000000, 0x00000000), { 0.0, 0.0, 16777216.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x01000000), { 0.0, 0.0, 0.0, 16777216.0}}, + {PIPE_FORMAT_R32G32B32A32_USCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x01000000, 0x01000000, 0x01000000, 0x01000000), {16777216.0, 16777216.0, 16777216.0, 16777216.0}}, + + {PIPE_FORMAT_R32_SNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_SNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x7fffffff), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_SNORM, PACKED_1x32(0xffffffff), PACKED_1x32(0x80000001), { -1.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x7fffffff, 0x00000000), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x80000001, 0x00000000), { -1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x7fffffff), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SNORM, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x80000001), { 0.0, -1.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x7fffffff, 0x00000000, 0x00000000), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x80000001, 0x00000000, 0x00000000), { -1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x7fffffff, 0x00000000), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x80000001, 0x00000000), { 0.0, -1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x7fffffff), { 0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SNORM, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x80000001), { 0.0, 0.0, -1.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x7fffffff, 0x00000000, 0x00000000, 0x00000000), { 1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x80000001, 0x00000000, 0x00000000, 0x00000000), { -1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x7fffffff, 0x00000000, 0x00000000), { 0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x80000001, 0x00000000, 0x00000000), { 0.0, -1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x7fffffff, 0x00000000), { 0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x80000001, 0x00000000), { 0.0, 0.0, -1.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x7fffffff), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32A32_SNORM, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x80000001), { 0.0, 0.0, 0.0, -1.0}}, + + {PIPE_FORMAT_R32_SSCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_SSCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0x01000000), { 16777216.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_SSCALED, PACKED_1x32(0xffffffff), PACKED_1x32(0xff000000), {-16777216.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x01000000, 0x00000000), { 16777216.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xff000000, 0x00000000), {-16777216.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x01000000), { 0.0, 16777216.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_SSCALED, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0xff000000), { 0.0, -16777216.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x01000000, 0x00000000, 0x00000000), { 16777216.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xff000000, 0x00000000, 0x00000000), {-16777216.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x01000000, 0x00000000), { 0.0, 16777216.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0xff000000, 0x00000000), { 0.0, -16777216.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x01000000), { 0.0, 0.0, 16777216.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_SSCALED, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0xff000000), { 0.0, 0.0, -16777216.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x01000000, 0x00000000, 0x00000000, 0x00000000), { 16777216.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xff000000, 0x00000000, 0x00000000, 0x00000000), {-16777216.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x01000000, 0x00000000, 0x00000000), { 0.0, 16777216.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0xff000000, 0x00000000, 0x00000000), { 0.0, -16777216.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x01000000, 0x00000000), { 0.0, 0.0, 16777216.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0xff000000, 0x00000000), { 0.0, 0.0, -16777216.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x01000000), { 0.0, 0.0, 0.0, 16777216.0}}, + {PIPE_FORMAT_R32G32B32A32_SSCALED, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0xff000000), { 0.0, 0.0, 0.0, -16777216.0}}, + + /* + * Standard 32-bit float formats + */ + + {PIPE_FORMAT_R32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0x3f800000), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32_FLOAT, PACKED_1x32(0xffffffff), PACKED_1x32(0xbf800000), { -1.0, 0.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x3f800000, 0x00000000), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0xbf800000, 0x00000000), {-1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0x3f800000), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x00000000, 0xbf800000), { 0.0, -1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32_FLOAT, PACKED_2x32(0xffffffff, 0xffffffff), PACKED_2x32(0x3f800000, 0x3f800000), { 1.0, 1.0, 0.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x3f800000, 0x00000000, 0x00000000), { 1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0xbf800000, 0x00000000, 0x00000000), {-1.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x3f800000, 0x00000000), { 0.0, 1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0xbf800000, 0x00000000), { 0.0, -1.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0x3f800000), { 0.0, 0.0, 1.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x00000000, 0x00000000, 0xbf800000), { 0.0, 0.0, -1.0, 1.0}}, + {PIPE_FORMAT_R32G32B32_FLOAT, PACKED_3x32(0xffffffff, 0xffffffff, 0xffffffff), PACKED_3x32(0x3f800000, 0x3f800000, 0x3f800000), { 1.0, 1.0, 1.0, 1.0}}, + + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x00000000), { 0.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x3f800000, 0x00000000, 0x00000000, 0x00000000), { 1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0xbf800000, 0x00000000, 0x00000000, 0x00000000), {-1.0, 0.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x3f800000, 0x00000000, 0x00000000), { 0.0, 1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0xbf800000, 0x00000000, 0x00000000), { 0.0, -1.0, 0.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x3f800000, 0x00000000), { 0.0, 0.0, 1.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0xbf800000, 0x00000000), { 0.0, 0.0, -1.0, 0.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0x3f800000), { 0.0, 0.0, 0.0, 1.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x00000000, 0x00000000, 0x00000000, 0xbf800000), { 0.0, 0.0, 0.0, -1.0}}, + {PIPE_FORMAT_R32G32B32A32_FLOAT, PACKED_4x32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff), PACKED_4x32(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000), { 1.0, 1.0, 1.0, 1.0}}, +}; + + +const unsigned util_format_nr_test_cases = Elements(util_format_test_cases); diff --git a/src/gallium/auxiliary/util/u_format_tests.h b/src/gallium/auxiliary/util/u_format_tests.h new file mode 100644 index 0000000000..2d4d9d5fa9 --- /dev/null +++ b/src/gallium/auxiliary/util/u_format_tests.h @@ -0,0 +1,69 @@ +/************************************************************************** + * + * Copyright 2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + **************************************************************************/ + + +#ifndef U_FORMAT_TESTS_H_ +#define U_FORMAT_TESTS_H_ + + +#include "pipe/p_compiler.h" +#include "pipe/p_format.h" + + +#define UTIL_FORMAT_MAX_PACKED_BYTES 16 + + +/** + * A (packed, unpacked) color pair. + */ +struct util_format_test_case +{ + enum pipe_format format; + + /** + * Mask of the bits that actually meaningful data. Used to mask out the + * "X" channels. + */ + uint8_t mask[UTIL_FORMAT_MAX_PACKED_BYTES]; + + uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES]; + + /** + * RGBA. + */ + double unpacked[4]; +}; + + +extern const struct util_format_test_case +util_format_test_cases[]; + + +extern const unsigned util_format_nr_test_cases; + + +#endif /* U_FORMAT_TESTS_H_ */ -- cgit v1.2.3 From 45ae4434b5bd779e74d12e5b63fcf91d88f4cb28 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 6 Mar 2010 14:22:56 +0000 Subject: util: Use bitshift arithmetic to unpack pixels. All test cases pass now. --- src/gallium/auxiliary/util/u_format_pack.py | 115 ++++++++++++++++++++++------ 1 file changed, 92 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py index 1fc58cd3de..b49039db39 100644 --- a/src/gallium/auxiliary/util/u_format_pack.py +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -304,6 +304,8 @@ def conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=True def generate_format_unpack(format, dst_channel, dst_native_type, dst_suffix): '''Generate the function to unpack pixels from a particular format''' + assert format.layout == PLAIN + name = format.short_name() src_native_type = native_type(format) @@ -311,32 +313,99 @@ def generate_format_unpack(format, dst_channel, dst_native_type, dst_suffix): print 'static INLINE void' print 'util_format_%s_unpack_%s(%s *dst, const void *src)' % (name, dst_suffix, dst_native_type) print '{' - print ' union util_format_%s pixel;' % format.short_name() - print ' memcpy(&pixel, src, sizeof pixel);' - bswap_format(format) + + if format.is_bitmask(): + depth = format.block_size() + print ' uint%u_t value = *(uint%u_t *)src;' % (depth, depth) - assert format.layout == PLAIN + # Declare the intermediate variables + for i in range(format.nr_channels()): + src_channel = format.channels[i] + if src_channel.type == UNSIGNED: + print ' uint%u_t %s;' % (depth, src_channel.name) + elif src_channel.type == SIGNED: + print ' int%u_t %s;' % (depth, src_channel.name) - for i in range(4): - swizzle = format.swizzles[i] - if swizzle < 4: - src_channel = format.channels[swizzle] - value = 'pixel.chan.%s' % src_channel.name - value = conversion_expr(src_channel, dst_channel, dst_native_type, value) - elif swizzle == SWIZZLE_0: - value = '0' - elif swizzle == SWIZZLE_1: - value = get_one(dst_channel) - elif swizzle == SWIZZLE_NONE: - value = '0' - else: - assert False - if format.colorspace == ZS: - if i == 3: + print '#ifdef PIPE_ARCH_BIG_ENDIAN' + print ' value = util_bswap%u(value);' % depth + print '#endif' + + # Compute the intermediate unshifted values + shift = 0 + for i in range(format.nr_channels()): + src_channel = format.channels[i] + value = 'value' + if src_channel.type == UNSIGNED: + if shift: + value = '%s >> %u' % (value, shift) + if shift + src_channel.size < depth: + value = '(%s) & 0x%x' % (value, (1 << src_channel.size) - 1) + elif src_channel.type == SIGNED: + if shift + src_channel.size < depth: + # Align the sign bit + lshift = depth - (shift + src_channel.size) + value = '%s << %u' % (value, lshift) + # Cast to signed + value = '(int%u_t)(%s) ' % (depth, value) + if src_channel.size < depth: + # Align the LSB bit + rshift = depth - src_channel.size + value = '(%s) >> %u' % (value, rshift) + else: + value = None + + if value is not None: + print ' %s = %s;' % (src_channel.name, value) + + shift += src_channel.size + + # Convert, swizzle, and store final values + for i in range(4): + swizzle = format.swizzles[i] + if swizzle < 4: + src_channel = format.channels[swizzle] + value = src_channel.name + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + elif swizzle == SWIZZLE_0: + value = '0' + elif swizzle == SWIZZLE_1: value = get_one(dst_channel) - elif i >= 1: - value = 'dst[0]' - print ' dst[%u] = %s; /* %s */' % (i, value, 'rgba'[i]) + elif swizzle == SWIZZLE_NONE: + value = '0' + else: + assert False + if format.colorspace == ZS: + if i == 3: + value = get_one(dst_channel) + elif i >= 1: + value = 'dst[0]' + print ' dst[%u] = %s; /* %s */' % (i, value, 'rgba'[i]) + + else: + print ' union util_format_%s pixel;' % format.short_name() + print ' memcpy(&pixel, src, sizeof pixel);' + bswap_format(format) + + for i in range(4): + swizzle = format.swizzles[i] + if swizzle < 4: + src_channel = format.channels[swizzle] + value = 'pixel.chan.%s' % src_channel.name + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + elif swizzle == SWIZZLE_0: + value = '0' + elif swizzle == SWIZZLE_1: + value = get_one(dst_channel) + elif swizzle == SWIZZLE_NONE: + value = '0' + else: + assert False + if format.colorspace == ZS: + if i == 3: + value = get_one(dst_channel) + elif i >= 1: + value = 'dst[0]' + print ' dst[%u] = %s; /* %s */' % (i, value, 'rgba'[i]) print '}' print -- cgit v1.2.3 From c37a20416d681a3fea42a1a2ce907eb8e11ba795 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 6 Mar 2010 19:35:10 +0100 Subject: r300g: clamp vertex max index according to currently bound buffers --- src/gallium/drivers/r300/r300_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 6c891029a5..073664fa45 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -278,7 +278,7 @@ static void r300_emit_draw_elements(struct r300_context *r300, DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n", count, minIndex, maxIndex); - maxIndex = MIN2(maxIndex, ((1 << 24) - 1)); + maxIndex = MIN2(maxIndex, r300->vertex_buffer_max_index); if (alt_num_verts) { BEGIN_CS(16); -- cgit v1.2.3 From 09653d65e9650c3c04b3e8160b8f2ad7198fc122 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 6 Mar 2010 23:29:17 +0100 Subject: r300g: minor cleanups after the no-rhw merge --- src/gallium/drivers/r300/r300_state.c | 4 +--- src/gallium/drivers/r300/r300_state_derived.c | 10 ++++------ 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 1f6f99d3e5..4349bc1d50 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -716,8 +716,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe, rs->vap_control_status = R300_VC_32BIT_SWAP; #endif - /* If bypassing TCL, or if no TCL engine is present, turn off the HW TCL. - * Else, enable HW TCL and force Draw's TCL off. */ + /* If no TCL engine is present, turn off the HW TCL. */ if (!r300screen->caps->has_tcl) { rs->vap_control_status |= R300_VAP_TCL_BYPASS; } @@ -1121,7 +1120,6 @@ static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) r300->rs_block_state.dirty = TRUE; /* Will be updated before the emission. */ r300->vap_output_state.dirty = TRUE; - r300->vertex_stream_state.dirty = TRUE; /* XXX needed for TCL bypass */ r300->pvs_flush.dirty = TRUE; if (r300->fs) { diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 9c8e907fdf..fc24cd5817 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -436,15 +436,14 @@ static void r300_update_derived_shader_state(struct r300_context* r300) struct r300_vap_output_state *vap_out = (struct r300_vap_output_state*)r300->vap_output_state.state; - /* XXX Mmm, delicious hax */ - memset(&r300->vertex_info, 0, sizeof(struct vertex_info)); - memcpy(vap_out, vs->hwfmt, sizeof(uint)*4); - r300_update_rs_block(r300, &vs->outputs, &r300->fs->inputs); if (r300screen->caps->has_tcl) { + memcpy(vap_out, vs->hwfmt, sizeof(uint)*4); r300_vertex_psc(r300); } else { + /* XXX set vap_out */ + memset(&r300->vertex_info, 0, sizeof(struct vertex_info)); r300_draw_emit_all_attribs(r300); draw_compute_vertex_size(&r300->vertex_info); r300_swtcl_vertex_psc(r300); @@ -582,8 +581,7 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300) void r300_update_derived_state(struct r300_context* r300) { if (r300->rs_block_state.dirty || - r300->vertex_stream_state.dirty || /* XXX put updating this state out of this file */ - r300->rs_state.dirty) { /* XXX and remove this one (tcl_bypass dependency) */ + r300->vertex_stream_state.dirty) { /* XXX put updating PSC out of this file */ r300_update_derived_shader_state(r300); } -- cgit v1.2.3 From 6f4a19ca562ccd7e4bc2f7ea32263391abaa16bd Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 7 Mar 2010 01:12:57 +0100 Subject: r300g: abort if FS compilation fails on non-debug builds --- src/gallium/drivers/r300/r300_fs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index 3c2625269b..9e71e61c30 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -207,6 +207,7 @@ static void r300_translate_fragment_shader( DBG(r300, DBG_FP, "r300: Error compiling fragment program: %s\n", compiler.Base.ErrorMsg); assert(0); + abort(); } /* And, finally... */ -- cgit v1.2.3 From 4f541db80c5ffff8932679a389a6043105f0b1be Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 7 Mar 2010 02:32:09 +0100 Subject: r300g: share the VS-output-mapping state with SWTCL And associated cleanups. --- src/gallium/drivers/r300/r300_state.c | 64 +++++----- src/gallium/drivers/r300/r300_state_derived.c | 4 - src/gallium/drivers/r300/r300_vs.c | 163 +++++++++----------------- src/gallium/drivers/r300/r300_vs.h | 13 +- 4 files changed, 96 insertions(+), 148 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 4349bc1d50..381676e09a 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1087,67 +1087,71 @@ static void* r300_create_vs_state(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); - if (r300_screen(pipe->screen)->caps->has_tcl) { - struct r300_vertex_shader* vs = CALLOC_STRUCT(r300_vertex_shader); - /* Copy state directly into shader. */ - vs->state = *shader; - vs->state.tokens = tgsi_dup_tokens(shader->tokens); - - tgsi_scan_shader(shader->tokens, &vs->info); + struct r300_vertex_shader* vs = CALLOC_STRUCT(r300_vertex_shader); + r300_vertex_shader_common_init(vs, shader); - return (void*)vs; + if (r300_screen(pipe->screen)->caps->has_tcl) { + r300_translate_vertex_shader(r300, vs); } else { - return draw_create_vertex_shader(r300->draw, shader); + vs->draw_vs = draw_create_vertex_shader(r300->draw, shader); } + + return vs; } static void r300_bind_vs_state(struct pipe_context* pipe, void* shader) { struct r300_context* r300 = r300_context(pipe); + struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader; - if (r300_screen(pipe->screen)->caps->has_tcl) { - struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader; + if (vs == NULL) { + r300->vs_state.state = NULL; + return; + } + if (vs == r300->vs_state.state) { + return; + } + r300->vs_state.state = vs; - if (vs == NULL) { - r300->vs_state.state = NULL; - return; - } else if (!vs->translated) { - r300_translate_vertex_shader(r300, vs); - } + // VS output mapping for HWTCL or stream mapping for SWTCL to the RS block + if (r300->fs) { + r300_vertex_shader_setup_wpos(r300); + } + memcpy(r300->vap_output_state.state, &vs->vap_out, + sizeof(struct r300_vap_output_state)); + r300->vap_output_state.dirty = TRUE; + + /* The majority of the RS block bits is dependent on the vertex shader. */ + r300->rs_block_state.dirty = TRUE; /* Will be updated before the emission. */ - UPDATE_STATE(shader, r300->vs_state); + if (r300_screen(pipe->screen)->caps->has_tcl) { + r300->vs_state.dirty = TRUE; r300->vs_state.size = vs->code.length + 9; - r300->rs_block_state.dirty = TRUE; /* Will be updated before the emission. */ - r300->vap_output_state.dirty = TRUE; r300->pvs_flush.dirty = TRUE; - if (r300->fs) { - r300_vertex_shader_setup_wpos(r300); - } - r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS; } else { draw_flush(r300->draw); draw_bind_vertex_shader(r300->draw, - (struct draw_vertex_shader*)shader); + (struct draw_vertex_shader*)vs->draw_vs); } } static void r300_delete_vs_state(struct pipe_context* pipe, void* shader) { struct r300_context* r300 = r300_context(pipe); + struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader; if (r300_screen(pipe->screen)->caps->has_tcl) { - struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader; - rc_constants_destroy(&vs->code.constants); - FREE((void*)vs->state.tokens); - FREE(shader); } else { draw_delete_vertex_shader(r300->draw, - (struct draw_vertex_shader*)shader); + (struct draw_vertex_shader*)vs->draw_vs); } + + FREE((void*)vs->state.tokens); + FREE(shader); } static void r300_set_constant_buffer(struct pipe_context *pipe, diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index fc24cd5817..e9e40747ef 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -433,16 +433,12 @@ static void r300_update_derived_shader_state(struct r300_context* r300) { struct r300_vertex_shader* vs = r300->vs_state.state; struct r300_screen* r300screen = r300_screen(r300->context.screen); - struct r300_vap_output_state *vap_out = - (struct r300_vap_output_state*)r300->vap_output_state.state; r300_update_rs_block(r300, &vs->outputs, &r300->fs->inputs); if (r300screen->caps->has_tcl) { - memcpy(vap_out, vs->hwfmt, sizeof(uint)*4); r300_vertex_psc(r300); } else { - /* XXX set vap_out */ memset(&r300->vertex_info, 0, sizeof(struct vertex_info)); r300_draw_emit_all_attribs(r300); draw_compute_vertex_size(&r300->vertex_info); diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index 60a04bbfed..379939ac75 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -89,95 +89,41 @@ static void r300_shader_read_vs_outputs( assert(0); } } + + /* WPOS is a straight copy of POSITION and it's always emitted. */ + vs_outputs->wpos = i; } -static void r300_shader_vap_output_fmt(struct r300_vertex_shader* vs) +/* This function sets up: + * - VAP mapping, which maps VS registers to output semantics and + * at the same time it indicates which attributes are enabled and should + * be rasterized. + * - Stream mapping to VS outputs if TCL is not present. */ +static void r300_init_vs_output_mapping(struct r300_vertex_shader* vs) { struct r300_shader_semantics* vs_outputs = &vs->outputs; - uint32_t* hwfmt = vs->hwfmt; - int i, gen_count; + struct r300_vap_output_state *vap_out = &vs->vap_out; + int *stream_loc = vs->stream_loc_notcl; + int i, gen_count, tabi = 0; boolean any_bcolor_used = vs_outputs->bcolor[0] != ATTR_UNUSED || vs_outputs->bcolor[1] != ATTR_UNUSED; - /* Do the actual vertex_info setup. - * - * vertex_info has four uints of hardware-specific data in it. - * vinfo.hwfmt[0] is R300_VAP_VTX_STATE_CNTL - * vinfo.hwfmt[1] is R300_VAP_VSM_VTX_ASSM - * vinfo.hwfmt[2] is R300_VAP_OUTPUT_VTX_FMT_0 - * vinfo.hwfmt[3] is R300_VAP_OUTPUT_VTX_FMT_1 */ - - hwfmt[0] = 0x5555; /* XXX this is classic Mesa bonghits */ + vap_out->vap_vtx_state_cntl = 0x5555; /* XXX this is classic Mesa bonghits */ /* Position. */ if (vs_outputs->pos != ATTR_UNUSED) { - hwfmt[1] |= R300_INPUT_CNTL_POS; - hwfmt[2] |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; + vap_out->vap_vsm_vtx_assm |= R300_INPUT_CNTL_POS; + vap_out->vap_out_vtx_fmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT; + + stream_loc[tabi++] = 0; } else { assert(0); } /* Point size. */ if (vs_outputs->psize != ATTR_UNUSED) { - hwfmt[2] |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; - } - - /* Colors. */ - for (i = 0; i < ATTR_COLOR_COUNT; i++) { - if (vs_outputs->color[i] != ATTR_UNUSED || any_bcolor_used || - vs_outputs->color[1] != ATTR_UNUSED) { - hwfmt[1] |= R300_INPUT_CNTL_COLOR; - hwfmt[2] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << i; - } - } - - /* Back-face colors. */ - if (any_bcolor_used) { - for (i = 0; i < ATTR_COLOR_COUNT; i++) { - hwfmt[1] |= R300_INPUT_CNTL_COLOR; - hwfmt[2] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << (2+i); - } - } + vap_out->vap_out_vtx_fmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT; - /* Texture coordinates. */ - gen_count = 0; - for (i = 0; i < ATTR_GENERIC_COUNT; i++) { - if (vs_outputs->generic[i] != ATTR_UNUSED) { - hwfmt[1] |= (R300_INPUT_CNTL_TC0 << gen_count); - hwfmt[3] |= (4 << (3 * gen_count)); - gen_count++; - } - } - - /* Fog coordinates. */ - if (vs_outputs->fog != ATTR_UNUSED) { - hwfmt[1] |= (R300_INPUT_CNTL_TC0 << gen_count); - hwfmt[3] |= (4 << (3 * gen_count)); - gen_count++; - } - - /* XXX magic */ - assert(gen_count <= 8); - - /* WPOS. */ - vs->wpos_tex_output = gen_count; -} - -/* Sets up stream mapping to equivalent VS outputs if TCL is bypassed - * or isn't present. */ -static void r300_stream_locations_notcl( - struct r300_shader_semantics* vs_outputs, - int* stream_loc) -{ - int i, tabi = 0, gen_count; - boolean any_bcolor_used = vs_outputs->bcolor[0] != ATTR_UNUSED || - vs_outputs->bcolor[1] != ATTR_UNUSED; - - /* Position. */ - stream_loc[tabi++] = 0; - - /* Point size. */ - if (vs_outputs->psize != ATTR_UNUSED) { stream_loc[tabi++] = 1; } @@ -185,6 +131,9 @@ static void r300_stream_locations_notcl( for (i = 0; i < ATTR_COLOR_COUNT; i++) { if (vs_outputs->color[i] != ATTR_UNUSED || any_bcolor_used || vs_outputs->color[1] != ATTR_UNUSED) { + vap_out->vap_vsm_vtx_assm |= R300_INPUT_CNTL_COLOR; + vap_out->vap_out_vtx_fmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << i; + stream_loc[tabi++] = 2 + i; } } @@ -192,6 +141,9 @@ static void r300_stream_locations_notcl( /* Back-face colors. */ if (any_bcolor_used) { for (i = 0; i < ATTR_COLOR_COUNT; i++) { + vap_out->vap_vsm_vtx_assm |= R300_INPUT_CNTL_COLOR; + vap_out->vap_out_vtx_fmt[0] |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT << (2+i); + stream_loc[tabi++] = 4 + i; } } @@ -200,6 +152,9 @@ static void r300_stream_locations_notcl( gen_count = 0; for (i = 0; i < ATTR_GENERIC_COUNT; i++) { if (vs_outputs->generic[i] != ATTR_UNUSED) { + vap_out->vap_vsm_vtx_assm |= (R300_INPUT_CNTL_TC0 << gen_count); + vap_out->vap_out_vtx_fmt[1] |= (4 << (3 * gen_count)); + assert(tabi < 16); stream_loc[tabi++] = 6 + gen_count; gen_count++; @@ -208,17 +163,22 @@ static void r300_stream_locations_notcl( /* Fog coordinates. */ if (vs_outputs->fog != ATTR_UNUSED) { + vap_out->vap_vsm_vtx_assm |= (R300_INPUT_CNTL_TC0 << gen_count); + vap_out->vap_out_vtx_fmt[1] |= (4 << (3 * gen_count)); + assert(tabi < 16); stream_loc[tabi++] = 6 + gen_count; gen_count++; } + /* XXX magic */ + assert(gen_count <= 8); + /* WPOS. */ - if (vs_outputs->wpos != ATTR_UNUSED) { - assert(tabi < 16); - stream_loc[tabi++] = 6 + gen_count; - gen_count++; - } + vs->wpos_tex_output = gen_count; + + assert(tabi < 16); + stream_loc[tabi++] = 6 + gen_count; for (; tabi < 16;) { stream_loc[tabi++] = -1; @@ -294,26 +254,16 @@ static void set_vertex_inputs_outputs(struct r300_vertex_program_compiler * c) } } -static void r300_insert_wpos(struct r300_vertex_program_compiler* c, - struct r300_shader_semantics* outputs) +void r300_vertex_shader_common_init(struct r300_vertex_shader *vs, + const struct pipe_shader_state *shader) { - int i, lastOutput = 0; - - /* Find the max output index. */ - lastOutput = MAX2(lastOutput, outputs->psize); - for (i = 0; i < ATTR_COLOR_COUNT; i++) { - lastOutput = MAX2(lastOutput, outputs->color[i]); - lastOutput = MAX2(lastOutput, outputs->bcolor[i]); - } - for (i = 0; i < ATTR_GENERIC_COUNT; i++) { - lastOutput = MAX2(lastOutput, outputs->generic[i]); - } - lastOutput = MAX2(lastOutput, outputs->fog); + /* Copy state directly into shader. */ + vs->state = *shader; + vs->state.tokens = tgsi_dup_tokens(shader->tokens); + tgsi_scan_shader(shader->tokens, &vs->info); - /* Set WPOS after the last output. */ - lastOutput++; - rc_copy_output(&c->Base, 0, lastOutput); /* out[lastOutput] = out[0]; */ - outputs->wpos = lastOutput; + r300_shader_read_vs_outputs(&vs->info, &vs->outputs); + r300_init_vs_output_mapping(vs); } void r300_translate_vertex_shader(struct r300_context* r300, @@ -322,9 +272,6 @@ void r300_translate_vertex_shader(struct r300_context* r300, struct r300_vertex_program_compiler compiler; struct tgsi_to_rc ttr; - /* Initialize. */ - r300_shader_read_vs_outputs(&vs->info, &vs->outputs); - /* Setup the compiler */ rc_init(&compiler.Base); @@ -348,10 +295,7 @@ void r300_translate_vertex_shader(struct r300_context* r300, compiler.SetHwInputOutput = &set_vertex_inputs_outputs; /* Insert the WPOS output. */ - r300_insert_wpos(&compiler, &vs->outputs); - - r300_shader_vap_output_fmt(vs); - r300_stream_locations_notcl(&vs->outputs, vs->stream_loc_notcl); + rc_copy_output(&compiler.Base, 0, vs->outputs.wpos); /* Invoke the compiler */ r3xx_compile_vertex_program(&compiler); @@ -363,30 +307,29 @@ void r300_translate_vertex_shader(struct r300_context* r300, /* And, finally... */ rc_destroy(&compiler.Base); - vs->translated = TRUE; } boolean r300_vertex_shader_setup_wpos(struct r300_context* r300) { struct r300_vertex_shader* vs = r300->vs_state.state; + struct r300_vap_output_state *vap_out = &vs->vap_out; int tex_output = vs->wpos_tex_output; uint32_t tex_fmt = R300_INPUT_CNTL_TC0 << tex_output; - uint32_t* hwfmt = vs->hwfmt; if (r300->fs->inputs.wpos != ATTR_UNUSED) { /* Enable WPOS in VAP. */ - if (!(hwfmt[1] & tex_fmt)) { - hwfmt[1] |= tex_fmt; - hwfmt[3] |= (4 << (3 * tex_output)); + if (!(vap_out->vap_vsm_vtx_assm & tex_fmt)) { + vap_out->vap_vsm_vtx_assm |= tex_fmt; + vap_out->vap_out_vtx_fmt[1] |= (4 << (3 * tex_output)); assert(tex_output < 8); return TRUE; } } else { /* Disable WPOS in VAP. */ - if (hwfmt[1] & tex_fmt) { - hwfmt[1] &= ~tex_fmt; - hwfmt[3] &= ~(4 << (3 * tex_output)); + if (vap_out->vap_vsm_vtx_assm & tex_fmt) { + vap_out->vap_vsm_vtx_assm &= ~tex_fmt; + vap_out->vap_out_vtx_fmt[1] &= ~(4 << (3 * tex_output)); return TRUE; } } diff --git a/src/gallium/drivers/r300/r300_vs.h b/src/gallium/drivers/r300/r300_vs.h index 18cfeee3cd..f6f0b86b68 100644 --- a/src/gallium/drivers/r300/r300_vs.h +++ b/src/gallium/drivers/r300/r300_vs.h @@ -28,6 +28,7 @@ #include "tgsi/tgsi_scan.h" #include "radeon_code.h" +#include "r300_context.h" #include "r300_shader_semantics.h" struct r300_context; @@ -38,7 +39,7 @@ struct r300_vertex_shader { struct tgsi_shader_info info; struct r300_shader_semantics outputs; - uint hwfmt[4]; + struct r300_vap_output_state vap_out; /* Stream locations for SWTCL or if TCL is bypassed. */ int stream_loc_notcl[16]; @@ -46,13 +47,17 @@ struct r300_vertex_shader { /* Output stream location for WPOS. */ int wpos_tex_output; - /* Has this shader been translated yet? */ - boolean translated; - + /* HWTCL-specific. */ /* Machine code (if translated) */ struct r300_vertex_program_code code; + + /* SWTCL-specific. */ + void *draw_vs; }; +void r300_vertex_shader_common_init(struct r300_vertex_shader *vs, + const struct pipe_shader_state *shader); + void r300_translate_vertex_shader(struct r300_context* r300, struct r300_vertex_shader* vs); -- cgit v1.2.3 From b03b70f6586baf3ff419be28817f61e6c4bacfb5 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 7 Mar 2010 02:40:57 +0100 Subject: r300g: validate buffers when using SWTCL --- src/gallium/drivers/r300/r300_render.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 073664fa45..c8420bcdd5 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -186,7 +186,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, dwords = 10 + count * vertex_size; r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + dwords); - r300_emit_buffer_validate(r300, FALSE, 0); + r300_emit_buffer_validate(r300, FALSE, NULL); r300_emit_dirty_state(r300); BEGIN_CS(dwords); @@ -450,7 +450,7 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, /* Make sure there are at least 128 spare dwords in the command buffer. * (most of it being consumed by emit_aos) */ r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 128); - r300_emit_buffer_validate(r300, TRUE, 0); + r300_emit_buffer_validate(r300, TRUE, NULL); r300_emit_dirty_state(r300); if (alt_num_verts || count <= 65535) { @@ -468,7 +468,7 @@ void r300_draw_arrays(struct pipe_context* pipe, unsigned mode, /* Again, we emit both AOS and draw_arrays so there should be * at least 128 spare dwords. */ if (count && r300_reserve_cs_space(r300, 128)) { - r300_emit_buffer_validate(r300, TRUE, 0); + r300_emit_buffer_validate(r300, TRUE, NULL); r300_emit_dirty_state(r300); } } while (count); @@ -688,6 +688,7 @@ static void r300_render_draw_arrays(struct vbuf_render* render, CS_LOCALS(r300); r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + 2); + r300_emit_buffer_validate(r300, FALSE, NULL); r300_emit_dirty_state(r300); DBG(r300, DBG_DRAW, "r300: Doing vbuf render, count %d\n", count); @@ -711,6 +712,7 @@ static void r300_render_draw(struct vbuf_render* render, CS_LOCALS(r300); r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + dwords); + r300_emit_buffer_validate(r300, FALSE, NULL); r300_emit_dirty_state(r300); BEGIN_CS(dwords); -- cgit v1.2.3 From 81992f37da64c2c89ce108e6b17159eee6085e5d Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 7 Mar 2010 03:00:07 +0100 Subject: r300g: resurrect r300_emit_vertex_buffer for SWTCL Taken over from c9928ac3ee5dc0d10127388f9312779a6c59da7c. --- src/gallium/drivers/r300/r300_emit.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index addb28bded..03da4754b7 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -794,6 +794,30 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) END_CS; } +void r300_emit_vertex_buffer(struct r300_context* r300) +{ + CS_LOCALS(r300); + + DBG(r300, DBG_DRAW, "r300: Preparing vertex buffer %p for render, " + "vertex size %d\n", r300->vbo, + r300->vertex_info.size); + /* Set the pointer to our vertex buffer. The emitted values are this: + * PACKET3 [3D_LOAD_VBPNTR] + * COUNT [1] + * FORMAT [size | stride << 8] + * OFFSET [offset into BO] + * VBPNTR [relocated BO] + */ + BEGIN_CS(7); + OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, 3); + OUT_CS(1); + OUT_CS(r300->vertex_info.size | + (r300->vertex_info.size << 8)); + OUT_CS(r300->vbo_offset); + OUT_CS_RELOC(r300->vbo, 0, RADEON_GEM_DOMAIN_GTT, 0, 0); + END_CS; +} + void r300_emit_vertex_stream_state(struct r300_context* r300, unsigned size, void* state) { @@ -1135,8 +1159,10 @@ void r300_emit_dirty_state(struct r300_context* r300) assert(r300->dirty_state == 0); */ - /* Finally, emit the VBO. */ - /* r300_emit_vertex_buffer(r300); */ + /* Emit the VBO for SWTCL. */ + if (!r300screen->caps->has_tcl) { + r300_emit_vertex_buffer(r300); + } r300->dirty_hw++; } -- cgit v1.2.3 From 690ded32cdda4363c30aca32ef94383ba356a3c5 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 7 Mar 2010 03:17:58 +0100 Subject: r300g: disable emitting the HWTCL-related state when SWTCL is in use Now SWTCL renders at least "something", we're close... --- src/gallium/drivers/r300/r300_context.c | 1 - src/gallium/drivers/r300/r300_emit.c | 4 ++-- src/gallium/drivers/r300/r300_flush.c | 6 ++++++ src/gallium/drivers/r300/r300_state.c | 6 ++++-- 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 86b98a4ba5..ec1c586522 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -212,7 +212,6 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->invariant_state.dirty = TRUE; r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300); - r300->dirty_state = R300_NEW_KITCHEN_SINK; r300->dirty_hw++; r300->blitter = util_blitter_create(&r300->context); diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 03da4754b7..a1d31d57b8 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -892,7 +892,7 @@ void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state) CS_LOCALS(r300); if (!r300screen->caps->has_tcl) { - debug_printf("r300: Implementation error: emit_vertex_shader called," + debug_printf("r300: Implementation error: emit_vs_state called," " but has_tcl is FALSE!\n"); return; } @@ -931,7 +931,7 @@ void r300_emit_vs_constant_buffer(struct r300_context* r300, CS_LOCALS(r300); if (!r300screen->caps->has_tcl) { - debug_printf("r300: Implementation error: emit_vertex_shader called," + debug_printf("r300: Implementation error: emit_vs_constant_buffer called," " but has_tcl is FALSE!\n"); return; } diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c index e37d309270..70de152713 100644 --- a/src/gallium/drivers/r300/r300_flush.c +++ b/src/gallium/drivers/r300/r300_flush.c @@ -61,6 +61,12 @@ static void r300_flush(struct pipe_context* pipe, atom->dirty = TRUE; } } + + /* Unmark HWTCL state for SWTCL. */ + if (!r300_screen(pipe->screen)->caps->has_tcl) { + r300->vs_state.dirty = FALSE; + r300->dirty_state &= ~R300_NEW_VERTEX_SHADER_CONSTANTS; + } } /* reset flushed query */ diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 381676e09a..de3ee0eefb 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1203,8 +1203,10 @@ static void r300_set_constant_buffer(struct pipe_context *pipe, pipe_buffer_unmap(pipe->screen, buf); if (shader == PIPE_SHADER_VERTEX) { - r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS; - r300->pvs_flush.dirty = TRUE; + if (r300screen->caps->has_tcl) { + r300->dirty_state |= R300_NEW_VERTEX_SHADER_CONSTANTS; + r300->pvs_flush.dirty = TRUE; + } } else if (shader == PIPE_SHADER_FRAGMENT) r300->dirty_state |= R300_NEW_FRAGMENT_SHADER_CONSTANTS; -- cgit v1.2.3 From 661b416e07004655af3f372114119e4f8166496e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 6 Mar 2010 20:30:28 -0800 Subject: gallivm: Initialize variables for default cases. Fixes use of uninitialized variables in non-debug builds. --- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index bc2f307c33..9058f76c1d 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -538,6 +538,9 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld, default: assert(0); + coord0 = NULL; + coord1 = NULL; + weight = NULL; } *x0_out = coord0; @@ -700,6 +703,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, default: assert(0); + icoord = NULL; } return icoord; -- cgit v1.2.3 From bbab68ae2db468cc72bf11b901d8e28ab86bd769 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Mar 2010 13:09:47 +0100 Subject: r300: remove unnecessary code _tnl_UpdateFixedFunctionProgram is already called in r300_draw.c --- src/mesa/drivers/dri/r300/r300_state.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 9d1ff6e2ba..ba4a963d40 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1985,23 +1985,6 @@ void r300UpdateShaders(r300ContextPtr rmesa) if (rmesa->options.hw_tcl_enabled) { struct r300_vertex_program *vp; - if (rmesa->radeon.NewGLState) { - int i; - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - rmesa->temp_attrib[i] = - TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = - &rmesa->dummy_attrib[i]; - } - - _tnl_UpdateFixedFunctionProgram(ctx); - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = - rmesa->temp_attrib[i]; - } - } - vp = r300SelectAndTranslateVertexShader(ctx); r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, vp->error); -- cgit v1.2.3 From e2d96b2bf805fef0bfb016be1895a49551e2faa7 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Mar 2010 13:18:11 +0100 Subject: r300: no need to flush on context init --- src/mesa/drivers/dri/r300/r300_state.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ba4a963d40..6c2c367aab 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1762,8 +1762,6 @@ static void r300ResetHwState(r300ContextPtr r300) if (RADEON_DEBUG & RADEON_STATE) fprintf(stderr, "%s\n", __FUNCTION__); - radeon_firevertices(&r300->radeon); - r300ColorMask(ctx, ctx->Color.ColorMask[0][RCOMP], ctx->Color.ColorMask[0][GCOMP], -- cgit v1.2.3 From 89ea4022371998467faf26c5e27ab987469b91ef Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Mar 2010 13:39:13 +0100 Subject: r300: recalculate point size, if point min/max size changes Fixes two wine d3d9 unit tests --- src/mesa/drivers/dri/r300/r300_state.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 6c2c367aab..5a056f018d 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -794,12 +794,14 @@ static void r300PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * pa R300_STATECHANGE(r300, ga_point_minmax); r300->hw.ga_point_minmax.cmd[1] &= ~R300_GA_POINT_MINMAX_MIN_MASK; r300->hw.ga_point_minmax.cmd[1] |= (GLuint)(ctx->Point.MinSize * 6.0); + r300PointSize(ctx, ctx->Point.Size); break; case GL_POINT_SIZE_MAX: R300_STATECHANGE(r300, ga_point_minmax); r300->hw.ga_point_minmax.cmd[1] &= ~R300_GA_POINT_MINMAX_MAX_MASK; r300->hw.ga_point_minmax.cmd[1] |= (GLuint)(ctx->Point.MaxSize * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT; + r300PointSize(ctx, ctx->Point.Size); break; case GL_POINT_DISTANCE_ATTENUATION: break; -- cgit v1.2.3 From 042779dc85191e51db79090613b5cc4498474e23 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 12:02:28 +0100 Subject: r300: VAP flush is needed only when vertex program or constants are changed --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 21 +-------------------- src/mesa/drivers/dri/r300/r300_context.h | 1 - src/mesa/drivers/dri/r300/r300_state.c | 1 - src/mesa/drivers/dri/r300/r300_vertprog.c | 4 +--- 4 files changed, 2 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 4787bafc66..6cfa5686f4 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -90,8 +90,7 @@ void r300_emit_vpu(struct r300_context *r300, { BATCH_LOCALS(&r300->radeon); - BEGIN_BATCH_NO_AUTOSTATE(5 + len); - OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); + BEGIN_BATCH_NO_AUTOSTATE(3 + len); OUT_BATCH_REGVAL(R300_VAP_PVS_VECTOR_INDX_REG, addr); OUT_BATCH(CP_PACKET0(R300_VAP_PVS_UPLOAD_DATA, len-1) | RADEON_ONE_REG_WR); OUT_BATCH_TABLE(data, len); @@ -778,24 +777,6 @@ void r300InitCmdBuf(r300ContextPtr r300) /* VPU only on TCL */ if (has_tcl) { int i; - if (r300->radeon.radeonScreen->kernel_mm) { - ALLOC_STATE(vap_flush, always, 10, 0); - /* flush processing vertices */ - r300->hw.vap_flush.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_SC_SCREENDOOR, 1); - r300->hw.vap_flush.cmd[1] = 0; - r300->hw.vap_flush.cmd[2] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_DSTCACHE_CTLSTAT, 1); - r300->hw.vap_flush.cmd[3] = R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D; - r300->hw.vap_flush.cmd[4] = cmdpacket0(r300->radeon.radeonScreen, RADEON_WAIT_UNTIL, 1); - r300->hw.vap_flush.cmd[5] = RADEON_WAIT_3D_IDLECLEAN; - r300->hw.vap_flush.cmd[6] = cmdpacket0(r300->radeon.radeonScreen, R300_SC_SCREENDOOR, 1); - r300->hw.vap_flush.cmd[7] = 0xffffff; - r300->hw.vap_flush.cmd[8] = cmdpacket0(r300->radeon.radeonScreen, R300_VAP_PVS_STATE_FLUSH_REG, 1); - r300->hw.vap_flush.cmd[9] = 0; - } else { - ALLOC_STATE(vap_flush, never, 10, 0); - } - - ALLOC_STATE(vpi, vpu, R300_VPI_CMDSIZE, 0); r300->hw.vpi.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_PVS_CODE_START, 0); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 78ab43a99f..df7115e7da 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -355,7 +355,6 @@ struct r300_hw_state { struct radeon_state_atom zb_hiz_offset; /* (4F44) */ struct radeon_state_atom zb_hiz_pitch; /* (4F54) */ - struct radeon_state_atom vap_flush; struct radeon_state_atom vpi; /* vp instructions */ struct radeon_state_atom vpp; /* vp parameters */ struct radeon_state_atom vps; /* vertex point size (?) */ diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 5a056f018d..5979dedac4 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -366,7 +366,6 @@ static void r300ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq ) p = (GLint) plane - (GLint) GL_CLIP_PLANE0; ip = (GLint *)ctx->Transform._ClipUserPlane[p]; - R300_STATECHANGE( rmesa, vap_flush ); R300_STATECHANGE( rmesa, vpucp[p] ); rmesa->hw.vpucp[p].cmd[R300_VPUCP_X] = ip[0]; rmesa->hw.vpucp[p].cmd[R300_VPUCP_Y] = ip[1]; diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index cbe4cb8304..129004fee7 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -342,8 +342,6 @@ static void r300EmitVertexProgram(r300ContextPtr r300, int dest, struct r300_ver assert((code->length > 0) && (code->length % 4 == 0)); - R300_STATECHANGE( r300, vap_flush ); - switch ((dest >> 8) & 0xf) { case 0: R300_STATECHANGE(r300, vpi); @@ -381,7 +379,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa) ((drm_r300_cmd_header_t *) rmesa->hw.vpi.cmd)->vpu.count = 0; ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0; - R300_STATECHANGE(rmesa, vap_flush); + R300_STATECHANGE(rmesa, vap_cntl); R300_STATECHANGE(rmesa, vpp); param_count = r300VertexProgUpdateParams(ctx, prog, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]); bump_vpu_count(rmesa->hw.vpp.cmd, param_count); -- cgit v1.2.3 From 9543f7f05f416ef6c1ac160e12e2d7ceed3b32ae Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Feb 2010 19:37:23 +0100 Subject: radeon: fallback to software in glCopyTexImage if blit isn't available --- src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c index 89fe9915a7..a4bb03d5d3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c @@ -53,6 +53,10 @@ do_copy_texsubimage(GLcontext *ctx, unsigned src_width; unsigned dst_width; + if (!radeon->vtbl.blit) { + return GL_FALSE; + } + if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { rrb = radeon_get_depthbuffer(radeon); } else { -- cgit v1.2.3 From c0a0a1933d4c2a7d32284b5e7170e79ac6157043 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Feb 2010 18:25:36 +0100 Subject: r300: reset bos when validating buffers during blit --- src/mesa/drivers/dri/r300/r300_blit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 2bc761bc20..f9c085e283 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -381,6 +381,9 @@ static GLboolean validate_buffers(struct r300_context *r300, struct radeon_bo *dst_bo) { int ret; + + radeon_cs_space_reset_bos(r300->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) -- cgit v1.2.3 From ea3494b98cc764ead7e96746c0247ebc3a68e629 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Thu, 4 Mar 2010 18:35:55 +0100 Subject: r300: allow src and dst BOs to be placed in GTT during blit Fixes some relocation failures --- src/mesa/drivers/dri/r300/r300_blit.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index f9c085e283..d870c7f852 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -385,18 +385,12 @@ static GLboolean validate_buffers(struct r300_context *r300, radeon_cs_space_reset_bos(r300->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); - if (ret) - return GL_FALSE; - - ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, - first_elem(&r300->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; -- cgit v1.2.3 From 78eb4a2ea569a7bd624bbf83ece5c9acef82a8de Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 16 Jan 2010 15:11:37 +0100 Subject: radeon: no need to emit full state twice after flush --- src/mesa/drivers/dri/radeon/radeon_common.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 79f3ff7da6..13f1f0611b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -1325,11 +1325,6 @@ void rcommonBeginBatch(radeonContextPtr rmesa, int n, const char *function, int line) { - if (!rmesa->cmdbuf.cs->cdw && dostate) { - radeon_print(RADEON_STATE, RADEON_NORMAL, - "Reemit state after flush (from %s)\n", function); - radeonEmitState(rmesa); - } radeon_cs_begin(rmesa->cmdbuf.cs, n, file, function, line); radeon_print(RADEON_CS, RADEON_VERBOSE, "BEGIN_BATCH(%d) at %d, from %s:%i\n", -- cgit v1.2.3 From 9c0c6c26decfa533ad3fe39f83e7530d4cfc8c2f Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 14 Feb 2010 00:02:05 +0100 Subject: r300: don't enable EXT_packed_depth_stencil R300 hw doesn't support sampling from Z24_S8 or S8_Z24 formats. --- src/mesa/drivers/dri/r300/r300_context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index df4cc11da4..ff35cd5275 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -109,7 +109,6 @@ static const struct dri_extension card_extensions[] = { {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, {"GL_EXT_blend_subtract", NULL}, - {"GL_EXT_packed_depth_stencil", NULL}, {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, {"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions}, {"GL_EXT_provoking_vertex", GL_EXT_provoking_vertex_functions }, @@ -456,6 +455,9 @@ static void r300InitGLExtensions(GLcontext *ctx) } if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV350) _mesa_enable_extension(ctx, "GL_ARB_half_float_vertex"); + + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) + _mesa_enable_extension(ctx, "GL_EXT_packed_depth_stencil"); } static void r300InitIoctlFuncs(struct dd_function_table *functions) -- cgit v1.2.3 From 88a99bb305186fd0eaaae9bd0dbfa4c45f14cac7 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 16 Jan 2010 18:38:17 +0100 Subject: radeon: added tiling functions --- src/mesa/drivers/dri/r200/Makefile | 3 +- src/mesa/drivers/dri/r200/radeon_tile.c | 1 + src/mesa/drivers/dri/r200/radeon_tile.h | 1 + src/mesa/drivers/dri/r300/Makefile | 3 +- src/mesa/drivers/dri/r300/radeon_tile.c | 1 + src/mesa/drivers/dri/r300/radeon_tile.h | 1 + src/mesa/drivers/dri/r600/Makefile | 3 +- src/mesa/drivers/dri/r600/radeon_tile.c | 1 + src/mesa/drivers/dri/r600/radeon_tile.h | 1 + src/mesa/drivers/dri/radeon/Makefile | 3 +- src/mesa/drivers/dri/radeon/radeon_tile.c | 246 ++++++++++++++++++++++++++++++ src/mesa/drivers/dri/radeon/radeon_tile.h | 32 ++++ 12 files changed, 292 insertions(+), 4 deletions(-) create mode 120000 src/mesa/drivers/dri/r200/radeon_tile.c create mode 120000 src/mesa/drivers/dri/r200/radeon_tile.h create mode 120000 src/mesa/drivers/dri/r300/radeon_tile.c create mode 120000 src/mesa/drivers/dri/r300/radeon_tile.h create mode 120000 src/mesa/drivers/dri/r600/radeon_tile.c create mode 120000 src/mesa/drivers/dri/r600/radeon_tile.h create mode 100644 src/mesa/drivers/dri/radeon/radeon_tile.c create mode 100644 src/mesa/drivers/dri/radeon/radeon_tile.h (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 2e86e8b941..d91e5482e9 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -24,7 +24,8 @@ RADEON_COMMON_SOURCES = \ radeon_queryobj.c \ radeon_span.c \ radeon_texture.c \ - radeon_tex_copy.c + radeon_tex_copy.c \ + radeon_tile.c DRIVER_SOURCES = r200_context.c \ r200_ioctl.c \ diff --git a/src/mesa/drivers/dri/r200/radeon_tile.c b/src/mesa/drivers/dri/r200/radeon_tile.c new file mode 120000 index 0000000000..d4bfe27da6 --- /dev/null +++ b/src/mesa/drivers/dri/r200/radeon_tile.c @@ -0,0 +1 @@ +../radeon/radeon_tile.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r200/radeon_tile.h b/src/mesa/drivers/dri/r200/radeon_tile.h new file mode 120000 index 0000000000..31074c581e --- /dev/null +++ b/src/mesa/drivers/dri/r200/radeon_tile.h @@ -0,0 +1 @@ +../radeon/radeon_tile.h \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 08934fc996..730d801bb0 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -34,7 +34,8 @@ RADEON_COMMON_SOURCES = \ radeon_span.c \ radeon_queryobj.c \ radeon_texture.c \ - radeon_tex_copy.c + radeon_tex_copy.c \ + radeon_tile.c DRIVER_SOURCES = \ radeon_screen.c \ diff --git a/src/mesa/drivers/dri/r300/radeon_tile.c b/src/mesa/drivers/dri/r300/radeon_tile.c new file mode 120000 index 0000000000..d4bfe27da6 --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_tile.c @@ -0,0 +1 @@ +../radeon/radeon_tile.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/radeon_tile.h b/src/mesa/drivers/dri/r300/radeon_tile.h new file mode 120000 index 0000000000..31074c581e --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_tile.h @@ -0,0 +1 @@ +../radeon/radeon_tile.h \ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index 2478b12658..b6d1c5f459 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -34,7 +34,8 @@ RADEON_COMMON_SOURCES = \ radeon_span.c \ radeon_texture.c \ radeon_queryobj.c \ - radeon_tex_copy.c + radeon_tex_copy.c \ + radeon_tile.c DRIVER_SOURCES = \ radeon_screen.c \ diff --git a/src/mesa/drivers/dri/r600/radeon_tile.c b/src/mesa/drivers/dri/r600/radeon_tile.c new file mode 120000 index 0000000000..d4bfe27da6 --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_tile.c @@ -0,0 +1 @@ +../radeon/radeon_tile.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/radeon_tile.h b/src/mesa/drivers/dri/r600/radeon_tile.h new file mode 120000 index 0000000000..31074c581e --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_tile.h @@ -0,0 +1 @@ +../radeon/radeon_tile.h \ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index fc6d1c8e89..f7e8059c4f 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -25,7 +25,8 @@ RADEON_COMMON_SOURCES = \ radeon_queryobj.c \ radeon_span.c \ radeon_texture.c \ - radeon_tex_copy.c + radeon_tex_copy.c \ + radeon_tile.c DRIVER_SOURCES = \ radeon_context.c \ diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.c b/src/mesa/drivers/dri/radeon/radeon_tile.c new file mode 100644 index 0000000000..56f2fc46d9 --- /dev/null +++ b/src/mesa/drivers/dri/radeon/radeon_tile.c @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2010 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "radeon_tile.h" + +#include +#include + +#include
    + +#define MICRO_TILE_SIZE 32 + +static void micro_tile_8_x_4_8bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current source row */ + unsigned col; /* current source column */ + unsigned k; /* number of processed tiles */ + const unsigned tile_width = 8, tile_height = 4; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint8_t *src2 = (uint8_t *)src + src_pitch * row + col; + uint8_t *dst2 = (uint8_t *)dst + row * dst_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint8_t); + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint8_t)); + dst2 += tile_width; + src2 += src_pitch; + } + } + } +} + +static void micro_tile_4_x_4_16bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current source row */ + unsigned col; /* current source column */ + unsigned k; /* number of processed tiles */ + const unsigned tile_width = 4, tile_height = 4; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint16_t *src2 = (uint16_t *)src + src_pitch * row + col; + uint16_t *dst2 = (uint16_t *)dst + row * dst_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t); + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint16_t)); + dst2 += tile_width; + src2 += src_pitch; + } + } + } +} + +static void micro_tile_8_x_2_16bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current source row */ + unsigned col; /* current source column */ + unsigned k; /* number of processed tiles */ + const unsigned tile_width = 8, tile_height = 2; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint16_t *src2 = (uint16_t *)src + src_pitch * row + col; + uint16_t *dst2 = (uint16_t *)dst + row * dst_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t); + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint16_t)); + dst2 += tile_width; + src2 += src_pitch; + } + } + } +} + +static void micro_tile_4_x_2_32bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current source row */ + unsigned col; /* current source column */ + unsigned k; /* number of processed tiles */ + const unsigned tile_width = 4, tile_height = 2; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint32_t *src2 = (uint32_t *)src + src_pitch * row + col; + uint32_t *dst2 = (uint32_t *)dst + row * dst_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint32_t); + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint32_t)); + dst2 += tile_width; + src2 += src_pitch; + } + } + } +} + +static void micro_tile_2_x_2_64bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current source row */ + unsigned col; /* current source column */ + unsigned k; /* number of processed tiles */ + const unsigned tile_width = 2, tile_height = 2; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint64_t *src2 = (uint64_t *)src + src_pitch * row + col; + uint64_t *dst2 = (uint64_t *)dst + row * dst_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint64_t); + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint64_t)); + dst2 += tile_width; + src2 += src_pitch; + } + } + } +} + +static void micro_tile_1_x_1_128bit(const void * src, unsigned src_pitch, + void * dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned i, j; + const unsigned elem_size = 16; /* sizeof(uint128_t) */ + + for (j = 0; j < height; ++j) + { + for (i = 0; i < width; ++i) + { + memcpy(dst, src, width * elem_size); + dst += dst_pitch * elem_size; + src += src_pitch * elem_size; + } + } +} + +void tile_image(const void * src, unsigned src_pitch, + void *dst, unsigned dst_pitch, + gl_format format, unsigned width, unsigned height) +{ + assert(src_pitch >= width); + assert(dst_pitch >= width); + assert(dst_pitch * _mesa_get_format_bytes(format) % MICRO_TILE_SIZE == 0); + + switch (_mesa_get_format_bytes(format)) + { + case 16: + micro_tile_1_x_1_128bit(src, src_pitch, dst, dst_pitch, width, height); + break; + case 8: + micro_tile_2_x_2_64bit(src, src_pitch, dst, dst_pitch, width, height); + break; + case 4: + micro_tile_4_x_2_32bit(src, src_pitch, dst, dst_pitch, width, height); + break; + case 2: + if (_mesa_get_format_bits(format, GL_DEPTH_BITS)) + { + micro_tile_4_x_4_16bit(src, src_pitch, dst, dst_pitch, width, height); + } + else + { + micro_tile_8_x_2_16bit(src, src_pitch, dst, dst_pitch, width, height); + } + break; + case 1: + micro_tile_8_x_4_8bit(src, src_pitch, dst, dst_pitch, width, height); + break; + default: + assert(0); + break; + } +} \ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.h b/src/mesa/drivers/dri/radeon/radeon_tile.h new file mode 100644 index 0000000000..4985e55204 --- /dev/null +++ b/src/mesa/drivers/dri/radeon/radeon_tile.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2010 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include
    + +void tile_image(const void * src, unsigned src_pitch, + void *dst, unsigned dst_pitch, + gl_format format, unsigned width, unsigned height); -- cgit v1.2.3 From 65faa27aa639e7352708a30105db3318f22f5f93 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 16 Jan 2010 23:11:10 +0100 Subject: radeon: add tile size getter --- src/mesa/drivers/dri/radeon/radeon_tile.c | 40 ++++++++++++++++++++++++++++++- src/mesa/drivers/dri/radeon/radeon_tile.h | 2 ++ 2 files changed, 41 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.c b/src/mesa/drivers/dri/radeon/radeon_tile.c index 56f2fc46d9..b998baf0a2 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tile.c +++ b/src/mesa/drivers/dri/radeon/radeon_tile.c @@ -243,4 +243,42 @@ void tile_image(const void * src, unsigned src_pitch, assert(0); break; } -} \ No newline at end of file +} + +void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height) +{ + switch (_mesa_get_format_bytes(format)) + { + case 16: + *block_width = 1; + *block_height = 1; + break; + case 8: + *block_width = 2; + *block_height = 2; + break; + case 4: + *block_width = 4; + *block_height = 2; + break; + case 2: + if (_mesa_get_format_bits(format, GL_DEPTH_BITS)) + { + *block_width = 4; + *block_height = 4; + } + else + { + *block_width = 8; + *block_height = 2; + } + break; + case 1: + *block_width = 8; + *block_height = 4; + break; + default: + assert(0); + break; + } +} diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.h b/src/mesa/drivers/dri/radeon/radeon_tile.h index 4985e55204..06850b361d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tile.h +++ b/src/mesa/drivers/dri/radeon/radeon_tile.h @@ -30,3 +30,5 @@ void tile_image(const void * src, unsigned src_pitch, void *dst, unsigned dst_pitch, gl_format format, unsigned width, unsigned height); + +void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height); -- cgit v1.2.3 From 5fefca5dbae9a5b00a3d624da0b5e582c00ad280 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Feb 2010 13:46:17 +0100 Subject: radeon: add software untiling functions --- src/mesa/drivers/dri/radeon/radeon_tile.c | 221 ++++++++++++++++++++++++++++++ src/mesa/drivers/dri/radeon/radeon_tile.h | 4 + 2 files changed, 225 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.c b/src/mesa/drivers/dri/radeon/radeon_tile.c index b998baf0a2..1e4729a0b5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tile.c +++ b/src/mesa/drivers/dri/radeon/radeon_tile.c @@ -245,6 +245,227 @@ void tile_image(const void * src, unsigned src_pitch, } } +static void micro_untile_8_x_4_8bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current destination row */ + unsigned col; /* current destination column */ + unsigned k; /* current tile number */ + const unsigned tile_width = 8, tile_height = 4; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + assert(src_pitch % tile_width == 0); + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint8_t *src2 = (uint8_t *)src + row * src_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint8_t); + uint8_t *dst2 = (uint8_t *)dst + dst_pitch * row + col; + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint8_t)); + dst2 += dst_pitch; + src2 += tile_width; + } + } + } +} + +static void micro_untile_8_x_2_16bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current destination row */ + unsigned col; /* current destination column */ + unsigned k; /* current tile number */ + const unsigned tile_width = 8, tile_height = 2; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + assert(src_pitch % tile_width == 0); + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint16_t *src2 = (uint16_t *)src + row * src_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t); + uint16_t *dst2 = (uint16_t *)dst + dst_pitch * row + col; + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint16_t)); + dst2 += dst_pitch; + src2 += tile_width; + } + } + } +} + +static void micro_untile_4_x_4_16bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current destination row */ + unsigned col; /* current destination column */ + unsigned k; /* current tile number */ + const unsigned tile_width = 4, tile_height = 4; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + assert(src_pitch % tile_width == 0); + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint16_t *src2 = (uint16_t *)src + row * src_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint16_t); + uint16_t *dst2 = (uint16_t *)dst + dst_pitch * row + col; + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint16_t)); + dst2 += dst_pitch; + src2 += tile_width; + } + } + } +} + +static void micro_untile_4_x_2_32bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current destination row */ + unsigned col; /* current destination column */ + unsigned k; /* current tile number */ + const unsigned tile_width = 4, tile_height = 2; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + assert(src_pitch % tile_width == 0); + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint32_t *src2 = (uint32_t *)src + row * src_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint32_t); + uint32_t *dst2 = (uint32_t *)dst + dst_pitch * row + col; + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint32_t)); + dst2 += dst_pitch; + src2 += tile_width; + } + } + } +} + +static void micro_untile_2_x_2_64bit(const void * const src, unsigned src_pitch, + void * const dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned row; /* current destination row */ + unsigned col; /* current destination column */ + unsigned k; /* current tile number */ + const unsigned tile_width = 2, tile_height = 2; + const unsigned tiles_in_row = (width + (tile_width - 1)) / tile_width; + + assert(src_pitch % tile_width == 0); + + k = 0; + for (row = 0; row < height; row += tile_height) + { + for (col = 0; col < width; col += tile_width, ++k) + { + uint64_t *src2 = (uint64_t *)src + row * src_pitch + + (k % tiles_in_row) * MICRO_TILE_SIZE / sizeof(uint64_t); + uint64_t *dst2 = (uint64_t *)dst + dst_pitch * row + col; + unsigned j; + + for (j = 0; j < MIN2(tile_height, height - row); ++j) + { + unsigned columns = MIN2(tile_width, width - col); + memcpy(dst2, src2, columns * sizeof(uint64_t)); + dst2 += dst_pitch; + src2 += tile_width; + } + } + } +} + +static void micro_untile_1_x_1_128bit(const void * src, unsigned src_pitch, + void * dst, unsigned dst_pitch, + unsigned width, unsigned height) +{ + unsigned i, j; + const unsigned elem_size = 16; /* sizeof(uint128_t) */ + + for (j = 0; j < height; ++j) + { + for (i = 0; i < width; ++i) + { + memcpy(dst, src, width * elem_size); + dst += dst_pitch * elem_size; + src += src_pitch * elem_size; + } + } +} + +void untile_image(const void * src, unsigned src_pitch, + void *dst, unsigned dst_pitch, + gl_format format, unsigned width, unsigned height) +{ + assert(src_pitch >= width); + assert(dst_pitch >= width); + assert(src_pitch * _mesa_get_format_bytes(format) % MICRO_TILE_SIZE == 0); + + switch (_mesa_get_format_bytes(format)) + { + case 16: + micro_untile_1_x_1_128bit(src, src_pitch, dst, dst_pitch, width, height); + break; + case 8: + micro_untile_2_x_2_64bit(src, src_pitch, dst, dst_pitch, width, height); + break; + case 4: + micro_untile_4_x_2_32bit(src, src_pitch, dst, dst_pitch, width, height); + break; + case 2: + if (_mesa_get_format_bits(format, GL_DEPTH_BITS)) + { + micro_untile_4_x_4_16bit(src, src_pitch, dst, dst_pitch, width, height); + } + else + { + micro_untile_8_x_2_16bit(src, src_pitch, dst, dst_pitch, width, height); + } + break; + case 1: + micro_untile_8_x_4_8bit(src, src_pitch, dst, dst_pitch, width, height); + break; + default: + assert(0); + break; + } +} + void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height) { switch (_mesa_get_format_bytes(format)) diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.h b/src/mesa/drivers/dri/radeon/radeon_tile.h index 06850b361d..31d9c5611c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tile.h +++ b/src/mesa/drivers/dri/radeon/radeon_tile.h @@ -31,4 +31,8 @@ void tile_image(const void * src, unsigned src_pitch, void *dst, unsigned dst_pitch, gl_format format, unsigned width, unsigned height); +void untile_image(const void * src, unsigned src_pitch, + void *dst, unsigned dst_pitch, + gl_format format, unsigned width, unsigned height); + void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height); -- cgit v1.2.3 From 8014b5f06853a5926ee772af232abdc9cd4e90c4 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Feb 2010 18:38:01 +0100 Subject: radeon: add some debugging info to sw tiling/untiling functions --- src/mesa/drivers/dri/radeon/radeon_tile.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.c b/src/mesa/drivers/dri/radeon/radeon_tile.c index 1e4729a0b5..935fa45e04 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tile.c +++ b/src/mesa/drivers/dri/radeon/radeon_tile.c @@ -30,7 +30,8 @@ #include #include -#include
    +#include "main/macros.h" +#include "radeon_debug.h" #define MICRO_TILE_SIZE 32 @@ -215,6 +216,10 @@ void tile_image(const void * src, unsigned src_pitch, assert(dst_pitch >= width); assert(dst_pitch * _mesa_get_format_bytes(format) % MICRO_TILE_SIZE == 0); + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "Software tiling: src_pitch %d, dst_pitch %d, width %d, height %d, bpp %d\n", + src_pitch, dst_pitch, width, height, _mesa_get_format_bytes(format)); + switch (_mesa_get_format_bytes(format)) { case 16: @@ -436,6 +441,10 @@ void untile_image(const void * src, unsigned src_pitch, assert(dst_pitch >= width); assert(src_pitch * _mesa_get_format_bytes(format) % MICRO_TILE_SIZE == 0); + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "Software untiling: src_pitch %d, dst_pitch %d, width %d, height %d, bpp %d\n", + src_pitch, dst_pitch, width, height, _mesa_get_format_bytes(format)); + switch (_mesa_get_format_bytes(format)) { case 16: -- cgit v1.2.3 From b078a613bedb76242af177bee12520203bd63d50 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 9 Jan 2010 20:36:47 +0100 Subject: radeon: add texture helper function --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 26 ++++++++++++++++++++++++ src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h | 3 +++ 2 files changed, 29 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index cd843d965e..117d695ce7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -81,6 +81,32 @@ static unsigned get_compressed_image_size( return rowStride * ((height + blockHeight - 1) / blockHeight); } +static unsigned is_pot(unsigned value) +{ + unsigned m; + + for (m = 1; m < value; m *= 2) {} + + return value == m; +} + +unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width) +{ + if (_mesa_is_format_compressed(format)) { + return get_aligned_compressed_row_stride(format, width, rmesa->texture_compressed_row_align); + } else { + unsigned row_align; + + if (is_pot(width)) { + row_align = rmesa->texture_row_align - 1; + } else { + row_align = rmesa->texture_rect_row_align - 1; + } + + return (_mesa_format_row_stride(format, width) + row_align) & ~row_align; + } +} + /** * Compute sizes and fill in offset and blit information for the given * image (determined by \p face and \p level). diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index c911688c1a..424bf5181a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -89,4 +89,7 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t); GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt, GLuint face, GLuint level); uint32_t get_base_teximage_offset(radeonTexObj *texObj); + +unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width); + #endif /* __RADEON_MIPMAP_TREE_H_ */ -- cgit v1.2.3 From 0d3835475fcb803a295dc738d90b83788bdc9472 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 16 Jan 2010 23:11:36 +0100 Subject: radeon: minor refactoring of mipmap code --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 50 +++++++++++------------- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h | 6 +++ 2 files changed, 29 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 117d695ce7..8c1f96ede0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -36,6 +36,7 @@ #include "main/texobj.h" #include "main/enums.h" #include "radeon_texture.h" +#include "radeon_tile.h" static unsigned get_aligned_compressed_row_stride( gl_format format, @@ -69,16 +70,30 @@ static unsigned get_aligned_compressed_row_stride( return stride; } -static unsigned get_compressed_image_size( +unsigned get_texture_image_size( gl_format format, unsigned rowStride, - unsigned height) + unsigned height, + unsigned depth, + unsigned tiling) { - unsigned blockWidth, blockHeight; + if (_mesa_is_format_compressed(format)) { + unsigned blockWidth, blockHeight; - _mesa_get_format_block_size(format, &blockWidth, &blockHeight); + _mesa_get_format_block_size(format, &blockWidth, &blockHeight); + + return rowStride * ((height + blockHeight - 1) / blockHeight) * depth; + } else if (tiling) { + /* Need to align height to tile height */ + unsigned tileWidth, tileHeight; + + get_tile_size(format, &tileWidth, &tileHeight); + tileHeight--; - return rowStride * ((height + blockHeight - 1) / blockHeight); + height = (height + tileHeight) & ~tileHeight; + } + + return rowStride * height * depth; } static unsigned is_pot(unsigned value) @@ -118,34 +133,15 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree GLuint face, GLuint level, GLuint* curOffset) { radeon_mipmap_level *lvl = &mt->levels[level]; - uint32_t row_align; GLuint height; height = _mesa_next_pow_two_32(lvl->height); - /* Find image size in bytes */ - if (_mesa_is_format_compressed(mt->mesaFormat)) { - lvl->rowstride = get_aligned_compressed_row_stride(mt->mesaFormat, lvl->width, rmesa->texture_compressed_row_align); - lvl->size = get_compressed_image_size(mt->mesaFormat, lvl->rowstride, height); - } else if (mt->target == GL_TEXTURE_RECTANGLE_NV) { - row_align = rmesa->texture_rect_row_align - 1; - lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; - lvl->size = lvl->rowstride * height; - } else if (mt->tilebits & RADEON_TXO_MICRO_TILE) { - /* tile pattern is 16 bytes x2. mipmaps stay 32 byte aligned, - * though the actual offset may be different (if texture is less than - * 32 bytes width) to the untiled case */ - lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) * 2 + 31) & ~31; - lvl->size = lvl->rowstride * ((height + 1) / 2) * lvl->depth; - } else { - row_align = rmesa->texture_row_align - 1; - lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; - lvl->size = lvl->rowstride * height * lvl->depth; - } + lvl->rowstride = get_texture_image_row_stride(rmesa, mt->mesaFormat, lvl->width); + lvl->size = get_texture_image_size(mt->mesaFormat, lvl->rowstride, lvl->height, lvl->depth, mt->tilebits); + assert(lvl->size > 0); - /* All images are aligned to a 32-byte offset */ - *curOffset = (*curOffset + 0x1f) & ~0x1f; lvl->faces[face].offset = *curOffset; *curOffset += lvl->size; diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index 424bf5181a..69103e68de 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -92,4 +92,10 @@ uint32_t get_base_teximage_offset(radeonTexObj *texObj); unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width); +unsigned get_texture_image_size( + gl_format format, + unsigned rowStride, + unsigned height, + unsigned depth, + unsigned tiling); #endif /* __RADEON_MIPMAP_TREE_H_ */ -- cgit v1.2.3 From d0ca5c3100dfe7ee634e3b455002e11e88822ea7 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 12:09:43 +0100 Subject: radeon: properly calculate rowstride for tiled images --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 14 +++++++++----- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h | 2 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 4 ++-- src/mesa/drivers/dri/radeon/radeon_tile.c | 2 -- 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 8c1f96ede0..ee91f30be5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -105,17 +105,21 @@ static unsigned is_pot(unsigned value) return value == m; } -unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width) +unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling) { if (_mesa_is_format_compressed(format)) { return get_aligned_compressed_row_stride(format, width, rmesa->texture_compressed_row_align); } else { unsigned row_align; - if (is_pot(width)) { - row_align = rmesa->texture_row_align - 1; - } else { + if (!is_pot(width)) { row_align = rmesa->texture_rect_row_align - 1; + } else if (tiling) { + unsigned tileWidth, tileHeight; + get_tile_size(format, &tileWidth, &tileHeight); + row_align = tileWidth * _mesa_get_format_bytes(format) - 1; + } else { + row_align = rmesa->texture_row_align - 1; } return (_mesa_format_row_stride(format, width) + row_align) & ~row_align; @@ -137,7 +141,7 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree height = _mesa_next_pow_two_32(lvl->height); - lvl->rowstride = get_texture_image_row_stride(rmesa, mt->mesaFormat, lvl->width); + lvl->rowstride = get_texture_image_row_stride(rmesa, mt->mesaFormat, lvl->width, mt->tilebits); lvl->size = get_texture_image_size(mt->mesaFormat, lvl->rowstride, lvl->height, lvl->depth, mt->tilebits); assert(lvl->size > 0); diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index 69103e68de..088f970172 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -90,7 +90,7 @@ GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt, GLuint face, GLuint level); uint32_t get_base_teximage_offset(radeonTexObj *texObj); -unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width); +unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling); unsigned get_texture_image_size( gl_format format, diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index ff37fd3e86..62dec2d4e0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -664,6 +664,7 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, struct gl_texture_image *texImage, int compressed) { + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); radeonTexObj *t = radeon_tex_obj(texObj); radeon_texture_image* image = get_radeon_texture_image(texImage); @@ -678,8 +679,7 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, dstRowStride = image->mt->levels[image->mtlevel].rowstride; } else if (t->bo) { /* TFP case */ - /* TODO */ - assert(0); + dstRowStride = get_texture_image_row_stride(rmesa, texImage->TexFormat, width, 0); } else { dstRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); } diff --git a/src/mesa/drivers/dri/radeon/radeon_tile.c b/src/mesa/drivers/dri/radeon/radeon_tile.c index 935fa45e04..403da11010 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tile.c +++ b/src/mesa/drivers/dri/radeon/radeon_tile.c @@ -214,7 +214,6 @@ void tile_image(const void * src, unsigned src_pitch, { assert(src_pitch >= width); assert(dst_pitch >= width); - assert(dst_pitch * _mesa_get_format_bytes(format) % MICRO_TILE_SIZE == 0); radeon_print(RADEON_TEXTURE, RADEON_TRACE, "Software tiling: src_pitch %d, dst_pitch %d, width %d, height %d, bpp %d\n", @@ -439,7 +438,6 @@ void untile_image(const void * src, unsigned src_pitch, { assert(src_pitch >= width); assert(dst_pitch >= width); - assert(src_pitch * _mesa_get_format_bytes(format) % MICRO_TILE_SIZE == 0); radeon_print(RADEON_TEXTURE, RADEON_TRACE, "Software untiling: src_pitch %d, dst_pitch %d, width %d, height %d, bpp %d\n", -- cgit v1.2.3 From 2b801066a1fcd8a83a367f70736d6adf2043f979 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 12:15:25 +0100 Subject: radeon: Some possible improvements that I spoted in radeon_tiled_texture branch. --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index ee91f30be5..c6cc417dd6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -96,15 +96,6 @@ unsigned get_texture_image_size( return rowStride * height * depth; } -static unsigned is_pot(unsigned value) -{ - unsigned m; - - for (m = 1; m < value; m *= 2) {} - - return value == m; -} - unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling) { if (_mesa_is_format_compressed(format)) { @@ -112,7 +103,7 @@ unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, } else { unsigned row_align; - if (!is_pot(width)) { + if (!_mesa_is_pow_two(width)) { row_align = rmesa->texture_rect_row_align - 1; } else if (tiling) { unsigned tileWidth, tileHeight; -- cgit v1.2.3 From ccbe3f0314c8278c55e1046a619969ae539564de Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 17 Jan 2010 12:47:46 +0100 Subject: radeon: move glGetTexImage handlers to seperate file --- src/mesa/drivers/dri/r200/Makefile | 1 + src/mesa/drivers/dri/r200/radeon_tex_getimage.c | 1 + src/mesa/drivers/dri/r300/Makefile | 1 + src/mesa/drivers/dri/r300/radeon_tex_getimage.c | 1 + src/mesa/drivers/dri/r600/Makefile | 1 + src/mesa/drivers/dri/r600/radeon_tex_getimage.c | 1 + src/mesa/drivers/dri/radeon/Makefile | 1 + src/mesa/drivers/dri/radeon/radeon_tex_getimage.c | 95 +++++++++++++++++++++++ src/mesa/drivers/dri/radeon/radeon_texture.c | 60 -------------- 9 files changed, 102 insertions(+), 60 deletions(-) create mode 120000 src/mesa/drivers/dri/r200/radeon_tex_getimage.c create mode 120000 src/mesa/drivers/dri/r300/radeon_tex_getimage.c create mode 120000 src/mesa/drivers/dri/r600/radeon_tex_getimage.c create mode 100644 src/mesa/drivers/dri/radeon/radeon_tex_getimage.c (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index d91e5482e9..3f87100570 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -25,6 +25,7 @@ RADEON_COMMON_SOURCES = \ radeon_span.c \ radeon_texture.c \ radeon_tex_copy.c \ + radeon_tex_getimage.c \ radeon_tile.c DRIVER_SOURCES = r200_context.c \ diff --git a/src/mesa/drivers/dri/r200/radeon_tex_getimage.c b/src/mesa/drivers/dri/r200/radeon_tex_getimage.c new file mode 120000 index 0000000000..d9836d7326 --- /dev/null +++ b/src/mesa/drivers/dri/r200/radeon_tex_getimage.c @@ -0,0 +1 @@ +../radeon/radeon_tex_getimage.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 730d801bb0..4257a32b89 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -35,6 +35,7 @@ RADEON_COMMON_SOURCES = \ radeon_queryobj.c \ radeon_texture.c \ radeon_tex_copy.c \ + radeon_tex_getimage.c \ radeon_tile.c DRIVER_SOURCES = \ diff --git a/src/mesa/drivers/dri/r300/radeon_tex_getimage.c b/src/mesa/drivers/dri/r300/radeon_tex_getimage.c new file mode 120000 index 0000000000..d9836d7326 --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_tex_getimage.c @@ -0,0 +1 @@ +../radeon/radeon_tex_getimage.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index b6d1c5f459..f76859d11e 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -35,6 +35,7 @@ RADEON_COMMON_SOURCES = \ radeon_texture.c \ radeon_queryobj.c \ radeon_tex_copy.c \ + radeon_tex_getimage.c \ radeon_tile.c DRIVER_SOURCES = \ diff --git a/src/mesa/drivers/dri/r600/radeon_tex_getimage.c b/src/mesa/drivers/dri/r600/radeon_tex_getimage.c new file mode 120000 index 0000000000..d9836d7326 --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_tex_getimage.c @@ -0,0 +1 @@ +../radeon/radeon_tex_getimage.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index f7e8059c4f..6904ebbee3 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -26,6 +26,7 @@ RADEON_COMMON_SOURCES = \ radeon_span.c \ radeon_texture.c \ radeon_tex_copy.c \ + radeon_tex_getimage.c \ radeon_tile.c DRIVER_SOURCES = \ diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c b/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c new file mode 100644 index 0000000000..7bf6dcc2e3 --- /dev/null +++ b/src/mesa/drivers/dri/radeon/radeon_tex_getimage.c @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2009 Maciej Cencora. + * Copyright (C) 2008 Nicolai Haehnle. + * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. + * + * The Weather Channel (TM) funded Tungsten Graphics to develop the + * initial release of the Radeon 8500 driver under the XFree86 license. + * This notice must be preserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "radeon_common_context.h" +#include "radeon_texture.h" +#include "radeon_mipmap_tree.h" + +#include "main/texgetimage.h" + +/** + * Need to map texture image into memory before copying image data, + * then unmap it. + */ +static void +radeon_get_tex_image(GLcontext * ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, int compressed) +{ + radeon_texture_image *image = get_radeon_texture_image(texImage); + + radeon_print(RADEON_TEXTURE, RADEON_NORMAL, + "%s(%p, tex %p, image %p) compressed %d.\n", + __func__, ctx, texObj, image, compressed); + + if (image->mt) { + /* Map the texture image read-only */ + radeon_teximage_map(image, GL_FALSE); + } else { + /* Image hasn't been uploaded to a miptree yet */ + assert(image->base.Data); + } + + if (compressed) { + /* FIXME: this can't work for small textures (mips) which + use different hw stride */ + _mesa_get_compressed_teximage(ctx, target, level, pixels, + texObj, texImage); + } else { + _mesa_get_teximage(ctx, target, level, format, type, pixels, + texObj, texImage); + } + + if (image->mt) { + radeon_teximage_unmap(image); + } +} + +void +radeonGetTexImage(GLcontext * ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + radeon_get_tex_image(ctx, target, level, format, type, pixels, + texObj, texImage, 0); +} + +void +radeonGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, + GLvoid *pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + radeon_get_tex_image(ctx, target, level, 0, 0, pixels, + texObj, texImage, 1); +} diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 62dec2d4e0..6a8e70d47e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -39,7 +39,6 @@ #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" -#include "main/texgetimage.h" #include "xmlpool.h" /* for symbolic values of enum-type options */ @@ -998,62 +997,3 @@ void radeonTexSubImage3D(GLcontext * ctx, GLenum target, GLint level, radeon_texsubimage(ctx, 3, target, level, xoffset, yoffset, zoffset, width, height, depth, 0, format, type, pixels, packing, texObj, texImage, 0); } - -/** - * Need to map texture image into memory before copying image data, - * then unmap it. - */ -static void -radeon_get_tex_image(GLcontext * ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage, int compressed) -{ - radeon_texture_image *image = get_radeon_texture_image(texImage); - - radeon_print(RADEON_TEXTURE, RADEON_NORMAL, - "%s(%p, tex %p, image %p) compressed %d.\n", - __func__, ctx, texObj, image, compressed); - - if (image->mt) { - /* Map the texture image read-only */ - radeon_teximage_map(image, GL_FALSE); - } else { - /* Image hasn't been uploaded to a miptree yet */ - assert(image->base.Data); - } - - if (compressed) { - /* FIXME: this can't work for small textures (mips) which - use different hw stride */ - _mesa_get_compressed_teximage(ctx, target, level, pixels, - texObj, texImage); - } else { - _mesa_get_teximage(ctx, target, level, format, type, pixels, - texObj, texImage); - } - - if (image->mt) { - radeon_teximage_unmap(image); - } -} - -void -radeonGetTexImage(GLcontext * ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - radeon_get_tex_image(ctx, target, level, format, type, pixels, - texObj, texImage, 0); -} - -void -radeonGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, - GLvoid *pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - radeon_get_tex_image(ctx, target, level, 0, 0, pixels, - texObj, texImage, 1); -} -- cgit v1.2.3 From 4012219f1f215cec9406be644b6b9d421bb5d8e4 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 6 Feb 2010 03:11:50 +0100 Subject: r300g: move r300_transfer to separate files --- src/gallium/drivers/r300/Makefile | 3 +- src/gallium/drivers/r300/SConscript | 1 + src/gallium/drivers/r300/r300_screen.c | 74 ++-------------------- src/gallium/drivers/r300/r300_screen.h | 16 +---- src/gallium/drivers/r300/r300_transfer.c | 101 +++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_transfer.h | 60 ++++++++++++++++++ 6 files changed, 171 insertions(+), 84 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_transfer.c create mode 100644 src/gallium/drivers/r300/r300_transfer.h (limited to 'src') diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 1f69daec81..61b54af4dd 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -19,7 +19,8 @@ C_SOURCES = \ r300_state_invariant.c \ r300_vs.c \ r300_texture.c \ - r300_tgsi_to_rc.c + r300_tgsi_to_rc.c \ + r300_transfer.c LIBRARY_INCLUDES = \ -I$(TOP)/src/mesa/drivers/dri/r300/compiler \ diff --git a/src/gallium/drivers/r300/SConscript b/src/gallium/drivers/r300/SConscript index 183aa17f9b..27b2e30993 100644 --- a/src/gallium/drivers/r300/SConscript +++ b/src/gallium/drivers/r300/SConscript @@ -30,6 +30,7 @@ r300 = env.ConvenienceLibrary( 'r300_vs.c', 'r300_texture.c', 'r300_tgsi_to_rc.c', + 'r300_transfer.c', ] + r300compiler) + r300compiler Export('r300') diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index d397a8eb2b..a35be05940 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -1,5 +1,6 @@ /* * Copyright 2008 Corbin Simpson + * Copyright 2010 Marek Olšák * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -20,14 +21,13 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "util/u_inlines.h" #include "util/u_format.h" #include "util/u_memory.h" #include "util/u_simple_screen.h" #include "r300_context.h" -#include "r300_screen.h" #include "r300_texture.h" +#include "r300_transfer.h" #include "radeon_winsys.h" #include "r300_winsys.h" @@ -250,70 +250,6 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, return retval == usage; } -static struct pipe_transfer* -r300_get_tex_transfer(struct pipe_screen *screen, - struct pipe_texture *texture, - unsigned face, unsigned level, unsigned zslice, - enum pipe_transfer_usage usage, unsigned x, unsigned y, - unsigned w, unsigned h) -{ - struct r300_texture *tex = (struct r300_texture *)texture; - struct r300_transfer *trans; - struct r300_screen *rscreen = r300_screen(screen); - unsigned offset; - - offset = r300_texture_get_offset(tex, level, zslice, face); /* in bytes */ - - trans = CALLOC_STRUCT(r300_transfer); - if (trans) { - pipe_texture_reference(&trans->transfer.texture, texture); - trans->transfer.x = x; - trans->transfer.y = y; - trans->transfer.width = w; - trans->transfer.height = h; - trans->transfer.stride = r300_texture_get_stride(rscreen, tex, level); - trans->transfer.usage = usage; - trans->transfer.zslice = zslice; - trans->transfer.face = face; - - trans->offset = offset; - } - return &trans->transfer; -} - -static void -r300_tex_transfer_destroy(struct pipe_transfer *trans) -{ - pipe_texture_reference(&trans->texture, NULL); - FREE(trans); -} - -static void* r300_transfer_map(struct pipe_screen* screen, - struct pipe_transfer* transfer) -{ - struct r300_texture* tex = (struct r300_texture*)transfer->texture; - char* map; - enum pipe_format format = tex->tex.format; - - map = pipe_buffer_map(screen, tex->buffer, - pipe_transfer_buffer_flags(transfer)); - - if (!map) { - return NULL; - } - - return map + r300_transfer(transfer)->offset + - transfer->y / util_format_get_blockheight(format) * transfer->stride + - transfer->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format); -} - -static void r300_transfer_unmap(struct pipe_screen* screen, - struct pipe_transfer* transfer) -{ - struct r300_texture* tex = (struct r300_texture*)transfer->texture; - pipe_buffer_unmap(screen, tex->buffer); -} - static void r300_destroy_screen(struct pipe_screen* pscreen) { struct r300_screen* r300screen = r300_screen(pscreen); @@ -350,13 +286,11 @@ struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys) r300screen->screen.get_paramf = r300_get_paramf; r300screen->screen.is_format_supported = r300_is_format_supported; r300screen->screen.context_create = r300_create_context; - r300screen->screen.get_tex_transfer = r300_get_tex_transfer; - r300screen->screen.tex_transfer_destroy = r300_tex_transfer_destroy; - r300screen->screen.transfer_map = r300_transfer_map; - r300screen->screen.transfer_unmap = r300_transfer_unmap; r300_init_screen_texture_functions(&r300screen->screen); + r300_init_screen_transfer_functions(&r300screen->screen); u_simple_screen_init(&r300screen->screen); return &r300screen->screen; } + diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index 502fbfa5a2..6d72fec778 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -1,5 +1,6 @@ /* * Copyright 2008 Corbin Simpson + * Copyright 2010 Marek Olšák * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -42,25 +43,14 @@ struct r300_screen { unsigned debug; }; -struct r300_transfer { - /* Parent class */ - struct pipe_transfer transfer; - - /* Offset from start of buffer. */ - unsigned offset; -}; /* Convenience cast wrapper. */ static INLINE struct r300_screen* r300_screen(struct pipe_screen* screen) { return (struct r300_screen*)screen; } -/* Convenience cast wrapper. */ -static INLINE struct r300_transfer* -r300_transfer(struct pipe_transfer* transfer) -{ - return (struct r300_transfer*)transfer; -} +/* Creates a new r300 screen. */ +struct pipe_screen* r300_create_screen(struct radeon_winsys* radeon_winsys); /* Debug functionality. */ diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c new file mode 100644 index 0000000000..fa48688db2 --- /dev/null +++ b/src/gallium/drivers/r300/r300_transfer.c @@ -0,0 +1,101 @@ +/* + * Copyright 2008 Corbin Simpson + * Copyright 2010 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "r300_context.h" +#include "r300_transfer.h" +#include "r300_texture.h" +#include "r300_screen.h" + +#include "util/u_memory.h" +#include "util/u_format.h" + +static struct pipe_transfer* +r300_get_tex_transfer(struct pipe_screen *screen, + struct pipe_texture *texture, + unsigned face, unsigned level, unsigned zslice, + enum pipe_transfer_usage usage, unsigned x, unsigned y, + unsigned w, unsigned h) +{ + struct r300_texture *tex = (struct r300_texture *)texture; + struct r300_transfer *trans; + struct r300_screen *rscreen = r300_screen(screen); + unsigned offset; + + offset = r300_texture_get_offset(tex, level, zslice, face); /* in bytes */ + + trans = CALLOC_STRUCT(r300_transfer); + if (trans) { + pipe_texture_reference(&trans->transfer.texture, texture); + trans->transfer.x = x; + trans->transfer.y = y; + trans->transfer.width = w; + trans->transfer.height = h; + trans->transfer.stride = r300_texture_get_stride(rscreen, tex, level); + trans->transfer.usage = usage; + trans->transfer.zslice = zslice; + trans->transfer.face = face; + + trans->offset = offset; + } + return &trans->transfer; +} + +static void r300_tex_transfer_destroy(struct pipe_transfer *trans) +{ + pipe_texture_reference(&trans->texture, NULL); + FREE(trans); +} + +static void* r300_transfer_map(struct pipe_screen *screen, + struct pipe_transfer *transfer) +{ + struct r300_texture *tex = (struct r300_texture*)transfer->texture; + char *map; + enum pipe_format format = tex->tex.format; + + map = pipe_buffer_map(screen, tex->buffer, + pipe_transfer_buffer_flags(transfer)); + + if (!map) { + return NULL; + } + + return map + r300_transfer(transfer)->offset + + transfer->y / util_format_get_blockheight(format) * transfer->stride + + transfer->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format); +} + +static void r300_transfer_unmap(struct pipe_screen *screen, + struct pipe_transfer *transfer) +{ + struct r300_texture *tex = (struct r300_texture*)transfer->texture; + pipe_buffer_unmap(screen, tex->buffer); +} + +void r300_init_screen_transfer_functions(struct pipe_screen *screen) +{ + screen->get_tex_transfer = r300_get_tex_transfer; + screen->tex_transfer_destroy = r300_tex_transfer_destroy; + screen->transfer_map = r300_transfer_map; + screen->transfer_unmap = r300_transfer_unmap; +} diff --git a/src/gallium/drivers/r300/r300_transfer.h b/src/gallium/drivers/r300/r300_transfer.h new file mode 100644 index 0000000000..faf62338ef --- /dev/null +++ b/src/gallium/drivers/r300/r300_transfer.h @@ -0,0 +1,60 @@ +/* + * Copyright 2008 Corbin Simpson + * Copyright 2010 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef R300_TRANSFER +#define R300_TRANSFER + +#include "pipe/p_screen.h" +#include "pipe/p_state.h" + +struct r300_texture; +struct r300_screen; + +struct r300_transfer { + /* Parent class */ + struct pipe_transfer transfer; + + /* Parameters of get_tex_transfer. */ + unsigned x, y, level, zslice, face; + + /* Offset from start of buffer. */ + unsigned offset; + + /* Untiled texture. */ + struct r300_texture *untiled_texture; + + /* Transfer and format flags. */ + unsigned buffer_usage, render_target_usage; +}; + +/* Convenience cast wrapper. */ +static INLINE struct r300_transfer* +r300_transfer(struct pipe_transfer* transfer) +{ + return (struct r300_transfer*)transfer; +} + +void r300_init_screen_transfer_functions(struct pipe_screen *screen); + +#endif + -- cgit v1.2.3 From 6c7fac846ef99cde5305cf1011b4570bd1901625 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 14 Feb 2010 03:19:01 +0100 Subject: r300g: add ability to tile/detile textures using blit during transfers --- src/gallium/drivers/r300/r300_context.c | 2 + src/gallium/drivers/r300/r300_screen.h | 6 + src/gallium/drivers/r300/r300_texture.c | 5 +- src/gallium/drivers/r300/r300_transfer.c | 210 +++++++++++++++++++++++++++---- src/gallium/drivers/r300/r300_transfer.h | 29 ----- 5 files changed, 197 insertions(+), 55 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index ec1c586522..e43e088b36 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -159,6 +159,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, if (!r300) return NULL; + r300screen->ctx = (struct pipe_context*)r300; + r300->winsys = radeon_winsys; r300->context.winsys = (struct pipe_winsys*)radeon_winsys; diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h index 6d72fec778..484bde6a6b 100644 --- a/src/gallium/drivers/r300/r300_screen.h +++ b/src/gallium/drivers/r300/r300_screen.h @@ -28,6 +28,8 @@ #include "r300_chipset.h" +#define R300_TEXTURE_USAGE_TRANSFER PIPE_TEXTURE_USAGE_CUSTOM + struct radeon_winsys; struct r300_screen { @@ -36,6 +38,10 @@ struct r300_screen { struct radeon_winsys* radeon_winsys; + /* XXX This hack will be removed once texture transfers become part of + * pipe_context. */ + struct pipe_context* ctx; + /* Chipset capabilities */ struct r300_capabilities* caps; diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index c0144f64b4..04e326eb78 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -725,9 +725,8 @@ static void r300_setup_flags(struct r300_texture* tex) } /* Create a new texture. */ -static struct pipe_texture* - r300_texture_create(struct pipe_screen* screen, - const struct pipe_texture* template) +static struct pipe_texture* r300_texture_create(struct pipe_screen* screen, + const struct pipe_texture* template) { struct r300_texture* tex = CALLOC_STRUCT(r300_texture); struct r300_screen* rscreen = r300_screen(screen); diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c index fa48688db2..56a6976e8b 100644 --- a/src/gallium/drivers/r300/r300_transfer.c +++ b/src/gallium/drivers/r300/r300_transfer.c @@ -29,6 +29,89 @@ #include "util/u_memory.h" #include "util/u_format.h" +struct r300_transfer { + /* Parent class */ + struct pipe_transfer transfer; + + /* Pipe context. */ + struct pipe_context *ctx; + + /* Parameters of get_tex_transfer. */ + unsigned x, y, level, zslice, face; + + /* Offset from start of buffer. */ + unsigned offset; + + /* Detiled texture. */ + struct r300_texture *detiled_texture; + + /* Transfer and format flags. */ + unsigned buffer_usage, render_target_usage; +}; + +/* Convenience cast wrapper. */ +static INLINE struct r300_transfer* +r300_transfer(struct pipe_transfer* transfer) +{ + return (struct r300_transfer*)transfer; +} + +/* Copy from a tiled texture to a detiled one. */ +static void r300_copy_from_tiled_texture(struct pipe_context *ctx, + struct r300_transfer *r300transfer) +{ + struct pipe_screen *screen = ctx->screen; + struct pipe_transfer *transfer = (struct pipe_transfer*)r300transfer; + struct pipe_texture *tex = transfer->texture; + struct pipe_surface *src, *dst; + + src = screen->get_tex_surface(screen, tex, r300transfer->face, + r300transfer->level, r300transfer->zslice, + PIPE_BUFFER_USAGE_GPU_READ | + PIPE_BUFFER_USAGE_PIXEL); + + dst = screen->get_tex_surface(screen, &r300transfer->detiled_texture->tex, + 0, 0, 0, + PIPE_BUFFER_USAGE_GPU_WRITE | + PIPE_BUFFER_USAGE_PIXEL | + r300transfer->buffer_usage); + + ctx->surface_copy(ctx, dst, 0, 0, src, r300transfer->x, r300transfer->y, + transfer->width, transfer->height); + + pipe_surface_reference(&src, NULL); + pipe_surface_reference(&dst, NULL); +} + +/* Copy a detiled texture to a tiled one. */ +static void r300_copy_into_tiled_texture(struct pipe_context *ctx, + struct r300_transfer *r300transfer) +{ + struct pipe_screen *screen = ctx->screen; + struct pipe_transfer *transfer = (struct pipe_transfer*)r300transfer; + struct pipe_texture *tex = transfer->texture; + struct pipe_surface *src, *dst; + + src = screen->get_tex_surface(screen, &r300transfer->detiled_texture->tex, + 0, 0, 0, + PIPE_BUFFER_USAGE_GPU_READ | + PIPE_BUFFER_USAGE_PIXEL); + + dst = screen->get_tex_surface(screen, tex, r300transfer->face, + r300transfer->level, r300transfer->zslice, + PIPE_BUFFER_USAGE_GPU_WRITE | + PIPE_BUFFER_USAGE_PIXEL); + + ctx->surface_copy(ctx, dst, r300transfer->x, r300transfer->y, src, 0, 0, + transfer->width, transfer->height); + + /* XXX this flush fixes lots of regressions, not sure why */ + ctx->flush(ctx, 0, NULL); + + pipe_surface_reference(&src, NULL); + pipe_surface_reference(&dst, NULL); +} + static struct pipe_transfer* r300_get_tex_transfer(struct pipe_screen *screen, struct pipe_texture *texture, @@ -38,58 +121,139 @@ r300_get_tex_transfer(struct pipe_screen *screen, { struct r300_texture *tex = (struct r300_texture *)texture; struct r300_transfer *trans; - struct r300_screen *rscreen = r300_screen(screen); - unsigned offset; - - offset = r300_texture_get_offset(tex, level, zslice, face); /* in bytes */ + struct r300_screen *r300screen = r300_screen(screen); + struct pipe_texture template; trans = CALLOC_STRUCT(r300_transfer); if (trans) { + /* Initialize the transfer object. */ pipe_texture_reference(&trans->transfer.texture, texture); - trans->transfer.x = x; - trans->transfer.y = y; + trans->transfer.usage = usage; trans->transfer.width = w; trans->transfer.height = h; - trans->transfer.stride = r300_texture_get_stride(rscreen, tex, level); - trans->transfer.usage = usage; - trans->transfer.zslice = zslice; - trans->transfer.face = face; + trans->ctx = r300screen->ctx; + trans->x = x; + trans->y = y; + trans->level = level; + trans->zslice = zslice; + trans->face = face; + + /* If the texture is tiled, we must create a temporary detiled texture + * for this transfer. */ + if (tex->microtile || tex->macrotile) { + trans->buffer_usage = pipe_transfer_buffer_flags(&trans->transfer); + trans->render_target_usage = + util_format_is_depth_or_stencil(texture->format) ? + PIPE_TEXTURE_USAGE_DEPTH_STENCIL : + PIPE_TEXTURE_USAGE_RENDER_TARGET; + + template.target = PIPE_TEXTURE_2D; + template.format = texture->format; + template.width0 = w; + template.height0 = h; + template.depth0 = 0; + template.last_level = 0; + template.nr_samples = 0; + template.tex_usage = PIPE_TEXTURE_USAGE_DYNAMIC | + R300_TEXTURE_USAGE_TRANSFER; - trans->offset = offset; + /* For texture reading, the temporary (detiled) texture is used as + * a render target when blitting from a tiled texture. */ + if (usage & PIPE_TRANSFER_READ) { + template.tex_usage |= trans->render_target_usage; + } + /* For texture writing, the temporary texture is used as a sampler + * when blitting into a tiled texture. */ + if (usage & PIPE_TRANSFER_WRITE) { + template.tex_usage |= PIPE_TEXTURE_USAGE_SAMPLER; + } + + /* Create the temporary texture. */ + trans->detiled_texture = + (struct r300_texture*)screen->texture_create(screen, &template); + assert(!trans->detiled_texture->microtile && + !trans->detiled_texture->macrotile); + + /* Set the stride. + * Parameters x, y, level, zslice, and face remain zero. */ + trans->transfer.stride = + r300_texture_get_stride(r300screen, trans->detiled_texture, 0); + + if (usage & PIPE_TRANSFER_READ) { + /* We cannot map a tiled texture directly because the data is + * in a different order, therefore we do detiling using a blit. */ + r300_copy_from_tiled_texture(r300screen->ctx, trans); + } + } else { + trans->transfer.x = x; + trans->transfer.y = y; + trans->transfer.stride = + r300_texture_get_stride(r300screen, tex, level); + trans->transfer.level = level; + trans->transfer.zslice = zslice; + trans->transfer.face = face; + trans->offset = r300_texture_get_offset(tex, level, zslice, face); + } } return &trans->transfer; } static void r300_tex_transfer_destroy(struct pipe_transfer *trans) { - pipe_texture_reference(&trans->texture, NULL); - FREE(trans); + struct r300_transfer *r300transfer = r300_transfer(trans); + + if (r300transfer->detiled_texture) { + if (trans->usage & PIPE_TRANSFER_WRITE) { + r300_copy_into_tiled_texture(r300transfer->ctx, r300transfer); + } + + pipe_texture_reference( + (struct pipe_texture**)&r300transfer->detiled_texture, NULL); + } + pipe_texture_reference(&trans->texture, NULL); + FREE(trans); } static void* r300_transfer_map(struct pipe_screen *screen, - struct pipe_transfer *transfer) + struct pipe_transfer *transfer) { + struct r300_transfer *r300transfer = r300_transfer(transfer); struct r300_texture *tex = (struct r300_texture*)transfer->texture; char *map; enum pipe_format format = tex->tex.format; - map = pipe_buffer_map(screen, tex->buffer, - pipe_transfer_buffer_flags(transfer)); + if (r300transfer->detiled_texture) { + /* The detiled texture is of the same size as the region being mapped + * (no offset needed). */ + return pipe_buffer_map(screen, + r300transfer->detiled_texture->buffer, + pipe_transfer_buffer_flags(transfer)); + } else { + /* Tiling is disabled. */ + map = pipe_buffer_map(screen, tex->buffer, + pipe_transfer_buffer_flags(transfer)); - if (!map) { - return NULL; - } + if (!map) { + return NULL; + } - return map + r300_transfer(transfer)->offset + - transfer->y / util_format_get_blockheight(format) * transfer->stride + - transfer->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format); + return map + r300_transfer(transfer)->offset + + transfer->y / util_format_get_blockheight(format) * transfer->stride + + transfer->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format); + } } static void r300_transfer_unmap(struct pipe_screen *screen, struct pipe_transfer *transfer) { + struct r300_transfer *r300transfer = r300_transfer(transfer); struct r300_texture *tex = (struct r300_texture*)transfer->texture; - pipe_buffer_unmap(screen, tex->buffer); + + if (r300transfer->detiled_texture) { + pipe_buffer_unmap(screen, r300transfer->detiled_texture->buffer); + } else { + pipe_buffer_unmap(screen, tex->buffer); + } } void r300_init_screen_transfer_functions(struct pipe_screen *screen) diff --git a/src/gallium/drivers/r300/r300_transfer.h b/src/gallium/drivers/r300/r300_transfer.h index faf62338ef..60d1d3dc85 100644 --- a/src/gallium/drivers/r300/r300_transfer.h +++ b/src/gallium/drivers/r300/r300_transfer.h @@ -25,36 +25,7 @@ #define R300_TRANSFER #include "pipe/p_screen.h" -#include "pipe/p_state.h" - -struct r300_texture; -struct r300_screen; - -struct r300_transfer { - /* Parent class */ - struct pipe_transfer transfer; - - /* Parameters of get_tex_transfer. */ - unsigned x, y, level, zslice, face; - - /* Offset from start of buffer. */ - unsigned offset; - - /* Untiled texture. */ - struct r300_texture *untiled_texture; - - /* Transfer and format flags. */ - unsigned buffer_usage, render_target_usage; -}; - -/* Convenience cast wrapper. */ -static INLINE struct r300_transfer* -r300_transfer(struct pipe_transfer* transfer) -{ - return (struct r300_transfer*)transfer; -} void r300_init_screen_transfer_functions(struct pipe_screen *screen); #endif - -- cgit v1.2.3 From b37d63337596aabc543ea7ecfa82f0f9fdbade69 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 14 Feb 2010 04:57:09 +0100 Subject: r300g: enable micro- and macrotiling for all textures and renderbuffers --- src/gallium/drivers/r300/r300_texture.c | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 04e326eb78..0736155d52 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -724,6 +724,42 @@ static void r300_setup_flags(struct r300_texture* tex) !util_is_power_of_two(tex->tex.height0); } +static void r300_setup_tiling(struct pipe_screen *screen, + struct r300_texture *tex) +{ + enum pipe_format format = tex->tex.format; + boolean rv350_mode = r300_screen(screen)->caps->family >= CHIP_FAMILY_RV350; + + if (util_format_is_compressed(format)) { + return; + } + + if (tex->tex.width0 == 1 || + tex->tex.height0 == 1) { + return; + } + + /* Set microtiling. */ + switch (util_format_get_blocksize(format)) { + case 1: + case 4: + tex->microtile = R300_BUFFER_TILED; + break; + + /* XXX Square-tiling doesn't work with kernel older than 2.6.34, + * XXX need to check the DRM version */ + /*case 2: + case 8: + tex->microtile = R300_BUFFER_SQUARETILED; + break;*/ + } + + /* Set macrotiling. */ + if (r300_texture_macro_switch(tex, 0, rv350_mode)) { + tex->macrotile = R300_BUFFER_TILED; + } +} + /* Create a new texture. */ static struct pipe_texture* r300_texture_create(struct pipe_screen* screen, const struct pipe_texture* template) @@ -741,6 +777,9 @@ static struct pipe_texture* r300_texture_create(struct pipe_screen* screen, tex->tex.screen = screen; r300_setup_flags(tex); + if (!(template->tex_usage & R300_TEXTURE_USAGE_TRANSFER)) { + r300_setup_tiling(screen, tex); + } r300_setup_miptree(rscreen, tex); r300_setup_texture_state(rscreen, tex); -- cgit v1.2.3 From 57a1395ec3f8eb01af6cfea3fd6b5903dcc61720 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 19 Feb 2010 03:02:34 +0100 Subject: r300g: disable macrotiling when the texture height is smaller than a macrotile Otherwise incorrect rendering occurs (no idea why). --- src/gallium/drivers/r300/r300_texture.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 0736155d52..c0da339916 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -617,18 +617,23 @@ static unsigned r300_texture_get_tile_size(struct r300_texture* tex, /* Return true if macrotiling should be enabled on the miplevel. */ static boolean r300_texture_macro_switch(struct r300_texture *tex, unsigned level, - boolean rv350_mode) + boolean rv350_mode, + int dim) { - unsigned tile_width, width; + unsigned tile, texdim; - tile_width = r300_texture_get_tile_size(tex, TILE_WIDTH, TRUE); - width = u_minify(tex->tex.width0, level); + tile = r300_texture_get_tile_size(tex, dim, TRUE); + if (dim == TILE_WIDTH) { + texdim = u_minify(tex->tex.width0, level); + } else { + texdim = u_minify(tex->tex.height0, level); + } /* See TX_FILTER1_n.MACRO_SWITCH. */ if (rv350_mode) { - return width >= tile_width; + return texdim >= tile; } else { - return width > tile_width; + return texdim > tile; } } @@ -692,9 +697,10 @@ static void r300_setup_miptree(struct r300_screen* screen, for (i = 0; i <= base->last_level; i++) { /* Let's see if this miplevel can be macrotiled. */ - tex->mip_macrotile[i] = (tex->macrotile == R300_BUFFER_TILED && - r300_texture_macro_switch(tex, i, rv350_mode)) ? - R300_BUFFER_TILED : R300_BUFFER_LINEAR; + tex->mip_macrotile[i] = + (tex->macrotile == R300_BUFFER_TILED && + r300_texture_macro_switch(tex, i, rv350_mode, TILE_WIDTH)) ? + R300_BUFFER_TILED : R300_BUFFER_LINEAR; stride = r300_texture_get_stride(screen, tex, i); nblocksy = r300_texture_get_nblocksy(tex, i); @@ -755,7 +761,8 @@ static void r300_setup_tiling(struct pipe_screen *screen, } /* Set macrotiling. */ - if (r300_texture_macro_switch(tex, 0, rv350_mode)) { + if (r300_texture_macro_switch(tex, 0, rv350_mode, TILE_WIDTH) && + r300_texture_macro_switch(tex, 0, rv350_mode, TILE_HEIGHT)) { tex->macrotile = R300_BUFFER_TILED; } } -- cgit v1.2.3 From 6b39abb63acba34f0f4f017f06b0c90da79e6e70 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 23 Feb 2010 01:14:44 +0100 Subject: r300g: fix DRM errors --- src/gallium/drivers/r300/r300_transfer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c index 56a6976e8b..ec89681a3c 100644 --- a/src/gallium/drivers/r300/r300_transfer.c +++ b/src/gallium/drivers/r300/r300_transfer.c @@ -102,10 +102,15 @@ static void r300_copy_into_tiled_texture(struct pipe_context *ctx, PIPE_BUFFER_USAGE_GPU_WRITE | PIPE_BUFFER_USAGE_PIXEL); + /* XXX this flush prevents the following DRM error from occuring: + * [drm:radeon_cs_ioctl] *ERROR* Failed to parse relocation ! + * Reproducible with perf/copytex. */ + ctx->flush(ctx, 0, NULL); + ctx->surface_copy(ctx, dst, r300transfer->x, r300transfer->y, src, 0, 0, transfer->width, transfer->height); - /* XXX this flush fixes lots of regressions, not sure why */ + /* XXX this flush fixes a few piglit tests (e.g. glean/pixelFormats). */ ctx->flush(ctx, 0, NULL); pipe_surface_reference(&src, NULL); -- cgit v1.2.3 From ba196a8318af6217fece3777ea038539fea4b415 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 15:00:29 +0100 Subject: radeon: handle compressed sRGB texture formats --- src/mesa/drivers/dri/radeon/radeon_texture.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 6a8e70d47e..3ccc711253 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -558,6 +558,15 @@ gl_format radeonChooseTextureFormat(GLcontext * ctx, case GL_COMPRESSED_SLUMINANCE_ALPHA: return MESA_FORMAT_SLA8; + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: + return MESA_FORMAT_SRGB_DXT1; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: + return MESA_FORMAT_SRGBA_DXT1; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: + return MESA_FORMAT_SRGBA_DXT3; + case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: + return MESA_FORMAT_SRGBA_DXT5; + default: _mesa_problem(ctx, "unexpected internalFormat 0x%x in %s", -- cgit v1.2.3 From 5befb6f810fb88ed1e51ec26b79b647cd15b1433 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 7 Mar 2010 14:20:31 +0100 Subject: dri/nouveau: Check _ColorDrawBuffers[0] before emitting fb state. --- src/mesa/drivers/dri/nouveau/nv04_state_fb.c | 2 +- src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 2 +- src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c index aad1e491d2..5e5e0c5874 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c @@ -63,7 +63,7 @@ nv04_emit_framebuffer(GLcontext *ctx, int emit) return; /* Render target */ - if (fb->_NumColorDrawBuffers) { + if (fb->_ColorDrawBuffers[0]) { s = &to_nouveau_renderbuffer( fb->_ColorDrawBuffers[0])->surface; diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c index 05c36b4f8f..6bd383ebcd 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c @@ -111,7 +111,7 @@ nv10_emit_framebuffer(GLcontext *ctx, int emit) } /* Render target */ - if (fb->_NumColorDrawBuffers) { + if (fb->_ColorDrawBuffers[0]) { s = &to_nouveau_renderbuffer( fb->_ColorDrawBuffers[0])->surface; diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c index 869acd6e31..d638541df9 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c @@ -67,7 +67,7 @@ nv20_emit_framebuffer(GLcontext *ctx, int emit) return; /* Render target */ - if (fb->_NumColorDrawBuffers) { + if (fb->_ColorDrawBuffers[0]) { s = &to_nouveau_renderbuffer( fb->_ColorDrawBuffers[0])->surface; -- cgit v1.2.3 From e64680bc1e36699096af5ade876b6cb0f5791ad0 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Tue, 2 Mar 2010 01:29:14 +0000 Subject: dri/nouveau: Trivially add GL_NV_blend_square Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 52185a2fb9..e26ed36529 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -56,6 +56,7 @@ static const struct dri_extension nouveau_extensions[] = { { "GL_ARB_texture_mirrored_repeat", NULL }, { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, + { "GL_NV_blend_square", NULL }, { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } }; -- cgit v1.2.3 From 6a15edfed326a06f08ac63020dc9472e45d8a9e1 Mon Sep 17 00:00:00 2001 From: Andrew Randrianasulu Date: Sun, 7 Mar 2010 01:09:21 +0000 Subject: dri/nv04: GL_EXT_secondary_color Signed-off-by: Francisco Jerez --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 10 ++++++---- src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index e26ed36529..502e01255c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -43,19 +43,21 @@ #define need_GL_EXT_framebuffer_object #define need_GL_EXT_fog_coord +#define need_GL_EXT_secondary_color #include "main/remap_helper.h" static const struct dri_extension nouveau_extensions[] = { { "GL_ARB_multitexture", NULL }, + { "GL_ARB_texture_env_add", NULL }, { "GL_ARB_texture_env_combine", NULL }, { "GL_ARB_texture_env_dot3", NULL }, - { "GL_ARB_texture_env_add", NULL }, - { "GL_EXT_texture_lod_bias", NULL }, - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, - { "GL_EXT_stencil_wrap", NULL }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, + { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, + { "GL_EXT_secondary_color", GL_EXT_secondary_color_functions }, + { "GL_EXT_stencil_wrap", NULL }, + { "GL_EXT_texture_lod_bias", NULL }, { "GL_NV_blend_square", NULL }, { "GL_SGIS_generate_mipmap", NULL }, { NULL, NULL } diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c index 4314fc33cf..c191571a5f 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c @@ -275,6 +275,10 @@ nv04_emit_blend(GLcontext *ctx, int emit) else blend |= NV04_MULTITEX_TRIANGLE_BLEND_SHADE_MODE_FLAT; + /* Secondary color */ + if (NEED_SECONDARY_COLOR(ctx)) + blend |= NV04_MULTITEX_TRIANGLE_BLEND_SPECULAR_ENABLE; + /* Fog. */ if (ctx->Fog.Enabled) blend |= NV04_MULTITEX_TRIANGLE_BLEND_FOG_ENABLE; @@ -309,6 +313,10 @@ nv04_emit_blend(GLcontext *ctx, int emit) else blend |= get_texenv_mode(GL_MODULATE); + /* Secondary color */ + if (NEED_SECONDARY_COLOR(ctx)) + blend |= NV04_TEXTURED_TRIANGLE_BLEND_SPECULAR_ENABLE; + /* Fog. */ if (ctx->Fog.Enabled) blend |= NV04_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE; -- cgit v1.2.3 From 75f52d1e5210944d7e92787c637285fd83533053 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 7 Mar 2010 18:40:21 +0100 Subject: dri/nouveau: Fix nv[12]x color sum. --- src/mesa/drivers/dri/nouveau/nouveau_state.c | 1 + src/mesa/drivers/dri/nouveau/nv10_state_tnl.c | 6 ++++-- src/mesa/drivers/dri/nouveau/nv20_state_tnl.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c index e1871db0eb..bc610451b4 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_state.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c @@ -150,6 +150,7 @@ nouveau_enable(GLcontext *ctx, GLenum cap, GLboolean state) break; case GL_COLOR_SUM_EXT: context_dirty(ctx, FRAG); + context_dirty(ctx, LIGHT_MODEL); break; case GL_CULL_FACE: context_dirty(ctx, CULL_FACE); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c index 6db14d83b8..406e24c455 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c @@ -201,8 +201,10 @@ nv10_emit_light_model(GLcontext *ctx, int emit) BEGIN_RING(chan, celsius, NV10TCL_LIGHT_MODEL, 1); OUT_RING(chan, ((m->LocalViewer ? NV10TCL_LIGHT_MODEL_LOCAL_VIEWER : 0) | - (m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ? - NV10TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0))); + (NEED_SECONDARY_COLOR(ctx) ? + NV10TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0) | + (!ctx->Light.Enabled && ctx->Fog.ColorSumEnabled ? + NV10TCL_LIGHT_MODEL_VERTEX_SPECULAR : 0))); } static float diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c index 0d566064f6..43f8c72312 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c @@ -158,7 +158,7 @@ nv20_emit_light_model(GLcontext *ctx, int emit) OUT_RING(chan, ((m->LocalViewer ? NV20TCL_LIGHT_MODEL_VIEWER_LOCAL : NV20TCL_LIGHT_MODEL_VIEWER_NONLOCAL) | - (m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ? + (NEED_SECONDARY_COLOR(ctx) ? NV20TCL_LIGHT_MODEL_SEPARATE_SPECULAR : 0))); -- cgit v1.2.3 From ea027bda8e4a7cdd8f131e01ab4ff80d6c6a3ab7 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 7 Mar 2010 19:12:27 +0100 Subject: dri/nouveau: Split big client buffers in the indexed case too. --- src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c index 69a9b96f0c..a365b977f2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c @@ -281,14 +281,13 @@ vbo_maybe_split(GLcontext *ctx, const struct gl_client_array **arrays, int stride; /* Try to keep client buffers smaller than the scratch BOs. */ - if (!ib && render->mode == VBO && + if (render->mode == VBO && (stride = get_max_client_stride(ctx))) vert_avail = MIN2(vert_avail, RENDER_SCRATCH_SIZE / stride); - - if ((ib && ib->count > idx_avail) || - (!ib && max_index - min_index > vert_avail)) { + if (max_index - min_index > vert_avail || + (ib && ib->count > idx_avail)) { struct split_limits limits = { .max_verts = vert_avail, .max_indices = idx_avail, -- cgit v1.2.3 From ee6fbf8d2f4718452c36366a08aa798cdda45ace Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 3 Mar 2010 23:51:13 +0800 Subject: st/vega: Fix OpenVG demo segfaults. When the paint is color, paint_bind_samplers binds a dummy sampler without a texture. It causes demos requiring a sampler (those use a mask or an image) to crash. --- src/gallium/state_trackers/vega/paint.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c index caf0c14b74..cdb87d3bf6 100644 --- a/src/gallium/state_trackers/vega/paint.c +++ b/src/gallium/state_trackers/vega/paint.c @@ -639,9 +639,6 @@ VGint paint_bind_samplers(struct vg_paint *paint, struct pipe_sampler_state **sa } break; default: - samplers[0] = &paint->pattern.sampler; /* dummy */ - textures[0] = 0; - return 0; break; } return 0; -- cgit v1.2.3 From 6abe6145fb3b642fc2ae1d6ad2cc9de045efe0cb Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 8 Mar 2010 04:31:03 +0100 Subject: r300g: remove unnecessary state emissions and clean up --- src/gallium/drivers/r300/r300_context.h | 2 ++ src/gallium/drivers/r300/r300_emit.c | 2 +- src/gallium/drivers/r300/r300_state.c | 37 ++++++++++++++++++++------------- 3 files changed, 26 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 0d1518a05b..8c52d880a3 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -368,6 +368,8 @@ struct r300_context { boolean polygon_offset_enabled; /* Z buffer bit depth. */ uint32_t zbuffer_bpp; + /* Whether scissor is enabled. */ + boolean scissor_enabled; }; /* Convenience cast wrapper. */ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index a1d31d57b8..51fc590e5d 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -675,7 +675,7 @@ void r300_emit_scissor_state(struct r300_context* r300, maxx = fb->width; maxy = fb->height; - if (((struct r300_rs_state*)r300->rs_state.state)->rs.scissor) { + if (r300->scissor_enabled) { minx = MAX2(minx, scissor->minx); miny = MAX2(miny, scissor->miny); maxx = MIN2(maxx, scissor->maxx); diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index de3ee0eefb..31259b557f 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -571,6 +571,7 @@ static void { struct r300_context* r300 = r300_context(pipe); struct r300_screen* r300screen = r300_screen(pipe->screen); + struct pipe_framebuffer_state *old_state = r300->fb_state.state; unsigned max_width, max_height; uint32_t zbuffer_bpp = 0; @@ -595,11 +596,24 @@ static void return; } - if (r300->draw) { draw_flush(r300->draw); } + r300->fb_state.dirty = TRUE; + + /* If nr_cbufs is changed from zero to non-zero or vice versa... */ + if (!!old_state->nr_cbufs != !!state->nr_cbufs) { + r300->blend_state.dirty = TRUE; + } + /* If zsbuf is set from NULL to non-NULL or vice versa.. */ + if (!!old_state->zsbuf != !!state->zsbuf) { + r300->dsa_state.dirty = TRUE; + } + if (!r300->scissor_enabled) { + r300->scissor_state.dirty = TRUE; + } + memcpy(r300->fb_state.state, state, sizeof(struct pipe_framebuffer_state)); r300->fb_state.size = (10 * state->nr_cbufs) + (2 * (4 - state->nr_cbufs)) + @@ -607,11 +621,6 @@ static void r300_fb_update_tiling_flags(r300, r300->fb_state.state, state); - /* XXX wait what */ - r300->blend_state.dirty = TRUE; - r300->dsa_state.dirty = TRUE; - r300->fb_state.dirty = TRUE; - r300->scissor_state.dirty = TRUE; /* Polygon offset depends on the zbuffer bit depth. */ if (state->zsbuf && r300->polygon_offset_enabled) { @@ -806,6 +815,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) { struct r300_context* r300 = r300_context(pipe); struct r300_rs_state* rs = (struct r300_rs_state*)state; + boolean scissor_was_enabled = r300->scissor_enabled; if (r300->draw) { draw_flush(r300->draw); @@ -814,20 +824,17 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) if (rs) { r300->polygon_offset_enabled = rs->rs.offset_cw || rs->rs.offset_ccw; + r300->scissor_enabled = rs->rs.scissor; } else { r300->polygon_offset_enabled = FALSE; + r300->scissor_enabled = FALSE; } UPDATE_STATE(state, r300->rs_state); r300->rs_state.size = 17 + (r300->polygon_offset_enabled ? 5 : 0); - /* XXX Why is this still needed, dammit!? */ - r300->scissor_state.dirty = TRUE; - r300->viewport_state.dirty = TRUE; - - /* XXX Clean these up when we move to atom emits */ - if (r300->fs && r300->fs->inputs.wpos != ATTR_UNUSED) { - r300->dirty_state |= R300_NEW_FRAGMENT_SHADER_CONSTANTS; + if (scissor_was_enabled != r300->scissor_enabled) { + r300->scissor_state.dirty = TRUE; } } @@ -972,7 +979,9 @@ static void r300_set_scissor_state(struct pipe_context* pipe, memcpy(r300->scissor_state.state, state, sizeof(struct pipe_scissor_state)); - r300->scissor_state.dirty = TRUE; + if (r300->scissor_enabled) { + r300->scissor_state.dirty = TRUE; + } } static void r300_set_viewport_state(struct pipe_context* pipe, -- cgit v1.2.3 From 9860f652e271d03672ec3e5f0e379170953a1e56 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 8 Mar 2010 04:38:16 +0100 Subject: r300g: fix updating the tiling flags for the framebuffer state --- src/gallium/drivers/r300/r300_state.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 31259b557f..8c9f604622 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -614,14 +614,13 @@ static void r300->scissor_state.dirty = TRUE; } + r300_fb_update_tiling_flags(r300, r300->fb_state.state, state); + memcpy(r300->fb_state.state, state, sizeof(struct pipe_framebuffer_state)); r300->fb_state.size = (10 * state->nr_cbufs) + (2 * (4 - state->nr_cbufs)) + (state->zsbuf ? 10 : 0) + 8; - r300_fb_update_tiling_flags(r300, r300->fb_state.state, state); - - /* Polygon offset depends on the zbuffer bit depth. */ if (state->zsbuf && r300->polygon_offset_enabled) { switch (util_format_get_blocksize(state->zsbuf->texture->format)) { -- cgit v1.2.3 From 97d40edb07aa6c67d21eb831898ac5387c18fdbc Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 09:57:26 -0500 Subject: r600: no need to flush on context init --- src/mesa/drivers/dri/r600/r700_state.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 4ebdbbfad2..3e10e5b37a 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1626,8 +1626,6 @@ void r700InitState(GLcontext * ctx) //------------------- R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); int id = 0; - radeon_firevertices(&context->radeon); - r700->TA_CNTL_AUX.u32All = 0; SETfield(r700->TA_CNTL_AUX.u32All, 28, TD_FIFO_CREDIT_shift, TD_FIFO_CREDIT_mask); r700->VC_ENHANCE.u32All = 0; -- cgit v1.2.3 From cbe28cb892e3b451d2d2cf6769ef7ef131f1853b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 10:00:59 -0500 Subject: r600: recalculate point size, if point min/max size changes --- src/mesa/drivers/dri/r600/r700_state.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 3e10e5b37a..6f156b5409 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -911,10 +911,12 @@ static void r700PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * pa case GL_POINT_SIZE_MIN: SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MinSize * 8.0), MIN_SIZE_shift, MIN_SIZE_mask); + r700PointSize(ctx, ctx->Point.Size); break; case GL_POINT_SIZE_MAX: SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MaxSize * 8.0), MAX_SIZE_shift, MAX_SIZE_mask); + r700PointSize(ctx, ctx->Point.Size); break; case GL_POINT_DISTANCE_ATTENUATION: break; -- cgit v1.2.3 From 7959274858fe66a90e6f97fed81141c39cb6702b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 10:04:02 -0500 Subject: radeon/r200/r600: reset bos when validating buffers during blit --- src/mesa/drivers/dri/r200/r200_blit.c | 3 +++ src/mesa/drivers/dri/r600/r600_blit.c | 2 ++ src/mesa/drivers/dri/radeon/radeon_blit.c | 3 +++ 3 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c index b56327dad5..2c8b3aafe5 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.c +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -211,6 +211,9 @@ static GLboolean validate_buffers(struct r200_context *r200, struct radeon_bo *dst_bo) { int ret; + + radeon_cs_space_reset_bos(r200->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index 9d17463cae..fb84825761 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -1533,6 +1533,8 @@ static GLboolean validate_buffers(context_t *rmesa, { int ret; + radeon_cs_space_reset_bos(rmesa->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index e188a122d5..8c3c2e4766 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -204,6 +204,9 @@ static GLboolean validate_buffers(struct r100_context *r100, struct radeon_bo *dst_bo) { int ret; + + radeon_cs_space_reset_bos(r100->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) -- cgit v1.2.3 From 39ab5ae30c303dd561252cb592d4de35814b6a70 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 10:13:49 -0500 Subject: radeon/r200/r600: allow src and dst BOs to be placed in GTT during blit --- src/mesa/drivers/dri/r200/r200_blit.c | 10 ++-------- src/mesa/drivers/dri/r600/r600_blit.c | 10 ++-------- src/mesa/drivers/dri/radeon/radeon_blit.c | 10 ++-------- 3 files changed, 6 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c index 2c8b3aafe5..3075760093 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.c +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -215,18 +215,12 @@ static GLboolean validate_buffers(struct r200_context *r200, radeon_cs_space_reset_bos(r200->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); - if (ret) - return GL_FALSE; - - ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, - first_elem(&r200->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index fb84825761..244fdc4ffb 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -1536,12 +1536,12 @@ static GLboolean validate_buffers(context_t *rmesa, radeon_cs_space_reset_bos(rmesa->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; @@ -1551,12 +1551,6 @@ static GLboolean validate_buffers(context_t *rmesa, if (ret) return GL_FALSE; - ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, - first_elem(&rmesa->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); - if (ret) - return GL_FALSE; - return GL_TRUE; } diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index 8c3c2e4766..e1e1f21550 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -208,18 +208,12 @@ static GLboolean validate_buffers(struct r100_context *r100, radeon_cs_space_reset_bos(r100->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); - if (ret) - return GL_FALSE; - - ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, - first_elem(&r100->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; -- cgit v1.2.3 From 614f490ca918f891cd70674ea7841d5b2a97e9ef Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 09:34:46 -0700 Subject: mesa: s/GL_DEPTH_STENCIL/GL_DEPTH_COMPONENT/ for MESA_FORMAT_Z16 renderbuffer MESA_FORMAT_Z16 has no stencil bits. --- src/mesa/main/texrender.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 5a528535c0..b7b23ade30 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -500,7 +500,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) { trb->Base.Format = MESA_FORMAT_Z16; trb->Base.DataType = GL_UNSIGNED_SHORT; - trb->Base._BaseFormat = GL_DEPTH_STENCIL; + trb->Base._BaseFormat = GL_DEPTH_COMPONENT; } else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) { trb->Base.Format = MESA_FORMAT_Z32; -- cgit v1.2.3 From 9b7c332d5f099fcf090bee9dbda9c73d7912b211 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 13:35:23 +0000 Subject: winsys/xlib: sketch of cell support --- src/gallium/winsys/xlib/xlib_cell.c | 268 +++--------------------------------- 1 file changed, 20 insertions(+), 248 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index 1dc9e8fa11..ce4efe8851 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -32,98 +32,19 @@ * Brian Paul */ -#include "xlib.h" - -#ifdef GALLIUM_CELL - -#include "xm_api.h" - -#undef ASSERT -#undef Elements - -#include "util/u_simple_screen.h" -#include "pipe/p_format.h" -#include "pipe/p_context.h" -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_memory.h" - -#include "cell/ppu/cell_context.h" -#include "cell/ppu/cell_screen.h" -#include "cell/ppu/cell_winsys.h" -#include "cell/ppu/cell_texture.h" - - -/** - * Subclass of pipe_buffer for Xlib winsys. - * Low-level OS/window system memory buffer - */ -struct xm_buffer -{ - struct pipe_buffer base; - boolean userBuffer; /** Is this a user-space buffer? */ - void *data; - void *mapped; - - XImage *tempImage; - int shm; -}; -/** - * Subclass of pipe_winsys for Xlib winsys - */ -struct xmesa_pipe_winsys -{ - struct pipe_winsys base; -}; - - - -/** Cast wrapper */ -static INLINE struct xm_buffer * -xm_buffer( struct pipe_buffer *buf ) -{ - return (struct xm_buffer *)buf; -} +#include "xlib.h" -/* Most callbacks map direcly onto dri_bufmgr operations: - */ -static void * -xm_buffer_map(struct pipe_winsys *pws, struct pipe_buffer *buf, - unsigned flags) -{ - struct xm_buffer *xm_buf = xm_buffer(buf); - xm_buf->mapped = xm_buf->data; - return xm_buf->mapped; -} - -static void -xm_buffer_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf) -{ - struct xm_buffer *xm_buf = xm_buffer(buf); - xm_buf->mapped = NULL; -} -static void -xm_buffer_destroy(/*struct pipe_winsys *pws,*/ - struct pipe_buffer *buf) -{ - struct xm_buffer *oldBuf = xm_buffer(buf); +#if defined(GALLIUM_CELL) - if (oldBuf) { - if (oldBuf->data) { - if (!oldBuf->userBuffer) { - align_free(oldBuf->data); - } +#include "cell/ppu/cell_texture.h" +#include "cell/ppu/cell_screen.h" +#include "state_tracker/sw_winsys.h" +#include "util/u_debug.h" - oldBuf->data = NULL; - } - free(oldBuf); - } -} /** @@ -155,15 +76,16 @@ twiddle_tile(const uint *tileIn, uint *tileOut) } } - - /** * Display a surface that's in a tiled configuration. That is, all the * pixels for a TILE_SIZExTILE_SIZE block are contiguous in memory. */ static void -xlib_cell_display_surface(struct xmesa_buffer *b, struct pipe_surface *surf) +xm_displaytarget_display(struct sw_winsys *ws, + struct sw_displaytarget *dt, + void *winsys_drawable) { + struct xmesa_buffer *xm_buffer = (struct xm_drawable *)winsys_drawable; XImage *ximage; struct xm_buffer *xm_buf = xm_buffer( cell_texture(surf->texture)->buffer); @@ -210,165 +132,21 @@ xlib_cell_display_surface(struct xmesa_buffer *b, struct pipe_surface *surf) - - -static void -xm_flush_frontbuffer(struct pipe_winsys *pws, - struct pipe_surface *surf, - void *context_private) -{ - /* - * The front color buffer is actually just another XImage buffer. - * This function copies that XImage to the actual X Window. - */ - XMesaContext xmctx = (XMesaContext) context_private; - if (xmctx) - xlib_cell_display_surface(xmctx->xm_buffer, surf); -} - - - -static const char * -xm_get_name(struct pipe_winsys *pws) -{ - return "Xlib/Cell"; -} - - -static struct pipe_buffer * -xm_buffer_create(struct pipe_winsys *pws, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer); - - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.alignment = alignment; - buffer->base.usage = usage; - buffer->base.size = size; - - - if (buffer->data == NULL) { - buffer->shm = 0; - - /* align to 16-byte multiple for Cell */ - buffer->data = align_malloc(size, max(alignment, 16)); - } - - return &buffer->base; -} - - -/** - * Create buffer which wraps user-space data. - */ -static struct pipe_buffer * -xm_user_buffer_create(struct pipe_winsys *pws, void *ptr, unsigned bytes) -{ - struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer); - pipe_reference_init(&buffer->base.reference, 1); - buffer->base.size = bytes; - buffer->userBuffer = TRUE; - buffer->data = ptr; - buffer->shm = 0; - - return &buffer->base; -} - - - -static struct pipe_buffer * -xm_surface_buffer_create(struct pipe_winsys *winsys, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride) -{ - const unsigned alignment = 64; - unsigned nblocksy; - - nblocksy = util_format_get_nblocksy(format, height); - *stride = align(util_format_get_stride(format, width), alignment); - - return winsys->buffer_create(winsys, alignment, - usage, - /* XXX a bit of a hack */ - *stride * align(nblocksy, TILE_SIZE)); -} - - -/* - * Fence functions - basically nothing to do, as we don't create any actual - * fence objects. - */ - -static void -xm_fence_reference(struct pipe_winsys *sws, struct pipe_fence_handle **ptr, - struct pipe_fence_handle *fence) -{ -} - - -static int -xm_fence_signalled(struct pipe_winsys *sws, struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - -static int -xm_fence_finish(struct pipe_winsys *sws, struct pipe_fence_handle *fence, - unsigned flag) -{ - return 0; -} - - - -static struct pipe_winsys * -xlib_create_cell_winsys( void ) -{ - static struct xmesa_pipe_winsys *ws = NULL; - - if (!ws) { - ws = CALLOC_STRUCT(xmesa_pipe_winsys); - - /* Fill in this struct with callbacks that pipe will need to - * communicate with the window system, buffer manager, etc. - */ - ws->base.buffer_create = xm_buffer_create; - ws->base.user_buffer_create = xm_user_buffer_create; - ws->base.buffer_map = xm_buffer_map; - ws->base.buffer_unmap = xm_buffer_unmap; - ws->base.buffer_destroy = xm_buffer_destroy; - - ws->base.surface_buffer_create = xm_surface_buffer_create; - - ws->base.fence_reference = xm_fence_reference; - ws->base.fence_signalled = xm_fence_signalled; - ws->base.fence_finish = xm_fence_finish; - - ws->base.flush_frontbuffer = xm_flush_frontbuffer; - ws->base.get_name = xm_get_name; - } - - return &ws->base; -} - - static struct pipe_screen * -xlib_create_cell_screen( void ) +xlib_create_cell_screen( Display *dpy ) { - struct pipe_winsys *winsys; + struct sw_winsys *winsys; struct pipe_screen *screen; - winsys = xlib_create_cell_winsys(); + winsys = xlib_create_sw_winsys( dpy ); if (winsys == NULL) return NULL; + /* Plug in a little cell-specific code: + */ + + ws->base.displaytarget_display = xm_cell_displaytarget_display; + screen = cell_create_screen(winsys); if (screen == NULL) goto fail; @@ -384,18 +162,12 @@ fail: + struct xm_driver xlib_cell_driver = { .create_pipe_screen = xlib_create_cell_screen, - .display_surface = xlib_cell_display_surface, }; -#else -struct xm_driver xlib_cell_driver = -{ - .create_pipe_screen = NULL, - .display_surface = NULL, -}; -#endif +#endif /* GALLIUM_CELL */ -- cgit v1.2.3 From 7f9a3959b0a69f6f4b520a87e3ea87918cf89f11 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 15:35:51 +0000 Subject: ws/xlib: remove redundant declarations --- src/gallium/winsys/xlib/xlib.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/xlib/xlib.h b/src/gallium/winsys/xlib/xlib.h index 7f9f910b88..8e091d0c08 100644 --- a/src/gallium/winsys/xlib/xlib.h +++ b/src/gallium/winsys/xlib/xlib.h @@ -9,12 +9,5 @@ extern struct xm_driver xlib_softpipe_driver; extern struct xm_driver xlib_llvmpipe_driver; extern struct xm_driver xlib_cell_driver; -/* Internal: - */ -struct sw_winsys; -struct sw_displaytarget; -struct sw_winsys *xlib_create_sw_winsys( void ); -void xlib_sw_display(struct xmesa_buffer *xm_buffer, - struct sw_displaytarget *dt); #endif -- cgit v1.2.3 From 1675d05f911fbd569efb5248674aa71cb755c75b Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 16:20:09 +0000 Subject: winsys/xlib: remove dependency on glx/x11 state tracker Introduce xlib_drawable struct, pass this down to winsys instead of having it use the internal data structures from glx/x11 --- src/gallium/include/state_tracker/xlib_sw_winsys.h | 25 ++++++ src/gallium/state_trackers/glx/xlib/glx_api.c | 2 +- src/gallium/state_trackers/glx/xlib/xm_api.c | 91 ++++------------------ src/gallium/state_trackers/glx/xlib/xm_api.h | 18 +---- src/gallium/state_trackers/glx/xlib/xm_winsys.h | 7 +- src/gallium/winsys/xlib/xlib_llvmpipe.c | 8 +- src/gallium/winsys/xlib/xlib_softpipe.c | 4 +- src/gallium/winsys/xlib/xlib_sw_winsys.c | 81 +++++++++++-------- 8 files changed, 103 insertions(+), 133 deletions(-) create mode 100644 src/gallium/include/state_tracker/xlib_sw_winsys.h (limited to 'src') diff --git a/src/gallium/include/state_tracker/xlib_sw_winsys.h b/src/gallium/include/state_tracker/xlib_sw_winsys.h new file mode 100644 index 0000000000..71d39b9cdb --- /dev/null +++ b/src/gallium/include/state_tracker/xlib_sw_winsys.h @@ -0,0 +1,25 @@ +#ifndef XLIB_SW_WINSYS_H +#define XLIB_SW_WINSYS_H + +#include "state_tracker/sw_winsys.h" +#include + +struct sw_winsys *xlib_create_sw_winsys( Display *display ); + +/* This is what the xlib software winsys expects to find in the + * "private" field of flush_frontbuffers(). Xlib-based state trackers + * somehow need to know this. + */ +struct xlib_drawable { + Visual *visual; + int depth; + Drawable drawable; + GC gc; /* temporary? */ +}; + +void +xlib_sw_display(struct xlib_drawable *xm_buffer, + struct sw_displaytarget *dt); + + +#endif diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index 08bf624b5c..2454585850 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -689,7 +689,7 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) int desiredVisualID = -1; int numAux = 0; - xmesa_init(); + xmesa_init( dpy ); parselist = list; diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 217bdeff75..d878740ab1 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -35,10 +35,6 @@ * corner of the window. Therefore, most drawing functions in this * file have to flip Y coordinates. * - * Define USE_XSHM in the Makefile with -DUSE_XSHM if you want to compile - * in support for the MIT Shared Memory extension. If enabled, when you - * use an Ximage for the back buffer in double buffered mode, the "swap" - * operation will be faster. You must also link with -lXext. * * Byte swapping: If the Mesa host and the X display use a different * byte order then there's some trickiness to be aware of when using @@ -111,41 +107,6 @@ static int host_byte_order( void ) } -/** - * Check if the X Shared Memory extension is available. - * Return: 0 = not available - * 1 = shared XImage support available - * 2 = shared Pixmap support available also - */ -int xmesa_check_for_xshm( Display *display ) -{ -#if defined(USE_XSHM) - int major, minor, ignore; - Bool pixmaps; - - if (getenv("SP_NO_RAST")) - return 0; - - if (getenv("MESA_NOSHM")) { - return 0; - } - - if (XQueryExtension( display, "MIT-SHM", &ignore, &ignore, &ignore )) { - if (XShmQueryVersion( display, &major, &minor, &pixmaps )==True) { - return (pixmaps==True) ? 2 : 1; - } - else { - return 0; - } - } - else { - return 0; - } -#else - /* No XSHM support */ - return 0; -#endif -} /** @@ -242,7 +203,7 @@ xmesa_get_window_size(Display *dpy, XMesaBuffer b, pipe_mutex_lock(_xmesa_lock); XSync(b->xm_visual->display, 0); /* added for Chromium */ - stat = get_drawable_size(dpy, b->drawable, width, height); + stat = get_drawable_size(dpy, b->ws.drawable, width, height); pipe_mutex_unlock(_xmesa_lock); if (!stat) { @@ -397,7 +358,9 @@ create_xmesa_buffer(Drawable d, BufferType type, if (!b) return NULL; - b->drawable = d; + b->ws.drawable = d; + b->ws.visual = vis->visinfo->visual; + b->ws.depth = vis->visinfo->depth; b->xm_visual = vis; b->type = type; @@ -422,18 +385,6 @@ create_xmesa_buffer(Drawable d, BufferType type, (void *) b); fb = &b->stfb->Base; - /* - * Create scratch XImage for xmesa_display_surface() - */ - b->tempImage = XCreateImage(vis->display, - vis->visinfo->visual, - vis->visinfo->depth, - ZPixmap, 0, /* format, offset */ - NULL, /* data */ - 0, 0, /* size */ - 32, /* bitmap_pad */ - 0); /* bytes_per_line */ - /* GLX_EXT_texture_from_pixmap */ b->TextureTarget = 0; b->TextureFormat = GLX_TEXTURE_FORMAT_NONE_EXT; @@ -490,15 +441,12 @@ xmesa_free_buffer(XMesaBuffer buffer) /* Since the X window for the XMesaBuffer is going away, we don't * want to dereference this pointer in the future. */ - b->drawable = 0; - - buffer->tempImage->data = NULL; - XDestroyImage(buffer->tempImage); + b->ws.drawable = 0; /* Unreference. If count = zero we'll really delete the buffer */ _mesa_reference_framebuffer(&fb, NULL); - XFreeGC(b->xm_visual->display, b->gc); + XFreeGC(b->xm_visual->display, b->ws.gc); free(buffer); @@ -578,17 +526,12 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, if (b && window) { /* these should have been set in create_xmesa_buffer */ - ASSERT(b->drawable == window); + ASSERT(b->ws.drawable == window); - /* Setup for single/double buffering */ - if (v->mesa_visual.doubleBufferMode) { - /* Double buffered */ - b->shm = xmesa_check_for_xshm( v->display ); - } /* X11 graphics context */ - b->gc = XCreateGC( v->display, window, 0, NULL ); - XSetFunction( v->display, b->gc, GXcopy ); + b->ws.gc = XCreateGC( v->display, window, 0, NULL ); + XSetFunction( v->display, b->ws.gc, GXcopy ); } return GL_TRUE; @@ -673,7 +616,7 @@ XMesaVisual XMesaCreateVisual( Display *display, XMesaVisual v; GLint red_bits, green_bits, blue_bits, alpha_bits; - xmesa_init(); + xmesa_init( display ); /* For debugging only */ if (_mesa_getenv("MESA_XSYNC")) { @@ -773,12 +716,12 @@ void XMesaDestroyVisual( XMesaVisual v ) * Do one-time initializations. */ void -xmesa_init(void) +xmesa_init( Display *display ) { static GLboolean firstTime = GL_TRUE; if (firstTime) { pipe_mutex_init(_xmesa_lock); - _screen = driver.create_pipe_screen(); + _screen = driver.create_pipe_screen( display ); screen = trace_screen_create( _screen ); firstTime = GL_FALSE; } @@ -800,7 +743,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) GLcontext *mesaCtx; uint pf; - xmesa_init(); + xmesa_init( v->display ); /* Note: the XMesaContext contains a Mesa GLcontext struct (inheritance) */ c = (XMesaContext) CALLOC_STRUCT(xmesa_context); @@ -1155,7 +1098,7 @@ void XMesaSwapBuffers( XMesaBuffer b ) frontLeftSurf = surf; } - driver.display_surface(b, frontLeftSurf); + driver.display_surface(&b->ws, frontLeftSurf); } xmesa_check_and_update_buffer_size(NULL, b); @@ -1203,7 +1146,7 @@ XMesaBuffer XMesaFindBuffer( Display *dpy, Drawable d ) { XMesaBuffer b; for (b = XMesaBufferList; b; b = b->Next) { - if (b->drawable == d && b->xm_visual->display == dpy) { + if (b->ws.drawable == d && b->xm_visual->display == dpy) { return b; } } @@ -1237,10 +1180,10 @@ void XMesaGarbageCollect( void ) next = b->Next; if (b->xm_visual && b->xm_visual->display && - b->drawable && + b->ws.drawable && b->type == WINDOW) { XSync(b->xm_visual->display, False); - if (!window_exists( b->xm_visual->display, b->drawable )) { + if (!window_exists( b->xm_visual->display, b->ws.drawable )) { /* found a dead window, free the ancillary info */ XMesaDestroyBuffer( b ); } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.h b/src/gallium/state_trackers/glx/xlib/xm_api.h index 004cb260dc..de47064b41 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.h +++ b/src/gallium/state_trackers/glx/xlib/xm_api.h @@ -62,15 +62,11 @@ and create a window, you must do the following to use the X/Mesa interface: #include "state_tracker/st_public.h" #include "os/os_thread.h" +#include "state_tracker/xlib_sw_winsys.h" # include # include # include -# ifdef USE_XSHM /* was SHM */ -# include -# include -# include -# endif typedef struct xmesa_buffer *XMesaBuffer; typedef struct xmesa_context *XMesaContext; @@ -316,6 +312,7 @@ typedef enum { */ struct xmesa_buffer { struct st_framebuffer *stfb; + struct xlib_drawable ws; GLboolean wasCurrent; /* was ever the current buffer? */ XMesaVisual xm_visual; /* the X/Mesa visual */ @@ -329,13 +326,6 @@ struct xmesa_buffer { XImage *tempImage; unsigned long selectedEvents;/* for pbuffers only */ - GLuint shm; /* X Shared Memory extension status: */ - /* 0 = not available */ - /* 1 = XImage support available */ - /* 2 = Pixmap support available too */ -#if defined(USE_XSHM) - XShmSegmentInfo shminfo; -#endif GC gc; /* scratch GC for span, line, tri drawing */ @@ -367,7 +357,7 @@ xmesa_buffer(GLframebuffer *fb) extern void -xmesa_init(void); +xmesa_init(Display *dpy); extern void xmesa_delete_framebuffer(struct gl_framebuffer *fb); @@ -397,8 +387,6 @@ xmesa_buffer_height(XMesaBuffer b) return b->stfb->Base.Height; } -extern int -xmesa_check_for_xshm(Display *display); #endif diff --git a/src/gallium/state_trackers/glx/xlib/xm_winsys.h b/src/gallium/state_trackers/glx/xlib/xm_winsys.h index 4bd5b5c8d3..fc4444bee0 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_winsys.h +++ b/src/gallium/state_trackers/glx/xlib/xm_winsys.h @@ -32,14 +32,15 @@ struct pipe_context; struct pipe_screen; struct pipe_surface; -struct xmesa_buffer; +struct xlib_drawable; +#include struct xm_driver { - struct pipe_screen *(*create_pipe_screen)( void ); + struct pipe_screen *(*create_pipe_screen)( Display *display ); - void (*display_surface)( struct xmesa_buffer *, + void (*display_surface)( struct xlib_drawable *, struct pipe_surface * ); }; diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c index cb559f9080..ceefc1624c 100644 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c @@ -42,16 +42,16 @@ #include "llvmpipe/lp_texture.h" #include "llvmpipe/lp_screen.h" -#include "state_tracker/sw_winsys.h" +#include "state_tracker/xlib_sw_winsys.h" #include "util/u_debug.h" static struct pipe_screen * -xlib_create_llvmpipe_screen( void ) +xlib_create_llvmpipe_screen( Display *display ) { struct sw_winsys *winsys; struct pipe_screen *screen; - winsys = xlib_create_sw_winsys(); + winsys = xlib_create_sw_winsys( display ); if (winsys == NULL) return NULL; @@ -70,7 +70,7 @@ fail: static void -xlib_llvmpipe_display_surface(struct xmesa_buffer *xm_buffer, +xlib_llvmpipe_display_surface(struct xlib_drawable *xm_buffer, struct pipe_surface *surf) { struct llvmpipe_texture *texture = llvmpipe_texture(surf->texture); diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index 47fec4313b..9d665c3d83 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -34,12 +34,12 @@ #include "util/u_debug.h" static struct pipe_screen * -xlib_create_softpipe_screen( void ) +xlib_create_softpipe_screen( Display *display ) { struct sw_winsys *winsys; struct pipe_screen *screen; - winsys = xlib_create_sw_winsys(); + winsys = xlib_create_sw_winsys( display ); if (winsys == NULL) return NULL; diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c index e4b02ba093..21649a0b1f 100644 --- a/src/gallium/winsys/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -46,10 +46,17 @@ #include "util/u_math.h" #include "util/u_memory.h" -#include "state_tracker/sw_winsys.h" +#include "state_tracker/xlib_sw_winsys.h" #include "xlib.h" +#include +#include +#include +#include +#include +#include + /** * Subclass of pipe_buffer for Xlib winsys. * Low-level OS/window system memory buffer @@ -64,21 +71,25 @@ struct xm_displaytarget void *data; void *mapped; + Display *display; + Visual *visual; XImage *tempImage; -#ifdef USE_XSHM - int shm; + XShmSegmentInfo shminfo; -#endif + int shm; }; /** * Subclass of sw_winsys for Xlib winsys */ -struct xmesa_sw_winsys +struct xlib_sw_winsys { struct sw_winsys base; -/* struct xmesa_visual *xm_visual; */ + + + + Display *display; }; @@ -136,8 +147,8 @@ static char *alloc_shm(struct xm_displaytarget *buf, unsigned size) * Allocate a shared memory XImage back buffer for the given XMesaBuffer. */ static void -alloc_shm_ximage(struct xm_displaytarget *xm_buffer, - struct xmesa_buffer *xmb, +alloc_shm_ximage(struct xm_displaytarget *xm_dt, + struct xlib_drawable *xmb, unsigned width, unsigned height) { /* @@ -148,15 +159,15 @@ alloc_shm_ximage(struct xm_displaytarget *xm_buffer, */ int (*old_handler)(Display *, XErrorEvent *); - xm_buffer->tempImage = XShmCreateImage(xmb->xm_visual->display, - xmb->xm_visual->visinfo->visual, - xmb->xm_visual->visinfo->depth, - ZPixmap, - NULL, - &xm_buffer->shminfo, - width, height); - if (xm_buffer->tempImage == NULL) { - xm_buffer->shm = 0; + xm_dt->tempImage = XShmCreateImage(xm_dt->display, + xmb->visual, + xmb->depth, + ZPixmap, + NULL, + &xm_dt->shminfo, + width, height); + if (xm_dt->tempImage == NULL) { + xm_dt->shm = 0; return; } @@ -164,21 +175,21 @@ alloc_shm_ximage(struct xm_displaytarget *xm_buffer, mesaXErrorFlag = 0; old_handler = XSetErrorHandler(mesaHandleXError); /* This may trigger the X protocol error we're ready to catch: */ - XShmAttach(xmb->xm_visual->display, &xm_buffer->shminfo); - XSync(xmb->xm_visual->display, False); + XShmAttach(xm_dt->display, &xm_dt->shminfo); + XSync(xm_dt->display, False); if (mesaXErrorFlag) { /* we are on a remote display, this error is normal, don't print it */ - XFlush(xmb->xm_visual->display); + XFlush(xm_dt->display); mesaXErrorFlag = 0; - XDestroyImage(xm_buffer->tempImage); - xm_buffer->tempImage = NULL; - xm_buffer->shm = 0; + XDestroyImage(xm_dt->tempImage); + xm_dt->tempImage = NULL; + xm_dt->shm = 0; (void) XSetErrorHandler(old_handler); return; } - xm_buffer->shm = 1; + xm_dt->shm = 1; } #endif /* USE_XSHM */ @@ -239,7 +250,7 @@ xm_displaytarget_destroy(struct sw_winsys *ws, * by the XMesaBuffer. */ void -xlib_sw_display(struct xmesa_buffer *xm_buffer, +xlib_sw_display(struct xlib_drawable *xlib_drawable, struct sw_displaytarget *dt) { XImage *ximage; @@ -262,7 +273,8 @@ xlib_sw_display(struct xmesa_buffer *xm_buffer, { assert(util_format_get_blockwidth(xm_dt->format) == 1); assert(util_format_get_blockheight(xm_dt->format) == 1); - alloc_shm_ximage(xm_dt, xm_buffer, + alloc_shm_ximage(xm_dt, + xlib_drawable, xm_dt->stride / util_format_get_blocksize(xm_dt->format), xm_dt->height); } @@ -271,7 +283,7 @@ xlib_sw_display(struct xmesa_buffer *xm_buffer, ximage->data = xm_dt->data; /* _debug_printf("XSHM\n"); */ - XShmPutImage(xm_buffer->xm_visual->display, xm_buffer->drawable, xm_buffer->gc, + XShmPutImage(xm_dt->display, xlib_drawable->drawable, xlib_drawable->gc, ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height, False); } else @@ -291,7 +303,7 @@ xlib_sw_display(struct xmesa_buffer *xm_buffer, ximage->bytes_per_line = xm_dt->stride; /* _debug_printf("XPUT\n"); */ - XPutImage(xm_buffer->xm_visual->display, xm_buffer->drawable, xm_buffer->gc, + XPutImage(xm_dt->display, xlib_drawable->drawable, xlib_drawable->gc, ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height); } } @@ -305,9 +317,8 @@ xm_displaytarget_display(struct sw_winsys *ws, struct sw_displaytarget *dt, void *context_private) { - XMesaContext xmctx = (XMesaContext) context_private; - struct xmesa_buffer *xm_buffer = xmctx->xm_buffer; - xm_sw_display(xm_buffer, dt); + struct xlib_drawable *xlib_drawable = (struct xlib_drawable *)context_private; + xlib_sw_display(xlib_drawable, dt); } @@ -325,6 +336,7 @@ xm_displaytarget_create(struct sw_winsys *winsys, if(!xm_dt) goto no_xm_dt; + xm_dt->display = ((struct xlib_sw_winsys *)winsys)->display; xm_dt->format = format; xm_dt->width = width; xm_dt->height = height; @@ -370,14 +382,15 @@ xm_destroy( struct sw_winsys *ws ) struct sw_winsys * -xlib_create_sw_winsys( void ) +xlib_create_sw_winsys( Display *display ) { - struct xmesa_sw_winsys *ws; + struct xlib_sw_winsys *ws; - ws = CALLOC_STRUCT(xmesa_sw_winsys); + ws = CALLOC_STRUCT(xlib_sw_winsys); if (!ws) return NULL; + ws->display = display; ws->base.destroy = xm_destroy; ws->base.is_displaytarget_format_supported = xm_is_displaytarget_format_supported; -- cgit v1.2.3 From 26aa870a0d80f8b93239a98c558402c3c9ce6445 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 09:38:07 -0700 Subject: mesa: add render-to-texture case for MESA_FORMAT_S8_Z24 --- src/mesa/main/texrender.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index b7b23ade30..9996a996c1 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -497,6 +497,11 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; trb->Base._BaseFormat = GL_DEPTH_STENCIL; } + else if (trb->TexImage->TexFormat == MESA_FORMAT_S8_Z24) { + trb->Base.Format = MESA_FORMAT_S8_Z24; + trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; /* not 8_24 */ + trb->Base._BaseFormat = GL_DEPTH_STENCIL; + } else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) { trb->Base.Format = MESA_FORMAT_Z16; trb->Base.DataType = GL_UNSIGNED_SHORT; -- cgit v1.2.3 From b1ab15c633b9307cf6e17b794949f9c7f4dc4226 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Mar 2010 13:09:47 +0100 Subject: r300: remove unnecessary code _tnl_UpdateFixedFunctionProgram is already called in r300_draw.c --- src/mesa/drivers/dri/r300/r300_state.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 9d1ff6e2ba..ba4a963d40 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1985,23 +1985,6 @@ void r300UpdateShaders(r300ContextPtr rmesa) if (rmesa->options.hw_tcl_enabled) { struct r300_vertex_program *vp; - if (rmesa->radeon.NewGLState) { - int i; - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - rmesa->temp_attrib[i] = - TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = - &rmesa->dummy_attrib[i]; - } - - _tnl_UpdateFixedFunctionProgram(ctx); - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = - rmesa->temp_attrib[i]; - } - } - vp = r300SelectAndTranslateVertexShader(ctx); r300SwitchFallback(ctx, R300_FALLBACK_VERTEX_PROGRAM, vp->error); -- cgit v1.2.3 From 44d92d4bbe7d4e90f9d7bb97af2fd74cbda3b2ee Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Mar 2010 13:18:11 +0100 Subject: r300: no need to flush on context init --- src/mesa/drivers/dri/r300/r300_state.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ba4a963d40..6c2c367aab 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1762,8 +1762,6 @@ static void r300ResetHwState(r300ContextPtr r300) if (RADEON_DEBUG & RADEON_STATE) fprintf(stderr, "%s\n", __FUNCTION__); - radeon_firevertices(&r300->radeon); - r300ColorMask(ctx, ctx->Color.ColorMask[0][RCOMP], ctx->Color.ColorMask[0][GCOMP], -- cgit v1.2.3 From 77ed4d1f5d2f73ec02478eb931296813c25b520c Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Mar 2010 13:39:13 +0100 Subject: r300: recalculate point size, if point min/max size changes Fixes two wine d3d9 unit tests --- src/mesa/drivers/dri/r300/r300_state.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 6c2c367aab..5a056f018d 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -794,12 +794,14 @@ static void r300PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * pa R300_STATECHANGE(r300, ga_point_minmax); r300->hw.ga_point_minmax.cmd[1] &= ~R300_GA_POINT_MINMAX_MIN_MASK; r300->hw.ga_point_minmax.cmd[1] |= (GLuint)(ctx->Point.MinSize * 6.0); + r300PointSize(ctx, ctx->Point.Size); break; case GL_POINT_SIZE_MAX: R300_STATECHANGE(r300, ga_point_minmax); r300->hw.ga_point_minmax.cmd[1] &= ~R300_GA_POINT_MINMAX_MAX_MASK; r300->hw.ga_point_minmax.cmd[1] |= (GLuint)(ctx->Point.MaxSize * 6.0) << R300_GA_POINT_MINMAX_MAX_SHIFT; + r300PointSize(ctx, ctx->Point.Size); break; case GL_POINT_DISTANCE_ATTENUATION: break; -- cgit v1.2.3 From 4350e025cf18ee3b570340ca8cacc8fd857eb59a Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 16:48:39 +0000 Subject: ws/xlib: fixup softpipe build --- src/gallium/winsys/xlib/xlib_softpipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index 9d665c3d83..3b51d7c17c 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -30,7 +30,7 @@ #include "xlib.h" #include "softpipe/sp_texture.h" #include "softpipe/sp_screen.h" -#include "state_tracker/sw_winsys.h" +#include "state_tracker/xlib_sw_winsys.h" #include "util/u_debug.h" static struct pipe_screen * @@ -58,7 +58,7 @@ fail: static void -xlib_softpipe_display_surface(struct xmesa_buffer *xm_buffer, +xlib_softpipe_display_surface(struct xlib_drawable *xm_buffer, struct pipe_surface *surf) { struct softpipe_texture *texture = softpipe_texture(surf->texture); -- cgit v1.2.3 From 2872c1cc328008dea166319f3023a3f568247bcf Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 12:02:28 +0100 Subject: r300: VAP flush is needed only when vertex program or constants are changed --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 21 +-------------------- src/mesa/drivers/dri/r300/r300_context.h | 1 - src/mesa/drivers/dri/r300/r300_state.c | 1 - src/mesa/drivers/dri/r300/r300_vertprog.c | 4 +--- 4 files changed, 2 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 4787bafc66..6cfa5686f4 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -90,8 +90,7 @@ void r300_emit_vpu(struct r300_context *r300, { BATCH_LOCALS(&r300->radeon); - BEGIN_BATCH_NO_AUTOSTATE(5 + len); - OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); + BEGIN_BATCH_NO_AUTOSTATE(3 + len); OUT_BATCH_REGVAL(R300_VAP_PVS_VECTOR_INDX_REG, addr); OUT_BATCH(CP_PACKET0(R300_VAP_PVS_UPLOAD_DATA, len-1) | RADEON_ONE_REG_WR); OUT_BATCH_TABLE(data, len); @@ -778,24 +777,6 @@ void r300InitCmdBuf(r300ContextPtr r300) /* VPU only on TCL */ if (has_tcl) { int i; - if (r300->radeon.radeonScreen->kernel_mm) { - ALLOC_STATE(vap_flush, always, 10, 0); - /* flush processing vertices */ - r300->hw.vap_flush.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_SC_SCREENDOOR, 1); - r300->hw.vap_flush.cmd[1] = 0; - r300->hw.vap_flush.cmd[2] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_DSTCACHE_CTLSTAT, 1); - r300->hw.vap_flush.cmd[3] = R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D; - r300->hw.vap_flush.cmd[4] = cmdpacket0(r300->radeon.radeonScreen, RADEON_WAIT_UNTIL, 1); - r300->hw.vap_flush.cmd[5] = RADEON_WAIT_3D_IDLECLEAN; - r300->hw.vap_flush.cmd[6] = cmdpacket0(r300->radeon.radeonScreen, R300_SC_SCREENDOOR, 1); - r300->hw.vap_flush.cmd[7] = 0xffffff; - r300->hw.vap_flush.cmd[8] = cmdpacket0(r300->radeon.radeonScreen, R300_VAP_PVS_STATE_FLUSH_REG, 1); - r300->hw.vap_flush.cmd[9] = 0; - } else { - ALLOC_STATE(vap_flush, never, 10, 0); - } - - ALLOC_STATE(vpi, vpu, R300_VPI_CMDSIZE, 0); r300->hw.vpi.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_PVS_CODE_START, 0); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 78ab43a99f..df7115e7da 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -355,7 +355,6 @@ struct r300_hw_state { struct radeon_state_atom zb_hiz_offset; /* (4F44) */ struct radeon_state_atom zb_hiz_pitch; /* (4F54) */ - struct radeon_state_atom vap_flush; struct radeon_state_atom vpi; /* vp instructions */ struct radeon_state_atom vpp; /* vp parameters */ struct radeon_state_atom vps; /* vertex point size (?) */ diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 5a056f018d..5979dedac4 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -366,7 +366,6 @@ static void r300ClipPlane( GLcontext *ctx, GLenum plane, const GLfloat *eq ) p = (GLint) plane - (GLint) GL_CLIP_PLANE0; ip = (GLint *)ctx->Transform._ClipUserPlane[p]; - R300_STATECHANGE( rmesa, vap_flush ); R300_STATECHANGE( rmesa, vpucp[p] ); rmesa->hw.vpucp[p].cmd[R300_VPUCP_X] = ip[0]; rmesa->hw.vpucp[p].cmd[R300_VPUCP_Y] = ip[1]; diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index cbe4cb8304..129004fee7 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -342,8 +342,6 @@ static void r300EmitVertexProgram(r300ContextPtr r300, int dest, struct r300_ver assert((code->length > 0) && (code->length % 4 == 0)); - R300_STATECHANGE( r300, vap_flush ); - switch ((dest >> 8) & 0xf) { case 0: R300_STATECHANGE(r300, vpi); @@ -381,7 +379,7 @@ void r300SetupVertexProgram(r300ContextPtr rmesa) ((drm_r300_cmd_header_t *) rmesa->hw.vpi.cmd)->vpu.count = 0; ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0; - R300_STATECHANGE(rmesa, vap_flush); + R300_STATECHANGE(rmesa, vap_cntl); R300_STATECHANGE(rmesa, vpp); param_count = r300VertexProgUpdateParams(ctx, prog, (float *)&rmesa->hw.vpp.cmd[R300_VPP_PARAM_0]); bump_vpu_count(rmesa->hw.vpp.cmd, param_count); -- cgit v1.2.3 From 90b3baf9b3d0236cbecb171f2e742c9157dd312d Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 16:48:45 +0000 Subject: ws/xlib: remove dead files --- src/gallium/winsys/xlib/xmesa.h | 424 -------------------------------------- src/gallium/winsys/xlib/xmesa_x.h | 86 -------- 2 files changed, 510 deletions(-) delete mode 100644 src/gallium/winsys/xlib/xmesa.h delete mode 100644 src/gallium/winsys/xlib/xmesa_x.h (limited to 'src') diff --git a/src/gallium/winsys/xlib/xmesa.h b/src/gallium/winsys/xlib/xmesa.h deleted file mode 100644 index 98139af833..0000000000 --- a/src/gallium/winsys/xlib/xmesa.h +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -/* - * Mesa/X11 interface. This header file serves as the documentation for - * the Mesa/X11 interface functions. - * - * Note: this interface isn't intended for user programs. It's primarily - * just for implementing the pseudo-GLX interface. - */ - - -/* Sample Usage: - -In addition to the usual X calls to select a visual, create a colormap -and create a window, you must do the following to use the X/Mesa interface: - -1. Call XMesaCreateVisual() to make an XMesaVisual from an XVisualInfo. - -2. Call XMesaCreateContext() to create an X/Mesa rendering context, given - the XMesaVisual. - -3. Call XMesaCreateWindowBuffer() to create an XMesaBuffer from an X window - and XMesaVisual. - -4. Call XMesaMakeCurrent() to bind the XMesaBuffer to an XMesaContext and - to make the context the current one. - -5. Make gl* calls to render your graphics. - -6. Use XMesaSwapBuffers() when double buffering to swap front/back buffers. - -7. Before the X window is destroyed, call XMesaDestroyBuffer(). - -8. Before exiting, call XMesaDestroyVisual and XMesaDestroyContext. - -*/ - - - - -#ifndef XMESA_H -#define XMESA_H - -#ifdef __VMS -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef XFree86Server -#include "xmesa_xf86.h" -#else -#include -#include -#include "xmesa_x.h" -#endif -#include "GL/gl.h" - -#ifdef AMIWIN -#include -extern struct Library *XLibBase; -#endif - - -#define XMESA_MAJOR_VERSION 6 -#define XMESA_MINOR_VERSION 3 - - - -/* - * Values passed to XMesaGetString: - */ -#define XMESA_VERSION 1 -#define XMESA_EXTENSIONS 2 - - -/* - * Values passed to XMesaSetFXmode: - */ -#define XMESA_FX_WINDOW 1 -#define XMESA_FX_FULLSCREEN 2 - - - -typedef struct xmesa_context *XMesaContext; - -typedef struct xmesa_visual *XMesaVisual; - -typedef struct xmesa_buffer *XMesaBuffer; - - - -/* - * Create a new X/Mesa visual. - * Input: display - X11 display - * visinfo - an XVisualInfo pointer - * rgb_flag - GL_TRUE = RGB mode, - * GL_FALSE = color index mode - * alpha_flag - alpha buffer requested? - * db_flag - GL_TRUE = double-buffered, - * GL_FALSE = single buffered - * stereo_flag - stereo visual? - * ximage_flag - GL_TRUE = use an XImage for back buffer, - * GL_FALSE = use an off-screen pixmap for back buffer - * depth_size - requested bits/depth values, or zero - * stencil_size - requested bits/stencil values, or zero - * accum_red_size - requested bits/red accum values, or zero - * accum_green_size - requested bits/green accum values, or zero - * accum_blue_size - requested bits/blue accum values, or zero - * accum_alpha_size - requested bits/alpha accum values, or zero - * num_samples - number of samples/pixel if multisampling, or zero - * level - visual level, usually 0 - * visualCaveat - ala the GLX extension, usually GLX_NONE_EXT - * Return; a new XMesaVisual or 0 if error. - */ -extern XMesaVisual XMesaCreateVisual( XMesaDisplay *display, - XMesaVisualInfo visinfo, - GLboolean rgb_flag, - GLboolean alpha_flag, - GLboolean db_flag, - GLboolean stereo_flag, - GLboolean ximage_flag, - GLint depth_size, - GLint stencil_size, - GLint accum_red_size, - GLint accum_green_size, - GLint accum_blue_size, - GLint accum_alpha_size, - GLint num_samples, - GLint level, - GLint visualCaveat ); - -/* - * Destroy an XMesaVisual, but not the associated XVisualInfo. - */ -extern void XMesaDestroyVisual( XMesaVisual v ); - - - -/* - * Create a new XMesaContext for rendering into an X11 window. - * - * Input: visual - an XMesaVisual - * share_list - another XMesaContext with which to share display - * lists or NULL if no sharing is wanted. - * Return: an XMesaContext or NULL if error. - */ -extern XMesaContext XMesaCreateContext( XMesaVisual v, - XMesaContext share_list ); - - -/* - * Destroy a rendering context as returned by XMesaCreateContext() - */ -extern void XMesaDestroyContext( XMesaContext c ); - - -#ifdef XFree86Server -/* - * These are the extra routines required for integration with XFree86. - * None of these routines should be user visible. -KEM - */ -extern GLboolean XMesaForceCurrent( XMesaContext c ); - -extern GLboolean XMesaLoseCurrent( XMesaContext c ); - -extern GLboolean XMesaCopyContext( XMesaContext src, - XMesaContext dst, - GLuint mask ); -#endif /* XFree86Server */ - - -/* - * Create an XMesaBuffer from an X window. - */ -extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v, XMesaWindow w ); - - -/* - * Create an XMesaBuffer from an X pixmap. - */ -extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, - XMesaPixmap p, - XMesaColormap cmap ); - - -/* - * Destroy an XMesaBuffer, but not the corresponding window or pixmap. - */ -extern void XMesaDestroyBuffer( XMesaBuffer b ); - - -/* - * Return the XMesaBuffer handle which corresponds to an X drawable, if any. - * - * New in Mesa 2.3. - */ -extern XMesaBuffer XMesaFindBuffer( XMesaDisplay *dpy, - XMesaDrawable d ); - - - -/* - * Bind a buffer to a context and make the context the current one. - */ -extern GLboolean XMesaMakeCurrent( XMesaContext c, - XMesaBuffer b ); - - -/* - * Bind two buffers (read and draw) to a context and make the - * context the current one. - * New in Mesa 3.3 - */ -extern GLboolean XMesaMakeCurrent2( XMesaContext c, - XMesaBuffer drawBuffer, - XMesaBuffer readBuffer ); - - -/* - * Unbind the current context from its buffer. - */ -extern GLboolean XMesaUnbindContext( XMesaContext c ); - - -/* - * Return a handle to the current context. - */ -extern XMesaContext XMesaGetCurrentContext( void ); - - -/* - * Return handle to the current (draw) buffer. - */ -extern XMesaBuffer XMesaGetCurrentBuffer( void ); - - -/* - * Return handle to the current read buffer. - * New in Mesa 3.3 - */ -extern XMesaBuffer XMesaGetCurrentReadBuffer( void ); - - -/* - * Swap the front and back buffers for the given buffer. No action is - * taken if the buffer is not double buffered. - */ -extern void XMesaSwapBuffers( XMesaBuffer b ); - - -/* - * Copy a sub-region of the back buffer to the front buffer. - * - * New in Mesa 2.6 - */ -extern void XMesaCopySubBuffer( XMesaBuffer b, - int x, - int y, - int width, - int height ); - - -/* - * Return a pointer to the the Pixmap or XImage being used as the back - * color buffer of an XMesaBuffer. This function is a way to get "under - * the hood" of X/Mesa so one can manipulate the back buffer directly. - * Input: b - the XMesaBuffer - * Output: pixmap - pointer to back buffer's Pixmap, or 0 - * ximage - pointer to back buffer's XImage, or NULL - * Return: GL_TRUE = context is double buffered - * GL_FALSE = context is single buffered - */ -extern GLboolean XMesaGetBackBuffer( XMesaBuffer b, - XMesaPixmap *pixmap, - XMesaImage **ximage ); - - - -/* - * Return the depth buffer associated with an XMesaBuffer. - * Input: b - the XMesa buffer handle - * Output: width, height - size of buffer in pixels - * bytesPerValue - bytes per depth value (2 or 4) - * buffer - pointer to depth buffer values - * Return: GL_TRUE or GL_FALSE to indicate success or failure. - * - * New in Mesa 2.4. - */ -extern GLboolean XMesaGetDepthBuffer( XMesaBuffer b, - GLint *width, - GLint *height, - GLint *bytesPerValue, - void **buffer ); - - - -/* - * Flush/sync a context - */ -extern void XMesaFlush( XMesaContext c ); - - - -/* - * Get an X/Mesa-specific string. - * Input: name - either XMESA_VERSION or XMESA_EXTENSIONS - */ -extern const char *XMesaGetString( XMesaContext c, int name ); - - - -/* - * Scan for XMesaBuffers whose window/pixmap has been destroyed, then free - * any memory used by that buffer. - * - * New in Mesa 2.3. - */ -extern void XMesaGarbageCollect( void ); - - - -/* - * Return a dithered pixel value. - * Input: c - XMesaContext - * x, y - window coordinate - * red, green, blue, alpha - color components in [0,1] - * Return: pixel value - * - * New in Mesa 2.3. - */ -extern unsigned long XMesaDitherColor( XMesaContext xmesa, - GLint x, - GLint y, - GLfloat red, - GLfloat green, - GLfloat blue, - GLfloat alpha ); - - - -/* - * 3Dfx Glide driver only! - * Set 3Dfx/Glide full-screen or window rendering mode. - * Input: mode - either XMESA_FX_WINDOW (window rendering mode) or - * XMESA_FX_FULLSCREEN (full-screen rendering mode) - * Return: GL_TRUE if success - * GL_FALSE if invalid mode or if not using 3Dfx driver - * - * New in Mesa 2.6. - */ -extern GLboolean XMesaSetFXmode( GLint mode ); - - - -/* - * Reallocate the back/depth/stencil/accum/etc/ buffers associated with - * buffer if its size has changed. - * - * New in Mesa 4.0.2 - */ -extern void XMesaResizeBuffers( XMesaBuffer b ); - - - -/* - * Create a pbuffer. - * New in Mesa 4.1 - */ -extern XMesaBuffer XMesaCreatePBuffer(XMesaVisual v, XMesaColormap cmap, - unsigned int width, unsigned int height); - - - -/* - * Texture from Pixmap - * New in Mesa 7.1 - */ -extern void -XMesaBindTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer, - const int *attrib_list); - -extern void -XMesaReleaseTexImage(XMesaDisplay *dpy, XMesaBuffer drawable, int buffer); - - -extern XMesaBuffer -XMesaCreatePixmapTextureBuffer(XMesaVisual v, XMesaPixmap p, - XMesaColormap cmap, - int format, int target, int mipmap); - - - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/src/gallium/winsys/xlib/xmesa_x.h b/src/gallium/winsys/xlib/xmesa_x.h deleted file mode 100644 index 865bab4313..0000000000 --- a/src/gallium/winsys/xlib/xmesa_x.h +++ /dev/null @@ -1,86 +0,0 @@ - -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * - * When we're building the XMesa driver for stand-alone Mesa we - * include this file when building the xm_*.c files. - * We need to define some types and macros differently when building - * in the Xserver vs. stand-alone Mesa. - */ - -#ifndef _XMESA_X_H_ -#define _XMESA_X_H_ - -typedef Display XMesaDisplay; -typedef Pixmap XMesaPixmap; -typedef Colormap XMesaColormap; -typedef Drawable XMesaDrawable; -typedef Window XMesaWindow; -typedef GC XMesaGC; -typedef XVisualInfo *XMesaVisualInfo; -typedef XImage XMesaImage; -typedef XPoint XMesaPoint; -typedef XColor XMesaColor; - -#define XMesaDestroyImage XDestroyImage - -#define XMesaPutPixel XPutPixel -#define XMesaGetPixel XGetPixel - -#define XMesaSetForeground XSetForeground -#define XMesaSetBackground XSetBackground -#define XMesaSetPlaneMask XSetPlaneMask -#define XMesaSetFunction XSetFunction -#define XMesaSetFillStyle XSetFillStyle -#define XMesaSetTile XSetTile - -#define XMesaDrawPoint XDrawPoint -#define XMesaDrawPoints XDrawPoints -#define XMesaDrawLine XDrawLine -#define XMesaFillRectangle XFillRectangle -#define XMesaGetImage XGetImage -#define XMesaPutImage XPutImage -#define XMesaCopyArea XCopyArea - -#define XMesaCreatePixmap XCreatePixmap -#define XMesaFreePixmap XFreePixmap -#define XMesaFreeGC XFreeGC - -#define GET_COLORMAP_SIZE(__v) __v->visinfo->colormap_size -#define GET_REDMASK(__v) __v->mesa_visual.redMask -#define GET_GREENMASK(__v) __v->mesa_visual.greenMask -#define GET_BLUEMASK(__v) __v->mesa_visual.blueMask -#define GET_VISUAL_DEPTH(__v) __v->visinfo->depth -#define GET_BLACK_PIXEL(__v) BlackPixel(__v->display, __v->mesa_visual.screen) -#define CHECK_BYTE_ORDER(__v) host_byte_order()==ImageByteOrder(__v->display) -#define CHECK_FOR_HPCR(__v) XInternAtom(__v->display, "_HP_RGB_SMOOTH_MAP_LIST", True) - -#endif -- cgit v1.2.3 From 8ccd83ab921380953a0e5cebd941444f85c23ed1 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Feb 2010 19:37:23 +0100 Subject: radeon: fallback to software in glCopyTexImage if blit isn't available --- src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c index 89fe9915a7..a4bb03d5d3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c @@ -53,6 +53,10 @@ do_copy_texsubimage(GLcontext *ctx, unsigned src_width; unsigned dst_width; + if (!radeon->vtbl.blit) { + return GL_FALSE; + } + if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { rrb = radeon_get_depthbuffer(radeon); } else { -- cgit v1.2.3 From 62b3321d7d9774ed235bc3d328b6a0f5da153dcf Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 6 Feb 2010 18:25:36 +0100 Subject: r300: reset bos when validating buffers during blit --- src/mesa/drivers/dri/r300/r300_blit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 2bc761bc20..f9c085e283 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -381,6 +381,9 @@ static GLboolean validate_buffers(struct r300_context *r300, struct radeon_bo *dst_bo) { int ret; + + radeon_cs_space_reset_bos(r300->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) -- cgit v1.2.3 From 4572ae1925e63227b2785fec446862d398ad0005 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Thu, 4 Mar 2010 18:35:55 +0100 Subject: r300: allow src and dst BOs to be placed in GTT during blit Fixes some relocation failures --- src/mesa/drivers/dri/r300/r300_blit.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index f9c085e283..d870c7f852 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -385,18 +385,12 @@ static GLboolean validate_buffers(struct r300_context *r300, radeon_cs_space_reset_bos(r300->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); - if (ret) - return GL_FALSE; - - ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, - first_elem(&r300->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; -- cgit v1.2.3 From 29e02c7e720a18b59317c4ad97d8ffc149228c69 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 16 Jan 2010 15:11:37 +0100 Subject: radeon: no need to emit full state twice after flush --- src/mesa/drivers/dri/radeon/radeon_common.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 79f3ff7da6..13f1f0611b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -1325,11 +1325,6 @@ void rcommonBeginBatch(radeonContextPtr rmesa, int n, const char *function, int line) { - if (!rmesa->cmdbuf.cs->cdw && dostate) { - radeon_print(RADEON_STATE, RADEON_NORMAL, - "Reemit state after flush (from %s)\n", function); - radeonEmitState(rmesa); - } radeon_cs_begin(rmesa->cmdbuf.cs, n, file, function, line); radeon_print(RADEON_CS, RADEON_VERBOSE, "BEGIN_BATCH(%d) at %d, from %s:%i\n", -- cgit v1.2.3 From b3b6bd5da1241086bda75431ddde6002e9353268 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 14 Feb 2010 00:02:05 +0100 Subject: r300: don't enable EXT_packed_depth_stencil R300 hw doesn't support sampling from Z24_S8 or S8_Z24 formats. --- src/mesa/drivers/dri/r300/r300_context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index df4cc11da4..ff35cd5275 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -109,7 +109,6 @@ static const struct dri_extension card_extensions[] = { {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, {"GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions}, {"GL_EXT_blend_subtract", NULL}, - {"GL_EXT_packed_depth_stencil", NULL}, {"GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, {"GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions}, {"GL_EXT_provoking_vertex", GL_EXT_provoking_vertex_functions }, @@ -456,6 +455,9 @@ static void r300InitGLExtensions(GLcontext *ctx) } if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV350) _mesa_enable_extension(ctx, "GL_ARB_half_float_vertex"); + + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) + _mesa_enable_extension(ctx, "GL_EXT_packed_depth_stencil"); } static void r300InitIoctlFuncs(struct dd_function_table *functions) -- cgit v1.2.3 From d18b3023653e709051a56f5806988f24724972e7 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 09:57:26 -0500 Subject: r600: no need to flush on context init --- src/mesa/drivers/dri/r600/r700_state.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 4ebdbbfad2..3e10e5b37a 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1626,8 +1626,6 @@ void r700InitState(GLcontext * ctx) //------------------- R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); int id = 0; - radeon_firevertices(&context->radeon); - r700->TA_CNTL_AUX.u32All = 0; SETfield(r700->TA_CNTL_AUX.u32All, 28, TD_FIFO_CREDIT_shift, TD_FIFO_CREDIT_mask); r700->VC_ENHANCE.u32All = 0; -- cgit v1.2.3 From c65235f97efe30eb9444f7c8f20cb8f0cc529d19 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 10:00:59 -0500 Subject: r600: recalculate point size, if point min/max size changes --- src/mesa/drivers/dri/r600/r700_state.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 3e10e5b37a..6f156b5409 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -911,10 +911,12 @@ static void r700PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * pa case GL_POINT_SIZE_MIN: SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MinSize * 8.0), MIN_SIZE_shift, MIN_SIZE_mask); + r700PointSize(ctx, ctx->Point.Size); break; case GL_POINT_SIZE_MAX: SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MaxSize * 8.0), MAX_SIZE_shift, MAX_SIZE_mask); + r700PointSize(ctx, ctx->Point.Size); break; case GL_POINT_DISTANCE_ATTENUATION: break; -- cgit v1.2.3 From d7ad1b8b0788536f6fcd261fbe0db7a10b84ac0a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 10:04:02 -0500 Subject: radeon/r200/r600: reset bos when validating buffers during blit --- src/mesa/drivers/dri/r200/r200_blit.c | 3 +++ src/mesa/drivers/dri/r600/r600_blit.c | 2 ++ src/mesa/drivers/dri/radeon/radeon_blit.c | 3 +++ 3 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c index b56327dad5..2c8b3aafe5 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.c +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -211,6 +211,9 @@ static GLboolean validate_buffers(struct r200_context *r200, struct radeon_bo *dst_bo) { int ret; + + radeon_cs_space_reset_bos(r200->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index 9d17463cae..fb84825761 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -1533,6 +1533,8 @@ static GLboolean validate_buffers(context_t *rmesa, { int ret; + radeon_cs_space_reset_bos(rmesa->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index e188a122d5..8c3c2e4766 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -204,6 +204,9 @@ static GLboolean validate_buffers(struct r100_context *r100, struct radeon_bo *dst_bo) { int ret; + + radeon_cs_space_reset_bos(r100->radeon.cmdbuf.cs); + ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, src_bo, RADEON_GEM_DOMAIN_VRAM, 0); if (ret) -- cgit v1.2.3 From 9458c2061ba5d8857217d9a7504b42ea17022897 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 10:13:49 -0500 Subject: radeon/r200/r600: allow src and dst BOs to be placed in GTT during blit --- src/mesa/drivers/dri/r200/r200_blit.c | 10 ++-------- src/mesa/drivers/dri/r600/r600_blit.c | 10 ++-------- src/mesa/drivers/dri/radeon/radeon_blit.c | 10 ++-------- 3 files changed, 6 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c index 2c8b3aafe5..3075760093 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.c +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -215,18 +215,12 @@ static GLboolean validate_buffers(struct r200_context *r200, radeon_cs_space_reset_bos(r200->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); - if (ret) - return GL_FALSE; - - ret = radeon_cs_space_check_with_bo(r200->radeon.cmdbuf.cs, - first_elem(&r200->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; diff --git a/src/mesa/drivers/dri/r600/r600_blit.c b/src/mesa/drivers/dri/r600/r600_blit.c index fb84825761..244fdc4ffb 100644 --- a/src/mesa/drivers/dri/r600/r600_blit.c +++ b/src/mesa/drivers/dri/r600/r600_blit.c @@ -1536,12 +1536,12 @@ static GLboolean validate_buffers(context_t *rmesa, radeon_cs_space_reset_bos(rmesa->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; @@ -1551,12 +1551,6 @@ static GLboolean validate_buffers(context_t *rmesa, if (ret) return GL_FALSE; - ret = radeon_cs_space_check_with_bo(rmesa->radeon.cmdbuf.cs, - first_elem(&rmesa->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); - if (ret) - return GL_FALSE; - return GL_TRUE; } diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index 8c3c2e4766..e1e1f21550 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -208,18 +208,12 @@ static GLboolean validate_buffers(struct r100_context *r100, radeon_cs_space_reset_bos(r100->radeon.cmdbuf.cs); ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, - src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + src_bo, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); if (ret) return GL_FALSE; ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, - dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); - if (ret) - return GL_FALSE; - - ret = radeon_cs_space_check_with_bo(r100->radeon.cmdbuf.cs, - first_elem(&r100->radeon.dma.reserved)->bo, - RADEON_GEM_DOMAIN_GTT, 0); + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT); if (ret) return GL_FALSE; -- cgit v1.2.3 From fe25bee14f4df3ef87cc7fee67e610da9afc5eda Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 09:58:54 -0700 Subject: mesa: add additional missing z formats for render to texture Allow render to texture for X8_Z24 and Z24_X8 formats. Replace big if/else with switch, etc. --- src/mesa/main/texrender.c | 98 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 83 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 9996a996c1..d29af5a5b2 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -84,6 +84,14 @@ texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; } } + else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { + GLuint *zValues = (GLuint *) values; + for (i = 0; i < count; i++) { + GLfloat flt; + trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt); + zValues[i] = (GLuint) (flt * 0xffffff); + } + } else { _mesa_problem(ctx, "invalid rb->DataType in texture_get_row"); } @@ -139,6 +147,15 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, zValues[i] = ((GLuint) (flt * 0xffffff)) << 8; } } + else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { + GLuint *zValues = (GLuint *) values; + for (i = 0; i < count; i++) { + GLfloat flt; + trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + z, &flt); + zValues[i] = (GLuint) (flt * 0xffffff); + } + } else { _mesa_problem(ctx, "invalid rb->DataType in texture_get_values"); } @@ -193,6 +210,15 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } } + else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { + const GLuint *zValues = (const GLuint *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff)); + trb->Store(trb->TexImage, x + i, y, z, &flt); + } + } + } else { _mesa_problem(ctx, "invalid rb->DataType in texture_put_row"); } @@ -246,6 +272,15 @@ texture_put_row_rgb(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } } + else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { + const GLuint *zValues = (const GLuint *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff)); + trb->Store(trb->TexImage, x + i, y, z, &flt); + } + } + } else { _mesa_problem(ctx, "invalid rb->DataType in texture_put_row"); } @@ -296,6 +331,15 @@ texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } } + else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { + const GLuint zValue = *((const GLuint *) value); + const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff)); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x + i, y, z, &flt); + } + } + } else { _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_row"); } @@ -346,6 +390,15 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, } } } + else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { + const GLuint *zValues = (const GLuint *) values; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff)); + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); + } + } + } else { _mesa_problem(ctx, "invalid rb->DataType in texture_put_values"); } @@ -395,6 +448,15 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, } } } + else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { + const GLuint zValue = *((const GLuint *) value); + const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff)); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); + } + } + } else { _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_values"); } @@ -491,29 +553,35 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Base.Width = trb->TexImage->Width; trb->Base.Height = trb->TexImage->Height; trb->Base.InternalFormat = trb->TexImage->InternalFormat; + trb->Base.Format = trb->TexImage->TexFormat; + /* XXX may need more special cases here */ - if (trb->TexImage->TexFormat == MESA_FORMAT_Z24_S8) { - trb->Base.Format = MESA_FORMAT_Z24_S8; + switch (trb->TexImage->TexFormat) { + case MESA_FORMAT_Z24_S8: trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; trb->Base._BaseFormat = GL_DEPTH_STENCIL; - } - else if (trb->TexImage->TexFormat == MESA_FORMAT_S8_Z24) { - trb->Base.Format = MESA_FORMAT_S8_Z24; - trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; /* not 8_24 */ + break; + case MESA_FORMAT_S8_Z24: + trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA; trb->Base._BaseFormat = GL_DEPTH_STENCIL; - } - else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) { - trb->Base.Format = MESA_FORMAT_Z16; + break; + case MESA_FORMAT_Z24_X8: + trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; + trb->Base._BaseFormat = GL_DEPTH_COMPONENT; + break; + case MESA_FORMAT_X8_Z24: + trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA; + trb->Base._BaseFormat = GL_DEPTH_COMPONENT; + break; + case MESA_FORMAT_Z16: trb->Base.DataType = GL_UNSIGNED_SHORT; trb->Base._BaseFormat = GL_DEPTH_COMPONENT; - } - else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) { - trb->Base.Format = MESA_FORMAT_Z32; + break; + case MESA_FORMAT_Z32: trb->Base.DataType = GL_UNSIGNED_INT; trb->Base._BaseFormat = GL_DEPTH_COMPONENT; - } - else { - trb->Base.Format = trb->TexImage->TexFormat; + break; + default: trb->Base.DataType = CHAN_TYPE; trb->Base._BaseFormat = GL_RGBA; } -- cgit v1.2.3 From df9bf78f888702542a506f551204a2e7dc8b7df1 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 8 Mar 2010 11:59:02 -0500 Subject: r600: enable GL_ARB_pixel_buffer_object --- src/mesa/drivers/dri/r600/r600_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 3d6802e735..134e97e7c3 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -140,6 +140,7 @@ static const struct dri_extension card_extensions[] = { {"GL_NV_blend_square", NULL}, {"GL_NV_vertex_program", GL_NV_vertex_program_functions}, {"GL_SGIS_generate_mipmap", NULL}, + {"GL_ARB_pixel_buffer_object", NULL}, {NULL, NULL} /* *INDENT-ON* */ }; -- cgit v1.2.3 From 80dc54e308dfb1fad344272978ff14646995e00a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 11:31:23 -0700 Subject: st/mesa: don't detach renderbuffer, surface in st_finish_render_texture() There's no reason to release the renderbuffer from the framebuffer object or release the gallium surface in this function (they're reference counted). In fact, we don't want to do this because we may later use the texture as a pixel source (ex: glBlitFramebuffer) and need the surface. Fixes fd.o bug 26923 and is part of the fix for bug 26932. --- src/mesa/state_tracker/st_cb_fbo.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 8fded0c69f..00e9d1dccb 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -410,17 +410,12 @@ st_finish_render_texture(GLcontext *ctx, st_flush( ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL ); - if (strb->surface) - pipe_surface_reference( &strb->surface, NULL ); - strb->rtt = NULL; /* printf("FINISH RENDER TO TEXTURE surf=%p\n", strb->surface); */ - _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); - /* restore previous framebuffer state */ st_invalidate_state(ctx, _NEW_BUFFERS); } -- cgit v1.2.3 From e1762fb870f86afc4f6bd000b4a1c059d161f10d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 11:34:55 -0700 Subject: softpipe: zero-out entire clear_flags array in sp_tile_cache_flush_clear() Before, we only cleared the flags for the active tiles (the ones inside the framebuffer bound). The problem is if we later bound a different, larger surface to the tile cache we'd have some stale clear-flags still set (and mistakenly clear some tiles in the new surface). Fixes fd.o bug 26932. --- src/gallium/drivers/softpipe/sp_tile_cache.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index 3b30954ac8..aedfdf1b46 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -299,13 +299,14 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc) x, y, TILE_SIZE, TILE_SIZE, tc->tile.data.color32, 0/*STRIDE*/); - /* do this? */ - clear_clear_flag(tc->clear_flags, addr); - numCleared++; } } } + + /* reset all clear flags to zero */ + memset(tc->clear_flags, 0, sizeof(tc->clear_flags)); + #if 0 debug_printf("num cleared: %u\n", numCleared); #endif -- cgit v1.2.3 From 99f11d0e18e1ff5a433c84d52ffc13b9684c2650 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 19:11:35 +0000 Subject: gallium: introduce target directory Currently there are still at least two functions bundled up inside the winsys concept: a) that of a backend resource manager, sometimes capable of performing present() operations, b) the initialization code/routine for the whole driver stack. The inclusion of (b) makes it difficult to share implementations of (a) between different drivers. For instance, a clean xlib winsys could be of use for software-rasterized VG, GLES, EGL, etc, stacks. But that is only true as long as there is no dependency from the winsys to higher level code, as would be the case when we include (b) in this component. This change creates a new gallium/targets subtree, specifically for implementing the glue needed to build individual driver stacks, and moves that code out of a single example winsys, namely xlib. Other drivers continue to build unchanged, but hopefully can migrate to this structure over time. --- configs/autoconf.in | 1 + configs/default | 3 +- configs/linux-cell | 2 +- configs/linux-dri | 1 + configs/linux-egl | 3 +- configs/linux-i965 | 1 + configs/linux-opengl-es | 2 +- src/gallium/include/state_tracker/xlib_sw_winsys.h | 17 +- src/gallium/state_trackers/glx/xlib/SConscript | 2 - src/gallium/state_trackers/glx/xlib/xm_winsys.h | 11 -- src/gallium/targets/Makefile | 12 ++ src/gallium/targets/SConscript | 16 ++ src/gallium/targets/libgl-xlib/Makefile | 98 ++++++++++ src/gallium/targets/libgl-xlib/SConscript | 64 +++++++ src/gallium/targets/libgl-xlib/xlib.c | 104 ++++++++++ src/gallium/winsys/xlib/Makefile | 90 +-------- src/gallium/winsys/xlib/SConscript | 83 +++----- src/gallium/winsys/xlib/xlib.c | 136 -------------- src/gallium/winsys/xlib/xlib.h | 7 +- src/gallium/winsys/xlib/xlib_brw_context.c | 209 --------------------- src/gallium/winsys/xlib/xlib_sw_winsys.c | 1 - 21 files changed, 350 insertions(+), 513 deletions(-) create mode 100644 src/gallium/targets/Makefile create mode 100644 src/gallium/targets/SConscript create mode 100644 src/gallium/targets/libgl-xlib/Makefile create mode 100644 src/gallium/targets/libgl-xlib/SConscript create mode 100644 src/gallium/targets/libgl-xlib/xlib.c delete mode 100644 src/gallium/winsys/xlib/xlib.c delete mode 100644 src/gallium/winsys/xlib/xlib_brw_context.c (limited to 'src') diff --git a/configs/autoconf.in b/configs/autoconf.in index 30637877f3..023b86eed6 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -73,6 +73,7 @@ EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@ GALLIUM_DIRS = @GALLIUM_DIRS@ GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@ GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@ +GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@ GALLIUM_WINSYS_DRM_DIRS = @GALLIUM_WINSYS_DRM_DIRS@ GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@ GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a diff --git a/configs/default b/configs/default index ad6d93c92f..45eaf8752e 100644 --- a/configs/default +++ b/configs/default @@ -86,7 +86,7 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2 # Directories to build LIB_DIR = lib -SRC_DIRS = glsl mesa gallium egl gallium/winsys glu glut/glx glew glw +SRC_DIRS = glsl mesa gallium egl gallium/winsys gallium/targets glu glut/glx glew glw GLU_DIRS = sgi DRIVER_DIRS = x11 osmesa # Which subdirs under $(TOP)/progs/ to enter: @@ -101,6 +101,7 @@ GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 i965 r300 trace identity GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) GALLIUM_WINSYS_DIRS = drm xlib +GALLIUM_TARGET_DIRS = libgl-xlib GALLIUM_WINSYS_DRM_DIRS = swrast GALLIUM_STATE_TRACKERS_DIRS = glx vega diff --git a/configs/linux-cell b/configs/linux-cell index e89a08cd93..306b9e01f4 100644 --- a/configs/linux-cell +++ b/configs/linux-cell @@ -37,7 +37,7 @@ CXXFLAGS = $(COMMON_C_CPP_FLAGS) # Omitting glw here: -SRC_DIRS = glsl mesa gallium gallium/winsys glu glut/glx glew +SRC_DIRS = glsl mesa gallium gallium/winsys gallium/targets glu glut/glx glew # Build no traditional Mesa drivers: DRIVER_DIRS = diff --git a/configs/linux-dri b/configs/linux-dri index e8e8ccfcf9..ae33973000 100644 --- a/configs/linux-dri +++ b/configs/linux-dri @@ -60,6 +60,7 @@ EGL_DRIVERS_DIRS = glx DRIVER_DIRS = dri WINDOW_SYSTEM = dri GALLIUM_WINSYS_DIRS = drm +GALLIUM_TARGET_DIRS = GALLIUM_WINSYS_DRM_DIRS = vmware intel i965 GALLIUM_STATE_TRACKERS_DIRS = egl diff --git a/configs/linux-egl b/configs/linux-egl index 2c2834b81d..9d898182fc 100644 --- a/configs/linux-egl +++ b/configs/linux-egl @@ -47,11 +47,12 @@ GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \ # Directories -SRC_DIRS = gallium mesa gallium/winsys glu egl +SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl PROGRAM_DIRS = egl DRIVER_DIRS = dri WINDOW_SYSTEM = dri GALLIUM_WINSYS_DIRS = egl_drm +GALLIUM_TARGET_DIRS = DRI_DIRS = intel diff --git a/configs/linux-i965 b/configs/linux-i965 index e66abc347b..7656a2adc5 100644 --- a/configs/linux-i965 +++ b/configs/linux-i965 @@ -6,3 +6,4 @@ CONFIG_NAME = linux-i965 GALLIUM_DRIVER_DIRS = i965 GALLIUM_WINSYS_DIRS = drm/i965/xlib +GALLIUM_TARGET_DIRS = diff --git a/configs/linux-opengl-es b/configs/linux-opengl-es index 259c26a931..76054aad14 100644 --- a/configs/linux-opengl-es +++ b/configs/linux-opengl-es @@ -6,7 +6,7 @@ CONFIG_NAME = linux-opengl-es # Directories to build LIB_DIR = lib -SRC_DIRS = egl glsl mesa/es gallium gallium/winsys +SRC_DIRS = egl glsl mesa/es gallium gallium/winsys gallium/targets PROGRAM_DIRS = es1/screen es1/xegl es2/xegl # egl st needs this diff --git a/src/gallium/include/state_tracker/xlib_sw_winsys.h b/src/gallium/include/state_tracker/xlib_sw_winsys.h index 71d39b9cdb..c703d3b66c 100644 --- a/src/gallium/include/state_tracker/xlib_sw_winsys.h +++ b/src/gallium/include/state_tracker/xlib_sw_winsys.h @@ -4,7 +4,9 @@ #include "state_tracker/sw_winsys.h" #include -struct sw_winsys *xlib_create_sw_winsys( Display *display ); + +struct pipe_screen; +struct pipe_surface; /* This is what the xlib software winsys expects to find in the * "private" field of flush_frontbuffers(). Xlib-based state trackers @@ -17,9 +19,16 @@ struct xlib_drawable { GC gc; /* temporary? */ }; -void -xlib_sw_display(struct xlib_drawable *xm_buffer, - struct sw_displaytarget *dt); +struct xm_driver { + struct pipe_screen *(*create_pipe_screen)( Display *display ); + + void (*display_surface)( struct xlib_drawable *, + struct pipe_surface * ); +}; + +/* Called by the libgl-xlib target code to build the rendering stack. + */ +struct xm_driver *xlib_sw_winsys_init( void ); #endif diff --git a/src/gallium/state_trackers/glx/xlib/SConscript b/src/gallium/state_trackers/glx/xlib/SConscript index fa96df357d..bb20235150 100644 --- a/src/gallium/state_trackers/glx/xlib/SConscript +++ b/src/gallium/state_trackers/glx/xlib/SConscript @@ -13,8 +13,6 @@ if env['platform'] == 'linux' \ '#/src/mesa/main', ]) - env.Append(CPPDEFINES = ['USE_XSHM']) - st_xlib = env.ConvenienceLibrary( target = 'st_xlib', source = [ diff --git a/src/gallium/state_trackers/glx/xlib/xm_winsys.h b/src/gallium/state_trackers/glx/xlib/xm_winsys.h index fc4444bee0..648f1c90ef 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_winsys.h +++ b/src/gallium/state_trackers/glx/xlib/xm_winsys.h @@ -34,17 +34,6 @@ struct pipe_screen; struct pipe_surface; struct xlib_drawable; -#include - -struct xm_driver { - - struct pipe_screen *(*create_pipe_screen)( Display *display ); - - void (*display_surface)( struct xlib_drawable *, - struct pipe_surface * ); - -}; - extern void xmesa_set_driver( const struct xm_driver *driver ); diff --git a/src/gallium/targets/Makefile b/src/gallium/targets/Makefile new file mode 100644 index 0000000000..a0bc5eb14f --- /dev/null +++ b/src/gallium/targets/Makefile @@ -0,0 +1,12 @@ +# src/gallium/winsys/Makefile +TOP = ../../.. +include $(TOP)/configs/current + +SUBDIRS = $(GALLIUM_TARGET_DIRS) + +default install clean: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) $@) || exit 1; \ + fi \ + done diff --git a/src/gallium/targets/SConscript b/src/gallium/targets/SConscript new file mode 100644 index 0000000000..46cbe656f4 --- /dev/null +++ b/src/gallium/targets/SConscript @@ -0,0 +1,16 @@ +Import('*') + +#if env['dri']: +# SConscript([ +# 'drm/SConscript', +# ]) + +if 'xlib' in env['winsys']: + SConscript([ + 'libgl-xlib/SConscript', + ]) + +#if 'gdi' in env['winsys']: +# SConscript([ +# 'gdi/SConscript', +# ]) diff --git a/src/gallium/targets/libgl-xlib/Makefile b/src/gallium/targets/libgl-xlib/Makefile new file mode 100644 index 0000000000..8ffe4dbf24 --- /dev/null +++ b/src/gallium/targets/libgl-xlib/Makefile @@ -0,0 +1,98 @@ +# src/gallium/targets/libgl-xlib/Makefile + +# This makefile produces a "stand-alone" libGL.so which is based on +# Xlib (no DRI HW acceleration) + + +TOP = ../../../.. +include $(TOP)/configs/current + + +GL_MAJOR = 1 +GL_MINOR = 5 +GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + + +INCLUDE_DIRS = \ + -I$(TOP)/include \ + -I$(TOP)/src/mesa \ + -I$(TOP)/src/mesa/main \ + -I$(TOP)/src/gallium/include \ + -I$(TOP)/src/gallium/drivers \ + -I$(TOP)/src/gallium/state_trackers/glx/xlib \ + -I$(TOP)/src/gallium/auxiliary + +DEFINES += \ + -DGALLIUM_SOFTPIPE +#-DGALLIUM_CELL will be defined by the config */ + +XLIB_TARGET_SOURCES = \ + xlib.c + + +XLIB_TARGET_OBJECTS = $(XLIB_TARGET_SOURCES:.c=.o) + + +# Note: CELL_SPU_LIB is only defined for cell configs + +LIBS = \ + $(GALLIUM_DRIVERS) \ + $(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \ + $(TOP)/src/gallium/winsys/xlib/libws_xlib.a \ + $(TOP)/src/mesa/libglapi.a \ + $(TOP)/src/mesa/libmesagallium.a \ + $(GALLIUM_AUXILIARIES) \ + $(CELL_SPU_LIB) \ + + +.SUFFIXES : .cpp + +.c.o: + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ + +.cpp.o: + $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@ + + + +default: $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME) + +$(TOP)/$(LIB_DIR)/gallium: + @ mkdir -p $(TOP)/$(LIB_DIR)/gallium + +# Make the libGL.so library +$(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_TARGET_OBJECTS) $(LIBS) Makefile + $(TOP)/bin/mklib -o $(GL_LIB) \ + -linker "$(CC)" \ + -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ + -install $(TOP)/$(LIB_DIR)/gallium \ + $(MKLIB_OPTIONS) $(XLIB_TARGET_OBJECTS) \ + -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS) + + +depend: $(XLIB_TARGET_SOURCES) + @ echo "running $(MKDEP)" + @ rm -f depend # workaround oops on gutsy?!? + @ touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(XLIB_TARGET_SOURCES) \ + > /dev/null 2>/dev/null + + +install: default + $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL + $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) + $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL + @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ + $(MINSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \ + fi + + +# Emacs tags +tags: + etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h + +clean: + -rm -f *.o + + +include depend diff --git a/src/gallium/targets/libgl-xlib/SConscript b/src/gallium/targets/libgl-xlib/SConscript new file mode 100644 index 0000000000..92e508ee50 --- /dev/null +++ b/src/gallium/targets/libgl-xlib/SConscript @@ -0,0 +1,64 @@ +####################################################################### +# SConscript for xlib winsys + +Import('*') + +if env['platform'] != 'linux': + Return() + +if 'mesa' not in env['statetrackers']: + print 'warning: Mesa state tracker disabled: skipping build of xlib libGL.so' + Return() + +if env['dri']: + print 'warning: DRI enabled: skipping build of xlib libGL.so' + Return() + +if not set(('softpipe', 'llvmpipe', 'cell')).intersection(env['drivers']): + print 'warning: no supported pipe driver: skipping build of xlib libGL.so' + Return() + +env = env.Clone() + +env.Append(CPPPATH = [ + '#/src/mesa', + '#/src/mesa/main', + '#src/gallium/state_trackers/glx/xlib', +]) + +env.Append(CPPDEFINES = ['USE_XSHM']) + +sources = [ + 'xlib.c', +] + +drivers = [trace] + +if 'softpipe' in env['drivers']: + env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') + sources += ['xlib_softpipe.c', 'xlib_sw_winsys.c'] + drivers += [softpipe] + +if 'llvmpipe' in env['drivers']: + env.Tool('llvm') + if 'LLVM_VERSION' in env: + env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') + env.Tool('udis86') + sources += ['xlib_llvmpipe.c', 'xlib_sw_winsys.c'] + drivers += [llvmpipe] + +if 'cell' in env['drivers']: + env.Append(CPPDEFINES = 'GALLIUM_CELL') + sources += ['xlib_cell.c'] + drivers += [cell] + +# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions +libgl = env.SharedLibrary( + target ='GL', + source = sources, + LIBS = st_xlib + glapi + mesa + glsl + drivers + gallium + env['LIBS'], +) + +if not env['dri']: + # Only install this libGL.so if DRI not enabled + env.InstallSharedLibrary(libgl, version=(1, 5)) diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c new file mode 100644 index 0000000000..7cae0884e8 --- /dev/null +++ b/src/gallium/targets/libgl-xlib/xlib.c @@ -0,0 +1,104 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/* + * Authors: + * Keith Whitwell + */ + +#include "state_tracker/xlib_sw_winsys.h" +#include "xm_winsys.h" +#include "util/u_debug.h" + + +/* advertise OpenGL support */ +PUBLIC const int st_api_OpenGL = 1; + +static void _init( void ) __attribute__((constructor)); + +/* Build the rendering stack. + */ +static void _init( void ) +{ + struct xm_driver *driver; + + /* Initialize the xlib software winsys. Later on, once Display and + * other parameters are known, this will be used to create the + * gallium driver (such as softpipe), etc. + */ + driver = xlib_sw_winsys_init(); + + /* Initialize the xlib libgl code, pass in the winsys: + */ + xmesa_set_driver( driver ); +} + + +/*********************************************************************** + * + * Butt-ugly hack to convince the linker not to throw away public GL + * symbols (they are all referenced from getprocaddress, I guess). + */ +extern void (*linker_foo(const unsigned char *procName))(); +extern void (*glXGetProcAddress(const unsigned char *procName))(); + +extern void (*linker_foo(const unsigned char *procName))() +{ + return glXGetProcAddress(procName); +} + + +/** + * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in + * libglapi.a. We need to define them here. + */ +#ifdef GLX_INDIRECT_RENDERING + +#define GL_GLEXT_PROTOTYPES +#include "GL/gl.h" +#include "glapi/glapi.h" +#include "glapi/glapitable.h" +#include "glapi/glapidispatch.h" + +#if defined(USE_MGL_NAMESPACE) +#define NAME(func) mgl##func +#else +#define NAME(func) gl##func +#endif + +#define DISPATCH(FUNC, ARGS, MESSAGE) \ + CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ + return CALL_ ## FUNC(GET_DISPATCH(), ARGS); + +/* skip normal ones */ +#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS +#include "glapi/glapitemp.h" + +#endif /* GLX_INDIRECT_RENDERING */ diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 129300423a..056b6a308f 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -1,101 +1,19 @@ -# src/gallium/winsys/xlib/Makefile - -# This makefile produces a "stand-alone" libGL.so which is based on -# Xlib (no DRI HW acceleration) - - TOP = ../../../.. include $(TOP)/configs/current +LIBNAME = ws_xlib -GL_MAJOR = 1 -GL_MINOR = 5 -GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) - - -INCLUDE_DIRS = \ - -I$(TOP)/include \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ +LIBRARY_INCLUDES = \ -I$(TOP)/src/gallium/include \ -I$(TOP)/src/gallium/drivers \ - -I$(TOP)/src/gallium/state_trackers/glx/xlib \ -I$(TOP)/src/gallium/auxiliary -DEFINES += \ - -DGALLIUM_SOFTPIPE -#-DGALLIUM_CELL will be defined by the config */ - -XLIB_WINSYS_SOURCES = \ - xlib.c \ +C_SOURCES = \ xlib_cell.c \ xlib_sw_winsys.c \ xlib_llvmpipe.c \ xlib_softpipe.c - -XLIB_WINSYS_OBJECTS = $(XLIB_WINSYS_SOURCES:.c=.o) - - -# Note: CELL_SPU_LIB is only defined for cell configs - -LIBS = \ - $(GALLIUM_DRIVERS) \ - $(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \ - $(TOP)/src/mesa/libglapi.a \ - $(TOP)/src/mesa/libmesagallium.a \ - $(GALLIUM_AUXILIARIES) \ - $(CELL_SPU_LIB) \ - - -.SUFFIXES : .cpp - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ - -.cpp.o: - $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@ - - - -default: $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME) - -$(TOP)/$(LIB_DIR)/gallium: - @ mkdir -p $(TOP)/$(LIB_DIR)/gallium - -# Make the libGL.so library -$(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefile - $(TOP)/bin/mklib -o $(GL_LIB) \ - -linker "$(CC)" \ - -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ - -install $(TOP)/$(LIB_DIR)/gallium \ - $(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \ - -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS) - - -depend: $(XLIB_WINSYS_SOURCES) - @ echo "running $(MKDEP)" - @ rm -f depend # workaround oops on gutsy?!? - @ touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(XLIB_WINSYS_SOURCES) \ - > /dev/null 2>/dev/null - - -install: default - $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL - $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) - $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL - @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ - $(MINSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \ - fi - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h - -clean: - -rm -f *.o +include ../../Makefile.template -include depend diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index 92e508ee50..26a13e42b5 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -1,64 +1,29 @@ ####################################################################### # SConscript for xlib winsys -Import('*') - -if env['platform'] != 'linux': - Return() - -if 'mesa' not in env['statetrackers']: - print 'warning: Mesa state tracker disabled: skipping build of xlib libGL.so' - Return() - -if env['dri']: - print 'warning: DRI enabled: skipping build of xlib libGL.so' - Return() - -if not set(('softpipe', 'llvmpipe', 'cell')).intersection(env['drivers']): - print 'warning: no supported pipe driver: skipping build of xlib libGL.so' - Return() - -env = env.Clone() -env.Append(CPPPATH = [ - '#/src/mesa', - '#/src/mesa/main', - '#src/gallium/state_trackers/glx/xlib', -]) - -env.Append(CPPDEFINES = ['USE_XSHM']) - -sources = [ - 'xlib.c', -] - -drivers = [trace] - -if 'softpipe' in env['drivers']: - env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') - sources += ['xlib_softpipe.c', 'xlib_sw_winsys.c'] - drivers += [softpipe] - -if 'llvmpipe' in env['drivers']: - env.Tool('llvm') - if 'LLVM_VERSION' in env: - env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') - env.Tool('udis86') - sources += ['xlib_llvmpipe.c', 'xlib_sw_winsys.c'] - drivers += [llvmpipe] - -if 'cell' in env['drivers']: - env.Append(CPPDEFINES = 'GALLIUM_CELL') - sources += ['xlib_cell.c'] - drivers += [cell] - -# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions -libgl = env.SharedLibrary( - target ='GL', - source = sources, - LIBS = st_xlib + glapi + mesa + glsl + drivers + gallium + env['LIBS'], -) +Import('*') -if not env['dri']: - # Only install this libGL.so if DRI not enabled - env.InstallSharedLibrary(libgl, version=(1, 5)) +if env['platform'] == 'linux' \ + and 'mesa' in env['statetrackers']: + + env = env.Clone() + + env.Append(CPPPATH = [ + '#/src/gallium/include', + '#/src/gallium/auxiliary', + '#/src/gallium/drivers', + ]) + + env.Append(CPPDEFINES = ['USE_XSHM']) + + st_xlib = env.ConvenienceLibrary( + target = 'ws_xlib', + source = [ + 'xlib_cell.c', + 'xlib_llvmpipe.c', + 'xlib_softpipe.c', + 'xlib_sw_winsys.c', + ] + ) + Export('ws_xlib') diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c deleted file mode 100644 index 9b91c980d1..0000000000 --- a/src/gallium/winsys/xlib/xlib.c +++ /dev/null @@ -1,136 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/* - * Authors: - * Keith Whitwell - */ - -#include "xlib.h" -#include "xm_winsys.h" -#include "util/u_debug.h" - -/* Todo, replace all this with callback-structs provided by the - * individual implementations. - */ - -enum mode { - MODE_CELL, - MODE_LLVMPIPE, - MODE_SOFTPIPE -}; - -/* advertise OpenGL support */ -PUBLIC const int st_api_OpenGL = 1; - -static enum mode get_mode() -{ -#ifdef GALLIUM_CELL - if (!getenv("GALLIUM_NOCELL")) - return MODE_CELL; -#endif - -#if defined(GALLIUM_LLVMPIPE) - return MODE_LLVMPIPE; -#else - return MODE_SOFTPIPE; -#endif -} - -static void _init( void ) __attribute__((constructor)); - -static void _init( void ) -{ - enum mode xlib_mode = get_mode(); - - switch (xlib_mode) { - case MODE_CELL: -#if defined(GALLIUM_CELL) - xmesa_set_driver( &xlib_cell_driver ); -#endif - break; - case MODE_LLVMPIPE: -#if defined(GALLIUM_LLVMPIPE) - xmesa_set_driver( &xlib_llvmpipe_driver ); -#endif - break; - case MODE_SOFTPIPE: -#if defined(GALLIUM_SOFTPIPE) - xmesa_set_driver( &xlib_softpipe_driver ); -#endif - break; - default: - assert(0); - break; - } -} - - -/*********************************************************************** - * - * Butt-ugly hack to convince the linker not to throw away public GL - * symbols (they are all referenced from getprocaddress, I guess). - */ -extern void (*linker_foo(const unsigned char *procName))(); -extern void (*glXGetProcAddress(const unsigned char *procName))(); - -extern void (*linker_foo(const unsigned char *procName))() -{ - return glXGetProcAddress(procName); -} - - -/** - * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in - * libglapi.a. We need to define them here. - */ -#ifdef GLX_INDIRECT_RENDERING - -#define GL_GLEXT_PROTOTYPES -#include "GL/gl.h" -#include "glapi/glapi.h" -#include "glapi/glapitable.h" -#include "glapi/glapidispatch.h" - -#if defined(USE_MGL_NAMESPACE) -#define NAME(func) mgl##func -#else -#define NAME(func) gl##func -#endif - -#define DISPATCH(FUNC, ARGS, MESSAGE) \ - CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \ - return CALL_ ## FUNC(GET_DISPATCH(), ARGS); - -/* skip normal ones */ -#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS -#include "glapi/glapitemp.h" - -#endif /* GLX_INDIRECT_RENDERING */ diff --git a/src/gallium/winsys/xlib/xlib.h b/src/gallium/winsys/xlib/xlib.h index 8e091d0c08..3c20048616 100644 --- a/src/gallium/winsys/xlib/xlib.h +++ b/src/gallium/winsys/xlib/xlib.h @@ -3,11 +3,16 @@ #define XLIB_H #include "pipe/p_compiler.h" -#include "xm_winsys.h" +#include "state_tracker/xlib_sw_winsys.h" extern struct xm_driver xlib_softpipe_driver; extern struct xm_driver xlib_llvmpipe_driver; extern struct xm_driver xlib_cell_driver; +struct sw_winsys *xlib_create_sw_winsys( Display *display ); + +void xlib_sw_display(struct xlib_drawable *xm_buffer, + struct sw_displaytarget *dt); + #endif diff --git a/src/gallium/winsys/xlib/xlib_brw_context.c b/src/gallium/winsys/xlib/xlib_brw_context.c deleted file mode 100644 index 22bf41a46f..0000000000 --- a/src/gallium/winsys/xlib/xlib_brw_context.c +++ /dev/null @@ -1,209 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/* - * Authors: - * Keith Whitwell - * Brian Paul - */ - - -/* #include "glxheader.h" */ -/* #include "xmesaP.h" */ - -#include "util/u_simple_screen.h" -#include "util/u_inlines.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "i965simple/brw_winsys.h" -#include "xlib_brw_aub.h" -#include "xlib_brw.h" - - - - -#define XBCWS_BATCHBUFFER_SIZE 1024 - - -/* The backend to the brw driver (ie struct brw_winsys) is actually a - * per-context entity. - */ -struct xlib_brw_context_winsys { - struct brw_winsys brw_context_winsys; /**< batch buffer funcs */ - struct aub_context *aub; - - struct pipe_winsys *pipe_winsys; - - unsigned batch_data[XBCWS_BATCHBUFFER_SIZE]; - unsigned batch_nr; - unsigned batch_size; - unsigned batch_alloc; -}; - - -/* Turn a brw_winsys into an xlib_brw_context_winsys: - */ -static inline struct xlib_brw_context_winsys * -xlib_brw_context_winsys( struct brw_winsys *sws ) -{ - return (struct xlib_brw_context_winsys *)sws; -} - - -/* Simple batchbuffer interface: - */ - -static unsigned *xbcws_batch_start( struct brw_winsys *sws, - unsigned dwords, - unsigned relocs ) -{ - struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws); - - if (xbcws->batch_size < xbcws->batch_nr + dwords) - return NULL; - - xbcws->batch_alloc = xbcws->batch_nr + dwords; - return (void *)1; /* not a valid pointer! */ -} - -static void xbcws_batch_dword( struct brw_winsys *sws, - unsigned dword ) -{ - struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws); - - assert(xbcws->batch_nr < xbcws->batch_alloc); - xbcws->batch_data[xbcws->batch_nr++] = dword; -} - -static void xbcws_batch_reloc( struct brw_winsys *sws, - struct pipe_buffer *buf, - unsigned access_flags, - unsigned delta ) -{ - struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws); - - assert(xbcws->batch_nr < xbcws->batch_alloc); - xbcws->batch_data[xbcws->batch_nr++] = - ( xlib_brw_get_buffer_offset( NULL, buf, access_flags ) + - delta ); -} - -static void xbcws_batch_end( struct brw_winsys *sws ) -{ - struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws); - - assert(xbcws->batch_nr <= xbcws->batch_alloc); - xbcws->batch_alloc = 0; -} - -static void xbcws_batch_flush( struct brw_winsys *sws, - struct pipe_fence_handle **fence ) -{ - struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws); - assert(xbcws->batch_nr <= xbcws->batch_size); - - if (xbcws->batch_nr) { - xlib_brw_commands_aub( xbcws->pipe_winsys, - xbcws->batch_data, - xbcws->batch_nr ); - } - - xbcws->batch_nr = 0; -} - - - -/* Really a per-device function, just pass through: - */ -static unsigned xbcws_get_buffer_offset( struct brw_winsys *sws, - struct pipe_buffer *buf, - unsigned access_flags ) -{ - struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws); - - return xlib_brw_get_buffer_offset( xbcws->pipe_winsys, - buf, - access_flags ); -} - - -/* Really a per-device function, just pass through: - */ -static void xbcws_buffer_subdata_typed( struct brw_winsys *sws, - struct pipe_buffer *buf, - unsigned long offset, - unsigned long size, - const void *data, - unsigned data_type ) -{ - struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws); - - xlib_brw_buffer_subdata_typed( xbcws->pipe_winsys, - buf, - offset, - size, - data, - data_type ); -} - - -/** - * Create i965 hardware rendering context, but plugged into a - * dump-to-aubfile backend. - */ -struct pipe_context * -xlib_create_brw_context( struct pipe_screen *screen, - void *unused ) -{ - struct xlib_brw_context_winsys *xbcws = CALLOC_STRUCT( xlib_brw_context_winsys ); - - /* Fill in this struct with callbacks that i965simple will need to - * communicate with the window system, buffer manager, etc. - */ - xbcws->brw_context_winsys.batch_start = xbcws_batch_start; - xbcws->brw_context_winsys.batch_dword = xbcws_batch_dword; - xbcws->brw_context_winsys.batch_reloc = xbcws_batch_reloc; - xbcws->brw_context_winsys.batch_end = xbcws_batch_end; - xbcws->brw_context_winsys.batch_flush = xbcws_batch_flush; - xbcws->brw_context_winsys.buffer_subdata_typed = xbcws_buffer_subdata_typed; - xbcws->brw_context_winsys.get_buffer_offset = xbcws_get_buffer_offset; - - xbcws->pipe_winsys = screen->winsys; /* redundant */ - - xbcws->batch_size = XBCWS_BATCHBUFFER_SIZE; - - /* Create the i965simple context: - */ -#ifdef GALLIUM_CELL - return NULL; -#else - return brw_create( screen, - &xbcws->brw_context_winsys, - 0 ); -#endif -} diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c index 21649a0b1f..3e8fefb582 100644 --- a/src/gallium/winsys/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -34,7 +34,6 @@ -#include "xm_api.h" #undef ASSERT #undef Elements -- cgit v1.2.3 From c867c58c7340eb5d56f7cc3edf95cce94600f858 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 19:21:27 +0000 Subject: gallium: make it work --- src/gallium/winsys/xlib/Makefile | 1 + src/gallium/winsys/xlib/xlib.c | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/gallium/winsys/xlib/xlib.c (limited to 'src') diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 056b6a308f..bb631b16ce 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -9,6 +9,7 @@ LIBRARY_INCLUDES = \ -I$(TOP)/src/gallium/auxiliary C_SOURCES = \ + xlib.c \ xlib_cell.c \ xlib_sw_winsys.c \ xlib_llvmpipe.c \ diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c new file mode 100644 index 0000000000..6ca9e362e7 --- /dev/null +++ b/src/gallium/winsys/xlib/xlib.c @@ -0,0 +1,49 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/* + * Authors: + * Keith Whitwell + */ + +#include "xlib.h" +#include "util/u_debug.h" + +struct xm_driver *xlib_sw_winsys_init( void ) +{ +#if defined(GALLIUM_CELL) + if (!getenv("GALLIUM_NOCELL")) + return &xlib_cell_driver; +#endif + +#if defined(GALLIUM_LLVMPIPE) + return &xlib_llvmpipe_driver; +#endif + + return &xlib_softpipe_driver; +} -- cgit v1.2.3 From 3ab8211be40e3cd835bd1f6947b2c56f9a0c7a59 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 8 Mar 2010 19:23:10 +0000 Subject: gallium: remove xlib_driver::display_surface Just use flush_frontbuffer directly. The flush_frontbuffer routine has been somewhat devalued recently, but it is actually just the right interface for our needs. It is in pipe_screen, meaning that any wrapping (eg trace module) will get properly unwrapped before we try and use the pipe_surface argument for real. If a particular co-state-tracker needs to implement this itself, it should organize a way to allow the winsys to call back up to its level, rather than hijacking the driver-supplied implementation. --- src/gallium/include/state_tracker/xlib_sw_winsys.h | 3 --- src/gallium/state_trackers/glx/xlib/xm_api.c | 10 +++------- src/gallium/winsys/xlib/xlib_llvmpipe.c | 13 ------------- src/gallium/winsys/xlib/xlib_softpipe.c | 11 ----------- 4 files changed, 3 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/gallium/include/state_tracker/xlib_sw_winsys.h b/src/gallium/include/state_tracker/xlib_sw_winsys.h index c703d3b66c..915a7b37fb 100644 --- a/src/gallium/include/state_tracker/xlib_sw_winsys.h +++ b/src/gallium/include/state_tracker/xlib_sw_winsys.h @@ -22,9 +22,6 @@ struct xlib_drawable { struct xm_driver { struct pipe_screen *(*create_pipe_screen)( Display *display ); - - void (*display_surface)( struct xlib_drawable *, - struct pipe_surface * ); }; /* Called by the libgl-xlib target code to build the rendering stack. diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index d878740ab1..d8aa59b3b7 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -1092,13 +1092,9 @@ void XMesaSwapBuffers( XMesaBuffer b ) st_swapbuffers(b->stfb, &frontLeftSurf, NULL); if (frontLeftSurf) { - if (_screen != screen) { - struct trace_surface *tr_surf = trace_surface( frontLeftSurf ); - struct pipe_surface *surf = tr_surf->surface; - frontLeftSurf = surf; - } - - driver.display_surface(&b->ws, frontLeftSurf); + screen->flush_frontbuffer( screen, + frontLeftSurf, + &b->ws ); } xmesa_check_and_update_buffer_size(NULL, b); diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c index ceefc1624c..8b66b7459d 100644 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c @@ -69,22 +69,9 @@ fail: } -static void -xlib_llvmpipe_display_surface(struct xlib_drawable *xm_buffer, - struct pipe_surface *surf) -{ - struct llvmpipe_texture *texture = llvmpipe_texture(surf->texture); - - assert(texture->dt); - if (texture->dt) - xlib_sw_display(xm_buffer, texture->dt); -} - - struct xm_driver xlib_llvmpipe_driver = { .create_pipe_screen = xlib_create_llvmpipe_screen, - .display_surface = xlib_llvmpipe_display_surface }; diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index 3b51d7c17c..08b7f08837 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -57,22 +57,11 @@ fail: } -static void -xlib_softpipe_display_surface(struct xlib_drawable *xm_buffer, - struct pipe_surface *surf) -{ - struct softpipe_texture *texture = softpipe_texture(surf->texture); - - assert(texture->dt); - if (texture->dt) - xlib_sw_display(xm_buffer, texture->dt); -} struct xm_driver xlib_softpipe_driver = { .create_pipe_screen = xlib_create_softpipe_screen, - .display_surface = xlib_softpipe_display_surface }; -- cgit v1.2.3 From 1d84808dc045d7fcf2fade8d1504bc25e7c5041a Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 8 Mar 2010 15:04:04 -0500 Subject: gallivm: fix a crash by making sure we set the has_mask flag correctly --- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index 28ff362cac..fbb664d43a 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -152,8 +152,7 @@ static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context static void lp_exec_mask_update(struct lp_exec_mask *mask) { mask->exec_mask = mask->cond_mask; - if (mask->cond_stack_size > 0) - mask->has_mask = TRUE; + mask->has_mask = (mask->cond_stack_size > 0); } static void lp_exec_mask_cond_push(struct lp_exec_mask *mask, -- cgit v1.2.3 From bc632d04370566c1156cbd0345fe303834f0b910 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 8 Mar 2010 12:12:31 -0800 Subject: i965: Fix up the handling of point sprite coordinate replacement. The code was walking over the regs of pairs of attributes and checking whether the attribute with a given reg index had point sprite enabled. So the point sprite setup code was rarely even getting executed. Instead, we need to determine which channels of a reg need point sprite coordinate replacement. In addition, it was multiplying the attribute by 1/w, when it's supposed to cover (0, 1) in each direction regardless of w, and it wasn't filling in the Z and W components of the texcoord as specified. Fixes piglit point-sprite and the spriteblast demo. Bug #24431, #22245. --- src/mesa/drivers/dri/i965/brw_sf.c | 21 ++--- src/mesa/drivers/dri/i965/brw_sf.h | 6 +- src/mesa/drivers/dri/i965/brw_sf_emit.c | 135 ++++++++++++++++++++------------ 3 files changed, 96 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index 8e6839b812..57d1c29ade 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -46,7 +46,6 @@ static void compile_sf_prog( struct brw_context *brw, struct brw_sf_prog_key *key ) { - GLcontext *ctx = &brw->intel.ctx; struct brw_sf_compile c; const GLuint *program; GLuint program_size; @@ -69,20 +68,14 @@ static void compile_sf_prog( struct brw_context *brw, /* Construct map from attribute number to position in the vertex. */ - for (i = idx = 0; i < VERT_RESULT_MAX; i++) + for (i = idx = 0; i < VERT_RESULT_MAX; i++) { if (c.key.attrs & BITFIELD64_BIT(i)) { c.attr_to_idx[i] = idx; c.idx_to_attr[idx] = i; - if (i >= VERT_RESULT_TEX0 && i <= VERT_RESULT_TEX7) { - c.point_attrs[i].CoordReplace = - ctx->Point.CoordReplace[i - VERT_RESULT_TEX0]; - } - else { - c.point_attrs[i].CoordReplace = GL_FALSE; - } idx++; } - + } + /* Which primitive? Or all three? */ switch (key->primitive) { @@ -162,6 +155,14 @@ static void upload_sf_prog(struct brw_context *brw) } key.do_point_sprite = ctx->Point.PointSprite; + if (key.do_point_sprite) { + int i; + + for (i = 0; i < 8; i++) { + if (ctx->Point.CoordReplace[i]) + key.point_sprite_coord_replace |= (1 << i); + } + } key.sprite_origin_lower_left = (ctx->Point.SpriteOrigin == GL_LOWER_LEFT); /* _NEW_LIGHT */ key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT); diff --git a/src/mesa/drivers/dri/i965/brw_sf.h b/src/mesa/drivers/dri/i965/brw_sf.h index 0ba731fac9..a0680a56f2 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.h +++ b/src/mesa/drivers/dri/i965/brw_sf.h @@ -46,6 +46,7 @@ struct brw_sf_prog_key { GLbitfield64 attrs; + uint8_t point_sprite_coord_replace; GLuint primitive:2; GLuint do_twoside_color:1; GLuint do_flat_shading:1; @@ -56,10 +57,6 @@ struct brw_sf_prog_key { GLuint pad:24; }; -struct brw_sf_point_tex { - GLboolean CoordReplace; -}; - struct brw_sf_compile { struct brw_compile func; struct brw_sf_prog_key key; @@ -100,7 +97,6 @@ struct brw_sf_compile { GLubyte attr_to_idx[VERT_RESULT_MAX]; GLubyte idx_to_attr[VERT_RESULT_MAX]; - struct brw_sf_point_tex point_attrs[VERT_RESULT_MAX]; }; diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index bb08055e3b..56f7c986e7 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_emit.c +++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c @@ -354,6 +354,33 @@ static GLboolean calculate_masks( struct brw_sf_compile *c, return is_last_attr; } +/* Calculates the predicate control for which channels of a reg + * (containing 2 attrs) to do point sprite coordinate replacement on. + */ +static uint16_t +calculate_point_sprite_mask(struct brw_sf_compile *c, GLuint reg) +{ + int attr1, attr2; + uint16_t pc = 0; + + attr1 = c->idx_to_attr[reg * 2]; + if (attr1 >= VERT_RESULT_TEX0 && attr1 <= VERT_RESULT_TEX7) { + if (c->key.point_sprite_coord_replace & (1 << (attr1 - VERT_RESULT_TEX0))) + pc |= 0x0f; + } + + if (reg * 2 + 1 < c->nr_setup_attrs) { + attr2 = c->idx_to_attr[reg * 2 + 1]; + if (attr2 >= VERT_RESULT_TEX0 && attr2 <= VERT_RESULT_TEX7) { + if (c->key.point_sprite_coord_replace & (1 << (attr2 - + VERT_RESULT_TEX0))) + pc |= 0xf0; + } + } + + return pc; +} + void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) @@ -529,22 +556,27 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) copy_z_inv_w(c); for (i = 0; i < c->nr_setup_regs; i++) { - struct brw_sf_point_tex *tex = &c->point_attrs[c->idx_to_attr[2*i]]; struct brw_reg a0 = offset(c->vert[0], i); - GLushort pc, pc_persp, pc_linear; + GLushort pc, pc_persp, pc_linear, pc_coord_replace; GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); - - if (pc_persp) - { - if (!tex->CoordReplace) { - brw_set_predicate_control_flag_value(p, pc_persp); - brw_MUL(p, a0, a0, c->inv_w[0]); - } + + pc_coord_replace = calculate_point_sprite_mask(c, i); + pc_persp &= ~pc_coord_replace; + + if (pc_persp) { + brw_set_predicate_control_flag_value(p, pc_persp); + brw_MUL(p, a0, a0, c->inv_w[0]); } - if (tex->CoordReplace) { - /* Caculate 1.0/PointWidth */ - brw_math(&c->func, + /* Point sprite coordinate replacement: A texcoord with this + * enabled gets replaced with the value (x, y, 0, 1) where x and + * y vary from 0 to 1 across the horizontal and vertical of the + * point. + */ + if (pc_coord_replace) { + brw_set_predicate_control_flag_value(p, pc_coord_replace); + /* Caculate 1.0/PointWidth */ + brw_math(&c->func, c->tmp, BRW_MATH_FUNCTION_INV, BRW_MATH_SATURATE_NONE, @@ -553,50 +585,51 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) BRW_MATH_DATA_SCALAR, BRW_MATH_PRECISION_FULL); - if (c->key.sprite_origin_lower_left) { - brw_MUL(p, c->m1Cx, c->tmp, c->inv_w[0]); - brw_MOV(p, vec1(suboffset(c->m1Cx, 1)), brw_imm_f(0.0)); - brw_MUL(p, c->m2Cy, c->tmp, negate(c->inv_w[0])); - brw_MOV(p, vec1(suboffset(c->m2Cy, 0)), brw_imm_f(0.0)); - } else { - brw_MUL(p, c->m1Cx, c->tmp, c->inv_w[0]); - brw_MOV(p, vec1(suboffset(c->m1Cx, 1)), brw_imm_f(0.0)); - brw_MUL(p, c->m2Cy, c->tmp, c->inv_w[0]); - brw_MOV(p, vec1(suboffset(c->m2Cy, 0)), brw_imm_f(0.0)); - } - } else { - brw_MOV(p, c->m1Cx, brw_imm_ud(0)); - brw_MOV(p, c->m2Cy, brw_imm_ud(0)); - } + brw_set_access_mode(p, BRW_ALIGN_16); - { - brw_set_predicate_control_flag_value(p, pc); - if (tex->CoordReplace) { - if (c->key.sprite_origin_lower_left) { - brw_MUL(p, c->m3C0, c->inv_w[0], brw_imm_f(1.0)); - brw_MOV(p, vec1(suboffset(c->m3C0, 0)), brw_imm_f(0.0)); - } - else - brw_MOV(p, c->m3C0, brw_imm_f(0.0)); + /* dA/dx, dA/dy */ + brw_MOV(p, c->m1Cx, brw_imm_f(0.0)); + brw_MOV(p, c->m2Cy, brw_imm_f(0.0)); + brw_MOV(p, brw_writemask(c->m1Cx, WRITEMASK_X), c->tmp); + if (c->key.sprite_origin_lower_left) { + brw_MOV(p, brw_writemask(c->m2Cy, WRITEMASK_Y), negate(c->tmp)); } else { - brw_MOV(p, c->m3C0, a0); /* constant value */ + brw_MOV(p, brw_writemask(c->m2Cy, WRITEMASK_Y), c->tmp); } - /* Copy m0..m3 to URB. - */ - brw_urb_WRITE(p, - brw_null_reg(), - 0, - brw_vec8_grf(0, 0), - 0, /* allocate */ - 1, /* used */ - 4, /* msg len */ - 0, /* response len */ - last, /* eot */ - last, /* writes complete */ - i*4, /* urb destination offset */ - BRW_URB_SWIZZLE_TRANSPOSE); + /* attribute constant offset */ + brw_MOV(p, c->m3C0, brw_imm_f(0.0)); + if (c->key.sprite_origin_lower_left) { + brw_MOV(p, brw_writemask(c->m3C0, WRITEMASK_YW), brw_imm_f(1.0)); + } else { + brw_MOV(p, brw_writemask(c->m3C0, WRITEMASK_W), brw_imm_f(1.0)); + } + + brw_set_access_mode(p, BRW_ALIGN_1); } + + if (pc & ~pc_coord_replace) { + brw_set_predicate_control_flag_value(p, pc & ~pc_coord_replace); + brw_MOV(p, c->m1Cx, brw_imm_ud(0)); + brw_MOV(p, c->m2Cy, brw_imm_ud(0)); + brw_MOV(p, c->m3C0, a0); /* constant value */ + } + + + brw_set_predicate_control_flag_value(p, pc); + /* Copy m0..m3 to URB. */ + brw_urb_WRITE(p, + brw_null_reg(), + 0, + brw_vec8_grf(0, 0), + 0, /* allocate */ + 1, /* used */ + 4, /* msg len */ + 0, /* response len */ + last, /* eot */ + last, /* writes complete */ + i*4, /* urb destination offset */ + BRW_URB_SWIZZLE_TRANSPOSE); } } -- cgit v1.2.3 From e3b6f7b8003a8838da2a219f62d6c025a87e9396 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 13:25:28 -0700 Subject: llvmpipe: rewrap for 80 columns --- src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c index 632462460a..fde2d653eb 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c @@ -51,10 +51,11 @@ /** - * This provides the bridge between the sampler state store in lp_jit_context - * and lp_jit_texture and the sampler code generator. It provides the - * texture layout information required by the texture sampler code generator - * in terms of the state stored in lp_jit_context and lp_jit_texture in runtime. + * This provides the bridge between the sampler state store in + * lp_jit_context and lp_jit_texture and the sampler code + * generator. It provides the texture layout information required by + * the texture sampler code generator in terms of the state stored in + * lp_jit_context and lp_jit_texture in runtime. */ struct llvmpipe_sampler_dynamic_state { @@ -89,7 +90,8 @@ lp_llvm_texture_member(struct lp_sampler_dynamic_state *base, unsigned member_index, const char *member_name) { - struct llvmpipe_sampler_dynamic_state *state = (struct llvmpipe_sampler_dynamic_state *)base; + struct llvmpipe_sampler_dynamic_state *state = + (struct llvmpipe_sampler_dynamic_state *)base; LLVMValueRef indices[4]; LLVMValueRef ptr; LLVMValueRef res; @@ -116,11 +118,13 @@ lp_llvm_texture_member(struct lp_sampler_dynamic_state *base, /** - * Helper macro to instantiate the functions that generate the code to fetch - * the members of lp_jit_texture to fulfill the sampler code generator requests. + * Helper macro to instantiate the functions that generate the code to + * fetch the members of lp_jit_texture to fulfill the sampler code + * generator requests. * - * This complexity is the price we have to pay to keep the texture sampler code - * generator a reusable module without dependencies to llvmpipe internals. + * This complexity is the price we have to pay to keep the texture + * sampler code generator a reusable module without dependencies to + * llvmpipe internals. */ #define LP_LLVM_TEXTURE_MEMBER(_name, _index) \ static LLVMValueRef \ -- cgit v1.2.3 From d73fadf2116f5459f18bd84f48e7ed86773797b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 13:36:34 -0700 Subject: llvmpipe: define max texture levels --- src/gallium/drivers/llvmpipe/lp_screen.c | 6 +++--- src/gallium/drivers/llvmpipe/lp_texture.h | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index f84ede675b..2c6fd67eae 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -107,11 +107,11 @@ llvmpipe_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_TEXTURE_SHADOW_MAP: return 1; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: - return 13; /* max 4Kx4K */ + return LP_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: - return 9; /* max 256x256x256 */ + return LP_MAX_TEXTURE_3D_LEVELS; case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: - return 13; /* max 4Kx4K */ + return LP_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_TGSI_CONT_SUPPORTED: return 1; case PIPE_CAP_BLEND_EQUATION_SEPARATE: diff --git a/src/gallium/drivers/llvmpipe/lp_texture.h b/src/gallium/drivers/llvmpipe/lp_texture.h index 87c905bc02..c511a01298 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.h +++ b/src/gallium/drivers/llvmpipe/lp_texture.h @@ -32,6 +32,10 @@ #include "pipe/p_state.h" +#define LP_MAX_TEXTURE_2D_LEVELS 13 /* 4K x 4K for now */ +#define LP_MAX_TEXTURE_3D_LEVELS 10 /* 512 x 512 x 512 for now */ + + struct pipe_context; struct pipe_screen; struct llvmpipe_context; @@ -42,8 +46,8 @@ struct llvmpipe_texture { struct pipe_texture base; - unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS]; - unsigned stride[PIPE_MAX_TEXTURE_LEVELS]; + unsigned long level_offset[LP_MAX_TEXTURE_2D_LEVELS]; + unsigned stride[LP_MAX_TEXTURE_2D_LEVELS]; /** * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET -- cgit v1.2.3 From 44eec2802323b1e6cb47dfcf0aeab6b4cfd1c110 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 13:56:44 -0700 Subject: softpipe: define SP_MAX_TEXTURE_2D/3D_LEVELS --- src/gallium/drivers/softpipe/sp_screen.c | 6 +++--- src/gallium/drivers/softpipe/sp_texture.h | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 6ec63fe698..3405a043c6 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -83,11 +83,11 @@ softpipe_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_TEXTURE_SHADOW_MAP: return 1; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: - return 13; /* max 4Kx4K */ + return SP_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: - return 9; /* max 256x256x256 */ + return SP_MAX_TEXTURE_3D_LEVELS; case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: - return 13; /* max 4Kx4K */ + return SP_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_TGSI_CONT_SUPPORTED: return 1; case PIPE_CAP_BLEND_EQUATION_SEPARATE: diff --git a/src/gallium/drivers/softpipe/sp_texture.h b/src/gallium/drivers/softpipe/sp_texture.h index 2ef64e1e7c..b54cf33ef5 100644 --- a/src/gallium/drivers/softpipe/sp_texture.h +++ b/src/gallium/drivers/softpipe/sp_texture.h @@ -33,6 +33,10 @@ #include "pipe/p_video_state.h" +#define SP_MAX_TEXTURE_2D_LEVELS 13 /* 4K x 4K */ +#define SP_MAX_TEXTURE_3D_LEVELS 9 /* 512 x 512 x 512 */ + + struct pipe_context; struct pipe_screen; struct softpipe_context; @@ -42,8 +46,8 @@ struct softpipe_texture { struct pipe_texture base; - unsigned long level_offset[PIPE_MAX_TEXTURE_LEVELS]; - unsigned stride[PIPE_MAX_TEXTURE_LEVELS]; + unsigned long level_offset[SP_MAX_TEXTURE_2D_LEVELS]; + unsigned stride[SP_MAX_TEXTURE_2D_LEVELS]; /* The data is held here: */ -- cgit v1.2.3 From e836f35369784fd90657252dcaf75e66f2369068 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 13:57:14 -0700 Subject: i965g: define BRW_MAX_TEXTURE_2D/3D_LEVELS --- src/gallium/drivers/i965/brw_screen.c | 6 +++--- src/gallium/drivers/i965/brw_screen.h | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c index 66f3aad8b2..cef83ffea8 100644 --- a/src/gallium/drivers/i965/brw_screen.c +++ b/src/gallium/drivers/i965/brw_screen.c @@ -174,11 +174,11 @@ brw_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_TEXTURE_SHADOW_MAP: return 1; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: - return 11; /* max 1024x1024 */ + return BRW_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: - return 8; /* max 128x128x128 */ + return BRW_MAX_TEXTURE_3D_LEVELS; case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: - return 11; /* max 1024x1024 */ + return BRW_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER: return 1; diff --git a/src/gallium/drivers/i965/brw_screen.h b/src/gallium/drivers/i965/brw_screen.h index 7226d9228b..e0f3cd2a9f 100644 --- a/src/gallium/drivers/i965/brw_screen.h +++ b/src/gallium/drivers/i965/brw_screen.h @@ -100,6 +100,9 @@ struct brw_surface }; +#define BRW_MAX_TEXTURE_2D_LEVELS 11 /* max 1024x1024 */ +#define BRW_MAX_TEXTURE_3D_LEVELS 8 /* max 128x128x128 */ + struct brw_texture { @@ -107,9 +110,9 @@ struct brw_texture struct brw_winsys_buffer *bo; struct brw_surface_state ss; - unsigned *image_offset[PIPE_MAX_TEXTURE_LEVELS]; - unsigned nr_images[PIPE_MAX_TEXTURE_LEVELS]; - unsigned level_offset[PIPE_MAX_TEXTURE_LEVELS]; + unsigned *image_offset[BRW_MAX_TEXTURE_2D_LEVELS]; + unsigned nr_images[BRW_MAX_TEXTURE_2D_LEVELS]; + unsigned level_offset[BRW_MAX_TEXTURE_2D_LEVELS]; boolean compressed; unsigned brw_target; -- cgit v1.2.3 From e0d4f3202e213ae790a272eba7e96a40f68a6822 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 13:59:39 -0700 Subject: i915g: define I915_MAX_TEXTURE_2D/3D_LEVELS --- src/gallium/drivers/i915/i915_context.h | 7 +++++-- src/gallium/drivers/i915/i915_screen.c | 6 +++--- src/gallium/drivers/i915/i915_texture.c | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index da769e7b29..499a727314 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -187,6 +187,9 @@ struct i915_sampler_state { unsigned maxlod; }; +#define I915_MAX_TEXTURE_2D_LEVELS 11 /* max 1024x1024 */ +#define I915_MAX_TEXTURE_3D_LEVELS 8 /* max 128x128x128 */ + struct i915_texture { struct pipe_texture base; @@ -199,7 +202,7 @@ struct i915_texture { unsigned sw_tiled; /**< tiled with software flags */ unsigned hw_tiled; /**< tiled with hardware fences */ - unsigned nr_images[PIPE_MAX_TEXTURE_LEVELS]; + unsigned nr_images[I915_MAX_TEXTURE_2D_LEVELS]; /* Explicitly store the offset of each image for each cube face or * depth value. Pretty much have to accept that hardware formats @@ -207,7 +210,7 @@ struct i915_texture { * compute the offsets of depth/cube images within a mipmap level, * so have to store them as a lookup table: */ - unsigned *image_offset[PIPE_MAX_TEXTURE_LEVELS]; /**< array [depth] of offsets */ + unsigned *image_offset[I915_MAX_TEXTURE_2D_LEVELS]; /**< array [depth] of offsets */ /* The data is held here: */ diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index 72bd263550..e5bf4a20bd 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -116,11 +116,11 @@ i915_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_TEXTURE_SHADOW_MAP: return 1; case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: - return 11; /* max 1024x1024 */ + return I915_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: - return 8; /* max 128x128x128 */ + return I915_MAX_TEXTURE_3D_LEVELS; case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: - return 11; /* max 1024x1024 */ + return I915_MAX_TEXTURE_2D_LEVELS; case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER: return 1; diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index 334959c46d..5b1f42313e 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -96,7 +96,7 @@ i915_miptree_set_level_info(struct i915_texture *tex, unsigned nr_images, unsigned w, unsigned h, unsigned d) { - assert(level < PIPE_MAX_TEXTURE_LEVELS); + assert(level < Elements(tex->nr_images)); tex->nr_images[level] = nr_images; @@ -775,7 +775,7 @@ i915_texture_destroy(struct pipe_texture *pt) iws->buffer_destroy(iws, tex->buffer); - for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++) + for (i = 0; i < Elements(tex->image_offset); i++) if (tex->image_offset[i]) FREE(tex->image_offset[i]); -- cgit v1.2.3 From 156585c12ea4ffc6ada703d68c80ed49137da59c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 14:00:20 -0700 Subject: svga: s/PIPE_MAX_TEXTURE_LEVELS/SVGA_MAX_TEXTURE_LEVELS/ --- src/gallium/drivers/svga/svga_screen_texture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_screen_texture.h b/src/gallium/drivers/svga/svga_screen_texture.h index 24c1f78ca5..ca6602b436 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.h +++ b/src/gallium/drivers/svga/svga_screen_texture.h @@ -78,7 +78,7 @@ struct svga_texture { struct pipe_texture base; - boolean defined[6][PIPE_MAX_TEXTURE_LEVELS]; + boolean defined[6][SVGA_MAX_TEXTURE_LEVELS]; struct svga_sampler_view *cached_view; -- cgit v1.2.3 From ac2e8491117dcf4a608eff4f52a9e34c1bea2a03 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 14:01:30 -0700 Subject: r300g: define R300_MAX_TEXTURE_LEVELS --- src/gallium/drivers/r300/r300_context.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 8c52d880a3..c2825d5f26 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -124,13 +124,15 @@ struct r300_texture_format_state { uint32_t format2; /* R300_TX_FORMAT2: 0x4500 */ }; +#define R300_MAX_TEXTURE_LEVELS 13 + struct r300_texture_fb_state { /* Colorbuffer. */ - uint32_t colorpitch[PIPE_MAX_TEXTURE_LEVELS]; /* R300_RB3D_COLORPITCH[0-3]*/ + uint32_t colorpitch[R300_MAX_TEXTURE_LEVELS]; /* R300_RB3D_COLORPITCH[0-3]*/ uint32_t us_out_fmt; /* R300_US_OUT_FMT[0-3] */ /* Zbuffer. */ - uint32_t depthpitch[PIPE_MAX_TEXTURE_LEVELS]; /* R300_RB3D_DEPTHPITCH */ + uint32_t depthpitch[R300_MAX_TEXTURE_LEVELS]; /* R300_RB3D_DEPTHPITCH */ uint32_t zb_format; /* R300_ZB_FORMAT */ }; @@ -236,16 +238,16 @@ struct r300_texture { struct pipe_texture tex; /* Offsets into the buffer. */ - unsigned offset[PIPE_MAX_TEXTURE_LEVELS]; + unsigned offset[R300_MAX_TEXTURE_LEVELS]; /* A pitch for each mip-level */ - unsigned pitch[PIPE_MAX_TEXTURE_LEVELS]; + unsigned pitch[R300_MAX_TEXTURE_LEVELS]; /* Size of one zslice or face based on the texture target */ - unsigned layer_size[PIPE_MAX_TEXTURE_LEVELS]; + unsigned layer_size[R300_MAX_TEXTURE_LEVELS]; /* Whether the mipmap level is macrotiled. */ - enum r300_buffer_tiling mip_macrotile[PIPE_MAX_TEXTURE_LEVELS]; + enum r300_buffer_tiling mip_macrotile[R300_MAX_TEXTURE_LEVELS]; /** * If non-zero, override the natural texture layout with -- cgit v1.2.3 From 891f7f4d52656ddbb445ef1992e8de05763ce680 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 14:02:38 -0700 Subject: nv: define NV30/40/50_MAX_TEXTURE_LEVELS --- src/gallium/drivers/nv30/nv30_state.h | 4 +++- src/gallium/drivers/nv40/nv40_state.h | 4 +++- src/gallium/drivers/nv50/nv50_context.h | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_state.h b/src/gallium/drivers/nv30/nv30_state.h index e42e872de7..66c26360cb 100644 --- a/src/gallium/drivers/nv30/nv30_state.h +++ b/src/gallium/drivers/nv30/nv30_state.h @@ -70,6 +70,8 @@ struct nv30_fragment_program { struct nouveau_stateobj *so; }; +#define NV30_MAX_TEXTURE_LEVELS 16 + struct nv30_miptree { struct pipe_texture base; struct nouveau_bo *bo; @@ -80,7 +82,7 @@ struct nv30_miptree { struct { uint pitch; uint *image_offset; - } level[PIPE_MAX_TEXTURE_LEVELS]; + } level[NV30_MAX_TEXTURE_LEVELS]; }; #endif diff --git a/src/gallium/drivers/nv40/nv40_state.h b/src/gallium/drivers/nv40/nv40_state.h index 192074e747..e2e69420ea 100644 --- a/src/gallium/drivers/nv40/nv40_state.h +++ b/src/gallium/drivers/nv40/nv40_state.h @@ -73,6 +73,8 @@ struct nv40_fragment_program { struct nouveau_stateobj *so; }; +#define NV40_MAX_TEXTURE_LEVELS 16 + struct nv40_miptree { struct pipe_texture base; struct nouveau_bo *bo; @@ -83,7 +85,7 @@ struct nv40_miptree { struct { uint pitch; uint *image_offset; - } level[PIPE_MAX_TEXTURE_LEVELS]; + } level[NV40_MAX_TEXTURE_LEVELS]; }; #endif diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index c540594b94..044437e75f 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -90,10 +90,12 @@ struct nv50_miptree_level { unsigned tile_mode; }; +#define NV50_MAX_TEXTURE_LEVELS 16 + struct nv50_miptree { struct nouveau_miptree base; - struct nv50_miptree_level level[PIPE_MAX_TEXTURE_LEVELS]; + struct nv50_miptree_level level[NV50_MAX_TEXTURE_LEVELS]; int image_nr; int total_size; }; -- cgit v1.2.3 From f027d5612901de8e6167e6288c4e24d91d964e7f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 15:19:13 -0700 Subject: llvmpipe/gallivm: checkpoint: array of pointers to mipmap levels Change the texture data_ptr from just a single image pointer to an array of image pointers, indexed by mipmap level. We'll use this for mipmap filtering. For now, the mipmap level is hard-coded to zero. --- src/gallium/auxiliary/gallivm/lp_bld_sample.c | 3 +- src/gallium/auxiliary/gallivm/lp_bld_sample.h | 3 +- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 69 +++++++++++++++-------- src/gallium/drivers/llvmpipe/lp_jit.c | 4 +- src/gallium/drivers/llvmpipe/lp_jit.h | 3 +- src/gallium/drivers/llvmpipe/lp_setup.c | 16 ++++-- src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c | 27 +++++---- 7 files changed, 81 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 29cadcc15a..311c9f1b9e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -162,8 +162,7 @@ lp_build_sample_offset(struct lp_build_context *bld, const struct util_format_description *format_desc, LLVMValueRef x, LLVMValueRef y, - LLVMValueRef y_stride, - LLVMValueRef data_ptr) + LLVMValueRef y_stride) { LLVMValueRef x_stride; LLVMValueRef offset; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index 5ba0925bb6..68db91d6fd 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -148,8 +148,7 @@ lp_build_sample_offset(struct lp_build_context *bld, const struct util_format_description *format_desc, LLVMValueRef x, LLVMValueRef y, - LLVMValueRef y_stride, - LLVMValueRef data_ptr); + LLVMValueRef y_stride); void diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 9058f76c1d..1dca29cdd5 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -124,13 +124,14 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, LLVMValueRef x, LLVMValueRef y, LLVMValueRef y_stride, - LLVMValueRef data_ptr, + LLVMValueRef data_array, LLVMValueRef *texel) { struct lp_build_context *int_coord_bld = &bld->int_coord_bld; LLVMValueRef offset; LLVMValueRef packed; LLVMValueRef use_border = NULL; + LLVMValueRef data_ptr; /* use_border = x < 0 || x >= width || y < 0 || y >= height */ if (wrap_mode_uses_border_color(bld->static_state->wrap_s)) { @@ -153,6 +154,16 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, } } + /* XXX always use mipmap level 0 for now */ + { + const int level = 0; + LLVMValueRef indexes[2]; + indexes[0] = LLVMConstInt(LLVMInt32Type(), 0, 0); + indexes[1] = LLVMConstInt(LLVMInt32Type(), level, 0); + data_ptr = LLVMBuildGEP(bld->builder, data_array, indexes, 2, ""); + data_ptr = LLVMBuildLoad(bld->builder, data_ptr, ""); + } + /* * Note: if we find an app which frequently samples the texture border * we might want to implement a true conditional here to avoid sampling @@ -171,8 +182,7 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, /* convert x,y coords to linear offset from start of texture, in bytes */ offset = lp_build_sample_offset(&bld->uint_coord_bld, bld->format_desc, - x, y, y_stride, - data_ptr); + x, y, y_stride); assert(bld->format_desc->block.width == 1); assert(bld->format_desc->block.height == 1); @@ -210,19 +220,31 @@ lp_build_sample_packed(struct lp_build_sample_context *bld, LLVMValueRef x, LLVMValueRef y, LLVMValueRef y_stride, - LLVMValueRef data_ptr) + LLVMValueRef data_array) { LLVMValueRef offset; + LLVMValueRef data_ptr; offset = lp_build_sample_offset(&bld->uint_coord_bld, bld->format_desc, - x, y, y_stride, - data_ptr); + x, y, y_stride); assert(bld->format_desc->block.width == 1); assert(bld->format_desc->block.height == 1); assert(bld->format_desc->block.bits <= bld->texel_type.width); + /* XXX always use mipmap level 0 for now */ + { + const int level = 0; + LLVMValueRef indexes[2]; + /* get data_ptr[level] */ + indexes[0] = LLVMConstInt(LLVMInt32Type(), 0, 0); + indexes[1] = LLVMConstInt(LLVMInt32Type(), level, 0); + data_ptr = LLVMBuildGEP(bld->builder, data_array, indexes, 2, ""); + /* load texture base address */ + data_ptr = LLVMBuildLoad(bld->builder, data_ptr, ""); + } + return lp_build_gather(bld->builder, bld->texel_type.length, bld->format_desc->block.bits, @@ -720,7 +742,7 @@ lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, LLVMValueRef width, LLVMValueRef height, LLVMValueRef stride, - LLVMValueRef data_ptr, + LLVMValueRef data_array, LLVMValueRef *texel) { LLVMValueRef x, y; @@ -735,7 +757,7 @@ lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, lp_build_name(x, "tex.x.wrapped"); lp_build_name(y, "tex.y.wrapped"); - lp_build_sample_texel_soa(bld, width, height, x, y, stride, data_ptr, texel); + lp_build_sample_texel_soa(bld, width, height, x, y, stride, data_array, texel); } @@ -749,7 +771,7 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, LLVMValueRef width, LLVMValueRef height, LLVMValueRef stride, - LLVMValueRef data_ptr, + LLVMValueRef data_array, LLVMValueRef *texel) { LLVMValueRef s_fpart; @@ -764,10 +786,10 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, lp_build_sample_wrap_linear(bld, t, height, bld->static_state->pot_height, bld->static_state->wrap_t, &y0, &y1, &t_fpart); - lp_build_sample_texel_soa(bld, width, height, x0, y0, stride, data_ptr, neighbors[0][0]); - lp_build_sample_texel_soa(bld, width, height, x1, y0, stride, data_ptr, neighbors[0][1]); - lp_build_sample_texel_soa(bld, width, height, x0, y1, stride, data_ptr, neighbors[1][0]); - lp_build_sample_texel_soa(bld, width, height, x1, y1, stride, data_ptr, neighbors[1][1]); + lp_build_sample_texel_soa(bld, width, height, x0, y0, stride, data_array, neighbors[0][0]); + lp_build_sample_texel_soa(bld, width, height, x1, y0, stride, data_array, neighbors[0][1]); + lp_build_sample_texel_soa(bld, width, height, x0, y1, stride, data_array, neighbors[1][0]); + lp_build_sample_texel_soa(bld, width, height, x1, y1, stride, data_array, neighbors[1][1]); /* TODO: Don't interpolate missing channels */ for(chan = 0; chan < 4; ++chan) { @@ -818,7 +840,7 @@ lp_build_sample_2d_linear_aos(struct lp_build_sample_context *bld, LLVMValueRef width, LLVMValueRef height, LLVMValueRef stride, - LLVMValueRef data_ptr, + LLVMValueRef data_array, LLVMValueRef *texel) { LLVMBuilderRef builder = bld->builder; @@ -958,10 +980,10 @@ lp_build_sample_2d_linear_aos(struct lp_build_sample_context *bld, * The higher 8 bits of the resulting elements will be zero. */ - neighbors[0][0] = lp_build_sample_packed(bld, x0, y0, stride, data_ptr); - neighbors[0][1] = lp_build_sample_packed(bld, x1, y0, stride, data_ptr); - neighbors[1][0] = lp_build_sample_packed(bld, x0, y1, stride, data_ptr); - neighbors[1][1] = lp_build_sample_packed(bld, x1, y1, stride, data_ptr); + neighbors[0][0] = lp_build_sample_packed(bld, x0, y0, stride, data_array); + neighbors[0][1] = lp_build_sample_packed(bld, x1, y0, stride, data_array); + neighbors[1][0] = lp_build_sample_packed(bld, x0, y1, stride, data_array); + neighbors[1][1] = lp_build_sample_packed(bld, x1, y1, stride, data_array); neighbors[0][0] = LLVMBuildBitCast(builder, neighbors[0][0], u8n_vec_type, ""); neighbors[0][1] = LLVMBuildBitCast(builder, neighbors[0][1], u8n_vec_type, ""); @@ -1248,7 +1270,7 @@ lp_build_sample_soa(LLVMBuilderRef builder, LLVMValueRef width; LLVMValueRef height; LLVMValueRef stride; - LLVMValueRef data_ptr; + LLVMValueRef data_array; LLVMValueRef s; LLVMValueRef t; LLVMValueRef r; @@ -1276,7 +1298,8 @@ lp_build_sample_soa(LLVMBuilderRef builder, width = dynamic_state->width(dynamic_state, builder, unit); height = dynamic_state->height(dynamic_state, builder, unit); stride = dynamic_state->stride(dynamic_state, builder, unit); - data_ptr = dynamic_state->data_ptr(dynamic_state, builder, unit); + data_array = dynamic_state->data_ptr(dynamic_state, builder, unit); + /* Note that data_array is an array[level] of pointers to texture images */ s = coords[0]; t = coords[1]; @@ -1292,17 +1315,17 @@ lp_build_sample_soa(LLVMBuilderRef builder, switch (static_state->min_img_filter) { case PIPE_TEX_FILTER_NEAREST: lp_build_sample_2d_nearest_soa(&bld, s, t, width, height, - stride, data_ptr, texel); + stride, data_array, texel); break; case PIPE_TEX_FILTER_LINEAR: if(lp_format_is_rgba8(bld.format_desc) && is_simple_wrap_mode(static_state->wrap_s) && is_simple_wrap_mode(static_state->wrap_t)) lp_build_sample_2d_linear_aos(&bld, s, t, width, height, - stride, data_ptr, texel); + stride, data_array, texel); else lp_build_sample_2d_linear_soa(&bld, s, t, width, height, - stride, data_ptr, texel); + stride, data_array, texel); break; default: assert(0); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index bacff500d6..08c8f93794 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -58,7 +58,9 @@ lp_jit_init_globals(struct llvmpipe_screen *screen) elem_types[LP_JIT_TEXTURE_DEPTH] = LLVMInt32Type(); elem_types[LP_JIT_TEXTURE_LAST_LEVEL] = LLVMInt32Type(); elem_types[LP_JIT_TEXTURE_STRIDE] = LLVMInt32Type(); - elem_types[LP_JIT_TEXTURE_DATA] = LLVMPointerType(LLVMInt8Type(), 0); + elem_types[LP_JIT_TEXTURE_DATA] = + LLVMArrayType(LLVMPointerType(LLVMInt8Type(), 0), + LP_MAX_TEXTURE_2D_LEVELS); texture_type = LLVMStructType(elem_types, Elements(elem_types), 0); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index 0ebb2826fa..5cc7a12c03 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -39,6 +39,7 @@ #include "gallivm/lp_bld_struct.h" #include "pipe/p_state.h" +#include "lp_texture.h" struct llvmpipe_screen; @@ -51,7 +52,7 @@ struct lp_jit_texture uint32_t depth; uint32_t last_level; uint32_t stride; - const void *data; + const void *data[LP_MAX_TEXTURE_2D_LEVELS]; }; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index b0713c3b71..cc7c18c8c0 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -472,19 +472,25 @@ lp_setup_set_sampler_textures( struct setup_context *setup, jit_tex->depth = tex->depth0; jit_tex->last_level = tex->last_level; jit_tex->stride = lp_tex->stride[0]; - if(!lp_tex->dt) { - jit_tex->data = lp_tex->data; + if (!lp_tex->dt) { + /* regular texture - setup array of mipmap level pointers */ + int j; + for (j = 0; j < LP_MAX_TEXTURE_2D_LEVELS; j++) { + jit_tex->data[j] = + (ubyte *) lp_tex->data + lp_tex->level_offset[j]; + } } else { + /* display target texture/surface */ /* * XXX: Where should this be unmapped? */ struct llvmpipe_screen *screen = llvmpipe_screen(tex->screen); struct llvmpipe_winsys *winsys = screen->winsys; - jit_tex->data = winsys->displaytarget_map(winsys, lp_tex->dt, - PIPE_BUFFER_USAGE_CPU_READ); - assert(jit_tex->data); + jit_tex->data[0] = winsys->displaytarget_map(winsys, lp_tex->dt, + PIPE_BUFFER_USAGE_CPU_READ); + assert(jit_tex->data[0]); } /* the scene references this texture */ diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c index fde2d653eb..5a3cf37d6d 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c @@ -80,6 +80,9 @@ struct lp_llvm_sampler_soa /** * Fetch the specified member of the lp_jit_texture structure. + * \param emit_load if TRUE, emit the LLVM load instruction to actually + * fetch the field's value. Otherwise, just emit the + * GEP code to address the field. * * @sa http://llvm.org/docs/GetElementPtr.html */ @@ -88,7 +91,8 @@ lp_llvm_texture_member(struct lp_sampler_dynamic_state *base, LLVMBuilderRef builder, unsigned unit, unsigned member_index, - const char *member_name) + const char *member_name, + boolean emit_load) { struct llvmpipe_sampler_dynamic_state *state = (struct llvmpipe_sampler_dynamic_state *)base; @@ -109,7 +113,10 @@ lp_llvm_texture_member(struct lp_sampler_dynamic_state *base, ptr = LLVMBuildGEP(builder, state->context_ptr, indices, Elements(indices), ""); - res = LLVMBuildLoad(builder, ptr, ""); + if (emit_load) + res = LLVMBuildLoad(builder, ptr, ""); + else + res = ptr; lp_build_name(res, "context.texture%u.%s", unit, member_name); @@ -126,22 +133,22 @@ lp_llvm_texture_member(struct lp_sampler_dynamic_state *base, * sampler code generator a reusable module without dependencies to * llvmpipe internals. */ -#define LP_LLVM_TEXTURE_MEMBER(_name, _index) \ +#define LP_LLVM_TEXTURE_MEMBER(_name, _index, _emit_load) \ static LLVMValueRef \ lp_llvm_texture_##_name( struct lp_sampler_dynamic_state *base, \ LLVMBuilderRef builder, \ unsigned unit) \ { \ - return lp_llvm_texture_member(base, builder, unit, _index, #_name ); \ + return lp_llvm_texture_member(base, builder, unit, _index, #_name, _emit_load ); \ } -LP_LLVM_TEXTURE_MEMBER(width, LP_JIT_TEXTURE_WIDTH) -LP_LLVM_TEXTURE_MEMBER(height, LP_JIT_TEXTURE_HEIGHT) -LP_LLVM_TEXTURE_MEMBER(depth, LP_JIT_TEXTURE_DEPTH) -LP_LLVM_TEXTURE_MEMBER(last_level, LP_JIT_TEXTURE_LAST_LEVEL) -LP_LLVM_TEXTURE_MEMBER(stride, LP_JIT_TEXTURE_STRIDE) -LP_LLVM_TEXTURE_MEMBER(data_ptr, LP_JIT_TEXTURE_DATA) +LP_LLVM_TEXTURE_MEMBER(width, LP_JIT_TEXTURE_WIDTH, TRUE) +LP_LLVM_TEXTURE_MEMBER(height, LP_JIT_TEXTURE_HEIGHT, TRUE) +LP_LLVM_TEXTURE_MEMBER(depth, LP_JIT_TEXTURE_DEPTH, TRUE) +LP_LLVM_TEXTURE_MEMBER(last_level, LP_JIT_TEXTURE_LAST_LEVEL, TRUE) +LP_LLVM_TEXTURE_MEMBER(stride, LP_JIT_TEXTURE_STRIDE, TRUE) +LP_LLVM_TEXTURE_MEMBER(data_ptr, LP_JIT_TEXTURE_DATA, FALSE) static void -- cgit v1.2.3 From e799163dec1fd23dadc9d3eaf5e71e9e7d23a818 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 16:19:15 -0700 Subject: vega: remove redundant DEFINES from .c.o rule --- src/gallium/state_trackers/vega/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/vega/Makefile b/src/gallium/state_trackers/vega/Makefile index 037d8dc911..7f04b2aa83 100644 --- a/src/gallium/state_trackers/vega/Makefile +++ b/src/gallium/state_trackers/vega/Makefile @@ -53,7 +53,7 @@ INCLUDE_DIRS = \ .c.o: - $(CC) -c $(INCLUDE_DIRS) $(DEFINES) $(CFLAGS) $< -o $@ + $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ default: depend $(TOP)/$(LIB_DIR)/$(VG_LIB_NAME) -- cgit v1.2.3 From 4243ca1144eef5783ed080cce9db1a8dda2c6360 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 8 Mar 2010 16:20:16 -0700 Subject: gallium: update some comments, remove others which are superfluous --- src/gallium/include/pipe/p_state.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 02558520bf..72635d1031 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -249,7 +249,7 @@ struct pipe_framebuffer_state { unsigned width, height; - /** multiple colorbuffers for multiple render targets */ + /** multiple color buffers for multiple render targets */ unsigned nr_cbufs; struct pipe_surface *cbufs[PIPE_MAX_COLOR_BUFS]; @@ -285,12 +285,12 @@ struct pipe_sampler_state struct pipe_surface { struct pipe_reference reference; - enum pipe_format format; /**< PIPE_FORMAT_x */ + enum pipe_format format; unsigned width; /**< logical width in pixels */ unsigned height; /**< logical height in pixels */ unsigned layout; /**< PIPE_SURFACE_LAYOUT_x */ unsigned offset; /**< offset from start of buffer, in bytes */ - unsigned usage; /**< PIPE_BUFFER_USAGE_* */ + unsigned usage; /**< bitmask of PIPE_BUFFER_USAGE_x */ unsigned zslice; struct pipe_texture *texture; /**< texture into which this is a view */ @@ -336,7 +336,7 @@ struct pipe_texture unsigned nr_samples:8; /**< for multisampled surfaces, nr of samples */ - unsigned tex_usage; /* PIPE_TEXTURE_USAGE_* */ + unsigned tex_usage; /**< bitmask of PIPE_TEXTURE_USAGE_* */ struct pipe_screen *screen; /**< screen that this texture belongs to */ }; @@ -375,7 +375,7 @@ struct pipe_vertex_element unsigned vertex_buffer_index:8; unsigned nr_components:8; - enum pipe_format src_format; /**< PIPE_FORMAT_* */ + enum pipe_format src_format; }; -- cgit v1.2.3 From 2b76e04a8ca92c02e705c6286c55975b0045d9af Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 9 Mar 2010 11:32:17 +0800 Subject: st/egl: Fix KMS build error after winsys handle change. --- src/gallium/state_trackers/egl/kms/native_kms.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/kms/native_kms.c b/src/gallium/state_trackers/egl/kms/native_kms.c index 418461089a..7322240856 100644 --- a/src/gallium/state_trackers/egl/kms/native_kms.c +++ b/src/gallium/state_trackers/egl/kms/native_kms.c @@ -55,7 +55,7 @@ kms_surface_validate(struct native_surface *nsurf, uint attachment_mask, templ.format = ksurf->color_format; templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; if (ksurf->type == KMS_SURFACE_TYPE_SCANOUT) - templ.tex_usage |= PIPE_TEXTURE_SCANOUT; + templ.tex_usage |= PIPE_TEXTURE_USAGE_SCANOUT; } /* create textures */ @@ -100,7 +100,7 @@ kms_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back) for (i = 0; i < num_framebuffers; i++) { struct kms_framebuffer *fb; enum native_attachment natt; - unsigned int handle, stride; + struct winsys_handle whandle; uint block_bits; if (i == 0) { @@ -128,13 +128,17 @@ kms_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back) /* TODO detect the real value */ fb->is_passive = TRUE; - if (!kdpy->api->local_handle_from_texture(kdpy->api, - kdpy->base.screen, fb->texture, &stride, &handle)) + memset(&whandle, 0, sizeof(whandle)); + whandle.type = DRM_API_HANDLE_TYPE_KMS; + + if (!kdpy->base.screen->texture_get_handle(kdpy->base.screen, + fb->texture, &whandle)) return FALSE; block_bits = util_format_get_blocksizebits(ksurf->color_format); err = drmModeAddFB(kdpy->fd, ksurf->width, ksurf->height, - block_bits, block_bits, stride, handle, &fb->buffer_id); + block_bits, block_bits, whandle.stride, whandle.handle, + &fb->buffer_id); if (err) { fb->buffer_id = 0; return FALSE; -- cgit v1.2.3 From dd8f5c33f3a54212a0d7d072cd75b321f5abcda8 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 10 Feb 2010 10:39:18 -0800 Subject: mesa/st: Gallium quads, by spec, never change provoking vertex. Fixes glean/clipFlat for r300g. --- src/mesa/state_tracker/st_extensions.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 79be833768..e03dd30f0f 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -137,6 +137,9 @@ void st_init_limits(struct st_context *st) /* XXX separate query for early function return? */ st->ctx->Shader.EmitContReturn = screen->get_param(screen, PIPE_CAP_TGSI_CONT_SUPPORTED); + + /* Quads always follow GL provoking rules. */ + c->QuadsFollowProvokingVertexConvention = GL_FALSE; } -- cgit v1.2.3 From f2b8f142674749f1b8f49938978493e0425f05fa Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 7 Mar 2010 04:54:43 +0100 Subject: llvmpipe: quads never provoke the first vertex --- src/gallium/drivers/llvmpipe/lp_setup_vbuf.c | 129 ++++++++------------------- 1 file changed, 36 insertions(+), 93 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c index 24291da91e..671e74465c 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c @@ -231,57 +231,29 @@ lp_setup_draw(struct vbuf_render *vbr, const ushort *indices, uint nr) break; case PIPE_PRIM_QUADS: - if (setup->flatshade_first) { - for (i = 3; i < nr; i += 4) { - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-2], stride), - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-3], stride) ); - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-0], stride), - get_vert(vertex_buffer, indices[i-3], stride) ); - } - } - else { - for (i = 3; i < nr; i += 4) { - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-3], stride), - get_vert(vertex_buffer, indices[i-2], stride), - get_vert(vertex_buffer, indices[i-0], stride) ); + for (i = 3; i < nr; i += 4) { + setup->triangle( setup, + get_vert(vertex_buffer, indices[i-3], stride), + get_vert(vertex_buffer, indices[i-2], stride), + get_vert(vertex_buffer, indices[i-0], stride) ); - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-2], stride), - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-0], stride) ); - } + setup->triangle( setup, + get_vert(vertex_buffer, indices[i-2], stride), + get_vert(vertex_buffer, indices[i-1], stride), + get_vert(vertex_buffer, indices[i-0], stride) ); } break; case PIPE_PRIM_QUAD_STRIP: - if (setup->flatshade_first) { - for (i = 3; i < nr; i += 2) { - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-0], stride), - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-3], stride)); - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-2], stride), - get_vert(vertex_buffer, indices[i-0], stride), - get_vert(vertex_buffer, indices[i-3], stride) ); - } - } - else { - for (i = 3; i < nr; i += 2) { - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-3], stride), - get_vert(vertex_buffer, indices[i-2], stride), - get_vert(vertex_buffer, indices[i-0], stride) ); - setup->triangle( setup, - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-3], stride), - get_vert(vertex_buffer, indices[i-0], stride) ); - } + for (i = 3; i < nr; i += 2) { + setup->triangle( setup, + get_vert(vertex_buffer, indices[i-3], stride), + get_vert(vertex_buffer, indices[i-2], stride), + get_vert(vertex_buffer, indices[i-0], stride) ); + setup->triangle( setup, + get_vert(vertex_buffer, indices[i-1], stride), + get_vert(vertex_buffer, indices[i-3], stride), + get_vert(vertex_buffer, indices[i-0], stride) ); } break; @@ -415,57 +387,28 @@ lp_setup_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) break; case PIPE_PRIM_QUADS: - if (setup->flatshade_first) { - for (i = 3; i < nr; i += 4) { - setup->triangle( setup, - get_vert(vertex_buffer, i-2, stride), - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-3, stride) ); - setup->triangle( setup, - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-0, stride), - get_vert(vertex_buffer, i-3, stride) ); - } - } - else { - for (i = 3; i < nr; i += 4) { - setup->triangle( setup, - get_vert(vertex_buffer, i-3, stride), - get_vert(vertex_buffer, i-2, stride), - get_vert(vertex_buffer, i-0, stride) ); - setup->triangle( setup, - get_vert(vertex_buffer, i-2, stride), - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-0, stride) ); - } + for (i = 3; i < nr; i += 4) { + setup->triangle( setup, + get_vert(vertex_buffer, i-3, stride), + get_vert(vertex_buffer, i-2, stride), + get_vert(vertex_buffer, i-0, stride) ); + setup->triangle( setup, + get_vert(vertex_buffer, i-2, stride), + get_vert(vertex_buffer, i-1, stride), + get_vert(vertex_buffer, i-0, stride) ); } break; case PIPE_PRIM_QUAD_STRIP: - if (setup->flatshade_first) { - for (i = 3; i < nr; i += 2) { - setup->triangle( setup, - get_vert(vertex_buffer, i-0, stride), - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-3, stride) ); - setup->triangle( setup, - - get_vert(vertex_buffer, i-2, stride), - get_vert(vertex_buffer, i-0, stride), - get_vert(vertex_buffer, i-3, stride) ); - } - } - else { - for (i = 3; i < nr; i += 2) { - setup->triangle( setup, - get_vert(vertex_buffer, i-3, stride), - get_vert(vertex_buffer, i-2, stride), - get_vert(vertex_buffer, i-0, stride) ); - setup->triangle( setup, - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-3, stride), - get_vert(vertex_buffer, i-0, stride) ); - } + for (i = 3; i < nr; i += 2) { + setup->triangle( setup, + get_vert(vertex_buffer, i-3, stride), + get_vert(vertex_buffer, i-2, stride), + get_vert(vertex_buffer, i-0, stride) ); + setup->triangle( setup, + get_vert(vertex_buffer, i-1, stride), + get_vert(vertex_buffer, i-3, stride), + get_vert(vertex_buffer, i-0, stride) ); } break; -- cgit v1.2.3 From 558ce9964f7edeefbe07b002a341fb9275b3c69b Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 7 Mar 2010 04:56:06 +0100 Subject: softpipe: quads never provoke the first vertex --- src/gallium/drivers/softpipe/sp_prim_vbuf.c | 80 +++++------------------------ 1 file changed, 12 insertions(+), 68 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c index 98c08eaffa..6749243ab4 100644 --- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c +++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c @@ -264,57 +264,29 @@ sp_vbuf_draw(struct vbuf_render *vbr, const ushort *indices, uint nr) break; case PIPE_PRIM_QUADS: - if (softpipe->rasterizer->flatshade_first) { - for (i = 3; i < nr; i += 4) { - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, indices[i-2], stride), - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-3], stride) ); - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-0], stride), - get_vert(vertex_buffer, indices[i-3], stride) ); - } - } - else { - for (i = 3; i < nr; i += 4) { - sp_setup_tri( setup_ctx, + for (i = 3; i < nr; i += 4) { + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, indices[i-3], stride), get_vert(vertex_buffer, indices[i-2], stride), get_vert(vertex_buffer, indices[i-0], stride) ); - sp_setup_tri( setup_ctx, + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, indices[i-2], stride), get_vert(vertex_buffer, indices[i-1], stride), get_vert(vertex_buffer, indices[i-0], stride) ); - } } break; case PIPE_PRIM_QUAD_STRIP: - if (softpipe->rasterizer->flatshade_first) { - for (i = 3; i < nr; i += 2) { - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, indices[i-0], stride), - get_vert(vertex_buffer, indices[i-1], stride), - get_vert(vertex_buffer, indices[i-3], stride)); - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, indices[i-2], stride), - get_vert(vertex_buffer, indices[i-0], stride), - get_vert(vertex_buffer, indices[i-3], stride) ); - } - } - else { - for (i = 3; i < nr; i += 2) { - sp_setup_tri( setup_ctx, + for (i = 3; i < nr; i += 2) { + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, indices[i-3], stride), get_vert(vertex_buffer, indices[i-2], stride), get_vert(vertex_buffer, indices[i-0], stride) ); - sp_setup_tri( setup_ctx, + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, indices[i-1], stride), get_vert(vertex_buffer, indices[i-3], stride), get_vert(vertex_buffer, indices[i-0], stride) ); - } } break; @@ -448,56 +420,28 @@ sp_vbuf_draw_arrays(struct vbuf_render *vbr, uint start, uint nr) break; case PIPE_PRIM_QUADS: - if (softpipe->rasterizer->flatshade_first) { - for (i = 3; i < nr; i += 4) { - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, i-2, stride), - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-3, stride) ); - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-0, stride), - get_vert(vertex_buffer, i-3, stride) ); - } - } - else { - for (i = 3; i < nr; i += 4) { - sp_setup_tri( setup_ctx, + for (i = 3; i < nr; i += 4) { + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, i-3, stride), get_vert(vertex_buffer, i-2, stride), get_vert(vertex_buffer, i-0, stride) ); - sp_setup_tri( setup_ctx, + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, i-2, stride), get_vert(vertex_buffer, i-1, stride), get_vert(vertex_buffer, i-0, stride) ); - } } break; case PIPE_PRIM_QUAD_STRIP: - if (softpipe->rasterizer->flatshade_first) { - for (i = 3; i < nr; i += 2) { - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, i-0, stride), - get_vert(vertex_buffer, i-1, stride), - get_vert(vertex_buffer, i-3, stride) ); - sp_setup_tri( setup_ctx, - get_vert(vertex_buffer, i-2, stride), - get_vert(vertex_buffer, i-0, stride), - get_vert(vertex_buffer, i-3, stride) ); - } - } - else { - for (i = 3; i < nr; i += 2) { - sp_setup_tri( setup_ctx, + for (i = 3; i < nr; i += 2) { + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, i-3, stride), get_vert(vertex_buffer, i-2, stride), get_vert(vertex_buffer, i-0, stride) ); - sp_setup_tri( setup_ctx, + sp_setup_tri( setup_ctx, get_vert(vertex_buffer, i-1, stride), get_vert(vertex_buffer, i-3, stride), get_vert(vertex_buffer, i-0, stride) ); - } } break; -- cgit v1.2.3 From f3365bceb881b7a5cdd47e6c102ca37454453ce9 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 9 Mar 2010 04:40:55 +0100 Subject: draw: quads never provoke the first vertex --- src/gallium/auxiliary/draw/draw_pt_decompose.h | 40 +++++++------------------ src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h | 38 +++++++---------------- 2 files changed, 20 insertions(+), 58 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/draw/draw_pt_decompose.h b/src/gallium/auxiliary/draw/draw_pt_decompose.h index 4ca5b52020..3c44f7c11e 100644 --- a/src/gallium/auxiliary/draw/draw_pt_decompose.h +++ b/src/gallium/auxiliary/draw/draw_pt_decompose.h @@ -105,40 +105,20 @@ static void FUNC( ARGS, case PIPE_PRIM_QUADS: - if (flatfirst) { - for (i = 0; i+3 < count; i += 4) { - QUAD( (i + 1), - (i + 2), - (i + 3), - (i + 0) ); - } - } - else { - for (i = 0; i+3 < count; i += 4) { - QUAD( (i + 0), - (i + 1), - (i + 2), - (i + 3)); - } + for (i = 0; i+3 < count; i += 4) { + QUAD( (i + 0), + (i + 1), + (i + 2), + (i + 3)); } break; case PIPE_PRIM_QUAD_STRIP: - if (flatfirst) { - for (i = 0; i+3 < count; i += 2) { - QUAD( (i + 1), - (i + 3), - (i + 2), - (i + 0) ); - } - } - else { - for (i = 0; i+3 < count; i += 2) { - QUAD( (i + 2), - (i + 0), - (i + 1), - (i + 3)); - } + for (i = 0; i+3 < count; i += 2) { + QUAD( (i + 2), + (i + 0), + (i + 1), + (i + 3)); } break; diff --git a/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h b/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h index 62822a3d56..7cba8547f1 100644 --- a/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h +++ b/src/gallium/auxiliary/draw/draw_pt_vcache_tmp.h @@ -118,39 +118,21 @@ static void FUNC( struct draw_pt_front_end *frontend, case PIPE_PRIM_QUADS: for (i = 0; i+3 < count; i += 4) { - if (flatfirst) { - QUAD( vcache, - get_elt(elts, i + 0), - get_elt(elts, i + 1), - get_elt(elts, i + 2), - get_elt(elts, i + 3) ); - } - else { - QUAD( vcache, - get_elt(elts, i + 0), - get_elt(elts, i + 1), - get_elt(elts, i + 2), - get_elt(elts, i + 3) ); - } + QUAD( vcache, + get_elt(elts, i + 0), + get_elt(elts, i + 1), + get_elt(elts, i + 2), + get_elt(elts, i + 3) ); } break; case PIPE_PRIM_QUAD_STRIP: for (i = 0; i+3 < count; i += 2) { - if (flatfirst) { - QUAD( vcache, - get_elt(elts, i + 0), - get_elt(elts, i + 1), - get_elt(elts, i + 3), - get_elt(elts, i + 2) ); - } - else { - QUAD( vcache, - get_elt(elts, i + 2), - get_elt(elts, i + 0), - get_elt(elts, i + 1), - get_elt(elts, i + 3) ); - } + QUAD( vcache, + get_elt(elts, i + 2), + get_elt(elts, i + 0), + get_elt(elts, i + 1), + get_elt(elts, i + 3) ); } break; -- cgit v1.2.3 From 821c830f11fc1c3529a186ace1d1ba3ddeab4957 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 9 Mar 2010 02:10:36 +0100 Subject: r300g: remove hacks from translate_vertex_data_swizzle The first part of the fix of BGRA vertex colors. --- src/gallium/drivers/r300/r300_state_inlines.h | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index 2f3a56e1fb..af7827820c 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -453,7 +453,6 @@ r300_translate_vertex_data_type(enum pipe_format format) { static INLINE uint16_t r300_translate_vertex_data_swizzle(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); - unsigned swizzle[4], i; assert(format); @@ -463,25 +462,10 @@ r300_translate_vertex_data_swizzle(enum pipe_format format) { return 0; } - /* Swizzles for 8bits formats are in the reversed order, not sure why. */ - if (desc->channel[0].size == 8) { - for (i = 0; i < 4; i++) { - if (desc->swizzle[i] <= 3) { - swizzle[i] = 3 - desc->swizzle[i]; - } else { - swizzle[i] = desc->swizzle[i]; - } - } - } else { - for (i = 0; i < 4; i++) { - swizzle[i] = desc->swizzle[i]; - } - } - - return ((swizzle[0] << R300_SWIZZLE_SELECT_X_SHIFT) | - (swizzle[1] << R300_SWIZZLE_SELECT_Y_SHIFT) | - (swizzle[2] << R300_SWIZZLE_SELECT_Z_SHIFT) | - (swizzle[3] << R300_SWIZZLE_SELECT_W_SHIFT) | + return ((desc->swizzle[0] << R300_SWIZZLE_SELECT_X_SHIFT) | + (desc->swizzle[1] << R300_SWIZZLE_SELECT_Y_SHIFT) | + (desc->swizzle[2] << R300_SWIZZLE_SELECT_Z_SHIFT) | + (desc->swizzle[3] << R300_SWIZZLE_SELECT_W_SHIFT) | (0xf << R300_WRITE_ENA_SHIFT)); } -- cgit v1.2.3 From da92f6db5bf0d3ac42732df556eb4f96619c9047 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 9 Mar 2010 12:36:34 +0800 Subject: winsys/xlib: Fix a segfault when USE_XSHM is not defined. --- src/gallium/winsys/xlib/xlib_sw_winsys.c | 41 ++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c index 3e8fefb582..9a4ae39aeb 100644 --- a/src/gallium/winsys/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -193,6 +193,26 @@ alloc_shm_ximage(struct xm_displaytarget *xm_dt, #endif /* USE_XSHM */ +static void +alloc_ximage(struct xm_displaytarget *xm_dt, + struct xlib_drawable *xmb, + unsigned width, unsigned height) +{ +#ifdef USE_XSHM + if (xm_dt->shm) { + alloc_shm_ximage(xm_dt, xmb, width, height); + return; + } +#endif + + xm_dt->tempImage = XCreateImage(xm_dt->display, + xmb->visual, + xmb->depth, + ZPixmap, 0, + NULL, width, height, + 8, 0); +} + static boolean xm_is_displaytarget_format_supported( struct sw_winsys *ws, enum pipe_format format ) @@ -265,19 +285,20 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, if (no_swap) return; + if (xm_dt->tempImage == NULL) + { + assert(util_format_get_blockwidth(xm_dt->format) == 1); + assert(util_format_get_blockheight(xm_dt->format) == 1); + alloc_ximage(xm_dt, xlib_drawable, + xm_dt->stride / util_format_get_blocksize(xm_dt->format), + xm_dt->height); + if (!xm_dt->tempImage) + return; + } + #ifdef USE_XSHM if (xm_dt->shm) { - if (xm_dt->tempImage == NULL) - { - assert(util_format_get_blockwidth(xm_dt->format) == 1); - assert(util_format_get_blockheight(xm_dt->format) == 1); - alloc_shm_ximage(xm_dt, - xlib_drawable, - xm_dt->stride / util_format_get_blocksize(xm_dt->format), - xm_dt->height); - } - ximage = xm_dt->tempImage; ximage->data = xm_dt->data; -- cgit v1.2.3 From 95c5c69b505f562b61e23fa7dd500dbdd432a70d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 8 Mar 2010 10:09:43 +0800 Subject: st/egl: Use xlib_sw_winsys in ximage backend. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 15 -- src/gallium/state_trackers/egl/common/native.h | 3 - src/gallium/state_trackers/egl/x11/native_x11.c | 13 +- src/gallium/state_trackers/egl/x11/native_x11.h | 2 +- src/gallium/state_trackers/egl/x11/native_ximage.c | 192 ++++------------- src/gallium/state_trackers/egl/x11/sw_winsys.c | 231 --------------------- src/gallium/state_trackers/egl/x11/sw_winsys.h | 40 ---- src/gallium/winsys/drm/Makefile.egl | 3 +- 8 files changed, 47 insertions(+), 452 deletions(-) delete mode 100644 src/gallium/state_trackers/egl/x11/sw_winsys.c delete mode 100644 src/gallium/state_trackers/egl/x11/sw_winsys.h (limited to 'src') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 04268c71c5..2f7a8a8f7e 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -507,20 +507,6 @@ egl_g3d_add_configs(_EGLDriver *drv, _EGLDisplay *dpy, EGLint id) return id; } -/** - * Flush the front buffer of the context's draw surface. - */ -static void -egl_g3d_flush_frontbuffer(struct pipe_screen *screen, - struct pipe_surface *surf, void *context_private) -{ - struct egl_g3d_context *gctx = egl_g3d_context(context_private); - struct egl_g3d_surface *gsurf = egl_g3d_surface(gctx->base.DrawSurface); - - if (gsurf) - gsurf->native->flush_frontbuffer(gsurf->native); -} - /** * Re-validate the context. */ @@ -581,7 +567,6 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy, goto fail; } - gdpy->native->screen->flush_frontbuffer = egl_g3d_flush_frontbuffer; gdpy->native->screen->update_buffer = egl_g3d_update_buffer; egl_g3d_init_st(&gdrv->base); diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 4f9758545a..4c9217e1a5 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -137,9 +137,6 @@ struct native_display_modeset; struct native_display { /** * The pipe screen of the native display. - * - * Note that the "flush_frontbuffer" and "update_buffer" callbacks will be - * overridden. */ struct pipe_screen *screen; diff --git a/src/gallium/state_trackers/egl/x11/native_x11.c b/src/gallium/state_trackers/egl/x11/native_x11.c index 3add95d0ac..ef7490503b 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.c +++ b/src/gallium/state_trackers/egl/x11/native_x11.c @@ -141,16 +141,9 @@ native_create_display(EGLNativeDisplayType dpy) if (!ndpy) { EGLint level = (force_sw) ? _EGL_INFO : _EGL_WARNING; - boolean use_shm; - - /* - * XXX st/mesa calls pipe_screen::update_buffer in st_validate_state. - * When SHM is used, there is a good chance that the shared memory - * segment is detached before the softpipe tile cache is flushed. - */ - use_shm = FALSE; - _eglLog(level, "use software%s fallback", (use_shm) ? " (SHM)" : ""); - ndpy = x11_create_ximage_display(dpy, use_shm); + + _eglLog(level, "use software fallback"); + ndpy = x11_create_ximage_display(dpy); } return ndpy; diff --git a/src/gallium/state_trackers/egl/x11/native_x11.h b/src/gallium/state_trackers/egl/x11/native_x11.h index 622ddac5df..2e71de1885 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.h +++ b/src/gallium/state_trackers/egl/x11/native_x11.h @@ -29,7 +29,7 @@ #include "common/native.h" struct native_display * -x11_create_ximage_display(EGLNativeDisplayType dpy, boolean use_xshm); +x11_create_ximage_display(EGLNativeDisplayType dpy); struct native_display * x11_create_dri2_display(EGLNativeDisplayType dpy, struct drm_api *api); diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index a8633b1501..6c6ba24e7b 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -28,17 +28,15 @@ #include #include #include -#include #include "util/u_memory.h" #include "util/u_math.h" #include "util/u_format.h" #include "pipe/p_compiler.h" #include "util/u_simple_screen.h" #include "util/u_inlines.h" -#include "softpipe/sp_winsys.h" +#include "state_tracker/xlib_sw_winsys.h" #include "egllog.h" -#include "sw_winsys.h" #include "native_x11.h" #include "x11_screen.h" @@ -56,19 +54,15 @@ struct ximage_display { struct x11_screen *xscr; int xscr_number; - boolean use_xshm; + struct xm_driver *driver; - struct pipe_winsys *winsys; struct ximage_config *configs; int num_configs; }; struct ximage_buffer { - XImage *ximage; - struct pipe_texture *texture; - XShmSegmentInfo *shm_info; - boolean xshm_attached; + struct xlib_drawable xdraw; }; struct ximage_surface { @@ -119,18 +113,6 @@ ximage_surface_free_buffer(struct native_surface *nsurf, struct ximage_buffer *xbuf = &xsurf->buffers[which]; pipe_texture_reference(&xbuf->texture, NULL); - - if (xbuf->shm_info) { - if (xbuf->xshm_attached) - XShmDetach(xsurf->xdpy->dpy, xbuf->shm_info); - if (xbuf->shm_info->shmaddr != (void *) -1) - shmdt(xbuf->shm_info->shmaddr); - if (xbuf->shm_info->shmid != -1) - shmctl(xbuf->shm_info->shmid, IPC_RMID, 0); - - xbuf->shm_info->shmaddr = (void *) -1; - xbuf->shm_info->shmid = -1; - } } static boolean @@ -154,40 +136,26 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, templ.depth0 = 1; templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; - if (xbuf->shm_info) { - struct pipe_buffer *pbuf; - unsigned stride, size; - void *addr = NULL; - - stride = util_format_get_stride(xsurf->color_format, xsurf->width); - /* alignment should depend on visual? */ - stride = align(stride, 4); - size = stride * xsurf->height; - - /* create and attach shm object */ - xbuf->shm_info->shmid = shmget(IPC_PRIVATE, size, 0755); - if (xbuf->shm_info->shmid != -1) { - xbuf->shm_info->shmaddr = - shmat(xbuf->shm_info->shmid, NULL, 0); - if (xbuf->shm_info->shmaddr != (void *) -1) { - if (XShmAttach(xsurf->xdpy->dpy, xbuf->shm_info)) { - addr = xbuf->shm_info->shmaddr; - xbuf->xshm_attached = TRUE; - } - } - } - - if (addr) { - pbuf = screen->user_buffer_create(screen, addr, size); - if (pbuf) { - xbuf->texture = - screen->texture_blanket(screen, &templ, &stride, pbuf); - pipe_buffer_reference(&pbuf, NULL); - } + if (xsurf->type != XIMAGE_SURFACE_TYPE_PBUFFER) { + switch (which) { + case NATIVE_ATTACHMENT_FRONT_LEFT: + case NATIVE_ATTACHMENT_FRONT_RIGHT: + templ.tex_usage |= PIPE_TEXTURE_USAGE_PRIMARY; + break; + case NATIVE_ATTACHMENT_BACK_LEFT: + case NATIVE_ATTACHMENT_BACK_RIGHT: + templ.tex_usage |= PIPE_TEXTURE_USAGE_DISPLAY_TARGET; + break; + default: + break; } } - else { - xbuf->texture = screen->texture_create(screen, &templ); + xbuf->texture = screen->texture_create(screen, &templ); + if (xbuf->texture) { + xbuf->xdraw.visual = xsurf->visual.visual; + xbuf->xdraw.depth = xsurf->visual.depth; + xbuf->xdraw.drawable = xsurf->drawable; + xbuf->xdraw.gc = xsurf->gc; } /* clean up the buffer if allocation failed */ @@ -257,18 +225,10 @@ ximage_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask) new_valid = 0x0; for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) { if (native_attachment_mask_test(buffer_mask, att)) { - struct ximage_buffer *xbuf = &xsurf->buffers[att]; - /* reallocate the texture */ if (!ximage_surface_alloc_buffer(&xsurf->base, att)) break; - /* update ximage */ - if (xbuf->ximage) { - xbuf->ximage->width = xsurf->width; - xbuf->ximage->height = xsurf->height; - } - new_valid |= (1 << att); if (buffer_mask == new_valid) break; @@ -288,43 +248,22 @@ ximage_surface_draw_buffer(struct native_surface *nsurf, struct ximage_surface *xsurf = ximage_surface(nsurf); struct ximage_buffer *xbuf = &xsurf->buffers[which]; struct pipe_screen *screen = xsurf->xdpy->base.screen; - struct pipe_transfer *transfer; + struct pipe_surface *psurf; if (xsurf->type == XIMAGE_SURFACE_TYPE_PBUFFER) return TRUE; - assert(xsurf->drawable && xbuf->ximage && xbuf->texture); + assert(xsurf->drawable && xbuf->texture); - transfer = screen->get_tex_transfer(screen, xbuf->texture, - 0, 0, 0, PIPE_TRANSFER_READ, 0, 0, xsurf->width, xsurf->height); - if (!transfer) + /* what's the cost of surface creation? */ + psurf = screen->get_tex_surface(screen, + xbuf->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ); + if (!psurf) return FALSE; - xbuf->ximage->bytes_per_line = transfer->stride; - xbuf->ximage->data = screen->transfer_map(screen, transfer); - if (!xbuf->ximage->data) { - screen->tex_transfer_destroy(transfer); - return FALSE; - } - - - if (xbuf->shm_info) - XShmPutImage(xsurf->xdpy->dpy, xsurf->drawable, xsurf->gc, - xbuf->ximage, 0, 0, 0, 0, xsurf->width, xsurf->height, False); - else - XPutImage(xsurf->xdpy->dpy, xsurf->drawable, xsurf->gc, - xbuf->ximage, 0, 0, 0, 0, xsurf->width, xsurf->height); + screen->flush_frontbuffer(screen, psurf, &xbuf->xdraw); - xbuf->ximage->data = NULL; - screen->transfer_unmap(screen, transfer); - - /* - * softpipe allows the pipe transfer to be re-used, but we don't want to - * rely on that behavior. - */ - screen->tex_transfer_destroy(transfer); - - XSync(xsurf->xdpy->dpy, FALSE); + pipe_surface_reference(&psurf, NULL); return TRUE; } @@ -351,20 +290,20 @@ ximage_surface_swap_buffers(struct native_surface *nsurf) boolean ret; /* display the back buffer first */ - ret = ximage_surface_draw_buffer(nsurf, NATIVE_ATTACHMENT_BACK_LEFT); + ret = ximage_surface_draw_buffer(&xsurf->base, + NATIVE_ATTACHMENT_BACK_LEFT); /* force buffers to be updated in next validation call */ xsurf->server_stamp++; xfront = &xsurf->buffers[NATIVE_ATTACHMENT_FRONT_LEFT]; xback = &xsurf->buffers[NATIVE_ATTACHMENT_BACK_LEFT]; - /* skip swapping so that the front buffer is allocated only when needed */ - if (!xfront->texture) - return ret; - - xtmp = *xfront; - *xfront = *xback; - *xback = xtmp; + /* skip swapping unless there is a front buffer */ + if (xfront->texture) { + xtmp = *xfront; + *xfront = *xback; + *xback = xtmp; + } return ret; } @@ -419,15 +358,8 @@ ximage_surface_destroy(struct native_surface *nsurf) struct ximage_surface *xsurf = ximage_surface(nsurf); int i; - for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) { - struct ximage_buffer *xbuf = &xsurf->buffers[i]; + for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) ximage_surface_free_buffer(&xsurf->base, i); - /* xbuf->shm_info is owned by xbuf->ximage? */ - if (xbuf->ximage) { - XDestroyImage(xbuf->ximage); - xbuf->ximage = NULL; - } - } if (xsurf->type != XIMAGE_SURFACE_TYPE_PBUFFER) XFreeGC(xsurf->xdpy->dpy, xsurf->gc); @@ -443,7 +375,6 @@ ximage_display_create_surface(struct native_display *ndpy, struct ximage_display *xdpy = ximage_display(ndpy); struct ximage_config *xconf = ximage_config(nconf); struct ximage_surface *xsurf; - int i; xsurf = CALLOC_STRUCT(ximage_surface); if (!xsurf) @@ -466,43 +397,6 @@ ximage_display_create_surface(struct native_display *ndpy, /* initialize the geometry */ ximage_surface_update_buffers(&xsurf->base, 0x0); - - for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) { - struct ximage_buffer *xbuf = &xsurf->buffers[i]; - - if (xdpy->use_xshm) { - xbuf->shm_info = calloc(1, sizeof(*xbuf->shm_info)); - if (xbuf->shm_info) { - /* initialize shm info */ - xbuf->shm_info->shmid = -1; - xbuf->shm_info->shmaddr = (void *) -1; - xbuf->shm_info->readOnly = TRUE; - - xbuf->ximage = XShmCreateImage(xsurf->xdpy->dpy, - xsurf->visual.visual, - xsurf->visual.depth, - ZPixmap, NULL, - xbuf->shm_info, - 0, 0); - } - } - else { - xbuf->ximage = XCreateImage(xsurf->xdpy->dpy, - xsurf->visual.visual, - xsurf->visual.depth, - ZPixmap, 0, /* format, offset */ - NULL, /* data */ - 0, 0, /* size */ - 8, /* bitmap_pad */ - 0); /* bytes_per_line */ - } - - if (!xbuf->ximage) { - XFreeGC(xdpy->dpy, xsurf->gc); - free(xsurf); - return NULL; - } - } } xsurf->base.destroy = ximage_surface_destroy; @@ -694,7 +588,6 @@ ximage_display_destroy(struct native_display *ndpy) free(xdpy->configs); xdpy->base.screen->destroy(xdpy->base.screen); - free(xdpy->winsys); x11_screen_destroy(xdpy->xscr); if (xdpy->own_dpy) @@ -703,7 +596,7 @@ ximage_display_destroy(struct native_display *ndpy) } struct native_display * -x11_create_ximage_display(EGLNativeDisplayType dpy, boolean use_xshm) +x11_create_ximage_display(EGLNativeDisplayType dpy) { struct ximage_display *xdpy; @@ -728,11 +621,8 @@ x11_create_ximage_display(EGLNativeDisplayType dpy, boolean use_xshm) return NULL; } - xdpy->use_xshm = - (use_xshm && x11_screen_support(xdpy->xscr, X11_SCREEN_EXTENSION_XSHM)); - - xdpy->winsys = create_sw_winsys(); - xdpy->base.screen = softpipe_create_screen(xdpy->winsys); + xdpy->driver = xlib_sw_winsys_init(); + xdpy->base.screen = xdpy->driver->create_pipe_screen(xdpy->dpy); xdpy->base.destroy = ximage_display_destroy; diff --git a/src/gallium/state_trackers/egl/x11/sw_winsys.c b/src/gallium/state_trackers/egl/x11/sw_winsys.c deleted file mode 100644 index 33328aadf2..0000000000 --- a/src/gallium/state_trackers/egl/x11/sw_winsys.c +++ /dev/null @@ -1,231 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -/** - * Totally software-based winsys layer. - * Note that the one winsys function that we can't implement here - * is flush_frontbuffer(). - * Whoever uses this code will have to provide that. - * - * Authors: Brian Paul - */ - - -#include "util/u_simple_screen.h" -#include "pipe/p_state.h" -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_math.h" -#include "util/u_memory.h" - -#include "sw_winsys.h" - - - -/** Subclass of pipe_winsys */ -struct sw_pipe_winsys -{ - struct pipe_winsys Base; - /* no extra fields for now */ -}; - - -/** subclass of pipe_buffer */ -struct sw_pipe_buffer -{ - struct pipe_buffer Base; - boolean UserBuffer; /** Is this a user-space buffer? */ - void *Data; - void *Mapped; -}; - - -/** cast wrapper */ -static INLINE struct sw_pipe_buffer * -sw_pipe_buffer(struct pipe_buffer *b) -{ - return (struct sw_pipe_buffer *) b; -} - - -static const char * -get_name(struct pipe_winsys *pws) -{ - return "software"; -} - - -/** Create new pipe_buffer and allocate storage of given size */ -static struct pipe_buffer * -buffer_create(struct pipe_winsys *pws, - unsigned alignment, - unsigned usage, - unsigned size) -{ - struct sw_pipe_buffer *buffer = CALLOC_STRUCT(sw_pipe_buffer); - if (!buffer) - return NULL; - - pipe_reference_init(&buffer->Base.reference, 1); - buffer->Base.alignment = alignment; - buffer->Base.usage = usage; - buffer->Base.size = size; - - /* align to 16-byte multiple for Cell */ - buffer->Data = align_malloc(size, MAX2(alignment, 16)); - - return &buffer->Base; -} - - -/** - * Create buffer which wraps user-space data. - */ -static struct pipe_buffer * -user_buffer_create(struct pipe_winsys *pws, void *ptr, unsigned bytes) -{ - struct sw_pipe_buffer *buffer = CALLOC_STRUCT(sw_pipe_buffer); - if (!buffer) - return NULL; - - pipe_reference_init(&buffer->Base.reference, 1); - buffer->Base.size = bytes; - buffer->UserBuffer = TRUE; - buffer->Data = ptr; - - return &buffer->Base; -} - - -static void * -buffer_map(struct pipe_winsys *pws, struct pipe_buffer *buf, unsigned flags) -{ - struct sw_pipe_buffer *buffer = sw_pipe_buffer(buf); - buffer->Mapped = buffer->Data; - return buffer->Mapped; -} - - -static void -buffer_unmap(struct pipe_winsys *pws, struct pipe_buffer *buf) -{ - struct sw_pipe_buffer *buffer = sw_pipe_buffer(buf); - buffer->Mapped = NULL; -} - - -static void -buffer_destroy(struct pipe_buffer *buf) -{ - struct sw_pipe_buffer *buffer = sw_pipe_buffer(buf); - - if (buffer->Data && !buffer->UserBuffer) { - align_free(buffer->Data); - buffer->Data = NULL; - } - - free(buffer); -} - - -static struct pipe_buffer * -surface_buffer_create(struct pipe_winsys *winsys, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride) -{ - const unsigned alignment = 64; - unsigned nblocksy; - - nblocksy = util_format_get_nblocksy(format, height); - *stride = align(util_format_get_stride(format, width), alignment); - - return winsys->buffer_create(winsys, alignment, - usage, - *stride * nblocksy); -} - - -static void -fence_reference(struct pipe_winsys *sws, struct pipe_fence_handle **ptr, - struct pipe_fence_handle *fence) -{ - /* no-op */ -} - - -static int -fence_signalled(struct pipe_winsys *sws, struct pipe_fence_handle *fence, - unsigned flag) -{ - /* no-op */ - return 0; -} - - -static int -fence_finish(struct pipe_winsys *sws, struct pipe_fence_handle *fence, - unsigned flag) -{ - /* no-op */ - return 0; -} - - -/** - * Create/return a new pipe_winsys object. - */ -struct pipe_winsys * -create_sw_winsys(void) -{ - struct sw_pipe_winsys *ws = CALLOC_STRUCT(sw_pipe_winsys); - if (!ws) - return NULL; - - /* Fill in this struct with callbacks that pipe will need to - * communicate with the window system, buffer manager, etc. - */ - ws->Base.buffer_create = buffer_create; - ws->Base.user_buffer_create = user_buffer_create; - ws->Base.buffer_map = buffer_map; - ws->Base.buffer_unmap = buffer_unmap; - ws->Base.buffer_destroy = buffer_destroy; - - ws->Base.surface_buffer_create = surface_buffer_create; - - ws->Base.fence_reference = fence_reference; - ws->Base.fence_signalled = fence_signalled; - ws->Base.fence_finish = fence_finish; - - ws->Base.flush_frontbuffer = NULL; /* not implemented here! */ - - ws->Base.get_name = get_name; - - return &ws->Base; -} diff --git a/src/gallium/state_trackers/egl/x11/sw_winsys.h b/src/gallium/state_trackers/egl/x11/sw_winsys.h deleted file mode 100644 index f96c5a14b0..0000000000 --- a/src/gallium/state_trackers/egl/x11/sw_winsys.h +++ /dev/null @@ -1,40 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#ifndef SW_WINSYS_H -#define SW_WINSYS_H - - -struct pipe_winsys; - - -extern struct pipe_winsys * -create_sw_winsys(void); - - -#endif /* SW_WINSYS_H */ diff --git a/src/gallium/winsys/drm/Makefile.egl b/src/gallium/winsys/drm/Makefile.egl index 8363de6e97..a006ad70b6 100644 --- a/src/gallium/winsys/drm/Makefile.egl +++ b/src/gallium/winsys/drm/Makefile.egl @@ -13,7 +13,8 @@ EGL_DRIVER_OBJECTS = $(EGL_DRIVER_SOURCES:.c=.o) common_LIBS = -ldrm -lm -ldl -x11_ST = $(TOP)/src/gallium/state_trackers/egl/libeglx11.a +x11_ST = $(TOP)/src/gallium/state_trackers/egl/libeglx11.a \ + $(TOP)/src/gallium/winsys/xlib/libws_xlib.a x11_LIBS = $(common_LIBS) -lX11 -lXext -lXfixes kms_ST = $(TOP)/src/gallium/state_trackers/egl/libeglkms.a -- cgit v1.2.3 From 6f4ce4a4fed9f0f0f0ee89a63e406ab86dae7150 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 10:54:13 +0000 Subject: Squashed commit of gallium-no-texture-blanket commit f90b3f01af82b9522067b1824e21709a6fb2d3af Author: Keith Whitwell Date: Mon Mar 8 14:39:44 2010 +0000 gallium: remove p_screen::surface_buffer_create This isn't very useful without texture_blanket(), which has also been removed. Note that this function hasn't been removed from the old pipe_winsys (u_simple_screen) still used internally by some drivers (eg softpipe). commit 6c462de39a4b9980a5f034a95e580efdfcb8173b Author: Keith Whitwell Date: Mon Mar 8 14:27:40 2010 +0000 egl/x11: disable texture_blanket usage commit b42da9160df9f47224e5b3291b972f41767aa6e5 Merge: 4be2436 3ca9336 Author: Keith Whitwell Date: Mon Mar 8 14:27:24 2010 +0000 Merge commit 'origin/master' into gallium-no-texture-blanket Conflicts: src/gallium/drivers/svga/svga_screen_texture.c commit 4be2436316929e3dfc55bc34d810920c06556b66 Author: Keith Whitwell Date: Thu Mar 4 14:59:26 2010 +0000 gallium: remove texture blanket call No longer needed, except for nouveau and egl/xll/native_ximage.c. Fix for nouveau is to keep the call, but move it to an internal function within nouveau. Fix for that egl/x11 relies on gallium-sw-api branch or its successor. commit 69b6764330367d63c237d0bde9fb96435d0e0257 Author: Keith Whitwell Date: Thu Mar 4 13:35:16 2010 +0000 drm_api: wrap comment --- src/gallium/auxiliary/util/u_simple_screen.c | 16 ----- src/gallium/drivers/i915/i915_texture.c | 38 ------------ src/gallium/drivers/i965/brw_screen_texture.c | 9 +-- src/gallium/drivers/i965/brw_winsys.h | 22 ------- src/gallium/drivers/identity/id_screen.c | 47 --------------- src/gallium/drivers/llvmpipe/lp_screen.c | 13 ---- src/gallium/drivers/llvmpipe/lp_texture.c | 38 ------------ src/gallium/drivers/nouveau/nouveau_screen.c | 3 +- src/gallium/drivers/nouveau/nouveau_screen.h | 12 ++++ src/gallium/drivers/nv30/nv30_miptree.c | 3 +- src/gallium/drivers/nv40/nv40_miptree.c | 3 +- src/gallium/drivers/nv50/nv50_miptree.c | 3 +- src/gallium/drivers/r300/r300_texture.c | 36 ----------- src/gallium/drivers/softpipe/sp_texture.c | 48 +++------------ src/gallium/drivers/svga/svga_screen_texture.c | 65 -------------------- src/gallium/drivers/trace/tr_screen.c | 70 ---------------------- src/gallium/include/pipe/p_screen.h | 28 --------- src/gallium/include/state_tracker/drm_api.h | 5 +- src/gallium/state_trackers/egl/x11/native_ximage.c | 9 ++- 19 files changed, 40 insertions(+), 428 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_simple_screen.c b/src/gallium/auxiliary/util/u_simple_screen.c index 53f3c16dbc..9203cb6580 100644 --- a/src/gallium/auxiliary/util/u_simple_screen.c +++ b/src/gallium/auxiliary/util/u_simple_screen.c @@ -59,22 +59,7 @@ pass_user_buffer_create(struct pipe_screen *screen, return buffer; } -static struct pipe_buffer * -pass_surface_buffer_create(struct pipe_screen *screen, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride) -{ - struct pipe_buffer *buffer = - screen->winsys->surface_buffer_create(screen->winsys, width, height, - format, usage, tex_usage, stride); - buffer->screen = screen; - - return buffer; -} static void * pass_buffer_map(struct pipe_screen *screen, @@ -135,7 +120,6 @@ u_simple_screen_init(struct pipe_screen *screen) { screen->buffer_create = pass_buffer_create; screen->user_buffer_create = pass_user_buffer_create; - screen->surface_buffer_create = pass_surface_buffer_create; screen->buffer_map = pass_buffer_map; screen->buffer_unmap = pass_buffer_unmap; diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index 5b1f42313e..3ce52cdcdb 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -724,43 +724,6 @@ i915_texture_get_handle(struct pipe_screen * screen, return iws->buffer_get_handle(iws, tex->buffer, whandle, tex->stride); } -static struct pipe_texture * -i915_texture_blanket(struct pipe_screen * screen, - const struct pipe_texture *base, - const unsigned *stride, - struct pipe_buffer *buffer) -{ -#if 0 - struct i915_texture *tex; - assert(screen); - - /* Only supports one type */ - if (base->target != PIPE_TEXTURE_2D || - base->last_level != 0 || - base->depth0 != 1) { - return NULL; - } - - tex = CALLOC_STRUCT(i915_texture); - if (!tex) - return NULL; - - tex->base = *base; - pipe_reference_init(&tex->base.reference, 1); - tex->base.screen = screen; - - tex->stride = stride[0]; - - i915_miptree_set_level_info(tex, 0, 1, base->width0, base->height0, 1); - i915_miptree_set_image_offset(tex, 0, 0, 0, 0); - - pipe_buffer_reference(&tex->buffer, buffer); - - return &tex->base; -#else - return NULL; -#endif -} static void i915_texture_destroy(struct pipe_texture *pt) @@ -923,7 +886,6 @@ i915_init_screen_texture_functions(struct i915_screen *is) is->base.texture_create = i915_texture_create; is->base.texture_from_handle = i915_texture_from_handle; is->base.texture_get_handle = i915_texture_get_handle; - is->base.texture_blanket = i915_texture_blanket; is->base.texture_destroy = i915_texture_destroy; is->base.get_tex_surface = i915_get_tex_surface; is->base.tex_surface_destroy = i915_tex_surface_destroy; diff --git a/src/gallium/drivers/i965/brw_screen_texture.c b/src/gallium/drivers/i965/brw_screen_texture.c index caa16ee150..cc79bfc771 100644 --- a/src/gallium/drivers/i965/brw_screen_texture.c +++ b/src/gallium/drivers/i965/brw_screen_texture.c @@ -416,13 +416,7 @@ brw_texture_get_handle(struct pipe_screen *screen, return bscreen->sws->bo_get_handle(tex->bo, whandle, stride); } -static struct pipe_texture *brw_texture_blanket(struct pipe_screen *screen, - const struct pipe_texture *templ, - const unsigned *stride, - struct pipe_buffer *buffer) -{ - return NULL; -} + static void brw_texture_destroy(struct pipe_texture *pt) { @@ -571,7 +565,6 @@ void brw_screen_tex_init( struct brw_screen *brw_screen ) brw_screen->base.texture_from_handle = brw_texture_from_handle; brw_screen->base.texture_get_handle = brw_texture_get_handle; brw_screen->base.texture_destroy = brw_texture_destroy; - brw_screen->base.texture_blanket = brw_texture_blanket; brw_screen->base.get_tex_transfer = brw_get_tex_transfer; brw_screen->base.transfer_map = brw_transfer_map; brw_screen->base.transfer_unmap = brw_transfer_unmap; diff --git a/src/gallium/drivers/i965/brw_winsys.h b/src/gallium/drivers/i965/brw_winsys.h index 139e26e31f..f30c7f1813 100644 --- a/src/gallium/drivers/i965/brw_winsys.h +++ b/src/gallium/drivers/i965/brw_winsys.h @@ -267,28 +267,6 @@ bo_reference(struct brw_winsys_buffer **ptr, struct brw_winsys_buffer *buf) struct pipe_screen *brw_create_screen(struct brw_winsys_screen *iws, unsigned pci_id); -/** - * Get the brw_winsys buffer backing the texture. - * - * TODO UGLY - */ -struct pipe_texture; -boolean brw_texture_get_winsys_buffer(struct pipe_texture *texture, - struct brw_winsys_buffer **buffer, - unsigned *stride); - -/** - * Wrap a brw_winsys buffer with a texture blanket. - * - * TODO UGLY - */ -struct pipe_texture * -brw_texture_blanket_winsys_buffer(struct pipe_screen *screen, - const struct pipe_texture *template, - unsigned pitch, - unsigned tiling, - struct brw_winsys_buffer *buffer); - /************************************************************************* * Cooperative dumping between winsys and driver. TODO: make this diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c index 77e15b92f7..b9d0f003d7 100644 --- a/src/gallium/drivers/identity/id_screen.c +++ b/src/gallium/drivers/identity/id_screen.c @@ -167,27 +167,7 @@ identity_screen_texture_get_handle(struct pipe_screen *_screen, return screen->texture_get_handle(screen, texture, handle); } -static struct pipe_texture * -identity_screen_texture_blanket(struct pipe_screen *_screen, - const struct pipe_texture *templat, - const unsigned *stride, - struct pipe_buffer *_buffer) -{ - struct identity_screen *id_screen = identity_screen(_screen); - struct identity_buffer *id_buffer = identity_buffer(_buffer); - struct pipe_screen *screen = id_screen->screen; - struct pipe_buffer *buffer = id_buffer->buffer; - struct pipe_texture *result; - - result = screen->texture_blanket(screen, - templat, - stride, - buffer); - if (result) - return identity_texture_create(id_screen, result); - return NULL; -} static void identity_screen_texture_destroy(struct pipe_texture *_texture) @@ -331,31 +311,6 @@ identity_screen_user_buffer_create(struct pipe_screen *_screen, return NULL; } -static struct pipe_buffer * -identity_screen_surface_buffer_create(struct pipe_screen *_screen, - unsigned width, - unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride) -{ - struct identity_screen *id_screen = identity_screen(_screen); - struct pipe_screen *screen = id_screen->screen; - struct pipe_buffer *result; - - result = screen->surface_buffer_create(screen, - width, - height, - format, - usage, - tex_usage, - stride); - - if (result) - return identity_buffer_create(id_screen, result); - return NULL; -} static void * identity_screen_buffer_map(struct pipe_screen *_screen, @@ -530,7 +485,6 @@ identity_screen_create(struct pipe_screen *screen) id_screen->base.texture_create = identity_screen_texture_create; id_screen->base.texture_from_handle = identity_screen_texture_from_handle; id_screen->base.texture_get_handle = identity_screen_texture_get_handle; - id_screen->base.texture_blanket = identity_screen_texture_blanket; id_screen->base.texture_destroy = identity_screen_texture_destroy; id_screen->base.get_tex_surface = identity_screen_get_tex_surface; id_screen->base.tex_surface_destroy = identity_screen_tex_surface_destroy; @@ -540,7 +494,6 @@ identity_screen_create(struct pipe_screen *screen) id_screen->base.transfer_unmap = identity_screen_transfer_unmap; id_screen->base.buffer_create = identity_screen_buffer_create; id_screen->base.user_buffer_create = identity_screen_user_buffer_create; - id_screen->base.surface_buffer_create = identity_screen_surface_buffer_create; if (screen->buffer_map) id_screen->base.buffer_map = identity_screen_buffer_map; if (screen->buffer_map_range) diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 2c6fd67eae..934b0d8439 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -238,18 +238,6 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, } -static struct pipe_buffer * -llvmpipe_surface_buffer_create(struct pipe_screen *screen, - unsigned width, unsigned height, - enum pipe_format format, - unsigned tex_usage, - unsigned usage, - unsigned *stride) -{ - /* This function should never be used */ - assert(0); - return NULL; -} static void @@ -309,7 +297,6 @@ llvmpipe_create_screen(struct llvmpipe_winsys *winsys) screen->base.get_paramf = llvmpipe_get_paramf; screen->base.is_format_supported = llvmpipe_is_format_supported; - screen->base.surface_buffer_create = llvmpipe_surface_buffer_create; screen->base.context_create = llvmpipe_create_context; screen->base.flush_frontbuffer = llvmpipe_flush_frontbuffer; diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 7d15e85600..e41d6238ed 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -143,43 +143,6 @@ llvmpipe_texture_create(struct pipe_screen *_screen, } -static struct pipe_texture * -llvmpipe_texture_blanket(struct pipe_screen * screen, - const struct pipe_texture *base, - const unsigned *stride, - struct pipe_buffer *buffer) -{ - /* FIXME */ -#if 0 - struct llvmpipe_texture *lpt; - assert(screen); - - /* Only supports one type */ - if (base->target != PIPE_TEXTURE_2D || - base->last_level != 0 || - base->depth0 != 1) { - return NULL; - } - - lpt = CALLOC_STRUCT(llvmpipe_texture); - if (!lpt) - return NULL; - - lpt->base = *base; - pipe_reference_init(&lpt->base.reference, 1); - lpt->base.screen = screen; - lpt->stride[0] = stride[0]; - - pipe_buffer_reference(&lpt->buffer, buffer); - - return &lpt->base; -#else - debug_printf("llvmpipe_texture_blanket() not implemented!"); - return NULL; -#endif -} - - static void llvmpipe_texture_destroy(struct pipe_texture *pt) { @@ -409,7 +372,6 @@ void llvmpipe_init_screen_texture_funcs(struct pipe_screen *screen) { screen->texture_create = llvmpipe_texture_create; - screen->texture_blanket = llvmpipe_texture_blanket; screen->texture_destroy = llvmpipe_texture_destroy; screen->get_tex_surface = llvmpipe_get_tex_surface; diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index 2013eef0c5..f7d10a591f 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -273,7 +273,8 @@ nouveau_screen_texture_from_handle(struct pipe_screen *pscreen, pb->usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE | PIPE_BUFFER_USAGE_CPU_READ_WRITE; pb->size = nouveau_bo(pb)->size; - pt = pscreen->texture_blanket(pscreen, templ, &whandle->stride, pb); + pt = nouveau_screen(pscreen)->texture_blanket(pscreen, templ, + &whandle->stride, pb); pipe_buffer_reference(&pb, NULL); return pt; } diff --git a/src/gallium/drivers/nouveau/nouveau_screen.h b/src/gallium/drivers/nouveau/nouveau_screen.h index a7927d88df..f4a7a2bc23 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.h +++ b/src/gallium/drivers/nouveau/nouveau_screen.h @@ -6,6 +6,18 @@ struct nouveau_screen { struct nouveau_device *device; struct nouveau_channel *channel; + /** + * Create a new texture object, using the given template info, but on top of + * existing memory. + * + * It is assumed that the buffer data is layed out according to the expected + * by the hardware. NULL will be returned if any inconsistency is found. + */ + struct pipe_texture * (*texture_blanket)(struct pipe_screen *, + const struct pipe_texture *templat, + const unsigned *stride, + struct pipe_buffer *buffer); + int (*pre_pipebuffer_map_callback) (struct pipe_screen *pscreen, struct pipe_buffer *pb, unsigned usage); }; diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index cb756cf6e6..5ef74a832d 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -232,8 +232,9 @@ void nv30_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv30_miptree_create; - pscreen->texture_blanket = nv30_miptree_blanket; pscreen->texture_destroy = nv30_miptree_destroy; pscreen->get_tex_surface = nv30_miptree_surface_new; pscreen->tex_surface_destroy = nv30_miptree_surface_del; + + nouveau_screen(pscreen)->texture_blanket = nv50_miptree_blanket; } diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index b17255dc6b..62e97bcea4 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -227,9 +227,10 @@ void nv40_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv40_miptree_create; - pscreen->texture_blanket = nv40_miptree_blanket; pscreen->texture_destroy = nv40_miptree_destroy; pscreen->get_tex_surface = nv40_miptree_surface_new; pscreen->tex_surface_destroy = nv40_miptree_surface_del; + + nouveau_screen(pscreen)->texture_blanket = nv40_miptree_blanket; } diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index a7788249ab..e091cae602 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -255,9 +255,10 @@ void nv50_screen_init_miptree_functions(struct pipe_screen *pscreen) { pscreen->texture_create = nv50_miptree_create; - pscreen->texture_blanket = nv50_miptree_blanket; pscreen->texture_destroy = nv50_miptree_destroy; pscreen->get_tex_surface = nv50_miptree_surface_new; pscreen->tex_surface_destroy = nv50_miptree_surface_del; + + nouveau_screen(pscreen)->texture_blanket = nv50_miptree_blanket; } diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 21e5910450..04124afd4d 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -851,41 +851,6 @@ static void r300_tex_surface_destroy(struct pipe_surface* s) FREE(s); } -static struct pipe_texture* - r300_texture_blanket(struct pipe_screen* screen, - const struct pipe_texture* base, - const unsigned* stride, - struct pipe_buffer* buffer) -{ - struct r300_texture* tex; - struct r300_screen* rscreen = r300_screen(screen); - - /* Support only 2D textures without mipmaps */ - if (base->target != PIPE_TEXTURE_2D || - base->depth0 != 1 || - base->last_level != 0) { - return NULL; - } - - tex = CALLOC_STRUCT(r300_texture); - if (!tex) { - return NULL; - } - - tex->tex = *base; - pipe_reference_init(&tex->tex.reference, 1); - tex->tex.screen = screen; - - tex->stride_override = *stride; - tex->pitch[0] = *stride / util_format_get_blocksize(base->format); - - r300_setup_flags(tex); - r300_setup_texture_state(rscreen, tex); - - pipe_buffer_reference(&tex->buffer, buffer); - - return (struct pipe_texture*)tex; -} static struct pipe_texture* r300_texture_from_handle(struct pipe_screen* screen, @@ -1007,7 +972,6 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen) screen->texture_destroy = r300_texture_destroy; screen->get_tex_surface = r300_get_tex_surface; screen->tex_surface_destroy = r300_tex_surface_destroy; - screen->texture_blanket = r300_texture_blanket; screen->video_surface_create = r300_video_surface_create; screen->video_surface_destroy= r300_video_surface_destroy; diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index 6ea060023d..c0052359fd 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -36,6 +36,7 @@ #include "util/u_format.h" #include "util/u_math.h" #include "util/u_memory.h" +#include "util/u_simple_screen.h" #include "sp_context.h" #include "sp_texture.h" @@ -91,13 +92,13 @@ softpipe_displaytarget_layout(struct pipe_screen *screen, PIPE_BUFFER_USAGE_GPU_READ_WRITE); unsigned tex_usage = spt->base.tex_usage; - spt->buffer = screen->surface_buffer_create( screen, - spt->base.width0, - spt->base.height0, - spt->base.format, - usage, - tex_usage, - &spt->stride[0]); + spt->buffer = screen->winsys->surface_buffer_create( screen->winsys, + spt->base.width0, + spt->base.height0, + spt->base.format, + usage, + tex_usage, + &spt->stride[0]); return spt->buffer != NULL; } @@ -141,38 +142,6 @@ softpipe_texture_create(struct pipe_screen *screen, } -/** - * Create a new pipe_texture which wraps an existing buffer. - */ -static struct pipe_texture * -softpipe_texture_blanket(struct pipe_screen * screen, - const struct pipe_texture *base, - const unsigned *stride, - struct pipe_buffer *buffer) -{ - struct softpipe_texture *spt; - assert(screen); - - /* Only supports one type */ - if (base->target != PIPE_TEXTURE_2D || - base->last_level != 0 || - base->depth0 != 1) { - return NULL; - } - - spt = CALLOC_STRUCT(softpipe_texture); - if (!spt) - return NULL; - - spt->base = *base; - pipe_reference_init(&spt->base.reference, 1); - spt->base.screen = screen; - spt->stride[0] = stride[0]; - - pipe_buffer_reference(&spt->buffer, buffer); - - return &spt->base; -} static void @@ -459,7 +428,6 @@ void softpipe_init_screen_texture_funcs(struct pipe_screen *screen) { screen->texture_create = softpipe_texture_create; - screen->texture_blanket = softpipe_texture_blanket; screen->texture_destroy = softpipe_texture_destroy; screen->get_tex_surface = softpipe_get_tex_surface; diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index 4b045c44d8..5b581debfc 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -359,71 +359,7 @@ error1: } -static struct pipe_texture * -svga_texture_blanket(struct pipe_screen * screen, - const struct pipe_texture *base, - const unsigned *stride, - struct pipe_buffer *buffer) -{ - struct svga_texture *tex; - struct svga_buffer *sbuf = svga_buffer(buffer); - struct svga_winsys_screen *sws = svga_winsys_screen(screen); - assert(screen); - - /* Only supports one type */ - if (base->target != PIPE_TEXTURE_2D || - base->last_level != 0 || - base->depth0 != 1) { - return NULL; - } - - /** - * We currently can't do texture blanket on - * SVGA3D_BUFFER. Need to blit to a temporary surface? - */ - - assert(sbuf->handle); - if (!sbuf->handle) - return NULL; - - if (svga_translate_format(base->format) != sbuf->key.format) { - unsigned f1 = svga_translate_format(base->format); - unsigned f2 = sbuf->key.format; - - /* It's okay for XRGB and ARGB or depth with/out stencil to get mixed up */ - if ( !( (f1 == SVGA3D_X8R8G8B8 && f2 == SVGA3D_A8R8G8B8) || - (f1 == SVGA3D_A8R8G8B8 && f2 == SVGA3D_X8R8G8B8) || - (f1 == SVGA3D_Z_D24X8 && f2 == SVGA3D_Z_D24S8) ) ) { - debug_printf("%s wrong format %u != %u\n", __FUNCTION__, f1, f2); - return NULL; - } - } - - tex = CALLOC_STRUCT(svga_texture); - if (!tex) - return NULL; - - tex->base = *base; - - if (sbuf->key.format == 1) - tex->base.format = PIPE_FORMAT_B8G8R8X8_UNORM; - else if (sbuf->key.format == 2) - tex->base.format = PIPE_FORMAT_B8G8R8A8_UNORM; - - pipe_reference_init(&tex->base.reference, 1); - tex->base.screen = screen; - - SVGA_DBG(DEBUG_DMA, "blanket sid %p\n", sbuf->handle); - - /* We don't own this storage, so don't try to cache it. - */ - assert(sbuf->key.cachable == 0); - tex->key.cachable = 0; - sws->surface_reference(sws, &tex->handle, sbuf->handle); - - return &tex->base; -} static struct pipe_texture * @@ -984,7 +920,6 @@ svga_screen_init_texture_functions(struct pipe_screen *screen) screen->texture_destroy = svga_texture_destroy; screen->get_tex_surface = svga_get_tex_surface; screen->tex_surface_destroy = svga_tex_surface_destroy; - screen->texture_blanket = svga_texture_blanket; screen->get_tex_transfer = svga_get_tex_transfer; screen->transfer_map = svga_transfer_map; screen->transfer_unmap = svga_transfer_unmap; diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index ac0876c3a8..a15addeb8c 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -269,36 +269,6 @@ trace_screen_texture_get_handle(struct pipe_screen *_screen, return screen->texture_get_handle(screen, texture, handle); } -static struct pipe_texture * -trace_screen_texture_blanket(struct pipe_screen *_screen, - const struct pipe_texture *templat, - const unsigned *ppitch, - struct pipe_buffer *_buffer) -{ - struct trace_screen *tr_scr = trace_screen(_screen); - struct trace_buffer *tr_buf = trace_buffer(_buffer); - struct pipe_screen *screen = tr_scr->screen; - struct pipe_buffer *buffer = tr_buf->buffer; - unsigned pitch = *ppitch; - struct pipe_texture *result; - - trace_dump_call_begin("pipe_screen", "texture_blanket"); - - trace_dump_arg(ptr, screen); - trace_dump_arg(template, templat); - trace_dump_arg(uint, pitch); - trace_dump_arg(ptr, buffer); - - result = screen->texture_blanket(screen, templat, ppitch, buffer); - - trace_dump_ret(ptr, result); - - trace_dump_call_end(); - - result = trace_texture_create(tr_scr, result); - - return result; -} static void @@ -516,45 +486,7 @@ trace_screen_transfer_unmap(struct pipe_screen *_screen, */ -static struct pipe_buffer * -trace_screen_surface_buffer_create(struct pipe_screen *_screen, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *pstride) -{ - struct trace_screen *tr_scr = trace_screen(_screen); - struct pipe_screen *screen = tr_scr->screen; - unsigned stride; - struct pipe_buffer *result; - trace_dump_call_begin("pipe_screen", "surface_buffer_create"); - - trace_dump_arg(ptr, screen); - trace_dump_arg(uint, width); - trace_dump_arg(uint, height); - trace_dump_arg(format, format); - trace_dump_arg(uint, usage); - trace_dump_arg(uint, tex_usage); - - result = screen->surface_buffer_create(screen, - width, height, - format, - usage, - tex_usage, - pstride); - - stride = *pstride; - - trace_dump_arg(uint, stride); - - trace_dump_ret(ptr, result); - - trace_dump_call_end(); - - return trace_buffer_create(tr_scr, result); -} static struct pipe_buffer * @@ -965,7 +897,6 @@ trace_screen_create(struct pipe_screen *screen) tr_scr->base.texture_create = trace_screen_texture_create; tr_scr->base.texture_from_handle = trace_screen_texture_from_handle; tr_scr->base.texture_get_handle = trace_screen_texture_get_handle; - tr_scr->base.texture_blanket = trace_screen_texture_blanket; tr_scr->base.texture_destroy = trace_screen_texture_destroy; tr_scr->base.get_tex_surface = trace_screen_get_tex_surface; tr_scr->base.tex_surface_destroy = trace_screen_tex_surface_destroy; @@ -975,7 +906,6 @@ trace_screen_create(struct pipe_screen *screen) tr_scr->base.transfer_unmap = trace_screen_transfer_unmap; tr_scr->base.buffer_create = trace_screen_buffer_create; tr_scr->base.user_buffer_create = trace_screen_user_buffer_create; - tr_scr->base.surface_buffer_create = trace_screen_surface_buffer_create; if (screen->buffer_map) tr_scr->base.buffer_map = trace_screen_buffer_map; if (screen->buffer_map_range) diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 617c47e4dc..690455f722 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -127,17 +127,6 @@ struct pipe_screen { struct pipe_texture *tex, struct winsys_handle *handle); - /** - * Create a new texture object, using the given template info, but on top of - * existing memory. - * - * It is assumed that the buffer data is layed out according to the expected - * by the hardware. NULL will be returned if any inconsistency is found. - */ - struct pipe_texture * (*texture_blanket)(struct pipe_screen *, - const struct pipe_texture *templat, - const unsigned *stride, - struct pipe_buffer *buffer); void (*texture_destroy)(struct pipe_texture *pt); @@ -207,23 +196,6 @@ struct pipe_screen { void *ptr, unsigned bytes); - /** - * Allocate storage for a display target surface. - * - * Often surfaces which are meant to be blitted to the front screen (i.e., - * display targets) must be allocated with special characteristics, memory - * pools, or obtained directly from the windowing system. - * - * This callback is invoked by the pipe_screenwhen creating a texture marked - * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag to get the underlying - * buffer storage. - */ - struct pipe_buffer *(*surface_buffer_create)(struct pipe_screen *screen, - unsigned width, unsigned height, - enum pipe_format format, - unsigned usage, - unsigned tex_usage, - unsigned *stride); /** diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h index d3edddd5d4..fe7ef253ef 100644 --- a/src/gallium/include/state_tracker/drm_api.h +++ b/src/gallium/include/state_tracker/drm_api.h @@ -26,8 +26,9 @@ enum drm_create_screen_mode { struct winsys_handle { /** - * Unused for texture_from_handle, always DRM_API_HANDLE_TYPE_SHARED. - * Input to texture_get_handle, use TEXTURE_USAGE to select handle for kms or ipc. + * Unused for texture_from_handle, always + * DRM_API_HANDLE_TYPE_SHARED. Input to texture_get_handle, + * use TEXTURE_USAGE to select handle for kms or ipc. */ unsigned type; /** diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 3421c1951a..a94b1ca6c6 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -156,6 +156,11 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, templ.depth0 = 1; templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; +#if 0 + /* Interesting and suprising use of texture_blanket + + * user_buffer_create... To be superceded by the sw_winsys branch, + * but currently disabled. + */ if (xbuf->shm_info) { struct pipe_buffer *pbuf; unsigned stride, size; @@ -188,7 +193,9 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, } } } - else { + else +#endif + { xbuf->texture = screen->texture_create(screen, &templ); } -- cgit v1.2.3 From d5bf9c0a5e51d160e7037297faf7657a0e2c6360 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 11:39:40 +0000 Subject: ws/xlib: manage the GC internally No need for the user of this winsys to supply/manage the x11 gc for us. --- src/gallium/include/state_tracker/xlib_sw_winsys.h | 1 - src/gallium/state_trackers/egl/x11/native_ximage.c | 12 ------ src/gallium/state_trackers/glx/xlib/xm_api.c | 12 ------ src/gallium/winsys/xlib/xlib_sw_winsys.c | 43 +++++++++++++++++++--- 4 files changed, 37 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/gallium/include/state_tracker/xlib_sw_winsys.h b/src/gallium/include/state_tracker/xlib_sw_winsys.h index 915a7b37fb..3cb679426d 100644 --- a/src/gallium/include/state_tracker/xlib_sw_winsys.h +++ b/src/gallium/include/state_tracker/xlib_sw_winsys.h @@ -16,7 +16,6 @@ struct xlib_drawable { Visual *visual; int depth; Drawable drawable; - GC gc; /* temporary? */ }; diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 0006b0caca..0aa25ead25 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -73,8 +73,6 @@ struct ximage_surface { XVisualInfo visual; struct ximage_display *xdpy; - GC gc; - unsigned int server_stamp; unsigned int client_stamp; int width, height; @@ -155,7 +153,6 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, xbuf->xdraw.visual = xsurf->visual.visual; xbuf->xdraw.depth = xsurf->visual.depth; xbuf->xdraw.drawable = xsurf->drawable; - xbuf->xdraw.gc = xsurf->gc; } /* clean up the buffer if allocation failed */ @@ -373,8 +370,6 @@ ximage_surface_destroy(struct native_surface *nsurf) for (i = 0; i < NUM_NATIVE_ATTACHMENTS; i++) ximage_surface_free_buffer(&xsurf->base, i); - if (xsurf->type != XIMAGE_SURFACE_TYPE_PBUFFER) - XFreeGC(xsurf->xdpy->dpy, xsurf->gc); free(xsurf); } @@ -400,13 +395,6 @@ ximage_display_create_surface(struct native_display *ndpy, if (xsurf->type != XIMAGE_SURFACE_TYPE_PBUFFER) { xsurf->drawable = drawable; xsurf->visual = *xconf->visual; - - xsurf->gc = XCreateGC(xdpy->dpy, xsurf->drawable, 0, NULL); - if (!xsurf->gc) { - free(xsurf); - return NULL; - } - /* initialize the geometry */ ximage_surface_update_buffers(&xsurf->base, 0x0); } diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index d8aa59b3b7..cf9a399209 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -446,8 +446,6 @@ xmesa_free_buffer(XMesaBuffer buffer) /* Unreference. If count = zero we'll really delete the buffer */ _mesa_reference_framebuffer(&fb, NULL); - XFreeGC(b->xm_visual->display, b->ws.gc); - free(buffer); return; @@ -524,16 +522,6 @@ initialize_visual_and_buffer(XMesaVisual v, XMesaBuffer b, printf("X/Mesa bits per pixel = %d\n", v->BitsPerPixel); } - if (b && window) { - /* these should have been set in create_xmesa_buffer */ - ASSERT(b->ws.drawable == window); - - - /* X11 graphics context */ - b->ws.gc = XCreateGC( v->display, window, 0, NULL ); - XSetFunction( v->display, b->ws.gc, GXcopy ); - } - return GL_TRUE; } diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c index 9a4ae39aeb..846d79c0eb 100644 --- a/src/gallium/winsys/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -73,6 +73,12 @@ struct xm_displaytarget Display *display; Visual *visual; XImage *tempImage; + GC gc; + + /* This is the last drawable that this display target was presented + * against. May need to recreate gc, tempImage when this changes?? + */ + Drawable drawable; XShmSegmentInfo shminfo; int shm; @@ -260,6 +266,12 @@ xm_displaytarget_destroy(struct sw_winsys *ws, FREE(xm_dt->data); } + if (xm_dt->tempImage) + XDestroyImage(xm_dt->tempImage); + + if (xm_dt->gc) + XFreeGC(xm_dt->display, xm_dt->gc); + FREE(xm_dt); } @@ -272,10 +284,11 @@ void xlib_sw_display(struct xlib_drawable *xlib_drawable, struct sw_displaytarget *dt) { - XImage *ximage; - struct xm_displaytarget *xm_dt = xm_displaytarget(dt); static boolean no_swap = 0; static boolean firsttime = 1; + struct xm_displaytarget *xm_dt = xm_displaytarget(dt); + Display *display = xm_dt->display; + XImage *ximage; if (firsttime) { no_swap = getenv("SP_NO_RAST") != NULL; @@ -285,8 +298,21 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, if (no_swap) return; - if (xm_dt->tempImage == NULL) - { + if (xm_dt->drawable != xlib_drawable->drawable) { + if (xm_dt->gc) { + XFreeGC( display, xm_dt->gc ); + xm_dt->gc = NULL; + } + + if (xm_dt->tempImage) { + XDestroyImage( xm_dt->tempImage ); + xm_dt->tempImage = NULL; + } + + xm_dt->drawable = xlib_drawable->drawable; + } + + if (xm_dt->tempImage == NULL) { assert(util_format_get_blockwidth(xm_dt->format) == 1); assert(util_format_get_blockheight(xm_dt->format) == 1); alloc_ximage(xm_dt, xlib_drawable, @@ -296,6 +322,11 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, return; } + if (xm_dt->gc == NULL) { + xm_dt->gc = XCreateGC( display, xlib_drawable->drawable, 0, NULL ); + XSetFunction( display, xm_dt->gc, GXcopy ); + } + #ifdef USE_XSHM if (xm_dt->shm) { @@ -303,7 +334,7 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, ximage->data = xm_dt->data; /* _debug_printf("XSHM\n"); */ - XShmPutImage(xm_dt->display, xlib_drawable->drawable, xlib_drawable->gc, + XShmPutImage(xm_dt->display, xlib_drawable->drawable, xm_dt->gc, ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height, False); } else @@ -323,7 +354,7 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, ximage->bytes_per_line = xm_dt->stride; /* _debug_printf("XPUT\n"); */ - XPutImage(xm_dt->display, xlib_drawable->drawable, xlib_drawable->gc, + XPutImage(xm_dt->display, xlib_drawable->drawable, xm_dt->gc, ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height); } } -- cgit v1.2.3 From 8ac10162f1412469698322c1c1baf5aaf78a4645 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 11:48:57 +0000 Subject: ws/xlib: remove USE_XSHM preprocessor macro --- src/gallium/winsys/xlib/SConscript | 2 -- src/gallium/winsys/xlib/xlib_sw_winsys.c | 17 +++-------------- 2 files changed, 3 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index 26a13e42b5..587cdb8e38 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -15,8 +15,6 @@ if env['platform'] == 'linux' \ '#/src/gallium/drivers', ]) - env.Append(CPPDEFINES = ['USE_XSHM']) - st_xlib = env.ConvenienceLibrary( target = 'ws_xlib', source = [ diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c index 846d79c0eb..d03e39a249 100644 --- a/src/gallium/winsys/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -111,8 +111,6 @@ xm_displaytarget( struct sw_displaytarget *dt ) * X Shared Memory Image extension code */ -#ifdef USE_XSHM - static volatile int mesaXErrorFlag = 0; /** @@ -197,19 +195,16 @@ alloc_shm_ximage(struct xm_displaytarget *xm_dt, xm_dt->shm = 1; } -#endif /* USE_XSHM */ static void alloc_ximage(struct xm_displaytarget *xm_dt, struct xlib_drawable *xmb, unsigned width, unsigned height) { -#ifdef USE_XSHM if (xm_dt->shm) { alloc_shm_ximage(xm_dt, xmb, width, height); return; } -#endif xm_dt->tempImage = XCreateImage(xm_dt->display, xmb->visual, @@ -253,7 +248,6 @@ xm_displaytarget_destroy(struct sw_winsys *ws, struct xm_displaytarget *xm_dt = xm_displaytarget(dt); if (xm_dt->data) { -#ifdef USE_XSHM if (xm_dt->shminfo.shmid >= 0) { shmdt(xm_dt->shminfo.shmaddr); shmctl(xm_dt->shminfo.shmid, IPC_RMID, 0); @@ -261,9 +255,9 @@ xm_displaytarget_destroy(struct sw_winsys *ws, xm_dt->shminfo.shmid = -1; xm_dt->shminfo.shmaddr = (char *) -1; } - else -#endif + else { FREE(xm_dt->data); + } } if (xm_dt->tempImage) @@ -327,7 +321,6 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, XSetFunction( display, xm_dt->gc, GXcopy ); } -#ifdef USE_XSHM if (xm_dt->shm) { ximage = xm_dt->tempImage; @@ -337,9 +330,7 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable, XShmPutImage(xm_dt->display, xlib_drawable->drawable, xm_dt->gc, ximage, 0, 0, 0, 0, xm_dt->width, xm_dt->height, False); } - else -#endif - { + else { /* display image in Window */ ximage = xm_dt->tempImage; ximage->data = xm_dt->data; @@ -396,7 +387,6 @@ xm_displaytarget_create(struct sw_winsys *winsys, xm_dt->stride = align(util_format_get_stride(format, width), alignment); size = xm_dt->stride * nblocksy; -#ifdef USE_XSHM if (!debug_get_bool_option("XLIB_NO_SHM", FALSE)) { xm_dt->shminfo.shmid = -1; @@ -407,7 +397,6 @@ xm_displaytarget_create(struct sw_winsys *winsys, if(!xm_dt->data) goto no_data; } -#endif if(!xm_dt->data) { xm_dt->data = align_malloc(size, alignment); -- cgit v1.2.3 From fe94a363e53ac5e19a919ea6eef2e22b4da4fc6f Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 12:31:20 +0000 Subject: cell: attempt conversion to sw_winsys --- src/gallium/drivers/cell/ppu/Makefile | 1 + src/gallium/drivers/cell/ppu/cell_buffer.c | 118 +++++++++++++++++++++++ src/gallium/drivers/cell/ppu/cell_buffer.h | 55 +++++++++++ src/gallium/drivers/cell/ppu/cell_context.c | 2 +- src/gallium/drivers/cell/ppu/cell_draw_arrays.c | 51 ++-------- src/gallium/drivers/cell/ppu/cell_screen.c | 61 +++++++++--- src/gallium/drivers/cell/ppu/cell_screen.h | 23 ++++- src/gallium/drivers/cell/ppu/cell_state_emit.c | 5 +- src/gallium/drivers/cell/ppu/cell_state_shader.c | 13 +++ src/gallium/drivers/cell/ppu/cell_texture.c | 97 +++++++++++++++---- src/gallium/drivers/cell/ppu/cell_texture.h | 15 ++- src/gallium/drivers/cell/ppu/cell_winsys.h | 47 --------- 12 files changed, 354 insertions(+), 134 deletions(-) create mode 100644 src/gallium/drivers/cell/ppu/cell_buffer.c create mode 100644 src/gallium/drivers/cell/ppu/cell_buffer.h delete mode 100644 src/gallium/drivers/cell/ppu/cell_winsys.h (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/Makefile b/src/gallium/drivers/cell/ppu/Makefile index c92f8e5cba..8769b826b5 100644 --- a/src/gallium/drivers/cell/ppu/Makefile +++ b/src/gallium/drivers/cell/ppu/Makefile @@ -21,6 +21,7 @@ SPU_CODE_MODULE = ../spu/g3d_spu.a SOURCES = \ cell_batch.c \ + cell_buffer.c \ cell_clear.c \ cell_context.c \ cell_draw_arrays.c \ diff --git a/src/gallium/drivers/cell/ppu/cell_buffer.c b/src/gallium/drivers/cell/ppu/cell_buffer.c new file mode 100644 index 0000000000..770f7328a7 --- /dev/null +++ b/src/gallium/drivers/cell/ppu/cell_buffer.c @@ -0,0 +1,118 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#include "util/u_inlines.h" +#include "util/u_memory.h" +#include "util/u_math.h" + +#include "sp_screen.h" +#include "sp_buffer.h" + + +static void * +cell_buffer_map(struct pipe_screen *screen, + struct pipe_buffer *buf, + unsigned flags) +{ + struct cell_buffer *cell_buf = cell_buffer(buf); + return cell_buf->data; +} + + +static void +cell_buffer_unmap(struct pipe_screen *screen, + struct pipe_buffer *buf) +{ +} + + +static void +cell_buffer_destroy(struct pipe_buffer *buf) +{ + struct cell_buffer *sbuf = cell_buffer(buf); + + if (!sbuf->userBuffer) + align_free(sbuf->data); + + FREE(sbuf); +} + + +static struct pipe_buffer * +cell_buffer_create(struct pipe_screen *screen, + unsigned alignment, + unsigned usage, + unsigned size) +{ + struct cell_buffer *buffer = CALLOC_STRUCT(cell_buffer); + + pipe_reference_init(&buffer->base.reference, 1); + buffer->base.screen = screen; + buffer->base.alignment = MAX2(alignment, 16); + buffer->base.usage = usage; + buffer->base.size = size; + + buffer->data = align_malloc(size, alignment); + + return &buffer->base; +} + + +/** + * Create buffer which wraps user-space data. + */ +static struct pipe_buffer * +cell_user_buffer_create(struct pipe_screen *screen, + void *ptr, + unsigned bytes) +{ + struct cell_buffer *buffer; + + buffer = CALLOC_STRUCT(cell_buffer); + if(!buffer) + return NULL; + + pipe_reference_init(&buffer->base.reference, 1); + buffer->base.screen = screen; + buffer->base.size = bytes; + buffer->userBuffer = TRUE; + buffer->data = ptr; + + return &buffer->base; +} + + +void +cell_init_screen_buffer_funcs(struct pipe_screen *screen) +{ + screen->buffer_create = cell_buffer_create; + screen->user_buffer_create = cell_user_buffer_create; + screen->buffer_map = cell_buffer_map; + screen->buffer_unmap = cell_buffer_unmap; + screen->buffer_destroy = cell_buffer_destroy; +} diff --git a/src/gallium/drivers/cell/ppu/cell_buffer.h b/src/gallium/drivers/cell/ppu/cell_buffer.h new file mode 100644 index 0000000000..ef0a8a70e5 --- /dev/null +++ b/src/gallium/drivers/cell/ppu/cell_buffer.h @@ -0,0 +1,55 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SP_BUFFER_H +#define SP_BUFFER_H + +#include "pipe/p_compiler.h" +#include "pipe/p_state.h" + + +struct cell_buffer +{ + struct pipe_buffer base; + boolean userBuffer; /** Is this a user-space buffer? */ + void *data; +}; + + +/** Cast wrapper */ +static INLINE struct cell_buffer * +cell_buffer( struct pipe_buffer *buf ) +{ + return (struct cell_buffer *)buf; +} + + +void +cell_init_screen_buffer_funcs(struct pipe_screen *screen); + + +#endif /* SP_BUFFER_H */ diff --git a/src/gallium/drivers/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c index 4751ca8957..afcea616d5 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.c +++ b/src/gallium/drivers/cell/ppu/cell_context.c @@ -136,7 +136,7 @@ cell_create_context(struct pipe_screen *screen, memset(cell, 0, sizeof(*cell)); cell->winsys = NULL; /* XXX: fixme - get this from screen? */ - cell->pipe.winsys = screen->winsys; + cell->pipe.winsys = NULL; cell->pipe.screen = screen; cell->pipe.priv = priv; cell->pipe.destroy = cell_destroy_context; diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index db28c26ca8..bd15034a5d 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -39,41 +39,12 @@ #include "cell_draw_arrays.h" #include "cell_state.h" #include "cell_flush.h" +#include "cell_buffer.h" #include "draw/draw_context.h" -static void -cell_map_constant_buffers(struct cell_context *sp) -{ - struct pipe_winsys *ws = sp->pipe.winsys; - uint i; - for (i = 0; i < 2; i++) { - if (sp->constants[i] && sp->constants[i]->size) { - sp->mapped_constants[i] = ws->buffer_map(ws, sp->constants[i], - PIPE_BUFFER_USAGE_CPU_READ); - cell_flush_buffer_range(sp, sp->mapped_constants[i], - sp->constants[i]->size); - } - } - - draw_set_mapped_constant_buffer(sp->draw, PIPE_SHADER_VERTEX, 0, - sp->mapped_constants[PIPE_SHADER_VERTEX], - sp->constants[PIPE_SHADER_VERTEX]->size); -} - -static void -cell_unmap_constant_buffers(struct cell_context *sp) -{ - struct pipe_winsys *ws = sp->pipe.winsys; - uint i; - for (i = 0; i < 2; i++) { - if (sp->constants[i] && sp->constants[i]->size) - ws->buffer_unmap(ws, sp->constants[i]); - sp->mapped_constants[i] = NULL; - } -} @@ -102,23 +73,17 @@ cell_draw_range_elements(struct pipe_context *pipe, #if 0 cell_map_surfaces(sp); #endif - cell_map_constant_buffers(sp); /* * Map vertex buffers */ for (i = 0; i < sp->num_vertex_buffers; i++) { - void *buf = pipe_buffer_map(pipe->screen, - sp->vertex_buffer[i].buffer, - PIPE_BUFFER_USAGE_CPU_READ); - cell_flush_buffer_range(sp, buf, sp->vertex_buffer[i].buffer->size); + void *buf = cell_buffer(cell->vertex_buffer[i].buffer)->data; draw_set_mapped_vertex_buffer(draw, i, buf); } /* Map index buffer, if present */ if (indexBuffer) { - void *mapped_indexes = pipe_buffer_map(pipe->screen, - indexBuffer, - PIPE_BUFFER_USAGE_CPU_READ); + void *mapped_indexes = cell_buffer(indexBuffer)->data; draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes); } else { @@ -135,15 +100,17 @@ cell_draw_range_elements(struct pipe_context *pipe, */ for (i = 0; i < sp->num_vertex_buffers; i++) { draw_set_mapped_vertex_buffer(draw, i, NULL); - pipe_buffer_unmap(pipe->screen, sp->vertex_buffer[i].buffer); } if (indexBuffer) { draw_set_mapped_element_buffer(draw, 0, NULL); - pipe_buffer_unmap(pipe->screen, indexBuffer); } - /* Note: leave drawing surfaces mapped */ - cell_unmap_constant_buffers(sp); + /* + * TODO: Flush only when a user vertex/index buffer is present + * (or even better, modify draw module to do this + * internally when this condition is seen?) + */ + draw_flush(draw); } diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 77bd849a15..36479e8e0c 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -35,7 +35,9 @@ #include "cell_context.h" #include "cell_screen.h" #include "cell_texture.h" -#include "cell_winsys.h" +#include "cell_buffer.h" + +#include "state_tracker/sw_winsys.h" static const char * @@ -133,19 +135,28 @@ cell_is_format_supported( struct pipe_screen *screen, unsigned tex_usage, unsigned geom_flags ) { - /* cell supports most formats, XXX for now anyway */ + struct sw_winsys *winsys = cell_screen(screen)->winsys; + if (format == PIPE_FORMAT_DXT5_RGBA || format == PIPE_FORMAT_A8B8G8R8_SRGB) return FALSE; - else - return TRUE; + + if (tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) { + if (!winsys->is_displaytarget_format_supported(winsys, format)) + return FALSE; + } + + /* This is often a lie. Pull in logic from llvmpipe to fix. + */ + return TRUE; } static void cell_destroy_screen( struct pipe_screen *screen ) { - struct pipe_winsys *winsys = screen->winsys; + struct cell_screen *sp_screen = cell_screen(screen); + struct sw_winsys *winsys = sp_screen->winsys; if(winsys->destroy) winsys->destroy(winsys); @@ -153,6 +164,23 @@ cell_destroy_screen( struct pipe_screen *screen ) FREE(screen); } +/* This used to be overriden by the co-state tracker, but really needs + * to be active with sw_winsys. + */ +static void +cell_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_surface *surface, + void *context_private) +{ + struct cell_screen *screen = cell_screen(_screen); + struct sw_winsys *winsys = screen->winsys; + struct cell_texture *texture = cell_texture(surface->texture); + + assert(texture->dt); + if (texture->dt) + winsys->displaytarget_display(winsys, texture->dt, context_private); +} + /** * Create a new pipe_screen object @@ -160,26 +188,27 @@ cell_destroy_screen( struct pipe_screen *screen ) * that would be the place to put SPU thread/context info... */ struct pipe_screen * -cell_create_screen(struct pipe_winsys *winsys) +cell_create_screen(struct sw_winsys *winsys) { - struct pipe_screen *screen = CALLOC_STRUCT(pipe_screen); + struct cell_screen *screen = CALLOC_STRUCT(pipe_screen); if (!screen) return NULL; screen->winsys = winsys; + screen->base.winsys = NULL; - screen->destroy = cell_destroy_screen; + screen->base.destroy = cell_destroy_screen; - screen->get_name = cell_get_name; - screen->get_vendor = cell_get_vendor; - screen->get_param = cell_get_param; - screen->get_paramf = cell_get_paramf; - screen->is_format_supported = cell_is_format_supported; - screen->context_create = cell_create_context; + screen->base.get_name = cell_get_name; + screen->base.get_vendor = cell_get_vendor; + screen->base.get_param = cell_get_param; + screen->base.get_paramf = cell_get_paramf; + screen->base.is_format_supported = cell_is_format_supported; + screen->base.context_create = cell_create_context; - cell_init_screen_texture_funcs(screen); - u_simple_screen_init(screen); + cell_init_screen_texture_funcs(&screen->base); + cell_init_screen_buffer_funcs(&screen->base); return screen; } diff --git a/src/gallium/drivers/cell/ppu/cell_screen.h b/src/gallium/drivers/cell/ppu/cell_screen.h index c7e15889d6..6a22433b56 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.h +++ b/src/gallium/drivers/cell/ppu/cell_screen.h @@ -30,12 +30,29 @@ #define CELL_SCREEN_H -struct pipe_screen; -struct pipe_winsys; +#include "pipe/p_screen.h" +struct sw_winsys; + +struct cell_screen { + struct pipe_screen base; + + struct sw_winsys *winsys; + + /* Increments whenever textures are modified. Contexts can track + * this. + */ + unsigned timestamp; +}; + +static INLINE struct cell_screen * +cell_screen( struct pipe_screen *pipe ) +{ + return (struct cell_screen *)pipe; +} extern struct pipe_screen * -cell_create_screen(struct pipe_winsys *winsys); +cell_create_screen(struct sw_winsys *winsys); #endif /* CELL_SCREEN_H */ diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c index a59c7828ac..424e2628a9 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_emit.c +++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c @@ -245,16 +245,13 @@ cell_emit_state(struct cell_context *cell) uint i, j; float *buf = cell_batch_alloc16(cell, ROUNDUP16(32 + num_const * sizeof(float))); uint32_t *ibuf = (uint32_t *) buf; - const float *constants = pipe_buffer_map(cell->pipe.screen, - cell->constants[shader], - PIPE_BUFFER_USAGE_CPU_READ); + const float *constants = cell->mapped_constants[shader]; ibuf[0] = CELL_CMD_STATE_FS_CONSTANTS; ibuf[4] = num_const; j = 8; for (i = 0; i < num_const; i++) { buf[j++] = constants[i]; } - pipe_buffer_unmap(cell->pipe.screen, cell->constants[shader]); } if (cell->dirty & (CELL_NEW_FRAMEBUFFER | diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index bc6127d7e7..6342402854 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -34,6 +34,7 @@ #include "cell_context.h" #include "cell_state.h" #include "cell_gen_fp.h" +#include "cell_buffer.h" /** cast wrapper */ @@ -185,15 +186,27 @@ cell_set_constant_buffer(struct pipe_context *pipe, struct pipe_buffer *buf) { struct cell_context *cell = cell_context(pipe); + unsigned size = constants ? constants->size : 0; + const void *data = constants ? cell_buffer(constants)->data : NULL; assert(shader < PIPE_SHADER_TYPES); assert(index == 0); + if (cell->constants[shader] == constants) + return; + draw_flush(cell->draw); /* note: reference counting */ pipe_buffer_reference(&cell->constants[shader], buf); + if(shader == PIPE_SHADER_VERTEX) { + draw_set_mapped_constant_buffer(cell->draw, PIPE_SHADER_VERTEX, 0, + data, size); + } + + cell->mapped_constants[shader] = data; + if (shader == PIPE_SHADER_VERTEX) cell->dirty |= CELL_NEW_VS_CONSTANTS; else if (shader == PIPE_SHADER_FRAGMENT) diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index a5f426795d..f3fc080aa3 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -43,10 +43,13 @@ #include "cell_state.h" #include "cell_texture.h" +#include "state_tracker/sw_winsys.h" -static void -cell_texture_layout(struct cell_texture *ct) + +static boolean +cell_texture_layout(struct pipe_screen *screen, + struct cell_texture *ct) { struct pipe_texture *pt = &ct->base; unsigned level; @@ -82,9 +85,34 @@ cell_texture_layout(struct cell_texture *ct) height = u_minify(height, 1); depth = u_minify(depth, 1); } + + ct->data = align_malloc(ct->buffer_size, 16); + + return ct->data != NULL; } +/** + * Texture layout for simple color buffers. + */ +static boolean +cell_displaytarget_layout(struct pipe_screen *screen, + struct cell_texture * ct) +{ + struct sw_winsys *winsys = cell_screen(screen)->winsys; + + /* Round up the surface size to a multiple of the tile size? + */ + ct->dt = winsys->displaytarget_create(winsys, + ct->base.format, + ct->base.width0, + ct->base.height0, + 16, + &ct->stride[0] ); + + return ct->dt != NULL; +} + static struct pipe_texture * cell_texture_create(struct pipe_screen *screen, const struct pipe_texture *templat) @@ -97,31 +125,46 @@ cell_texture_create(struct pipe_screen *screen, pipe_reference_init(&ct->base.reference, 1); ct->base.screen = screen; - cell_texture_layout(ct); - - ct->buffer = screen->buffer_create(screen, 32, PIPE_BUFFER_USAGE_PIXEL, - ct->buffer_size); - - if (!ct->buffer) { - FREE(ct); - return NULL; + if (ct->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | + PIPE_TEXTURE_USAGE_SCANOUT | + PIPE_TEXTURE_USAGE_SHARED)) { + if (!cell_displaytarget_layout(screen, ct)) + goto fail; + } + else { + if (!cell_texture_layout(screen, ct)) + goto fail; } return &ct->base; + +fail: + FREE(ct); + return NULL; } static void cell_texture_destroy(struct pipe_texture *pt) { + struct cell_screen *screen = cell_screen(pt->screen); + struct sw_winsys *winsys = screen->winsys; struct cell_texture *ct = cell_texture(pt); if (ct->mapped) { - pipe_buffer_unmap(ct->buffer->screen, ct->buffer); + if (ct->dt) + winsys->displaytarget_unmap(winsys, ct->dt); ct->mapped = NULL; } - pipe_buffer_reference(&ct->buffer, NULL); + if (ct->dt) { + /* display target */ + winsys->displaytarget_destroy(winsys, ct->dt); + } + else { + /* regular texture */ + align_free(ct->data); + } FREE(ct); } @@ -388,12 +431,20 @@ cell_transfer_map(struct pipe_screen *screen, struct pipe_transfer *transfer) assert(transfer->texture); - if (!ct->mapped) { - /* map now */ - ct->mapped = pipe_buffer_map(screen, ct->buffer, - pipe_transfer_buffer_flags(transfer)); + if (ct->mapped == NULL) { + if (ct->dt) { + struct sw_winsys *winsys = cell_screen(screen)->winsys; + ct->mapped = winsys->displaytarget_map(screen, ct->dt, + pipe_transfer_buffer_flags(transfer)); + } + else { + ct->mapped = ct->data; + } } + if (ct->mapped == NULL) + return NULL; + /* * Create a buffer of ordinary memory for the linear texture. * This is the memory that the user will read/write. @@ -441,9 +492,8 @@ cell_transfer_unmap(struct pipe_screen *screen, const uint stride = ct->stride[level]; if (!ct->mapped) { - /* map now */ - ct->mapped = pipe_buffer_map(screen, ct->buffer, - PIPE_BUFFER_USAGE_CPU_READ); + assert(0); + return; } if (transfer->usage & PIPE_TRANSFER_WRITE) { @@ -461,11 +511,20 @@ cell_transfer_unmap(struct pipe_screen *screen, } } + if (ct->dt) { + /* display target */ + struct sw_winsys *winsys = cell_screen(screen)->winsys; + winsys->displaytarget_unmap(winsys, ct->dt); + } + align_free(ctrans->map); ctrans->map = NULL; } + + + void cell_init_screen_texture_funcs(struct pipe_screen *screen) { diff --git a/src/gallium/drivers/cell/ppu/cell_texture.h b/src/gallium/drivers/cell/ppu/cell_texture.h index 3ffc0bfdb5..55b983218f 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.h +++ b/src/gallium/drivers/cell/ppu/cell_texture.h @@ -43,8 +43,19 @@ struct cell_texture unsigned long level_offset[CELL_MAX_TEXTURE_LEVELS]; unsigned long stride[CELL_MAX_TEXTURE_LEVELS]; - /** The tiled texture data is held in this buffer */ - struct pipe_buffer *buffer; + /** + * Display target, for textures with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET + * usage. + */ + struct sw_displaytarget *dt; + + /** + * Malloc'ed data for regular textures, or a mapping to dt above. + */ + void *data; + + /* Size of the linear buffer?? + */ unsigned long buffer_size; /** The buffer above, mapped. This is the memory from which the diff --git a/src/gallium/drivers/cell/ppu/cell_winsys.h b/src/gallium/drivers/cell/ppu/cell_winsys.h deleted file mode 100644 index e227e065ff..0000000000 --- a/src/gallium/drivers/cell/ppu/cell_winsys.h +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#ifndef CELL_WINSYS_H -#define CELL_WINSYS_H - -#include "pipe/p_compiler.h" - - -/** - * Very simple winsys at this time. - * Will probably eventually add SPU control info. - */ -struct cell_winsys -{ - uint dummy; -}; - - - - -#endif -- cgit v1.2.3 From e497a58fad878d913a1795b239ddd05870988c58 Mon Sep 17 00:00:00 2001 From: David Heidelberger Date: Tue, 9 Mar 2010 13:50:27 +0100 Subject: nv30: fix typo Signed-off-by: David Heidelberger --- src/gallium/drivers/nv30/nv30_miptree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 5ef74a832d..bfa27b632f 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -236,5 +236,5 @@ nv30_screen_init_miptree_functions(struct pipe_screen *pscreen) pscreen->get_tex_surface = nv30_miptree_surface_new; pscreen->tex_surface_destroy = nv30_miptree_surface_del; - nouveau_screen(pscreen)->texture_blanket = nv50_miptree_blanket; + nouveau_screen(pscreen)->texture_blanket = nv30_miptree_blanket; } -- cgit v1.2.3 From fe9f8536f1b1e7a3a2ac10afd8078e8f4d327578 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 14:19:29 +0100 Subject: auxiliary: fix vertex elements cso potentially could have got a match even though the cso was different (in case of different count and first few elements the same). --- src/gallium/auxiliary/cso_cache/cso_cache.h | 7 ++++++- src/gallium/auxiliary/cso_cache/cso_context.c | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.h b/src/gallium/auxiliary/cso_cache/cso_cache.h index d884d5410f..fb09b83c62 100644 --- a/src/gallium/auxiliary/cso_cache/cso_cache.h +++ b/src/gallium/auxiliary/cso_cache/cso_cache.h @@ -146,8 +146,13 @@ struct cso_sampler { struct pipe_context *context; }; +struct cso_velems_state { + unsigned count; + struct pipe_vertex_element velems[PIPE_MAX_ATTRIBS]; +}; + struct cso_velements { - struct pipe_vertex_element state[PIPE_MAX_ATTRIBS]; + struct cso_velems_state state; void *data; cso_state_callback delete_state; struct pipe_context *context; diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 95e3c18e53..510366a8d4 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -1152,18 +1152,25 @@ enum pipe_error cso_set_vertex_elements(struct cso_context *ctx, unsigned key_size, hash_key; struct cso_hash_iter iter; void *handle; - - key_size = sizeof(struct pipe_vertex_element) * count; - hash_key = cso_construct_key((void*)states, key_size); - iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS, (void*)states, key_size); + struct cso_velems_state velems_state; + + /* need to include the count into the stored state data too. + Otherwise first few count pipe_vertex_elements could be identical even if count + is different, and there's no guarantee the hash would be different in that + case neither */ + key_size = sizeof(struct pipe_vertex_element) * count + sizeof(unsigned); + velems_state.count = count; + memcpy(velems_state.velems, states, sizeof(struct pipe_vertex_element) * count); + hash_key = cso_construct_key((void*)&velems_state, key_size); + iter = cso_find_state_template(ctx->cache, hash_key, CSO_VELEMENTS, (void*)&velems_state, key_size); if (cso_hash_iter_is_null(iter)) { struct cso_velements *cso = MALLOC(sizeof(struct cso_velements)); if (!cso) return PIPE_ERROR_OUT_OF_MEMORY; - memcpy(&cso->state, states, key_size); - cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count, &cso->state[0]); + memcpy(&cso->state, &velems_state, key_size); + cso->data = ctx->pipe->create_vertex_elements_state(ctx->pipe, count, &cso->state.velems[0]); cso->delete_state = (cso_state_callback)ctx->pipe->delete_vertex_elements_state; cso->context = ctx->pipe; -- cgit v1.2.3 From e8983f70b41ea92a9527cb618db011b5dd136626 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 14:23:00 +0100 Subject: gallium: don't use flexible array members in drivers for vertex elements cso While this c99 feature should work with most compilers, valgrind doesn't really like it, and this only really saves some memory, we don't do this in similar occasions (like the blend state) neither. --- src/gallium/drivers/cell/ppu/cell_context.h | 2 +- src/gallium/drivers/cell/ppu/cell_state_vertex.c | 2 +- src/gallium/drivers/i915/i915_context.h | 2 +- src/gallium/drivers/i915/i915_state.c | 2 +- src/gallium/drivers/i965/brw_pipe_vertex.c | 2 +- src/gallium/drivers/llvmpipe/lp_state.h | 2 +- src/gallium/drivers/llvmpipe/lp_state_vertex.c | 2 +- src/gallium/drivers/softpipe/sp_state.h | 2 +- src/gallium/drivers/softpipe/sp_state_vertex.c | 2 +- src/gallium/drivers/svga/svga_context.h | 2 +- src/gallium/drivers/svga/svga_pipe_vertex.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_context.h b/src/gallium/drivers/cell/ppu/cell_context.h index 84ad0f3422..584f355804 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.h +++ b/src/gallium/drivers/cell/ppu/cell_context.h @@ -96,7 +96,7 @@ struct cell_buffer_list struct cell_velems_state { unsigned count; - struct pipe_vertex_element velem[]; + struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; } /** diff --git a/src/gallium/drivers/cell/ppu/cell_state_vertex.c b/src/gallium/drivers/cell/ppu/cell_state_vertex.c index 35c919fb6b..d3efb8ecea 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_vertex.c +++ b/src/gallium/drivers/cell/ppu/cell_state_vertex.c @@ -43,7 +43,7 @@ cell_create_vertex_elements_state(struct pipe_context *pipe, { struct cell_velems_state *velems; assert(count <= PIPE_MAX_ATTRIBS); - velems = (struct cell_velems_state *) MALLOC(sizeof(struct cell_velems_state) + count * sizeof(*attribs)); + velems = (struct cell_velems_state *) MALLOC(sizeof(struct cell_velems_state)); if (velems) { velems->count = count; memcpy(velems->velem, attribs, sizeof(*attribs) * count); diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h index 369c63eece..3e383aaa1c 100644 --- a/src/gallium/drivers/i915/i915_context.h +++ b/src/gallium/drivers/i915/i915_context.h @@ -189,7 +189,7 @@ struct i915_sampler_state { struct i915_velems_state { unsigned count; - struct pipe_vertex_element velem[]; + struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; }; struct i915_texture { diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index 46406065c3..8927dfc33d 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -749,7 +749,7 @@ i915_create_vertex_elements_state(struct pipe_context *pipe, { struct i915_velems_state *velems; assert(count <= PIPE_MAX_ATTRIBS); - velems = (struct i915_velems_state *) MALLOC(sizeof(struct i915_velems_state) + count * sizeof(*attribs)); + velems = (struct i915_velems_state *) MALLOC(sizeof(struct i915_velems_state)); if (velems) { velems->count = count; memcpy(velems->velem, attribs, sizeof(*attribs) * count); diff --git a/src/gallium/drivers/i965/brw_pipe_vertex.c b/src/gallium/drivers/i965/brw_pipe_vertex.c index 3d84fb86fb..d6a840857e 100644 --- a/src/gallium/drivers/i965/brw_pipe_vertex.c +++ b/src/gallium/drivers/i965/brw_pipe_vertex.c @@ -215,7 +215,7 @@ static void* brw_create_vertex_elements_state( struct pipe_context *pipe, const struct pipe_vertex_element *attribs ) { /* note: for the brw_swtnl.c code (if ever we need draw fallback) we'd also need - store the original data */ + to store the original data */ struct brw_context *brw = brw_context(pipe); struct brw_vertex_element_packet *velems; assert(count <= BRW_VEP_MAX); diff --git a/src/gallium/drivers/llvmpipe/lp_state.h b/src/gallium/drivers/llvmpipe/lp_state.h index 57f5bd0042..6dbdc195bf 100644 --- a/src/gallium/drivers/llvmpipe/lp_state.h +++ b/src/gallium/drivers/llvmpipe/lp_state.h @@ -121,7 +121,7 @@ struct lp_vertex_shader { struct lp_velems_state { unsigned count; - struct pipe_vertex_element velem[]; + struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; }; diff --git a/src/gallium/drivers/llvmpipe/lp_state_vertex.c b/src/gallium/drivers/llvmpipe/lp_state_vertex.c index 5a9b6d5e18..2ddd110a5f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vertex.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vertex.c @@ -42,7 +42,7 @@ llvmpipe_create_vertex_elements_state(struct pipe_context *pipe, { struct lp_velems_state *velems; assert(count <= PIPE_MAX_ATTRIBS); - velems = (struct lp_velems_state *) MALLOC(sizeof(struct lp_velems_state) + count * sizeof(*attribs)); + velems = (struct lp_velems_state *) MALLOC(sizeof(struct lp_velems_state)); if (velems) { velems->count = count; memcpy(velems->velem, attribs, sizeof(*attribs) * count); diff --git a/src/gallium/drivers/softpipe/sp_state.h b/src/gallium/drivers/softpipe/sp_state.h index a6b9a841fe..6b01c0f4d7 100644 --- a/src/gallium/drivers/softpipe/sp_state.h +++ b/src/gallium/drivers/softpipe/sp_state.h @@ -102,7 +102,7 @@ struct sp_geometry_shader { struct sp_velems_state { unsigned count; - struct pipe_vertex_element velem[]; + struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; }; diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c index e7dc3d002b..a151758ddc 100644 --- a/src/gallium/drivers/softpipe/sp_state_vertex.c +++ b/src/gallium/drivers/softpipe/sp_state_vertex.c @@ -43,7 +43,7 @@ softpipe_create_vertex_elements_state(struct pipe_context *pipe, { struct sp_velems_state *velems; assert(count <= PIPE_MAX_ATTRIBS); - velems = (struct sp_velems_state *) MALLOC(sizeof(struct sp_velems_state) + count * sizeof(*attribs)); + velems = (struct sp_velems_state *) MALLOC(sizeof(struct sp_velems_state)); if (velems) { velems->count = count; memcpy(velems->velem, attribs, sizeof(*attribs) * count); diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h index 4d9f00991a..791d30edc0 100644 --- a/src/gallium/drivers/svga/svga_context.h +++ b/src/gallium/drivers/svga/svga_context.h @@ -171,7 +171,7 @@ struct svga_sampler_state { struct svga_velems_state { unsigned count; - struct pipe_vertex_element velem[]; + struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; }; /* Use to calculate differences between state emitted to hardware and diff --git a/src/gallium/drivers/svga/svga_pipe_vertex.c b/src/gallium/drivers/svga/svga_pipe_vertex.c index 979deb12af..d4a1280e74 100644 --- a/src/gallium/drivers/svga/svga_pipe_vertex.c +++ b/src/gallium/drivers/svga/svga_pipe_vertex.c @@ -73,7 +73,7 @@ svga_create_vertex_elements_state(struct pipe_context *pipe, { struct svga_velems_state *velems; assert(count <= PIPE_MAX_ATTRIBS); - velems = (struct svga_velems_state *) MALLOC(sizeof(struct svga_velems_state) + count * sizeof(*attribs)); + velems = (struct svga_velems_state *) MALLOC(sizeof(struct svga_velems_state)); if (velems) { velems->count = count; memcpy(velems->velem, attribs, sizeof(*attribs) * count); -- cgit v1.2.3 From 65233674d3598fee90d762b0c2826752f2619f05 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 14:03:41 +0000 Subject: cell: untwiddle surface contents in flush_frontbuffer() Don't make the shared software winsys rely on internal knowledge about the cell driver's texture twiddling. This is just a sketch and hasn't even been compile tested. --- src/gallium/drivers/cell/ppu/cell_screen.c | 16 ------ src/gallium/drivers/cell/ppu/cell_texture.c | 89 ++++++++++++++++++----------- src/gallium/drivers/cell/ppu/cell_texture.h | 1 + src/gallium/winsys/xlib/xlib_cell.c | 81 -------------------------- 4 files changed, 58 insertions(+), 129 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 36479e8e0c..00035be53a 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -164,22 +164,6 @@ cell_destroy_screen( struct pipe_screen *screen ) FREE(screen); } -/* This used to be overriden by the co-state tracker, but really needs - * to be active with sw_winsys. - */ -static void -cell_flush_frontbuffer(struct pipe_screen *_screen, - struct pipe_surface *surface, - void *context_private) -{ - struct cell_screen *screen = cell_screen(_screen); - struct sw_winsys *winsys = screen->winsys; - struct cell_texture *texture = cell_texture(surface->texture); - - assert(texture->dt); - if (texture->dt) - winsys->displaytarget_display(winsys, texture->dt, context_private); -} /** diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index f3fc080aa3..002dd3a9b5 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -108,7 +108,7 @@ cell_displaytarget_layout(struct pipe_screen *screen, ct->base.width0, ct->base.height0, 16, - &ct->stride[0] ); + &ct->dt_stride ); return ct->dt != NULL; } @@ -125,21 +125,29 @@ cell_texture_create(struct pipe_screen *screen, pipe_reference_init(&ct->base.reference, 1); ct->base.screen = screen; + /* Create both a displaytarget (linear) and regular texture + * (twiddled). Convert twiddled->linear at flush_frontbuffer time. + */ if (ct->base.tex_usage & (PIPE_TEXTURE_USAGE_DISPLAY_TARGET | PIPE_TEXTURE_USAGE_SCANOUT | PIPE_TEXTURE_USAGE_SHARED)) { if (!cell_displaytarget_layout(screen, ct)) goto fail; } - else { - if (!cell_texture_layout(screen, ct)) - goto fail; - } + + if (!cell_texture_layout(screen, ct)) + goto fail; return &ct->base; fail: + if (ct->dt) { + struct sw_winsys winsys = cell_screen(screen)->winsys; + winsys->displaytarget_destroy(winsys, ct->dt); + } + FREE(ct); + return NULL; } @@ -151,20 +159,12 @@ cell_texture_destroy(struct pipe_texture *pt) struct sw_winsys *winsys = screen->winsys; struct cell_texture *ct = cell_texture(pt); - if (ct->mapped) { - if (ct->dt) - winsys->displaytarget_unmap(winsys, ct->dt); - ct->mapped = NULL; - } - if (ct->dt) { /* display target */ winsys->displaytarget_destroy(winsys, ct->dt); } - else { - /* regular texture */ - align_free(ct->data); - } + + align_free(ct->data); FREE(ct); } @@ -432,19 +432,9 @@ cell_transfer_map(struct pipe_screen *screen, struct pipe_transfer *transfer) assert(transfer->texture); if (ct->mapped == NULL) { - if (ct->dt) { - struct sw_winsys *winsys = cell_screen(screen)->winsys; - ct->mapped = winsys->displaytarget_map(screen, ct->dt, - pipe_transfer_buffer_flags(transfer)); - } - else { - ct->mapped = ct->data; - } + ct->mapped = ct->data; } - if (ct->mapped == NULL) - return NULL; - /* * Create a buffer of ordinary memory for the linear texture. * This is the memory that the user will read/write. @@ -511,18 +501,51 @@ cell_transfer_unmap(struct pipe_screen *screen, } } - if (ct->dt) { - /* display target */ - struct sw_winsys *winsys = cell_screen(screen)->winsys; - winsys->displaytarget_unmap(winsys, ct->dt); - } - align_free(ctrans->map); ctrans->map = NULL; } +/* This used to be overriden by the co-state tracker, but really needs + * to be active with sw_winsys. + * + * Contrasting with llvmpipe and softpipe, this is the only place + * where we use the ct->dt display target in any real sense. + * + * Basically just untwiddle our local data into the linear + * displaytarget. + */ +static void +cell_flush_frontbuffer(struct pipe_screen *_screen, + struct pipe_surface *surface, + void *context_private) +{ + struct cell_screen *screen = cell_screen(_screen); + struct sw_winsys *winsys = screen->winsys; + struct cell_texture *ct = cell_texture(surface->texture); + + if (!ct->dt) + return; + + /* Need to untwiddle from our internal representation here: + */ + { + unsigned *map = winsys->displaytarget_map(winsys, ct->dt); + unsigned *src = (unsigned *)(ct->data + ct->level_offset[surface->level]); + + untwiddle_image_uint(surface->width, + surface->height, + TILE_SIZE, + map, + ct->dt_stride, + src); + + winsys->displaytarget_unmap(winsys, c->dt); + } + + winsys->displaytarget_display(winsys, ct->dt, context_private); +} void @@ -539,4 +562,6 @@ cell_init_screen_texture_funcs(struct pipe_screen *screen) screen->transfer_map = cell_transfer_map; screen->transfer_unmap = cell_transfer_unmap; + + screen->flush_frontbuffer = cell_flush_frontbuffer; } diff --git a/src/gallium/drivers/cell/ppu/cell_texture.h b/src/gallium/drivers/cell/ppu/cell_texture.h index 55b983218f..b89db1a5a8 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.h +++ b/src/gallium/drivers/cell/ppu/cell_texture.h @@ -48,6 +48,7 @@ struct cell_texture * usage. */ struct sw_displaytarget *dt; + unsigned dt_stride; /** * Malloc'ed data for regular textures, or a mapping to dt above. diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index ce4efe8851..2ad1aab439 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -47,88 +47,7 @@ -/** - * For Cell. Basically, rearrange the pixels/quads from this layout: - * +--+--+--+--+ - * |p0|p1|p2|p3|.... - * +--+--+--+--+ - * - * to this layout: - * +--+--+ - * |p0|p1|.... - * +--+--+ - * |p2|p3| - * +--+--+ - */ -static void -twiddle_tile(const uint *tileIn, uint *tileOut) -{ - int y, x; - - for (y = 0; y < TILE_SIZE; y+=2) { - for (x = 0; x < TILE_SIZE; x+=2) { - int k = 4 * (y/2 * TILE_SIZE/2 + x/2); - tileOut[y * TILE_SIZE + (x + 0)] = tileIn[k]; - tileOut[y * TILE_SIZE + (x + 1)] = tileIn[k+1]; - tileOut[(y + 1) * TILE_SIZE + (x + 0)] = tileIn[k+2]; - tileOut[(y + 1) * TILE_SIZE + (x + 1)] = tileIn[k+3]; - } - } -} -/** - * Display a surface that's in a tiled configuration. That is, all the - * pixels for a TILE_SIZExTILE_SIZE block are contiguous in memory. - */ -static void -xm_displaytarget_display(struct sw_winsys *ws, - struct sw_displaytarget *dt, - void *winsys_drawable) -{ - struct xmesa_buffer *xm_buffer = (struct xm_drawable *)winsys_drawable; - XImage *ximage; - struct xm_buffer *xm_buf = xm_buffer( - cell_texture(surf->texture)->buffer); - const uint tilesPerRow = (surf->width + TILE_SIZE - 1) / TILE_SIZE; - uint x, y; - - ximage = b->tempImage; - - /* check that the XImage has been previously initialized */ - assert(ximage->format); - assert(ximage->bitmap_unit); - - /* update XImage's fields */ - ximage->width = TILE_SIZE; - ximage->height = TILE_SIZE; - ximage->bytes_per_line = TILE_SIZE * 4; - - for (y = 0; y < surf->height; y += TILE_SIZE) { - for (x = 0; x < surf->width; x += TILE_SIZE) { - uint tmpTile[TILE_SIZE * TILE_SIZE]; - int tx = x / TILE_SIZE; - int ty = y / TILE_SIZE; - int offset = ty * tilesPerRow + tx; - int w = TILE_SIZE; - int h = TILE_SIZE; - - if (y + h > surf->height) - h = surf->height - y; - if (x + w > surf->width) - w = surf->width - x; - - /* offset in pixels */ - offset *= TILE_SIZE * TILE_SIZE; - - /* twiddle from ximage buffer to temp tile */ - twiddle_tile((uint *) xm_buf->data + offset, tmpTile); - /* display temp tile data */ - ximage->data = (char *) tmpTile; - XPutImage(b->xm_visual->display, b->drawable, b->gc, - ximage, 0, 0, x, y, w, h); - } - } -} -- cgit v1.2.3 From ae7b7bf1edcf6c492b4dcc162bca28a0090f601e Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 15:09:01 +0100 Subject: st/mesa: fix clear/drawpixels/bitmap for new cso vertex elements interface somehow those got lost... --- src/mesa/state_tracker/st_cb_bitmap.c | 4 ++++ src/mesa/state_tracker/st_cb_clear.c | 4 ++++ src/mesa/state_tracker/st_cb_drawpixels.c | 4 ++++ src/mesa/state_tracker/st_context.c | 8 ++++++++ src/mesa/state_tracker/st_context.h | 3 +++ 5 files changed, 23 insertions(+) (limited to 'src') diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 25430bba77..95b148a7b4 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -440,6 +440,7 @@ draw_bitmap_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, cso_save_viewport(cso); cso_save_fragment_shader(cso); cso_save_vertex_shader(cso); + cso_save_vertex_elements(cso); /* rasterizer state: just scissor */ st->bitmap.rasterizer.scissor = ctx->Scissor.Enabled; @@ -490,6 +491,8 @@ draw_bitmap_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, cso_set_viewport(cso, &vp); } + cso_set_vertex_elements(cso, 3, st->velems_util_draw); + /* draw textured quad */ offset = setup_bitmap_vertex_data(st, x, y, width, height, z, color); @@ -506,6 +509,7 @@ draw_bitmap_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, cso_restore_viewport(cso); cso_restore_fragment_shader(cso); cso_restore_vertex_shader(cso); + cso_restore_vertex_elements(cso); } diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 898c32293d..efba9853b4 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -220,6 +220,7 @@ clear_with_quad(GLcontext *ctx, cso_save_rasterizer(st->cso_context); cso_save_fragment_shader(st->cso_context); cso_save_vertex_shader(st->cso_context); + cso_save_vertex_elements(st->cso_context); /* blend state: RGBA masking */ { @@ -271,6 +272,8 @@ clear_with_quad(GLcontext *ctx, cso_set_depth_stencil_alpha(st->cso_context, &depth_stencil); } + cso_set_vertex_elements(st->cso_context, 2, st->velems_util_draw); + cso_set_rasterizer(st->cso_context, &st->clear.raster); cso_set_fragment_shader_handle(st->cso_context, st->clear.fs); @@ -286,6 +289,7 @@ clear_with_quad(GLcontext *ctx, cso_restore_rasterizer(st->cso_context); cso_restore_fragment_shader(st->cso_context); cso_restore_vertex_shader(st->cso_context); + cso_restore_vertex_elements(st->cso_context); } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 36c0a2b0e1..a21c0105e9 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -529,6 +529,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, cso_save_sampler_textures(cso); cso_save_fragment_shader(cso); cso_save_vertex_shader(cso); + cso_save_vertex_elements(cso); /* rasterizer state: just scissor */ { @@ -581,6 +582,8 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, cso_set_viewport(cso, &vp); } + cso_set_vertex_elements(cso, 3, st->velems_util_draw); + /* texture state: */ if (st->pixel_xfer.pixelmap_enabled) { struct pipe_texture *textures[2]; @@ -612,6 +615,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, cso_restore_sampler_textures(cso); cso_restore_fragment_shader(cso); cso_restore_vertex_shader(cso); + cso_restore_vertex_elements(cso); } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 8f6a0c2423..0329e0cef0 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -142,6 +142,14 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe ) for (i = 0; i < PIPE_MAX_SAMPLERS; i++) st->state.sampler_list[i] = &st->state.samplers[i]; + for (i = 0; i < 3; i++) { + memset(&st->velems_util_draw[i], 0, sizeof(struct pipe_vertex_element)); + st->velems_util_draw[i].src_offset = i * 4 * sizeof(float); + st->velems_util_draw[i].instance_divisor = 0; + st->velems_util_draw[i].vertex_buffer_index = 0; + st->velems_util_draw[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + /* we want all vertex data to be placed in buffer objects */ vbo_use_buffer_objects(ctx); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 50e98d7146..f2fa7e8711 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -173,6 +173,9 @@ struct st_context unsigned vbuf_slot; } clear; + /** used for anything using util_draw_vertex_buffer */ + struct pipe_vertex_element velems_util_draw[3]; + void *passthrough_fs; /**< simple pass-through frag shader */ struct gen_mipmap_state *gen_mipmap; -- cgit v1.2.3 From ce30b5bf2c4ff864542c038f59fc69c3e6518acd Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 14:32:44 +0000 Subject: ws/gdi: sketch of gdi changes --- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 2 +- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 2 +- src/gallium/winsys/gdi/gdi_sw_winsys.c | 214 +++++++++++++++++++++++++++ 3 files changed, 216 insertions(+), 2 deletions(-) create mode 100644 src/gallium/winsys/gdi/gdi_sw_winsys.c (limited to 'src') diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index 3d317c70dd..e627028dd4 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -36,7 +36,7 @@ #include -#include "gdi_winsys.h" +#include "gdi_sw_winsys.h" #include "llvmpipe/lp_texture.h" diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index 56e84fd066..bb669bbb64 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -36,7 +36,7 @@ #include -#include "gdi_winsys.h" +#include "gdi_sw_winsys.h" #include "softpipe/sp_texture.h" diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.c b/src/gallium/winsys/gdi/gdi_sw_winsys.c new file mode 100644 index 0000000000..00c6facd04 --- /dev/null +++ b/src/gallium/winsys/gdi/gdi_sw_winsys.c @@ -0,0 +1,214 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/** + * @file + * LLVMpipe support. + * + * @author Jose Fonseca + */ + + +#include + +#include "pipe/p_format.h" +#include "pipe/p_context.h" +#include "util/u_inlines.h" +#include "util/u_format.h" +#include "util/u_math.h" +#include "util/u_memory.h" +#include "state_tracker/sw_winsys.h" +#include "stw_winsys.h" + + +struct gdi_sw_displaytarget +{ + enum pipe_format format; + unsigned width; + unsigned height; + unsigned stride; + + unsigned size; + + void *data; + + BITMAPINFO bmi; +}; + + +/** Cast wrapper */ +static INLINE struct gdi_sw_displaytarget * +gdi_sw_displaytarget( struct sw_displaytarget *buf ) +{ + return (struct gdi_sw_displaytarget *)buf; +} + + +static boolean +gdi_sw_is_displaytarget_format_supported( struct sw_winsys *ws, + enum pipe_format format ) +{ + switch(format) { + case PIPE_FORMAT_B8G8R8X8_UNORM: + case PIPE_FORMAT_B8G8R8A8_UNORM: + return TRUE; + + /* TODO: Support other formats possible with BMPs, as described in + * http://msdn.microsoft.com/en-us/library/dd183376(VS.85).aspx */ + + default: + return FALSE; + } +} + + +static void * +gdi_sw_displaytarget_map(struct sw_winsys *ws, + struct sw_displaytarget *dt, + unsigned flags ) +{ + struct gdi_sw_displaytarget *gdt = gdi_sw_displaytarget(dt); + + return gdt->data; +} + + +static void +gdi_sw_displaytarget_unmap(struct sw_winsys *ws, + struct sw_displaytarget *dt ) +{ + +} + + +static void +gdi_sw_displaytarget_destroy(struct sw_winsys *winsys, + struct sw_displaytarget *dt) +{ + struct gdi_sw_displaytarget *gdt = gdi_sw_displaytarget(dt); + + align_free(gdt->data); + FREE(gdt); +} + + +static struct sw_displaytarget * +gdi_sw_displaytarget_create(struct sw_winsys *winsys, + enum pipe_format format, + unsigned width, unsigned height, + unsigned alignment, + unsigned *stride) +{ + struct gdi_sw_displaytarget *gdt; + unsigned cpp; + unsigned bpp; + + gdt = CALLOC_STRUCT(gdi_sw_displaytarget); + if(!gdt) + goto no_gdt; + + gdt->format = format; + gdt->width = width; + gdt->height = height; + + bpp = util_format_get_blocksizebits(format); + cpp = util_format_get_blocksize(format); + + gdt->stride = align(width * cpp, alignment); + gdt->size = gdt->stride * height; + + gdt->data = align_malloc(gdt->size, alignment); + if(!gdt->data) + goto no_data; + + gdt->bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + gdt->bmi.bmiHeader.biWidth = gdt->stride / cpp; + gdt->bmi.bmiHeader.biHeight= -(long)height; + gdt->bmi.bmiHeader.biPlanes = 1; + gdt->bmi.bmiHeader.biBitCount = bpp; + gdt->bmi.bmiHeader.biCompression = BI_RGB; + gdt->bmi.bmiHeader.biSizeImage = 0; + gdt->bmi.bmiHeader.biXPelsPerMeter = 0; + gdt->bmi.bmiHeader.biYPelsPerMeter = 0; + gdt->bmi.bmiHeader.biClrUsed = 0; + gdt->bmi.bmiHeader.biClrImportant = 0; + + *stride = gdt->stride; + return (struct sw_displaytarget *)gdt; + +no_data: + FREE(gdt); +no_gdt: + return NULL; +} + + +static void +gdi_sw_displaytarget_display(struct sw_winsys *winsys, + struct sw_displaytarget *dt, + void *context_private) +{ + struct gdi_softpipe_displaytarget *gdt = gdi_sw_displaytarget(dt); + + /* nasty: + */ + HDC hDC = (HDC)context_private; + + StretchDIBits(hDC, + 0, 0, gdt->width, gdt->height, + 0, 0, gdt->width, gdt->height, + gdt->data, &gdt->bmi, 0, SRCCOPY); +} + + +static void +gdi_sw_destroy(struct sw_winsys *winsys) +{ + FREE(winsys); +} + +struct sw_winsys * +gdi_create_sw_winsys(void) +{ + static struct sw_winsys *winsys; + + winsys = CALLOC_STRUCT(sw_winsys); + if(!winsys) + return NULL; + + winsys->destroy = gdi_sw_destroy; + winsys->is_displaytarget_format_supported = gdi_sw_is_displaytarget_format_supported; + winsys->displaytarget_create = gdi_sw_displaytarget_create; + winsys->displaytarget_map = gdi_sw_displaytarget_map; + winsys->displaytarget_unmap = gdi_sw_displaytarget_unmap; + winsys->displaytarget_display = gdi_sw_displaytarget_display; + winsys->displaytarget_destroy = gdi_sw_displaytarget_destroy; + + return winsys; +} + -- cgit v1.2.3 From 3db9644a9efd37fdefbde9ef5f9e60f44938d614 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 14:49:39 +0000 Subject: ws/gdi: missing file --- src/gallium/winsys/gdi/gdi_sw_winsys.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/gallium/winsys/gdi/gdi_sw_winsys.h (limited to 'src') diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.h b/src/gallium/winsys/gdi/gdi_sw_winsys.h new file mode 100644 index 0000000000..7e00d78911 --- /dev/null +++ b/src/gallium/winsys/gdi/gdi_sw_winsys.h @@ -0,0 +1,10 @@ +#ifndef GDI_SW_WINSYS_H +#define GDI_SW_WINSYS_H + +#include "pipe/p_compiler.h" +#include "state_tracker/sw_winsys.h" + +struct sw_winsys * +gdi_create_sw_winsys(void) + +#endif -- cgit v1.2.3 From 73d9400ad65c1ec0a20c29805a9fc1930687988c Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 14:49:02 +0000 Subject: softpipe: silence warning --- src/gallium/drivers/softpipe/sp_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h index 95def72c54..3d69cfdb11 100644 --- a/src/gallium/drivers/softpipe/sp_context.h +++ b/src/gallium/drivers/softpipe/sp_context.h @@ -93,7 +93,7 @@ struct softpipe_context { ubyte *mapped_vbuffer[PIPE_MAX_ATTRIBS]; /** Mapped constant buffers */ - void *mapped_constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS]; + const void *mapped_constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS]; /** Vertex format */ struct vertex_info vertex_info; -- cgit v1.2.3 From b694f321707c98c71478aceb11f814643109367b Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 15:02:21 +0000 Subject: winsys/gdi: get softpipe version compiling --- src/gallium/winsys/gdi/SConscript | 8 +++++--- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 26 +++++++++++++++----------- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 28 ++++++++++++++++------------ src/gallium/winsys/gdi/gdi_sw_winsys.c | 22 +++++++++++++++------- src/gallium/winsys/gdi/gdi_sw_winsys.h | 6 +++++- 5 files changed, 56 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript index 4b32aa27e1..0a3f141e72 100644 --- a/src/gallium/winsys/gdi/SConscript +++ b/src/gallium/winsys/gdi/SConscript @@ -18,17 +18,19 @@ if env['platform'] == 'windows': 'ws2_32', ]) - sources = ['gdi_sw_winsys.c'] + sources = [] drivers = [] if 'softpipe' in env['drivers']: - sources = ['gdi_softpipe_winsys.c'] + sources = ['gdi_sw_winsys.c', + 'gdi_softpipe_winsys.c'] drivers = [softpipe] if 'llvmpipe' in env['drivers']: env.Tool('llvm') if 'LLVM_VERSION' in env: - sources = ['gdi_llvmpipe_winsys.c'] + sources = ['gdi_sw_winsys.c', + 'gdi_llvmpipe_winsys.c'] drivers = [llvmpipe] if not sources or not drivers: diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index e627028dd4..4ea33f673f 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -36,8 +36,10 @@ #include +#include "stw_winsys.h" #include "gdi_sw_winsys.h" #include "llvmpipe/lp_texture.h" +#include "llvmpipe/lp_screen.h" static struct pipe_screen * @@ -57,7 +59,7 @@ gdi_llvmpipe_screen_create(void) return screen; no_screen: - FREE(winsys); + winsys->destroy(winsys); no_winsys: return NULL; } @@ -70,16 +72,18 @@ gdi_llvmpipe_present(struct pipe_screen *screen, struct pipe_surface *surface, HDC hDC) { - struct llvmpipe_texture *texture; - struct gdi_llvmpipe_displaytarget *gdt; - - texture = llvmpipe_texture(surface->texture); - gdt = gdi_llvmpipe_displaytarget(texture->dt); - - StretchDIBits(hDC, - 0, 0, gdt->width, gdt->height, - 0, 0, gdt->width, gdt->height, - gdt->data, &gdt->bmi, 0, SRCCOPY); + /* This will fail if any interposing layer (trace, debug, etc) has + * been introduced between the state-trackers and llvmpipe. + * + * Ideally this would get replaced with a call to + * pipe_screen::flush_frontbuffer(). + * + * Failing that, it may be necessary for intervening layers to wrap + * other structs such as this stw_winsys as well... + */ + gdi_sw_display(llvmpipe_screen(screen)->winsys, + llvmpipe_texture(surface->texture)->dt, + hDC); } diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index bb669bbb64..5c5c154c7f 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -36,14 +36,16 @@ #include +#include "stw_winsys.h" #include "gdi_sw_winsys.h" #include "softpipe/sp_texture.h" +#include "softpipe/sp_screen.h" static struct pipe_screen * gdi_softpipe_screen_create(void) { - static struct softpipe_winsys *winsys; + static struct sw_winsys *winsys; struct pipe_screen *screen; winsys = gdi_create_sw_winsys(); @@ -57,7 +59,7 @@ gdi_softpipe_screen_create(void) return screen; no_screen: - FREE(winsys); + winsys->destroy(winsys); no_winsys: return NULL; } @@ -70,16 +72,18 @@ gdi_softpipe_present(struct pipe_screen *screen, struct pipe_surface *surface, HDC hDC) { - struct softpipe_texture *texture; - struct gdi_softpipe_displaytarget *gdt; - - texture = softpipe_texture(surface->texture); - gdt = gdi_softpipe_displaytarget(texture->dt); - - StretchDIBits(hDC, - 0, 0, gdt->width, gdt->height, - 0, 0, gdt->width, gdt->height, - gdt->data, &gdt->bmi, 0, SRCCOPY); + /* This will fail if any interposing layer (trace, debug, etc) has + * been introduced between the state-trackers and softpipe. + * + * Ideally this would get replaced with a call to + * pipe_screen::flush_frontbuffer(). + * + * Failing that, it may be necessary for intervening layers to wrap + * other structs such as this stw_winsys as well... + */ + gdi_sw_display(softpipe_screen(screen)->winsys, + softpipe_texture(surface->texture)->dt, + hDC); } diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.c b/src/gallium/winsys/gdi/gdi_sw_winsys.c index 00c6facd04..55f99c4f47 100644 --- a/src/gallium/winsys/gdi/gdi_sw_winsys.c +++ b/src/gallium/winsys/gdi/gdi_sw_winsys.c @@ -43,7 +43,7 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "state_tracker/sw_winsys.h" -#include "stw_winsys.h" +#include "gdi_sw_winsys.h" struct gdi_sw_displaytarget @@ -168,21 +168,29 @@ no_gdt: } +void +gdi_sw_display( struct sw_winsys *winsys, + struct sw_displaytarget *dt, + HDC hDC ) +{ + struct gdi_sw_displaytarget *gdt = gdi_sw_displaytarget(dt); + + StretchDIBits(hDC, + 0, 0, gdt->width, gdt->height, + 0, 0, gdt->width, gdt->height, + gdt->data, &gdt->bmi, 0, SRCCOPY); +} + static void gdi_sw_displaytarget_display(struct sw_winsys *winsys, struct sw_displaytarget *dt, void *context_private) { - struct gdi_softpipe_displaytarget *gdt = gdi_sw_displaytarget(dt); - /* nasty: */ HDC hDC = (HDC)context_private; - StretchDIBits(hDC, - 0, 0, gdt->width, gdt->height, - 0, 0, gdt->width, gdt->height, - gdt->data, &gdt->bmi, 0, SRCCOPY); + gdi_sw_display(winsys, dt, hDC); } diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.h b/src/gallium/winsys/gdi/gdi_sw_winsys.h index 7e00d78911..8ecca7bbc3 100644 --- a/src/gallium/winsys/gdi/gdi_sw_winsys.h +++ b/src/gallium/winsys/gdi/gdi_sw_winsys.h @@ -4,7 +4,11 @@ #include "pipe/p_compiler.h" #include "state_tracker/sw_winsys.h" +void gdi_sw_display( struct sw_winsys *winsys, + struct sw_displaytarget *dt, + HDC hDC ); + struct sw_winsys * -gdi_create_sw_winsys(void) +gdi_create_sw_winsys(void); #endif -- cgit v1.2.3 From 706eda30578cbdd1456c09ccc2a570a5d6a99c92 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 9 Mar 2010 15:07:57 +0000 Subject: scons: Add new targets option. This will likely change. Most probably we'll just add an alias to indvidual targets and use the regular scons targets arguments. --- SConstruct | 2 ++ src/SConscript | 9 ++++----- src/gallium/SConscript | 4 ++++ src/gallium/targets/SConscript | 2 +- src/gallium/winsys/xlib/SConscript | 16 ++++++++-------- 5 files changed, 19 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/SConstruct b/SConstruct index e1c4a1898c..4cadd01363 100644 --- a/SConstruct +++ b/SConstruct @@ -53,6 +53,8 @@ opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers, ['softpipe', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'identity', 'llvmpipe'])) opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys, ['xlib', 'vmware', 'intel', 'i965', 'gdi', 'radeon'])) +opts.Add(ListVariable('targets', 'target drivers to build', 'all', + ['xlib'])) opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0'))) diff --git a/src/SConscript b/src/SConscript index cd4896ada4..cf6db730da 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,13 +1,12 @@ Import('*') SConscript('glsl/SConscript') -SConscript('gallium/SConscript') if 'mesa' in env['statetrackers']: - SConscript('mesa/SConscript') + SConscript('mesa/SConscript') -SConscript('gallium/winsys/SConscript') +SConscript('gallium/SConscript') if platform != 'embedded': - SConscript('glut/glx/SConscript') - SConscript('glew/SConscript') + SConscript('glut/glx/SConscript') + SConscript('glew/SConscript') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index d56c5c8461..ba541f9636 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -15,3 +15,7 @@ if platform != 'embedded': if platform == 'windows': SConscript('state_trackers/wgl/SConscript') + +SConscript('winsys/SConscript') + +SConscript('targets/SConscript') diff --git a/src/gallium/targets/SConscript b/src/gallium/targets/SConscript index 46cbe656f4..266d705f89 100644 --- a/src/gallium/targets/SConscript +++ b/src/gallium/targets/SConscript @@ -5,7 +5,7 @@ Import('*') # 'drm/SConscript', # ]) -if 'xlib' in env['winsys']: +if 'xlib' in env['targets']: SConscript([ 'libgl-xlib/SConscript', ]) diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index 587cdb8e38..1a1879f128 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -15,13 +15,13 @@ if env['platform'] == 'linux' \ '#/src/gallium/drivers', ]) - st_xlib = env.ConvenienceLibrary( - target = 'ws_xlib', - source = [ - 'xlib_cell.c', - 'xlib_llvmpipe.c', - 'xlib_softpipe.c', - 'xlib_sw_winsys.c', - ] + ws_xlib = env.ConvenienceLibrary( + target = 'ws_xlib', + source = [ + 'xlib_cell.c', + 'xlib_llvmpipe.c', + 'xlib_softpipe.c', + 'xlib_sw_winsys.c', + ] ) Export('ws_xlib') -- cgit v1.2.3 From ff407a117c7bd4e9f370f8ec204d3f7b4e7f91a2 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 9 Mar 2010 15:12:19 +0000 Subject: gdi: Fixup llvmpipe gdi winsys too. --- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index 4ea33f673f..f20c2614e2 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -45,7 +45,7 @@ static struct pipe_screen * gdi_llvmpipe_screen_create(void) { - static struct llvmpipe_winsys *winsys; + static struct sw_winsys *winsys; struct pipe_screen *screen; winsys = gdi_create_sw_winsys(); -- cgit v1.2.3 From 27a7f9454f190ebb51834e9d2d74c55766cbb29f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 9 Mar 2010 08:12:47 -0700 Subject: cell: fix up assorted compilation problems The driver is pretty much totally broken though. --- src/gallium/drivers/cell/ppu/cell_buffer.c | 4 ++-- src/gallium/drivers/cell/ppu/cell_context.h | 2 +- src/gallium/drivers/cell/ppu/cell_draw_arrays.c | 14 +++++++------- src/gallium/drivers/cell/ppu/cell_fence.c | 8 ++++++-- src/gallium/drivers/cell/ppu/cell_pipe_state.c | 22 ++++++++++++++++------ src/gallium/drivers/cell/ppu/cell_screen.c | 4 ++-- src/gallium/drivers/cell/ppu/cell_state_shader.c | 4 ++-- src/gallium/drivers/cell/ppu/cell_texture.c | 9 ++++++--- src/gallium/drivers/cell/ppu/cell_texture.h | 1 + src/gallium/include/state_tracker/sw_winsys.h | 3 +++ src/gallium/winsys/xlib/xlib_cell.c | 23 +++++++++++++---------- 11 files changed, 59 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_buffer.c b/src/gallium/drivers/cell/ppu/cell_buffer.c index 770f7328a7..f56a28d62e 100644 --- a/src/gallium/drivers/cell/ppu/cell_buffer.c +++ b/src/gallium/drivers/cell/ppu/cell_buffer.c @@ -30,8 +30,8 @@ #include "util/u_memory.h" #include "util/u_math.h" -#include "sp_screen.h" -#include "sp_buffer.h" +#include "cell_screen.h" +#include "cell_buffer.h" static void * diff --git a/src/gallium/drivers/cell/ppu/cell_context.h b/src/gallium/drivers/cell/ppu/cell_context.h index a77cc5b906..233b91dec6 100644 --- a/src/gallium/drivers/cell/ppu/cell_context.h +++ b/src/gallium/drivers/cell/ppu/cell_context.h @@ -34,7 +34,7 @@ #include "pipe/p_defines.h" #include "draw/draw_vertex.h" #include "draw/draw_vbuf.h" -#include "cell_winsys.h" +/*#include "cell_winsys.h"*/ #include "cell/common.h" #include "rtasm/rtasm_ppc_spe.h" #include "tgsi/tgsi_scan.h" diff --git a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c index bd15034a5d..15d4e8338f 100644 --- a/src/gallium/drivers/cell/ppu/cell_draw_arrays.c +++ b/src/gallium/drivers/cell/ppu/cell_draw_arrays.c @@ -63,21 +63,21 @@ cell_draw_range_elements(struct pipe_context *pipe, unsigned max_index, unsigned mode, unsigned start, unsigned count) { - struct cell_context *sp = cell_context(pipe); - struct draw_context *draw = sp->draw; + struct cell_context *cell = cell_context(pipe); + struct draw_context *draw = cell->draw; unsigned i; - if (sp->dirty) - cell_update_derived( sp ); + if (cell->dirty) + cell_update_derived( cell ); #if 0 - cell_map_surfaces(sp); + cell_map_surfaces(cell); #endif /* * Map vertex buffers */ - for (i = 0; i < sp->num_vertex_buffers; i++) { + for (i = 0; i < cell->num_vertex_buffers; i++) { void *buf = cell_buffer(cell->vertex_buffer[i].buffer)->data; draw_set_mapped_vertex_buffer(draw, i, buf); } @@ -98,7 +98,7 @@ cell_draw_range_elements(struct pipe_context *pipe, /* * unmap vertex/index buffers - will cause draw module to flush */ - for (i = 0; i < sp->num_vertex_buffers; i++) { + for (i = 0; i < cell->num_vertex_buffers; i++) { draw_set_mapped_vertex_buffer(draw, i, NULL); } if (indexBuffer) { diff --git a/src/gallium/drivers/cell/ppu/cell_fence.c b/src/gallium/drivers/cell/ppu/cell_fence.c index e10071529a..035ef41b89 100644 --- a/src/gallium/drivers/cell/ppu/cell_fence.c +++ b/src/gallium/drivers/cell/ppu/cell_fence.c @@ -92,7 +92,6 @@ cell_add_buffer_to_list(struct cell_context *cell, struct cell_buffer_list *list, struct pipe_buffer *buffer) { - struct pipe_screen *ps = cell->pipe.screen; struct cell_buffer_node *node = CALLOC_STRUCT(cell_buffer_node); /* create new list node which references the buffer, insert at head */ if (node) { @@ -157,8 +156,13 @@ cell_add_fenced_textures(struct cell_context *cell) printf("Adding texture %p buffer %p to list\n", ct, ct->tiled_buffer[level]); #endif - if (ct->buffer) +#if 00 + /* XXX this needs to be fixed/restored! + * Maybe keep pointers to textures, not buffers. + */ + if (ct->base.buffer) cell_add_buffer_to_list(cell, list, ct->buffer); +#endif } } } diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/src/gallium/drivers/cell/ppu/cell_pipe_state.c index 3d8b4409c7..dce10ae7f8 100644 --- a/src/gallium/drivers/cell/ppu/cell_pipe_state.c +++ b/src/gallium/drivers/cell/ppu/cell_pipe_state.c @@ -292,17 +292,23 @@ cell_set_sampler_textures(struct pipe_context *pipe, static void cell_map_surfaces(struct cell_context *cell) { +#if 0 struct pipe_screen *screen = cell->pipe.screen; +#endif uint i; for (i = 0; i < 1; i++) { struct pipe_surface *ps = cell->framebuffer.cbufs[i]; if (ps) { struct cell_texture *ct = cell_texture(ps->texture); +#if 0 cell->cbuf_map[i] = screen->buffer_map(screen, ct->buffer, (PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE)); +#else + cell->cbuf_map[i] = ct->data; +#endif } } @@ -310,10 +316,14 @@ cell_map_surfaces(struct cell_context *cell) struct pipe_surface *ps = cell->framebuffer.zsbuf; if (ps) { struct cell_texture *ct = cell_texture(ps->texture); +#if 0 cell->zsbuf_map = screen->buffer_map(screen, ct->buffer, (PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE)); +#else + cell->zsbuf_map = ct->data; +#endif } } } @@ -325,17 +335,17 @@ cell_map_surfaces(struct cell_context *cell) static void cell_unmap_surfaces(struct cell_context *cell) { - struct pipe_screen *screen = cell->pipe.screen; + /*struct pipe_screen *screen = cell->pipe.screen;*/ uint i; for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) { struct pipe_surface *ps = cell->framebuffer.cbufs[i]; if (ps && cell->cbuf_map[i]) { - struct cell_texture *ct = cell_texture(ps->texture); + /*struct cell_texture *ct = cell_texture(ps->texture);*/ assert(ps->texture); - assert(ct->buffer); + /*assert(ct->buffer);*/ - screen->buffer_unmap(screen, ct->buffer); + /*screen->buffer_unmap(screen, ct->buffer);*/ cell->cbuf_map[i] = NULL; } } @@ -343,8 +353,8 @@ cell_unmap_surfaces(struct cell_context *cell) { struct pipe_surface *ps = cell->framebuffer.zsbuf; if (ps && cell->zsbuf_map) { - struct cell_texture *ct = cell_texture(ps->texture); - screen->buffer_unmap(screen, ct->buffer); + /*struct cell_texture *ct = cell_texture(ps->texture);*/ + /*screen->buffer_unmap(screen, ct->buffer);*/ cell->zsbuf_map = NULL; } } diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index 00035be53a..fc04767a1e 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -174,7 +174,7 @@ cell_destroy_screen( struct pipe_screen *screen ) struct pipe_screen * cell_create_screen(struct sw_winsys *winsys) { - struct cell_screen *screen = CALLOC_STRUCT(pipe_screen); + struct cell_screen *screen = CALLOC_STRUCT(cell_screen); if (!screen) return NULL; @@ -194,5 +194,5 @@ cell_create_screen(struct sw_winsys *winsys) cell_init_screen_texture_funcs(&screen->base); cell_init_screen_buffer_funcs(&screen->base); - return screen; + return &screen->base; } diff --git a/src/gallium/drivers/cell/ppu/cell_state_shader.c b/src/gallium/drivers/cell/ppu/cell_state_shader.c index 6342402854..9e29ddc2d4 100644 --- a/src/gallium/drivers/cell/ppu/cell_state_shader.c +++ b/src/gallium/drivers/cell/ppu/cell_state_shader.c @@ -183,7 +183,7 @@ cell_delete_vs_state(struct pipe_context *pipe, void *vs) static void cell_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index, - struct pipe_buffer *buf) + struct pipe_buffer *constants) { struct cell_context *cell = cell_context(pipe); unsigned size = constants ? constants->size : 0; @@ -198,7 +198,7 @@ cell_set_constant_buffer(struct pipe_context *pipe, draw_flush(cell->draw); /* note: reference counting */ - pipe_buffer_reference(&cell->constants[shader], buf); + pipe_buffer_reference(&cell->constants[shader], constants); if(shader == PIPE_SHADER_VERTEX) { draw_set_mapped_constant_buffer(cell->draw, PIPE_SHADER_VERTEX, 0, diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index 002dd3a9b5..c8a1acd86a 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -40,6 +40,7 @@ #include "util/u_memory.h" #include "cell_context.h" +#include "cell_screen.h" #include "cell_state.h" #include "cell_texture.h" @@ -142,7 +143,7 @@ cell_texture_create(struct pipe_screen *screen, fail: if (ct->dt) { - struct sw_winsys winsys = cell_screen(screen)->winsys; + struct sw_winsys *winsys = cell_screen(screen)->winsys; winsys->displaytarget_destroy(winsys, ct->dt); } @@ -531,7 +532,9 @@ cell_flush_frontbuffer(struct pipe_screen *_screen, /* Need to untwiddle from our internal representation here: */ { - unsigned *map = winsys->displaytarget_map(winsys, ct->dt); + unsigned *map = winsys->displaytarget_map(winsys, ct->dt, + (PIPE_BUFFER_USAGE_CPU_READ | + PIPE_BUFFER_USAGE_CPU_WRITE)); unsigned *src = (unsigned *)(ct->data + ct->level_offset[surface->level]); untwiddle_image_uint(surface->width, @@ -541,7 +544,7 @@ cell_flush_frontbuffer(struct pipe_screen *_screen, ct->dt_stride, src); - winsys->displaytarget_unmap(winsys, c->dt); + winsys->displaytarget_unmap(winsys, ct->dt); } winsys->displaytarget_display(winsys, ct->dt, context_private); diff --git a/src/gallium/drivers/cell/ppu/cell_texture.h b/src/gallium/drivers/cell/ppu/cell_texture.h index b89db1a5a8..2be0579312 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.h +++ b/src/gallium/drivers/cell/ppu/cell_texture.h @@ -28,6 +28,7 @@ #ifndef CELL_TEXTURE_H #define CELL_TEXTURE_H +#include "cell/common.h" struct cell_context; struct pipe_texture; diff --git a/src/gallium/include/state_tracker/sw_winsys.h b/src/gallium/include/state_tracker/sw_winsys.h index 719c3f3eee..0de98bbc1c 100644 --- a/src/gallium/include/state_tracker/sw_winsys.h +++ b/src/gallium/include/state_tracker/sw_winsys.h @@ -88,6 +88,9 @@ struct sw_winsys unsigned alignment, unsigned *stride ); + /** + * \param flags bitmask of PIPE_BUFFER_USAGE_x flags + */ void * (*displaytarget_map)( struct sw_winsys *ws, struct sw_displaytarget *dt, diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index 2ad1aab439..d943953bd1 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -33,11 +33,8 @@ */ - - #include "xlib.h" - #if defined(GALLIUM_CELL) #include "cell/ppu/cell_texture.h" @@ -46,9 +43,18 @@ #include "util/u_debug.h" - - - +/** + * Display/copy the image in the surface into the X window specified + * by the XMesaBuffer. + */ +static void +xm_cell_displaytarget_display(struct sw_winsys *ws, + struct sw_displaytarget *dt, + void *context_private) +{ + struct xlib_drawable *xlib_drawable = (struct xlib_drawable *)context_private; + xlib_sw_display(xlib_drawable, dt); +} static struct pipe_screen * @@ -64,7 +70,7 @@ xlib_create_cell_screen( Display *dpy ) /* Plug in a little cell-specific code: */ - ws->base.displaytarget_display = xm_cell_displaytarget_display; + winsys->displaytarget_display = xm_cell_displaytarget_display; screen = cell_create_screen(winsys); if (screen == NULL) @@ -80,13 +86,10 @@ fail: } - - struct xm_driver xlib_cell_driver = { .create_pipe_screen = xlib_create_cell_screen, }; - #endif /* GALLIUM_CELL */ -- cgit v1.2.3 From 22812421b5f394af741022f2f65ba19bc7b0aa73 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 16:24:47 +0100 Subject: r300g: fix gallium-vertexlementcso merge damage --- src/gallium/drivers/r300/r300_emit.c | 4 ++-- src/gallium/drivers/r300/r300_render.c | 25 ------------------------- src/gallium/drivers/r300/r300_state_derived.c | 1 - 3 files changed, 2 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 65377b3865..55e9217fd3 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -1004,7 +1004,7 @@ void r300_emit_buffer_validate(struct r300_context *r300, (struct r300_textures_state*)r300->textures_state.state; struct r300_texture* tex; struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; - struct pipe_vertex_element *velem = r300->vertex_element; + struct pipe_vertex_element *velem = r300->velems->velem; struct pipe_buffer *pbuf; unsigned i; boolean invalid = FALSE; @@ -1062,7 +1062,7 @@ validate: } /* ...vertex buffers for HWTCL path... */ if (do_validate_vertex_buffers) { - for (i = 0; i < r300->vertex_element_count; i++) { + for (i = 0; i < r300->velems->count; i++) { pbuf = vbuf[velem[i].vertex_buffer_index].buffer; if (!r300->winsys->add_buffer(r300->winsys, pbuf, diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index d0e06ade40..2605628c02 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -319,31 +319,6 @@ static void r300_emit_draw_elements(struct r300_context *r300, END_CS; } -static boolean r300_setup_vertex_buffers(struct r300_context *r300) -{ - struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; - struct pipe_vertex_element *velem = r300->velems->velem; - struct pipe_buffer *pbuf; - -validate: - for (int i = 0; i < r300->velems->count; i++) { - pbuf = vbuf[velem[i].vertex_buffer_index].buffer; - - if (!r300->winsys->add_buffer(r300->winsys, pbuf, - RADEON_GEM_DOMAIN_GTT, 0)) { - r300->context.flush(&r300->context, 0, NULL); - goto validate; - } - } - - if (!r300->winsys->validate(r300->winsys)) { - r300->context.flush(&r300->context, 0, NULL); - return r300->winsys->validate(r300->winsys); - } - - return TRUE; -} - static void r300_shorten_ubyte_elts(struct r300_context* r300, struct pipe_buffer** elts, unsigned count) diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 4422581b51..81a373abad 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -128,7 +128,6 @@ static void r300_vertex_psc(struct r300_context* r300) " in psc\n", vs->info.num_inputs, r300->velems->count); - r300->vertex_element_count); for (i = 0; i < r300->velems->count; i++) { format = r300->velems->velem[i].src_format; -- cgit v1.2.3 From 4d02534628e5fd4cd1231c5d742928b34067f25c Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 16:28:59 +0100 Subject: identity: fix copy & paste error --- src/gallium/drivers/identity/id_context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 05a9dfab77..baf0ae4401 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -378,7 +378,7 @@ identity_delete_vs_state(struct pipe_context *_pipe, } -static void +static void * identity_create_vertex_elements_state(struct pipe_context *_pipe, unsigned num_elements, const struct pipe_vertex_element *vertex_elements) @@ -386,9 +386,9 @@ identity_create_vertex_elements_state(struct pipe_context *_pipe, struct identity_context *id_pipe = identity_context(_pipe); struct pipe_context *pipe = id_pipe->pipe; - pipe->create_vertex_elements_state(pipe, - num_elements, - vertex_elements); + return pipe->create_vertex_elements_state(pipe, + num_elements, + vertex_elements); } static void -- cgit v1.2.3 From 9c8cb12388be6818ac11a28d40034d01047584b2 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 8 Mar 2010 21:35:43 -0800 Subject: r300g: Cleanup old PSC code a bit. --- src/gallium/drivers/r300/r300_state_derived.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 81a373abad..cb2b9bd99f 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -114,13 +114,9 @@ static void r300_vertex_psc(struct r300_context* r300) uint16_t type, swizzle; enum pipe_format format; unsigned i; - int identity[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - int* stream_tab; memset(vformat, 0, sizeof(struct r300_vertex_stream_state)); - stream_tab = identity; - /* Vertex shaders have no semantics on their inputs, * so PSC should just route stuff based on the vertex elements, * and not on attrib information. */ @@ -133,7 +129,7 @@ static void r300_vertex_psc(struct r300_context* r300) format = r300->velems->velem[i].src_format; type = r300_translate_vertex_data_type(format) | - (stream_tab[i] << R300_DST_VEC_LOC_SHIFT); + (i << R300_DST_VEC_LOC_SHIFT); swizzle = r300_translate_vertex_data_swizzle(format); if (i & 1) { -- cgit v1.2.3 From 141c7cb0d6078b3a2832c4be03ddcf25e35e596b Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 8 Mar 2010 23:36:04 -0800 Subject: r300g: Precalculate and CSO-bind PSC state. --- src/gallium/drivers/r300/r300_context.c | 2 - src/gallium/drivers/r300/r300_context.h | 6 +- src/gallium/drivers/r300/r300_state.c | 197 ++++++++++++++++++++++++-- src/gallium/drivers/r300/r300_state_derived.c | 190 +------------------------ 4 files changed, 190 insertions(+), 205 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index e0a5532327..923e1e541f 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -60,7 +60,6 @@ static void r300_destroy_context(struct pipe_context* context) FREE(r300->rs_block_state.state); FREE(r300->scissor_state.state); FREE(r300->textures_state.state); - FREE(r300->vertex_stream_state.state); FREE(r300->vap_output_state.state); FREE(r300->viewport_state.state); FREE(r300->ztop_state.state); @@ -147,7 +146,6 @@ static void r300_setup_atoms(struct r300_context* r300) r300->rs_block_state.state = CALLOC_STRUCT(r300_rs_block); r300->scissor_state.state = CALLOC_STRUCT(pipe_scissor_state); r300->textures_state.state = CALLOC_STRUCT(r300_textures_state); - r300->vertex_stream_state.state = CALLOC_STRUCT(r300_vertex_stream_state); r300->vap_output_state.state = CALLOC_STRUCT(r300_vap_output_state); r300->viewport_state.state = CALLOC_STRUCT(r300_viewport_state); r300->ztop_state.state = CALLOC_STRUCT(r300_ztop_state); diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 80e69924f0..985e339112 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -288,9 +288,11 @@ struct r300_vertex_info { uint32_t vap_prog_stream_cntl_ext[8]; }; -struct r300_velems_state { +struct r300_vertex_element_state { unsigned count; struct pipe_vertex_element velem[PIPE_MAX_ATTRIBS]; + + struct r300_vertex_stream_state vertex_stream; }; extern struct pipe_viewport_state r300_viewport_identity; @@ -365,7 +367,7 @@ struct r300_context { int vertex_buffer_count; int vertex_buffer_max_index; /* Vertex elements for Gallium. */ - struct r300_velems_state *velems; + struct r300_vertex_element_state *velems; /* Vertex info for Draw. */ struct vertex_info vertex_info; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 7683a423f2..bd4c2766cb 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1046,8 +1046,6 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, if (r300->draw) { draw_flush(r300->draw); draw_set_vertex_buffers(r300->draw, count, buffers); - } else { - r300->vertex_stream_state.dirty = TRUE; } } @@ -1067,37 +1065,209 @@ static boolean r300_validate_aos(struct r300_context *r300) return TRUE; } +static void r300_draw_emit_attrib(struct r300_context* r300, + enum attrib_emit emit, + enum interp_mode interp, + int index) +{ + struct r300_vertex_shader* vs = r300->vs_state.state; + struct tgsi_shader_info* info = &vs->info; + int output; + + output = draw_find_shader_output(r300->draw, + info->output_semantic_name[index], + info->output_semantic_index[index]); + draw_emit_vertex_attr(&r300->vertex_info, emit, interp, output); +} + +static void r300_draw_emit_all_attribs(struct r300_context* r300) +{ + struct r300_vertex_shader* vs = r300->vs_state.state; + struct r300_shader_semantics* vs_outputs = &vs->outputs; + int i, gen_count; + + /* Position. */ + if (vs_outputs->pos != ATTR_UNUSED) { + r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE, + vs_outputs->pos); + } else { + assert(0); + } + + /* Point size. */ + if (vs_outputs->psize != ATTR_UNUSED) { + r300_draw_emit_attrib(r300, EMIT_1F_PSIZE, INTERP_POS, + vs_outputs->psize); + } + + /* Colors. */ + for (i = 0; i < ATTR_COLOR_COUNT; i++) { + if (vs_outputs->color[i] != ATTR_UNUSED) { + r300_draw_emit_attrib(r300, EMIT_4F, INTERP_LINEAR, + vs_outputs->color[i]); + } + } + + /* XXX Back-face colors. */ + + /* Texture coordinates. */ + gen_count = 0; + for (i = 0; i < ATTR_GENERIC_COUNT; i++) { + if (vs_outputs->generic[i] != ATTR_UNUSED) { + r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE, + vs_outputs->generic[i]); + gen_count++; + } + } + + /* Fog coordinates. */ + if (vs_outputs->fog != ATTR_UNUSED) { + r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE, + vs_outputs->fog); + gen_count++; + } + + /* XXX magic */ + assert(gen_count <= 8); +} + +/* Update the PSC tables. */ +static void r300_vertex_psc(struct r300_vertex_element_state *velems) +{ + struct r300_vertex_stream_state *vstream = &velems->vertex_stream; + uint16_t type, swizzle; + enum pipe_format format; + unsigned i; + + assert(velems->count <= 16); + + /* Vertex shaders have no semantics on their inputs, + * so PSC should just route stuff based on the vertex elements, + * and not on attrib information. */ + for (i = 0; i < velems->count; i++) { + format = velems->velem[i].src_format; + + type = r300_translate_vertex_data_type(format) | + (i << R300_DST_VEC_LOC_SHIFT); + swizzle = r300_translate_vertex_data_swizzle(format); + + if (i & 1) { + vstream->vap_prog_stream_cntl[i >> 1] |= type << 16; + vstream->vap_prog_stream_cntl_ext[i >> 1] |= swizzle << 16; + } else { + vstream->vap_prog_stream_cntl[i >> 1] |= type; + vstream->vap_prog_stream_cntl_ext[i >> 1] |= swizzle; + } + } + + /* Set the last vector in the PSC. */ + if (i) { + i -= 1; + } + vstream->vap_prog_stream_cntl[i >> 1] |= + (R300_LAST_VEC << (i & 1 ? 16 : 0)); + + vstream->count = (i >> 1) + 1; +} + +/* Update the PSC tables for SW TCL, using Draw. */ +static void r300_swtcl_vertex_psc(struct r300_context *r300, + struct r300_vertex_element_state *velems) +{ + struct r300_vertex_stream_state *vstream = &velems->vertex_stream; + struct r300_vertex_shader* vs = r300->vs_state.state; + struct vertex_info* vinfo = &r300->vertex_info; + uint16_t type, swizzle; + enum pipe_format format; + unsigned i, attrib_count; + int* vs_output_tab = vs->stream_loc_notcl; + + /* For each Draw attribute, route it to the fragment shader according + * to the vs_output_tab. */ + attrib_count = vinfo->num_attribs; + DBG(r300, DBG_DRAW, "r300: attrib count: %d\n", attrib_count); + for (i = 0; i < attrib_count; i++) { + DBG(r300, DBG_DRAW, "r300: attrib: offset %d, interp %d, size %d," + " vs_output_tab %d\n", vinfo->attrib[i].src_index, + vinfo->attrib[i].interp_mode, vinfo->attrib[i].emit, + vs_output_tab[i]); + } + + for (i = 0; i < attrib_count; i++) { + /* Make sure we have a proper destination for our attribute. */ + assert(vs_output_tab[i] != -1); + + format = draw_translate_vinfo_format(vinfo->attrib[i].emit); + + /* Obtain the type of data in this attribute. */ + type = r300_translate_vertex_data_type(format) | + vs_output_tab[i] << R300_DST_VEC_LOC_SHIFT; + + /* Obtain the swizzle for this attribute. Note that the default + * swizzle in the hardware is not XYZW! */ + swizzle = r300_translate_vertex_data_swizzle(format); + + /* Add the attribute to the PSC table. */ + if (i & 1) { + vstream->vap_prog_stream_cntl[i >> 1] |= type << 16; + vstream->vap_prog_stream_cntl_ext[i >> 1] |= swizzle << 16; + } else { + vstream->vap_prog_stream_cntl[i >> 1] |= type; + vstream->vap_prog_stream_cntl_ext[i >> 1] |= swizzle; + } + } + + /* Set the last vector in the PSC. */ + if (i) { + i -= 1; + } + vstream->vap_prog_stream_cntl[i >> 1] |= + (R300_LAST_VEC << (i & 1 ? 16 : 0)); + + vstream->count = (i >> 1) + 1; +} + static void* r300_create_vertex_elements_state(struct pipe_context* pipe, unsigned count, const struct pipe_vertex_element* attribs) { - struct r300_velems_state *velems; + struct r300_context *r300 = r300_context(pipe); + struct r300_screen* r300screen = r300_screen(pipe->screen); + struct r300_vertex_element_state *velems; - /*XXX should precalculate state here instead of later */ assert(count <= PIPE_MAX_ATTRIBS); - velems = CALLOC_STRUCT(r300_velems_state); - if (velems) { + velems = CALLOC_STRUCT(r300_vertex_element_state); + if (velems != NULL) { velems->count = count; memcpy(velems->velem, attribs, sizeof(struct pipe_vertex_element) * count); + + if (r300screen->caps->has_tcl) { + r300_vertex_psc(velems); + } else { + memset(&r300->vertex_info, 0, sizeof(struct vertex_info)); + r300_draw_emit_all_attribs(r300); + draw_compute_vertex_size(&r300->vertex_info); + r300_swtcl_vertex_psc(r300, velems); + } } return velems; } static void r300_bind_vertex_elements_state(struct pipe_context *pipe, - void *velems) + void *state) { struct r300_context *r300 = r300_context(pipe); - struct r300_velems_state *r300_velems = (struct r300_velems_state *) velems; + struct r300_vertex_element_state *velems = state; if (velems == NULL) { return; } - r300->velems = r300_velems; + r300->velems = velems; if (r300->draw) { draw_flush(r300->draw); - draw_set_vertex_elements(r300->draw, r300_velems->count, r300_velems->velem); + draw_set_vertex_elements(r300->draw, velems->count, velems->velem); } if (!r300_validate_aos(r300)) { @@ -1105,11 +1275,14 @@ static void r300_bind_vertex_elements_state(struct pipe_context *pipe, assert(0); abort(); } + + UPDATE_STATE(&velems->vertex_stream, r300->vertex_stream_state); + r300->vertex_stream_state.size = (1 + velems->vertex_stream.count) * 2; } -static void r300_delete_vertex_elements_state(struct pipe_context *pipe, void *velems) +static void r300_delete_vertex_elements_state(struct pipe_context *pipe, void *state) { - FREE(velems); + FREE(state); } static void* r300_create_vs_state(struct pipe_context* pipe, diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index cb2b9bd99f..6b9f61acd7 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -37,183 +37,6 @@ /* r300_state_derived: Various bits of state which are dependent upon * currently bound CSO data. */ -static void r300_draw_emit_attrib(struct r300_context* r300, - enum attrib_emit emit, - enum interp_mode interp, - int index) -{ - struct r300_vertex_shader* vs = r300->vs_state.state; - struct tgsi_shader_info* info = &vs->info; - int output; - - output = draw_find_shader_output(r300->draw, - info->output_semantic_name[index], - info->output_semantic_index[index]); - draw_emit_vertex_attr(&r300->vertex_info, emit, interp, output); -} - -static void r300_draw_emit_all_attribs(struct r300_context* r300) -{ - struct r300_vertex_shader* vs = r300->vs_state.state; - struct r300_shader_semantics* vs_outputs = &vs->outputs; - int i, gen_count; - - /* Position. */ - if (vs_outputs->pos != ATTR_UNUSED) { - r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE, - vs_outputs->pos); - } else { - assert(0); - } - - /* Point size. */ - if (vs_outputs->psize != ATTR_UNUSED) { - r300_draw_emit_attrib(r300, EMIT_1F_PSIZE, INTERP_POS, - vs_outputs->psize); - } - - /* Colors. */ - for (i = 0; i < ATTR_COLOR_COUNT; i++) { - if (vs_outputs->color[i] != ATTR_UNUSED) { - r300_draw_emit_attrib(r300, EMIT_4F, INTERP_LINEAR, - vs_outputs->color[i]); - } - } - - /* XXX Back-face colors. */ - - /* Texture coordinates. */ - gen_count = 0; - for (i = 0; i < ATTR_GENERIC_COUNT; i++) { - if (vs_outputs->generic[i] != ATTR_UNUSED) { - r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE, - vs_outputs->generic[i]); - gen_count++; - } - } - - /* Fog coordinates. */ - if (vs_outputs->fog != ATTR_UNUSED) { - r300_draw_emit_attrib(r300, EMIT_4F, INTERP_PERSPECTIVE, - vs_outputs->fog); - gen_count++; - } - - /* XXX magic */ - assert(gen_count <= 8); -} - -/* Update the PSC tables. */ -/* XXX move this function into r300_state.c after TCL-bypass gets removed - * XXX because this one is dependent only on vertex elements. */ -static void r300_vertex_psc(struct r300_context* r300) -{ - struct r300_vertex_shader* vs = r300->vs_state.state; - struct r300_vertex_stream_state *vformat = - (struct r300_vertex_stream_state*)r300->vertex_stream_state.state; - uint16_t type, swizzle; - enum pipe_format format; - unsigned i; - - memset(vformat, 0, sizeof(struct r300_vertex_stream_state)); - - /* Vertex shaders have no semantics on their inputs, - * so PSC should just route stuff based on the vertex elements, - * and not on attrib information. */ - DBG(r300, DBG_DRAW, "r300: vs expects %d attribs, routing %d elements" - " in psc\n", - vs->info.num_inputs, - r300->velems->count); - - for (i = 0; i < r300->velems->count; i++) { - format = r300->velems->velem[i].src_format; - - type = r300_translate_vertex_data_type(format) | - (i << R300_DST_VEC_LOC_SHIFT); - swizzle = r300_translate_vertex_data_swizzle(format); - - if (i & 1) { - vformat->vap_prog_stream_cntl[i >> 1] |= type << 16; - vformat->vap_prog_stream_cntl_ext[i >> 1] |= swizzle << 16; - } else { - vformat->vap_prog_stream_cntl[i >> 1] |= type; - vformat->vap_prog_stream_cntl_ext[i >> 1] |= swizzle; - } - } - - assert(i <= 15); - - /* Set the last vector in the PSC. */ - if (i) { - i -= 1; - } - vformat->vap_prog_stream_cntl[i >> 1] |= - (R300_LAST_VEC << (i & 1 ? 16 : 0)); - - vformat->count = (i >> 1) + 1; - r300->vertex_stream_state.size = (1 + vformat->count) * 2; -} - -/* Update the PSC tables for SW TCL, using Draw. */ -static void r300_swtcl_vertex_psc(struct r300_context* r300) -{ - struct r300_vertex_shader* vs = r300->vs_state.state; - struct r300_vertex_stream_state *vformat = - (struct r300_vertex_stream_state*)r300->vertex_stream_state.state; - struct vertex_info* vinfo = &r300->vertex_info; - uint16_t type, swizzle; - enum pipe_format format; - unsigned i, attrib_count; - int* vs_output_tab = vs->stream_loc_notcl; - - memset(vformat, 0, sizeof(struct r300_vertex_stream_state)); - - /* For each Draw attribute, route it to the fragment shader according - * to the vs_output_tab. */ - attrib_count = vinfo->num_attribs; - DBG(r300, DBG_DRAW, "r300: attrib count: %d\n", attrib_count); - for (i = 0; i < attrib_count; i++) { - DBG(r300, DBG_DRAW, "r300: attrib: offset %d, interp %d, size %d," - " vs_output_tab %d\n", vinfo->attrib[i].src_index, - vinfo->attrib[i].interp_mode, vinfo->attrib[i].emit, - vs_output_tab[i]); - } - - for (i = 0; i < attrib_count; i++) { - /* Make sure we have a proper destination for our attribute. */ - assert(vs_output_tab[i] != -1); - - format = draw_translate_vinfo_format(vinfo->attrib[i].emit); - - /* Obtain the type of data in this attribute. */ - type = r300_translate_vertex_data_type(format) | - vs_output_tab[i] << R300_DST_VEC_LOC_SHIFT; - - /* Obtain the swizzle for this attribute. Note that the default - * swizzle in the hardware is not XYZW! */ - swizzle = r300_translate_vertex_data_swizzle(format); - - /* Add the attribute to the PSC table. */ - if (i & 1) { - vformat->vap_prog_stream_cntl[i >> 1] |= type << 16; - vformat->vap_prog_stream_cntl_ext[i >> 1] |= swizzle << 16; - } else { - vformat->vap_prog_stream_cntl[i >> 1] |= type; - vformat->vap_prog_stream_cntl_ext[i >> 1] |= swizzle; - } - } - - /* Set the last vector in the PSC. */ - if (i) { - i -= 1; - } - vformat->vap_prog_stream_cntl[i >> 1] |= - (R300_LAST_VEC << (i & 1 ? 16 : 0)); - - vformat->count = (i >> 1) + 1; - r300->vertex_stream_state.size = (1 + vformat->count) * 2; -} - static void r300_rs_col(struct r300_rs_block* rs, int id, int ptr, boolean swizzle_0001) { @@ -428,18 +251,8 @@ static void r300_update_rs_block(struct r300_context* r300, static void r300_update_derived_shader_state(struct r300_context* r300) { struct r300_vertex_shader* vs = r300->vs_state.state; - struct r300_screen* r300screen = r300_screen(r300->context.screen); r300_update_rs_block(r300, &vs->outputs, &r300->fs->inputs); - - if (r300screen->caps->has_tcl) { - r300_vertex_psc(r300); - } else { - memset(&r300->vertex_info, 0, sizeof(struct vertex_info)); - r300_draw_emit_all_attribs(r300); - draw_compute_vertex_size(&r300->vertex_info); - r300_swtcl_vertex_psc(r300); - } } static boolean r300_dsa_writes_depth_stencil(struct r300_dsa_state* dsa) @@ -572,8 +385,7 @@ static void r300_merge_textures_and_samplers(struct r300_context* r300) void r300_update_derived_state(struct r300_context* r300) { - if (r300->rs_block_state.dirty || - r300->vertex_stream_state.dirty) { /* XXX put updating PSC out of this file */ + if (r300->rs_block_state.dirty) { r300_update_derived_shader_state(r300); } -- cgit v1.2.3 From a73fd447d4bb3d509fedf52b18a50fccab618298 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 9 Mar 2010 07:30:27 -0800 Subject: cso: Fix typo in assert. --- src/gallium/auxiliary/cso_cache/cso_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 292e489312..f8cb01467c 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -1248,7 +1248,7 @@ enum pipe_error cso_set_vertex_elements(struct cso_context *ctx, void cso_save_vertex_elements(struct cso_context *ctx) { - assert(!ctx->velements); + assert(!ctx->velements_saved); ctx->velements_saved = ctx->velements; } -- cgit v1.2.3 From 3c57c01a44c294e69d902207b2ec94d28a397a51 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 15:25:42 +0000 Subject: ws/xlib: remove self-knowledge about users of xlib winsys Several software rasterizers can make use of this winsys, but there isn't any reason why the winsys itself should know about them. This change moves that information into the libgl-xlib target. Need to fix up other targets making use of this winsys. --- src/gallium/drivers/cell/ppu/cell_public.h | 10 +++ src/gallium/drivers/cell/ppu/cell_screen.c | 1 + src/gallium/drivers/cell/ppu/cell_screen.h | 3 - src/gallium/drivers/llvmpipe/lp_public.h | 10 +++ src/gallium/drivers/llvmpipe/lp_screen.c | 1 + src/gallium/drivers/llvmpipe/lp_screen.h | 2 - src/gallium/drivers/softpipe/sp_public.h | 10 +++ src/gallium/drivers/softpipe/sp_screen.c | 1 + src/gallium/drivers/softpipe/sp_screen.h | 8 -- src/gallium/include/state_tracker/xlib_sw_winsys.h | 10 ++- src/gallium/targets/libgl-xlib/xlib.c | 65 ++++++++++++--- src/gallium/winsys/xlib/Makefile | 6 +- src/gallium/winsys/xlib/SConscript | 3 - src/gallium/winsys/xlib/xlib.c | 49 ----------- src/gallium/winsys/xlib/xlib.h | 18 ---- src/gallium/winsys/xlib/xlib_cell.c | 95 ---------------------- src/gallium/winsys/xlib/xlib_llvmpipe.c | 79 ------------------ src/gallium/winsys/xlib/xlib_softpipe.c | 68 ---------------- src/gallium/winsys/xlib/xlib_sw_winsys.c | 4 +- 19 files changed, 96 insertions(+), 347 deletions(-) create mode 100644 src/gallium/drivers/cell/ppu/cell_public.h create mode 100644 src/gallium/drivers/llvmpipe/lp_public.h create mode 100644 src/gallium/drivers/softpipe/sp_public.h delete mode 100644 src/gallium/winsys/xlib/xlib.c delete mode 100644 src/gallium/winsys/xlib/xlib.h delete mode 100644 src/gallium/winsys/xlib/xlib_cell.c delete mode 100644 src/gallium/winsys/xlib/xlib_llvmpipe.c delete mode 100644 src/gallium/winsys/xlib/xlib_softpipe.c (limited to 'src') diff --git a/src/gallium/drivers/cell/ppu/cell_public.h b/src/gallium/drivers/cell/ppu/cell_public.h new file mode 100644 index 0000000000..7e2e093565 --- /dev/null +++ b/src/gallium/drivers/cell/ppu/cell_public.h @@ -0,0 +1,10 @@ +#ifndef CELL_PUBLIC_H +#define CELL_PUBLIC_H + +struct pipe_screen; +struct sw_winsys; + +struct pipe_screen * +cell_create_screen(struct sw_winsys *winsys); + +#endif diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c index fc04767a1e..31fd963d19 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.c +++ b/src/gallium/drivers/cell/ppu/cell_screen.c @@ -36,6 +36,7 @@ #include "cell_screen.h" #include "cell_texture.h" #include "cell_buffer.h" +#include "cell_public.h" #include "state_tracker/sw_winsys.h" diff --git a/src/gallium/drivers/cell/ppu/cell_screen.h b/src/gallium/drivers/cell/ppu/cell_screen.h index 6a22433b56..baff9d3b7d 100644 --- a/src/gallium/drivers/cell/ppu/cell_screen.h +++ b/src/gallium/drivers/cell/ppu/cell_screen.h @@ -51,8 +51,5 @@ cell_screen( struct pipe_screen *pipe ) return (struct cell_screen *)pipe; } -extern struct pipe_screen * -cell_create_screen(struct sw_winsys *winsys); - #endif /* CELL_SCREEN_H */ diff --git a/src/gallium/drivers/llvmpipe/lp_public.h b/src/gallium/drivers/llvmpipe/lp_public.h new file mode 100644 index 0000000000..ec6b660b48 --- /dev/null +++ b/src/gallium/drivers/llvmpipe/lp_public.h @@ -0,0 +1,10 @@ +#ifndef LP_PUBLIC_H +#define LP_PUBLIC_H + +struct pipe_screen; +struct sw_winsys; + +struct pipe_screen * +llvmpipe_create_screen(struct sw_winsys *winsys); + +#endif diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 9bb3043320..5093f58bb1 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -38,6 +38,7 @@ #include "lp_screen.h" #include "lp_context.h" #include "lp_debug.h" +#include "lp_public.h" #include "state_tracker/sw_winsys.h" diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h index 0c86283605..f4e62cbf08 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.h +++ b/src/gallium/drivers/llvmpipe/lp_screen.h @@ -76,7 +76,5 @@ llvmpipe_screen( struct pipe_screen *pipe ) } -struct pipe_screen * -llvmpipe_create_screen(struct sw_winsys *winsys); #endif /* LP_SCREEN_H */ diff --git a/src/gallium/drivers/softpipe/sp_public.h b/src/gallium/drivers/softpipe/sp_public.h new file mode 100644 index 0000000000..62d0903d87 --- /dev/null +++ b/src/gallium/drivers/softpipe/sp_public.h @@ -0,0 +1,10 @@ +#ifndef SP_PUBLIC_H +#define SP_PUBLIC_H + +struct pipe_screen; +struct sw_winsys; + +struct pipe_screen * +softpipe_create_screen(struct sw_winsys *winsys); + +#endif diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 44680ea70c..e0a2ef604e 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -36,6 +36,7 @@ #include "sp_screen.h" #include "sp_context.h" #include "sp_buffer.h" +#include "sp_public.h" static const char * diff --git a/src/gallium/drivers/softpipe/sp_screen.h b/src/gallium/drivers/softpipe/sp_screen.h index 4d7d8bada2..f741454c9e 100644 --- a/src/gallium/drivers/softpipe/sp_screen.h +++ b/src/gallium/drivers/softpipe/sp_screen.h @@ -59,12 +59,4 @@ softpipe_screen( struct pipe_screen *pipe ) -/** - * Create a softpipe screen that uses the - * given winsys for allocating buffers. - */ -struct pipe_screen *softpipe_create_screen( struct sw_winsys * ); - - - #endif /* SP_SCREEN_H */ diff --git a/src/gallium/include/state_tracker/xlib_sw_winsys.h b/src/gallium/include/state_tracker/xlib_sw_winsys.h index 3cb679426d..13dc837712 100644 --- a/src/gallium/include/state_tracker/xlib_sw_winsys.h +++ b/src/gallium/include/state_tracker/xlib_sw_winsys.h @@ -18,13 +18,17 @@ struct xlib_drawable { Drawable drawable; }; - +/* This is the interface required by the glx/xlib state tracker. Why + * is it being defined in this file? + */ struct xm_driver { struct pipe_screen *(*create_pipe_screen)( Display *display ); }; -/* Called by the libgl-xlib target code to build the rendering stack. +/* This is the public interface to the ws/xlib module. Why isn't it + * being defined in that directory? */ -struct xm_driver *xlib_sw_winsys_init( void ); +struct sw_winsys *xlib_create_sw_winsys( Display *display ); + #endif diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c index 7cae0884e8..6651bd538e 100644 --- a/src/gallium/targets/libgl-xlib/xlib.c +++ b/src/gallium/targets/libgl-xlib/xlib.c @@ -34,28 +34,71 @@ #include "state_tracker/xlib_sw_winsys.h" #include "xm_winsys.h" #include "util/u_debug.h" - +#include "softpipe/sp_public.h" +#include "llvmpipe/lp_public.h" +#include "cell/ppu/cell_public.h" /* advertise OpenGL support */ PUBLIC const int st_api_OpenGL = 1; -static void _init( void ) __attribute__((constructor)); + +static struct pipe_screen * +create_screen( struct sw_winsys *winsys ) +{ +#if defined(GALLIUM_CELL) + if (!getenv("GALLIUM_NOCELL")) + return cell_create_screen( winsys ); +#endif + +#if defined(GALLIUM_LLVMPIPE) + return llvmpipe_create_screen( winsys ); +#endif + + return softpipe_create_screen( winsys ); +} + + + +static struct pipe_screen * +xlib_create_screen( Display *display ) +{ + struct sw_winsys *winsys; + struct pipe_screen *screen; + + winsys = xlib_create_sw_winsys( display ); + if (winsys == NULL) + return NULL; + + screen = create_screen(winsys); + if (screen == NULL) + goto fail; + + return screen; + +fail: + if (winsys) + winsys->destroy( winsys ); + + return NULL; +} + + +struct xm_driver xlib_driver = +{ + .create_pipe_screen = xlib_create_screen, +}; + + + /* Build the rendering stack. */ +static void _init( void ) __attribute__((constructor)); static void _init( void ) { - struct xm_driver *driver; - - /* Initialize the xlib software winsys. Later on, once Display and - * other parameters are known, this will be used to create the - * gallium driver (such as softpipe), etc. - */ - driver = xlib_sw_winsys_init(); - /* Initialize the xlib libgl code, pass in the winsys: */ - xmesa_set_driver( driver ); + xmesa_set_driver( &xlib_driver ); } diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index bb631b16ce..68542b488d 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -9,11 +9,7 @@ LIBRARY_INCLUDES = \ -I$(TOP)/src/gallium/auxiliary C_SOURCES = \ - xlib.c \ - xlib_cell.c \ - xlib_sw_winsys.c \ - xlib_llvmpipe.c \ - xlib_softpipe.c + xlib_sw_winsys.c include ../../Makefile.template diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index 1a1879f128..d4009df991 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -18,9 +18,6 @@ if env['platform'] == 'linux' \ ws_xlib = env.ConvenienceLibrary( target = 'ws_xlib', source = [ - 'xlib_cell.c', - 'xlib_llvmpipe.c', - 'xlib_softpipe.c', 'xlib_sw_winsys.c', ] ) diff --git a/src/gallium/winsys/xlib/xlib.c b/src/gallium/winsys/xlib/xlib.c deleted file mode 100644 index 6ca9e362e7..0000000000 --- a/src/gallium/winsys/xlib/xlib.c +++ /dev/null @@ -1,49 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/* - * Authors: - * Keith Whitwell - */ - -#include "xlib.h" -#include "util/u_debug.h" - -struct xm_driver *xlib_sw_winsys_init( void ) -{ -#if defined(GALLIUM_CELL) - if (!getenv("GALLIUM_NOCELL")) - return &xlib_cell_driver; -#endif - -#if defined(GALLIUM_LLVMPIPE) - return &xlib_llvmpipe_driver; -#endif - - return &xlib_softpipe_driver; -} diff --git a/src/gallium/winsys/xlib/xlib.h b/src/gallium/winsys/xlib/xlib.h deleted file mode 100644 index 3c20048616..0000000000 --- a/src/gallium/winsys/xlib/xlib.h +++ /dev/null @@ -1,18 +0,0 @@ - -#ifndef XLIB_H -#define XLIB_H - -#include "pipe/p_compiler.h" -#include "state_tracker/xlib_sw_winsys.h" - -extern struct xm_driver xlib_softpipe_driver; -extern struct xm_driver xlib_llvmpipe_driver; -extern struct xm_driver xlib_cell_driver; - -struct sw_winsys *xlib_create_sw_winsys( Display *display ); - -void xlib_sw_display(struct xlib_drawable *xm_buffer, - struct sw_displaytarget *dt); - - -#endif diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c deleted file mode 100644 index d943953bd1..0000000000 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ /dev/null @@ -1,95 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/* - * Authors: - * Keith Whitwell - * Brian Paul - */ - - -#include "xlib.h" - -#if defined(GALLIUM_CELL) - -#include "cell/ppu/cell_texture.h" -#include "cell/ppu/cell_screen.h" -#include "state_tracker/sw_winsys.h" -#include "util/u_debug.h" - - -/** - * Display/copy the image in the surface into the X window specified - * by the XMesaBuffer. - */ -static void -xm_cell_displaytarget_display(struct sw_winsys *ws, - struct sw_displaytarget *dt, - void *context_private) -{ - struct xlib_drawable *xlib_drawable = (struct xlib_drawable *)context_private; - xlib_sw_display(xlib_drawable, dt); -} - - -static struct pipe_screen * -xlib_create_cell_screen( Display *dpy ) -{ - struct sw_winsys *winsys; - struct pipe_screen *screen; - - winsys = xlib_create_sw_winsys( dpy ); - if (winsys == NULL) - return NULL; - - /* Plug in a little cell-specific code: - */ - - winsys->displaytarget_display = xm_cell_displaytarget_display; - - screen = cell_create_screen(winsys); - if (screen == NULL) - goto fail; - - return screen; - -fail: - if (winsys) - winsys->destroy( winsys ); - - return NULL; -} - - -struct xm_driver xlib_cell_driver = -{ - .create_pipe_screen = xlib_create_cell_screen, -}; - - -#endif /* GALLIUM_CELL */ diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c deleted file mode 100644 index 8b66b7459d..0000000000 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/* - * Authors: - * Keith Whitwell - * Brian Paul - */ - - - - -#include "xlib.h" - - -#if defined(GALLIUM_LLVMPIPE) - -#include "llvmpipe/lp_texture.h" -#include "llvmpipe/lp_screen.h" -#include "state_tracker/xlib_sw_winsys.h" -#include "util/u_debug.h" - -static struct pipe_screen * -xlib_create_llvmpipe_screen( Display *display ) -{ - struct sw_winsys *winsys; - struct pipe_screen *screen; - - winsys = xlib_create_sw_winsys( display ); - if (winsys == NULL) - return NULL; - - screen = llvmpipe_create_screen(winsys); - if (screen == NULL) - goto fail; - - return screen; - -fail: - if (winsys) - winsys->destroy( winsys ); - - return NULL; -} - - -struct xm_driver xlib_llvmpipe_driver = -{ - .create_pipe_screen = xlib_create_llvmpipe_screen, -}; - - - -#endif /* GALLIUM_LLVMPIPE */ diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c deleted file mode 100644 index 08b7f08837..0000000000 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - - -#include "xlib.h" -#include "softpipe/sp_texture.h" -#include "softpipe/sp_screen.h" -#include "state_tracker/xlib_sw_winsys.h" -#include "util/u_debug.h" - -static struct pipe_screen * -xlib_create_softpipe_screen( Display *display ) -{ - struct sw_winsys *winsys; - struct pipe_screen *screen; - - winsys = xlib_create_sw_winsys( display ); - if (winsys == NULL) - return NULL; - - screen = softpipe_create_screen(winsys); - if (screen == NULL) - goto fail; - - return screen; - -fail: - if (winsys) - winsys->destroy( winsys ); - - return NULL; -} - - - - -struct xm_driver xlib_softpipe_driver = -{ - .create_pipe_screen = xlib_create_softpipe_screen, -}; - - - diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c index d03e39a249..0ee589943e 100644 --- a/src/gallium/winsys/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -47,8 +47,6 @@ #include "state_tracker/xlib_sw_winsys.h" -#include "xlib.h" - #include #include #include @@ -274,7 +272,7 @@ xm_displaytarget_destroy(struct sw_winsys *ws, * Display/copy the image in the surface into the X window specified * by the XMesaBuffer. */ -void +static void xlib_sw_display(struct xlib_drawable *xlib_drawable, struct sw_displaytarget *dt) { -- cgit v1.2.3 From 999932bf1feed4cbf834b2c81510aab09dda56dc Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 15:58:45 +0000 Subject: targets/libgl-xlib: add code to inject trace and identity layers Finally we can inject layers for debug, trace and "other" with relative ease between state-tracker and driver. --- src/gallium/drivers/trace/tr_drm.c | 1 + src/gallium/drivers/trace/tr_public.h | 37 ++++++++++++++++++++++++++++ src/gallium/drivers/trace/tr_screen.h | 3 --- src/gallium/state_trackers/glx/xlib/xm_api.c | 8 +----- src/gallium/targets/libgl-xlib/Makefile | 2 ++ src/gallium/targets/libgl-xlib/xlib.c | 16 +++++++++++- 6 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 src/gallium/drivers/trace/tr_public.h (limited to 'src') diff --git a/src/gallium/drivers/trace/tr_drm.c b/src/gallium/drivers/trace/tr_drm.c index c16989fa52..906b3262e4 100644 --- a/src/gallium/drivers/trace/tr_drm.c +++ b/src/gallium/drivers/trace/tr_drm.c @@ -33,6 +33,7 @@ #include "tr_context.h" #include "tr_buffer.h" #include "tr_texture.h" +#include "tr_public.h" struct trace_drm_api { diff --git a/src/gallium/drivers/trace/tr_public.h b/src/gallium/drivers/trace/tr_public.h new file mode 100644 index 0000000000..da31c24e64 --- /dev/null +++ b/src/gallium/drivers/trace/tr_public.h @@ -0,0 +1,37 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef TR_PUBLIC_H +#define TR_PUBLIC_H + +struct pipe_screen; +struct pipe_context; + +struct pipe_screen * +trace_screen_create(struct pipe_screen *screen); + +#endif /* TR_PUBLIC_H */ diff --git a/src/gallium/drivers/trace/tr_screen.h b/src/gallium/drivers/trace/tr_screen.h index fe5a0fa190..597e2fc265 100644 --- a/src/gallium/drivers/trace/tr_screen.h +++ b/src/gallium/drivers/trace/tr_screen.h @@ -99,9 +99,6 @@ trace_enabled(void); struct trace_screen * trace_screen(struct pipe_screen *screen); -struct pipe_screen * -trace_screen_create(struct pipe_screen *screen); - void trace_screen_user_buffer_update(struct pipe_screen *screen, struct pipe_buffer *buffer); diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index cf9a399209..b8647d71c6 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -63,10 +63,6 @@ #include "pipe/p_screen.h" #include "pipe/p_context.h" -#include "trace/tr_screen.h" -#include "trace/tr_context.h" -#include "trace/tr_texture.h" - #include "xm_winsys.h" #include @@ -87,7 +83,6 @@ void xmesa_set_driver( const struct xm_driver *templ ) */ pipe_mutex _xmesa_lock; -static struct pipe_screen *_screen = NULL; static struct pipe_screen *screen = NULL; @@ -709,8 +704,7 @@ xmesa_init( Display *display ) static GLboolean firstTime = GL_TRUE; if (firstTime) { pipe_mutex_init(_xmesa_lock); - _screen = driver.create_pipe_screen( display ); - screen = trace_screen_create( _screen ); + screen = driver.create_pipe_screen( display ); firstTime = GL_FALSE; } } diff --git a/src/gallium/targets/libgl-xlib/Makefile b/src/gallium/targets/libgl-xlib/Makefile index 8ffe4dbf24..5a4e035c2e 100644 --- a/src/gallium/targets/libgl-xlib/Makefile +++ b/src/gallium/targets/libgl-xlib/Makefile @@ -39,6 +39,8 @@ LIBS = \ $(GALLIUM_DRIVERS) \ $(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \ $(TOP)/src/gallium/winsys/xlib/libws_xlib.a \ + $(TOP)/src/gallium/drivers/trace/libtrace.a \ + $(TOP)/src/gallium/drivers/identity/libidentity.a \ $(TOP)/src/mesa/libglapi.a \ $(TOP)/src/mesa/libmesagallium.a \ $(GALLIUM_AUXILIARIES) \ diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c index 6651bd538e..7881bc2cb1 100644 --- a/src/gallium/targets/libgl-xlib/xlib.c +++ b/src/gallium/targets/libgl-xlib/xlib.c @@ -36,8 +36,11 @@ #include "util/u_debug.h" #include "softpipe/sp_public.h" #include "llvmpipe/lp_public.h" +#include "identity/id_public.h" +#include "trace/tr_public.h" #include "cell/ppu/cell_public.h" + /* advertise OpenGL support */ PUBLIC const int st_api_OpenGL = 1; @@ -46,7 +49,7 @@ static struct pipe_screen * create_screen( struct sw_winsys *winsys ) { #if defined(GALLIUM_CELL) - if (!getenv("GALLIUM_NOCELL")) + if (!debug_get_bool_option("GALLIUM_NOCELL", FALSE)) return cell_create_screen( winsys ); #endif @@ -73,6 +76,17 @@ xlib_create_screen( Display *display ) if (screen == NULL) goto fail; + /* Finally we have somewhere to inject layers into the stack in a + * clean fashion: + */ + if (debug_get_bool_option("GALLIUM_WRAP", FALSE)) { + screen = identity_screen_create(screen); + } + + if (debug_get_bool_option("GALLIUM_TRACE", FALSE)) { + screen = trace_screen_create( screen ); + } + return screen; fail: -- cgit v1.2.3 From 09a7c25e7661887be31f3cd340010b99b407ef16 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sun, 7 Mar 2010 01:24:57 +0000 Subject: util: Use bitshift arithmetic for pack too. --- src/gallium/auxiliary/util/u_format_pack.py | 77 ++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py index b49039db39..409d024c63 100644 --- a/src/gallium/auxiliary/util/u_format_pack.py +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -418,31 +418,70 @@ def generate_format_pack(format, src_channel, src_native_type, src_suffix): dst_native_type = native_type(format) + assert format.layout == PLAIN + + inv_swizzle = format.inv_swizzles() + print 'static INLINE void' print 'util_format_%s_pack_%s(void *dst, %s r, %s g, %s b, %s a)' % (name, src_suffix, src_native_type, src_native_type, src_native_type, src_native_type) print '{' - print ' union util_format_%s pixel;' % format.short_name() - - assert format.layout == PLAIN + + if format.is_bitmask(): + depth = format.block_size() + print ' uint%u_t value = 0;' % depth - inv_swizzle = format.inv_swizzles() + shift = 0 + for i in range(4): + dst_channel = format.channels[i] + if inv_swizzle[i] is not None: + value = 'rgba'[inv_swizzle[i]] + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + if format.colorspace == ZS: + if i == 3: + value = get_one(dst_channel) + elif i >= 1: + value = '0' + if dst_channel.type in (UNSIGNED, SIGNED): + if shift + dst_channel.size < depth: + value = '(%s) & 0x%x' % (value, (1 << dst_channel.size) - 1) + if shift: + value = '(%s) << %u' % (value, shift) + if dst_channel.type == SIGNED: + # Cast to unsigned + value = '(uint%u_t)(%s) ' % (depth, value) + else: + value = None + if value is not None: + print ' value |= %s;' % (value) + + shift += dst_channel.size - for i in range(4): - dst_channel = format.channels[i] - width = dst_channel.size - if inv_swizzle[i] is None: - continue - value = 'rgba'[inv_swizzle[i]] - value = conversion_expr(src_channel, dst_channel, dst_native_type, value) - if format.colorspace == ZS: - if i == 3: - value = get_one(dst_channel) - elif i >= 1: - value = '0' - print ' pixel.chan.%s = %s;' % (dst_channel.name, value) + print '#ifdef PIPE_ARCH_BIG_ENDIAN' + print ' value = util_bswap%u(value);' % depth + print '#endif' + + print ' *(uint%u_t *)dst = value;' % depth - bswap_format(format) - print ' memcpy(dst, &pixel, sizeof pixel);' + else: + print ' union util_format_%s pixel;' % format.short_name() + + for i in range(4): + dst_channel = format.channels[i] + width = dst_channel.size + if inv_swizzle[i] is None: + continue + value = 'rgba'[inv_swizzle[i]] + value = conversion_expr(src_channel, dst_channel, dst_native_type, value) + if format.colorspace == ZS: + if i == 3: + value = get_one(dst_channel) + elif i >= 1: + value = '0' + print ' pixel.chan.%s = %s;' % (dst_channel.name, value) + + bswap_format(format) + print ' memcpy(dst, &pixel, sizeof pixel);' + print '}' print -- cgit v1.2.3 From e0f10a6fca34619f61c3533b68d89dcb1ff2627c Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 17:27:45 +0100 Subject: util: simplify util_format_get_nr_components helper since the number of components is now stored in the pipe format description, we obviously no longer need to figure this out ourselves. --- src/gallium/auxiliary/util/u_format.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 20fdaca007..c08fdcafcc 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -423,14 +423,7 @@ static INLINE unsigned util_format_get_nr_components(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); - unsigned chan; - unsigned nr_comp = 0; - for (chan = 0; chan < 4; chan++) { - if (desc->channel[chan].size != 0) { - nr_comp++; - } - } - return nr_comp; + return desc->nr_channels; } /* -- cgit v1.2.3 From 2ccae040a458ad0f95ee46916e2ea467d5cf9d02 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 9 Mar 2010 09:37:50 -0700 Subject: gallivm: checkpoint: nearest mipmap filtering The LOD is computed from texcoord partial derivatives and used to select a mipmap level. Still some bugs in texel fetching. Lots of rough edges and unfinished parts but the basics are in place. Lots of changes to the lp_bld_arit.c code to support non-vector/scalar datatypes. --- src/gallium/auxiliary/gallivm/lp_bld_arit.c | 143 +++++- src/gallium/auxiliary/gallivm/lp_bld_const.c | 8 +- src/gallium/auxiliary/gallivm/lp_bld_logic.c | 100 ++-- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c | 592 +++++++++++++--------- src/gallium/auxiliary/gallivm/lp_bld_type.h | 50 +- 5 files changed, 601 insertions(+), 292 deletions(-) (limited to 'src') diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c index 32f9e5201c..e2c6788397 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c @@ -644,13 +644,26 @@ lp_build_abs(struct lp_build_context *bld, if(type.floating) { /* Mask out the sign bit */ - LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); - unsigned long long absMask = ~(1ULL << (type.width - 1)); - LLVMValueRef mask = lp_build_int_const_scalar(type, ((unsigned long long) absMask)); - a = LLVMBuildBitCast(bld->builder, a, int_vec_type, ""); - a = LLVMBuildAnd(bld->builder, a, mask, ""); - a = LLVMBuildBitCast(bld->builder, a, vec_type, ""); - return a; + if (type.length == 1) { + LLVMTypeRef int_type = LLVMIntType(type.width); + LLVMTypeRef float_type = LLVMFloatType(); + unsigned long long absMask = ~(1ULL << (type.width - 1)); + LLVMValueRef mask = LLVMConstInt(int_type, absMask, 0); + a = LLVMBuildBitCast(bld->builder, a, int_type, ""); + a = LLVMBuildAnd(bld->builder, a, mask, ""); + a = LLVMBuildBitCast(bld->builder, a, float_type, ""); + return a; + } + else { + /* vector of floats */ + LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); + unsigned long long absMask = ~(1ULL << (type.width - 1)); + LLVMValueRef mask = lp_build_int_const_scalar(type, ((unsigned long long) absMask)); + a = LLVMBuildBitCast(bld->builder, a, int_vec_type, ""); + a = LLVMBuildAnd(bld->builder, a, mask, ""); + a = LLVMBuildBitCast(bld->builder, a, vec_type, ""); + return a; + } } if(type.width*type.length == 128 && util_cpu_caps.has_ssse3) { @@ -753,7 +766,7 @@ lp_build_set_sign(struct lp_build_context *bld, /** - * Convert vector of int to vector of float. + * Convert vector of (or scalar) int to vector of (or scalar) float. */ LLVMValueRef lp_build_int_to_float(struct lp_build_context *bld, @@ -764,7 +777,11 @@ lp_build_int_to_float(struct lp_build_context *bld, assert(type.floating); /*assert(lp_check_value(type, a));*/ - { + if (type.length == 1) { + LLVMTypeRef float_type = LLVMFloatType(); + return LLVMBuildSIToFP(bld->builder, a, float_type, ""); + } + else { LLVMTypeRef vec_type = lp_build_vec_type(type); /*LLVMTypeRef int_vec_type = lp_build_int_vec_type(type);*/ LLVMValueRef res; @@ -921,12 +938,18 @@ lp_build_itrunc(struct lp_build_context *bld, LLVMValueRef a) { const struct lp_type type = bld->type; - LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); assert(type.floating); - assert(lp_check_value(type, a)); - return LLVMBuildFPToSI(bld->builder, a, int_vec_type, ""); + if (type.length == 1) { + LLVMTypeRef int_type = LLVMIntType(type.width); + return LLVMBuildFPTrunc(bld->builder, a, int_type, ""); + } + else { + LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); + assert(lp_check_value(type, a)); + return LLVMBuildFPToSI(bld->builder, a, int_vec_type, ""); + } } @@ -939,6 +962,15 @@ lp_build_iround(struct lp_build_context *bld, LLVMValueRef res; assert(type.floating); + + if (type.length == 1) { + /* scalar float to int */ + LLVMTypeRef int_type = LLVMIntType(type.width); + /* XXX we want rounding here! */ + res = LLVMBuildFPToSI(bld->builder, a, int_type, ""); + return res; + } + assert(lp_check_value(type, a)); if(util_cpu_caps.has_sse4_1) { @@ -1207,6 +1239,7 @@ lp_build_polynomial(struct lp_build_context *bld, unsigned num_coeffs) { const struct lp_type type = bld->type; + LLVMTypeRef float_type = LLVMFloatType(); LLVMValueRef res = NULL; unsigned i; @@ -1216,7 +1249,13 @@ lp_build_polynomial(struct lp_build_context *bld, __FUNCTION__); for (i = num_coeffs; i--; ) { - LLVMValueRef coeff = lp_build_const_scalar(type, coeffs[i]); + LLVMValueRef coeff; + + if (type.length == 1) + coeff = LLVMConstReal(float_type, coeffs[i]); + else + coeff = lp_build_const_scalar(type, coeffs[i]); + if(res) res = lp_build_add(bld, coeff, lp_build_mul(bld, x, res)); else @@ -1410,11 +1449,87 @@ lp_build_log2_approx(struct lp_build_context *bld, } +/** scalar version of above function */ +static void +lp_build_float_log2_approx(struct lp_build_context *bld, + LLVMValueRef x, + LLVMValueRef *p_exp, + LLVMValueRef *p_floor_log2, + LLVMValueRef *p_log2) +{ + const struct lp_type type = bld->type; + LLVMTypeRef float_type = LLVMFloatType(); + LLVMTypeRef int_type = LLVMIntType(type.width); + + LLVMValueRef expmask = LLVMConstInt(int_type, 0x7f800000, 0); + LLVMValueRef mantmask = LLVMConstInt(int_type, 0x007fffff, 0); + LLVMValueRef one = LLVMConstBitCast(bld->one, int_type); + + LLVMValueRef i = NULL; + LLVMValueRef exp = NULL; + LLVMValueRef mant = NULL; + LLVMValueRef logexp = NULL; + LLVMValueRef logmant = NULL; + LLVMValueRef res = NULL; + + if(p_exp || p_floor_log2 || p_log2) { + /* TODO: optimize the constant case */ + if(LLVMIsConstant(x)) + debug_printf("%s: inefficient/imprecise constant arithmetic\n", + __FUNCTION__); + + assert(type.floating && type.width == 32); + + i = LLVMBuildBitCast(bld->builder, x, int_type, ""); + + /* exp = (float) exponent(x) */ + exp = LLVMBuildAnd(bld->builder, i, expmask, ""); + } + + if(p_floor_log2 || p_log2) { + LLVMValueRef c23 = LLVMConstInt(int_type, 23, 0); + LLVMValueRef c127 = LLVMConstInt(int_type, 127, 0); + logexp = LLVMBuildLShr(bld->builder, exp, c23, ""); + logexp = LLVMBuildSub(bld->builder, logexp, c127, ""); + logexp = LLVMBuildSIToFP(bld->builder, logexp, float_type, ""); + } + + if(p_log2) { + /* mant = (float) mantissa(x) */ + mant = LLVMBuildAnd(bld->builder, i, mantmask, ""); + mant = LLVMBuildOr(bld->builder, mant, one, ""); + mant = LLVMBuildBitCast(bld->builder, mant, float_type, ""); + + logmant = lp_build_polynomial(bld, mant, lp_build_log2_polynomial, + Elements(lp_build_log2_polynomial)); + + /* This effectively increases the polynomial degree by one, but ensures that log2(1) == 0*/ + logmant = LLVMBuildMul(bld->builder, logmant, LLVMBuildSub(bld->builder, mant, bld->one, ""), ""); + + res = LLVMBuildAdd(bld->builder, logmant, logexp, ""); + } + + if(p_exp) + *p_exp = exp; + + if(p_floor_log2) + *p_floor_log2 = logexp; + + if(p_log2) + *p_log2 = res; +} + + LLVMValueRef lp_build_log2(struct lp_build_context *bld, LLVMValueRef x) { LLVMValueRef res; - lp_build_log2_approx(bld, x, NULL, NULL, &res); + if (bld->type.length == 1) { + lp_build_float_log2_approx(bld, x, NULL, NULL, &res); + } + else { + lp_build_log2_approx(bld, x, NULL, NULL, &res); + } return res; } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_const.c b/src/gallium/auxiliary/gallivm/lp_bld_const.c index c8eaa8c394..53447757e8 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_const.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_const.c @@ -264,10 +264,16 @@ lp_build_one(struct lp_type type) for(i = 1; i < type.length; ++i) elems[i] = elems[0]; - return LLVMConstVector(elems, type.length); + if (type.length == 1) + return elems[0]; + else + return LLVMConstVector(elems, type.length); } +/** + * Build constant-valued vector from a scalar value. + */ LLVMValueRef lp_build_const_scalar(struct lp_type type, double val) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c b/src/gallium/auxiliary/gallivm/lp_bld_logic.c index 2726747eae..7c585fda78 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c @@ -198,7 +198,7 @@ lp_build_compare(LLVMBuilderRef builder, return res; } - } + } /* if (type.width * type.length == 128) */ #endif if(type.floating) { @@ -238,20 +238,25 @@ lp_build_compare(LLVMBuilderRef builder, cond = LLVMBuildFCmp(builder, op, a, b, ""); res = LLVMBuildSelect(builder, cond, ones, zeros, ""); #else - debug_printf("%s: warning: using slow element-wise vector comparison\n", - __FUNCTION__); res = LLVMGetUndef(int_vec_type); - for(i = 0; i < type.length; ++i) { - LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), i, 0); - cond = LLVMBuildFCmp(builder, op, - LLVMBuildExtractElement(builder, a, index, ""), - LLVMBuildExtractElement(builder, b, index, ""), - ""); - cond = LLVMBuildSelect(builder, cond, - LLVMConstExtractElement(ones, index), - LLVMConstExtractElement(zeros, index), - ""); - res = LLVMBuildInsertElement(builder, res, cond, index, ""); + if (type.length == 1) { + res = LLVMBuildFCmp(builder, op, a, b, ""); + } + else { + debug_printf("%s: warning: using slow element-wise float" + " vector comparison\n", __FUNCTION__); + for (i = 0; i < type.length; ++i) { + LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), i, 0); + cond = LLVMBuildFCmp(builder, op, + LLVMBuildExtractElement(builder, a, index, ""), + LLVMBuildExtractElement(builder, b, index, ""), + ""); + cond = LLVMBuildSelect(builder, cond, + LLVMConstExtractElement(ones, index), + LLVMConstExtractElement(zeros, index), + ""); + res = LLVMBuildInsertElement(builder, res, cond, index, ""); + } } #endif } @@ -286,20 +291,26 @@ lp_build_compare(LLVMBuilderRef builder, cond = LLVMBuildICmp(builder, op, a, b, ""); res = LLVMBuildSelect(builder, cond, ones, zeros, ""); #else - debug_printf("%s: warning: using slow element-wise int vector comparison\n", - __FUNCTION__); res = LLVMGetUndef(int_vec_type); - for(i = 0; i < type.length; ++i) { - LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), i, 0); - cond = LLVMBuildICmp(builder, op, - LLVMBuildExtractElement(builder, a, index, ""), - LLVMBuildExtractElement(builder, b, index, ""), - ""); - cond = LLVMBuildSelect(builder, cond, - LLVMConstExtractElement(ones, index), - LLVMConstExtractElement(zeros, index), - ""); - res = LLVMBuildInsertElement(builder, res, cond, index, ""); + if (type.length == 1) { + res = LLVMBuildICmp(builder, op, a, b, ""); + } + else { + debug_printf("%s: warning: using slow element-wise int" + " vector comparison\n", __FUNCTION__); + + for(i = 0; i < type.length; ++i) { + LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), i, 0); + cond = LLVMBuildICmp(builder, op, + LLVMBuildExtractElement(builder, a, index, ""), + LLVMBuildExtractElement(builder, b, index, ""), + ""); + cond = LLVMBuildSelect(builder, cond, + LLVMConstExtractElement(ones, index), + LLVMConstExtractElement(zeros, index), + ""); + res = LLVMBuildInsertElement(builder, res, cond, index, ""); + } } #endif } @@ -339,26 +350,31 @@ lp_build_select(struct lp_build_context *bld, if(a == b) return a; - if(type.floating) { - LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); - a = LLVMBuildBitCast(bld->builder, a, int_vec_type, ""); - b = LLVMBuildBitCast(bld->builder, b, int_vec_type, ""); + if (type.length == 1) { + res = LLVMBuildSelect(bld->builder, mask, a, b, ""); } + else { + if(type.floating) { + LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); + a = LLVMBuildBitCast(bld->builder, a, int_vec_type, ""); + b = LLVMBuildBitCast(bld->builder, b, int_vec_type, ""); + } - a = LLVMBuildAnd(bld->builder, a, mask, ""); + a = LLVMBuildAnd(bld->builder, a, mask, ""); - /* This often gets translated to PANDN, but sometimes the NOT is - * pre-computed and stored in another constant. The best strategy depends - * on available registers, so it is not a big deal -- hopefully LLVM does - * the right decision attending the rest of the program. - */ - b = LLVMBuildAnd(bld->builder, b, LLVMBuildNot(bld->builder, mask, ""), ""); + /* This often gets translated to PANDN, but sometimes the NOT is + * pre-computed and stored in another constant. The best strategy depends + * on available registers, so it is not a big deal -- hopefully LLVM does + * the right decision attending the rest of the program. + */ + b = LLVMBuildAnd(bld->builder, b, LLVMBuildNot(bld->builder, mask, ""), ""); - res = LLVMBuildOr(bld->builder, a, b, ""); + res = LLVMBuildOr(bld->builder, a, b, ""); - if(type.floating) { - LLVMTypeRef vec_type = lp_build_vec_type(type); - res = LLVMBuildBitCast(bld->builder, res, vec_type, ""); + if(type.floating) { + LLVMTypeRef vec_type = lp_build_vec_type(type); + res = LLVMBuildBitCast(bld->builder, res, vec_type, ""); + } } return res; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 1dca29cdd5..a965d394f4 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -65,6 +65,14 @@ struct lp_build_sample_context const struct util_format_description *format_desc; + /** regular scalar float type */ + struct lp_type float_type; + struct lp_build_context float_bld; + + /** regular scalar float type */ + struct lp_type int_type; + struct lp_build_context int_bld; + /** Incoming coordinates type and build context */ struct lp_type coord_type; struct lp_build_context coord_bld; @@ -108,6 +116,27 @@ wrap_mode_uses_border_color(unsigned mode) } +static LLVMValueRef +lp_build_get_mipmap_level(struct lp_build_sample_context *bld, + LLVMValueRef data_array, LLVMValueRef level) +{ + LLVMValueRef indexes[2], data_ptr; + indexes[0] = LLVMConstInt(LLVMInt32Type(), 0, 0); + indexes[1] = level; + data_ptr = LLVMBuildGEP(bld->builder, data_array, indexes, 2, ""); + data_ptr = LLVMBuildLoad(bld->builder, data_ptr, ""); + return data_ptr; +} + + +static LLVMValueRef +lp_build_get_const_mipmap_level(struct lp_build_sample_context *bld, + LLVMValueRef data_array, int level) +{ + LLVMValueRef lvl = LLVMConstInt(LLVMInt32Type(), level, 0); + return lp_build_get_mipmap_level(bld, data_array, lvl); +} + /** * Gen code to fetch a texel from a texture at int coords (x, y). @@ -124,14 +153,13 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, LLVMValueRef x, LLVMValueRef y, LLVMValueRef y_stride, - LLVMValueRef data_array, + LLVMValueRef data_ptr, LLVMValueRef *texel) { struct lp_build_context *int_coord_bld = &bld->int_coord_bld; LLVMValueRef offset; LLVMValueRef packed; LLVMValueRef use_border = NULL; - LLVMValueRef data_ptr; /* use_border = x < 0 || x >= width || y < 0 || y >= height */ if (wrap_mode_uses_border_color(bld->static_state->wrap_s)) { @@ -154,16 +182,6 @@ lp_build_sample_texel_soa(struct lp_build_sample_context *bld, } } - /* XXX always use mipmap level 0 for now */ - { - const int level = 0; - LLVMValueRef indexes[2]; - indexes[0] = LLVMConstInt(LLVMInt32Type(), 0, 0); - indexes[1] = LLVMConstInt(LLVMInt32Type(), level, 0); - data_ptr = LLVMBuildGEP(bld->builder, data_array, indexes, 2, ""); - data_ptr = LLVMBuildLoad(bld->builder, data_ptr, ""); - } - /* * Note: if we find an app which frequently samples the texture border * we might want to implement a true conditional here to avoid sampling @@ -233,17 +251,8 @@ lp_build_sample_packed(struct lp_build_sample_context *bld, assert(bld->format_desc->block.height == 1); assert(bld->format_desc->block.bits <= bld->texel_type.width); - /* XXX always use mipmap level 0 for now */ - { - const int level = 0; - LLVMValueRef indexes[2]; - /* get data_ptr[level] */ - indexes[0] = LLVMConstInt(LLVMInt32Type(), 0, 0); - indexes[1] = LLVMConstInt(LLVMInt32Type(), level, 0); - data_ptr = LLVMBuildGEP(bld->builder, data_array, indexes, 2, ""); - /* load texture base address */ - data_ptr = LLVMBuildLoad(bld->builder, data_ptr, ""); - } + /* get pointer to mipmap level 0 data */ + data_ptr = lp_build_get_const_mipmap_level(bld, data_array, 0); return lp_build_gather(bld->builder, bld->texel_type.length, @@ -733,7 +742,210 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld, /** - * Sample 2D texture with nearest filtering. + * Codegen equivalent for u_minify(). + * Return max(1, base_size >> level); + */ +static LLVMValueRef +lp_build_minify(struct lp_build_sample_context *bld, + LLVMValueRef base_size, + LLVMValueRef level) +{ + LLVMValueRef size = LLVMBuildAShr(bld->builder, base_size, level, "minify"); + size = lp_build_max(&bld->int_coord_bld, size, bld->int_coord_bld.one); + return size; +} + + +static int +texture_dims(enum pipe_texture_target tex) +{ + switch (tex) { + case PIPE_TEXTURE_1D: + return 1; + case PIPE_TEXTURE_2D: + case PIPE_TEXTURE_CUBE: + return 2; + case PIPE_TEXTURE_3D: + return 3; + default: + assert(0 && "bad texture target in texture_dims()"); + return 2; + } +} + + +/** + * Generate code to compute texture level of detail (lambda). + * \param s vector of texcoord s values + * \param t vector of texcoord t values + * \param r vector of texcoord r values + * \param width scalar int texture width + * \param height scalar int texture height + * \param depth scalar int texture depth + */ +static LLVMValueRef +lp_build_lod_selector(struct lp_build_sample_context *bld, + LLVMValueRef s, + LLVMValueRef t, + LLVMValueRef r, + LLVMValueRef width, + LLVMValueRef height, + LLVMValueRef depth) + +{ + const int dims = texture_dims(bld->static_state->target); + struct lp_build_context *coord_bld = &bld->coord_bld; + struct lp_build_context *float_bld = &bld->float_bld; + LLVMValueRef lod_bias = LLVMConstReal(LLVMFloatType(), bld->static_state->lod_bias); + LLVMValueRef min_lod = LLVMConstReal(LLVMFloatType(), bld->static_state->min_lod); + LLVMValueRef max_lod = LLVMConstReal(LLVMFloatType(), bld->static_state->max_lod); + + LLVMValueRef index0 = LLVMConstInt(LLVMInt32Type(), 0, 0); + LLVMValueRef index1 = LLVMConstInt(LLVMInt32Type(), 1, 0); + LLVMValueRef index2 = LLVMConstInt(LLVMInt32Type(), 2, 0); + + LLVMValueRef s0, s1, s2; + LLVMValueRef t0, t1, t2; + LLVMValueRef r0, r1, r2; + LLVMValueRef dsdx, dsdy, dtdx, dtdy, drdx, drdy; + LLVMValueRef rho, lod; + + /* + * dsdx = abs(s[1] - s[0]); + * dsdy = abs(s[2] - s[0]); + * dtdx = abs(t[1] - t[0]); + * dtdy = abs(t[2] - t[0]); + * drdx = abs(r[1] - r[0]); + * drdy = abs(r[2] - r[0]); + * XXX we're assuming a four-element quad in 2x2 layout here. + */ + s0 = LLVMBuildExtractElement(bld->builder, s, index0, "s0"); + s1 = LLVMBuildExtractElement(bld->builder, s, index1, "s1"); + s2 = LLVMBuildExtractElement(bld->builder, s, index2, "s2"); + dsdx = LLVMBuildSub(bld->builder, s1, s0, ""); + dsdx = lp_build_abs(float_bld, dsdx); + dsdy = LLVMBuildSub(bld->builder, s2, s0, ""); + dsdy = lp_build_abs(float_bld, dsdy); + if (dims > 1) { + t0 = LLVMBuildExtractElement(bld->builder, t, index0, "t0"); + t1 = LLVMBuildExtractElement(bld->builder, t, index1, "t1"); + t2 = LLVMBuildExtractElement(bld->builder, t, index2, "t2"); + dtdx = LLVMBuildSub(bld->builder, t1, t0, ""); + dtdx = lp_build_abs(float_bld, dtdx); + dtdy = LLVMBuildSub(bld->builder, t2, t0, ""); + dtdy = lp_build_abs(float_bld, dtdy); + if (dims > 2) { + r0 = LLVMBuildExtractElement(bld->builder, r, index0, "r0"); + r1 = LLVMBuildExtractElement(bld->builder, r, index1, "r1"); + r2 = LLVMBuildExtractElement(bld->builder, r, index2, "r2"); + drdx = LLVMBuildSub(bld->builder, r1, r0, ""); + drdx = lp_build_abs(float_bld, drdx); + drdy = LLVMBuildSub(bld->builder, r2, r0, ""); + drdy = lp_build_abs(float_bld, drdy); + } + } + + /* Compute rho = max of all partial derivatives scaled by texture size. + * XXX this could be vectorized somewhat + */ + rho = LLVMBuildMul(bld->builder, + lp_build_max(float_bld, dsdx, dsdy), + lp_build_int_to_float(float_bld, width), ""); + if (dims > 1) { + LLVMValueRef max; + max = LLVMBuildMul(bld->builder, + lp_build_max(float_bld, dtdx, dtdy), + lp_build_int_to_float(float_bld, height), ""); + rho = lp_build_max(float_bld, rho, max); + if (dims > 2) { + max = LLVMBuildMul(bld->builder, + lp_build_max(float_bld, drdx, drdy), + lp_build_int_to_float(float_bld, depth), ""); + rho = lp_build_max(float_bld, rho, max); + } + } + + /* compute lod = log2(rho) */ + lod = lp_build_log2(float_bld, rho); + + /* add lod bias */ + lod = LLVMBuildAdd(bld->builder, lod, lod_bias, "LOD bias"); + + /* clamp lod */ + lod = lp_build_clamp(float_bld, lod, min_lod, max_lod); + + return lod; +} + + +/** + * For PIPE_TEX_MIPFILTER_NEAREST, convert float LOD to integer + * mipmap level index. + * Note: this is all scalar code. + * \param lod scalar float texture level of detail + * \param level_out returns integer + */ +static void +lp_build_nearest_mip_level(struct lp_build_sample_context *bld, + unsigned unit, + LLVMValueRef lod, + LLVMValueRef *level_out) +{ + struct lp_build_context *float_bld = &bld->float_bld; + struct lp_build_context *int_bld = &bld->int_bld; + LLVMValueRef last_level, level; + + LLVMValueRef zero = LLVMConstInt(LLVMInt32Type(), 0, 0); + + last_level = bld->dynamic_state->last_level(bld->dynamic_state, + bld->builder, unit); + + /* convert float lod to integer */ + level = lp_build_iround(float_bld, lod); + + /* clamp level to legal range of levels */ + *level_out = lp_build_clamp(int_bld, level, zero, last_level); +} + + +/** + * For PIPE_TEX_MIPFILTER_LINEAR, convert float LOD to integer to + * two (adjacent) mipmap level indexes. Later, we'll sample from those + * two mipmap levels and interpolate between them. + */ +static void +lp_build_linear_mip_levels(struct lp_build_sample_context *bld, + unsigned unit, + LLVMValueRef lod, + LLVMValueRef *level0_out, + LLVMValueRef *level1_out, + LLVMValueRef *weight_out) +{ + struct lp_build_context *coord_bld = &bld->coord_bld; + struct lp_build_context *int_coord_bld = &bld->int_coord_bld; + LLVMValueRef last_level, level; + + last_level = bld->dynamic_state->last_level(bld->dynamic_state, + bld->builder, unit); + + /* convert float lod to integer */ + level = lp_build_ifloor(coord_bld, lod); + + /* compute level 0 and clamp to legal range of levels */ + *level0_out = lp_build_clamp(int_coord_bld, level, + int_coord_bld->zero, + last_level); + /* compute level 1 and clamp to legal range of levels */ + *level1_out = lp_build_add(int_coord_bld, *level0_out, int_coord_bld->one); + *level1_out = lp_build_min(int_coord_bld, *level1_out, int_coord_bld->zero); + + *weight_out = lp_build_fract(coord_bld, lod); +} + + + +/** + * Sample 2D texture with nearest filtering, no mipmapping. */ static void lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, @@ -746,6 +958,7 @@ lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, LLVMValueRef *texel) { LLVMValueRef x, y; + LLVMValueRef data_ptr; x = lp_build_sample_wrap_nearest(bld, s, width, bld->static_state->pot_width, @@ -757,7 +970,63 @@ lp_build_sample_2d_nearest_soa(struct lp_build_sample_context *bld, lp_build_name(x, "tex.x.wrapped"); lp_build_name(y, "tex.y.wrapped"); - lp_build_sample_texel_soa(bld, width, height, x, y, stride, data_array, texel); + /* get pointer to mipmap level 0 data */ + data_ptr = lp_build_get_const_mipmap_level(bld, data_array, 0); + + lp_build_sample_texel_soa(bld, width, height, x, y, stride, data_ptr, texel); +} + + +/** + * Sample 2D texture with nearest filtering, nearest mipmap. + */ +static void +lp_build_sample_2d_nearest_mip_nearest_soa(struct lp_build_sample_context *bld, + unsigned unit, + LLVMValueRef s, + LLVMValueRef t, + LLVMValueRef width, + LLVMValueRef height, + LLVMValueRef width_vec, + LLVMValueRef height_vec, + LLVMValueRef stride, + LLVMValueRef data_array, + LLVMValueRef *texel) +{ + LLVMValueRef x, y; + LLVMValueRef lod, ilevel, ilevel_vec; + LLVMValueRef data_ptr; + + /* compute float LOD */ + lod = lp_build_lod_selector(bld, s, t, NULL, width, height, NULL); + + /* convert LOD to int */ + lp_build_nearest_mip_level(bld, unit, lod, &ilevel); + + ilevel_vec = lp_build_broadcast_scalar(&bld->int_coord_bld, ilevel); + + /* compute width_vec, height at mipmap level 'ilevel' */ + width_vec = lp_build_minify(bld, width_vec, ilevel_vec); + height_vec = lp_build_minify(bld, height_vec, ilevel_vec); + stride = lp_build_minify(bld, stride, ilevel_vec); + + x = lp_build_sample_wrap_nearest(bld, s, width_vec, + bld->static_state->pot_width, + bld->static_state->wrap_s); + y = lp_build_sample_wrap_nearest(bld, t, height_vec, + bld->static_state->pot_height, + bld->static_state->wrap_t); + + lp_build_name(x, "tex.x.wrapped"); + lp_build_name(y, "tex.y.wrapped"); + + /* get pointer to mipmap level [ilevel] data */ + if (0) + data_ptr = lp_build_get_mipmap_level(bld, data_array, ilevel); + else + data_ptr = lp_build_get_const_mipmap_level(bld, data_array, 0); + + lp_build_sample_texel_soa(bld, width_vec, height_vec, x, y, stride, data_ptr, texel); } @@ -779,6 +1048,7 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, LLVMValueRef x0, x1; LLVMValueRef y0, y1; LLVMValueRef neighbors[2][2][4]; + LLVMValueRef data_ptr; unsigned chan; lp_build_sample_wrap_linear(bld, s, width, bld->static_state->pot_width, @@ -786,10 +1056,13 @@ lp_build_sample_2d_linear_soa(struct lp_build_sample_context *bld, lp_build_sample_wrap_linear(bld, t, height, bld->static_state->pot_height, bld->static_state->wrap_t, &y0, &y1, &t_fpart); - lp_build_sample_texel_soa(bld, width, height, x0, y0, stride, data_array, neighbors[0][0]); - lp_build_sample_texel_soa(bld, width, height, x1, y0, stride, data_array, neighbors[0][1]); - lp_build_sample_texel_soa(bld, width, height, x0, y1, stride, data_array, neighbors[1][0]); - lp_build_sample_texel_soa(bld, width, height, x1, y1, stride, data_array, neighbors[1][1]); + /* get pointer to mipmap level 0 data */ + data_ptr = lp_build_get_const_mipmap_level(bld, data_array, 0); + + lp_build_sample_texel_soa(bld, width, height, x0, y0, stride, data_ptr, neighbors[0][0]); + lp_build_sample_texel_soa(bld, width, height, x1, y0, stride, data_ptr, neighbors[0][1]); + lp_build_sample_texel_soa(bld, width, height, x0, y1, stride, data_ptr, neighbors[1][0]); + lp_build_sample_texel_soa(bld, width, height, x1, y1, stride, data_ptr, neighbors[1][1]); /* TODO: Don't interpolate missing channels */ for(chan = 0; chan < 4; ++chan) { @@ -857,7 +1130,7 @@ lp_build_sample_2d_linear_aos(struct lp_build_sample_context *bld, LLVMValueRef packed, packed_lo, packed_hi; LLVMValueRef unswizzled[4]; - lp_build_context_init(&i32, builder, lp_type_int(32)); + lp_build_context_init(&i32, builder, lp_type_int_vec(32)); lp_build_context_init(&h16, builder, lp_type_ufixed(16)); lp_build_context_init(&u8n, builder, lp_type_unorm(8)); @@ -1066,194 +1339,11 @@ lp_build_sample_compare(struct lp_build_sample_context *bld, } -static int -texture_dims(enum pipe_texture_target tex) -{ - switch (tex) { - case PIPE_TEXTURE_1D: - return 1; - case PIPE_TEXTURE_2D: - case PIPE_TEXTURE_CUBE: - return 2; - case PIPE_TEXTURE_3D: - return 3; - default: - assert(0 && "bad texture target in texture_dims()"); - return 2; - } -} - - -/** - * Generate code to compute texture level of detail (lambda). - * \param s vector of texcoord s values - * \param t vector of texcoord t values - * \param r vector of texcoord r values - * \param width scalar int texture width - * \param height scalar int texture height - * \param depth scalar int texture depth - */ -static LLVMValueRef -lp_build_lod_selector(struct lp_build_sample_context *bld, - LLVMValueRef s, - LLVMValueRef t, - LLVMValueRef r, - LLVMValueRef width, - LLVMValueRef height, - LLVMValueRef depth) - -{ - const int dims = texture_dims(bld->static_state->target); - struct lp_build_context *coord_bld = &bld->coord_bld; - - LLVMValueRef lod_bias = lp_build_const_scalar(bld->coord_bld.type, - bld->static_state->lod_bias); - LLVMValueRef min_lod = lp_build_const_scalar(bld->coord_bld.type, - bld->static_state->min_lod); - LLVMValueRef max_lod = lp_build_const_scalar(bld->coord_bld.type, - bld->static_state->max_lod); - - LLVMValueRef index0 = LLVMConstInt(LLVMInt32Type(), 0, 0); - LLVMValueRef index1 = LLVMConstInt(LLVMInt32Type(), 1, 0); - LLVMValueRef index2 = LLVMConstInt(LLVMInt32Type(), 2, 0); - - LLVMValueRef s0, s1, s2; - LLVMValueRef t0, t1, t2; - LLVMValueRef r0, r1, r2; - LLVMValueRef dsdx, dsdy, dtdx, dtdy, drdx, drdy; - LLVMValueRef rho, lod; - - /* - * dsdx = abs(s[1] - s[0]); - * dsdy = abs(s[2] - s[0]); - * dtdx = abs(t[1] - t[0]); - * dtdy = abs(t[2] - t[0]); - * drdx = abs(r[1] - r[0]); - * drdy = abs(r[2] - r[0]); - * XXX we're assuming a four-element quad in 2x2 layout here. - */ - s0 = LLVMBuildExtractElement(bld->builder, s, index0, "s0"); - s1 = LLVMBuildExtractElement(bld->builder, s, index1, "s1"); - s2 = LLVMBuildExtractElement(bld->builder, s, index2, "s2"); - dsdx = lp_build_abs(coord_bld, lp_build_sub(coord_bld, s1, s0)); - dsdy = lp_build_abs(coord_bld, lp_build_sub(coord_bld, s2, s0)); - if (dims > 1) { - t0 = LLVMBuildExtractElement(bld->builder, t, index0, "t0"); - t1 = LLVMBuildExtractElement(bld->builder, t, index1, "t1"); - t2 = LLVMBuildExtractElement(bld->builder, t, index2, "t2"); - dtdx = lp_build_abs(coord_bld, lp_build_sub(coord_bld, t1, t0)); - dtdy = lp_build_abs(coord_bld, lp_build_sub(coord_bld, t2, t0)); - if (dims > 2) { - r0 = LLVMBuildExtractElement(bld->builder, r, index0, "r0"); - r1 = LLVMBuildExtractElement(bld->builder, r, index1, "r1"); - r2 = LLVMBuildExtractElement(bld->builder, r, index2, "r2"); - drdx = lp_build_abs(coord_bld, lp_build_sub(coord_bld, r1, r0)); - drdy = lp_build_abs(coord_bld, lp_build_sub(coord_bld, r2, r0)); - } - } - - /* Compute rho = max of all partial derivatives scaled by texture size. - * XXX this can be vectorized somewhat - */ - rho = lp_build_mul(coord_bld, - lp_build_max(coord_bld, dsdx, dsdy), - lp_build_int_to_float(coord_bld, width)); - if (dims > 1) { - LLVMValueRef max; - max = lp_build_mul(coord_bld, - lp_build_max(coord_bld, dtdx, dtdy), - lp_build_int_to_float(coord_bld, height)); - rho = lp_build_max(coord_bld, rho, max); - if (dims > 2) { - max = lp_build_mul(coord_bld, - lp_build_max(coord_bld, drdx, drdy), - lp_build_int_to_float(coord_bld, depth)); - rho = lp_build_max(coord_bld, rho, max); - } - } - - /* compute lod = log2(rho) */ - lod = lp_build_log2(coord_bld, rho); - - /* add lod bias */ - lod = lp_build_add(coord_bld, lod, lod_bias); - - /* clamp lod */ - lod = lp_build_clamp(coord_bld, lod, min_lod, max_lod); - - return lod; -} - - -/** - * For PIPE_TEX_MIPFILTER_NEAREST, convert float LOD to integer - * mipmap level index. - * \param lod scalar float texture level of detail - * \param level_out returns integer - */ -static void -lp_build_nearest_mip_level(struct lp_build_sample_context *bld, - unsigned unit, - LLVMValueRef lod, - LLVMValueRef *level_out) -{ - struct lp_build_context *coord_bld = &bld->coord_bld; - struct lp_build_context *int_coord_bld = &bld->int_coord_bld; - LLVMValueRef last_level, level; - - last_level = bld->dynamic_state->last_level(bld->dynamic_state, - bld->builder, unit); - - /* convert float lod to integer */ - level = lp_build_iround(coord_bld, lod); - - /* clamp level to legal range of levels */ - *level_out = lp_build_clamp(int_coord_bld, level, - int_coord_bld->zero, - last_level); -} - - -/** - * For PIPE_TEX_MIPFILTER_LINEAR, convert float LOD to integer to - * two (adjacent) mipmap level indexes. Later, we'll sample from those - * two mipmap levels and interpolate between them. - */ -static void -lp_build_linear_mip_levels(struct lp_build_sample_context *bld, - unsigned unit, - LLVMValueRef lod, - LLVMValueRef *level0_out, - LLVMValueRef *level1_out, - LLVMValueRef *weight_out) -{ - struct lp_build_context *coord_bld = &bld->coord_bld; - struct lp_build_context *int_coord_bld = &bld->int_coord_bld; - LLVMValueRef last_level, level; - - last_level = bld->dynamic_state->last_level(bld->dynamic_state, - bld->builder, unit); - - /* convert float lod to integer */ - level = lp_build_ifloor(coord_bld, lod); - - /* compute level 0 and clamp to legal range of levels */ - *level0_out = lp_build_clamp(int_coord_bld, level, - int_coord_bld->zero, - last_level); - /* compute level 1 and clamp to legal range of levels */ - *level1_out = lp_build_add(int_coord_bld, *level0_out, int_coord_bld->one); - *level1_out = lp_build_min(int_coord_bld, *level1_out, int_coord_bld->zero); - - *weight_out = lp_build_fract(coord_bld, lod); -} - - - /** * Build texture sampling code. * 'texel' will return a vector of four LLVMValueRefs corresponding to * R, G, B, A. + * \param type vector float type to use for coords, etc. */ void lp_build_sample_soa(LLVMBuilderRef builder, @@ -1267,17 +1357,19 @@ lp_build_sample_soa(LLVMBuilderRef builder, LLVMValueRef *texel) { struct lp_build_sample_context bld; - LLVMValueRef width; - LLVMValueRef height; - LLVMValueRef stride; + LLVMValueRef width, width_vec; + LLVMValueRef height, height_vec; + LLVMValueRef stride, stride_vec; LLVMValueRef data_array; LLVMValueRef s; LLVMValueRef t; LLVMValueRef r; + boolean done = FALSE; (void) lp_build_lod_selector; /* temporary to silence warning */ (void) lp_build_nearest_mip_level; (void) lp_build_linear_mip_levels; + (void) lp_build_minify; /* Setup our build context */ memset(&bld, 0, sizeof bld); @@ -1285,10 +1377,16 @@ lp_build_sample_soa(LLVMBuilderRef builder, bld.static_state = static_state; bld.dynamic_state = dynamic_state; bld.format_desc = util_format_description(static_state->format); + + bld.float_type = lp_type_float(32); + bld.int_type = lp_type_int(32); bld.coord_type = type; bld.uint_coord_type = lp_uint_type(type); bld.int_coord_type = lp_int_type(type); bld.texel_type = type; + + lp_build_context_init(&bld.float_bld, builder, bld.float_type); + lp_build_context_init(&bld.int_bld, builder, bld.int_type); lp_build_context_init(&bld.coord_bld, builder, bld.coord_type); lp_build_context_init(&bld.uint_coord_bld, builder, bld.uint_coord_type); lp_build_context_init(&bld.int_coord_bld, builder, bld.int_coord_type); @@ -1305,30 +1403,56 @@ lp_build_sample_soa(LLVMBuilderRef builder, t = coords[1]; r = coords[2]; - width = lp_build_broadcast_scalar(&bld.uint_coord_bld, width); - height = lp_build_broadcast_scalar(&bld.uint_coord_bld, height); - stride = lp_build_broadcast_scalar(&bld.uint_coord_bld, stride); + width_vec = lp_build_broadcast_scalar(&bld.uint_coord_bld, width); + height_vec = lp_build_broadcast_scalar(&bld.uint_coord_bld, height); + stride_vec = lp_build_broadcast_scalar(&bld.uint_coord_bld, stride); if(static_state->target == PIPE_TEXTURE_1D) t = bld.coord_bld.zero; - switch (static_state->min_img_filter) { - case PIPE_TEX_FILTER_NEAREST: - lp_build_sample_2d_nearest_soa(&bld, s, t, width, height, - stride, data_array, texel); + switch (static_state->min_mip_filter) { + case PIPE_TEX_MIPFILTER_NONE: break; - case PIPE_TEX_FILTER_LINEAR: - if(lp_format_is_rgba8(bld.format_desc) && - is_simple_wrap_mode(static_state->wrap_s) && - is_simple_wrap_mode(static_state->wrap_t)) - lp_build_sample_2d_linear_aos(&bld, s, t, width, height, - stride, data_array, texel); - else - lp_build_sample_2d_linear_soa(&bld, s, t, width, height, - stride, data_array, texel); + case PIPE_TEX_MIPFILTER_NEAREST: + + switch (static_state->min_img_filter) { + case PIPE_TEX_FILTER_NEAREST: + lp_build_sample_2d_nearest_mip_nearest_soa(&bld, unit, + s, t, + width, height, + width_vec, height_vec, + stride_vec, + data_array, texel); + done = TRUE; + break; + } + + break; + case PIPE_TEX_MIPFILTER_LINEAR: break; default: - assert(0); + assert(0 && "invalid mip filter"); + } + + if (!done) { + switch (static_state->min_img_filter) { + case PIPE_TEX_FILTER_NEAREST: + lp_build_sample_2d_nearest_soa(&bld, s, t, width_vec, height_vec, + stride_vec, data_array, texel); + break; + case PIPE_TEX_FILTER_LINEAR: + if(lp_format_is_rgba8(bld.format_desc) && + is_simple_wrap_mode(static_state->wrap_s) && + is_simple_wrap_mode(static_state->wrap_t)) + lp_build_sample_2d_linear_aos(&bld, s, t, width_vec, height_vec, + stride_vec, data_array, texel); + else + lp_build_sample_2d_linear_soa(&bld, s, t, width_vec, height_vec, + stride_vec, data_array, texel); + break; + default: + assert(0); + } } /* FIXME: respect static_state->min_mip_filter */; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_type.h b/src/gallium/auxiliary/gallivm/lp_bld_type.h index 16946cc28a..4daa904e63 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_type.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_type.h @@ -103,7 +103,7 @@ struct lp_type { unsigned width:14; /** - * Vector length. + * Vector length. If length==1, this is a scalar (float/int) type. * * width*length should be a power of two greater or equal to eight. * @@ -139,11 +139,28 @@ struct lp_build_context }; +/** Create scalar float type */ static INLINE struct lp_type lp_type_float(unsigned width) { struct lp_type res_type; + memset(&res_type, 0, sizeof res_type); + res_type.floating = TRUE; + res_type.sign = TRUE; + res_type.width = width; + res_type.length = 1; + + return res_type; +} + + +/** Create vector of float type */ +static INLINE struct lp_type +lp_type_float_vec(unsigned width) +{ + struct lp_type res_type; + memset(&res_type, 0, sizeof res_type); res_type.floating = TRUE; res_type.sign = TRUE; @@ -154,11 +171,27 @@ lp_type_float(unsigned width) } +/** Create scalar int type */ static INLINE struct lp_type lp_type_int(unsigned width) { struct lp_type res_type; + memset(&res_type, 0, sizeof res_type); + res_type.sign = TRUE; + res_type.width = width; + res_type.length = 1; + + return res_type; +} + + +/** Create vector int type */ +static INLINE struct lp_type +lp_type_int_vec(unsigned width) +{ + struct lp_type res_type; + memset(&res_type, 0, sizeof res_type); res_type.sign = TRUE; res_type.width = width; @@ -168,11 +201,26 @@ lp_type_int(unsigned width) } +/** Create scalar uint type */ static INLINE struct lp_type lp_type_uint(unsigned width) { struct lp_type res_type; + memset(&res_type, 0, sizeof res_type); + res_type.width = width; + res_type.length = 1; + + return res_type; +} + + +/** Create vector uint type */ +static INLINE struct lp_type +lp_type_uint_vec(unsigned width) +{ + struct lp_type res_type; + memset(&res_type, 0, sizeof res_type); res_type.width = width; res_type.length = LP_NATIVE_VECTOR_WIDTH / width; -- cgit v1.2.3 From c27ffc5215573d6ff106d4770168117adea884f9 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 9 Mar 2010 17:08:36 +0000 Subject: scons: Fix the libg-xlib Sconscript. --- src/gallium/targets/libgl-xlib/SConscript | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/targets/libgl-xlib/SConscript b/src/gallium/targets/libgl-xlib/SConscript index 92e508ee50..efa7e797d1 100644 --- a/src/gallium/targets/libgl-xlib/SConscript +++ b/src/gallium/targets/libgl-xlib/SConscript @@ -28,35 +28,40 @@ env.Append(CPPPATH = [ env.Append(CPPDEFINES = ['USE_XSHM']) +env.Prepend(LIBS = [ + st_xlib, + ws_xlib, + trace, + identity, + glapi, + mesa, + glsl, + gallium, +]) + sources = [ 'xlib.c', ] -drivers = [trace] - if 'softpipe' in env['drivers']: env.Append(CPPDEFINES = 'GALLIUM_SOFTPIPE') - sources += ['xlib_softpipe.c', 'xlib_sw_winsys.c'] - drivers += [softpipe] + env.Prepend(LIBS = [softpipe]) if 'llvmpipe' in env['drivers']: env.Tool('llvm') if 'LLVM_VERSION' in env: env.Append(CPPDEFINES = 'GALLIUM_LLVMPIPE') env.Tool('udis86') - sources += ['xlib_llvmpipe.c', 'xlib_sw_winsys.c'] - drivers += [llvmpipe] + env.Prepend(LIBS = [llvmpipe]) if 'cell' in env['drivers']: env.Append(CPPDEFINES = 'GALLIUM_CELL') - sources += ['xlib_cell.c'] - drivers += [cell] + env.Prepend(LIBS = [cell]) # TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions libgl = env.SharedLibrary( target ='GL', source = sources, - LIBS = st_xlib + glapi + mesa + glsl + drivers + gallium + env['LIBS'], ) if not env['dri']: -- cgit v1.2.3 From d0aea650320fec0b8e01110eeee22b1f3700d587 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 17:27:58 +0000 Subject: gallium: create helper for swrast+xlib combination Several targets may want to reuse this code. It's pretty simple, not sure if this is really a win. --- src/gallium/auxiliary/Makefile | 3 +- src/gallium/include/state_tracker/xlib_sw_winsys.h | 11 +--- src/gallium/state_trackers/glx/xlib/xm_api.c | 2 +- src/gallium/state_trackers/glx/xlib/xm_public.h | 44 ++++++++++++++ src/gallium/state_trackers/glx/xlib/xm_winsys.h | 42 ------------- src/gallium/targets/libgl-xlib/xlib.c | 70 ++-------------------- src/gallium/winsys/drm/i965/xlib/xlib_i965.c | 2 +- 7 files changed, 55 insertions(+), 119 deletions(-) create mode 100644 src/gallium/state_trackers/glx/xlib/xm_public.h delete mode 100644 src/gallium/state_trackers/glx/xlib/xm_winsys.h (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 68b1a3e854..c84e8d781d 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -131,7 +131,8 @@ C_SOURCES = \ vl/vl_mpeg12_mc_renderer.c \ vl/vl_compositor.c \ vl/vl_csc.c \ - vl/vl_shader_build.c + vl/vl_shader_build.c \ + target-helpers/swrast_xlib.c GALLIVM_SOURCES = \ gallivm/lp_bld_alpha.c \ diff --git a/src/gallium/include/state_tracker/xlib_sw_winsys.h b/src/gallium/include/state_tracker/xlib_sw_winsys.h index 13dc837712..f22c22bb62 100644 --- a/src/gallium/include/state_tracker/xlib_sw_winsys.h +++ b/src/gallium/include/state_tracker/xlib_sw_winsys.h @@ -9,8 +9,9 @@ struct pipe_screen; struct pipe_surface; /* This is what the xlib software winsys expects to find in the - * "private" field of flush_frontbuffers(). Xlib-based state trackers - * somehow need to know this. + * "private" field of flush_frontbuffers(). + * + * Xlib-based state trackers somehow need to know this. */ struct xlib_drawable { Visual *visual; @@ -18,12 +19,6 @@ struct xlib_drawable { Drawable drawable; }; -/* This is the interface required by the glx/xlib state tracker. Why - * is it being defined in this file? - */ -struct xm_driver { - struct pipe_screen *(*create_pipe_screen)( Display *display ); -}; /* This is the public interface to the ws/xlib module. Why isn't it * being defined in that directory? diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index b8647d71c6..568bc6e962 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -63,7 +63,7 @@ #include "pipe/p_screen.h" #include "pipe/p_context.h" -#include "xm_winsys.h" +#include "xm_public.h" #include diff --git a/src/gallium/state_trackers/glx/xlib/xm_public.h b/src/gallium/state_trackers/glx/xlib/xm_public.h new file mode 100644 index 0000000000..ac6a8ffb27 --- /dev/null +++ b/src/gallium/state_trackers/glx/xlib/xm_public.h @@ -0,0 +1,44 @@ + +/************************************************************************** + * + * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef XM_WINSYS_H +#define XM_WINSYS_H + +struct xm_driver; + +/* This is the driver interface required by the glx/xlib state tracker. + */ +struct xm_driver { + struct pipe_screen *(*create_pipe_screen)( Display *display ); +}; + +extern void +xmesa_set_driver( const struct xm_driver *driver ); + + +#endif diff --git a/src/gallium/state_trackers/glx/xlib/xm_winsys.h b/src/gallium/state_trackers/glx/xlib/xm_winsys.h deleted file mode 100644 index 648f1c90ef..0000000000 --- a/src/gallium/state_trackers/glx/xlib/xm_winsys.h +++ /dev/null @@ -1,42 +0,0 @@ - -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#ifndef XM_WINSYS_H -#define XM_WINSYS_H - -struct pipe_context; -struct pipe_screen; -struct pipe_surface; -struct xlib_drawable; - - -extern void -xmesa_set_driver( const struct xm_driver *driver ); - - -#endif diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c index 7881bc2cb1..54764440e7 100644 --- a/src/gallium/targets/libgl-xlib/xlib.c +++ b/src/gallium/targets/libgl-xlib/xlib.c @@ -30,81 +30,19 @@ * Authors: * Keith Whitwell */ - -#include "state_tracker/xlib_sw_winsys.h" -#include "xm_winsys.h" -#include "util/u_debug.h" -#include "softpipe/sp_public.h" -#include "llvmpipe/lp_public.h" -#include "identity/id_public.h" -#include "trace/tr_public.h" -#include "cell/ppu/cell_public.h" - +#include "pipe/p_compiler.h" +#include "target-helpers/swrast_xlib.h" +#include "xm_public.h" /* advertise OpenGL support */ PUBLIC const int st_api_OpenGL = 1; - -static struct pipe_screen * -create_screen( struct sw_winsys *winsys ) -{ -#if defined(GALLIUM_CELL) - if (!debug_get_bool_option("GALLIUM_NOCELL", FALSE)) - return cell_create_screen( winsys ); -#endif - -#if defined(GALLIUM_LLVMPIPE) - return llvmpipe_create_screen( winsys ); -#endif - - return softpipe_create_screen( winsys ); -} - - - -static struct pipe_screen * -xlib_create_screen( Display *display ) -{ - struct sw_winsys *winsys; - struct pipe_screen *screen; - - winsys = xlib_create_sw_winsys( display ); - if (winsys == NULL) - return NULL; - - screen = create_screen(winsys); - if (screen == NULL) - goto fail; - - /* Finally we have somewhere to inject layers into the stack in a - * clean fashion: - */ - if (debug_get_bool_option("GALLIUM_WRAP", FALSE)) { - screen = identity_screen_create(screen); - } - - if (debug_get_bool_option("GALLIUM_TRACE", FALSE)) { - screen = trace_screen_create( screen ); - } - - return screen; - -fail: - if (winsys) - winsys->destroy( winsys ); - - return NULL; -} - - struct xm_driver xlib_driver = { - .create_pipe_screen = xlib_create_screen, + .create_pipe_screen = swrast_xlib_create_screen, }; - - /* Build the rendering stack. */ static void _init( void ) __attribute__((constructor)); diff --git a/src/gallium/winsys/drm/i965/xlib/xlib_i965.c b/src/gallium/winsys/drm/i965/xlib/xlib_i965.c index 74501eeb16..063e9f600b 100644 --- a/src/gallium/winsys/drm/i965/xlib/xlib_i965.c +++ b/src/gallium/winsys/drm/i965/xlib/xlib_i965.c @@ -38,7 +38,7 @@ #include "pipe/p_error.h" #include "pipe/p_context.h" -#include "xm_winsys.h" +#include "xm_public.h" #include "i965/brw_winsys.h" #include "i965/brw_screen.h" -- cgit v1.2.3 From 5e72b89b89fe172638afa66abdd6607d11970e5a Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 17:31:50 +0000 Subject: egl/x11: use swrast-xlib helper --- src/gallium/state_trackers/egl/x11/native_ximage.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 0aa25ead25..7d1462d4b7 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -32,9 +32,9 @@ #include "util/u_math.h" #include "util/u_format.h" #include "pipe/p_compiler.h" -#include "util/u_simple_screen.h" #include "util/u_inlines.h" #include "state_tracker/xlib_sw_winsys.h" +#include "target-helpers/swrast_xlib.h" #include "egllog.h" #include "native_x11.h" @@ -640,8 +640,7 @@ x11_create_ximage_display(EGLNativeDisplayType dpy) return NULL; } - xdpy->driver = xlib_sw_winsys_init(); - xdpy->base.screen = xdpy->driver->create_pipe_screen(xdpy->dpy); + xdpy->base.screen = swrast_xlib_create_screen(xdpy->dpy); xdpy->base.destroy = ximage_display_destroy; xdpy->base.get_param = ximage_display_get_param; -- cgit v1.2.3 From 25b9aafbd2f2d0737c23b4c59778c4e41f046d39 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 17:55:19 +0000 Subject: ws/xlib: no dependency on mesa state tracker --- src/gallium/winsys/xlib/SConscript | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/xlib/SConscript b/src/gallium/winsys/xlib/SConscript index d4009df991..2af6153b4c 100644 --- a/src/gallium/winsys/xlib/SConscript +++ b/src/gallium/winsys/xlib/SConscript @@ -4,8 +4,7 @@ Import('*') -if env['platform'] == 'linux' \ - and 'mesa' in env['statetrackers']: +if env['platform'] == 'linux': env = env.Clone() -- cgit v1.2.3 From 0df858a8d541e342dfe569091b665c2a6dff7ef0 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 17:57:13 +0000 Subject: gallium: create target for gdi libgl --- src/gallium/targets/libgl-gdi/SConscript | 51 +++++++++ .../targets/libgl-gdi/gdi_llvmpipe_winsys.c | 123 +++++++++++++++++++++ .../targets/libgl-gdi/gdi_softpipe_winsys.c | 123 +++++++++++++++++++++ src/gallium/winsys/gdi/SConscript | 52 ++------- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 123 --------------------- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 123 --------------------- src/gallium/winsys/gdi/gdi_sw_winsys.c | 2 +- 7 files changed, 309 insertions(+), 288 deletions(-) create mode 100644 src/gallium/targets/libgl-gdi/SConscript create mode 100644 src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c create mode 100644 src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c delete mode 100644 src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c delete mode 100644 src/gallium/winsys/gdi/gdi_softpipe_winsys.c (limited to 'src') diff --git a/src/gallium/targets/libgl-gdi/SConscript b/src/gallium/targets/libgl-gdi/SConscript new file mode 100644 index 0000000000..57704440ce --- /dev/null +++ b/src/gallium/targets/libgl-gdi/SConscript @@ -0,0 +1,51 @@ +####################################################################### +# SConscript for gdi winsys + +Import('*') + +if env['platform'] == 'windows': + + env = env.Clone() + + env.Append(CPPPATH = [ + '#src/gallium/state_trackers/wgl', + ]) + + env.Append(LIBS = [ + 'gdi32', + 'user32', + 'kernel32', + 'ws2_32', + ]) + + sources = [] + drivers = [] + + if 'softpipe' in env['drivers']: + sources = ['gdi_softpipe_winsys.c'] + drivers = [softpipe] + + if 'llvmpipe' in env['drivers']: + env.Tool('llvm') + if 'LLVM_VERSION' in env: + sources = ['gdi_llvmpipe_winsys.c'] + drivers = [llvmpipe] + + if not sources or not drivers: + print 'warning: softpipe or llvmpipe not selected, gdi winsys disabled' + Return() + + if env['gcc']: + sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def'] + else: + sources += ['#src/gallium/state_trackers/wgl/opengl32.def'] + + drivers += [trace] + + env['no_import_lib'] = 1 + + env.SharedLibrary( + target ='opengl32', + source = sources, + LIBS = wgl + ws_gdi + glapi + mesa + drivers + gallium + glsl + env['LIBS'], + ) diff --git a/src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c b/src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c new file mode 100644 index 0000000000..f20c2614e2 --- /dev/null +++ b/src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c @@ -0,0 +1,123 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/** + * @file + * LLVMpipe support. + * + * @author Jose Fonseca + */ + + +#include + +#include "stw_winsys.h" +#include "gdi_sw_winsys.h" +#include "llvmpipe/lp_texture.h" +#include "llvmpipe/lp_screen.h" + + +static struct pipe_screen * +gdi_llvmpipe_screen_create(void) +{ + static struct sw_winsys *winsys; + struct pipe_screen *screen; + + winsys = gdi_create_sw_winsys(); + if(!winsys) + goto no_winsys; + + screen = llvmpipe_create_screen(winsys); + if(!screen) + goto no_screen; + + return screen; + +no_screen: + winsys->destroy(winsys); +no_winsys: + return NULL; +} + + + + +static void +gdi_llvmpipe_present(struct pipe_screen *screen, + struct pipe_surface *surface, + HDC hDC) +{ + /* This will fail if any interposing layer (trace, debug, etc) has + * been introduced between the state-trackers and llvmpipe. + * + * Ideally this would get replaced with a call to + * pipe_screen::flush_frontbuffer(). + * + * Failing that, it may be necessary for intervening layers to wrap + * other structs such as this stw_winsys as well... + */ + gdi_sw_display(llvmpipe_screen(screen)->winsys, + llvmpipe_texture(surface->texture)->dt, + hDC); +} + + +static const struct stw_winsys stw_winsys = { + &gdi_llvmpipe_screen_create, + &gdi_llvmpipe_present, + NULL, /* get_adapter_luid */ + NULL, /* shared_surface_open */ + NULL, /* shared_surface_close */ + NULL /* compose */ +}; + + +BOOL WINAPI +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) +{ + switch (fdwReason) { + case DLL_PROCESS_ATTACH: + stw_init(&stw_winsys); + stw_init_thread(); + break; + + case DLL_THREAD_ATTACH: + stw_init_thread(); + break; + + case DLL_THREAD_DETACH: + stw_cleanup_thread(); + break; + + case DLL_PROCESS_DETACH: + stw_cleanup_thread(); + stw_cleanup(); + break; + } + return TRUE; +} diff --git a/src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c b/src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c new file mode 100644 index 0000000000..5c5c154c7f --- /dev/null +++ b/src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c @@ -0,0 +1,123 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/** + * @file + * LLVMpipe support. + * + * @author Jose Fonseca + */ + + +#include + +#include "stw_winsys.h" +#include "gdi_sw_winsys.h" +#include "softpipe/sp_texture.h" +#include "softpipe/sp_screen.h" + + +static struct pipe_screen * +gdi_softpipe_screen_create(void) +{ + static struct sw_winsys *winsys; + struct pipe_screen *screen; + + winsys = gdi_create_sw_winsys(); + if(!winsys) + goto no_winsys; + + screen = softpipe_create_screen(winsys); + if(!screen) + goto no_screen; + + return screen; + +no_screen: + winsys->destroy(winsys); +no_winsys: + return NULL; +} + + + + +static void +gdi_softpipe_present(struct pipe_screen *screen, + struct pipe_surface *surface, + HDC hDC) +{ + /* This will fail if any interposing layer (trace, debug, etc) has + * been introduced between the state-trackers and softpipe. + * + * Ideally this would get replaced with a call to + * pipe_screen::flush_frontbuffer(). + * + * Failing that, it may be necessary for intervening layers to wrap + * other structs such as this stw_winsys as well... + */ + gdi_sw_display(softpipe_screen(screen)->winsys, + softpipe_texture(surface->texture)->dt, + hDC); +} + + +static const struct stw_winsys stw_winsys = { + &gdi_softpipe_screen_create, + &gdi_softpipe_present, + NULL, /* get_adapter_luid */ + NULL, /* shared_surface_open */ + NULL, /* shared_surface_close */ + NULL /* compose */ +}; + + +BOOL WINAPI +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) +{ + switch (fdwReason) { + case DLL_PROCESS_ATTACH: + stw_init(&stw_winsys); + stw_init_thread(); + break; + + case DLL_THREAD_ATTACH: + stw_init_thread(); + break; + + case DLL_THREAD_DETACH: + stw_cleanup_thread(); + break; + + case DLL_PROCESS_DETACH: + stw_cleanup_thread(); + stw_cleanup(); + break; + } + return TRUE; +} diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript index 0a3f141e72..80f6c0e477 100644 --- a/src/gallium/winsys/gdi/SConscript +++ b/src/gallium/winsys/gdi/SConscript @@ -1,5 +1,6 @@ ####################################################################### -# SConscript for gdi winsys +# SConscript for xlib winsys + Import('*') @@ -8,46 +9,15 @@ if env['platform'] == 'windows': env = env.Clone() env.Append(CPPPATH = [ - '#src/gallium/state_trackers/wgl', - ]) - - env.Append(LIBS = [ - 'gdi32', - 'user32', - 'kernel32', - 'ws2_32', + '#/src/gallium/include', + '#/src/gallium/auxiliary', + '#/src/gallium/drivers', ]) - sources = [] - drivers = [] - - if 'softpipe' in env['drivers']: - sources = ['gdi_sw_winsys.c', - 'gdi_softpipe_winsys.c'] - drivers = [softpipe] - - if 'llvmpipe' in env['drivers']: - env.Tool('llvm') - if 'LLVM_VERSION' in env: - sources = ['gdi_sw_winsys.c', - 'gdi_llvmpipe_winsys.c'] - drivers = [llvmpipe] - - if not sources or not drivers: - print 'warning: softpipe or llvmpipe not selected, gdi winsys disabled' - Return() - - if env['gcc']: - sources += ['#src/gallium/state_trackers/wgl/opengl32.mingw.def'] - else: - sources += ['#src/gallium/state_trackers/wgl/opengl32.def'] - - drivers += [trace] - - env['no_import_lib'] = 1 - - env.SharedLibrary( - target ='opengl32', - source = sources, - LIBS = wgl + glapi + mesa + drivers + gallium + glsl + env['LIBS'], + ws_xlib = env.ConvenienceLibrary( + target = 'ws_gdi', + source = [ + 'gdi_sw_winsys.c', + ] ) + Export('ws_gdi') diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c deleted file mode 100644 index f20c2614e2..0000000000 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/** - * @file - * LLVMpipe support. - * - * @author Jose Fonseca - */ - - -#include - -#include "stw_winsys.h" -#include "gdi_sw_winsys.h" -#include "llvmpipe/lp_texture.h" -#include "llvmpipe/lp_screen.h" - - -static struct pipe_screen * -gdi_llvmpipe_screen_create(void) -{ - static struct sw_winsys *winsys; - struct pipe_screen *screen; - - winsys = gdi_create_sw_winsys(); - if(!winsys) - goto no_winsys; - - screen = llvmpipe_create_screen(winsys); - if(!screen) - goto no_screen; - - return screen; - -no_screen: - winsys->destroy(winsys); -no_winsys: - return NULL; -} - - - - -static void -gdi_llvmpipe_present(struct pipe_screen *screen, - struct pipe_surface *surface, - HDC hDC) -{ - /* This will fail if any interposing layer (trace, debug, etc) has - * been introduced between the state-trackers and llvmpipe. - * - * Ideally this would get replaced with a call to - * pipe_screen::flush_frontbuffer(). - * - * Failing that, it may be necessary for intervening layers to wrap - * other structs such as this stw_winsys as well... - */ - gdi_sw_display(llvmpipe_screen(screen)->winsys, - llvmpipe_texture(surface->texture)->dt, - hDC); -} - - -static const struct stw_winsys stw_winsys = { - &gdi_llvmpipe_screen_create, - &gdi_llvmpipe_present, - NULL, /* get_adapter_luid */ - NULL, /* shared_surface_open */ - NULL, /* shared_surface_close */ - NULL /* compose */ -}; - - -BOOL WINAPI -DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) -{ - switch (fdwReason) { - case DLL_PROCESS_ATTACH: - stw_init(&stw_winsys); - stw_init_thread(); - break; - - case DLL_THREAD_ATTACH: - stw_init_thread(); - break; - - case DLL_THREAD_DETACH: - stw_cleanup_thread(); - break; - - case DLL_PROCESS_DETACH: - stw_cleanup_thread(); - stw_cleanup(); - break; - } - return TRUE; -} diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c deleted file mode 100644 index 5c5c154c7f..0000000000 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/** - * @file - * LLVMpipe support. - * - * @author Jose Fonseca - */ - - -#include - -#include "stw_winsys.h" -#include "gdi_sw_winsys.h" -#include "softpipe/sp_texture.h" -#include "softpipe/sp_screen.h" - - -static struct pipe_screen * -gdi_softpipe_screen_create(void) -{ - static struct sw_winsys *winsys; - struct pipe_screen *screen; - - winsys = gdi_create_sw_winsys(); - if(!winsys) - goto no_winsys; - - screen = softpipe_create_screen(winsys); - if(!screen) - goto no_screen; - - return screen; - -no_screen: - winsys->destroy(winsys); -no_winsys: - return NULL; -} - - - - -static void -gdi_softpipe_present(struct pipe_screen *screen, - struct pipe_surface *surface, - HDC hDC) -{ - /* This will fail if any interposing layer (trace, debug, etc) has - * been introduced between the state-trackers and softpipe. - * - * Ideally this would get replaced with a call to - * pipe_screen::flush_frontbuffer(). - * - * Failing that, it may be necessary for intervening layers to wrap - * other structs such as this stw_winsys as well... - */ - gdi_sw_display(softpipe_screen(screen)->winsys, - softpipe_texture(surface->texture)->dt, - hDC); -} - - -static const struct stw_winsys stw_winsys = { - &gdi_softpipe_screen_create, - &gdi_softpipe_present, - NULL, /* get_adapter_luid */ - NULL, /* shared_surface_open */ - NULL, /* shared_surface_close */ - NULL /* compose */ -}; - - -BOOL WINAPI -DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) -{ - switch (fdwReason) { - case DLL_PROCESS_ATTACH: - stw_init(&stw_winsys); - stw_init_thread(); - break; - - case DLL_THREAD_ATTACH: - stw_init_thread(); - break; - - case DLL_THREAD_DETACH: - stw_cleanup_thread(); - break; - - case DLL_PROCESS_DETACH: - stw_cleanup_thread(); - stw_cleanup(); - break; - } - return TRUE; -} diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.c b/src/gallium/winsys/gdi/gdi_sw_winsys.c index 55f99c4f47..f5c0b7d56e 100644 --- a/src/gallium/winsys/gdi/gdi_sw_winsys.c +++ b/src/gallium/winsys/gdi/gdi_sw_winsys.c @@ -28,7 +28,7 @@ /** * @file - * LLVMpipe support. + * GDI software rasterizer support. * * @author Jose Fonseca */ -- cgit v1.2.3 From 3cadd983e875ebd2ccdde5287af1dcd3abad6db8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 18:01:47 +0000 Subject: ws/gdi: fix typo --- src/gallium/winsys/gdi/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript index 80f6c0e477..1267fc6eea 100644 --- a/src/gallium/winsys/gdi/SConscript +++ b/src/gallium/winsys/gdi/SConscript @@ -14,7 +14,7 @@ if env['platform'] == 'windows': '#/src/gallium/drivers', ]) - ws_xlib = env.ConvenienceLibrary( + ws_gdi = env.ConvenienceLibrary( target = 'ws_gdi', source = [ 'gdi_sw_winsys.c', -- cgit v1.2.3 From bf50d40f1ba68a0f19ca06196af99c01efce1e76 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 9 Mar 2010 20:12:52 +0100 Subject: r300g: kill pf_component_count --- src/gallium/drivers/r300/r300_state_inlines.h | 29 +-------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h index af7827820c..a32924ed0a 100644 --- a/src/gallium/drivers/r300/r300_state_inlines.h +++ b/src/gallium/drivers/r300/r300_state_inlines.h @@ -348,39 +348,12 @@ static INLINE uint32_t r300_translate_gb_pipes(int pipe_count) return 0; } -/* Utility function to count the number of components in RGBAZS formats. - * XXX should go to util or p_format.h */ -static INLINE unsigned pf_component_count(enum pipe_format format) { - unsigned count = 0; - - if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 0)) { - count++; - } - if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 1)) { - count++; - } - if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 2)) { - count++; - } - if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_RGB, 3)) { - count++; - } - if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 0)) { - count++; - } - if (util_format_get_component_bits(format, UTIL_FORMAT_COLORSPACE_ZS, 1)) { - count++; - } - - return count; -} - /* Translate pipe_formats into PSC vertex types. */ static INLINE uint16_t r300_translate_vertex_data_type(enum pipe_format format) { uint32_t result = 0; const struct util_format_description *desc; - unsigned components = pf_component_count(format); + unsigned components = util_format_get_nr_components(format); desc = util_format_description(format); -- cgit v1.2.3 From 9cdaadc92f7ca91d01daf5573bff2c75416ad274 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 19:15:28 +0000 Subject: target-helpers: missing files --- src/gallium/auxiliary/target-helpers/swrast_xlib.c | 106 +++++++++++++++++++++ src/gallium/auxiliary/target-helpers/swrast_xlib.h | 15 +++ 2 files changed, 121 insertions(+) create mode 100644 src/gallium/auxiliary/target-helpers/swrast_xlib.c create mode 100644 src/gallium/auxiliary/target-helpers/swrast_xlib.h (limited to 'src') diff --git a/src/gallium/auxiliary/target-helpers/swrast_xlib.c b/src/gallium/auxiliary/target-helpers/swrast_xlib.c new file mode 100644 index 0000000000..bf30ff68c1 --- /dev/null +++ b/src/gallium/auxiliary/target-helpers/swrast_xlib.c @@ -0,0 +1,106 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/* + * Authors: + * Keith Whitwell + */ + +#include "swrast_xlib.h" + +#include "state_tracker/xlib_sw_winsys.h" +#include "util/u_debug.h" +#include "softpipe/sp_public.h" +#include "llvmpipe/lp_public.h" +#include "identity/id_public.h" +#include "trace/tr_public.h" +#include "cell/ppu/cell_public.h" + + +/* Helper function to build a subset of a driver stack consisting of + * one of the software rasterizers (cell, llvmpipe, softpipe) and the + * xlib winsys. + * + * This can be called by any target that builds on top of this + * combination. + */ +struct pipe_screen * +swrast_xlib_create_screen( Display *display ) +{ + struct sw_winsys *winsys; + struct pipe_screen *screen = NULL; + + /* Create the underlying winsys, which performs presents to Xlib + * drawables: + */ + winsys = xlib_create_sw_winsys( display ); + if (winsys == NULL) + return NULL; + + /* Create a software rasterizer on top of that winsys: + */ +#if defined(GALLIUM_CELL) + if (screen == NULL && + !debug_get_bool_option("GALLIUM_NO_CELL", FALSE)) + screen = cell_create_screen( winsys ); +#endif + +#if defined(GALLIUM_LLVMPIPE) + if (screen == NULL && + !debug_get_bool_option("GALLIUM_NO_LLVM", FALSE)) + screen = llvmpipe_create_screen( winsys ); +#endif + + if (screen == NULL) + screen = softpipe_create_screen( winsys ); + + if (screen == NULL) + goto fail; + + /* Inject any wrapping layers we want to here: + */ + if (debug_get_bool_option("GALLIUM_WRAP", FALSE)) { + screen = identity_screen_create(screen); + } + + if (debug_get_bool_option("GALLIUM_TRACE", FALSE)) { + screen = trace_screen_create( screen ); + } + + return screen; + +fail: + if (winsys) + winsys->destroy( winsys ); + + return NULL; +} + + + + diff --git a/src/gallium/auxiliary/target-helpers/swrast_xlib.h b/src/gallium/auxiliary/target-helpers/swrast_xlib.h new file mode 100644 index 0000000000..3a0f713d54 --- /dev/null +++ b/src/gallium/auxiliary/target-helpers/swrast_xlib.h @@ -0,0 +1,15 @@ +#ifndef SWRAST_XLIB_HELPER_H +#define SWRAST_XLIB_HELPER_H + +#include +#include "pipe/p_compiler.h" + +/* Helper to build the xlib winsys, choose between the software + * rasterizers and construct the lower part of a driver stack. + * + * Just add a state tracker. + */ +struct pipe_screen *swrast_xlib_create_screen( Display *display ); + + +#endif -- cgit v1.2.3 From 0d6b0b0d9d5257cc8fb95786b6cd77d088bdb35e Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 19:05:32 +0100 Subject: cso: don't forget to release vertex elements state --- src/gallium/auxiliary/cso_cache/cso_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index f8cb01467c..6500891a10 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -289,6 +289,7 @@ void cso_release_all( struct cso_context *ctx ) ctx->pipe->bind_depth_stencil_alpha_state( ctx->pipe, NULL ); ctx->pipe->bind_fs_state( ctx->pipe, NULL ); ctx->pipe->bind_vs_state( ctx->pipe, NULL ); + ctx->pipe->bind_vertex_elements_state( ctx->pipe, NULL ); } for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { -- cgit v1.2.3 From a673dee4553b6f1649d4cc31f7f7849058411c49 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 9 Mar 2010 20:31:40 +0100 Subject: mesa/st: initialize velements state properly one variable is a bitfield where the rest is never written to, which caused valgrind to complain. Might have caused cso to not recognize an already stored state. Reported by Christoph Bumiller. --- src/mesa/state_tracker/st_draw.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 4d2e39108d..8a6e1ed466 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -563,6 +563,7 @@ st_draw_vbo(GLcontext *ctx, (void) check_uniforms; #endif + memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs); /* * Setup the vbuffer[] and velements[] arrays. */ -- cgit v1.2.3 From 02716cf7d16543d5dedc6e550895d77139ad2432 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 9 Mar 2010 19:47:30 +0000 Subject: null: Add a null software winsys. One where framebuffer data will be read via texture transfers. Useful for e.g., python state tracker. --- configs/default | 2 +- src/gallium/winsys/SConscript | 4 + src/gallium/winsys/null/Makefile | 16 ++++ src/gallium/winsys/null/SConscript | 21 ++++++ src/gallium/winsys/null/null_sw_winsys.c | 124 +++++++++++++++++++++++++++++++ src/gallium/winsys/null/null_sw_winsys.h | 40 ++++++++++ 6 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 src/gallium/winsys/null/Makefile create mode 100644 src/gallium/winsys/null/SConscript create mode 100644 src/gallium/winsys/null/null_sw_winsys.c create mode 100644 src/gallium/winsys/null/null_sw_winsys.h (limited to 'src') diff --git a/configs/default b/configs/default index fb1a35522e..a6a92efe8f 100644 --- a/configs/default +++ b/configs/default @@ -100,7 +100,7 @@ GALLIUM_DIRS = auxiliary drivers state_trackers GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a GALLIUM_DRIVERS_DIRS = softpipe failover svga i915 i965 r300 trace identity GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a) -GALLIUM_WINSYS_DIRS = drm xlib +GALLIUM_WINSYS_DIRS = drm null xlib GALLIUM_TARGET_DIRS = libgl-xlib GALLIUM_WINSYS_DRM_DIRS = swrast GALLIUM_STATE_TRACKERS_DIRS = glx vega diff --git a/src/gallium/winsys/SConscript b/src/gallium/winsys/SConscript index 30c3378dff..4567d17447 100644 --- a/src/gallium/winsys/SConscript +++ b/src/gallium/winsys/SConscript @@ -1,5 +1,9 @@ Import('*') +SConscript([ + 'null/SConscript', +]) + if env['dri']: SConscript([ 'drm/SConscript', diff --git a/src/gallium/winsys/null/Makefile b/src/gallium/winsys/null/Makefile new file mode 100644 index 0000000000..3a3fb75ab3 --- /dev/null +++ b/src/gallium/winsys/null/Makefile @@ -0,0 +1,16 @@ +TOP = ../../../.. +include $(TOP)/configs/current + +LIBNAME = ws_null + +LIBRARY_INCLUDES = \ + -I$(TOP)/src/gallium/include \ + -I$(TOP)/src/gallium/drivers \ + -I$(TOP)/src/gallium/auxiliary + +C_SOURCES = \ + null_sw_winsys.c + +include ../../Makefile.template + + diff --git a/src/gallium/winsys/null/SConscript b/src/gallium/winsys/null/SConscript new file mode 100644 index 0000000000..21837dc60c --- /dev/null +++ b/src/gallium/winsys/null/SConscript @@ -0,0 +1,21 @@ +####################################################################### +# SConscript for xlib winsys + + +Import('*') + +env = env.Clone() + +env.Append(CPPPATH = [ + '#/src/gallium/include', + '#/src/gallium/auxiliary', + '#/src/gallium/drivers', +]) + +ws_null = env.ConvenienceLibrary( + target = 'ws_null', + source = [ + 'null_sw_winsys.c', + ] +) +Export('ws_null') diff --git a/src/gallium/winsys/null/null_sw_winsys.c b/src/gallium/winsys/null/null_sw_winsys.c new file mode 100644 index 0000000000..d961d34860 --- /dev/null +++ b/src/gallium/winsys/null/null_sw_winsys.c @@ -0,0 +1,124 @@ +/************************************************************************** + * + * Copyright 2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + **************************************************************************/ + +/** + * @file + * Null software rasterizer winsys. + * + * There is no present support. Framebuffer data needs to be obtained via + * transfers. + * + * @author Jose Fonseca + */ + + +#include "pipe/p_format.h" +#include "util/u_memory.h" +#include "state_tracker/sw_winsys.h" +#include "null_sw_winsys.h" + + +static boolean +null_sw_is_displaytarget_format_supported(struct sw_winsys *ws, + enum pipe_format format ) +{ + return FALSE; +} + + +static void * +null_sw_displaytarget_map(struct sw_winsys *ws, + struct sw_displaytarget *dt, + unsigned flags ) +{ + assert(0); + return NULL; +} + + +static void +null_sw_displaytarget_unmap(struct sw_winsys *ws, + struct sw_displaytarget *dt ) +{ + assert(0); +} + + +static void +null_sw_displaytarget_destroy(struct sw_winsys *winsys, + struct sw_displaytarget *dt) +{ + assert(0); +} + + +static struct sw_displaytarget * +null_sw_displaytarget_create(struct sw_winsys *winsys, + enum pipe_format format, + unsigned width, unsigned height, + unsigned alignment, + unsigned *stride) +{ + return NULL; +} + + +static void +null_sw_displaytarget_display(struct sw_winsys *winsys, + struct sw_displaytarget *dt, + void *context_private) +{ + assert(0); +} + + +static void +null_sw_destroy(struct sw_winsys *winsys) +{ + FREE(winsys); +} + + +struct sw_winsys * +null_sw_create(void) +{ + static struct sw_winsys *winsys; + + winsys = CALLOC_STRUCT(sw_winsys); + if (!winsys) + return NULL; + + winsys->destroy = null_sw_destroy; + winsys->is_displaytarget_format_supported = null_sw_is_displaytarget_format_supported; + winsys->displaytarget_create = null_sw_displaytarget_create; + winsys->displaytarget_map = null_sw_displaytarget_map; + winsys->displaytarget_unmap = null_sw_displaytarget_unmap; + winsys->displaytarget_display = null_sw_displaytarget_display; + winsys->displaytarget_destroy = null_sw_displaytarget_destroy; + + return winsys; +} diff --git a/src/gallium/winsys/null/null_sw_winsys.h b/src/gallium/winsys/null/null_sw_winsys.h new file mode 100644 index 0000000000..1986186feb --- /dev/null +++ b/src/gallium/winsys/null/null_sw_winsys.h @@ -0,0 +1,40 @@ +/************************************************************************** + * + * Copyright 2010 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + **************************************************************************/ + + +#ifndef NULL_SW_WINSYS_H_ +#define NULL_SW_WINSYS_H_ + + +struct sw_winsys; + + +struct sw_winsys * +null_sw_create(void); + + +#endif /* NULL_SW_WINSYS_H_ */ -- cgit v1.2.3 From dc1e4cf87fdab5a57049fbf4180e3597d80323cd Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 9 Mar 2010 19:14:34 +0100 Subject: svga: Don't do culling while the software pipeline is active. It does it for us, and additionally introduces potentially back-facing triangles. --- src/gallium/drivers/svga/svga_state_rss.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_state_rss.c b/src/gallium/drivers/svga/svga_state_rss.c index 107cc403b4..b7195d246b 100644 --- a/src/gallium/drivers/svga/svga_state_rss.c +++ b/src/gallium/drivers/svga/svga_state_rss.c @@ -191,15 +191,24 @@ static int emit_rss( struct svga_context *svga, EMIT_RS( svga, svga->curr.stencil_ref.ref_value[0], STENCILREF, fail ); } - if (dirty & SVGA_NEW_RAST) + if (dirty & (SVGA_NEW_RAST | SVGA_NEW_NEED_PIPELINE)) { const struct svga_rasterizer_state *curr = svga->curr.rast; + unsigned cullmode = curr->cullmode; /* Shademode: still need to rearrange index list to move * flat-shading PV first vertex. */ EMIT_RS( svga, curr->shademode, SHADEMODE, fail ); - EMIT_RS( svga, curr->cullmode, CULLMODE, fail ); + + /* Don't do culling while the software pipeline is active. It + * does it for us, and additionally introduces potentially + * back-facing triangles. + */ + if (svga->state.sw.need_pipeline) + cullmode = SVGA3D_FACE_NONE; + + EMIT_RS( svga, cullmode, CULLMODE, fail ); EMIT_RS( svga, curr->scissortestenable, SCISSORTESTENABLE, fail ); EMIT_RS( svga, curr->multisampleantialias, MULTISAMPLEANTIALIAS, fail ); EMIT_RS( svga, curr->lastpixel, LASTPIXEL, fail ); -- cgit v1.2.3 From fe14868d96d4820dba73c3a507d191b8a73c6870 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Tue, 9 Mar 2010 22:03:24 +0200 Subject: drop stray XFree86Server, XGLServer --- src/gallium/include/pipe/p_compiler.h | 5 ----- src/mesa/glapi/glapi_getproc.c | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index b93b38310a..e2766d15cd 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -31,13 +31,8 @@ #include "p_config.h" -#ifndef XFree86Server #include #include -#else -#include "xf86_ansic.h" -#include "xf86_libc.h" -#endif #include #include diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index a6dbf173e8..2b89a8f4f4 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -53,7 +53,7 @@ # endif #endif -#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer) +#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) # define NEED_FUNCTION_POINTER #endif @@ -112,7 +112,7 @@ extern const GLubyte gl_dispatch_functions_start[]; #endif /* USE_X86_ASM */ -#if !defined(XFree86Server) && !defined(XGLServer) +#if !defined(XFree86Server) /** * Return dispatch function address for the named static (built-in) function. @@ -140,7 +140,7 @@ get_static_proc_address(const char *funcName) } } -#endif /* !defined(XFree86Server) && !defined(XGLServer) */ +#endif /* !defined(XFree86Server) */ @@ -724,7 +724,7 @@ _glapi_get_proc_address(const char *funcName) } } -#if !defined( XFree86Server ) && !defined( XGLServer ) +#if !defined( XFree86Server ) /* search static functions */ { const _glapi_proc func = get_static_proc_address(funcName); -- cgit v1.2.3 From 2c8b5ffed9a787e896b540a95be48ef401d5f007 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Tue, 9 Mar 2010 22:03:24 +0200 Subject: glapi: mv table functions to glapi_getproc.c and add local header --- src/mesa/glapi/glapi.c | 44 +-------------------------------- src/mesa/glapi/glapi.h | 21 ---------------- src/mesa/glapi/glapi_getproc.c | 56 ++++++++++++++++++++++++++++++++++++++++-- src/mesa/glapi/glapi_priv.h | 43 ++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 66 deletions(-) create mode 100644 src/mesa/glapi/glapi_priv.h (limited to 'src') diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 13de594aaf..ce85cf6a87 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -59,7 +59,7 @@ #endif #include "glapi/glapi.h" -#include "glapi/glapitable.h" +#include "glapi/glapi_priv.h" extern _glapi_proc __glapi_noop_table[]; @@ -291,45 +291,3 @@ _glapi_get_dispatch(void) return _glapi_Dispatch; #endif } - - - - -/* - * The dispatch table size (number of entries) is the size of the - * _glapi_table struct plus the number of dynamic entries we can add. - * The extra slots can be filled in by DRI drivers that register new extension - * functions. - */ -#define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS) - - -/** - * Return size of dispatch table struct as number of functions (or - * slots). - */ -PUBLIC GLuint -_glapi_get_dispatch_table_size(void) -{ - return DISPATCH_TABLE_SIZE; -} - - -/** - * Make sure there are no NULL pointers in the given dispatch table. - * Intended for debugging purposes. - */ -void -_glapi_check_table_not_null(const struct _glapi_table *table) -{ -#if 0 /* enable this for extra DEBUG */ - const GLuint entries = _glapi_get_dispatch_table_size(); - const void **tab = (const void **) table; - GLuint i; - for (i = 1; i < entries; i++) { - assert(tab[i]); - } -#else - (void) table; -#endif -} diff --git a/src/mesa/glapi/glapi.h b/src/mesa/glapi/glapi.h index 1ca2e4beff..7dcf2e8910 100644 --- a/src/mesa/glapi/glapi.h +++ b/src/mesa/glapi/glapi.h @@ -165,29 +165,8 @@ extern _glapi_proc _glapi_get_proc_address(const char *funcName); -/** - * GL API local functions and defines - */ - -extern void -init_glapi_relocs_once(void); - -extern void -_glapi_check_table_not_null(const struct _glapi_table *table); - - -extern void -_glapi_check_table(const struct _glapi_table *table); - - extern const char * _glapi_get_proc_name(unsigned int offset); -/* - * Number of extension functions which we can dynamically add at runtime. - */ -#define MAX_EXTENSION_FUNCS 300 - - #endif diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index 2b89a8f4f4..fbf48f1388 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -39,8 +39,9 @@ #endif #include "glapi/glapi.h" -#include "glapi/glapioffsets.h" +#include "glapi/glapi_priv.h" #include "glapi/glapitable.h" +#include "glapi/glapioffsets.h" #if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) @@ -378,6 +379,12 @@ struct _glapi_function { }; +/* + * Number of extension functions which we can dynamically add at runtime. + */ +#define MAX_EXTENSION_FUNCS 300 + + static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; static GLuint NumExtEntryPoints = 0; @@ -766,6 +773,51 @@ _glapi_get_proc_name(GLuint offset) +/********************************************************************** + * GL API table functions. + */ + + +/* + * The dispatch table size (number of entries) is the size of the + * _glapi_table struct plus the number of dynamic entries we can add. + * The extra slots can be filled in by DRI drivers that register new extension + * functions. + */ +#define DISPATCH_TABLE_SIZE (sizeof(struct _glapi_table) / sizeof(void *) + MAX_EXTENSION_FUNCS) + + +/** + * Return size of dispatch table struct as number of functions (or + * slots). + */ +PUBLIC GLuint +_glapi_get_dispatch_table_size(void) +{ + return DISPATCH_TABLE_SIZE; +} + + +/** + * Make sure there are no NULL pointers in the given dispatch table. + * Intended for debugging purposes. + */ +void +_glapi_check_table_not_null(const struct _glapi_table *table) +{ +#ifdef EXTRA_DEBUG /* set to DEBUG for extra DEBUG */ + const GLuint entries = _glapi_get_dispatch_table_size(); + const void **tab = (const void **) table; + GLuint i; + for (i = 1; i < entries; i++) { + assert(tab[i]); + } +#else + (void) table; +#endif +} + + /** * Do some spot checks to be sure that the dispatch table * slots are assigned correctly. For debugging only. @@ -773,7 +825,7 @@ _glapi_get_proc_name(GLuint offset) void _glapi_check_table(const struct _glapi_table *table) { -#if 0 /* enable this for extra DEBUG */ +#ifdef EXTRA_DEBUG /* set to DEBUG for extra DEBUG */ { GLuint BeginOffset = _glapi_get_proc_offset("glBegin"); char *BeginFunc = (char*) &table->Begin; diff --git a/src/mesa/glapi/glapi_priv.h b/src/mesa/glapi/glapi_priv.h new file mode 100644 index 0000000000..05eda99ccf --- /dev/null +++ b/src/mesa/glapi/glapi_priv.h @@ -0,0 +1,43 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +#ifndef _GLAPI_PRIV_H +#define _GLAPI_PRIV_H + +#include "glthread.h" + +extern void +_glapi_check_table_not_null(const struct _glapi_table *table); + + +extern void +_glapi_check_table(const struct _glapi_table *table); + + +extern void +init_glapi_relocs_once(void); + + +#endif -- cgit v1.2.3 From 54ba95a4de749de1da73b3917aac99eb1d57d7fa Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Tue, 9 Mar 2010 22:03:24 +0200 Subject: glapi: split out arch-specific code for entrypoints --- src/mesa/glapi/glapi_entrypoint.c | 331 ++++++++++++++++++++++++++++++++++++++ src/mesa/glapi/glapi_getproc.c | 297 +--------------------------------- src/mesa/glapi/glapi_priv.h | 23 +++ src/mesa/sources.mak | 1 + 4 files changed, 357 insertions(+), 295 deletions(-) create mode 100644 src/mesa/glapi/glapi_entrypoint.c (limited to 'src') diff --git a/src/mesa/glapi/glapi_entrypoint.c b/src/mesa/glapi/glapi_entrypoint.c new file mode 100644 index 0000000000..5e6e5995f2 --- /dev/null +++ b/src/mesa/glapi/glapi_entrypoint.c @@ -0,0 +1,331 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glapi_entrypoint.c + * + * Arch-specific code for manipulating GL API entrypoints (dispatch stubs). + */ + + +#ifdef HAVE_DIX_CONFIG_H +#include +#include "glapi/mesa.h" +#else +#include "main/glheader.h" +#include "main/compiler.h" +#endif + +#include "glapi/glapi.h" +#include "glapi/glapi_priv.h" + + +#ifdef USE_X86_ASM + +#if defined( GLX_USE_TLS ) +extern GLubyte gl_dispatch_functions_start[]; +extern GLubyte gl_dispatch_functions_end[]; +#else +extern const GLubyte gl_dispatch_functions_start[]; +#endif + +#endif /* USE_X86_ASM */ + + +#if defined(DISPATCH_FUNCTION_SIZE) + +_glapi_proc +get_entrypoint_address(GLuint functionOffset) +{ + return (_glapi_proc) (gl_dispatch_functions_start + + (DISPATCH_FUNCTION_SIZE * functionOffset)); +} + +#endif + + +#if defined(PTHREADS) || defined(GLX_USE_TLS) + +/** + * Perform platform-specific GL API entry-point fixups. + */ +static void +init_glapi_relocs( void ) +{ +#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) + extern unsigned long _x86_get_dispatch(void); + char run_time_patch[] = { + 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ + }; + GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ + const GLubyte * const get_disp = (const GLubyte *) run_time_patch; + GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; + + *offset = _x86_get_dispatch(); + while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { + (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); + curr_func += DISPATCH_FUNCTION_SIZE; + } +#endif +#ifdef USE_SPARC_ASM + extern void __glapi_sparc_icache_flush(unsigned int *); + static const unsigned int template[] = { +#ifdef GLX_USE_TLS + 0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */ + 0x8730e00a, /* srl %g3, 10, %g3 */ + 0x8410a000, /* or %g2, %lo(_glapi_tls_Dispatch), %g2 */ +#ifdef __arch64__ + 0xc259c002, /* ldx [%g7 + %g2], %g1 */ + 0xc2584003, /* ldx [%g1 + %g3], %g1 */ +#else + 0xc201c002, /* ld [%g7 + %g2], %g1 */ + 0xc2004003, /* ld [%g1 + %g3], %g1 */ +#endif + 0x81c04000, /* jmp %g1 */ + 0x01000000, /* nop */ +#else +#ifdef __arch64__ + 0x03000000, /* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */ + 0x05000000, /* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */ + 0x82106000, /* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */ + 0x8730e00a, /* 64-bit 0x0c --> srl %g3, 10, %g3 */ + 0x83287020, /* 64-bit 0x10 --> sllx %g1, 32, %g1 */ + 0x82004002, /* 64-bit 0x14 --> add %g1, %g2, %g1 */ + 0xc2586000, /* 64-bit 0x18 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */ +#else + 0x03000000, /* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */ + 0x8730e00a, /* 32-bit 0x04 --> srl %g3, 10, %g3 */ + 0xc2006000, /* 32-bit 0x08 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ +#endif + 0x80a06000, /* --> cmp %g1, 0 */ + 0x02800005, /* --> be +4*5 */ + 0x01000000, /* --> nop */ +#ifdef __arch64__ + 0xc2584003, /* 64-bit --> ldx [%g1 + %g3], %g1 */ +#else + 0xc2004003, /* 32-bit --> ld [%g1 + %g3], %g1 */ +#endif + 0x81c04000, /* --> jmp %g1 */ + 0x01000000, /* --> nop */ +#ifdef __arch64__ + 0x9de3bf80, /* 64-bit --> save %sp, -128, %sp */ +#else + 0x9de3bfc0, /* 32-bit --> save %sp, -64, %sp */ +#endif + 0xa0100003, /* --> mov %g3, %l0 */ + 0x40000000, /* --> call _glapi_get_dispatch */ + 0x01000000, /* --> nop */ + 0x82100008, /* --> mov %o0, %g1 */ + 0x86100010, /* --> mov %l0, %g3 */ + 0x10bffff7, /* --> ba -4*9 */ + 0x81e80000, /* --> restore */ +#endif + }; +#ifdef GLX_USE_TLS + extern unsigned int __glapi_sparc_tls_stub; + extern unsigned long __glapi_sparc_get_dispatch(void); + unsigned int *code = &__glapi_sparc_tls_stub; + unsigned long dispatch = __glapi_sparc_get_dispatch(); +#else + extern unsigned int __glapi_sparc_pthread_stub; + unsigned int *code = &__glapi_sparc_pthread_stub; + unsigned long dispatch = (unsigned long) &_glapi_Dispatch; + unsigned long call_dest = (unsigned long ) &_glapi_get_dispatch; + int idx; +#endif + +#if defined(GLX_USE_TLS) + code[0] = template[0] | (dispatch >> 10); + code[1] = template[1]; + __glapi_sparc_icache_flush(&code[0]); + code[2] = template[2] | (dispatch & 0x3ff); + code[3] = template[3]; + __glapi_sparc_icache_flush(&code[2]); + code[4] = template[4]; + code[5] = template[5]; + __glapi_sparc_icache_flush(&code[4]); + code[6] = template[6]; + __glapi_sparc_icache_flush(&code[6]); +#else +#if defined(__arch64__) + code[0] = template[0] | (dispatch >> (32 + 10)); + code[1] = template[1] | ((dispatch & 0xffffffff) >> 10); + __glapi_sparc_icache_flush(&code[0]); + code[2] = template[2] | ((dispatch >> 32) & 0x3ff); + code[3] = template[3]; + __glapi_sparc_icache_flush(&code[2]); + code[4] = template[4]; + code[5] = template[5]; + __glapi_sparc_icache_flush(&code[4]); + code[6] = template[6] | (dispatch & 0x3ff); + idx = 7; +#else + code[0] = template[0] | (dispatch >> 10); + code[1] = template[1]; + __glapi_sparc_icache_flush(&code[0]); + code[2] = template[2] | (dispatch & 0x3ff); + idx = 3; +#endif + code[idx + 0] = template[idx + 0]; + __glapi_sparc_icache_flush(&code[idx - 1]); + code[idx + 1] = template[idx + 1]; + code[idx + 2] = template[idx + 2]; + __glapi_sparc_icache_flush(&code[idx + 1]); + code[idx + 3] = template[idx + 3]; + code[idx + 4] = template[idx + 4]; + __glapi_sparc_icache_flush(&code[idx + 3]); + code[idx + 5] = template[idx + 5]; + code[idx + 6] = template[idx + 6]; + __glapi_sparc_icache_flush(&code[idx + 5]); + code[idx + 7] = template[idx + 7]; + code[idx + 8] = template[idx + 8] | + (((call_dest - ((unsigned long) &code[idx + 8])) + >> 2) & 0x3fffffff); + __glapi_sparc_icache_flush(&code[idx + 7]); + code[idx + 9] = template[idx + 9]; + code[idx + 10] = template[idx + 10]; + __glapi_sparc_icache_flush(&code[idx + 9]); + code[idx + 11] = template[idx + 11]; + code[idx + 12] = template[idx + 12]; + __glapi_sparc_icache_flush(&code[idx + 11]); + code[idx + 13] = template[idx + 13]; + __glapi_sparc_icache_flush(&code[idx + 13]); +#endif +#endif +} + +void +init_glapi_relocs_once( void ) +{ + static pthread_once_t once_control = PTHREAD_ONCE_INIT; + pthread_once( & once_control, init_glapi_relocs ); +} + +#else + +void +init_glapi_relocs_once( void ) { } + +#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ + + +#ifdef USE_SPARC_ASM +extern void __glapi_sparc_icache_flush(unsigned int *); +#endif + +/** + * Generate a dispatch function (entrypoint) which jumps through + * the given slot number (offset) in the current dispatch table. + * We need assembly language in order to accomplish this. + */ +_glapi_proc +generate_entrypoint(GLuint functionOffset) +{ +#if defined(USE_X86_ASM) + /* 32 is chosen as something of a magic offset. For x86, the dispatch + * at offset 32 is the first one where the offset in the + * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. + */ + const GLubyte * const template_func = gl_dispatch_functions_start + + (DISPATCH_FUNCTION_SIZE * 32); + GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE); + + + if ( code != NULL ) { + (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE); + fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset ); + } + + return (_glapi_proc) code; +#elif defined(USE_SPARC_ASM) + +#if defined(PTHREADS) || defined(GLX_USE_TLS) + static const unsigned int template[] = { + 0x07000000, /* sethi %hi(0), %g3 */ + 0x8210000f, /* mov %o7, %g1 */ + 0x40000000, /* call */ + 0x9e100001, /* mov %g1, %o7 */ + }; +#ifdef GLX_USE_TLS + extern unsigned int __glapi_sparc_tls_stub; + unsigned long call_dest = (unsigned long ) &__glapi_sparc_tls_stub; +#else + extern unsigned int __glapi_sparc_pthread_stub; + unsigned long call_dest = (unsigned long ) &__glapi_sparc_pthread_stub; +#endif + unsigned int *code = (unsigned int *) malloc(sizeof(template)); + if (code) { + code[0] = template[0] | (functionOffset & 0x3fffff); + code[1] = template[1]; + __glapi_sparc_icache_flush(&code[0]); + code[2] = template[2] | + (((call_dest - ((unsigned long) &code[2])) + >> 2) & 0x3fffffff); + code[3] = template[3]; + __glapi_sparc_icache_flush(&code[2]); + } + return (_glapi_proc) code; +#endif + +#else + (void) functionOffset; + return NULL; +#endif /* USE_*_ASM */ +} + + +/** + * This function inserts a new dispatch offset into the assembly language + * stub that was generated with the preceeding function. + */ +void +fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) +{ +#if defined(USE_X86_ASM) + GLubyte * const code = (GLubyte *) entrypoint; + +#if DISPATCH_FUNCTION_SIZE == 32 + *((unsigned int *)(code + 11)) = 4 * offset; + *((unsigned int *)(code + 22)) = 4 * offset; +#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS ) + *((unsigned int *)(code + 8)) = 4 * offset; +#elif DISPATCH_FUNCTION_SIZE == 16 + *((unsigned int *)(code + 7)) = 4 * offset; +#else +# error Invalid DISPATCH_FUNCTION_SIZE! +#endif + +#elif defined(USE_SPARC_ASM) + unsigned int *code = (unsigned int *) entrypoint; + code[0] &= ~0x3fffff; + code[0] |= (offset * sizeof(void *)) & 0x3fffff; + __glapi_sparc_icache_flush(&code[0]); +#else + + /* an unimplemented architecture */ + (void) entrypoint; + (void) offset; + +#endif /* USE_*_ASM */ +} diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index fbf48f1388..bd930b875d 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -44,16 +44,6 @@ #include "glapi/glapioffsets.h" -#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 16 -#elif defined(USE_X86_ASM) -# if defined(THREADS) && !defined(GLX_USE_TLS) -# define DISPATCH_FUNCTION_SIZE 32 -# else -# define DISPATCH_FUNCTION_SIZE 16 -# endif -#endif - #if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) # define NEED_FUNCTION_POINTER #endif @@ -101,18 +91,6 @@ get_static_proc_offset(const char *funcName) } -#ifdef USE_X86_ASM - -#if defined( GLX_USE_TLS ) -extern GLubyte gl_dispatch_functions_start[]; -extern GLubyte gl_dispatch_functions_end[]; -#else -extern const GLubyte gl_dispatch_functions_start[]; -#endif - -#endif /* USE_X86_ASM */ - - #if !defined(XFree86Server) /** @@ -126,12 +104,10 @@ get_static_proc_address(const char *funcName) if (f) { #if defined(DISPATCH_FUNCTION_SIZE) && defined(GLX_INDIRECT_RENDERING) return (f->Address == NULL) - ? (_glapi_proc) (gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * f->Offset)) + ? get_entrypoint_address(f->Offset) : f->Address; #elif defined(DISPATCH_FUNCTION_SIZE) - return (_glapi_proc) (gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * f->Offset)); + return get_entrypoint_address(f->Offset); #else return f->Address; #endif @@ -163,172 +139,6 @@ get_static_proc_name( GLuint offset ) -#if defined(PTHREADS) || defined(GLX_USE_TLS) - -/** - * Perform platform-specific GL API entry-point fixups. - */ -static void -init_glapi_relocs( void ) -{ -#if defined(USE_X86_ASM) && defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) - extern unsigned long _x86_get_dispatch(void); - char run_time_patch[] = { - 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ - }; - GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ - const GLubyte * const get_disp = (const GLubyte *) run_time_patch; - GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; - - *offset = _x86_get_dispatch(); - while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { - (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); - curr_func += DISPATCH_FUNCTION_SIZE; - } -#endif -#ifdef USE_SPARC_ASM - extern void __glapi_sparc_icache_flush(unsigned int *); - static const unsigned int template[] = { -#ifdef GLX_USE_TLS - 0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */ - 0x8730e00a, /* srl %g3, 10, %g3 */ - 0x8410a000, /* or %g2, %lo(_glapi_tls_Dispatch), %g2 */ -#ifdef __arch64__ - 0xc259c002, /* ldx [%g7 + %g2], %g1 */ - 0xc2584003, /* ldx [%g1 + %g3], %g1 */ -#else - 0xc201c002, /* ld [%g7 + %g2], %g1 */ - 0xc2004003, /* ld [%g1 + %g3], %g1 */ -#endif - 0x81c04000, /* jmp %g1 */ - 0x01000000, /* nop */ -#else -#ifdef __arch64__ - 0x03000000, /* 64-bit 0x00 --> sethi %hh(_glapi_Dispatch), %g1 */ - 0x05000000, /* 64-bit 0x04 --> sethi %lm(_glapi_Dispatch), %g2 */ - 0x82106000, /* 64-bit 0x08 --> or %g1, %hm(_glapi_Dispatch), %g1 */ - 0x8730e00a, /* 64-bit 0x0c --> srl %g3, 10, %g3 */ - 0x83287020, /* 64-bit 0x10 --> sllx %g1, 32, %g1 */ - 0x82004002, /* 64-bit 0x14 --> add %g1, %g2, %g1 */ - 0xc2586000, /* 64-bit 0x18 --> ldx [%g1 + %lo(_glapi_Dispatch)], %g1 */ -#else - 0x03000000, /* 32-bit 0x00 --> sethi %hi(_glapi_Dispatch), %g1 */ - 0x8730e00a, /* 32-bit 0x04 --> srl %g3, 10, %g3 */ - 0xc2006000, /* 32-bit 0x08 --> ld [%g1 + %lo(_glapi_Dispatch)], %g1 */ -#endif - 0x80a06000, /* --> cmp %g1, 0 */ - 0x02800005, /* --> be +4*5 */ - 0x01000000, /* --> nop */ -#ifdef __arch64__ - 0xc2584003, /* 64-bit --> ldx [%g1 + %g3], %g1 */ -#else - 0xc2004003, /* 32-bit --> ld [%g1 + %g3], %g1 */ -#endif - 0x81c04000, /* --> jmp %g1 */ - 0x01000000, /* --> nop */ -#ifdef __arch64__ - 0x9de3bf80, /* 64-bit --> save %sp, -128, %sp */ -#else - 0x9de3bfc0, /* 32-bit --> save %sp, -64, %sp */ -#endif - 0xa0100003, /* --> mov %g3, %l0 */ - 0x40000000, /* --> call _glapi_get_dispatch */ - 0x01000000, /* --> nop */ - 0x82100008, /* --> mov %o0, %g1 */ - 0x86100010, /* --> mov %l0, %g3 */ - 0x10bffff7, /* --> ba -4*9 */ - 0x81e80000, /* --> restore */ -#endif - }; -#ifdef GLX_USE_TLS - extern unsigned int __glapi_sparc_tls_stub; - extern unsigned long __glapi_sparc_get_dispatch(void); - unsigned int *code = &__glapi_sparc_tls_stub; - unsigned long dispatch = __glapi_sparc_get_dispatch(); -#else - extern unsigned int __glapi_sparc_pthread_stub; - unsigned int *code = &__glapi_sparc_pthread_stub; - unsigned long dispatch = (unsigned long) &_glapi_Dispatch; - unsigned long call_dest = (unsigned long ) &_glapi_get_dispatch; - int idx; -#endif - -#if defined(GLX_USE_TLS) - code[0] = template[0] | (dispatch >> 10); - code[1] = template[1]; - __glapi_sparc_icache_flush(&code[0]); - code[2] = template[2] | (dispatch & 0x3ff); - code[3] = template[3]; - __glapi_sparc_icache_flush(&code[2]); - code[4] = template[4]; - code[5] = template[5]; - __glapi_sparc_icache_flush(&code[4]); - code[6] = template[6]; - __glapi_sparc_icache_flush(&code[6]); -#else -#if defined(__arch64__) - code[0] = template[0] | (dispatch >> (32 + 10)); - code[1] = template[1] | ((dispatch & 0xffffffff) >> 10); - __glapi_sparc_icache_flush(&code[0]); - code[2] = template[2] | ((dispatch >> 32) & 0x3ff); - code[3] = template[3]; - __glapi_sparc_icache_flush(&code[2]); - code[4] = template[4]; - code[5] = template[5]; - __glapi_sparc_icache_flush(&code[4]); - code[6] = template[6] | (dispatch & 0x3ff); - idx = 7; -#else - code[0] = template[0] | (dispatch >> 10); - code[1] = template[1]; - __glapi_sparc_icache_flush(&code[0]); - code[2] = template[2] | (dispatch & 0x3ff); - idx = 3; -#endif - code[idx + 0] = template[idx + 0]; - __glapi_sparc_icache_flush(&code[idx - 1]); - code[idx + 1] = template[idx + 1]; - code[idx + 2] = template[idx + 2]; - __glapi_sparc_icache_flush(&code[idx + 1]); - code[idx + 3] = template[idx + 3]; - code[idx + 4] = template[idx + 4]; - __glapi_sparc_icache_flush(&code[idx + 3]); - code[idx + 5] = template[idx + 5]; - code[idx + 6] = template[idx + 6]; - __glapi_sparc_icache_flush(&code[idx + 5]); - code[idx + 7] = template[idx + 7]; - code[idx + 8] = template[idx + 8] | - (((call_dest - ((unsigned long) &code[idx + 8])) - >> 2) & 0x3fffffff); - __glapi_sparc_icache_flush(&code[idx + 7]); - code[idx + 9] = template[idx + 9]; - code[idx + 10] = template[idx + 10]; - __glapi_sparc_icache_flush(&code[idx + 9]); - code[idx + 11] = template[idx + 11]; - code[idx + 12] = template[idx + 12]; - __glapi_sparc_icache_flush(&code[idx + 11]); - code[idx + 13] = template[idx + 13]; - __glapi_sparc_icache_flush(&code[idx + 13]); -#endif -#endif -} - -void -init_glapi_relocs_once( void ) -{ - static pthread_once_t once_control = PTHREAD_ONCE_INIT; - pthread_once( & once_control, init_glapi_relocs ); -} - -#else - -void -init_glapi_relocs_once( void ) { } - -#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ - - - /********************************************************************** * Extension function management. */ @@ -388,109 +198,6 @@ struct _glapi_function { static struct _glapi_function ExtEntryTable[MAX_EXTENSION_FUNCS]; static GLuint NumExtEntryPoints = 0; -#ifdef USE_SPARC_ASM -extern void __glapi_sparc_icache_flush(unsigned int *); -#endif - -static void -fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); - -/** - * Generate a dispatch function (entrypoint) which jumps through - * the given slot number (offset) in the current dispatch table. - * We need assembly language in order to accomplish this. - */ -static _glapi_proc -generate_entrypoint(GLuint functionOffset) -{ -#if defined(USE_X86_ASM) - /* 32 is chosen as something of a magic offset. For x86, the dispatch - * at offset 32 is the first one where the offset in the - * "jmp OFFSET*4(%eax)" can't be encoded in a single byte. - */ - const GLubyte * const template_func = gl_dispatch_functions_start - + (DISPATCH_FUNCTION_SIZE * 32); - GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE); - - - if ( code != NULL ) { - (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE); - fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset ); - } - - return (_glapi_proc) code; -#elif defined(USE_SPARC_ASM) - -#if defined(PTHREADS) || defined(GLX_USE_TLS) - static const unsigned int template[] = { - 0x07000000, /* sethi %hi(0), %g3 */ - 0x8210000f, /* mov %o7, %g1 */ - 0x40000000, /* call */ - 0x9e100001, /* mov %g1, %o7 */ - }; -#ifdef GLX_USE_TLS - extern unsigned int __glapi_sparc_tls_stub; - unsigned long call_dest = (unsigned long ) &__glapi_sparc_tls_stub; -#else - extern unsigned int __glapi_sparc_pthread_stub; - unsigned long call_dest = (unsigned long ) &__glapi_sparc_pthread_stub; -#endif - unsigned int *code = (unsigned int *) malloc(sizeof(template)); - if (code) { - code[0] = template[0] | (functionOffset & 0x3fffff); - code[1] = template[1]; - __glapi_sparc_icache_flush(&code[0]); - code[2] = template[2] | - (((call_dest - ((unsigned long) &code[2])) - >> 2) & 0x3fffffff); - code[3] = template[3]; - __glapi_sparc_icache_flush(&code[2]); - } - return (_glapi_proc) code; -#endif - -#else - (void) functionOffset; - return NULL; -#endif /* USE_*_ASM */ -} - - -/** - * This function inserts a new dispatch offset into the assembly language - * stub that was generated with the preceeding function. - */ -static void -fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) -{ -#if defined(USE_X86_ASM) - GLubyte * const code = (GLubyte *) entrypoint; - -#if DISPATCH_FUNCTION_SIZE == 32 - *((unsigned int *)(code + 11)) = 4 * offset; - *((unsigned int *)(code + 22)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS ) - *((unsigned int *)(code + 8)) = 4 * offset; -#elif DISPATCH_FUNCTION_SIZE == 16 - *((unsigned int *)(code + 7)) = 4 * offset; -#else -# error Invalid DISPATCH_FUNCTION_SIZE! -#endif - -#elif defined(USE_SPARC_ASM) - unsigned int *code = (unsigned int *) entrypoint; - code[0] &= ~0x3fffff; - code[0] |= (offset * sizeof(void *)) & 0x3fffff; - __glapi_sparc_icache_flush(&code[0]); -#else - - /* an unimplemented architecture */ - (void) entrypoint; - (void) offset; - -#endif /* USE_*_ASM */ -} - /** * strdup() is actually not a standard ANSI C or POSIX routine. diff --git a/src/mesa/glapi/glapi_priv.h b/src/mesa/glapi/glapi_priv.h index 05eda99ccf..7cd81ee8dc 100644 --- a/src/mesa/glapi/glapi_priv.h +++ b/src/mesa/glapi/glapi_priv.h @@ -40,4 +40,27 @@ extern void init_glapi_relocs_once(void); +extern _glapi_proc +generate_entrypoint(GLuint functionOffset); + + +extern void +fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset); + + +extern _glapi_proc +get_entrypoint_address(GLuint functionOffset); + + +#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS) +# define DISPATCH_FUNCTION_SIZE 16 +#elif defined(USE_X86_ASM) +# if defined(THREADS) && !defined(GLX_USE_TLS) +# define DISPATCH_FUNCTION_SIZE 32 +# else +# define DISPATCH_FUNCTION_SIZE 16 +# endif +#endif + + #endif diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 9f2e4e5157..74885548e5 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -88,6 +88,7 @@ MAIN_SOURCES = \ GLAPI_SOURCES = \ glapi/glapi.c \ glapi/glapi_dispatch.c \ + glapi/glapi_entrypoint.c \ glapi/glapi_getproc.c \ glapi/glapi_nop.c \ glapi/glthread.c -- cgit v1.2.3 From 20ed2445b3b98f2b49a26ad4b45859a908583311 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Tue, 9 Mar 2010 22:03:24 +0200 Subject: glapi: allow for any mangle prefix --- src/mesa/glapi/glapi_getproc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c index bd930b875d..46b466920b 100644 --- a/src/mesa/glapi/glapi_getproc.c +++ b/src/mesa/glapi/glapi_getproc.c @@ -63,7 +63,7 @@ find_entry( const char * n ) for (i = 0; static_functions[i].Name_offset >= 0; i++) { const char *testName = gl_string_table + static_functions[i].Name_offset; #ifdef MANGLE - /* skip the "m" prefix on the name */ + /* skip the prefix on the name */ if (strcmp(testName, n + 1) == 0) #else if (strcmp(testName, n) == 0) @@ -424,7 +424,8 @@ _glapi_get_proc_address(const char *funcName) GLuint i; #ifdef MANGLE - if (funcName[0] != 'm' || funcName[1] != 'g' || funcName[2] != 'l') + /* skip the prefix on the name */ + if (funcName[1] != 'g' || funcName[2] != 'l') return NULL; #else if (funcName[0] != 'g' || funcName[1] != 'l') -- cgit v1.2.3 From 3355ae1925dc3c868ec196d09c3a6121ed77849a Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 9 Mar 2010 20:43:13 +0000 Subject: glapi: Fix scons build -- list new file. --- src/mesa/SConscript | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 0a25dccde5..e80ec5ee88 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -249,6 +249,7 @@ if env['platform'] != 'winddk': glapi_sources = [ 'glapi/glapi.c', 'glapi/glapi_dispatch.c', + 'glapi/glapi_entrypoint.c', 'glapi/glapi_getproc.c', 'glapi/glapi_nop.c', 'glapi/glthread.c', -- cgit v1.2.3 From ac2b7835d5e61629f0a1f8b6c35eb1efa2ffbfa2 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 9 Mar 2010 21:41:00 +0100 Subject: radeon: add hw accelerated glReadPixel support (not enabled yet) --- src/mesa/drivers/dri/r200/Makefile | 1 + src/mesa/drivers/dri/r200/radeon_pixel_read.c | 1 + src/mesa/drivers/dri/r300/Makefile | 3 +- src/mesa/drivers/dri/r300/radeon_pixel_read.c | 1 + src/mesa/drivers/dri/r600/Makefile | 3 +- src/mesa/drivers/dri/r600/radeon_pixel_read.c | 1 + src/mesa/drivers/dri/radeon/Makefile | 1 + src/mesa/drivers/dri/radeon/radeon_common.h | 6 + src/mesa/drivers/dri/radeon/radeon_pixel_read.c | 188 ++++++++++++++++++++++++ 9 files changed, 203 insertions(+), 2 deletions(-) create mode 120000 src/mesa/drivers/dri/r200/radeon_pixel_read.c create mode 120000 src/mesa/drivers/dri/r300/radeon_pixel_read.c create mode 120000 src/mesa/drivers/dri/r600/radeon_pixel_read.c create mode 100644 src/mesa/drivers/dri/radeon/radeon_pixel_read.c (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index 3f87100570..9ea81fd505 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -21,6 +21,7 @@ RADEON_COMMON_SOURCES = \ radeon_fbo.c \ radeon_lock.c \ radeon_mipmap_tree.c \ + radeon_pixel_read.c \ radeon_queryobj.c \ radeon_span.c \ radeon_texture.c \ diff --git a/src/mesa/drivers/dri/r200/radeon_pixel_read.c b/src/mesa/drivers/dri/r200/radeon_pixel_read.c new file mode 120000 index 0000000000..3b03803126 --- /dev/null +++ b/src/mesa/drivers/dri/r200/radeon_pixel_read.c @@ -0,0 +1 @@ +../radeon/radeon_pixel_read.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 4257a32b89..2245998c95 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -31,8 +31,9 @@ RADEON_COMMON_SOURCES = \ radeon_fbo.c \ radeon_lock.c \ radeon_mipmap_tree.c \ - radeon_span.c \ + radeon_pixel_read.c \ radeon_queryobj.c \ + radeon_span.c \ radeon_texture.c \ radeon_tex_copy.c \ radeon_tex_getimage.c \ diff --git a/src/mesa/drivers/dri/r300/radeon_pixel_read.c b/src/mesa/drivers/dri/r300/radeon_pixel_read.c new file mode 120000 index 0000000000..3b03803126 --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_pixel_read.c @@ -0,0 +1 @@ +../radeon/radeon_pixel_read.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index f76859d11e..17915621ee 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -31,9 +31,10 @@ RADEON_COMMON_SOURCES = \ radeon_fbo.c \ radeon_lock.c \ radeon_mipmap_tree.c \ + radeon_pixel_read.c \ + radeon_queryobj.c \ radeon_span.c \ radeon_texture.c \ - radeon_queryobj.c \ radeon_tex_copy.c \ radeon_tex_getimage.c \ radeon_tile.c diff --git a/src/mesa/drivers/dri/r600/radeon_pixel_read.c b/src/mesa/drivers/dri/r600/radeon_pixel_read.c new file mode 120000 index 0000000000..3b03803126 --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_pixel_read.c @@ -0,0 +1 @@ +../radeon/radeon_pixel_read.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index 6904ebbee3..19df62742e 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -22,6 +22,7 @@ RADEON_COMMON_SOURCES = \ radeon_fbo.c \ radeon_lock.c \ radeon_mipmap_tree.c \ + radeon_pixel_read.c \ radeon_queryobj.c \ radeon_span.c \ radeon_texture.c \ diff --git a/src/mesa/drivers/dri/radeon/radeon_common.h b/src/mesa/drivers/dri/radeon/radeon_common.h index cd01c9984e..35b3f08fff 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.h +++ b/src/mesa/drivers/dri/radeon/radeon_common.h @@ -44,6 +44,12 @@ radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb, struct radeon_renderbuffer * radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv); +void +radeonReadPixels(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, GLvoid * pixels); + void radeon_check_front_buffer_rendering(GLcontext *ctx); static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb) { diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c new file mode 100644 index 0000000000..27841938e6 --- /dev/null +++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2010 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "stdint.h" +#include "main/bufferobj.h" +#include "main/enums.h" +#include "main/image.h" +#include "main/state.h" +#include "swrast/swrast.h" + +#include "radeon_common_context.h" +#include "radeon_debug.h" +#include "radeon_mipmap_tree.h" + +static gl_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type) +{ + switch (format) + { + case GL_RGB: + switch (type) { + case GL_UNSIGNED_SHORT_5_6_5: + return MESA_FORMAT_RGB565; + case GL_UNSIGNED_SHORT_5_6_5_REV: + return MESA_FORMAT_RGB565_REV; + } + break; + case GL_RGBA: + switch (type) { + case GL_UNSIGNED_BYTE: + return MESA_FORMAT_RGBA8888_REV; + case GL_FLOAT: + return MESA_FORMAT_RGBA_FLOAT32; + case GL_UNSIGNED_SHORT_4_4_4_4: + return MESA_FORMAT_ARGB4444; + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + return MESA_FORMAT_ARGB4444; + case GL_UNSIGNED_SHORT_5_5_5_1: + return MESA_FORMAT_RGBA5551; + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + return MESA_FORMAT_ARGB1555_REV; + case GL_UNSIGNED_INT_8_8_8_8: + return MESA_FORMAT_ARGB8888; + case GL_UNSIGNED_INT_8_8_8_8_REV: + return MESA_FORMAT_ARGB8888_REV; + } + break; + } + + return MESA_FORMAT_NONE; +} + +static GLboolean +do_blit_readpixels(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, GLvoid * pixels) +{ + radeonContextPtr radeon = RADEON_CONTEXT(ctx); + const struct radeon_renderbuffer *rrb = radeon_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer); + const gl_format dst_format = gl_format_and_type_to_mesa_format(format, type); + unsigned dst_rowstride, dst_imagesize, aligned_rowstride, flip_y; + struct radeon_bo *dst_buffer; + GLint dst_x = 0, dst_y = 0; + + /* It's not worth if number of pixels to copy is really small */ + if (width * height < 100) { + return GL_FALSE; + } + + if (dst_format == MESA_FORMAT_NONE || + !radeon->vtbl.check_blit(dst_format) || !radeon->vtbl.blit) { + return GL_FALSE; + } + + if (ctx->_ImageTransferState) { + return GL_FALSE; + } + + if (pack->SwapBytes || pack->LsbFirst) { + return GL_FALSE; + } + + if (pack->RowLength > 0) { + dst_rowstride = pack->RowLength; + } else { + dst_rowstride = width; + } + + if (!_mesa_clip_copytexsubimage(ctx, &dst_x, &dst_y, &x, &y, &width, &height)) { + return GL_TRUE; + } + assert(x >= 0 && y >= 0); + + aligned_rowstride = get_texture_image_row_stride(radeon, dst_format, dst_rowstride, 0); + dst_imagesize = get_texture_image_size(dst_format, + aligned_rowstride, + height, 1, 0); + dst_buffer = radeon_bo_open(radeon->radeonScreen->bom, 0, dst_imagesize, 1024, RADEON_GEM_DOMAIN_GTT, 0); + + /* Disable source Y flipping for FBOs */ + flip_y = (ctx->ReadBuffer->Name == 0); + if (pack->Invert) { + y = rrb->base.Height - height - y; + flip_y = !flip_y; + } + + if (radeon->vtbl.blit(ctx, + rrb->bo, + rrb->draw_offset, + rrb->base.Format, + rrb->pitch / rrb->cpp, + rrb->base.Width, + rrb->base.Height, + x, + y, + dst_buffer, + 0, /* dst_offset */ + dst_format, + aligned_rowstride / _mesa_get_format_bytes(dst_format), + width, + height, + 0, /* dst_x */ + 0, /* dst_y */ + width, + height, + flip_y)) + { + radeon_bo_map(dst_buffer, 0); + dst_rowstride *= _mesa_get_format_bytes(dst_format); + copy_rows(pixels, dst_rowstride, dst_buffer->ptr, + aligned_rowstride, height, dst_rowstride); + radeon_bo_unmap(dst_buffer); + radeon_bo_unref(dst_buffer); + return GL_TRUE; + } else { + radeon_bo_unref(dst_buffer); + return GL_FALSE; + } +} + +void +radeonReadPixels(GLcontext * ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *pack, GLvoid * pixels) +{ + if (do_blit_readpixels(ctx, x, y, width, height, format, type, pack, pixels)) + return; + + /* Update Mesa state before calling down into _swrast_ReadPixels, as + * the spans code requires the computed buffer states to be up to date, + * but _swrast_ReadPixels only updates Mesa state after setting up + * the spans code. + */ + + radeon_print(RADEON_FALLBACKS, RADEON_NORMAL, + "Falling back to sw for ReadPixels (format %s, type %s)\n", + _mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type)); + + if (ctx->NewState) + _mesa_update_state(ctx); + + _swrast_ReadPixels(ctx, x, y, width, height, format, type, pack, pixels); +} -- cgit v1.2.3 From 67108b5d12e0526ebedcdf2dbeeadfdbd0782161 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 9 Mar 2010 21:42:00 +0100 Subject: r300: enable HW accelerated gl(Read/Copy/Draw)Pixels --- src/mesa/drivers/dri/r300/r300_state.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 5979dedac4..8739dcbafb 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -46,6 +46,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/simple_list.h" #include "main/api_arrayelt.h" +#include "drivers/common/meta.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "shader/prog_parameter.h" @@ -2326,8 +2327,12 @@ void r300InitStateFuncs(struct dd_function_table *functions) functions->ClipPlane = r300ClipPlane; functions->Scissor = radeonScissor; - functions->DrawBuffer = radeonDrawBuffer; - functions->ReadBuffer = radeonReadBuffer; + functions->DrawBuffer = radeonDrawBuffer; + functions->ReadBuffer = radeonReadBuffer; + + functions->CopyPixels = _mesa_meta_CopyPixels; + functions->DrawPixels = _mesa_meta_DrawPixels; + functions->ReadPixels = radeonReadPixels; } void r300InitShaderFunctions(r300ContextPtr r300) -- cgit v1.2.3 From a17563c7ddfa58fe7f09d22a62a10f3488ef3147 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 14:34:21 +0100 Subject: radeon/r200/r300/r600: add is_format_renderable function --- src/mesa/drivers/dri/r200/r200_context.c | 1 + src/mesa/drivers/dri/r300/r300_context.c | 6 ++++ src/mesa/drivers/dri/r300/r300_tex.c | 39 ++++++++++++++++++++++ src/mesa/drivers/dri/r300/r300_tex.h | 3 ++ src/mesa/drivers/dri/r600/r600_context.c | 1 + .../drivers/dri/radeon/radeon_common_context.h | 1 + src/mesa/drivers/dri/radeon/radeon_context.c | 1 + src/mesa/drivers/dri/radeon/radeon_texture.c | 16 +++++++++ src/mesa/drivers/dri/radeon/radeon_texture.h | 2 ++ 9 files changed, 70 insertions(+) (limited to 'src') diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index dad2580e08..4f1a56658c 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -266,6 +266,7 @@ static void r200_init_vtbl(radeonContextPtr radeon) radeon->vtbl.emit_query_finish = r200_emit_query_finish; radeon->vtbl.check_blit = r200_check_blit; radeon->vtbl.blit = r200_blit; + radeon->vtbl.is_format_renderable = radeonIsFormatRenderable; } diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index ff35cd5275..364e0ba6b6 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -321,6 +321,12 @@ static void r300_init_vtbl(radeonContextPtr radeon) radeon->vtbl.check_blit = r300_check_blit; radeon->vtbl.blit = r300_blit; + + if (radeon->radeonScreen->chip_family >= CHIP_FAMILY_RV515) { + radeon->vtbl.is_format_renderable = r500IsFormatRenderable; + } else { + radeon->vtbl.is_format_renderable = r300IsFormatRenderable; + } } static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen) diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 8dd8507395..baef206bc2 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -308,6 +308,45 @@ static struct gl_texture_object *r300NewTextureObject(GLcontext * ctx, return &t->base; } +unsigned r300IsFormatRenderable(gl_format mesa_format) +{ + switch (mesa_format) + { + case MESA_FORMAT_RGB565: + case MESA_FORMAT_RGBA5551: + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGB565_REV: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_ARGB4444_REV: + case MESA_FORMAT_ARGB1555_REV: + case MESA_FORMAT_XRGB8888_REV: + case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: + case MESA_FORMAT_SL8: + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_Z16: + return 1; + default: + return 0; + } +} + +unsigned r500IsFormatRenderable(gl_format mesa_format) +{ + if (mesa_format == MESA_FORMAT_S8_Z24) { + return 1; + } else { + return r300IsFormatRenderable(mesa_format); + } +} + void r300InitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions) { /* Note: we only plug in the functions we implement in the driver diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h index 9694e703b8..aca44cd766 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.h +++ b/src/mesa/drivers/dri/r300/r300_tex.h @@ -53,4 +53,7 @@ extern void r300InitTextureFuncs(radeonContextPtr radeon, struct dd_function_tab int32_t r300TranslateTexFormat(gl_format mesaFormat); +unsigned r300IsFormatRenderable(gl_format mesaFormat); +unsigned r500IsFormatRenderable(gl_format mesaFormat); + #endif /* __r300_TEX_H__ */ diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 134e97e7c3..76d5027649 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -239,6 +239,7 @@ static void r600_init_vtbl(radeonContextPtr radeon) radeon->vtbl.emit_query_finish = r600_emit_query_finish; radeon->vtbl.check_blit = r600_check_blit; radeon->vtbl.blit = r600_blit; + radeon->vtbl.is_format_renderable = radeonIsFormatRenderable; } static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index d1a24e265f..5156c5d0d0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -539,6 +539,7 @@ struct radeon_context { unsigned reg_width, unsigned reg_height, unsigned flip_y); + unsigned (*is_format_renderable)(gl_format mesa_format); } vtbl; }; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 878a453bd5..56aba16e9e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -200,6 +200,7 @@ static void r100_init_vtbl(radeonContextPtr radeon) radeon->vtbl.emit_query_finish = r100_emit_query_finish; radeon->vtbl.check_blit = r100_check_blit; radeon->vtbl.blit = r100_blit; + radeon->vtbl.is_format_renderable = radeonIsFormatRenderable; } /* Create the device specific context. diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 3ccc711253..2b655fbd95 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -1006,3 +1006,19 @@ void radeonTexSubImage3D(GLcontext * ctx, GLenum target, GLint level, radeon_texsubimage(ctx, 3, target, level, xoffset, yoffset, zoffset, width, height, depth, 0, format, type, pixels, packing, texObj, texImage, 0); } + +unsigned radeonIsFormatRenderable(gl_format mesa_format) +{ + if (mesa_format == _dri_texformat_argb8888 || mesa_format == _dri_texformat_rgb565 || + mesa_format == _dri_texformat_argb1555 || mesa_format == _dri_texformat_argb4444) + return 1; + + switch (mesa_format) + { + case MESA_FORMAT_Z16: + case MESA_FORMAT_S8_Z24: + return 1; + default: + return 0; + } +} diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h index f09dd65214..4ce639ea34 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.h +++ b/src/mesa/drivers/dri/radeon/radeon_texture.h @@ -135,4 +135,6 @@ void radeonCopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height); +unsigned radeonIsFormatRenderable(gl_format mesa_format); + #endif -- cgit v1.2.3 From fd05067c9912e7ee83058a48d6e4c2cd7f262665 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 14:26:21 +0100 Subject: r300: add support for more rendering formats --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 35 ++++++++++--------- src/mesa/drivers/dri/r300/r300_state.c | 61 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 6cfa5686f4..e2dbb1dbf4 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -332,36 +332,37 @@ void r300_emit_cb_setup(struct r300_context *r300, assert(offset % 32 == 0); switch (format) { - case MESA_FORMAT_RGB565: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_RGB565; + case MESA_FORMAT_SL8: + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + cbpitch |= R300_COLOR_FORMAT_I8; break; + case MESA_FORMAT_RGB565: case MESA_FORMAT_RGB565_REV: - assert(!_mesa_little_endian()); cbpitch |= R300_COLOR_FORMAT_RGB565; break; case MESA_FORMAT_ARGB4444: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB4444; - break; case MESA_FORMAT_ARGB4444_REV: - assert(!_mesa_little_endian()); cbpitch |= R300_COLOR_FORMAT_ARGB4444; break; + case MESA_FORMAT_RGBA5551: case MESA_FORMAT_ARGB1555: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB1555; - break; case MESA_FORMAT_ARGB1555_REV: - assert(!_mesa_little_endian()); cbpitch |= R300_COLOR_FORMAT_ARGB1555; break; + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888_REV: + case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: + cbpitch |= R300_COLOR_FORMAT_ARGB8888; + break; default: - if (cpp == 4) { - cbpitch |= R300_COLOR_FORMAT_ARGB8888; - } else { - _mesa_problem(r300->radeon.glCtx, "unexpected format in emit_cb_offset()");; - } + _mesa_problem(r300->radeon.glCtx, "unexpected format in emit_cb_offset()"); break; } diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 8739dcbafb..bdd12c6d22 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2238,6 +2238,63 @@ void r300UpdateShaderStates(r300ContextPtr rmesa) } } +#define EASY_US_OUT_FMT(comps, c0, c1, c2, c3) \ + (R500_OUT_FMT_##comps | R500_C0_SEL_##c0 | R500_C1_SEL_##c1 | \ + R500_C2_SEL_##c2 | R500_C3_SEL_##c3) +static void r300SetupUsOutputFormat(GLcontext *ctx) +{ + r300ContextPtr rmesa = R300_CONTEXT(ctx); + uint32_t hw_format; + + switch (radeon_get_colorbuffer(&rmesa->radeon)->base.Format) + { + case MESA_FORMAT_RGBA5551: + case MESA_FORMAT_RGBA8888: + hw_format = EASY_US_OUT_FMT(C4_8, A, B, G, R); + break; + case MESA_FORMAT_RGB565_REV: + case MESA_FORMAT_RGBA8888_REV: + hw_format = EASY_US_OUT_FMT(C4_8, R, G, B, A); + break; + case MESA_FORMAT_RGB565: + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_ARGB8888: + hw_format = EASY_US_OUT_FMT(C4_8, B, G, R, A); + break; + case MESA_FORMAT_ARGB4444_REV: + case MESA_FORMAT_ARGB1555_REV: + case MESA_FORMAT_XRGB8888_REV: + case MESA_FORMAT_ARGB8888_REV: + hw_format = EASY_US_OUT_FMT(C4_8, A, R, G, B); + break; + case MESA_FORMAT_SRGBA8: + hw_format = EASY_US_OUT_FMT(C4_10_GAMMA, A, B, G, R); + break; + case MESA_FORMAT_SARGB8: + hw_format = EASY_US_OUT_FMT(C4_10_GAMMA, B, G, R, A); + break; + case MESA_FORMAT_SL8: + hw_format = EASY_US_OUT_FMT(C4_10_GAMMA, A, A, R, A); + break; + case MESA_FORMAT_A8: + hw_format = EASY_US_OUT_FMT(C4_8, A, A, A, A); + break; + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + hw_format = EASY_US_OUT_FMT(C4_8, A, A, R, A); + break; + default: + assert(!"Unsupported format"); + break; + } + + R300_STATECHANGE(rmesa, us_out_fmt); + rmesa->hw.us_out_fmt.cmd[1] = hw_format; +} +#undef EASY_US_OUT_FMT + /** * Called by Mesa after an internal state update. */ @@ -2267,6 +2324,10 @@ static void r300InvalidateState(GLcontext * ctx, GLuint new_state) r300->hw.shade2.cmd[1] &= ~R300_GA_COLOR_CONTROL_PROVOKING_VERTEX_LAST; } + if (new_state & _NEW_BUFFERS) { + r300SetupUsOutputFormat(ctx); + } + r300->radeon.NewGLState |= new_state; } -- cgit v1.2.3 From b70dcabafce0c1a8a9fbbd84ff196e46b0782ca7 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 7 Mar 2010 22:01:56 +0100 Subject: radeon: mark framebuffer as incomplete if renderbuffer format isn't supported by hw --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 126 +++++++++++------------ src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 3 - 2 files changed, 62 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 46664a1755..6398605835 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -409,82 +409,51 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx, radeon_draw_buffer(ctx, fb); } - -/* TODO: According to EXT_fbo spec internal format of texture image - * once set during glTexImage call, should be preserved when - * attaching image to renderbuffer. When HW doesn't support - * rendering to format of attached image, set framebuffer - * completeness accordingly in radeon_validate_framebuffer (issue #79). - */ static GLboolean radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, struct gl_texture_image *texImage) { - int retry = 0; - gl_format texFormat; - radeon_print(RADEON_TEXTURE, RADEON_TRACE, - "%s(%p, rrb %p, texImage %p) \n", - __func__, ctx, rrb, texImage); - -restart: - if (texImage->TexFormat == _dri_texformat_argb8888) { - rrb->base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to RGBA8 texture OK\n"); + "%s(%p, rrb %p, texImage %p, texFormat %s) \n", + __func__, ctx, rrb, texImage, _mesa_get_format_name(texImage->TexFormat)); + + switch (texImage->TexFormat) { + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_XRGB8888: + case MESA_FORMAT_XRGB8888_REV: + case MESA_FORMAT_RGB565: + case MESA_FORMAT_RGB565_REV: + case MESA_FORMAT_RGBA5551: + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_ARGB1555_REV: + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB4444_REV: + rrb->base.DataType = GL_UNSIGNED_BYTE; + break; + case MESA_FORMAT_Z16: + rrb->base.DataType = GL_UNSIGNED_SHORT; + break; + case MESA_FORMAT_X8_Z24: + rrb->base.DataType = GL_UNSIGNED_INT; + break; + case MESA_FORMAT_S8_Z24: + rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; + break; } - else if (texImage->TexFormat == _dri_texformat_rgb565) { - rrb->base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to RGB5 texture OK\n"); - } - else if (texImage->TexFormat == _dri_texformat_argb1555) { - rrb->base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to ARGB1555 texture OK\n"); - } - else if (texImage->TexFormat == _dri_texformat_argb4444) { - rrb->base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to ARGB4444 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_Z16) { - rrb->base.DataType = GL_UNSIGNED_SHORT; - DBG("Render to DEPTH16 texture OK\n"); - } - else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) { - rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; - DBG("Render to DEPTH_STENCIL texture OK\n"); - } - else { - /* try redoing the FBO */ - if (retry == 1) { - DBG("Render to texture BAD FORMAT %d\n", - texImage->TexFormat); - return GL_FALSE; - } - /* XXX why is the tex format being set here? - * I think this can be removed. - */ - texImage->TexFormat = radeonChooseTextureFormat(ctx, texImage->InternalFormat, 0, - _mesa_get_format_datatype(texImage->TexFormat), - 1); - - retry++; - goto restart; - } - - texFormat = texImage->TexFormat; - - rrb->base.Format = texFormat; - - rrb->cpp = _mesa_get_format_bytes(texFormat); + + rrb->cpp = _mesa_get_format_bytes(texImage->TexFormat); rrb->pitch = texImage->Width * rrb->cpp; + rrb->base.Format = texImage->TexFormat; rrb->base.InternalFormat = texImage->InternalFormat; - rrb->base._BaseFormat = _mesa_base_fbo_format(ctx, rrb->base.InternalFormat); - + rrb->base._BaseFormat = _mesa_base_fbo_format(ctx, rrb->base.InternalFormat); rrb->base.Width = texImage->Width; rrb->base.Height = texImage->Height; - rrb->base.Delete = radeon_delete_renderbuffer; rrb->base.AllocStorage = radeon_nop_alloc_storage; - + return GL_TRUE; } @@ -607,6 +576,35 @@ radeon_finish_render_texture(GLcontext * ctx, static void radeon_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) { + radeonContextPtr radeon = RADEON_CONTEXT(ctx); + gl_format mesa_format; + int i; + + for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { + struct gl_renderbuffer_attachment *att; + if (i == -2) { + att = &fb->Attachment[BUFFER_DEPTH]; + } else if (i == -1) { + att = &fb->Attachment[BUFFER_STENCIL]; + } else { + att = &fb->Attachment[BUFFER_COLOR0 + i]; + } + + if (att->Type == GL_TEXTURE) { + mesa_format = att->Texture->Image[att->CubeMapFace][att->TextureLevel]->TexFormat; + } else { + /* All renderbuffer formats are renderable, but not sampable */ + continue; + } + + if (!radeon->vtbl.is_format_renderable(mesa_format)){ + fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED; + radeon_print(RADEON_TEXTURE, RADEON_TRACE, + "%s: HW doesn't support format %s as output format of attachment %d\n", + __FUNCTION__, _mesa_get_format_name(mesa_format), i); + return; + } + } } void radeon_fbo_init(struct radeon_context *radeon) diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index c6cc417dd6..78c5f5dd57 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -468,12 +468,9 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel]; - /* TODO: bring back these assertions once the FBOs are fixed */ -#if 0 assert(image->mtlevel == level); assert(srclvl->size == dstlvl->size); assert(srclvl->rowstride == dstlvl->rowstride); -#endif radeon_bo_map(image->mt->bo, GL_FALSE); -- cgit v1.2.3 From eeaf1e0519912b2ca3a8bce56c35548f9e0b73ca Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 9 Mar 2010 23:13:19 +0100 Subject: r300: don't crash if there's no colorbuffer --- src/mesa/drivers/dri/r300/r300_state.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index bdd12c6d22..8748941241 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2245,8 +2245,13 @@ static void r300SetupUsOutputFormat(GLcontext *ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); uint32_t hw_format; + struct radeon_renderbuffer *rrb = radeon_get_colorbuffer(&rmesa->radeon); - switch (radeon_get_colorbuffer(&rmesa->radeon)->base.Format) + if (!rrb) { + return; + } + + switch (rrb->base.Format) { case MESA_FORMAT_RGBA5551: case MESA_FORMAT_RGBA8888: -- cgit v1.2.3 From 7f6d2754d586545ab6c970acffdd897294879039 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 8 Mar 2010 16:08:33 -0800 Subject: i965: Fix up VP constbuf leak on program delete. --- src/mesa/drivers/dri/i965/brw_program.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index c78f7b38ae..1fd957b3ad 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -95,9 +95,17 @@ static void brwDeleteProgram( GLcontext *ctx, struct gl_program *prog ) { if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) { - struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog; - struct brw_fragment_program *brw_fprog = brw_fragment_program(fprog); - dri_bo_unreference(brw_fprog->const_buffer); + struct gl_fragment_program *fp = (struct gl_fragment_program *) prog; + struct brw_fragment_program *brw_fp = brw_fragment_program(fp); + + dri_bo_unreference(brw_fp->const_buffer); + } + + if (prog->Target == GL_VERTEX_PROGRAM_ARB) { + struct gl_vertex_program *vp = (struct gl_vertex_program *) prog; + struct brw_vertex_program *brw_vp = brw_vertex_program(vp); + + dri_bo_unreference(brw_vp->const_buffer); } _mesa_delete_program( ctx, prog ); -- cgit v1.2.3 From f6f547d87ea68f44c50a0b0231b7360ca94b2975 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 9 Mar 2010 09:56:42 -0800 Subject: i965: Fix nested loops in the VS. We were patching up all the break and continues between the start of our loop and the end of our loop, even if they were breaks/continues for an inner loop. Avoiding patching already patched breaks/continues fixes piglit glsl-vs-loop-nested. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index a7c4b58972..a48804a660 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -1717,11 +1717,13 @@ void brw_vs_emit(struct brw_vs_compile *c ) /* patch all the BREAK/CONT instructions from last BEGINLOOP */ while (inst0 > loop_inst[loop_depth]) { inst0--; - if (inst0->header.opcode == BRW_OPCODE_BREAK) { + if (inst0->header.opcode == BRW_OPCODE_BREAK && + inst0->bits3.if_else.jump_count == 0) { inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); inst0->bits3.if_else.pop_count = 0; } - else if (inst0->header.opcode == BRW_OPCODE_CONTINUE) { + else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && + inst0->bits3.if_else.jump_count == 0) { inst0->bits3.if_else.jump_count = br * (inst1 - inst0); inst0->bits3.if_else.pop_count = 0; } -- cgit v1.2.3 From 280abdacf900d591ef909cf697f0c5679389c3f6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 9 Mar 2010 11:31:28 -0800 Subject: i965: Print the offsets for WHILE and BREAK in disasm. --- src/mesa/drivers/dri/i965/brw_disasm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index a8f6b993ac..54699cf8d3 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -74,9 +74,9 @@ struct { [BRW_OPCODE_JMPI] = { .name = "jmpi", .nsrc = 1, .ndst = 0 }, [BRW_OPCODE_IF] = { .name = "if", .nsrc = 2, .ndst = 0 }, [BRW_OPCODE_IFF] = { .name = "iff", .nsrc = 1, .ndst = 01 }, - [BRW_OPCODE_WHILE] = { .name = "while", .nsrc = 1, .ndst = 0 }, + [BRW_OPCODE_WHILE] = { .name = "while", .nsrc = 2, .ndst = 0 }, [BRW_OPCODE_ELSE] = { .name = "else", .nsrc = 2, .ndst = 0 }, - [BRW_OPCODE_BREAK] = { .name = "break", .nsrc = 1, .ndst = 0 }, + [BRW_OPCODE_BREAK] = { .name = "break", .nsrc = 2, .ndst = 0 }, [BRW_OPCODE_CONTINUE] = { .name = "cont", .nsrc = 1, .ndst = 0 }, [BRW_OPCODE_HALT] = { .name = "halt", .nsrc = 1, .ndst = 0 }, [BRW_OPCODE_MSAVE] = { .name = "msave", .nsrc = 1, .ndst = 1 }, -- cgit v1.2.3 From 6b194dab6b4d9f12cdd54c699b23c0d3420a49c2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 9 Mar 2010 11:56:14 -0800 Subject: i965: Unalias all GLSL source regs from the destination regs used. We were doing it ad-hoc before, as instructions with potential aliasing problems were identified. But thanks to swizzling basically anything can have aliasing, so just do it generally at source reg setup time. This is somewhat inefficient, because sometimes an operation doesn't need unaliasing protection if the swizzling is safe, but the unaliasing before didn't cover those cases either. Fixes piglit glsl-fs-loop. --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 138 ++++++-------------------------- 1 file changed, 25 insertions(+), 113 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 562608e2ec..13306accda 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -614,112 +614,6 @@ static void invoke_subroutine( struct brw_wm_compile *c, } } -/* Workaround for using brw_wm_emit.c's emit functions, which expect - * destination regs to be uniquely written. Moves arguments out to - * temporaries as necessary for instructions which use their destination as - * a temporary. - */ -static void -unalias3(struct brw_wm_compile *c, - void (*func)(struct brw_compile *c, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1, - const struct brw_reg *arg2), - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1, - const struct brw_reg *arg2) -{ - struct brw_compile *p = &c->func; - struct brw_reg tmp_arg0[4], tmp_arg1[4], tmp_arg2[4]; - int i, j; - int mark = mark_tmps(c); - - for (j = 0; j < 4; j++) { - tmp_arg0[j] = arg0[j]; - tmp_arg1[j] = arg1[j]; - tmp_arg2[j] = arg2[j]; - } - - for (i = 0; i < 4; i++) { - if (mask & (1<func; - struct brw_reg tmp_arg0[4], tmp_arg1[4]; - int i, j; - int mark = mark_tmps(c); - - for (j = 0; j < 4; j++) { - tmp_arg0[j] = arg0[j]; - tmp_arg1[j] = arg1[j]; - } - - for (i = 0; i < 4; i++) { - if (mask & (1<func; + int i, j; for (i = 0; i < 4; i++) { - if (mask & (1 << i)) + if (mask & (1 << i)) { regs[i] = get_src_reg(c, inst, index, i); + + /* Unalias destination registers from our sources. */ + if (regs[i].file == BRW_GENERAL_REGISTER_FILE) { + for (j = 0; j < 4; j++) { + if (memcmp(®s[i], &dst[j], sizeof(regs[0])) == 0) { + struct brw_reg tmp = alloc_tmp(c); + brw_MOV(p, tmp, regs[i]); + regs[i] = tmp; + break; + } + } + } + } } } @@ -1845,6 +1754,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) int dst_flags; struct brw_reg args[3][4], dst[4]; int j; + int mark = mark_tmps( c ); c->cur_inst = i; @@ -1866,7 +1776,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) } } for (j = 0; j < brw_wm_nr_args(inst->Opcode); j++) - get_argument_regs(c, inst, j, args[j], WRITEMASK_XYZW); + get_argument_regs(c, inst, j, dst, args[j], WRITEMASK_XYZW); dst_flags = inst->DstReg.WriteMask; if (inst->SaturateMode == SATURATE_ZERO_ONE) @@ -1920,8 +1830,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_alu1(p, brw_RNDD, dst, dst_flags, args[0]); break; case OPCODE_LRP: - unalias3(c, emit_lrp, - dst, dst_flags, args[0], args[1], args[2]); + emit_lrp(p, dst, dst_flags, args[0], args[1], args[2]); break; case OPCODE_TRUNC: emit_alu1(p, brw_RNDZ, dst, dst_flags, args[0]); @@ -1961,10 +1870,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_math1(c, BRW_MATH_FUNCTION_LOG, dst, dst_flags, args[0]); break; case OPCODE_MIN: - unalias2(c, emit_min, dst, dst_flags, args[0], args[1]); + emit_min(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_MAX: - unalias2(c, emit_max, dst, dst_flags, args[0], args[1]); + emit_max(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_DDX: case OPCODE_DDY: @@ -2119,6 +2028,9 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) inst->Opcode); } + /* Release temporaries containing any unaliased source regs. */ + release_tmps( c, mark ); + if (inst->CondUpdate) brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); else -- cgit v1.2.3 From a81836ee2fe5092d695b717addf8cec91f569777 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 9 Mar 2010 14:22:51 -0800 Subject: i965: Fix ENDLOOP to only patch up this loop's BREAK and CONT. Corresponds to d225a25e21a24508aea3b877c78beb35502e942d and fixes piglit glsl-fs-loop-nested. Bug #25173. --- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 13306accda..ea3c2405af 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -2012,11 +2012,13 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) /* patch all the BREAK/CONT instructions from last BGNLOOP */ while (inst0 > loop_inst[loop_depth]) { inst0--; - if (inst0->header.opcode == BRW_OPCODE_BREAK) { + if (inst0->header.opcode == BRW_OPCODE_BREAK && + inst0->bits3.if_else.jump_count == 0) { inst0->bits3.if_else.jump_count = br * (inst1 - inst0 + 1); inst0->bits3.if_else.pop_count = 0; } - else if (inst0->header.opcode == BRW_OPCODE_CONTINUE) { + else if (inst0->header.opcode == BRW_OPCODE_CONTINUE && + inst0->bits3.if_else.jump_count == 0) { inst0->bits3.if_else.jump_count = br * (inst1 - inst0); inst0->bits3.if_else.pop_count = 0; } -- cgit v1.2.3 From 1f92cf55e1d19864a51e620a14c6912e94cd14ea Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 10 Mar 2010 09:48:33 +0800 Subject: st/egl: Fix build errors in ximage backend after merge. This fixes assorted merge conflicts when master is merged to gallium-sw-api-2 in 0c96690a5b6e1c2d114e7ec5f1e9d60a4ff2a330. --- src/gallium/state_trackers/egl/x11/native_x11.c | 2 +- src/gallium/state_trackers/egl/x11/native_x11.h | 3 ++- src/gallium/state_trackers/egl/x11/native_ximage.c | 11 +++++++---- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/egl/x11/native_x11.c b/src/gallium/state_trackers/egl/x11/native_x11.c index 2b3edbc006..c6eb17ab1a 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.c +++ b/src/gallium/state_trackers/egl/x11/native_x11.c @@ -144,7 +144,7 @@ native_create_display(EGLNativeDisplayType dpy, EGLint level = (force_sw) ? _EGL_INFO : _EGL_WARNING; _eglLog(level, "use software fallback"); - ndpy = x11_create_ximage_display(dpy); + ndpy = x11_create_ximage_display(dpy, event_handler); } return ndpy; diff --git a/src/gallium/state_trackers/egl/x11/native_x11.h b/src/gallium/state_trackers/egl/x11/native_x11.h index 21ed6a2e06..1566524926 100644 --- a/src/gallium/state_trackers/egl/x11/native_x11.h +++ b/src/gallium/state_trackers/egl/x11/native_x11.h @@ -29,7 +29,8 @@ #include "common/native.h" struct native_display * -x11_create_ximage_display(EGLNativeDisplayType dpy); +x11_create_ximage_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler); struct native_display * x11_create_dri2_display(EGLNativeDisplayType dpy, diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 7d1462d4b7..544b3b4276 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -51,11 +51,11 @@ struct ximage_display { Display *dpy; boolean own_dpy; + struct native_event_handler *event_handler; + struct x11_screen *xscr; int xscr_number; - struct xm_driver *driver; - struct ximage_config *configs; int num_configs; }; @@ -138,7 +138,7 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf, switch (which) { case NATIVE_ATTACHMENT_FRONT_LEFT: case NATIVE_ATTACHMENT_FRONT_RIGHT: - templ.tex_usage |= PIPE_TEXTURE_USAGE_PRIMARY; + templ.tex_usage |= PIPE_TEXTURE_USAGE_SCANOUT; break; case NATIVE_ATTACHMENT_BACK_LEFT: case NATIVE_ATTACHMENT_BACK_RIGHT: @@ -615,7 +615,8 @@ ximage_display_destroy(struct native_display *ndpy) } struct native_display * -x11_create_ximage_display(EGLNativeDisplayType dpy) +x11_create_ximage_display(EGLNativeDisplayType dpy, + struct native_event_handler *event_handler) { struct ximage_display *xdpy; @@ -633,6 +634,8 @@ x11_create_ximage_display(EGLNativeDisplayType dpy) xdpy->own_dpy = TRUE; } + xdpy->event_handler = event_handler; + xdpy->xscr_number = DefaultScreen(xdpy->dpy); xdpy->xscr = x11_screen_create(xdpy->dpy, xdpy->xscr_number); if (!xdpy->xscr) { -- cgit v1.2.3 From 9a8342ebcd83a2022b3c9b9539c5b15ac56d6440 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 10 Mar 2010 10:12:45 +0800 Subject: winsys/drm: Handle circular dependencies in Makefile.egl. The libraries have circular dependencies. Use --start-group and --end-group when producing the final shared libraries. --- src/gallium/winsys/drm/Makefile.egl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/drm/Makefile.egl b/src/gallium/winsys/drm/Makefile.egl index a006ad70b6..bc5dd3a53b 100644 --- a/src/gallium/winsys/drm/Makefile.egl +++ b/src/gallium/winsys/drm/Makefile.egl @@ -39,8 +39,10 @@ $(EGL_DISPLAY_LIBS): $(TOP)/$(LIB_DIR)/%.so: %.so define mklib-egl $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) $($(1)_ST) \ - $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) $($(1)_LIBS) $(EGL_DRIVER_LIBS) + $(MKLIB_OPTIONS) $(EGL_DRIVER_OBJECTS) \ + -Wl,--start-group $($(1)_ST) $(EGL_DRIVER_PIPES) \ + $(GALLIUM_AUXILIARIES) -Wl,--end-group \ + $($(1)_LIBS) $(EGL_DRIVER_LIBS) endef egl_x11_$(EGL_DRIVER_NAME).so: $(EGL_DRIVER_OBJECTS) $(x11_ST) $(EGL_DRIVER_PIPES) $(GALLIUM_AUXILIARIES) Makefile -- cgit v1.2.3 From 007f25b3bde88de550d6ddba6a96769e4f3d5ce7 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Tue, 9 Mar 2010 20:03:35 -0800 Subject: r300g: Reorder regs, save one dword. Or, put another way, save 10% on rendering calls. --- src/gallium/drivers/r300/r300_render.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 2605628c02..9c001ae186 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -183,7 +183,7 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, } } - dwords = 10 + count * vertex_size; + dwords = 9 + count * vertex_size; r300_reserve_cs_space(r300, r300_get_num_dirty_dwords(r300) + dwords); r300_emit_buffer_validate(r300, FALSE, NULL); @@ -193,8 +193,9 @@ static void r300_emit_draw_arrays_immediate(struct r300_context *r300, OUT_CS_REG(R300_GA_COLOR_CONTROL, r300_provoking_vertex_fixes(r300, mode)); OUT_CS_REG(R300_VAP_VTX_SIZE, vertex_size); - OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0); - OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, count - 1); + OUT_CS_REG_SEQ(R300_VAP_VF_MAX_VTX_INDX, 2); + OUT_CS(count - 1); + OUT_CS(0); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_IMMD_2, count * vertex_size); OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED | (count << 16) | r300_translate_primitive(mode)); @@ -238,15 +239,16 @@ static void r300_emit_draw_arrays(struct r300_context *r300, if (alt_num_verts) { assert(count < (1 << 24)); - BEGIN_CS(10); + BEGIN_CS(9); OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count); } else { - BEGIN_CS(8); + BEGIN_CS(7); } OUT_CS_REG(R300_GA_COLOR_CONTROL, r300_provoking_vertex_fixes(r300, mode)); - OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0); - OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, count - 1); + OUT_CS_REG_SEQ(R300_VAP_VF_MAX_VTX_INDX, 2); + OUT_CS(count - 1); + OUT_CS(0); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_VBUF_2, 0); OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (count << 16) | r300_translate_primitive(mode) | @@ -281,15 +283,16 @@ static void r300_emit_draw_elements(struct r300_context *r300, maxIndex = MIN2(maxIndex, r300->vertex_buffer_max_index); if (alt_num_verts) { - BEGIN_CS(16); + BEGIN_CS(15); OUT_CS_REG(R500_VAP_ALT_NUM_VERTICES, count); } else { - BEGIN_CS(14); + BEGIN_CS(13); } OUT_CS_REG(R300_GA_COLOR_CONTROL, r300_provoking_vertex_fixes(r300, mode)); - OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, minIndex); - OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, maxIndex); + OUT_CS_REG_SEQ(R300_VAP_VF_MAX_VTX_INDX, 2); + OUT_CS(maxIndex); + OUT_CS(minIndex); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, 0); if (indexSize == 4) { count_dwords = count; -- cgit v1.2.3 From ac2b35fd2d5008a39fa394b7b04fd29b899d3e55 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 3 Mar 2010 11:45:08 +1000 Subject: nv50: use relocs rather than re-uploading TIC all the time --- src/gallium/drivers/nv50/nv50_context.h | 1 + src/gallium/drivers/nv50/nv50_state_validate.c | 3 +-- src/gallium/drivers/nv50/nv50_tex.c | 30 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index e91a61b27d..2cb5538c54 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -249,6 +249,7 @@ extern void nv50_so_init_sifc(struct nv50_context *nv50, unsigned offset, unsigned size); /* nv50_tex.c */ +extern void nv50_tex_relocs(struct nv50_context *); extern void nv50_tex_validate(struct nv50_context *); /* nv50_transfer.c */ diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index c974cc92dc..0d30957ee3 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -290,8 +290,7 @@ nv50_state_flush_notify(struct nouveau_channel *chan) { struct nv50_context *nv50 = chan->user_private; - if (nv50->state.tic_upload && !(nv50->dirty & NV50_NEW_TEXTURE)) - so_emit(chan, nv50->state.tic_upload); + nv50_tex_relocs(nv50); so_emit_reloc_markers(chan, nv50->state.fb); so_emit_reloc_markers(chan, nv50->state.vertprog); diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index de0560e20c..ed3440fcc1 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -24,6 +24,7 @@ #include "nv50_texture.h" #include "nouveau/nouveau_stateobj.h" +#include "nouveau/nouveau_reloc.h" #include "util/u_format.h" @@ -194,6 +195,35 @@ nv50_validate_textures(struct nv50_context *nv50, struct nouveau_stateobj *so, return TRUE; } +void +nv50_tex_relocs(struct nv50_context *nv50) +{ + struct nouveau_channel *chan = nv50->screen->tesla->channel; + int p, unit; + + p = PIPE_SHADER_FRAGMENT; + for (unit = 0; unit < nv50->miptree_nr[p]; unit++) { + if (!nv50->miptree[p][unit]) + continue; + nouveau_reloc_emit(chan, nv50->screen->tic, + ((p * 32) + unit) * 32, NULL, + nv50->miptree[p][unit]->base.bo, 0, 0, + NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | + NOUVEAU_BO_RD, 0, 0); + } + + p = PIPE_SHADER_VERTEX; + for (unit = 0; unit < nv50->miptree_nr[p]; unit++) { + if (!nv50->miptree[p][unit]) + continue; + nouveau_reloc_emit(chan, nv50->screen->tic, + ((p * 32) + unit) * 32, NULL, + nv50->miptree[p][unit]->base.bo, 0, 0, + NOUVEAU_BO_VRAM | NOUVEAU_BO_LOW | + NOUVEAU_BO_RD, 0, 0); + } +} + void nv50_tex_validate(struct nv50_context *nv50) { -- cgit v1.2.3 From 62ab89785b55e60b978dc2b32995676859299c80 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 3 Mar 2010 14:26:25 +1000 Subject: nv50: rework state emission --- src/gallium/drivers/nv50/nv50_context.c | 42 +-- src/gallium/drivers/nv50/nv50_context.h | 39 +-- src/gallium/drivers/nv50/nv50_program.c | 31 +- src/gallium/drivers/nv50/nv50_screen.c | 4 +- src/gallium/drivers/nv50/nv50_state_validate.c | 430 ++++++++++++------------- src/gallium/drivers/nv50/nv50_tex.c | 7 +- src/gallium/drivers/nv50/nv50_vbo.c | 7 +- 7 files changed, 249 insertions(+), 311 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index 7be12fcdef..eff012c14d 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -46,43 +46,13 @@ static void nv50_destroy(struct pipe_context *pipe) { struct nv50_context *nv50 = nv50_context(pipe); + int i; - if (nv50->state.fb) - so_ref(NULL, &nv50->state.fb); - if (nv50->state.blend) - so_ref(NULL, &nv50->state.blend); - if (nv50->state.blend_colour) - so_ref(NULL, &nv50->state.blend_colour); - if (nv50->state.zsa) - so_ref(NULL, &nv50->state.zsa); - if (nv50->state.rast) - so_ref(NULL, &nv50->state.rast); - if (nv50->state.stipple) - so_ref(NULL, &nv50->state.stipple); - if (nv50->state.scissor) - so_ref(NULL, &nv50->state.scissor); - if (nv50->state.viewport) - so_ref(NULL, &nv50->state.viewport); - if (nv50->state.tsc_upload) - so_ref(NULL, &nv50->state.tsc_upload); - if (nv50->state.tic_upload) - so_ref(NULL, &nv50->state.tic_upload); - if (nv50->state.vertprog) - so_ref(NULL, &nv50->state.vertprog); - if (nv50->state.fragprog) - so_ref(NULL, &nv50->state.fragprog); - if (nv50->state.geomprog) - so_ref(NULL, &nv50->state.geomprog); - if (nv50->state.fp_linkage) - so_ref(NULL, &nv50->state.fp_linkage); - if (nv50->state.gp_linkage) - so_ref(NULL, &nv50->state.gp_linkage); - if (nv50->state.vtxfmt) - so_ref(NULL, &nv50->state.vtxfmt); - if (nv50->state.vtxbuf) - so_ref(NULL, &nv50->state.vtxbuf); - if (nv50->state.vtxattr) - so_ref(NULL, &nv50->state.vtxattr); + for (i = 0; i < 64; i++) { + if (!nv50->state.hw[i]) + continue; + so_ref(NULL, &nv50->state.hw[i]); + } draw_destroy(nv50->draw); diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 2cb5538c54..5fa3911114 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -123,27 +123,11 @@ nv50_surface(struct pipe_surface *pt) } struct nv50_state { - unsigned dirty; + struct nouveau_stateobj *hw[64]; + uint64_t hw_dirty; - struct nouveau_stateobj *fb; - struct nouveau_stateobj *blend; - struct nouveau_stateobj *blend_colour; - struct nouveau_stateobj *zsa; - struct nouveau_stateobj *stencil_ref; - struct nouveau_stateobj *rast; - struct nouveau_stateobj *stipple; - struct nouveau_stateobj *scissor; unsigned scissor_enabled; - struct nouveau_stateobj *viewport; - struct nouveau_stateobj *tsc_upload; - struct nouveau_stateobj *tic_upload; unsigned miptree_nr[PIPE_SHADER_TYPES]; - struct nouveau_stateobj *vertprog; - struct nouveau_stateobj *fragprog; - struct nouveau_stateobj *geomprog; - struct nouveau_stateobj *fp_linkage; - struct nouveau_stateobj *gp_linkage; - struct nouveau_stateobj *vtxfmt; struct nouveau_stateobj *vtxbuf; struct nouveau_stateobj *vtxattr; struct nouveau_stateobj *instbuf; @@ -224,18 +208,23 @@ extern void nv50_draw_elements_instanced(struct pipe_context *pipe, unsigned startInstance, unsigned instanceCount); extern void nv50_vtxelt_construct(struct nv50_vtxelt_stateobj *cso); -extern void nv50_vbo_validate(struct nv50_context *nv50); +extern struct nouveau_stateobj *nv50_vbo_validate(struct nv50_context *nv50); /* nv50_clear.c */ extern void nv50_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, unsigned stencil); /* nv50_program.c */ -extern void nv50_vertprog_validate(struct nv50_context *nv50); -extern void nv50_fragprog_validate(struct nv50_context *nv50); -extern void nv50_geomprog_validate(struct nv50_context *nv50); -extern void nv50_fp_linkage_validate(struct nv50_context *nv50); -extern void nv50_gp_linkage_validate(struct nv50_context *nv50); +extern struct nouveau_stateobj * +nv50_vertprog_validate(struct nv50_context *nv50); +extern struct nouveau_stateobj * +nv50_fragprog_validate(struct nv50_context *nv50); +extern struct nouveau_stateobj * +nv50_geomprog_validate(struct nv50_context *nv50); +extern struct nouveau_stateobj * +nv50_fp_linkage_validate(struct nv50_context *nv50); +extern struct nouveau_stateobj * +nv50_gp_linkage_validate(struct nv50_context *nv50); extern void nv50_program_destroy(struct nv50_context *nv50, struct nv50_program *p); @@ -250,7 +239,7 @@ extern void nv50_so_init_sifc(struct nv50_context *nv50, /* nv50_tex.c */ extern void nv50_tex_relocs(struct nv50_context *); -extern void nv50_tex_validate(struct nv50_context *); +extern struct nouveau_stateobj *nv50_tex_validate(struct nv50_context *); /* nv50_transfer.c */ extern void diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 2372cbbef6..50bb982076 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -4270,7 +4270,7 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p) FREE(up); } -void +struct nouveau_stateobj * nv50_vertprog_validate(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; @@ -4301,11 +4301,10 @@ nv50_vertprog_validate(struct nv50_context *nv50) so_data (so, p->cfg.high_temp); so_method(so, tesla, NV50TCL_VP_START_ID, 1); so_data (so, 0); /* program start offset */ - so_ref(so, &nv50->state.vertprog); - so_ref(NULL, &so); + return so; } -void +struct nouveau_stateobj * nv50_fragprog_validate(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; @@ -4337,11 +4336,10 @@ nv50_fragprog_validate(struct nv50_context *nv50) so_data (so, p->cfg.regs[3]); so_method(so, tesla, NV50TCL_FP_START_ID, 1); so_data (so, 0); /* program start offset */ - so_ref(so, &nv50->state.fragprog); - so_ref(NULL, &so); + return so; } -void +struct nouveau_stateobj * nv50_geomprog_validate(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; @@ -4373,8 +4371,7 @@ nv50_geomprog_validate(struct nv50_context *nv50) so_data (so, p->cfg.vert_count); so_method(so, tesla, NV50TCL_GP_START_ID, 1); so_data (so, 0); - so_ref(so, &nv50->state.geomprog); - so_ref(NULL, &so); + return so; } static uint32_t @@ -4454,7 +4451,7 @@ nv50_vec4_map(uint32_t *map32, int mid, uint8_t zval, uint32_t lin[4], return mid; } -void +struct nouveau_stateobj * nv50_fp_linkage_validate(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; @@ -4580,8 +4577,7 @@ nv50_fp_linkage_validate(struct nv50_context *nv50) so_method(so, tesla, NV50TCL_GP_ENABLE, 1); so_data (so, (vp->type == PIPE_SHADER_GEOMETRY) ? 1 : 0); - so_ref(so, &nv50->state.fp_linkage); - so_ref(NULL, &so); + return so; } static int @@ -4615,7 +4611,7 @@ construct_vp_gp_mapping(uint32_t *map32, int m, return m; } -void +struct nouveau_stateobj * nv50_gp_linkage_validate(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; @@ -4625,10 +4621,8 @@ nv50_gp_linkage_validate(struct nv50_context *nv50) uint32_t map[16]; int m = 0; - if (!gp) { - so_ref(NULL, &nv50->state.gp_linkage); - return; - } + if (!gp) + return NULL; memset(map, 0, sizeof(map)); m = construct_vp_gp_mapping(map, m, vp, gp); @@ -4646,8 +4640,7 @@ nv50_gp_linkage_validate(struct nv50_context *nv50) so_method(so, tesla, NV50TCL_VP_RESULT_MAP(0), m); so_datap (so, map, m); - so_ref(so, &nv50->state.gp_linkage); - so_ref(NULL, &so); + return so; } void diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index eed6031eaf..b530de64b6 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -215,9 +215,9 @@ nv50_pre_pipebuffer_map(struct pipe_screen *pscreen, struct pipe_buffer *pb, /* Our vtxbuf got mapped, it can no longer be considered part of current * state, remove it to avoid emitting reloc markers. */ - if (ctx && ctx->state.vtxbuf && so_bo_is_reloc(ctx->state.vtxbuf, + if (ctx && ctx->state.hw[17] && so_bo_is_reloc(ctx->state.hw[17], nouveau_bo(pb))) { - so_ref(NULL, &ctx->state.vtxbuf); + so_ref(NULL, &ctx->state.hw[17]); ctx->dirty |= NV50_NEW_ARRAYS; } diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 0d30957ee3..abdb9a55c8 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -25,8 +25,8 @@ #include "nv50_context.h" #include "nouveau/nouveau_stateobj.h" -static void -nv50_state_validate_fb(struct nv50_context *nv50) +static struct nouveau_stateobj * +validate_fb(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; struct nouveau_stateobj *so = so_new(32, 79, 18); @@ -169,10 +169,8 @@ nv50_state_validate_fb(struct nv50_context *nv50) /* we set scissors to framebuffer size when they're 'turned off' */ nv50->dirty |= NV50_NEW_SCISSOR; - so_ref(NULL, &nv50->state.scissor); - - so_ref(so, &nv50->state.fb); - so_ref(NULL, &so); + so_ref(NULL, &nv50->state.hw[12]); + return so; } static void @@ -199,261 +197,251 @@ nv50_validate_samplers(struct nv50_context *nv50, struct nouveau_stateobj *so, } } -static void -nv50_state_emit(struct nv50_context *nv50) +static struct nouveau_stateobj * +validate_blend(struct nv50_context *nv50) { - struct nv50_screen *screen = nv50->screen; - struct nouveau_channel *chan = screen->base.channel; + struct nouveau_stateobj *so = NULL; + so_ref(nv50->blend->so, &so); + return so; +} - /* XXX: this is racy for multiple contexts active on separate - * threads. - */ - if (screen->cur_ctx != nv50) { - if (nv50->state.fb) - nv50->state.dirty |= NV50_NEW_FRAMEBUFFER; - if (nv50->state.blend) - nv50->state.dirty |= NV50_NEW_BLEND; - if (nv50->state.zsa) - nv50->state.dirty |= NV50_NEW_ZSA; - if (nv50->state.vertprog) - nv50->state.dirty |= NV50_NEW_VERTPROG; - if (nv50->state.fragprog) - nv50->state.dirty |= NV50_NEW_FRAGPROG; - if (nv50->state.geomprog) - nv50->state.dirty |= NV50_NEW_GEOMPROG; - if (nv50->state.rast) - nv50->state.dirty |= NV50_NEW_RASTERIZER; - if (nv50->state.blend_colour) - nv50->state.dirty |= NV50_NEW_BLEND_COLOUR; - if (nv50->state.stencil_ref) - nv50->state.dirty |= NV50_NEW_STENCIL_REF; - if (nv50->state.stipple) - nv50->state.dirty |= NV50_NEW_STIPPLE; - if (nv50->state.scissor) - nv50->state.dirty |= NV50_NEW_SCISSOR; - if (nv50->state.viewport) - nv50->state.dirty |= NV50_NEW_VIEWPORT; - if (nv50->state.tsc_upload) - nv50->state.dirty |= NV50_NEW_SAMPLER; - if (nv50->state.tic_upload) - nv50->state.dirty |= NV50_NEW_TEXTURE; - if (nv50->state.vtxfmt && nv50->state.vtxbuf) - nv50->state.dirty |= NV50_NEW_ARRAYS; - screen->cur_ctx = nv50; - } +static struct nouveau_stateobj * +validate_zsa(struct nv50_context *nv50) +{ + struct nouveau_stateobj *so = NULL; + so_ref(nv50->zsa->so, &so); + return so; +} - if (nv50->state.dirty & NV50_NEW_FRAMEBUFFER) - so_emit(chan, nv50->state.fb); - if (nv50->state.dirty & NV50_NEW_BLEND) - so_emit(chan, nv50->state.blend); - if (nv50->state.dirty & NV50_NEW_ZSA) - so_emit(chan, nv50->state.zsa); - if (nv50->state.dirty & NV50_NEW_VERTPROG) - so_emit(chan, nv50->state.vertprog); - if (nv50->state.dirty & NV50_NEW_FRAGPROG) - so_emit(chan, nv50->state.fragprog); - if (nv50->state.dirty & NV50_NEW_GEOMPROG && nv50->state.geomprog) - so_emit(chan, nv50->state.geomprog); - if (nv50->state.dirty & (NV50_NEW_FRAGPROG | NV50_NEW_VERTPROG | - NV50_NEW_GEOMPROG | NV50_NEW_RASTERIZER)) - so_emit(chan, nv50->state.fp_linkage); - if ((nv50->state.dirty & (NV50_NEW_VERTPROG | NV50_NEW_GEOMPROG)) - && nv50->state.gp_linkage) - so_emit(chan, nv50->state.gp_linkage); - if (nv50->state.dirty & NV50_NEW_RASTERIZER) - so_emit(chan, nv50->state.rast); - if (nv50->state.dirty & NV50_NEW_BLEND_COLOUR) - so_emit(chan, nv50->state.blend_colour); - if (nv50->state.dirty & NV50_NEW_STENCIL_REF) - so_emit(chan, nv50->state.stencil_ref); - if (nv50->state.dirty & NV50_NEW_STIPPLE) - so_emit(chan, nv50->state.stipple); - if (nv50->state.dirty & NV50_NEW_SCISSOR) - so_emit(chan, nv50->state.scissor); - if (nv50->state.dirty & NV50_NEW_VIEWPORT) - so_emit(chan, nv50->state.viewport); - if (nv50->state.dirty & NV50_NEW_SAMPLER) - so_emit(chan, nv50->state.tsc_upload); - if (nv50->state.dirty & NV50_NEW_TEXTURE) - so_emit(chan, nv50->state.tic_upload); - if (nv50->state.dirty & NV50_NEW_ARRAYS) { - so_emit(chan, nv50->state.vtxfmt); - so_emit(chan, nv50->state.vtxbuf); - if (nv50->state.vtxattr) - so_emit(chan, nv50->state.vtxattr); - } - nv50->state.dirty = 0; +static struct nouveau_stateobj * +validate_rast(struct nv50_context *nv50) +{ + struct nouveau_stateobj *so = NULL; + so_ref(nv50->rasterizer->so, &so); + return so; } -void -nv50_state_flush_notify(struct nouveau_channel *chan) +static struct nouveau_stateobj * +validate_blend_colour(struct nv50_context *nv50) { - struct nv50_context *nv50 = chan->user_private; + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_stateobj *so = so_new(1, 4, 0); + + so_method(so, tesla, NV50TCL_BLEND_COLOR(0), 4); + so_data (so, fui(nv50->blend_colour.color[0])); + so_data (so, fui(nv50->blend_colour.color[1])); + so_data (so, fui(nv50->blend_colour.color[2])); + so_data (so, fui(nv50->blend_colour.color[3])); + return so; +} - nv50_tex_relocs(nv50); +static struct nouveau_stateobj * +validate_stencil_ref(struct nv50_context *nv50) +{ + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_stateobj *so = so = so_new(2, 2, 0); - so_emit_reloc_markers(chan, nv50->state.fb); - so_emit_reloc_markers(chan, nv50->state.vertprog); - so_emit_reloc_markers(chan, nv50->state.fragprog); - so_emit_reloc_markers(chan, nv50->state.vtxbuf); - so_emit_reloc_markers(chan, nv50->screen->static_init); + so_method(so, tesla, NV50TCL_STENCIL_FRONT_FUNC_REF, 1); + so_data (so, nv50->stencil_ref.ref_value[0]); + so_method(so, tesla, NV50TCL_STENCIL_BACK_FUNC_REF, 1); + so_data (so, nv50->stencil_ref.ref_value[1]); + return so; +} - if (nv50->state.instbuf) - so_emit_reloc_markers(chan, nv50->state.instbuf); +static struct nouveau_stateobj * +validate_stipple(struct nv50_context *nv50) +{ + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_stateobj *so = so_new(1, 32, 0); + int i; + + so_method(so, tesla, NV50TCL_POLYGON_STIPPLE_PATTERN(0), 32); + for (i = 0; i < 32; i++) + so_data(so, util_bswap32(nv50->stipple.stipple[i])); + return so; } -boolean -nv50_state_validate(struct nv50_context *nv50) +static struct nouveau_stateobj * +validate_scissor(struct nv50_context *nv50) { + struct pipe_rasterizer_state *rast = &nv50->rasterizer->pipe; + struct pipe_scissor_state *s = &nv50->scissor; struct nouveau_grobj *tesla = nv50->screen->tesla; struct nouveau_stateobj *so; - unsigned i; - if (nv50->dirty & NV50_NEW_FRAMEBUFFER) - nv50_state_validate_fb(nv50); + if (nv50->state.hw[12] && + (rast->scissor == 0 && nv50->state.scissor_enabled == 0)) + return NULL; + nv50->state.scissor_enabled = rast->scissor; - if (nv50->dirty & NV50_NEW_BLEND) - so_ref(nv50->blend->so, &nv50->state.blend); + so = so_new(1, 2, 0); + so_method(so, tesla, NV50TCL_SCISSOR_HORIZ(0), 2); + if (nv50->state.scissor_enabled) { + so_data(so, (s->maxx << 16) | s->minx); + so_data(so, (s->maxy << 16) | s->miny); + } else { + so_data(so, (nv50->framebuffer.width << 16)); + so_data(so, (nv50->framebuffer.height << 16)); + } - if (nv50->dirty & NV50_NEW_ZSA) - so_ref(nv50->zsa->so, &nv50->state.zsa); + return so; +} - if (nv50->dirty & (NV50_NEW_VERTPROG | NV50_NEW_VERTPROG_CB)) - nv50_vertprog_validate(nv50); +static struct nouveau_stateobj * +validate_viewport(struct nv50_context *nv50) +{ + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_stateobj *so = so_new(5, 9, 0); + + so_method(so, tesla, NV50TCL_VIEWPORT_TRANSLATE_X(0), 3); + so_data (so, fui(nv50->viewport.translate[0])); + so_data (so, fui(nv50->viewport.translate[1])); + so_data (so, fui(nv50->viewport.translate[2])); + so_method(so, tesla, NV50TCL_VIEWPORT_SCALE_X(0), 3); + so_data (so, fui(nv50->viewport.scale[0])); + so_data (so, fui(nv50->viewport.scale[1])); + so_data (so, fui(nv50->viewport.scale[2])); + + so_method(so, tesla, NV50TCL_VIEWPORT_TRANSFORM_EN, 1); + so_data (so, 1); + /* 0x0000 = remove whole primitive only (xyz) + * 0x1018 = remove whole primitive only (xy), clamp z + * 0x1080 = clip primitive (xyz) + * 0x1098 = clip primitive (xy), clamp z + */ + so_method(so, tesla, NV50TCL_VIEW_VOLUME_CLIP_CTRL, 1); + so_data (so, 0x1080); + /* no idea what 0f90 does */ + so_method(so, tesla, 0x0f90, 1); + so_data (so, 0); - if (nv50->dirty & (NV50_NEW_FRAGPROG | NV50_NEW_FRAGPROG_CB)) - nv50_fragprog_validate(nv50); + return so; +} - if (nv50->dirty & (NV50_NEW_GEOMPROG | NV50_NEW_GEOMPROG_CB)) - nv50_geomprog_validate(nv50); +static struct nouveau_stateobj * +validate_sampler(struct nv50_context *nv50) +{ + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_stateobj *so; + unsigned nr = 0, i; - if (nv50->dirty & (NV50_NEW_FRAGPROG | NV50_NEW_VERTPROG | - NV50_NEW_GEOMPROG | NV50_NEW_RASTERIZER)) - nv50_fp_linkage_validate(nv50); + for (i = 0; i < PIPE_SHADER_TYPES; ++i) + nr += nv50->sampler_nr[i]; - if (nv50->dirty & (NV50_NEW_GEOMPROG | NV50_NEW_VERTPROG)) - nv50_gp_linkage_validate(nv50); + so = so_new(1 + 5 * PIPE_SHADER_TYPES, + 1 + 19 * PIPE_SHADER_TYPES + nr * 8, + PIPE_SHADER_TYPES * 2); - if (nv50->dirty & NV50_NEW_RASTERIZER) - so_ref(nv50->rasterizer->so, &nv50->state.rast); + nv50_validate_samplers(nv50, so, PIPE_SHADER_VERTEX); + nv50_validate_samplers(nv50, so, PIPE_SHADER_FRAGMENT); - if (nv50->dirty & NV50_NEW_BLEND_COLOUR) { - so = so_new(1, 4, 0); - so_method(so, tesla, NV50TCL_BLEND_COLOR(0), 4); - so_data (so, fui(nv50->blend_colour.color[0])); - so_data (so, fui(nv50->blend_colour.color[1])); - so_data (so, fui(nv50->blend_colour.color[2])); - so_data (so, fui(nv50->blend_colour.color[3])); - so_ref(so, &nv50->state.blend_colour); - so_ref(NULL, &so); - } - - if (nv50->dirty & NV50_NEW_STENCIL_REF) { - so = so_new(2, 2, 0); - so_method(so, tesla, NV50TCL_STENCIL_FRONT_FUNC_REF, 1); - so_data (so, nv50->stencil_ref.ref_value[0]); - so_method(so, tesla, NV50TCL_STENCIL_BACK_FUNC_REF, 1); - so_data (so, nv50->stencil_ref.ref_value[1]); - so_ref(so, &nv50->state.stencil_ref); - so_ref(NULL, &so); - } + so_method(so, tesla, 0x1334, 1); /* flush TSC */ + so_data (so, 0); - if (nv50->dirty & NV50_NEW_STIPPLE) { - so = so_new(1, 32, 0); - so_method(so, tesla, NV50TCL_POLYGON_STIPPLE_PATTERN(0), 32); - for (i = 0; i < 32; i++) - so_data(so, util_bswap32(nv50->stipple.stipple[i])); - so_ref(so, &nv50->state.stipple); - so_ref(NULL, &so); - } + return so; +} - if (nv50->dirty & (NV50_NEW_SCISSOR | NV50_NEW_RASTERIZER)) { - struct pipe_rasterizer_state *rast = &nv50->rasterizer->pipe; - struct pipe_scissor_state *s = &nv50->scissor; +static struct nouveau_stateobj * +validate_vtxbuf(struct nv50_context *nv50) +{ + struct nouveau_stateobj *so = NULL; + so_ref(nv50->state.vtxbuf, &so); + return so; +} - if (nv50->state.scissor && - (rast->scissor == 0 && nv50->state.scissor_enabled == 0)) - goto scissor_uptodate; - nv50->state.scissor_enabled = rast->scissor; +static struct nouveau_stateobj * +validate_vtxattr(struct nv50_context *nv50) +{ + struct nouveau_stateobj *so = NULL; + so_ref(nv50->state.vtxattr, &so); + return so; +} - so = so_new(1, 2, 0); - so_method(so, tesla, NV50TCL_SCISSOR_HORIZ(0), 2); - if (nv50->state.scissor_enabled) { - so_data(so, (s->maxx << 16) | s->minx); - so_data(so, (s->maxy << 16) | s->miny); - } else { - so_data(so, (nv50->framebuffer.width << 16)); - so_data(so, (nv50->framebuffer.height << 16)); - } - so_ref(so, &nv50->state.scissor); - so_ref(NULL, &so); - nv50->state.dirty |= NV50_NEW_SCISSOR; - } -scissor_uptodate: - - if (nv50->dirty & (NV50_NEW_VIEWPORT | NV50_NEW_RASTERIZER)) { - if (nv50->state.viewport && - !(nv50->dirty & NV50_NEW_VIEWPORT)) - goto viewport_uptodate; - - so = so_new(5, 9, 0); - so_method(so, tesla, NV50TCL_VIEWPORT_TRANSLATE_X(0), 3); - so_data (so, fui(nv50->viewport.translate[0])); - so_data (so, fui(nv50->viewport.translate[1])); - so_data (so, fui(nv50->viewport.translate[2])); - so_method(so, tesla, NV50TCL_VIEWPORT_SCALE_X(0), 3); - so_data (so, fui(nv50->viewport.scale[0])); - so_data (so, fui(nv50->viewport.scale[1])); - so_data (so, fui(nv50->viewport.scale[2])); - - so_method(so, tesla, NV50TCL_VIEWPORT_TRANSFORM_EN, 1); - so_data (so, 1); - /* 0x0000 = remove whole primitive only (xyz) - * 0x1018 = remove whole primitive only (xy), clamp z - * 0x1080 = clip primitive (xyz) - * 0x1098 = clip primitive (xy), clamp z - */ - so_method(so, tesla, NV50TCL_VIEW_VOLUME_CLIP_CTRL, 1); - so_data (so, 0x1080); - /* no idea what 0f90 does */ - so_method(so, tesla, 0x0f90, 1); - so_data (so, 0); +struct state_validate { + struct nouveau_stateobj *(*func)(struct nv50_context *nv50); + unsigned states; +} validate_list[] = { + { validate_fb , NV50_NEW_FRAMEBUFFER }, + { validate_blend , NV50_NEW_BLEND }, + { validate_zsa , NV50_NEW_ZSA }, + { nv50_vertprog_validate , NV50_NEW_VERTPROG | NV50_NEW_VERTPROG_CB }, + { nv50_fragprog_validate , NV50_NEW_FRAGPROG | NV50_NEW_FRAGPROG_CB }, + { nv50_geomprog_validate , NV50_NEW_GEOMPROG | NV50_NEW_GEOMPROG_CB }, + { nv50_fp_linkage_validate, NV50_NEW_VERTPROG | NV50_NEW_GEOMPROG | + NV50_NEW_FRAGPROG | NV50_NEW_RASTERIZER }, + { nv50_gp_linkage_validate, NV50_NEW_VERTPROG | NV50_NEW_GEOMPROG }, + { validate_rast , NV50_NEW_RASTERIZER }, + { validate_blend_colour , NV50_NEW_BLEND_COLOUR }, + { validate_stencil_ref , NV50_NEW_STENCIL_REF }, + { validate_stipple , NV50_NEW_STIPPLE }, + { validate_scissor , NV50_NEW_SCISSOR | NV50_NEW_RASTERIZER }, + { validate_viewport , NV50_NEW_VIEWPORT }, + { validate_sampler , NV50_NEW_SAMPLER }, + { nv50_tex_validate , NV50_NEW_TEXTURE | NV50_NEW_SAMPLER }, + { nv50_vbo_validate , NV50_NEW_ARRAYS }, + { validate_vtxbuf , NV50_NEW_ARRAYS }, + { validate_vtxattr , NV50_NEW_ARRAYS }, + {} +}; +#define validate_list_len (sizeof(validate_list) / sizeof(validate_list[0])) - so_ref(so, &nv50->state.viewport); - so_ref(NULL, &so); - nv50->state.dirty |= NV50_NEW_VIEWPORT; - } -viewport_uptodate: +void +nv50_state_flush_notify(struct nouveau_channel *chan) +{ + struct nv50_context *nv50 = chan->user_private; - if (nv50->dirty & NV50_NEW_SAMPLER) { - unsigned nr = 0; + nv50_tex_relocs(nv50); - for (i = 0; i < PIPE_SHADER_TYPES; ++i) - nr += nv50->sampler_nr[i]; + so_emit_reloc_markers(chan, nv50->state.hw[0]); /* fb */ + so_emit_reloc_markers(chan, nv50->state.hw[3]); /* vp */ + so_emit_reloc_markers(chan, nv50->state.hw[4]); /* fp */ + so_emit_reloc_markers(chan, nv50->state.hw[17]); /* vb */ + so_emit_reloc_markers(chan, nv50->screen->static_init); - so = so_new(1 + 5 * PIPE_SHADER_TYPES, - 1 + 19 * PIPE_SHADER_TYPES + nr * 8, - PIPE_SHADER_TYPES * 2); +#if 0 + if (nv50->state.instbuf) + so_emit_reloc_markers(chan, nv50->state.instbuf); +#endif +} - nv50_validate_samplers(nv50, so, PIPE_SHADER_VERTEX); - nv50_validate_samplers(nv50, so, PIPE_SHADER_FRAGMENT); +boolean +nv50_state_validate(struct nv50_context *nv50) +{ + struct nouveau_channel *chan = nv50->screen->base.channel; + int i; - so_method(so, tesla, 0x1334, 1); /* flush TSC */ - so_data (so, 0); + if (nv50->screen->cur_ctx != nv50) { + for (i = 0; i < validate_list_len; i++) { + if (nv50->state.hw[i]) + nv50->state.hw_dirty |= (1 << i); + } - so_ref(so, &nv50->state.tsc_upload); - so_ref(NULL, &so); + nv50->screen->cur_ctx = nv50; } - if (nv50->dirty & (NV50_NEW_TEXTURE | NV50_NEW_SAMPLER)) - nv50_tex_validate(nv50); + for (i = 0; i < validate_list_len; i++) { + struct state_validate *validate = &validate_list[i]; + struct nouveau_stateobj *so; + + if (!(nv50->dirty & validate->states)) + continue; - if (nv50->dirty & NV50_NEW_ARRAYS) - nv50_vbo_validate(nv50); + so = validate->func(nv50); + if (!so) + continue; - nv50->state.dirty |= nv50->dirty; + so_ref(so, &nv50->state.hw[i]); + so_ref(NULL, &so); + nv50->state.hw_dirty |= (1 << i); + } nv50->dirty = 0; - nv50_state_emit(nv50); + + while (nv50->state.hw_dirty) { + i = ffs(nv50->state.hw_dirty) - 1; + nv50->state.hw_dirty &= ~(1 << i); + + so_emit(chan, nv50->state.hw[i]); + } return TRUE; } diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index ed3440fcc1..4c48b12cd8 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -224,7 +224,7 @@ nv50_tex_relocs(struct nv50_context *nv50) } } -void +struct nouveau_stateobj * nv50_tex_validate(struct nv50_context *nv50) { struct nouveau_stateobj *so; @@ -247,12 +247,11 @@ nv50_tex_validate(struct nv50_context *nv50) so_ref(NULL, &so); NOUVEAU_ERR("failed tex validate\n"); - return; + return NULL; } so_method(so, tesla, 0x1330, 1); /* flush TIC */ so_data (so, 0); - so_ref(so, &nv50->state.tic_upload); - so_ref(NULL, &so); + return so; } diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index c1dcb93b48..3e540013c4 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -792,7 +792,7 @@ nv50_vtxelt_construct(struct nv50_vtxelt_stateobj *cso) } } -void +struct nouveau_stateobj * nv50_vbo_validate(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; @@ -801,7 +801,7 @@ nv50_vbo_validate(struct nv50_context *nv50) /* don't validate if Gallium took away our buffers */ if (nv50->vtxbuf_nr == 0) - return; + return NULL; nv50->vbo_fifo = 0; for (i = 0; i < nv50->vtxbuf_nr; ++i) @@ -875,12 +875,11 @@ nv50_vbo_validate(struct nv50_context *nv50) } nv50->state.vtxelt_nr = nv50->vtxelt->num_elements; - so_ref (vtxfmt, &nv50->state.vtxfmt); so_ref (vtxbuf, &nv50->state.vtxbuf); so_ref (vtxattr, &nv50->state.vtxattr); so_ref (NULL, &vtxbuf); - so_ref (NULL, &vtxfmt); so_ref (NULL, &vtxattr); + return vtxfmt; } typedef void (*pfn_push)(struct nouveau_channel *, void *); -- cgit v1.2.3 From e1d015fe222a3f6f942426c39fb1a17188df8d57 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 3 Mar 2010 14:43:21 +1000 Subject: nv50: ensure enough room for state changes in current pushbuf Also allows the nv50_state_validate() caller to request a minimum amount of space that itself requires, not all callers accurately use this yet but the simple cases are now accounted for. Rendering will also be dropped on the floor if validate fails now. --- src/gallium/drivers/nv50/nv50_clear.c | 2 +- src/gallium/drivers/nv50/nv50_context.h | 2 +- src/gallium/drivers/nv50/nv50_state_validate.c | 39 ++++++++++++++++++-------- src/gallium/drivers/nv50/nv50_vbo.c | 12 +++++--- 4 files changed, 38 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_clear.c b/src/gallium/drivers/nv50/nv50_clear.c index e0b2d2880b..8afc95c9fc 100644 --- a/src/gallium/drivers/nv50/nv50_clear.c +++ b/src/gallium/drivers/nv50/nv50_clear.c @@ -36,7 +36,7 @@ nv50_clear(struct pipe_context *pipe, unsigned buffers, struct pipe_framebuffer_state *fb = &nv50->framebuffer; unsigned mode = 0, i; - if (!nv50_state_validate(nv50)) + if (!nv50_state_validate(nv50, 64)) return; if (buffers & PIPE_CLEAR_COLOR && fb->nr_cbufs) { diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 5fa3911114..ef0e99f0b1 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -229,7 +229,7 @@ extern void nv50_program_destroy(struct nv50_context *nv50, struct nv50_program *p); /* nv50_state_validate.c */ -extern boolean nv50_state_validate(struct nv50_context *nv50); +extern boolean nv50_state_validate(struct nv50_context *nv50, unsigned dwords); extern void nv50_state_flush_notify(struct nouveau_channel *chan); extern void nv50_so_init_sifc(struct nv50_context *nv50, diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index abdb9a55c8..b01a3d87de 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -405,19 +405,11 @@ nv50_state_flush_notify(struct nouveau_channel *chan) } boolean -nv50_state_validate(struct nv50_context *nv50) +nv50_state_validate(struct nv50_context *nv50, unsigned nr_dwords) { struct nouveau_channel *chan = nv50->screen->base.channel; - int i; - - if (nv50->screen->cur_ctx != nv50) { - for (i = 0; i < validate_list_len; i++) { - if (nv50->state.hw[i]) - nv50->state.hw_dirty |= (1 << i); - } - - nv50->screen->cur_ctx = nv50; - } + unsigned nr_relocs = 0; + int ret, i; for (i = 0; i < validate_list_len; i++) { struct state_validate *validate = &validate_list[i]; @@ -430,12 +422,37 @@ nv50_state_validate(struct nv50_context *nv50) if (!so) continue; + nr_dwords += (so->total + so->cur); + nr_relocs += so->cur_reloc; + so_ref(so, &nv50->state.hw[i]); so_ref(NULL, &so); nv50->state.hw_dirty |= (1 << i); } nv50->dirty = 0; + if (nv50->screen->cur_ctx != nv50) { + for (i = 0; i < validate_list_len; i++) { + if (!nv50->state.hw[i] || + (nv50->state.hw_dirty & (1 << i))) + continue; + + nr_dwords += (nv50->state.hw[i]->total + + nv50->state.hw[i]->cur); + nr_relocs += nv50->state.hw[i]->cur_reloc; + nv50->state.hw_dirty |= (1 << i); + } + + nv50->screen->cur_ctx = nv50; + } + + ret = MARK_RING(chan, nr_dwords, nr_relocs); + if (ret) { + debug_printf("MARK_RING(%d, %d) failed: %d\n", + nr_dwords, nr_relocs, ret); + return FALSE; + } + while (nv50->state.hw_dirty) { i = ffs(nv50->state.hw_dirty) - 1; nv50->state.hw_dirty &= ~(1 << i); diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 3e540013c4..ce2e479cfd 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -425,7 +425,8 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, if (!NV50_USING_LOATHED_EDGEFLAG(nv50)) nv50_upload_user_vbufs(nv50); - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 0)) + return; nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); @@ -477,7 +478,8 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, struct nouveau_grobj *tesla = nv50->screen->tesla; boolean ret; - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 11)) + return; BEGIN_RING(chan, tesla, 0x142c, 1); OUT_RING (chan, 0); @@ -633,7 +635,8 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, if (!NV50_USING_LOATHED_EDGEFLAG(nv50)) nv50_upload_user_vbufs(nv50); - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 0)) + return; nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); @@ -677,7 +680,8 @@ nv50_draw_elements(struct pipe_context *pipe, struct pipe_screen *pscreen = pipe->screen; void *map; - nv50_state_validate(nv50); + if (!nv50_state_validate(nv50, 14)) + return; BEGIN_RING(chan, tesla, 0x142c, 1); OUT_RING (chan, 0); -- cgit v1.2.3 From c926ed0e76bdbf842170f9396856e9cedb6e718f Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 3 Mar 2010 14:55:54 +1000 Subject: nv50: always emit dummy relocs for all still-referenced buffers --- src/gallium/drivers/nv50/nv50_state_validate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index b01a3d87de..12e427d38b 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -405,10 +405,10 @@ nv50_state_flush_notify(struct nouveau_channel *chan) } boolean -nv50_state_validate(struct nv50_context *nv50, unsigned nr_dwords) +nv50_state_validate(struct nv50_context *nv50, unsigned wait_dwords) { struct nouveau_channel *chan = nv50->screen->base.channel; - unsigned nr_relocs = 0; + unsigned nr_relocs = 128, nr_dwords = wait_dwords + 128; int ret, i; for (i = 0; i < validate_list_len; i++) { @@ -460,6 +460,12 @@ nv50_state_validate(struct nv50_context *nv50, unsigned nr_dwords) so_emit(chan, nv50->state.hw[i]); } + /* Yes, really, we need to do this. If a buffer that is referenced + * on the hardware isn't part of changed state above, without doing + * this the kernel is given no clue that the buffer is being used + * still. This can cause all sorts of fun issues. + */ + nv50_state_flush_notify(chan); return TRUE; } -- cgit v1.2.3 From 3f804b0f199680e981c70376f55ecc5fe8d16aec Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 3 Mar 2010 14:59:28 +1000 Subject: nv50: remove horrific abuse of nouveau_channel.flush_notify Really though, using this at all is just not a good idea in the 3D driver. I'm almost certain the hardware will not like a reloc appearing between begin()/end().. Anyways, this is still better than before, more fixes to come.. --- src/gallium/drivers/nv50/nv50_context.c | 1 - src/gallium/drivers/nv50/nv50_vbo.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c index eff012c14d..0eb42f323f 100644 --- a/src/gallium/drivers/nv50/nv50_context.c +++ b/src/gallium/drivers/nv50/nv50_context.c @@ -93,7 +93,6 @@ nv50_create(struct pipe_screen *pscreen, void *priv) nv50->pipe.is_buffer_referenced = nouveau_is_buffer_referenced; screen->base.channel->user_private = nv50; - screen->base.channel->flush_notify = nv50_state_flush_notify; nv50_init_surface_functions(nv50); nv50_init_state_functions(nv50); diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index ce2e479cfd..215dfb74fc 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -427,6 +427,7 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, if (!nv50_state_validate(nv50, 0)) return; + chan->flush_notify = nv50_state_flush_notify; nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); @@ -464,6 +465,8 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); } + + chan->flush_notify = NULL; nv50_unmap_vbufs(nv50); so_ref(NULL, &nv50->state.instbuf); @@ -480,6 +483,7 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, if (!nv50_state_validate(nv50, 11)) return; + chan->flush_notify = nv50_state_flush_notify; BEGIN_RING(chan, tesla, 0x142c, 1); OUT_RING (chan, 0); @@ -500,6 +504,7 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); + chan->flush_notify = NULL; nv50_unmap_vbufs(nv50); /* XXX: not sure what to do if ret != TRUE: flush and retry? @@ -637,6 +642,7 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, if (!nv50_state_validate(nv50, 0)) return; + chan->flush_notify = nv50_state_flush_notify; nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); @@ -664,6 +670,8 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); } + + chan->flush_notify = NULL; nv50_unmap_vbufs(nv50); so_ref(NULL, &nv50->state.instbuf); @@ -682,6 +690,7 @@ nv50_draw_elements(struct pipe_context *pipe, if (!nv50_state_validate(nv50, 14)) return; + chan->flush_notify = nv50_state_flush_notify; BEGIN_RING(chan, tesla, 0x142c, 1); OUT_RING (chan, 0); @@ -720,6 +729,7 @@ nv50_draw_elements(struct pipe_context *pipe, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); + chan->flush_notify = NULL; } static INLINE boolean -- cgit v1.2.3 From 2a84db24b33993844ba5e5c036edca78718d2425 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 3 Mar 2010 15:02:53 +1000 Subject: nv50: remove pre_pipebuffer_map hack.... --- src/gallium/drivers/nv50/nv50_screen.c | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index b530de64b6..2a1b64ffdc 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -202,28 +202,6 @@ nv50_screen_destroy(struct pipe_screen *pscreen) FREE(screen); } -static int -nv50_pre_pipebuffer_map(struct pipe_screen *pscreen, struct pipe_buffer *pb, - unsigned usage) -{ - struct nv50_screen *screen = nv50_screen(pscreen); - struct nv50_context *ctx = screen->cur_ctx; - - if (!(pb->usage & PIPE_BUFFER_USAGE_VERTEX)) - return 0; - - /* Our vtxbuf got mapped, it can no longer be considered part of current - * state, remove it to avoid emitting reloc markers. - */ - if (ctx && ctx->state.hw[17] && so_bo_is_reloc(ctx->state.hw[17], - nouveau_bo(pb))) { - so_ref(NULL, &ctx->state.hw[17]); - ctx->dirty |= NV50_NEW_ARRAYS; - } - - return 0; -} - struct pipe_screen * nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) { @@ -252,7 +230,6 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) pscreen->get_paramf = nv50_screen_get_paramf; pscreen->is_format_supported = nv50_screen_is_format_supported; pscreen->context_create = nv50_create; - screen->base.pre_pipebuffer_map_callback = nv50_pre_pipebuffer_map; nv50_screen_init_miptree_functions(pscreen); nv50_transfer_init_screen_functions(pscreen); -- cgit v1.2.3 From 0e6af1fcaaca6be94a1a0aba287a569299e27295 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 4 Mar 2010 09:52:47 +1000 Subject: nv50: avoid unnecessary vp/gp/fp state changes --- src/gallium/drivers/nv50/nv50_program.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 50bb982076..c857816b31 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -4286,6 +4286,9 @@ nv50_vertprog_validate(struct nv50_context *nv50) nv50_program_validate_data(nv50, p); nv50_program_validate_code(nv50, p); + if (!(nv50->dirty & NV50_NEW_VERTPROG)) + return NULL; + so = so_new(5, 7, 2); so_method(so, tesla, NV50TCL_VP_ADDRESS_HIGH, 2); so_reloc (so, p->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | @@ -4320,6 +4323,9 @@ nv50_fragprog_validate(struct nv50_context *nv50) nv50_program_validate_data(nv50, p); nv50_program_validate_code(nv50, p); + if (!(nv50->dirty & NV50_NEW_FRAGPROG)) + return NULL; + so = so_new(6, 7, 2); so_method(so, tesla, NV50TCL_FP_ADDRESS_HIGH, 2); so_reloc (so, p->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | @@ -4355,6 +4361,9 @@ nv50_geomprog_validate(struct nv50_context *nv50) nv50_program_validate_data(nv50, p); nv50_program_validate_code(nv50, p); + if (!(nv50->dirty & NV50_NEW_GEOMPROG)) + return NULL; + so = so_new(6, 7, 2); so_method(so, tesla, NV50TCL_GP_ADDRESS_HIGH, 2); so_reloc (so, p->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | -- cgit v1.2.3 From 885d2eceb1517fa11be902ef826de3ba8620d085 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 4 Mar 2010 10:55:50 +1000 Subject: nv50: move magic 0x142c stuff to after state emission --- src/gallium/drivers/nv50/nv50_state_validate.c | 9 ++++++++- src/gallium/drivers/nv50/nv50_vbo.c | 10 ---------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 12e427d38b..0f27605372 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -408,7 +408,8 @@ boolean nv50_state_validate(struct nv50_context *nv50, unsigned wait_dwords) { struct nouveau_channel *chan = nv50->screen->base.channel; - unsigned nr_relocs = 128, nr_dwords = wait_dwords + 128; + struct nouveau_grobj *tesla = nv50->screen->tesla; + unsigned nr_relocs = 128, nr_dwords = wait_dwords + 128 + 4; int ret, i; for (i = 0; i < validate_list_len; i++) { @@ -466,6 +467,12 @@ nv50_state_validate(struct nv50_context *nv50, unsigned wait_dwords) * still. This can cause all sorts of fun issues. */ nv50_state_flush_notify(chan); + + /* No idea.. */ + BEGIN_RING(chan, tesla, 0x142c, 1); + OUT_RING (chan, 0); + BEGIN_RING(chan, tesla, 0x142c, 1); + OUT_RING (chan, 0); return TRUE; } diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 215dfb74fc..c099afe212 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -485,11 +485,6 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, return; chan->flush_notify = nv50_state_flush_notify; - BEGIN_RING(chan, tesla, 0x142c, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, tesla, 0x142c, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); OUT_RING (chan, nv50_prim(mode)); @@ -692,11 +687,6 @@ nv50_draw_elements(struct pipe_context *pipe, return; chan->flush_notify = nv50_state_flush_notify; - BEGIN_RING(chan, tesla, 0x142c, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, tesla, 0x142c, 1); - OUT_RING (chan, 0); - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); OUT_RING (chan, nv50_prim(mode)); -- cgit v1.2.3 From 2b8c0cf16959c07341309484da41b2e9a17e5266 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 4 Mar 2010 11:13:51 +1000 Subject: nv50: make use of scissor enable/disable method --- src/gallium/drivers/nv50/nv50_context.h | 1 - src/gallium/drivers/nv50/nv50_screen.c | 4 ---- src/gallium/drivers/nv50/nv50_state.c | 5 ++++- src/gallium/drivers/nv50/nv50_state_validate.c | 23 ++++------------------- 4 files changed, 8 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index ef0e99f0b1..973fdd23a2 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -126,7 +126,6 @@ struct nv50_state { struct nouveau_stateobj *hw[64]; uint64_t hw_dirty; - unsigned scissor_enabled; unsigned miptree_nr[PIPE_SHADER_TYPES]; struct nouveau_stateobj *vtxbuf; struct nouveau_stateobj *vtxattr; diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 2a1b64ffdc..114ae9b386 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -485,10 +485,6 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) so_method(so, screen->tesla, NV50TCL_LINKED_TSC, 1); so_data (so, 1); - /* activate first scissor rectangle */ - so_method(so, screen->tesla, NV50TCL_SCISSOR_ENABLE(0), 1); - so_data (so, 1); - so_method(so, screen->tesla, NV50TCL_EDGEFLAG_ENABLE, 1); so_data (so, 1); /* default edgeflag to TRUE */ diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index ffbf3473a1..b0e5552eff 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -302,7 +302,7 @@ static void * nv50_rasterizer_state_create(struct pipe_context *pipe, const struct pipe_rasterizer_state *cso) { - struct nouveau_stateobj *so = so_new(15, 21, 0); + struct nouveau_stateobj *so = so_new(16, 22, 0); struct nouveau_grobj *tesla = nv50_context(pipe)->screen->tesla; struct nv50_rasterizer_stateobj *rso = CALLOC_STRUCT(nv50_rasterizer_stateobj); @@ -314,6 +314,9 @@ nv50_rasterizer_state_create(struct pipe_context *pipe, * - point_sprite / sprite_coord_mode */ + so_method(so, tesla, NV50TCL_SCISSOR_ENABLE(0), 1); + so_data (so, cso->scissor); + so_method(so, tesla, NV50TCL_SHADE_MODEL, 1); so_data (so, cso->flatshade ? NV50TCL_SHADE_MODEL_FLAT : NV50TCL_SHADE_MODEL_SMOOTH); diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 0f27605372..2aaee31c0e 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -167,9 +167,6 @@ validate_fb(struct nv50_context *nv50) so_data (so, w << 16); so_data (so, h << 16); - /* we set scissors to framebuffer size when they're 'turned off' */ - nv50->dirty |= NV50_NEW_SCISSOR; - so_ref(NULL, &nv50->state.hw[12]); return so; } @@ -264,26 +261,14 @@ validate_stipple(struct nv50_context *nv50) static struct nouveau_stateobj * validate_scissor(struct nv50_context *nv50) { - struct pipe_rasterizer_state *rast = &nv50->rasterizer->pipe; - struct pipe_scissor_state *s = &nv50->scissor; struct nouveau_grobj *tesla = nv50->screen->tesla; + struct pipe_scissor_state *s = &nv50->scissor; struct nouveau_stateobj *so; - if (nv50->state.hw[12] && - (rast->scissor == 0 && nv50->state.scissor_enabled == 0)) - return NULL; - nv50->state.scissor_enabled = rast->scissor; - so = so_new(1, 2, 0); so_method(so, tesla, NV50TCL_SCISSOR_HORIZ(0), 2); - if (nv50->state.scissor_enabled) { - so_data(so, (s->maxx << 16) | s->minx); - so_data(so, (s->maxy << 16) | s->miny); - } else { - so_data(so, (nv50->framebuffer.width << 16)); - so_data(so, (nv50->framebuffer.height << 16)); - } - + so_data (so, (s->maxx << 16) | s->minx); + so_data (so, (s->maxy << 16) | s->miny); return so; } @@ -374,7 +359,7 @@ struct state_validate { { validate_blend_colour , NV50_NEW_BLEND_COLOUR }, { validate_stencil_ref , NV50_NEW_STENCIL_REF }, { validate_stipple , NV50_NEW_STIPPLE }, - { validate_scissor , NV50_NEW_SCISSOR | NV50_NEW_RASTERIZER }, + { validate_scissor , NV50_NEW_SCISSOR }, { validate_viewport , NV50_NEW_VIEWPORT }, { validate_sampler , NV50_NEW_SAMPLER }, { nv50_tex_validate , NV50_NEW_TEXTURE | NV50_NEW_SAMPLER }, -- cgit v1.2.3 From a527716e81a81f73c73d3744b4803c27a053ade2 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 4 Mar 2010 13:47:41 +1000 Subject: nv50: rip out inline push draw paths temporarily --- src/gallium/drivers/nv50/nv50_context.h | 2 - src/gallium/drivers/nv50/nv50_vbo.c | 561 +------------------------------- 2 files changed, 12 insertions(+), 551 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 973fdd23a2..15f33fa4f4 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -163,8 +163,6 @@ struct nv50_context { unsigned sampler_nr[PIPE_SHADER_TYPES]; struct nv50_miptree *miptree[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; unsigned miptree_nr[PIPE_SHADER_TYPES]; - - uint16_t vbo_fifo; }; static INLINE struct nv50_context * diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index c099afe212..bab9530852 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -27,18 +27,6 @@ #include "nv50_context.h" -static boolean -nv50_push_elements_u08(struct nv50_context *, uint8_t *, unsigned); - -static boolean -nv50_push_elements_u16(struct nv50_context *, uint16_t *, unsigned); - -static boolean -nv50_push_elements_u32(struct nv50_context *, uint32_t *, unsigned); - -static boolean -nv50_push_arrays(struct nv50_context *, unsigned, unsigned); - #define NV50_USING_LOATHED_EDGEFLAG(ctx) ((ctx)->vertprog->cfg.edgeflag_in < 16) static INLINE unsigned @@ -162,61 +150,6 @@ nv50_vbo_vtxelt_to_hw(struct pipe_vertex_element *ve) return (hw_type | hw_size); } -/* For instanced drawing from user buffers, hitting the FIFO repeatedly - * with the same vertex data is probably worse than uploading all data. - */ -static boolean -nv50_upload_vtxbuf(struct nv50_context *nv50, unsigned i) -{ - struct nv50_screen *nscreen = nv50->screen; - struct pipe_screen *pscreen = &nscreen->base.base; - struct pipe_buffer *buf = nscreen->strm_vbuf[i]; - struct pipe_vertex_buffer *vb = &nv50->vtxbuf[i]; - uint8_t *src; - unsigned size = align(vb->buffer->size, 4096); - - if (buf && buf->size < size) - pipe_buffer_reference(&nscreen->strm_vbuf[i], NULL); - - if (!nscreen->strm_vbuf[i]) { - nscreen->strm_vbuf[i] = pipe_buffer_create( - pscreen, 0, PIPE_BUFFER_USAGE_VERTEX, size); - buf = nscreen->strm_vbuf[i]; - } - - src = pipe_buffer_map(pscreen, vb->buffer, PIPE_BUFFER_USAGE_CPU_READ); - if (!src) - return FALSE; - src += vb->buffer_offset; - - size = (vb->max_index + 1) * vb->stride + 16; /* + 16 is for stride 0 */ - if (vb->buffer_offset + size > vb->buffer->size) - size = vb->buffer->size - vb->buffer_offset; - - pipe_buffer_write(pscreen, buf, vb->buffer_offset, size, src); - pipe_buffer_unmap(pscreen, vb->buffer); - - vb->buffer = buf; /* don't pipe_reference, this is a private copy */ - return TRUE; -} - -static void -nv50_upload_user_vbufs(struct nv50_context *nv50) -{ - unsigned i; - - if (nv50->vbo_fifo) - nv50->dirty |= NV50_NEW_ARRAYS; - if (!(nv50->dirty & NV50_NEW_ARRAYS)) - return; - - for (i = 0; i < nv50->vtxbuf_nr; ++i) { - if (nv50->vtxbuf[i].buffer->usage & PIPE_BUFFER_USAGE_VERTEX) - continue; - nv50_upload_vtxbuf(nv50, i); - } -} - static void nv50_set_static_vtxattr(struct nv50_context *nv50, unsigned i, void *data) { @@ -257,36 +190,6 @@ nv50_set_static_vtxattr(struct nv50_context *nv50, unsigned i, void *data) } } -static unsigned -init_per_instance_arrays_immd(struct nv50_context *nv50, - unsigned startInstance, - unsigned pos[16], unsigned step[16]) -{ - struct nouveau_bo *bo; - unsigned i, b, count = 0; - - for (i = 0; i < nv50->vtxelt->num_elements; ++i) { - if (!nv50->vtxelt->pipe[i].instance_divisor) - continue; - ++count; - b = nv50->vtxelt->pipe[i].vertex_buffer_index; - - pos[i] = nv50->vtxelt->pipe[i].src_offset + - nv50->vtxbuf[b].buffer_offset + - startInstance * nv50->vtxbuf[b].stride; - step[i] = startInstance % - nv50->vtxelt->pipe[i].instance_divisor; - - bo = nouveau_bo(nv50->vtxbuf[b].buffer); - if (!bo->map) - nouveau_bo_map(bo, NOUVEAU_BO_RD); - - nv50_set_static_vtxattr(nv50, i, (uint8_t *)bo->map + pos[i]); - } - - return count; -} - static unsigned init_per_instance_arrays(struct nv50_context *nv50, unsigned startInstance, @@ -299,10 +202,6 @@ init_per_instance_arrays(struct nv50_context *nv50, unsigned i, b, count = 0, num_elements = nv50->vtxelt->num_elements; const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; - if (nv50->vbo_fifo) - return init_per_instance_arrays_immd(nv50, startInstance, - pos, step); - so = so_new(num_elements, num_elements * 2, num_elements * 2); for (i = 0; i < nv50->vtxelt->num_elements; ++i) { @@ -338,28 +237,6 @@ init_per_instance_arrays(struct nv50_context *nv50, return count; } -static void -step_per_instance_arrays_immd(struct nv50_context *nv50, - unsigned pos[16], unsigned step[16]) -{ - struct nouveau_bo *bo; - unsigned i, b; - - for (i = 0; i < nv50->vtxelt->num_elements; ++i) { - if (!nv50->vtxelt->pipe[i].instance_divisor) - continue; - if (++step[i] != nv50->vtxelt->pipe[i].instance_divisor) - continue; - b = nv50->vtxelt->pipe[i].vertex_buffer_index; - bo = nouveau_bo(nv50->vtxbuf[b].buffer); - - step[i] = 0; - pos[i] += nv50->vtxbuf[b].stride; - - nv50_set_static_vtxattr(nv50, i, (uint8_t *)bo->map + pos[i]); - } -} - static void step_per_instance_arrays(struct nv50_context *nv50, unsigned pos[16], unsigned step[16]) @@ -371,11 +248,6 @@ step_per_instance_arrays(struct nv50_context *nv50, unsigned i, b, num_elements = nv50->vtxelt->num_elements; const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; - if (nv50->vbo_fifo) { - step_per_instance_arrays_immd(nv50, pos, step); - return; - } - so = so_new(num_elements, num_elements * 2, num_elements * 2); for (i = 0; i < nv50->vtxelt->num_elements; ++i) { @@ -401,16 +273,6 @@ step_per_instance_arrays(struct nv50_context *nv50, so_emit(chan, nv50->state.instbuf); } -static INLINE void -nv50_unmap_vbufs(struct nv50_context *nv50) -{ - unsigned i; - - for (i = 0; i < nv50->vtxbuf_nr; ++i) - if (nouveau_bo(nv50->vtxbuf[i].buffer)->map) - nouveau_bo_unmap(nouveau_bo(nv50->vtxbuf[i].buffer)); -} - void nv50_draw_arrays_instanced(struct pipe_context *pipe, unsigned mode, unsigned start, unsigned count, @@ -422,9 +284,6 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, unsigned i, nz_divisors; unsigned step[16], pos[16]; - if (!NV50_USING_LOATHED_EDGEFLAG(nv50)) - nv50_upload_user_vbufs(nv50); - if (!nv50_state_validate(nv50, 0)) return; chan->flush_notify = nv50_state_flush_notify; @@ -437,14 +296,9 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); OUT_RING (chan, nv50_prim(mode)); - - if (nv50->vbo_fifo) - nv50_push_arrays(nv50, start, count); - else { - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); - OUT_RING (chan, start); - OUT_RING (chan, count); - } + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); + OUT_RING (chan, start); + OUT_RING (chan, count); BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); @@ -454,20 +308,14 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); OUT_RING (chan, nv50_prim(mode) | (1 << 28)); - - if (nv50->vbo_fifo) - nv50_push_arrays(nv50, start, count); - else { - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); - OUT_RING (chan, start); - OUT_RING (chan, count); - } + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); + OUT_RING (chan, start); + OUT_RING (chan, count); BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); } chan->flush_notify = NULL; - nv50_unmap_vbufs(nv50); so_ref(NULL, &nv50->state.instbuf); } @@ -479,7 +327,6 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, struct nv50_context *nv50 = nv50_context(pipe); struct nouveau_channel *chan = nv50->screen->tesla->channel; struct nouveau_grobj *tesla = nv50->screen->tesla; - boolean ret; if (!nv50_state_validate(nv50, 11)) return; @@ -487,24 +334,13 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); OUT_RING (chan, nv50_prim(mode)); - - if (nv50->vbo_fifo) - ret = nv50_push_arrays(nv50, start, count); - else { - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); - OUT_RING (chan, start); - OUT_RING (chan, count); - ret = TRUE; - } + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); + OUT_RING (chan, start); + OUT_RING (chan, count); BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); chan->flush_notify = NULL; - nv50_unmap_vbufs(nv50); - - /* XXX: not sure what to do if ret != TRUE: flush and retry? - */ - assert(ret); } static INLINE boolean @@ -516,9 +352,6 @@ nv50_draw_elements_inline_u08(struct nv50_context *nv50, uint8_t *map, map += start; - if (nv50->vbo_fifo) - return nv50_push_elements_u08(nv50, map, count); - if (count & 1) { BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32, 1); OUT_RING (chan, map[0]); @@ -549,9 +382,6 @@ nv50_draw_elements_inline_u16(struct nv50_context *nv50, uint16_t *map, map += start; - if (nv50->vbo_fifo) - return nv50_push_elements_u16(nv50, map, count); - if (count & 1) { BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32, 1); OUT_RING (chan, map[0]); @@ -582,9 +412,6 @@ nv50_draw_elements_inline_u32(struct nv50_context *nv50, uint32_t *map, map += start; - if (nv50->vbo_fifo) - return nv50_push_elements_u32(nv50, map, count); - while (count) { unsigned nr = count > 2047 ? 2047 : count; @@ -632,9 +459,6 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, map = pipe_buffer_map(pscreen, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ); - if (!NV50_USING_LOATHED_EDGEFLAG(nv50)) - nv50_upload_user_vbufs(nv50); - if (!nv50_state_validate(nv50, 0)) return; chan->flush_notify = nv50_state_flush_notify; @@ -667,7 +491,6 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, } chan->flush_notify = NULL; - nv50_unmap_vbufs(nv50); so_ref(NULL, &nv50->state.instbuf); } @@ -690,13 +513,13 @@ nv50_draw_elements(struct pipe_context *pipe, BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); OUT_RING (chan, nv50_prim(mode)); - if (!nv50->vbo_fifo && indexSize == 4) { + if (indexSize == 4) { BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32 | 0x30000, 0); OUT_RING (chan, count); nouveau_pushbuf_submit(chan, nouveau_bo(indexBuffer), start << 2, count << 2); } else - if (!nv50->vbo_fifo && indexSize == 2) { + if (indexSize == 2) { unsigned vb_start = (start & ~1); unsigned vb_end = (start + count + 1) & ~1; unsigned dwords = (vb_end - vb_start) >> 1; @@ -713,7 +536,6 @@ nv50_draw_elements(struct pipe_context *pipe, map = pipe_buffer_map(pscreen, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ); nv50_draw_elements_inline(nv50, map, indexSize, start, count); - nv50_unmap_vbufs(nv50); pipe_buffer_unmap(pscreen, indexBuffer); } @@ -806,15 +628,8 @@ nv50_vbo_validate(struct nv50_context *nv50) /* don't validate if Gallium took away our buffers */ if (nv50->vtxbuf_nr == 0) return NULL; - nv50->vbo_fifo = 0; - for (i = 0; i < nv50->vtxbuf_nr; ++i) - if (nv50->vtxbuf[i].stride && - !(nv50->vtxbuf[i].buffer->usage & PIPE_BUFFER_USAGE_VERTEX)) - nv50->vbo_fifo = 0xffff; - - if (NV50_USING_LOATHED_EDGEFLAG(nv50)) - nv50->vbo_fifo = 0xffff; /* vertprog can't set edgeflag */ + assert(!NV50_USING_LOATHED_EDGEFLAG(nv50)); n_ve = MAX2(nv50->vtxelt->num_elements, nv50->state.vtxelt_nr); @@ -837,19 +652,9 @@ nv50_vbo_validate(struct nv50_context *nv50) so_method(vtxbuf, tesla, NV50TCL_VERTEX_ARRAY_FORMAT(i), 1); so_data (vtxbuf, 0); - - nv50->vbo_fifo &= ~(1 << i); continue; } - if (nv50->vbo_fifo) { - so_data (vtxfmt, hw | - (ve->instance_divisor ? (1 << 4) : i)); - so_method(vtxbuf, tesla, - NV50TCL_VERTEX_ARRAY_FORMAT(i), 1); - so_data (vtxbuf, 0); - continue; - } so_data(vtxfmt, hw | i); so_method(vtxbuf, tesla, NV50TCL_VERTEX_ARRAY_FORMAT(i), 3); @@ -886,346 +691,4 @@ nv50_vbo_validate(struct nv50_context *nv50) return vtxfmt; } -typedef void (*pfn_push)(struct nouveau_channel *, void *); - -struct nv50_vbo_emitctx -{ - pfn_push push[16]; - uint8_t *map[16]; - unsigned stride[16]; - unsigned nr_ve; - unsigned vtx_dwords; - unsigned vtx_max; - - float edgeflag; - unsigned ve_edgeflag; -}; -static INLINE void -emit_vtx_next(struct nouveau_channel *chan, struct nv50_vbo_emitctx *emit) -{ - unsigned i; - - for (i = 0; i < emit->nr_ve; ++i) { - emit->push[i](chan, emit->map[i]); - emit->map[i] += emit->stride[i]; - } -} - -static INLINE void -emit_vtx(struct nouveau_channel *chan, struct nv50_vbo_emitctx *emit, - uint32_t vi) -{ - unsigned i; - - for (i = 0; i < emit->nr_ve; ++i) - emit->push[i](chan, emit->map[i] + emit->stride[i] * vi); -} - -static INLINE boolean -nv50_map_vbufs(struct nv50_context *nv50) -{ - int i; - - for (i = 0; i < nv50->vtxbuf_nr; ++i) { - struct pipe_vertex_buffer *vb = &nv50->vtxbuf[i]; - unsigned size = vb->stride * (vb->max_index + 1) + 16; - - if (nouveau_bo(vb->buffer)->map) - continue; - - size = vb->stride * (vb->max_index + 1) + 16; - size = MIN2(size, vb->buffer->size); - if (!size) - size = vb->buffer->size; - - if (nouveau_bo_map_range(nouveau_bo(vb->buffer), - 0, size, NOUVEAU_BO_RD)) - break; - } - - if (i == nv50->vtxbuf_nr) - return TRUE; - for (; i >= 0; --i) - nouveau_bo_unmap(nouveau_bo(nv50->vtxbuf[i].buffer)); - return FALSE; -} - -static void -emit_b32_1(struct nouveau_channel *chan, void *data) -{ - uint32_t *v = data; - - OUT_RING(chan, v[0]); -} - -static void -emit_b32_2(struct nouveau_channel *chan, void *data) -{ - uint32_t *v = data; - - OUT_RING(chan, v[0]); - OUT_RING(chan, v[1]); -} - -static void -emit_b32_3(struct nouveau_channel *chan, void *data) -{ - uint32_t *v = data; - - OUT_RING(chan, v[0]); - OUT_RING(chan, v[1]); - OUT_RING(chan, v[2]); -} - -static void -emit_b32_4(struct nouveau_channel *chan, void *data) -{ - uint32_t *v = data; - - OUT_RING(chan, v[0]); - OUT_RING(chan, v[1]); - OUT_RING(chan, v[2]); - OUT_RING(chan, v[3]); -} - -static void -emit_b16_1(struct nouveau_channel *chan, void *data) -{ - uint16_t *v = data; - - OUT_RING(chan, v[0]); -} - -static void -emit_b16_3(struct nouveau_channel *chan, void *data) -{ - uint16_t *v = data; - - OUT_RING(chan, (v[1] << 16) | v[0]); - OUT_RING(chan, v[2]); -} - -static void -emit_b08_1(struct nouveau_channel *chan, void *data) -{ - uint8_t *v = data; - - OUT_RING(chan, v[0]); -} - -static void -emit_b08_3(struct nouveau_channel *chan, void *data) -{ - uint8_t *v = data; - - OUT_RING(chan, (v[2] << 16) | (v[1] << 8) | v[0]); -} - -static boolean -emit_prepare(struct nv50_context *nv50, struct nv50_vbo_emitctx *emit, - unsigned start) -{ - unsigned i; - - if (nv50_map_vbufs(nv50) == FALSE) - return FALSE; - - emit->ve_edgeflag = nv50->vertprog->cfg.edgeflag_in; - - emit->edgeflag = 0.5f; - emit->nr_ve = 0; - emit->vtx_dwords = 0; - - for (i = 0; i < nv50->vtxelt->num_elements; ++i) { - struct pipe_vertex_element *ve; - struct pipe_vertex_buffer *vb; - unsigned n, size, nr_components; - const struct util_format_description *desc; - - ve = &nv50->vtxelt->pipe[i]; - vb = &nv50->vtxbuf[ve->vertex_buffer_index]; - if (!(nv50->vbo_fifo & (1 << i)) || ve->instance_divisor) - continue; - n = emit->nr_ve++; - - emit->stride[n] = vb->stride; - emit->map[n] = (uint8_t *)nouveau_bo(vb->buffer)->map + - vb->buffer_offset + - (start * vb->stride + ve->src_offset); - - desc = util_format_description(ve->src_format); - assert(desc); - - size = util_format_get_component_bits( - ve->src_format, UTIL_FORMAT_COLORSPACE_RGB, 0); - nr_components = util_format_get_nr_components(ve->src_format); - - assert(nr_components > 0 && nr_components <= 4); - - /* It shouldn't be necessary to push the implicit 1s - * for case 3 and size 8 cases 1, 2, 3. - */ - switch (size) { - default: - NOUVEAU_ERR("unsupported vtxelt size: %u\n", size); - return FALSE; - case 32: - switch (nr_components) { - case 1: emit->push[n] = emit_b32_1; break; - case 2: emit->push[n] = emit_b32_2; break; - case 3: emit->push[n] = emit_b32_3; break; - case 4: emit->push[n] = emit_b32_4; break; - } - emit->vtx_dwords += nr_components; - break; - case 16: - switch (nr_components) { - case 1: emit->push[n] = emit_b16_1; break; - case 2: emit->push[n] = emit_b32_1; break; - case 3: emit->push[n] = emit_b16_3; break; - case 4: emit->push[n] = emit_b32_2; break; - } - emit->vtx_dwords += (nr_components + 1) >> 1; - break; - case 8: - switch (nr_components) { - case 1: emit->push[n] = emit_b08_1; break; - case 2: emit->push[n] = emit_b16_1; break; - case 3: emit->push[n] = emit_b08_3; break; - case 4: emit->push[n] = emit_b32_1; break; - } - emit->vtx_dwords += 1; - break; - } - } - - emit->vtx_max = 512 / emit->vtx_dwords; - if (emit->ve_edgeflag < 16) - emit->vtx_max = 1; - - return TRUE; -} - -static INLINE void -set_edgeflag(struct nouveau_channel *chan, - struct nouveau_grobj *tesla, - struct nv50_vbo_emitctx *emit, uint32_t index) -{ - unsigned i = emit->ve_edgeflag; - - if (i < 16) { - float f = *((float *)(emit->map[i] + index * emit->stride[i])); - - if (emit->edgeflag != f) { - emit->edgeflag = f; - - BEGIN_RING(chan, tesla, 0x15e4, 1); - OUT_RING (chan, f ? 1 : 0); - } - } -} - -static boolean -nv50_push_arrays(struct nv50_context *nv50, unsigned start, unsigned count) -{ - struct nouveau_channel *chan = nv50->screen->base.channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nv50_vbo_emitctx emit; - - if (emit_prepare(nv50, &emit, start) == FALSE) - return FALSE; - - while (count) { - unsigned i, dw, nr = MIN2(count, emit.vtx_max); - dw = nr * emit.vtx_dwords; - - set_edgeflag(chan, tesla, &emit, 0); /* nr will be 1 */ - - BEGIN_RING_NI(chan, tesla, NV50TCL_VERTEX_DATA, dw); - for (i = 0; i < nr; ++i) - emit_vtx_next(chan, &emit); - - count -= nr; - } - - return TRUE; -} - -static boolean -nv50_push_elements_u32(struct nv50_context *nv50, uint32_t *map, unsigned count) -{ - struct nouveau_channel *chan = nv50->screen->base.channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nv50_vbo_emitctx emit; - - if (emit_prepare(nv50, &emit, 0) == FALSE) - return FALSE; - - while (count) { - unsigned i, dw, nr = MIN2(count, emit.vtx_max); - dw = nr * emit.vtx_dwords; - - set_edgeflag(chan, tesla, &emit, *map); - - BEGIN_RING_NI(chan, tesla, NV50TCL_VERTEX_DATA, dw); - for (i = 0; i < nr; ++i) - emit_vtx(chan, &emit, *map++); - - count -= nr; - } - - return TRUE; -} - -static boolean -nv50_push_elements_u16(struct nv50_context *nv50, uint16_t *map, unsigned count) -{ - struct nouveau_channel *chan = nv50->screen->base.channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nv50_vbo_emitctx emit; - - if (emit_prepare(nv50, &emit, 0) == FALSE) - return FALSE; - - while (count) { - unsigned i, dw, nr = MIN2(count, emit.vtx_max); - dw = nr * emit.vtx_dwords; - - set_edgeflag(chan, tesla, &emit, *map); - - BEGIN_RING_NI(chan, tesla, NV50TCL_VERTEX_DATA, dw); - for (i = 0; i < nr; ++i) - emit_vtx(chan, &emit, *map++); - - count -= nr; - } - - return TRUE; -} - -static boolean -nv50_push_elements_u08(struct nv50_context *nv50, uint8_t *map, unsigned count) -{ - struct nouveau_channel *chan = nv50->screen->base.channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nv50_vbo_emitctx emit; - - if (emit_prepare(nv50, &emit, 0) == FALSE) - return FALSE; - - while (count) { - unsigned i, dw, nr = MIN2(count, emit.vtx_max); - dw = nr * emit.vtx_dwords; - - set_edgeflag(chan, tesla, &emit, *map); - - BEGIN_RING_NI(chan, tesla, NV50TCL_VERTEX_DATA, dw); - for (i = 0; i < nr; ++i) - emit_vtx(chan, &emit, *map++); - - count -= nr; - } - - return TRUE; -} -- cgit v1.2.3 From 621c4609f871d3e84d5f7fd98f11ee9ddf2a1f7c Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 5 Mar 2010 10:08:12 +1000 Subject: nv50: reimplement draw_arrays_instanced(), do draw_arrays() in terms of it This makes draw_arrays()/draw_arrays_instanced() do the right thing and not require the (probably broken anyway) flush_notify() usage. It also fixes a potential bug in the behaviour of reading InstanceID from shaders, where 0 should be read for non-instanced drawing, previously it was possible to read non-0 ids if mixing instanced/non-instanced. --- src/gallium/drivers/nv50/nv50_vbo.c | 278 +++++++++++++++++------------------- 1 file changed, 134 insertions(+), 144 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index bab9530852..5a9728d7be 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -150,127 +150,58 @@ nv50_vbo_vtxelt_to_hw(struct pipe_vertex_element *ve) return (hw_type | hw_size); } -static void -nv50_set_static_vtxattr(struct nv50_context *nv50, unsigned i, void *data) -{ - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_channel *chan = tesla->channel; - float v[4]; - enum pipe_format pf = nv50->vtxelt->pipe[i].src_format; - unsigned nr_components = util_format_get_nr_components(pf); - - util_format_read_4f(pf, v, 0, data, 0, 0, 0, 1, 1); - - switch (nr_components) { - case 4: - BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_4F_X(i), 4); - OUT_RINGf (chan, v[0]); - OUT_RINGf (chan, v[1]); - OUT_RINGf (chan, v[2]); - OUT_RINGf (chan, v[3]); - break; - case 3: - BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_3F_X(i), 3); - OUT_RINGf (chan, v[0]); - OUT_RINGf (chan, v[1]); - OUT_RINGf (chan, v[2]); - break; - case 2: - BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_2F_X(i), 2); - OUT_RINGf (chan, v[0]); - OUT_RINGf (chan, v[1]); - break; - case 1: - BEGIN_RING(chan, tesla, NV50TCL_VTX_ATTR_1F(i), 1); - OUT_RINGf (chan, v[0]); - break; - default: - assert(0); - break; - } -} - -static unsigned -init_per_instance_arrays(struct nv50_context *nv50, - unsigned startInstance, - unsigned pos[16], unsigned step[16]) -{ - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_channel *chan = tesla->channel; +struct instance { struct nouveau_bo *bo; - struct nouveau_stateobj *so; - unsigned i, b, count = 0, num_elements = nv50->vtxelt->num_elements; - const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; + unsigned delta; + unsigned stride; + unsigned step; + unsigned divisor; +}; - so = so_new(num_elements, num_elements * 2, num_elements * 2); +static void +instance_init(struct nv50_context *nv50, struct instance *a, unsigned first) +{ + int i; - for (i = 0; i < nv50->vtxelt->num_elements; ++i) { - if (!nv50->vtxelt->pipe[i].instance_divisor) - continue; - ++count; - b = nv50->vtxelt->pipe[i].vertex_buffer_index; + for (i = 0; i < nv50->vtxelt->num_elements; i++) { + struct pipe_vertex_element *ve = &nv50->vtxelt->pipe[i]; + struct pipe_vertex_buffer *vb; - pos[i] = nv50->vtxelt->pipe[i].src_offset + - nv50->vtxbuf[b].buffer_offset + - startInstance * nv50->vtxbuf[b].stride; + a[i].divisor = ve->instance_divisor; + if (a[i].divisor) { + vb = &nv50->vtxbuf[ve->vertex_buffer_index]; - if (!startInstance) { - step[i] = 0; - continue; + a[i].bo = nouveau_bo(vb->buffer); + a[i].stride = vb->stride; + a[i].step = first % a[i].divisor; + a[i].delta = vb->buffer_offset + ve->src_offset + + (first * a[i].stride); } - step[i] = startInstance % - nv50->vtxelt->pipe[i].instance_divisor; - - bo = nouveau_bo(nv50->vtxbuf[b].buffer); - - so_method(so, tesla, NV50TCL_VERTEX_ARRAY_START_HIGH(i), 2); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_HIGH, 0, 0); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_LOW, 0, 0); - } - - if (count && startInstance) { - so_ref (so, &nv50->state.instbuf); /* for flush notify */ - so_emit(chan, nv50->state.instbuf); } - so_ref (NULL, &so); - - return count; } static void -step_per_instance_arrays(struct nv50_context *nv50, - unsigned pos[16], unsigned step[16]) +instance_step(struct nv50_context *nv50, struct instance *a) { + struct nouveau_channel *chan = nv50->screen->tesla->channel; struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_channel *chan = tesla->channel; - struct nouveau_bo *bo; - struct nouveau_stateobj *so; - unsigned i, b, num_elements = nv50->vtxelt->num_elements; - const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; - - so = so_new(num_elements, num_elements * 2, num_elements * 2); + int i; - for (i = 0; i < nv50->vtxelt->num_elements; ++i) { - if (!nv50->vtxelt->pipe[i].instance_divisor) + for (i = 0; i < nv50->vtxelt->num_elements; i++) { + if (!a[i].divisor) continue; - b = nv50->vtxelt->pipe[i].vertex_buffer_index; - if (++step[i] == nv50->vtxelt->pipe[i].instance_divisor) { - step[i] = 0; - pos[i] += nv50->vtxbuf[b].stride; + BEGIN_RING(chan, tesla, + NV50TCL_VERTEX_ARRAY_START_HIGH(i), 2); + OUT_RELOCh(chan, a[i].bo, a[i].delta, NOUVEAU_BO_RD | + NOUVEAU_BO_VRAM | NOUVEAU_BO_GART); + OUT_RELOCl(chan, a[i].bo, a[i].delta, NOUVEAU_BO_RD | + NOUVEAU_BO_VRAM | NOUVEAU_BO_GART); + if (++a[i].step == a[i].divisor) { + a[i].step = 0; + a[i].delta += a[i].stride; } - - bo = nouveau_bo(nv50->vtxbuf[b].buffer); - - so_method(so, tesla, NV50TCL_VERTEX_ARRAY_START_HIGH(i), 2); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_HIGH, 0, 0); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_LOW, 0, 0); } - - so_ref (so, &nv50->state.instbuf); /* for flush notify */ - so_ref (NULL, &so); - - so_emit(chan, nv50->state.instbuf); } void @@ -281,66 +212,43 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, struct nv50_context *nv50 = nv50_context(pipe); struct nouveau_channel *chan = nv50->screen->tesla->channel; struct nouveau_grobj *tesla = nv50->screen->tesla; - unsigned i, nz_divisors; - unsigned step[16], pos[16]; + struct instance a[16]; + unsigned prim = nv50_prim(mode); - if (!nv50_state_validate(nv50, 0)) + instance_init(nv50, a, startInstance); + if (!nv50_state_validate(nv50, 10 + 16*3)) return; - chan->flush_notify = nv50_state_flush_notify; - - nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 2); OUT_RING (chan, NV50_CB_AUX | (24 << 8)); OUT_RING (chan, startInstance); - - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (chan, nv50_prim(mode)); - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); - OUT_RING (chan, start); - OUT_RING (chan, count); - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); - OUT_RING (chan, 0); - - for (i = 1; i < instanceCount; i++) { - if (nz_divisors) /* any non-zero array divisors ? */ - step_per_instance_arrays(nv50, pos, step); + while (instanceCount--) { + if (AVAIL_RING(chan) < (7 + 16*3)) { + FIRE_RING(chan); + if (!nv50_state_validate(nv50, 7 + 16*3)) { + assert(0); + return; + } + } + instance_step(nv50, a); BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (chan, nv50_prim(mode) | (1 << 28)); + OUT_RING (chan, prim); BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); OUT_RING (chan, start); OUT_RING (chan, count); BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); - } - - chan->flush_notify = NULL; - so_ref(NULL, &nv50->state.instbuf); + prim |= (1 << 28); + } } void nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, unsigned count) { - struct nv50_context *nv50 = nv50_context(pipe); - struct nouveau_channel *chan = nv50->screen->tesla->channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; - - if (!nv50_state_validate(nv50, 11)) - return; - chan->flush_notify = nv50_state_flush_notify; - - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (chan, nv50_prim(mode)); - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BUFFER_FIRST, 2); - OUT_RING (chan, start); - OUT_RING (chan, count); - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); - OUT_RING (chan, 0); - - chan->flush_notify = NULL; + nv50_draw_arrays_instanced(pipe, mode, start, count, 0, 1); } static INLINE boolean @@ -442,6 +350,88 @@ nv50_draw_elements_inline(struct nv50_context *nv50, } } +static unsigned +init_per_instance_arrays(struct nv50_context *nv50, + unsigned startInstance, + unsigned pos[16], unsigned step[16]) +{ + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; + struct nouveau_bo *bo; + struct nouveau_stateobj *so; + unsigned i, b, count = 0; + const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; + + so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 2, nv50->vtxelt_nr * 2); + + for (i = 0; i < nv50->vtxelt_nr; ++i) { + if (!nv50->vtxelt[i].instance_divisor) + continue; + ++count; + b = nv50->vtxelt[i].vertex_buffer_index; + + pos[i] = nv50->vtxelt[i].src_offset + + nv50->vtxbuf[b].buffer_offset + + startInstance * nv50->vtxbuf[b].stride; + + if (!startInstance) { + step[i] = 0; + continue; + } + step[i] = startInstance % nv50->vtxelt[i].instance_divisor; + + bo = nouveau_bo(nv50->vtxbuf[b].buffer); + + so_method(so, tesla, NV50TCL_VERTEX_ARRAY_START_HIGH(i), 2); + so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_HIGH, 0, 0); + so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_LOW, 0, 0); + } + + if (count && startInstance) { + so_ref (so, &nv50->state.instbuf); /* for flush notify */ + so_emit(chan, nv50->state.instbuf); + } + so_ref (NULL, &so); + + return count; +} + +static void +step_per_instance_arrays(struct nv50_context *nv50, + unsigned pos[16], unsigned step[16]) +{ + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; + struct nouveau_bo *bo; + struct nouveau_stateobj *so; + unsigned i, b; + const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; + + so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 2, nv50->vtxelt_nr * 2); + + for (i = 0; i < nv50->vtxelt_nr; ++i) { + if (!nv50->vtxelt[i].instance_divisor) + continue; + b = nv50->vtxelt[i].vertex_buffer_index; + + if (++step[i] == nv50->vtxelt[i].instance_divisor) { + step[i] = 0; + pos[i] += nv50->vtxbuf[b].stride; + } + + bo = nouveau_bo(nv50->vtxbuf[b].buffer); + + so_method(so, tesla, NV50TCL_VERTEX_ARRAY_START_HIGH(i), 2); + so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_HIGH, 0, 0); + so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_LOW, 0, 0); + } + + so_ref (so, &nv50->state.instbuf); /* for flush notify */ + so_ref (NULL, &so); + + so_emit(chan, nv50->state.instbuf); +} + void nv50_draw_elements_instanced(struct pipe_context *pipe, struct pipe_buffer *indexBuffer, -- cgit v1.2.3 From d8a415425e7761a7bed03a0c383cb3839eaf1b4b Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 5 Mar 2010 13:25:01 +1000 Subject: nv50: reimplement draw_elements_instance(), use for draw_elements() too This makes draw_elements()/draw_elements_instanced() do the right thing for the non-inline elements cases, and not require flush_notify(). --- src/gallium/drivers/nv50/nv50_vbo.c | 252 +++++++++++++----------------------- 1 file changed, 93 insertions(+), 159 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 5a9728d7be..54a2fa730a 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -332,104 +332,65 @@ nv50_draw_elements_inline_u32(struct nv50_context *nv50, uint32_t *map, return TRUE; } -static INLINE void -nv50_draw_elements_inline(struct nv50_context *nv50, - void *map, unsigned indexSize, - unsigned start, unsigned count) -{ - switch (indexSize) { - case 1: - nv50_draw_elements_inline_u08(nv50, map, start, count); - break; - case 2: - nv50_draw_elements_inline_u16(nv50, map, start, count); - break; - case 4: - nv50_draw_elements_inline_u32(nv50, map, start, count); - break; - } -} - -static unsigned -init_per_instance_arrays(struct nv50_context *nv50, - unsigned startInstance, - unsigned pos[16], unsigned step[16]) -{ - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_channel *chan = tesla->channel; - struct nouveau_bo *bo; - struct nouveau_stateobj *so; - unsigned i, b, count = 0; - const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; - - so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 2, nv50->vtxelt_nr * 2); - - for (i = 0; i < nv50->vtxelt_nr; ++i) { - if (!nv50->vtxelt[i].instance_divisor) - continue; - ++count; - b = nv50->vtxelt[i].vertex_buffer_index; - - pos[i] = nv50->vtxelt[i].src_offset + - nv50->vtxbuf[b].buffer_offset + - startInstance * nv50->vtxbuf[b].stride; - - if (!startInstance) { - step[i] = 0; - continue; - } - step[i] = startInstance % nv50->vtxelt[i].instance_divisor; - - bo = nouveau_bo(nv50->vtxbuf[b].buffer); - - so_method(so, tesla, NV50TCL_VERTEX_ARRAY_START_HIGH(i), 2); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_HIGH, 0, 0); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_LOW, 0, 0); - } - - if (count && startInstance) { - so_ref (so, &nv50->state.instbuf); /* for flush notify */ - so_emit(chan, nv50->state.instbuf); - } - so_ref (NULL, &so); - - return count; -} - static void -step_per_instance_arrays(struct nv50_context *nv50, - unsigned pos[16], unsigned step[16]) +nv50_draw_elements_inline(struct pipe_context *pipe, + struct pipe_buffer *indexBuffer, unsigned indexSize, + unsigned mode, unsigned start, unsigned count, + unsigned startInstance, unsigned instanceCount) { + struct pipe_screen *pscreen = pipe->screen; + struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_channel *chan = nv50->screen->tesla->channel; struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_channel *chan = tesla->channel; - struct nouveau_bo *bo; - struct nouveau_stateobj *so; - unsigned i, b; - const uint32_t rl = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD; + struct instance a[16]; + unsigned prim = nv50_prim(mode); + void *map; - so = so_new(nv50->vtxelt_nr, nv50->vtxelt_nr * 2, nv50->vtxelt_nr * 2); + map = pipe_buffer_map(pscreen, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ); + assert(map); + if (!map) + return; - for (i = 0; i < nv50->vtxelt_nr; ++i) { - if (!nv50->vtxelt[i].instance_divisor) - continue; - b = nv50->vtxelt[i].vertex_buffer_index; + instance_init(nv50, a, startInstance); + if (!nv50_state_validate(nv50, 0)) + return; - if (++step[i] == nv50->vtxelt[i].instance_divisor) { - step[i] = 0; - pos[i] += nv50->vtxbuf[b].stride; + BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 2); + OUT_RING (chan, NV50_CB_AUX | (24 << 8)); + OUT_RING (chan, startInstance); + while (instanceCount--) { + if (AVAIL_RING(chan) < (7 + 16*3)) { + FIRE_RING(chan); + if (!nv50_state_validate(nv50, 0)) { + assert(0); + return; + } } + instance_step(nv50, a); - bo = nouveau_bo(nv50->vtxbuf[b].buffer); + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); + OUT_RING (chan, prim); + switch (indexSize) { + case 1: + nv50_draw_elements_inline_u08(nv50, map, start, count); + break; + case 2: + nv50_draw_elements_inline_u16(nv50, map, start, count); + break; + case 4: + nv50_draw_elements_inline_u32(nv50, map, start, count); + break; + default: + assert(0); + break; + } + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); + OUT_RING (chan, 0); - so_method(so, tesla, NV50TCL_VERTEX_ARRAY_START_HIGH(i), 2); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_HIGH, 0, 0); - so_reloc (so, bo, pos[i], rl | NOUVEAU_BO_LOW, 0, 0); + prim |= (1 << 28); } - so_ref (so, &nv50->state.instbuf); /* for flush notify */ - so_ref (NULL, &so); - - so_emit(chan, nv50->state.instbuf); + pipe_buffer_unmap(pscreen, indexBuffer); } void @@ -440,49 +401,62 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, unsigned startInstance, unsigned instanceCount) { struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_channel *chan = nv50->screen->tesla->channel; struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_channel *chan = tesla->channel; - struct pipe_screen *pscreen = pipe->screen; - void *map; - unsigned i, nz_divisors; - unsigned step[16], pos[16]; - - map = pipe_buffer_map(pscreen, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ); + struct instance a[16]; + unsigned prim = nv50_prim(mode); - if (!nv50_state_validate(nv50, 0)) + if (indexSize == 1) { + nv50_draw_elements_inline(pipe, indexBuffer, indexSize, + mode, start, count, startInstance, + instanceCount); return; - chan->flush_notify = nv50_state_flush_notify; + } - nz_divisors = init_per_instance_arrays(nv50, startInstance, pos, step); + instance_init(nv50, a, startInstance); + if (!nv50_state_validate(nv50, 13 + 16*3)) + return; BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 2); OUT_RING (chan, NV50_CB_AUX | (24 << 8)); OUT_RING (chan, startInstance); - - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (chan, nv50_prim(mode)); - - nv50_draw_elements_inline(nv50, map, indexSize, start, count); - - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); - OUT_RING (chan, 0); - - for (i = 1; i < instanceCount; ++i) { - if (nz_divisors) /* any non-zero array divisors ? */ - step_per_instance_arrays(nv50, pos, step); + while (instanceCount--) { + if (AVAIL_RING(chan) < (7 + 16*3)) { + FIRE_RING(chan); + if (!nv50_state_validate(nv50, 10 + 16*3)) { + assert(0); + return; + } + } + instance_step(nv50, a); BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (chan, nv50_prim(mode) | (1 << 28)); - - nv50_draw_elements_inline(nv50, map, indexSize, start, count); - + OUT_RING (chan, prim); + if (indexSize == 4) { + BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32 | 0x30000, 0); + OUT_RING (chan, count); + nouveau_pushbuf_submit(chan, nouveau_bo(indexBuffer), + start << 2, count << 2); + } else + if (indexSize == 2) { + unsigned vb_start = (start & ~1); + unsigned vb_end = (start + count + 1) & ~1; + unsigned dwords = (vb_end - vb_start) >> 1; + + BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U16_SETUP, 1); + OUT_RING (chan, ((start & 1) << 31) | count); + BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U16 | 0x30000, 0); + OUT_RING (chan, dwords); + nouveau_pushbuf_submit(chan, nouveau_bo(indexBuffer), + vb_start << 1, dwords << 2); + BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U16_SETUP, 1); + OUT_RING (chan, 0); + } BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); OUT_RING (chan, 0); - } - chan->flush_notify = NULL; - - so_ref(NULL, &nv50->state.instbuf); + prim |= (1 << 28); + } } void @@ -490,48 +464,8 @@ nv50_draw_elements(struct pipe_context *pipe, struct pipe_buffer *indexBuffer, unsigned indexSize, unsigned mode, unsigned start, unsigned count) { - struct nv50_context *nv50 = nv50_context(pipe); - struct nouveau_channel *chan = nv50->screen->tesla->channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; - struct pipe_screen *pscreen = pipe->screen; - void *map; - - if (!nv50_state_validate(nv50, 14)) - return; - chan->flush_notify = nv50_state_flush_notify; - - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (chan, nv50_prim(mode)); - - if (indexSize == 4) { - BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32 | 0x30000, 0); - OUT_RING (chan, count); - nouveau_pushbuf_submit(chan, nouveau_bo(indexBuffer), - start << 2, count << 2); - } else - if (indexSize == 2) { - unsigned vb_start = (start & ~1); - unsigned vb_end = (start + count + 1) & ~1; - unsigned dwords = (vb_end - vb_start) >> 1; - - BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U16_SETUP, 1); - OUT_RING (chan, ((start & 1) << 31) | count); - BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U16 | 0x30000, 0); - OUT_RING (chan, dwords); - nouveau_pushbuf_submit(chan, nouveau_bo(indexBuffer), - vb_start << 1, dwords << 2); - BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U16_SETUP, 1); - OUT_RING (chan, 0); - } else { - map = pipe_buffer_map(pscreen, indexBuffer, - PIPE_BUFFER_USAGE_CPU_READ); - nv50_draw_elements_inline(nv50, map, indexSize, start, count); - pipe_buffer_unmap(pscreen, indexBuffer); - } - - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); - OUT_RING (chan, 0); - chan->flush_notify = NULL; + nv50_draw_elements_instanced(pipe, indexBuffer, indexSize, + mode, start, count, 0, 1); } static INLINE boolean -- cgit v1.2.3 From 0842829c1813d47e6fdf3de09167d243c029cc90 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 8 Mar 2010 13:27:46 +1000 Subject: nv50: when doing inline indices, split elt lists so they fit into pushbuf --- src/gallium/drivers/nouveau/nouveau_util.h | 100 +++++++++++++++ src/gallium/drivers/nv50/nv50_vbo.c | 187 ++++++++++++++++------------- 2 files changed, 202 insertions(+), 85 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_util.h b/src/gallium/drivers/nouveau/nouveau_util.h index a10114beab..7f16e31c3f 100644 --- a/src/gallium/drivers/nouveau/nouveau_util.h +++ b/src/gallium/drivers/nouveau/nouveau_util.h @@ -88,4 +88,104 @@ static INLINE unsigned log2i(unsigned i) return r; } +struct u_split_prim { + void *priv; + void (*emit)(void *priv, unsigned start, unsigned count); + void (*edge)(void *priv, boolean enabled); + + unsigned mode; + unsigned start; + unsigned p_start; + unsigned p_end; + + int repeat_first:1; + int close_first:1; + int edgeflag_off:1; +}; + +static inline void +u_split_prim_init(struct u_split_prim *s, + unsigned mode, unsigned start, unsigned count) +{ + if (mode == PIPE_PRIM_LINE_LOOP) { + s->mode = PIPE_PRIM_LINE_STRIP; + s->close_first = 1; + } else { + s->mode = mode; + s->close_first = 0; + } + s->start = start; + s->p_start = start; + s->p_end = start + count; + s->edgeflag_off = 0; + s->repeat_first = 0; +} + +static INLINE boolean +u_split_prim_next(struct u_split_prim *s, unsigned max_verts) +{ + int repeat = 0; + + if (s->repeat_first) { + s->emit(s->priv, s->start, 1); + max_verts--; + if (s->edgeflag_off) { + s->edge(s->priv, TRUE); + s->edgeflag_off = FALSE; + } + } + + if (s->p_start + s->close_first + max_verts >= s->p_end) { + s->emit(s->priv, s->p_start, s->p_end - s->p_start); + if (s->close_first) + s->emit(s->priv, s->start, 1); + return TRUE; + } + + switch (s->mode) { + case PIPE_PRIM_LINES: + max_verts &= ~1; + break; + case PIPE_PRIM_LINE_STRIP: + repeat = 1; + break; + case PIPE_PRIM_POLYGON: + max_verts--; + s->emit(s->priv, s->p_start, max_verts); + s->edge(s->priv, FALSE); + s->emit(s->priv, s->p_start + max_verts, 1); + s->p_start += max_verts; + s->repeat_first = TRUE; + s->edgeflag_off = TRUE; + return FALSE; + case PIPE_PRIM_TRIANGLES: + max_verts = max_verts - (max_verts % 3); + break; + case PIPE_PRIM_TRIANGLE_STRIP: + /* to ensure winding stays correct, always split + * on an even number of generated triangles + */ + max_verts = max_verts & ~1; + repeat = 2; + break; + case PIPE_PRIM_TRIANGLE_FAN: + s->repeat_first = TRUE; + repeat = 1; + break; + case PIPE_PRIM_QUADS: + max_verts &= ~3; + break; + case PIPE_PRIM_QUAD_STRIP: + max_verts &= ~1; + repeat = 2; + break; + default: + break; + } + + s->emit (s->priv, s->p_start, max_verts); + s->p_start += (max_verts - repeat); + return FALSE; +} + #endif diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 54a2fa730a..8f3c1aaf46 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -25,6 +25,7 @@ #include "util/u_inlines.h" #include "util/u_format.h" +#include "nouveau/nouveau_util.h" #include "nv50_context.h" #define NV50_USING_LOATHED_EDGEFLAG(ctx) ((ctx)->vertprog->cfg.edgeflag_in < 16) @@ -251,85 +252,83 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start, nv50_draw_arrays_instanced(pipe, mode, start, count, 0, 1); } -static INLINE boolean -nv50_draw_elements_inline_u08(struct nv50_context *nv50, uint8_t *map, - unsigned start, unsigned count) -{ - struct nouveau_channel *chan = nv50->screen->tesla->channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; +struct inline_ctx { + struct nv50_context *nv50; + void *map; +}; - map += start; +static void +inline_elt08(void *priv, unsigned start, unsigned count) +{ + struct inline_ctx *ctx = priv; + struct nouveau_grobj *tesla = ctx->nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; + uint8_t *map = (uint8_t *)ctx->map + start; if (count & 1) { BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32, 1); OUT_RING (chan, map[0]); map++; - count--; + count &= ~1; } - while (count) { - unsigned nr = count > 2046 ? 2046 : count; - int i; - - BEGIN_RING_NI(chan, tesla, NV50TCL_VB_ELEMENT_U16, nr >> 1); - for (i = 0; i < nr; i += 2) - OUT_RING (chan, (map[i + 1] << 16) | map[i]); + count >>= 1; + if (!count) + return; - count -= nr; - map += nr; + BEGIN_RING_NI(chan, tesla, NV50TCL_VB_ELEMENT_U16, count); + while (count--) { + OUT_RING(chan, (map[1] << 16) | map[0]); + map += 2; } - return TRUE; } -static INLINE boolean -nv50_draw_elements_inline_u16(struct nv50_context *nv50, uint16_t *map, - unsigned start, unsigned count) +static void +inline_elt16(void *priv, unsigned start, unsigned count) { - struct nouveau_channel *chan = nv50->screen->tesla->channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; - - map += start; + struct inline_ctx *ctx = priv; + struct nouveau_grobj *tesla = ctx->nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; + uint16_t *map = (uint16_t *)ctx->map + start; if (count & 1) { BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_U32, 1); OUT_RING (chan, map[0]); + count &= ~1; map++; - count--; } - while (count) { - unsigned nr = count > 2046 ? 2046 : count; - int i; - - BEGIN_RING_NI(chan, tesla, NV50TCL_VB_ELEMENT_U16, nr >> 1); - for (i = 0; i < nr; i += 2) - OUT_RING (chan, (map[i + 1] << 16) | map[i]); + count >>= 1; + if (!count) + return; - count -= nr; - map += nr; + BEGIN_RING_NI(chan, tesla, NV50TCL_VB_ELEMENT_U16, count); + while (count--) { + OUT_RING(chan, (map[1] << 16) | map[0]); + map += 2; } - return TRUE; } -static INLINE boolean -nv50_draw_elements_inline_u32(struct nv50_context *nv50, uint32_t *map, - unsigned start, unsigned count) +static void +inline_elt32(void *priv, unsigned start, unsigned count) { - struct nouveau_channel *chan = nv50->screen->tesla->channel; - struct nouveau_grobj *tesla = nv50->screen->tesla; + struct inline_ctx *ctx = priv; + struct nouveau_grobj *tesla = ctx->nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; - map += start; - - while (count) { - unsigned nr = count > 2047 ? 2047 : count; + BEGIN_RING_NI(chan, tesla, NV50TCL_VB_ELEMENT_U32, count); + OUT_RINGp (chan, (uint32_t *)ctx->map + start, count); +} - BEGIN_RING_NI(chan, tesla, NV50TCL_VB_ELEMENT_U32, nr); - OUT_RINGp (chan, map, nr); +static void +inline_edgeflag(void *priv, boolean enabled) +{ + struct inline_ctx *ctx = priv; + struct nouveau_grobj *tesla = ctx->nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; - count -= nr; - map += nr; - } - return TRUE; + BEGIN_RING(chan, tesla, NV50TCL_EDGEFLAG_ENABLE, 1); + OUT_RING (chan, enabled ? 1 : 0); } static void @@ -343,51 +342,68 @@ nv50_draw_elements_inline(struct pipe_context *pipe, struct nouveau_channel *chan = nv50->screen->tesla->channel; struct nouveau_grobj *tesla = nv50->screen->tesla; struct instance a[16]; - unsigned prim = nv50_prim(mode); - void *map; - - map = pipe_buffer_map(pscreen, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ); - assert(map); - if (!map) + struct inline_ctx ctx; + struct u_split_prim s; + boolean nzi = FALSE; + unsigned overhead; + + overhead = 16*3; /* potential instance adjustments */ + overhead += 4; /* Begin()/End() */ + overhead += 4; /* potential edgeflag disable/reenable */ + overhead += 3; /* potentially 3 VTX_ELT_U16/U32 packet headers */ + + s.priv = &ctx; + if (indexSize == 1) + s.emit = inline_elt08; + else + if (indexSize == 2) + s.emit = inline_elt16; + else + s.emit = inline_elt32; + s.edge = inline_edgeflag; + + ctx.nv50 = nv50; + ctx.map = pipe_buffer_map(pscreen, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ); + assert(ctx.map); + if (!ctx.map) return; instance_init(nv50, a, startInstance); - if (!nv50_state_validate(nv50, 0)) + if (!nv50_state_validate(nv50, overhead + 6 + 3)) return; BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 2); OUT_RING (chan, NV50_CB_AUX | (24 << 8)); OUT_RING (chan, startInstance); while (instanceCount--) { - if (AVAIL_RING(chan) < (7 + 16*3)) { - FIRE_RING(chan); - if (!nv50_state_validate(nv50, 0)) { - assert(0); - return; + unsigned max_verts; + boolean done; + + u_split_prim_init(&s, mode, start, count); + do { + if (AVAIL_RING(chan) < (overhead + 6)) { + FIRE_RING(chan); + if (!nv50_state_validate(nv50, (overhead + 6))) { + assert(0); + return; + } } - } - instance_step(nv50, a); - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); - OUT_RING (chan, prim); - switch (indexSize) { - case 1: - nv50_draw_elements_inline_u08(nv50, map, start, count); - break; - case 2: - nv50_draw_elements_inline_u16(nv50, map, start, count); - break; - case 4: - nv50_draw_elements_inline_u32(nv50, map, start, count); - break; - default: - assert(0); - break; - } - BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); - OUT_RING (chan, 0); + max_verts = AVAIL_RING(chan) - overhead; + if (max_verts > 2047) + max_verts = 2047; + if (indexSize != 4) + max_verts <<= 1; + instance_step(nv50, a); + + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); + OUT_RING (chan, nv50_prim(s.mode) | (nzi ? (1<<28) : 0)); + done = u_split_prim_next(&s, max_verts); + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); + OUT_RING (chan, 0); + } while (!done); - prim |= (1 << 28); + nzi = TRUE; } pipe_buffer_unmap(pscreen, indexBuffer); @@ -406,7 +422,8 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, struct instance a[16]; unsigned prim = nv50_prim(mode); - if (indexSize == 1) { + if (!(indexBuffer->usage & PIPE_BUFFER_USAGE_INDEX) || + indexSize == 1) { nv50_draw_elements_inline(pipe, indexBuffer, indexSize, mode, start, count, startInstance, instanceCount); -- cgit v1.2.3 From 160bda24ed3b8f74d58cfcf55349c6d9e92fb442 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 8 Mar 2010 17:06:38 +1000 Subject: nv50: re-add immediate mode vertex submission paths --- src/gallium/drivers/nv50/Makefile | 3 +- src/gallium/drivers/nv50/nv50_context.h | 9 + src/gallium/drivers/nv50/nv50_push.c | 357 ++++++++++++++++++++++++++++++++ src/gallium/drivers/nv50/nv50_vbo.c | 38 +++- 4 files changed, 399 insertions(+), 8 deletions(-) create mode 100644 src/gallium/drivers/nv50/nv50_push.c (limited to 'src') diff --git a/src/gallium/drivers/nv50/Makefile b/src/gallium/drivers/nv50/Makefile index 612aea28a3..5d622e1c13 100644 --- a/src/gallium/drivers/nv50/Makefile +++ b/src/gallium/drivers/nv50/Makefile @@ -16,6 +16,7 @@ C_SOURCES = \ nv50_surface.c \ nv50_tex.c \ nv50_transfer.c \ - nv50_vbo.c + nv50_vbo.c \ + nv50_push.c include ../../Makefile.template diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 15f33fa4f4..35abfba93b 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -163,6 +163,8 @@ struct nv50_context { unsigned sampler_nr[PIPE_SHADER_TYPES]; struct nv50_miptree *miptree[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; unsigned miptree_nr[PIPE_SHADER_TYPES]; + + unsigned vbo_fifo; }; static INLINE struct nv50_context * @@ -207,6 +209,13 @@ extern void nv50_draw_elements_instanced(struct pipe_context *pipe, extern void nv50_vtxelt_construct(struct nv50_vtxelt_stateobj *cso); extern struct nouveau_stateobj *nv50_vbo_validate(struct nv50_context *nv50); +/* nv50_push.c */ +extern void +nv50_push_elements_instanced(struct pipe_context *, struct pipe_buffer *, + unsigned idxsize, unsigned mode, unsigned start, + unsigned count, unsigned i_start, + unsigned i_count); + /* nv50_clear.c */ extern void nv50_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, unsigned stencil); diff --git a/src/gallium/drivers/nv50/nv50_push.c b/src/gallium/drivers/nv50/nv50_push.c new file mode 100644 index 0000000000..b615f4e054 --- /dev/null +++ b/src/gallium/drivers/nv50/nv50_push.c @@ -0,0 +1,357 @@ +#include "pipe/p_context.h" +#include "pipe/p_state.h" +#include "util/u_inlines.h" +#include "util/u_format.h" + +#include "nouveau/nouveau_util.h" +#include "nv50_context.h" + +static INLINE unsigned +nv50_prim(unsigned mode) +{ + switch (mode) { + case PIPE_PRIM_POINTS: return NV50TCL_VERTEX_BEGIN_POINTS; + case PIPE_PRIM_LINES: return NV50TCL_VERTEX_BEGIN_LINES; + case PIPE_PRIM_LINE_LOOP: return NV50TCL_VERTEX_BEGIN_LINE_LOOP; + case PIPE_PRIM_LINE_STRIP: return NV50TCL_VERTEX_BEGIN_LINE_STRIP; + case PIPE_PRIM_TRIANGLES: return NV50TCL_VERTEX_BEGIN_TRIANGLES; + case PIPE_PRIM_TRIANGLE_STRIP: + return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP; + case PIPE_PRIM_TRIANGLE_FAN: return NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN; + case PIPE_PRIM_QUADS: return NV50TCL_VERTEX_BEGIN_QUADS; + case PIPE_PRIM_QUAD_STRIP: return NV50TCL_VERTEX_BEGIN_QUAD_STRIP; + case PIPE_PRIM_POLYGON: return NV50TCL_VERTEX_BEGIN_POLYGON; + case PIPE_PRIM_LINES_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_LINES_ADJACENCY; + case PIPE_PRIM_LINE_STRIP_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_LINE_STRIP_ADJACENCY; + case PIPE_PRIM_TRIANGLES_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_TRIANGLES_ADJACENCY; + case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP_ADJACENCY; + default: + break; + } + + NOUVEAU_ERR("invalid primitive type %d\n", mode); + return NV50TCL_VERTEX_BEGIN_POINTS; +} + +struct push_context { + struct nv50_context *nv50; + + unsigned vtx_size; + + void *idxbuf; + unsigned idxsize; + + float edgeflag; + int edgeflag_attr; + + struct { + void *map; + unsigned stride; + unsigned divisor; + unsigned step; + void (*push)(struct nouveau_channel *, void *); + } attr[16]; + unsigned attr_nr; +}; + +static void +emit_b32_1(struct nouveau_channel *chan, void *data) +{ + uint32_t *v = data; + + OUT_RING(chan, v[0]); +} + +static void +emit_b32_2(struct nouveau_channel *chan, void *data) +{ + uint32_t *v = data; + + OUT_RING(chan, v[0]); + OUT_RING(chan, v[1]); +} + +static void +emit_b32_3(struct nouveau_channel *chan, void *data) +{ + uint32_t *v = data; + + OUT_RING(chan, v[0]); + OUT_RING(chan, v[1]); + OUT_RING(chan, v[2]); +} + +static void +emit_b32_4(struct nouveau_channel *chan, void *data) +{ + uint32_t *v = data; + + OUT_RING(chan, v[0]); + OUT_RING(chan, v[1]); + OUT_RING(chan, v[2]); + OUT_RING(chan, v[3]); +} + +static void +emit_b16_1(struct nouveau_channel *chan, void *data) +{ + uint16_t *v = data; + + OUT_RING(chan, v[0]); +} + +static void +emit_b16_3(struct nouveau_channel *chan, void *data) +{ + uint16_t *v = data; + + OUT_RING(chan, (v[1] << 16) | v[0]); + OUT_RING(chan, v[2]); +} + +static void +emit_b08_1(struct nouveau_channel *chan, void *data) +{ + uint8_t *v = data; + + OUT_RING(chan, v[0]); +} + +static void +emit_b08_3(struct nouveau_channel *chan, void *data) +{ + uint8_t *v = data; + + OUT_RING(chan, (v[2] << 16) | (v[1] << 8) | v[0]); +} + +static INLINE void +emit_vertex(struct push_context *ctx, unsigned n) +{ + struct nouveau_grobj *tesla = ctx->nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; + int i; + + if (ctx->edgeflag_attr < 16) { + float *edgeflag = ctx->attr[ctx->edgeflag_attr].map + + ctx->attr[ctx->edgeflag_attr].stride * n; + + if (*edgeflag != ctx->edgeflag) { + BEGIN_RING(chan, tesla, NV50TCL_EDGEFLAG_ENABLE, 1); + OUT_RING (chan, *edgeflag ? 1 : 0); + ctx->edgeflag = *edgeflag; + } + } + + BEGIN_RING_NI(chan, tesla, NV50TCL_VERTEX_DATA, ctx->vtx_size); + for (i = 0; i < ctx->attr_nr; i++) + ctx->attr[i].push(chan, ctx->attr[i].map + ctx->attr[i].stride * n); +} + +static void +emit_edgeflag(void *priv, boolean enabled) +{ + struct push_context *ctx = priv; + struct nouveau_grobj *tesla = ctx->nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; + + BEGIN_RING(chan, tesla, NV50TCL_EDGEFLAG_ENABLE, 1); + OUT_RING (chan, enabled ? 1 : 0); +} + +static void +emit_elt08(void *priv, unsigned start, unsigned count) +{ + struct push_context *ctx = priv; + uint8_t *idxbuf = ctx->idxbuf; + + while (count--) + emit_vertex(ctx, idxbuf[start++]); +} + +static void +emit_elt16(void *priv, unsigned start, unsigned count) +{ + struct push_context *ctx = priv; + uint16_t *idxbuf = ctx->idxbuf; + + while (count--) + emit_vertex(ctx, idxbuf[start++]); +} + +static void +emit_elt32(void *priv, unsigned start, unsigned count) +{ + struct push_context *ctx = priv; + uint32_t *idxbuf = ctx->idxbuf; + + while (count--) + emit_vertex(ctx, idxbuf[start++]); +} + +static void +emit_verts(void *priv, unsigned start, unsigned count) +{ + while (count--) + emit_vertex(priv, start++); +} + +void +nv50_push_elements_instanced(struct pipe_context *pipe, + struct pipe_buffer *idxbuf, unsigned idxsize, + unsigned mode, unsigned start, unsigned count, + unsigned i_start, unsigned i_count) +{ + struct nv50_context *nv50 = nv50_context(pipe); + struct nouveau_grobj *tesla = nv50->screen->tesla; + struct nouveau_channel *chan = tesla->channel; + struct push_context ctx; + const unsigned p_overhead = 4 + /* begin/end */ + 4; /* potential edgeflag enable/disable */ + const unsigned v_overhead = 1 + /* VERTEX_DATA packet header */ + 2; /* potential edgeflag modification */ + struct u_split_prim s; + unsigned vtx_size; + boolean nzi = FALSE; + int i; + + ctx.nv50 = nv50; + ctx.attr_nr = 0; + ctx.idxbuf = NULL; + ctx.vtx_size = 0; + ctx.edgeflag = 0.5f; + ctx.edgeflag_attr = nv50->vertprog->cfg.edgeflag_in; + + /* map vertex buffers, determine vertex size */ + for (i = 0; i < nv50->vtxelt->num_elements; i++) { + struct pipe_vertex_element *ve = &nv50->vtxelt->pipe[i]; + struct pipe_vertex_buffer *vb = &nv50->vtxbuf[ve->vertex_buffer_index]; + struct nouveau_bo *bo = nouveau_bo(vb->buffer); + unsigned size, nr_components, n; + + if (!(nv50->vbo_fifo & (1 << i))) + continue; + n = ctx.attr_nr++; + + if (nouveau_bo_map(bo, NOUVEAU_BO_RD)) { + assert(bo->map); + return; + } + ctx.attr[n].map = bo->map + vb->buffer_offset + ve->src_offset; + nouveau_bo_unmap(bo); + + ctx.attr[n].stride = vb->stride; + ctx.attr[n].divisor = ve->instance_divisor; + if (ctx.attr[n].divisor) { + ctx.attr[n].step = i_start % ve->instance_divisor; + ctx.attr[n].map += i_start * vb->stride; + } + + size = util_format_get_component_bits(ve->src_format, + UTIL_FORMAT_COLORSPACE_RGB, 0); + nr_components = util_format_get_nr_components(ve->src_format); + switch (size) { + case 8: + switch (nr_components) { + case 1: ctx.attr[n].push = emit_b08_1; break; + case 2: ctx.attr[n].push = emit_b16_1; break; + case 3: ctx.attr[n].push = emit_b08_3; break; + case 4: ctx.attr[n].push = emit_b32_1; break; + } + ctx.vtx_size++; + break; + case 16: + switch (nr_components) { + case 1: ctx.attr[n].push = emit_b16_1; break; + case 2: ctx.attr[n].push = emit_b32_1; break; + case 3: ctx.attr[n].push = emit_b16_3; break; + case 4: ctx.attr[n].push = emit_b32_2; break; + } + ctx.vtx_size += (nr_components + 1) >> 1; + break; + case 32: + switch (nr_components) { + case 1: ctx.attr[n].push = emit_b32_1; break; + case 2: ctx.attr[n].push = emit_b32_2; break; + case 3: ctx.attr[n].push = emit_b32_3; break; + case 4: ctx.attr[n].push = emit_b32_4; break; + } + ctx.vtx_size += nr_components; + break; + default: + assert(0); + return; + } + } + vtx_size = ctx.vtx_size + v_overhead; + + /* map index buffer, if present */ + if (idxbuf) { + struct nouveau_bo *bo = nouveau_bo(idxbuf); + + if (nouveau_bo_map(bo, NOUVEAU_BO_RD)) { + assert(bo->map); + return; + } + ctx.idxbuf = bo->map; + ctx.idxsize = idxsize; + nouveau_bo_unmap(bo); + } + + s.priv = &ctx; + s.edge = emit_edgeflag; + if (idxbuf) { + if (idxsize == 1) + s.emit = emit_elt08; + else + if (idxsize == 2) + s.emit = emit_elt16; + else + s.emit = emit_elt32; + } else + s.emit = emit_verts; + + /* per-instance loop */ + BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 2); + OUT_RING (chan, NV50_CB_AUX | (24 << 8)); + OUT_RING (chan, i_start); + while (i_count--) { + unsigned max_verts; + boolean done; + + for (i = 0; i < ctx.attr_nr; i++) { + if (!ctx.attr[i].divisor || + ctx.attr[i].divisor != ++ctx.attr[i].step) + continue; + ctx.attr[i].step = 0; + ctx.attr[i].map += ctx.attr[i].stride; + } + + u_split_prim_init(&s, mode, start, count); + do { + if (AVAIL_RING(chan) < p_overhead + (6 * vtx_size)) { + FIRE_RING(chan); + if (!nv50_state_validate(nv50, p_overhead + (6 * vtx_size))) { + assert(0); + return; + } + } + + max_verts = AVAIL_RING(chan); + max_verts -= p_overhead; + max_verts /= vtx_size; + + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_BEGIN, 1); + OUT_RING (chan, nv50_prim(s.mode) | (nzi ? (1 << 28) : 0)); + done = u_split_prim_next(&s, max_verts); + BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1); + OUT_RING (chan, 0); + } while (!done); + + nzi = TRUE; + } +} diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 8f3c1aaf46..9d49ad6db2 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -220,6 +220,13 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe, if (!nv50_state_validate(nv50, 10 + 16*3)) return; + if (nv50->vbo_fifo) { + nv50_push_elements_instanced(pipe, NULL, 0, mode, start, + count, startInstance, + instanceCount); + return; + } + BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 2); OUT_RING (chan, NV50_CB_AUX | (24 << 8)); OUT_RING (chan, startInstance); @@ -422,18 +429,23 @@ nv50_draw_elements_instanced(struct pipe_context *pipe, struct instance a[16]; unsigned prim = nv50_prim(mode); - if (!(indexBuffer->usage & PIPE_BUFFER_USAGE_INDEX) || - indexSize == 1) { + instance_init(nv50, a, startInstance); + if (!nv50_state_validate(nv50, 13 + 16*3)) + return; + + if (nv50->vbo_fifo) { + nv50_push_elements_instanced(pipe, indexBuffer, indexSize, + mode, start, count, startInstance, + instanceCount); + return; + } else + if (!(indexBuffer->usage & PIPE_BUFFER_USAGE_INDEX) || indexSize == 1) { nv50_draw_elements_inline(pipe, indexBuffer, indexSize, mode, start, count, startInstance, instanceCount); return; } - instance_init(nv50, a, startInstance); - if (!nv50_state_validate(nv50, 13 + 16*3)) - return; - BEGIN_RING(chan, tesla, NV50TCL_CB_ADDR, 2); OUT_RING (chan, NV50_CB_AUX | (24 << 8)); OUT_RING (chan, startInstance); @@ -570,7 +582,9 @@ nv50_vbo_validate(struct nv50_context *nv50) if (nv50->vtxbuf_nr == 0) return NULL; - assert(!NV50_USING_LOATHED_EDGEFLAG(nv50)); + if (NV50_USING_LOATHED_EDGEFLAG(nv50)) + nv50->vbo_fifo = 0xffff; + nv50->vbo_fifo = 0xffff; n_ve = MAX2(nv50->vtxelt->num_elements, nv50->state.vtxelt_nr); @@ -590,6 +604,16 @@ nv50_vbo_validate(struct nv50_context *nv50) nv50_vbo_static_attrib(nv50, i, &vtxattr, ve, vb)) { so_data(vtxfmt, hw | (1 << 4)); + so_method(vtxbuf, tesla, + NV50TCL_VERTEX_ARRAY_FORMAT(i), 1); + so_data (vtxbuf, 0); + + nv50->vbo_fifo &= ~(1 << i); + continue; + } + + if (nv50->vbo_fifo) { + so_data (vtxfmt, hw | (ve->instance_divisor ? (1 << 4) : i)); so_method(vtxbuf, tesla, NV50TCL_VERTEX_ARRAY_FORMAT(i), 1); so_data (vtxbuf, 0); -- cgit v1.2.3 From 4796986c9874134e47b00ae2280c3d7fc65111df Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 9 Mar 2010 14:04:14 +1000 Subject: nv50: add option to force immediate-mode submission, disable by default --- src/gallium/drivers/nv50/nv50_screen.c | 7 +++++-- src/gallium/drivers/nv50/nv50_screen.h | 2 ++ src/gallium/drivers/nv50/nv50_vbo.c | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 114ae9b386..7e2e8aa336 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -95,6 +95,8 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, static int nv50_screen_get_param(struct pipe_screen *pscreen, int param) { + struct nv50_screen *screen = nv50_screen(pscreen); + switch (param) { case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return 32; @@ -132,9 +134,9 @@ nv50_screen_get_param(struct pipe_screen *pscreen, int param) case PIPE_CAP_BLEND_EQUATION_SEPARATE: return 1; case NOUVEAU_CAP_HW_VTXBUF: - return 1; + return screen->force_push ? 0 : 1; case NOUVEAU_CAP_HW_IDXBUF: - return 1; + return screen->force_push ? 0 : 1; case PIPE_CAP_INDEP_BLEND_ENABLE: return 1; case PIPE_CAP_INDEP_BLEND_FUNC: @@ -493,6 +495,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) so_ref (NULL, &so); nouveau_pushbuf_flush(chan, 0); + screen->force_push = debug_get_bool_option("NV50_ALWAYS_PUSH", FALSE); return pscreen; } diff --git a/src/gallium/drivers/nv50/nv50_screen.h b/src/gallium/drivers/nv50/nv50_screen.h index 2687b72127..d1bc80cb9e 100644 --- a/src/gallium/drivers/nv50/nv50_screen.h +++ b/src/gallium/drivers/nv50/nv50_screen.h @@ -28,6 +28,8 @@ struct nv50_screen { struct nouveau_bo *tsc; struct nouveau_stateobj *static_init; + + boolean force_push; }; static INLINE struct nv50_screen * diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 9d49ad6db2..7eedd49271 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -582,9 +582,14 @@ nv50_vbo_validate(struct nv50_context *nv50) if (nv50->vtxbuf_nr == 0) return NULL; - if (NV50_USING_LOATHED_EDGEFLAG(nv50)) + if (nv50->screen->force_push || NV50_USING_LOATHED_EDGEFLAG(nv50)) nv50->vbo_fifo = 0xffff; - nv50->vbo_fifo = 0xffff; + + for (i = 0; i < nv50->vtxbuf_nr; i++) { + if (nv50->vtxbuf[i].stride && + !(nv50->vtxbuf[i].buffer->usage & PIPE_BUFFER_USAGE_VERTEX)) + nv50->vbo_fifo = 0xffff; + } n_ve = MAX2(nv50->vtxelt->num_elements, nv50->state.vtxelt_nr); -- cgit v1.2.3 From 3f93fa601097ded6993deecb90225242b20307e0 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 9 Mar 2010 14:52:30 +1000 Subject: nv50: move nv50_prim() into a header file rather than duplicating --- src/gallium/drivers/nv50/nv50_context.h | 31 +++++++++++++++++++++++++++++++ src/gallium/drivers/nv50/nv50_push.c | 31 ------------------------------- src/gallium/drivers/nv50/nv50_vbo.c | 31 ------------------------------- 3 files changed, 31 insertions(+), 62 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 35abfba93b..f65b328a56 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -259,4 +259,35 @@ nv50_upload_sifc(struct nv50_context *nv50, struct pipe_context * nv50_create(struct pipe_screen *pscreen, void *priv); +static INLINE unsigned +nv50_prim(unsigned mode) +{ + switch (mode) { + case PIPE_PRIM_POINTS: return NV50TCL_VERTEX_BEGIN_POINTS; + case PIPE_PRIM_LINES: return NV50TCL_VERTEX_BEGIN_LINES; + case PIPE_PRIM_LINE_LOOP: return NV50TCL_VERTEX_BEGIN_LINE_LOOP; + case PIPE_PRIM_LINE_STRIP: return NV50TCL_VERTEX_BEGIN_LINE_STRIP; + case PIPE_PRIM_TRIANGLES: return NV50TCL_VERTEX_BEGIN_TRIANGLES; + case PIPE_PRIM_TRIANGLE_STRIP: + return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP; + case PIPE_PRIM_TRIANGLE_FAN: return NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN; + case PIPE_PRIM_QUADS: return NV50TCL_VERTEX_BEGIN_QUADS; + case PIPE_PRIM_QUAD_STRIP: return NV50TCL_VERTEX_BEGIN_QUAD_STRIP; + case PIPE_PRIM_POLYGON: return NV50TCL_VERTEX_BEGIN_POLYGON; + case PIPE_PRIM_LINES_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_LINES_ADJACENCY; + case PIPE_PRIM_LINE_STRIP_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_LINE_STRIP_ADJACENCY; + case PIPE_PRIM_TRIANGLES_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_TRIANGLES_ADJACENCY; + case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY: + return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP_ADJACENCY; + default: + break; + } + + NOUVEAU_ERR("invalid primitive type %d\n", mode); + return NV50TCL_VERTEX_BEGIN_POINTS; +} + #endif diff --git a/src/gallium/drivers/nv50/nv50_push.c b/src/gallium/drivers/nv50/nv50_push.c index b615f4e054..96a1f32d30 100644 --- a/src/gallium/drivers/nv50/nv50_push.c +++ b/src/gallium/drivers/nv50/nv50_push.c @@ -6,37 +6,6 @@ #include "nouveau/nouveau_util.h" #include "nv50_context.h" -static INLINE unsigned -nv50_prim(unsigned mode) -{ - switch (mode) { - case PIPE_PRIM_POINTS: return NV50TCL_VERTEX_BEGIN_POINTS; - case PIPE_PRIM_LINES: return NV50TCL_VERTEX_BEGIN_LINES; - case PIPE_PRIM_LINE_LOOP: return NV50TCL_VERTEX_BEGIN_LINE_LOOP; - case PIPE_PRIM_LINE_STRIP: return NV50TCL_VERTEX_BEGIN_LINE_STRIP; - case PIPE_PRIM_TRIANGLES: return NV50TCL_VERTEX_BEGIN_TRIANGLES; - case PIPE_PRIM_TRIANGLE_STRIP: - return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP; - case PIPE_PRIM_TRIANGLE_FAN: return NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN; - case PIPE_PRIM_QUADS: return NV50TCL_VERTEX_BEGIN_QUADS; - case PIPE_PRIM_QUAD_STRIP: return NV50TCL_VERTEX_BEGIN_QUAD_STRIP; - case PIPE_PRIM_POLYGON: return NV50TCL_VERTEX_BEGIN_POLYGON; - case PIPE_PRIM_LINES_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_LINES_ADJACENCY; - case PIPE_PRIM_LINE_STRIP_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_LINE_STRIP_ADJACENCY; - case PIPE_PRIM_TRIANGLES_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_TRIANGLES_ADJACENCY; - case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP_ADJACENCY; - default: - break; - } - - NOUVEAU_ERR("invalid primitive type %d\n", mode); - return NV50TCL_VERTEX_BEGIN_POINTS; -} - struct push_context { struct nv50_context *nv50; diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 7eedd49271..2b06b81056 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -30,37 +30,6 @@ #define NV50_USING_LOATHED_EDGEFLAG(ctx) ((ctx)->vertprog->cfg.edgeflag_in < 16) -static INLINE unsigned -nv50_prim(unsigned mode) -{ - switch (mode) { - case PIPE_PRIM_POINTS: return NV50TCL_VERTEX_BEGIN_POINTS; - case PIPE_PRIM_LINES: return NV50TCL_VERTEX_BEGIN_LINES; - case PIPE_PRIM_LINE_LOOP: return NV50TCL_VERTEX_BEGIN_LINE_LOOP; - case PIPE_PRIM_LINE_STRIP: return NV50TCL_VERTEX_BEGIN_LINE_STRIP; - case PIPE_PRIM_TRIANGLES: return NV50TCL_VERTEX_BEGIN_TRIANGLES; - case PIPE_PRIM_TRIANGLE_STRIP: - return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP; - case PIPE_PRIM_TRIANGLE_FAN: return NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN; - case PIPE_PRIM_QUADS: return NV50TCL_VERTEX_BEGIN_QUADS; - case PIPE_PRIM_QUAD_STRIP: return NV50TCL_VERTEX_BEGIN_QUAD_STRIP; - case PIPE_PRIM_POLYGON: return NV50TCL_VERTEX_BEGIN_POLYGON; - case PIPE_PRIM_LINES_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_LINES_ADJACENCY; - case PIPE_PRIM_LINE_STRIP_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_LINE_STRIP_ADJACENCY; - case PIPE_PRIM_TRIANGLES_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_TRIANGLES_ADJACENCY; - case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY: - return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP_ADJACENCY; - default: - break; - } - - NOUVEAU_ERR("invalid primitive type %d\n", mode); - return NV50TCL_VERTEX_BEGIN_POINTS; -} - static INLINE uint32_t nv50_vbo_type_to_hw(enum pipe_format format) { -- cgit v1.2.3 From 9b233ce7de7923feb4b8ef4e1994baa4f13daeef Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 9 Mar 2010 14:56:46 +1000 Subject: nv50: remove unnecessary macro --- src/gallium/drivers/nv50/nv50_vbo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c index 2b06b81056..6b9c1ee231 100644 --- a/src/gallium/drivers/nv50/nv50_vbo.c +++ b/src/gallium/drivers/nv50/nv50_vbo.c @@ -28,8 +28,6 @@ #include "nouveau/nouveau_util.h" #include "nv50_context.h" -#define NV50_USING_LOATHED_EDGEFLAG(ctx) ((ctx)->vertprog->cfg.edgeflag_in < 16) - static INLINE uint32_t nv50_vbo_type_to_hw(enum pipe_format format) { @@ -551,7 +549,8 @@ nv50_vbo_validate(struct nv50_context *nv50) if (nv50->vtxbuf_nr == 0) return NULL; - if (nv50->screen->force_push || NV50_USING_LOATHED_EDGEFLAG(nv50)) + if (nv50->screen->force_push || + nv50->vertprog->cfg.edgeflag_in < 16) nv50->vbo_fifo = 0xffff; for (i = 0; i < nv50->vtxbuf_nr; i++) { -- cgit v1.2.3 From 7b7fcb08542ddd63ed6ef4c6304aade3684db948 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 9 Mar 2010 15:29:12 +1000 Subject: nv50: remove nv50_context.state.instbuf --- src/gallium/drivers/nv50/nv50_context.h | 1 - src/gallium/drivers/nv50/nv50_state_validate.c | 5 ----- 2 files changed, 6 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index f65b328a56..6865686690 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -129,7 +129,6 @@ struct nv50_state { unsigned miptree_nr[PIPE_SHADER_TYPES]; struct nouveau_stateobj *vtxbuf; struct nouveau_stateobj *vtxattr; - struct nouveau_stateobj *instbuf; unsigned vtxelt_nr; }; diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 2aaee31c0e..61be3a45fd 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -382,11 +382,6 @@ nv50_state_flush_notify(struct nouveau_channel *chan) so_emit_reloc_markers(chan, nv50->state.hw[4]); /* fp */ so_emit_reloc_markers(chan, nv50->state.hw[17]); /* vb */ so_emit_reloc_markers(chan, nv50->screen->static_init); - -#if 0 - if (nv50->state.instbuf) - so_emit_reloc_markers(chan, nv50->state.instbuf); -#endif } boolean -- cgit v1.2.3 From 139062946df4fba62a1e411073b61d4b0eeb034c Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 9 Mar 2010 15:30:08 +1000 Subject: nv50: inline nv50_state_flush_notify() It's (rightly) not called from anywhere else now --- src/gallium/drivers/nv50/nv50_context.h | 1 - src/gallium/drivers/nv50/nv50_state_validate.c | 21 ++++++--------------- 2 files changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 6865686690..8793c2aac5 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -235,7 +235,6 @@ extern void nv50_program_destroy(struct nv50_context *nv50, /* nv50_state_validate.c */ extern boolean nv50_state_validate(struct nv50_context *nv50, unsigned dwords); -extern void nv50_state_flush_notify(struct nouveau_channel *chan); extern void nv50_so_init_sifc(struct nv50_context *nv50, struct nouveau_stateobj *so, diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index 61be3a45fd..2c8e7ca798 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -370,20 +370,6 @@ struct state_validate { }; #define validate_list_len (sizeof(validate_list) / sizeof(validate_list[0])) -void -nv50_state_flush_notify(struct nouveau_channel *chan) -{ - struct nv50_context *nv50 = chan->user_private; - - nv50_tex_relocs(nv50); - - so_emit_reloc_markers(chan, nv50->state.hw[0]); /* fb */ - so_emit_reloc_markers(chan, nv50->state.hw[3]); /* vp */ - so_emit_reloc_markers(chan, nv50->state.hw[4]); /* fp */ - so_emit_reloc_markers(chan, nv50->state.hw[17]); /* vb */ - so_emit_reloc_markers(chan, nv50->screen->static_init); -} - boolean nv50_state_validate(struct nv50_context *nv50, unsigned wait_dwords) { @@ -446,7 +432,12 @@ nv50_state_validate(struct nv50_context *nv50, unsigned wait_dwords) * this the kernel is given no clue that the buffer is being used * still. This can cause all sorts of fun issues. */ - nv50_state_flush_notify(chan); + nv50_tex_relocs(nv50); + so_emit_reloc_markers(chan, nv50->state.hw[0]); /* fb */ + so_emit_reloc_markers(chan, nv50->state.hw[3]); /* vp */ + so_emit_reloc_markers(chan, nv50->state.hw[4]); /* fp */ + so_emit_reloc_markers(chan, nv50->state.hw[17]); /* vb */ + so_emit_reloc_markers(chan, nv50->screen->static_init); /* No idea.. */ BEGIN_RING(chan, tesla, 0x142c, 1); -- cgit v1.2.3 From ed7f73e161b93b4a83bb6ad6b6aa6cfcb65dc4b0 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Wed, 10 Mar 2010 15:22:53 +1000 Subject: nouveau: translate PIPE_BUFFER_USAGE_UNSYNCHRONIZED --- src/gallium/drivers/nouveau/nouveau_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c b/src/gallium/drivers/nouveau/nouveau_screen.c index f7d10a591f..b1ad686022 100644 --- a/src/gallium/drivers/nouveau/nouveau_screen.c +++ b/src/gallium/drivers/nouveau/nouveau_screen.c @@ -124,7 +124,7 @@ nouveau_screen_map_flags(unsigned pipe) if (pipe & PIPE_BUFFER_USAGE_DONTBLOCK) flags |= NOUVEAU_BO_NOWAIT; else - if (pipe & 0 /*PIPE_BUFFER_USAGE_UNSYNCHRONIZED*/) + if (pipe & PIPE_BUFFER_USAGE_UNSYNCHRONIZED) flags |= NOUVEAU_BO_NOSYNC; return flags; -- cgit v1.2.3 From eeaa0861bfc98a06ceec269801271b7453c4fcbd Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 07:23:29 +0000 Subject: llvmpipe: Cope with null Vertex element cso. CSO can often be null. For example: 1. at initialization 2. using an util module (u_blit) right after initialization (it will push state and pop the previous null state) 3. at shutdown time (state shouldn't be bound when being destroyed) Glean was hitting 2. --- src/gallium/drivers/llvmpipe/lp_state_vertex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/llvmpipe/lp_state_vertex.c b/src/gallium/drivers/llvmpipe/lp_state_vertex.c index 2ddd110a5f..f6427aa908 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_vertex.c +++ b/src/gallium/drivers/llvmpipe/lp_state_vertex.c @@ -61,7 +61,8 @@ llvmpipe_bind_vertex_elements_state(struct pipe_context *pipe, llvmpipe->dirty |= LP_NEW_VERTEX; - draw_set_vertex_elements(llvmpipe->draw, lp_velems->count, lp_velems->velem); + if (velems) + draw_set_vertex_elements(llvmpipe->draw, lp_velems->count, lp_velems->velem); } void -- cgit v1.2.3 From 3e38dbe3d3371f0a37dd35582301ae2b1507e5d2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 09:22:02 +0000 Subject: gallium: plumb winsys-drawable-handle through to state tracker The state trackers need this value so that they can supply it as the "void *" argument to flush_frontbuffer. Fixes single-buffer rendering. --- src/gallium/state_trackers/dri/dri_context.c | 12 +++++++++--- src/gallium/state_trackers/egl/common/egl_g3d.c | 9 +++++++-- src/gallium/state_trackers/egl/common/st_public_tmp.h | 2 +- src/gallium/state_trackers/glx/xlib/xm_api.c | 5 +++-- src/gallium/state_trackers/vega/vg_tracker.c | 10 +++++++++- src/gallium/state_trackers/vega/vg_tracker.h | 3 ++- src/gallium/state_trackers/wgl/stw_context.c | 6 +++--- src/mesa/state_tracker/st_context.c | 8 ++++++-- src/mesa/state_tracker/st_public.h | 3 ++- 9 files changed, 42 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c index 908cef454e..2f991c39e3 100644 --- a/src/gallium/state_trackers/dri/dri_context.c +++ b/src/gallium/state_trackers/dri/dri_context.c @@ -128,7 +128,7 @@ dri_unbind_context(__DRIcontext * cPriv) if (--ctx->bind_count == 0) { if (ctx->st && ctx->st == st_get_current()) { st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL); - st_make_current(NULL, NULL, NULL); + st_make_current(NULL, NULL, NULL, NULL); } } } @@ -161,7 +161,13 @@ dri_make_current(__DRIcontext * cPriv, ctx->r_stamp = driReadPriv->lastStamp - 1; } - st_make_current(ctx->st, draw->stfb, read->stfb); + /* DRI co-state tracker currently overrides flush_frontbuffer. + * When this is fixed, will need to pass the drawable in the + * fourth parameter here so that when Mesa calls + * flush_frontbuffer directly (in front-buffer rendering), it + * will have access to the drawable argument: + */ + st_make_current(ctx->st, draw->stfb, read->stfb, NULL); if (__dri1_api_hooks) { dri1_update_drawables(ctx, draw, read); @@ -170,7 +176,7 @@ dri_make_current(__DRIcontext * cPriv, ctx->pipe->priv); } } else { - st_make_current(NULL, NULL, NULL); + st_make_current(NULL, NULL, NULL, NULL); } return GL_TRUE; diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index f54c51a668..e4972d493d 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -892,8 +892,13 @@ egl_g3d_make_current(_EGLDriver *drv, _EGLDisplay *dpy, if (gctx) { ok = egl_g3d_realloc_context(dpy, &gctx->base); if (ok) { + /* XXX: need to pass the winsys argument for + * flush_frontbuffer in the fourth parameter here: + */ ok = gctx->stapi->st_make_current(gctx->st_ctx, - gctx->draw.st_fb, gctx->read.st_fb); + gctx->draw.st_fb, + gctx->read.st_fb, + NULL); if (ok) { egl_g3d_validate_context(dpy, &gctx->base); if (gdraw->base.Type == EGL_WINDOW_BIT) { @@ -905,7 +910,7 @@ egl_g3d_make_current(_EGLDriver *drv, _EGLDisplay *dpy, } } else if (old_gctx) { - ok = old_gctx->stapi->st_make_current(NULL, NULL, NULL); + ok = old_gctx->stapi->st_make_current(NULL, NULL, NULL, NULL); old_gctx->base.WindowRenderBuffer = EGL_NONE; } diff --git a/src/gallium/state_trackers/egl/common/st_public_tmp.h b/src/gallium/state_trackers/egl/common/st_public_tmp.h index 507a0ec402..562dd68c15 100644 --- a/src/gallium/state_trackers/egl/common/st_public_tmp.h +++ b/src/gallium/state_trackers/egl/common/st_public_tmp.h @@ -9,7 +9,7 @@ ST_PUBLIC(st_get_framebuffer_surface, int, struct st_f ST_PUBLIC(st_get_framebuffer_texture, int, struct st_framebuffer *stfb, uint surfIndex, struct pipe_texture **texture) ST_PUBLIC(st_framebuffer_private, void *, struct st_framebuffer *stfb) ST_PUBLIC(st_unreference_framebuffer, void, struct st_framebuffer *stfb) -ST_PUBLIC(st_make_current, GLboolean, struct st_context *st, struct st_framebuffer *draw, struct st_framebuffer *read) +ST_PUBLIC(st_make_current, GLboolean, struct st_context *st, struct st_framebuffer *draw, struct st_framebuffer *read, void *winsys_drawable_handle) ST_PUBLIC(st_get_current, struct st_context *, void) ST_PUBLIC(st_flush, void, struct st_context *st, uint pipeFlushFlags, struct pipe_fence_handle **fence) ST_PUBLIC(st_finish, void, struct st_context *st) diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 568bc6e962..f4d7133d2f 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -1020,7 +1020,8 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, c->xm_buffer = drawBuffer; c->xm_read_buffer = readBuffer; - st_make_current(c->st, drawBuffer->stfb, readBuffer->stfb); + st_make_current(c->st, drawBuffer->stfb, readBuffer->stfb, + &drawBuffer->ws); xmesa_check_and_update_buffer_size(c, drawBuffer); if (readBuffer != drawBuffer) @@ -1031,7 +1032,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, } else { /* Detach */ - st_make_current( NULL, NULL, NULL ); + st_make_current( NULL, NULL, NULL, NULL ); } return GL_TRUE; diff --git a/src/gallium/state_trackers/vega/vg_tracker.c b/src/gallium/state_trackers/vega/vg_tracker.c index 57d3baad7f..a002e50faf 100644 --- a/src/gallium/state_trackers/vega/vg_tracker.c +++ b/src/gallium/state_trackers/vega/vg_tracker.c @@ -376,11 +376,19 @@ void st_unreference_framebuffer(struct st_framebuffer *stfb) boolean st_make_current(struct vg_context *st, struct st_framebuffer *draw, - struct st_framebuffer *read) + struct st_framebuffer *read, + void *winsys_drawable_handle) { vg_set_current_context(st); if (st) { st->draw_buffer = draw; + + /* VG state tracker doesn't seem to do front-buffer rendering + * (no calls to flush_frontbuffer). If it ever did start doing + * that, it would need to pass this value down in the + * flush_frontbuffer call: + */ + st->pipe->priv = winsys_drawable_handle; } return VG_TRUE; } diff --git a/src/gallium/state_trackers/vega/vg_tracker.h b/src/gallium/state_trackers/vega/vg_tracker.h index c1196954a7..165a6b7a33 100644 --- a/src/gallium/state_trackers/vega/vg_tracker.h +++ b/src/gallium/state_trackers/vega/vg_tracker.h @@ -101,7 +101,8 @@ void st_unreference_framebuffer(struct st_framebuffer *stfb); PUBLIC boolean st_make_current(struct vg_context *st, struct st_framebuffer *draw, - struct st_framebuffer *read); + struct st_framebuffer *read, + void *winsys_drawable_handle); PUBLIC struct vg_context *st_get_current(void); diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c index 05ccd5febc..866f485a40 100644 --- a/src/gallium/state_trackers/wgl/stw_context.c +++ b/src/gallium/state_trackers/wgl/stw_context.c @@ -226,7 +226,7 @@ DrvDeleteContext( /* Unbind current if deleting current context. */ if (curctx == ctx) - st_make_current( NULL, NULL, NULL ); + st_make_current( NULL, NULL, NULL, NULL ); st_destroy_context(ctx->st); FREE(ctx); @@ -317,7 +317,7 @@ stw_make_current( } if (hdc == NULL || dhglrc == 0) { - return st_make_current( NULL, NULL, NULL ); + return st_make_current( NULL, NULL, NULL, NULL ); } pipe_mutex_lock( stw_dev->ctx_mutex ); @@ -352,7 +352,7 @@ stw_make_current( /* pass to stw_flush_frontbuffer as context_private */ ctx->st->pipe->priv = hdc; - if(!st_make_current( ctx->st, fb->stfb, fb->stfb )) + if(!st_make_current( ctx->st, fb->stfb, fb->stfb, hdc )) goto fail; success: diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 0358a70726..09f891d691 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -272,7 +272,8 @@ void st_destroy_context( struct st_context *st ) GLboolean st_make_current(struct st_context *st, struct st_framebuffer *draw, - struct st_framebuffer *read) + struct st_framebuffer *read, + void *winsys_drawable_handle ) { /* Call this periodically to detect when the user has begun using * GL rendering from multiple threads. @@ -280,10 +281,13 @@ st_make_current(struct st_context *st, _glapi_check_multithread(); if (st) { - if (!_mesa_make_current(st->ctx, &draw->Base, &read->Base)) + if (!_mesa_make_current(st->ctx, &draw->Base, &read->Base)) { + st->pipe->priv = NULL; return GL_FALSE; + } _mesa_check_init_viewport(st->ctx, draw->InitWidth, draw->InitHeight); + st->pipe->priv = winsys_drawable_handle; return GL_TRUE; } diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h index 0824356cec..4b40d6d044 100644 --- a/src/mesa/state_tracker/st_public.h +++ b/src/mesa/state_tracker/st_public.h @@ -105,7 +105,8 @@ void st_unreference_framebuffer( struct st_framebuffer *stfb ); PUBLIC GLboolean st_make_current(struct st_context *st, struct st_framebuffer *draw, - struct st_framebuffer *read); + struct st_framebuffer *read, + void *winsys_drawable_handle); PUBLIC struct st_context *st_get_current(void); -- cgit v1.2.3 From 7ce6b3130698aada770dc54b58e7b62e9cf20ad7 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 09:51:41 +0000 Subject: trace: include tr_public.h --- src/gallium/drivers/trace/tr_screen.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index a15addeb8c..86ddb99540 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -35,6 +35,7 @@ #include "tr_texture.h" #include "tr_context.h" #include "tr_screen.h" +#include "tr_public.h" #include "util/u_inlines.h" #include "pipe/p_format.h" -- cgit v1.2.3 From 80f86d22b2d16e3191dfeedcb9ea94bf30db68a5 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 09:52:25 +0000 Subject: st/wgl: add missing paramter --- src/gallium/state_trackers/wgl/stw_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c index 866f485a40..1f11b649c3 100644 --- a/src/gallium/state_trackers/wgl/stw_context.c +++ b/src/gallium/state_trackers/wgl/stw_context.c @@ -367,7 +367,7 @@ success: fail: if(fb) stw_framebuffer_release(fb); - st_make_current( NULL, NULL, NULL ); + st_make_current( NULL, NULL, NULL, NULL ); return FALSE; } -- cgit v1.2.3 From 5235c5aac7c3a2e4af41cb70864245cc254fb797 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 10:00:08 +0000 Subject: Revert "r300-gallium: Skeleton for integrating into the python statetracker." This reverts commit 2d56d0839e6db0861131893d67fe23734800085a. Never actually used. --- src/gallium/winsys/drm/radeon/python/README | 15 - src/gallium/winsys/drm/radeon/python/SConscript | 33 -- .../drm/radeon/python/radeon_hardpipe_winsys.c | 132 ----- src/gallium/winsys/drm/radeon/python/xf86dri.c | 605 --------------------- src/gallium/winsys/drm/radeon/python/xf86dri.h | 123 ----- src/gallium/winsys/drm/radeon/python/xf86dristr.h | 389 ------------- 6 files changed, 1297 deletions(-) delete mode 100644 src/gallium/winsys/drm/radeon/python/README delete mode 100644 src/gallium/winsys/drm/radeon/python/SConscript delete mode 100644 src/gallium/winsys/drm/radeon/python/radeon_hardpipe_winsys.c delete mode 100644 src/gallium/winsys/drm/radeon/python/xf86dri.c delete mode 100644 src/gallium/winsys/drm/radeon/python/xf86dri.h delete mode 100644 src/gallium/winsys/drm/radeon/python/xf86dristr.h (limited to 'src') diff --git a/src/gallium/winsys/drm/radeon/python/README b/src/gallium/winsys/drm/radeon/python/README deleted file mode 100644 index 339836a592..0000000000 --- a/src/gallium/winsys/drm/radeon/python/README +++ /dev/null @@ -1,15 +0,0 @@ -Python bindings for the radeon gallium driver. - - -See gallium/src/gallium/state_trackers/python/README for more information. - - -Build as: - - scons debug=1 statetrackers=python winsys=drm/radeon/python - -Run as: - - export PYTHONPATH=$PWD/build/linux-x86-debug/gallium/winsys/drm/radeon/python:$PWD/build/linux-x86-debug/gallium/state_trackers/python - - python progs/gallium/python/samples/tri.py diff --git a/src/gallium/winsys/drm/radeon/python/SConscript b/src/gallium/winsys/drm/radeon/python/SConscript deleted file mode 100644 index 91cae98697..0000000000 --- a/src/gallium/winsys/drm/radeon/python/SConscript +++ /dev/null @@ -1,33 +0,0 @@ -import os.path - -Import('*') - -if env['platform'] == 'linux': - - env = env.Clone() - - env.Tool('python') - - env.ParseConfig('pkg-config --cflags --libs libdrm') - - env.Prepend(CPPPATH = [ - '#src/gallium/state_trackers/python', - '../core', - ]) - - drivers = [ - softpipe, - radeon, - trace, - ] - - sources = [ - 'radeon_hardpipe_winsys.c', - 'xf86dri.c', - ] - - env.SharedLibrary( - target ='_gallium', - source = sources, - LIBS = [pyst] + drivers + gallium + env['LIBS'], - ) diff --git a/src/gallium/winsys/drm/radeon/python/radeon_hardpipe_winsys.c b/src/gallium/winsys/drm/radeon/python/radeon_hardpipe_winsys.c deleted file mode 100644 index fc63081a4c..0000000000 --- a/src/gallium/winsys/drm/radeon/python/radeon_hardpipe_winsys.c +++ /dev/null @@ -1,132 +0,0 @@ - /************************************************************************** - * - * Copyright 2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#include -#include -#include - -#include -#include -#include - -#include "pipe/p_screen.h" -#include "pipe/p_context.h" - -#include "st_winsys.h" - -#include "radeon_winsys.h" - -#include "xf86dri.h" - - -/* XXX: Force init_gallium symbol to be linked */ -extern void init_gallium(void); -void (*force_init_gallium_linkage)(void) = &init_gallium; - - -static struct pipe_screen * -radeon_hardpipe_screen_create(void) -{ - Display *dpy; - Window rootWin; - XWindowAttributes winAttr; - int isCapable; - int screen; - char *driverName; - char *curBusID; - unsigned magic; - int ddxDriverMajor; - int ddxDriverMinor; - int ddxDriverPatch; - drm_handle_t sAreaOffset; - int ret; - int drmFD; - drm_context_t hHWContext; - XID id; - - dpy = XOpenDisplay(":0"); - if (!dpy) { - fprintf(stderr, "Open Display Failed\n"); - return NULL; - } - - screen = DefaultScreen(dpy); - rootWin = RootWindow(dpy, screen); - XGetWindowAttributes(dpy, rootWin, &winAttr); - - ret = uniDRIQueryDirectRenderingCapable(dpy, screen, &isCapable); - if (!ret || !isCapable) { - fprintf(stderr, "No DRI on this display:sceen\n"); - goto error; - } - - if (!uniDRIOpenConnection(dpy, screen, &sAreaOffset, - &curBusID)) { - fprintf(stderr, "Could not open DRI connection.\n"); - goto error; - } - - if (!uniDRIGetClientDriverName(dpy, screen, &ddxDriverMajor, - &ddxDriverMinor, &ddxDriverPatch, - &driverName)) { - fprintf(stderr, "Could not get DRI driver name.\n"); - goto error; - } - - if ((drmFD = drmOpen(NULL, curBusID)) < 0) { - perror("DRM Device could not be opened"); - goto error; - } - - drmGetMagic(drmFD, &magic); - if (!uniDRIAuthConnection(dpy, screen, magic)) { - fprintf(stderr, "Could not get X server to authenticate us.\n"); - goto error; - } - - if (!uniDRICreateContext(dpy, screen, winAttr.visual, - &id, &hHWContext)) { - fprintf(stderr, "Could not create DRI context.\n"); - goto error; - } - - /* FIXME: create a radeon pipe_screen from drmFD and hHWContext */ - - return NULL; - -error: - return NULL; -} - - - - -const struct st_winsys st_hardpipe_winsys = { - &radeon_hardpipe_screen_create, -}; - diff --git a/src/gallium/winsys/drm/radeon/python/xf86dri.c b/src/gallium/winsys/drm/radeon/python/xf86dri.c deleted file mode 100644 index 1736f1e54f..0000000000 --- a/src/gallium/winsys/drm/radeon/python/xf86dri.c +++ /dev/null @@ -1,605 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Jens Owen - * Rickard E. (Rik) Faith - * - */ - -/* THIS IS NOT AN X CONSORTIUM STANDARD */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#define NEED_REPLIES -#include -#include -#include -#include "xf86dristr.h" - -static XExtensionInfo _xf86dri_info_data; -static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; -static char xf86dri_extension_name[] = XF86DRINAME; - -#define uniDRICheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, xf86dri_extension_name, val) - -/***************************************************************************** - * * - * private utility routines * - * * - *****************************************************************************/ - -static int close_display(Display * dpy, XExtCodes * extCodes); -static /* const */ XExtensionHooks xf86dri_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - -static -XEXT_GENERATE_FIND_DISPLAY(find_display, xf86dri_info, - xf86dri_extension_name, &xf86dri_extension_hooks, - 0, NULL) - - static XEXT_GENERATE_CLOSE_DISPLAY(close_display, xf86dri_info) - -/***************************************************************************** - * * - * public XFree86-DRI Extension routines * - * * - *****************************************************************************/ -#if 0 -#include -#define TRACE(msg) fprintf(stderr,"uniDRI%s\n", msg); -#else -#define TRACE(msg) -#endif - Bool uniDRIQueryExtension(dpy, event_basep, error_basep) - Display *dpy; - int *event_basep, *error_basep; -{ - XExtDisplayInfo *info = find_display(dpy); - - TRACE("QueryExtension..."); - if (XextHasExtension(info)) { - *event_basep = info->codes->first_event; - *error_basep = info->codes->first_error; - TRACE("QueryExtension... return True"); - return True; - } else { - TRACE("QueryExtension... return False"); - return False; - } -} - -Bool -uniDRIQueryVersion(dpy, majorVersion, minorVersion, patchVersion) - Display *dpy; - int *majorVersion; - int *minorVersion; - int *patchVersion; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIQueryVersionReply rep; - xXF86DRIQueryVersionReq *req; - - TRACE("QueryVersion..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIQueryVersion; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("QueryVersion... return False"); - return False; - } - *majorVersion = rep.majorVersion; - *minorVersion = rep.minorVersion; - *patchVersion = rep.patchVersion; - UnlockDisplay(dpy); - SyncHandle(); - TRACE("QueryVersion... return True"); - return True; -} - -Bool -uniDRIQueryDirectRenderingCapable(dpy, screen, isCapable) - Display *dpy; - int screen; - Bool *isCapable; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIQueryDirectRenderingCapableReply rep; - xXF86DRIQueryDirectRenderingCapableReq *req; - - TRACE("QueryDirectRenderingCapable..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIQueryDirectRenderingCapable, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIQueryDirectRenderingCapable; - req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("QueryDirectRenderingCapable... return False"); - return False; - } - *isCapable = rep.isCapable; - UnlockDisplay(dpy); - SyncHandle(); - TRACE("QueryDirectRenderingCapable... return True"); - return True; -} - -Bool -uniDRIOpenConnection(dpy, screen, hSAREA, busIdString) - Display *dpy; - int screen; - drm_handle_t *hSAREA; - char **busIdString; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIOpenConnectionReply rep; - xXF86DRIOpenConnectionReq *req; - - TRACE("OpenConnection..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIOpenConnection, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIOpenConnection; - req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("OpenConnection... return False"); - return False; - } - - *hSAREA = rep.hSAREALow; -#ifdef LONG64 - if (sizeof(drm_handle_t) == 8) { - *hSAREA |= ((unsigned long)rep.hSAREAHigh) << 32; - } -#endif - if (rep.length) { - if (!(*busIdString = (char *)Xcalloc(rep.busIdStringLength + 1, 1))) { - _XEatData(dpy, ((rep.busIdStringLength + 3) & ~3)); - UnlockDisplay(dpy); - SyncHandle(); - TRACE("OpenConnection... return False"); - return False; - } - _XReadPad(dpy, *busIdString, rep.busIdStringLength); - } else { - *busIdString = NULL; - } - UnlockDisplay(dpy); - SyncHandle(); - TRACE("OpenConnection... return True"); - return True; -} - -Bool -uniDRIAuthConnection(dpy, screen, magic) - Display *dpy; - int screen; - drm_magic_t magic; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIAuthConnectionReq *req; - xXF86DRIAuthConnectionReply rep; - - TRACE("AuthConnection..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIAuthConnection, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIAuthConnection; - req->screen = screen; - req->magic = magic; - rep.authenticated = 0; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("AuthConnection... return False"); - return False; - } - UnlockDisplay(dpy); - SyncHandle(); - TRACE("AuthConnection... return True"); - return True; -} - -Bool -uniDRICloseConnection(dpy, screen) - Display *dpy; - int screen; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRICloseConnectionReq *req; - - TRACE("CloseConnection..."); - - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRICloseConnection, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRICloseConnection; - req->screen = screen; - UnlockDisplay(dpy); - SyncHandle(); - TRACE("CloseConnection... return True"); - return True; -} - -Bool -uniDRIGetClientDriverName(dpy, screen, ddxDriverMajorVersion, - ddxDriverMinorVersion, ddxDriverPatchVersion, - clientDriverName) - Display *dpy; - int screen; - int *ddxDriverMajorVersion; - int *ddxDriverMinorVersion; - int *ddxDriverPatchVersion; - char **clientDriverName; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIGetClientDriverNameReply rep; - xXF86DRIGetClientDriverNameReq *req; - - TRACE("GetClientDriverName..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIGetClientDriverName, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIGetClientDriverName; - req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetClientDriverName... return False"); - return False; - } - - *ddxDriverMajorVersion = rep.ddxDriverMajorVersion; - *ddxDriverMinorVersion = rep.ddxDriverMinorVersion; - *ddxDriverPatchVersion = rep.ddxDriverPatchVersion; - - if (rep.length) { - if (!(*clientDriverName = - (char *)Xcalloc(rep.clientDriverNameLength + 1, 1))) { - _XEatData(dpy, ((rep.clientDriverNameLength + 3) & ~3)); - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetClientDriverName... return False"); - return False; - } - _XReadPad(dpy, *clientDriverName, rep.clientDriverNameLength); - } else { - *clientDriverName = NULL; - } - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetClientDriverName... return True"); - return True; -} - -Bool -uniDRICreateContextWithConfig(dpy, screen, configID, context, hHWContext) - Display *dpy; - int screen; - int configID; - XID *context; - drm_context_t *hHWContext; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRICreateContextReply rep; - xXF86DRICreateContextReq *req; - - TRACE("CreateContext..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRICreateContext, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRICreateContext; - req->visual = configID; - req->screen = screen; - *context = XAllocID(dpy); - req->context = *context; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("CreateContext... return False"); - return False; - } - *hHWContext = rep.hHWContext; - UnlockDisplay(dpy); - SyncHandle(); - TRACE("CreateContext... return True"); - return True; -} - -Bool -uniDRICreateContext(dpy, screen, visual, context, hHWContext) - Display *dpy; - int screen; - Visual *visual; - XID *context; - drm_context_t *hHWContext; -{ - return uniDRICreateContextWithConfig(dpy, screen, visual->visualid, - context, hHWContext); -} - -Bool -uniDRIDestroyContext(Display * ndpy, int screen, XID context) -{ - Display *const dpy = (Display *) ndpy; - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIDestroyContextReq *req; - - TRACE("DestroyContext..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIDestroyContext, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIDestroyContext; - req->screen = screen; - req->context = context; - UnlockDisplay(dpy); - SyncHandle(); - TRACE("DestroyContext... return True"); - return True; -} - -Bool -uniDRICreateDrawable(Display * ndpy, int screen, - Drawable drawable, drm_drawable_t * hHWDrawable) -{ - Display *const dpy = (Display *) ndpy; - XExtDisplayInfo *info = find_display(dpy); - xXF86DRICreateDrawableReply rep; - xXF86DRICreateDrawableReq *req; - - TRACE("CreateDrawable..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRICreateDrawable, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRICreateDrawable; - req->screen = screen; - req->drawable = drawable; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("CreateDrawable... return False"); - return False; - } - *hHWDrawable = rep.hHWDrawable; - UnlockDisplay(dpy); - SyncHandle(); - TRACE("CreateDrawable... return True"); - return True; -} - -Bool -uniDRIDestroyDrawable(Display * ndpy, int screen, Drawable drawable) -{ - Display *const dpy = (Display *) ndpy; - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIDestroyDrawableReq *req; - - TRACE("DestroyDrawable..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIDestroyDrawable, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIDestroyDrawable; - req->screen = screen; - req->drawable = drawable; - UnlockDisplay(dpy); - SyncHandle(); - TRACE("DestroyDrawable... return True"); - return True; -} - -Bool -uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, - unsigned int *index, unsigned int *stamp, - int *X, int *Y, int *W, int *H, - int *numClipRects, drm_clip_rect_t ** pClipRects, - int *backX, int *backY, - int *numBackClipRects, - drm_clip_rect_t ** pBackClipRects) -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIGetDrawableInfoReply rep; - xXF86DRIGetDrawableInfoReq *req; - int total_rects; - - TRACE("GetDrawableInfo..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIGetDrawableInfo, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIGetDrawableInfo; - req->screen = screen; - req->drawable = drawable; - - if (!_XReply(dpy, (xReply *) & rep, 1, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetDrawableInfo... return False"); - return False; - } - *index = rep.drawableTableIndex; - *stamp = rep.drawableTableStamp; - *X = (int)rep.drawableX; - *Y = (int)rep.drawableY; - *W = (int)rep.drawableWidth; - *H = (int)rep.drawableHeight; - *numClipRects = rep.numClipRects; - total_rects = *numClipRects; - - *backX = rep.backX; - *backY = rep.backY; - *numBackClipRects = rep.numBackClipRects; - total_rects += *numBackClipRects; - -#if 0 - /* Because of the fix in Xserver/GL/dri/xf86dri.c, this check breaks - * backwards compatibility (Because of the >> 2 shift) but the fix - * enables multi-threaded apps to work. - */ - if (rep.length != ((((SIZEOF(xXF86DRIGetDrawableInfoReply) - - SIZEOF(xGenericReply) + - total_rects * sizeof(drm_clip_rect_t)) + - 3) & ~3) >> 2)) { - _XEatData(dpy, rep.length); - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetDrawableInfo... return False"); - return False; - } -#endif - - if (*numClipRects) { - int len = sizeof(drm_clip_rect_t) * (*numClipRects); - - *pClipRects = (drm_clip_rect_t *) Xcalloc(len, 1); - if (*pClipRects) - _XRead(dpy, (char *)*pClipRects, len); - } else { - *pClipRects = NULL; - } - - if (*numBackClipRects) { - int len = sizeof(drm_clip_rect_t) * (*numBackClipRects); - - *pBackClipRects = (drm_clip_rect_t *) Xcalloc(len, 1); - if (*pBackClipRects) - _XRead(dpy, (char *)*pBackClipRects, len); - } else { - *pBackClipRects = NULL; - } - - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetDrawableInfo... return True"); - return True; -} - -Bool -uniDRIGetDeviceInfo(dpy, screen, hFrameBuffer, - fbOrigin, fbSize, fbStride, devPrivateSize, pDevPrivate) - Display *dpy; - int screen; - drm_handle_t *hFrameBuffer; - int *fbOrigin; - int *fbSize; - int *fbStride; - int *devPrivateSize; - void **pDevPrivate; -{ - XExtDisplayInfo *info = find_display(dpy); - xXF86DRIGetDeviceInfoReply rep; - xXF86DRIGetDeviceInfoReq *req; - - TRACE("GetDeviceInfo..."); - uniDRICheckExtension(dpy, info, False); - - LockDisplay(dpy); - GetReq(XF86DRIGetDeviceInfo, req); - req->reqType = info->codes->major_opcode; - req->driReqType = X_XF86DRIGetDeviceInfo; - req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetDeviceInfo... return False"); - return False; - } - - *hFrameBuffer = rep.hFrameBufferLow; -#ifdef LONG64 - if (sizeof(drm_handle_t) == 8) { - *hFrameBuffer |= ((unsigned long)rep.hFrameBufferHigh) << 32; - } -#endif - - *fbOrigin = rep.framebufferOrigin; - *fbSize = rep.framebufferSize; - *fbStride = rep.framebufferStride; - *devPrivateSize = rep.devPrivateSize; - - if (rep.length) { - if (!(*pDevPrivate = (void *)Xcalloc(rep.devPrivateSize, 1))) { - _XEatData(dpy, ((rep.devPrivateSize + 3) & ~3)); - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetDeviceInfo... return False"); - return False; - } - _XRead(dpy, (char *)*pDevPrivate, rep.devPrivateSize); - } else { - *pDevPrivate = NULL; - } - - UnlockDisplay(dpy); - SyncHandle(); - TRACE("GetDeviceInfo... return True"); - return True; -} diff --git a/src/gallium/winsys/drm/radeon/python/xf86dri.h b/src/gallium/winsys/drm/radeon/python/xf86dri.h deleted file mode 100644 index bf6de37d9d..0000000000 --- a/src/gallium/winsys/drm/radeon/python/xf86dri.h +++ /dev/null @@ -1,123 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/** - * \file xf86dri.h - * Protocol numbers and function prototypes for DRI X protocol. - * - * \author Kevin E. Martin - * \author Jens Owen - * \author Rickard E. (Rik) Faith - */ - -#ifndef _XF86DRI_H_ -#define _XF86DRI_H_ - -#include -#include -#include - -#define X_XF86DRIQueryVersion 0 -#define X_XF86DRIQueryDirectRenderingCapable 1 -#define X_XF86DRIOpenConnection 2 -#define X_XF86DRICloseConnection 3 -#define X_XF86DRIGetClientDriverName 4 -#define X_XF86DRICreateContext 5 -#define X_XF86DRIDestroyContext 6 -#define X_XF86DRICreateDrawable 7 -#define X_XF86DRIDestroyDrawable 8 -#define X_XF86DRIGetDrawableInfo 9 -#define X_XF86DRIGetDeviceInfo 10 -#define X_XF86DRIAuthConnection 11 -#define X_XF86DRIOpenFullScreen 12 /* Deprecated */ -#define X_XF86DRICloseFullScreen 13 /* Deprecated */ - -#define XF86DRINumberEvents 0 - -#define XF86DRIClientNotLocal 0 -#define XF86DRIOperationNotSupported 1 -#define XF86DRINumberErrors (XF86DRIOperationNotSupported + 1) - -#ifndef _XF86DRI_SERVER_ - -_XFUNCPROTOBEGIN - Bool uniDRIQueryExtension(Display * dpy, int *event_base, - int *error_base); - -Bool uniDRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion, - int *patchVersion); - -Bool uniDRIQueryDirectRenderingCapable(Display * dpy, int screen, - Bool * isCapable); - -Bool uniDRIOpenConnection(Display * dpy, int screen, drm_handle_t * hSAREA, - char **busIDString); - -Bool uniDRIAuthConnection(Display * dpy, int screen, drm_magic_t magic); - -Bool uniDRICloseConnection(Display * dpy, int screen); - -Bool uniDRIGetClientDriverName(Display * dpy, int screen, - int *ddxDriverMajorVersion, - int *ddxDriverMinorVersion, - int *ddxDriverPatchVersion, - char **clientDriverName); - -Bool uniDRICreateContext(Display * dpy, int screen, Visual * visual, - XID * ptr_to_returned_context_id, - drm_context_t * hHWContext); - -Bool uniDRICreateContextWithConfig(Display * dpy, int screen, int configID, - XID * ptr_to_returned_context_id, - drm_context_t * hHWContext); - -extern Bool uniDRIDestroyContext(Display * dpy, int screen, XID context_id); - -extern Bool uniDRICreateDrawable(Display * dpy, int screen, - Drawable drawable, - drm_drawable_t * hHWDrawable); - -extern Bool uniDRIDestroyDrawable(Display * dpy, int screen, - Drawable drawable); - -Bool uniDRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, - unsigned int *index, unsigned int *stamp, - int *X, int *Y, int *W, int *H, - int *numClipRects, drm_clip_rect_t ** pClipRects, - int *backX, int *backY, - int *numBackClipRects, - drm_clip_rect_t ** pBackClipRects); - -Bool uniDRIGetDeviceInfo(Display * dpy, int screen, - drm_handle_t * hFrameBuffer, int *fbOrigin, - int *fbSize, int *fbStride, int *devPrivateSize, - void **pDevPrivate); - -_XFUNCPROTOEND -#endif /* _XF86DRI_SERVER_ */ -#endif /* _XF86DRI_H_ */ diff --git a/src/gallium/winsys/drm/radeon/python/xf86dristr.h b/src/gallium/winsys/drm/radeon/python/xf86dristr.h deleted file mode 100644 index d898996360..0000000000 --- a/src/gallium/winsys/drm/radeon/python/xf86dristr.h +++ /dev/null @@ -1,389 +0,0 @@ -/************************************************************************** - -Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. -Copyright 2000 VA Linux Systems, Inc. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Jens Owen - * Rickard E. (Rik) Fiath - * - */ - -#ifndef _XF86DRISTR_H_ -#define _XF86DRISTR_H_ - -#include "xf86dri.h" - -#define XF86DRINAME "XFree86-DRI" - -/* The DRI version number. This was originally set to be the same of the - * XFree86 version number. However, this version is really indepedent of - * the XFree86 version. - * - * Version History: - * 4.0.0: Original - * 4.0.1: Patch to bump clipstamp when windows are destroyed, 28 May 02 - * 4.1.0: Add transition from single to multi in DRMInfo rec, 24 Jun 02 - */ -#define XF86DRI_MAJOR_VERSION 4 -#define XF86DRI_MINOR_VERSION 1 -#define XF86DRI_PATCH_VERSION 0 - -typedef struct _XF86DRIQueryVersion -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIQueryVersion */ - CARD16 length B16; -} xXF86DRIQueryVersionReq; - -#define sz_xXF86DRIQueryVersionReq 4 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD16 majorVersion B16; /* major version of DRI protocol */ - CARD16 minorVersion B16; /* minor version of DRI protocol */ - CARD32 patchVersion B32; /* patch version of DRI protocol */ - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86DRIQueryVersionReply; - -#define sz_xXF86DRIQueryVersionReply 32 - -typedef struct _XF86DRIQueryDirectRenderingCapable -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* X_DRIQueryDirectRenderingCapable */ - CARD16 length B16; - CARD32 screen B32; -} xXF86DRIQueryDirectRenderingCapableReq; - -#define sz_xXF86DRIQueryDirectRenderingCapableReq 8 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - BOOL isCapable; - BOOL pad2; - BOOL pad3; - BOOL pad4; - CARD32 pad5 B32; - CARD32 pad6 B32; - CARD32 pad7 B32; - CARD32 pad8 B32; - CARD32 pad9 B32; -} xXF86DRIQueryDirectRenderingCapableReply; - -#define sz_xXF86DRIQueryDirectRenderingCapableReply 32 - -typedef struct _XF86DRIOpenConnection -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIOpenConnection */ - CARD16 length B16; - CARD32 screen B32; -} xXF86DRIOpenConnectionReq; - -#define sz_xXF86DRIOpenConnectionReq 8 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 hSAREALow B32; - CARD32 hSAREAHigh B32; - CARD32 busIdStringLength B32; - CARD32 pad6 B32; - CARD32 pad7 B32; - CARD32 pad8 B32; -} xXF86DRIOpenConnectionReply; - -#define sz_xXF86DRIOpenConnectionReply 32 - -typedef struct _XF86DRIAuthConnection -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRICloseConnection */ - CARD16 length B16; - CARD32 screen B32; - CARD32 magic B32; -} xXF86DRIAuthConnectionReq; - -#define sz_xXF86DRIAuthConnectionReq 12 - -typedef struct -{ - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 authenticated B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86DRIAuthConnectionReply; - -#define zx_xXF86DRIAuthConnectionReply 32 - -typedef struct _XF86DRICloseConnection -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRICloseConnection */ - CARD16 length B16; - CARD32 screen B32; -} xXF86DRICloseConnectionReq; - -#define sz_xXF86DRICloseConnectionReq 8 - -typedef struct _XF86DRIGetClientDriverName -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIGetClientDriverName */ - CARD16 length B16; - CARD32 screen B32; -} xXF86DRIGetClientDriverNameReq; - -#define sz_xXF86DRIGetClientDriverNameReq 8 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 ddxDriverMajorVersion B32; - CARD32 ddxDriverMinorVersion B32; - CARD32 ddxDriverPatchVersion B32; - CARD32 clientDriverNameLength B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86DRIGetClientDriverNameReply; - -#define sz_xXF86DRIGetClientDriverNameReply 32 - -typedef struct _XF86DRICreateContext -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRICreateContext */ - CARD16 length B16; - CARD32 screen B32; - CARD32 visual B32; - CARD32 context B32; -} xXF86DRICreateContextReq; - -#define sz_xXF86DRICreateContextReq 16 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 hHWContext B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86DRICreateContextReply; - -#define sz_xXF86DRICreateContextReply 32 - -typedef struct _XF86DRIDestroyContext -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIDestroyContext */ - CARD16 length B16; - CARD32 screen B32; - CARD32 context B32; -} xXF86DRIDestroyContextReq; - -#define sz_xXF86DRIDestroyContextReq 12 - -typedef struct _XF86DRICreateDrawable -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRICreateDrawable */ - CARD16 length B16; - CARD32 screen B32; - CARD32 drawable B32; -} xXF86DRICreateDrawableReq; - -#define sz_xXF86DRICreateDrawableReq 12 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 hHWDrawable B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86DRICreateDrawableReply; - -#define sz_xXF86DRICreateDrawableReply 32 - -typedef struct _XF86DRIDestroyDrawable -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIDestroyDrawable */ - CARD16 length B16; - CARD32 screen B32; - CARD32 drawable B32; -} xXF86DRIDestroyDrawableReq; - -#define sz_xXF86DRIDestroyDrawableReq 12 - -typedef struct _XF86DRIGetDrawableInfo -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIGetDrawableInfo */ - CARD16 length B16; - CARD32 screen B32; - CARD32 drawable B32; -} xXF86DRIGetDrawableInfoReq; - -#define sz_xXF86DRIGetDrawableInfoReq 12 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 drawableTableIndex B32; - CARD32 drawableTableStamp B32; - INT16 drawableX B16; - INT16 drawableY B16; - INT16 drawableWidth B16; - INT16 drawableHeight B16; - CARD32 numClipRects B32; - INT16 backX B16; - INT16 backY B16; - CARD32 numBackClipRects B32; -} xXF86DRIGetDrawableInfoReply; - -#define sz_xXF86DRIGetDrawableInfoReply 36 - -typedef struct _XF86DRIGetDeviceInfo -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIGetDeviceInfo */ - CARD16 length B16; - CARD32 screen B32; -} xXF86DRIGetDeviceInfoReq; - -#define sz_xXF86DRIGetDeviceInfoReq 8 - -typedef struct -{ - BYTE type; /* X_Reply */ - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 hFrameBufferLow B32; - CARD32 hFrameBufferHigh B32; - CARD32 framebufferOrigin B32; - CARD32 framebufferSize B32; - CARD32 framebufferStride B32; - CARD32 devPrivateSize B32; -} xXF86DRIGetDeviceInfoReply; - -#define sz_xXF86DRIGetDeviceInfoReply 32 - -typedef struct _XF86DRIOpenFullScreen -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRIOpenFullScreen */ - CARD16 length B16; - CARD32 screen B32; - CARD32 drawable B32; -} xXF86DRIOpenFullScreenReq; - -#define sz_xXF86DRIOpenFullScreenReq 12 - -typedef struct -{ - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 isFullScreen B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xXF86DRIOpenFullScreenReply; - -#define sz_xXF86DRIOpenFullScreenReply 32 - -typedef struct _XF86DRICloseFullScreen -{ - CARD8 reqType; /* always DRIReqCode */ - CARD8 driReqType; /* always X_DRICloseFullScreen */ - CARD16 length B16; - CARD32 screen B32; - CARD32 drawable B32; -} xXF86DRICloseFullScreenReq; - -#define sz_xXF86DRICloseFullScreenReq 12 - -typedef struct -{ - BYTE type; - BOOL pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; - CARD32 pad7 B32; -} xXF86DRICloseFullScreenReply; - -#define sz_xXF86DRICloseFullScreenReply 32 - -#endif /* _XF86DRISTR_H_ */ -- cgit v1.2.3 From 601bfb5951ae303b54b4dd8a50bf0558017bf549 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 10:34:29 +0000 Subject: python: Fix up state tracker for sw api. --- SConstruct | 1 + src/gallium/state_trackers/python/SConscript | 29 ++--- src/gallium/state_trackers/python/st_device.c | 52 +++----- src/gallium/state_trackers/python/st_device.h | 9 +- .../state_trackers/python/st_hardpipe_winsys.c | 11 +- .../state_trackers/python/st_llvmpipe_winsys.c | 141 --------------------- .../state_trackers/python/st_softpipe_winsys.c | 53 ++++++-- src/gallium/state_trackers/python/st_winsys.h | 14 +- 8 files changed, 85 insertions(+), 225 deletions(-) delete mode 100644 src/gallium/state_trackers/python/st_llvmpipe_winsys.c (limited to 'src') diff --git a/SConstruct b/SConstruct index 5e171ea2e1..606be015c0 100644 --- a/SConstruct +++ b/SConstruct @@ -124,6 +124,7 @@ env.Append(CPPPATH = [ '#/src/gallium/include', '#/src/gallium/auxiliary', '#/src/gallium/drivers', + '#/src/gallium/winsys', ]) if env['msvc']: diff --git a/src/gallium/state_trackers/python/SConscript b/src/gallium/state_trackers/python/SConscript index 527e065cd9..8010f122b7 100644 --- a/src/gallium/state_trackers/python/SConscript +++ b/src/gallium/state_trackers/python/SConscript @@ -33,31 +33,26 @@ if 'python' in env['statetrackers']: 'gallium.i', 'st_device.c', 'st_sample.c', + 'st_hardpipe_winsys.c', + 'st_softpipe_winsys.c', ] - drivers = [ - trace - ] + env.Prepend(LIBS = [ + trace, + gallium + ]) if 'llvmpipe' in env['drivers']: + env.Append(CPPDEFINES = ['HAVE_LLVMPIPE']) env.Tool('llvm') - sources += ['st_llvmpipe_winsys.c'] - drivers += [llvmpipe] - else: - sources += ['st_softpipe_winsys.c'] - drivers += [softpipe] - - pyst = env.ConvenienceLibrary( - target = 'pyst', - source = sources, - ) + env.Prepend(LIBS = [llvmpipe]) + if 'softpipe' in env['drivers']: + env.Append(CPPDEFINES = ['HAVE_SOFTPIPE']) + env.Prepend(LIBS = [softpipe]) env['no_import_lib'] = 1 env.SharedLibrary( target = '_gallium', - source = [ - 'st_hardpipe_winsys.c', - ], - LIBS = [pyst] + drivers + gallium + env['LIBS'], + source = sources, ) diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index 45e7841750..335e8e7f0d 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -34,8 +34,7 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_simple_shaders.h" -#include "trace/tr_screen.h" -#include "trace/tr_context.h" +#include "trace/tr_public.h" #include "st_device.h" #include "st_winsys.h" @@ -75,43 +74,34 @@ st_device_destroy(struct st_device *st_dev) } -static struct st_device * -st_device_create_from_st_winsys(const struct st_winsys *st_ws) +struct st_device * +st_device_create(boolean hardware) { + struct pipe_screen *screen; struct st_device *st_dev; - - if(!st_ws->screen_create) - return NULL; - + + if (hardware) + screen = st_hardware_screen_create(); + else + screen = st_software_screen_create(); + + screen = trace_screen_create(screen); + if (!screen) + goto no_screen; + st_dev = CALLOC_STRUCT(st_device); - if(!st_dev) - return NULL; + if (!st_dev) + goto no_device; pipe_reference_init(&st_dev->reference, 1); - st_dev->st_ws = st_ws; - - st_dev->real_screen = st_ws->screen_create(); - if(!st_dev->real_screen) { - st_device_destroy(st_dev); - return NULL; - } - - st_dev->screen = trace_screen_create(st_dev->real_screen); - if(!st_dev->screen) { - st_device_destroy(st_dev); - return NULL; - } + st_dev->screen = screen; return st_dev; -} - -struct st_device * -st_device_create(boolean hardware) { - if(hardware) - return st_device_create_from_st_winsys(&st_hardpipe_winsys); - else - return st_device_create_from_st_winsys(&st_softpipe_winsys); +no_device: + screen->destroy(screen); +no_screen: + return NULL; } diff --git a/src/gallium/state_trackers/python/st_device.h b/src/gallium/state_trackers/python/st_device.h index de9e0215d8..6ec7409b11 100644 --- a/src/gallium/state_trackers/python/st_device.h +++ b/src/gallium/state_trackers/python/st_device.h @@ -47,7 +47,8 @@ struct st_surface }; -struct st_context { +struct st_context +{ struct st_device *st_dev; struct pipe_context *pipe; @@ -72,13 +73,11 @@ struct st_context { }; -struct st_device { +struct st_device +{ /* FIXME: we also need to refcount for textures and surfaces... */ struct pipe_reference reference; - const struct st_winsys *st_ws; - - struct pipe_screen *real_screen; struct pipe_screen *screen; }; diff --git a/src/gallium/state_trackers/python/st_hardpipe_winsys.c b/src/gallium/state_trackers/python/st_hardpipe_winsys.c index a3110a19d5..0bf7c51613 100644 --- a/src/gallium/state_trackers/python/st_hardpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_hardpipe_winsys.c @@ -207,16 +207,11 @@ st_hardpipe_load(void) #endif -static struct pipe_screen * -st_hardpipe_screen_create(void) +struct pipe_screen * +st_hardware_screen_create(void) { if(st_hardpipe_load()) return pfnGetGalliumScreenMESA(); else - return st_softpipe_winsys.screen_create(); + return st_software_screen_create(); } - - -const struct st_winsys st_hardpipe_winsys = { - &st_hardpipe_screen_create -}; diff --git a/src/gallium/state_trackers/python/st_llvmpipe_winsys.c b/src/gallium/state_trackers/python/st_llvmpipe_winsys.c deleted file mode 100644 index 5d83b5a9e1..0000000000 --- a/src/gallium/state_trackers/python/st_llvmpipe_winsys.c +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************************** - * - * Copyright 2010 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/** - * @file - * Llvmpipe support. - * - * @author Jose Fonseca - */ - - -#include "pipe/p_format.h" -#include "pipe/p_context.h" -#include "util/u_inlines.h" -#include "util/u_math.h" -#include "util/u_memory.h" -#include "llvmpipe/lp_winsys.h" -#include "st_winsys.h" - - -static boolean -llvmpipe_ws_is_displaytarget_format_supported( struct llvmpipe_winsys *ws, - enum pipe_format format ) -{ - return FALSE; -} - - -static void * -llvmpipe_ws_displaytarget_map(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt, - unsigned flags ) -{ - assert(0); - return NULL; -} - - -static void -llvmpipe_ws_displaytarget_unmap(struct llvmpipe_winsys *ws, - struct llvmpipe_displaytarget *dt ) -{ - assert(0); -} - - -static void -llvmpipe_ws_displaytarget_destroy(struct llvmpipe_winsys *winsys, - struct llvmpipe_displaytarget *dt) -{ - assert(0); -} - - -static struct llvmpipe_displaytarget * -llvmpipe_ws_displaytarget_create(struct llvmpipe_winsys *winsys, - enum pipe_format format, - unsigned width, unsigned height, - unsigned alignment, - unsigned *stride) -{ - return NULL; -} - - -static void -llvmpipe_ws_displaytarget_display(struct llvmpipe_winsys *winsys, - struct llvmpipe_displaytarget *dt, - void *context_private) -{ - assert(0); -} - - -static void -llvmpipe_ws_destroy(struct llvmpipe_winsys *winsys) -{ - FREE(winsys); -} - - -static struct pipe_screen * -st_llvmpipe_screen_create(void) -{ - static struct llvmpipe_winsys *winsys; - struct pipe_screen *screen; - - winsys = CALLOC_STRUCT(llvmpipe_winsys); - if (!winsys) - goto no_winsys; - - winsys->destroy = llvmpipe_ws_destroy; - winsys->is_displaytarget_format_supported = llvmpipe_ws_is_displaytarget_format_supported; - winsys->displaytarget_create = llvmpipe_ws_displaytarget_create; - winsys->displaytarget_map = llvmpipe_ws_displaytarget_map; - winsys->displaytarget_unmap = llvmpipe_ws_displaytarget_unmap; - winsys->displaytarget_display = llvmpipe_ws_displaytarget_display; - winsys->displaytarget_destroy = llvmpipe_ws_displaytarget_destroy; - - screen = llvmpipe_create_screen(winsys); - if (!screen) - goto no_screen; - - return screen; - -no_screen: - FREE(winsys); -no_winsys: - return NULL; -} - - - -const struct st_winsys st_softpipe_winsys = { - &st_llvmpipe_screen_create -}; diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c index 81676bc3a4..cd3e786f1a 100644 --- a/src/gallium/state_trackers/python/st_softpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c @@ -26,18 +26,45 @@ * **************************************************************************/ -/** - * @file - * Softpipe support. - * - * @author Keith Whitwell - * @author Brian Paul - * @author Jose Fonseca - */ - -#include "softpipe/sp_winsys.h" +#include "util/u_debug.h" +#include "softpipe/sp_public.h" +#include "llvmpipe/lp_public.h" +#include "state_tracker/sw_winsys.h" +#include "null/null_sw_winsys.h" #include "st_winsys.h" -const struct st_winsys st_softpipe_winsys = { - &softpipe_create_screen_malloc -}; + +struct pipe_screen * +st_software_screen_create(void) +{ + struct sw_winsys *ws; + const char *default_driver; + const char *driver; + struct pipe_screen *screen = NULL; + +#if defined(HAVE_LLVMPIPE) + default_driver = "llvmpipe"; +#elif defined(HAVE_SOFTPIPE) + default_driver = "softpipe"; +#endif + + ws = null_sw_create(); + if(!ws) + return NULL; + + driver = debug_get_option("GALLIUM_DRIVER", default_driver); + +#ifdef HAVE_LLVMPIPE + if (strcmp(driver, "llvmpipe") == 0) { + screen = llvmpipe_create_screen(ws); + } +#endif + +#ifdef HAVE_SOFTPIPE + if (strcmp(driver, "softpipe") == 0) { + screen = softpipe_create_screen(ws); + } +#endif + + return screen; +} diff --git a/src/gallium/state_trackers/python/st_winsys.h b/src/gallium/state_trackers/python/st_winsys.h index 0c7b6a200e..e1a99383a4 100644 --- a/src/gallium/state_trackers/python/st_winsys.h +++ b/src/gallium/state_trackers/python/st_winsys.h @@ -31,19 +31,13 @@ struct pipe_screen; -struct pipe_context; -struct st_winsys -{ - struct pipe_screen * - (*screen_create)(void); -}; +struct pipe_screen * +st_hardware_screen_create(void); - -extern const struct st_winsys st_softpipe_winsys; - -extern const struct st_winsys st_hardpipe_winsys; +struct pipe_screen * +st_software_screen_create(void); #endif /* ST_WINSYS_H_ */ -- cgit v1.2.3 From 431a2f99bc9d4ab567c1feaac9360c09c1dcdfde Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 10:32:16 +0000 Subject: target-helpers: helper for injecting common debug layers Add a helper gallium_wrap_screen() for injecting the commonly used extra layers into a gallium stack. Currently that's just the trace module and identity layer, but there could be more in the future, eg. a validation layer. --- src/gallium/auxiliary/Makefile | 1 + src/gallium/auxiliary/SConscript | 1 + src/gallium/auxiliary/target-helpers/swrast_xlib.c | 13 +---- src/gallium/auxiliary/target-helpers/wrap_screen.c | 65 ++++++++++++++++++++++ src/gallium/auxiliary/target-helpers/wrap_screen.h | 16 ++++++ 5 files changed, 85 insertions(+), 11 deletions(-) create mode 100644 src/gallium/auxiliary/target-helpers/wrap_screen.c create mode 100644 src/gallium/auxiliary/target-helpers/wrap_screen.h (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index c84e8d781d..89b15d41b7 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -133,6 +133,7 @@ C_SOURCES = \ vl/vl_csc.c \ vl/vl_shader_build.c \ target-helpers/swrast_xlib.c + target-helpers/wrap_screen.c GALLIVM_SOURCES = \ gallivm/lp_bld_alpha.c \ diff --git a/src/gallium/auxiliary/SConscript b/src/gallium/auxiliary/SConscript index d6185bcb5e..2be16776fb 100644 --- a/src/gallium/auxiliary/SConscript +++ b/src/gallium/auxiliary/SConscript @@ -175,6 +175,7 @@ source = [ 'vl/vl_compositor.c', 'vl/vl_csc.c', 'vl/vl_shader_build.c', + 'target-helpers/wrap_screen.c', ] if drawllvm: diff --git a/src/gallium/auxiliary/target-helpers/swrast_xlib.c b/src/gallium/auxiliary/target-helpers/swrast_xlib.c index bf30ff68c1..3cab901272 100644 --- a/src/gallium/auxiliary/target-helpers/swrast_xlib.c +++ b/src/gallium/auxiliary/target-helpers/swrast_xlib.c @@ -37,9 +37,8 @@ #include "util/u_debug.h" #include "softpipe/sp_public.h" #include "llvmpipe/lp_public.h" -#include "identity/id_public.h" -#include "trace/tr_public.h" #include "cell/ppu/cell_public.h" +#include "wrap_screen.h" /* Helper function to build a subset of a driver stack consisting of @@ -84,15 +83,7 @@ swrast_xlib_create_screen( Display *display ) /* Inject any wrapping layers we want to here: */ - if (debug_get_bool_option("GALLIUM_WRAP", FALSE)) { - screen = identity_screen_create(screen); - } - - if (debug_get_bool_option("GALLIUM_TRACE", FALSE)) { - screen = trace_screen_create( screen ); - } - - return screen; + return gallium_wrap_screen( screen ); fail: if (winsys) diff --git a/src/gallium/auxiliary/target-helpers/wrap_screen.c b/src/gallium/auxiliary/target-helpers/wrap_screen.c new file mode 100644 index 0000000000..5fe3013938 --- /dev/null +++ b/src/gallium/auxiliary/target-helpers/wrap_screen.c @@ -0,0 +1,65 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * + **************************************************************************/ + +/* + * Authors: + * Keith Whitwell + */ + +#include "target-helpers/wrap_screen.h" +#include "trace/tr_public.h" +#include "identity/id_public.h" +#include "util/u_debug.h" + + +/* Centralized code to inject common wrapping layers: + */ +struct pipe_screen * +gallium_wrap_screen( struct pipe_screen *screen ) +{ + /* Screen wrapping functions are required not to fail. If it is + * impossible to wrap a screen, the unwrapped screen should be + * returned instead. Any failure condition should be returned in + * an OUT argument. + * + * Otherwise it is really messy trying to clean up in this code. + */ + if (debug_get_bool_option("GALLIUM_WRAP", FALSE)) { + screen = identity_screen_create(screen); + } + + if (debug_get_bool_option("GALLIUM_TRACE", FALSE)) { + screen = trace_screen_create( screen ); + } + + return screen; +} + + + + diff --git a/src/gallium/auxiliary/target-helpers/wrap_screen.h b/src/gallium/auxiliary/target-helpers/wrap_screen.h new file mode 100644 index 0000000000..7e76beb7c5 --- /dev/null +++ b/src/gallium/auxiliary/target-helpers/wrap_screen.h @@ -0,0 +1,16 @@ +#ifndef WRAP_SCREEN_HELPER_H +#define WRAP_SCREEN_HELPER_H + +#include "pipe/p_compiler.h" + +struct pipe_screen; + +/* Centralized code to inject common wrapping layers. Other layers + * can be introduced by specific targets, but these are the generally + * helpful ones we probably want everywhere. + */ +struct pipe_screen * +gallium_wrap_screen( struct pipe_screen *screen ); + + +#endif -- cgit v1.2.3 From 7e29bef7dc7669bdf44f97e235c7a7aed8c52be8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 10:37:41 +0000 Subject: ws/gdi: add include --- src/gallium/winsys/gdi/gdi_sw_winsys.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.h b/src/gallium/winsys/gdi/gdi_sw_winsys.h index 8ecca7bbc3..4bbcb47848 100644 --- a/src/gallium/winsys/gdi/gdi_sw_winsys.h +++ b/src/gallium/winsys/gdi/gdi_sw_winsys.h @@ -1,6 +1,8 @@ #ifndef GDI_SW_WINSYS_H #define GDI_SW_WINSYS_H +#include + #include "pipe/p_compiler.h" #include "state_tracker/sw_winsys.h" -- cgit v1.2.3 From de27e272f42f8f453588edbcb98f3e510dad869b Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 10:43:00 +0000 Subject: gallium: remove trace module injection from various state trackers Components such as state trackers, drivers, etc, should be free to be recombined in arbtrary ways to build driver stacks. They should not be reaching out and trying to build the stack themselves - this is now expected to be handled by the "target" abstraction. --- src/gallium/state_trackers/python/st_device.c | 5 ----- src/gallium/state_trackers/wgl/stw_device.c | 14 +++----------- src/gallium/state_trackers/wgl/stw_device.h | 4 ---- src/gallium/state_trackers/wgl/stw_ext_gallium.c | 5 ----- src/gallium/state_trackers/wgl/stw_framebuffer.c | 19 ------------------- 5 files changed, 3 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index 335e8e7f0d..3aeb6226d0 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -34,7 +34,6 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_simple_shaders.h" -#include "trace/tr_public.h" #include "st_device.h" #include "st_winsys.h" @@ -85,10 +84,6 @@ st_device_create(boolean hardware) else screen = st_software_screen_create(); - screen = trace_screen_create(screen); - if (!screen) - goto no_screen; - st_dev = CALLOC_STRUCT(st_device); if (!st_dev) goto no_device; diff --git a/src/gallium/state_trackers/wgl/stw_device.c b/src/gallium/state_trackers/wgl/stw_device.c index 472a2a5379..ea300f27cb 100644 --- a/src/gallium/state_trackers/wgl/stw_device.c +++ b/src/gallium/state_trackers/wgl/stw_device.c @@ -33,11 +33,6 @@ #include "pipe/p_screen.h" #include "state_tracker/st_public.h" -#ifdef DEBUG -#include "trace/tr_screen.h" -#include "trace/tr_texture.h" -#endif - #include "stw_device.h" #include "stw_winsys.h" #include "stw_pixelformat.h" @@ -107,13 +102,10 @@ stw_init(const struct stw_winsys *stw_winsys) if(stw_winsys->get_adapter_luid) stw_winsys->get_adapter_luid(screen, &stw_dev->AdapterLuid); -#ifdef DEBUG - stw_dev->screen = trace_screen_create(screen); - stw_dev->trace_running = stw_dev->screen != screen ? TRUE : FALSE; -#else stw_dev->screen = screen; -#endif - + + /* XXX + */ stw_dev->screen->flush_frontbuffer = &stw_flush_frontbuffer; pipe_mutex_init( stw_dev->ctx_mutex ); diff --git a/src/gallium/state_trackers/wgl/stw_device.h b/src/gallium/state_trackers/wgl/stw_device.h index a83841f6b7..2e9ba197df 100644 --- a/src/gallium/state_trackers/wgl/stw_device.h +++ b/src/gallium/state_trackers/wgl/stw_device.h @@ -48,10 +48,6 @@ struct stw_device struct pipe_screen *screen; -#ifdef DEBUG - boolean trace_running; -#endif - LUID AdapterLuid; struct stw_pixelformat_info pixelformats[STW_MAX_PIXELFORMATS]; diff --git a/src/gallium/state_trackers/wgl/stw_ext_gallium.c b/src/gallium/state_trackers/wgl/stw_ext_gallium.c index 8dd63f124a..5ecbd8048d 100644 --- a/src/gallium/state_trackers/wgl/stw_ext_gallium.c +++ b/src/gallium/state_trackers/wgl/stw_ext_gallium.c @@ -31,11 +31,6 @@ #include "stw_winsys.h" #include "stw_ext_gallium.h" -#ifdef DEBUG -#include "trace/tr_screen.h" -#include "trace/tr_context.h" -#endif - struct pipe_screen * APIENTRY wglGetGalliumScreenMESA(void) diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c index 02de21ccb2..4f1629de2f 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c @@ -34,11 +34,6 @@ #include "state_tracker/st_context.h" #include "state_tracker/st_public.h" -#ifdef DEBUG -#include "trace/tr_screen.h" -#include "trace/tr_texture.h" -#endif - #include "stw_icd.h" #include "stw_framebuffer.h" #include "stw_device.h" @@ -495,13 +490,6 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data) surface = (struct pipe_surface *)data->pPrivateData; -#ifdef DEBUG - if(stw_dev->trace_running) { - screen = trace_screen(screen)->screen; - surface = trace_surface(surface)->surface; - } -#endif - if(data->hSharedSurface != fb->hSharedSurface) { if(fb->shared_surface) { stw_dev->stw_winsys->shared_surface_close(screen, fb->shared_surface); @@ -563,13 +551,6 @@ stw_framebuffer_present_locked(HDC hdc, else { struct pipe_screen *screen = stw_dev->screen; -#ifdef DEBUG - if(stw_dev->trace_running) { - screen = trace_screen(screen)->screen; - surface = trace_surface(surface)->surface; - } -#endif - stw_dev->stw_winsys->present( screen, surface, hdc ); stw_framebuffer_update(fb); -- cgit v1.2.3 From 6b707667c853c6c0ded3715050a01cfdbd4883c2 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 10:56:51 +0000 Subject: python: Handle the possibility that no driver is selected. --- src/gallium/state_trackers/python/st_softpipe_winsys.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c index cd3e786f1a..985374190c 100644 --- a/src/gallium/state_trackers/python/st_softpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c @@ -46,6 +46,8 @@ st_software_screen_create(void) default_driver = "llvmpipe"; #elif defined(HAVE_SOFTPIPE) default_driver = "softpipe"; +#else + default_driver = ""; #endif ws = null_sw_create(); -- cgit v1.2.3 From e8d884eab9b96f2db647363f17649ff35570c710 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 11:34:09 +0000 Subject: scons: Fixup the libgl-gdi build. --- SConstruct | 2 -- src/gallium/targets/SConscript | 10 +++++----- src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c | 3 ++- src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c | 3 ++- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/SConstruct b/SConstruct index 606be015c0..6ed44ddd06 100644 --- a/SConstruct +++ b/SConstruct @@ -53,8 +53,6 @@ opts.Add(ListVariable('drivers', 'pipe drivers to build', default_drivers, ['softpipe', 'failover', 'svga', 'i915', 'i965', 'trace', 'r300', 'identity', 'llvmpipe'])) opts.Add(ListVariable('winsys', 'winsys drivers to build', default_winsys, ['xlib', 'vmware', 'intel', 'i965', 'gdi', 'radeon'])) -opts.Add(ListVariable('targets', 'target drivers to build', 'all', - ['xlib'])) opts.Add(EnumVariable('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0'))) diff --git a/src/gallium/targets/SConscript b/src/gallium/targets/SConscript index 266d705f89..df62fc65fb 100644 --- a/src/gallium/targets/SConscript +++ b/src/gallium/targets/SConscript @@ -5,12 +5,12 @@ Import('*') # 'drm/SConscript', # ]) -if 'xlib' in env['targets']: +if 'xlib' in env['winsys']: SConscript([ 'libgl-xlib/SConscript', ]) -#if 'gdi' in env['winsys']: -# SConscript([ -# 'gdi/SConscript', -# ]) +if 'gdi' in env['winsys']: + SConscript([ + 'libgl-gdi/SConscript', + ]) diff --git a/src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c b/src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c index f20c2614e2..29316a1ce2 100644 --- a/src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/targets/libgl-gdi/gdi_llvmpipe_winsys.c @@ -37,9 +37,10 @@ #include #include "stw_winsys.h" -#include "gdi_sw_winsys.h" +#include "gdi/gdi_sw_winsys.h" #include "llvmpipe/lp_texture.h" #include "llvmpipe/lp_screen.h" +#include "llvmpipe/lp_public.h" static struct pipe_screen * diff --git a/src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c b/src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c index 5c5c154c7f..dfe60195d9 100644 --- a/src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c +++ b/src/gallium/targets/libgl-gdi/gdi_softpipe_winsys.c @@ -37,9 +37,10 @@ #include #include "stw_winsys.h" -#include "gdi_sw_winsys.h" +#include "gdi/gdi_sw_winsys.h" #include "softpipe/sp_texture.h" #include "softpipe/sp_screen.h" +#include "softpipe/sp_public.h" static struct pipe_screen * -- cgit v1.2.3 From e47a619ea262ba1c49f86525b2855a64a5e36a42 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 11:13:03 +0000 Subject: ws/xlib: remove dead lines --- src/gallium/winsys/xlib/xlib_sw_winsys.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src') diff --git a/src/gallium/winsys/xlib/xlib_sw_winsys.c b/src/gallium/winsys/xlib/xlib_sw_winsys.c index 0ee589943e..29c642706a 100644 --- a/src/gallium/winsys/xlib/xlib_sw_winsys.c +++ b/src/gallium/winsys/xlib/xlib_sw_winsys.c @@ -32,12 +32,6 @@ * Brian Paul */ - - - -#undef ASSERT -#undef Elements - #include "pipe/p_format.h" #include "pipe/p_context.h" #include "util/u_inlines.h" -- cgit v1.2.3 From 0731d14a43191233e91fbebe5b47b13faa655f9f Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 10 Mar 2010 11:49:11 +0000 Subject: target-helpers: remove swrast_xlib.c helper This was a good idea, but ended up tying the build systems in knots. We can revisit this later, in particular if we can put in place dummy implementations of cell_create_screen(), llvmpipe_create_screen() which just return NULL if the driver isn't available. In the meantime, just duplicate this smallish function in the two places it was being called. --- src/gallium/auxiliary/Makefile | 1 - src/gallium/auxiliary/target-helpers/swrast_xlib.c | 97 ---------------------- src/gallium/auxiliary/target-helpers/swrast_xlib.h | 15 ---- src/gallium/state_trackers/egl/x11/native_ximage.c | 60 ++++++++++++- src/gallium/targets/libgl-xlib/xlib.c | 63 +++++++++++++- 5 files changed, 121 insertions(+), 115 deletions(-) delete mode 100644 src/gallium/auxiliary/target-helpers/swrast_xlib.c delete mode 100644 src/gallium/auxiliary/target-helpers/swrast_xlib.h (limited to 'src') diff --git a/src/gallium/auxiliary/Makefile b/src/gallium/auxiliary/Makefile index 89b15d41b7..0ac18426d9 100644 --- a/src/gallium/auxiliary/Makefile +++ b/src/gallium/auxiliary/Makefile @@ -132,7 +132,6 @@ C_SOURCES = \ vl/vl_compositor.c \ vl/vl_csc.c \ vl/vl_shader_build.c \ - target-helpers/swrast_xlib.c target-helpers/wrap_screen.c GALLIVM_SOURCES = \ diff --git a/src/gallium/auxiliary/target-helpers/swrast_xlib.c b/src/gallium/auxiliary/target-helpers/swrast_xlib.c deleted file mode 100644 index 3cab901272..0000000000 --- a/src/gallium/auxiliary/target-helpers/swrast_xlib.c +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ - -/* - * Authors: - * Keith Whitwell - */ - -#include "swrast_xlib.h" - -#include "state_tracker/xlib_sw_winsys.h" -#include "util/u_debug.h" -#include "softpipe/sp_public.h" -#include "llvmpipe/lp_public.h" -#include "cell/ppu/cell_public.h" -#include "wrap_screen.h" - - -/* Helper function to build a subset of a driver stack consisting of - * one of the software rasterizers (cell, llvmpipe, softpipe) and the - * xlib winsys. - * - * This can be called by any target that builds on top of this - * combination. - */ -struct pipe_screen * -swrast_xlib_create_screen( Display *display ) -{ - struct sw_winsys *winsys; - struct pipe_screen *screen = NULL; - - /* Create the underlying winsys, which performs presents to Xlib - * drawables: - */ - winsys = xlib_create_sw_winsys( display ); - if (winsys == NULL) - return NULL; - - /* Create a software rasterizer on top of that winsys: - */ -#if defined(GALLIUM_CELL) - if (screen == NULL && - !debug_get_bool_option("GALLIUM_NO_CELL", FALSE)) - screen = cell_create_screen( winsys ); -#endif - -#if defined(GALLIUM_LLVMPIPE) - if (screen == NULL && - !debug_get_bool_option("GALLIUM_NO_LLVM", FALSE)) - screen = llvmpipe_create_screen( winsys ); -#endif - - if (screen == NULL) - screen = softpipe_create_screen( winsys ); - - if (screen == NULL) - goto fail; - - /* Inject any wrapping layers we want to here: - */ - return gallium_wrap_screen( screen ); - -fail: - if (winsys) - winsys->destroy( winsys ); - - return NULL; -} - - - - diff --git a/src/gallium/auxiliary/target-helpers/swrast_xlib.h b/src/gallium/auxiliary/target-helpers/swrast_xlib.h deleted file mode 100644 index 3a0f713d54..0000000000 --- a/src/gallium/auxiliary/target-helpers/swrast_xlib.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef SWRAST_XLIB_HELPER_H -#define SWRAST_XLIB_HELPER_H - -#include -#include "pipe/p_compiler.h" - -/* Helper to build the xlib winsys, choose between the software - * rasterizers and construct the lower part of a driver stack. - * - * Just add a state tracker. - */ -struct pipe_screen *swrast_xlib_create_screen( Display *display ); - - -#endif diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c index 544b3b4276..e0d12acabe 100644 --- a/src/gallium/state_trackers/egl/x11/native_ximage.c +++ b/src/gallium/state_trackers/egl/x11/native_ximage.c @@ -34,7 +34,11 @@ #include "pipe/p_compiler.h" #include "util/u_inlines.h" #include "state_tracker/xlib_sw_winsys.h" -#include "target-helpers/swrast_xlib.h" +#include "target-helpers/wrap_screen.h" +#include "util/u_debug.h" +#include "softpipe/sp_public.h" +#include "llvmpipe/lp_public.h" +#include "cell/ppu/cell_public.h" #include "egllog.h" #include "native_x11.h" @@ -614,6 +618,60 @@ ximage_display_destroy(struct native_display *ndpy) free(xdpy); } + +/* Helper function to build a subset of a driver stack consisting of + * one of the software rasterizers (cell, llvmpipe, softpipe) and the + * xlib winsys. + * + * This function could be shared, but currently causes headaches for + * the build systems, particularly scons if we try. + * + * Long term, want to avoid having global #defines for things like + * GALLIUM_LLVMPIPE, GALLIUM_CELL, etc. Scons already eliminates + * those #defines, so things that are painful for it now are likely to + * be painful for other build systems in the future. + */ +static struct pipe_screen * +swrast_xlib_create_screen( Display *display ) +{ + struct sw_winsys *winsys; + struct pipe_screen *screen = NULL; + + /* Create the underlying winsys, which performs presents to Xlib + * drawables: + */ + winsys = xlib_create_sw_winsys( display ); + if (winsys == NULL) + return NULL; + + /* Create a software rasterizer on top of that winsys. Use + * llvmpipe if it is available. + */ +#if defined(GALLIUM_LLVMPIPE) + if (screen == NULL && + !debug_get_bool_option("GALLIUM_NO_LLVM", FALSE)) + screen = llvmpipe_create_screen( winsys ); +#endif + + if (screen == NULL) + screen = softpipe_create_screen( winsys ); + + if (screen == NULL) + goto fail; + + /* Inject any wrapping layers we want to here: + */ + return gallium_wrap_screen( screen ); + +fail: + if (winsys) + winsys->destroy( winsys ); + + return NULL; +} + + + struct native_display * x11_create_ximage_display(EGLNativeDisplayType dpy, struct native_event_handler *event_handler) diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c index 54764440e7..05dc8db57d 100644 --- a/src/gallium/targets/libgl-xlib/xlib.c +++ b/src/gallium/targets/libgl-xlib/xlib.c @@ -31,12 +31,73 @@ * Keith Whitwell */ #include "pipe/p_compiler.h" -#include "target-helpers/swrast_xlib.h" +#include "state_tracker/xlib_sw_winsys.h" +#include "util/u_debug.h" +#include "softpipe/sp_public.h" +#include "llvmpipe/lp_public.h" +#include "cell/ppu/cell_public.h" +#include "target-helpers/wrap_screen.h" #include "xm_public.h" /* advertise OpenGL support */ PUBLIC const int st_api_OpenGL = 1; + +/* Helper function to build a subset of a driver stack consisting of + * one of the software rasterizers (cell, llvmpipe, softpipe) and the + * xlib winsys. + * + * This function could be shared, but currently causes headaches for + * the build systems, particularly scons if we try. Long term, want + * to avoid having global #defines for things like GALLIUM_LLVMPIPE, + * GALLIUM_CELL, etc. Scons already eliminates those #defines, so + * things that are painful for it now are likely to be painful for + * other build systems in the future. + */ +static struct pipe_screen * +swrast_xlib_create_screen( Display *display ) +{ + struct sw_winsys *winsys; + struct pipe_screen *screen = NULL; + + /* Create the underlying winsys, which performs presents to Xlib + * drawables: + */ + winsys = xlib_create_sw_winsys( display ); + if (winsys == NULL) + return NULL; + + /* Create a software rasterizer on top of that winsys: + */ +#if defined(GALLIUM_CELL) + if (screen == NULL && + !debug_get_bool_option("GALLIUM_NO_CELL", FALSE)) + screen = cell_create_screen( winsys ); +#endif + +#if defined(GALLIUM_LLVMPIPE) + if (screen == NULL && + !debug_get_bool_option("GALLIUM_NO_LLVM", FALSE)) + screen = llvmpipe_create_screen( winsys ); +#endif + + if (screen == NULL) + screen = softpipe_create_screen( winsys ); + + if (screen == NULL) + goto fail; + + /* Inject any wrapping layers we want to here: + */ + return gallium_wrap_screen( screen ); + +fail: + if (winsys) + winsys->destroy( winsys ); + + return NULL; +} + struct xm_driver xlib_driver = { .create_pipe_screen = swrast_xlib_create_screen, -- cgit v1.2.3 From fc08d13fdcfe637064e92f962b1704fde193e70b Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 11:52:20 +0000 Subject: trace: Make tr_public.h c++ friendly. --- src/gallium/drivers/trace/tr_public.h | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/trace/tr_public.h b/src/gallium/drivers/trace/tr_public.h index da31c24e64..62e217097d 100644 --- a/src/gallium/drivers/trace/tr_public.h +++ b/src/gallium/drivers/trace/tr_public.h @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2009 VMware, Inc. + * Copyright 2010 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -11,27 +11,35 @@ * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * **************************************************************************/ #ifndef TR_PUBLIC_H #define TR_PUBLIC_H +#ifdef __cplusplus +extern "C" { +#endif + struct pipe_screen; struct pipe_context; struct pipe_screen * trace_screen_create(struct pipe_screen *screen); +#ifdef __cplusplus +} +#endif + #endif /* TR_PUBLIC_H */ -- cgit v1.2.3 From 7b8641bbba995bc3fc299b1018720caa1e91cb9f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 12:00:13 +0000 Subject: python: More build fixes. --- src/gallium/SConscript | 3 +++ src/gallium/state_trackers/python/SConscript | 3 ++- src/gallium/state_trackers/python/st_device.c | 5 +++++ src/gallium/winsys/SConscript | 4 ---- 4 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/SConscript b/src/gallium/SConscript index ba541f9636..c833d83e65 100644 --- a/src/gallium/SConscript +++ b/src/gallium/SConscript @@ -7,6 +7,9 @@ SConscript('auxiliary/SConscript') for driver in env['drivers']: SConscript(os.path.join('drivers', driver, 'SConscript')) +# Needed by some state trackers +SConscript('winsys/null/SConscript') + SConscript('state_trackers/python/SConscript') if platform != 'embedded': SConscript('state_trackers/glx/xlib/SConscript') diff --git a/src/gallium/state_trackers/python/SConscript b/src/gallium/state_trackers/python/SConscript index 8010f122b7..2b44c13737 100644 --- a/src/gallium/state_trackers/python/SConscript +++ b/src/gallium/state_trackers/python/SConscript @@ -38,8 +38,9 @@ if 'python' in env['statetrackers']: ] env.Prepend(LIBS = [ + ws_null, trace, - gallium + gallium, ]) if 'llvmpipe' in env['drivers']: diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index 3aeb6226d0..335e8e7f0d 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -34,6 +34,7 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "util/u_simple_shaders.h" +#include "trace/tr_public.h" #include "st_device.h" #include "st_winsys.h" @@ -84,6 +85,10 @@ st_device_create(boolean hardware) else screen = st_software_screen_create(); + screen = trace_screen_create(screen); + if (!screen) + goto no_screen; + st_dev = CALLOC_STRUCT(st_device); if (!st_dev) goto no_device; diff --git a/src/gallium/winsys/SConscript b/src/gallium/winsys/SConscript index 4567d17447..30c3378dff 100644 --- a/src/gallium/winsys/SConscript +++ b/src/gallium/winsys/SConscript @@ -1,9 +1,5 @@ Import('*') -SConscript([ - 'null/SConscript', -]) - if env['dri']: SConscript([ 'drm/SConscript', -- cgit v1.2.3 From 986ce8f1c118007062cacd4b4bad54657cd09a65 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 12:05:10 +0000 Subject: python: Remove broken link hack. --- src/gallium/state_trackers/python/SConscript | 1 + src/gallium/state_trackers/python/st_hardpipe_winsys.c | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/gallium/state_trackers/python/SConscript b/src/gallium/state_trackers/python/SConscript index 2b44c13737..781f54bf2b 100644 --- a/src/gallium/state_trackers/python/SConscript +++ b/src/gallium/state_trackers/python/SConscript @@ -24,6 +24,7 @@ if 'python' in env['statetrackers']: 'ws2_32', ]) else: + env.Append(CPPDEFINES = ['GCC_HASCLASSVISIBILITY']) env.Append(LIBS = [ 'GL', 'X11', diff --git a/src/gallium/state_trackers/python/st_hardpipe_winsys.c b/src/gallium/state_trackers/python/st_hardpipe_winsys.c index 0bf7c51613..b141177b79 100644 --- a/src/gallium/state_trackers/python/st_hardpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_hardpipe_winsys.c @@ -54,11 +54,6 @@ static PFNGETGALLIUMSCREENMESAPROC pfnGetGalliumScreenMESA = NULL; static PFNCREATEGALLIUMCONTEXTMESAPROC pfnCreateGalliumContextMESA = NULL; -/* XXX: Force init_gallium symbol to be linked */ -extern void init_gallium(void); -void (*force_init_gallium_linkage)(void) = &init_gallium; - - #ifdef PIPE_OS_WINDOWS static INLINE boolean -- cgit v1.2.3 From c282c0b6e40f9ed3cbf9d4c4eeb01d1896763246 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 10 Mar 2010 12:24:03 +0000 Subject: softpipe: Prevent NULL dereference. --- src/gallium/drivers/softpipe/sp_state_vertex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/softpipe/sp_state_vertex.c b/src/gallium/drivers/softpipe/sp_state_vertex.c index a151758ddc..462f4d2655 100644 --- a/src/gallium/drivers/softpipe/sp_state_vertex.c +++ b/src/gallium/drivers/softpipe/sp_state_vertex.c @@ -62,7 +62,8 @@ softpipe_bind_vertex_elements_state(struct pipe_context *pipe, softpipe->dirty |= SP_NEW_VERTEX; - draw_set_vertex_elements(softpipe->draw, sp_velems->count, sp_velems->velem); + if (sp_velems) + draw_set_vertex_elements(softpipe->draw, sp_velems->count, sp_velems->velem); } void -- cgit v1.2.3 From 504ad3606dfd5891ee04d85d3af2c233fd362c51 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 10 Mar 2010 12:04:00 +0100 Subject: svga: Check if vertex elements has been bound before using it. --- src/gallium/drivers/svga/svga_state_need_swtnl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_state_need_swtnl.c b/src/gallium/drivers/svga/svga_state_need_swtnl.c index 10d473584d..dfaab53aef 100644 --- a/src/gallium/drivers/svga/svga_state_need_swtnl.c +++ b/src/gallium/drivers/svga/svga_state_need_swtnl.c @@ -76,6 +76,11 @@ static int update_need_swvfetch( struct svga_context *svga, unsigned i; boolean need_swvfetch = FALSE; + if (!svga->curr.velems) { + /* No vertex elements bound. */ + return 0; + } + for (i = 0; i < svga->curr.velems->count; i++) { svga->state.sw.ve_format[i] = svga_translate_vertex_format(svga->curr.velems->velem[i].src_format); if (svga->state.sw.ve_format[i] == SVGA3D_DECLTYPE_MAX) { -- cgit v1.2.3 From 9b348d0ed125a22be3f318ac60cef6f201edfdab Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 10 Mar 2010 12:05:25 +0100 Subject: svga: Disable debug message. --- src/gallium/drivers/svga/svga_pipe_sampler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index acba2b8f9d..1a8ef296ca 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -155,7 +155,7 @@ static void svga_bind_sampler_states(struct pipe_context *pipe, /* Check for no-op */ if (num == svga->curr.num_samplers && !memcmp(svga->curr.sampler, sampler, num * sizeof(void *))) { - debug_printf("sampler noop\n"); + if (0) debug_printf("sampler noop\n"); return; } -- cgit v1.2.3